@w6w/sdk 0.5.0 → 0.6.0

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.
Files changed (44) hide show
  1. package/README.md +20 -17
  2. package/dist/mod.d.ts +4 -0
  3. package/dist/mod.d.ts.map +1 -1
  4. package/dist/mod.js +2 -0
  5. package/dist/mod.js.map +1 -1
  6. package/dist/src/client.d.ts +26 -3
  7. package/dist/src/client.d.ts.map +1 -1
  8. package/dist/src/client.js +28 -3
  9. package/dist/src/client.js.map +1 -1
  10. package/dist/src/config.js +1 -1
  11. package/dist/src/config.js.map +1 -1
  12. package/dist/src/console/aliases.d.ts +137 -0
  13. package/dist/src/console/aliases.d.ts.map +1 -0
  14. package/dist/src/console/aliases.js +113 -0
  15. package/dist/src/console/aliases.js.map +1 -0
  16. package/dist/src/console/auth.d.ts +202 -4
  17. package/dist/src/console/auth.d.ts.map +1 -1
  18. package/dist/src/console/auth.js +154 -4
  19. package/dist/src/console/auth.js.map +1 -1
  20. package/dist/src/console/endpoints.d.ts +23 -5
  21. package/dist/src/console/endpoints.d.ts.map +1 -1
  22. package/dist/src/console/endpoints.js.map +1 -1
  23. package/dist/src/console/mod.d.ts +12 -2
  24. package/dist/src/console/mod.d.ts.map +1 -1
  25. package/dist/src/console/mod.js +10 -0
  26. package/dist/src/console/mod.js.map +1 -1
  27. package/dist/src/console/passkeys.d.ts +246 -0
  28. package/dist/src/console/passkeys.d.ts.map +1 -0
  29. package/dist/src/console/passkeys.js +192 -0
  30. package/dist/src/console/passkeys.js.map +1 -0
  31. package/dist/src/endpoints.d.ts +75 -0
  32. package/dist/src/endpoints.d.ts.map +1 -0
  33. package/dist/src/endpoints.js +47 -0
  34. package/dist/src/endpoints.js.map +1 -0
  35. package/dist/src/functions.d.ts +88 -0
  36. package/dist/src/functions.d.ts.map +1 -0
  37. package/dist/src/functions.js +56 -0
  38. package/dist/src/functions.js.map +1 -0
  39. package/dist/src/run.d.ts +8 -3
  40. package/dist/src/run.d.ts.map +1 -1
  41. package/dist/src/run.js +3 -2
  42. package/dist/src/run.js.map +1 -1
  43. package/dist/src/version.js +1 -1
  44. package/package.json +1 -1
@@ -43,9 +43,27 @@
43
43
  * handlers, not assumed) — every method here returns `res.body` directly and
44
44
  * never calls this package's `unwrap()` helper.
45
45
  *
