Skip to content

Commit

Permalink
[MS-754] feat: Add gql subscriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrgrundas committed Oct 3, 2024
1 parent b392f34 commit a517437
Show file tree
Hide file tree
Showing 11 changed files with 294 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
subscription AccountChangeEmailRequestedSubscription {
event {
... on AccountChangeEmailRequested {
user {
email
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
subscription AccountConfirmationRequestedSubscription {
event {
... on AccountConfirmationRequested {
user {
email
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
subscription AccountConfirmedSubscription {
event {
... on AccountConfirmed {
user {
email
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
subscription AccountDeleteRequestedSubscription {
event {
... on AccountDeleteRequested {
user {
email
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
subscription AccountDeletedSubscription {
event {
... on AccountDeleted {
user {
email
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
subscription FulfillmentTrackingNumberUpdated {
event {
... on FulfillmentTrackingNumberUpdated {
order {
userEmail
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
subscription GiftCardSentSubscription {
event {
... on GiftCardSent {
sentToEmail
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
subscription OrderCancelledSubscription {
event {
... on OrderCancelled {
order {
userEmail
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
subscription OrderRefundedSubscription {
event {
... on OrderCancelled {
order {
userEmail
}
}
}
}
203 changes: 203 additions & 0 deletions src/graphql/operations/subscriptions/generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,100 @@
import type * as Types from '../../schema';

import type { DocumentTypeDecoration } from '@graphql-typed-document-node/core';
export type AccountChangeEmailRequestedSubscription_event_AccountChangeEmailRequested_user_User = { email: string };

export type AccountChangeEmailRequestedSubscription_event_AccountChangeEmailRequested = { user: AccountChangeEmailRequestedSubscription_event_AccountChangeEmailRequested_user_User | null };

export type AccountChangeEmailRequestedSubscription_Subscription = { event: AccountChangeEmailRequestedSubscription_event_AccountChangeEmailRequested | null };


export type AccountChangeEmailRequestedSubscriptionVariables = Types.Exact<{ [key: string]: never; }>;


export type AccountChangeEmailRequestedSubscription = AccountChangeEmailRequestedSubscription_Subscription;

export type AccountConfirmationRequestedSubscription_event_AccountConfirmationRequested_user_User = { email: string };

export type AccountConfirmationRequestedSubscription_event_AccountConfirmationRequested = { user: AccountConfirmationRequestedSubscription_event_AccountConfirmationRequested_user_User | null };

export type AccountConfirmationRequestedSubscription_Subscription = { event: AccountConfirmationRequestedSubscription_event_AccountConfirmationRequested | null };


export type AccountConfirmationRequestedSubscriptionVariables = Types.Exact<{ [key: string]: never; }>;


export type AccountConfirmationRequestedSubscription = AccountConfirmationRequestedSubscription_Subscription;

export type AccountConfirmedSubscription_event_AccountConfirmed_user_User = { email: string };

export type AccountConfirmedSubscription_event_AccountConfirmed = { user: AccountConfirmedSubscription_event_AccountConfirmed_user_User | null };

export type AccountConfirmedSubscription_Subscription = { event: AccountConfirmedSubscription_event_AccountConfirmed | null };


export type AccountConfirmedSubscriptionVariables = Types.Exact<{ [key: string]: never; }>;


export type AccountConfirmedSubscription = AccountConfirmedSubscription_Subscription;

export type AccountDeleteRequestedSubscription_event_AccountDeleteRequested_user_User = { email: string };

export type AccountDeleteRequestedSubscription_event_AccountDeleteRequested = { user: AccountDeleteRequestedSubscription_event_AccountDeleteRequested_user_User | null };

export type AccountDeleteRequestedSubscription_Subscription = { event: AccountDeleteRequestedSubscription_event_AccountDeleteRequested | null };


export type AccountDeleteRequestedSubscriptionVariables = Types.Exact<{ [key: string]: never; }>;


export type AccountDeleteRequestedSubscription = AccountDeleteRequestedSubscription_Subscription;

export type AccountDeletedSubscription_event_AccountDeleted_user_User = { email: string };

export type AccountDeletedSubscription_event_AccountDeleted = { user: AccountDeletedSubscription_event_AccountDeleted_user_User | null };

export type AccountDeletedSubscription_Subscription = { event: AccountDeletedSubscription_event_AccountDeleted | null };


export type AccountDeletedSubscriptionVariables = Types.Exact<{ [key: string]: never; }>;


export type AccountDeletedSubscription = AccountDeletedSubscription_Subscription;

export type FulfillmentTrackingNumberUpdated_event_FulfillmentTrackingNumberUpdated_order_Order = { userEmail: string | null };

export type FulfillmentTrackingNumberUpdated_event_FulfillmentTrackingNumberUpdated = { order: FulfillmentTrackingNumberUpdated_event_FulfillmentTrackingNumberUpdated_order_Order | null };

export type FulfillmentTrackingNumberUpdated_Subscription = { event: FulfillmentTrackingNumberUpdated_event_FulfillmentTrackingNumberUpdated | null };


export type FulfillmentTrackingNumberUpdatedVariables = Types.Exact<{ [key: string]: never; }>;


export type FulfillmentTrackingNumberUpdated = FulfillmentTrackingNumberUpdated_Subscription;

export type GiftCardSentSubscription_event_GiftCardSent = { sentToEmail: string | null };

export type GiftCardSentSubscription_Subscription = { event: GiftCardSentSubscription_event_GiftCardSent | null };


export type GiftCardSentSubscriptionVariables = Types.Exact<{ [key: string]: never; }>;


export type GiftCardSentSubscription = GiftCardSentSubscription_Subscription;

export type OrderCancelledSubscription_event_OrderCancelled_order_Order = { userEmail: string | null };

export type OrderCancelledSubscription_event_OrderCancelled = { order: OrderCancelledSubscription_event_OrderCancelled_order_Order | null };

export type OrderCancelledSubscription_Subscription = { event: OrderCancelledSubscription_event_OrderCancelled | null };


export type OrderCancelledSubscriptionVariables = Types.Exact<{ [key: string]: never; }>;


export type OrderCancelledSubscription = OrderCancelledSubscription_Subscription;

export type OrderCreatedSubscription_event_OrderCreated_order_Order = { id: string, userEmail: string | null };

export type OrderCreatedSubscription_event_OrderCreated = { order: OrderCreatedSubscription_event_OrderCreated_order_Order | null };
Expand All @@ -17,6 +111,18 @@ export type OrderCreatedSubscriptionVariables = Types.Exact<{ [key: string]: nev

export type OrderCreatedSubscription = OrderCreatedSubscription_Subscription;

export type OrderRefundedSubscription_event_OrderCancelled_order_Order = { userEmail: string | null };

export type OrderRefundedSubscription_event_OrderCancelled = { order: OrderRefundedSubscription_event_OrderCancelled_order_Order | null };

export type OrderRefundedSubscription_Subscription = { event: OrderRefundedSubscription_event_OrderCancelled | null };


export type OrderRefundedSubscriptionVariables = Types.Exact<{ [key: string]: never; }>;


export type OrderRefundedSubscription = OrderRefundedSubscription_Subscription;

export type OrderUpdatedSubscription_event_OrderUpdated_order_Order = { id: string, userEmail: string | null };

export type OrderUpdatedSubscription_event_OrderUpdated = { order: OrderUpdatedSubscription_event_OrderUpdated_order_Order | null };
Expand Down Expand Up @@ -44,6 +150,92 @@ export class TypedDocumentString<TResult, TVariables>
}
}

export const AccountChangeEmailRequestedSubscriptionDocument = new TypedDocumentString(`
subscription AccountChangeEmailRequestedSubscription {
event {
... on AccountChangeEmailRequested {
user {
email
}
}
}
}
`) as unknown as TypedDocumentString<AccountChangeEmailRequestedSubscription, AccountChangeEmailRequestedSubscriptionVariables>;
export const AccountConfirmationRequestedSubscriptionDocument = new TypedDocumentString(`
subscription AccountConfirmationRequestedSubscription {
event {
... on AccountConfirmationRequested {
user {
email
}
}
}
}
`) as unknown as TypedDocumentString<AccountConfirmationRequestedSubscription, AccountConfirmationRequestedSubscriptionVariables>;
export const AccountConfirmedSubscriptionDocument = new TypedDocumentString(`
subscription AccountConfirmedSubscription {
event {
... on AccountConfirmed {
user {
email
}
}
}
}
`) as unknown as TypedDocumentString<AccountConfirmedSubscription, AccountConfirmedSubscriptionVariables>;
export const AccountDeleteRequestedSubscriptionDocument = new TypedDocumentString(`
subscription AccountDeleteRequestedSubscription {
event {
... on AccountDeleteRequested {
user {
email
}
}
}
}
`) as unknown as TypedDocumentString<AccountDeleteRequestedSubscription, AccountDeleteRequestedSubscriptionVariables>;
export const AccountDeletedSubscriptionDocument = new TypedDocumentString(`
subscription AccountDeletedSubscription {
event {
... on AccountDeleted {
user {
email
}
}
}
}
`) as unknown as TypedDocumentString<AccountDeletedSubscription, AccountDeletedSubscriptionVariables>;
export const FulfillmentTrackingNumberUpdatedDocument = new TypedDocumentString(`
subscription FulfillmentTrackingNumberUpdated {
event {
... on FulfillmentTrackingNumberUpdated {
order {
userEmail
}
}
}
}
`) as unknown as TypedDocumentString<FulfillmentTrackingNumberUpdated, FulfillmentTrackingNumberUpdatedVariables>;
export const GiftCardSentSubscriptionDocument = new TypedDocumentString(`
subscription GiftCardSentSubscription {
event {
... on GiftCardSent {
sentToEmail
}
}
}
`) as unknown as TypedDocumentString<GiftCardSentSubscription, GiftCardSentSubscriptionVariables>;
export const OrderCancelledSubscriptionDocument = new TypedDocumentString(`
subscription OrderCancelledSubscription {
event {
... on OrderCancelled {
order {
userEmail
}
}
}
}
`) as unknown as TypedDocumentString<OrderCancelledSubscription, OrderCancelledSubscriptionVariables>;
export const OrderCreatedSubscriptionDocument = new TypedDocumentString(`
subscription OrderCreatedSubscription {
event {
Expand All @@ -56,6 +248,17 @@ export const OrderCreatedSubscriptionDocument = new TypedDocumentString(`
}
}
`) as unknown as TypedDocumentString<OrderCreatedSubscription, OrderCreatedSubscriptionVariables>;
export const OrderRefundedSubscriptionDocument = new TypedDocumentString(`
subscription OrderRefundedSubscription {
event {
... on OrderCancelled {
order {
userEmail
}
}
}
}
`) as unknown as TypedDocumentString<OrderRefundedSubscription, OrderRefundedSubscriptionVariables>;
export const OrderUpdatedSubscriptionDocument = new TypedDocumentString(`
subscription OrderUpdatedSubscription {
event {
Expand Down
12 changes: 12 additions & 0 deletions src/graphql/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12896,6 +12896,11 @@ export type Mutation = {
* Note: this API is currently in Feature Preview and can be subject to changes at later point.
*
* Requires the following permissions: OWNER and HANDLE_PAYMENTS for apps, HANDLE_PAYMENTS for staff users. Staff user cannot update a transaction that is owned by the app.
*
* Triggers the following webhook events:
* - TRANSACTION_ITEM_METADATA_UPDATED (async): Optionally called when transaction's metadata was updated.
* - CHECKOUT_FULLY_PAID (async): Optionally called when the checkout charge status changed to `FULL` or `OVERCHARGED`.
* - ORDER_UPDATED (async): Optionally called when the transaction is related to the order and the order was updated.
*/
transactionEventReport: Maybe<TransactionEventReport>;
/**
Expand Down Expand Up @@ -14850,6 +14855,8 @@ export type MutationTransactionEventReportArgs = {
pspReference: Scalars['String']['input'];
time?: InputMaybe<Scalars['DateTime']['input']>;
token?: InputMaybe<Scalars['UUID']['input']>;
transactionMetadata?: InputMaybe<Array<MetadataInput>>;
transactionPrivateMetadata?: InputMaybe<Array<MetadataInput>>;
type: TransactionEventTypeEnum;
};

Expand Down Expand Up @@ -28578,6 +28585,11 @@ export type TransactionEventInput = {
* Note: this API is currently in Feature Preview and can be subject to changes at later point.
*
* Requires the following permissions: OWNER and HANDLE_PAYMENTS for apps, HANDLE_PAYMENTS for staff users. Staff user cannot update a transaction that is owned by the app.
*
* Triggers the following webhook events:
* - TRANSACTION_ITEM_METADATA_UPDATED (async): Optionally called when transaction's metadata was updated.
* - CHECKOUT_FULLY_PAID (async): Optionally called when the checkout charge status changed to `FULL` or `OVERCHARGED`.
* - ORDER_UPDATED (async): Optionally called when the transaction is related to the order and the order was updated.
*/
export type TransactionEventReport = {
/** Defines if the reported event hasn't been processed earlier. */
Expand Down

0 comments on commit a517437

Please sign in to comment.