aegis-platform-sdk 0.1.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/CHANGELOG.md +11 -0
- package/LICENSE +14 -0
- package/README.md +105 -0
- package/dist/index.cjs +719 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +497 -0
- package/dist/index.d.ts +497 -0
- package/dist/index.js +688 -0
- package/dist/index.js.map +1 -0
- package/package.json +53 -0
- package/skills/aegis-sdk/SKILL.md +88 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,497 @@
|
|
|
1
|
+
type QueryParams = Record<string, string | number | boolean | undefined | null>;
|
|
2
|
+
interface RequestOptions {
|
|
3
|
+
params?: QueryParams;
|
|
4
|
+
json?: unknown;
|
|
5
|
+
signal?: AbortSignal;
|
|
6
|
+
}
|
|
7
|
+
/** The verb-agnostic transport contract every resource is built on. */
|
|
8
|
+
interface Transport {
|
|
9
|
+
request<T = unknown>(method: string, path: string, opts?: RequestOptions): Promise<T>;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Core wire types — mirrors `aegis/types.py` in the Python SDK.
|
|
14
|
+
*
|
|
15
|
+
* Many endpoints return backend-shaped JSON that the Python SDK types as
|
|
16
|
+
* `dict`; those are `Json` here. As endpoints stabilize they graduate to
|
|
17
|
+
* named interfaces (same policy as the Python SDK).
|
|
18
|
+
*/
|
|
19
|
+
type Json = Record<string, unknown>;
|
|
20
|
+
interface TokenPair {
|
|
21
|
+
access_token: string;
|
|
22
|
+
refresh_token: string;
|
|
23
|
+
token_type: string;
|
|
24
|
+
expires_in: number;
|
|
25
|
+
must_change_password: boolean;
|
|
26
|
+
}
|
|
27
|
+
interface Tenant {
|
|
28
|
+
id: string;
|
|
29
|
+
slug: string;
|
|
30
|
+
display_name: string;
|
|
31
|
+
features: Json;
|
|
32
|
+
}
|
|
33
|
+
interface DevMode {
|
|
34
|
+
enabled: boolean;
|
|
35
|
+
until?: string | null;
|
|
36
|
+
}
|
|
37
|
+
interface WhoAmI {
|
|
38
|
+
user_id: string;
|
|
39
|
+
username: string;
|
|
40
|
+
display_name: string;
|
|
41
|
+
email?: string | null;
|
|
42
|
+
tenant?: Tenant | null;
|
|
43
|
+
clearances: string[];
|
|
44
|
+
roles: string[];
|
|
45
|
+
permissions: string[];
|
|
46
|
+
must_change_password: boolean;
|
|
47
|
+
totp_enabled: boolean;
|
|
48
|
+
dev_mode?: DevMode | null;
|
|
49
|
+
}
|
|
50
|
+
interface User {
|
|
51
|
+
id: string;
|
|
52
|
+
tenant_id: string;
|
|
53
|
+
username: string;
|
|
54
|
+
display_name: string;
|
|
55
|
+
email?: string | null;
|
|
56
|
+
active: boolean;
|
|
57
|
+
clearances: string[];
|
|
58
|
+
roles: string[];
|
|
59
|
+
must_change_password: boolean;
|
|
60
|
+
totp_enabled: boolean;
|
|
61
|
+
}
|
|
62
|
+
interface Role {
|
|
63
|
+
id: string;
|
|
64
|
+
tenant_id?: string | null;
|
|
65
|
+
key: string;
|
|
66
|
+
name: string;
|
|
67
|
+
description: string;
|
|
68
|
+
is_system: boolean;
|
|
69
|
+
priority: number;
|
|
70
|
+
permission_keys: string[];
|
|
71
|
+
parent_role_ids: string[];
|
|
72
|
+
}
|
|
73
|
+
interface Permission {
|
|
74
|
+
id: string;
|
|
75
|
+
key: string;
|
|
76
|
+
resource: string;
|
|
77
|
+
action: string;
|
|
78
|
+
description: string;
|
|
79
|
+
is_system: boolean;
|
|
80
|
+
}
|
|
81
|
+
interface OsdkToken {
|
|
82
|
+
id: string;
|
|
83
|
+
name: string;
|
|
84
|
+
scopes: string[];
|
|
85
|
+
expires_at?: string | null;
|
|
86
|
+
last_used_at?: string | null;
|
|
87
|
+
revoked: boolean;
|
|
88
|
+
created_at?: string | null;
|
|
89
|
+
}
|
|
90
|
+
/** Returned once on create/rotate — `token` is the plaintext secret. */
|
|
91
|
+
interface OsdkTokenWithSecret extends OsdkToken {
|
|
92
|
+
token: string;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
interface LoginOptions {
|
|
96
|
+
totpCode?: string;
|
|
97
|
+
/** Attach the issued JWT to the client for subsequent calls (default true). */
|
|
98
|
+
attach?: boolean;
|
|
99
|
+
}
|
|
100
|
+
/** `client.auth.*` — login, whoami, dev-mode. */
|
|
101
|
+
declare class AuthResource {
|
|
102
|
+
private readonly t;
|
|
103
|
+
private readonly setToken;
|
|
104
|
+
constructor(t: Transport, setToken: (token: string | null) => void);
|
|
105
|
+
login(username: string, password: string, opts?: LoginOptions): Promise<TokenPair>;
|
|
106
|
+
me(): Promise<WhoAmI>;
|
|
107
|
+
/** Activate a vendor dev-mode session; requires the `vendor` role. */
|
|
108
|
+
enableDevMode(password: string): Promise<DevMode>;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
declare class UsersResource {
|
|
112
|
+
private readonly t;
|
|
113
|
+
constructor(t: Transport);
|
|
114
|
+
list(): Promise<User[]>;
|
|
115
|
+
get(userId: string): Promise<User>;
|
|
116
|
+
}
|
|
117
|
+
declare class RolesResource {
|
|
118
|
+
private readonly t;
|
|
119
|
+
constructor(t: Transport);
|
|
120
|
+
list(): Promise<Role[]>;
|
|
121
|
+
get(roleId: string): Promise<Role>;
|
|
122
|
+
}
|
|
123
|
+
declare class GroupsResource {
|
|
124
|
+
private readonly t;
|
|
125
|
+
constructor(t: Transport);
|
|
126
|
+
list(opts?: {
|
|
127
|
+
limit?: number;
|
|
128
|
+
offset?: number;
|
|
129
|
+
}): Promise<Json[]>;
|
|
130
|
+
get(groupId: string): Promise<Json>;
|
|
131
|
+
create(name: string, description?: string): Promise<Json>;
|
|
132
|
+
update(groupId: string, patch: {
|
|
133
|
+
name?: string;
|
|
134
|
+
description?: string;
|
|
135
|
+
}): Promise<Json>;
|
|
136
|
+
delete(groupId: string): Promise<void>;
|
|
137
|
+
listMembers(groupId: string): Promise<Json[]>;
|
|
138
|
+
addMember(groupId: string, userId: string): Promise<Json>;
|
|
139
|
+
removeMember(groupId: string, userId: string): Promise<void>;
|
|
140
|
+
listForUser(userId: string): Promise<Json[]>;
|
|
141
|
+
}
|
|
142
|
+
declare class PermissionsResource {
|
|
143
|
+
private readonly t;
|
|
144
|
+
constructor(t: Transport);
|
|
145
|
+
list(resource?: string): Promise<Permission[]>;
|
|
146
|
+
}
|
|
147
|
+
declare class NavResource {
|
|
148
|
+
private readonly t;
|
|
149
|
+
constructor(t: Transport);
|
|
150
|
+
tree(asRoleId?: string): Promise<Json>;
|
|
151
|
+
}
|
|
152
|
+
/** `client.iam.*` — users, roles, groups, permissions, nav tree. */
|
|
153
|
+
declare class IamResource {
|
|
154
|
+
readonly users: UsersResource;
|
|
155
|
+
readonly roles: RolesResource;
|
|
156
|
+
readonly groups: GroupsResource;
|
|
157
|
+
readonly permissions: PermissionsResource;
|
|
158
|
+
readonly nav: NavResource;
|
|
159
|
+
constructor(t: Transport);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/** `client.osdk.*` — OSDK application token management (Governance → OSDK). */
|
|
163
|
+
declare class OsdkResource {
|
|
164
|
+
private readonly t;
|
|
165
|
+
constructor(t: Transport);
|
|
166
|
+
list(): Promise<OsdkToken[]>;
|
|
167
|
+
get(tokenId: string): Promise<OsdkToken>;
|
|
168
|
+
/** Returns the plaintext secret ONCE — stash it like any other secret. */
|
|
169
|
+
create(name: string, scopes: string[], expiresAt?: string): Promise<OsdkTokenWithSecret>;
|
|
170
|
+
rotate(tokenId: string): Promise<OsdkTokenWithSecret>;
|
|
171
|
+
revoke(tokenId: string): Promise<void>;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
interface OperatorTaskListOptions {
|
|
175
|
+
status?: string;
|
|
176
|
+
project_id?: string;
|
|
177
|
+
origin?: string;
|
|
178
|
+
mine?: boolean;
|
|
179
|
+
limit?: number;
|
|
180
|
+
}
|
|
181
|
+
interface OperatorTaskCreate {
|
|
182
|
+
prompt_text: string;
|
|
183
|
+
title?: string;
|
|
184
|
+
project_id?: string;
|
|
185
|
+
priority?: string;
|
|
186
|
+
parent_task_id?: string;
|
|
187
|
+
markings?: string[];
|
|
188
|
+
}
|
|
189
|
+
declare class OperatorTasksResource {
|
|
190
|
+
private readonly t;
|
|
191
|
+
constructor(t: Transport);
|
|
192
|
+
list(opts?: OperatorTaskListOptions): Promise<Json[]>;
|
|
193
|
+
get(taskId: string): Promise<Json>;
|
|
194
|
+
create(input: OperatorTaskCreate): Promise<Json>;
|
|
195
|
+
cancel(taskId: string): Promise<Json>;
|
|
196
|
+
retry(taskId: string): Promise<Json>;
|
|
197
|
+
reprioritize(taskId: string, priority: string): Promise<Json>;
|
|
198
|
+
}
|
|
199
|
+
/** `client.operator.*` — operator task queue (NL kanban). */
|
|
200
|
+
declare class OperatorResource {
|
|
201
|
+
readonly tasks: OperatorTasksResource;
|
|
202
|
+
constructor(t: Transport);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
declare class ObjectsResource {
|
|
206
|
+
private readonly t;
|
|
207
|
+
constructor(t: Transport);
|
|
208
|
+
get(objectId: string): Promise<Json>;
|
|
209
|
+
list(kind: string, opts?: {
|
|
210
|
+
limit?: number;
|
|
211
|
+
offset?: number;
|
|
212
|
+
q?: string;
|
|
213
|
+
}): Promise<Json[]>;
|
|
214
|
+
create(kind: string, properties: Json, name?: string): Promise<Json>;
|
|
215
|
+
createMany(kind: string, items: Json[], markings?: string[]): Promise<Json>;
|
|
216
|
+
delete(objectId: string): Promise<Json>;
|
|
217
|
+
bulkDelete(opts: {
|
|
218
|
+
object_ids?: string[];
|
|
219
|
+
kind?: string;
|
|
220
|
+
dry_run?: boolean;
|
|
221
|
+
confirm?: boolean;
|
|
222
|
+
expected_count?: number;
|
|
223
|
+
}): Promise<Json>;
|
|
224
|
+
links(objectId: string): Promise<Json[]>;
|
|
225
|
+
history(objectId: string): Promise<Json[]>;
|
|
226
|
+
queryTimeseries(objectId: string, propertyName: string, opts?: {
|
|
227
|
+
from_time?: string;
|
|
228
|
+
to_time?: string;
|
|
229
|
+
max_points?: number;
|
|
230
|
+
}): Promise<Json>;
|
|
231
|
+
appendTimeseries(objectId: string, propertyName: string, points: Json[]): Promise<Json>;
|
|
232
|
+
}
|
|
233
|
+
declare class GraphResource {
|
|
234
|
+
private readonly t;
|
|
235
|
+
constructor(t: Transport);
|
|
236
|
+
expand(seedId: string, opts?: {
|
|
237
|
+
depth?: number;
|
|
238
|
+
limit?: number;
|
|
239
|
+
}): Promise<Json>;
|
|
240
|
+
}
|
|
241
|
+
declare class ExplorerResource {
|
|
242
|
+
private readonly t;
|
|
243
|
+
constructor(t: Transport);
|
|
244
|
+
histogram(property: string, filters?: Json): Promise<Json[]>;
|
|
245
|
+
timeline(filters?: Json, bin?: string): Promise<Json[]>;
|
|
246
|
+
}
|
|
247
|
+
interface ObjectTypeWrite {
|
|
248
|
+
title_property: string;
|
|
249
|
+
properties: Json;
|
|
250
|
+
display_name?: string;
|
|
251
|
+
enforce?: boolean;
|
|
252
|
+
markings?: string[];
|
|
253
|
+
}
|
|
254
|
+
declare class ObjectTypesResource {
|
|
255
|
+
private readonly t;
|
|
256
|
+
constructor(t: Transport);
|
|
257
|
+
get(kind: string): Promise<Json>;
|
|
258
|
+
create(kind: string, input: ObjectTypeWrite): Promise<Json>;
|
|
259
|
+
update(kind: string, input: ObjectTypeWrite): Promise<Json>;
|
|
260
|
+
delete(kind: string): Promise<Json>;
|
|
261
|
+
}
|
|
262
|
+
declare class LinkTypesResource {
|
|
263
|
+
private readonly t;
|
|
264
|
+
constructor(t: Transport);
|
|
265
|
+
declare(input: {
|
|
266
|
+
source_kind: string;
|
|
267
|
+
target_kind: string;
|
|
268
|
+
relation: string;
|
|
269
|
+
cardinality: string;
|
|
270
|
+
inverse_label?: string;
|
|
271
|
+
}): Promise<Json>;
|
|
272
|
+
delete(edgeId: string): Promise<Json>;
|
|
273
|
+
}
|
|
274
|
+
/** `client.ontology.*` — objects, graph, explorer, object/link types, OSDK manifest. */
|
|
275
|
+
declare class OntologyResource {
|
|
276
|
+
private readonly t;
|
|
277
|
+
readonly objects: ObjectsResource;
|
|
278
|
+
readonly graph: GraphResource;
|
|
279
|
+
readonly explorer: ExplorerResource;
|
|
280
|
+
readonly objectTypes: ObjectTypesResource;
|
|
281
|
+
readonly linkTypes: LinkTypesResource;
|
|
282
|
+
constructor(t: Transport);
|
|
283
|
+
/** Shortcut — same as `objectTypes.get(kind)`. */
|
|
284
|
+
objectType(kind: string): Promise<Json>;
|
|
285
|
+
osdkManifest(): Promise<Json[]>;
|
|
286
|
+
osdkFunctions(): Promise<Json[]>;
|
|
287
|
+
osdkGenerate(lang?: string): Promise<Json>;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
declare class FlowsResource {
|
|
291
|
+
private readonly t;
|
|
292
|
+
constructor(t: Transport);
|
|
293
|
+
list(): Promise<Json[]>;
|
|
294
|
+
get(flowId: string): Promise<Json>;
|
|
295
|
+
runs(flowId: string): Promise<Json[]>;
|
|
296
|
+
patch(flowId: string, payload: Json): Promise<Json>;
|
|
297
|
+
run(flowId: string, dryRun?: boolean): Promise<Json>;
|
|
298
|
+
}
|
|
299
|
+
declare class AgentsResource {
|
|
300
|
+
private readonly t;
|
|
301
|
+
constructor(t: Transport);
|
|
302
|
+
list(): Promise<Json[]>;
|
|
303
|
+
get(agentId: string): Promise<Json>;
|
|
304
|
+
patch(agentId: string, config: Json): Promise<Json>;
|
|
305
|
+
manualRun(agentId: string): Promise<Json>;
|
|
306
|
+
runs(agentId: string): Promise<Json[]>;
|
|
307
|
+
}
|
|
308
|
+
declare class ModelsResource {
|
|
309
|
+
private readonly t;
|
|
310
|
+
constructor(t: Transport);
|
|
311
|
+
catalog(provider?: string): Promise<Json[]>;
|
|
312
|
+
defaults(): Promise<Json[]>;
|
|
313
|
+
setDefault(input: {
|
|
314
|
+
provider: string;
|
|
315
|
+
model: string;
|
|
316
|
+
purpose?: string;
|
|
317
|
+
provider_id?: string;
|
|
318
|
+
}): Promise<Json>;
|
|
319
|
+
}
|
|
320
|
+
declare class BudgetResource {
|
|
321
|
+
private readonly t;
|
|
322
|
+
constructor(t: Transport);
|
|
323
|
+
get(): Promise<Json>;
|
|
324
|
+
set(tokensPerMonth: number): Promise<Json>;
|
|
325
|
+
}
|
|
326
|
+
/** `client.aip.*` — flows, agents, model catalog/defaults, LLM budget. */
|
|
327
|
+
declare class AipResource {
|
|
328
|
+
readonly flows: FlowsResource;
|
|
329
|
+
readonly agents: AgentsResource;
|
|
330
|
+
readonly models: ModelsResource;
|
|
331
|
+
readonly budget: BudgetResource;
|
|
332
|
+
constructor(t: Transport);
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
interface FunctionCreate {
|
|
336
|
+
slug: string;
|
|
337
|
+
display_name: string;
|
|
338
|
+
source: string;
|
|
339
|
+
language?: string;
|
|
340
|
+
signature?: Json;
|
|
341
|
+
description?: string;
|
|
342
|
+
markings?: string[];
|
|
343
|
+
classification_level?: string;
|
|
344
|
+
project_id?: string;
|
|
345
|
+
strict_signature?: boolean;
|
|
346
|
+
allow_network?: boolean;
|
|
347
|
+
}
|
|
348
|
+
interface PullRequestCreate {
|
|
349
|
+
title: string;
|
|
350
|
+
proposed_source: string;
|
|
351
|
+
description?: string;
|
|
352
|
+
proposed_signature?: Json;
|
|
353
|
+
proposed_language?: string;
|
|
354
|
+
required_approvers?: number;
|
|
355
|
+
target_branch?: string;
|
|
356
|
+
}
|
|
357
|
+
/** `client.functions.*` — Code Functions (/platform/v26/functions). */
|
|
358
|
+
declare class FunctionsResource {
|
|
359
|
+
private readonly t;
|
|
360
|
+
constructor(t: Transport);
|
|
361
|
+
list(): Promise<Json[]>;
|
|
362
|
+
get(slug: string): Promise<Json>;
|
|
363
|
+
create(input: FunctionCreate): Promise<Json>;
|
|
364
|
+
invoke(slug: string, inputs?: Json, opts?: {
|
|
365
|
+
branch?: string;
|
|
366
|
+
draft?: boolean;
|
|
367
|
+
}): Promise<Json>;
|
|
368
|
+
tests(slug: string): Promise<Json[]>;
|
|
369
|
+
addTest(slug: string, name: string, inputs?: Json, expectedContains?: string): Promise<Json>;
|
|
370
|
+
runTest(slug: string, testId: string): Promise<Json>;
|
|
371
|
+
runTests(slug: string): Promise<Json>;
|
|
372
|
+
publish(slug: string, branch?: string): Promise<Json>;
|
|
373
|
+
versions(slug: string): Promise<Json[]>;
|
|
374
|
+
pullRequests(slug: string, status?: string): Promise<Json[]>;
|
|
375
|
+
openPullRequest(slug: string, input: PullRequestCreate): Promise<Json>;
|
|
376
|
+
updatePullRequest(slug: string, prId: string, patch: Json): Promise<Json>;
|
|
377
|
+
runPrCi(slug: string, prId: string): Promise<Json>;
|
|
378
|
+
reviewPullRequest(slug: string, prId: string, decision: string, comment?: string): Promise<Json>;
|
|
379
|
+
mergePullRequest(slug: string, prId: string): Promise<Json>;
|
|
380
|
+
}
|
|
381
|
+
/** `client.codeRepositories.*` — repos/branches around Code Functions. */
|
|
382
|
+
declare class CodeRepositoriesResource {
|
|
383
|
+
private readonly t;
|
|
384
|
+
constructor(t: Transport);
|
|
385
|
+
list(): Promise<Json[]>;
|
|
386
|
+
create(input: {
|
|
387
|
+
slug: string;
|
|
388
|
+
display_name: string;
|
|
389
|
+
description?: string;
|
|
390
|
+
default_branch?: string;
|
|
391
|
+
}): Promise<Json>;
|
|
392
|
+
branches(repoId: string): Promise<Json[]>;
|
|
393
|
+
createBranch(repoId: string, name: string, description?: string): Promise<Json>;
|
|
394
|
+
functions(repoId: string): Promise<Json[]>;
|
|
395
|
+
assignFunction(repoId: string, slug: string): Promise<Json>;
|
|
396
|
+
runCi(repoId: string): Promise<Json>;
|
|
397
|
+
mergeBranch(repoId: string, sourceBranch: string, into?: string): Promise<Json>;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
type TransactionKind = "SNAPSHOT" | "APPEND" | "UPDATE" | "DELETE";
|
|
401
|
+
/** `client.datasets.*` — datasets, branches, transactions, classification, markings. */
|
|
402
|
+
declare class DatasetsResource {
|
|
403
|
+
private readonly t;
|
|
404
|
+
constructor(t: Transport);
|
|
405
|
+
list(): Promise<Json[]>;
|
|
406
|
+
get(name: string): Promise<Json>;
|
|
407
|
+
sample(name: string, limit?: number): Promise<Json>;
|
|
408
|
+
listBranches(name: string): Promise<Json[]>;
|
|
409
|
+
createBranch(name: string, branchName: string, opts?: {
|
|
410
|
+
from_branch?: string;
|
|
411
|
+
from_asset_id?: string;
|
|
412
|
+
description?: string;
|
|
413
|
+
project_id?: string;
|
|
414
|
+
}): Promise<Json>;
|
|
415
|
+
deactivateBranch(name: string, branchName: string): Promise<Json>;
|
|
416
|
+
listTransactions(name: string, branch?: string): Promise<Json[]>;
|
|
417
|
+
beginTransaction(name: string, kind: TransactionKind, branch?: string): Promise<Json>;
|
|
418
|
+
commitTransaction(name: string, txId: string, inputPayload: Json): Promise<Json>;
|
|
419
|
+
abortTransaction(name: string, txId: string, reason?: string): Promise<Json>;
|
|
420
|
+
mergeFastForward(name: string, source: string, into: string): Promise<Json>;
|
|
421
|
+
/** 409 responses carry the conflict body in `AegisAPIError.payload`. */
|
|
422
|
+
mergeThreeWay(name: string, source: string, into: string, resolutions?: Json): Promise<Json>;
|
|
423
|
+
getClassification(name: string): Promise<Json>;
|
|
424
|
+
setClassification(name: string, patch: {
|
|
425
|
+
data_classification?: string;
|
|
426
|
+
file_classification?: string;
|
|
427
|
+
}): Promise<Json>;
|
|
428
|
+
listMarkings(name: string): Promise<Json[]>;
|
|
429
|
+
applyMarking(name: string, markingId: string): Promise<Json>;
|
|
430
|
+
removeMarking(name: string, markingId: string): Promise<void>;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
interface AegisClientOptions {
|
|
434
|
+
/** Root URL of the AEGIS deployment, e.g. `https://aegis.example.com`.
|
|
435
|
+
* Falls back to `process.env.AEGIS_API_URL`, then `http://localhost:8002`. */
|
|
436
|
+
baseUrl?: string;
|
|
437
|
+
/** Bearer token — a JWT (`eyJ…`) or an OSDK key (`osdk_…`).
|
|
438
|
+
* Falls back to `process.env.AEGIS_TOKEN`. Omit for `auth.login(...)` flows. */
|
|
439
|
+
token?: string;
|
|
440
|
+
/** Per-request timeout in milliseconds. Defaults to 15000. */
|
|
441
|
+
timeoutMs?: number;
|
|
442
|
+
/** Custom fetch implementation (tests, proxies, polyfills). */
|
|
443
|
+
fetch?: typeof globalThis.fetch;
|
|
444
|
+
}
|
|
445
|
+
declare class AegisClient implements Transport {
|
|
446
|
+
readonly baseUrl: string;
|
|
447
|
+
private _token;
|
|
448
|
+
private readonly timeoutMs;
|
|
449
|
+
private readonly _fetch;
|
|
450
|
+
readonly auth: AuthResource;
|
|
451
|
+
readonly iam: IamResource;
|
|
452
|
+
readonly osdk: OsdkResource;
|
|
453
|
+
readonly operator: OperatorResource;
|
|
454
|
+
readonly ontology: OntologyResource;
|
|
455
|
+
readonly aip: AipResource;
|
|
456
|
+
readonly functions: FunctionsResource;
|
|
457
|
+
readonly codeRepositories: CodeRepositoriesResource;
|
|
458
|
+
readonly datasets: DatasetsResource;
|
|
459
|
+
constructor(options?: AegisClientOptions);
|
|
460
|
+
/** Replace the active bearer token (or clear with `null`). */
|
|
461
|
+
setToken(token: string | null): void;
|
|
462
|
+
get token(): string | null;
|
|
463
|
+
/** Generic escape hatch — call any AEGIS endpoint not yet wrapped. */
|
|
464
|
+
request<T = unknown>(method: string, path: string, opts?: RequestOptions): Promise<T>;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
/**
|
|
468
|
+
* Exception hierarchy for the AEGIS SDK — mirrors `aegis.exceptions` in the
|
|
469
|
+
* Python SDK. Callers can catch the broad `AegisAPIError` or react to
|
|
470
|
+
* specific subclasses:
|
|
471
|
+
*
|
|
472
|
+
* ```ts
|
|
473
|
+
* try {
|
|
474
|
+
* await client.iam.users.list();
|
|
475
|
+
* } catch (err) {
|
|
476
|
+
* if (err instanceof PermissionDeniedError) console.log("missing perm:", err.detail);
|
|
477
|
+
* else if (err instanceof AegisAPIError) console.log(err.statusCode, err.detail);
|
|
478
|
+
* }
|
|
479
|
+
* ```
|
|
480
|
+
*/
|
|
481
|
+
declare class AegisAPIError extends Error {
|
|
482
|
+
readonly statusCode: number;
|
|
483
|
+
readonly detail: string;
|
|
484
|
+
readonly payload: unknown;
|
|
485
|
+
constructor(statusCode: number, detail?: string, payload?: unknown);
|
|
486
|
+
}
|
|
487
|
+
/** 401 — invalid / expired token, missing credentials, locked account. */
|
|
488
|
+
declare class AuthError extends AegisAPIError {
|
|
489
|
+
}
|
|
490
|
+
/** 403 — authenticated but lacks the permission for this call. */
|
|
491
|
+
declare class PermissionDeniedError extends AegisAPIError {
|
|
492
|
+
}
|
|
493
|
+
/** 404 — the addressed resource does not exist (or is hidden by tenant scope). */
|
|
494
|
+
declare class NotFoundError extends AegisAPIError {
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
export { AegisAPIError, AegisClient, type AegisClientOptions, AuthError, type DevMode, type FunctionCreate, type Json, type LoginOptions, NotFoundError, type ObjectTypeWrite, type OperatorTaskCreate, type OperatorTaskListOptions, type OsdkToken, type OsdkTokenWithSecret, type Permission, PermissionDeniedError, type PullRequestCreate, type QueryParams, type RequestOptions, type Role, type Tenant, type TokenPair, type TransactionKind, type Transport, type User, type WhoAmI };
|