contentful-management 12.4.0 → 12.5.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 (38) hide show
  1. package/dist/browser/index.js +42 -6
  2. package/dist/browser/index.js.map +1 -1
  3. package/dist/browser/index.min.js +1 -1
  4. package/dist/browser/index.min.js.map +1 -1
  5. package/dist/cjs/index.cjs +42 -6
  6. package/dist/cjs/index.cjs.map +1 -1
  7. package/dist/esm/adapters/REST/endpoints/asset.mjs +12 -1
  8. package/dist/esm/adapters/REST/endpoints/asset.mjs.map +1 -1
  9. package/dist/esm/adapters/REST/endpoints/content-type.mjs +9 -1
  10. package/dist/esm/adapters/REST/endpoints/content-type.mjs.map +1 -1
  11. package/dist/esm/adapters/REST/endpoints/entry.mjs +12 -1
  12. package/dist/esm/adapters/REST/endpoints/entry.mjs.map +1 -1
  13. package/dist/esm/adapters/REST/endpoints/space.mjs +4 -2
  14. package/dist/esm/adapters/REST/endpoints/space.mjs.map +1 -1
  15. package/dist/esm/common-types.mjs.map +1 -1
  16. package/dist/esm/create-contentful-api.mjs +8 -4
  17. package/dist/esm/create-contentful-api.mjs.map +1 -1
  18. package/dist/esm/entities/space.mjs.map +1 -1
  19. package/dist/types/adapters/REST/endpoints/asset.d.ts +1 -0
  20. package/dist/types/adapters/REST/endpoints/asset.js +12 -1
  21. package/dist/types/adapters/REST/endpoints/asset.js.map +1 -1
  22. package/dist/types/adapters/REST/endpoints/content-type.d.ts +1 -0
  23. package/dist/types/adapters/REST/endpoints/content-type.js +9 -1
  24. package/dist/types/adapters/REST/endpoints/content-type.js.map +1 -1
  25. package/dist/types/adapters/REST/endpoints/entry.d.ts +1 -0
  26. package/dist/types/adapters/REST/endpoints/entry.js +12 -1
  27. package/dist/types/adapters/REST/endpoints/entry.js.map +1 -1
  28. package/dist/types/adapters/REST/endpoints/space.js +4 -2
  29. package/dist/types/adapters/REST/endpoints/space.js.map +1 -1
  30. package/dist/types/common-types.d.ts +8 -4
  31. package/dist/types/common-types.js.map +1 -1
  32. package/dist/types/create-contentful-api.d.ts +4 -4
  33. package/dist/types/create-contentful-api.js +8 -4
  34. package/dist/types/create-contentful-api.js.map +1 -1
  35. package/dist/types/entities/space.d.ts +23 -0
  36. package/dist/types/entities/space.js.map +1 -1
  37. package/dist/types/plain/entities/space.d.ts +10 -4
  38. package/package.json +1 -1
@@ -10898,6 +10898,16 @@ var contentfulManagement = (function (exports) {
10898
10898
  headers: headers ? { ...headers } : undefined,
10899
10899
  });
10900
10900
  };
