Update webhooks (#982)

* Update webhooks

* Update snapshots

* Add messages

Co-authored-by: Marcin Gębala <5421321+maarcingebala@users.noreply.github.com>
This commit is contained in:
Piotr Grundas 2021-02-18 14:50:57 +01:00 committed by GitHub
parent afa228fd6d
commit 35857cf717
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 1565 additions and 333 deletions

View file

@ -20,6 +20,7 @@ All notable, unreleased changes to this project will be documented in this file.
- Add error tracking with Sentry adapter - #956 by @jwm0
- Add OAuth2 login with OpenID support - #963 by @orzechdev
- Fix no channels crash - #984 by @dominik-zeglen
- Update webhooks - #982 by @piotrgrundas
# 2.11.1

View file

@ -6767,6 +6767,10 @@
"context": "event",
"string": "All events"
},
"src_dot_webhooks_dot_components_dot_WebhookEvents_dot_2745028894": {
"context": "event",
"string": "Page deleted"
},
"src_dot_webhooks_dot_components_dot_WebhookEvents_dot_2862596150": {
"context": "event",
"string": "Invoice sent"
@ -6795,6 +6799,14 @@
"context": "event",
"string": "Order cancelled"
},
"src_dot_webhooks_dot_components_dot_WebhookEvents_dot_3618648517": {
"context": "event",
"string": "Page updated"
},
"src_dot_webhooks_dot_components_dot_WebhookEvents_dot_3671033983": {
"context": "event",
"string": "Product deleted"
},
"src_dot_webhooks_dot_components_dot_WebhookEvents_dot_3907151399": {
"context": "event",
"string": "Order fulfilled"
@ -6803,10 +6815,6 @@
"context": "event",
"string": "Customer created"
},
"src_dot_webhooks_dot_components_dot_WebhookEvents_dot_40035964": {
"context": "event",
"string": "Changed quantity in checkout"
},
"src_dot_webhooks_dot_components_dot_WebhookEvents_dot_4186057882": {
"context": "event",
"string": "Invoice requested"
@ -6815,6 +6823,14 @@
"context": "event",
"string": "Fulfillment created"
},
"src_dot_webhooks_dot_components_dot_WebhookEvents_dot_679080833": {
"context": "event",
"string": "Page created"
},
"src_dot_webhooks_dot_components_dot_WebhookEvents_dot_787792649": {
"context": "event",
"string": "Customer updated"
},
"src_dot_webhooks_dot_components_dot_WebhookInfo_dot_1690209105": {
"context": "webhook",
"string": "Target URL"

View file

@ -677,7 +677,7 @@ type Category implements Node & ObjectWithMetadata {
level: Int!
privateMetadata: [MetadataItem]!
metadata: [MetadataItem]!
descriptionJson: String @deprecated(reason: "Will be removed in Saleor 4.0. Use the `description` field instead.")
descriptionJson: JSONString @deprecated(reason: "Will be removed in Saleor 4.0. Use the `description` field instead.")
ancestors(before: String, after: String, first: Int, last: Int): CategoryCountableConnection
products(channel: String, before: String, after: String, first: Int, last: Int): ProductCountableConnection
url: String @deprecated(reason: "This field will be removed after 2020-07-31.")
@ -747,7 +747,7 @@ type CategoryTranslatableContent implements Node {
id: ID!
name: String!
description: JSONString!
descriptionJson: String @deprecated(reason: "Will be removed in Saleor 4.0. Use the `description` field instead.")
descriptionJson: JSONString @deprecated(reason: "Will be removed in Saleor 4.0. Use the `description` field instead.")
translation(languageCode: LanguageCodeEnum!): CategoryTranslation
category: Category
}
@ -765,7 +765,7 @@ type CategoryTranslation implements Node {
name: String!
description: JSONString!
language: LanguageDisplay!
descriptionJson: String @deprecated(reason: "Will be removed in Saleor 4.0. Use the `description` field instead.")
descriptionJson: JSONString @deprecated(reason: "Will be removed in Saleor 4.0. Use the `description` field instead.")
}
type CategoryUpdate {
@ -1054,7 +1054,7 @@ type Collection implements Node & ObjectWithMetadata {
slug: String!
privateMetadata: [MetadataItem]!
metadata: [MetadataItem]!
descriptionJson: String @deprecated(reason: "Will be removed in Saleor 4.0. Use the `description` field instead.")
descriptionJson: JSONString @deprecated(reason: "Will be removed in Saleor 4.0. Use the `description` field instead.")
products(filter: ProductFilterInput, sortBy: ProductOrder, before: String, after: String, first: Int, last: Int): ProductCountableConnection
backgroundImage(size: Int): Image
translation(languageCode: LanguageCodeEnum!): CollectionTranslation
@ -1206,7 +1206,7 @@ type CollectionTranslatableContent implements Node {
id: ID!
name: String!
description: JSONString!
descriptionJson: String @deprecated(reason: "Will be removed in Saleor 4.0. Use the `description` field instead.")
descriptionJson: JSONString @deprecated(reason: "Will be removed in Saleor 4.0. Use the `description` field instead.")
translation(languageCode: LanguageCodeEnum!): CollectionTranslation
collection: Collection
}
@ -1224,7 +1224,7 @@ type CollectionTranslation implements Node {
name: String!
description: JSONString!
language: LanguageDisplay!
descriptionJson: String @deprecated(reason: "Will be removed in Saleor 4.0. Use the `description` field instead.")
descriptionJson: JSONString @deprecated(reason: "Will be removed in Saleor 4.0. Use the `description` field instead.")
}
type CollectionUpdate {
@ -2076,10 +2076,6 @@ type GatewayConfigLine {
scalar GenericScalar
type Geolocalization {
country: CountryDisplay
}
type GiftCard implements Node {
code: String
user: User
@ -3319,7 +3315,7 @@ type Page implements Node & ObjectWithMetadata {
created: DateTime!
privateMetadata: [MetadataItem]!
metadata: [MetadataItem]!
contentJson: String! @deprecated(reason: "Will be removed in Saleor 4.0. Use the `content` field instead.")
contentJson: JSONString! @deprecated(reason: "Will be removed in Saleor 4.0. Use the `content` field instead.")
translation(languageCode: LanguageCodeEnum!): PageTranslation
attributes: [SelectedAttribute!]!
}
@ -3446,7 +3442,7 @@ type PageTranslatableContent implements Node {
id: ID!
title: String!
content: JSONString!
contentJson: String @deprecated(reason: "Will be removed in Saleor 4.0. Use the `content` field instead.")
contentJson: JSONString @deprecated(reason: "Will be removed in Saleor 4.0. Use the `content` field instead.")
translation(languageCode: LanguageCodeEnum!): PageTranslation
page: Page
}
@ -3464,7 +3460,7 @@ type PageTranslation implements Node {
title: String!
content: JSONString!
language: LanguageDisplay!
contentJson: String @deprecated(reason: "Will be removed in Saleor 4.0. Use the `content` field instead.")
contentJson: JSONString @deprecated(reason: "Will be removed in Saleor 4.0. Use the `content` field instead.")
}
input PageTranslationInput {
@ -3657,7 +3653,6 @@ input PaymentInput {
gateway: String!
token: String
amount: PositiveDecimal
billingAddress: AddressInput
returnUrl: String
}
@ -3850,11 +3845,11 @@ type Product implements Node & ObjectWithMetadata {
rating: Float
privateMetadata: [MetadataItem]!
metadata: [MetadataItem]!
descriptionJson: String @deprecated(reason: "Will be removed in Saleor 4.0. Use the `description` field instead.")
descriptionJson: JSONString @deprecated(reason: "Will be removed in Saleor 4.0. Use the `description` field instead.")
url: String! @deprecated(reason: "This field will be removed after 2020-07-31.")
thumbnail(size: Int): Image
pricing: ProductPricingInfo
isAvailable: Boolean
pricing(address: AddressInput): ProductPricingInfo
isAvailable(address: AddressInput): Boolean
taxType: TaxType
attributes: [SelectedAttribute!]!
channelListings: [ProductChannelListing!]
@ -3906,7 +3901,7 @@ type ProductChannelListing implements Node {
purchaseCost: MoneyRange
margin: Margin
isAvailableForPurchase: Boolean
pricing: ProductPricingInfo
pricing(address: AddressInput): ProductPricingInfo
}
input ProductChannelListingAddInput {
@ -4109,6 +4104,7 @@ input ProductOrder {
enum ProductOrderField {
NAME
RANK
PRICE
MINIMAL_PRICE
DATE
@ -4145,7 +4141,7 @@ type ProductTranslatableContent implements Node {
seoDescription: String
name: String!
description: JSONString!
descriptionJson: String @deprecated(reason: "Will be removed in Saleor 4.0. Use the `description` field instead.")
descriptionJson: JSONString @deprecated(reason: "Will be removed in Saleor 4.0. Use the `description` field instead.")
translation(languageCode: LanguageCodeEnum!): ProductTranslation
product: Product
}
@ -4163,7 +4159,7 @@ type ProductTranslation implements Node {
name: String!
description: JSONString!
language: LanguageDisplay!
descriptionJson: String @deprecated(reason: "Will be removed in Saleor 4.0. Use the `description` field instead.")
descriptionJson: JSONString @deprecated(reason: "Will be removed in Saleor 4.0. Use the `description` field instead.")
}
type ProductType implements Node & ObjectWithMetadata {
@ -4177,7 +4173,6 @@ type ProductType implements Node & ObjectWithMetadata {
privateMetadata: [MetadataItem]!
metadata: [MetadataItem]!
products(channel: String, before: String, after: String, first: Int, last: Int): ProductCountableConnection @deprecated(reason: "Use the top-level `products` query with the `productTypes` filter.")
taxRate: TaxRateType
taxType: TaxType
variantAttributes(variantSelection: VariantAttributeScope): [Attribute]
productAttributes: [Attribute]
@ -4281,7 +4276,7 @@ type ProductVariant implements Node & ObjectWithMetadata {
privateMetadata: [MetadataItem]!
metadata: [MetadataItem]!
channelListings: [ProductVariantChannelListing!]
pricing: VariantPricingInfo
pricing(address: AddressInput): VariantPricingInfo
attributes(variantSelection: VariantAttributeScope): [SelectedAttribute!]!
costPrice: Money
margin: Int
@ -4290,8 +4285,8 @@ type ProductVariant implements Node & ObjectWithMetadata {
images: [ProductImage]
translation(languageCode: LanguageCodeEnum!): ProductVariantTranslation
digitalContent: DigitalContent
stocks(countryCode: CountryCode): [Stock]
quantityAvailable(countryCode: CountryCode): Int!
stocks(address: AddressInput, countryCode: CountryCode): [Stock]
quantityAvailable(address: AddressInput, countryCode: CountryCode): Int!
}
type ProductVariantBulkCreate {
@ -4956,7 +4951,6 @@ type Shop {
availablePaymentGateways(currency: String): [PaymentGateway!]!
availableExternalAuthentications: [ExternalAuthentication!]!
availableShippingMethods(channel: String!, address: AddressInput): [ShippingMethod]
geolocalization: Geolocalization
countries(languageCode: LanguageCodeEnum): [CountryDisplay!]!
defaultCountry: CountryDisplay
defaultMailSenderName: String
@ -5833,12 +5827,16 @@ enum WebhookEventTypeEnum {
INVOICE_DELETED
INVOICE_SENT
CUSTOMER_CREATED
CUSTOMER_UPDATED
PRODUCT_CREATED
PRODUCT_UPDATED
CHECKOUT_QUANTITY_CHANGED
PRODUCT_DELETED
CHECKOUT_CREATED
CHECKOUT_UPDATED
FULFILLMENT_CREATED
PAGE_CREATED
PAGE_UPDATED
PAGE_DELETED
}
enum WebhookSampleEventTypeEnum {
@ -5852,12 +5850,16 @@ enum WebhookSampleEventTypeEnum {
INVOICE_DELETED
INVOICE_SENT
CUSTOMER_CREATED
CUSTOMER_UPDATED
PRODUCT_CREATED
PRODUCT_UPDATED
CHECKOUT_QUANTITY_CHANGED
PRODUCT_DELETED
CHECKOUT_CREATED
CHECKOUT_UPDATED
FULFILLMENT_CREATED
PAGE_CREATED
PAGE_UPDATED
PAGE_DELETED
}
type WebhookUpdate {

File diff suppressed because it is too large Load diff

View file

@ -804,6 +804,7 @@ export enum ProductOrderField {
PRICE = "PRICE",
PUBLICATION_DATE = "PUBLICATION_DATE",
PUBLISHED = "PUBLISHED",
RANK = "RANK",
RATING = "RATING",
TYPE = "TYPE",
}
@ -967,9 +968,9 @@ export enum WebhookErrorCode {
export enum WebhookEventTypeEnum {
ANY_EVENTS = "ANY_EVENTS",
CHECKOUT_CREATED = "CHECKOUT_CREATED",
CHECKOUT_QUANTITY_CHANGED = "CHECKOUT_QUANTITY_CHANGED",
CHECKOUT_UPDATED = "CHECKOUT_UPDATED",
CUSTOMER_CREATED = "CUSTOMER_CREATED",
CUSTOMER_UPDATED = "CUSTOMER_UPDATED",
FULFILLMENT_CREATED = "FULFILLMENT_CREATED",
INVOICE_DELETED = "INVOICE_DELETED",
INVOICE_REQUESTED = "INVOICE_REQUESTED",
@ -980,7 +981,11 @@ export enum WebhookEventTypeEnum {
ORDER_FULFILLED = "ORDER_FULFILLED",
ORDER_FULLY_PAID = "ORDER_FULLY_PAID",
ORDER_UPDATED = "ORDER_UPDATED",
PAGE_CREATED = "PAGE_CREATED",
PAGE_DELETED = "PAGE_DELETED",
PAGE_UPDATED = "PAGE_UPDATED",
PRODUCT_CREATED = "PRODUCT_CREATED",
PRODUCT_DELETED = "PRODUCT_DELETED",
PRODUCT_UPDATED = "PRODUCT_UPDATED",
}

View file

@ -44,6 +44,10 @@ const WebhookEvents: React.FC<WebhookEventsProps> = ({
defaultMessage: "Customer created",
description: "event"
}),
[WebhookEventTypeEnum.CUSTOMER_UPDATED]: intl.formatMessage({
defaultMessage: "Customer updated",
description: "event"
}),
[WebhookEventTypeEnum.CHECKOUT_CREATED]: intl.formatMessage({
defaultMessage: "Checkout created",
description: "event"
@ -84,8 +88,8 @@ const WebhookEvents: React.FC<WebhookEventsProps> = ({
defaultMessage: "Product updated",
description: "event"
}),
[WebhookEventTypeEnum.CHECKOUT_QUANTITY_CHANGED]: intl.formatMessage({
defaultMessage: "Changed quantity in checkout",
[WebhookEventTypeEnum.PRODUCT_DELETED]: intl.formatMessage({
defaultMessage: "Product deleted",
description: "event"
}),
[WebhookEventTypeEnum.FULFILLMENT_CREATED]: intl.formatMessage({
@ -103,6 +107,18 @@ const WebhookEvents: React.FC<WebhookEventsProps> = ({
[WebhookEventTypeEnum.INVOICE_DELETED]: intl.formatMessage({
defaultMessage: "Invoice deleted",
description: "event"
}),
[WebhookEventTypeEnum.PAGE_CREATED]: intl.formatMessage({
defaultMessage: "Page created",
description: "event"
}),
[WebhookEventTypeEnum.PAGE_UPDATED]: intl.formatMessage({
defaultMessage: "Page updated",
description: "event"
}),
[WebhookEventTypeEnum.PAGE_DELETED]: intl.formatMessage({
defaultMessage: "Page deleted",
description: "event"
})
};