contentful-management 12.0.0-beta.1 → 12.0.0-beta.3

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.
Files changed (172) hide show
  1. package/README.md +3 -0
  2. package/dist/cjs/adapters/REST/endpoints/access-token.cjs +136 -0
  3. package/dist/cjs/adapters/REST/endpoints/ai-action-invocation.cjs +9 -0
  4. package/dist/cjs/adapters/REST/endpoints/ai-action.cjs +53 -0
  5. package/dist/cjs/adapters/REST/endpoints/api-key.cjs +48 -0
  6. package/dist/cjs/adapters/REST/endpoints/app-access-token.cjs +9 -0
  7. package/dist/cjs/adapters/REST/endpoints/app-action-call.cjs +65 -0
  8. package/dist/cjs/adapters/REST/endpoints/app-action.cjs +42 -0
  9. package/dist/cjs/adapters/REST/endpoints/app-bundle.cjs +39 -0
  10. package/dist/cjs/adapters/REST/endpoints/app-definition.cjs +47 -0
  11. package/dist/cjs/adapters/REST/endpoints/app-details.cjs +17 -0
  12. package/dist/cjs/adapters/REST/endpoints/app-event-subscription.cjs +17 -0
  13. package/dist/cjs/adapters/REST/endpoints/app-installation.cjs +42 -0
  14. package/dist/cjs/adapters/REST/endpoints/app-key.cjs +21 -0
  15. package/dist/cjs/adapters/REST/endpoints/app-signed-request.cjs +9 -0
  16. package/dist/cjs/adapters/REST/endpoints/app-signing-secret.cjs +17 -0
  17. package/dist/cjs/adapters/REST/endpoints/app-upload.cjs +28 -0
  18. package/dist/cjs/adapters/REST/endpoints/asset-key.cjs +34 -0
  19. package/dist/cjs/adapters/REST/endpoints/asset.cjs +185 -0
  20. package/dist/cjs/adapters/REST/endpoints/bulk-action.cjs +21 -0
  21. package/dist/cjs/adapters/REST/endpoints/comment.cjs +92 -0
  22. package/dist/cjs/adapters/REST/endpoints/concept-scheme.cjs +44 -0
  23. package/dist/cjs/adapters/REST/endpoints/concept.cjs +65 -0
  24. package/dist/cjs/adapters/REST/endpoints/content-type.cjs +56 -0
  25. package/dist/cjs/adapters/REST/endpoints/editor-interface.cjs +24 -0
  26. package/dist/cjs/adapters/REST/endpoints/entry.cjs +104 -0
  27. package/dist/cjs/adapters/REST/endpoints/environment-alias.cjs +44 -0
  28. package/dist/cjs/adapters/REST/endpoints/environment-template-installation.cjs +23 -0
  29. package/dist/cjs/adapters/REST/endpoints/environment-template.cjs +49 -0
  30. package/dist/cjs/adapters/REST/endpoints/environment.cjs +47 -0
  31. package/dist/cjs/adapters/REST/endpoints/extension.cjs +44 -0
  32. package/dist/cjs/adapters/REST/endpoints/function-log.cjs +23 -0
  33. package/dist/cjs/adapters/REST/endpoints/function.cjs +25 -0
  34. package/dist/cjs/adapters/REST/endpoints/http.cjs +29 -0
  35. package/dist/cjs/adapters/REST/endpoints/index.cjs +139 -0
  36. package/dist/cjs/adapters/REST/endpoints/locale.cjs +37 -0
  37. package/dist/cjs/adapters/REST/endpoints/oauth-application.cjs +147 -0
  38. package/dist/cjs/adapters/REST/endpoints/organization-invitation.cjs +23 -0
  39. package/dist/cjs/adapters/REST/endpoints/organization-membership.cjs +32 -0
  40. package/dist/cjs/adapters/REST/endpoints/organization.cjs +28 -0
  41. package/dist/cjs/adapters/REST/endpoints/personal-access-token.cjs +37 -0
  42. package/dist/cjs/adapters/REST/endpoints/preview-api-key.cjs +15 -0
  43. package/dist/cjs/adapters/REST/endpoints/raw.cjs +44 -0
  44. package/dist/cjs/adapters/REST/endpoints/release-action.cjs +21 -0
  45. package/dist/cjs/adapters/REST/endpoints/release.cjs +61 -0
  46. package/dist/cjs/adapters/REST/endpoints/resource-provider.cjs +18 -0
  47. package/dist/cjs/adapters/REST/endpoints/resource-type.cjs +30 -0
  48. package/dist/cjs/adapters/REST/endpoints/resource.cjs +10 -0
  49. package/dist/cjs/adapters/REST/endpoints/role.cjs +48 -0
  50. package/dist/cjs/adapters/REST/endpoints/scheduled-action.cjs +44 -0
  51. package/dist/cjs/adapters/REST/endpoints/snapshot.cjs +30 -0
  52. package/dist/cjs/adapters/REST/endpoints/space-member.cjs +11 -0
  53. package/dist/cjs/adapters/REST/endpoints/space-membership.cjs +60 -0
  54. package/dist/cjs/adapters/REST/endpoints/space.cjs +34 -0
  55. package/dist/cjs/adapters/REST/endpoints/tag.cjs +37 -0
  56. package/dist/cjs/adapters/REST/endpoints/task.cjs +40 -0
  57. package/dist/cjs/adapters/REST/endpoints/team-membership.cjs +35 -0
  58. package/dist/cjs/adapters/REST/endpoints/team-space-membership.cjs +46 -0
  59. package/dist/cjs/adapters/REST/endpoints/team.cjs +36 -0
  60. package/dist/cjs/adapters/REST/endpoints/ui-config.cjs +22 -0
  61. package/dist/cjs/adapters/REST/endpoints/upload-credentials.cjs +16 -0
  62. package/dist/cjs/adapters/REST/endpoints/upload.cjs +42 -0
  63. package/dist/cjs/adapters/REST/endpoints/usage.cjs +17 -0
  64. package/dist/cjs/adapters/REST/endpoints/user-ui-config.cjs +22 -0
  65. package/dist/cjs/adapters/REST/endpoints/user.cjs +27 -0
  66. package/dist/cjs/adapters/REST/endpoints/utils.cjs +20 -0
  67. package/dist/cjs/adapters/REST/endpoints/webhook.cjs +98 -0
  68. package/dist/cjs/adapters/REST/endpoints/workflow-definition.cjs +41 -0
  69. package/dist/cjs/adapters/REST/endpoints/workflow.cjs +49 -0
  70. package/dist/cjs/adapters/REST/endpoints/workflows-changelog.cjs +11 -0
  71. package/dist/cjs/adapters/REST/make-request.cjs +19 -0
  72. package/dist/cjs/adapters/REST/rest-adapter.cjs +32 -0
  73. package/dist/cjs/common-types.cjs +6 -0
  74. package/dist/cjs/common-utils.cjs +38 -0
  75. package/dist/cjs/constants/editor-interface-defaults/controls-defaults.cjs +161 -0
  76. package/dist/cjs/constants/editor-interface-defaults/editors-defaults.cjs +40 -0
  77. package/dist/cjs/constants/editor-interface-defaults/index.cjs +14 -0
  78. package/dist/cjs/constants/editor-interface-defaults/sidebar-defaults.cjs +71 -0
  79. package/dist/cjs/constants/editor-interface-defaults/types.cjs +18 -0
  80. package/dist/cjs/create-adapter.cjs +21 -0
  81. package/dist/cjs/create-app-definition-api.cjs +254 -0
  82. package/dist/cjs/create-contentful-api.cjs +592 -0
  83. package/dist/cjs/create-entry-api.cjs +481 -0
  84. package/dist/cjs/create-environment-api.cjs +2403 -0
  85. package/dist/cjs/create-environment-template-api.cjs +270 -0
  86. package/dist/cjs/create-organization-api.cjs +1136 -0
  87. package/dist/cjs/create-space-api.cjs +1591 -0
  88. package/dist/cjs/create-ui-config-api.cjs +55 -0
  89. package/dist/cjs/create-user-ui-config-api.cjs +55 -0
  90. package/dist/cjs/enhance-with-methods.cjs +26 -0
  91. package/dist/cjs/entities/access-token.cjs +36 -0
  92. package/dist/cjs/entities/ai-action-invocation.cjs +46 -0
  93. package/dist/cjs/entities/ai-action.cjs +94 -0
  94. package/dist/cjs/entities/api-key.cjs +59 -0
  95. package/dist/cjs/entities/app-access-token.cjs +17 -0
  96. package/dist/cjs/entities/app-action-call.cjs +67 -0
  97. package/dist/cjs/entities/app-action.cjs +48 -0
  98. package/dist/cjs/entities/app-bundle.cjs +48 -0
  99. package/dist/cjs/entities/app-definition.cjs +29 -0
  100. package/dist/cjs/entities/app-details.cjs +39 -0
  101. package/dist/cjs/entities/app-event-subscription.cjs +34 -0
  102. package/dist/cjs/entities/app-installation.cjs +55 -0
  103. package/dist/cjs/entities/app-key.cjs +44 -0
  104. package/dist/cjs/entities/app-signed-request.cjs +17 -0
  105. package/dist/cjs/entities/app-signing-secret.cjs +34 -0
  106. package/dist/cjs/entities/app-upload.cjs +47 -0
  107. package/dist/cjs/entities/asset-key.cjs +17 -0
  108. package/dist/cjs/entities/asset.cjs +124 -0
  109. package/dist/cjs/entities/bulk-action.cjs +60 -0
  110. package/dist/cjs/entities/comment.cjs +63 -0
  111. package/dist/cjs/entities/concept-scheme.cjs +2 -0
  112. package/dist/cjs/entities/concept.cjs +2 -0
  113. package/dist/cjs/entities/content-type.cjs +120 -0
  114. package/dist/cjs/entities/editor-interface.cjs +50 -0
  115. package/dist/cjs/entities/entry.cjs +27 -0
  116. package/dist/cjs/entities/environment-alias.cjs +58 -0
  117. package/dist/cjs/entities/environment-template-installation.cjs +23 -0
  118. package/dist/cjs/entities/environment-template.cjs +18 -0
  119. package/dist/cjs/entities/environment.cjs +34 -0
  120. package/dist/cjs/entities/extension.cjs +54 -0
  121. package/dist/cjs/entities/function-log.cjs +26 -0
  122. package/dist/cjs/entities/function.cjs +66 -0
  123. package/dist/cjs/entities/index.cjs +131 -0
  124. package/dist/cjs/entities/locale.cjs +57 -0
  125. package/dist/cjs/entities/oauth-application.cjs +66 -0
  126. package/dist/cjs/entities/organization-invitation.cjs +17 -0
  127. package/dist/cjs/entities/organization-membership.cjs +53 -0
  128. package/dist/cjs/entities/organization.cjs +32 -0
  129. package/dist/cjs/entities/personal-access-token.cjs +36 -0
  130. package/dist/cjs/entities/preview-api-key.cjs +31 -0
  131. package/dist/cjs/entities/release-action.cjs +55 -0
  132. package/dist/cjs/entities/release.cjs +111 -0
  133. package/dist/cjs/entities/resource-provider.cjs +139 -0
  134. package/dist/cjs/entities/resource-type.cjs +98 -0
  135. package/dist/cjs/entities/resource.cjs +13 -0
  136. package/dist/cjs/entities/role.cjs +53 -0
  137. package/dist/cjs/entities/scheduled-action.cjs +154 -0
  138. package/dist/cjs/entities/snapshot.cjs +36 -0
  139. package/dist/cjs/entities/space-member.cjs +23 -0
  140. package/dist/cjs/entities/space-membership.cjs +53 -0
  141. package/dist/cjs/entities/space.cjs +33 -0
  142. package/dist/cjs/entities/tag.cjs +56 -0
  143. package/dist/cjs/entities/task.cjs +57 -0
  144. package/dist/cjs/entities/team-membership.cjs +54 -0
  145. package/dist/cjs/entities/team-space-membership.cjs +53 -0
  146. package/dist/cjs/entities/team.cjs +53 -0
  147. package/dist/cjs/entities/ui-config.cjs +20 -0
  148. package/dist/cjs/entities/upload.cjs +38 -0
  149. package/dist/cjs/entities/usage.cjs +25 -0
  150. package/dist/cjs/entities/user-ui-config.cjs +20 -0
  151. package/dist/cjs/entities/user.cjs +28 -0
  152. package/dist/cjs/entities/webhook.cjs +77 -0
  153. package/dist/cjs/entities/workflow-definition.cjs +79 -0
  154. package/dist/cjs/index.cjs +65 -0
  155. package/dist/cjs/methods/action.cjs +53 -0
  156. package/dist/cjs/methods/content-type.cjs +51 -0
  157. package/dist/cjs/methods/utils.cjs +11 -0
  158. package/dist/cjs/plain/as-iterator.cjs +32 -0
  159. package/dist/cjs/plain/checks.cjs +15 -0
  160. package/dist/cjs/plain/pagination-helper.cjs +56 -0
  161. package/dist/cjs/plain/plain-client.cjs +516 -0
  162. package/dist/cjs/plain/wrappers/wrap.cjs +26 -0
  163. package/dist/cjs/upload-http-client.cjs +17 -0
  164. package/dist/contentful-management.browser.js +50 -34
  165. package/dist/contentful-management.browser.min.js +1 -1
  166. package/dist/contentful-management.cjs +35 -19
  167. package/dist/esm/create-contentful-api.js +1 -1
  168. package/dist/esm/index.js +1 -1
  169. package/dist/esm/plain/plain-client.js +1 -1
  170. package/dist/stats-browser-min.html +1 -1
  171. package/package.json +6 -6
  172. package/types.d.ts +0 -1
