@meetkai/mka1 0.51.12 → 0.51.13
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 +233 -227
- package/bin/mcp-server.js +316 -82
- package/bin/mcp-server.js.map +15 -8
- 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 +3 -1
- package/dist/commonjs/mcp-server/server.js.map +1 -1
- 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/index.d.ts +4 -0
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +4 -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 +1 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +1 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/react-query/index.d.ts +1 -0
- package/dist/commonjs/react-query/index.d.ts.map +1 -1
- package/dist/commonjs/react-query/index.js +1 -0
- package/dist/commonjs/react-query/index.js.map +1 -1
- 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/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/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/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 +3 -1
- package/dist/esm/mcp-server/server.js.map +1 -1
- 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/index.d.ts +4 -0
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +4 -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 +1 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +1 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/react-query/index.d.ts +1 -0
- package/dist/esm/react-query/index.d.ts.map +1 -1
- package/dist/esm/react-query/index.js +1 -0
- package/dist/esm/react-query/index.js.map +1 -1
- 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/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/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/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 +3 -1
- package/src/mcp-server/tools/servingSpendGet.ts +37 -0
- package/src/models/components/index.ts +4 -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 +1 -0
- package/src/react-query/index.ts +1 -0
- package/src/react-query/servingSpendGet.core.ts +79 -0
- package/src/react-query/servingSpendGet.ts +145 -0
- package/src/sdk/serving.ts +6 -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.13",
|
|
69
69
|
genVersion: "2.918.4",
|
|
70
|
-
userAgent: "speakeasy-sdk/typescript 0.51.
|
|
70
|
+
userAgent: "speakeasy-sdk/typescript 0.51.13 2.918.4 1.1.0 @meetkai/mka1",
|
|
71
71
|
} as const;
|
package/src/mcp-server/server.ts
CHANGED
|
@@ -338,6 +338,7 @@ import { tool$servingRecipesSetEnabled } from "./tools/servingRecipesSetEnabled.
|
|
|
338
338
|
import { tool$servingSecretsCreate } from "./tools/servingSecretsCreate.js";
|
|
339
339
|
import { tool$servingSecretsDelete } from "./tools/servingSecretsDelete.js";
|
|
340
340
|
import { tool$servingSecretsList } from "./tools/servingSecretsList.js";
|
|
341
|
+
import { tool$servingSpendGet } from "./tools/servingSpendGet.js";
|
|
341
342
|
import { tool$servingTenantsDeleteOrganization } from "./tools/servingTenantsDeleteOrganization.js";
|
|
342
343
|
import { tool$servingTenantsGet } from "./tools/servingTenantsGet.js";
|
|
343
344
|
import { tool$servingTenantsGetOrganizationDeletion } from "./tools/servingTenantsGetOrganizationDeletion.js";
|
|
@@ -360,7 +361,7 @@ export function createMCPServer(deps: {
|
|
|
360
361
|
}) {
|
|
361
362
|
const server = new McpServer({
|
|
362
363
|
name: "SDK",
|
|
363
|
-
version: "0.51.
|
|
364
|
+
version: "0.51.13",
|
|
364
365
|
});
|
|
365
366
|
|
|
366
367
|
const client = new SDKCore({
|
|
@@ -717,6 +718,7 @@ export function createMCPServer(deps: {
|
|
|
717
718
|
tool(tool$servingSecretsList);
|
|
718
719
|
tool(tool$servingSecretsCreate);
|
|
719
720
|
tool(tool$servingSecretsDelete);
|
|
721
|
+
tool(tool$servingSpendGet);
|
|
720
722
|
tool(tool$servingTenantsList);
|
|
721
723
|
tool(tool$servingTenantsGet);
|
|
722
724
|
tool(tool$servingTenantsSet);
|
|
@@ -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
|
+
};
|
|
@@ -512,6 +512,10 @@ export * from "./speakersegment.js";
|
|
|
512
512
|
export * from "./speechhistorydeletionstatus.js";
|
|
513
513
|
export * from "./speechtotexthistorylist.js";
|
|
514
514
|
export * from "./speechtotexthistoryobject.js";
|
|
515
|
+
export * from "./spendgroup.js";
|
|
516
|
+
export * from "./spenditem.js";
|
|
517
|
+
export * from "./spendsummary.js";
|
|
518
|
+
export * from "./spendwindow.js";
|
|
515
519
|
export * from "./startexportfeedbackresponse.js";
|
|
516
520
|
export * from "./staticchunkingstrategy.js";
|
|
517
521
|
export * from "./status.js";
|
|
@@ -0,0 +1,75 @@
|
|
|
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
|
+
SpendItem,
|
|
12
|
+
SpendItem$inboundSchema,
|
|
13
|
+
SpendItem$Outbound,
|
|
14
|
+
SpendItem$outboundSchema,
|
|
15
|
+
} from "./spenditem.js";
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Aggregate spend for one resource class.
|
|
19
|
+
*/
|
|
20
|
+
export type SpendGroup = {
|
|
21
|
+
/**
|
|
22
|
+
* Highest-spend resources first; at most 100 entries.
|
|
23
|
+
*/
|
|
24
|
+
items: Array<SpendItem>;
|
|
25
|
+
/**
|
|
26
|
+
* Full spend for this group in the window, including resources beyond the items cap.
|
|
27
|
+
*/
|
|
28
|
+
totalUsd: number;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/** @internal */
|
|
32
|
+
export const SpendGroup$inboundSchema: z.ZodType<
|
|
33
|
+
SpendGroup,
|
|
34
|
+
z.ZodTypeDef,
|
|
35
|
+
unknown
|
|
36
|
+
> = z.object({
|
|
37
|
+
items: z.array(SpendItem$inboundSchema),
|
|
38
|
+
total_usd: z.number(),
|
|
39
|
+
}).transform((v) => {
|
|
40
|
+
return remap$(v, {
|
|
41
|
+
"total_usd": "totalUsd",
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
/** @internal */
|
|
45
|
+
export type SpendGroup$Outbound = {
|
|
46
|
+
items: Array<SpendItem$Outbound>;
|
|
47
|
+
total_usd: number;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
/** @internal */
|
|
51
|
+
export const SpendGroup$outboundSchema: z.ZodType<
|
|
52
|
+
SpendGroup$Outbound,
|
|
53
|
+
z.ZodTypeDef,
|
|
54
|
+
SpendGroup
|
|
55
|
+
> = z.object({
|
|
56
|
+
items: z.array(SpendItem$outboundSchema),
|
|
57
|
+
totalUsd: z.number(),
|
|
58
|
+
}).transform((v) => {
|
|
59
|
+
return remap$(v, {
|
|
60
|
+
totalUsd: "total_usd",
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
export function spendGroupToJSON(spendGroup: SpendGroup): string {
|
|
65
|
+
return JSON.stringify(SpendGroup$outboundSchema.parse(spendGroup));
|
|
66
|
+
}
|
|
67
|
+
export function spendGroupFromJSON(
|
|
68
|
+
jsonString: string,
|
|
69
|
+
): SafeParseResult<SpendGroup, SDKValidationError> {
|
|
70
|
+
return safeParse(
|
|
71
|
+
jsonString,
|
|
72
|
+
(x) => SpendGroup$inboundSchema.parse(JSON.parse(x)),
|
|
73
|
+
`Failed to parse 'SpendGroup' from JSON`,
|
|
74
|
+
);
|
|
75
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
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
|
+
* Computed spend for one resource within the window.
|
|
12
|
+
*/
|
|
13
|
+
export type SpendItem = {
|
|
14
|
+
id: string;
|
|
15
|
+
name: string;
|
|
16
|
+
/**
|
|
17
|
+
* Computed spend within the window, in USD.
|
|
18
|
+
*/
|
|
19
|
+
usd: number;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/** @internal */
|
|
23
|
+
export const SpendItem$inboundSchema: z.ZodType<
|
|
24
|
+
SpendItem,
|
|
25
|
+
z.ZodTypeDef,
|
|
26
|
+
unknown
|
|
27
|
+
> = z.object({
|
|
28
|
+
id: z.string(),
|
|
29
|
+
name: z.string(),
|
|
30
|
+
usd: z.number(),
|
|
31
|
+
});
|
|
32
|
+
/** @internal */
|
|
33
|
+
export type SpendItem$Outbound = {
|
|
34
|
+
id: string;
|
|
35
|
+
name: string;
|
|
36
|
+
usd: number;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
/** @internal */
|
|
40
|
+
export const SpendItem$outboundSchema: z.ZodType<
|
|
41
|
+
SpendItem$Outbound,
|
|
42
|
+
z.ZodTypeDef,
|
|
43
|
+
SpendItem
|
|
44
|
+
> = z.object({
|
|
45
|
+
id: z.string(),
|
|
46
|
+
name: z.string(),
|
|
47
|
+
usd: z.number(),
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
export function spendItemToJSON(spendItem: SpendItem): string {
|
|
51
|
+
return JSON.stringify(SpendItem$outboundSchema.parse(spendItem));
|
|
52
|
+
}
|
|
53
|
+
export function spendItemFromJSON(
|
|
54
|
+
jsonString: string,
|
|
55
|
+
): SafeParseResult<SpendItem, SDKValidationError> {
|
|
56
|
+
return safeParse(
|
|
57
|
+
jsonString,
|
|
58
|
+
(x) => SpendItem$inboundSchema.parse(JSON.parse(x)),
|
|
59
|
+
`Failed to parse 'SpendItem' from JSON`,
|
|
60
|
+
);
|
|
61
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
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
|
+
SpendGroup,
|
|
12
|
+
SpendGroup$inboundSchema,
|
|
13
|
+
SpendGroup$Outbound,
|
|
14
|
+
SpendGroup$outboundSchema,
|
|
15
|
+
} from "./spendgroup.js";
|
|
16
|
+
import {
|
|
17
|
+
SpendWindow,
|
|
18
|
+
SpendWindow$inboundSchema,
|
|
19
|
+
SpendWindow$Outbound,
|
|
20
|
+
SpendWindow$outboundSchema,
|
|
21
|
+
} from "./spendwindow.js";
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Aggregate spend computed as price × runtime overlap with the window; derived on read, never stored.
|
|
25
|
+
*/
|
|
26
|
+
export type SpendSummary = {
|
|
27
|
+
/**
|
|
28
|
+
* Aggregate spend for one resource class.
|
|
29
|
+
*/
|
|
30
|
+
deployments: SpendGroup;
|
|
31
|
+
/**
|
|
32
|
+
* Aggregate spend for one resource class.
|
|
33
|
+
*/
|
|
34
|
+
finetune: SpendGroup;
|
|
35
|
+
/**
|
|
36
|
+
* Total spend across deployments and fine-tune jobs in the window.
|
|
37
|
+
*/
|
|
38
|
+
totalUsd: number;
|
|
39
|
+
/**
|
|
40
|
+
* The resolved reporting window.
|
|
41
|
+
*/
|
|
42
|
+
window: SpendWindow;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/** @internal */
|
|
46
|
+
export const SpendSummary$inboundSchema: z.ZodType<
|
|
47
|
+
SpendSummary,
|
|
48
|
+
z.ZodTypeDef,
|
|
49
|
+
unknown
|
|
50
|
+
> = z.object({
|
|
51
|
+
deployments: SpendGroup$inboundSchema,
|
|
52
|
+
finetune: SpendGroup$inboundSchema,
|
|
53
|
+
total_usd: z.number(),
|
|
54
|
+
window: SpendWindow$inboundSchema,
|
|
55
|
+
}).transform((v) => {
|
|
56
|
+
return remap$(v, {
|
|
57
|
+
"total_usd": "totalUsd",
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
/** @internal */
|
|
61
|
+
export type SpendSummary$Outbound = {
|
|
62
|
+
deployments: SpendGroup$Outbound;
|
|
63
|
+
finetune: SpendGroup$Outbound;
|
|
64
|
+
total_usd: number;
|
|
65
|
+
window: SpendWindow$Outbound;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
/** @internal */
|
|
69
|
+
export const SpendSummary$outboundSchema: z.ZodType<
|
|
70
|
+
SpendSummary$Outbound,
|
|
71
|
+
z.ZodTypeDef,
|
|
72
|
+
SpendSummary
|
|
73
|
+
> = z.object({
|
|
74
|
+
deployments: SpendGroup$outboundSchema,
|
|
75
|
+
finetune: SpendGroup$outboundSchema,
|
|
76
|
+
totalUsd: z.number(),
|
|
77
|
+
window: SpendWindow$outboundSchema,
|
|
78
|
+
}).transform((v) => {
|
|
79
|
+
return remap$(v, {
|
|
80
|
+
totalUsd: "total_usd",
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
export function spendSummaryToJSON(spendSummary: SpendSummary): string {
|
|
85
|
+
return JSON.stringify(SpendSummary$outboundSchema.parse(spendSummary));
|
|
86
|
+
}
|
|
87
|
+
export function spendSummaryFromJSON(
|
|
88
|
+
jsonString: string,
|
|
89
|
+
): SafeParseResult<SpendSummary, SDKValidationError> {
|
|
90
|
+
return safeParse(
|
|
91
|
+
jsonString,
|
|
92
|
+
(x) => SpendSummary$inboundSchema.parse(JSON.parse(x)),
|
|
93
|
+
`Failed to parse 'SpendSummary' from JSON`,
|
|
94
|
+
);
|
|
95
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
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
|
+
* The resolved reporting window.
|
|
12
|
+
*/
|
|
13
|
+
export type SpendWindow = {
|
|
14
|
+
end: Date;
|
|
15
|
+
/**
|
|
16
|
+
* Lower bound of the window; null when the request set none (total covers all history).
|
|
17
|
+
*/
|
|
18
|
+
start?: Date | null | undefined;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/** @internal */
|
|
22
|
+
export const SpendWindow$inboundSchema: z.ZodType<
|
|
23
|
+
SpendWindow,
|
|
24
|
+
z.ZodTypeDef,
|
|
25
|
+
unknown
|
|
26
|
+
> = z.object({
|
|
27
|
+
end: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
28
|
+
start: z.nullable(
|
|
29
|
+
z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
30
|
+
).optional(),
|
|
31
|
+
});
|
|
32
|
+
/** @internal */
|
|
33
|
+
export type SpendWindow$Outbound = {
|
|
34
|
+
end: string;
|
|
35
|
+
start?: string | null | undefined;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/** @internal */
|
|
39
|
+
export const SpendWindow$outboundSchema: z.ZodType<
|
|
40
|
+
SpendWindow$Outbound,
|
|
41
|
+
z.ZodTypeDef,
|
|
42
|
+
SpendWindow
|
|
43
|
+
> = z.object({
|
|
44
|
+
end: z.date().transform(v => v.toISOString()),
|
|
45
|
+
start: z.nullable(z.date().transform(v => v.toISOString())).optional(),
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
export function spendWindowToJSON(spendWindow: SpendWindow): string {
|
|
49
|
+
return JSON.stringify(SpendWindow$outboundSchema.parse(spendWindow));
|
|
50
|
+
}
|
|
51
|
+
export function spendWindowFromJSON(
|
|
52
|
+
jsonString: string,
|
|
53
|
+
): SafeParseResult<SpendWindow, SDKValidationError> {
|
|
54
|
+
return safeParse(
|
|
55
|
+
jsonString,
|
|
56
|
+
(x) => SpendWindow$inboundSchema.parse(JSON.parse(x)),
|
|
57
|
+
`Failed to parse 'SpendWindow' from JSON`,
|
|
58
|
+
);
|
|
59
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
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
|
+
export type GetSpendRequest = {
|
|
12
|
+
start?: Date | null | undefined;
|
|
13
|
+
end?: Date | null | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Optional external end-user identifier forwarded by the API gateway.
|
|
16
|
+
*/
|
|
17
|
+
xOnBehalfOf?: string | undefined;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/** @internal */
|
|
21
|
+
export const GetSpendRequest$inboundSchema: z.ZodType<
|
|
22
|
+
GetSpendRequest,
|
|
23
|
+
z.ZodTypeDef,
|
|
24
|
+
unknown
|
|
25
|
+
> = z.object({
|
|
26
|
+
start: z.nullable(
|
|
27
|
+
z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
28
|
+
).optional(),
|
|
29
|
+
end: z.nullable(
|
|
30
|
+
z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
31
|
+
).optional(),
|
|
32
|
+
"X-On-Behalf-Of": z.string().optional(),
|
|
33
|
+
}).transform((v) => {
|
|
34
|
+
return remap$(v, {
|
|
35
|
+
"X-On-Behalf-Of": "xOnBehalfOf",
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
/** @internal */
|
|
39
|
+
export type GetSpendRequest$Outbound = {
|
|
40
|
+
start?: string | null | undefined;
|
|
41
|
+
end?: string | null | undefined;
|
|
42
|
+
"X-On-Behalf-Of"?: string | undefined;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/** @internal */
|
|
46
|
+
export const GetSpendRequest$outboundSchema: z.ZodType<
|
|
47
|
+
GetSpendRequest$Outbound,
|
|
48
|
+
z.ZodTypeDef,
|
|
49
|
+
GetSpendRequest
|
|
50
|
+
> = z.object({
|
|
51
|
+
start: z.nullable(z.date().transform(v => v.toISOString())).optional(),
|
|
52
|
+
end: z.nullable(z.date().transform(v => v.toISOString())).optional(),
|
|
53
|
+
xOnBehalfOf: z.string().optional(),
|
|
54
|
+
}).transform((v) => {
|
|
55
|
+
return remap$(v, {
|
|
56
|
+
xOnBehalfOf: "X-On-Behalf-Of",
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
export function getSpendRequestToJSON(
|
|
61
|
+
getSpendRequest: GetSpendRequest,
|
|
62
|
+
): string {
|
|
63
|
+
return JSON.stringify(GetSpendRequest$outboundSchema.parse(getSpendRequest));
|
|
64
|
+
}
|
|
65
|
+
export function getSpendRequestFromJSON(
|
|
66
|
+
jsonString: string,
|
|
67
|
+
): SafeParseResult<GetSpendRequest, SDKValidationError> {
|
|
68
|
+
return safeParse(
|
|
69
|
+
jsonString,
|
|
70
|
+
(x) => GetSpendRequest$inboundSchema.parse(JSON.parse(x)),
|
|
71
|
+
`Failed to parse 'GetSpendRequest' from JSON`,
|
|
72
|
+
);
|
|
73
|
+
}
|
|
@@ -176,6 +176,7 @@ export * from "./getskillversion.js";
|
|
|
176
176
|
export * from "./getskillversioncontent.js";
|
|
177
177
|
export * from "./getspeechtotexthistory.js";
|
|
178
178
|
export * from "./getspeechtotexthistorycontent.js";
|
|
179
|
+
export * from "./getspend.js";
|
|
179
180
|
export * from "./getteam.js";
|
|
180
181
|
export * from "./gettexttospeechhistory.js";
|
|
181
182
|
export * from "./gettexttospeechhistorycontent.js";
|
package/src/react-query/index.ts
CHANGED
|
@@ -331,6 +331,7 @@ export * from "./servingRecipesSetEnabled.js";
|
|
|
331
331
|
export * from "./servingSecretsCreate.js";
|
|
332
332
|
export * from "./servingSecretsDelete.js";
|
|
333
333
|
export * from "./servingSecretsList.js";
|
|
334
|
+
export * from "./servingSpendGet.js";
|
|
334
335
|
export * from "./servingTenantsDeleteOrganization.js";
|
|
335
336
|
export * from "./servingTenantsGet.js";
|
|
336
337
|
export * from "./servingTenantsGetOrganizationDeletion.js";
|