@w6w/sdk 0.9.15 → 0.9.16
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 +21 -16
- package/dist/mod.d.ts +1 -1
- package/dist/mod.d.ts.map +1 -1
- package/dist/mod.js +1 -1
- package/dist/mod.js.map +1 -1
- package/dist/src/client.d.ts +3 -3
- package/dist/src/client.js +3 -3
- package/dist/src/config.d.ts +14 -8
- package/dist/src/config.d.ts.map +1 -1
- package/dist/src/config.js +15 -9
- package/dist/src/config.js.map +1 -1
- package/dist/src/errors.d.ts +2 -2
- package/dist/src/errors.js +2 -2
- package/dist/src/server/mod.d.ts +11 -10
- package/dist/src/server/mod.d.ts.map +1 -1
- package/dist/src/server/mod.js +11 -9
- package/dist/src/server/mod.js.map +1 -1
- package/dist/src/version.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ The package is authored as runtime-neutral TypeScript against Web standards (`fe
|
|
|
10
10
|
`URL`, `AbortController`), so the same build runs under Node 18+, Deno and Bun.
|
|
11
11
|
|
|
12
12
|
- **License:** MIT (see [LICENSE](./LICENSE)).
|
|
13
|
-
- **Version:** `0.9.
|
|
13
|
+
- **Version:** `0.9.16`.
|
|
14
14
|
- **Guides:** [docs.w6w.io/clients/node](https://docs.w6w.io/clients/node/), with a
|
|
15
15
|
[full reference](https://docs.w6w.io/clients/node/reference/).
|
|
16
16
|
|
|
@@ -37,7 +37,7 @@ means the same set of operations in every language.
|
|
|
37
37
|
```ts
|
|
38
38
|
import { isActionRun, isFunctionRun, isWorkflowRun, W6WClient } from "@w6w/sdk";
|
|
39
39
|
|
|
40
|
-
const client = new W6WClient(); //
|
|
40
|
+
const client = new W6WClient(); // W6W_BASE_URL (default https://api.w6w.io) and W6W_TOKEN
|
|
41
41
|
|
|
42
42
|
// Who am I? (`me.versions.wrapper` is this SDK's version.)
|
|
43
43
|
const me = await client.me();
|
|
@@ -166,15 +166,16 @@ Every call also takes an `AbortSignal` as `signal`; an aborted call raises `ApiE
|
|
|
166
166
|
|
|
167
167
|
Two environment variables, both read only at client construction:
|
|
168
168
|
|
|
169
|
-
| Variable | Meaning
|
|
170
|
-
| -------------- |
|
|
171
|
-
| `W6W_BASE_URL` | The **origin** of your w6w server, e.g. `https://api.example.com`. The API is served at the root of that host, so nothing is appended. |
|
|
172
|
-
| `W6W_TOKEN` | The bearer token, sent as `Authorization: Bearer <token>` on every request.
|
|
169
|
+
| Variable | Meaning | Required |
|
|
170
|
+
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------- |
|
|
171
|
+
| `W6W_BASE_URL` | The **origin** of your w6w server, e.g. `https://api.example.com`. The API is served at the root of that host, so nothing is appended. Defaults to `https://api.w6w.io`. | No |
|
|
172
|
+
| `W6W_TOKEN` | The bearer token, sent as `Authorization: Bearer <token>` on every request. | Yes |
|
|
173
173
|
|
|
174
174
|
Explicit constructor arguments always win over the environment, and credentials are **instance
|
|
175
175
|
state**: two clients in one process can hold different tokens and point at different servers with no
|
|
176
|
-
interference.
|
|
177
|
-
|
|
176
|
+
interference. The base URL resolves as explicit `baseUrl`, then `W6W_BASE_URL`, then the default
|
|
177
|
+
`https://api.w6w.io` (exported as `DEFAULT_BASE_URL`) — so a client built without either talks to
|
|
178
|
+
w6w's own API.
|
|
178
179
|
|
|
179
180
|
```ts
|
|
180
181
|
import { W6WClient } from "@w6w/sdk";
|
|
@@ -250,10 +251,10 @@ preserved verbatim, because it is indistinguishable from a real gateway prefix:
|
|
|
250
251
|
> deployment behind a gateway prefix is addressed, and silently removing it would break those.
|
|
251
252
|
|
|
252
253
|
A variable that is **set but empty** — or whitespace-only — counts as **unset**, in both variables.
|
|
253
|
-
`W6W_BASE_URL=` is how a shell or a Dockerfile spells "I meant to set this and did not", so it
|
|
254
|
-
|
|
255
|
-
An empty string passed _explicitly_ to the constructor is
|
|
256
|
-
to the environment.
|
|
254
|
+
`W6W_BASE_URL=` is how a shell or a Dockerfile spells "I meant to set this and did not", so it falls
|
|
255
|
+
through to the default `https://api.w6w.io`, exactly like an unset one, rather than quietly
|
|
256
|
+
producing a relative URL. An empty string passed _explicitly_ to the constructor is different: it is
|
|
257
|
+
an error, and falls back neither to the environment nor to the default.
|
|
257
258
|
|
|
258
259
|
### `W6W_TOKEN`
|
|
259
260
|
|
|
@@ -269,7 +270,7 @@ the environment.
|
|
|
269
270
|
|
|
270
271
|
Two error types, and the difference between them is diagnostic:
|
|
271
272
|
|
|
272
|
-
- **`ConfigError`** — the client never got as far as a request:
|
|
273
|
+
- **`ConfigError`** — the client never got as far as a request: a malformed base URL, or no token.
|
|
273
274
|
- **`ApiError`** — carries `status`, `code`, `message` and `raw` (the parsed response body, kept
|
|
274
275
|
because an error body carries fields the message drops). It covers exactly three cases: a
|
|
275
276
|
transport failure (`status: 0`, code `network_error`), a non-JSON body on a failing status (code
|
|
@@ -295,7 +296,10 @@ route and walkthrough are in [Embed w6w in your product](https://docs.w6w.io/gui
|
|
|
295
296
|
import { createEmbedSessionClient } from "@w6w/sdk/server";
|
|
296
297
|
|
|
297
298
|
const sessions = createEmbedSessionClient({
|
|
298
|
-
|
|
299
|
+
// Optional: defaults to https://api.w6w.io. Self-hosted? Pass your API origin: when omitted, the
|
|
300
|
+
// tenant client credentials are sent to https://api.w6w.io. This factory never reads W6W_BASE_URL itself;
|
|
301
|
+
// `|| undefined` keeps a blank variable from reaching it as an explicit "" (a ConfigError).
|
|
302
|
+
baseUrl: process.env.W6W_BASE_URL || undefined,
|
|
299
303
|
clientId: process.env.W6W_TENANT_CLIENT_ID!,
|
|
300
304
|
clientSecret: process.env.W6W_TENANT_CLIENT_SECRET!, // never sent to the browser
|
|
301
305
|
});
|
|
@@ -308,7 +312,8 @@ const { token, expiresAt, account } = await sessions.create({ subject: userId, a
|
|
|
308
312
|
`account` is the server's resolved `acct_…` id. The factory throws in a browser-like runtime.
|
|
309
313
|
|
|
310
314
|
The lower-level `exchangeToken`, with an optional `account`, stays available from the same entry
|
|
311
|
-
point
|
|
315
|
+
point. **Self-hosted deployments must pass `baseUrl` explicitly; when omitted, the helper sends the
|
|
316
|
+
tenant client credentials to `https://api.w6w.io`** (neither helper reads `W6W_BASE_URL`):
|
|
312
317
|
|
|
313
318
|
```ts
|
|
314
319
|
import { exchangeToken } from "@w6w/sdk/server";
|
|
@@ -330,7 +335,7 @@ app.post("/api/w6w-token", async (req, res) => {
|
|
|
330
335
|
const account = await yourOwnMembershipLookup(session.userId);
|
|
331
336
|
|
|
332
337
|
const { token, expiresIn } = await exchangeToken({
|
|
333
|
-
baseUrl: process.env.W6W_BASE_URL
|
|
338
|
+
baseUrl: process.env.W6W_BASE_URL || undefined, // optional; defaults to https://api.w6w.io, never read from env
|
|
334
339
|
clientId: process.env.W6W_TENANT_CLIENT_ID!,
|
|
335
340
|
clientSecret: process.env.W6W_TENANT_CLIENT_SECRET!, // never sent to the browser
|
|
336
341
|
subject: session.userId,
|
package/dist/mod.d.ts
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
export { VERSION } from "./src/version.ts";
|
|
18
18
|
export { W6WClient } from "./src/client.ts";
|
|
19
19
|
export { ApiError, ConfigError } from "./src/errors.ts";
|
|
20
|
-
export { BASE_PATH, type FetchLike, joinBaseUrl, type ResolvedConfig, type TokenProvider, type W6WClientOptions, } from "./src/config.ts";
|
|
20
|
+
export { BASE_PATH, DEFAULT_BASE_URL, type FetchLike, joinBaseUrl, type ResolvedConfig, type TokenProvider, type W6WClientOptions, } from "./src/config.ts";
|
|
21
21
|
export type { CallOptions, HttpMethod, HttpResponse, QueryParams, RequestOptions, } from "./src/http.ts";
|
|
22
22
|
export { path } from "./src/http.ts";
|
|
23
23
|
export { DocumentsApi } from "./src/documents.ts";
|
package/dist/mod.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG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C;AACxC,YAAY,EACV,QAAQ,EACR,UAAU,EACV,eAAe,EACf,kBAAkB,EAClB,UAAU,GACX,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,yBAAyB,EACzB,kBAAkB,EAClB,aAAa,EACb,oBAAoB,GACrB,MAAM,oBAAoB,CAAC;AAK5B,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAOtD,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEhG,YAAY,EACV,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,GAAG,EACH,SAAS,EACT,mBAAmB,EACnB,eAAe,EACf,eAAe,EACf,EAAE,EACF,WAAW,EACX,SAAS,EACT,SAAS,EACT,SAAS,EACT,kBAAkB,EAClB,GAAG,EACH,OAAO,EACP,mBAAmB,EACnB,cAAc,EACd,eAAe,GAChB,MAAM,gBAAgB,CAAC"}
|
package/dist/mod.js
CHANGED
|
@@ -18,7 +18,7 @@ export { VERSION } from "./src/version.js";
|
|
|
18
18
|
// Transport core (T2.1.2): the client, its configuration and the error model.
|
|
19
19
|
export { W6WClient } from "./src/client.js";
|
|
20
20
|
export { ApiError, ConfigError } from "./src/errors.js";
|
|
21
|
-
export { BASE_PATH, joinBaseUrl, } from "./src/config.js";
|
|
21
|
+
export { BASE_PATH, DEFAULT_BASE_URL, joinBaseUrl, } from "./src/config.js";
|
|
22
22
|
// Exported because `W6WClient.request` is public: a host reaching an endpoint
|
|
23
23
|
// this version does not model yet must have the same encoding-at-interpolation
|
|
24
24
|
// tag the operation modules use, or it will concatenate a caller value into a
|
package/dist/mod.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mod.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AW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAetD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAmBlD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAoBxC,+EAA+E;AAC/E,+EAA+E;AAC/E,mDAAmD;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAGtC,+EAA+E;AAC/E,8EAA8E;AAC9E,gFAAgF;AAChF,uEAAuE;AACvE,wEAAwE;AACxE,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC"}
|
package/dist/src/client.d.ts
CHANGED
|
@@ -35,8 +35,8 @@ import { WorkflowsApi } from "./workflows.ts";
|
|
|
35
35
|
*
|
|
36
36
|
* Construction resolves configuration once — explicit arguments first, then the
|
|
37
37
|
* environment (`W6W_BASE_URL`, `W6W_TOKEN`) — and never consults the
|
|
38
|
-
* environment again.
|
|
39
|
-
* the first request, so a CLI can print `--help` offline.
|
|
38
|
+
* environment again. An omitted base URL falls back to `DEFAULT_BASE_URL`
|
|
39
|
+
* (only an explicit blank one raises here); a missing token raises on the first request, so a CLI can print `--help` offline.
|
|
40
40
|
*
|
|
41
41
|
* @example
|
|
42
42
|
* ```ts
|
|
@@ -150,7 +150,7 @@ export declare class W6WClient {
|
|
|
150
150
|
readonly team: TeamApi;
|
|
151
151
|
/**
|
|
152
152
|
* @param options - Explicit configuration; anything omitted falls back to the environment.
|
|
153
|
-
* @throws {ConfigError} When
|
|
153
|
+
* @throws {ConfigError} When an explicit `baseUrl` is blank or malformed, or the host has no `fetch`.
|
|
154
154
|
*/
|
|
155
155
|
constructor(options?: W6WClientOptions);
|
|
156
156
|
/**
|
package/dist/src/client.js
CHANGED
|
@@ -36,8 +36,8 @@ import { WorkflowsApi } from "./workflows.js";
|
|
|
36
36
|
*
|
|
37
37
|
* Construction resolves configuration once — explicit arguments first, then the
|
|
38
38
|
* environment (`W6W_BASE_URL`, `W6W_TOKEN`) — and never consults the
|
|
39
|
-
* environment again.
|
|
40
|
-
* the first request, so a CLI can print `--help` offline.
|
|
39
|
+
* environment again. An omitted base URL falls back to `DEFAULT_BASE_URL`
|
|
40
|
+
* (only an explicit blank one raises here); a missing token raises on the first request, so a CLI can print `--help` offline.
|
|
41
41
|
*
|
|
42
42
|
* @example
|
|
43
43
|
* ```ts
|
|
@@ -151,7 +151,7 @@ export class W6WClient {
|
|
|
151
151
|
#fetch;
|
|
152
152
|
/**
|
|
153
153
|
* @param options - Explicit configuration; anything omitted falls back to the environment.
|
|
154
|
-
* @throws {ConfigError} When
|
|
154
|
+
* @throws {ConfigError} When an explicit `baseUrl` is blank or malformed, or the host has no `fetch`.
|
|
155
155
|
*/
|
|
156
156
|
constructor(options = {}) {
|
|
157
157
|
this.config = resolveConfig(options);
|
package/dist/src/config.d.ts
CHANGED
|
@@ -180,23 +180,29 @@ export interface ResolvedConfig {
|
|
|
180
180
|
* @throws {ConfigError} When the origin is blank, relative, hostless or not `http(s)`.
|
|
181
181
|
*/
|
|
182
182
|
export declare function joinBaseUrl(origin: string): string;
|
|
183
|
+
/**
|
|
184
|
+
* The base URL used when none is given: w6w's own production API. Declared once
|
|
185
|
+
* in `endpoints.json` as `defaultBaseUrl`; a conformance test pins this constant
|
|
186
|
+
* to it. An absolute origin, unlike a relative `"/api"`, resolves the same in
|
|
187
|
+
* every runtime.
|
|
188
|
+
*/
|
|
189
|
+
export declare const DEFAULT_BASE_URL = "https://api.w6w.io";
|
|
183
190
|
/**
|
|
184
191
|
* Resolve constructor options and the environment into one config value.
|
|
185
192
|
*
|
|
186
|
-
* Precedence is **explicit argument > environment variable
|
|
187
|
-
*
|
|
188
|
-
* value, not "unset" — it does not fall through to the environment
|
|
189
|
-
* empty base URL is a configuration error
|
|
190
|
-
* (`undefined`) argument consults the environment.
|
|
193
|
+
* Precedence is **explicit argument > environment variable >
|
|
194
|
+
* {@linkcode DEFAULT_BASE_URL}**. An explicitly passed empty string is an
|
|
195
|
+
* *explicit* value, not "unset" — it does not fall through to the environment
|
|
196
|
+
* or the default, and an empty base URL is a configuration error. Only an
|
|
197
|
+
* absent (`undefined`) argument consults the environment.
|
|
191
198
|
*
|
|
192
199
|
* An **empty or whitespace-only environment variable is absent** and falls
|
|
193
200
|
* through (see `src/env.ts`), so `W6W_BASE_URL=`, `W6W_BASE_URL=" "` and an
|
|
194
|
-
* unset `W6W_BASE_URL` all end
|
|
195
|
-
* a relative `"/api"`.
|
|
201
|
+
* unset `W6W_BASE_URL` all end at the default — never at a relative `"/api"`.
|
|
196
202
|
*
|
|
197
203
|
* @param options - Constructor options; `fetch` is ignored here (the client owns it).
|
|
198
204
|
* @returns The resolved configuration.
|
|
199
|
-
* @throws {ConfigError} When
|
|
205
|
+
* @throws {ConfigError} When an explicit or environment base URL is malformed.
|
|
200
206
|
*/
|
|
201
207
|
export declare function resolveConfig(options?: W6WClientOptions): ResolvedConfig;
|
|
202
208
|
/**
|
package/dist/src/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,KAAK,QAAQ,EAAe,MAAM,aAAa,CAAC;AAEzD;;;;;;;;;GASG;AACH,eAAO,MAAM,SAAS,KAAK,CAAC;AAE5B;;;;;;;;;;GAUG;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AAEjF;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,MAAM,aAAa,GAAG,CAC1B,GAAG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AO,EAAE,MAAM,CAAC;IACzB,wEAAwE;IACxE,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAAC;IAC9C,yDAAyD;IACzD,QAAQ,CAAC,qBAAqB,EAAE,OAAO,CAAC;IACxC,iEAAiE;IACjE,QAAQ,CAAC,cAAc,EAAE,CAAC,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC;IAC5D,iEAAiE;IACjE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC,qCAAqC;IACrC,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AAeD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAuBlD;AAkBD;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,uBAAuB,CAAC;AAErD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,aAAa,CAAC,OAAO,GAAE,gBAAqB,GAAG,cAAc,CAY5E;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,cAAc,EACtB,GAAG,CAAC,EAAE;IAAE,YAAY,CAAC,EAAE,OAAO,CAAA;CAAE,GAC/B,OAAO,CAAC,MAAM,CAAC,CAajB"}
|
package/dist/src/config.js
CHANGED
|
@@ -113,30 +113,36 @@ function parses(origin) {
|
|
|
113
113
|
return false;
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
|
+
/**
|
|
117
|
+
* The base URL used when none is given: w6w's own production API. Declared once
|
|
118
|
+
* in `endpoints.json` as `defaultBaseUrl`; a conformance test pins this constant
|
|
119
|
+
* to it. An absolute origin, unlike a relative `"/api"`, resolves the same in
|
|
120
|
+
* every runtime.
|
|
121
|
+
*/
|
|
122
|
+
export const DEFAULT_BASE_URL = "https://api.w6w.io";
|
|
116
123
|
/**
|
|
117
124
|
* Resolve constructor options and the environment into one config value.
|
|
118
125
|
*
|
|
119
|
-
* Precedence is **explicit argument > environment variable
|
|
120
|
-
*
|
|
121
|
-
* value, not "unset" — it does not fall through to the environment
|
|
122
|
-
* empty base URL is a configuration error
|
|
123
|
-
* (`undefined`) argument consults the environment.
|
|
126
|
+
* Precedence is **explicit argument > environment variable >
|
|
127
|
+
* {@linkcode DEFAULT_BASE_URL}**. An explicitly passed empty string is an
|
|
128
|
+
* *explicit* value, not "unset" — it does not fall through to the environment
|
|
129
|
+
* or the default, and an empty base URL is a configuration error. Only an
|
|
130
|
+
* absent (`undefined`) argument consults the environment.
|
|
124
131
|
*
|
|
125
132
|
* An **empty or whitespace-only environment variable is absent** and falls
|
|
126
133
|
* through (see `src/env.ts`), so `W6W_BASE_URL=`, `W6W_BASE_URL=" "` and an
|
|
127
|
-
* unset `W6W_BASE_URL` all end
|
|
128
|
-
* a relative `"/api"`.
|
|
134
|
+
* unset `W6W_BASE_URL` all end at the default — never at a relative `"/api"`.
|
|
129
135
|
*
|
|
130
136
|
* @param options - Constructor options; `fetch` is ignored here (the client owns it).
|
|
131
137
|
* @returns The resolved configuration.
|
|
132
|
-
* @throws {ConfigError} When
|
|
138
|
+
* @throws {ConfigError} When an explicit or environment base URL is malformed.
|
|
133
139
|
*/
|
|
134
140
|
export function resolveConfig(options = {}) {
|
|
135
141
|
return {
|
|
136
142
|
// Every normalisation, the emptiness test and the absoluteness check live in
|
|
137
143
|
// `joinBaseUrl` — one code path, so the exported helper and the client can
|
|
138
144
|
// never answer differently for the same input.
|
|
139
|
-
baseUrl: joinBaseUrl(options.baseUrl ?? readEnv(ENV_BASE_URL) ??
|
|
145
|
+
baseUrl: joinBaseUrl(options.baseUrl ?? readEnv(ENV_BASE_URL) ?? DEFAULT_BASE_URL),
|
|
140
146
|
token: options.token ?? readEnv(ENV_TOKEN) ?? null,
|
|
141
147
|
refreshOnUnauthorized: options.refreshOnUnauthorized ?? false,
|
|
142
148
|
onUnauthorized: options.onUnauthorized ?? null,
|
package/dist/src/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAC5D,OAAO,EAAiB,WAAW,EAAE,MAAM,aAAa,CAAC;AAEzD;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,EAAE,CAAC;AAyH5B;;;;;;;;;;GAUG;AACH,MAAM,oBAAoB,GAAG,uBAAuB,CAAC;AAErD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,MAAM,UAAU,WAAW,CAAC,MAAc;IACxC,0EAA0E;IAC1E,8EAA8E;IAC9E,4DAA4D;IAC5D,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAClD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,MAAM,IAAI,WAAW,CACnB,wDAAwD;YACtD,qEAAqE;YACrE,GAAG,YAAY,uDAAuD;YACtE,wEAAwE;YACxE,mBAAmB,CACtB,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;QAC5D,MAAM,IAAI,WAAW,CACnB,qBAAqB,OAAO,oCAAoC;YAC9D,GAAG,YAAY,sEAAsE;YACrF,6EAA6E;YAC7E,oEAAoE,CACvE,CAAC;IACJ,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;;;GAMG;AACH,SAAS,MAAM,CAAC,MAAc;IAC5B,IAAI,CAA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C,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,MAAM,KAAK,GAAG,GAAG,EAAE;QACjB,IAAI,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,MAAM;YAAE,cAAc,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC3E,CAAC,CAAC;IACF,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAC1B,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,mFAAmF;AACnF,MAAM,cAAc,GAAG,IAAI,OAAO,EAAmC,CAAC;AAEtE,KAAK,UAAU,YAAY,CACzB,MAAsB,EACtB,GAAgC;IAEhC,MAAM,GAAG,GAAG,OAAO,MAAM,CAAC,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,MAAM,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;IACxF,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACjE,MAAM,IAAI,WAAW,CACnB,yDAAyD;YACvD,6CAA6C;YAC7C,GAAG,SAAS,kEAAkE,CACjF,CAAC;IACJ,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
package/dist/src/errors.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* `docs/implementation.md` §3, and raised by exactly the three failure modes
|
|
9
9
|
* in `src/http.ts`.
|
|
10
10
|
* - {@linkcode ConfigError} — the client was never in a position to make a
|
|
11
|
-
* request:
|
|
11
|
+
* request: an explicitly blank base URL, or no token. No HTTP exchange happened, so an
|
|
12
12
|
* `ApiError`'s `status` and `code` would have to be invented; `status: 0` in
|
|
13
13
|
* particular is already spoken for by `network_error`, and conflating "your
|
|
14
14
|
* server is unreachable" with "you have not configured a server" is exactly
|
|
@@ -65,7 +65,7 @@ export declare class ApiError extends Error {
|
|
|
65
65
|
/**
|
|
66
66
|
* The client is not configured well enough to make a request.
|
|
67
67
|
*
|
|
68
|
-
* Raised at construction when
|
|
68
|
+
* Raised at construction when an explicit base URL is blank or malformed, and on the first request
|
|
69
69
|
* when there is no token — a client with no token can still be *built*, so a
|
|
70
70
|
* CLI's `--help` and `--version` work offline (`docs/implementation.md` §2).
|
|
71
71
|
*
|
package/dist/src/errors.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* `docs/implementation.md` §3, and raised by exactly the three failure modes
|
|
9
9
|
* in `src/http.ts`.
|
|
10
10
|
* - {@linkcode ConfigError} — the client was never in a position to make a
|
|
11
|
-
* request:
|
|
11
|
+
* request: an explicitly blank base URL, or no token. No HTTP exchange happened, so an
|
|
12
12
|
* `ApiError`'s `status` and `code` would have to be invented; `status: 0` in
|
|
13
13
|
* particular is already spoken for by `network_error`, and conflating "your
|
|
14
14
|
* server is unreachable" with "you have not configured a server" is exactly
|
|
@@ -71,7 +71,7 @@ export class ApiError extends Error {
|
|
|
71
71
|
/**
|
|
72
72
|
* The client is not configured well enough to make a request.
|
|
73
73
|
*
|
|
74
|
-
* Raised at construction when
|
|
74
|
+
* Raised at construction when an explicit base URL is blank or malformed, and on the first request
|
|
75
75
|
* when there is no token — a client with no token can still be *built*, so a
|
|
76
76
|
* CLI's `--help` and `--version` work offline (`docs/implementation.md` §2).
|
|
77
77
|
*
|
package/dist/src/server/mod.d.ts
CHANGED
|
@@ -31,9 +31,10 @@ export interface ExchangeTokenOptions {
|
|
|
31
31
|
/**
|
|
32
32
|
* The w6w server's origin, e.g. `https://api.example.com`. Same rules as
|
|
33
33
|
* {@linkcode W6WClientOptions.baseUrl} — an absolute `http(s)` URL with a
|
|
34
|
-
* host.
|
|
34
|
+
* host. Defaults to {@linkcode DEFAULT_BASE_URL} when omitted; this helper
|
|
35
|
+
* never reads `W6W_BASE_URL`. A blank value is a {@linkcode ConfigError}.
|
|
35
36
|
*/
|
|
36
|
-
baseUrl
|
|
37
|
+
baseUrl?: string;
|
|
37
38
|
/** The tenant's client id. Must not contain `:` or a non-latin-1 character. */
|
|
38
39
|
clientId: string;
|
|
39
40
|
/** The tenant's client secret. Must be latin-1 encodable. */
|
|
@@ -88,8 +89,8 @@ export interface ExchangeTokenResult {
|
|
|
88
89
|
* @param options - See {@linkcode ExchangeTokenOptions}.
|
|
89
90
|
* @returns The minted token and the identity it carries.
|
|
90
91
|
* @throws {ConfigError} Blank `clientId`/`clientSecret`/`subject`; a `clientId`
|
|
91
|
-
* containing `:`; a `clientId`/`clientSecret` outside latin-1;
|
|
92
|
-
* no runtime `fetch`.
|
|
92
|
+
* containing `:`; a `clientId`/`clientSecret` outside latin-1; a blank or
|
|
93
|
+
* malformed `baseUrl`; no runtime `fetch`.
|
|
93
94
|
* @throws {ApiError} `invalid_client` (401, unknown/disabled credentials),
|
|
94
95
|
* `invalid_body` / `invalid_subject` / `invalid_account` (400), or any of
|
|
95
96
|
* the transport's own failure modes (`../http.ts`). Never retried: this
|
|
@@ -100,10 +101,11 @@ export declare function exchangeToken(options: ExchangeTokenOptions): Promise<Ex
|
|
|
100
101
|
/** Options for {@linkcode createEmbedSessionClient}. */
|
|
101
102
|
export interface EmbedSessionClientOptions {
|
|
102
103
|
/**
|
|
103
|
-
* The w6w server's origin.
|
|
104
|
-
* this factory never
|
|
104
|
+
* The w6w server's origin. Defaults to {@linkcode DEFAULT_BASE_URL}; like
|
|
105
|
+
* {@linkcode exchangeToken} this factory never reads `W6W_BASE_URL`. A blank
|
|
106
|
+
* value is a {@linkcode ConfigError}.
|
|
105
107
|
*/
|
|
106
|
-
baseUrl
|
|
108
|
+
baseUrl?: string;
|
|
107
109
|
/** The tenant's client id. Must not contain `:` or a non-latin-1 character. */
|
|
108
110
|
clientId: string;
|
|
109
111
|
/** The tenant's client secret. Held by this instance only; never returned. */
|
|
@@ -161,9 +163,8 @@ export interface EmbedSessionClient {
|
|
|
161
163
|
* and `document` exist (a browser-like global). This is a runtime check by
|
|
162
164
|
* design; a bundler may or may not remove it.
|
|
163
165
|
*
|
|
164
|
-
* @throws {ConfigError} A
|
|
165
|
-
*
|
|
166
|
-
* `:`, non-latin-1 credentials, or a browser-like runtime. No message echoes
|
|
166
|
+
* @throws {ConfigError} A blank/malformed `baseUrl`, blank/non-string `clientId` or
|
|
167
|
+
* `clientSecret`, a `clientId` containing `:`, non-latin-1 credentials, or a browser-like runtime. No message echoes
|
|
167
168
|
* `clientSecret`.
|
|
168
169
|
*/
|
|
169
170
|
export declare function createEmbedSessionClient(options: EmbedSessionClientOptions): EmbedSessionClient;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../src/server/mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../src/server/mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAoB,KAAK,SAAS,EAAiB,MAAM,cAAc,CAAC;AAI/E,6CAA6C;AAC7C,MAAM,WAAW,oBAAoB;IACnC;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,+EAA+E;IAC/E,QAAQ,EAAE,MAAM,CAAC;IACjB,6DAA6D;IAC7D,YAAY,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iEAAiE;IACjE,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAED,+DAA+D;AAC/D,MAAM,WAAW,mBAAmB;IAClC,4CAA4C;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,sCAAsC;IACtC,IAAI,EAAE;QACJ,mDAAmD;QACnD,OAAO,EAAE,MAAM,CAAC;QAChB,qDAAqD;QACrD,MA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;;;;;;;;;GAYG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,yBAAyB,GAAG,kBAAkB,CA6D/F"}
|
package/dist/src/server/mod.js
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
*
|
|
26
26
|
* @module
|
|
27
27
|
*/
|
|
28
|
-
import { resolveConfig } from "../config.js";
|
|
28
|
+
import { DEFAULT_BASE_URL, resolveConfig } from "../config.js";
|
|
29
29
|
import { ApiError, ConfigError } from "../errors.js";
|
|
30
30
|
import { request } from "../http.js";
|
|
31
31
|
/** Non-blank after trimming. `who` prefixes the message (the raw path keeps `exchangeToken`). */
|
|
@@ -96,8 +96,8 @@ function resolveFetch(fetchOption) {
|
|
|
96
96
|
* @param options - See {@linkcode ExchangeTokenOptions}.
|
|
97
97
|
* @returns The minted token and the identity it carries.
|
|
98
98
|
* @throws {ConfigError} Blank `clientId`/`clientSecret`/`subject`; a `clientId`
|
|
99
|
-
* containing `:`; a `clientId`/`clientSecret` outside latin-1;
|
|
100
|
-
* no runtime `fetch`.
|
|
99
|
+
* containing `:`; a `clientId`/`clientSecret` outside latin-1; a blank or
|
|
100
|
+
* malformed `baseUrl`; no runtime `fetch`.
|
|
101
101
|
* @throws {ApiError} `invalid_client` (401, unknown/disabled credentials),
|
|
102
102
|
* `invalid_body` / `invalid_subject` / `invalid_account` (400), or any of
|
|
103
103
|
* the transport's own failure modes (`../http.ts`). Never retried: this
|
|
@@ -110,7 +110,9 @@ export async function exchangeToken(options) {
|
|
|
110
110
|
required(clientSecret, "clientSecret");
|
|
111
111
|
required(subject, "subject");
|
|
112
112
|
const basic = basicAuthHeader(clientId, clientSecret);
|
|
113
|
-
|
|
113
|
+
// A defined string never reaches resolveConfig's W6W_BASE_URL fallback: the
|
|
114
|
+
// credentials below go to the explicit host or the default, never an env host.
|
|
115
|
+
const config = resolveConfig({ baseUrl: baseUrl ?? DEFAULT_BASE_URL });
|
|
114
116
|
const fetchImpl = resolveFetch(options.fetch);
|
|
115
117
|
const body = { subject };
|
|
116
118
|
if (account !== undefined) {
|
|
@@ -135,9 +137,8 @@ const SESSION = "EmbedSessionClient";
|
|
|
135
137
|
* and `document` exist (a browser-like global). This is a runtime check by
|
|
136
138
|
* design; a bundler may or may not remove it.
|
|
137
139
|
*
|
|
138
|
-
* @throws {ConfigError} A
|
|
139
|
-
*
|
|
140
|
-
* `:`, non-latin-1 credentials, or a browser-like runtime. No message echoes
|
|
140
|
+
* @throws {ConfigError} A blank/malformed `baseUrl`, blank/non-string `clientId` or
|
|
141
|
+
* `clientSecret`, a `clientId` containing `:`, non-latin-1 credentials, or a browser-like runtime. No message echoes
|
|
141
142
|
* `clientSecret`.
|
|
142
143
|
*/
|
|
143
144
|
export function createEmbedSessionClient(options) {
|
|
@@ -147,11 +148,12 @@ export function createEmbedSessionClient(options) {
|
|
|
147
148
|
"secret must stay on your backend.");
|
|
148
149
|
}
|
|
149
150
|
const { baseUrl, clientId, clientSecret } = options ?? {};
|
|
150
|
-
|
|
151
|
+
if (baseUrl !== undefined)
|
|
152
|
+
requiredText(baseUrl, "baseUrl", SESSION);
|
|
151
153
|
requiredText(clientId, "clientId", SESSION);
|
|
152
154
|
requiredText(clientSecret, "clientSecret", SESSION);
|
|
153
155
|
basicAuthHeader(clientId, clientSecret, SESSION);
|
|
154
|
-
resolveConfig({ baseUrl });
|
|
156
|
+
resolveConfig({ baseUrl: baseUrl ?? DEFAULT_BASE_URL });
|
|
155
157
|
const fetchOption = options.fetch;
|
|
156
158
|
const now = options.now ?? Date.now;
|
|
157
159
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mod.js","sourceRoot":"","sources":["../../../src/server/mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAkB,aAAa,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"mod.js","sourceRoot":"","sources":["../../../src/server/mod.ts"],"names":[],"mappings":"AA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