@dork-labs/cloud-api 0.75.1
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/LICENSE +21 -0
- package/README.md +192 -0
- package/dist/billing.d.ts +328 -0
- package/dist/billing.d.ts.map +1 -0
- package/dist/billing.js +267 -0
- package/dist/billing.js.map +1 -0
- package/dist/client.d.ts +130 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +192 -0
- package/dist/client.js.map +1 -0
- package/dist/connections.d.ts +281 -0
- package/dist/connections.d.ts.map +1 -0
- package/dist/connections.js +241 -0
- package/dist/connections.js.map +1 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +31 -0
- package/dist/index.js.map +1 -0
- package/dist/inference.d.ts +123 -0
- package/dist/inference.d.ts.map +1 -0
- package/dist/inference.js +114 -0
- package/dist/inference.js.map +1 -0
- package/dist/instances.d.ts +60 -0
- package/dist/instances.d.ts.map +1 -0
- package/dist/instances.js +65 -0
- package/dist/instances.js.map +1 -0
- package/dist/primitives.d.ts +74 -0
- package/dist/primitives.d.ts.map +1 -0
- package/dist/primitives.js +98 -0
- package/dist/primitives.js.map +1 -0
- package/dist/problem.d.ts +96 -0
- package/dist/problem.d.ts.map +1 -0
- package/dist/problem.js +94 -0
- package/dist/problem.js.map +1 -0
- package/dist/remote.d.ts +268 -0
- package/dist/remote.d.ts.map +1 -0
- package/dist/remote.js +267 -0
- package/dist/remote.js.map +1 -0
- package/dist/routes.d.ts +273 -0
- package/dist/routes.d.ts.map +1 -0
- package/dist/routes.js +302 -0
- package/dist/routes.js.map +1 -0
- package/dist/seats.d.ts +529 -0
- package/dist/seats.d.ts.map +1 -0
- package/dist/seats.js +266 -0
- package/dist/seats.js.map +1 -0
- package/dist/session.d.ts +135 -0
- package/dist/session.d.ts.map +1 -0
- package/dist/session.js +143 -0
- package/dist/session.js.map +1 -0
- package/fixtures/v1/billing/balance-owed.json +16 -0
- package/fixtures/v1/billing/balance.json +16 -0
- package/fixtures/v1/billing/entitlements-free.json +34 -0
- package/fixtures/v1/billing/hosted-page.json +3 -0
- package/fixtures/v1/billing/nudge.json +9 -0
- package/fixtures/v1/billing/price-list.json +13 -0
- package/fixtures/v1/billing/statement.json +5 -0
- package/fixtures/v1/billing/usage-by-model.json +21 -0
- package/fixtures/v1/connections/catalog.json +12 -0
- package/fixtures/v1/connections/events-ack.json +3 -0
- package/fixtures/v1/connections/events-pull.json +16 -0
- package/fixtures/v1/connections/execution.json +12 -0
- package/fixtures/v1/connections/list.json +16 -0
- package/fixtures/v1/connections/usage.json +16 -0
- package/fixtures/v1/index.json +58 -0
- package/fixtures/v1/inference/models.json +17 -0
- package/fixtures/v1/inference/token-revoke.json +3 -0
- package/fixtures/v1/inference/token.json +14 -0
- package/fixtures/v1/instances/heartbeat.json +5 -0
- package/fixtures/v1/instances/list.json +15 -0
- package/fixtures/v1/instances/revoke.json +3 -0
- package/fixtures/v1/problem/handle-tombstoned.json +6 -0
- package/fixtures/v1/problem/person-seat-required.json +7 -0
- package/fixtures/v1/problem/unauthenticated.json +7 -0
- package/fixtures/v1/remote/address.json +5 -0
- package/fixtures/v1/remote/command-keepalive.json +4 -0
- package/fixtures/v1/remote/command-open.json +6 -0
- package/fixtures/v1/remote/commands-ack.json +3 -0
- package/fixtures/v1/remote/credential.json +7 -0
- package/fixtures/v1/remote/custom-address.json +12 -0
- package/fixtures/v1/remote/designation.json +5 -0
- package/fixtures/v1/remote/enrolment.json +5 -0
- package/fixtures/v1/remote/events.json +3 -0
- package/fixtures/v1/remote/open.json +5 -0
- package/fixtures/v1/remote/status-closed.json +7 -0
- package/fixtures/v1/remote/status-open.json +10 -0
- package/fixtures/v1/remote/wake-token.json +5 -0
- package/fixtures/v1/seats/addons.json +11 -0
- package/fixtures/v1/seats/agent.json +9 -0
- package/fixtures/v1/seats/grants.json +20 -0
- package/fixtures/v1/seats/inbox-browse.json +17 -0
- package/fixtures/v1/seats/inbox-pull.json +17 -0
- package/fixtures/v1/seats/invitation.json +9 -0
- package/fixtures/v1/seats/members.json +12 -0
- package/fixtures/v1/seats/org.json +7 -0
- package/fixtures/v1/seats/presence.json +6 -0
- package/fixtures/v1/seats/seat.json +21 -0
- package/fixtures/v1/session/account-export.json +6 -0
- package/fixtures/v1/session/device-code.json +8 -0
- package/fixtures/v1/session/device-token-pending.json +4 -0
- package/fixtures/v1/session/device-token.json +7 -0
- package/fixtures/v1/session/signed-in.json +14 -0
- package/fixtures/v1/session/signed-out.json +4 -0
- package/package.json +58 -0
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* How a toolkit is authenticated.
|
|
4
|
+
*
|
|
5
|
+
* Mechanism: it tells a client which flow to run, and names no vendor.
|
|
6
|
+
*/
|
|
7
|
+
export declare const AuthenticationKindSchema: z.ZodEnum<{
|
|
8
|
+
none: "none";
|
|
9
|
+
oauth2: "oauth2";
|
|
10
|
+
api_key: "api_key";
|
|
11
|
+
basic: "basic";
|
|
12
|
+
bearer: "bearer";
|
|
13
|
+
}>;
|
|
14
|
+
/** The lifecycle of one managed connection. */
|
|
15
|
+
export declare const ConnectionStatusSchema: z.ZodEnum<{
|
|
16
|
+
active: "active";
|
|
17
|
+
pending: "pending";
|
|
18
|
+
degraded: "degraded";
|
|
19
|
+
expired: "expired";
|
|
20
|
+
revoked: "revoked";
|
|
21
|
+
}>;
|
|
22
|
+
/** One toolkit the catalog offers. */
|
|
23
|
+
export declare const ToolkitSummarySchema: z.ZodObject<{
|
|
24
|
+
toolkit: z.ZodString;
|
|
25
|
+
displayName: z.ZodString;
|
|
26
|
+
description: z.ZodOptional<z.ZodString>;
|
|
27
|
+
iconUrl: z.ZodOptional<z.ZodString>;
|
|
28
|
+
authentication: z.ZodEnum<{
|
|
29
|
+
none: "none";
|
|
30
|
+
oauth2: "oauth2";
|
|
31
|
+
api_key: "api_key";
|
|
32
|
+
basic: "basic";
|
|
33
|
+
bearer: "bearer";
|
|
34
|
+
}>;
|
|
35
|
+
version: z.ZodString;
|
|
36
|
+
}, z.core.$strip>;
|
|
37
|
+
/** One toolkit the managed-connection catalog offers. */
|
|
38
|
+
export type ToolkitSummary = z.infer<typeof ToolkitSummarySchema>;
|
|
39
|
+
/** `GET /v1/connections/catalog` — every toolkit on offer. */
|
|
40
|
+
export declare const ConnectionCatalogResponseSchema: z.ZodObject<{
|
|
41
|
+
items: z.ZodArray<z.ZodObject<{
|
|
42
|
+
toolkit: z.ZodString;
|
|
43
|
+
displayName: z.ZodString;
|
|
44
|
+
description: z.ZodOptional<z.ZodString>;
|
|
45
|
+
iconUrl: z.ZodOptional<z.ZodString>;
|
|
46
|
+
authentication: z.ZodEnum<{
|
|
47
|
+
none: "none";
|
|
48
|
+
oauth2: "oauth2";
|
|
49
|
+
api_key: "api_key";
|
|
50
|
+
basic: "basic";
|
|
51
|
+
bearer: "bearer";
|
|
52
|
+
}>;
|
|
53
|
+
version: z.ZodString;
|
|
54
|
+
}, z.core.$strip>>;
|
|
55
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
56
|
+
}, z.core.$strip>;
|
|
57
|
+
/** `GET /v1/connections/toolkits/{toolkit}/version`. */
|
|
58
|
+
export declare const ToolkitVersionResponseSchema: z.ZodObject<{
|
|
59
|
+
toolkit: z.ZodString;
|
|
60
|
+
version: z.ZodString;
|
|
61
|
+
updatedAt: z.ZodISODateTime;
|
|
62
|
+
}, z.core.$strip>;
|
|
63
|
+
/** One callable operation a toolkit exposes. */
|
|
64
|
+
export declare const ToolkitOperationSchema: z.ZodObject<{
|
|
65
|
+
slug: z.ZodString;
|
|
66
|
+
displayName: z.ZodString;
|
|
67
|
+
description: z.ZodOptional<z.ZodString>;
|
|
68
|
+
inputSchema: z.ZodUnknown;
|
|
69
|
+
outputSchema: z.ZodOptional<z.ZodUnknown>;
|
|
70
|
+
}, z.core.$strip>;
|
|
71
|
+
/** `GET /v1/connections/toolkits/{toolkit}/operations`. */
|
|
72
|
+
export declare const ToolkitOperationsResponseSchema: z.ZodObject<{
|
|
73
|
+
items: z.ZodArray<z.ZodObject<{
|
|
74
|
+
slug: z.ZodString;
|
|
75
|
+
displayName: z.ZodString;
|
|
76
|
+
description: z.ZodOptional<z.ZodString>;
|
|
77
|
+
inputSchema: z.ZodUnknown;
|
|
78
|
+
outputSchema: z.ZodOptional<z.ZodUnknown>;
|
|
79
|
+
}, z.core.$strip>>;
|
|
80
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
81
|
+
}, z.core.$strip>;
|
|
82
|
+
/** One event a toolkit can deliver. */
|
|
83
|
+
export declare const ToolkitEventSchema: z.ZodObject<{
|
|
84
|
+
slug: z.ZodString;
|
|
85
|
+
displayName: z.ZodString;
|
|
86
|
+
description: z.ZodOptional<z.ZodString>;
|
|
87
|
+
payloadSchema: z.ZodOptional<z.ZodUnknown>;
|
|
88
|
+
}, z.core.$strip>;
|
|
89
|
+
/** `GET /v1/connections/toolkits/{toolkit}/events`. */
|
|
90
|
+
export declare const ToolkitEventsResponseSchema: z.ZodObject<{
|
|
91
|
+
items: z.ZodArray<z.ZodObject<{
|
|
92
|
+
slug: z.ZodString;
|
|
93
|
+
displayName: z.ZodString;
|
|
94
|
+
description: z.ZodOptional<z.ZodString>;
|
|
95
|
+
payloadSchema: z.ZodOptional<z.ZodUnknown>;
|
|
96
|
+
}, z.core.$strip>>;
|
|
97
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
98
|
+
}, z.core.$strip>;
|
|
99
|
+
/** One managed connection belonging to the caller. */
|
|
100
|
+
export declare const ConnectionSchema: z.ZodObject<{
|
|
101
|
+
id: z.ZodString;
|
|
102
|
+
toolkit: z.ZodString;
|
|
103
|
+
displayName: z.ZodString;
|
|
104
|
+
status: z.ZodEnum<{
|
|
105
|
+
active: "active";
|
|
106
|
+
pending: "pending";
|
|
107
|
+
degraded: "degraded";
|
|
108
|
+
expired: "expired";
|
|
109
|
+
revoked: "revoked";
|
|
110
|
+
}>;
|
|
111
|
+
orgId: z.ZodNullable<z.ZodString>;
|
|
112
|
+
seatId: z.ZodNullable<z.ZodString>;
|
|
113
|
+
createdAt: z.ZodISODateTime;
|
|
114
|
+
expiresAt: z.ZodNullable<z.ZodISODateTime>;
|
|
115
|
+
lastUsedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
116
|
+
}, z.core.$strip>;
|
|
117
|
+
/** One managed connection belonging to the caller. */
|
|
118
|
+
export type Connection = z.infer<typeof ConnectionSchema>;
|
|
119
|
+
/** `GET /v1/connections`. */
|
|
120
|
+
export declare const ConnectionListResponseSchema: z.ZodObject<{
|
|
121
|
+
items: z.ZodArray<z.ZodObject<{
|
|
122
|
+
id: z.ZodString;
|
|
123
|
+
toolkit: z.ZodString;
|
|
124
|
+
displayName: z.ZodString;
|
|
125
|
+
status: z.ZodEnum<{
|
|
126
|
+
active: "active";
|
|
127
|
+
pending: "pending";
|
|
128
|
+
degraded: "degraded";
|
|
129
|
+
expired: "expired";
|
|
130
|
+
revoked: "revoked";
|
|
131
|
+
}>;
|
|
132
|
+
orgId: z.ZodNullable<z.ZodString>;
|
|
133
|
+
seatId: z.ZodNullable<z.ZodString>;
|
|
134
|
+
createdAt: z.ZodISODateTime;
|
|
135
|
+
expiresAt: z.ZodNullable<z.ZodISODateTime>;
|
|
136
|
+
lastUsedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
137
|
+
}, z.core.$strip>>;
|
|
138
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
139
|
+
}, z.core.$strip>;
|
|
140
|
+
/** `POST /v1/connections/authentication-flows` — begin connecting a toolkit. */
|
|
141
|
+
export declare const AuthenticationFlowRequestSchema: z.ZodObject<{
|
|
142
|
+
toolkit: z.ZodString;
|
|
143
|
+
seatId: z.ZodOptional<z.ZodString>;
|
|
144
|
+
redirectUrl: z.ZodOptional<z.ZodString>;
|
|
145
|
+
}, z.core.$strip>;
|
|
146
|
+
/** An authentication flow in progress. */
|
|
147
|
+
export declare const AuthenticationFlowSchema: z.ZodObject<{
|
|
148
|
+
flowId: z.ZodString;
|
|
149
|
+
toolkit: z.ZodString;
|
|
150
|
+
status: z.ZodEnum<{
|
|
151
|
+
pending: "pending";
|
|
152
|
+
expired: "expired";
|
|
153
|
+
awaiting_user: "awaiting_user";
|
|
154
|
+
succeeded: "succeeded";
|
|
155
|
+
failed: "failed";
|
|
156
|
+
}>;
|
|
157
|
+
redirectUrl: z.ZodNullable<z.ZodString>;
|
|
158
|
+
connectionId: z.ZodNullable<z.ZodString>;
|
|
159
|
+
createdAt: z.ZodISODateTime;
|
|
160
|
+
expiresAt: z.ZodISODateTime;
|
|
161
|
+
}, z.core.$strip>;
|
|
162
|
+
/** An authentication flow in progress, or its outcome. */
|
|
163
|
+
export type AuthenticationFlow = z.infer<typeof AuthenticationFlowSchema>;
|
|
164
|
+
/**
|
|
165
|
+
* `POST /v1/connections/authority-commands` — an operation on a connection
|
|
166
|
+
* that only the issuing authority can perform.
|
|
167
|
+
*/
|
|
168
|
+
export declare const AuthorityCommandRequestSchema: z.ZodObject<{
|
|
169
|
+
connectionId: z.ZodString;
|
|
170
|
+
command: z.ZodEnum<{
|
|
171
|
+
refresh: "refresh";
|
|
172
|
+
reauthorize: "reauthorize";
|
|
173
|
+
disable: "disable";
|
|
174
|
+
enable: "enable";
|
|
175
|
+
delete: "delete";
|
|
176
|
+
}>;
|
|
177
|
+
idempotencyKey: z.ZodString;
|
|
178
|
+
}, z.core.$strip>;
|
|
179
|
+
/** The state of an authority command. */
|
|
180
|
+
export declare const AuthorityCommandSchema: z.ZodObject<{
|
|
181
|
+
commandId: z.ZodString;
|
|
182
|
+
connectionId: z.ZodString;
|
|
183
|
+
status: z.ZodEnum<{
|
|
184
|
+
succeeded: "succeeded";
|
|
185
|
+
failed: "failed";
|
|
186
|
+
queued: "queued";
|
|
187
|
+
running: "running";
|
|
188
|
+
}>;
|
|
189
|
+
createdAt: z.ZodISODateTime;
|
|
190
|
+
completedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
191
|
+
}, z.core.$strip>;
|
|
192
|
+
/** `POST /v1/connections/executions` — run one toolkit operation. */
|
|
193
|
+
export declare const ExecutionRequestSchema: z.ZodObject<{
|
|
194
|
+
connectionId: z.ZodString;
|
|
195
|
+
operation: z.ZodString;
|
|
196
|
+
input: z.ZodUnknown;
|
|
197
|
+
idempotencyKey: z.ZodString;
|
|
198
|
+
}, z.core.$strip>;
|
|
199
|
+
/** One attempt at a toolkit operation. */
|
|
200
|
+
export declare const ExecutionSchema: z.ZodObject<{
|
|
201
|
+
attemptId: z.ZodString;
|
|
202
|
+
connectionId: z.ZodString;
|
|
203
|
+
operation: z.ZodString;
|
|
204
|
+
status: z.ZodEnum<{
|
|
205
|
+
succeeded: "succeeded";
|
|
206
|
+
failed: "failed";
|
|
207
|
+
queued: "queued";
|
|
208
|
+
running: "running";
|
|
209
|
+
canceled: "canceled";
|
|
210
|
+
}>;
|
|
211
|
+
startedAt: z.ZodISODateTime;
|
|
212
|
+
completedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
213
|
+
output: z.ZodOptional<z.ZodUnknown>;
|
|
214
|
+
failure: z.ZodNullable<z.ZodObject<{
|
|
215
|
+
reason: z.ZodString;
|
|
216
|
+
retriable: z.ZodBoolean;
|
|
217
|
+
}, z.core.$strip>>;
|
|
218
|
+
}, z.core.$strip>;
|
|
219
|
+
/** One attempt at a toolkit operation. */
|
|
220
|
+
export type Execution = z.infer<typeof ExecutionSchema>;
|
|
221
|
+
/**
|
|
222
|
+
* `POST /v1/connections/events/pull` — lease a batch of pending events.
|
|
223
|
+
*
|
|
224
|
+
* Lease-based and deliberately cursor-free: a pull hands out work, and only an
|
|
225
|
+
* exact lease receipt acknowledges it. The seat inbox is this route's sibling
|
|
226
|
+
* rather than a second design.
|
|
227
|
+
*/
|
|
228
|
+
export declare const ConnectionEventPullRequestSchema: z.ZodObject<{
|
|
229
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
230
|
+
}, z.core.$strip>;
|
|
231
|
+
/** One leased connector event. */
|
|
232
|
+
export declare const ConnectionEventSchema: z.ZodObject<{
|
|
233
|
+
id: z.ZodString;
|
|
234
|
+
leaseToken: z.ZodString;
|
|
235
|
+
connectionId: z.ZodString;
|
|
236
|
+
toolkit: z.ZodString;
|
|
237
|
+
event: z.ZodString;
|
|
238
|
+
receivedAt: z.ZodISODateTime;
|
|
239
|
+
expiresAt: z.ZodISODateTime;
|
|
240
|
+
payload: z.ZodUnknown;
|
|
241
|
+
}, z.core.$strip>;
|
|
242
|
+
/** A leased batch of connector events. */
|
|
243
|
+
export declare const ConnectionEventPullResponseSchema: z.ZodObject<{
|
|
244
|
+
items: z.ZodArray<z.ZodObject<{
|
|
245
|
+
id: z.ZodString;
|
|
246
|
+
leaseToken: z.ZodString;
|
|
247
|
+
connectionId: z.ZodString;
|
|
248
|
+
toolkit: z.ZodString;
|
|
249
|
+
event: z.ZodString;
|
|
250
|
+
receivedAt: z.ZodISODateTime;
|
|
251
|
+
expiresAt: z.ZodISODateTime;
|
|
252
|
+
payload: z.ZodUnknown;
|
|
253
|
+
}, z.core.$strip>>;
|
|
254
|
+
}, z.core.$strip>;
|
|
255
|
+
/** `POST /v1/connections/events/ack` — settle leases. */
|
|
256
|
+
export declare const ConnectionEventAckRequestSchema: z.ZodObject<{
|
|
257
|
+
items: z.ZodArray<z.ZodObject<{
|
|
258
|
+
id: z.ZodString;
|
|
259
|
+
leaseToken: z.ZodString;
|
|
260
|
+
}, z.core.$strip>>;
|
|
261
|
+
}, z.core.$strip>;
|
|
262
|
+
/** How many leases were settled. */
|
|
263
|
+
export declare const ConnectionEventAckResponseSchema: z.ZodObject<{
|
|
264
|
+
acknowledged: z.ZodNumber;
|
|
265
|
+
}, z.core.$strip>;
|
|
266
|
+
/** `GET /v1/connections/usage` and `GET /v1/connections/{id}/usage`. */
|
|
267
|
+
export declare const ConnectionUsageResponseSchema: z.ZodObject<{
|
|
268
|
+
periodStart: z.ZodISODateTime;
|
|
269
|
+
periodEnd: z.ZodISODateTime;
|
|
270
|
+
rows: z.ZodArray<z.ZodObject<{
|
|
271
|
+
connectionId: z.ZodString;
|
|
272
|
+
toolkit: z.ZodString;
|
|
273
|
+
actions: z.ZodNumber;
|
|
274
|
+
events: z.ZodNumber;
|
|
275
|
+
}, z.core.$strip>>;
|
|
276
|
+
totals: z.ZodObject<{
|
|
277
|
+
actions: z.ZodNumber;
|
|
278
|
+
events: z.ZodNumber;
|
|
279
|
+
}, z.core.$strip>;
|
|
280
|
+
}, z.core.$strip>;
|
|
281
|
+
//# sourceMappingURL=connections.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connections.d.ts","sourceRoot":"","sources":["../src/connections.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;;GAIG;AACH,eAAO,MAAM,wBAAwB;;;;;;EAEwD,CAAC;AAE9F,+CAA+C;AAC/C,eAAO,MAAM,sBAAsB;;;;;;EAEwB,CAAC;AAE5D,sCAAsC;AACtC,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;iBASgC,CAAC;AAElE,yDAAyD;AACzD,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,8DAA8D;AAC9D,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;iBAG3C,CAAC;AAEF,wDAAwD;AACxD,eAAO,MAAM,4BAA4B;;;;iBAMiB,CAAC;AAE3D,gDAAgD;AAChD,eAAO,MAAM,sBAAsB;;;;;;iBAaqB,CAAC;AAEzD,2DAA2D;AAC3D,eAAO,MAAM,+BAA+B;;;;;;;;;iBAG3C,CAAC;AAEF,uCAAuC;AACvC,eAAO,MAAM,kBAAkB;;;;;iBAUgB,CAAC;AAEhD,uDAAuD;AACvD,eAAO,MAAM,2BAA2B;;;;;;;;iBAGvC,CAAC;AAEF,sDAAsD;AACtD,eA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 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { IdSchema, TimestampSchema, pageOf } from './primitives.js';
|
|
3
|
+
/**
|
|
4
|
+
* How a toolkit is authenticated.
|
|
5
|
+
*
|
|
6
|
+
* Mechanism: it tells a client which flow to run, and names no vendor.
|
|
7
|
+
*/
|
|
8
|
+
export const AuthenticationKindSchema = z
|
|
9
|
+
.enum(['oauth2', 'api_key', 'basic', 'bearer', 'none'])
|
|
10
|
+
.describe('Which authentication flow a toolkit needs. Mechanism only; no vendor is named.');
|
|
11
|
+
/** The lifecycle of one managed connection. */
|
|
12
|
+
export const ConnectionStatusSchema = z
|
|
13
|
+
.enum(['pending', 'active', 'degraded', 'expired', 'revoked'])
|
|
14
|
+
.describe('The lifecycle state of a managed connection.');
|
|
15
|
+
/** One toolkit the catalog offers. */
|
|
16
|
+
export const ToolkitSummarySchema = z
|
|
17
|
+
.object({
|
|
18
|
+
toolkit: z.string().describe('The opaque toolkit identifier.'),
|
|
19
|
+
displayName: z.string(),
|
|
20
|
+
description: z.string().optional(),
|
|
21
|
+
iconUrl: z.string().url().optional(),
|
|
22
|
+
authentication: AuthenticationKindSchema,
|
|
23
|
+
version: z.string().describe('The catalog version of this toolkit, as an opaque string.'),
|
|
24
|
+
})
|
|
25
|
+
.describe('One toolkit the managed-connection catalog offers.');
|
|
26
|
+
/** `GET /v1/connections/catalog` — every toolkit on offer. */
|
|
27
|
+
export const ConnectionCatalogResponseSchema = pageOf(ToolkitSummarySchema, 'A page of the toolkits the managed-connection catalog offers.');
|
|
28
|
+
/** `GET /v1/connections/toolkits/{toolkit}/version`. */
|
|
29
|
+
export const ToolkitVersionResponseSchema = z
|
|
30
|
+
.object({
|
|
31
|
+
toolkit: z.string(),
|
|
32
|
+
version: z.string().describe('An opaque version string. Compare for equality; never parse it.'),
|
|
33
|
+
updatedAt: TimestampSchema,
|
|
34
|
+
})
|
|
35
|
+
.describe('The current catalog version of one toolkit.');
|
|
36
|
+
/** One callable operation a toolkit exposes. */
|
|
37
|
+
export const ToolkitOperationSchema = z
|
|
38
|
+
.object({
|
|
39
|
+
slug: z.string().describe('The opaque operation identifier.'),
|
|
40
|
+
displayName: z.string(),
|
|
41
|
+
description: z.string().optional(),
|
|
42
|
+
inputSchema: z
|
|
43
|
+
.unknown()
|
|
44
|
+
.describe('A JSON Schema for the operation`s input, as published by the toolkit.'),
|
|
45
|
+
outputSchema: z
|
|
46
|
+
.unknown()
|
|
47
|
+
.optional()
|
|
48
|
+
.describe('A JSON Schema for the operation`s output, where one is published.'),
|
|
49
|
+
})
|
|
50
|
+
.describe('One callable operation a toolkit exposes.');
|
|
51
|
+
/** `GET /v1/connections/toolkits/{toolkit}/operations`. */
|
|
52
|
+
export const ToolkitOperationsResponseSchema = pageOf(ToolkitOperationSchema, 'A page of the operations one toolkit exposes.');
|
|
53
|
+
/** One event a toolkit can deliver. */
|
|
54
|
+
export const ToolkitEventSchema = z
|
|
55
|
+
.object({
|
|
56
|
+
slug: z.string().describe('The opaque event identifier.'),
|
|
57
|
+
displayName: z.string(),
|
|
58
|
+
description: z.string().optional(),
|
|
59
|
+
payloadSchema: z
|
|
60
|
+
.unknown()
|
|
61
|
+
.optional()
|
|
62
|
+
.describe('A JSON Schema for the event payload, where one is published.'),
|
|
63
|
+
})
|
|
64
|
+
.describe('One event a toolkit can deliver.');
|
|
65
|
+
/** `GET /v1/connections/toolkits/{toolkit}/events`. */
|
|
66
|
+
export const ToolkitEventsResponseSchema = pageOf(ToolkitEventSchema, 'A page of the events one toolkit can deliver.');
|
|
67
|
+
/** One managed connection belonging to the caller. */
|
|
68
|
+
export const ConnectionSchema = z
|
|
69
|
+
.object({
|
|
70
|
+
id: IdSchema,
|
|
71
|
+
toolkit: z.string(),
|
|
72
|
+
displayName: z.string(),
|
|
73
|
+
status: ConnectionStatusSchema,
|
|
74
|
+
orgId: IdSchema.nullable(),
|
|
75
|
+
seatId: IdSchema.nullable(),
|
|
76
|
+
createdAt: TimestampSchema,
|
|
77
|
+
expiresAt: TimestampSchema.nullable(),
|
|
78
|
+
lastUsedAt: TimestampSchema.nullable(),
|
|
79
|
+
})
|
|
80
|
+
.describe('One managed connection belonging to the caller.');
|
|
81
|
+
/** `GET /v1/connections`. */
|
|
82
|
+
export const ConnectionListResponseSchema = pageOf(ConnectionSchema, 'A page of the caller`s managed connections.');
|
|
83
|
+
/** `POST /v1/connections/authentication-flows` — begin connecting a toolkit. */
|
|
84
|
+
export const AuthenticationFlowRequestSchema = z
|
|
85
|
+
.object({
|
|
86
|
+
toolkit: z.string(),
|
|
87
|
+
seatId: IdSchema.optional().describe('The seat the resulting connection belongs to.'),
|
|
88
|
+
redirectUrl: z
|
|
89
|
+
.string()
|
|
90
|
+
.url()
|
|
91
|
+
.optional()
|
|
92
|
+
.describe('Where to send the person after the hosted flow completes.'),
|
|
93
|
+
})
|
|
94
|
+
.describe('Begin connecting a toolkit. The hosted page is a runtime value; no origin is baked into this package.');
|
|
95
|
+
/** An authentication flow in progress. */
|
|
96
|
+
export const AuthenticationFlowSchema = z
|
|
97
|
+
.object({
|
|
98
|
+
flowId: IdSchema,
|
|
99
|
+
toolkit: z.string(),
|
|
100
|
+
status: z
|
|
101
|
+
.enum(['pending', 'awaiting_user', 'succeeded', 'failed', 'expired'])
|
|
102
|
+
.describe('How far the flow has got.'),
|
|
103
|
+
redirectUrl: z
|
|
104
|
+
.string()
|
|
105
|
+
.url()
|
|
106
|
+
.nullable()
|
|
107
|
+
.describe('The hosted page to send the person to, or null when no redirect is needed.'),
|
|
108
|
+
connectionId: IdSchema.nullable().describe('The connection this flow produced, once it succeeded.'),
|
|
109
|
+
createdAt: TimestampSchema,
|
|
110
|
+
expiresAt: TimestampSchema,
|
|
111
|
+
})
|
|
112
|
+
.describe('An authentication flow in progress, or its outcome.');
|
|
113
|
+
/**
|
|
114
|
+
* `POST /v1/connections/authority-commands` — an operation on a connection
|
|
115
|
+
* that only the issuing authority can perform.
|
|
116
|
+
*/
|
|
117
|
+
export const AuthorityCommandRequestSchema = z
|
|
118
|
+
.object({
|
|
119
|
+
connectionId: IdSchema,
|
|
120
|
+
command: z
|
|
121
|
+
.enum(['refresh', 'reauthorize', 'disable', 'enable', 'delete'])
|
|
122
|
+
.describe('What to do to the connection. Mechanism only.'),
|
|
123
|
+
idempotencyKey: z
|
|
124
|
+
.string()
|
|
125
|
+
.min(1)
|
|
126
|
+
.describe('A client-chosen key. Repeating a command with the same key repeats its result, not its effect.'),
|
|
127
|
+
})
|
|
128
|
+
.describe('An operation on a connection that only the issuing authority can perform.');
|
|
129
|
+
/** The state of an authority command. */
|
|
130
|
+
export const AuthorityCommandSchema = z
|
|
131
|
+
.object({
|
|
132
|
+
commandId: IdSchema,
|
|
133
|
+
connectionId: IdSchema,
|
|
134
|
+
status: z.enum(['queued', 'running', 'succeeded', 'failed']),
|
|
135
|
+
createdAt: TimestampSchema,
|
|
136
|
+
completedAt: TimestampSchema.nullable(),
|
|
137
|
+
})
|
|
138
|
+
.describe('The state of an authority command.');
|
|
139
|
+
/** `POST /v1/connections/executions` — run one toolkit operation. */
|
|
140
|
+
export const ExecutionRequestSchema = z
|
|
141
|
+
.object({
|
|
142
|
+
connectionId: IdSchema,
|
|
143
|
+
operation: z.string().describe('The opaque operation slug to run.'),
|
|
144
|
+
input: z
|
|
145
|
+
.unknown()
|
|
146
|
+
.describe('The operation input, matching the operation`s published input schema.'),
|
|
147
|
+
idempotencyKey: z.string().min(1),
|
|
148
|
+
})
|
|
149
|
+
.describe('Run one toolkit operation through a managed connection.');
|
|
150
|
+
/** One attempt at a toolkit operation. */
|
|
151
|
+
export const ExecutionSchema = z
|
|
152
|
+
.object({
|
|
153
|
+
attemptId: IdSchema,
|
|
154
|
+
connectionId: IdSchema,
|
|
155
|
+
operation: z.string(),
|
|
156
|
+
status: z.enum(['queued', 'running', 'succeeded', 'failed', 'canceled']),
|
|
157
|
+
startedAt: TimestampSchema,
|
|
158
|
+
completedAt: TimestampSchema.nullable(),
|
|
159
|
+
output: z
|
|
160
|
+
.unknown()
|
|
161
|
+
.optional()
|
|
162
|
+
.describe('The operation output, present once the attempt succeeded.'),
|
|
163
|
+
failure: z
|
|
164
|
+
.object({ reason: z.string(), retriable: z.boolean() })
|
|
165
|
+
.nullable()
|
|
166
|
+
.describe('Why the attempt failed, and whether repeating it could succeed.'),
|
|
167
|
+
})
|
|
168
|
+
.describe('One attempt at a toolkit operation.');
|
|
169
|
+
/**
|
|
170
|
+
* `POST /v1/connections/events/pull` — lease a batch of pending events.
|
|
171
|
+
*
|
|
172
|
+
* Lease-based and deliberately cursor-free: a pull hands out work, and only an
|
|
173
|
+
* exact lease receipt acknowledges it. The seat inbox is this route's sibling
|
|
174
|
+
* rather than a second design.
|
|
175
|
+
*/
|
|
176
|
+
export const ConnectionEventPullRequestSchema = z
|
|
177
|
+
.object({
|
|
178
|
+
limit: z
|
|
179
|
+
.number()
|
|
180
|
+
.int()
|
|
181
|
+
.min(1)
|
|
182
|
+
.max(100)
|
|
183
|
+
.optional()
|
|
184
|
+
.describe('How many events to lease. Defaults to 50, capped at 100.'),
|
|
185
|
+
})
|
|
186
|
+
.describe('Lease a batch of pending connector events. Cursor-free by design.');
|
|
187
|
+
/** One leased connector event. */
|
|
188
|
+
export const ConnectionEventSchema = z
|
|
189
|
+
.object({
|
|
190
|
+
id: IdSchema,
|
|
191
|
+
leaseToken: z
|
|
192
|
+
.string()
|
|
193
|
+
.min(1)
|
|
194
|
+
.describe('The receipt that acknowledges exactly this delivery of exactly this event.'),
|
|
195
|
+
connectionId: IdSchema,
|
|
196
|
+
toolkit: z.string(),
|
|
197
|
+
event: z.string().describe('The opaque event slug.'),
|
|
198
|
+
receivedAt: TimestampSchema,
|
|
199
|
+
expiresAt: TimestampSchema.describe('When the lease lapses and the event becomes pullable again.'),
|
|
200
|
+
payload: z.unknown(),
|
|
201
|
+
})
|
|
202
|
+
.describe('One connector event, leased to exactly one puller until its lease expires.');
|
|
203
|
+
/** A leased batch of connector events. */
|
|
204
|
+
export const ConnectionEventPullResponseSchema = z
|
|
205
|
+
.object({ items: z.array(ConnectionEventSchema) })
|
|
206
|
+
.describe('A leased batch of connector events. No cursor, by design.');
|
|
207
|
+
/** `POST /v1/connections/events/ack` — settle leases. */
|
|
208
|
+
export const ConnectionEventAckRequestSchema = z
|
|
209
|
+
.object({
|
|
210
|
+
items: z
|
|
211
|
+
.array(z.object({ id: IdSchema, leaseToken: z.string().min(1) }))
|
|
212
|
+
.min(1)
|
|
213
|
+
.max(100),
|
|
214
|
+
})
|
|
215
|
+
.describe('Settle event leases with exact receipts. One to a hundred at a time.');
|
|
216
|
+
/** How many leases were settled. */
|
|
217
|
+
export const ConnectionEventAckResponseSchema = z
|
|
218
|
+
.object({ acknowledged: z.number().int().nonnegative() })
|
|
219
|
+
.describe('How many leases the server settled.');
|
|
220
|
+
/** `GET /v1/connections/usage` and `GET /v1/connections/{id}/usage`. */
|
|
221
|
+
export const ConnectionUsageResponseSchema = z
|
|
222
|
+
.object({
|
|
223
|
+
periodStart: TimestampSchema,
|
|
224
|
+
periodEnd: TimestampSchema,
|
|
225
|
+
rows: z.array(z.object({
|
|
226
|
+
connectionId: IdSchema,
|
|
227
|
+
toolkit: z.string(),
|
|
228
|
+
actions: z.number().int().nonnegative().describe('How many operations ran in the period.'),
|
|
229
|
+
events: z
|
|
230
|
+
.number()
|
|
231
|
+
.int()
|
|
232
|
+
.nonnegative()
|
|
233
|
+
.describe('How many events were delivered in the period.'),
|
|
234
|
+
})),
|
|
235
|
+
totals: z.object({
|
|
236
|
+
actions: z.number().int().nonnegative(),
|
|
237
|
+
events: z.number().int().nonnegative(),
|
|
238
|
+
}),
|
|
239
|
+
})
|
|
240
|
+
.describe('Counts of managed-connection activity for a period. Counts only; no amount appears here.');
|
|
241
|
+
//# sourceMappingURL=connections.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connections.js","sourceRoot":"","sources":["../src/connections.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAA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AC;KAC3C,MAAM,CAAC;IACN,WAAW,EAAE,eAAe;IAC5B,SAAS,EAAE,eAAe;IAC1B,IAAI,EAAE,CAAC,CAAC,KAAK,CACX,CAAC,CAAC,MAAM,CAAC;QACP,YAAY,EAAE,QAAQ;QACtB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;QACnB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,wCAAwC,CAAC;QAC1F,MAAM,EAAE,CAAC;aACN,MAAM,EAAE;aACR,GAAG,EAAE;aACL,WAAW,EAAE;aACb,QAAQ,CAAC,+CAA+C,CAAC;KAC7D,CAAC,CACH;IACD,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;QACvC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;KACvC,CAAC;CACH,CAAC;KACD,QAAQ,CACP,0FAA0F,CAC3F,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@dork-labs/cloud-api` — the public wire contract for DorkOS Cloud.
|
|
3
|
+
*
|
|
4
|
+
* The root export is schemas, inferred types and route paths only. There is no
|
|
5
|
+
* network code here on purpose: a program can validate a payload against this
|
|
6
|
+
* contract without pulling in a client. The thin `fetch` client lives at
|
|
7
|
+
* `@dork-labs/cloud-api/client`.
|
|
8
|
+
*
|
|
9
|
+
* Two rules govern everything in this file, and both are enforced by tests in
|
|
10
|
+
* `src/__tests__/`:
|
|
11
|
+
*
|
|
12
|
+
* 1. **Additive within `/v1`.** New endpoints and new optional fields only.
|
|
13
|
+
* Removing a field, or making an optional one required, is `/v2`.
|
|
14
|
+
* 2. **Catalog blindness.** No type here enumerates the plan catalog or the
|
|
15
|
+
* model catalog. `planId`, `skuId`, `modelId`, add-on kinds and every
|
|
16
|
+
* catalog-shaped identifier are opaque strings — never an enum, a literal
|
|
17
|
+
* union, a const array or a value named in a description.
|
|
18
|
+
*
|
|
19
|
+
* @packageDocumentation
|
|
20
|
+
*/
|
|
21
|
+
export * from './primitives.js';
|
|
22
|
+
export * from './problem.js';
|
|
23
|
+
export * from './routes.js';
|
|
24
|
+
export * from './session.js';
|
|
25
|
+
export * from './instances.js';
|
|
26
|
+
export * from './connections.js';
|
|
27
|
+
export * from './billing.js';
|
|
28
|
+
export * from './inference.js';
|
|
29
|
+
export * from './seats.js';
|
|
30
|
+
export * from './remote.js';
|
|
31
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@dork-labs/cloud-api` — the public wire contract for DorkOS Cloud.
|
|
3
|
+
*
|
|
4
|
+
* The root export is schemas, inferred types and route paths only. There is no
|
|
5
|
+
* network code here on purpose: a program can validate a payload against this
|
|
6
|
+
* contract without pulling in a client. The thin `fetch` client lives at
|
|
7
|
+
* `@dork-labs/cloud-api/client`.
|
|
8
|
+
*
|
|
9
|
+
* Two rules govern everything in this file, and both are enforced by tests in
|
|
10
|
+
* `src/__tests__/`:
|
|
11
|
+
*
|
|
12
|
+
* 1. **Additive within `/v1`.** New endpoints and new optional fields only.
|
|
13
|
+
* Removing a field, or making an optional one required, is `/v2`.
|
|
14
|
+
* 2. **Catalog blindness.** No type here enumerates the plan catalog or the
|
|
15
|
+
* model catalog. `planId`, `skuId`, `modelId`, add-on kinds and every
|
|
16
|
+
* catalog-shaped identifier are opaque strings — never an enum, a literal
|
|
17
|
+
* union, a const array or a value named in a description.
|
|
18
|
+
*
|
|
19
|
+
* @packageDocumentation
|
|
20
|
+
*/
|
|
21
|
+
export * from './primitives.js';
|
|
22
|
+
export * from './problem.js';
|
|
23
|
+
export * from './routes.js';
|
|
24
|
+
export * from './session.js';
|
|
25
|
+
export * from './instances.js';
|
|
26
|
+
export * from './connections.js';
|
|
27
|
+
export * from './billing.js';
|
|
28
|
+
export * from './inference.js';
|
|
29
|
+
export * from './seats.js';
|
|
30
|
+
export * from './remote.js';
|
|
31
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC"}
|