contentful-management
Advanced tools
Comparing version 11.47.2 to 11.47.3
@@ -50,3 +50,3 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } | ||
// @ts-expect-error | ||
`${sdkMain}/${"11.47.2"}`, params.application, params.integration, params.feature); | ||
`${sdkMain}/${"11.47.3"}`, params.application, params.integration, params.feature); | ||
const adapter = createAdapter(_objectSpread(_objectSpread({}, params), {}, { | ||
@@ -53,0 +53,0 @@ userAgent |
@@ -5,3 +5,12 @@ import { freezeSys, toPlainObject } from 'contentful-sdk-core'; | ||
import enhanceWithMethods from '../enhance-with-methods'; | ||
/** | ||
* 'function' is deprecated, use 'function-invocation' instead | ||
*/ | ||
/** | ||
* @deprecated Use FunctionAppActionProps instead | ||
*/ | ||
/** | ||
* @private | ||
@@ -8,0 +17,0 @@ */ |
@@ -680,6 +680,48 @@ import type { Stream } from 'stream'; | ||
}; | ||
name: string; | ||
description?: string; | ||
} & Record<string, unknown> & { | ||
type: "function"; | ||
} & import("./common-types").DefaultElements<import("./entities/app-action").AppActionProps> & { | ||
delete(): Promise<void>; | ||
}) | ({ | ||
category: "Entries.v1.0" | "Notification.v1.0"; | ||
} & { | ||
sys: { | ||
type: string; | ||
id: string; | ||
createdBy?: import("./common-types").SysLink | undefined; | ||
createdAt: string; | ||
updatedBy?: import("./common-types").SysLink | undefined; | ||
updatedAt: string; | ||
} & { | ||
appDefinition: import("./common-types").SysLink; | ||
organization: import("./common-types").SysLink; | ||
}; | ||
name: string; | ||
description?: string; | ||
} & { | ||
type: "endpoint"; | ||
url: string; | ||
} & import("./common-types").DefaultElements<import("./entities/app-action").AppActionProps> & { | ||
delete(): Promise<void>; | ||
}) | ({ | ||
category: "Entries.v1.0" | "Notification.v1.0"; | ||
} & { | ||
sys: { | ||
type: string; | ||
id: string; | ||
createdBy?: import("./common-types").SysLink | undefined; | ||
createdAt: string; | ||
updatedBy?: import("./common-types").SysLink | undefined; | ||
updatedAt: string; | ||
} & { | ||
appDefinition: import("./common-types").SysLink; | ||
organization: import("./common-types").SysLink; | ||
}; | ||
name: string; | ||
description?: string; | ||
type?: import("./entities/app-action").AppActionType; | ||
} & { | ||
type: "function-invocation"; | ||
function: import("./common-types").Link<"Function">; | ||
} & import("./common-types").DefaultElements<import("./entities/app-action").AppActionProps> & { | ||
@@ -702,6 +744,50 @@ delete(): Promise<void>; | ||
}; | ||
name: string; | ||
description?: string; | ||
} & Record<string, unknown> & { | ||
type: "function"; | ||
} & import("./common-types").DefaultElements<import("./entities/app-action").AppActionProps> & { | ||
delete(): Promise<void>; | ||
}) | ({ | ||
category: "Custom"; | ||
parameters: import("./entities/app-action").AppActionParameterDefinition[]; | ||
} & { | ||
sys: { | ||
type: string; | ||
id: string; | ||
createdBy?: import("./common-types").SysLink | undefined; | ||
createdAt: string; | ||
updatedBy?: import("./common-types").SysLink | undefined; | ||
updatedAt: string; | ||
} & { | ||
appDefinition: import("./common-types").SysLink; | ||
organization: import("./common-types").SysLink; | ||
}; | ||
name: string; | ||
description?: string; | ||
} & { | ||
type: "endpoint"; | ||
url: string; | ||
} & import("./common-types").DefaultElements<import("./entities/app-action").AppActionProps> & { | ||
delete(): Promise<void>; | ||
}) | ({ | ||
category: "Custom"; | ||
parameters: import("./entities/app-action").AppActionParameterDefinition[]; | ||
} & { | ||
sys: { | ||
type: string; | ||
id: string; | ||
createdBy?: import("./common-types").SysLink | undefined; | ||
createdAt: string; | ||
updatedBy?: import("./common-types").SysLink | undefined; | ||
updatedAt: string; | ||
} & { | ||
appDefinition: import("./common-types").SysLink; | ||
organization: import("./common-types").SysLink; | ||
}; | ||
name: string; | ||
description?: string; | ||
type?: import("./entities/app-action").AppActionType; | ||
} & { | ||
type: "function-invocation"; | ||
function: import("./common-types").Link<"Function">; | ||
} & import("./common-types").DefaultElements<import("./entities/app-action").AppActionProps> & { | ||
@@ -743,6 +829,48 @@ delete(): Promise<void>; | ||
}; | ||
name: string; | ||
description?: string; | ||
} & Record<string, unknown> & { | ||
type: "function"; | ||
} & import("./common-types").DefaultElements<import("./entities/app-action").AppActionProps> & { | ||
delete(): Promise<void>; | ||
}) | ({ | ||
category: "Entries.v1.0" | "Notification.v1.0"; | ||
} & { | ||
sys: { | ||
type: string; | ||
id: string; | ||
createdBy?: import("./common-types").SysLink | undefined; | ||
createdAt: string; | ||
updatedBy?: import("./common-types").SysLink | undefined; | ||
updatedAt: string; | ||
} & { | ||
appDefinition: import("./common-types").SysLink; | ||
organization: import("./common-types").SysLink; | ||
}; | ||
name: string; | ||
description?: string; | ||
} & { | ||
type: "endpoint"; | ||
url: string; | ||
} & import("./common-types").DefaultElements<import("./entities/app-action").AppActionProps> & { | ||
delete(): Promise<void>; | ||
}) | ({ | ||
category: "Entries.v1.0" | "Notification.v1.0"; | ||
} & { | ||
sys: { | ||
type: string; | ||
id: string; | ||
createdBy?: import("./common-types").SysLink | undefined; | ||
createdAt: string; | ||
updatedBy?: import("./common-types").SysLink | undefined; | ||
updatedAt: string; | ||
} & { | ||
appDefinition: import("./common-types").SysLink; | ||
organization: import("./common-types").SysLink; | ||
}; | ||
name: string; | ||
description?: string; | ||
type?: import("./entities/app-action").AppActionType; | ||
} & { | ||
type: "function-invocation"; | ||
function: import("./common-types").Link<"Function">; | ||
} & import("./common-types").DefaultElements<import("./entities/app-action").AppActionProps> & { | ||
@@ -765,6 +893,50 @@ delete(): Promise<void>; | ||
}; | ||
name: string; | ||
description?: string; | ||
} & Record<string, unknown> & { | ||
type: "function"; | ||
} & import("./common-types").DefaultElements<import("./entities/app-action").AppActionProps> & { | ||
delete(): Promise<void>; | ||
}) | ({ | ||
category: "Custom"; | ||
parameters: import("./entities/app-action").AppActionParameterDefinition[]; | ||
} & { | ||
sys: { | ||
type: string; | ||
id: string; | ||
createdBy?: import("./common-types").SysLink | undefined; | ||
createdAt: string; | ||
updatedBy?: import("./common-types").SysLink | undefined; | ||
updatedAt: string; | ||
} & { | ||
appDefinition: import("./common-types").SysLink; | ||
organization: import("./common-types").SysLink; | ||
}; | ||
name: string; | ||
description?: string; | ||
} & { | ||
type: "endpoint"; | ||
url: string; | ||
} & import("./common-types").DefaultElements<import("./entities/app-action").AppActionProps> & { | ||
delete(): Promise<void>; | ||
}) | ({ | ||
category: "Custom"; | ||
parameters: import("./entities/app-action").AppActionParameterDefinition[]; | ||
} & { | ||
sys: { | ||
type: string; | ||
id: string; | ||
createdBy?: import("./common-types").SysLink | undefined; | ||
createdAt: string; | ||
updatedBy?: import("./common-types").SysLink | undefined; | ||
updatedAt: string; | ||
} & { | ||
appDefinition: import("./common-types").SysLink; | ||
organization: import("./common-types").SysLink; | ||
}; | ||
name: string; | ||
description?: string; | ||
type?: import("./entities/app-action").AppActionType; | ||
} & { | ||
type: "function-invocation"; | ||
function: import("./common-types").Link<"Function">; | ||
} & import("./common-types").DefaultElements<import("./entities/app-action").AppActionProps> & { | ||
@@ -818,6 +990,48 @@ delete(): Promise<void>; | ||
}; | ||
name: string; | ||
description?: string; | ||
} & Record<string, unknown> & { | ||
type: "function"; | ||
} & import("./common-types").DefaultElements<import("./entities/app-action").AppActionProps> & { | ||
delete(): Promise<void>; | ||
}) | ({ | ||
category: "Entries.v1.0" | "Notification.v1.0"; | ||
} & { | ||
sys: { | ||
type: string; | ||
id: string; | ||
createdBy?: import("./common-types").SysLink | undefined; | ||
createdAt: string; | ||
updatedBy?: import("./common-types").SysLink | undefined; | ||
updatedAt: string; | ||
} & { | ||
appDefinition: import("./common-types").SysLink; | ||
organization: import("./common-types").SysLink; | ||
}; | ||
name: string; | ||
description?: string; | ||
} & { | ||
type: "endpoint"; | ||
url: string; | ||
} & import("./common-types").DefaultElements<import("./entities/app-action").AppActionProps> & { | ||
delete(): Promise<void>; | ||
}) | ({ | ||
category: "Entries.v1.0" | "Notification.v1.0"; | ||
} & { | ||
sys: { | ||
type: string; | ||
id: string; | ||
createdBy?: import("./common-types").SysLink | undefined; | ||
createdAt: string; | ||
updatedBy?: import("./common-types").SysLink | undefined; | ||
updatedAt: string; | ||
} & { | ||
appDefinition: import("./common-types").SysLink; | ||
organization: import("./common-types").SysLink; | ||
}; | ||
name: string; | ||
description?: string; | ||
type?: import("./entities/app-action").AppActionType; | ||
} & { | ||
type: "function-invocation"; | ||
function: import("./common-types").Link<"Function">; | ||
} & import("./common-types").DefaultElements<import("./entities/app-action").AppActionProps> & { | ||
@@ -840,6 +1054,50 @@ delete(): Promise<void>; | ||
}; | ||
name: string; | ||
description?: string; | ||
} & Record<string, unknown> & { | ||
type: "function"; | ||
} & import("./common-types").DefaultElements<import("./entities/app-action").AppActionProps> & { | ||
delete(): Promise<void>; | ||
}) | ({ | ||
category: "Custom"; | ||
parameters: import("./entities/app-action").AppActionParameterDefinition[]; | ||
} & { | ||
sys: { | ||
type: string; | ||
id: string; | ||
createdBy?: import("./common-types").SysLink | undefined; | ||
createdAt: string; | ||
updatedBy?: import("./common-types").SysLink | undefined; | ||
updatedAt: string; | ||
} & { | ||
appDefinition: import("./common-types").SysLink; | ||
organization: import("./common-types").SysLink; | ||
}; | ||
name: string; | ||
description?: string; | ||
} & { | ||
type: "endpoint"; | ||
url: string; | ||
} & import("./common-types").DefaultElements<import("./entities/app-action").AppActionProps> & { | ||
delete(): Promise<void>; | ||
}) | ({ | ||
category: "Custom"; | ||
parameters: import("./entities/app-action").AppActionParameterDefinition[]; | ||
} & { | ||
sys: { | ||
type: string; | ||
id: string; | ||
createdBy?: import("./common-types").SysLink | undefined; | ||
createdAt: string; | ||
updatedBy?: import("./common-types").SysLink | undefined; | ||
updatedAt: string; | ||
} & { | ||
appDefinition: import("./common-types").SysLink; | ||
organization: import("./common-types").SysLink; | ||
}; | ||
name: string; | ||
description?: string; | ||
type?: import("./entities/app-action").AppActionType; | ||
} & { | ||
type: "function-invocation"; | ||
function: import("./common-types").Link<"Function">; | ||
} & import("./common-types").DefaultElements<import("./entities/app-action").AppActionProps> & { | ||
@@ -846,0 +1104,0 @@ delete(): Promise<void>; |
import type { Except } from 'type-fest'; | ||
import type { BasicMetaSysProps, DefaultElements, MakeRequest, SysLink } from '../common-types'; | ||
import type { BasicMetaSysProps, DefaultElements, Link, MakeRequest, SysLink } from '../common-types'; | ||
import type { ParameterDefinition } from './widget-parameters'; | ||
@@ -34,10 +34,7 @@ type AppActionSys = Except<BasicMetaSysProps, 'version'> & { | ||
export type AppActionCategoryType = AppActionCategory['category']; | ||
/** | ||
* 'function' is deprecated, use 'function-invocation' instead | ||
*/ | ||
export type AppActionType = 'endpoint' | 'function' | 'function-invocation'; | ||
export type CreateAppActionProps = AppActionCategory & { | ||
url: string; | ||
name: string; | ||
description?: string; | ||
type?: AppActionType; | ||
}; | ||
export type AppActionProps = AppActionCategory & { | ||
type BaseAppActionProps = AppActionCategory & { | ||
/** | ||
@@ -48,6 +45,2 @@ * System metadata | ||
/** | ||
* Url that will be called when the action is invoked | ||
*/ | ||
url: string; | ||
/** | ||
* Human readable name for the action | ||
@@ -60,10 +53,62 @@ */ | ||
description?: string; | ||
}; | ||
type CreateEndpointAppActionProps = { | ||
/** | ||
* Type of the action, defaults to endpoint if not provided | ||
* endpoint: action is sent to specified URL | ||
* function: deprecated, use function-invocation instead | ||
*/ | ||
type?: 'endpoint'; | ||
/** | ||
* Url that will be called when the action is invoked | ||
*/ | ||
url: string; | ||
}; | ||
type EndpointAppActionProps = { | ||
/** | ||
* Type of the action | ||
* endpoint: action is sent to specified URL | ||
*/ | ||
type: 'endpoint'; | ||
/** | ||
* Url that will be called when the action is invoked | ||
*/ | ||
url: string; | ||
}; | ||
type CreateFunctionAppActionProps = { | ||
/** | ||
* Type of the action | ||
* function-invocation: action invokes a contentful function | ||
*/ | ||
type?: AppActionType; | ||
type: 'function-invocation'; | ||
/** | ||
* Link to a Function | ||
*/ | ||
function: Link<'Function'>; | ||
/** | ||
* ID of the action | ||
*/ | ||
id?: string; | ||
}; | ||
type FunctionAppActionProps = { | ||
/** | ||
* Type of the action | ||
* function-invocation: action invokes a contentful function | ||
*/ | ||
type: 'function-invocation'; | ||
/** | ||
* Link to a Function | ||
*/ | ||
function: Link<'Function'>; | ||
}; | ||
/** | ||
* @deprecated Use FunctionAppActionProps instead | ||
*/ | ||
type LegacyFunctionAppActionProps = Record<string, unknown> & { | ||
type: 'function'; | ||
}; | ||
export type CreateAppActionProps = AppActionCategory & { | ||
name: string; | ||
description?: string; | ||
} & (CreateEndpointAppActionProps | CreateFunctionAppActionProps | LegacyFunctionAppActionProps); | ||
export type AppActionProps = BaseAppActionProps & (EndpointAppActionProps | FunctionAppActionProps | LegacyFunctionAppActionProps); | ||
export type AppAction = AppActionProps & DefaultElements<AppActionProps> & { | ||
@@ -70,0 +115,0 @@ /** |
@@ -71,2 +71,3 @@ import type { CollectionProp, GetAppActionParams, GetAppActionsForEnvParams, GetAppDefinitionParams, QueryParams } from '../../common-types'; | ||
* ```javascript | ||
* // app action that targets an endpoint url | ||
* const appAction = await client.appAction.create( | ||
@@ -85,2 +86,24 @@ * { | ||
* ); | ||
* | ||
* // app action that invokes a Contentful Function | ||
* const functionAppAction = await client.appAction.create( | ||
* { | ||
* organizationId: '<org_id>', | ||
* appDefinitionId: '<app_definition_id>', | ||
* appActionId: '<app_action_id>', | ||
* }, | ||
* { | ||
* type: "function-invocation", | ||
* function: { | ||
* sys: { | ||
* type: "Link", | ||
* linkType: "Function", | ||
* id: '<function_id>' | ||
* } | ||
* }, | ||
* category: "Notification.v1.0", | ||
* description: "sends a notification", | ||
* name: "Notification (Function Example)", | ||
* } | ||
*); | ||
* ``` | ||
@@ -97,2 +120,3 @@ */ | ||
* ```javascript | ||
* // app action that targets an endpoint url | ||
* const appAction = await client.appAction.update( | ||
@@ -111,2 +135,24 @@ * { | ||
* ); | ||
* | ||
* // app action that invokes a Contentful Function | ||
* const functionAppAction = await client.appAction.update( | ||
* { | ||
* organizationId: '<org_id>', | ||
* appDefinitionId: '<app_definition_id>', | ||
* appActionId: '<app_action_id>', | ||
* }, | ||
* { | ||
* type: "function-invocation", | ||
* function: { | ||
* sys: { | ||
* type: "Link", | ||
* linkType: "Function", | ||
* id: '<function_id>' | ||
* } | ||
* }, | ||
* category: "Notification.v1.0", | ||
* description: "sends a notification", | ||
* name: "Notification (Function Example)", | ||
* } | ||
*); | ||
* ``` | ||
@@ -113,0 +159,0 @@ */ |
{ | ||
"name": "contentful-management", | ||
"version": "11.47.2", | ||
"version": "11.47.3", | ||
"description": "Client for Contentful's Content Management API", | ||
@@ -29,2 +29,3 @@ "homepage": "https://www.contentful.com/developers/documentation/content-management-api/", | ||
"build": "npm run clean && npm run build:modules && npm run build:standalone && npm run build:types", | ||
"postbuild": "npm run test:demo-projects", | ||
"build:modules": "BABEL_ENV=modules babel --extensions \".ts\" --extensions \".js\" lib -d dist/es-modules/", | ||
@@ -52,2 +53,5 @@ "build:standalone": "webpack && NODE_ENV=production webpack", | ||
"test:size": "size-limit", | ||
"test:demo-projects": "npm run test:demo-node && npm run test:demo-browser", | ||
"test:demo-node": "rimraf ./test/output-integration/node/node-modules && npm --prefix ./test/output-integration/node ci && vitest --run ./test/output-integration/node", | ||
"test:demo-browser": "rimraf ./test/output-integration/browser/node-modules && npm --prefix ./test/output-integration/browser ci && npm --prefix ./test/output-integration/browser run test", | ||
"test:prepush": "npm run build && npm run test:unit && npm run test:size", | ||
@@ -70,3 +74,4 @@ "prettier": "prettier --write '**/*.{jsx,js,ts,tsx}'", | ||
"contentful-sdk-core": "^9.0.1", | ||
"fast-copy": "^3.0.0" | ||
"fast-copy": "^3.0.0", | ||
"globals": "^15.15.0" | ||
}, | ||
@@ -73,0 +78,0 @@ "devDependencies": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
8360748
88181
5
6
19
83
+ Addedglobals@^15.15.0
+ Added@rollup/rollup-linux-x64-gnu@4.34.9(transitive)
+ Addedglobals@15.15.0(transitive)
- Removed@rollup/rollup-linux-x64-gnu@4.34.8(transitive)