diff --git a/src/types.ts b/src/types.ts new file mode 100644 index 0000000..957c761 --- /dev/null +++ b/src/types.ts @@ -0,0 +1,112 @@ +export type AppExtensionTarget = "POPUP" | "APP_PAGE"; + +export type AppExtensionMount = + | "PRODUCT_DETAILS_MORE_ACTIONS" + | "PRODUCT_OVERVIEW_CREATE" + | "PRODUCT_OVERVIEW_MORE_ACTIONS" + | "NAVIGATION_CATALOG" + | "NAVIGATION_ORDERS" + | "NAVIGATION_CUSTOMERS" + | "NAVIGATION_DISCOUNTS" + | "NAVIGATION_TRANSLATIONS" + | "NAVIGATION_PAGES" + | "ORDER_DETAILS_MORE_ACTIONS" + | "ORDER_OVERVIEW_CREATE" + | "ORDER_OVERVIEW_MORE_ACTIONS"; + +export type AppPermission = + | "HANDLE_PAYMENTS" + | "HANDLE_CHECKOUTS" + | "MANAGE_APPS" + | "MANAGE_CHECKOUTS" + | "MANAGE_DISCOUNTS" + | "MANAGE_GIFT_CARD" + | "MANAGE_MENUS" + | "MANAGE_ORDERS" + | "MANAGE_PAGES" + | "MANAGE_PLUGINS" + | "MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES" + | "MANAGE_PRODUCTS" + | "MANAGE_SETTINGS" + | "MANAGE_SHIPPING" + | "MANAGE_STAFF" + | "MANAGE_TRANSLATIONS" + | "MANAGE_USERS"; + +export type WebhookEvent = string; + +export interface AppExtension { + /** Name which will be displayed in the dashboard */ + label: string; + /** the place where the extension will be mounted */ + mount: AppExtensionMount; + /** Method of presenting the interface + `POPUP` will present the interface in a modal overlay + `APP_PAGE` will navigate to the application page + @default `POPUP` + */ + target: AppExtensionTarget; + permissions: AppPermission[]; + /** URL of the view to display; + you can skip the domain and protocol when target is set to `APP_PAGE`, or when your manifest defines an `appUrl`. + + When target is set to `POPUP`, the url will be used to render an `