Update app-sdk in apps to 0.34.0 and rewrite SaleorAsyncWebhook to modern api (#238)

* Data importer: disable sentry if not in env

* All packages: update app sdk to 0.34.0 version and update api
This commit is contained in:
Lukasz Ostrowski 2023-03-07 16:21:46 +01:00 committed by GitHub
parent 7632c44ab0
commit dca82bb93c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 101 additions and 126 deletions

View file

@ -0,0 +1,11 @@
---
"saleor-app-data-importer": patch
"saleor-app-products-feed": patch
"saleor-app-monitoring": patch
"saleor-app-invoices": patch
"saleor-app-klaviyo": patch
"saleor-app-search": patch
"saleor-app-slack": patch
---
Update app-sdk to pre-0.34.0. Update Async Webhooks to use new API

View file

@ -4,6 +4,9 @@
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/ // https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
const { withSentryConfig } = require("@sentry/nextjs"); const { withSentryConfig } = require("@sentry/nextjs");
const isSentryPropertiesInEnvironment =
process.env.SENTRY_AUTH_TOKEN && process.env.SENTRY_PROJECT && process.env.SENTRY_ORG;
/** /**
* @type {import('next').NextConfig} * @type {import('next').NextConfig}
*/ */
@ -13,6 +16,10 @@ module.exports = {
esmExternals: true, esmExternals: true,
}, },
transpilePackages: ["nuvo-react", "@saleor/apps-shared"], transpilePackages: ["nuvo-react", "@saleor/apps-shared"],
sentry: {
disableServerWebpackPlugin: !isSentryPropertiesInEnvironment,
disableClientWebpackPlugin: !isSentryPropertiesInEnvironment,
},
}; };
module.exports = withSentryConfig(module.exports, { silent: true }, { hideSourcemaps: true }); module.exports = withSentryConfig(module.exports, { silent: true }, { hideSourcemaps: true });

View file

@ -19,7 +19,7 @@
"@material-ui/core": "^4.12.4", "@material-ui/core": "^4.12.4",
"@material-ui/icons": "^4.11.3", "@material-ui/icons": "^4.11.3",
"@material-ui/lab": "4.0.0-alpha.61", "@material-ui/lab": "4.0.0-alpha.61",
"@saleor/app-sdk": "0.29.0", "@saleor/app-sdk": "0.34.0",
"@saleor/apps-shared": "workspace:*", "@saleor/apps-shared": "workspace:*",
"@saleor/macaw-ui": "^0.7.2", "@saleor/macaw-ui": "^0.7.2",
"@sentry/nextjs": "^7.39.0", "@sentry/nextjs": "^7.39.0",

View file

