2023-03-02 11:01:17 +00:00
|
|
|
import { createManifestHandler } from "@saleor/app-sdk/handlers/next";
|
|
|
|
import { AppManifest } from "@saleor/app-sdk/types";
|
|
|
|
|
|
|
|
import packageJson from "../../../package.json";
|
|
|
|
import { checkoutCalculateTaxesSyncWebhook } from "./webhooks/checkout-calculate-taxes";
|
|
|
|
import { orderCalculateTaxesSyncWebhook } from "./webhooks/order-calculate-taxes";
|
|
|
|
|
|
|
|
export default createManifestHandler({
|
|
|
|
async manifestFactory(context) {
|
|
|
|
const manifest: AppManifest = {
|
|
|
|
name: "Taxes",
|
|
|
|
tokenTargetUrl: `${context.appBaseUrl}/api/register`,
|
|
|
|
appUrl: context.appBaseUrl,
|
|
|
|
permissions: ["HANDLE_TAXES", "MANAGE_ORDERS"],
|
|
|
|
id: "saleor.app.taxes",
|
|
|
|
version: packageJson.version,
|
|
|
|
webhooks: [
|
|
|
|
orderCalculateTaxesSyncWebhook.getWebhookManifest(context.appBaseUrl),
|
|
|
|
checkoutCalculateTaxesSyncWebhook.getWebhookManifest(context.appBaseUrl),
|
|
|
|
],
|
|
|
|
extensions: [],
|
|
|
|
homepageUrl: "https://github.com/saleor/apps",
|
|
|
|
supportUrl: "https://github.com/saleor/apps/discussions",
|
2023-03-16 18:09:26 +00:00
|
|
|
author: "Saleor Commerce",
|
2023-03-02 11:01:17 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
return manifest;
|
|
|
|
},
|
|
|
|
});
|