2023-03-16 10:17:00 +00:00
|
|
|
import { AppManifest } from "@saleor/app-sdk/types";
|
|
|
|
import { createManifestHandler } from "@saleor/app-sdk/handlers/next";
|
|
|
|
|
|
|
|
import packageJson from "../../../package.json";
|
|
|
|
import { productVariantUpdatedWebhook } from "./webhooks/product-variant-updated";
|
|
|
|
import { productVariantCreatedWebhook } from "./webhooks/product-variant-created";
|
|
|
|
import { productVariantDeletedWebhook } from "./webhooks/product-variant-deleted";
|
2023-03-24 12:36:59 +00:00
|
|
|
import { productUpdatedWebhook } from "./webhooks/product-updated";
|
2023-03-16 10:17:00 +00:00
|
|
|
|
|
|
|
export default createManifestHandler({
|
|
|
|
async manifestFactory(context) {
|
|
|
|
const manifest: AppManifest = {
|
|
|
|
name: "CMS",
|
|
|
|
tokenTargetUrl: `${context.appBaseUrl}/api/register`,
|
|
|
|
appUrl: context.appBaseUrl,
|
|
|
|
permissions: ["MANAGE_PRODUCTS"],
|
|
|
|
id: "saleor.app.cms",
|
|
|
|
version: packageJson.version,
|
|
|
|
webhooks: [
|
|
|
|
productVariantCreatedWebhook.getWebhookManifest(context.appBaseUrl),
|
|
|
|
productVariantUpdatedWebhook.getWebhookManifest(context.appBaseUrl),
|
|
|
|
productVariantDeletedWebhook.getWebhookManifest(context.appBaseUrl),
|
2023-03-24 12:36:59 +00:00
|
|
|
productUpdatedWebhook.getWebhookManifest(context.appBaseUrl),
|
2023-03-16 10:17:00 +00:00
|
|
|
],
|
|
|
|
extensions: [],
|
2023-03-16 18:09:26 +00:00
|
|
|
author: "Saleor Commerce",
|
2023-03-16 10:17:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
return manifest;
|
|
|
|
},
|
|
|
|
});
|