modal 0.8.1 → 0.8.2
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 +1 -0
- package/dist/index.cjs +486 -7
- package/dist/index.d.cts +108 -1
- package/dist/index.d.ts +108 -1
- package/dist/index.js +486 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -13401,13 +13401,16 @@ var ContainerReloadVolumesResponse = {
|
|
|
13401
13401
|
}
|
|
13402
13402
|
};
|
|
13403
13403
|
function createBaseContainerStopRequest() {
|
|
13404
|
-
return { taskId: "" };
|
|
13404
|
+
return { taskId: "", graceful: false };
|
|
13405
13405
|
}
|
|
13406
13406
|
var ContainerStopRequest = {
|
|
13407
13407
|
encode(message, writer = new BinaryWriter()) {
|
|
13408
13408
|
if (message.taskId !== "") {
|
|
13409
13409
|
writer.uint32(10).string(message.taskId);
|
|
13410
13410
|
}
|
|
13411
|
+
if (message.graceful !== false) {
|
|
13412
|
+
writer.uint32(16).bool(message.graceful);
|
|
13413
|
+
}
|
|
13411
13414
|
return writer;
|
|
13412
13415
|
},
|
|
13413
13416
|
decode(input, length) {
|
|
@@ -13424,6 +13427,13 @@ var ContainerStopRequest = {
|
|
|
13424
13427
|
message.taskId = reader.string();
|
|
13425
13428
|
continue;
|
|
13426
13429
|
}
|
|
13430
|
+
case 2: {
|
|
13431
|
+
if (tag !== 16) {
|
|
13432
|
+
break;
|
|
13433
|
+
}
|
|
13434
|
+
message.graceful = reader.bool();
|
|
13435
|
+
continue;
|
|
13436
|
+
}
|
|
13427
13437
|
}
|
|
13428
13438
|
if ((tag & 7) === 4 || tag === 0) {
|
|
13429
13439
|
break;
|
|
@@ -13433,13 +13443,19 @@ var ContainerStopRequest = {
|
|
|
13433
13443
|
return message;
|
|
13434
13444
|
},
|
|
13435
13445
|
fromJSON(object) {
|
|
13436
|
-
return {
|
|
13446
|
+
return {
|
|
13447
|
+
taskId: isSet5(object.taskId) ? globalThis.String(object.taskId) : "",
|
|
13448
|
+
graceful: isSet5(object.graceful) ? globalThis.Boolean(object.graceful) : false
|
|
13449
|
+
};
|
|
13437
13450
|
},
|
|
13438
13451
|
toJSON(message) {
|
|
13439
13452
|
const obj = {};
|
|
13440
13453
|
if (message.taskId !== "") {
|
|
13441
13454
|
obj.taskId = message.taskId;
|
|
13442
13455
|
}
|
|
13456
|
+
if (message.graceful !== false) {
|
|
13457
|
+
obj.graceful = message.graceful;
|
|
13458
|
+
}
|
|
13443
13459
|
return obj;
|
|
13444
13460
|
},
|
|
13445
13461
|
create(base) {
|
|
@@ -13448,6 +13464,7 @@ var ContainerStopRequest = {
|
|
|
13448
13464
|
fromPartial(object) {
|
|
13449
13465
|
const message = createBaseContainerStopRequest();
|
|
13450
13466
|
message.taskId = object.taskId ?? "";
|
|
13467
|
+
message.graceful = object.graceful ?? false;
|
|
13451
13468
|
return message;
|
|
13452
13469
|
}
|
|
13453
13470
|
};
|
|
@@ -25958,7 +25975,8 @@ function createBaseFunctionOptions() {
|
|
|
25958
25975
|
cloudProviderStr: void 0,
|
|
25959
25976
|
replaceCloudBucketMounts: false,
|
|
25960
25977
|
cloudBucketMounts: [],
|
|
25961
|
-
pinnedAppVersion: void 0
|
|
25978
|
+
pinnedAppVersion: void 0,
|
|
25979
|
+
routingRegion: void 0
|
|
25962
25980
|
};
|
|
25963
25981
|
}
|
|
25964
25982
|
var FunctionOptions = {
|
|
@@ -26026,6 +26044,9 @@ var FunctionOptions = {
|
|
|
26026
26044
|
if (message.pinnedAppVersion !== void 0) {
|
|
26027
26045
|
writer.uint32(168).int32(message.pinnedAppVersion);
|
|
26028
26046
|
}
|
|
26047
|
+
if (message.routingRegion !== void 0) {
|
|
26048
|
+
writer.uint32(178).string(message.routingRegion);
|
|
26049
|
+
}
|
|
26029
26050
|
return writer;
|
|
26030
26051
|
},
|
|
26031
26052
|
decode(input, length) {
|
|
@@ -26182,6 +26203,13 @@ var FunctionOptions = {
|
|
|
26182
26203
|
message.pinnedAppVersion = reader.int32();
|
|
26183
26204
|
continue;
|
|
26184
26205
|
}
|
|
26206
|
+
case 22: {
|
|
26207
|
+
if (tag !== 178) {
|
|
26208
|
+
break;
|
|
26209
|
+
}
|
|
26210
|
+
message.routingRegion = reader.string();
|
|
26211
|
+
continue;
|
|
26212
|
+
}
|
|
26185
26213
|
}
|
|
26186
26214
|
if ((tag & 7) === 4 || tag === 0) {
|
|
26187
26215
|
break;
|
|
@@ -26212,7 +26240,8 @@ var FunctionOptions = {
|
|
|
26212
26240
|
cloudProviderStr: isSet5(object.cloudProviderStr) ? globalThis.String(object.cloudProviderStr) : void 0,
|
|
26213
26241
|
replaceCloudBucketMounts: isSet5(object.replaceCloudBucketMounts) ? globalThis.Boolean(object.replaceCloudBucketMounts) : false,
|
|
26214
26242
|
cloudBucketMounts: globalThis.Array.isArray(object?.cloudBucketMounts) ? object.cloudBucketMounts.map((e) => CloudBucketMount.fromJSON(e)) : [],
|
|
26215
|
-
pinnedAppVersion: isSet5(object.pinnedAppVersion) ? globalThis.Number(object.pinnedAppVersion) : void 0
|
|
26243
|
+
pinnedAppVersion: isSet5(object.pinnedAppVersion) ? globalThis.Number(object.pinnedAppVersion) : void 0,
|
|
26244
|
+
routingRegion: isSet5(object.routingRegion) ? globalThis.String(object.routingRegion) : void 0
|
|
26216
26245
|
};
|
|
26217
26246
|
},
|
|
26218
26247
|
toJSON(message) {
|
|
@@ -26280,6 +26309,9 @@ var FunctionOptions = {
|
|
|
26280
26309
|
if (message.pinnedAppVersion !== void 0) {
|
|
26281
26310
|
obj.pinnedAppVersion = Math.round(message.pinnedAppVersion);
|
|
26282
26311
|
}
|
|
26312
|
+
if (message.routingRegion !== void 0) {
|
|
26313
|
+
obj.routingRegion = message.routingRegion;
|
|
26314
|
+
}
|
|
26283
26315
|
return obj;
|
|
26284
26316
|
},
|
|
26285
26317
|
create(base) {
|
|
@@ -26308,6 +26340,7 @@ var FunctionOptions = {
|
|
|
26308
26340
|
message.replaceCloudBucketMounts = object.replaceCloudBucketMounts ?? false;
|
|
26309
26341
|
message.cloudBucketMounts = object.cloudBucketMounts?.map((e) => CloudBucketMount.fromPartial(e)) || [];
|
|
26310
26342
|
message.pinnedAppVersion = object.pinnedAppVersion ?? void 0;
|
|
26343
|
+
message.routingRegion = object.routingRegion ?? void 0;
|
|
26311
26344
|
return message;
|
|
26312
26345
|
}
|
|
26313
26346
|
};
|
|
@@ -30341,7 +30374,7 @@ var ImageRegistryConfig = {
|
|
|
30341
30374
|
}
|
|
30342
30375
|
};
|
|
30343
30376
|
function createBaseImageTagRevisionsItem() {
|
|
30344
|
-
return { imageId: "", revisionId: "", createdAt: 0 };
|
|
30377
|
+
return { imageId: "", revisionId: "", createdAt: 0, publishedBy: "" };
|
|
30345
30378
|
}
|
|
30346
30379
|
var ImageTagRevisionsItem = {
|
|
30347
30380
|
encode(message, writer = new BinaryWriter()) {
|
|
@@ -30354,6 +30387,9 @@ var ImageTagRevisionsItem = {
|
|
|
30354
30387
|
if (message.createdAt !== 0) {
|
|
30355
30388
|
writer.uint32(25).double(message.createdAt);
|
|
30356
30389
|
}
|
|
30390
|
+
if (message.publishedBy !== "") {
|
|
30391
|
+
writer.uint32(34).string(message.publishedBy);
|
|
30392
|
+
}
|
|
30357
30393
|
return writer;
|
|
30358
30394
|
},
|
|
30359
30395
|
decode(input, length) {
|
|
@@ -30384,6 +30420,13 @@ var ImageTagRevisionsItem = {
|
|
|
30384
30420
|
message.createdAt = reader.double();
|
|
30385
30421
|
continue;
|
|
30386
30422
|
}
|
|
30423
|
+
case 4: {
|
|
30424
|
+
if (tag !== 34) {
|
|
30425
|
+
break;
|
|
30426
|
+
}
|
|
30427
|
+
message.publishedBy = reader.string();
|
|
30428
|
+
continue;
|
|
30429
|
+
}
|
|
30387
30430
|
}
|
|
30388
30431
|
if ((tag & 7) === 4 || tag === 0) {
|
|
30389
30432
|
break;
|
|
@@ -30396,7 +30439,8 @@ var ImageTagRevisionsItem = {
|
|
|
30396
30439
|
return {
|
|
30397
30440
|
imageId: isSet5(object.imageId) ? globalThis.String(object.imageId) : "",
|
|
30398
30441
|
revisionId: isSet5(object.revisionId) ? globalThis.String(object.revisionId) : "",
|
|
30399
|
-
createdAt: isSet5(object.createdAt) ? globalThis.Number(object.createdAt) : 0
|
|
30442
|
+
createdAt: isSet5(object.createdAt) ? globalThis.Number(object.createdAt) : 0,
|
|
30443
|
+
publishedBy: isSet5(object.publishedBy) ? globalThis.String(object.publishedBy) : ""
|
|
30400
30444
|
};
|
|
30401
30445
|
},
|
|
30402
30446
|
toJSON(message) {
|
|
@@ -30410,6 +30454,9 @@ var ImageTagRevisionsItem = {
|
|
|
30410
30454
|
if (message.createdAt !== 0) {
|
|
30411
30455
|
obj.createdAt = message.createdAt;
|
|
30412
30456
|
}
|
|
30457
|
+
if (message.publishedBy !== "") {
|
|
30458
|
+
obj.publishedBy = message.publishedBy;
|
|
30459
|
+
}
|
|
30413
30460
|
return obj;
|
|
30414
30461
|
},
|
|
30415
30462
|
create(base) {
|
|
@@ -30420,6 +30467,7 @@ var ImageTagRevisionsItem = {
|
|
|
30420
30467
|
message.imageId = object.imageId ?? "";
|
|
30421
30468
|
message.revisionId = object.revisionId ?? "";
|
|
30422
30469
|
message.createdAt = object.createdAt ?? 0;
|
|
30470
|
+
message.publishedBy = object.publishedBy ?? "";
|
|
30423
30471
|
return message;
|
|
30424
30472
|
}
|
|
30425
30473
|
};
|
|
@@ -51359,6 +51407,231 @@ var WorkspaceNameLookupResponse = {
|
|
|
51359
51407
|
return message;
|
|
51360
51408
|
}
|
|
51361
51409
|
};
|
|
51410
|
+
function createBaseWorkspaceSetDefaultEnvironmentRequest() {
|
|
51411
|
+
return { environmentName: "" };
|
|
51412
|
+
}
|
|
51413
|
+
var WorkspaceSetDefaultEnvironmentRequest = {
|
|
51414
|
+
encode(message, writer = new BinaryWriter()) {
|
|
51415
|
+
if (message.environmentName !== "") {
|
|
51416
|
+
writer.uint32(10).string(message.environmentName);
|
|
51417
|
+
}
|
|
51418
|
+
return writer;
|
|
51419
|
+
},
|
|
51420
|
+
decode(input, length) {
|
|
51421
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
51422
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
51423
|
+
const message = createBaseWorkspaceSetDefaultEnvironmentRequest();
|
|
51424
|
+
while (reader.pos < end) {
|
|
51425
|
+
const tag = reader.uint32();
|
|
51426
|
+
switch (tag >>> 3) {
|
|
51427
|
+
case 1: {
|
|
51428
|
+
if (tag !== 10) {
|
|
51429
|
+
break;
|
|
51430
|
+
}
|
|
51431
|
+
message.environmentName = reader.string();
|
|
51432
|
+
continue;
|
|
51433
|
+
}
|
|
51434
|
+
}
|
|
51435
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
51436
|
+
break;
|
|
51437
|
+
}
|
|
51438
|
+
reader.skip(tag & 7);
|
|
51439
|
+
}
|
|
51440
|
+
return message;
|
|
51441
|
+
},
|
|
51442
|
+
fromJSON(object) {
|
|
51443
|
+
return { environmentName: isSet5(object.environmentName) ? globalThis.String(object.environmentName) : "" };
|
|
51444
|
+
},
|
|
51445
|
+
toJSON(message) {
|
|
51446
|
+
const obj = {};
|
|
51447
|
+
if (message.environmentName !== "") {
|
|
51448
|
+
obj.environmentName = message.environmentName;
|
|
51449
|
+
}
|
|
51450
|
+
return obj;
|
|
51451
|
+
},
|
|
51452
|
+
create(base) {
|
|
51453
|
+
return WorkspaceSetDefaultEnvironmentRequest.fromPartial(base ?? {});
|
|
51454
|
+
},
|
|
51455
|
+
fromPartial(object) {
|
|
51456
|
+
const message = createBaseWorkspaceSetDefaultEnvironmentRequest();
|
|
51457
|
+
message.environmentName = object.environmentName ?? "";
|
|
51458
|
+
return message;
|
|
51459
|
+
}
|
|
51460
|
+
};
|
|
51461
|
+
function createBaseWorkspaceSetImageBuilderVersionRequest() {
|
|
51462
|
+
return { newImageBuilderVersion: "" };
|
|
51463
|
+
}
|
|
51464
|
+
var WorkspaceSetImageBuilderVersionRequest = {
|
|
51465
|
+
encode(message, writer = new BinaryWriter()) {
|
|
51466
|
+
if (message.newImageBuilderVersion !== "") {
|
|
51467
|
+
writer.uint32(10).string(message.newImageBuilderVersion);
|
|
51468
|
+
}
|
|
51469
|
+
return writer;
|
|
51470
|
+
},
|
|
51471
|
+
decode(input, length) {
|
|
51472
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
51473
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
51474
|
+
const message = createBaseWorkspaceSetImageBuilderVersionRequest();
|
|
51475
|
+
while (reader.pos < end) {
|
|
51476
|
+
const tag = reader.uint32();
|
|
51477
|
+
switch (tag >>> 3) {
|
|
51478
|
+
case 1: {
|
|
51479
|
+
if (tag !== 10) {
|
|
51480
|
+
break;
|
|
51481
|
+
}
|
|
51482
|
+
message.newImageBuilderVersion = reader.string();
|
|
51483
|
+
continue;
|
|
51484
|
+
}
|
|
51485
|
+
}
|
|
51486
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
51487
|
+
break;
|
|
51488
|
+
}
|
|
51489
|
+
reader.skip(tag & 7);
|
|
51490
|
+
}
|
|
51491
|
+
return message;
|
|
51492
|
+
},
|
|
51493
|
+
fromJSON(object) {
|
|
51494
|
+
return {
|
|
51495
|
+
newImageBuilderVersion: isSet5(object.newImageBuilderVersion) ? globalThis.String(object.newImageBuilderVersion) : ""
|
|
51496
|
+
};
|
|
51497
|
+
},
|
|
51498
|
+
toJSON(message) {
|
|
51499
|
+
const obj = {};
|
|
51500
|
+
if (message.newImageBuilderVersion !== "") {
|
|
51501
|
+
obj.newImageBuilderVersion = message.newImageBuilderVersion;
|
|
51502
|
+
}
|
|
51503
|
+
return obj;
|
|
51504
|
+
},
|
|
51505
|
+
create(base) {
|
|
51506
|
+
return WorkspaceSetImageBuilderVersionRequest.fromPartial(base ?? {});
|
|
51507
|
+
},
|
|
51508
|
+
fromPartial(object) {
|
|
51509
|
+
const message = createBaseWorkspaceSetImageBuilderVersionRequest();
|
|
51510
|
+
message.newImageBuilderVersion = object.newImageBuilderVersion ?? "";
|
|
51511
|
+
return message;
|
|
51512
|
+
}
|
|
51513
|
+
};
|
|
51514
|
+
function createBaseWorkspaceSetImageBuilderVersionResponse() {
|
|
51515
|
+
return { imageBuilderVersion: "" };
|
|
51516
|
+
}
|
|
51517
|
+
var WorkspaceSetImageBuilderVersionResponse = {
|
|
51518
|
+
encode(message, writer = new BinaryWriter()) {
|
|
51519
|
+
if (message.imageBuilderVersion !== "") {
|
|
51520
|
+
writer.uint32(10).string(message.imageBuilderVersion);
|
|
51521
|
+
}
|
|
51522
|
+
return writer;
|
|
51523
|
+
},
|
|
51524
|
+
decode(input, length) {
|
|
51525
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
51526
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
51527
|
+
const message = createBaseWorkspaceSetImageBuilderVersionResponse();
|
|
51528
|
+
while (reader.pos < end) {
|
|
51529
|
+
const tag = reader.uint32();
|
|
51530
|
+
switch (tag >>> 3) {
|
|
51531
|
+
case 1: {
|
|
51532
|
+
if (tag !== 10) {
|
|
51533
|
+
break;
|
|
51534
|
+
}
|
|
51535
|
+
message.imageBuilderVersion = reader.string();
|
|
51536
|
+
continue;
|
|
51537
|
+
}
|
|
51538
|
+
}
|
|
51539
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
51540
|
+
break;
|
|
51541
|
+
}
|
|
51542
|
+
reader.skip(tag & 7);
|
|
51543
|
+
}
|
|
51544
|
+
return message;
|
|
51545
|
+
},
|
|
51546
|
+
fromJSON(object) {
|
|
51547
|
+
return {
|
|
51548
|
+
imageBuilderVersion: isSet5(object.imageBuilderVersion) ? globalThis.String(object.imageBuilderVersion) : ""
|
|
51549
|
+
};
|
|
51550
|
+
},
|
|
51551
|
+
toJSON(message) {
|
|
51552
|
+
const obj = {};
|
|
51553
|
+
if (message.imageBuilderVersion !== "") {
|
|
51554
|
+
obj.imageBuilderVersion = message.imageBuilderVersion;
|
|
51555
|
+
}
|
|
51556
|
+
return obj;
|
|
51557
|
+
},
|
|
51558
|
+
create(base) {
|
|
51559
|
+
return WorkspaceSetImageBuilderVersionResponse.fromPartial(base ?? {});
|
|
51560
|
+
},
|
|
51561
|
+
fromPartial(object) {
|
|
51562
|
+
const message = createBaseWorkspaceSetImageBuilderVersionResponse();
|
|
51563
|
+
message.imageBuilderVersion = object.imageBuilderVersion ?? "";
|
|
51564
|
+
return message;
|
|
51565
|
+
}
|
|
51566
|
+
};
|
|
51567
|
+
function createBaseWorkspaceSettingsResponse() {
|
|
51568
|
+
return { defaultEnvironmentName: "", imageBuilderVersion: "" };
|
|
51569
|
+
}
|
|
51570
|
+
var WorkspaceSettingsResponse = {
|
|
51571
|
+
encode(message, writer = new BinaryWriter()) {
|
|
51572
|
+
if (message.defaultEnvironmentName !== "") {
|
|
51573
|
+
writer.uint32(10).string(message.defaultEnvironmentName);
|
|
51574
|
+
}
|
|
51575
|
+
if (message.imageBuilderVersion !== "") {
|
|
51576
|
+
writer.uint32(18).string(message.imageBuilderVersion);
|
|
51577
|
+
}
|
|
51578
|
+
return writer;
|
|
51579
|
+
},
|
|
51580
|
+
decode(input, length) {
|
|
51581
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
51582
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
51583
|
+
const message = createBaseWorkspaceSettingsResponse();
|
|
51584
|
+
while (reader.pos < end) {
|
|
51585
|
+
const tag = reader.uint32();
|
|
51586
|
+
switch (tag >>> 3) {
|
|
51587
|
+
case 1: {
|
|
51588
|
+
if (tag !== 10) {
|
|
51589
|
+
break;
|
|
51590
|
+
}
|
|
51591
|
+
message.defaultEnvironmentName = reader.string();
|
|
51592
|
+
continue;
|
|
51593
|
+
}
|
|
51594
|
+
case 2: {
|
|
51595
|
+
if (tag !== 18) {
|
|
51596
|
+
break;
|
|
51597
|
+
}
|
|
51598
|
+
message.imageBuilderVersion = reader.string();
|
|
51599
|
+
continue;
|
|
51600
|
+
}
|
|
51601
|
+
}
|
|
51602
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
51603
|
+
break;
|
|
51604
|
+
}
|
|
51605
|
+
reader.skip(tag & 7);
|
|
51606
|
+
}
|
|
51607
|
+
return message;
|
|
51608
|
+
},
|
|
51609
|
+
fromJSON(object) {
|
|
51610
|
+
return {
|
|
51611
|
+
defaultEnvironmentName: isSet5(object.defaultEnvironmentName) ? globalThis.String(object.defaultEnvironmentName) : "",
|
|
51612
|
+
imageBuilderVersion: isSet5(object.imageBuilderVersion) ? globalThis.String(object.imageBuilderVersion) : ""
|
|
51613
|
+
};
|
|
51614
|
+
},
|
|
51615
|
+
toJSON(message) {
|
|
51616
|
+
const obj = {};
|
|
51617
|
+
if (message.defaultEnvironmentName !== "") {
|
|
51618
|
+
obj.defaultEnvironmentName = message.defaultEnvironmentName;
|
|
51619
|
+
}
|
|
51620
|
+
if (message.imageBuilderVersion !== "") {
|
|
51621
|
+
obj.imageBuilderVersion = message.imageBuilderVersion;
|
|
51622
|
+
}
|
|
51623
|
+
return obj;
|
|
51624
|
+
},
|
|
51625
|
+
create(base) {
|
|
51626
|
+
return WorkspaceSettingsResponse.fromPartial(base ?? {});
|
|
51627
|
+
},
|
|
51628
|
+
fromPartial(object) {
|
|
51629
|
+
const message = createBaseWorkspaceSettingsResponse();
|
|
51630
|
+
message.defaultEnvironmentName = object.defaultEnvironmentName ?? "";
|
|
51631
|
+
message.imageBuilderVersion = object.imageBuilderVersion ?? "";
|
|
51632
|
+
return message;
|
|
51633
|
+
}
|
|
51634
|
+
};
|
|
51362
51635
|
var ModalClientDefinition = {
|
|
51363
51636
|
name: "ModalClient",
|
|
51364
51637
|
fullName: "modal.client.ModalClient",
|
|
@@ -53143,6 +53416,30 @@ var ModalClientDefinition = {
|
|
|
53143
53416
|
responseType: WorkspaceNameLookupResponse,
|
|
53144
53417
|
responseStream: false,
|
|
53145
53418
|
options: {}
|
|
53419
|
+
},
|
|
53420
|
+
workspaceSetDefaultEnvironment: {
|
|
53421
|
+
name: "WorkspaceSetDefaultEnvironment",
|
|
53422
|
+
requestType: WorkspaceSetDefaultEnvironmentRequest,
|
|
53423
|
+
requestStream: false,
|
|
53424
|
+
responseType: Empty,
|
|
53425
|
+
responseStream: false,
|
|
53426
|
+
options: {}
|
|
53427
|
+
},
|
|
53428
|
+
workspaceSetImageBuilderVersion: {
|
|
53429
|
+
name: "WorkspaceSetImageBuilderVersion",
|
|
53430
|
+
requestType: WorkspaceSetImageBuilderVersionRequest,
|
|
53431
|
+
requestStream: false,
|
|
53432
|
+
responseType: WorkspaceSetImageBuilderVersionResponse,
|
|
53433
|
+
responseStream: false,
|
|
53434
|
+
options: {}
|
|
53435
|
+
},
|
|
53436
|
+
workspaceSettings: {
|
|
53437
|
+
name: "WorkspaceSettings",
|
|
53438
|
+
requestType: Empty,
|
|
53439
|
+
requestStream: false,
|
|
53440
|
+
responseType: WorkspaceSettingsResponse,
|
|
53441
|
+
responseStream: false,
|
|
53442
|
+
options: {}
|
|
53146
53443
|
}
|
|
53147
53444
|
}
|
|
53148
53445
|
};
|
|
@@ -58416,6 +58713,94 @@ var TaskMountDirectoryRequest = {
|
|
|
58416
58713
|
return message;
|
|
58417
58714
|
}
|
|
58418
58715
|
};
|
|
58716
|
+
function createBaseTaskReloadVolumesRequest() {
|
|
58717
|
+
return { taskId: "" };
|
|
58718
|
+
}
|
|
58719
|
+
var TaskReloadVolumesRequest = {
|
|
58720
|
+
encode(message, writer = new BinaryWriter()) {
|
|
58721
|
+
if (message.taskId !== "") {
|
|
58722
|
+
writer.uint32(10).string(message.taskId);
|
|
58723
|
+
}
|
|
58724
|
+
return writer;
|
|
58725
|
+
},
|
|
58726
|
+
decode(input, length) {
|
|
58727
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
58728
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
58729
|
+
const message = createBaseTaskReloadVolumesRequest();
|
|
58730
|
+
while (reader.pos < end) {
|
|
58731
|
+
const tag = reader.uint32();
|
|
58732
|
+
switch (tag >>> 3) {
|
|
58733
|
+
case 1: {
|
|
58734
|
+
if (tag !== 10) {
|
|
58735
|
+
break;
|
|
58736
|
+
}
|
|
58737
|
+
message.taskId = reader.string();
|
|
58738
|
+
continue;
|
|
58739
|
+
}
|
|
58740
|
+
}
|
|
58741
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
58742
|
+
break;
|
|
58743
|
+
}
|
|
58744
|
+
reader.skip(tag & 7);
|
|
58745
|
+
}
|
|
58746
|
+
return message;
|
|
58747
|
+
},
|
|
58748
|
+
fromJSON(object) {
|
|
58749
|
+
return { taskId: isSet6(object.taskId) ? globalThis.String(object.taskId) : "" };
|
|
58750
|
+
},
|
|
58751
|
+
toJSON(message) {
|
|
58752
|
+
const obj = {};
|
|
58753
|
+
if (message.taskId !== "") {
|
|
58754
|
+
obj.taskId = message.taskId;
|
|
58755
|
+
}
|
|
58756
|
+
return obj;
|
|
58757
|
+
},
|
|
58758
|
+
create(base) {
|
|
58759
|
+
return TaskReloadVolumesRequest.fromPartial(base ?? {});
|
|
58760
|
+
},
|
|
58761
|
+
fromPartial(object) {
|
|
58762
|
+
const message = createBaseTaskReloadVolumesRequest();
|
|
58763
|
+
message.taskId = object.taskId ?? "";
|
|
58764
|
+
return message;
|
|
58765
|
+
}
|
|
58766
|
+
};
|
|
58767
|
+
function createBaseTaskReloadVolumesResponse() {
|
|
58768
|
+
return {};
|
|
58769
|
+
}
|
|
58770
|
+
var TaskReloadVolumesResponse = {
|
|
58771
|
+
encode(_, writer = new BinaryWriter()) {
|
|
58772
|
+
return writer;
|
|
58773
|
+
},
|
|
58774
|
+
decode(input, length) {
|
|
58775
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
58776
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
58777
|
+
const message = createBaseTaskReloadVolumesResponse();
|
|
58778
|
+
while (reader.pos < end) {
|
|
58779
|
+
const tag = reader.uint32();
|
|
58780
|
+
switch (tag >>> 3) {
|
|
58781
|
+
}
|
|
58782
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
58783
|
+
break;
|
|
58784
|
+
}
|
|
58785
|
+
reader.skip(tag & 7);
|
|
58786
|
+
}
|
|
58787
|
+
return message;
|
|
58788
|
+
},
|
|
58789
|
+
fromJSON(_) {
|
|
58790
|
+
return {};
|
|
58791
|
+
},
|
|
58792
|
+
toJSON(_) {
|
|
58793
|
+
const obj = {};
|
|
58794
|
+
return obj;
|
|
58795
|
+
},
|
|
58796
|
+
create(base) {
|
|
58797
|
+
return TaskReloadVolumesResponse.fromPartial(base ?? {});
|
|
58798
|
+
},
|
|
58799
|
+
fromPartial(_) {
|
|
58800
|
+
const message = createBaseTaskReloadVolumesResponse();
|
|
58801
|
+
return message;
|
|
58802
|
+
}
|
|
58803
|
+
};
|
|
58419
58804
|
function createBaseTaskSetNetworkAccessRequest() {
|
|
58420
58805
|
return { taskId: "", networkAccess: void 0 };
|
|
58421
58806
|
}
|
|
@@ -59061,6 +59446,15 @@ var TaskCommandRouterDefinition = {
|
|
|
59061
59446
|
responseStream: false,
|
|
59062
59447
|
options: {}
|
|
59063
59448
|
},
|
|
59449
|
+
/** Reload all Volumes mounted in the task to reflect their latest committed state. */
|
|
59450
|
+
taskReloadVolumes: {
|
|
59451
|
+
name: "TaskReloadVolumes",
|
|
59452
|
+
requestType: TaskReloadVolumesRequest,
|
|
59453
|
+
requestStream: false,
|
|
59454
|
+
responseType: TaskReloadVolumesResponse,
|
|
59455
|
+
responseStream: false,
|
|
59456
|
+
options: {}
|
|
59457
|
+
},
|
|
59064
59458
|
/** Replace the task's outbound network allowlist (domains + CIDRs). */
|
|
59065
59459
|
taskSetNetworkAccess: {
|
|
59066
59460
|
name: "TaskSetNetworkAccess",
|
|
@@ -59464,8 +59858,9 @@ var AuthTokenManager = class {
|
|
|
59464
59858
|
};
|
|
59465
59859
|
|
|
59466
59860
|
// src/version.ts
|
|
59861
|
+
var SDK_VERSION = "0.8.2";
|
|
59467
59862
|
function getSDKVersion() {
|
|
59468
|
-
return
|
|
59863
|
+
return SDK_VERSION;
|
|
59469
59864
|
}
|
|
59470
59865
|
|
|
59471
59866
|
// src/logger.ts
|
|
@@ -60361,6 +60756,13 @@ var TaskCommandRouterClientImpl = class _TaskCommandRouterClientImpl {
|
|
|
60361
60756
|
async unmountDirectory(request) {
|
|
60362
60757
|
await this.callUnary(() => this.stub.taskUnmountDirectory(request));
|
|
60363
60758
|
}
|
|
60759
|
+
async setNetworkAccess(request) {
|
|
60760
|
+
await this.callUnary(() => this.stub.taskSetNetworkAccess(request));
|
|
60761
|
+
}
|
|
60762
|
+
/** Reload all Volumes mounted in the task to reflect their latest committed state. */
|
|
60763
|
+
async reloadVolumes(request) {
|
|
60764
|
+
await this.callUnary(() => this.stub.taskReloadVolumes(request));
|
|
60765
|
+
}
|
|
60364
60766
|
async sandboxWaitUntilReady(taskId, timeoutMs) {
|
|
60365
60767
|
const deadlineMs = Date.now() + timeoutMs;
|
|
60366
60768
|
try {
|
|
@@ -62007,6 +62409,41 @@ var SandboxService = class {
|
|
|
62007
62409
|
}
|
|
62008
62410
|
}
|
|
62009
62411
|
}
|
|
62412
|
+
/**
|
|
62413
|
+
* List the V2 {@link Sandbox}es in an {@link App}.
|
|
62414
|
+
*
|
|
62415
|
+
* This lists V2 Sandboxes, i.e. Sandboxes created via
|
|
62416
|
+
* {@link SandboxService#experimentalCreate client.sandboxes.experimentalCreate()}.
|
|
62417
|
+
* Such Sandboxes are not returned by
|
|
62418
|
+
* {@link SandboxService#list client.sandboxes.list()}. Filtering based on tags
|
|
62419
|
+
* is not yet supported.
|
|
62420
|
+
*
|
|
62421
|
+
* Yields {@link Sandbox} objects that are currently running in the App.
|
|
62422
|
+
*
|
|
62423
|
+
* EXPERIMENTAL: the API is subject to change.
|
|
62424
|
+
*/
|
|
62425
|
+
async *experimentalList(params) {
|
|
62426
|
+
if (!params?.appId) {
|
|
62427
|
+
throw new InvalidError(
|
|
62428
|
+
'experimentalList requires an `appId`:\n\nconst app = await modal.apps.fromName("my-app");\nmodal.sandboxes.experimentalList({ appId: app.appId });'
|
|
62429
|
+
);
|
|
62430
|
+
}
|
|
62431
|
+
let beforeTimestamp = void 0;
|
|
62432
|
+
while (true) {
|
|
62433
|
+
const resp = await this.#client.cpClient.sandboxListV2({
|
|
62434
|
+
appId: params.appId,
|
|
62435
|
+
beforeTimestamp,
|
|
62436
|
+
includeFinished: false
|
|
62437
|
+
});
|
|
62438
|
+
if (!resp.sandboxes || resp.sandboxes.length === 0) {
|
|
62439
|
+
return;
|
|
62440
|
+
}
|
|
62441
|
+
for (const info of resp.sandboxes) {
|
|
62442
|
+
yield new Sandbox2(this.#client, info.id, { isV2: true });
|
|
62443
|
+
}
|
|
62444
|
+
beforeTimestamp = resp.sandboxes[resp.sandboxes.length - 1].createdAt;
|
|
62445
|
+
}
|
|
62446
|
+
}
|
|
62010
62447
|
};
|
|
62011
62448
|
var Tunnel = class {
|
|
62012
62449
|
/** @ignore */
|
|
@@ -62602,6 +63039,48 @@ var Sandbox2 = class _Sandbox {
|
|
|
62602
63039
|
});
|
|
62603
63040
|
await commandRouterClient.unmountDirectory(request);
|
|
62604
63041
|
}
|
|
63042
|
+
/**
|
|
63043
|
+
* Updates the outbound network policy of a running Sandbox.
|
|
63044
|
+
*
|
|
63045
|
+
* Established connections that the new policy no longer permits are terminated.
|
|
63046
|
+
*
|
|
63047
|
+
* @param params - Both `outboundCidrAllowlist` and `outboundDomainAllowlist` must be provided.
|
|
63048
|
+
*/
|
|
63049
|
+
async updateNetworkPolicy(params) {
|
|
63050
|
+
this.#ensureAttached();
|
|
63051
|
+
if (params.outboundCidrAllowlist === void 0 || params.outboundDomainAllowlist === void 0) {
|
|
63052
|
+
throw new InvalidError(
|
|
63053
|
+
"updateNetworkPolicy currently requires both outboundCidrAllowlist and outboundDomainAllowlist to be set"
|
|
63054
|
+
);
|
|
63055
|
+
}
|
|
63056
|
+
const [taskId, commandRouterClient] = await this.#getCommandRouter();
|
|
63057
|
+
const request = TaskSetNetworkAccessRequest.create({
|
|
63058
|
+
taskId,
|
|
63059
|
+
networkAccess: NetworkAccess.create({
|
|
63060
|
+
networkAccessType: 3 /* ALLOWLIST */,
|
|
63061
|
+
allowedCidrs: params.outboundCidrAllowlist,
|
|
63062
|
+
allowedDomains: params.outboundDomainAllowlist
|
|
63063
|
+
})
|
|
63064
|
+
});
|
|
63065
|
+
await commandRouterClient.setNetworkAccess(request);
|
|
63066
|
+
}
|
|
63067
|
+
/**
|
|
63068
|
+
* Reload all Volumes mounted in the Sandbox.
|
|
63069
|
+
*/
|
|
63070
|
+
async reloadVolumes() {
|
|
63071
|
+
this.#ensureAttached();
|
|
63072
|
+
const taskId = await this.#getTaskId();
|
|
63073
|
+
if (this.#isV2) {
|
|
63074
|
+
const commandRouterClient = await this.#getOrCreateCommandRouterClient(taskId);
|
|
63075
|
+
await commandRouterClient.reloadVolumes(
|
|
63076
|
+
TaskReloadVolumesRequest.create({ taskId })
|
|
63077
|
+
);
|
|
63078
|
+
} else {
|
|
63079
|
+
await this.#client.cpClient.containerReloadVolumes(
|
|
63080
|
+
ContainerReloadVolumesRequest.create({ taskId })
|
|
63081
|
+
);
|
|
63082
|
+
}
|
|
63083
|
+
}
|
|
62605
63084
|
/**
|
|
62606
63085
|
* Snapshots and creates a new {@link Image} from a directory in the running sandbox.
|
|
62607
63086
|
*
|