This commit is contained in:
158
node_modules/decap-cms-backend-proxy/CHANGELOG.md
generated
vendored
Normal file
158
node_modules/decap-cms-backend-proxy/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,158 @@
|
||||
# Change Log
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [3.1.4](https://github.com/decaporg/decap-cms/compare/decap-cms-backend-proxy@3.1.3...decap-cms-backend-proxy@3.1.4) (2024-08-13)
|
||||
|
||||
### Reverts
|
||||
|
||||
- Revert "Update dependencies (#7264)" ([22d483a](https://github.com/decaporg/decap-cms/commit/22d483a5b0c654071ae05735ac4f49abdc13d38c)), closes [#7264](https://github.com/decaporg/decap-cms/issues/7264)
|
||||
|
||||
## [3.1.3](https://github.com/decaporg/decap-cms/compare/decap-cms-backend-proxy@3.1.2...decap-cms-backend-proxy@3.1.3) (2024-08-13)
|
||||
|
||||
**Note:** Version bump only for package decap-cms-backend-proxy
|
||||
|
||||
## [3.1.2](https://github.com/decaporg/decap-cms/compare/decap-cms-backend-proxy@3.1.1...decap-cms-backend-proxy@3.1.2) (2024-06-27)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- display custom logo when using a proxy server ([#7235](https://github.com/decaporg/decap-cms/issues/7235)) ([7feca52](https://github.com/decaporg/decap-cms/commit/7feca52605315a764dfbe1b65c6782a644191dd4))
|
||||
|
||||
## [3.1.1](https://github.com/decaporg/decap-cms/compare/decap-cms-backend-proxy@3.1.0-beta.1...decap-cms-backend-proxy@3.1.1) (2024-03-21)
|
||||
|
||||
**Note:** Version bump only for package decap-cms-backend-proxy
|
||||
|
||||
# [3.1.0](https://github.com/decaporg/decap-cms/compare/decap-cms-backend-proxy@3.1.0-beta.1...decap-cms-backend-proxy@3.1.0) (2024-02-01)
|
||||
|
||||
**Note:** Version bump only for package decap-cms-backend-proxy
|
||||
|
||||
# [3.1.0-beta.1](https://github.com/decaporg/decap-cms/compare/decap-cms-backend-proxy@3.1.0-beta.0...decap-cms-backend-proxy@3.1.0-beta.1) (2024-01-31)
|
||||
|
||||
**Note:** Version bump only for package decap-cms-backend-proxy
|
||||
|
||||
# [3.1.0-beta.0](https://github.com/decaporg/decap-cms/compare/decap-cms-backend-proxy@3.1.0...decap-cms-backend-proxy@3.1.0-beta.0) (2023-10-20)
|
||||
|
||||
### Reverts
|
||||
|
||||
- Revert "chore(release): publish" ([b89fc89](https://github.com/decaporg/decap-cms/commit/b89fc894dfbb5f4136b2e5427fd25a29378a58c6))
|
||||
|
||||
## [3.0.2](https://github.com/decaporg/decap-cms/compare/decap-cms-backend-proxy@3.0.1...decap-cms-backend-proxy@3.0.2) (2023-10-13)
|
||||
|
||||
**Note:** Version bump only for package decap-cms-backend-proxy
|
||||
|
||||
## [3.0.1](https://github.com/decaporg/decap-cms/compare/decap-cms-backend-proxy@3.0.0...decap-cms-backend-proxy@3.0.1) (2023-08-25)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- update peer dependencies ([#6886](https://github.com/decaporg/decap-cms/issues/6886)) ([e580ce5](https://github.com/decaporg/decap-cms/commit/e580ce52ce5f80fa040e8fbcab7fed0744f4f695))
|
||||
|
||||
# [3.0.0](https://github.com/decaporg/decap-cms/compare/decap-cms-backend-proxy@1.3.0...decap-cms-backend-proxy@3.0.0) (2023-08-18)
|
||||
|
||||
**Note:** Version bump only for package decap-cms-backend-proxy
|
||||
|
||||
# [1.3.0](https://github.com/decaporg/decap-cms/compare/decap-cms-backend-proxy@1.3.0-beta.0...decap-cms-backend-proxy@1.3.0) (2023-08-18)
|
||||
|
||||
**Note:** Version bump only for package decap-cms-backend-proxy
|
||||
|
||||
# 1.3.0-beta.0 (2023-08-18)
|
||||
|
||||
### Features
|
||||
|
||||
- rename packages ([#6863](https://github.com/decaporg/decap-cms/issues/6863)) ([d515e7b](https://github.com/decaporg/decap-cms/commit/d515e7bd33216a775d96887b08c4f7b1962941bb))
|
||||
|
||||
## [1.2.4-beta.0](https://github.com/decaporg/decap-cms/compare/decap-cms-backend-proxy@1.2.3...decap-cms-backend-proxy@1.2.4-beta.0) (2023-07-27)
|
||||
|
||||
**Note:** Version bump only for package decap-cms-backend-proxy
|
||||
|
||||
## [1.2.3](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-backend-proxy/compare/decap-cms-backend-proxy@1.2.2...decap-cms-backend-proxy@1.2.3) (2021-06-01)
|
||||
|
||||
**Note:** Version bump only for package decap-cms-backend-proxy
|
||||
|
||||
## [1.2.2](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-backend-proxy/compare/decap-cms-backend-proxy@1.2.1...decap-cms-backend-proxy@1.2.2) (2021-05-31)
|
||||
|
||||
**Note:** Version bump only for package decap-cms-backend-proxy
|
||||
|
||||
## [1.2.1](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-backend-proxy/compare/decap-cms-backend-proxy@1.2.0...decap-cms-backend-proxy@1.2.1) (2021-05-19)
|
||||
|
||||
**Note:** Version bump only for package decap-cms-backend-proxy
|
||||
|
||||
# [1.2.0](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-backend-proxy/compare/decap-cms-backend-proxy@1.1.7...decap-cms-backend-proxy@1.2.0) (2021-05-04)
|
||||
|
||||
### Features
|
||||
|
||||
- added react 17 as peer dependency in packages ([#5316](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-backend-proxy/issues/5316)) ([9e42380](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-backend-proxy/commit/9e423805707321396eec137f5b732a5b07a0dd3f))
|
||||
|
||||
## [1.1.7](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-backend-proxy/compare/decap-cms-backend-proxy@1.1.6...decap-cms-backend-proxy@1.1.7) (2021-02-23)
|
||||
|
||||
**Note:** Version bump only for package decap-cms-backend-proxy
|
||||
|
||||
## [1.1.6](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-backend-proxy/compare/decap-cms-backend-proxy@1.1.5...decap-cms-backend-proxy@1.1.6) (2021-02-10)
|
||||
|
||||
**Note:** Version bump only for package decap-cms-backend-proxy
|
||||
|
||||
## [1.1.5](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-backend-proxy/compare/decap-cms-backend-proxy@1.1.4...decap-cms-backend-proxy@1.1.5) (2020-09-20)
|
||||
|
||||
**Note:** Version bump only for package decap-cms-backend-proxy
|
||||
|
||||
## [1.1.4](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-backend-proxy/compare/decap-cms-backend-proxy@1.1.3...decap-cms-backend-proxy@1.1.4) (2020-09-15)
|
||||
|
||||
**Note:** Version bump only for package decap-cms-backend-proxy
|
||||
|
||||
## 1.1.3 (2020-09-08)
|
||||
|
||||
### Reverts
|
||||
|
||||
- Revert "chore(release): publish" ([828bb16](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-backend-proxy/commit/828bb16415b8c22a34caa19c50c38b24ffe9ceae))
|
||||
|
||||
## 1.1.2 (2020-08-20)
|
||||
|
||||
### Reverts
|
||||
|
||||
- Revert "chore(release): publish" ([8262487](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-backend-proxy/commit/82624879ccbcb16610090041db28f00714d924c8))
|
||||
|
||||
## 1.1.1 (2020-07-27)
|
||||
|
||||
### Reverts
|
||||
|
||||
- Revert "chore(release): publish" ([118d50a](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-backend-proxy/commit/118d50a7a70295f25073e564b5161aa2b9883056))
|
||||
|
||||
# [1.1.0](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-backend-proxy/compare/decap-cms-backend-proxy@1.0.7...decap-cms-backend-proxy@1.1.0) (2020-06-18)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- handle token expiry ([#3847](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-backend-proxy/issues/3847)) ([285c940](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-backend-proxy/commit/285c940562548d7bc88de244123ba87ff66fba65))
|
||||
|
||||
### Features
|
||||
|
||||
- add backend status down indicator ([#3889](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-backend-proxy/issues/3889)) ([a50edc7](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-backend-proxy/commit/a50edc70553ad6afa1acee6a51996ad226443f8c))
|
||||
|
||||
## [1.0.7](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-backend-proxy/compare/decap-cms-backend-proxy@1.0.6...decap-cms-backend-proxy@1.0.7) (2020-05-19)
|
||||
|
||||
**Note:** Version bump only for package decap-cms-backend-proxy
|
||||
|
||||
## [1.0.6](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-backend-proxy/compare/decap-cms-backend-proxy@1.0.5...decap-cms-backend-proxy@1.0.6) (2020-04-06)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **backend-proxy:** fix error reporting ([#3527](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-backend-proxy/issues/3527)) ([f94dea3](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-backend-proxy/commit/f94dea386ce89f0f92744d0c4196416706999ea0))
|
||||
|
||||
## [1.0.5](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-backend-proxy/compare/decap-cms-backend-proxy@1.0.4...decap-cms-backend-proxy@1.0.5) (2020-04-01)
|
||||
|
||||
**Note:** Version bump only for package decap-cms-backend-proxy
|
||||
|
||||
## [1.0.4](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-backend-proxy/compare/decap-cms-backend-proxy@1.0.3...decap-cms-backend-proxy@1.0.4) (2020-03-03)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **locale:** Remove hard coded string literals ([#3333](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-backend-proxy/issues/3333)) ([7c45a3c](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-backend-proxy/commit/7c45a3cda983be427864a56e58791565eb9232e2))
|
||||
|
||||
## [1.0.3](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-backend-proxy/compare/decap-cms-backend-proxy@1.0.2...decap-cms-backend-proxy@1.0.3) (2020-02-06)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **locale:** remove hard coded strings ([#3193](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-backend-proxy/issues/3193)) ([fc91bf8](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-backend-proxy/commit/fc91bf8781e65ce1dc946363dbb10419a145c66b))
|
||||
|
||||
## 1.0.2 (2020-01-22)
|
||||
|
||||
**Note:** Version bump only for package decap-cms-backend-proxy
|
||||
22
node_modules/decap-cms-backend-proxy/LICENSE
generated
vendored
Normal file
22
node_modules/decap-cms-backend-proxy/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
Copyright (c) 2016 Netlify <decap@p-m.si>
|
||||
|
||||
MIT License
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
9
node_modules/decap-cms-backend-proxy/README.md
generated
vendored
Normal file
9
node_modules/decap-cms-backend-proxy/README.md
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
# Proxy backend
|
||||
|
||||
Facilitates [local development](https://www.decapcms.org/docs/beta-features/#working-with-a-local-git-repository).
|
||||
|
||||
## Code structure
|
||||
|
||||
`Implementation` for [File Management System API](https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-lib-util/README.md). An `RPC` wrapper for `decap-server`.
|
||||
|
||||
`AuthenticationPage` - a mock authentication page
|
||||
2
node_modules/decap-cms-backend-proxy/dist/decap-cms-backend-proxy.js
generated
vendored
Normal file
2
node_modules/decap-cms-backend-proxy/dist/decap-cms-backend-proxy.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
node_modules/decap-cms-backend-proxy/dist/decap-cms-backend-proxy.js.map
generated
vendored
Normal file
1
node_modules/decap-cms-backend-proxy/dist/decap-cms-backend-proxy.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
62
node_modules/decap-cms-backend-proxy/dist/esm/AuthenticationPage.js
generated
vendored
Normal file
62
node_modules/decap-cms-backend-proxy/dist/esm/AuthenticationPage.js
generated
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _base = _interopRequireDefault(require("@emotion/styled/base"));
|
||||
var _react = _interopRequireDefault(require("react"));
|
||||
var _propTypes = _interopRequireDefault(require("prop-types"));
|
||||
var _decapCmsUiDefault = require("decap-cms-ui-default");
|
||||
var _react2 = require("@emotion/react");
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
||||
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
||||
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
||||
const StyledAuthenticationPage = /*#__PURE__*/(0, _base.default)("section", {
|
||||
target: "e1ektlme1",
|
||||
label: "StyledAuthenticationPage"
|
||||
})(process.env.NODE_ENV === "production" ? {
|
||||
name: "8azftg",
|
||||
styles: "display:flex;flex-flow:column nowrap;align-items:center;justify-content:center;height:100vh"
|
||||
} : {
|
||||
name: "8azftg",
|
||||
styles: "display:flex;flex-flow:column nowrap;align-items:center;justify-content:center;height:100vh",
|
||||
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9BdXRoZW50aWNhdGlvblBhZ2UuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBSytDIiwiZmlsZSI6Ii4uLy4uL3NyYy9BdXRoZW50aWNhdGlvblBhZ2UuanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgUmVhY3QgZnJvbSAncmVhY3QnO1xuaW1wb3J0IFByb3BUeXBlcyBmcm9tICdwcm9wLXR5cGVzJztcbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcbmltcG9ydCB7IEljb24sIGJ1dHRvbnMsIHNoYWRvd3MsIEdvQmFja0J1dHRvbiwgcmVuZGVyUGFnZUxvZ28gfSBmcm9tICdkZWNhcC1jbXMtdWktZGVmYXVsdCc7XG5cbmNvbnN0IFN0eWxlZEF1dGhlbnRpY2F0aW9uUGFnZSA9IHN0eWxlZC5zZWN0aW9uYFxuICBkaXNwbGF5OiBmbGV4O1xuICBmbGV4LWZsb3c6IGNvbHVtbiBub3dyYXA7XG4gIGFsaWduLWl0ZW1zOiBjZW50ZXI7XG4gIGp1c3RpZnktY29udGVudDogY2VudGVyO1xuICBoZWlnaHQ6IDEwMHZoO1xuYDtcblxuY29uc3QgTG9naW5CdXR0b24gPSBzdHlsZWQuYnV0dG9uYFxuICAke2J1dHRvbnMuYnV0dG9ufTtcbiAgJHtzaGFkb3dzLmRyb3BEZWVwfTtcbiAgJHtidXR0b25zLmRlZmF1bHR9O1xuICAke2J1dHRvbnMuZ3JheX07XG5cbiAgcGFkZGluZzogMCAzMHB4O1xuICBtYXJnaW4tdG9wOiAwO1xuICBkaXNwbGF5OiBmbGV4O1xuICBhbGlnbi1pdGVtczogY2VudGVyO1xuICBwb3NpdGlvbjogcmVsYXRpdmU7XG5cbiAgJHtJY29ufSB7XG4gICAgbWFyZ2luLXJpZ2h0OiAxOHB4O1xuICB9XG5gO1xuXG5leHBvcnQgZGVmYXVsdCBjbGFzcyBBdXRoZW50aWNhdGlvblBhZ2UgZXh0ZW5kcyBSZWFjdC5Db21wb25lbnQge1xuICBzdGF0aWMgcHJvcFR5cGVzID0ge1xuICAgIG9uTG9naW46IFByb3BUeXBlcy5mdW5jLmlzUmVxdWlyZWQsXG4gICAgaW5Qcm9ncmVzczogUHJvcFR5cGVzLmJvb2wsXG4gICAgY29uZmlnOiBQcm9wVHlwZXMub2JqZWN0LmlzUmVxdWlyZWQsXG4gICAgdDogUHJvcFR5cGVzLmZ1bmMuaXNSZXF1aXJlZCxcbiAgfTtcblxuICBoYW5kbGVMb2dpbiA9IGUgPT4ge1xuICAgIGUucHJldmVudERlZmF1bHQoKTtcbiAgICB0aGlzLnByb3BzLm9uTG9naW4odGhpcy5zdGF0ZSk7XG4gIH07XG5cbiAgcmVuZGVyKCkge1xuICAgIGNvbnN0IHsgY29uZmlnLCBpblByb2dyZXNzLCB0IH0gPSB0aGlzLnByb3BzO1xuXG4gICAgcmV0dXJuIChcbiAgICAgIDxTdHlsZWRBdXRoZW50aWNhdGlvblBhZ2U+XG4gICAgICAgIHtyZW5kZXJQYWdlTG9nbyhjb25maWcubG9nb191cmwpfVxuICAgICAgICA8TG9naW5CdXR0b24gZGlzYWJsZWQ9e2luUHJvZ3Jlc3N9IG9uQ2xpY2s9e3RoaXMuaGFuZGxlTG9naW59PlxuICAgICAgICAgIHtpblByb2dyZXNzID8gdCgnYXV0aC5sb2dnaW5nSW4nKSA6IHQoJ2F1dGgubG9naW4nKX1cbiAgICAgICAgPC9Mb2dpbkJ1dHRvbj5cbiAgICAgICAge2NvbmZpZy5zaXRlX3VybCAmJiA8R29CYWNrQnV0dG9uIGhyZWY9e2NvbmZpZy5zaXRlX3VybH0gdD17dH0+PC9Hb0JhY2tCdXR0b24+fVxuICAgICAgPC9TdHlsZWRBdXRoZW50aWNhdGlvblBhZ2U+XG4gICAgKTtcbiAgfVxufVxuIl19 */",
|
||||
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
||||
});
|
||||
const LoginButton = /*#__PURE__*/(0, _base.default)("button", {
|
||||
target: "e1ektlme0",
|
||||
label: "LoginButton"
|
||||
})(_decapCmsUiDefault.buttons.button, ";", _decapCmsUiDefault.shadows.dropDeep, ";", _decapCmsUiDefault.buttons.default, ";", _decapCmsUiDefault.buttons.gray, ";padding:0 30px;margin-top:0;display:flex;align-items:center;position:relative;", _decapCmsUiDefault.Icon, "{margin-right:18px;}" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9BdXRoZW50aWNhdGlvblBhZ2UuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBYWlDIiwiZmlsZSI6Ii4uLy4uL3NyYy9BdXRoZW50aWNhdGlvblBhZ2UuanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgUmVhY3QgZnJvbSAncmVhY3QnO1xuaW1wb3J0IFByb3BUeXBlcyBmcm9tICdwcm9wLXR5cGVzJztcbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcbmltcG9ydCB7IEljb24sIGJ1dHRvbnMsIHNoYWRvd3MsIEdvQmFja0J1dHRvbiwgcmVuZGVyUGFnZUxvZ28gfSBmcm9tICdkZWNhcC1jbXMtdWktZGVmYXVsdCc7XG5cbmNvbnN0IFN0eWxlZEF1dGhlbnRpY2F0aW9uUGFnZSA9IHN0eWxlZC5zZWN0aW9uYFxuICBkaXNwbGF5OiBmbGV4O1xuICBmbGV4LWZsb3c6IGNvbHVtbiBub3dyYXA7XG4gIGFsaWduLWl0ZW1zOiBjZW50ZXI7XG4gIGp1c3RpZnktY29udGVudDogY2VudGVyO1xuICBoZWlnaHQ6IDEwMHZoO1xuYDtcblxuY29uc3QgTG9naW5CdXR0b24gPSBzdHlsZWQuYnV0dG9uYFxuICAke2J1dHRvbnMuYnV0dG9ufTtcbiAgJHtzaGFkb3dzLmRyb3BEZWVwfTtcbiAgJHtidXR0b25zLmRlZmF1bHR9O1xuICAke2J1dHRvbnMuZ3JheX07XG5cbiAgcGFkZGluZzogMCAzMHB4O1xuICBtYXJnaW4tdG9wOiAwO1xuICBkaXNwbGF5OiBmbGV4O1xuICBhbGlnbi1pdGVtczogY2VudGVyO1xuICBwb3NpdGlvbjogcmVsYXRpdmU7XG5cbiAgJHtJY29ufSB7XG4gICAgbWFyZ2luLXJpZ2h0OiAxOHB4O1xuICB9XG5gO1xuXG5leHBvcnQgZGVmYXVsdCBjbGFzcyBBdXRoZW50aWNhdGlvblBhZ2UgZXh0ZW5kcyBSZWFjdC5Db21wb25lbnQge1xuICBzdGF0aWMgcHJvcFR5cGVzID0ge1xuICAgIG9uTG9naW46IFByb3BUeXBlcy5mdW5jLmlzUmVxdWlyZWQsXG4gICAgaW5Qcm9ncmVzczogUHJvcFR5cGVzLmJvb2wsXG4gICAgY29uZmlnOiBQcm9wVHlwZXMub2JqZWN0LmlzUmVxdWlyZWQsXG4gICAgdDogUHJvcFR5cGVzLmZ1bmMuaXNSZXF1aXJlZCxcbiAgfTtcblxuICBoYW5kbGVMb2dpbiA9IGUgPT4ge1xuICAgIGUucHJldmVudERlZmF1bHQoKTtcbiAgICB0aGlzLnByb3BzLm9uTG9naW4odGhpcy5zdGF0ZSk7XG4gIH07XG5cbiAgcmVuZGVyKCkge1xuICAgIGNvbnN0IHsgY29uZmlnLCBpblByb2dyZXNzLCB0IH0gPSB0aGlzLnByb3BzO1xuXG4gICAgcmV0dXJuIChcbiAgICAgIDxTdHlsZWRBdXRoZW50aWNhdGlvblBhZ2U+XG4gICAgICAgIHtyZW5kZXJQYWdlTG9nbyhjb25maWcubG9nb191cmwpfVxuICAgICAgICA8TG9naW5CdXR0b24gZGlzYWJsZWQ9e2luUHJvZ3Jlc3N9IG9uQ2xpY2s9e3RoaXMuaGFuZGxlTG9naW59PlxuICAgICAgICAgIHtpblByb2dyZXNzID8gdCgnYXV0aC5sb2dnaW5nSW4nKSA6IHQoJ2F1dGgubG9naW4nKX1cbiAgICAgICAgPC9Mb2dpbkJ1dHRvbj5cbiAgICAgICAge2NvbmZpZy5zaXRlX3VybCAmJiA8R29CYWNrQnV0dG9uIGhyZWY9e2NvbmZpZy5zaXRlX3VybH0gdD17dH0+PC9Hb0JhY2tCdXR0b24+fVxuICAgICAgPC9TdHlsZWRBdXRoZW50aWNhdGlvblBhZ2U+XG4gICAgKTtcbiAgfVxufVxuIl19 */"));
|
||||
class AuthenticationPage extends _react.default.Component {
|
||||
constructor(...args) {
|
||||
super(...args);
|
||||
_defineProperty(this, "handleLogin", e => {
|
||||
e.preventDefault();
|
||||
this.props.onLogin(this.state);
|
||||
});
|
||||
}
|
||||
render() {
|
||||
const {
|
||||
config,
|
||||
inProgress,
|
||||
t
|
||||
} = this.props;
|
||||
return (0, _react2.jsx)(StyledAuthenticationPage, null, (0, _decapCmsUiDefault.renderPageLogo)(config.logo_url), (0, _react2.jsx)(LoginButton, {
|
||||
disabled: inProgress,
|
||||
onClick: this.handleLogin
|
||||
}, inProgress ? t('auth.loggingIn') : t('auth.login')), config.site_url && (0, _react2.jsx)(_decapCmsUiDefault.GoBackButton, {
|
||||
href: config.site_url,
|
||||
t: t
|
||||
}));
|
||||
}
|
||||
}
|
||||
exports.default = AuthenticationPage;
|
||||
_defineProperty(AuthenticationPage, "propTypes", {
|
||||
onLogin: _propTypes.default.func.isRequired,
|
||||
inProgress: _propTypes.default.bool,
|
||||
config: _propTypes.default.object.isRequired,
|
||||
t: _propTypes.default.func.isRequired
|
||||
});
|
||||
308
node_modules/decap-cms-backend-proxy/dist/esm/implementation.js
generated
vendored
Normal file
308
node_modules/decap-cms-backend-proxy/dist/esm/implementation.js
generated
vendored
Normal file
@@ -0,0 +1,308 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _decapCmsLibUtil = require("decap-cms-lib-util");
|
||||
var _AuthenticationPage = _interopRequireDefault(require("./AuthenticationPage"));
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
||||
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
||||
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
||||
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
||||
async function serializeAsset(assetProxy) {
|
||||
const base64content = await assetProxy.toBase64();
|
||||
return {
|
||||
path: assetProxy.path,
|
||||
content: base64content,
|
||||
encoding: 'base64'
|
||||
};
|
||||
}
|
||||
function deserializeMediaFile({
|
||||
id,
|
||||
content,
|
||||
encoding,
|
||||
path,
|
||||
name
|
||||
}) {
|
||||
let byteArray = new Uint8Array(0);
|
||||
if (encoding !== 'base64') {
|
||||
console.error(`Unsupported encoding '${encoding}' for file '${path}'`);
|
||||
} else {
|
||||
const decodedContent = atob(content);
|
||||
byteArray = new Uint8Array(decodedContent.length);
|
||||
for (let i = 0; i < decodedContent.length; i++) {
|
||||
byteArray[i] = decodedContent.charCodeAt(i);
|
||||
}
|
||||
}
|
||||
const blob = new Blob([byteArray]);
|
||||
const file = (0, _decapCmsLibUtil.blobToFileObj)(name, blob);
|
||||
const url = URL.createObjectURL(file);
|
||||
return {
|
||||
id,
|
||||
name,
|
||||
path,
|
||||
file,
|
||||
size: file.size,
|
||||
url,
|
||||
displayURL: url
|
||||
};
|
||||
}
|
||||
class ProxyBackend {
|
||||
constructor(config, options = {}) {
|
||||
_defineProperty(this, "proxyUrl", void 0);
|
||||
_defineProperty(this, "mediaFolder", void 0);
|
||||
_defineProperty(this, "options", void 0);
|
||||
_defineProperty(this, "branch", void 0);
|
||||
_defineProperty(this, "cmsLabelPrefix", void 0);
|
||||
if (!config.backend.proxy_url) {
|
||||
throw new Error('The Proxy backend needs a "proxy_url" in the backend configuration.');
|
||||
}
|
||||
this.branch = config.backend.branch || 'master';
|
||||
this.proxyUrl = config.backend.proxy_url;
|
||||
this.mediaFolder = config.media_folder;
|
||||
this.options = options;
|
||||
this.cmsLabelPrefix = config.backend.cms_label_prefix;
|
||||
}
|
||||
isGitBackend() {
|
||||
return false;
|
||||
}
|
||||
status() {
|
||||
return Promise.resolve({
|
||||
auth: {
|
||||
status: true
|
||||
},
|
||||
api: {
|
||||
status: true,
|
||||
statusPage: ''
|
||||
}
|
||||
});
|
||||
}
|
||||
authComponent() {
|
||||
return _AuthenticationPage.default;
|
||||
}
|
||||
restoreUser() {
|
||||
return this.authenticate();
|
||||
}
|
||||
authenticate() {
|
||||
return Promise.resolve();
|
||||
}
|
||||
logout() {
|
||||
return null;
|
||||
}
|
||||
getToken() {
|
||||
return Promise.resolve('');
|
||||
}
|
||||
async request(payload) {
|
||||
const response = await _decapCmsLibUtil.unsentRequest.fetchWithTimeout(this.proxyUrl, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json; charset=utf-8'
|
||||
},
|
||||
body: JSON.stringify(_objectSpread({
|
||||
branch: this.branch
|
||||
}, payload))
|
||||
});
|
||||
const json = await response.json();
|
||||
if (response.ok) {
|
||||
return json;
|
||||
} else {
|
||||
throw new _decapCmsLibUtil.APIError(json.error, response.status, 'Proxy');
|
||||
}
|
||||
}
|
||||
entriesByFolder(folder, extension, depth) {
|
||||
return this.request({
|
||||
action: 'entriesByFolder',
|
||||
params: {
|
||||
branch: this.branch,
|
||||
folder,
|
||||
extension,
|
||||
depth
|
||||
}
|
||||
});
|
||||
}
|
||||
entriesByFiles(files) {
|
||||
return this.request({
|
||||
action: 'entriesByFiles',
|
||||
params: {
|
||||
branch: this.branch,
|
||||
files
|
||||
}
|
||||
});
|
||||
}
|
||||
getEntry(path) {
|
||||
return this.request({
|
||||
action: 'getEntry',
|
||||
params: {
|
||||
branch: this.branch,
|
||||
path
|
||||
}
|
||||
});
|
||||
}
|
||||
unpublishedEntries() {
|
||||
return this.request({
|
||||
action: 'unpublishedEntries',
|
||||
params: {
|
||||
branch: this.branch
|
||||
}
|
||||
});
|
||||
}
|
||||
async unpublishedEntry({
|
||||
id,
|
||||
collection,
|
||||
slug
|
||||
}) {
|
||||
try {
|
||||
const entry = await this.request({
|
||||
action: 'unpublishedEntry',
|
||||
params: {
|
||||
branch: this.branch,
|
||||
id,
|
||||
collection,
|
||||
slug,
|
||||
cmsLabelPrefix: this.cmsLabelPrefix
|
||||
}
|
||||
});
|
||||
return entry;
|
||||
} catch (e) {
|
||||
if (e.status === 404) {
|
||||
throw new _decapCmsLibUtil.EditorialWorkflowError('content is not under editorial workflow', true);
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
async unpublishedEntryDataFile(collection, slug, path, id) {
|
||||
const {
|
||||
data
|
||||
} = await this.request({
|
||||
action: 'unpublishedEntryDataFile',
|
||||
params: {
|
||||
branch: this.branch,
|
||||
collection,
|
||||
slug,
|
||||
path,
|
||||
id
|
||||
}
|
||||
});
|
||||
return data;
|
||||
}
|
||||
async unpublishedEntryMediaFile(collection, slug, path, id) {
|
||||
const file = await this.request({
|
||||
action: 'unpublishedEntryMediaFile',
|
||||
params: {
|
||||
branch: this.branch,
|
||||
collection,
|
||||
slug,
|
||||
path,
|
||||
id
|
||||
}
|
||||
});
|
||||
return deserializeMediaFile(file);
|
||||
}
|
||||
deleteUnpublishedEntry(collection, slug) {
|
||||
return this.request({
|
||||
action: 'deleteUnpublishedEntry',
|
||||
params: {
|
||||
branch: this.branch,
|
||||
collection,
|
||||
slug
|
||||
}
|
||||
});
|
||||
}
|
||||
async persistEntry(entry, options) {
|
||||
const assets = await Promise.all(entry.assets.map(serializeAsset));
|
||||
return this.request({
|
||||
action: 'persistEntry',
|
||||
params: {
|
||||
branch: this.branch,
|
||||
dataFiles: entry.dataFiles,
|
||||
assets,
|
||||
options: _objectSpread(_objectSpread({}, options), {}, {
|
||||
status: options.status || this.options.initialWorkflowStatus
|
||||
}),
|
||||
cmsLabelPrefix: this.cmsLabelPrefix
|
||||
}
|
||||
});
|
||||
}
|
||||
updateUnpublishedEntryStatus(collection, slug, newStatus) {
|
||||
return this.request({
|
||||
action: 'updateUnpublishedEntryStatus',
|
||||
params: {
|
||||
branch: this.branch,
|
||||
collection,
|
||||
slug,
|
||||
newStatus,
|
||||
cmsLabelPrefix: this.cmsLabelPrefix
|
||||
}
|
||||
});
|
||||
}
|
||||
publishUnpublishedEntry(collection, slug) {
|
||||
return this.request({
|
||||
action: 'publishUnpublishedEntry',
|
||||
params: {
|
||||
branch: this.branch,
|
||||
collection,
|
||||
slug
|
||||
}
|
||||
});
|
||||
}
|
||||
async getMedia(mediaFolder = this.mediaFolder) {
|
||||
const files = await this.request({
|
||||
action: 'getMedia',
|
||||
params: {
|
||||
branch: this.branch,
|
||||
mediaFolder
|
||||
}
|
||||
});
|
||||
return files.map(deserializeMediaFile);
|
||||
}
|
||||
async getMediaFile(path) {
|
||||
const file = await this.request({
|
||||
action: 'getMediaFile',
|
||||
params: {
|
||||
branch: this.branch,
|
||||
path
|
||||
}
|
||||
});
|
||||
return deserializeMediaFile(file);
|
||||
}
|
||||
async persistMedia(assetProxy, options) {
|
||||
const asset = await serializeAsset(assetProxy);
|
||||
const file = await this.request({
|
||||
action: 'persistMedia',
|
||||
params: {
|
||||
branch: this.branch,
|
||||
asset,
|
||||
options: {
|
||||
commitMessage: options.commitMessage
|
||||
}
|
||||
}
|
||||
});
|
||||
return deserializeMediaFile(file);
|
||||
}
|
||||
deleteFiles(paths, commitMessage) {
|
||||
return this.request({
|
||||
action: 'deleteFiles',
|
||||
params: {
|
||||
branch: this.branch,
|
||||
paths,
|
||||
options: {
|
||||
commitMessage
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
getDeployPreview(collection, slug) {
|
||||
return this.request({
|
||||
action: 'getDeployPreview',
|
||||
params: {
|
||||
branch: this.branch,
|
||||
collection,
|
||||
slug
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
exports.default = ProxyBackend;
|
||||
25
node_modules/decap-cms-backend-proxy/dist/esm/index.js
generated
vendored
Normal file
25
node_modules/decap-cms-backend-proxy/dist/esm/index.js
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "AuthenticationPage", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _AuthenticationPage.default;
|
||||
}
|
||||
});
|
||||
exports.DecapCmsBackendProxy = void 0;
|
||||
Object.defineProperty(exports, "ProxyBackend", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _implementation.default;
|
||||
}
|
||||
});
|
||||
var _implementation = _interopRequireDefault(require("./implementation"));
|
||||
var _AuthenticationPage = _interopRequireDefault(require("./AuthenticationPage"));
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
const DecapCmsBackendProxy = exports.DecapCmsBackendProxy = {
|
||||
ProxyBackend: _implementation.default,
|
||||
AuthenticationPage: _AuthenticationPage.default
|
||||
};
|
||||
29
node_modules/decap-cms-backend-proxy/package.json
generated
vendored
Normal file
29
node_modules/decap-cms-backend-proxy/package.json
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"name": "decap-cms-backend-proxy",
|
||||
"description": "Proxy backend for Decap CMS",
|
||||
"version": "3.1.4",
|
||||
"repository": "https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-backend-proxy",
|
||||
"bugs": "https://github.com/decaporg/decap-cms/issues",
|
||||
"license": "MIT",
|
||||
"module": "dist/esm/index.js",
|
||||
"main": "dist/decap-cms-backend-proxy.js",
|
||||
"keywords": [
|
||||
"decap-cms",
|
||||
"backend"
|
||||
],
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"develop": "npm run build:esm -- --watch",
|
||||
"build": "cross-env NODE_ENV=production webpack",
|
||||
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore \"**/__tests__\" --root-mode upward --extensions \".js,.jsx,.ts,.tsx\""
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@emotion/react": "^11.11.1",
|
||||
"@emotion/styled": "^11.11.0",
|
||||
"decap-cms-lib-util": "^3.0.0",
|
||||
"decap-cms-ui-default": "^3.0.0",
|
||||
"prop-types": "^15.7.2",
|
||||
"react": "^18.2.0"
|
||||
},
|
||||
"gitHead": "64d91b8bb3d0a93dd36c53800cdac4ba2e435000"
|
||||
}
|
||||
57
node_modules/decap-cms-backend-proxy/src/AuthenticationPage.js
generated
vendored
Normal file
57
node_modules/decap-cms-backend-proxy/src/AuthenticationPage.js
generated
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import styled from '@emotion/styled';
|
||||
import { Icon, buttons, shadows, GoBackButton, renderPageLogo } from 'decap-cms-ui-default';
|
||||
|
||||
const StyledAuthenticationPage = styled.section`
|
||||
display: flex;
|
||||
flex-flow: column nowrap;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100vh;
|
||||
`;
|
||||
|
||||
const LoginButton = styled.button`
|
||||
${buttons.button};
|
||||
${shadows.dropDeep};
|
||||
${buttons.default};
|
||||
${buttons.gray};
|
||||
|
||||
padding: 0 30px;
|
||||
margin-top: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
|
||||
${Icon} {
|
||||
margin-right: 18px;
|
||||
}
|
||||
`;
|
||||
|
||||
export default class AuthenticationPage extends React.Component {
|
||||
static propTypes = {
|
||||
onLogin: PropTypes.func.isRequired,
|
||||
inProgress: PropTypes.bool,
|
||||
config: PropTypes.object.isRequired,
|
||||
t: PropTypes.func.isRequired,
|
||||
};
|
||||
|
||||
handleLogin = e => {
|
||||
e.preventDefault();
|
||||
this.props.onLogin(this.state);
|
||||
};
|
||||
|
||||
render() {
|
||||
const { config, inProgress, t } = this.props;
|
||||
|
||||
return (
|
||||
<StyledAuthenticationPage>
|
||||
{renderPageLogo(config.logo_url)}
|
||||
<LoginButton disabled={inProgress} onClick={this.handleLogin}>
|
||||
{inProgress ? t('auth.loggingIn') : t('auth.login')}
|
||||
</LoginButton>
|
||||
{config.site_url && <GoBackButton href={config.site_url} t={t}></GoBackButton>}
|
||||
</StyledAuthenticationPage>
|
||||
);
|
||||
}
|
||||
}
|
||||
263
node_modules/decap-cms-backend-proxy/src/implementation.ts
generated
vendored
Normal file
263
node_modules/decap-cms-backend-proxy/src/implementation.ts
generated
vendored
Normal file
@@ -0,0 +1,263 @@
|
||||
import {
|
||||
EditorialWorkflowError,
|
||||
APIError,
|
||||
unsentRequest,
|
||||
blobToFileObj,
|
||||
} from 'decap-cms-lib-util';
|
||||
|
||||
import AuthenticationPage from './AuthenticationPage';
|
||||
|
||||
import type {
|
||||
Entry,
|
||||
AssetProxy,
|
||||
PersistOptions,
|
||||
User,
|
||||
Config,
|
||||
Implementation,
|
||||
ImplementationFile,
|
||||
UnpublishedEntry,
|
||||
} from 'decap-cms-lib-util';
|
||||
|
||||
async function serializeAsset(assetProxy: AssetProxy) {
|
||||
const base64content = await assetProxy.toBase64!();
|
||||
return { path: assetProxy.path, content: base64content, encoding: 'base64' };
|
||||
}
|
||||
|
||||
type MediaFile = {
|
||||
id: string;
|
||||
content: string;
|
||||
encoding: string;
|
||||
name: string;
|
||||
path: string;
|
||||
};
|
||||
|
||||
function deserializeMediaFile({ id, content, encoding, path, name }: MediaFile) {
|
||||
let byteArray = new Uint8Array(0);
|
||||
if (encoding !== 'base64') {
|
||||
console.error(`Unsupported encoding '${encoding}' for file '${path}'`);
|
||||
} else {
|
||||
const decodedContent = atob(content);
|
||||
byteArray = new Uint8Array(decodedContent.length);
|
||||
for (let i = 0; i < decodedContent.length; i++) {
|
||||
byteArray[i] = decodedContent.charCodeAt(i);
|
||||
}
|
||||
}
|
||||
const blob = new Blob([byteArray]);
|
||||
const file = blobToFileObj(name, blob);
|
||||
const url = URL.createObjectURL(file);
|
||||
return { id, name, path, file, size: file.size, url, displayURL: url };
|
||||
}
|
||||
|
||||
export default class ProxyBackend implements Implementation {
|
||||
proxyUrl: string;
|
||||
mediaFolder: string;
|
||||
options: { initialWorkflowStatus?: string };
|
||||
branch: string;
|
||||
cmsLabelPrefix?: string;
|
||||
|
||||
constructor(config: Config, options = {}) {
|
||||
if (!config.backend.proxy_url) {
|
||||
throw new Error('The Proxy backend needs a "proxy_url" in the backend configuration.');
|
||||
}
|
||||
|
||||
this.branch = config.backend.branch || 'master';
|
||||
this.proxyUrl = config.backend.proxy_url;
|
||||
this.mediaFolder = config.media_folder;
|
||||
this.options = options;
|
||||
this.cmsLabelPrefix = config.backend.cms_label_prefix;
|
||||
}
|
||||
|
||||
isGitBackend() {
|
||||
return false;
|
||||
}
|
||||
|
||||
status() {
|
||||
return Promise.resolve({ auth: { status: true }, api: { status: true, statusPage: '' } });
|
||||
}
|
||||
|
||||
authComponent() {
|
||||
return AuthenticationPage;
|
||||
}
|
||||
|
||||
restoreUser() {
|
||||
return this.authenticate();
|
||||
}
|
||||
|
||||
authenticate() {
|
||||
return Promise.resolve() as unknown as Promise<User>;
|
||||
}
|
||||
|
||||
logout() {
|
||||
return null;
|
||||
}
|
||||
|
||||
getToken() {
|
||||
return Promise.resolve('');
|
||||
}
|
||||
|
||||
async request(payload: { action: string; params: Record<string, unknown> }) {
|
||||
const response = await unsentRequest.fetchWithTimeout(this.proxyUrl, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json; charset=utf-8' },
|
||||
body: JSON.stringify({ branch: this.branch, ...payload }),
|
||||
});
|
||||
|
||||
const json = await response.json();
|
||||
|
||||
if (response.ok) {
|
||||
return json;
|
||||
} else {
|
||||
throw new APIError(json.error, response.status, 'Proxy');
|
||||
}
|
||||
}
|
||||
|
||||
entriesByFolder(folder: string, extension: string, depth: number) {
|
||||
return this.request({
|
||||
action: 'entriesByFolder',
|
||||
params: { branch: this.branch, folder, extension, depth },
|
||||
});
|
||||
}
|
||||
|
||||
entriesByFiles(files: ImplementationFile[]) {
|
||||
return this.request({
|
||||
action: 'entriesByFiles',
|
||||
params: { branch: this.branch, files },
|
||||
});
|
||||
}
|
||||
|
||||
getEntry(path: string) {
|
||||
return this.request({
|
||||
action: 'getEntry',
|
||||
params: { branch: this.branch, path },
|
||||
});
|
||||
}
|
||||
|
||||
unpublishedEntries() {
|
||||
return this.request({
|
||||
action: 'unpublishedEntries',
|
||||
params: { branch: this.branch },
|
||||
});
|
||||
}
|
||||
|
||||
async unpublishedEntry({
|
||||
id,
|
||||
collection,
|
||||
slug,
|
||||
}: {
|
||||
id?: string;
|
||||
collection?: string;
|
||||
slug?: string;
|
||||
}) {
|
||||
try {
|
||||
const entry: UnpublishedEntry = await this.request({
|
||||
action: 'unpublishedEntry',
|
||||
params: { branch: this.branch, id, collection, slug, cmsLabelPrefix: this.cmsLabelPrefix },
|
||||
});
|
||||
|
||||
return entry;
|
||||
} catch (e) {
|
||||
if (e.status === 404) {
|
||||
throw new EditorialWorkflowError('content is not under editorial workflow', true);
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
async unpublishedEntryDataFile(collection: string, slug: string, path: string, id: string) {
|
||||
const { data } = await this.request({
|
||||
action: 'unpublishedEntryDataFile',
|
||||
params: { branch: this.branch, collection, slug, path, id },
|
||||
});
|
||||
return data;
|
||||
}
|
||||
|
||||
async unpublishedEntryMediaFile(collection: string, slug: string, path: string, id: string) {
|
||||
const file = await this.request({
|
||||
action: 'unpublishedEntryMediaFile',
|
||||
params: { branch: this.branch, collection, slug, path, id },
|
||||
});
|
||||
return deserializeMediaFile(file);
|
||||
}
|
||||
|
||||
deleteUnpublishedEntry(collection: string, slug: string) {
|
||||
return this.request({
|
||||
action: 'deleteUnpublishedEntry',
|
||||
params: { branch: this.branch, collection, slug },
|
||||
});
|
||||
}
|
||||
|
||||
async persistEntry(entry: Entry, options: PersistOptions) {
|
||||
const assets = await Promise.all(entry.assets.map(serializeAsset));
|
||||
return this.request({
|
||||
action: 'persistEntry',
|
||||
params: {
|
||||
branch: this.branch,
|
||||
dataFiles: entry.dataFiles,
|
||||
assets,
|
||||
options: { ...options, status: options.status || this.options.initialWorkflowStatus },
|
||||
cmsLabelPrefix: this.cmsLabelPrefix,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
updateUnpublishedEntryStatus(collection: string, slug: string, newStatus: string) {
|
||||
return this.request({
|
||||
action: 'updateUnpublishedEntryStatus',
|
||||
params: {
|
||||
branch: this.branch,
|
||||
collection,
|
||||
slug,
|
||||
newStatus,
|
||||
cmsLabelPrefix: this.cmsLabelPrefix,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
publishUnpublishedEntry(collection: string, slug: string) {
|
||||
return this.request({
|
||||
action: 'publishUnpublishedEntry',
|
||||
params: { branch: this.branch, collection, slug },
|
||||
});
|
||||
}
|
||||
|
||||
async getMedia(mediaFolder = this.mediaFolder) {
|
||||
const files: MediaFile[] = await this.request({
|
||||
action: 'getMedia',
|
||||
params: { branch: this.branch, mediaFolder },
|
||||
});
|
||||
|
||||
return files.map(deserializeMediaFile);
|
||||
}
|
||||
|
||||
async getMediaFile(path: string) {
|
||||
const file = await this.request({
|
||||
action: 'getMediaFile',
|
||||
params: { branch: this.branch, path },
|
||||
});
|
||||
return deserializeMediaFile(file);
|
||||
}
|
||||
|
||||
async persistMedia(assetProxy: AssetProxy, options: PersistOptions) {
|
||||
const asset = await serializeAsset(assetProxy);
|
||||
const file: MediaFile = await this.request({
|
||||
action: 'persistMedia',
|
||||
params: { branch: this.branch, asset, options: { commitMessage: options.commitMessage } },
|
||||
});
|
||||
|
||||
return deserializeMediaFile(file);
|
||||
}
|
||||
|
||||
deleteFiles(paths: string[], commitMessage: string) {
|
||||
return this.request({
|
||||
action: 'deleteFiles',
|
||||
params: { branch: this.branch, paths, options: { commitMessage } },
|
||||
});
|
||||
}
|
||||
|
||||
getDeployPreview(collection: string, slug: string) {
|
||||
return this.request({
|
||||
action: 'getDeployPreview',
|
||||
params: { branch: this.branch, collection, slug },
|
||||
});
|
||||
}
|
||||
}
|
||||
8
node_modules/decap-cms-backend-proxy/src/index.ts
generated
vendored
Normal file
8
node_modules/decap-cms-backend-proxy/src/index.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import ProxyBackend from './implementation';
|
||||
import AuthenticationPage from './AuthenticationPage';
|
||||
|
||||
export const DecapCmsBackendProxy = {
|
||||
ProxyBackend,
|
||||
AuthenticationPage,
|
||||
};
|
||||
export { ProxyBackend, AuthenticationPage };
|
||||
3
node_modules/decap-cms-backend-proxy/webpack.config.js
generated
vendored
Normal file
3
node_modules/decap-cms-backend-proxy/webpack.config.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
const { getConfig } = require('../../scripts/webpack.js');
|
||||
|
||||
module.exports = getConfig();
|
||||
Reference in New Issue
Block a user