@usestatemachines/sdk 0.7.1 → 0.8.1
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 +75 -30
- package/agents/SKILL.md +24 -9
- package/agents/index.d.ts +2 -0
- package/agents/index.js +8 -6
- package/agents/llms.txt +25 -5
- package/agents/prompt.md +11 -5
- package/esm/extensions/client.d.ts +11 -7
- package/esm/extensions/client.js +32 -49
- package/esm/extensions/credentials.d.ts +25 -8
- package/esm/extensions/credentials.js +75 -40
- package/esm/extensions/environment.d.ts +1 -1
- package/esm/extensions/errors.js +1 -1
- package/esm/extensions/index.d.ts +2 -2
- package/esm/extensions/yaml.js +14 -12
- package/esm/funcs/environments-creators.d.ts +11 -0
- package/esm/funcs/environments-creators.js +90 -0
- package/esm/funcs/environments-list.js +2 -0
- package/esm/funcs/requests-list.js +5 -1
- package/esm/funcs/requests-stats.js +5 -1
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/app-entry.d.ts +8 -0
- package/esm/models/app-entry.js +11 -0
- package/esm/models/create-environment-app.d.ts +25 -0
- package/esm/models/create-environment-app.js +14 -0
- package/esm/models/create-environment.d.ts +3 -26
- package/esm/models/create-environment.js +2 -19
- package/esm/models/credential.d.ts +50 -0
- package/esm/models/credential.js +60 -0
- package/esm/models/credentials.d.ts +26 -5
- package/esm/models/credentials.js +20 -3
- package/esm/models/environment-failure.d.ts +3 -2
- package/esm/models/environment-failure.js +3 -2
- package/esm/models/environment.d.ts +4 -1
- package/esm/models/environment.js +2 -1
- package/esm/models/error.d.ts +1 -0
- package/esm/models/error.js +1 -0
- package/esm/models/index.d.ts +6 -1
- package/esm/models/index.js +6 -1
- package/esm/models/mcp-server.d.ts +11 -0
- package/esm/models/mcp-server.js +16 -0
- package/esm/models/mcp-tool.d.ts +12 -0
- package/esm/models/mcp-tool.js +16 -0
- package/esm/models/me.d.ts +2 -0
- package/esm/models/me.js +2 -0
- package/esm/models/operations/create-credentials.d.ts +2 -0
- package/esm/models/operations/create-credentials.js +1 -0
- package/esm/models/operations/get-request-stats.d.ts +10 -2
- package/esm/models/operations/get-request-stats.js +5 -1
- package/esm/models/operations/index.d.ts +1 -0
- package/esm/models/operations/index.js +1 -0
- package/esm/models/operations/list-environment-creators.d.ts +23 -0
- package/esm/models/operations/list-environment-creators.js +20 -0
- package/esm/models/operations/list-environments.d.ts +5 -1
- package/esm/models/operations/list-environments.js +2 -0
- package/esm/models/operations/list-requests.d.ts +10 -2
- package/esm/models/operations/list-requests.js +5 -1
- package/esm/models/request-detail.d.ts +8 -1
- package/esm/models/request-detail.js +5 -1
- package/esm/models/request-stats.d.ts +8 -0
- package/esm/models/request-stats.js +9 -0
- package/esm/models/request.d.ts +8 -1
- package/esm/models/request.js +5 -1
- package/esm/models/service.d.ts +25 -0
- package/esm/models/service.js +28 -0
- package/esm/models/snapshot.d.ts +7 -0
- package/esm/models/snapshot.js +3 -0
- package/esm/models/version.d.ts +2 -2
- package/esm/models/version.js +2 -2
- package/esm/sdk/environments.d.ts +1 -0
- package/esm/sdk/environments.js +4 -0
- package/esm/types/discriminated-union.d.ts +24 -0
- package/esm/types/discriminated-union.js +60 -0
- package/esm/types/smart-union.js +2 -1
- package/openapi.json +596 -116
- package/package.json +1 -1
- package/esm/models/api.d.ts +0 -17
- package/esm/models/api.js +0 -21
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as z from "zod/v4-mini";
|
|
5
|
+
import { encodeFormQuery } from "../lib/encodings.js";
|
|
6
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
11
|
+
import { pathToFunc } from "../lib/url.js";
|
|
12
|
+
import * as errors from "../models/errors/index.js";
|
|
13
|
+
import * as operations from "../models/operations/index.js";
|
|
14
|
+
import { APIPromise } from "../types/async.js";
|
|
15
|
+
export function environmentsCreators(client, request, options) {
|
|
16
|
+
return new APIPromise($do(client, request, options));
|
|
17
|
+
}
|
|
18
|
+
async function $do(client, request, options) {
|
|
19
|
+
const parsed = safeParse(request, (value) => z.parse(z.optional(operations.ListEnvironmentCreatorsRequest$outboundSchema), value), "Input validation failed");
|
|
20
|
+
if (!parsed.ok) {
|
|
21
|
+
return [parsed, { status: "invalid" }];
|
|
22
|
+
}
|
|
23
|
+
const payload = parsed.value;
|
|
24
|
+
const body = null;
|
|
25
|
+
const path = pathToFunc("/v1/environments/creators")();
|
|
26
|
+
const query = encodeFormQuery({
|
|
27
|
+
"workspaceId": payload?.workspaceId,
|
|
28
|
+
});
|
|
29
|
+
const headers = new Headers(compactMap({
|
|
30
|
+
Accept: "application/json",
|
|
31
|
+
}));
|
|
32
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
33
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
34
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
35
|
+
const context = {
|
|
36
|
+
options: client._options,
|
|
37
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
38
|
+
operationID: "listEnvironmentCreators",
|
|
39
|
+
oAuth2Scopes: null,
|
|
40
|
+
resolvedSecurity: requestSecurity,
|
|
41
|
+
securitySource: client._options.apiKey,
|
|
42
|
+
retryConfig: options?.retries
|
|
43
|
+
|| client._options.retryConfig
|
|
44
|
+
|| {
|
|
45
|
+
strategy: "backoff",
|
|
46
|
+
backoff: {
|
|
47
|
+
initialInterval: 1000,
|
|
48
|
+
maxInterval: 5000,
|
|
49
|
+
exponent: 1.5,
|
|
50
|
+
maxElapsedTime: 600000,
|
|
51
|
+
},
|
|
52
|
+
retryConnectionErrors: true,
|
|
53
|
+
}
|
|
54
|
+
|| { strategy: "none" },
|
|
55
|
+
retryCodes: options?.retryCodes || ["502", "503", "504"],
|
|
56
|
+
};
|
|
57
|
+
const requestRes = client._createRequest(context, {
|
|
58
|
+
security: requestSecurity,
|
|
59
|
+
method: "GET",
|
|
60
|
+
baseURL: options?.serverURL,
|
|
61
|
+
path: path,
|
|
62
|
+
headers: headers,
|
|
63
|
+
query: query,
|
|
64
|
+
body: body,
|
|
65
|
+
userAgent: client._options.userAgent,
|
|
66
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
67
|
+
}, options);
|
|
68
|
+
if (!requestRes.ok) {
|
|
69
|
+
return [requestRes, { status: "invalid" }];
|
|
70
|
+
}
|
|
71
|
+
const req = requestRes.value;
|
|
72
|
+
const doResult = await client._do(req, {
|
|
73
|
+
context,
|
|
74
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
75
|
+
retryConfig: context.retryConfig,
|
|
76
|
+
retryCodes: context.retryCodes,
|
|
77
|
+
});
|
|
78
|
+
if (!doResult.ok) {
|
|
79
|
+
return [doResult, { status: "request-error", request: req }];
|
|
80
|
+
}
|
|
81
|
+
const response = doResult.value;
|
|
82
|
+
const responseFields = {
|
|
83
|
+
HttpMeta: { Response: response, Request: req },
|
|
84
|
+
};
|
|
85
|
+
const [result] = await M.match(M.json(200, operations.ListEnvironmentCreatorsResponse$inboundSchema), M.jsonErr([400, 401, 403, 404, 409, 413, 422, 429], errors.ErrorT$inboundSchema), M.jsonErr([500, 503], errors.ErrorT$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
86
|
+
if (!result.ok) {
|
|
87
|
+
return [result, { status: "complete", request: req, response }];
|
|
88
|
+
}
|
|
89
|
+
return [result, { status: "complete", request: req, response }];
|
|
90
|
+
}
|
|
@@ -24,6 +24,8 @@ async function $do(client, request, options) {
|
|
|
24
24
|
const body = null;
|
|
25
25
|
const path = pathToFunc("/v1/environments")();
|
|
26
26
|
const query = encodeFormQuery({
|
|
27
|
+
"appId": payload?.appId,
|
|
28
|
+
"createdBy": payload?.createdBy,
|
|
27
29
|
"cursor": payload?.cursor,
|
|
28
30
|
"label": payload?.label,
|
|
29
31
|
"limit": payload?.limit,
|
|
@@ -24,16 +24,20 @@ async function $do(client, request, options) {
|
|
|
24
24
|
const body = null;
|
|
25
25
|
const path = pathToFunc("/v1/requests")();
|
|
26
26
|
const query = encodeFormQuery({
|
|
27
|
-
"
|
|
27
|
+
"appName": payload.appName,
|
|
28
28
|
"cursor": payload.cursor,
|
|
29
29
|
"environmentId": payload.environmentId,
|
|
30
30
|
"from": payload.from,
|
|
31
31
|
"limit": payload.limit,
|
|
32
|
+
"mcpServer": payload.mcpServer,
|
|
32
33
|
"method": payload.method,
|
|
34
|
+
"operation": payload.operation,
|
|
33
35
|
"responseStatus": payload.responseStatus,
|
|
34
36
|
"search": payload.search,
|
|
37
|
+
"service": payload.service,
|
|
35
38
|
"statusClass": payload.statusClass,
|
|
36
39
|
"to": payload.to,
|
|
40
|
+
"tool": payload.tool,
|
|
37
41
|
"writesOnly": payload.writesOnly,
|
|
38
42
|
});
|
|
39
43
|
const headers = new Headers(compactMap({
|
|
@@ -25,14 +25,18 @@ async function $do(client, request, options) {
|
|
|
25
25
|
const body = null;
|
|
26
26
|
const path = pathToFunc("/v1/requests/stats")();
|
|
27
27
|
const query = encodeFormQuery({
|
|
28
|
-
"
|
|
28
|
+
"appName": payload.appName,
|
|
29
29
|
"environmentId": payload.environmentId,
|
|
30
30
|
"from": payload.from,
|
|
31
|
+
"mcpServer": payload.mcpServer,
|
|
31
32
|
"method": payload.method,
|
|
33
|
+
"operation": payload.operation,
|
|
32
34
|
"responseStatus": payload.responseStatus,
|
|
33
35
|
"search": payload.search,
|
|
36
|
+
"service": payload.service,
|
|
34
37
|
"statusClass": payload.statusClass,
|
|
35
38
|
"to": payload.to,
|
|
39
|
+
"tool": payload.tool,
|
|
36
40
|
"writesOnly": payload.writesOnly,
|
|
37
41
|
});
|
|
38
42
|
const headers = new Headers(compactMap({
|
package/esm/lib/config.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ export declare function serverURLFromOptions(options: SDKOptions): URL | null;
|
|
|
31
31
|
export declare const SDK_METADATA: {
|
|
32
32
|
readonly language: "typescript";
|
|
33
33
|
readonly openapiDocVersion: "1.0.0";
|
|
34
|
-
readonly sdkVersion: "0.
|
|
34
|
+
readonly sdkVersion: "0.8.1";
|
|
35
35
|
readonly genVersion: "2.941.0";
|
|
36
|
-
readonly userAgent: "speakeasy-sdk/typescript 0.
|
|
36
|
+
readonly userAgent: "speakeasy-sdk/typescript 0.8.1 2.941.0 1.0.0 @usestatemachines/sdk";
|
|
37
37
|
};
|
package/esm/lib/config.js
CHANGED
|
@@ -24,7 +24,7 @@ export function serverURLFromOptions(options) {
|
|
|
24
24
|
export const SDK_METADATA = {
|
|
25
25
|
language: "typescript",
|
|
26
26
|
openapiDocVersion: "1.0.0",
|
|
27
|
-
sdkVersion: "0.
|
|
27
|
+
sdkVersion: "0.8.1",
|
|
28
28
|
genVersion: "2.941.0",
|
|
29
|
-
userAgent: "speakeasy-sdk/typescript 0.
|
|
29
|
+
userAgent: "speakeasy-sdk/typescript 0.8.1 2.941.0 1.0.0 @usestatemachines/sdk",
|
|
30
30
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as z from "zod/v4-mini";
|
|
2
|
+
import { CreateEnvironmentApp, CreateEnvironmentApp$Outbound } from "./create-environment-app.js";
|
|
3
|
+
export type AppEntry = CreateEnvironmentApp | string;
|
|
4
|
+
/** @internal */
|
|
5
|
+
export type AppEntry$Outbound = CreateEnvironmentApp$Outbound | string;
|
|
6
|
+
/** @internal */
|
|
7
|
+
export declare const AppEntry$outboundSchema: z.ZodMiniType<AppEntry$Outbound, AppEntry>;
|
|
8
|
+
export declare function appEntryToJSON(appEntry: AppEntry): string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as z from "zod/v4-mini";
|
|
5
|
+
import { smartUnion } from "../types/smart-union.js";
|
|
6
|
+
import { CreateEnvironmentApp$outboundSchema, } from "./create-environment-app.js";
|
|
7
|
+
/** @internal */
|
|
8
|
+
export const AppEntry$outboundSchema = smartUnion([CreateEnvironmentApp$outboundSchema, z.string()]);
|
|
9
|
+
export function appEntryToJSON(appEntry) {
|
|
10
|
+
return JSON.stringify(AppEntry$outboundSchema.parse(appEntry));
|
|
11
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as z from "zod/v4-mini";
|
|
2
|
+
export type CreateEnvironmentApp = {
|
|
3
|
+
appId: string;
|
|
4
|
+
name?: string | undefined;
|
|
5
|
+
services?: {
|
|
6
|
+
[k: string]: any;
|
|
7
|
+
} | undefined;
|
|
8
|
+
setup?: {
|
|
9
|
+
[k: string]: any;
|
|
10
|
+
} | undefined;
|
|
11
|
+
};
|
|
12
|
+
/** @internal */
|
|
13
|
+
export type CreateEnvironmentApp$Outbound = {
|
|
14
|
+
appId: string;
|
|
15
|
+
name?: string | undefined;
|
|
16
|
+
services?: {
|
|
17
|
+
[k: string]: any;
|
|
18
|
+
} | undefined;
|
|
19
|
+
setup?: {
|
|
20
|
+
[k: string]: any;
|
|
21
|
+
} | undefined;
|
|
22
|
+
};
|
|
23
|
+
/** @internal */
|
|
24
|
+
export declare const CreateEnvironmentApp$outboundSchema: z.ZodMiniType<CreateEnvironmentApp$Outbound, CreateEnvironmentApp>;
|
|
25
|
+
export declare function createEnvironmentAppToJSON(createEnvironmentApp: CreateEnvironmentApp): string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as z from "zod/v4-mini";
|
|
5
|
+
/** @internal */
|
|
6
|
+
export const CreateEnvironmentApp$outboundSchema = z.object({
|
|
7
|
+
appId: z.string(),
|
|
8
|
+
name: z.optional(z.string()),
|
|
9
|
+
services: z.optional(z.record(z.string(), z.any())),
|
|
10
|
+
setup: z.optional(z.record(z.string(), z.any())),
|
|
11
|
+
});
|
|
12
|
+
export function createEnvironmentAppToJSON(createEnvironmentApp) {
|
|
13
|
+
return JSON.stringify(CreateEnvironmentApp$outboundSchema.parse(createEnvironmentApp));
|
|
14
|
+
}
|
|
@@ -1,14 +1,7 @@
|
|
|
1
1
|
import * as z from "zod/v4-mini";
|
|
2
|
-
|
|
3
|
-
app: string;
|
|
4
|
-
name?: string | undefined;
|
|
5
|
-
settings?: {
|
|
6
|
-
[k: string]: any;
|
|
7
|
-
} | undefined;
|
|
8
|
-
};
|
|
9
|
-
export type AppUnion = CreateEnvironmentApp | string;
|
|
2
|
+
import { AppEntry, AppEntry$Outbound } from "./app-entry.js";
|
|
10
3
|
export type CreateEnvironment = {
|
|
11
|
-
apps?: Array<
|
|
4
|
+
apps?: Array<AppEntry> | undefined;
|
|
12
5
|
labels?: {
|
|
13
6
|
[k: string]: string;
|
|
14
7
|
} | undefined;
|
|
@@ -19,24 +12,8 @@ export type CreateEnvironment = {
|
|
|
19
12
|
workspaceId?: string | undefined;
|
|
20
13
|
};
|
|
21
14
|
/** @internal */
|
|
22
|
-
export type CreateEnvironmentApp$Outbound = {
|
|
23
|
-
app: string;
|
|
24
|
-
name?: string | undefined;
|
|
25
|
-
settings?: {
|
|
26
|
-
[k: string]: any;
|
|
27
|
-
} | undefined;
|
|
28
|
-
};
|
|
29
|
-
/** @internal */
|
|
30
|
-
export declare const CreateEnvironmentApp$outboundSchema: z.ZodMiniType<CreateEnvironmentApp$Outbound, CreateEnvironmentApp>;
|
|
31
|
-
export declare function createEnvironmentAppToJSON(createEnvironmentApp: CreateEnvironmentApp): string;
|
|
32
|
-
/** @internal */
|
|
33
|
-
export type AppUnion$Outbound = CreateEnvironmentApp$Outbound | string;
|
|
34
|
-
/** @internal */
|
|
35
|
-
export declare const AppUnion$outboundSchema: z.ZodMiniType<AppUnion$Outbound, AppUnion>;
|
|
36
|
-
export declare function appUnionToJSON(appUnion: AppUnion): string;
|
|
37
|
-
/** @internal */
|
|
38
15
|
export type CreateEnvironment$Outbound = {
|
|
39
|
-
apps?: Array<
|
|
16
|
+
apps?: Array<AppEntry$Outbound> | undefined;
|
|
40
17
|
labels?: {
|
|
41
18
|
[k: string]: string;
|
|
42
19
|
} | undefined;
|
|
@@ -2,27 +2,10 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
import * as z from "zod/v4-mini";
|
|
5
|
-
import {
|
|
6
|
-
/** @internal */
|
|
7
|
-
export const CreateEnvironmentApp$outboundSchema = z.object({
|
|
8
|
-
app: z.string(),
|
|
9
|
-
name: z.optional(z.string()),
|
|
10
|
-
settings: z.optional(z.record(z.string(), z.any())),
|
|
11
|
-
});
|
|
12
|
-
export function createEnvironmentAppToJSON(createEnvironmentApp) {
|
|
13
|
-
return JSON.stringify(CreateEnvironmentApp$outboundSchema.parse(createEnvironmentApp));
|
|
14
|
-
}
|
|
15
|
-
/** @internal */
|
|
16
|
-
export const AppUnion$outboundSchema = smartUnion([z.lazy(() => CreateEnvironmentApp$outboundSchema), z.string()]);
|
|
17
|
-
export function appUnionToJSON(appUnion) {
|
|
18
|
-
return JSON.stringify(AppUnion$outboundSchema.parse(appUnion));
|
|
19
|
-
}
|
|
5
|
+
import { AppEntry$outboundSchema, } from "./app-entry.js";
|
|
20
6
|
/** @internal */
|
|
21
7
|
export const CreateEnvironment$outboundSchema = z.object({
|
|
22
|
-
apps: z.optional(z.array(
|
|
23
|
-
z.lazy(() => CreateEnvironmentApp$outboundSchema),
|
|
24
|
-
z.string(),
|
|
25
|
-
]))),
|
|
8
|
+
apps: z.optional(z.array(AppEntry$outboundSchema)),
|
|
26
9
|
labels: z.optional(z.record(z.string(), z.string())),
|
|
27
10
|
name: z.optional(z.nullable(z.string())),
|
|
28
11
|
snapshotId: z.optional(z.string()),
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import * as z from "zod/v4-mini";
|
|
2
|
+
import * as discriminatedUnionTypes from "../types/discriminated-union.js";
|
|
3
|
+
import { OpenEnum } from "../types/enums.js";
|
|
4
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
5
|
+
import { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
6
|
+
export declare const ApiKeyKind: {
|
|
7
|
+
readonly Dashboard: "dashboard";
|
|
8
|
+
readonly CliRun: "cli_run";
|
|
9
|
+
readonly EnvPull: "env_pull";
|
|
10
|
+
};
|
|
11
|
+
export type ApiKeyKind = OpenEnum<typeof ApiKeyKind>;
|
|
12
|
+
export type CredentialAPIKey = {
|
|
13
|
+
apiKeyKind: ApiKeyKind;
|
|
14
|
+
expiresAt: Date | null;
|
|
15
|
+
id: string;
|
|
16
|
+
idleExpiresAt: any | null;
|
|
17
|
+
kind: "api_key";
|
|
18
|
+
name: string;
|
|
19
|
+
};
|
|
20
|
+
export type CredentialCliToken = {
|
|
21
|
+
apiKeyKind: any | null;
|
|
22
|
+
expiresAt: Date;
|
|
23
|
+
id: string;
|
|
24
|
+
idleExpiresAt: Date;
|
|
25
|
+
kind: "cli_token";
|
|
26
|
+
name: string;
|
|
27
|
+
};
|
|
28
|
+
export type CredentialSession = {
|
|
29
|
+
apiKeyKind: any | null;
|
|
30
|
+
expiresAt: Date;
|
|
31
|
+
id: string;
|
|
32
|
+
idleExpiresAt: any | null;
|
|
33
|
+
kind: "session";
|
|
34
|
+
name: any | null;
|
|
35
|
+
};
|
|
36
|
+
export type Credential = CredentialSession | CredentialCliToken | CredentialAPIKey | discriminatedUnionTypes.Unknown<"kind">;
|
|
37
|
+
/** @internal */
|
|
38
|
+
export declare const ApiKeyKind$inboundSchema: z.ZodMiniType<ApiKeyKind, unknown>;
|
|
39
|
+
/** @internal */
|
|
40
|
+
export declare const CredentialAPIKey$inboundSchema: z.ZodMiniType<CredentialAPIKey, unknown>;
|
|
41
|
+
export declare function credentialAPIKeyFromJSON(jsonString: string): SafeParseResult<CredentialAPIKey, SDKValidationError>;
|
|
42
|
+
/** @internal */
|
|
43
|
+
export declare const CredentialCliToken$inboundSchema: z.ZodMiniType<CredentialCliToken, unknown>;
|
|
44
|
+
export declare function credentialCliTokenFromJSON(jsonString: string): SafeParseResult<CredentialCliToken, SDKValidationError>;
|
|
45
|
+
/** @internal */
|
|
46
|
+
export declare const CredentialSession$inboundSchema: z.ZodMiniType<CredentialSession, unknown>;
|
|
47
|
+
export declare function credentialSessionFromJSON(jsonString: string): SafeParseResult<CredentialSession, SDKValidationError>;
|
|
48
|
+
/** @internal */
|
|
49
|
+
export declare const Credential$inboundSchema: z.ZodMiniType<Credential, unknown>;
|
|
50
|
+
export declare function credentialFromJSON(jsonString: string): SafeParseResult<Credential, SDKValidationError>;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as z from "zod/v4-mini";
|
|
5
|
+
import { safeParse } from "../lib/schemas.js";
|
|
6
|
+
import { discriminatedUnion } from "../types/discriminated-union.js";
|
|
7
|
+
import * as openEnums from "../types/enums.js";
|
|
8
|
+
import * as types from "../types/primitives.js";
|
|
9
|
+
export const ApiKeyKind = {
|
|
10
|
+
Dashboard: "dashboard",
|
|
11
|
+
CliRun: "cli_run",
|
|
12
|
+
EnvPull: "env_pull",
|
|
13
|
+
};
|
|
14
|
+
/** @internal */
|
|
15
|
+
export const ApiKeyKind$inboundSchema = openEnums.inboundSchema(ApiKeyKind);
|
|
16
|
+
/** @internal */
|
|
17
|
+
export const CredentialAPIKey$inboundSchema = z.object({
|
|
18
|
+
apiKeyKind: ApiKeyKind$inboundSchema,
|
|
19
|
+
expiresAt: types.nullable(types.date()),
|
|
20
|
+
id: types.string(),
|
|
21
|
+
idleExpiresAt: types.nullable(z.any()),
|
|
22
|
+
kind: types.literal("api_key"),
|
|
23
|
+
name: types.string(),
|
|
24
|
+
});
|
|
25
|
+
export function credentialAPIKeyFromJSON(jsonString) {
|
|
26
|
+
return safeParse(jsonString, (x) => CredentialAPIKey$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CredentialAPIKey' from JSON`);
|
|
27
|
+
}
|
|
28
|
+
/** @internal */
|
|
29
|
+
export const CredentialCliToken$inboundSchema = z.object({
|
|
30
|
+
apiKeyKind: types.nullable(z.any()),
|
|
31
|
+
expiresAt: types.date(),
|
|
32
|
+
id: types.string(),
|
|
33
|
+
idleExpiresAt: types.date(),
|
|
34
|
+
kind: types.literal("cli_token"),
|
|
35
|
+
name: types.string(),
|
|
36
|
+
});
|
|
37
|
+
export function credentialCliTokenFromJSON(jsonString) {
|
|
38
|
+
return safeParse(jsonString, (x) => CredentialCliToken$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CredentialCliToken' from JSON`);
|
|
39
|
+
}
|
|
40
|
+
/** @internal */
|
|
41
|
+
export const CredentialSession$inboundSchema = z.object({
|
|
42
|
+
apiKeyKind: types.nullable(z.any()),
|
|
43
|
+
expiresAt: types.date(),
|
|
44
|
+
id: types.string(),
|
|
45
|
+
idleExpiresAt: types.nullable(z.any()),
|
|
46
|
+
kind: types.literal("session"),
|
|
47
|
+
name: types.nullable(z.any()),
|
|
48
|
+
});
|
|
49
|
+
export function credentialSessionFromJSON(jsonString) {
|
|
50
|
+
return safeParse(jsonString, (x) => CredentialSession$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CredentialSession' from JSON`);
|
|
51
|
+
}
|
|
52
|
+
/** @internal */
|
|
53
|
+
export const Credential$inboundSchema = discriminatedUnion("kind", {
|
|
54
|
+
session: z.lazy(() => CredentialSession$inboundSchema),
|
|
55
|
+
cli_token: z.lazy(() => CredentialCliToken$inboundSchema),
|
|
56
|
+
api_key: z.lazy(() => CredentialAPIKey$inboundSchema),
|
|
57
|
+
});
|
|
58
|
+
export function credentialFromJSON(jsonString) {
|
|
59
|
+
return safeParse(jsonString, (x) => Credential$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Credential' from JSON`);
|
|
60
|
+
}
|
|
@@ -11,21 +11,42 @@ export type Login = {
|
|
|
11
11
|
};
|
|
12
12
|
url: string;
|
|
13
13
|
};
|
|
14
|
+
export type CredentialsMcpServer = {
|
|
15
|
+
name: string;
|
|
16
|
+
/**
|
|
17
|
+
* The MCP server's URL. On an environment created with `tokenInUrl`, a request with no `Authorization` header acts as the actor that this call picks when you send no `actorId`. To act as `actorId`, send the service's headers.
|
|
18
|
+
*/
|
|
19
|
+
url: string;
|
|
20
|
+
};
|
|
21
|
+
export type CredentialsService = {
|
|
22
|
+
headers: {
|
|
23
|
+
[k: string]: string;
|
|
24
|
+
};
|
|
25
|
+
id: string;
|
|
26
|
+
servers?: Array<CredentialsMcpServer> | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* The URL where the service's paths start: the app URL followed by the service's path. The `url` of the service at `/` is the app URL itself. On an environment created with `tokenInUrl`, the app URL is in its token form. A client of a service that serves MCP servers calls the URL of one of its MCP servers instead.
|
|
29
|
+
*/
|
|
30
|
+
url: string;
|
|
31
|
+
};
|
|
14
32
|
export type Credentials = {
|
|
15
33
|
actorId: string;
|
|
16
|
-
|
|
34
|
+
appName: string;
|
|
17
35
|
environmentId: string;
|
|
18
36
|
expiresAt: Date;
|
|
19
|
-
headers: {
|
|
20
|
-
[k: string]: string;
|
|
21
|
-
};
|
|
22
37
|
login: Login | null;
|
|
38
|
+
services: Array<CredentialsService>;
|
|
23
39
|
token: string;
|
|
24
|
-
url: string;
|
|
25
40
|
};
|
|
26
41
|
/** @internal */
|
|
27
42
|
export declare const Login$inboundSchema: z.ZodMiniType<Login, unknown>;
|
|
28
43
|
export declare function loginFromJSON(jsonString: string): SafeParseResult<Login, SDKValidationError>;
|
|
29
44
|
/** @internal */
|
|
45
|
+
export declare const CredentialsMcpServer$inboundSchema: z.ZodMiniType<CredentialsMcpServer, unknown>;
|
|
46
|
+
export declare function credentialsMcpServerFromJSON(jsonString: string): SafeParseResult<CredentialsMcpServer, SDKValidationError>;
|
|
47
|
+
/** @internal */
|
|
48
|
+
export declare const CredentialsService$inboundSchema: z.ZodMiniType<CredentialsService, unknown>;
|
|
49
|
+
export declare function credentialsServiceFromJSON(jsonString: string): SafeParseResult<CredentialsService, SDKValidationError>;
|
|
50
|
+
/** @internal */
|
|
30
51
|
export declare const Credentials$inboundSchema: z.ZodMiniType<Credentials, unknown>;
|
|
31
52
|
export declare function credentialsFromJSON(jsonString: string): SafeParseResult<Credentials, SDKValidationError>;
|
|
@@ -15,16 +15,33 @@ export function loginFromJSON(jsonString) {
|
|
|
15
15
|
return safeParse(jsonString, (x) => Login$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Login' from JSON`);
|
|
16
16
|
}
|
|
17
17
|
/** @internal */
|
|
18
|
+
export const CredentialsMcpServer$inboundSchema = z.object({
|
|
19
|
+
name: types.string(),
|
|
20
|
+
url: types.string(),
|
|
21
|
+
});
|
|
22
|
+
export function credentialsMcpServerFromJSON(jsonString) {
|
|
23
|
+
return safeParse(jsonString, (x) => CredentialsMcpServer$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CredentialsMcpServer' from JSON`);
|
|
24
|
+
}
|
|
25
|
+
/** @internal */
|
|
26
|
+
export const CredentialsService$inboundSchema = z.object({
|
|
27
|
+
headers: z.record(z.string(), types.string()),
|
|
28
|
+
id: types.string(),
|
|
29
|
+
servers: types.optional(z.array(z.lazy(() => CredentialsMcpServer$inboundSchema))),
|
|
30
|
+
url: types.string(),
|
|
31
|
+
});
|
|
32
|
+
export function credentialsServiceFromJSON(jsonString) {
|
|
33
|
+
return safeParse(jsonString, (x) => CredentialsService$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CredentialsService' from JSON`);
|
|
34
|
+
}
|
|
35
|
+
/** @internal */
|
|
18
36
|
export const Credentials$inboundSchema = z
|
|
19
37
|
.object({
|
|
20
38
|
actorId: types.string(),
|
|
21
|
-
|
|
39
|
+
appName: types.string(),
|
|
22
40
|
environmentId: types.string(),
|
|
23
41
|
expiresAt: types.date(),
|
|
24
|
-
headers: z.record(z.string(), types.string()),
|
|
25
42
|
login: types.nullable(z.lazy(() => Login$inboundSchema)),
|
|
43
|
+
services: z.array(z.lazy(() => CredentialsService$inboundSchema)),
|
|
26
44
|
token: types.string(),
|
|
27
|
-
url: types.string(),
|
|
28
45
|
});
|
|
29
46
|
export function credentialsFromJSON(jsonString) {
|
|
30
47
|
return safeParse(jsonString, (x) => Credentials$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Credentials' from JSON`);
|
|
@@ -6,11 +6,12 @@ export declare const EnvironmentFailureCode: {
|
|
|
6
6
|
readonly StartFailed: "start_failed";
|
|
7
7
|
readonly PauseRemoved: "pause_removed";
|
|
8
8
|
readonly VersionUnavailable: "version_unavailable";
|
|
9
|
-
readonly
|
|
9
|
+
readonly InvalidSetup: "invalid_setup";
|
|
10
|
+
readonly InvalidServices: "invalid_services";
|
|
10
11
|
};
|
|
11
12
|
export type EnvironmentFailureCode = OpenEnum<typeof EnvironmentFailureCode>;
|
|
12
13
|
export type EnvironmentFailure = {
|
|
13
|
-
|
|
14
|
+
appName: string;
|
|
14
15
|
code: EnvironmentFailureCode;
|
|
15
16
|
message: string;
|
|
16
17
|
};
|
|
@@ -9,13 +9,14 @@ export const EnvironmentFailureCode = {
|
|
|
9
9
|
StartFailed: "start_failed",
|
|
10
10
|
PauseRemoved: "pause_removed",
|
|
11
11
|
VersionUnavailable: "version_unavailable",
|
|
12
|
-
|
|
12
|
+
InvalidSetup: "invalid_setup",
|
|
13
|
+
InvalidServices: "invalid_services",
|
|
13
14
|
};
|
|
14
15
|
/** @internal */
|
|
15
16
|
export const EnvironmentFailureCode$inboundSchema = openEnums.inboundSchema(EnvironmentFailureCode);
|
|
16
17
|
/** @internal */
|
|
17
18
|
export const EnvironmentFailure$inboundSchema = z.object({
|
|
18
|
-
|
|
19
|
+
appName: types.string(),
|
|
19
20
|
code: EnvironmentFailureCode$inboundSchema,
|
|
20
21
|
message: types.string(),
|
|
21
22
|
});
|
|
@@ -17,7 +17,8 @@ export const Reason = {
|
|
|
17
17
|
export const EnvironmentApp$inboundSchema = z.object({
|
|
18
18
|
appId: types.string(),
|
|
19
19
|
name: types.string(),
|
|
20
|
-
|
|
20
|
+
services: z.record(z.string(), z.any()),
|
|
21
|
+
setup: z.record(z.string(), z.any()),
|
|
21
22
|
url: types.string(),
|
|
22
23
|
version: types.string(),
|
|
23
24
|
versionId: types.string(),
|
package/esm/models/error.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export declare const ErrorCode: {
|
|
|
18
18
|
readonly BodyTooLarge: "body_too_large";
|
|
19
19
|
readonly VersionUnavailable: "version_unavailable";
|
|
20
20
|
readonly EnvironmentLimitReached: "environment_limit_reached";
|
|
21
|
+
readonly RateLimited: "rate_limited";
|
|
21
22
|
readonly InternalError: "internal_error";
|
|
22
23
|
readonly Unavailable: "unavailable";
|
|
23
24
|
};
|
package/esm/models/error.js
CHANGED
|
@@ -21,6 +21,7 @@ export const ErrorCode = {
|
|
|
21
21
|
BodyTooLarge: "body_too_large",
|
|
22
22
|
VersionUnavailable: "version_unavailable",
|
|
23
23
|
EnvironmentLimitReached: "environment_limit_reached",
|
|
24
|
+
RateLimited: "rate_limited",
|
|
24
25
|
InternalError: "internal_error",
|
|
25
26
|
Unavailable: "unavailable",
|
|
26
27
|
};
|
package/esm/models/index.d.ts
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
export * from "./actor.js";
|
|
2
|
-
export * from "./
|
|
2
|
+
export * from "./app-entry.js";
|
|
3
3
|
export * from "./app.js";
|
|
4
4
|
export * from "./audit-event.js";
|
|
5
5
|
export * from "./body-preview.js";
|
|
6
|
+
export * from "./create-environment-app.js";
|
|
6
7
|
export * from "./create-environment.js";
|
|
8
|
+
export * from "./credential.js";
|
|
7
9
|
export * from "./credentials.js";
|
|
8
10
|
export * from "./environment-failure.js";
|
|
9
11
|
export * from "./environment-status.js";
|
|
10
12
|
export * from "./environment.js";
|
|
11
13
|
export * from "./error.js";
|
|
14
|
+
export * from "./mcp-server.js";
|
|
15
|
+
export * from "./mcp-tool.js";
|
|
12
16
|
export * from "./me.js";
|
|
13
17
|
export * from "./permission.js";
|
|
14
18
|
export * from "./principal.js";
|
|
@@ -16,6 +20,7 @@ export * from "./request-detail.js";
|
|
|
16
20
|
export * from "./request-stats.js";
|
|
17
21
|
export * from "./request.js";
|
|
18
22
|
export * from "./security.js";
|
|
23
|
+
export * from "./service.js";
|
|
19
24
|
export * from "./snapshot-status.js";
|
|
20
25
|
export * from "./snapshot.js";
|
|
21
26
|
export * from "./version.js";
|
package/esm/models/index.js
CHANGED
|
@@ -2,16 +2,20 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
export * from "./actor.js";
|
|
5
|
-
export * from "./
|
|
5
|
+
export * from "./app-entry.js";
|
|
6
6
|
export * from "./app.js";
|
|
7
7
|
export * from "./audit-event.js";
|
|
8
8
|
export * from "./body-preview.js";
|
|
9
|
+
export * from "./create-environment-app.js";
|
|
9
10
|
export * from "./create-environment.js";
|
|
11
|
+
export * from "./credential.js";
|
|
10
12
|
export * from "./credentials.js";
|
|
11
13
|
export * from "./environment-failure.js";
|
|
12
14
|
export * from "./environment-status.js";
|
|
13
15
|
export * from "./environment.js";
|
|
14
16
|
export * from "./error.js";
|
|
17
|
+
export * from "./mcp-server.js";
|
|
18
|
+
export * from "./mcp-tool.js";
|
|
15
19
|
export * from "./me.js";
|
|
16
20
|
export * from "./permission.js";
|
|
17
21
|
export * from "./principal.js";
|
|
@@ -19,6 +23,7 @@ export * from "./request-detail.js";
|
|
|
19
23
|
export * from "./request-stats.js";
|
|
20
24
|
export * from "./request.js";
|
|
21
25
|
export * from "./security.js";
|
|
26
|
+
export * from "./service.js";
|
|
22
27
|
export * from "./snapshot-status.js";
|
|
23
28
|
export * from "./snapshot.js";
|
|
24
29
|
export * from "./version.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as z from "zod/v4-mini";
|
|
2
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
|
+
import { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
4
|
+
import { McpTool } from "./mcp-tool.js";
|
|
5
|
+
export type McpServer = {
|
|
6
|
+
name: string;
|
|
7
|
+
tools: Array<McpTool>;
|
|
8
|
+
};
|
|
9
|
+
/** @internal */
|
|
10
|
+
export declare const McpServer$inboundSchema: z.ZodMiniType<McpServer, unknown>;
|
|
11
|
+
export declare function mcpServerFromJSON(jsonString: string): SafeParseResult<McpServer, SDKValidationError>;
|