@w6w/sdk 0.9.9 → 0.9.12
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 +23 -3
- package/dist/mod.d.ts +11 -2
- package/dist/mod.d.ts.map +1 -1
- package/dist/mod.js +6 -0
- package/dist/mod.js.map +1 -1
- package/dist/src/apps.d.ts +68 -0
- package/dist/src/apps.d.ts.map +1 -0
- package/dist/src/apps.js +76 -0
- package/dist/src/apps.js.map +1 -0
- package/dist/src/client.d.ts +15 -3
- package/dist/src/client.d.ts.map +1 -1
- package/dist/src/client.js +19 -3
- package/dist/src/client.js.map +1 -1
- package/dist/src/connections.d.ts +41 -13
- package/dist/src/connections.d.ts.map +1 -1
- package/dist/src/connections.js +54 -12
- package/dist/src/connections.js.map +1 -1
- package/dist/src/console/apps.d.ts +5 -0
- package/dist/src/console/apps.d.ts.map +1 -1
- package/dist/src/console/apps.js.map +1 -1
- package/dist/src/console/connections.d.ts +10 -9
- package/dist/src/console/connections.d.ts.map +1 -1
- package/dist/src/console/connections.js +10 -9
- package/dist/src/console/connections.js.map +1 -1
- package/dist/src/console/tenant-oauth-apps.d.ts +26 -0
- package/dist/src/console/tenant-oauth-apps.d.ts.map +1 -1
- package/dist/src/console/tenant-oauth-apps.js +3 -1
- package/dist/src/console/tenant-oauth-apps.js.map +1 -1
- package/dist/src/dashboard.d.ts +50 -0
- package/dist/src/dashboard.d.ts.map +1 -0
- package/dist/src/dashboard.js +49 -0
- package/dist/src/dashboard.js.map +1 -0
- package/dist/src/functions.d.ts +100 -3
- package/dist/src/functions.d.ts.map +1 -1
- package/dist/src/functions.js +122 -3
- package/dist/src/functions.js.map +1 -1
- package/dist/src/projects.d.ts +49 -0
- package/dist/src/projects.d.ts.map +1 -0
- package/dist/src/projects.js +51 -0
- package/dist/src/projects.js.map +1 -0
- package/dist/src/reliability.d.ts +78 -0
- package/dist/src/reliability.d.ts.map +1 -0
- package/dist/src/reliability.js +76 -0
- package/dist/src/reliability.js.map +1 -0
- package/dist/src/server/mod.d.ts +71 -1
- package/dist/src/server/mod.d.ts.map +1 -1
- package/dist/src/server/mod.js +78 -7
- package/dist/src/server/mod.js.map +1 -1
- package/dist/src/types.d.ts +7 -0
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.js.map +1 -1
- package/dist/src/version.d.ts.map +1 -1
- package/dist/src/version.js +1 -1
- package/dist/src/version.js.map +1 -1
- package/dist/src/versions.d.ts +134 -0
- package/dist/src/versions.d.ts.map +1 -0
- package/dist/src/versions.js +113 -0
- package/dist/src/versions.js.map +1 -0
- package/dist/src/workflows.d.ts +82 -0
- package/dist/src/workflows.d.ts.map +1 -1
- package/dist/src/workflows.js +109 -4
- package/dist/src/workflows.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apps.js","sourceRoot":"","sources":["../../../src/console/apps.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8DG;AAEH,OAAO,EAAqB,IAAI,EAAuB,MAAM,YAAY,CAAC;AAC1E,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"apps.js","sourceRoot":"","sources":["../../../src/console/apps.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8DG;AAEH,OAAO,EAAqB,IAAI,EAAuB,MAAM,YAAY,CAAC;AAC1E,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AA2gBrC;;;;;;;;;GASG;AACH,MAAM,OAAO,OAAO;IACT,KAAK,CAAW;IAEzB;;OAEG;IACH,YAAY,IAAc;QACxB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACpB,CAAC;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,KAAK,CA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
|
|
15
15
|
* **Console placement is a resolved HITL, not a default applied without
|
|
16
16
|
* thought — see `HITL-10` in `HITL.md` and `plan.md`'s SP2.3 section for the
|
|
17
|
-
* full investigation.** `endpoints.json`'s `outOfScope` entry
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
17
|
+
* full investigation.** `endpoints.json`'s `outOfScope` entry "connection
|
|
18
|
+
* create / update / test / OAuth" frames the eventual intent as a real partner
|
|
19
|
+
* operation; the server routes this file wraps are plain, stateless handlers
|
|
20
|
+
* over an already-resolved payload for both real studio call sites, which makes
|
|
21
|
+
* console placement technically safe for studio's own use — it does not by
|
|
22
|
+
* itself justify promoting the connect flows to the partner surface (cli/python
|
|
23
|
+
* lockstep; no partner-facing OAuth-flow counterpart exists yet either). Contract
|
|
24
|
+
* `0.7.0` promoted `get` and `delete` to the root client
|
|
25
|
+
* (`client.connections.get/delete`); they remain here unchanged for the studio.
|
|
26
|
+
* Console placement is the pinned default for the rest.
|
|
26
27
|
*
|
|
27
28
|
* **`listConnections` (base `client.connections.list()`,
|
|
28
29
|
* `../connections.ts:47-64`) is deliberately NOT relocated here** — it is the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connections.d.ts","sourceRoot":"","sources":["../../../src/console/connections.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"connections.d.ts","sourceRoot":"","sources":["../../../src/console/connections.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAEH,OAAO,EAAE,KAAK,YAAY,EAAQ,KAAK,cAAc,EAAE,MAAM,YAAY,CAAC;AAC1E,OAAO,EAAE,KAAK,iBAAiB,EAAU,MAAM,aAAa,CAAC;AAE7D;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B,2BAA2B;IAC3B,OAA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,CAAC,oBAAoB,CAAC;IAQrD;;;;;;;;;;;;OAYG;IACG,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGxC"}
|
|
@@ -14,15 +14,16 @@
|
|
|
14
14
|
*
|
|
15
15
|
* **Console placement is a resolved HITL, not a default applied without
|
|
16
16
|
* thought — see `HITL-10` in `HITL.md` and `plan.md`'s SP2.3 section for the
|
|
17
|
-
* full investigation.** `endpoints.json`'s `outOfScope` entry
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
17
|
+
* full investigation.** `endpoints.json`'s `outOfScope` entry "connection
|
|
18
|
+
* create / update / test / OAuth" frames the eventual intent as a real partner
|
|
19
|
+
* operation; the server routes this file wraps are plain, stateless handlers
|
|
20
|
+
* over an already-resolved payload for both real studio call sites, which makes
|
|
21
|
+
* console placement technically safe for studio's own use — it does not by
|
|
22
|
+
* itself justify promoting the connect flows to the partner surface (cli/python
|
|
23
|
+
* lockstep; no partner-facing OAuth-flow counterpart exists yet either). Contract
|
|
24
|
+
* `0.7.0` promoted `get` and `delete` to the root client
|
|
25
|
+
* (`client.connections.get/delete`); they remain here unchanged for the studio.
|
|
26
|
+
* Console placement is the pinned default for the rest.
|
|
26
27
|
*
|
|
27
28
|
* **`listConnections` (base `client.connections.list()`,
|
|
28
29
|
* `../connections.ts:47-64`) is deliberately NOT relocated here** — it is the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connections.js","sourceRoot":"","sources":["../../../src/console/connections.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"connections.js","sourceRoot":"","sources":["../../../src/console/connections.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAEH,OAAO,EAAqB,IAAI,EAAuB,MAAM,YAAY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,OAAO;YACf,IAAI,EAAE,IAAI,CAAA,gBAAgB,EAAE,EAAE;YAC9B,IAAI;SACL,CAAC,CAAC;QACH,OAAO,MAAM,CAAoB,GAAG,EAAE,YAAY,CAAC,CAAC;IACtD,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,IAAI,CAAC,EAAU;QACnB,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAuB;YACzD,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,IAAI,CAAA,gBAAgB,EAAE,OAAO;SACpC,CAAC,CAAC;QACH,OAAO,GAAG,CAAC,IAAI,CAAC;IAClB,CAAC;IAED;;;;;;;;;;;;OAYG;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"}
|
|
@@ -87,6 +87,27 @@ export interface TenantOAuthAppSummary {
|
|
|
87
87
|
hasClientSecret: boolean;
|
|
88
88
|
/** Whether the override is switched off (the host's own client is used instead). */
|
|
89
89
|
disabled: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Whether users of this tenant get this method preselected. Absent from an
|
|
92
|
+
* older server.
|
|
93
|
+
*/
|
|
94
|
+
isDefault?: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* Server-computed masked display string for the stored client secret, or
|
|
97
|
+
* `null` when none is stored. Never the secret itself. Absent from an older
|
|
98
|
+
* server.
|
|
99
|
+
*/
|
|
100
|
+
clientSecretHint?: string | null;
|
|
101
|
+
/** The app's display name, joined server-side. Absent from an older server. */
|
|
102
|
+
appDisplayName?: string;
|
|
103
|
+
/** The app's icon as inline SVG, joined server-side. Absent when none or an older server. */
|
|
104
|
+
iconSvg?: string;
|
|
105
|
+
/** The app's dark-theme icon as inline SVG. Absent when none or an older server. */
|
|
106
|
+
iconSvgDark?: string;
|
|
107
|
+
/** The app's brand colour. Absent when none or an older server. */
|
|
108
|
+
brandColor?: string;
|
|
109
|
+
/** The app's dark-theme brand colour. Absent when none or an older server. */
|
|
110
|
+
brandColorDark?: string;
|
|
90
111
|
}
|
|
91
112
|
/** `GET /tenant/oauth-apps` → 200 (W3). */
|
|
92
113
|
export interface TenantOAuthAppsResponse {
|
|
@@ -132,6 +153,11 @@ export interface SetTenantOAuthAppInput {
|
|
|
132
153
|
extra?: Record<string, unknown> | null;
|
|
133
154
|
/** Whether to switch the override off. */
|
|
134
155
|
disabled?: boolean;
|
|
156
|
+
/**
|
|
157
|
+
* Whether users of this tenant get this method preselected. `true` and
|
|
158
|
+
* `false` are both sent; omit to leave the stored value alone.
|
|
159
|
+
*/
|
|
160
|
+
isDefault?: boolean;
|
|
135
161
|
}
|
|
136
162
|
/**
|
|
137
163
|
* One app a tenant administrator may register an OAuth client for — the picker
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tenant-oauth-apps.d.ts","sourceRoot":"","sources":["../../../src/console/tenant-oauth-apps.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAEH,OAAO,EAAE,KAAK,YAAY,EAAQ,KAAK,cAAc,EAAE,MAAM,YAAY,CAAC;AAE1E;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB;IAClC,2BAA2B;IAC3B,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;CAC/D;AAED;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IACpC,wCAAwC;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,mDAAmD;IACnD,OAAO,EAAE,MAAM,CAAC;IAChB,wEAAwE;IACxE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB;;;;OAIG;IACH,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C;CAC5C;AAED,oFAAoF;AACpF,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,oBAAoB,EAAE,CAAC;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,gCAAgC;IAC/C,mGAAmG;IACnG,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,oDAAoD;IACpD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yDAAyD;IACzD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gFAAgF;IAChF,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED;;;;;;;;;;;GAWG;AACH,qBAAa,kBAAkB;;IAG7B;;OAEG;gBACS,IAAI,EAAE,mBAAmB;IAIrC;;;;;;;;;OASG;IACG,IAAI,IAAI,OAAO,CAAC,uBAAuB,CAAC;IAQ9C;;;;;;;;;;;;;;OAcG;IACG,cAAc,CAClB,OAAO,GAAE,gCAAqC,GAC7C,OAAO,CAAC,yBAAyB,CAAC;IAWrC;;;;;;;;;;;OAWG;IACG,GAAG,CACP,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,sBAAsB,GAC5B,OAAO,CAAC,qBAAqB,CAAC;IASjC;;;;;;;;;;;OAWG;IACG,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAM5D"}
|
|
@@ -51,7 +51,7 @@ import { path } from "../http.js";
|
|
|
51
51
|
* Serialise {@linkcode SetTenantOAuthAppInput} for the wire: **only the keys
|
|
52
52
|
* actually present**, with `null` preserved as a real value.
|
|
53
53
|
*
|
|
54
|
-
* Written as
|
|
54
|
+
* Written as five explicit `!== undefined` tests rather than a spread or an
|
|
55
55
|
* `Object.entries` loop, for two reasons. It keeps `undefined` off the wire
|
|
56
56
|
* without relying on `JSON.stringify` dropping it (a serializer that
|
|
57
57
|
* normalised `undefined` to `null` would silently wipe a stored credential —
|
|
@@ -72,6 +72,8 @@ function toSetBody(input) {
|
|
|
72
72
|
body.extra = input.extra;
|
|
73
73
|
if (input.disabled !== undefined)
|
|
74
74
|
body.disabled = input.disabled;
|
|
75
|
+
if (input.isDefault !== undefined)
|
|
76
|
+
body.isDefault = input.isDefault;
|
|
75
77
|
return body;
|
|
76
78
|
}
|
|
77
79
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tenant-oauth-apps.js","sourceRoot":"","sources":["../../../src/console/tenant-oauth-apps.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAEH,OAAO,EAAqB,IAAI,EAAuB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"tenant-oauth-apps.js","sourceRoot":"","sources":["../../../src/console/tenant-oauth-apps.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAEH,OAAO,EAAqB,IAAI,EAAuB,MAAM,YAAY,CAAC;AAsH1E;;;;;;;;;;;;;;GAcG;AACH,SAAS,SAAS,CAAC,KAA6B;IAC9C,MAAM,IAAI,GAA4B,EAAE,CAAC;IACzC,IAAI,KAAK,CAAC,QAAQ,KAAK,SAAS;QAAE,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;IACjE,IAAI,KAAK,CAAC,YAAY,KAAK,SAAS;QAAE,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC;IAC7E,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS;QAAE,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;IACxD,IAAI,KAAK,CAAC,QAAQ,KAAK,SAAS;QAAE,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;IACjE,IAAI,KAAK,CAAC,SAAS,KAAK,SAAS;QAAE,IAAI,CAAC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;OAWG;IACH,KAAK,CAAC,MAAM,CAAC,KAAa,EAAE,OAAe;QACzC,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAU;YAChC,MAAM,EAAE,QAAQ;YAChB,IAAI,EAAE,IAAI,CAAA,qBAAqB,KAAK,IAAI,OAAO,EAAE;SAClD,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `client.dashboard.stats()` — the account-scoped run rollup.
|
|
3
|
+
*
|
|
4
|
+
* One operation, `GET /dashboard/stats`. It is **account-scoped**: the account
|
|
5
|
+
* comes from the credential, so there is no `project` parameter and the client's
|
|
6
|
+
* default project is never sent. The response has no envelope key — the rollup
|
|
7
|
+
* IS the body.
|
|
8
|
+
*
|
|
9
|
+
* The wire types are declared once, in `./console/dashboard.ts`, and
|
|
10
|
+
* re-exported here.
|
|
11
|
+
*
|
|
12
|
+
* @module
|
|
13
|
+
*/
|
|
14
|
+
import type { DashboardStats, DashboardStatsParams } from "./console/dashboard.ts";
|
|
15
|
+
import type { CallOptions, HttpResponse, RequestOptions } from "./http.ts";
|
|
16
|
+
export type { DashboardStats, DashboardStatsParams } from "./console/dashboard.ts";
|
|
17
|
+
/** The slice of `W6WClient` this namespace needs: the transport, and nothing else. */
|
|
18
|
+
export interface DashboardHost {
|
|
19
|
+
/** Perform one request. */
|
|
20
|
+
request<T>(options: RequestOptions): Promise<HttpResponse<T>>;
|
|
21
|
+
}
|
|
22
|
+
/** Window/bucketing for `stats`, plus the per-call transport options. */
|
|
23
|
+
export interface DashboardStatsOptions extends DashboardStatsParams, CallOptions {
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The `dashboard` namespace on a `W6WClient`.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* const rollup = await client.dashboard.stats({ bucket: "week" });
|
|
31
|
+
* console.log(rollup.headline.workflowRuns);
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export declare class DashboardApi {
|
|
35
|
+
#private;
|
|
36
|
+
/**
|
|
37
|
+
* @param host - The client this namespace issues requests through.
|
|
38
|
+
*/
|
|
39
|
+
constructor(host: DashboardHost);
|
|
40
|
+
/**
|
|
41
|
+
* Fetch the account-scoped dashboard rollup.
|
|
42
|
+
*
|
|
43
|
+
* @param options - Optional `from` / `to` / `bucket` (each sent only when given; the server
|
|
44
|
+
* applies its own defaults) and `signal`.
|
|
45
|
+
* @returns The rollup, exactly as the server sent it.
|
|
46
|
+
* @throws {ApiError} On any non-2xx.
|
|
47
|
+
*/
|
|
48
|
+
stats(options?: DashboardStatsOptions): Promise<DashboardStats>;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=dashboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../../src/dashboard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACnF,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAE3E,YAAY,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAEnF,sFAAsF;AACtF,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,yEAAyE;AACzE,MAAM,WAAW,qBAAsB,SAAQ,oBAAoB,EAAE,WAAW;CAAG;AAEnF;;;;;;;;GAQG;AACH,qBAAa,YAAY;;IAGvB;;OAEG;gBACS,IAAI,EAAE,aAAa;IAI/B;;;;;;;OAOG;IACG,KAAK,CAAC,OAAO,GAAE,qBAA0B,GAAG,OAAO,CAAC,cAAc,CAAC;CAS1E"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `client.dashboard.stats()` — the account-scoped run rollup.
|
|
3
|
+
*
|
|
4
|
+
* One operation, `GET /dashboard/stats`. It is **account-scoped**: the account
|
|
5
|
+
* comes from the credential, so there is no `project` parameter and the client's
|
|
6
|
+
* default project is never sent. The response has no envelope key — the rollup
|
|
7
|
+
* IS the body.
|
|
8
|
+
*
|
|
9
|
+
* The wire types are declared once, in `./console/dashboard.ts`, and
|
|
10
|
+
* re-exported here.
|
|
11
|
+
*
|
|
12
|
+
* @module
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* The `dashboard` namespace on a `W6WClient`.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* const rollup = await client.dashboard.stats({ bucket: "week" });
|
|
20
|
+
* console.log(rollup.headline.workflowRuns);
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export class DashboardApi {
|
|
24
|
+
#host;
|
|
25
|
+
/**
|
|
26
|
+
* @param host - The client this namespace issues requests through.
|
|
27
|
+
*/
|
|
28
|
+
constructor(host) {
|
|
29
|
+
this.#host = host;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Fetch the account-scoped dashboard rollup.
|
|
33
|
+
*
|
|
34
|
+
* @param options - Optional `from` / `to` / `bucket` (each sent only when given; the server
|
|
35
|
+
* applies its own defaults) and `signal`.
|
|
36
|
+
* @returns The rollup, exactly as the server sent it.
|
|
37
|
+
* @throws {ApiError} On any non-2xx.
|
|
38
|
+
*/
|
|
39
|
+
async stats(options = {}) {
|
|
40
|
+
const res = await this.#host.request({
|
|
41
|
+
method: "GET",
|
|
42
|
+
path: "/dashboard/stats",
|
|
43
|
+
query: { from: options.from, to: options.to, bucket: options.bucket },
|
|
44
|
+
signal: options.signal,
|
|
45
|
+
});
|
|
46
|
+
return res.body;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=dashboard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboard.js","sourceRoot":"","sources":["../../src/dashboard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAgBH;;;;;;;;GAQG;AACH,MAAM,OAAO,YAAY;IACd,KAAK,CAAgB;IAE9B;;OAEG;IACH,YAAY,IAAmB;QAC7B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACpB,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,KAAK,CAAC,UAAiC,EAAE;QAC7C,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAiB;YACnD,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,kBAAkB;YACxB,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE;YACrE,MAAM,EAAE,OAAO,CAAC,MAAM;SACvB,CAAC,CAAC;QACH,OAAO,GAAG,CAAC,IAAI,CAAC;IAClB,CAAC;CACF"}
|
package/dist/src/functions.d.ts
CHANGED
|
@@ -22,9 +22,10 @@
|
|
|
22
22
|
*
|
|
23
23
|
* ── The rest of the namespace ──
|
|
24
24
|
* `list`, `get`, `create`, `update` and `delete` complete the definition
|
|
25
|
-
* lifecycle, mirroring `client.workflows.*` op for op with
|
|
25
|
+
* lifecycle, mirroring `client.workflows.*` op for op with one difference the
|
|
26
26
|
* server dictates, not this package: there is no `?project=` anywhere on this
|
|
27
|
-
* domain
|
|
27
|
+
* domain. `archive` is the required step before `delete`, and the version
|
|
28
|
+
* methods (`listVersions` … `runVersion`) match `client.workflows.*`.
|
|
28
29
|
*
|
|
29
30
|
* The server has ONE write route (`POST /functions`, an upsert), so `create`
|
|
30
31
|
* and `update` are the same request shaped differently — `create` mints the
|
|
@@ -39,6 +40,7 @@
|
|
|
39
40
|
import type { ResolvedConfig } from "./config.ts";
|
|
40
41
|
import { type CallOptions, type HttpResponse, type RequestOptions } from "./http.ts";
|
|
41
42
|
import { type FunctionSummary } from "./types.ts";
|
|
43
|
+
import { type PublishResult, type RevertResult, type VersionDetail, type VersionList } from "./versions.ts";
|
|
42
44
|
/**
|
|
43
45
|
* What this namespace needs from the client — the same narrow seam
|
|
44
46
|
* `WorkflowsApi` takes, so it is constructible in a test and this module never
|
|
@@ -63,7 +65,19 @@ export interface FunctionRunOptions {
|
|
|
63
65
|
* absent key says "I forgot".
|
|
64
66
|
*/
|
|
65
67
|
payload?: Record<string, unknown>;
|
|
68
|
+
/**
|
|
69
|
+
* Run the **stored** definition even though it was never published — the draft
|
|
70
|
+
* run. A disabled one is still refused.
|
|
71
|
+
*
|
|
72
|
+
* It runs the row exactly as last saved, never a definition you submit here,
|
|
73
|
+
* so save first. Sent as `allowUnpublished: true` in the body **only when
|
|
74
|
+
* `true`**; `false` is the same as omitting it. Not accepted by
|
|
75
|
+
* {@linkcode FunctionsApi.runVersion}.
|
|
76
|
+
*/
|
|
77
|
+
allowUnpublished?: boolean;
|
|
66
78
|
}
|
|
79
|
+
/** Per-call options for `functions.runVersion`: `payload` only. */
|
|
80
|
+
export type FunctionRunVersionOptions = Pick<FunctionRunOptions, "payload">;
|
|
67
81
|
/**
|
|
68
82
|
* A Function definition — kept OPAQUE, for the same reason `WorkflowDefinition`
|
|
69
83
|
* (`./workflows.ts`) is.
|
|
@@ -214,7 +228,89 @@ export declare class FunctionsApi {
|
|
|
214
228
|
key: string;
|
|
215
229
|
}>;
|
|
216
230
|
/**
|
|
217
|
-
*
|
|
231
|
+
* Archive a Function.
|
|
232
|
+
*
|
|
233
|
+
* One-way: there is no unarchive route. Idempotent — archiving an
|
|
234
|
+
* already-archived Function re-returns it unchanged. This is a required step,
|
|
235
|
+
* not a convenience: {@linkcode delete} refuses a Function that is not
|
|
236
|
+
* archived (`409 function_not_archived`).
|
|
237
|
+
*
|
|
238
|
+
* @param id - The `fn_…` id.
|
|
239
|
+
* @returns The archived definition, unwrapped from its `function` envelope.
|
|
240
|
+
* @throws {ApiError} `404 unknown_function` when there is no such id.
|
|
241
|
+
*/
|
|
242
|
+
archive(id: string): Promise<FunctionDefinition>;
|
|
243
|
+
/**
|
|
244
|
+
* List a Function's published versions (metadata only).
|
|
245
|
+
*
|
|
246
|
+
* @param id - The `fn_…` id.
|
|
247
|
+
* @returns `enabled`, `currentPublishedVersion` (`null` before the first publish) and `versions[]`.
|
|
248
|
+
* @throws {ApiError} `404 unknown_function` when there is no such id.
|
|
249
|
+
*/
|
|
250
|
+
listVersions(id: string): Promise<VersionList>;
|
|
251
|
+
/**
|
|
252
|
+
* Read one published version, with its definition.
|
|
253
|
+
*
|
|
254
|
+
* @param id - The `fn_…` id.
|
|
255
|
+
* @param n - The 1-based version number.
|
|
256
|
+
* @returns The version, unwrapped from its `version` envelope.
|
|
257
|
+
* @throws {ApiError} `404 unknown_version` / `404 unknown_function`; `400 invalid_version` for a non-positive `n`.
|
|
258
|
+
*/
|
|
259
|
+
getVersion(id: string, n: number): Promise<VersionDetail>;
|
|
260
|
+
/**
|
|
261
|
+
* Publish the Function's **stored** definition as a new immutable version.
|
|
262
|
+
*
|
|
263
|
+
* It snapshots what the server has saved, so flush any pending save first.
|
|
264
|
+
* The server takes no precondition.
|
|
265
|
+
*
|
|
266
|
+
* @param id - The `fn_…` id.
|
|
267
|
+
* @returns The new version and `currentPublishedVersion`, as the server sent them.
|
|
268
|
+
* @throws {ApiError} `404 unknown_function` when there is no such id.
|
|
269
|
+
*/
|
|
270
|
+
publish(id: string): Promise<PublishResult>;
|
|
271
|
+
/**
|
|
272
|
+
* Rewrite the live Function from a published version. Does not publish.
|
|
273
|
+
*
|
|
274
|
+
* Saves remain last-write-wins: Functions have no concurrency precondition.
|
|
275
|
+
*
|
|
276
|
+
* @param id - The `fn_…` id.
|
|
277
|
+
* @param n - The version to restore.
|
|
278
|
+
* @returns The `reverted` object, unwrapped from its envelope.
|
|
279
|
+
* @throws {ApiError} `404 unknown_version` / `404 unknown_function`; `400 invalid_version`.
|
|
280
|
+
*/
|
|
281
|
+
revert(id: string, n: number): Promise<RevertResult>;
|
|
282
|
+
/**
|
|
283
|
+
* Allow invocations of this Function. Idempotent. Returns nothing.
|
|
284
|
+
*
|
|
285
|
+
* @param id - The `fn_…` id.
|
|
286
|
+
* @throws {ApiError} `404 unknown_function` when there is no such id.
|
|
287
|
+
*/
|
|
288
|
+
enable(id: string): Promise<void>;
|
|
289
|
+
/**
|
|
290
|
+
* Refuse invocations of this Function (`422 function_disabled`). Idempotent. Returns nothing.
|
|
291
|
+
*
|
|
292
|
+
* @param id - The `fn_…` id.
|
|
293
|
+
* @throws {ApiError} `404 unknown_function` when there is no such id.
|
|
294
|
+
*/
|
|
295
|
+
disable(id: string): Promise<void>;
|
|
296
|
+
/**
|
|
297
|
+
* Run one published version of a Function rather than the live row.
|
|
298
|
+
*
|
|
299
|
+
* Same output unwrapping as {@linkcode run}; the wire verb is `invoke`.
|
|
300
|
+
*
|
|
301
|
+
* @param id - The `fn_…` id, or the Function's `key`.
|
|
302
|
+
* @param n - The version to run.
|
|
303
|
+
* @param options - `payload`, the Function's canonical inputs.
|
|
304
|
+
* @returns The Function's output.
|
|
305
|
+
* @throws {ApiError} `404 unknown_version` / `404 unknown_function`; `422 function_incomplete` / `function_disabled` / `function_not_published`; `400 invalid_version`.
|
|
306
|
+
*/
|
|
307
|
+
runVersion(id: string, n: number, options?: FunctionRunVersionOptions): Promise<unknown>;
|
|
308
|
+
/**
|
|
309
|
+
* Delete an archived Function.
|
|
310
|
+
*
|
|
311
|
+
* **Archive first.** A Function that is not archived is `409
|
|
312
|
+
* function_not_archived`, which this method does NOT catch and retry through
|
|
313
|
+
* {@linkcode archive}.
|
|
218
314
|
*
|
|
219
315
|
* Not idempotent, and deliberately so: deleting an id that is not there is
|
|
220
316
|
* `404 unknown_function`, not a silent success — the same pin
|
|
@@ -230,6 +326,7 @@ export declare class FunctionsApi {
|
|
|
230
326
|
*
|
|
231
327
|
* @param id - The `fn_…` id, or the Function's `key`.
|
|
232
328
|
* @throws {ApiError} `404 unknown_function` when there is no such Function for this caller.
|
|
329
|
+
* @throws {ApiError} `409 function_not_archived` when it exists but has not been archived yet.
|
|
233
330
|
*/
|
|
234
331
|
delete(id: string): Promise<void>;
|
|
235
332
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"functions.d.ts","sourceRoot":"","sources":["../../src/functions.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"functions.d.ts","sourceRoot":"","sources":["../../src/functions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,YAAY,EAAQ,KAAK,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3F,OAAO,EAAE,KAAK,eAAe,EAAkB,MAAM,YAAY,CAAC;AAClE,OAAO,EAGL,KAAK,aAAa,EAElB,KAAK,YAAY,EAGjB,KAAK,aAAa,EAClB,KAAK,WAAW,EAEjB,MAAM,eAAe,CAAC;AAEvB;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,kCAAkC;IAClC,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;IAChC,2BAA2B;IAC3B,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;CAC/D;AAED,4CAA4C;AAC5C,MAAM,WAAW,kBAAkB;IACjC;;;;;;;;;OASG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC;;;;;;;;OAQG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,mEAAmE;AACnE,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Y,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAIpD;;;;;;;OAOG;IACG,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAI/D;;;;;;;;;OASG;IACG,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAIjD;;;;;;;;;OASG;IACG,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAI1D;;;;;OAKG;IACG,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIvC;;;;;OAKG;IACG,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIxC;;;;;;;;;;OAUG;IACG,UAAU,CACd,EAAE,EAAE,MAAM,EACV,CAAC,EAAE,MAAM,EACT,OAAO,CAAC,EAAE,yBAAyB,GAClC,OAAO,CAAC,OAAO,CAAC;IAInB;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACG,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAsBxC"}
|
package/dist/src/functions.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ApiError } from "./errors.js";
|
|
2
2
|
import { path } from "./http.js";
|
|
3
3
|
import { mintId, unwrap } from "./types.js";
|
|
4
|
+
import { getVersion, listVersions, publishVersion, revertVersion, setEnabled, versionRunPath, } from "./versions.js";
|
|
4
5
|
/**
|
|
5
6
|
* The `functions` namespace on a `W6WClient`.
|
|
6
7
|
*
|
|
@@ -40,10 +41,25 @@ export class FunctionsApi {
|
|
|
40
41
|
* @throws {ApiError} `bad_response` when a success body carries no `output` key at all.
|
|
41
42
|
*/
|
|
42
43
|
async run(name, options) {
|
|
44
|
+
return await this.#invoke(path `/functions/${name}/invoke`, options);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The one POST both {@linkcode run} and {@linkcode runVersion} go through, so
|
|
48
|
+
* the output guard cannot drift between them.
|
|
49
|
+
*
|
|
50
|
+
* @param invokePath - The already-encoded path.
|
|
51
|
+
* @param options - The run options as given by the public method.
|
|
52
|
+
* @returns The Function's output.
|
|
53
|
+
*/
|
|
54
|
+
async #invoke(invokePath, options) {
|
|
43
55
|
const res = await this.#host.request({
|
|
44
56
|
method: "POST",
|
|
45
|
-
path:
|
|
46
|
-
body: {
|
|
57
|
+
path: invokePath,
|
|
58
|
+
body: {
|
|
59
|
+
inputs: options?.payload ?? {},
|
|
60
|
+
// Present only when `true`, like `workflows.run`'s `wait`.
|
|
61
|
+
...(options?.allowUnpublished === true ? { allowUnpublished: true } : {}),
|
|
62
|
+
},
|
|
47
63
|
});
|
|
48
64
|
// Deliberately NOT `unwrap(res, "output")`. That helper treats `null` as
|
|
49
65
|
// "the server did not send what it promised" — correct for a `documents` or
|
|
@@ -159,7 +175,109 @@ export class FunctionsApi {
|
|
|
159
175
|
return await this.#save({ ...definition, id });
|
|
160
176
|
}
|
|
161
177
|
/**
|
|
162
|
-
*
|
|
178
|
+
* Archive a Function.
|
|
179
|
+
*
|
|
180
|
+
* One-way: there is no unarchive route. Idempotent — archiving an
|
|
181
|
+
* already-archived Function re-returns it unchanged. This is a required step,
|
|
182
|
+
* not a convenience: {@linkcode delete} refuses a Function that is not
|
|
183
|
+
* archived (`409 function_not_archived`).
|
|
184
|
+
*
|
|
185
|
+
* @param id - The `fn_…` id.
|
|
186
|
+
* @returns The archived definition, unwrapped from its `function` envelope.
|
|
187
|
+
* @throws {ApiError} `404 unknown_function` when there is no such id.
|
|
188
|
+
*/
|
|
189
|
+
async archive(id) {
|
|
190
|
+
const res = await this.#host.request({
|
|
191
|
+
method: "POST",
|
|
192
|
+
path: path `/functions/${id}/archive`,
|
|
193
|
+
});
|
|
194
|
+
return unwrap(res, "function");
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* List a Function's published versions (metadata only).
|
|
198
|
+
*
|
|
199
|
+
* @param id - The `fn_…` id.
|
|
200
|
+
* @returns `enabled`, `currentPublishedVersion` (`null` before the first publish) and `versions[]`.
|
|
201
|
+
* @throws {ApiError} `404 unknown_function` when there is no such id.
|
|
202
|
+
*/
|
|
203
|
+
async listVersions(id) {
|
|
204
|
+
return await listVersions(this.#host, "functions", id);
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Read one published version, with its definition.
|
|
208
|
+
*
|
|
209
|
+
* @param id - The `fn_…` id.
|
|
210
|
+
* @param n - The 1-based version number.
|
|
211
|
+
* @returns The version, unwrapped from its `version` envelope.
|
|
212
|
+
* @throws {ApiError} `404 unknown_version` / `404 unknown_function`; `400 invalid_version` for a non-positive `n`.
|
|
213
|
+
*/
|
|
214
|
+
async getVersion(id, n) {
|
|
215
|
+
return await getVersion(this.#host, "functions", id, n);
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Publish the Function's **stored** definition as a new immutable version.
|
|
219
|
+
*
|
|
220
|
+
* It snapshots what the server has saved, so flush any pending save first.
|
|
221
|
+
* The server takes no precondition.
|
|
222
|
+
*
|
|
223
|
+
* @param id - The `fn_…` id.
|
|
224
|
+
* @returns The new version and `currentPublishedVersion`, as the server sent them.
|
|
225
|
+
* @throws {ApiError} `404 unknown_function` when there is no such id.
|
|
226
|
+
*/
|
|
227
|
+
async publish(id) {
|
|
228
|
+
return await publishVersion(this.#host, "functions", id);
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Rewrite the live Function from a published version. Does not publish.
|
|
232
|
+
*
|
|
233
|
+
* Saves remain last-write-wins: Functions have no concurrency precondition.
|
|
234
|
+
*
|
|
235
|
+
* @param id - The `fn_…` id.
|
|
236
|
+
* @param n - The version to restore.
|
|
237
|
+
* @returns The `reverted` object, unwrapped from its envelope.
|
|
238
|
+
* @throws {ApiError} `404 unknown_version` / `404 unknown_function`; `400 invalid_version`.
|
|
239
|
+
*/
|
|
240
|
+
async revert(id, n) {
|
|
241
|
+
return await revertVersion(this.#host, "functions", id, n);
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Allow invocations of this Function. Idempotent. Returns nothing.
|
|
245
|
+
*
|
|
246
|
+
* @param id - The `fn_…` id.
|
|
247
|
+
* @throws {ApiError} `404 unknown_function` when there is no such id.
|
|
248
|
+
*/
|
|
249
|
+
async enable(id) {
|
|
250
|
+
await setEnabled(this.#host, "functions", id, true);
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Refuse invocations of this Function (`422 function_disabled`). Idempotent. Returns nothing.
|
|
254
|
+
*
|
|
255
|
+
* @param id - The `fn_…` id.
|
|
256
|
+
* @throws {ApiError} `404 unknown_function` when there is no such id.
|
|
257
|
+
*/
|
|
258
|
+
async disable(id) {
|
|
259
|
+
await setEnabled(this.#host, "functions", id, false);
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Run one published version of a Function rather than the live row.
|
|
263
|
+
*
|
|
264
|
+
* Same output unwrapping as {@linkcode run}; the wire verb is `invoke`.
|
|
265
|
+
*
|
|
266
|
+
* @param id - The `fn_…` id, or the Function's `key`.
|
|
267
|
+
* @param n - The version to run.
|
|
268
|
+
* @param options - `payload`, the Function's canonical inputs.
|
|
269
|
+
* @returns The Function's output.
|
|
270
|
+
* @throws {ApiError} `404 unknown_version` / `404 unknown_function`; `422 function_incomplete` / `function_disabled` / `function_not_published`; `400 invalid_version`.
|
|
271
|
+
*/
|
|
272
|
+
async runVersion(id, n, options) {
|
|
273
|
+
return await this.#invoke(versionRunPath("functions", id, n), { payload: options?.payload });
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* Delete an archived Function.
|
|
277
|
+
*
|
|
278
|
+
* **Archive first.** A Function that is not archived is `409
|
|
279
|
+
* function_not_archived`, which this method does NOT catch and retry through
|
|
280
|
+
* {@linkcode archive}.
|
|
163
281
|
*
|
|
164
282
|
* Not idempotent, and deliberately so: deleting an id that is not there is
|
|
165
283
|
* `404 unknown_function`, not a silent success — the same pin
|
|
@@ -175,6 +293,7 @@ export class FunctionsApi {
|
|
|
175
293
|
*
|
|
176
294
|
* @param id - The `fn_…` id, or the Function's `key`.
|
|
177
295
|
* @throws {ApiError} `404 unknown_function` when there is no such Function for this caller.
|
|
296
|
+
* @throws {ApiError} `409 function_not_archived` when it exists but has not been archived yet.
|
|
178
297
|
*/
|
|
179
298
|
async delete(id) {
|
|
180
299
|
await this.#host.request({ method: "DELETE", path: path `/functions/${id}` });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"functions.js","sourceRoot":"","sources":["../../src/functions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"functions.js","sourceRoot":"","sources":["../../src/functions.ts"],"names":[],"mappings":"AAwCA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAuC,IAAI,EAAuB,MAAM,WAAW,CAAC;AAC3F,OAAO,EAAwB,MAAM,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAClE,OAAO,EACL,UAAU,EACV,YAAY,EAEZ,cAAc,EAEd,aAAa,EACb,UAAU,EAGV,cAAc,GACf,MAAM,eAAe,CAAC;AAuEvB;;;;;;;;;;;;;;GAcG;AACH,MAAM,OAAO,YAAY;IACd,KAAK,CAAgB;IAE9B;;OAEG;IACH,YAAY,IAAmB;QAC7B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACpB,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,KAAK,CAAC,GAAG,CAAC,IAAY,EAAE,OAA4B;QAClD,OAAO,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAA,cAAc,IAAI,SAAS,EAAE,OAAO,CAAC,CAAC;IACtE,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,OAAO,CAAC,UAAkB,EAAE,OAA4B;QAC5D,MAAM,GAAG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