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.cjs
CHANGED
|
@@ -2102,6 +2102,31 @@ function environmentRoleToJSON(object) {
|
|
|
2102
2102
|
return "UNRECOGNIZED";
|
|
2103
2103
|
}
|
|
2104
2104
|
}
|
|
2105
|
+
function environmentTypeFromJSON(object) {
|
|
2106
|
+
switch (object) {
|
|
2107
|
+
case 0:
|
|
2108
|
+
case "ENVIRONMENT_TYPE_UNSPECIFIED":
|
|
2109
|
+
return 0 /* ENVIRONMENT_TYPE_UNSPECIFIED */;
|
|
2110
|
+
case 1:
|
|
2111
|
+
case "ENVIRONMENT_TYPE_PUBLIC":
|
|
2112
|
+
return 1 /* ENVIRONMENT_TYPE_PUBLIC */;
|
|
2113
|
+
case -1:
|
|
2114
|
+
case "UNRECOGNIZED":
|
|
2115
|
+
default:
|
|
2116
|
+
return -1 /* UNRECOGNIZED */;
|
|
2117
|
+
}
|
|
2118
|
+
}
|
|
2119
|
+
function environmentTypeToJSON(object) {
|
|
2120
|
+
switch (object) {
|
|
2121
|
+
case 0 /* ENVIRONMENT_TYPE_UNSPECIFIED */:
|
|
2122
|
+
return "ENVIRONMENT_TYPE_UNSPECIFIED";
|
|
2123
|
+
case 1 /* ENVIRONMENT_TYPE_PUBLIC */:
|
|
2124
|
+
return "ENVIRONMENT_TYPE_PUBLIC";
|
|
2125
|
+
case -1 /* UNRECOGNIZED */:
|
|
2126
|
+
default:
|
|
2127
|
+
return "UNRECOGNIZED";
|
|
2128
|
+
}
|
|
2129
|
+
}
|
|
2105
2130
|
function execOutputOptionFromJSON(object) {
|
|
2106
2131
|
switch (object) {
|
|
2107
2132
|
case 0:
|
|
@@ -13485,6 +13510,43 @@ var ContainerReloadVolumesResponse = {
|
|
|
13485
13510
|
return message;
|
|
13486
13511
|
}
|
|
13487
13512
|
};
|
|
13513
|
+
function createBaseContainerServerLifecycleReadyRequest() {
|
|
13514
|
+
return {};
|
|
13515
|
+
}
|
|
13516
|
+
var ContainerServerLifecycleReadyRequest = {
|
|
13517
|
+
encode(_, writer = new BinaryWriter()) {
|
|
13518
|
+
return writer;
|
|
13519
|
+
},
|
|
13520
|
+
decode(input, length) {
|
|
13521
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
13522
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
13523
|
+
const message = createBaseContainerServerLifecycleReadyRequest();
|
|
13524
|
+
while (reader.pos < end) {
|
|
13525
|
+
const tag = reader.uint32();
|
|
13526
|
+
switch (tag >>> 3) {
|
|
13527
|
+
}
|
|
13528
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
13529
|
+
break;
|
|
13530
|
+
}
|
|
13531
|
+
reader.skip(tag & 7);
|
|
13532
|
+
}
|
|
13533
|
+
return message;
|
|
13534
|
+
},
|
|
13535
|
+
fromJSON(_) {
|
|
13536
|
+
return {};
|
|
13537
|
+
},
|
|
13538
|
+
toJSON(_) {
|
|
13539
|
+
const obj = {};
|
|
13540
|
+
return obj;
|
|
13541
|
+
},
|
|
13542
|
+
create(base) {
|
|
13543
|
+
return ContainerServerLifecycleReadyRequest.fromPartial(base ?? {});
|
|
13544
|
+
},
|
|
13545
|
+
fromPartial(_) {
|
|
13546
|
+
const message = createBaseContainerServerLifecycleReadyRequest();
|
|
13547
|
+
return message;
|
|
13548
|
+
}
|
|
13549
|
+
};
|
|
13488
13550
|
function createBaseContainerStopRequest() {
|
|
13489
13551
|
return { taskId: "", graceful: false };
|
|
13490
13552
|
}
|
|
@@ -17597,8 +17659,280 @@ var EndpointStopResponse = {
|
|
|
17597
17659
|
return message;
|
|
17598
17660
|
}
|
|
17599
17661
|
};
|
|
17662
|
+
function createBaseEnvironmentBillingSummaryRequest() {
|
|
17663
|
+
return { startTimestamp: void 0, endTimestamp: void 0, environmentId: "" };
|
|
17664
|
+
}
|
|
17665
|
+
var EnvironmentBillingSummaryRequest = {
|
|
17666
|
+
encode(message, writer = new BinaryWriter()) {
|
|
17667
|
+
if (message.startTimestamp !== void 0) {
|
|
17668
|
+
Timestamp.encode(toTimestamp(message.startTimestamp), writer.uint32(10).fork()).join();
|
|
17669
|
+
}
|
|
17670
|
+
if (message.endTimestamp !== void 0) {
|
|
17671
|
+
Timestamp.encode(toTimestamp(message.endTimestamp), writer.uint32(18).fork()).join();
|
|
17672
|
+
}
|
|
17673
|
+
if (message.environmentId !== "") {
|
|
17674
|
+
writer.uint32(26).string(message.environmentId);
|
|
17675
|
+
}
|
|
17676
|
+
return writer;
|
|
17677
|
+
},
|
|
17678
|
+
decode(input, length) {
|
|
17679
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
17680
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
17681
|
+
const message = createBaseEnvironmentBillingSummaryRequest();
|
|
17682
|
+
while (reader.pos < end) {
|
|
17683
|
+
const tag = reader.uint32();
|
|
17684
|
+
switch (tag >>> 3) {
|
|
17685
|
+
case 1: {
|
|
17686
|
+
if (tag !== 10) {
|
|
17687
|
+
break;
|
|
17688
|
+
}
|
|
17689
|
+
message.startTimestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
17690
|
+
continue;
|
|
17691
|
+
}
|
|
17692
|
+
case 2: {
|
|
17693
|
+
if (tag !== 18) {
|
|
17694
|
+
break;
|
|
17695
|
+
}
|
|
17696
|
+
message.endTimestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
17697
|
+
continue;
|
|
17698
|
+
}
|
|
17699
|
+
case 3: {
|
|
17700
|
+
if (tag !== 26) {
|
|
17701
|
+
break;
|
|
17702
|
+
}
|
|
17703
|
+
message.environmentId = reader.string();
|
|
17704
|
+
continue;
|
|
17705
|
+
}
|
|
17706
|
+
}
|
|
17707
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
17708
|
+
break;
|
|
17709
|
+
}
|
|
17710
|
+
reader.skip(tag & 7);
|
|
17711
|
+
}
|
|
17712
|
+
return message;
|
|
17713
|
+
},
|
|
17714
|
+
fromJSON(object) {
|
|
17715
|
+
return {
|
|
17716
|
+
startTimestamp: isSet5(object.startTimestamp) ? fromJsonTimestamp(object.startTimestamp) : void 0,
|
|
17717
|
+
endTimestamp: isSet5(object.endTimestamp) ? fromJsonTimestamp(object.endTimestamp) : void 0,
|
|
17718
|
+
environmentId: isSet5(object.environmentId) ? globalThis.String(object.environmentId) : ""
|
|
17719
|
+
};
|
|
17720
|
+
},
|
|
17721
|
+
toJSON(message) {
|
|
17722
|
+
const obj = {};
|
|
17723
|
+
if (message.startTimestamp !== void 0) {
|
|
17724
|
+
obj.startTimestamp = message.startTimestamp.toISOString();
|
|
17725
|
+
}
|
|
17726
|
+
if (message.endTimestamp !== void 0) {
|
|
17727
|
+
obj.endTimestamp = message.endTimestamp.toISOString();
|
|
17728
|
+
}
|
|
17729
|
+
if (message.environmentId !== "") {
|
|
17730
|
+
obj.environmentId = message.environmentId;
|
|
17731
|
+
}
|
|
17732
|
+
return obj;
|
|
17733
|
+
},
|
|
17734
|
+
create(base) {
|
|
17735
|
+
return EnvironmentBillingSummaryRequest.fromPartial(base ?? {});
|
|
17736
|
+
},
|
|
17737
|
+
fromPartial(object) {
|
|
17738
|
+
const message = createBaseEnvironmentBillingSummaryRequest();
|
|
17739
|
+
message.startTimestamp = object.startTimestamp ?? void 0;
|
|
17740
|
+
message.endTimestamp = object.endTimestamp ?? void 0;
|
|
17741
|
+
message.environmentId = object.environmentId ?? "";
|
|
17742
|
+
return message;
|
|
17743
|
+
}
|
|
17744
|
+
};
|
|
17745
|
+
function createBaseEnvironmentBillingSummaryResponse() {
|
|
17746
|
+
return { startTimestamp: void 0, endTimestamp: void 0, meteredCost: "", meteredCostBreakdown: {} };
|
|
17747
|
+
}
|
|
17748
|
+
var EnvironmentBillingSummaryResponse = {
|
|
17749
|
+
encode(message, writer = new BinaryWriter()) {
|
|
17750
|
+
if (message.startTimestamp !== void 0) {
|
|
17751
|
+
Timestamp.encode(toTimestamp(message.startTimestamp), writer.uint32(10).fork()).join();
|
|
17752
|
+
}
|
|
17753
|
+
if (message.endTimestamp !== void 0) {
|
|
17754
|
+
Timestamp.encode(toTimestamp(message.endTimestamp), writer.uint32(18).fork()).join();
|
|
17755
|
+
}
|
|
17756
|
+
if (message.meteredCost !== "") {
|
|
17757
|
+
writer.uint32(26).string(message.meteredCost);
|
|
17758
|
+
}
|
|
17759
|
+
Object.entries(message.meteredCostBreakdown).forEach(([key, value]) => {
|
|
17760
|
+
EnvironmentBillingSummaryResponse_MeteredCostBreakdownEntry.encode(
|
|
17761
|
+
{ key, value },
|
|
17762
|
+
writer.uint32(34).fork()
|
|
17763
|
+
).join();
|
|
17764
|
+
});
|
|
17765
|
+
return writer;
|
|
17766
|
+
},
|
|
17767
|
+
decode(input, length) {
|
|
17768
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
17769
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
17770
|
+
const message = createBaseEnvironmentBillingSummaryResponse();
|
|
17771
|
+
while (reader.pos < end) {
|
|
17772
|
+
const tag = reader.uint32();
|
|
17773
|
+
switch (tag >>> 3) {
|
|
17774
|
+
case 1: {
|
|
17775
|
+
if (tag !== 10) {
|
|
17776
|
+
break;
|
|
17777
|
+
}
|
|
17778
|
+
message.startTimestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
17779
|
+
continue;
|
|
17780
|
+
}
|
|
17781
|
+
case 2: {
|
|
17782
|
+
if (tag !== 18) {
|
|
17783
|
+
break;
|
|
17784
|
+
}
|
|
17785
|
+
message.endTimestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
17786
|
+
continue;
|
|
17787
|
+
}
|
|
17788
|
+
case 3: {
|
|
17789
|
+
if (tag !== 26) {
|
|
17790
|
+
break;
|
|
17791
|
+
}
|
|
17792
|
+
message.meteredCost = reader.string();
|
|
17793
|
+
continue;
|
|
17794
|
+
}
|
|
17795
|
+
case 4: {
|
|
17796
|
+
if (tag !== 34) {
|
|
17797
|
+
break;
|
|
17798
|
+
}
|
|
17799
|
+
const entry4 = EnvironmentBillingSummaryResponse_MeteredCostBreakdownEntry.decode(reader, reader.uint32());
|
|
17800
|
+
if (entry4.value !== void 0) {
|
|
17801
|
+
message.meteredCostBreakdown[entry4.key] = entry4.value;
|
|
17802
|
+
}
|
|
17803
|
+
continue;
|
|
17804
|
+
}
|
|
17805
|
+
}
|
|
17806
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
17807
|
+
break;
|
|
17808
|
+
}
|
|
17809
|
+
reader.skip(tag & 7);
|
|
17810
|
+
}
|
|
17811
|
+
return message;
|
|
17812
|
+
},
|
|
17813
|
+
fromJSON(object) {
|
|
17814
|
+
return {
|
|
17815
|
+
startTimestamp: isSet5(object.startTimestamp) ? fromJsonTimestamp(object.startTimestamp) : void 0,
|
|
17816
|
+
endTimestamp: isSet5(object.endTimestamp) ? fromJsonTimestamp(object.endTimestamp) : void 0,
|
|
17817
|
+
meteredCost: isSet5(object.meteredCost) ? globalThis.String(object.meteredCost) : "",
|
|
17818
|
+
meteredCostBreakdown: isObject2(object.meteredCostBreakdown) ? Object.entries(object.meteredCostBreakdown).reduce((acc, [key, value]) => {
|
|
17819
|
+
acc[key] = String(value);
|
|
17820
|
+
return acc;
|
|
17821
|
+
}, {}) : {}
|
|
17822
|
+
};
|
|
17823
|
+
},
|
|
17824
|
+
toJSON(message) {
|
|
17825
|
+
const obj = {};
|
|
17826
|
+
if (message.startTimestamp !== void 0) {
|
|
17827
|
+
obj.startTimestamp = message.startTimestamp.toISOString();
|
|
17828
|
+
}
|
|
17829
|
+
if (message.endTimestamp !== void 0) {
|
|
17830
|
+
obj.endTimestamp = message.endTimestamp.toISOString();
|
|
17831
|
+
}
|
|
17832
|
+
if (message.meteredCost !== "") {
|
|
17833
|
+
obj.meteredCost = message.meteredCost;
|
|
17834
|
+
}
|
|
17835
|
+
if (message.meteredCostBreakdown) {
|
|
17836
|
+
const entries = Object.entries(message.meteredCostBreakdown);
|
|
17837
|
+
if (entries.length > 0) {
|
|
17838
|
+
obj.meteredCostBreakdown = {};
|
|
17839
|
+
entries.forEach(([k, v]) => {
|
|
17840
|
+
obj.meteredCostBreakdown[k] = v;
|
|
17841
|
+
});
|
|
17842
|
+
}
|
|
17843
|
+
}
|
|
17844
|
+
return obj;
|
|
17845
|
+
},
|
|
17846
|
+
create(base) {
|
|
17847
|
+
return EnvironmentBillingSummaryResponse.fromPartial(base ?? {});
|
|
17848
|
+
},
|
|
17849
|
+
fromPartial(object) {
|
|
17850
|
+
const message = createBaseEnvironmentBillingSummaryResponse();
|
|
17851
|
+
message.startTimestamp = object.startTimestamp ?? void 0;
|
|
17852
|
+
message.endTimestamp = object.endTimestamp ?? void 0;
|
|
17853
|
+
message.meteredCost = object.meteredCost ?? "";
|
|
17854
|
+
message.meteredCostBreakdown = Object.entries(object.meteredCostBreakdown ?? {}).reduce(
|
|
17855
|
+
(acc, [key, value]) => {
|
|
17856
|
+
if (value !== void 0) {
|
|
17857
|
+
acc[key] = globalThis.String(value);
|
|
17858
|
+
}
|
|
17859
|
+
return acc;
|
|
17860
|
+
},
|
|
17861
|
+
{}
|
|
17862
|
+
);
|
|
17863
|
+
return message;
|
|
17864
|
+
}
|
|
17865
|
+
};
|
|
17866
|
+
function createBaseEnvironmentBillingSummaryResponse_MeteredCostBreakdownEntry() {
|
|
17867
|
+
return { key: "", value: "" };
|
|
17868
|
+
}
|
|
17869
|
+
var EnvironmentBillingSummaryResponse_MeteredCostBreakdownEntry = {
|
|
17870
|
+
encode(message, writer = new BinaryWriter()) {
|
|
17871
|
+
if (message.key !== "") {
|
|
17872
|
+
writer.uint32(10).string(message.key);
|
|
17873
|
+
}
|
|
17874
|
+
if (message.value !== "") {
|
|
17875
|
+
writer.uint32(18).string(message.value);
|
|
17876
|
+
}
|
|
17877
|
+
return writer;
|
|
17878
|
+
},
|
|
17879
|
+
decode(input, length) {
|
|
17880
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
17881
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
17882
|
+
const message = createBaseEnvironmentBillingSummaryResponse_MeteredCostBreakdownEntry();
|
|
17883
|
+
while (reader.pos < end) {
|
|
17884
|
+
const tag = reader.uint32();
|
|
17885
|
+
switch (tag >>> 3) {
|
|
17886
|
+
case 1: {
|
|
17887
|
+
if (tag !== 10) {
|
|
17888
|
+
break;
|
|
17889
|
+
}
|
|
17890
|
+
message.key = reader.string();
|
|
17891
|
+
continue;
|
|
17892
|
+
}
|
|
17893
|
+
case 2: {
|
|
17894
|
+
if (tag !== 18) {
|
|
17895
|
+
break;
|
|
17896
|
+
}
|
|
17897
|
+
message.value = reader.string();
|
|
17898
|
+
continue;
|
|
17899
|
+
}
|
|
17900
|
+
}
|
|
17901
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
17902
|
+
break;
|
|
17903
|
+
}
|
|
17904
|
+
reader.skip(tag & 7);
|
|
17905
|
+
}
|
|
17906
|
+
return message;
|
|
17907
|
+
},
|
|
17908
|
+
fromJSON(object) {
|
|
17909
|
+
return {
|
|
17910
|
+
key: isSet5(object.key) ? globalThis.String(object.key) : "",
|
|
17911
|
+
value: isSet5(object.value) ? globalThis.String(object.value) : ""
|
|
17912
|
+
};
|
|
17913
|
+
},
|
|
17914
|
+
toJSON(message) {
|
|
17915
|
+
const obj = {};
|
|
17916
|
+
if (message.key !== "") {
|
|
17917
|
+
obj.key = message.key;
|
|
17918
|
+
}
|
|
17919
|
+
if (message.value !== "") {
|
|
17920
|
+
obj.value = message.value;
|
|
17921
|
+
}
|
|
17922
|
+
return obj;
|
|
17923
|
+
},
|
|
17924
|
+
create(base) {
|
|
17925
|
+
return EnvironmentBillingSummaryResponse_MeteredCostBreakdownEntry.fromPartial(base ?? {});
|
|
17926
|
+
},
|
|
17927
|
+
fromPartial(object) {
|
|
17928
|
+
const message = createBaseEnvironmentBillingSummaryResponse_MeteredCostBreakdownEntry();
|
|
17929
|
+
message.key = object.key ?? "";
|
|
17930
|
+
message.value = object.value ?? "";
|
|
17931
|
+
return message;
|
|
17932
|
+
}
|
|
17933
|
+
};
|
|
17600
17934
|
function createBaseEnvironmentCreateRequest() {
|
|
17601
|
-
return { name: "", isManaged: false, settings: void 0 };
|
|
17935
|
+
return { name: "", isManaged: false, settings: void 0, environmentType: 0 };
|
|
17602
17936
|
}
|
|
17603
17937
|
var EnvironmentCreateRequest = {
|
|
17604
17938
|
encode(message, writer = new BinaryWriter()) {
|
|
@@ -17611,6 +17945,9 @@ var EnvironmentCreateRequest = {
|
|
|
17611
17945
|
if (message.settings !== void 0) {
|
|
17612
17946
|
EnvironmentSettings.encode(message.settings, writer.uint32(26).fork()).join();
|
|
17613
17947
|
}
|
|
17948
|
+
if (message.environmentType !== 0) {
|
|
17949
|
+
writer.uint32(32).int32(message.environmentType);
|
|
17950
|
+
}
|
|
17614
17951
|
return writer;
|
|
17615
17952
|
},
|
|
17616
17953
|
decode(input, length) {
|
|
@@ -17641,6 +17978,13 @@ var EnvironmentCreateRequest = {
|
|
|
17641
17978
|
message.settings = EnvironmentSettings.decode(reader, reader.uint32());
|
|
17642
17979
|
continue;
|
|
17643
17980
|
}
|
|
17981
|
+
case 4: {
|
|
17982
|
+
if (tag !== 32) {
|
|
17983
|
+
break;
|
|
17984
|
+
}
|
|
17985
|
+
message.environmentType = reader.int32();
|
|
17986
|
+
continue;
|
|
17987
|
+
}
|
|
17644
17988
|
}
|
|
17645
17989
|
if ((tag & 7) === 4 || tag === 0) {
|
|
17646
17990
|
break;
|
|
@@ -17653,7 +17997,8 @@ var EnvironmentCreateRequest = {
|
|
|
17653
17997
|
return {
|
|
17654
17998
|
name: isSet5(object.name) ? globalThis.String(object.name) : "",
|
|
17655
17999
|
isManaged: isSet5(object.isManaged) ? globalThis.Boolean(object.isManaged) : false,
|
|
17656
|
-
settings: isSet5(object.settings) ? EnvironmentSettings.fromJSON(object.settings) : void 0
|
|
18000
|
+
settings: isSet5(object.settings) ? EnvironmentSettings.fromJSON(object.settings) : void 0,
|
|
18001
|
+
environmentType: isSet5(object.environmentType) ? environmentTypeFromJSON(object.environmentType) : 0
|
|
17657
18002
|
};
|
|
17658
18003
|
},
|
|
17659
18004
|
toJSON(message) {
|
|
@@ -17667,6 +18012,9 @@ var EnvironmentCreateRequest = {
|
|
|
17667
18012
|
if (message.settings !== void 0) {
|
|
17668
18013
|
obj.settings = EnvironmentSettings.toJSON(message.settings);
|
|
17669
18014
|
}
|
|
18015
|
+
if (message.environmentType !== 0) {
|
|
18016
|
+
obj.environmentType = environmentTypeToJSON(message.environmentType);
|
|
18017
|
+
}
|
|
17670
18018
|
return obj;
|
|
17671
18019
|
},
|
|
17672
18020
|
create(base) {
|
|
@@ -17677,6 +18025,7 @@ var EnvironmentCreateRequest = {
|
|
|
17677
18025
|
message.name = object.name ?? "";
|
|
17678
18026
|
message.isManaged = object.isManaged ?? false;
|
|
17679
18027
|
message.settings = object.settings !== void 0 && object.settings !== null ? EnvironmentSettings.fromPartial(object.settings) : void 0;
|
|
18028
|
+
message.environmentType = object.environmentType ?? 0;
|
|
17680
18029
|
return message;
|
|
17681
18030
|
}
|
|
17682
18031
|
};
|
|
@@ -18364,7 +18713,8 @@ function createBaseEnvironmentListItem() {
|
|
|
18364
18713
|
cycleBudgetDollars: void 0,
|
|
18365
18714
|
effectiveCycleSpendLimit: 0,
|
|
18366
18715
|
currentCycleUsage: 0,
|
|
18367
|
-
spendLimitReached: false
|
|
18716
|
+
spendLimitReached: false,
|
|
18717
|
+
environmentType: 0
|
|
18368
18718
|
};
|
|
18369
18719
|
}
|
|
18370
18720
|
var EnvironmentListItem = {
|
|
@@ -18411,6 +18761,9 @@ var EnvironmentListItem = {
|
|
|
18411
18761
|
if (message.spendLimitReached !== false) {
|
|
18412
18762
|
writer.uint32(112).bool(message.spendLimitReached);
|
|
18413
18763
|
}
|
|
18764
|
+
if (message.environmentType !== 0) {
|
|
18765
|
+
writer.uint32(120).int32(message.environmentType);
|
|
18766
|
+
}
|
|
18414
18767
|
return writer;
|
|
18415
18768
|
},
|
|
18416
18769
|
decode(input, length) {
|
|
@@ -18518,6 +18871,13 @@ var EnvironmentListItem = {
|
|
|
18518
18871
|
message.spendLimitReached = reader.bool();
|
|
18519
18872
|
continue;
|
|
18520
18873
|
}
|
|
18874
|
+
case 15: {
|
|
18875
|
+
if (tag !== 120) {
|
|
18876
|
+
break;
|
|
18877
|
+
}
|
|
18878
|
+
message.environmentType = reader.int32();
|
|
18879
|
+
continue;
|
|
18880
|
+
}
|
|
18521
18881
|
}
|
|
18522
18882
|
if ((tag & 7) === 4 || tag === 0) {
|
|
18523
18883
|
break;
|
|
@@ -18541,7 +18901,8 @@ var EnvironmentListItem = {
|
|
|
18541
18901
|
cycleBudgetDollars: isSet5(object.cycleBudgetDollars) ? globalThis.Number(object.cycleBudgetDollars) : void 0,
|
|
18542
18902
|
effectiveCycleSpendLimit: isSet5(object.effectiveCycleSpendLimit) ? globalThis.Number(object.effectiveCycleSpendLimit) : 0,
|
|
18543
18903
|
currentCycleUsage: isSet5(object.currentCycleUsage) ? globalThis.Number(object.currentCycleUsage) : 0,
|
|
18544
|
-
spendLimitReached: isSet5(object.spendLimitReached) ? globalThis.Boolean(object.spendLimitReached) : false
|
|
18904
|
+
spendLimitReached: isSet5(object.spendLimitReached) ? globalThis.Boolean(object.spendLimitReached) : false,
|
|
18905
|
+
environmentType: isSet5(object.environmentType) ? environmentTypeFromJSON(object.environmentType) : 0
|
|
18545
18906
|
};
|
|
18546
18907
|
},
|
|
18547
18908
|
toJSON(message) {
|
|
@@ -18588,6 +18949,9 @@ var EnvironmentListItem = {
|
|
|
18588
18949
|
if (message.spendLimitReached !== false) {
|
|
18589
18950
|
obj.spendLimitReached = message.spendLimitReached;
|
|
18590
18951
|
}
|
|
18952
|
+
if (message.environmentType !== 0) {
|
|
18953
|
+
obj.environmentType = environmentTypeToJSON(message.environmentType);
|
|
18954
|
+
}
|
|
18591
18955
|
return obj;
|
|
18592
18956
|
},
|
|
18593
18957
|
create(base) {
|
|
@@ -18609,6 +18973,7 @@ var EnvironmentListItem = {
|
|
|
18609
18973
|
message.effectiveCycleSpendLimit = object.effectiveCycleSpendLimit ?? 0;
|
|
18610
18974
|
message.currentCycleUsage = object.currentCycleUsage ?? 0;
|
|
18611
18975
|
message.spendLimitReached = object.spendLimitReached ?? false;
|
|
18976
|
+
message.environmentType = object.environmentType ?? 0;
|
|
18612
18977
|
return message;
|
|
18613
18978
|
}
|
|
18614
18979
|
};
|
|
@@ -18666,7 +19031,7 @@ var EnvironmentListResponse = {
|
|
|
18666
19031
|
}
|
|
18667
19032
|
};
|
|
18668
19033
|
function createBaseEnvironmentMetadata() {
|
|
18669
|
-
return { name: "", settings: void 0 };
|
|
19034
|
+
return { name: "", settings: void 0, environmentType: 0 };
|
|
18670
19035
|
}
|
|
18671
19036
|
var EnvironmentMetadata = {
|
|
18672
19037
|
encode(message, writer = new BinaryWriter()) {
|
|
@@ -18676,6 +19041,9 @@ var EnvironmentMetadata = {
|
|
|
18676
19041
|
if (message.settings !== void 0) {
|
|
18677
19042
|
EnvironmentSettings.encode(message.settings, writer.uint32(18).fork()).join();
|
|
18678
19043
|
}
|
|
19044
|
+
if (message.environmentType !== 0) {
|
|
19045
|
+
writer.uint32(24).int32(message.environmentType);
|
|
19046
|
+
}
|
|
18679
19047
|
return writer;
|
|
18680
19048
|
},
|
|
18681
19049
|
decode(input, length) {
|
|
@@ -18699,6 +19067,13 @@ var EnvironmentMetadata = {
|
|
|
18699
19067
|
message.settings = EnvironmentSettings.decode(reader, reader.uint32());
|
|
18700
19068
|
continue;
|
|
18701
19069
|
}
|
|
19070
|
+
case 3: {
|
|
19071
|
+
if (tag !== 24) {
|
|
19072
|
+
break;
|
|
19073
|
+
}
|
|
19074
|
+
message.environmentType = reader.int32();
|
|
19075
|
+
continue;
|
|
19076
|
+
}
|
|
18702
19077
|
}
|
|
18703
19078
|
if ((tag & 7) === 4 || tag === 0) {
|
|
18704
19079
|
break;
|
|
@@ -18710,7 +19085,8 @@ var EnvironmentMetadata = {
|
|
|
18710
19085
|
fromJSON(object) {
|
|
18711
19086
|
return {
|
|
18712
19087
|
name: isSet5(object.name) ? globalThis.String(object.name) : "",
|
|
18713
|
-
settings: isSet5(object.settings) ? EnvironmentSettings.fromJSON(object.settings) : void 0
|
|
19088
|
+
settings: isSet5(object.settings) ? EnvironmentSettings.fromJSON(object.settings) : void 0,
|
|
19089
|
+
environmentType: isSet5(object.environmentType) ? environmentTypeFromJSON(object.environmentType) : 0
|
|
18714
19090
|
};
|
|
18715
19091
|
},
|
|
18716
19092
|
toJSON(message) {
|
|
@@ -18721,6 +19097,9 @@ var EnvironmentMetadata = {
|
|
|
18721
19097
|
if (message.settings !== void 0) {
|
|
18722
19098
|
obj.settings = EnvironmentSettings.toJSON(message.settings);
|
|
18723
19099
|
}
|
|
19100
|
+
if (message.environmentType !== 0) {
|
|
19101
|
+
obj.environmentType = environmentTypeToJSON(message.environmentType);
|
|
19102
|
+
}
|
|
18724
19103
|
return obj;
|
|
18725
19104
|
},
|
|
18726
19105
|
create(base) {
|
|
@@ -18730,6 +19109,7 @@ var EnvironmentMetadata = {
|
|
|
18730
19109
|
const message = createBaseEnvironmentMetadata();
|
|
18731
19110
|
message.name = object.name ?? "";
|
|
18732
19111
|
message.settings = object.settings !== void 0 && object.settings !== null ? EnvironmentSettings.fromPartial(object.settings) : void 0;
|
|
19112
|
+
message.environmentType = object.environmentType ?? 0;
|
|
18733
19113
|
return message;
|
|
18734
19114
|
}
|
|
18735
19115
|
};
|
|
@@ -21983,7 +22363,7 @@ var FunctionCallFromIdRequest = {
|
|
|
21983
22363
|
}
|
|
21984
22364
|
};
|
|
21985
22365
|
function createBaseFunctionCallFromIdResponse() {
|
|
21986
|
-
return { functionCallId: "", numInputs: 0 };
|
|
22366
|
+
return { functionCallId: "", numInputs: 0, metadata: void 0 };
|
|
21987
22367
|
}
|
|
21988
22368
|
var FunctionCallFromIdResponse = {
|
|
21989
22369
|
encode(message, writer = new BinaryWriter()) {
|
|
@@ -21993,6 +22373,9 @@ var FunctionCallFromIdResponse = {
|
|
|
21993
22373
|
if (message.numInputs !== 0) {
|
|
21994
22374
|
writer.uint32(16).int32(message.numInputs);
|
|
21995
22375
|
}
|
|
22376
|
+
if (message.metadata !== void 0) {
|
|
22377
|
+
FunctionCallHandleMetadata.encode(message.metadata, writer.uint32(26).fork()).join();
|
|
22378
|
+
}
|
|
21996
22379
|
return writer;
|
|
21997
22380
|
},
|
|
21998
22381
|
decode(input, length) {
|
|
@@ -22016,6 +22399,13 @@ var FunctionCallFromIdResponse = {
|
|
|
22016
22399
|
message.numInputs = reader.int32();
|
|
22017
22400
|
continue;
|
|
22018
22401
|
}
|
|
22402
|
+
case 3: {
|
|
22403
|
+
if (tag !== 26) {
|
|
22404
|
+
break;
|
|
22405
|
+
}
|
|
22406
|
+
message.metadata = FunctionCallHandleMetadata.decode(reader, reader.uint32());
|
|
22407
|
+
continue;
|
|
22408
|
+
}
|
|
22019
22409
|
}
|
|
22020
22410
|
if ((tag & 7) === 4 || tag === 0) {
|
|
22021
22411
|
break;
|
|
@@ -22027,7 +22417,8 @@ var FunctionCallFromIdResponse = {
|
|
|
22027
22417
|
fromJSON(object) {
|
|
22028
22418
|
return {
|
|
22029
22419
|
functionCallId: isSet5(object.functionCallId) ? globalThis.String(object.functionCallId) : "",
|
|
22030
|
-
numInputs: isSet5(object.numInputs) ? globalThis.Number(object.numInputs) : 0
|
|
22420
|
+
numInputs: isSet5(object.numInputs) ? globalThis.Number(object.numInputs) : 0,
|
|
22421
|
+
metadata: isSet5(object.metadata) ? FunctionCallHandleMetadata.fromJSON(object.metadata) : void 0
|
|
22031
22422
|
};
|
|
22032
22423
|
},
|
|
22033
22424
|
toJSON(message) {
|
|
@@ -22038,6 +22429,9 @@ var FunctionCallFromIdResponse = {
|
|
|
22038
22429
|
if (message.numInputs !== 0) {
|
|
22039
22430
|
obj.numInputs = Math.round(message.numInputs);
|
|
22040
22431
|
}
|
|
22432
|
+
if (message.metadata !== void 0) {
|
|
22433
|
+
obj.metadata = FunctionCallHandleMetadata.toJSON(message.metadata);
|
|
22434
|
+
}
|
|
22041
22435
|
return obj;
|
|
22042
22436
|
},
|
|
22043
22437
|
create(base) {
|
|
@@ -22047,6 +22441,7 @@ var FunctionCallFromIdResponse = {
|
|
|
22047
22441
|
const message = createBaseFunctionCallFromIdResponse();
|
|
22048
22442
|
message.functionCallId = object.functionCallId ?? "";
|
|
22049
22443
|
message.numInputs = object.numInputs ?? 0;
|
|
22444
|
+
message.metadata = object.metadata !== void 0 && object.metadata !== null ? FunctionCallHandleMetadata.fromPartial(object.metadata) : void 0;
|
|
22050
22445
|
return message;
|
|
22051
22446
|
}
|
|
22052
22447
|
};
|
|
@@ -22133,6 +22528,74 @@ var FunctionCallGetDataRequest = {
|
|
|
22133
22528
|
return message;
|
|
22134
22529
|
}
|
|
22135
22530
|
};
|
|
22531
|
+
function createBaseFunctionCallHandleMetadata() {
|
|
22532
|
+
return { appId: "", functionId: "" };
|
|
22533
|
+
}
|
|
22534
|
+
var FunctionCallHandleMetadata = {
|
|
22535
|
+
encode(message, writer = new BinaryWriter()) {
|
|
22536
|
+
if (message.appId !== "") {
|
|
22537
|
+
writer.uint32(10).string(message.appId);
|
|
22538
|
+
}
|
|
22539
|
+
if (message.functionId !== "") {
|
|
22540
|
+
writer.uint32(18).string(message.functionId);
|
|
22541
|
+
}
|
|
22542
|
+
return writer;
|
|
22543
|
+
},
|
|
22544
|
+
decode(input, length) {
|
|
22545
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
22546
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
22547
|
+
const message = createBaseFunctionCallHandleMetadata();
|
|
22548
|
+
while (reader.pos < end) {
|
|
22549
|
+
const tag = reader.uint32();
|
|
22550
|
+
switch (tag >>> 3) {
|
|
22551
|
+
case 1: {
|
|
22552
|
+
if (tag !== 10) {
|
|
22553
|
+
break;
|
|
22554
|
+
}
|
|
22555
|
+
message.appId = reader.string();
|
|
22556
|
+
continue;
|
|
22557
|
+
}
|
|
22558
|
+
case 2: {
|
|
22559
|
+
if (tag !== 18) {
|
|
22560
|
+
break;
|
|
22561
|
+
}
|
|
22562
|
+
message.functionId = reader.string();
|
|
22563
|
+
continue;
|
|
22564
|
+
}
|
|
22565
|
+
}
|
|
22566
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
22567
|
+
break;
|
|
22568
|
+
}
|
|
22569
|
+
reader.skip(tag & 7);
|
|
22570
|
+
}
|
|
22571
|
+
return message;
|
|
22572
|
+
},
|
|
22573
|
+
fromJSON(object) {
|
|
22574
|
+
return {
|
|
22575
|
+
appId: isSet5(object.appId) ? globalThis.String(object.appId) : "",
|
|
22576
|
+
functionId: isSet5(object.functionId) ? globalThis.String(object.functionId) : ""
|
|
22577
|
+
};
|
|
22578
|
+
},
|
|
22579
|
+
toJSON(message) {
|
|
22580
|
+
const obj = {};
|
|
22581
|
+
if (message.appId !== "") {
|
|
22582
|
+
obj.appId = message.appId;
|
|
22583
|
+
}
|
|
22584
|
+
if (message.functionId !== "") {
|
|
22585
|
+
obj.functionId = message.functionId;
|
|
22586
|
+
}
|
|
22587
|
+
return obj;
|
|
22588
|
+
},
|
|
22589
|
+
create(base) {
|
|
22590
|
+
return FunctionCallHandleMetadata.fromPartial(base ?? {});
|
|
22591
|
+
},
|
|
22592
|
+
fromPartial(object) {
|
|
22593
|
+
const message = createBaseFunctionCallHandleMetadata();
|
|
22594
|
+
message.appId = object.appId ?? "";
|
|
22595
|
+
message.functionId = object.functionId ?? "";
|
|
22596
|
+
return message;
|
|
22597
|
+
}
|
|
22598
|
+
};
|
|
22136
22599
|
function createBaseFunctionCallInfo() {
|
|
22137
22600
|
return {
|
|
22138
22601
|
functionCallId: "",
|
|
@@ -25255,7 +25718,8 @@ function createBaseFunctionHandleMetadata() {
|
|
|
25255
25718
|
maxObjectSizeBytes: void 0,
|
|
25256
25719
|
ExperimentalFlashUrls: [],
|
|
25257
25720
|
supportedInputFormats: [],
|
|
25258
|
-
supportedOutputFormats: []
|
|
25721
|
+
supportedOutputFormats: [],
|
|
25722
|
+
appId: ""
|
|
25259
25723
|
};
|
|
25260
25724
|
}
|
|
25261
25725
|
var FunctionHandleMetadata = {
|
|
@@ -25312,6 +25776,9 @@ var FunctionHandleMetadata = {
|
|
|
25312
25776
|
writer.int32(v);
|
|
25313
25777
|
}
|
|
25314
25778
|
writer.join();
|
|
25779
|
+
if (message.appId !== "") {
|
|
25780
|
+
writer.uint32(418).string(message.appId);
|
|
25781
|
+
}
|
|
25315
25782
|
return writer;
|
|
25316
25783
|
},
|
|
25317
25784
|
decode(input, length) {
|
|
@@ -25450,6 +25917,13 @@ var FunctionHandleMetadata = {
|
|
|
25450
25917
|
}
|
|
25451
25918
|
break;
|
|
25452
25919
|
}
|
|
25920
|
+
case 52: {
|
|
25921
|
+
if (tag !== 418) {
|
|
25922
|
+
break;
|
|
25923
|
+
}
|
|
25924
|
+
message.appId = reader.string();
|
|
25925
|
+
continue;
|
|
25926
|
+
}
|
|
25453
25927
|
}
|
|
25454
25928
|
if ((tag & 7) === 4 || tag === 0) {
|
|
25455
25929
|
break;
|
|
@@ -25481,7 +25955,8 @@ var FunctionHandleMetadata = {
|
|
|
25481
25955
|
maxObjectSizeBytes: isSet5(object.maxObjectSizeBytes) ? globalThis.Number(object.maxObjectSizeBytes) : void 0,
|
|
25482
25956
|
ExperimentalFlashUrls: globalThis.Array.isArray(object?.ExperimentalFlashUrls) ? object.ExperimentalFlashUrls.map((e) => globalThis.String(e)) : [],
|
|
25483
25957
|
supportedInputFormats: globalThis.Array.isArray(object?.supportedInputFormats) ? object.supportedInputFormats.map((e) => dataFormatFromJSON(e)) : [],
|
|
25484
|
-
supportedOutputFormats: globalThis.Array.isArray(object?.supportedOutputFormats) ? object.supportedOutputFormats.map((e) => dataFormatFromJSON(e)) : []
|
|
25958
|
+
supportedOutputFormats: globalThis.Array.isArray(object?.supportedOutputFormats) ? object.supportedOutputFormats.map((e) => dataFormatFromJSON(e)) : [],
|
|
25959
|
+
appId: isSet5(object.appId) ? globalThis.String(object.appId) : ""
|
|
25485
25960
|
};
|
|
25486
25961
|
},
|
|
25487
25962
|
toJSON(message) {
|
|
@@ -25540,6 +26015,9 @@ var FunctionHandleMetadata = {
|
|
|
25540
26015
|
if (message.supportedOutputFormats?.length) {
|
|
25541
26016
|
obj.supportedOutputFormats = message.supportedOutputFormats.map((e) => dataFormatToJSON(e));
|
|
25542
26017
|
}
|
|
26018
|
+
if (message.appId !== "") {
|
|
26019
|
+
obj.appId = message.appId;
|
|
26020
|
+
}
|
|
25543
26021
|
return obj;
|
|
25544
26022
|
},
|
|
25545
26023
|
create(base) {
|
|
@@ -25568,6 +26046,7 @@ var FunctionHandleMetadata = {
|
|
|
25568
26046
|
message.ExperimentalFlashUrls = object.ExperimentalFlashUrls?.map((e) => e) || [];
|
|
25569
26047
|
message.supportedInputFormats = object.supportedInputFormats?.map((e) => e) || [];
|
|
25570
26048
|
message.supportedOutputFormats = object.supportedOutputFormats?.map((e) => e) || [];
|
|
26049
|
+
message.appId = object.appId ?? "";
|
|
25571
26050
|
return message;
|
|
25572
26051
|
}
|
|
25573
26052
|
};
|
|
@@ -30225,7 +30704,7 @@ var ImageMetadata_PythonPackagesEntry = {
|
|
|
30225
30704
|
}
|
|
30226
30705
|
};
|
|
30227
30706
|
function createBaseImagePublishRequest() {
|
|
30228
|
-
return { imageId: "", tag: "", environmentName: "",
|
|
30707
|
+
return { imageId: "", tag: "", environmentName: "", allowPublic: false };
|
|
30229
30708
|
}
|
|
30230
30709
|
var ImagePublishRequest = {
|
|
30231
30710
|
encode(message, writer = new BinaryWriter()) {
|
|
@@ -30238,8 +30717,8 @@ var ImagePublishRequest = {
|
|
|
30238
30717
|
if (message.environmentName !== "") {
|
|
30239
30718
|
writer.uint32(26).string(message.environmentName);
|
|
30240
30719
|
}
|
|
30241
|
-
if (message.
|
|
30242
|
-
writer.uint32(32).bool(message.
|
|
30720
|
+
if (message.allowPublic !== false) {
|
|
30721
|
+
writer.uint32(32).bool(message.allowPublic);
|
|
30243
30722
|
}
|
|
30244
30723
|
return writer;
|
|
30245
30724
|
},
|
|
@@ -30275,7 +30754,7 @@ var ImagePublishRequest = {
|
|
|
30275
30754
|
if (tag !== 32) {
|
|
30276
30755
|
break;
|
|
30277
30756
|
}
|
|
30278
|
-
message.
|
|
30757
|
+
message.allowPublic = reader.bool();
|
|
30279
30758
|
continue;
|
|
30280
30759
|
}
|
|
30281
30760
|
}
|
|
@@ -30291,7 +30770,7 @@ var ImagePublishRequest = {
|
|
|
30291
30770
|
imageId: isSet5(object.imageId) ? globalThis.String(object.imageId) : "",
|
|
30292
30771
|
tag: isSet5(object.tag) ? globalThis.String(object.tag) : "",
|
|
30293
30772
|
environmentName: isSet5(object.environmentName) ? globalThis.String(object.environmentName) : "",
|
|
30294
|
-
|
|
30773
|
+
allowPublic: isSet5(object.allowPublic) ? globalThis.Boolean(object.allowPublic) : false
|
|
30295
30774
|
};
|
|
30296
30775
|
},
|
|
30297
30776
|
toJSON(message) {
|
|
@@ -30305,8 +30784,8 @@ var ImagePublishRequest = {
|
|
|
30305
30784
|
if (message.environmentName !== "") {
|
|
30306
30785
|
obj.environmentName = message.environmentName;
|
|
30307
30786
|
}
|
|
30308
|
-
if (message.
|
|
30309
|
-
obj.
|
|
30787
|
+
if (message.allowPublic !== false) {
|
|
30788
|
+
obj.allowPublic = message.allowPublic;
|
|
30310
30789
|
}
|
|
30311
30790
|
return obj;
|
|
30312
30791
|
},
|
|
@@ -30318,7 +30797,7 @@ var ImagePublishRequest = {
|
|
|
30318
30797
|
message.imageId = object.imageId ?? "";
|
|
30319
30798
|
message.tag = object.tag ?? "";
|
|
30320
30799
|
message.environmentName = object.environmentName ?? "";
|
|
30321
|
-
message.
|
|
30800
|
+
message.allowPublic = object.allowPublic ?? false;
|
|
30322
30801
|
return message;
|
|
30323
30802
|
}
|
|
30324
30803
|
};
|
|
@@ -31970,6 +32449,112 @@ var MethodDefinition = {
|
|
|
31970
32449
|
return message;
|
|
31971
32450
|
}
|
|
31972
32451
|
};
|
|
32452
|
+
function createBaseMountBatchedCheckExistenceRequest() {
|
|
32453
|
+
return { sha256HexHashes: [] };
|
|
32454
|
+
}
|
|
32455
|
+
var MountBatchedCheckExistenceRequest = {
|
|
32456
|
+
encode(message, writer = new BinaryWriter()) {
|
|
32457
|
+
for (const v of message.sha256HexHashes) {
|
|
32458
|
+
writer.uint32(10).string(v);
|
|
32459
|
+
}
|
|
32460
|
+
return writer;
|
|
32461
|
+
},
|
|
32462
|
+
decode(input, length) {
|
|
32463
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
32464
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
32465
|
+
const message = createBaseMountBatchedCheckExistenceRequest();
|
|
32466
|
+
while (reader.pos < end) {
|
|
32467
|
+
const tag = reader.uint32();
|
|
32468
|
+
switch (tag >>> 3) {
|
|
32469
|
+
case 1: {
|
|
32470
|
+
if (tag !== 10) {
|
|
32471
|
+
break;
|
|
32472
|
+
}
|
|
32473
|
+
message.sha256HexHashes.push(reader.string());
|
|
32474
|
+
continue;
|
|
32475
|
+
}
|
|
32476
|
+
}
|
|
32477
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
32478
|
+
break;
|
|
32479
|
+
}
|
|
32480
|
+
reader.skip(tag & 7);
|
|
32481
|
+
}
|
|
32482
|
+
return message;
|
|
32483
|
+
},
|
|
32484
|
+
fromJSON(object) {
|
|
32485
|
+
return {
|
|
32486
|
+
sha256HexHashes: globalThis.Array.isArray(object?.sha256HexHashes) ? object.sha256HexHashes.map((e) => globalThis.String(e)) : []
|
|
32487
|
+
};
|
|
32488
|
+
},
|
|
32489
|
+
toJSON(message) {
|
|
32490
|
+
const obj = {};
|
|
32491
|
+
if (message.sha256HexHashes?.length) {
|
|
32492
|
+
obj.sha256HexHashes = message.sha256HexHashes;
|
|
32493
|
+
}
|
|
32494
|
+
return obj;
|
|
32495
|
+
},
|
|
32496
|
+
create(base) {
|
|
32497
|
+
return MountBatchedCheckExistenceRequest.fromPartial(base ?? {});
|
|
32498
|
+
},
|
|
32499
|
+
fromPartial(object) {
|
|
32500
|
+
const message = createBaseMountBatchedCheckExistenceRequest();
|
|
32501
|
+
message.sha256HexHashes = object.sha256HexHashes?.map((e) => e) || [];
|
|
32502
|
+
return message;
|
|
32503
|
+
}
|
|
32504
|
+
};
|
|
32505
|
+
function createBaseMountBatchedCheckExistenceResponse() {
|
|
32506
|
+
return { missingSha256HexHashes: [] };
|
|
32507
|
+
}
|
|
32508
|
+
var MountBatchedCheckExistenceResponse = {
|
|
32509
|
+
encode(message, writer = new BinaryWriter()) {
|
|
32510
|
+
for (const v of message.missingSha256HexHashes) {
|
|
32511
|
+
writer.uint32(10).string(v);
|
|
32512
|
+
}
|
|
32513
|
+
return writer;
|
|
32514
|
+
},
|
|
32515
|
+
decode(input, length) {
|
|
32516
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
32517
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
32518
|
+
const message = createBaseMountBatchedCheckExistenceResponse();
|
|
32519
|
+
while (reader.pos < end) {
|
|
32520
|
+
const tag = reader.uint32();
|
|
32521
|
+
switch (tag >>> 3) {
|
|
32522
|
+
case 1: {
|
|
32523
|
+
if (tag !== 10) {
|
|
32524
|
+
break;
|
|
32525
|
+
}
|
|
32526
|
+
message.missingSha256HexHashes.push(reader.string());
|
|
32527
|
+
continue;
|
|
32528
|
+
}
|
|
32529
|
+
}
|
|
32530
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
32531
|
+
break;
|
|
32532
|
+
}
|
|
32533
|
+
reader.skip(tag & 7);
|
|
32534
|
+
}
|
|
32535
|
+
return message;
|
|
32536
|
+
},
|
|
32537
|
+
fromJSON(object) {
|
|
32538
|
+
return {
|
|
32539
|
+
missingSha256HexHashes: globalThis.Array.isArray(object?.missingSha256HexHashes) ? object.missingSha256HexHashes.map((e) => globalThis.String(e)) : []
|
|
32540
|
+
};
|
|
32541
|
+
},
|
|
32542
|
+
toJSON(message) {
|
|
32543
|
+
const obj = {};
|
|
32544
|
+
if (message.missingSha256HexHashes?.length) {
|
|
32545
|
+
obj.missingSha256HexHashes = message.missingSha256HexHashes;
|
|
32546
|
+
}
|
|
32547
|
+
return obj;
|
|
32548
|
+
},
|
|
32549
|
+
create(base) {
|
|
32550
|
+
return MountBatchedCheckExistenceResponse.fromPartial(base ?? {});
|
|
32551
|
+
},
|
|
32552
|
+
fromPartial(object) {
|
|
32553
|
+
const message = createBaseMountBatchedCheckExistenceResponse();
|
|
32554
|
+
message.missingSha256HexHashes = object.missingSha256HexHashes?.map((e) => e) || [];
|
|
32555
|
+
return message;
|
|
32556
|
+
}
|
|
32557
|
+
};
|
|
31973
32558
|
function createBaseMountFile() {
|
|
31974
32559
|
return { filename: "", sha256Hex: "", size: void 0, mode: void 0 };
|
|
31975
32560
|
}
|
|
@@ -38307,7 +38892,7 @@ var SandboxCreateResponse = {
|
|
|
38307
38892
|
}
|
|
38308
38893
|
};
|
|
38309
38894
|
function createBaseSandboxCreateV2Request() {
|
|
38310
|
-
return { appId: "", definition: void 0, ephemeralSecrets: void 0 };
|
|
38895
|
+
return { appId: "", definition: void 0, ephemeralSecrets: void 0, tags: [] };
|
|
38311
38896
|
}
|
|
38312
38897
|
var SandboxCreateV2Request = {
|
|
38313
38898
|
encode(message, writer = new BinaryWriter()) {
|
|
@@ -38320,6 +38905,9 @@ var SandboxCreateV2Request = {
|
|
|
38320
38905
|
if (message.ephemeralSecrets !== void 0) {
|
|
38321
38906
|
StringMap.encode(message.ephemeralSecrets, writer.uint32(26).fork()).join();
|
|
38322
38907
|
}
|
|
38908
|
+
for (const v of message.tags) {
|
|
38909
|
+
SandboxTag.encode(v, writer.uint32(34).fork()).join();
|
|
38910
|
+
}
|
|
38323
38911
|
return writer;
|
|
38324
38912
|
},
|
|
38325
38913
|
decode(input, length) {
|
|
@@ -38350,6 +38938,13 @@ var SandboxCreateV2Request = {
|
|
|
38350
38938
|
message.ephemeralSecrets = StringMap.decode(reader, reader.uint32());
|
|
38351
38939
|
continue;
|
|
38352
38940
|
}
|
|
38941
|
+
case 4: {
|
|
38942
|
+
if (tag !== 34) {
|
|
38943
|
+
break;
|
|
38944
|
+
}
|
|
38945
|
+
message.tags.push(SandboxTag.decode(reader, reader.uint32()));
|
|
38946
|
+
continue;
|
|
38947
|
+
}
|
|
38353
38948
|
}
|
|
38354
38949
|
if ((tag & 7) === 4 || tag === 0) {
|
|
38355
38950
|
break;
|
|
@@ -38362,7 +38957,8 @@ var SandboxCreateV2Request = {
|
|
|
38362
38957
|
return {
|
|
38363
38958
|
appId: isSet5(object.appId) ? globalThis.String(object.appId) : "",
|
|
38364
38959
|
definition: isSet5(object.definition) ? Sandbox.fromJSON(object.definition) : void 0,
|
|
38365
|
-
ephemeralSecrets: isSet5(object.ephemeralSecrets) ? StringMap.fromJSON(object.ephemeralSecrets) : void 0
|
|
38960
|
+
ephemeralSecrets: isSet5(object.ephemeralSecrets) ? StringMap.fromJSON(object.ephemeralSecrets) : void 0,
|
|
38961
|
+
tags: globalThis.Array.isArray(object?.tags) ? object.tags.map((e) => SandboxTag.fromJSON(e)) : []
|
|
38366
38962
|
};
|
|
38367
38963
|
},
|
|
38368
38964
|
toJSON(message) {
|
|
@@ -38376,6 +38972,9 @@ var SandboxCreateV2Request = {
|
|
|
38376
38972
|
if (message.ephemeralSecrets !== void 0) {
|
|
38377
38973
|
obj.ephemeralSecrets = StringMap.toJSON(message.ephemeralSecrets);
|
|
38378
38974
|
}
|
|
38975
|
+
if (message.tags?.length) {
|
|
38976
|
+
obj.tags = message.tags.map((e) => SandboxTag.toJSON(e));
|
|
38977
|
+
}
|
|
38379
38978
|
return obj;
|
|
38380
38979
|
},
|
|
38381
38980
|
create(base) {
|
|
@@ -38386,6 +38985,7 @@ var SandboxCreateV2Request = {
|
|
|
38386
38985
|
message.appId = object.appId ?? "";
|
|
38387
38986
|
message.definition = object.definition !== void 0 && object.definition !== null ? Sandbox.fromPartial(object.definition) : void 0;
|
|
38388
38987
|
message.ephemeralSecrets = object.ephemeralSecrets !== void 0 && object.ephemeralSecrets !== null ? StringMap.fromPartial(object.ephemeralSecrets) : void 0;
|
|
38988
|
+
message.tags = object.tags?.map((e) => SandboxTag.fromPartial(e)) || [];
|
|
38389
38989
|
return message;
|
|
38390
38990
|
}
|
|
38391
38991
|
};
|
|
@@ -38473,13 +39073,16 @@ var SandboxCreateV2Response = {
|
|
|
38473
39073
|
}
|
|
38474
39074
|
};
|
|
38475
39075
|
function createBaseSandboxGetCommandRouterAccessRequest() {
|
|
38476
|
-
return { sandboxId:
|
|
39076
|
+
return { sandboxId: void 0, taskId: void 0 };
|
|
38477
39077
|
}
|
|
38478
39078
|
var SandboxGetCommandRouterAccessRequest = {
|
|
38479
39079
|
encode(message, writer = new BinaryWriter()) {
|
|
38480
|
-
if (message.sandboxId !==
|
|
39080
|
+
if (message.sandboxId !== void 0) {
|
|
38481
39081
|
writer.uint32(10).string(message.sandboxId);
|
|
38482
39082
|
}
|
|
39083
|
+
if (message.taskId !== void 0) {
|
|
39084
|
+
writer.uint32(18).string(message.taskId);
|
|
39085
|
+
}
|
|
38483
39086
|
return writer;
|
|
38484
39087
|
},
|
|
38485
39088
|
decode(input, length) {
|
|
@@ -38496,6 +39099,13 @@ var SandboxGetCommandRouterAccessRequest = {
|
|
|
38496
39099
|
message.sandboxId = reader.string();
|
|
38497
39100
|
continue;
|
|
38498
39101
|
}
|
|
39102
|
+
case 2: {
|
|
39103
|
+
if (tag !== 18) {
|
|
39104
|
+
break;
|
|
39105
|
+
}
|
|
39106
|
+
message.taskId = reader.string();
|
|
39107
|
+
continue;
|
|
39108
|
+
}
|
|
38499
39109
|
}
|
|
38500
39110
|
if ((tag & 7) === 4 || tag === 0) {
|
|
38501
39111
|
break;
|
|
@@ -38505,13 +39115,19 @@ var SandboxGetCommandRouterAccessRequest = {
|
|
|
38505
39115
|
return message;
|
|
38506
39116
|
},
|
|
38507
39117
|
fromJSON(object) {
|
|
38508
|
-
return {
|
|
39118
|
+
return {
|
|
39119
|
+
sandboxId: isSet5(object.sandboxId) ? globalThis.String(object.sandboxId) : void 0,
|
|
39120
|
+
taskId: isSet5(object.taskId) ? globalThis.String(object.taskId) : void 0
|
|
39121
|
+
};
|
|
38509
39122
|
},
|
|
38510
39123
|
toJSON(message) {
|
|
38511
39124
|
const obj = {};
|
|
38512
|
-
if (message.sandboxId !==
|
|
39125
|
+
if (message.sandboxId !== void 0) {
|
|
38513
39126
|
obj.sandboxId = message.sandboxId;
|
|
38514
39127
|
}
|
|
39128
|
+
if (message.taskId !== void 0) {
|
|
39129
|
+
obj.taskId = message.taskId;
|
|
39130
|
+
}
|
|
38515
39131
|
return obj;
|
|
38516
39132
|
},
|
|
38517
39133
|
create(base) {
|
|
@@ -38519,7 +39135,8 @@ var SandboxGetCommandRouterAccessRequest = {
|
|
|
38519
39135
|
},
|
|
38520
39136
|
fromPartial(object) {
|
|
38521
39137
|
const message = createBaseSandboxGetCommandRouterAccessRequest();
|
|
38522
|
-
message.sandboxId = object.sandboxId ??
|
|
39138
|
+
message.sandboxId = object.sandboxId ?? void 0;
|
|
39139
|
+
message.taskId = object.taskId ?? void 0;
|
|
38523
39140
|
return message;
|
|
38524
39141
|
}
|
|
38525
39142
|
};
|
|
@@ -44070,7 +44687,7 @@ var SystemErrorMessage = {
|
|
|
44070
44687
|
}
|
|
44071
44688
|
};
|
|
44072
44689
|
function createBaseTaskClusterHelloRequest() {
|
|
44073
|
-
return { taskId: "", containerIp: "", imexHostIp: "" };
|
|
44690
|
+
return { taskId: "", containerIp: "", imexHostIp: "", imexFabricId: "" };
|
|
44074
44691
|
}
|
|
44075
44692
|
var TaskClusterHelloRequest = {
|
|
44076
44693
|
encode(message, writer = new BinaryWriter()) {
|
|
@@ -44083,6 +44700,9 @@ var TaskClusterHelloRequest = {
|
|
|
44083
44700
|
if (message.imexHostIp !== "") {
|
|
44084
44701
|
writer.uint32(26).string(message.imexHostIp);
|
|
44085
44702
|
}
|
|
44703
|
+
if (message.imexFabricId !== "") {
|
|
44704
|
+
writer.uint32(34).string(message.imexFabricId);
|
|
44705
|
+
}
|
|
44086
44706
|
return writer;
|
|
44087
44707
|
},
|
|
44088
44708
|
decode(input, length) {
|
|
@@ -44113,6 +44733,13 @@ var TaskClusterHelloRequest = {
|
|
|
44113
44733
|
message.imexHostIp = reader.string();
|
|
44114
44734
|
continue;
|
|
44115
44735
|
}
|
|
44736
|
+
case 4: {
|
|
44737
|
+
if (tag !== 34) {
|
|
44738
|
+
break;
|
|
44739
|
+
}
|
|
44740
|
+
message.imexFabricId = reader.string();
|
|
44741
|
+
continue;
|
|
44742
|
+
}
|
|
44116
44743
|
}
|
|
44117
44744
|
if ((tag & 7) === 4 || tag === 0) {
|
|
44118
44745
|
break;
|
|
@@ -44125,7 +44752,8 @@ var TaskClusterHelloRequest = {
|
|
|
44125
44752
|
return {
|
|
44126
44753
|
taskId: isSet5(object.taskId) ? globalThis.String(object.taskId) : "",
|
|
44127
44754
|
containerIp: isSet5(object.containerIp) ? globalThis.String(object.containerIp) : "",
|
|
44128
|
-
imexHostIp: isSet5(object.imexHostIp) ? globalThis.String(object.imexHostIp) : ""
|
|
44755
|
+
imexHostIp: isSet5(object.imexHostIp) ? globalThis.String(object.imexHostIp) : "",
|
|
44756
|
+
imexFabricId: isSet5(object.imexFabricId) ? globalThis.String(object.imexFabricId) : ""
|
|
44129
44757
|
};
|
|
44130
44758
|
},
|
|
44131
44759
|
toJSON(message) {
|
|
@@ -44139,6 +44767,9 @@ var TaskClusterHelloRequest = {
|
|
|
44139
44767
|
if (message.imexHostIp !== "") {
|
|
44140
44768
|
obj.imexHostIp = message.imexHostIp;
|
|
44141
44769
|
}
|
|
44770
|
+
if (message.imexFabricId !== "") {
|
|
44771
|
+
obj.imexFabricId = message.imexFabricId;
|
|
44772
|
+
}
|
|
44142
44773
|
return obj;
|
|
44143
44774
|
},
|
|
44144
44775
|
create(base) {
|
|
@@ -44149,6 +44780,7 @@ var TaskClusterHelloRequest = {
|
|
|
44149
44780
|
message.taskId = object.taskId ?? "";
|
|
44150
44781
|
message.containerIp = object.containerIp ?? "";
|
|
44151
44782
|
message.imexHostIp = object.imexHostIp ?? "";
|
|
44783
|
+
message.imexFabricId = object.imexFabricId ?? "";
|
|
44152
44784
|
return message;
|
|
44153
44785
|
}
|
|
44154
44786
|
};
|
|
@@ -47337,6 +47969,147 @@ var VolumeCopyFilesRequest = {
|
|
|
47337
47969
|
return message;
|
|
47338
47970
|
}
|
|
47339
47971
|
};
|
|
47972
|
+
function createBaseVolumeCreateOptions() {
|
|
47973
|
+
return { experimentalOptions: {} };
|
|
47974
|
+
}
|
|
47975
|
+
var VolumeCreateOptions = {
|
|
47976
|
+
encode(message, writer = new BinaryWriter()) {
|
|
47977
|
+
Object.entries(message.experimentalOptions).forEach(([key, value]) => {
|
|
47978
|
+
VolumeCreateOptions_ExperimentalOptionsEntry.encode({ key, value }, writer.uint32(10).fork()).join();
|
|
47979
|
+
});
|
|
47980
|
+
return writer;
|
|
47981
|
+
},
|
|
47982
|
+
decode(input, length) {
|
|
47983
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
47984
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
47985
|
+
const message = createBaseVolumeCreateOptions();
|
|
47986
|
+
while (reader.pos < end) {
|
|
47987
|
+
const tag = reader.uint32();
|
|
47988
|
+
switch (tag >>> 3) {
|
|
47989
|
+
case 1: {
|
|
47990
|
+
if (tag !== 10) {
|
|
47991
|
+
break;
|
|
47992
|
+
}
|
|
47993
|
+
const entry1 = VolumeCreateOptions_ExperimentalOptionsEntry.decode(reader, reader.uint32());
|
|
47994
|
+
if (entry1.value !== void 0) {
|
|
47995
|
+
message.experimentalOptions[entry1.key] = entry1.value;
|
|
47996
|
+
}
|
|
47997
|
+
continue;
|
|
47998
|
+
}
|
|
47999
|
+
}
|
|
48000
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
48001
|
+
break;
|
|
48002
|
+
}
|
|
48003
|
+
reader.skip(tag & 7);
|
|
48004
|
+
}
|
|
48005
|
+
return message;
|
|
48006
|
+
},
|
|
48007
|
+
fromJSON(object) {
|
|
48008
|
+
return {
|
|
48009
|
+
experimentalOptions: isObject2(object.experimentalOptions) ? Object.entries(object.experimentalOptions).reduce((acc, [key, value]) => {
|
|
48010
|
+
acc[key] = String(value);
|
|
48011
|
+
return acc;
|
|
48012
|
+
}, {}) : {}
|
|
48013
|
+
};
|
|
48014
|
+
},
|
|
48015
|
+
toJSON(message) {
|
|
48016
|
+
const obj = {};
|
|
48017
|
+
if (message.experimentalOptions) {
|
|
48018
|
+
const entries = Object.entries(message.experimentalOptions);
|
|
48019
|
+
if (entries.length > 0) {
|
|
48020
|
+
obj.experimentalOptions = {};
|
|
48021
|
+
entries.forEach(([k, v]) => {
|
|
48022
|
+
obj.experimentalOptions[k] = v;
|
|
48023
|
+
});
|
|
48024
|
+
}
|
|
48025
|
+
}
|
|
48026
|
+
return obj;
|
|
48027
|
+
},
|
|
48028
|
+
create(base) {
|
|
48029
|
+
return VolumeCreateOptions.fromPartial(base ?? {});
|
|
48030
|
+
},
|
|
48031
|
+
fromPartial(object) {
|
|
48032
|
+
const message = createBaseVolumeCreateOptions();
|
|
48033
|
+
message.experimentalOptions = Object.entries(object.experimentalOptions ?? {}).reduce(
|
|
48034
|
+
(acc, [key, value]) => {
|
|
48035
|
+
if (value !== void 0) {
|
|
48036
|
+
acc[key] = globalThis.String(value);
|
|
48037
|
+
}
|
|
48038
|
+
return acc;
|
|
48039
|
+
},
|
|
48040
|
+
{}
|
|
48041
|
+
);
|
|
48042
|
+
return message;
|
|
48043
|
+
}
|
|
48044
|
+
};
|
|
48045
|
+
function createBaseVolumeCreateOptions_ExperimentalOptionsEntry() {
|
|
48046
|
+
return { key: "", value: "" };
|
|
48047
|
+
}
|
|
48048
|
+
var VolumeCreateOptions_ExperimentalOptionsEntry = {
|
|
48049
|
+
encode(message, writer = new BinaryWriter()) {
|
|
48050
|
+
if (message.key !== "") {
|
|
48051
|
+
writer.uint32(10).string(message.key);
|
|
48052
|
+
}
|
|
48053
|
+
if (message.value !== "") {
|
|
48054
|
+
writer.uint32(18).string(message.value);
|
|
48055
|
+
}
|
|
48056
|
+
return writer;
|
|
48057
|
+
},
|
|
48058
|
+
decode(input, length) {
|
|
48059
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
48060
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
48061
|
+
const message = createBaseVolumeCreateOptions_ExperimentalOptionsEntry();
|
|
48062
|
+
while (reader.pos < end) {
|
|
48063
|
+
const tag = reader.uint32();
|
|
48064
|
+
switch (tag >>> 3) {
|
|
48065
|
+
case 1: {
|
|
48066
|
+
if (tag !== 10) {
|
|
48067
|
+
break;
|
|
48068
|
+
}
|
|
48069
|
+
message.key = reader.string();
|
|
48070
|
+
continue;
|
|
48071
|
+
}
|
|
48072
|
+
case 2: {
|
|
48073
|
+
if (tag !== 18) {
|
|
48074
|
+
break;
|
|
48075
|
+
}
|
|
48076
|
+
message.value = reader.string();
|
|
48077
|
+
continue;
|
|
48078
|
+
}
|
|
48079
|
+
}
|
|
48080
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
48081
|
+
break;
|
|
48082
|
+
}
|
|
48083
|
+
reader.skip(tag & 7);
|
|
48084
|
+
}
|
|
48085
|
+
return message;
|
|
48086
|
+
},
|
|
48087
|
+
fromJSON(object) {
|
|
48088
|
+
return {
|
|
48089
|
+
key: isSet5(object.key) ? globalThis.String(object.key) : "",
|
|
48090
|
+
value: isSet5(object.value) ? globalThis.String(object.value) : ""
|
|
48091
|
+
};
|
|
48092
|
+
},
|
|
48093
|
+
toJSON(message) {
|
|
48094
|
+
const obj = {};
|
|
48095
|
+
if (message.key !== "") {
|
|
48096
|
+
obj.key = message.key;
|
|
48097
|
+
}
|
|
48098
|
+
if (message.value !== "") {
|
|
48099
|
+
obj.value = message.value;
|
|
48100
|
+
}
|
|
48101
|
+
return obj;
|
|
48102
|
+
},
|
|
48103
|
+
create(base) {
|
|
48104
|
+
return VolumeCreateOptions_ExperimentalOptionsEntry.fromPartial(base ?? {});
|
|
48105
|
+
},
|
|
48106
|
+
fromPartial(object) {
|
|
48107
|
+
const message = createBaseVolumeCreateOptions_ExperimentalOptionsEntry();
|
|
48108
|
+
message.key = object.key ?? "";
|
|
48109
|
+
message.value = object.value ?? "";
|
|
48110
|
+
return message;
|
|
48111
|
+
}
|
|
48112
|
+
};
|
|
47340
48113
|
function createBaseVolumeDeleteRequest() {
|
|
47341
48114
|
return { volumeId: "", environmentName: "" };
|
|
47342
48115
|
}
|
|
@@ -47932,7 +48705,14 @@ var VolumeGetFileResponse = {
|
|
|
47932
48705
|
}
|
|
47933
48706
|
};
|
|
47934
48707
|
function createBaseVolumeGetOrCreateRequest() {
|
|
47935
|
-
return {
|
|
48708
|
+
return {
|
|
48709
|
+
deploymentName: "",
|
|
48710
|
+
environmentName: "",
|
|
48711
|
+
objectCreationType: 0,
|
|
48712
|
+
appId: "",
|
|
48713
|
+
version: 0,
|
|
48714
|
+
createOptions: void 0
|
|
48715
|
+
};
|
|
47936
48716
|
}
|
|
47937
48717
|
var VolumeGetOrCreateRequest = {
|
|
47938
48718
|
encode(message, writer = new BinaryWriter()) {
|
|
@@ -47951,6 +48731,9 @@ var VolumeGetOrCreateRequest = {
|
|
|
47951
48731
|
if (message.version !== 0) {
|
|
47952
48732
|
writer.uint32(48).int32(message.version);
|
|
47953
48733
|
}
|
|
48734
|
+
if (message.createOptions !== void 0) {
|
|
48735
|
+
VolumeCreateOptions.encode(message.createOptions, writer.uint32(58).fork()).join();
|
|
48736
|
+
}
|
|
47954
48737
|
return writer;
|
|
47955
48738
|
},
|
|
47956
48739
|
decode(input, length) {
|
|
@@ -47995,6 +48778,13 @@ var VolumeGetOrCreateRequest = {
|
|
|
47995
48778
|
message.version = reader.int32();
|
|
47996
48779
|
continue;
|
|
47997
48780
|
}
|
|
48781
|
+
case 7: {
|
|
48782
|
+
if (tag !== 58) {
|
|
48783
|
+
break;
|
|
48784
|
+
}
|
|
48785
|
+
message.createOptions = VolumeCreateOptions.decode(reader, reader.uint32());
|
|
48786
|
+
continue;
|
|
48787
|
+
}
|
|
47998
48788
|
}
|
|
47999
48789
|
if ((tag & 7) === 4 || tag === 0) {
|
|
48000
48790
|
break;
|
|
@@ -48009,7 +48799,8 @@ var VolumeGetOrCreateRequest = {
|
|
|
48009
48799
|
environmentName: isSet5(object.environmentName) ? globalThis.String(object.environmentName) : "",
|
|
48010
48800
|
objectCreationType: isSet5(object.objectCreationType) ? objectCreationTypeFromJSON(object.objectCreationType) : 0,
|
|
48011
48801
|
appId: isSet5(object.appId) ? globalThis.String(object.appId) : "",
|
|
48012
|
-
version: isSet5(object.version) ? volumeFsVersionFromJSON(object.version) : 0
|
|
48802
|
+
version: isSet5(object.version) ? volumeFsVersionFromJSON(object.version) : 0,
|
|
48803
|
+
createOptions: isSet5(object.createOptions) ? VolumeCreateOptions.fromJSON(object.createOptions) : void 0
|
|
48013
48804
|
};
|
|
48014
48805
|
},
|
|
48015
48806
|
toJSON(message) {
|
|
@@ -48029,6 +48820,9 @@ var VolumeGetOrCreateRequest = {
|
|
|
48029
48820
|
if (message.version !== 0) {
|
|
48030
48821
|
obj.version = volumeFsVersionToJSON(message.version);
|
|
48031
48822
|
}
|
|
48823
|
+
if (message.createOptions !== void 0) {
|
|
48824
|
+
obj.createOptions = VolumeCreateOptions.toJSON(message.createOptions);
|
|
48825
|
+
}
|
|
48032
48826
|
return obj;
|
|
48033
48827
|
},
|
|
48034
48828
|
create(base) {
|
|
@@ -48041,6 +48835,7 @@ var VolumeGetOrCreateRequest = {
|
|
|
48041
48835
|
message.objectCreationType = object.objectCreationType ?? 0;
|
|
48042
48836
|
message.appId = object.appId ?? "";
|
|
48043
48837
|
message.version = object.version ?? 0;
|
|
48838
|
+
message.createOptions = object.createOptions !== void 0 && object.createOptions !== null ? VolumeCreateOptions.fromPartial(object.createOptions) : void 0;
|
|
48044
48839
|
return message;
|
|
48045
48840
|
}
|
|
48046
48841
|
};
|
|
@@ -50499,7 +51294,6 @@ function createBaseWorkspaceBillingReportItem() {
|
|
|
50499
51294
|
interval: void 0,
|
|
50500
51295
|
cost: "",
|
|
50501
51296
|
tags: {},
|
|
50502
|
-
costByResourceFloat: {},
|
|
50503
51297
|
costByResource: {}
|
|
50504
51298
|
};
|
|
50505
51299
|
}
|
|
@@ -50523,9 +51317,6 @@ var WorkspaceBillingReportItem = {
|
|
|
50523
51317
|
Object.entries(message.tags).forEach(([key, value]) => {
|
|
50524
51318
|
WorkspaceBillingReportItem_TagsEntry.encode({ key, value }, writer.uint32(50).fork()).join();
|
|
50525
51319
|
});
|
|
50526
|
-
Object.entries(message.costByResourceFloat).forEach(([key, value]) => {
|
|
50527
|
-
WorkspaceBillingReportItem_CostByResourceFloatEntry.encode({ key, value }, writer.uint32(58).fork()).join();
|
|
50528
|
-
});
|
|
50529
51320
|
Object.entries(message.costByResource).forEach(([key, value]) => {
|
|
50530
51321
|
WorkspaceBillingReportItem_CostByResourceEntry.encode({ key, value }, writer.uint32(66).fork()).join();
|
|
50531
51322
|
});
|
|
@@ -50583,16 +51374,6 @@ var WorkspaceBillingReportItem = {
|
|
|
50583
51374
|
}
|
|
50584
51375
|
continue;
|
|
50585
51376
|
}
|
|
50586
|
-
case 7: {
|
|
50587
|
-
if (tag !== 58) {
|
|
50588
|
-
break;
|
|
50589
|
-
}
|
|
50590
|
-
const entry7 = WorkspaceBillingReportItem_CostByResourceFloatEntry.decode(reader, reader.uint32());
|
|
50591
|
-
if (entry7.value !== void 0) {
|
|
50592
|
-
message.costByResourceFloat[entry7.key] = entry7.value;
|
|
50593
|
-
}
|
|
50594
|
-
continue;
|
|
50595
|
-
}
|
|
50596
51377
|
case 8: {
|
|
50597
51378
|
if (tag !== 66) {
|
|
50598
51379
|
break;
|
|
@@ -50622,10 +51403,6 @@ var WorkspaceBillingReportItem = {
|
|
|
50622
51403
|
acc[key] = String(value);
|
|
50623
51404
|
return acc;
|
|
50624
51405
|
}, {}) : {},
|
|
50625
|
-
costByResourceFloat: isObject2(object.costByResourceFloat) ? Object.entries(object.costByResourceFloat).reduce((acc, [key, value]) => {
|
|
50626
|
-
acc[key] = Number(value);
|
|
50627
|
-
return acc;
|
|
50628
|
-
}, {}) : {},
|
|
50629
51406
|
costByResource: isObject2(object.costByResource) ? Object.entries(object.costByResource).reduce((acc, [key, value]) => {
|
|
50630
51407
|
acc[key] = String(value);
|
|
50631
51408
|
return acc;
|
|
@@ -50658,15 +51435,6 @@ var WorkspaceBillingReportItem = {
|
|
|
50658
51435
|
});
|
|
50659
51436
|
}
|
|
50660
51437
|
}
|
|
50661
|
-
if (message.costByResourceFloat) {
|
|
50662
|
-
const entries = Object.entries(message.costByResourceFloat);
|
|
50663
|
-
if (entries.length > 0) {
|
|
50664
|
-
obj.costByResourceFloat = {};
|
|
50665
|
-
entries.forEach(([k, v]) => {
|
|
50666
|
-
obj.costByResourceFloat[k] = v;
|
|
50667
|
-
});
|
|
50668
|
-
}
|
|
50669
|
-
}
|
|
50670
51438
|
if (message.costByResource) {
|
|
50671
51439
|
const entries = Object.entries(message.costByResource);
|
|
50672
51440
|
if (entries.length > 0) {
|
|
@@ -50694,15 +51462,6 @@ var WorkspaceBillingReportItem = {
|
|
|
50694
51462
|
}
|
|
50695
51463
|
return acc;
|
|
50696
51464
|
}, {});
|
|
50697
|
-
message.costByResourceFloat = Object.entries(object.costByResourceFloat ?? {}).reduce(
|
|
50698
|
-
(acc, [key, value]) => {
|
|
50699
|
-
if (value !== void 0) {
|
|
50700
|
-
acc[key] = globalThis.Number(value);
|
|
50701
|
-
}
|
|
50702
|
-
return acc;
|
|
50703
|
-
},
|
|
50704
|
-
{}
|
|
50705
|
-
);
|
|
50706
51465
|
message.costByResource = Object.entries(object.costByResource ?? {}).reduce(
|
|
50707
51466
|
(acc, [key, value]) => {
|
|
50708
51467
|
if (value !== void 0) {
|
|
@@ -50783,74 +51542,6 @@ var WorkspaceBillingReportItem_TagsEntry = {
|
|
|
50783
51542
|
return message;
|
|
50784
51543
|
}
|
|
50785
51544
|
};
|
|
50786
|
-
function createBaseWorkspaceBillingReportItem_CostByResourceFloatEntry() {
|
|
50787
|
-
return { key: "", value: 0 };
|
|
50788
|
-
}
|
|
50789
|
-
var WorkspaceBillingReportItem_CostByResourceFloatEntry = {
|
|
50790
|
-
encode(message, writer = new BinaryWriter()) {
|
|
50791
|
-
if (message.key !== "") {
|
|
50792
|
-
writer.uint32(10).string(message.key);
|
|
50793
|
-
}
|
|
50794
|
-
if (message.value !== 0) {
|
|
50795
|
-
writer.uint32(17).double(message.value);
|
|
50796
|
-
}
|
|
50797
|
-
return writer;
|
|
50798
|
-
},
|
|
50799
|
-
decode(input, length) {
|
|
50800
|
-
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
50801
|
-
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
50802
|
-
const message = createBaseWorkspaceBillingReportItem_CostByResourceFloatEntry();
|
|
50803
|
-
while (reader.pos < end) {
|
|
50804
|
-
const tag = reader.uint32();
|
|
50805
|
-
switch (tag >>> 3) {
|
|
50806
|
-
case 1: {
|
|
50807
|
-
if (tag !== 10) {
|
|
50808
|
-
break;
|
|
50809
|
-
}
|
|
50810
|
-
message.key = reader.string();
|
|
50811
|
-
continue;
|
|
50812
|
-
}
|
|
50813
|
-
case 2: {
|
|
50814
|
-
if (tag !== 17) {
|
|
50815
|
-
break;
|
|
50816
|
-
}
|
|
50817
|
-
message.value = reader.double();
|
|
50818
|
-
continue;
|
|
50819
|
-
}
|
|
50820
|
-
}
|
|
50821
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
50822
|
-
break;
|
|
50823
|
-
}
|
|
50824
|
-
reader.skip(tag & 7);
|
|
50825
|
-
}
|
|
50826
|
-
return message;
|
|
50827
|
-
},
|
|
50828
|
-
fromJSON(object) {
|
|
50829
|
-
return {
|
|
50830
|
-
key: isSet5(object.key) ? globalThis.String(object.key) : "",
|
|
50831
|
-
value: isSet5(object.value) ? globalThis.Number(object.value) : 0
|
|
50832
|
-
};
|
|
50833
|
-
},
|
|
50834
|
-
toJSON(message) {
|
|
50835
|
-
const obj = {};
|
|
50836
|
-
if (message.key !== "") {
|
|
50837
|
-
obj.key = message.key;
|
|
50838
|
-
}
|
|
50839
|
-
if (message.value !== 0) {
|
|
50840
|
-
obj.value = message.value;
|
|
50841
|
-
}
|
|
50842
|
-
return obj;
|
|
50843
|
-
},
|
|
50844
|
-
create(base) {
|
|
50845
|
-
return WorkspaceBillingReportItem_CostByResourceFloatEntry.fromPartial(base ?? {});
|
|
50846
|
-
},
|
|
50847
|
-
fromPartial(object) {
|
|
50848
|
-
const message = createBaseWorkspaceBillingReportItem_CostByResourceFloatEntry();
|
|
50849
|
-
message.key = object.key ?? "";
|
|
50850
|
-
message.value = object.value ?? 0;
|
|
50851
|
-
return message;
|
|
50852
|
-
}
|
|
50853
|
-
};
|
|
50854
51545
|
function createBaseWorkspaceBillingReportItem_CostByResourceEntry() {
|
|
50855
51546
|
return { key: "", value: "" };
|
|
50856
51547
|
}
|
|
@@ -51054,6 +51745,348 @@ var WorkspaceBillingReportRequest = {
|
|
|
51054
51745
|
return message;
|
|
51055
51746
|
}
|
|
51056
51747
|
};
|
|
51748
|
+
function createBaseWorkspaceBillingSummaryRequest() {
|
|
51749
|
+
return { startTimestamp: void 0, endTimestamp: void 0 };
|
|
51750
|
+
}
|
|
51751
|
+
var WorkspaceBillingSummaryRequest = {
|
|
51752
|
+
encode(message, writer = new BinaryWriter()) {
|
|
51753
|
+
if (message.startTimestamp !== void 0) {
|
|
51754
|
+
Timestamp.encode(toTimestamp(message.startTimestamp), writer.uint32(10).fork()).join();
|
|
51755
|
+
}
|
|
51756
|
+
if (message.endTimestamp !== void 0) {
|
|
51757
|
+
Timestamp.encode(toTimestamp(message.endTimestamp), writer.uint32(18).fork()).join();
|
|
51758
|
+
}
|
|
51759
|
+
return writer;
|
|
51760
|
+
},
|
|
51761
|
+
decode(input, length) {
|
|
51762
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
51763
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
51764
|
+
const message = createBaseWorkspaceBillingSummaryRequest();
|
|
51765
|
+
while (reader.pos < end) {
|
|
51766
|
+
const tag = reader.uint32();
|
|
51767
|
+
switch (tag >>> 3) {
|
|
51768
|
+
case 1: {
|
|
51769
|
+
if (tag !== 10) {
|
|
51770
|
+
break;
|
|
51771
|
+
}
|
|
51772
|
+
message.startTimestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
51773
|
+
continue;
|
|
51774
|
+
}
|
|
51775
|
+
case 2: {
|
|
51776
|
+
if (tag !== 18) {
|
|
51777
|
+
break;
|
|
51778
|
+
}
|
|
51779
|
+
message.endTimestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
51780
|
+
continue;
|
|
51781
|
+
}
|
|
51782
|
+
}
|
|
51783
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
51784
|
+
break;
|
|
51785
|
+
}
|
|
51786
|
+
reader.skip(tag & 7);
|
|
51787
|
+
}
|
|
51788
|
+
return message;
|
|
51789
|
+
},
|
|
51790
|
+
fromJSON(object) {
|
|
51791
|
+
return {
|
|
51792
|
+
startTimestamp: isSet5(object.startTimestamp) ? fromJsonTimestamp(object.startTimestamp) : void 0,
|
|
51793
|
+
endTimestamp: isSet5(object.endTimestamp) ? fromJsonTimestamp(object.endTimestamp) : void 0
|
|
51794
|
+
};
|
|
51795
|
+
},
|
|
51796
|
+
toJSON(message) {
|
|
51797
|
+
const obj = {};
|
|
51798
|
+
if (message.startTimestamp !== void 0) {
|
|
51799
|
+
obj.startTimestamp = message.startTimestamp.toISOString();
|
|
51800
|
+
}
|
|
51801
|
+
if (message.endTimestamp !== void 0) {
|
|
51802
|
+
obj.endTimestamp = message.endTimestamp.toISOString();
|
|
51803
|
+
}
|
|
51804
|
+
return obj;
|
|
51805
|
+
},
|
|
51806
|
+
create(base) {
|
|
51807
|
+
return WorkspaceBillingSummaryRequest.fromPartial(base ?? {});
|
|
51808
|
+
},
|
|
51809
|
+
fromPartial(object) {
|
|
51810
|
+
const message = createBaseWorkspaceBillingSummaryRequest();
|
|
51811
|
+
message.startTimestamp = object.startTimestamp ?? void 0;
|
|
51812
|
+
message.endTimestamp = object.endTimestamp ?? void 0;
|
|
51813
|
+
return message;
|
|
51814
|
+
}
|
|
51815
|
+
};
|
|
51816
|
+
function createBaseWorkspaceBillingSummaryResponse() {
|
|
51817
|
+
return {
|
|
51818
|
+
startTimestamp: void 0,
|
|
51819
|
+
endTimestamp: void 0,
|
|
51820
|
+
meteredCost: "",
|
|
51821
|
+
planCost: "",
|
|
51822
|
+
creditsApplied: "",
|
|
51823
|
+
reservationsDiscount: "",
|
|
51824
|
+
volumesDiscount: "",
|
|
51825
|
+
billedCost: "",
|
|
51826
|
+
meteredCostBreakdown: {}
|
|
51827
|
+
};
|
|
51828
|
+
}
|
|
51829
|
+
var WorkspaceBillingSummaryResponse = {
|
|
51830
|
+
encode(message, writer = new BinaryWriter()) {
|
|
51831
|
+
if (message.startTimestamp !== void 0) {
|
|
51832
|
+
Timestamp.encode(toTimestamp(message.startTimestamp), writer.uint32(10).fork()).join();
|
|
51833
|
+
}
|
|
51834
|
+
if (message.endTimestamp !== void 0) {
|
|
51835
|
+
Timestamp.encode(toTimestamp(message.endTimestamp), writer.uint32(18).fork()).join();
|
|
51836
|
+
}
|
|
51837
|
+
if (message.meteredCost !== "") {
|
|
51838
|
+
writer.uint32(26).string(message.meteredCost);
|
|
51839
|
+
}
|
|
51840
|
+
if (message.planCost !== "") {
|
|
51841
|
+
writer.uint32(34).string(message.planCost);
|
|
51842
|
+
}
|
|
51843
|
+
if (message.creditsApplied !== "") {
|
|
51844
|
+
writer.uint32(42).string(message.creditsApplied);
|
|
51845
|
+
}
|
|
51846
|
+
if (message.reservationsDiscount !== "") {
|
|
51847
|
+
writer.uint32(50).string(message.reservationsDiscount);
|
|
51848
|
+
}
|
|
51849
|
+
if (message.volumesDiscount !== "") {
|
|
51850
|
+
writer.uint32(58).string(message.volumesDiscount);
|
|
51851
|
+
}
|
|
51852
|
+
if (message.billedCost !== "") {
|
|
51853
|
+
writer.uint32(66).string(message.billedCost);
|
|
51854
|
+
}
|
|
51855
|
+
Object.entries(message.meteredCostBreakdown).forEach(([key, value]) => {
|
|
51856
|
+
WorkspaceBillingSummaryResponse_MeteredCostBreakdownEntry.encode(
|
|
51857
|
+
{ key, value },
|
|
51858
|
+
writer.uint32(74).fork()
|
|
51859
|
+
).join();
|
|
51860
|
+
});
|
|
51861
|
+
return writer;
|
|
51862
|
+
},
|
|
51863
|
+
decode(input, length) {
|
|
51864
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
51865
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
51866
|
+
const message = createBaseWorkspaceBillingSummaryResponse();
|
|
51867
|
+
while (reader.pos < end) {
|
|
51868
|
+
const tag = reader.uint32();
|
|
51869
|
+
switch (tag >>> 3) {
|
|
51870
|
+
case 1: {
|
|
51871
|
+
if (tag !== 10) {
|
|
51872
|
+
break;
|
|
51873
|
+
}
|
|
51874
|
+
message.startTimestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
51875
|
+
continue;
|
|
51876
|
+
}
|
|
51877
|
+
case 2: {
|
|
51878
|
+
if (tag !== 18) {
|
|
51879
|
+
break;
|
|
51880
|
+
}
|
|
51881
|
+
message.endTimestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
51882
|
+
continue;
|
|
51883
|
+
}
|
|
51884
|
+
case 3: {
|
|
51885
|
+
if (tag !== 26) {
|
|
51886
|
+
break;
|
|
51887
|
+
}
|
|
51888
|
+
message.meteredCost = reader.string();
|
|
51889
|
+
continue;
|
|
51890
|
+
}
|
|
51891
|
+
case 4: {
|
|
51892
|
+
if (tag !== 34) {
|
|
51893
|
+
break;
|
|
51894
|
+
}
|
|
51895
|
+
message.planCost = reader.string();
|
|
51896
|
+
continue;
|
|
51897
|
+
}
|
|
51898
|
+
case 5: {
|
|
51899
|
+
if (tag !== 42) {
|
|
51900
|
+
break;
|
|
51901
|
+
}
|
|
51902
|
+
message.creditsApplied = reader.string();
|
|
51903
|
+
continue;
|
|
51904
|
+
}
|
|
51905
|
+
case 6: {
|
|
51906
|
+
if (tag !== 50) {
|
|
51907
|
+
break;
|
|
51908
|
+
}
|
|
51909
|
+
message.reservationsDiscount = reader.string();
|
|
51910
|
+
continue;
|
|
51911
|
+
}
|
|
51912
|
+
case 7: {
|
|
51913
|
+
if (tag !== 58) {
|
|
51914
|
+
break;
|
|
51915
|
+
}
|
|
51916
|
+
message.volumesDiscount = reader.string();
|
|
51917
|
+
continue;
|
|
51918
|
+
}
|
|
51919
|
+
case 8: {
|
|
51920
|
+
if (tag !== 66) {
|
|
51921
|
+
break;
|
|
51922
|
+
}
|
|
51923
|
+
message.billedCost = reader.string();
|
|
51924
|
+
continue;
|
|
51925
|
+
}
|
|
51926
|
+
case 9: {
|
|
51927
|
+
if (tag !== 74) {
|
|
51928
|
+
break;
|
|
51929
|
+
}
|
|
51930
|
+
const entry9 = WorkspaceBillingSummaryResponse_MeteredCostBreakdownEntry.decode(reader, reader.uint32());
|
|
51931
|
+
if (entry9.value !== void 0) {
|
|
51932
|
+
message.meteredCostBreakdown[entry9.key] = entry9.value;
|
|
51933
|
+
}
|
|
51934
|
+
continue;
|
|
51935
|
+
}
|
|
51936
|
+
}
|
|
51937
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
51938
|
+
break;
|
|
51939
|
+
}
|
|
51940
|
+
reader.skip(tag & 7);
|
|
51941
|
+
}
|
|
51942
|
+
return message;
|
|
51943
|
+
},
|
|
51944
|
+
fromJSON(object) {
|
|
51945
|
+
return {
|
|
51946
|
+
startTimestamp: isSet5(object.startTimestamp) ? fromJsonTimestamp(object.startTimestamp) : void 0,
|
|
51947
|
+
endTimestamp: isSet5(object.endTimestamp) ? fromJsonTimestamp(object.endTimestamp) : void 0,
|
|
51948
|
+
meteredCost: isSet5(object.meteredCost) ? globalThis.String(object.meteredCost) : "",
|
|
51949
|
+
planCost: isSet5(object.planCost) ? globalThis.String(object.planCost) : "",
|
|
51950
|
+
creditsApplied: isSet5(object.creditsApplied) ? globalThis.String(object.creditsApplied) : "",
|
|
51951
|
+
reservationsDiscount: isSet5(object.reservationsDiscount) ? globalThis.String(object.reservationsDiscount) : "",
|
|
51952
|
+
volumesDiscount: isSet5(object.volumesDiscount) ? globalThis.String(object.volumesDiscount) : "",
|
|
51953
|
+
billedCost: isSet5(object.billedCost) ? globalThis.String(object.billedCost) : "",
|
|
51954
|
+
meteredCostBreakdown: isObject2(object.meteredCostBreakdown) ? Object.entries(object.meteredCostBreakdown).reduce((acc, [key, value]) => {
|
|
51955
|
+
acc[key] = String(value);
|
|
51956
|
+
return acc;
|
|
51957
|
+
}, {}) : {}
|
|
51958
|
+
};
|
|
51959
|
+
},
|
|
51960
|
+
toJSON(message) {
|
|
51961
|
+
const obj = {};
|
|
51962
|
+
if (message.startTimestamp !== void 0) {
|
|
51963
|
+
obj.startTimestamp = message.startTimestamp.toISOString();
|
|
51964
|
+
}
|
|
51965
|
+
if (message.endTimestamp !== void 0) {
|
|
51966
|
+
obj.endTimestamp = message.endTimestamp.toISOString();
|
|
51967
|
+
}
|
|
51968
|
+
if (message.meteredCost !== "") {
|
|
51969
|
+
obj.meteredCost = message.meteredCost;
|
|
51970
|
+
}
|
|
51971
|
+
if (message.planCost !== "") {
|
|
51972
|
+
obj.planCost = message.planCost;
|
|
51973
|
+
}
|
|
51974
|
+
if (message.creditsApplied !== "") {
|
|
51975
|
+
obj.creditsApplied = message.creditsApplied;
|
|
51976
|
+
}
|
|
51977
|
+
if (message.reservationsDiscount !== "") {
|
|
51978
|
+
obj.reservationsDiscount = message.reservationsDiscount;
|
|
51979
|
+
}
|
|
51980
|
+
if (message.volumesDiscount !== "") {
|
|
51981
|
+
obj.volumesDiscount = message.volumesDiscount;
|
|
51982
|
+
}
|
|
51983
|
+
if (message.billedCost !== "") {
|
|
51984
|
+
obj.billedCost = message.billedCost;
|
|
51985
|
+
}
|
|
51986
|
+
if (message.meteredCostBreakdown) {
|
|
51987
|
+
const entries = Object.entries(message.meteredCostBreakdown);
|
|
51988
|
+
if (entries.length > 0) {
|
|
51989
|
+
obj.meteredCostBreakdown = {};
|
|
51990
|
+
entries.forEach(([k, v]) => {
|
|
51991
|
+
obj.meteredCostBreakdown[k] = v;
|
|
51992
|
+
});
|
|
51993
|
+
}
|
|
51994
|
+
}
|
|
51995
|
+
return obj;
|
|
51996
|
+
},
|
|
51997
|
+
create(base) {
|
|
51998
|
+
return WorkspaceBillingSummaryResponse.fromPartial(base ?? {});
|
|
51999
|
+
},
|
|
52000
|
+
fromPartial(object) {
|
|
52001
|
+
const message = createBaseWorkspaceBillingSummaryResponse();
|
|
52002
|
+
message.startTimestamp = object.startTimestamp ?? void 0;
|
|
52003
|
+
message.endTimestamp = object.endTimestamp ?? void 0;
|
|
52004
|
+
message.meteredCost = object.meteredCost ?? "";
|
|
52005
|
+
message.planCost = object.planCost ?? "";
|
|
52006
|
+
message.creditsApplied = object.creditsApplied ?? "";
|
|
52007
|
+
message.reservationsDiscount = object.reservationsDiscount ?? "";
|
|
52008
|
+
message.volumesDiscount = object.volumesDiscount ?? "";
|
|
52009
|
+
message.billedCost = object.billedCost ?? "";
|
|
52010
|
+
message.meteredCostBreakdown = Object.entries(object.meteredCostBreakdown ?? {}).reduce(
|
|
52011
|
+
(acc, [key, value]) => {
|
|
52012
|
+
if (value !== void 0) {
|
|
52013
|
+
acc[key] = globalThis.String(value);
|
|
52014
|
+
}
|
|
52015
|
+
return acc;
|
|
52016
|
+
},
|
|
52017
|
+
{}
|
|
52018
|
+
);
|
|
52019
|
+
return message;
|
|
52020
|
+
}
|
|
52021
|
+
};
|
|
52022
|
+
function createBaseWorkspaceBillingSummaryResponse_MeteredCostBreakdownEntry() {
|
|
52023
|
+
return { key: "", value: "" };
|
|
52024
|
+
}
|
|
52025
|
+
var WorkspaceBillingSummaryResponse_MeteredCostBreakdownEntry = {
|
|
52026
|
+
encode(message, writer = new BinaryWriter()) {
|
|
52027
|
+
if (message.key !== "") {
|
|
52028
|
+
writer.uint32(10).string(message.key);
|
|
52029
|
+
}
|
|
52030
|
+
if (message.value !== "") {
|
|
52031
|
+
writer.uint32(18).string(message.value);
|
|
52032
|
+
}
|
|
52033
|
+
return writer;
|
|
52034
|
+
},
|
|
52035
|
+
decode(input, length) {
|
|
52036
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
52037
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
52038
|
+
const message = createBaseWorkspaceBillingSummaryResponse_MeteredCostBreakdownEntry();
|
|
52039
|
+
while (reader.pos < end) {
|
|
52040
|
+
const tag = reader.uint32();
|
|
52041
|
+
switch (tag >>> 3) {
|
|
52042
|
+
case 1: {
|
|
52043
|
+
if (tag !== 10) {
|
|
52044
|
+
break;
|
|
52045
|
+
}
|
|
52046
|
+
message.key = reader.string();
|
|
52047
|
+
continue;
|
|
52048
|
+
}
|
|
52049
|
+
case 2: {
|
|
52050
|
+
if (tag !== 18) {
|
|
52051
|
+
break;
|
|
52052
|
+
}
|
|
52053
|
+
message.value = reader.string();
|
|
52054
|
+
continue;
|
|
52055
|
+
}
|
|
52056
|
+
}
|
|
52057
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
52058
|
+
break;
|
|
52059
|
+
}
|
|
52060
|
+
reader.skip(tag & 7);
|
|
52061
|
+
}
|
|
52062
|
+
return message;
|
|
52063
|
+
},
|
|
52064
|
+
fromJSON(object) {
|
|
52065
|
+
return {
|
|
52066
|
+
key: isSet5(object.key) ? globalThis.String(object.key) : "",
|
|
52067
|
+
value: isSet5(object.value) ? globalThis.String(object.value) : ""
|
|
52068
|
+
};
|
|
52069
|
+
},
|
|
52070
|
+
toJSON(message) {
|
|
52071
|
+
const obj = {};
|
|
52072
|
+
if (message.key !== "") {
|
|
52073
|
+
obj.key = message.key;
|
|
52074
|
+
}
|
|
52075
|
+
if (message.value !== "") {
|
|
52076
|
+
obj.value = message.value;
|
|
52077
|
+
}
|
|
52078
|
+
return obj;
|
|
52079
|
+
},
|
|
52080
|
+
create(base) {
|
|
52081
|
+
return WorkspaceBillingSummaryResponse_MeteredCostBreakdownEntry.fromPartial(base ?? {});
|
|
52082
|
+
},
|
|
52083
|
+
fromPartial(object) {
|
|
52084
|
+
const message = createBaseWorkspaceBillingSummaryResponse_MeteredCostBreakdownEntry();
|
|
52085
|
+
message.key = object.key ?? "";
|
|
52086
|
+
message.value = object.value ?? "";
|
|
52087
|
+
return message;
|
|
52088
|
+
}
|
|
52089
|
+
};
|
|
51057
52090
|
function createBaseWorkspaceDashboardUrlRequest() {
|
|
51058
52091
|
return { environmentName: "" };
|
|
51059
52092
|
}
|
|
@@ -52081,6 +53114,14 @@ var ModalClientDefinition = {
|
|
|
52081
53114
|
responseStream: false,
|
|
52082
53115
|
options: {}
|
|
52083
53116
|
},
|
|
53117
|
+
containerServerLifecycleReady: {
|
|
53118
|
+
name: "ContainerServerLifecycleReady",
|
|
53119
|
+
requestType: ContainerServerLifecycleReadyRequest,
|
|
53120
|
+
requestStream: false,
|
|
53121
|
+
responseType: Empty,
|
|
53122
|
+
responseStream: false,
|
|
53123
|
+
options: {}
|
|
53124
|
+
},
|
|
52084
53125
|
containerStop: {
|
|
52085
53126
|
name: "ContainerStop",
|
|
52086
53127
|
requestType: ContainerStopRequest,
|
|
@@ -52262,6 +53303,14 @@ var ModalClientDefinition = {
|
|
|
52262
53303
|
options: {}
|
|
52263
53304
|
},
|
|
52264
53305
|
/** Environments */
|
|
53306
|
+
environmentBillingSummary: {
|
|
53307
|
+
name: "EnvironmentBillingSummary",
|
|
53308
|
+
requestType: EnvironmentBillingSummaryRequest,
|
|
53309
|
+
requestStream: false,
|
|
53310
|
+
responseType: EnvironmentBillingSummaryResponse,
|
|
53311
|
+
responseStream: false,
|
|
53312
|
+
options: {}
|
|
53313
|
+
},
|
|
52265
53314
|
environmentCreate: {
|
|
52266
53315
|
name: "EnvironmentCreate",
|
|
52267
53316
|
requestType: EnvironmentCreateRequest,
|
|
@@ -52663,6 +53712,14 @@ var ModalClientDefinition = {
|
|
|
52663
53712
|
options: {}
|
|
52664
53713
|
},
|
|
52665
53714
|
/** Mounts */
|
|
53715
|
+
mountBatchedCheckExistence: {
|
|
53716
|
+
name: "MountBatchedCheckExistence",
|
|
53717
|
+
requestType: MountBatchedCheckExistenceRequest,
|
|
53718
|
+
requestStream: false,
|
|
53719
|
+
responseType: MountBatchedCheckExistenceResponse,
|
|
53720
|
+
responseStream: false,
|
|
53721
|
+
options: {}
|
|
53722
|
+
},
|
|
52666
53723
|
mountGetOrCreate: {
|
|
52667
53724
|
name: "MountGetOrCreate",
|
|
52668
53725
|
requestType: MountGetOrCreateRequest,
|
|
@@ -52867,6 +53924,14 @@ var ModalClientDefinition = {
|
|
|
52867
53924
|
responseStream: false,
|
|
52868
53925
|
options: {}
|
|
52869
53926
|
},
|
|
53927
|
+
sandboxGetFromNameV2: {
|
|
53928
|
+
name: "SandboxGetFromNameV2",
|
|
53929
|
+
requestType: SandboxGetFromNameRequest,
|
|
53930
|
+
requestStream: false,
|
|
53931
|
+
responseType: SandboxGetFromNameResponse,
|
|
53932
|
+
responseStream: false,
|
|
53933
|
+
options: {}
|
|
53934
|
+
},
|
|
52870
53935
|
sandboxGetLogs: {
|
|
52871
53936
|
name: "SandboxGetLogs",
|
|
52872
53937
|
requestType: SandboxGetLogsRequest,
|
|
@@ -53004,6 +54069,14 @@ var ModalClientDefinition = {
|
|
|
53004
54069
|
responseStream: false,
|
|
53005
54070
|
options: {}
|
|
53006
54071
|
},
|
|
54072
|
+
sandboxTagsGetV2: {
|
|
54073
|
+
name: "SandboxTagsGetV2",
|
|
54074
|
+
requestType: SandboxTagsGetRequest,
|
|
54075
|
+
requestStream: false,
|
|
54076
|
+
responseType: SandboxTagsGetResponse,
|
|
54077
|
+
responseStream: false,
|
|
54078
|
+
options: {}
|
|
54079
|
+
},
|
|
53007
54080
|
sandboxTagsSet: {
|
|
53008
54081
|
name: "SandboxTagsSet",
|
|
53009
54082
|
requestType: SandboxTagsSetRequest,
|
|
@@ -53012,6 +54085,14 @@ var ModalClientDefinition = {
|
|
|
53012
54085
|
responseStream: false,
|
|
53013
54086
|
options: {}
|
|
53014
54087
|
},
|
|
54088
|
+
sandboxTagsSetV2: {
|
|
54089
|
+
name: "SandboxTagsSetV2",
|
|
54090
|
+
requestType: SandboxTagsSetRequest,
|
|
54091
|
+
requestStream: false,
|
|
54092
|
+
responseType: Empty,
|
|
54093
|
+
responseStream: false,
|
|
54094
|
+
options: {}
|
|
54095
|
+
},
|
|
53015
54096
|
sandboxTerminate: {
|
|
53016
54097
|
name: "SandboxTerminate",
|
|
53017
54098
|
requestType: SandboxTerminateRequest,
|
|
@@ -53478,6 +54559,14 @@ var ModalClientDefinition = {
|
|
|
53478
54559
|
responseStream: true,
|
|
53479
54560
|
options: {}
|
|
53480
54561
|
},
|
|
54562
|
+
workspaceBillingSummary: {
|
|
54563
|
+
name: "WorkspaceBillingSummary",
|
|
54564
|
+
requestType: WorkspaceBillingSummaryRequest,
|
|
54565
|
+
requestStream: false,
|
|
54566
|
+
responseType: WorkspaceBillingSummaryResponse,
|
|
54567
|
+
responseStream: false,
|
|
54568
|
+
options: {}
|
|
54569
|
+
},
|
|
53481
54570
|
workspaceDashboardUrlGet: {
|
|
53482
54571
|
name: "WorkspaceDashboardUrlGet",
|
|
53483
54572
|
requestType: WorkspaceDashboardUrlRequest,
|
|
@@ -54116,6 +55205,16 @@ var import_nice_grpc4 = require("nice-grpc");
|
|
|
54116
55205
|
|
|
54117
55206
|
// src/secret.ts
|
|
54118
55207
|
var import_nice_grpc2 = require("nice-grpc");
|
|
55208
|
+
var ENV_VAR_KEY_REGEX = /^[a-zA-Z_][a-zA-Z0-9_]*$/;
|
|
55209
|
+
function validateEnvVarKeys(env) {
|
|
55210
|
+
for (const key of Object.keys(env)) {
|
|
55211
|
+
if (!ENV_VAR_KEY_REGEX.test(key)) {
|
|
55212
|
+
throw new InvalidError(
|
|
55213
|
+
`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.`
|
|
55214
|
+
);
|
|
55215
|
+
}
|
|
55216
|
+
}
|
|
55217
|
+
}
|
|
54119
55218
|
var SecretService = class {
|
|
54120
55219
|
#client;
|
|
54121
55220
|
constructor(client) {
|
|
@@ -54145,7 +55244,16 @@ var SecretService = class {
|
|
|
54145
55244
|
throw err;
|
|
54146
55245
|
}
|
|
54147
55246
|
}
|
|
54148
|
-
/**
|
|
55247
|
+
/**
|
|
55248
|
+
* Create a {@link Secret} from a plain object of key-value pairs.
|
|
55249
|
+
*
|
|
55250
|
+
* The returned Secret is lazy: no server-side Secret is created (and
|
|
55251
|
+
* {@link Secret#secretId secretId} stays empty) until it is first used. When
|
|
55252
|
+
* used with {@link Sandbox#exec Sandbox.exec()} or
|
|
55253
|
+
* {@link SandboxService#experimentalCreate client.sandboxes.experimentalCreate()},
|
|
55254
|
+
* the values are sent directly to the worker as environment variables,
|
|
55255
|
+
* avoiding a `SecretGetOrCreate` round-trip entirely.
|
|
55256
|
+
*/
|
|
54149
55257
|
async fromObject(entries, params) {
|
|
54150
55258
|
for (const [, value] of Object.entries(entries)) {
|
|
54151
55259
|
if (value == null || typeof value !== "string") {
|
|
@@ -54154,23 +55262,14 @@ var SecretService = class {
|
|
|
54154
55262
|
);
|
|
54155
55263
|
}
|
|
54156
55264
|
}
|
|
54157
|
-
|
|
54158
|
-
|
|
54159
|
-
|
|
54160
|
-
|
|
54161
|
-
|
|
54162
|
-
|
|
54163
|
-
|
|
54164
|
-
|
|
54165
|
-
"secret_id",
|
|
54166
|
-
resp.secretId
|
|
54167
|
-
);
|
|
54168
|
-
return new Secret(resp.secretId);
|
|
54169
|
-
} catch (err) {
|
|
54170
|
-
if (err instanceof import_nice_grpc2.ClientError && (err.code === import_nice_grpc2.Status.INVALID_ARGUMENT || err.code === import_nice_grpc2.Status.FAILED_PRECONDITION))
|
|
54171
|
-
throw new InvalidError(err.details);
|
|
54172
|
-
throw err;
|
|
54173
|
-
}
|
|
55265
|
+
validateEnvVarKeys(entries);
|
|
55266
|
+
const envDict = { ...entries };
|
|
55267
|
+
const environment = this.#client.environmentName(params?.environment);
|
|
55268
|
+
return new Secret(
|
|
55269
|
+
"",
|
|
55270
|
+
void 0,
|
|
55271
|
+
new SecretFromObjectHydrator(envDict, environment)
|
|
55272
|
+
);
|
|
54174
55273
|
}
|
|
54175
55274
|
/**
|
|
54176
55275
|
* Delete a named {@link Secret}.
|
|
@@ -54201,15 +55300,98 @@ var SecretService = class {
|
|
|
54201
55300
|
}
|
|
54202
55301
|
}
|
|
54203
55302
|
};
|
|
55303
|
+
var SecretFromObjectHydrator = class {
|
|
55304
|
+
envDict;
|
|
55305
|
+
#environment;
|
|
55306
|
+
constructor(envDict, environment) {
|
|
55307
|
+
this.envDict = envDict;
|
|
55308
|
+
this.#environment = environment;
|
|
55309
|
+
}
|
|
55310
|
+
async hydrate(client) {
|
|
55311
|
+
try {
|
|
55312
|
+
const resp = await client.cpClient.secretGetOrCreate({
|
|
55313
|
+
objectCreationType: 5 /* OBJECT_CREATION_TYPE_EPHEMERAL */,
|
|
55314
|
+
envDict: this.envDict,
|
|
55315
|
+
environmentName: this.#environment
|
|
55316
|
+
});
|
|
55317
|
+
client.logger.debug(
|
|
55318
|
+
"Created ephemeral Secret",
|
|
55319
|
+
"secret_id",
|
|
55320
|
+
resp.secretId
|
|
55321
|
+
);
|
|
55322
|
+
return resp.secretId;
|
|
55323
|
+
} catch (err) {
|
|
55324
|
+
if (err instanceof import_nice_grpc2.ClientError && (err.code === import_nice_grpc2.Status.INVALID_ARGUMENT || err.code === import_nice_grpc2.Status.FAILED_PRECONDITION))
|
|
55325
|
+
throw new InvalidError(err.details);
|
|
55326
|
+
throw err;
|
|
55327
|
+
}
|
|
55328
|
+
}
|
|
55329
|
+
};
|
|
54204
55330
|
var Secret = class {
|
|
54205
|
-
secretId;
|
|
55331
|
+
#secretId;
|
|
54206
55332
|
name;
|
|
55333
|
+
// Resolves secretId lazily the first time it is needed. Undefined for Secrets
|
|
55334
|
+
// constructed already-hydrated (e.g. from fromName), and not consulted again
|
|
55335
|
+
// once secretId is set.
|
|
55336
|
+
#hydrator;
|
|
55337
|
+
// Caches the single in-flight (or successfully completed) hydration so the
|
|
55338
|
+
// ephemeral Secret is created at most once, even if multiple callers hydrate
|
|
55339
|
+
// the same Secret concurrently. Cleared on failure so a transient error
|
|
55340
|
+
// doesn't permanently break the Secret; subsequent calls can retry.
|
|
55341
|
+
#hydratePromise;
|
|
54207
55342
|
/** @ignore */
|
|
54208
|
-
constructor(secretId, name) {
|
|
54209
|
-
this
|
|
55343
|
+
constructor(secretId, name, hydrator) {
|
|
55344
|
+
this.#secretId = secretId;
|
|
54210
55345
|
this.name = name;
|
|
55346
|
+
this.#hydrator = hydrator;
|
|
55347
|
+
}
|
|
55348
|
+
/** The ID of the server-side Secret, or an empty string if not yet hydrated. */
|
|
55349
|
+
get secretId() {
|
|
55350
|
+
return this.#secretId;
|
|
55351
|
+
}
|
|
55352
|
+
/**
|
|
55353
|
+
* The hydrator resolving a lazy Secret to a secretId, or `undefined` for
|
|
55354
|
+
* Secrets that already reference a server-side Secret (e.g. from fromName).
|
|
55355
|
+
*
|
|
55356
|
+
* @internal
|
|
55357
|
+
* @hidden
|
|
55358
|
+
*/
|
|
55359
|
+
get _hydrator() {
|
|
55360
|
+
return this.#hydrator;
|
|
55361
|
+
}
|
|
55362
|
+
/**
|
|
55363
|
+
* Lazily create the ephemeral server-side Secret backing a fromObject Secret
|
|
55364
|
+
* and populate {@link Secret#secretId secretId}. A no-op once secretId is set
|
|
55365
|
+
* (e.g. for Secrets returned by fromName).
|
|
55366
|
+
*
|
|
55367
|
+
* @internal
|
|
55368
|
+
* @hidden
|
|
55369
|
+
*/
|
|
55370
|
+
async _hydrate(client) {
|
|
55371
|
+
if (this.#secretId !== "" || this.#hydrator === void 0) {
|
|
55372
|
+
return;
|
|
55373
|
+
}
|
|
55374
|
+
if (this.#hydratePromise === void 0) {
|
|
55375
|
+
this.#hydratePromise = this.#doHydrate(client);
|
|
55376
|
+
}
|
|
55377
|
+
const promise = this.#hydratePromise;
|
|
55378
|
+
try {
|
|
55379
|
+
await promise;
|
|
55380
|
+
} catch (err) {
|
|
55381
|
+
if (this.#hydratePromise === promise) {
|
|
55382
|
+
this.#hydratePromise = void 0;
|
|
55383
|
+
}
|
|
55384
|
+
throw err;
|
|
55385
|
+
}
|
|
55386
|
+
}
|
|
55387
|
+
async #doHydrate(client) {
|
|
55388
|
+
this.#secretId = await this.#hydrator.hydrate(client);
|
|
54211
55389
|
}
|
|
54212
55390
|
};
|
|
55391
|
+
function secretEnvDictHydrator(secret) {
|
|
55392
|
+
const hydrator = secret?._hydrator;
|
|
55393
|
+
return hydrator instanceof SecretFromObjectHydrator ? hydrator : void 0;
|
|
55394
|
+
}
|
|
54213
55395
|
async function mergeEnvIntoSecrets(client, env, secrets) {
|
|
54214
55396
|
const result = [...secrets || []];
|
|
54215
55397
|
if (env && Object.keys(env).length > 0) {
|
|
@@ -54217,6 +55399,38 @@ async function mergeEnvIntoSecrets(client, env, secrets) {
|
|
|
54217
55399
|
}
|
|
54218
55400
|
return result;
|
|
54219
55401
|
}
|
|
55402
|
+
async function hydrateSecrets(client, secrets) {
|
|
55403
|
+
secrets.forEach((secret, i) => {
|
|
55404
|
+
if (secret == null) {
|
|
55405
|
+
throw new InvalidError(`secret at index ${i} must not be null`);
|
|
55406
|
+
}
|
|
55407
|
+
});
|
|
55408
|
+
await Promise.all(secrets.map((secret) => secret._hydrate(client)));
|
|
55409
|
+
}
|
|
55410
|
+
function collectSecretIds(secrets) {
|
|
55411
|
+
return secrets.map((secret, i) => {
|
|
55412
|
+
if (secret == null) {
|
|
55413
|
+
throw new InvalidError(`secret at index ${i} must not be null`);
|
|
55414
|
+
}
|
|
55415
|
+
if (secret.secretId === "") {
|
|
55416
|
+
throw new InvalidError(`secret at index ${i} has not been hydrated`);
|
|
55417
|
+
}
|
|
55418
|
+
return secret.secretId;
|
|
55419
|
+
});
|
|
55420
|
+
}
|
|
55421
|
+
function splitEnvDictAndResolvableSecrets(secrets) {
|
|
55422
|
+
const envDict = {};
|
|
55423
|
+
const resolvable = [];
|
|
55424
|
+
for (const secret of secrets) {
|
|
55425
|
+
const hydrator = secret != null ? secretEnvDictHydrator(secret) : void 0;
|
|
55426
|
+
if (hydrator !== void 0) {
|
|
55427
|
+
Object.assign(envDict, hydrator.envDict);
|
|
55428
|
+
} else {
|
|
55429
|
+
resolvable.push(secret);
|
|
55430
|
+
}
|
|
55431
|
+
}
|
|
55432
|
+
return [envDict, resolvable];
|
|
55433
|
+
}
|
|
54220
55434
|
|
|
54221
55435
|
// src/volume.ts
|
|
54222
55436
|
var import_nice_grpc3 = require("nice-grpc");
|
|
@@ -54476,7 +55690,8 @@ var FunctionService = class {
|
|
|
54476
55690
|
const resp = await this.#client.cpClient.functionGet({
|
|
54477
55691
|
appName,
|
|
54478
55692
|
objectTag: name,
|
|
54479
|
-
environmentName: this.#client.environmentName(params.environment)
|
|
55693
|
+
environmentName: this.#client.environmentName(params.environment),
|
|
55694
|
+
appVersion: params.version
|
|
54480
55695
|
});
|
|
54481
55696
|
this.#client.logger.debug(
|
|
54482
55697
|
"Retrieved Function",
|
|
@@ -54599,7 +55814,8 @@ async function buildFunctionOptionsProto(options) {
|
|
|
54599
55814
|
maxConcurrentInputs: o.maxConcurrentInputs,
|
|
54600
55815
|
targetConcurrentInputs: o.targetConcurrentInputs,
|
|
54601
55816
|
batchMaxSize: o.batchMaxSize,
|
|
54602
|
-
batchLingerMs: o.batchWaitMs
|
|
55817
|
+
batchLingerMs: o.batchWaitMs,
|
|
55818
|
+
routingRegion: o.routingRegion
|
|
54603
55819
|
});
|
|
54604
55820
|
return functionOptions;
|
|
54605
55821
|
}
|
|
@@ -54664,6 +55880,7 @@ async function bindParameters(client, functionId, options = {}, schema = [], par
|
|
|
54664
55880
|
options?.env,
|
|
54665
55881
|
options?.secrets
|
|
54666
55882
|
);
|
|
55883
|
+
await hydrateSecrets(client, mergedSecrets);
|
|
54667
55884
|
const mergedOptions = mergeServiceOptions(options, {
|
|
54668
55885
|
secrets: mergedSecrets,
|
|
54669
55886
|
env: void 0
|
|
@@ -54740,6 +55957,7 @@ var Function_ = class _Function_ {
|
|
|
54740
55957
|
* and/or {@link Function_#withBatching withBatching}. */
|
|
54741
55958
|
async instance() {
|
|
54742
55959
|
let newFnId = this.functionId;
|
|
55960
|
+
let handleMetadata = this.#handleMetadata;
|
|
54743
55961
|
if (this.#options != null && Object.entries(this.#options).length > 0) {
|
|
54744
55962
|
const boundF = await bindParameters(
|
|
54745
55963
|
this.#client,
|
|
@@ -54747,12 +55965,13 @@ var Function_ = class _Function_ {
|
|
|
54747
55965
|
this.#options
|
|
54748
55966
|
);
|
|
54749
55967
|
newFnId = boundF.boundFunctionId;
|
|
55968
|
+
handleMetadata = boundF.handleMetadata;
|
|
54750
55969
|
}
|
|
54751
55970
|
return new _Function_(
|
|
54752
55971
|
this.#client,
|
|
54753
55972
|
newFnId,
|
|
54754
55973
|
this.methodName,
|
|
54755
|
-
|
|
55974
|
+
handleMetadata
|
|
54756
55975
|
);
|
|
54757
55976
|
}
|
|
54758
55977
|
// Execute a single input into a remote Function.
|
|
@@ -54903,7 +56122,8 @@ var ClsService = class {
|
|
|
54903
56122
|
const serviceFunction = await this.#client.cpClient.functionGet({
|
|
54904
56123
|
appName,
|
|
54905
56124
|
objectTag: serviceFunctionName,
|
|
54906
|
-
environmentName: this.#client.environmentName(params.environment)
|
|
56125
|
+
environmentName: this.#client.environmentName(params.environment),
|
|
56126
|
+
appVersion: params.version
|
|
54907
56127
|
});
|
|
54908
56128
|
const parameterInfo = serviceFunction.handleMetadata?.classParameterInfo;
|
|
54909
56129
|
const schema = parameterInfo?.schema ?? [];
|
|
@@ -54952,15 +56172,17 @@ var Cls = class _Cls {
|
|
|
54952
56172
|
/** Create a new instance of the Cls with parameters and/or runtime options. */
|
|
54953
56173
|
async instance(parameters = {}) {
|
|
54954
56174
|
let functionId;
|
|
56175
|
+
let methodHandleMetadata;
|
|
54955
56176
|
if (this.#schema.length === 0 && this.#serviceFunctionOptions === void 0) {
|
|
54956
56177
|
functionId = this.#serviceFunctionId;
|
|
56178
|
+
methodHandleMetadata = this.#serviceFunctionMetadata.methodHandleMetadata;
|
|
54957
56179
|
} else {
|
|
54958
|
-
|
|
56180
|
+
const bindResp = await this.#bindParameters(parameters);
|
|
56181
|
+
functionId = bindResp.boundFunctionId;
|
|
56182
|
+
methodHandleMetadata = bindResp.handleMetadata?.methodHandleMetadata ?? {};
|
|
54959
56183
|
}
|
|
54960
56184
|
const methods = /* @__PURE__ */ new Map();
|
|
54961
|
-
for (const [name, methodMetadata] of Object.entries(
|
|
54962
|
-
this.#serviceFunctionMetadata.methodHandleMetadata
|
|
54963
|
-
)) {
|
|
56185
|
+
for (const [name, methodMetadata] of Object.entries(methodHandleMetadata)) {
|
|
54964
56186
|
methods.set(
|
|
54965
56187
|
name,
|
|
54966
56188
|
new Function_(this.#client, functionId, name, methodMetadata)
|
|
@@ -55006,14 +56228,13 @@ var Cls = class _Cls {
|
|
|
55006
56228
|
}
|
|
55007
56229
|
/** Bind parameters to the Cls function. */
|
|
55008
56230
|
async #bindParameters(parameters) {
|
|
55009
|
-
|
|
56231
|
+
return await bindParameters(
|
|
55010
56232
|
this.#client,
|
|
55011
56233
|
this.#serviceFunctionId,
|
|
55012
56234
|
this.#serviceFunctionOptions,
|
|
55013
56235
|
this.#schema,
|
|
55014
56236
|
parameters
|
|
55015
56237
|
);
|
|
55016
|
-
return bindResp.boundFunctionId;
|
|
55017
56238
|
}
|
|
55018
56239
|
};
|
|
55019
56240
|
var ClsInstance = class {
|
|
@@ -55680,11 +56901,27 @@ var Queue = class _Queue {
|
|
|
55680
56901
|
// src/image.ts
|
|
55681
56902
|
var import_nice_grpc7 = require("nice-grpc");
|
|
55682
56903
|
var import_nice_grpc8 = require("nice-grpc");
|
|
56904
|
+
|
|
56905
|
+
// src/name_utils.ts
|
|
56906
|
+
var OBJECT_NAME_CHARSET = /^[a-zA-Z0-9\-_.]+$/;
|
|
56907
|
+
var APP_ID_PATTERN = /^ap-[a-zA-Z0-9]{22}$/;
|
|
56908
|
+
function isValidObjectName(name) {
|
|
56909
|
+
return name.length <= 64 && OBJECT_NAME_CHARSET.test(name) && !APP_ID_PATTERN.test(name);
|
|
56910
|
+
}
|
|
56911
|
+
function checkObjectName(name, objectType) {
|
|
56912
|
+
if (!isValidObjectName(name)) {
|
|
56913
|
+
throw new InvalidError(
|
|
56914
|
+
`Invalid ${objectType} name: '${name}'.
|
|
56915
|
+
|
|
56916
|
+
Names may contain only alphanumeric characters, dashes, periods, and underscores, must be shorter than 64 characters, and cannot conflict with App ID strings.`
|
|
56917
|
+
);
|
|
56918
|
+
}
|
|
56919
|
+
}
|
|
56920
|
+
|
|
56921
|
+
// src/image.ts
|
|
55683
56922
|
var DEFAULT_IMAGE_TAG = "latest";
|
|
55684
56923
|
function validateImageName(name) {
|
|
55685
|
-
|
|
55686
|
-
throw new InvalidError("Image name must be non-empty.");
|
|
55687
|
-
}
|
|
56924
|
+
checkObjectName(name, "Image");
|
|
55688
56925
|
if (name.startsWith("im-")) {
|
|
55689
56926
|
throw new InvalidError(
|
|
55690
56927
|
"Image name cannot start with 'im-' (reserved for image IDs)."
|
|
@@ -55692,21 +56929,53 @@ function validateImageName(name) {
|
|
|
55692
56929
|
}
|
|
55693
56930
|
}
|
|
55694
56931
|
function validateImageTag(tag) {
|
|
55695
|
-
|
|
55696
|
-
throw new InvalidError("Image tag must be non-empty.");
|
|
55697
|
-
}
|
|
56932
|
+
checkObjectName(tag, "Image tag");
|
|
55698
56933
|
}
|
|
55699
56934
|
function parseNamedImageRef(value) {
|
|
55700
56935
|
const separatorIndex = value.indexOf(":");
|
|
56936
|
+
let imageName;
|
|
56937
|
+
let tag;
|
|
55701
56938
|
if (separatorIndex === -1) {
|
|
55702
|
-
|
|
55703
|
-
|
|
56939
|
+
imageName = value;
|
|
56940
|
+
tag = DEFAULT_IMAGE_TAG;
|
|
56941
|
+
} else {
|
|
56942
|
+
imageName = value.slice(0, separatorIndex);
|
|
56943
|
+
tag = value.slice(separatorIndex + 1);
|
|
56944
|
+
}
|
|
56945
|
+
let prefix = "";
|
|
56946
|
+
const lastSlashIndex = imageName.lastIndexOf("/");
|
|
56947
|
+
if (lastSlashIndex !== -1) {
|
|
56948
|
+
prefix = imageName.slice(0, lastSlashIndex);
|
|
56949
|
+
const after = imageName.slice(lastSlashIndex + 1);
|
|
56950
|
+
if (prefix === "") {
|
|
56951
|
+
throw new InvalidError(
|
|
56952
|
+
"Invalid Image name: '/' prefix must be non-empty."
|
|
56953
|
+
);
|
|
56954
|
+
}
|
|
56955
|
+
if (after === "") {
|
|
56956
|
+
throw new InvalidError(
|
|
56957
|
+
"Invalid Image name: name after '/' must be non-empty."
|
|
56958
|
+
);
|
|
56959
|
+
}
|
|
56960
|
+
imageName = after;
|
|
55704
56961
|
}
|
|
55705
|
-
|
|
55706
|
-
const tag = value.slice(separatorIndex + 1);
|
|
55707
|
-
validateImageName(name);
|
|
56962
|
+
validateImageName(imageName);
|
|
55708
56963
|
validateImageTag(tag);
|
|
55709
|
-
|
|
56964
|
+
const fullName = prefix ? `${prefix}/${imageName}` : imageName;
|
|
56965
|
+
return [prefix, `${fullName}:${tag}`];
|
|
56966
|
+
}
|
|
56967
|
+
function registryConfigBuilder(authType, secret) {
|
|
56968
|
+
return async (client) => {
|
|
56969
|
+
let secretId = "";
|
|
56970
|
+
if (secret) {
|
|
56971
|
+
await hydrateSecrets(client, [secret]);
|
|
56972
|
+
secretId = secret.secretId;
|
|
56973
|
+
}
|
|
56974
|
+
return ImageRegistryConfig.create({
|
|
56975
|
+
registryAuthType: authType,
|
|
56976
|
+
secretId
|
|
56977
|
+
});
|
|
56978
|
+
};
|
|
55710
56979
|
}
|
|
55711
56980
|
var ImageService = class {
|
|
55712
56981
|
#client;
|
|
@@ -55738,10 +57007,21 @@ var ImageService = class {
|
|
|
55738
57007
|
* @param params - Optional environment.
|
|
55739
57008
|
*/
|
|
55740
57009
|
async fromName(name, params = {}) {
|
|
55741
|
-
const tag = parseNamedImageRef(name);
|
|
57010
|
+
const [namespacePrefix, tag] = parseNamedImageRef(name);
|
|
57011
|
+
let environmentName;
|
|
57012
|
+
if (namespacePrefix) {
|
|
57013
|
+
if (params.environment) {
|
|
57014
|
+
throw new InvalidError(
|
|
57015
|
+
"Cannot specify 'environment' when the image name contains a '/'."
|
|
57016
|
+
);
|
|
57017
|
+
}
|
|
57018
|
+
environmentName = "";
|
|
57019
|
+
} else {
|
|
57020
|
+
environmentName = this.#client.environmentName(params.environment);
|
|
57021
|
+
}
|
|
55742
57022
|
try {
|
|
55743
57023
|
const resp = await this.#client.cpClient.imageGetByTag({
|
|
55744
|
-
environmentName
|
|
57024
|
+
environmentName,
|
|
55745
57025
|
tag
|
|
55746
57026
|
});
|
|
55747
57027
|
return new Image2(this.#client, resp.imageId, "");
|
|
@@ -55758,19 +57038,19 @@ var ImageService = class {
|
|
|
55758
57038
|
* @param secret - Optional. A Secret containing credentials for registry authentication.
|
|
55759
57039
|
*/
|
|
55760
57040
|
fromRegistry(tag, secret) {
|
|
55761
|
-
let
|
|
57041
|
+
let buildRegistryConfig;
|
|
55762
57042
|
if (secret) {
|
|
55763
57043
|
if (!(secret instanceof Secret)) {
|
|
55764
57044
|
throw new TypeError(
|
|
55765
57045
|
"secret must be a reference to an existing Secret, e.g. `await client.secrets.fromName('my_secret')`"
|
|
55766
57046
|
);
|
|
55767
57047
|
}
|
|
55768
|
-
|
|
55769
|
-
|
|
55770
|
-
|
|
55771
|
-
|
|
57048
|
+
buildRegistryConfig = registryConfigBuilder(
|
|
57049
|
+
4 /* REGISTRY_AUTH_TYPE_STATIC_CREDS */,
|
|
57050
|
+
secret
|
|
57051
|
+
);
|
|
55772
57052
|
}
|
|
55773
|
-
return new Image2(this.#client, "", tag,
|
|
57053
|
+
return new Image2(this.#client, "", tag, buildRegistryConfig);
|
|
55774
57054
|
}
|
|
55775
57055
|
/**
|
|
55776
57056
|
* Creates an {@link Image} from a raw registry tag, optionally using a {@link Secret} for authentication.
|
|
@@ -55779,19 +57059,16 @@ var ImageService = class {
|
|
|
55779
57059
|
* @param secret - A Secret containing credentials for registry authentication.
|
|
55780
57060
|
*/
|
|
55781
57061
|
fromAwsEcr(tag, secret) {
|
|
55782
|
-
|
|
55783
|
-
|
|
55784
|
-
|
|
55785
|
-
|
|
55786
|
-
"secret must be a reference to an existing Secret, e.g. `await client.secrets.fromName('my_secret')`"
|
|
55787
|
-
);
|
|
55788
|
-
}
|
|
55789
|
-
imageRegistryConfig = {
|
|
55790
|
-
registryAuthType: 1 /* REGISTRY_AUTH_TYPE_AWS */,
|
|
55791
|
-
secretId: secret.secretId
|
|
55792
|
-
};
|
|
57062
|
+
if (!(secret instanceof Secret)) {
|
|
57063
|
+
throw new TypeError(
|
|
57064
|
+
"secret must be a reference to an existing Secret, e.g. `await client.secrets.fromName('my_secret')`"
|
|
57065
|
+
);
|
|
55793
57066
|
}
|
|
55794
|
-
|
|
57067
|
+
const buildRegistryConfig = registryConfigBuilder(
|
|
57068
|
+
1 /* REGISTRY_AUTH_TYPE_AWS */,
|
|
57069
|
+
secret
|
|
57070
|
+
);
|
|
57071
|
+
return new Image2(this.#client, "", tag, buildRegistryConfig);
|
|
55795
57072
|
}
|
|
55796
57073
|
/**
|
|
55797
57074
|
* Creates an {@link Image} from a raw registry tag, optionally using a {@link Secret} for authentication.
|
|
@@ -55800,19 +57077,16 @@ var ImageService = class {
|
|
|
55800
57077
|
* @param secret - A Secret containing credentials for registry authentication.
|
|
55801
57078
|
*/
|
|
55802
57079
|
fromGcpArtifactRegistry(tag, secret) {
|
|
55803
|
-
|
|
55804
|
-
|
|
55805
|
-
|
|
55806
|
-
|
|
55807
|
-
"secret must be a reference to an existing Secret, e.g. `await client.secrets.fromName('my_secret')`"
|
|
55808
|
-
);
|
|
55809
|
-
}
|
|
55810
|
-
imageRegistryConfig = {
|
|
55811
|
-
registryAuthType: 2 /* REGISTRY_AUTH_TYPE_GCP */,
|
|
55812
|
-
secretId: secret.secretId
|
|
55813
|
-
};
|
|
57080
|
+
if (!(secret instanceof Secret)) {
|
|
57081
|
+
throw new TypeError(
|
|
57082
|
+
"secret must be a reference to an existing Secret, e.g. `await client.secrets.fromName('my_secret')`"
|
|
57083
|
+
);
|
|
55814
57084
|
}
|
|
55815
|
-
|
|
57085
|
+
const buildRegistryConfig = registryConfigBuilder(
|
|
57086
|
+
2 /* REGISTRY_AUTH_TYPE_GCP */,
|
|
57087
|
+
secret
|
|
57088
|
+
);
|
|
57089
|
+
return new Image2(this.#client, "", tag, buildRegistryConfig);
|
|
55816
57090
|
}
|
|
55817
57091
|
/**
|
|
55818
57092
|
* Delete an {@link Image} by ID.
|
|
@@ -55842,15 +57116,18 @@ var Image2 = class _Image {
|
|
|
55842
57116
|
#tag;
|
|
55843
57117
|
// Image ID of the parent image layer to use as `FROM base`.
|
|
55844
57118
|
#baseImageId;
|
|
55845
|
-
|
|
57119
|
+
// When set, hydrates the registry-auth Secret (if any) and returns the
|
|
57120
|
+
// ImageRegistryConfig for the base build layer. Runs at build time, since the
|
|
57121
|
+
// Secret may be lazy. Undefined when not pulling from a private registry.
|
|
57122
|
+
#buildRegistryConfig;
|
|
55846
57123
|
#layers;
|
|
55847
57124
|
/** @ignore */
|
|
55848
|
-
constructor(client, imageId, tag,
|
|
57125
|
+
constructor(client, imageId, tag, buildRegistryConfig, layers, baseImageId) {
|
|
55849
57126
|
this.#client = client;
|
|
55850
57127
|
this.#imageId = imageId;
|
|
55851
57128
|
this.#tag = tag;
|
|
55852
57129
|
this.#baseImageId = baseImageId || "";
|
|
55853
|
-
this.#
|
|
57130
|
+
this.#buildRegistryConfig = buildRegistryConfig;
|
|
55854
57131
|
this.#layers = layers || [
|
|
55855
57132
|
{
|
|
55856
57133
|
commands: [],
|
|
@@ -55902,7 +57179,7 @@ var Image2 = class _Image {
|
|
|
55902
57179
|
this.#client,
|
|
55903
57180
|
"",
|
|
55904
57181
|
this.#tag,
|
|
55905
|
-
this.#
|
|
57182
|
+
this.#buildRegistryConfig,
|
|
55906
57183
|
[...layers, newLayer],
|
|
55907
57184
|
baseImageId
|
|
55908
57185
|
);
|
|
@@ -55928,6 +57205,7 @@ var Image2 = class _Image {
|
|
|
55928
57205
|
layer.env,
|
|
55929
57206
|
layer.secrets
|
|
55930
57207
|
);
|
|
57208
|
+
await hydrateSecrets(this.#client, mergedSecrets);
|
|
55931
57209
|
const secretIds = mergedSecrets.map((secret) => secret.secretId);
|
|
55932
57210
|
const gpuConfig = layer.gpuConfig;
|
|
55933
57211
|
let dockerfileCommands;
|
|
@@ -55942,7 +57220,7 @@ var Image2 = class _Image {
|
|
|
55942
57220
|
dockerfileCommands = ["FROM base", ...layer.commands];
|
|
55943
57221
|
baseImages = [{ dockerTag: "base", imageId: baseImageId }];
|
|
55944
57222
|
}
|
|
55945
|
-
const imageRegistryConfig = i === 0 && !baseImageId ? this.#
|
|
57223
|
+
const imageRegistryConfig = i === 0 && !baseImageId && this.#buildRegistryConfig ? await this.#buildRegistryConfig(this.#client) : void 0;
|
|
55946
57224
|
const resp = await this.#client.cpClient.imageGetOrCreate({
|
|
55947
57225
|
appId: app.appId,
|
|
55948
57226
|
image: Image.create({
|
|
@@ -56009,17 +57287,27 @@ ${result.exception}`
|
|
|
56009
57287
|
* @param params - Optional environment.
|
|
56010
57288
|
*/
|
|
56011
57289
|
async publish(name, params = {}) {
|
|
56012
|
-
const tag = parseNamedImageRef(name);
|
|
57290
|
+
const [namespacePrefix, tag] = parseNamedImageRef(name);
|
|
56013
57291
|
if (this.#imageId === "") {
|
|
56014
57292
|
throw new InvalidError(
|
|
56015
57293
|
"Cannot publish an image that has not been built yet. Call build() first."
|
|
56016
57294
|
);
|
|
56017
57295
|
}
|
|
56018
|
-
|
|
57296
|
+
let environmentName;
|
|
57297
|
+
if (namespacePrefix) {
|
|
57298
|
+
if (params.environment) {
|
|
57299
|
+
throw new InvalidError(
|
|
57300
|
+
"Cannot specify 'environment' when the image name contains a '/'."
|
|
57301
|
+
);
|
|
57302
|
+
}
|
|
57303
|
+
environmentName = "";
|
|
57304
|
+
} else {
|
|
57305
|
+
environmentName = this.#client.environmentName(params.environment);
|
|
57306
|
+
}
|
|
56019
57307
|
await this.#client.cpClient.imagePublish({
|
|
56020
57308
|
imageId: this.#imageId,
|
|
56021
57309
|
environmentName,
|
|
56022
|
-
|
|
57310
|
+
allowPublic: false,
|
|
56023
57311
|
tag
|
|
56024
57312
|
});
|
|
56025
57313
|
}
|
|
@@ -58227,8 +59515,45 @@ var TaskExecStdinWriteResponse = {
|
|
|
58227
59515
|
return message;
|
|
58228
59516
|
}
|
|
58229
59517
|
};
|
|
59518
|
+
function createBaseTaskExecStdinWriteStreamEnd() {
|
|
59519
|
+
return {};
|
|
59520
|
+
}
|
|
59521
|
+
var TaskExecStdinWriteStreamEnd = {
|
|
59522
|
+
encode(_, writer = new BinaryWriter()) {
|
|
59523
|
+
return writer;
|
|
59524
|
+
},
|
|
59525
|
+
decode(input, length) {
|
|
59526
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
59527
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
59528
|
+
const message = createBaseTaskExecStdinWriteStreamEnd();
|
|
59529
|
+
while (reader.pos < end) {
|
|
59530
|
+
const tag = reader.uint32();
|
|
59531
|
+
switch (tag >>> 3) {
|
|
59532
|
+
}
|
|
59533
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
59534
|
+
break;
|
|
59535
|
+
}
|
|
59536
|
+
reader.skip(tag & 7);
|
|
59537
|
+
}
|
|
59538
|
+
return message;
|
|
59539
|
+
},
|
|
59540
|
+
fromJSON(_) {
|
|
59541
|
+
return {};
|
|
59542
|
+
},
|
|
59543
|
+
toJSON(_) {
|
|
59544
|
+
const obj = {};
|
|
59545
|
+
return obj;
|
|
59546
|
+
},
|
|
59547
|
+
create(base) {
|
|
59548
|
+
return TaskExecStdinWriteStreamEnd.fromPartial(base ?? {});
|
|
59549
|
+
},
|
|
59550
|
+
fromPartial(_) {
|
|
59551
|
+
const message = createBaseTaskExecStdinWriteStreamEnd();
|
|
59552
|
+
return message;
|
|
59553
|
+
}
|
|
59554
|
+
};
|
|
58230
59555
|
function createBaseTaskExecStdinWriteStreamRequest() {
|
|
58231
|
-
return { start: void 0, data: void 0 };
|
|
59556
|
+
return { start: void 0, data: void 0, end: void 0 };
|
|
58232
59557
|
}
|
|
58233
59558
|
var TaskExecStdinWriteStreamRequest = {
|
|
58234
59559
|
encode(message, writer = new BinaryWriter()) {
|
|
@@ -58238,6 +59563,9 @@ var TaskExecStdinWriteStreamRequest = {
|
|
|
58238
59563
|
if (message.data !== void 0) {
|
|
58239
59564
|
writer.uint32(18).bytes(message.data);
|
|
58240
59565
|
}
|
|
59566
|
+
if (message.end !== void 0) {
|
|
59567
|
+
TaskExecStdinWriteStreamEnd.encode(message.end, writer.uint32(26).fork()).join();
|
|
59568
|
+
}
|
|
58241
59569
|
return writer;
|
|
58242
59570
|
},
|
|
58243
59571
|
decode(input, length) {
|
|
@@ -58261,6 +59589,13 @@ var TaskExecStdinWriteStreamRequest = {
|
|
|
58261
59589
|
message.data = reader.bytes();
|
|
58262
59590
|
continue;
|
|
58263
59591
|
}
|
|
59592
|
+
case 3: {
|
|
59593
|
+
if (tag !== 26) {
|
|
59594
|
+
break;
|
|
59595
|
+
}
|
|
59596
|
+
message.end = TaskExecStdinWriteStreamEnd.decode(reader, reader.uint32());
|
|
59597
|
+
continue;
|
|
59598
|
+
}
|
|
58264
59599
|
}
|
|
58265
59600
|
if ((tag & 7) === 4 || tag === 0) {
|
|
58266
59601
|
break;
|
|
@@ -58272,7 +59607,8 @@ var TaskExecStdinWriteStreamRequest = {
|
|
|
58272
59607
|
fromJSON(object) {
|
|
58273
59608
|
return {
|
|
58274
59609
|
start: isSet6(object.start) ? TaskExecStdinWriteStreamStart.fromJSON(object.start) : void 0,
|
|
58275
|
-
data: isSet6(object.data) ? bytesFromBase643(object.data) : void 0
|
|
59610
|
+
data: isSet6(object.data) ? bytesFromBase643(object.data) : void 0,
|
|
59611
|
+
end: isSet6(object.end) ? TaskExecStdinWriteStreamEnd.fromJSON(object.end) : void 0
|
|
58276
59612
|
};
|
|
58277
59613
|
},
|
|
58278
59614
|
toJSON(message) {
|
|
@@ -58283,6 +59619,9 @@ var TaskExecStdinWriteStreamRequest = {
|
|
|
58283
59619
|
if (message.data !== void 0) {
|
|
58284
59620
|
obj.data = base64FromBytes3(message.data);
|
|
58285
59621
|
}
|
|
59622
|
+
if (message.end !== void 0) {
|
|
59623
|
+
obj.end = TaskExecStdinWriteStreamEnd.toJSON(message.end);
|
|
59624
|
+
}
|
|
58286
59625
|
return obj;
|
|
58287
59626
|
},
|
|
58288
59627
|
create(base) {
|
|
@@ -58292,6 +59631,7 @@ var TaskExecStdinWriteStreamRequest = {
|
|
|
58292
59631
|
const message = createBaseTaskExecStdinWriteStreamRequest();
|
|
58293
59632
|
message.start = object.start !== void 0 && object.start !== null ? TaskExecStdinWriteStreamStart.fromPartial(object.start) : void 0;
|
|
58294
59633
|
message.data = object.data ?? void 0;
|
|
59634
|
+
message.end = object.end !== void 0 && object.end !== null ? TaskExecStdinWriteStreamEnd.fromPartial(object.end) : void 0;
|
|
58295
59635
|
return message;
|
|
58296
59636
|
}
|
|
58297
59637
|
};
|
|
@@ -59930,7 +61270,7 @@ var AuthTokenManager = class {
|
|
|
59930
61270
|
};
|
|
59931
61271
|
|
|
59932
61272
|
// src/version.ts
|
|
59933
|
-
var SDK_VERSION = "0.
|
|
61273
|
+
var SDK_VERSION = "0.9.0";
|
|
59934
61274
|
function getSDKVersion() {
|
|
59935
61275
|
return SDK_VERSION;
|
|
59936
61276
|
}
|
|
@@ -60831,9 +62171,36 @@ var TaskCommandRouterClientImpl = class _TaskCommandRouterClientImpl {
|
|
|
60831
62171
|
async setNetworkAccess(request) {
|
|
60832
62172
|
await this.callUnary(() => this.stub.taskSetNetworkAccess(request));
|
|
60833
62173
|
}
|
|
60834
|
-
/**
|
|
60835
|
-
|
|
60836
|
-
|
|
62174
|
+
/**
|
|
62175
|
+
* Reload all Volumes mounted in the task to reflect their latest committed state.
|
|
62176
|
+
*
|
|
62177
|
+
* `timeoutMs` is the client-side deadline. If the reload does not complete
|
|
62178
|
+
* within this window, the call is cancelled and a TimeoutError is thrown.
|
|
62179
|
+
*/
|
|
62180
|
+
async reloadVolumes(request, options) {
|
|
62181
|
+
const overallDeadlineMs = options?.timeoutMs !== void 0 ? Date.now() + options.timeoutMs : null;
|
|
62182
|
+
try {
|
|
62183
|
+
await callWithRetriesOnTransientErrors(
|
|
62184
|
+
() => this.callWithAuthRetry(() => {
|
|
62185
|
+
const remainingMs = overallDeadlineMs !== null ? Math.max(1, overallDeadlineMs - Date.now()) : options?.timeoutMs;
|
|
62186
|
+
return this.stub.taskReloadVolumes(request, {
|
|
62187
|
+
...options,
|
|
62188
|
+
timeoutMs: remainingMs
|
|
62189
|
+
});
|
|
62190
|
+
}),
|
|
62191
|
+
10,
|
|
62192
|
+
2,
|
|
62193
|
+
10,
|
|
62194
|
+
overallDeadlineMs,
|
|
62195
|
+
() => this.closed,
|
|
62196
|
+
[import_nice_grpc11.Status.DEADLINE_EXCEEDED, import_nice_grpc11.Status.CANCELLED]
|
|
62197
|
+
);
|
|
62198
|
+
} catch (err) {
|
|
62199
|
+
if (overallDeadlineMs !== null && Date.now() >= overallDeadlineMs) {
|
|
62200
|
+
throw new TimeoutError("Timeout expired");
|
|
62201
|
+
}
|
|
62202
|
+
throw err;
|
|
62203
|
+
}
|
|
60837
62204
|
}
|
|
60838
62205
|
async sandboxWaitUntilReady(taskId, timeoutMs) {
|
|
60839
62206
|
const deadlineMs = Date.now() + timeoutMs;
|
|
@@ -61200,6 +62567,44 @@ function raiseStatError(returnCode, stderr, remotePath) {
|
|
|
61200
62567
|
function makeStatCommand(remotePath) {
|
|
61201
62568
|
return JSON.stringify({ Stat: { path: remotePath } });
|
|
61202
62569
|
}
|
|
62570
|
+
function raiseWatchError(returnCode, stderr, remotePath) {
|
|
62571
|
+
const payload = tryParseErrorPayload(stderr);
|
|
62572
|
+
if (payload) {
|
|
62573
|
+
logger.debug(
|
|
62574
|
+
`sandbox-fs-tools watch error: path=${remotePath}, error_kind=${payload.error_kind}, message=${payload.message}, detail=${payload.detail}`
|
|
62575
|
+
);
|
|
62576
|
+
if (payload.error_kind === "NotFound")
|
|
62577
|
+
throw new SandboxFilesystemNotFoundError(
|
|
62578
|
+
`${payload.message}: ${remotePath}`
|
|
62579
|
+
);
|
|
62580
|
+
if (payload.error_kind === "PermissionDenied")
|
|
62581
|
+
throw new SandboxFilesystemPermissionError(
|
|
62582
|
+
`${payload.message}: ${remotePath}`
|
|
62583
|
+
);
|
|
62584
|
+
if (payload.error_kind === "NotSupported")
|
|
62585
|
+
throw new InvalidError(
|
|
62586
|
+
`${payload.message}: ${remotePath} - this operation is not supported for CloudBucketMounts`
|
|
62587
|
+
);
|
|
62588
|
+
throw new SandboxFilesystemError(payload.message);
|
|
62589
|
+
}
|
|
62590
|
+
const text = stderrToText(stderr);
|
|
62591
|
+
if (text) logger.debug(`Unstructured modal-sandbox-fs-tools stderr: ${text}`);
|
|
62592
|
+
throw new SandboxFilesystemError(
|
|
62593
|
+
`Operation on '${remotePath}' failed with exit code ${returnCode}`
|
|
62594
|
+
);
|
|
62595
|
+
}
|
|
62596
|
+
function makeWatchCommand(remotePath, opts) {
|
|
62597
|
+
return JSON.stringify({
|
|
62598
|
+
Watch: {
|
|
62599
|
+
path: remotePath,
|
|
62600
|
+
recursive: opts.recursive,
|
|
62601
|
+
filter: opts.filter,
|
|
62602
|
+
// The fs-tools wire protocol takes whole seconds; convert from the SDK's
|
|
62603
|
+
// millisecond convention, truncating any sub-second remainder.
|
|
62604
|
+
timeout_secs: opts.timeoutMs !== null ? Math.trunc(opts.timeoutMs / 1e3) : null
|
|
62605
|
+
}
|
|
62606
|
+
});
|
|
62607
|
+
}
|
|
61203
62608
|
function raiseWriteFileError(returnCode, stderr, remotePath) {
|
|
61204
62609
|
const payload = tryParseErrorPayload(stderr);
|
|
61205
62610
|
if (payload) {
|
|
@@ -61293,6 +62698,36 @@ function parseFileEntry(raw) {
|
|
|
61293
62698
|
symlinkTarget: raw.symlink_target ?? null
|
|
61294
62699
|
};
|
|
61295
62700
|
}
|
|
62701
|
+
var RUST_RENAME_VARIANTS = ["Rename", "RenameFrom", "RenameTo"];
|
|
62702
|
+
var VALID_EVENT_TYPES = /* @__PURE__ */ new Set([
|
|
62703
|
+
"Access",
|
|
62704
|
+
"Create",
|
|
62705
|
+
"Modify",
|
|
62706
|
+
"Remove",
|
|
62707
|
+
"Unknown"
|
|
62708
|
+
]);
|
|
62709
|
+
function expandWatchFilter(filter) {
|
|
62710
|
+
const result = [];
|
|
62711
|
+
for (const eventType of filter) {
|
|
62712
|
+
result.push(eventType);
|
|
62713
|
+
if (eventType === "Modify") {
|
|
62714
|
+
result.push(...RUST_RENAME_VARIANTS);
|
|
62715
|
+
}
|
|
62716
|
+
}
|
|
62717
|
+
return result;
|
|
62718
|
+
}
|
|
62719
|
+
async function* readLines(stream) {
|
|
62720
|
+
const decoder2 = new TextDecoder();
|
|
62721
|
+
let buffer = "";
|
|
62722
|
+
for await (const chunk of stream) {
|
|
62723
|
+
buffer += typeof chunk === "string" ? chunk : decoder2.decode(chunk, { stream: true });
|
|
62724
|
+
const lines = buffer.split("\n");
|
|
62725
|
+
buffer = lines.pop() ?? "";
|
|
62726
|
+
for (const line of lines) yield line;
|
|
62727
|
+
}
|
|
62728
|
+
const tail = decoder2.decode(void 0, { stream: false });
|
|
62729
|
+
if (buffer + tail) yield buffer + tail;
|
|
62730
|
+
}
|
|
61296
62731
|
var WRITE_CHUNK_SIZE = 4 * 1024 * 1024;
|
|
61297
62732
|
function toUint8Array(data) {
|
|
61298
62733
|
if (data instanceof ArrayBuffer) return new Uint8Array(data);
|
|
@@ -61570,6 +63005,94 @@ var SandboxFilesystem = class {
|
|
|
61570
63005
|
});
|
|
61571
63006
|
return parseFileEntry(JSON.parse(stdout));
|
|
61572
63007
|
}
|
|
63008
|
+
/**
|
|
63009
|
+
* Watch a path in the Sandbox for filesystem changes.
|
|
63010
|
+
*
|
|
63011
|
+
* `remotePath` must be an absolute path in the Sandbox. If it points to a
|
|
63012
|
+
* file, events for that file are reported. If it points to a directory,
|
|
63013
|
+
* events for entries directly inside it are reported. Set `recursive: true`
|
|
63014
|
+
* to also receive events for all nested subdirectories. If `remotePath` is
|
|
63015
|
+
* a symlink, it is followed and events reference paths under the resolved
|
|
63016
|
+
* target.
|
|
63017
|
+
*
|
|
63018
|
+
* Yields {@link FileWatchEvent} objects as changes occur, until either the
|
|
63019
|
+
* timeout elapses, the iterator is closed, or the Sandbox is terminated.
|
|
63020
|
+
*
|
|
63021
|
+
* Optionally restrict the kinds of events emitted to those included in
|
|
63022
|
+
* `filter`. An undefined `filter` permits all types; passing an empty array
|
|
63023
|
+
* suppresses all events.
|
|
63024
|
+
*
|
|
63025
|
+
* `timeoutMs` is truncated to whole seconds. Omit it to watch indefinitely.
|
|
63026
|
+
* When the timeout elapses, the iterator stops without raising an exception.
|
|
63027
|
+
*
|
|
63028
|
+
* @throws {SandboxFilesystemNotFoundError} `remotePath` does not exist.
|
|
63029
|
+
* @throws {SandboxFilesystemPermissionError} watch access is denied.
|
|
63030
|
+
* @throws {InvalidError} the filesystem does not support watching.
|
|
63031
|
+
* @throws {SandboxFilesystemError} the command fails for any other reason.
|
|
63032
|
+
*/
|
|
63033
|
+
async *watch(remotePath, params = {}) {
|
|
63034
|
+
validateAbsoluteRemotePath(remotePath, "watch");
|
|
63035
|
+
checkForRenamedParams(params, { timeout: "timeoutMs" });
|
|
63036
|
+
const { filter, recursive = false, timeoutMs } = params;
|
|
63037
|
+
const process2 = await translateExecErrors(
|
|
63038
|
+
"watch",
|
|
63039
|
+
remotePath,
|
|
63040
|
+
() => this.exec(
|
|
63041
|
+
[
|
|
63042
|
+
SANDBOX_FS_TOOLS_PATH,
|
|
63043
|
+
makeWatchCommand(remotePath, {
|
|
63044
|
+
recursive,
|
|
63045
|
+
filter: filter !== void 0 ? expandWatchFilter(filter) : null,
|
|
63046
|
+
timeoutMs: timeoutMs ?? null
|
|
63047
|
+
})
|
|
63048
|
+
],
|
|
63049
|
+
{ mode: "text" }
|
|
63050
|
+
)
|
|
63051
|
+
);
|
|
63052
|
+
let streamEnded = false;
|
|
63053
|
+
try {
|
|
63054
|
+
for await (const line of readLines(process2.stdout)) {
|
|
63055
|
+
const trimmed = line.trim();
|
|
63056
|
+
if (!trimmed) continue;
|
|
63057
|
+
let data;
|
|
63058
|
+
try {
|
|
63059
|
+
data = JSON.parse(trimmed);
|
|
63060
|
+
} catch {
|
|
63061
|
+
continue;
|
|
63062
|
+
}
|
|
63063
|
+
const paths = data.paths ?? [];
|
|
63064
|
+
if (paths.length === 0) continue;
|
|
63065
|
+
let rawType = data.event_type;
|
|
63066
|
+
if (typeof rawType !== "string") continue;
|
|
63067
|
+
if (RUST_RENAME_VARIANTS.includes(rawType)) {
|
|
63068
|
+
rawType = "Modify";
|
|
63069
|
+
}
|
|
63070
|
+
if (!VALID_EVENT_TYPES.has(rawType)) continue;
|
|
63071
|
+
yield { eventType: rawType, paths };
|
|
63072
|
+
}
|
|
63073
|
+
streamEnded = true;
|
|
63074
|
+
} catch (err) {
|
|
63075
|
+
await translateExecErrors("watch", remotePath, () => {
|
|
63076
|
+
throw err;
|
|
63077
|
+
});
|
|
63078
|
+
throw err;
|
|
63079
|
+
} finally {
|
|
63080
|
+
await process2.closeStdin().catch(() => {
|
|
63081
|
+
});
|
|
63082
|
+
if (streamEnded) {
|
|
63083
|
+
await translateExecErrors("watch", remotePath, async () => {
|
|
63084
|
+
const returnCode = await process2.wait();
|
|
63085
|
+
if (returnCode !== 0) {
|
|
63086
|
+
const stderr = await process2.stderr.readBytes();
|
|
63087
|
+
raiseWatchError(returnCode, stderr, remotePath);
|
|
63088
|
+
}
|
|
63089
|
+
});
|
|
63090
|
+
} else {
|
|
63091
|
+
await process2.wait().catch(() => {
|
|
63092
|
+
});
|
|
63093
|
+
}
|
|
63094
|
+
}
|
|
63095
|
+
}
|
|
61573
63096
|
/**
|
|
61574
63097
|
* Write binary content to a file in the Sandbox.
|
|
61575
63098
|
*
|
|
@@ -61680,7 +63203,13 @@ var SidecarService = class {
|
|
|
61680
63203
|
const command = params?.command ?? [];
|
|
61681
63204
|
validateExecArgs(command);
|
|
61682
63205
|
validateWorkdir(params?.workdir);
|
|
61683
|
-
|
|
63206
|
+
validateEnvVarKeys(params?.env ?? {});
|
|
63207
|
+
const [envDict, resolvableSecrets] = splitEnvDictAndResolvableSecrets(
|
|
63208
|
+
params?.secrets ?? []
|
|
63209
|
+
);
|
|
63210
|
+
Object.assign(envDict, params?.env ?? {});
|
|
63211
|
+
await hydrateSecrets(this.#access.client, resolvableSecrets);
|
|
63212
|
+
const secretIds = collectSecretIds(resolvableSecrets);
|
|
61684
63213
|
const [taskId, client] = await this.#access.commandRouter();
|
|
61685
63214
|
let resp;
|
|
61686
63215
|
try {
|
|
@@ -61690,7 +63219,7 @@ var SidecarService = class {
|
|
|
61690
63219
|
containerName: name,
|
|
61691
63220
|
imageId: image.imageId,
|
|
61692
63221
|
args: command,
|
|
61693
|
-
env:
|
|
63222
|
+
env: envDict,
|
|
61694
63223
|
workdir: params?.workdir ?? "",
|
|
61695
63224
|
secretIds
|
|
61696
63225
|
})
|
|
@@ -62302,9 +63831,11 @@ async function buildSandboxCreateV2RequestProto(appId, imageId, params = {}) {
|
|
|
62302
63831
|
throw new Error("custom domains are not supported by experimentalCreate");
|
|
62303
63832
|
}
|
|
62304
63833
|
const req = await buildSandboxCreateRequestProto(appId, imageId, params);
|
|
63834
|
+
const ephemeralSecrets = params.env && Object.keys(params.env).length > 0 ? StringMap.create({ contents: params.env }) : void 0;
|
|
62305
63835
|
return SandboxCreateV2Request.create({
|
|
62306
63836
|
appId: req.appId,
|
|
62307
|
-
definition: req.definition
|
|
63837
|
+
definition: req.definition,
|
|
63838
|
+
ephemeralSecrets
|
|
62308
63839
|
});
|
|
62309
63840
|
}
|
|
62310
63841
|
var SandboxService = class {
|
|
@@ -62322,6 +63853,11 @@ var SandboxService = class {
|
|
|
62322
63853
|
params.env,
|
|
62323
63854
|
params.secrets
|
|
62324
63855
|
);
|
|
63856
|
+
await hydrateSandboxSecrets(
|
|
63857
|
+
this.#client,
|
|
63858
|
+
mergedSecrets,
|
|
63859
|
+
params.cloudBucketMounts
|
|
63860
|
+
);
|
|
62325
63861
|
const mergedParams = {
|
|
62326
63862
|
...params,
|
|
62327
63863
|
secrets: mergedSecrets,
|
|
@@ -62361,24 +63897,28 @@ var SandboxService = class {
|
|
|
62361
63897
|
* supported.
|
|
62362
63898
|
*
|
|
62363
63899
|
* V2 sandboxes created with this method are not currently returned by
|
|
62364
|
-
* {@link SandboxService#list client.sandboxes.list()}
|
|
62365
|
-
*
|
|
62366
|
-
* {@link
|
|
62367
|
-
*
|
|
62368
|
-
* to reattach.
|
|
63900
|
+
* {@link SandboxService#list client.sandboxes.list()}. A named Sandbox can be
|
|
63901
|
+
* looked up with
|
|
63902
|
+
* {@link SandboxService#experimentalFromName client.sandboxes.experimentalFromName()};
|
|
63903
|
+
* otherwise store {@link Sandbox#sandboxId sandbox.sandboxId} and use
|
|
63904
|
+
* {@link SandboxService#fromId client.sandboxes.fromId()} to reattach.
|
|
62369
63905
|
*/
|
|
62370
63906
|
async experimentalCreate(app, image, params = {}) {
|
|
62371
63907
|
await image.build(app);
|
|
62372
|
-
|
|
63908
|
+
validateEnvVarKeys(params.env ?? {});
|
|
63909
|
+
const [envDict, resolvableSecrets] = splitEnvDictAndResolvableSecrets(
|
|
63910
|
+
params.secrets ?? []
|
|
63911
|
+
);
|
|
63912
|
+
Object.assign(envDict, params.env ?? {});
|
|
63913
|
+
await hydrateSandboxSecrets(
|
|
62373
63914
|
this.#client,
|
|
62374
|
-
|
|
62375
|
-
params.
|
|
63915
|
+
resolvableSecrets,
|
|
63916
|
+
params.cloudBucketMounts
|
|
62376
63917
|
);
|
|
62377
63918
|
const mergedParams = {
|
|
62378
63919
|
...params,
|
|
62379
|
-
secrets:
|
|
62380
|
-
env:
|
|
62381
|
-
// setting env to undefined just to clarify it's not needed anymore
|
|
63920
|
+
secrets: resolvableSecrets,
|
|
63921
|
+
env: envDict
|
|
62382
63922
|
};
|
|
62383
63923
|
const createReq = await buildSandboxCreateV2RequestProto(
|
|
62384
63924
|
app.appId,
|
|
@@ -62446,6 +63986,35 @@ var SandboxService = class {
|
|
|
62446
63986
|
throw err;
|
|
62447
63987
|
}
|
|
62448
63988
|
}
|
|
63989
|
+
/**
|
|
63990
|
+
* Get a running V2 {@link Sandbox} by name from a deployed {@link App}.
|
|
63991
|
+
*
|
|
63992
|
+
* This looks up V2 Sandboxes, i.e. Sandboxes created via
|
|
63993
|
+
* {@link SandboxService#experimentalCreate client.sandboxes.experimentalCreate()}.
|
|
63994
|
+
*
|
|
63995
|
+
* EXPERIMENTAL: the API is subject to change.
|
|
63996
|
+
*
|
|
63997
|
+
* @param appName - Name of the deployed App
|
|
63998
|
+
* @param name - Name of the Sandbox
|
|
63999
|
+
* @param params - Optional parameters for getting the Sandbox
|
|
64000
|
+
* @returns Promise that resolves to a Sandbox
|
|
64001
|
+
*/
|
|
64002
|
+
async experimentalFromName(appName, name, params) {
|
|
64003
|
+
try {
|
|
64004
|
+
const resp = await this.#client.cpClient.sandboxGetFromNameV2({
|
|
64005
|
+
sandboxName: name,
|
|
64006
|
+
appName,
|
|
64007
|
+
environmentName: this.#client.environmentName(params?.environment)
|
|
64008
|
+
});
|
|
64009
|
+
return new Sandbox2(this.#client, resp.sandboxId, { isV2: true });
|
|
64010
|
+
} catch (err) {
|
|
64011
|
+
if (err instanceof import_nice_grpc15.ClientError && err.code === import_nice_grpc15.Status.NOT_FOUND)
|
|
64012
|
+
throw new NotFoundError(
|
|
64013
|
+
`Sandbox with name '${name}' not found in App '${appName}'`
|
|
64014
|
+
);
|
|
64015
|
+
throw err;
|
|
64016
|
+
}
|
|
64017
|
+
}
|
|
62449
64018
|
/**
|
|
62450
64019
|
* List all {@link Sandbox}es for the current Environment or App ID (if specified).
|
|
62451
64020
|
* If tags are specified, only Sandboxes that have at least those tags are returned.
|
|
@@ -62487,8 +64056,8 @@ var SandboxService = class {
|
|
|
62487
64056
|
* This lists V2 Sandboxes, i.e. Sandboxes created via
|
|
62488
64057
|
* {@link SandboxService#experimentalCreate client.sandboxes.experimentalCreate()}.
|
|
62489
64058
|
* Such Sandboxes are not returned by
|
|
62490
|
-
* {@link SandboxService#list client.sandboxes.list()}.
|
|
62491
|
-
*
|
|
64059
|
+
* {@link SandboxService#list client.sandboxes.list()}. If tags are specified,
|
|
64060
|
+
* only Sandboxes that have at least those tags are returned.
|
|
62492
64061
|
*
|
|
62493
64062
|
* Yields {@link Sandbox} objects that are currently running in the App.
|
|
62494
64063
|
*
|
|
@@ -62500,12 +64069,17 @@ var SandboxService = class {
|
|
|
62500
64069
|
'experimentalList requires an `appId`:\n\nconst app = await modal.apps.fromName("my-app");\nmodal.sandboxes.experimentalList({ appId: app.appId });'
|
|
62501
64070
|
);
|
|
62502
64071
|
}
|
|
64072
|
+
const tagsList = params.tags ? Object.entries(params.tags).map(([tagName, tagValue]) => ({
|
|
64073
|
+
tagName,
|
|
64074
|
+
tagValue
|
|
64075
|
+
})) : [];
|
|
62503
64076
|
let beforeTimestamp = void 0;
|
|
62504
64077
|
while (true) {
|
|
62505
64078
|
const resp = await this.#client.cpClient.sandboxListV2({
|
|
62506
64079
|
appId: params.appId,
|
|
62507
64080
|
beforeTimestamp,
|
|
62508
|
-
includeFinished: false
|
|
64081
|
+
includeFinished: false,
|
|
64082
|
+
tags: tagsList
|
|
62509
64083
|
});
|
|
62510
64084
|
if (!resp.sandboxes || resp.sandboxes.length === 0) {
|
|
62511
64085
|
return;
|
|
@@ -62573,6 +64147,17 @@ function validateWorkdir(workdir) {
|
|
|
62573
64147
|
throw new InvalidError(`workdir must be an absolute path, got: ${workdir}`);
|
|
62574
64148
|
}
|
|
62575
64149
|
}
|
|
64150
|
+
async function hydrateSandboxSecrets(client, secrets, mounts) {
|
|
64151
|
+
const toHydrate = [...secrets];
|
|
64152
|
+
if (mounts) {
|
|
64153
|
+
for (const mount of Object.values(mounts)) {
|
|
64154
|
+
if (mount?.secret) {
|
|
64155
|
+
toHydrate.push(mount.secret);
|
|
64156
|
+
}
|
|
64157
|
+
}
|
|
64158
|
+
}
|
|
64159
|
+
await hydrateSecrets(client, toHydrate);
|
|
64160
|
+
}
|
|
62576
64161
|
function getReturnCode(result) {
|
|
62577
64162
|
if (result === void 0 || result.status === 0 /* GENERIC_STATUS_UNSPECIFIED */) {
|
|
62578
64163
|
return null;
|
|
@@ -62745,6 +64330,7 @@ var Sandbox2 = class _Sandbox {
|
|
|
62745
64330
|
this.#ensureAttached();
|
|
62746
64331
|
if (!this.#sidecars) {
|
|
62747
64332
|
this.#sidecars = new SidecarService({
|
|
64333
|
+
client: this.#client,
|
|
62748
64334
|
exec: (command, params, containerId) => this.#execInternal(command, params, containerId),
|
|
62749
64335
|
commandRouter: () => this.#getCommandRouter()
|
|
62750
64336
|
});
|
|
@@ -62799,13 +64385,24 @@ var Sandbox2 = class _Sandbox {
|
|
|
62799
64385
|
async #execInternal(command, params, containerId) {
|
|
62800
64386
|
this.#ensureAttached();
|
|
62801
64387
|
validateExecArgs(command);
|
|
64388
|
+
validateEnvVarKeys(params?.env ?? {});
|
|
64389
|
+
const [envDict, resolvableSecrets] = splitEnvDictAndResolvableSecrets(
|
|
64390
|
+
params?.secrets ?? []
|
|
64391
|
+
);
|
|
64392
|
+
Object.assign(envDict, params?.env ?? {});
|
|
64393
|
+
await hydrateSecrets(this.#client, resolvableSecrets);
|
|
64394
|
+
const execParams = {
|
|
64395
|
+
...params,
|
|
64396
|
+
env: envDict,
|
|
64397
|
+
secrets: resolvableSecrets
|
|
64398
|
+
};
|
|
62802
64399
|
const [taskId, commandRouterClient] = await this.#getCommandRouter();
|
|
62803
64400
|
const execId = (0, import_uuid2.v4)();
|
|
62804
64401
|
const request = buildTaskExecStartRequestProto(
|
|
62805
64402
|
taskId,
|
|
62806
64403
|
execId,
|
|
62807
64404
|
command,
|
|
62808
|
-
|
|
64405
|
+
execParams,
|
|
62809
64406
|
containerId
|
|
62810
64407
|
);
|
|
62811
64408
|
await commandRouterClient.execStart(request);
|
|
@@ -63138,20 +64735,25 @@ var Sandbox2 = class _Sandbox {
|
|
|
63138
64735
|
}
|
|
63139
64736
|
/**
|
|
63140
64737
|
* Reload all Volumes mounted in the Sandbox.
|
|
64738
|
+
*
|
|
64739
|
+
* Blocks until the Volumes have been reloaded, bounded by `timeoutMs` (55000
|
|
64740
|
+
* by default). If the reload does not complete within that window, a
|
|
64741
|
+
* `TimeoutError` is thrown; note that the reload may still complete in the
|
|
64742
|
+
* background.
|
|
64743
|
+
*
|
|
64744
|
+
* @param params - Optional parameters; see {@link SandboxReloadVolumesParams}.
|
|
63141
64745
|
*/
|
|
63142
|
-
async reloadVolumes() {
|
|
64746
|
+
async reloadVolumes(params) {
|
|
63143
64747
|
this.#ensureAttached();
|
|
63144
|
-
|
|
63145
|
-
|
|
63146
|
-
const commandRouterClient = await this.#getOrCreateCommandRouterClient(taskId);
|
|
63147
|
-
await commandRouterClient.reloadVolumes(
|
|
63148
|
-
TaskReloadVolumesRequest.create({ taskId })
|
|
63149
|
-
);
|
|
63150
|
-
} else {
|
|
63151
|
-
await this.#client.cpClient.containerReloadVolumes(
|
|
63152
|
-
ContainerReloadVolumesRequest.create({ taskId })
|
|
63153
|
-
);
|
|
64748
|
+
if (params?.timeoutMs !== void 0 && params.timeoutMs < 0) {
|
|
64749
|
+
throw new InvalidError("`timeoutMs` must not be negative");
|
|
63154
64750
|
}
|
|
64751
|
+
const timeoutMs = params?.timeoutMs || 55e3;
|
|
64752
|
+
const [taskId, commandRouterClient] = await this.#getCommandRouter();
|
|
64753
|
+
await commandRouterClient.reloadVolumes(
|
|
64754
|
+
TaskReloadVolumesRequest.create({ taskId }),
|
|
64755
|
+
{ timeoutMs }
|
|
64756
|
+
);
|
|
63155
64757
|
}
|
|
63156
64758
|
/**
|
|
63157
64759
|
* Snapshots and creates a new {@link Image} from a directory in the running sandbox.
|