saleor-apps-redis_apl/apps/taxes/src/pages/api/manifest.ts
Lukasz Ostrowski 23b5c70f51
Extract part of Semver compatibility logic to shared package and implement in Invoices and Taxes (#488)
* Extract semver compatibility logic to shared package and implement it in taxes

* Move semver checking package to packages/shared

* Update lock

* Apply suggestions from code review

Co-authored-by: Adrian Pilarczyk <admin@peelar.dev>

* Improve error message

* Fix lockfile

---------

Co-authored-by: Adrian Pilarczyk <admin@peelar.dev>
2023-05-23 11:04:52 +02:00

36 lines
1.5 KiB
TypeScript

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";
import { orderCreatedAsyncWebhook } from "./webhooks/order-created";
import { orderFulfilledAsyncWebhook } from "./webhooks/order-fulfilled";
import { REQUIRED_SALEOR_VERSION } from "../../../saleor-app";
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),
orderCreatedAsyncWebhook.getWebhookManifest(context.appBaseUrl),
orderFulfilledAsyncWebhook.getWebhookManifest(context.appBaseUrl),
],
extensions: [],
homepageUrl: "https://github.com/saleor/apps",
supportUrl: "https://github.com/saleor/apps/discussions",
author: "Saleor Commerce",
dataPrivacyUrl: "https://saleor.io/legal/privacy/",
requiredSaleorVersion: REQUIRED_SALEOR_VERSION,
};
return manifest;
},
});