46
+ * **T1.1.4's seven `/me/*` methods added here (profile, contact
47
+ * change-and-confirm, promote, remove, password).** Registered BELOW the auth
48
+ * guard (`packages/server/packages/api/data/me.ts`'s own doc comment) — every
49
+ * one of the seven is AUTHENTICATED, the default `requireAuth`, unlike
50
+ * `login`/`signup`/`checkAccountSlug` above. `removeContact` and
51
+ * `promoteContact` are not in this task's pinned method list but are added
52
+ * per HITL-7 ("if T1.1.4 ships routes for adding / removing / promoting a
53
+ * secondary contact, they get methods here too") — both routes exist on the
54
+ * merged branch (`data/me.ts:135-154`).
55
+ *
56
+ * **`UserProfile.hasPassword` is a RENAME of the wire's `passwordSet`, not an
57
+ * invented field.** `GET /me/profile` answers `passwordSet` (`data/me.ts:9`,
58
+ * `packages/bll/signup.ts:555`, derived server-side from
59
+ * `password_hash !== null` — the hash itself never appears). HITL-10 needs
60
+ * this fact under a name Studio's "Set a password"/"Change password" fork
61
+ * reads directly; `toUserProfile()` below performs the rename from the exact
62
+ * value the wire sent, never a default and never computed from anything else.
63
+ *
46
64
  * @module
47
65
  */
48
- import type { HttpResponse, RequestOptions } from "../http.ts";
66
+ import { type HttpResponse, type RequestOptions } from "../http.ts";
49
67
  /**
50
68
  * The slice of `W6WClient` this namespace needs: the transport, and nothing
51
69
  * else. Structural rather than a concrete client type, so the namespace stays
@@ -152,12 +170,104 @@ export interface ConsoleMe {
152
170
  /** Component versions, as the published `Me` documents them. Optional and open. */
153
171
  versions?: Record<string, string>;
154
172
  }
173
+ /**
174
+ * One of the caller's own contact addresses (email or phone), as `GET /me/profile`
175
+ * lists it (`packages/bll/signup.ts`'s `ProfileContact`, `data/me.ts:9-12`).
176
+ */
177
+ export interface ProfileContact {
178
+ id: string;
179
+ kind: "email" | "phone";
180
+ value: string;
181
+ /** ISO-8601 timestamp, or `null` while unverified. */
182
+ verifiedAt: string | null;
183
+ }
184
+ /** One of the caller's registered login methods (`data/me.ts:9-12`). */
185
+ export interface ProfileLoginMethod {
186
+ id: string;
187
+ /** e.g. `"password"`, `"passkey"`. */
188
+ kind: string;
189
+ label: string;
190
+ /** ISO-8601 timestamp. */
191
+ createdAt: string;
192
+ /** ISO-8601 timestamp, or `null` if never used. */
193
+ lastUsedAt: string | null;
194
+ }
195
+ /** A pending, unconfirmed contact-change request (`data/me.ts:9-12`). */
196
+ export interface ProfilePendingChange {
197
+ id: string;
198
+ method: "email" | "phone";
199
+ value: string;
200
+ /** ISO-8601 timestamp; the pending row is unusable past this point. */
201
+ expiresAt: string;
202
+ /** ISO-8601 timestamp. */
203
+ createdAt: string;
204
+ }
205
+ /**
206
+ * The `users` row and its dependent state, as `GET`/`PATCH /me/profile`,
207
+ * `POST /me/contacts/confirm` and `POST /me/contacts/:id/primary` all return
208
+ * it (`data/me.ts:6-19`). Every method on this namespace that returns a
209
+ * profile returns THIS shape, mapped from the wire's `passwordSet` — see this
210
+ * module's header for why {@linkcode UserProfile.hasPassword} is a rename,
211
+ * not an invented field.
212
+ */
213
+ export interface UserProfile {
214
+ userId: string;
215
+ tenant: string;
216
+ displayName: string;
217
+ email: string | null;
218
+ emailVerified: boolean;
219
+ /**
220
+ * Whether the caller already has a local password. Read straight off the
221
+ * wire's `passwordSet` (`packages/bll/signup.ts:555`) — never defaulted,
222
+ * never computed client-side. Drives HITL-10's "Set a password" (`false`)
223
+ * vs "Change password" (`true`) fork.
224
+ */
225
+ hasPassword: boolean;
226
+ contacts: ProfileContact[];
227
+ loginMethods: ProfileLoginMethod[];
228
+ pending: ProfilePendingChange[];
229
+ }
230
+ /** The body `updateProfile` sends (`PATCH /me/profile`, `data/me.ts:53-71`). */
231
+ export interface UpdateProfileInput {
232
+ displayName: string;
233
+ }
234
+ /**
235
+ * The body `requestContactChange` sends (`POST /me/contacts/change`,
236
+ * `data/me.ts:73-98`). Parks a pending change; does not confirm it.
237
+ */
238
+ export interface RequestContactChangeInput {
239
+ method: "email" | "phone";
240
+ value: string;
241
+ }
242
+ /**
243
+ * The body `confirmContactChange` sends (`POST /me/contacts/confirm`,
244
+ * `data/me.ts:100-133`). Consumes the code sent to `requestContactChange`'s
245
+ * `value`.
246
+ */
247
+ export interface ConfirmContactChangeInput {
248
+ method: "email" | "phone";
249
+ code: string;
250
+ /** Promote the newly-confirmed contact to primary in the same call (D3). */
251
+ promote?: boolean;
252
+ }
253
+ /**
254
+ * The body `setPassword` sends (`POST /me/password`, `data/me.ts:156-184`).
255
+ * One method for HITL-10's set-and-change: `currentPassword` is a field, not
256
+ * a second method, because the merged route is the single `POST /me/password`
257
+ * — not two routes.
258
+ */
259
+ export interface SetPasswordInput {
260
+ newPassword: string;
261
+ /** Required by the server when the caller already has a password (`hasPassword: true`); omit
262
+ * for the first-time "set a password" case. */
263
+ currentPassword?: string;
264
+ }
155
265
  /**
156
266
  * The `console.auth` namespace on a `W6WClient`.
157
267
  *
158
268
  * @example
159
269
  * ```ts
160
- * const { token } = await client.console.auth.login("user", "pass");
270
+ * const { token } = await client.console.auth.login("user@example.com", "pass");
161
271
  * const me = await client.console.auth.getMe();
162
272
  * if (me.tenantAdmin) { // tenant-admin surface
163
273
  * }
@@ -175,12 +285,15 @@ export declare class AuthApi {
175
285
  * PUBLIC — sends no bearer, even on a client that already holds one
176
286
  * (`requireAuth: false`).
177
287
  *
178
- * @param username - The account username.
288
+ * @param identifier - The login identifier, normally the account's email. The
289
+ * platform operator credential (`AUTH_USERNAME`) is NOT email-shaped and is a
290
+ * legitimate value here — never validate this as an email (DECISIONS.md HITL-1).
291
+ * It is sent as the `email` key: the server resolves `body.email ?? body.username`.
179
292
  * @param password - The account password.
180
293
  * @returns The token, the caller's identity, and the token's lifetime.
181
294
  * @throws {ApiError} On any non-2xx, e.g. `401` for invalid credentials.
182
295
  */
183
- login(username: string, password: string): Promise<LoginResponse>;
296
+ login(identifier: string, password: string): Promise<LoginResponse>;
184
297
  /**
185
298
  * Self-serve signup: creates the user and mints a `role: "user"` session.
186
299
  *
@@ -237,5 +350,90 @@ export declare class AuthApi {
237
350
  * @throws {ApiError} On any non-2xx, e.g. `401` when the bearer is missing or expired.
238
351
  */
239
352
  getMe(): Promise<ConsoleMe>;
353
+ /**
354
+ * Read the caller's own profile — the real `users` row, including
355
+ * {@linkcode UserProfile.hasPassword}. Distinct from `getMe()`, which reads
356
+ * session claims: this reads the actual database row (`data/me.ts:43-51`).
357
+ *
358
+ * AUTHENTICATED — the default `requireAuth` applies.
359
+ *
360
+ * @returns The caller's profile.
361
+ * @throws {ApiError} `404 no_user_profile` when there is no `users` row for this principal.
362
+ */
363
+ getProfile(): Promise<UserProfile>;
364
+ /**
365
+ * Patch the caller's display name.
366
+ *
367
+ * AUTHENTICATED — the default `requireAuth` applies.
368
+ *
369
+ * @param input - The new display name.
370
+ * @returns The updated profile (`data/me.ts:53-71`).
371
+ * @throws {ApiError} `400 invalid_body`/`invalid_display_name`.
372
+ */
373
+ updateProfile(input: UpdateProfileInput): Promise<UserProfile>;
374
+ /**
375
+ * Park a pending email/phone change and send its confirmation code. Does
376
+ * NOT confirm the change — see {@linkcode confirmContactChange}.
377
+ *
378
+ * AUTHENTICATED — the default `requireAuth` applies.
379
+ *
380
+ * @param input - The contact method and the new value.
381
+ * @returns Nothing: the server answers `202` with `{ok: true}`, which carries no information a
382
+ * caller can use (`data/me.ts:73-98`).
383
+ * @throws {ApiError} `400 invalid_body`/`invalid_email`, `409 email_taken`.
384
+ */
385
+ requestContactChange(input: RequestContactChangeInput): Promise<void>;
386
+ /**
387
+ * Consume the code from {@linkcode requestContactChange} and confirm the
388
+ * pending change. Optionally promotes the newly-confirmed contact to
389
+ * primary in the same call (D3).
390
+ *
391
+ * AUTHENTICATED — the default `requireAuth` applies.
392
+ *
393
+ * @param input - The contact method, the code, and an optional promote flag.
394
+ * @returns The updated profile (`data/me.ts:100-133`).
395
+ * @throws {ApiError} `400 invalid_body`/`invalid_code`, `404 contact_not_found`.
396
+ */
397
+ confirmContactChange(input: ConfirmContactChangeInput): Promise<UserProfile>;
398
+ /**
399
+ * Remove one of the caller's own (non-primary) contacts. Added per HITL-7
400
+ * — `DELETE /me/contacts/:id` exists on the merged branch (`data/me.ts:135-144`).
401
+ *
402
+ * AUTHENTICATED — the default `requireAuth` applies.
403
+ *
404
+ * @param id - The contact id.
405
+ * @returns Nothing: the server answers `{ok: true}`, which carries no information a caller can
406
+ * use, mirroring `console.projects.delete`/`console.schedules.delete` in this same package.
407
+ * @throws {ApiError} `404 contact_not_found`.
408
+ */
409
+ removeContact(id: string): Promise<void>;
410
+ /**
411
+ * Promote one of the caller's own secondary contacts to primary. Added per
412
+ * HITL-7 — `POST /me/contacts/:id/primary` exists on the merged branch
413
+ * (`data/me.ts:146-154`).
414
+ *
415
+ * AUTHENTICATED — the default `requireAuth` applies.
416
+ *
417
+ * @param id - The contact id.
418
+ * @returns The updated profile.
419
+ * @throws {ApiError} `404 contact_not_found`, `403 contact_not_verified`.
420
+ */
421
+ promoteContact(id: string): Promise<UserProfile>;
422
+ /**
423
+ * Set or change the caller's password (HITL-10) — one method, since the
424
+ * merged route is the single `POST /me/password`, not two. Omit
425
+ * `currentPassword` for the first-time "set a password" case
426
+ * (`hasPassword: false`); the server requires it once a password already
427
+ * exists.
428
+ *
429
+ * AUTHENTICATED — the default `requireAuth` applies.
430
+ *
431
+ * @param input - The new password, plus the current one when required.
432
+ * @returns Nothing: the server answers `{ok: true}`, which carries no information a caller can
433
+ * use (`data/me.ts:156-184`).
434
+ * @throws {ApiError} `400 invalid_body`/`invalid_password`/`current_password_required`,
435
+ * `403 invalid_current_password`.
436
+ */
437
+ setPassword(input: SetPasswordInput): Promise<void>;
240
438
  }
