contentful-management 12.3.2 → 12.4.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.
- package/dist/browser/index.js +15 -3
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/index.min.js +1 -1
- package/dist/browser/index.min.js.map +1 -1
- package/dist/cjs/index.cjs +15 -3
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/adapters/REST/endpoints/space.mjs +3 -0
- package/dist/esm/adapters/REST/endpoints/space.mjs.map +1 -1
- package/dist/esm/common-types.mjs.map +1 -1
- package/dist/esm/create-contentful-api.mjs +13 -4
- package/dist/esm/create-contentful-api.mjs.map +1 -1
- package/dist/esm/entities/space.mjs +3 -2
- package/dist/esm/entities/space.mjs.map +1 -1
- package/dist/esm/plain/plain-client.mjs.map +1 -1
- package/dist/types/adapters/REST/endpoints/space.js +3 -0
- package/dist/types/adapters/REST/endpoints/space.js.map +1 -1
- package/dist/types/common-types.d.ts +4 -2
- package/dist/types/common-types.js.map +1 -1
- package/dist/types/create-contentful-api.d.ts +8 -1
- package/dist/types/create-contentful-api.js +13 -4
- package/dist/types/create-contentful-api.js.map +1 -1
- package/dist/types/entities/space.d.ts +1 -0
- package/dist/types/entities/space.js +3 -2
- package/dist/types/entities/space.js.map +1 -1
- package/dist/types/plain/entities/space.d.ts +9 -2
- package/dist/types/plain/plain-client.js.map +1 -1
- package/package.json +1 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -2922,6 +2922,9 @@ var Snapshot = /*#__PURE__*/Object.freeze({
|
|
|
2922
2922
|
const get$c = (http, params) => get$14(http, `/spaces/${params.spaceId}`);
|
|
2923
2923
|
const getMany$b = (http, params) => get$14(http, `/spaces`, {
|
|
2924
2924
|
params: params.query,
|
|
2925
|
+
headers: params.organizationId
|
|
2926
|
+
? { 'X-Contentful-Organization': params.organizationId }
|
|
2927
|
+
: undefined,
|
|
2925
2928
|
});
|
|
2926
2929
|
const getManyForOrganization$5 = (http, params) => get$14(http, `/organizations/${params.organizationId}/spaces`, {
|
|
2927
2930
|
params: params.query,
|
|
@@ -10845,6 +10848,7 @@ function wrapSpace(makeRequest, data) {
|
|
|
10845
10848
|
* @internal
|
|
10846
10849
|
*/
|
|
10847
10850
|
const wrapSpaceCollection = wrapCollection(wrapSpace);
|
|
10851
|
+
const wrapSpaceCursorPaginatedCollection = wrapCursorPaginatedCollection(wrapSpace);
|
|
10848
10852
|
|
|
10849
10853
|
/**
|
|
10850
10854
|
* @internal
|
|
@@ -13360,12 +13364,20 @@ function createClientApi(makeRequest) {
|
|
|
13360
13364
|
* .catch(console.error)
|
|
13361
13365
|
* ```
|
|
13362
13366
|
*/
|
|
13363
|
-
getSpaces: function getSpaces(query = {}) {
|
|
13367
|
+
getSpaces: function getSpaces(query = {}, organizationId) {
|
|
13368
|
+
const { cursor, ...rest } = query;
|
|
13369
|
+
const normalizedQuery = cursor
|
|
13370
|
+
? normalizeCursorPaginationParameters(rest)
|
|
13371
|
+
: rest;
|
|
13364
13372
|
return makeRequest({
|
|
13365
13373
|
entityType: 'Space',
|
|
13366
13374
|
action: 'getMany',
|
|
13367
|
-
params: { query: contentfulSdkCore.createRequestConfig({ query:
|
|
13368
|
-
}).then((data) =>
|
|
13375
|
+
params: { query: contentfulSdkCore.createRequestConfig({ query: normalizedQuery }).params, organizationId },
|
|
13376
|
+
}).then((data) =>
|
|
13377
|
+
// makeRequest returns the union type; cursor determines which branch is present at runtime so the casts are required
|
|
13378
|
+
cursor
|
|
13379
|
+
? wrapSpaceCursorPaginatedCollection(makeRequest, normalizeCursorPaginationResponse(data))
|
|
13380
|
+
: wrapSpaceCollection(makeRequest, data));
|
|
13369
13381
|
},
|
|
13370
13382
|
/**
|
|
13371
13383
|
* Gets a space
|