freestyle-sandboxes 0.0.86 → 0.0.88

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "freestyle-sandboxes",
3
- "version": "0.0.86",
3
+ "version": "0.0.88",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",
package/src/index.ts CHANGED
@@ -439,6 +439,86 @@ export class FreestyleSandboxes {
439
439
  );
440
440
  }
441
441
 
442
+ /**
443
+ * Insert a domain mapping for a deployment.
444
+ */
445
+ async insertDomainMapping({
446
+ domain,
447
+ deploymentId,
448
+ }: {
449
+ domain: string;
450
+ deploymentId: string;
451
+ }): Promise<sandbox_openapi.HandleInsertDomainMappingResponse> {
452
+ const response = await sandbox_openapi.handleInsertDomainMapping({
453
+ client: this.client,
454
+ path: {
455
+ domain,
456
+ },
457
+ body: {
458
+ deploymentId,
459
+ },
460
+ });
461
+ if (response.data) {
462
+ return response.data;
463
+ }
464
+ throw new Error(
465
+ `Failed to insert domain mapping for domain ${domain} and deployment ${deploymentId}: ${response.error.message}`
466
+ );
467
+ }
468
+
469
+ /**
470
+ * Remove a domain mapping for a deployment.
471
+ */
472
+ async removeDomainMapping({
473
+ domain,
474
+ deploymentId,
475
+ }: {
476
+ domain: string;
477
+ deploymentId: string;
478
+ }): Promise<sandbox_openapi.HandleDeleteDomainMappingResponse> {
479
+ const response = await sandbox_openapi.handleDeleteDomainMapping({
480
+ client: this.client,
481
+ path: {
482
+ domain,
483
+ },
484
+ body: {
485
+ deploymentId,
486
+ },
487
+ });
488
+ if (response.data) {
489
+ return response.data;
490
+ }
491
+ throw new Error(
492
+ `Failed to remove domain mapping for domain ${domain} and deployment ${deploymentId}: ${response.error.message}`
493
+ );
494
+ }
495
+
496
+ async listDomainMappings({
497
+ domain,
498
+ domainOwnership,
499
+ limit = 10,
500
+ offset = 0,
501
+ }: {
502
+ domain?: string;
503
+ domainOwnership?: string;
504
+ limit?: number;
505
+ offset?: number;
506
+ }): Promise<sandbox_openapi.HandleListDomainMappingsResponse> {
507
+ const response = await sandbox_openapi.handleListDomainMappings({
508
+ client: this.client,
509
+ query: {
510
+ limit,
511
+ offset,
512
+ domain,
513
+ domainOwnership,
514
+ },
515
+ });
516
+ if (response.data) {
517
+ return response.data;
518
+ }
519
+ throw new Error(`Failed to list domain mappings: ${response.error}`);
520
+ }
521
+
442
522
  /**
443
523
  * Create a new git repository.
444
524
  */
@@ -1150,7 +1230,7 @@ export class FreestyleSandboxes {
1150
1230
  await sandbox_openapi.handleReadFileFromEphemeralDevServer({
1151
1231
  client,
1152
1232
  path: {
1153
- filepath: path,
1233
+ "*filepath": path,
1154
1234
  },
1155
1235
  body: {
1156
1236
  devServer: devServerInstance,