contentful-management 11.55.0-canary.6 → 11.55.0-canary.7

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.
@@ -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.6"}`, params.application, params.integration, params.feature);
50
+ `${sdkMain}/${"11.55.0-canary.7"}`, 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'>;
@@ -1894,6 +1895,20 @@ export type MRActions = {
1894
1895
  };
1895
1896
  }>;
1896
1897
  };
1898
+ create: {
1899
+ params: CreateReleaseEntryParams;
1900
+ payload: CreateEntryProps<any>;
1901
+ headers?: RawAxiosRequestHeaders;
1902
+ return: EntryProps<any, {
1903
+ release: {
1904
+ sys: {
1905
+ type: 'Link';
1906
+ linkType: 'Entry' | 'Asset';
1907
+ id: string;
1908
+ };
1909
+ };
1910
+ }>;
1911
+ };
1897
1912
  createWithId: {
1898
1913
  params: GetSpaceEnvironmentParams & {
1899
1914
  releaseId: string;
@@ -2641,6 +2656,10 @@ export type PatchReleaseEntryParams = GetSpaceEnvironmentParams & {
2641
2656
  entryId: string;
2642
2657
  version: number;
2643
2658
  };
2659
+ export type CreateReleaseEntryParams = GetSpaceEnvironmentParams & {
2660
+ releaseId: string;
2661
+ contentTypeId: string;
2662
+ };
2644
2663
  export type CreateWithIdReleaseEntryParams = GetSpaceEnvironmentParams & {
2645
2664
  releaseId: string;
2646
2665
  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';
@@ -321,6 +321,15 @@ export type PlainClientAPI = {
321
321
  };
322
322
  };
323
323
  }>>;
324
+ create<T extends KeyValueMap = KeyValueMap>(params: OptionalDefaults<CreateReleaseEntryParams & QueryParams>, rawData: CreateEntryProps<T>, headers?: RawAxiosRequestHeaders): Promise<EntryProps<T, {
325
+ release: {
326
+ sys: {
327
+ type: 'Link';
328
+ linkType: 'Entry' | 'Asset';
329
+ id: string;
330
+ };
331
+ };
332
+ }>>;
324
333
  createWithId<T extends KeyValueMap = KeyValueMap>(params: OptionalDefaults<CreateWithIdReleaseEntryParams & QueryParams>, rawData: CreateEntryProps<T>, headers?: RawAxiosRequestHeaders): Promise<EntryProps<T, {
325
334
  release: {
326
335
  sys: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contentful-management",
3
- "version": "11.55.0-canary.6",
3
+ "version": "11.55.0-canary.7",
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",