10901
+ const getManyWithCursor$2 = (http, params, rawData, headers) => {
10902
+ if (params.releaseId) {
10903
+ throw new Error('getManyWithCursor is not supported for release-scoped assets');
10904
+ }
10905
+ return get$14(http, `/spaces/${params.spaceId}/environments/${params.environmentId}/assets`, {
10906
+ params: { cursor: true, ...(params.query ?? {}) },
10907
+ headers: headers ? { ...headers } : undefined,
10908
+ })
10909
+ .then(normalizeCursorPaginationResponse);
10910
+ };
10901
10911
  const update$t = (http, params, rawData, headers) => {
10902
10912
  if (params.releaseId) {
10903
10913
  return update$u(http, params, rawData, headers ?? {});
@@ -11081,6 +11091,7 @@ var contentfulManagement = (function (exports) {
11081
11091
  del: del$t,
11082
11092
  get: get$L,
11083
11093
  getMany: getMany$E,
11094
+ getManyWithCursor: getManyWithCursor$2,
11084
11095
  getPublished: getPublished$1,
11085
11096
  processForAllLocales: processForAllLocales,
11086
11097
  processForLocale: processForLocale,
@@ -11419,6 +11430,13 @@ var contentfulManagement = (function (exports) {
11419
11430
  headers,
11420
11431
  });
11421
11432
  };
11433
+ const getManyWithCursor$1 = (http, params, headers) => {
11434
+ return get$14(http, getBaseUrl$j(params), {
11435
+ params: { cursor: true, ...(params.query ?? {}) },
11436
+ headers,
11437
+ })
11438
+ .then(normalizeCursorPaginationResponse);
11439
+ };
11422
11440
  const create$n = (http, params, rawData, headers) => {
11423
11441
  const data = index$2(rawData);
11424
11442
  return post$1(http, getBaseUrl$j(params), data, { headers });
@@ -11459,6 +11477,7 @@ var contentfulManagement = (function (exports) {
11459
11477
  del: del$p,
11460
11478
  get: get$G,
11461
11479
  getMany: getMany$y,
11480
+ getManyWithCursor: getManyWithCursor$1,
11462
11481
  publish: publish$2,
11463
11482
  unpublish: unpublish$2,
11464
11483
  update: update$p
@@ -11585,6 +11604,16 @@ var contentfulManagement = (function (exports) {
11585
11604
  headers: { ...headers },
11586
11605
  });
11587
11606
  };
11607
+ const getManyWithCursor = (http, params, rawData, headers) => {
11608
+ if (params.releaseId) {
11609
+ throw new Error('getManyWithCursor is not supported for release-scoped entries');
11610
+ }
11611
+ return get$14(http, `/spaces/${params.spaceId}/environments/${params.environmentId}/entries`, {
11612
+ params: { cursor: true, ...(params.query ?? {}) },
11613
+ headers: { ...headers },
11614
+ })
11615
+ .then(normalizeCursorPaginationResponse);
11616
+ };
11588
11617
  const patch$1 = (http, params, data, headers) => {
11589
11618
  if (params.releaseId) {
11590
11619
  return patch$2(http, params, data, headers ?? {});
@@ -11676,6 +11705,7 @@ var contentfulManagement = (function (exports) {
11676
11705
  del: del$o,
11677
11706
  get: get$D,
11678
11707
  getMany: getMany$u,
11708
+ getManyWithCursor: getManyWithCursor,
11679
11709
  getPublished: getPublished,
11680
11710
  patch: patch$1,
11681
11711
  publish: publish$1,
@@ -12658,9 +12688,11 @@ var contentfulManagement = (function (exports) {
12658
12688
  getManyForEntry: getManyForEntry
12659
12689
  });
12660
12690
 
12661
- const get$c = (http, params) => get$14(http, `/spaces/${params.spaceId}`);
12691
+ const get$c = (http, params) => get$14(http, `/spaces/${params.spaceId}`, {
12692
+ params: params.include ? { include: params.include } : undefined,
12693
+ });
12662
12694
  const getMany$b = (http, params) => get$14(http, `/spaces`, {
12663
- params: params.query,
12695
+ params: { ...params.query, ...(params.include ? { include: params.include } : {}) },
12664
12696
  headers: params.organizationId
12665
12697
  ? { 'X-Contentful-Organization': params.organizationId }
12666
12698
  : undefined,
@@ -23104,14 +23136,18 @@ var contentfulManagement = (function (exports) {
23104
23136
  * ```
23105
23137
  */
23106
23138
  getSpaces: function getSpaces(query = {}, organizationId) {
23107
- const { cursor, ...rest } = query;
23139
+ const { cursor, include, ...rest } = query;
23108
23140
  const normalizedQuery = cursor
23109
23141
  ? normalizeCursorPaginationParameters(rest)
23110
23142
  : rest;
23111
23143
  return makeRequest({
23112
23144
  entityType: 'Space',
23113
23145
  action: 'getMany',
23114
- params: { query: createRequestConfig({ query: normalizedQuery }).params, organizationId },
23146
+ params: {
23147
+ query: createRequestConfig({ query: normalizedQuery }).params,
23148
+ organizationId,
23149
+ include,
23150
+ },
23115
23151
  }).then((data) =>
23116
23152
  // makeRequest returns the union type; cursor determines which branch is present at runtime so the casts are required
23117
23153
  cursor
@@ -23134,11 +23170,11 @@ var contentfulManagement = (function (exports) {
23134
23170
  * .catch(console.error)
23135
23171
  * ```
23136
23172
  */
23137
- getSpace: function getSpace(spaceId) {
23173
+ getSpace: function getSpace(spaceId, { include } = {}) {
23138
23174
  return makeRequest({
23139
23175
  entityType: 'Space',
23140
23176
  action: 'get',
23141
- params: { spaceId },
23177
+ params: { spaceId, include },
23142
23178
  }).then((data) => wrapSpace(makeRequest, data));
23143
23179
  },
23144
23180
  /**