Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing permissions to typings #302

Merged
merged 5 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/happy-seahorses-check.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@saleor/app-sdk": minor
---

Added definition for payment and transaction events. From now on, sync webhook factory will autocomplete response expected by Saleor
5 changes: 5 additions & 0 deletions .changeset/proud-llamas-push.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@saleor/app-sdk": minor
---

Added new permission - MANAGE_ORDERS_IMPORT - to Permission type
5 changes: 5 additions & 0 deletions .changeset/thirty-doors-kneel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@saleor/app-sdk": minor
---

Added missing payment transactions sync events
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"react-dom": "18.2.0",
"tsm": "^2.2.2",
"tsup": "^6.2.3",
"typescript": "^4.9.5",
"typescript": "4.9.5",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to pin TypeScript version only or other dependencies as well?

Copy link
Member Author

@lkostrowski lkostrowski Nov 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we should pin everything. I will do that in next PRs - it will require additional testing to ensure everything stays in place (and will add "save exact" flag for project level)

"vi-fetch": "^0.8.0",
"vite": "^4.0.4",
"vitest": "^0.28.1"
Expand Down
6 changes: 5 additions & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,77 @@ export type SyncWebhookResponsesMap = {
externalUrl?: string;
message?: string;
};
PAYMENT_METHOD_PROCESS_TOKENIZATION_SESSION:
| {
result: "SUCCESSFULLY_TOKENIZED";
id: string;
data: unknown;
}
| {
result: "ADDITIONAL_ACTION_REQUIRED";
id: string;
data: unknown;
}
| {
result: "PENDING";
data: unknown;
}
| {
result: "FAILED_TO_TOKENIZE";
error: string;
};
PAYMENT_METHOD_INITIALIZE_TOKENIZATION_SESSION:
| {
result: "SUCCESSFULLY_TOKENIZED";
id: string;
data: unknown;
}
| {
result: "ADDITIONAL_ACTION_REQUIRED";
id: string;
data: unknown;
}
| {
result: "PENDING";
data: unknown;
}
| {
result: "FAILED_TO_TOKENIZE";
error: string;
};
PAYMENT_GATEWAY_INITIALIZE_TOKENIZATION_SESSION:
| {
result: "SUCCESSFULLY_INITIALIZED";
data: unknown;
}
| {
result: "FAILED_TO_INITIALIZE";
error: string;
};
STORED_PAYMENT_METHOD_DELETE_REQUESTED:
| {
result: "SUCCESSFULLY_DELETED";
}
| {
result: "FAILED_TO_DELETE";
error: string;
};
LIST_STORED_PAYMENT_METHODS: {
paymentMethods: Array<{
id: string;
supportedPaymentFlows: Array<"INTERACTIVE">;
type: string;
lkostrowski marked this conversation as resolved.
Show resolved Hide resolved
creditCardInfo?: {
brand: string;
lastDigits: string;
expMonth: string;
expYear: string;
firstDigits?: string;
};
name?: string;
data?: unknown;
}>;
};
};

/**
Expand Down
8 changes: 7 additions & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export type Permission =
| "MANAGE_GIFT_CARD"
| "MANAGE_MENUS"
| "MANAGE_ORDERS"
| "MANAGE_ORDERS_IMPORT"
| "MANAGE_PAGES"
| "MANAGE_PAGE_TYPES_AND_ATTRIBUTES"
| "HANDLE_PAYMENTS"
Expand Down Expand Up @@ -187,7 +188,12 @@ export type SyncWebhookEventType =
| "TRANSACTION_CANCELATION_REQUESTED"
| "PAYMENT_GATEWAY_INITIALIZE_SESSION"
| "TRANSACTION_INITIALIZE_SESSION"
| "TRANSACTION_PROCESS_SESSION";
| "TRANSACTION_PROCESS_SESSION"
| "LIST_STORED_PAYMENT_METHODS"
| "STORED_PAYMENT_METHOD_DELETE_REQUESTED"
| "PAYMENT_GATEWAY_INITIALIZE_TOKENIZATION_SESSION"
| "PAYMENT_METHOD_INITIALIZE_TOKENIZATION_SESSION"
| "PAYMENT_METHOD_PROCESS_TOKENIZATION_SESSION";

export interface AppExtension {
/** Name which will be displayed in the dashboard */
Expand Down