@w6w/sdk 0.2.1 → 0.4.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 +1 -1
- package/dist/src/client.d.ts +33 -1
- package/dist/src/client.d.ts.map +1 -1
- package/dist/src/client.js +34 -1
- package/dist/src/client.js.map +1 -1
- package/dist/src/console/api-calls.d.ts +80 -0
- package/dist/src/console/api-calls.d.ts.map +1 -0
- package/dist/src/console/api-calls.js +69 -0
- package/dist/src/console/api-calls.js.map +1 -0
- package/dist/src/console/apps.d.ts +689 -0
- package/dist/src/console/apps.d.ts.map +1 -0
- package/dist/src/console/apps.js +402 -0
- package/dist/src/console/apps.js.map +1 -0
- package/dist/src/console/auth.d.ts +241 -0
- package/dist/src/console/auth.d.ts.map +1 -0
- package/dist/src/console/auth.js +173 -0
- package/dist/src/console/auth.js.map +1 -0
- package/dist/src/console/connections.d.ts +188 -0
- package/dist/src/console/connections.d.ts.map +1 -0
- package/dist/src/console/connections.js +182 -0
- package/dist/src/console/connections.js.map +1 -0
- package/dist/src/console/dashboard.d.ts +102 -0
- package/dist/src/console/dashboard.d.ts.map +1 -0
- package/dist/src/console/dashboard.js +59 -0
- package/dist/src/console/dashboard.js.map +1 -0
- package/dist/src/console/endpoints.d.ts +264 -0
- package/dist/src/console/endpoints.d.ts.map +1 -0
- package/dist/src/console/endpoints.js +164 -0
- package/dist/src/console/endpoints.js.map +1 -0
- package/dist/src/console/functions.d.ts +165 -0
- package/dist/src/console/functions.d.ts.map +1 -0
- package/dist/src/console/functions.js +117 -0
- package/dist/src/console/functions.js.map +1 -0
- package/dist/src/console/mod.d.ts +131 -0
- package/dist/src/console/mod.d.ts.map +1 -0
- package/dist/src/console/mod.js +121 -0
- package/dist/src/console/mod.js.map +1 -0
- package/dist/src/console/projects.d.ts +107 -0
- package/dist/src/console/projects.d.ts.map +1 -0
- package/dist/src/console/projects.js +97 -0
- package/dist/src/console/projects.js.map +1 -0
- package/dist/src/console/reliability.d.ts +149 -0
- package/dist/src/console/reliability.d.ts.map +1 -0
- package/dist/src/console/reliability.js +56 -0
- package/dist/src/console/reliability.js.map +1 -0
- package/dist/src/console/saved-tests.d.ts +198 -0
- package/dist/src/console/saved-tests.d.ts.map +1 -0
- package/dist/src/console/saved-tests.js +172 -0
- package/dist/src/console/saved-tests.js.map +1 -0
- package/dist/src/console/schedules.d.ts +127 -0
- package/dist/src/console/schedules.d.ts.map +1 -0
- package/dist/src/console/schedules.js +118 -0
- package/dist/src/console/schedules.js.map +1 -0
- package/dist/src/console/step-tests.d.ts +159 -0
- package/dist/src/console/step-tests.d.ts.map +1 -0
- package/dist/src/console/step-tests.js +129 -0
- package/dist/src/console/step-tests.js.map +1 -0
- package/dist/src/console/subscriptions.d.ts +199 -0
- package/dist/src/console/subscriptions.d.ts.map +1 -0
- package/dist/src/console/subscriptions.js +191 -0
- package/dist/src/console/subscriptions.js.map +1 -0
- package/dist/src/console/tenant-oauth-apps.d.ts +188 -0
- package/dist/src/console/tenant-oauth-apps.d.ts.map +1 -0
- package/dist/src/console/tenant-oauth-apps.js +152 -0
- package/dist/src/console/tenant-oauth-apps.js.map +1 -0
- package/dist/src/console/tokens.d.ts +159 -0
- package/dist/src/console/tokens.d.ts.map +1 -0
- package/dist/src/console/tokens.js +145 -0
- package/dist/src/console/tokens.js.map +1 -0
- package/dist/src/console/vault.d.ts +188 -0
- package/dist/src/console/vault.d.ts.map +1 -0
- package/dist/src/console/vault.js +164 -0
- package/dist/src/console/vault.js.map +1 -0
- package/dist/src/console/workflows.d.ts +243 -0
- package/dist/src/console/workflows.d.ts.map +1 -0
- package/dist/src/console/workflows.js +205 -0
- package/dist/src/console/workflows.js.map +1 -0
- package/dist/src/http.d.ts +32 -2
- package/dist/src/http.d.ts.map +1 -1
- package/dist/src/http.js +11 -2
- package/dist/src/http.js.map +1 -1
- package/dist/src/types.d.ts +2 -2
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/version.js +1 -1
- package/dist/src/workflows.d.ts +11 -4
- package/dist/src/workflows.d.ts.map +1 -1
- package/dist/src/workflows.js +3 -3
- package/dist/src/workflows.js.map +1 -1
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ The package is authored as runtime-neutral TypeScript against Web standards (`fe
|
|
|
10
10
|
`URL`, `AbortController`), so the same build runs under Node 18+, Deno and Bun.
|
|
11
11
|
|
|
12
12
|
- **License:** MIT (see [LICENSE](./LICENSE)).
|
|
13
|
-
- **Version:** `0.2.
|
|
13
|
+
- **Version:** `0.2.1`.
|
|
14
14
|
|
|
15
15
|
## Install
|
|
16
16
|
|
package/dist/src/client.d.ts
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
import { type ResolvedConfig, type W6wClientOptions } from "./config.ts";
|
|
18
18
|
import { ConnectionsApi } from "./connections.ts";
|
|
19
|
+
import { ConsoleApi } from "./console/mod.ts";
|
|
19
20
|
import { DocumentsApi } from "./documents.ts";
|
|
20
21
|
import { type HttpResponse, type RequestOptions } from "./http.ts";
|
|
21
22
|
import { type RunInput } from "./run.ts";
|
|
@@ -70,9 +71,40 @@ export declare class W6wClient {
|
|
|
70
71
|
/**
|
|
71
72
|
* Workflows: `list` and `run`. `list` is project-scoped and accepts an
|
|
72
73
|
* optional `project` that overrides this client's default; `run` is addressed
|
|
73
|
-
* by `wf_…` id and takes `wait`, `variables` and `
|
|
74
|
+
* by `wf_…` id and takes `wait`, `variables`, `trigger` and `input`.
|
|
75
|
+
*
|
|
76
|
+
* `variables` and `input` are not interchangeable: `variables` lands as
|
|
77
|
+
* `vars.*` in the run scope, while `input` is delivered to the entry
|
|
78
|
+
* `@w6w/trigger` step and read downstream as `steps.<triggerId>.output.<key>`.
|
|
74
79
|
*/
|
|
75
80
|
readonly workflows: WorkflowsApi;
|
|
81
|
+
/**
|
|
82
|
+
* Console-only namespaces: `console.reliability.list`, `console.auth.*`
|
|
83
|
+
* (`login`, `signup`, `checkAccountSlug`, `createAccount`),
|
|
84
|
+
* `console.dashboard.stats`, `console.projects.*` (`list`, `create`,
|
|
85
|
+
* `delete`), `console.schedules.*` (`get`, `upsert`, `delete`),
|
|
86
|
+
* `console.apps.*` (`list`, `get`, `getAuth`, `getActions`, `getTriggers`,
|
|
87
|
+
* `getHealth`, `getHealthStatus`, `listOAuthConfig`, `upsertOAuthConfig`,
|
|
88
|
+
* `deleteOAuthConfig`, `startOAuthFlow`, `preview`, `import`, `refresh`,
|
|
89
|
+
* `invoke`, `delete`), `console.connections.*` (`listForApp`, `get`,
|
|
90
|
+
* `create`, `update`, `test`, `delete`), `console.workflows.*` (`get`,
|
|
91
|
+
* `upsert`, `archive`, `delete`, `listRuns`, `getRun`),
|
|
92
|
+
* `console.savedTests.*` (`list`, `create`, `update`, `delete`,
|
|
93
|
+
* `recordTestRun`, `listTestRuns`), `console.stepTests.*` (`save`,
|
|
94
|
+
* `list`, `recordRun`), `console.vault.*` (`list`, `get`, `create`,
|
|
95
|
+
* `update`, `delete`, `seal`), `console.tokens.*` (`list`, `create`,
|
|
96
|
+
* `disable`, `enable`, `revoke`), `console.functions.*` (`list`, `get`,
|
|
97
|
+
* `upsert`), `console.endpoints.*` (`list`, `get`, `upsert`, `invoke`),
|
|
98
|
+
* `console.subscriptions.*` (`list`, `listForWorkflow`, `get`, `create`,
|
|
99
|
+
* `delete`, `listEvents`, `requeueEvent`), `console.apiCalls.*` (`list`) and
|
|
100
|
+
* `console.tenantOAuthApps.*` (`list`, `put`, `remove`).
|
|
101
|
+
* Studio-internal and unstable — not part of the published partner
|
|
102
|
+
* contract, excluded from `endpoints.json` and from this package's root
|
|
103
|
+
* barrel (`docs/console.md`, HITL-1). Reached only through
|
|
104
|
+
* `@w6w/sdk/console`'s re-exports, and constructed with the transport only,
|
|
105
|
+
* exactly like `vars` and `connections`.
|
|
106
|
+
*/
|
|
107
|
+
readonly console: ConsoleApi;
|
|
76
108
|
/**
|
|
77
109
|
* @param options - Explicit configuration; anything omitted falls back to the environment.
|
|
78
110
|
* @throws {ConfigError} When no base URL is configured, or the host has no `fetch`.
|
package/dist/src/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACtB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,KAAK,YAAY,EAAW,KAAK,cAAc,EAAE,MAAM,WAAW,CAAC;AAE5E,OAAO,EAAE,KAAK,QAAQ,EAAU,MAAM,UAAU,CAAC;AACjD,OAAO,KAAK,EAAE,EAAE,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,SAAS;;IACpB;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;IAEhC;;;;OAIG;IACH,QAAQ,CAAC,SAAS,EAAE,YAAY,CAAC;IAEjC;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAEvB;;;;OAIG;IACH,QAAQ,CAAC,WAAW,EAAE,cAAc,CAAC;IAErC
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACtB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,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Config, } from "./config.js";
|
|
18
18
|
import { ConnectionsApi } from "./connections.js";
|
|
19
|
+
import { ConsoleApi } from "./console/mod.js";
|
|
19
20
|
import { DocumentsApi } from "./documents.js";
|
|
20
21
|
import { ConfigError } from "./errors.js";
|
|
21
22
|
import { request } from "./http.js";
|
|
@@ -70,9 +71,40 @@ export class W6wClient {
|
|
|
70
71
|
/**
|
|
71
72
|
* Workflows: `list` and `run`. `list` is project-scoped and accepts an
|
|
72
73
|
* optional `project` that overrides this client's default; `run` is addressed
|
|
73
|
-
* by `wf_…` id and takes `wait`, `variables` and `
|
|
74
|
+
* by `wf_…` id and takes `wait`, `variables`, `trigger` and `input`.
|
|
75
|
+
*
|
|
76
|
+
* `variables` and `input` are not interchangeable: `variables` lands as
|
|
77
|
+
* `vars.*` in the run scope, while `input` is delivered to the entry
|
|
78
|
+
* `@w6w/trigger` step and read downstream as `steps.<triggerId>.output.<key>`.
|
|
74
79
|
*/
|
|
75
80
|
workflows;
|
|
81
|
+
/**
|
|
82
|
+
* Console-only namespaces: `console.reliability.list`, `console.auth.*`
|
|
83
|
+
* (`login`, `signup`, `checkAccountSlug`, `createAccount`),
|
|
84
|
+
* `console.dashboard.stats`, `console.projects.*` (`list`, `create`,
|
|
85
|
+
* `delete`), `console.schedules.*` (`get`, `upsert`, `delete`),
|
|
86
|
+
* `console.apps.*` (`list`, `get`, `getAuth`, `getActions`, `getTriggers`,
|
|
87
|
+
* `getHealth`, `getHealthStatus`, `listOAuthConfig`, `upsertOAuthConfig`,
|
|
88
|
+
* `deleteOAuthConfig`, `startOAuthFlow`, `preview`, `import`, `refresh`,
|
|
89
|
+
* `invoke`, `delete`), `console.connections.*` (`listForApp`, `get`,
|
|
90
|
+
* `create`, `update`, `test`, `delete`), `console.workflows.*` (`get`,
|
|
91
|
+
* `upsert`, `archive`, `delete`, `listRuns`, `getRun`),
|
|
92
|
+
* `console.savedTests.*` (`list`, `create`, `update`, `delete`,
|
|
93
|
+
* `recordTestRun`, `listTestRuns`), `console.stepTests.*` (`save`,
|
|
94
|
+
* `list`, `recordRun`), `console.vault.*` (`list`, `get`, `create`,
|
|
95
|
+
* `update`, `delete`, `seal`), `console.tokens.*` (`list`, `create`,
|
|
96
|
+
* `disable`, `enable`, `revoke`), `console.functions.*` (`list`, `get`,
|
|
97
|
+
* `upsert`), `console.endpoints.*` (`list`, `get`, `upsert`, `invoke`),
|
|
98
|
+
* `console.subscriptions.*` (`list`, `listForWorkflow`, `get`, `create`,
|
|
99
|
+
* `delete`, `listEvents`, `requeueEvent`), `console.apiCalls.*` (`list`) and
|
|
100
|
+
* `console.tenantOAuthApps.*` (`list`, `put`, `remove`).
|
|
101
|
+
* Studio-internal and unstable — not part of the published partner
|
|
102
|
+
* contract, excluded from `endpoints.json` and from this package's root
|
|
103
|
+
* barrel (`docs/console.md`, HITL-1). Reached only through
|
|
104
|
+
* `@w6w/sdk/console`'s re-exports, and constructed with the transport only,
|
|
105
|
+
* exactly like `vars` and `connections`.
|
|
106
|
+
*/
|
|
107
|
+
console;
|
|
76
108
|
#fetch;
|
|
77
109
|
/**
|
|
78
110
|
* @param options - Explicit configuration; anything omitted falls back to the environment.
|
|
@@ -102,6 +134,7 @@ export class W6wClient {
|
|
|
102
134
|
this.vars = new VarsApi(this);
|
|
103
135
|
this.connections = new ConnectionsApi(this);
|
|
104
136
|
this.workflows = new WorkflowsApi(this);
|
|
137
|
+
this.console = new ConsoleApi(this);
|
|
105
138
|
}
|
|
106
139
|
/**
|
|
107
140
|
* Who this client's credential says you are, plus the versions of the
|
package/dist/src/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAEL,aAAa,GAGd,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,gB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;OAoBG;IACH,GAAG,CAAC,KAAe;QACjB,OAAO,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC7B,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAI,OAAuB;QAChC,OAAO,OAAO,CAAI,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACvD,CAAC;CACF"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `client.console.apiCalls.*` — the outbound API call log behind a run,
|
|
3
|
+
* relocated from the studio's own API client.
|
|
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
|
+
* One method: `list`, relocated from `client.ts:214-231`'s `listApiCalls` —
|
|
15
|
+
* which lived under the `client.ts` `// Apps` comment block despite having no
|
|
16
|
+
* apps-domain consumer (its only caller is reliability's drill-down page).
|
|
17
|
+
*
|
|
18
|
+
* **`ApiCallRecord` is REUSED from `console.apps`, never redefined.**
|
|
19
|
+
* `console/apps.ts` already declares it (used internally by `AppsApi.invoke`'s
|
|
20
|
+
* result type) and `console/mod.ts` already re-exports it — this module
|
|
21
|
+
* imports it as a type and uses it verbatim as `list`'s return element type.
|
|
22
|
+
*
|
|
23
|
+
* `api-calls` is scoped to the caller by the server's own repo, not by a
|
|
24
|
+
* `project` query param — so `ApiCallsHost` needs only the transport,
|
|
25
|
+
* mirroring `VarsHost`/`ProjectsHost`, not `DocumentsHost`.
|
|
26
|
+
*
|
|
27
|
+
* @module
|
|
28
|
+
*/
|
|
29
|
+
import type { HttpResponse, RequestOptions } from "../http.ts";
|
|
30
|
+
import type { ApiCallRecord } from "./apps.ts";
|
|
31
|
+
export type { ApiCallRecord } from "./apps.ts";
|
|
32
|
+
/**
|
|
33
|
+
* The slice of `W6wClient` this namespace needs: the transport, and nothing
|
|
34
|
+
* else. Structural rather than a concrete client type, so the namespace stays
|
|
35
|
+
* independently constructible in a test and this module never imports the
|
|
36
|
+
* client back — mirrors `VarsHost` in `../vars.ts`.
|
|
37
|
+
*/
|
|
38
|
+
export interface ApiCallsHost {
|
|
39
|
+
/** Perform one request. */
|
|
40
|
+
request<T>(options: RequestOptions): Promise<HttpResponse<T>>;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Optional filter for `list`. All fields optional; omitted or `undefined`
|
|
44
|
+
* fields are not sent as query params — mirrors `client.ts:214-231`'s default
|
|
45
|
+
* `{}` parameter and its `Object.entries` loop that skips `undefined`/`""`
|
|
46
|
+
* values.
|
|
47
|
+
*/
|
|
48
|
+
export interface ApiCallsFilter {
|
|
49
|
+
appId?: string;
|
|
50
|
+
actionKey?: string;
|
|
51
|
+
connectionId?: string;
|
|
52
|
+
sessionId?: string;
|
|
53
|
+
/** Server defaults to 25 when unset/invalid, caps at 200. */
|
|
54
|
+
limit?: number;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* The `console.apiCalls` namespace on a `W6wClient`.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```ts
|
|
61
|
+
* const calls = await client.console.apiCalls.list({ appId: "app_x", limit: 50 });
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
export declare class ApiCallsApi {
|
|
65
|
+
#private;
|
|
66
|
+
/**
|
|
67
|
+
* @param host - The client this namespace issues requests through.
|
|
68
|
+
*/
|
|
69
|
+
constructor(host: ApiCallsHost);
|
|
70
|
+
/**
|
|
71
|
+
* List outbound API calls, newest first. Filter by app/action/connection/
|
|
72
|
+
* session.
|
|
73
|
+
*
|
|
74
|
+
* @param filter - Optional filter; omitted entirely, no query params are sent.
|
|
75
|
+
* @returns The calls, unwrapped from the `apiCalls` envelope.
|
|
76
|
+
* @throws {ApiError} On any non-2xx.
|
|
77
|
+
*/
|
|
78
|
+
list(filter?: ApiCallsFilter): Promise<ApiCallRecord[]>;
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=api-calls.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-calls.d.ts","sourceRoot":"","sources":["../../../src/console/api-calls.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAK/C,YAAY,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE/C;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,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,cAAc;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6DAA6D;IAC7D,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;GAOG;AACH,qBAAa,WAAW;;IAGtB;;OAEG;gBACS,IAAI,EAAE,YAAY;IAI9B;;;;;;;OAOG;IACG,IAAI,CAAC,MAAM,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;CAc9D"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `client.console.apiCalls.*` — the outbound API call log behind a run,
|
|
3
|
+
* relocated from the studio's own API client.
|
|
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
|
+
* One method: `list`, relocated from `client.ts:214-231`'s `listApiCalls` —
|
|
15
|
+
* which lived under the `client.ts` `// Apps` comment block despite having no
|
|
16
|
+
* apps-domain consumer (its only caller is reliability's drill-down page).
|
|
17
|
+
*
|
|
18
|
+
* **`ApiCallRecord` is REUSED from `console.apps`, never redefined.**
|
|
19
|
+
* `console/apps.ts` already declares it (used internally by `AppsApi.invoke`'s
|
|
20
|
+
* result type) and `console/mod.ts` already re-exports it — this module
|
|
21
|
+
* imports it as a type and uses it verbatim as `list`'s return element type.
|
|
22
|
+
*
|
|
23
|
+
* `api-calls` is scoped to the caller by the server's own repo, not by a
|
|
24
|
+
* `project` query param — so `ApiCallsHost` needs only the transport,
|
|
25
|
+
* mirroring `VarsHost`/`ProjectsHost`, not `DocumentsHost`.
|
|
26
|
+
*
|
|
27
|
+
* @module
|
|
28
|
+
*/
|
|
29
|
+
import { unwrap } from "../types.js";
|
|
30
|
+
/**
|
|
31
|
+
* The `console.apiCalls` namespace on a `W6wClient`.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* const calls = await client.console.apiCalls.list({ appId: "app_x", limit: 50 });
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export class ApiCallsApi {
|
|
39
|
+
#host;
|
|
40
|
+
/**
|
|
41
|
+
* @param host - The client this namespace issues requests through.
|
|
42
|
+
*/
|
|
43
|
+
constructor(host) {
|
|
44
|
+
this.#host = host;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* List outbound API calls, newest first. Filter by app/action/connection/
|
|
48
|
+
* session.
|
|
49
|
+
*
|
|
50
|
+
* @param filter - Optional filter; omitted entirely, no query params are sent.
|
|
51
|
+
* @returns The calls, unwrapped from the `apiCalls` envelope.
|
|
52
|
+
* @throws {ApiError} On any non-2xx.
|
|
53
|
+
*/
|
|
54
|
+
async list(filter) {
|
|
55
|
+
const res = await this.#host.request({
|
|
56
|
+
method: "GET",
|
|
57
|
+
path: "/api-calls",
|
|
58
|
+
query: {
|
|
59
|
+
appId: filter?.appId,
|
|
60
|
+
actionKey: filter?.actionKey,
|
|
61
|
+
connectionId: filter?.connectionId,
|
|
62
|
+
sessionId: filter?.sessionId,
|
|
63
|
+
limit: filter?.limit,
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
return unwrap(res, "apiCalls");
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=api-calls.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-calls.js","sourceRoot":"","sources":["../../../src/console/api-calls.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAkCrC;;;;;;;GAOG;AACH,MAAM,OAAO,WAAW;IACb,KAAK,CAAe;IAE7B;;OAEG;IACH,YAAY,IAAkB;QAC5B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACpB,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,IAAI,CAAC,MAAuB;QAChC,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAU;YAC5C,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,YAAY;YAClB,KAAK,EAAE;gBACL,KAAK,EAAE,MAAM,EAAE,KAAK;gBACpB,SAAS,EAAE,MAAM,EAAE,SAAS;gBAC5B,YAAY,EAAE,MAAM,EAAE,YAAY;gBAClC,SAAS,EAAE,MAAM,EAAE,SAAS;gBAC5B,KAAK,EAAE,MAAM,EAAE,KAAK;aACrB;SACF,CAAC,CAAC;QACH,OAAO,MAAM,CAAkB,GAAG,EAAE,UAAU,CAAC,CAAC;IAClD,CAAC;CACF"}
|