@north-light/sdk 0.3.429 → 0.3.431
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/dist/crtr.js +1 -1
- package/dist/oauth/index.d.ts +3 -3
- package/dist/oauth/index.js +2 -2
- package/dist/oauth/refusal.d.ts +1 -1
- package/dist/resources/grant-watcher.d.ts +1 -1
- package/dist/testing/cloud.d.ts +2 -2
- package/dist/testing/cloud.js +1 -1
- package/dist/testing/index.js +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
package/dist/crtr.js
CHANGED
|
@@ -44,7 +44,7 @@ export function runCrtr(argv, timeoutMs) {
|
|
|
44
44
|
}
|
|
45
45
|
/** "This machine's crtr isn't joined …, so <what>." then the join step. */
|
|
46
46
|
export const notJoinedLines = (what, joinStep) => [
|
|
47
|
-
`This machine's crtr isn't joined to your
|
|
47
|
+
`This machine's crtr isn't joined to your Northlight account, so ${what}.`,
|
|
48
48
|
joinStep,
|
|
49
49
|
];
|
|
50
50
|
export const say = (lines) => console.error(lines.join('\n'));
|
package/dist/oauth/index.d.ts
CHANGED
|
@@ -47,13 +47,13 @@ export declare class MemoryConnectionStore implements ConnectionStore {
|
|
|
47
47
|
lock<T>(userId: string, fn: () => Promise<T>): Promise<T>;
|
|
48
48
|
}
|
|
49
49
|
/**
|
|
50
|
-
* A person's
|
|
50
|
+
* A person's Northlight identity from a sign-in-only (`openid`, `openid email`, `openid profile`, or `openid email profile`) request, read from an
|
|
51
51
|
* ID token the SDK verified: ES256 signature against the directory's JWKS, `iss`, `aud` = the client id,
|
|
52
52
|
* `exp`, and the `nonce` from `authorizeUrl`. It is not a connection: it holds no runtime URL, refresh
|
|
53
53
|
* token, or grant, and nothing can be called on the person's runtime with it.
|
|
54
54
|
*/
|
|
55
55
|
export interface Identity {
|
|
56
|
-
/** The person's
|
|
56
|
+
/** The person's Northlight user id (`user:<id>`), the same `sub` a `Connection.userId` carries. */
|
|
57
57
|
sub: string;
|
|
58
58
|
/** Present only when `email` was requested and approved. */
|
|
59
59
|
email?: string;
|
|
@@ -137,7 +137,7 @@ export declare class OAuth2Client {
|
|
|
137
137
|
* caller stops waiting for it at its own. */
|
|
138
138
|
private discoveryWithin;
|
|
139
139
|
/**
|
|
140
|
-
* The app's page on the signed-in person's
|
|
140
|
+
* The app's page on the signed-in person's Northlight account, where they change or remove what the app may do:
|
|
141
141
|
* the discovery document's `account_app_uri_template` with its one `{client_id}` replaced by the encoded client id.
|
|
142
142
|
* Needs no user or connection; its only request is the shared discovery read. Throws `CrouterError` when the field
|
|
143
143
|
* is absent, does not contain `{client_id}` exactly once, or does not expand to a URL on the issuer's origin.
|
package/dist/oauth/index.js
CHANGED
|
@@ -152,7 +152,7 @@ export class OAuth2Client {
|
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
154
|
/**
|
|
155
|
-
* The app's page on the signed-in person's
|
|
155
|
+
* The app's page on the signed-in person's Northlight account, where they change or remove what the app may do:
|
|
156
156
|
* the discovery document's `account_app_uri_template` with its one `{client_id}` replaced by the encoded client id.
|
|
157
157
|
* Needs no user or connection; its only request is the shared discovery read. Throws `CrouterError` when the field
|
|
158
158
|
* is absent, does not contain `{client_id}` exactly once, or does not expand to a URL on the issuer's origin.
|
|
@@ -600,7 +600,7 @@ function parseDiscovery(value, issuer) {
|
|
|
600
600
|
};
|
|
601
601
|
}
|
|
602
602
|
function notConnected(userId) {
|
|
603
|
-
return new CrouterError(`No stored connection for ${userId}: they must sign in with
|
|
603
|
+
return new CrouterError(`No stored connection for ${userId}: they must sign in with Northlight again`, 'not_connected');
|
|
604
604
|
}
|
|
605
605
|
function assertNotInHandler(userId) {
|
|
606
606
|
if (handlerScope()?.getStore() === userId) {
|
package/dist/oauth/refusal.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export interface Refusal {
|
|
|
19
19
|
kind: RefusalKind;
|
|
20
20
|
/** The directory's code: `grant_removed`, `grant_suspended`, `app_in_testing`, `refresh_token_expired`, `refresh_token_reused`, or `grant_revoked`. */
|
|
21
21
|
code: string;
|
|
22
|
-
/** The connection's
|
|
22
|
+
/** The connection's Northlight user id (`user:<id>`). */
|
|
23
23
|
userId: string;
|
|
24
24
|
/** The grant the refused connection held. */
|
|
25
25
|
grantId: string;
|
|
@@ -8,7 +8,7 @@ export interface GrantChanged {
|
|
|
8
8
|
previous: GrantGetDTO | null;
|
|
9
9
|
}
|
|
10
10
|
export interface GrantWatchOptions {
|
|
11
|
-
/** The people whose grant the app follows (
|
|
11
|
+
/** The people whose grant the app follows (Northlight user ids), read from its own rows. Called at `start()`,
|
|
12
12
|
* every `sweepMs`, after each delivery, and on `nudge()`. Return only people whose change the app will act on:
|
|
13
13
|
* each followed person holds one request on their runtime per turn. A user no longer returned is forgotten. */
|
|
14
14
|
users: () => Promise<string[]> | string[];
|
package/dist/testing/cloud.d.ts
CHANGED
|
@@ -91,7 +91,7 @@ export interface FakeCloudOptions {
|
|
|
91
91
|
/** Runtime→app run notices; without it nothing is sent. */
|
|
92
92
|
runNotice?: RunNoticeOptions;
|
|
93
93
|
/**
|
|
94
|
-
* Whether the runtime can start an `isolated: true` run. `available` (default) models a
|
|
94
|
+
* Whether the runtime can start an `isolated: true` run. `available` (default) models a Northlight guest, where
|
|
95
95
|
* the Linux root launcher always exists: the run starts, `run.params.isolated` is true, and a `cwd` outside the run's
|
|
96
96
|
* root folder (`/apps/<clientId>/nodes/<run id>`) is 400 `invalid_request` `param: cwd`. `unavailable` models a
|
|
97
97
|
* runtime without the launcher (a developer's Mac): every isolated start is 503 `isolated_unavailable`, retryable.
|
|
@@ -151,7 +151,7 @@ export interface FakeRuns {
|
|
|
151
151
|
/** Set the responder (null clears it). On a user's `runs` it overrides the cloud's for that user. */
|
|
152
152
|
respond(fn: Responder | null): void;
|
|
153
153
|
}
|
|
154
|
-
/** A fake
|
|
154
|
+
/** A fake Northlight: the directory (discovery, refresh, JWKS) and each person's runtime, behind `fetch`. */
|
|
155
155
|
export declare class FakeCloud {
|
|
156
156
|
/** Pass to `OAuth2Client` (and `verifyRunNotice`) as `fetch`. Unique per cloud. */
|
|
157
157
|
readonly fetch: typeof fetch;
|
package/dist/testing/cloud.js
CHANGED
|
@@ -56,7 +56,7 @@ function withSignal(promise, signal) {
|
|
|
56
56
|
promise.then((value) => { signal.removeEventListener('abort', onAbort); resolve(value); }, (error) => { signal.removeEventListener('abort', onAbort); reject(error); });
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
|
-
/** A fake
|
|
59
|
+
/** A fake Northlight: the directory (discovery, refresh, JWKS) and each person's runtime, behind `fetch`. */
|
|
60
60
|
export class FakeCloud {
|
|
61
61
|
/** Pass to `OAuth2Client` (and `verifyRunNotice`) as `fetch`. Unique per cloud. */
|
|
62
62
|
fetch;
|
package/dist/testing/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// `@north-light/sdk/testing`: a fake
|
|
1
|
+
// `@north-light/sdk/testing`: a fake Northlight (directory + runtime) your real `OAuth2Client` and `Crouter` talk to
|
|
2
2
|
// through `fetch`. Node-only; no test framework. See docs/sdk/testing.md.
|
|
3
3
|
export { FakeCloud, FAKE_TESTER_LIMIT } from './cloud.js';
|
|
4
4
|
export { manualClock } from './clock.js';
|
package/dist/version.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** This SDK's release version. Informational only: compatibility is the contract level, not this number. */
|
|
2
|
-
export declare const SDK_VERSION = "0.3.
|
|
2
|
+
export declare const SDK_VERSION = "0.3.431";
|
|
3
3
|
/** The release sent in `Crouter-Minimum-Runtime-Version` on every request. It is frozen, so a runtime from before the
|
|
4
4
|
* contract level existed (which only knows this header) refuses this SDK, while every later runtime accepts it. */
|
|
5
5
|
export declare const LEGACY_FLOOR = "0.3.423";
|
package/dist/version.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// SDK_VERSION is written by scripts/release-version.mjs on every release; do not edit by hand.
|
|
2
2
|
/** This SDK's release version. Informational only: compatibility is the contract level, not this number. */
|
|
3
|
-
export const SDK_VERSION = '0.3.
|
|
3
|
+
export const SDK_VERSION = '0.3.431';
|
|
4
4
|
// LEGACY_FLOOR is written once by `scripts/contract.mjs release`, at the first release that carries the contract level
|
|
5
5
|
// (the `0.0.0` placeholder is replaced there and never again); do not edit by hand.
|
|
6
6
|
/** The release sent in `Crouter-Minimum-Runtime-Version` on every request. It is frozen, so a runtime from before the
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@north-light/sdk",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.431",
|
|
4
4
|
"crouterContract": "1.0",
|
|
5
5
|
"description": "Typed Node and browser client for running crouter agents through the crtrd /v1 API.",
|
|
6
6
|
"type": "module",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"prepublishOnly": "node -e \"if (process.env.npm_config_tag !== 'next') { console.error('@north-light/sdk publishes only with --tag next; scripts/promote-sdk.mjs is the only mover of latest.'); process.exit(1); }\""
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@north-light/api": "0.3.
|
|
45
|
-
"@north-light/identity": "0.3.
|
|
44
|
+
"@north-light/api": "0.3.431",
|
|
45
|
+
"@north-light/identity": "0.3.431",
|
|
46
46
|
"jose": "^6.2.1"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|