contentful-management 11.58.0-canary.4 → 11.58.1

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 (30) hide show
  1. package/README.md +0 -14
  2. package/dist/contentful-management.browser.js +63 -558
  3. package/dist/contentful-management.browser.js.map +1 -1
  4. package/dist/contentful-management.browser.min.js +1 -1
  5. package/dist/contentful-management.node.js +63 -500
  6. package/dist/contentful-management.node.js.map +1 -1
  7. package/dist/contentful-management.node.min.js +1 -1
  8. package/dist/es-modules/adapters/REST/endpoints/asset.js +0 -35
  9. package/dist/es-modules/adapters/REST/endpoints/entry.js +0 -19
  10. package/dist/es-modules/adapters/REST/endpoints/index.js +0 -4
  11. package/dist/es-modules/adapters/REST/endpoints/release.js +0 -24
  12. package/dist/es-modules/contentful-management.js +1 -1
  13. package/dist/es-modules/entities/app-action-call.js +8 -44
  14. package/dist/es-modules/plain/plain-client.js +0 -33
  15. package/dist/typings/adapters/REST/endpoints/index.d.ts +0 -4
  16. package/dist/typings/common-types.d.ts +10 -212
  17. package/dist/typings/create-entry-api.d.ts +1 -1
  18. package/dist/typings/create-environment-api.d.ts +4 -4
  19. package/dist/typings/entities/app-action-call.d.ts +22 -14
  20. package/dist/typings/entities/asset.d.ts +3 -3
  21. package/dist/typings/entities/entry.d.ts +3 -3
  22. package/dist/typings/entities/release.d.ts +1 -18
  23. package/dist/typings/export-types.d.ts +1 -1
  24. package/dist/typings/plain/common-types.d.ts +11 -81
  25. package/dist/typings/plain/wrappers/wrap.d.ts +0 -2
  26. package/package.json +2 -6
  27. package/dist/es-modules/adapters/REST/endpoints/release-asset.js +0 -179
  28. package/dist/es-modules/adapters/REST/endpoints/release-entry.js +0 -54
  29. package/dist/typings/adapters/REST/endpoints/release-asset.d.ts +0 -9
  30. package/dist/typings/adapters/REST/endpoints/release-entry.d.ts +0 -7
@@ -13,11 +13,7 @@ import { getUploadHttpClient } from '../../../upload-http-client';
13
13
  import * as raw from './raw';
14
14
  import { create as createUpload } from './upload';
15
15
  import { normalizeSelect } from './utils';
