@meetkai/mka1 0.51.12 → 0.51.14
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 +936 -433
- package/bin/mcp-server.js.map +24 -9
- package/dist/commonjs/funcs/servingEligibilityPreview.d.ts +19 -0
- package/dist/commonjs/funcs/servingEligibilityPreview.d.ts.map +1 -0
- package/dist/commonjs/funcs/servingEligibilityPreview.js +133 -0
- package/dist/commonjs/funcs/servingEligibilityPreview.js.map +1 -0
- package/dist/commonjs/funcs/servingSpendGet.d.ts +19 -0
- package/dist/commonjs/funcs/servingSpendGet.d.ts.map +1 -0
- package/dist/commonjs/funcs/servingSpendGet.js +135 -0
- package/dist/commonjs/funcs/servingSpendGet.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/mcp-server/mcp-server.js +1 -1
- package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/server.js +5 -1
- package/dist/commonjs/mcp-server/server.js.map +1 -1
- package/dist/commonjs/mcp-server/tools/servingEligibilityPreview.d.ts +8 -0
- package/dist/commonjs/mcp-server/tools/servingEligibilityPreview.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/servingEligibilityPreview.js +64 -0
- package/dist/commonjs/mcp-server/tools/servingEligibilityPreview.js.map +1 -0
- package/dist/commonjs/mcp-server/tools/servingSpendGet.d.ts +8 -0
- package/dist/commonjs/mcp-server/tools/servingSpendGet.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/servingSpendGet.js +64 -0
- package/dist/commonjs/mcp-server/tools/servingSpendGet.js.map +1 -0
- package/dist/commonjs/models/components/acceleratorpriceband.d.ts +22 -0
- package/dist/commonjs/models/components/acceleratorpriceband.d.ts.map +1 -0
- package/dist/commonjs/models/components/acceleratorpriceband.js +60 -0
- package/dist/commonjs/models/components/acceleratorpriceband.js.map +1 -0
- package/dist/commonjs/models/components/acceleratortype.d.ts +22 -0
- package/dist/commonjs/models/components/acceleratortype.d.ts.map +1 -1
- package/dist/commonjs/models/components/acceleratortype.js +14 -0
- package/dist/commonjs/models/components/acceleratortype.js.map +1 -1
- package/dist/commonjs/models/components/acquirability.d.ts +20 -0
- package/dist/commonjs/models/components/acquirability.d.ts.map +1 -0
- package/dist/commonjs/models/components/acquirability.js +54 -0
- package/dist/commonjs/models/components/acquirability.js.map +1 -0
- package/dist/commonjs/models/components/eligibilitypreview.d.ts +73 -0
- package/dist/commonjs/models/components/eligibilitypreview.d.ts.map +1 -0
- package/dist/commonjs/models/components/eligibilitypreview.js +99 -0
- package/dist/commonjs/models/components/eligibilitypreview.js.map +1 -0
- package/dist/commonjs/models/components/eligibilitypriceband.d.ts +24 -0
- package/dist/commonjs/models/components/eligibilitypriceband.d.ts.map +1 -0
- package/dist/commonjs/models/components/eligibilitypriceband.js +62 -0
- package/dist/commonjs/models/components/eligibilitypriceband.js.map +1 -0
- package/dist/commonjs/models/components/eligibilityrequest.d.ts +28 -0
- package/dist/commonjs/models/components/eligibilityrequest.d.ts.map +1 -0
- package/dist/commonjs/models/components/eligibilityrequest.js +59 -0
- package/dist/commonjs/models/components/eligibilityrequest.js.map +1 -0
- package/dist/commonjs/models/components/index.d.ts +9 -0
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +9 -0
- package/dist/commonjs/models/components/index.js.map +1 -1
- package/dist/commonjs/models/components/spendgroup.d.ts +29 -0
- package/dist/commonjs/models/components/spendgroup.d.ts.map +1 -0
- package/dist/commonjs/models/components/spendgroup.js +70 -0
- package/dist/commonjs/models/components/spendgroup.js.map +1 -0
- package/dist/commonjs/models/components/spenditem.d.ts +27 -0
- package/dist/commonjs/models/components/spenditem.d.ts.map +1 -0
- package/dist/commonjs/models/components/spenditem.js +62 -0
- package/dist/commonjs/models/components/spenditem.js.map +1 -0
- package/dist/commonjs/models/components/spendsummary.d.ts +40 -0
- package/dist/commonjs/models/components/spendsummary.d.ts.map +1 -0
- package/dist/commonjs/models/components/spendsummary.js +75 -0
- package/dist/commonjs/models/components/spendsummary.js.map +1 -0
- package/dist/commonjs/models/components/spendwindow.d.ts +25 -0
- package/dist/commonjs/models/components/spendwindow.d.ts.map +1 -0
- package/dist/commonjs/models/components/spendwindow.js +60 -0
- package/dist/commonjs/models/components/spendwindow.js.map +1 -0
- package/dist/commonjs/models/operations/getspend.d.ts +24 -0
- package/dist/commonjs/models/operations/getspend.d.ts.map +1 -0
- package/dist/commonjs/models/operations/getspend.js +71 -0
- package/dist/commonjs/models/operations/getspend.js.map +1 -0
- package/dist/commonjs/models/operations/index.d.ts +2 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +2 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/operations/previeweligibility.d.ts +23 -0
- package/dist/commonjs/models/operations/previeweligibility.d.ts.map +1 -0
- package/dist/commonjs/models/operations/previeweligibility.js +72 -0
- package/dist/commonjs/models/operations/previeweligibility.js.map +1 -0
- package/dist/commonjs/react-query/index.d.ts +2 -0
- package/dist/commonjs/react-query/index.d.ts.map +1 -1
- package/dist/commonjs/react-query/index.js +2 -0
- package/dist/commonjs/react-query/index.js.map +1 -1
- package/dist/commonjs/react-query/servingEligibilityPreview.d.ts +30 -0
- package/dist/commonjs/react-query/servingEligibilityPreview.d.ts.map +1 -0
- package/dist/commonjs/react-query/servingEligibilityPreview.js +47 -0
- package/dist/commonjs/react-query/servingEligibilityPreview.js.map +1 -0
- package/dist/commonjs/react-query/servingSpendGet.core.d.ts +17 -0
- package/dist/commonjs/react-query/servingSpendGet.core.d.ts.map +1 -0
- package/dist/commonjs/react-query/servingSpendGet.core.js +38 -0
- package/dist/commonjs/react-query/servingSpendGet.core.js.map +1 -0
- package/dist/commonjs/react-query/servingSpendGet.d.ts +41 -0
- package/dist/commonjs/react-query/servingSpendGet.d.ts.map +1 -0
- package/dist/commonjs/react-query/servingSpendGet.js +60 -0
- package/dist/commonjs/react-query/servingSpendGet.js.map +1 -0
- package/dist/commonjs/sdk/eligibility.d.ts +13 -0
- package/dist/commonjs/sdk/eligibility.d.ts.map +1 -0
- package/dist/commonjs/sdk/eligibility.js +22 -0
- package/dist/commonjs/sdk/eligibility.js.map +1 -0
- package/dist/commonjs/sdk/serving.d.ts +6 -0
- package/dist/commonjs/sdk/serving.d.ts.map +1 -1
- package/dist/commonjs/sdk/serving.js +8 -0
- package/dist/commonjs/sdk/serving.js.map +1 -1
- package/dist/commonjs/sdk/spend.d.ts +13 -0
- package/dist/commonjs/sdk/spend.d.ts.map +1 -0
- package/dist/commonjs/sdk/spend.js +22 -0
- package/dist/commonjs/sdk/spend.js.map +1 -0
- package/dist/esm/funcs/servingEligibilityPreview.d.ts +19 -0
- package/dist/esm/funcs/servingEligibilityPreview.d.ts.map +1 -0
- package/dist/esm/funcs/servingEligibilityPreview.js +97 -0
- package/dist/esm/funcs/servingEligibilityPreview.js.map +1 -0
- package/dist/esm/funcs/servingSpendGet.d.ts +19 -0
- package/dist/esm/funcs/servingSpendGet.d.ts.map +1 -0
- package/dist/esm/funcs/servingSpendGet.js +99 -0
- package/dist/esm/funcs/servingSpendGet.js.map +1 -0
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/mcp-server/mcp-server.js +1 -1
- package/dist/esm/mcp-server/server.d.ts.map +1 -1
- package/dist/esm/mcp-server/server.js +5 -1
- package/dist/esm/mcp-server/server.js.map +1 -1
- package/dist/esm/mcp-server/tools/servingEligibilityPreview.d.ts +8 -0
- package/dist/esm/mcp-server/tools/servingEligibilityPreview.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/servingEligibilityPreview.js +28 -0
- package/dist/esm/mcp-server/tools/servingEligibilityPreview.js.map +1 -0
- package/dist/esm/mcp-server/tools/servingSpendGet.d.ts +8 -0
- package/dist/esm/mcp-server/tools/servingSpendGet.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/servingSpendGet.js +28 -0
- package/dist/esm/mcp-server/tools/servingSpendGet.js.map +1 -0
- package/dist/esm/models/components/acceleratorpriceband.d.ts +22 -0
- package/dist/esm/models/components/acceleratorpriceband.d.ts.map +1 -0
- package/dist/esm/models/components/acceleratorpriceband.js +22 -0
- package/dist/esm/models/components/acceleratorpriceband.js.map +1 -0
- package/dist/esm/models/components/acceleratortype.d.ts +22 -0
- package/dist/esm/models/components/acceleratortype.d.ts.map +1 -1
- package/dist/esm/models/components/acceleratortype.js +14 -0
- package/dist/esm/models/components/acceleratortype.js.map +1 -1
- package/dist/esm/models/components/acquirability.d.ts +20 -0
- package/dist/esm/models/components/acquirability.d.ts.map +1 -0
- package/dist/esm/models/components/acquirability.js +18 -0
- package/dist/esm/models/components/acquirability.js.map +1 -0
- package/dist/esm/models/components/eligibilitypreview.d.ts +73 -0
- package/dist/esm/models/components/eligibilitypreview.d.ts.map +1 -0
- package/dist/esm/models/components/eligibilitypreview.js +61 -0
- package/dist/esm/models/components/eligibilitypreview.js.map +1 -0
- package/dist/esm/models/components/eligibilitypriceband.d.ts +24 -0
- package/dist/esm/models/components/eligibilitypriceband.d.ts.map +1 -0
- package/dist/esm/models/components/eligibilitypriceband.js +24 -0
- package/dist/esm/models/components/eligibilitypriceband.js.map +1 -0
- package/dist/esm/models/components/eligibilityrequest.d.ts +28 -0
- package/dist/esm/models/components/eligibilityrequest.d.ts.map +1 -0
- package/dist/esm/models/components/eligibilityrequest.js +21 -0
- package/dist/esm/models/components/eligibilityrequest.js.map +1 -0
- package/dist/esm/models/components/index.d.ts +9 -0
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +9 -0
- package/dist/esm/models/components/index.js.map +1 -1
- package/dist/esm/models/components/spendgroup.d.ts +29 -0
- package/dist/esm/models/components/spendgroup.d.ts.map +1 -0
- package/dist/esm/models/components/spendgroup.js +32 -0
- package/dist/esm/models/components/spendgroup.js.map +1 -0
- package/dist/esm/models/components/spenditem.d.ts +27 -0
- package/dist/esm/models/components/spenditem.d.ts.map +1 -0
- package/dist/esm/models/components/spenditem.js +24 -0
- package/dist/esm/models/components/spenditem.js.map +1 -0
- package/dist/esm/models/components/spendsummary.d.ts +40 -0
- package/dist/esm/models/components/spendsummary.d.ts.map +1 -0
- package/dist/esm/models/components/spendsummary.js +37 -0
- package/dist/esm/models/components/spendsummary.js.map +1 -0
- package/dist/esm/models/components/spendwindow.d.ts +25 -0
- package/dist/esm/models/components/spendwindow.d.ts.map +1 -0
- package/dist/esm/models/components/spendwindow.js +22 -0
- package/dist/esm/models/components/spendwindow.js.map +1 -0
- package/dist/esm/models/operations/getspend.d.ts +24 -0
- package/dist/esm/models/operations/getspend.d.ts.map +1 -0
- package/dist/esm/models/operations/getspend.js +33 -0
- package/dist/esm/models/operations/getspend.js.map +1 -0
- package/dist/esm/models/operations/index.d.ts +2 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +2 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/operations/previeweligibility.d.ts +23 -0
- package/dist/esm/models/operations/previeweligibility.d.ts.map +1 -0
- package/dist/esm/models/operations/previeweligibility.js +34 -0
- package/dist/esm/models/operations/previeweligibility.js.map +1 -0
- package/dist/esm/react-query/index.d.ts +2 -0
- package/dist/esm/react-query/index.d.ts.map +1 -1
- package/dist/esm/react-query/index.js +2 -0
- package/dist/esm/react-query/index.js.map +1 -1
- package/dist/esm/react-query/servingEligibilityPreview.d.ts +30 -0
- package/dist/esm/react-query/servingEligibilityPreview.d.ts.map +1 -0
- package/dist/esm/react-query/servingEligibilityPreview.js +42 -0
- package/dist/esm/react-query/servingEligibilityPreview.js.map +1 -0
- package/dist/esm/react-query/servingSpendGet.core.d.ts +17 -0
- package/dist/esm/react-query/servingSpendGet.core.d.ts.map +1 -0
- package/dist/esm/react-query/servingSpendGet.core.js +33 -0
- package/dist/esm/react-query/servingSpendGet.core.js.map +1 -0
- package/dist/esm/react-query/servingSpendGet.d.ts +41 -0
- package/dist/esm/react-query/servingSpendGet.d.ts.map +1 -0
- package/dist/esm/react-query/servingSpendGet.js +50 -0
- package/dist/esm/react-query/servingSpendGet.js.map +1 -0
- package/dist/esm/sdk/eligibility.d.ts +13 -0
- package/dist/esm/sdk/eligibility.d.ts.map +1 -0
- package/dist/esm/sdk/eligibility.js +18 -0
- package/dist/esm/sdk/eligibility.js.map +1 -0
- package/dist/esm/sdk/serving.d.ts +6 -0
- package/dist/esm/sdk/serving.d.ts.map +1 -1
- package/dist/esm/sdk/serving.js +8 -0
- package/dist/esm/sdk/serving.js.map +1 -1
- package/dist/esm/sdk/spend.d.ts +13 -0
- package/dist/esm/sdk/spend.d.ts.map +1 -0
- package/dist/esm/sdk/spend.js +18 -0
- package/dist/esm/sdk/spend.js.map +1 -0
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/servingEligibilityPreview.ts +193 -0
- package/src/funcs/servingSpendGet.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 +5 -1
- package/src/mcp-server/tools/servingEligibilityPreview.ts +37 -0
- package/src/mcp-server/tools/servingSpendGet.ts +37 -0
- package/src/models/components/acceleratorpriceband.ts +58 -0
- package/src/models/components/acceleratortype.ts +43 -0
- package/src/models/components/acquirability.ts +29 -0
- package/src/models/components/eligibilitypreview.ts +145 -0
- package/src/models/components/eligibilitypriceband.ts +62 -0
- package/src/models/components/eligibilityrequest.ts +67 -0
- package/src/models/components/index.ts +9 -0
- package/src/models/components/spendgroup.ts +75 -0
- package/src/models/components/spenditem.ts +61 -0
- package/src/models/components/spendsummary.ts +95 -0
- package/src/models/components/spendwindow.ts +59 -0
- package/src/models/operations/getspend.ts +73 -0
- package/src/models/operations/index.ts +2 -0
- package/src/models/operations/previeweligibility.ts +70 -0
- package/src/react-query/index.ts +2 -0
- package/src/react-query/servingEligibilityPreview.ts +113 -0
- package/src/react-query/servingSpendGet.core.ts +79 -0
- package/src/react-query/servingSpendGet.ts +145 -0
- package/src/sdk/eligibility.ts +28 -0
- package/src/sdk/serving.ts +12 -0
- package/src/sdk/spend.ts +28 -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 { encodeFormQuery, 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
|
+
* Cost and spend summary
|
|
32
|
+
*
|
|
33
|
+
* @remarks
|
|
34
|
+
* Aggregate spend for your organization, computed from retained compute ledgers as price × runtime overlap with the requested window. Spend is derived on read and is never stored.
|
|
35
|
+
*/
|
|
36
|
+
export function servingSpendGet(
|
|
37
|
+
client: SDKCore,
|
|
38
|
+
request: operations.GetSpendRequest,
|
|
39
|
+
options?: RequestOptions,
|
|
40
|
+
): APIPromise<
|
|
41
|
+
Result<
|
|
42
|
+
components.SpendSummary,
|
|
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.GetSpendRequest,
|
|
65
|
+
options?: RequestOptions,
|
|
66
|
+
): Promise<
|
|
67
|
+
[
|
|
68
|
+
Result<
|
|
69
|
+
components.SpendSummary,
|
|
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.GetSpendRequest$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 = null;
|
|
94
|
+
|
|
95
|
+
const path = pathToFunc("/api/v1/serving/spend")();
|
|
96
|
+
|
|
97
|
+
const query = encodeFormQuery({
|
|
98
|
+
"end": payload.end,
|
|
99
|
+
"start": payload.start,
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
const headers = new Headers(compactMap({
|
|
103
|
+
Accept: "application/json",
|
|
104
|
+
"X-On-Behalf-Of": encodeSimple(
|
|
105
|
+
"X-On-Behalf-Of",
|
|
106
|
+
payload["X-On-Behalf-Of"],
|
|
107
|
+
{ explode: false, charEncoding: "none" },
|
|
108
|
+
),
|
|
109
|
+
}));
|
|
110
|
+
|
|
111
|
+
const secConfig = await extractSecurity(client._options.bearerAuth);
|
|
112
|
+
const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
|
|
113
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
114
|
+
|
|
115
|
+
const context = {
|
|
116
|
+
options: client._options,
|
|
117
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
118
|
+
operationID: "getSpend",
|
|
119
|
+
oAuth2Scopes: null,
|
|
120
|
+
|
|
121
|
+
resolvedSecurity: requestSecurity,
|
|
122
|
+
|
|
123
|
+
securitySource: client._options.bearerAuth,
|
|
124
|
+
retryConfig: options?.retries
|
|
125
|
+
|| client._options.retryConfig
|
|
126
|
+
|| {
|
|
127
|
+
strategy: "backoff",
|
|
128
|
+
backoff: {
|
|
129
|
+
initialInterval: 500,
|
|
130
|
+
maxInterval: 5000,
|
|
131
|
+
exponent: 1.5,
|
|
132
|
+
maxElapsedTime: 15000,
|
|
133
|
+
},
|
|
134
|
+
retryConnectionErrors: true,
|
|
135
|
+
}
|
|
136
|
+
|| { strategy: "none" },
|
|
137
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
const requestRes = client._createRequest(context, {
|
|
141
|
+
security: requestSecurity,
|
|
142
|
+
method: "GET",
|
|
143
|
+
baseURL: options?.serverURL,
|
|
144
|
+
path: path,
|
|
145
|
+
headers: headers,
|
|
146
|
+
query: query,
|
|
147
|
+
body: body,
|
|
148
|
+
userAgent: client._options.userAgent,
|
|
149
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
150
|
+
}, options);
|
|
151
|
+
if (!requestRes.ok) {
|
|
152
|
+
return [requestRes, { status: "invalid" }];
|
|
153
|
+
}
|
|
154
|
+
const req = requestRes.value;
|
|
155
|
+
|
|
156
|
+
const doResult = await client._do(req, {
|
|
157
|
+
context,
|
|
158
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
159
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
160
|
+
retryConfig: context.retryConfig,
|
|
161
|
+
retryCodes: context.retryCodes,
|
|
162
|
+
});
|
|
163
|
+
if (!doResult.ok) {
|
|
164
|
+
return [doResult, { status: "request-error", request: req }];
|
|
165
|
+
}
|
|
166
|
+
const response = doResult.value;
|
|
167
|
+
|
|
168
|
+
const responseFields = {
|
|
169
|
+
HttpMeta: { Response: response, Request: req },
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
const [result] = await M.match<
|
|
173
|
+
components.SpendSummary,
|
|
174
|
+
| errors.ServingError
|
|
175
|
+
| errors.ServingHTTPValidationError
|
|
176
|
+
| SDKError
|
|
177
|
+
| ResponseValidationError
|
|
178
|
+
| ConnectionError
|
|
179
|
+
| RequestAbortedError
|
|
180
|
+
| RequestTimeoutError
|
|
181
|
+
| InvalidRequestError
|
|
182
|
+
| UnexpectedClientError
|
|
183
|
+
| SDKValidationError
|
|
184
|
+
>(
|
|
185
|
+
M.json(200, components.SpendSummary$inboundSchema),
|
|
186
|
+
M.jsonErr([401, 403], errors.ServingError$inboundSchema),
|
|
187
|
+
M.jsonErr(422, errors.ServingHTTPValidationError$inboundSchema),
|
|
188
|
+
M.jsonErr([500, 503], errors.ServingError$inboundSchema),
|
|
189
|
+
M.fail("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.51.
|
|
68
|
+
sdkVersion: "0.51.14",
|
|
69
69
|
genVersion: "2.918.4",
|
|
70
|
-
userAgent: "speakeasy-sdk/typescript 0.51.
|
|
70
|
+
userAgent: "speakeasy-sdk/typescript 0.51.14 2.918.4 1.1.0 @meetkai/mka1",
|
|
71
71
|
} as const;
|
package/src/mcp-server/server.ts
CHANGED
|
@@ -314,6 +314,7 @@ import { tool$servingDeploymentsRegister } from "./tools/servingDeploymentsRegis
|
|
|
314
314
|
import { tool$servingDeploymentsRollback } from "./tools/servingDeploymentsRollback.js";
|
|
315
315
|
import { tool$servingDeploymentsUpdate } from "./tools/servingDeploymentsUpdate.js";
|
|
316
316
|
import { tool$servingDeploymentsUpdateScaling } from "./tools/servingDeploymentsUpdateScaling.js";
|
|
317
|
+
import { tool$servingEligibilityPreview } from "./tools/servingEligibilityPreview.js";
|
|
317
318
|
import { tool$servingFinetuneJobsCancel } from "./tools/servingFinetuneJobsCancel.js";
|
|
318
319
|
import { tool$servingFinetuneJobsCreate } from "./tools/servingFinetuneJobsCreate.js";
|
|
319
320
|
import { tool$servingFinetuneJobsGet } from "./tools/servingFinetuneJobsGet.js";
|
|
@@ -338,6 +339,7 @@ import { tool$servingRecipesSetEnabled } from "./tools/servingRecipesSetEnabled.
|
|
|
338
339
|
import { tool$servingSecretsCreate } from "./tools/servingSecretsCreate.js";
|
|
339
340
|
import { tool$servingSecretsDelete } from "./tools/servingSecretsDelete.js";
|
|
340
341
|
import { tool$servingSecretsList } from "./tools/servingSecretsList.js";
|
|
342
|
+
import { tool$servingSpendGet } from "./tools/servingSpendGet.js";
|
|
341
343
|
import { tool$servingTenantsDeleteOrganization } from "./tools/servingTenantsDeleteOrganization.js";
|
|
342
344
|
import { tool$servingTenantsGet } from "./tools/servingTenantsGet.js";
|
|
343
345
|
import { tool$servingTenantsGetOrganizationDeletion } from "./tools/servingTenantsGetOrganizationDeletion.js";
|
|
@@ -360,7 +362,7 @@ export function createMCPServer(deps: {
|
|
|
360
362
|
}) {
|
|
361
363
|
const server = new McpServer({
|
|
362
364
|
name: "SDK",
|
|
363
|
-
version: "0.51.
|
|
365
|
+
version: "0.51.14",
|
|
364
366
|
});
|
|
365
367
|
|
|
366
368
|
const client = new SDKCore({
|
|
@@ -693,6 +695,7 @@ export function createMCPServer(deps: {
|
|
|
693
695
|
tool(tool$servingDeploymentsListRevisions);
|
|
694
696
|
tool(tool$servingDeploymentsRollback);
|
|
695
697
|
tool(tool$servingDeploymentsUpdateScaling);
|
|
698
|
+
tool(tool$servingEligibilityPreview);
|
|
696
699
|
tool(tool$servingFinetuneJobsList);
|
|
697
700
|
tool(tool$servingFinetuneJobsCreate);
|
|
698
701
|
tool(tool$servingFinetuneJobsCancel);
|
|
@@ -717,6 +720,7 @@ export function createMCPServer(deps: {
|
|
|
717
720
|
tool(tool$servingSecretsList);
|
|
718
721
|
tool(tool$servingSecretsCreate);
|
|
719
722
|
tool(tool$servingSecretsDelete);
|
|
723
|
+
tool(tool$servingSpendGet);
|
|
720
724
|
tool(tool$servingTenantsList);
|
|
721
725
|
tool(tool$servingTenantsGet);
|
|
722
726
|
tool(tool$servingTenantsSet);
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { servingEligibilityPreview } from "../../funcs/servingEligibilityPreview.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.PreviewEligibilityRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$servingEligibilityPreview: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "serving-eligibility-preview",
|
|
15
|
+
description: `Preview accelerator eligibility
|
|
16
|
+
|
|
17
|
+
Preview, before submitting a job or deployment, how much matching capacity the cluster can currently acquire and how likely it is to start. The response is provider-anonymous: counts, price bands, and advice only. This is an advisory read; it reserves nothing.`,
|
|
18
|
+
args,
|
|
19
|
+
tool: async (client, args, ctx) => {
|
|
20
|
+
const [result, apiCall] = await servingEligibilityPreview(
|
|
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 { servingSpendGet } from "../../funcs/servingSpendGet.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.GetSpendRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$servingSpendGet: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "serving-spend-get",
|
|
15
|
+
description: `Cost and spend summary
|
|
16
|
+
|
|
17
|
+
Aggregate spend for your organization, computed from retained compute ledgers as price × runtime overlap with the requested window. Spend is derived on read and is never stored.`,
|
|
18
|
+
args,
|
|
19
|
+
tool: async (client, args, ctx) => {
|
|
20
|
+
const [result, apiCall] = await servingSpendGet(
|
|
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,58 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* USD-per-hour price band across configurations acquirable now for an accelerator type.
|
|
12
|
+
*/
|
|
13
|
+
export type AcceleratorPriceBand = {
|
|
14
|
+
min: number;
|
|
15
|
+
p50: number;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
/** @internal */
|
|
19
|
+
export const AcceleratorPriceBand$inboundSchema: z.ZodType<
|
|
20
|
+
AcceleratorPriceBand,
|
|
21
|
+
z.ZodTypeDef,
|
|
22
|
+
unknown
|
|
23
|
+
> = z.object({
|
|
24
|
+
min: z.number(),
|
|
25
|
+
p50: z.number(),
|
|
26
|
+
});
|
|
27
|
+
/** @internal */
|
|
28
|
+
export type AcceleratorPriceBand$Outbound = {
|
|
29
|
+
min: number;
|
|
30
|
+
p50: number;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/** @internal */
|
|
34
|
+
export const AcceleratorPriceBand$outboundSchema: z.ZodType<
|
|
35
|
+
AcceleratorPriceBand$Outbound,
|
|
36
|
+
z.ZodTypeDef,
|
|
37
|
+
AcceleratorPriceBand
|
|
38
|
+
> = z.object({
|
|
39
|
+
min: z.number(),
|
|
40
|
+
p50: z.number(),
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
export function acceleratorPriceBandToJSON(
|
|
44
|
+
acceleratorPriceBand: AcceleratorPriceBand,
|
|
45
|
+
): string {
|
|
46
|
+
return JSON.stringify(
|
|
47
|
+
AcceleratorPriceBand$outboundSchema.parse(acceleratorPriceBand),
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
export function acceleratorPriceBandFromJSON(
|
|
51
|
+
jsonString: string,
|
|
52
|
+
): SafeParseResult<AcceleratorPriceBand, SDKValidationError> {
|
|
53
|
+
return safeParse(
|
|
54
|
+
jsonString,
|
|
55
|
+
(x) => AcceleratorPriceBand$inboundSchema.parse(JSON.parse(x)),
|
|
56
|
+
`Failed to parse 'AcceleratorPriceBand' from JSON`,
|
|
57
|
+
);
|
|
58
|
+
}
|
|
@@ -8,6 +8,17 @@ import { safeParse } from "../../lib/schemas.js";
|
|
|
8
8
|
import { ClosedEnum } from "../../types/enums.js";
|
|
9
9
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
10
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
import {
|
|
12
|
+
AcceleratorPriceBand,
|
|
13
|
+
AcceleratorPriceBand$inboundSchema,
|
|
14
|
+
AcceleratorPriceBand$Outbound,
|
|
15
|
+
AcceleratorPriceBand$outboundSchema,
|
|
16
|
+
} from "./acceleratorpriceband.js";
|
|
17
|
+
import {
|
|
18
|
+
Acquirability,
|
|
19
|
+
Acquirability$inboundSchema,
|
|
20
|
+
Acquirability$outboundSchema,
|
|
21
|
+
} from "./acquirability.js";
|
|
11
22
|
|
|
12
23
|
export const Kind = {
|
|
13
24
|
Gpu: "gpu",
|
|
@@ -21,6 +32,14 @@ export type Kind = ClosedEnum<typeof Kind>;
|
|
|
21
32
|
* An offered accelerator type in the catalog.
|
|
22
33
|
*/
|
|
23
34
|
export type AcceleratorType = {
|
|
35
|
+
/**
|
|
36
|
+
* Banded estimate of how reliably matching capacity can be acquired, computed from availability history. "unknown" means no history, never a guess.
|
|
37
|
+
*/
|
|
38
|
+
acquirability?: Acquirability | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* Configurations acquirable now (0 when offered is false). Absent when live market data is unavailable.
|
|
41
|
+
*/
|
|
42
|
+
acquirableCount?: number | undefined;
|
|
24
43
|
kind?: Kind | undefined;
|
|
25
44
|
/**
|
|
26
45
|
* Max accelerators of this type per replica
|
|
@@ -28,6 +47,14 @@ export type AcceleratorType = {
|
|
|
28
47
|
maxCount: number;
|
|
29
48
|
memoryGb: number;
|
|
30
49
|
name: string;
|
|
50
|
+
/**
|
|
51
|
+
* Whether any capacity acquirable right now matches this type. Absent when live market data is unavailable.
|
|
52
|
+
*/
|
|
53
|
+
offered?: boolean | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* USD-per-hour price band across configurations acquirable now for an accelerator type.
|
|
56
|
+
*/
|
|
57
|
+
priceUsdHr?: AcceleratorPriceBand | undefined;
|
|
31
58
|
vendor: string;
|
|
32
59
|
};
|
|
33
60
|
|
|
@@ -45,23 +72,33 @@ export const AcceleratorType$inboundSchema: z.ZodType<
|
|
|
45
72
|
z.ZodTypeDef,
|
|
46
73
|
unknown
|
|
47
74
|
> = z.object({
|
|
75
|
+
acquirability: Acquirability$inboundSchema.optional(),
|
|
76
|
+
acquirable_count: z.number().int().optional(),
|
|
48
77
|
kind: Kind$inboundSchema.default("gpu"),
|
|
49
78
|
max_count: z.number().int(),
|
|
50
79
|
memory_gb: z.number().int(),
|
|
51
80
|
name: z.string(),
|
|
81
|
+
offered: z.boolean().optional(),
|
|
82
|
+
price_usd_hr: AcceleratorPriceBand$inboundSchema.optional(),
|
|
52
83
|
vendor: z.string(),
|
|
53
84
|
}).transform((v) => {
|
|
54
85
|
return remap$(v, {
|
|
86
|
+
"acquirable_count": "acquirableCount",
|
|
55
87
|
"max_count": "maxCount",
|
|
56
88
|
"memory_gb": "memoryGb",
|
|
89
|
+
"price_usd_hr": "priceUsdHr",
|
|
57
90
|
});
|
|
58
91
|
});
|
|
59
92
|
/** @internal */
|
|
60
93
|
export type AcceleratorType$Outbound = {
|
|
94
|
+
acquirability?: string | undefined;
|
|
95
|
+
acquirable_count?: number | undefined;
|
|
61
96
|
kind: string;
|
|
62
97
|
max_count: number;
|
|
63
98
|
memory_gb: number;
|
|
64
99
|
name: string;
|
|
100
|
+
offered?: boolean | undefined;
|
|
101
|
+
price_usd_hr?: AcceleratorPriceBand$Outbound | undefined;
|
|
65
102
|
vendor: string;
|
|
66
103
|
};
|
|
67
104
|
|
|
@@ -71,15 +108,21 @@ export const AcceleratorType$outboundSchema: z.ZodType<
|
|
|
71
108
|
z.ZodTypeDef,
|
|
72
109
|
AcceleratorType
|
|
73
110
|
> = z.object({
|
|
111
|
+
acquirability: Acquirability$outboundSchema.optional(),
|
|
112
|
+
acquirableCount: z.number().int().optional(),
|
|
74
113
|
kind: Kind$outboundSchema.default("gpu"),
|
|
75
114
|
maxCount: z.number().int(),
|
|
76
115
|
memoryGb: z.number().int(),
|
|
77
116
|
name: z.string(),
|
|
117
|
+
offered: z.boolean().optional(),
|
|
118
|
+
priceUsdHr: AcceleratorPriceBand$outboundSchema.optional(),
|
|
78
119
|
vendor: z.string(),
|
|
79
120
|
}).transform((v) => {
|
|
80
121
|
return remap$(v, {
|
|
122
|
+
acquirableCount: "acquirable_count",
|
|
81
123
|
maxCount: "max_count",
|
|
82
124
|
memoryGb: "memory_gb",
|
|
125
|
+
priceUsdHr: "price_usd_hr",
|
|
83
126
|
});
|
|
84
127
|
});
|
|
85
128
|
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Banded estimate of how reliably matching capacity can be acquired, computed from availability history. "unknown" means no history, never a guess.
|
|
10
|
+
*/
|
|
11
|
+
export const Acquirability = {
|
|
12
|
+
High: "high",
|
|
13
|
+
Medium: "medium",
|
|
14
|
+
Low: "low",
|
|
15
|
+
Unknown: "unknown",
|
|
16
|
+
} as const;
|
|
17
|
+
/**
|
|
18
|
+
* Banded estimate of how reliably matching capacity can be acquired, computed from availability history. "unknown" means no history, never a guess.
|
|
19
|
+
*/
|
|
20
|
+
export type Acquirability = ClosedEnum<typeof Acquirability>;
|
|
21
|
+
|
|
22
|
+
/** @internal */
|
|
23
|
+
export const Acquirability$inboundSchema: z.ZodNativeEnum<
|
|
24
|
+
typeof Acquirability
|
|
25
|
+
> = z.nativeEnum(Acquirability);
|
|
26
|
+
/** @internal */
|
|
27
|
+
export const Acquirability$outboundSchema: z.ZodNativeEnum<
|
|
28
|
+
typeof Acquirability
|
|
29
|
+
> = Acquirability$inboundSchema;
|
|
@@ -0,0 +1,145 @@
|
|
|
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 { ClosedEnum } from "../../types/enums.js";
|
|
9
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
import {
|
|
12
|
+
Acquirability,
|
|
13
|
+
Acquirability$inboundSchema,
|
|
14
|
+
Acquirability$outboundSchema,
|
|
15
|
+
} from "./acquirability.js";
|
|
16
|
+
import {
|
|
17
|
+
EligibilityPriceBand,
|
|
18
|
+
EligibilityPriceBand$inboundSchema,
|
|
19
|
+
EligibilityPriceBand$Outbound,
|
|
20
|
+
EligibilityPriceBand$outboundSchema,
|
|
21
|
+
} from "./eligibilitypriceband.js";
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Coarse expected-start band for the request as the market looks now.
|
|
25
|
+
*/
|
|
26
|
+
export const EstStart = {
|
|
27
|
+
Immediate: "immediate",
|
|
28
|
+
Minutes: "minutes",
|
|
29
|
+
Queued: "queued",
|
|
30
|
+
Unknown: "unknown",
|
|
31
|
+
} as const;
|
|
32
|
+
/**
|
|
33
|
+
* Coarse expected-start band for the request as the market looks now.
|
|
34
|
+
*/
|
|
35
|
+
export type EstStart = ClosedEnum<typeof EstStart>;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Provider-anonymous capacity preview: counts, price bands, and advice only. Configurations, providers, regions, and SKUs are never enumerated.
|
|
39
|
+
*/
|
|
40
|
+
export type EligibilityPreview = {
|
|
41
|
+
/**
|
|
42
|
+
* Banded estimate of how reliably matching capacity can be acquired, computed from availability history. "unknown" means no history, never a guess.
|
|
43
|
+
*/
|
|
44
|
+
acquirability: Acquirability;
|
|
45
|
+
/**
|
|
46
|
+
* Matching configurations that could start immediately.
|
|
47
|
+
*/
|
|
48
|
+
acquirableNow: number;
|
|
49
|
+
/**
|
|
50
|
+
* Machine-generated, provider-anonymous guidance.
|
|
51
|
+
*/
|
|
52
|
+
advice: Array<string>;
|
|
53
|
+
/**
|
|
54
|
+
* Whether any known configuration matches the request.
|
|
55
|
+
*/
|
|
56
|
+
eligible: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Coarse expected-start band for the request as the market looks now.
|
|
59
|
+
*/
|
|
60
|
+
estStart: EstStart;
|
|
61
|
+
/**
|
|
62
|
+
* USD-per-hour price band across the configurations matching an eligibility request.
|
|
63
|
+
*/
|
|
64
|
+
priceUsdHr?: EligibilityPriceBand | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* Known matching configurations currently out of stock.
|
|
67
|
+
*/
|
|
68
|
+
watchable: number;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
/** @internal */
|
|
72
|
+
export const EstStart$inboundSchema: z.ZodNativeEnum<typeof EstStart> = z
|
|
73
|
+
.nativeEnum(EstStart);
|
|
74
|
+
/** @internal */
|
|
75
|
+
export const EstStart$outboundSchema: z.ZodNativeEnum<typeof EstStart> =
|
|
76
|
+
EstStart$inboundSchema;
|
|
77
|
+
|
|
78
|
+
/** @internal */
|
|
79
|
+
export const EligibilityPreview$inboundSchema: z.ZodType<
|
|
80
|
+
EligibilityPreview,
|
|
81
|
+
z.ZodTypeDef,
|
|
82
|
+
unknown
|
|
83
|
+
> = z.object({
|
|
84
|
+
acquirability: Acquirability$inboundSchema,
|
|
85
|
+
acquirable_now: z.number().int(),
|
|
86
|
+
advice: z.array(z.string()),
|
|
87
|
+
eligible: z.boolean(),
|
|
88
|
+
est_start: EstStart$inboundSchema,
|
|
89
|
+
price_usd_hr: EligibilityPriceBand$inboundSchema.optional(),
|
|
90
|
+
watchable: z.number().int(),
|
|
91
|
+
}).transform((v) => {
|
|
92
|
+
return remap$(v, {
|
|
93
|
+
"acquirable_now": "acquirableNow",
|
|
94
|
+
"est_start": "estStart",
|
|
95
|
+
"price_usd_hr": "priceUsdHr",
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
/** @internal */
|
|
99
|
+
export type EligibilityPreview$Outbound = {
|
|
100
|
+
acquirability: string;
|
|
101
|
+
acquirable_now: number;
|
|
102
|
+
advice: Array<string>;
|
|
103
|
+
eligible: boolean;
|
|
104
|
+
est_start: string;
|
|
105
|
+
price_usd_hr?: EligibilityPriceBand$Outbound | undefined;
|
|
106
|
+
watchable: number;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
/** @internal */
|
|
110
|
+
export const EligibilityPreview$outboundSchema: z.ZodType<
|
|
111
|
+
EligibilityPreview$Outbound,
|
|
112
|
+
z.ZodTypeDef,
|
|
113
|
+
EligibilityPreview
|
|
114
|
+
> = z.object({
|
|
115
|
+
acquirability: Acquirability$outboundSchema,
|
|
116
|
+
acquirableNow: z.number().int(),
|
|
117
|
+
advice: z.array(z.string()),
|
|
118
|
+
eligible: z.boolean(),
|
|
119
|
+
estStart: EstStart$outboundSchema,
|
|
120
|
+
priceUsdHr: EligibilityPriceBand$outboundSchema.optional(),
|
|
121
|
+
watchable: z.number().int(),
|
|
122
|
+
}).transform((v) => {
|
|
123
|
+
return remap$(v, {
|
|
124
|
+
acquirableNow: "acquirable_now",
|
|
125
|
+
estStart: "est_start",
|
|
126
|
+
priceUsdHr: "price_usd_hr",
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
export function eligibilityPreviewToJSON(
|
|
131
|
+
eligibilityPreview: EligibilityPreview,
|
|
132
|
+
): string {
|
|
133
|
+
return JSON.stringify(
|
|
134
|
+
EligibilityPreview$outboundSchema.parse(eligibilityPreview),
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
export function eligibilityPreviewFromJSON(
|
|
138
|
+
jsonString: string,
|
|
139
|
+
): SafeParseResult<EligibilityPreview, SDKValidationError> {
|
|
140
|
+
return safeParse(
|
|
141
|
+
jsonString,
|
|
142
|
+
(x) => EligibilityPreview$inboundSchema.parse(JSON.parse(x)),
|
|
143
|
+
`Failed to parse 'EligibilityPreview' from JSON`,
|
|
144
|
+
);
|
|
145
|
+
}
|