241
439
  //# sourceMappingURL=auth.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"auth.d.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OAcG;IACG,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;CAO1D"}
@@ -43,14 +43,38 @@
43
43
  * handlers, not assumed) — every method here returns `res.body` directly and
44
44
  * never calls this package's `unwrap()` helper.
45
45
  *
46
+ * **T1.1.4's seven `/me/*` methods added here (profile, contact
47
+ * change-and-confirm, promote, remove, password).** Registered BELOW the auth
48
+ * guard (`packages/server/packages/api/data/me.ts`'s own doc comment) — every
49
+ * one of the seven is AUTHENTICATED, the default `requireAuth`, unlike
50
+ * `login`/`signup`/`checkAccountSlug` above. `removeContact` and
51
+ * `promoteContact` are not in this task's pinned method list but are added
52
+ * per HITL-7 ("if T1.1.4 ships routes for adding / removing / promoting a
53
+ * secondary contact, they get methods here too") — both routes exist on the
54
+ * merged branch (`data/me.ts:135-154`).
55
+ *
56
+ * **`UserProfile.hasPassword` is a RENAME of the wire's `passwordSet`, not an
57
+ * invented field.** `GET /me/profile` answers `passwordSet` (`data/me.ts:9`,
58
+ * `packages/bll/signup.ts:555`, derived server-side from
59
+ * `password_hash !== null` — the hash itself never appears). HITL-10 needs
60
+ * this fact under a name Studio's "Set a password"/"Change password" fork
61
+ * reads directly; `toUserProfile()` below performs the rename from the exact
62
+ * value the wire sent, never a default and never computed from anything else.
63
+ *
46
64
  * @module
47
65
  */
66
+ import { path } from "../http.js";
67
+ /** `passwordSet` → `hasPassword`. The one hop between the wire and {@linkcode UserProfile}. */
68
+ function toUserProfile(wire) {
69
+ const { passwordSet, ...rest } = wire;
70
+ return { ...rest, hasPassword: passwordSet };
71
+ }
48
72
  /**
49
73
  * The `console.auth` namespace on a `W6WClient`.
50
74
  *
51
75
  * @example
52
76
  * ```ts
53
- * const { token } = await client.console.auth.login("user", "pass");
77
+ * const { token } = await client.console.auth.login("user@example.com", "pass");
54
78
  * const me = await client.console.auth.getMe();
55
79
  * if (me.tenantAdmin) { // tenant-admin surface
56
80
  * }
@@ -70,16 +94,19 @@ export class AuthApi {
70
94
  * PUBLIC — sends no bearer, even on a client that already holds one
71
95
  * (`requireAuth: false`).
72
96
  *
73
- * @param username - The account username.
97
+ * @param identifier - The login identifier, normally the account's email. The
98
+ * platform operator credential (`AUTH_USERNAME`) is NOT email-shaped and is a
99
+ * legitimate value here — never validate this as an email (DECISIONS.md HITL-1).
100
+ * It is sent as the `email` key: the server resolves `body.email ?? body.username`.
74
101
  * @param password - The account password.
75
102
  * @returns The token, the caller's identity, and the token's lifetime.
76
103
  * @throws {ApiError} On any non-2xx, e.g. `401` for invalid credentials.
77
104
  */
78
- async login(username, password) {
105
+ async login(identifier, password) {
79
106
  const res = await this.#host.request({
80
107
  method: "POST",
81
108
  path: "/auth/login",
82
- body: { username, password },
109
+ body: { email: identifier, password },
83
110
  requireAuth: false,
84
111
  });
85
112
  return res.body;
@@ -169,5 +196,128 @@ export class AuthApi {
169
196
  });
170
197
  return res.body;
171
198
  }
