@assembly-js/app-foundation 0.3.8 → 0.3.9
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 +3 -0
- package/dist/scripts.d.ts +1 -1
- package/dist/scripts.js +5 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -19,6 +19,9 @@ A patch release never changes what an app's build requires; a minor release may
|
|
|
19
19
|
not by hand; see `changes/README.md`. CI fails a PR that changes a check script without a
|
|
20
20
|
`bump: minor` change file.
|
|
21
21
|
|
|
22
|
+
## 0.3.9
|
|
23
|
+
- [fix] `getOfflineAssembly` from `@assembly-js/app-foundation/scripts` now refuses to run inside Next, so a route under `app/` can no longer use it to act with the installer's access. The entry shipped in 0.2.1 for standalone scripts only and nothing the build agent is taught imports it from a route, so no existing app's code needs to change.
|
|
24
|
+
|
|
22
25
|
## 0.3.8
|
|
23
26
|
- [behavior] An app that calls a provider's inferred route now lists that provider in `.assembly/app-deps.json`.
|
|
24
27
|
|
package/dist/scripts.d.ts
CHANGED
|
@@ -3,6 +3,6 @@ import { type AssemblyAPI } from '@assembly-js/node-sdk';
|
|
|
3
3
|
* The script-side counterpart of `getOfflineAssembly` from `/server`: mints a
|
|
4
4
|
* short-lived app-scoped bearer from `ASSEMBLY_API_KEY` and returns a bearer-only
|
|
5
5
|
* client. There is no request here, so the viewer-identity guard `/server` applies
|
|
6
|
-
* does not exist; use this only from scripts
|
|
6
|
+
* does not exist, so it refuses to run inside Next instead; use this only from scripts.
|
|
7
7
|
*/
|
|
8
8
|
export declare function getOfflineAssembly(): Promise<AssemblyAPI>;
|
package/dist/scripts.js
CHANGED
|
@@ -4676,6 +4676,11 @@ async function mintBearerFromAppKey() {
|
|
|
4676
4676
|
|
|
4677
4677
|
// src/scripts.ts
|
|
4678
4678
|
async function getOfflineAssembly() {
|
|
4679
|
+
if (process.env.NEXT_RUNTIME) {
|
|
4680
|
+
throw new Error(
|
|
4681
|
+
"getOfflineAssembly from '/scripts' must not run inside Next: its app-scoped bearer acts as the installer. Use getAssembly() or getAssemblyForRequest() from '/server' in user-facing routes, or getOfflineAssembly() from '/server' for cron and webhook routes"
|
|
4682
|
+
);
|
|
4683
|
+
}
|
|
4679
4684
|
if (!process.env.ASSEMBLY_API_KEY) {
|
|
4680
4685
|
throw new Error(
|
|
4681
4686
|
"getOfflineAssembly: ASSEMBLY_API_KEY is not set \u2014 cannot mint an app-scoped bearer"
|