@webiny/app-headless-cms 5.18.1-beta.0 → 5.18.3-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { useI18N } from "@webiny/app-i18n/hooks/useI18N";
|
|
3
3
|
import { CircularProgress } from "@webiny/ui/Progress";
|
|
4
|
+
import { config as appConfig } from "@webiny/app/config";
|
|
4
5
|
export var CmsContext = /*#__PURE__*/React.createContext(null);
|
|
5
6
|
var apolloClientsCache = {};
|
|
6
7
|
export function CmsProvider(props) {
|
|
8
|
+
var apiUrl = appConfig.getKey("API_URL", process.env.REACT_APP_API_URL);
|
|
9
|
+
|
|
7
10
|
var _useI18N = useI18N(),
|
|
8
11
|
getCurrentLocale = _useI18N.getCurrentLocale;
|
|
9
12
|
|
|
@@ -15,7 +18,7 @@ export function CmsProvider(props) {
|
|
|
15
18
|
|
|
16
19
|
if (currentLocale && !apolloClientsCache[currentLocale]) {
|
|
17
20
|
apolloClientsCache[currentLocale] = props.createApolloClient({
|
|
18
|
-
uri: "".concat(
|
|
21
|
+
uri: "".concat(apiUrl, "/cms/manage/").concat(currentLocale)
|
|
19
22
|
});
|
|
20
23
|
}
|
|
21
24
|
|
|
@@ -23,7 +26,7 @@ export function CmsProvider(props) {
|
|
|
23
26
|
getApolloClient: function getApolloClient(locale) {
|
|
24
27
|
if (!apolloClientsCache[locale]) {
|
|
25
28
|
apolloClientsCache[locale] = props.createApolloClient({
|
|
26
|
-
uri: "".concat(
|
|
29
|
+
uri: "".concat(apiUrl, "/cms/manage/").concat(locale)
|
|
27
30
|
});
|
|
28
31
|
}
|
|
29
32
|
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
var manageQuery = "# Webiny Headless CMS Manage API\n#\n# This API controls all the operations within the Headless CMS module.\n# Use it to manage content, create and modify content models and more.\n# Explore the schema for details.\n#\n# Note: to use the API outside of the playground, you will need to provide an API key via the Authorization header.\n#\n# Example query - list content model groups:\n{\n listContentModelGroups {\n data {\n name\n icon\n slug\n }\n }\n}\n";
|
|
2
2
|
var readQuery = "# Webiny Headless CMS Read API\n#\n# This is the API to use in your 3rd party apps to read your content.\n# It returns only content that has been published.\n#\n# Note: to use the API outside of the playground, you will need to provide an API key via the Authorization header.\n#\n# Example query - list content models:\n{\n listContentModels {\n data {\n name\n modelId\n }\n }\n}\n";
|
|
3
3
|
var previewQuery = "# Webiny Headless CMS Preview API\n#\n# This is the API to use in your 3rd party apps to preview content.\n# It returns the latest content revision, regardless of whether it was published or not.\n#\n# Note: to use the API outside of the playground, you will need to provide an API key via the Authorization header.\n#\n# Example query - list content models:\n{\n listContentModels {\n data {\n name\n }\n }\n}\n";
|
|
4
|
+
import { config as appConfig } from "@webiny/app/config";
|
|
4
5
|
var plugins = [{
|
|
5
6
|
type: "graphql-playground-tab",
|
|
6
7
|
name: "graphql-playground-tab-manage",
|
|
7
8
|
tab: function tab(_ref) {
|
|
8
9
|
var locale = _ref.locale,
|
|
9
10
|
identity = _ref.identity;
|
|
11
|
+
var apiUrl = appConfig.getKey("API_URL", process.env.REACT_APP_API_URL);
|
|
10
12
|
|
|
11
13
|
if (!identity.getPermission("cms.endpoint.manage")) {
|
|
12
14
|
return null;
|
|
@@ -14,7 +16,7 @@ var plugins = [{
|
|
|
14
16
|
|
|
15
17
|
return {
|
|
16
18
|
name: "Headless CMS - Manage API",
|
|
17
|
-
endpoint:
|
|
19
|
+
endpoint: apiUrl + "/cms/manage/" + locale,
|
|
18
20
|
headers: {},
|
|
19
21
|
query: manageQuery
|
|
20
22
|
};
|
|
@@ -25,6 +27,7 @@ var plugins = [{
|
|
|
25
27
|
tab: function tab(_ref2) {
|
|
26
28
|
var locale = _ref2.locale,
|
|
27
29
|
identity = _ref2.identity;
|
|
30
|
+
var apiUrl = appConfig.getKey("API_URL", process.env.REACT_APP_API_URL);
|
|
28
31
|
|
|
29
32
|
if (!identity.getPermission("cms.endpoint.read")) {
|
|
30
33
|
return null;
|
|
@@ -32,7 +35,7 @@ var plugins = [{
|
|
|
32
35
|
|
|
33
36
|
return {
|
|
34
37
|
name: "Headless CMS - Read API",
|
|
35
|
-
endpoint:
|
|
38
|
+
endpoint: apiUrl + "/cms/read/" + locale,
|
|
36
39
|
headers: {},
|
|
37
40
|
query: readQuery
|
|
38
41
|
};
|
|
@@ -43,6 +46,7 @@ var plugins = [{
|
|
|
43
46
|
tab: function tab(_ref3) {
|
|
44
47
|
var locale = _ref3.locale,
|
|
45
48
|
identity = _ref3.identity;
|
|
49
|
+
var apiUrl = appConfig.getKey("API_URL", process.env.REACT_APP_API_URL);
|
|
46
50
|
|
|
47
51
|
if (!identity.getPermission("cms.endpoint.preview")) {
|
|
48
52
|
return null;
|
|
@@ -50,7 +54,7 @@ var plugins = [{
|
|
|
50
54
|
|
|
51
55
|
return {
|
|
52
56
|
name: "Headless CMS - Preview API",
|
|
53
|
-
endpoint:
|
|
57
|
+
endpoint: apiUrl + "/cms/preview/" + locale,
|
|
54
58
|
headers: {},
|
|
55
59
|
query: previewQuery
|
|
56
60
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/app-headless-cms",
|
|
3
|
-
"version": "5.18.
|
|
3
|
+
"version": "5.18.3-beta.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -24,18 +24,18 @@
|
|
|
24
24
|
"@fortawesome/react-fontawesome": "0.1.16",
|
|
25
25
|
"@svgr/webpack": "4.3.3",
|
|
26
26
|
"@types/react": "16.14.2",
|
|
27
|
-
"@webiny/app": "5.18.
|
|
28
|
-
"@webiny/app-admin": "5.18.
|
|
29
|
-
"@webiny/app-graphql-playground": "5.18.
|
|
30
|
-
"@webiny/app-i18n": "5.18.
|
|
31
|
-
"@webiny/app-plugin-admin-welcome-screen": "5.18.
|
|
32
|
-
"@webiny/app-security": "5.18.
|
|
33
|
-
"@webiny/error": "5.18.
|
|
34
|
-
"@webiny/form": "5.18.
|
|
35
|
-
"@webiny/plugins": "5.18.
|
|
36
|
-
"@webiny/react-router": "5.18.
|
|
37
|
-
"@webiny/ui": "5.18.
|
|
38
|
-
"@webiny/validation": "5.18.
|
|
27
|
+
"@webiny/app": "5.18.3-beta.0",
|
|
28
|
+
"@webiny/app-admin": "5.18.3-beta.0",
|
|
29
|
+
"@webiny/app-graphql-playground": "5.18.3-beta.0",
|
|
30
|
+
"@webiny/app-i18n": "5.18.3-beta.0",
|
|
31
|
+
"@webiny/app-plugin-admin-welcome-screen": "5.18.3-beta.0",
|
|
32
|
+
"@webiny/app-security": "5.18.3-beta.0",
|
|
33
|
+
"@webiny/error": "5.18.3-beta.0",
|
|
34
|
+
"@webiny/form": "5.18.3-beta.0",
|
|
35
|
+
"@webiny/plugins": "5.18.3-beta.0",
|
|
36
|
+
"@webiny/react-router": "5.18.3-beta.0",
|
|
37
|
+
"@webiny/ui": "5.18.3-beta.0",
|
|
38
|
+
"@webiny/validation": "5.18.3-beta.0",
|
|
39
39
|
"apollo-cache": "1.3.5",
|
|
40
40
|
"apollo-client": "2.6.10",
|
|
41
41
|
"apollo-link": "1.2.14",
|
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
"@babel/preset-env": "^7.5.5",
|
|
67
67
|
"@babel/preset-react": "^7.0.0",
|
|
68
68
|
"@babel/preset-typescript": "^7.8.3",
|
|
69
|
-
"@webiny/cli": "^5.18.
|
|
70
|
-
"@webiny/project-utils": "^5.18.
|
|
69
|
+
"@webiny/cli": "^5.18.3-beta.0",
|
|
70
|
+
"@webiny/project-utils": "^5.18.3-beta.0",
|
|
71
71
|
"babel-plugin-emotion": "^9.2.8",
|
|
72
72
|
"babel-plugin-lodash": "^3.3.4",
|
|
73
73
|
"babel-plugin-module-resolver": "^4.1.0",
|
|
@@ -105,5 +105,5 @@
|
|
|
105
105
|
]
|
|
106
106
|
}
|
|
107
107
|
},
|
|
108
|
-
"gitHead": "
|
|
108
|
+
"gitHead": "eb7a008ad4f5b01f01b7c84d291d1fa0b5ced25b"
|
|
109
109
|
}
|