@project-ajax/sdk 0.0.60 → 0.0.61
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/package.json +3 -11
- package/dist/cli/api/client.d.ts +0 -212
- package/dist/cli/api/client.d.ts.map +0 -1
- package/dist/cli/api/client.js +0 -330
- package/dist/cli/api/result.d.ts +0 -43
- package/dist/cli/api/result.d.ts.map +0 -1
- package/dist/cli/api/result.js +0 -43
- package/dist/cli/bin/cli.d.ts +0 -3
- package/dist/cli/bin/cli.d.ts.map +0 -1
- package/dist/cli/bin/cli.js +0 -5
- package/dist/cli/commands/auth.d.ts +0 -2
- package/dist/cli/commands/auth.d.ts.map +0 -1
- package/dist/cli/commands/auth.impl.d.ts +0 -5
- package/dist/cli/commands/auth.impl.d.ts.map +0 -1
- package/dist/cli/commands/auth.impl.js +0 -45
- package/dist/cli/commands/auth.impl.test.d.ts +0 -2
- package/dist/cli/commands/auth.impl.test.d.ts.map +0 -1
- package/dist/cli/commands/auth.js +0 -56
- package/dist/cli/commands/bundle.d.ts +0 -2
- package/dist/cli/commands/bundle.d.ts.map +0 -1
- package/dist/cli/commands/bundle.impl.d.ts +0 -2
- package/dist/cli/commands/bundle.impl.d.ts.map +0 -1
- package/dist/cli/commands/bundle.impl.js +0 -21
- package/dist/cli/commands/bundle.impl.test.d.ts +0 -2
- package/dist/cli/commands/bundle.impl.test.d.ts.map +0 -1
- package/dist/cli/commands/bundle.js +0 -23
- package/dist/cli/commands/capabilities.d.ts +0 -2
- package/dist/cli/commands/capabilities.d.ts.map +0 -1
- package/dist/cli/commands/capabilities.impl.d.ts +0 -3
- package/dist/cli/commands/capabilities.impl.d.ts.map +0 -1
- package/dist/cli/commands/capabilities.impl.js +0 -40
- package/dist/cli/commands/capabilities.js +0 -24
- package/dist/cli/commands/connect.d.ts +0 -2
- package/dist/cli/commands/connect.d.ts.map +0 -1
- package/dist/cli/commands/connect.impl.d.ts +0 -6
- package/dist/cli/commands/connect.impl.d.ts.map +0 -1
- package/dist/cli/commands/connect.impl.js +0 -116
- package/dist/cli/commands/connect.js +0 -78
- package/dist/cli/commands/deploy.d.ts +0 -3
- package/dist/cli/commands/deploy.d.ts.map +0 -1
- package/dist/cli/commands/deploy.impl.d.ts +0 -6
- package/dist/cli/commands/deploy.impl.d.ts.map +0 -1
- package/dist/cli/commands/deploy.impl.js +0 -60
- package/dist/cli/commands/deploy.impl.test.d.ts +0 -2
- package/dist/cli/commands/deploy.impl.test.d.ts.map +0 -1
- package/dist/cli/commands/deploy.js +0 -22
- package/dist/cli/commands/env.d.ts +0 -2
- package/dist/cli/commands/env.d.ts.map +0 -1
- package/dist/cli/commands/env.impl.d.ts +0 -11
- package/dist/cli/commands/env.impl.d.ts.map +0 -1
- package/dist/cli/commands/env.impl.js +0 -62
- package/dist/cli/commands/env.js +0 -39
- package/dist/cli/commands/exec.d.ts +0 -3
- package/dist/cli/commands/exec.d.ts.map +0 -1
- package/dist/cli/commands/exec.impl.d.ts +0 -7
- package/dist/cli/commands/exec.impl.d.ts.map +0 -1
- package/dist/cli/commands/exec.impl.js +0 -123
- package/dist/cli/commands/exec.js +0 -30
- package/dist/cli/commands/runs.d.ts +0 -2
- package/dist/cli/commands/runs.d.ts.map +0 -1
- package/dist/cli/commands/runs.impl.d.ts +0 -4
- package/dist/cli/commands/runs.impl.d.ts.map +0 -1
- package/dist/cli/commands/runs.impl.js +0 -71
- package/dist/cli/commands/runs.js +0 -45
- package/dist/cli/commands/secrets.d.ts +0 -2
- package/dist/cli/commands/secrets.d.ts.map +0 -1
- package/dist/cli/commands/secrets.impl.d.ts +0 -5
- package/dist/cli/commands/secrets.impl.d.ts.map +0 -1
- package/dist/cli/commands/secrets.impl.js +0 -99
- package/dist/cli/commands/secrets.js +0 -64
- package/dist/cli/commands/utils/testing.d.ts +0 -13
- package/dist/cli/commands/utils/testing.d.ts.map +0 -1
- package/dist/cli/commands/utils/testing.js +0 -58
- package/dist/cli/config.d.ts +0 -63
- package/dist/cli/config.d.ts.map +0 -1
- package/dist/cli/config.js +0 -194
- package/dist/cli/config.test.d.ts +0 -2
- package/dist/cli/config.test.d.ts.map +0 -1
- package/dist/cli/context.d.ts +0 -15
- package/dist/cli/context.d.ts.map +0 -1
- package/dist/cli/context.js +0 -16
- package/dist/cli/deploy.d.ts +0 -37
- package/dist/cli/deploy.d.ts.map +0 -1
- package/dist/cli/deploy.js +0 -100
- package/dist/cli/flags.d.ts +0 -21
- package/dist/cli/flags.d.ts.map +0 -1
- package/dist/cli/flags.js +0 -49
- package/dist/cli/handler.d.ts +0 -14
- package/dist/cli/handler.d.ts.map +0 -1
- package/dist/cli/handler.js +0 -32
- package/dist/cli/io.d.ts +0 -55
- package/dist/cli/io.d.ts.map +0 -1
- package/dist/cli/io.js +0 -96
- package/dist/cli/routes.d.ts +0 -2
- package/dist/cli/routes.d.ts.map +0 -1
- package/dist/cli/routes.js +0 -62
- package/dist/cli/utils/array.d.ts +0 -2
- package/dist/cli/utils/array.d.ts.map +0 -1
- package/dist/cli/utils/array.js +0 -10
- package/dist/cli/utils/openUrl.d.ts +0 -4
- package/dist/cli/utils/openUrl.d.ts.map +0 -1
- package/dist/cli/utils/openUrl.js +0 -43
- package/dist/cli/utils/string.d.ts +0 -2
- package/dist/cli/utils/string.d.ts.map +0 -1
- package/dist/cli/utils/string.js +0 -12
- package/src/cli/api/client.ts +0 -628
- package/src/cli/api/result.ts +0 -71
- package/src/cli/bin/cli.ts +0 -7
- package/src/cli/commands/.cursor/rules/testing-commands.mdc +0 -212
- package/src/cli/commands/auth.impl.test.ts +0 -228
- package/src/cli/commands/auth.impl.ts +0 -56
- package/src/cli/commands/auth.ts +0 -63
- package/src/cli/commands/bundle.impl.test.ts +0 -143
- package/src/cli/commands/bundle.impl.ts +0 -21
- package/src/cli/commands/bundle.ts +0 -23
- package/src/cli/commands/capabilities.impl.ts +0 -47
- package/src/cli/commands/capabilities.ts +0 -25
- package/src/cli/commands/connect.impl.ts +0 -149
- package/src/cli/commands/connect.ts +0 -80
- package/src/cli/commands/deploy.impl.test.ts +0 -254
- package/src/cli/commands/deploy.impl.ts +0 -73
- package/src/cli/commands/deploy.ts +0 -22
- package/src/cli/commands/env.impl.ts +0 -88
- package/src/cli/commands/env.ts +0 -38
- package/src/cli/commands/exec.impl.ts +0 -171
- package/src/cli/commands/exec.ts +0 -32
- package/src/cli/commands/runs.impl.ts +0 -87
- package/src/cli/commands/runs.ts +0 -49
- package/src/cli/commands/secrets.impl.ts +0 -130
- package/src/cli/commands/secrets.ts +0 -73
- package/src/cli/commands/utils/testing.ts +0 -66
- package/src/cli/config.test.ts +0 -108
- package/src/cli/config.ts +0 -265
- package/src/cli/context.ts +0 -26
- package/src/cli/deploy.ts +0 -190
- package/src/cli/flags.ts +0 -72
- package/src/cli/handler.ts +0 -68
- package/src/cli/io.ts +0 -132
- package/src/cli/routes.ts +0 -61
- package/src/cli/utils/array.ts +0 -7
- package/src/cli/utils/openUrl.ts +0 -53
- package/src/cli/utils/string.ts +0 -9
package/package.json
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@project-ajax/sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.61",
|
|
4
4
|
"description": "An SDK for building workers for the Project Ajax platform",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
7
|
-
"bin": {
|
|
8
|
-
"workers": "dist/cli/bin/cli.js"
|
|
9
|
-
},
|
|
10
7
|
"exports": {
|
|
11
8
|
".": {
|
|
12
9
|
"types": "./dist/index.d.ts",
|
|
@@ -59,7 +56,7 @@
|
|
|
59
56
|
"build:js": "tsx scripts/build.ts",
|
|
60
57
|
"build:watch": "concurrently --group \"npm run build:watch:types\" \"npm run build:watch:js\"",
|
|
61
58
|
"build:watch:types": "tsc --watch",
|
|
62
|
-
"build:watch:js": "esbuild --watch --format=esm --outdir=dist --target=esnext --packages=external ./src
|
|
59
|
+
"build:watch:js": "esbuild --watch --format=esm --outdir=dist --target=esnext --packages=external ./src/**.ts ./src/**/*.ts",
|
|
63
60
|
"test": "vitest run"
|
|
64
61
|
},
|
|
65
62
|
"devDependencies": {
|
|
@@ -70,11 +67,6 @@
|
|
|
70
67
|
"vitest": "^4.0.8"
|
|
71
68
|
},
|
|
72
69
|
"dependencies": {
|
|
73
|
-
"
|
|
74
|
-
"@stricli/auto-complete": "^1.2.4",
|
|
75
|
-
"@stricli/core": "^1.2.4",
|
|
76
|
-
"@visulima/tabular": "^3.1.1",
|
|
77
|
-
"ajv": "^8.17.1",
|
|
78
|
-
"esbuild": "^0.25.12"
|
|
70
|
+
"ajv": "^8.17.1"
|
|
79
71
|
}
|
|
80
72
|
}
|
package/dist/cli/api/client.d.ts
DELETED
|
@@ -1,212 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* API client for making authenticated requests to the Workers API
|
|
3
|
-
*/
|
|
4
|
-
import type { IO } from "../io.js";
|
|
5
|
-
import { Result } from "./result.js";
|
|
6
|
-
export type Environment = "local" | "staging" | "dev" | "prod";
|
|
7
|
-
interface ApiClientConfig {
|
|
8
|
-
token: string;
|
|
9
|
-
environment: Environment;
|
|
10
|
-
baseUrl?: string | undefined;
|
|
11
|
-
cellId: string;
|
|
12
|
-
writer: IO;
|
|
13
|
-
}
|
|
14
|
-
export interface ApiError {
|
|
15
|
-
status: number;
|
|
16
|
-
statusText: string;
|
|
17
|
-
message: string;
|
|
18
|
-
validationError?: {
|
|
19
|
-
errorId: string;
|
|
20
|
-
name: string;
|
|
21
|
-
debugMessage: string;
|
|
22
|
-
message: string;
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* API client for making authenticated requests to Workers endpoints
|
|
27
|
-
*/
|
|
28
|
-
export declare class ApiClient {
|
|
29
|
-
#private;
|
|
30
|
-
constructor(config: ApiClientConfig);
|
|
31
|
-
/**
|
|
32
|
-
* Make an authenticated fetch request to the Workers API
|
|
33
|
-
*/
|
|
34
|
-
private fetch;
|
|
35
|
-
/**
|
|
36
|
-
* Create a new worker
|
|
37
|
-
*/
|
|
38
|
-
createWorker(name: string): Promise<Result<{
|
|
39
|
-
worker: {
|
|
40
|
-
workerId: string;
|
|
41
|
-
name: string;
|
|
42
|
-
spaceId: string;
|
|
43
|
-
createdAt: string;
|
|
44
|
-
updatedAt: string;
|
|
45
|
-
state: unknown;
|
|
46
|
-
};
|
|
47
|
-
url: string;
|
|
48
|
-
fields: Record<string, string>;
|
|
49
|
-
}, ApiError>>;
|
|
50
|
-
/**
|
|
51
|
-
* Update an existing worker's bundle
|
|
52
|
-
*/
|
|
53
|
-
updateWorkerBundle(workerId: string): Promise<Result<{
|
|
54
|
-
url: string;
|
|
55
|
-
fields: Record<string, string>;
|
|
56
|
-
}, ApiError>>;
|
|
57
|
-
/**
|
|
58
|
-
* Get a worker by ID
|
|
59
|
-
*/
|
|
60
|
-
getWorker(workerId: string): Promise<Result<{
|
|
61
|
-
worker: {
|
|
62
|
-
workerId: string;
|
|
63
|
-
name: string;
|
|
64
|
-
spaceId: string;
|
|
65
|
-
state: unknown;
|
|
66
|
-
tools: unknown[];
|
|
67
|
-
createdAt: string;
|
|
68
|
-
updatedAt: string;
|
|
69
|
-
};
|
|
70
|
-
}, ApiError>>;
|
|
71
|
-
/**
|
|
72
|
-
* List all workers in the space
|
|
73
|
-
*/
|
|
74
|
-
listWorkers(): Promise<Result<{
|
|
75
|
-
workers: Array<{
|
|
76
|
-
workerId: string;
|
|
77
|
-
name: string;
|
|
78
|
-
spaceId: string;
|
|
79
|
-
state: unknown;
|
|
80
|
-
createdAt: string;
|
|
81
|
-
updatedAt: string;
|
|
82
|
-
}>;
|
|
83
|
-
}, ApiError>>;
|
|
84
|
-
/**
|
|
85
|
-
* Delete a worker
|
|
86
|
-
*/
|
|
87
|
-
deleteWorker(workerId: string): Promise<Result<Record<string, never>, ApiError>>;
|
|
88
|
-
/**
|
|
89
|
-
* Fetch and save worker capabilities
|
|
90
|
-
*/
|
|
91
|
-
fetchAndSaveCapabilities(workerId: string): Promise<Result<{
|
|
92
|
-
capabilities: ReadonlyArray<{
|
|
93
|
-
_tag: "sync" | "slashCommand";
|
|
94
|
-
spaceId: string;
|
|
95
|
-
workerId: string;
|
|
96
|
-
key: string;
|
|
97
|
-
config: unknown;
|
|
98
|
-
}>;
|
|
99
|
-
}, ApiError>>;
|
|
100
|
-
/**
|
|
101
|
-
* Upsert secrets (create or update multiple secrets)
|
|
102
|
-
*/
|
|
103
|
-
upsertSecrets(workerId: string, secrets: Array<{
|
|
104
|
-
key: string;
|
|
105
|
-
value: string;
|
|
106
|
-
}>): Promise<Result<{
|
|
107
|
-
secrets: Array<{
|
|
108
|
-
spaceId: string;
|
|
109
|
-
workerId: string;
|
|
110
|
-
key: string;
|
|
111
|
-
createdAt: string;
|
|
112
|
-
}>;
|
|
113
|
-
}, ApiError>>;
|
|
114
|
-
/**
|
|
115
|
-
* List all secrets for a worker (keys only, not values)
|
|
116
|
-
*/
|
|
117
|
-
listSecrets(workerId: string, options?: {
|
|
118
|
-
secretKinds?: Array<"keyValue" | "oauth">;
|
|
119
|
-
}): Promise<Result<{
|
|
120
|
-
secrets: Array<{
|
|
121
|
-
spaceId: string;
|
|
122
|
-
workerId: string;
|
|
123
|
-
key: string;
|
|
124
|
-
createdAt: string;
|
|
125
|
-
kind: "keyValue" | "oauth";
|
|
126
|
-
}>;
|
|
127
|
-
}, ApiError>>;
|
|
128
|
-
/**
|
|
129
|
-
* Pull decrypted env vars for a worker
|
|
130
|
-
*/
|
|
131
|
-
pullEnv(workerId: string): Promise<Result<{
|
|
132
|
-
env: Array<{
|
|
133
|
-
key: string;
|
|
134
|
-
value: string;
|
|
135
|
-
}>;
|
|
136
|
-
}, ApiError>>;
|
|
137
|
-
listOauthProviders(): Promise<Result<{
|
|
138
|
-
providers: Array<{
|
|
139
|
-
key: string;
|
|
140
|
-
displayName: string;
|
|
141
|
-
}>;
|
|
142
|
-
}, ApiError>>;
|
|
143
|
-
/**
|
|
144
|
-
* Start the OAuth flow for a provider
|
|
145
|
-
*/
|
|
146
|
-
startOauth(args: {
|
|
147
|
-
workerId: string;
|
|
148
|
-
provider: string;
|
|
149
|
-
}): Promise<Result<{
|
|
150
|
-
authorizationUrl: string;
|
|
151
|
-
state: string;
|
|
152
|
-
}, ApiError>>;
|
|
153
|
-
/**
|
|
154
|
-
* Remove an OAuth connection for a worker
|
|
155
|
-
*/
|
|
156
|
-
deleteOauthConnection(args: {
|
|
157
|
-
workerId: string;
|
|
158
|
-
provider: string;
|
|
159
|
-
}): Promise<Result<Record<string, never>, ApiError>>;
|
|
160
|
-
/**
|
|
161
|
-
* Delete a secret
|
|
162
|
-
*/
|
|
163
|
-
deleteSecret(workerId: string, key: string): Promise<Result<Record<string, never>, ApiError>>;
|
|
164
|
-
/**
|
|
165
|
-
* List all capabilities for a worker
|
|
166
|
-
*/
|
|
167
|
-
listCapabilities(workerId: string): Promise<Result<{
|
|
168
|
-
capabilities: Array<{
|
|
169
|
-
_tag: "sync" | "slashCommand";
|
|
170
|
-
key: string;
|
|
171
|
-
}>;
|
|
172
|
-
}, ApiError>>;
|
|
173
|
-
/**
|
|
174
|
-
* Run a capability
|
|
175
|
-
*/
|
|
176
|
-
runCapability(workerId: string, capabilityKey: string, functionName: string | null, args: Array<{
|
|
177
|
-
name: string;
|
|
178
|
-
value: string;
|
|
179
|
-
}>, stream: true): Promise<Result<ReadableStream<Uint8Array<ArrayBufferLike>>, ApiError>>;
|
|
180
|
-
runCapability(workerId: string, capabilityKey: string, functionName: string | null, args: Array<{
|
|
181
|
-
name: string;
|
|
182
|
-
value: string;
|
|
183
|
-
}>, stream?: false | undefined): Promise<Result<{
|
|
184
|
-
result: unknown;
|
|
185
|
-
}, ApiError>>;
|
|
186
|
-
/**
|
|
187
|
-
* Download the bundle for a worker
|
|
188
|
-
*/
|
|
189
|
-
downloadWorkerBundle(workerId: string): Promise<Result<ReadableStream<Uint8Array<ArrayBufferLike>>, ApiError>>;
|
|
190
|
-
/**
|
|
191
|
-
* List all runs for a worker
|
|
192
|
-
*/
|
|
193
|
-
listRunsForWorker(workerId: string): Promise<Result<{
|
|
194
|
-
runs: Array<{
|
|
195
|
-
workerId: string;
|
|
196
|
-
spaceId: string;
|
|
197
|
-
runId: string;
|
|
198
|
-
name: string;
|
|
199
|
-
exitCode: number | null;
|
|
200
|
-
startedAt: string;
|
|
201
|
-
endedAt: string | null;
|
|
202
|
-
}>;
|
|
203
|
-
}, ApiError>>;
|
|
204
|
-
/**
|
|
205
|
-
* Get logs for a specific run
|
|
206
|
-
*/
|
|
207
|
-
getRunLogs(workerId: string, runId: string): Promise<Result<{
|
|
208
|
-
logs: string;
|
|
209
|
-
}, ApiError>>;
|
|
210
|
-
}
|
|
211
|
-
export {};
|
|
212
|
-
//# sourceMappingURL=client.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/cli/api/client.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,SAAS,GAAG,KAAK,GAAG,MAAM,CAAC;AAE/D,UAAU,eAAe;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,WAAW,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,EAAE,CAAC;CACX;AAID,MAAM,WAAW,QAAQ;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE;QACjB,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,YAAY,EAAE,MAAM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AC;YACxB,SAAS,EAAE,MAAM,CAAC;YAClB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;SACvB,CAAC,CAAC;KACH,EACD,QAAQ,CACR,CACD;IASD;;OAEG;IACG,UAAU,CACf,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,GACX,OAAO,CACT,MAAM,CACL;QACC,IAAI,EAAE,MAAM,CAAC;KACb,EACD,QAAQ,CACR,CACD;CASD"}
|
package/dist/cli/api/client.js
DELETED
|
@@ -1,330 +0,0 @@
|
|
|
1
|
-
import { Result } from "./result.js";
|
|
2
|
-
class ApiClient {
|
|
3
|
-
#token;
|
|
4
|
-
#baseUrl;
|
|
5
|
-
#cellId;
|
|
6
|
-
#writer;
|
|
7
|
-
constructor(config) {
|
|
8
|
-
this.#token = config.token;
|
|
9
|
-
this.#baseUrl = config.baseUrl;
|
|
10
|
-
this.#cellId = config.cellId;
|
|
11
|
-
this.#writer = config.writer;
|
|
12
|
-
}
|
|
13
|
-
#baseApiUrl() {
|
|
14
|
-
return `${this.#baseUrl}/api/v3`;
|
|
15
|
-
}
|
|
16
|
-
async fetch(endpoint, requestOptions = {}, options) {
|
|
17
|
-
if (!endpoint.startsWith("/")) {
|
|
18
|
-
throw new Error("Endpoint must start with a slash (/)");
|
|
19
|
-
}
|
|
20
|
-
const url = `${this.#baseApiUrl()}${endpoint}`;
|
|
21
|
-
this.#writer.debug(`Fetching ${url}`);
|
|
22
|
-
this.#writer.debug(
|
|
23
|
-
`Options: ${JSON.stringify(requestOptions, null, " ")}`
|
|
24
|
-
);
|
|
25
|
-
const headers = new Headers({
|
|
26
|
-
Authorization: `Bearer ${this.#token}`,
|
|
27
|
-
"Content-Type": "application/json",
|
|
28
|
-
"X-Notion-Cell": this.#cellId
|
|
29
|
-
});
|
|
30
|
-
const addlHeaders = headersInitToEntries(requestOptions.headers);
|
|
31
|
-
for (const [key, value] of addlHeaders) {
|
|
32
|
-
headers.append(key, value);
|
|
33
|
-
}
|
|
34
|
-
const response = await fetch(url, {
|
|
35
|
-
method: requestOptions.method ?? "GET",
|
|
36
|
-
headers,
|
|
37
|
-
body: requestOptions.body ? JSON.stringify(requestOptions.body) : null
|
|
38
|
-
});
|
|
39
|
-
this.#writer.debug(`Response: ${response.status} ${response.statusText}`);
|
|
40
|
-
if (!response.ok) {
|
|
41
|
-
const error = await parseApiError(response);
|
|
42
|
-
return Result.fail(error);
|
|
43
|
-
}
|
|
44
|
-
if (options?.stream) {
|
|
45
|
-
if (!response.body) {
|
|
46
|
-
return Result.fail({
|
|
47
|
-
status: response.status,
|
|
48
|
-
statusText: response.statusText,
|
|
49
|
-
message: "No body in response"
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
return Result.success(response.body);
|
|
53
|
-
} else {
|
|
54
|
-
const data = await response.json();
|
|
55
|
-
return Result.success(data);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Create a new worker
|
|
60
|
-
*/
|
|
61
|
-
async createWorker(name) {
|
|
62
|
-
return this.fetch("/workersCreateWorker", {
|
|
63
|
-
method: "POST",
|
|
64
|
-
body: {
|
|
65
|
-
name
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Update an existing worker's bundle
|
|
71
|
-
*/
|
|
72
|
-
async updateWorkerBundle(workerId) {
|
|
73
|
-
return this.fetch("/workersUpdateWorker", {
|
|
74
|
-
method: "POST",
|
|
75
|
-
body: {
|
|
76
|
-
workerId
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Get a worker by ID
|
|
82
|
-
*/
|
|
83
|
-
async getWorker(workerId) {
|
|
84
|
-
return this.fetch("/workersGetWorker", {
|
|
85
|
-
method: "POST",
|
|
86
|
-
body: {
|
|
87
|
-
workerId
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* List all workers in the space
|
|
93
|
-
*/
|
|
94
|
-
async listWorkers() {
|
|
95
|
-
return this.fetch("/workersListWorkers", {
|
|
96
|
-
method: "POST",
|
|
97
|
-
body: {}
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Delete a worker
|
|
102
|
-
*/
|
|
103
|
-
async deleteWorker(workerId) {
|
|
104
|
-
return this.fetch("/workersDeleteWorker", {
|
|
105
|
-
method: "POST",
|
|
106
|
-
body: {
|
|
107
|
-
workerId
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* Fetch and save worker capabilities
|
|
113
|
-
*/
|
|
114
|
-
async fetchAndSaveCapabilities(workerId) {
|
|
115
|
-
return this.fetch("/workersFetchAndSaveCapabilities", {
|
|
116
|
-
method: "POST",
|
|
117
|
-
body: {
|
|
118
|
-
workerId
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Upsert secrets (create or update multiple secrets)
|
|
124
|
-
*/
|
|
125
|
-
async upsertSecrets(workerId, secrets) {
|
|
126
|
-
return this.fetch("/workersUpsertSecrets", {
|
|
127
|
-
method: "POST",
|
|
128
|
-
body: {
|
|
129
|
-
workerId,
|
|
130
|
-
secrets
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* List all secrets for a worker (keys only, not values)
|
|
136
|
-
*/
|
|
137
|
-
async listSecrets(workerId, options) {
|
|
138
|
-
return this.fetch("/workersListSecrets", {
|
|
139
|
-
method: "POST",
|
|
140
|
-
body: {
|
|
141
|
-
workerId,
|
|
142
|
-
secretKinds: options?.secretKinds
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* Pull decrypted env vars for a worker
|
|
148
|
-
*/
|
|
149
|
-
async pullEnv(workerId) {
|
|
150
|
-
return this.fetch("/workersPullEnv", {
|
|
151
|
-
method: "POST",
|
|
152
|
-
body: {
|
|
153
|
-
workerId
|
|
154
|
-
}
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
async listOauthProviders() {
|
|
158
|
-
return this.fetch("/workersListOauthProviders", {
|
|
159
|
-
method: "POST",
|
|
160
|
-
body: {}
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
/**
|
|
164
|
-
* Start the OAuth flow for a provider
|
|
165
|
-
*/
|
|
166
|
-
async startOauth(args) {
|
|
167
|
-
return this.fetch("/workersStartOauth", {
|
|
168
|
-
method: "POST",
|
|
169
|
-
body: {
|
|
170
|
-
workerId: args.workerId,
|
|
171
|
-
provider: args.provider
|
|
172
|
-
}
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
|
-
/**
|
|
176
|
-
* Remove an OAuth connection for a worker
|
|
177
|
-
*/
|
|
178
|
-
async deleteOauthConnection(args) {
|
|
179
|
-
return this.fetch("/workersDeleteOauthConnection", {
|
|
180
|
-
method: "POST",
|
|
181
|
-
body: {
|
|
182
|
-
workerId: args.workerId,
|
|
183
|
-
provider: args.provider
|
|
184
|
-
}
|
|
185
|
-
});
|
|
186
|
-
}
|
|
187
|
-
/**
|
|
188
|
-
* Delete a secret
|
|
189
|
-
*/
|
|
190
|
-
async deleteSecret(workerId, key) {
|
|
191
|
-
return this.fetch("/workersDeleteSecret", {
|
|
192
|
-
method: "POST",
|
|
193
|
-
body: {
|
|
194
|
-
workerId,
|
|
195
|
-
key
|
|
196
|
-
}
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
/**
|
|
200
|
-
* List all capabilities for a worker
|
|
201
|
-
*/
|
|
202
|
-
async listCapabilities(workerId) {
|
|
203
|
-
return this.fetch("/workersListCapabilities", {
|
|
204
|
-
method: "POST",
|
|
205
|
-
body: {
|
|
206
|
-
workerId
|
|
207
|
-
}
|
|
208
|
-
});
|
|
209
|
-
}
|
|
210
|
-
async runCapability(workerId, capabilityKey, functionName, args, stream) {
|
|
211
|
-
if (stream) {
|
|
212
|
-
return this.fetch(
|
|
213
|
-
"/workersRunCapability",
|
|
214
|
-
{
|
|
215
|
-
method: "POST",
|
|
216
|
-
body: {
|
|
217
|
-
workerId,
|
|
218
|
-
capabilityKey,
|
|
219
|
-
functionName,
|
|
220
|
-
args,
|
|
221
|
-
stream
|
|
222
|
-
}
|
|
223
|
-
},
|
|
224
|
-
{ stream }
|
|
225
|
-
);
|
|
226
|
-
} else {
|
|
227
|
-
return this.fetch("/workersRunCapability", {
|
|
228
|
-
method: "POST",
|
|
229
|
-
body: {
|
|
230
|
-
workerId,
|
|
231
|
-
capabilityKey,
|
|
232
|
-
functionName,
|
|
233
|
-
args,
|
|
234
|
-
stream
|
|
235
|
-
}
|
|
236
|
-
});
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
/**
|
|
240
|
-
* Download the bundle for a worker
|
|
241
|
-
*/
|
|
242
|
-
async downloadWorkerBundle(workerId) {
|
|
243
|
-
return this.fetch(
|
|
244
|
-
"/workersGetBundle",
|
|
245
|
-
{
|
|
246
|
-
method: "POST",
|
|
247
|
-
body: {
|
|
248
|
-
workerId
|
|
249
|
-
}
|
|
250
|
-
},
|
|
251
|
-
{ stream: true }
|
|
252
|
-
);
|
|
253
|
-
}
|
|
254
|
-
/**
|
|
255
|
-
* List all runs for a worker
|
|
256
|
-
*/
|
|
257
|
-
async listRunsForWorker(workerId) {
|
|
258
|
-
return this.fetch("/workersListRunsForWorker", {
|
|
259
|
-
method: "POST",
|
|
260
|
-
body: {
|
|
261
|
-
workerId
|
|
262
|
-
}
|
|
263
|
-
});
|
|
264
|
-
}
|
|
265
|
-
/**
|
|
266
|
-
* Get logs for a specific run
|
|
267
|
-
*/
|
|
268
|
-
async getRunLogs(workerId, runId) {
|
|
269
|
-
return this.fetch("/workersGetRunLogs", {
|
|
270
|
-
method: "POST",
|
|
271
|
-
body: {
|
|
272
|
-
workerId,
|
|
273
|
-
runId
|
|
274
|
-
}
|
|
275
|
-
});
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
function headersInitToEntries(headersInit) {
|
|
279
|
-
if (headersInit instanceof Headers) {
|
|
280
|
-
return Array.from(headersInit.entries());
|
|
281
|
-
}
|
|
282
|
-
if (Array.isArray(headersInit)) {
|
|
283
|
-
return headersInit;
|
|
284
|
-
}
|
|
285
|
-
if (headersInit === void 0) {
|
|
286
|
-
return [];
|
|
287
|
-
}
|
|
288
|
-
const entries = [];
|
|
289
|
-
for (const [key, value] of Object.entries(headersInit)) {
|
|
290
|
-
if (value === void 0) {
|
|
291
|
-
continue;
|
|
292
|
-
}
|
|
293
|
-
entries.push([key, value]);
|
|
294
|
-
}
|
|
295
|
-
return entries;
|
|
296
|
-
}
|
|
297
|
-
async function parseApiError(response) {
|
|
298
|
-
const errorText = await response.text();
|
|
299
|
-
const message = `[${response.status}] ${response.statusText}: ${errorText}`;
|
|
300
|
-
const error = {
|
|
301
|
-
status: response.status,
|
|
302
|
-
statusText: response.statusText,
|
|
303
|
-
message
|
|
304
|
-
};
|
|
305
|
-
if (response.status === 400) {
|
|
306
|
-
const validationError = parseValidationError(errorText);
|
|
307
|
-
if (validationError) {
|
|
308
|
-
error.validationError = validationError;
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
return error;
|
|
312
|
-
}
|
|
313
|
-
function parseValidationError(errorText) {
|
|
314
|
-
try {
|
|
315
|
-
const errorJson = JSON.parse(errorText);
|
|
316
|
-
if (errorJson.name === "ValidationError" && errorJson.debugMessage && errorJson.errorId) {
|
|
317
|
-
return {
|
|
318
|
-
errorId: errorJson.errorId,
|
|
319
|
-
name: errorJson.name,
|
|
320
|
-
debugMessage: errorJson.debugMessage,
|
|
321
|
-
message: errorJson.message
|
|
322
|
-
};
|
|
323
|
-
}
|
|
324
|
-
} catch {
|
|
325
|
-
}
|
|
326
|
-
return void 0;
|
|
327
|
-
}
|
|
328
|
-
export {
|
|
329
|
-
ApiClient
|
|
330
|
-
};
|
package/dist/cli/api/result.d.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Represents the union of *either* the value returned
|
|
3
|
-
* from some function *or* an arbitrary error emitted during computation.
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* The left side of the Result type, the value.
|
|
7
|
-
*/
|
|
8
|
-
export interface Success<T> {
|
|
9
|
-
_tag: "success";
|
|
10
|
-
value: T;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* The right side of the Result type, the error.
|
|
14
|
-
*/
|
|
15
|
-
export interface Fail<E> {
|
|
16
|
-
_tag: "fail";
|
|
17
|
-
error: E;
|
|
18
|
-
}
|
|
19
|
-
export type Result<S, E> = Success<S> | Fail<E>;
|
|
20
|
-
/**
|
|
21
|
-
* Type predicates and helpers for the Result type.
|
|
22
|
-
*/
|
|
23
|
-
export declare const Result: {
|
|
24
|
-
success<S>(value: S): Success<S>;
|
|
25
|
-
fail<E>(error: E): Fail<E>;
|
|
26
|
-
/**
|
|
27
|
-
* Success (left side) type predicate for the Result type.
|
|
28
|
-
*/
|
|
29
|
-
isSuccess<S, E>(result: Result<S, E>): result is Success<S>;
|
|
30
|
-
/**
|
|
31
|
-
* Fail (right side) type predicate for the Result type.
|
|
32
|
-
*/
|
|
33
|
-
isFail<S, E>(result: Result<S, E>): result is Fail<E>;
|
|
34
|
-
/**
|
|
35
|
-
* Unwrap a Result value, throwing the error if it's set.
|
|
36
|
-
*/
|
|
37
|
-
unwrap<S, E>(result: Result<S, E>): S;
|
|
38
|
-
/**
|
|
39
|
-
* Unwrap a Result value, or return a default value if an error is set.
|
|
40
|
-
*/
|
|
41
|
-
unwrapOr<S, E>(result: Result<S, E>, defaultValue: S): S;
|
|
42
|
-
};
|
|
43
|
-
//# sourceMappingURL=result.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"result.d.ts","sourceRoot":"","sources":["../../../src/cli/api/result.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,WAAW,OAAO,CAAC,CAAC;IACzB,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,CAAC,CAAC;CACT;AAED;;GAEG;AACH,MAAM,WAAW,IAAI,CAAC,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,CAAC,CAAC;CACT;AAED,MAAM,MAAM,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;AAEhD;;GAEG;AACH,eAAO,MAAM,MAAM;YACV,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;SAI3B,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;IAI1B;;OAEG;cACO,CAAC,EAAE,CAAC,UAAU,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,MAAM,IAAI,OAAO,CAAC,CAAC,CAAC;IAI3D;;OAEG;WACI,CAAC,EAAE,CAAC,UAAU,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC;IAIrD;;OAEG;WACI,CAAC,EAAE,CAAC,UAAU,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC;IAQrC;;OAEG;aACM,CAAC,EAAE,CAAC,UAAU,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,gBAAgB,CAAC,GAAG,CAAC;CAOxD,CAAC"}
|
package/dist/cli/api/result.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
const Result = {
|
|
2
|
-
success(value) {
|
|
3
|
-
return { _tag: "success", value };
|
|
4
|
-
},
|
|
5
|
-
fail(error) {
|
|
6
|
-
return { _tag: "fail", error };
|
|
7
|
-
},
|
|
8
|
-
/**
|
|
9
|
-
* Success (left side) type predicate for the Result type.
|
|
10
|
-
*/
|
|
11
|
-
isSuccess(result) {
|
|
12
|
-
return result._tag === "success";
|
|
13
|
-
},
|
|
14
|
-
/**
|
|
15
|
-
* Fail (right side) type predicate for the Result type.
|
|
16
|
-
*/
|
|
17
|
-
isFail(result) {
|
|
18
|
-
return result._tag === "fail";
|
|
19
|
-
},
|
|
20
|
-
/**
|
|
21
|
-
* Unwrap a Result value, throwing the error if it's set.
|
|
22
|
-
*/
|
|
23
|
-
unwrap(result) {
|
|
24
|
-
if (Result.isFail(result)) {
|
|
25
|
-
throw result.error;
|
|
26
|
-
} else {
|
|
27
|
-
return result.value;
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
/**
|
|
31
|
-
* Unwrap a Result value, or return a default value if an error is set.
|
|
32
|
-
*/
|
|
33
|
-
unwrapOr(result, defaultValue) {
|
|
34
|
-
if (Result.isFail(result)) {
|
|
35
|
-
return defaultValue;
|
|
36
|
-
} else {
|
|
37
|
-
return result.value;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
export {
|
|
42
|
-
Result
|
|
43
|
-
};
|
package/dist/cli/bin/cli.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../../src/cli/bin/cli.ts"],"names":[],"mappings":""}
|
package/dist/cli/bin/cli.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/auth.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,YAAY,wEA2DvB,CAAC"}
|