contentful-management 11.55.0-canary.6 → 11.55.0-canary.8
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/contentful-management.browser.js +17 -1
- package/dist/contentful-management.browser.js.map +1 -1
- package/dist/contentful-management.browser.min.js +1 -1
- package/dist/contentful-management.node.js +17 -1
- package/dist/contentful-management.node.js.map +1 -1
- package/dist/contentful-management.node.min.js +1 -1
- package/dist/es-modules/adapters/REST/endpoints/entry.js +3 -0
- package/dist/es-modules/adapters/REST/endpoints/release-entry.js +11 -0
- package/dist/es-modules/contentful-management.js +1 -1
- package/dist/es-modules/plain/plain-client.js +1 -0
- package/dist/typings/adapters/REST/endpoints/release-entry.d.ts +1 -0
- package/dist/typings/common-types.d.ts +21 -1
- package/dist/typings/plain/common-types.d.ts +12 -2
- package/package.json +1 -1
|
@@ -104,6 +104,9 @@ export const unarchive = (http, params) => {
|
|
|
104
104
|
return raw.del(http, `/spaces/${params.spaceId}/environments/${params.environmentId}/entries/${params.entryId}/archived`);
|
|
105
105
|
};
|
|
106
106
|
export const create = (http, params, rawData) => {
|
|
107
|
+
if (params.releaseId) {
|
|
108
|
+
return releaseEntry.create(http, params, rawData, {});
|
|
109
|
+
}
|
|
107
110
|
const data = copy(rawData);
|
|
108
111
|
return raw.post(http, `/spaces/${params.spaceId}/environments/${params.environmentId}/entries`, data, {
|
|
109
112
|
headers: {
|
|
@@ -39,6 +39,17 @@ export const patch = (http, params, data, headers) => {
|
|
|
39
39
|
}, headers)
|
|
40
40
|
});
|
|
41
41
|
};
|
|
42
|
+
export const create = (http, params, rawData, headers) => {
|
|
43
|
+
params.query = _objectSpread(_objectSpread({}, params.query), {}, {
|
|
44
|
+
'sys.schemaVersion': 'Release.V2'
|
|
45
|
+
});
|
|
46
|
+
const data = copy(rawData);
|
|
47
|
+
return raw.post(http, `/spaces/${params.spaceId}/environments/${params.environmentId}/releases/${params.releaseId}/entries`, data, {
|
|
48
|
+
headers: _objectSpread({
|
|
49
|
+
'X-Contentful-Content-Type': params.contentTypeId
|
|
50
|
+
}, headers)
|
|
51
|
+
});
|
|
52
|
+
};
|
|
42
53
|
export const createWithId = (http, params, rawData, headers) => {
|
|
43
54
|
params.query = _objectSpread(_objectSpread({}, params.query), {}, {
|
|
44
55
|
'sys.schemaVersion': 'Release.V2'
|
|
@@ -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.55.0-canary.
|
|
50
|
+
`${sdkMain}/${"11.55.0-canary.8"}`, params.application, params.integration, params.feature);
|
|
51
51
|
const adapter = createAdapter(_objectSpread(_objectSpread({}, params), {}, {
|
|
52
52
|
userAgent
|
|
53
53
|
}));
|
|
@@ -348,6 +348,7 @@ export const createPlainClient = (makeRequest, defaults) => {
|
|
|
348
348
|
getMany: wrap(wrapParams, 'ReleaseEntry', 'getMany'),
|
|
349
349
|
update: wrap(wrapParams, 'ReleaseEntry', 'update'),
|
|
350
350
|
patch: wrap(wrapParams, 'ReleaseEntry', 'patch'),
|
|
351
|
+
create: wrap(wrapParams, 'ReleaseEntry', 'create'),
|
|
351
352
|
createWithId: wrap(wrapParams, 'ReleaseEntry', 'createWithId')
|
|
352
353
|
},
|
|
353
354
|
archive: wrap(wrapParams, 'Release', 'archive'),
|
|
@@ -3,4 +3,5 @@ export declare const get: RestEndpoint<'ReleaseEntry', 'get'>;
|
|
|
3
3
|
export declare const getMany: RestEndpoint<'ReleaseEntry', 'getMany'>;
|
|
4
4
|
export declare const update: RestEndpoint<'ReleaseEntry', 'update'>;
|
|
5
5
|
export declare const patch: RestEndpoint<'ReleaseEntry', 'patch'>;
|
|
6
|
+
export declare const create: RestEndpoint<'ReleaseEntry', 'create'>;
|
|
6
7
|
export declare const createWithId: RestEndpoint<'ReleaseEntry', 'createWithId'>;
|
|
@@ -455,6 +455,7 @@ type MRInternal<UA extends boolean> = {
|
|
|
455
455
|
(opts: MROpts<'ReleaseEntry', 'getMany', UA>): MRReturn<'ReleaseEntry', 'getMany'>;
|
|
456
456
|
(opts: MROpts<'ReleaseEntry', 'update', UA>): MRReturn<'ReleaseEntry', 'update'>;
|
|
457
457
|
(opts: MROpts<'ReleaseEntry', 'patch', UA>): MRReturn<'ReleaseEntry', 'patch'>;
|
|
458
|
+
(opts: MROpts<'ReleaseEntry', 'create', UA>): MRReturn<'ReleaseEntry', 'create'>;
|
|
458
459
|
(opts: MROpts<'ReleaseEntry', 'createWithId', UA>): MRReturn<'ReleaseEntry', 'createWithId'>;
|
|
459
460
|
(opts: MROpts<'Resource', 'getMany', UA>): MRReturn<'Resource', 'getMany'>;
|
|
460
461
|
(opts: MROpts<'ResourceProvider', 'get', UA>): MRReturn<'ResourceProvider', 'get'>;
|
|
@@ -1546,7 +1547,8 @@ export type MRActions = {
|
|
|
1546
1547
|
create: {
|
|
1547
1548
|
params: GetSpaceEnvironmentParams & {
|
|
1548
1549
|
contentTypeId: string;
|
|
1549
|
-
|
|
1550
|
+
releaseId?: string;
|
|
1551
|
+
} & QueryParams;
|
|
1550
1552
|
payload: CreateEntryProps<any>;
|
|
1551
1553
|
return: EntryProps<any>;
|
|
1552
1554
|
};
|
|
@@ -1894,6 +1896,20 @@ export type MRActions = {
|
|
|
1894
1896
|
};
|
|
1895
1897
|
}>;
|
|
1896
1898
|
};
|
|
1899
|
+
create: {
|
|
1900
|
+
params: CreateReleaseEntryParams;
|
|
1901
|
+
payload: CreateEntryProps<any>;
|
|
1902
|
+
headers?: RawAxiosRequestHeaders;
|
|
1903
|
+
return: EntryProps<any, {
|
|
1904
|
+
release: {
|
|
1905
|
+
sys: {
|
|
1906
|
+
type: 'Link';
|
|
1907
|
+
linkType: 'Entry' | 'Asset';
|
|
1908
|
+
id: string;
|
|
1909
|
+
};
|
|
1910
|
+
};
|
|
1911
|
+
}>;
|
|
1912
|
+
};
|
|
1897
1913
|
createWithId: {
|
|
1898
1914
|
params: GetSpaceEnvironmentParams & {
|
|
1899
1915
|
releaseId: string;
|
|
@@ -2641,6 +2657,10 @@ export type PatchReleaseEntryParams = GetSpaceEnvironmentParams & {
|
|
|
2641
2657
|
entryId: string;
|
|
2642
2658
|
version: number;
|
|
2643
2659
|
};
|
|
2660
|
+
export type CreateReleaseEntryParams = GetSpaceEnvironmentParams & {
|
|
2661
|
+
releaseId: string;
|
|
2662
|
+
contentTypeId: string;
|
|
2663
|
+
};
|
|
2644
2664
|
export type CreateWithIdReleaseEntryParams = GetSpaceEnvironmentParams & {
|
|
2645
2665
|
releaseId: string;
|
|
2646
2666
|
entryId: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RawAxiosRequestConfig, RawAxiosRequestHeaders } from 'axios';
|
|
2
2
|
import type { OpPatch } from 'json-patch';
|
|
3
|
-
import type { BasicCursorPaginationOptions, CollectionProp, CreateWithIdReleaseEntryParams, CursorPaginatedCollectionProp, EnvironmentTemplateParams, GetBulkActionParams, GetContentTypeParams, GetEntryParams, GetEnvironmentTemplateParams, GetManyEntryParams, GetManyReleaseEntryParams, GetOrganizationMembershipParams, GetOrganizationParams, GetReleaseEntryParams, GetReleaseParams, GetSnapshotForContentTypeParams, GetSnapshotForEntryParams, GetSpaceEnvironmentParams, GetSpaceParams, KeyValueMap, PatchEntryParams, PatchReleaseEntryParams, QueryParams, ReleaseEnvironmentParams, UpdateEntryParams, UpdateReleaseEntryParams } from '../common-types';
|
|
3
|
+
import type { BasicCursorPaginationOptions, CollectionProp, CreateReleaseEntryParams, CreateWithIdReleaseEntryParams, CursorPaginatedCollectionProp, EnvironmentTemplateParams, GetBulkActionParams, GetContentTypeParams, GetEntryParams, GetEnvironmentTemplateParams, GetManyEntryParams, GetManyReleaseEntryParams, GetOrganizationMembershipParams, GetOrganizationParams, GetReleaseEntryParams, GetReleaseParams, GetSnapshotForContentTypeParams, GetSnapshotForEntryParams, GetSpaceEnvironmentParams, GetSpaceParams, KeyValueMap, PatchEntryParams, PatchReleaseEntryParams, QueryParams, ReleaseEnvironmentParams, UpdateEntryParams, UpdateReleaseEntryParams } from '../common-types';
|
|
4
4
|
import type { AccessTokenProps, CreatePersonalAccessTokenProps as CreatePATProps } from '../entities/access-token';
|
|
5
5
|
import type { ApiKeyProps, CreateApiKeyProps } from '../entities/api-key';
|
|
6
6
|
import type { AssetFileProp, AssetProcessingForLocale, AssetProps, CreateAssetProps } from '../entities/asset';
|
|
@@ -201,7 +201,8 @@ export type PlainClientAPI = {
|
|
|
201
201
|
}>): Promise<EntryProps<T>>;
|
|
202
202
|
create<T extends KeyValueMap = KeyValueMap>(params: OptionalDefaults<GetSpaceEnvironmentParams & {
|
|
203
203
|
contentTypeId: string;
|
|
204
|
-
|
|
204
|
+
releaseId?: string;
|
|
205
|
+
} & QueryParams>, rawData: CreateEntryProps<T>): Promise<EntryProps<T>>;
|
|
205
206
|
createWithId<T extends KeyValueMap = KeyValueMap>(params: OptionalDefaults<GetSpaceEnvironmentParams & {
|
|
206
207
|
entryId: string;
|
|
207
208
|
contentTypeId: string;
|
|
@@ -321,6 +322,15 @@ export type PlainClientAPI = {
|
|
|
321
322
|
};
|
|
322
323
|
};
|
|
323
324
|
}>>;
|
|
325
|
+
create<T extends KeyValueMap = KeyValueMap>(params: OptionalDefaults<CreateReleaseEntryParams & QueryParams>, rawData: CreateEntryProps<T>, headers?: RawAxiosRequestHeaders): Promise<EntryProps<T, {
|
|
326
|
+
release: {
|
|
327
|
+
sys: {
|
|
328
|
+
type: 'Link';
|
|
329
|
+
linkType: 'Entry' | 'Asset';
|
|
330
|
+
id: string;
|
|
331
|
+
};
|
|
332
|
+
};
|
|
333
|
+
}>>;
|
|
324
334
|
createWithId<T extends KeyValueMap = KeyValueMap>(params: OptionalDefaults<CreateWithIdReleaseEntryParams & QueryParams>, rawData: CreateEntryProps<T>, headers?: RawAxiosRequestHeaders): Promise<EntryProps<T, {
|
|
325
335
|
release: {
|
|
326
336
|
sys: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "contentful-management",
|
|
3
|
-
"version": "11.55.0-canary.
|
|
3
|
+
"version": "11.55.0-canary.8",
|
|
4
4
|
"description": "Client for Contentful's Content Management API",
|
|
5
5
|
"homepage": "https://www.contentful.com/developers/documentation/content-management-api/",
|
|
6
6
|
"main": "./dist/contentful-management.node.js",
|