@introspection-sdk/introspection-node 0.22.0 → 0.31.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 +430 -8
- package/dist/auth-client.d.ts +182 -0
- package/dist/auth-client.d.ts.map +1 -0
- package/dist/auth-client.js +402 -0
- package/dist/auth-client.js.map +1 -0
- package/dist/auth.d.ts +12 -2
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js.map +1 -1
- package/dist/client.d.ts +51 -6
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +80 -6
- package/dist/client.js.map +1 -1
- package/dist/data-plane.d.ts +69 -0
- package/dist/data-plane.d.ts.map +1 -0
- package/dist/data-plane.js +61 -0
- package/dist/data-plane.js.map +1 -0
- package/dist/http.d.ts +23 -4
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +26 -7
- package/dist/http.js.map +1 -1
- package/dist/index.d.ts +14 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/dist/otel/index.d.ts +3 -1
- package/dist/otel/index.d.ts.map +1 -1
- package/dist/otel/index.js +2 -1
- package/dist/otel/index.js.map +1 -1
- package/dist/otel/init.d.ts +7 -2
- package/dist/otel/init.d.ts.map +1 -1
- package/dist/otel/init.js +9 -2
- package/dist/otel/init.js.map +1 -1
- package/dist/otel/logs.d.ts +23 -6
- package/dist/otel/logs.d.ts.map +1 -1
- package/dist/otel/logs.js +56 -13
- package/dist/otel/logs.js.map +1 -1
- package/dist/resources/annotations.d.ts +28 -0
- package/dist/resources/annotations.d.ts.map +1 -0
- package/dist/resources/annotations.js +198 -0
- package/dist/resources/annotations.js.map +1 -0
- package/dist/resources/app-connections.d.ts +35 -0
- package/dist/resources/app-connections.d.ts.map +1 -0
- package/dist/resources/app-connections.js +66 -0
- package/dist/resources/app-connections.js.map +1 -0
- package/dist/resources/automations.d.ts +5 -0
- package/dist/resources/automations.d.ts.map +1 -0
- package/dist/resources/automations.js +6 -0
- package/dist/resources/automations.js.map +1 -0
- package/dist/resources/connectors.d.ts +34 -2
- package/dist/resources/connectors.d.ts.map +1 -1
- package/dist/resources/connectors.js +53 -1
- package/dist/resources/connectors.js.map +1 -1
- package/dist/resources/experiments.d.ts +6 -6
- package/dist/resources/experiments.d.ts.map +1 -1
- package/dist/resources/experiments.js +29 -6
- package/dist/resources/experiments.js.map +1 -1
- package/dist/resources/members.d.ts +33 -0
- package/dist/resources/members.d.ts.map +1 -0
- package/dist/resources/members.js +59 -0
- package/dist/resources/members.js.map +1 -0
- package/dist/resources/repositories.d.ts +52 -0
- package/dist/resources/repositories.d.ts.map +1 -0
- package/dist/resources/repositories.js +112 -0
- package/dist/resources/repositories.js.map +1 -0
- package/dist/runner.d.ts +19 -5
- package/dist/runner.d.ts.map +1 -1
- package/dist/runner.js +18 -3
- package/dist/runner.js.map +1 -1
- package/dist/types.d.ts +2 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utils.d.ts +2 -2
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +1 -1
- package/dist/utils.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +21 -16
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"automations.js","sourceRoot":"","sources":["../../src/resources/automations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAGzD,OAAO,EAAE,cAAc,EAAE,CAAC;AAE1B,MAAM,UAAU,iBAAiB,CAAC,IAAgB;IAChD,OAAO,IAAI,cAAc,CAAC,IAAI,CAAC,CAAC;AAClC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Connection, ConnectionCreateParams, ConnectionTokenParams, ConnectionTokenResult, Connector, ConnectorAuthorizeParams, ConnectorAuthorizeResponse, ConnectorCreateParams, ConnectorListParams, ConnectorUpdateParams, CursorParams, Uuid } from "@introspection-sdk/types";
|
|
1
|
+
import type { Connection, ConnectionCreateParams, ConnectionTokenParams, ConnectionTokenResult, Connector, ConnectorApp, ConnectorAppListParams, ConnectorAuthorizeParams, ConnectorAuthorizeResponse, ConnectorCreateParams, ConnectorCustomAppSearchParams, ConnectorListParams, ConnectorOAuthDiscoveryResponse, ConnectorUpdateParams, CursorParams, Uuid } from "@introspection-sdk/types";
|
|
2
2
|
import type { HttpClient } from "../http.js";
|
|
3
3
|
import { Paginator } from "../pagination.js";
|
|
4
4
|
/**
|
|
@@ -59,12 +59,37 @@ export declare class ConnectorsApi {
|
|
|
59
59
|
* cursor; stop early to stop fetching).
|
|
60
60
|
*/
|
|
61
61
|
list(params?: ConnectorListParams): Paginator<Connector>;
|
|
62
|
-
/**
|
|
62
|
+
/**
|
|
63
|
+
* Create a connector. Upserts on `slug`: a repeat POST replaces the live
|
|
64
|
+
* row's configuration and keeps its provider, auth mode and stored secrets.
|
|
65
|
+
*/
|
|
63
66
|
create(params: ConnectorCreateParams): Promise<Connector>;
|
|
64
67
|
get(connectorId: Uuid): Promise<Connector>;
|
|
65
68
|
update(connectorId: Uuid, params: ConnectorUpdateParams): Promise<Connector>;
|
|
66
69
|
/** Soft-delete a connector; the server revokes its connections. */
|
|
67
70
|
delete(connectorId: Uuid): Promise<void>;
|
|
71
|
+
/**
|
|
72
|
+
* Search the provider's application catalogue. Pipedream connectors use
|
|
73
|
+
* the returned slug when minting an application-specific Connect Link.
|
|
74
|
+
*/
|
|
75
|
+
listApps(connectorId: Uuid, params?: ConnectorAppListParams): Promise<ConnectorApp[]>;
|
|
76
|
+
/**
|
|
77
|
+
* Search the open MCP registry — the catalogue a custom connector picks
|
|
78
|
+
* from. Needs no connector: read it before creating one, then pass the
|
|
79
|
+
* listing's `mcp_url` to {@link discoverOAuth} or `create({ issuer })`.
|
|
80
|
+
*/
|
|
81
|
+
searchCustomApps(params: ConnectorCustomAppSearchParams): Promise<ConnectorApp[]>;
|
|
82
|
+
/**
|
|
83
|
+
* Resolve a provider's OAuth metadata before creating a custom connector.
|
|
84
|
+
* `issuer` may be the authorization server or the MCP server it protects.
|
|
85
|
+
*
|
|
86
|
+
* This may REGISTER an OAuth client with the provider (dynamic
|
|
87
|
+
* registration) and return its `client_id` / `client_secret` — pass those
|
|
88
|
+
* to {@link create} so a second client is not registered. (`create` with
|
|
89
|
+
* only `issuer` also discovers and registers on its own.) Raises a
|
|
90
|
+
* {@link ValidationError} (400) when discovery fails.
|
|
91
|
+
*/
|
|
92
|
+
discoverOAuth(issuer: string): Promise<ConnectorOAuthDiscoveryResponse>;
|
|
68
93
|
/**
|
|
69
94
|
* Mint a consent URL for a connector — the link a Business hands its
|
|
70
95
|
* customer to connect (e.g. install the Slack app into a workspace).
|
|
@@ -75,6 +100,13 @@ export declare class ConnectorsApi {
|
|
|
75
100
|
* chat-provider connector (`connector.requires_runtime === true`) 422s
|
|
76
101
|
* unless `runtime` names the agent that replies.
|
|
77
102
|
*
|
|
103
|
+
* Pipedream connectors additionally require `app`, selected from
|
|
104
|
+
* {@link listApps}. `allow_progressive_scopes` is optional and defaults to
|
|
105
|
+
* false, matching Pipedream's Connect API.
|
|
106
|
+
*
|
|
107
|
+
* `binding` (with `runtime`) writes the runtime's MCP endpoint in the same
|
|
108
|
+
* transaction as the grant, so the runtime is never authorized-but-unbound.
|
|
109
|
+
*
|
|
78
110
|
* Passing `params.identity` mints a `customer` member for the asserted
|
|
79
111
|
* end user, so it can raise a {@link ConflictError} (409) when the org has
|
|
80
112
|
* reached its member limit — a plan conflict, not back-pressure.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connectors.d.ts","sourceRoot":"","sources":["../../src/resources/connectors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EACrB,SAAS,EACT,wBAAwB,EACxB,0BAA0B,EAC1B,qBA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QzD,GAAG,CAAC,WAAW,EAAE,IAAI,GAAG,OAAO,CAAC,SAAS,CAAC;IAO1C,MAAM,CAAC,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAAC,SAAS,CAAC;IAQ5E,mEAAmE;IACnE,MAAM,CAAC,WAAW,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAQxC;;;OAGG;IACG,QAAQ,CACZ,WAAW,EAAE,IAAI,EACjB,MAAM,GAAE,sBAA2B,GAClC,OAAO,CAAC,YAAY,EAAE,CAAC;IAS1B;;;;OAIG;IACG,gBAAgB,CACpB,MAAM,EAAE,8BAA8B,GACrC,OAAO,CAAC,YAAY,EAAE,CAAC;IAS1B;;;;;;;;;OASG;IACH,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,+BAA+B,CAAC;IAQvE;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,SAAS,CACP,WAAW,EAAE,IAAI,EACjB,MAAM,GAAE,wBAA6B,GACpC,OAAO,CAAC,0BAA0B,CAAC;CAOvC;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,UAAU,GAAG,aAAa,CAEhE"}
|
|
@@ -97,7 +97,10 @@ export class ConnectorsApi {
|
|
|
97
97
|
query: { ...params, next },
|
|
98
98
|
}), params.next);
|
|
99
99
|
}
|
|
100
|
-
/**
|
|
100
|
+
/**
|
|
101
|
+
* Create a connector. Upserts on `slug`: a repeat POST replaces the live
|
|
102
|
+
* row's configuration and keeps its provider, auth mode and stored secrets.
|
|
103
|
+
*/
|
|
101
104
|
create(params) {
|
|
102
105
|
return this.http.request({
|
|
103
106
|
method: "POST",
|
|
@@ -126,6 +129,48 @@ export class ConnectorsApi {
|
|
|
126
129
|
expect: "empty",
|
|
127
130
|
});
|
|
128
131
|
}
|
|
132
|
+
/**
|
|
133
|
+
* Search the provider's application catalogue. Pipedream connectors use
|
|
134
|
+
* the returned slug when minting an application-specific Connect Link.
|
|
135
|
+
*/
|
|
136
|
+
async listApps(connectorId, params = {}) {
|
|
137
|
+
const response = await this.http.request({
|
|
138
|
+
method: "GET",
|
|
139
|
+
path: `/v1/connectors/${encodeURIComponent(connectorId)}/apps`,
|
|
140
|
+
query: params,
|
|
141
|
+
});
|
|
142
|
+
return response.data;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Search the open MCP registry — the catalogue a custom connector picks
|
|
146
|
+
* from. Needs no connector: read it before creating one, then pass the
|
|
147
|
+
* listing's `mcp_url` to {@link discoverOAuth} or `create({ issuer })`.
|
|
148
|
+
*/
|
|
149
|
+
async searchCustomApps(params) {
|
|
150
|
+
const response = await this.http.request({
|
|
151
|
+
method: "GET",
|
|
152
|
+
path: "/v1/connectors/custom/apps",
|
|
153
|
+
query: params,
|
|
154
|
+
});
|
|
155
|
+
return response.data;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Resolve a provider's OAuth metadata before creating a custom connector.
|
|
159
|
+
* `issuer` may be the authorization server or the MCP server it protects.
|
|
160
|
+
*
|
|
161
|
+
* This may REGISTER an OAuth client with the provider (dynamic
|
|
162
|
+
* registration) and return its `client_id` / `client_secret` — pass those
|
|
163
|
+
* to {@link create} so a second client is not registered. (`create` with
|
|
164
|
+
* only `issuer` also discovers and registers on its own.) Raises a
|
|
165
|
+
* {@link ValidationError} (400) when discovery fails.
|
|
166
|
+
*/
|
|
167
|
+
discoverOAuth(issuer) {
|
|
168
|
+
return this.http.request({
|
|
169
|
+
method: "POST",
|
|
170
|
+
path: "/v1/connectors/discover-oauth",
|
|
171
|
+
body: { issuer },
|
|
172
|
+
});
|
|
173
|
+
}
|
|
129
174
|
/**
|
|
130
175
|
* Mint a consent URL for a connector — the link a Business hands its
|
|
131
176
|
* customer to connect (e.g. install the Slack app into a workspace).
|
|
@@ -136,6 +181,13 @@ export class ConnectorsApi {
|
|
|
136
181
|
* chat-provider connector (`connector.requires_runtime === true`) 422s
|
|
137
182
|
* unless `runtime` names the agent that replies.
|
|
138
183
|
*
|
|
184
|
+
* Pipedream connectors additionally require `app`, selected from
|
|
185
|
+
* {@link listApps}. `allow_progressive_scopes` is optional and defaults to
|
|
186
|
+
* false, matching Pipedream's Connect API.
|
|
187
|
+
*
|
|
188
|
+
* `binding` (with `runtime`) writes the runtime's MCP endpoint in the same
|
|
189
|
+
* transaction as the grant, so the runtime is never authorized-but-unbound.
|
|
190
|
+
*
|
|
139
191
|
* Passing `params.identity` mints a `customer` member for the asserted
|
|
140
192
|
* end user, so it can raise a {@link ConflictError} (409) when the org has
|
|
141
193
|
* reached its member limit — a plan conflict, not back-pressure.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connectors.js","sourceRoot":"","sources":["../../src/resources/connectors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"connectors.js","sourceRoot":"","sources":["../../src/resources/connectors.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAa,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAE7D;;;;;;GAMG;AACH,MAAM,OAAO,cAAc;IACI;IAA7B,YAA6B,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;IAAG,CAAC;IAEjD;;;;OAIG;IACH,IAAI,CAAC,WAAiB,EAAE,SAAuB,EAAE;QAC/C,OAAO,cAAc,CACnB,CAAC,IAAI,EAAE,EAAE,CACP,IAAI,CAAC,IAAI,CAAC,OAAO,CAAwB;YACvC,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,kBAAkB,kBAAkB,CAAC,WAAW,CAAC,cAAc;YACrE,KAAK,EAAE,EAAE,GAAG,MAAM,EAAE,IAAI,EAA6B;SACtD,CAAC,EACJ,MAAM,CAAC,IAAI,CACZ,CAAC;IACJ,CAAC;IAED;;;;;OAKG;IACH,MAAM,CACJ,WAAiB,EACjB,MAA8B;QAE9B,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAa;YACnC,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,kBAAk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,CAAC;IACvB,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,gBAAgB,CACpB,MAAsC;QAEtC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAA2B;YACjE,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,4BAA4B;YAClC,KAAK,EAAE,MAA4C;SACpD,CAAC,CAAC;QACH,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;IAED;;;;;;;;;OASG;IACH,aAAa,CAAC,MAAc;QAC1B,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAkC;YACxD,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,+BAA+B;YACrC,IAAI,EAAE,EAAE,MAAM,EAAE;SACjB,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,SAAS,CACP,WAAiB,EACjB,SAAmC,EAAE;QAErC,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAA6B;YACnD,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,iCAAiC;YACvC,IAAI,EAAE,EAAE,YAAY,EAAE,WAAW,EAAE,GAAG,MAAM,EAAE;SAC/C,CAAC,CAAC;IACL,CAAC;CACF;AAED,MAAM,UAAU,gBAAgB,CAAC,IAAgB;IAC/C,OAAO,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC;AACjC,CAAC"}
|
|
@@ -4,12 +4,9 @@ import type { IntrospectionClient } from "../client.js";
|
|
|
4
4
|
import { Paginator } from "../pagination.js";
|
|
5
5
|
import { Runner } from "../runner.js";
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* the experiment and then `start` / `end` / `cancel` around the work it is
|
|
11
|
-
* being measured on. Authoring an experiment is a project-authoring act and
|
|
12
|
-
* lives in the CLI.
|
|
7
|
+
* CRUD, lifecycle, and execution for `/v1/experiments` on the CP. Create and
|
|
8
|
+
* update accept the exact Control Plane request document so its schema remains
|
|
9
|
+
* the source of truth.
|
|
13
10
|
*/
|
|
14
11
|
export declare class ExperimentsApi {
|
|
15
12
|
private readonly http;
|
|
@@ -23,6 +20,9 @@ export declare class ExperimentsApi {
|
|
|
23
20
|
*/
|
|
24
21
|
list(params?: ExperimentListParams): Paginator<Experiment>;
|
|
25
22
|
get(id: Uuid): Promise<Experiment>;
|
|
23
|
+
create(document: Record<string, unknown>): Promise<Experiment>;
|
|
24
|
+
update(id: Uuid, document: Record<string, unknown>, project?: string): Promise<Experiment>;
|
|
25
|
+
delete(id: Uuid, project?: string): Promise<void>;
|
|
26
26
|
startById(id: Uuid): Promise<Experiment>;
|
|
27
27
|
endById(id: Uuid): Promise<Experiment>;
|
|
28
28
|
cancelById(id: Uuid): Promise<Experiment>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"experiments.d.ts","sourceRoot":"","sources":["../../src/resources/experiments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,oBAAoB,EAEpB,UAAU,EAEV,IAAI,EACL,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,SAAS,EAAkB,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAqB,MAAM,cAAc,CAAC;AAyBzD
|
|
1
|
+
{"version":3,"file":"experiments.d.ts","sourceRoot":"","sources":["../../src/resources/experiments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,oBAAoB,EAEpB,UAAU,EAEV,IAAI,EACL,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,SAAS,EAAkB,MAAM,kBAA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,MAAM,CAAC;IAIvC,KAAK,IAAI,OAAO,CAAC,UAAU,CAAC;IAI5B,GAAG,IAAI,OAAO,CAAC,UAAU,CAAC;IAI1B,MAAM,IAAI,OAAO,CAAC,UAAU,CAAC;CAG9B;AAED,MAAM,MAAM,uBAAuB,GAAG,CAAC,EAAE,EAAE,IAAI,KAAK,gBAAgB,CAAC;AAErE,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,mBAAmB,EAC3B,IAAI,EAAE,UAAU,GACf,cAAc,GAAG,uBAAuB,CAe1C"}
|
|
@@ -17,12 +17,9 @@ function toRunBody(opts) {
|
|
|
17
17
|
return out;
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* the experiment and then `start` / `end` / `cancel` around the work it is
|
|
24
|
-
* being measured on. Authoring an experiment is a project-authoring act and
|
|
25
|
-
* lives in the CLI.
|
|
20
|
+
* CRUD, lifecycle, and execution for `/v1/experiments` on the CP. Create and
|
|
21
|
+
* update accept the exact Control Plane request document so its schema remains
|
|
22
|
+
* the source of truth.
|
|
26
23
|
*/
|
|
27
24
|
export class ExperimentsApi {
|
|
28
25
|
http;
|
|
@@ -50,6 +47,29 @@ export class ExperimentsApi {
|
|
|
50
47
|
path: `/v1/experiments/${encodeURIComponent(id)}`,
|
|
51
48
|
});
|
|
52
49
|
}
|
|
50
|
+
create(document) {
|
|
51
|
+
return this.http.request({
|
|
52
|
+
method: "POST",
|
|
53
|
+
path: "/v1/experiments",
|
|
54
|
+
body: document,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
update(id, document, project) {
|
|
58
|
+
return this.http.request({
|
|
59
|
+
method: "PATCH",
|
|
60
|
+
path: `/v1/experiments/${encodeURIComponent(id)}`,
|
|
61
|
+
query: project ? { project } : undefined,
|
|
62
|
+
body: document,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
delete(id, project) {
|
|
66
|
+
return this.http.request({
|
|
67
|
+
method: "DELETE",
|
|
68
|
+
path: `/v1/experiments/${encodeURIComponent(id)}`,
|
|
69
|
+
query: project ? { project } : undefined,
|
|
70
|
+
expect: "empty",
|
|
71
|
+
});
|
|
72
|
+
}
|
|
53
73
|
startById(id) {
|
|
54
74
|
return this.http.request({
|
|
55
75
|
method: "POST",
|
|
@@ -111,6 +131,9 @@ export function attachExperiments(client, http) {
|
|
|
111
131
|
const hybrid = factory;
|
|
112
132
|
hybrid.list = api.list.bind(api);
|
|
113
133
|
hybrid.get = api.get.bind(api);
|
|
134
|
+
hybrid.create = api.create.bind(api);
|
|
135
|
+
hybrid.update = api.update.bind(api);
|
|
136
|
+
hybrid.delete = api.delete.bind(api);
|
|
114
137
|
hybrid.startById = api.startById.bind(api);
|
|
115
138
|
hybrid.endById = api.endById.bind(api);
|
|
116
139
|
hybrid.cancelById = api.cancelById.bind(api);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"experiments.js","sourceRoot":"","sources":["../../src/resources/experiments.ts"],"names":[],"mappings":"AAUA,OAAO,EAAa,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAqB,MAAM,cAAc,CAAC;AAczD,SAAS,SAAS,CAAC,IAAiB;IAClC,IAAI,CAAC,IAAI;QAAE,OAAO,SAAS,CAAC;IAC5B,MAAM,GAAG,GAA6B,EAAE,CAAC;IACzC,IAAI,IAAI,CAAC,QAAQ;QAAE,GAAG,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;IAChD,IAAI,IAAI,CAAC,MAAM;QAAE,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;IAC1C,IAAI,IAAI,CAAC,UAAU,KAAK,SAAS;QAAE,GAAG,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;IACpE,IAAI,IAAI,CAAC,WAAW,KAAK,SAAS;QAAE,GAAG,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC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AG,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC7C,MAAM,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACvC,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Member, MemberCreateParams, MemberListParams, MemberUpdateParams, Uuid } from "@introspection-sdk/types";
|
|
2
|
+
import type { HttpClient } from "../http.js";
|
|
3
|
+
import { Paginator } from "../pagination.js";
|
|
4
|
+
/**
|
|
5
|
+
* List, read, create and update on `/v1/members` (Control Plane).
|
|
6
|
+
* Removing a member is an org-admin action left to the CLI.
|
|
7
|
+
*
|
|
8
|
+
* `tags` are access-bearing and writable only with `members:manage`;
|
|
9
|
+
* `metadata` is a `key: value` label map that grants nothing. Both are
|
|
10
|
+
* replaced wholesale by {@link update}. A `customer` member's metadata is
|
|
11
|
+
* also merged in by every identity assertion that names it
|
|
12
|
+
* (`RunIdentityInput.metadata`).
|
|
13
|
+
*/
|
|
14
|
+
export declare class MembersApi {
|
|
15
|
+
private readonly http;
|
|
16
|
+
constructor(http: HttpClient);
|
|
17
|
+
/**
|
|
18
|
+
* List members matching `params`. `await` the result for the first page,
|
|
19
|
+
* or `for await` it to stream every member across pages (fetched lazily;
|
|
20
|
+
* stop early to stop fetching).
|
|
21
|
+
*/
|
|
22
|
+
list(params?: MemberListParams): Paginator<Member>;
|
|
23
|
+
/** Invite an operator by email; see {@link MemberCreateParams}. */
|
|
24
|
+
create(params: MemberCreateParams): Promise<Member>;
|
|
25
|
+
get(memberId: Uuid): Promise<Member>;
|
|
26
|
+
/**
|
|
27
|
+
* Update a member. Only provided fields change; `tags` and `metadata`
|
|
28
|
+
* each replace the stored value wholesale (`[]` / `{}` clear it).
|
|
29
|
+
*/
|
|
30
|
+
update(memberId: Uuid, params: MemberUpdateParams): Promise<Member>;
|
|
31
|
+
}
|
|
32
|
+
export declare function attachMembers(http: HttpClient): MembersApi;
|
|
33
|
+
//# sourceMappingURL=members.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"members.d.ts","sourceRoot":"","sources":["../../src/resources/members.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EACN,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAElB,IAAI,EACL,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAkB,MAAM,kBAAkB,CAAC;AAE7D;;;;;;;;;GASG;AACH,qBAAa,UAAU;IACT,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAE7C;;;;OAIG;IACH,IAAI,CAAC,MAAM,GAAE,gBAAqB,GAAG,SAAS,CAAC,MAAM,CAAC;IAetD,mEAAmE;IACnE,MAAM,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC;IAQnD,GAAG,CAAC,QAAQ,EAAE,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC;IAOpC;;;OAGG;IACH,MAAM,CAAC,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC;CAOpE;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,UAAU,GAAG,UAAU,CAE1D"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { encodeMetadataFilter } from "@introspection-sdk/http";
|
|
2
|
+
import { cursorPaginate } from "../pagination.js";
|
|
3
|
+
/**
|
|
4
|
+
* List, read, create and update on `/v1/members` (Control Plane).
|
|
5
|
+
* Removing a member is an org-admin action left to the CLI.
|
|
6
|
+
*
|
|
7
|
+
* `tags` are access-bearing and writable only with `members:manage`;
|
|
8
|
+
* `metadata` is a `key: value` label map that grants nothing. Both are
|
|
9
|
+
* replaced wholesale by {@link update}. A `customer` member's metadata is
|
|
10
|
+
* also merged in by every identity assertion that names it
|
|
11
|
+
* (`RunIdentityInput.metadata`).
|
|
12
|
+
*/
|
|
13
|
+
export class MembersApi {
|
|
14
|
+
http;
|
|
15
|
+
constructor(http) {
|
|
16
|
+
this.http = http;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* List members matching `params`. `await` the result for the first page,
|
|
20
|
+
* or `for await` it to stream every member across pages (fetched lazily;
|
|
21
|
+
* stop early to stop fetching).
|
|
22
|
+
*/
|
|
23
|
+
list(params = {}) {
|
|
24
|
+
return cursorPaginate((next) => this.http.request({
|
|
25
|
+
method: "GET",
|
|
26
|
+
path: "/v1/members",
|
|
27
|
+
query: { ...encodeMetadataFilter(params), next },
|
|
28
|
+
}), params.next);
|
|
29
|
+
}
|
|
30
|
+
/** Invite an operator by email; see {@link MemberCreateParams}. */
|
|
31
|
+
create(params) {
|
|
32
|
+
return this.http.request({
|
|
33
|
+
method: "POST",
|
|
34
|
+
path: "/v1/members",
|
|
35
|
+
body: params,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
get(memberId) {
|
|
39
|
+
return this.http.request({
|
|
40
|
+
method: "GET",
|
|
41
|
+
path: `/v1/members/${encodeURIComponent(memberId)}`,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Update a member. Only provided fields change; `tags` and `metadata`
|
|
46
|
+
* each replace the stored value wholesale (`[]` / `{}` clear it).
|
|
47
|
+
*/
|
|
48
|
+
update(memberId, params) {
|
|
49
|
+
return this.http.request({
|
|
50
|
+
method: "PATCH",
|
|
51
|
+
path: `/v1/members/${encodeURIComponent(memberId)}`,
|
|
52
|
+
body: params,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
export function attachMembers(http) {
|
|
57
|
+
return new MembersApi(http);
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=members.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
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AAC,IAAgB;IAC5C,OAAO,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { type Repository, type RepositoryCommit, type RepositoryCommitDetail, type RepositoryCommitPage, type RepositoryCommitsParams, type RepositoryContent, type RepositoryContentGetParams, type RepositoryContentsParams, type RepositoryDirectory, type RepositoryEntry, type RepositoryGetParams, type RepositoryListParams, type RepositoryMerge, type RepositoryMergeParams, type Uuid } from "@introspection-sdk/types";
|
|
2
|
+
import type { HttpClient } from "../http.js";
|
|
3
|
+
import { Paginator } from "../pagination.js";
|
|
4
|
+
/**
|
|
5
|
+
* `client.repositories.contents` — callable to enumerate a directory,
|
|
6
|
+
* with `.get` for one raw read (a directory page or a file).
|
|
7
|
+
*/
|
|
8
|
+
export interface RepositoryContentsApi {
|
|
9
|
+
/**
|
|
10
|
+
* Stream every entry of the directory at `params.path` (the root when
|
|
11
|
+
* omitted), following the server's cursor across pages. `await` it for
|
|
12
|
+
* the first page. Throws a {@link ValidationError} when the path is a file;
|
|
13
|
+
* read files with {@link RepositoryContentsApi.get}.
|
|
14
|
+
*/
|
|
15
|
+
(repositoryId: Uuid, params?: RepositoryContentsParams): Paginator<RepositoryEntry, RepositoryDirectory>;
|
|
16
|
+
/** Read one path: a directory page or a file, discriminated on `type`. */
|
|
17
|
+
get(repositoryId: Uuid, path: string, params?: RepositoryContentGetParams): Promise<RepositoryContent>;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Repositories linked to a project. Lookup is on the CP; `contents`,
|
|
21
|
+
* `commits` and `commit` read through the DP.
|
|
22
|
+
*
|
|
23
|
+
* `GET /v1/repositories` answers a bare array rather than the cursor
|
|
24
|
+
* envelope, so {@link RepositoriesApi.list} returns an array.
|
|
25
|
+
*/
|
|
26
|
+
export declare class RepositoriesApi {
|
|
27
|
+
private readonly cpHttp;
|
|
28
|
+
private readonly dpHttp;
|
|
29
|
+
readonly contents: RepositoryContentsApi;
|
|
30
|
+
constructor(cpHttp: HttpClient, dpHttp: HttpClient);
|
|
31
|
+
/** `GET /v1/repositories?project=…[&slug=…]` — every repository in one array. */
|
|
32
|
+
list(params: RepositoryListParams): Promise<Repository[]>;
|
|
33
|
+
/**
|
|
34
|
+
* Stream the commit history from `params.sha` (the default branch when
|
|
35
|
+
* omitted), following the server's cursor across pages. `await` it for
|
|
36
|
+
* the first page.
|
|
37
|
+
*/
|
|
38
|
+
commits(repositoryId: Uuid, params?: RepositoryCommitsParams): Paginator<RepositoryCommit, RepositoryCommitPage>;
|
|
39
|
+
/** One commit with the files it changed and its unified diff. */
|
|
40
|
+
commit(repositoryId: Uuid, sha: string): Promise<RepositoryCommitDetail>;
|
|
41
|
+
/**
|
|
42
|
+
* `POST /v1/repositories/{id}/merges` — merge `head` into `base`, like
|
|
43
|
+
* GitHub's merges API. Resolves to the merge commit, or `null` when `base`
|
|
44
|
+
* already contains `head`. A conflict throws a `ConflictError`; a `504`
|
|
45
|
+
* means it is still running, and sending the same request again attaches
|
|
46
|
+
* to it.
|
|
47
|
+
*/
|
|
48
|
+
merge(repositoryId: Uuid, params: RepositoryMergeParams): Promise<RepositoryMerge | null>;
|
|
49
|
+
get(repositoryId: Uuid, params: RepositoryGetParams): Promise<Repository>;
|
|
50
|
+
}
|
|
51
|
+
export declare function attachRepositories(cpHttp: HttpClient, dpHttp: HttpClient): RepositoriesApi;
|
|
52
|
+
//# sourceMappingURL=repositories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repositories.d.ts","sourceRoot":"","sources":["../../src/resources/repositories.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,EACtB,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,EACxB,KAAK,e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Y,EAAE,IAAI,EAAE,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,UAAU,CAAC;CAO1E;AAED,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,UAAU,GACjB,eAAe,CAEjB"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { ValidationError, } from "@introspection-sdk/types";
|
|
2
|
+
import { Paginator } from "../pagination.js";
|
|
3
|
+
/** Percent-encode each path segment, keeping `/` as the separator. */
|
|
4
|
+
function contentsPath(repositoryId, path) {
|
|
5
|
+
const base = `/v1/repositories/${encodeURIComponent(repositoryId)}/contents`;
|
|
6
|
+
const segments = path.split("/").filter((segment) => segment.length > 0);
|
|
7
|
+
return segments.length
|
|
8
|
+
? `${base}/${segments.map(encodeURIComponent).join("/")}`
|
|
9
|
+
: base;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Repositories linked to a project. Lookup is on the CP; `contents`,
|
|
13
|
+
* `commits` and `commit` read through the DP.
|
|
14
|
+
*
|
|
15
|
+
* `GET /v1/repositories` answers a bare array rather than the cursor
|
|
16
|
+
* envelope, so {@link RepositoriesApi.list} returns an array.
|
|
17
|
+
*/
|
|
18
|
+
export class RepositoriesApi {
|
|
19
|
+
cpHttp;
|
|
20
|
+
dpHttp;
|
|
21
|
+
contents;
|
|
22
|
+
constructor(cpHttp, dpHttp) {
|
|
23
|
+
this.cpHttp = cpHttp;
|
|
24
|
+
this.dpHttp = dpHttp;
|
|
25
|
+
const get = (repositoryId, path, params = {}) => this.dpHttp.request({
|
|
26
|
+
method: "GET",
|
|
27
|
+
path: contentsPath(repositoryId, path),
|
|
28
|
+
query: { ...params },
|
|
29
|
+
});
|
|
30
|
+
const enumerate = (repositoryId, params = {}) => {
|
|
31
|
+
const path = params.path ?? "";
|
|
32
|
+
return new Paginator({
|
|
33
|
+
fetch: async (cursor) => {
|
|
34
|
+
const content = await get(repositoryId, path, {
|
|
35
|
+
ref: params.ref,
|
|
36
|
+
limit: params.limit,
|
|
37
|
+
cursor,
|
|
38
|
+
});
|
|
39
|
+
if (content.type !== "dir") {
|
|
40
|
+
throw new ValidationError({
|
|
41
|
+
message: `'${content.path}' is a file, not a directory; read it with repositories.contents.get()`,
|
|
42
|
+
status: 422,
|
|
43
|
+
code: "repository_path_is_file",
|
|
44
|
+
body: null,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
return content;
|
|
48
|
+
},
|
|
49
|
+
items: (page) => page.records,
|
|
50
|
+
next: (page) => page.next || undefined,
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
this.contents = Object.assign(enumerate, { get });
|
|
54
|
+
}
|
|
55
|
+
/** `GET /v1/repositories?project=…[&slug=…]` — every repository in one array. */
|
|
56
|
+
list(params) {
|
|
57
|
+
return this.cpHttp.request({
|
|
58
|
+
method: "GET",
|
|
59
|
+
path: "/v1/repositories",
|
|
60
|
+
query: { ...params },
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Stream the commit history from `params.sha` (the default branch when
|
|
65
|
+
* omitted), following the server's cursor across pages. `await` it for
|
|
66
|
+
* the first page.
|
|
67
|
+
*/
|
|
68
|
+
commits(repositoryId, params = {}) {
|
|
69
|
+
return new Paginator({
|
|
70
|
+
fetch: (cursor) => this.dpHttp.request({
|
|
71
|
+
method: "GET",
|
|
72
|
+
path: `/v1/repositories/${encodeURIComponent(repositoryId)}/commits`,
|
|
73
|
+
query: { ...params, cursor },
|
|
74
|
+
}),
|
|
75
|
+
items: (page) => page.records,
|
|
76
|
+
next: (page) => page.next || undefined,
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
/** One commit with the files it changed and its unified diff. */
|
|
80
|
+
commit(repositoryId, sha) {
|
|
81
|
+
return this.dpHttp.request({
|
|
82
|
+
method: "GET",
|
|
83
|
+
path: `/v1/repositories/${encodeURIComponent(repositoryId)}/commits/${encodeURIComponent(sha)}`,
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* `POST /v1/repositories/{id}/merges` — merge `head` into `base`, like
|
|
88
|
+
* GitHub's merges API. Resolves to the merge commit, or `null` when `base`
|
|
89
|
+
* already contains `head`. A conflict throws a `ConflictError`; a `504`
|
|
90
|
+
* means it is still running, and sending the same request again attaches
|
|
91
|
+
* to it.
|
|
92
|
+
*/
|
|
93
|
+
async merge(repositoryId, params) {
|
|
94
|
+
const merge = await this.dpHttp.request({
|
|
95
|
+
method: "POST",
|
|
96
|
+
path: `/v1/repositories/${encodeURIComponent(repositoryId)}/merges`,
|
|
97
|
+
body: params,
|
|
98
|
+
});
|
|
99
|
+
return merge ?? null;
|
|
100
|
+
}
|
|
101
|
+
get(repositoryId, params) {
|
|
102
|
+
return this.cpHttp.request({
|
|
103
|
+
method: "GET",
|
|
104
|
+
path: `/v1/repositories/${encodeURIComponent(repositoryId)}`,
|
|
105
|
+
query: { ...params },
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
export function attachRepositories(cpHttp, dpHttp) {
|
|
110
|
+
return new RepositoriesApi(cpHttp, dpHttp);
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=repositories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repositories.js","sourceRoot":"","sources":["../../src/resources/repositories.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,GAgBhB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,sEAAsE;AACtE,SAAS,YAAY,CAAC,YAAkB,EAAE,IAAY;IACpD,MAAM,IAAI,GAAG,oBAAoB,kBAAkB,CAAC,YAAY,CAAC,WAAW,CAAC;IAC7E,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC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AC,YAAY,kBAAkB,CAAC,GAAG,CAAC,EAAE;SAChG,CAAC,CAAC;IACL,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,KAAK,CACT,YAAkB,EAClB,MAA6B;QAE7B,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAA8B;YACnE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,oBAAoB,kBAAkB,CAAC,YAAY,CAAC,SAAS;YACnE,IAAI,EAAE,MAAM;SACb,CAAC,CAAC;QACH,OAAO,KAAK,IAAI,IAAI,CAAC;IACvB,CAAC;IAED,GAAG,CAAC,YAAkB,EAAE,MAA2B;QACjD,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAa;YACrC,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,oBAAoB,kBAAkB,CAAC,YAAY,CAAC,EAAE;YAC5D,KAAK,EAAE,EAAE,GAAG,MAAM,EAAE;SACrB,CAAC,CAAC;IACL,CAAC;CACF;AAED,MAAM,UAAU,kBAAkB,CAChC,MAAkB,EAClB,MAAkB;IAElB,OAAO,IAAI,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC7C,CAAC"}
|
package/dist/runner.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { type RunnerContext, type RunnerDeployment, type RunnerSpec, type RunRequest, type Uuid } from "@introspection-sdk/types";
|
|
2
2
|
import { ConversationsApi, EventsApi, FilesApi, MetricsApi, SharesApi, TasksApi } from "@introspection-sdk/http";
|
|
3
|
+
import { AutomationsApi } from "./resources/automations.js";
|
|
4
|
+
import { AppConnectionsApi } from "./resources/app-connections.js";
|
|
5
|
+
import type { DataPlaneResources } from "./data-plane.js";
|
|
3
6
|
import type { IntrospectionClient } from "./client.js";
|
|
4
7
|
/**
|
|
5
8
|
* Where this Runner came from, so `refresh()` can call CP again with the
|
|
@@ -8,7 +11,7 @@ import type { IntrospectionClient } from "./client.js";
|
|
|
8
11
|
*/
|
|
9
12
|
export type RunnerSource = {
|
|
10
13
|
kind: "runtime";
|
|
11
|
-
id: Uuid;
|
|
14
|
+
id: Uuid | string;
|
|
12
15
|
options?: RunRequest;
|
|
13
16
|
} | {
|
|
14
17
|
kind: "experiment";
|
|
@@ -18,9 +21,13 @@ export type RunnerSource = {
|
|
|
18
21
|
/**
|
|
19
22
|
* Live handle to a Data Plane sandbox. Holds the bearer JWT, the DP
|
|
20
23
|
* endpoint URL, and the runtime/experiment context, and exposes the
|
|
21
|
-
* runner-bound
|
|
22
|
-
* `
|
|
23
|
-
*
|
|
24
|
+
* runner-bound Data Plane namespaces ({@link DataPlaneResources}: `tasks`,
|
|
25
|
+
* `files`, `conversations`, `events`, `metrics`, `shares`, `automations`
|
|
26
|
+
* and `connections`), which send the runner's bearer and use its
|
|
27
|
+
* runtime context.
|
|
28
|
+
*
|
|
29
|
+
* A runner a member opens for themself carries `automations:read` and
|
|
30
|
+
* `automations:write`, so `runner.automations` acts as that member.
|
|
24
31
|
*
|
|
25
32
|
* In v1 of the agent-session-based design, token refresh is handled
|
|
26
33
|
* server-side by the DP materializer attached to the agent session — the
|
|
@@ -28,7 +35,7 @@ export type RunnerSource = {
|
|
|
28
35
|
* `refresh()` method is kept as a manual escape hatch that re-calls the
|
|
29
36
|
* CP `/run` route to mint a brand-new spec.
|
|
30
37
|
*/
|
|
31
|
-
export declare class Runner {
|
|
38
|
+
export declare class Runner implements DataPlaneResources {
|
|
32
39
|
private readonly client;
|
|
33
40
|
private readonly source;
|
|
34
41
|
private spec;
|
|
@@ -40,6 +47,13 @@ export declare class Runner {
|
|
|
40
47
|
readonly events: EventsApi;
|
|
41
48
|
readonly metrics: MetricsApi;
|
|
42
49
|
readonly shares: SharesApi;
|
|
50
|
+
/** CRUD on `/v1/automations` plus `trigger(id)`, on the runner's token. */
|
|
51
|
+
readonly automations: AutomationsApi;
|
|
52
|
+
/**
|
|
53
|
+
* CRUD on `/v1/connections`. `create` defaults `runtime` to this runner's
|
|
54
|
+
* runtime group.
|
|
55
|
+
*/
|
|
56
|
+
readonly connections: AppConnectionsApi;
|
|
43
57
|
constructor(client: IntrospectionClient, source: RunnerSource, spec: RunnerSpec);
|
|
44
58
|
/** DP REST base URL the runner is bound to. */
|
|
45
59
|
get dpEndpoint(): string;
|
package/dist/runner.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../src/runner.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,IAAI,EACV,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,gBAAgB,EAChB,SAAS,EACT,QAAQ,EACR,UAAU,EACV,SAAS,EACT,QAAQ,EACT,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEvD;;;;GAIG;AACH,MAAM,MAAM,YAAY,GACpB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,EAAE,EAAE,IAAI,CAAC;IAAC,OAAO,CAAC,EAAE,UAAU,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../src/runner.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,IAAI,EACV,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,gBAAgB,EAChB,SAAS,EACT,QAAQ,EACR,UAAU,EACV,SAAS,EACT,QAAQ,EACT,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAA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