Loading...
Loading...
Compare original and translation side by side
app.commerce.config.tsapp.commerce.config.tsapp.commerce.config.tssrc/commerce-extensibility-1/node_modules@adobe/aio-commerce-lib-appapp.commerce.config.tscommerce-app-initsrc/commerce-extensibility-1/node_modulesnpx @adobe/aio-commerce-lib-app initwebpack-config.cjstsconfig.jsoninitcommerce-app-initCloudIntegrationSDKcommerceeventingaio console workspace api list --projectName <project> --workspaceName <workspace> --jsonaio console workspace api addaio console workspace api add \
--projectName <project> \
--workspaceName <workspace> \
--service-code <existing-codes>,CloudIntegrationSDK,commerceeventing \
--jsoncommerceeventing--license-config commerceeventing=<profile>app.commerce.config.tssrc/commerce-extensibility-1/node_modules@adobe/aio-commerce-lib-appapp.commerce.config.tscommerce-app-initsrc/commerce-extensibility-1/node_modulesnpx @adobe/aio-commerce-lib-app initinitwebpack-config.cjstsconfig.jsoncommerce-app-initCloudIntegrationSDKcommerceeventingaio console workspace api list --projectName <project> --workspaceName <workspace> --jsonaio console workspace api addaio console workspace api add \
--projectName <project> \
--workspaceName <workspace> \
--service-code <existing-codes>,CloudIntegrationSDK,commerceeventing \
--jsoncommerceeventing--license-config commerceeventing=<profile>eventing.commerceplugin.<segments>observer.<segments>eventing.external[\w\-_.]+<package>/<action>enveventing.commerceplugin.<segments>observer.<segments>eventing.external[\w\-_.]+<package>/<action>env| Field | Constraint |
|---|---|
| Commerce event name | Starts with |
| External event name | |
| Provider label | Max 100 chars |
| Provider description | Max 255 chars |
| Provider key | Optional; alphanumeric + hyphens only; max 50 chars |
| Event label | Max 100 chars |
| Event description | Max 255 chars |
| Field name | |
| Rule operator | |
| Runtime action | |
| Event env (optional) | Non-empty array of |
| 字段 | 约束条件 |
|---|---|
| Commerce事件名称 | 以 |
| 外部事件名称 | |
| 提供商标签 | 最大长度100字符 |
| 提供商描述 | 最大长度255字符 |
| 提供商键值 | 可选;仅包含字母数字和连字符;最大长度50字符 |
| 事件标签 | 最大长度100字符 |
| 事件描述 | 最大长度255字符 |
| 字段名称 | |
| 规则运算符 | |
| 运行时Action | |
| 事件环境(可选) | 非空数组,元素为 |
app.commerce.config.tsapp.commerce.config.tseventing.commerceeventing.externaleventingeventing: {
commerce: [{
provider: { label: "Commerce Events Provider", description: "..." },
events: [{
name: "plugin.order_placed", // plugin.<segments> or observer.<segments>
label: "Order Placed",
description: "Triggered when a customer places an order.",
fields: [{ name: "order_id" }], // empty array = full payload; Commerce events only
runtimeActions: ["my-package/handle-order-placed"], // <package>/<action>
}],
}],
}eventing.commerceeventing.externaleventingeventing: {
commerce: [{
provider: { label: "Commerce Events Provider", description: "..." },
events: [{
name: "plugin.order_placed", // plugin.<segments> or observer.<segments>
label: "Order Placed",
description: "Triggered when a customer places an order.",
fields: [{ name: "order_id" }], // empty array = full payload; Commerce events only
runtimeActions: ["my-package/handle-order-placed"], // <package>/<action>
}],
}],
}runtimeActionssrc/actions/app.config.yamlruntimeActionssrc/actions/app.config.yamlsrc/commerce-extensibility-1/ext.config.yamlapp-managementapp-managementundefinedsrc/commerce-extensibility-1/ext.config.yamlapp-managementapp-managementundefined
The `<package>/<action>` format in `runtimeActions` maps directly: `my-app/handle-order-placed` → package `my-app`, action `handle-order-placed`.
`runtimeActions`中的`<package>/<action>`格式直接对应:`my-app/handle-order-placed` → 包`my-app`,Action`handle-order-placed`。params.data// src/commerce-extensibility-1/actions/handle-order-placed/index.ts
export async function main(params: Record<string, unknown>) {
const data = params.data as Record<string, unknown>;
// data contains the fields declared in the event's `fields` array
// (or the full payload if fields is empty)
const orderId = data["order_id"];
// process the event ...
return { statusCode: 200, body: { processed: true } };
}params.data// src/commerce-extensibility-1/actions/handle-order-placed/index.ts
export async function main(params: Record<string, unknown>) {
const data = params.data as Record<string, unknown>;
// data包含事件`fields`数组中声明的字段
// (如果fields为空则包含完整负载)
const orderId = data["order_id"];
// 处理事件...
return { statusCode: 200, body: { processed: true } };
}aio app buildaio app buildfieldsfieldsruntimeActions<package>/<action>app-managementext.config.yamlsrc/commerce-extensibility-1/src/...actions/handle-order-placed/index.jssrc/commerce-extensibility-1/actions/handle-order-placed/index.jsdefineConfig@adobe/aio-commerce-lib-appdefineConfig@adobe/aio-commerce-lib-app/configruntimeActionssrc/commerce-extensibility-1/actions/fieldsfieldsruntimeActions<package>/<action>app-managementext.config.yamlsrc/commerce-extensibility-1/src/...actions/handle-order-placed/index.jssrc/commerce-extensibility-1/actions/handle-order-placed/index.jsdefineConfig@adobe/aio-commerce-lib-app@adobe/aio-commerce-lib-app/configdefineConfigruntimeActionssrc/commerce-extensibility-1/actions/aio app buildaio app buildaio app buildcommerce-app-webhookscommerce-app-business-configcommerce-app-admin-uicommerce-app-storageaio app buildcommerce-app-webhookscommerce-app-business-configcommerce-app-admin-uicommerce-app-storage