16
- import * as releaseAsset from './release-asset';
17
16
  export const get = (http, params, rawData, headers) => {
18
- if (params.releaseId) {
19
- return releaseAsset.get(http, params);
20
- }
21
17
  return raw.get(http, `/spaces/${params.spaceId}/environments/${params.environmentId}/assets/${params.assetId}`, {
22
18
  params: normalizeSelect(params.query),
23
19
  headers: headers ? _objectSpread({}, headers) : undefined
@@ -30,9 +26,6 @@ export const getPublished = (http, params, rawData, headers) => {
30
26
  });
31
27
  };
32
28
  export const getMany = (http, params, rawData, headers) => {
33
- if (params.releaseId) {
34
- return releaseAsset.getMany(http, params);
35
- }
36
29
  return raw.get(http, `/spaces/${params.spaceId}/environments/${params.environmentId}/assets`, {
37
30
  params: normalizeSelect(params.query),
38
31
  headers: headers ? _objectSpread({}, headers) : undefined
@@ -40,9 +33,6 @@ export const getMany = (http, params, rawData, headers) => {
40
33
  };
41
34
  export const update = (http, params, rawData, headers) => {
42
35
  var _rawData$sys$version;
43
- if (params.releaseId) {
44
- return releaseAsset.update(http, params, rawData, headers !== null && headers !== void 0 ? headers : {});
45
- }
46
36
  const data = copy(rawData);
47
37
  delete data.sys;
48
38
  return raw.put(http, `/spaces/${params.spaceId}/environments/${params.environmentId}/assets/${params.assetId}`, data, {
@@ -95,23 +85,14 @@ export const unarchive = (http, params) => {
95
85
  return raw.del(http, `/spaces/${params.spaceId}/environments/${params.environmentId}/assets/${params.assetId}/archived`);
96
86
  };
97
87
  export const create = (http, params, rawData) => {
98
- if (params.releaseId) {
99
- return releaseAsset.create(http, params, rawData, {});
100
- }
101
88
  const data = copy(rawData);
102
89
  return raw.post(http, `/spaces/${params.spaceId}/environments/${params.environmentId}/assets`, data);
103
90
  };
104
91
  export const createWithId = (http, params, rawData) => {
105
- if (params.releaseId) {
106
- return releaseAsset.createWithId(http, params, rawData, {});
107
- }
108
92
  const data = copy(rawData);
109
93
  return raw.put(http, `/spaces/${params.spaceId}/environments/${params.environmentId}/assets/${params.assetId}`, data);
110
94
  };
111
95
  export const createFromFiles = async (http, params, data) => {
112
- if (params.releaseId) {
113
- return releaseAsset.createFromFiles(http, params, data, {});
114
- }
115
96
  const httpUpload = getUploadHttpClient(http, {
116
97
  uploadTimeout: params.uploadTimeout
117
98
  });
@@ -194,16 +175,6 @@ export const processForLocale = async (http, _ref) => {
194
175
  } = {}
195
176
  } = _ref,
196
177
  params = _objectWithoutProperties(_ref, _excluded);
197
- if (asset.sys.release) {
198
- return releaseAsset.processForLocale(http, _objectSpread({
199
- asset: asset,
200
- locale,
201
- options: {
202
- processingCheckRetries,
203
- processingCheckWait
204
- }
205
- }, params));
206
- }
207
178
  return raw.put(http, `/spaces/${params.spaceId}/environments/${params.environmentId}/assets/${asset.sys.id}/files/${locale}/process`, null, {
208
179
  headers: {
209
180
  'X-Contentful-Version': asset.sys.version
@@ -228,12 +199,6 @@ export const processForAllLocales = async (http, _ref2) => {
228
199
  options = {}
229
200
  } = _ref2,
230
201
  params = _objectWithoutProperties(_ref2, _excluded2);
231
- if (asset.sys.release) {
232
- return releaseAsset.processForAllLocales(http, _objectSpread({
233
- asset: asset,
234
- options
235
- }, params));
236
- }
237
202
  const locales = Object.keys(asset.fields.file || {});
238
203
  let mostUpToDateAssetVersion = asset;
239
204
 
@@ -5,12 +5,8 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
5
5
  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); }
6
6
  import copy from 'fast-copy';
7
7
  import * as raw from './raw';
8
- import * as releaseEntry from './release-entry';
9
8
  import { normalizeSelect } from './utils';
10
9
  export const get = (http, params, rawData, headers) => {
11
- if (params.releaseId) {
12
- return releaseEntry.get(http, params);
13
- }
14
10
  return raw.get(http, `/spaces/${params.spaceId}/environments/${params.environmentId}/entries/${params.entryId}`, {
15
11
  params: normalizeSelect(params.query),
16
12
  headers: _objectSpread({}, headers)
@@ -23,18 +19,12 @@ export const getPublished = (http, params, rawData, headers) => {
23
19
  });
24
20
  };
25
21
  export const getMany = (http, params, rawData, headers) => {
26
- if (params.releaseId) {
27
- return releaseEntry.getMany(http, params);
28
- }
29
22
  return raw.get(http, `/spaces/${params.spaceId}/environments/${params.environmentId}/entries`, {
30
23
  params: normalizeSelect(params.query),
31
24
  headers: _objectSpread({}, headers)
32
25
  });
33
26
  };
34
27
  export const patch = (http, params, data, headers) => {
35
- if (params.releaseId) {
36
- return releaseEntry.patch(http, params, data, headers !== null && headers !== void 0 ? headers : {});
37
- }
38
28
  return raw.patch(http, `/spaces/${params.spaceId}/environments/${params.environmentId}/entries/${params.entryId}`, data, {
39
29
  headers: _objectSpread({
40
30
  'X-Contentful-Version': params.version,
@@ -44,9 +34,6 @@ export const patch = (http, params, data, headers) => {
44
34
  };
45
35
  export const update = (http, params, rawData, headers) => {
46
36
  var _rawData$sys$version;
47
- if (params.releaseId) {
48
- return releaseEntry.update(http, params, rawData, headers !== null && headers !== void 0 ? headers : {});
49
- }
50
37
  const data = copy(rawData);
51
38
  delete data.sys;
52
39
  return raw.put(http, `/spaces/${params.spaceId}/environments/${params.environmentId}/entries/${params.entryId}`, data, {
@@ -99,9 +86,6 @@ export const unarchive = (http, params) => {
99
86
  return raw.del(http, `/spaces/${params.spaceId}/environments/${params.environmentId}/entries/${params.entryId}/archived`);
100
87
  };
101
88
  export const create = (http, params, rawData) => {
102
- if (params.releaseId) {
103
- return releaseEntry.create(http, params, rawData, {});
104
- }
105
89
  const data = copy(rawData);
106
90
  return raw.post(http, `/spaces/${params.spaceId}/environments/${params.environmentId}/entries`, data, {
107
91
  headers: {
@@ -110,9 +94,6 @@ export const create = (http, params, rawData) => {
110
94
  });
111
95
  };
112
96
  export const createWithId = (http, params, rawData) => {
113
- if (params.releaseId) {
114
- return releaseEntry.createWithId(http, params, rawData, {});
115
- }
116
97
  const data = copy(rawData);
117
98
  return raw.put(http, `/spaces/${params.spaceId}/environments/${params.environmentId}/entries/${params.entryId}`, data, {
118
99
  headers: {
@@ -39,8 +39,6 @@ import * as OAuthApplication from './oauth-application';
39
39
  import * as PersonalAccessToken from './personal-access-token';
40
40
  import * as PreviewApiKey from './preview-api-key';
41
41
  import * as Release from './release';
42
- import * as ReleaseAsset from './release-asset';
43
- import * as ReleaseEntry from './release-entry';
44
42
  import * as ReleaseAction from './release-action';
45
43
  import * as Resource from './resource';
46
44
  import * as ResourceProvider from './resource-provider';
@@ -108,8 +106,6 @@ export default {
108
106
  AccessToken,
109
107
  PreviewApiKey,
110
108
  Release,
111
- ReleaseAsset,
112
- ReleaseEntry,
113
109
  ReleaseAction,
114
110
  Resource,
115
111
  ResourceProvider,
@@ -8,38 +8,14 @@ export const get = (http, params) => {
8
8
  return raw.get(http, `/spaces/${params.spaceId}/environments/${params.environmentId}/releases/${params.releaseId}`);
9
9
  };
10
10
  export const query = (http, params) => {
11
- var _ref, _params$query$sysSch, _params$query;
12
- // Set the schema version in the query if provided in params or query options
13
- const releaseSchemaVersion = (_ref = (_params$query$sysSch = (_params$query = params.query) === null || _params$query === void 0 ? void 0 : _params$query['sys.schemaVersion']) !== null && _params$query$sysSch !== void 0 ? _params$query$sysSch : params.releaseSchemaVersion) !== null && _ref !== void 0 ? _ref : undefined;
14
- if (releaseSchemaVersion !== undefined) {
15
- params.query = _objectSpread(_objectSpread({}, params.query), {}, {
16
- 'sys.schemaVersion': releaseSchemaVersion
17
- });
18
- }
19
11
  return raw.get(http, `/spaces/${params.spaceId}/environments/${params.environmentId}/releases`, {
20
12
  params: params.query
21
13
  });
22
14
  };
23
15
  export const create = (http, params, payload) => {
24
- var _payload$sys$schemaVe, _payload$sys;
25
- const releaseSchemaVersion = (_payload$sys$schemaVe = (_payload$sys = payload.sys) === null || _payload$sys === void 0 ? void 0 : _payload$sys.schemaVersion) !== null && _payload$sys$schemaVe !== void 0 ? _payload$sys$schemaVe : params.releaseSchemaVersion;
26
- if (releaseSchemaVersion === 'Release.v2') {
27
- payload.sys = _objectSpread(_objectSpread({}, payload.sys), {}, {
28
- type: 'Release',
29
- schemaVersion: 'Release.v2'
30
- });
31
- }
32
16
  return raw.post(http, `/spaces/${params.spaceId}/environments/${params.environmentId}/releases`, payload);
33
17
  };
34
18
  export const update = (http, params, payload, headers) => {
35
- var _payload$sys$schemaVe2, _payload$sys2;
36
- const releaseSchemaVersion = (_payload$sys$schemaVe2 = (_payload$sys2 = payload.sys) === null || _payload$sys2 === void 0 ? void 0 : _payload$sys2.schemaVersion) !== null && _payload$sys$schemaVe2 !== void 0 ? _payload$sys$schemaVe2 : params.releaseSchemaVersion;
37
- if (releaseSchemaVersion === 'Release.v2') {
38
- payload.sys = _objectSpread(_objectSpread({}, payload.sys), {}, {
39
- type: 'Release',
40
- schemaVersion: 'Release.v2'
41
- });
42
- }
43
19
  return raw.put(http, `/spaces/${params.spaceId}/environments/${params.environmentId}/releases/${params.releaseId}`, payload, {
44
20
  headers: _objectSpread({
45
21
  'X-Contentful-Version': params.version
@@ -47,7 +47,7 @@ function createClient(params, opts = {}) {
47
47
  const sdkMain = opts.type === 'plain' ? 'contentful-management-plain.js' : 'contentful-management.js';
48
48
  const userAgent = getUserAgentHeader(
49
49
  // @ts-expect-error
50
- `${sdkMain}/${"11.58.0-canary.4"}`, params.application, params.integration, params.feature);
50
+ `${sdkMain}/${"11.58.1"}`, params.application, params.integration, params.feature);
51
51
  const adapter = createAdapter(_objectSpread(_objectSpread({}, params), {}, {
52
52
  userAgent
53
53
  }));
@@ -6,74 +6,38 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
6
6
  import copy from 'fast-copy';
7
7
  import { toPlainObject } from 'contentful-sdk-core';
8
8
  import enhanceWithMethods from '../enhance-with-methods';
9
-
10
- // Raw App Action call response (new endpoint). Not yet wired to runtime behavior.
11
-
12
9
  /**
13
10
  * @private
14
11
  */
15
12
  export default function createAppActionCallApi(makeRequest, retryOptions) {
16
13
  return {
17
- createWithResponse: function () {
18
- const payload = {
19
- parameters: {
20
- recipient: 'Alice <alice@my-company.com>',
21
- message_body: 'Hello from Bob!'
22
- }
23
- };
14
+ createWithResponse: function (params, payload) {
24
15
  return makeRequest({
25
16
  entityType: 'AppActionCall',
26
17
  action: 'createWithResponse',
27
- params: _objectSpread({
28
- spaceId: 'space-id',
29
- environmentId: 'environment-id',
30
- appDefinitionId: 'app-definiton-id',
31
- appActionId: 'app-action-id'
32
- }, retryOptions),
18
+ params: _objectSpread(_objectSpread({}, params), retryOptions),
33
19
  payload: payload
34
20
  }).then(data => wrapAppActionCallResponse(makeRequest, data));
35
21
  },
36
- getCallDetails: function getCallDetails() {
22
+ getCallDetails: function getCallDetails(params) {
37
23
  return makeRequest({
38
24
  entityType: 'AppActionCall',
39
25
  action: 'getCallDetails',
40
- params: {
41
- spaceId: 'space-id',
42
- environmentId: 'environment-id',
43
- callId: 'call-id',
44
- appActionId: 'app-action-id'
45
- }
26
+ params
46
27
  }).then(data => wrapAppActionCallResponse(makeRequest, data));
47
28
  },
48
- get: function get() {
29
+ get: function get(params) {
49
30
  return makeRequest({
50
31
  entityType: 'AppActionCall',
51
32
  action: 'get',
52
- params: {
53
- spaceId: 'space-id',
54
- environmentId: 'environment-id',
55
- appDefinitionId: 'app-definiton-id',
56
- appActionId: 'app-action-id',
57
- callId: 'call-id'
58
- }
33
+ params
59
34
  }).then(data => wrapAppActionCall(makeRequest, data));
60
35
  },
61
- createWithResult: function () {
62
- const payload = {
63
- parameters: {
64
- recipient: 'Alice <alice@my-company.com>',
65
- message_body: 'Hello from Bob!'
66
- }
67
- };
36
+ createWithResult: function (params, payload) {
68
37
  return makeRequest({
69
38
  entityType: 'AppActionCall',
70
39
  action: 'createWithResult',
71
- params: _objectSpread({
72
- spaceId: 'space-id',
73
- environmentId: 'environment-id',
74
- appDefinitionId: 'app-definiton-id',
75
- appActionId: 'app-action-id'
76
- }, retryOptions),
40
+ params: _objectSpread(_objectSpread({}, params), retryOptions),
77
41
  payload: payload
78
42
  }).then(data => wrapAppActionCall(makeRequest, data));
79
43
  }
@@ -346,39 +346,6 @@ export const createPlainClient = (makeRequest, defaults) => {
346
346
  getManyForOrganization: wrap(wrapParams, 'Usage', 'getManyForOrganization')
347
347
  },
348
348
  release: {
349
- asset: {
350
- get: wrap(wrapParams, 'ReleaseAsset', 'get'),
351
- getMany: wrap(wrapParams, 'ReleaseAsset', 'getMany'),
352
- update: wrap(wrapParams, 'ReleaseAsset', 'update'),
353
- create: wrap(wrapParams, 'ReleaseAsset', 'create'),
354
- createWithId: wrap(wrapParams, 'ReleaseAsset', 'createWithId'),
355
- createFromFiles: wrap(wrapParams, 'ReleaseAsset', 'createFromFiles'),
356
- processForAllLocales: (params, asset, options) => makeRequest({
357
- entityType: 'ReleaseAsset',
358
- action: 'processForAllLocales',
359
- params: _objectSpread(_objectSpread({}, _objectSpread(_objectSpread({}, defaults), params)), {}, {
360
- options,
361
- asset
362
- })
363
- }),
364
- processForLocale: (params, asset, locale, options) => makeRequest({
365
- entityType: 'ReleaseAsset',
366
- action: 'processForLocale',
367
- params: _objectSpread(_objectSpread({}, _objectSpread(_objectSpread({}, defaults), params)), {}, {
368
- locale,
369
- asset,
370
- options
371
- })
372
- })
373
- },
374
- entry: {
375
- get: wrap(wrapParams, 'ReleaseEntry', 'get'),
376
- getMany: wrap(wrapParams, 'ReleaseEntry', 'getMany'),
377
- update: wrap(wrapParams, 'ReleaseEntry', 'update'),
378
- patch: wrap(wrapParams, 'ReleaseEntry', 'patch'),
379
- create: wrap(wrapParams, 'ReleaseEntry', 'create'),
380
- createWithId: wrap(wrapParams, 'ReleaseEntry', 'createWithId')
381
- },
382
349
  archive: wrap(wrapParams, 'Release', 'archive'),
383
350
  get: wrap(wrapParams, 'Release', 'get'),
384
351
  query: wrap(wrapParams, 'Release', 'query'),
@@ -39,8 +39,6 @@ import * as OAuthApplication from './oauth-application';
39
39
  import * as PersonalAccessToken from './personal-access-token';
40
40
  import * as PreviewApiKey from './preview-api-key';
41
41
  import * as Release from './release';
42
- import * as ReleaseAsset from './release-asset';
43
- import * as ReleaseEntry from './release-entry';
44
42
  import * as ReleaseAction from './release-action';
45
43
  import * as Resource from './resource';
46
44
  import * as ResourceProvider from './resource-provider';
@@ -108,8 +106,6 @@ declare const _default: {
108
106
  AccessToken: typeof AccessToken;
109
107
  PreviewApiKey: typeof PreviewApiKey;
110
108
  Release: typeof Release;
111
- ReleaseAsset: typeof ReleaseAsset;
112
- ReleaseEntry: typeof ReleaseEntry;
113
109
  ReleaseAction: typeof ReleaseAction;
114
110
  Resource: typeof Resource;
115
111
  ResourceProvider: typeof ResourceProvider;