@w6w/sdk 0.4.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.
- package/README.md +24 -21
- package/dist/mod.d.ts +6 -2
- package/dist/mod.d.ts.map +1 -1
- package/dist/mod.js +4 -2
- package/dist/mod.js.map +1 -1
- package/dist/src/client.d.ts +32 -9
- package/dist/src/client.d.ts.map +1 -1
- package/dist/src/client.js +33 -8
- package/dist/src/client.js.map +1 -1
- package/dist/src/config.d.ts +2 -2
- package/dist/src/config.js +3 -3
- package/dist/src/config.js.map +1 -1
- package/dist/src/connections.d.ts +2 -2
- package/dist/src/connections.js +1 -1
- package/dist/src/console/aliases.d.ts +137 -0
- package/dist/src/console/aliases.d.ts.map +1 -0
- package/dist/src/console/aliases.js +113 -0
- package/dist/src/console/aliases.js.map +1 -0
- package/dist/src/console/api-calls.d.ts +2 -2
- package/dist/src/console/api-calls.js +1 -1
- package/dist/src/console/apps.d.ts +4 -4
- package/dist/src/console/apps.js +3 -3
- package/dist/src/console/auth.d.ts +204 -6
- package/dist/src/console/auth.d.ts.map +1 -1
- package/dist/src/console/auth.js +155 -5
- package/dist/src/console/auth.js.map +1 -1
- package/dist/src/console/connections.d.ts +2 -2
- package/dist/src/console/connections.js +1 -1
- package/dist/src/console/dashboard.d.ts +2 -2
- package/dist/src/console/dashboard.js +1 -1
- package/dist/src/console/endpoints.d.ts +25 -7
- package/dist/src/console/endpoints.d.ts.map +1 -1
- package/dist/src/console/endpoints.js +1 -1
- package/dist/src/console/endpoints.js.map +1 -1
- package/dist/src/console/functions.d.ts +2 -2
- package/dist/src/console/functions.js +1 -1
- package/dist/src/console/mod.d.ts +15 -5
- package/dist/src/console/mod.d.ts.map +1 -1
- package/dist/src/console/mod.js +12 -2
- package/dist/src/console/mod.js.map +1 -1
- package/dist/src/console/passkeys.d.ts +246 -0
- package/dist/src/console/passkeys.d.ts.map +1 -0
- package/dist/src/console/passkeys.js +192 -0
- package/dist/src/console/passkeys.js.map +1 -0
- package/dist/src/console/projects.d.ts +2 -2
- package/dist/src/console/projects.js +1 -1
- package/dist/src/console/reliability.d.ts +2 -2
- package/dist/src/console/reliability.js +1 -1
- package/dist/src/console/saved-tests.d.ts +3 -3
- package/dist/src/console/saved-tests.js +2 -2
- package/dist/src/console/schedules.d.ts +2 -2
- package/dist/src/console/schedules.js +1 -1
- package/dist/src/console/step-tests.d.ts +3 -3
- package/dist/src/console/step-tests.js +2 -2
- package/dist/src/console/subscriptions.d.ts +2 -2
- package/dist/src/console/subscriptions.js +1 -1
- package/dist/src/console/tenant-oauth-apps.d.ts +2 -2
- package/dist/src/console/tenant-oauth-apps.js +1 -1
- package/dist/src/console/tokens.d.ts +2 -2
- package/dist/src/console/tokens.js +1 -1
- package/dist/src/console/vault.d.ts +2 -2
- package/dist/src/console/vault.js +1 -1
- package/dist/src/console/workflows.d.ts +2 -2
- package/dist/src/console/workflows.js +1 -1
- package/dist/src/documents.d.ts +2 -2
- package/dist/src/documents.js +1 -1
- package/dist/src/endpoints.d.ts +75 -0
- package/dist/src/endpoints.d.ts.map +1 -0
- package/dist/src/endpoints.js +47 -0
- package/dist/src/endpoints.js.map +1 -0
- package/dist/src/functions.d.ts +88 -0
- package/dist/src/functions.d.ts.map +1 -0
- package/dist/src/functions.js +56 -0
- package/dist/src/functions.js.map +1 -0
- package/dist/src/me.d.ts +2 -2
- package/dist/src/me.js +1 -1
- package/dist/src/run.d.ts +9 -4
- package/dist/src/run.d.ts.map +1 -1
- package/dist/src/run.js +3 -2
- package/dist/src/run.js.map +1 -1
- package/dist/src/vars.d.ts +2 -2
- package/dist/src/vars.js +1 -1
- package/dist/src/version.js +1 -1
- package/dist/src/workflows.d.ts +2 -2
- package/dist/src/workflows.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/console/auth.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3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,EAAE,KAAK;SACZ,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
import { type HttpResponse, type RequestOptions } from "../http.ts";
|
|
46
46
|
import { type ConnectionSummary } from "../types.ts";
|
|
47
47
|
/**
|
|
48
|
-
* The slice of `
|
|
48
|
+
* The slice of `W6WClient` this namespace needs: the transport, and nothing
|
|
49
49
|
* else. Structural rather than a concrete client type, so the namespace stays
|
|
50
50
|
* independently constructible in a test and this module never imports the
|
|
51
51
|
* client back — mirrors `VarsHost` in `../vars.ts`.
|
|
@@ -79,7 +79,7 @@ export interface ConnectionTestResult {
|
|
|
79
79
|
};
|
|
80
80
|
}
|
|
81
81
|
/**
|
|
82
|
-
* The `console.connections` namespace on a `
|
|
82
|
+
* The `console.connections` namespace on a `W6WClient`.
|
|
83
83
|
*
|
|
84
84
|
* @example
|
|
85
85
|
* ```ts
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
*/
|
|
25
25
|
import type { HttpResponse, RequestOptions } from "../http.ts";
|
|
26
26
|
/**
|
|
27
|
-
* The slice of `
|
|
27
|
+
* The slice of `W6WClient` this namespace needs: the transport, and nothing
|
|
28
28
|
* else. Structural rather than a concrete client type, so the namespace stays
|
|
29
29
|
* independently constructible in a test and this module never imports the
|
|
30
30
|
* client back — mirrors `ReliabilityHost` in `./reliability.ts`.
|
|
@@ -75,7 +75,7 @@ export interface DashboardStats {
|
|
|
75
75
|
}>;
|
|
76
76
|
}
|
|
77
77
|
/**
|
|
78
|
-
* The `console.dashboard` namespace on a `
|
|
78
|
+
* The `console.dashboard` namespace on a `W6WClient`.
|
|
79
79
|
*
|
|
80
80
|
* @example
|
|
81
81
|
* ```ts
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
*/
|
|
44
44
|
import { type HttpResponse, type RequestOptions } from "../http.ts";
|
|
45
45
|
/**
|
|
46
|
-
* The slice of `
|
|
46
|
+
* The slice of `W6WClient` this namespace needs: the transport, and nothing
|
|
47
47
|
* else. Structural rather than a concrete client type, so the namespace stays
|
|
48
48
|
* independently constructible in a test and this module never imports the
|
|
49
49
|
* client back — mirrors `WorkflowsHost` in `./workflows.ts`.
|
|
@@ -70,8 +70,23 @@ export interface ActionTarget {
|
|
|
70
70
|
};
|
|
71
71
|
with?: Record<string, unknown>;
|
|
72
72
|
}
|
|
73
|
-
/**
|
|
74
|
-
|
|
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
|
|
119
|
-
*
|
|
120
|
-
*
|
|
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
|
|
@@ -165,7 +183,7 @@ export type EndpointInvokeResult = {
|
|
|
165
183
|
runId: string;
|
|
166
184
|
};
|
|
167
185
|
/**
|
|
168
|
-
* The `console.endpoints` namespace on a `
|
|
186
|
+
* The `console.endpoints` namespace on a `W6WClient`.
|
|
169
187
|
*
|
|
170
188
|
* @example
|
|
171
189
|
* ```ts
|
|
@@ -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,U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
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"endpoints.js","sourceRoot":"","sources":["../../../src/console/endpoints.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH,OAAO,EAAqB,IAAI,EAAuB,MAAM,YAAY,CAAC;AAC1E,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"endpoints.js","sourceRoot":"","sources":["../../../src/console/endpoints.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH,OAAO,EAAqB,IAAI,EAAuB,MAAM,YAAY,CAAC;AAC1E,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AA8DrC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,YAAY,CAAC;AAqExC;;;;;;;;;GASG;AACH,MAAM,OAAO,YAAY;IACd,KAAK,CAAgB;IAE9B;;OAEG;IACH,YAAY,IAAmB;QAC7B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACpB,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,IAAI;QACR,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAU,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,CAAC;QACrF,OAAO,MAAM,CAAoB,GAAG,EAAE,WAAW,CAAC,CAAC;IACrD,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,KAAK,CAAC,GAAG,CACP,EAAU;QAEV,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAElC;YACA,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,IAAI,CAAA,cAAc,EAAE,EAAE;SAC7B,CAAC,CAAC;QACH,OAAO,GAAG,CAAC,IAAI,CAAC;IAClB,CAAC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,KAAK,CAAC,MAAM,CACV,UAAuB;QAIvB,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAElC;YACA,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,YAAY;YAClB,IAAI,EAAE,UAAU;SACjB,CAAC,CAAC;QACH,OAAO,GAAG,CAAC,IAAI,CAAC;IAClB,CAAC;IAED;;;;;;;;;;;;;;;;;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"}
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
*/
|
|
39
39
|
import { type HttpResponse, type RequestOptions } from "../http.ts";
|
|
40
40
|
/**
|
|
41
|
-
* The slice of `
|
|
41
|
+
* The slice of `W6WClient` this namespace needs: the transport, and nothing
|
|
42
42
|
* else. Structural rather than a concrete client type, so the namespace stays
|
|
43
43
|
* independently constructible in a test and this module never imports the
|
|
44
44
|
* client back — mirrors `WorkflowsHost` in `./workflows.ts`.
|
|
@@ -102,7 +102,7 @@ export interface FunctionSummary {
|
|
|
102
102
|
valid: boolean;
|
|
103
103
|
}
|
|
104
104
|
/**
|
|
105
|
-
* The `console.functions` namespace on a `
|
|
105
|
+
* The `console.functions` namespace on a `W6WClient`.
|
|
106
106
|
*
|
|
107
107
|
* @example
|
|
108
108
|
* ```ts
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* but deliberately EXCLUDED from `endpoints.json`'s `operations[]` and from
|
|
7
7
|
* the root barrel (`../../mod.ts`) — see `docs/console.md` and HITL-1 in this
|
|
8
8
|
* task's contract. `client.console` is instance state exactly like every other
|
|
9
|
-
* namespace on `
|
|
9
|
+
* namespace on `W6WClient` (`docs/implementation.md` §MECHANISM PIN —
|
|
10
10
|
* instance state, never globals): it holds the host it was constructed with
|
|
11
11
|
* and nothing of its own.
|
|
12
12
|
*
|
|
@@ -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";
|
|
@@ -70,7 +76,7 @@ export type { ApiCallsFilter, ApiCallsHost } from "./api-calls.ts";
|
|
|
70
76
|
export { TenantOAuthAppsApi } from "./tenant-oauth-apps.ts";
|
|
71
77
|
export type { SetTenantOAuthAppInput, TenantOAuthAppsHost, TenantOAuthAppsResponse, TenantOAuthAppSummary, } from "./tenant-oauth-apps.ts";
|
|
72
78
|
/**
|
|
73
|
-
* The slice of `
|
|
79
|
+
* The slice of `W6WClient` the console namespace group needs: the transport,
|
|
74
80
|
* and nothing else. Structural rather than a concrete client type, so
|
|
75
81
|
* `ConsoleApi` stays independently constructible in a test and this module
|
|
76
82
|
* never imports the client back.
|
|
@@ -80,7 +86,7 @@ export interface ConsoleHost {
|
|
|
80
86
|
request<T>(options: RequestOptions): Promise<HttpResponse<T>>;
|
|
81
87
|
}
|
|
82
88
|
/**
|
|
83
|
-
* The `console` namespace group on a `
|
|
89
|
+
* The `console` namespace group on a `W6WClient` — studio-internal, not part
|
|
84
90
|
* of the published partner contract.
|
|
85
91
|
*
|
|
86
92
|
* @example
|
|
@@ -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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B,QAAQ,CAAC,SAAS,EAAE,YAAY,CAAC;IACjC,yBAAyB;IACzB,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;IACzB,0BAA0B;IAC1B,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAC3B,6BAA6B;IAC7B,QAAQ,CAAC,SAAS,EAAE,YAAY,CAAC;IACjC,6BAA6B;IAC7B,QAAQ,CAAC,SAAS,EAAE,YAAY,CAAC;IACjC,2BAA2B;IAC3B,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC;IAC7B,iCAAiC;IACjC,QAAQ,CAAC,aAAa,EAAE,gBAAgB,CAAC;IACzC,4BAA4B;IAC5B,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC;IAC/B,6FAA6F;IAC7F,QAAQ,CAAC,eAAe,EAAE,kBAAkB,CAAC;IAC7C,4BAA4B;IAC5B,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC;IAE/B;;OAEG;gBACS,IAAI,EAAE,WAAW;CAqB9B"}
|
package/dist/src/console/mod.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* but deliberately EXCLUDED from `endpoints.json`'s `operations[]` and from
|
|
7
7
|
* the root barrel (`../../mod.ts`) — see `docs/console.md` and HITL-1 in this
|
|
8
8
|
* task's contract. `client.console` is instance state exactly like every other
|
|
9
|
-
* namespace on `
|
|
9
|
+
* namespace on `W6WClient` (`docs/implementation.md` §MECHANISM PIN —
|
|
10
10
|
* instance state, never globals): it holds the host it was constructed with
|
|
11
11
|
* and nothing of its own.
|
|
12
12
|
*
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
*
|
|
18
18
|
* @module
|
|
19
19
|
*/
|
|
20
|
+
import { AliasesApi } from "./aliases.js";
|
|
20
21
|
import { ApiCallsApi } from "./api-calls.js";
|
|
21
22
|
import { AppsApi } from "./apps.js";
|
|
22
23
|
import { AuthApi } from "./auth.js";
|
|
@@ -24,6 +25,7 @@ import { ConnectionsApi } from "./connections.js";
|
|
|
24
25
|
import { DashboardApi } from "./dashboard.js";
|
|
25
26
|
import { EndpointsApi } from "./endpoints.js";
|
|
26
27
|
import { FunctionsApi } from "./functions.js";
|
|
28
|
+
import { PasskeysApi } from "./passkeys.js";
|
|
27
29
|
import { ReliabilityApi } from "./reliability.js";
|
|
28
30
|
import { ProjectsApi } from "./projects.js";
|
|
29
31
|
import { SavedTestsApi } from "./saved-tests.js";
|
|
@@ -35,6 +37,7 @@ import { TokensApi } from "./tokens.js";
|
|
|
35
37
|
import { VaultApi } from "./vault.js";
|
|
36
38
|
import { WorkflowsApi } from "./workflows.js";
|
|
37
39
|
export { AuthApi } from "./auth.js";
|
|
40
|
+
export { PasskeysApi } from "./passkeys.js";
|
|
38
41
|
export { DashboardApi } from "./dashboard.js";
|
|
39
42
|
export { ReliabilityApi } from "./reliability.js";
|
|
40
43
|
export { ProjectsApi } from "./projects.js";
|
|
@@ -48,11 +51,12 @@ export { VaultApi } from "./vault.js";
|
|
|
48
51
|
export { TokensApi } from "./tokens.js";
|
|
49
52
|
export { FunctionsApi } from "./functions.js";
|
|
50
53
|
export { EndpointsApi, SECRET_MASK } from "./endpoints.js";
|
|
54
|
+
export { AliasesApi } from "./aliases.js";
|
|
51
55
|
export { SubscriptionsApi } from "./subscriptions.js";
|
|
52
56
|
export { ApiCallsApi } from "./api-calls.js";
|
|
53
57
|
export { TenantOAuthAppsApi } from "./tenant-oauth-apps.js";
|
|
54
58
|
/**
|
|
55
|
-
* The `console` namespace group on a `
|
|
59
|
+
* The `console` namespace group on a `W6WClient` — studio-internal, not part
|
|
56
60
|
* of the published partner contract.
|
|
57
61
|
*
|
|
58
62
|
* @example
|
|
@@ -89,12 +93,16 @@ export class ConsoleApi {
|
|
|
89
93
|
functions;
|
|
90
94
|
/** `console.endpoints.*`. */
|
|
91
95
|
endpoints;
|
|
96
|
+
/** `console.aliases.*`. */
|
|
97
|
+
aliases;
|
|
92
98
|
/** `console.subscriptions.*`. */
|
|
93
99
|
subscriptions;
|
|
94
100
|
/** `console.apiCalls.*`. */
|
|
95
101
|
apiCalls;
|
|
96
102
|
/** `console.tenantOAuthApps.*` — the caller's OWN tenant, never a tenant of its choosing. */
|
|
97
103
|
tenantOAuthApps;
|
|
104
|
+
/** `console.passkeys.*`. */
|
|
105
|
+
passkeys;
|
|
98
106
|
/**
|
|
99
107
|
* @param host - The client this namespace group issues requests through.
|
|
100
108
|
*/
|
|
@@ -113,9 +121,11 @@ export class ConsoleApi {
|
|
|
113
121
|
this.tokens = new TokensApi(host);
|
|
114
122
|
this.functions = new FunctionsApi(host);
|
|
115
123
|
this.endpoints = new EndpointsApi(host);
|
|
124
|
+
this.aliases = new AliasesApi(host);
|
|
116
125
|
this.subscriptions = new SubscriptionsApi(host);
|
|
117
126
|
this.apiCalls = new ApiCallsApi(host);
|
|
118
127
|
this.tenantOAuthApps = new TenantOAuthAppsApi(host);
|
|
128
|
+
this.passkeys = new PasskeysApi(host);
|
|
119
129
|
}
|
|
120
130
|
}
|
|
121
131
|
//# sourceMappingURL=mod.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mod.js","sourceRoot":"","sources":["../../../src/console/mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,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,C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C;QAC5C,IAAI,CAAC,SAAS,GAAG,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC;QACxC,IAAI,CAAC,UAAU,GAAG,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC;QAC1C,IAAI,CAAC,SAAS,GAAG,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC;QACxC,IAAI,CAAC,KAAK,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC;QAChC,IAAI,CAAC,MAAM,GAAG,IAAI,SAAS,CAAC,IAAI,CAAC,CAAC;QAClC,IAAI,CAAC,SAAS,GAAG,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC;QACxC,IAAI,CAAC,SAAS,GAAG,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC;QACxC,IAAI,CAAC,OAAO,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC;QACpC,IAAI,CAAC,aAAa,GAAG,IAAI,gBAAgB,CAAC,IAAI,CAAC,CAAC;QAChD,IAAI,CAAC,QAAQ,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;QACtC,IAAI,CAAC,eAAe,GAAG,IAAI,kBAAkB,CAAC,IAAI,CAAC,CAAC;QACpD,IAAI,CAAC,QAAQ,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC;CACF"}
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `client.console.passkeys.*` — WebAuthn passkey management and login for
|
|
3
|
+
* self-serve Studio users (T1.1.5).
|
|
4
|
+
*
|
|
5
|
+
* **Studio-internal, not the published partner contract.** This namespace
|
|
6
|
+
* lives under the `console` subpath export (`@w6w/sdk/console`), excluded from
|
|
7
|
+
* `endpoints.json` and from the root barrel (`mod.ts`) — see `docs/console.md`
|
|
8
|
+
* and HITL-1 in this task's contract. `@w6w/sdk`'s instance-state mechanism
|
|
9
|
+
* pin still applies here exactly as it does to every other namespace
|
|
10
|
+
* (`docs/implementation.md` §MECHANISM PIN — instance state, never globals):
|
|
11
|
+
* this class holds no state of its own beyond the injected host, so two
|
|
12
|
+
* clients in one process never share a credential.
|
|
13
|
+
*
|
|
14
|
+
* **Who this is for (HITL-3).** Passkeys belong to self-serve Studio users
|
|
15
|
+
* only; a partner-tenant user's IdP owns its identity. No eligibility logic
|
|
16
|
+
* lives here — the server enforces it (`PasskeyNotEligibleError`), and this
|
|
17
|
+
* module is a plain transport shim over whatever it decides.
|
|
18
|
+
*
|
|
19
|
+
* **Two routes, four methods, split by who is authenticated.** The management
|
|
20
|
+
* quartet (`registrationOptions`, `registrationVerify`, `list`, `revoke`) is
|
|
21
|
+
* GUARDED, mirroring `packages/server/packages/api/data/passkeys.ts`'s own
|
|
22
|
+
* doc comment ("Registered BELOW the auth guard"). The login pair
|
|
23
|
+
* (`authenticationOptions`, `authenticationVerify`) is PUBLIC, mirroring
|
|
24
|
+
* `packages/server/packages/api/id/passkey-login.ts`'s own doc comment ("BOTH
|
|
25
|
+
* routes are PUBLIC and UNAUTHENTICATED by construction") — discoverable
|
|
26
|
+
* credentials, no identifier in the request body (P1). Each of those two
|
|
27
|
+
* methods passes `requireAuth: false`, the same mechanism
|
|
28
|
+
* `console.auth.login`/`signup`/`checkAccountSlug` rely on: without it a
|
|
29
|
+
* tokenless client (the normal case at the login screen, before any session
|
|
30
|
+
* exists) would hit `requireToken`'s `ConfigError` before `fetch` is ever
|
|
31
|
+
* called.
|
|
32
|
+
*
|
|
33
|
+
* **`authenticationVerify` mints a session, the same way `login` does
|
|
34
|
+
* (HITL-5).** A verified passkey assertion is a standalone alternative to a
|
|
35
|
+
* password, not a second factor — so its response is token-bearing, exactly
|
|
36
|
+
* like `console.auth.login`'s. It is a SEPARATE type from `LoginResponse`
|
|
37
|
+
* (`./auth.ts`), not a reuse: the server route is byte-shape-identical to
|
|
38
|
+
* `user-login.ts`'s login body (`id/passkey-login.ts`'s own doc comment) which
|
|
39
|
+
* carries `role`, `tenant` and `emailVerified` on `user` — fields
|
|
40
|
+
* `console.auth`'s `LoginResponse.user` does not declare.
|
|
41
|
+
*
|
|
42
|
+
* **WebAuthn ceremony payloads (`options`/`response`) are opaque JSON, typed
|
|
43
|
+
* as `Record<string, unknown>`, never as `@simplewebauthn/*` types.** This
|
|
44
|
+
* package has no dependency on `@simplewebauthn` (browser or server) and
|
|
45
|
+
* adding one only to type two pass-through fields would be a new dependency
|
|
46
|
+
* for zero behavioural gain — `inputs.touch` for this task explicitly
|
|
47
|
+
* excludes `package.json`. A caller passes the browser's own
|
|
48
|
+
* `PublicKeyCredentialCreationOptionsJSON`/`...RequestOptionsJSON` (from
|
|
49
|
+
* `options`) into `navigator.credentials.create()`/`.get()` (or a helper such
|
|
50
|
+
* as `@simplewebauthn/browser`'s `startRegistration`/`startAuthentication`)
|
|
51
|
+
* and forwards what comes back as `response` — this module never inspects
|
|
52
|
+
* either shape, only relays it.
|
|
53
|
+
*
|
|
54
|
+
* @module
|
|
55
|
+
*/
|
|
56
|
+
import { type HttpResponse, type RequestOptions } from "../http.ts";
|
|
57
|
+
/**
|
|
58
|
+
* The slice of `W6WClient` this namespace needs: the transport, and nothing
|
|
59
|
+
* else. Structural rather than a concrete client type, so the namespace stays
|
|
60
|
+
* independently constructible in a test and this module never imports the
|
|
61
|
+
* client back — mirrors `TokensHost` in `./tokens.ts`.
|
|
62
|
+
*/
|
|
63
|
+
export interface PasskeysHost {
|
|
64
|
+
/** Perform one request. */
|
|
65
|
+
request<T>(options: RequestOptions): Promise<HttpResponse<T>>;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* A stored passkey, as the server exposes it. **Never the public key or the
|
|
69
|
+
* counter** — `packages/server/packages/api/data/passkeys.ts`'s own
|
|
70
|
+
* `WirePasskey`/`toWirePasskey()` state the identical invariant server-side.
|
|
71
|
+
*/
|
|
72
|
+
export interface Passkey {
|
|
73
|
+
/** Server-issued id. */
|
|
74
|
+
id: string;
|
|
75
|
+
/** Caller-chosen label (empty string when none was given at registration). */
|
|
76
|
+
label: string;
|
|
77
|
+
/** ISO-8601 timestamp. */
|
|
78
|
+
createdAt: string;
|
|
79
|
+
/** ISO-8601 timestamp of the credential's last successful authentication, or `null`. */
|
|
80
|
+
lastUsedAt: string | null;
|
|
81
|
+
/** WebAuthn transport hints reported at registration (e.g. `"internal"`, `"hybrid"`). */
|
|
82
|
+
transports: string[];
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* A fresh WebAuthn ceremony challenge — the shared result shape of
|
|
86
|
+
* `POST /me/passkeys/options` (`data/passkeys.ts:118-130`) and
|
|
87
|
+
* `POST /auth/passkey/options` (`id/passkey-login.ts:63-71`). Flat, no
|
|
88
|
+
* envelope key.
|
|
89
|
+
*/
|
|
90
|
+
export interface PasskeyCeremonyOptions {
|
|
91
|
+
/**
|
|
92
|
+
* WebAuthn ceremony options, opaque JSON forwarded verbatim to
|
|
93
|
+
* `navigator.credentials.create()`/`.get()` (or a browser WebAuthn helper).
|
|
94
|
+
* This package never inspects its shape — see this module's header.
|
|
95
|
+
*/
|
|
96
|
+
options: Record<string, unknown>;
|
|
97
|
+
/** Single-use challenge token. Echo it back on the paired verify call. */
|
|
98
|
+
challengeToken: string;
|
|
99
|
+
}
|
|
100
|
+
/** The body `registrationVerify` sends (`POST /me/passkeys`, `data/passkeys.ts:132-164`). */
|
|
101
|
+
export interface RegistrationVerifyInput {
|
|
102
|
+
/** The token returned by the paired `registrationOptions()` call. */
|
|
103
|
+
challengeToken: string;
|
|
104
|
+
/**
|
|
105
|
+
* The browser's `RegistrationResponseJSON`, opaque JSON — see this
|
|
106
|
+
* module's header.
|
|
107
|
+
*/
|
|
108
|
+
response: Record<string, unknown>;
|
|
109
|
+
/** Caller-chosen label for the new passkey. */
|
|
110
|
+
label?: string;
|
|
111
|
+
}
|
|
112
|
+
/** The body `authenticationVerify` sends (`POST /auth/passkey/verify`, `id/passkey-login.ts:73-110`). */
|
|
113
|
+
export interface AuthenticationVerifyInput {
|
|
114
|
+
/** The token returned by the paired `authenticationOptions()` call. */
|
|
115
|
+
challengeToken: string;
|
|
116
|
+
/**
|
|
117
|
+
* The browser's `AuthenticationResponseJSON`, opaque JSON — see this
|
|
118
|
+
* module's header.
|
|
119
|
+
*/
|
|
120
|
+
response: Record<string, unknown>;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* The user identity `authenticationVerify` mints a session for, as
|
|
124
|
+
* `id/passkey-login.ts` returns it — BYTE-SHAPE IDENTICAL to
|
|
125
|
+
* `console.auth`'s `LoginResponse.user`'s sibling in `user-login.ts`, but
|
|
126
|
+
* carrying more fields (`role`, `tenant`, `emailVerified`), which is why this
|
|
127
|
+
* is a separate type rather than a reuse of `./auth.ts`'s `User`.
|
|
128
|
+
*/
|
|
129
|
+
export interface PasskeyUser {
|
|
130
|
+
/** The user's email, or its `userId` when no email is on file. */
|
|
131
|
+
username: string;
|
|
132
|
+
/** Always `"user"` for a passkey login (`id/passkey-login.ts:100`). */
|
|
133
|
+
role: string;
|
|
134
|
+
/** The tenant the session is minted in. */
|
|
135
|
+
tenant: string;
|
|
136
|
+
emailVerified: boolean;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* `POST /auth/passkey/verify` → 200 (`id/passkey-login.ts:96-105`). Mints a
|
|
140
|
+
* session exactly like `console.auth.login` does (HITL-5) — a verified
|
|
141
|
+
* passkey assertion is a standalone alternative to a password, not a second
|
|
142
|
+
* factor.
|
|
143
|
+
*/
|
|
144
|
+
export interface PasskeyAuthenticationVerifyResponse {
|
|
145
|
+
token: string;
|
|
146
|
+
user: PasskeyUser;
|
|
147
|
+
expiresIn: number;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* The `console.passkeys` namespace on a `W6WClient`.
|
|
151
|
+
*
|
|
152
|
+
* @example
|
|
153
|
+
* ```ts
|
|
154
|
+
* // Registration (authenticated).
|
|
155
|
+
* const { options, challengeToken } = await client.console.passkeys.registrationOptions();
|
|
156
|
+
* const response = await startRegistration({ optionsJSON: options }); // e.g. @simplewebauthn/browser
|
|
157
|
+
* const passkey = await client.console.passkeys.registrationVerify({ challengeToken, response });
|
|
158
|
+
*
|
|
159
|
+
* // Login (public — works on a tokenless client).
|
|
160
|
+
* const opts = await client.console.passkeys.authenticationOptions();
|
|
161
|
+
* const assertion = await startAuthentication({ optionsJSON: opts.options });
|
|
162
|
+
* const { token } = await client.console.passkeys.authenticationVerify({
|
|
163
|
+
* challengeToken: opts.challengeToken,
|
|
164
|
+
* response: assertion,
|
|
165
|
+
* });
|
|
166
|
+
* ```
|
|
167
|
+
*/
|
|
168
|
+
export declare class PasskeysApi {
|
|
169
|
+
#private;
|
|
170
|
+
/**
|
|
171
|
+
* @param host - The client this namespace issues requests through.
|
|
172
|
+
*/
|
|
173
|
+
constructor(host: PasskeysHost);
|
|
174
|
+
/**
|
|
175
|
+
* A fresh registration challenge, scoped to the caller's own identity.
|
|
176
|
+
*
|
|
177
|
+
* AUTHENTICATED — the default `requireAuth` applies.
|
|
178
|
+
*
|
|
179
|
+
* @returns The ceremony options and a single-use challenge token.
|
|
180
|
+
* @throws {ApiError} `400 passkey_not_configured`, `403 passkey_not_eligible`.
|
|
181
|
+
*/
|
|
182
|
+
registrationOptions(): Promise<PasskeyCeremonyOptions>;
|
|
183
|
+
/**
|
|
184
|
+
* Verify a registration ceremony and store the credential.
|
|
185
|
+
*
|
|
186
|
+
* AUTHENTICATED — the default `requireAuth` applies.
|
|
187
|
+
*
|
|
188
|
+
* @param input - The challenge token from `registrationOptions()`, the browser's ceremony
|
|
189
|
+
* response, and an optional caller-chosen label.
|
|
190
|
+
* @returns The stored passkey's metadata, unwrapped from the `passkey` envelope.
|
|
191
|
+
* @throws {ApiError} `400 passkey_registration_failed`, `403 passkey_not_eligible`,
|
|
192
|
+
* `409 passkey_already_registered`.
|
|
193
|
+
*/
|
|
194
|
+
registrationVerify(input: RegistrationVerifyInput): Promise<Passkey>;
|
|
195
|
+
/**
|
|
196
|
+
* A fresh authentication challenge. No identifier is sent or accepted —
|
|
197
|
+
* discoverable credentials only (P1): the owner is resolved server-side
|
|
198
|
+
* from the assertion itself, never from anything this call sends.
|
|
199
|
+
*
|
|
200
|
+
* PUBLIC — sends no bearer, even on a client that already holds one
|
|
201
|
+
* (`requireAuth: false`). Without it, the login screen (the normal case:
|
|
202
|
+
* no session exists yet) could never call this method at all — a tokenless
|
|
203
|
+
* client would hit `requireToken`'s `ConfigError` before `fetch` is ever
|
|
204
|
+
* called.
|
|
205
|
+
*
|
|
206
|
+
* @returns The ceremony options and a single-use challenge token.
|
|
207
|
+
* @throws {ApiError} `400 passkey_not_configured`.
|
|
208
|
+
*/
|
|
209
|
+
authenticationOptions(): Promise<PasskeyCeremonyOptions>;
|
|
210
|
+
/**
|
|
211
|
+
* Verify an authentication (login) ceremony and mint a session — the same
|
|
212
|
+
* way `console.auth.login` does (HITL-5).
|
|
213
|
+
*
|
|
214
|
+
* PUBLIC — sends no bearer, even on a client that already holds one
|
|
215
|
+
* (`requireAuth: false`). Every failure mode past a malformed body is the
|
|
216
|
+
* same `401 passkey_rejected` (P9): unknown credential, revoked credential,
|
|
217
|
+
* wrong kind, bad signature, counter regression, and a spent/invalid
|
|
218
|
+
* challenge are indistinguishable to the caller.
|
|
219
|
+
*
|
|
220
|
+
* @param input - The challenge token from `authenticationOptions()` and the browser's ceremony
|
|
221
|
+
* response.
|
|
222
|
+
* @returns The token, the caller's identity, and the token's lifetime.
|
|
223
|
+
* @throws {ApiError} `401 passkey_rejected` on any verification failure.
|
|
224
|
+
*/
|
|
225
|
+
authenticationVerify(input: AuthenticationVerifyInput): Promise<PasskeyAuthenticationVerifyResponse>;
|
|
226
|
+
/**
|
|
227
|
+
* List the caller's own passkeys.
|
|
228
|
+
*
|
|
229
|
+
* AUTHENTICATED — the default `requireAuth` applies.
|
|
230
|
+
*
|
|
231
|
+
* @returns The caller's passkeys, unwrapped from the `passkeys` envelope. Never the empty array
|
|
232
|
+
* collapsed to `undefined` — an empty account gets `[]`.
|
|
233
|
+
*/
|
|
234
|
+
list(): Promise<Passkey[]>;
|
|
235
|
+
/**
|
|
236
|
+
* Revoke (delete) one of the caller's own passkeys.
|
|
237
|
+
*
|
|
238
|
+
* AUTHENTICATED — the default `requireAuth` applies.
|
|
239
|
+
*
|
|
240
|
+
* @param id - The passkey id.
|
|
241
|
+
* @returns Nothing: the server answers `204` with no body.
|
|
242
|
+
* @throws {ApiError} `404 passkey_not_found`.
|
|
243
|
+
*/
|
|
244
|
+
revoke(id: string): Promise<void>;
|
|
245
|
+
}
|
|
246
|
+
//# sourceMappingURL=passkeys.d.ts.map
|