contentful-management 11.55.0-canary.9 → 11.56.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.
Files changed (33) hide show
  1. package/README.md +0 -14
  2. package/dist/contentful-management.browser.js +290 -240
  3. package/dist/contentful-management.browser.js.map +1 -1
  4. package/dist/contentful-management.browser.min.js +1 -1
  5. package/dist/contentful-management.node.js +204 -212
  6. package/dist/contentful-management.node.js.map +1 -1
  7. package/dist/contentful-management.node.min.js +1 -1
  8. package/dist/es-modules/adapters/REST/endpoints/app-action-call.js +59 -0
  9. package/dist/es-modules/adapters/REST/endpoints/entry.js +6 -31
  10. package/dist/es-modules/adapters/REST/endpoints/index.js +0 -2
  11. package/dist/es-modules/adapters/REST/endpoints/release.js +0 -24
  12. package/dist/es-modules/common-types.js +2 -0
  13. package/dist/es-modules/contentful-management.js +1 -1
  14. package/dist/es-modules/create-environment-api.js +39 -4
  15. package/dist/es-modules/entities/app-action-call.js +35 -0
  16. package/dist/es-modules/plain/plain-client.js +4 -9
  17. package/dist/typings/adapters/REST/endpoints/app-action-call.d.ts +3 -0
  18. package/dist/typings/adapters/REST/endpoints/index.d.ts +0 -2
  19. package/dist/typings/common-types.d.ts +39 -137
  20. package/dist/typings/create-entry-api.d.ts +1 -1
  21. package/dist/typings/create-environment-api.d.ts +31 -9
  22. package/dist/typings/create-organization-api.d.ts +36 -0
  23. package/dist/typings/entities/app-action-call.d.ts +37 -1
  24. package/dist/typings/entities/app-action.d.ts +16 -0
  25. package/dist/typings/entities/entry.d.ts +3 -3
  26. package/dist/typings/entities/release.d.ts +1 -18
  27. package/dist/typings/export-types.d.ts +1 -1
  28. package/dist/typings/plain/common-types.d.ts +17 -92
  29. package/dist/typings/plain/entities/app-action-call.d.ts +84 -2
  30. package/dist/typings/plain/wrappers/wrap.d.ts +0 -2
  31. package/package.json +2 -6
  32. package/dist/es-modules/adapters/REST/endpoints/release-entry.js +0 -63
  33. package/dist/typings/adapters/REST/endpoints/release-entry.d.ts +0 -7
@@ -4,7 +4,7 @@ import type { Stream } from 'stream';
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 { AppActionProps, CreateAppActionProps } from './entities/app-action';
7
- import type { AppActionCallProps, AppActionCallResponse, CreateAppActionCallProps } from './entities/app-action-call';
7
+ import type { AppActionCallProps, AppActionCallResponse, AppActionCallRawResponseProps, CreateAppActionCallProps } from './entities/app-action-call';
8
8
  import type { AppBundleProps, CreateAppBundleProps } from './entities/app-bundle';
9
9
  import type { AppDefinitionProps, AppInstallationsForOrganizationProps, CreateAppDefinitionProps } from './entities/app-definition';
10
10
  import type { AppDetailsProps, CreateAppDetailsProps } from './entities/app-details';
@@ -28,7 +28,7 @@ import type { CreateOrganizationInvitationProps, OrganizationInvitationProps } f
28
28
  import type { OrganizationMembershipProps } from './entities/organization-membership';
29
29
  import type { CreatePersonalAccessTokenProps, PersonalAccessTokenProps } from './entities/personal-access-token';
30
30
  import type { PreviewApiKeyProps } from './entities/preview-api-key';
31
- import type { ReleasePayload, ReleasePayloadV2, ReleaseProps, ReleaseQueryOptions, ReleaseValidatePayload } from './entities/release';
31
+ import type { ReleasePayload, ReleaseProps, ReleaseQueryOptions, ReleaseValidatePayload } from './entities/release';
32
32
  import type { ReleaseAction, ReleaseActionProps, ReleaseActionQueryOptions } from './entities/release-action';
33
33
  import type { CreateRoleProps, RoleProps } from './entities/role';
34
34
  import type { ScheduledActionProps } from './entities/scheduled-action';
