@miosa/sdk 1.2.14 → 1.2.16
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 +57 -0
- package/dist/index.d.ts +658 -1
- package/dist/index.js +1167 -404
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -26,6 +26,8 @@ var MiosaError = class _MiosaError extends Error {
|
|
|
26
26
|
const message = body4.error?.message ?? body4.message ?? `HTTP ${status}`;
|
|
27
27
|
const code = body4.error?.code ?? body4.code ?? "UNKNOWN_ERROR";
|
|
28
28
|
const details = body4.error?.details;
|
|
29
|
+
const connectError = connectErrorFromCode(code, message, status, details, requestId);
|
|
30
|
+
if (connectError) return connectError;
|
|
29
31
|
if (status === 401 || status === 403) {
|
|
30
32
|
return new AuthError(message, status, code, details, requestId);
|
|
31
33
|
}
|
|
@@ -44,6 +46,28 @@ var MiosaError = class _MiosaError extends Error {
|
|
|
44
46
|
return new _MiosaError(message, status, code, details, requestId);
|
|
45
47
|
}
|
|
46
48
|
};
|
|
49
|
+
function connectErrorFromCode(code, message, status, details, requestId) {
|
|
50
|
+
switch (code) {
|
|
51
|
+
case "PROJECT_NOT_LINKED":
|
|
52
|
+
return new ProjectNotLinkedError(message, status, details, requestId);
|
|
53
|
+
case "SUBJECT_NOT_ALLOWED":
|
|
54
|
+
return new SubjectNotAllowedError(message, status, details, requestId);
|
|
55
|
+
case "SCOPE_NOT_ALLOWED":
|
|
56
|
+
return new ScopeNotAllowedError(message, status, details, requestId);
|
|
57
|
+
case "MANAGED_PROVIDER_BINDING_ONLY":
|
|
58
|
+
return new ManagedProviderBindingOnlyError(message, status, details, requestId);
|
|
59
|
+
case "INSTALLATION_REQUIRED":
|
|
60
|
+
return new InstallationRequiredError(message, status, details, requestId);
|
|
61
|
+
case "USER_AUTHORIZATION_REQUIRED":
|
|
62
|
+
return new UserAuthorizationRequiredError(message, status, details, requestId);
|
|
63
|
+
case "EGRESS_HOST_NOT_ALLOWED":
|
|
64
|
+
return new EgressHostNotAllowedError(message, status, details, requestId);
|
|
65
|
+
case "TOKEN_REFRESH_FAILED":
|
|
66
|
+
return new TokenRefreshFailedError(message, status, details, requestId);
|
|
67
|
+
default:
|
|
68
|
+
return void 0;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
47
71
|
var AuthError = class extends MiosaError {
|
|
48
72
|
constructor(message, status = 401, code = "UNAUTHORIZED", details, requestId) {
|
|
49
73
|
super(message, status, code, details, requestId);
|
|
@@ -90,6 +114,54 @@ var NetworkError = class extends MiosaError {
|
|
|
90
114
|
this.cause = cause;
|
|
91
115
|
}
|
|
92
116
|
};
|
|
117
|
+
var ProjectNotLinkedError = class extends MiosaError {
|
|
118
|
+
constructor(message, status = 403, details, requestId) {
|
|
119
|
+
super(message, status, "PROJECT_NOT_LINKED", details, requestId);
|
|
120
|
+
this.name = "ProjectNotLinkedError";
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
var SubjectNotAllowedError = class extends MiosaError {
|
|
124
|
+
constructor(message, status = 403, details, requestId) {
|
|
125
|
+
super(message, status, "SUBJECT_NOT_ALLOWED", details, requestId);
|
|
126
|
+
this.name = "SubjectNotAllowedError";
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
var ScopeNotAllowedError = class extends MiosaError {
|
|
130
|
+
constructor(message, status = 403, details, requestId) {
|
|
131
|
+
super(message, status, "SCOPE_NOT_ALLOWED", details, requestId);
|
|
132
|
+
this.name = "ScopeNotAllowedError";
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
var ManagedProviderBindingOnlyError = class extends MiosaError {
|
|
136
|
+
constructor(message, status = 403, details, requestId) {
|
|
137
|
+
super(message, status, "MANAGED_PROVIDER_BINDING_ONLY", details, requestId);
|
|
138
|
+
this.name = "ManagedProviderBindingOnlyError";
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
var InstallationRequiredError = class extends MiosaError {
|
|
142
|
+
constructor(message, status = 409, details, requestId) {
|
|
143
|
+
super(message, status, "INSTALLATION_REQUIRED", details, requestId);
|
|
144
|
+
this.name = "InstallationRequiredError";
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
var UserAuthorizationRequiredError = class extends MiosaError {
|
|
148
|
+
constructor(message, status = 403, details, requestId) {
|
|
149
|
+
super(message, status, "USER_AUTHORIZATION_REQUIRED", details, requestId);
|
|
150
|
+
this.name = "UserAuthorizationRequiredError";
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
var EgressHostNotAllowedError = class extends MiosaError {
|
|
154
|
+
constructor(message, status = 403, details, requestId) {
|
|
155
|
+
super(message, status, "EGRESS_HOST_NOT_ALLOWED", details, requestId);
|
|
156
|
+
this.name = "EgressHostNotAllowedError";
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
var TokenRefreshFailedError = class extends MiosaError {
|
|
160
|
+
constructor(message, status = 502, details, requestId) {
|
|
161
|
+
super(message, status, "TOKEN_REFRESH_FAILED", details, requestId);
|
|
162
|
+
this.name = "TokenRefreshFailedError";
|
|
163
|
+
}
|
|
164
|
+
};
|
|
93
165
|
|
|
94
166
|
// src/http.ts
|
|
95
167
|
var _h2Configured = false;
|
|
@@ -895,6 +967,9 @@ var AgentRuns = class {
|
|
|
895
967
|
sandbox_id: params.sandboxId,
|
|
896
968
|
computer_id: params.computerId,
|
|
897
969
|
agent_run_group_id: params.agentRunGroupId,
|
|
970
|
+
external_workspace_id: params.externalWorkspaceId ?? params.external_workspace_id,
|
|
971
|
+
external_user_id: params.externalUserId ?? params.external_user_id,
|
|
972
|
+
external_project_id: params.externalProjectId ?? params.external_project_id,
|
|
898
973
|
status: params.status
|
|
899
974
|
})
|
|
900
975
|
);
|
|
@@ -976,6 +1051,9 @@ var AgentRuns = class {
|
|
|
976
1051
|
agent_run_group_id: params.agentRunGroupId,
|
|
977
1052
|
parent_agent_run_id: params.parentAgentRunId,
|
|
978
1053
|
orchestration_role: params.orchestrationRole,
|
|
1054
|
+
external_workspace_id: params.externalWorkspaceId ?? params.external_workspace_id,
|
|
1055
|
+
external_user_id: params.externalUserId ?? params.external_user_id,
|
|
1056
|
+
external_project_id: params.externalProjectId ?? params.external_project_id,
|
|
979
1057
|
skip_agent_runtime_profile: params.skipAgentRuntimeProfile,
|
|
980
1058
|
execution_packet: params.executionPacket,
|
|
981
1059
|
output_contract: params.outputContract,
|
|
@@ -1949,6 +2027,426 @@ var ComputerVolumes = class {
|
|
|
1949
2027
|
}
|
|
1950
2028
|
};
|
|
1951
2029
|
|
|
2030
|
+
// src/resources/connectors.ts
|
|
2031
|
+
function unwrap20(payload) {
|
|
2032
|
+
if (payload && typeof payload === "object") {
|
|
2033
|
+
const p = payload;
|
|
2034
|
+
for (const key of ["data", "binding"]) {
|
|
2035
|
+
if (key in p) return p[key];
|
|
2036
|
+
}
|
|
2037
|
+
}
|
|
2038
|
+
return payload;
|
|
2039
|
+
}
|
|
2040
|
+
function unwrapList8(payload) {
|
|
2041
|
+
if (Array.isArray(payload)) return payload;
|
|
2042
|
+
if (payload && typeof payload === "object") {
|
|
2043
|
+
const p = payload;
|
|
2044
|
+
for (const key of ["data", "connectors", "items"]) {
|
|
2045
|
+
if (Array.isArray(p[key])) return p[key];
|
|
2046
|
+
}
|
|
2047
|
+
}
|
|
2048
|
+
return [];
|
|
2049
|
+
}
|
|
2050
|
+
function stripUndefined7(input) {
|
|
2051
|
+
return Object.fromEntries(
|
|
2052
|
+
Object.entries(input).filter(([, value]) => value !== void 0)
|
|
2053
|
+
);
|
|
2054
|
+
}
|
|
2055
|
+
function pickFirst(...values) {
|
|
2056
|
+
for (const value of values) if (value !== void 0) return value;
|
|
2057
|
+
return void 0;
|
|
2058
|
+
}
|
|
2059
|
+
function externalAttributionParams(params = {}) {
|
|
2060
|
+
return {
|
|
2061
|
+
external_user_id: pickFirst(params.externalUserId, params.external_user_id),
|
|
2062
|
+
external_workspace_id: pickFirst(
|
|
2063
|
+
params.externalWorkspaceId,
|
|
2064
|
+
params.external_workspace_id
|
|
2065
|
+
),
|
|
2066
|
+
external_project_id: pickFirst(
|
|
2067
|
+
params.externalProjectId,
|
|
2068
|
+
params.external_project_id
|
|
2069
|
+
)
|
|
2070
|
+
};
|
|
2071
|
+
}
|
|
2072
|
+
function queryFromListParams(params) {
|
|
2073
|
+
return stripUndefined7({
|
|
2074
|
+
scope: params.scope,
|
|
2075
|
+
workspace_id: pickFirst(params.workspaceId, params.workspace_id),
|
|
2076
|
+
owner_user_id: pickFirst(params.ownerUserId, params.owner_user_id),
|
|
2077
|
+
...externalAttributionParams(params)
|
|
2078
|
+
});
|
|
2079
|
+
}
|
|
2080
|
+
function bodyFromCreateParams(provider, params) {
|
|
2081
|
+
const credential = params.credential && typeof params.credential === "object" && !Array.isArray(params.credential) ? params.credential : void 0;
|
|
2082
|
+
const value = pickFirst(
|
|
2083
|
+
params.value,
|
|
2084
|
+
params.token,
|
|
2085
|
+
params.apiKey,
|
|
2086
|
+
params.api_key,
|
|
2087
|
+
credential?.value
|
|
2088
|
+
);
|
|
2089
|
+
return stripUndefined7({
|
|
2090
|
+
provider,
|
|
2091
|
+
type: String(params.type ?? "api_key").replaceAll("-", "_"),
|
|
2092
|
+
name: params.name,
|
|
2093
|
+
uid: params.uid ?? `${provider}/${params.name ?? "default"}`,
|
|
2094
|
+
scope: params.scope,
|
|
2095
|
+
workspace_id: pickFirst(params.workspaceId, params.workspace_id),
|
|
2096
|
+
owner_user_id: pickFirst(params.ownerUserId, params.owner_user_id),
|
|
2097
|
+
...externalAttributionParams(params),
|
|
2098
|
+
credential: value ? {
|
|
2099
|
+
field: credential?.field ?? "api_key",
|
|
2100
|
+
value,
|
|
2101
|
+
...Object.fromEntries(
|
|
2102
|
+
Object.entries(credential ?? {}).filter(
|
|
2103
|
+
([key]) => key !== "value" && key !== "field"
|
|
2104
|
+
)
|
|
2105
|
+
)
|
|
2106
|
+
} : credential
|
|
2107
|
+
});
|
|
2108
|
+
}
|
|
2109
|
+
function tokenBody(params = {}) {
|
|
2110
|
+
return stripUndefined7({
|
|
2111
|
+
subject: params.subject ?? { type: "app" },
|
|
2112
|
+
installation_id: pickFirst(params.installationId, params.installation_id),
|
|
2113
|
+
project_id: pickFirst(params.projectId, params.project_id),
|
|
2114
|
+
environment: params.environment,
|
|
2115
|
+
resource_type: pickFirst(params.resourceType, params.resource_type),
|
|
2116
|
+
resource_id: pickFirst(params.resourceId, params.resource_id),
|
|
2117
|
+
scopes: pickFirst(params.scopes, params.scope),
|
|
2118
|
+
audience: params.audience,
|
|
2119
|
+
...externalAttributionParams(params),
|
|
2120
|
+
validity_buffer_ms: pickFirst(
|
|
2121
|
+
params.validityBufferMs,
|
|
2122
|
+
params.validity_buffer_ms
|
|
2123
|
+
)
|
|
2124
|
+
});
|
|
2125
|
+
}
|
|
2126
|
+
function queryFromLinkParams(params = {}) {
|
|
2127
|
+
return stripUndefined7({
|
|
2128
|
+
workspace_id: pickFirst(params.workspaceId, params.workspace_id),
|
|
2129
|
+
project_id: pickFirst(params.projectId, params.project_id),
|
|
2130
|
+
connector_id: pickFirst(params.connectorId, params.connector_id),
|
|
2131
|
+
environment: params.environment,
|
|
2132
|
+
status: params.status,
|
|
2133
|
+
...externalAttributionParams(params)
|
|
2134
|
+
});
|
|
2135
|
+
}
|
|
2136
|
+
function queryFromDefaultParams(params = {}) {
|
|
2137
|
+
return stripUndefined7({
|
|
2138
|
+
...queryFromLinkParams(params),
|
|
2139
|
+
default_scope: pickFirst(params.defaultScope, params.default_scope),
|
|
2140
|
+
target: params.target
|
|
2141
|
+
});
|
|
2142
|
+
}
|
|
2143
|
+
function queryFromApplicableDefaultParams(params = {}) {
|
|
2144
|
+
return stripUndefined7({
|
|
2145
|
+
workspace_id: pickFirst(params.workspaceId, params.workspace_id),
|
|
2146
|
+
project_id: pickFirst(params.projectId, params.project_id),
|
|
2147
|
+
environment: params.environment,
|
|
2148
|
+
target: params.target,
|
|
2149
|
+
resource_type: pickFirst(params.resourceType, params.resource_type),
|
|
2150
|
+
resource_id: pickFirst(params.resourceId, params.resource_id),
|
|
2151
|
+
...externalAttributionParams(params)
|
|
2152
|
+
});
|
|
2153
|
+
}
|
|
2154
|
+
function materializeDefaultsBody(params = {}) {
|
|
2155
|
+
return stripUndefined7({
|
|
2156
|
+
workspace_id: pickFirst(params.workspaceId, params.workspace_id),
|
|
2157
|
+
project_id: pickFirst(params.projectId, params.project_id),
|
|
2158
|
+
environment: params.environment,
|
|
2159
|
+
target: params.target,
|
|
2160
|
+
resource_type: pickFirst(params.resourceType, params.resource_type),
|
|
2161
|
+
resource_id: pickFirst(params.resourceId, params.resource_id),
|
|
2162
|
+
env_name: pickFirst(params.envName, params.env_name),
|
|
2163
|
+
...externalAttributionParams(params)
|
|
2164
|
+
});
|
|
2165
|
+
}
|
|
2166
|
+
function projectLinkBody(params) {
|
|
2167
|
+
return stripUndefined7({
|
|
2168
|
+
connector: params.connector,
|
|
2169
|
+
connector_id: pickFirst(params.connectorId, params.connector_id),
|
|
2170
|
+
installation_id: pickFirst(params.installationId, params.installation_id),
|
|
2171
|
+
workspace_id: pickFirst(params.workspaceId, params.workspace_id),
|
|
2172
|
+
project_id: pickFirst(params.projectId, params.project_id),
|
|
2173
|
+
environment: params.environment,
|
|
2174
|
+
resource_type: pickFirst(params.resourceType, params.resource_type),
|
|
2175
|
+
resource_id: pickFirst(params.resourceId, params.resource_id),
|
|
2176
|
+
allowed_subjects: pickFirst(
|
|
2177
|
+
params.allowedSubjects,
|
|
2178
|
+
params.allowed_subjects
|
|
2179
|
+
),
|
|
2180
|
+
allowed_scopes: pickFirst(params.allowedScopes, params.allowed_scopes),
|
|
2181
|
+
mode: params.mode?.replaceAll("-", "_"),
|
|
2182
|
+
effect: params.effect,
|
|
2183
|
+
...externalAttributionParams(params),
|
|
2184
|
+
metadata: params.metadata
|
|
2185
|
+
});
|
|
2186
|
+
}
|
|
2187
|
+
function defaultBody(params) {
|
|
2188
|
+
return stripUndefined7({
|
|
2189
|
+
...projectLinkBody(params),
|
|
2190
|
+
default_scope: pickFirst(params.defaultScope, params.default_scope),
|
|
2191
|
+
target: params.target
|
|
2192
|
+
});
|
|
2193
|
+
}
|
|
2194
|
+
function triggerBody(params) {
|
|
2195
|
+
return stripUndefined7({
|
|
2196
|
+
connector: params.connector,
|
|
2197
|
+
connector_id: pickFirst(params.connectorId, params.connector_id),
|
|
2198
|
+
workspace_id: pickFirst(params.workspaceId, params.workspace_id),
|
|
2199
|
+
project_id: pickFirst(params.projectId, params.project_id),
|
|
2200
|
+
environment: params.environment,
|
|
2201
|
+
destination_path: pickFirst(params.destinationPath, params.destination_path),
|
|
2202
|
+
destination_url: pickFirst(params.destinationUrl, params.destination_url),
|
|
2203
|
+
event_types: pickFirst(params.eventTypes, params.event_types),
|
|
2204
|
+
status: params.status,
|
|
2205
|
+
provider_adapter: pickFirst(params.providerAdapter, params.provider_adapter),
|
|
2206
|
+
webhook_signing_secret: pickFirst(
|
|
2207
|
+
params.webhookSigningSecret,
|
|
2208
|
+
params.webhook_signing_secret
|
|
2209
|
+
),
|
|
2210
|
+
...externalAttributionParams(params),
|
|
2211
|
+
metadata: params.metadata
|
|
2212
|
+
});
|
|
2213
|
+
}
|
|
2214
|
+
function queryFromTriggerDeliveryParams(params = {}) {
|
|
2215
|
+
return stripUndefined7({
|
|
2216
|
+
...queryFromLinkParams(params),
|
|
2217
|
+
trigger_id: pickFirst(params.triggerId, params.trigger_id),
|
|
2218
|
+
event_type: pickFirst(params.eventType, params.event_type)
|
|
2219
|
+
});
|
|
2220
|
+
}
|
|
2221
|
+
function connectorPath(connector) {
|
|
2222
|
+
return encodeURIComponent(connector);
|
|
2223
|
+
}
|
|
2224
|
+
var Connectors = class {
|
|
2225
|
+
constructor(http) {
|
|
2226
|
+
this.http = http;
|
|
2227
|
+
}
|
|
2228
|
+
http;
|
|
2229
|
+
/** List Connect provider connectors visible to the current tenant/workspace. */
|
|
2230
|
+
async list(params = {}) {
|
|
2231
|
+
const data = await this.http.get(
|
|
2232
|
+
"/connect/connectors",
|
|
2233
|
+
queryFromListParams(params)
|
|
2234
|
+
);
|
|
2235
|
+
return unwrapList8(data);
|
|
2236
|
+
}
|
|
2237
|
+
/** Show one connector by UID or id. */
|
|
2238
|
+
async get(connector) {
|
|
2239
|
+
const data = await this.http.get(
|
|
2240
|
+
`/connect/connectors/${connectorPath(connector)}`
|
|
2241
|
+
);
|
|
2242
|
+
return unwrap20(data);
|
|
2243
|
+
}
|
|
2244
|
+
show(connector) {
|
|
2245
|
+
return this.get(connector);
|
|
2246
|
+
}
|
|
2247
|
+
/** Create an API-key backed connector. Raw values are never returned later. */
|
|
2248
|
+
async create(provider, params) {
|
|
2249
|
+
const data = await this.http.post(
|
|
2250
|
+
"/connect/connectors",
|
|
2251
|
+
bodyFromCreateParams(provider, params)
|
|
2252
|
+
);
|
|
2253
|
+
return unwrap20(data);
|
|
2254
|
+
}
|
|
2255
|
+
/** Request a runtime provider token for a connector. */
|
|
2256
|
+
async getToken(connector, params = {}) {
|
|
2257
|
+
const data = await this.http.post(
|
|
2258
|
+
`/connect/token/${connectorPath(connector)}`,
|
|
2259
|
+
tokenBody(params)
|
|
2260
|
+
);
|
|
2261
|
+
return unwrap20(data);
|
|
2262
|
+
}
|
|
2263
|
+
token(connector, params = {}) {
|
|
2264
|
+
return this.getToken(connector, params);
|
|
2265
|
+
}
|
|
2266
|
+
/** List OAuth app providers available for end-user authorization. */
|
|
2267
|
+
async oauthProviders() {
|
|
2268
|
+
const data = await this.http.get("/connect/oauth/providers");
|
|
2269
|
+
return unwrapList8(data);
|
|
2270
|
+
}
|
|
2271
|
+
/** Start an OAuth authorization flow for a provider-backed connector. */
|
|
2272
|
+
async startOauth(params) {
|
|
2273
|
+
const data = await this.http.post(
|
|
2274
|
+
"/connect/oauth/start",
|
|
2275
|
+
stripUndefined7({
|
|
2276
|
+
provider: params.provider,
|
|
2277
|
+
scope: params.scope,
|
|
2278
|
+
expose_as_env: pickFirst(params.exposeAsEnv, params.expose_as_env),
|
|
2279
|
+
owner_user_id: pickFirst(params.ownerUserId, params.owner_user_id),
|
|
2280
|
+
...externalAttributionParams(params)
|
|
2281
|
+
})
|
|
2282
|
+
);
|
|
2283
|
+
return unwrap20(data);
|
|
2284
|
+
}
|
|
2285
|
+
/** List connector installations/grants. */
|
|
2286
|
+
async installations(params = {}) {
|
|
2287
|
+
const data = await this.http.get(
|
|
2288
|
+
"/connect/installations",
|
|
2289
|
+
queryFromLinkParams(params)
|
|
2290
|
+
);
|
|
2291
|
+
return unwrapList8(data);
|
|
2292
|
+
}
|
|
2293
|
+
/** List project/environment connector links. */
|
|
2294
|
+
async projectLinks(params = {}) {
|
|
2295
|
+
const data = await this.http.get(
|
|
2296
|
+
"/connect/project-links",
|
|
2297
|
+
queryFromLinkParams(params)
|
|
2298
|
+
);
|
|
2299
|
+
return unwrapList8(data);
|
|
2300
|
+
}
|
|
2301
|
+
/** List inherited connector defaults for tenant/workspace/project runtimes. */
|
|
2302
|
+
async defaults(params = {}) {
|
|
2303
|
+
const data = await this.http.get(
|
|
2304
|
+
"/connect/defaults",
|
|
2305
|
+
queryFromDefaultParams(params)
|
|
2306
|
+
);
|
|
2307
|
+
return unwrapList8(data);
|
|
2308
|
+
}
|
|
2309
|
+
/** Resolve inherited connector defaults that apply to a runtime target. */
|
|
2310
|
+
async applicableDefaults(params = {}) {
|
|
2311
|
+
const data = await this.http.get(
|
|
2312
|
+
"/connect/defaults/applicable",
|
|
2313
|
+
queryFromApplicableDefaultParams(params)
|
|
2314
|
+
);
|
|
2315
|
+
return unwrapList8(data);
|
|
2316
|
+
}
|
|
2317
|
+
/** Materialize inherited connector defaults onto one runtime resource. */
|
|
2318
|
+
async materializeDefaults(params) {
|
|
2319
|
+
const data = await this.http.post(
|
|
2320
|
+
"/connect/defaults/materialize",
|
|
2321
|
+
materializeDefaultsBody(params)
|
|
2322
|
+
);
|
|
2323
|
+
return unwrap20(data);
|
|
2324
|
+
}
|
|
2325
|
+
/** Create an inherited connector default for future runtime resources. */
|
|
2326
|
+
async createDefault(params) {
|
|
2327
|
+
const data = await this.http.post(
|
|
2328
|
+
"/connect/defaults",
|
|
2329
|
+
defaultBody(params)
|
|
2330
|
+
);
|
|
2331
|
+
return unwrap20(data);
|
|
2332
|
+
}
|
|
2333
|
+
/** Delete an inherited connector default. */
|
|
2334
|
+
async deleteDefault(id) {
|
|
2335
|
+
await this.http.delete(`/connect/defaults/${connectorPath(id)}`);
|
|
2336
|
+
}
|
|
2337
|
+
/** List inbound provider trigger forwarding definitions. */
|
|
2338
|
+
async triggers(params = {}) {
|
|
2339
|
+
const data = await this.http.get(
|
|
2340
|
+
"/connect/triggers",
|
|
2341
|
+
queryFromLinkParams(params)
|
|
2342
|
+
);
|
|
2343
|
+
return unwrapList8(data);
|
|
2344
|
+
}
|
|
2345
|
+
/** Create an inbound provider trigger forwarding definition. */
|
|
2346
|
+
async createTrigger(params) {
|
|
2347
|
+
const data = await this.http.post(
|
|
2348
|
+
"/connect/triggers",
|
|
2349
|
+
triggerBody(params)
|
|
2350
|
+
);
|
|
2351
|
+
return unwrap20(data);
|
|
2352
|
+
}
|
|
2353
|
+
/** List inbound provider trigger delivery attempts. */
|
|
2354
|
+
async triggerDeliveries(params = {}) {
|
|
2355
|
+
const data = await this.http.get(
|
|
2356
|
+
"/connect/trigger-deliveries",
|
|
2357
|
+
queryFromTriggerDeliveryParams(params)
|
|
2358
|
+
);
|
|
2359
|
+
return unwrapList8(data);
|
|
2360
|
+
}
|
|
2361
|
+
/** List delivery attempts for one trigger. */
|
|
2362
|
+
async triggerDeliveryHistory(triggerId) {
|
|
2363
|
+
const data = await this.http.get(
|
|
2364
|
+
`/connect/triggers/${connectorPath(triggerId)}/deliveries`
|
|
2365
|
+
);
|
|
2366
|
+
return unwrapList8(data);
|
|
2367
|
+
}
|
|
2368
|
+
/** Delete an inbound provider trigger forwarding definition. */
|
|
2369
|
+
async deleteTrigger(id) {
|
|
2370
|
+
await this.http.delete(`/connect/triggers/${connectorPath(id)}`);
|
|
2371
|
+
}
|
|
2372
|
+
/** Link a connector to a project/environment/resource. */
|
|
2373
|
+
async createProjectLink(params) {
|
|
2374
|
+
const data = await this.http.post(
|
|
2375
|
+
"/connect/project-links",
|
|
2376
|
+
projectLinkBody(params)
|
|
2377
|
+
);
|
|
2378
|
+
return unwrap20(data);
|
|
2379
|
+
}
|
|
2380
|
+
/** Delete a project connector link. */
|
|
2381
|
+
async deleteProjectLink(id) {
|
|
2382
|
+
await this.http.delete(`/connect/project-links/${connectorPath(id)}`);
|
|
2383
|
+
}
|
|
2384
|
+
};
|
|
2385
|
+
var RuntimeConnectors = class {
|
|
2386
|
+
constructor(http, basePath) {
|
|
2387
|
+
this.http = http;
|
|
2388
|
+
this.basePath = basePath;
|
|
2389
|
+
}
|
|
2390
|
+
http;
|
|
2391
|
+
basePath;
|
|
2392
|
+
/** List provider connector bindings for this runtime resource. */
|
|
2393
|
+
async list() {
|
|
2394
|
+
const data = await this.http.get(this.basePath);
|
|
2395
|
+
return unwrapList8(data);
|
|
2396
|
+
}
|
|
2397
|
+
/** Attach a connector to this runtime resource as a brokered env var. */
|
|
2398
|
+
async attach(params) {
|
|
2399
|
+
const data = await this.http.post(
|
|
2400
|
+
this.basePath,
|
|
2401
|
+
stripUndefined7({
|
|
2402
|
+
connector: params.connector,
|
|
2403
|
+
env_name: params.env,
|
|
2404
|
+
mode: params.mode?.replaceAll("-", "_"),
|
|
2405
|
+
installation_id: pickFirst(
|
|
2406
|
+
params.installationId,
|
|
2407
|
+
params.installation_id
|
|
2408
|
+
),
|
|
2409
|
+
project_id: pickFirst(params.projectId, params.project_id),
|
|
2410
|
+
environment: params.environment,
|
|
2411
|
+
...externalAttributionParams(params)
|
|
2412
|
+
})
|
|
2413
|
+
);
|
|
2414
|
+
return unwrap20(data);
|
|
2415
|
+
}
|
|
2416
|
+
/** Detach a connector binding by binding id or connector UID. */
|
|
2417
|
+
async detach(bindingOrConnector) {
|
|
2418
|
+
await this.http.delete(`${this.basePath}/${connectorPath(bindingOrConnector)}`);
|
|
2419
|
+
}
|
|
2420
|
+
/** Sync or materialize connector placeholder env vars for this runtime resource. */
|
|
2421
|
+
async sync() {
|
|
2422
|
+
const data = await this.http.post(`${this.basePath}/sync`, {});
|
|
2423
|
+
return unwrap20(data);
|
|
2424
|
+
}
|
|
2425
|
+
/** Verify a required connector is attached before agent work begins. */
|
|
2426
|
+
async preflight(params = {}) {
|
|
2427
|
+
const data = await this.http.post(
|
|
2428
|
+
`${this.basePath}/preflight`,
|
|
2429
|
+
stripUndefined7(params)
|
|
2430
|
+
);
|
|
2431
|
+
return unwrap20(data);
|
|
2432
|
+
}
|
|
2433
|
+
};
|
|
2434
|
+
var SandboxConnectors = class extends RuntimeConnectors {
|
|
2435
|
+
constructor(http, sandboxId) {
|
|
2436
|
+
super(http, `/sandboxes/${sandboxId}/connectors`);
|
|
2437
|
+
}
|
|
2438
|
+
};
|
|
2439
|
+
var ComputerConnectors = class extends RuntimeConnectors {
|
|
2440
|
+
constructor(http, computerId) {
|
|
2441
|
+
super(http, `/computers/${computerId}/connectors`);
|
|
2442
|
+
}
|
|
2443
|
+
};
|
|
2444
|
+
var DeploymentConnectors = class extends RuntimeConnectors {
|
|
2445
|
+
constructor(http, deploymentId) {
|
|
2446
|
+
super(http, `/deployments/${deploymentId}/connectors`);
|
|
2447
|
+
}
|
|
2448
|
+
};
|
|
2449
|
+
|
|
1952
2450
|
// src/resources/custom_domains.ts
|
|
1953
2451
|
var CustomDomains = class {
|
|
1954
2452
|
http;
|
|
@@ -2109,7 +2607,7 @@ var Desktop = class {
|
|
|
2109
2607
|
};
|
|
2110
2608
|
|
|
2111
2609
|
// src/resources/egressAudit.ts
|
|
2112
|
-
function
|
|
2610
|
+
function unwrap21(payload) {
|
|
2113
2611
|
if (payload && typeof payload === "object") {
|
|
2114
2612
|
const p = payload;
|
|
2115
2613
|
for (const k of ["data", "event", "items"]) {
|
|
@@ -2118,7 +2616,7 @@ function unwrap20(payload) {
|
|
|
2118
2616
|
}
|
|
2119
2617
|
return payload;
|
|
2120
2618
|
}
|
|
2121
|
-
function
|
|
2619
|
+
function unwrapList9(payload) {
|
|
2122
2620
|
if (Array.isArray(payload)) return payload;
|
|
2123
2621
|
if (payload && typeof payload === "object") {
|
|
2124
2622
|
const p = payload;
|
|
@@ -2128,27 +2626,27 @@ function unwrapList8(payload) {
|
|
|
2128
2626
|
}
|
|
2129
2627
|
return [];
|
|
2130
2628
|
}
|
|
2131
|
-
function
|
|
2629
|
+
function stripUndefined8(input) {
|
|
2132
2630
|
return Object.fromEntries(
|
|
2133
2631
|
Object.entries(input).filter(([, v]) => v !== void 0)
|
|
2134
2632
|
);
|
|
2135
2633
|
}
|
|
2136
|
-
function
|
|
2634
|
+
function pickFirst2(...values) {
|
|
2137
2635
|
for (const v of values) if (v !== void 0) return v;
|
|
2138
2636
|
return void 0;
|
|
2139
2637
|
}
|
|
2140
2638
|
function listQuery(params) {
|
|
2141
|
-
return
|
|
2142
|
-
resource_id:
|
|
2143
|
-
resource_type:
|
|
2639
|
+
return stripUndefined8({
|
|
2640
|
+
resource_id: pickFirst2(params.resourceId, params.resource_id),
|
|
2641
|
+
resource_type: pickFirst2(params.resourceType, params.resource_type),
|
|
2144
2642
|
host: params.host,
|
|
2145
2643
|
action: params.action,
|
|
2146
2644
|
since: params.since,
|
|
2147
2645
|
until: params.until,
|
|
2148
2646
|
limit: params.limit,
|
|
2149
2647
|
cursor: params.cursor,
|
|
2150
|
-
external_user_id:
|
|
2151
|
-
external_workspace_id:
|
|
2648
|
+
external_user_id: pickFirst2(params.externalUserId, params.external_user_id),
|
|
2649
|
+
external_workspace_id: pickFirst2(
|
|
2152
2650
|
params.externalWorkspaceId,
|
|
2153
2651
|
params.external_workspace_id
|
|
2154
2652
|
)
|
|
@@ -2168,14 +2666,14 @@ var EgressAudit = class {
|
|
|
2168
2666
|
"/egress/audit",
|
|
2169
2667
|
listQuery(params)
|
|
2170
2668
|
);
|
|
2171
|
-
return
|
|
2669
|
+
return unwrapList9(data);
|
|
2172
2670
|
}
|
|
2173
2671
|
/** Get a single audit event by id. */
|
|
2174
2672
|
async get(id) {
|
|
2175
2673
|
const data = await this.http.get(
|
|
2176
2674
|
`/egress/audit/${id}`
|
|
2177
2675
|
);
|
|
2178
|
-
return
|
|
2676
|
+
return unwrap21(data);
|
|
2179
2677
|
}
|
|
2180
2678
|
/**
|
|
2181
2679
|
* Long-poll the audit endpoint and yield new events as they appear.
|
|
@@ -2195,7 +2693,7 @@ var EgressAudit = class {
|
|
|
2195
2693
|
"/egress/audit",
|
|
2196
2694
|
listQuery(queryParams)
|
|
2197
2695
|
);
|
|
2198
|
-
const events =
|
|
2696
|
+
const events = unwrapList9(data);
|
|
2199
2697
|
for (const event of events) {
|
|
2200
2698
|
if (event.id && seen.has(event.id)) continue;
|
|
2201
2699
|
if (event.id) seen.add(event.id);
|
|
@@ -2251,7 +2749,7 @@ var ComputerAudit = class extends SandboxAudit {
|
|
|
2251
2749
|
};
|
|
2252
2750
|
|
|
2253
2751
|
// src/resources/egressNetwork.ts
|
|
2254
|
-
function
|
|
2752
|
+
function unwrap22(payload) {
|
|
2255
2753
|
if (payload && typeof payload === "object") {
|
|
2256
2754
|
const p = payload;
|
|
2257
2755
|
for (const k of ["data", "policy", "rule", "items"]) {
|
|
@@ -2260,7 +2758,7 @@ function unwrap21(payload) {
|
|
|
2260
2758
|
}
|
|
2261
2759
|
return payload;
|
|
2262
2760
|
}
|
|
2263
|
-
function
|
|
2761
|
+
function unwrapList10(payload) {
|
|
2264
2762
|
if (Array.isArray(payload)) return payload;
|
|
2265
2763
|
if (payload && typeof payload === "object") {
|
|
2266
2764
|
const p = payload;
|
|
@@ -2277,24 +2775,24 @@ function unwrapList9(payload) {
|
|
|
2277
2775
|
}
|
|
2278
2776
|
return [];
|
|
2279
2777
|
}
|
|
2280
|
-
function
|
|
2778
|
+
function stripUndefined9(input) {
|
|
2281
2779
|
return Object.fromEntries(
|
|
2282
2780
|
Object.entries(input).filter(([, v]) => v !== void 0)
|
|
2283
2781
|
);
|
|
2284
2782
|
}
|
|
2285
|
-
function
|
|
2783
|
+
function pickFirst3(...values) {
|
|
2286
2784
|
for (const v of values) if (v !== void 0) return v;
|
|
2287
2785
|
return void 0;
|
|
2288
2786
|
}
|
|
2289
2787
|
function ruleBody(host, params, effect) {
|
|
2290
|
-
return
|
|
2788
|
+
return stripUndefined9({
|
|
2291
2789
|
host,
|
|
2292
2790
|
effect,
|
|
2293
2791
|
methods: params.methods,
|
|
2294
|
-
path_glob:
|
|
2295
|
-
policy_id:
|
|
2296
|
-
resource_id:
|
|
2297
|
-
resource_type:
|
|
2792
|
+
path_glob: pickFirst3(params.pathGlob, params.path_glob),
|
|
2793
|
+
policy_id: pickFirst3(params.policyId, params.policy_id),
|
|
2794
|
+
resource_id: pickFirst3(params.resourceId, params.resource_id),
|
|
2795
|
+
resource_type: pickFirst3(params.resourceType, params.resource_type),
|
|
2298
2796
|
note: params.note
|
|
2299
2797
|
});
|
|
2300
2798
|
}
|
|
@@ -2310,7 +2808,7 @@ var EgressNetwork = class {
|
|
|
2310
2808
|
"/egress/allowlist",
|
|
2311
2809
|
ruleBody(host, params, "allow")
|
|
2312
2810
|
);
|
|
2313
|
-
return
|
|
2811
|
+
return unwrap22(data);
|
|
2314
2812
|
}
|
|
2315
2813
|
/** Add a `deny` rule for `host` to the allowlist. */
|
|
2316
2814
|
async deny(host, params = {}) {
|
|
@@ -2318,17 +2816,17 @@ var EgressNetwork = class {
|
|
|
2318
2816
|
"/egress/allowlist",
|
|
2319
2817
|
ruleBody(host, params, "deny")
|
|
2320
2818
|
);
|
|
2321
|
-
return
|
|
2819
|
+
return unwrap22(data);
|
|
2322
2820
|
}
|
|
2323
2821
|
/** List allowlist rules. */
|
|
2324
2822
|
async rules(params = {}) {
|
|
2325
|
-
const query2 =
|
|
2326
|
-
policy_id:
|
|
2327
|
-
resource_id:
|
|
2328
|
-
resource_type:
|
|
2823
|
+
const query2 = stripUndefined9({
|
|
2824
|
+
policy_id: pickFirst3(params.policyId, params.policy_id),
|
|
2825
|
+
resource_id: pickFirst3(params.resourceId, params.resource_id),
|
|
2826
|
+
resource_type: pickFirst3(params.resourceType, params.resource_type)
|
|
2329
2827
|
});
|
|
2330
2828
|
const data = await this.http.get("/egress/allowlist", query2);
|
|
2331
|
-
return
|
|
2829
|
+
return unwrapList10(data);
|
|
2332
2830
|
}
|
|
2333
2831
|
/** Delete an allowlist rule by id. */
|
|
2334
2832
|
async removeRule(ruleId) {
|
|
@@ -2337,38 +2835,38 @@ var EgressNetwork = class {
|
|
|
2337
2835
|
// ── policies ──────────────────────────────────────────────────────────────
|
|
2338
2836
|
/** List egress policies. */
|
|
2339
2837
|
async policies(params = {}) {
|
|
2340
|
-
const query2 =
|
|
2341
|
-
resource_id:
|
|
2342
|
-
resource_type:
|
|
2838
|
+
const query2 = stripUndefined9({
|
|
2839
|
+
resource_id: pickFirst3(params.resourceId, params.resource_id),
|
|
2840
|
+
resource_type: pickFirst3(params.resourceType, params.resource_type)
|
|
2343
2841
|
});
|
|
2344
2842
|
const data = await this.http.get("/egress/policies", query2);
|
|
2345
|
-
return
|
|
2843
|
+
return unwrapList10(data);
|
|
2346
2844
|
}
|
|
2347
2845
|
/** Create an egress policy. */
|
|
2348
2846
|
async createPolicy(params) {
|
|
2349
|
-
const body4 =
|
|
2847
|
+
const body4 = stripUndefined9({
|
|
2350
2848
|
name: params.name,
|
|
2351
2849
|
mode: params.mode ?? "enforce",
|
|
2352
|
-
default_effect:
|
|
2850
|
+
default_effect: pickFirst3(
|
|
2353
2851
|
params.defaultEffect,
|
|
2354
2852
|
params.default_effect,
|
|
2355
2853
|
"deny"
|
|
2356
2854
|
),
|
|
2357
|
-
resource_id:
|
|
2358
|
-
resource_type:
|
|
2855
|
+
resource_id: pickFirst3(params.resourceId, params.resource_id),
|
|
2856
|
+
resource_type: pickFirst3(params.resourceType, params.resource_type),
|
|
2359
2857
|
description: params.description
|
|
2360
2858
|
});
|
|
2361
2859
|
const data = await this.http.post(
|
|
2362
2860
|
"/egress/policies",
|
|
2363
2861
|
body4
|
|
2364
2862
|
);
|
|
2365
|
-
return
|
|
2863
|
+
return unwrap22(data);
|
|
2366
2864
|
}
|
|
2367
2865
|
/** Update an egress policy by id. */
|
|
2368
2866
|
async updatePolicy(policyId, params) {
|
|
2369
|
-
const body4 =
|
|
2867
|
+
const body4 = stripUndefined9({
|
|
2370
2868
|
mode: params.mode,
|
|
2371
|
-
default_effect:
|
|
2869
|
+
default_effect: pickFirst3(params.defaultEffect, params.default_effect),
|
|
2372
2870
|
name: params.name,
|
|
2373
2871
|
description: params.description
|
|
2374
2872
|
});
|
|
@@ -2376,7 +2874,7 @@ var EgressNetwork = class {
|
|
|
2376
2874
|
`/egress/policies/${policyId}`,
|
|
2377
2875
|
body4
|
|
2378
2876
|
);
|
|
2379
|
-
return
|
|
2877
|
+
return unwrap22(data);
|
|
2380
2878
|
}
|
|
2381
2879
|
// ── mode helpers ──────────────────────────────────────────────────────────
|
|
2382
2880
|
/** Set the policy to `mode="enforce"` — denied egress is blocked. */
|
|
@@ -2388,13 +2886,13 @@ var EgressNetwork = class {
|
|
|
2388
2886
|
return this.setMode("audit_only", params);
|
|
2389
2887
|
}
|
|
2390
2888
|
async setMode(mode, params) {
|
|
2391
|
-
const policyId =
|
|
2392
|
-
const resourceId =
|
|
2393
|
-
const resourceType =
|
|
2889
|
+
const policyId = pickFirst3(params.policyId, params.policy_id);
|
|
2890
|
+
const resourceId = pickFirst3(params.resourceId, params.resource_id);
|
|
2891
|
+
const resourceType = pickFirst3(params.resourceType, params.resource_type);
|
|
2394
2892
|
if (policyId) {
|
|
2395
2893
|
return this.updatePolicy(policyId, { mode });
|
|
2396
2894
|
}
|
|
2397
|
-
const body4 = resourceId !== void 0 && resourceType !== void 0 ?
|
|
2895
|
+
const body4 = resourceId !== void 0 && resourceType !== void 0 ? stripUndefined9({
|
|
2398
2896
|
mode,
|
|
2399
2897
|
resource_id: resourceId,
|
|
2400
2898
|
resource_type: resourceType
|
|
@@ -2403,21 +2901,21 @@ var EgressNetwork = class {
|
|
|
2403
2901
|
"/egress/policies",
|
|
2404
2902
|
body4
|
|
2405
2903
|
);
|
|
2406
|
-
return
|
|
2904
|
+
return unwrap22(data);
|
|
2407
2905
|
}
|
|
2408
2906
|
// ── suggestions ───────────────────────────────────────────────────────────
|
|
2409
2907
|
/** AI-generated allowlist suggestions from recent denied egress. */
|
|
2410
2908
|
async suggestions(params = {}) {
|
|
2411
|
-
const query2 =
|
|
2412
|
-
resource_id:
|
|
2413
|
-
resource_type:
|
|
2909
|
+
const query2 = stripUndefined9({
|
|
2910
|
+
resource_id: pickFirst3(params.resourceId, params.resource_id),
|
|
2911
|
+
resource_type: pickFirst3(params.resourceType, params.resource_type),
|
|
2414
2912
|
since: params.since ?? "7d"
|
|
2415
2913
|
});
|
|
2416
2914
|
const data = await this.http.get(
|
|
2417
2915
|
"/egress/audit/suggestions",
|
|
2418
2916
|
query2
|
|
2419
2917
|
);
|
|
2420
|
-
return
|
|
2918
|
+
return unwrapList10(data);
|
|
2421
2919
|
}
|
|
2422
2920
|
};
|
|
2423
2921
|
var SandboxNetwork = class {
|
|
@@ -2494,7 +2992,7 @@ var ComputerNetwork = class extends SandboxNetwork {
|
|
|
2494
2992
|
};
|
|
2495
2993
|
|
|
2496
2994
|
// src/resources/egressSecrets.ts
|
|
2497
|
-
function
|
|
2995
|
+
function unwrap23(payload) {
|
|
2498
2996
|
if (payload && typeof payload === "object") {
|
|
2499
2997
|
const p = payload;
|
|
2500
2998
|
for (const k of ["data", "secret", "binding", "items"]) {
|
|
@@ -2503,7 +3001,7 @@ function unwrap22(payload) {
|
|
|
2503
3001
|
}
|
|
2504
3002
|
return payload;
|
|
2505
3003
|
}
|
|
2506
|
-
function
|
|
3004
|
+
function unwrapList11(payload) {
|
|
2507
3005
|
if (Array.isArray(payload)) return payload;
|
|
2508
3006
|
if (payload && typeof payload === "object") {
|
|
2509
3007
|
const p = payload;
|
|
@@ -2513,87 +3011,87 @@ function unwrapList10(payload) {
|
|
|
2513
3011
|
}
|
|
2514
3012
|
return [];
|
|
2515
3013
|
}
|
|
2516
|
-
function
|
|
3014
|
+
function stripUndefined10(input) {
|
|
2517
3015
|
return Object.fromEntries(
|
|
2518
3016
|
Object.entries(input).filter(([, v]) => v !== void 0)
|
|
2519
3017
|
);
|
|
2520
3018
|
}
|
|
2521
|
-
function
|
|
3019
|
+
function pickFirst4(...values) {
|
|
2522
3020
|
for (const v of values) if (v !== void 0) return v;
|
|
2523
3021
|
return void 0;
|
|
2524
3022
|
}
|
|
2525
3023
|
function setBody(params) {
|
|
2526
|
-
return
|
|
3024
|
+
return stripUndefined10({
|
|
2527
3025
|
name: params.name,
|
|
2528
3026
|
value: params.value,
|
|
2529
3027
|
type: params.type ?? "api_key",
|
|
2530
3028
|
scope: params.scope ?? "user",
|
|
2531
|
-
expose_as_env:
|
|
2532
|
-
workspace_id:
|
|
2533
|
-
owner_user_id:
|
|
2534
|
-
external_user_id:
|
|
2535
|
-
external_workspace_id:
|
|
3029
|
+
expose_as_env: pickFirst4(params.exposeAsEnv, params.expose_as_env),
|
|
3030
|
+
workspace_id: pickFirst4(params.workspaceId, params.workspace_id),
|
|
3031
|
+
owner_user_id: pickFirst4(params.ownerUserId, params.owner_user_id),
|
|
3032
|
+
external_user_id: pickFirst4(params.externalUserId, params.external_user_id),
|
|
3033
|
+
external_workspace_id: pickFirst4(
|
|
2536
3034
|
params.externalWorkspaceId,
|
|
2537
3035
|
params.external_workspace_id
|
|
2538
3036
|
),
|
|
2539
|
-
resource_id:
|
|
2540
|
-
resource_type:
|
|
2541
|
-
refresh_token:
|
|
2542
|
-
expires_at:
|
|
3037
|
+
resource_id: pickFirst4(params.resourceId, params.resource_id),
|
|
3038
|
+
resource_type: pickFirst4(params.resourceType, params.resource_type),
|
|
3039
|
+
refresh_token: pickFirst4(params.refreshToken, params.refresh_token),
|
|
3040
|
+
expires_at: pickFirst4(params.expiresAt, params.expires_at),
|
|
2543
3041
|
metadata: params.metadata
|
|
2544
3042
|
});
|
|
2545
3043
|
}
|
|
2546
3044
|
function listQuery2(params) {
|
|
2547
|
-
return
|
|
3045
|
+
return stripUndefined10({
|
|
2548
3046
|
scope: params.scope,
|
|
2549
3047
|
type: params.type,
|
|
2550
|
-
workspace_id:
|
|
2551
|
-
owner_user_id:
|
|
2552
|
-
external_user_id:
|
|
2553
|
-
external_workspace_id:
|
|
3048
|
+
workspace_id: pickFirst4(params.workspaceId, params.workspace_id),
|
|
3049
|
+
owner_user_id: pickFirst4(params.ownerUserId, params.owner_user_id),
|
|
3050
|
+
external_user_id: pickFirst4(params.externalUserId, params.external_user_id),
|
|
3051
|
+
external_workspace_id: pickFirst4(
|
|
2554
3052
|
params.externalWorkspaceId,
|
|
2555
3053
|
params.external_workspace_id
|
|
2556
3054
|
),
|
|
2557
|
-
resource_id:
|
|
2558
|
-
resource_type:
|
|
3055
|
+
resource_id: pickFirst4(params.resourceId, params.resource_id),
|
|
3056
|
+
resource_type: pickFirst4(params.resourceType, params.resource_type)
|
|
2559
3057
|
});
|
|
2560
3058
|
}
|
|
2561
3059
|
function rotateBody(params) {
|
|
2562
|
-
return
|
|
2563
|
-
value:
|
|
2564
|
-
refresh_token:
|
|
2565
|
-
expires_at:
|
|
3060
|
+
return stripUndefined10({
|
|
3061
|
+
value: pickFirst4(params.newValue, params.new_value, params.value),
|
|
3062
|
+
refresh_token: pickFirst4(params.refreshToken, params.refresh_token),
|
|
3063
|
+
expires_at: pickFirst4(params.expiresAt, params.expires_at)
|
|
2566
3064
|
});
|
|
2567
3065
|
}
|
|
2568
3066
|
function bindingBody(params) {
|
|
2569
|
-
return
|
|
2570
|
-
secret_id:
|
|
2571
|
-
resource_id:
|
|
2572
|
-
resource_type:
|
|
2573
|
-
expose_as_env:
|
|
3067
|
+
return stripUndefined10({
|
|
3068
|
+
secret_id: pickFirst4(params.secretId, params.secret_id),
|
|
3069
|
+
resource_id: pickFirst4(params.resourceId, params.resource_id),
|
|
3070
|
+
resource_type: pickFirst4(params.resourceType, params.resource_type),
|
|
3071
|
+
expose_as_env: pickFirst4(params.exposeAsEnv, params.expose_as_env)
|
|
2574
3072
|
});
|
|
2575
3073
|
}
|
|
2576
3074
|
function bindingQuery(params) {
|
|
2577
|
-
return
|
|
2578
|
-
resource_id:
|
|
2579
|
-
resource_type:
|
|
2580
|
-
secret_id:
|
|
3075
|
+
return stripUndefined10({
|
|
3076
|
+
resource_id: pickFirst4(params.resourceId, params.resource_id),
|
|
3077
|
+
resource_type: pickFirst4(params.resourceType, params.resource_type),
|
|
3078
|
+
secret_id: pickFirst4(params.secretId, params.secret_id)
|
|
2581
3079
|
});
|
|
2582
3080
|
}
|
|
2583
3081
|
function oauthBody(params) {
|
|
2584
|
-
return
|
|
3082
|
+
return stripUndefined10({
|
|
2585
3083
|
provider: params.provider,
|
|
2586
|
-
expose_as_env:
|
|
3084
|
+
expose_as_env: pickFirst4(params.exposeAsEnv, params.expose_as_env),
|
|
2587
3085
|
scope: params.scope,
|
|
2588
|
-
owner_user_id:
|
|
2589
|
-
external_user_id:
|
|
2590
|
-
external_workspace_id:
|
|
3086
|
+
owner_user_id: pickFirst4(params.ownerUserId, params.owner_user_id),
|
|
3087
|
+
external_user_id: pickFirst4(params.externalUserId, params.external_user_id),
|
|
3088
|
+
external_workspace_id: pickFirst4(
|
|
2591
3089
|
params.externalWorkspaceId,
|
|
2592
3090
|
params.external_workspace_id
|
|
2593
3091
|
),
|
|
2594
|
-
resource_id:
|
|
2595
|
-
resource_type:
|
|
2596
|
-
redirect_uri:
|
|
3092
|
+
resource_id: pickFirst4(params.resourceId, params.resource_id),
|
|
3093
|
+
resource_type: pickFirst4(params.resourceType, params.resource_type),
|
|
3094
|
+
redirect_uri: pickFirst4(params.redirectUri, params.redirect_uri)
|
|
2597
3095
|
});
|
|
2598
3096
|
}
|
|
2599
3097
|
function sleep5(ms) {
|
|
@@ -2630,7 +3128,7 @@ var OAuthFlow = class {
|
|
|
2630
3128
|
const data = await this.http.get("/egress/oauth/status", {
|
|
2631
3129
|
state: this.state
|
|
2632
3130
|
});
|
|
2633
|
-
const payload =
|
|
3131
|
+
const payload = unwrap23(data) ?? {};
|
|
2634
3132
|
const status = payload.status;
|
|
2635
3133
|
if (status === "completed" || status === "ready" || status === "succeeded") {
|
|
2636
3134
|
return payload;
|
|
@@ -2662,7 +3160,7 @@ var EgressSecrets = class {
|
|
|
2662
3160
|
"/egress/secrets",
|
|
2663
3161
|
setBody(params)
|
|
2664
3162
|
);
|
|
2665
|
-
return
|
|
3163
|
+
return unwrap23(data);
|
|
2666
3164
|
}
|
|
2667
3165
|
/** List secrets. */
|
|
2668
3166
|
async list(params = {}) {
|
|
@@ -2670,14 +3168,14 @@ var EgressSecrets = class {
|
|
|
2670
3168
|
"/egress/secrets",
|
|
2671
3169
|
listQuery2(params)
|
|
2672
3170
|
);
|
|
2673
|
-
return
|
|
3171
|
+
return unwrapList11(data);
|
|
2674
3172
|
}
|
|
2675
3173
|
/** Get a single secret by id. */
|
|
2676
3174
|
async get(id) {
|
|
2677
3175
|
const data = await this.http.get(
|
|
2678
3176
|
`/egress/secrets/${id}`
|
|
2679
3177
|
);
|
|
2680
|
-
return
|
|
3178
|
+
return unwrap23(data);
|
|
2681
3179
|
}
|
|
2682
3180
|
/** Rotate the secret's value. */
|
|
2683
3181
|
async rotate(id, params) {
|
|
@@ -2686,7 +3184,7 @@ var EgressSecrets = class {
|
|
|
2686
3184
|
`/egress/secrets/${id}`,
|
|
2687
3185
|
body4
|
|
2688
3186
|
);
|
|
2689
|
-
return
|
|
3187
|
+
return unwrap23(data);
|
|
2690
3188
|
}
|
|
2691
3189
|
/** Delete a secret. */
|
|
2692
3190
|
async delete(id) {
|
|
@@ -2699,7 +3197,7 @@ var EgressSecrets = class {
|
|
|
2699
3197
|
"/egress/bindings",
|
|
2700
3198
|
bindingBody(params)
|
|
2701
3199
|
);
|
|
2702
|
-
return
|
|
3200
|
+
return unwrap23(data);
|
|
2703
3201
|
}
|
|
2704
3202
|
/** List secret bindings. */
|
|
2705
3203
|
async listBindings(params = {}) {
|
|
@@ -2707,7 +3205,7 @@ var EgressSecrets = class {
|
|
|
2707
3205
|
"/egress/bindings",
|
|
2708
3206
|
bindingQuery(params)
|
|
2709
3207
|
);
|
|
2710
|
-
return
|
|
3208
|
+
return unwrapList11(data);
|
|
2711
3209
|
}
|
|
2712
3210
|
/** Delete a binding. */
|
|
2713
3211
|
async deleteBinding(id) {
|
|
@@ -2717,7 +3215,7 @@ var EgressSecrets = class {
|
|
|
2717
3215
|
/** List OAuth providers visible to the current tenant. */
|
|
2718
3216
|
async providers() {
|
|
2719
3217
|
const data = await this.http.get("/egress/oauth/providers");
|
|
2720
|
-
return
|
|
3218
|
+
return unwrapList11(data);
|
|
2721
3219
|
}
|
|
2722
3220
|
/**
|
|
2723
3221
|
* Start an OAuth Connect flow.
|
|
@@ -2732,7 +3230,7 @@ var EgressSecrets = class {
|
|
|
2732
3230
|
"/egress/oauth/start",
|
|
2733
3231
|
oauthBody(params)
|
|
2734
3232
|
);
|
|
2735
|
-
const payload =
|
|
3233
|
+
const payload = unwrap23(data) ?? {};
|
|
2736
3234
|
return new OAuthFlow(this.http, payload, params.provider);
|
|
2737
3235
|
}
|
|
2738
3236
|
};
|
|
@@ -3348,6 +3846,8 @@ var Computer = class _Computer {
|
|
|
3348
3846
|
ports;
|
|
3349
3847
|
/** Volume attachment — list, attach, detach. */
|
|
3350
3848
|
volumes;
|
|
3849
|
+
/** MIOSA Connect provider bindings scoped to this computer. */
|
|
3850
|
+
connectors;
|
|
3351
3851
|
/** Encrypted secrets + OAuth credentials scoped to this computer. */
|
|
3352
3852
|
secrets;
|
|
3353
3853
|
/** Egress allowlist + policies scoped to this computer. */
|
|
@@ -3374,6 +3874,7 @@ var Computer = class _Computer {
|
|
|
3374
3874
|
this.logs = new ComputerLogs(http, id);
|
|
3375
3875
|
this.ports = new ComputerPorts(http, id);
|
|
3376
3876
|
this.volumes = new ComputerVolumes(http, id);
|
|
3877
|
+
this.connectors = new ComputerConnectors(http, id);
|
|
3377
3878
|
this.secrets = new ComputerSecrets(http, id);
|
|
3378
3879
|
this.network = new ComputerNetwork(http, id);
|
|
3379
3880
|
this.audit = new ComputerAudit(http, id);
|
|
@@ -3785,7 +4286,7 @@ var Credits = class {
|
|
|
3785
4286
|
return this.http.get("/credits/usage");
|
|
3786
4287
|
}
|
|
3787
4288
|
};
|
|
3788
|
-
function
|
|
4289
|
+
function unwrap24(payload) {
|
|
3789
4290
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
3790
4291
|
return payload.data;
|
|
3791
4292
|
}
|
|
@@ -3801,7 +4302,7 @@ function listItems2(payload, candidateKeys = ["data", "cron_jobs", "executions",
|
|
|
3801
4302
|
}
|
|
3802
4303
|
return [];
|
|
3803
4304
|
}
|
|
3804
|
-
function
|
|
4305
|
+
function stripUndefined11(input) {
|
|
3805
4306
|
return Object.fromEntries(
|
|
3806
4307
|
Object.entries(input).filter(([, v]) => v !== void 0)
|
|
3807
4308
|
);
|
|
@@ -3815,28 +4316,28 @@ var CronJobs = class {
|
|
|
3815
4316
|
}
|
|
3816
4317
|
http;
|
|
3817
4318
|
async list(params = {}) {
|
|
3818
|
-
const query2 =
|
|
4319
|
+
const query2 = stripUndefined11({ ...params });
|
|
3819
4320
|
const data = await this.http.get("/cron-jobs", query2);
|
|
3820
4321
|
return listItems2(data);
|
|
3821
4322
|
}
|
|
3822
4323
|
async get(jobId) {
|
|
3823
4324
|
const data = await this.http.get(`/cron-jobs/${jobId}`);
|
|
3824
|
-
return
|
|
4325
|
+
return unwrap24(data);
|
|
3825
4326
|
}
|
|
3826
4327
|
async create(params) {
|
|
3827
4328
|
const { idempotencyKey: ikey, ...rest } = params;
|
|
3828
|
-
const body4 =
|
|
4329
|
+
const body4 = stripUndefined11(rest);
|
|
3829
4330
|
const data = await this.http.request("/cron-jobs", {
|
|
3830
4331
|
method: "POST",
|
|
3831
4332
|
body: body4,
|
|
3832
4333
|
headers: { "Idempotency-Key": idempotencyKey2(ikey) }
|
|
3833
4334
|
});
|
|
3834
|
-
return
|
|
4335
|
+
return unwrap24(data);
|
|
3835
4336
|
}
|
|
3836
4337
|
async update(jobId, params) {
|
|
3837
|
-
const body4 =
|
|
4338
|
+
const body4 = stripUndefined11(params);
|
|
3838
4339
|
const data = await this.http.patch(`/cron-jobs/${jobId}`, body4);
|
|
3839
|
-
return
|
|
4340
|
+
return unwrap24(data);
|
|
3840
4341
|
}
|
|
3841
4342
|
async delete(jobId) {
|
|
3842
4343
|
await this.http.delete(`/cron-jobs/${jobId}`);
|
|
@@ -3844,11 +4345,11 @@ var CronJobs = class {
|
|
|
3844
4345
|
// ── Control ────────────────────────────────────────────────────────────────
|
|
3845
4346
|
async pause(jobId) {
|
|
3846
4347
|
const data = await this.http.post(`/cron-jobs/${jobId}/pause`);
|
|
3847
|
-
return
|
|
4348
|
+
return unwrap24(data);
|
|
3848
4349
|
}
|
|
3849
4350
|
async resume(jobId) {
|
|
3850
4351
|
const data = await this.http.post(`/cron-jobs/${jobId}/resume`);
|
|
3851
|
-
return
|
|
4352
|
+
return unwrap24(data);
|
|
3852
4353
|
}
|
|
3853
4354
|
async runNow(jobId, opts = {}) {
|
|
3854
4355
|
const data = await this.http.request(
|
|
@@ -3858,7 +4359,7 @@ var CronJobs = class {
|
|
|
3858
4359
|
headers: { "Idempotency-Key": idempotencyKey2(opts.idempotencyKey) }
|
|
3859
4360
|
}
|
|
3860
4361
|
);
|
|
3861
|
-
return
|
|
4362
|
+
return unwrap24(data);
|
|
3862
4363
|
}
|
|
3863
4364
|
// ── Execution history ──────────────────────────────────────────────────────
|
|
3864
4365
|
async listExecutions(jobId) {
|
|
@@ -3873,12 +4374,12 @@ var CronJobs = class {
|
|
|
3873
4374
|
const data = await this.http.get(
|
|
3874
4375
|
`/cron-jobs/${jobId}/executions/${executionId}`
|
|
3875
4376
|
);
|
|
3876
|
-
return
|
|
4377
|
+
return unwrap24(data);
|
|
3877
4378
|
}
|
|
3878
4379
|
};
|
|
3879
4380
|
|
|
3880
4381
|
// src/resources/dashboard.ts
|
|
3881
|
-
function
|
|
4382
|
+
function unwrap25(payload) {
|
|
3882
4383
|
if (payload && typeof payload === "object") {
|
|
3883
4384
|
const p = payload;
|
|
3884
4385
|
for (const k of ["data", "dashboard", "overview", "items"]) {
|
|
@@ -3895,15 +4396,15 @@ var Dashboard = class {
|
|
|
3895
4396
|
/** Aggregated user dashboard payload. */
|
|
3896
4397
|
async summary() {
|
|
3897
4398
|
const data = await this.http.get("/dashboard");
|
|
3898
|
-
return
|
|
4399
|
+
return unwrap25(data);
|
|
3899
4400
|
}
|
|
3900
4401
|
/** Status / health overview (public endpoint). */
|
|
3901
4402
|
async overview() {
|
|
3902
4403
|
const data = await this.http.get("/overview");
|
|
3903
|
-
return
|
|
4404
|
+
return unwrap25(data);
|
|
3904
4405
|
}
|
|
3905
4406
|
};
|
|
3906
|
-
function
|
|
4407
|
+
function unwrap26(payload) {
|
|
3907
4408
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
3908
4409
|
return payload.data;
|
|
3909
4410
|
}
|
|
@@ -3919,7 +4420,7 @@ function listItems3(payload, candidateKeys = ["data", "databases", "items"]) {
|
|
|
3919
4420
|
}
|
|
3920
4421
|
return [];
|
|
3921
4422
|
}
|
|
3922
|
-
function
|
|
4423
|
+
function stripUndefined12(input) {
|
|
3923
4424
|
return Object.fromEntries(
|
|
3924
4425
|
Object.entries(input).filter(([, v]) => v !== void 0)
|
|
3925
4426
|
);
|
|
@@ -3933,13 +4434,13 @@ var Databases = class {
|
|
|
3933
4434
|
}
|
|
3934
4435
|
http;
|
|
3935
4436
|
async list(params = {}) {
|
|
3936
|
-
const query2 =
|
|
4437
|
+
const query2 = stripUndefined12({ ...params });
|
|
3937
4438
|
const data = await this.http.get("/databases", query2);
|
|
3938
4439
|
return listItems3(data);
|
|
3939
4440
|
}
|
|
3940
4441
|
async get(databaseId) {
|
|
3941
4442
|
const data = await this.http.get(`/databases/${databaseId}`);
|
|
3942
|
-
return
|
|
4443
|
+
return unwrap26(data);
|
|
3943
4444
|
}
|
|
3944
4445
|
async create(params) {
|
|
3945
4446
|
const {
|
|
@@ -3950,7 +4451,7 @@ var Databases = class {
|
|
|
3950
4451
|
size: _deprecatedSize,
|
|
3951
4452
|
...rest
|
|
3952
4453
|
} = params;
|
|
3953
|
-
const body4 =
|
|
4454
|
+
const body4 = stripUndefined12({
|
|
3954
4455
|
...rest,
|
|
3955
4456
|
engine_version: engine_version ?? version
|
|
3956
4457
|
});
|
|
@@ -3963,7 +4464,7 @@ var Databases = class {
|
|
|
3963
4464
|
)
|
|
3964
4465
|
}
|
|
3965
4466
|
});
|
|
3966
|
-
return
|
|
4467
|
+
return unwrap26(data);
|
|
3967
4468
|
}
|
|
3968
4469
|
async delete(databaseId) {
|
|
3969
4470
|
await this.http.delete(`/databases/${databaseId}`);
|
|
@@ -3973,27 +4474,27 @@ var Databases = class {
|
|
|
3973
4474
|
const data = await this.http.post(
|
|
3974
4475
|
`/databases/${databaseId}/start`
|
|
3975
4476
|
);
|
|
3976
|
-
return
|
|
4477
|
+
return unwrap26(data);
|
|
3977
4478
|
}
|
|
3978
4479
|
async stop(databaseId) {
|
|
3979
4480
|
const data = await this.http.post(`/databases/${databaseId}/stop`);
|
|
3980
|
-
return
|
|
4481
|
+
return unwrap26(data);
|
|
3981
4482
|
}
|
|
3982
4483
|
async restart(databaseId) {
|
|
3983
4484
|
const data = await this.http.post(
|
|
3984
4485
|
`/databases/${databaseId}/restart`
|
|
3985
4486
|
);
|
|
3986
|
-
return
|
|
4487
|
+
return unwrap26(data);
|
|
3987
4488
|
}
|
|
3988
4489
|
// ── Credentials + logs ────────────────────────────────────────────────────
|
|
3989
4490
|
async credentials(databaseId) {
|
|
3990
4491
|
const data = await this.http.get(
|
|
3991
4492
|
`/databases/${databaseId}/credentials`
|
|
3992
4493
|
);
|
|
3993
|
-
return
|
|
4494
|
+
return unwrap26(data);
|
|
3994
4495
|
}
|
|
3995
4496
|
async logs(databaseId, params = {}) {
|
|
3996
|
-
const query2 =
|
|
4497
|
+
const query2 = stripUndefined12({
|
|
3997
4498
|
lines: params.lines,
|
|
3998
4499
|
since: params.since
|
|
3999
4500
|
});
|
|
@@ -4020,7 +4521,7 @@ function attributionBody(p) {
|
|
|
4020
4521
|
function idempotencyKey4(key) {
|
|
4021
4522
|
return key ?? randomUUID();
|
|
4022
4523
|
}
|
|
4023
|
-
function
|
|
4524
|
+
function unwrap27(payload) {
|
|
4024
4525
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
4025
4526
|
return payload.data;
|
|
4026
4527
|
}
|
|
@@ -4036,7 +4537,7 @@ function listItems4(payload, candidateKeys = ["items", "deployments", "versions"
|
|
|
4036
4537
|
}
|
|
4037
4538
|
return [];
|
|
4038
4539
|
}
|
|
4039
|
-
function
|
|
4540
|
+
function stripUndefined13(input) {
|
|
4040
4541
|
return Object.fromEntries(
|
|
4041
4542
|
Object.entries(input).filter(([, v]) => v !== void 0)
|
|
4042
4543
|
);
|
|
@@ -4091,7 +4592,7 @@ var DeploymentVersions = class {
|
|
|
4091
4592
|
http;
|
|
4092
4593
|
deploymentId;
|
|
4093
4594
|
async list(params = {}) {
|
|
4094
|
-
const query2 =
|
|
4595
|
+
const query2 = stripUndefined13({
|
|
4095
4596
|
state: params.state,
|
|
4096
4597
|
limit: params.limit,
|
|
4097
4598
|
cursor: params.cursor,
|
|
@@ -4107,10 +4608,10 @@ var DeploymentVersions = class {
|
|
|
4107
4608
|
const data = await this.http.get(
|
|
4108
4609
|
`/deployments/${this.deploymentId}/versions/${versionId}`
|
|
4109
4610
|
);
|
|
4110
|
-
return
|
|
4611
|
+
return unwrap27(data);
|
|
4111
4612
|
}
|
|
4112
4613
|
async promote(versionId, opts = {}) {
|
|
4113
|
-
const body4 =
|
|
4614
|
+
const body4 = stripUndefined13({ environment: opts.environment });
|
|
4114
4615
|
const data = await this.http.request(
|
|
4115
4616
|
`/deployments/${this.deploymentId}/versions/${versionId}/promote`,
|
|
4116
4617
|
{
|
|
@@ -4119,7 +4620,7 @@ var DeploymentVersions = class {
|
|
|
4119
4620
|
headers: { "Idempotency-Key": idempotencyKey4(opts.idempotencyKey) }
|
|
4120
4621
|
}
|
|
4121
4622
|
);
|
|
4122
|
-
return
|
|
4623
|
+
return unwrap27(data);
|
|
4123
4624
|
}
|
|
4124
4625
|
};
|
|
4125
4626
|
var DeploymentReleases = class {
|
|
@@ -4139,7 +4640,7 @@ var DeploymentReleases = class {
|
|
|
4139
4640
|
const data = await this.http.get(
|
|
4140
4641
|
`/deployments/${this.deploymentId}/releases/${releaseId}`
|
|
4141
4642
|
);
|
|
4142
|
-
return
|
|
4643
|
+
return unwrap27(data);
|
|
4143
4644
|
}
|
|
4144
4645
|
};
|
|
4145
4646
|
var DeploymentRuntimeInstances = class {
|
|
@@ -4159,14 +4660,14 @@ var DeploymentRuntimeInstances = class {
|
|
|
4159
4660
|
const data = await this.http.get(
|
|
4160
4661
|
`/deployments/${this.deploymentId}/runtime-instances/${instanceId}`
|
|
4161
4662
|
);
|
|
4162
|
-
return
|
|
4663
|
+
return unwrap27(data);
|
|
4163
4664
|
}
|
|
4164
4665
|
async logs(instanceId, lines = 100) {
|
|
4165
4666
|
const data = await this.http.get(
|
|
4166
4667
|
`/deployments/${this.deploymentId}/runtime-instances/${instanceId}/logs`,
|
|
4167
4668
|
{ lines }
|
|
4168
4669
|
);
|
|
4169
|
-
const unwrapped =
|
|
4670
|
+
const unwrapped = unwrap27(data);
|
|
4170
4671
|
const result = { logs: String(unwrapped.logs ?? "") };
|
|
4171
4672
|
if (typeof unwrapped.runtime_instance_id === "string") {
|
|
4172
4673
|
result.runtime_instance_id = unwrapped.runtime_instance_id;
|
|
@@ -4197,11 +4698,11 @@ var DeploymentDomains = class {
|
|
|
4197
4698
|
`/deployments/${this.deploymentId}/domains`,
|
|
4198
4699
|
{
|
|
4199
4700
|
method: "POST",
|
|
4200
|
-
body:
|
|
4701
|
+
body: stripUndefined13(body4),
|
|
4201
4702
|
headers: { "Idempotency-Key": idempotencyKey4(params.idempotencyKey) }
|
|
4202
4703
|
}
|
|
4203
4704
|
);
|
|
4204
|
-
return
|
|
4705
|
+
return unwrap27(data);
|
|
4205
4706
|
}
|
|
4206
4707
|
async list(filters = {}) {
|
|
4207
4708
|
const data = await this.http.get(
|
|
@@ -4214,7 +4715,7 @@ var DeploymentDomains = class {
|
|
|
4214
4715
|
const data = await this.http.post(
|
|
4215
4716
|
`/deployments/${this.deploymentId}/domains/${domainId}/verify`
|
|
4216
4717
|
);
|
|
4217
|
-
return
|
|
4718
|
+
return unwrap27(data);
|
|
4218
4719
|
}
|
|
4219
4720
|
async delete(domainId) {
|
|
4220
4721
|
await this.http.delete(
|
|
@@ -4229,7 +4730,7 @@ var Deployments = class {
|
|
|
4229
4730
|
http;
|
|
4230
4731
|
async list(params = {}) {
|
|
4231
4732
|
const projectId = params.projectId ?? params.project_id;
|
|
4232
|
-
const query2 =
|
|
4733
|
+
const query2 = stripUndefined13({
|
|
4233
4734
|
project_id: projectId,
|
|
4234
4735
|
state: params.state,
|
|
4235
4736
|
limit: params.limit,
|
|
@@ -4244,10 +4745,10 @@ var Deployments = class {
|
|
|
4244
4745
|
}
|
|
4245
4746
|
async get(deploymentId) {
|
|
4246
4747
|
const data = await this.http.get(`/deployments/${deploymentId}`);
|
|
4247
|
-
return
|
|
4748
|
+
return unwrap27(data);
|
|
4248
4749
|
}
|
|
4249
4750
|
async create(params) {
|
|
4250
|
-
const body4 =
|
|
4751
|
+
const body4 = stripUndefined13({
|
|
4251
4752
|
name: params.name,
|
|
4252
4753
|
repo_url: params.repoUrl ?? params.repo_url,
|
|
4253
4754
|
branch: params.branch,
|
|
@@ -4263,7 +4764,7 @@ var Deployments = class {
|
|
|
4263
4764
|
body: body4,
|
|
4264
4765
|
headers: { "Idempotency-Key": idempotencyKey4(params.idempotencyKey) }
|
|
4265
4766
|
});
|
|
4266
|
-
return
|
|
4767
|
+
return unwrap27(data);
|
|
4267
4768
|
}
|
|
4268
4769
|
/**
|
|
4269
4770
|
* Create a deployment that runs on the workspace's dedicated Docker Deploy
|
|
@@ -4307,7 +4808,7 @@ var Deployments = class {
|
|
|
4307
4808
|
const rawHost = await this.http.get(
|
|
4308
4809
|
`/docker-deploy/hosts/${hostId}`
|
|
4309
4810
|
);
|
|
4310
|
-
host =
|
|
4811
|
+
host = unwrap27(
|
|
4311
4812
|
rawHost
|
|
4312
4813
|
);
|
|
4313
4814
|
addDoctorCheck(
|
|
@@ -4410,7 +4911,7 @@ var Deployments = class {
|
|
|
4410
4911
|
};
|
|
4411
4912
|
}
|
|
4412
4913
|
async update(deploymentId, params) {
|
|
4413
|
-
const body4 =
|
|
4914
|
+
const body4 = stripUndefined13({
|
|
4414
4915
|
name: params.name,
|
|
4415
4916
|
branch: params.branch,
|
|
4416
4917
|
build_command: params.buildCommand ?? params.build_command,
|
|
@@ -4421,13 +4922,13 @@ var Deployments = class {
|
|
|
4421
4922
|
`/deployments/${deploymentId}`,
|
|
4422
4923
|
body4
|
|
4423
4924
|
);
|
|
4424
|
-
return
|
|
4925
|
+
return unwrap27(data);
|
|
4425
4926
|
}
|
|
4426
4927
|
async delete(deploymentId) {
|
|
4427
4928
|
await this.http.delete(`/deployments/${deploymentId}`);
|
|
4428
4929
|
}
|
|
4429
4930
|
async publish(deploymentId, params) {
|
|
4430
|
-
const body4 =
|
|
4931
|
+
const body4 = stripUndefined13({
|
|
4431
4932
|
source_sandbox_id: params.sourceSandboxId ?? params.source_sandbox_id,
|
|
4432
4933
|
output_path: params.outputPath ?? params.output_path,
|
|
4433
4934
|
entrypoint: params.entrypoint,
|
|
@@ -4441,89 +4942,342 @@ var Deployments = class {
|
|
|
4441
4942
|
headers: { "Idempotency-Key": idempotencyKey4(params.idempotencyKey) }
|
|
4442
4943
|
}
|
|
4443
4944
|
);
|
|
4444
|
-
return
|
|
4945
|
+
return unwrap27(data);
|
|
4946
|
+
}
|
|
4947
|
+
/**
|
|
4948
|
+
* Backward-compatible bridge: POST /sandboxes/:id/deploy. Works today;
|
|
4949
|
+
* returns either release-backed or sandbox-backed depending on backend
|
|
4950
|
+
* phase. Prefer `publish()` once Phase 2B/3 lands.
|
|
4951
|
+
*/
|
|
4952
|
+
async publishFromSandbox(sandboxId, params = {}) {
|
|
4953
|
+
const body4 = stripUndefined13({
|
|
4954
|
+
name: params.name,
|
|
4955
|
+
deployment_id: params.deploymentId ?? params.deployment_id,
|
|
4956
|
+
output_path: params.outputPath ?? params.output_path,
|
|
4957
|
+
source_snapshot_path: params.sourceSnapshotPath ?? params.source_snapshot_path,
|
|
4958
|
+
entrypoint: params.entrypoint,
|
|
4959
|
+
domain: params.domain,
|
|
4960
|
+
custom_domain: params.customDomain ?? params.custom_domain
|
|
4961
|
+
});
|
|
4962
|
+
const data = await this.http.request(
|
|
4963
|
+
`/sandboxes/${sandboxId}/deploy`,
|
|
4964
|
+
{
|
|
4965
|
+
method: "POST",
|
|
4966
|
+
body: body4,
|
|
4967
|
+
headers: { "Idempotency-Key": idempotencyKey4(params.idempotencyKey) }
|
|
4968
|
+
}
|
|
4969
|
+
);
|
|
4970
|
+
return unwrap27(data);
|
|
4971
|
+
}
|
|
4972
|
+
async rollback(deploymentId, params = {}) {
|
|
4973
|
+
const body4 = stripUndefined13({
|
|
4974
|
+
version_id: params.versionId ?? params.version_id
|
|
4975
|
+
});
|
|
4976
|
+
const data = await this.http.request(
|
|
4977
|
+
`/deployments/${deploymentId}/rollback`,
|
|
4978
|
+
{
|
|
4979
|
+
method: "POST",
|
|
4980
|
+
body: body4,
|
|
4981
|
+
headers: { "Idempotency-Key": idempotencyKey4(params.idempotencyKey) }
|
|
4982
|
+
}
|
|
4983
|
+
);
|
|
4984
|
+
return unwrap27(data);
|
|
4985
|
+
}
|
|
4986
|
+
async listBuilds(deploymentId) {
|
|
4987
|
+
const data = await this.http.get(
|
|
4988
|
+
`/deployments/${deploymentId}/builds`
|
|
4989
|
+
);
|
|
4990
|
+
return listItems4(data);
|
|
4991
|
+
}
|
|
4992
|
+
async getBuild(deploymentId, buildId) {
|
|
4993
|
+
const data = await this.http.get(
|
|
4994
|
+
`/deployments/${deploymentId}/builds/${buildId}`
|
|
4995
|
+
);
|
|
4996
|
+
return unwrap27(data);
|
|
4997
|
+
}
|
|
4998
|
+
async listEnv(deploymentId) {
|
|
4999
|
+
const data = await this.http.get(
|
|
5000
|
+
`/deployments/${deploymentId}/env`
|
|
5001
|
+
);
|
|
5002
|
+
return listItems4(data);
|
|
5003
|
+
}
|
|
5004
|
+
async setEnv(deploymentId, vars, opts = {}) {
|
|
5005
|
+
const body4 = stripUndefined13({ env: vars, environment: opts.environment });
|
|
5006
|
+
const data = await this.http.post(
|
|
5007
|
+
`/deployments/${deploymentId}/env`,
|
|
5008
|
+
body4
|
|
5009
|
+
);
|
|
5010
|
+
return listItems4(data);
|
|
5011
|
+
}
|
|
5012
|
+
versions(deploymentId) {
|
|
5013
|
+
return new DeploymentVersions(this.http, deploymentId);
|
|
5014
|
+
}
|
|
5015
|
+
releases(deploymentId) {
|
|
5016
|
+
return new DeploymentReleases(this.http, deploymentId);
|
|
5017
|
+
}
|
|
5018
|
+
runtimeInstances(deploymentId) {
|
|
5019
|
+
return new DeploymentRuntimeInstances(this.http, deploymentId);
|
|
5020
|
+
}
|
|
5021
|
+
runtime_instances(deploymentId) {
|
|
5022
|
+
return this.runtimeInstances(deploymentId);
|
|
5023
|
+
}
|
|
5024
|
+
domains(deploymentId) {
|
|
5025
|
+
return new DeploymentDomains(this.http, deploymentId);
|
|
5026
|
+
}
|
|
5027
|
+
connectors(deploymentId) {
|
|
5028
|
+
return new DeploymentConnectors(this.http, deploymentId);
|
|
5029
|
+
}
|
|
5030
|
+
};
|
|
5031
|
+
|
|
5032
|
+
// src/resources/devices.ts
|
|
5033
|
+
var RUNTIME_BINARIES = {
|
|
5034
|
+
"claude-code": ["claude-code", "claude"],
|
|
5035
|
+
claude: ["claude"],
|
|
5036
|
+
codex: ["codex"],
|
|
5037
|
+
hermes: ["hermes"],
|
|
5038
|
+
osa: ["osa"],
|
|
5039
|
+
pi: ["pi"],
|
|
5040
|
+
custom: []
|
|
5041
|
+
};
|
|
5042
|
+
function unwrap28(payload, keys = ["data"]) {
|
|
5043
|
+
if (payload && typeof payload === "object") {
|
|
5044
|
+
const p = payload;
|
|
5045
|
+
for (const key of keys) {
|
|
5046
|
+
if (key in p) return p[key];
|
|
5047
|
+
}
|
|
5048
|
+
}
|
|
5049
|
+
return payload;
|
|
5050
|
+
}
|
|
5051
|
+
function unwrapList12(payload) {
|
|
5052
|
+
if (Array.isArray(payload)) return payload;
|
|
5053
|
+
if (payload && typeof payload === "object") {
|
|
5054
|
+
const p = payload;
|
|
5055
|
+
for (const key of ["data", "devices", "items", "entries"]) {
|
|
5056
|
+
if (Array.isArray(p[key])) return p[key];
|
|
5057
|
+
}
|
|
5058
|
+
}
|
|
5059
|
+
return [];
|
|
5060
|
+
}
|
|
5061
|
+
function stripUndefined14(input) {
|
|
5062
|
+
return Object.fromEntries(
|
|
5063
|
+
Object.entries(input).filter(([, value]) => value !== void 0)
|
|
5064
|
+
);
|
|
5065
|
+
}
|
|
5066
|
+
function pickFirst5(...values) {
|
|
5067
|
+
for (const value of values) if (value !== void 0) return value;
|
|
5068
|
+
return void 0;
|
|
5069
|
+
}
|
|
5070
|
+
function queryFromListParams2(params = {}) {
|
|
5071
|
+
return stripUndefined14({
|
|
5072
|
+
kind: pickFirst5(params.kind, params.type),
|
|
5073
|
+
workspace_id: pickFirst5(params.workspaceId, params.workspace_id),
|
|
5074
|
+
project_id: pickFirst5(params.projectId, params.project_id)
|
|
5075
|
+
});
|
|
5076
|
+
}
|
|
5077
|
+
function queryFromFileParams(params = {}) {
|
|
5078
|
+
return stripUndefined14({
|
|
5079
|
+
path: params.path
|
|
5080
|
+
});
|
|
5081
|
+
}
|
|
5082
|
+
function devicePath(id) {
|
|
5083
|
+
return encodeURIComponent(id);
|
|
5084
|
+
}
|
|
5085
|
+
var Devices = class {
|
|
5086
|
+
constructor(http) {
|
|
5087
|
+
this.http = http;
|
|
5088
|
+
}
|
|
5089
|
+
http;
|
|
5090
|
+
/** List unified MIOSA devices: sandbox workers and desktop computers. */
|
|
5091
|
+
async list(params = {}) {
|
|
5092
|
+
const data = await this.http.get(
|
|
5093
|
+
"/devices",
|
|
5094
|
+
queryFromListParams2(params)
|
|
5095
|
+
);
|
|
5096
|
+
return unwrapList12(data);
|
|
5097
|
+
}
|
|
5098
|
+
/** Show one unified device by id. */
|
|
5099
|
+
async get(id) {
|
|
5100
|
+
const data = await this.http.get(`/devices/${devicePath(id)}`);
|
|
5101
|
+
return unwrap28(data);
|
|
5102
|
+
}
|
|
5103
|
+
show(id) {
|
|
5104
|
+
return this.get(id);
|
|
4445
5105
|
}
|
|
4446
|
-
/**
|
|
4447
|
-
|
|
4448
|
-
|
|
4449
|
-
|
|
4450
|
-
*/
|
|
4451
|
-
async publishFromSandbox(sandboxId, params = {}) {
|
|
4452
|
-
const body4 = stripUndefined12({
|
|
4453
|
-
name: params.name,
|
|
4454
|
-
deployment_id: params.deploymentId ?? params.deployment_id,
|
|
4455
|
-
output_path: params.outputPath ?? params.output_path,
|
|
4456
|
-
source_snapshot_path: params.sourceSnapshotPath ?? params.source_snapshot_path,
|
|
4457
|
-
entrypoint: params.entrypoint,
|
|
4458
|
-
domain: params.domain,
|
|
4459
|
-
custom_domain: params.customDomain ?? params.custom_domain
|
|
4460
|
-
});
|
|
4461
|
-
const data = await this.http.request(
|
|
4462
|
-
`/sandboxes/${sandboxId}/deploy`,
|
|
4463
|
-
{
|
|
4464
|
-
method: "POST",
|
|
4465
|
-
body: body4,
|
|
4466
|
-
headers: { "Idempotency-Key": idempotencyKey4(params.idempotencyKey) }
|
|
4467
|
-
}
|
|
5106
|
+
/** Discover the operations this device supports. */
|
|
5107
|
+
async capabilities(id) {
|
|
5108
|
+
const data = await this.http.get(
|
|
5109
|
+
`/devices/${devicePath(id)}/capabilities`
|
|
4468
5110
|
);
|
|
4469
|
-
return
|
|
5111
|
+
return unwrap28(data);
|
|
4470
5112
|
}
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
|
|
4474
|
-
|
|
4475
|
-
|
|
4476
|
-
|
|
4477
|
-
|
|
4478
|
-
|
|
4479
|
-
|
|
4480
|
-
|
|
4481
|
-
}
|
|
5113
|
+
/** Execute a command inside the device. */
|
|
5114
|
+
async exec(id, params) {
|
|
5115
|
+
const data = await this.http.post(
|
|
5116
|
+
`/devices/${devicePath(id)}/exec`,
|
|
5117
|
+
stripUndefined14({
|
|
5118
|
+
command: params.command,
|
|
5119
|
+
timeout_ms: pickFirst5(params.timeoutMs, params.timeout_ms),
|
|
5120
|
+
cwd: params.cwd,
|
|
5121
|
+
env: params.env
|
|
5122
|
+
})
|
|
4482
5123
|
);
|
|
4483
|
-
return
|
|
5124
|
+
return unwrap28(data);
|
|
4484
5125
|
}
|
|
4485
|
-
|
|
5126
|
+
/** List files inside the device filesystem. */
|
|
5127
|
+
async listFiles(id, params = {}) {
|
|
4486
5128
|
const data = await this.http.get(
|
|
4487
|
-
`/
|
|
5129
|
+
`/devices/${devicePath(id)}/files`,
|
|
5130
|
+
queryFromFileParams(params)
|
|
4488
5131
|
);
|
|
4489
|
-
return
|
|
5132
|
+
return unwrapList12(data);
|
|
4490
5133
|
}
|
|
4491
|
-
|
|
5134
|
+
/** Read a file. Content is returned base64-encoded by the API. */
|
|
5135
|
+
async readFile(id, params) {
|
|
4492
5136
|
const data = await this.http.get(
|
|
4493
|
-
`/
|
|
5137
|
+
`/devices/${devicePath(id)}/files/read`,
|
|
5138
|
+
queryFromFileParams(params)
|
|
4494
5139
|
);
|
|
4495
|
-
return
|
|
5140
|
+
return unwrap28(data);
|
|
4496
5141
|
}
|
|
4497
|
-
|
|
4498
|
-
|
|
4499
|
-
|
|
5142
|
+
/** Write a text or base64 payload into the device filesystem. */
|
|
5143
|
+
async writeFile(id, params) {
|
|
5144
|
+
const data = await this.http.post(
|
|
5145
|
+
`/devices/${devicePath(id)}/files/write`,
|
|
5146
|
+
stripUndefined14({
|
|
5147
|
+
path: params.path,
|
|
5148
|
+
content: params.content,
|
|
5149
|
+
content_base64: pickFirst5(params.contentBase64, params.content_base64)
|
|
5150
|
+
})
|
|
4500
5151
|
);
|
|
4501
|
-
return
|
|
5152
|
+
return unwrap28(data);
|
|
4502
5153
|
}
|
|
4503
|
-
|
|
4504
|
-
|
|
5154
|
+
/** Expose a device port through MIOSA routing. */
|
|
5155
|
+
async expose(id, params) {
|
|
4505
5156
|
const data = await this.http.post(
|
|
4506
|
-
`/
|
|
4507
|
-
|
|
5157
|
+
`/devices/${devicePath(id)}/expose`,
|
|
5158
|
+
{ port: params.port }
|
|
4508
5159
|
);
|
|
4509
|
-
return
|
|
5160
|
+
return unwrap28(data);
|
|
4510
5161
|
}
|
|
4511
|
-
|
|
4512
|
-
|
|
5162
|
+
/** Return browser/desktop connection details for a computer-backed device. */
|
|
5163
|
+
async browser(id) {
|
|
5164
|
+
const data = await this.http.get(`/devices/${devicePath(id)}/browser`);
|
|
5165
|
+
return unwrap28(data);
|
|
4513
5166
|
}
|
|
4514
|
-
|
|
4515
|
-
|
|
5167
|
+
async pause(id) {
|
|
5168
|
+
const data = await this.http.post(
|
|
5169
|
+
`/devices/${devicePath(id)}/pause`,
|
|
5170
|
+
{}
|
|
5171
|
+
);
|
|
5172
|
+
return unwrap28(data);
|
|
4516
5173
|
}
|
|
4517
|
-
|
|
4518
|
-
|
|
5174
|
+
async stop(id) {
|
|
5175
|
+
const data = await this.http.post(
|
|
5176
|
+
`/devices/${devicePath(id)}/stop`,
|
|
5177
|
+
{}
|
|
5178
|
+
);
|
|
5179
|
+
return unwrap28(data);
|
|
4519
5180
|
}
|
|
4520
|
-
|
|
4521
|
-
|
|
5181
|
+
async resume(id) {
|
|
5182
|
+
const data = await this.http.post(
|
|
5183
|
+
`/devices/${devicePath(id)}/resume`,
|
|
5184
|
+
{}
|
|
5185
|
+
);
|
|
5186
|
+
return unwrap28(data);
|
|
4522
5187
|
}
|
|
4523
|
-
|
|
4524
|
-
|
|
5188
|
+
async extend(id, params) {
|
|
5189
|
+
const data = await this.http.post(
|
|
5190
|
+
`/devices/${devicePath(id)}/extend`,
|
|
5191
|
+
{ timeout_sec: pickFirst5(params.timeoutSec, params.timeout_sec) }
|
|
5192
|
+
);
|
|
5193
|
+
return unwrap28(data);
|
|
5194
|
+
}
|
|
5195
|
+
async destroy(id) {
|
|
5196
|
+
const data = await this.http.delete(`/devices/${devicePath(id)}`);
|
|
5197
|
+
return unwrap28(data);
|
|
5198
|
+
}
|
|
5199
|
+
/**
|
|
5200
|
+
* Write a MIOSA runtime bootstrap manifest and optionally install/probe
|
|
5201
|
+
* an agent runtime inside the device.
|
|
5202
|
+
*/
|
|
5203
|
+
async bootstrap(id, params) {
|
|
5204
|
+
const runtime = params.runtime.trim().toLowerCase();
|
|
5205
|
+
const cwd = params.cwd ?? "/workspace";
|
|
5206
|
+
const manifestPath = `${cwd.replace(/\/$/, "")}/.miosa/runtime-bootstrap.json`;
|
|
5207
|
+
const steps = [];
|
|
5208
|
+
const manifest = {
|
|
5209
|
+
version: 1,
|
|
5210
|
+
runtime,
|
|
5211
|
+
cwd,
|
|
5212
|
+
expected_binaries: RUNTIME_BINARIES[runtime] ?? [],
|
|
5213
|
+
connectors: params.connectors ?? [],
|
|
5214
|
+
env: params.env ?? {},
|
|
5215
|
+
mcp: params.mcp ?? [],
|
|
5216
|
+
created_by: "@miosa/sdk"
|
|
5217
|
+
};
|
|
5218
|
+
await this.recordStep(
|
|
5219
|
+
steps,
|
|
5220
|
+
"write_manifest",
|
|
5221
|
+
() => this.writeFile(id, {
|
|
5222
|
+
path: manifestPath,
|
|
5223
|
+
content: `${JSON.stringify(manifest, null, 2)}
|
|
5224
|
+
`
|
|
5225
|
+
})
|
|
5226
|
+
);
|
|
5227
|
+
const installCommand = pickFirst5(params.installCommand, params.install_command);
|
|
5228
|
+
if (installCommand) {
|
|
5229
|
+
await this.recordStep(
|
|
5230
|
+
steps,
|
|
5231
|
+
"install",
|
|
5232
|
+
() => this.exec(id, {
|
|
5233
|
+
command: installCommand,
|
|
5234
|
+
cwd,
|
|
5235
|
+
timeoutMs: 6e5
|
|
5236
|
+
})
|
|
5237
|
+
);
|
|
5238
|
+
}
|
|
5239
|
+
if (!(params.skipProbe ?? params.skip_probe)) {
|
|
5240
|
+
await this.recordStep(
|
|
5241
|
+
steps,
|
|
5242
|
+
"probe",
|
|
5243
|
+
() => this.exec(id, {
|
|
5244
|
+
command: runtimeProbeCommand(runtime),
|
|
5245
|
+
cwd,
|
|
5246
|
+
timeoutMs: 6e4
|
|
5247
|
+
})
|
|
5248
|
+
);
|
|
5249
|
+
}
|
|
5250
|
+
return {
|
|
5251
|
+
device_id: id,
|
|
5252
|
+
ok: steps.every((step) => step.ok),
|
|
5253
|
+
runtime,
|
|
5254
|
+
manifest_path: manifestPath,
|
|
5255
|
+
steps
|
|
5256
|
+
};
|
|
5257
|
+
}
|
|
5258
|
+
async recordStep(steps, name, fn) {
|
|
5259
|
+
try {
|
|
5260
|
+
steps.push({ name, ok: true, detail: await fn() });
|
|
5261
|
+
} catch (error) {
|
|
5262
|
+
steps.push({
|
|
5263
|
+
name,
|
|
5264
|
+
ok: false,
|
|
5265
|
+
error: error instanceof Error ? error.message : String(error)
|
|
5266
|
+
});
|
|
5267
|
+
}
|
|
4525
5268
|
}
|
|
4526
5269
|
};
|
|
5270
|
+
function runtimeProbeCommand(runtime) {
|
|
5271
|
+
const binaries = RUNTIME_BINARIES[runtime] ?? [];
|
|
5272
|
+
if (binaries.length === 0) return "printf 'custom runtime manifest written\\n'";
|
|
5273
|
+
const checks = binaries.map((binary) => `command -v ${shellWord(binary)} >/dev/null 2>&1`).join(" || ");
|
|
5274
|
+
const display = binaries.join(" or ");
|
|
5275
|
+
return `${checks} && printf 'runtime available: ${display}\\n' || { printf 'runtime missing: ${display}\\n' >&2; exit 127; }`;
|
|
5276
|
+
}
|
|
5277
|
+
function shellWord(value) {
|
|
5278
|
+
if (/^[A-Za-z0-9_./:-]+$/.test(value)) return value;
|
|
5279
|
+
return `'${value.replaceAll("'", `'"'"'`)}'`;
|
|
5280
|
+
}
|
|
4527
5281
|
|
|
4528
5282
|
// src/resources/docker-deploy.ts
|
|
4529
5283
|
function workspaceId(params) {
|
|
@@ -4610,7 +5364,7 @@ var DockerDeploy = class {
|
|
|
4610
5364
|
};
|
|
4611
5365
|
|
|
4612
5366
|
// src/resources/email.ts
|
|
4613
|
-
function
|
|
5367
|
+
function unwrap29(data) {
|
|
4614
5368
|
if (data && typeof data === "object") {
|
|
4615
5369
|
const d = data;
|
|
4616
5370
|
for (const k of [
|
|
@@ -4626,7 +5380,7 @@ function unwrap27(data) {
|
|
|
4626
5380
|
}
|
|
4627
5381
|
return data;
|
|
4628
5382
|
}
|
|
4629
|
-
function
|
|
5383
|
+
function unwrapList13(data) {
|
|
4630
5384
|
if (Array.isArray(data)) return data;
|
|
4631
5385
|
if (data && typeof data === "object") {
|
|
4632
5386
|
const d = data;
|
|
@@ -4654,7 +5408,7 @@ var EmailCampaigns = class {
|
|
|
4654
5408
|
}
|
|
4655
5409
|
http;
|
|
4656
5410
|
async list(filters = {}) {
|
|
4657
|
-
return
|
|
5411
|
+
return unwrapList13(
|
|
4658
5412
|
await this.http.get(
|
|
4659
5413
|
"/admin/email-campaigns",
|
|
4660
5414
|
filters
|
|
@@ -4662,12 +5416,12 @@ var EmailCampaigns = class {
|
|
|
4662
5416
|
);
|
|
4663
5417
|
}
|
|
4664
5418
|
async create(attrs) {
|
|
4665
|
-
return
|
|
5419
|
+
return unwrap29(
|
|
4666
5420
|
await this.http.post("/admin/email-campaigns", strip(attrs))
|
|
4667
5421
|
);
|
|
4668
5422
|
}
|
|
4669
5423
|
async recipientCount(filters = {}) {
|
|
4670
|
-
return
|
|
5424
|
+
return unwrap29(
|
|
4671
5425
|
await this.http.get(
|
|
4672
5426
|
"/admin/email-campaigns/recipient-count",
|
|
4673
5427
|
filters
|
|
@@ -4675,7 +5429,7 @@ var EmailCampaigns = class {
|
|
|
4675
5429
|
);
|
|
4676
5430
|
}
|
|
4677
5431
|
async send(campaignId, opts = {}) {
|
|
4678
|
-
return
|
|
5432
|
+
return unwrap29(
|
|
4679
5433
|
await this.http.post(
|
|
4680
5434
|
`/admin/email-campaigns/${campaignId}/send`,
|
|
4681
5435
|
strip(opts)
|
|
@@ -4683,14 +5437,14 @@ var EmailCampaigns = class {
|
|
|
4683
5437
|
);
|
|
4684
5438
|
}
|
|
4685
5439
|
async cancel(campaignId) {
|
|
4686
|
-
return
|
|
5440
|
+
return unwrap29(
|
|
4687
5441
|
await this.http.post(
|
|
4688
5442
|
`/admin/email-campaigns/${campaignId}/cancel`
|
|
4689
5443
|
)
|
|
4690
5444
|
);
|
|
4691
5445
|
}
|
|
4692
5446
|
async deliveries(campaignId, filters = {}) {
|
|
4693
|
-
return
|
|
5447
|
+
return unwrapList13(
|
|
4694
5448
|
await this.http.get(
|
|
4695
5449
|
`/admin/email-campaigns/${campaignId}/deliveries`,
|
|
4696
5450
|
filters
|
|
@@ -4704,12 +5458,12 @@ var EmailTemplates = class {
|
|
|
4704
5458
|
}
|
|
4705
5459
|
http;
|
|
4706
5460
|
async list(filters = {}) {
|
|
4707
|
-
return
|
|
5461
|
+
return unwrapList13(
|
|
4708
5462
|
await this.http.get("/admin/email-templates", filters)
|
|
4709
5463
|
);
|
|
4710
5464
|
}
|
|
4711
5465
|
async create(key, attrs = {}) {
|
|
4712
|
-
return
|
|
5466
|
+
return unwrap29(
|
|
4713
5467
|
await this.http.post("/admin/email-templates", {
|
|
4714
5468
|
key,
|
|
4715
5469
|
...strip(attrs)
|
|
@@ -4717,7 +5471,7 @@ var EmailTemplates = class {
|
|
|
4717
5471
|
);
|
|
4718
5472
|
}
|
|
4719
5473
|
async update(key, attrs) {
|
|
4720
|
-
return
|
|
5474
|
+
return unwrap29(
|
|
4721
5475
|
await this.http.put(
|
|
4722
5476
|
`/admin/email-templates/${key}`,
|
|
4723
5477
|
strip(attrs)
|
|
@@ -4725,7 +5479,7 @@ var EmailTemplates = class {
|
|
|
4725
5479
|
);
|
|
4726
5480
|
}
|
|
4727
5481
|
async reset(key) {
|
|
4728
|
-
return
|
|
5482
|
+
return unwrap29(
|
|
4729
5483
|
await this.http.post(`/admin/email-templates/${key}/reset`)
|
|
4730
5484
|
);
|
|
4731
5485
|
}
|
|
@@ -4736,22 +5490,22 @@ var EmailInbox = class {
|
|
|
4736
5490
|
}
|
|
4737
5491
|
http;
|
|
4738
5492
|
async list(filters = {}) {
|
|
4739
|
-
return
|
|
5493
|
+
return unwrapList13(
|
|
4740
5494
|
await this.http.get("/admin/email-inbox", filters)
|
|
4741
5495
|
);
|
|
4742
5496
|
}
|
|
4743
5497
|
async send(attrs) {
|
|
4744
|
-
return
|
|
5498
|
+
return unwrap29(
|
|
4745
5499
|
await this.http.post("/admin/email-inbox/send", strip(attrs))
|
|
4746
5500
|
);
|
|
4747
5501
|
}
|
|
4748
5502
|
async markRead(messageId) {
|
|
4749
|
-
return
|
|
5503
|
+
return unwrap29(
|
|
4750
5504
|
await this.http.post(`/admin/email-inbox/${messageId}/read`)
|
|
4751
5505
|
);
|
|
4752
5506
|
}
|
|
4753
5507
|
async archive(messageId) {
|
|
4754
|
-
return
|
|
5508
|
+
return unwrap29(
|
|
4755
5509
|
await this.http.post(`/admin/email-inbox/${messageId}/archive`)
|
|
4756
5510
|
);
|
|
4757
5511
|
}
|
|
@@ -4791,7 +5545,7 @@ var Embeddings = class {
|
|
|
4791
5545
|
};
|
|
4792
5546
|
|
|
4793
5547
|
// src/resources/external-keys.ts
|
|
4794
|
-
function
|
|
5548
|
+
function unwrap30(payload) {
|
|
4795
5549
|
if (payload && typeof payload === "object") {
|
|
4796
5550
|
const p = payload;
|
|
4797
5551
|
for (const k of ["data", "external_keys", "items"]) {
|
|
@@ -4800,7 +5554,7 @@ function unwrap28(payload) {
|
|
|
4800
5554
|
}
|
|
4801
5555
|
return payload;
|
|
4802
5556
|
}
|
|
4803
|
-
function
|
|
5557
|
+
function stripUndefined15(input) {
|
|
4804
5558
|
return Object.fromEntries(
|
|
4805
5559
|
Object.entries(input).filter(([, v]) => v !== void 0)
|
|
4806
5560
|
);
|
|
@@ -4813,22 +5567,22 @@ var ExternalKeys = class {
|
|
|
4813
5567
|
/** List configured external keys. */
|
|
4814
5568
|
async list() {
|
|
4815
5569
|
const data = await this.http.get("/external-keys");
|
|
4816
|
-
const result =
|
|
5570
|
+
const result = unwrap30(data);
|
|
4817
5571
|
if (Array.isArray(result)) return result;
|
|
4818
5572
|
return [];
|
|
4819
5573
|
}
|
|
4820
5574
|
/** Create / register an external provider key. */
|
|
4821
5575
|
async create(params) {
|
|
4822
|
-
const body4 =
|
|
5576
|
+
const body4 = stripUndefined15(params);
|
|
4823
5577
|
const data = await this.http.post("/external-keys", body4);
|
|
4824
|
-
return
|
|
5578
|
+
return unwrap30(data);
|
|
4825
5579
|
}
|
|
4826
5580
|
/** Resolve (preview) the stored key for a provider. */
|
|
4827
5581
|
async resolve(provider) {
|
|
4828
5582
|
const data = await this.http.get(
|
|
4829
5583
|
`/external-keys/${provider}/resolve`
|
|
4830
5584
|
);
|
|
4831
|
-
return
|
|
5585
|
+
return unwrap30(data);
|
|
4832
5586
|
}
|
|
4833
5587
|
/**
|
|
4834
5588
|
* Delete the stored key for a provider.
|
|
@@ -4838,7 +5592,7 @@ var ExternalKeys = class {
|
|
|
4838
5592
|
await this.http.delete(`/external-keys/${provider}`);
|
|
4839
5593
|
}
|
|
4840
5594
|
};
|
|
4841
|
-
function
|
|
5595
|
+
function unwrap31(payload) {
|
|
4842
5596
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
4843
5597
|
return payload.data;
|
|
4844
5598
|
}
|
|
@@ -4854,7 +5608,7 @@ function listItems5(payload, candidateKeys = ["data", "domains", "items"]) {
|
|
|
4854
5608
|
}
|
|
4855
5609
|
return [];
|
|
4856
5610
|
}
|
|
4857
|
-
function
|
|
5611
|
+
function stripUndefined16(input) {
|
|
4858
5612
|
return Object.fromEntries(
|
|
4859
5613
|
Object.entries(input).filter(([, v]) => v !== void 0)
|
|
4860
5614
|
);
|
|
@@ -4868,7 +5622,7 @@ var FlatCustomDomains = class {
|
|
|
4868
5622
|
}
|
|
4869
5623
|
http;
|
|
4870
5624
|
async list(params = {}) {
|
|
4871
|
-
const query2 =
|
|
5625
|
+
const query2 = stripUndefined16({ ...params });
|
|
4872
5626
|
const data = await this.http.get("/custom-domains", query2);
|
|
4873
5627
|
return listItems5(data);
|
|
4874
5628
|
}
|
|
@@ -4880,7 +5634,7 @@ var FlatCustomDomains = class {
|
|
|
4880
5634
|
redirectPolicy,
|
|
4881
5635
|
...rest
|
|
4882
5636
|
} = params;
|
|
4883
|
-
const body4 =
|
|
5637
|
+
const body4 = stripUndefined16({
|
|
4884
5638
|
...rest,
|
|
4885
5639
|
resource_type: resourceType ?? rest.resource_type,
|
|
4886
5640
|
resource_id: resourceId ?? rest.resource_id,
|
|
@@ -4891,13 +5645,13 @@ var FlatCustomDomains = class {
|
|
|
4891
5645
|
body: body4,
|
|
4892
5646
|
headers: { "Idempotency-Key": idempotencyKey5(ikey) }
|
|
4893
5647
|
});
|
|
4894
|
-
return
|
|
5648
|
+
return unwrap31(data);
|
|
4895
5649
|
}
|
|
4896
5650
|
async delete(domainId) {
|
|
4897
5651
|
await this.http.delete(`/custom-domains/${domainId}`);
|
|
4898
5652
|
}
|
|
4899
5653
|
};
|
|
4900
|
-
function
|
|
5654
|
+
function unwrap32(payload) {
|
|
4901
5655
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
4902
5656
|
return payload.data;
|
|
4903
5657
|
}
|
|
@@ -4913,7 +5667,7 @@ function listItems6(payload, candidateKeys = ["data", "functions", "items"]) {
|
|
|
4913
5667
|
}
|
|
4914
5668
|
return [];
|
|
4915
5669
|
}
|
|
4916
|
-
function
|
|
5670
|
+
function stripUndefined17(input) {
|
|
4917
5671
|
return Object.fromEntries(
|
|
4918
5672
|
Object.entries(input).filter(([, v]) => v !== void 0)
|
|
4919
5673
|
);
|
|
@@ -4927,17 +5681,17 @@ var Functions = class {
|
|
|
4927
5681
|
}
|
|
4928
5682
|
http;
|
|
4929
5683
|
async list(params = {}) {
|
|
4930
|
-
const query2 =
|
|
5684
|
+
const query2 = stripUndefined17({ ...params });
|
|
4931
5685
|
const data = await this.http.get("/functions", query2);
|
|
4932
5686
|
return listItems6(data);
|
|
4933
5687
|
}
|
|
4934
5688
|
async get(functionId) {
|
|
4935
5689
|
const data = await this.http.get(`/functions/${functionId}`);
|
|
4936
|
-
return
|
|
5690
|
+
return unwrap32(data);
|
|
4937
5691
|
}
|
|
4938
5692
|
async create(params) {
|
|
4939
5693
|
const { idempotencyKey: ikey, memoryMb, timeoutSec, ...rest } = params;
|
|
4940
|
-
const body4 =
|
|
5694
|
+
const body4 = stripUndefined17({
|
|
4941
5695
|
...rest,
|
|
4942
5696
|
memory_mb: memoryMb ?? rest.memory_mb,
|
|
4943
5697
|
timeout_sec: timeoutSec ?? rest.timeout_sec
|
|
@@ -4947,11 +5701,11 @@ var Functions = class {
|
|
|
4947
5701
|
body: body4,
|
|
4948
5702
|
headers: { "Idempotency-Key": idempotencyKey6(ikey) }
|
|
4949
5703
|
});
|
|
4950
|
-
return
|
|
5704
|
+
return unwrap32(data);
|
|
4951
5705
|
}
|
|
4952
5706
|
async update(functionId, params) {
|
|
4953
5707
|
const { memoryMb, timeoutSec, ...rest } = params;
|
|
4954
|
-
const body4 =
|
|
5708
|
+
const body4 = stripUndefined17({
|
|
4955
5709
|
...rest,
|
|
4956
5710
|
memory_mb: memoryMb ?? rest.memory_mb,
|
|
4957
5711
|
timeout_sec: timeoutSec ?? rest.timeout_sec
|
|
@@ -4960,7 +5714,7 @@ var Functions = class {
|
|
|
4960
5714
|
`/functions/${functionId}`,
|
|
4961
5715
|
body4
|
|
4962
5716
|
);
|
|
4963
|
-
return
|
|
5717
|
+
return unwrap32(data);
|
|
4964
5718
|
}
|
|
4965
5719
|
async delete(functionId) {
|
|
4966
5720
|
await this.http.delete(`/functions/${functionId}`);
|
|
@@ -4981,7 +5735,7 @@ var Functions = class {
|
|
|
4981
5735
|
return data ?? {};
|
|
4982
5736
|
}
|
|
4983
5737
|
};
|
|
4984
|
-
function
|
|
5738
|
+
function unwrap33(payload) {
|
|
4985
5739
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
4986
5740
|
return payload.data;
|
|
4987
5741
|
}
|
|
@@ -4997,7 +5751,7 @@ function listItems7(payload, candidateKeys = ["data", "health_checks", "items"])
|
|
|
4997
5751
|
}
|
|
4998
5752
|
return [];
|
|
4999
5753
|
}
|
|
5000
|
-
function
|
|
5754
|
+
function stripUndefined18(input) {
|
|
5001
5755
|
return Object.fromEntries(
|
|
5002
5756
|
Object.entries(input).filter(([, v]) => v !== void 0)
|
|
5003
5757
|
);
|
|
@@ -5011,13 +5765,13 @@ var HealthChecks = class {
|
|
|
5011
5765
|
}
|
|
5012
5766
|
http;
|
|
5013
5767
|
async list(params = {}) {
|
|
5014
|
-
const query2 =
|
|
5768
|
+
const query2 = stripUndefined18({ ...params });
|
|
5015
5769
|
const data = await this.http.get("/health-checks", query2);
|
|
5016
5770
|
return listItems7(data);
|
|
5017
5771
|
}
|
|
5018
5772
|
async get(checkId) {
|
|
5019
5773
|
const data = await this.http.get(`/health-checks/${checkId}`);
|
|
5020
|
-
return
|
|
5774
|
+
return unwrap33(data);
|
|
5021
5775
|
}
|
|
5022
5776
|
async create(params) {
|
|
5023
5777
|
const {
|
|
@@ -5027,7 +5781,7 @@ var HealthChecks = class {
|
|
|
5027
5781
|
expectedStatus,
|
|
5028
5782
|
...rest
|
|
5029
5783
|
} = params;
|
|
5030
|
-
const body4 =
|
|
5784
|
+
const body4 = stripUndefined18({
|
|
5031
5785
|
...rest,
|
|
5032
5786
|
interval_sec: intervalSec ?? rest.interval_sec,
|
|
5033
5787
|
timeout_sec: timeoutSec ?? rest.timeout_sec,
|
|
@@ -5038,11 +5792,11 @@ var HealthChecks = class {
|
|
|
5038
5792
|
body: body4,
|
|
5039
5793
|
headers: { "Idempotency-Key": idempotencyKey7(ikey) }
|
|
5040
5794
|
});
|
|
5041
|
-
return
|
|
5795
|
+
return unwrap33(data);
|
|
5042
5796
|
}
|
|
5043
5797
|
async update(checkId, params) {
|
|
5044
5798
|
const { intervalSec, timeoutSec, expectedStatus, ...rest } = params;
|
|
5045
|
-
const body4 =
|
|
5799
|
+
const body4 = stripUndefined18({
|
|
5046
5800
|
...rest,
|
|
5047
5801
|
interval_sec: intervalSec ?? rest.interval_sec,
|
|
5048
5802
|
timeout_sec: timeoutSec ?? rest.timeout_sec,
|
|
@@ -5052,7 +5806,7 @@ var HealthChecks = class {
|
|
|
5052
5806
|
`/health-checks/${checkId}`,
|
|
5053
5807
|
body4
|
|
5054
5808
|
);
|
|
5055
|
-
return
|
|
5809
|
+
return unwrap33(data);
|
|
5056
5810
|
}
|
|
5057
5811
|
async delete(checkId) {
|
|
5058
5812
|
await this.http.delete(`/health-checks/${checkId}`);
|
|
@@ -5060,7 +5814,7 @@ var HealthChecks = class {
|
|
|
5060
5814
|
};
|
|
5061
5815
|
|
|
5062
5816
|
// src/resources/integrations.ts
|
|
5063
|
-
function
|
|
5817
|
+
function unwrap34(payload) {
|
|
5064
5818
|
if (payload && typeof payload === "object") {
|
|
5065
5819
|
const p = payload;
|
|
5066
5820
|
for (const k of ["data", "integrations", "catalog", "items"]) {
|
|
@@ -5070,11 +5824,11 @@ function unwrap32(payload) {
|
|
|
5070
5824
|
return payload;
|
|
5071
5825
|
}
|
|
5072
5826
|
function listItems8(payload) {
|
|
5073
|
-
const result =
|
|
5827
|
+
const result = unwrap34(payload);
|
|
5074
5828
|
if (Array.isArray(result)) return result;
|
|
5075
5829
|
return [];
|
|
5076
5830
|
}
|
|
5077
|
-
function
|
|
5831
|
+
function stripUndefined19(input) {
|
|
5078
5832
|
return Object.fromEntries(
|
|
5079
5833
|
Object.entries(input).filter(([, v]) => v !== void 0)
|
|
5080
5834
|
);
|
|
@@ -5099,14 +5853,14 @@ var Integrations = class {
|
|
|
5099
5853
|
const data = await this.http.get(
|
|
5100
5854
|
`/integrations/${provider}/start`
|
|
5101
5855
|
);
|
|
5102
|
-
return
|
|
5856
|
+
return unwrap34(data);
|
|
5103
5857
|
}
|
|
5104
5858
|
/** Force-refresh the access token for a provider. */
|
|
5105
5859
|
async refresh(provider) {
|
|
5106
5860
|
const data = await this.http.post(
|
|
5107
5861
|
`/integrations/${provider}/refresh`
|
|
5108
5862
|
);
|
|
5109
|
-
return
|
|
5863
|
+
return unwrap34(data);
|
|
5110
5864
|
}
|
|
5111
5865
|
/** Disconnect (revoke) an integration. */
|
|
5112
5866
|
async disconnect(provider) {
|
|
@@ -5126,41 +5880,41 @@ var Integrations = class {
|
|
|
5126
5880
|
// ── Test hooks ─────────────────────────────────────────────────────────────
|
|
5127
5881
|
/** Send a test message to the connected Slack channel. */
|
|
5128
5882
|
async slackSendTest(params = {}) {
|
|
5129
|
-
const body4 =
|
|
5883
|
+
const body4 = stripUndefined19(params);
|
|
5130
5884
|
const data = await this.http.post(
|
|
5131
5885
|
"/integrations/slack/send-test",
|
|
5132
5886
|
body4
|
|
5133
5887
|
);
|
|
5134
|
-
return
|
|
5888
|
+
return unwrap34(data);
|
|
5135
5889
|
}
|
|
5136
5890
|
/** Send a test message to the connected Discord channel. */
|
|
5137
5891
|
async discordSendTest(params = {}) {
|
|
5138
|
-
const body4 =
|
|
5892
|
+
const body4 = stripUndefined19(params);
|
|
5139
5893
|
const data = await this.http.post(
|
|
5140
5894
|
"/integrations/discord/send-test",
|
|
5141
5895
|
body4
|
|
5142
5896
|
);
|
|
5143
|
-
return
|
|
5897
|
+
return unwrap34(data);
|
|
5144
5898
|
}
|
|
5145
5899
|
// ── Linear dedicated controller ────────────────────────────────────────────
|
|
5146
5900
|
/** Begin Linear OAuth — Linear has provider-specific error shapes. */
|
|
5147
5901
|
async linearStart() {
|
|
5148
5902
|
const data = await this.http.get("/integrations/linear/start");
|
|
5149
|
-
return
|
|
5903
|
+
return unwrap34(data);
|
|
5150
5904
|
}
|
|
5151
5905
|
/** Create a Linear issue via the connected workspace. */
|
|
5152
5906
|
async linearCreateIssue(params = {}) {
|
|
5153
|
-
const body4 =
|
|
5907
|
+
const body4 = stripUndefined19(params);
|
|
5154
5908
|
const data = await this.http.post(
|
|
5155
5909
|
"/integrations/linear/create-issue",
|
|
5156
5910
|
body4
|
|
5157
5911
|
);
|
|
5158
|
-
return
|
|
5912
|
+
return unwrap34(data);
|
|
5159
5913
|
}
|
|
5160
5914
|
};
|
|
5161
5915
|
|
|
5162
5916
|
// src/resources/mcp.ts
|
|
5163
|
-
function
|
|
5917
|
+
function unwrap35(payload) {
|
|
5164
5918
|
if (payload && typeof payload === "object") {
|
|
5165
5919
|
const p = payload;
|
|
5166
5920
|
for (const k of ["data", "mcp", "result", "items"]) {
|
|
@@ -5169,7 +5923,7 @@ function unwrap33(payload) {
|
|
|
5169
5923
|
}
|
|
5170
5924
|
return payload;
|
|
5171
5925
|
}
|
|
5172
|
-
function
|
|
5926
|
+
function stripUndefined20(input) {
|
|
5173
5927
|
return Object.fromEntries(
|
|
5174
5928
|
Object.entries(input).filter(([, v]) => v !== void 0)
|
|
5175
5929
|
);
|
|
@@ -5181,12 +5935,12 @@ var Mcp = class {
|
|
|
5181
5935
|
http;
|
|
5182
5936
|
/** Send a JSON-RPC request to the MCP endpoint. */
|
|
5183
5937
|
async dispatch(params = {}) {
|
|
5184
|
-
const body4 =
|
|
5938
|
+
const body4 = stripUndefined20(params);
|
|
5185
5939
|
const data = await this.http.post(
|
|
5186
5940
|
"/mcp",
|
|
5187
5941
|
Object.keys(body4).length > 0 ? body4 : void 0
|
|
5188
5942
|
);
|
|
5189
|
-
return
|
|
5943
|
+
return unwrap35(data);
|
|
5190
5944
|
}
|
|
5191
5945
|
/**
|
|
5192
5946
|
* Open the MCP listen channel (GET).
|
|
@@ -5196,7 +5950,7 @@ var Mcp = class {
|
|
|
5196
5950
|
*/
|
|
5197
5951
|
async listen() {
|
|
5198
5952
|
const data = await this.http.get("/mcp");
|
|
5199
|
-
return
|
|
5953
|
+
return unwrap35(data);
|
|
5200
5954
|
}
|
|
5201
5955
|
/** Close (terminate) the MCP session. */
|
|
5202
5956
|
async close() {
|
|
@@ -5205,7 +5959,7 @@ var Mcp = class {
|
|
|
5205
5959
|
};
|
|
5206
5960
|
|
|
5207
5961
|
// src/resources/models.ts
|
|
5208
|
-
function
|
|
5962
|
+
function unwrap36(data) {
|
|
5209
5963
|
if (Array.isArray(data)) return data;
|
|
5210
5964
|
if (data && typeof data === "object") {
|
|
5211
5965
|
const d = data;
|
|
@@ -5226,7 +5980,7 @@ var Models = class {
|
|
|
5226
5980
|
Object.entries(filters).filter(([, v]) => v !== void 0)
|
|
5227
5981
|
);
|
|
5228
5982
|
const data = await this.http.get("/intelligence/models", query2);
|
|
5229
|
-
return
|
|
5983
|
+
return unwrap36(data);
|
|
5230
5984
|
}
|
|
5231
5985
|
/**
|
|
5232
5986
|
* Get a single model by id.
|
|
@@ -5869,7 +6623,7 @@ function resourcePayload(params) {
|
|
|
5869
6623
|
return { resource_type, resource_id };
|
|
5870
6624
|
}
|
|
5871
6625
|
function authConfig(params) {
|
|
5872
|
-
return
|
|
6626
|
+
return stripUndefined21({
|
|
5873
6627
|
...params.config ?? {},
|
|
5874
6628
|
signup_enabled: params.signup_enabled ?? params.signupEnabled,
|
|
5875
6629
|
email_confirm_required: params.email_confirm_required ?? params.emailConfirmRequired,
|
|
@@ -5877,12 +6631,12 @@ function authConfig(params) {
|
|
|
5877
6631
|
});
|
|
5878
6632
|
}
|
|
5879
6633
|
function requestBody(params) {
|
|
5880
|
-
return
|
|
6634
|
+
return stripUndefined21({
|
|
5881
6635
|
...resourcePayload(params),
|
|
5882
6636
|
config: authConfig(params)
|
|
5883
6637
|
});
|
|
5884
6638
|
}
|
|
5885
|
-
function
|
|
6639
|
+
function unwrap37(payload) {
|
|
5886
6640
|
if (payload && typeof payload === "object") {
|
|
5887
6641
|
const p = payload;
|
|
5888
6642
|
for (const k of ["data", "project_auth", "config", "items"]) {
|
|
@@ -5891,7 +6645,7 @@ function unwrap35(payload) {
|
|
|
5891
6645
|
}
|
|
5892
6646
|
return payload;
|
|
5893
6647
|
}
|
|
5894
|
-
function
|
|
6648
|
+
function stripUndefined21(input) {
|
|
5895
6649
|
return Object.fromEntries(
|
|
5896
6650
|
Object.entries(input).filter(([, v]) => v !== void 0)
|
|
5897
6651
|
);
|
|
@@ -5907,13 +6661,13 @@ var ProjectAuth = class {
|
|
|
5907
6661
|
"/project-auth/status",
|
|
5908
6662
|
resourcePayload(params)
|
|
5909
6663
|
);
|
|
5910
|
-
return
|
|
6664
|
+
return unwrap37(data);
|
|
5911
6665
|
}
|
|
5912
6666
|
/** Enable project auth. */
|
|
5913
6667
|
async enable(params) {
|
|
5914
6668
|
const body4 = requestBody(params);
|
|
5915
6669
|
const data = await this.http.post("/project-auth/enable", body4);
|
|
5916
|
-
return
|
|
6670
|
+
return unwrap37(data);
|
|
5917
6671
|
}
|
|
5918
6672
|
/** Disable project auth. */
|
|
5919
6673
|
async disable(params) {
|
|
@@ -5921,18 +6675,18 @@ var ProjectAuth = class {
|
|
|
5921
6675
|
"/project-auth/disable",
|
|
5922
6676
|
resourcePayload(params)
|
|
5923
6677
|
);
|
|
5924
|
-
return
|
|
6678
|
+
return unwrap37(data);
|
|
5925
6679
|
}
|
|
5926
6680
|
/** Update project-auth configuration. */
|
|
5927
6681
|
async update(params) {
|
|
5928
6682
|
const body4 = requestBody(params);
|
|
5929
6683
|
const data = await this.http.patch("/project-auth/config", body4);
|
|
5930
|
-
return
|
|
6684
|
+
return unwrap37(data);
|
|
5931
6685
|
}
|
|
5932
6686
|
};
|
|
5933
6687
|
|
|
5934
6688
|
// src/resources/project-integrations.ts
|
|
5935
|
-
function
|
|
6689
|
+
function unwrap38(payload) {
|
|
5936
6690
|
if (payload && typeof payload === "object") {
|
|
5937
6691
|
const p = payload;
|
|
5938
6692
|
for (const k of ["data", "project_integrations", "catalog", "items"]) {
|
|
@@ -5942,11 +6696,11 @@ function unwrap36(payload) {
|
|
|
5942
6696
|
return payload;
|
|
5943
6697
|
}
|
|
5944
6698
|
function listItems9(payload) {
|
|
5945
|
-
const result =
|
|
6699
|
+
const result = unwrap38(payload);
|
|
5946
6700
|
if (Array.isArray(result)) return result;
|
|
5947
6701
|
return [];
|
|
5948
6702
|
}
|
|
5949
|
-
function
|
|
6703
|
+
function stripUndefined22(input) {
|
|
5950
6704
|
return Object.fromEntries(
|
|
5951
6705
|
Object.entries(input).filter(([, v]) => v !== void 0)
|
|
5952
6706
|
);
|
|
@@ -5963,7 +6717,7 @@ var ProjectIntegrations = class {
|
|
|
5963
6717
|
http;
|
|
5964
6718
|
/** List project integrations. */
|
|
5965
6719
|
async list(params = {}) {
|
|
5966
|
-
const query2 =
|
|
6720
|
+
const query2 = stripUndefined22(params);
|
|
5967
6721
|
const data = await this.http.get("/project-integrations", query2);
|
|
5968
6722
|
return listItems9(data);
|
|
5969
6723
|
}
|
|
@@ -5977,13 +6731,13 @@ var ProjectIntegrations = class {
|
|
|
5977
6731
|
const data = await this.http.get(
|
|
5978
6732
|
`/project-integrations/${integrationId}`
|
|
5979
6733
|
);
|
|
5980
|
-
return
|
|
6734
|
+
return unwrap38(data);
|
|
5981
6735
|
}
|
|
5982
6736
|
/** Create a project integration. */
|
|
5983
6737
|
async create(params) {
|
|
5984
6738
|
const body4 = stripUndefObj2(params);
|
|
5985
6739
|
const data = await this.http.post("/project-integrations", body4);
|
|
5986
|
-
return
|
|
6740
|
+
return unwrap38(data);
|
|
5987
6741
|
}
|
|
5988
6742
|
/** Update a project integration. */
|
|
5989
6743
|
async update(integrationId, params) {
|
|
@@ -5992,7 +6746,7 @@ var ProjectIntegrations = class {
|
|
|
5992
6746
|
`/project-integrations/${integrationId}`,
|
|
5993
6747
|
body4
|
|
5994
6748
|
);
|
|
5995
|
-
return
|
|
6749
|
+
return unwrap38(data);
|
|
5996
6750
|
}
|
|
5997
6751
|
/** Delete a project integration. */
|
|
5998
6752
|
async delete(integrationId) {
|
|
@@ -6001,7 +6755,7 @@ var ProjectIntegrations = class {
|
|
|
6001
6755
|
};
|
|
6002
6756
|
|
|
6003
6757
|
// src/resources/provider-defaults.ts
|
|
6004
|
-
function
|
|
6758
|
+
function unwrap39(data) {
|
|
6005
6759
|
if (data && typeof data === "object") {
|
|
6006
6760
|
const d = data;
|
|
6007
6761
|
for (const k of ["data", "defaults", "provider_defaults", "config"]) {
|
|
@@ -6017,7 +6771,7 @@ var ProviderDefaults = class {
|
|
|
6017
6771
|
http;
|
|
6018
6772
|
/** Get the current fleet-wide provider defaults. */
|
|
6019
6773
|
async list() {
|
|
6020
|
-
return
|
|
6774
|
+
return unwrap39(await this.http.get("/admin/provider-defaults"));
|
|
6021
6775
|
}
|
|
6022
6776
|
/** Return the defaults entry for a single provider, or {} if missing. */
|
|
6023
6777
|
async get(provider) {
|
|
@@ -6033,13 +6787,13 @@ var ProviderDefaults = class {
|
|
|
6033
6787
|
const body4 = Object.fromEntries(
|
|
6034
6788
|
Object.entries(opts).filter(([, v]) => v !== void 0)
|
|
6035
6789
|
);
|
|
6036
|
-
return
|
|
6790
|
+
return unwrap39(
|
|
6037
6791
|
await this.http.put("/admin/provider-defaults", body4)
|
|
6038
6792
|
);
|
|
6039
6793
|
}
|
|
6040
6794
|
// ── Per-tenant overrides ────────────────────────────────────────────────
|
|
6041
6795
|
async getTenant(tenantId) {
|
|
6042
|
-
return
|
|
6796
|
+
return unwrap39(
|
|
6043
6797
|
await this.http.get(
|
|
6044
6798
|
`/admin/tenants/${tenantId}/provider-config`
|
|
6045
6799
|
)
|
|
@@ -6049,7 +6803,7 @@ var ProviderDefaults = class {
|
|
|
6049
6803
|
const body4 = Object.fromEntries(
|
|
6050
6804
|
Object.entries(opts).filter(([, v]) => v !== void 0)
|
|
6051
6805
|
);
|
|
6052
|
-
return
|
|
6806
|
+
return unwrap39(
|
|
6053
6807
|
await this.http.put(
|
|
6054
6808
|
`/admin/tenants/${tenantId}/provider-config`,
|
|
6055
6809
|
body4
|
|
@@ -6062,7 +6816,7 @@ var ProviderDefaults = class {
|
|
|
6062
6816
|
};
|
|
6063
6817
|
|
|
6064
6818
|
// src/resources/regions.ts
|
|
6065
|
-
function
|
|
6819
|
+
function unwrap40(payload) {
|
|
6066
6820
|
if (payload && typeof payload === "object") {
|
|
6067
6821
|
const p = payload;
|
|
6068
6822
|
for (const k of [
|
|
@@ -6079,7 +6833,7 @@ function unwrap38(payload) {
|
|
|
6079
6833
|
return payload;
|
|
6080
6834
|
}
|
|
6081
6835
|
function listItems10(payload) {
|
|
6082
|
-
const result =
|
|
6836
|
+
const result = unwrap40(payload);
|
|
6083
6837
|
if (Array.isArray(result)) return result;
|
|
6084
6838
|
return [];
|
|
6085
6839
|
}
|
|
@@ -6101,7 +6855,7 @@ var Regions = class {
|
|
|
6101
6855
|
/** Get static compute pricing data. */
|
|
6102
6856
|
async pricing() {
|
|
6103
6857
|
const data = await this.http.get("/compute/pricing");
|
|
6104
|
-
return
|
|
6858
|
+
return unwrap40(data);
|
|
6105
6859
|
}
|
|
6106
6860
|
/** List community computer templates. */
|
|
6107
6861
|
async listTemplates() {
|
|
@@ -6113,12 +6867,12 @@ var Regions = class {
|
|
|
6113
6867
|
const data = await this.http.get(
|
|
6114
6868
|
`/compute/templates/${templateId}`
|
|
6115
6869
|
);
|
|
6116
|
-
return
|
|
6870
|
+
return unwrap40(data);
|
|
6117
6871
|
}
|
|
6118
6872
|
};
|
|
6119
6873
|
|
|
6120
6874
|
// src/resources/runtime-env.ts
|
|
6121
|
-
function
|
|
6875
|
+
function unwrap41(payload) {
|
|
6122
6876
|
if (payload !== null && typeof payload === "object" && "data" in payload && payload.data !== void 0) {
|
|
6123
6877
|
return payload.data;
|
|
6124
6878
|
}
|
|
@@ -6171,11 +6925,11 @@ var RuntimeEnv = class {
|
|
|
6171
6925
|
"/runtime-env",
|
|
6172
6926
|
query(params)
|
|
6173
6927
|
);
|
|
6174
|
-
return
|
|
6928
|
+
return unwrap41(response).map(normalize2);
|
|
6175
6929
|
}
|
|
6176
6930
|
async get(id) {
|
|
6177
6931
|
return normalize2(
|
|
6178
|
-
|
|
6932
|
+
unwrap41(
|
|
6179
6933
|
await this.http.get(
|
|
6180
6934
|
`/runtime-env/${encodeURIComponent(id)}`
|
|
6181
6935
|
)
|
|
@@ -6184,7 +6938,7 @@ var RuntimeEnv = class {
|
|
|
6184
6938
|
}
|
|
6185
6939
|
async set(params) {
|
|
6186
6940
|
return normalize2(
|
|
6187
|
-
|
|
6941
|
+
unwrap41(
|
|
6188
6942
|
await this.http.post(
|
|
6189
6943
|
"/runtime-env",
|
|
6190
6944
|
body3(params)
|
|
@@ -6198,7 +6952,7 @@ var RuntimeEnv = class {
|
|
|
6198
6952
|
};
|
|
6199
6953
|
|
|
6200
6954
|
// src/resources/runtime-capabilities.ts
|
|
6201
|
-
function
|
|
6955
|
+
function unwrap42(payload) {
|
|
6202
6956
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
6203
6957
|
return payload.data;
|
|
6204
6958
|
}
|
|
@@ -6210,7 +6964,7 @@ var RuntimeCapabilitiesResource = class {
|
|
|
6210
6964
|
}
|
|
6211
6965
|
http;
|
|
6212
6966
|
async get() {
|
|
6213
|
-
return
|
|
6967
|
+
return unwrap42(
|
|
6214
6968
|
await this.http.get("/runtime-capabilities")
|
|
6215
6969
|
);
|
|
6216
6970
|
}
|
|
@@ -6230,7 +6984,7 @@ var AGENT_WORKSPACE_TIMEOUT_SEC = 86400;
|
|
|
6230
6984
|
var AGENT_WORKSPACE_IDLE_TIMEOUT_SEC = 1800;
|
|
6231
6985
|
var AGENT_WORKSPACE_SNAPSHOT_EXPIRATION_DAYS = 30;
|
|
6232
6986
|
var AGENT_WORKSPACE_KEEP_LAST_SNAPSHOTS = 1;
|
|
6233
|
-
function
|
|
6987
|
+
function unwrap43(payload) {
|
|
6234
6988
|
if (payload !== null && typeof payload === "object" && "data" in payload && payload.data !== void 0) {
|
|
6235
6989
|
return payload.data;
|
|
6236
6990
|
}
|
|
@@ -6277,7 +7031,7 @@ function createBody(params = {}) {
|
|
|
6277
7031
|
if (keepLastSnapshots !== void 0) {
|
|
6278
7032
|
metadata.keep_last_snapshots = keepLastSnapshots;
|
|
6279
7033
|
}
|
|
6280
|
-
return
|
|
7034
|
+
return stripUndefined23({
|
|
6281
7035
|
template_id: templateId,
|
|
6282
7036
|
cpu_count: params.cpuCount ?? params.cpu_count,
|
|
6283
7037
|
memory_mb: params.memoryMb ?? params.memory_mb,
|
|
@@ -6307,14 +7061,14 @@ function createBody(params = {}) {
|
|
|
6307
7061
|
});
|
|
6308
7062
|
}
|
|
6309
7063
|
function execBody(command, options = {}) {
|
|
6310
|
-
return
|
|
7064
|
+
return stripUndefined23({
|
|
6311
7065
|
command,
|
|
6312
7066
|
cwd: options.cwd ?? options.workingDir ?? options.working_dir,
|
|
6313
7067
|
env: options.env,
|
|
6314
7068
|
timeout: options.timeout ?? options.timeoutSec ?? options.timeout_sec
|
|
6315
7069
|
});
|
|
6316
7070
|
}
|
|
6317
|
-
function
|
|
7071
|
+
function stripUndefined23(input) {
|
|
6318
7072
|
return Object.fromEntries(
|
|
6319
7073
|
Object.entries(input).filter(([, value]) => value !== void 0)
|
|
6320
7074
|
);
|
|
@@ -6456,7 +7210,7 @@ var SandboxTerminal = class {
|
|
|
6456
7210
|
const body4 = Object.fromEntries(
|
|
6457
7211
|
Object.entries(params).filter(([, v]) => v !== void 0)
|
|
6458
7212
|
);
|
|
6459
|
-
const response =
|
|
7213
|
+
const response = unwrap43(
|
|
6460
7214
|
await this.sandbox.http.post(`/sandboxes/${this.sandbox.id}/terminal`, body4)
|
|
6461
7215
|
);
|
|
6462
7216
|
return response;
|
|
@@ -6505,7 +7259,7 @@ var SandboxPreviews = class {
|
|
|
6505
7259
|
Object.entries(opts).filter(([, v]) => v !== void 0)
|
|
6506
7260
|
)
|
|
6507
7261
|
};
|
|
6508
|
-
return
|
|
7262
|
+
return unwrap43(
|
|
6509
7263
|
await this.http.post(
|
|
6510
7264
|
`/sandboxes/${this.sandbox.id}/previews`,
|
|
6511
7265
|
body4
|
|
@@ -6513,7 +7267,7 @@ var SandboxPreviews = class {
|
|
|
6513
7267
|
);
|
|
6514
7268
|
}
|
|
6515
7269
|
async get(previewId) {
|
|
6516
|
-
return
|
|
7270
|
+
return unwrap43(
|
|
6517
7271
|
await this.http.get(
|
|
6518
7272
|
`/sandboxes/${this.sandbox.id}/previews/${previewId}`
|
|
6519
7273
|
)
|
|
@@ -6526,7 +7280,7 @@ var SandboxPreviews = class {
|
|
|
6526
7280
|
}
|
|
6527
7281
|
/** Mint a share token for previewId. */
|
|
6528
7282
|
async share(previewId, opts = {}) {
|
|
6529
|
-
return
|
|
7283
|
+
return unwrap43(
|
|
6530
7284
|
await this.http.post(
|
|
6531
7285
|
`/sandboxes/${this.sandbox.id}/previews/${previewId}/share`,
|
|
6532
7286
|
{ ttl_seconds: opts.ttl_seconds ?? opts.expires_in_sec ?? 3600 }
|
|
@@ -6595,7 +7349,7 @@ var SandboxTags = class {
|
|
|
6595
7349
|
sandbox;
|
|
6596
7350
|
/** Replace the full tag list with tags. */
|
|
6597
7351
|
async set(tags) {
|
|
6598
|
-
return
|
|
7352
|
+
return unwrap43(
|
|
6599
7353
|
await this.sandbox.http.patch(`/sandboxes/${this.sandbox.id}/tags`, { tags })
|
|
6600
7354
|
);
|
|
6601
7355
|
}
|
|
@@ -6621,6 +7375,7 @@ var Sandbox = class _Sandbox {
|
|
|
6621
7375
|
this.env = new SandboxEnv(this);
|
|
6622
7376
|
this.tags = new SandboxTags(this);
|
|
6623
7377
|
const sandboxId = data.id;
|
|
7378
|
+
this.connectors = new SandboxConnectors(http, sandboxId);
|
|
6624
7379
|
this.secrets = new SandboxSecrets(http, sandboxId);
|
|
6625
7380
|
this.network = new SandboxNetwork(http, sandboxId);
|
|
6626
7381
|
this.audit = new SandboxAudit(http, sandboxId);
|
|
@@ -6644,6 +7399,8 @@ var Sandbox = class _Sandbox {
|
|
|
6644
7399
|
env;
|
|
6645
7400
|
/** Tag replacement. */
|
|
6646
7401
|
tags;
|
|
7402
|
+
/** MIOSA Connect provider bindings scoped to this sandbox. */
|
|
7403
|
+
connectors;
|
|
6647
7404
|
/** Encrypted secrets + OAuth credentials scoped to this sandbox. */
|
|
6648
7405
|
secrets;
|
|
6649
7406
|
/** Egress allowlist + policies scoped to this sandbox. */
|
|
@@ -6663,14 +7420,14 @@ var Sandbox = class _Sandbox {
|
|
|
6663
7420
|
return this.data.template_id ?? this.data.image_id ?? "";
|
|
6664
7421
|
}
|
|
6665
7422
|
async refresh() {
|
|
6666
|
-
this.data =
|
|
7423
|
+
this.data = unwrap43(
|
|
6667
7424
|
await this.http.get(`/sandboxes/${this.id}`)
|
|
6668
7425
|
);
|
|
6669
7426
|
return this;
|
|
6670
7427
|
}
|
|
6671
7428
|
async runExec(command, options) {
|
|
6672
7429
|
this.assertRunning("exec");
|
|
6673
|
-
const response =
|
|
7430
|
+
const response = unwrap43(
|
|
6674
7431
|
await this.http.post(
|
|
6675
7432
|
`/sandboxes/${this.id}/exec`,
|
|
6676
7433
|
execBody(command, options)
|
|
@@ -6715,7 +7472,7 @@ var Sandbox = class _Sandbox {
|
|
|
6715
7472
|
}
|
|
6716
7473
|
async createExport(params) {
|
|
6717
7474
|
const body4 = typeof params === "string" ? { path: params } : Array.isArray(params) ? { paths: params } : params;
|
|
6718
|
-
const response =
|
|
7475
|
+
const response = unwrap43(
|
|
6719
7476
|
await this.http.post(
|
|
6720
7477
|
`/sandboxes/${this.id}/exports`,
|
|
6721
7478
|
body4
|
|
@@ -6740,7 +7497,7 @@ var Sandbox = class _Sandbox {
|
|
|
6740
7497
|
}
|
|
6741
7498
|
async listFiles(path = "/workspace") {
|
|
6742
7499
|
this.assertRunning("files.list");
|
|
6743
|
-
const response =
|
|
7500
|
+
const response = unwrap43(
|
|
6744
7501
|
await this.http.get(
|
|
6745
7502
|
`/sandboxes/${this.id}/files`,
|
|
6746
7503
|
{ path }
|
|
@@ -6750,7 +7507,7 @@ var Sandbox = class _Sandbox {
|
|
|
6750
7507
|
}
|
|
6751
7508
|
async statFile(path) {
|
|
6752
7509
|
this.assertRunning("files.stat");
|
|
6753
|
-
return
|
|
7510
|
+
return unwrap43(
|
|
6754
7511
|
await this.http.post(
|
|
6755
7512
|
`/sandboxes/${this.id}/files/stat`,
|
|
6756
7513
|
{ path }
|
|
@@ -6759,7 +7516,7 @@ var Sandbox = class _Sandbox {
|
|
|
6759
7516
|
}
|
|
6760
7517
|
async expose(port) {
|
|
6761
7518
|
this.assertRunning("expose");
|
|
6762
|
-
const response =
|
|
7519
|
+
const response = unwrap43(
|
|
6763
7520
|
await this.http.post(
|
|
6764
7521
|
`/sandboxes/${this.id}/expose`,
|
|
6765
7522
|
port === void 0 ? {} : { port }
|
|
@@ -6769,7 +7526,7 @@ var Sandbox = class _Sandbox {
|
|
|
6769
7526
|
}
|
|
6770
7527
|
async startTemplate(options = {}) {
|
|
6771
7528
|
this.assertRunning("startTemplate");
|
|
6772
|
-
return
|
|
7529
|
+
return unwrap43(
|
|
6773
7530
|
await this.http.post(
|
|
6774
7531
|
`/sandboxes/${this.id}/template/start`,
|
|
6775
7532
|
options
|
|
@@ -6777,7 +7534,7 @@ var Sandbox = class _Sandbox {
|
|
|
6777
7534
|
);
|
|
6778
7535
|
}
|
|
6779
7536
|
async getArtifacts() {
|
|
6780
|
-
return
|
|
7537
|
+
return unwrap43(
|
|
6781
7538
|
await this.http.get(
|
|
6782
7539
|
`/sandboxes/${this.id}/artifacts`
|
|
6783
7540
|
)
|
|
@@ -6788,7 +7545,7 @@ var Sandbox = class _Sandbox {
|
|
|
6788
7545
|
`/sandboxes/${this.id}/logs`,
|
|
6789
7546
|
{ lines }
|
|
6790
7547
|
);
|
|
6791
|
-
return
|
|
7548
|
+
return unwrap43(response);
|
|
6792
7549
|
}
|
|
6793
7550
|
streamLogs() {
|
|
6794
7551
|
return this.http.stream(
|
|
@@ -6797,7 +7554,7 @@ var Sandbox = class _Sandbox {
|
|
|
6797
7554
|
}
|
|
6798
7555
|
async createSnapshot(comment) {
|
|
6799
7556
|
this.assertRunning("snapshots.create");
|
|
6800
|
-
return
|
|
7557
|
+
return unwrap43(
|
|
6801
7558
|
await this.http.post(
|
|
6802
7559
|
`/sandboxes/${this.id}/snapshots`,
|
|
6803
7560
|
comment ? { comment } : {}
|
|
@@ -6805,14 +7562,14 @@ var Sandbox = class _Sandbox {
|
|
|
6805
7562
|
);
|
|
6806
7563
|
}
|
|
6807
7564
|
async listSnapshots() {
|
|
6808
|
-
return
|
|
7565
|
+
return unwrap43(
|
|
6809
7566
|
await this.http.get(
|
|
6810
7567
|
`/sandboxes/${this.id}/snapshots`
|
|
6811
7568
|
)
|
|
6812
7569
|
);
|
|
6813
7570
|
}
|
|
6814
7571
|
async restoreSnapshot(snapshotId) {
|
|
6815
|
-
const data =
|
|
7572
|
+
const data = unwrap43(
|
|
6816
7573
|
await this.http.post(
|
|
6817
7574
|
`/sandboxes/${this.id}/restore/${snapshotId}`,
|
|
6818
7575
|
{}
|
|
@@ -6832,7 +7589,7 @@ var Sandbox = class _Sandbox {
|
|
|
6832
7589
|
const body4 = {};
|
|
6833
7590
|
if (opts.name !== void 0) body4.name = opts.name;
|
|
6834
7591
|
if (opts.metadata !== void 0) body4.metadata = opts.metadata;
|
|
6835
|
-
const data =
|
|
7592
|
+
const data = unwrap43(
|
|
6836
7593
|
await this.http.post(
|
|
6837
7594
|
`/sandboxes/${this.id}/fork`,
|
|
6838
7595
|
body4
|
|
@@ -6854,7 +7611,7 @@ var Sandbox = class _Sandbox {
|
|
|
6854
7611
|
if (keepLastSnapshots !== void 0) {
|
|
6855
7612
|
metadata.keep_last_snapshots = keepLastSnapshots;
|
|
6856
7613
|
}
|
|
6857
|
-
const body4 =
|
|
7614
|
+
const body4 = stripUndefined23({
|
|
6858
7615
|
name: params.name,
|
|
6859
7616
|
slug: params.slug,
|
|
6860
7617
|
tags: params.tags,
|
|
@@ -6863,7 +7620,7 @@ var Sandbox = class _Sandbox {
|
|
|
6863
7620
|
timeout_sec: params.timeout_sec ?? params.timeoutSec,
|
|
6864
7621
|
idle_timeout_sec: params.idle_timeout_sec ?? params.idleTimeoutSec
|
|
6865
7622
|
});
|
|
6866
|
-
const data =
|
|
7623
|
+
const data = unwrap43(
|
|
6867
7624
|
await this.http.patch(
|
|
6868
7625
|
`/sandboxes/${this.id}`,
|
|
6869
7626
|
body4
|
|
@@ -6873,7 +7630,7 @@ var Sandbox = class _Sandbox {
|
|
|
6873
7630
|
return this;
|
|
6874
7631
|
}
|
|
6875
7632
|
async extend(timeoutSec) {
|
|
6876
|
-
const data =
|
|
7633
|
+
const data = unwrap43(
|
|
6877
7634
|
await this.http.post(
|
|
6878
7635
|
`/sandboxes/${this.id}/extend`,
|
|
6879
7636
|
{ timeout_sec: timeoutSec }
|
|
@@ -6896,7 +7653,7 @@ var Sandbox = class _Sandbox {
|
|
|
6896
7653
|
return raw;
|
|
6897
7654
|
}
|
|
6898
7655
|
async pause() {
|
|
6899
|
-
const data =
|
|
7656
|
+
const data = unwrap43(
|
|
6900
7657
|
await this.http.post(
|
|
6901
7658
|
`/sandboxes/${this.id}/pause`,
|
|
6902
7659
|
{}
|
|
@@ -6906,7 +7663,7 @@ var Sandbox = class _Sandbox {
|
|
|
6906
7663
|
return this;
|
|
6907
7664
|
}
|
|
6908
7665
|
async resume() {
|
|
6909
|
-
const data =
|
|
7666
|
+
const data = unwrap43(
|
|
6910
7667
|
await this.http.post(
|
|
6911
7668
|
`/sandboxes/${this.id}/resume`,
|
|
6912
7669
|
{}
|
|
@@ -6919,7 +7676,7 @@ var Sandbox = class _Sandbox {
|
|
|
6919
7676
|
const idempotencyKey11 = params.idempotencyKey ?? params.idempotency_key;
|
|
6920
7677
|
const requestOptions = {
|
|
6921
7678
|
method: "POST",
|
|
6922
|
-
body:
|
|
7679
|
+
body: stripUndefined23({
|
|
6923
7680
|
name: params.name,
|
|
6924
7681
|
deployment_id: params.deploymentId ?? params.deployment_id,
|
|
6925
7682
|
output_path: params.outputPath ?? params.output_path ?? params.path ?? params.sourcePath ?? params.source_path,
|
|
@@ -6942,7 +7699,7 @@ var Sandbox = class _Sandbox {
|
|
|
6942
7699
|
if (idempotencyKey11) {
|
|
6943
7700
|
requestOptions.headers = { "Idempotency-Key": idempotencyKey11 };
|
|
6944
7701
|
}
|
|
6945
|
-
return
|
|
7702
|
+
return unwrap43(
|
|
6946
7703
|
await this.http.request(
|
|
6947
7704
|
`/sandboxes/${this.id}/deploy`,
|
|
6948
7705
|
requestOptions
|
|
@@ -6954,7 +7711,7 @@ var Sandbox = class _Sandbox {
|
|
|
6954
7711
|
}
|
|
6955
7712
|
/** Check readiness of the sandbox (GET /sandboxes/:id/readiness). */
|
|
6956
7713
|
async readiness() {
|
|
6957
|
-
return
|
|
7714
|
+
return unwrap43(
|
|
6958
7715
|
await this.http.get(
|
|
6959
7716
|
`/sandboxes/${this.id}/readiness`
|
|
6960
7717
|
)
|
|
@@ -7122,7 +7879,7 @@ var Sandboxes = class {
|
|
|
7122
7879
|
if (idempotencyKey11) {
|
|
7123
7880
|
requestOptions.headers = { "Idempotency-Key": idempotencyKey11 };
|
|
7124
7881
|
}
|
|
7125
|
-
const data =
|
|
7882
|
+
const data = unwrap43(
|
|
7126
7883
|
await this.http.request(
|
|
7127
7884
|
"/sandboxes",
|
|
7128
7885
|
requestOptions
|
|
@@ -7141,7 +7898,7 @@ var Sandboxes = class {
|
|
|
7141
7898
|
return listItems11(data).map((item) => new Sandbox(this.http, item));
|
|
7142
7899
|
}
|
|
7143
7900
|
async get(id) {
|
|
7144
|
-
const data =
|
|
7901
|
+
const data = unwrap43(
|
|
7145
7902
|
await this.http.get(`/sandboxes/${id}`)
|
|
7146
7903
|
);
|
|
7147
7904
|
return new Sandbox(this.http, data);
|
|
@@ -7150,7 +7907,7 @@ var Sandboxes = class {
|
|
|
7150
7907
|
return this.get(id);
|
|
7151
7908
|
}
|
|
7152
7909
|
async getByName(name) {
|
|
7153
|
-
const data =
|
|
7910
|
+
const data = unwrap43(
|
|
7154
7911
|
await this.http.get(
|
|
7155
7912
|
`/sandboxes/by-name/${encodeURIComponent(name)}`
|
|
7156
7913
|
)
|
|
@@ -7207,7 +7964,7 @@ var Sandboxes = class {
|
|
|
7207
7964
|
async createTemplate(params) {
|
|
7208
7965
|
const response = await this.http.post(
|
|
7209
7966
|
"/sandbox-templates",
|
|
7210
|
-
|
|
7967
|
+
stripUndefined23({
|
|
7211
7968
|
name: params.name,
|
|
7212
7969
|
slug: params.slug,
|
|
7213
7970
|
description: params.description,
|
|
@@ -7215,29 +7972,29 @@ var Sandboxes = class {
|
|
|
7215
7972
|
metadata: params.metadata
|
|
7216
7973
|
})
|
|
7217
7974
|
);
|
|
7218
|
-
return
|
|
7975
|
+
return unwrap43(response);
|
|
7219
7976
|
}
|
|
7220
7977
|
async createTemplateBuild(templateId, params = {}) {
|
|
7221
7978
|
const response = await this.http.post(
|
|
7222
7979
|
`/sandbox-templates/${templateId}/builds`,
|
|
7223
|
-
|
|
7980
|
+
stripUndefined23({
|
|
7224
7981
|
build_spec: params.buildSpec ?? params.build_spec,
|
|
7225
7982
|
metadata: params.metadata
|
|
7226
7983
|
})
|
|
7227
7984
|
);
|
|
7228
|
-
return
|
|
7985
|
+
return unwrap43(response);
|
|
7229
7986
|
}
|
|
7230
7987
|
async listTemplateBuilds(templateId) {
|
|
7231
7988
|
const response = await this.http.get(
|
|
7232
7989
|
`/sandbox-templates/${templateId}/builds`
|
|
7233
7990
|
);
|
|
7234
|
-
return
|
|
7991
|
+
return unwrap43(response);
|
|
7235
7992
|
}
|
|
7236
7993
|
async getTemplateBuild(buildId) {
|
|
7237
7994
|
const response = await this.http.get(
|
|
7238
7995
|
`/sandbox-template-builds/${buildId}`
|
|
7239
7996
|
);
|
|
7240
|
-
return
|
|
7997
|
+
return unwrap43(response);
|
|
7241
7998
|
}
|
|
7242
7999
|
};
|
|
7243
8000
|
function toBase642(bytes) {
|
|
@@ -7249,7 +8006,7 @@ function toBase642(bytes) {
|
|
|
7249
8006
|
}
|
|
7250
8007
|
return btoa(binary);
|
|
7251
8008
|
}
|
|
7252
|
-
function
|
|
8009
|
+
function unwrap44(payload) {
|
|
7253
8010
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
7254
8011
|
return payload.data;
|
|
7255
8012
|
}
|
|
@@ -7265,7 +8022,7 @@ function listItems12(payload, candidateKeys = ["data", "templates", "builds", "i
|
|
|
7265
8022
|
}
|
|
7266
8023
|
return [];
|
|
7267
8024
|
}
|
|
7268
|
-
function
|
|
8025
|
+
function stripUndefined24(input) {
|
|
7269
8026
|
return Object.fromEntries(
|
|
7270
8027
|
Object.entries(input).filter(([, v]) => v !== void 0)
|
|
7271
8028
|
);
|
|
@@ -7292,7 +8049,7 @@ var SandboxTemplates = class {
|
|
|
7292
8049
|
const data = await this.http.get(
|
|
7293
8050
|
`/sandbox-templates/${templateId}`
|
|
7294
8051
|
);
|
|
7295
|
-
return
|
|
8052
|
+
return unwrap44(data);
|
|
7296
8053
|
}
|
|
7297
8054
|
async create(params) {
|
|
7298
8055
|
const {
|
|
@@ -7302,7 +8059,7 @@ var SandboxTemplates = class {
|
|
|
7302
8059
|
name,
|
|
7303
8060
|
...rest
|
|
7304
8061
|
} = params;
|
|
7305
|
-
const body4 =
|
|
8062
|
+
const body4 = stripUndefined24({
|
|
7306
8063
|
name,
|
|
7307
8064
|
build_spec: buildSpec ?? build_spec,
|
|
7308
8065
|
...rest
|
|
@@ -7312,7 +8069,7 @@ var SandboxTemplates = class {
|
|
|
7312
8069
|
body: body4,
|
|
7313
8070
|
headers: { "Idempotency-Key": idempotencyKey8(ikey) }
|
|
7314
8071
|
});
|
|
7315
|
-
return
|
|
8072
|
+
return unwrap44(data);
|
|
7316
8073
|
}
|
|
7317
8074
|
async buildSpecSchema() {
|
|
7318
8075
|
const data = await this.http.get("/sandbox-templates/build-spec");
|
|
@@ -7336,7 +8093,7 @@ var SandboxTemplates = class {
|
|
|
7336
8093
|
}
|
|
7337
8094
|
async createBuild(templateId, params = {}) {
|
|
7338
8095
|
const { idempotencyKey: ikey, ...rest } = params;
|
|
7339
|
-
const body4 =
|
|
8096
|
+
const body4 = stripUndefined24(rest);
|
|
7340
8097
|
const data = await this.http.request(
|
|
7341
8098
|
`/sandbox-templates/${templateId}/builds`,
|
|
7342
8099
|
{
|
|
@@ -7345,12 +8102,12 @@ var SandboxTemplates = class {
|
|
|
7345
8102
|
headers: { "Idempotency-Key": idempotencyKey8(ikey) }
|
|
7346
8103
|
}
|
|
7347
8104
|
);
|
|
7348
|
-
return
|
|
8105
|
+
return unwrap44(data);
|
|
7349
8106
|
}
|
|
7350
8107
|
};
|
|
7351
8108
|
|
|
7352
8109
|
// src/resources/settings.ts
|
|
7353
|
-
function
|
|
8110
|
+
function unwrap45(payload) {
|
|
7354
8111
|
if (payload && typeof payload === "object") {
|
|
7355
8112
|
const p = payload;
|
|
7356
8113
|
for (const k of [
|
|
@@ -7366,11 +8123,11 @@ function unwrap43(payload) {
|
|
|
7366
8123
|
return payload;
|
|
7367
8124
|
}
|
|
7368
8125
|
function listItems13(payload) {
|
|
7369
|
-
const result =
|
|
8126
|
+
const result = unwrap45(payload);
|
|
7370
8127
|
if (Array.isArray(result)) return result;
|
|
7371
8128
|
return [];
|
|
7372
8129
|
}
|
|
7373
|
-
function
|
|
8130
|
+
function stripUndefined25(input) {
|
|
7374
8131
|
return Object.fromEntries(
|
|
7375
8132
|
Object.entries(input).filter(([, v]) => v !== void 0)
|
|
7376
8133
|
);
|
|
@@ -7383,46 +8140,46 @@ var Settings = class {
|
|
|
7383
8140
|
/** Get the current tenant settings. */
|
|
7384
8141
|
async get() {
|
|
7385
8142
|
const data = await this.http.get("/settings");
|
|
7386
|
-
return
|
|
8143
|
+
return unwrap45(data);
|
|
7387
8144
|
}
|
|
7388
8145
|
/** Update tenant settings. */
|
|
7389
8146
|
async update(params) {
|
|
7390
|
-
const body4 =
|
|
8147
|
+
const body4 = stripUndefined25(params);
|
|
7391
8148
|
const data = await this.http.put("/settings", body4);
|
|
7392
|
-
return
|
|
8149
|
+
return unwrap45(data);
|
|
7393
8150
|
}
|
|
7394
8151
|
// ── Branding ──────────────────────────────────────────────────────────────
|
|
7395
8152
|
/** Get tenant branding (logo, colors, custom wordmark). */
|
|
7396
8153
|
async getBranding() {
|
|
7397
8154
|
const data = await this.http.get("/settings/branding");
|
|
7398
|
-
return
|
|
8155
|
+
return unwrap45(data);
|
|
7399
8156
|
}
|
|
7400
8157
|
/** Update tenant branding. */
|
|
7401
8158
|
async updateBranding(params) {
|
|
7402
|
-
const body4 =
|
|
8159
|
+
const body4 = stripUndefined25(params);
|
|
7403
8160
|
const data = await this.http.put("/settings/branding", body4);
|
|
7404
|
-
return
|
|
8161
|
+
return unwrap45(data);
|
|
7405
8162
|
}
|
|
7406
8163
|
// ── Read-only reference data ───────────────────────────────────────────────
|
|
7407
8164
|
/** Get tenant-scoped compute pricing. */
|
|
7408
8165
|
async computePricing() {
|
|
7409
8166
|
const data = await this.http.get("/settings/compute-pricing");
|
|
7410
|
-
return
|
|
8167
|
+
return unwrap45(data);
|
|
7411
8168
|
}
|
|
7412
8169
|
/** Get tenant-scoped GPU pricing. */
|
|
7413
8170
|
async gpuPricing() {
|
|
7414
8171
|
const data = await this.http.get("/settings/gpu-pricing");
|
|
7415
|
-
return
|
|
8172
|
+
return unwrap45(data);
|
|
7416
8173
|
}
|
|
7417
8174
|
/** List models available to this tenant. */
|
|
7418
8175
|
async availableModels() {
|
|
7419
8176
|
const data = await this.http.get("/settings/available-models");
|
|
7420
|
-
return
|
|
8177
|
+
return unwrap45(data);
|
|
7421
8178
|
}
|
|
7422
8179
|
/** List regions enabled for this tenant. */
|
|
7423
8180
|
async regions() {
|
|
7424
8181
|
const data = await this.http.get("/settings/regions");
|
|
7425
|
-
return
|
|
8182
|
+
return unwrap45(data);
|
|
7426
8183
|
}
|
|
7427
8184
|
// ── BYOK provider keys ────────────────────────────────────────────────────
|
|
7428
8185
|
/** List tenant-level BYOK provider keys (Anthropic, OpenAI, etc.). */
|
|
@@ -7432,12 +8189,12 @@ var Settings = class {
|
|
|
7432
8189
|
}
|
|
7433
8190
|
/** Create or update a BYOK provider key. */
|
|
7434
8191
|
async upsertProviderKey(provider, params) {
|
|
7435
|
-
const body4 =
|
|
8192
|
+
const body4 = stripUndefined25(params);
|
|
7436
8193
|
const data = await this.http.put(
|
|
7437
8194
|
`/settings/provider-keys/${provider}`,
|
|
7438
8195
|
body4
|
|
7439
8196
|
);
|
|
7440
|
-
return
|
|
8197
|
+
return unwrap45(data);
|
|
7441
8198
|
}
|
|
7442
8199
|
/** Delete a BYOK provider key. */
|
|
7443
8200
|
async deleteProviderKey(provider) {
|
|
@@ -7446,7 +8203,7 @@ var Settings = class {
|
|
|
7446
8203
|
};
|
|
7447
8204
|
|
|
7448
8205
|
// src/resources/snapshots-standalone.ts
|
|
7449
|
-
function
|
|
8206
|
+
function unwrap46(data) {
|
|
7450
8207
|
if (data && typeof data === "object") {
|
|
7451
8208
|
const d = data;
|
|
7452
8209
|
for (const k of ["data", "snapshots", "items"]) {
|
|
@@ -7455,7 +8212,7 @@ function unwrap44(data) {
|
|
|
7455
8212
|
}
|
|
7456
8213
|
return data;
|
|
7457
8214
|
}
|
|
7458
|
-
function
|
|
8215
|
+
function unwrapList14(data) {
|
|
7459
8216
|
if (Array.isArray(data)) return data;
|
|
7460
8217
|
if (data && typeof data === "object") {
|
|
7461
8218
|
const d = data;
|
|
@@ -7474,17 +8231,17 @@ var SnapshotsStandalone = class {
|
|
|
7474
8231
|
const query2 = Object.fromEntries(
|
|
7475
8232
|
Object.entries(filters).filter(([, v]) => v !== void 0)
|
|
7476
8233
|
);
|
|
7477
|
-
return
|
|
8234
|
+
return unwrapList14(await this.http.get("/admin/snapshots", query2));
|
|
7478
8235
|
}
|
|
7479
8236
|
async get(snapshotId) {
|
|
7480
|
-
return
|
|
8237
|
+
return unwrap46(
|
|
7481
8238
|
await this.http.get(`/admin/snapshots/${snapshotId}`)
|
|
7482
8239
|
);
|
|
7483
8240
|
}
|
|
7484
8241
|
};
|
|
7485
8242
|
|
|
7486
8243
|
// src/resources/storage.ts
|
|
7487
|
-
function
|
|
8244
|
+
function unwrap47(payload) {
|
|
7488
8245
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
7489
8246
|
return payload.data;
|
|
7490
8247
|
}
|
|
@@ -7500,7 +8257,7 @@ function listItems14(payload, candidateKeys = ["data", "buckets", "objects", "it
|
|
|
7500
8257
|
}
|
|
7501
8258
|
return [];
|
|
7502
8259
|
}
|
|
7503
|
-
function
|
|
8260
|
+
function stripUndefined26(input) {
|
|
7504
8261
|
return Object.fromEntries(
|
|
7505
8262
|
Object.entries(input).filter(([, v]) => v !== void 0)
|
|
7506
8263
|
);
|
|
@@ -7517,24 +8274,24 @@ var Storage = class {
|
|
|
7517
8274
|
}
|
|
7518
8275
|
async createBucket(params) {
|
|
7519
8276
|
const { name, public: isPublic, visibility, ...rest } = params;
|
|
7520
|
-
const body4 =
|
|
8277
|
+
const body4 = stripUndefined26({
|
|
7521
8278
|
name,
|
|
7522
8279
|
visibility: visibility ?? (isPublic === void 0 ? void 0 : isPublic ? "public" : "private"),
|
|
7523
8280
|
...rest
|
|
7524
8281
|
});
|
|
7525
8282
|
const data = await this.http.post("/storage/buckets", body4);
|
|
7526
|
-
return
|
|
8283
|
+
return unwrap47(data);
|
|
7527
8284
|
}
|
|
7528
8285
|
async getBucket(bucketId) {
|
|
7529
8286
|
const data = await this.http.get(`/storage/buckets/${bucketId}`);
|
|
7530
|
-
return
|
|
8287
|
+
return unwrap47(data);
|
|
7531
8288
|
}
|
|
7532
8289
|
async deleteBucket(bucketId) {
|
|
7533
8290
|
await this.http.delete(`/storage/buckets/${bucketId}`);
|
|
7534
8291
|
}
|
|
7535
8292
|
// ── Objects ────────────────────────────────────────────────────────────────
|
|
7536
8293
|
async listObjects(bucketId, params = {}) {
|
|
7537
|
-
const query2 =
|
|
8294
|
+
const query2 = stripUndefined26({
|
|
7538
8295
|
prefix: params.prefix,
|
|
7539
8296
|
max_keys: params.max_keys ?? params.maxKeys ?? params.limit,
|
|
7540
8297
|
marker: params.marker ?? params.cursor
|
|
@@ -7568,7 +8325,7 @@ var Storage = class {
|
|
|
7568
8325
|
// ── Presigned URLs ─────────────────────────────────────────────────────────
|
|
7569
8326
|
async presign(bucketId, params) {
|
|
7570
8327
|
const operationMethod = params.operation === "put" ? "PUT" : params.operation === "get" ? "GET" : void 0;
|
|
7571
|
-
const body4 =
|
|
8328
|
+
const body4 = stripUndefined26({
|
|
7572
8329
|
key: params.key,
|
|
7573
8330
|
method: params.method ?? operationMethod ?? "GET",
|
|
7574
8331
|
expires_in: params.expiresIn ?? params.expires_in ?? params.expiresInSec ?? params.expires_in_sec ?? 3600
|
|
@@ -7577,7 +8334,7 @@ var Storage = class {
|
|
|
7577
8334
|
`/storage/buckets/${bucketId}/presign`,
|
|
7578
8335
|
body4
|
|
7579
8336
|
);
|
|
7580
|
-
return
|
|
8337
|
+
return unwrap47(data);
|
|
7581
8338
|
}
|
|
7582
8339
|
};
|
|
7583
8340
|
|
|
@@ -7667,7 +8424,7 @@ var OrgInvites = class {
|
|
|
7667
8424
|
};
|
|
7668
8425
|
|
|
7669
8426
|
// src/resources/tenant.ts
|
|
7670
|
-
function
|
|
8427
|
+
function unwrap48(payload) {
|
|
7671
8428
|
if (payload && typeof payload === "object") {
|
|
7672
8429
|
const p = payload;
|
|
7673
8430
|
for (const k of ["data", "tenant", "branding", "items"]) {
|
|
@@ -7676,7 +8433,7 @@ function unwrap46(payload) {
|
|
|
7676
8433
|
}
|
|
7677
8434
|
return payload;
|
|
7678
8435
|
}
|
|
7679
|
-
function
|
|
8436
|
+
function stripUndefined27(input) {
|
|
7680
8437
|
return Object.fromEntries(
|
|
7681
8438
|
Object.entries(input).filter(([, v]) => v !== void 0)
|
|
7682
8439
|
);
|
|
@@ -7689,14 +8446,14 @@ var PreviewDomain = class {
|
|
|
7689
8446
|
/** Get the tenant's white-label preview domain settings. */
|
|
7690
8447
|
async get() {
|
|
7691
8448
|
const data = await this.http.get("/tenant/preview-domain");
|
|
7692
|
-
return
|
|
8449
|
+
return unwrap48(data);
|
|
7693
8450
|
}
|
|
7694
8451
|
/** Set the tenant's white-label preview domain. */
|
|
7695
8452
|
async set(domain) {
|
|
7696
8453
|
const data = await this.http.put("/tenant/preview-domain", {
|
|
7697
8454
|
preview_domain: domain
|
|
7698
8455
|
});
|
|
7699
|
-
return
|
|
8456
|
+
return unwrap48(data);
|
|
7700
8457
|
}
|
|
7701
8458
|
/** Re-run DNS verification for the configured preview domain. */
|
|
7702
8459
|
async verify() {
|
|
@@ -7704,7 +8461,7 @@ var PreviewDomain = class {
|
|
|
7704
8461
|
"/tenant/preview-domain/verify",
|
|
7705
8462
|
{}
|
|
7706
8463
|
);
|
|
7707
|
-
return
|
|
8464
|
+
return unwrap48(data);
|
|
7708
8465
|
}
|
|
7709
8466
|
/** Remove the tenant's custom preview domain. */
|
|
7710
8467
|
async delete() {
|
|
@@ -7719,14 +8476,14 @@ var Branding = class {
|
|
|
7719
8476
|
/** Get tenant branding used by white-label hosted surfaces. */
|
|
7720
8477
|
async get() {
|
|
7721
8478
|
const data = await this.http.get("/tenant/branding");
|
|
7722
|
-
return
|
|
8479
|
+
return unwrap48(data);
|
|
7723
8480
|
}
|
|
7724
8481
|
/** Update tenant branding used by white-label hosted surfaces. */
|
|
7725
8482
|
async set(params) {
|
|
7726
8483
|
const data = await this.http.put("/tenant/branding", {
|
|
7727
|
-
branding:
|
|
8484
|
+
branding: stripUndefined27(params)
|
|
7728
8485
|
});
|
|
7729
|
-
return
|
|
8486
|
+
return unwrap48(data);
|
|
7730
8487
|
}
|
|
7731
8488
|
/** Reset tenant branding to platform defaults. */
|
|
7732
8489
|
async delete() {
|
|
@@ -7748,7 +8505,7 @@ var Tenant = class {
|
|
|
7748
8505
|
/** Get the current tenant's plan, limits, and live usage counters. */
|
|
7749
8506
|
async current() {
|
|
7750
8507
|
const data = await this.http.get("/tenant/plan");
|
|
7751
|
-
return
|
|
8508
|
+
return unwrap48(data);
|
|
7752
8509
|
}
|
|
7753
8510
|
/** Convenience alias for `tenant.branding.get()`. */
|
|
7754
8511
|
async getBranding() {
|
|
@@ -7765,7 +8522,7 @@ var Tenant = class {
|
|
|
7765
8522
|
};
|
|
7766
8523
|
|
|
7767
8524
|
// src/resources/usage.ts
|
|
7768
|
-
function
|
|
8525
|
+
function unwrap49(payload) {
|
|
7769
8526
|
if (payload && typeof payload === "object") {
|
|
7770
8527
|
const p = payload;
|
|
7771
8528
|
for (const k of ["data", "usage", "sessions", "summary", "items"]) {
|
|
@@ -7774,7 +8531,7 @@ function unwrap47(payload) {
|
|
|
7774
8531
|
}
|
|
7775
8532
|
return payload;
|
|
7776
8533
|
}
|
|
7777
|
-
function
|
|
8534
|
+
function stripUndefined28(input) {
|
|
7778
8535
|
return Object.fromEntries(
|
|
7779
8536
|
Object.entries(input).filter(([, v]) => v !== void 0)
|
|
7780
8537
|
);
|
|
@@ -7787,24 +8544,24 @@ var Usage = class {
|
|
|
7787
8544
|
/** Get the current period usage summary. */
|
|
7788
8545
|
async current() {
|
|
7789
8546
|
const data = await this.http.get("/usage/summary");
|
|
7790
|
-
return
|
|
8547
|
+
return unwrap49(data);
|
|
7791
8548
|
}
|
|
7792
8549
|
/** List per-session metering events. */
|
|
7793
8550
|
async sessions(params = {}) {
|
|
7794
|
-
const query2 =
|
|
8551
|
+
const query2 = stripUndefined28(params);
|
|
7795
8552
|
const data = await this.http.get("/usage/sessions", query2);
|
|
7796
|
-
const result =
|
|
8553
|
+
const result = unwrap49(data);
|
|
7797
8554
|
if (Array.isArray(result)) return result;
|
|
7798
8555
|
return [];
|
|
7799
8556
|
}
|
|
7800
8557
|
/** Get a usage report for a period. */
|
|
7801
8558
|
async report(params = {}) {
|
|
7802
|
-
const query2 =
|
|
8559
|
+
const query2 = stripUndefined28(params);
|
|
7803
8560
|
const data = await this.http.get("/usage/summary", query2);
|
|
7804
|
-
return
|
|
8561
|
+
return unwrap49(data);
|
|
7805
8562
|
}
|
|
7806
8563
|
};
|
|
7807
|
-
function
|
|
8564
|
+
function unwrap50(payload) {
|
|
7808
8565
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
7809
8566
|
return payload.data;
|
|
7810
8567
|
}
|
|
@@ -7820,7 +8577,7 @@ function listItems15(payload, candidateKeys = ["data", "volumes", "items"]) {
|
|
|
7820
8577
|
}
|
|
7821
8578
|
return [];
|
|
7822
8579
|
}
|
|
7823
|
-
function
|
|
8580
|
+
function stripUndefined29(input) {
|
|
7824
8581
|
return Object.fromEntries(
|
|
7825
8582
|
Object.entries(input).filter(([, v]) => v !== void 0)
|
|
7826
8583
|
);
|
|
@@ -7834,17 +8591,17 @@ var Volumes = class {
|
|
|
7834
8591
|
}
|
|
7835
8592
|
http;
|
|
7836
8593
|
async list(params = {}) {
|
|
7837
|
-
const query2 =
|
|
8594
|
+
const query2 = stripUndefined29({ ...params });
|
|
7838
8595
|
const data = await this.http.get("/volumes", query2);
|
|
7839
8596
|
return listItems15(data);
|
|
7840
8597
|
}
|
|
7841
8598
|
async get(volumeId) {
|
|
7842
8599
|
const data = await this.http.get(`/volumes/${volumeId}`);
|
|
7843
|
-
return
|
|
8600
|
+
return unwrap50(data);
|
|
7844
8601
|
}
|
|
7845
8602
|
async create(params) {
|
|
7846
8603
|
const { idempotencyKey: ikey, sizeGb, ...rest } = params;
|
|
7847
|
-
const body4 =
|
|
8604
|
+
const body4 = stripUndefined29({
|
|
7848
8605
|
...rest,
|
|
7849
8606
|
size_gb: sizeGb ?? rest.size_gb
|
|
7850
8607
|
});
|
|
@@ -7853,13 +8610,13 @@ var Volumes = class {
|
|
|
7853
8610
|
body: body4,
|
|
7854
8611
|
headers: { "Idempotency-Key": idempotencyKey9(ikey) }
|
|
7855
8612
|
});
|
|
7856
|
-
return
|
|
8613
|
+
return unwrap50(data);
|
|
7857
8614
|
}
|
|
7858
8615
|
async delete(volumeId) {
|
|
7859
8616
|
await this.http.delete(`/volumes/${volumeId}`);
|
|
7860
8617
|
}
|
|
7861
8618
|
};
|
|
7862
|
-
function
|
|
8619
|
+
function unwrap51(payload) {
|
|
7863
8620
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
7864
8621
|
return payload.data;
|
|
7865
8622
|
}
|
|
@@ -7875,7 +8632,7 @@ function listItems16(payload, candidateKeys = ["data", "webhooks", "deliveries",
|
|
|
7875
8632
|
}
|
|
7876
8633
|
return [];
|
|
7877
8634
|
}
|
|
7878
|
-
function
|
|
8635
|
+
function stripUndefined30(input) {
|
|
7879
8636
|
return Object.fromEntries(
|
|
7880
8637
|
Object.entries(input).filter(([, v]) => v !== void 0)
|
|
7881
8638
|
);
|
|
@@ -7920,28 +8677,28 @@ var Webhooks = class {
|
|
|
7920
8677
|
http;
|
|
7921
8678
|
static verifySignature = verifySignature;
|
|
7922
8679
|
async list(params = {}) {
|
|
7923
|
-
const query2 =
|
|
8680
|
+
const query2 = stripUndefined30({ ...params });
|
|
7924
8681
|
const data = await this.http.get("/webhooks", query2);
|
|
7925
8682
|
return listItems16(data);
|
|
7926
8683
|
}
|
|
7927
8684
|
async get(webhookId) {
|
|
7928
8685
|
const data = await this.http.get(`/webhooks/${webhookId}`);
|
|
7929
|
-
return
|
|
8686
|
+
return unwrap51(data);
|
|
7930
8687
|
}
|
|
7931
8688
|
async create(params) {
|
|
7932
8689
|
const { idempotencyKey: ikey, ...rest } = params;
|
|
7933
|
-
const body4 =
|
|
8690
|
+
const body4 = stripUndefined30(rest);
|
|
7934
8691
|
const data = await this.http.request("/webhooks", {
|
|
7935
8692
|
method: "POST",
|
|
7936
8693
|
body: body4,
|
|
7937
8694
|
headers: { "Idempotency-Key": idempotencyKey10(ikey) }
|
|
7938
8695
|
});
|
|
7939
|
-
return
|
|
8696
|
+
return unwrap51(data);
|
|
7940
8697
|
}
|
|
7941
8698
|
async update(webhookId, params) {
|
|
7942
|
-
const body4 =
|
|
8699
|
+
const body4 = stripUndefined30(params);
|
|
7943
8700
|
const data = await this.http.patch(`/webhooks/${webhookId}`, body4);
|
|
7944
|
-
return
|
|
8701
|
+
return unwrap51(data);
|
|
7945
8702
|
}
|
|
7946
8703
|
async delete(webhookId) {
|
|
7947
8704
|
await this.http.delete(`/webhooks/${webhookId}`);
|
|
@@ -7954,7 +8711,7 @@ var Webhooks = class {
|
|
|
7954
8711
|
headers: { "Idempotency-Key": idempotencyKey10(opts.idempotencyKey) }
|
|
7955
8712
|
}
|
|
7956
8713
|
);
|
|
7957
|
-
return
|
|
8714
|
+
return unwrap51(data);
|
|
7958
8715
|
}
|
|
7959
8716
|
async deliveries(webhookId) {
|
|
7960
8717
|
const data = await this.http.get(
|
|
@@ -8167,10 +8924,14 @@ var Miosa = class {
|
|
|
8167
8924
|
agentRunGroups;
|
|
8168
8925
|
/** Agent runtime profiles — tenant/workspace defaults for sandbox/computer agents. */
|
|
8169
8926
|
agentRuntimeProfiles;
|
|
8927
|
+
/** MIOSA Connect — provider connectors and runtime tokens. */
|
|
8928
|
+
connectors;
|
|
8170
8929
|
/** Inherited runtime env — tenant/workspace/project defaults for agent runtimes. */
|
|
8171
8930
|
runtimeEnv;
|
|
8172
8931
|
/** Runtime capabilities — live backend feature and contract discovery. */
|
|
8173
8932
|
runtimeCapabilities;
|
|
8933
|
+
/** Unified devices — sandbox workers and desktop computers behind one API. */
|
|
8934
|
+
devices;
|
|
8174
8935
|
/** Computer management — create, list, get, delete. */
|
|
8175
8936
|
computers;
|
|
8176
8937
|
/** Sandboxes — native code-execution environments under `/sandboxes`. */
|
|
@@ -8276,8 +9037,10 @@ var Miosa = class {
|
|
|
8276
9037
|
this.agentRuns = new AgentRuns(this.http);
|
|
8277
9038
|
this.agentRunGroups = new AgentRunGroups(this.http);
|
|
8278
9039
|
this.agentRuntimeProfiles = new AgentRuntimeProfiles(this.http);
|
|
9040
|
+
this.connectors = new Connectors(this.http);
|
|
8279
9041
|
this.runtimeEnv = new RuntimeEnv(this.http);
|
|
8280
9042
|
this.runtimeCapabilities = new RuntimeCapabilitiesResource(this.http);
|
|
9043
|
+
this.devices = new Devices(this.http);
|
|
8281
9044
|
this.computers = new Computers(this.http);
|
|
8282
9045
|
this.sandboxes = new Sandboxes(this.http);
|
|
8283
9046
|
this.deployments = new Deployments(this.http);
|
|
@@ -8467,6 +9230,6 @@ var AppAuth = class {
|
|
|
8467
9230
|
}
|
|
8468
9231
|
};
|
|
8469
9232
|
|
|
8470
|
-
export { Admin, AgentRunGroups, AgentRuns, AgentRuntimeProfiles, Analytics, ApiKeys, AppAuth, AuditLog, AuthError, Benchmarks, BuilderSessions, Channels, Checkpoints, CommandCenter, Community, Completions, Computer, ComputerAudit, ComputerAutoStop, ComputerEnv, ComputerInbox, ComputerLogs, ComputerNetwork, ComputerOsa, ComputerPorts, ComputerSecrets, ComputerTerminal, ComputerVolumes, Computers, Credits, CronJobs, Dashboard, Databases, DeploymentDomains, DeploymentReleases, DeploymentRuntimeInstances, DeploymentVersions, Deployments, Desktop, DockerDeploy, EgressAudit, EgressNetwork, EgressSecrets, Email, EmailCampaigns, EmailInbox, EmailTemplates, Embeddings, Exec, ExternalKeys, Files, FlatCustomDomains, Functions, HealthChecks, InsufficientCreditsError, Integrations, Mcp, Miosa, MiosaError, Models, NetworkError, NetworkPolicy, NotFoundError, OAuthFlow, OpenComputers, OrgInvites, ProjectAuth, ProjectIntegrations, ProviderDefaults, RateLimitError, Regions, RuntimeCapabilitiesResource, RuntimeEnv, SANDBOX_TEMPLATE, Sandbox, SandboxArtifacts, SandboxAudit, SandboxCommands, SandboxEnv, SandboxEvents, SandboxFiles, SandboxNetwork, SandboxPreview, SandboxPreviews, SandboxSecrets, SandboxTags, SandboxTemplates, SandboxTerminal, Sandboxes, ScopedFs, Settings, SnapshotsStandalone, Storage, Tenant, TimeoutError, Usage, ValidationError, Volumes, Webhooks, WorkspaceInvites, WorkspaceMembers, verifySignature };
|
|
9233
|
+
export { Admin, AgentRunGroups, AgentRuns, AgentRuntimeProfiles, Analytics, ApiKeys, AppAuth, AuditLog, AuthError, Benchmarks, BuilderSessions, Channels, Checkpoints, CommandCenter, Community, Completions, Computer, ComputerAudit, ComputerAutoStop, ComputerConnectors, ComputerEnv, ComputerInbox, ComputerLogs, ComputerNetwork, ComputerOsa, ComputerPorts, ComputerSecrets, ComputerTerminal, ComputerVolumes, Computers, Connectors, Credits, CronJobs, Dashboard, Databases, DeploymentConnectors, DeploymentDomains, DeploymentReleases, DeploymentRuntimeInstances, DeploymentVersions, Deployments, Desktop, Devices, DockerDeploy, EgressAudit, EgressHostNotAllowedError, EgressNetwork, EgressSecrets, Email, EmailCampaigns, EmailInbox, EmailTemplates, Embeddings, Exec, ExternalKeys, Files, FlatCustomDomains, Functions, HealthChecks, InstallationRequiredError, InsufficientCreditsError, Integrations, ManagedProviderBindingOnlyError, Mcp, Miosa, MiosaError, Models, NetworkError, NetworkPolicy, NotFoundError, OAuthFlow, OpenComputers, OrgInvites, ProjectAuth, ProjectIntegrations, ProjectNotLinkedError, ProviderDefaults, RateLimitError, Regions, RuntimeCapabilitiesResource, RuntimeEnv, SANDBOX_TEMPLATE, Sandbox, SandboxArtifacts, SandboxAudit, SandboxCommands, SandboxConnectors, SandboxEnv, SandboxEvents, SandboxFiles, SandboxNetwork, SandboxPreview, SandboxPreviews, SandboxSecrets, SandboxTags, SandboxTemplates, SandboxTerminal, Sandboxes, ScopeNotAllowedError, ScopedFs, Settings, SnapshotsStandalone, Storage, SubjectNotAllowedError, Tenant, TimeoutError, TokenRefreshFailedError, Usage, UserAuthorizationRequiredError, ValidationError, Volumes, Webhooks, WorkspaceInvites, WorkspaceMembers, verifySignature };
|
|
8471
9234
|
//# sourceMappingURL=index.js.map
|
|
8472
9235
|
//# sourceMappingURL=index.js.map
|