@meetkai/mka1 0.48.30 → 0.48.31

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.
Files changed (128) hide show
  1. package/README.md +238 -229
  2. package/bin/mcp-server.js +2191 -1879
  3. package/bin/mcp-server.js.map +13 -9
  4. package/dist/commonjs/funcs/authApiKeyGetJwtFromKey.d.ts +2 -0
  5. package/dist/commonjs/funcs/authApiKeyGetJwtFromKey.d.ts.map +1 -1
  6. package/dist/commonjs/funcs/authApiKeyGetJwtFromKey.js +2 -0
  7. package/dist/commonjs/funcs/authApiKeyGetJwtFromKey.js.map +1 -1
  8. package/dist/commonjs/funcs/authApiKeysExchangeToken.d.ts +18 -0
  9. package/dist/commonjs/funcs/authApiKeysExchangeToken.d.ts.map +1 -0
  10. package/dist/commonjs/funcs/authApiKeysExchangeToken.js +133 -0
  11. package/dist/commonjs/funcs/authApiKeysExchangeToken.js.map +1 -0
  12. package/dist/commonjs/lib/config.d.ts +2 -2
  13. package/dist/commonjs/lib/config.js +2 -2
  14. package/dist/commonjs/mcp-server/mcp-server.js +1 -1
  15. package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
  16. package/dist/commonjs/mcp-server/server.js +3 -1
  17. package/dist/commonjs/mcp-server/server.js.map +1 -1
  18. package/dist/commonjs/mcp-server/tools/authApiKeysExchangeToken.d.ts +8 -0
  19. package/dist/commonjs/mcp-server/tools/authApiKeysExchangeToken.d.ts.map +1 -0
  20. package/dist/commonjs/mcp-server/tools/authApiKeysExchangeToken.js +64 -0
  21. package/dist/commonjs/mcp-server/tools/authApiKeysExchangeToken.js.map +1 -0
  22. package/dist/commonjs/models/errors/exchangeapikeytoken.d.ts +159 -0
  23. package/dist/commonjs/models/errors/exchangeapikeytoken.d.ts.map +1 -0
  24. package/dist/commonjs/models/errors/exchangeapikeytoken.js +234 -0
  25. package/dist/commonjs/models/errors/exchangeapikeytoken.js.map +1 -0
  26. package/dist/commonjs/models/errors/index.d.ts +1 -0
  27. package/dist/commonjs/models/errors/index.d.ts.map +1 -1
  28. package/dist/commonjs/models/errors/index.js +1 -0
  29. package/dist/commonjs/models/errors/index.js.map +1 -1
  30. package/dist/commonjs/models/operations/exchangeapikeytoken.d.ts +72 -0
  31. package/dist/commonjs/models/operations/exchangeapikeytoken.d.ts.map +1 -0
  32. package/dist/commonjs/models/operations/exchangeapikeytoken.js +111 -0
  33. package/dist/commonjs/models/operations/exchangeapikeytoken.js.map +1 -0
  34. package/dist/commonjs/models/operations/index.d.ts +1 -0
  35. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  36. package/dist/commonjs/models/operations/index.js +1 -0
  37. package/dist/commonjs/models/operations/index.js.map +1 -1
  38. package/dist/commonjs/react-query/authApiKeyGetJwtFromKey.d.ts +2 -0
  39. package/dist/commonjs/react-query/authApiKeyGetJwtFromKey.d.ts.map +1 -1
  40. package/dist/commonjs/react-query/authApiKeyGetJwtFromKey.js +2 -0
  41. package/dist/commonjs/react-query/authApiKeyGetJwtFromKey.js.map +1 -1
  42. package/dist/commonjs/react-query/authApiKeysExchangeToken.d.ts +29 -0
  43. package/dist/commonjs/react-query/authApiKeysExchangeToken.d.ts.map +1 -0
  44. package/dist/commonjs/react-query/authApiKeysExchangeToken.js +47 -0
  45. package/dist/commonjs/react-query/authApiKeysExchangeToken.js.map +1 -0
  46. package/dist/commonjs/react-query/index.d.ts +1 -0
  47. package/dist/commonjs/react-query/index.d.ts.map +1 -1
  48. package/dist/commonjs/react-query/index.js +1 -0
  49. package/dist/commonjs/react-query/index.js.map +1 -1
  50. package/dist/commonjs/sdk/apikey.d.ts +2 -0
  51. package/dist/commonjs/sdk/apikey.d.ts.map +1 -1
  52. package/dist/commonjs/sdk/apikey.js +2 -0
  53. package/dist/commonjs/sdk/apikey.js.map +1 -1
  54. package/dist/commonjs/sdk/apikeys.d.ts +7 -0
  55. package/dist/commonjs/sdk/apikeys.d.ts.map +1 -1
  56. package/dist/commonjs/sdk/apikeys.js +10 -0
  57. package/dist/commonjs/sdk/apikeys.js.map +1 -1
  58. package/dist/esm/funcs/authApiKeyGetJwtFromKey.d.ts +2 -0
  59. package/dist/esm/funcs/authApiKeyGetJwtFromKey.d.ts.map +1 -1
  60. package/dist/esm/funcs/authApiKeyGetJwtFromKey.js +2 -0
  61. package/dist/esm/funcs/authApiKeyGetJwtFromKey.js.map +1 -1
  62. package/dist/esm/funcs/authApiKeysExchangeToken.d.ts +18 -0
  63. package/dist/esm/funcs/authApiKeysExchangeToken.d.ts.map +1 -0
  64. package/dist/esm/funcs/authApiKeysExchangeToken.js +97 -0
  65. package/dist/esm/funcs/authApiKeysExchangeToken.js.map +1 -0
  66. package/dist/esm/lib/config.d.ts +2 -2
  67. package/dist/esm/lib/config.js +2 -2
  68. package/dist/esm/mcp-server/mcp-server.js +1 -1
  69. package/dist/esm/mcp-server/server.d.ts.map +1 -1
  70. package/dist/esm/mcp-server/server.js +3 -1
  71. package/dist/esm/mcp-server/server.js.map +1 -1
  72. package/dist/esm/mcp-server/tools/authApiKeysExchangeToken.d.ts +8 -0
  73. package/dist/esm/mcp-server/tools/authApiKeysExchangeToken.d.ts.map +1 -0
  74. package/dist/esm/mcp-server/tools/authApiKeysExchangeToken.js +28 -0
  75. package/dist/esm/mcp-server/tools/authApiKeysExchangeToken.js.map +1 -0
  76. package/dist/esm/models/errors/exchangeapikeytoken.d.ts +159 -0
  77. package/dist/esm/models/errors/exchangeapikeytoken.d.ts.map +1 -0
  78. package/dist/esm/models/errors/exchangeapikeytoken.js +192 -0
  79. package/dist/esm/models/errors/exchangeapikeytoken.js.map +1 -0
  80. package/dist/esm/models/errors/index.d.ts +1 -0
  81. package/dist/esm/models/errors/index.d.ts.map +1 -1
  82. package/dist/esm/models/errors/index.js +1 -0
  83. package/dist/esm/models/errors/index.js.map +1 -1
  84. package/dist/esm/models/operations/exchangeapikeytoken.d.ts +72 -0
  85. package/dist/esm/models/operations/exchangeapikeytoken.d.ts.map +1 -0
  86. package/dist/esm/models/operations/exchangeapikeytoken.js +69 -0
  87. package/dist/esm/models/operations/exchangeapikeytoken.js.map +1 -0
  88. package/dist/esm/models/operations/index.d.ts +1 -0
  89. package/dist/esm/models/operations/index.d.ts.map +1 -1
  90. package/dist/esm/models/operations/index.js +1 -0
  91. package/dist/esm/models/operations/index.js.map +1 -1
  92. package/dist/esm/react-query/authApiKeyGetJwtFromKey.d.ts +2 -0
  93. package/dist/esm/react-query/authApiKeyGetJwtFromKey.d.ts.map +1 -1
  94. package/dist/esm/react-query/authApiKeyGetJwtFromKey.js +2 -0
  95. package/dist/esm/react-query/authApiKeyGetJwtFromKey.js.map +1 -1
  96. package/dist/esm/react-query/authApiKeysExchangeToken.d.ts +29 -0
  97. package/dist/esm/react-query/authApiKeysExchangeToken.d.ts.map +1 -0
  98. package/dist/esm/react-query/authApiKeysExchangeToken.js +42 -0
  99. package/dist/esm/react-query/authApiKeysExchangeToken.js.map +1 -0
  100. package/dist/esm/react-query/index.d.ts +1 -0
  101. package/dist/esm/react-query/index.d.ts.map +1 -1
  102. package/dist/esm/react-query/index.js +1 -0
  103. package/dist/esm/react-query/index.js.map +1 -1
  104. package/dist/esm/sdk/apikey.d.ts +2 -0
  105. package/dist/esm/sdk/apikey.d.ts.map +1 -1
  106. package/dist/esm/sdk/apikey.js +2 -0
  107. package/dist/esm/sdk/apikey.js.map +1 -1
  108. package/dist/esm/sdk/apikeys.d.ts +7 -0
  109. package/dist/esm/sdk/apikeys.d.ts.map +1 -1
  110. package/dist/esm/sdk/apikeys.js +10 -0
  111. package/dist/esm/sdk/apikeys.js.map +1 -1
  112. package/jsr.json +1 -1
  113. package/package.json +1 -1
  114. package/src/funcs/authApiKeyGetJwtFromKey.ts +2 -0
  115. package/src/funcs/authApiKeysExchangeToken.ts +225 -0
  116. package/src/lib/config.ts +2 -2
  117. package/src/mcp-server/mcp-server.ts +1 -1
  118. package/src/mcp-server/server.ts +3 -1
  119. package/src/mcp-server/tools/authApiKeysExchangeToken.ts +37 -0
  120. package/src/models/errors/exchangeapikeytoken.ts +387 -0
  121. package/src/models/errors/index.ts +1 -0
  122. package/src/models/operations/exchangeapikeytoken.ts +191 -0
  123. package/src/models/operations/index.ts +1 -0
  124. package/src/react-query/authApiKeyGetJwtFromKey.ts +2 -0
  125. package/src/react-query/authApiKeysExchangeToken.ts +116 -0
  126. package/src/react-query/index.ts +1 -0
  127. package/src/sdk/apikey.ts +2 -0
  128. package/src/sdk/apikeys.ts +18 -0