@@ -268,6 +268,9 @@ type MRInternal<UA extends boolean> = {
268
268
  (opts: MROpts<'AppActionCall', 'create', UA>): MRReturn<'AppActionCall', 'create'>;
269
269
  (opts: MROpts<'AppActionCall', 'createWithResponse', UA>): MRReturn<'AppActionCall', 'createWithResponse'>;
270
270
  (opts: MROpts<'AppActionCall', 'getCallDetails', UA>): MRReturn<'AppActionCall', 'getCallDetails'>;
271
+ (opts: MROpts<'AppActionCall', 'get', UA>): MRReturn<'AppActionCall', 'get'>;
272
+ (opts: MROpts<'AppActionCall', 'createWithResult', UA>): MRReturn<'AppActionCall', 'createWithResult'>;
273
+ (opts: MROpts<'AppActionCall', 'getResponse', UA>): MRReturn<'AppActionCall', 'getResponse'>;
271
274
  (opts: MROpts<'AppBundle', 'get', UA>): MRReturn<'AppBundle', 'get'>;
272
275
  (opts: MROpts<'AppBundle', 'getMany', UA>): MRReturn<'AppBundle', 'getMany'>;
273
276
  (opts: MROpts<'AppBundle', 'delete', UA>): MRReturn<'AppBundle', 'delete'>;
@@ -451,12 +454,6 @@ type MRInternal<UA extends boolean> = {
451
454
  (opts: MROpts<'ReleaseAction', 'get', UA>): MRReturn<'ReleaseAction', 'get'>;
452
455
  (opts: MROpts<'ReleaseAction', 'getMany', UA>): MRReturn<'ReleaseAction', 'getMany'>;
453
456
  (opts: MROpts<'ReleaseAction', 'queryForRelease', UA>): MRReturn<'ReleaseAction', 'queryForRelease'>;
454
- (opts: MROpts<'ReleaseEntry', 'get', UA>): MRReturn<'ReleaseEntry', 'get'>;
455
- (opts: MROpts<'ReleaseEntry', 'getMany', UA>): MRReturn<'ReleaseEntry', 'getMany'>;
456
- (opts: MROpts<'ReleaseEntry', 'update', UA>): MRReturn<'ReleaseEntry', 'update'>;
457
- (opts: MROpts<'ReleaseEntry', 'patch', UA>): MRReturn<'ReleaseEntry', 'patch'>;
458
- (opts: MROpts<'ReleaseEntry', 'create', UA>): MRReturn<'ReleaseEntry', 'create'>;
459
- (opts: MROpts<'ReleaseEntry', 'createWithId', UA>): MRReturn<'ReleaseEntry', 'createWithId'>;
460
457
  (opts: MROpts<'Resource', 'getMany', UA>): MRReturn<'Resource', 'getMany'>;
461
458
  (opts: MROpts<'ResourceProvider', 'get', UA>): MRReturn<'ResourceProvider', 'get'>;
462
459
  (opts: MROpts<'ResourceProvider', 'upsert', UA>): MRReturn<'ResourceProvider', 'upsert'>;
@@ -794,6 +791,10 @@ export type MRActions = {
794
791
  payload: CreateAppActionCallProps;
795
792
  return: AppActionCallProps;
796
793
  };
794
+ get: {
795
+ params: GetAppActionCallParamsWithId;
796
+ return: AppActionCallProps;
797
+ };
797
798
  getCallDetails: {
798
799
  params: GetAppActionCallDetailsParams;
799
800
  return: AppActionCallResponse;
@@ -803,6 +804,15 @@ export type MRActions = {
803
804
  payload: CreateAppActionCallProps;
804
805
  return: AppActionCallResponse;
805
806
  };
807
+ createWithResult: {
808
+ params: CreateWithResponseParams;
809
+ payload: CreateAppActionCallProps;
810
+ return: AppActionCallProps;
811
+ };
812
+ getResponse: {
813
+ params: GetAppActionCallParamsWithId;
814
+ return: AppActionCallRawResponseProps;
815
+ };
806
816
  };
807
817
  AppBundle: {
808
818
  get: {
@@ -1494,21 +1504,28 @@ export type MRActions = {
1494
1504
  return: CollectionProp<EntryProps<any>>;
1495
1505
  };
1496
1506
  getMany: {
1497
- params: GetManyEntryParams & QueryParams;
1498
- return: CollectionProp<EntryProps<any, any>>;
1507
+ params: GetSpaceEnvironmentParams & QueryParams;
1508
+ return: CollectionProp<EntryProps<any>>;
1499
1509
  };
1500
1510
  get: {
1501
- params: GetEntryParams & QueryParams;
1502
- return: EntryProps<any, any>;
1511
+ params: GetSpaceEnvironmentParams & {
1512
+ entryId: string;
1513
+ } & QueryParams;
1514
+ return: EntryProps<any>;
1503
1515
  };
1504
1516
  patch: {
1505
- params: PatchEntryParams & QueryParams;
1517
+ params: GetSpaceEnvironmentParams & {
1518
+ entryId: string;
1519
+ version: number;
1520
+ };
1506
1521
  payload: OpPatch[];
1507
1522
  headers?: RawAxiosRequestHeaders;
1508
1523
  return: EntryProps<any>;
1509
1524
  };
1510
1525
  update: {
1511
- params: UpdateEntryParams & QueryParams;
1526
+ params: GetSpaceEnvironmentParams & {
1527
+ entryId: string;
1528
+ };
1512
1529
  payload: EntryProps<any>;
1513
1530
  headers?: RawAxiosRequestHeaders;
1514
1531
  return: EntryProps<any>;
@@ -1547,8 +1564,7 @@ export type MRActions = {
1547
1564
  create: {
1548
1565
  params: GetSpaceEnvironmentParams & {
1549
1566
  contentTypeId: string;
1550
- releaseId?: string;
1551
- } & QueryParams;
1567
+ };
1552
1568
  payload: CreateEntryProps<any>;
1553
1569
  return: EntryProps<any>;
1554
1570
  };
@@ -1556,10 +1572,9 @@ export type MRActions = {
1556
1572
  params: GetSpaceEnvironmentParams & {
1557
1573
  entryId: string;
1558
1574
  contentTypeId: string;
1559
- releaseId?: string;
1560
1575
  };
1561
1576
  payload: CreateEntryProps<any>;
1562
- return: EntryProps<any, any>;
1577
+ return: EntryProps<any>;
1563
1578
  };
1564
1579
  references: {
1565
1580
  params: GetSpaceEnvironmentParams & {
@@ -1816,14 +1831,14 @@ export type MRActions = {
1816
1831
  };
1817
1832
  create: {
1818
1833
  params: GetSpaceEnvironmentParams;
1819
- payload: ReleasePayload | ReleasePayloadV2;
1834
+ payload: ReleasePayload;
1820
1835
  return: ReleaseProps;
1821
1836
  };
1822
1837
  update: {
1823
1838
  params: GetReleaseParams & {
1824
1839
  version: number;
1825
1840
  };
1826
- payload: ReleasePayload | ReleasePayloadV2;
1841
+ payload: ReleasePayload;
1827
1842
  return: ReleaseProps;
1828
1843
  };
1829
1844
  delete: {
@@ -1854,81 +1869,6 @@ export type MRActions = {
1854
1869
  return: ReleaseActionProps<'validate'>;
1855
1870
  };
1856
1871
  };
1857
- ReleaseEntry: {
1858
- get: {
1859
- params: GetReleaseEntryParams;
1860
- return: EntryProps<any, any>;
1861
- };
1862
- getMany: {
1863
- params: GetManyReleaseEntryParams;
1864
- return: CollectionProp<EntryProps<any, any>>;
1865
- };
1866
- update: {
1867
- params: UpdateReleaseEntryParams & {
1868
- entryId: string;
1869
- };
1870
- payload: EntryProps<any>;
1871
- headers?: RawAxiosRequestHeaders;
1872
- return: EntryProps<any, {
1873
- release: {
1874
- sys: {
1875
- type: 'Link';
1876
- linkType: 'Entry' | 'Asset';
1877
- id: string;
1878
- };
1879
- };
1880
- }>;
1881
- };
1882
- patch: {
1883
- params: PatchReleaseEntryParams & {
1884
- entryId: string;
1885
- version: number;
1886
- };
1887
- payload: OpPatch[];
1888
- headers?: RawAxiosRequestHeaders;
1889
- return: EntryProps<any, {
1890
- release: {
1891
- sys: {
1892
- type: 'Link';
1893
- linkType: 'Entry' | 'Asset';
1894
- id: string;
1895
- };
1896
- };
1897
- }>;
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
- };
1913
- createWithId: {
1914
- params: GetSpaceEnvironmentParams & {
1915
- releaseId: string;
1916
- entryId: string;
1917
- contentTypeId: string;
1918
- };
1919
- payload: CreateEntryProps<any>;
1920
- headers?: RawAxiosRequestHeaders;
1921
- return: EntryProps<any, {
1922
- release: {
1923
- sys: {
1924
- type: 'Link';
1925
- linkType: 'Entry' | 'Asset';
1926
- id: string;
1927
- };
1928
- };
1929
- }>;
1930
- };
1931
- };
1932
1872
  ReleaseAction: {
1933
1873
  get: {
1934
1874
  params: GetReleaseParams & {
@@ -2576,6 +2516,9 @@ export type GetAppActionCallDetailsParams = GetSpaceEnvironmentParams & {
2576
2516
  appActionId: string;
2577
2517
  callId: string;
2578
2518
  };
2519
+ export type GetAppActionCallParamsWithId = GetAppActionCallParams & {
2520
+ callId: string;
2521
+ };
2579
2522
  export type GetAppBundleParams = GetAppDefinitionParams & {
2580
2523
  appBundleId: string;
2581
2524
  };
@@ -2602,19 +2545,6 @@ export type GetEditorInterfaceParams = GetSpaceEnvironmentParams & {
2602
2545
  };
2603
2546
  export type GetEntryParams = GetSpaceEnvironmentParams & {
2604
2547
  entryId: string;
2605
- releaseId?: string;
2606
- };
2607
- export type GetManyEntryParams = GetSpaceEnvironmentParams & {
2608
- releaseId?: string;
2609
- };
2610
- export type PatchEntryParams = GetSpaceEnvironmentParams & {
2611
- entryId: string;
2612
- version: number;
2613
- releaseId?: string;
2614
- };
2615
- export type UpdateEntryParams = GetSpaceEnvironmentParams & {
2616
- entryId: string;
2617
- releaseId?: string;
2618
2548
  };
2619
2549
  export type GetExtensionParams = GetSpaceEnvironmentParams & {
2620
2550
  extensionId: string;
@@ -2638,34 +2568,9 @@ export type GetFunctionLogParams = GetManyFunctionLogParams & {
2638
2568
  export type GetOrganizationParams = {
2639
2569
  organizationId: string;
2640
2570
  };
2641
- export type GetReleaseParams = ReleaseEnvironmentParams & {
2642
- releaseId: string;
2643
- };
2644
- export type GetReleaseEntryParams = GetSpaceEnvironmentParams & {
2645
- releaseId?: string;
2646
- entryId: string;
2647
- };
2648
- export type GetManyReleaseEntryParams = GetSpaceEnvironmentParams & {
2571
+ export type GetReleaseParams = GetSpaceEnvironmentParams & {
2649
2572
  releaseId: string;
2650
2573
  };
2651
- export type UpdateReleaseEntryParams = GetSpaceEnvironmentParams & {
2652
- releaseId: string;
2653
- entryId: string;
2654
- };
2655
- export type PatchReleaseEntryParams = GetSpaceEnvironmentParams & {
2656
- releaseId: string;
2657
- entryId: string;
2658
- version: number;
2659
- };
2660
- export type CreateReleaseEntryParams = GetSpaceEnvironmentParams & {
2661
- releaseId: string;
2662
- contentTypeId: string;
2663
- };
2664
- export type CreateWithIdReleaseEntryParams = GetSpaceEnvironmentParams & {
2665
- releaseId: string;
2666
- entryId: string;
2667
- contentTypeId: string;
2668
- };
2669
2574
  export type GetSnapshotForContentTypeParams = GetSpaceEnvironmentParams & {
2670
2575
  contentTypeId: string;
2671
2576
  };
@@ -2812,7 +2717,4 @@ export type GetUserParams = {
2812
2717
  export declare enum ScheduledActionReferenceFilters {
2813
2718
  contentTypeAnnotationNotIn = "sys.contentType.metadata.annotations.ContentType[nin]"
2814
2719
  }
2815
- export type ReleaseEnvironmentParams = GetSpaceEnvironmentParams & {
2816
- releaseSchemaVersion?: 'Release.v1' | 'Release.v2';
2817
- };
2818
2720
  export {};
@@ -327,5 +327,5 @@ export default function createEntryApi(makeRequest: MakeRequest): {
327
327
  /**
328
328
  * Recursively collects references of an entry and their descendants
329
329
  */
330
- references: (options?: EntryReferenceOptionsProps) => Promise<import("./common-types").Collection<Entry, EntryProps<import("./common-types").KeyValueMap, unknown>>>;
330
+ references: (options?: EntryReferenceOptionsProps) => Promise<import("./common-types").Collection<Entry, EntryProps<import("./common-types").KeyValueMap>>>;
331
331
  };
@@ -3,12 +3,12 @@ import type { AcceptsQueryOptions, BasicCursorPaginationOptions, CreatedAtInterv
3
3
  import type { BasicQueryOptions, MakeRequest } from './common-types';
4
4
  import type { CreateAppInstallationProps } from './entities/app-installation';
5
5
  import type { CreateAppSignedRequestProps } from './entities/app-signed-request';
6
- import type { CreateAppActionCallProps } from './entities/app-action-call';
6
+ import type { CreateAppActionCallProps, AppActionCallRawResponseProps } from './entities/app-action-call';
7
7
  import type { AssetFileProp, AssetProps, CreateAssetFromFilesOptions, CreateAssetProps } from './entities/asset';
8
8
  import type { CreateAssetKeyProps } from './entities/asset-key';
9
9
  import type { BulkAction, BulkActionPayload, BulkActionPublishPayload, BulkActionUnpublishPayload, BulkActionValidatePayload } from './entities/bulk-action';
10
10
  import type { ReleaseActionQueryOptions } from './entities/release-action';
11
- import type { ReleasePayload, ReleaseQueryOptions, ReleaseValidatePayload, ReleasePayloadV2 } from './entities/release';
11
+ import type { ReleasePayload, ReleaseQueryOptions, ReleaseValidatePayload } from './entities/release';
12
12
  import type { ContentTypeProps, CreateContentTypeProps } from './entities/content-type';
13
13
  import type { CreateEntryProps, EntryProps, EntryReferenceOptionsProps, EntryReferenceProps } from './entities/entry';
14
14
  import type { CreateExtensionProps } from './entities/extension';
@@ -269,7 +269,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest): {
269
269
  *
270
270
  * // Using Thenables
271
271
  * client.getSpace('<space_id>')
272
- * .then((space) => space.getEnvironment('<environment-id>'))
272
+ * .then((space) => space.getEnvironment('<environment_id>'))
273
273
  * .then((environment) => environment.createUnpublishBulkAction(payload))
274
274
  * .then((bulkAction) => console.log(bulkAction.waitProcessing()))
275
275
  * .catch(console.error)
@@ -277,7 +277,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest): {
277
277
  * // Using async/await
278
278
  * try {
279
279
  * const space = await clientgetSpace('<space_id>')
280
- * const environment = await space.getEnvironment('<environment-id>')
280
+ * const environment = await space.getEnvironment('<environment_id>')
281
281
  * const bulkActionInProgress = await environment.createUnpublishBulkAction(payload)
282
282
  *
283
283
  * // You can wait for a recently created BulkAction to be processed by using `bulkAction.waitProcessing()`
@@ -486,7 +486,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest): {
486
486
  * .catch(console.error)
487
487
  * ```
488
488
  */
489
- getEntries(query?: QueryOptions): Promise<import("./common-types").Collection<import("./entities/entry").Entry, EntryProps<import("./common-types").KeyValueMap, unknown>>>;
489
+ getEntries(query?: QueryOptions): Promise<import("./common-types").Collection<import("./entities/entry").Entry, EntryProps<import("./common-types").KeyValueMap>>>;
490
490
  /**
491
491
  * Gets a collection of published Entries
492
492
  * @param query - Object with search parameters. Check the <a href="https://www.contentful.com/developers/docs/javascript/tutorials/using-js-cda-sdk/#retrieving-entries-with-search-parameters">JS SDK tutorial</a> and the <a href="https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/search-parameters">REST API reference</a> for more details.
@@ -505,7 +505,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest): {
505
505
  * .catch(console.error)
506
506
  * ```
507
507
  */
508
- getPublishedEntries(query?: QueryOptions): Promise<import("./common-types").Collection<import("./entities/entry").Entry, EntryProps<import("./common-types").KeyValueMap, unknown>>>;
508
+ getPublishedEntries(query?: QueryOptions): Promise<import("./common-types").Collection<import("./entities/entry").Entry, EntryProps<import("./common-types").KeyValueMap>>>;
509
509
  /**
510
510
  * Creates a Entry
511
511
  * @param contentTypeId - The Content Type ID of the newly created Entry
@@ -574,7 +574,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest): {
574
574
  *
575
575
  * // Get entry references
576
576
  * client.getSpace('<space_id>')
577
- * .then((space) => space.getEnvironment('<environment-id>'))
577
+ * .then((space) => space.getEnvironment('<environment_id>'))
578
578
  * .then((environment) => environment.getEntryReferences('<entry_id>', {include: number}))
579
579
  * .then((entry) => console.log(entry.includes))
580
580
  * // or
@@ -1068,6 +1068,28 @@ export default function createEnvironmentApi(makeRequest: MakeRequest): {
1068
1068
  * ```
1069
1069
  */
1070
1070
  createAppActionCall(appDefinitionId: string, appActionId: string, data: CreateAppActionCallProps): Promise<import("./entities/app-action-call").AppActionCall>;
1071
+ /**
1072
+ * Gets the raw response (headers/body) for a completed App Action Call
1073
+ * @param appDefinitionId - AppDefinition ID
1074
+ * @param appActionId - App Action ID
1075
+ * @param callId - App Action Call ID
1076
+ * @return Promise for the raw response object including `response.body` and optional `response.headers`
1077
+ * @example ```javascript
1078
+ * const contentful = require('contentful-management')
1079
+ *
1080
+ * const client = contentful.createClient({
1081
+ * accessToken: '<content_management_api_key>'
1082
+ * })
1083
+ *
1084
+ * client
1085
+ * .getSpace('<space_id>')
1086
+ * .then((space) => space.getEnvironment('<environment_id>'))
1087
+ * .then((environment) => environment.getAppActionCallResponse('<app_definition_id>', '<app_action_id>', '<call_id>'))
1088
+ * .then((raw) => console.log(raw.response.body))
1089
+ * .catch(console.error)
1090
+ * ```
1091
+ */
1092
+ getAppActionCallResponse(appDefinitionId: string, appActionId: string, callId: string): Promise<AppActionCallRawResponseProps>;
1071
1093
  /**
1072
1094
  * Creates an app signed request
1073
1095
  * @param appDefinitionId - AppDefinition ID
@@ -1358,7 +1380,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest): {
1358
1380
  */
1359
1381
  updateRelease({ releaseId, payload, version, }: {
1360
1382
  releaseId: string;
1361
- payload: ReleasePayload | ReleasePayloadV2;
1383
+ payload: ReleasePayload;
1362
1384
  version: number;
1363
1385
  }): Promise<import("./entities/release").Release>;
1364
1386
  /**
@@ -1590,7 +1612,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest): {
1590
1612
  * })
1591
1613
  *
1592
1614
  * client.getSpace('<space_id>')
1593
- * .then((space) => space.getEnvironment('<environment-id>'))
1615
+ * .then((space) => space.getEnvironment('<environment_id>'))
1594
1616
  * .then((environment) => environment.getResourceTypes({limit: 10}))
1595
1617
  * .then((installations) => console.log(installations.items))
1596
1618
  * .catch(console.error)
@@ -679,6 +679,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest): {
679
679
  };
680
680
  name: string;
681
681
  description?: string;
682
+ parametersSchema?: Record<string, unknown>;
683
+ resultSchema?: Record<string, unknown>;
682
684
  } & Record<string, unknown> & {
683
685
  type: "function";
684
686
  } & import("./common-types").DefaultElements<import("./entities/app-action").AppActionProps> & {
@@ -699,6 +701,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest): {
699
701
  };
700
702
  name: string;
701
703
  description?: string;
704
+ parametersSchema?: Record<string, unknown>;
705
+ resultSchema?: Record<string, unknown>;
702
706
  } & {
703
707
  type: "endpoint";
704
708
  url: string;
@@ -720,6 +724,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest): {
720
724
  };
721
725
  name: string;
722
726
  description?: string;
727
+ parametersSchema?: Record<string, unknown>;
728
+ resultSchema?: Record<string, unknown>;
723
729
  } & {
724
730
  type: "function-invocation";
725
731
  function: import("./common-types").Link<"Function">;
@@ -742,6 +748,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest): {
742
748
  };
743
749
  name: string;
744
750
  description?: string;
751
+ parametersSchema?: Record<string, unknown>;
752
+ resultSchema?: Record<string, unknown>;
745
753
  } & Record<string, unknown> & {
746
754
  type: "function";
747
755
  } & import("./common-types").DefaultElements<import("./entities/app-action").AppActionProps> & {
@@ -763,6 +771,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest): {
763
771
  };
764
772
  name: string;
765
773
  description?: string;
774
+ parametersSchema?: Record<string, unknown>;
775
+ resultSchema?: Record<string, unknown>;
766
776
  } & {
767
777
  type: "endpoint";
768
778
  url: string;
@@ -785,6 +795,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest): {
785
795
  };
786
796
  name: string;
787
797
  description?: string;
798
+ parametersSchema?: Record<string, unknown>;
799
+ resultSchema?: Record<string, unknown>;
788
800
  } & {
789
801
  type: "function-invocation";
790
802
  function: import("./common-types").Link<"Function">;
@@ -826,6 +838,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest): {
826
838
  };
827
839
  name: string;
828
840
  description?: string;
841
+ parametersSchema?: Record<string, unknown>;
842
+ resultSchema?: Record<string, unknown>;
829
843
  } & Record<string, unknown> & {
830
844
  type: "function";
831
845
  } & import("./common-types").DefaultElements<import("./entities/app-action").AppActionProps> & {
@@ -846,6 +860,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest): {
846
860
  };
847
861
  name: string;
848
862
  description?: string;
863
+ parametersSchema?: Record<string, unknown>;
864
+ resultSchema?: Record<string, unknown>;
849
865
  } & {
850
866
  type: "endpoint";
851
867
  url: string;
@@ -867,6 +883,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest): {
867
883
  };
868
884
  name: string;
869
885
  description?: string;
886
+ parametersSchema?: Record<string, unknown>;
887
+ resultSchema?: Record<string, unknown>;
870
888
  } & {
871
889
  type: "function-invocation";
872
890
  function: import("./common-types").Link<"Function">;
@@ -889,6 +907,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest): {
889
907
  };
890
908
  name: string;
891
909
  description?: string;
910
+ parametersSchema?: Record<string, unknown>;
911
+ resultSchema?: Record<string, unknown>;
892
912
  } & Record<string, unknown> & {
893
913
  type: "function";
894
914
  } & import("./common-types").DefaultElements<import("./entities/app-action").AppActionProps> & {
@@ -910,6 +930,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest): {
910
930
  };
911
931
  name: string;
912
932
  description?: string;
933
+ parametersSchema?: Record<string, unknown>;
934
+ resultSchema?: Record<string, unknown>;
913
935
  } & {
914
936
  type: "endpoint";
915
937
  url: string;
@@ -932,6 +954,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest): {
932
954
  };
933
955
  name: string;
934
956
  description?: string;
957
+ parametersSchema?: Record<string, unknown>;
958
+ resultSchema?: Record<string, unknown>;
935
959
  } & {
936
960
  type: "function-invocation";
937
961
  function: import("./common-types").Link<"Function">;
@@ -985,6 +1009,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest): {
985
1009
  };
986
1010
  name: string;
987
1011
  description?: string;
1012
+ parametersSchema?: Record<string, unknown>;
1013
+ resultSchema?: Record<string, unknown>;
988
1014
  } & Record<string, unknown> & {
989
1015
  type: "function";
990
1016
  } & import("./common-types").DefaultElements<import("./entities/app-action").AppActionProps> & {
@@ -1005,6 +1031,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest): {
1005
1031
  };
1006
1032
  name: string;
1007
1033
  description?: string;
1034
+ parametersSchema?: Record<string, unknown>;
1035
+ resultSchema?: Record<string, unknown>;
1008
1036
  } & {
1009
1037
  type: "endpoint";
1010
1038
  url: string;
@@ -1026,6 +1054,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest): {
1026
1054
  };
1027
1055
  name: string;
1028
1056
  description?: string;
1057
+ parametersSchema?: Record<string, unknown>;
1058
+ resultSchema?: Record<string, unknown>;
1029
1059
  } & {
1030
1060
  type: "function-invocation";
1031
1061
  function: import("./common-types").Link<"Function">;
@@ -1048,6 +1078,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest): {
1048
1078
  };
1049
1079
  name: string;
1050
1080
  description?: string;
1081
+ parametersSchema?: Record<string, unknown>;
1082
+ resultSchema?: Record<string, unknown>;
1051
1083
  } & Record<string, unknown> & {
1052
1084
  type: "function";
1053
1085
  } & import("./common-types").DefaultElements<import("./entities/app-action").AppActionProps> & {
@@ -1069,6 +1101,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest): {
1069
1101
  };
1070
1102
  name: string;
1071
1103
  description?: string;
1104
+ parametersSchema?: Record<string, unknown>;
1105
+ resultSchema?: Record<string, unknown>;
1072
1106
  } & {
1073
1107
  type: "endpoint";
1074
1108
  url: string;
@@ -1091,6 +1125,8 @@ export default function createOrganizationApi(makeRequest: MakeRequest): {
1091
1125
  };
1092
1126
  name: string;
1093
1127
  description?: string;
1128
+ parametersSchema?: Record<string, unknown>;
1129
+ resultSchema?: Record<string, unknown>;
1094
1130
  } & {
1095
1131
  type: "function-invocation";
1096
1132
  function: import("./common-types").Link<"Function">;
@@ -6,25 +6,61 @@ type AppActionCallSys = Except<BasicMetaSysProps, 'version'> & {
6
6
  space: SysLink;
7
7
  environment: SysLink;
8
8
  action: SysLink;
9
+ appActionCallResponse?: SysLink;
9
10
  };
10
11
  type RetryOptions = Pick<CreateWithResponseParams, 'retries' | 'retryInterval'>;
12
+ export type AppActionCallStatus = 'processing' | 'succeeded' | 'failed';
13
+ export interface AppActionCallErrorProps {
14
+ sys: {
15
+ type: 'Error';
16
+ id: string;
17
+ };
18
+ message: string;
19
+ details?: Record<string, unknown>;
20
+ statusCode?: number;
21
+ }
11
22
  export type AppActionCallProps = {
12
23
  /**
13
24
  * System metadata
14
25
  */
15
26
  sys: AppActionCallSys;
27
+ /** The execution status of the app action call, if available */
28
+ status?: AppActionCallStatus;
29
+ /** Structured result when execution succeeded */
30
+ result?: unknown;
31
+ /** Structured error when execution failed */
32
+ error?: AppActionCallErrorProps;
16
33
  };
17
34
  export type CreateAppActionCallProps = {
18
35
  /** The body for the call */
19
36
  parameters: {
20
- [key: string]: any;
37
+ [key: string]: unknown;
21
38
  };
22
39
  };
23
40
  type AppActionCallApi = {
24
41
  createWithResponse(): Promise<AppActionCallResponse>;
25
42
  getCallDetails(): Promise<AppActionCallResponse>;
43
+ get(): Promise<AppActionCallProps>;
44
+ createWithResult(): Promise<AppActionCallProps>;
26
45
  };
27
46
  export type AppActionCallResponse = WebhookCallDetailsProps;
47
+ export interface AppActionCallRawResponseProps {
48
+ sys: {
49
+ id: string;
50
+ type: 'AppActionCallResponse';
51
+ space: SysLink;
52
+ environment: SysLink;
53
+ appInstallation: SysLink;
54
+ appAction: SysLink;
55
+ createdAt: string;
56
+ };
57
+ response: {
58
+ headers?: {
59
+ contentType?: string;
60
+ };
61
+ body: string;
62
+ };
63
+ }
28
64
  export interface AppActionCallResponseData extends AppActionCallResponse, DefaultElements<AppActionCallResponse>, AppActionCallApi {
29
65
  }
30
66
  export interface AppActionCall extends AppActionCallProps, DefaultElements<AppActionCallProps> {
@@ -48,6 +48,14 @@ type BaseAppActionProps = AppActionCategory & {
48
48
  * Human readable description of the action
49
49
  */
50
50
  description?: string;
51
+ /**
52
+ * Optional JSON Schema describing the request payload shape
53
+ */
54
+ parametersSchema?: Record<string, unknown>;
55
+ /**
56
+ * Optional JSON Schema describing the result shape
57
+ */
58
+ resultSchema?: Record<string, unknown>;
51
59
  };
52
60
  type CreateEndpointAppActionProps = {
53
61
  /**
@@ -106,6 +114,14 @@ type LegacyFunctionAppActionProps = Record<string, unknown> & {
106
114
  export type CreateAppActionProps = AppActionCategory & {
107
115
  name: string;
108
116
  description?: string;
117
+ /**
118
+ * Optional JSON Schema describing the request payload shape
119
+ */
120
+ parametersSchema?: Record<string, unknown>;
121
+ /**
122
+ * Optional JSON Schema describing the result shape
123
+ */
124
+ resultSchema?: Record<string, unknown>;
109
125
  } & (CreateEndpointAppActionProps | CreateFunctionAppActionProps | LegacyFunctionAppActionProps);
110
126
  export type AppActionProps = BaseAppActionProps & (EndpointAppActionProps | FunctionAppActionProps | LegacyFunctionAppActionProps);
111
127
  export type AppAction = AppActionProps & DefaultElements<AppActionProps> & {
@@ -1,8 +1,8 @@
1
1
  import type { CollectionProp, DefaultElements, EntryMetaSysProps, KeyValueMap, MakeRequest, MetadataProps } from '../common-types';
2
2
  import type { ContentfulEntryApi } from '../create-entry-api';
3
3
  import type { AssetProps } from './asset';
4
- export type EntryProps<T = KeyValueMap, S = unknown> = {
5
- sys: EntryMetaSysProps & S;
4
+ export type EntryProps<T = KeyValueMap> = {
5
+ sys: EntryMetaSysProps;
6
6
  metadata?: MetadataProps;
7
7
  fields: T;
8
8
  };
@@ -50,4 +50,4 @@ export declare function wrapEntry(makeRequest: MakeRequest, data: EntryProps): E
50
50
  * Data is also mixed in with link getters if links exist and includes were requested
51
51
  * @private
52
52
  */
53
- export declare const wrapEntryCollection: (makeRequest: MakeRequest, data: CollectionProp<EntryProps<KeyValueMap, unknown>>) => import("../common-types").Collection<Entry, EntryProps<KeyValueMap, unknown>>;
53
+ export declare const wrapEntryCollection: (makeRequest: MakeRequest, data: CollectionProp<EntryProps<KeyValueMap>>) => import("../common-types").Collection<Entry, EntryProps<KeyValueMap>>;