@ -16,11 +16,11 @@
"schemaVersion": "3.10" "schemaVersion": "3.10"
}, },
"dependencies": { "dependencies": {
"semver": "^7.3.8",
"@material-ui/core": "^4.12.4", "@material-ui/core": "^4.12.4",
"@material-ui/icons": "^4.11.3", "@material-ui/icons": "^4.11.3",
"@material-ui/lab": "4.0.0-alpha.61", "@material-ui/lab": "4.0.0-alpha.61",
"@saleor/app-sdk": "0.33.0", "@saleor/app-sdk": "0.34.0",
"@saleor/apps-shared": "workspace:*",
"@saleor/macaw-ui": "^0.7.2", "@saleor/macaw-ui": "^0.7.2",
"@sentry/nextjs": "^7.36.0", "@sentry/nextjs": "^7.36.0",
"@tanstack/react-query": "^4.24.4", "@tanstack/react-query": "^4.24.4",
@ -41,11 +41,11 @@
"react": "18.2.0", "react": "18.2.0",
"react-dom": "18.2.0", "react-dom": "18.2.0",
"react-hook-form": "^7.41.0", "react-hook-form": "^7.41.0",
"semver": "^7.3.8",
"tiny-invariant": "^1.3.1", "tiny-invariant": "^1.3.1",
"urql": "^3.0.3", "urql": "^3.0.3",
"usehooks-ts": "^2.9.1", "usehooks-ts": "^2.9.1",
"zod": "^3.20.2", "zod": "^3.20.2"
"@saleor/apps-shared": "workspace:*"
}, },
"devDependencies": { "devDependencies": {
"@graphql-codegen/cli": "2.13.3", "@graphql-codegen/cli": "2.13.3",
@ -62,12 +62,12 @@
"@types/rimraf": "^3.0.2", "@types/rimraf": "^3.0.2",
"@vitejs/plugin-react": "^3.0.0", "@vitejs/plugin-react": "^3.0.0",
"@vitest/coverage-c8": "^0.28.4", "@vitest/coverage-c8": "^0.28.4",
"eslint-config-saleor": "workspace:*",
"jsdom": "^20.0.3", "jsdom": "^20.0.3",
"rimraf": "^3.0.2", "rimraf": "^3.0.2",
"typescript": "4.9.5", "typescript": "4.9.5",
"vite": "^4.1.1", "vite": "^4.1.1",
"vitest": "^0.28.4", "vitest": "^0.28.4"
"eslint-config-saleor": "workspace:*"
}, },
"lint-staged": { "lint-staged": {
"*.{js,ts,tsx}": "eslint --cache --fix", "*.{js,ts,tsx}": "eslint --cache --fix",

View file

@ -122,9 +122,9 @@ const InvoiceRequestedSubscription = gql`
export const invoiceRequestedWebhook = new SaleorAsyncWebhook<InvoiceRequestedPayloadFragment>({ export const invoiceRequestedWebhook = new SaleorAsyncWebhook<InvoiceRequestedPayloadFragment>({
name: "Invoice requested", name: "Invoice requested",
webhookPath: "api/webhooks/invoice-requested", webhookPath: "api/webhooks/invoice-requested",
asyncEvent: "INVOICE_REQUESTED", event: "INVOICE_REQUESTED",
apl: saleorApp.apl, apl: saleorApp.apl,
subscriptionQueryAst: InvoiceRequestedSubscription, query: InvoiceRequestedSubscription,
onError(error, req, res) { onError(error, req, res) {
const saleorApiUrl = req.headers[SALEOR_API_URL_HEADER] as string; const saleorApiUrl = req.headers[SALEOR_API_URL_HEADER] as string;

View file

@ -18,7 +18,8 @@
"@material-ui/core": "^4.12.4", "@material-ui/core": "^4.12.4",
"@material-ui/icons": "^4.11.3", "@material-ui/icons": "^4.11.3",
"@material-ui/lab": "4.0.0-alpha.61", "@material-ui/lab": "4.0.0-alpha.61",
"@saleor/app-sdk": "0.29.0", "@saleor/app-sdk": "0.34.0",
"@saleor/apps-shared": "workspace:*",
"@saleor/macaw-ui": "^0.7.2", "@saleor/macaw-ui": "^0.7.2",
"@sentry/nextjs": "^7.36.0", "@sentry/nextjs": "^7.36.0",
"@urql/exchange-auth": "^1.0.0", "@urql/exchange-auth": "^1.0.0",
@ -30,8 +31,7 @@
"react": "18.2.0", "react": "18.2.0",
"react-dom": "18.2.0", "react-dom": "18.2.0",
"react-helmet": "^6.1.0", "react-helmet": "^6.1.0",
"urql": "^3.0.3", "urql": "^3.0.3"
"@saleor/apps-shared": "workspace:*"
}, },
"devDependencies": { "devDependencies": {
"@graphql-codegen/cli": "2.7.0", "@graphql-codegen/cli": "2.7.0",
@ -48,11 +48,11 @@
"autoprefixer": "^10.4.7", "autoprefixer": "^10.4.7",
"clean-publish": "^4.0.1", "clean-publish": "^4.0.1",
"eslint": "8.15.0", "eslint": "8.15.0",
"eslint-config-saleor": "workspace:*",
"husky": "^8.0.1", "husky": "^8.0.1",
"postcss": "^8.4.14", "postcss": "^8.4.14",
"prettier": "^2.7.1", "prettier": "^2.7.1",
"pretty-quick": "^3.1.3", "pretty-quick": "^3.1.3",
"typescript": "4.9.5", "typescript": "4.9.5"
"eslint-config-saleor": "workspace:*"
} }
} }

View file

@ -53,9 +53,9 @@ export const customerCreatedWebhook = new SaleorAsyncWebhook<CustomerCreatedWebh
{ {
name: "Customer Created", name: "Customer Created",
webhookPath: "api/webhooks/customer-created", webhookPath: "api/webhooks/customer-created",
asyncEvent: "CUSTOMER_CREATED", event: "CUSTOMER_CREATED",
apl: saleorApp.apl, apl: saleorApp.apl,
subscriptionQueryAst: UntypedCustomerCreatedDocument, query: UntypedCustomerCreatedDocument,
} }
); );

View file

@ -60,9 +60,9 @@ export const fulfillmentCreatedWebhook =
new SaleorAsyncWebhook<FulfillmentCreatedWebhookPayloadFragment>({ new SaleorAsyncWebhook<FulfillmentCreatedWebhookPayloadFragment>({
name: "Fulfillment Created", name: "Fulfillment Created",
webhookPath: "api/webhooks/fulfillment-created", webhookPath: "api/webhooks/fulfillment-created",
asyncEvent: "FULFILLMENT_CREATED", event: "FULFILLMENT_CREATED",
apl: saleorApp.apl, apl: saleorApp.apl,
subscriptionQueryAst: UntypedFulfillmentCreatedDocument, query: UntypedFulfillmentCreatedDocument,
}); });
const handler: NextWebhookApiHandler<FulfillmentCreatedWebhookPayloadFragment> = async ( const handler: NextWebhookApiHandler<FulfillmentCreatedWebhookPayloadFragment> = async (

View file

@ -30,9 +30,9 @@ export const OrderCreatedGraphqlSubscription = gql`
export const orderCreatedWebhook = new SaleorAsyncWebhook<OrderCreatedWebhookPayloadFragment>({ export const orderCreatedWebhook = new SaleorAsyncWebhook<OrderCreatedWebhookPayloadFragment>({
name: "Order Created", name: "Order Created",
webhookPath: "api/webhooks/order-created", webhookPath: "api/webhooks/order-created",
asyncEvent: "ORDER_CREATED", event: "ORDER_CREATED",
apl: saleorApp.apl, apl: saleorApp.apl,
subscriptionQueryAst: UntypedOrderCreatedDocument, query: UntypedOrderCreatedDocument,
}); });
const handler: NextWebhookApiHandler<OrderCreatedWebhookPayloadFragment> = async ( const handler: NextWebhookApiHandler<OrderCreatedWebhookPayloadFragment> = async (

View file

@ -30,9 +30,9 @@ export const OrderFullyPaidGraphqlSubscription = gql`
export const orderFullyPaidWebhook = new SaleorAsyncWebhook<OrderFullyPaidWebhookPayloadFragment>({ export const orderFullyPaidWebhook = new SaleorAsyncWebhook<OrderFullyPaidWebhookPayloadFragment>({
name: "Order Fully Paid", name: "Order Fully Paid",
webhookPath: "api/webhooks/order-fully-paid", webhookPath: "api/webhooks/order-fully-paid",
asyncEvent: "ORDER_FULLY_PAID", event: "ORDER_FULLY_PAID",
apl: saleorApp.apl, apl: saleorApp.apl,
subscriptionQueryAst: UntypedOrderFullyPaidDocument, query: UntypedOrderFullyPaidDocument,
}); });
const handler: NextWebhookApiHandler<OrderFullyPaidWebhookPayloadFragment> = async ( const handler: NextWebhookApiHandler<OrderFullyPaidWebhookPayloadFragment> = async (

View file

@ -14,25 +14,25 @@
"schemaVersion": "3.10" "schemaVersion": "3.10"
}, },
"dependencies": { "dependencies": {
"react-hook-form": "^7.42.1",
"@material-ui/core": "^4.12.4", "@material-ui/core": "^4.12.4",
"@material-ui/icons": "^4.11.3", "@material-ui/icons": "^4.11.3",
"@material-ui/lab": "4.0.0-alpha.61", "@material-ui/lab": "4.0.0-alpha.61",
"@saleor/app-sdk": "0.27.1", "@saleor/app-sdk": "0.34.0",
"@saleor/apps-shared": "workspace:*",
"@saleor/macaw-ui": "^0.7.2", "@saleor/macaw-ui": "^0.7.2",
"@urql/exchange-auth": "^1.0.0", "@urql/exchange-auth": "^1.0.0",
"@vitejs/plugin-react": "^3.0.1", "@vitejs/plugin-react": "^3.0.1",
"clsx": "^1.2.1",
"graphql": "^16.6.0", "graphql": "^16.6.0",
"graphql-tag": "^2.12.6", "graphql-tag": "^2.12.6",
"jsdom": "^20.0.3", "jsdom": "^20.0.3",
"next": "13.1.2", "next": "13.1.2",
"react": "18.2.0", "react": "18.2.0",
"react-dom": "18.2.0", "react-dom": "18.2.0",
"react-hook-form": "^7.42.1",
"urql": "^3.0.3", "urql": "^3.0.3",
"vite": "^4.0.4", "vite": "^4.0.4",
"vitest": "^0.27.1", "vitest": "^0.27.1"
"clsx": "^1.2.1",
"@saleor/apps-shared": "workspace:*"
}, },
"devDependencies": { "devDependencies": {
"@graphql-codegen/cli": "2.13.3", "@graphql-codegen/cli": "2.13.3",
@ -51,9 +51,9 @@
"eslint": "8.31.0", "eslint": "8.31.0",
"eslint-config-next": "13.1.2", "eslint-config-next": "13.1.2",
"eslint-config-prettier": "^8.6.0", "eslint-config-prettier": "^8.6.0",
"eslint-config-saleor": "workspace:*",
"prettier": "^2.8.2", "prettier": "^2.8.2",
"typescript": "4.9.4", "typescript": "4.9.4"
"eslint-config-saleor": "workspace:*"
}, },
"lint-staged": { "lint-staged": {
"*.{js,ts,tsx}": "eslint --cache --fix", "*.{js,ts,tsx}": "eslint --cache --fix",

View file

@ -18,7 +18,8 @@
"@material-ui/core": "^4.12.4", "@material-ui/core": "^4.12.4",
"@material-ui/icons": "^4.11.3", "@material-ui/icons": "^4.11.3",
"@material-ui/lab": "4.0.0-alpha.61", "@material-ui/lab": "4.0.0-alpha.61",
"@saleor/app-sdk": "0.29.0", "@saleor/app-sdk": "0.34.0",
"@saleor/apps-shared": "workspace:*",
"@saleor/macaw-ui": "^0.7.2", "@saleor/macaw-ui": "^0.7.2",
"@tanstack/react-query": "^4.24.2", "@tanstack/react-query": "^4.24.2",
"@trpc/client": "^10.9.0", "@trpc/client": "^10.9.0",
@ -44,11 +45,9 @@
"usehooks-ts": "^2.9.1", "usehooks-ts": "^2.9.1",
"vite": "^4.0.4", "vite": "^4.0.4",
"vitest": "^0.27.1", "vitest": "^0.27.1",
"zod": "^3.20.2", "zod": "^3.20.2"
"@saleor/apps-shared": "workspace:*"
}, },
"devDependencies": { "devDependencies": {
"eslint-config-saleor": "workspace:*",
"@graphql-codegen/cli": "2.13.3", "@graphql-codegen/cli": "2.13.3",
"@graphql-codegen/introspection": "2.2.1", "@graphql-codegen/introspection": "2.2.1",
"@graphql-codegen/typed-document-node": "^2.3.3", "@graphql-codegen/typed-document-node": "^2.3.3",
@ -65,6 +64,7 @@
"eslint": "8.31.0", "eslint": "8.31.0",
"eslint-config-next": "13.1.2", "eslint-config-next": "13.1.2",
"eslint-config-prettier": "^8.6.0", "eslint-config-prettier": "^8.6.0",
"eslint-config-saleor": "workspace:*",
"prettier": "^2.8.2", "prettier": "^2.8.2",
"typescript": "4.9.4" "typescript": "4.9.4"
}, },

View file

@ -17,7 +17,8 @@
"@material-ui/core": "^4.12.4", "@material-ui/core": "^4.12.4",
"@material-ui/icons": "^4.11.3", "@material-ui/icons": "^4.11.3",
"@material-ui/lab": "4.0.0-alpha.61", "@material-ui/lab": "4.0.0-alpha.61",
"@saleor/app-sdk": "0.29.0", "@saleor/app-sdk": "0.34.0",
"@saleor/apps-shared": "workspace:*",
"@saleor/macaw-ui": "0.7.2", "@saleor/macaw-ui": "0.7.2",
"@sentry/nextjs": "^7.31.1", "@sentry/nextjs": "^7.31.1",
"@types/debug": "^4.1.7", "@types/debug": "^4.1.7",
@ -36,8 +37,7 @@
"react-hook-form": "^7.39.1", "react-hook-form": "^7.39.1",
"react-instantsearch-hooks-web": "^6.38.0", "react-instantsearch-hooks-web": "^6.38.0",
"react-query": "^3.39.2", "react-query": "^3.39.2",
"urql": "^3.0.3", "urql": "^3.0.3"
"@saleor/apps-shared": "workspace:*"
}, },
"devDependencies": { "devDependencies": {
"@graphql-codegen/cli": "2.13.11", "@graphql-codegen/cli": "2.13.11",
@ -54,9 +54,9 @@
"eslint": "8.27.0", "eslint": "8.27.0",
"eslint-config-next": "13.0.2", "eslint-config-next": "13.0.2",
"eslint-config-prettier": "^8.5.0", "eslint-config-prettier": "^8.5.0",
"eslint-config-saleor": "workspace:*",
"prettier": "^2.7.1", "prettier": "^2.7.1",
"typescript": "4.8.4", "typescript": "4.8.4"
"eslint-config-saleor": "workspace:*"
}, },
"lint-staged": { "lint-staged": {
"*.{js,ts,tsx}": "eslint --cache --fix", "*.{js,ts,tsx}": "eslint --cache --fix",

View file

@ -13,13 +13,13 @@ export const config = {
export const webhookProductCreated = new SaleorAsyncWebhook<ProductCreated>({ export const webhookProductCreated = new SaleorAsyncWebhook<ProductCreated>({
webhookPath: "api/webhooks/saleor/product_created", webhookPath: "api/webhooks/saleor/product_created",
asyncEvent: "PRODUCT_CREATED", event: "PRODUCT_CREATED",
apl: saleorApp.apl, apl: saleorApp.apl,
subscriptionQueryAst: ProductCreatedDocument, query: ProductCreatedDocument,
}); });
export const handler: NextWebhookApiHandler<ProductCreated> = async (req, res, context) => { export const handler: NextWebhookApiHandler<ProductCreated> = async (req, res, context) => {
const debug = createDebug(`Webhook handler - ${webhookProductCreated.asyncEvent}`); const debug = createDebug(`Webhook handler - ${webhookProductCreated.event}`);
const { event, authData } = context; const { event, authData } = context;
debug( debug(

View file

@ -13,13 +13,13 @@ export const config = {
export const webhookProductDeleted = new SaleorAsyncWebhook<ProductDeleted>({ export const webhookProductDeleted = new SaleorAsyncWebhook<ProductDeleted>({
webhookPath: "api/webhooks/saleor/product_deleted", webhookPath: "api/webhooks/saleor/product_deleted",
asyncEvent: "PRODUCT_DELETED", event: "PRODUCT_DELETED",
apl: saleorApp.apl, apl: saleorApp.apl,
subscriptionQueryAst: ProductDeletedDocument, query: ProductDeletedDocument,
}); });
export const handler: NextWebhookApiHandler<ProductDeleted> = async (req, res, context) => { export const handler: NextWebhookApiHandler<ProductDeleted> = async (req, res, context) => {
const debug = createDebug(`Webhook handler - ${webhookProductDeleted.asyncEvent}`); const debug = createDebug(`Webhook handler - ${webhookProductDeleted.event}`);
const { event, authData } = context; const { event, authData } = context;
debug( debug(

View file

@ -13,13 +13,13 @@ export const config = {
export const webhookProductUpdated = new SaleorAsyncWebhook<ProductUpdated>({ export const webhookProductUpdated = new SaleorAsyncWebhook<ProductUpdated>({
webhookPath: "api/webhooks/saleor/product_updated", webhookPath: "api/webhooks/saleor/product_updated",
asyncEvent: "PRODUCT_UPDATED", event: "PRODUCT_UPDATED",
apl: saleorApp.apl, apl: saleorApp.apl,
subscriptionQueryAst: ProductUpdatedDocument, query: ProductUpdatedDocument,
}); });
export const handler: NextWebhookApiHandler<ProductUpdated> = async (req, res, context) => { export const handler: NextWebhookApiHandler<ProductUpdated> = async (req, res, context) => {
const debug = createDebug(`Webhook handler - ${webhookProductUpdated.asyncEvent}`); const debug = createDebug(`Webhook handler - ${webhookProductUpdated.event}`);
const { event, authData } = context; const { event, authData } = context;
debug( debug(

View file

@ -16,13 +16,13 @@ export const config = {
export const webhookProductVariantCreated = new SaleorAsyncWebhook<ProductVariantCreated>({ export const webhookProductVariantCreated = new SaleorAsyncWebhook<ProductVariantCreated>({
webhookPath: "api/webhooks/saleor/product_variant_created", webhookPath: "api/webhooks/saleor/product_variant_created",
asyncEvent: "PRODUCT_VARIANT_CREATED", event: "PRODUCT_VARIANT_CREATED",
apl: saleorApp.apl, apl: saleorApp.apl,
subscriptionQueryAst: ProductVariantCreatedDocument, query: ProductVariantCreatedDocument,
}); });
export const handler: NextWebhookApiHandler<ProductVariantCreated> = async (req, res, context) => { export const handler: NextWebhookApiHandler<ProductVariantCreated> = async (req, res, context) => {
const debug = createDebug(`Webhook handler - ${webhookProductVariantCreated.asyncEvent}`); const debug = createDebug(`Webhook handler - ${webhookProductVariantCreated.event}`);
const { event, authData } = context; const { event, authData } = context;
debug( debug(

View file

@ -16,13 +16,13 @@ export const config = {
export const webhookProductVariantDeleted = new SaleorAsyncWebhook<ProductVariantDeleted>({ export const webhookProductVariantDeleted = new SaleorAsyncWebhook<ProductVariantDeleted>({
webhookPath: "api/webhooks/saleor/product_variant_deleted", webhookPath: "api/webhooks/saleor/product_variant_deleted",
asyncEvent: "PRODUCT_VARIANT_DELETED", event: "PRODUCT_VARIANT_DELETED",
apl: saleorApp.apl, apl: saleorApp.apl,
subscriptionQueryAst: ProductVariantDeletedDocument, query: ProductVariantDeletedDocument,
}); });
export const handler: NextWebhookApiHandler<ProductVariantDeleted> = async (req, res, context) => { export const handler: NextWebhookApiHandler<ProductVariantDeleted> = async (req, res, context) => {
const debug = createDebug(`Webhook handler - ${webhookProductVariantDeleted.asyncEvent}`); const debug = createDebug(`Webhook handler - ${webhookProductVariantDeleted.event}`);
const { event, authData } = context; const { event, authData } = context;
debug( debug(

View file

@ -16,13 +16,13 @@ export const config = {
export const webhookProductVariantUpdated = new SaleorAsyncWebhook<ProductVariantUpdated>({ export const webhookProductVariantUpdated = new SaleorAsyncWebhook<ProductVariantUpdated>({
webhookPath: "api/webhooks/saleor/product_variant_updated", webhookPath: "api/webhooks/saleor/product_variant_updated",
asyncEvent: "PRODUCT_VARIANT_UPDATED", event: "PRODUCT_VARIANT_UPDATED",
apl: saleorApp.apl, apl: saleorApp.apl,
subscriptionQueryAst: ProductVariantUpdatedDocument, query: ProductVariantUpdatedDocument,
}); });
export const handler: NextWebhookApiHandler<ProductVariantUpdated> = async (req, res, context) => { export const handler: NextWebhookApiHandler<ProductVariantUpdated> = async (req, res, context) => {
const debug = createDebug(`Webhook handler - ${webhookProductVariantUpdated.asyncEvent}`); const debug = createDebug(`Webhook handler - ${webhookProductVariantUpdated.event}`);
const { event, authData } = context; const { event, authData } = context;
debug( debug(

View file

@ -17,7 +17,8 @@
"@material-ui/core": "^4.12.4", "@material-ui/core": "^4.12.4",
"@material-ui/icons": "^4.11.3", "@material-ui/icons": "^4.11.3",
"@material-ui/lab": "4.0.0-alpha.61", "@material-ui/lab": "4.0.0-alpha.61",
"@saleor/app-sdk": "0.29.0", "@saleor/app-sdk": "0.34.0",
"@saleor/apps-shared": "workspace:*",
"@saleor/macaw-ui": "^0.7.2", "@saleor/macaw-ui": "^0.7.2",
"@sentry/nextjs": "^7.30.0", "@sentry/nextjs": "^7.30.0",
"@urql/exchange-auth": "^1.0.0", "@urql/exchange-auth": "^1.0.0",
@ -30,8 +31,7 @@
"react-dom": "18.2.0", "react-dom": "18.2.0",
"react-helmet": "^6.1.0", "react-helmet": "^6.1.0",
"urql": "^3.0.3", "urql": "^3.0.3",
"usehooks-ts": "^2.9.1", "usehooks-ts": "^2.9.1"
"@saleor/apps-shared": "workspace:*"
}, },
"devDependencies": { "devDependencies": {
"@graphql-codegen/cli": "2.7.0", "@graphql-codegen/cli": "2.7.0",
@ -49,10 +49,10 @@
"@typescript-eslint/parser": "^5.36.2", "@typescript-eslint/parser": "^5.36.2",
"autoprefixer": "^10.4.7", "autoprefixer": "^10.4.7",
"clean-publish": "^4.0.1", "clean-publish": "^4.0.1",
"eslint-config-saleor": "workspace:*",
"postcss": "^8.4.14", "postcss": "^8.4.14",
"pretty-quick": "^3.1.3", "pretty-quick": "^3.1.3",
"typescript": "4.8.3", "typescript": "4.8.3"
"eslint-config-saleor": "workspace:*"
}, },
"lint-staged": { "lint-staged": {
"*.{js,ts,tsx}": "eslint --cache --fix", "*.{js,ts,tsx}": "eslint --cache --fix",

View file

@ -68,9 +68,9 @@ const OrderCreatedGraphqlSubscription = gql`
export const orderCreatedWebhook = new SaleorAsyncWebhook<OrderCreatedWebhookPayloadFragment>({ export const orderCreatedWebhook = new SaleorAsyncWebhook<OrderCreatedWebhookPayloadFragment>({
name: "Order Created in Saleor", name: "Order Created in Saleor",
webhookPath: "api/webhooks/order-created", webhookPath: "api/webhooks/order-created",
asyncEvent: "ORDER_CREATED", event: "ORDER_CREATED",
apl: saleorApp.apl, apl: saleorApp.apl,
subscriptionQueryAst: OrderCreatedGraphqlSubscription, query: OrderCreatedGraphqlSubscription,
}); });
const handler: NextWebhookApiHandler<OrderCreatedWebhookPayloadFragment> = async ( const handler: NextWebhookApiHandler<OrderCreatedWebhookPayloadFragment> = async (

View file

@ -33,7 +33,7 @@ importers:
'@material-ui/core': ^4.12.4 '@material-ui/core': ^4.12.4
'@material-ui/icons': ^4.11.3 '@material-ui/icons': ^4.11.3
'@material-ui/lab': 4.0.0-alpha.61 '@material-ui/lab': 4.0.0-alpha.61
'@saleor/app-sdk': 0.29.0 '@saleor/app-sdk': 0.34.0
'@saleor/apps-shared': workspace:* '@saleor/apps-shared': workspace:*
'@saleor/macaw-ui': ^0.7.2 '@saleor/macaw-ui': ^0.7.2
'@sentry/nextjs': ^7.39.0 '@sentry/nextjs': ^7.39.0
@ -68,7 +68,7 @@ importers:
'@material-ui/core': 4.12.4_5ndqzdd6t4rivxsukjv3i3ak2q '@material-ui/core': 4.12.4_5ndqzdd6t4rivxsukjv3i3ak2q
'@material-ui/icons': 4.11.3_x54wk6dsnsxe7g7vvfmytp77te '@material-ui/icons': 4.11.3_x54wk6dsnsxe7g7vvfmytp77te
'@material-ui/lab': 4.0.0-alpha.61_x54wk6dsnsxe7g7vvfmytp77te '@material-ui/lab': 4.0.0-alpha.61_x54wk6dsnsxe7g7vvfmytp77te
'@saleor/app-sdk': 0.29.0_3vryta7zmbcsw4rrqf4axjqggm '@saleor/app-sdk': 0.34.0_3vryta7zmbcsw4rrqf4axjqggm
'@saleor/apps-shared': link:../../packages/shared '@saleor/apps-shared': link:../../packages/shared
'@saleor/macaw-ui': 0.7.2_pmlnlm755hlzzzocw2qhf3a34e '@saleor/macaw-ui': 0.7.2_pmlnlm755hlzzzocw2qhf3a34e
'@sentry/nextjs': 7.39.0_next@13.1.6+react@18.2.0 '@sentry/nextjs': 7.39.0_next@13.1.6+react@18.2.0
@ -122,7 +122,7 @@ importers:
'@material-ui/core': ^4.12.4 '@material-ui/core': ^4.12.4
'@material-ui/icons': ^4.11.3 '@material-ui/icons': ^4.11.3
'@material-ui/lab': 4.0.0-alpha.61 '@material-ui/lab': 4.0.0-alpha.61
'@saleor/app-sdk': 0.33.0 '@saleor/app-sdk': 0.34.0
'@saleor/apps-shared': workspace:* '@saleor/apps-shared': workspace:*
'@saleor/macaw-ui': ^0.7.2 '@saleor/macaw-ui': ^0.7.2
'@sentry/nextjs': ^7.36.0 '@sentry/nextjs': ^7.36.0
@ -165,7 +165,7 @@ importers:
'@material-ui/core': 4.12.4_5ndqzdd6t4rivxsukjv3i3ak2q '@material-ui/core': 4.12.4_5ndqzdd6t4rivxsukjv3i3ak2q
'@material-ui/icons': 4.11.3_x54wk6dsnsxe7g7vvfmytp77te '@material-ui/icons': 4.11.3_x54wk6dsnsxe7g7vvfmytp77te
'@material-ui/lab': 4.0.0-alpha.61_x54wk6dsnsxe7g7vvfmytp77te '@material-ui/lab': 4.0.0-alpha.61_x54wk6dsnsxe7g7vvfmytp77te
'@saleor/app-sdk': 0.33.0_3vryta7zmbcsw4rrqf4axjqggm '@saleor/app-sdk': 0.34.0_3vryta7zmbcsw4rrqf4axjqggm
'@saleor/apps-shared': link:../../packages/shared '@saleor/apps-shared': link:../../packages/shared
'@saleor/macaw-ui': 0.7.2_pmlnlm755hlzzzocw2qhf3a34e '@saleor/macaw-ui': 0.7.2_pmlnlm755hlzzzocw2qhf3a34e
'@sentry/nextjs': 7.36.0_next@13.1.6+react@18.2.0 '@sentry/nextjs': 7.36.0_next@13.1.6+react@18.2.0
@ -227,7 +227,7 @@ importers:
'@material-ui/core': ^4.12.4 '@material-ui/core': ^4.12.4
'@material-ui/icons': ^4.11.3 '@material-ui/icons': ^4.11.3
'@material-ui/lab': 4.0.0-alpha.61 '@material-ui/lab': 4.0.0-alpha.61
'@saleor/app-sdk': 0.29.0 '@saleor/app-sdk': 0.34.0
'@saleor/apps-shared': workspace:* '@saleor/apps-shared': workspace:*
'@saleor/macaw-ui': ^0.7.2 '@saleor/macaw-ui': ^0.7.2
'@sentry/nextjs': ^7.36.0 '@sentry/nextjs': ^7.36.0
@ -257,7 +257,7 @@ importers:
'@material-ui/core': 4.12.4_twyhzqqpkwvvgrmyeapdo6i4my '@material-ui/core': 4.12.4_twyhzqqpkwvvgrmyeapdo6i4my
'@material-ui/icons': 4.11.3_xfab57qepcdrxdxif4xlv2kdgm '@material-ui/icons': 4.11.3_xfab57qepcdrxdxif4xlv2kdgm
'@material-ui/lab': 4.0.0-alpha.61_xfab57qepcdrxdxif4xlv2kdgm '@material-ui/lab': 4.0.0-alpha.61_xfab57qepcdrxdxif4xlv2kdgm
'@saleor/app-sdk': 0.29.0_3vryta7zmbcsw4rrqf4axjqggm '@saleor/app-sdk': 0.34.0_3vryta7zmbcsw4rrqf4axjqggm
'@saleor/apps-shared': link:../../packages/shared '@saleor/apps-shared': link:../../packages/shared
'@saleor/macaw-ui': 0.7.2_5j6zkq4mzir5org5dcu2pr43hm '@saleor/macaw-ui': 0.7.2_5j6zkq4mzir5org5dcu2pr43hm
'@sentry/nextjs': 7.36.0_next@13.1.6+react@18.2.0 '@sentry/nextjs': 7.36.0_next@13.1.6+react@18.2.0
@ -306,7 +306,7 @@ importers:
'@material-ui/core': ^4.12.4 '@material-ui/core': ^4.12.4
'@material-ui/icons': ^4.11.3 '@material-ui/icons': ^4.11.3
'@material-ui/lab': 4.0.0-alpha.61 '@material-ui/lab': 4.0.0-alpha.61
'@saleor/app-sdk': 0.27.1 '@saleor/app-sdk': 0.34.0
'@saleor/apps-shared': workspace:* '@saleor/apps-shared': workspace:*
'@saleor/macaw-ui': ^0.7.2 '@saleor/macaw-ui': ^0.7.2
'@testing-library/react': ^13.4.0 '@testing-library/react': ^13.4.0
@ -337,7 +337,7 @@ importers:
'@material-ui/core': 4.12.4_5ndqzdd6t4rivxsukjv3i3ak2q '@material-ui/core': 4.12.4_5ndqzdd6t4rivxsukjv3i3ak2q
'@material-ui/icons': 4.11.3_x54wk6dsnsxe7g7vvfmytp77te '@material-ui/icons': 4.11.3_x54wk6dsnsxe7g7vvfmytp77te
'@material-ui/lab': 4.0.0-alpha.61_x54wk6dsnsxe7g7vvfmytp77te '@material-ui/lab': 4.0.0-alpha.61_x54wk6dsnsxe7g7vvfmytp77te
'@saleor/app-sdk': 0.27.1_7jnwqgtpcnwg4nzft4b6xlzlfi '@saleor/app-sdk': 0.34.0_7jnwqgtpcnwg4nzft4b6xlzlfi
'@saleor/apps-shared': link:../../packages/shared '@saleor/apps-shared': link:../../packages/shared
'@saleor/macaw-ui': 0.7.2_pmlnlm755hlzzzocw2qhf3a34e '@saleor/macaw-ui': 0.7.2_pmlnlm755hlzzzocw2qhf3a34e
'@urql/exchange-auth': 1.0.0_graphql@16.6.0 '@urql/exchange-auth': 1.0.0_graphql@16.6.0
@ -387,7 +387,7 @@ importers:
'@material-ui/core': ^4.12.4 '@material-ui/core': ^4.12.4
'@material-ui/icons': ^4.11.3 '@material-ui/icons': ^4.11.3
'@material-ui/lab': 4.0.0-alpha.61 '@material-ui/lab': 4.0.0-alpha.61
'@saleor/app-sdk': 0.29.0 '@saleor/app-sdk': 0.34.0
'@saleor/apps-shared': workspace:* '@saleor/apps-shared': workspace:*
'@saleor/macaw-ui': ^0.7.2 '@saleor/macaw-ui': ^0.7.2
'@tanstack/react-query': ^4.24.2 '@tanstack/react-query': ^4.24.2
@ -430,7 +430,7 @@ importers:
'@material-ui/core': 4.12.4_5ndqzdd6t4rivxsukjv3i3ak2q '@material-ui/core': 4.12.4_5ndqzdd6t4rivxsukjv3i3ak2q
'@material-ui/icons': 4.11.3_x54wk6dsnsxe7g7vvfmytp77te '@material-ui/icons': 4.11.3_x54wk6dsnsxe7g7vvfmytp77te
'@material-ui/lab': 4.0.0-alpha.61_x54wk6dsnsxe7g7vvfmytp77te '@material-ui/lab': 4.0.0-alpha.61_x54wk6dsnsxe7g7vvfmytp77te
'@saleor/app-sdk': 0.29.0_7jnwqgtpcnwg4nzft4b6xlzlfi '@saleor/app-sdk': 0.34.0_7jnwqgtpcnwg4nzft4b6xlzlfi
'@saleor/apps-shared': link:../../packages/shared '@saleor/apps-shared': link:../../packages/shared
'@saleor/macaw-ui': 0.7.2_pmlnlm755hlzzzocw2qhf3a34e '@saleor/macaw-ui': 0.7.2_pmlnlm755hlzzzocw2qhf3a34e
'@tanstack/react-query': 4.24.4_biqbaboplfbrettd7655fr4n2y '@tanstack/react-query': 4.24.4_biqbaboplfbrettd7655fr4n2y
@ -492,7 +492,7 @@ importers:
'@material-ui/core': ^4.12.4 '@material-ui/core': ^4.12.4
'@material-ui/icons': ^4.11.3 '@material-ui/icons': ^4.11.3
'@material-ui/lab': 4.0.0-alpha.61 '@material-ui/lab': 4.0.0-alpha.61
'@saleor/app-sdk': 0.29.0 '@saleor/app-sdk': 0.34.0
'@saleor/apps-shared': workspace:* '@saleor/apps-shared': workspace:*
'@saleor/macaw-ui': 0.7.2 '@saleor/macaw-ui': 0.7.2
'@sentry/nextjs': ^7.31.1 '@sentry/nextjs': ^7.31.1
@ -526,7 +526,7 @@ importers:
'@material-ui/core': 4.12.4_5ndqzdd6t4rivxsukjv3i3ak2q '@material-ui/core': 4.12.4_5ndqzdd6t4rivxsukjv3i3ak2q
'@material-ui/icons': 4.11.3_x54wk6dsnsxe7g7vvfmytp77te '@material-ui/icons': 4.11.3_x54wk6dsnsxe7g7vvfmytp77te
'@material-ui/lab': 4.0.0-alpha.61_x54wk6dsnsxe7g7vvfmytp77te '@material-ui/lab': 4.0.0-alpha.61_x54wk6dsnsxe7g7vvfmytp77te
'@saleor/app-sdk': 0.29.0_3vryta7zmbcsw4rrqf4axjqggm '@saleor/app-sdk': 0.34.0_3vryta7zmbcsw4rrqf4axjqggm
'@saleor/apps-shared': link:../../packages/shared '@saleor/apps-shared': link:../../packages/shared
'@saleor/macaw-ui': 0.7.2_2dwar4pp5qoelfawvjffoi6dne '@saleor/macaw-ui': 0.7.2_2dwar4pp5qoelfawvjffoi6dne
'@sentry/nextjs': 7.36.0_next@13.1.6+react@18.2.0 '@sentry/nextjs': 7.36.0_next@13.1.6+react@18.2.0
@ -579,7 +579,7 @@ importers:
'@material-ui/core': ^4.12.4 '@material-ui/core': ^4.12.4
'@material-ui/icons': ^4.11.3 '@material-ui/icons': ^4.11.3
'@material-ui/lab': 4.0.0-alpha.61 '@material-ui/lab': 4.0.0-alpha.61
'@saleor/app-sdk': 0.29.0 '@saleor/app-sdk': 0.34.0
'@saleor/apps-shared': workspace:* '@saleor/apps-shared': workspace:*
'@saleor/macaw-ui': ^0.7.2 '@saleor/macaw-ui': ^0.7.2
'@sentry/nextjs': ^7.30.0 '@sentry/nextjs': ^7.30.0
@ -609,7 +609,7 @@ importers:
'@material-ui/core': 4.12.4_5ndqzdd6t4rivxsukjv3i3ak2q '@material-ui/core': 4.12.4_5ndqzdd6t4rivxsukjv3i3ak2q
'@material-ui/icons': 4.11.3_x54wk6dsnsxe7g7vvfmytp77te '@material-ui/icons': 4.11.3_x54wk6dsnsxe7g7vvfmytp77te
'@material-ui/lab': 4.0.0-alpha.61_x54wk6dsnsxe7g7vvfmytp77te '@material-ui/lab': 4.0.0-alpha.61_x54wk6dsnsxe7g7vvfmytp77te
'@saleor/app-sdk': 0.29.0_s75y6mxmikaw2mhqmuko6w7njm '@saleor/app-sdk': 0.34.0_s75y6mxmikaw2mhqmuko6w7njm
'@saleor/apps-shared': link:../../packages/shared '@saleor/apps-shared': link:../../packages/shared
'@saleor/macaw-ui': 0.7.2_2dwar4pp5qoelfawvjffoi6dne '@saleor/macaw-ui': 0.7.2_2dwar4pp5qoelfawvjffoi6dne
'@sentry/nextjs': 7.36.0_next@13.1.0+react@18.2.0 '@sentry/nextjs': 7.36.0_next@13.1.0+react@18.2.0
@ -4226,29 +4226,8 @@ packages:
- supports-color - supports-color
dev: true dev: true
/@saleor/app-sdk/0.27.1_7jnwqgtpcnwg4nzft4b6xlzlfi: /@saleor/app-sdk/0.34.0_3vryta7zmbcsw4rrqf4axjqggm:
resolution: {integrity: sha512-ZNbucokKCdBE1qa+YLHvjBVazYcRuUExBdaPW9aNxfeYyXgQNCdHqJx9oA/S1lMEVSbZSIRcn8Sx1+X/eEV8BA==} resolution: {integrity: sha512-szcXE7OJ3lmu1DN9X8aHQ6dlBSf9ySWhpd49UnOJdAAh42MlxPJDgbbBtw8rNA42hfU75WMyp73wQ6xxbp/TZg==}
peerDependencies:
next: '>=12'
react: '>=17'
react-dom: '>=17'
dependencies:
debug: 4.3.4
fast-glob: 3.2.12
graphql: 16.6.0
jose: 4.11.4
next: 13.1.2_biqbaboplfbrettd7655fr4n2y
raw-body: 2.5.1
react: 18.2.0
react-dom: 18.2.0_react@18.2.0
retes: 0.33.0
uuid: 8.3.2
transitivePeerDependencies:
- supports-color
dev: false
/@saleor/app-sdk/0.29.0_3vryta7zmbcsw4rrqf4axjqggm:
resolution: {integrity: sha512-GWVLv1E8JPP8ieq9PQz5vfR5ZZ1Bo8RAkc5WaMHP/XxbPH7R8WwIGZJEkYD/kaLus3xk3DZKmA7tpzXtHRPwgw==}
peerDependencies: peerDependencies:
next: '>=12' next: '>=12'
react: '>=17' react: '>=17'
@ -4269,8 +4248,8 @@ packages:
- supports-color - supports-color
dev: false dev: false
/@saleor/app-sdk/0.29.0_7jnwqgtpcnwg4nzft4b6xlzlfi: /@saleor/app-sdk/0.34.0_7jnwqgtpcnwg4nzft4b6xlzlfi:
resolution: {integrity: sha512-GWVLv1E8JPP8ieq9PQz5vfR5ZZ1Bo8RAkc5WaMHP/XxbPH7R8WwIGZJEkYD/kaLus3xk3DZKmA7tpzXtHRPwgw==} resolution: {integrity: sha512-szcXE7OJ3lmu1DN9X8aHQ6dlBSf9ySWhpd49UnOJdAAh42MlxPJDgbbBtw8rNA42hfU75WMyp73wQ6xxbp/TZg==}
peerDependencies: peerDependencies:
next: '>=12' next: '>=12'
react: '>=17' react: '>=17'
@ -4291,8 +4270,8 @@ packages:
- supports-color - supports-color
dev: false dev: false
/@saleor/app-sdk/0.29.0_s75y6mxmikaw2mhqmuko6w7njm: /@saleor/app-sdk/0.34.0_s75y6mxmikaw2mhqmuko6w7njm:
resolution: {integrity: sha512-GWVLv1E8JPP8ieq9PQz5vfR5ZZ1Bo8RAkc5WaMHP/XxbPH7R8WwIGZJEkYD/kaLus3xk3DZKmA7tpzXtHRPwgw==} resolution: {integrity: sha512-szcXE7OJ3lmu1DN9X8aHQ6dlBSf9ySWhpd49UnOJdAAh42MlxPJDgbbBtw8rNA42hfU75WMyp73wQ6xxbp/TZg==}
peerDependencies: peerDependencies:
next: '>=12' next: '>=12'
react: '>=17' react: '>=17'
@ -4313,28 +4292,6 @@ packages:
- supports-color - supports-color
dev: false dev: false
/@saleor/app-sdk/0.33.0_3vryta7zmbcsw4rrqf4axjqggm:
resolution: {integrity: sha512-JEeUTBIa2aRuIBEeV1U/C76Oy4hfdMnXo16XB+PH/wQUPSBIsKkfpAB82JmAQiLzHHvTh5V9QZynPqt8EZbCFw==}
peerDependencies:
next: '>=12'
react: '>=17'
react-dom: '>=17'
dependencies:
'@changesets/cli': 2.26.0
debug: 4.3.4
fast-glob: 3.2.12
graphql: 16.6.0
jose: 4.11.4
next: 13.1.6_biqbaboplfbrettd7655fr4n2y
raw-body: 2.5.1
react: 18.2.0
react-dom: 18.2.0_react@18.2.0
retes: 0.33.0
uuid: 8.3.2
transitivePeerDependencies:
- supports-color
dev: false
/@saleor/app-sdk/0.34.1_nvzgbose6yf6w7ijjprgspqefi: /@saleor/app-sdk/0.34.1_nvzgbose6yf6w7ijjprgspqefi:
resolution: {integrity: sha512-z5oheqsJziYgsCHg2Q3x1EaiIBaWh7Y1DcAg/wGwxaI/1CLS2i4jKoTjTTvO0MzGNdZQdQRkQIQ8LQBwqQRlzQ==} resolution: {integrity: sha512-z5oheqsJziYgsCHg2Q3x1EaiIBaWh7Y1DcAg/wGwxaI/1CLS2i4jKoTjTTvO0MzGNdZQdQRkQIQ8LQBwqQRlzQ==}
peerDependencies: peerDependencies: