modal 0.8.2 → 0.9.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 +1 -0
- package/dist/index.cjs +1853 -251
- package/dist/index.d.cts +302 -28
- package/dist/index.d.ts +302 -28
- package/dist/index.js +1853 -251
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2017,6 +2017,31 @@ function environmentRoleToJSON(object) {
|
|
|
2017
2017
|
return "UNRECOGNIZED";
|
|
2018
2018
|
}
|
|
2019
2019
|
}
|
|
2020
|
+
function environmentTypeFromJSON(object) {
|
|
2021
|
+
switch (object) {
|
|
2022
|
+
case 0:
|
|
2023
|
+
case "ENVIRONMENT_TYPE_UNSPECIFIED":
|
|
2024
|
+
return 0 /* ENVIRONMENT_TYPE_UNSPECIFIED */;
|
|
2025
|
+
case 1:
|
|
2026
|
+
case "ENVIRONMENT_TYPE_PUBLIC":
|
|
2027
|
+
return 1 /* ENVIRONMENT_TYPE_PUBLIC */;
|
|
2028
|
+
case -1:
|
|
2029
|
+
case "UNRECOGNIZED":
|
|
2030
|
+
default:
|
|
2031
|
+
return -1 /* UNRECOGNIZED */;
|
|
2032
|
+
}
|
|
2033
|
+
}
|
|
2034
|
+
function environmentTypeToJSON(object) {
|
|
2035
|
+
switch (object) {
|
|
2036
|
+
case 0 /* ENVIRONMENT_TYPE_UNSPECIFIED */:
|
|
2037
|
+
return "ENVIRONMENT_TYPE_UNSPECIFIED";
|
|
2038
|
+
case 1 /* ENVIRONMENT_TYPE_PUBLIC */:
|
|
2039
|
+
return "ENVIRONMENT_TYPE_PUBLIC";
|
|
2040
|
+
case -1 /* UNRECOGNIZED */:
|
|
2041
|
+
default:
|
|
2042
|
+
return "UNRECOGNIZED";
|
|
2043
|
+
}
|
|
2044
|
+
}
|
|
2020
2045
|
function execOutputOptionFromJSON(object) {
|
|
2021
2046
|
switch (object) {
|
|
2022
2047
|
case 0:
|
|
@@ -13400,6 +13425,43 @@ var ContainerReloadVolumesResponse = {
|
|
|
13400
13425
|
return message;
|
|
13401
13426
|
}
|
|
13402
13427
|
};
|
|
13428
|
+
function createBaseContainerServerLifecycleReadyRequest() {
|
|
13429
|
+
return {};
|
|
13430
|
+
}
|
|
13431
|
+
var ContainerServerLifecycleReadyRequest = {
|
|
13432
|
+
encode(_, writer = new BinaryWriter()) {
|
|
13433
|
+
return writer;
|
|
13434
|
+
},
|
|
13435
|
+
decode(input, length) {
|
|
13436
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
13437
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
13438
|
+
const message = createBaseContainerServerLifecycleReadyRequest();
|
|
13439
|
+
while (reader.pos < end) {
|
|
13440
|
+
const tag = reader.uint32();
|
|
13441
|
+
switch (tag >>> 3) {
|
|
13442
|
+
}
|
|
13443
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
13444
|
+
break;
|
|
13445
|
+
}
|
|
13446
|
+
reader.skip(tag & 7);
|
|
13447
|
+
}
|
|
13448
|
+
return message;
|
|
13449
|
+
},
|
|
13450
|
+
fromJSON(_) {
|
|
13451
|
+
return {};
|
|
13452
|
+
},
|
|
13453
|
+
toJSON(_) {
|
|
13454
|
+
const obj = {};
|
|
13455
|
+
return obj;
|
|
13456
|
+
},
|
|
13457
|
+
create(base) {
|
|
13458
|
+
return ContainerServerLifecycleReadyRequest.fromPartial(base ?? {});
|
|
13459
|
+
},
|
|
13460
|
+
fromPartial(_) {
|
|
13461
|
+
const message = createBaseContainerServerLifecycleReadyRequest();
|
|
13462
|
+
return message;
|
|
13463
|
+
}
|
|
13464
|
+
};
|
|
13403
13465
|
function createBaseContainerStopRequest() {
|
|
13404
13466
|
return { taskId: "", graceful: false };
|
|
13405
13467
|
}
|
|
@@ -17512,8 +17574,280 @@ var EndpointStopResponse = {
|
|
|
17512
17574
|
return message;
|
|
17513
17575
|
}
|
|
17514
17576
|
};
|
|
17577
|
+
function createBaseEnvironmentBillingSummaryRequest() {
|
|
17578
|
+
return { startTimestamp: void 0, endTimestamp: void 0, environmentId: "" };
|
|
17579
|
+
}
|
|
17580
|
+
var EnvironmentBillingSummaryRequest = {
|
|
17581
|
+
encode(message, writer = new BinaryWriter()) {
|
|
17582
|
+
if (message.startTimestamp !== void 0) {
|
|
17583
|
+
Timestamp.encode(toTimestamp(message.startTimestamp), writer.uint32(10).fork()).join();
|
|
17584
|
+
}
|
|
17585
|
+
if (message.endTimestamp !== void 0) {
|
|
17586
|
+
Timestamp.encode(toTimestamp(message.endTimestamp), writer.uint32(18).fork()).join();
|
|
17587
|
+
}
|
|
17588
|
+
if (message.environmentId !== "") {
|
|
17589
|
+
writer.uint32(26).string(message.environmentId);
|
|
17590
|
+
}
|
|
17591
|
+
return writer;
|
|
17592
|
+
},
|
|
17593
|
+
decode(input, length) {
|
|
17594
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
17595
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
17596
|
+
const message = createBaseEnvironmentBillingSummaryRequest();
|
|
17597
|
+
while (reader.pos < end) {
|
|
17598
|
+
const tag = reader.uint32();
|
|
17599
|
+
switch (tag >>> 3) {
|
|
17600
|
+
case 1: {
|
|
17601
|
+
if (tag !== 10) {
|
|
17602
|
+
break;
|
|
17603
|
+
}
|
|
17604
|
+
message.startTimestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
17605
|
+
continue;
|
|
17606
|
+
}
|
|
17607
|
+
case 2: {
|
|
17608
|
+
if (tag !== 18) {
|
|
17609
|
+
break;
|
|
17610
|
+
}
|
|
17611
|
+
message.endTimestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
17612
|
+
continue;
|
|
17613
|
+
}
|
|
17614
|
+
case 3: {
|
|
17615
|
+
if (tag !== 26) {
|
|
17616
|
+
break;
|
|
17617
|
+
}
|
|
17618
|
+
message.environmentId = reader.string();
|
|
17619
|
+
continue;
|
|
17620
|
+
}
|
|
17621
|
+
}
|
|
17622
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
17623
|
+
break;
|
|
17624
|
+
}
|
|
17625
|
+
reader.skip(tag & 7);
|
|
17626
|
+
}
|
|
17627
|
+
return message;
|
|
17628
|
+
},
|
|
17629
|
+
fromJSON(object) {
|
|
17630
|
+
return {
|
|
17631
|
+
startTimestamp: isSet5(object.startTimestamp) ? fromJsonTimestamp(object.startTimestamp) : void 0,
|
|
17632
|
+
endTimestamp: isSet5(object.endTimestamp) ? fromJsonTimestamp(object.endTimestamp) : void 0,
|
|
17633
|
+
environmentId: isSet5(object.environmentId) ? globalThis.String(object.environmentId) : ""
|
|
17634
|
+
};
|
|
17635
|
+
},
|
|
17636
|
+
toJSON(message) {
|
|
17637
|
+
const obj = {};
|
|
17638
|
+
if (message.startTimestamp !== void 0) {
|
|
17639
|
+
obj.startTimestamp = message.startTimestamp.toISOString();
|
|
17640
|
+
}
|
|
17641
|
+
if (message.endTimestamp !== void 0) {
|
|
17642
|
+
obj.endTimestamp = message.endTimestamp.toISOString();
|
|
17643
|
+
}
|
|
17644
|
+
if (message.environmentId !== "") {
|
|
17645
|
+
obj.environmentId = message.environmentId;
|
|
17646
|
+
}
|
|
17647
|
+
return obj;
|
|
17648
|
+
},
|
|
17649
|
+
create(base) {
|
|
17650
|
+
return EnvironmentBillingSummaryRequest.fromPartial(base ?? {});
|
|
17651
|
+
},
|
|
17652
|
+
fromPartial(object) {
|
|
17653
|
+
const message = createBaseEnvironmentBillingSummaryRequest();
|
|
17654
|
+
message.startTimestamp = object.startTimestamp ?? void 0;
|
|
17655
|
+
message.endTimestamp = object.endTimestamp ?? void 0;
|
|
17656
|
+
message.environmentId = object.environmentId ?? "";
|
|
17657
|
+
return message;
|
|
17658
|
+
}
|
|
17659
|
+
};
|
|
17660
|
+
function createBaseEnvironmentBillingSummaryResponse() {
|
|
17661
|
+
return { startTimestamp: void 0, endTimestamp: void 0, meteredCost: "", meteredCostBreakdown: {} };
|
|
17662
|
+
}
|
|
17663
|
+
var EnvironmentBillingSummaryResponse = {
|
|
17664
|
+
encode(message, writer = new BinaryWriter()) {
|
|
17665
|
+
if (message.startTimestamp !== void 0) {
|
|
17666
|
+
Timestamp.encode(toTimestamp(message.startTimestamp), writer.uint32(10).fork()).join();
|
|
17667
|
+
}
|
|
17668
|
+
if (message.endTimestamp !== void 0) {
|
|
17669
|
+
Timestamp.encode(toTimestamp(message.endTimestamp), writer.uint32(18).fork()).join();
|
|
17670
|
+
}
|
|
17671
|
+
if (message.meteredCost !== "") {
|
|
17672
|
+
writer.uint32(26).string(message.meteredCost);
|
|
17673
|
+
}
|
|
17674
|
+
Object.entries(message.meteredCostBreakdown).forEach(([key, value]) => {
|
|
17675
|
+
EnvironmentBillingSummaryResponse_MeteredCostBreakdownEntry.encode(
|
|
17676
|
+
{ key, value },
|
|
17677
|
+
writer.uint32(34).fork()
|
|
17678
|
+
).join();
|
|
17679
|
+
});
|
|
17680
|
+
return writer;
|
|
17681
|
+
},
|
|
17682
|
+
decode(input, length) {
|
|
17683
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
17684
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
17685
|
+
const message = createBaseEnvironmentBillingSummaryResponse();
|
|
17686
|
+
while (reader.pos < end) {
|
|
17687
|
+
const tag = reader.uint32();
|
|
17688
|
+
switch (tag >>> 3) {
|
|
17689
|
+
case 1: {
|
|
17690
|
+
if (tag !== 10) {
|
|
17691
|
+
break;
|
|
17692
|
+
}
|
|
17693
|
+
message.startTimestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
17694
|
+
continue;
|
|
17695
|
+
}
|
|
17696
|
+
case 2: {
|
|
17697
|
+
if (tag !== 18) {
|
|
17698
|
+
break;
|
|
17699
|
+
}
|
|
17700
|
+
message.endTimestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
17701
|
+
continue;
|
|
17702
|
+
}
|
|
17703
|
+
case 3: {
|
|
17704
|
+
if (tag !== 26) {
|
|
17705
|
+
break;
|
|
17706
|
+
}
|
|
17707
|
+
message.meteredCost = reader.string();
|
|
17708
|
+
continue;
|
|
17709
|
+
}
|
|
17710
|
+
case 4: {
|
|
17711
|
+
if (tag !== 34) {
|
|
17712
|
+
break;
|
|
17713
|
+
}
|
|
17714
|
+
const entry4 = EnvironmentBillingSummaryResponse_MeteredCostBreakdownEntry.decode(reader, reader.uint32());
|
|
17715
|
+
if (entry4.value !== void 0) {
|
|
17716
|
+
message.meteredCostBreakdown[entry4.key] = entry4.value;
|
|
17717
|
+
}
|
|
17718
|
+
continue;
|
|
17719
|
+
}
|
|
17720
|
+
}
|
|
17721
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
17722
|
+
break;
|
|
17723
|
+
}
|
|
17724
|
+
reader.skip(tag & 7);
|
|
17725
|
+
}
|
|
17726
|
+
return message;
|
|
17727
|
+
},
|
|
17728
|
+
fromJSON(object) {
|
|
17729
|
+
return {
|
|
17730
|
+
startTimestamp: isSet5(object.startTimestamp) ? fromJsonTimestamp(object.startTimestamp) : void 0,
|
|
17731
|
+
endTimestamp: isSet5(object.endTimestamp) ? fromJsonTimestamp(object.endTimestamp) : void 0,
|
|
17732
|
+
meteredCost: isSet5(object.meteredCost) ? globalThis.String(object.meteredCost) : "",
|
|
17733
|
+
meteredCostBreakdown: isObject2(object.meteredCostBreakdown) ? Object.entries(object.meteredCostBreakdown).reduce((acc, [key, value]) => {
|
|
17734
|
+
acc[key] = String(value);
|
|
17735
|
+
return acc;
|
|
17736
|
+
}, {}) : {}
|
|
17737
|
+
};
|
|
17738
|
+
},
|
|
17739
|
+
toJSON(message) {
|
|
17740
|
+
const obj = {};
|
|
17741
|
+
if (message.startTimestamp !== void 0) {
|
|
17742
|
+
obj.startTimestamp = message.startTimestamp.toISOString();
|
|
17743
|
+
}
|
|
17744
|
+
if (message.endTimestamp !== void 0) {
|
|
17745
|
+
obj.endTimestamp = message.endTimestamp.toISOString();
|
|
17746
|
+
}
|
|
17747
|
+
if (message.meteredCost !== "") {
|
|
17748
|
+
obj.meteredCost = message.meteredCost;
|
|
17749
|
+
}
|
|
17750
|
+
if (message.meteredCostBreakdown) {
|
|
17751
|
+
const entries = Object.entries(message.meteredCostBreakdown);
|
|
17752
|
+
if (entries.length > 0) {
|
|
17753
|
+
obj.meteredCostBreakdown = {};
|
|
17754
|
+
entries.forEach(([k, v]) => {
|
|
17755
|
+
obj.meteredCostBreakdown[k] = v;
|
|
17756
|
+
});
|
|
17757
|
+
}
|
|
17758
|
+
}
|
|
17759
|
+
return obj;
|
|
17760
|
+
},
|
|
17761
|
+
create(base) {
|
|
17762
|
+
return EnvironmentBillingSummaryResponse.fromPartial(base ?? {});
|
|
17763
|
+
},
|
|
17764
|
+
fromPartial(object) {
|
|
17765
|
+
const message = createBaseEnvironmentBillingSummaryResponse();
|
|
17766
|
+
message.startTimestamp = object.startTimestamp ?? void 0;
|
|
17767
|
+
message.endTimestamp = object.endTimestamp ?? void 0;
|
|
17768
|
+
message.meteredCost = object.meteredCost ?? "";
|
|
17769
|
+
message.meteredCostBreakdown = Object.entries(object.meteredCostBreakdown ?? {}).reduce(
|
|
17770
|
+
(acc, [key, value]) => {
|
|
17771
|
+
if (value !== void 0) {
|
|
17772
|
+
acc[key] = globalThis.String(value);
|
|
17773
|
+
}
|
|
17774
|
+
return acc;
|
|
17775
|
+
},
|
|
17776
|
+
{}
|
|
17777
|
+
);
|
|
17778
|
+
return message;
|
|
17779
|
+
}
|
|
17780
|
+
};
|
|
17781
|
+
function createBaseEnvironmentBillingSummaryResponse_MeteredCostBreakdownEntry() {
|
|
17782
|
+
return { key: "", value: "" };
|
|
17783
|
+
}
|
|
17784
|
+
var EnvironmentBillingSummaryResponse_MeteredCostBreakdownEntry = {
|
|
17785
|
+
encode(message, writer = new BinaryWriter()) {
|
|
17786
|
+
if (message.key !== "") {
|
|
17787
|
+
writer.uint32(10).string(message.key);
|
|
17788
|
+
}
|
|
17789
|
+
if (message.value !== "") {
|
|
17790
|
+
writer.uint32(18).string(message.value);
|
|
17791
|
+
}
|
|
17792
|
+
return writer;
|
|
17793
|
+
},
|
|
17794
|
+
decode(input, length) {
|
|
17795
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
17796
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
17797
|
+
const message = createBaseEnvironmentBillingSummaryResponse_MeteredCostBreakdownEntry();
|
|
17798
|
+
while (reader.pos < end) {
|
|
17799
|
+
const tag = reader.uint32();
|
|
17800
|
+
switch (tag >>> 3) {
|
|
17801
|
+
case 1: {
|
|
17802
|
+
if (tag !== 10) {
|
|
17803
|
+
break;
|
|
17804
|
+
}
|
|
17805
|
+
message.key = reader.string();
|
|
17806
|
+
continue;
|
|
17807
|
+
}
|
|
17808
|
+
case 2: {
|
|
17809
|
+
if (tag !== 18) {
|
|
17810
|
+
break;
|
|
17811
|
+
}
|
|
17812
|
+
message.value = reader.string();
|
|
17813
|
+
continue;
|
|
17814
|
+
}
|
|
17815
|
+
}
|
|
17816
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
17817
|
+
break;
|
|
17818
|
+
}
|
|
17819
|
+
reader.skip(tag & 7);
|
|
17820
|
+
}
|
|
17821
|
+
return message;
|
|
17822
|
+
},
|
|
17823
|
+
fromJSON(object) {
|
|
17824
|
+
return {
|
|
17825
|
+
key: isSet5(object.key) ? globalThis.String(object.key) : "",
|
|
17826
|
+
value: isSet5(object.value) ? globalThis.String(object.value) : ""
|
|
17827
|
+
};
|
|
17828
|
+
},
|
|
17829
|
+
toJSON(message) {
|
|
17830
|
+
const obj = {};
|
|
17831
|
+
if (message.key !== "") {
|
|
17832
|
+
obj.key = message.key;
|
|
17833
|
+
}
|
|
17834
|
+
if (message.value !== "") {
|
|
17835
|
+
obj.value = message.value;
|
|
17836
|
+
}
|
|
17837
|
+
return obj;
|
|
17838
|
+
},
|
|
17839
|
+
create(base) {
|
|
17840
|
+
return EnvironmentBillingSummaryResponse_MeteredCostBreakdownEntry.fromPartial(base ?? {});
|
|
17841
|
+
},
|
|
17842
|
+
fromPartial(object) {
|
|
17843
|
+
const message = createBaseEnvironmentBillingSummaryResponse_MeteredCostBreakdownEntry();
|
|
17844
|
+
message.key = object.key ?? "";
|
|
17845
|
+
message.value = object.value ?? "";
|
|
17846
|
+
return message;
|
|
17847
|
+
}
|
|
17848
|
+
};
|
|
17515
17849
|
function createBaseEnvironmentCreateRequest() {
|
|
17516
|
-
return { name: "", isManaged: false, settings: void 0 };
|
|
17850
|
+
return { name: "", isManaged: false, settings: void 0, environmentType: 0 };
|
|
17517
17851
|
}
|
|
17518
17852
|
var EnvironmentCreateRequest = {
|
|
17519
17853
|
encode(message, writer = new BinaryWriter()) {
|
|
@@ -17526,6 +17860,9 @@ var EnvironmentCreateRequest = {
|
|
|
17526
17860
|
if (message.settings !== void 0) {
|
|
17527
17861
|
EnvironmentSettings.encode(message.settings, writer.uint32(26).fork()).join();
|
|
17528
17862
|
}
|
|
17863
|
+
if (message.environmentType !== 0) {
|
|
17864
|
+
writer.uint32(32).int32(message.environmentType);
|
|
17865
|
+
}
|
|
17529
17866
|
return writer;
|
|
17530
17867
|
},
|
|
17531
17868
|
decode(input, length) {
|
|
@@ -17556,6 +17893,13 @@ var EnvironmentCreateRequest = {
|
|
|
17556
17893
|
message.settings = EnvironmentSettings.decode(reader, reader.uint32());
|
|
17557
17894
|
continue;
|
|
17558
17895
|
}
|
|
17896
|
+
case 4: {
|
|
17897
|
+
if (tag !== 32) {
|
|
17898
|
+
break;
|
|
17899
|
+
}
|
|
17900
|
+
message.environmentType = reader.int32();
|
|
17901
|
+
continue;
|
|
17902
|
+
}
|
|
17559
17903
|
}
|
|
17560
17904
|
if ((tag & 7) === 4 || tag === 0) {
|
|
17561
17905
|
break;
|
|
@@ -17568,7 +17912,8 @@ var EnvironmentCreateRequest = {
|
|
|
17568
17912
|
return {
|
|
17569
17913
|
name: isSet5(object.name) ? globalThis.String(object.name) : "",
|
|
17570
17914
|
isManaged: isSet5(object.isManaged) ? globalThis.Boolean(object.isManaged) : false,
|
|
17571
|
-
settings: isSet5(object.settings) ? EnvironmentSettings.fromJSON(object.settings) : void 0
|
|
17915
|
+
settings: isSet5(object.settings) ? EnvironmentSettings.fromJSON(object.settings) : void 0,
|
|
17916
|
+
environmentType: isSet5(object.environmentType) ? environmentTypeFromJSON(object.environmentType) : 0
|
|
17572
17917
|
};
|
|
17573
17918
|
},
|
|
17574
17919
|
toJSON(message) {
|
|
@@ -17582,6 +17927,9 @@ var EnvironmentCreateRequest = {
|
|
|
17582
17927
|
if (message.settings !== void 0) {
|
|
17583
17928
|
obj.settings = EnvironmentSettings.toJSON(message.settings);
|
|
17584
17929
|
}
|
|
17930
|
+
if (message.environmentType !== 0) {
|
|
17931
|
+
obj.environmentType = environmentTypeToJSON(message.environmentType);
|
|
17932
|
+
}
|
|
17585
17933
|
return obj;
|
|
17586
17934
|
},
|
|
17587
17935
|
create(base) {
|
|
@@ -17592,6 +17940,7 @@ var EnvironmentCreateRequest = {
|
|
|
17592
17940
|
message.name = object.name ?? "";
|
|
17593
17941
|
message.isManaged = object.isManaged ?? false;
|
|
17594
17942
|
message.settings = object.settings !== void 0 && object.settings !== null ? EnvironmentSettings.fromPartial(object.settings) : void 0;
|
|
17943
|
+
message.environmentType = object.environmentType ?? 0;
|
|
17595
17944
|
return message;
|
|
17596
17945
|
}
|
|
17597
17946
|
};
|
|
@@ -18279,7 +18628,8 @@ function createBaseEnvironmentListItem() {
|
|
|
18279
18628
|
cycleBudgetDollars: void 0,
|
|
18280
18629
|
effectiveCycleSpendLimit: 0,
|
|
18281
18630
|
currentCycleUsage: 0,
|
|
18282
|
-
spendLimitReached: false
|
|
18631
|
+
spendLimitReached: false,
|
|
18632
|
+
environmentType: 0
|
|
18283
18633
|
};
|
|
18284
18634
|
}
|
|
18285
18635
|
var EnvironmentListItem = {
|
|
@@ -18326,6 +18676,9 @@ var EnvironmentListItem = {
|
|
|
18326
18676
|
if (message.spendLimitReached !== false) {
|
|
18327
18677
|
writer.uint32(112).bool(message.spendLimitReached);
|
|
18328
18678
|
}
|
|
18679
|
+
if (message.environmentType !== 0) {
|
|
18680
|
+
writer.uint32(120).int32(message.environmentType);
|
|
18681
|
+
}
|
|
18329
18682
|
return writer;
|
|
18330
18683
|
},
|
|
18331
18684
|
decode(input, length) {
|
|
@@ -18433,6 +18786,13 @@ var EnvironmentListItem = {
|
|
|
18433
18786
|
message.spendLimitReached = reader.bool();
|
|
18434
18787
|
continue;
|
|
18435
18788
|
}
|
|
18789
|
+
case 15: {
|
|
18790
|
+
if (tag !== 120) {
|
|
18791
|
+
break;
|
|
18792
|
+
}
|
|
18793
|
+
message.environmentType = reader.int32();
|
|
18794
|
+
continue;
|
|
18795
|
+
}
|
|
18436
18796
|
}
|
|
18437
18797
|
if ((tag & 7) === 4 || tag === 0) {
|
|
18438
18798
|
break;
|
|
@@ -18456,7 +18816,8 @@ var EnvironmentListItem = {
|
|
|
18456
18816
|
cycleBudgetDollars: isSet5(object.cycleBudgetDollars) ? globalThis.Number(object.cycleBudgetDollars) : void 0,
|
|
18457
18817
|
effectiveCycleSpendLimit: isSet5(object.effectiveCycleSpendLimit) ? globalThis.Number(object.effectiveCycleSpendLimit) : 0,
|
|
18458
18818
|
currentCycleUsage: isSet5(object.currentCycleUsage) ? globalThis.Number(object.currentCycleUsage) : 0,
|
|
18459
|
-
spendLimitReached: isSet5(object.spendLimitReached) ? globalThis.Boolean(object.spendLimitReached) : false
|
|
18819
|
+
spendLimitReached: isSet5(object.spendLimitReached) ? globalThis.Boolean(object.spendLimitReached) : false,
|
|
18820
|
+
environmentType: isSet5(object.environmentType) ? environmentTypeFromJSON(object.environmentType) : 0
|
|
18460
18821
|
};
|
|
18461
18822
|
},
|
|
18462
18823
|
toJSON(message) {
|
|
@@ -18503,6 +18864,9 @@ var EnvironmentListItem = {
|
|
|
18503
18864
|
if (message.spendLimitReached !== false) {
|
|
18504
18865
|
obj.spendLimitReached = message.spendLimitReached;
|
|
18505
18866
|
}
|
|
18867
|
+
if (message.environmentType !== 0) {
|
|
18868
|
+
obj.environmentType = environmentTypeToJSON(message.environmentType);
|
|
18869
|
+
}
|
|
18506
18870
|
return obj;
|
|
18507
18871
|
},
|
|
18508
18872
|
create(base) {
|
|
@@ -18524,6 +18888,7 @@ var EnvironmentListItem = {
|
|
|
18524
18888
|
message.effectiveCycleSpendLimit = object.effectiveCycleSpendLimit ?? 0;
|
|
18525
18889
|
message.currentCycleUsage = object.currentCycleUsage ?? 0;
|
|
18526
18890
|
message.spendLimitReached = object.spendLimitReached ?? false;
|
|
18891
|
+
message.environmentType = object.environmentType ?? 0;
|
|
18527
18892
|
return message;
|
|
18528
18893
|
}
|
|
18529
18894
|
};
|
|
@@ -18581,7 +18946,7 @@ var EnvironmentListResponse = {
|
|
|
18581
18946
|
}
|
|
18582
18947
|
};
|
|
18583
18948
|
function createBaseEnvironmentMetadata() {
|
|
18584
|
-
return { name: "", settings: void 0 };
|
|
18949
|
+
return { name: "", settings: void 0, environmentType: 0 };
|
|
18585
18950
|
}
|
|
18586
18951
|
var EnvironmentMetadata = {
|
|
18587
18952
|
encode(message, writer = new BinaryWriter()) {
|
|
@@ -18591,6 +18956,9 @@ var EnvironmentMetadata = {
|
|
|
18591
18956
|
if (message.settings !== void 0) {
|
|
18592
18957
|
EnvironmentSettings.encode(message.settings, writer.uint32(18).fork()).join();
|
|
18593
18958
|
}
|
|
18959
|
+
if (message.environmentType !== 0) {
|
|
18960
|
+
writer.uint32(24).int32(message.environmentType);
|
|
18961
|
+
}
|
|
18594
18962
|
return writer;
|
|
18595
18963
|
},
|
|
18596
18964
|
decode(input, length) {
|
|
@@ -18614,6 +18982,13 @@ var EnvironmentMetadata = {
|
|
|
18614
18982
|
message.settings = EnvironmentSettings.decode(reader, reader.uint32());
|
|
18615
18983
|
continue;
|
|
18616
18984
|
}
|
|
18985
|
+
case 3: {
|
|
18986
|
+
if (tag !== 24) {
|
|
18987
|
+
break;
|
|
18988
|
+
}
|
|
18989
|
+
message.environmentType = reader.int32();
|
|
18990
|
+
continue;
|
|
18991
|
+
}
|
|
18617
18992
|
}
|
|
18618
18993
|
if ((tag & 7) === 4 || tag === 0) {
|
|
18619
18994
|
break;
|
|
@@ -18625,7 +19000,8 @@ var EnvironmentMetadata = {
|
|
|
18625
19000
|
fromJSON(object) {
|
|
18626
19001
|
return {
|
|
18627
19002
|
name: isSet5(object.name) ? globalThis.String(object.name) : "",
|
|
18628
|
-
settings: isSet5(object.settings) ? EnvironmentSettings.fromJSON(object.settings) : void 0
|
|
19003
|
+
settings: isSet5(object.settings) ? EnvironmentSettings.fromJSON(object.settings) : void 0,
|
|
19004
|
+
environmentType: isSet5(object.environmentType) ? environmentTypeFromJSON(object.environmentType) : 0
|
|
18629
19005
|
};
|
|
18630
19006
|
},
|
|
18631
19007
|
toJSON(message) {
|
|
@@ -18636,6 +19012,9 @@ var EnvironmentMetadata = {
|
|
|
18636
19012
|
if (message.settings !== void 0) {
|
|
18637
19013
|
obj.settings = EnvironmentSettings.toJSON(message.settings);
|
|
18638
19014
|
}
|
|
19015
|
+
if (message.environmentType !== 0) {
|
|
19016
|
+
obj.environmentType = environmentTypeToJSON(message.environmentType);
|
|
19017
|
+
}
|
|
18639
19018
|
return obj;
|
|
18640
19019
|
},
|
|
18641
19020
|
create(base) {
|
|
@@ -18645,6 +19024,7 @@ var EnvironmentMetadata = {
|
|
|
18645
19024
|
const message = createBaseEnvironmentMetadata();
|
|
18646
19025
|
message.name = object.name ?? "";
|
|
18647
19026
|
message.settings = object.settings !== void 0 && object.settings !== null ? EnvironmentSettings.fromPartial(object.settings) : void 0;
|
|
19027
|
+
message.environmentType = object.environmentType ?? 0;
|
|
18648
19028
|
return message;
|
|
18649
19029
|
}
|
|
18650
19030
|
};
|
|
@@ -21898,7 +22278,7 @@ var FunctionCallFromIdRequest = {
|
|
|
21898
22278
|
}
|
|
21899
22279
|
};
|
|
21900
22280
|
function createBaseFunctionCallFromIdResponse() {
|
|
21901
|
-
return { functionCallId: "", numInputs: 0 };
|
|
22281
|
+
return { functionCallId: "", numInputs: 0, metadata: void 0 };
|
|
21902
22282
|
}
|
|
21903
22283
|
var FunctionCallFromIdResponse = {
|
|
21904
22284
|
encode(message, writer = new BinaryWriter()) {
|
|
@@ -21908,6 +22288,9 @@ var FunctionCallFromIdResponse = {
|
|
|
21908
22288
|
if (message.numInputs !== 0) {
|
|
21909
22289
|
writer.uint32(16).int32(message.numInputs);
|
|
21910
22290
|
}
|
|
22291
|
+
if (message.metadata !== void 0) {
|
|
22292
|
+
FunctionCallHandleMetadata.encode(message.metadata, writer.uint32(26).fork()).join();
|
|
22293
|
+
}
|
|
21911
22294
|
return writer;
|
|
21912
22295
|
},
|
|
21913
22296
|
decode(input, length) {
|
|
@@ -21931,6 +22314,13 @@ var FunctionCallFromIdResponse = {
|
|
|
21931
22314
|
message.numInputs = reader.int32();
|
|
21932
22315
|
continue;
|
|
21933
22316
|
}
|
|
22317
|
+
case 3: {
|
|
22318
|
+
if (tag !== 26) {
|
|
22319
|
+
break;
|
|
22320
|
+
}
|
|
22321
|
+
message.metadata = FunctionCallHandleMetadata.decode(reader, reader.uint32());
|
|
22322
|
+
continue;
|
|
22323
|
+
}
|
|
21934
22324
|
}
|
|
21935
22325
|
if ((tag & 7) === 4 || tag === 0) {
|
|
21936
22326
|
break;
|
|
@@ -21942,7 +22332,8 @@ var FunctionCallFromIdResponse = {
|
|
|
21942
22332
|
fromJSON(object) {
|
|
21943
22333
|
return {
|
|
21944
22334
|
functionCallId: isSet5(object.functionCallId) ? globalThis.String(object.functionCallId) : "",
|
|
21945
|
-
numInputs: isSet5(object.numInputs) ? globalThis.Number(object.numInputs) : 0
|
|
22335
|
+
numInputs: isSet5(object.numInputs) ? globalThis.Number(object.numInputs) : 0,
|
|
22336
|
+
metadata: isSet5(object.metadata) ? FunctionCallHandleMetadata.fromJSON(object.metadata) : void 0
|
|
21946
22337
|
};
|
|
21947
22338
|
},
|
|
21948
22339
|
toJSON(message) {
|
|
@@ -21953,6 +22344,9 @@ var FunctionCallFromIdResponse = {
|
|
|
21953
22344
|
if (message.numInputs !== 0) {
|
|
21954
22345
|
obj.numInputs = Math.round(message.numInputs);
|
|
21955
22346
|
}
|
|
22347
|
+
if (message.metadata !== void 0) {
|
|
22348
|
+
obj.metadata = FunctionCallHandleMetadata.toJSON(message.metadata);
|
|
22349
|
+
}
|
|
21956
22350
|
return obj;
|
|
21957
22351
|
},
|
|
21958
22352
|
create(base) {
|
|
@@ -21962,6 +22356,7 @@ var FunctionCallFromIdResponse = {
|
|
|
21962
22356
|
const message = createBaseFunctionCallFromIdResponse();
|
|
21963
22357
|
message.functionCallId = object.functionCallId ?? "";
|
|
21964
22358
|
message.numInputs = object.numInputs ?? 0;
|
|
22359
|
+
message.metadata = object.metadata !== void 0 && object.metadata !== null ? FunctionCallHandleMetadata.fromPartial(object.metadata) : void 0;
|
|
21965
22360
|
return message;
|
|
21966
22361
|
}
|
|
21967
22362
|
};
|
|
@@ -22048,6 +22443,74 @@ var FunctionCallGetDataRequest = {
|
|
|
22048
22443
|
return message;
|
|
22049
22444
|
}
|
|
22050
22445
|
};
|
|
22446
|
+
function createBaseFunctionCallHandleMetadata() {
|
|
22447
|
+
return { appId: "", functionId: "" };
|
|
22448
|
+
}
|
|
22449
|
+
var FunctionCallHandleMetadata = {
|
|
22450
|
+
encode(message, writer = new BinaryWriter()) {
|
|
22451
|
+
if (message.appId !== "") {
|
|
22452
|
+
writer.uint32(10).string(message.appId);
|
|
22453
|
+
}
|
|
22454
|
+
if (message.functionId !== "") {
|
|
22455
|
+
writer.uint32(18).string(message.functionId);
|
|
22456
|
+
}
|
|
22457
|
+
return writer;
|
|
22458
|
+
},
|
|
22459
|
+
decode(input, length) {
|
|
22460
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
22461
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
22462
|
+
const message = createBaseFunctionCallHandleMetadata();
|
|
22463
|
+
while (reader.pos < end) {
|
|
22464
|
+
const tag = reader.uint32();
|
|
22465
|
+
switch (tag >>> 3) {
|
|
22466
|
+
case 1: {
|
|
22467
|
+
if (tag !== 10) {
|
|
22468
|
+
break;
|
|
22469
|
+
}
|
|
22470
|
+
message.appId = reader.string();
|
|
22471
|
+
continue;
|
|
22472
|
+
}
|
|
22473
|
+
case 2: {
|
|
22474
|
+
if (tag !== 18) {
|
|
22475
|
+
break;
|
|
22476
|
+
}
|
|
22477
|
+
message.functionId = reader.string();
|
|
22478
|
+
continue;
|
|
22479
|
+
}
|
|
22480
|
+
}
|
|
22481
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
22482
|
+
break;
|
|
22483
|
+
}
|
|
22484
|
+
reader.skip(tag & 7);
|
|
22485
|
+
}
|
|
22486
|
+
return message;
|
|
22487
|
+
},
|
|
22488
|
+
fromJSON(object) {
|
|
22489
|
+
return {
|
|
22490
|
+
appId: isSet5(object.appId) ? globalThis.String(object.appId) : "",
|
|
22491
|
+
functionId: isSet5(object.functionId) ? globalThis.String(object.functionId) : ""
|
|
22492
|
+
};
|
|
22493
|
+
},
|
|
22494
|
+
toJSON(message) {
|
|
22495
|
+
const obj = {};
|
|
22496
|
+
if (message.appId !== "") {
|
|
22497
|
+
obj.appId = message.appId;
|
|
22498
|
+
}
|
|
22499
|
+
if (message.functionId !== "") {
|
|
22500
|
+
obj.functionId = message.functionId;
|
|
22501
|
+
}
|
|
22502
|
+
return obj;
|
|
22503
|
+
},
|
|
22504
|
+
create(base) {
|
|
22505
|
+
return FunctionCallHandleMetadata.fromPartial(base ?? {});
|
|
22506
|
+
},
|
|
22507
|
+
fromPartial(object) {
|
|
22508
|
+
const message = createBaseFunctionCallHandleMetadata();
|
|
22509
|
+
message.appId = object.appId ?? "";
|
|
22510
|
+
message.functionId = object.functionId ?? "";
|
|
22511
|
+
return message;
|
|
22512
|
+
}
|
|
22513
|
+
};
|
|
22051
22514
|
function createBaseFunctionCallInfo() {
|
|
22052
22515
|
return {
|
|
22053
22516
|
functionCallId: "",
|
|
@@ -25170,7 +25633,8 @@ function createBaseFunctionHandleMetadata() {
|
|
|
25170
25633
|
maxObjectSizeBytes: void 0,
|
|
25171
25634
|
ExperimentalFlashUrls: [],
|
|
25172
25635
|
supportedInputFormats: [],
|
|
25173
|
-
supportedOutputFormats: []
|
|
25636
|
+
supportedOutputFormats: [],
|
|
25637
|
+
appId: ""
|
|
25174
25638
|
};
|
|
25175
25639
|
}
|
|
25176
25640
|
var FunctionHandleMetadata = {
|
|
@@ -25227,6 +25691,9 @@ var FunctionHandleMetadata = {
|
|
|
25227
25691
|
writer.int32(v);
|
|
25228
25692
|
}
|
|
25229
25693
|
writer.join();
|
|
25694
|
+
if (message.appId !== "") {
|
|
25695
|
+
writer.uint32(418).string(message.appId);
|
|
25696
|
+
}
|
|
25230
25697
|
return writer;
|
|
25231
25698
|
},
|
|
25232
25699
|
decode(input, length) {
|
|
@@ -25365,6 +25832,13 @@ var FunctionHandleMetadata = {
|
|
|
25365
25832
|
}
|
|
25366
25833
|
break;
|
|
25367
25834
|
}
|
|
25835
|
+
case 52: {
|
|
25836
|
+
if (tag !== 418) {
|
|
25837
|
+
break;
|
|
25838
|
+
}
|
|
25839
|
+
message.appId = reader.string();
|
|
25840
|
+
continue;
|
|
25841
|
+
}
|
|
25368
25842
|
}
|
|
25369
25843
|
if ((tag & 7) === 4 || tag === 0) {
|
|
25370
25844
|
break;
|
|
@@ -25396,7 +25870,8 @@ var FunctionHandleMetadata = {
|
|
|
25396
25870
|
maxObjectSizeBytes: isSet5(object.maxObjectSizeBytes) ? globalThis.Number(object.maxObjectSizeBytes) : void 0,
|
|
25397
25871
|
ExperimentalFlashUrls: globalThis.Array.isArray(object?.ExperimentalFlashUrls) ? object.ExperimentalFlashUrls.map((e) => globalThis.String(e)) : [],
|
|
25398
25872
|
supportedInputFormats: globalThis.Array.isArray(object?.supportedInputFormats) ? object.supportedInputFormats.map((e) => dataFormatFromJSON(e)) : [],
|
|
25399
|
-
supportedOutputFormats: globalThis.Array.isArray(object?.supportedOutputFormats) ? object.supportedOutputFormats.map((e) => dataFormatFromJSON(e)) : []
|
|
25873
|
+
supportedOutputFormats: globalThis.Array.isArray(object?.supportedOutputFormats) ? object.supportedOutputFormats.map((e) => dataFormatFromJSON(e)) : [],
|
|
25874
|
+
appId: isSet5(object.appId) ? globalThis.String(object.appId) : ""
|
|
25400
25875
|
};
|
|
25401
25876
|
},
|
|
25402
25877
|
toJSON(message) {
|
|
@@ -25455,6 +25930,9 @@ var FunctionHandleMetadata = {
|
|
|
25455
25930
|
if (message.supportedOutputFormats?.length) {
|
|
25456
25931
|
obj.supportedOutputFormats = message.supportedOutputFormats.map((e) => dataFormatToJSON(e));
|
|
25457
25932
|
}
|
|
25933
|
+
if (message.appId !== "") {
|
|
25934
|
+
obj.appId = message.appId;
|
|
25935
|
+
}
|
|
25458
25936
|
return obj;
|
|
25459
25937
|
},
|
|
25460
25938
|
create(base) {
|
|
@@ -25483,6 +25961,7 @@ var FunctionHandleMetadata = {
|
|
|
25483
25961
|
message.ExperimentalFlashUrls = object.ExperimentalFlashUrls?.map((e) => e) || [];
|
|
25484
25962
|
message.supportedInputFormats = object.supportedInputFormats?.map((e) => e) || [];
|
|
25485
25963
|
message.supportedOutputFormats = object.supportedOutputFormats?.map((e) => e) || [];
|
|
25964
|
+
message.appId = object.appId ?? "";
|
|
25486
25965
|
return message;
|
|
25487
25966
|
}
|
|
25488
25967
|
};
|
|
@@ -30140,7 +30619,7 @@ var ImageMetadata_PythonPackagesEntry = {
|
|
|
30140
30619
|
}
|
|
30141
30620
|
};
|
|
30142
30621
|
function createBaseImagePublishRequest() {
|
|
30143
|
-
return { imageId: "", tag: "", environmentName: "",
|
|
30622
|
+
return { imageId: "", tag: "", environmentName: "", allowPublic: false };
|
|
30144
30623
|
}
|
|
30145
30624
|
var ImagePublishRequest = {
|
|
30146
30625
|
encode(message, writer = new BinaryWriter()) {
|
|
@@ -30153,8 +30632,8 @@ var ImagePublishRequest = {
|
|
|
30153
30632
|
if (message.environmentName !== "") {
|
|
30154
30633
|
writer.uint32(26).string(message.environmentName);
|
|
30155
30634
|
}
|
|
30156
|
-
if (message.
|
|
30157
|
-
writer.uint32(32).bool(message.
|
|
30635
|
+
if (message.allowPublic !== false) {
|
|
30636
|
+
writer.uint32(32).bool(message.allowPublic);
|
|
30158
30637
|
}
|
|
30159
30638
|
return writer;
|
|
30160
30639
|
},
|
|
@@ -30190,7 +30669,7 @@ var ImagePublishRequest = {
|
|
|
30190
30669
|
if (tag !== 32) {
|
|
30191
30670
|
break;
|
|
30192
30671
|
}
|
|
30193
|
-
message.
|
|
30672
|
+
message.allowPublic = reader.bool();
|
|
30194
30673
|
continue;
|
|
30195
30674
|
}
|
|
30196
30675
|
}
|
|
@@ -30206,7 +30685,7 @@ var ImagePublishRequest = {
|
|
|
30206
30685
|
imageId: isSet5(object.imageId) ? globalThis.String(object.imageId) : "",
|
|
30207
30686
|
tag: isSet5(object.tag) ? globalThis.String(object.tag) : "",
|
|
30208
30687
|
environmentName: isSet5(object.environmentName) ? globalThis.String(object.environmentName) : "",
|
|
30209
|
-
|
|
30688
|
+
allowPublic: isSet5(object.allowPublic) ? globalThis.Boolean(object.allowPublic) : false
|
|
30210
30689
|
};
|
|
30211
30690
|
},
|
|
30212
30691
|
toJSON(message) {
|
|
@@ -30220,8 +30699,8 @@ var ImagePublishRequest = {
|
|
|
30220
30699
|
if (message.environmentName !== "") {
|
|
30221
30700
|
obj.environmentName = message.environmentName;
|
|
30222
30701
|
}
|
|
30223
|
-
if (message.
|
|
30224
|
-
obj.
|
|
30702
|
+
if (message.allowPublic !== false) {
|
|
30703
|
+
obj.allowPublic = message.allowPublic;
|
|
30225
30704
|
}
|
|
30226
30705
|
return obj;
|
|
30227
30706
|
},
|
|
@@ -30233,7 +30712,7 @@ var ImagePublishRequest = {
|
|
|
30233
30712
|
message.imageId = object.imageId ?? "";
|
|
30234
30713
|
message.tag = object.tag ?? "";
|
|
30235
30714
|
message.environmentName = object.environmentName ?? "";
|
|
30236
|
-
message.
|
|
30715
|
+
message.allowPublic = object.allowPublic ?? false;
|
|
30237
30716
|
return message;
|
|
30238
30717
|
}
|
|
30239
30718
|
};
|
|
@@ -31885,6 +32364,112 @@ var MethodDefinition = {
|
|
|
31885
32364
|
return message;
|
|
31886
32365
|
}
|
|
31887
32366
|
};
|
|
32367
|
+
function createBaseMountBatchedCheckExistenceRequest() {
|
|
32368
|
+
return { sha256HexHashes: [] };
|
|
32369
|
+
}
|
|
32370
|
+
var MountBatchedCheckExistenceRequest = {
|
|
32371
|
+
encode(message, writer = new BinaryWriter()) {
|
|
32372
|
+
for (const v of message.sha256HexHashes) {
|
|
32373
|
+
writer.uint32(10).string(v);
|
|
32374
|
+
}
|
|
32375
|
+
return writer;
|
|
32376
|
+
},
|
|
32377
|
+
decode(input, length) {
|
|
32378
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
32379
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
32380
|
+
const message = createBaseMountBatchedCheckExistenceRequest();
|
|
32381
|
+
while (reader.pos < end) {
|
|
32382
|
+
const tag = reader.uint32();
|
|
32383
|
+
switch (tag >>> 3) {
|
|
32384
|
+
case 1: {
|
|
32385
|
+
if (tag !== 10) {
|
|
32386
|
+
break;
|
|
32387
|
+
}
|
|
32388
|
+
message.sha256HexHashes.push(reader.string());
|
|
32389
|
+
continue;
|
|
32390
|
+
}
|
|
32391
|
+
}
|
|
32392
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
32393
|
+
break;
|
|
32394
|
+
}
|
|
32395
|
+
reader.skip(tag & 7);
|
|
32396
|
+
}
|
|
32397
|
+
return message;
|
|
32398
|
+
},
|
|
32399
|
+
fromJSON(object) {
|
|
32400
|
+
return {
|
|
32401
|
+
sha256HexHashes: globalThis.Array.isArray(object?.sha256HexHashes) ? object.sha256HexHashes.map((e) => globalThis.String(e)) : []
|
|
32402
|
+
};
|
|
32403
|
+
},
|
|
32404
|
+
toJSON(message) {
|
|
32405
|
+
const obj = {};
|
|
32406
|
+
if (message.sha256HexHashes?.length) {
|
|
32407
|
+
obj.sha256HexHashes = message.sha256HexHashes;
|
|
32408
|
+
}
|
|
32409
|
+
return obj;
|
|
32410
|
+
},
|
|
32411
|
+
create(base) {
|
|
32412
|
+
return MountBatchedCheckExistenceRequest.fromPartial(base ?? {});
|
|
32413
|
+
},
|
|
32414
|
+
fromPartial(object) {
|
|
32415
|
+
const message = createBaseMountBatchedCheckExistenceRequest();
|
|
32416
|
+
message.sha256HexHashes = object.sha256HexHashes?.map((e) => e) || [];
|
|
32417
|
+
return message;
|
|
32418
|
+
}
|
|
32419
|
+
};
|
|
32420
|
+
function createBaseMountBatchedCheckExistenceResponse() {
|
|
32421
|
+
return { missingSha256HexHashes: [] };
|
|
32422
|
+
}
|
|
32423
|
+
var MountBatchedCheckExistenceResponse = {
|
|
32424
|
+
encode(message, writer = new BinaryWriter()) {
|
|
32425
|
+
for (const v of message.missingSha256HexHashes) {
|
|
32426
|
+
writer.uint32(10).string(v);
|
|
32427
|
+
}
|
|
32428
|
+
return writer;
|
|
32429
|
+
},
|
|
32430
|
+
decode(input, length) {
|
|
32431
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
32432
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
32433
|
+
const message = createBaseMountBatchedCheckExistenceResponse();
|
|
32434
|
+
while (reader.pos < end) {
|
|
32435
|
+
const tag = reader.uint32();
|
|
32436
|
+
switch (tag >>> 3) {
|
|
32437
|
+
case 1: {
|
|
32438
|
+
if (tag !== 10) {
|
|
32439
|
+
break;
|
|
32440
|
+
}
|
|
32441
|
+
message.missingSha256HexHashes.push(reader.string());
|
|
32442
|
+
continue;
|
|
32443
|
+
}
|
|
32444
|
+
}
|
|
32445
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
32446
|
+
break;
|
|
32447
|
+
}
|
|
32448
|
+
reader.skip(tag & 7);
|
|
32449
|
+
}
|
|
32450
|
+
return message;
|
|
32451
|
+
},
|
|
32452
|
+
fromJSON(object) {
|
|
32453
|
+
return {
|
|
32454
|
+
missingSha256HexHashes: globalThis.Array.isArray(object?.missingSha256HexHashes) ? object.missingSha256HexHashes.map((e) => globalThis.String(e)) : []
|
|
32455
|
+
};
|
|
32456
|
+
},
|
|
32457
|
+
toJSON(message) {
|
|
32458
|
+
const obj = {};
|
|
32459
|
+
if (message.missingSha256HexHashes?.length) {
|
|
32460
|
+
obj.missingSha256HexHashes = message.missingSha256HexHashes;
|
|
32461
|
+
}
|
|
32462
|
+
return obj;
|
|
32463
|
+
},
|
|
32464
|
+
create(base) {
|
|
32465
|
+
return MountBatchedCheckExistenceResponse.fromPartial(base ?? {});
|
|
32466
|
+
},
|
|
32467
|
+
fromPartial(object) {
|
|
32468
|
+
const message = createBaseMountBatchedCheckExistenceResponse();
|
|
32469
|
+
message.missingSha256HexHashes = object.missingSha256HexHashes?.map((e) => e) || [];
|
|
32470
|
+
return message;
|
|
32471
|
+
}
|
|
32472
|
+
};
|
|
31888
32473
|
function createBaseMountFile() {
|
|
31889
32474
|
return { filename: "", sha256Hex: "", size: void 0, mode: void 0 };
|
|
31890
32475
|
}
|
|
@@ -38222,7 +38807,7 @@ var SandboxCreateResponse = {
|
|
|
38222
38807
|
}
|
|
38223
38808
|
};
|
|
38224
38809
|
function createBaseSandboxCreateV2Request() {
|
|
38225
|
-
return { appId: "", definition: void 0, ephemeralSecrets: void 0 };
|
|
38810
|
+
return { appId: "", definition: void 0, ephemeralSecrets: void 0, tags: [] };
|
|
38226
38811
|
}
|
|
38227
38812
|
var SandboxCreateV2Request = {
|
|
38228
38813
|
encode(message, writer = new BinaryWriter()) {
|
|
@@ -38235,6 +38820,9 @@ var SandboxCreateV2Request = {
|
|
|
38235
38820
|
if (message.ephemeralSecrets !== void 0) {
|
|
38236
38821
|
StringMap.encode(message.ephemeralSecrets, writer.uint32(26).fork()).join();
|
|
38237
38822
|
}
|
|
38823
|
+
for (const v of message.tags) {
|
|
38824
|
+
SandboxTag.encode(v, writer.uint32(34).fork()).join();
|
|
38825
|
+
}
|
|
38238
38826
|
return writer;
|
|
38239
38827
|
},
|
|
38240
38828
|
decode(input, length) {
|
|
@@ -38265,6 +38853,13 @@ var SandboxCreateV2Request = {
|
|
|
38265
38853
|
message.ephemeralSecrets = StringMap.decode(reader, reader.uint32());
|
|
38266
38854
|
continue;
|
|
38267
38855
|
}
|
|
38856
|
+
case 4: {
|
|
38857
|
+
if (tag !== 34) {
|
|
38858
|
+
break;
|
|
38859
|
+
}
|
|
38860
|
+
message.tags.push(SandboxTag.decode(reader, reader.uint32()));
|
|
38861
|
+
continue;
|
|
38862
|
+
}
|
|
38268
38863
|
}
|
|
38269
38864
|
if ((tag & 7) === 4 || tag === 0) {
|
|
38270
38865
|
break;
|
|
@@ -38277,7 +38872,8 @@ var SandboxCreateV2Request = {
|
|
|
38277
38872
|
return {
|
|
38278
38873
|
appId: isSet5(object.appId) ? globalThis.String(object.appId) : "",
|
|
38279
38874
|
definition: isSet5(object.definition) ? Sandbox.fromJSON(object.definition) : void 0,
|
|
38280
|
-
ephemeralSecrets: isSet5(object.ephemeralSecrets) ? StringMap.fromJSON(object.ephemeralSecrets) : void 0
|
|
38875
|
+
ephemeralSecrets: isSet5(object.ephemeralSecrets) ? StringMap.fromJSON(object.ephemeralSecrets) : void 0,
|
|
38876
|
+
tags: globalThis.Array.isArray(object?.tags) ? object.tags.map((e) => SandboxTag.fromJSON(e)) : []
|
|
38281
38877
|
};
|
|
38282
38878
|
},
|
|
38283
38879
|
toJSON(message) {
|
|
@@ -38291,6 +38887,9 @@ var SandboxCreateV2Request = {
|
|
|
38291
38887
|
if (message.ephemeralSecrets !== void 0) {
|
|
38292
38888
|
obj.ephemeralSecrets = StringMap.toJSON(message.ephemeralSecrets);
|
|
38293
38889
|
}
|
|
38890
|
+
if (message.tags?.length) {
|
|
38891
|
+
obj.tags = message.tags.map((e) => SandboxTag.toJSON(e));
|
|
38892
|
+
}
|
|
38294
38893
|
return obj;
|
|
38295
38894
|
},
|
|
38296
38895
|
create(base) {
|
|
@@ -38301,6 +38900,7 @@ var SandboxCreateV2Request = {
|
|
|
38301
38900
|
message.appId = object.appId ?? "";
|
|
38302
38901
|
message.definition = object.definition !== void 0 && object.definition !== null ? Sandbox.fromPartial(object.definition) : void 0;
|
|
38303
38902
|
message.ephemeralSecrets = object.ephemeralSecrets !== void 0 && object.ephemeralSecrets !== null ? StringMap.fromPartial(object.ephemeralSecrets) : void 0;
|
|
38903
|
+
message.tags = object.tags?.map((e) => SandboxTag.fromPartial(e)) || [];
|
|
38304
38904
|
return message;
|
|
38305
38905
|
}
|
|
38306
38906
|
};
|
|
@@ -38388,13 +38988,16 @@ var SandboxCreateV2Response = {
|
|
|
38388
38988
|
}
|
|
38389
38989
|
};
|
|
38390
38990
|
function createBaseSandboxGetCommandRouterAccessRequest() {
|
|
38391
|
-
return { sandboxId:
|
|
38991
|
+
return { sandboxId: void 0, taskId: void 0 };
|
|
38392
38992
|
}
|
|
38393
38993
|
var SandboxGetCommandRouterAccessRequest = {
|
|
38394
38994
|
encode(message, writer = new BinaryWriter()) {
|
|
38395
|
-
if (message.sandboxId !==
|
|
38995
|
+
if (message.sandboxId !== void 0) {
|
|
38396
38996
|
writer.uint32(10).string(message.sandboxId);
|
|
38397
38997
|
}
|
|
38998
|
+
if (message.taskId !== void 0) {
|
|
38999
|
+
writer.uint32(18).string(message.taskId);
|
|
39000
|
+
}
|
|
38398
39001
|
return writer;
|
|
38399
39002
|
},
|
|
38400
39003
|
decode(input, length) {
|
|
@@ -38411,6 +39014,13 @@ var SandboxGetCommandRouterAccessRequest = {
|
|
|
38411
39014
|
message.sandboxId = reader.string();
|
|
38412
39015
|
continue;
|
|
38413
39016
|
}
|
|
39017
|
+
case 2: {
|
|
39018
|
+
if (tag !== 18) {
|
|
39019
|
+
break;
|
|
39020
|
+
}
|
|
39021
|
+
message.taskId = reader.string();
|
|
39022
|
+
continue;
|
|
39023
|
+
}
|
|
38414
39024
|
}
|
|
38415
39025
|
if ((tag & 7) === 4 || tag === 0) {
|
|
38416
39026
|
break;
|
|
@@ -38420,13 +39030,19 @@ var SandboxGetCommandRouterAccessRequest = {
|
|
|
38420
39030
|
return message;
|
|
38421
39031
|
},
|
|
38422
39032
|
fromJSON(object) {
|
|
38423
|
-
return {
|
|
39033
|
+
return {
|
|
39034
|
+
sandboxId: isSet5(object.sandboxId) ? globalThis.String(object.sandboxId) : void 0,
|
|
39035
|
+
taskId: isSet5(object.taskId) ? globalThis.String(object.taskId) : void 0
|
|
39036
|
+
};
|
|
38424
39037
|
},
|
|
38425
39038
|
toJSON(message) {
|
|
38426
39039
|
const obj = {};
|
|
38427
|
-
if (message.sandboxId !==
|
|
39040
|
+
if (message.sandboxId !== void 0) {
|
|
38428
39041
|
obj.sandboxId = message.sandboxId;
|
|
38429
39042
|
}
|
|
39043
|
+
if (message.taskId !== void 0) {
|
|
39044
|
+
obj.taskId = message.taskId;
|
|
39045
|
+
}
|
|
38430
39046
|
return obj;
|
|
38431
39047
|
},
|
|
38432
39048
|
create(base) {
|
|
@@ -38434,7 +39050,8 @@ var SandboxGetCommandRouterAccessRequest = {
|
|
|
38434
39050
|
},
|
|
38435
39051
|
fromPartial(object) {
|
|
38436
39052
|
const message = createBaseSandboxGetCommandRouterAccessRequest();
|
|
38437
|
-
message.sandboxId = object.sandboxId ??
|
|
39053
|
+
message.sandboxId = object.sandboxId ?? void 0;
|
|
39054
|
+
message.taskId = object.taskId ?? void 0;
|
|
38438
39055
|
return message;
|
|
38439
39056
|
}
|
|
38440
39057
|
};
|
|
@@ -43985,7 +44602,7 @@ var SystemErrorMessage = {
|
|
|
43985
44602
|
}
|
|
43986
44603
|
};
|
|
43987
44604
|
function createBaseTaskClusterHelloRequest() {
|
|
43988
|
-
return { taskId: "", containerIp: "", imexHostIp: "" };
|
|
44605
|
+
return { taskId: "", containerIp: "", imexHostIp: "", imexFabricId: "" };
|
|
43989
44606
|
}
|
|
43990
44607
|
var TaskClusterHelloRequest = {
|
|
43991
44608
|
encode(message, writer = new BinaryWriter()) {
|
|
@@ -43998,6 +44615,9 @@ var TaskClusterHelloRequest = {
|
|
|
43998
44615
|
if (message.imexHostIp !== "") {
|
|
43999
44616
|
writer.uint32(26).string(message.imexHostIp);
|
|
44000
44617
|
}
|
|
44618
|
+
if (message.imexFabricId !== "") {
|
|
44619
|
+
writer.uint32(34).string(message.imexFabricId);
|
|
44620
|
+
}
|
|
44001
44621
|
return writer;
|
|
44002
44622
|
},
|
|
44003
44623
|
decode(input, length) {
|
|
@@ -44028,6 +44648,13 @@ var TaskClusterHelloRequest = {
|
|
|
44028
44648
|
message.imexHostIp = reader.string();
|
|
44029
44649
|
continue;
|
|
44030
44650
|
}
|
|
44651
|
+
case 4: {
|
|
44652
|
+
if (tag !== 34) {
|
|
44653
|
+
break;
|
|
44654
|
+
}
|
|
44655
|
+
message.imexFabricId = reader.string();
|
|
44656
|
+
continue;
|
|
44657
|
+
}
|
|
44031
44658
|
}
|
|
44032
44659
|
if ((tag & 7) === 4 || tag === 0) {
|
|
44033
44660
|
break;
|
|
@@ -44040,7 +44667,8 @@ var TaskClusterHelloRequest = {
|
|
|
44040
44667
|
return {
|
|
44041
44668
|
taskId: isSet5(object.taskId) ? globalThis.String(object.taskId) : "",
|
|
44042
44669
|
containerIp: isSet5(object.containerIp) ? globalThis.String(object.containerIp) : "",
|
|
44043
|
-
imexHostIp: isSet5(object.imexHostIp) ? globalThis.String(object.imexHostIp) : ""
|
|
44670
|
+
imexHostIp: isSet5(object.imexHostIp) ? globalThis.String(object.imexHostIp) : "",
|
|
44671
|
+
imexFabricId: isSet5(object.imexFabricId) ? globalThis.String(object.imexFabricId) : ""
|
|
44044
44672
|
};
|
|
44045
44673
|
},
|
|
44046
44674
|
toJSON(message) {
|
|
@@ -44054,6 +44682,9 @@ var TaskClusterHelloRequest = {
|
|
|
44054
44682
|
if (message.imexHostIp !== "") {
|
|
44055
44683
|
obj.imexHostIp = message.imexHostIp;
|
|
44056
44684
|
}
|
|
44685
|
+
if (message.imexFabricId !== "") {
|
|
44686
|
+
obj.imexFabricId = message.imexFabricId;
|
|
44687
|
+
}
|
|
44057
44688
|
return obj;
|
|
44058
44689
|
},
|
|
44059
44690
|
create(base) {
|
|
@@ -44064,6 +44695,7 @@ var TaskClusterHelloRequest = {
|
|
|
44064
44695
|
message.taskId = object.taskId ?? "";
|
|
44065
44696
|
message.containerIp = object.containerIp ?? "";
|
|
44066
44697
|
message.imexHostIp = object.imexHostIp ?? "";
|
|
44698
|
+
message.imexFabricId = object.imexFabricId ?? "";
|
|
44067
44699
|
return message;
|
|
44068
44700
|
}
|
|
44069
44701
|
};
|
|
@@ -47252,6 +47884,147 @@ var VolumeCopyFilesRequest = {
|
|
|
47252
47884
|
return message;
|
|
47253
47885
|
}
|
|
47254
47886
|
};
|
|
47887
|
+
function createBaseVolumeCreateOptions() {
|
|
47888
|
+
return { experimentalOptions: {} };
|
|
47889
|
+
}
|
|
47890
|
+
var VolumeCreateOptions = {
|
|
47891
|
+
encode(message, writer = new BinaryWriter()) {
|
|
47892
|
+
Object.entries(message.experimentalOptions).forEach(([key, value]) => {
|
|
47893
|
+
VolumeCreateOptions_ExperimentalOptionsEntry.encode({ key, value }, writer.uint32(10).fork()).join();
|
|
47894
|
+
});
|
|
47895
|
+
return writer;
|
|
47896
|
+
},
|
|
47897
|
+
decode(input, length) {
|
|
47898
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
47899
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
47900
|
+
const message = createBaseVolumeCreateOptions();
|
|
47901
|
+
while (reader.pos < end) {
|
|
47902
|
+
const tag = reader.uint32();
|
|
47903
|
+
switch (tag >>> 3) {
|
|
47904
|
+
case 1: {
|
|
47905
|
+
if (tag !== 10) {
|
|
47906
|
+
break;
|
|
47907
|
+
}
|
|
47908
|
+
const entry1 = VolumeCreateOptions_ExperimentalOptionsEntry.decode(reader, reader.uint32());
|
|
47909
|
+
if (entry1.value !== void 0) {
|
|
47910
|
+
message.experimentalOptions[entry1.key] = entry1.value;
|
|
47911
|
+
}
|
|
47912
|
+
continue;
|
|
47913
|
+
}
|
|
47914
|
+
}
|
|
47915
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
47916
|
+
break;
|
|
47917
|
+
}
|
|
47918
|
+
reader.skip(tag & 7);
|
|
47919
|
+
}
|
|
47920
|
+
return message;
|
|
47921
|
+
},
|
|
47922
|
+
fromJSON(object) {
|
|
47923
|
+
return {
|
|
47924
|
+
experimentalOptions: isObject2(object.experimentalOptions) ? Object.entries(object.experimentalOptions).reduce((acc, [key, value]) => {
|
|
47925
|
+
acc[key] = String(value);
|
|
47926
|
+
return acc;
|
|
47927
|
+
}, {}) : {}
|
|
47928
|
+
};
|
|
47929
|
+
},
|
|
47930
|
+
toJSON(message) {
|
|
47931
|
+
const obj = {};
|
|
47932
|
+
if (message.experimentalOptions) {
|
|
47933
|
+
const entries = Object.entries(message.experimentalOptions);
|
|
47934
|
+
if (entries.length > 0) {
|
|
47935
|
+
obj.experimentalOptions = {};
|
|
47936
|
+
entries.forEach(([k, v]) => {
|
|
47937
|
+
obj.experimentalOptions[k] = v;
|
|
47938
|
+
});
|
|
47939
|
+
}
|
|
47940
|
+
}
|
|
47941
|
+
return obj;
|
|
47942
|
+
},
|
|
47943
|
+
create(base) {
|
|
47944
|
+
return VolumeCreateOptions.fromPartial(base ?? {});
|
|
47945
|
+
},
|
|
47946
|
+
fromPartial(object) {
|
|
47947
|
+
const message = createBaseVolumeCreateOptions();
|
|
47948
|
+
message.experimentalOptions = Object.entries(object.experimentalOptions ?? {}).reduce(
|
|
47949
|
+
(acc, [key, value]) => {
|
|
47950
|
+
if (value !== void 0) {
|
|
47951
|
+
acc[key] = globalThis.String(value);
|
|
47952
|
+
}
|
|
47953
|
+
return acc;
|
|
47954
|
+
},
|
|
47955
|
+
{}
|
|
47956
|
+
);
|
|
47957
|
+
return message;
|
|
47958
|
+
}
|
|
47959
|
+
};
|
|
47960
|
+
function createBaseVolumeCreateOptions_ExperimentalOptionsEntry() {
|
|
47961
|
+
return { key: "", value: "" };
|
|
47962
|
+
}
|
|
47963
|
+
var VolumeCreateOptions_ExperimentalOptionsEntry = {
|
|
47964
|
+
encode(message, writer = new BinaryWriter()) {
|
|
47965
|
+
if (message.key !== "") {
|
|
47966
|
+
writer.uint32(10).string(message.key);
|
|
47967
|
+
}
|
|
47968
|
+
if (message.value !== "") {
|
|
47969
|
+
writer.uint32(18).string(message.value);
|
|
47970
|
+
}
|
|
47971
|
+
return writer;
|
|
47972
|
+
},
|
|
47973
|
+
decode(input, length) {
|
|
47974
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
47975
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
47976
|
+
const message = createBaseVolumeCreateOptions_ExperimentalOptionsEntry();
|
|
47977
|
+
while (reader.pos < end) {
|
|
47978
|
+
const tag = reader.uint32();
|
|
47979
|
+
switch (tag >>> 3) {
|
|
47980
|
+
case 1: {
|
|
47981
|
+
if (tag !== 10) {
|
|
47982
|
+
break;
|
|
47983
|
+
}
|
|
47984
|
+
message.key = reader.string();
|
|
47985
|
+
continue;
|
|
47986
|
+
}
|
|
47987
|
+
case 2: {
|
|
47988
|
+
if (tag !== 18) {
|
|
47989
|
+
break;
|
|
47990
|
+
}
|
|
47991
|
+
message.value = reader.string();
|
|
47992
|
+
continue;
|
|
47993
|
+
}
|
|
47994
|
+
}
|
|
47995
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
47996
|
+
break;
|
|
47997
|
+
}
|
|
47998
|
+
reader.skip(tag & 7);
|
|
47999
|
+
}
|
|
48000
|
+
return message;
|
|
48001
|
+
},
|
|
48002
|
+
fromJSON(object) {
|
|
48003
|
+
return {
|
|
48004
|
+
key: isSet5(object.key) ? globalThis.String(object.key) : "",
|
|
48005
|
+
value: isSet5(object.value) ? globalThis.String(object.value) : ""
|
|
48006
|
+
};
|
|
48007
|
+
},
|
|
48008
|
+
toJSON(message) {
|
|
48009
|
+
const obj = {};
|
|
48010
|
+
if (message.key !== "") {
|
|
48011
|
+
obj.key = message.key;
|
|
48012
|
+
}
|
|
48013
|
+
if (message.value !== "") {
|
|
48014
|
+
obj.value = message.value;
|
|
48015
|
+
}
|
|
48016
|
+
return obj;
|
|
48017
|
+
},
|
|
48018
|
+
create(base) {
|
|
48019
|
+
return VolumeCreateOptions_ExperimentalOptionsEntry.fromPartial(base ?? {});
|
|
48020
|
+
},
|
|
48021
|
+
fromPartial(object) {
|
|
48022
|
+
const message = createBaseVolumeCreateOptions_ExperimentalOptionsEntry();
|
|
48023
|
+
message.key = object.key ?? "";
|
|
48024
|
+
message.value = object.value ?? "";
|
|
48025
|
+
return message;
|
|
48026
|
+
}
|
|
48027
|
+
};
|
|
47255
48028
|
function createBaseVolumeDeleteRequest() {
|
|
47256
48029
|
return { volumeId: "", environmentName: "" };
|
|
47257
48030
|
}
|
|
@@ -47847,7 +48620,14 @@ var VolumeGetFileResponse = {
|
|
|
47847
48620
|
}
|
|
47848
48621
|
};
|
|
47849
48622
|
function createBaseVolumeGetOrCreateRequest() {
|
|
47850
|
-
return {
|
|
48623
|
+
return {
|
|
48624
|
+
deploymentName: "",
|
|
48625
|
+
environmentName: "",
|
|
48626
|
+
objectCreationType: 0,
|
|
48627
|
+
appId: "",
|
|
48628
|
+
version: 0,
|
|
48629
|
+
createOptions: void 0
|
|
48630
|
+
};
|
|
47851
48631
|
}
|
|
47852
48632
|
var VolumeGetOrCreateRequest = {
|
|
47853
48633
|
encode(message, writer = new BinaryWriter()) {
|
|
@@ -47866,6 +48646,9 @@ var VolumeGetOrCreateRequest = {
|
|
|
47866
48646
|
if (message.version !== 0) {
|
|
47867
48647
|
writer.uint32(48).int32(message.version);
|
|
47868
48648
|
}
|
|
48649
|
+
if (message.createOptions !== void 0) {
|
|
48650
|
+
VolumeCreateOptions.encode(message.createOptions, writer.uint32(58).fork()).join();
|
|
48651
|
+
}
|
|
47869
48652
|
return writer;
|
|
47870
48653
|
},
|
|
47871
48654
|
decode(input, length) {
|
|
@@ -47910,6 +48693,13 @@ var VolumeGetOrCreateRequest = {
|
|
|
47910
48693
|
message.version = reader.int32();
|
|
47911
48694
|
continue;
|
|
47912
48695
|
}
|
|
48696
|
+
case 7: {
|
|
48697
|
+
if (tag !== 58) {
|
|
48698
|
+
break;
|
|
48699
|
+
}
|
|
48700
|
+
message.createOptions = VolumeCreateOptions.decode(reader, reader.uint32());
|
|
48701
|
+
continue;
|
|
48702
|
+
}
|
|
47913
48703
|
}
|
|
47914
48704
|
if ((tag & 7) === 4 || tag === 0) {
|
|
47915
48705
|
break;
|
|
@@ -47924,7 +48714,8 @@ var VolumeGetOrCreateRequest = {
|
|
|
47924
48714
|
environmentName: isSet5(object.environmentName) ? globalThis.String(object.environmentName) : "",
|
|
47925
48715
|
objectCreationType: isSet5(object.objectCreationType) ? objectCreationTypeFromJSON(object.objectCreationType) : 0,
|
|
47926
48716
|
appId: isSet5(object.appId) ? globalThis.String(object.appId) : "",
|
|
47927
|
-
version: isSet5(object.version) ? volumeFsVersionFromJSON(object.version) : 0
|
|
48717
|
+
version: isSet5(object.version) ? volumeFsVersionFromJSON(object.version) : 0,
|
|
48718
|
+
createOptions: isSet5(object.createOptions) ? VolumeCreateOptions.fromJSON(object.createOptions) : void 0
|
|
47928
48719
|
};
|
|
47929
48720
|
},
|
|
47930
48721
|
toJSON(message) {
|
|
@@ -47944,6 +48735,9 @@ var VolumeGetOrCreateRequest = {
|
|
|
47944
48735
|
if (message.version !== 0) {
|
|
47945
48736
|
obj.version = volumeFsVersionToJSON(message.version);
|
|
47946
48737
|
}
|
|
48738
|
+
if (message.createOptions !== void 0) {
|
|
48739
|
+
obj.createOptions = VolumeCreateOptions.toJSON(message.createOptions);
|
|
48740
|
+
}
|
|
47947
48741
|
return obj;
|
|
47948
48742
|
},
|
|
47949
48743
|
create(base) {
|
|
@@ -47956,6 +48750,7 @@ var VolumeGetOrCreateRequest = {
|
|
|
47956
48750
|
message.objectCreationType = object.objectCreationType ?? 0;
|
|
47957
48751
|
message.appId = object.appId ?? "";
|
|
47958
48752
|
message.version = object.version ?? 0;
|
|
48753
|
+
message.createOptions = object.createOptions !== void 0 && object.createOptions !== null ? VolumeCreateOptions.fromPartial(object.createOptions) : void 0;
|
|
47959
48754
|
return message;
|
|
47960
48755
|
}
|
|
47961
48756
|
};
|
|
@@ -50414,7 +51209,6 @@ function createBaseWorkspaceBillingReportItem() {
|
|
|
50414
51209
|
interval: void 0,
|
|
50415
51210
|
cost: "",
|
|
50416
51211
|
tags: {},
|
|
50417
|
-
costByResourceFloat: {},
|
|
50418
51212
|
costByResource: {}
|
|
50419
51213
|
};
|
|
50420
51214
|
}
|
|
@@ -50438,9 +51232,6 @@ var WorkspaceBillingReportItem = {
|
|
|
50438
51232
|
Object.entries(message.tags).forEach(([key, value]) => {
|
|
50439
51233
|
WorkspaceBillingReportItem_TagsEntry.encode({ key, value }, writer.uint32(50).fork()).join();
|
|
50440
51234
|
});
|
|
50441
|
-
Object.entries(message.costByResourceFloat).forEach(([key, value]) => {
|
|
50442
|
-
WorkspaceBillingReportItem_CostByResourceFloatEntry.encode({ key, value }, writer.uint32(58).fork()).join();
|
|
50443
|
-
});
|
|
50444
51235
|
Object.entries(message.costByResource).forEach(([key, value]) => {
|
|
50445
51236
|
WorkspaceBillingReportItem_CostByResourceEntry.encode({ key, value }, writer.uint32(66).fork()).join();
|
|
50446
51237
|
});
|
|
@@ -50498,16 +51289,6 @@ var WorkspaceBillingReportItem = {
|
|
|
50498
51289
|
}
|
|
50499
51290
|
continue;
|
|
50500
51291
|
}
|
|
50501
|
-
case 7: {
|
|
50502
|
-
if (tag !== 58) {
|
|
50503
|
-
break;
|
|
50504
|
-
}
|
|
50505
|
-
const entry7 = WorkspaceBillingReportItem_CostByResourceFloatEntry.decode(reader, reader.uint32());
|
|
50506
|
-
if (entry7.value !== void 0) {
|
|
50507
|
-
message.costByResourceFloat[entry7.key] = entry7.value;
|
|
50508
|
-
}
|
|
50509
|
-
continue;
|
|
50510
|
-
}
|
|
50511
51292
|
case 8: {
|
|
50512
51293
|
if (tag !== 66) {
|
|
50513
51294
|
break;
|
|
@@ -50537,10 +51318,6 @@ var WorkspaceBillingReportItem = {
|
|
|
50537
51318
|
acc[key] = String(value);
|
|
50538
51319
|
return acc;
|
|
50539
51320
|
}, {}) : {},
|
|
50540
|
-
costByResourceFloat: isObject2(object.costByResourceFloat) ? Object.entries(object.costByResourceFloat).reduce((acc, [key, value]) => {
|
|
50541
|
-
acc[key] = Number(value);
|
|
50542
|
-
return acc;
|
|
50543
|
-
}, {}) : {},
|
|
50544
51321
|
costByResource: isObject2(object.costByResource) ? Object.entries(object.costByResource).reduce((acc, [key, value]) => {
|
|
50545
51322
|
acc[key] = String(value);
|
|
50546
51323
|
return acc;
|
|
@@ -50573,15 +51350,6 @@ var WorkspaceBillingReportItem = {
|
|
|
50573
51350
|
});
|
|
50574
51351
|
}
|
|
50575
51352
|
}
|
|
50576
|
-
if (message.costByResourceFloat) {
|
|
50577
|
-
const entries = Object.entries(message.costByResourceFloat);
|
|
50578
|
-
if (entries.length > 0) {
|
|
50579
|
-
obj.costByResourceFloat = {};
|
|
50580
|
-
entries.forEach(([k, v]) => {
|
|
50581
|
-
obj.costByResourceFloat[k] = v;
|
|
50582
|
-
});
|
|
50583
|
-
}
|
|
50584
|
-
}
|
|
50585
51353
|
if (message.costByResource) {
|
|
50586
51354
|
const entries = Object.entries(message.costByResource);
|
|
50587
51355
|
if (entries.length > 0) {
|
|
@@ -50609,15 +51377,6 @@ var WorkspaceBillingReportItem = {
|
|
|
50609
51377
|
}
|
|
50610
51378
|
return acc;
|
|
50611
51379
|
}, {});
|
|
50612
|
-
message.costByResourceFloat = Object.entries(object.costByResourceFloat ?? {}).reduce(
|
|
50613
|
-
(acc, [key, value]) => {
|
|
50614
|
-
if (value !== void 0) {
|
|
50615
|
-
acc[key] = globalThis.Number(value);
|
|
50616
|
-
}
|
|
50617
|
-
return acc;
|
|
50618
|
-
},
|
|
50619
|
-
{}
|
|
50620
|
-
);
|
|
50621
51380
|
message.costByResource = Object.entries(object.costByResource ?? {}).reduce(
|
|
50622
51381
|
(acc, [key, value]) => {
|
|
50623
51382
|
if (value !== void 0) {
|
|
@@ -50698,74 +51457,6 @@ var WorkspaceBillingReportItem_TagsEntry = {
|
|
|
50698
51457
|
return message;
|
|
50699
51458
|
}
|
|
50700
51459
|
};
|
|
50701
|
-
function createBaseWorkspaceBillingReportItem_CostByResourceFloatEntry() {
|
|
50702
|
-
return { key: "", value: 0 };
|
|
50703
|
-
}
|
|
50704
|
-
var WorkspaceBillingReportItem_CostByResourceFloatEntry = {
|
|
50705
|
-
encode(message, writer = new BinaryWriter()) {
|
|
50706
|
-
if (message.key !== "") {
|
|
50707
|
-
writer.uint32(10).string(message.key);
|
|
50708
|
-
}
|
|
50709
|
-
if (message.value !== 0) {
|
|
50710
|
-
writer.uint32(17).double(message.value);
|
|
50711
|
-
}
|
|
50712
|
-
return writer;
|
|
50713
|
-
},
|
|
50714
|
-
decode(input, length) {
|
|
50715
|
-
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
50716
|
-
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
50717
|
-
const message = createBaseWorkspaceBillingReportItem_CostByResourceFloatEntry();
|
|
50718
|
-
while (reader.pos < end) {
|
|
50719
|
-
const tag = reader.uint32();
|
|
50720
|
-
switch (tag >>> 3) {
|
|
50721
|
-
case 1: {
|
|
50722
|
-
if (tag !== 10) {
|
|
50723
|
-
break;
|
|
50724
|
-
}
|
|
50725
|
-
message.key = reader.string();
|
|
50726
|
-
continue;
|
|
50727
|
-
}
|
|
50728
|
-
case 2: {
|
|
50729
|
-
if (tag !== 17) {
|
|
50730
|
-
break;
|
|
50731
|
-
}
|
|
50732
|
-
message.value = reader.double();
|
|
50733
|
-
continue;
|
|
50734
|
-
}
|
|
50735
|
-
}
|
|
50736
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
50737
|
-
break;
|
|
50738
|
-
}
|
|
50739
|
-
reader.skip(tag & 7);
|
|
50740
|
-
}
|
|
50741
|
-
return message;
|
|
50742
|
-
},
|
|
50743
|
-
fromJSON(object) {
|
|
50744
|
-
return {
|
|
50745
|
-
key: isSet5(object.key) ? globalThis.String(object.key) : "",
|
|
50746
|
-
value: isSet5(object.value) ? globalThis.Number(object.value) : 0
|
|
50747
|
-
};
|
|
50748
|
-
},
|
|
50749
|
-
toJSON(message) {
|
|
50750
|
-
const obj = {};
|
|
50751
|
-
if (message.key !== "") {
|
|
50752
|
-
obj.key = message.key;
|
|
50753
|
-
}
|
|
50754
|
-
if (message.value !== 0) {
|
|
50755
|
-
obj.value = message.value;
|
|
50756
|
-
}
|
|
50757
|
-
return obj;
|
|
50758
|
-
},
|
|
50759
|
-
create(base) {
|
|
50760
|
-
return WorkspaceBillingReportItem_CostByResourceFloatEntry.fromPartial(base ?? {});
|
|
50761
|
-
},
|
|
50762
|
-
fromPartial(object) {
|
|
50763
|
-
const message = createBaseWorkspaceBillingReportItem_CostByResourceFloatEntry();
|
|
50764
|
-
message.key = object.key ?? "";
|
|
50765
|
-
message.value = object.value ?? 0;
|
|
50766
|
-
return message;
|
|
50767
|
-
}
|
|
50768
|
-
};
|
|
50769
51460
|
function createBaseWorkspaceBillingReportItem_CostByResourceEntry() {
|
|
50770
51461
|
return { key: "", value: "" };
|
|
50771
51462
|
}
|
|
@@ -50969,6 +51660,348 @@ var WorkspaceBillingReportRequest = {
|
|
|
50969
51660
|
return message;
|
|
50970
51661
|
}
|
|
50971
51662
|
};
|
|
51663
|
+
function createBaseWorkspaceBillingSummaryRequest() {
|
|
51664
|
+
return { startTimestamp: void 0, endTimestamp: void 0 };
|
|
51665
|
+
}
|
|
51666
|
+
var WorkspaceBillingSummaryRequest = {
|
|
51667
|
+
encode(message, writer = new BinaryWriter()) {
|
|
51668
|
+
if (message.startTimestamp !== void 0) {
|
|
51669
|
+
Timestamp.encode(toTimestamp(message.startTimestamp), writer.uint32(10).fork()).join();
|
|
51670
|
+
}
|
|
51671
|
+
if (message.endTimestamp !== void 0) {
|
|
51672
|
+
Timestamp.encode(toTimestamp(message.endTimestamp), writer.uint32(18).fork()).join();
|
|
51673
|
+
}
|
|
51674
|
+
return writer;
|
|
51675
|
+
},
|
|
51676
|
+
decode(input, length) {
|
|
51677
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
51678
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
51679
|
+
const message = createBaseWorkspaceBillingSummaryRequest();
|
|
51680
|
+
while (reader.pos < end) {
|
|
51681
|
+
const tag = reader.uint32();
|
|
51682
|
+
switch (tag >>> 3) {
|
|
51683
|
+
case 1: {
|
|
51684
|
+
if (tag !== 10) {
|
|
51685
|
+
break;
|
|
51686
|
+
}
|
|
51687
|
+
message.startTimestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
51688
|
+
continue;
|
|
51689
|
+
}
|
|
51690
|
+
case 2: {
|
|
51691
|
+
if (tag !== 18) {
|
|
51692
|
+
break;
|
|
51693
|
+
}
|
|
51694
|
+
message.endTimestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
51695
|
+
continue;
|
|
51696
|
+
}
|
|
51697
|
+
}
|
|
51698
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
51699
|
+
break;
|
|
51700
|
+
}
|
|
51701
|
+
reader.skip(tag & 7);
|
|
51702
|
+
}
|
|
51703
|
+
return message;
|
|
51704
|
+
},
|
|
51705
|
+
fromJSON(object) {
|
|
51706
|
+
return {
|
|
51707
|
+
startTimestamp: isSet5(object.startTimestamp) ? fromJsonTimestamp(object.startTimestamp) : void 0,
|
|
51708
|
+
endTimestamp: isSet5(object.endTimestamp) ? fromJsonTimestamp(object.endTimestamp) : void 0
|
|
51709
|
+
};
|
|
51710
|
+
},
|
|
51711
|
+
toJSON(message) {
|
|
51712
|
+
const obj = {};
|
|
51713
|
+
if (message.startTimestamp !== void 0) {
|
|
51714
|
+
obj.startTimestamp = message.startTimestamp.toISOString();
|
|
51715
|
+
}
|
|
51716
|
+
if (message.endTimestamp !== void 0) {
|
|
51717
|
+
obj.endTimestamp = message.endTimestamp.toISOString();
|
|
51718
|
+
}
|
|
51719
|
+
return obj;
|
|
51720
|
+
},
|
|
51721
|
+
create(base) {
|
|
51722
|
+
return WorkspaceBillingSummaryRequest.fromPartial(base ?? {});
|
|
51723
|
+
},
|
|
51724
|
+
fromPartial(object) {
|
|
51725
|
+
const message = createBaseWorkspaceBillingSummaryRequest();
|
|
51726
|
+
message.startTimestamp = object.startTimestamp ?? void 0;
|
|
51727
|
+
message.endTimestamp = object.endTimestamp ?? void 0;
|
|
51728
|
+
return message;
|
|
51729
|
+
}
|
|
51730
|
+
};
|
|
51731
|
+
function createBaseWorkspaceBillingSummaryResponse() {
|
|
51732
|
+
return {
|
|
51733
|
+
startTimestamp: void 0,
|
|
51734
|
+
endTimestamp: void 0,
|
|
51735
|
+
meteredCost: "",
|
|
51736
|
+
planCost: "",
|
|
51737
|
+
creditsApplied: "",
|
|
51738
|
+
reservationsDiscount: "",
|
|
51739
|
+
volumesDiscount: "",
|
|
51740
|
+
billedCost: "",
|
|
51741
|
+
meteredCostBreakdown: {}
|
|
51742
|
+
};
|
|
51743
|
+
}
|
|
51744
|
+
var WorkspaceBillingSummaryResponse = {
|
|
51745
|
+
encode(message, writer = new BinaryWriter()) {
|
|
51746
|
+
if (message.startTimestamp !== void 0) {
|
|
51747
|
+
Timestamp.encode(toTimestamp(message.startTimestamp), writer.uint32(10).fork()).join();
|
|
51748
|
+
}
|
|
51749
|
+
if (message.endTimestamp !== void 0) {
|
|
51750
|
+
Timestamp.encode(toTimestamp(message.endTimestamp), writer.uint32(18).fork()).join();
|
|
51751
|
+
}
|
|
51752
|
+
if (message.meteredCost !== "") {
|
|
51753
|
+
writer.uint32(26).string(message.meteredCost);
|
|
51754
|
+
}
|
|
51755
|
+
if (message.planCost !== "") {
|
|
51756
|
+
writer.uint32(34).string(message.planCost);
|
|
51757
|
+
}
|
|
51758
|
+
if (message.creditsApplied !== "") {
|
|
51759
|
+
writer.uint32(42).string(message.creditsApplied);
|
|
51760
|
+
}
|
|
51761
|
+
if (message.reservationsDiscount !== "") {
|
|
51762
|
+
writer.uint32(50).string(message.reservationsDiscount);
|
|
51763
|
+
}
|
|
51764
|
+
if (message.volumesDiscount !== "") {
|
|
51765
|
+
writer.uint32(58).string(message.volumesDiscount);
|
|
51766
|
+
}
|
|
51767
|
+
if (message.billedCost !== "") {
|
|
51768
|
+
writer.uint32(66).string(message.billedCost);
|
|
51769
|
+
}
|
|
51770
|
+
Object.entries(message.meteredCostBreakdown).forEach(([key, value]) => {
|
|
51771
|
+
WorkspaceBillingSummaryResponse_MeteredCostBreakdownEntry.encode(
|
|
51772
|
+
{ key, value },
|
|
51773
|
+
writer.uint32(74).fork()
|
|
51774
|
+
).join();
|
|
51775
|
+
});
|
|
51776
|
+
return writer;
|
|
51777
|
+
},
|
|
51778
|
+
decode(input, length) {
|
|
51779
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
51780
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
51781
|
+
const message = createBaseWorkspaceBillingSummaryResponse();
|
|
51782
|
+
while (reader.pos < end) {
|
|
51783
|
+
const tag = reader.uint32();
|
|
51784
|
+
switch (tag >>> 3) {
|
|
51785
|
+
case 1: {
|
|
51786
|
+
if (tag !== 10) {
|
|
51787
|
+
break;
|
|
51788
|
+
}
|
|
51789
|
+
message.startTimestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
51790
|
+
continue;
|
|
51791
|
+
}
|
|
51792
|
+
case 2: {
|
|
51793
|
+
if (tag !== 18) {
|
|
51794
|
+
break;
|
|
51795
|
+
}
|
|
51796
|
+
message.endTimestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
51797
|
+
continue;
|
|
51798
|
+
}
|
|
51799
|
+
case 3: {
|
|
51800
|
+
if (tag !== 26) {
|
|
51801
|
+
break;
|
|
51802
|
+
}
|
|
51803
|
+
message.meteredCost = reader.string();
|
|
51804
|
+
continue;
|
|
51805
|
+
}
|
|
51806
|
+
case 4: {
|
|
51807
|
+
if (tag !== 34) {
|
|
51808
|
+
break;
|
|
51809
|
+
}
|
|
51810
|
+
message.planCost = reader.string();
|
|
51811
|
+
continue;
|
|
51812
|
+
}
|
|
51813
|
+
case 5: {
|
|
51814
|
+
if (tag !== 42) {
|
|
51815
|
+
break;
|
|
51816
|
+
}
|
|
51817
|
+
message.creditsApplied = reader.string();
|
|
51818
|
+
continue;
|
|
51819
|
+
}
|
|
51820
|
+
case 6: {
|
|
51821
|
+
if (tag !== 50) {
|
|
51822
|
+
break;
|
|
51823
|
+
}
|
|
51824
|
+
message.reservationsDiscount = reader.string();
|
|
51825
|
+
continue;
|
|
51826
|
+
}
|
|
51827
|
+
case 7: {
|
|
51828
|
+
if (tag !== 58) {
|
|
51829
|
+
break;
|
|
51830
|
+
}
|
|
51831
|
+
message.volumesDiscount = reader.string();
|
|
51832
|
+
continue;
|
|
51833
|
+
}
|
|
51834
|
+
case 8: {
|
|
51835
|
+
if (tag !== 66) {
|
|
51836
|
+
break;
|
|
51837
|
+
}
|
|
51838
|
+
message.billedCost = reader.string();
|
|
51839
|
+
continue;
|
|
51840
|
+
}
|
|
51841
|
+
case 9: {
|
|
51842
|
+
if (tag !== 74) {
|
|
51843
|
+
break;
|
|
51844
|
+
}
|
|
51845
|
+
const entry9 = WorkspaceBillingSummaryResponse_MeteredCostBreakdownEntry.decode(reader, reader.uint32());
|
|
51846
|
+
if (entry9.value !== void 0) {
|
|
51847
|
+
message.meteredCostBreakdown[entry9.key] = entry9.value;
|
|
51848
|
+
}
|
|
51849
|
+
continue;
|
|
51850
|
+
}
|
|
51851
|
+
}
|
|
51852
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
51853
|
+
break;
|
|
51854
|
+
}
|
|
51855
|
+
reader.skip(tag & 7);
|
|
51856
|
+
}
|
|
51857
|
+
return message;
|
|
51858
|
+
},
|
|
51859
|
+
fromJSON(object) {
|
|
51860
|
+
return {
|
|
51861
|
+
startTimestamp: isSet5(object.startTimestamp) ? fromJsonTimestamp(object.startTimestamp) : void 0,
|
|
51862
|
+
endTimestamp: isSet5(object.endTimestamp) ? fromJsonTimestamp(object.endTimestamp) : void 0,
|
|
51863
|
+
meteredCost: isSet5(object.meteredCost) ? globalThis.String(object.meteredCost) : "",
|
|
51864
|
+
planCost: isSet5(object.planCost) ? globalThis.String(object.planCost) : "",
|
|
51865
|
+
creditsApplied: isSet5(object.creditsApplied) ? globalThis.String(object.creditsApplied) : "",
|
|
51866
|
+
reservationsDiscount: isSet5(object.reservationsDiscount) ? globalThis.String(object.reservationsDiscount) : "",
|
|
51867
|
+
volumesDiscount: isSet5(object.volumesDiscount) ? globalThis.String(object.volumesDiscount) : "",
|
|
51868
|
+
billedCost: isSet5(object.billedCost) ? globalThis.String(object.billedCost) : "",
|
|
51869
|
+
meteredCostBreakdown: isObject2(object.meteredCostBreakdown) ? Object.entries(object.meteredCostBreakdown).reduce((acc, [key, value]) => {
|
|
51870
|
+
acc[key] = String(value);
|
|
51871
|
+
return acc;
|
|
51872
|
+
}, {}) : {}
|
|
51873
|
+
};
|
|
51874
|
+
},
|
|
51875
|
+
toJSON(message) {
|
|
51876
|
+
const obj = {};
|
|
51877
|
+
if (message.startTimestamp !== void 0) {
|
|
51878
|
+
obj.startTimestamp = message.startTimestamp.toISOString();
|
|
51879
|
+
}
|
|
51880
|
+
if (message.endTimestamp !== void 0) {
|
|
51881
|
+
obj.endTimestamp = message.endTimestamp.toISOString();
|
|
51882
|
+
}
|
|
51883
|
+
if (message.meteredCost !== "") {
|
|
51884
|
+
obj.meteredCost = message.meteredCost;
|
|
51885
|
+
}
|
|
51886
|
+
if (message.planCost !== "") {
|
|
51887
|
+
obj.planCost = message.planCost;
|
|
51888
|
+
}
|
|
51889
|
+
if (message.creditsApplied !== "") {
|
|
51890
|
+
obj.creditsApplied = message.creditsApplied;
|
|
51891
|
+
}
|
|
51892
|
+
if (message.reservationsDiscount !== "") {
|
|
51893
|
+
obj.reservationsDiscount = message.reservationsDiscount;
|
|
51894
|
+
}
|
|
51895
|
+
if (message.volumesDiscount !== "") {
|
|
51896
|
+
obj.volumesDiscount = message.volumesDiscount;
|
|
51897
|
+
}
|
|
51898
|
+
if (message.billedCost !== "") {
|
|
51899
|
+
obj.billedCost = message.billedCost;
|
|
51900
|
+
}
|
|
51901
|
+
if (message.meteredCostBreakdown) {
|
|
51902
|
+
const entries = Object.entries(message.meteredCostBreakdown);
|
|
51903
|
+
if (entries.length > 0) {
|
|
51904
|
+
obj.meteredCostBreakdown = {};
|
|
51905
|
+
entries.forEach(([k, v]) => {
|
|
51906
|
+
obj.meteredCostBreakdown[k] = v;
|
|
51907
|
+
});
|
|
51908
|
+
}
|
|
51909
|
+
}
|
|
51910
|
+
return obj;
|
|
51911
|
+
},
|
|
51912
|
+
create(base) {
|
|
51913
|
+
return WorkspaceBillingSummaryResponse.fromPartial(base ?? {});
|
|
51914
|
+
},
|
|
51915
|
+
fromPartial(object) {
|
|
51916
|
+
const message = createBaseWorkspaceBillingSummaryResponse();
|
|
51917
|
+
message.startTimestamp = object.startTimestamp ?? void 0;
|
|
51918
|
+
message.endTimestamp = object.endTimestamp ?? void 0;
|
|
51919
|
+
message.meteredCost = object.meteredCost ?? "";
|
|
51920
|
+
message.planCost = object.planCost ?? "";
|
|
51921
|
+
message.creditsApplied = object.creditsApplied ?? "";
|
|
51922
|
+
message.reservationsDiscount = object.reservationsDiscount ?? "";
|
|
51923
|
+
message.volumesDiscount = object.volumesDiscount ?? "";
|
|
51924
|
+
message.billedCost = object.billedCost ?? "";
|
|
51925
|
+
message.meteredCostBreakdown = Object.entries(object.meteredCostBreakdown ?? {}).reduce(
|
|
51926
|
+
(acc, [key, value]) => {
|
|
51927
|
+
if (value !== void 0) {
|
|
51928
|
+
acc[key] = globalThis.String(value);
|
|
51929
|
+
}
|
|
51930
|
+
return acc;
|
|
51931
|
+
},
|
|
51932
|
+
{}
|
|
51933
|
+
);
|
|
51934
|
+
return message;
|
|
51935
|
+
}
|
|
51936
|
+
};
|
|
51937
|
+
function createBaseWorkspaceBillingSummaryResponse_MeteredCostBreakdownEntry() {
|
|
51938
|
+
return { key: "", value: "" };
|
|
51939
|
+
}
|
|
51940
|
+
var WorkspaceBillingSummaryResponse_MeteredCostBreakdownEntry = {
|
|
51941
|
+
encode(message, writer = new BinaryWriter()) {
|
|
51942
|
+
if (message.key !== "") {
|
|
51943
|
+
writer.uint32(10).string(message.key);
|
|
51944
|
+
}
|
|
51945
|
+
if (message.value !== "") {
|
|
51946
|
+
writer.uint32(18).string(message.value);
|
|
51947
|
+
}
|
|
51948
|
+
return writer;
|
|
51949
|
+
},
|
|
51950
|
+
decode(input, length) {
|
|
51951
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
51952
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
51953
|
+
const message = createBaseWorkspaceBillingSummaryResponse_MeteredCostBreakdownEntry();
|
|
51954
|
+
while (reader.pos < end) {
|
|
51955
|
+
const tag = reader.uint32();
|
|
51956
|
+
switch (tag >>> 3) {
|
|
51957
|
+
case 1: {
|
|
51958
|
+
if (tag !== 10) {
|
|
51959
|
+
break;
|
|
51960
|
+
}
|
|
51961
|
+
message.key = reader.string();
|
|
51962
|
+
continue;
|
|
51963
|
+
}
|
|
51964
|
+
case 2: {
|
|
51965
|
+
if (tag !== 18) {
|
|
51966
|
+
break;
|
|
51967
|
+
}
|
|
51968
|
+
message.value = reader.string();
|
|
51969
|
+
continue;
|
|
51970
|
+
}
|
|
51971
|
+
}
|
|
51972
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
51973
|
+
break;
|
|
51974
|
+
}
|
|
51975
|
+
reader.skip(tag & 7);
|
|
51976
|
+
}
|
|
51977
|
+
return message;
|
|
51978
|
+
},
|
|
51979
|
+
fromJSON(object) {
|
|
51980
|
+
return {
|
|
51981
|
+
key: isSet5(object.key) ? globalThis.String(object.key) : "",
|
|
51982
|
+
value: isSet5(object.value) ? globalThis.String(object.value) : ""
|
|
51983
|
+
};
|
|
51984
|
+
},
|
|
51985
|
+
toJSON(message) {
|
|
51986
|
+
const obj = {};
|
|
51987
|
+
if (message.key !== "") {
|
|
51988
|
+
obj.key = message.key;
|
|
51989
|
+
}
|
|
51990
|
+
if (message.value !== "") {
|
|
51991
|
+
obj.value = message.value;
|
|
51992
|
+
}
|
|
51993
|
+
return obj;
|
|
51994
|
+
},
|
|
51995
|
+
create(base) {
|
|
51996
|
+
return WorkspaceBillingSummaryResponse_MeteredCostBreakdownEntry.fromPartial(base ?? {});
|
|
51997
|
+
},
|
|
51998
|
+
fromPartial(object) {
|
|
51999
|
+
const message = createBaseWorkspaceBillingSummaryResponse_MeteredCostBreakdownEntry();
|
|
52000
|
+
message.key = object.key ?? "";
|
|
52001
|
+
message.value = object.value ?? "";
|
|
52002
|
+
return message;
|
|
52003
|
+
}
|
|
52004
|
+
};
|
|
50972
52005
|
function createBaseWorkspaceDashboardUrlRequest() {
|
|
50973
52006
|
return { environmentName: "" };
|
|
50974
52007
|
}
|
|
@@ -51996,6 +53029,14 @@ var ModalClientDefinition = {
|
|
|
51996
53029
|
responseStream: false,
|
|
51997
53030
|
options: {}
|
|
51998
53031
|
},
|
|
53032
|
+
containerServerLifecycleReady: {
|
|
53033
|
+
name: "ContainerServerLifecycleReady",
|
|
53034
|
+
requestType: ContainerServerLifecycleReadyRequest,
|
|
53035
|
+
requestStream: false,
|
|
53036
|
+
responseType: Empty,
|
|
53037
|
+
responseStream: false,
|
|
53038
|
+
options: {}
|
|
53039
|
+
},
|
|
51999
53040
|
containerStop: {
|
|
52000
53041
|
name: "ContainerStop",
|
|
52001
53042
|
requestType: ContainerStopRequest,
|
|
@@ -52177,6 +53218,14 @@ var ModalClientDefinition = {
|
|
|
52177
53218
|
options: {}
|
|
52178
53219
|
},
|
|
52179
53220
|
/** Environments */
|
|
53221
|
+
environmentBillingSummary: {
|
|
53222
|
+
name: "EnvironmentBillingSummary",
|
|
53223
|
+
requestType: EnvironmentBillingSummaryRequest,
|
|
53224
|
+
requestStream: false,
|
|
53225
|
+
responseType: EnvironmentBillingSummaryResponse,
|
|
53226
|
+
responseStream: false,
|
|
53227
|
+
options: {}
|
|
53228
|
+
},
|
|
52180
53229
|
environmentCreate: {
|
|
52181
53230
|
name: "EnvironmentCreate",
|
|
52182
53231
|
requestType: EnvironmentCreateRequest,
|
|
@@ -52578,6 +53627,14 @@ var ModalClientDefinition = {
|
|
|
52578
53627
|
options: {}
|
|
52579
53628
|
},
|
|
52580
53629
|
/** Mounts */
|
|
53630
|
+
mountBatchedCheckExistence: {
|
|
53631
|
+
name: "MountBatchedCheckExistence",
|
|
53632
|
+
requestType: MountBatchedCheckExistenceRequest,
|
|
53633
|
+
requestStream: false,
|
|
53634
|
+
responseType: MountBatchedCheckExistenceResponse,
|
|
53635
|
+
responseStream: false,
|
|
53636
|
+
options: {}
|
|
53637
|
+
},
|
|
52581
53638
|
mountGetOrCreate: {
|
|
52582
53639
|
name: "MountGetOrCreate",
|
|
52583
53640
|
requestType: MountGetOrCreateRequest,
|
|
@@ -52782,6 +53839,14 @@ var ModalClientDefinition = {
|
|
|
52782
53839
|
responseStream: false,
|
|
52783
53840
|
options: {}
|
|
52784
53841
|
},
|
|
53842
|
+
sandboxGetFromNameV2: {
|
|
53843
|
+
name: "SandboxGetFromNameV2",
|
|
53844
|
+
requestType: SandboxGetFromNameRequest,
|
|
53845
|
+
requestStream: false,
|
|
53846
|
+
responseType: SandboxGetFromNameResponse,
|
|
53847
|
+
responseStream: false,
|
|
53848
|
+
options: {}
|
|
53849
|
+
},
|
|
52785
53850
|
sandboxGetLogs: {
|
|
52786
53851
|
name: "SandboxGetLogs",
|
|
52787
53852
|
requestType: SandboxGetLogsRequest,
|
|
@@ -52919,6 +53984,14 @@ var ModalClientDefinition = {
|
|
|
52919
53984
|
responseStream: false,
|
|
52920
53985
|
options: {}
|
|
52921
53986
|
},
|
|
53987
|
+
sandboxTagsGetV2: {
|
|
53988
|
+
name: "SandboxTagsGetV2",
|
|
53989
|
+
requestType: SandboxTagsGetRequest,
|
|
53990
|
+
requestStream: false,
|
|
53991
|
+
responseType: SandboxTagsGetResponse,
|
|
53992
|
+
responseStream: false,
|
|
53993
|
+
options: {}
|
|
53994
|
+
},
|
|
52922
53995
|
sandboxTagsSet: {
|
|
52923
53996
|
name: "SandboxTagsSet",
|
|
52924
53997
|
requestType: SandboxTagsSetRequest,
|
|
@@ -52927,6 +54000,14 @@ var ModalClientDefinition = {
|
|
|
52927
54000
|
responseStream: false,
|
|
52928
54001
|
options: {}
|
|
52929
54002
|
},
|
|
54003
|
+
sandboxTagsSetV2: {
|
|
54004
|
+
name: "SandboxTagsSetV2",
|
|
54005
|
+
requestType: SandboxTagsSetRequest,
|
|
54006
|
+
requestStream: false,
|
|
54007
|
+
responseType: Empty,
|
|
54008
|
+
responseStream: false,
|
|
54009
|
+
options: {}
|
|
54010
|
+
},
|
|
52930
54011
|
sandboxTerminate: {
|
|
52931
54012
|
name: "SandboxTerminate",
|
|
52932
54013
|
requestType: SandboxTerminateRequest,
|
|
@@ -53393,6 +54474,14 @@ var ModalClientDefinition = {
|
|
|
53393
54474
|
responseStream: true,
|
|
53394
54475
|
options: {}
|
|
53395
54476
|
},
|
|
54477
|
+
workspaceBillingSummary: {
|
|
54478
|
+
name: "WorkspaceBillingSummary",
|
|
54479
|
+
requestType: WorkspaceBillingSummaryRequest,
|
|
54480
|
+
requestStream: false,
|
|
54481
|
+
responseType: WorkspaceBillingSummaryResponse,
|
|
54482
|
+
responseStream: false,
|
|
54483
|
+
options: {}
|
|
54484
|
+
},
|
|
53396
54485
|
workspaceDashboardUrlGet: {
|
|
53397
54486
|
name: "WorkspaceDashboardUrlGet",
|
|
53398
54487
|
requestType: WorkspaceDashboardUrlRequest,
|
|
@@ -54031,6 +55120,16 @@ import { ClientError as ClientError4, Status as Status4 } from "nice-grpc";
|
|
|
54031
55120
|
|
|
54032
55121
|
// src/secret.ts
|
|
54033
55122
|
import { ClientError as ClientError2, Status as Status2 } from "nice-grpc";
|
|
55123
|
+
var ENV_VAR_KEY_REGEX = /^[a-zA-Z_][a-zA-Z0-9_]*$/;
|
|
55124
|
+
function validateEnvVarKeys(env) {
|
|
55125
|
+
for (const key of Object.keys(env)) {
|
|
55126
|
+
if (!ENV_VAR_KEY_REGEX.test(key)) {
|
|
55127
|
+
throw new InvalidError(
|
|
55128
|
+
`Secret key name ${JSON.stringify(key)} is invalid for environment variables. Only letters, numbers, and underscores are allowed, and the name may not start with a number.`
|
|
55129
|
+
);
|
|
55130
|
+
}
|
|
55131
|
+
}
|
|
55132
|
+
}
|
|
54034
55133
|
var SecretService = class {
|
|
54035
55134
|
#client;
|
|
54036
55135
|
constructor(client) {
|
|
@@ -54060,7 +55159,16 @@ var SecretService = class {
|
|
|
54060
55159
|
throw err;
|
|
54061
55160
|
}
|
|
54062
55161
|
}
|
|
54063
|
-
/**
|
|
55162
|
+
/**
|
|
55163
|
+
* Create a {@link Secret} from a plain object of key-value pairs.
|
|
55164
|
+
*
|
|
55165
|
+
* The returned Secret is lazy: no server-side Secret is created (and
|
|
55166
|
+
* {@link Secret#secretId secretId} stays empty) until it is first used. When
|
|
55167
|
+
* used with {@link Sandbox#exec Sandbox.exec()} or
|
|
55168
|
+
* {@link SandboxService#experimentalCreate client.sandboxes.experimentalCreate()},
|
|
55169
|
+
* the values are sent directly to the worker as environment variables,
|
|
55170
|
+
* avoiding a `SecretGetOrCreate` round-trip entirely.
|
|
55171
|
+
*/
|
|
54064
55172
|
async fromObject(entries, params) {
|
|
54065
55173
|
for (const [, value] of Object.entries(entries)) {
|
|
54066
55174
|
if (value == null || typeof value !== "string") {
|
|
@@ -54069,23 +55177,14 @@ var SecretService = class {
|
|
|
54069
55177
|
);
|
|
54070
55178
|
}
|
|
54071
55179
|
}
|
|
54072
|
-
|
|
54073
|
-
|
|
54074
|
-
|
|
54075
|
-
|
|
54076
|
-
|
|
54077
|
-
|
|
54078
|
-
|
|
54079
|
-
|
|
54080
|
-
"secret_id",
|
|
54081
|
-
resp.secretId
|
|
54082
|
-
);
|
|
54083
|
-
return new Secret(resp.secretId);
|
|
54084
|
-
} catch (err) {
|
|
54085
|
-
if (err instanceof ClientError2 && (err.code === Status2.INVALID_ARGUMENT || err.code === Status2.FAILED_PRECONDITION))
|
|
54086
|
-
throw new InvalidError(err.details);
|
|
54087
|
-
throw err;
|
|
54088
|
-
}
|
|
55180
|
+
validateEnvVarKeys(entries);
|
|
55181
|
+
const envDict = { ...entries };
|
|
55182
|
+
const environment = this.#client.environmentName(params?.environment);
|
|
55183
|
+
return new Secret(
|
|
55184
|
+
"",
|
|
55185
|
+
void 0,
|
|
55186
|
+
new SecretFromObjectHydrator(envDict, environment)
|
|
55187
|
+
);
|
|
54089
55188
|
}
|
|
54090
55189
|
/**
|
|
54091
55190
|
* Delete a named {@link Secret}.
|
|
@@ -54116,15 +55215,98 @@ var SecretService = class {
|
|
|
54116
55215
|
}
|
|
54117
55216
|
}
|
|
54118
55217
|
};
|
|
55218
|
+
var SecretFromObjectHydrator = class {
|
|
55219
|
+
envDict;
|
|
55220
|
+
#environment;
|
|
55221
|
+
constructor(envDict, environment) {
|
|
55222
|
+
this.envDict = envDict;
|
|
55223
|
+
this.#environment = environment;
|
|
55224
|
+
}
|
|
55225
|
+
async hydrate(client) {
|
|
55226
|
+
try {
|
|
55227
|
+
const resp = await client.cpClient.secretGetOrCreate({
|
|
55228
|
+
objectCreationType: 5 /* OBJECT_CREATION_TYPE_EPHEMERAL */,
|
|
55229
|
+
envDict: this.envDict,
|
|
55230
|
+
environmentName: this.#environment
|
|
55231
|
+
});
|
|
55232
|
+
client.logger.debug(
|
|
55233
|
+
"Created ephemeral Secret",
|
|
55234
|
+
"secret_id",
|
|
55235
|
+
resp.secretId
|
|
55236
|
+
);
|
|
55237
|
+
return resp.secretId;
|
|
55238
|
+
} catch (err) {
|
|
55239
|
+
if (err instanceof ClientError2 && (err.code === Status2.INVALID_ARGUMENT || err.code === Status2.FAILED_PRECONDITION))
|
|
55240
|
+
throw new InvalidError(err.details);
|
|
55241
|
+
throw err;
|
|
55242
|
+
}
|
|
55243
|
+
}
|
|
55244
|
+
};
|
|
54119
55245
|
var Secret = class {
|
|
54120
|
-
secretId;
|
|
55246
|
+
#secretId;
|
|
54121
55247
|
name;
|
|
55248
|
+
// Resolves secretId lazily the first time it is needed. Undefined for Secrets
|
|
55249
|
+
// constructed already-hydrated (e.g. from fromName), and not consulted again
|
|
55250
|
+
// once secretId is set.
|
|
55251
|
+
#hydrator;
|
|
55252
|
+
// Caches the single in-flight (or successfully completed) hydration so the
|
|
55253
|
+
// ephemeral Secret is created at most once, even if multiple callers hydrate
|
|
55254
|
+
// the same Secret concurrently. Cleared on failure so a transient error
|
|
55255
|
+
// doesn't permanently break the Secret; subsequent calls can retry.
|
|
55256
|
+
#hydratePromise;
|
|
54122
55257
|
/** @ignore */
|
|
54123
|
-
constructor(secretId, name) {
|
|
54124
|
-
this
|
|
55258
|
+
constructor(secretId, name, hydrator) {
|
|
55259
|
+
this.#secretId = secretId;
|
|
54125
55260
|
this.name = name;
|
|
55261
|
+
this.#hydrator = hydrator;
|
|
55262
|
+
}
|
|
55263
|
+
/** The ID of the server-side Secret, or an empty string if not yet hydrated. */
|
|
55264
|
+
get secretId() {
|
|
55265
|
+
return this.#secretId;
|
|
55266
|
+
}
|
|
55267
|
+
/**
|
|
55268
|
+
* The hydrator resolving a lazy Secret to a secretId, or `undefined` for
|
|
55269
|
+
* Secrets that already reference a server-side Secret (e.g. from fromName).
|
|
55270
|
+
*
|
|
55271
|
+
* @internal
|
|
55272
|
+
* @hidden
|
|
55273
|
+
*/
|
|
55274
|
+
get _hydrator() {
|
|
55275
|
+
return this.#hydrator;
|
|
55276
|
+
}
|
|
55277
|
+
/**
|
|
55278
|
+
* Lazily create the ephemeral server-side Secret backing a fromObject Secret
|
|
55279
|
+
* and populate {@link Secret#secretId secretId}. A no-op once secretId is set
|
|
55280
|
+
* (e.g. for Secrets returned by fromName).
|
|
55281
|
+
*
|
|
55282
|
+
* @internal
|
|
55283
|
+
* @hidden
|
|
55284
|
+
*/
|
|
55285
|
+
async _hydrate(client) {
|
|
55286
|
+
if (this.#secretId !== "" || this.#hydrator === void 0) {
|
|
55287
|
+
return;
|
|
55288
|
+
}
|
|
55289
|
+
if (this.#hydratePromise === void 0) {
|
|
55290
|
+
this.#hydratePromise = this.#doHydrate(client);
|
|
55291
|
+
}
|
|
55292
|
+
const promise = this.#hydratePromise;
|
|
55293
|
+
try {
|
|
55294
|
+
await promise;
|
|
55295
|
+
} catch (err) {
|
|
55296
|
+
if (this.#hydratePromise === promise) {
|
|
55297
|
+
this.#hydratePromise = void 0;
|
|
55298
|
+
}
|
|
55299
|
+
throw err;
|
|
55300
|
+
}
|
|
55301
|
+
}
|
|
55302
|
+
async #doHydrate(client) {
|
|
55303
|
+
this.#secretId = await this.#hydrator.hydrate(client);
|
|
54126
55304
|
}
|
|
54127
55305
|
};
|
|
55306
|
+
function secretEnvDictHydrator(secret) {
|
|
55307
|
+
const hydrator = secret?._hydrator;
|
|
55308
|
+
return hydrator instanceof SecretFromObjectHydrator ? hydrator : void 0;
|
|
55309
|
+
}
|
|
54128
55310
|
async function mergeEnvIntoSecrets(client, env, secrets) {
|
|
54129
55311
|
const result = [...secrets || []];
|
|
54130
55312
|
if (env && Object.keys(env).length > 0) {
|
|
@@ -54132,6 +55314,38 @@ async function mergeEnvIntoSecrets(client, env, secrets) {
|
|
|
54132
55314
|
}
|
|
54133
55315
|
return result;
|
|
54134
55316
|
}
|
|
55317
|
+
async function hydrateSecrets(client, secrets) {
|
|
55318
|
+
secrets.forEach((secret, i) => {
|
|
55319
|
+
if (secret == null) {
|
|
55320
|
+
throw new InvalidError(`secret at index ${i} must not be null`);
|
|
55321
|
+
}
|
|
55322
|
+
});
|
|
55323
|
+
await Promise.all(secrets.map((secret) => secret._hydrate(client)));
|
|
55324
|
+
}
|
|
55325
|
+
function collectSecretIds(secrets) {
|
|
55326
|
+
return secrets.map((secret, i) => {
|
|
55327
|
+
if (secret == null) {
|
|
55328
|
+
throw new InvalidError(`secret at index ${i} must not be null`);
|
|
55329
|
+
}
|
|
55330
|
+
if (secret.secretId === "") {
|
|
55331
|
+
throw new InvalidError(`secret at index ${i} has not been hydrated`);
|
|
55332
|
+
}
|
|
55333
|
+
return secret.secretId;
|
|
55334
|
+
});
|
|
55335
|
+
}
|
|
55336
|
+
function splitEnvDictAndResolvableSecrets(secrets) {
|
|
55337
|
+
const envDict = {};
|
|
55338
|
+
const resolvable = [];
|
|
55339
|
+
for (const secret of secrets) {
|
|
55340
|
+
const hydrator = secret != null ? secretEnvDictHydrator(secret) : void 0;
|
|
55341
|
+
if (hydrator !== void 0) {
|
|
55342
|
+
Object.assign(envDict, hydrator.envDict);
|
|
55343
|
+
} else {
|
|
55344
|
+
resolvable.push(secret);
|
|
55345
|
+
}
|
|
55346
|
+
}
|
|
55347
|
+
return [envDict, resolvable];
|
|
55348
|
+
}
|
|
54135
55349
|
|
|
54136
55350
|
// src/volume.ts
|
|
54137
55351
|
import { ClientError as ClientError3, Status as Status3 } from "nice-grpc";
|
|
@@ -54391,7 +55605,8 @@ var FunctionService = class {
|
|
|
54391
55605
|
const resp = await this.#client.cpClient.functionGet({
|
|
54392
55606
|
appName,
|
|
54393
55607
|
objectTag: name,
|
|
54394
|
-
environmentName: this.#client.environmentName(params.environment)
|
|
55608
|
+
environmentName: this.#client.environmentName(params.environment),
|
|
55609
|
+
appVersion: params.version
|
|
54395
55610
|
});
|
|
54396
55611
|
this.#client.logger.debug(
|
|
54397
55612
|
"Retrieved Function",
|
|
@@ -54514,7 +55729,8 @@ async function buildFunctionOptionsProto(options) {
|
|
|
54514
55729
|
maxConcurrentInputs: o.maxConcurrentInputs,
|
|
54515
55730
|
targetConcurrentInputs: o.targetConcurrentInputs,
|
|
54516
55731
|
batchMaxSize: o.batchMaxSize,
|
|
54517
|
-
batchLingerMs: o.batchWaitMs
|
|
55732
|
+
batchLingerMs: o.batchWaitMs,
|
|
55733
|
+
routingRegion: o.routingRegion
|
|
54518
55734
|
});
|
|
54519
55735
|
return functionOptions;
|
|
54520
55736
|
}
|
|
@@ -54579,6 +55795,7 @@ async function bindParameters(client, functionId, options = {}, schema = [], par
|
|
|
54579
55795
|
options?.env,
|
|
54580
55796
|
options?.secrets
|
|
54581
55797
|
);
|
|
55798
|
+
await hydrateSecrets(client, mergedSecrets);
|
|
54582
55799
|
const mergedOptions = mergeServiceOptions(options, {
|
|
54583
55800
|
secrets: mergedSecrets,
|
|
54584
55801
|
env: void 0
|
|
@@ -54655,6 +55872,7 @@ var Function_ = class _Function_ {
|
|
|
54655
55872
|
* and/or {@link Function_#withBatching withBatching}. */
|
|
54656
55873
|
async instance() {
|
|
54657
55874
|
let newFnId = this.functionId;
|
|
55875
|
+
let handleMetadata = this.#handleMetadata;
|
|
54658
55876
|
if (this.#options != null && Object.entries(this.#options).length > 0) {
|
|
54659
55877
|
const boundF = await bindParameters(
|
|
54660
55878
|
this.#client,
|
|
@@ -54662,12 +55880,13 @@ var Function_ = class _Function_ {
|
|
|
54662
55880
|
this.#options
|
|
54663
55881
|
);
|
|
54664
55882
|
newFnId = boundF.boundFunctionId;
|
|
55883
|
+
handleMetadata = boundF.handleMetadata;
|
|
54665
55884
|
}
|
|
54666
55885
|
return new _Function_(
|
|
54667
55886
|
this.#client,
|
|
54668
55887
|
newFnId,
|
|
54669
55888
|
this.methodName,
|
|
54670
|
-
|
|
55889
|
+
handleMetadata
|
|
54671
55890
|
);
|
|
54672
55891
|
}
|
|
54673
55892
|
// Execute a single input into a remote Function.
|
|
@@ -54818,7 +56037,8 @@ var ClsService = class {
|
|
|
54818
56037
|
const serviceFunction = await this.#client.cpClient.functionGet({
|
|
54819
56038
|
appName,
|
|
54820
56039
|
objectTag: serviceFunctionName,
|
|
54821
|
-
environmentName: this.#client.environmentName(params.environment)
|
|
56040
|
+
environmentName: this.#client.environmentName(params.environment),
|
|
56041
|
+
appVersion: params.version
|
|
54822
56042
|
});
|
|
54823
56043
|
const parameterInfo = serviceFunction.handleMetadata?.classParameterInfo;
|
|
54824
56044
|
const schema = parameterInfo?.schema ?? [];
|
|
@@ -54867,15 +56087,17 @@ var Cls = class _Cls {
|
|
|
54867
56087
|
/** Create a new instance of the Cls with parameters and/or runtime options. */
|
|
54868
56088
|
async instance(parameters = {}) {
|
|
54869
56089
|
let functionId;
|
|
56090
|
+
let methodHandleMetadata;
|
|
54870
56091
|
if (this.#schema.length === 0 && this.#serviceFunctionOptions === void 0) {
|
|
54871
56092
|
functionId = this.#serviceFunctionId;
|
|
56093
|
+
methodHandleMetadata = this.#serviceFunctionMetadata.methodHandleMetadata;
|
|
54872
56094
|
} else {
|
|
54873
|
-
|
|
56095
|
+
const bindResp = await this.#bindParameters(parameters);
|
|
56096
|
+
functionId = bindResp.boundFunctionId;
|
|
56097
|
+
methodHandleMetadata = bindResp.handleMetadata?.methodHandleMetadata ?? {};
|
|
54874
56098
|
}
|
|
54875
56099
|
const methods = /* @__PURE__ */ new Map();
|
|
54876
|
-
for (const [name, methodMetadata] of Object.entries(
|
|
54877
|
-
this.#serviceFunctionMetadata.methodHandleMetadata
|
|
54878
|
-
)) {
|
|
56100
|
+
for (const [name, methodMetadata] of Object.entries(methodHandleMetadata)) {
|
|
54879
56101
|
methods.set(
|
|
54880
56102
|
name,
|
|
54881
56103
|
new Function_(this.#client, functionId, name, methodMetadata)
|
|
@@ -54921,14 +56143,13 @@ var Cls = class _Cls {
|
|
|
54921
56143
|
}
|
|
54922
56144
|
/** Bind parameters to the Cls function. */
|
|
54923
56145
|
async #bindParameters(parameters) {
|
|
54924
|
-
|
|
56146
|
+
return await bindParameters(
|
|
54925
56147
|
this.#client,
|
|
54926
56148
|
this.#serviceFunctionId,
|
|
54927
56149
|
this.#serviceFunctionOptions,
|
|
54928
56150
|
this.#schema,
|
|
54929
56151
|
parameters
|
|
54930
56152
|
);
|
|
54931
|
-
return bindResp.boundFunctionId;
|
|
54932
56153
|
}
|
|
54933
56154
|
};
|
|
54934
56155
|
var ClsInstance = class {
|
|
@@ -55595,11 +56816,27 @@ var Queue = class _Queue {
|
|
|
55595
56816
|
// src/image.ts
|
|
55596
56817
|
import { ClientError as ClientError7 } from "nice-grpc";
|
|
55597
56818
|
import { Status as Status7 } from "nice-grpc";
|
|
56819
|
+
|
|
56820
|
+
// src/name_utils.ts
|
|
56821
|
+
var OBJECT_NAME_CHARSET = /^[a-zA-Z0-9\-_.]+$/;
|
|
56822
|
+
var APP_ID_PATTERN = /^ap-[a-zA-Z0-9]{22}$/;
|
|
56823
|
+
function isValidObjectName(name) {
|
|
56824
|
+
return name.length <= 64 && OBJECT_NAME_CHARSET.test(name) && !APP_ID_PATTERN.test(name);
|
|
56825
|
+
}
|
|
56826
|
+
function checkObjectName(name, objectType) {
|
|
56827
|
+
if (!isValidObjectName(name)) {
|
|
56828
|
+
throw new InvalidError(
|
|
56829
|
+
`Invalid ${objectType} name: '${name}'.
|
|
56830
|
+
|
|
56831
|
+
Names may contain only alphanumeric characters, dashes, periods, and underscores, must be shorter than 64 characters, and cannot conflict with App ID strings.`
|
|
56832
|
+
);
|
|
56833
|
+
}
|
|
56834
|
+
}
|
|
56835
|
+
|
|
56836
|
+
// src/image.ts
|
|
55598
56837
|
var DEFAULT_IMAGE_TAG = "latest";
|
|
55599
56838
|
function validateImageName(name) {
|
|
55600
|
-
|
|
55601
|
-
throw new InvalidError("Image name must be non-empty.");
|
|
55602
|
-
}
|
|
56839
|
+
checkObjectName(name, "Image");
|
|
55603
56840
|
if (name.startsWith("im-")) {
|
|
55604
56841
|
throw new InvalidError(
|
|
55605
56842
|
"Image name cannot start with 'im-' (reserved for image IDs)."
|
|
@@ -55607,21 +56844,53 @@ function validateImageName(name) {
|
|
|
55607
56844
|
}
|
|
55608
56845
|
}
|
|
55609
56846
|
function validateImageTag(tag) {
|
|
55610
|
-
|
|
55611
|
-
throw new InvalidError("Image tag must be non-empty.");
|
|
55612
|
-
}
|
|
56847
|
+
checkObjectName(tag, "Image tag");
|
|
55613
56848
|
}
|
|
55614
56849
|
function parseNamedImageRef(value) {
|
|
55615
56850
|
const separatorIndex = value.indexOf(":");
|
|
56851
|
+
let imageName;
|
|
56852
|
+
let tag;
|
|
55616
56853
|
if (separatorIndex === -1) {
|
|
55617
|
-
|
|
55618
|
-
|
|
56854
|
+
imageName = value;
|
|
56855
|
+
tag = DEFAULT_IMAGE_TAG;
|
|
56856
|
+
} else {
|
|
56857
|
+
imageName = value.slice(0, separatorIndex);
|
|
56858
|
+
tag = value.slice(separatorIndex + 1);
|
|
56859
|
+
}
|
|
56860
|
+
let prefix = "";
|
|
56861
|
+
const lastSlashIndex = imageName.lastIndexOf("/");
|
|
56862
|
+
if (lastSlashIndex !== -1) {
|
|
56863
|
+
prefix = imageName.slice(0, lastSlashIndex);
|
|
56864
|
+
const after = imageName.slice(lastSlashIndex + 1);
|
|
56865
|
+
if (prefix === "") {
|
|
56866
|
+
throw new InvalidError(
|
|
56867
|
+
"Invalid Image name: '/' prefix must be non-empty."
|
|
56868
|
+
);
|
|
56869
|
+
}
|
|
56870
|
+
if (after === "") {
|
|
56871
|
+
throw new InvalidError(
|
|
56872
|
+
"Invalid Image name: name after '/' must be non-empty."
|
|
56873
|
+
);
|
|
56874
|
+
}
|
|
56875
|
+
imageName = after;
|
|
55619
56876
|
}
|
|
55620
|
-
|
|
55621
|
-
const tag = value.slice(separatorIndex + 1);
|
|
55622
|
-
validateImageName(name);
|
|
56877
|
+
validateImageName(imageName);
|
|
55623
56878
|
validateImageTag(tag);
|
|
55624
|
-
|
|
56879
|
+
const fullName = prefix ? `${prefix}/${imageName}` : imageName;
|
|
56880
|
+
return [prefix, `${fullName}:${tag}`];
|
|
56881
|
+
}
|
|
56882
|
+
function registryConfigBuilder(authType, secret) {
|
|
56883
|
+
return async (client) => {
|
|
56884
|
+
let secretId = "";
|
|
56885
|
+
if (secret) {
|
|
56886
|
+
await hydrateSecrets(client, [secret]);
|
|
56887
|
+
secretId = secret.secretId;
|
|
56888
|
+
}
|
|
56889
|
+
return ImageRegistryConfig.create({
|
|
56890
|
+
registryAuthType: authType,
|
|
56891
|
+
secretId
|
|
56892
|
+
});
|
|
56893
|
+
};
|
|
55625
56894
|
}
|
|
55626
56895
|
var ImageService = class {
|
|
55627
56896
|
#client;
|
|
@@ -55653,10 +56922,21 @@ var ImageService = class {
|
|
|
55653
56922
|
* @param params - Optional environment.
|
|
55654
56923
|
*/
|
|
55655
56924
|
async fromName(name, params = {}) {
|
|
55656
|
-
const tag = parseNamedImageRef(name);
|
|
56925
|
+
const [namespacePrefix, tag] = parseNamedImageRef(name);
|
|
56926
|
+
let environmentName;
|
|
56927
|
+
if (namespacePrefix) {
|
|
56928
|
+
if (params.environment) {
|
|
56929
|
+
throw new InvalidError(
|
|
56930
|
+
"Cannot specify 'environment' when the image name contains a '/'."
|
|
56931
|
+
);
|
|
56932
|
+
}
|
|
56933
|
+
environmentName = "";
|
|
56934
|
+
} else {
|
|
56935
|
+
environmentName = this.#client.environmentName(params.environment);
|
|
56936
|
+
}
|
|
55657
56937
|
try {
|
|
55658
56938
|
const resp = await this.#client.cpClient.imageGetByTag({
|
|
55659
|
-
environmentName
|
|
56939
|
+
environmentName,
|
|
55660
56940
|
tag
|
|
55661
56941
|
});
|
|
55662
56942
|
return new Image2(this.#client, resp.imageId, "");
|
|
@@ -55673,19 +56953,19 @@ var ImageService = class {
|
|
|
55673
56953
|
* @param secret - Optional. A Secret containing credentials for registry authentication.
|
|
55674
56954
|
*/
|
|
55675
56955
|
fromRegistry(tag, secret) {
|
|
55676
|
-
let
|
|
56956
|
+
let buildRegistryConfig;
|
|
55677
56957
|
if (secret) {
|
|
55678
56958
|
if (!(secret instanceof Secret)) {
|
|
55679
56959
|
throw new TypeError(
|
|
55680
56960
|
"secret must be a reference to an existing Secret, e.g. `await client.secrets.fromName('my_secret')`"
|
|
55681
56961
|
);
|
|
55682
56962
|
}
|
|
55683
|
-
|
|
55684
|
-
|
|
55685
|
-
|
|
55686
|
-
|
|
56963
|
+
buildRegistryConfig = registryConfigBuilder(
|
|
56964
|
+
4 /* REGISTRY_AUTH_TYPE_STATIC_CREDS */,
|
|
56965
|
+
secret
|
|
56966
|
+
);
|
|
55687
56967
|
}
|
|
55688
|
-
return new Image2(this.#client, "", tag,
|
|
56968
|
+
return new Image2(this.#client, "", tag, buildRegistryConfig);
|
|
55689
56969
|
}
|
|
55690
56970
|
/**
|
|
55691
56971
|
* Creates an {@link Image} from a raw registry tag, optionally using a {@link Secret} for authentication.
|
|
@@ -55694,19 +56974,16 @@ var ImageService = class {
|
|
|
55694
56974
|
* @param secret - A Secret containing credentials for registry authentication.
|
|
55695
56975
|
*/
|
|
55696
56976
|
fromAwsEcr(tag, secret) {
|
|
55697
|
-
|
|
55698
|
-
|
|
55699
|
-
|
|
55700
|
-
|
|
55701
|
-
"secret must be a reference to an existing Secret, e.g. `await client.secrets.fromName('my_secret')`"
|
|
55702
|
-
);
|
|
55703
|
-
}
|
|
55704
|
-
imageRegistryConfig = {
|
|
55705
|
-
registryAuthType: 1 /* REGISTRY_AUTH_TYPE_AWS */,
|
|
55706
|
-
secretId: secret.secretId
|
|
55707
|
-
};
|
|
56977
|
+
if (!(secret instanceof Secret)) {
|
|
56978
|
+
throw new TypeError(
|
|
56979
|
+
"secret must be a reference to an existing Secret, e.g. `await client.secrets.fromName('my_secret')`"
|
|
56980
|
+
);
|
|
55708
56981
|
}
|
|
55709
|
-
|
|
56982
|
+
const buildRegistryConfig = registryConfigBuilder(
|
|
56983
|
+
1 /* REGISTRY_AUTH_TYPE_AWS */,
|
|
56984
|
+
secret
|
|
56985
|
+
);
|
|
56986
|
+
return new Image2(this.#client, "", tag, buildRegistryConfig);
|
|
55710
56987
|
}
|
|
55711
56988
|
/**
|
|
55712
56989
|
* Creates an {@link Image} from a raw registry tag, optionally using a {@link Secret} for authentication.
|
|
@@ -55715,19 +56992,16 @@ var ImageService = class {
|
|
|
55715
56992
|
* @param secret - A Secret containing credentials for registry authentication.
|
|
55716
56993
|
*/
|
|
55717
56994
|
fromGcpArtifactRegistry(tag, secret) {
|
|
55718
|
-
|
|
55719
|
-
|
|
55720
|
-
|
|
55721
|
-
|
|
55722
|
-
"secret must be a reference to an existing Secret, e.g. `await client.secrets.fromName('my_secret')`"
|
|
55723
|
-
);
|
|
55724
|
-
}
|
|
55725
|
-
imageRegistryConfig = {
|
|
55726
|
-
registryAuthType: 2 /* REGISTRY_AUTH_TYPE_GCP */,
|
|
55727
|
-
secretId: secret.secretId
|
|
55728
|
-
};
|
|
56995
|
+
if (!(secret instanceof Secret)) {
|
|
56996
|
+
throw new TypeError(
|
|
56997
|
+
"secret must be a reference to an existing Secret, e.g. `await client.secrets.fromName('my_secret')`"
|
|
56998
|
+
);
|
|
55729
56999
|
}
|
|
55730
|
-
|
|
57000
|
+
const buildRegistryConfig = registryConfigBuilder(
|
|
57001
|
+
2 /* REGISTRY_AUTH_TYPE_GCP */,
|
|
57002
|
+
secret
|
|
57003
|
+
);
|
|
57004
|
+
return new Image2(this.#client, "", tag, buildRegistryConfig);
|
|
55731
57005
|
}
|
|
55732
57006
|
/**
|
|
55733
57007
|
* Delete an {@link Image} by ID.
|
|
@@ -55757,15 +57031,18 @@ var Image2 = class _Image {
|
|
|
55757
57031
|
#tag;
|
|
55758
57032
|
// Image ID of the parent image layer to use as `FROM base`.
|
|
55759
57033
|
#baseImageId;
|
|
55760
|
-
|
|
57034
|
+
// When set, hydrates the registry-auth Secret (if any) and returns the
|
|
57035
|
+
// ImageRegistryConfig for the base build layer. Runs at build time, since the
|
|
57036
|
+
// Secret may be lazy. Undefined when not pulling from a private registry.
|
|
57037
|
+
#buildRegistryConfig;
|
|
55761
57038
|
#layers;
|
|
55762
57039
|
/** @ignore */
|
|
55763
|
-
constructor(client, imageId, tag,
|
|
57040
|
+
constructor(client, imageId, tag, buildRegistryConfig, layers, baseImageId) {
|
|
55764
57041
|
this.#client = client;
|
|
55765
57042
|
this.#imageId = imageId;
|
|
55766
57043
|
this.#tag = tag;
|
|
55767
57044
|
this.#baseImageId = baseImageId || "";
|
|
55768
|
-
this.#
|
|
57045
|
+
this.#buildRegistryConfig = buildRegistryConfig;
|
|
55769
57046
|
this.#layers = layers || [
|
|
55770
57047
|
{
|
|
55771
57048
|
commands: [],
|
|
@@ -55817,7 +57094,7 @@ var Image2 = class _Image {
|
|
|
55817
57094
|
this.#client,
|
|
55818
57095
|
"",
|
|
55819
57096
|
this.#tag,
|
|
55820
|
-
this.#
|
|
57097
|
+
this.#buildRegistryConfig,
|
|
55821
57098
|
[...layers, newLayer],
|
|
55822
57099
|
baseImageId
|
|
55823
57100
|
);
|
|
@@ -55843,6 +57120,7 @@ var Image2 = class _Image {
|
|
|
55843
57120
|
layer.env,
|
|
55844
57121
|
layer.secrets
|
|
55845
57122
|
);
|
|
57123
|
+
await hydrateSecrets(this.#client, mergedSecrets);
|
|
55846
57124
|
const secretIds = mergedSecrets.map((secret) => secret.secretId);
|
|
55847
57125
|
const gpuConfig = layer.gpuConfig;
|
|
55848
57126
|
let dockerfileCommands;
|
|
@@ -55857,7 +57135,7 @@ var Image2 = class _Image {
|
|
|
55857
57135
|
dockerfileCommands = ["FROM base", ...layer.commands];
|
|
55858
57136
|
baseImages = [{ dockerTag: "base", imageId: baseImageId }];
|
|
55859
57137
|
}
|
|
55860
|
-
const imageRegistryConfig = i === 0 && !baseImageId ? this.#
|
|
57138
|
+
const imageRegistryConfig = i === 0 && !baseImageId && this.#buildRegistryConfig ? await this.#buildRegistryConfig(this.#client) : void 0;
|
|
55861
57139
|
const resp = await this.#client.cpClient.imageGetOrCreate({
|
|
55862
57140
|
appId: app.appId,
|
|
55863
57141
|
image: Image.create({
|
|
@@ -55924,17 +57202,27 @@ ${result.exception}`
|
|
|
55924
57202
|
* @param params - Optional environment.
|
|
55925
57203
|
*/
|
|
55926
57204
|
async publish(name, params = {}) {
|
|
55927
|
-
const tag = parseNamedImageRef(name);
|
|
57205
|
+
const [namespacePrefix, tag] = parseNamedImageRef(name);
|
|
55928
57206
|
if (this.#imageId === "") {
|
|
55929
57207
|
throw new InvalidError(
|
|
55930
57208
|
"Cannot publish an image that has not been built yet. Call build() first."
|
|
55931
57209
|
);
|
|
55932
57210
|
}
|
|
55933
|
-
|
|
57211
|
+
let environmentName;
|
|
57212
|
+
if (namespacePrefix) {
|
|
57213
|
+
if (params.environment) {
|
|
57214
|
+
throw new InvalidError(
|
|
57215
|
+
"Cannot specify 'environment' when the image name contains a '/'."
|
|
57216
|
+
);
|
|
57217
|
+
}
|
|
57218
|
+
environmentName = "";
|
|
57219
|
+
} else {
|
|
57220
|
+
environmentName = this.#client.environmentName(params.environment);
|
|
57221
|
+
}
|
|
55934
57222
|
await this.#client.cpClient.imagePublish({
|
|
55935
57223
|
imageId: this.#imageId,
|
|
55936
57224
|
environmentName,
|
|
55937
|
-
|
|
57225
|
+
allowPublic: false,
|
|
55938
57226
|
tag
|
|
55939
57227
|
});
|
|
55940
57228
|
}
|
|
@@ -58142,8 +59430,45 @@ var TaskExecStdinWriteResponse = {
|
|
|
58142
59430
|
return message;
|
|
58143
59431
|
}
|
|
58144
59432
|
};
|
|
59433
|
+
function createBaseTaskExecStdinWriteStreamEnd() {
|
|
59434
|
+
return {};
|
|
59435
|
+
}
|
|
59436
|
+
var TaskExecStdinWriteStreamEnd = {
|
|
59437
|
+
encode(_, writer = new BinaryWriter()) {
|
|
59438
|
+
return writer;
|
|
59439
|
+
},
|
|
59440
|
+
decode(input, length) {
|
|
59441
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
59442
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
59443
|
+
const message = createBaseTaskExecStdinWriteStreamEnd();
|
|
59444
|
+
while (reader.pos < end) {
|
|
59445
|
+
const tag = reader.uint32();
|
|
59446
|
+
switch (tag >>> 3) {
|
|
59447
|
+
}
|
|
59448
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
59449
|
+
break;
|
|
59450
|
+
}
|
|
59451
|
+
reader.skip(tag & 7);
|
|
59452
|
+
}
|
|
59453
|
+
return message;
|
|
59454
|
+
},
|
|
59455
|
+
fromJSON(_) {
|
|
59456
|
+
return {};
|
|
59457
|
+
},
|
|
59458
|
+
toJSON(_) {
|
|
59459
|
+
const obj = {};
|
|
59460
|
+
return obj;
|
|
59461
|
+
},
|
|
59462
|
+
create(base) {
|
|
59463
|
+
return TaskExecStdinWriteStreamEnd.fromPartial(base ?? {});
|
|
59464
|
+
},
|
|
59465
|
+
fromPartial(_) {
|
|
59466
|
+
const message = createBaseTaskExecStdinWriteStreamEnd();
|
|
59467
|
+
return message;
|
|
59468
|
+
}
|
|
59469
|
+
};
|
|
58145
59470
|
function createBaseTaskExecStdinWriteStreamRequest() {
|
|
58146
|
-
return { start: void 0, data: void 0 };
|
|
59471
|
+
return { start: void 0, data: void 0, end: void 0 };
|
|
58147
59472
|
}
|
|
58148
59473
|
var TaskExecStdinWriteStreamRequest = {
|
|
58149
59474
|
encode(message, writer = new BinaryWriter()) {
|
|
@@ -58153,6 +59478,9 @@ var TaskExecStdinWriteStreamRequest = {
|
|
|
58153
59478
|
if (message.data !== void 0) {
|
|
58154
59479
|
writer.uint32(18).bytes(message.data);
|
|
58155
59480
|
}
|
|
59481
|
+
if (message.end !== void 0) {
|
|
59482
|
+
TaskExecStdinWriteStreamEnd.encode(message.end, writer.uint32(26).fork()).join();
|
|
59483
|
+
}
|
|
58156
59484
|
return writer;
|
|
58157
59485
|
},
|
|
58158
59486
|
decode(input, length) {
|
|
@@ -58176,6 +59504,13 @@ var TaskExecStdinWriteStreamRequest = {
|
|
|
58176
59504
|
message.data = reader.bytes();
|
|
58177
59505
|
continue;
|
|
58178
59506
|
}
|
|
59507
|
+
case 3: {
|
|
59508
|
+
if (tag !== 26) {
|
|
59509
|
+
break;
|
|
59510
|
+
}
|
|
59511
|
+
message.end = TaskExecStdinWriteStreamEnd.decode(reader, reader.uint32());
|
|
59512
|
+
continue;
|
|
59513
|
+
}
|
|
58179
59514
|
}
|
|
58180
59515
|
if ((tag & 7) === 4 || tag === 0) {
|
|
58181
59516
|
break;
|
|
@@ -58187,7 +59522,8 @@ var TaskExecStdinWriteStreamRequest = {
|
|
|
58187
59522
|
fromJSON(object) {
|
|
58188
59523
|
return {
|
|
58189
59524
|
start: isSet6(object.start) ? TaskExecStdinWriteStreamStart.fromJSON(object.start) : void 0,
|
|
58190
|
-
data: isSet6(object.data) ? bytesFromBase643(object.data) : void 0
|
|
59525
|
+
data: isSet6(object.data) ? bytesFromBase643(object.data) : void 0,
|
|
59526
|
+
end: isSet6(object.end) ? TaskExecStdinWriteStreamEnd.fromJSON(object.end) : void 0
|
|
58191
59527
|
};
|
|
58192
59528
|
},
|
|
58193
59529
|
toJSON(message) {
|
|
@@ -58198,6 +59534,9 @@ var TaskExecStdinWriteStreamRequest = {
|
|
|
58198
59534
|
if (message.data !== void 0) {
|
|
58199
59535
|
obj.data = base64FromBytes3(message.data);
|
|
58200
59536
|
}
|
|
59537
|
+
if (message.end !== void 0) {
|
|
59538
|
+
obj.end = TaskExecStdinWriteStreamEnd.toJSON(message.end);
|
|
59539
|
+
}
|
|
58201
59540
|
return obj;
|
|
58202
59541
|
},
|
|
58203
59542
|
create(base) {
|
|
@@ -58207,6 +59546,7 @@ var TaskExecStdinWriteStreamRequest = {
|
|
|
58207
59546
|
const message = createBaseTaskExecStdinWriteStreamRequest();
|
|
58208
59547
|
message.start = object.start !== void 0 && object.start !== null ? TaskExecStdinWriteStreamStart.fromPartial(object.start) : void 0;
|
|
58209
59548
|
message.data = object.data ?? void 0;
|
|
59549
|
+
message.end = object.end !== void 0 && object.end !== null ? TaskExecStdinWriteStreamEnd.fromPartial(object.end) : void 0;
|
|
58210
59550
|
return message;
|
|
58211
59551
|
}
|
|
58212
59552
|
};
|
|
@@ -59858,7 +61198,7 @@ var AuthTokenManager = class {
|
|
|
59858
61198
|
};
|
|
59859
61199
|
|
|
59860
61200
|
// src/version.ts
|
|
59861
|
-
var SDK_VERSION = "0.
|
|
61201
|
+
var SDK_VERSION = "0.9.0";
|
|
59862
61202
|
function getSDKVersion() {
|
|
59863
61203
|
return SDK_VERSION;
|
|
59864
61204
|
}
|
|
@@ -60759,9 +62099,36 @@ var TaskCommandRouterClientImpl = class _TaskCommandRouterClientImpl {
|
|
|
60759
62099
|
async setNetworkAccess(request) {
|
|
60760
62100
|
await this.callUnary(() => this.stub.taskSetNetworkAccess(request));
|
|
60761
62101
|
}
|
|
60762
|
-
/**
|
|
60763
|
-
|
|
60764
|
-
|
|
62102
|
+
/**
|
|
62103
|
+
* Reload all Volumes mounted in the task to reflect their latest committed state.
|
|
62104
|
+
*
|
|
62105
|
+
* `timeoutMs` is the client-side deadline. If the reload does not complete
|
|
62106
|
+
* within this window, the call is cancelled and a TimeoutError is thrown.
|
|
62107
|
+
*/
|
|
62108
|
+
async reloadVolumes(request, options) {
|
|
62109
|
+
const overallDeadlineMs = options?.timeoutMs !== void 0 ? Date.now() + options.timeoutMs : null;
|
|
62110
|
+
try {
|
|
62111
|
+
await callWithRetriesOnTransientErrors(
|
|
62112
|
+
() => this.callWithAuthRetry(() => {
|
|
62113
|
+
const remainingMs = overallDeadlineMs !== null ? Math.max(1, overallDeadlineMs - Date.now()) : options?.timeoutMs;
|
|
62114
|
+
return this.stub.taskReloadVolumes(request, {
|
|
62115
|
+
...options,
|
|
62116
|
+
timeoutMs: remainingMs
|
|
62117
|
+
});
|
|
62118
|
+
}),
|
|
62119
|
+
10,
|
|
62120
|
+
2,
|
|
62121
|
+
10,
|
|
62122
|
+
overallDeadlineMs,
|
|
62123
|
+
() => this.closed,
|
|
62124
|
+
[Status10.DEADLINE_EXCEEDED, Status10.CANCELLED]
|
|
62125
|
+
);
|
|
62126
|
+
} catch (err) {
|
|
62127
|
+
if (overallDeadlineMs !== null && Date.now() >= overallDeadlineMs) {
|
|
62128
|
+
throw new TimeoutError("Timeout expired");
|
|
62129
|
+
}
|
|
62130
|
+
throw err;
|
|
62131
|
+
}
|
|
60765
62132
|
}
|
|
60766
62133
|
async sandboxWaitUntilReady(taskId, timeoutMs) {
|
|
60767
62134
|
const deadlineMs = Date.now() + timeoutMs;
|
|
@@ -61128,6 +62495,44 @@ function raiseStatError(returnCode, stderr, remotePath) {
|
|
|
61128
62495
|
function makeStatCommand(remotePath) {
|
|
61129
62496
|
return JSON.stringify({ Stat: { path: remotePath } });
|
|
61130
62497
|
}
|
|
62498
|
+
function raiseWatchError(returnCode, stderr, remotePath) {
|
|
62499
|
+
const payload = tryParseErrorPayload(stderr);
|
|
62500
|
+
if (payload) {
|
|
62501
|
+
logger.debug(
|
|
62502
|
+
`sandbox-fs-tools watch error: path=${remotePath}, error_kind=${payload.error_kind}, message=${payload.message}, detail=${payload.detail}`
|
|
62503
|
+
);
|
|
62504
|
+
if (payload.error_kind === "NotFound")
|
|
62505
|
+
throw new SandboxFilesystemNotFoundError(
|
|
62506
|
+
`${payload.message}: ${remotePath}`
|
|
62507
|
+
);
|
|
62508
|
+
if (payload.error_kind === "PermissionDenied")
|
|
62509
|
+
throw new SandboxFilesystemPermissionError(
|
|
62510
|
+
`${payload.message}: ${remotePath}`
|
|
62511
|
+
);
|
|
62512
|
+
if (payload.error_kind === "NotSupported")
|
|
62513
|
+
throw new InvalidError(
|
|
62514
|
+
`${payload.message}: ${remotePath} - this operation is not supported for CloudBucketMounts`
|
|
62515
|
+
);
|
|
62516
|
+
throw new SandboxFilesystemError(payload.message);
|
|
62517
|
+
}
|
|
62518
|
+
const text = stderrToText(stderr);
|
|
62519
|
+
if (text) logger.debug(`Unstructured modal-sandbox-fs-tools stderr: ${text}`);
|
|
62520
|
+
throw new SandboxFilesystemError(
|
|
62521
|
+
`Operation on '${remotePath}' failed with exit code ${returnCode}`
|
|
62522
|
+
);
|
|
62523
|
+
}
|
|
62524
|
+
function makeWatchCommand(remotePath, opts) {
|
|
62525
|
+
return JSON.stringify({
|
|
62526
|
+
Watch: {
|
|
62527
|
+
path: remotePath,
|
|
62528
|
+
recursive: opts.recursive,
|
|
62529
|
+
filter: opts.filter,
|
|
62530
|
+
// The fs-tools wire protocol takes whole seconds; convert from the SDK's
|
|
62531
|
+
// millisecond convention, truncating any sub-second remainder.
|
|
62532
|
+
timeout_secs: opts.timeoutMs !== null ? Math.trunc(opts.timeoutMs / 1e3) : null
|
|
62533
|
+
}
|
|
62534
|
+
});
|
|
62535
|
+
}
|
|
61131
62536
|
function raiseWriteFileError(returnCode, stderr, remotePath) {
|
|
61132
62537
|
const payload = tryParseErrorPayload(stderr);
|
|
61133
62538
|
if (payload) {
|
|
@@ -61221,6 +62626,36 @@ function parseFileEntry(raw) {
|
|
|
61221
62626
|
symlinkTarget: raw.symlink_target ?? null
|
|
61222
62627
|
};
|
|
61223
62628
|
}
|
|
62629
|
+
var RUST_RENAME_VARIANTS = ["Rename", "RenameFrom", "RenameTo"];
|
|
62630
|
+
var VALID_EVENT_TYPES = /* @__PURE__ */ new Set([
|
|
62631
|
+
"Access",
|
|
62632
|
+
"Create",
|
|
62633
|
+
"Modify",
|
|
62634
|
+
"Remove",
|
|
62635
|
+
"Unknown"
|
|
62636
|
+
]);
|
|
62637
|
+
function expandWatchFilter(filter) {
|
|
62638
|
+
const result = [];
|
|
62639
|
+
for (const eventType of filter) {
|
|
62640
|
+
result.push(eventType);
|
|
62641
|
+
if (eventType === "Modify") {
|
|
62642
|
+
result.push(...RUST_RENAME_VARIANTS);
|
|
62643
|
+
}
|
|
62644
|
+
}
|
|
62645
|
+
return result;
|
|
62646
|
+
}
|
|
62647
|
+
async function* readLines(stream) {
|
|
62648
|
+
const decoder2 = new TextDecoder();
|
|
62649
|
+
let buffer = "";
|
|
62650
|
+
for await (const chunk of stream) {
|
|
62651
|
+
buffer += typeof chunk === "string" ? chunk : decoder2.decode(chunk, { stream: true });
|
|
62652
|
+
const lines = buffer.split("\n");
|
|
62653
|
+
buffer = lines.pop() ?? "";
|
|
62654
|
+
for (const line of lines) yield line;
|
|
62655
|
+
}
|
|
62656
|
+
const tail = decoder2.decode(void 0, { stream: false });
|
|
62657
|
+
if (buffer + tail) yield buffer + tail;
|
|
62658
|
+
}
|
|
61224
62659
|
var WRITE_CHUNK_SIZE = 4 * 1024 * 1024;
|
|
61225
62660
|
function toUint8Array(data) {
|
|
61226
62661
|
if (data instanceof ArrayBuffer) return new Uint8Array(data);
|
|
@@ -61498,6 +62933,94 @@ var SandboxFilesystem = class {
|
|
|
61498
62933
|
});
|
|
61499
62934
|
return parseFileEntry(JSON.parse(stdout));
|
|
61500
62935
|
}
|
|
62936
|
+
/**
|
|
62937
|
+
* Watch a path in the Sandbox for filesystem changes.
|
|
62938
|
+
*
|
|
62939
|
+
* `remotePath` must be an absolute path in the Sandbox. If it points to a
|
|
62940
|
+
* file, events for that file are reported. If it points to a directory,
|
|
62941
|
+
* events for entries directly inside it are reported. Set `recursive: true`
|
|
62942
|
+
* to also receive events for all nested subdirectories. If `remotePath` is
|
|
62943
|
+
* a symlink, it is followed and events reference paths under the resolved
|
|
62944
|
+
* target.
|
|
62945
|
+
*
|
|
62946
|
+
* Yields {@link FileWatchEvent} objects as changes occur, until either the
|
|
62947
|
+
* timeout elapses, the iterator is closed, or the Sandbox is terminated.
|
|
62948
|
+
*
|
|
62949
|
+
* Optionally restrict the kinds of events emitted to those included in
|
|
62950
|
+
* `filter`. An undefined `filter` permits all types; passing an empty array
|
|
62951
|
+
* suppresses all events.
|
|
62952
|
+
*
|
|
62953
|
+
* `timeoutMs` is truncated to whole seconds. Omit it to watch indefinitely.
|
|
62954
|
+
* When the timeout elapses, the iterator stops without raising an exception.
|
|
62955
|
+
*
|
|
62956
|
+
* @throws {SandboxFilesystemNotFoundError} `remotePath` does not exist.
|
|
62957
|
+
* @throws {SandboxFilesystemPermissionError} watch access is denied.
|
|
62958
|
+
* @throws {InvalidError} the filesystem does not support watching.
|
|
62959
|
+
* @throws {SandboxFilesystemError} the command fails for any other reason.
|
|
62960
|
+
*/
|
|
62961
|
+
async *watch(remotePath, params = {}) {
|
|
62962
|
+
validateAbsoluteRemotePath(remotePath, "watch");
|
|
62963
|
+
checkForRenamedParams(params, { timeout: "timeoutMs" });
|
|
62964
|
+
const { filter, recursive = false, timeoutMs } = params;
|
|
62965
|
+
const process2 = await translateExecErrors(
|
|
62966
|
+
"watch",
|
|
62967
|
+
remotePath,
|
|
62968
|
+
() => this.exec(
|
|
62969
|
+
[
|
|
62970
|
+
SANDBOX_FS_TOOLS_PATH,
|
|
62971
|
+
makeWatchCommand(remotePath, {
|
|
62972
|
+
recursive,
|
|
62973
|
+
filter: filter !== void 0 ? expandWatchFilter(filter) : null,
|
|
62974
|
+
timeoutMs: timeoutMs ?? null
|
|
62975
|
+
})
|
|
62976
|
+
],
|
|
62977
|
+
{ mode: "text" }
|
|
62978
|
+
)
|
|
62979
|
+
);
|
|
62980
|
+
let streamEnded = false;
|
|
62981
|
+
try {
|
|
62982
|
+
for await (const line of readLines(process2.stdout)) {
|
|
62983
|
+
const trimmed = line.trim();
|
|
62984
|
+
if (!trimmed) continue;
|
|
62985
|
+
let data;
|
|
62986
|
+
try {
|
|
62987
|
+
data = JSON.parse(trimmed);
|
|
62988
|
+
} catch {
|
|
62989
|
+
continue;
|
|
62990
|
+
}
|
|
62991
|
+
const paths = data.paths ?? [];
|
|
62992
|
+
if (paths.length === 0) continue;
|
|
62993
|
+
let rawType = data.event_type;
|
|
62994
|
+
if (typeof rawType !== "string") continue;
|
|
62995
|
+
if (RUST_RENAME_VARIANTS.includes(rawType)) {
|
|
62996
|
+
rawType = "Modify";
|
|
62997
|
+
}
|
|
62998
|
+
if (!VALID_EVENT_TYPES.has(rawType)) continue;
|
|
62999
|
+
yield { eventType: rawType, paths };
|
|
63000
|
+
}
|
|
63001
|
+
streamEnded = true;
|
|
63002
|
+
} catch (err) {
|
|
63003
|
+
await translateExecErrors("watch", remotePath, () => {
|
|
63004
|
+
throw err;
|
|
63005
|
+
});
|
|
63006
|
+
throw err;
|
|
63007
|
+
} finally {
|
|
63008
|
+
await process2.closeStdin().catch(() => {
|
|
63009
|
+
});
|
|
63010
|
+
if (streamEnded) {
|
|
63011
|
+
await translateExecErrors("watch", remotePath, async () => {
|
|
63012
|
+
const returnCode = await process2.wait();
|
|
63013
|
+
if (returnCode !== 0) {
|
|
63014
|
+
const stderr = await process2.stderr.readBytes();
|
|
63015
|
+
raiseWatchError(returnCode, stderr, remotePath);
|
|
63016
|
+
}
|
|
63017
|
+
});
|
|
63018
|
+
} else {
|
|
63019
|
+
await process2.wait().catch(() => {
|
|
63020
|
+
});
|
|
63021
|
+
}
|
|
63022
|
+
}
|
|
63023
|
+
}
|
|
61501
63024
|
/**
|
|
61502
63025
|
* Write binary content to a file in the Sandbox.
|
|
61503
63026
|
*
|
|
@@ -61608,7 +63131,13 @@ var SidecarService = class {
|
|
|
61608
63131
|
const command = params?.command ?? [];
|
|
61609
63132
|
validateExecArgs(command);
|
|
61610
63133
|
validateWorkdir(params?.workdir);
|
|
61611
|
-
|
|
63134
|
+
validateEnvVarKeys(params?.env ?? {});
|
|
63135
|
+
const [envDict, resolvableSecrets] = splitEnvDictAndResolvableSecrets(
|
|
63136
|
+
params?.secrets ?? []
|
|
63137
|
+
);
|
|
63138
|
+
Object.assign(envDict, params?.env ?? {});
|
|
63139
|
+
await hydrateSecrets(this.#access.client, resolvableSecrets);
|
|
63140
|
+
const secretIds = collectSecretIds(resolvableSecrets);
|
|
61612
63141
|
const [taskId, client] = await this.#access.commandRouter();
|
|
61613
63142
|
let resp;
|
|
61614
63143
|
try {
|
|
@@ -61618,7 +63147,7 @@ var SidecarService = class {
|
|
|
61618
63147
|
containerName: name,
|
|
61619
63148
|
imageId: image.imageId,
|
|
61620
63149
|
args: command,
|
|
61621
|
-
env:
|
|
63150
|
+
env: envDict,
|
|
61622
63151
|
workdir: params?.workdir ?? "",
|
|
61623
63152
|
secretIds
|
|
61624
63153
|
})
|
|
@@ -62230,9 +63759,11 @@ async function buildSandboxCreateV2RequestProto(appId, imageId, params = {}) {
|
|
|
62230
63759
|
throw new Error("custom domains are not supported by experimentalCreate");
|
|
62231
63760
|
}
|
|
62232
63761
|
const req = await buildSandboxCreateRequestProto(appId, imageId, params);
|
|
63762
|
+
const ephemeralSecrets = params.env && Object.keys(params.env).length > 0 ? StringMap.create({ contents: params.env }) : void 0;
|
|
62233
63763
|
return SandboxCreateV2Request.create({
|
|
62234
63764
|
appId: req.appId,
|
|
62235
|
-
definition: req.definition
|
|
63765
|
+
definition: req.definition,
|
|
63766
|
+
ephemeralSecrets
|
|
62236
63767
|
});
|
|
62237
63768
|
}
|
|
62238
63769
|
var SandboxService = class {
|
|
@@ -62250,6 +63781,11 @@ var SandboxService = class {
|
|
|
62250
63781
|
params.env,
|
|
62251
63782
|
params.secrets
|
|
62252
63783
|
);
|
|
63784
|
+
await hydrateSandboxSecrets(
|
|
63785
|
+
this.#client,
|
|
63786
|
+
mergedSecrets,
|
|
63787
|
+
params.cloudBucketMounts
|
|
63788
|
+
);
|
|
62253
63789
|
const mergedParams = {
|
|
62254
63790
|
...params,
|
|
62255
63791
|
secrets: mergedSecrets,
|
|
@@ -62289,24 +63825,28 @@ var SandboxService = class {
|
|
|
62289
63825
|
* supported.
|
|
62290
63826
|
*
|
|
62291
63827
|
* V2 sandboxes created with this method are not currently returned by
|
|
62292
|
-
* {@link SandboxService#list client.sandboxes.list()}
|
|
62293
|
-
*
|
|
62294
|
-
* {@link
|
|
62295
|
-
*
|
|
62296
|
-
* to reattach.
|
|
63828
|
+
* {@link SandboxService#list client.sandboxes.list()}. A named Sandbox can be
|
|
63829
|
+
* looked up with
|
|
63830
|
+
* {@link SandboxService#experimentalFromName client.sandboxes.experimentalFromName()};
|
|
63831
|
+
* otherwise store {@link Sandbox#sandboxId sandbox.sandboxId} and use
|
|
63832
|
+
* {@link SandboxService#fromId client.sandboxes.fromId()} to reattach.
|
|
62297
63833
|
*/
|
|
62298
63834
|
async experimentalCreate(app, image, params = {}) {
|
|
62299
63835
|
await image.build(app);
|
|
62300
|
-
|
|
63836
|
+
validateEnvVarKeys(params.env ?? {});
|
|
63837
|
+
const [envDict, resolvableSecrets] = splitEnvDictAndResolvableSecrets(
|
|
63838
|
+
params.secrets ?? []
|
|
63839
|
+
);
|
|
63840
|
+
Object.assign(envDict, params.env ?? {});
|
|
63841
|
+
await hydrateSandboxSecrets(
|
|
62301
63842
|
this.#client,
|
|
62302
|
-
|
|
62303
|
-
params.
|
|
63843
|
+
resolvableSecrets,
|
|
63844
|
+
params.cloudBucketMounts
|
|
62304
63845
|
);
|
|
62305
63846
|
const mergedParams = {
|
|
62306
63847
|
...params,
|
|
62307
|
-
secrets:
|
|
62308
|
-
env:
|
|
62309
|
-
// setting env to undefined just to clarify it's not needed anymore
|
|
63848
|
+
secrets: resolvableSecrets,
|
|
63849
|
+
env: envDict
|
|
62310
63850
|
};
|
|
62311
63851
|
const createReq = await buildSandboxCreateV2RequestProto(
|
|
62312
63852
|
app.appId,
|
|
@@ -62374,6 +63914,35 @@ var SandboxService = class {
|
|
|
62374
63914
|
throw err;
|
|
62375
63915
|
}
|
|
62376
63916
|
}
|
|
63917
|
+
/**
|
|
63918
|
+
* Get a running V2 {@link Sandbox} by name from a deployed {@link App}.
|
|
63919
|
+
*
|
|
63920
|
+
* This looks up V2 Sandboxes, i.e. Sandboxes created via
|
|
63921
|
+
* {@link SandboxService#experimentalCreate client.sandboxes.experimentalCreate()}.
|
|
63922
|
+
*
|
|
63923
|
+
* EXPERIMENTAL: the API is subject to change.
|
|
63924
|
+
*
|
|
63925
|
+
* @param appName - Name of the deployed App
|
|
63926
|
+
* @param name - Name of the Sandbox
|
|
63927
|
+
* @param params - Optional parameters for getting the Sandbox
|
|
63928
|
+
* @returns Promise that resolves to a Sandbox
|
|
63929
|
+
*/
|
|
63930
|
+
async experimentalFromName(appName, name, params) {
|
|
63931
|
+
try {
|
|
63932
|
+
const resp = await this.#client.cpClient.sandboxGetFromNameV2({
|
|
63933
|
+
sandboxName: name,
|
|
63934
|
+
appName,
|
|
63935
|
+
environmentName: this.#client.environmentName(params?.environment)
|
|
63936
|
+
});
|
|
63937
|
+
return new Sandbox2(this.#client, resp.sandboxId, { isV2: true });
|
|
63938
|
+
} catch (err) {
|
|
63939
|
+
if (err instanceof ClientError14 && err.code === Status14.NOT_FOUND)
|
|
63940
|
+
throw new NotFoundError(
|
|
63941
|
+
`Sandbox with name '${name}' not found in App '${appName}'`
|
|
63942
|
+
);
|
|
63943
|
+
throw err;
|
|
63944
|
+
}
|
|
63945
|
+
}
|
|
62377
63946
|
/**
|
|
62378
63947
|
* List all {@link Sandbox}es for the current Environment or App ID (if specified).
|
|
62379
63948
|
* If tags are specified, only Sandboxes that have at least those tags are returned.
|
|
@@ -62415,8 +63984,8 @@ var SandboxService = class {
|
|
|
62415
63984
|
* This lists V2 Sandboxes, i.e. Sandboxes created via
|
|
62416
63985
|
* {@link SandboxService#experimentalCreate client.sandboxes.experimentalCreate()}.
|
|
62417
63986
|
* Such Sandboxes are not returned by
|
|
62418
|
-
* {@link SandboxService#list client.sandboxes.list()}.
|
|
62419
|
-
*
|
|
63987
|
+
* {@link SandboxService#list client.sandboxes.list()}. If tags are specified,
|
|
63988
|
+
* only Sandboxes that have at least those tags are returned.
|
|
62420
63989
|
*
|
|
62421
63990
|
* Yields {@link Sandbox} objects that are currently running in the App.
|
|
62422
63991
|
*
|
|
@@ -62428,12 +63997,17 @@ var SandboxService = class {
|
|
|
62428
63997
|
'experimentalList requires an `appId`:\n\nconst app = await modal.apps.fromName("my-app");\nmodal.sandboxes.experimentalList({ appId: app.appId });'
|
|
62429
63998
|
);
|
|
62430
63999
|
}
|
|
64000
|
+
const tagsList = params.tags ? Object.entries(params.tags).map(([tagName, tagValue]) => ({
|
|
64001
|
+
tagName,
|
|
64002
|
+
tagValue
|
|
64003
|
+
})) : [];
|
|
62431
64004
|
let beforeTimestamp = void 0;
|
|
62432
64005
|
while (true) {
|
|
62433
64006
|
const resp = await this.#client.cpClient.sandboxListV2({
|
|
62434
64007
|
appId: params.appId,
|
|
62435
64008
|
beforeTimestamp,
|
|
62436
|
-
includeFinished: false
|
|
64009
|
+
includeFinished: false,
|
|
64010
|
+
tags: tagsList
|
|
62437
64011
|
});
|
|
62438
64012
|
if (!resp.sandboxes || resp.sandboxes.length === 0) {
|
|
62439
64013
|
return;
|
|
@@ -62501,6 +64075,17 @@ function validateWorkdir(workdir) {
|
|
|
62501
64075
|
throw new InvalidError(`workdir must be an absolute path, got: ${workdir}`);
|
|
62502
64076
|
}
|
|
62503
64077
|
}
|
|
64078
|
+
async function hydrateSandboxSecrets(client, secrets, mounts) {
|
|
64079
|
+
const toHydrate = [...secrets];
|
|
64080
|
+
if (mounts) {
|
|
64081
|
+
for (const mount of Object.values(mounts)) {
|
|
64082
|
+
if (mount?.secret) {
|
|
64083
|
+
toHydrate.push(mount.secret);
|
|
64084
|
+
}
|
|
64085
|
+
}
|
|
64086
|
+
}
|
|
64087
|
+
await hydrateSecrets(client, toHydrate);
|
|
64088
|
+
}
|
|
62504
64089
|
function getReturnCode(result) {
|
|
62505
64090
|
if (result === void 0 || result.status === 0 /* GENERIC_STATUS_UNSPECIFIED */) {
|
|
62506
64091
|
return null;
|
|
@@ -62673,6 +64258,7 @@ var Sandbox2 = class _Sandbox {
|
|
|
62673
64258
|
this.#ensureAttached();
|
|
62674
64259
|
if (!this.#sidecars) {
|
|
62675
64260
|
this.#sidecars = new SidecarService({
|
|
64261
|
+
client: this.#client,
|
|
62676
64262
|
exec: (command, params, containerId) => this.#execInternal(command, params, containerId),
|
|
62677
64263
|
commandRouter: () => this.#getCommandRouter()
|
|
62678
64264
|
});
|
|
@@ -62727,13 +64313,24 @@ var Sandbox2 = class _Sandbox {
|
|
|
62727
64313
|
async #execInternal(command, params, containerId) {
|
|
62728
64314
|
this.#ensureAttached();
|
|
62729
64315
|
validateExecArgs(command);
|
|
64316
|
+
validateEnvVarKeys(params?.env ?? {});
|
|
64317
|
+
const [envDict, resolvableSecrets] = splitEnvDictAndResolvableSecrets(
|
|
64318
|
+
params?.secrets ?? []
|
|
64319
|
+
);
|
|
64320
|
+
Object.assign(envDict, params?.env ?? {});
|
|
64321
|
+
await hydrateSecrets(this.#client, resolvableSecrets);
|
|
64322
|
+
const execParams = {
|
|
64323
|
+
...params,
|
|
64324
|
+
env: envDict,
|
|
64325
|
+
secrets: resolvableSecrets
|
|
64326
|
+
};
|
|
62730
64327
|
const [taskId, commandRouterClient] = await this.#getCommandRouter();
|
|
62731
64328
|
const execId = uuidv42();
|
|
62732
64329
|
const request = buildTaskExecStartRequestProto(
|
|
62733
64330
|
taskId,
|
|
62734
64331
|
execId,
|
|
62735
64332
|
command,
|
|
62736
|
-
|
|
64333
|
+
execParams,
|
|
62737
64334
|
containerId
|
|
62738
64335
|
);
|
|
62739
64336
|
await commandRouterClient.execStart(request);
|
|
@@ -63066,20 +64663,25 @@ var Sandbox2 = class _Sandbox {
|
|
|
63066
64663
|
}
|
|
63067
64664
|
/**
|
|
63068
64665
|
* Reload all Volumes mounted in the Sandbox.
|
|
64666
|
+
*
|
|
64667
|
+
* Blocks until the Volumes have been reloaded, bounded by `timeoutMs` (55000
|
|
64668
|
+
* by default). If the reload does not complete within that window, a
|
|
64669
|
+
* `TimeoutError` is thrown; note that the reload may still complete in the
|
|
64670
|
+
* background.
|
|
64671
|
+
*
|
|
64672
|
+
* @param params - Optional parameters; see {@link SandboxReloadVolumesParams}.
|
|
63069
64673
|
*/
|
|
63070
|
-
async reloadVolumes() {
|
|
64674
|
+
async reloadVolumes(params) {
|
|
63071
64675
|
this.#ensureAttached();
|
|
63072
|
-
|
|
63073
|
-
|
|
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
|
-
);
|
|
64676
|
+
if (params?.timeoutMs !== void 0 && params.timeoutMs < 0) {
|
|
64677
|
+
throw new InvalidError("`timeoutMs` must not be negative");
|
|
63082
64678
|
}
|
|
64679
|
+
const timeoutMs = params?.timeoutMs || 55e3;
|
|
64680
|
+
const [taskId, commandRouterClient] = await this.#getCommandRouter();
|
|
64681
|
+
await commandRouterClient.reloadVolumes(
|
|
64682
|
+
TaskReloadVolumesRequest.create({ taskId }),
|
|
64683
|
+
{ timeoutMs }
|
|
64684
|
+
);
|
|
63083
64685
|
}
|
|
63084
64686
|
/**
|
|
63085
64687
|
* Snapshots and creates a new {@link Image} from a directory in the running sandbox.
|