contentful-management 12.3.3 → 12.5.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.
@@ -12658,9 +12658,14 @@ var contentfulManagement = (function (exports) {
12658
12658
  getManyForEntry: getManyForEntry
12659
12659
  });
12660
12660
 
12661
- const get$c = (http, params) => get$14(http, `/spaces/${params.spaceId}`);
12661
+ const get$c = (http, params) => get$14(http, `/spaces/${params.spaceId}`, {
12662
+ params: params.include ? { include: params.include } : undefined,
12663
+ });
12662
12664
  const getMany$b = (http, params) => get$14(http, `/spaces`, {
12663
- params: params.query,
12665
+ params: { ...params.query, ...(params.include ? { include: params.include } : {}) },
12666
+ headers: params.organizationId
12667
+ ? { 'X-Contentful-Organization': params.organizationId }
12668
+ : undefined,
12664
12669
  });
12665
12670
  const getManyForOrganization$5 = (http, params) => get$14(http, `/organizations/${params.organizationId}/spaces`, {
12666
12671
  params: params.query,
@@ -20584,6 +20589,7 @@ var contentfulManagement = (function (exports) {
20584
20589
  * @internal
20585
20590
  */
20586
20591
  const wrapSpaceCollection = wrapCollection(wrapSpace);
20592
+ const wrapSpaceCursorPaginatedCollection = wrapCursorPaginatedCollection(wrapSpace);
20587
20593
 
20588
20594
  /**
20589
20595
  * @internal
@@ -23099,12 +23105,24 @@ var contentfulManagement = (function (exports) {
23099
23105
  * .catch(console.error)
23100
23106
  * ```
23101
23107
  */
23102
- getSpaces: function getSpaces(query = {}) {
23108
+ getSpaces: function getSpaces(query = {}, organizationId) {
23109
+ const { cursor, include, ...rest } = query;
23110
+ const normalizedQuery = cursor
23111
+ ? normalizeCursorPaginationParameters(rest)
23112
+ : rest;
23103
23113
  return makeRequest({
23104
23114
  entityType: 'Space',
23105
23115
  action: 'getMany',
23106
- params: { query: createRequestConfig({ query: query }).params },
23107
- }).then((data) => wrapSpaceCollection(makeRequest, data));
23116
+ params: {
23117
+ query: createRequestConfig({ query: normalizedQuery }).params,
23118
+ organizationId,
23119
+ include,
23120
+ },
23121
+ }).then((data) =>
23122
+ // makeRequest returns the union type; cursor determines which branch is present at runtime so the casts are required
23123
+ cursor
23124
+ ? wrapSpaceCursorPaginatedCollection(makeRequest, normalizeCursorPaginationResponse(data))
23125
+ : wrapSpaceCollection(makeRequest, data));
23108
23126
  },
23109
23127
  /**
23110
23128
  * Gets a space
@@ -23122,11 +23140,11 @@ var contentfulManagement = (function (exports) {
23122
23140
  * .catch(console.error)
23123
23141
  * ```
23124
23142
  */
23125
- getSpace: function getSpace(spaceId) {
23143
+ getSpace: function getSpace(spaceId, { include } = {}) {
23126
23144
  return makeRequest({
23127
23145
  entityType: 'Space',
23128
23146
  action: 'get',
23129
- params: { spaceId },
23147
+ params: { spaceId, include },
23130
23148
  }).then((data) => wrapSpace(makeRequest, data));
23131
23149
  },
23132
23150
  /**