Commit graph

36 commits

Author SHA1 Message Date
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
11b793be94
Change import from next/router to use wildcard (#234) 2023-04-26 13:38:13 +02: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
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
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
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
c4fa6a1c05
Rename apiUrl to saleorApiUrl for consistency (#144) 2023-01-12 13:39:49 +01:00
Lukasz Ostrowski
f612da9035
Add authenticated fetch (#138)
* Add authenticated fetch

* Add tests

* Update vitest

* setup node-fetch

* update lockfle

* change to global.fetch

* add mock fetch

* Change window.fetch to global.fetch
2022-12-12 11:47:23 +01:00
Lukasz Ostrowski
95eac760ca
Add action that informs Dashboard that AppBridge is ready (#129)
* Add action that informs Dashboard that AppBridge is ready

* Allow AppBridge to disable automated notifyReady event

* Remove unused strategy field from RoutePropagator

* Apply suggestions from code review

Co-authored-by: Dawid <tarasiukdawid@gmail.com>

Co-authored-by: Dawid <tarasiukdawid@gmail.com>
2022-12-05 17:17:17 +01:00
Lukasz Ostrowski
b39081ed9a
Change AppBridge interval to timeout (#128) 2022-12-02 16:08:39 +01:00
Lukasz Ostrowski
063e56f345
Update app-bridge.ts (#127) 2022-12-01 10:17:02 +01:00
Lukasz Ostrowski
ddd65dabf1
Add saleorApiUrl state param to AppBridge (#114)
* Add saleorApiUrl state param to AppBridge

* Apply payload verification check based on full api endpoint url

* Remove deprecation info

* Check if either domain or saleorApiUrl is provided
2022-11-23 10:08:04 +01:00
Lukasz Ostrowski
607fe73569
Update build config (#118)
* Ensure peer deps are excluded

* Release 0.20.1-0

* Change next router import to fix the build

* Release 0.20.1-1

* Restore releaseit config
2022-11-22 09:52:21 +01:00
Lukasz Ostrowski
b4e0a053cb
Add routing changing actions and RoutePropagator (#110) 2022-11-21 11:32:18 +01:00
Krzysztof Żuraw
d7ccde30ee
feat: add getLayout to return type of withAuthorization (#82) 2022-10-13 09:22:49 +02:00
Lukasz Ostrowski
aa4d55b83d
Disable token iss validation (#75)
* Disable token iss validation

* Disable VercelApl constructor validation
2022-10-11 16:09:29 +02:00
Lukasz Ostrowski
864ca16f78
Auth features (#64)
* Add useDashboardToken to app bridge module

* Add authorization HOC

* Fixes
2022-10-05 13:12:19 +02:00
Lukasz Ostrowski
126e949366
Detect locale param from URL in AppBridge (#58)
* Detect locale param from URL in AppBridge

* Add docs
2022-09-14 14:21:53 +02:00
Lukasz Ostrowski
d4670b048c
Fix tests and strong-type locales (#57)
* Add new event type

* Add state handling for locale change

* Add strongly typed language codes

* fix tests
2022-09-13 15:15:52 +02:00
Lukasz Ostrowski
cc18c3deac
Add AppBridgeProvider and events factory (#51)
* Add events factory

* Add AppBridgeProvider

* Rewrite useAppBridge, add tests
2022-09-13 12:00:02 +02:00
Lukasz Ostrowski
ac6900f35f
Add support for locale change (#55)
* Add new event type

* Add state handling for locale change
2022-09-13 11:59:30 +02:00
Lukasz Ostrowski
423495970b Add additional test and fix debug message 2022-09-06 16:02:24 +02:00
Lukasz Ostrowski
47e7865dc5 Add debug messages to middlewares
Add debug messages to middlewares

Apply suggestions from code review

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

better debug messages

Add experimental debug middleware
2022-09-05 10:13:46 +02:00
Krzysztof Wolski
c745de5a2c Ignore type warning on log message 2022-09-02 16:55:14 +02:00
Krzysztof Wolski
14b5fb6460 Mark event type as unknown 2022-09-02 16:53:40 +02:00
Lukasz Ostrowski
d6366e2ef1 Change "debug" package import to use default
This is rquired because app-template broke when using app-sdk with previous
named import
2022-08-30 09:15:11 +02:00
Lukasz Ostrowski
915f6496f1 Fix legacy createApp factory to not override targetDomain 2022-08-29 09:01:16 +02:00
Lukasz Ostrowski
6de0675784 Install debug package and add debug messages to AppBridge 2022-08-26 09:24:56 +02:00
Lukasz Ostrowski
53561452d4 Fix constructuring url with missing referrer 2022-08-23 09:22:40 +02:00
Lukasz Ostrowski
ef5ad07c1e Fix test 2022-08-22 15:53:03 +02:00
Lukasz Ostrowski
683f19b5c0 Add docs and test 2022-08-22 15:47:40 +02:00
Lukasz Ostrowski
c4d672683c Fix exports 2022-08-22 11:37:42 +02:00
Lukasz Ostrowski
d445653c2d Refactors and tests 2022-08-11 23:14:41 +02:00
Lukasz Ostrowski
983dba1126 Refactor app bridge state container 2022-08-11 22:19:11 +02:00
Lukasz Ostrowski
af68bedfb3 Tests for actions 2022-08-11 20:51:02 +02:00
Lukasz Ostrowski
8110818251 move app-bridge code and tests to app-sdk 2022-08-11 14:03:51 +02:00