@usestatemachines/sdk 0.1.1 → 0.2.0
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 +175 -75
- package/agents/SKILL.md +24 -44
- package/agents/index.js +7 -7
- package/agents/llms.txt +18 -39
- package/agents/prompt.md +11 -34
- package/esm/extensions/apps.d.ts +8 -0
- package/esm/extensions/apps.js +23 -0
- package/esm/extensions/client.d.ts +33 -3
- package/esm/extensions/client.js +144 -28
- package/esm/extensions/errors.d.ts +24 -5
- package/esm/extensions/errors.js +3 -2
- package/esm/extensions/index.d.ts +3 -1
- package/esm/extensions/index.js +1 -0
- package/esm/extensions/running-environment.d.ts +29 -0
- package/esm/extensions/running-environment.js +35 -0
- package/esm/extensions/signal.d.ts +1 -2
- package/esm/extensions/signal.js +9 -4
- package/esm/extensions/wait.d.ts +1 -0
- package/esm/extensions/wait.js +1 -1
- package/esm/funcs/create-environment-definition.d.ts +11 -0
- package/esm/funcs/create-environment-definition.js +94 -0
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/connection-secret.d.ts +16 -0
- package/esm/models/connection-secret.js +13 -0
- package/esm/models/connection.d.ts +14 -0
- package/esm/models/connection.js +14 -0
- package/esm/models/error-response.d.ts +4 -0
- package/esm/models/error-response.js +4 -0
- package/esm/models/operations/create-environment-definition.d.ts +143 -0
- package/esm/models/operations/create-environment-definition.js +90 -0
- package/esm/models/operations/index.d.ts +1 -0
- package/esm/models/operations/index.js +1 -0
- package/esm/models/operations/reveal-connection.d.ts +26 -4
- package/esm/models/operations/reveal-connection.js +28 -2
- package/esm/sdk/sdk.d.ts +3 -1
- package/esm/sdk/sdk.js +5 -0
- package/openapi.json +394 -7
- package/package.json +1 -1
|
@@ -5,13 +5,26 @@ import * as z from "zod/v4-mini";
|
|
|
5
5
|
import { safeParse } from "../lib/schemas.js";
|
|
6
6
|
import * as types from "../types/primitives.js";
|
|
7
7
|
/** @internal */
|
|
8
|
+
export const Native$inboundSchema = z.object({
|
|
9
|
+
authentication: types.string(),
|
|
10
|
+
baseUrl: types.string(),
|
|
11
|
+
credentials: z.record(z.string(), types.string()),
|
|
12
|
+
key: types.string(),
|
|
13
|
+
parameters: z.record(z.string(), types.string()),
|
|
14
|
+
});
|
|
15
|
+
export function nativeFromJSON(jsonString) {
|
|
16
|
+
return safeParse(jsonString, (x) => Native$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Native' from JSON`);
|
|
17
|
+
}
|
|
18
|
+
/** @internal */
|
|
8
19
|
export const ConnectionSecret$inboundSchema = z.object({
|
|
9
20
|
actorId: types.string(),
|
|
10
21
|
actorToken: types.string(),
|
|
11
22
|
appKey: types.string(),
|
|
23
|
+
connectionKey: types.nullable(types.string()),
|
|
12
24
|
environmentId: types.string(),
|
|
13
25
|
environmentToken: types.string(),
|
|
14
26
|
expiresAt: types.date(),
|
|
27
|
+
native: types.optional(z.lazy(() => Native$inboundSchema)),
|
|
15
28
|
});
|
|
16
29
|
export function connectionSecretFromJSON(jsonString) {
|
|
17
30
|
return safeParse(jsonString, (x) => ConnectionSecret$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ConnectionSecret' from JSON`);
|
|
@@ -4,6 +4,15 @@ import { Result as SafeParseResult } from "../types/fp.js";
|
|
|
4
4
|
import { ApiProfile } from "./api-profile.js";
|
|
5
5
|
import { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
6
6
|
import { ReleaseActor } from "./release-actor.js";
|
|
7
|
+
export type Connection1 = {
|
|
8
|
+
actorId: string;
|
|
9
|
+
authentication: string;
|
|
10
|
+
key: string;
|
|
11
|
+
parameters: {
|
|
12
|
+
[k: string]: string;
|
|
13
|
+
};
|
|
14
|
+
secrets: Array<string>;
|
|
15
|
+
};
|
|
7
16
|
export declare const ConnectionStatus: {
|
|
8
17
|
readonly Starting: "starting";
|
|
9
18
|
readonly Ready: "ready";
|
|
@@ -15,11 +24,16 @@ export type Connection = {
|
|
|
15
24
|
apis: Array<ApiProfile>;
|
|
16
25
|
appKey: string;
|
|
17
26
|
baseUrl: string | null;
|
|
27
|
+
connections: Array<Connection1>;
|
|
28
|
+
defaultConnection: string | null;
|
|
18
29
|
environmentId: string;
|
|
19
30
|
expiresAt: Date | null;
|
|
20
31
|
status: ConnectionStatus;
|
|
21
32
|
};
|
|
22
33
|
/** @internal */
|
|
34
|
+
export declare const Connection1$inboundSchema: z.ZodMiniType<Connection1, unknown>;
|
|
35
|
+
export declare function connection1FromJSON(jsonString: string): SafeParseResult<Connection1, SDKValidationError>;
|
|
36
|
+
/** @internal */
|
|
23
37
|
export declare const ConnectionStatus$inboundSchema: z.ZodMiniType<ConnectionStatus, unknown>;
|
|
24
38
|
/** @internal */
|
|
25
39
|
export declare const Connection$inboundSchema: z.ZodMiniType<Connection, unknown>;
|
package/esm/models/connection.js
CHANGED
|
@@ -13,6 +13,18 @@ export const ConnectionStatus = {
|
|
|
13
13
|
Unavailable: "unavailable",
|
|
14
14
|
};
|
|
15
15
|
/** @internal */
|
|
16
|
+
export const Connection1$inboundSchema = z
|
|
17
|
+
.object({
|
|
18
|
+
actorId: types.string(),
|
|
19
|
+
authentication: types.string(),
|
|
20
|
+
key: types.string(),
|
|
21
|
+
parameters: z.record(z.string(), types.string()),
|
|
22
|
+
secrets: z.array(types.string()),
|
|
23
|
+
});
|
|
24
|
+
export function connection1FromJSON(jsonString) {
|
|
25
|
+
return safeParse(jsonString, (x) => Connection1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Connection1' from JSON`);
|
|
26
|
+
}
|
|
27
|
+
/** @internal */
|
|
16
28
|
export const ConnectionStatus$inboundSchema = openEnums.inboundSchema(ConnectionStatus);
|
|
17
29
|
/** @internal */
|
|
18
30
|
export const Connection$inboundSchema = z
|
|
@@ -21,6 +33,8 @@ export const Connection$inboundSchema = z
|
|
|
21
33
|
apis: z.array(ApiProfile$inboundSchema),
|
|
22
34
|
appKey: types.string(),
|
|
23
35
|
baseUrl: types.nullable(types.string()),
|
|
36
|
+
connections: z.array(z.lazy(() => Connection1$inboundSchema)),
|
|
37
|
+
defaultConnection: types.nullable(types.string()),
|
|
24
38
|
environmentId: types.string(),
|
|
25
39
|
expiresAt: types.nullable(types.date()),
|
|
26
40
|
status: ConnectionStatus$inboundSchema,
|
|
@@ -4,15 +4,19 @@ import { Result as SafeParseResult } from "../types/fp.js";
|
|
|
4
4
|
import { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
5
5
|
export declare const Code: {
|
|
6
6
|
readonly BodyTooLarge: "body-too-large";
|
|
7
|
+
readonly ConnectionNotAuthorized: "connection-not-authorized";
|
|
7
8
|
readonly ConnectionUnavailable: "connection-unavailable";
|
|
8
9
|
readonly EnvironmentLimit: "environment-limit";
|
|
9
10
|
readonly Forbidden: "forbidden";
|
|
10
11
|
readonly IdempotencyConflict: "idempotency-conflict";
|
|
11
12
|
readonly IdentityRequestRejected: "identity-request-rejected";
|
|
13
|
+
readonly InitializationBusy: "initialization-busy";
|
|
14
|
+
readonly InitializationUnavailable: "initialization-unavailable";
|
|
12
15
|
readonly InternalError: "internal-error";
|
|
13
16
|
readonly InvalidCursor: "invalid-cursor";
|
|
14
17
|
readonly InvalidRequest: "invalid-request";
|
|
15
18
|
readonly InvalidResponse: "invalid-response";
|
|
19
|
+
readonly InvalidSetup: "invalid-setup";
|
|
16
20
|
readonly InvalidWebhook: "invalid-webhook";
|
|
17
21
|
readonly LastOwner: "last-owner";
|
|
18
22
|
readonly LastWorkspace: "last-workspace";
|
|
@@ -7,15 +7,19 @@ import * as openEnums from "../types/enums.js";
|
|
|
7
7
|
import * as types from "../types/primitives.js";
|
|
8
8
|
export const Code = {
|
|
9
9
|
BodyTooLarge: "body-too-large",
|
|
10
|
+
ConnectionNotAuthorized: "connection-not-authorized",
|
|
10
11
|
ConnectionUnavailable: "connection-unavailable",
|
|
11
12
|
EnvironmentLimit: "environment-limit",
|
|
12
13
|
Forbidden: "forbidden",
|
|
13
14
|
IdempotencyConflict: "idempotency-conflict",
|
|
14
15
|
IdentityRequestRejected: "identity-request-rejected",
|
|
16
|
+
InitializationBusy: "initialization-busy",
|
|
17
|
+
InitializationUnavailable: "initialization-unavailable",
|
|
15
18
|
InternalError: "internal-error",
|
|
16
19
|
InvalidCursor: "invalid-cursor",
|
|
17
20
|
InvalidRequest: "invalid-request",
|
|
18
21
|
InvalidResponse: "invalid-response",
|
|
22
|
+
InvalidSetup: "invalid-setup",
|
|
19
23
|
InvalidWebhook: "invalid-webhook",
|
|
20
24
|
LastOwner: "last-owner",
|
|
21
25
|
LastWorkspace: "last-workspace",
|
|
@@ -0,0 +1,143 @@
|
|
|
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 * as models from "../index.js";
|
|
5
|
+
export type From = {
|
|
6
|
+
snapshot: string;
|
|
7
|
+
};
|
|
8
|
+
export type CreateEnvironmentDefinitionRequestBody2 = {
|
|
9
|
+
from: From;
|
|
10
|
+
version?: number | undefined;
|
|
11
|
+
};
|
|
12
|
+
export type Apps = {
|
|
13
|
+
app: string;
|
|
14
|
+
/**
|
|
15
|
+
* Native values validated by the selected replica release.
|
|
16
|
+
*/
|
|
17
|
+
configure?: {
|
|
18
|
+
[k: string]: any;
|
|
19
|
+
} | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Native values validated by the selected replica release.
|
|
22
|
+
*/
|
|
23
|
+
connections?: {
|
|
24
|
+
[k: string]: any;
|
|
25
|
+
} | undefined;
|
|
26
|
+
defaultConnection?: string | undefined;
|
|
27
|
+
preset?: string | undefined;
|
|
28
|
+
release?: string | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Native values validated by the selected replica release.
|
|
31
|
+
*/
|
|
32
|
+
resources?: {
|
|
33
|
+
[k: string]: any;
|
|
34
|
+
} | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* Native values validated by the selected replica release.
|
|
37
|
+
*/
|
|
38
|
+
settings?: {
|
|
39
|
+
[k: string]: any;
|
|
40
|
+
} | undefined;
|
|
41
|
+
};
|
|
42
|
+
export type AppsUnion = Array<string> | {
|
|
43
|
+
[k: string]: Apps;
|
|
44
|
+
};
|
|
45
|
+
export type CreateEnvironmentDefinitionRequestBody1 = {
|
|
46
|
+
apps: Array<string> | {
|
|
47
|
+
[k: string]: Apps;
|
|
48
|
+
};
|
|
49
|
+
labels?: {
|
|
50
|
+
[k: string]: string;
|
|
51
|
+
} | undefined;
|
|
52
|
+
lifetimeMinutes?: number | undefined;
|
|
53
|
+
name?: string | undefined;
|
|
54
|
+
version?: number | undefined;
|
|
55
|
+
};
|
|
56
|
+
export type CreateEnvironmentDefinitionRequestBody = CreateEnvironmentDefinitionRequestBody1 | CreateEnvironmentDefinitionRequestBody2;
|
|
57
|
+
export type CreateEnvironmentDefinitionRequest = {
|
|
58
|
+
workspaceId: string;
|
|
59
|
+
idempotencyKey: string;
|
|
60
|
+
body: CreateEnvironmentDefinitionRequestBody1 | CreateEnvironmentDefinitionRequestBody2;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Environment accepted from its setup definition
|
|
64
|
+
*/
|
|
65
|
+
export type CreateEnvironmentDefinitionResponse = {
|
|
66
|
+
data: models.Environment;
|
|
67
|
+
};
|
|
68
|
+
/** @internal */
|
|
69
|
+
export type From$Outbound = {
|
|
70
|
+
snapshot: string;
|
|
71
|
+
};
|
|
72
|
+
/** @internal */
|
|
73
|
+
export declare const From$outboundSchema: z.ZodMiniType<From$Outbound, From>;
|
|
74
|
+
export declare function fromToJSON(from: From): string;
|
|
75
|
+
/** @internal */
|
|
76
|
+
export type CreateEnvironmentDefinitionRequestBody2$Outbound = {
|
|
77
|
+
from: From$Outbound;
|
|
78
|
+
version: number;
|
|
79
|
+
};
|
|
80
|
+
/** @internal */
|
|
81
|
+
export declare const CreateEnvironmentDefinitionRequestBody2$outboundSchema: z.ZodMiniType<CreateEnvironmentDefinitionRequestBody2$Outbound, CreateEnvironmentDefinitionRequestBody2>;
|
|
82
|
+
export declare function createEnvironmentDefinitionRequestBody2ToJSON(createEnvironmentDefinitionRequestBody2: CreateEnvironmentDefinitionRequestBody2): string;
|
|
83
|
+
/** @internal */
|
|
84
|
+
export type Apps$Outbound = {
|
|
85
|
+
app: string;
|
|
86
|
+
configure?: {
|
|
87
|
+
[k: string]: any;
|
|
88
|
+
} | undefined;
|
|
89
|
+
connections?: {
|
|
90
|
+
[k: string]: any;
|
|
91
|
+
} | undefined;
|
|
92
|
+
defaultConnection?: string | undefined;
|
|
93
|
+
preset?: string | undefined;
|
|
94
|
+
release?: string | undefined;
|
|
95
|
+
resources?: {
|
|
96
|
+
[k: string]: any;
|
|
97
|
+
} | undefined;
|
|
98
|
+
settings?: {
|
|
99
|
+
[k: string]: any;
|
|
100
|
+
} | undefined;
|
|
101
|
+
};
|
|
102
|
+
/** @internal */
|
|
103
|
+
export declare const Apps$outboundSchema: z.ZodMiniType<Apps$Outbound, Apps>;
|
|
104
|
+
export declare function appsToJSON(apps: Apps): string;
|
|
105
|
+
/** @internal */
|
|
106
|
+
export type AppsUnion$Outbound = Array<string> | {
|
|
107
|
+
[k: string]: Apps$Outbound;
|
|
108
|
+
};
|
|
109
|
+
/** @internal */
|
|
110
|
+
export declare const AppsUnion$outboundSchema: z.ZodMiniType<AppsUnion$Outbound, AppsUnion>;
|
|
111
|
+
export declare function appsUnionToJSON(appsUnion: AppsUnion): string;
|
|
112
|
+
/** @internal */
|
|
113
|
+
export type CreateEnvironmentDefinitionRequestBody1$Outbound = {
|
|
114
|
+
apps: Array<string> | {
|
|
115
|
+
[k: string]: Apps$Outbound;
|
|
116
|
+
};
|
|
117
|
+
labels?: {
|
|
118
|
+
[k: string]: string;
|
|
119
|
+
} | undefined;
|
|
120
|
+
lifetimeMinutes?: number | undefined;
|
|
121
|
+
name?: string | undefined;
|
|
122
|
+
version: number;
|
|
123
|
+
};
|
|
124
|
+
/** @internal */
|
|
125
|
+
export declare const CreateEnvironmentDefinitionRequestBody1$outboundSchema: z.ZodMiniType<CreateEnvironmentDefinitionRequestBody1$Outbound, CreateEnvironmentDefinitionRequestBody1>;
|
|
126
|
+
export declare function createEnvironmentDefinitionRequestBody1ToJSON(createEnvironmentDefinitionRequestBody1: CreateEnvironmentDefinitionRequestBody1): string;
|
|
127
|
+
/** @internal */
|
|
128
|
+
export type CreateEnvironmentDefinitionRequestBody$Outbound = CreateEnvironmentDefinitionRequestBody1$Outbound | CreateEnvironmentDefinitionRequestBody2$Outbound;
|
|
129
|
+
/** @internal */
|
|
130
|
+
export declare const CreateEnvironmentDefinitionRequestBody$outboundSchema: z.ZodMiniType<CreateEnvironmentDefinitionRequestBody$Outbound, CreateEnvironmentDefinitionRequestBody>;
|
|
131
|
+
export declare function createEnvironmentDefinitionRequestBodyToJSON(createEnvironmentDefinitionRequestBody: CreateEnvironmentDefinitionRequestBody): string;
|
|
132
|
+
/** @internal */
|
|
133
|
+
export type CreateEnvironmentDefinitionRequest$Outbound = {
|
|
134
|
+
workspaceId: string;
|
|
135
|
+
"idempotency-key": string;
|
|
136
|
+
body: CreateEnvironmentDefinitionRequestBody1$Outbound | CreateEnvironmentDefinitionRequestBody2$Outbound;
|
|
137
|
+
};
|
|
138
|
+
/** @internal */
|
|
139
|
+
export declare const CreateEnvironmentDefinitionRequest$outboundSchema: z.ZodMiniType<CreateEnvironmentDefinitionRequest$Outbound, CreateEnvironmentDefinitionRequest>;
|
|
140
|
+
export declare function createEnvironmentDefinitionRequestToJSON(createEnvironmentDefinitionRequest: CreateEnvironmentDefinitionRequest): string;
|
|
141
|
+
/** @internal */
|
|
142
|
+
export declare const CreateEnvironmentDefinitionResponse$inboundSchema: z.ZodMiniType<CreateEnvironmentDefinitionResponse, unknown>;
|
|
143
|
+
export declare function createEnvironmentDefinitionResponseFromJSON(jsonString: string): SafeParseResult<CreateEnvironmentDefinitionResponse, SDKValidationError>;
|
|
@@ -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 { remap as remap$ } from "../../lib/primitives.js";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { smartUnion } from "../../types/smart-union.js";
|
|
8
|
+
import * as models from "../index.js";
|
|
9
|
+
/** @internal */
|
|
10
|
+
export const From$outboundSchema = z.object({
|
|
11
|
+
snapshot: z.string(),
|
|
12
|
+
});
|
|
13
|
+
export function fromToJSON(from) {
|
|
14
|
+
return JSON.stringify(From$outboundSchema.parse(from));
|
|
15
|
+
}
|
|
16
|
+
/** @internal */
|
|
17
|
+
export const CreateEnvironmentDefinitionRequestBody2$outboundSchema = z.object({
|
|
18
|
+
from: z.lazy(() => From$outboundSchema),
|
|
19
|
+
version: z._default(z.number(), 1),
|
|
20
|
+
});
|
|
21
|
+
export function createEnvironmentDefinitionRequestBody2ToJSON(createEnvironmentDefinitionRequestBody2) {
|
|
22
|
+
return JSON.stringify(CreateEnvironmentDefinitionRequestBody2$outboundSchema.parse(createEnvironmentDefinitionRequestBody2));
|
|
23
|
+
}
|
|
24
|
+
/** @internal */
|
|
25
|
+
export const Apps$outboundSchema = z.object({
|
|
26
|
+
app: z.string(),
|
|
27
|
+
configure: z.optional(z.record(z.string(), z.any())),
|
|
28
|
+
connections: z.optional(z.record(z.string(), z.any())),
|
|
29
|
+
defaultConnection: z.optional(z.string()),
|
|
30
|
+
preset: z.optional(z.string()),
|
|
31
|
+
release: z.optional(z.string()),
|
|
32
|
+
resources: z.optional(z.record(z.string(), z.any())),
|
|
33
|
+
settings: z.optional(z.record(z.string(), z.any())),
|
|
34
|
+
});
|
|
35
|
+
export function appsToJSON(apps) {
|
|
36
|
+
return JSON.stringify(Apps$outboundSchema.parse(apps));
|
|
37
|
+
}
|
|
38
|
+
/** @internal */
|
|
39
|
+
export const AppsUnion$outboundSchema = smartUnion([
|
|
40
|
+
z.array(z.string()),
|
|
41
|
+
z.record(z.string(), z.lazy(() => Apps$outboundSchema)),
|
|
42
|
+
]);
|
|
43
|
+
export function appsUnionToJSON(appsUnion) {
|
|
44
|
+
return JSON.stringify(AppsUnion$outboundSchema.parse(appsUnion));
|
|
45
|
+
}
|
|
46
|
+
/** @internal */
|
|
47
|
+
export const CreateEnvironmentDefinitionRequestBody1$outboundSchema = z.object({
|
|
48
|
+
apps: smartUnion([
|
|
49
|
+
z.array(z.string()),
|
|
50
|
+
z.record(z.string(), z.lazy(() => Apps$outboundSchema)),
|
|
51
|
+
]),
|
|
52
|
+
labels: z.optional(z.record(z.string(), z.string())),
|
|
53
|
+
lifetimeMinutes: z.optional(z.int()),
|
|
54
|
+
name: z.optional(z.string()),
|
|
55
|
+
version: z._default(z.number(), 1),
|
|
56
|
+
});
|
|
57
|
+
export function createEnvironmentDefinitionRequestBody1ToJSON(createEnvironmentDefinitionRequestBody1) {
|
|
58
|
+
return JSON.stringify(CreateEnvironmentDefinitionRequestBody1$outboundSchema.parse(createEnvironmentDefinitionRequestBody1));
|
|
59
|
+
}
|
|
60
|
+
/** @internal */
|
|
61
|
+
export const CreateEnvironmentDefinitionRequestBody$outboundSchema = smartUnion([
|
|
62
|
+
z.lazy(() => CreateEnvironmentDefinitionRequestBody1$outboundSchema),
|
|
63
|
+
z.lazy(() => CreateEnvironmentDefinitionRequestBody2$outboundSchema),
|
|
64
|
+
]);
|
|
65
|
+
export function createEnvironmentDefinitionRequestBodyToJSON(createEnvironmentDefinitionRequestBody) {
|
|
66
|
+
return JSON.stringify(CreateEnvironmentDefinitionRequestBody$outboundSchema.parse(createEnvironmentDefinitionRequestBody));
|
|
67
|
+
}
|
|
68
|
+
/** @internal */
|
|
69
|
+
export const CreateEnvironmentDefinitionRequest$outboundSchema = z.pipe(z.object({
|
|
70
|
+
workspaceId: z.string(),
|
|
71
|
+
idempotencyKey: z.string(),
|
|
72
|
+
body: smartUnion([
|
|
73
|
+
z.lazy(() => CreateEnvironmentDefinitionRequestBody1$outboundSchema),
|
|
74
|
+
z.lazy(() => CreateEnvironmentDefinitionRequestBody2$outboundSchema),
|
|
75
|
+
]),
|
|
76
|
+
}), z.transform((v) => {
|
|
77
|
+
return remap$(v, {
|
|
78
|
+
idempotencyKey: "idempotency-key",
|
|
79
|
+
});
|
|
80
|
+
}));
|
|
81
|
+
export function createEnvironmentDefinitionRequestToJSON(createEnvironmentDefinitionRequest) {
|
|
82
|
+
return JSON.stringify(CreateEnvironmentDefinitionRequest$outboundSchema.parse(createEnvironmentDefinitionRequest));
|
|
83
|
+
}
|
|
84
|
+
/** @internal */
|
|
85
|
+
export const CreateEnvironmentDefinitionResponse$inboundSchema = z.object({
|
|
86
|
+
data: models.Environment$inboundSchema,
|
|
87
|
+
});
|
|
88
|
+
export function createEnvironmentDefinitionResponseFromJSON(jsonString) {
|
|
89
|
+
return safeParse(jsonString, (x) => CreateEnvironmentDefinitionResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateEnvironmentDefinitionResponse' from JSON`);
|
|
90
|
+
}
|
|
@@ -2,13 +2,18 @@ import * as z from "zod/v4-mini";
|
|
|
2
2
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
3
3
|
import { SDKValidationError } from "../errors/sdk-validation-error.js";
|
|
4
4
|
import * as models from "../index.js";
|
|
5
|
-
export type
|
|
5
|
+
export type RevealConnectionRequestBody3 = {};
|
|
6
|
+
export type RevealConnectionRequestBody2 = {
|
|
6
7
|
actorId: string;
|
|
7
8
|
};
|
|
9
|
+
export type RevealConnectionRequestBody1 = {
|
|
10
|
+
connectionKey: string;
|
|
11
|
+
};
|
|
12
|
+
export type RevealConnectionRequestBody = RevealConnectionRequestBody1 | RevealConnectionRequestBody2 | RevealConnectionRequestBody3;
|
|
8
13
|
export type RevealConnectionRequest = {
|
|
9
14
|
environmentId: string;
|
|
10
15
|
appKey: string;
|
|
11
|
-
body:
|
|
16
|
+
body: RevealConnectionRequestBody1 | RevealConnectionRequestBody2 | RevealConnectionRequestBody3;
|
|
12
17
|
};
|
|
13
18
|
/**
|
|
14
19
|
* Live credentials for one actor; recorded as an event
|
|
@@ -17,17 +22,34 @@ export type RevealConnectionResponse = {
|
|
|
17
22
|
data: models.ConnectionSecret;
|
|
18
23
|
};
|
|
19
24
|
/** @internal */
|
|
20
|
-
export type
|
|
25
|
+
export type RevealConnectionRequestBody3$Outbound = {};
|
|
26
|
+
/** @internal */
|
|
27
|
+
export declare const RevealConnectionRequestBody3$outboundSchema: z.ZodMiniType<RevealConnectionRequestBody3$Outbound, RevealConnectionRequestBody3>;
|
|
28
|
+
export declare function revealConnectionRequestBody3ToJSON(revealConnectionRequestBody3: RevealConnectionRequestBody3): string;
|
|
29
|
+
/** @internal */
|
|
30
|
+
export type RevealConnectionRequestBody2$Outbound = {
|
|
21
31
|
actorId: string;
|
|
22
32
|
};
|
|
23
33
|
/** @internal */
|
|
34
|
+
export declare const RevealConnectionRequestBody2$outboundSchema: z.ZodMiniType<RevealConnectionRequestBody2$Outbound, RevealConnectionRequestBody2>;
|
|
35
|
+
export declare function revealConnectionRequestBody2ToJSON(revealConnectionRequestBody2: RevealConnectionRequestBody2): string;
|
|
36
|
+
/** @internal */
|
|
37
|
+
export type RevealConnectionRequestBody1$Outbound = {
|
|
38
|
+
connectionKey: string;
|
|
39
|
+
};
|
|
40
|
+
/** @internal */
|
|
41
|
+
export declare const RevealConnectionRequestBody1$outboundSchema: z.ZodMiniType<RevealConnectionRequestBody1$Outbound, RevealConnectionRequestBody1>;
|
|
42
|
+
export declare function revealConnectionRequestBody1ToJSON(revealConnectionRequestBody1: RevealConnectionRequestBody1): string;
|
|
43
|
+
/** @internal */
|
|
44
|
+
export type RevealConnectionRequestBody$Outbound = RevealConnectionRequestBody1$Outbound | RevealConnectionRequestBody2$Outbound | RevealConnectionRequestBody3$Outbound;
|
|
45
|
+
/** @internal */
|
|
24
46
|
export declare const RevealConnectionRequestBody$outboundSchema: z.ZodMiniType<RevealConnectionRequestBody$Outbound, RevealConnectionRequestBody>;
|
|
25
47
|
export declare function revealConnectionRequestBodyToJSON(revealConnectionRequestBody: RevealConnectionRequestBody): string;
|
|
26
48
|
/** @internal */
|
|
27
49
|
export type RevealConnectionRequest$Outbound = {
|
|
28
50
|
environmentId: string;
|
|
29
51
|
appKey: string;
|
|
30
|
-
body:
|
|
52
|
+
body: RevealConnectionRequestBody1$Outbound | RevealConnectionRequestBody2$Outbound | RevealConnectionRequestBody3$Outbound;
|
|
31
53
|
};
|
|
32
54
|
/** @internal */
|
|
33
55
|
export declare const RevealConnectionRequest$outboundSchema: z.ZodMiniType<RevealConnectionRequest$Outbound, RevealConnectionRequest>;
|
|
@@ -3,11 +3,33 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as z from "zod/v4-mini";
|
|
5
5
|
import { safeParse } from "../../lib/schemas.js";
|
|
6
|
+
import { smartUnion } from "../../types/smart-union.js";
|
|
6
7
|
import * as models from "../index.js";
|
|
7
8
|
/** @internal */
|
|
8
|
-
export const
|
|
9
|
+
export const RevealConnectionRequestBody3$outboundSchema = z.object({});
|
|
10
|
+
export function revealConnectionRequestBody3ToJSON(revealConnectionRequestBody3) {
|
|
11
|
+
return JSON.stringify(RevealConnectionRequestBody3$outboundSchema.parse(revealConnectionRequestBody3));
|
|
12
|
+
}
|
|
13
|
+
/** @internal */
|
|
14
|
+
export const RevealConnectionRequestBody2$outboundSchema = z.object({
|
|
9
15
|
actorId: z.string(),
|
|
10
16
|
});
|
|
17
|
+
export function revealConnectionRequestBody2ToJSON(revealConnectionRequestBody2) {
|
|
18
|
+
return JSON.stringify(RevealConnectionRequestBody2$outboundSchema.parse(revealConnectionRequestBody2));
|
|
19
|
+
}
|
|
20
|
+
/** @internal */
|
|
21
|
+
export const RevealConnectionRequestBody1$outboundSchema = z.object({
|
|
22
|
+
connectionKey: z.string(),
|
|
23
|
+
});
|
|
24
|
+
export function revealConnectionRequestBody1ToJSON(revealConnectionRequestBody1) {
|
|
25
|
+
return JSON.stringify(RevealConnectionRequestBody1$outboundSchema.parse(revealConnectionRequestBody1));
|
|
26
|
+
}
|
|
27
|
+
/** @internal */
|
|
28
|
+
export const RevealConnectionRequestBody$outboundSchema = smartUnion([
|
|
29
|
+
z.lazy(() => RevealConnectionRequestBody1$outboundSchema),
|
|
30
|
+
z.lazy(() => RevealConnectionRequestBody2$outboundSchema),
|
|
31
|
+
z.lazy(() => RevealConnectionRequestBody3$outboundSchema),
|
|
32
|
+
]);
|
|
11
33
|
export function revealConnectionRequestBodyToJSON(revealConnectionRequestBody) {
|
|
12
34
|
return JSON.stringify(RevealConnectionRequestBody$outboundSchema.parse(revealConnectionRequestBody));
|
|
13
35
|
}
|
|
@@ -15,7 +37,11 @@ export function revealConnectionRequestBodyToJSON(revealConnectionRequestBody) {
|
|
|
15
37
|
export const RevealConnectionRequest$outboundSchema = z.object({
|
|
16
38
|
environmentId: z.string(),
|
|
17
39
|
appKey: z.string(),
|
|
18
|
-
body:
|
|
40
|
+
body: smartUnion([
|
|
41
|
+
z.lazy(() => RevealConnectionRequestBody1$outboundSchema),
|
|
42
|
+
z.lazy(() => RevealConnectionRequestBody2$outboundSchema),
|
|
43
|
+
z.lazy(() => RevealConnectionRequestBody3$outboundSchema),
|
|
44
|
+
]),
|
|
19
45
|
});
|
|
20
46
|
export function revealConnectionRequestToJSON(revealConnectionRequest) {
|
|
21
47
|
return JSON.stringify(RevealConnectionRequest$outboundSchema.parse(revealConnectionRequest));
|
package/esm/sdk/sdk.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ClientSDK } from "../lib/sdks.js";
|
|
1
|
+
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
2
|
+
import * as operations from "../models/operations/index.js";
|
|
2
3
|
import { Catalog } from "./catalog.js";
|
|
3
4
|
import { Credential } from "./credential.js";
|
|
4
5
|
import { Environments } from "./environments.js";
|
|
@@ -12,4 +13,5 @@ export declare class StateMachines extends ClientSDK {
|
|
|
12
13
|
get environments(): Environments;
|
|
13
14
|
private _workspaces?;
|
|
14
15
|
get workspaces(): Workspaces;
|
|
16
|
+
createEnvironmentDefinition(request: operations.CreateEnvironmentDefinitionRequest, options?: RequestOptions): Promise<operations.CreateEnvironmentDefinitionResponse>;
|
|
15
17
|
}
|
package/esm/sdk/sdk.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
|
+
import { createEnvironmentDefinition } from "../funcs/create-environment-definition.js";
|
|
4
5
|
import { ClientSDK } from "../lib/sdks.js";
|
|
6
|
+
import { unwrapAsync } from "../types/fp.js";
|
|
5
7
|
import { Catalog } from "./catalog.js";
|
|
6
8
|
import { Credential } from "./credential.js";
|
|
7
9
|
import { Environments } from "./environments.js";
|
|
@@ -23,4 +25,7 @@ export class StateMachines extends ClientSDK {
|
|
|
23
25
|
get workspaces() {
|
|
24
26
|
return (this._workspaces ?? (this._workspaces = new Workspaces(this._options)));
|
|
25
27
|
}
|
|
28
|
+
async createEnvironmentDefinition(request, options) {
|
|
29
|
+
return unwrapAsync(createEnvironmentDefinition(this, request, options));
|
|
30
|
+
}
|
|
26
31
|
}
|