Skip to content
Closed
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/eight-files-relate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@saleor/app-sdk": patch
---

Deprecate `buildSyncWebhookResponsePayload` function. Saleor now exposes JSON schema for webhook response payloads that can be used to generate TypeScript types. See [Saleor docs](https://docs.saleor.io/developer/extending/apps/developing-apps/generating-types-for-sync-webhooks) for more info.
2 changes: 2 additions & 0 deletions src/handlers/shared/sync-webhook-response-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@ export type SyncWebhookResponsesMap<V extends SaleorVersion = "3.20"> = CoreSync
} & TransactionWebhookResponses<V>;

/**
* @deprecated Saleor now exposes JSON schema for webhook response payloads that can be used to generate TypeScript types. See https://docs.saleor.io/developer/extending/apps/developing-apps/generating-types-for-sync-webhooks for more details.
*
Comment on lines +261 to +262
Copy link
Member

Choose a reason for hiding this comment

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

maybe we should generate types in SDK instead? So you don't have to regenerate them in every app?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can - but I think it will the best if we have app-sdk version connected to Saleor version. Then we can generate JSON schema types + GraphQL types as well

Copy link
Member

Choose a reason for hiding this comment

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

so lets do it

* Identity function, but it works on Typescript level to pick right payload based on first param
*/
export const buildSyncWebhookResponsePayload = <
Expand Down
Loading