-
Notifications
You must be signed in to change notification settings - Fork 21
Add missing changeset, add more description for changes #406
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| --- | ||
| "@saleor/app-sdk": patch | ||
| "@saleor/app-sdk": major | ||
| --- | ||
|
|
||
| Removed `/middlewares`, you should use `/handlers` instead. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| --- | ||
| "@saleor/app-sdk": major | ||
| --- | ||
|
|
||
| `createManifestHandler` will now require `saleor-schema-version` header, sent by Saleor when fetching manifest. | ||
| `schemaVersion` parameter passed to factory method will be always defined | ||
|
|
||
| ### Previously: | ||
|
|
||
| ``` | ||
|
||
| const handler = createManifestHandler({ | ||
| manifestFactory({ schemaVersion }) { | ||
| schemaVersion -> null or number | ||
| return { | ||
| // ... | ||
| } | ||
| } | ||
| }) | ||
| ``` | ||
|
|
||
| Example request: | ||
|
|
||
| ``` | ||
|
||
| GET /api/manifest | ||
| host: my-app.com | ||
| ``` | ||
|
|
||
| ``` | ||
| GET /api/manifest | ||
| host: my-app.com | ||
| saleor-schema-version: 3.20 | ||
| ``` | ||
|
|
||
| Example response: | ||
|
|
||
| ``` | ||
| Content-Type: application/json | ||
|
|
||
| { | ||
| "name": "Example Saleor App" | ||
| ... | ||
| } | ||
| ``` | ||
|
|
||
| ### Now: | ||
|
|
||
| ``` | ||
|
||
| const handler = createManifestHandler({ | ||
| manifestFactory({ schemaVersion }) { | ||
| schemaVersion -> number | ||
| return { | ||
| // ... | ||
| } | ||
| } | ||
| }) | ||
| ``` | ||
|
|
||
| ### Invalid request | ||
|
|
||
| ```http | ||
| GET /api/manifest | ||
| host: my-app.com | ||
| ``` | ||
|
|
||
| Response: | ||
|
|
||
| ``` | ||
| HTTP 400 | ||
| Content-Type: text/plain | ||
|
|
||
| Missing schema version header | ||
| ``` | ||
|
|
||
| ### Valid request | ||
|
|
||
| ```http | ||
| GET /api/manifest | ||
| host: my-app.com | ||
| saleor-schema-version: 3.20 | ||
| ``` | ||
|
|
||
| Response: | ||
|
|
||
| ``` | ||
| HTTP 200 | ||
| Content-Type: application/json | ||
|
|
||
| { | ||
| "name": "Example Saleor App" | ||
| ... | ||
| } | ||
| ``` | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: can you add imports as well for
createManifestHandlerandcreateAppRegisterHandler