modal 0.10.2-dev.1 → 0.10.2-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +259 -121
- package/dist/index.d.cts +106 -18
- package/dist/index.d.ts +106 -18
- package/dist/index.js +258 -121
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -17639,7 +17639,8 @@ function createBaseEndpointCreateRequest() {
|
|
|
17639
17639
|
inputModalities: [],
|
|
17640
17640
|
environmentName: "",
|
|
17641
17641
|
unauthenticated: false,
|
|
17642
|
-
servingMode: 0
|
|
17642
|
+
servingMode: 0,
|
|
17643
|
+
sharedEndpointNoticeAcknowledged: false
|
|
17643
17644
|
};
|
|
17644
17645
|
}
|
|
17645
17646
|
var EndpointCreateRequest = {
|
|
@@ -17678,6 +17679,9 @@ var EndpointCreateRequest = {
|
|
|
17678
17679
|
if (message.servingMode !== 0) {
|
|
17679
17680
|
writer.uint32(80).int32(message.servingMode);
|
|
17680
17681
|
}
|
|
17682
|
+
if (message.sharedEndpointNoticeAcknowledged !== false) {
|
|
17683
|
+
writer.uint32(88).bool(message.sharedEndpointNoticeAcknowledged);
|
|
17684
|
+
}
|
|
17681
17685
|
return writer;
|
|
17682
17686
|
},
|
|
17683
17687
|
decode(input, length) {
|
|
@@ -17771,6 +17775,13 @@ var EndpointCreateRequest = {
|
|
|
17771
17775
|
message.servingMode = reader.int32();
|
|
17772
17776
|
continue;
|
|
17773
17777
|
}
|
|
17778
|
+
case 11: {
|
|
17779
|
+
if (tag !== 88) {
|
|
17780
|
+
break;
|
|
17781
|
+
}
|
|
17782
|
+
message.sharedEndpointNoticeAcknowledged = reader.bool();
|
|
17783
|
+
continue;
|
|
17784
|
+
}
|
|
17774
17785
|
}
|
|
17775
17786
|
if ((tag & 7) === 4 || tag === 0) {
|
|
17776
17787
|
break;
|
|
@@ -17790,7 +17801,8 @@ var EndpointCreateRequest = {
|
|
|
17790
17801
|
inputModalities: globalThis.Array.isArray(object?.inputModalities) ? object.inputModalities.map((e) => endpointInputModalityFromJSON(e)) : [],
|
|
17791
17802
|
environmentName: isSet5(object.environmentName) ? globalThis.String(object.environmentName) : "",
|
|
17792
17803
|
unauthenticated: isSet5(object.unauthenticated) ? globalThis.Boolean(object.unauthenticated) : false,
|
|
17793
|
-
servingMode: isSet5(object.servingMode) ? endpointServingModeFromJSON(object.servingMode) : 0
|
|
17804
|
+
servingMode: isSet5(object.servingMode) ? endpointServingModeFromJSON(object.servingMode) : 0,
|
|
17805
|
+
sharedEndpointNoticeAcknowledged: isSet5(object.sharedEndpointNoticeAcknowledged) ? globalThis.Boolean(object.sharedEndpointNoticeAcknowledged) : false
|
|
17794
17806
|
};
|
|
17795
17807
|
},
|
|
17796
17808
|
toJSON(message) {
|
|
@@ -17825,6 +17837,9 @@ var EndpointCreateRequest = {
|
|
|
17825
17837
|
if (message.servingMode !== 0) {
|
|
17826
17838
|
obj.servingMode = endpointServingModeToJSON(message.servingMode);
|
|
17827
17839
|
}
|
|
17840
|
+
if (message.sharedEndpointNoticeAcknowledged !== false) {
|
|
17841
|
+
obj.sharedEndpointNoticeAcknowledged = message.sharedEndpointNoticeAcknowledged;
|
|
17842
|
+
}
|
|
17828
17843
|
return obj;
|
|
17829
17844
|
},
|
|
17830
17845
|
create(base) {
|
|
@@ -17842,6 +17857,7 @@ var EndpointCreateRequest = {
|
|
|
17842
17857
|
message.environmentName = object.environmentName ?? "";
|
|
17843
17858
|
message.unauthenticated = object.unauthenticated ?? false;
|
|
17844
17859
|
message.servingMode = object.servingMode ?? 0;
|
|
17860
|
+
message.sharedEndpointNoticeAcknowledged = object.sharedEndpointNoticeAcknowledged ?? false;
|
|
17845
17861
|
return message;
|
|
17846
17862
|
}
|
|
17847
17863
|
};
|
|
@@ -22400,8 +22416,6 @@ function createBaseFunctionMessage() {
|
|
|
22400
22416
|
cloudBucketMounts: [],
|
|
22401
22417
|
schedulerPlacement: void 0,
|
|
22402
22418
|
isClass: false,
|
|
22403
|
-
useFunctionId: "",
|
|
22404
|
-
useMethodName: "",
|
|
22405
22419
|
classParameterInfo: void 0,
|
|
22406
22420
|
batchMaxSize: 0,
|
|
22407
22421
|
batchLingerMs: 0,
|
|
@@ -22572,12 +22586,6 @@ var FunctionMessage = {
|
|
|
22572
22586
|
if (message.isClass !== false) {
|
|
22573
22587
|
writer.uint32(424).bool(message.isClass);
|
|
22574
22588
|
}
|
|
22575
|
-
if (message.useFunctionId !== "") {
|
|
22576
|
-
writer.uint32(434).string(message.useFunctionId);
|
|
22577
|
-
}
|
|
22578
|
-
if (message.useMethodName !== "") {
|
|
22579
|
-
writer.uint32(442).string(message.useMethodName);
|
|
22580
|
-
}
|
|
22581
22589
|
if (message.classParameterInfo !== void 0) {
|
|
22582
22590
|
ClassParameterInfo.encode(message.classParameterInfo, writer.uint32(450).fork()).join();
|
|
22583
22591
|
}
|
|
@@ -23003,20 +23011,6 @@ var FunctionMessage = {
|
|
|
23003
23011
|
message.isClass = reader.bool();
|
|
23004
23012
|
continue;
|
|
23005
23013
|
}
|
|
23006
|
-
case 54: {
|
|
23007
|
-
if (tag !== 434) {
|
|
23008
|
-
break;
|
|
23009
|
-
}
|
|
23010
|
-
message.useFunctionId = reader.string();
|
|
23011
|
-
continue;
|
|
23012
|
-
}
|
|
23013
|
-
case 55: {
|
|
23014
|
-
if (tag !== 442) {
|
|
23015
|
-
break;
|
|
23016
|
-
}
|
|
23017
|
-
message.useMethodName = reader.string();
|
|
23018
|
-
continue;
|
|
23019
|
-
}
|
|
23020
23014
|
case 56: {
|
|
23021
23015
|
if (tag !== 450) {
|
|
23022
23016
|
break;
|
|
@@ -23349,8 +23343,6 @@ var FunctionMessage = {
|
|
|
23349
23343
|
cloudBucketMounts: globalThis.Array.isArray(object?.cloudBucketMounts) ? object.cloudBucketMounts.map((e) => CloudBucketMount.fromJSON(e)) : [],
|
|
23350
23344
|
schedulerPlacement: isSet5(object.schedulerPlacement) ? SchedulerPlacement.fromJSON(object.schedulerPlacement) : void 0,
|
|
23351
23345
|
isClass: isSet5(object.isClass) ? globalThis.Boolean(object.isClass) : false,
|
|
23352
|
-
useFunctionId: isSet5(object.useFunctionId) ? globalThis.String(object.useFunctionId) : "",
|
|
23353
|
-
useMethodName: isSet5(object.useMethodName) ? globalThis.String(object.useMethodName) : "",
|
|
23354
23346
|
classParameterInfo: isSet5(object.classParameterInfo) ? ClassParameterInfo.fromJSON(object.classParameterInfo) : void 0,
|
|
23355
23347
|
batchMaxSize: isSet5(object.batchMaxSize) ? globalThis.Number(object.batchMaxSize) : 0,
|
|
23356
23348
|
batchLingerMs: isSet5(object.batchLingerMs) ? globalThis.Number(object.batchLingerMs) : 0,
|
|
@@ -23527,12 +23519,6 @@ var FunctionMessage = {
|
|
|
23527
23519
|
if (message.isClass !== false) {
|
|
23528
23520
|
obj.isClass = message.isClass;
|
|
23529
23521
|
}
|
|
23530
|
-
if (message.useFunctionId !== "") {
|
|
23531
|
-
obj.useFunctionId = message.useFunctionId;
|
|
23532
|
-
}
|
|
23533
|
-
if (message.useMethodName !== "") {
|
|
23534
|
-
obj.useMethodName = message.useMethodName;
|
|
23535
|
-
}
|
|
23536
23522
|
if (message.classParameterInfo !== void 0) {
|
|
23537
23523
|
obj.classParameterInfo = ClassParameterInfo.toJSON(message.classParameterInfo);
|
|
23538
23524
|
}
|
|
@@ -23706,8 +23692,6 @@ var FunctionMessage = {
|
|
|
23706
23692
|
message.cloudBucketMounts = object.cloudBucketMounts?.map((e) => CloudBucketMount.fromPartial(e)) || [];
|
|
23707
23693
|
message.schedulerPlacement = object.schedulerPlacement !== void 0 && object.schedulerPlacement !== null ? SchedulerPlacement.fromPartial(object.schedulerPlacement) : void 0;
|
|
23708
23694
|
message.isClass = object.isClass ?? false;
|
|
23709
|
-
message.useFunctionId = object.useFunctionId ?? "";
|
|
23710
|
-
message.useMethodName = object.useMethodName ?? "";
|
|
23711
23695
|
message.classParameterInfo = object.classParameterInfo !== void 0 && object.classParameterInfo !== null ? ClassParameterInfo.fromPartial(object.classParameterInfo) : void 0;
|
|
23712
23696
|
message.batchMaxSize = object.batchMaxSize ?? 0;
|
|
23713
23697
|
message.batchLingerMs = object.batchLingerMs ?? 0;
|
|
@@ -25479,8 +25463,6 @@ function createBaseFunctionData() {
|
|
|
25479
25463
|
isClass: false,
|
|
25480
25464
|
classParameterInfo: void 0,
|
|
25481
25465
|
isMethod: false,
|
|
25482
|
-
useFunctionId: "",
|
|
25483
|
-
useMethodName: "",
|
|
25484
25466
|
rankedFunctions: [],
|
|
25485
25467
|
schedule: void 0,
|
|
25486
25468
|
untrusted: false,
|
|
@@ -25572,12 +25554,6 @@ var FunctionData = {
|
|
|
25572
25554
|
if (message.isMethod !== false) {
|
|
25573
25555
|
writer.uint32(120).bool(message.isMethod);
|
|
25574
25556
|
}
|
|
25575
|
-
if (message.useFunctionId !== "") {
|
|
25576
|
-
writer.uint32(130).string(message.useFunctionId);
|
|
25577
|
-
}
|
|
25578
|
-
if (message.useMethodName !== "") {
|
|
25579
|
-
writer.uint32(138).string(message.useMethodName);
|
|
25580
|
-
}
|
|
25581
25557
|
for (const v of message.rankedFunctions) {
|
|
25582
25558
|
FunctionData_RankedFunction.encode(v, writer.uint32(146).fork()).join();
|
|
25583
25559
|
}
|
|
@@ -25809,20 +25785,6 @@ var FunctionData = {
|
|
|
25809
25785
|
message.isMethod = reader.bool();
|
|
25810
25786
|
continue;
|
|
25811
25787
|
}
|
|
25812
|
-
case 16: {
|
|
25813
|
-
if (tag !== 130) {
|
|
25814
|
-
break;
|
|
25815
|
-
}
|
|
25816
|
-
message.useFunctionId = reader.string();
|
|
25817
|
-
continue;
|
|
25818
|
-
}
|
|
25819
|
-
case 17: {
|
|
25820
|
-
if (tag !== 138) {
|
|
25821
|
-
break;
|
|
25822
|
-
}
|
|
25823
|
-
message.useMethodName = reader.string();
|
|
25824
|
-
continue;
|
|
25825
|
-
}
|
|
25826
25788
|
case 18: {
|
|
25827
25789
|
if (tag !== 146) {
|
|
25828
25790
|
break;
|
|
@@ -26002,8 +25964,6 @@ var FunctionData = {
|
|
|
26002
25964
|
isClass: isSet5(object.isClass) ? globalThis.Boolean(object.isClass) : false,
|
|
26003
25965
|
classParameterInfo: isSet5(object.classParameterInfo) ? ClassParameterInfo.fromJSON(object.classParameterInfo) : void 0,
|
|
26004
25966
|
isMethod: isSet5(object.isMethod) ? globalThis.Boolean(object.isMethod) : false,
|
|
26005
|
-
useFunctionId: isSet5(object.useFunctionId) ? globalThis.String(object.useFunctionId) : "",
|
|
26006
|
-
useMethodName: isSet5(object.useMethodName) ? globalThis.String(object.useMethodName) : "",
|
|
26007
25967
|
rankedFunctions: globalThis.Array.isArray(object?.rankedFunctions) ? object.rankedFunctions.map((e) => FunctionData_RankedFunction.fromJSON(e)) : [],
|
|
26008
25968
|
schedule: isSet5(object.schedule) ? Schedule.fromJSON(object.schedule) : void 0,
|
|
26009
25969
|
untrusted: isSet5(object.untrusted) ? globalThis.Boolean(object.untrusted) : false,
|
|
@@ -26104,12 +26064,6 @@ var FunctionData = {
|
|
|
26104
26064
|
if (message.isMethod !== false) {
|
|
26105
26065
|
obj.isMethod = message.isMethod;
|
|
26106
26066
|
}
|
|
26107
|
-
if (message.useFunctionId !== "") {
|
|
26108
|
-
obj.useFunctionId = message.useFunctionId;
|
|
26109
|
-
}
|
|
26110
|
-
if (message.useMethodName !== "") {
|
|
26111
|
-
obj.useMethodName = message.useMethodName;
|
|
26112
|
-
}
|
|
26113
26067
|
if (message.rankedFunctions?.length) {
|
|
26114
26068
|
obj.rankedFunctions = message.rankedFunctions.map((e) => FunctionData_RankedFunction.toJSON(e));
|
|
26115
26069
|
}
|
|
@@ -26205,8 +26159,6 @@ var FunctionData = {
|
|
|
26205
26159
|
message.isClass = object.isClass ?? false;
|
|
26206
26160
|
message.classParameterInfo = object.classParameterInfo !== void 0 && object.classParameterInfo !== null ? ClassParameterInfo.fromPartial(object.classParameterInfo) : void 0;
|
|
26207
26161
|
message.isMethod = object.isMethod ?? false;
|
|
26208
|
-
message.useFunctionId = object.useFunctionId ?? "";
|
|
26209
|
-
message.useMethodName = object.useMethodName ?? "";
|
|
26210
26162
|
message.rankedFunctions = object.rankedFunctions?.map((e) => FunctionData_RankedFunction.fromPartial(e)) || [];
|
|
26211
26163
|
message.schedule = object.schedule !== void 0 && object.schedule !== null ? Schedule.fromPartial(object.schedule) : void 0;
|
|
26212
26164
|
message.untrusted = object.untrusted ?? false;
|
|
@@ -28839,7 +28791,6 @@ function createBaseFunctionHandleMetadata() {
|
|
|
28839
28791
|
functionType: 0,
|
|
28840
28792
|
webUrl: "",
|
|
28841
28793
|
isMethod: false,
|
|
28842
|
-
useFunctionId: "",
|
|
28843
28794
|
useMethodName: "",
|
|
28844
28795
|
definitionId: "",
|
|
28845
28796
|
classParameterInfo: void 0,
|
|
@@ -28870,9 +28821,6 @@ var FunctionHandleMetadata = {
|
|
|
28870
28821
|
if (message.isMethod !== false) {
|
|
28871
28822
|
writer.uint32(312).bool(message.isMethod);
|
|
28872
28823
|
}
|
|
28873
|
-
if (message.useFunctionId !== "") {
|
|
28874
|
-
writer.uint32(322).string(message.useFunctionId);
|
|
28875
|
-
}
|
|
28876
28824
|
if (message.useMethodName !== "") {
|
|
28877
28825
|
writer.uint32(330).string(message.useMethodName);
|
|
28878
28826
|
}
|
|
@@ -28956,13 +28904,6 @@ var FunctionHandleMetadata = {
|
|
|
28956
28904
|
message.isMethod = reader.bool();
|
|
28957
28905
|
continue;
|
|
28958
28906
|
}
|
|
28959
|
-
case 40: {
|
|
28960
|
-
if (tag !== 322) {
|
|
28961
|
-
break;
|
|
28962
|
-
}
|
|
28963
|
-
message.useFunctionId = reader.string();
|
|
28964
|
-
continue;
|
|
28965
|
-
}
|
|
28966
28907
|
case 41: {
|
|
28967
28908
|
if (tag !== 330) {
|
|
28968
28909
|
break;
|
|
@@ -29092,7 +29033,6 @@ var FunctionHandleMetadata = {
|
|
|
29092
29033
|
functionType: isSet5(object.functionType) ? function_FunctionTypeFromJSON(object.functionType) : 0,
|
|
29093
29034
|
webUrl: isSet5(object.webUrl) ? globalThis.String(object.webUrl) : "",
|
|
29094
29035
|
isMethod: isSet5(object.isMethod) ? globalThis.Boolean(object.isMethod) : false,
|
|
29095
|
-
useFunctionId: isSet5(object.useFunctionId) ? globalThis.String(object.useFunctionId) : "",
|
|
29096
29036
|
useMethodName: isSet5(object.useMethodName) ? globalThis.String(object.useMethodName) : "",
|
|
29097
29037
|
definitionId: isSet5(object.definitionId) ? globalThis.String(object.definitionId) : "",
|
|
29098
29038
|
classParameterInfo: isSet5(object.classParameterInfo) ? ClassParameterInfo.fromJSON(object.classParameterInfo) : void 0,
|
|
@@ -29129,9 +29069,6 @@ var FunctionHandleMetadata = {
|
|
|
29129
29069
|
if (message.isMethod !== false) {
|
|
29130
29070
|
obj.isMethod = message.isMethod;
|
|
29131
29071
|
}
|
|
29132
|
-
if (message.useFunctionId !== "") {
|
|
29133
|
-
obj.useFunctionId = message.useFunctionId;
|
|
29134
|
-
}
|
|
29135
29072
|
if (message.useMethodName !== "") {
|
|
29136
29073
|
obj.useMethodName = message.useMethodName;
|
|
29137
29074
|
}
|
|
@@ -29191,7 +29128,6 @@ var FunctionHandleMetadata = {
|
|
|
29191
29128
|
message.functionType = object.functionType ?? 0;
|
|
29192
29129
|
message.webUrl = object.webUrl ?? "";
|
|
29193
29130
|
message.isMethod = object.isMethod ?? false;
|
|
29194
|
-
message.useFunctionId = object.useFunctionId ?? "";
|
|
29195
29131
|
message.useMethodName = object.useMethodName ?? "";
|
|
29196
29132
|
message.definitionId = object.definitionId ?? "";
|
|
29197
29133
|
message.classParameterInfo = object.classParameterInfo !== void 0 && object.classParameterInfo !== null ? ClassParameterInfo.fromPartial(object.classParameterInfo) : void 0;
|
|
@@ -30079,8 +30015,6 @@ function createBaseFunctionPrecreateRequest() {
|
|
|
30079
30015
|
existingFunctionId: "",
|
|
30080
30016
|
functionType: 0,
|
|
30081
30017
|
webhookConfig: void 0,
|
|
30082
|
-
useFunctionId: "",
|
|
30083
|
-
useMethodName: "",
|
|
30084
30018
|
methodDefinitions: {},
|
|
30085
30019
|
functionSchema: void 0,
|
|
30086
30020
|
supportedInputFormats: [],
|
|
@@ -30104,12 +30038,6 @@ var FunctionPrecreateRequest = {
|
|
|
30104
30038
|
if (message.webhookConfig !== void 0) {
|
|
30105
30039
|
WebhookConfig.encode(message.webhookConfig, writer.uint32(42).fork()).join();
|
|
30106
30040
|
}
|
|
30107
|
-
if (message.useFunctionId !== "") {
|
|
30108
|
-
writer.uint32(50).string(message.useFunctionId);
|
|
30109
|
-
}
|
|
30110
|
-
if (message.useMethodName !== "") {
|
|
30111
|
-
writer.uint32(58).string(message.useMethodName);
|
|
30112
|
-
}
|
|
30113
30041
|
Object.entries(message.methodDefinitions).forEach(([key, value]) => {
|
|
30114
30042
|
FunctionPrecreateRequest_MethodDefinitionsEntry.encode({ key, value }, writer.uint32(66).fork()).join();
|
|
30115
30043
|
});
|
|
@@ -30170,20 +30098,6 @@ var FunctionPrecreateRequest = {
|
|
|
30170
30098
|
message.webhookConfig = WebhookConfig.decode(reader, reader.uint32());
|
|
30171
30099
|
continue;
|
|
30172
30100
|
}
|
|
30173
|
-
case 6: {
|
|
30174
|
-
if (tag !== 50) {
|
|
30175
|
-
break;
|
|
30176
|
-
}
|
|
30177
|
-
message.useFunctionId = reader.string();
|
|
30178
|
-
continue;
|
|
30179
|
-
}
|
|
30180
|
-
case 7: {
|
|
30181
|
-
if (tag !== 58) {
|
|
30182
|
-
break;
|
|
30183
|
-
}
|
|
30184
|
-
message.useMethodName = reader.string();
|
|
30185
|
-
continue;
|
|
30186
|
-
}
|
|
30187
30101
|
case 8: {
|
|
30188
30102
|
if (tag !== 66) {
|
|
30189
30103
|
break;
|
|
@@ -30244,8 +30158,6 @@ var FunctionPrecreateRequest = {
|
|
|
30244
30158
|
existingFunctionId: isSet5(object.existingFunctionId) ? globalThis.String(object.existingFunctionId) : "",
|
|
30245
30159
|
functionType: isSet5(object.functionType) ? function_FunctionTypeFromJSON(object.functionType) : 0,
|
|
30246
30160
|
webhookConfig: isSet5(object.webhookConfig) ? WebhookConfig.fromJSON(object.webhookConfig) : void 0,
|
|
30247
|
-
useFunctionId: isSet5(object.useFunctionId) ? globalThis.String(object.useFunctionId) : "",
|
|
30248
|
-
useMethodName: isSet5(object.useMethodName) ? globalThis.String(object.useMethodName) : "",
|
|
30249
30161
|
methodDefinitions: isObject2(object.methodDefinitions) ? Object.entries(object.methodDefinitions).reduce((acc, [key, value]) => {
|
|
30250
30162
|
acc[key] = MethodDefinition.fromJSON(value);
|
|
30251
30163
|
return acc;
|
|
@@ -30272,12 +30184,6 @@ var FunctionPrecreateRequest = {
|
|
|
30272
30184
|
if (message.webhookConfig !== void 0) {
|
|
30273
30185
|
obj.webhookConfig = WebhookConfig.toJSON(message.webhookConfig);
|
|
30274
30186
|
}
|
|
30275
|
-
if (message.useFunctionId !== "") {
|
|
30276
|
-
obj.useFunctionId = message.useFunctionId;
|
|
30277
|
-
}
|
|
30278
|
-
if (message.useMethodName !== "") {
|
|
30279
|
-
obj.useMethodName = message.useMethodName;
|
|
30280
|
-
}
|
|
30281
30187
|
if (message.methodDefinitions) {
|
|
30282
30188
|
const entries = Object.entries(message.methodDefinitions);
|
|
30283
30189
|
if (entries.length > 0) {
|
|
@@ -30308,8 +30214,6 @@ var FunctionPrecreateRequest = {
|
|
|
30308
30214
|
message.existingFunctionId = object.existingFunctionId ?? "";
|
|
30309
30215
|
message.functionType = object.functionType ?? 0;
|
|
30310
30216
|
message.webhookConfig = object.webhookConfig !== void 0 && object.webhookConfig !== null ? WebhookConfig.fromPartial(object.webhookConfig) : void 0;
|
|
30311
|
-
message.useFunctionId = object.useFunctionId ?? "";
|
|
30312
|
-
message.useMethodName = object.useMethodName ?? "";
|
|
30313
30217
|
message.methodDefinitions = Object.entries(object.methodDefinitions ?? {}).reduce((acc, [key, value]) => {
|
|
30314
30218
|
if (value !== void 0) {
|
|
30315
30219
|
acc[key] = MethodDefinition.fromPartial(value);
|
|
@@ -32053,7 +31957,8 @@ function createBaseHTTPConfig() {
|
|
|
32053
31957
|
exitGracePeriod: 0,
|
|
32054
31958
|
h2Enabled: false,
|
|
32055
31959
|
targetConcurrency: 0,
|
|
32056
|
-
unauthenticated: false
|
|
31960
|
+
unauthenticated: false,
|
|
31961
|
+
liftAndShiftConfig: void 0
|
|
32057
31962
|
};
|
|
32058
31963
|
}
|
|
32059
31964
|
var HTTPConfig = {
|
|
@@ -32079,6 +31984,9 @@ var HTTPConfig = {
|
|
|
32079
31984
|
if (message.unauthenticated !== false) {
|
|
32080
31985
|
writer.uint32(56).bool(message.unauthenticated);
|
|
32081
31986
|
}
|
|
31987
|
+
if (message.liftAndShiftConfig !== void 0) {
|
|
31988
|
+
LiftAndShiftConfig.encode(message.liftAndShiftConfig, writer.uint32(66).fork()).join();
|
|
31989
|
+
}
|
|
32082
31990
|
return writer;
|
|
32083
31991
|
},
|
|
32084
31992
|
decode(input, length) {
|
|
@@ -32137,6 +32045,13 @@ var HTTPConfig = {
|
|
|
32137
32045
|
message.unauthenticated = reader.bool();
|
|
32138
32046
|
continue;
|
|
32139
32047
|
}
|
|
32048
|
+
case 8: {
|
|
32049
|
+
if (tag !== 66) {
|
|
32050
|
+
break;
|
|
32051
|
+
}
|
|
32052
|
+
message.liftAndShiftConfig = LiftAndShiftConfig.decode(reader, reader.uint32());
|
|
32053
|
+
continue;
|
|
32054
|
+
}
|
|
32140
32055
|
}
|
|
32141
32056
|
if ((tag & 7) === 4 || tag === 0) {
|
|
32142
32057
|
break;
|
|
@@ -32153,7 +32068,8 @@ var HTTPConfig = {
|
|
|
32153
32068
|
exitGracePeriod: isSet5(object.exitGracePeriod) ? globalThis.Number(object.exitGracePeriod) : 0,
|
|
32154
32069
|
h2Enabled: isSet5(object.h2Enabled) ? globalThis.Boolean(object.h2Enabled) : false,
|
|
32155
32070
|
targetConcurrency: isSet5(object.targetConcurrency) ? globalThis.Number(object.targetConcurrency) : 0,
|
|
32156
|
-
unauthenticated: isSet5(object.unauthenticated) ? globalThis.Boolean(object.unauthenticated) : false
|
|
32071
|
+
unauthenticated: isSet5(object.unauthenticated) ? globalThis.Boolean(object.unauthenticated) : false,
|
|
32072
|
+
liftAndShiftConfig: isSet5(object.liftAndShiftConfig) ? LiftAndShiftConfig.fromJSON(object.liftAndShiftConfig) : void 0
|
|
32157
32073
|
};
|
|
32158
32074
|
},
|
|
32159
32075
|
toJSON(message) {
|
|
@@ -32179,6 +32095,9 @@ var HTTPConfig = {
|
|
|
32179
32095
|
if (message.unauthenticated !== false) {
|
|
32180
32096
|
obj.unauthenticated = message.unauthenticated;
|
|
32181
32097
|
}
|
|
32098
|
+
if (message.liftAndShiftConfig !== void 0) {
|
|
32099
|
+
obj.liftAndShiftConfig = LiftAndShiftConfig.toJSON(message.liftAndShiftConfig);
|
|
32100
|
+
}
|
|
32182
32101
|
return obj;
|
|
32183
32102
|
},
|
|
32184
32103
|
create(base) {
|
|
@@ -32193,6 +32112,7 @@ var HTTPConfig = {
|
|
|
32193
32112
|
message.h2Enabled = object.h2Enabled ?? false;
|
|
32194
32113
|
message.targetConcurrency = object.targetConcurrency ?? 0;
|
|
32195
32114
|
message.unauthenticated = object.unauthenticated ?? false;
|
|
32115
|
+
message.liftAndShiftConfig = object.liftAndShiftConfig !== void 0 && object.liftAndShiftConfig !== null ? LiftAndShiftConfig.fromPartial(object.liftAndShiftConfig) : void 0;
|
|
32196
32116
|
return message;
|
|
32197
32117
|
}
|
|
32198
32118
|
};
|
|
@@ -34968,6 +34888,43 @@ var InputInfo = {
|
|
|
34968
34888
|
return message;
|
|
34969
34889
|
}
|
|
34970
34890
|
};
|
|
34891
|
+
function createBaseLiftAndShiftConfig() {
|
|
34892
|
+
return {};
|
|
34893
|
+
}
|
|
34894
|
+
var LiftAndShiftConfig = {
|
|
34895
|
+
encode(_, writer = new BinaryWriter()) {
|
|
34896
|
+
return writer;
|
|
34897
|
+
},
|
|
34898
|
+
decode(input, length) {
|
|
34899
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
34900
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
34901
|
+
const message = createBaseLiftAndShiftConfig();
|
|
34902
|
+
while (reader.pos < end) {
|
|
34903
|
+
const tag = reader.uint32();
|
|
34904
|
+
switch (tag >>> 3) {
|
|
34905
|
+
}
|
|
34906
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
34907
|
+
break;
|
|
34908
|
+
}
|
|
34909
|
+
reader.skip(tag & 7);
|
|
34910
|
+
}
|
|
34911
|
+
return message;
|
|
34912
|
+
},
|
|
34913
|
+
fromJSON(_) {
|
|
34914
|
+
return {};
|
|
34915
|
+
},
|
|
34916
|
+
toJSON(_) {
|
|
34917
|
+
const obj = {};
|
|
34918
|
+
return obj;
|
|
34919
|
+
},
|
|
34920
|
+
create(base) {
|
|
34921
|
+
return LiftAndShiftConfig.fromPartial(base ?? {});
|
|
34922
|
+
},
|
|
34923
|
+
fromPartial(_) {
|
|
34924
|
+
const message = createBaseLiftAndShiftConfig();
|
|
34925
|
+
return message;
|
|
34926
|
+
}
|
|
34927
|
+
};
|
|
34971
34928
|
function createBaseListPagination() {
|
|
34972
34929
|
return { maxObjects: 0, createdBefore: 0 };
|
|
34973
34930
|
}
|
|
@@ -51593,7 +51550,8 @@ function createBaseTaskLogsBatch() {
|
|
|
51593
51550
|
eof: false,
|
|
51594
51551
|
ptyExecId: "",
|
|
51595
51552
|
rootFunctionId: "",
|
|
51596
|
-
ttlDays: 0
|
|
51553
|
+
ttlDays: 0,
|
|
51554
|
+
sandboxId: ""
|
|
51597
51555
|
};
|
|
51598
51556
|
}
|
|
51599
51557
|
var TaskLogsBatch = {
|
|
@@ -51631,6 +51589,9 @@ var TaskLogsBatch = {
|
|
|
51631
51589
|
if (message.ttlDays !== 0) {
|
|
51632
51590
|
writer.uint32(136).uint32(message.ttlDays);
|
|
51633
51591
|
}
|
|
51592
|
+
if (message.sandboxId !== "") {
|
|
51593
|
+
writer.uint32(146).string(message.sandboxId);
|
|
51594
|
+
}
|
|
51634
51595
|
return writer;
|
|
51635
51596
|
},
|
|
51636
51597
|
decode(input, length) {
|
|
@@ -51717,6 +51678,13 @@ var TaskLogsBatch = {
|
|
|
51717
51678
|
message.ttlDays = reader.uint32();
|
|
51718
51679
|
continue;
|
|
51719
51680
|
}
|
|
51681
|
+
case 18: {
|
|
51682
|
+
if (tag !== 146) {
|
|
51683
|
+
break;
|
|
51684
|
+
}
|
|
51685
|
+
message.sandboxId = reader.string();
|
|
51686
|
+
continue;
|
|
51687
|
+
}
|
|
51720
51688
|
}
|
|
51721
51689
|
if ((tag & 7) === 4 || tag === 0) {
|
|
51722
51690
|
break;
|
|
@@ -51737,7 +51705,8 @@ var TaskLogsBatch = {
|
|
|
51737
51705
|
eof: isSet5(object.eof) ? globalThis.Boolean(object.eof) : false,
|
|
51738
51706
|
ptyExecId: isSet5(object.ptyExecId) ? globalThis.String(object.ptyExecId) : "",
|
|
51739
51707
|
rootFunctionId: isSet5(object.rootFunctionId) ? globalThis.String(object.rootFunctionId) : "",
|
|
51740
|
-
ttlDays: isSet5(object.ttlDays) ? globalThis.Number(object.ttlDays) : 0
|
|
51708
|
+
ttlDays: isSet5(object.ttlDays) ? globalThis.Number(object.ttlDays) : 0,
|
|
51709
|
+
sandboxId: isSet5(object.sandboxId) ? globalThis.String(object.sandboxId) : ""
|
|
51741
51710
|
};
|
|
51742
51711
|
},
|
|
51743
51712
|
toJSON(message) {
|
|
@@ -51775,6 +51744,9 @@ var TaskLogsBatch = {
|
|
|
51775
51744
|
if (message.ttlDays !== 0) {
|
|
51776
51745
|
obj.ttlDays = Math.round(message.ttlDays);
|
|
51777
51746
|
}
|
|
51747
|
+
if (message.sandboxId !== "") {
|
|
51748
|
+
obj.sandboxId = message.sandboxId;
|
|
51749
|
+
}
|
|
51778
51750
|
return obj;
|
|
51779
51751
|
},
|
|
51780
51752
|
create(base) {
|
|
@@ -51793,6 +51765,7 @@ var TaskLogsBatch = {
|
|
|
51793
51765
|
message.ptyExecId = object.ptyExecId ?? "";
|
|
51794
51766
|
message.rootFunctionId = object.rootFunctionId ?? "";
|
|
51795
51767
|
message.ttlDays = object.ttlDays ?? 0;
|
|
51768
|
+
message.sandboxId = object.sandboxId ?? "";
|
|
51796
51769
|
return message;
|
|
51797
51770
|
}
|
|
51798
51771
|
};
|
|
@@ -68232,6 +68205,9 @@ var TaskCommandRouterClientImpl = class _TaskCommandRouterClientImpl {
|
|
|
68232
68205
|
async setNetworkAccess(request) {
|
|
68233
68206
|
await this.callUnary(() => this.stub.taskSetNetworkAccess(request));
|
|
68234
68207
|
}
|
|
68208
|
+
async setOutboundPolicy(request) {
|
|
68209
|
+
await this.callUnary(() => this.stub.taskSetOutboundPolicy(request));
|
|
68210
|
+
}
|
|
68235
68211
|
/**
|
|
68236
68212
|
* Reload all Volumes mounted in the task to reflect their latest committed state.
|
|
68237
68213
|
*
|
|
@@ -70290,6 +70266,19 @@ async function buildSandboxCreateRequestProto(appId, imageId, params = {}) {
|
|
|
70290
70266
|
);
|
|
70291
70267
|
}
|
|
70292
70268
|
}
|
|
70269
|
+
if (params.outboundPolicy !== void 0) {
|
|
70270
|
+
params.outboundPolicy._validate();
|
|
70271
|
+
if (params.blockNetwork) {
|
|
70272
|
+
throw new InvalidError(
|
|
70273
|
+
"outboundPolicy cannot be used when blockNetwork is enabled"
|
|
70274
|
+
);
|
|
70275
|
+
}
|
|
70276
|
+
if (params.outboundDomainAllowlist && params.outboundDomainAllowlist.length > 0) {
|
|
70277
|
+
throw new InvalidError(
|
|
70278
|
+
"outboundPolicy cannot be used with outboundDomainAllowlist"
|
|
70279
|
+
);
|
|
70280
|
+
}
|
|
70281
|
+
}
|
|
70293
70282
|
const networkAccess = buildOutboundNetworkAccess(
|
|
70294
70283
|
params.blockNetwork,
|
|
70295
70284
|
params.outboundCidrAllowlist,
|
|
@@ -70370,6 +70359,7 @@ async function buildSandboxCreateRequestProto(appId, imageId, params = {}) {
|
|
|
70370
70359
|
idleTimeoutSecs: params.idleTimeoutMs != void 0 ? params.idleTimeoutMs / 1e3 : void 0,
|
|
70371
70360
|
workdir: params.workdir ?? void 0,
|
|
70372
70361
|
networkAccess,
|
|
70362
|
+
outboundPolicy: params.outboundPolicy?._toProto(),
|
|
70373
70363
|
resources: Resources.create({
|
|
70374
70364
|
milliCpu,
|
|
70375
70365
|
milliCpuMax,
|
|
@@ -70430,7 +70420,7 @@ var SandboxService = class {
|
|
|
70430
70420
|
);
|
|
70431
70421
|
await hydrateSandboxSecrets(
|
|
70432
70422
|
this.#client,
|
|
70433
|
-
mergedSecrets,
|
|
70423
|
+
[...mergedSecrets, ...params.outboundPolicy?._secrets() ?? []],
|
|
70434
70424
|
params.cloudBucketMounts
|
|
70435
70425
|
);
|
|
70436
70426
|
const mergedParams = {
|
|
@@ -70491,7 +70481,7 @@ var SandboxService = class {
|
|
|
70491
70481
|
Object.assign(envDict, params.env ?? {});
|
|
70492
70482
|
await hydrateSandboxSecrets(
|
|
70493
70483
|
this.#client,
|
|
70494
|
-
resolvableSecrets,
|
|
70484
|
+
[...resolvableSecrets, ...params.outboundPolicy?._secrets() ?? []],
|
|
70495
70485
|
params.cloudBucketMounts
|
|
70496
70486
|
);
|
|
70497
70487
|
const mergedParams = {
|
|
@@ -71637,6 +71627,29 @@ var Sandbox2 = class _Sandbox {
|
|
|
71637
71627
|
});
|
|
71638
71628
|
await commandRouterClient.setNetworkAccess(request);
|
|
71639
71629
|
}
|
|
71630
|
+
/**
|
|
71631
|
+
* Replace the outbound policy of a running Sandbox.
|
|
71632
|
+
*
|
|
71633
|
+
* The new policy replaces all existing policy configuration on the
|
|
71634
|
+
* Sandbox; build a policy including any existing rules you want to keep.
|
|
71635
|
+
*
|
|
71636
|
+
* Only Sandboxes created with an `outboundPolicy` can be updated this
|
|
71637
|
+
* way; for Sandboxes created without one this fails, since header
|
|
71638
|
+
* replacement is only set up at creation time.
|
|
71639
|
+
*/
|
|
71640
|
+
async updateOutboundPolicy(outboundPolicy) {
|
|
71641
|
+
this.#ensureAttached();
|
|
71642
|
+
outboundPolicy._validate();
|
|
71643
|
+
const [, [taskId, commandRouterClient]] = await Promise.all([
|
|
71644
|
+
hydrateSecrets(this.#client, outboundPolicy._secrets()),
|
|
71645
|
+
this.#getCommandRouter()
|
|
71646
|
+
]);
|
|
71647
|
+
const request = TaskSetOutboundPolicyRequest.create({
|
|
71648
|
+
taskId,
|
|
71649
|
+
outboundPolicy: outboundPolicy._toProto()
|
|
71650
|
+
});
|
|
71651
|
+
await commandRouterClient.setOutboundPolicy(request);
|
|
71652
|
+
}
|
|
71640
71653
|
/**
|
|
71641
71654
|
* Reload all Volumes mounted in the Sandbox.
|
|
71642
71655
|
*
|
|
@@ -72194,7 +72207,7 @@ var AuthTokenManager = class {
|
|
|
72194
72207
|
};
|
|
72195
72208
|
|
|
72196
72209
|
// src/version.ts
|
|
72197
|
-
var SDK_VERSION = "0.10.2-dev.
|
|
72210
|
+
var SDK_VERSION = "0.10.2-dev.2";
|
|
72198
72211
|
function getSDKVersion() {
|
|
72199
72212
|
return SDK_VERSION;
|
|
72200
72213
|
}
|
|
@@ -74525,6 +74538,129 @@ var ClsInstance = class {
|
|
|
74525
74538
|
return method;
|
|
74526
74539
|
}
|
|
74527
74540
|
};
|
|
74541
|
+
|
|
74542
|
+
// src/outbound_policy.ts
|
|
74543
|
+
var DOMAIN_RE = /^(\*\.)?([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?$/;
|
|
74544
|
+
var HEADER_NAME_RE = /^[A-Za-z0-9!#$%&'*+.^_`|~-]+$/;
|
|
74545
|
+
var MAX_HEADER_REPLACEMENTS = 25;
|
|
74546
|
+
function hasInvalidHeaderValueChar(value) {
|
|
74547
|
+
for (const c of value) {
|
|
74548
|
+
const code = c.codePointAt(0);
|
|
74549
|
+
if (code < 32 && c !== " " || code === 127) {
|
|
74550
|
+
return true;
|
|
74551
|
+
}
|
|
74552
|
+
}
|
|
74553
|
+
return false;
|
|
74554
|
+
}
|
|
74555
|
+
function templateReferencesKey(template) {
|
|
74556
|
+
const isKeyStart = (c) => /[a-zA-Z_]/.test(c);
|
|
74557
|
+
let i = template.indexOf("$");
|
|
74558
|
+
while (i !== -1 && i + 1 < template.length) {
|
|
74559
|
+
const c = template[i + 1];
|
|
74560
|
+
if (c === "$") {
|
|
74561
|
+
i = template.indexOf("$", i + 2);
|
|
74562
|
+
continue;
|
|
74563
|
+
}
|
|
74564
|
+
if (isKeyStart(c)) {
|
|
74565
|
+
return true;
|
|
74566
|
+
}
|
|
74567
|
+
i = template.indexOf("$", i + 1);
|
|
74568
|
+
}
|
|
74569
|
+
return false;
|
|
74570
|
+
}
|
|
74571
|
+
var OutboundPolicy2 = class _OutboundPolicy {
|
|
74572
|
+
/** @internal */
|
|
74573
|
+
_replacements;
|
|
74574
|
+
/** @internal */
|
|
74575
|
+
constructor(_replacements = []) {
|
|
74576
|
+
this._replacements = _replacements;
|
|
74577
|
+
}
|
|
74578
|
+
/**
|
|
74579
|
+
* Return a new {@link OutboundPolicy} with an added header replacement.
|
|
74580
|
+
*
|
|
74581
|
+
* @param params.domain Domain the replacements are scoped to. Supports `*.` wildcard
|
|
74582
|
+
* prefixes (matching the apex domain and subdomains) and a bare `"*"`.
|
|
74583
|
+
* @param params.headers Header name -> header value. Values support `$KEY` templates
|
|
74584
|
+
* referencing keys in the replacement's `secret`.
|
|
74585
|
+
* @param params.secret Named {@link Secret} (e.g. from `client.secrets.fromName`) whose
|
|
74586
|
+
* keys may be referenced in the header value templates. Static replacements pass no secret.
|
|
74587
|
+
*/
|
|
74588
|
+
withHeaderReplacement(params) {
|
|
74589
|
+
const { domain, headers, secret } = params;
|
|
74590
|
+
return new _OutboundPolicy([
|
|
74591
|
+
...this._replacements,
|
|
74592
|
+
{ domain, headers: { ...headers }, secret }
|
|
74593
|
+
]);
|
|
74594
|
+
}
|
|
74595
|
+
/** Check all replacements, throwing `InvalidError` on the first violation found.
|
|
74596
|
+
* @internal
|
|
74597
|
+
*/
|
|
74598
|
+
_validate() {
|
|
74599
|
+
let total = 0;
|
|
74600
|
+
for (const replacement of this._replacements) {
|
|
74601
|
+
const { domain, headers, secret } = replacement;
|
|
74602
|
+
if (domain !== "*" && !DOMAIN_RE.test(domain)) {
|
|
74603
|
+
throw new InvalidError(`Invalid domain: ${JSON.stringify(domain)}`);
|
|
74604
|
+
}
|
|
74605
|
+
const entries = Object.entries(headers);
|
|
74606
|
+
if (entries.length === 0) {
|
|
74607
|
+
throw new InvalidError("`headers` must contain at least one header");
|
|
74608
|
+
}
|
|
74609
|
+
for (const [name, value] of entries) {
|
|
74610
|
+
if (!HEADER_NAME_RE.test(name)) {
|
|
74611
|
+
throw new InvalidError(
|
|
74612
|
+
`Invalid header name: ${JSON.stringify(name)}`
|
|
74613
|
+
);
|
|
74614
|
+
}
|
|
74615
|
+
if (hasInvalidHeaderValueChar(value)) {
|
|
74616
|
+
throw new InvalidError(
|
|
74617
|
+
`Header value for ${JSON.stringify(name)} must not contain control characters (except tab)`
|
|
74618
|
+
);
|
|
74619
|
+
}
|
|
74620
|
+
if (secret === void 0 && templateReferencesKey(value)) {
|
|
74621
|
+
throw new InvalidError(
|
|
74622
|
+
`Header value for ${JSON.stringify(name)} references a secret key, but no \`secret\` was passed`
|
|
74623
|
+
);
|
|
74624
|
+
}
|
|
74625
|
+
}
|
|
74626
|
+
if (secret !== void 0 && secretEnvDictHydrator(secret) !== void 0) {
|
|
74627
|
+
throw new InvalidError(
|
|
74628
|
+
"Outbound policies only support named secrets (e.g. `client.secrets.fromName`); ephemeral secrets (e.g. `client.secrets.fromObject`) are not yet supported"
|
|
74629
|
+
);
|
|
74630
|
+
}
|
|
74631
|
+
total += entries.length;
|
|
74632
|
+
}
|
|
74633
|
+
if (total > MAX_HEADER_REPLACEMENTS) {
|
|
74634
|
+
throw new InvalidError(
|
|
74635
|
+
`Outbound policy cannot have more than ${MAX_HEADER_REPLACEMENTS} header replacements`
|
|
74636
|
+
);
|
|
74637
|
+
}
|
|
74638
|
+
}
|
|
74639
|
+
/** Deduplicated list of secrets referenced by the policy's replacements.
|
|
74640
|
+
* @internal
|
|
74641
|
+
*/
|
|
74642
|
+
_secrets() {
|
|
74643
|
+
return [
|
|
74644
|
+
...new Set(
|
|
74645
|
+
this._replacements.map((s) => s.secret).filter((s) => s !== void 0)
|
|
74646
|
+
)
|
|
74647
|
+
];
|
|
74648
|
+
}
|
|
74649
|
+
/** Convert to the wire format. Referenced secrets must be hydrated first.
|
|
74650
|
+
* @internal
|
|
74651
|
+
*/
|
|
74652
|
+
_toProto() {
|
|
74653
|
+
return OutboundPolicy.create({
|
|
74654
|
+
headerReplacements: this._replacements.map(
|
|
74655
|
+
(replacement) => OutboundPolicy_HeaderReplacement.create({
|
|
74656
|
+
domain: replacement.domain,
|
|
74657
|
+
secretId: replacement.secret?.secretId ?? "",
|
|
74658
|
+
headers: replacement.headers
|
|
74659
|
+
})
|
|
74660
|
+
)
|
|
74661
|
+
});
|
|
74662
|
+
}
|
|
74663
|
+
};
|
|
74528
74664
|
export {
|
|
74529
74665
|
AlreadyExistsError,
|
|
74530
74666
|
App,
|
|
@@ -74551,6 +74687,7 @@ export {
|
|
|
74551
74687
|
InvalidError,
|
|
74552
74688
|
ModalClient,
|
|
74553
74689
|
NotFoundError,
|
|
74690
|
+
OutboundPolicy2 as OutboundPolicy,
|
|
74554
74691
|
Probe2 as Probe,
|
|
74555
74692
|
Proxy2 as Proxy,
|
|
74556
74693
|
ProxyService,
|