contentful-management 11.50.1 → 11.52.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.
@@ -45,7 +45,7 @@ export const del = (http, params, headers) => {
45
45
  export const publish = (http, params, rawData, headers) => {
46
46
  return raw.put(http, `/spaces/${params.spaceId}/ai/actions/${params.aiActionId}/published`, null, {
47
47
  headers: _objectSpread({
48
- 'X-Contentful-Version': rawData.sys.version
48
+ 'X-Contentful-Version': params.version
49
49
  }, headers)
50
50
  });
51
51
  };
@@ -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.50.1"}`, params.application, params.integration, params.feature);
50
+ `${sdkMain}/${"11.52.0"}`, params.application, params.integration, params.feature);
51
51
  const adapter = createAdapter(_objectSpread(_objectSpread({}, params), {}, {
52
52
  userAgent
53
53
  }));
@@ -1686,18 +1686,17 @@ export default function createSpaceApi(makeRequest) {
1686
1686
  * .catch(console.error)
1687
1687
  * ```
1688
1688
  */
1689
- publishAiAction(aiActionId, data) {
1689
+ publishAiAction(aiActionId, {
1690
+ version
1691
+ }) {
1690
1692
  const raw = this.toPlainObject();
1691
1693
  return makeRequest({
1692
1694
  entityType: 'AiAction',
1693
1695
  action: 'publish',
1694
1696
  params: {
1695
1697
  spaceId: raw.sys.id,
1696
- aiActionId
1697
- },
1698
- payload: data,
1699
- headers: {
1700
- 'X-Contentful-Version': data.sys.version
1698
+ aiActionId,
1699
+ version
1701
1700
  }
1702
1701
  }).then(response => wrapAiAction(makeRequest, response));
1703
1702
  },
@@ -50,8 +50,11 @@ function createAiActionApi(makeRequest) {
50
50
  return makeRequest({
51
51
  entityType: 'AiAction',
52
52
  action: 'publish',
53
- params: getParams(self),
54
- payload: self
53
+ params: {
54
+ aiActionId: self.sys.id,
55
+ spaceId: self.sys.space.sys.id,
56
+ version: self.sys.version
57
+ }
55
58
  }).then(data => wrapAiAction(makeRequest, data));
56
59
  },
57
60
  unpublish: function unpublish() {
@@ -722,8 +722,8 @@ export type MRActions = {
722
722
  publish: {
723
723
  params: GetSpaceParams & {
724
724
  aiActionId: string;
725
+ version: number;
725
726
  };
726
- payload: AiActionProps;
727
727
  headers?: RawAxiosRequestHeaders;
728
728
  return: AiActionProps;
729
729
  };
@@ -1118,7 +1118,9 @@ export default function createSpaceApi(makeRequest: MakeRequest): {
1118
1118
  * .catch(console.error)
1119
1119
  * ```
1120
1120
  */
1121
- publishAiAction(aiActionId: string, data: AiActionProps): Promise<import("./entities/ai-action").AiAction>;
1121
+ publishAiAction(aiActionId: string, { version }: {
1122
+ version: number;
1123
+ }): Promise<import("./entities/ai-action").AiAction>;
1122
1124
  /**
1123
1125
  * Unpublishes an AI Action.
1124
1126
  * @param aiActionId - AI Action ID
@@ -44,6 +44,10 @@ export type AppBundleProps = {
44
44
  * A comment that describes this bundle
45
45
  */
46
46
  comment?: string;
47
+ /**
48
+ * List of all functions in the bundle
49
+ */
50
+ functions?: FunctionManifestProps[];
47
51
  };
48
52
  export interface AppBundle extends AppBundleProps, DefaultElements<AppBundleProps> {
49
53
  /**
@@ -52,14 +52,14 @@ export type AiActionPlainClientAPI = {
52
52
  /**
53
53
  * Publishes the AI Action.
54
54
  * @param params Entity IDs to identify the AI Action.
55
- * @param payload The AI Action details.
56
55
  * @param headers Optional headers for the request.
57
56
  * @returns The published AI Action and its metadata.
58
57
  * @throws if the request fails or the payload is malformed.
59
58
  */
60
59
  publish(params: OptionalDefaults<GetSpaceParams & {
61
60
  aiActionId: string;
62
- }>, payload: AiActionProps, headers?: Partial<RawAxiosRequestHeaders>): Promise<AiActionProps>;
61
+ version: number;
62
+ }>, payload?: unknown, headers?: Partial<RawAxiosRequestHeaders>): Promise<AiActionProps>;
63
63
  /**
64
64
  * Unpublishes the AI Action.
65
65
  * @param params Entity IDs to identify the AI Action.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contentful-management",
3
- "version": "11.50.1",
3
+ "version": "11.52.0",
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",