Commit graph

146 commits

Author SHA1 Message Date
Lukasz Ostrowski
9fefd728a2
fixed duplicated ProtectedHandlerContext (#255) 2023-06-14 15:46:51 +02:00
Lukasz Ostrowski
1d08329651
Extend manifest to allow brand.logo.default field (#251)
* Extend manifest to allow brand.logo.default field

* Update grumpy-spies-sin.md
2023-06-14 12:30:43 +02:00
Lukasz Ostrowski
390fae2c97
Extend protectedHandler to contain user object with email and permissions (#252) 2023-06-13 14:52:53 +02:00
Krzysztof Wolski
9056e7617a
Update async webhook enum (#249)
* Add new async webhook types to events enum

* Add changeset
2023-06-06 14:41:25 +02:00
Lukasz Ostrowski
dd0cf3a7cf
Change signature of SettingsManager interface, because it was incorrectly generated in dts (#245) 2023-05-24 10:26:32 +02:00
Lukasz Ostrowski
f809368e4f
Add tokenRefresh event (#244)
* Add tokenRefresh event

* Create slow-oranges-serve.md

* update docs
2023-05-22 19:26:03 +02:00
Lukasz Ostrowski
d4169dc35a
Add delete method do settings manager and implement it metadata manager (#241)
* Add delete method do settings manager and implement it metadata manager

* Implement EncrypedMetadataManager.delete + changesets + docs

* Update src/settings-manager/metadata-manager.test.ts

Co-authored-by: Krzysztof Wolski <krzysztof.k.wolski@gmail.com>

* Fix test

---------

Co-authored-by: Krzysztof Wolski <krzysztof.k.wolski@gmail.com>
2023-05-21 18:42:35 +02:00
Lukasz Ostrowski
c777275a64
Fix SaleorCloudAPL getAll method (#240)
* add debug log for not existing api url in register handler

* Fix SaleoCloudApl.getAll to map data properly
2023-05-15 11:43:04 +02:00
Lukasz Ostrowski
62e4c39335
Memo app bridge & improved registerHandler error message (#237)
* Add token exp validaiton

* revert lock

* Improved registerHandler error message and wrap useAuthenticatedFetch with memo
2023-05-08 09:29:47 +02:00
Lukasz Ostrowski
da351faae9
Add EXP field validation in JWT (#233)
* Add token exp validaiton

* revert lock
2023-04-26 14:09:50 +02:00
Lukasz Ostrowski
11b793be94
Change import from next/router to use wildcard (#234) 2023-04-26 13:38:13 +02:00
Lukasz Ostrowski
7c6c164a92
Improve debug logs in createAppRegisterHandler (#231) 2023-04-17 15:11:24 +02:00
Krzysztof Wolski
5a68bec557
Fix data serialization in the UpstashAPL (#228) 2023-04-12 21:21:19 +02:00
Michał Miszczyszyn
5057d3491e
Support comma-delimited x-forwarded-proto (#227)
* Support comma-delimited x-forwarded-proto

* Changeset
2023-04-11 15:03:50 +02:00
Lukasz Ostrowski
ab24968b67
Require only partial of req - headers - in processProtectedHandler (#224)
* Require only partial of req - headers - in processProtectedHandler

* Update .changeset/tough-tips-judge.md

Co-authored-by: Krzysztof Wolski <krzysztof.k.wolski@gmail.com>

---------

Co-authored-by: Krzysztof Wolski <krzysztof.k.wolski@gmail.com>
2023-04-11 10:55:51 +02:00
Michał Miszczyszyn
b108460435
Add types for payment webhooks (#212)
* Add types for payment webhooks

* Add transaction webhooks

* Update responses for transactions

* Create .changeset/gold-buses-warn.md

* Simplify returned values for some webhooks

* Update changesets

---------

Co-authored-by: Lukasz Ostrowski <lukasz@monolog.tech>
2023-03-30 14:23:12 +02:00
Lukasz Ostrowski
96ffb925bd
Fix Permission / AppPermission (#220) 2023-03-16 15:03:35 +01:00
Przemysław Łada
6e748e3c15
Add author field to AppManifest (#218)
* Add author field to AppManifest

* Create changeset/sharp-crabs-notice.md
2023-03-15 09:27:24 +01:00
Lukasz Ostrowski
5744aa4ffd
Add requiredSaleorVersion field to AppManifest (#186)
* Add requiredSaleorVersion field to AppManifest

* Create .changeset/great-dogs-cheer.md

* Update types.ts

* Update src/types.ts

Co-authored-by: Przemysław Łada <przlada@gmail.com>

---------

Co-authored-by: Przemysław Łada <przlada@gmail.com>
2023-03-14 13:41:46 +01:00
Lukasz Ostrowski
f7d38dc8d7
Authenticated fetch update (#215)
* Remove MANAGE_APPS permission for available permission

* Fix missing header in useAuthenticatedFetch and add docs

* Update docs/protected-handlers.md

Co-authored-by: Krzysztof Wolski <krzysztof.k.wolski@gmail.com>

---------

Co-authored-by: Krzysztof Wolski <krzysztof.k.wolski@gmail.com>
2023-03-14 12:31:11 +01:00
Lukasz Ostrowski
dfd632bb14
Add EnvAPL (#213)
* Add EnvAPL

* Add extra check for api url matching

* Add EnvAPL in exported files

* Change Apl to APL

* Change configured to always true

* Add readme

* Replace console table with log
2023-03-14 11:34:53 +01:00
Hazem Khaled
3786c86506
Improve error messages in UpstashAPL (#200)
* Fix #199

Fix #199

* Throw formatted error on UpstashAPL error

* Create .changeset/big-beans-grab.md

---------

Co-authored-by: Krzysztof Wolski <krzysztof.k.wolski@gmail.com>
Co-authored-by: Lukasz Ostrowski <lukasz@monolog.tech>
2023-03-09 08:59:35 +01:00
Lukasz Ostrowski
e35d9c7fc1 Add comment to typed payload 2023-03-07 12:21:54 +01:00
Lukasz Ostrowski
0f750657cf export SyncWebhookResponsesMap 2023-03-07 12:21:54 +01:00
Lukasz Ostrowski
f5643fba6b Update expected payloads 2023-03-07 11:02:37 +01:00
Lukasz Ostrowski
ff65b615a8 Fix debug message for SaleorWebhook 2023-03-07 10:52:23 +01:00
Lukasz Ostrowski
a17232632c Fix webhook legacy fields 2023-03-07 08:30:38 +01:00
Lukasz Ostrowski
4574178fff Export NextWebhookApiHandler 2023-03-06 16:36:32 +01:00
Lukasz Ostrowski
1f4bb64a3e Fix test 2023-03-06 15:06:10 +01:00
Lukasz Ostrowski
9420209a2d
Add sync webhook (#202)
* Change process-async-saleor-webhook to process-saleor-webhook and add better debug logs

* Change processWebhook name

* wip

* Add base class structure

* refactor

* add sync payload builder

* wip

* wip

* Add some missing webhook responses

* Fix tests for Async version

* Fix tests

* Add MockAPL test util

* Refactor tests to use MockAPL

* Add test to sync webhook

* Restore legacy subscriptionQueryAst field for compatibility

* CR Fixes - TS type & event -> eventType

* Changelog, docs and remove old payment webhooks

* Apply suggestions from code review

Co-authored-by: Krzysztof Wolski <krzysztof.k.wolski@gmail.com>

* Update src/handlers/next/saleor-webhooks/process-saleor-webhook.ts

Co-authored-by: Krzysztof Wolski <krzysztof.k.wolski@gmail.com>

---------

Co-authored-by: Krzysztof Wolski <krzysztof.k.wolski@gmail.com>
2023-03-06 15:01:22 +01:00
Lukasz Ostrowski
a939281e98
Improve register handler errors API (#201) 2023-02-28 13:54:58 +01:00
Lukasz Ostrowski
9e22a49acc
Change AppBridge default autoNotifyReady to true (#185)
* Change AppBridge default autoNotifyReady to true

* Add changeset
2023-02-27 16:39:01 +01:00
Lukasz Ostrowski
195f2d9127
Add hooks to createAppRegsiterHandler (#183)
* Add hooks to createAppRegsiterHandler

* Add error handling and flatten structure

* Add tests

* Add docs

* CR suggestions applied

* Update docs
2023-02-27 14:36:22 +01:00
Lukasz Ostrowski
020d6aaa39
Remove Vercel APL (#170) 2023-02-26 18:35:04 +01:00
Lukasz Ostrowski
4f9c9c2816
Add req and res to onError callback for AsyncWebhook (#180) 2023-02-15 11:08:09 +01:00
Lukasz Ostrowski
ea65d37474
Add better error handling for async webhook factory (#176)
* Add better error handling for async webhook factory

* Add docs, make formatter function async

* Add docs, make formatter function async
2023-02-14 16:19:07 +01:00
Lukasz Ostrowski
652833146f
Expose verify-jwks and remove legacy domain usage instead of api url (#173)
* Expose verify-jwks and remove legacy domain usage instead of api url

* Update src/verify-signature.ts

Co-authored-by: Krzysztof Wolski <krzysztof.k.wolski@gmail.com>

---------

Co-authored-by: Krzysztof Wolski <krzysztof.k.wolski@gmail.com>
2023-02-14 16:18:46 +01:00
Lukasz Ostrowski
a15d72602f
Add more debug messages to SaleorCloudAPL (#175)
* Add more debug messages to SaleorCloudAPL

* Refactor error message extraction
2023-02-14 13:00:46 +01:00
Lukasz Ostrowski
24778df592
Add strict type literal unions for Sync and Async Events enums (#174)
* Add strict type literal unions for Sync and Async Events enums

* Fix manifest structure
2023-02-14 12:46:29 +01:00
Lukasz Ostrowski
7413de221b
Add user email and permissions to app bridge (#167)
* Add user email and permissions to app bridge

* Update src/app-bridge/app-bridge-state.ts

Co-authored-by: Krzysztof Wolski <krzysztof.k.wolski@gmail.com>

* Fix permissions name

---------

Co-authored-by: Krzysztof Wolski <krzysztof.k.wolski@gmail.com>
2023-02-07 09:30:46 +01:00
Lukasz Ostrowski
450a3ce741
Remove inferWebhooks (#168) 2023-02-07 08:04:39 +01:00
Krzysztof Wolski
bb3396dde6
Permission check for the protected handler (#161)
* Permission check for the protected handler

* Add tests
2023-01-25 12:00:22 +01:00
Lukasz Ostrowski
6ffaba2dab
Allow setting initial theme from constructor in AppBridge (#162)
* Allow passing initial theme value, change initial notifyOnReady

* Update doc
2023-01-24 19:21:05 +01:00
Krzysztof Wolski
51284efa00
Handle missing encryption key for the EncryptedMetadataManager (#159)
* Handle missing encryption key for the EncryptedMetadataManager

* Fancy up the documentation

* Throw an error instead of process exit
2023-01-23 15:39:42 +01:00
Krzysztof Wolski
b84049246b
Use b64url and fix incoming data validation (#156) 2023-01-23 09:35:31 +01:00
Adrian Pilarczyk
db1cd13919
feat: 🏷️ add handle_taxes permission type (#153) 2023-01-19 12:02:46 +01:00
Lukasz Ostrowski
67cded2e2a
Add optional URL protection to createRegisterHandler (#148)
* validateAllowSaleorUrls impl

* Implement in handler and add test

* update codeowners

* Apply suggestions from code review

Co-authored-by: Krzysztof Wolski <krzysztof.k.wolski@gmail.com>

* Rename param

Co-authored-by: Krzysztof Wolski <krzysztof.k.wolski@gmail.com>
2023-01-13 17:29:38 +01:00
Krzysztof Wolski
8dccb00edd
Fix CloudAPL response parsing (#149)
* Fix CloudAPL response parsing

* Mock signature fetch
2023-01-13 16:35:16 +01:00
Krzysztof Wolski
bc622dd3e1
Rename api url field in the Cloud APL (#146) 2023-01-12 16:13:27 +01:00
Krzysztof Wolski
c4fa6a1c05
Rename apiUrl to saleorApiUrl for consistency (#144) 2023-01-12 13:39:49 +01:00