199
+ /**
200
+ * Read the caller's own profile — the real `users` row, including
201
+ * {@linkcode UserProfile.hasPassword}. Distinct from `getMe()`, which reads
202
+ * session claims: this reads the actual database row (`data/me.ts:43-51`).
203
+ *
204
+ * AUTHENTICATED — the default `requireAuth` applies.
205
+ *
206
+ * @returns The caller's profile.
207
+ * @throws {ApiError} `404 no_user_profile` when there is no `users` row for this principal.
208
+ */
209
+ async getProfile() {
210
+ const res = await this.#host.request({ method: "GET", path: "/me/profile" });
211
+ return toUserProfile(res.body);
212
+ }
213
+ /**
214
+ * Patch the caller's display name.
215
+ *
216
+ * AUTHENTICATED — the default `requireAuth` applies.
217
+ *
218
+ * @param input - The new display name.
219
+ * @returns The updated profile (`data/me.ts:53-71`).
220
+ * @throws {ApiError} `400 invalid_body`/`invalid_display_name`.
221
+ */
222
+ async updateProfile(input) {
223
+ const res = await this.#host.request({
224
+ method: "PATCH",
225
+ path: "/me/profile",
226
+ body: input,
227
+ });
228
+ return toUserProfile(res.body);
229
+ }
230
+ /**
231
+ * Park a pending email/phone change and send its confirmation code. Does
232
+ * NOT confirm the change — see {@linkcode confirmContactChange}.
233
+ *
234
+ * AUTHENTICATED — the default `requireAuth` applies.
235
+ *
236
+ * @param input - The contact method and the new value.
237
+ * @returns Nothing: the server answers `202` with `{ok: true}`, which carries no information a
238
+ * caller can use (`data/me.ts:73-98`).
239
+ * @throws {ApiError} `400 invalid_body`/`invalid_email`, `409 email_taken`.
240
+ */
241
+ async requestContactChange(input) {
242
+ await this.#host.request({
243
+ method: "POST",
244
+ path: "/me/contacts/change",
245
+ body: input,
246
+ });
247
+ }
248
+ /**
249
+ * Consume the code from {@linkcode requestContactChange} and confirm the
250
+ * pending change. Optionally promotes the newly-confirmed contact to
251
+ * primary in the same call (D3).
252
+ *
253
+ * AUTHENTICATED — the default `requireAuth` applies.
254
+ *
255
+ * @param input - The contact method, the code, and an optional promote flag.
256
+ * @returns The updated profile (`data/me.ts:100-133`).
257
+ * @throws {ApiError} `400 invalid_body`/`invalid_code`, `404 contact_not_found`.
258
+ */
259
+ async confirmContactChange(input) {
260
+ const res = await this.#host.request({
261
+ method: "POST",
262
+ path: "/me/contacts/confirm",
263
+ body: input,
264
+ });
265
+ return toUserProfile(res.body);
266
+ }
267
+ /**
268
+ * Remove one of the caller's own (non-primary) contacts. Added per HITL-7
269
+ * — `DELETE /me/contacts/:id` exists on the merged branch (`data/me.ts:135-144`).
270
+ *
271
+ * AUTHENTICATED — the default `requireAuth` applies.
272
+ *
273
+ * @param id - The contact id.
274
+ * @returns Nothing: the server answers `{ok: true}`, which carries no information a caller can
275
+ * use, mirroring `console.projects.delete`/`console.schedules.delete` in this same package.
276
+ * @throws {ApiError} `404 contact_not_found`.
277
+ */
278
+ async removeContact(id) {
279
+ await this.#host.request({ method: "DELETE", path: path `/me/contacts/${id}` });
280
+ }
281
+ /**
282
+ * Promote one of the caller's own secondary contacts to primary. Added per
283
+ * HITL-7 — `POST /me/contacts/:id/primary` exists on the merged branch
284
+ * (`data/me.ts:146-154`).
285
+ *
286
+ * AUTHENTICATED — the default `requireAuth` applies.
287
+ *
288
+ * @param id - The contact id.
289
+ * @returns The updated profile.
290
+ * @throws {ApiError} `404 contact_not_found`, `403 contact_not_verified`.
291
+ */
292
+ async promoteContact(id) {
293
+ const res = await this.#host.request({
294
+ method: "POST",
295
+ path: path `/me/contacts/${id}/primary`,
296
+ body: {},
297
+ });
298
+ return toUserProfile(res.body);
299
+ }
300
+ /**
301
+ * Set or change the caller's password (HITL-10) — one method, since the
302
+ * merged route is the single `POST /me/password`, not two. Omit
303
+ * `currentPassword` for the first-time "set a password" case
304
+ * (`hasPassword: false`); the server requires it once a password already
305
+ * exists.
306
+ *
307
+ * AUTHENTICATED — the default `requireAuth` applies.
308
+ *
309
+ * @param input - The new password, plus the current one when required.
310
+ * @returns Nothing: the server answers `{ok: true}`, which carries no information a caller can
311
+ * use (`data/me.ts:156-184`).
312
+ * @throws {ApiError} `400 invalid_body`/`invalid_password`/`current_password_required`,
313
+ * `403 invalid_current_password`.
314
+ */
315
+ async setPassword(input) {
316
+ await this.#host.request({
317
+ method: "POST",
318
+ path: "/me/password",
319
+ body: input,
320
+ });
321
+ }
172
322
  }
173
323
  //# sourceMappingURL=auth.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/console/auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAwHH;;;;;;;;;;GAUG;AACH,MAAM,OAAO,OAAO;IACT,KAAK,CAAW;IAEzB;;OAEG;IACH,YAAY,IAAc;QACxB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACpB,CAAC;IAED;;;;;;;;;;OAUG;IACH,KAAK,CAAC,KAAK,CAAC,QAAgB,EAAE,QAAgB;QAC5C,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAgB;YAClD,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,aAAa;YACnB,IAAI,EAAE,EAAE,QAAQ,E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YACpB,IAAI,EAAE,KAAK;SACZ,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -70,8 +70,23 @@ export interface ActionTarget {
70
70
  };
71
71
  with?: Record<string, unknown>;
72
72
  }
73
- /** The full discriminated union of what an Endpoint may dispatch to. */
74
- export type EndpointTarget = Callable | ActionTarget;
73
+ /**
74
+ * The alias-only fourth arm: dispatch to another Endpoint by id.
75
+ * LEGAL FOR AN ALIAS'S `target` ONLY. `POST /endpoints` refuses it
76
+ * (api/admin/endpoints.ts's validateDefinition) and that refusal is the sole
77
+ * bound on Endpoint→Endpoint recursion; a regression test pins it (D-14).
78
+ */
79
+ export interface EndpointRefTarget {
80
+ kind: "endpoint";
81
+ endpoint: string;
82
+ }
83
+ /**
84
+ * The full discriminated union of what an Endpoint may dispatch to. Shared by
85
+ * `EndpointDef.target` and `AliasDef.target` — but the `endpoint` arm is
86
+ * legal only for the latter: an Endpoint's own target can never be another
87
+ * Endpoint (see {@linkcode EndpointRefTarget}).
88
+ */
89
+ export type EndpointTarget = Callable | ActionTarget | EndpointRefTarget;
75
90
  /** The inbound auth mode an Endpoint's public exposure enforces. */
76
91
  export type EndpointAuthMode = "platform" | "none" | "basic" | "header" | "jwt";
77
92
  /**
@@ -115,9 +130,12 @@ export interface EndpointInput {
115
130
  }
116
131
  /**
117
132
  * An Endpoint definition — a named, stable callable entry point that
118
- * dispatches to exactly one target: an app Action, a Function, or a Workflow
119
- * (`rfcs/endpoint.md`). Callers bind to the Endpoint id; the target beneath
120
- * it can change without breaking them.
133
+ * dispatches to a target (`rfcs/endpoint.md`). `target` is typed with the
134
+ * full {@linkcode EndpointTarget} union shared with `AliasDef.target`, but an
135
+ * Endpoint's own target can never be another Endpoint: the `endpoint` arm
136
+ * ({@linkcode EndpointRefTarget}) is legal only for an alias's `target`, and
137
+ * `POST /endpoints` refuses it here. Callers bind to the Endpoint id; the
138
+ * target beneath it can change without breaking them.
121
139
  *
122
140
  * `key` is **immutable after first save** — it is a public URL segment. A
123
141
  * save that changes `key` on an already-stored Endpoint answers `409
@@ -1 +1 @@
1
- {"version":3,"file":"endpoints.d.ts","sourceRoot":"","sources":["../../../src/console/endpoints.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH,OAAO,EAAE,KAAK,YAAY,EAAQ,KAAK,cAAc,EAAE,MAAM,YAAY,CAAC;AAG1E;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B,2BAA2B;IAC3B,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;CAC/D;AAED,iFAAiF;AACjF,MAAM,MAAM,QAAQ,GAChB;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GACtC;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3C,8EAA8E;AAC9E,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC;IAClE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC;AAED,wEAAwE;AACxE,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,YAAY,CAAC;AAErD,oEAAoE;AACpE,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;AAEhF;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,gBAAgB,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UA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;OAiBG;IACH,KAAK,CAAC,MAAM,CAAC,EAAU,EAAE,KAA8B;QACrD,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAuB;YACzD,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,IAAI,CAAA,cAAc,EAAE,SAAS;YACnC,IAAI,EAAE,EAAE,KAAK,EAAE;SAChB,CAAC,CAAC;QACH,OAAO,GAAG,CAAC,IAAI,CAAC;IAClB,CAAC;CACF"}
@@ -18,6 +18,7 @@
18
18
  * @module
19
19
  */
