@w6w/sdk 0.5.0 → 0.9.8
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 +185 -32
- package/dist/mod.d.ts +10 -4
- package/dist/mod.d.ts.map +1 -1
- package/dist/mod.js +3 -0
- package/dist/mod.js.map +1 -1
- package/dist/src/client.d.ts +37 -5
- package/dist/src/client.d.ts.map +1 -1
- package/dist/src/client.js +40 -5
- package/dist/src/client.js.map +1 -1
- package/dist/src/config.d.ts +83 -6
- package/dist/src/config.d.ts.map +1 -1
- package/dist/src/config.js +41 -5
- package/dist/src/config.js.map +1 -1
- package/dist/src/connections.d.ts +3 -2
- package/dist/src/connections.d.ts.map +1 -1
- package/dist/src/connections.js +7 -2
- package/dist/src/connections.js.map +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 +4 -3
- package/dist/src/console/api-calls.d.ts.map +1 -1
- package/dist/src/console/api-calls.js +4 -3
- package/dist/src/console/api-calls.js.map +1 -1
- package/dist/src/console/apps.d.ts +181 -8
- package/dist/src/console/apps.d.ts.map +1 -1
- package/dist/src/console/apps.js +67 -12
- package/dist/src/console/apps.js.map +1 -1
- package/dist/src/console/auth.d.ts +245 -7
- package/dist/src/console/auth.d.ts.map +1 -1
- package/dist/src/console/auth.js +177 -8
- package/dist/src/console/auth.js.map +1 -1
- package/dist/src/console/commerce.d.ts +428 -0
- package/dist/src/console/commerce.d.ts.map +1 -0
- package/dist/src/console/commerce.js +220 -0
- package/dist/src/console/commerce.js.map +1 -0
- package/dist/src/console/dashboard.d.ts +8 -0
- package/dist/src/console/dashboard.d.ts.map +1 -1
- package/dist/src/console/dashboard.js.map +1 -1
- package/dist/src/console/endpoints.d.ts +79 -6
- package/dist/src/console/endpoints.d.ts.map +1 -1
- package/dist/src/console/endpoints.js.map +1 -1
- package/dist/src/console/functions.d.ts +35 -4
- package/dist/src/console/functions.d.ts.map +1 -1
- package/dist/src/console/functions.js +13 -0
- package/dist/src/console/functions.js.map +1 -1
- package/dist/src/console/mod.d.ts +32 -7
- package/dist/src/console/mod.d.ts.map +1 -1
- package/dist/src/console/mod.js +26 -1
- package/dist/src/console/mod.js.map +1 -1
- package/dist/src/console/otp.d.ts +127 -0
- package/dist/src/console/otp.d.ts.map +1 -0
- package/dist/src/console/otp.js +118 -0
- package/dist/src/console/otp.js.map +1 -0
- 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/reliability.d.ts +101 -6
- package/dist/src/console/reliability.d.ts.map +1 -1
- package/dist/src/console/reliability.js +16 -5
- package/dist/src/console/reliability.js.map +1 -1
- package/dist/src/console/step-tests.d.ts +7 -1
- package/dist/src/console/step-tests.d.ts.map +1 -1
- package/dist/src/console/step-tests.js +1 -1
- package/dist/src/console/step-tests.js.map +1 -1
- package/dist/src/console/subscriptions.d.ts +38 -16
- package/dist/src/console/subscriptions.d.ts.map +1 -1
- package/dist/src/console/subscriptions.js +7 -13
- package/dist/src/console/subscriptions.js.map +1 -1
- package/dist/src/console/tenant-login-flags.d.ts +106 -0
- package/dist/src/console/tenant-login-flags.d.ts.map +1 -0
- package/dist/src/console/tenant-login-flags.js +113 -0
- package/dist/src/console/tenant-login-flags.js.map +1 -0
- package/dist/src/console/tenant-oauth-apps.d.ts +75 -14
- package/dist/src/console/tenant-oauth-apps.d.ts.map +1 -1
- package/dist/src/console/tenant-oauth-apps.js +37 -11
- package/dist/src/console/tenant-oauth-apps.js.map +1 -1
- package/dist/src/console/tokens.d.ts +2 -0
- package/dist/src/console/tokens.d.ts.map +1 -1
- package/dist/src/console/tokens.js.map +1 -1
- package/dist/src/console/workflows.d.ts +14 -0
- package/dist/src/console/workflows.d.ts.map +1 -1
- package/dist/src/console/workflows.js +13 -0
- package/dist/src/console/workflows.js.map +1 -1
- package/dist/src/documents.d.ts +9 -5
- package/dist/src/documents.d.ts.map +1 -1
- package/dist/src/documents.js +6 -3
- package/dist/src/documents.js.map +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 +236 -0
- package/dist/src/functions.d.ts.map +1 -0
- package/dist/src/functions.js +201 -0
- package/dist/src/functions.js.map +1 -0
- package/dist/src/http.d.ts +58 -10
- package/dist/src/http.d.ts.map +1 -1
- package/dist/src/http.js +82 -11
- package/dist/src/http.js.map +1 -1
- package/dist/src/me.d.ts +3 -2
- package/dist/src/me.d.ts.map +1 -1
- package/dist/src/me.js +7 -2
- package/dist/src/me.js.map +1 -1
- package/dist/src/run.d.ts +19 -5
- package/dist/src/run.d.ts.map +1 -1
- package/dist/src/run.js +14 -4
- package/dist/src/run.js.map +1 -1
- package/dist/src/server/mod.d.ts +100 -0
- package/dist/src/server/mod.d.ts.map +1 -0
- package/dist/src/server/mod.js +121 -0
- package/dist/src/server/mod.js.map +1 -0
- package/dist/src/team.d.ts +204 -0
- package/dist/src/team.d.ts.map +1 -0
- package/dist/src/team.js +161 -0
- package/dist/src/team.js.map +1 -0
- package/dist/src/types.d.ts +143 -10
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.js +27 -0
- package/dist/src/types.js.map +1 -1
- package/dist/src/vars.d.ts +5 -3
- package/dist/src/vars.d.ts.map +1 -1
- package/dist/src/vars.js +14 -4
- package/dist/src/vars.js.map +1 -1
- package/dist/src/version.js +1 -1
- package/dist/src/workflows.d.ts +261 -9
- package/dist/src/workflows.d.ts.map +1 -1
- package/dist/src/workflows.js +246 -7
- package/dist/src/workflows.js.map +1 -1
- package/package.json +5 -1
|
@@ -0,0 +1,192 @@
|
|
|
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 { path } from "../http.js";
|
|
57
|
+
import { unwrap } from "../types.js";
|
|
58
|
+
/**
|
|
59
|
+
* The `console.passkeys` namespace on a `W6WClient`.
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```ts
|
|
63
|
+
* // Registration (authenticated).
|
|
64
|
+
* const { options, challengeToken } = await client.console.passkeys.registrationOptions();
|
|
65
|
+
* const response = await startRegistration({ optionsJSON: options }); // e.g. @simplewebauthn/browser
|
|
66
|
+
* const passkey = await client.console.passkeys.registrationVerify({ challengeToken, response });
|
|
67
|
+
*
|
|
68
|
+
* // Login (public — works on a tokenless client).
|
|
69
|
+
* const opts = await client.console.passkeys.authenticationOptions();
|
|
70
|
+
* const assertion = await startAuthentication({ optionsJSON: opts.options });
|
|
71
|
+
* const { token } = await client.console.passkeys.authenticationVerify({
|
|
72
|
+
* challengeToken: opts.challengeToken,
|
|
73
|
+
* response: assertion,
|
|
74
|
+
* });
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
export class PasskeysApi {
|
|
78
|
+
#host;
|
|
79
|
+
/**
|
|
80
|
+
* @param host - The client this namespace issues requests through.
|
|
81
|
+
*/
|
|
82
|
+
constructor(host) {
|
|
83
|
+
this.#host = host;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* A fresh registration challenge, scoped to the caller's own identity.
|
|
87
|
+
*
|
|
88
|
+
* AUTHENTICATED — the default `requireAuth` applies.
|
|
89
|
+
*
|
|
90
|
+
* @returns The ceremony options and a single-use challenge token.
|
|
91
|
+
* @throws {ApiError} `400 passkey_not_configured`, `403 passkey_not_eligible`.
|
|
92
|
+
*/
|
|
93
|
+
async registrationOptions() {
|
|
94
|
+
const res = await this.#host.request({
|
|
95
|
+
method: "POST",
|
|
96
|
+
path: "/me/passkeys/options",
|
|
97
|
+
body: {},
|
|
98
|
+
});
|
|
99
|
+
return res.body;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Verify a registration ceremony and store the credential.
|
|
103
|
+
*
|
|
104
|
+
* AUTHENTICATED — the default `requireAuth` applies.
|
|
105
|
+
*
|
|
106
|
+
* @param input - The challenge token from `registrationOptions()`, the browser's ceremony
|
|
107
|
+
* response, and an optional caller-chosen label.
|
|
108
|
+
* @returns The stored passkey's metadata, unwrapped from the `passkey` envelope.
|
|
109
|
+
* @throws {ApiError} `400 passkey_registration_failed`, `403 passkey_not_eligible`,
|
|
110
|
+
* `409 passkey_already_registered`.
|
|
111
|
+
*/
|
|
112
|
+
async registrationVerify(input) {
|
|
113
|
+
const res = await this.#host.request({
|
|
114
|
+
method: "POST",
|
|
115
|
+
path: "/me/passkeys",
|
|
116
|
+
body: input,
|
|
117
|
+
});
|
|
118
|
+
return unwrap(res, "passkey");
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* A fresh authentication challenge. No identifier is sent or accepted —
|
|
122
|
+
* discoverable credentials only (P1): the owner is resolved server-side
|
|
123
|
+
* from the assertion itself, never from anything this call sends.
|
|
124
|
+
*
|
|
125
|
+
* PUBLIC — sends no bearer, even on a client that already holds one
|
|
126
|
+
* (`requireAuth: false`). Without it, the login screen (the normal case:
|
|
127
|
+
* no session exists yet) could never call this method at all — a tokenless
|
|
128
|
+
* client would hit `requireToken`'s `ConfigError` before `fetch` is ever
|
|
129
|
+
* called.
|
|
130
|
+
*
|
|
131
|
+
* @returns The ceremony options and a single-use challenge token.
|
|
132
|
+
* @throws {ApiError} `400 passkey_not_configured`.
|
|
133
|
+
*/
|
|
134
|
+
async authenticationOptions() {
|
|
135
|
+
const res = await this.#host.request({
|
|
136
|
+
method: "POST",
|
|
137
|
+
path: "/auth/passkey/options",
|
|
138
|
+
body: {},
|
|
139
|
+
requireAuth: false,
|
|
140
|
+
});
|
|
141
|
+
return res.body;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Verify an authentication (login) ceremony and mint a session — the same
|
|
145
|
+
* way `console.auth.login` does (HITL-5).
|
|
146
|
+
*
|
|
147
|
+
* PUBLIC — sends no bearer, even on a client that already holds one
|
|
148
|
+
* (`requireAuth: false`). Every failure mode past a malformed body is the
|
|
149
|
+
* same `401 passkey_rejected` (P9): unknown credential, revoked credential,
|
|
150
|
+
* wrong kind, bad signature, counter regression, and a spent/invalid
|
|
151
|
+
* challenge are indistinguishable to the caller.
|
|
152
|
+
*
|
|
153
|
+
* @param input - The challenge token from `authenticationOptions()` and the browser's ceremony
|
|
154
|
+
* response.
|
|
155
|
+
* @returns The token, the caller's identity, and the token's lifetime.
|
|
156
|
+
* @throws {ApiError} `401 passkey_rejected` on any verification failure.
|
|
157
|
+
*/
|
|
158
|
+
async authenticationVerify(input) {
|
|
159
|
+
const res = await this.#host.request({
|
|
160
|
+
method: "POST",
|
|
161
|
+
path: "/auth/passkey/verify",
|
|
162
|
+
body: input,
|
|
163
|
+
requireAuth: false,
|
|
164
|
+
});
|
|
165
|
+
return res.body;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* List the caller's own passkeys.
|
|
169
|
+
*
|
|
170
|
+
* AUTHENTICATED — the default `requireAuth` applies.
|
|
171
|
+
*
|
|
172
|
+
* @returns The caller's passkeys, unwrapped from the `passkeys` envelope. Never the empty array
|
|
173
|
+
* collapsed to `undefined` — an empty account gets `[]`.
|
|
174
|
+
*/
|
|
175
|
+
async list() {
|
|
176
|
+
const res = await this.#host.request({ method: "GET", path: "/me/passkeys" });
|
|
177
|
+
return unwrap(res, "passkeys");
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Revoke (delete) one of the caller's own passkeys.
|
|
181
|
+
*
|
|
182
|
+
* AUTHENTICATED — the default `requireAuth` applies.
|
|
183
|
+
*
|
|
184
|
+
* @param id - The passkey id.
|
|
185
|
+
* @returns Nothing: the server answers `204` with no body.
|
|
186
|
+
* @throws {ApiError} `404 passkey_not_found`.
|
|
187
|
+
*/
|
|
188
|
+
async revoke(id) {
|
|
189
|
+
await this.#host.request({ method: "DELETE", path: path `/me/passkeys/${id}` });
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
//# sourceMappingURL=passkeys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"passkeys.js","sourceRoot":"","sources":["../../../src/console/passkeys.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AAEH,OAAO,EAAqB,IAAI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sB;YAC5B,IAAI,EAAE,KAAK;YACX,WAAW,EAAE,KAAK;SACnB,CAAC,CAAC;QACH,OAAO,GAAG,CAAC,IAAI,CAAC;IAClB,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,IAAI;QACR,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAU,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,CAAC;QACvF,OAAO,MAAM,CAAY,GAAG,EAAE,UAAU,CAAC,CAAC;IAC5C,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,MAAM,CAAC,EAAU;QACrB,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAA,gBAAgB,EAAE,EAAE,EAAE,CAAC,CAAC;IAC1F,CAAC;CACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `client.console.reliability.*` — the
|
|
2
|
+
* `client.console.reliability.*` — the project-scoped reliability board,
|
|
3
3
|
* relocated from the studio's own API client.
|
|
4
4
|
*
|
|
5
5
|
* **Studio-internal, not the published partner contract.** This namespace
|
|
@@ -51,6 +51,36 @@ export interface ReliabilityUptimeDay {
|
|
|
51
51
|
calls: number;
|
|
52
52
|
errors: ReliabilityErrorMix;
|
|
53
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* Per-component detail inside a `ReliabilityVendorStatus.components` map. No
|
|
56
|
+
* `@w6w/types` dependency here — this is the SDK's own local copy, the same
|
|
57
|
+
* deliberate pattern `ReliabilityState` already follows.
|
|
58
|
+
*/
|
|
59
|
+
export interface ReliabilityComponentReport {
|
|
60
|
+
state: ReliabilityState;
|
|
61
|
+
message?: string;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* One entry in a vendor's own incident history. Field-for-field with core's
|
|
65
|
+
* `HealthTimelineEntry` — see `ReliabilityComponentReport` for why this is a
|
|
66
|
+
* local copy rather than an import.
|
|
67
|
+
*/
|
|
68
|
+
export interface ReliabilityTimelineEntry {
|
|
69
|
+
/** Stable identity, when the source states one — an incident id, not a title. */
|
|
70
|
+
id?: string;
|
|
71
|
+
title: string;
|
|
72
|
+
state: ReliabilityState;
|
|
73
|
+
/** Component ids (matching `ReliabilityVendorStatus.components`) this entry is about. */
|
|
74
|
+
components?: string[];
|
|
75
|
+
/** ISO 8601 — when the incident began. */
|
|
76
|
+
startedAt?: string;
|
|
77
|
+
/** ISO 8601 — when the incident was last updated. */
|
|
78
|
+
updatedAt?: string;
|
|
79
|
+
/** ISO 8601 — when the incident was resolved. Absent means "not stated". */
|
|
80
|
+
resolvedAt?: string;
|
|
81
|
+
/** Link to the vendor's own incident/status page entry, when it has one. */
|
|
82
|
+
link?: string;
|
|
83
|
+
}
|
|
54
84
|
/** The vendor's own verdict for one service. See `ReliabilityService.vendorStatus`. */
|
|
55
85
|
export interface ReliabilityVendorStatus {
|
|
56
86
|
state: ReliabilityState;
|
|
@@ -59,11 +89,27 @@ export interface ReliabilityVendorStatus {
|
|
|
59
89
|
checkedAt: string;
|
|
60
90
|
/** Keys of the checks behind a non-`ok` verdict. Empty when `ok`. */
|
|
61
91
|
attributedTo: string[];
|
|
92
|
+
/** Every surface every public check named, worst-state-wins on collision.
|
|
93
|
+
* `null` = no public check reported a breakdown at all. */
|
|
94
|
+
components: Record<string, ReliabilityComponentReport> | null;
|
|
95
|
+
/** Vendor incident history, newest first. `null` = no public check publishes history
|
|
96
|
+
* (Stripe); `[]` = one does and there is nothing in it. The two are DIFFERENT FACTS
|
|
97
|
+
* and the studio renders them differently. */
|
|
98
|
+
timeline: ReliabilityTimelineEntry[] | null;
|
|
99
|
+
/** The vendor's own status PAGE (not the feed URL), for a link out. `null` when the
|
|
100
|
+
* App declares nothing to derive one from. */
|
|
101
|
+
statusPageUrl: string | null;
|
|
62
102
|
}
|
|
63
103
|
/** One row of the service board — a single external service the account calls. */
|
|
64
104
|
export interface ReliabilityService {
|
|
65
105
|
appId: string;
|
|
66
106
|
displayName: string;
|
|
107
|
+
/** Inlined catalog icon for this requested service, when it declares one. */
|
|
108
|
+
iconSrc?: string;
|
|
109
|
+
/** Optional dark-mode icon variant. */
|
|
110
|
+
iconSrcDark?: string;
|
|
111
|
+
/** Brand-colour fallback when the app has no icon. */
|
|
112
|
+
brandColor?: string;
|
|
67
113
|
state: ReliabilityState;
|
|
68
114
|
hasDeclaredHealth: boolean;
|
|
69
115
|
calls: number;
|
|
@@ -73,8 +119,17 @@ export interface ReliabilityService {
|
|
|
73
119
|
openAdvisories: number;
|
|
74
120
|
/** Non-null while an outage is still open. */
|
|
75
121
|
ongoingOutageId: string | null;
|
|
76
|
-
/**
|
|
77
|
-
*
|
|
122
|
+
/**
|
|
123
|
+
* Null when the account has never called this service.
|
|
124
|
+
*
|
|
125
|
+
* Breaks ties in the server's ordering — but only WITHIN an urgency tier. The
|
|
126
|
+
* server sorts a board by how urgent each row is first (anything degraded or
|
|
127
|
+
* down on either signal, then anything the window shows trouble in, then the
|
|
128
|
+
* rest) and by `lastCallAt` descending, nulls last, inside each tier. That
|
|
129
|
+
* matters most under `?limit=N`: a purely recency-ordered cap can cut the
|
|
130
|
+
* degraded services the board exists to surface. The client never re-sorts by
|
|
131
|
+
* this or anything else.
|
|
132
|
+
*/
|
|
78
133
|
lastCallAt: string | null;
|
|
79
134
|
/**
|
|
80
135
|
* Gap-free, exactly `window.days` entries, ONE PER CALENDAR DAY, OLDEST FIRST —
|
|
@@ -97,6 +152,26 @@ export interface ReliabilityService {
|
|
|
97
152
|
* board renders them differently.
|
|
98
153
|
*/
|
|
99
154
|
vendorStatus: ReliabilityVendorStatus | null;
|
|
155
|
+
/**
|
|
156
|
+
* Which urgency tier the server sorted this row into — and the field a UI
|
|
157
|
+
* should GROUP on rather than re-deriving the tier from `state`,
|
|
158
|
+
* `ongoingOutageId` and `vendorStatus` itself.
|
|
159
|
+
*
|
|
160
|
+
* `now` — degraded or down right now, on YOUR CALLS or PER THE VENDOR.
|
|
161
|
+
* Either signal alone is enough: a service can be answering you
|
|
162
|
+
* perfectly while its vendor publishes an incident.
|
|
163
|
+
* `recent` — clear now, but this window holds a failed stretch or an open
|
|
164
|
+
* advisory.
|
|
165
|
+
* `none` — clear.
|
|
166
|
+
*
|
|
167
|
+
* `unknown` on either signal is NOT attention: on your calls it means the
|
|
168
|
+
* window held none (idle, not broken), and on the vendor it means the status
|
|
169
|
+
* page could not be read — a gap in our reading, not a finding about them.
|
|
170
|
+
*
|
|
171
|
+
* This drives the `?limit=N` cut, which is why it is worth having on the
|
|
172
|
+
* wire: a capped board keeps the most urgent rows, not the most recent ones.
|
|
173
|
+
*/
|
|
174
|
+
attention: "now" | "recent" | "none";
|
|
100
175
|
}
|
|
101
176
|
/**
|
|
102
177
|
* Account-scoped reliability board (server `GET /reliability/services?days=…`,
|
|
@@ -122,12 +197,28 @@ export interface ReliabilityServices {
|
|
|
122
197
|
};
|
|
123
198
|
services: ReliabilityService[];
|
|
124
199
|
}
|
|
200
|
+
/** Identifier-only project membership discovery; it performs no status probes. */
|
|
201
|
+
export interface ReliabilityServiceMembers {
|
|
202
|
+
account: string;
|
|
203
|
+
window: {
|
|
204
|
+
from: string;
|
|
205
|
+
to: string;
|
|
206
|
+
days: number;
|
|
207
|
+
};
|
|
208
|
+
uptimeMeans: string;
|
|
209
|
+
definition: {
|
|
210
|
+
id: string;
|
|
211
|
+
version: string;
|
|
212
|
+
source: string;
|
|
213
|
+
};
|
|
214
|
+
appIds: string[];
|
|
215
|
+
}
|
|
125
216
|
/**
|
|
126
217
|
* The `console.reliability` namespace on a `W6WClient`.
|
|
127
218
|
*
|
|
128
219
|
* @example
|
|
129
220
|
* ```ts
|
|
130
|
-
* const board = await client.console.reliability.list(
|
|
221
|
+
* const board = await client.console.reliability.list("prj_123", ["io.w6w.stripe"], 30);
|
|
131
222
|
* ```
|
|
132
223
|
*/
|
|
133
224
|
export declare class ReliabilityApi {
|
|
@@ -137,13 +228,17 @@ export declare class ReliabilityApi {
|
|
|
137
228
|
*/
|
|
138
229
|
constructor(host: ReliabilityHost);
|
|
139
230
|
/**
|
|
140
|
-
* Fetch
|
|
231
|
+
* Fetch one project's reliability board.
|
|
141
232
|
*
|
|
233
|
+
* @param project - The project whose services and calls are reported.
|
|
234
|
+
* @param appIds - Explicit service filter. The server accepts at most ten ids.
|
|
142
235
|
* @param days - The window size in days. Omitted, the server applies its own default.
|
|
143
236
|
* @param limit - Cap on the number of services returned, most-recently-called first. Omitted, no cap.
|
|
144
237
|
* @returns The board, exactly as the server sent it — no envelope key to peel.
|
|
145
238
|
* @throws {ApiError} On any non-2xx.
|
|
146
239
|
*/
|
|
147
|
-
list(days?: number, limit?: number): Promise<ReliabilityServices>;
|
|
240
|
+
list(project: string, appIds: readonly string[], days?: number, limit?: number): Promise<ReliabilityServices>;
|
|
241
|
+
/** Discover project members before issuing bounded status batches. */
|
|
242
|
+
listMembers(project: string, days?: number): Promise<ReliabilityServiceMembers>;
|
|
148
243
|
}
|
|
149
244
|
//# sourceMappingURL=reliability.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reliability.d.ts","sourceRoot":"","sources":["../../../src/console/reliability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE/D;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B,2BAA2B;IAC3B,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;CAC/D;AAED;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,IAAI,GAAG,UAAU,GAAG,MAAM,GAAG,SAAS,CAAC;AAEtE,sFAAsF;AACtF,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,C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AAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5D,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED;;;;;;;GAOG;AACH,qBAAa,cAAc;;IAGzB;;OAEG;gBACS,IAAI,EAAE,eAAe;IAIjC;;;;;;;;;OASG;IACG,IAAI,CACR,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,SAAS,MAAM,EAAE,EACzB,IAAI,CAAC,EAAE,MAAM,EACb,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,mBAAmB,CAAC;IAS/B,sEAAsE;IAChE,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,yBAAyB,CAAC;CAQtF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `client.console.reliability.*` — the
|
|
2
|
+
* `client.console.reliability.*` — the project-scoped reliability board,
|
|
3
3
|
* relocated from the studio's own API client.
|
|
4
4
|
*
|
|
5
5
|
* **Studio-internal, not the published partner contract.** This namespace
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
*
|
|
26
26
|
* @example
|
|
27
27
|
* ```ts
|
|
28
|
-
* const board = await client.console.reliability.list(
|
|
28
|
+
* const board = await client.console.reliability.list("prj_123", ["io.w6w.stripe"], 30);
|
|
29
29
|
* ```
|
|
30
30
|
*/
|
|
31
31
|
export class ReliabilityApi {
|
|
@@ -37,18 +37,29 @@ export class ReliabilityApi {
|
|
|
37
37
|
this.#host = host;
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
40
|
-
* Fetch
|
|
40
|
+
* Fetch one project's reliability board.
|
|
41
41
|
*
|
|
42
|
+
* @param project - The project whose services and calls are reported.
|
|
43
|
+
* @param appIds - Explicit service filter. The server accepts at most ten ids.
|
|
42
44
|
* @param days - The window size in days. Omitted, the server applies its own default.
|
|
43
45
|
* @param limit - Cap on the number of services returned, most-recently-called first. Omitted, no cap.
|
|
44
46
|
* @returns The board, exactly as the server sent it — no envelope key to peel.
|
|
45
47
|
* @throws {ApiError} On any non-2xx.
|
|
46
48
|
*/
|
|
47
|
-
async list(days, limit) {
|
|
49
|
+
async list(project, appIds, days, limit) {
|
|
48
50
|
const res = await this.#host.request({
|
|
49
51
|
method: "GET",
|
|
50
52
|
path: "/reliability/services",
|
|
51
|
-
query: { days, limit },
|
|
53
|
+
query: { project, apps: appIds.join(","), days, limit },
|
|
54
|
+
});
|
|
55
|
+
return res.body;
|
|
56
|
+
}
|
|
57
|
+
/** Discover project members before issuing bounded status batches. */
|
|
58
|
+
async listMembers(project, days) {
|
|
59
|
+
const res = await this.#host.request({
|
|
60
|
+
method: "GET",
|
|
61
|
+
path: "/reliability/services/members",
|
|
62
|
+
query: { project, days },
|
|
52
63
|
});
|
|
53
64
|
return res.body;
|
|
54
65
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reliability.js","sourceRoot":"","sources":["../../../src/console/reliability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;
|
|
1
|
+
{"version":3,"file":"reliability.js","sourceRoot":"","sources":["../../../src/console/reliability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AA8LH;;;;;;;GAOG;AACH,MAAM,OAAO,cAAc;IAChB,KAAK,CAAkB;IAEhC;;OAEG;IACH,YAAY,IAAqB;QAC/B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACpB,CAAC;IAED;;;;;;;;;OASG;IACH,KAAK,CAAC,IAAI,CACR,OAAe,EACf,MAAyB,EACzB,IAAa,EACb,KAAc;QAEd,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAsB;YACxD,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,uBAAuB;YAC7B,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE;SACxD,CAAC,CAAC;QACH,OAAO,GAAG,CAAC,IAAI,CAAC;IAClB,CAAC;IAED,sEAAsE;IACtE,KAAK,CAAC,WAAW,CAAC,OAAe,EAAE,IAAa;QAC9C,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAA4B;YAC9D,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,+BAA+B;YACrC,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;SACzB,CAAC,CAAC;QACH,OAAO,GAAG,CAAC,IAAI,CAAC;IAClB,CAAC;CACF"}
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
* @module
|
|
43
43
|
*/
|
|
44
44
|
import { type HttpResponse, type RequestOptions } from "../http.ts";
|
|
45
|
+
import type { StepMeta } from "./apps.ts";
|
|
45
46
|
/**
|
|
46
47
|
* The slice of `W6WClient` this namespace needs: the transport, and nothing
|
|
47
48
|
* else. Structural rather than a concrete client type, so the namespace stays
|
|
@@ -72,6 +73,8 @@ export interface StepTest {
|
|
|
72
73
|
lastRunStatus?: string | null;
|
|
73
74
|
lastRunError?: unknown;
|
|
74
75
|
lastRunOutput?: unknown;
|
|
76
|
+
/** Metadata of the most recent run; omitted when none was recorded. */
|
|
77
|
+
lastRunMeta?: StepMeta | null;
|
|
75
78
|
}
|
|
76
79
|
/** The real row `recordRun` creates (mirrors the server's `StepTestRun`). */
|
|
77
80
|
export interface StepTestRun {
|
|
@@ -84,6 +87,8 @@ export interface StepTestRun {
|
|
|
84
87
|
output: unknown;
|
|
85
88
|
error: unknown;
|
|
86
89
|
createdAt: string;
|
|
90
|
+
/** Metadata the run reported; omitted when none was recorded. */
|
|
91
|
+
meta?: StepMeta | null;
|
|
87
92
|
}
|
|
88
93
|
/**
|
|
89
94
|
* The `console.stepTests` namespace on a `W6WClient`.
|
|
@@ -143,7 +148,7 @@ export declare class StepTestsApi {
|
|
|
143
148
|
* @param workflowId - The `wf_…` id.
|
|
144
149
|
* @param stepId - The step's id within that workflow.
|
|
145
150
|
* @param body - `stepTestId` (optional), `status`, and optional
|
|
146
|
-
* `input`/`output`/`error
|
|
151
|
+
* `input`/`output`/`error`/`meta` (the server sanitizes `meta`), forwarded verbatim.
|
|
147
152
|
* @returns The created `StepTestRun`, unwrapped from the `run` envelope (the server answers `201`).
|
|
148
153
|
* @throws {ApiError} `400 invalid_body`/`invalid_status`. No `404` — the
|
|
149
154
|
* route never checks the workflow/step exist before writing.
|
|
@@ -154,6 +159,7 @@ export declare class StepTestsApi {
|
|
|
154
159
|
input?: unknown;
|
|
155
160
|
output?: unknown;
|
|
156
161
|
error?: unknown;
|
|
162
|
+
meta?: unknown;
|
|
157
163
|
}): Promise<StepTestRun>;
|
|
158
164
|
}
|
|
159
165
|
//# sourceMappingURL=step-tests.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step-tests.d.ts","sourceRoot":"","sources":["../../../src/console/step-tests.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH,OAAO,EAAE,KAAK,YAAY,EAAQ,KAAK,cAAc,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"step-tests.d.ts","sourceRoot":"","sources":["../../../src/console/step-tests.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH,OAAO,EAAE,KAAK,YAAY,EAAQ,KAAK,cAAc,EAAE,MAAM,YAAY,CAAC;AAE1E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE1C;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B,2BAA2B;IAC3B,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,C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,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,GACrF,OAAO,CAAC,QAAQ,CAAC;IASpB;;;;;;OAMG;IACG,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAQnE;;;;;;;;;;;;;;;;OAgBG;IACG,SAAS,CACb,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE;QACJ,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAC3B,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,IAAI,CAAC,EAAE,OAAO,CAAC;KAChB,GACA,OAAO,CAAC,WAAW,CAAC;CAQxB"}
|
|
@@ -112,7 +112,7 @@ export class StepTestsApi {
|
|
|
112
112
|
* @param workflowId - The `wf_…` id.
|
|
113
113
|
* @param stepId - The step's id within that workflow.
|
|
114
114
|
* @param body - `stepTestId` (optional), `status`, and optional
|
|
115
|
-
* `input`/`output`/`error
|
|
115
|
+
* `input`/`output`/`error`/`meta` (the server sanitizes `meta`), forwarded verbatim.
|
|
116
116
|
* @returns The created `StepTestRun`, unwrapped from the `run` envelope (the server answers `201`).
|
|
117
117
|
* @throws {ApiError} `400 invalid_body`/`invalid_status`. No `404` — the
|
|
118
118
|
* route never checks the workflow/step exist before writing.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step-tests.js","sourceRoot":"","sources":["../../../src/console/step-tests.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH,OAAO,EAAqB,IAAI,EAAuB,MAAM,YAAY,CAAC;A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CAAU;YAC5C,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,IAAI,CAAA,cAAc,UAAU,UAAU,MAAM,YAAY;YAC9D,IAAI;SACL,CAAC,CAAC;QACH,OAAO,MAAM,CAAc,GAAG,EAAE,KAAK,CAAC,CAAC;IACzC,CAAC;CACF"}
|
|
@@ -26,16 +26,13 @@
|
|
|
26
26
|
* `console.apps`'s/`console.functions`' identical treatment of their own
|
|
27
27
|
* zero-caller methods.
|
|
28
28
|
*
|
|
29
|
-
* **`webhookUrl` is
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* config value genuinely distinct from studio's own
|
|
33
|
-
* (`internal-triggers.ts:123-127`, `config.ts:27,259`).
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* independently) — this is a deliberate, verified omission, not an
|
|
37
|
-
* oversight: whatever extra field the server sends is silently ignored,
|
|
38
|
-
* exactly as today.
|
|
29
|
+
* **`webhookUrl` is modeled.** For a subscription whose `appId ===
|
|
30
|
+
* "@w6w/webhook"`, the server enriches the response with a `webhookUrl`
|
|
31
|
+
* field — produced by `withUrl` in `server/packages/api/admin/triggers.ts:74`
|
|
32
|
+
* — computed from a config value genuinely distinct from studio's own
|
|
33
|
+
* `apiBaseUrl()` (`internal-triggers.ts:123-127`, `config.ts:27,259`).
|
|
34
|
+
* Present only for `appId === "@w6w/webhook"`; absent for every other
|
|
35
|
+
* subscription.
|
|
39
36
|
*
|
|
40
37
|
* Subscriptions are account-level, never scoped by `project` — so
|
|
41
38
|
* `SubscriptionsHost` needs only the transport, mirroring `VarsHost`/
|
|
@@ -54,11 +51,18 @@ export interface SubscriptionsHost {
|
|
|
54
51
|
/** Perform one request. */
|
|
55
52
|
request<T>(options: RequestOptions): Promise<HttpResponse<T>>;
|
|
56
53
|
}
|
|
54
|
+
/** How a trigger's events arrive: pushed to a webhook, or fetched by a poll. */
|
|
55
|
+
export type TriggerType = "webhook" | "poll";
|
|
56
|
+
/**
|
|
57
|
+
* Where a subscription is in its registration lifecycle. Only `registered`
|
|
58
|
+
* subscriptions receive events.
|
|
59
|
+
*/
|
|
60
|
+
export type SubscriptionStatus = "pending" | "registered" | "failed" | "destroying";
|
|
57
61
|
/**
|
|
58
62
|
* A (trigger → workflow) binding. Field-for-field per
|
|
59
63
|
* `packages/studio/src/api/types.ts:72-83` — this module does not redesign
|
|
60
|
-
* the shape, only gives it a second home.
|
|
61
|
-
*
|
|
64
|
+
* the shape, only gives it a second home. Also carries `webhookUrl` — see
|
|
65
|
+
* this module's header.
|
|
62
66
|
*/
|
|
63
67
|
export interface Subscription {
|
|
64
68
|
id: string;
|
|
@@ -71,6 +75,25 @@ export interface Subscription {
|
|
|
71
75
|
enabled: boolean;
|
|
72
76
|
createdAt: string;
|
|
73
77
|
updatedAt: string;
|
|
78
|
+
/** How events arrive. */
|
|
79
|
+
type: TriggerType;
|
|
80
|
+
/** Registration lifecycle state. */
|
|
81
|
+
status: SubscriptionStatus;
|
|
82
|
+
/** Poll interval in ms; `null` for a webhook subscription. */
|
|
83
|
+
intervalMs: number | null;
|
|
84
|
+
/** Principal ids (workflow, connection, …) this subscription depends on. */
|
|
85
|
+
dependencies: string[];
|
|
86
|
+
/** When the next poll is due; `null` when not a poll or not yet scheduled. */
|
|
87
|
+
nextCheckAt: string | null;
|
|
88
|
+
/** The last registration failure, if any; `null` otherwise. */
|
|
89
|
+
lastError: {
|
|
90
|
+
code: string;
|
|
91
|
+
message: string;
|
|
92
|
+
} | null;
|
|
93
|
+
/** When registration last succeeded; `null` if it never has. */
|
|
94
|
+
registeredAt: string | null;
|
|
95
|
+
/** Present only for `appId === "@w6w/webhook"` — the server's own computed receive URL. */
|
|
96
|
+
webhookUrl?: string;
|
|
74
97
|
}
|
|
75
98
|
/**
|
|
76
99
|
* The body of `create`, forwarded verbatim as the whole POST body.
|
|
@@ -80,9 +103,11 @@ export interface SubscriptionCreateInput {
|
|
|
80
103
|
workflowId: string;
|
|
81
104
|
connectionId?: string | null;
|
|
82
105
|
params?: Record<string, unknown>;
|
|
106
|
+
/** Poll interval in ms (integer). Poll triggers only — the server defaults it to its floor. */
|
|
107
|
+
intervalMs?: number;
|
|
83
108
|
}
|
|
84
109
|
/** The lifecycle a delivered trigger event can be in. */
|
|
85
|
-
export type TriggerEventStatus = "received" | "dispatching" | "dispatched" | "failed";
|
|
110
|
+
export type TriggerEventStatus = "received" | "dispatching" | "dispatched" | "failed" | "ignored";
|
|
86
111
|
/**
|
|
87
112
|
* Metadata-only view of a delivered trigger event. Field-for-field per
|
|
88
113
|
* `packages/studio/src/api/types.ts:85-96`.
|
|
@@ -124,9 +149,6 @@ export declare class SubscriptionsApi {
|
|
|
124
149
|
/**
|
|
125
150
|
* List the subscriptions bound to one workflow.
|
|
126
151
|
*
|
|
127
|
-
* **Dead code (HITL-4)** — zero call sites anywhere in studio or
|
|
128
|
-
* `@w6w/ui`. Built for SDK completeness only; see this module's header.
|
|
129
|
-
*
|
|
130
152
|
* @param workflowId - The `wf_…` id.
|
|
131
153
|
* @returns The subscriptions, unwrapped from the `subscriptions` envelope.
|
|
132
154
|
* @throws {ApiError} On any non-2xx.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscriptions.d.ts","sourceRoot":"","sources":["../../../src/console/subscriptions.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"subscriptions.d.ts","sourceRoot":"","sources":["../../../src/console/subscriptions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,OAAO,EAAE,KAAK,YAAY,EAAQ,KAAK,cAAc,EAAE,MAAM,YAAY,CAAC;AAG1E;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC,2BAA2B;IAC3B,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;CAC/D;AAED,gFAAgF;AAChF,MAAM,MAAM,WAA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26
|
* `console.apps`'s/`console.functions`' identical treatment of their own
|
|
27
27
|
* zero-caller methods.
|
|
28
28
|
*
|
|
29
|
-
* **`webhookUrl` is
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* config value genuinely distinct from studio's own
|
|
33
|
-
* (`internal-triggers.ts:123-127`, `config.ts:27,259`).
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* independently) — this is a deliberate, verified omission, not an
|
|
37
|
-
* oversight: whatever extra field the server sends is silently ignored,
|
|
38
|
-
* exactly as today.
|
|
29
|
+
* **`webhookUrl` is modeled.** For a subscription whose `appId ===
|
|
30
|
+
* "@w6w/webhook"`, the server enriches the response with a `webhookUrl`
|
|
31
|
+
* field — produced by `withUrl` in `server/packages/api/admin/triggers.ts:74`
|
|
32
|
+
* — computed from a config value genuinely distinct from studio's own
|
|
33
|
+
* `apiBaseUrl()` (`internal-triggers.ts:123-127`, `config.ts:27,259`).
|
|
34
|
+
* Present only for `appId === "@w6w/webhook"`; absent for every other
|
|
35
|
+
* subscription.
|
|
39
36
|
*
|
|
40
37
|
* Subscriptions are account-level, never scoped by `project` — so
|
|
41
38
|
* `SubscriptionsHost` needs only the transport, mirroring `VarsHost`/
|
|
@@ -81,9 +78,6 @@ export class SubscriptionsApi {
|
|
|
81
78
|
/**
|
|
82
79
|
* List the subscriptions bound to one workflow.
|
|
83
80
|
*
|
|
84
|
-
* **Dead code (HITL-4)** — zero call sites anywhere in studio or
|
|
85
|
-
* `@w6w/ui`. Built for SDK completeness only; see this module's header.
|
|
86
|
-
*
|
|
87
81
|
* @param workflowId - The `wf_…` id.
|
|
88
82
|
* @returns The subscriptions, unwrapped from the `subscriptions` envelope.
|
|
89
83
|
* @throws {ApiError} On any non-2xx.
|