@meetkai/mka1 0.49.18 → 0.51.2
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/README.md +239 -227
- package/bin/mcp-server.js +586 -54
- package/bin/mcp-server.js.map +23 -11
- package/dist/commonjs/funcs/servingTenantsGet.d.ts +19 -0
- package/dist/commonjs/funcs/servingTenantsGet.d.ts.map +1 -0
- package/dist/commonjs/funcs/servingTenantsGet.js +136 -0
- package/dist/commonjs/funcs/servingTenantsGet.js.map +1 -0
- package/dist/commonjs/funcs/servingTenantsList.d.ts +19 -0
- package/dist/commonjs/funcs/servingTenantsList.d.ts.map +1 -0
- package/dist/commonjs/funcs/servingTenantsList.js +135 -0
- package/dist/commonjs/funcs/servingTenantsList.js.map +1 -0
- package/dist/commonjs/funcs/servingTenantsSet.d.ts +19 -0
- package/dist/commonjs/funcs/servingTenantsSet.d.ts.map +1 -0
- package/dist/commonjs/funcs/servingTenantsSet.js +137 -0
- package/dist/commonjs/funcs/servingTenantsSet.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/lib/config.js.map +1 -1
- package/dist/commonjs/mcp-server/mcp-server.js +1 -1
- package/dist/commonjs/mcp-server/mcp-server.js.map +1 -1
- package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/server.js +7 -1
- package/dist/commonjs/mcp-server/server.js.map +1 -1
- package/dist/commonjs/mcp-server/tools/servingTenantsGet.d.ts +8 -0
- package/dist/commonjs/mcp-server/tools/servingTenantsGet.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/servingTenantsGet.js +64 -0
- package/dist/commonjs/mcp-server/tools/servingTenantsGet.js.map +1 -0
- package/dist/commonjs/mcp-server/tools/servingTenantsList.d.ts +8 -0
- package/dist/commonjs/mcp-server/tools/servingTenantsList.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/servingTenantsList.js +64 -0
- package/dist/commonjs/mcp-server/tools/servingTenantsList.js.map +1 -0
- package/dist/commonjs/mcp-server/tools/servingTenantsSet.d.ts +8 -0
- package/dist/commonjs/mcp-server/tools/servingTenantsSet.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/servingTenantsSet.js +64 -0
- package/dist/commonjs/mcp-server/tools/servingTenantsSet.js.map +1 -0
- package/dist/commonjs/models/components/evaldataset.d.ts +5 -0
- package/dist/commonjs/models/components/evaldataset.d.ts.map +1 -1
- package/dist/commonjs/models/components/evaldataset.js +4 -0
- package/dist/commonjs/models/components/evaldataset.js.map +1 -1
- package/dist/commonjs/models/components/evaltask.d.ts +7 -2
- package/dist/commonjs/models/components/evaltask.d.ts.map +1 -1
- package/dist/commonjs/models/components/evaltask.js +4 -2
- package/dist/commonjs/models/components/evaltask.js.map +1 -1
- package/dist/commonjs/models/components/evaltasktype.d.ts +1 -0
- package/dist/commonjs/models/components/evaltasktype.d.ts.map +1 -1
- package/dist/commonjs/models/components/evaltasktype.js +1 -0
- package/dist/commonjs/models/components/evaltasktype.js.map +1 -1
- package/dist/commonjs/models/components/index.d.ts +3 -0
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +3 -0
- package/dist/commonjs/models/components/index.js.map +1 -1
- package/dist/commonjs/models/components/pageservingtenant.d.ts +22 -0
- package/dist/commonjs/models/components/pageservingtenant.d.ts.map +1 -0
- package/dist/commonjs/models/components/pageservingtenant.js +72 -0
- package/dist/commonjs/models/components/pageservingtenant.js.map +1 -0
- package/dist/commonjs/models/components/servingtenant.d.ts +28 -0
- package/dist/commonjs/models/components/servingtenant.d.ts.map +1 -0
- package/dist/commonjs/models/components/servingtenant.js +81 -0
- package/dist/commonjs/models/components/servingtenant.js.map +1 -0
- package/dist/commonjs/models/components/servingtenantset.d.ts +20 -0
- package/dist/commonjs/models/components/servingtenantset.d.ts.map +1 -0
- package/dist/commonjs/models/components/servingtenantset.js +58 -0
- package/dist/commonjs/models/components/servingtenantset.js.map +1 -0
- package/dist/commonjs/models/operations/getservingtenant.d.ts +22 -0
- package/dist/commonjs/models/operations/getservingtenant.d.ts.map +1 -0
- package/dist/commonjs/models/operations/getservingtenant.js +71 -0
- package/dist/commonjs/models/operations/getservingtenant.js.map +1 -0
- package/dist/commonjs/models/operations/index.d.ts +3 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +3 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/operations/listservingtenants.d.ts +24 -0
- package/dist/commonjs/models/operations/listservingtenants.d.ts.map +1 -0
- package/dist/commonjs/models/operations/listservingtenants.js +71 -0
- package/dist/commonjs/models/operations/listservingtenants.js.map +1 -0
- package/dist/commonjs/models/operations/setservingtenant.d.ts +25 -0
- package/dist/commonjs/models/operations/setservingtenant.d.ts.map +1 -0
- package/dist/commonjs/models/operations/setservingtenant.js +76 -0
- package/dist/commonjs/models/operations/setservingtenant.js.map +1 -0
- package/dist/commonjs/react-query/index.d.ts +3 -0
- package/dist/commonjs/react-query/index.d.ts.map +1 -1
- package/dist/commonjs/react-query/index.js +3 -0
- package/dist/commonjs/react-query/index.js.map +1 -1
- package/dist/commonjs/react-query/servingTenantsGet.core.d.ts +15 -0
- package/dist/commonjs/react-query/servingTenantsGet.core.d.ts.map +1 -0
- package/dist/commonjs/react-query/servingTenantsGet.core.js +36 -0
- package/dist/commonjs/react-query/servingTenantsGet.core.js.map +1 -0
- package/dist/commonjs/react-query/servingTenantsGet.d.ts +39 -0
- package/dist/commonjs/react-query/servingTenantsGet.d.ts.map +1 -0
- package/dist/commonjs/react-query/servingTenantsGet.js +60 -0
- package/dist/commonjs/react-query/servingTenantsGet.js.map +1 -0
- package/dist/commonjs/react-query/servingTenantsList.core.d.ts +17 -0
- package/dist/commonjs/react-query/servingTenantsList.core.d.ts.map +1 -0
- package/dist/commonjs/react-query/servingTenantsList.core.js +38 -0
- package/dist/commonjs/react-query/servingTenantsList.core.js.map +1 -0
- package/dist/commonjs/react-query/servingTenantsList.d.ts +41 -0
- package/dist/commonjs/react-query/servingTenantsList.d.ts.map +1 -0
- package/dist/commonjs/react-query/servingTenantsList.js +60 -0
- package/dist/commonjs/react-query/servingTenantsList.js.map +1 -0
- package/dist/commonjs/react-query/servingTenantsSet.d.ts +30 -0
- package/dist/commonjs/react-query/servingTenantsSet.d.ts.map +1 -0
- package/dist/commonjs/react-query/servingTenantsSet.js +47 -0
- package/dist/commonjs/react-query/servingTenantsSet.js.map +1 -0
- package/dist/commonjs/sdk/serving.d.ts +3 -0
- package/dist/commonjs/sdk/serving.d.ts.map +1 -1
- package/dist/commonjs/sdk/serving.js +4 -0
- package/dist/commonjs/sdk/serving.js.map +1 -1
- package/dist/commonjs/sdk/tenants.d.ts +27 -0
- package/dist/commonjs/sdk/tenants.d.ts.map +1 -0
- package/dist/commonjs/sdk/tenants.js +42 -0
- package/dist/commonjs/sdk/tenants.js.map +1 -0
- package/dist/esm/funcs/servingTenantsGet.d.ts +19 -0
- package/dist/esm/funcs/servingTenantsGet.d.ts.map +1 -0
- package/dist/esm/funcs/servingTenantsGet.js +100 -0
- package/dist/esm/funcs/servingTenantsGet.js.map +1 -0
- package/dist/esm/funcs/servingTenantsList.d.ts +19 -0
- package/dist/esm/funcs/servingTenantsList.d.ts.map +1 -0
- package/dist/esm/funcs/servingTenantsList.js +99 -0
- package/dist/esm/funcs/servingTenantsList.js.map +1 -0
- package/dist/esm/funcs/servingTenantsSet.d.ts +19 -0
- package/dist/esm/funcs/servingTenantsSet.d.ts.map +1 -0
- package/dist/esm/funcs/servingTenantsSet.js +101 -0
- package/dist/esm/funcs/servingTenantsSet.js.map +1 -0
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/lib/config.js.map +1 -1
- package/dist/esm/mcp-server/mcp-server.js +1 -1
- package/dist/esm/mcp-server/mcp-server.js.map +1 -1
- package/dist/esm/mcp-server/server.d.ts.map +1 -1
- package/dist/esm/mcp-server/server.js +7 -1
- package/dist/esm/mcp-server/server.js.map +1 -1
- package/dist/esm/mcp-server/tools/servingTenantsGet.d.ts +8 -0
- package/dist/esm/mcp-server/tools/servingTenantsGet.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/servingTenantsGet.js +28 -0
- package/dist/esm/mcp-server/tools/servingTenantsGet.js.map +1 -0
- package/dist/esm/mcp-server/tools/servingTenantsList.d.ts +8 -0
- package/dist/esm/mcp-server/tools/servingTenantsList.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/servingTenantsList.js +28 -0
- package/dist/esm/mcp-server/tools/servingTenantsList.js.map +1 -0
- package/dist/esm/mcp-server/tools/servingTenantsSet.d.ts +8 -0
- package/dist/esm/mcp-server/tools/servingTenantsSet.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/servingTenantsSet.js +28 -0
- package/dist/esm/mcp-server/tools/servingTenantsSet.js.map +1 -0
- package/dist/esm/models/components/evaldataset.d.ts +5 -0
- package/dist/esm/models/components/evaldataset.d.ts.map +1 -1
- package/dist/esm/models/components/evaldataset.js +4 -0
- package/dist/esm/models/components/evaldataset.js.map +1 -1
- package/dist/esm/models/components/evaltask.d.ts +7 -2
- package/dist/esm/models/components/evaltask.d.ts.map +1 -1
- package/dist/esm/models/components/evaltask.js +4 -2
- package/dist/esm/models/components/evaltask.js.map +1 -1
- package/dist/esm/models/components/evaltasktype.d.ts +1 -0
- package/dist/esm/models/components/evaltasktype.d.ts.map +1 -1
- package/dist/esm/models/components/evaltasktype.js +1 -0
- package/dist/esm/models/components/evaltasktype.js.map +1 -1
- package/dist/esm/models/components/index.d.ts +3 -0
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +3 -0
- package/dist/esm/models/components/index.js.map +1 -1
- package/dist/esm/models/components/pageservingtenant.d.ts +22 -0
- package/dist/esm/models/components/pageservingtenant.d.ts.map +1 -0
- package/dist/esm/models/components/pageservingtenant.js +34 -0
- package/dist/esm/models/components/pageservingtenant.js.map +1 -0
- package/dist/esm/models/components/servingtenant.d.ts +28 -0
- package/dist/esm/models/components/servingtenant.d.ts.map +1 -0
- package/dist/esm/models/components/servingtenant.js +43 -0
- package/dist/esm/models/components/servingtenant.js.map +1 -0
- package/dist/esm/models/components/servingtenantset.d.ts +20 -0
- package/dist/esm/models/components/servingtenantset.d.ts.map +1 -0
- package/dist/esm/models/components/servingtenantset.js +20 -0
- package/dist/esm/models/components/servingtenantset.js.map +1 -0
- package/dist/esm/models/operations/getservingtenant.d.ts +22 -0
- package/dist/esm/models/operations/getservingtenant.d.ts.map +1 -0
- package/dist/esm/models/operations/getservingtenant.js +33 -0
- package/dist/esm/models/operations/getservingtenant.js.map +1 -0
- package/dist/esm/models/operations/index.d.ts +3 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +3 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/operations/listservingtenants.d.ts +24 -0
- package/dist/esm/models/operations/listservingtenants.d.ts.map +1 -0
- package/dist/esm/models/operations/listservingtenants.js +33 -0
- package/dist/esm/models/operations/listservingtenants.js.map +1 -0
- package/dist/esm/models/operations/setservingtenant.d.ts +25 -0
- package/dist/esm/models/operations/setservingtenant.d.ts.map +1 -0
- package/dist/esm/models/operations/setservingtenant.js +38 -0
- package/dist/esm/models/operations/setservingtenant.js.map +1 -0
- package/dist/esm/react-query/index.d.ts +3 -0
- package/dist/esm/react-query/index.d.ts.map +1 -1
- package/dist/esm/react-query/index.js +3 -0
- package/dist/esm/react-query/index.js.map +1 -1
- package/dist/esm/react-query/servingTenantsGet.core.d.ts +15 -0
- package/dist/esm/react-query/servingTenantsGet.core.d.ts.map +1 -0
- package/dist/esm/react-query/servingTenantsGet.core.js +31 -0
- package/dist/esm/react-query/servingTenantsGet.core.js.map +1 -0
- package/dist/esm/react-query/servingTenantsGet.d.ts +39 -0
- package/dist/esm/react-query/servingTenantsGet.d.ts.map +1 -0
- package/dist/esm/react-query/servingTenantsGet.js +50 -0
- package/dist/esm/react-query/servingTenantsGet.js.map +1 -0
- package/dist/esm/react-query/servingTenantsList.core.d.ts +17 -0
- package/dist/esm/react-query/servingTenantsList.core.d.ts.map +1 -0
- package/dist/esm/react-query/servingTenantsList.core.js +33 -0
- package/dist/esm/react-query/servingTenantsList.core.js.map +1 -0
- package/dist/esm/react-query/servingTenantsList.d.ts +41 -0
- package/dist/esm/react-query/servingTenantsList.d.ts.map +1 -0
- package/dist/esm/react-query/servingTenantsList.js +50 -0
- package/dist/esm/react-query/servingTenantsList.js.map +1 -0
- package/dist/esm/react-query/servingTenantsSet.d.ts +30 -0
- package/dist/esm/react-query/servingTenantsSet.d.ts.map +1 -0
- package/dist/esm/react-query/servingTenantsSet.js +42 -0
- package/dist/esm/react-query/servingTenantsSet.js.map +1 -0
- package/dist/esm/sdk/serving.d.ts +3 -0
- package/dist/esm/sdk/serving.d.ts.map +1 -1
- package/dist/esm/sdk/serving.js +4 -0
- package/dist/esm/sdk/serving.js.map +1 -1
- package/dist/esm/sdk/tenants.d.ts +27 -0
- package/dist/esm/sdk/tenants.d.ts.map +1 -0
- package/dist/esm/sdk/tenants.js +38 -0
- package/dist/esm/sdk/tenants.js.map +1 -0
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/servingTenantsGet.ts +196 -0
- package/src/funcs/servingTenantsList.ts +196 -0
- package/src/funcs/servingTenantsSet.ts +197 -0
- package/src/lib/config.ts +2 -2
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +7 -1
- package/src/mcp-server/tools/servingTenantsGet.ts +37 -0
- package/src/mcp-server/tools/servingTenantsList.ts +37 -0
- package/src/mcp-server/tools/servingTenantsSet.ts +37 -0
- package/src/models/components/evaldataset.ts +9 -0
- package/src/models/components/evaltask.ts +11 -4
- package/src/models/components/evaltasktype.ts +1 -0
- package/src/models/components/index.ts +3 -0
- package/src/models/components/pageservingtenant.ts +74 -0
- package/src/models/components/servingtenant.ts +85 -0
- package/src/models/components/servingtenantset.ts +54 -0
- package/src/models/operations/getservingtenant.ts +69 -0
- package/src/models/operations/index.ts +3 -0
- package/src/models/operations/listservingtenants.ts +71 -0
- package/src/models/operations/setservingtenant.ts +76 -0
- package/src/react-query/index.ts +3 -0
- package/src/react-query/servingTenantsGet.core.ts +76 -0
- package/src/react-query/servingTenantsGet.ts +141 -0
- package/src/react-query/servingTenantsList.core.ts +81 -0
- package/src/react-query/servingTenantsList.ts +148 -0
- package/src/react-query/servingTenantsSet.ts +112 -0
- package/src/sdk/serving.ts +6 -0
- package/src/sdk/tenants.ts +64 -0
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { SDKCore } from "../core.js";
|
|
6
|
+
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
8
|
+
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { compactMap } from "../lib/primitives.js";
|
|
10
|
+
import { safeParse } from "../lib/schemas.js";
|
|
11
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
12
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
13
|
+
import { pathToFunc } from "../lib/url.js";
|
|
14
|
+
import * as components from "../models/components/index.js";
|
|
15
|
+
import {
|
|
16
|
+
ConnectionError,
|
|
17
|
+
InvalidRequestError,
|
|
18
|
+
RequestAbortedError,
|
|
19
|
+
RequestTimeoutError,
|
|
20
|
+
UnexpectedClientError,
|
|
21
|
+
} from "../models/errors/httpclienterrors.js";
|
|
22
|
+
import * as errors from "../models/errors/index.js";
|
|
23
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
24
|
+
import { SDKError } from "../models/errors/sdkerror.js";
|
|
25
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
26
|
+
import * as operations from "../models/operations/index.js";
|
|
27
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
28
|
+
import { Result } from "../types/fp.js";
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Set serving tenant enablement
|
|
32
|
+
*
|
|
33
|
+
* @remarks
|
|
34
|
+
* Enable or disable serving for an organization and all of its teams. Disabling blocks product API access but does not stop existing workloads or callbacks. Cluster administrators only.
|
|
35
|
+
*/
|
|
36
|
+
export function servingTenantsSet(
|
|
37
|
+
client: SDKCore,
|
|
38
|
+
request: operations.SetServingTenantRequest,
|
|
39
|
+
options?: RequestOptions,
|
|
40
|
+
): APIPromise<
|
|
41
|
+
Result<
|
|
42
|
+
components.ServingTenant,
|
|
43
|
+
| errors.ServingError
|
|
44
|
+
| errors.ServingHTTPValidationError
|
|
45
|
+
| SDKError
|
|
46
|
+
| ResponseValidationError
|
|
47
|
+
| ConnectionError
|
|
48
|
+
| RequestAbortedError
|
|
49
|
+
| RequestTimeoutError
|
|
50
|
+
| InvalidRequestError
|
|
51
|
+
| UnexpectedClientError
|
|
52
|
+
| SDKValidationError
|
|
53
|
+
>
|
|
54
|
+
> {
|
|
55
|
+
return new APIPromise($do(
|
|
56
|
+
client,
|
|
57
|
+
request,
|
|
58
|
+
options,
|
|
59
|
+
));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
async function $do(
|
|
63
|
+
client: SDKCore,
|
|
64
|
+
request: operations.SetServingTenantRequest,
|
|
65
|
+
options?: RequestOptions,
|
|
66
|
+
): Promise<
|
|
67
|
+
[
|
|
68
|
+
Result<
|
|
69
|
+
components.ServingTenant,
|
|
70
|
+
| errors.ServingError
|
|
71
|
+
| errors.ServingHTTPValidationError
|
|
72
|
+
| SDKError
|
|
73
|
+
| ResponseValidationError
|
|
74
|
+
| ConnectionError
|
|
75
|
+
| RequestAbortedError
|
|
76
|
+
| RequestTimeoutError
|
|
77
|
+
| InvalidRequestError
|
|
78
|
+
| UnexpectedClientError
|
|
79
|
+
| SDKValidationError
|
|
80
|
+
>,
|
|
81
|
+
APICall,
|
|
82
|
+
]
|
|
83
|
+
> {
|
|
84
|
+
const parsed = safeParse(
|
|
85
|
+
request,
|
|
86
|
+
(value) => operations.SetServingTenantRequest$outboundSchema.parse(value),
|
|
87
|
+
"Input validation failed",
|
|
88
|
+
);
|
|
89
|
+
if (!parsed.ok) {
|
|
90
|
+
return [parsed, { status: "invalid" }];
|
|
91
|
+
}
|
|
92
|
+
const payload = parsed.value;
|
|
93
|
+
const body = encodeJSON("body", payload.ServingTenantSet, { explode: true });
|
|
94
|
+
|
|
95
|
+
const pathParams = {
|
|
96
|
+
org_id: encodeSimple("org_id", payload.org_id, {
|
|
97
|
+
explode: false,
|
|
98
|
+
charEncoding: "percent",
|
|
99
|
+
}),
|
|
100
|
+
};
|
|
101
|
+
const path = pathToFunc("/api/v1/serving/tenants/{org_id}")(pathParams);
|
|
102
|
+
|
|
103
|
+
const headers = new Headers(compactMap({
|
|
104
|
+
"Content-Type": "application/json",
|
|
105
|
+
Accept: "application/json",
|
|
106
|
+
"X-On-Behalf-Of": encodeSimple(
|
|
107
|
+
"X-On-Behalf-Of",
|
|
108
|
+
payload["X-On-Behalf-Of"],
|
|
109
|
+
{ explode: false, charEncoding: "none" },
|
|
110
|
+
),
|
|
111
|
+
}));
|
|
112
|
+
|
|
113
|
+
const secConfig = await extractSecurity(client._options.bearerAuth);
|
|
114
|
+
const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
|
|
115
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
116
|
+
|
|
117
|
+
const context = {
|
|
118
|
+
options: client._options,
|
|
119
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
120
|
+
operationID: "setServingTenant",
|
|
121
|
+
oAuth2Scopes: null,
|
|
122
|
+
|
|
123
|
+
resolvedSecurity: requestSecurity,
|
|
124
|
+
|
|
125
|
+
securitySource: client._options.bearerAuth,
|
|
126
|
+
retryConfig: options?.retries
|
|
127
|
+
|| client._options.retryConfig
|
|
128
|
+
|| {
|
|
129
|
+
strategy: "backoff",
|
|
130
|
+
backoff: {
|
|
131
|
+
initialInterval: 500,
|
|
132
|
+
maxInterval: 5000,
|
|
133
|
+
exponent: 1.5,
|
|
134
|
+
maxElapsedTime: 15000,
|
|
135
|
+
},
|
|
136
|
+
retryConnectionErrors: true,
|
|
137
|
+
}
|
|
138
|
+
|| { strategy: "none" },
|
|
139
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
const requestRes = client._createRequest(context, {
|
|
143
|
+
security: requestSecurity,
|
|
144
|
+
method: "PUT",
|
|
145
|
+
baseURL: options?.serverURL,
|
|
146
|
+
path: path,
|
|
147
|
+
headers: headers,
|
|
148
|
+
body: body,
|
|
149
|
+
userAgent: client._options.userAgent,
|
|
150
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
151
|
+
}, options);
|
|
152
|
+
if (!requestRes.ok) {
|
|
153
|
+
return [requestRes, { status: "invalid" }];
|
|
154
|
+
}
|
|
155
|
+
const req = requestRes.value;
|
|
156
|
+
|
|
157
|
+
const doResult = await client._do(req, {
|
|
158
|
+
context,
|
|
159
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
160
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
161
|
+
retryConfig: context.retryConfig,
|
|
162
|
+
retryCodes: context.retryCodes,
|
|
163
|
+
});
|
|
164
|
+
if (!doResult.ok) {
|
|
165
|
+
return [doResult, { status: "request-error", request: req }];
|
|
166
|
+
}
|
|
167
|
+
const response = doResult.value;
|
|
168
|
+
|
|
169
|
+
const responseFields = {
|
|
170
|
+
HttpMeta: { Response: response, Request: req },
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
const [result] = await M.match<
|
|
174
|
+
components.ServingTenant,
|
|
175
|
+
| errors.ServingError
|
|
176
|
+
| errors.ServingHTTPValidationError
|
|
177
|
+
| SDKError
|
|
178
|
+
| ResponseValidationError
|
|
179
|
+
| ConnectionError
|
|
180
|
+
| RequestAbortedError
|
|
181
|
+
| RequestTimeoutError
|
|
182
|
+
| InvalidRequestError
|
|
183
|
+
| UnexpectedClientError
|
|
184
|
+
| SDKValidationError
|
|
185
|
+
>(
|
|
186
|
+
M.json(200, components.ServingTenant$inboundSchema),
|
|
187
|
+
M.jsonErr(403, errors.ServingError$inboundSchema),
|
|
188
|
+
M.jsonErr(422, errors.ServingHTTPValidationError$inboundSchema),
|
|
189
|
+
M.fail([401, "4XX"]),
|
|
190
|
+
M.fail("5XX"),
|
|
191
|
+
)(response, req, { extraFields: responseFields });
|
|
192
|
+
if (!result.ok) {
|
|
193
|
+
return [result, { status: "complete", request: req, response }];
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
return [result, { status: "complete", request: req, response }];
|
|
197
|
+
}
|
package/src/lib/config.ts
CHANGED
|
@@ -65,7 +65,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
65
65
|
export const SDK_METADATA = {
|
|
66
66
|
language: "typescript",
|
|
67
67
|
openapiDocVersion: "1.1.0",
|
|
68
|
-
sdkVersion: "0.
|
|
68
|
+
sdkVersion: "0.51.2",
|
|
69
69
|
genVersion: "2.918.4",
|
|
70
|
-
userAgent: "speakeasy-sdk/typescript 0.
|
|
70
|
+
userAgent: "speakeasy-sdk/typescript 0.51.2 2.918.4 1.1.0 @meetkai/mka1",
|
|
71
71
|
} as const;
|
package/src/mcp-server/server.ts
CHANGED
|
@@ -330,6 +330,9 @@ import { tool$servingModelsRegister } from "./tools/servingModelsRegister.js";
|
|
|
330
330
|
import { tool$servingSecretsCreate } from "./tools/servingSecretsCreate.js";
|
|
331
331
|
import { tool$servingSecretsDelete } from "./tools/servingSecretsDelete.js";
|
|
332
332
|
import { tool$servingSecretsList } from "./tools/servingSecretsList.js";
|
|
333
|
+
import { tool$servingTenantsGet } from "./tools/servingTenantsGet.js";
|
|
334
|
+
import { tool$servingTenantsList } from "./tools/servingTenantsList.js";
|
|
335
|
+
import { tool$servingTenantsSet } from "./tools/servingTenantsSet.js";
|
|
333
336
|
import { tool$servingVolumesCreate } from "./tools/servingVolumesCreate.js";
|
|
334
337
|
import { tool$servingVolumesDelete } from "./tools/servingVolumesDelete.js";
|
|
335
338
|
import { tool$servingVolumesGet } from "./tools/servingVolumesGet.js";
|
|
@@ -347,7 +350,7 @@ export function createMCPServer(deps: {
|
|
|
347
350
|
}) {
|
|
348
351
|
const server = new McpServer({
|
|
349
352
|
name: "SDK",
|
|
350
|
-
version: "0.
|
|
353
|
+
version: "0.51.2",
|
|
351
354
|
});
|
|
352
355
|
|
|
353
356
|
const client = new SDKCore({
|
|
@@ -696,6 +699,9 @@ export function createMCPServer(deps: {
|
|
|
696
699
|
tool(tool$servingSecretsList);
|
|
697
700
|
tool(tool$servingSecretsCreate);
|
|
698
701
|
tool(tool$servingSecretsDelete);
|
|
702
|
+
tool(tool$servingTenantsList);
|
|
703
|
+
tool(tool$servingTenantsGet);
|
|
704
|
+
tool(tool$servingTenantsSet);
|
|
699
705
|
tool(tool$servingVolumesList);
|
|
700
706
|
tool(tool$servingVolumesCreate);
|
|
701
707
|
tool(tool$servingVolumesDelete);
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { servingTenantsGet } from "../../funcs/servingTenantsGet.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.GetServingTenantRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$servingTenantsGet: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "serving-tenants-get",
|
|
15
|
+
description: `Get a serving tenant
|
|
16
|
+
|
|
17
|
+
Get one organization's serving enablement record. Cluster administrators only.`,
|
|
18
|
+
args,
|
|
19
|
+
tool: async (client, args, ctx) => {
|
|
20
|
+
const [result, apiCall] = await servingTenantsGet(
|
|
21
|
+
client,
|
|
22
|
+
args.request,
|
|
23
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
24
|
+
).$inspect();
|
|
25
|
+
|
|
26
|
+
if (!result.ok) {
|
|
27
|
+
return {
|
|
28
|
+
content: [{ type: "text", text: result.error.message }],
|
|
29
|
+
isError: true,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const value = result.value;
|
|
34
|
+
|
|
35
|
+
return formatResult(value, apiCall);
|
|
36
|
+
},
|
|
37
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { servingTenantsList } from "../../funcs/servingTenantsList.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.ListServingTenantsRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$servingTenantsList: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "serving-tenants-list",
|
|
15
|
+
description: `List serving tenants
|
|
16
|
+
|
|
17
|
+
List organization-wide serving enablement records. Cluster administrators only; a missing organization is not provisioned.`,
|
|
18
|
+
args,
|
|
19
|
+
tool: async (client, args, ctx) => {
|
|
20
|
+
const [result, apiCall] = await servingTenantsList(
|
|
21
|
+
client,
|
|
22
|
+
args.request,
|
|
23
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
24
|
+
).$inspect();
|
|
25
|
+
|
|
26
|
+
if (!result.ok) {
|
|
27
|
+
return {
|
|
28
|
+
content: [{ type: "text", text: result.error.message }],
|
|
29
|
+
isError: true,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const value = result.value;
|
|
34
|
+
|
|
35
|
+
return formatResult(value, apiCall);
|
|
36
|
+
},
|
|
37
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { servingTenantsSet } from "../../funcs/servingTenantsSet.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.SetServingTenantRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$servingTenantsSet: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "serving-tenants-set",
|
|
15
|
+
description: `Set serving tenant enablement
|
|
16
|
+
|
|
17
|
+
Enable or disable serving for an organization and all of its teams. Disabling blocks product API access but does not stop existing workloads or callbacks. Cluster administrators only.`,
|
|
18
|
+
args,
|
|
19
|
+
tool: async (client, args, ctx) => {
|
|
20
|
+
const [result, apiCall] = await servingTenantsSet(
|
|
21
|
+
client,
|
|
22
|
+
args.request,
|
|
23
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
24
|
+
).$inspect();
|
|
25
|
+
|
|
26
|
+
if (!result.ok) {
|
|
27
|
+
return {
|
|
28
|
+
content: [{ type: "text", text: result.error.message }],
|
|
29
|
+
isError: true,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const value = result.value;
|
|
34
|
+
|
|
35
|
+
return formatResult(value, apiCall);
|
|
36
|
+
},
|
|
37
|
+
};
|
|
@@ -80,6 +80,10 @@ export type EvalDataset = {
|
|
|
80
80
|
* Optional safety cap for remote dataset loading.
|
|
81
81
|
*/
|
|
82
82
|
maxRows?: number | undefined;
|
|
83
|
+
/**
|
|
84
|
+
* Row column holding the audio input for transcription tasks (e.g. a Hugging Face Audio feature that resolves to a clip URL). Required for transcription tasks.
|
|
85
|
+
*/
|
|
86
|
+
audioColumn?: string | undefined;
|
|
83
87
|
};
|
|
84
88
|
|
|
85
89
|
/** @internal */
|
|
@@ -174,12 +178,14 @@ export const EvalDataset$inboundSchema: z.ZodType<
|
|
|
174
178
|
]).optional(),
|
|
175
179
|
dataset_kwargs: z.record(z.any()).optional(),
|
|
176
180
|
max_rows: z.number().int().optional(),
|
|
181
|
+
audio_column: z.string().optional(),
|
|
177
182
|
}).transform((v) => {
|
|
178
183
|
return remap$(v, {
|
|
179
184
|
"file_id": "fileId",
|
|
180
185
|
"data_files": "dataFiles",
|
|
181
186
|
"dataset_kwargs": "datasetKwargs",
|
|
182
187
|
"max_rows": "maxRows",
|
|
188
|
+
"audio_column": "audioColumn",
|
|
183
189
|
});
|
|
184
190
|
});
|
|
185
191
|
/** @internal */
|
|
@@ -198,6 +204,7 @@ export type EvalDataset$Outbound = {
|
|
|
198
204
|
| undefined;
|
|
199
205
|
dataset_kwargs?: { [k: string]: any } | undefined;
|
|
200
206
|
max_rows?: number | undefined;
|
|
207
|
+
audio_column?: string | undefined;
|
|
201
208
|
};
|
|
202
209
|
|
|
203
210
|
/** @internal */
|
|
@@ -220,12 +227,14 @@ export const EvalDataset$outboundSchema: z.ZodType<
|
|
|
220
227
|
]).optional(),
|
|
221
228
|
datasetKwargs: z.record(z.any()).optional(),
|
|
222
229
|
maxRows: z.number().int().optional(),
|
|
230
|
+
audioColumn: z.string().optional(),
|
|
223
231
|
}).transform((v) => {
|
|
224
232
|
return remap$(v, {
|
|
225
233
|
fileId: "file_id",
|
|
226
234
|
dataFiles: "data_files",
|
|
227
235
|
datasetKwargs: "dataset_kwargs",
|
|
228
236
|
maxRows: "max_rows",
|
|
237
|
+
audioColumn: "audio_column",
|
|
229
238
|
});
|
|
230
239
|
});
|
|
231
240
|
|
|
@@ -60,7 +60,7 @@ export type EvalTask = {
|
|
|
60
60
|
* Dataset backing an eval task.
|
|
61
61
|
*/
|
|
62
62
|
dataset: EvalDataset;
|
|
63
|
-
promptTemplate
|
|
63
|
+
promptTemplate?: string | undefined;
|
|
64
64
|
targetTemplate?: string | undefined;
|
|
65
65
|
choices?: Array<string> | undefined;
|
|
66
66
|
outputExtraction?: EvalOutputExtraction | undefined;
|
|
@@ -72,6 +72,10 @@ export type EvalTask = {
|
|
|
72
72
|
* lm-eval style alias for fewshot.count.
|
|
73
73
|
*/
|
|
74
74
|
numFewshot?: number | undefined;
|
|
75
|
+
/**
|
|
76
|
+
* BCP-47/ISO language hint passed to the transcription model for transcription tasks (e.g. "ur", "uk").
|
|
77
|
+
*/
|
|
78
|
+
language?: string | undefined;
|
|
75
79
|
metadata?: { [k: string]: any } | undefined;
|
|
76
80
|
};
|
|
77
81
|
|
|
@@ -85,7 +89,7 @@ export const EvalTask$inboundSchema: z.ZodType<
|
|
|
85
89
|
name: z.string().optional(),
|
|
86
90
|
type: EvalTaskType$inboundSchema,
|
|
87
91
|
dataset: EvalDataset$inboundSchema,
|
|
88
|
-
prompt_template: z.string(),
|
|
92
|
+
prompt_template: z.string().optional(),
|
|
89
93
|
target_template: z.string().optional(),
|
|
90
94
|
choices: z.array(z.string()).optional(),
|
|
91
95
|
output_extraction: EvalOutputExtraction$inboundSchema.optional(),
|
|
@@ -94,6 +98,7 @@ export const EvalTask$inboundSchema: z.ZodType<
|
|
|
94
98
|
preprocess: EvalPythonPreprocessor$inboundSchema.optional(),
|
|
95
99
|
fewshot: EvalFewshotConfig$inboundSchema.optional(),
|
|
96
100
|
num_fewshot: z.number().int().optional(),
|
|
101
|
+
language: z.string().optional(),
|
|
97
102
|
metadata: z.record(z.any()).optional(),
|
|
98
103
|
}).transform((v) => {
|
|
99
104
|
return remap$(v, {
|
|
@@ -109,7 +114,7 @@ export type EvalTask$Outbound = {
|
|
|
109
114
|
name?: string | undefined;
|
|
110
115
|
type: string;
|
|
111
116
|
dataset: EvalDataset$Outbound;
|
|
112
|
-
prompt_template
|
|
117
|
+
prompt_template?: string | undefined;
|
|
113
118
|
target_template?: string | undefined;
|
|
114
119
|
choices?: Array<string> | undefined;
|
|
115
120
|
output_extraction?: EvalOutputExtraction$Outbound | undefined;
|
|
@@ -118,6 +123,7 @@ export type EvalTask$Outbound = {
|
|
|
118
123
|
preprocess?: EvalPythonPreprocessor$Outbound | undefined;
|
|
119
124
|
fewshot?: EvalFewshotConfig$Outbound | undefined;
|
|
120
125
|
num_fewshot?: number | undefined;
|
|
126
|
+
language?: string | undefined;
|
|
121
127
|
metadata?: { [k: string]: any } | undefined;
|
|
122
128
|
};
|
|
123
129
|
|
|
@@ -131,7 +137,7 @@ export const EvalTask$outboundSchema: z.ZodType<
|
|
|
131
137
|
name: z.string().optional(),
|
|
132
138
|
type: EvalTaskType$outboundSchema,
|
|
133
139
|
dataset: EvalDataset$outboundSchema,
|
|
134
|
-
promptTemplate: z.string(),
|
|
140
|
+
promptTemplate: z.string().optional(),
|
|
135
141
|
targetTemplate: z.string().optional(),
|
|
136
142
|
choices: z.array(z.string()).optional(),
|
|
137
143
|
outputExtraction: EvalOutputExtraction$outboundSchema.optional(),
|
|
@@ -140,6 +146,7 @@ export const EvalTask$outboundSchema: z.ZodType<
|
|
|
140
146
|
preprocess: EvalPythonPreprocessor$outboundSchema.optional(),
|
|
141
147
|
fewshot: EvalFewshotConfig$outboundSchema.optional(),
|
|
142
148
|
numFewshot: z.number().int().optional(),
|
|
149
|
+
language: z.string().optional(),
|
|
143
150
|
metadata: z.record(z.any()).optional(),
|
|
144
151
|
}).transform((v) => {
|
|
145
152
|
return remap$(v, {
|
|
@@ -342,6 +342,7 @@ export * from "./pagemodel.js";
|
|
|
342
342
|
export * from "./pagereplica.js";
|
|
343
343
|
export * from "./pagerevision.js";
|
|
344
344
|
export * from "./pagesecret.js";
|
|
345
|
+
export * from "./pageservingtenant.js";
|
|
345
346
|
export * from "./pagevolume.js";
|
|
346
347
|
export * from "./pendingsafetycheck.js";
|
|
347
348
|
export * from "./preconfiguredskill.js";
|
|
@@ -469,6 +470,8 @@ export * from "./searchvectorstorerequest.js";
|
|
|
469
470
|
export * from "./secret.js";
|
|
470
471
|
export * from "./secretcreate.js";
|
|
471
472
|
export * from "./security.js";
|
|
473
|
+
export * from "./servingtenant.js";
|
|
474
|
+
export * from "./servingtenantset.js";
|
|
472
475
|
export * from "./servingvalidationerror.js";
|
|
473
476
|
export * from "./sessionkind.js";
|
|
474
477
|
export * from "./sessionrecord.js";
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
import {
|
|
11
|
+
ServingTenant,
|
|
12
|
+
ServingTenant$inboundSchema,
|
|
13
|
+
ServingTenant$Outbound,
|
|
14
|
+
ServingTenant$outboundSchema,
|
|
15
|
+
} from "./servingtenant.js";
|
|
16
|
+
|
|
17
|
+
export type PageServingTenant = {
|
|
18
|
+
data: Array<ServingTenant>;
|
|
19
|
+
nextCursor?: string | null | undefined;
|
|
20
|
+
total: number;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/** @internal */
|
|
24
|
+
export const PageServingTenant$inboundSchema: z.ZodType<
|
|
25
|
+
PageServingTenant,
|
|
26
|
+
z.ZodTypeDef,
|
|
27
|
+
unknown
|
|
28
|
+
> = z.object({
|
|
29
|
+
data: z.array(ServingTenant$inboundSchema),
|
|
30
|
+
next_cursor: z.nullable(z.string()).optional(),
|
|
31
|
+
total: z.number().int(),
|
|
32
|
+
}).transform((v) => {
|
|
33
|
+
return remap$(v, {
|
|
34
|
+
"next_cursor": "nextCursor",
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
/** @internal */
|
|
38
|
+
export type PageServingTenant$Outbound = {
|
|
39
|
+
data: Array<ServingTenant$Outbound>;
|
|
40
|
+
next_cursor?: string | null | undefined;
|
|
41
|
+
total: number;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/** @internal */
|
|
45
|
+
export const PageServingTenant$outboundSchema: z.ZodType<
|
|
46
|
+
PageServingTenant$Outbound,
|
|
47
|
+
z.ZodTypeDef,
|
|
48
|
+
PageServingTenant
|
|
49
|
+
> = z.object({
|
|
50
|
+
data: z.array(ServingTenant$outboundSchema),
|
|
51
|
+
nextCursor: z.nullable(z.string()).optional(),
|
|
52
|
+
total: z.number().int(),
|
|
53
|
+
}).transform((v) => {
|
|
54
|
+
return remap$(v, {
|
|
55
|
+
nextCursor: "next_cursor",
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
export function pageServingTenantToJSON(
|
|
60
|
+
pageServingTenant: PageServingTenant,
|
|
61
|
+
): string {
|
|
62
|
+
return JSON.stringify(
|
|
63
|
+
PageServingTenant$outboundSchema.parse(pageServingTenant),
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
export function pageServingTenantFromJSON(
|
|
67
|
+
jsonString: string,
|
|
68
|
+
): SafeParseResult<PageServingTenant, SDKValidationError> {
|
|
69
|
+
return safeParse(
|
|
70
|
+
jsonString,
|
|
71
|
+
(x) => PageServingTenant$inboundSchema.parse(JSON.parse(x)),
|
|
72
|
+
`Failed to parse 'PageServingTenant' from JSON`,
|
|
73
|
+
);
|
|
74
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Organization-wide serving enablement shared by every team in the organization.
|
|
13
|
+
*/
|
|
14
|
+
export type ServingTenant = {
|
|
15
|
+
disabledAt: Date | null;
|
|
16
|
+
enabled: boolean;
|
|
17
|
+
enabledAt: Date | null;
|
|
18
|
+
enabledBy: string | null;
|
|
19
|
+
orgId: string;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/** @internal */
|
|
23
|
+
export const ServingTenant$inboundSchema: z.ZodType<
|
|
24
|
+
ServingTenant,
|
|
25
|
+
z.ZodTypeDef,
|
|
26
|
+
unknown
|
|
27
|
+
> = z.object({
|
|
28
|
+
disabled_at: z.nullable(
|
|
29
|
+
z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
30
|
+
),
|
|
31
|
+
enabled: z.boolean(),
|
|
32
|
+
enabled_at: z.nullable(
|
|
33
|
+
z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
34
|
+
),
|
|
35
|
+
enabled_by: z.nullable(z.string()),
|
|
36
|
+
org_id: z.string(),
|
|
37
|
+
}).transform((v) => {
|
|
38
|
+
return remap$(v, {
|
|
39
|
+
"disabled_at": "disabledAt",
|
|
40
|
+
"enabled_at": "enabledAt",
|
|
41
|
+
"enabled_by": "enabledBy",
|
|
42
|
+
"org_id": "orgId",
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
/** @internal */
|
|
46
|
+
export type ServingTenant$Outbound = {
|
|
47
|
+
disabled_at: string | null;
|
|
48
|
+
enabled: boolean;
|
|
49
|
+
enabled_at: string | null;
|
|
50
|
+
enabled_by: string | null;
|
|
51
|
+
org_id: string;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/** @internal */
|
|
55
|
+
export const ServingTenant$outboundSchema: z.ZodType<
|
|
56
|
+
ServingTenant$Outbound,
|
|
57
|
+
z.ZodTypeDef,
|
|
58
|
+
ServingTenant
|
|
59
|
+
> = z.object({
|
|
60
|
+
disabledAt: z.nullable(z.date().transform(v => v.toISOString())),
|
|
61
|
+
enabled: z.boolean(),
|
|
62
|
+
enabledAt: z.nullable(z.date().transform(v => v.toISOString())),
|
|
63
|
+
enabledBy: z.nullable(z.string()),
|
|
64
|
+
orgId: z.string(),
|
|
65
|
+
}).transform((v) => {
|
|
66
|
+
return remap$(v, {
|
|
67
|
+
disabledAt: "disabled_at",
|
|
68
|
+
enabledAt: "enabled_at",
|
|
69
|
+
enabledBy: "enabled_by",
|
|
70
|
+
orgId: "org_id",
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
export function servingTenantToJSON(servingTenant: ServingTenant): string {
|
|
75
|
+
return JSON.stringify(ServingTenant$outboundSchema.parse(servingTenant));
|
|
76
|
+
}
|
|
77
|
+
export function servingTenantFromJSON(
|
|
78
|
+
jsonString: string,
|
|
79
|
+
): SafeParseResult<ServingTenant, SDKValidationError> {
|
|
80
|
+
return safeParse(
|
|
81
|
+
jsonString,
|
|
82
|
+
(x) => ServingTenant$inboundSchema.parse(JSON.parse(x)),
|
|
83
|
+
`Failed to parse 'ServingTenant' from JSON`,
|
|
84
|
+
);
|
|
85
|
+
}
|