diff --git a/introspection.json b/introspection.json index 07a5bc03c..e5d38dd30 100644 --- a/introspection.json +++ b/introspection.json @@ -4659,6 +4659,105 @@ "enumValues": null, "possibleTypes": null }, + { + "kind": "OBJECT", + "name": "AppManifestWebhook", + "description": null, + "fields": [ + { + "name": "name", + "description": "The name of the webhook.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "asyncEvents", + "description": "The asynchronous events that webhook wants to subscribe.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "WebhookEventTypeAsyncEnum", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "syncEvents", + "description": "The synchronous events that webhook wants to subscribe.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "WebhookEventTypeSyncEnum", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "query", + "description": "Subscription query of a webhook", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "targetUrl", + "description": "The url to receive the payload.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, { "kind": "OBJECT", "name": "AppRetryInstall", @@ -24823,6 +24922,11 @@ "name": "SaleDeleted", "ofType": null }, + { + "kind": "OBJECT", + "name": "SaleToggle", + "ofType": null + }, { "kind": "OBJECT", "name": "SaleUpdated", @@ -38497,6 +38601,30 @@ }, "isDeprecated": false, "deprecationReason": null + }, + { + "name": "webhooks", + "description": "List of the app's webhooks.\n\nAdded in Saleor 3.5.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "AppManifestWebhook", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null } ], "inputFields": null, @@ -84182,6 +84310,96 @@ "enumValues": null, "possibleTypes": null }, + { + "kind": "OBJECT", + "name": "SaleToggle", + "description": "The event informs about the start or end of the sale.\n\nAdded in Saleor 3.5.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", + "fields": [ + { + "name": "issuedAt", + "description": "Time of the event.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "version", + "description": "Saleor version that triggered the event.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "issuingPrincipal", + "description": "The user or application that triggered the event.", + "args": [], + "type": { + "kind": "UNION", + "name": "IssuingPrincipal", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "recipient", + "description": "The application receiving the webhook.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "App", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "sale", + "description": "The sale the event relates to.\n\nAdded in Saleor 3.5.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", + "args": [ + { + "name": "channel", + "description": "Slug of a channel for which the data should be returned.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Sale", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Event", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, { "kind": "OBJECT", "name": "SaleTranslatableContent", @@ -101850,6 +102068,12 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "SALE_TOGGLE", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "INVOICE_REQUESTED", "description": "An invoice for order requested.", @@ -102401,6 +102625,12 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "SALE_TOGGLE", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "INVOICE_REQUESTED", "description": "An invoice for order requested.", @@ -103077,6 +103307,12 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "SALE_TOGGLE", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "INVOICE_REQUESTED", "description": null, diff --git a/package-lock.json b/package-lock.json index 27f0ff93d..b067e8e0a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27216,7 +27216,7 @@ "request-progress": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/request-progress/-/request-progress-3.0.0.tgz", - "integrity": "sha1-TKdUCBx/7GP1BeT6qCWqBs1mnb4=", + "integrity": "sha512-MnWzEHHaxHO2iWiQuHrUPBi/1WeBf5PkxQqNyNvLl9VAYSdXkP8tQ3pBSeCPD+yw0v0Aq1zosWLz0BdeXpWwZg==", "dev": true, "requires": { "throttleit": "^1.0.0" diff --git a/schema.graphql b/schema.graphql index e36633610..96eefa94e 100644 --- a/schema.graphql +++ b/schema.graphql @@ -840,6 +840,23 @@ type AppManifestExtension { target: AppExtensionTargetEnum! } +type AppManifestWebhook { + """The name of the webhook.""" + name: String! + + """The asynchronous events that webhook wants to subscribe.""" + asyncEvents: [WebhookEventTypeAsyncEnum!] + + """The synchronous events that webhook wants to subscribe.""" + syncEvents: [WebhookEventTypeSyncEnum!] + + """Subscription query of a webhook""" + query: String! + + """The url to receive the payload.""" + targetUrl: String! +} + """ Retry failed installation of new app. @@ -7686,6 +7703,15 @@ type Manifest { homepageUrl: String supportUrl: String extensions: [AppManifestExtension!]! + + """ + List of the app's webhooks. + + Added in Saleor 3.5. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + webhooks: [AppManifestWebhook!]! } type Margin { @@ -18666,6 +18692,39 @@ input SaleSortingInput { field: SaleSortField! } +""" +The event informs about the start or end of the sale. + +Added in Saleor 3.5. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. +""" +type SaleToggle implements Event { + """Time of the event.""" + issuedAt: DateTime + + """Saleor version that triggered the event.""" + version: String + + """The user or application that triggered the event.""" + issuingPrincipal: IssuingPrincipal + + """The application receiving the webhook.""" + recipient: App + + """ + The sale the event relates to. + + Added in Saleor 3.5. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + sale( + """Slug of a channel for which the data should be returned.""" + channel: String + ): Sale +} + type SaleTranslatableContent implements Node { id: ID! name: String! @@ -22537,6 +22596,7 @@ enum WebhookEventTypeAsyncEnum { SALE_CREATED SALE_UPDATED SALE_DELETED + SALE_TOGGLE """An invoice for order requested.""" INVOICE_REQUESTED @@ -22790,6 +22850,7 @@ enum WebhookEventTypeEnum { SALE_CREATED SALE_UPDATED SALE_DELETED + SALE_TOGGLE """An invoice for order requested.""" INVOICE_REQUESTED @@ -22989,6 +23050,7 @@ enum WebhookSampleEventTypeEnum { SALE_CREATED SALE_UPDATED SALE_DELETED + SALE_TOGGLE INVOICE_REQUESTED INVOICE_DELETED INVOICE_SENT diff --git a/src/graphql/fragmentTypes.generated.ts b/src/graphql/fragmentTypes.generated.ts index 7a96c3d5e..6117fc85a 100644 --- a/src/graphql/fragmentTypes.generated.ts +++ b/src/graphql/fragmentTypes.generated.ts @@ -79,6 +79,7 @@ "ProductVariantUpdated", "SaleCreated", "SaleDeleted", + "SaleToggle", "SaleUpdated", "ShippingPriceCreated", "ShippingPriceDeleted", diff --git a/src/graphql/typePolicies.generated.ts b/src/graphql/typePolicies.generated.ts index 8e6f5837e..ac4a2d065 100644 --- a/src/graphql/typePolicies.generated.ts +++ b/src/graphql/typePolicies.generated.ts @@ -297,6 +297,14 @@ export type AppManifestExtensionFieldPolicy = { mount?: FieldPolicy | FieldReadFunction, target?: FieldPolicy | FieldReadFunction }; +export type AppManifestWebhookKeySpecifier = ('name' | 'asyncEvents' | 'syncEvents' | 'query' | 'targetUrl' | AppManifestWebhookKeySpecifier)[]; +export type AppManifestWebhookFieldPolicy = { + name?: FieldPolicy | FieldReadFunction, + asyncEvents?: FieldPolicy | FieldReadFunction, + syncEvents?: FieldPolicy | FieldReadFunction, + query?: FieldPolicy | FieldReadFunction, + targetUrl?: FieldPolicy | FieldReadFunction +}; export type AppRetryInstallKeySpecifier = ('appErrors' | 'errors' | 'appInstallation' | AppRetryInstallKeySpecifier)[]; export type AppRetryInstallFieldPolicy = { appErrors?: FieldPolicy | FieldReadFunction, @@ -1988,7 +1996,7 @@ export type LimitsFieldPolicy = { staffUsers?: FieldPolicy | FieldReadFunction, warehouses?: FieldPolicy | FieldReadFunction }; -export type ManifestKeySpecifier = ('identifier' | 'version' | 'name' | 'about' | 'permissions' | 'appUrl' | 'configurationUrl' | 'tokenTargetUrl' | 'dataPrivacy' | 'dataPrivacyUrl' | 'homepageUrl' | 'supportUrl' | 'extensions' | ManifestKeySpecifier)[]; +export type ManifestKeySpecifier = ('identifier' | 'version' | 'name' | 'about' | 'permissions' | 'appUrl' | 'configurationUrl' | 'tokenTargetUrl' | 'dataPrivacy' | 'dataPrivacyUrl' | 'homepageUrl' | 'supportUrl' | 'extensions' | 'webhooks' | ManifestKeySpecifier)[]; export type ManifestFieldPolicy = { identifier?: FieldPolicy | FieldReadFunction, version?: FieldPolicy | FieldReadFunction, @@ -2002,7 +2010,8 @@ export type ManifestFieldPolicy = { dataPrivacyUrl?: FieldPolicy | FieldReadFunction, homepageUrl?: FieldPolicy | FieldReadFunction, supportUrl?: FieldPolicy | FieldReadFunction, - extensions?: FieldPolicy | FieldReadFunction + extensions?: FieldPolicy | FieldReadFunction, + webhooks?: FieldPolicy | FieldReadFunction }; export type MarginKeySpecifier = ('start' | 'stop' | MarginKeySpecifier)[]; export type MarginFieldPolicy = { @@ -4007,6 +4016,14 @@ export type SaleRemoveCataloguesFieldPolicy = { discountErrors?: FieldPolicy | FieldReadFunction, errors?: FieldPolicy | FieldReadFunction }; +export type SaleToggleKeySpecifier = ('issuedAt' | 'version' | 'issuingPrincipal' | 'recipient' | 'sale' | SaleToggleKeySpecifier)[]; +export type SaleToggleFieldPolicy = { + issuedAt?: FieldPolicy | FieldReadFunction, + version?: FieldPolicy | FieldReadFunction, + issuingPrincipal?: FieldPolicy | FieldReadFunction, + recipient?: FieldPolicy | FieldReadFunction, + sale?: FieldPolicy | FieldReadFunction +}; export type SaleTranslatableContentKeySpecifier = ('id' | 'name' | 'translation' | 'sale' | SaleTranslatableContentKeySpecifier)[]; export type SaleTranslatableContentFieldPolicy = { id?: FieldPolicy | FieldReadFunction, @@ -5189,6 +5206,10 @@ export type StrictTypedTypePolicies = { keyFields?: false | AppManifestExtensionKeySpecifier | (() => undefined | AppManifestExtensionKeySpecifier), fields?: AppManifestExtensionFieldPolicy, }, + AppManifestWebhook?: Omit & { + keyFields?: false | AppManifestWebhookKeySpecifier | (() => undefined | AppManifestWebhookKeySpecifier), + fields?: AppManifestWebhookFieldPolicy, + }, AppRetryInstall?: Omit & { keyFields?: false | AppRetryInstallKeySpecifier | (() => undefined | AppRetryInstallKeySpecifier), fields?: AppRetryInstallFieldPolicy, @@ -6937,6 +6958,10 @@ export type StrictTypedTypePolicies = { keyFields?: false | SaleRemoveCataloguesKeySpecifier | (() => undefined | SaleRemoveCataloguesKeySpecifier), fields?: SaleRemoveCataloguesFieldPolicy, }, + SaleToggle?: Omit & { + keyFields?: false | SaleToggleKeySpecifier | (() => undefined | SaleToggleKeySpecifier), + fields?: SaleToggleFieldPolicy, + }, SaleTranslatableContent?: Omit & { keyFields?: false | SaleTranslatableContentKeySpecifier | (() => undefined | SaleTranslatableContentKeySpecifier), fields?: SaleTranslatableContentFieldPolicy, diff --git a/src/graphql/types.generated.ts b/src/graphql/types.generated.ts index 7fa63618e..64978ea6a 100644 --- a/src/graphql/types.generated.ts +++ b/src/graphql/types.generated.ts @@ -5002,6 +5002,7 @@ export enum WebhookEventTypeAsyncEnum { SALE_CREATED = 'SALE_CREATED', SALE_UPDATED = 'SALE_UPDATED', SALE_DELETED = 'SALE_DELETED', + SALE_TOGGLE = 'SALE_TOGGLE', /** An invoice for order requested. */ INVOICE_REQUESTED = 'INVOICE_REQUESTED', /** An invoice is deleted. */ @@ -5173,6 +5174,7 @@ export enum WebhookEventTypeEnum { SALE_CREATED = 'SALE_CREATED', SALE_UPDATED = 'SALE_UPDATED', SALE_DELETED = 'SALE_DELETED', + SALE_TOGGLE = 'SALE_TOGGLE', /** An invoice for order requested. */ INVOICE_REQUESTED = 'INVOICE_REQUESTED', /** An invoice is deleted. */ @@ -5330,6 +5332,7 @@ export enum WebhookSampleEventTypeEnum { SALE_CREATED = 'SALE_CREATED', SALE_UPDATED = 'SALE_UPDATED', SALE_DELETED = 'SALE_DELETED', + SALE_TOGGLE = 'SALE_TOGGLE', INVOICE_REQUESTED = 'INVOICE_REQUESTED', INVOICE_DELETED = 'INVOICE_DELETED', INVOICE_SENT = 'INVOICE_SENT',