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