@@ -0,0 +1,15 @@
1
+ 'use strict';
2
+
3
+ var raw = require('./raw.js');
4
+
5
+ const get = (http, params) => {
6
+ return raw.get(http, `/spaces/${params.spaceId}/preview_api_keys/${params.previewApiKeyId}`);
7
+ };
8
+ const getMany = (http, params) => {
9
+ return raw.get(http, `/spaces/${params.spaceId}/preview_api_keys`, {
10
+ params: params.query,
11
+ });
12
+ };
13
+
14
+ exports.get = get;
15
+ exports.getMany = getMany;
@@ -0,0 +1,44 @@
1
+ 'use strict';
2
+
3
+ var contentfulSdkCore = require('contentful-sdk-core');
4
+
5
+ /* eslint-disable @typescript-eslint/no-explicit-any */
6
+ function getBaseUrl(http) {
7
+ var _a;
8
+ return (_a = http.defaults.baseURL) === null || _a === void 0 ? void 0 : _a.split('/spaces')[0];
9
+ }
10
+ function get(http, url, config) {
11
+ return http
12
+ .get(url, Object.assign({ baseURL: getBaseUrl(http) }, config))
13
+ .then((response) => response.data, contentfulSdkCore.errorHandler);
14
+ }
15
+ function patch(http, url, payload, config) {
16
+ return http
17
+ .patch(url, payload, Object.assign({ baseURL: getBaseUrl(http) }, config))
18
+ .then((response) => response.data, contentfulSdkCore.errorHandler);
19
+ }
20
+ function post(http, url, payload, config) {
21
+ return http
22
+ .post(url, payload, Object.assign({ baseURL: getBaseUrl(http) }, config))
23
+ .then((response) => response.data, contentfulSdkCore.errorHandler);
24
+ }
25
+ function put(http, url, payload, config) {
26
+ return http
27
+ .put(url, payload, Object.assign({ baseURL: getBaseUrl(http) }, config))
28
+ .then((response) => response.data, contentfulSdkCore.errorHandler);
29
+ }
30
+ function del(http, url, config) {
31
+ return http
32
+ .delete(url, Object.assign({ baseURL: getBaseUrl(http) }, config))
33
+ .then((response) => response.data, contentfulSdkCore.errorHandler);
34
+ }
35
+ function http(http, url, config) {
36
+ return http(url, Object.assign({ baseURL: getBaseUrl(http) }, config)).then((response) => response.data, contentfulSdkCore.errorHandler);
37
+ }
38
+
39
+ exports.del = del;
40
+ exports.get = get;
41
+ exports.http = http;
42
+ exports.patch = patch;
43
+ exports.post = post;
44
+ exports.put = put;
@@ -0,0 +1,21 @@
1
+ 'use strict';
2
+
3
+ var raw = require('./raw.js');
4
+
5
+ const get = (http, params) => {
6
+ return raw.get(http, `/spaces/${params.spaceId}/environments/${params.environmentId}/releases/${params.releaseId}/actions/${params.actionId}`);
7
+ };
8
+ const getMany = (http, params) => {
9
+ return raw.get(http, `/spaces/${params.spaceId}/environments/${params.environmentId}/release_actions`, {
10
+ params: params.query,
11
+ });
12
+ };
13
+ const queryForRelease = (http, params) => {
14
+ return raw.get(http, `/spaces/${params.spaceId}/environments/${params.environmentId}/release_actions`, {
15
+ params: Object.assign({ 'sys.release.sys.id[in]': params.releaseId }, params.query),
16
+ });
17
+ };
18
+
19
+ exports.get = get;
20
+ exports.getMany = getMany;
21
+ exports.queryForRelease = queryForRelease;
@@ -0,0 +1,61 @@
1
+ 'use strict';
2
+
3
+ var raw = require('./raw.js');
4
+
5
+ const get = (http, params) => {
6
+ return raw.get(http, `/spaces/${params.spaceId}/environments/${params.environmentId}/releases/${params.releaseId}`);
7
+ };
8
+ const query = (http, params) => {
9
+ return raw.get(http, `/spaces/${params.spaceId}/environments/${params.environmentId}/releases`, {
10
+ params: params.query,
11
+ });
12
+ };
13
+ const create = (http, params, payload) => {
14
+ return raw.post(http, `/spaces/${params.spaceId}/environments/${params.environmentId}/releases`, payload);
15
+ };
16
+ const update = (http, params, payload, headers) => {
17
+ return raw.put(http, `/spaces/${params.spaceId}/environments/${params.environmentId}/releases/${params.releaseId}`, payload, {
18
+ headers: Object.assign({ 'X-Contentful-Version': params.version }, headers),
19
+ });
20
+ };
21
+ const del = (http, params) => {
22
+ return raw.del(http, `/spaces/${params.spaceId}/environments/${params.environmentId}/releases/${params.releaseId}`);
23
+ };
24
+ const publish = (http, params, headers) => {
25
+ return raw.put(http, `/spaces/${params.spaceId}/environments/${params.environmentId}/releases/${params.releaseId}/published`, null, {
26
+ headers: Object.assign({ 'X-Contentful-Version': params.version }, headers),
27
+ });
28
+ };
29
+ const unpublish = (http, params, headers) => {
30
+ return raw.del(http, `/spaces/${params.spaceId}/environments/${params.environmentId}/releases/${params.releaseId}/published`, {
31
+ headers: Object.assign({ 'X-Contentful-Version': params.version }, headers),
32
+ });
33
+ };
34
+ const validate = (http, params, payload) => {
35
+ return raw.post(http, `/spaces/${params.spaceId}/environments/${params.environmentId}/releases/${params.releaseId}/validate`, payload);
36
+ };
37
+ const archive = (http, params) => {
38
+ return raw.put(http, `/spaces/${params.spaceId}/environments/${params.environmentId}/releases/${params.releaseId}/archived`, null, {
39
+ headers: {
40
+ 'X-Contentful-Version': params.version,
41
+ },
42
+ });
43
+ };
44
+ const unarchive = (http, params) => {
45
+ return raw.del(http, `/spaces/${params.spaceId}/environments/${params.environmentId}/releases/${params.releaseId}/archived`, {
46
+ headers: {
47
+ 'X-Contentful-Version': params.version,
48
+ },
49
+ });
50
+ };
51
+
52
+ exports.archive = archive;
53
+ exports.create = create;
54
+ exports.del = del;
55
+ exports.get = get;
56
+ exports.publish = publish;
57
+ exports.query = query;
58
+ exports.unarchive = unarchive;
59
+ exports.unpublish = unpublish;
60
+ exports.update = update;
61
+ exports.validate = validate;
@@ -0,0 +1,18 @@
1
+ 'use strict';
2
+
3
+ var raw = require('./raw.js');
4
+
5
+ const getBaseUrl = (params) => `/organizations/${params.organizationId}/app_definitions/${params.appDefinitionId}/resource_provider`;
6
+ const get = (http, params) => {
7
+ return raw.get(http, getBaseUrl(params));
8
+ };
9
+ const upsert = (http, params, rawData, headers) => {
10
+ return raw.put(http, getBaseUrl(params), rawData, { headers });
11
+ };
12
+ const del = (http, params) => {
13
+ return raw.del(http, getBaseUrl(params));
14
+ };
15
+
16
+ exports.del = del;
17
+ exports.get = get;
18
+ exports.upsert = upsert;
@@ -0,0 +1,30 @@
1
+ 'use strict';
2
+
3
+ var raw = require('./raw.js');
4
+ var copy = require('fast-copy');
5
+
6
+ const getBaseUrl = (params) => `/organizations/${params.organizationId}/app_definitions/${params.appDefinitionId}/resource_provider/resource_types`;
7
+ const getEntityUrl = (params) => `${getBaseUrl(params)}/${params.resourceTypeId}`;
8
+ const getSpaceEnvUrl = (params) => `/spaces/${params.spaceId}/environments/${params.environmentId}/resource_types`;
9
+ const get = (http, params) => {
10
+ return raw.get(http, getEntityUrl(params));
11
+ };
12
+ const upsert = (http, params, rawData, headers) => {
13
+ const data = copy(rawData);
14
+ return raw.put(http, getEntityUrl(params), data, { headers });
15
+ };
16
+ const del = (http, params) => {
17
+ return raw.del(http, getEntityUrl(params));
18
+ };
19
+ const getMany = (http, params) => {
20
+ return raw.get(http, getBaseUrl(params));
21
+ };
22
+ const getForEnvironment = (http, params) => {
23
+ return raw.get(http, getSpaceEnvUrl(params));
24
+ };
25
+
26
+ exports.del = del;
27
+ exports.get = get;
28
+ exports.getForEnvironment = getForEnvironment;
29
+ exports.getMany = getMany;
30
+ exports.upsert = upsert;
@@ -0,0 +1,10 @@
1
+ 'use strict';
2
+
3
+ var raw = require('./raw.js');
4
+
5
+ const getBaseUrl = (params) => `/spaces/${params.spaceId}/environments/${params.environmentId}/resource_types/${params.resourceTypeId}/resources`;
6
+ const getMany = (http, params) => raw.get(http, getBaseUrl(params), {
7
+ params: params.query,
8
+ });
9
+
10
+ exports.getMany = getMany;
@@ -0,0 +1,48 @@
1
+ 'use strict';
2
+
3
+ var copy = require('fast-copy');
4
+ var raw = require('./raw.js');
5
+ var utils = require('./utils.js');
6
+
7
+ const get = (http, params) => {
8
+ return raw.get(http, `/spaces/${params.spaceId}/roles/${params.roleId}`);
9
+ };
10
+ const getMany = (http, params) => {
11
+ return raw.get(http, `/spaces/${params.spaceId}/roles`, {
12
+ params: utils.normalizeSelect(params.query),
13
+ });
14
+ };
15
+ const getManyForOrganization = (http, params) => {
16
+ return raw.get(http, `/organizations/${params.organizationId}/roles`, {
17
+ params: utils.normalizeSelect(params.query),
18
+ });
19
+ };
20
+ const create = (http, params, data, headers) => {
21
+ return raw.post(http, `/spaces/${params.spaceId}/roles`, data, {
22
+ headers,
23
+ });
24
+ };
25
+ const createWithId = (http, params, data, headers) => {
26
+ return raw.put(http, `/spaces/${params.spaceId}/roles/${params.roleId}`, data, {
27
+ headers,
28
+ });
29
+ };
30
+ const update = (http, params, rawData, headers) => {
31
+ var _a;
32
+ const data = copy(rawData);
33
+ delete data.sys;
34
+ return raw.put(http, `/spaces/${params.spaceId}/roles/${params.roleId}`, data, {
35
+ headers: Object.assign(Object.assign({}, headers), { 'X-Contentful-Version': (_a = rawData.sys.version) !== null && _a !== void 0 ? _a : 0 }),
36
+ });
37
+ };
38
+ const del = (http, params) => {
39
+ return raw.del(http, `/spaces/${params.spaceId}/roles/${params.roleId}`);
40
+ };
41
+
42
+ exports.create = create;
43
+ exports.createWithId = createWithId;
44
+ exports.del = del;
45
+ exports.get = get;
46
+ exports.getMany = getMany;
47
+ exports.getManyForOrganization = getManyForOrganization;
48
+ exports.update = update;
@@ -0,0 +1,44 @@
1
+ 'use strict';
2
+
3
+ var raw = require('./raw.js');
4
+ var utils = require('./utils.js');
5
+
6
+ const get = (http, params) => {
7
+ return raw.get(http, `/spaces/${params.spaceId}/scheduled_actions/${params.scheduledActionId}`, {
8
+ params: {
9
+ 'environment.sys.id': params.environmentId,
10
+ },
11
+ });
12
+ };
13
+ const getMany = (http, params) => {
14
+ return raw.get(http, `/spaces/${params.spaceId}/scheduled_actions`, {
15
+ params: utils.normalizeSelect(params.query),
16
+ });
17
+ };
18
+ const create = (http, params, data) => {
19
+ return raw.post(http, `/spaces/${params.spaceId}/scheduled_actions`, data);
20
+ };
21
+ const del = (http, params) => {
22
+ return raw.del(http, `/spaces/${params.spaceId}/scheduled_actions/${params.scheduledActionId}`, {
23
+ params: {
24
+ 'environment.sys.id': params.environmentId,
25
+ },
26
+ });
27
+ };
28
+ const update = (http, params, data) => {
29
+ var _a;
30
+ return raw.put(http, `/spaces/${params.spaceId}/scheduled_actions/${params.scheduledActionId}`, data, {
31
+ params: {
32
+ 'environment.sys.id': (_a = data.environment) === null || _a === void 0 ? void 0 : _a.sys.id,
33
+ },
34
+ headers: {
35
+ 'X-Contentful-Version': params.version,
36
+ },
37
+ });
38
+ };
39
+
40
+ exports.create = create;
41
+ exports.del = del;
42
+ exports.get = get;
43
+ exports.getMany = getMany;
44
+ exports.update = update;
@@ -0,0 +1,30 @@
1
+ 'use strict';
2
+
3
+ var raw = require('./raw.js');
4
+ var utils = require('./utils.js');
5
+
6
+ const getBaseEntryUrl = (params) => `/spaces/${params.spaceId}/environments/${params.environmentId}/entries/${params.entryId}/snapshots`;
7
+ const getEntryUrl = (params) => getBaseEntryUrl(params) + `/${params.snapshotId}`;
8
+ const getManyForEntry = (http, params) => {
9
+ return raw.get(http, getBaseEntryUrl(params), {
10
+ params: utils.normalizeSelect(params.query),
11
+ });
12
+ };
13
+ const getForEntry = (http, params) => {
14
+ return raw.get(http, getEntryUrl(params));
15
+ };
16
+ const getBaseContentTypeUrl = (params) => `/spaces/${params.spaceId}/environments/${params.environmentId}/content_types/${params.contentTypeId}/snapshots`;
17
+ const getContentTypeUrl = (params) => getBaseContentTypeUrl(params) + `/${params.snapshotId}`;
18
+ const getManyForContentType = (http, params) => {
19
+ return raw.get(http, getBaseContentTypeUrl(params), {
20
+ params: utils.normalizeSelect(params.query),
21
+ });
22
+ };
23
+ const getForContentType = (http, params) => {
24
+ return raw.get(http, getContentTypeUrl(params));
25
+ };
26
+
27
+ exports.getForContentType = getForContentType;
28
+ exports.getForEntry = getForEntry;
29
+ exports.getManyForContentType = getManyForContentType;
30
+ exports.getManyForEntry = getManyForEntry;
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+
3
+ var raw = require('./raw.js');
4
+
5
+ const get = (http, params) => raw.get(http, `/spaces/${params.spaceId}/space_members/${params.spaceMemberId}`);
6
+ const getMany = (http, params) => raw.get(http, `/spaces/${params.spaceId}/space_members`, {
7
+ params: params.query,
8
+ });
9
+
10
+ exports.get = get;
11
+ exports.getMany = getMany;
@@ -0,0 +1,60 @@
1
+ 'use strict';
2
+
3
+ var copy = require('fast-copy');
4
+ var raw = require('./raw.js');
5
+
6
+ function spaceMembershipDeprecationWarning() {
7
+ console.warn('The user attribute in the space membership root is deprecated. The attribute has been moved inside the sys object (i.e. sys.user)');
8
+ }
9
+ const getBaseUrl = (params) => `/spaces/${params.spaceId}/space_memberships`;
10
+ const getEntityUrl = (params) => `${getBaseUrl(params)}/${params.spaceMembershipId}`;
11
+ const get = (http, params) => {
12
+ spaceMembershipDeprecationWarning();
13
+ return raw.get(http, getEntityUrl(params));
14
+ };
15
+ const getMany = (http, params) => {
16
+ spaceMembershipDeprecationWarning();
17
+ return raw.get(http, getBaseUrl(params), {
18
+ params: params.query,
19
+ });
20
+ };
21
+ const getForOrganization = (http, params) => {
22
+ return raw.get(http, `/organizations/${params.organizationId}/space_memberships/${params.spaceMembershipId}`);
23
+ };
24
+ const getManyForOrganization = (http, params) => {
25
+ return raw.get(http, `/organizations/${params.organizationId}/space_memberships`, {
26
+ params: params.query,
27
+ });
28
+ };
29
+ const create = (http, params, data, headers) => {
30
+ spaceMembershipDeprecationWarning();
31
+ return raw.post(http, getBaseUrl(params), data, {
32
+ headers,
33
+ });
34
+ };
35
+ const createWithId = (http, params, data, headers) => {
36
+ spaceMembershipDeprecationWarning();
37
+ return raw.put(http, getEntityUrl(params), data, {
38
+ headers,
39
+ });
40
+ };
41
+ const update = (http, params, rawData, headers) => {
42
+ var _a;
43
+ const data = copy(rawData);
44
+ delete data.sys;
45
+ return raw.put(http, getEntityUrl(params), data, {
46
+ headers: Object.assign(Object.assign({}, headers), { 'X-Contentful-Version': (_a = rawData.sys.version) !== null && _a !== void 0 ? _a : 0 }),
47
+ });
48
+ };
49
+ const del = (http, params) => {
50
+ return raw.del(http, getEntityUrl(params));
51
+ };
52
+
53
+ exports.create = create;
54
+ exports.createWithId = createWithId;
55
+ exports.del = del;
56
+ exports.get = get;
57
+ exports.getForOrganization = getForOrganization;
58
+ exports.getMany = getMany;
59
+ exports.getManyForOrganization = getManyForOrganization;
60
+ exports.update = update;
@@ -0,0 +1,34 @@
1
+ 'use strict';
2
+
3
+ var copy = require('fast-copy');
4
+ var raw = require('./raw.js');
5
+
6
+ const get = (http, params) => raw.get(http, `/spaces/${params.spaceId}`);
7
+ const getMany = (http, params) => raw.get(http, `/spaces`, {
8
+ params: params.query,
9
+ });
10
+ const getManyForOrganization = (http, params) => raw.get(http, `/organizations/${params.organizationId}/spaces`, {
11
+ params: params.query,
12
+ });
13
+ const create = (http, params, payload, headers) => {
14
+ return raw.post(http, `/spaces`, payload, {
15
+ headers: params.organizationId
16
+ ? Object.assign(Object.assign({}, headers), { 'X-Contentful-Organization': params.organizationId }) : headers,
17
+ });
18
+ };
19
+ const update = (http, params, rawData, headers) => {
20
+ var _a;
21
+ const data = copy(rawData);
22
+ delete data.sys;
23
+ return raw.put(http, `/spaces/${params.spaceId}`, data, {
24
+ headers: Object.assign({ 'X-Contentful-Version': (_a = rawData.sys.version) !== null && _a !== void 0 ? _a : 0 }, headers),
25
+ });
26
+ };
27
+ const del = (http, params) => raw.del(http, `/spaces/${params.spaceId}`);
28
+
29
+ exports.create = create;
30
+ exports.del = del;
31
+ exports.get = get;
32
+ exports.getMany = getMany;
33
+ exports.getManyForOrganization = getManyForOrganization;
34
+ exports.update = update;
@@ -0,0 +1,37 @@
1
+ 'use strict';
2
+
3
+ var tslib = require('tslib');
4
+ var copy = require('fast-copy');
5
+ var raw = require('./raw.js');
6
+
7
+ const getBaseUrl = (params) => `/spaces/${params.spaceId}/environments/${params.environmentId}/tags`;
8
+ const getTagUrl = (params) => getBaseUrl(params) + `/${params.tagId}`;
9
+ const get = (http, params) => raw.get(http, getTagUrl(params));
10
+ const getMany = (http, params) => raw.get(http, getBaseUrl(params), {
11
+ params: params.query,
12
+ });
13
+ const createWithId = (http, params, rawData) => {
14
+ var _a;
15
+ const data = copy(rawData);
16
+ return raw.put(http, getTagUrl(params), data, {
17
+ headers: { 'X-Contentful-Tag-Visibility': (_a = rawData.sys.visibility) !== null && _a !== void 0 ? _a : 'private' },
18
+ });
19
+ };
20
+ const update = (http, params, rawData, headers) => {
21
+ var _a;
22
+ const data = copy(rawData);
23
+ delete data.sys;
24
+ return raw.put(http, getTagUrl(params), data, {
25
+ headers: Object.assign({ 'X-Contentful-Version': (_a = rawData.sys.version) !== null && _a !== void 0 ? _a : 0 }, headers),
26
+ });
27
+ };
28
+ const del = (http, _a) => {
29
+ var { version } = _a, params = tslib.__rest(_a, ["version"]);
30
+ return raw.del(http, getTagUrl(params), { headers: { 'X-Contentful-Version': version } });
31
+ };
32
+
33
+ exports.createWithId = createWithId;
34
+ exports.del = del;
35
+ exports.get = get;
36
+ exports.getMany = getMany;
37
+ exports.update = update;
@@ -0,0 +1,40 @@
1
+ 'use strict';
2
+
3
+ var tslib = require('tslib');
4
+ var copy = require('fast-copy');
5
+ var raw = require('./raw.js');
6
+ var utils = require('./utils.js');
7
+
8
+ const getBaseUrl = (params) => `/spaces/${params.spaceId}/environments/${params.environmentId}/entries/${params.entryId}/tasks`;
9
+ const getTaskUrl = (params) => `${getBaseUrl(params)}/${params.taskId}`;
10
+ const get = (http, params) => raw.get(http, getTaskUrl(params));
11
+ const getMany = (http, params) => raw.get(http, getBaseUrl(params), {
12
+ params: utils.normalizeSelect(params.query),
13
+ });
14
+ /**
15
+ * @deprecated use `getMany` instead. `getAll` may never be removed for app compatibility reasons.
16
+ */
17
+ const getAll = getMany;
18
+ const create = (http, params, rawData) => {
19
+ const data = copy(rawData);
20
+ return raw.post(http, getBaseUrl(params), data);
21
+ };
22
+ const update = (http, params, rawData, headers) => {
23
+ var _a;
24
+ const data = copy(rawData);
25
+ delete data.sys;
26
+ return raw.put(http, getTaskUrl(params), data, {
27
+ headers: Object.assign({ 'X-Contentful-Version': (_a = rawData.sys.version) !== null && _a !== void 0 ? _a : 0 }, headers),
28
+ });
29
+ };
30
+ const del = (http, _a) => {
31
+ var { version } = _a, params = tslib.__rest(_a, ["version"]);
32
+ return raw.del(http, getTaskUrl(params), { headers: { 'X-Contentful-Version': version } });
33
+ };
34
+
35
+ exports.create = create;
36
+ exports.del = del;
37
+ exports.get = get;
38
+ exports.getAll = getAll;
39
+ exports.getMany = getMany;
40
+ exports.update = update;
@@ -0,0 +1,35 @@
1
+ 'use strict';
2
+
3
+ var copy = require('fast-copy');
4
+ var raw = require('./raw.js');
5
+ var utils = require('./utils.js');
6
+
7
+ const getBaseUrl = (params) => `/organizations/${params.organizationId}/teams/${params.teamId}/team_memberships`;
8
+ const getEntityUrl = (params) => `/organizations/${params.organizationId}/teams/${params.teamId}/team_memberships/${params.teamMembershipId}`;
9
+ const get = (http, params) => raw.get(http, getEntityUrl(params));
10
+ const getManyForOrganization = (http, params) => raw.get(http, `/organizations/${params.organizationId}/team_memberships`, {
11
+ params: utils.normalizeSelect(params.query),
12
+ });
13
+ const getManyForTeam = (http, params) => {
14
+ return raw.get(http, getBaseUrl(params), {
15
+ params: utils.normalizeSelect(params.query),
16
+ });
17
+ };
18
+ const create = (http, params, rawData, headers) => {
19
+ return raw.post(http, getBaseUrl(params), rawData, { headers });
20
+ };
21
+ const update = (http, params, rawData, headers) => {
22
+ const data = copy(rawData);
23
+ delete data.sys;
24
+ return raw.put(http, getEntityUrl(params), data, {
25
+ headers: Object.assign({ 'X-Contentful-Version': rawData.sys.version || 0 }, headers),
26
+ });
27
+ };
28
+ const del = (http, params) => raw.del(http, getEntityUrl(params));
29
+
30
+ exports.create = create;
31
+ exports.del = del;
32
+ exports.get = get;
33
+ exports.getManyForOrganization = getManyForOrganization;
34
+ exports.getManyForTeam = getManyForTeam;
35
+ exports.update = update;
@@ -0,0 +1,46 @@
1
+ 'use strict';
2
+
3
+ var copy = require('fast-copy');
4
+ var raw = require('./raw.js');
5
+
6
+ const getBaseUrl = (params) => `/spaces/${params.spaceId}/team_space_memberships`;
7
+ const getEntityUrl = (params) => `${getBaseUrl(params)}/${params.teamSpaceMembershipId}`;
8
+ const get = (http, params) => raw.get(http, getEntityUrl(params));
9
+ const getMany = (http, params) => raw.get(http, getBaseUrl(params), {
10
+ params: params.query,
11
+ });
12
+ const getForOrganization = (http, params) => {
13
+ return raw.get(http, `/organizations/${params.organizationId}/team_space_memberships/${params.teamSpaceMembershipId}`);
14
+ };
15
+ const getManyForOrganization = (http, params) => {
16
+ const query = params.query || {};
17
+ if (params.teamId) {
18
+ query['sys.team.sys.id'] = params.teamId;
19
+ }
20
+ return raw.get(http, `/organizations/${params.organizationId}/team_space_memberships`, {
21
+ params: params.query,
22
+ });
23
+ };
24
+ const create = (http, params, rawData, headers) => {
25
+ return raw.post(http, getBaseUrl(params), rawData, {
26
+ headers: Object.assign({ 'x-contentful-team': params.teamId }, headers),
27
+ });
28
+ };
29
+ const update = (http, params, rawData, headers) => {
30
+ const data = copy(rawData);
31
+ delete data.sys;
32
+ return raw.put(http, getEntityUrl(params), data, {
33
+ headers: Object.assign({ 'X-Contentful-Version': rawData.sys.version || 0, 'x-contentful-team': rawData.sys.team.sys.id }, headers),
34
+ });
35
+ };
36
+ const del = (http, params) => {
37
+ return raw.del(http, getEntityUrl(params));
38
+ };
39
+
40
+ exports.create = create;
41
+ exports.del = del;
42
+ exports.get = get;
43
+ exports.getForOrganization = getForOrganization;
44
+ exports.getMany = getMany;
45
+ exports.getManyForOrganization = getManyForOrganization;
46
+ exports.update = update;
@@ -0,0 +1,36 @@
1
+ 'use strict';
2
+
3
+ var copy = require('fast-copy');
4
+ var raw = require('./raw.js');
5
+ var utils = require('./utils.js');
6
+
7
+ const getBaseUrl = (params) => `/organizations/${params.organizationId}/teams`;
8
+ const getEntityUrl = (params) => `${getBaseUrl(params)}/${params.teamId}`;
9
+ const get = (http, params) => raw.get(http, getEntityUrl(params));
10
+ const getMany = (http, params) => raw.get(http, getBaseUrl(params), {
11
+ params: utils.normalizeSelect(params.query),
12
+ });
13
+ const getManyForSpace = (http, params) => {
14
+ return raw.get(http, `/spaces/${params.spaceId}/teams`, {
15
+ params: utils.normalizeSelect(params.query),
16
+ });
17
+ };
18
+ const create = (http, params, rawData, headers) => {
19
+ return raw.post(http, getBaseUrl(params), rawData, { headers });
20
+ };
21
+ const update = (http, params, rawData, headers) => {
22
+ var _a;
23
+ const data = copy(rawData);
24
+ delete data.sys;
25
+ return raw.put(http, getEntityUrl(params), data, {
26
+ headers: Object.assign({ 'X-Contentful-Version': (_a = rawData.sys.version) !== null && _a !== void 0 ? _a : 0 }, headers),
27
+ });
28
+ };
29
+ const del = (http, params) => raw.del(http, getEntityUrl(params));
30
+
31
+ exports.create = create;
32
+ exports.del = del;
33
+ exports.get = get;
34
+ exports.getMany = getMany;
35
+ exports.getManyForSpace = getManyForSpace;
36
+ exports.update = update;
@@ -0,0 +1,22 @@
1
+ 'use strict';
2
+
3
+ var raw = require('./raw.js');
4
+ var copy = require('fast-copy');
5
+
6
+ const getUrl = (params) => `/spaces/${params.spaceId}/environments/${params.environmentId}/ui_config`;
7
+ const get = (http, params) => {
8
+ return raw.get(http, getUrl(params));
9
+ };
10
+ const update = (http, params, rawData) => {
11
+ var _a;
12
+ const data = copy(rawData);
13
+ delete data.sys;
14
+ return raw.put(http, getUrl(params), data, {
15
+ headers: {
16
+ 'X-Contentful-Version': (_a = rawData.sys.version) !== null && _a !== void 0 ? _a : 0,
17
+ },
18
+ });
19
+ };
20
+
21
+ exports.get = get;
22
+ exports.update = update;