@@ -0,0 +1,37 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { authApiKeysExchangeToken } from "../../funcs/authApiKeysExchangeToken.js";
6
+ import * as operations from "../../models/operations/index.js";
7
+ import { formatResult, ToolDefinition } from "../tools.js";
8
+
9
+ const args = {
10
+ request: operations.ExchangeApiKeyTokenRequest$inboundSchema,
11
+ };
12
+
13
+ export const tool$authApiKeysExchangeToken: ToolDefinition<typeof args> = {
14
+ name: "auth-api-keys-exchange-token",
15
+ description: `Exchange API key for a JWT token
16
+
17
+ Exchange an API key for a short-lived JWT token.`,
18
+ args,
19
+ tool: async (client, args, ctx) => {
20
+ const [result, apiCall] = await authApiKeysExchangeToken(
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,387 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { SDKError } from "./sdkerror.js";
7
+
8
+ /**
9
+ * Rate limited
10
+ */
11
+ export type ExchangeApiKeyTokenAuthApiKeysResponse429ResponseBodyData = {
12
+ message: string;
13
+ };
14
+
15
+ /**
16
+ * Rate limited
17
+ */
18
+ export class ExchangeApiKeyTokenAuthApiKeysResponse429ResponseBody
19
+ extends SDKError
20
+ {
21
+ /** The original data that was passed to this error instance. */
22
+ data$: ExchangeApiKeyTokenAuthApiKeysResponse429ResponseBodyData;
23
+
24
+ constructor(
25
+ err: ExchangeApiKeyTokenAuthApiKeysResponse429ResponseBodyData,
26
+ httpMeta: { response: Response; request: Request; body: string },
27
+ ) {
28
+ const message = err.message || `API error occurred: ${JSON.stringify(err)}`;
29
+ super(message, httpMeta);
30
+ this.data$ = err;
31
+
32
+ this.name = "ExchangeApiKeyTokenAuthApiKeysResponse429ResponseBody";
33
+ }
34
+ }
35
+
36
+ /**
37
+ * Conflict
38
+ */
39
+ export type ExchangeApiKeyTokenAuthApiKeysResponse409ResponseBodyData = {
40
+ message: string;
41
+ };
42
+
43
+ /**
44
+ * Conflict
45
+ */
46
+ export class ExchangeApiKeyTokenAuthApiKeysResponse409ResponseBody
47
+ extends SDKError
48
+ {
49
+ /** The original data that was passed to this error instance. */
50
+ data$: ExchangeApiKeyTokenAuthApiKeysResponse409ResponseBodyData;
51
+
52
+ constructor(
53
+ err: ExchangeApiKeyTokenAuthApiKeysResponse409ResponseBodyData,
54
+ httpMeta: { response: Response; request: Request; body: string },
55
+ ) {
56
+ const message = err.message || `API error occurred: ${JSON.stringify(err)}`;
57
+ super(message, httpMeta);
58
+ this.data$ = err;
59
+
60
+ this.name = "ExchangeApiKeyTokenAuthApiKeysResponse409ResponseBody";
61
+ }
62
+ }
63
+
64
+ /**
65
+ * Not found
66
+ */
67
+ export type ExchangeApiKeyTokenAuthApiKeysResponse404ResponseBodyData = {
68
+ message: string;
69
+ };
70
+
71
+ /**
72
+ * Not found
73
+ */
74
+ export class ExchangeApiKeyTokenAuthApiKeysResponse404ResponseBody
75
+ extends SDKError
76
+ {
77
+ /** The original data that was passed to this error instance. */
78
+ data$: ExchangeApiKeyTokenAuthApiKeysResponse404ResponseBodyData;
79
+
80
+ constructor(
81
+ err: ExchangeApiKeyTokenAuthApiKeysResponse404ResponseBodyData,
82
+ httpMeta: { response: Response; request: Request; body: string },
83
+ ) {
84
+ const message = err.message || `API error occurred: ${JSON.stringify(err)}`;
85
+ super(message, httpMeta);
86
+ this.data$ = err;
87
+
88
+ this.name = "ExchangeApiKeyTokenAuthApiKeysResponse404ResponseBody";
89
+ }
90
+ }
91
+
92
+ /**
93
+ * Forbidden
94
+ */
95
+ export type ExchangeApiKeyTokenAuthApiKeysResponseResponseBodyData = {
96
+ message: string;
97
+ };
98
+
99
+ /**
100
+ * Forbidden
101
+ */
102
+ export class ExchangeApiKeyTokenAuthApiKeysResponseResponseBody
103
+ extends SDKError
104
+ {
105
+ /** The original data that was passed to this error instance. */
106
+ data$: ExchangeApiKeyTokenAuthApiKeysResponseResponseBodyData;
107
+
108
+ constructor(
109
+ err: ExchangeApiKeyTokenAuthApiKeysResponseResponseBodyData,
110
+ httpMeta: { response: Response; request: Request; body: string },
111
+ ) {
112
+ const message = err.message || `API error occurred: ${JSON.stringify(err)}`;
113
+ super(message, httpMeta);
114
+ this.data$ = err;
115
+
116
+ this.name = "ExchangeApiKeyTokenAuthApiKeysResponseResponseBody";
117
+ }
118
+ }
119
+
120
+ /**
121
+ * Unauthorized
122
+ */
123
+ export type ExchangeApiKeyTokenAuthApiKeysResponseBodyData = {
124
+ message: string;
125
+ };
126
+
127
+ /**
128
+ * Unauthorized
129
+ */
130
+ export class ExchangeApiKeyTokenAuthApiKeysResponseBody extends SDKError {
131
+ /** The original data that was passed to this error instance. */
132
+ data$: ExchangeApiKeyTokenAuthApiKeysResponseBodyData;
133
+
134
+ constructor(
135
+ err: ExchangeApiKeyTokenAuthApiKeysResponseBodyData,
136
+ httpMeta: { response: Response; request: Request; body: string },
137
+ ) {
138
+ const message = err.message || `API error occurred: ${JSON.stringify(err)}`;
139
+ super(message, httpMeta);
140
+ this.data$ = err;
141
+
142
+ this.name = "ExchangeApiKeyTokenAuthApiKeysResponseBody";
143
+ }
144
+ }
145
+
146
+ /**
147
+ * Bad request
148
+ */
149
+ export type ExchangeApiKeyTokenResponseBodyData = {
150
+ message: string;
151
+ };
152
+
153
+ /**
154
+ * Bad request
155
+ */
156
+ export class ExchangeApiKeyTokenResponseBody extends SDKError {
157
+ /** The original data that was passed to this error instance. */
158
+ data$: ExchangeApiKeyTokenResponseBodyData;
159
+
160
+ constructor(
161
+ err: ExchangeApiKeyTokenResponseBodyData,
162
+ httpMeta: { response: Response; request: Request; body: string },
163
+ ) {
164
+ const message = err.message || `API error occurred: ${JSON.stringify(err)}`;
165
+ super(message, httpMeta);
166
+ this.data$ = err;
167
+
168
+ this.name = "ExchangeApiKeyTokenResponseBody";
169
+ }
170
+ }
171
+
172
+ /** @internal */
173
+ export const ExchangeApiKeyTokenAuthApiKeysResponse429ResponseBody$inboundSchema:
174
+ z.ZodType<
175
+ ExchangeApiKeyTokenAuthApiKeysResponse429ResponseBody,
176
+ z.ZodTypeDef,
177
+ unknown
178
+ > = z.object({
179
+ message: z.string(),
180
+ request$: z.instanceof(Request),
181
+ response$: z.instanceof(Response),
182
+ body$: z.string(),
183
+ })
184
+ .transform((v) => {
185
+ return new ExchangeApiKeyTokenAuthApiKeysResponse429ResponseBody(v, {
186
+ request: v.request$,
187
+ response: v.response$,
188
+ body: v.body$,
189
+ });
190
+ });
191
+
192
+ /** @internal */
193
+ export type ExchangeApiKeyTokenAuthApiKeysResponse429ResponseBody$Outbound = {
194
+ message: string;
195
+ };
196
+
197
+ /** @internal */
198
+ export const ExchangeApiKeyTokenAuthApiKeysResponse429ResponseBody$outboundSchema:
199
+ z.ZodType<
200
+ ExchangeApiKeyTokenAuthApiKeysResponse429ResponseBody$Outbound,
201
+ z.ZodTypeDef,
202
+ ExchangeApiKeyTokenAuthApiKeysResponse429ResponseBody
203
+ > = z.instanceof(ExchangeApiKeyTokenAuthApiKeysResponse429ResponseBody)
204
+ .transform(v => v.data$)
205
+ .pipe(z.object({
206
+ message: z.string(),
207
+ }));
208
+
209
+ /** @internal */
210
+ export const ExchangeApiKeyTokenAuthApiKeysResponse409ResponseBody$inboundSchema:
211
+ z.ZodType<
212
+ ExchangeApiKeyTokenAuthApiKeysResponse409ResponseBody,
213
+ z.ZodTypeDef,
214
+ unknown
215
+ > = z.object({
216
+ message: z.string(),
217
+ request$: z.instanceof(Request),
218
+ response$: z.instanceof(Response),
219
+ body$: z.string(),
220
+ })
221
+ .transform((v) => {
222
+ return new ExchangeApiKeyTokenAuthApiKeysResponse409ResponseBody(v, {
223
+ request: v.request$,
224
+ response: v.response$,
225
+ body: v.body$,
226
+ });
227
+ });
228
+
229
+ /** @internal */
230
+ export type ExchangeApiKeyTokenAuthApiKeysResponse409ResponseBody$Outbound = {
231
+ message: string;
232
+ };
233
+
234
+ /** @internal */
235
+ export const ExchangeApiKeyTokenAuthApiKeysResponse409ResponseBody$outboundSchema:
236
+ z.ZodType<
237
+ ExchangeApiKeyTokenAuthApiKeysResponse409ResponseBody$Outbound,
238
+ z.ZodTypeDef,
239
+ ExchangeApiKeyTokenAuthApiKeysResponse409ResponseBody
240
+ > = z.instanceof(ExchangeApiKeyTokenAuthApiKeysResponse409ResponseBody)
241
+ .transform(v => v.data$)
242
+ .pipe(z.object({
243
+ message: z.string(),
244
+ }));
245
+
246
+ /** @internal */
247
+ export const ExchangeApiKeyTokenAuthApiKeysResponse404ResponseBody$inboundSchema:
248
+ z.ZodType<
249
+ ExchangeApiKeyTokenAuthApiKeysResponse404ResponseBody,
250
+ z.ZodTypeDef,
251
+ unknown
252
+ > = z.object({
253
+ message: z.string(),
254
+ request$: z.instanceof(Request),
255
+ response$: z.instanceof(Response),
256
+ body$: z.string(),
257
+ })
258
+ .transform((v) => {
259
+ return new ExchangeApiKeyTokenAuthApiKeysResponse404ResponseBody(v, {
260
+ request: v.request$,
261
+ response: v.response$,
262
+ body: v.body$,
263
+ });
264
+ });
265
+
266
+ /** @internal */
267
+ export type ExchangeApiKeyTokenAuthApiKeysResponse404ResponseBody$Outbound = {
268
+ message: string;
269
+ };
270
+
271
+ /** @internal */
272
+ export const ExchangeApiKeyTokenAuthApiKeysResponse404ResponseBody$outboundSchema:
273
+ z.ZodType<
274
+ ExchangeApiKeyTokenAuthApiKeysResponse404ResponseBody$Outbound,
275
+ z.ZodTypeDef,
276
+ ExchangeApiKeyTokenAuthApiKeysResponse404ResponseBody
277
+ > = z.instanceof(ExchangeApiKeyTokenAuthApiKeysResponse404ResponseBody)
278
+ .transform(v => v.data$)
279
+ .pipe(z.object({
280
+ message: z.string(),
281
+ }));
282
+
283
+ /** @internal */
284
+ export const ExchangeApiKeyTokenAuthApiKeysResponseResponseBody$inboundSchema:
285
+ z.ZodType<
286
+ ExchangeApiKeyTokenAuthApiKeysResponseResponseBody,
287
+ z.ZodTypeDef,
288
+ unknown
289
+ > = z.object({
290
+ message: z.string(),
291
+ request$: z.instanceof(Request),
292
+ response$: z.instanceof(Response),
293
+ body$: z.string(),
294
+ })
295
+ .transform((v) => {
296
+ return new ExchangeApiKeyTokenAuthApiKeysResponseResponseBody(v, {
297
+ request: v.request$,
298
+ response: v.response$,
299
+ body: v.body$,
300
+ });
301
+ });
302
+
303
+ /** @internal */
304
+ export type ExchangeApiKeyTokenAuthApiKeysResponseResponseBody$Outbound = {
305
+ message: string;
306
+ };
307
+
308
+ /** @internal */
309
+ export const ExchangeApiKeyTokenAuthApiKeysResponseResponseBody$outboundSchema:
310
+ z.ZodType<
311
+ ExchangeApiKeyTokenAuthApiKeysResponseResponseBody$Outbound,
312
+ z.ZodTypeDef,
313
+ ExchangeApiKeyTokenAuthApiKeysResponseResponseBody
314
+ > = z.instanceof(ExchangeApiKeyTokenAuthApiKeysResponseResponseBody)
315
+ .transform(v => v.data$)
316
+ .pipe(z.object({
317
+ message: z.string(),
318
+ }));
319
+
320
+ /** @internal */
321
+ export const ExchangeApiKeyTokenAuthApiKeysResponseBody$inboundSchema:
322
+ z.ZodType<ExchangeApiKeyTokenAuthApiKeysResponseBody, z.ZodTypeDef, unknown> =
323
+ z.object({
324
+ message: z.string(),
325
+ request$: z.instanceof(Request),
326
+ response$: z.instanceof(Response),
327
+ body$: z.string(),
328
+ })
329
+ .transform((v) => {
330
+ return new ExchangeApiKeyTokenAuthApiKeysResponseBody(v, {
331
+ request: v.request$,
332
+ response: v.response$,
333
+ body: v.body$,
334
+ });
335
+ });
336
+
337
+ /** @internal */
338
+ export type ExchangeApiKeyTokenAuthApiKeysResponseBody$Outbound = {
339
+ message: string;
340
+ };
341
+
342
+ /** @internal */
343
+ export const ExchangeApiKeyTokenAuthApiKeysResponseBody$outboundSchema:
344
+ z.ZodType<
345
+ ExchangeApiKeyTokenAuthApiKeysResponseBody$Outbound,
346
+ z.ZodTypeDef,
347
+ ExchangeApiKeyTokenAuthApiKeysResponseBody
348
+ > = z.instanceof(ExchangeApiKeyTokenAuthApiKeysResponseBody)
349
+ .transform(v => v.data$)
350
+ .pipe(z.object({
351
+ message: z.string(),
352
+ }));
353
+
354
+ /** @internal */
355
+ export const ExchangeApiKeyTokenResponseBody$inboundSchema: z.ZodType<
356
+ ExchangeApiKeyTokenResponseBody,
357
+ z.ZodTypeDef,
358
+ unknown
359
+ > = z.object({
360
+ message: z.string(),
361
+ request$: z.instanceof(Request),
362
+ response$: z.instanceof(Response),
363
+ body$: z.string(),
364
+ })
365
+ .transform((v) => {
366
+ return new ExchangeApiKeyTokenResponseBody(v, {
367
+ request: v.request$,
368
+ response: v.response$,
369
+ body: v.body$,
370
+ });
371
+ });
372
+
373
+ /** @internal */
374
+ export type ExchangeApiKeyTokenResponseBody$Outbound = {
375
+ message: string;
376
+ };
377
+
378
+ /** @internal */
379
+ export const ExchangeApiKeyTokenResponseBody$outboundSchema: z.ZodType<
380
+ ExchangeApiKeyTokenResponseBody$Outbound,
381
+ z.ZodTypeDef,
382
+ ExchangeApiKeyTokenResponseBody
383
+ > = z.instanceof(ExchangeApiKeyTokenResponseBody)
384
+ .transform(v => v.data$)
385
+ .pipe(z.object({
386
+ message: z.string(),
387
+ }));
@@ -15,6 +15,7 @@ export * from "./deleteserviceaccountapikey.js";
15
15
  export * from "./deleteteam.js";
16
16
  export * from "./errorenvelope.js";
17
17
  export * from "./errorresponse.js";
18
+ export * from "./exchangeapikeytoken.js";
18
19
  export * from "./getclusterinviteinfo.js";
19
20
  export * from "./getclusterorg.js";
20
21
  export * from "./getfilecontent.js";
@@ -0,0 +1,191 @@
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 ExchangeApiKeyTokenRequestBody = {
12
+ /**
13
+ * JWT audience (aud) claim for the exchanged token. Set this to the target API/service URL that should accept the token.
14
+ */
15
+ audience: string;
16
+ /**
17
+ * Your external user identifier to place in the JWT subject (sub) claim. Must be 1–150 printable-ASCII characters and not the wildcard `*`.
18
+ */
19
+ externalUserId: string;
20
+ /**
21
+ * Token lifetime in seconds. Must be between 300 (5 minutes) and 2592000 (30 days). Defaults to 3600 (1 hour).
22
+ */
23
+ expiresIn?: number | undefined;
24
+ /**
25
+ * Optional subset of API key permissions to embed in the token. If omitted, all API key permissions are used.
26
+ */
27
+ permissions?: Array<string> | undefined;
28
+ };
29
+
30
+ export type ExchangeApiKeyTokenRequest = {
31
+ /**
32
+ * Optional external end-user identifier forwarded by the API gateway.
33
+ */
34
+ xOnBehalfOf?: string | undefined;
35
+ requestBody?: ExchangeApiKeyTokenRequestBody | undefined;
36
+ };
37
+
38
+ /**
39
+ * Signed JWT
40
+ */
41
+ export type ExchangeApiKeyTokenResponseBody = {
42
+ /**
43
+ * Signed JWT exchange token to use when calling downstream services.
44
+ */
45
+ token: string;
46
+ };
47
+
48
+ /** @internal */
49
+ export const ExchangeApiKeyTokenRequestBody$inboundSchema: z.ZodType<
50
+ ExchangeApiKeyTokenRequestBody,
51
+ z.ZodTypeDef,
52
+ unknown
53
+ > = z.object({
54
+ audience: z.string(),
55
+ externalUserId: z.string(),
56
+ expiresIn: z.number().default(3600),
57
+ permissions: z.array(z.string()).optional(),
58
+ });
59
+ /** @internal */
60
+ export type ExchangeApiKeyTokenRequestBody$Outbound = {
61
+ audience: string;
62
+ externalUserId: string;
63
+ expiresIn: number;
64
+ permissions?: Array<string> | undefined;
65
+ };
66
+
67
+ /** @internal */
68
+ export const ExchangeApiKeyTokenRequestBody$outboundSchema: z.ZodType<
69
+ ExchangeApiKeyTokenRequestBody$Outbound,
70
+ z.ZodTypeDef,
71
+ ExchangeApiKeyTokenRequestBody
72
+ > = z.object({
73
+ audience: z.string(),
74
+ externalUserId: z.string(),
75
+ expiresIn: z.number().default(3600),
76
+ permissions: z.array(z.string()).optional(),
77
+ });
78
+
79
+ export function exchangeApiKeyTokenRequestBodyToJSON(
80
+ exchangeApiKeyTokenRequestBody: ExchangeApiKeyTokenRequestBody,
81
+ ): string {
82
+ return JSON.stringify(
83
+ ExchangeApiKeyTokenRequestBody$outboundSchema.parse(
84
+ exchangeApiKeyTokenRequestBody,
85
+ ),
86
+ );
87
+ }
88
+ export function exchangeApiKeyTokenRequestBodyFromJSON(
89
+ jsonString: string,
90
+ ): SafeParseResult<ExchangeApiKeyTokenRequestBody, SDKValidationError> {
91
+ return safeParse(
92
+ jsonString,
93
+ (x) => ExchangeApiKeyTokenRequestBody$inboundSchema.parse(JSON.parse(x)),
94
+ `Failed to parse 'ExchangeApiKeyTokenRequestBody' from JSON`,
95
+ );
96
+ }
97
+
98
+ /** @internal */
99
+ export const ExchangeApiKeyTokenRequest$inboundSchema: z.ZodType<
100
+ ExchangeApiKeyTokenRequest,
101
+ z.ZodTypeDef,
102
+ unknown
103
+ > = z.object({
104
+ "X-On-Behalf-Of": z.string().optional(),
105
+ RequestBody: z.lazy(() => ExchangeApiKeyTokenRequestBody$inboundSchema)
106
+ .optional(),
107
+ }).transform((v) => {
108
+ return remap$(v, {
109
+ "X-On-Behalf-Of": "xOnBehalfOf",
110
+ "RequestBody": "requestBody",
111
+ });
112
+ });
113
+ /** @internal */
114
+ export type ExchangeApiKeyTokenRequest$Outbound = {
115
+ "X-On-Behalf-Of"?: string | undefined;
116
+ RequestBody?: ExchangeApiKeyTokenRequestBody$Outbound | undefined;
117
+ };
118
+
119
+ /** @internal */
120
+ export const ExchangeApiKeyTokenRequest$outboundSchema: z.ZodType<
121
+ ExchangeApiKeyTokenRequest$Outbound,
122
+ z.ZodTypeDef,
123
+ ExchangeApiKeyTokenRequest
124
+ > = z.object({
125
+ xOnBehalfOf: z.string().optional(),
126
+ requestBody: z.lazy(() => ExchangeApiKeyTokenRequestBody$outboundSchema)
127
+ .optional(),
128
+ }).transform((v) => {
129
+ return remap$(v, {
130
+ xOnBehalfOf: "X-On-Behalf-Of",
131
+ requestBody: "RequestBody",
132
+ });
133
+ });
134
+
135
+ export function exchangeApiKeyTokenRequestToJSON(
136
+ exchangeApiKeyTokenRequest: ExchangeApiKeyTokenRequest,
137
+ ): string {
138
+ return JSON.stringify(
139
+ ExchangeApiKeyTokenRequest$outboundSchema.parse(exchangeApiKeyTokenRequest),
140
+ );
141
+ }
142
+ export function exchangeApiKeyTokenRequestFromJSON(
143
+ jsonString: string,
144
+ ): SafeParseResult<ExchangeApiKeyTokenRequest, SDKValidationError> {
145
+ return safeParse(
146
+ jsonString,
147
+ (x) => ExchangeApiKeyTokenRequest$inboundSchema.parse(JSON.parse(x)),
148
+ `Failed to parse 'ExchangeApiKeyTokenRequest' from JSON`,
149
+ );
150
+ }
151
+
152
+ /** @internal */
153
+ export const ExchangeApiKeyTokenResponseBody$inboundSchema: z.ZodType<
154
+ ExchangeApiKeyTokenResponseBody,
155
+ z.ZodTypeDef,
156
+ unknown
157
+ > = z.object({
158
+ token: z.string(),
159
+ });
160
+ /** @internal */
161
+ export type ExchangeApiKeyTokenResponseBody$Outbound = {
162
+ token: string;
163
+ };
164
+
165
+ /** @internal */
166
+ export const ExchangeApiKeyTokenResponseBody$outboundSchema: z.ZodType<
167
+ ExchangeApiKeyTokenResponseBody$Outbound,
168
+ z.ZodTypeDef,
169
+ ExchangeApiKeyTokenResponseBody
170
+ > = z.object({
171
+ token: z.string(),
172
+ });
173
+
174
+ export function exchangeApiKeyTokenResponseBodyToJSON(
175
+ exchangeApiKeyTokenResponseBody: ExchangeApiKeyTokenResponseBody,
176
+ ): string {
177
+ return JSON.stringify(
178
+ ExchangeApiKeyTokenResponseBody$outboundSchema.parse(
179
+ exchangeApiKeyTokenResponseBody,
180
+ ),
181
+ );
182
+ }
183
+ export function exchangeApiKeyTokenResponseBodyFromJSON(
184
+ jsonString: string,
185
+ ): SafeParseResult<ExchangeApiKeyTokenResponseBody, SDKValidationError> {
186
+ return safeParse(
187
+ jsonString,
188
+ (x) => ExchangeApiKeyTokenResponseBody$inboundSchema.parse(JSON.parse(x)),
189
+ `Failed to parse 'ExchangeApiKeyTokenResponseBody' from JSON`,
190
+ );
191
+ }
@@ -98,6 +98,7 @@ export * from "./downloadworkspacearchive.js";
98
98
  export * from "./downloadworkspacefile.js";
99
99
  export * from "./dropindex.js";
100
100
  export * from "./embed.js";
101
+ export * from "./exchangeapikeytoken.js";
101
102
  export * from "./extract.js";
102
103
  export * from "./extractwithschema.js";
103
104
  export * from "./getagent.js";
@@ -53,6 +53,8 @@ export type AuthApiKeyGetJwtFromKeyMutationError =
53
53
  *
54
54
  * @remarks
55
55
  * Exchange an API key for a JWT token
56
+ *
57
+ * @deprecated method: Use auth.apiKeys.exchangeToken() instead. This method will be removed in a future release.. Use exchangeToken instead.
56
58
  */
57
59
  export function useAuthApiKeyGetJwtFromKeyMutation(
58
60
  options?: MutationHookOptions<