20
20
  import type { HttpResponse, RequestOptions } from "../http.ts";
21
+ import { AliasesApi } from "./aliases.ts";
21
22
  import { ApiCallsApi } from "./api-calls.ts";
22
23
  import { AppsApi } from "./apps.ts";
23
24
  import { AuthApi } from "./auth.ts";
@@ -25,6 +26,7 @@ import { ConnectionsApi } from "./connections.ts";
25
26
  import { DashboardApi } from "./dashboard.ts";
26
27
  import { EndpointsApi } from "./endpoints.ts";
27
28
  import { FunctionsApi } from "./functions.ts";
29
+ import { PasskeysApi } from "./passkeys.ts";
28
30
  import { ReliabilityApi } from "./reliability.ts";
29
31
  import { ProjectsApi } from "./projects.ts";
30
32
  import { SavedTestsApi } from "./saved-tests.ts";
@@ -36,7 +38,9 @@ import { TokensApi } from "./tokens.ts";
36
38
  import { VaultApi } from "./vault.ts";
37
39
  import { WorkflowsApi } from "./workflows.ts";
38
40
  export { AuthApi } from "./auth.ts";
39
- export type { AccountWire, AuthHost, ConsoleMe, CreateAccountResponse, LoginResponse, SignupInput, SignupResponse, SignupUser, SlugAvailabilityResponse, User, } from "./auth.ts";
41
+ export type { AccountWire, AuthHost, ConfirmContactChangeInput, ConsoleMe, CreateAccountResponse, LoginResponse, ProfileContact, ProfileLoginMethod, ProfilePendingChange, RequestContactChangeInput, SetPasswordInput, SignupInput, SignupResponse, SignupUser, SlugAvailabilityResponse, UpdateProfileInput, User, UserProfile, } from "./auth.ts";
42
+ export { PasskeysApi } from "./passkeys.ts";
43
+ export type { AuthenticationVerifyInput, Passkey, PasskeyAuthenticationVerifyResponse, PasskeyCeremonyOptions, PasskeysHost, PasskeyUser, RegistrationVerifyInput, } from "./passkeys.ts";
40
44
  export { DashboardApi } from "./dashboard.ts";
41
45
  export type { DashboardHost, DashboardStats, DashboardStatsParams } from "./dashboard.ts";
42
46
  export { ReliabilityApi } from "./reliability.ts";
@@ -62,7 +66,9 @@ export type { ApiToken, ApiTokenStatus, CreateTokenResponse, TokensHost } from "
62
66
  export { FunctionsApi } from "./functions.ts";
63
67
  export type { FunctionDef, FunctionImpl, FunctionInput, FunctionOutputField, FunctionsHost, FunctionSummary, } from "./functions.ts";
64
68
  export { EndpointsApi, SECRET_MASK } from "./endpoints.ts";
65
- export type { ActionTarget, Callable, EndpointAuthMode, EndpointDef, EndpointInput, EndpointInvokeResult, EndpointSecurity, EndpointsHost, EndpointSummary, EndpointTarget, Exposure, } from "./endpoints.ts";
69
+ export type { ActionTarget, Callable, EndpointAuthMode, EndpointDef, EndpointInput, EndpointInvokeResult, EndpointRefTarget, EndpointSecurity, EndpointsHost, EndpointSummary, EndpointTarget, Exposure, } from "./endpoints.ts";
70
+ export { AliasesApi } from "./aliases.ts";
71
+ export type { AliasDef, AliasesHost, AliasSummary } from "./aliases.ts";
66
72
  export { SubscriptionsApi } from "./subscriptions.ts";
67
73
  export type { Subscription, SubscriptionCreateInput, SubscriptionsHost, TriggerEventStatus, TriggerEventSummary, } from "./subscriptions.ts";
68
74
  export { ApiCallsApi } from "./api-calls.ts";
@@ -117,12 +123,16 @@ export declare class ConsoleApi {
117
123
  readonly functions: FunctionsApi;
118
124
  /** `console.endpoints.*`. */
119
125
  readonly endpoints: EndpointsApi;
126
+ /** `console.aliases.*`. */
127
+ readonly aliases: AliasesApi;
120
128
  /** `console.subscriptions.*`. */
121
129
  readonly subscriptions: SubscriptionsApi;
122
130
  /** `console.apiCalls.*`. */
123
131
  readonly apiCalls: ApiCallsApi;
124
132
  /** `console.tenantOAuthApps.*` — the caller's OWN tenant, never a tenant of its choosing. */
125
133
  readonly tenantOAuthApps: TenantOAuthAppsApi;
134
+ /** `console.passkeys.*`. */
135
+ readonly passkeys: PasskeysApi;
126
136
  /**
127
137
  * @param host - The client this namespace group issues requests through.
128
138
  */
@@ -1 +1 @@
1
- {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../src/console/mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,O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