@miosa/sdk 1.2.1 → 1.2.3
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 +43 -1
- package/dist/index.d.ts +224 -8
- package/dist/index.js +398 -30
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/client.ts +5 -0
- package/src/index.ts +24 -2
- package/src/resources/admin.ts +11 -0
- package/src/resources/api-keys.ts +16 -0
- package/src/resources/custom_domains.ts +1 -1
- package/src/resources/deployments.test.ts +121 -0
- package/src/resources/deployments.ts +231 -1
- package/src/resources/docker-deploy.test.ts +102 -0
- package/src/resources/docker-deploy.ts +183 -0
- package/src/resources/governance.test.ts +355 -0
- package/src/resources/governance.ts +528 -0
- package/src/resources/phase1.test.ts +187 -0
- package/src/resources/quotas.ts +77 -0
- package/src/resources/sandbox-processes.ts +112 -0
- package/src/resources/sandbox-shares.ts +83 -0
- package/src/resources/sandboxes.test.ts +26 -0
- package/src/resources/sandboxes.ts +31 -0
- package/src/resources/tenant-events.ts +32 -0
- package/src/resources/tenant.ts +111 -2
- package/src/resources/webhooks.ts +54 -1
- package/src/resources/workspaces.ts +285 -0
- package/src/types.ts +5 -5
package/README.md
CHANGED
|
@@ -38,7 +38,7 @@ console.log(result.stdout); // hello from miosa
|
|
|
38
38
|
|
|
39
39
|
// Expose a live preview URL
|
|
40
40
|
const url = await sbx.expose(3000);
|
|
41
|
-
console.log(url); // https://3000-<slug>.sandbox
|
|
41
|
+
console.log(url); // https://3000-<slug>.sandbox.miosa.ai
|
|
42
42
|
|
|
43
43
|
await sbx.destroy();
|
|
44
44
|
```
|
|
@@ -99,6 +99,36 @@ await sbx.pause();
|
|
|
99
99
|
await sbx.resume();
|
|
100
100
|
```
|
|
101
101
|
|
|
102
|
+
## Publish from sandbox
|
|
103
|
+
|
|
104
|
+
Preview is mutable; publish creates a durable deployment version. Static output
|
|
105
|
+
is served by MIOSA's artifact plane. Dynamic apps run in reconciled runtime VMs.
|
|
106
|
+
|
|
107
|
+
```ts
|
|
108
|
+
const deployment = await sbx.deploy({
|
|
109
|
+
name: "clinic-intake",
|
|
110
|
+
outputPath: "/workspace/dist",
|
|
111
|
+
entrypoint: "index.html",
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
console.log(deployment.url ?? deployment.deployment?.public_url);
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
For dynamic/full-stack apps:
|
|
118
|
+
|
|
119
|
+
```ts
|
|
120
|
+
const deployment = await sbx.deploy({
|
|
121
|
+
name: "clinic-intake-api",
|
|
122
|
+
outputPath: "/workspace",
|
|
123
|
+
runCommand: "npm start",
|
|
124
|
+
port: 3000,
|
|
125
|
+
domain: "intake.apps.cliniciq.com",
|
|
126
|
+
});
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Always display the server-returned `url` / `public_url`. Do not hardcode
|
|
130
|
+
`preview.miosa.app`, `api.miosa.app`, or `<tenant>.miosa.app`.
|
|
131
|
+
|
|
102
132
|
## Desktop control (Computers)
|
|
103
133
|
|
|
104
134
|
```ts
|
|
@@ -136,6 +166,18 @@ const sandboxes = await miosa.sandboxes.list({
|
|
|
136
166
|
});
|
|
137
167
|
```
|
|
138
168
|
|
|
169
|
+
White-label domain layers are separate:
|
|
170
|
+
|
|
171
|
+
```text
|
|
172
|
+
sandbox preview: https://<port>-<slug>.sandbox.<preview-domain>
|
|
173
|
+
durable deployment: https://<slug>.<deployment-domain>
|
|
174
|
+
custom domain: https://app.customer.com
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
Tenant preview-domain management is available through `miosa.tenant.previewDomain`.
|
|
178
|
+
Tenant deployment-domain routing exists server-side; SDKs should consume
|
|
179
|
+
deployment `public_url` instead of reconstructing it.
|
|
180
|
+
|
|
139
181
|
## Error handling
|
|
140
182
|
|
|
141
183
|
```ts
|
package/dist/index.d.ts
CHANGED
|
@@ -155,6 +155,13 @@ declare class Admin {
|
|
|
155
155
|
optimalStatus(): Promise<Json>;
|
|
156
156
|
listOptimalModels(): Promise<Json>;
|
|
157
157
|
switchOptimalModel(modelId: string): Promise<Json>;
|
|
158
|
+
/** POST /api/v1/admin/impersonate — returns {token, expires_at}. */
|
|
159
|
+
impersonate(externalUserId: string, options?: {
|
|
160
|
+
ttlSec?: number;
|
|
161
|
+
}): Promise<{
|
|
162
|
+
token: string;
|
|
163
|
+
expires_at: string;
|
|
164
|
+
}>;
|
|
158
165
|
}
|
|
159
166
|
|
|
160
167
|
/**
|
|
@@ -221,6 +228,12 @@ declare class ApiKeys {
|
|
|
221
228
|
constructor(http: HttpClient);
|
|
222
229
|
list(params?: ApiKeyListParams): Promise<ApiKeyData[]>;
|
|
223
230
|
create(params: ApiKeyCreateParams): Promise<ApiKeyCreateResult>;
|
|
231
|
+
/** POST /api/v1/api-keys/scoped — L2 delegation token bound to one external user. */
|
|
232
|
+
createScoped(params: {
|
|
233
|
+
externalUserId: string;
|
|
234
|
+
scopes: string[];
|
|
235
|
+
expiresAt?: string;
|
|
236
|
+
}): Promise<ApiKeyCreateResult>;
|
|
224
237
|
delete(keyId: string): Promise<void>;
|
|
225
238
|
}
|
|
226
239
|
|
|
@@ -639,7 +652,7 @@ interface CustomDomainData$1 {
|
|
|
639
652
|
* // 1. Register the domain
|
|
640
653
|
* const domain = await computer.domains.register("app.example.com");
|
|
641
654
|
* console.log(domain.instructions);
|
|
642
|
-
* // => "Add a CNAME record: app.example.com → <slug>.sandbox
|
|
655
|
+
* // => "Add a CNAME record: app.example.com → <slug>.sandbox.miosa.ai"
|
|
643
656
|
*
|
|
644
657
|
* // 2. Add the CNAME in your DNS registrar, then...
|
|
645
658
|
*
|
|
@@ -755,9 +768,9 @@ interface ComputerData {
|
|
|
755
768
|
id: ComputerId;
|
|
756
769
|
name: string;
|
|
757
770
|
/**
|
|
758
|
-
* URL-safe identifier used in preview URLs:
|
|
759
|
-
*
|
|
760
|
-
*
|
|
771
|
+
* URL-safe identifier used in preview URLs: `https://{port}-{slug}.sandbox.{preview_domain}`.
|
|
772
|
+
* Falls back to the computer id when no slug is assigned. The domain is the
|
|
773
|
+
* tenant's white-label `preview_domain` (server-provided) — never hardcode it.
|
|
761
774
|
*/
|
|
762
775
|
slug: string;
|
|
763
776
|
status: ComputerStatus;
|
|
@@ -768,9 +781,9 @@ interface ComputerData {
|
|
|
768
781
|
metadata: Record<string, string>;
|
|
769
782
|
/** Controls who can access the HTTP preview URL. Defaults to `"public"`. */
|
|
770
783
|
visibility: ComputerVisibility;
|
|
771
|
-
/** Public ingress root, e.g. `https://<slug>.sandbox.<preview_domain
|
|
784
|
+
/** Public ingress root, e.g. `https://<slug>.sandbox.<preview_domain>` (server-provided). */
|
|
772
785
|
sandbox_url?: string;
|
|
773
|
-
/** Tenant's white-label preview/base domain
|
|
786
|
+
/** Tenant's white-label preview/base domain (e.g. `cliniciq.com`). Use to build preview URLs. */
|
|
774
787
|
preview_domain?: string;
|
|
775
788
|
/** KasmVNC URL for desktop templates. */
|
|
776
789
|
desktop_url?: string;
|
|
@@ -2535,6 +2548,90 @@ declare class Databases {
|
|
|
2535
2548
|
streamLogs(databaseId: string): AsyncIterableIterator<unknown>;
|
|
2536
2549
|
}
|
|
2537
2550
|
|
|
2551
|
+
type DockerDeployHostId = string & {
|
|
2552
|
+
readonly __brand: "DockerDeployHostId";
|
|
2553
|
+
};
|
|
2554
|
+
type DockerDeployHostStatus = "pending" | "provisioning" | "bootstrapping" | "active" | "degraded" | "suspended" | "retired" | "error";
|
|
2555
|
+
type DockerDeployApplianceStatus = "not_installed" | "installing" | "starting" | "healthy" | "unhealthy" | "unknown";
|
|
2556
|
+
interface DockerDeployHostData {
|
|
2557
|
+
id: DockerDeployHostId;
|
|
2558
|
+
tenant_id: string;
|
|
2559
|
+
workspace_id: string;
|
|
2560
|
+
external_workspace_id?: string | null;
|
|
2561
|
+
computer_id?: string | null;
|
|
2562
|
+
fleet_node_id?: string | null;
|
|
2563
|
+
status: DockerDeployHostStatus;
|
|
2564
|
+
size: string;
|
|
2565
|
+
region: string;
|
|
2566
|
+
portal_domain?: string | null;
|
|
2567
|
+
runtime_base_url?: string | null;
|
|
2568
|
+
agent_base_url?: string | null;
|
|
2569
|
+
appliance_image?: string | null;
|
|
2570
|
+
appliance_version?: string | null;
|
|
2571
|
+
appliance_status: DockerDeployApplianceStatus;
|
|
2572
|
+
agent_last_seen_at?: string | null;
|
|
2573
|
+
metadata?: Record<string, unknown>;
|
|
2574
|
+
created_at?: string;
|
|
2575
|
+
updated_at?: string;
|
|
2576
|
+
}
|
|
2577
|
+
interface DockerDeployHostListParams {
|
|
2578
|
+
workspace_id?: string;
|
|
2579
|
+
workspaceId?: string;
|
|
2580
|
+
}
|
|
2581
|
+
interface DockerDeployHostEnsureParams {
|
|
2582
|
+
workspace_id?: string;
|
|
2583
|
+
workspaceId?: string;
|
|
2584
|
+
external_workspace_id?: string;
|
|
2585
|
+
externalWorkspaceId?: string;
|
|
2586
|
+
}
|
|
2587
|
+
interface DockerDeployHostListResponse {
|
|
2588
|
+
data?: DockerDeployHostData[];
|
|
2589
|
+
hosts?: DockerDeployHostData[];
|
|
2590
|
+
}
|
|
2591
|
+
interface DockerDeployHostResponse {
|
|
2592
|
+
data?: DockerDeployHostData;
|
|
2593
|
+
host?: DockerDeployHostData;
|
|
2594
|
+
queued?: boolean;
|
|
2595
|
+
}
|
|
2596
|
+
interface DockerDeployTemplate {
|
|
2597
|
+
id: string;
|
|
2598
|
+
name: string;
|
|
2599
|
+
description?: string;
|
|
2600
|
+
category?: string;
|
|
2601
|
+
runtime?: string;
|
|
2602
|
+
tags?: string[];
|
|
2603
|
+
metadata?: Record<string, unknown>;
|
|
2604
|
+
[key: string]: unknown;
|
|
2605
|
+
}
|
|
2606
|
+
declare class DockerDeploy {
|
|
2607
|
+
private readonly http;
|
|
2608
|
+
constructor(http: HttpClient);
|
|
2609
|
+
/**
|
|
2610
|
+
* List Docker Deploy appliance hosts scoped to the current tenant.
|
|
2611
|
+
*
|
|
2612
|
+
* Pass a workspace ID to inspect the dedicated always-on appliance machine
|
|
2613
|
+
* for one white-label workspace.
|
|
2614
|
+
*/
|
|
2615
|
+
listHosts(params?: DockerDeployHostListParams): Promise<DockerDeployHostData[]>;
|
|
2616
|
+
/**
|
|
2617
|
+
* Ensure a workspace has its dedicated Docker Deploy appliance host.
|
|
2618
|
+
*
|
|
2619
|
+
* The host may still be `pending`, `provisioning`, or `bootstrapping` after
|
|
2620
|
+
* this call. Treat `status === "active"` and `appliance_status === "healthy"`
|
|
2621
|
+
* as the ready condition before sending app/container traffic to it.
|
|
2622
|
+
*/
|
|
2623
|
+
ensureHost(params?: DockerDeployHostEnsureParams): Promise<{
|
|
2624
|
+
host: DockerDeployHostData;
|
|
2625
|
+
queued: boolean;
|
|
2626
|
+
}>;
|
|
2627
|
+
/** Fetch one Docker Deploy host by ID. */
|
|
2628
|
+
getHost(hostId: string): Promise<DockerDeployHostData>;
|
|
2629
|
+
/** List Docker Deploy starter templates. */
|
|
2630
|
+
listTemplates(): Promise<DockerDeployTemplate[]>;
|
|
2631
|
+
/** Fetch one Docker Deploy starter template by ID. */
|
|
2632
|
+
getTemplate(templateId: string): Promise<DockerDeployTemplate>;
|
|
2633
|
+
}
|
|
2634
|
+
|
|
2538
2635
|
/**
|
|
2539
2636
|
* Deployments resource — sandbox→production publishing surface.
|
|
2540
2637
|
*
|
|
@@ -2566,6 +2663,7 @@ type DeploymentState = "pending" | "building" | "running" | "stopped" | "failed"
|
|
|
2566
2663
|
type DeploymentVersionKind = "static" | "dynamic" | "sandbox_backed";
|
|
2567
2664
|
type DeploymentVersionState = "created" | "building" | "ready" | "failed" | "archived";
|
|
2568
2665
|
type DeploymentSourceType = "repo" | "sandbox" | "upload";
|
|
2666
|
+
type DeploymentProduct = "miosa_deploy" | "docker_deploy";
|
|
2569
2667
|
type DeploymentServiceType = "static_web" | "web" | "api" | "function" | "worker" | "cron" | "postgres" | "redis" | "bucket" | "volume";
|
|
2570
2668
|
type RuntimeInstanceState = "provisioning" | "starting" | "healthy" | "unhealthy" | "error" | "stopped" | "destroyed";
|
|
2571
2669
|
interface ExternalAttribution {
|
|
@@ -2599,6 +2697,8 @@ interface DeploymentData {
|
|
|
2599
2697
|
auto_deploy?: boolean;
|
|
2600
2698
|
custom_domain_id?: string | null;
|
|
2601
2699
|
linked_database_id?: string | null;
|
|
2700
|
+
deployment_product?: DeploymentProduct | string | null;
|
|
2701
|
+
docker_deploy_host_id?: string | null;
|
|
2602
2702
|
metadata?: Record<string, unknown>;
|
|
2603
2703
|
external_workspace_id?: string | null;
|
|
2604
2704
|
external_user_id?: string | null;
|
|
@@ -2607,8 +2707,33 @@ interface DeploymentData {
|
|
|
2607
2707
|
created_at?: string;
|
|
2608
2708
|
updated_at?: string;
|
|
2609
2709
|
}
|
|
2710
|
+
interface DockerDeployDoctorCheck {
|
|
2711
|
+
name: string;
|
|
2712
|
+
ok: boolean;
|
|
2713
|
+
message: string;
|
|
2714
|
+
details?: Record<string, unknown>;
|
|
2715
|
+
}
|
|
2716
|
+
interface DockerDeployDoctorProbe {
|
|
2717
|
+
url: string;
|
|
2718
|
+
ok: boolean;
|
|
2719
|
+
status?: number;
|
|
2720
|
+
error?: string;
|
|
2721
|
+
}
|
|
2722
|
+
interface DockerDeployDoctorResult {
|
|
2723
|
+
ok: boolean;
|
|
2724
|
+
deployment: DeploymentData;
|
|
2725
|
+
host?: DockerDeployHostData;
|
|
2726
|
+
checks: DockerDeployDoctorCheck[];
|
|
2727
|
+
probe?: DockerDeployDoctorProbe;
|
|
2728
|
+
}
|
|
2729
|
+
interface DockerDeployDoctorParams {
|
|
2730
|
+
probePath?: string;
|
|
2731
|
+
probe_path?: string;
|
|
2732
|
+
timeoutMs?: number;
|
|
2733
|
+
timeout_ms?: number;
|
|
2734
|
+
}
|
|
2610
2735
|
type DeploymentDatabaseRequest = boolean | {
|
|
2611
|
-
engine?: "postgresql" | "mysql" | "redis";
|
|
2736
|
+
engine?: "postgresql" | "mysql" | "redis" | "qdrant";
|
|
2612
2737
|
size?: "xs" | "small" | "medium" | "large";
|
|
2613
2738
|
storage_mb?: number;
|
|
2614
2739
|
region?: string;
|
|
@@ -2760,6 +2885,8 @@ interface DeploymentCreateParams extends ExternalAttribution {
|
|
|
2760
2885
|
metadata?: Record<string, unknown>;
|
|
2761
2886
|
idempotencyKey?: string;
|
|
2762
2887
|
}
|
|
2888
|
+
interface DockerDeployCreateParams extends DeploymentCreateParams {
|
|
2889
|
+
}
|
|
2763
2890
|
interface DeploymentUpdateParams {
|
|
2764
2891
|
name?: string;
|
|
2765
2892
|
branch?: string;
|
|
@@ -2884,6 +3011,18 @@ declare class Deployments {
|
|
|
2884
3011
|
list(params?: DeploymentListParams): Promise<DeploymentData[]>;
|
|
2885
3012
|
get(deploymentId: string): Promise<DeploymentData>;
|
|
2886
3013
|
create(params: DeploymentCreateParams): Promise<DeploymentData>;
|
|
3014
|
+
/**
|
|
3015
|
+
* Create a deployment that runs on the workspace's dedicated Docker Deploy
|
|
3016
|
+
* runtime. It uses the same /deployments API as MIOSA Deploy, but marks the
|
|
3017
|
+
* deployment so the control plane attaches it to the workspace Docker host.
|
|
3018
|
+
*/
|
|
3019
|
+
createDockerDeploy(params: DockerDeployCreateParams): Promise<DeploymentData>;
|
|
3020
|
+
/**
|
|
3021
|
+
* Verify a Docker Deploy deployment before telling a user or agent it is
|
|
3022
|
+
* live. Checks product markers, appliance host health, route metadata, and
|
|
3023
|
+
* optionally probes the public URL.
|
|
3024
|
+
*/
|
|
3025
|
+
doctorDockerDeploy(deploymentId: string, params?: DockerDeployDoctorParams): Promise<DockerDeployDoctorResult>;
|
|
2887
3026
|
update(deploymentId: string, params: DeploymentUpdateParams): Promise<DeploymentData>;
|
|
2888
3027
|
delete(deploymentId: string): Promise<void>;
|
|
2889
3028
|
publish(deploymentId: string, params: PublishParams): Promise<PublishResult>;
|
|
@@ -4552,6 +4691,21 @@ interface SandboxDeployParams {
|
|
|
4552
4691
|
sourceSnapshotPath?: string;
|
|
4553
4692
|
source_snapshot_path?: string;
|
|
4554
4693
|
entrypoint?: string;
|
|
4694
|
+
buildCommand?: string;
|
|
4695
|
+
build_command?: string;
|
|
4696
|
+
runCommand?: string;
|
|
4697
|
+
run_command?: string;
|
|
4698
|
+
startCommand?: string;
|
|
4699
|
+
start_command?: string;
|
|
4700
|
+
port?: number;
|
|
4701
|
+
healthCheckPath?: string;
|
|
4702
|
+
health_check_path?: string;
|
|
4703
|
+
deploymentType?: "miosa_deploy" | "docker_deploy" | "docker-deploy" | string;
|
|
4704
|
+
deployment_type?: "miosa_deploy" | "docker_deploy" | "docker-deploy" | string;
|
|
4705
|
+
type?: "static" | "dynamic" | "server" | string;
|
|
4706
|
+
mode?: "static" | "dynamic" | "server" | string;
|
|
4707
|
+
database?: boolean | Record<string, unknown>;
|
|
4708
|
+
resources?: Record<string, unknown>;
|
|
4555
4709
|
domain?: string;
|
|
4556
4710
|
customDomain?: string;
|
|
4557
4711
|
custom_domain?: string;
|
|
@@ -4743,6 +4897,7 @@ declare class Sandbox {
|
|
|
4743
4897
|
pause(): Promise<Sandbox>;
|
|
4744
4898
|
resume(): Promise<Sandbox>;
|
|
4745
4899
|
deploy(params?: SandboxDeployParams): Promise<Record<string, unknown>>;
|
|
4900
|
+
deployDocker(params?: SandboxDeployParams): Promise<Record<string, unknown>>;
|
|
4746
4901
|
/** Check readiness of the sandbox (GET /sandboxes/:id/readiness). */
|
|
4747
4902
|
readiness(): Promise<Record<string, unknown>>;
|
|
4748
4903
|
/**
|
|
@@ -5135,11 +5290,62 @@ interface TenantPlan {
|
|
|
5135
5290
|
usage?: Record<string, unknown>;
|
|
5136
5291
|
[key: string]: unknown;
|
|
5137
5292
|
}
|
|
5293
|
+
interface PreviewDomainData {
|
|
5294
|
+
preview_domain?: string | null;
|
|
5295
|
+
default_domain?: string;
|
|
5296
|
+
status?: string;
|
|
5297
|
+
dns_status?: string;
|
|
5298
|
+
cname_target?: string | null;
|
|
5299
|
+
dns_instructions?: unknown;
|
|
5300
|
+
[key: string]: unknown;
|
|
5301
|
+
}
|
|
5302
|
+
interface TenantBrandingUpdateParams {
|
|
5303
|
+
product_name?: string;
|
|
5304
|
+
logo_url?: string;
|
|
5305
|
+
support_url?: string;
|
|
5306
|
+
support_email?: string;
|
|
5307
|
+
primary_color?: string;
|
|
5308
|
+
background_color?: string;
|
|
5309
|
+
[key: string]: unknown;
|
|
5310
|
+
}
|
|
5311
|
+
type BrandingData = TenantBrandingUpdateParams;
|
|
5312
|
+
declare class PreviewDomain {
|
|
5313
|
+
private readonly http;
|
|
5314
|
+
constructor(http: HttpClient);
|
|
5315
|
+
/** Get the tenant's white-label preview domain settings. */
|
|
5316
|
+
get(): Promise<PreviewDomainData>;
|
|
5317
|
+
/** Set the tenant's white-label preview domain. */
|
|
5318
|
+
set(domain: string): Promise<PreviewDomainData>;
|
|
5319
|
+
/** Re-run DNS verification for the configured preview domain. */
|
|
5320
|
+
verify(): Promise<PreviewDomainData>;
|
|
5321
|
+
/** Remove the tenant's custom preview domain. */
|
|
5322
|
+
delete(): Promise<void>;
|
|
5323
|
+
}
|
|
5324
|
+
declare class Branding {
|
|
5325
|
+
private readonly http;
|
|
5326
|
+
constructor(http: HttpClient);
|
|
5327
|
+
/** Get tenant branding used by white-label hosted surfaces. */
|
|
5328
|
+
get(): Promise<BrandingData>;
|
|
5329
|
+
/** Update tenant branding used by white-label hosted surfaces. */
|
|
5330
|
+
set(params: TenantBrandingUpdateParams): Promise<BrandingData>;
|
|
5331
|
+
/** Reset tenant branding to platform defaults. */
|
|
5332
|
+
delete(): Promise<void>;
|
|
5333
|
+
}
|
|
5138
5334
|
declare class Tenant {
|
|
5139
5335
|
private readonly http;
|
|
5336
|
+
readonly preview_domain: PreviewDomain;
|
|
5337
|
+
readonly branding: Branding;
|
|
5338
|
+
/** camelCase alias for SDK consumers that avoid snake_case properties. */
|
|
5339
|
+
readonly previewDomain: PreviewDomain;
|
|
5140
5340
|
constructor(http: HttpClient);
|
|
5141
5341
|
/** Get the current tenant's plan, limits, and live usage counters. */
|
|
5142
5342
|
current(): Promise<TenantPlan>;
|
|
5343
|
+
/** Convenience alias for `tenant.branding.get()`. */
|
|
5344
|
+
getBranding(): Promise<BrandingData>;
|
|
5345
|
+
/** Convenience alias for `tenant.branding.set(...)`. */
|
|
5346
|
+
setBranding(params: TenantBrandingUpdateParams): Promise<BrandingData>;
|
|
5347
|
+
/** Convenience alias for `tenant.branding.delete()`. */
|
|
5348
|
+
deleteBranding(): Promise<void>;
|
|
5143
5349
|
}
|
|
5144
5350
|
|
|
5145
5351
|
/**
|
|
@@ -5277,9 +5483,17 @@ interface WebhookUpdateParams {
|
|
|
5277
5483
|
enabled?: boolean;
|
|
5278
5484
|
[key: string]: unknown;
|
|
5279
5485
|
}
|
|
5486
|
+
/**
|
|
5487
|
+
* Verify the `Miosa-Signature` webhook header.
|
|
5488
|
+
*
|
|
5489
|
+
* Header format: `t=<unix_seconds>,v1=<hex_hmac>`.
|
|
5490
|
+
* Signed payload: `<timestamp>.<raw_body>`.
|
|
5491
|
+
*/
|
|
5492
|
+
declare function verifySignature(body: Buffer | Uint8Array | string, header: string, secret: string, toleranceSec?: number): boolean;
|
|
5280
5493
|
declare class Webhooks {
|
|
5281
5494
|
private readonly http;
|
|
5282
5495
|
constructor(http: HttpClient);
|
|
5496
|
+
static verifySignature: typeof verifySignature;
|
|
5283
5497
|
list(params?: WebhookListParams): Promise<WebhookData[]>;
|
|
5284
5498
|
get(webhookId: string): Promise<WebhookData>;
|
|
5285
5499
|
create(params: WebhookCreateParams): Promise<WebhookData>;
|
|
@@ -5566,6 +5780,8 @@ declare class Miosa {
|
|
|
5566
5780
|
* Versions, releases, rollback, custom domains.
|
|
5567
5781
|
*/
|
|
5568
5782
|
readonly deployments: Deployments;
|
|
5783
|
+
/** Docker Deploy appliance hosts — one always-on workspace host, many apps. */
|
|
5784
|
+
readonly dockerDeploy: DockerDeploy;
|
|
5569
5785
|
/** Credit balance and usage. */
|
|
5570
5786
|
readonly credits: Credits;
|
|
5571
5787
|
/** Admin surface (`/api/v1/admin/*`) — requires an admin credential. */
|
|
@@ -5666,4 +5882,4 @@ declare class NetworkError extends MiosaError {
|
|
|
5666
5882
|
constructor(message: string, cause: Error);
|
|
5667
5883
|
}
|
|
5668
5884
|
|
|
5669
|
-
export { type AcceptOrgInviteResponse, type AcceptWorkspaceInviteResponse, type AddDomainParams, type AddWorkspaceMemberParams, Admin, type AgentDispatchParams, type AgentEvent$1 as AgentEvent, type AgentEventType, type AgentSessionCreateParams, type AgentSessionData, type AgentSessionListResponse$1 as AgentSessionListResponse, type AgentSessionStatus$1 as AgentSessionStatus, type AllowParams, Analytics, type AnalyticsFilters, type ApiKeyCreateParams, type ApiKeyCreateResult, type ApiKeyData, type ApiKeyId, type ApiKeyListParams, ApiKeys, type AppCatalogEntry, type AppInstallData, type AppInstallEvent, type AuditListParams, AuditLog, type AuditLogEvent, type AuditLogListParams, type AuditTailParams, AuthError, type BenchmarkCompareParams, type BenchmarkCreateParams, Benchmarks, type BindingCreateParams, type BindingListParams, type BrandingUpdateParams, type BucketCreateParams, type BucketData, type BucketId, type BuilderSessionListParams, BuilderSessions, type BulkUserActionParams, type ChannelCreateParams, type ChannelData, type ChannelListParams, type ChannelUpdateParams, Channels, type ChatCompletionCreateParams, type ChatCompletionCreateStreamParams, Checkpoints, type ClickParams, type ClusterCreateParams, type ClusterData, type ClusterEvent, type ClusterId, type ClusterListResponse, type ClusterStatus, CommandCenter, Community, type CompletionCreateParams, type CompletionCreateStreamParams, Completions, Computer, ComputerAudit, ComputerAutoStop, type ComputerCreateParams, type ComputerData, ComputerEnv, type ComputerId, ComputerInbox, type ComputerListParams, type ComputerListResponse, ComputerLogs, type ComputerLogsGetParams, ComputerNetwork, ComputerOsa, ComputerPorts, ComputerSecrets, type ComputerSize, type ComputerStatus, type ComputerTemplateType, ComputerTerminal, type ComputerUpdateParams, type ComputerVisibility, ComputerVolumes, Computers, type CopyParams, type CreateAdminApiKeyParams, type CreateOrgInviteParams, type CreateWorkspaceInviteParams, type CreateWorkspaceInviteResponse, type CreditBalance, type CreditTransaction, type CreditTransactionListResponse, type CreditUsage, Credits, type CronJobCreateParams, type CronJobData, type CronJobExecutionData, type CronJobExecutionId, type CronJobId, type CronJobListParams, type CronJobUpdateParams, CronJobs, type CursorInfo, type CustomDomainCreateParams, type CustomDomainData, type CustomDomainId, type CustomDomainListParams, Dashboard, type DashboardSummary, type DatabaseCreateParams, type DatabaseCredentials, type DatabaseData, type DatabaseId, type DatabaseListParams, type DatabaseLogsParams, type DatabaseLogsResult, Databases, type DeploymentBuildData, type DeploymentCreateParams, type DeploymentData, DeploymentDomains, type DeploymentId, type DeploymentListParams, type DeploymentReleaseData, type DeploymentReleaseId, DeploymentReleases, DeploymentRuntimeInstances, type DeploymentServiceData, type DeploymentServiceId, type DeploymentServiceType, type DeploymentSourceType, type DeploymentState, type DeploymentUpdateParams, type DeploymentVersionData, type DeploymentVersionId, type DeploymentVersionKind, type DeploymentVersionState, DeploymentVersions, Deployments, Desktop$1 as Desktop, type DesktopActionResult, type DirEntry, type DirListResult, type DiscordSendTestParams, type DoubleClickParams, type DragParams, type EgressAllowlistRule, EgressAudit, type EgressAuditEvent, type EgressBindingData, EgressNetwork, type EgressPolicyData, type EgressPolicyMode, type EgressRuleEffect, type EgressSecretData, type EgressSecretScope, type EgressSecretType, EgressSecrets, type EgressSuggestion, Email, EmailCampaigns, EmailInbox, EmailTemplates, type EmbeddingCreateParams, Embeddings, Exec, type ExecParams, type ExecPythonParams, type ExecResult, type ExternalAttribution, type ExternalKeyCreateParams, type ExternalKeyData, ExternalKeys, type FileDeleteParams, type FileDownloadParams, type FileEntry, type FileExportParams, type FileExportResult, type FileListParams, type FileListResult, type FileStat, Files, FlatCustomDomains, type FsEntry, type FsListResponse, type FsStat, type FunctionCreateParams, type FunctionData, type FunctionId, type FunctionInvokeParams, type FunctionListParams, type FunctionUpdateParams, Functions, type GithubRepo, type GithubSshKey, type HealthCheckCreateParams, type HealthCheckData, type HealthCheckId, type HealthCheckListParams, type HealthCheckUpdateParams, HealthChecks, type HostCreateParams, type HostData, type HostEvent, type HostId, type HostListResponse, type HostStatus, type HostUpdateParams, InsufficientCreditsError, type IntegrationCatalogEntry, type IntegrationData, Integrations, type JobData, type JobEvent, type JobEventType, type JobId, type JobListResponse, type JobRunParams, type JobStatus, type KeyParams, type LaunchParams, type LinearCreateIssueParams, type ListAdminApiKeysParams, type ListAdminComputersParams, type ListAdminTenantsParams, type ListAdminUsersParams, Mcp, type McpDispatchParams, Miosa, type MiosaClientConfig, MiosaError, type MkdirParams, type ModeParams, Models, type MouseButton, NetworkError, NetworkPolicy, type NetworkPolicyData, type NetworkPolicyEffect, type NetworkPolicyProtocol, type NetworkPolicyRule, type NetworkPolicySetParams, NotFoundError, type NotificationPrefsUpdateParams, OAuthFlow, type OauthConnectParams, type OauthProvider, type OauthStartResult, type OauthStatusResult, type ObjectListParams, type AgentEvent as OcAgentEvent, type OcAgentSessionData, type AgentSessionListResponse as OcAgentSessionListResponse, type OcWorkspaceCreateParams, type OcWorkspaceData, type OcWorkspaceEvent, type OcWorkspaceListResponse, type OcWorkspaceStatus, type OcWorkspaceUpdateParams, OpenComputers, type OrgInvite, type OrgInviteCreated, type OrgInviteCreatedResponse, type OrgInviteListResponse, type OrgInvitePreview, type OrgInviteRevokeResponse, OrgInvites, type OrgRole, type OverviewData, type PolicyCreateParams, type PolicyListParams, type PolicyUpdateParams, type PresignParams, type PresignResult, ProjectAuth, type ProjectAuthEnableParams, type ProjectAuthStatus, type ProjectAuthUpdateParams, type ProjectIntegrationCatalogEntry, type ProjectIntegrationCreateParams, type ProjectIntegrationData, type ProjectIntegrationListParams, type ProjectIntegrationUpdateParams, ProjectIntegrations, ProviderDefaults, type ProviderKeyUpsertParams, type PublishFromSandboxParams, type PublishParams, type PublishResult, RateLimitError, type RegionData, Regions, type RollbackParams, type RulesListParams, type RuntimeInstanceData, type RuntimeInstanceId, type RuntimeInstanceState, type RuntimeLogsResult, SANDBOX_TEMPLATE, Sandbox, SandboxArtifacts, SandboxAudit, type SandboxBuildSpec, type SandboxBuildSpecError, type SandboxBuildSpecValidation, SandboxCommands, type SandboxCreateParams, type SandboxData, SandboxEnv, SandboxEvents, type SandboxExecOptions, type SandboxExecResult, SandboxFiles, type SandboxId, type SandboxListParams, SandboxNetwork, SandboxPreview, SandboxPreviews, SandboxSecrets, type SandboxState, SandboxTags, type SandboxTemplate, type SandboxTemplateBuild, type SandboxTemplateBuildCreateParams, type SandboxTemplateBuildResourceData, type SandboxTemplateBuildResourceId, type SandboxTemplateCreateParams, type SandboxTemplateList, type SandboxTemplateListParams, type SandboxTemplateResourceData, type SandboxTemplateResourceId, SandboxTemplates, SandboxTerminal, Sandboxes, ScopedFs, type ScrollDirection, type ScrollParams, type SecretCreateParams, type SecretData, type SecretId, type SecretListParams, type SecretRotateParams, type SecretSetParams, type SecretUpdateParams, type SessionId, Settings, type SettingsUpdateParams, type SizeData, type SlackSendTestParams, type SnapshotCreateParams, type SnapshotData, type SnapshotListResponse, type SnapshotProgressEvent, type SnapshotRestoreResult, type SnapshotStatus, SnapshotsStandalone, Storage, type StorageObjectData, type SuggestionsParams, type TemplateBuildCreateParams, type TemplateCreateParams, type TemplateData, Tenant, type TenantId, type TenantPlan, type TenantSummary, type TerminalCreateParams, TimeoutError, type TimeseriesParams, type TunnelAuthMode, type TunnelCreateParams, type TunnelData, type TunnelId, type TunnelListResponse, type TunnelUpdateParams, type TypeParams, type UpdateWorkspaceMemberRoleParams, Usage, type UsageReportParams, type UsageSession, type UsageSessionsParams, type UsageSummary, ValidationError, type VersionListParams, type VolumeCreateParams, type VolumeData, type VolumeId, type VolumeListParams, Volumes, type WaitParams, type WebhookCreateParams, type WebhookData, type WebhookDeliveryData, type WebhookDeliveryId, type WebhookId, type WebhookListParams, type WebhookUpdateParams, Webhooks, type WindowFocusParams, type WindowInfo, type WorkspaceId, type WorkspaceInvite, type WorkspaceInviteCreatedResponse, type WorkspaceInviteListResponse, type WorkspaceInvitePreview, type WorkspaceInviteRevokeResponse, WorkspaceInvites, type WorkspaceMember, type WorkspaceMemberAddedResponse, type WorkspaceMemberDeleteResponse, type WorkspaceMemberListResponse, type WorkspaceMemberRecord, type WorkspaceMemberRecordResponse, WorkspaceMembers, type WorkspaceRole, type WsTicket };
|
|
5885
|
+
export { type AcceptOrgInviteResponse, type AcceptWorkspaceInviteResponse, type AddDomainParams, type AddWorkspaceMemberParams, Admin, type AgentDispatchParams, type AgentEvent$1 as AgentEvent, type AgentEventType, type AgentSessionCreateParams, type AgentSessionData, type AgentSessionListResponse$1 as AgentSessionListResponse, type AgentSessionStatus$1 as AgentSessionStatus, type AllowParams, Analytics, type AnalyticsFilters, type ApiKeyCreateParams, type ApiKeyCreateResult, type ApiKeyData, type ApiKeyId, type ApiKeyListParams, ApiKeys, type AppCatalogEntry, type AppInstallData, type AppInstallEvent, type AuditListParams, AuditLog, type AuditLogEvent, type AuditLogListParams, type AuditTailParams, AuthError, type BenchmarkCompareParams, type BenchmarkCreateParams, Benchmarks, type BindingCreateParams, type BindingListParams, type BrandingData, type BrandingUpdateParams, type BucketCreateParams, type BucketData, type BucketId, type BuilderSessionListParams, BuilderSessions, type BulkUserActionParams, type ChannelCreateParams, type ChannelData, type ChannelListParams, type ChannelUpdateParams, Channels, type ChatCompletionCreateParams, type ChatCompletionCreateStreamParams, Checkpoints, type ClickParams, type ClusterCreateParams, type ClusterData, type ClusterEvent, type ClusterId, type ClusterListResponse, type ClusterStatus, CommandCenter, Community, type CompletionCreateParams, type CompletionCreateStreamParams, Completions, Computer, ComputerAudit, ComputerAutoStop, type ComputerCreateParams, type ComputerData, ComputerEnv, type ComputerId, ComputerInbox, type ComputerListParams, type ComputerListResponse, ComputerLogs, type ComputerLogsGetParams, ComputerNetwork, ComputerOsa, ComputerPorts, ComputerSecrets, type ComputerSize, type ComputerStatus, type ComputerTemplateType, ComputerTerminal, type ComputerUpdateParams, type ComputerVisibility, ComputerVolumes, Computers, type CopyParams, type CreateAdminApiKeyParams, type CreateOrgInviteParams, type CreateWorkspaceInviteParams, type CreateWorkspaceInviteResponse, type CreditBalance, type CreditTransaction, type CreditTransactionListResponse, type CreditUsage, Credits, type CronJobCreateParams, type CronJobData, type CronJobExecutionData, type CronJobExecutionId, type CronJobId, type CronJobListParams, type CronJobUpdateParams, CronJobs, type CursorInfo, type CustomDomainCreateParams, type CustomDomainData, type CustomDomainId, type CustomDomainListParams, Dashboard, type DashboardSummary, type DatabaseCreateParams, type DatabaseCredentials, type DatabaseData, type DatabaseId, type DatabaseListParams, type DatabaseLogsParams, type DatabaseLogsResult, Databases, type DeploymentBuildData, type DeploymentCreateParams, type DeploymentData, DeploymentDomains, type DeploymentId, type DeploymentListParams, type DeploymentProduct, type DeploymentReleaseData, type DeploymentReleaseId, DeploymentReleases, DeploymentRuntimeInstances, type DeploymentServiceData, type DeploymentServiceId, type DeploymentServiceType, type DeploymentSourceType, type DeploymentState, type DeploymentUpdateParams, type DeploymentVersionData, type DeploymentVersionId, type DeploymentVersionKind, type DeploymentVersionState, DeploymentVersions, Deployments, Desktop$1 as Desktop, type DesktopActionResult, type DirEntry, type DirListResult, type DiscordSendTestParams, DockerDeploy, type DockerDeployApplianceStatus, type DockerDeployCreateParams, type DockerDeployDoctorCheck, type DockerDeployDoctorParams, type DockerDeployDoctorProbe, type DockerDeployDoctorResult, type DockerDeployHostData, type DockerDeployHostEnsureParams, type DockerDeployHostId, type DockerDeployHostListParams, type DockerDeployHostListResponse, type DockerDeployHostResponse, type DockerDeployHostStatus, type DoubleClickParams, type DragParams, type EgressAllowlistRule, EgressAudit, type EgressAuditEvent, type EgressBindingData, EgressNetwork, type EgressPolicyData, type EgressPolicyMode, type EgressRuleEffect, type EgressSecretData, type EgressSecretScope, type EgressSecretType, EgressSecrets, type EgressSuggestion, Email, EmailCampaigns, EmailInbox, EmailTemplates, type EmbeddingCreateParams, Embeddings, Exec, type ExecParams, type ExecPythonParams, type ExecResult, type ExternalAttribution, type ExternalKeyCreateParams, type ExternalKeyData, ExternalKeys, type FileDeleteParams, type FileDownloadParams, type FileEntry, type FileExportParams, type FileExportResult, type FileListParams, type FileListResult, type FileStat, Files, FlatCustomDomains, type FsEntry, type FsListResponse, type FsStat, type FunctionCreateParams, type FunctionData, type FunctionId, type FunctionInvokeParams, type FunctionListParams, type FunctionUpdateParams, Functions, type GithubRepo, type GithubSshKey, type HealthCheckCreateParams, type HealthCheckData, type HealthCheckId, type HealthCheckListParams, type HealthCheckUpdateParams, HealthChecks, type HostCreateParams, type HostData, type HostEvent, type HostId, type HostListResponse, type HostStatus, type HostUpdateParams, InsufficientCreditsError, type IntegrationCatalogEntry, type IntegrationData, Integrations, type JobData, type JobEvent, type JobEventType, type JobId, type JobListResponse, type JobRunParams, type JobStatus, type KeyParams, type LaunchParams, type LinearCreateIssueParams, type ListAdminApiKeysParams, type ListAdminComputersParams, type ListAdminTenantsParams, type ListAdminUsersParams, Mcp, type McpDispatchParams, Miosa, type MiosaClientConfig, MiosaError, type MkdirParams, type ModeParams, Models, type MouseButton, NetworkError, NetworkPolicy, type NetworkPolicyData, type NetworkPolicyEffect, type NetworkPolicyProtocol, type NetworkPolicyRule, type NetworkPolicySetParams, NotFoundError, type NotificationPrefsUpdateParams, OAuthFlow, type OauthConnectParams, type OauthProvider, type OauthStartResult, type OauthStatusResult, type ObjectListParams, type AgentEvent as OcAgentEvent, type OcAgentSessionData, type AgentSessionListResponse as OcAgentSessionListResponse, type OcWorkspaceCreateParams, type OcWorkspaceData, type OcWorkspaceEvent, type OcWorkspaceListResponse, type OcWorkspaceStatus, type OcWorkspaceUpdateParams, OpenComputers, type OrgInvite, type OrgInviteCreated, type OrgInviteCreatedResponse, type OrgInviteListResponse, type OrgInvitePreview, type OrgInviteRevokeResponse, OrgInvites, type OrgRole, type OverviewData, type PolicyCreateParams, type PolicyListParams, type PolicyUpdateParams, type PresignParams, type PresignResult, type PreviewDomainData, ProjectAuth, type ProjectAuthEnableParams, type ProjectAuthStatus, type ProjectAuthUpdateParams, type ProjectIntegrationCatalogEntry, type ProjectIntegrationCreateParams, type ProjectIntegrationData, type ProjectIntegrationListParams, type ProjectIntegrationUpdateParams, ProjectIntegrations, ProviderDefaults, type ProviderKeyUpsertParams, type PublishFromSandboxParams, type PublishParams, type PublishResult, RateLimitError, type RegionData, Regions, type RollbackParams, type RulesListParams, type RuntimeInstanceData, type RuntimeInstanceId, type RuntimeInstanceState, type RuntimeLogsResult, SANDBOX_TEMPLATE, Sandbox, SandboxArtifacts, SandboxAudit, type SandboxBuildSpec, type SandboxBuildSpecError, type SandboxBuildSpecValidation, SandboxCommands, type SandboxCreateParams, type SandboxData, SandboxEnv, SandboxEvents, type SandboxExecOptions, type SandboxExecResult, SandboxFiles, type SandboxId, type SandboxListParams, SandboxNetwork, SandboxPreview, SandboxPreviews, SandboxSecrets, type SandboxState, SandboxTags, type SandboxTemplate, type SandboxTemplateBuild, type SandboxTemplateBuildCreateParams, type SandboxTemplateBuildResourceData, type SandboxTemplateBuildResourceId, type SandboxTemplateCreateParams, type SandboxTemplateList, type SandboxTemplateListParams, type SandboxTemplateResourceData, type SandboxTemplateResourceId, SandboxTemplates, SandboxTerminal, Sandboxes, ScopedFs, type ScrollDirection, type ScrollParams, type SecretCreateParams, type SecretData, type SecretId, type SecretListParams, type SecretRotateParams, type SecretSetParams, type SecretUpdateParams, type SessionId, Settings, type SettingsUpdateParams, type SizeData, type SlackSendTestParams, type SnapshotCreateParams, type SnapshotData, type SnapshotListResponse, type SnapshotProgressEvent, type SnapshotRestoreResult, type SnapshotStatus, SnapshotsStandalone, Storage, type StorageObjectData, type SuggestionsParams, type TemplateBuildCreateParams, type TemplateCreateParams, type TemplateData, Tenant, type TenantBrandingUpdateParams, type TenantId, type TenantPlan, type TenantSummary, type TerminalCreateParams, TimeoutError, type TimeseriesParams, type TunnelAuthMode, type TunnelCreateParams, type TunnelData, type TunnelId, type TunnelListResponse, type TunnelUpdateParams, type TypeParams, type UpdateWorkspaceMemberRoleParams, Usage, type UsageReportParams, type UsageSession, type UsageSessionsParams, type UsageSummary, ValidationError, type VersionListParams, type VolumeCreateParams, type VolumeData, type VolumeId, type VolumeListParams, Volumes, type WaitParams, type WebhookCreateParams, type WebhookData, type WebhookDeliveryData, type WebhookDeliveryId, type WebhookId, type WebhookListParams, type WebhookUpdateParams, Webhooks, type WindowFocusParams, type WindowInfo, type WorkspaceId, type WorkspaceInvite, type WorkspaceInviteCreatedResponse, type WorkspaceInviteListResponse, type WorkspaceInvitePreview, type WorkspaceInviteRevokeResponse, WorkspaceInvites, type WorkspaceMember, type WorkspaceMemberAddedResponse, type WorkspaceMemberDeleteResponse, type WorkspaceMemberListResponse, type WorkspaceMemberRecord, type WorkspaceMemberRecordResponse, WorkspaceMembers, type WorkspaceRole, type WsTicket, verifySignature };
|