@loams/client 0.1.1 → 0.1.2
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/README.md +28 -4
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/loams.d.ts +1 -1
- package/dist/loams.js +1 -1
- package/dist/node.js +1 -1
- package/dist/runtime/machine-key.d.ts +33 -0
- package/dist/runtime/machine-key.js +174 -0
- package/dist/runtime/token-source.d.ts +1 -1
- package/dist/runtime/token-source.js +1 -1
- package/dist/runtime/transports.d.ts +22 -1
- package/dist/runtime/transports.js +28 -2
- package/dist/vendor/proto/gen/loams/auth/v1/auth_pb.d.ts +7 -2
- package/dist/vendor/proto/gen/loams/auth/v1/auth_pb.js +5 -1
- package/dist/vendor/proto/gen/loams/instance/v1/instance_pb.d.ts +23 -7
- package/dist/vendor/proto/gen/loams/instance/v1/instance_pb.js +20 -5
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# The TypeScript SDK (`@loams/client`)
|
|
4
4
|
|
|
5
|
-
> **Preview.** `0.1.
|
|
5
|
+
> **Preview.** `0.1.2` tracks the Loams preview server and may change between previews; pin an exact version. Installed with `npm install @loams/client@preview`.
|
|
6
6
|
|
|
7
7
|
Design §44 §7 and §10.2: the SDK is a `Loams` object with namespaced modules,
|
|
8
8
|
generated from the `loams.options.v1` annotations on the protos, over the
|
|
@@ -29,7 +29,7 @@ generator inputs stay outside the workspace, next to `proto/`.
|
|
|
29
29
|
npm i @loams/client # and @loams/live for Live's stubs
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
-
`0.1.
|
|
32
|
+
`0.1.2` tracks Loams 0.1.2; in 0.x the API may change between minor versions.
|
|
33
33
|
|
|
34
34
|
## Using it
|
|
35
35
|
|
|
@@ -55,8 +55,13 @@ try {
|
|
|
55
55
|
```
|
|
56
56
|
|
|
57
57
|
One port serves the Connect protocol, gRPC and gRPC-Web (D600), so the same
|
|
58
|
-
object works in a browser, in Node
|
|
59
|
-
Connect over `fetch`.
|
|
58
|
+
object works in a browser, in Node and in Bun. The default transport is
|
|
59
|
+
Connect over `fetch`.
|
|
60
|
+
|
|
61
|
+
Deno is not supported (design 79, D1790): Deno's team is ending the runtime's
|
|
62
|
+
development. The default `fetch` transport uses only standard Web APIs, so the
|
|
63
|
+
SDK may still run on Deno, but we don't test it there or promise it works.
|
|
64
|
+
Moving off Deno? See [Moving from Deno to Bun](https://github.com/ostrium-labs/loams/blob/dev/docs/guides/migrate-deno-to-bun.md). For HTTP/2 gRPC on a server:
|
|
60
65
|
|
|
61
66
|
```ts
|
|
62
67
|
import { Loams, createNodeTransport } from '@loams/client/node';
|
|
@@ -143,6 +148,25 @@ scenario as a program, type-checked in CI. The session's token is used only for
|
|
|
143
148
|
collection and SQL reads: a graph's token names one graph (SDKP-17). Durable
|
|
144
149
|
workflows use the Resonate SDK pointed at `LOAMS_ENDPOINT/durable/` (SDKP-1).
|
|
145
150
|
|
|
151
|
+
## Cloudflare Workers
|
|
152
|
+
|
|
153
|
+
`@loams/client` runs in Cloudflare Workers (workerd) with no `nodejs_compat` flag and no `fetch` override. The
|
|
154
|
+
default transport detects workerd (`navigator.userAgent === "Cloudflare-Workers"`) and sends
|
|
155
|
+
`redirect: "manual"`, because connect-web's default `redirect: "error"` is rejected by Workers. Loams calls never
|
|
156
|
+
redirect, so nothing changes for them. Other runtimes are untouched: in a browser `manual` would hide a redirect
|
|
157
|
+
as an opaque response.
|
|
158
|
+
|
|
159
|
+
```ts
|
|
160
|
+
const loams = new Loams({ endpoint: env.LOAMS_URL, token: env.LOAMS_TOKEN });
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
To control `fetch` yourself (a proxy, a service binding, a test double), pass it through the transport options;
|
|
164
|
+
it is used exactly as given, so set `redirect: "manual"` in it if you also run in workerd:
|
|
165
|
+
|
|
166
|
+
```ts
|
|
167
|
+
new Loams({ endpoint, transportOptions: { fetch: env.GATEWAY.fetch.bind(env.GATEWAY) } });
|
|
168
|
+
```
|
|
169
|
+
|
|
146
170
|
## What is generated and what is hand-written
|
|
147
171
|
|
|
148
172
|
Design §44 §7.3 draws the line, and this SDK follows it exactly.
|
package/dist/index.d.ts
CHANGED
|
@@ -15,5 +15,6 @@ export { paginate, pageFields, type PageFetcher, type PageRequestOptions } from
|
|
|
15
15
|
export { BASE_DELAY_MS, DEFAULT_MAX_RETRIES, MAX_DELAY_MS, MAX_SERVER_DELAY_MS, backoffMs, isRetryableCode, shouldRetry, sleep, } from './runtime/retry.js';
|
|
16
16
|
export { watch, type CursorOf, type ResumeOptions, type StreamOpener } from './runtime/streams.js';
|
|
17
17
|
export { apiKey, envToken, oidcExchange, refreshing, staticToken, type TokenSource, } from './runtime/token-source.js';
|
|
18
|
+
export { JWT_BEARER_GRANT, MACHINE_KEY_ASSERTION_TTL_S, MACHINE_KEY_REFRESH_EARLY_S, machineKey, type MachineKeyFile, type MachineKeyOptions, } from './runtime/machine-key.js';
|
|
18
19
|
export { createLoamsTransport, headersInterceptor, type TransportOptions, } from './runtime/transports.js';
|
|
19
20
|
export { uuidv7, uuidv7Time } from './runtime/uuidv7.js';
|
package/dist/index.js
CHANGED
|
@@ -37,5 +37,6 @@ export { paginate, pageFields } from './runtime/pagination.js';
|
|
|
37
37
|
export { BASE_DELAY_MS, DEFAULT_MAX_RETRIES, MAX_DELAY_MS, MAX_SERVER_DELAY_MS, backoffMs, isRetryableCode, shouldRetry, sleep, } from './runtime/retry.js';
|
|
38
38
|
export { watch } from './runtime/streams.js';
|
|
39
39
|
export { apiKey, envToken, oidcExchange, refreshing, staticToken, } from './runtime/token-source.js';
|
|
40
|
+
export { JWT_BEARER_GRANT, MACHINE_KEY_ASSERTION_TTL_S, MACHINE_KEY_REFRESH_EARLY_S, machineKey, } from './runtime/machine-key.js';
|
|
40
41
|
export { createLoamsTransport, headersInterceptor, } from './runtime/transports.js';
|
|
41
42
|
export { uuidv7, uuidv7Time } from './runtime/uuidv7.js';
|
package/dist/loams.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ export interface LoamsOptions {
|
|
|
22
22
|
auth?: TokenSource | string;
|
|
23
23
|
/**
|
|
24
24
|
* The transport. Defaults to Connect over `fetch` pointed at `endpoint`,
|
|
25
|
-
* which is the browser, Node
|
|
25
|
+
* which is the browser, Node and Bun path (see `runtime/transports.ts`).
|
|
26
26
|
* `@loams/client/node` exports `createNodeTransport` for HTTP/2 gRPC.
|
|
27
27
|
*
|
|
28
28
|
* A transport carries its own base URL, so a transport passed here must be
|
package/dist/loams.js
CHANGED
|
@@ -192,7 +192,7 @@ export class Loams {
|
|
|
192
192
|
this.system.invalidate();
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
|
-
/** The process environment, where there is one (Node,
|
|
195
|
+
/** The process environment, where there is one (Node, Bun); empty in a
|
|
196
196
|
* browser. */
|
|
197
197
|
function readEnvironment() {
|
|
198
198
|
const scope = globalThis;
|
package/dist/node.js
CHANGED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { TokenSource } from './token-source.js';
|
|
2
|
+
/** How long an assertion is valid, in seconds. */
|
|
3
|
+
export declare const MACHINE_KEY_ASSERTION_TTL_S = 300;
|
|
4
|
+
/** How long before expiry a token is traded again, in seconds. */
|
|
5
|
+
export declare const MACHINE_KEY_REFRESH_EARLY_S = 60;
|
|
6
|
+
/** The RFC 7523 grant type. */
|
|
7
|
+
export declare const JWT_BEARER_GRANT = "urn:ietf:params:oauth:grant-type:jwt-bearer";
|
|
8
|
+
/** A machine user's key file, as the identity provider hands it out. */
|
|
9
|
+
export interface MachineKeyFile {
|
|
10
|
+
type?: string;
|
|
11
|
+
keyId: string;
|
|
12
|
+
key: string;
|
|
13
|
+
userId: string;
|
|
14
|
+
}
|
|
15
|
+
export interface MachineKeyOptions {
|
|
16
|
+
/** The key file's JSON text, or the parsed file. */
|
|
17
|
+
keyFile: string | MachineKeyFile;
|
|
18
|
+
/** The identity provider's issuer URL (`https://auth.loams.dev`). */
|
|
19
|
+
issuer: string;
|
|
20
|
+
/** The Loams project's id at the identity provider: the audience Loams checks. */
|
|
21
|
+
project: string;
|
|
22
|
+
/** Injected for tests and for hosts with their own `fetch`. */
|
|
23
|
+
fetch?: typeof globalThis.fetch;
|
|
24
|
+
/** The clock, in milliseconds (tests). */
|
|
25
|
+
now?: () => number;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* An agent's token source from its machine key (module header). The key is checked when the
|
|
29
|
+
* source is built; it is imported into WebCrypto on first use.
|
|
30
|
+
*/
|
|
31
|
+
export declare function machineKey(options: MachineKeyOptions): TokenSource & {
|
|
32
|
+
readonly userId: string;
|
|
33
|
+
};
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
// An agent's token from its identity provider's private-key JWT key (design 76 §10, D1607;
|
|
2
|
+
// plan IA1, IA4 Task 2).
|
|
3
|
+
//
|
|
4
|
+
// An agent is a machine user at the identity provider (Zitadel). Its key file is the JSON the
|
|
5
|
+
// provider hands out once (`{"type": "serviceaccount", "keyId", "key", "userId"}`). The source
|
|
6
|
+
// signs an RFC 7523 assertion (RS256, `kid` = `keyId`, `iss` = `sub` = `userId`, `aud` = the
|
|
7
|
+
// issuer, valid for 5 minutes) with WebCrypto, trades it at `<issuer>/oauth/v2/token` for an
|
|
8
|
+
// access token whose audience is the Loams project
|
|
9
|
+
// (`urn:zitadel:iam:org:project:id:<project>:aud`), caches it, and trades again a minute
|
|
10
|
+
// before it expires or when the server answers `token_expired`. Concurrent callers share one
|
|
11
|
+
// trade. The private key never leaves the process. A sandboxed agent holds no key: agentd
|
|
12
|
+
// vends it a 15-minute token file instead (D1618).
|
|
13
|
+
/** How long an assertion is valid, in seconds. */
|
|
14
|
+
export const MACHINE_KEY_ASSERTION_TTL_S = 300;
|
|
15
|
+
/** How long before expiry a token is traded again, in seconds. */
|
|
16
|
+
export const MACHINE_KEY_REFRESH_EARLY_S = 60;
|
|
17
|
+
/** The RFC 7523 grant type. */
|
|
18
|
+
export const JWT_BEARER_GRANT = 'urn:ietf:params:oauth:grant-type:jwt-bearer';
|
|
19
|
+
const b64url = (bytes) => {
|
|
20
|
+
let text = '';
|
|
21
|
+
for (const b of bytes) {
|
|
22
|
+
text += String.fromCharCode(b);
|
|
23
|
+
}
|
|
24
|
+
return btoa(text).replaceAll('+', '-').replaceAll('/', '_').replace(/=+$/u, '');
|
|
25
|
+
};
|
|
26
|
+
const utf8 = (text) => Uint8Array.from(new TextEncoder().encode(text));
|
|
27
|
+
function derLength(n) {
|
|
28
|
+
if (n < 0x80) {
|
|
29
|
+
return Uint8Array.of(n);
|
|
30
|
+
}
|
|
31
|
+
const out = [];
|
|
32
|
+
for (let v = n; v > 0; v >>= 8) {
|
|
33
|
+
out.unshift(v & 0xff);
|
|
34
|
+
}
|
|
35
|
+
return Uint8Array.of(0x80 | out.length, ...out);
|
|
36
|
+
}
|
|
37
|
+
function der(tag, ...parts) {
|
|
38
|
+
const body = new Uint8Array(parts.reduce((n, p) => n + p.length, 0));
|
|
39
|
+
let at = 0;
|
|
40
|
+
for (const p of parts) {
|
|
41
|
+
body.set(p, at);
|
|
42
|
+
at += p.length;
|
|
43
|
+
}
|
|
44
|
+
const length = derLength(body.length);
|
|
45
|
+
const out = new Uint8Array(1 + length.length + body.length);
|
|
46
|
+
out[0] = tag;
|
|
47
|
+
out.set(length, 1);
|
|
48
|
+
out.set(body, 1 + length.length);
|
|
49
|
+
return out;
|
|
50
|
+
}
|
|
51
|
+
/** PKCS #1 `RSAPrivateKey` wrapped as PKCS #8, which is what WebCrypto imports. */
|
|
52
|
+
function pkcs1ToPkcs8(pkcs1) {
|
|
53
|
+
const version = Uint8Array.of(0x02, 0x01, 0x00);
|
|
54
|
+
// rsaEncryption (1.2.840.113549.1.1.1) with NULL parameters.
|
|
55
|
+
const algorithm = Uint8Array.of(0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00);
|
|
56
|
+
return der(0x30, version, algorithm, der(0x04, pkcs1));
|
|
57
|
+
}
|
|
58
|
+
function pemToPkcs8(pem) {
|
|
59
|
+
const match = /-----BEGIN (RSA )?PRIVATE KEY-----([\s\S]+?)-----END (RSA )?PRIVATE KEY-----/u.exec(pem);
|
|
60
|
+
if (match === null) {
|
|
61
|
+
throw new Error('machineKey: the key is not a PEM private key');
|
|
62
|
+
}
|
|
63
|
+
const bytes = Uint8Array.from(atob((match[2] ?? '').replace(/\s+/gu, '')), (c) => c.charCodeAt(0));
|
|
64
|
+
return match[1] === undefined ? bytes : pkcs1ToPkcs8(bytes);
|
|
65
|
+
}
|
|
66
|
+
function parseKeyFile(keyFile) {
|
|
67
|
+
let file;
|
|
68
|
+
if (typeof keyFile === 'string') {
|
|
69
|
+
try {
|
|
70
|
+
file = JSON.parse(keyFile);
|
|
71
|
+
}
|
|
72
|
+
catch {
|
|
73
|
+
throw new Error('machineKey: not a machine key file');
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
file = keyFile;
|
|
78
|
+
}
|
|
79
|
+
if (file.type !== undefined && file.type !== '' && file.type !== 'serviceaccount') {
|
|
80
|
+
throw new Error(`machineKey: a ${JSON.stringify(file.type)} key is not a machine user's key`);
|
|
81
|
+
}
|
|
82
|
+
if (!file.keyId || !file.userId || !file.key) {
|
|
83
|
+
throw new Error('machineKey: the key file has no keyId, key or userId');
|
|
84
|
+
}
|
|
85
|
+
return file;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* An agent's token source from its machine key (module header). The key is checked when the
|
|
89
|
+
* source is built; it is imported into WebCrypto on first use.
|
|
90
|
+
*/
|
|
91
|
+
export function machineKey(options) {
|
|
92
|
+
const file = parseKeyFile(options.keyFile);
|
|
93
|
+
const issuer = options.issuer.replace(/\/+$/u, '');
|
|
94
|
+
if (!/^https?:\/\/[^/]+/u.test(issuer)) {
|
|
95
|
+
throw new Error(`machineKey: the issuer ${JSON.stringify(issuer)} is not a URL`);
|
|
96
|
+
}
|
|
97
|
+
if (options.project === '') {
|
|
98
|
+
throw new Error('machineKey: the Loams project id (the audience) is empty');
|
|
99
|
+
}
|
|
100
|
+
const pkcs8 = pemToPkcs8(file.key);
|
|
101
|
+
const scope = `openid urn:zitadel:iam:org:project:id:${options.project}:aud`;
|
|
102
|
+
const doFetch = options.fetch ?? globalThis.fetch;
|
|
103
|
+
const now = options.now ?? Date.now;
|
|
104
|
+
let signingKey;
|
|
105
|
+
let cached;
|
|
106
|
+
let inFlight;
|
|
107
|
+
const assertion = async (issuedAtMs) => {
|
|
108
|
+
signingKey ??= globalThis.crypto.subtle.importKey('pkcs8', pkcs8, { name: 'RSASSA-PKCS1-v1_5', hash: 'SHA-256' }, false, ['sign']);
|
|
109
|
+
const iat = Math.floor(issuedAtMs / 1000);
|
|
110
|
+
const header = b64url(utf8(JSON.stringify({ alg: 'RS256', typ: 'JWT', kid: file.keyId })));
|
|
111
|
+
const claims = b64url(utf8(JSON.stringify({
|
|
112
|
+
iss: file.userId,
|
|
113
|
+
sub: file.userId,
|
|
114
|
+
aud: issuer,
|
|
115
|
+
iat,
|
|
116
|
+
exp: iat + MACHINE_KEY_ASSERTION_TTL_S,
|
|
117
|
+
})));
|
|
118
|
+
const signing = `${header}.${claims}`;
|
|
119
|
+
const signature = await globalThis.crypto.subtle.sign('RSASSA-PKCS1-v1_5', await signingKey, utf8(signing));
|
|
120
|
+
return `${signing}.${b64url(new Uint8Array(signature))}`;
|
|
121
|
+
};
|
|
122
|
+
const trade = () => {
|
|
123
|
+
inFlight ??= (async () => {
|
|
124
|
+
const started = now();
|
|
125
|
+
const response = await doFetch(`${issuer}/oauth/v2/token`, {
|
|
126
|
+
method: 'POST',
|
|
127
|
+
headers: { 'content-type': 'application/x-www-form-urlencoded' },
|
|
128
|
+
body: new URLSearchParams({
|
|
129
|
+
grant_type: JWT_BEARER_GRANT,
|
|
130
|
+
scope,
|
|
131
|
+
assertion: await assertion(started),
|
|
132
|
+
}).toString(),
|
|
133
|
+
});
|
|
134
|
+
if (!response.ok) {
|
|
135
|
+
const text = (await response.text()).slice(0, 512);
|
|
136
|
+
throw new Error(`the token endpoint refused the machine key (${response.status}): ${text}`);
|
|
137
|
+
}
|
|
138
|
+
const body = (await response.json());
|
|
139
|
+
if (!body.access_token) {
|
|
140
|
+
throw new Error('the token endpoint answered no access_token');
|
|
141
|
+
}
|
|
142
|
+
const life = body.expires_in ?? 900;
|
|
143
|
+
const early = Math.min(MACHINE_KEY_REFRESH_EARLY_S, life / 2);
|
|
144
|
+
cached = { token: body.access_token, refreshAt: started + (life - early) * 1000 };
|
|
145
|
+
return body.access_token;
|
|
146
|
+
})()
|
|
147
|
+
.catch((error) => {
|
|
148
|
+
cached = undefined;
|
|
149
|
+
throw error;
|
|
150
|
+
})
|
|
151
|
+
.finally(() => {
|
|
152
|
+
inFlight = undefined;
|
|
153
|
+
});
|
|
154
|
+
return inFlight;
|
|
155
|
+
};
|
|
156
|
+
return {
|
|
157
|
+
userId: file.userId,
|
|
158
|
+
token: async () => {
|
|
159
|
+
if (cached !== undefined && now() < cached.refreshAt) {
|
|
160
|
+
return cached.token;
|
|
161
|
+
}
|
|
162
|
+
try {
|
|
163
|
+
return await trade();
|
|
164
|
+
}
|
|
165
|
+
catch {
|
|
166
|
+
// A failed trade sends no credential; `refresh()` reports the reason.
|
|
167
|
+
return undefined;
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
refresh: async () => {
|
|
171
|
+
await trade();
|
|
172
|
+
},
|
|
173
|
+
};
|
|
174
|
+
}
|
|
@@ -32,7 +32,7 @@ export declare function envToken(environment?: Record<string, string | undefined
|
|
|
32
32
|
* rather than one per request.
|
|
33
33
|
*/
|
|
34
34
|
export declare function refreshing(fetchToken: () => Promise<string>): TokenSource;
|
|
35
|
-
/** The RFC 8693 token exchange a person signed in
|
|
35
|
+
/** The RFC 8693 token exchange a person signed in at the IdP needs
|
|
36
36
|
* (design §44 §7.4, D608; §19 §5.2).
|
|
37
37
|
*
|
|
38
38
|
* The instance's `/oauth/token` protocol endpoint takes the identity token and
|
|
@@ -64,7 +64,7 @@ export function refreshing(fetchToken) {
|
|
|
64
64
|
};
|
|
65
65
|
return source;
|
|
66
66
|
}
|
|
67
|
-
/** The RFC 8693 token exchange a person signed in
|
|
67
|
+
/** The RFC 8693 token exchange a person signed in at the IdP needs
|
|
68
68
|
* (design §44 §7.4, D608; §19 §5.2).
|
|
69
69
|
*
|
|
70
70
|
* The instance's `/oauth/token` protocol endpoint takes the identity token and
|
|
@@ -33,11 +33,32 @@ export interface TransportOptions {
|
|
|
33
33
|
* it; this only tells the transport what the request will look like.
|
|
34
34
|
*/
|
|
35
35
|
interceptors?: Parameters<typeof createConnectTransport>[0]['interceptors'];
|
|
36
|
+
/**
|
|
37
|
+
* The `fetch` the transport calls, for a runtime whose `fetch` needs
|
|
38
|
+
* wrapping (a proxy, a test double, instrumentation). When set it is used
|
|
39
|
+
* as given. When unset, the global `fetch` is used, wrapped to send
|
|
40
|
+
* `redirect: "manual"` in Cloudflare Workers (see `workersFetch`).
|
|
41
|
+
*/
|
|
42
|
+
fetch?: typeof globalThis.fetch;
|
|
36
43
|
}
|
|
44
|
+
/** True in Cloudflare Workers (workerd), which identifies itself this way. */
|
|
45
|
+
export declare function isWorkerd(): boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Wraps `fetch` to send `redirect: "manual"`.
|
|
48
|
+
*
|
|
49
|
+
* connect-web sets `redirect: "error"` on every request, which Workers rejects
|
|
50
|
+
* ("Invalid redirect value, must be one of 'follow' or 'manual'"). Loams calls
|
|
51
|
+
* never redirect, so `manual` loses nothing there; it is applied only in
|
|
52
|
+
* workerd because in a browser `manual` turns a redirect into an opaque
|
|
53
|
+
* response that hides the failure `error` reports.
|
|
54
|
+
*/
|
|
55
|
+
export declare function workersFetch(inner: typeof globalThis.fetch): typeof globalThis.fetch;
|
|
56
|
+
/** The `fetch` a transport built from `options` uses, or undefined for connect-web's default. */
|
|
57
|
+
export declare function transportFetch(options: TransportOptions): typeof globalThis.fetch | undefined;
|
|
37
58
|
/**
|
|
38
59
|
* The default transport: Connect over `fetch`.
|
|
39
60
|
*
|
|
40
|
-
* Works in a browser, in Node 18+ (which has `fetch`)
|
|
61
|
+
* Works in a browser, in Node 18+ (which has `fetch`) and in Bun, and
|
|
41
62
|
* speaks both the Connect unary protocol and gRPC-Web, which is what the server
|
|
42
63
|
* serves on the same port (D600). This is the browser path as a first-class
|
|
43
64
|
* case, not a fallback: it is the default in every runtime.
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
// over `fetch`, which is what `@connectrpc/connect-web` implements. Because
|
|
8
8
|
// the API serves gRPC-Web on the same port as everything else, the same
|
|
9
9
|
// client code runs in a browser with no proxy and no sidecar.
|
|
10
|
-
// - **Node
|
|
10
|
+
// - **Node and Bun** can do HTTP/2 gRPC. `@connectrpc/connect-node`
|
|
11
11
|
// implements it over `node:http2`, and the server's plaintext listener means
|
|
12
12
|
// no ALPN to negotiate — the client asks for HTTP/2 with prior knowledge.
|
|
13
13
|
//
|
|
@@ -17,22 +17,48 @@
|
|
|
17
17
|
// HTTP/2 transport in a browser bundle would be a build error, which is the
|
|
18
18
|
// right failure.
|
|
19
19
|
import { createConnectTransport } from '@connectrpc/connect-web';
|
|
20
|
+
/** True in Cloudflare Workers (workerd), which identifies itself this way. */
|
|
21
|
+
export function isWorkerd() {
|
|
22
|
+
return typeof navigator !== 'undefined' && navigator.userAgent === 'Cloudflare-Workers';
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Wraps `fetch` to send `redirect: "manual"`.
|
|
26
|
+
*
|
|
27
|
+
* connect-web sets `redirect: "error"` on every request, which Workers rejects
|
|
28
|
+
* ("Invalid redirect value, must be one of 'follow' or 'manual'"). Loams calls
|
|
29
|
+
* never redirect, so `manual` loses nothing there; it is applied only in
|
|
30
|
+
* workerd because in a browser `manual` turns a redirect into an opaque
|
|
31
|
+
* response that hides the failure `error` reports.
|
|
32
|
+
*/
|
|
33
|
+
export function workersFetch(inner) {
|
|
34
|
+
return (input, init) => inner(input, init === undefined ? init : { ...init, redirect: 'manual' });
|
|
35
|
+
}
|
|
36
|
+
/** The `fetch` a transport built from `options` uses, or undefined for connect-web's default. */
|
|
37
|
+
export function transportFetch(options) {
|
|
38
|
+
if (options.fetch !== undefined) {
|
|
39
|
+
return options.fetch;
|
|
40
|
+
}
|
|
41
|
+
// Resolve the global lazily so a later polyfill or test stub is honoured.
|
|
42
|
+
return isWorkerd() ? workersFetch((input, init) => globalThis.fetch(input, init)) : undefined;
|
|
43
|
+
}
|
|
20
44
|
/**
|
|
21
45
|
* The default transport: Connect over `fetch`.
|
|
22
46
|
*
|
|
23
|
-
* Works in a browser, in Node 18+ (which has `fetch`)
|
|
47
|
+
* Works in a browser, in Node 18+ (which has `fetch`) and in Bun, and
|
|
24
48
|
* speaks both the Connect unary protocol and gRPC-Web, which is what the server
|
|
25
49
|
* serves on the same port (D600). This is the browser path as a first-class
|
|
26
50
|
* case, not a fallback: it is the default in every runtime.
|
|
27
51
|
*/
|
|
28
52
|
export function createLoamsTransport(options = {}) {
|
|
29
53
|
const interceptors = transportInterceptors(options);
|
|
54
|
+
const fetchImpl = transportFetch(options);
|
|
30
55
|
return createConnectTransport({
|
|
31
56
|
baseUrl: options.baseUrl ?? '',
|
|
32
57
|
useBinaryFormat: options.useBinaryFormat ?? true,
|
|
33
58
|
...(options.defaultTimeoutMs === undefined
|
|
34
59
|
? {}
|
|
35
60
|
: { defaultTimeoutMs: options.defaultTimeoutMs }),
|
|
61
|
+
...(fetchImpl === undefined ? {} : { fetch: fetchImpl }),
|
|
36
62
|
...(interceptors.length === 0 ? {} : { interceptors }),
|
|
37
63
|
});
|
|
38
64
|
}
|
|
@@ -110,7 +110,8 @@ export declare const ListProvidersResponseSchema: GenMessage<ListProvidersRespon
|
|
|
110
110
|
*/
|
|
111
111
|
export type CompleteSetupRequest = Message<"loams.auth.v1.CompleteSetupRequest"> & {
|
|
112
112
|
/**
|
|
113
|
-
*
|
|
113
|
+
* This engine's LOAMS_SETUP_TOKEN. Required when authentication is on;
|
|
114
|
+
* ignored with LOAMS_AUTH_MODE=off.
|
|
114
115
|
*
|
|
115
116
|
* @generated from field: string setup_token = 1;
|
|
116
117
|
*/
|
|
@@ -333,7 +334,11 @@ export declare enum OidcProviderKind {
|
|
|
333
334
|
/**
|
|
334
335
|
* @generated from enum value: OIDC_PROVIDER_KIND_GENERIC = 7;
|
|
335
336
|
*/
|
|
336
|
-
GENERIC = 7
|
|
337
|
+
GENERIC = 7,
|
|
338
|
+
/**
|
|
339
|
+
* @generated from enum value: OIDC_PROVIDER_KIND_ZITADEL = 8;
|
|
340
|
+
*/
|
|
341
|
+
ZITADEL = 8
|
|
337
342
|
}
|
|
338
343
|
/**
|
|
339
344
|
* Describes the enum loams.auth.v1.OidcProviderKind.
|
|
@@ -9,7 +9,7 @@ import { file_loams_options_v1_options } from "../../options/v1/options_pb.js";
|
|
|
9
9
|
/**
|
|
10
10
|
* Describes the file loams/auth/v1/auth.proto.
|
|
11
11
|
*/
|
|
12
|
-
export const file_loams_auth_v1_auth = /*@__PURE__*/ fileDesc("
|
|
12
|
+
export const file_loams_auth_v1_auth = /*@__PURE__*/ fileDesc("Chhsb2Ftcy9hdXRoL3YxL2F1dGgucHJvdG8SDWxvYW1zLmF1dGgudjEiVwoMT2lkY1Byb3ZpZGVyEgoKAmlkGAEgASgJEgwKBG5hbWUYAiABKAkSLQoEa2luZBgDIAEoDjIfLmxvYW1zLmF1dGgudjEuT2lkY1Byb3ZpZGVyS2luZCK6AQoHU2Vzc2lvbhIiCgR1c2VyGAEgASgLMhQubG9hbXMuYWRtaW4udjEuVXNlchIgCgNvcmcYAiABKAsyEy5sb2Ftcy5hZG1pbi52MS5PcmcSJQoEcm9sZRgDIAEoDjIXLmxvYW1zLmFkbWluLnYxLk9yZ1JvbGUSEgoKY3NyZl90b2tlbhgEIAEoCRIuCgple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MS5HZXRTZXNzaW9uUmVzcG9uc2UiE5ACAZK1GAwSCmdldFNlc3Npb24SbwoNQ3JlYXRlU2Vzc2lvbhIjLmxvYW1zLmF1dGgudjEuQ3JlYXRlU2Vzc2lvblJlcXVlc3QaJC5sb2Ftcy5hdXRoLnYxLkNyZWF0ZVNlc3Npb25SZXNwb25zZSITkrUYDxINY3JlYXRlU2Vzc2lvbhJyCg1EZWxldGVTZXNzaW9uEiMubG9hbXMuYXV0aC52MS5EZWxldGVTZXNzaW9uUmVxdWVzdBokLmxvYW1zLmF1dGgudjEuRGVsZXRlU2Vzc2lvblJlc3BvbnNlIhaQAgKStRgPEg1kZWxldGVTZXNzaW9uEm8KDURlY2lkZUNvbnNlbnQSIy5sb2Ftcy5hdXRoLnYxLkRlY2lkZUNvbnNlbnRSZXF1ZXN0GiQubG9hbXMuYXV0aC52MS5EZWNpZGVDb25zZW50UmVzcG9uc2UiE5K1GA8SDWRlY2lkZUNvbnNlbnQaS4q1GEcKBGF1dGgSP1NpZ24taW4gcHJvdmlkZXJzLCBmaXJzdC1ydW4gc2V0dXAsIHNlc3Npb25zIGFuZCBPQXV0aCBjb25zZW50LmIGcHJvdG8z", [file_google_protobuf_timestamp, file_loams_admin_v1_common, file_loams_admin_v1_org, file_loams_options_v1_options]);
|
|
13
13
|
/**
|
|
14
14
|
* Describes the message loams.auth.v1.OidcProvider.
|
|
15
15
|
* Use `create(OidcProviderSchema)` to create a new message.
|
|
@@ -119,6 +119,10 @@ export var OidcProviderKind;
|
|
|
119
119
|
* @generated from enum value: OIDC_PROVIDER_KIND_GENERIC = 7;
|
|
120
120
|
*/
|
|
121
121
|
OidcProviderKind[OidcProviderKind["GENERIC"] = 7] = "GENERIC";
|
|
122
|
+
/**
|
|
123
|
+
* @generated from enum value: OIDC_PROVIDER_KIND_ZITADEL = 8;
|
|
124
|
+
*/
|
|
125
|
+
OidcProviderKind[OidcProviderKind["ZITADEL"] = 8] = "ZITADEL";
|
|
122
126
|
})(OidcProviderKind || (OidcProviderKind = {}));
|
|
123
127
|
/**
|
|
124
128
|
* Describes the enum loams.auth.v1.OidcProviderKind.
|
|
@@ -71,7 +71,8 @@ export type GetInstanceResponse = Message<"loams.instance.v1.GetInstanceResponse
|
|
|
71
71
|
*/
|
|
72
72
|
jwksUri: string;
|
|
73
73
|
/**
|
|
74
|
-
* How people sign in
|
|
74
|
+
* How people sign in: the instance's OIDC issuer (Zitadel, design §76), a
|
|
75
|
+
* pairing code, or none (§37 §6.5).
|
|
75
76
|
*
|
|
76
77
|
* @generated from field: repeated loams.instance.v1.SignInMethod sign_in_methods = 9;
|
|
77
78
|
*/
|
|
@@ -183,7 +184,7 @@ export type SignInMethod = Message<"loams.instance.v1.SignInMethod"> & {
|
|
|
183
184
|
*/
|
|
184
185
|
kind: SignInKind;
|
|
185
186
|
/**
|
|
186
|
-
* The OIDC issuer for
|
|
187
|
+
* The OIDC issuer for SIGN_IN_KIND_OIDC and SIGN_IN_KIND_OIDC_DEVICE_CODE.
|
|
187
188
|
*
|
|
188
189
|
* @generated from field: string issuer = 2;
|
|
189
190
|
*/
|
|
@@ -427,15 +428,18 @@ export declare enum SignInKind {
|
|
|
427
428
|
*/
|
|
428
429
|
NONE = 1,
|
|
429
430
|
/**
|
|
430
|
-
*
|
|
431
|
+
* Deprecated: use SIGN_IN_KIND_OIDC (D1619). Kept so the wire value still
|
|
432
|
+
* decodes; no server sends it.
|
|
431
433
|
*
|
|
432
|
-
* @generated from enum value: SIGN_IN_KIND_AUTHENTIK = 2;
|
|
434
|
+
* @generated from enum value: SIGN_IN_KIND_AUTHENTIK = 2 [deprecated = true];
|
|
435
|
+
* @deprecated
|
|
433
436
|
*/
|
|
434
437
|
AUTHENTIK = 2,
|
|
435
438
|
/**
|
|
436
|
-
*
|
|
439
|
+
* Deprecated: use SIGN_IN_KIND_OIDC_DEVICE_CODE (D1619).
|
|
437
440
|
*
|
|
438
|
-
* @generated from enum value: SIGN_IN_KIND_AUTHENTIK_DEVICE_CODE = 3;
|
|
441
|
+
* @generated from enum value: SIGN_IN_KIND_AUTHENTIK_DEVICE_CODE = 3 [deprecated = true];
|
|
442
|
+
* @deprecated
|
|
439
443
|
*/
|
|
440
444
|
AUTHENTIK_DEVICE_CODE = 3,
|
|
441
445
|
/**
|
|
@@ -443,7 +447,19 @@ export declare enum SignInKind {
|
|
|
443
447
|
*
|
|
444
448
|
* @generated from enum value: SIGN_IN_KIND_PAIRING = 4;
|
|
445
449
|
*/
|
|
446
|
-
PAIRING = 4
|
|
450
|
+
PAIRING = 4,
|
|
451
|
+
/**
|
|
452
|
+
* OIDC authorization code + PKCE at the instance's issuer (design §76).
|
|
453
|
+
*
|
|
454
|
+
* @generated from enum value: SIGN_IN_KIND_OIDC = 5;
|
|
455
|
+
*/
|
|
456
|
+
OIDC = 5,
|
|
457
|
+
/**
|
|
458
|
+
* The issuer's device authorization flow (RFC 8628).
|
|
459
|
+
*
|
|
460
|
+
* @generated from enum value: SIGN_IN_KIND_OIDC_DEVICE_CODE = 6;
|
|
461
|
+
*/
|
|
462
|
+
OIDC_DEVICE_CODE = 6
|
|
447
463
|
}
|
|
448
464
|
/**
|
|
449
465
|
* Describes the enum loams.instance.v1.SignInKind.
|
|
@@ -18,7 +18,7 @@ import { file_loams_options_v1_options } from "../../options/v1/options_pb.js";
|
|
|
18
18
|
/**
|
|
19
19
|
* Describes the file loams/instance/v1/instance.proto.
|
|
20
20
|
*/
|
|
21
|
-
export const file_loams_instance_v1_instance = /*@__PURE__*/ fileDesc("
|
|
21
|
+
export const file_loams_instance_v1_instance = /*@__PURE__*/ fileDesc("CiBsb2Ftcy9pbnN0YW5jZS92MS9pbnN0YW5jZS5wcm90bxIRbG9hbXMuaW5zdGFuY2UudjEiFAoSR2V0SW5zdGFuY2VSZXF1ZXN0IpYFChNHZXRJbnN0YW5jZVJlc3BvbnNlEhMKC2luc3RhbmNlX2lkGAEgASgJEgwKBG5hbWUYAiABKAkSKwoHZWRpdGlvbhgDIAEoDjIaLmxvYW1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JVElPTl9PU1MQARIRCg1FRElUSU9OX0NMT1VEEAISEAoMRURJVElPTl9CWU9DEAMq4QEKClNpZ25JbktpbmQSHAoYU0lHTl9JTl9LSU5EX1VOU1BFQ0lGSUVEEAASFQoRU0lHTl9JTl9LSU5EX05PTkUQARIeChZTSUdOX0lOX0tJTkRfQVVUSEVOVElLEAIaAggBEioKIlNJR05fSU5fS0lORF9BVVRIRU5USUtfREVWSUNFX0NPREUQAxoCCAESGAoUU0lHTl9JTl9LSU5EX1BBSVJJTkcQBBIVChFTSUdOX0lOX0tJTkRfT0lEQxAFEiEKHVNJR05fSU5fS0lORF9PSURDX0RFVklDRV9DT0RFEAYqhgEKDVByaW5jaXBhbEtpbmQSHgoaUFJJTkNJUEFMX0tJTkRfVU5TUEVDSUZJRUQQABIXChNQUklOQ0lQQUxfS0lORF9VU0VSEAESIgoeUFJJTkNJUEFMX0tJTkRfU0VSVklDRV9BQ0NPVU5UEAISGAoUUFJJTkNJUEFMX0tJTkRfQUdFTlQQAzKqAgoPSW5zdGFuY2VTZXJ2aWNlEnIKC0dldEluc3RhbmNlEiUubG9hbXMuaW5zdGFuY2UudjEuR2V0SW5zdGFuY2VSZXF1ZXN0GiYubG9hbXMuaW5zdGFuY2UudjEuR2V0SW5zdGFuY2VSZXNwb25zZSIUkAIBkrUYDRILZ2V0SW5zdGFuY2USXgoGV2hvQW1JEiAubG9hbXMuaW5zdGFuY2UudjEuV2hvQW1JUmVxdWVzdBohLmxvYW1zLmluc3RhbmNlLnYxLldob0FtSVJlc3BvbnNlIg+QAgGStRgIEgZ3aG9BbUkaQ4q1GD8KCGluc3RhbmNlEjNXaGF0IHRoaXMgaW5zdGFuY2UgaXMsIGFuZCB3aG8gdGhlIGNhbGxlciBpcyBvbiBpdC5iBnByb3RvMw", [file_google_protobuf_timestamp, file_loams_options_v1_options]);
|
|
22
22
|
/**
|
|
23
23
|
* Describes the message loams.instance.v1.GetInstanceRequest.
|
|
24
24
|
* Use `create(GetInstanceRequestSchema)` to create a new message.
|
|
@@ -116,15 +116,18 @@ export var SignInKind;
|
|
|
116
116
|
*/
|
|
117
117
|
SignInKind[SignInKind["NONE"] = 1] = "NONE";
|
|
118
118
|
/**
|
|
119
|
-
*
|
|
119
|
+
* Deprecated: use SIGN_IN_KIND_OIDC (D1619). Kept so the wire value still
|
|
120
|
+
* decodes; no server sends it.
|
|
120
121
|
*
|
|
121
|
-
* @generated from enum value: SIGN_IN_KIND_AUTHENTIK = 2;
|
|
122
|
+
* @generated from enum value: SIGN_IN_KIND_AUTHENTIK = 2 [deprecated = true];
|
|
123
|
+
* @deprecated
|
|
122
124
|
*/
|
|
123
125
|
SignInKind[SignInKind["AUTHENTIK"] = 2] = "AUTHENTIK";
|
|
124
126
|
/**
|
|
125
|
-
*
|
|
127
|
+
* Deprecated: use SIGN_IN_KIND_OIDC_DEVICE_CODE (D1619).
|
|
126
128
|
*
|
|
127
|
-
* @generated from enum value: SIGN_IN_KIND_AUTHENTIK_DEVICE_CODE = 3;
|
|
129
|
+
* @generated from enum value: SIGN_IN_KIND_AUTHENTIK_DEVICE_CODE = 3 [deprecated = true];
|
|
130
|
+
* @deprecated
|
|
128
131
|
*/
|
|
129
132
|
SignInKind[SignInKind["AUTHENTIK_DEVICE_CODE"] = 3] = "AUTHENTIK_DEVICE_CODE";
|
|
130
133
|
/**
|
|
@@ -133,6 +136,18 @@ export var SignInKind;
|
|
|
133
136
|
* @generated from enum value: SIGN_IN_KIND_PAIRING = 4;
|
|
134
137
|
*/
|
|
135
138
|
SignInKind[SignInKind["PAIRING"] = 4] = "PAIRING";
|
|
139
|
+
/**
|
|
140
|
+
* OIDC authorization code + PKCE at the instance's issuer (design §76).
|
|
141
|
+
*
|
|
142
|
+
* @generated from enum value: SIGN_IN_KIND_OIDC = 5;
|
|
143
|
+
*/
|
|
144
|
+
SignInKind[SignInKind["OIDC"] = 5] = "OIDC";
|
|
145
|
+
/**
|
|
146
|
+
* The issuer's device authorization flow (RFC 8628).
|
|
147
|
+
*
|
|
148
|
+
* @generated from enum value: SIGN_IN_KIND_OIDC_DEVICE_CODE = 6;
|
|
149
|
+
*/
|
|
150
|
+
SignInKind[SignInKind["OIDC_DEVICE_CODE"] = 6] = "OIDC_DEVICE_CODE";
|
|
136
151
|
})(SignInKind || (SignInKind = {}));
|
|
137
152
|
/**
|
|
138
153
|
* Describes the enum loams.instance.v1.SignInKind.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loams/client",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "The Loams SDK for TypeScript and JavaScript: one Loams object with namespaced modules over the unified Connect API, generated from proto/.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://github.com/ostrium-labs/loams/tree/dev/sdks/typescript",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@connectrpc/connect": "2.2.0",
|
|
44
44
|
"@connectrpc/connect-node": "2.2.0",
|
|
45
45
|
"@connectrpc/connect-web": "2.2.0",
|
|
46
|
-
"@loams/live": "0.1.
|
|
46
|
+
"@loams/live": "0.1.2"
|
|
47
47
|
},
|
|
48
48
|
"publishConfig": {
|
|
49
49
|
"access": "public"
|