modal 0.11.1-dev.6 → 0.11.1-dev.8
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/dist/index.cjs +528 -9
- package/dist/index.d.cts +131 -16
- package/dist/index.d.ts +131 -16
- package/dist/index.js +528 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2170,6 +2170,9 @@ function environmentTypeFromJSON(object) {
|
|
|
2170
2170
|
case 1:
|
|
2171
2171
|
case "ENVIRONMENT_TYPE_PUBLIC":
|
|
2172
2172
|
return 1 /* ENVIRONMENT_TYPE_PUBLIC */;
|
|
2173
|
+
case 2:
|
|
2174
|
+
case "ENVIRONMENT_TYPE_MODAL_ADMINISTERED":
|
|
2175
|
+
return 2 /* ENVIRONMENT_TYPE_MODAL_ADMINISTERED */;
|
|
2173
2176
|
case -1:
|
|
2174
2177
|
case "UNRECOGNIZED":
|
|
2175
2178
|
default:
|
|
@@ -2182,6 +2185,8 @@ function environmentTypeToJSON(object) {
|
|
|
2182
2185
|
return "ENVIRONMENT_TYPE_UNSPECIFIED";
|
|
2183
2186
|
case 1 /* ENVIRONMENT_TYPE_PUBLIC */:
|
|
2184
2187
|
return "ENVIRONMENT_TYPE_PUBLIC";
|
|
2188
|
+
case 2 /* ENVIRONMENT_TYPE_MODAL_ADMINISTERED */:
|
|
2189
|
+
return "ENVIRONMENT_TYPE_MODAL_ADMINISTERED";
|
|
2185
2190
|
case -1 /* UNRECOGNIZED */:
|
|
2186
2191
|
default:
|
|
2187
2192
|
return "UNRECOGNIZED";
|
|
@@ -12601,6 +12606,377 @@ var ClusterListResponse = {
|
|
|
12601
12606
|
return message;
|
|
12602
12607
|
}
|
|
12603
12608
|
};
|
|
12609
|
+
function createBaseClusterReservation() {
|
|
12610
|
+
return {
|
|
12611
|
+
name: "",
|
|
12612
|
+
gpuType: "",
|
|
12613
|
+
region: "",
|
|
12614
|
+
minReservedWorkers: 0,
|
|
12615
|
+
reservedWorkers: 0,
|
|
12616
|
+
activeWorkers: 0,
|
|
12617
|
+
idleWorkers: 0,
|
|
12618
|
+
unfulfilledWorkers: 0,
|
|
12619
|
+
tasks: []
|
|
12620
|
+
};
|
|
12621
|
+
}
|
|
12622
|
+
var ClusterReservation = {
|
|
12623
|
+
encode(message, writer = new BinaryWriter()) {
|
|
12624
|
+
if (message.name !== "") {
|
|
12625
|
+
writer.uint32(10).string(message.name);
|
|
12626
|
+
}
|
|
12627
|
+
if (message.gpuType !== "") {
|
|
12628
|
+
writer.uint32(18).string(message.gpuType);
|
|
12629
|
+
}
|
|
12630
|
+
if (message.region !== "") {
|
|
12631
|
+
writer.uint32(26).string(message.region);
|
|
12632
|
+
}
|
|
12633
|
+
if (message.minReservedWorkers !== 0) {
|
|
12634
|
+
writer.uint32(32).int32(message.minReservedWorkers);
|
|
12635
|
+
}
|
|
12636
|
+
if (message.reservedWorkers !== 0) {
|
|
12637
|
+
writer.uint32(40).int32(message.reservedWorkers);
|
|
12638
|
+
}
|
|
12639
|
+
if (message.activeWorkers !== 0) {
|
|
12640
|
+
writer.uint32(48).int32(message.activeWorkers);
|
|
12641
|
+
}
|
|
12642
|
+
if (message.idleWorkers !== 0) {
|
|
12643
|
+
writer.uint32(56).int32(message.idleWorkers);
|
|
12644
|
+
}
|
|
12645
|
+
if (message.unfulfilledWorkers !== 0) {
|
|
12646
|
+
writer.uint32(64).int32(message.unfulfilledWorkers);
|
|
12647
|
+
}
|
|
12648
|
+
for (const v of message.tasks) {
|
|
12649
|
+
ClusterReservation_Task.encode(v, writer.uint32(74).fork()).join();
|
|
12650
|
+
}
|
|
12651
|
+
return writer;
|
|
12652
|
+
},
|
|
12653
|
+
decode(input, length) {
|
|
12654
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
12655
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
12656
|
+
const message = createBaseClusterReservation();
|
|
12657
|
+
while (reader.pos < end) {
|
|
12658
|
+
const tag = reader.uint32();
|
|
12659
|
+
switch (tag >>> 3) {
|
|
12660
|
+
case 1: {
|
|
12661
|
+
if (tag !== 10) {
|
|
12662
|
+
break;
|
|
12663
|
+
}
|
|
12664
|
+
message.name = reader.string();
|
|
12665
|
+
continue;
|
|
12666
|
+
}
|
|
12667
|
+
case 2: {
|
|
12668
|
+
if (tag !== 18) {
|
|
12669
|
+
break;
|
|
12670
|
+
}
|
|
12671
|
+
message.gpuType = reader.string();
|
|
12672
|
+
continue;
|
|
12673
|
+
}
|
|
12674
|
+
case 3: {
|
|
12675
|
+
if (tag !== 26) {
|
|
12676
|
+
break;
|
|
12677
|
+
}
|
|
12678
|
+
message.region = reader.string();
|
|
12679
|
+
continue;
|
|
12680
|
+
}
|
|
12681
|
+
case 4: {
|
|
12682
|
+
if (tag !== 32) {
|
|
12683
|
+
break;
|
|
12684
|
+
}
|
|
12685
|
+
message.minReservedWorkers = reader.int32();
|
|
12686
|
+
continue;
|
|
12687
|
+
}
|
|
12688
|
+
case 5: {
|
|
12689
|
+
if (tag !== 40) {
|
|
12690
|
+
break;
|
|
12691
|
+
}
|
|
12692
|
+
message.reservedWorkers = reader.int32();
|
|
12693
|
+
continue;
|
|
12694
|
+
}
|
|
12695
|
+
case 6: {
|
|
12696
|
+
if (tag !== 48) {
|
|
12697
|
+
break;
|
|
12698
|
+
}
|
|
12699
|
+
message.activeWorkers = reader.int32();
|
|
12700
|
+
continue;
|
|
12701
|
+
}
|
|
12702
|
+
case 7: {
|
|
12703
|
+
if (tag !== 56) {
|
|
12704
|
+
break;
|
|
12705
|
+
}
|
|
12706
|
+
message.idleWorkers = reader.int32();
|
|
12707
|
+
continue;
|
|
12708
|
+
}
|
|
12709
|
+
case 8: {
|
|
12710
|
+
if (tag !== 64) {
|
|
12711
|
+
break;
|
|
12712
|
+
}
|
|
12713
|
+
message.unfulfilledWorkers = reader.int32();
|
|
12714
|
+
continue;
|
|
12715
|
+
}
|
|
12716
|
+
case 9: {
|
|
12717
|
+
if (tag !== 74) {
|
|
12718
|
+
break;
|
|
12719
|
+
}
|
|
12720
|
+
message.tasks.push(ClusterReservation_Task.decode(reader, reader.uint32()));
|
|
12721
|
+
continue;
|
|
12722
|
+
}
|
|
12723
|
+
}
|
|
12724
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
12725
|
+
break;
|
|
12726
|
+
}
|
|
12727
|
+
reader.skip(tag & 7);
|
|
12728
|
+
}
|
|
12729
|
+
return message;
|
|
12730
|
+
},
|
|
12731
|
+
fromJSON(object) {
|
|
12732
|
+
return {
|
|
12733
|
+
name: isSet5(object.name) ? globalThis.String(object.name) : "",
|
|
12734
|
+
gpuType: isSet5(object.gpuType) ? globalThis.String(object.gpuType) : "",
|
|
12735
|
+
region: isSet5(object.region) ? globalThis.String(object.region) : "",
|
|
12736
|
+
minReservedWorkers: isSet5(object.minReservedWorkers) ? globalThis.Number(object.minReservedWorkers) : 0,
|
|
12737
|
+
reservedWorkers: isSet5(object.reservedWorkers) ? globalThis.Number(object.reservedWorkers) : 0,
|
|
12738
|
+
activeWorkers: isSet5(object.activeWorkers) ? globalThis.Number(object.activeWorkers) : 0,
|
|
12739
|
+
idleWorkers: isSet5(object.idleWorkers) ? globalThis.Number(object.idleWorkers) : 0,
|
|
12740
|
+
unfulfilledWorkers: isSet5(object.unfulfilledWorkers) ? globalThis.Number(object.unfulfilledWorkers) : 0,
|
|
12741
|
+
tasks: globalThis.Array.isArray(object?.tasks) ? object.tasks.map((e) => ClusterReservation_Task.fromJSON(e)) : []
|
|
12742
|
+
};
|
|
12743
|
+
},
|
|
12744
|
+
toJSON(message) {
|
|
12745
|
+
const obj = {};
|
|
12746
|
+
if (message.name !== "") {
|
|
12747
|
+
obj.name = message.name;
|
|
12748
|
+
}
|
|
12749
|
+
if (message.gpuType !== "") {
|
|
12750
|
+
obj.gpuType = message.gpuType;
|
|
12751
|
+
}
|
|
12752
|
+
if (message.region !== "") {
|
|
12753
|
+
obj.region = message.region;
|
|
12754
|
+
}
|
|
12755
|
+
if (message.minReservedWorkers !== 0) {
|
|
12756
|
+
obj.minReservedWorkers = Math.round(message.minReservedWorkers);
|
|
12757
|
+
}
|
|
12758
|
+
if (message.reservedWorkers !== 0) {
|
|
12759
|
+
obj.reservedWorkers = Math.round(message.reservedWorkers);
|
|
12760
|
+
}
|
|
12761
|
+
if (message.activeWorkers !== 0) {
|
|
12762
|
+
obj.activeWorkers = Math.round(message.activeWorkers);
|
|
12763
|
+
}
|
|
12764
|
+
if (message.idleWorkers !== 0) {
|
|
12765
|
+
obj.idleWorkers = Math.round(message.idleWorkers);
|
|
12766
|
+
}
|
|
12767
|
+
if (message.unfulfilledWorkers !== 0) {
|
|
12768
|
+
obj.unfulfilledWorkers = Math.round(message.unfulfilledWorkers);
|
|
12769
|
+
}
|
|
12770
|
+
if (message.tasks?.length) {
|
|
12771
|
+
obj.tasks = message.tasks.map((e) => ClusterReservation_Task.toJSON(e));
|
|
12772
|
+
}
|
|
12773
|
+
return obj;
|
|
12774
|
+
},
|
|
12775
|
+
create(base) {
|
|
12776
|
+
return ClusterReservation.fromPartial(base ?? {});
|
|
12777
|
+
},
|
|
12778
|
+
fromPartial(object) {
|
|
12779
|
+
const message = createBaseClusterReservation();
|
|
12780
|
+
message.name = object.name ?? "";
|
|
12781
|
+
message.gpuType = object.gpuType ?? "";
|
|
12782
|
+
message.region = object.region ?? "";
|
|
12783
|
+
message.minReservedWorkers = object.minReservedWorkers ?? 0;
|
|
12784
|
+
message.reservedWorkers = object.reservedWorkers ?? 0;
|
|
12785
|
+
message.activeWorkers = object.activeWorkers ?? 0;
|
|
12786
|
+
message.idleWorkers = object.idleWorkers ?? 0;
|
|
12787
|
+
message.unfulfilledWorkers = object.unfulfilledWorkers ?? 0;
|
|
12788
|
+
message.tasks = object.tasks?.map((e) => ClusterReservation_Task.fromPartial(e)) || [];
|
|
12789
|
+
return message;
|
|
12790
|
+
}
|
|
12791
|
+
};
|
|
12792
|
+
function createBaseClusterReservation_Task() {
|
|
12793
|
+
return { taskId: "", clusterRank: 0, appId: "", functionId: "" };
|
|
12794
|
+
}
|
|
12795
|
+
var ClusterReservation_Task = {
|
|
12796
|
+
encode(message, writer = new BinaryWriter()) {
|
|
12797
|
+
if (message.taskId !== "") {
|
|
12798
|
+
writer.uint32(10).string(message.taskId);
|
|
12799
|
+
}
|
|
12800
|
+
if (message.clusterRank !== 0) {
|
|
12801
|
+
writer.uint32(16).int32(message.clusterRank);
|
|
12802
|
+
}
|
|
12803
|
+
if (message.appId !== "") {
|
|
12804
|
+
writer.uint32(26).string(message.appId);
|
|
12805
|
+
}
|
|
12806
|
+
if (message.functionId !== "") {
|
|
12807
|
+
writer.uint32(34).string(message.functionId);
|
|
12808
|
+
}
|
|
12809
|
+
return writer;
|
|
12810
|
+
},
|
|
12811
|
+
decode(input, length) {
|
|
12812
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
12813
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
12814
|
+
const message = createBaseClusterReservation_Task();
|
|
12815
|
+
while (reader.pos < end) {
|
|
12816
|
+
const tag = reader.uint32();
|
|
12817
|
+
switch (tag >>> 3) {
|
|
12818
|
+
case 1: {
|
|
12819
|
+
if (tag !== 10) {
|
|
12820
|
+
break;
|
|
12821
|
+
}
|
|
12822
|
+
message.taskId = reader.string();
|
|
12823
|
+
continue;
|
|
12824
|
+
}
|
|
12825
|
+
case 2: {
|
|
12826
|
+
if (tag !== 16) {
|
|
12827
|
+
break;
|
|
12828
|
+
}
|
|
12829
|
+
message.clusterRank = reader.int32();
|
|
12830
|
+
continue;
|
|
12831
|
+
}
|
|
12832
|
+
case 3: {
|
|
12833
|
+
if (tag !== 26) {
|
|
12834
|
+
break;
|
|
12835
|
+
}
|
|
12836
|
+
message.appId = reader.string();
|
|
12837
|
+
continue;
|
|
12838
|
+
}
|
|
12839
|
+
case 4: {
|
|
12840
|
+
if (tag !== 34) {
|
|
12841
|
+
break;
|
|
12842
|
+
}
|
|
12843
|
+
message.functionId = reader.string();
|
|
12844
|
+
continue;
|
|
12845
|
+
}
|
|
12846
|
+
}
|
|
12847
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
12848
|
+
break;
|
|
12849
|
+
}
|
|
12850
|
+
reader.skip(tag & 7);
|
|
12851
|
+
}
|
|
12852
|
+
return message;
|
|
12853
|
+
},
|
|
12854
|
+
fromJSON(object) {
|
|
12855
|
+
return {
|
|
12856
|
+
taskId: isSet5(object.taskId) ? globalThis.String(object.taskId) : "",
|
|
12857
|
+
clusterRank: isSet5(object.clusterRank) ? globalThis.Number(object.clusterRank) : 0,
|
|
12858
|
+
appId: isSet5(object.appId) ? globalThis.String(object.appId) : "",
|
|
12859
|
+
functionId: isSet5(object.functionId) ? globalThis.String(object.functionId) : ""
|
|
12860
|
+
};
|
|
12861
|
+
},
|
|
12862
|
+
toJSON(message) {
|
|
12863
|
+
const obj = {};
|
|
12864
|
+
if (message.taskId !== "") {
|
|
12865
|
+
obj.taskId = message.taskId;
|
|
12866
|
+
}
|
|
12867
|
+
if (message.clusterRank !== 0) {
|
|
12868
|
+
obj.clusterRank = Math.round(message.clusterRank);
|
|
12869
|
+
}
|
|
12870
|
+
if (message.appId !== "") {
|
|
12871
|
+
obj.appId = message.appId;
|
|
12872
|
+
}
|
|
12873
|
+
if (message.functionId !== "") {
|
|
12874
|
+
obj.functionId = message.functionId;
|
|
12875
|
+
}
|
|
12876
|
+
return obj;
|
|
12877
|
+
},
|
|
12878
|
+
create(base) {
|
|
12879
|
+
return ClusterReservation_Task.fromPartial(base ?? {});
|
|
12880
|
+
},
|
|
12881
|
+
fromPartial(object) {
|
|
12882
|
+
const message = createBaseClusterReservation_Task();
|
|
12883
|
+
message.taskId = object.taskId ?? "";
|
|
12884
|
+
message.clusterRank = object.clusterRank ?? 0;
|
|
12885
|
+
message.appId = object.appId ?? "";
|
|
12886
|
+
message.functionId = object.functionId ?? "";
|
|
12887
|
+
return message;
|
|
12888
|
+
}
|
|
12889
|
+
};
|
|
12890
|
+
function createBaseClusterReservationListRequest() {
|
|
12891
|
+
return {};
|
|
12892
|
+
}
|
|
12893
|
+
var ClusterReservationListRequest = {
|
|
12894
|
+
encode(_, writer = new BinaryWriter()) {
|
|
12895
|
+
return writer;
|
|
12896
|
+
},
|
|
12897
|
+
decode(input, length) {
|
|
12898
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
12899
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
12900
|
+
const message = createBaseClusterReservationListRequest();
|
|
12901
|
+
while (reader.pos < end) {
|
|
12902
|
+
const tag = reader.uint32();
|
|
12903
|
+
switch (tag >>> 3) {
|
|
12904
|
+
}
|
|
12905
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
12906
|
+
break;
|
|
12907
|
+
}
|
|
12908
|
+
reader.skip(tag & 7);
|
|
12909
|
+
}
|
|
12910
|
+
return message;
|
|
12911
|
+
},
|
|
12912
|
+
fromJSON(_) {
|
|
12913
|
+
return {};
|
|
12914
|
+
},
|
|
12915
|
+
toJSON(_) {
|
|
12916
|
+
const obj = {};
|
|
12917
|
+
return obj;
|
|
12918
|
+
},
|
|
12919
|
+
create(base) {
|
|
12920
|
+
return ClusterReservationListRequest.fromPartial(base ?? {});
|
|
12921
|
+
},
|
|
12922
|
+
fromPartial(_) {
|
|
12923
|
+
const message = createBaseClusterReservationListRequest();
|
|
12924
|
+
return message;
|
|
12925
|
+
}
|
|
12926
|
+
};
|
|
12927
|
+
function createBaseClusterReservationListResponse() {
|
|
12928
|
+
return { reservations: [] };
|
|
12929
|
+
}
|
|
12930
|
+
var ClusterReservationListResponse = {
|
|
12931
|
+
encode(message, writer = new BinaryWriter()) {
|
|
12932
|
+
for (const v of message.reservations) {
|
|
12933
|
+
ClusterReservation.encode(v, writer.uint32(10).fork()).join();
|
|
12934
|
+
}
|
|
12935
|
+
return writer;
|
|
12936
|
+
},
|
|
12937
|
+
decode(input, length) {
|
|
12938
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
12939
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
12940
|
+
const message = createBaseClusterReservationListResponse();
|
|
12941
|
+
while (reader.pos < end) {
|
|
12942
|
+
const tag = reader.uint32();
|
|
12943
|
+
switch (tag >>> 3) {
|
|
12944
|
+
case 1: {
|
|
12945
|
+
if (tag !== 10) {
|
|
12946
|
+
break;
|
|
12947
|
+
}
|
|
12948
|
+
message.reservations.push(ClusterReservation.decode(reader, reader.uint32()));
|
|
12949
|
+
continue;
|
|
12950
|
+
}
|
|
12951
|
+
}
|
|
12952
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
12953
|
+
break;
|
|
12954
|
+
}
|
|
12955
|
+
reader.skip(tag & 7);
|
|
12956
|
+
}
|
|
12957
|
+
return message;
|
|
12958
|
+
},
|
|
12959
|
+
fromJSON(object) {
|
|
12960
|
+
return {
|
|
12961
|
+
reservations: globalThis.Array.isArray(object?.reservations) ? object.reservations.map((e) => ClusterReservation.fromJSON(e)) : []
|
|
12962
|
+
};
|
|
12963
|
+
},
|
|
12964
|
+
toJSON(message) {
|
|
12965
|
+
const obj = {};
|
|
12966
|
+
if (message.reservations?.length) {
|
|
12967
|
+
obj.reservations = message.reservations.map((e) => ClusterReservation.toJSON(e));
|
|
12968
|
+
}
|
|
12969
|
+
return obj;
|
|
12970
|
+
},
|
|
12971
|
+
create(base) {
|
|
12972
|
+
return ClusterReservationListResponse.fromPartial(base ?? {});
|
|
12973
|
+
},
|
|
12974
|
+
fromPartial(object) {
|
|
12975
|
+
const message = createBaseClusterReservationListResponse();
|
|
12976
|
+
message.reservations = object.reservations?.map((e) => ClusterReservation.fromPartial(e)) || [];
|
|
12977
|
+
return message;
|
|
12978
|
+
}
|
|
12979
|
+
};
|
|
12604
12980
|
function createBaseClusterStats() {
|
|
12605
12981
|
return { appId: "", taskIds: [], clusterId: "", startedAt: 0 };
|
|
12606
12982
|
}
|
|
@@ -17804,7 +18180,8 @@ function createBaseEndpointCreateRequest() {
|
|
|
17804
18180
|
environmentName: "",
|
|
17805
18181
|
unauthenticated: false,
|
|
17806
18182
|
servingMode: 0,
|
|
17807
|
-
sharedEndpointNoticeAcknowledged: false
|
|
18183
|
+
sharedEndpointNoticeAcknowledged: false,
|
|
18184
|
+
recipeId: void 0
|
|
17808
18185
|
};
|
|
17809
18186
|
}
|
|
17810
18187
|
var EndpointCreateRequest = {
|
|
@@ -17846,6 +18223,9 @@ var EndpointCreateRequest = {
|
|
|
17846
18223
|
if (message.sharedEndpointNoticeAcknowledged !== false) {
|
|
17847
18224
|
writer.uint32(88).bool(message.sharedEndpointNoticeAcknowledged);
|
|
17848
18225
|
}
|
|
18226
|
+
if (message.recipeId !== void 0) {
|
|
18227
|
+
writer.uint32(98).string(message.recipeId);
|
|
18228
|
+
}
|
|
17849
18229
|
return writer;
|
|
17850
18230
|
},
|
|
17851
18231
|
decode(input, length) {
|
|
@@ -17946,6 +18326,13 @@ var EndpointCreateRequest = {
|
|
|
17946
18326
|
message.sharedEndpointNoticeAcknowledged = reader.bool();
|
|
17947
18327
|
continue;
|
|
17948
18328
|
}
|
|
18329
|
+
case 12: {
|
|
18330
|
+
if (tag !== 98) {
|
|
18331
|
+
break;
|
|
18332
|
+
}
|
|
18333
|
+
message.recipeId = reader.string();
|
|
18334
|
+
continue;
|
|
18335
|
+
}
|
|
17949
18336
|
}
|
|
17950
18337
|
if ((tag & 7) === 4 || tag === 0) {
|
|
17951
18338
|
break;
|
|
@@ -17966,7 +18353,8 @@ var EndpointCreateRequest = {
|
|
|
17966
18353
|
environmentName: isSet5(object.environmentName) ? globalThis.String(object.environmentName) : "",
|
|
17967
18354
|
unauthenticated: isSet5(object.unauthenticated) ? globalThis.Boolean(object.unauthenticated) : false,
|
|
17968
18355
|
servingMode: isSet5(object.servingMode) ? endpointServingModeFromJSON(object.servingMode) : 0,
|
|
17969
|
-
sharedEndpointNoticeAcknowledged: isSet5(object.sharedEndpointNoticeAcknowledged) ? globalThis.Boolean(object.sharedEndpointNoticeAcknowledged) : false
|
|
18356
|
+
sharedEndpointNoticeAcknowledged: isSet5(object.sharedEndpointNoticeAcknowledged) ? globalThis.Boolean(object.sharedEndpointNoticeAcknowledged) : false,
|
|
18357
|
+
recipeId: isSet5(object.recipeId) ? globalThis.String(object.recipeId) : void 0
|
|
17970
18358
|
};
|
|
17971
18359
|
},
|
|
17972
18360
|
toJSON(message) {
|
|
@@ -18004,6 +18392,9 @@ var EndpointCreateRequest = {
|
|
|
18004
18392
|
if (message.sharedEndpointNoticeAcknowledged !== false) {
|
|
18005
18393
|
obj.sharedEndpointNoticeAcknowledged = message.sharedEndpointNoticeAcknowledged;
|
|
18006
18394
|
}
|
|
18395
|
+
if (message.recipeId !== void 0) {
|
|
18396
|
+
obj.recipeId = message.recipeId;
|
|
18397
|
+
}
|
|
18007
18398
|
return obj;
|
|
18008
18399
|
},
|
|
18009
18400
|
create(base) {
|
|
@@ -18022,11 +18413,12 @@ var EndpointCreateRequest = {
|
|
|
18022
18413
|
message.unauthenticated = object.unauthenticated ?? false;
|
|
18023
18414
|
message.servingMode = object.servingMode ?? 0;
|
|
18024
18415
|
message.sharedEndpointNoticeAcknowledged = object.sharedEndpointNoticeAcknowledged ?? false;
|
|
18416
|
+
message.recipeId = object.recipeId ?? void 0;
|
|
18025
18417
|
return message;
|
|
18026
18418
|
}
|
|
18027
18419
|
};
|
|
18028
18420
|
function createBaseEndpointCreateResponse() {
|
|
18029
|
-
return { endpointId: "", endpointPageUrl: "", name: "" };
|
|
18421
|
+
return { endpointId: "", endpointPageUrl: "", name: "", modelName: "" };
|
|
18030
18422
|
}
|
|
18031
18423
|
var EndpointCreateResponse = {
|
|
18032
18424
|
encode(message, writer = new BinaryWriter()) {
|
|
@@ -18039,6 +18431,9 @@ var EndpointCreateResponse = {
|
|
|
18039
18431
|
if (message.name !== "") {
|
|
18040
18432
|
writer.uint32(26).string(message.name);
|
|
18041
18433
|
}
|
|
18434
|
+
if (message.modelName !== "") {
|
|
18435
|
+
writer.uint32(34).string(message.modelName);
|
|
18436
|
+
}
|
|
18042
18437
|
return writer;
|
|
18043
18438
|
},
|
|
18044
18439
|
decode(input, length) {
|
|
@@ -18069,6 +18464,13 @@ var EndpointCreateResponse = {
|
|
|
18069
18464
|
message.name = reader.string();
|
|
18070
18465
|
continue;
|
|
18071
18466
|
}
|
|
18467
|
+
case 4: {
|
|
18468
|
+
if (tag !== 34) {
|
|
18469
|
+
break;
|
|
18470
|
+
}
|
|
18471
|
+
message.modelName = reader.string();
|
|
18472
|
+
continue;
|
|
18473
|
+
}
|
|
18072
18474
|
}
|
|
18073
18475
|
if ((tag & 7) === 4 || tag === 0) {
|
|
18074
18476
|
break;
|
|
@@ -18081,7 +18483,8 @@ var EndpointCreateResponse = {
|
|
|
18081
18483
|
return {
|
|
18082
18484
|
endpointId: isSet5(object.endpointId) ? globalThis.String(object.endpointId) : "",
|
|
18083
18485
|
endpointPageUrl: isSet5(object.endpointPageUrl) ? globalThis.String(object.endpointPageUrl) : "",
|
|
18084
|
-
name: isSet5(object.name) ? globalThis.String(object.name) : ""
|
|
18486
|
+
name: isSet5(object.name) ? globalThis.String(object.name) : "",
|
|
18487
|
+
modelName: isSet5(object.modelName) ? globalThis.String(object.modelName) : ""
|
|
18085
18488
|
};
|
|
18086
18489
|
},
|
|
18087
18490
|
toJSON(message) {
|
|
@@ -18095,6 +18498,9 @@ var EndpointCreateResponse = {
|
|
|
18095
18498
|
if (message.name !== "") {
|
|
18096
18499
|
obj.name = message.name;
|
|
18097
18500
|
}
|
|
18501
|
+
if (message.modelName !== "") {
|
|
18502
|
+
obj.modelName = message.modelName;
|
|
18503
|
+
}
|
|
18098
18504
|
return obj;
|
|
18099
18505
|
},
|
|
18100
18506
|
create(base) {
|
|
@@ -18105,6 +18511,7 @@ var EndpointCreateResponse = {
|
|
|
18105
18511
|
message.endpointId = object.endpointId ?? "";
|
|
18106
18512
|
message.endpointPageUrl = object.endpointPageUrl ?? "";
|
|
18107
18513
|
message.name = object.name ?? "";
|
|
18514
|
+
message.modelName = object.modelName ?? "";
|
|
18108
18515
|
return message;
|
|
18109
18516
|
}
|
|
18110
18517
|
};
|
|
@@ -18457,7 +18864,8 @@ function createBaseEndpointGetInfoResponse_EndpointInfoSummary() {
|
|
|
18457
18864
|
status: 0,
|
|
18458
18865
|
lifecycle: void 0,
|
|
18459
18866
|
volumeId: "",
|
|
18460
|
-
modelPath: ""
|
|
18867
|
+
modelPath: "",
|
|
18868
|
+
modelName: ""
|
|
18461
18869
|
};
|
|
18462
18870
|
}
|
|
18463
18871
|
var EndpointGetInfoResponse_EndpointInfoSummary = {
|
|
@@ -18492,6 +18900,9 @@ var EndpointGetInfoResponse_EndpointInfoSummary = {
|
|
|
18492
18900
|
if (message.modelPath !== "") {
|
|
18493
18901
|
writer.uint32(98).string(message.modelPath);
|
|
18494
18902
|
}
|
|
18903
|
+
if (message.modelName !== "") {
|
|
18904
|
+
writer.uint32(106).string(message.modelName);
|
|
18905
|
+
}
|
|
18495
18906
|
return writer;
|
|
18496
18907
|
},
|
|
18497
18908
|
decode(input, length) {
|
|
@@ -18571,6 +18982,13 @@ var EndpointGetInfoResponse_EndpointInfoSummary = {
|
|
|
18571
18982
|
message.modelPath = reader.string();
|
|
18572
18983
|
continue;
|
|
18573
18984
|
}
|
|
18985
|
+
case 13: {
|
|
18986
|
+
if (tag !== 106) {
|
|
18987
|
+
break;
|
|
18988
|
+
}
|
|
18989
|
+
message.modelName = reader.string();
|
|
18990
|
+
continue;
|
|
18991
|
+
}
|
|
18574
18992
|
}
|
|
18575
18993
|
if ((tag & 7) === 4 || tag === 0) {
|
|
18576
18994
|
break;
|
|
@@ -18590,7 +19008,8 @@ var EndpointGetInfoResponse_EndpointInfoSummary = {
|
|
|
18590
19008
|
status: isSet5(object.status) ? endpointGetInfoResponse_EndpointStatusFromJSON(object.status) : 0,
|
|
18591
19009
|
lifecycle: isSet5(object.lifecycle) ? EndpointLifecycle.fromJSON(object.lifecycle) : void 0,
|
|
18592
19010
|
volumeId: isSet5(object.volumeId) ? globalThis.String(object.volumeId) : "",
|
|
18593
|
-
modelPath: isSet5(object.modelPath) ? globalThis.String(object.modelPath) : ""
|
|
19011
|
+
modelPath: isSet5(object.modelPath) ? globalThis.String(object.modelPath) : "",
|
|
19012
|
+
modelName: isSet5(object.modelName) ? globalThis.String(object.modelName) : ""
|
|
18594
19013
|
};
|
|
18595
19014
|
},
|
|
18596
19015
|
toJSON(message) {
|
|
@@ -18625,6 +19044,9 @@ var EndpointGetInfoResponse_EndpointInfoSummary = {
|
|
|
18625
19044
|
if (message.modelPath !== "") {
|
|
18626
19045
|
obj.modelPath = message.modelPath;
|
|
18627
19046
|
}
|
|
19047
|
+
if (message.modelName !== "") {
|
|
19048
|
+
obj.modelName = message.modelName;
|
|
19049
|
+
}
|
|
18628
19050
|
return obj;
|
|
18629
19051
|
},
|
|
18630
19052
|
create(base) {
|
|
@@ -18642,6 +19064,7 @@ var EndpointGetInfoResponse_EndpointInfoSummary = {
|
|
|
18642
19064
|
message.lifecycle = object.lifecycle !== void 0 && object.lifecycle !== null ? EndpointLifecycle.fromPartial(object.lifecycle) : void 0;
|
|
18643
19065
|
message.volumeId = object.volumeId ?? "";
|
|
18644
19066
|
message.modelPath = object.modelPath ?? "";
|
|
19067
|
+
message.modelName = object.modelName ?? "";
|
|
18645
19068
|
return message;
|
|
18646
19069
|
}
|
|
18647
19070
|
};
|
|
@@ -44921,7 +45344,7 @@ var SandboxGetExitSnapshotResponse_Error = {
|
|
|
44921
45344
|
}
|
|
44922
45345
|
};
|
|
44923
45346
|
function createBaseSandboxGetFromNameRequest() {
|
|
44924
|
-
return { sandboxName: "", environmentName: "", appName: "" };
|
|
45347
|
+
return { sandboxName: "", environmentName: "", appName: "", includeTerminated: false };
|
|
44925
45348
|
}
|
|
44926
45349
|
var SandboxGetFromNameRequest = {
|
|
44927
45350
|
encode(message, writer = new BinaryWriter()) {
|
|
@@ -44934,6 +45357,9 @@ var SandboxGetFromNameRequest = {
|
|
|
44934
45357
|
if (message.appName !== "") {
|
|
44935
45358
|
writer.uint32(26).string(message.appName);
|
|
44936
45359
|
}
|
|
45360
|
+
if (message.includeTerminated !== false) {
|
|
45361
|
+
writer.uint32(32).bool(message.includeTerminated);
|
|
45362
|
+
}
|
|
44937
45363
|
return writer;
|
|
44938
45364
|
},
|
|
44939
45365
|
decode(input, length) {
|
|
@@ -44964,6 +45390,13 @@ var SandboxGetFromNameRequest = {
|
|
|
44964
45390
|
message.appName = reader.string();
|
|
44965
45391
|
continue;
|
|
44966
45392
|
}
|
|
45393
|
+
case 4: {
|
|
45394
|
+
if (tag !== 32) {
|
|
45395
|
+
break;
|
|
45396
|
+
}
|
|
45397
|
+
message.includeTerminated = reader.bool();
|
|
45398
|
+
continue;
|
|
45399
|
+
}
|
|
44967
45400
|
}
|
|
44968
45401
|
if ((tag & 7) === 4 || tag === 0) {
|
|
44969
45402
|
break;
|
|
@@ -44976,7 +45409,8 @@ var SandboxGetFromNameRequest = {
|
|
|
44976
45409
|
return {
|
|
44977
45410
|
sandboxName: isSet5(object.sandboxName) ? globalThis.String(object.sandboxName) : "",
|
|
44978
45411
|
environmentName: isSet5(object.environmentName) ? globalThis.String(object.environmentName) : "",
|
|
44979
|
-
appName: isSet5(object.appName) ? globalThis.String(object.appName) : ""
|
|
45412
|
+
appName: isSet5(object.appName) ? globalThis.String(object.appName) : "",
|
|
45413
|
+
includeTerminated: isSet5(object.includeTerminated) ? globalThis.Boolean(object.includeTerminated) : false
|
|
44980
45414
|
};
|
|
44981
45415
|
},
|
|
44982
45416
|
toJSON(message) {
|
|
@@ -44990,6 +45424,9 @@ var SandboxGetFromNameRequest = {
|
|
|
44990
45424
|
if (message.appName !== "") {
|
|
44991
45425
|
obj.appName = message.appName;
|
|
44992
45426
|
}
|
|
45427
|
+
if (message.includeTerminated !== false) {
|
|
45428
|
+
obj.includeTerminated = message.includeTerminated;
|
|
45429
|
+
}
|
|
44993
45430
|
return obj;
|
|
44994
45431
|
},
|
|
44995
45432
|
create(base) {
|
|
@@ -45000,6 +45437,7 @@ var SandboxGetFromNameRequest = {
|
|
|
45000
45437
|
message.sandboxName = object.sandboxName ?? "";
|
|
45001
45438
|
message.environmentName = object.environmentName ?? "";
|
|
45002
45439
|
message.appName = object.appName ?? "";
|
|
45440
|
+
message.includeTerminated = object.includeTerminated ?? false;
|
|
45003
45441
|
return message;
|
|
45004
45442
|
}
|
|
45005
45443
|
};
|
|
@@ -61557,6 +61995,14 @@ var ModalClientDefinition = {
|
|
|
61557
61995
|
responseStream: false,
|
|
61558
61996
|
options: {}
|
|
61559
61997
|
},
|
|
61998
|
+
clusterReservationList: {
|
|
61999
|
+
name: "ClusterReservationList",
|
|
62000
|
+
requestType: ClusterReservationListRequest,
|
|
62001
|
+
requestStream: false,
|
|
62002
|
+
responseType: ClusterReservationListResponse,
|
|
62003
|
+
responseStream: false,
|
|
62004
|
+
options: {}
|
|
62005
|
+
},
|
|
61560
62006
|
/** Container */
|
|
61561
62007
|
containerCheckpoint: {
|
|
61562
62008
|
name: "ContainerCheckpoint",
|
|
@@ -74497,7 +74943,7 @@ var AuthTokenManager = class {
|
|
|
74497
74943
|
};
|
|
74498
74944
|
|
|
74499
74945
|
// src/version.ts
|
|
74500
|
-
var SDK_VERSION = "0.11.1-dev.
|
|
74946
|
+
var SDK_VERSION = "0.11.1-dev.8";
|
|
74501
74947
|
function getSDKVersion() {
|
|
74502
74948
|
return SDK_VERSION;
|
|
74503
74949
|
}
|
|
@@ -76380,6 +76826,20 @@ var FunctionService = class {
|
|
|
76380
76826
|
}
|
|
76381
76827
|
}
|
|
76382
76828
|
};
|
|
76829
|
+
function statsDistributions(stats) {
|
|
76830
|
+
return Object.fromEntries(
|
|
76831
|
+
Object.entries(stats).map(([key, distribution]) => [
|
|
76832
|
+
key,
|
|
76833
|
+
{
|
|
76834
|
+
unit: distribution.unit,
|
|
76835
|
+
percentiles: distribution.percentiles.map((p) => ({
|
|
76836
|
+
percentile: p.percentileBasisPoints / 100,
|
|
76837
|
+
value: p.value
|
|
76838
|
+
}))
|
|
76839
|
+
}
|
|
76840
|
+
])
|
|
76841
|
+
);
|
|
76842
|
+
}
|
|
76383
76843
|
function mergeServiceOptions(base, diff) {
|
|
76384
76844
|
const filteredDiff = Object.fromEntries(
|
|
76385
76845
|
Object.entries(diff).filter(([, value]) => value !== void 0)
|
|
@@ -76747,6 +77207,65 @@ var Function_ = class _Function_ {
|
|
|
76747
77207
|
this.functionId
|
|
76748
77208
|
);
|
|
76749
77209
|
}
|
|
77210
|
+
/**
|
|
77211
|
+
* Return historical statistics. Defaults to the last hour; the maximum range is 7 days.
|
|
77212
|
+
*
|
|
77213
|
+
* @example Read statistics for the last hour.
|
|
77214
|
+
* ```ts
|
|
77215
|
+
* const fn = await modal.functions.fromName("libmodal-test-support", "echo_string");
|
|
77216
|
+
* const stats = await fn.stats();
|
|
77217
|
+
* console.log(stats.inputSuccessCount, stats.inputFailureCount);
|
|
77218
|
+
* ```
|
|
77219
|
+
*
|
|
77220
|
+
* @example Include all variants over the last 24 hours.
|
|
77221
|
+
* ```ts
|
|
77222
|
+
* const until = new Date();
|
|
77223
|
+
* const since = new Date(until.getTime() - 24 * 60 * 60 * 1000);
|
|
77224
|
+
* const variantStats = await fn.stats({ since, until, allVariants: true });
|
|
77225
|
+
* for (const [metric, distribution] of Object.entries(variantStats.inputPercentileStats)) {
|
|
77226
|
+
* console.log(metric, distribution.unit, distribution.percentiles);
|
|
77227
|
+
* }
|
|
77228
|
+
* ```
|
|
77229
|
+
*
|
|
77230
|
+
* Set `container` to a container ID to restrict statistics to that container.
|
|
77231
|
+
*/
|
|
77232
|
+
async stats(params = {}) {
|
|
77233
|
+
const until = params.until ?? /* @__PURE__ */ new Date();
|
|
77234
|
+
const since = params.since ?? new Date(until.getTime() - 60 * 60 * 1e3);
|
|
77235
|
+
if (!Number.isFinite(since.getTime()) || !Number.isFinite(until.getTime())) {
|
|
77236
|
+
throw new InvalidError("`since` and `until` must be valid dates.");
|
|
77237
|
+
}
|
|
77238
|
+
if (since >= until) {
|
|
77239
|
+
throw new InvalidError("`since` must be before `until`.");
|
|
77240
|
+
}
|
|
77241
|
+
const allVariants = params.allVariants ?? false;
|
|
77242
|
+
const resp = await this.#client.cpClient.functionGetTimeRangeStats(
|
|
77243
|
+
FunctionGetTimeRangeStatsRequest.create({
|
|
77244
|
+
functionId: this.functionId,
|
|
77245
|
+
since,
|
|
77246
|
+
until,
|
|
77247
|
+
containerId: params.container || void 0,
|
|
77248
|
+
rollup: allVariants
|
|
77249
|
+
})
|
|
77250
|
+
);
|
|
77251
|
+
return {
|
|
77252
|
+
since: resp.since ?? /* @__PURE__ */ new Date(0),
|
|
77253
|
+
until: resp.until ?? /* @__PURE__ */ new Date(0),
|
|
77254
|
+
inputSuccessCount: resp.inputSuccessCount,
|
|
77255
|
+
inputFailureCount: resp.inputFailureCount,
|
|
77256
|
+
inputTimeoutCount: resp.inputTimeoutCount,
|
|
77257
|
+
inputRunningAtEndCount: resp.inputRunningAtEndCount,
|
|
77258
|
+
containerStartedCount: resp.containerStartedCount,
|
|
77259
|
+
containerErrorCount: resp.containerErrorCount,
|
|
77260
|
+
containerCreatingAtEndCount: resp.containerCreatingAtEndCount,
|
|
77261
|
+
variantCount: resp.variantCount,
|
|
77262
|
+
inputPercentileStats: statsDistributions(resp.inputPercentileStats),
|
|
77263
|
+
containerPercentileStats: statsDistributions(
|
|
77264
|
+
resp.containerPercentileStats
|
|
77265
|
+
),
|
|
77266
|
+
allVariants
|
|
77267
|
+
};
|
|
77268
|
+
}
|
|
76750
77269
|
// Returns statistics about the Function.
|
|
76751
77270
|
async getCurrentStats() {
|
|
76752
77271
|
const resp = await this.#client.cpClient.functionGetCurrentStats(
|