@assembly-js/app-foundation 0.2.1 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/bin/client-safe-sdk-methods.mjs +27 -10
- package/dist/scripts.js +4695 -22
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -17,6 +17,12 @@ bullets ship. Write `[fix]`, `[behavior]` and `[action]` bullets for the app's o
|
|
|
17
17
|
A patch release never changes what an app's build requires; a minor release may add or change a
|
|
18
18
|
`bin/check-*.mjs` script. CI fails a PR that changes a check script without a minor bump over main.
|
|
19
19
|
|
|
20
|
+
## 0.2.3
|
|
21
|
+
- [new] The client-call scan now treats a client's own notification reads (list, mark read, mark unread) as safe, matching the routes the platform opens to clients. Nothing in the app changes.
|
|
22
|
+
|
|
23
|
+
## 0.2.2
|
|
24
|
+
- [fix] `@assembly-js/app-foundation/scripts` now loads when a script runs under plain `node`, not only under `bun`.
|
|
25
|
+
|
|
20
26
|
## 0.2.1
|
|
21
27
|
- [new] Add `@assembly-js/app-foundation/scripts`, which exports `getOfflineAssembly` without `server-only`, for seed and backfill scripts that run outside Next.
|
|
22
28
|
|
|
@@ -1,11 +1,28 @@
|
|
|
1
|
-
// PROVISIONAL until the final client-safe public route list lands.
|
|
2
|
-
//
|
|
3
1
|
// The routes a client bearer may keep calling once clients stop acting as admin,
|
|
4
|
-
// as SDK method names (the SDK is flat: `retrieveClient`, not `clients.retrieve`)
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
|
|
2
|
+
// as SDK method names (the SDK is flat: `retrieveClient`, not `clients.retrieve`).
|
|
3
|
+
// Mirrors every route the platform marks with ClientAccessOpen, ClientAccessSelf or
|
|
4
|
+
// ClientAccessGuarded under backend/platform-api; scan-client-calls.test.mjs fails when
|
|
5
|
+
// the marker count drifts from this list.
|
|
6
|
+
//
|
|
7
|
+
// GET /v1/me -> retrieveMe
|
|
8
|
+
// GET /v1/clients/{id} -> retrieveClient (the client's own record only)
|
|
9
|
+
// GET /v1/notifications -> listNotifications
|
|
10
|
+
// POST /v1/notifications/{id}/read -> markNotificationRead
|
|
11
|
+
// POST /v1/notifications/{id}/unread -> markNotificationUnread
|
|
12
|
+
// GET /v1/session/flags -> no SDK method yet, so nothing to list; add it
|
|
13
|
+
// here when the SDK gains one.
|
|
14
|
+
//
|
|
15
|
+
// retrieveClient is allowlisted by name: whether the id is the viewer's own is a runtime
|
|
16
|
+
// fact a static scan cannot see. The notification routes are open to clients, and the
|
|
17
|
+
// platform pins a client caller to their own notifications. Creating, retrieving and
|
|
18
|
+
// deleting a notification stay off the list: those routes are not open to clients.
|
|
19
|
+
export const CLIENT_SAFE_SDK_METHODS = Object.freeze([
|
|
20
|
+
'retrieveClient',
|
|
21
|
+
'retrieveMe',
|
|
22
|
+
'listNotifications',
|
|
23
|
+
'markNotificationRead',
|
|
24
|
+
'markNotificationUnread',
|
|
25
|
+
]);
|
|
26
|
+
|
|
27
|
+
// Marked client-safe routes that no SDK method reaches yet (the list above says which).
|
|
28
|
+
export const CLIENT_SAFE_ROUTES_WITHOUT_SDK_METHOD = 1;
|