@buddy-works/sandbox-sdk 0.1.4 → 0.1.6-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +50 -0
- package/dist/index.d.mts +307 -80
- package/dist/index.mjs +1774 -1550
- package/package.json +66 -65
package/README.md
CHANGED
|
@@ -45,6 +45,56 @@ export BUDDY_PROJECT="your-project"
|
|
|
45
45
|
export BUDDY_REGION="US" # Optional: US (default), EU, or AP
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
+
## Apps
|
|
49
|
+
|
|
50
|
+
Sandboxes can run multiple apps simultaneously. Each app is a long-running process defined by a command string.
|
|
51
|
+
|
|
52
|
+
```typescript
|
|
53
|
+
const sandbox = await Sandbox.create({
|
|
54
|
+
identifier: "my-sandbox",
|
|
55
|
+
name: "My Sandbox",
|
|
56
|
+
os: "ubuntu:24.04",
|
|
57
|
+
first_boot_commands: "apt-get update && apt-get install -y curl",
|
|
58
|
+
apps: ["node server.js", "python worker.py"],
|
|
59
|
+
timeout: 600, // auto-stop after 10 minutes of inactivity
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
// List apps
|
|
63
|
+
for (const app of sandbox.data.apps ?? []) {
|
|
64
|
+
console.log(`${app.id}: "${app.command}" -> ${app.app_status}`);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// Control individual apps
|
|
68
|
+
const appId = sandbox.data.apps![0].id!;
|
|
69
|
+
|
|
70
|
+
await sandbox.stopApp(appId);
|
|
71
|
+
await sandbox.startApp(appId);
|
|
72
|
+
|
|
73
|
+
const { logs } = await sandbox.getAppLogs(appId);
|
|
74
|
+
console.log(logs);
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Fetching repositories and artifacts
|
|
78
|
+
|
|
79
|
+
Use `fetch` to clone repositories or download artifacts into the sandbox on
|
|
80
|
+
first boot. Each entry sets a `type` (`PROJECT_REPO`, `PUBLIC_REPO`, or
|
|
81
|
+
`ARTIFACT`) plus the fields relevant to it.
|
|
82
|
+
|
|
83
|
+
```typescript
|
|
84
|
+
await Sandbox.create({
|
|
85
|
+
identifier: "my-sandbox",
|
|
86
|
+
fetch: [
|
|
87
|
+
{
|
|
88
|
+
type: "PUBLIC_REPO",
|
|
89
|
+
repository: "https://github.com/octocat/Hello-World",
|
|
90
|
+
ref: "master",
|
|
91
|
+
path: "/workspace/hello",
|
|
92
|
+
build_command: "echo built",
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
});
|
|
96
|
+
```
|
|
97
|
+
|
|
48
98
|
## Regions
|
|
49
99
|
|
|
50
100
|
Configure the API region:
|
package/dist/index.d.mts
CHANGED
|
@@ -10,7 +10,7 @@ type GroupPermissionView = {
|
|
|
10
10
|
/**
|
|
11
11
|
* The access level for the group
|
|
12
12
|
*/
|
|
13
|
-
access_level?: "DENIED" | "READ_ONLY" | "BLIND" | "RUN_ONLY" | "READ_WRITE" | "MANAGE" | "DEFAULT" | "ALLOWED" | "STAGE" | "COMMIT"
|
|
13
|
+
access_level?: "DENIED" | "READ_ONLY" | "USE_ONLY" | "BLIND" | "RUN_ONLY" | "READ_WRITE" | "MANAGE" | "DEFAULT" | "ALLOWED" | "STAGE" | "COMMIT";
|
|
14
14
|
};
|
|
15
15
|
type UserPermissionView = {
|
|
16
16
|
/**
|
|
@@ -20,7 +20,24 @@ type UserPermissionView = {
|
|
|
20
20
|
/**
|
|
21
21
|
* The access level for the user
|
|
22
22
|
*/
|
|
23
|
-
access_level?: "DENIED" | "READ_ONLY" | "BLIND" | "RUN_ONLY" | "READ_WRITE" | "MANAGE" | "DEFAULT" | "ALLOWED" | "STAGE" | "COMMIT"
|
|
23
|
+
access_level?: "DENIED" | "READ_ONLY" | "USE_ONLY" | "BLIND" | "RUN_ONLY" | "READ_WRITE" | "MANAGE" | "DEFAULT" | "ALLOWED" | "STAGE" | "COMMIT";
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Access permissions configuration
|
|
27
|
+
*/
|
|
28
|
+
type PermissionsView = {
|
|
29
|
+
/**
|
|
30
|
+
* Access level for other workspace members
|
|
31
|
+
*/
|
|
32
|
+
others?: "DENIED" | "READ_ONLY" | "USE_ONLY" | "BLIND" | "RUN_ONLY" | "READ_WRITE" | "MANAGE" | "DEFAULT" | "ALLOWED" | "STAGE" | "COMMIT";
|
|
33
|
+
/**
|
|
34
|
+
* List of specific users with their access levels
|
|
35
|
+
*/
|
|
36
|
+
users?: Array<UserPermissionView>;
|
|
37
|
+
/**
|
|
38
|
+
* List of user groups with their access levels
|
|
39
|
+
*/
|
|
40
|
+
groups?: Array<GroupPermissionView>;
|
|
24
41
|
};
|
|
25
42
|
type IdsView = {
|
|
26
43
|
/**
|
|
@@ -48,17 +65,37 @@ type IdsView = {
|
|
|
48
65
|
*/
|
|
49
66
|
environment_id?: string;
|
|
50
67
|
/**
|
|
51
|
-
* The ID of the
|
|
68
|
+
* The ID of the artifact
|
|
52
69
|
*/
|
|
53
|
-
|
|
70
|
+
artifact_id?: string;
|
|
54
71
|
/**
|
|
55
|
-
* The ID of the
|
|
72
|
+
* The ID of the artifact version
|
|
56
73
|
*/
|
|
57
|
-
|
|
74
|
+
artifact_version_id?: string;
|
|
58
75
|
/**
|
|
59
76
|
* The ID of the sandbox
|
|
60
77
|
*/
|
|
61
78
|
sandbox_id?: string;
|
|
79
|
+
/**
|
|
80
|
+
* The ID of the unit test suite
|
|
81
|
+
*/
|
|
82
|
+
unit_test_suite_id?: string;
|
|
83
|
+
/**
|
|
84
|
+
* The ID of the visual test suite
|
|
85
|
+
*/
|
|
86
|
+
visual_test_suite_id?: string;
|
|
87
|
+
/**
|
|
88
|
+
* The ID of the crawl suite
|
|
89
|
+
*/
|
|
90
|
+
crawl_suite_id?: string;
|
|
91
|
+
/**
|
|
92
|
+
* The ID of the distribution
|
|
93
|
+
*/
|
|
94
|
+
distribution_id?: string;
|
|
95
|
+
/**
|
|
96
|
+
* The ID of the route
|
|
97
|
+
*/
|
|
98
|
+
route_id?: string;
|
|
62
99
|
};
|
|
63
100
|
/**
|
|
64
101
|
* Sandbox reference
|
|
@@ -88,6 +125,10 @@ type SandboxIdView = {
|
|
|
88
125
|
* The current status of the sandbox
|
|
89
126
|
*/
|
|
90
127
|
status?: "STARTING" | "STOPPING" | "FAILED" | "RUNNING" | "STOPPED" | "RESTORING";
|
|
128
|
+
/**
|
|
129
|
+
* The current setup status of the sandbox
|
|
130
|
+
*/
|
|
131
|
+
setup_status?: "INPROGRESS" | "SUCCESS" | "FAILED";
|
|
91
132
|
};
|
|
92
133
|
/**
|
|
93
134
|
* Integration reference
|
|
@@ -116,7 +157,7 @@ type IntegrationIdView = {
|
|
|
116
157
|
/**
|
|
117
158
|
* The type of integration
|
|
118
159
|
*/
|
|
119
|
-
type?: "GIT_HUB" | "BITBUCKET" | "GOOGLE" | "DIGITAL_OCEAN" | "SLACK" | "MODULUS" | "HEROKU" | "AMAZON" | "GIT_LAB" | "SHOPIFY" | "GIT_HUB_ENTERPRISE" | "GIT_LAB_ENTERPRISE" | "PUSHOVER" | "PUSHBULLET" | "RACKSPACE" | "CUSTOM" | "CLOUDFLARE" | "NEW_RELIC" | "SENTRY" | "ROLLBAR" | "DATADOG" | "DO_SPACES" | "HONEYBADGER" | "VULTR" | "SENTRY_ENTERPRISE" | "LOGGLY" | "HIP_CHAT" | "FIREBASE" | "TELEGRAM" | "AZURE" | "UPCLOUD" | "GHOST_INSPECTOR" | "NETLIFY" | "AZURE_CLOUD" | "MICROSOFT_TEAMS" | "GOOGLE_SERVICE_ACCOUNT" | "GOOGLE_PLAY_STORE" | "DOCKER_HUB" | "APP_STORE" | "GIT_HUB_APP" | "GIT_HUB_APP_ENTERPRISE" | "GIT_HUB_API" | "ATOP" | "SNYK" | "STACK_HAWK" | "BLACKFIRE" | "BACKBLAZE" | "ONE_LOGIN" | "OKTA" | "CONTENTFUL";
|
|
160
|
+
type?: "GIT_HUB" | "BITBUCKET" | "GOOGLE" | "DIGITAL_OCEAN" | "SLACK" | "MODULUS" | "HEROKU" | "AMAZON" | "GIT_LAB" | "SHOPIFY" | "GIT_HUB_ENTERPRISE" | "GIT_LAB_ENTERPRISE" | "PUSHOVER" | "PUSHBULLET" | "RACKSPACE" | "CUSTOM" | "CLOUDFLARE" | "NEW_RELIC" | "SENTRY" | "ROLLBAR" | "DATADOG" | "DO_SPACES" | "HONEYBADGER" | "VULTR" | "SENTRY_ENTERPRISE" | "LOGGLY" | "HIP_CHAT" | "FIREBASE" | "TELEGRAM" | "AZURE" | "UPCLOUD" | "GHOST_INSPECTOR" | "NETLIFY" | "AZURE_CLOUD" | "MICROSOFT_TEAMS" | "GOOGLE_SERVICE_ACCOUNT" | "GOOGLE_PLAY_STORE" | "DOCKER_HUB" | "APP_STORE" | "GIT_HUB_APP" | "GIT_HUB_APP_ENTERPRISE" | "GIT_HUB_API" | "ATOP" | "SNYK" | "STACK_HAWK" | "BLACKFIRE" | "BACKBLAZE" | "ONE_LOGIN" | "OKTA" | "CONTENTFUL" | "JIRA" | "NPM_REGISTRY" | "ANTHROPIC";
|
|
120
161
|
/**
|
|
121
162
|
* The authentication method used by the integration
|
|
122
163
|
*/
|
|
@@ -271,23 +312,6 @@ type ProjectView = {
|
|
|
271
312
|
*/
|
|
272
313
|
without_repository?: boolean;
|
|
273
314
|
};
|
|
274
|
-
/**
|
|
275
|
-
* Access permissions configuration
|
|
276
|
-
*/
|
|
277
|
-
type PermissionsView = {
|
|
278
|
-
/**
|
|
279
|
-
* Access level for other workspace members
|
|
280
|
-
*/
|
|
281
|
-
others?: "DENIED" | "READ_ONLY" | "BLIND" | "RUN_ONLY" | "READ_WRITE" | "MANAGE" | "DEFAULT" | "ALLOWED" | "STAGE" | "COMMIT" | "USE_ONLY";
|
|
282
|
-
/**
|
|
283
|
-
* List of specific users with their access levels
|
|
284
|
-
*/
|
|
285
|
-
users?: Array<UserPermissionView>;
|
|
286
|
-
/**
|
|
287
|
-
* List of user groups with their access levels
|
|
288
|
-
*/
|
|
289
|
-
groups?: Array<GroupPermissionView>;
|
|
290
|
-
};
|
|
291
315
|
/**
|
|
292
316
|
* The TLS/SSL encryption settings of the tunnel
|
|
293
317
|
*/
|
|
@@ -336,9 +360,9 @@ type HttpSettingsView = {
|
|
|
336
360
|
/**
|
|
337
361
|
* Custom HTTP headers to add to requests
|
|
338
362
|
*/
|
|
339
|
-
request_headers?:
|
|
363
|
+
request_headers?: {
|
|
340
364
|
[key: string]: string;
|
|
341
|
-
}
|
|
365
|
+
};
|
|
342
366
|
/**
|
|
343
367
|
* List of allowed User-Agent strings
|
|
344
368
|
*/
|
|
@@ -350,9 +374,9 @@ type HttpSettingsView = {
|
|
|
350
374
|
/**
|
|
351
375
|
* Custom HTTP headers to add to responses
|
|
352
376
|
*/
|
|
353
|
-
response_headers?:
|
|
377
|
+
response_headers?: {
|
|
354
378
|
[key: string]: string;
|
|
355
|
-
}
|
|
379
|
+
};
|
|
356
380
|
/**
|
|
357
381
|
* Basic authentication username
|
|
358
382
|
*/
|
|
@@ -410,6 +434,46 @@ type TunnelView = {
|
|
|
410
434
|
*/
|
|
411
435
|
endpoint_url?: string;
|
|
412
436
|
};
|
|
437
|
+
type SandboxFetchView = {
|
|
438
|
+
/**
|
|
439
|
+
* The type of the fetch item: PROJECT_REPO, PUBLIC_REPO, or ARTIFACT
|
|
440
|
+
*/
|
|
441
|
+
type?: "PROJECT_REPO" | "PUBLIC_REPO" | "ARTIFACT";
|
|
442
|
+
/**
|
|
443
|
+
* The URL of the git repository (for PUBLIC_REPO type)
|
|
444
|
+
*/
|
|
445
|
+
repository?: string;
|
|
446
|
+
/**
|
|
447
|
+
* The branch, tag, or commit to checkout. Defaults to the default branch
|
|
448
|
+
*/
|
|
449
|
+
ref?: string;
|
|
450
|
+
/**
|
|
451
|
+
* The target path where the item will be cloned/downloaded. Defaults to the app directory
|
|
452
|
+
*/
|
|
453
|
+
path?: string;
|
|
454
|
+
/**
|
|
455
|
+
* The command to run after fetching
|
|
456
|
+
*/
|
|
457
|
+
build_command?: string;
|
|
458
|
+
/**
|
|
459
|
+
* The artifact identifier in format pkg:version (for ARTIFACT type)
|
|
460
|
+
*/
|
|
461
|
+
artifact?: string;
|
|
462
|
+
};
|
|
463
|
+
type SandboxAppView = {
|
|
464
|
+
/**
|
|
465
|
+
* The auto-generated ID of the app
|
|
466
|
+
*/
|
|
467
|
+
id?: string;
|
|
468
|
+
/**
|
|
469
|
+
* The run command of the app
|
|
470
|
+
*/
|
|
471
|
+
command?: string;
|
|
472
|
+
/**
|
|
473
|
+
* The current status of the app
|
|
474
|
+
*/
|
|
475
|
+
app_status?: "NONE" | "RUNNING" | "ENDED" | "FAILED";
|
|
476
|
+
};
|
|
413
477
|
type SandboxesView = {
|
|
414
478
|
/**
|
|
415
479
|
* API endpoint to GET this object
|
|
@@ -496,6 +560,14 @@ type SandboxCommandView = {
|
|
|
496
560
|
* Command exit code
|
|
497
561
|
*/
|
|
498
562
|
exit_code?: number;
|
|
563
|
+
/**
|
|
564
|
+
* Command execution start date
|
|
565
|
+
*/
|
|
566
|
+
start_date?: Date;
|
|
567
|
+
/**
|
|
568
|
+
* Command execution finish date
|
|
569
|
+
*/
|
|
570
|
+
finish_date?: Date;
|
|
499
571
|
/**
|
|
500
572
|
* API endpoint URL to retrieve logs for this command
|
|
501
573
|
*/
|
|
@@ -511,6 +583,24 @@ type SandboxCommandLog = {
|
|
|
511
583
|
*/
|
|
512
584
|
data?: string;
|
|
513
585
|
};
|
|
586
|
+
type SandboxAppLogsView = {
|
|
587
|
+
/**
|
|
588
|
+
* API endpoint to GET this object
|
|
589
|
+
*/
|
|
590
|
+
readonly url?: string;
|
|
591
|
+
/**
|
|
592
|
+
* Web URL to view this object in Buddy.works
|
|
593
|
+
*/
|
|
594
|
+
readonly html_url?: string;
|
|
595
|
+
/**
|
|
596
|
+
* Cursor for pagination
|
|
597
|
+
*/
|
|
598
|
+
cursor?: string;
|
|
599
|
+
/**
|
|
600
|
+
* Application log entries
|
|
601
|
+
*/
|
|
602
|
+
logs?: Array<string>;
|
|
603
|
+
};
|
|
514
604
|
type ExecuteSandboxCommandRequest = {
|
|
515
605
|
/**
|
|
516
606
|
* Command to execute in the sandbox
|
|
@@ -521,9 +611,6 @@ type ExecuteSandboxCommandRequest = {
|
|
|
521
611
|
*/
|
|
522
612
|
runtime?: "BASH" | "JAVASCRIPT" | "TYPESCRIPT" | "PYTHON";
|
|
523
613
|
};
|
|
524
|
-
/**
|
|
525
|
-
* The list of variables you can use the action
|
|
526
|
-
*/
|
|
527
614
|
type EnvironmentVariableView = {
|
|
528
615
|
/**
|
|
529
616
|
* The ID of the variable
|
|
@@ -566,15 +653,15 @@ type EnvironmentVariableView = {
|
|
|
566
653
|
*/
|
|
567
654
|
defaults?: string;
|
|
568
655
|
/**
|
|
569
|
-
* Specifies where to copy the file on each run. Set if `type` is `SSH_KEY`
|
|
656
|
+
* Specifies where to copy the file on each run. Set if `type` is `FILE`, `SSH_KEY`, `SSH_PUBLIC_KEY`, `IOS_KEYCHAIN`, or `IOS_PROVISION_PROFILES`
|
|
570
657
|
*/
|
|
571
658
|
file_path?: string;
|
|
572
659
|
/**
|
|
573
|
-
* File permission set on copy to a container on each run. Set if `type` is `SSH_KEY`
|
|
660
|
+
* File permission set on copy to a container on each run. Set if `type` is `FILE`, `SSH_KEY`, `SSH_PUBLIC_KEY`, `IOS_KEYCHAIN`, or `IOS_PROVISION_PROFILES`
|
|
574
661
|
*/
|
|
575
662
|
file_chmod?: string;
|
|
576
663
|
/**
|
|
577
|
-
* Set if `type` is `SSH_KEY`. If it's `NONE`, the variable can be used as a parameter in an action. For `CONTAINER`, the given key is additionally copied to an action container on each run
|
|
664
|
+
* Set if `type` is `FILE`, `SSH_KEY`, `SSH_PUBLIC_KEY`, `IOS_KEYCHAIN`, or `IOS_PROVISION_PROFILES`. If it's `NONE`, the variable can be used as a parameter in an action. For `CONTAINER`, the given key is additionally copied to an action container on each run
|
|
578
665
|
*/
|
|
579
666
|
file_place?: "NONE" | "CONTAINER";
|
|
580
667
|
/**
|
|
@@ -602,9 +689,13 @@ type EnvironmentVariableView = {
|
|
|
602
689
|
*/
|
|
603
690
|
passphrase?: string;
|
|
604
691
|
/**
|
|
605
|
-
* GPG
|
|
692
|
+
* Key identifier for iOS certificates, provisioning profiles, or GPG keys
|
|
606
693
|
*/
|
|
607
694
|
key_identifier?: string;
|
|
695
|
+
/**
|
|
696
|
+
* Set to `true` to disable the variable. Disabled variables are not injected anywhere
|
|
697
|
+
*/
|
|
698
|
+
disabled?: boolean;
|
|
608
699
|
};
|
|
609
700
|
type CloneSandboxRequest = {
|
|
610
701
|
/**
|
|
@@ -645,6 +736,10 @@ type SandboxResponse = {
|
|
|
645
736
|
* The current status of the sandbox
|
|
646
737
|
*/
|
|
647
738
|
status?: "STARTING" | "STOPPING" | "FAILED" | "RUNNING" | "STOPPED" | "RESTORING";
|
|
739
|
+
/**
|
|
740
|
+
* The current setup status of the sandbox
|
|
741
|
+
*/
|
|
742
|
+
setup_status?: "INPROGRESS" | "SUCCESS" | "FAILED" | "STALE";
|
|
648
743
|
/**
|
|
649
744
|
* The operating system of the sandbox ["ubuntu:22.04", "ubuntu:24.04"]
|
|
650
745
|
*/
|
|
@@ -654,41 +749,45 @@ type SandboxResponse = {
|
|
|
654
749
|
*/
|
|
655
750
|
resources?: "1x2" | "2x4" | "3x6" | "4x8" | "5x10" | "6x12" | "7x14" | "8x16" | "9x18" | "10x20" | "11x22" | "12x24" | "CUSTOM";
|
|
656
751
|
/**
|
|
657
|
-
* The commands to run during
|
|
658
|
-
*/
|
|
659
|
-
install_commands?: string;
|
|
660
|
-
/**
|
|
661
|
-
* The run command of the sandbox
|
|
752
|
+
* The commands to run during first boot of the sandbox
|
|
662
753
|
*/
|
|
663
|
-
|
|
754
|
+
first_boot_commands?: string;
|
|
664
755
|
/**
|
|
665
756
|
* The application directory of the sandbox
|
|
666
757
|
*/
|
|
667
758
|
app_dir?: string;
|
|
668
759
|
/**
|
|
669
|
-
* The
|
|
760
|
+
* The list of apps (run commands) for the sandbox
|
|
670
761
|
*/
|
|
671
|
-
|
|
762
|
+
apps?: Array<SandboxAppView>;
|
|
672
763
|
/**
|
|
673
|
-
* The list of
|
|
764
|
+
* The list of items (repositories and artifacts) to fetch into the sandbox
|
|
674
765
|
*/
|
|
675
|
-
|
|
766
|
+
fetch?: Array<SandboxFetchView>;
|
|
676
767
|
/**
|
|
677
|
-
* The
|
|
768
|
+
* The timeout in seconds after which the sandbox will be automatically stopped
|
|
678
769
|
*/
|
|
679
|
-
|
|
770
|
+
timeout?: number;
|
|
680
771
|
/**
|
|
681
|
-
* The
|
|
772
|
+
* The list of tags associated with the sandbox
|
|
682
773
|
*/
|
|
683
|
-
|
|
774
|
+
tags?: Array<string>;
|
|
684
775
|
/**
|
|
685
|
-
* The
|
|
776
|
+
* The boot logs of the sandbox
|
|
686
777
|
*/
|
|
687
|
-
|
|
778
|
+
boot_logs?: Array<string>;
|
|
688
779
|
/**
|
|
689
780
|
* The tunnel endpoints of the sandbox
|
|
690
781
|
*/
|
|
691
782
|
endpoints?: Array<TunnelView>;
|
|
783
|
+
/**
|
|
784
|
+
* The SSH hostname
|
|
785
|
+
*/
|
|
786
|
+
ssh_host?: string;
|
|
787
|
+
/**
|
|
788
|
+
* The SSH port
|
|
789
|
+
*/
|
|
790
|
+
ssh_port?: number;
|
|
692
791
|
project?: ProjectView;
|
|
693
792
|
permissions?: PermissionsView;
|
|
694
793
|
/**
|
|
@@ -733,15 +832,15 @@ type AddVariableInObjectRequestWritable = {
|
|
|
733
832
|
*/
|
|
734
833
|
defaults?: string;
|
|
735
834
|
/**
|
|
736
|
-
* Specifies where to copy the file on each run. Set if `type` is `SSH_KEY`
|
|
835
|
+
* Specifies where to copy the file on each run. Set if `type` is `FILE`, `SSH_KEY`, `SSH_PUBLIC_KEY`, `IOS_KEYCHAIN`, or `IOS_PROVISION_PROFILES`
|
|
737
836
|
*/
|
|
738
837
|
file_path?: string;
|
|
739
838
|
/**
|
|
740
|
-
* File permission set on copy to a container on each run. Set if `type` is `SSH_KEY`
|
|
839
|
+
* File permission set on copy to a container on each run. Set if `type` is `FILE`, `SSH_KEY`, `SSH_PUBLIC_KEY`, `IOS_KEYCHAIN`, or `IOS_PROVISION_PROFILES`
|
|
741
840
|
*/
|
|
742
841
|
file_chmod?: string;
|
|
743
842
|
/**
|
|
744
|
-
* Set if `type` is `SSH_KEY`. If it's `NONE`, the variable can be used as a parameter in an action. For `CONTAINER`, the given key is additionally copied to an action container on each run
|
|
843
|
+
* Set if `type` is `FILE`, `SSH_KEY`, `SSH_PUBLIC_KEY`, `IOS_KEYCHAIN`, or `IOS_PROVISION_PROFILES`. If it's `NONE`, the variable can be used as a parameter in an action. For `CONTAINER`, the given key is additionally copied to an action container on each run
|
|
745
844
|
*/
|
|
746
845
|
file_place?: "NONE" | "CONTAINER";
|
|
747
846
|
/**
|
|
@@ -753,9 +852,13 @@ type AddVariableInObjectRequestWritable = {
|
|
|
753
852
|
*/
|
|
754
853
|
passphrase?: string;
|
|
755
854
|
/**
|
|
756
|
-
* GPG
|
|
855
|
+
* Key identifier for iOS certificates, provisioning profiles, or GPG keys
|
|
757
856
|
*/
|
|
758
857
|
key_identifier?: string;
|
|
858
|
+
/**
|
|
859
|
+
* Set to `true` to disable the variable. Disabled variables are not injected anywhere
|
|
860
|
+
*/
|
|
861
|
+
disabled?: boolean;
|
|
759
862
|
/**
|
|
760
863
|
* The type of the added variable
|
|
761
864
|
*/
|
|
@@ -805,9 +908,9 @@ type HttpSettingsViewWritable = {
|
|
|
805
908
|
/**
|
|
806
909
|
* Custom HTTP headers to add to requests
|
|
807
910
|
*/
|
|
808
|
-
request_headers?:
|
|
911
|
+
request_headers?: {
|
|
809
912
|
[key: string]: string;
|
|
810
|
-
}
|
|
913
|
+
};
|
|
811
914
|
/**
|
|
812
915
|
* List of allowed User-Agent strings
|
|
813
916
|
*/
|
|
@@ -819,9 +922,9 @@ type HttpSettingsViewWritable = {
|
|
|
819
922
|
/**
|
|
820
923
|
* Custom HTTP headers to add to responses
|
|
821
924
|
*/
|
|
822
|
-
response_headers?:
|
|
925
|
+
response_headers?: {
|
|
823
926
|
[key: string]: string;
|
|
824
|
-
}
|
|
927
|
+
};
|
|
825
928
|
/**
|
|
826
929
|
* Basic authentication username
|
|
827
930
|
*/
|
|
@@ -897,21 +1000,21 @@ type CreateNewSandboxRequestWritable = {
|
|
|
897
1000
|
*/
|
|
898
1001
|
resources?: "1x2" | "2x4" | "3x6" | "4x8" | "5x10" | "6x12" | "7x14" | "8x16" | "9x18" | "10x20" | "11x22" | "12x24" | "CUSTOM";
|
|
899
1002
|
/**
|
|
900
|
-
* The commands to run during
|
|
1003
|
+
* The commands to run during first boot of the sandbox
|
|
901
1004
|
*/
|
|
902
|
-
|
|
903
|
-
/**
|
|
904
|
-
* The run command of the sandbox
|
|
905
|
-
*/
|
|
906
|
-
run_command?: string;
|
|
1005
|
+
first_boot_commands?: string;
|
|
907
1006
|
/**
|
|
908
1007
|
* The application directory of the sandbox
|
|
909
1008
|
*/
|
|
910
1009
|
app_dir?: string;
|
|
911
1010
|
/**
|
|
912
|
-
* The
|
|
1011
|
+
* The list of apps (run commands) for the sandbox
|
|
1012
|
+
*/
|
|
1013
|
+
apps?: Array<string>;
|
|
1014
|
+
/**
|
|
1015
|
+
* The list of items (repositories and artifacts) to fetch into the sandbox
|
|
913
1016
|
*/
|
|
914
|
-
|
|
1017
|
+
fetch?: Array<SandboxFetchView>;
|
|
915
1018
|
/**
|
|
916
1019
|
* The list of tags associated with the sandbox
|
|
917
1020
|
*/
|
|
@@ -924,6 +1027,11 @@ type CreateNewSandboxRequestWritable = {
|
|
|
924
1027
|
* The environment variables of the sandbox
|
|
925
1028
|
*/
|
|
926
1029
|
variables?: Array<AddVariableInObjectRequestWritable>;
|
|
1030
|
+
/**
|
|
1031
|
+
* The timeout in seconds after which the sandbox will be automatically stopped
|
|
1032
|
+
*/
|
|
1033
|
+
timeout?: number;
|
|
1034
|
+
permissions?: PermissionsView;
|
|
927
1035
|
};
|
|
928
1036
|
type CreateFromSnapshotRequestWritable = {
|
|
929
1037
|
/**
|
|
@@ -947,21 +1055,17 @@ type CreateFromSnapshotRequestWritable = {
|
|
|
947
1055
|
*/
|
|
948
1056
|
resources?: "1x2" | "2x4" | "3x6" | "4x8" | "5x10" | "6x12" | "7x14" | "8x16" | "9x18" | "10x20" | "11x22" | "12x24" | "CUSTOM";
|
|
949
1057
|
/**
|
|
950
|
-
* The commands to run during
|
|
951
|
-
*/
|
|
952
|
-
install_commands?: string;
|
|
953
|
-
/**
|
|
954
|
-
* The run command of the sandbox
|
|
1058
|
+
* The commands to run during first boot of the sandbox
|
|
955
1059
|
*/
|
|
956
|
-
|
|
1060
|
+
first_boot_commands?: string;
|
|
957
1061
|
/**
|
|
958
1062
|
* The application directory of the sandbox
|
|
959
1063
|
*/
|
|
960
1064
|
app_dir?: string;
|
|
961
1065
|
/**
|
|
962
|
-
* The
|
|
1066
|
+
* The list of apps (run commands) for the sandbox
|
|
963
1067
|
*/
|
|
964
|
-
|
|
1068
|
+
apps?: Array<string>;
|
|
965
1069
|
/**
|
|
966
1070
|
* The list of tags associated with the sandbox
|
|
967
1071
|
*/
|
|
@@ -997,17 +1101,45 @@ type GetIdentifiersData = {
|
|
|
997
1101
|
*/
|
|
998
1102
|
environment?: string;
|
|
999
1103
|
/**
|
|
1000
|
-
* The human-readable ID of the
|
|
1104
|
+
* The human-readable ID of the artifact
|
|
1001
1105
|
*/
|
|
1002
|
-
|
|
1106
|
+
artifact?: string;
|
|
1003
1107
|
/**
|
|
1004
|
-
* The version of the
|
|
1108
|
+
* The version of the artifact
|
|
1005
1109
|
*/
|
|
1006
|
-
|
|
1110
|
+
artifact_version?: string;
|
|
1007
1111
|
/**
|
|
1008
1112
|
* The human-readable ID of the sandbox
|
|
1009
1113
|
*/
|
|
1010
1114
|
sandbox?: string;
|
|
1115
|
+
/**
|
|
1116
|
+
* The human-readable ID of the unit test suite
|
|
1117
|
+
*/
|
|
1118
|
+
unit_test_suite?: string;
|
|
1119
|
+
/**
|
|
1120
|
+
* The human-readable ID of the visual test suite
|
|
1121
|
+
*/
|
|
1122
|
+
visual_test_suite?: string;
|
|
1123
|
+
/**
|
|
1124
|
+
* The human-readable ID of the crawl suite
|
|
1125
|
+
*/
|
|
1126
|
+
crawl_suite?: string;
|
|
1127
|
+
/**
|
|
1128
|
+
* The human-readable ID of the distribution
|
|
1129
|
+
*/
|
|
1130
|
+
distribution?: string;
|
|
1131
|
+
/**
|
|
1132
|
+
* The subdomain of the route. Resolved together with route_domain and route_path against the parent distribution.
|
|
1133
|
+
*/
|
|
1134
|
+
route_subdomain?: string;
|
|
1135
|
+
/**
|
|
1136
|
+
* The domain of the route. Required to resolve a route.
|
|
1137
|
+
*/
|
|
1138
|
+
route_domain?: string;
|
|
1139
|
+
/**
|
|
1140
|
+
* The path of the route. Resolved together with route_subdomain and route_domain against the parent distribution.
|
|
1141
|
+
*/
|
|
1142
|
+
route_path?: string;
|
|
1011
1143
|
};
|
|
1012
1144
|
url: "/workspaces/{workspace_domain}/identifiers";
|
|
1013
1145
|
};
|
|
@@ -1077,6 +1209,72 @@ type GetSandboxResponses = {
|
|
|
1077
1209
|
200: SandboxResponse;
|
|
1078
1210
|
};
|
|
1079
1211
|
type GetSandboxResponse = GetSandboxResponses[keyof GetSandboxResponses];
|
|
1212
|
+
type GetSandboxAppLogsByIdData = {
|
|
1213
|
+
body?: never;
|
|
1214
|
+
path: {
|
|
1215
|
+
/**
|
|
1216
|
+
* The human-readable ID of the workspace
|
|
1217
|
+
*/
|
|
1218
|
+
workspace_domain: string;
|
|
1219
|
+
/**
|
|
1220
|
+
* The ID of the sandbox
|
|
1221
|
+
*/
|
|
1222
|
+
sandbox_id: string;
|
|
1223
|
+
/**
|
|
1224
|
+
* The ID of the app
|
|
1225
|
+
*/
|
|
1226
|
+
app_id: string;
|
|
1227
|
+
};
|
|
1228
|
+
query?: {
|
|
1229
|
+
/**
|
|
1230
|
+
* Cursor for pagination
|
|
1231
|
+
*/
|
|
1232
|
+
cursor?: string;
|
|
1233
|
+
};
|
|
1234
|
+
url: "/workspaces/{workspace_domain}/sandboxes/{sandbox_id}/apps/{app_id}/logs";
|
|
1235
|
+
};
|
|
1236
|
+
type GetSandboxAppLogsByIdResponses = {
|
|
1237
|
+
200: SandboxAppLogsView;
|
|
1238
|
+
};
|
|
1239
|
+
type GetSandboxAppLogsByIdResponse = GetSandboxAppLogsByIdResponses[keyof GetSandboxAppLogsByIdResponses];
|
|
1240
|
+
type StartSandboxAppData = {
|
|
1241
|
+
body?: never;
|
|
1242
|
+
path: {
|
|
1243
|
+
/**
|
|
1244
|
+
* The human-readable ID of the workspace
|
|
1245
|
+
*/
|
|
1246
|
+
workspace_domain: string;
|
|
1247
|
+
/**
|
|
1248
|
+
* The ID of the sandbox
|
|
1249
|
+
*/
|
|
1250
|
+
sandbox_id: string;
|
|
1251
|
+
/**
|
|
1252
|
+
* The ID of the app
|
|
1253
|
+
*/
|
|
1254
|
+
app_id: string;
|
|
1255
|
+
};
|
|
1256
|
+
query?: never;
|
|
1257
|
+
url: "/workspaces/{workspace_domain}/sandboxes/{sandbox_id}/apps/{app_id}/start";
|
|
1258
|
+
};
|
|
1259
|
+
type StopSandboxAppData = {
|
|
1260
|
+
body?: never;
|
|
1261
|
+
path: {
|
|
1262
|
+
/**
|
|
1263
|
+
* The human-readable ID of the workspace
|
|
1264
|
+
*/
|
|
1265
|
+
workspace_domain: string;
|
|
1266
|
+
/**
|
|
1267
|
+
* The ID of the sandbox
|
|
1268
|
+
*/
|
|
1269
|
+
sandbox_id: string;
|
|
1270
|
+
/**
|
|
1271
|
+
* The ID of the app
|
|
1272
|
+
*/
|
|
1273
|
+
app_id: string;
|
|
1274
|
+
};
|
|
1275
|
+
query?: never;
|
|
1276
|
+
url: "/workspaces/{workspace_domain}/sandboxes/{sandbox_id}/apps/{app_id}/stop";
|
|
1277
|
+
};
|
|
1080
1278
|
type ExecuteSandboxCommandData = {
|
|
1081
1279
|
body?: ExecuteSandboxCommandRequest;
|
|
1082
1280
|
path: {
|
|
@@ -1406,6 +1604,12 @@ declare class BuddyApiClient extends HttpClient {
|
|
|
1406
1604
|
stopSandbox<const Data$1 extends StopSandboxData>(data: ClientData<Data$1>): Promise<SandboxResponse>;
|
|
1407
1605
|
/** Restart a sandbox */
|
|
1408
1606
|
restartSandbox<const Data$1 extends RestartSandboxData>(data: ClientData<Data$1>): Promise<SandboxResponse>;
|
|
1607
|
+
/** Start a sandbox app */
|
|
1608
|
+
startSandboxApp<const Data$1 extends StartSandboxAppData>(data: ClientData<Data$1>): Promise<SandboxResponse>;
|
|
1609
|
+
/** Stop a sandbox app */
|
|
1610
|
+
stopSandboxApp<const Data$1 extends StopSandboxAppData>(data: ClientData<Data$1>): Promise<SandboxResponse>;
|
|
1611
|
+
/** Get logs for a specific sandbox app */
|
|
1612
|
+
getSandboxAppLogs<const Data$1 extends GetSandboxAppLogsByIdData>(data: ClientData<Data$1>): Promise<SandboxAppLogsView>;
|
|
1409
1613
|
/** Get sandbox content (list files/directories at a path) */
|
|
1410
1614
|
getSandboxContent<const Data$1 extends GetSandboxContentData>(data: ClientData<Data$1>): Promise<GetSandboxContentResponse>;
|
|
1411
1615
|
/** Delete a file or directory from a sandbox */
|
|
@@ -1721,6 +1925,29 @@ declare class Sandbox {
|
|
|
1721
1925
|
* Waits until the sandbox reaches RUNNING state and setup is complete
|
|
1722
1926
|
*/
|
|
1723
1927
|
restart(): Promise<void>;
|
|
1928
|
+
/**
|
|
1929
|
+
* Start a specific app within the sandbox
|
|
1930
|
+
*
|
|
1931
|
+
* Updates the internal sandbox data with the latest state after starting.
|
|
1932
|
+
* @param appId - The auto-generated ID of the app (from sandbox.data.apps)
|
|
1933
|
+
*/
|
|
1934
|
+
startApp(appId: NonNullable<SandboxAppView["id"]>): Promise<void>;
|
|
1935
|
+
/**
|
|
1936
|
+
* Stop a specific app within the sandbox
|
|
1937
|
+
*
|
|
1938
|
+
* Updates the internal sandbox data with the latest state after stopping.
|
|
1939
|
+
* @param appId - The auto-generated ID of the app (from sandbox.data.apps)
|
|
1940
|
+
*/
|
|
1941
|
+
stopApp(appId: NonNullable<SandboxAppView["id"]>): Promise<void>;
|
|
1942
|
+
/**
|
|
1943
|
+
* Get logs for a specific app within the sandbox
|
|
1944
|
+
*
|
|
1945
|
+
* Returns paginated log entries. Pass the returned cursor to fetch the next page.
|
|
1946
|
+
* @param appId - The auto-generated ID of the app (from sandbox.data.apps)
|
|
1947
|
+
* @param cursor - Pagination cursor from a previous response
|
|
1948
|
+
* @returns Log entries and a cursor for the next page
|
|
1949
|
+
*/
|
|
1950
|
+
getAppLogs(appId: NonNullable<SandboxAppView["id"]>, cursor?: string): Promise<GetSandboxAppLogsByIdResponse>;
|
|
1724
1951
|
private constructor();
|
|
1725
1952
|
}
|
|
1726
1953
|
//#endregion
|
|
@@ -1744,4 +1971,4 @@ declare class BuddySDKError extends Error {
|
|
|
1744
1971
|
});
|
|
1745
1972
|
}
|
|
1746
1973
|
//#endregion
|
|
1747
|
-
export { API_URLS, BuddyApiClient, BuddySDKError, Command, type ConnectionConfig, type CreateSandboxConfig, ERROR_CODES, type ErrorCode, type FileInfo, FileSystem, type GetFileSystemConfig, type GetSandboxConfig, type ListSandboxesConfig, REGIONS, type Region, Sandbox, type SandboxIdView };
|
|
1974
|
+
export { API_URLS, BuddyApiClient, BuddySDKError, Command, type ConnectionConfig, type CreateSandboxConfig, ERROR_CODES, type ErrorCode, type FileInfo, FileSystem, type GetFileSystemConfig, type GetSandboxConfig, type ListSandboxesConfig, REGIONS, type Region, Sandbox, type SandboxAppView, type SandboxIdView };
|