@kindgi/client 0.1.4-rc.1 → 0.1.4-rc.3
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/dist/index.cjs +454 -257
- package/dist/index.d.cts +1730 -138
- package/dist/index.d.ts +1730 -138
- package/dist/index.js +454 -257
- package/package.json +7 -7
package/dist/index.cjs
CHANGED
|
@@ -16,7 +16,13 @@ function notYetWired(method, reason) {
|
|
|
16
16
|
reason
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
|
-
function fromWire(body) {
|
|
19
|
+
function fromWire(body, status) {
|
|
20
|
+
const error = classify(body, status);
|
|
21
|
+
if (error.code === "server") return error;
|
|
22
|
+
const code = body !== null && typeof body === "object" && typeof body.code === "string" ? body.code : void 0;
|
|
23
|
+
return code === void 0 ? error : { ...error, serverCode: code };
|
|
24
|
+
}
|
|
25
|
+
function classify(body, status) {
|
|
20
26
|
if (!body || typeof body !== "object") {
|
|
21
27
|
return {
|
|
22
28
|
code: "server",
|
|
@@ -46,11 +52,7 @@ function fromWire(body) {
|
|
|
46
52
|
return { code: "auth", message, reason: "forbidden" };
|
|
47
53
|
case "rate-limited":
|
|
48
54
|
case "rate-limit-exceeded":
|
|
49
|
-
return
|
|
50
|
-
code: "rate-limited",
|
|
51
|
-
message,
|
|
52
|
-
...typeof obj.retryAfterSeconds === "number" ? { retryAfterSeconds: obj.retryAfterSeconds } : {}
|
|
53
|
-
};
|
|
55
|
+
return rateLimited(message, obj);
|
|
54
56
|
case "not-found":
|
|
55
57
|
case "run-not-found":
|
|
56
58
|
case "agent-not-found":
|
|
@@ -73,27 +75,9 @@ function fromWire(body) {
|
|
|
73
75
|
case "provider-not-found":
|
|
74
76
|
case "capability-not-found":
|
|
75
77
|
case "token-not-found":
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
resource: {
|
|
80
|
-
kind: code.replace(/-not-found$/u, "") || "unknown",
|
|
81
|
-
id: readStringField(
|
|
82
|
-
details,
|
|
83
|
-
"agentId",
|
|
84
|
-
"toolId",
|
|
85
|
-
"runId",
|
|
86
|
-
"adapterId",
|
|
87
|
-
"userId",
|
|
88
|
-
"providerId",
|
|
89
|
-
"capabilityId",
|
|
90
|
-
"tokenId",
|
|
91
|
-
"factId",
|
|
92
|
-
"guardrailId",
|
|
93
|
-
"id"
|
|
94
|
-
) ?? "unknown"
|
|
95
|
-
}
|
|
96
|
-
};
|
|
78
|
+
case "agent-version-not-found":
|
|
79
|
+
case "promotion-not-found":
|
|
80
|
+
return notFound(code, message, details);
|
|
97
81
|
case "conflict":
|
|
98
82
|
case "already-terminal":
|
|
99
83
|
case "run-already-terminal":
|
|
@@ -110,6 +94,25 @@ function fromWire(body) {
|
|
|
110
94
|
case "slug-conflict":
|
|
111
95
|
case "project-default-already-exists":
|
|
112
96
|
case "registry-read-only":
|
|
97
|
+
case "policy-scope-taken":
|
|
98
|
+
case "policy-scope-changed":
|
|
99
|
+
case "nothing-to-roll-back":
|
|
100
|
+
case "not-pinned":
|
|
101
|
+
case "agent-version-live":
|
|
102
|
+
case "eval-suite-already-registered":
|
|
103
|
+
case "policy-already-registered":
|
|
104
|
+
case "mcp-endpoint-already-registered":
|
|
105
|
+
case "identity-provider-already-registered":
|
|
106
|
+
case "version-already-exists":
|
|
107
|
+
case "eval-run-already-terminal":
|
|
108
|
+
case "approval-already-decided":
|
|
109
|
+
case "judge-class-name-taken":
|
|
110
|
+
case "promotion-superseded":
|
|
111
|
+
case "gate-policy-already-registered":
|
|
112
|
+
case "gate-policy-scope-taken":
|
|
113
|
+
case "gate-policy-scope-changed":
|
|
114
|
+
case "gate-policy-scope-unpinned":
|
|
115
|
+
case "gate-policy-needs-pin":
|
|
113
116
|
return { code: "conflict", message, reason: code };
|
|
114
117
|
case "invalid-request":
|
|
115
118
|
case "validation-failed":
|
|
@@ -125,11 +128,8 @@ function fromWire(body) {
|
|
|
125
128
|
case "invalid-guardrail":
|
|
126
129
|
case "invalid-provider":
|
|
127
130
|
case "supervisor-header-missing":
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
message,
|
|
131
|
-
issues: obj.issues ?? details?.issues ?? []
|
|
132
|
-
};
|
|
131
|
+
case "scope-invalid":
|
|
132
|
+
return invalidRequest(message, obj, details);
|
|
133
133
|
case "guardrail-violation":
|
|
134
134
|
return {
|
|
135
135
|
code: "guardrail-violation",
|
|
@@ -137,6 +137,23 @@ function fromWire(body) {
|
|
|
137
137
|
violations: readGuardrailViolations(details?.violations),
|
|
138
138
|
evaluationErrors: readEvaluationErrors(details?.evaluationErrors)
|
|
139
139
|
};
|
|
140
|
+
default:
|
|
141
|
+
return byStatus(status, code, message, obj, details);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
function byStatus(status, code, message, obj, details) {
|
|
145
|
+
switch (status) {
|
|
146
|
+
case 404:
|
|
147
|
+
case 410:
|
|
148
|
+
return notFound(code, message, details);
|
|
149
|
+
case 400:
|
|
150
|
+
return invalidRequest(message, obj, details);
|
|
151
|
+
case 401:
|
|
152
|
+
return { code: "auth", message, reason: "unauthenticated" };
|
|
153
|
+
case 403:
|
|
154
|
+
return { code: "auth", message, reason: "forbidden" };
|
|
155
|
+
case 429:
|
|
156
|
+
return rateLimited(message, obj);
|
|
140
157
|
default:
|
|
141
158
|
return {
|
|
142
159
|
code: "server",
|
|
@@ -146,6 +163,43 @@ function fromWire(body) {
|
|
|
146
163
|
};
|
|
147
164
|
}
|
|
148
165
|
}
|
|
166
|
+
function notFound(code, message, details) {
|
|
167
|
+
return {
|
|
168
|
+
code: "not-found",
|
|
169
|
+
message,
|
|
170
|
+
resource: {
|
|
171
|
+
kind: code.replace(/-not-found$/u, "") || "unknown",
|
|
172
|
+
id: readStringField(
|
|
173
|
+
details,
|
|
174
|
+
"agentId",
|
|
175
|
+
"toolId",
|
|
176
|
+
"runId",
|
|
177
|
+
"adapterId",
|
|
178
|
+
"userId",
|
|
179
|
+
"providerId",
|
|
180
|
+
"capabilityId",
|
|
181
|
+
"tokenId",
|
|
182
|
+
"factId",
|
|
183
|
+
"guardrailId",
|
|
184
|
+
"id"
|
|
185
|
+
) ?? "unknown"
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
function invalidRequest(message, obj, details) {
|
|
190
|
+
return {
|
|
191
|
+
code: "invalid-request",
|
|
192
|
+
message,
|
|
193
|
+
issues: obj.issues ?? details?.issues ?? []
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
function rateLimited(message, obj) {
|
|
197
|
+
return {
|
|
198
|
+
code: "rate-limited",
|
|
199
|
+
message,
|
|
200
|
+
...typeof obj.retryAfterSeconds === "number" ? { retryAfterSeconds: obj.retryAfterSeconds } : {}
|
|
201
|
+
};
|
|
202
|
+
}
|
|
149
203
|
function readStringField(obj, ...keys) {
|
|
150
204
|
if (obj === void 0) return void 0;
|
|
151
205
|
for (const key of keys) {
|
|
@@ -195,6 +249,17 @@ var KindgiApiError = class extends Error {
|
|
|
195
249
|
}
|
|
196
250
|
};
|
|
197
251
|
|
|
252
|
+
// src/list-page.ts
|
|
253
|
+
function listPage(page) {
|
|
254
|
+
const result = {
|
|
255
|
+
data: page.data,
|
|
256
|
+
hasMore: page.hasMore,
|
|
257
|
+
...page.nextCursor !== void 0 && { nextCursor: page.nextCursor }
|
|
258
|
+
};
|
|
259
|
+
Object.defineProperty(result, "items", { get: () => result.data, enumerable: false });
|
|
260
|
+
return result;
|
|
261
|
+
}
|
|
262
|
+
|
|
198
263
|
// src/streaming.ts
|
|
199
264
|
async function* readSse(options) {
|
|
200
265
|
const fetchImpl = options.fetchImpl ?? fetch;
|
|
@@ -350,10 +415,7 @@ function makeAdaptersClient(transport) {
|
|
|
350
415
|
...filter?.status !== void 0 && { status: filter.status }
|
|
351
416
|
}
|
|
352
417
|
});
|
|
353
|
-
return
|
|
354
|
-
items: page.data,
|
|
355
|
-
...page.nextCursor !== void 0 && { nextCursor: page.nextCursor }
|
|
356
|
-
};
|
|
418
|
+
return listPage(page);
|
|
357
419
|
},
|
|
358
420
|
async get(adapterId) {
|
|
359
421
|
return transport.request({
|
|
@@ -410,6 +472,57 @@ function makeAdaptersClient(transport) {
|
|
|
410
472
|
// src/resources/agents.ts
|
|
411
473
|
function makeAgentsClient(transport) {
|
|
412
474
|
const seg = (s) => encodeURIComponent(s);
|
|
475
|
+
const versions = {
|
|
476
|
+
async list(agentId, filter) {
|
|
477
|
+
return transport.request({
|
|
478
|
+
method: "GET",
|
|
479
|
+
path: `/v1/agents/${seg(agentId)}/versions`,
|
|
480
|
+
query: {
|
|
481
|
+
...filter?.limit !== void 0 && { limit: filter.limit },
|
|
482
|
+
...filter?.cursor !== void 0 && { cursor: filter.cursor }
|
|
483
|
+
}
|
|
484
|
+
});
|
|
485
|
+
},
|
|
486
|
+
async get(agentId, version) {
|
|
487
|
+
return transport.request({
|
|
488
|
+
method: "GET",
|
|
489
|
+
path: `/v1/agents/${seg(agentId)}/versions/${seg(version)}`
|
|
490
|
+
});
|
|
491
|
+
},
|
|
492
|
+
async unregister(agentId, version, options) {
|
|
493
|
+
return transport.request({
|
|
494
|
+
method: "POST",
|
|
495
|
+
path: `/v1/agents/${seg(agentId)}/versions/${seg(version)}/unregister`,
|
|
496
|
+
...options?.idempotencyKey !== void 0 && {
|
|
497
|
+
idempotencyKey: options.idempotencyKey
|
|
498
|
+
}
|
|
499
|
+
});
|
|
500
|
+
},
|
|
501
|
+
async derive(agentId, input, options) {
|
|
502
|
+
return transport.request({
|
|
503
|
+
method: "POST",
|
|
504
|
+
path: `/v1/agents/${seg(agentId)}/versions`,
|
|
505
|
+
body: input,
|
|
506
|
+
...options?.idempotencyKey !== void 0 && {
|
|
507
|
+
idempotencyKey: options.idempotencyKey
|
|
508
|
+
}
|
|
509
|
+
});
|
|
510
|
+
},
|
|
511
|
+
async reinstate(agentId, version, options) {
|
|
512
|
+
const wire = await transport.request({
|
|
513
|
+
method: "POST",
|
|
514
|
+
path: `/v1/agents/${seg(agentId)}/versions/${seg(version)}/reinstate`,
|
|
515
|
+
...options?.idempotencyKey !== void 0 && {
|
|
516
|
+
idempotencyKey: options.idempotencyKey
|
|
517
|
+
}
|
|
518
|
+
});
|
|
519
|
+
return {
|
|
520
|
+
agentId: wire.agentId,
|
|
521
|
+
version: wire.version,
|
|
522
|
+
wasTombstoned: wire.wasTombstoned
|
|
523
|
+
};
|
|
524
|
+
}
|
|
525
|
+
};
|
|
413
526
|
return {
|
|
414
527
|
async define(spec, options) {
|
|
415
528
|
const result = await transport.request({
|
|
@@ -439,59 +552,106 @@ function makeAgentsClient(transport) {
|
|
|
439
552
|
path: `/v1/agents/${seg(agentId)}`
|
|
440
553
|
});
|
|
441
554
|
},
|
|
442
|
-
versions
|
|
443
|
-
|
|
555
|
+
versions,
|
|
556
|
+
reinstateVersion: (agentId, version, options) => versions.reinstate(agentId, version, options),
|
|
557
|
+
live: {
|
|
558
|
+
async resolve(agentId, where) {
|
|
444
559
|
return transport.request({
|
|
445
560
|
method: "GET",
|
|
446
|
-
path: `/v1/agents/${seg(agentId)}/
|
|
561
|
+
path: `/v1/agents/${seg(agentId)}/live`,
|
|
447
562
|
query: {
|
|
448
|
-
...
|
|
449
|
-
...
|
|
563
|
+
...where?.projectId !== void 0 && { projectId: where.projectId },
|
|
564
|
+
...where?.segments !== void 0 && { segment: where.segments.map(segmentParam) }
|
|
450
565
|
}
|
|
451
566
|
});
|
|
452
567
|
},
|
|
453
|
-
async
|
|
568
|
+
async list(agentId) {
|
|
454
569
|
return transport.request({
|
|
455
570
|
method: "GET",
|
|
456
|
-
path: `/v1/agents/${seg(agentId)}/versions
|
|
571
|
+
path: `/v1/agents/${seg(agentId)}/live-versions`
|
|
457
572
|
});
|
|
458
573
|
},
|
|
459
|
-
async
|
|
574
|
+
async rollback(agentId, input, options) {
|
|
460
575
|
return transport.request({
|
|
461
576
|
method: "POST",
|
|
462
|
-
path: `/v1/agents/${seg(agentId)}/
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
}
|
|
577
|
+
path: `/v1/agents/${seg(agentId)}/live/rollback`,
|
|
578
|
+
body: input,
|
|
579
|
+
...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
|
|
466
580
|
});
|
|
467
581
|
},
|
|
468
|
-
async
|
|
582
|
+
async unpin(agentId, input, options) {
|
|
469
583
|
return transport.request({
|
|
470
584
|
method: "POST",
|
|
471
|
-
path: `/v1/agents/${seg(agentId)}/
|
|
585
|
+
path: `/v1/agents/${seg(agentId)}/live/unpin`,
|
|
472
586
|
body: input,
|
|
473
|
-
...options?.idempotencyKey !== void 0 && {
|
|
474
|
-
|
|
587
|
+
...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
|
|
588
|
+
});
|
|
589
|
+
}
|
|
590
|
+
},
|
|
591
|
+
promotions: {
|
|
592
|
+
async create(agentId, input, options) {
|
|
593
|
+
return transport.request({
|
|
594
|
+
method: "POST",
|
|
595
|
+
path: `/v1/agents/${seg(agentId)}/promotions`,
|
|
596
|
+
body: input,
|
|
597
|
+
...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
|
|
598
|
+
});
|
|
599
|
+
},
|
|
600
|
+
async check(agentId, input) {
|
|
601
|
+
return transport.request({
|
|
602
|
+
method: "POST",
|
|
603
|
+
path: `/v1/agents/${seg(agentId)}/promotions/check`,
|
|
604
|
+
body: input
|
|
605
|
+
});
|
|
606
|
+
},
|
|
607
|
+
async list(agentId, filter) {
|
|
608
|
+
return transport.request({
|
|
609
|
+
method: "GET",
|
|
610
|
+
path: `/v1/agents/${seg(agentId)}/promotions`,
|
|
611
|
+
query: {
|
|
612
|
+
...filter?.scope !== void 0 && scopeQuery(filter.scope),
|
|
613
|
+
...filter?.limit !== void 0 && { limit: filter.limit },
|
|
614
|
+
...filter?.cursor !== void 0 && { cursor: filter.cursor }
|
|
475
615
|
}
|
|
476
616
|
});
|
|
617
|
+
},
|
|
618
|
+
async get(agentId, promotionId) {
|
|
619
|
+
return transport.request({
|
|
620
|
+
method: "GET",
|
|
621
|
+
path: `/v1/agents/${seg(agentId)}/promotions/${seg(promotionId)}`
|
|
622
|
+
});
|
|
477
623
|
}
|
|
478
624
|
},
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
return {
|
|
488
|
-
agentId: wire.agentId,
|
|
489
|
-
version: wire.version,
|
|
490
|
-
wasTombstoned: wire.wasTombstoned
|
|
491
|
-
};
|
|
625
|
+
gatePolicy: {
|
|
626
|
+
async resolve(agentId, scope) {
|
|
627
|
+
return transport.request({
|
|
628
|
+
method: "GET",
|
|
629
|
+
path: `/v1/agents/${seg(agentId)}/gate-policy`,
|
|
630
|
+
query: scopeQuery(scope)
|
|
631
|
+
});
|
|
632
|
+
}
|
|
492
633
|
}
|
|
493
634
|
};
|
|
494
635
|
}
|
|
636
|
+
function segmentParam(s) {
|
|
637
|
+
return `${s.key}:${s.value}`;
|
|
638
|
+
}
|
|
639
|
+
function scopeQuery(scope) {
|
|
640
|
+
switch (scope.kind) {
|
|
641
|
+
case "tenant":
|
|
642
|
+
return { scopeKind: "tenant" };
|
|
643
|
+
case "org":
|
|
644
|
+
return { scopeKind: "org", scopeId: scope.orgId };
|
|
645
|
+
case "project":
|
|
646
|
+
return { scopeKind: "project", scopeId: scope.projectId };
|
|
647
|
+
case "segment":
|
|
648
|
+
return {
|
|
649
|
+
scopeKind: "segment",
|
|
650
|
+
scopeId: scope.projectId,
|
|
651
|
+
segment: scope.path.map(segmentParam)
|
|
652
|
+
};
|
|
653
|
+
}
|
|
654
|
+
}
|
|
495
655
|
|
|
496
656
|
// src/scope-wire.ts
|
|
497
657
|
function scopeForBody(scope) {
|
|
@@ -537,15 +697,11 @@ function makeApprovalsClient(transport) {
|
|
|
537
697
|
...filter?.requiredRole !== void 0 && { requiredRole: filter.requiredRole },
|
|
538
698
|
...filter?.createdAfter !== void 0 && {
|
|
539
699
|
createdAfter: filter.createdAfter
|
|
540
|
-
}
|
|
700
|
+
},
|
|
701
|
+
...filter?.waitTokenIds !== void 0 && filter.waitTokenIds.length > 0 && { waitTokenId: filter.waitTokenIds }
|
|
541
702
|
}
|
|
542
703
|
});
|
|
543
|
-
return
|
|
544
|
-
items: page.data,
|
|
545
|
-
...page.nextCursor !== void 0 && {
|
|
546
|
-
nextCursor: page.nextCursor
|
|
547
|
-
}
|
|
548
|
-
};
|
|
704
|
+
return listPage(page);
|
|
549
705
|
},
|
|
550
706
|
async get(id) {
|
|
551
707
|
return transport.request({
|
|
@@ -613,12 +769,7 @@ function makeApprovalsClient(transport) {
|
|
|
613
769
|
...filter?.role !== void 0 && { role: filter.role }
|
|
614
770
|
}
|
|
615
771
|
});
|
|
616
|
-
return
|
|
617
|
-
items: page.data,
|
|
618
|
-
...page.nextCursor !== void 0 && {
|
|
619
|
-
nextCursor: page.nextCursor
|
|
620
|
-
}
|
|
621
|
-
};
|
|
772
|
+
return listPage(page);
|
|
622
773
|
},
|
|
623
774
|
async get(id) {
|
|
624
775
|
return transport.request({
|
|
@@ -719,12 +870,7 @@ function makeArtifactsClient(transport) {
|
|
|
719
870
|
...filter?.contentType !== void 0 && { contentType: filter.contentType }
|
|
720
871
|
}
|
|
721
872
|
});
|
|
722
|
-
return
|
|
723
|
-
items: page.data,
|
|
724
|
-
...page.nextCursor !== void 0 && {
|
|
725
|
-
nextCursor: page.nextCursor
|
|
726
|
-
}
|
|
727
|
-
};
|
|
873
|
+
return listPage(page);
|
|
728
874
|
},
|
|
729
875
|
async delete(blobId, options) {
|
|
730
876
|
return transport.request({
|
|
@@ -772,7 +918,8 @@ function makeAuditClient(transport) {
|
|
|
772
918
|
...filter?.outcome !== void 0 && { outcome: filter.outcome },
|
|
773
919
|
...filter?.runId !== void 0 && { runId: filter.runId },
|
|
774
920
|
...filter?.from !== void 0 && { from: filter.from },
|
|
775
|
-
...filter?.to !== void 0 && { to: filter.to }
|
|
921
|
+
...filter?.to !== void 0 && { to: filter.to },
|
|
922
|
+
...filter?.order !== void 0 && { order: filter.order }
|
|
776
923
|
}
|
|
777
924
|
});
|
|
778
925
|
}
|
|
@@ -786,10 +933,11 @@ function makeAuthClient(transport) {
|
|
|
786
933
|
return {
|
|
787
934
|
providers: {
|
|
788
935
|
async list() {
|
|
789
|
-
|
|
936
|
+
const page = await transport.request({
|
|
790
937
|
method: "GET",
|
|
791
938
|
path: "/v1/auth/providers"
|
|
792
939
|
});
|
|
940
|
+
return { ...page, hasMore: page.hasMore ?? false };
|
|
793
941
|
},
|
|
794
942
|
async register(input, options) {
|
|
795
943
|
return transport.request({
|
|
@@ -918,12 +1066,7 @@ function makeCapabilitiesClient(transport) {
|
|
|
918
1066
|
...filter?.feature !== void 0 && { feature: filter.feature }
|
|
919
1067
|
}
|
|
920
1068
|
});
|
|
921
|
-
return
|
|
922
|
-
items: page.data,
|
|
923
|
-
...page.nextCursor !== void 0 && {
|
|
924
|
-
nextCursor: page.nextCursor
|
|
925
|
-
}
|
|
926
|
-
};
|
|
1069
|
+
return listPage(page);
|
|
927
1070
|
},
|
|
928
1071
|
async get(capabilityId) {
|
|
929
1072
|
return transport.request({
|
|
@@ -950,12 +1093,7 @@ function makeCapabilitiesClient(transport) {
|
|
|
950
1093
|
...filter?.feature !== void 0 && { feature: filter.feature }
|
|
951
1094
|
}
|
|
952
1095
|
});
|
|
953
|
-
return
|
|
954
|
-
items: page.data,
|
|
955
|
-
...page.nextCursor !== void 0 && {
|
|
956
|
-
nextCursor: page.nextCursor
|
|
957
|
-
}
|
|
958
|
-
};
|
|
1096
|
+
return listPage(page);
|
|
959
1097
|
},
|
|
960
1098
|
async get(id) {
|
|
961
1099
|
return transport.request({
|
|
@@ -1085,13 +1223,11 @@ function makeConversationsClient(transport) {
|
|
|
1085
1223
|
...filter?.cursor !== void 0 && { cursor: filter.cursor },
|
|
1086
1224
|
...statusParam !== void 0 && { status: statusParam },
|
|
1087
1225
|
...filter?.scope !== void 0 && scopeToQuery(filter.scope),
|
|
1088
|
-
...filter?.agent !== void 0 && { agentId: filter.agent }
|
|
1226
|
+
...filter?.agent !== void 0 && { agentId: filter.agent },
|
|
1227
|
+
...filter?.replays !== void 0 && { replays: filter.replays }
|
|
1089
1228
|
}
|
|
1090
1229
|
});
|
|
1091
|
-
return
|
|
1092
|
-
items: page.data,
|
|
1093
|
-
...page.nextCursor !== void 0 && { nextCursor: page.nextCursor }
|
|
1094
|
-
};
|
|
1230
|
+
return listPage(page);
|
|
1095
1231
|
},
|
|
1096
1232
|
async close(id, options) {
|
|
1097
1233
|
return transport.request({
|
|
@@ -1112,10 +1248,7 @@ function makeConversationsClient(transport) {
|
|
|
1112
1248
|
...filter?.cursor !== void 0 && { cursor: filter.cursor }
|
|
1113
1249
|
}
|
|
1114
1250
|
});
|
|
1115
|
-
return
|
|
1116
|
-
items: page.data,
|
|
1117
|
-
...page.nextCursor !== void 0 && { nextCursor: page.nextCursor }
|
|
1118
|
-
};
|
|
1251
|
+
return listPage(page);
|
|
1119
1252
|
}
|
|
1120
1253
|
};
|
|
1121
1254
|
}
|
|
@@ -1157,12 +1290,7 @@ function makeCostClient(transport) {
|
|
|
1157
1290
|
...filterQuery(filter ?? {})
|
|
1158
1291
|
}
|
|
1159
1292
|
});
|
|
1160
|
-
return
|
|
1161
|
-
items: page.data,
|
|
1162
|
-
...page.nextCursor !== void 0 && {
|
|
1163
|
-
nextCursor: page.nextCursor
|
|
1164
|
-
}
|
|
1165
|
-
};
|
|
1293
|
+
return listPage(page);
|
|
1166
1294
|
},
|
|
1167
1295
|
async get(recordId, options) {
|
|
1168
1296
|
return transport.request({
|
|
@@ -1172,7 +1300,7 @@ function makeCostClient(transport) {
|
|
|
1172
1300
|
});
|
|
1173
1301
|
},
|
|
1174
1302
|
async summary(input) {
|
|
1175
|
-
const { from, to, groupBy, ...filter } = input;
|
|
1303
|
+
const { from, to, groupBy, limit, ...filter } = input;
|
|
1176
1304
|
return transport.request({
|
|
1177
1305
|
method: "GET",
|
|
1178
1306
|
path: "/v1/cost/aggregate",
|
|
@@ -1180,7 +1308,8 @@ function makeCostClient(transport) {
|
|
|
1180
1308
|
...filterQuery(filter),
|
|
1181
1309
|
from,
|
|
1182
1310
|
to,
|
|
1183
|
-
...groupBy !== void 0 && { groupBy: groupBy.join(",") }
|
|
1311
|
+
...groupBy !== void 0 && { groupBy: groupBy.join(",") },
|
|
1312
|
+
...limit !== void 0 && { limit }
|
|
1184
1313
|
}
|
|
1185
1314
|
});
|
|
1186
1315
|
}
|
|
@@ -1275,6 +1404,7 @@ function makeEnvClient(transport) {
|
|
|
1275
1404
|
});
|
|
1276
1405
|
return {
|
|
1277
1406
|
data: page.data,
|
|
1407
|
+
hasMore: page.hasMore ?? page.nextCursor !== void 0,
|
|
1278
1408
|
...page.nextCursor !== void 0 && {
|
|
1279
1409
|
nextCursor: page.nextCursor
|
|
1280
1410
|
}
|
|
@@ -1652,6 +1782,58 @@ function makeEventsClient(_transport) {
|
|
|
1652
1782
|
|
|
1653
1783
|
// src/resources/flows.ts
|
|
1654
1784
|
function makeFlowsClient(transport) {
|
|
1785
|
+
const list = async (id, filter) => {
|
|
1786
|
+
const page = await transport.request({
|
|
1787
|
+
method: "GET",
|
|
1788
|
+
path: `/v1/flows/${encodeURIComponent(id)}/versions`,
|
|
1789
|
+
query: {
|
|
1790
|
+
...filter?.limit !== void 0 && { limit: filter.limit },
|
|
1791
|
+
...filter?.cursor !== void 0 && { cursor: filter.cursor }
|
|
1792
|
+
}
|
|
1793
|
+
});
|
|
1794
|
+
return listPage(page);
|
|
1795
|
+
};
|
|
1796
|
+
const versions = Object.assign(
|
|
1797
|
+
(id, filter) => list(id, filter),
|
|
1798
|
+
{
|
|
1799
|
+
list,
|
|
1800
|
+
async get(id, version) {
|
|
1801
|
+
return transport.request({
|
|
1802
|
+
method: "GET",
|
|
1803
|
+
path: `/v1/flows/${encodeURIComponent(id)}/versions/${encodeURIComponent(version)}`
|
|
1804
|
+
});
|
|
1805
|
+
},
|
|
1806
|
+
async unregister(id, version, options) {
|
|
1807
|
+
const wire = await transport.request({
|
|
1808
|
+
method: "POST",
|
|
1809
|
+
path: `/v1/flows/${encodeURIComponent(id)}/versions/${encodeURIComponent(version)}/unregister`,
|
|
1810
|
+
body: {},
|
|
1811
|
+
...options?.idempotencyKey !== void 0 && {
|
|
1812
|
+
idempotencyKey: options.idempotencyKey
|
|
1813
|
+
}
|
|
1814
|
+
});
|
|
1815
|
+
return {
|
|
1816
|
+
flowId: wire.flowId,
|
|
1817
|
+
version: wire.version,
|
|
1818
|
+
unregistered: wire.unregistered
|
|
1819
|
+
};
|
|
1820
|
+
},
|
|
1821
|
+
async reinstate(id, version, options) {
|
|
1822
|
+
const wire = await transport.request({
|
|
1823
|
+
method: "POST",
|
|
1824
|
+
path: `/v1/flows/${encodeURIComponent(id)}/versions/${encodeURIComponent(version)}/reinstate`,
|
|
1825
|
+
...options?.idempotencyKey !== void 0 && {
|
|
1826
|
+
idempotencyKey: options.idempotencyKey
|
|
1827
|
+
}
|
|
1828
|
+
});
|
|
1829
|
+
return {
|
|
1830
|
+
flowId: wire.flowId,
|
|
1831
|
+
version: wire.version,
|
|
1832
|
+
wasTombstoned: wire.wasTombstoned
|
|
1833
|
+
};
|
|
1834
|
+
}
|
|
1835
|
+
}
|
|
1836
|
+
);
|
|
1655
1837
|
return {
|
|
1656
1838
|
async define(flow, options) {
|
|
1657
1839
|
const result = await transport.request({
|
|
@@ -1691,59 +1873,72 @@ function makeFlowsClient(transport) {
|
|
|
1691
1873
|
...filter?.name !== void 0 && { name: filter.name }
|
|
1692
1874
|
}
|
|
1693
1875
|
});
|
|
1694
|
-
return
|
|
1695
|
-
items: page.data,
|
|
1696
|
-
...page.nextCursor !== void 0 && {
|
|
1697
|
-
nextCursor: page.nextCursor
|
|
1698
|
-
}
|
|
1699
|
-
};
|
|
1876
|
+
return listPage(page);
|
|
1700
1877
|
},
|
|
1701
|
-
|
|
1702
|
-
|
|
1878
|
+
versions,
|
|
1879
|
+
getVersion: (id, version) => versions.get(id, version),
|
|
1880
|
+
async delete(id, version, options) {
|
|
1881
|
+
await versions.unregister(id, version, options);
|
|
1882
|
+
},
|
|
1883
|
+
reinstateVersion: (id, version, options) => versions.reinstate(id, version, options)
|
|
1884
|
+
};
|
|
1885
|
+
}
|
|
1886
|
+
|
|
1887
|
+
// src/resources/gate-policies.ts
|
|
1888
|
+
function makeGatePoliciesClient(transport) {
|
|
1889
|
+
const seg = (s) => encodeURIComponent(s);
|
|
1890
|
+
return {
|
|
1891
|
+
async list(filter) {
|
|
1892
|
+
return transport.request({
|
|
1703
1893
|
method: "GET",
|
|
1704
|
-
path:
|
|
1894
|
+
path: "/v1/gate-policies",
|
|
1705
1895
|
query: {
|
|
1896
|
+
...filter?.agentId !== void 0 && { agentId: filter.agentId },
|
|
1897
|
+
...filter?.scope !== void 0 && scopeQuery(filter.scope),
|
|
1706
1898
|
...filter?.limit !== void 0 && { limit: filter.limit },
|
|
1707
1899
|
...filter?.cursor !== void 0 && { cursor: filter.cursor }
|
|
1708
1900
|
}
|
|
1709
1901
|
});
|
|
1710
|
-
return {
|
|
1711
|
-
items: page.data,
|
|
1712
|
-
...page.nextCursor !== void 0 && {
|
|
1713
|
-
nextCursor: page.nextCursor
|
|
1714
|
-
}
|
|
1715
|
-
};
|
|
1716
1902
|
},
|
|
1717
|
-
async
|
|
1903
|
+
async get(policyId) {
|
|
1718
1904
|
return transport.request({
|
|
1719
1905
|
method: "GET",
|
|
1720
|
-
path: `/v1/
|
|
1906
|
+
path: `/v1/gate-policies/${seg(policyId)}`
|
|
1721
1907
|
});
|
|
1722
1908
|
},
|
|
1723
|
-
async
|
|
1724
|
-
|
|
1909
|
+
async publish(input, options) {
|
|
1910
|
+
return transport.request({
|
|
1725
1911
|
method: "POST",
|
|
1726
|
-
path:
|
|
1727
|
-
body:
|
|
1728
|
-
|
|
1729
|
-
...options?.idempotencyKey !== void 0 && {
|
|
1730
|
-
idempotencyKey: options.idempotencyKey
|
|
1731
|
-
}
|
|
1912
|
+
path: "/v1/gate-policies",
|
|
1913
|
+
body: input,
|
|
1914
|
+
...options?.idempotencyKey !== void 0 && { idempotencyKey: options.idempotencyKey }
|
|
1732
1915
|
});
|
|
1733
1916
|
},
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
}
|
|
1917
|
+
versions: {
|
|
1918
|
+
async list(policyId) {
|
|
1919
|
+
return transport.request({
|
|
1920
|
+
method: "GET",
|
|
1921
|
+
path: `/v1/gate-policies/${seg(policyId)}/versions`
|
|
1922
|
+
});
|
|
1923
|
+
},
|
|
1924
|
+
async get(policyId, version) {
|
|
1925
|
+
return transport.request({
|
|
1926
|
+
method: "GET",
|
|
1927
|
+
path: `/v1/gate-policies/${seg(policyId)}/versions/${seg(version)}`
|
|
1928
|
+
});
|
|
1929
|
+
},
|
|
1930
|
+
async unregister(policyId, version) {
|
|
1931
|
+
return transport.request({
|
|
1932
|
+
method: "POST",
|
|
1933
|
+
path: `/v1/gate-policies/${seg(policyId)}/versions/${seg(version)}/unregister`
|
|
1934
|
+
});
|
|
1935
|
+
},
|
|
1936
|
+
async reinstate(policyId, version) {
|
|
1937
|
+
return transport.request({
|
|
1938
|
+
method: "POST",
|
|
1939
|
+
path: `/v1/gate-policies/${seg(policyId)}/versions/${seg(version)}/reinstate`
|
|
1940
|
+
});
|
|
1941
|
+
}
|
|
1747
1942
|
}
|
|
1748
1943
|
};
|
|
1749
1944
|
}
|
|
@@ -1775,12 +1970,7 @@ function makeGuardrailsClient(transport) {
|
|
|
1775
1970
|
...filter?.name !== void 0 && { name: filter.name }
|
|
1776
1971
|
}
|
|
1777
1972
|
});
|
|
1778
|
-
return
|
|
1779
|
-
items: page.data,
|
|
1780
|
-
...page.nextCursor !== void 0 && {
|
|
1781
|
-
nextCursor: page.nextCursor
|
|
1782
|
-
}
|
|
1783
|
-
};
|
|
1973
|
+
return listPage(page);
|
|
1784
1974
|
},
|
|
1785
1975
|
async delete(id, options) {
|
|
1786
1976
|
return transport.request({
|
|
@@ -1863,7 +2053,7 @@ function makeIdentityClient(transport) {
|
|
|
1863
2053
|
}
|
|
1864
2054
|
|
|
1865
2055
|
// src/resources/judge-classes.ts
|
|
1866
|
-
function
|
|
2056
|
+
function scopeQuery2(scope) {
|
|
1867
2057
|
if (scope.kind === "tenant") return { scopeKind: "tenant" };
|
|
1868
2058
|
if (scope.kind === "project") return { scopeKind: "project", projectId: scope.projectId };
|
|
1869
2059
|
return { scopeKind: "agent", projectId: scope.projectId, agentId: scope.agentId };
|
|
@@ -1886,13 +2076,10 @@ function makeJudgeClassesClient(transport) {
|
|
|
1886
2076
|
query: {
|
|
1887
2077
|
...filter?.limit !== void 0 && { limit: filter.limit },
|
|
1888
2078
|
...filter?.cursor !== void 0 && { cursor: filter.cursor },
|
|
1889
|
-
...filter?.scope !== void 0 &&
|
|
2079
|
+
...filter?.scope !== void 0 && scopeQuery2(filter.scope)
|
|
1890
2080
|
}
|
|
1891
2081
|
});
|
|
1892
|
-
return
|
|
1893
|
-
items: page.data,
|
|
1894
|
-
...page.nextCursor !== void 0 && { nextCursor: page.nextCursor }
|
|
1895
|
-
};
|
|
2082
|
+
return listPage(page);
|
|
1896
2083
|
},
|
|
1897
2084
|
async get(judgeClassId) {
|
|
1898
2085
|
return transport.request({
|
|
@@ -1948,10 +2135,7 @@ function makeJudgmentsClient(transport) {
|
|
|
1948
2135
|
...filter?.scope !== void 0 && scopeToQuery(filter.scope)
|
|
1949
2136
|
}
|
|
1950
2137
|
});
|
|
1951
|
-
return
|
|
1952
|
-
items: page.data,
|
|
1953
|
-
...page.nextCursor !== void 0 && { nextCursor: page.nextCursor }
|
|
1954
|
-
};
|
|
2138
|
+
return listPage(page);
|
|
1955
2139
|
},
|
|
1956
2140
|
async get(judgmentId) {
|
|
1957
2141
|
return transport.request({
|
|
@@ -1985,12 +2169,7 @@ function makeMcpClient(transport) {
|
|
|
1985
2169
|
...filter?.transport !== void 0 && { transport: filter.transport }
|
|
1986
2170
|
}
|
|
1987
2171
|
});
|
|
1988
|
-
return
|
|
1989
|
-
items: page.data,
|
|
1990
|
-
...page.nextCursor !== void 0 && {
|
|
1991
|
-
nextCursor: page.nextCursor
|
|
1992
|
-
}
|
|
1993
|
-
};
|
|
2172
|
+
return listPage(page);
|
|
1994
2173
|
},
|
|
1995
2174
|
async register(input, options) {
|
|
1996
2175
|
const { scope, ...endpoint } = input;
|
|
@@ -2128,12 +2307,7 @@ function makeMemoryClient(transport) {
|
|
|
2128
2307
|
...filter?.scope !== void 0 && { scope: JSON.stringify(filter.scope) }
|
|
2129
2308
|
}
|
|
2130
2309
|
});
|
|
2131
|
-
return
|
|
2132
|
-
items: page.data,
|
|
2133
|
-
...page.nextCursor !== void 0 && {
|
|
2134
|
-
nextCursor: page.nextCursor
|
|
2135
|
-
}
|
|
2136
|
-
};
|
|
2310
|
+
return listPage(page);
|
|
2137
2311
|
},
|
|
2138
2312
|
async delete(id, options) {
|
|
2139
2313
|
return transport.request({
|
|
@@ -2214,10 +2388,7 @@ function makeObservationsClient(transport) {
|
|
|
2214
2388
|
...filter?.until !== void 0 && { until: filter.until }
|
|
2215
2389
|
}
|
|
2216
2390
|
});
|
|
2217
|
-
return
|
|
2218
|
-
items: page.data,
|
|
2219
|
-
...page.nextCursor !== void 0 && { nextCursor: page.nextCursor }
|
|
2220
|
-
};
|
|
2391
|
+
return listPage(page);
|
|
2221
2392
|
},
|
|
2222
2393
|
async patterns(_input) {
|
|
2223
2394
|
throw new KindgiApiError(
|
|
@@ -2330,8 +2501,9 @@ function makePacksClient(_transport) {
|
|
|
2330
2501
|
|
|
2331
2502
|
// src/resources/policies.ts
|
|
2332
2503
|
function makePoliciesClient(transport) {
|
|
2333
|
-
|
|
2334
|
-
|
|
2504
|
+
const client = {
|
|
2505
|
+
author: (spec, options) => client.publish(spec, options),
|
|
2506
|
+
async publish(spec, options) {
|
|
2335
2507
|
const result = await transport.request({
|
|
2336
2508
|
method: "POST",
|
|
2337
2509
|
path: "/v1/policies",
|
|
@@ -2368,12 +2540,7 @@ function makePoliciesClient(transport) {
|
|
|
2368
2540
|
...filter?.name !== void 0 && { name: filter.name }
|
|
2369
2541
|
}
|
|
2370
2542
|
});
|
|
2371
|
-
return
|
|
2372
|
-
items: page.data,
|
|
2373
|
-
...page.nextCursor !== void 0 && {
|
|
2374
|
-
nextCursor: page.nextCursor
|
|
2375
|
-
}
|
|
2376
|
-
};
|
|
2543
|
+
return listPage(page);
|
|
2377
2544
|
},
|
|
2378
2545
|
async versions(id, filter) {
|
|
2379
2546
|
const page = await transport.request({
|
|
@@ -2385,12 +2552,7 @@ function makePoliciesClient(transport) {
|
|
|
2385
2552
|
...filter?.includeTombstoned === true && { includeTombstoned: "true" }
|
|
2386
2553
|
}
|
|
2387
2554
|
});
|
|
2388
|
-
return
|
|
2389
|
-
items: page.data,
|
|
2390
|
-
...page.nextCursor !== void 0 && {
|
|
2391
|
-
nextCursor: page.nextCursor
|
|
2392
|
-
}
|
|
2393
|
-
};
|
|
2555
|
+
return listPage(page);
|
|
2394
2556
|
},
|
|
2395
2557
|
async getVersion(id, version) {
|
|
2396
2558
|
return transport.request({
|
|
@@ -2440,6 +2602,7 @@ function makePoliciesClient(transport) {
|
|
|
2440
2602
|
);
|
|
2441
2603
|
}
|
|
2442
2604
|
};
|
|
2605
|
+
return client;
|
|
2443
2606
|
}
|
|
2444
2607
|
|
|
2445
2608
|
// src/resources/projects.ts
|
|
@@ -2557,10 +2720,7 @@ function makeProvenanceClient(transport) {
|
|
|
2557
2720
|
}
|
|
2558
2721
|
}
|
|
2559
2722
|
});
|
|
2560
|
-
return
|
|
2561
|
-
items: page.data,
|
|
2562
|
-
...page.nextCursor !== void 0 && { nextCursor: page.nextCursor }
|
|
2563
|
-
};
|
|
2723
|
+
return listPage(page);
|
|
2564
2724
|
},
|
|
2565
2725
|
async export(input) {
|
|
2566
2726
|
return transport.request({
|
|
@@ -2629,6 +2789,40 @@ function makeProvidersClient(transport) {
|
|
|
2629
2789
|
};
|
|
2630
2790
|
}
|
|
2631
2791
|
|
|
2792
|
+
// src/resources/retention.ts
|
|
2793
|
+
function makeRetentionClient(transport) {
|
|
2794
|
+
return {
|
|
2795
|
+
async scheduled(filter) {
|
|
2796
|
+
const page = await transport.request({
|
|
2797
|
+
method: "GET",
|
|
2798
|
+
path: "/v1/retention/scheduled",
|
|
2799
|
+
query: {
|
|
2800
|
+
...filter?.domain !== void 0 && { domain: filter.domain },
|
|
2801
|
+
...filter?.pastGraceOnly === true && { pastGraceOnly: "true" },
|
|
2802
|
+
...filter?.limit !== void 0 && { limit: filter.limit },
|
|
2803
|
+
...filter?.cursor !== void 0 && { cursor: filter.cursor }
|
|
2804
|
+
}
|
|
2805
|
+
});
|
|
2806
|
+
return { ...page, hasMore: page.hasMore ?? page.nextCursor !== void 0 };
|
|
2807
|
+
},
|
|
2808
|
+
async sweep(input) {
|
|
2809
|
+
const body = input?.maxPerDomain !== void 0 ? { maxPerDomain: input.maxPerDomain } : {};
|
|
2810
|
+
if (input?.domain !== void 0) {
|
|
2811
|
+
return transport.request({
|
|
2812
|
+
method: "POST",
|
|
2813
|
+
path: `/v1/retention/sweep/${encodeURIComponent(input.domain)}`,
|
|
2814
|
+
body
|
|
2815
|
+
});
|
|
2816
|
+
}
|
|
2817
|
+
return transport.request({
|
|
2818
|
+
method: "POST",
|
|
2819
|
+
path: "/v1/retention/sweep",
|
|
2820
|
+
body
|
|
2821
|
+
});
|
|
2822
|
+
}
|
|
2823
|
+
};
|
|
2824
|
+
}
|
|
2825
|
+
|
|
2632
2826
|
// src/run-follow.ts
|
|
2633
2827
|
var MAX_REFRESHES_IN_A_ROW = 3;
|
|
2634
2828
|
var TERMINAL_KINDS = /* @__PURE__ */ new Set([
|
|
@@ -2707,12 +2901,14 @@ function makeRunsClient(transport) {
|
|
|
2707
2901
|
agent: input.agent,
|
|
2708
2902
|
...input.agentVersion !== void 0 && { agentVersion: input.agentVersion },
|
|
2709
2903
|
...input.projectId !== void 0 && { projectId: input.projectId },
|
|
2904
|
+
...input.segments !== void 0 && { segments: input.segments },
|
|
2710
2905
|
input: input.input,
|
|
2711
2906
|
...input.options !== void 0 && { options: input.options }
|
|
2712
2907
|
} : {
|
|
2713
2908
|
flow: input.flow,
|
|
2714
2909
|
...input.flowVersion !== void 0 && { flowVersion: input.flowVersion },
|
|
2715
2910
|
...input.projectId !== void 0 && { projectId: input.projectId },
|
|
2911
|
+
...input.segments !== void 0 && { segments: input.segments },
|
|
2716
2912
|
input: input.input,
|
|
2717
2913
|
...input.options !== void 0 && { options: input.options }
|
|
2718
2914
|
};
|
|
@@ -2964,6 +3160,7 @@ function makeSecretsClient(transport) {
|
|
|
2964
3160
|
});
|
|
2965
3161
|
return {
|
|
2966
3162
|
data: page.data,
|
|
3163
|
+
hasMore: page.hasMore ?? page.nextCursor !== void 0,
|
|
2967
3164
|
...page.nextCursor !== void 0 && {
|
|
2968
3165
|
nextCursor: page.nextCursor
|
|
2969
3166
|
}
|
|
@@ -3018,6 +3215,7 @@ function makeSecretsClient(transport) {
|
|
|
3018
3215
|
});
|
|
3019
3216
|
return {
|
|
3020
3217
|
data: page.data,
|
|
3218
|
+
hasMore: page.hasMore ?? page.nextCursor !== void 0,
|
|
3021
3219
|
...page.nextCursor !== void 0 && {
|
|
3022
3220
|
nextCursor: page.nextCursor
|
|
3023
3221
|
}
|
|
@@ -3258,12 +3456,7 @@ function makeSupervisorClient(transport) {
|
|
|
3258
3456
|
...input.tier !== void 0 && { tier: input.tier }
|
|
3259
3457
|
}
|
|
3260
3458
|
});
|
|
3261
|
-
return
|
|
3262
|
-
items: page.data,
|
|
3263
|
-
...page.nextCursor !== void 0 && {
|
|
3264
|
-
nextCursor: page.nextCursor
|
|
3265
|
-
}
|
|
3266
|
-
};
|
|
3459
|
+
return listPage(page);
|
|
3267
3460
|
},
|
|
3268
3461
|
async get(supervisorId, id) {
|
|
3269
3462
|
return transport.request({
|
|
@@ -3501,10 +3694,7 @@ function makeTokensClient(transport) {
|
|
|
3501
3694
|
...filter?.cursor !== void 0 && { cursor: filter.cursor }
|
|
3502
3695
|
}
|
|
3503
3696
|
});
|
|
3504
|
-
return {
|
|
3505
|
-
items: page.data.map(fromWire2),
|
|
3506
|
-
...page.nextCursor !== void 0 && { nextCursor: page.nextCursor }
|
|
3507
|
-
};
|
|
3697
|
+
return listPage({ ...page, data: page.data.map(fromWire2) });
|
|
3508
3698
|
},
|
|
3509
3699
|
async get(id) {
|
|
3510
3700
|
const wire = await transport.request({
|
|
@@ -3539,29 +3729,8 @@ function makeTokensClient(transport) {
|
|
|
3539
3729
|
|
|
3540
3730
|
// src/resources/tools.ts
|
|
3541
3731
|
function makeToolsClient(transport) {
|
|
3542
|
-
|
|
3543
|
-
async list(filter) {
|
|
3544
|
-
const page = await transport.request({
|
|
3545
|
-
method: "GET",
|
|
3546
|
-
path: "/v1/tools",
|
|
3547
|
-
query: {
|
|
3548
|
-
...filter?.limit !== void 0 && { limit: filter.limit },
|
|
3549
|
-
...filter?.cursor !== void 0 && { cursor: filter.cursor },
|
|
3550
|
-
...filter?.name !== void 0 && { name: filter.name }
|
|
3551
|
-
}
|
|
3552
|
-
});
|
|
3553
|
-
return {
|
|
3554
|
-
items: page.data,
|
|
3555
|
-
...page.nextCursor !== void 0 && { nextCursor: page.nextCursor }
|
|
3556
|
-
};
|
|
3557
|
-
},
|
|
3558
|
-
async get(id) {
|
|
3559
|
-
return transport.request({
|
|
3560
|
-
method: "GET",
|
|
3561
|
-
path: `/v1/tools/${encodeURIComponent(id)}`
|
|
3562
|
-
});
|
|
3563
|
-
},
|
|
3564
|
-
async listVersions(id, filter) {
|
|
3732
|
+
const versions = {
|
|
3733
|
+
async list(id, filter) {
|
|
3565
3734
|
const page = await transport.request({
|
|
3566
3735
|
method: "GET",
|
|
3567
3736
|
path: `/v1/tools/${encodeURIComponent(id)}/versions`,
|
|
@@ -3571,18 +3740,15 @@ function makeToolsClient(transport) {
|
|
|
3571
3740
|
...filter?.includeTombstoned === true && { includeTombstoned: "true" }
|
|
3572
3741
|
}
|
|
3573
3742
|
});
|
|
3574
|
-
return
|
|
3575
|
-
items: page.data,
|
|
3576
|
-
...page.nextCursor !== void 0 && { nextCursor: page.nextCursor }
|
|
3577
|
-
};
|
|
3743
|
+
return listPage(page);
|
|
3578
3744
|
},
|
|
3579
|
-
async
|
|
3745
|
+
async get(id, version) {
|
|
3580
3746
|
return transport.request({
|
|
3581
3747
|
method: "GET",
|
|
3582
3748
|
path: `/v1/tools/${encodeURIComponent(id)}/versions/${encodeURIComponent(version)}`
|
|
3583
3749
|
});
|
|
3584
3750
|
},
|
|
3585
|
-
async
|
|
3751
|
+
async reinstate(id, version, options) {
|
|
3586
3752
|
const wire = await transport.request({
|
|
3587
3753
|
method: "POST",
|
|
3588
3754
|
path: `/v1/tools/${encodeURIComponent(id)}/versions/${encodeURIComponent(version)}/reinstate`,
|
|
@@ -3596,7 +3762,7 @@ function makeToolsClient(transport) {
|
|
|
3596
3762
|
wasTombstoned: wire.wasTombstoned
|
|
3597
3763
|
};
|
|
3598
3764
|
},
|
|
3599
|
-
async
|
|
3765
|
+
async unregister(id, version, options) {
|
|
3600
3766
|
const wire = await transport.request({
|
|
3601
3767
|
method: "POST",
|
|
3602
3768
|
path: `/v1/tools/${encodeURIComponent(id)}/versions/${encodeURIComponent(version)}/unregister`,
|
|
@@ -3609,7 +3775,43 @@ function makeToolsClient(transport) {
|
|
|
3609
3775
|
version: wire.version,
|
|
3610
3776
|
unregistered: wire.unregistered
|
|
3611
3777
|
};
|
|
3778
|
+
}
|
|
3779
|
+
};
|
|
3780
|
+
return {
|
|
3781
|
+
async list(filter) {
|
|
3782
|
+
const page = await transport.request({
|
|
3783
|
+
method: "GET",
|
|
3784
|
+
path: "/v1/tools",
|
|
3785
|
+
query: {
|
|
3786
|
+
...filter?.limit !== void 0 && { limit: filter.limit },
|
|
3787
|
+
...filter?.cursor !== void 0 && { cursor: filter.cursor },
|
|
3788
|
+
...filter?.name !== void 0 && { name: filter.name }
|
|
3789
|
+
}
|
|
3790
|
+
});
|
|
3791
|
+
return listPage(page);
|
|
3792
|
+
},
|
|
3793
|
+
async get(id) {
|
|
3794
|
+
return transport.request({
|
|
3795
|
+
method: "GET",
|
|
3796
|
+
path: `/v1/tools/${encodeURIComponent(id)}`
|
|
3797
|
+
});
|
|
3612
3798
|
},
|
|
3799
|
+
versions,
|
|
3800
|
+
async register(manifest, options) {
|
|
3801
|
+
const result = await transport.request({
|
|
3802
|
+
method: "POST",
|
|
3803
|
+
path: "/v1/tools",
|
|
3804
|
+
body: { ...manifest, projectId: options.projectId },
|
|
3805
|
+
...options.idempotencyKey !== void 0 && {
|
|
3806
|
+
idempotencyKey: options.idempotencyKey
|
|
3807
|
+
}
|
|
3808
|
+
});
|
|
3809
|
+
return { toolId: result.toolId };
|
|
3810
|
+
},
|
|
3811
|
+
listVersions: (id, filter) => versions.list(id, filter),
|
|
3812
|
+
getVersion: (id, version) => versions.get(id, version),
|
|
3813
|
+
reinstateVersion: (id, version, options) => versions.reinstate(id, version, options),
|
|
3814
|
+
unregisterVersion: (id, version, options) => versions.unregister(id, version, options),
|
|
3613
3815
|
async invoke(_id, _input) {
|
|
3614
3816
|
throw new KindgiApiError(
|
|
3615
3817
|
notYetWired(
|
|
@@ -3662,12 +3864,7 @@ function makeUsersClient(transport) {
|
|
|
3662
3864
|
...filter?.query !== void 0 && { query: filter.query }
|
|
3663
3865
|
}
|
|
3664
3866
|
});
|
|
3665
|
-
return
|
|
3666
|
-
items: page.data,
|
|
3667
|
-
...page.nextCursor !== void 0 && {
|
|
3668
|
-
nextCursor: page.nextCursor
|
|
3669
|
-
}
|
|
3670
|
-
};
|
|
3867
|
+
return listPage(page);
|
|
3671
3868
|
},
|
|
3672
3869
|
async update(_id, _patch) {
|
|
3673
3870
|
throw new KindgiApiError(
|
|
@@ -3691,12 +3888,7 @@ function makeUsersClient(transport) {
|
|
|
3691
3888
|
method: "GET",
|
|
3692
3889
|
path: `/v1/identity/users/${encodeURIComponent(userId)}/sessions`
|
|
3693
3890
|
});
|
|
3694
|
-
return
|
|
3695
|
-
items: page.data,
|
|
3696
|
-
...page.nextCursor !== void 0 && {
|
|
3697
|
-
nextCursor: page.nextCursor
|
|
3698
|
-
}
|
|
3699
|
-
};
|
|
3891
|
+
return listPage(page);
|
|
3700
3892
|
},
|
|
3701
3893
|
async revokeAll(userId, options) {
|
|
3702
3894
|
return transport.request({
|
|
@@ -3927,7 +4119,9 @@ function createTransport(options) {
|
|
|
3927
4119
|
} catch {
|
|
3928
4120
|
body = void 0;
|
|
3929
4121
|
}
|
|
3930
|
-
throw new KindgiApiError(
|
|
4122
|
+
throw new KindgiApiError(
|
|
4123
|
+
fromWire(unwrapErrorEnvelope(body, response.status), response.status)
|
|
4124
|
+
);
|
|
3931
4125
|
}
|
|
3932
4126
|
};
|
|
3933
4127
|
}
|
|
@@ -3939,7 +4133,8 @@ function buildUrl(apiUrl, path, query) {
|
|
|
3939
4133
|
for (const key of Object.keys(query)) {
|
|
3940
4134
|
const value = query[key];
|
|
3941
4135
|
if (value === void 0) continue;
|
|
3942
|
-
|
|
4136
|
+
const values = typeof value === "object" ? value : [String(value)];
|
|
4137
|
+
for (const v of values) params.push(`${encodeURIComponent(key)}=${encodeURIComponent(v)}`);
|
|
3943
4138
|
}
|
|
3944
4139
|
return params.length === 0 ? base : `${base}?${params.join("&")}`;
|
|
3945
4140
|
}
|
|
@@ -3997,6 +4192,8 @@ function createClient(options) {
|
|
|
3997
4192
|
adapters: makeAdaptersClient(transport),
|
|
3998
4193
|
providers: makeProvidersClient(transport),
|
|
3999
4194
|
policies: makePoliciesClient(transport),
|
|
4195
|
+
gatePolicies: makeGatePoliciesClient(transport),
|
|
4196
|
+
retention: makeRetentionClient(transport),
|
|
4000
4197
|
projects: makeProjectsClient(transport),
|
|
4001
4198
|
env: makeEnvClient(transport),
|
|
4002
4199
|
secrets: makeSecretsClient(transport),
|