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.cjs
CHANGED
|
@@ -2265,6 +2265,9 @@ function environmentTypeFromJSON(object) {
|
|
|
2265
2265
|
case 1:
|
|
2266
2266
|
case "ENVIRONMENT_TYPE_PUBLIC":
|
|
2267
2267
|
return 1 /* ENVIRONMENT_TYPE_PUBLIC */;
|
|
2268
|
+
case 2:
|
|
2269
|
+
case "ENVIRONMENT_TYPE_MODAL_ADMINISTERED":
|
|
2270
|
+
return 2 /* ENVIRONMENT_TYPE_MODAL_ADMINISTERED */;
|
|
2268
2271
|
case -1:
|
|
2269
2272
|
case "UNRECOGNIZED":
|
|
2270
2273
|
default:
|
|
@@ -2277,6 +2280,8 @@ function environmentTypeToJSON(object) {
|
|
|
2277
2280
|
return "ENVIRONMENT_TYPE_UNSPECIFIED";
|
|
2278
2281
|
case 1 /* ENVIRONMENT_TYPE_PUBLIC */:
|
|
2279
2282
|
return "ENVIRONMENT_TYPE_PUBLIC";
|
|
2283
|
+
case 2 /* ENVIRONMENT_TYPE_MODAL_ADMINISTERED */:
|
|
2284
|
+
return "ENVIRONMENT_TYPE_MODAL_ADMINISTERED";
|
|
2280
2285
|
case -1 /* UNRECOGNIZED */:
|
|
2281
2286
|
default:
|
|
2282
2287
|
return "UNRECOGNIZED";
|
|
@@ -12696,6 +12701,377 @@ var ClusterListResponse = {
|
|
|
12696
12701
|
return message;
|
|
12697
12702
|
}
|
|
12698
12703
|
};
|
|
12704
|
+
function createBaseClusterReservation() {
|
|
12705
|
+
return {
|
|
12706
|
+
name: "",
|
|
12707
|
+
gpuType: "",
|
|
12708
|
+
region: "",
|
|
12709
|
+
minReservedWorkers: 0,
|
|
12710
|
+
reservedWorkers: 0,
|
|
12711
|
+
activeWorkers: 0,
|
|
12712
|
+
idleWorkers: 0,
|
|
12713
|
+
unfulfilledWorkers: 0,
|
|
12714
|
+
tasks: []
|
|
12715
|
+
};
|
|
12716
|
+
}
|
|
12717
|
+
var ClusterReservation = {
|
|
12718
|
+
encode(message, writer = new BinaryWriter()) {
|
|
12719
|
+
if (message.name !== "") {
|
|
12720
|
+
writer.uint32(10).string(message.name);
|
|
12721
|
+
}
|
|
12722
|
+
if (message.gpuType !== "") {
|
|
12723
|
+
writer.uint32(18).string(message.gpuType);
|
|
12724
|
+
}
|
|
12725
|
+
if (message.region !== "") {
|
|
12726
|
+
writer.uint32(26).string(message.region);
|
|
12727
|
+
}
|
|
12728
|
+
if (message.minReservedWorkers !== 0) {
|
|
12729
|
+
writer.uint32(32).int32(message.minReservedWorkers);
|
|
12730
|
+
}
|
|
12731
|
+
if (message.reservedWorkers !== 0) {
|
|
12732
|
+
writer.uint32(40).int32(message.reservedWorkers);
|
|
12733
|
+
}
|
|
12734
|
+
if (message.activeWorkers !== 0) {
|
|
12735
|
+
writer.uint32(48).int32(message.activeWorkers);
|
|
12736
|
+
}
|
|
12737
|
+
if (message.idleWorkers !== 0) {
|
|
12738
|
+
writer.uint32(56).int32(message.idleWorkers);
|
|
12739
|
+
}
|
|
12740
|
+
if (message.unfulfilledWorkers !== 0) {
|
|
12741
|
+
writer.uint32(64).int32(message.unfulfilledWorkers);
|
|
12742
|
+
}
|
|
12743
|
+
for (const v of message.tasks) {
|
|
12744
|
+
ClusterReservation_Task.encode(v, writer.uint32(74).fork()).join();
|
|
12745
|
+
}
|
|
12746
|
+
return writer;
|
|
12747
|
+
},
|
|
12748
|
+
decode(input, length) {
|
|
12749
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
12750
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
12751
|
+
const message = createBaseClusterReservation();
|
|
12752
|
+
while (reader.pos < end) {
|
|
12753
|
+
const tag = reader.uint32();
|
|
12754
|
+
switch (tag >>> 3) {
|
|
12755
|
+
case 1: {
|
|
12756
|
+
if (tag !== 10) {
|
|
12757
|
+
break;
|
|
12758
|
+
}
|
|
12759
|
+
message.name = reader.string();
|
|
12760
|
+
continue;
|
|
12761
|
+
}
|
|
12762
|
+
case 2: {
|
|
12763
|
+
if (tag !== 18) {
|
|
12764
|
+
break;
|
|
12765
|
+
}
|
|
12766
|
+
message.gpuType = reader.string();
|
|
12767
|
+
continue;
|
|
12768
|
+
}
|
|
12769
|
+
case 3: {
|
|
12770
|
+
if (tag !== 26) {
|
|
12771
|
+
break;
|
|
12772
|
+
}
|
|
12773
|
+
message.region = reader.string();
|
|
12774
|
+
continue;
|
|
12775
|
+
}
|
|
12776
|
+
case 4: {
|
|
12777
|
+
if (tag !== 32) {
|
|
12778
|
+
break;
|
|
12779
|
+
}
|
|
12780
|
+
message.minReservedWorkers = reader.int32();
|
|
12781
|
+
continue;
|
|
12782
|
+
}
|
|
12783
|
+
case 5: {
|
|
12784
|
+
if (tag !== 40) {
|
|
12785
|
+
break;
|
|
12786
|
+
}
|
|
12787
|
+
message.reservedWorkers = reader.int32();
|
|
12788
|
+
continue;
|
|
12789
|
+
}
|
|
12790
|
+
case 6: {
|
|
12791
|
+
if (tag !== 48) {
|
|
12792
|
+
break;
|
|
12793
|
+
}
|
|
12794
|
+
message.activeWorkers = reader.int32();
|
|
12795
|
+
continue;
|
|
12796
|
+
}
|
|
12797
|
+
case 7: {
|
|
12798
|
+
if (tag !== 56) {
|
|
12799
|
+
break;
|
|
12800
|
+
}
|
|
12801
|
+
message.idleWorkers = reader.int32();
|
|
12802
|
+
continue;
|
|
12803
|
+
}
|
|
12804
|
+
case 8: {
|
|
12805
|
+
if (tag !== 64) {
|
|
12806
|
+
break;
|
|
12807
|
+
}
|
|
12808
|
+
message.unfulfilledWorkers = reader.int32();
|
|
12809
|
+
continue;
|
|
12810
|
+
}
|
|
12811
|
+
case 9: {
|
|
12812
|
+
if (tag !== 74) {
|
|
12813
|
+
break;
|
|
12814
|
+
}
|
|
12815
|
+
message.tasks.push(ClusterReservation_Task.decode(reader, reader.uint32()));
|
|
12816
|
+
continue;
|
|
12817
|
+
}
|
|
12818
|
+
}
|
|
12819
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
12820
|
+
break;
|
|
12821
|
+
}
|
|
12822
|
+
reader.skip(tag & 7);
|
|
12823
|
+
}
|
|
12824
|
+
return message;
|
|
12825
|
+
},
|
|
12826
|
+
fromJSON(object) {
|
|
12827
|
+
return {
|
|
12828
|
+
name: isSet5(object.name) ? globalThis.String(object.name) : "",
|
|
12829
|
+
gpuType: isSet5(object.gpuType) ? globalThis.String(object.gpuType) : "",
|
|
12830
|
+
region: isSet5(object.region) ? globalThis.String(object.region) : "",
|
|
12831
|
+
minReservedWorkers: isSet5(object.minReservedWorkers) ? globalThis.Number(object.minReservedWorkers) : 0,
|
|
12832
|
+
reservedWorkers: isSet5(object.reservedWorkers) ? globalThis.Number(object.reservedWorkers) : 0,
|
|
12833
|
+
activeWorkers: isSet5(object.activeWorkers) ? globalThis.Number(object.activeWorkers) : 0,
|
|
12834
|
+
idleWorkers: isSet5(object.idleWorkers) ? globalThis.Number(object.idleWorkers) : 0,
|
|
12835
|
+
unfulfilledWorkers: isSet5(object.unfulfilledWorkers) ? globalThis.Number(object.unfulfilledWorkers) : 0,
|
|
12836
|
+
tasks: globalThis.Array.isArray(object?.tasks) ? object.tasks.map((e) => ClusterReservation_Task.fromJSON(e)) : []
|
|
12837
|
+
};
|
|
12838
|
+
},
|
|
12839
|
+
toJSON(message) {
|
|
12840
|
+
const obj = {};
|
|
12841
|
+
if (message.name !== "") {
|
|
12842
|
+
obj.name = message.name;
|
|
12843
|
+
}
|
|
12844
|
+
if (message.gpuType !== "") {
|
|
12845
|
+
obj.gpuType = message.gpuType;
|
|
12846
|
+
}
|
|
12847
|
+
if (message.region !== "") {
|
|
12848
|
+
obj.region = message.region;
|
|
12849
|
+
}
|
|
12850
|
+
if (message.minReservedWorkers !== 0) {
|
|
12851
|
+
obj.minReservedWorkers = Math.round(message.minReservedWorkers);
|
|
12852
|
+
}
|
|
12853
|
+
if (message.reservedWorkers !== 0) {
|
|
12854
|
+
obj.reservedWorkers = Math.round(message.reservedWorkers);
|
|
12855
|
+
}
|
|
12856
|
+
if (message.activeWorkers !== 0) {
|
|
12857
|
+
obj.activeWorkers = Math.round(message.activeWorkers);
|
|
12858
|
+
}
|
|
12859
|
+
if (message.idleWorkers !== 0) {
|
|
12860
|
+
obj.idleWorkers = Math.round(message.idleWorkers);
|
|
12861
|
+
}
|
|
12862
|
+
if (message.unfulfilledWorkers !== 0) {
|
|
12863
|
+
obj.unfulfilledWorkers = Math.round(message.unfulfilledWorkers);
|
|
12864
|
+
}
|
|
12865
|
+
if (message.tasks?.length) {
|
|
12866
|
+
obj.tasks = message.tasks.map((e) => ClusterReservation_Task.toJSON(e));
|
|
12867
|
+
}
|
|
12868
|
+
return obj;
|
|
12869
|
+
},
|
|
12870
|
+
create(base) {
|
|
12871
|
+
return ClusterReservation.fromPartial(base ?? {});
|
|
12872
|
+
},
|
|
12873
|
+
fromPartial(object) {
|
|
12874
|
+
const message = createBaseClusterReservation();
|
|
12875
|
+
message.name = object.name ?? "";
|
|
12876
|
+
message.gpuType = object.gpuType ?? "";
|
|
12877
|
+
message.region = object.region ?? "";
|
|
12878
|
+
message.minReservedWorkers = object.minReservedWorkers ?? 0;
|
|
12879
|
+
message.reservedWorkers = object.reservedWorkers ?? 0;
|
|
12880
|
+
message.activeWorkers = object.activeWorkers ?? 0;
|
|
12881
|
+
message.idleWorkers = object.idleWorkers ?? 0;
|
|
12882
|
+
message.unfulfilledWorkers = object.unfulfilledWorkers ?? 0;
|
|
12883
|
+
message.tasks = object.tasks?.map((e) => ClusterReservation_Task.fromPartial(e)) || [];
|
|
12884
|
+
return message;
|
|
12885
|
+
}
|
|
12886
|
+
};
|
|
12887
|
+
function createBaseClusterReservation_Task() {
|
|
12888
|
+
return { taskId: "", clusterRank: 0, appId: "", functionId: "" };
|
|
12889
|
+
}
|
|
12890
|
+
var ClusterReservation_Task = {
|
|
12891
|
+
encode(message, writer = new BinaryWriter()) {
|
|
12892
|
+
if (message.taskId !== "") {
|
|
12893
|
+
writer.uint32(10).string(message.taskId);
|
|
12894
|
+
}
|
|
12895
|
+
if (message.clusterRank !== 0) {
|
|
12896
|
+
writer.uint32(16).int32(message.clusterRank);
|
|
12897
|
+
}
|
|
12898
|
+
if (message.appId !== "") {
|
|
12899
|
+
writer.uint32(26).string(message.appId);
|
|
12900
|
+
}
|
|
12901
|
+
if (message.functionId !== "") {
|
|
12902
|
+
writer.uint32(34).string(message.functionId);
|
|
12903
|
+
}
|
|
12904
|
+
return writer;
|
|
12905
|
+
},
|
|
12906
|
+
decode(input, length) {
|
|
12907
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
12908
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
12909
|
+
const message = createBaseClusterReservation_Task();
|
|
12910
|
+
while (reader.pos < end) {
|
|
12911
|
+
const tag = reader.uint32();
|
|
12912
|
+
switch (tag >>> 3) {
|
|
12913
|
+
case 1: {
|
|
12914
|
+
if (tag !== 10) {
|
|
12915
|
+
break;
|
|
12916
|
+
}
|
|
12917
|
+
message.taskId = reader.string();
|
|
12918
|
+
continue;
|
|
12919
|
+
}
|
|
12920
|
+
case 2: {
|
|
12921
|
+
if (tag !== 16) {
|
|
12922
|
+
break;
|
|
12923
|
+
}
|
|
12924
|
+
message.clusterRank = reader.int32();
|
|
12925
|
+
continue;
|
|
12926
|
+
}
|
|
12927
|
+
case 3: {
|
|
12928
|
+
if (tag !== 26) {
|
|
12929
|
+
break;
|
|
12930
|
+
}
|
|
12931
|
+
message.appId = reader.string();
|
|
12932
|
+
continue;
|
|
12933
|
+
}
|
|
12934
|
+
case 4: {
|
|
12935
|
+
if (tag !== 34) {
|
|
12936
|
+
break;
|
|
12937
|
+
}
|
|
12938
|
+
message.functionId = reader.string();
|
|
12939
|
+
continue;
|
|
12940
|
+
}
|
|
12941
|
+
}
|
|
12942
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
12943
|
+
break;
|
|
12944
|
+
}
|
|
12945
|
+
reader.skip(tag & 7);
|
|
12946
|
+
}
|
|
12947
|
+
return message;
|
|
12948
|
+
},
|
|
12949
|
+
fromJSON(object) {
|
|
12950
|
+
return {
|
|
12951
|
+
taskId: isSet5(object.taskId) ? globalThis.String(object.taskId) : "",
|
|
12952
|
+
clusterRank: isSet5(object.clusterRank) ? globalThis.Number(object.clusterRank) : 0,
|
|
12953
|
+
appId: isSet5(object.appId) ? globalThis.String(object.appId) : "",
|
|
12954
|
+
functionId: isSet5(object.functionId) ? globalThis.String(object.functionId) : ""
|
|
12955
|
+
};
|
|
12956
|
+
},
|
|
12957
|
+
toJSON(message) {
|
|
12958
|
+
const obj = {};
|
|
12959
|
+
if (message.taskId !== "") {
|
|
12960
|
+
obj.taskId = message.taskId;
|
|
12961
|
+
}
|
|
12962
|
+
if (message.clusterRank !== 0) {
|
|
12963
|
+
obj.clusterRank = Math.round(message.clusterRank);
|
|
12964
|
+
}
|
|
12965
|
+
if (message.appId !== "") {
|
|
12966
|
+
obj.appId = message.appId;
|
|
12967
|
+
}
|
|
12968
|
+
if (message.functionId !== "") {
|
|
12969
|
+
obj.functionId = message.functionId;
|
|
12970
|
+
}
|
|
12971
|
+
return obj;
|
|
12972
|
+
},
|
|
12973
|
+
create(base) {
|
|
12974
|
+
return ClusterReservation_Task.fromPartial(base ?? {});
|
|
12975
|
+
},
|
|
12976
|
+
fromPartial(object) {
|
|
12977
|
+
const message = createBaseClusterReservation_Task();
|
|
12978
|
+
message.taskId = object.taskId ?? "";
|
|
12979
|
+
message.clusterRank = object.clusterRank ?? 0;
|
|
12980
|
+
message.appId = object.appId ?? "";
|
|
12981
|
+
message.functionId = object.functionId ?? "";
|
|
12982
|
+
return message;
|
|
12983
|
+
}
|
|
12984
|
+
};
|
|
12985
|
+
function createBaseClusterReservationListRequest() {
|
|
12986
|
+
return {};
|
|
12987
|
+
}
|
|
12988
|
+
var ClusterReservationListRequest = {
|
|
12989
|
+
encode(_, writer = new BinaryWriter()) {
|
|
12990
|
+
return writer;
|
|
12991
|
+
},
|
|
12992
|
+
decode(input, length) {
|
|
12993
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
12994
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
12995
|
+
const message = createBaseClusterReservationListRequest();
|
|
12996
|
+
while (reader.pos < end) {
|
|
12997
|
+
const tag = reader.uint32();
|
|
12998
|
+
switch (tag >>> 3) {
|
|
12999
|
+
}
|
|
13000
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
13001
|
+
break;
|
|
13002
|
+
}
|
|
13003
|
+
reader.skip(tag & 7);
|
|
13004
|
+
}
|
|
13005
|
+
return message;
|
|
13006
|
+
},
|
|
13007
|
+
fromJSON(_) {
|
|
13008
|
+
return {};
|
|
13009
|
+
},
|
|
13010
|
+
toJSON(_) {
|
|
13011
|
+
const obj = {};
|
|
13012
|
+
return obj;
|
|
13013
|
+
},
|
|
13014
|
+
create(base) {
|
|
13015
|
+
return ClusterReservationListRequest.fromPartial(base ?? {});
|
|
13016
|
+
},
|
|
13017
|
+
fromPartial(_) {
|
|
13018
|
+
const message = createBaseClusterReservationListRequest();
|
|
13019
|
+
return message;
|
|
13020
|
+
}
|
|
13021
|
+
};
|
|
13022
|
+
function createBaseClusterReservationListResponse() {
|
|
13023
|
+
return { reservations: [] };
|
|
13024
|
+
}
|
|
13025
|
+
var ClusterReservationListResponse = {
|
|
13026
|
+
encode(message, writer = new BinaryWriter()) {
|
|
13027
|
+
for (const v of message.reservations) {
|
|
13028
|
+
ClusterReservation.encode(v, writer.uint32(10).fork()).join();
|
|
13029
|
+
}
|
|
13030
|
+
return writer;
|
|
13031
|
+
},
|
|
13032
|
+
decode(input, length) {
|
|
13033
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
13034
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
13035
|
+
const message = createBaseClusterReservationListResponse();
|
|
13036
|
+
while (reader.pos < end) {
|
|
13037
|
+
const tag = reader.uint32();
|
|
13038
|
+
switch (tag >>> 3) {
|
|
13039
|
+
case 1: {
|
|
13040
|
+
if (tag !== 10) {
|
|
13041
|
+
break;
|
|
13042
|
+
}
|
|
13043
|
+
message.reservations.push(ClusterReservation.decode(reader, reader.uint32()));
|
|
13044
|
+
continue;
|
|
13045
|
+
}
|
|
13046
|
+
}
|
|
13047
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
13048
|
+
break;
|
|
13049
|
+
}
|
|
13050
|
+
reader.skip(tag & 7);
|
|
13051
|
+
}
|
|
13052
|
+
return message;
|
|
13053
|
+
},
|
|
13054
|
+
fromJSON(object) {
|
|
13055
|
+
return {
|
|
13056
|
+
reservations: globalThis.Array.isArray(object?.reservations) ? object.reservations.map((e) => ClusterReservation.fromJSON(e)) : []
|
|
13057
|
+
};
|
|
13058
|
+
},
|
|
13059
|
+
toJSON(message) {
|
|
13060
|
+
const obj = {};
|
|
13061
|
+
if (message.reservations?.length) {
|
|
13062
|
+
obj.reservations = message.reservations.map((e) => ClusterReservation.toJSON(e));
|
|
13063
|
+
}
|
|
13064
|
+
return obj;
|
|
13065
|
+
},
|
|
13066
|
+
create(base) {
|
|
13067
|
+
return ClusterReservationListResponse.fromPartial(base ?? {});
|
|
13068
|
+
},
|
|
13069
|
+
fromPartial(object) {
|
|
13070
|
+
const message = createBaseClusterReservationListResponse();
|
|
13071
|
+
message.reservations = object.reservations?.map((e) => ClusterReservation.fromPartial(e)) || [];
|
|
13072
|
+
return message;
|
|
13073
|
+
}
|
|
13074
|
+
};
|
|
12699
13075
|
function createBaseClusterStats() {
|
|
12700
13076
|
return { appId: "", taskIds: [], clusterId: "", startedAt: 0 };
|
|
12701
13077
|
}
|
|
@@ -17899,7 +18275,8 @@ function createBaseEndpointCreateRequest() {
|
|
|
17899
18275
|
environmentName: "",
|
|
17900
18276
|
unauthenticated: false,
|
|
17901
18277
|
servingMode: 0,
|
|
17902
|
-
sharedEndpointNoticeAcknowledged: false
|
|
18278
|
+
sharedEndpointNoticeAcknowledged: false,
|
|
18279
|
+
recipeId: void 0
|
|
17903
18280
|
};
|
|
17904
18281
|
}
|
|
17905
18282
|
var EndpointCreateRequest = {
|
|
@@ -17941,6 +18318,9 @@ var EndpointCreateRequest = {
|
|
|
17941
18318
|
if (message.sharedEndpointNoticeAcknowledged !== false) {
|
|
17942
18319
|
writer.uint32(88).bool(message.sharedEndpointNoticeAcknowledged);
|
|
17943
18320
|
}
|
|
18321
|
+
if (message.recipeId !== void 0) {
|
|
18322
|
+
writer.uint32(98).string(message.recipeId);
|
|
18323
|
+
}
|
|
17944
18324
|
return writer;
|
|
17945
18325
|
},
|
|
17946
18326
|
decode(input, length) {
|
|
@@ -18041,6 +18421,13 @@ var EndpointCreateRequest = {
|
|
|
18041
18421
|
message.sharedEndpointNoticeAcknowledged = reader.bool();
|
|
18042
18422
|
continue;
|
|
18043
18423
|
}
|
|
18424
|
+
case 12: {
|
|
18425
|
+
if (tag !== 98) {
|
|
18426
|
+
break;
|
|
18427
|
+
}
|
|
18428
|
+
message.recipeId = reader.string();
|
|
18429
|
+
continue;
|
|
18430
|
+
}
|
|
18044
18431
|
}
|
|
18045
18432
|
if ((tag & 7) === 4 || tag === 0) {
|
|
18046
18433
|
break;
|
|
@@ -18061,7 +18448,8 @@ var EndpointCreateRequest = {
|
|
|
18061
18448
|
environmentName: isSet5(object.environmentName) ? globalThis.String(object.environmentName) : "",
|
|
18062
18449
|
unauthenticated: isSet5(object.unauthenticated) ? globalThis.Boolean(object.unauthenticated) : false,
|
|
18063
18450
|
servingMode: isSet5(object.servingMode) ? endpointServingModeFromJSON(object.servingMode) : 0,
|
|
18064
|
-
sharedEndpointNoticeAcknowledged: isSet5(object.sharedEndpointNoticeAcknowledged) ? globalThis.Boolean(object.sharedEndpointNoticeAcknowledged) : false
|
|
18451
|
+
sharedEndpointNoticeAcknowledged: isSet5(object.sharedEndpointNoticeAcknowledged) ? globalThis.Boolean(object.sharedEndpointNoticeAcknowledged) : false,
|
|
18452
|
+
recipeId: isSet5(object.recipeId) ? globalThis.String(object.recipeId) : void 0
|
|
18065
18453
|
};
|
|
18066
18454
|
},
|
|
18067
18455
|
toJSON(message) {
|
|
@@ -18099,6 +18487,9 @@ var EndpointCreateRequest = {
|
|
|
18099
18487
|
if (message.sharedEndpointNoticeAcknowledged !== false) {
|
|
18100
18488
|
obj.sharedEndpointNoticeAcknowledged = message.sharedEndpointNoticeAcknowledged;
|
|
18101
18489
|
}
|
|
18490
|
+
if (message.recipeId !== void 0) {
|
|
18491
|
+
obj.recipeId = message.recipeId;
|
|
18492
|
+
}
|
|
18102
18493
|
return obj;
|
|
18103
18494
|
},
|
|
18104
18495
|
create(base) {
|
|
@@ -18117,11 +18508,12 @@ var EndpointCreateRequest = {
|
|
|
18117
18508
|
message.unauthenticated = object.unauthenticated ?? false;
|
|
18118
18509
|
message.servingMode = object.servingMode ?? 0;
|
|
18119
18510
|
message.sharedEndpointNoticeAcknowledged = object.sharedEndpointNoticeAcknowledged ?? false;
|
|
18511
|
+
message.recipeId = object.recipeId ?? void 0;
|
|
18120
18512
|
return message;
|
|
18121
18513
|
}
|
|
18122
18514
|
};
|
|
18123
18515
|
function createBaseEndpointCreateResponse() {
|
|
18124
|
-
return { endpointId: "", endpointPageUrl: "", name: "" };
|
|
18516
|
+
return { endpointId: "", endpointPageUrl: "", name: "", modelName: "" };
|
|
18125
18517
|
}
|
|
18126
18518
|
var EndpointCreateResponse = {
|
|
18127
18519
|
encode(message, writer = new BinaryWriter()) {
|
|
@@ -18134,6 +18526,9 @@ var EndpointCreateResponse = {
|
|
|
18134
18526
|
if (message.name !== "") {
|
|
18135
18527
|
writer.uint32(26).string(message.name);
|
|
18136
18528
|
}
|
|
18529
|
+
if (message.modelName !== "") {
|
|
18530
|
+
writer.uint32(34).string(message.modelName);
|
|
18531
|
+
}
|
|
18137
18532
|
return writer;
|
|
18138
18533
|
},
|
|
18139
18534
|
decode(input, length) {
|
|
@@ -18164,6 +18559,13 @@ var EndpointCreateResponse = {
|
|
|
18164
18559
|
message.name = reader.string();
|
|
18165
18560
|
continue;
|
|
18166
18561
|
}
|
|
18562
|
+
case 4: {
|
|
18563
|
+
if (tag !== 34) {
|
|
18564
|
+
break;
|
|
18565
|
+
}
|
|
18566
|
+
message.modelName = reader.string();
|
|
18567
|
+
continue;
|
|
18568
|
+
}
|
|
18167
18569
|
}
|
|
18168
18570
|
if ((tag & 7) === 4 || tag === 0) {
|
|
18169
18571
|
break;
|
|
@@ -18176,7 +18578,8 @@ var EndpointCreateResponse = {
|
|
|
18176
18578
|
return {
|
|
18177
18579
|
endpointId: isSet5(object.endpointId) ? globalThis.String(object.endpointId) : "",
|
|
18178
18580
|
endpointPageUrl: isSet5(object.endpointPageUrl) ? globalThis.String(object.endpointPageUrl) : "",
|
|
18179
|
-
name: isSet5(object.name) ? globalThis.String(object.name) : ""
|
|
18581
|
+
name: isSet5(object.name) ? globalThis.String(object.name) : "",
|
|
18582
|
+
modelName: isSet5(object.modelName) ? globalThis.String(object.modelName) : ""
|
|
18180
18583
|
};
|
|
18181
18584
|
},
|
|
18182
18585
|
toJSON(message) {
|
|
@@ -18190,6 +18593,9 @@ var EndpointCreateResponse = {
|
|
|
18190
18593
|
if (message.name !== "") {
|
|
18191
18594
|
obj.name = message.name;
|
|
18192
18595
|
}
|
|
18596
|
+
if (message.modelName !== "") {
|
|
18597
|
+
obj.modelName = message.modelName;
|
|
18598
|
+
}
|
|
18193
18599
|
return obj;
|
|
18194
18600
|
},
|
|
18195
18601
|
create(base) {
|
|
@@ -18200,6 +18606,7 @@ var EndpointCreateResponse = {
|
|
|
18200
18606
|
message.endpointId = object.endpointId ?? "";
|
|
18201
18607
|
message.endpointPageUrl = object.endpointPageUrl ?? "";
|
|
18202
18608
|
message.name = object.name ?? "";
|
|
18609
|
+
message.modelName = object.modelName ?? "";
|
|
18203
18610
|
return message;
|
|
18204
18611
|
}
|
|
18205
18612
|
};
|
|
@@ -18552,7 +18959,8 @@ function createBaseEndpointGetInfoResponse_EndpointInfoSummary() {
|
|
|
18552
18959
|
status: 0,
|
|
18553
18960
|
lifecycle: void 0,
|
|
18554
18961
|
volumeId: "",
|
|
18555
|
-
modelPath: ""
|
|
18962
|
+
modelPath: "",
|
|
18963
|
+
modelName: ""
|
|
18556
18964
|
};
|
|
18557
18965
|
}
|
|
18558
18966
|
var EndpointGetInfoResponse_EndpointInfoSummary = {
|
|
@@ -18587,6 +18995,9 @@ var EndpointGetInfoResponse_EndpointInfoSummary = {
|
|
|
18587
18995
|
if (message.modelPath !== "") {
|
|
18588
18996
|
writer.uint32(98).string(message.modelPath);
|
|
18589
18997
|
}
|
|
18998
|
+
if (message.modelName !== "") {
|
|
18999
|
+
writer.uint32(106).string(message.modelName);
|
|
19000
|
+
}
|
|
18590
19001
|
return writer;
|
|
18591
19002
|
},
|
|
18592
19003
|
decode(input, length) {
|
|
@@ -18666,6 +19077,13 @@ var EndpointGetInfoResponse_EndpointInfoSummary = {
|
|
|
18666
19077
|
message.modelPath = reader.string();
|
|
18667
19078
|
continue;
|
|
18668
19079
|
}
|
|
19080
|
+
case 13: {
|
|
19081
|
+
if (tag !== 106) {
|
|
19082
|
+
break;
|
|
19083
|
+
}
|
|
19084
|
+
message.modelName = reader.string();
|
|
19085
|
+
continue;
|
|
19086
|
+
}
|
|
18669
19087
|
}
|
|
18670
19088
|
if ((tag & 7) === 4 || tag === 0) {
|
|
18671
19089
|
break;
|
|
@@ -18685,7 +19103,8 @@ var EndpointGetInfoResponse_EndpointInfoSummary = {
|
|
|
18685
19103
|
status: isSet5(object.status) ? endpointGetInfoResponse_EndpointStatusFromJSON(object.status) : 0,
|
|
18686
19104
|
lifecycle: isSet5(object.lifecycle) ? EndpointLifecycle.fromJSON(object.lifecycle) : void 0,
|
|
18687
19105
|
volumeId: isSet5(object.volumeId) ? globalThis.String(object.volumeId) : "",
|
|
18688
|
-
modelPath: isSet5(object.modelPath) ? globalThis.String(object.modelPath) : ""
|
|
19106
|
+
modelPath: isSet5(object.modelPath) ? globalThis.String(object.modelPath) : "",
|
|
19107
|
+
modelName: isSet5(object.modelName) ? globalThis.String(object.modelName) : ""
|
|
18689
19108
|
};
|
|
18690
19109
|
},
|
|
18691
19110
|
toJSON(message) {
|
|
@@ -18720,6 +19139,9 @@ var EndpointGetInfoResponse_EndpointInfoSummary = {
|
|
|
18720
19139
|
if (message.modelPath !== "") {
|
|
18721
19140
|
obj.modelPath = message.modelPath;
|
|
18722
19141
|
}
|
|
19142
|
+
if (message.modelName !== "") {
|
|
19143
|
+
obj.modelName = message.modelName;
|
|
19144
|
+
}
|
|
18723
19145
|
return obj;
|
|
18724
19146
|
},
|
|
18725
19147
|
create(base) {
|
|
@@ -18737,6 +19159,7 @@ var EndpointGetInfoResponse_EndpointInfoSummary = {
|
|
|
18737
19159
|
message.lifecycle = object.lifecycle !== void 0 && object.lifecycle !== null ? EndpointLifecycle.fromPartial(object.lifecycle) : void 0;
|
|
18738
19160
|
message.volumeId = object.volumeId ?? "";
|
|
18739
19161
|
message.modelPath = object.modelPath ?? "";
|
|
19162
|
+
message.modelName = object.modelName ?? "";
|
|
18740
19163
|
return message;
|
|
18741
19164
|
}
|
|
18742
19165
|
};
|
|
@@ -45016,7 +45439,7 @@ var SandboxGetExitSnapshotResponse_Error = {
|
|
|
45016
45439
|
}
|
|
45017
45440
|
};
|
|
45018
45441
|
function createBaseSandboxGetFromNameRequest() {
|
|
45019
|
-
return { sandboxName: "", environmentName: "", appName: "" };
|
|
45442
|
+
return { sandboxName: "", environmentName: "", appName: "", includeTerminated: false };
|
|
45020
45443
|
}
|
|
45021
45444
|
var SandboxGetFromNameRequest = {
|
|
45022
45445
|
encode(message, writer = new BinaryWriter()) {
|
|
@@ -45029,6 +45452,9 @@ var SandboxGetFromNameRequest = {
|
|
|
45029
45452
|
if (message.appName !== "") {
|
|
45030
45453
|
writer.uint32(26).string(message.appName);
|
|
45031
45454
|
}
|
|
45455
|
+
if (message.includeTerminated !== false) {
|
|
45456
|
+
writer.uint32(32).bool(message.includeTerminated);
|
|
45457
|
+
}
|
|
45032
45458
|
return writer;
|
|
45033
45459
|
},
|
|
45034
45460
|
decode(input, length) {
|
|
@@ -45059,6 +45485,13 @@ var SandboxGetFromNameRequest = {
|
|
|
45059
45485
|
message.appName = reader.string();
|
|
45060
45486
|
continue;
|
|
45061
45487
|
}
|
|
45488
|
+
case 4: {
|
|
45489
|
+
if (tag !== 32) {
|
|
45490
|
+
break;
|
|
45491
|
+
}
|
|
45492
|
+
message.includeTerminated = reader.bool();
|
|
45493
|
+
continue;
|
|
45494
|
+
}
|
|
45062
45495
|
}
|
|
45063
45496
|
if ((tag & 7) === 4 || tag === 0) {
|
|
45064
45497
|
break;
|
|
@@ -45071,7 +45504,8 @@ var SandboxGetFromNameRequest = {
|
|
|
45071
45504
|
return {
|
|
45072
45505
|
sandboxName: isSet5(object.sandboxName) ? globalThis.String(object.sandboxName) : "",
|
|
45073
45506
|
environmentName: isSet5(object.environmentName) ? globalThis.String(object.environmentName) : "",
|
|
45074
|
-
appName: isSet5(object.appName) ? globalThis.String(object.appName) : ""
|
|
45507
|
+
appName: isSet5(object.appName) ? globalThis.String(object.appName) : "",
|
|
45508
|
+
includeTerminated: isSet5(object.includeTerminated) ? globalThis.Boolean(object.includeTerminated) : false
|
|
45075
45509
|
};
|
|
45076
45510
|
},
|
|
45077
45511
|
toJSON(message) {
|
|
@@ -45085,6 +45519,9 @@ var SandboxGetFromNameRequest = {
|
|
|
45085
45519
|
if (message.appName !== "") {
|
|
45086
45520
|
obj.appName = message.appName;
|
|
45087
45521
|
}
|
|
45522
|
+
if (message.includeTerminated !== false) {
|
|
45523
|
+
obj.includeTerminated = message.includeTerminated;
|
|
45524
|
+
}
|
|
45088
45525
|
return obj;
|
|
45089
45526
|
},
|
|
45090
45527
|
create(base) {
|
|
@@ -45095,6 +45532,7 @@ var SandboxGetFromNameRequest = {
|
|
|
45095
45532
|
message.sandboxName = object.sandboxName ?? "";
|
|
45096
45533
|
message.environmentName = object.environmentName ?? "";
|
|
45097
45534
|
message.appName = object.appName ?? "";
|
|
45535
|
+
message.includeTerminated = object.includeTerminated ?? false;
|
|
45098
45536
|
return message;
|
|
45099
45537
|
}
|
|
45100
45538
|
};
|
|
@@ -61652,6 +62090,14 @@ var ModalClientDefinition = {
|
|
|
61652
62090
|
responseStream: false,
|
|
61653
62091
|
options: {}
|
|
61654
62092
|
},
|
|
62093
|
+
clusterReservationList: {
|
|
62094
|
+
name: "ClusterReservationList",
|
|
62095
|
+
requestType: ClusterReservationListRequest,
|
|
62096
|
+
requestStream: false,
|
|
62097
|
+
responseType: ClusterReservationListResponse,
|
|
62098
|
+
responseStream: false,
|
|
62099
|
+
options: {}
|
|
62100
|
+
},
|
|
61655
62101
|
/** Container */
|
|
61656
62102
|
containerCheckpoint: {
|
|
61657
62103
|
name: "ContainerCheckpoint",
|
|
@@ -74579,7 +75025,7 @@ var AuthTokenManager = class {
|
|
|
74579
75025
|
};
|
|
74580
75026
|
|
|
74581
75027
|
// src/version.ts
|
|
74582
|
-
var SDK_VERSION = "0.11.1-dev.
|
|
75028
|
+
var SDK_VERSION = "0.11.1-dev.8";
|
|
74583
75029
|
function getSDKVersion() {
|
|
74584
75030
|
return SDK_VERSION;
|
|
74585
75031
|
}
|
|
@@ -76457,6 +76903,20 @@ var FunctionService = class {
|
|
|
76457
76903
|
}
|
|
76458
76904
|
}
|
|
76459
76905
|
};
|
|
76906
|
+
function statsDistributions(stats) {
|
|
76907
|
+
return Object.fromEntries(
|
|
76908
|
+
Object.entries(stats).map(([key, distribution]) => [
|
|
76909
|
+
key,
|
|
76910
|
+
{
|
|
76911
|
+
unit: distribution.unit,
|
|
76912
|
+
percentiles: distribution.percentiles.map((p) => ({
|
|
76913
|
+
percentile: p.percentileBasisPoints / 100,
|
|
76914
|
+
value: p.value
|
|
76915
|
+
}))
|
|
76916
|
+
}
|
|
76917
|
+
])
|
|
76918
|
+
);
|
|
76919
|
+
}
|
|
76460
76920
|
function mergeServiceOptions(base, diff) {
|
|
76461
76921
|
const filteredDiff = Object.fromEntries(
|
|
76462
76922
|
Object.entries(diff).filter(([, value]) => value !== void 0)
|
|
@@ -76824,6 +77284,65 @@ var Function_ = class _Function_ {
|
|
|
76824
77284
|
this.functionId
|
|
76825
77285
|
);
|
|
76826
77286
|
}
|
|
77287
|
+
/**
|
|
77288
|
+
* Return historical statistics. Defaults to the last hour; the maximum range is 7 days.
|
|
77289
|
+
*
|
|
77290
|
+
* @example Read statistics for the last hour.
|
|
77291
|
+
* ```ts
|
|
77292
|
+
* const fn = await modal.functions.fromName("libmodal-test-support", "echo_string");
|
|
77293
|
+
* const stats = await fn.stats();
|
|
77294
|
+
* console.log(stats.inputSuccessCount, stats.inputFailureCount);
|
|
77295
|
+
* ```
|
|
77296
|
+
*
|
|
77297
|
+
* @example Include all variants over the last 24 hours.
|
|
77298
|
+
* ```ts
|
|
77299
|
+
* const until = new Date();
|
|
77300
|
+
* const since = new Date(until.getTime() - 24 * 60 * 60 * 1000);
|
|
77301
|
+
* const variantStats = await fn.stats({ since, until, allVariants: true });
|
|
77302
|
+
* for (const [metric, distribution] of Object.entries(variantStats.inputPercentileStats)) {
|
|
77303
|
+
* console.log(metric, distribution.unit, distribution.percentiles);
|
|
77304
|
+
* }
|
|
77305
|
+
* ```
|
|
77306
|
+
*
|
|
77307
|
+
* Set `container` to a container ID to restrict statistics to that container.
|
|
77308
|
+
*/
|
|
77309
|
+
async stats(params = {}) {
|
|
77310
|
+
const until = params.until ?? /* @__PURE__ */ new Date();
|
|
77311
|
+
const since = params.since ?? new Date(until.getTime() - 60 * 60 * 1e3);
|
|
77312
|
+
if (!Number.isFinite(since.getTime()) || !Number.isFinite(until.getTime())) {
|
|
77313
|
+
throw new InvalidError("`since` and `until` must be valid dates.");
|
|
77314
|
+
}
|
|
77315
|
+
if (since >= until) {
|
|
77316
|
+
throw new InvalidError("`since` must be before `until`.");
|
|
77317
|
+
}
|
|
77318
|
+
const allVariants = params.allVariants ?? false;
|
|
77319
|
+
const resp = await this.#client.cpClient.functionGetTimeRangeStats(
|
|
77320
|
+
FunctionGetTimeRangeStatsRequest.create({
|
|
77321
|
+
functionId: this.functionId,
|
|
77322
|
+
since,
|
|
77323
|
+
until,
|
|
77324
|
+
containerId: params.container || void 0,
|
|
77325
|
+
rollup: allVariants
|
|
77326
|
+
})
|
|
77327
|
+
);
|
|
77328
|
+
return {
|
|
77329
|
+
since: resp.since ?? /* @__PURE__ */ new Date(0),
|
|
77330
|
+
until: resp.until ?? /* @__PURE__ */ new Date(0),
|
|
77331
|
+
inputSuccessCount: resp.inputSuccessCount,
|
|
77332
|
+
inputFailureCount: resp.inputFailureCount,
|
|
77333
|
+
inputTimeoutCount: resp.inputTimeoutCount,
|
|
77334
|
+
inputRunningAtEndCount: resp.inputRunningAtEndCount,
|
|
77335
|
+
containerStartedCount: resp.containerStartedCount,
|
|
77336
|
+
containerErrorCount: resp.containerErrorCount,
|
|
77337
|
+
containerCreatingAtEndCount: resp.containerCreatingAtEndCount,
|
|
77338
|
+
variantCount: resp.variantCount,
|
|
77339
|
+
inputPercentileStats: statsDistributions(resp.inputPercentileStats),
|
|
77340
|
+
containerPercentileStats: statsDistributions(
|
|
77341
|
+
resp.containerPercentileStats
|
|
77342
|
+
),
|
|
77343
|
+
allVariants
|
|
77344
|
+
};
|
|
77345
|
+
}
|
|
76827
77346
|
// Returns statistics about the Function.
|
|
76828
77347
|
async getCurrentStats() {
|
|
76829
77348
|
const resp = await this.#client.cpClient.functionGetCurrentStats(
|