modal 0.7.1 → 0.7.3-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +51 -30
- package/dist/index.cjs +727 -91
- package/dist/index.d.cts +93 -0
- package/dist/index.d.ts +93 -0
- package/dist/index.js +727 -91
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -12682,6 +12682,125 @@ var DictEntry = {
|
|
|
12682
12682
|
return message;
|
|
12683
12683
|
}
|
|
12684
12684
|
};
|
|
12685
|
+
function createBaseDictGetByIdRequest() {
|
|
12686
|
+
return { dictId: "" };
|
|
12687
|
+
}
|
|
12688
|
+
var DictGetByIdRequest = {
|
|
12689
|
+
encode(message, writer = new BinaryWriter()) {
|
|
12690
|
+
if (message.dictId !== "") {
|
|
12691
|
+
writer.uint32(10).string(message.dictId);
|
|
12692
|
+
}
|
|
12693
|
+
return writer;
|
|
12694
|
+
},
|
|
12695
|
+
decode(input, length) {
|
|
12696
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
12697
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
12698
|
+
const message = createBaseDictGetByIdRequest();
|
|
12699
|
+
while (reader.pos < end) {
|
|
12700
|
+
const tag = reader.uint32();
|
|
12701
|
+
switch (tag >>> 3) {
|
|
12702
|
+
case 1: {
|
|
12703
|
+
if (tag !== 10) {
|
|
12704
|
+
break;
|
|
12705
|
+
}
|
|
12706
|
+
message.dictId = reader.string();
|
|
12707
|
+
continue;
|
|
12708
|
+
}
|
|
12709
|
+
}
|
|
12710
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
12711
|
+
break;
|
|
12712
|
+
}
|
|
12713
|
+
reader.skip(tag & 7);
|
|
12714
|
+
}
|
|
12715
|
+
return message;
|
|
12716
|
+
},
|
|
12717
|
+
fromJSON(object) {
|
|
12718
|
+
return { dictId: isSet4(object.dictId) ? globalThis.String(object.dictId) : "" };
|
|
12719
|
+
},
|
|
12720
|
+
toJSON(message) {
|
|
12721
|
+
const obj = {};
|
|
12722
|
+
if (message.dictId !== "") {
|
|
12723
|
+
obj.dictId = message.dictId;
|
|
12724
|
+
}
|
|
12725
|
+
return obj;
|
|
12726
|
+
},
|
|
12727
|
+
create(base) {
|
|
12728
|
+
return DictGetByIdRequest.fromPartial(base ?? {});
|
|
12729
|
+
},
|
|
12730
|
+
fromPartial(object) {
|
|
12731
|
+
const message = createBaseDictGetByIdRequest();
|
|
12732
|
+
message.dictId = object.dictId ?? "";
|
|
12733
|
+
return message;
|
|
12734
|
+
}
|
|
12735
|
+
};
|
|
12736
|
+
function createBaseDictGetByIdResponse() {
|
|
12737
|
+
return { dictId: "", metadata: void 0 };
|
|
12738
|
+
}
|
|
12739
|
+
var DictGetByIdResponse = {
|
|
12740
|
+
encode(message, writer = new BinaryWriter()) {
|
|
12741
|
+
if (message.dictId !== "") {
|
|
12742
|
+
writer.uint32(10).string(message.dictId);
|
|
12743
|
+
}
|
|
12744
|
+
if (message.metadata !== void 0) {
|
|
12745
|
+
DictMetadata.encode(message.metadata, writer.uint32(18).fork()).join();
|
|
12746
|
+
}
|
|
12747
|
+
return writer;
|
|
12748
|
+
},
|
|
12749
|
+
decode(input, length) {
|
|
12750
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
12751
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
12752
|
+
const message = createBaseDictGetByIdResponse();
|
|
12753
|
+
while (reader.pos < end) {
|
|
12754
|
+
const tag = reader.uint32();
|
|
12755
|
+
switch (tag >>> 3) {
|
|
12756
|
+
case 1: {
|
|
12757
|
+
if (tag !== 10) {
|
|
12758
|
+
break;
|
|
12759
|
+
}
|
|
12760
|
+
message.dictId = reader.string();
|
|
12761
|
+
continue;
|
|
12762
|
+
}
|
|
12763
|
+
case 2: {
|
|
12764
|
+
if (tag !== 18) {
|
|
12765
|
+
break;
|
|
12766
|
+
}
|
|
12767
|
+
message.metadata = DictMetadata.decode(reader, reader.uint32());
|
|
12768
|
+
continue;
|
|
12769
|
+
}
|
|
12770
|
+
}
|
|
12771
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
12772
|
+
break;
|
|
12773
|
+
}
|
|
12774
|
+
reader.skip(tag & 7);
|
|
12775
|
+
}
|
|
12776
|
+
return message;
|
|
12777
|
+
},
|
|
12778
|
+
fromJSON(object) {
|
|
12779
|
+
return {
|
|
12780
|
+
dictId: isSet4(object.dictId) ? globalThis.String(object.dictId) : "",
|
|
12781
|
+
metadata: isSet4(object.metadata) ? DictMetadata.fromJSON(object.metadata) : void 0
|
|
12782
|
+
};
|
|
12783
|
+
},
|
|
12784
|
+
toJSON(message) {
|
|
12785
|
+
const obj = {};
|
|
12786
|
+
if (message.dictId !== "") {
|
|
12787
|
+
obj.dictId = message.dictId;
|
|
12788
|
+
}
|
|
12789
|
+
if (message.metadata !== void 0) {
|
|
12790
|
+
obj.metadata = DictMetadata.toJSON(message.metadata);
|
|
12791
|
+
}
|
|
12792
|
+
return obj;
|
|
12793
|
+
},
|
|
12794
|
+
create(base) {
|
|
12795
|
+
return DictGetByIdResponse.fromPartial(base ?? {});
|
|
12796
|
+
},
|
|
12797
|
+
fromPartial(object) {
|
|
12798
|
+
const message = createBaseDictGetByIdResponse();
|
|
12799
|
+
message.dictId = object.dictId ?? "";
|
|
12800
|
+
message.metadata = object.metadata !== void 0 && object.metadata !== null ? DictMetadata.fromPartial(object.metadata) : void 0;
|
|
12801
|
+
return message;
|
|
12802
|
+
}
|
|
12803
|
+
};
|
|
12685
12804
|
function createBaseDictGetOrCreateRequest() {
|
|
12686
12805
|
return { deploymentName: "", environmentName: "", objectCreationType: 0, data: [] };
|
|
12687
12806
|
}
|
|
@@ -29467,6 +29586,125 @@ var QueueDeleteRequest = {
|
|
|
29467
29586
|
return message;
|
|
29468
29587
|
}
|
|
29469
29588
|
};
|
|
29589
|
+
function createBaseQueueGetByIdRequest() {
|
|
29590
|
+
return { queueId: "" };
|
|
29591
|
+
}
|
|
29592
|
+
var QueueGetByIdRequest = {
|
|
29593
|
+
encode(message, writer = new BinaryWriter()) {
|
|
29594
|
+
if (message.queueId !== "") {
|
|
29595
|
+
writer.uint32(10).string(message.queueId);
|
|
29596
|
+
}
|
|
29597
|
+
return writer;
|
|
29598
|
+
},
|
|
29599
|
+
decode(input, length) {
|
|
29600
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
29601
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
29602
|
+
const message = createBaseQueueGetByIdRequest();
|
|
29603
|
+
while (reader.pos < end) {
|
|
29604
|
+
const tag = reader.uint32();
|
|
29605
|
+
switch (tag >>> 3) {
|
|
29606
|
+
case 1: {
|
|
29607
|
+
if (tag !== 10) {
|
|
29608
|
+
break;
|
|
29609
|
+
}
|
|
29610
|
+
message.queueId = reader.string();
|
|
29611
|
+
continue;
|
|
29612
|
+
}
|
|
29613
|
+
}
|
|
29614
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
29615
|
+
break;
|
|
29616
|
+
}
|
|
29617
|
+
reader.skip(tag & 7);
|
|
29618
|
+
}
|
|
29619
|
+
return message;
|
|
29620
|
+
},
|
|
29621
|
+
fromJSON(object) {
|
|
29622
|
+
return { queueId: isSet4(object.queueId) ? globalThis.String(object.queueId) : "" };
|
|
29623
|
+
},
|
|
29624
|
+
toJSON(message) {
|
|
29625
|
+
const obj = {};
|
|
29626
|
+
if (message.queueId !== "") {
|
|
29627
|
+
obj.queueId = message.queueId;
|
|
29628
|
+
}
|
|
29629
|
+
return obj;
|
|
29630
|
+
},
|
|
29631
|
+
create(base) {
|
|
29632
|
+
return QueueGetByIdRequest.fromPartial(base ?? {});
|
|
29633
|
+
},
|
|
29634
|
+
fromPartial(object) {
|
|
29635
|
+
const message = createBaseQueueGetByIdRequest();
|
|
29636
|
+
message.queueId = object.queueId ?? "";
|
|
29637
|
+
return message;
|
|
29638
|
+
}
|
|
29639
|
+
};
|
|
29640
|
+
function createBaseQueueGetByIdResponse() {
|
|
29641
|
+
return { queueId: "", metadata: void 0 };
|
|
29642
|
+
}
|
|
29643
|
+
var QueueGetByIdResponse = {
|
|
29644
|
+
encode(message, writer = new BinaryWriter()) {
|
|
29645
|
+
if (message.queueId !== "") {
|
|
29646
|
+
writer.uint32(10).string(message.queueId);
|
|
29647
|
+
}
|
|
29648
|
+
if (message.metadata !== void 0) {
|
|
29649
|
+
QueueMetadata.encode(message.metadata, writer.uint32(18).fork()).join();
|
|
29650
|
+
}
|
|
29651
|
+
return writer;
|
|
29652
|
+
},
|
|
29653
|
+
decode(input, length) {
|
|
29654
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
29655
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
29656
|
+
const message = createBaseQueueGetByIdResponse();
|
|
29657
|
+
while (reader.pos < end) {
|
|
29658
|
+
const tag = reader.uint32();
|
|
29659
|
+
switch (tag >>> 3) {
|
|
29660
|
+
case 1: {
|
|
29661
|
+
if (tag !== 10) {
|
|
29662
|
+
break;
|
|
29663
|
+
}
|
|
29664
|
+
message.queueId = reader.string();
|
|
29665
|
+
continue;
|
|
29666
|
+
}
|
|
29667
|
+
case 2: {
|
|
29668
|
+
if (tag !== 18) {
|
|
29669
|
+
break;
|
|
29670
|
+
}
|
|
29671
|
+
message.metadata = QueueMetadata.decode(reader, reader.uint32());
|
|
29672
|
+
continue;
|
|
29673
|
+
}
|
|
29674
|
+
}
|
|
29675
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
29676
|
+
break;
|
|
29677
|
+
}
|
|
29678
|
+
reader.skip(tag & 7);
|
|
29679
|
+
}
|
|
29680
|
+
return message;
|
|
29681
|
+
},
|
|
29682
|
+
fromJSON(object) {
|
|
29683
|
+
return {
|
|
29684
|
+
queueId: isSet4(object.queueId) ? globalThis.String(object.queueId) : "",
|
|
29685
|
+
metadata: isSet4(object.metadata) ? QueueMetadata.fromJSON(object.metadata) : void 0
|
|
29686
|
+
};
|
|
29687
|
+
},
|
|
29688
|
+
toJSON(message) {
|
|
29689
|
+
const obj = {};
|
|
29690
|
+
if (message.queueId !== "") {
|
|
29691
|
+
obj.queueId = message.queueId;
|
|
29692
|
+
}
|
|
29693
|
+
if (message.metadata !== void 0) {
|
|
29694
|
+
obj.metadata = QueueMetadata.toJSON(message.metadata);
|
|
29695
|
+
}
|
|
29696
|
+
return obj;
|
|
29697
|
+
},
|
|
29698
|
+
create(base) {
|
|
29699
|
+
return QueueGetByIdResponse.fromPartial(base ?? {});
|
|
29700
|
+
},
|
|
29701
|
+
fromPartial(object) {
|
|
29702
|
+
const message = createBaseQueueGetByIdResponse();
|
|
29703
|
+
message.queueId = object.queueId ?? "";
|
|
29704
|
+
message.metadata = object.metadata !== void 0 && object.metadata !== null ? QueueMetadata.fromPartial(object.metadata) : void 0;
|
|
29705
|
+
return message;
|
|
29706
|
+
}
|
|
29707
|
+
};
|
|
29470
29708
|
function createBaseQueueGetOrCreateRequest() {
|
|
29471
29709
|
return { deploymentName: "", environmentName: "", objectCreationType: 0 };
|
|
29472
29710
|
}
|
|
@@ -31460,7 +31698,8 @@ function createBaseSandbox() {
|
|
|
31460
31698
|
idleTimeoutSecs: void 0,
|
|
31461
31699
|
directSandboxCommandsEnabled: false,
|
|
31462
31700
|
RestoreInstanceType: "",
|
|
31463
|
-
customDomain: ""
|
|
31701
|
+
customDomain: "",
|
|
31702
|
+
includeOidcIdentityToken: false
|
|
31464
31703
|
};
|
|
31465
31704
|
}
|
|
31466
31705
|
var Sandbox = {
|
|
@@ -31567,6 +31806,9 @@ var Sandbox = {
|
|
|
31567
31806
|
if (message.customDomain !== "") {
|
|
31568
31807
|
writer.uint32(290).string(message.customDomain);
|
|
31569
31808
|
}
|
|
31809
|
+
if (message.includeOidcIdentityToken !== false) {
|
|
31810
|
+
writer.uint32(296).bool(message.includeOidcIdentityToken);
|
|
31811
|
+
}
|
|
31570
31812
|
return writer;
|
|
31571
31813
|
},
|
|
31572
31814
|
decode(input, length) {
|
|
@@ -31817,6 +32059,13 @@ var Sandbox = {
|
|
|
31817
32059
|
message.customDomain = reader.string();
|
|
31818
32060
|
continue;
|
|
31819
32061
|
}
|
|
32062
|
+
case 37: {
|
|
32063
|
+
if (tag !== 296) {
|
|
32064
|
+
break;
|
|
32065
|
+
}
|
|
32066
|
+
message.includeOidcIdentityToken = reader.bool();
|
|
32067
|
+
continue;
|
|
32068
|
+
}
|
|
31820
32069
|
}
|
|
31821
32070
|
if ((tag & 7) === 4 || tag === 0) {
|
|
31822
32071
|
break;
|
|
@@ -31863,7 +32112,8 @@ var Sandbox = {
|
|
|
31863
32112
|
idleTimeoutSecs: isSet4(object.idleTimeoutSecs) ? globalThis.Number(object.idleTimeoutSecs) : void 0,
|
|
31864
32113
|
directSandboxCommandsEnabled: isSet4(object.directSandboxCommandsEnabled) ? globalThis.Boolean(object.directSandboxCommandsEnabled) : false,
|
|
31865
32114
|
RestoreInstanceType: isSet4(object.RestoreInstanceType) ? globalThis.String(object.RestoreInstanceType) : "",
|
|
31866
|
-
customDomain: isSet4(object.customDomain) ? globalThis.String(object.customDomain) : ""
|
|
32115
|
+
customDomain: isSet4(object.customDomain) ? globalThis.String(object.customDomain) : "",
|
|
32116
|
+
includeOidcIdentityToken: isSet4(object.includeOidcIdentityToken) ? globalThis.Boolean(object.includeOidcIdentityToken) : false
|
|
31867
32117
|
};
|
|
31868
32118
|
},
|
|
31869
32119
|
toJSON(message) {
|
|
@@ -31976,6 +32226,9 @@ var Sandbox = {
|
|
|
31976
32226
|
if (message.customDomain !== "") {
|
|
31977
32227
|
obj.customDomain = message.customDomain;
|
|
31978
32228
|
}
|
|
32229
|
+
if (message.includeOidcIdentityToken !== false) {
|
|
32230
|
+
obj.includeOidcIdentityToken = message.includeOidcIdentityToken;
|
|
32231
|
+
}
|
|
31979
32232
|
return obj;
|
|
31980
32233
|
},
|
|
31981
32234
|
create(base) {
|
|
@@ -32025,6 +32278,7 @@ var Sandbox = {
|
|
|
32025
32278
|
message.directSandboxCommandsEnabled = object.directSandboxCommandsEnabled ?? false;
|
|
32026
32279
|
message.RestoreInstanceType = object.RestoreInstanceType ?? "";
|
|
32027
32280
|
message.customDomain = object.customDomain ?? "";
|
|
32281
|
+
message.includeOidcIdentityToken = object.includeOidcIdentityToken ?? false;
|
|
32028
32282
|
return message;
|
|
32029
32283
|
}
|
|
32030
32284
|
};
|
|
@@ -35911,6 +36165,142 @@ var SecretMetadata = {
|
|
|
35911
36165
|
return message;
|
|
35912
36166
|
}
|
|
35913
36167
|
};
|
|
36168
|
+
function createBaseSecretUpdateRequest() {
|
|
36169
|
+
return { secretId: "", updates: [] };
|
|
36170
|
+
}
|
|
36171
|
+
var SecretUpdateRequest = {
|
|
36172
|
+
encode(message, writer = new BinaryWriter()) {
|
|
36173
|
+
if (message.secretId !== "") {
|
|
36174
|
+
writer.uint32(10).string(message.secretId);
|
|
36175
|
+
}
|
|
36176
|
+
for (const v of message.updates) {
|
|
36177
|
+
SecretUpdateRequest_Update.encode(v, writer.uint32(18).fork()).join();
|
|
36178
|
+
}
|
|
36179
|
+
return writer;
|
|
36180
|
+
},
|
|
36181
|
+
decode(input, length) {
|
|
36182
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
36183
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
36184
|
+
const message = createBaseSecretUpdateRequest();
|
|
36185
|
+
while (reader.pos < end) {
|
|
36186
|
+
const tag = reader.uint32();
|
|
36187
|
+
switch (tag >>> 3) {
|
|
36188
|
+
case 1: {
|
|
36189
|
+
if (tag !== 10) {
|
|
36190
|
+
break;
|
|
36191
|
+
}
|
|
36192
|
+
message.secretId = reader.string();
|
|
36193
|
+
continue;
|
|
36194
|
+
}
|
|
36195
|
+
case 2: {
|
|
36196
|
+
if (tag !== 18) {
|
|
36197
|
+
break;
|
|
36198
|
+
}
|
|
36199
|
+
message.updates.push(SecretUpdateRequest_Update.decode(reader, reader.uint32()));
|
|
36200
|
+
continue;
|
|
36201
|
+
}
|
|
36202
|
+
}
|
|
36203
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
36204
|
+
break;
|
|
36205
|
+
}
|
|
36206
|
+
reader.skip(tag & 7);
|
|
36207
|
+
}
|
|
36208
|
+
return message;
|
|
36209
|
+
},
|
|
36210
|
+
fromJSON(object) {
|
|
36211
|
+
return {
|
|
36212
|
+
secretId: isSet4(object.secretId) ? globalThis.String(object.secretId) : "",
|
|
36213
|
+
updates: globalThis.Array.isArray(object?.updates) ? object.updates.map((e) => SecretUpdateRequest_Update.fromJSON(e)) : []
|
|
36214
|
+
};
|
|
36215
|
+
},
|
|
36216
|
+
toJSON(message) {
|
|
36217
|
+
const obj = {};
|
|
36218
|
+
if (message.secretId !== "") {
|
|
36219
|
+
obj.secretId = message.secretId;
|
|
36220
|
+
}
|
|
36221
|
+
if (message.updates?.length) {
|
|
36222
|
+
obj.updates = message.updates.map((e) => SecretUpdateRequest_Update.toJSON(e));
|
|
36223
|
+
}
|
|
36224
|
+
return obj;
|
|
36225
|
+
},
|
|
36226
|
+
create(base) {
|
|
36227
|
+
return SecretUpdateRequest.fromPartial(base ?? {});
|
|
36228
|
+
},
|
|
36229
|
+
fromPartial(object) {
|
|
36230
|
+
const message = createBaseSecretUpdateRequest();
|
|
36231
|
+
message.secretId = object.secretId ?? "";
|
|
36232
|
+
message.updates = object.updates?.map((e) => SecretUpdateRequest_Update.fromPartial(e)) || [];
|
|
36233
|
+
return message;
|
|
36234
|
+
}
|
|
36235
|
+
};
|
|
36236
|
+
function createBaseSecretUpdateRequest_Update() {
|
|
36237
|
+
return { key: "", value: void 0 };
|
|
36238
|
+
}
|
|
36239
|
+
var SecretUpdateRequest_Update = {
|
|
36240
|
+
encode(message, writer = new BinaryWriter()) {
|
|
36241
|
+
if (message.key !== "") {
|
|
36242
|
+
writer.uint32(10).string(message.key);
|
|
36243
|
+
}
|
|
36244
|
+
if (message.value !== void 0) {
|
|
36245
|
+
writer.uint32(18).string(message.value);
|
|
36246
|
+
}
|
|
36247
|
+
return writer;
|
|
36248
|
+
},
|
|
36249
|
+
decode(input, length) {
|
|
36250
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
36251
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
36252
|
+
const message = createBaseSecretUpdateRequest_Update();
|
|
36253
|
+
while (reader.pos < end) {
|
|
36254
|
+
const tag = reader.uint32();
|
|
36255
|
+
switch (tag >>> 3) {
|
|
36256
|
+
case 1: {
|
|
36257
|
+
if (tag !== 10) {
|
|
36258
|
+
break;
|
|
36259
|
+
}
|
|
36260
|
+
message.key = reader.string();
|
|
36261
|
+
continue;
|
|
36262
|
+
}
|
|
36263
|
+
case 2: {
|
|
36264
|
+
if (tag !== 18) {
|
|
36265
|
+
break;
|
|
36266
|
+
}
|
|
36267
|
+
message.value = reader.string();
|
|
36268
|
+
continue;
|
|
36269
|
+
}
|
|
36270
|
+
}
|
|
36271
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
36272
|
+
break;
|
|
36273
|
+
}
|
|
36274
|
+
reader.skip(tag & 7);
|
|
36275
|
+
}
|
|
36276
|
+
return message;
|
|
36277
|
+
},
|
|
36278
|
+
fromJSON(object) {
|
|
36279
|
+
return {
|
|
36280
|
+
key: isSet4(object.key) ? globalThis.String(object.key) : "",
|
|
36281
|
+
value: isSet4(object.value) ? globalThis.String(object.value) : void 0
|
|
36282
|
+
};
|
|
36283
|
+
},
|
|
36284
|
+
toJSON(message) {
|
|
36285
|
+
const obj = {};
|
|
36286
|
+
if (message.key !== "") {
|
|
36287
|
+
obj.key = message.key;
|
|
36288
|
+
}
|
|
36289
|
+
if (message.value !== void 0) {
|
|
36290
|
+
obj.value = message.value;
|
|
36291
|
+
}
|
|
36292
|
+
return obj;
|
|
36293
|
+
},
|
|
36294
|
+
create(base) {
|
|
36295
|
+
return SecretUpdateRequest_Update.fromPartial(base ?? {});
|
|
36296
|
+
},
|
|
36297
|
+
fromPartial(object) {
|
|
36298
|
+
const message = createBaseSecretUpdateRequest_Update();
|
|
36299
|
+
message.key = object.key ?? "";
|
|
36300
|
+
message.value = object.value ?? void 0;
|
|
36301
|
+
return message;
|
|
36302
|
+
}
|
|
36303
|
+
};
|
|
35914
36304
|
function createBaseServiceUserIdentity() {
|
|
35915
36305
|
return { serviceUserId: "", serviceUserName: "", createdBy: void 0 };
|
|
35916
36306
|
}
|
|
@@ -38906,7 +39296,8 @@ function createBaseTokenInfoGetResponse() {
|
|
|
38906
39296
|
userIdentity: void 0,
|
|
38907
39297
|
serviceUserIdentity: void 0,
|
|
38908
39298
|
createdAt: void 0,
|
|
38909
|
-
expiresAt: void 0
|
|
39299
|
+
expiresAt: void 0,
|
|
39300
|
+
tokenName: ""
|
|
38910
39301
|
};
|
|
38911
39302
|
}
|
|
38912
39303
|
var TokenInfoGetResponse = {
|
|
@@ -38932,6 +39323,9 @@ var TokenInfoGetResponse = {
|
|
|
38932
39323
|
if (message.expiresAt !== void 0) {
|
|
38933
39324
|
Timestamp.encode(toTimestamp(message.expiresAt), writer.uint32(58).fork()).join();
|
|
38934
39325
|
}
|
|
39326
|
+
if (message.tokenName !== "") {
|
|
39327
|
+
writer.uint32(66).string(message.tokenName);
|
|
39328
|
+
}
|
|
38935
39329
|
return writer;
|
|
38936
39330
|
},
|
|
38937
39331
|
decode(input, length) {
|
|
@@ -38990,6 +39384,13 @@ var TokenInfoGetResponse = {
|
|
|
38990
39384
|
message.expiresAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
38991
39385
|
continue;
|
|
38992
39386
|
}
|
|
39387
|
+
case 8: {
|
|
39388
|
+
if (tag !== 66) {
|
|
39389
|
+
break;
|
|
39390
|
+
}
|
|
39391
|
+
message.tokenName = reader.string();
|
|
39392
|
+
continue;
|
|
39393
|
+
}
|
|
38993
39394
|
}
|
|
38994
39395
|
if ((tag & 7) === 4 || tag === 0) {
|
|
38995
39396
|
break;
|
|
@@ -39006,7 +39407,8 @@ var TokenInfoGetResponse = {
|
|
|
39006
39407
|
userIdentity: isSet4(object.userIdentity) ? UserIdentity.fromJSON(object.userIdentity) : void 0,
|
|
39007
39408
|
serviceUserIdentity: isSet4(object.serviceUserIdentity) ? ServiceUserIdentity.fromJSON(object.serviceUserIdentity) : void 0,
|
|
39008
39409
|
createdAt: isSet4(object.createdAt) ? fromJsonTimestamp(object.createdAt) : void 0,
|
|
39009
|
-
expiresAt: isSet4(object.expiresAt) ? fromJsonTimestamp(object.expiresAt) : void 0
|
|
39410
|
+
expiresAt: isSet4(object.expiresAt) ? fromJsonTimestamp(object.expiresAt) : void 0,
|
|
39411
|
+
tokenName: isSet4(object.tokenName) ? globalThis.String(object.tokenName) : ""
|
|
39010
39412
|
};
|
|
39011
39413
|
},
|
|
39012
39414
|
toJSON(message) {
|
|
@@ -39032,6 +39434,9 @@ var TokenInfoGetResponse = {
|
|
|
39032
39434
|
if (message.expiresAt !== void 0) {
|
|
39033
39435
|
obj.expiresAt = message.expiresAt.toISOString();
|
|
39034
39436
|
}
|
|
39437
|
+
if (message.tokenName !== "") {
|
|
39438
|
+
obj.tokenName = message.tokenName;
|
|
39439
|
+
}
|
|
39035
39440
|
return obj;
|
|
39036
39441
|
},
|
|
39037
39442
|
create(base) {
|
|
@@ -39046,6 +39451,7 @@ var TokenInfoGetResponse = {
|
|
|
39046
39451
|
message.serviceUserIdentity = object.serviceUserIdentity !== void 0 && object.serviceUserIdentity !== null ? ServiceUserIdentity.fromPartial(object.serviceUserIdentity) : void 0;
|
|
39047
39452
|
message.createdAt = object.createdAt ?? void 0;
|
|
39048
39453
|
message.expiresAt = object.expiresAt ?? void 0;
|
|
39454
|
+
message.tokenName = object.tokenName ?? "";
|
|
39049
39455
|
return message;
|
|
39050
39456
|
}
|
|
39051
39457
|
};
|
|
@@ -39930,6 +40336,125 @@ var VolumeDeleteRequest = {
|
|
|
39930
40336
|
return message;
|
|
39931
40337
|
}
|
|
39932
40338
|
};
|
|
40339
|
+
function createBaseVolumeGetByIdRequest() {
|
|
40340
|
+
return { volumeId: "" };
|
|
40341
|
+
}
|
|
40342
|
+
var VolumeGetByIdRequest = {
|
|
40343
|
+
encode(message, writer = new BinaryWriter()) {
|
|
40344
|
+
if (message.volumeId !== "") {
|
|
40345
|
+
writer.uint32(10).string(message.volumeId);
|
|
40346
|
+
}
|
|
40347
|
+
return writer;
|
|
40348
|
+
},
|
|
40349
|
+
decode(input, length) {
|
|
40350
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
40351
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
40352
|
+
const message = createBaseVolumeGetByIdRequest();
|
|
40353
|
+
while (reader.pos < end) {
|
|
40354
|
+
const tag = reader.uint32();
|
|
40355
|
+
switch (tag >>> 3) {
|
|
40356
|
+
case 1: {
|
|
40357
|
+
if (tag !== 10) {
|
|
40358
|
+
break;
|
|
40359
|
+
}
|
|
40360
|
+
message.volumeId = reader.string();
|
|
40361
|
+
continue;
|
|
40362
|
+
}
|
|
40363
|
+
}
|
|
40364
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
40365
|
+
break;
|
|
40366
|
+
}
|
|
40367
|
+
reader.skip(tag & 7);
|
|
40368
|
+
}
|
|
40369
|
+
return message;
|
|
40370
|
+
},
|
|
40371
|
+
fromJSON(object) {
|
|
40372
|
+
return { volumeId: isSet4(object.volumeId) ? globalThis.String(object.volumeId) : "" };
|
|
40373
|
+
},
|
|
40374
|
+
toJSON(message) {
|
|
40375
|
+
const obj = {};
|
|
40376
|
+
if (message.volumeId !== "") {
|
|
40377
|
+
obj.volumeId = message.volumeId;
|
|
40378
|
+
}
|
|
40379
|
+
return obj;
|
|
40380
|
+
},
|
|
40381
|
+
create(base) {
|
|
40382
|
+
return VolumeGetByIdRequest.fromPartial(base ?? {});
|
|
40383
|
+
},
|
|
40384
|
+
fromPartial(object) {
|
|
40385
|
+
const message = createBaseVolumeGetByIdRequest();
|
|
40386
|
+
message.volumeId = object.volumeId ?? "";
|
|
40387
|
+
return message;
|
|
40388
|
+
}
|
|
40389
|
+
};
|
|
40390
|
+
function createBaseVolumeGetByIdResponse() {
|
|
40391
|
+
return { volumeId: "", metadata: void 0 };
|
|
40392
|
+
}
|
|
40393
|
+
var VolumeGetByIdResponse = {
|
|
40394
|
+
encode(message, writer = new BinaryWriter()) {
|
|
40395
|
+
if (message.volumeId !== "") {
|
|
40396
|
+
writer.uint32(10).string(message.volumeId);
|
|
40397
|
+
}
|
|
40398
|
+
if (message.metadata !== void 0) {
|
|
40399
|
+
VolumeMetadata.encode(message.metadata, writer.uint32(18).fork()).join();
|
|
40400
|
+
}
|
|
40401
|
+
return writer;
|
|
40402
|
+
},
|
|
40403
|
+
decode(input, length) {
|
|
40404
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
40405
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
40406
|
+
const message = createBaseVolumeGetByIdResponse();
|
|
40407
|
+
while (reader.pos < end) {
|
|
40408
|
+
const tag = reader.uint32();
|
|
40409
|
+
switch (tag >>> 3) {
|
|
40410
|
+
case 1: {
|
|
40411
|
+
if (tag !== 10) {
|
|
40412
|
+
break;
|
|
40413
|
+
}
|
|
40414
|
+
message.volumeId = reader.string();
|
|
40415
|
+
continue;
|
|
40416
|
+
}
|
|
40417
|
+
case 2: {
|
|
40418
|
+
if (tag !== 18) {
|
|
40419
|
+
break;
|
|
40420
|
+
}
|
|
40421
|
+
message.metadata = VolumeMetadata.decode(reader, reader.uint32());
|
|
40422
|
+
continue;
|
|
40423
|
+
}
|
|
40424
|
+
}
|
|
40425
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
40426
|
+
break;
|
|
40427
|
+
}
|
|
40428
|
+
reader.skip(tag & 7);
|
|
40429
|
+
}
|
|
40430
|
+
return message;
|
|
40431
|
+
},
|
|
40432
|
+
fromJSON(object) {
|
|
40433
|
+
return {
|
|
40434
|
+
volumeId: isSet4(object.volumeId) ? globalThis.String(object.volumeId) : "",
|
|
40435
|
+
metadata: isSet4(object.metadata) ? VolumeMetadata.fromJSON(object.metadata) : void 0
|
|
40436
|
+
};
|
|
40437
|
+
},
|
|
40438
|
+
toJSON(message) {
|
|
40439
|
+
const obj = {};
|
|
40440
|
+
if (message.volumeId !== "") {
|
|
40441
|
+
obj.volumeId = message.volumeId;
|
|
40442
|
+
}
|
|
40443
|
+
if (message.metadata !== void 0) {
|
|
40444
|
+
obj.metadata = VolumeMetadata.toJSON(message.metadata);
|
|
40445
|
+
}
|
|
40446
|
+
return obj;
|
|
40447
|
+
},
|
|
40448
|
+
create(base) {
|
|
40449
|
+
return VolumeGetByIdResponse.fromPartial(base ?? {});
|
|
40450
|
+
},
|
|
40451
|
+
fromPartial(object) {
|
|
40452
|
+
const message = createBaseVolumeGetByIdResponse();
|
|
40453
|
+
message.volumeId = object.volumeId ?? "";
|
|
40454
|
+
message.metadata = object.metadata !== void 0 && object.metadata !== null ? VolumeMetadata.fromPartial(object.metadata) : void 0;
|
|
40455
|
+
return message;
|
|
40456
|
+
}
|
|
40457
|
+
};
|
|
39933
40458
|
function createBaseVolumeGetFile2Request() {
|
|
39934
40459
|
return { volumeId: "", path: "", start: 0, len: 0 };
|
|
39935
40460
|
}
|
|
@@ -42715,6 +43240,108 @@ var WorkspaceBillingReportRequest = {
|
|
|
42715
43240
|
return message;
|
|
42716
43241
|
}
|
|
42717
43242
|
};
|
|
43243
|
+
function createBaseWorkspaceDashboardUrlRequest() {
|
|
43244
|
+
return { environmentName: "" };
|
|
43245
|
+
}
|
|
43246
|
+
var WorkspaceDashboardUrlRequest = {
|
|
43247
|
+
encode(message, writer = new BinaryWriter()) {
|
|
43248
|
+
if (message.environmentName !== "") {
|
|
43249
|
+
writer.uint32(10).string(message.environmentName);
|
|
43250
|
+
}
|
|
43251
|
+
return writer;
|
|
43252
|
+
},
|
|
43253
|
+
decode(input, length) {
|
|
43254
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
43255
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
43256
|
+
const message = createBaseWorkspaceDashboardUrlRequest();
|
|
43257
|
+
while (reader.pos < end) {
|
|
43258
|
+
const tag = reader.uint32();
|
|
43259
|
+
switch (tag >>> 3) {
|
|
43260
|
+
case 1: {
|
|
43261
|
+
if (tag !== 10) {
|
|
43262
|
+
break;
|
|
43263
|
+
}
|
|
43264
|
+
message.environmentName = reader.string();
|
|
43265
|
+
continue;
|
|
43266
|
+
}
|
|
43267
|
+
}
|
|
43268
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
43269
|
+
break;
|
|
43270
|
+
}
|
|
43271
|
+
reader.skip(tag & 7);
|
|
43272
|
+
}
|
|
43273
|
+
return message;
|
|
43274
|
+
},
|
|
43275
|
+
fromJSON(object) {
|
|
43276
|
+
return { environmentName: isSet4(object.environmentName) ? globalThis.String(object.environmentName) : "" };
|
|
43277
|
+
},
|
|
43278
|
+
toJSON(message) {
|
|
43279
|
+
const obj = {};
|
|
43280
|
+
if (message.environmentName !== "") {
|
|
43281
|
+
obj.environmentName = message.environmentName;
|
|
43282
|
+
}
|
|
43283
|
+
return obj;
|
|
43284
|
+
},
|
|
43285
|
+
create(base) {
|
|
43286
|
+
return WorkspaceDashboardUrlRequest.fromPartial(base ?? {});
|
|
43287
|
+
},
|
|
43288
|
+
fromPartial(object) {
|
|
43289
|
+
const message = createBaseWorkspaceDashboardUrlRequest();
|
|
43290
|
+
message.environmentName = object.environmentName ?? "";
|
|
43291
|
+
return message;
|
|
43292
|
+
}
|
|
43293
|
+
};
|
|
43294
|
+
function createBaseWorkspaceDashboardUrlResponse() {
|
|
43295
|
+
return { url: "" };
|
|
43296
|
+
}
|
|
43297
|
+
var WorkspaceDashboardUrlResponse = {
|
|
43298
|
+
encode(message, writer = new BinaryWriter()) {
|
|
43299
|
+
if (message.url !== "") {
|
|
43300
|
+
writer.uint32(10).string(message.url);
|
|
43301
|
+
}
|
|
43302
|
+
return writer;
|
|
43303
|
+
},
|
|
43304
|
+
decode(input, length) {
|
|
43305
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
43306
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
43307
|
+
const message = createBaseWorkspaceDashboardUrlResponse();
|
|
43308
|
+
while (reader.pos < end) {
|
|
43309
|
+
const tag = reader.uint32();
|
|
43310
|
+
switch (tag >>> 3) {
|
|
43311
|
+
case 1: {
|
|
43312
|
+
if (tag !== 10) {
|
|
43313
|
+
break;
|
|
43314
|
+
}
|
|
43315
|
+
message.url = reader.string();
|
|
43316
|
+
continue;
|
|
43317
|
+
}
|
|
43318
|
+
}
|
|
43319
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
43320
|
+
break;
|
|
43321
|
+
}
|
|
43322
|
+
reader.skip(tag & 7);
|
|
43323
|
+
}
|
|
43324
|
+
return message;
|
|
43325
|
+
},
|
|
43326
|
+
fromJSON(object) {
|
|
43327
|
+
return { url: isSet4(object.url) ? globalThis.String(object.url) : "" };
|
|
43328
|
+
},
|
|
43329
|
+
toJSON(message) {
|
|
43330
|
+
const obj = {};
|
|
43331
|
+
if (message.url !== "") {
|
|
43332
|
+
obj.url = message.url;
|
|
43333
|
+
}
|
|
43334
|
+
return obj;
|
|
43335
|
+
},
|
|
43336
|
+
create(base) {
|
|
43337
|
+
return WorkspaceDashboardUrlResponse.fromPartial(base ?? {});
|
|
43338
|
+
},
|
|
43339
|
+
fromPartial(object) {
|
|
43340
|
+
const message = createBaseWorkspaceDashboardUrlResponse();
|
|
43341
|
+
message.url = object.url ?? "";
|
|
43342
|
+
return message;
|
|
43343
|
+
}
|
|
43344
|
+
};
|
|
42718
43345
|
function createBaseWorkspaceNameLookupResponse() {
|
|
42719
43346
|
return { workspaceName: "", username: "" };
|
|
42720
43347
|
}
|
|
@@ -43164,6 +43791,14 @@ var ModalClientDefinition = {
|
|
|
43164
43791
|
responseStream: false,
|
|
43165
43792
|
options: {}
|
|
43166
43793
|
},
|
|
43794
|
+
dictGetById: {
|
|
43795
|
+
name: "DictGetById",
|
|
43796
|
+
requestType: DictGetByIdRequest,
|
|
43797
|
+
requestStream: false,
|
|
43798
|
+
responseType: DictGetByIdResponse,
|
|
43799
|
+
responseStream: false,
|
|
43800
|
+
options: {}
|
|
43801
|
+
},
|
|
43167
43802
|
dictGetOrCreate: {
|
|
43168
43803
|
name: "DictGetOrCreate",
|
|
43169
43804
|
requestType: DictGetOrCreateRequest,
|
|
@@ -43674,6 +44309,14 @@ var ModalClientDefinition = {
|
|
|
43674
44309
|
responseStream: false,
|
|
43675
44310
|
options: {}
|
|
43676
44311
|
},
|
|
44312
|
+
queueGetById: {
|
|
44313
|
+
name: "QueueGetById",
|
|
44314
|
+
requestType: QueueGetByIdRequest,
|
|
44315
|
+
requestStream: false,
|
|
44316
|
+
responseType: QueueGetByIdResponse,
|
|
44317
|
+
responseStream: false,
|
|
44318
|
+
options: {}
|
|
44319
|
+
},
|
|
43677
44320
|
queueGetOrCreate: {
|
|
43678
44321
|
name: "QueueGetOrCreate",
|
|
43679
44322
|
requestType: QueueGetOrCreateRequest,
|
|
@@ -43909,6 +44552,14 @@ var ModalClientDefinition = {
|
|
|
43909
44552
|
responseStream: false,
|
|
43910
44553
|
options: {}
|
|
43911
44554
|
},
|
|
44555
|
+
secretUpdate: {
|
|
44556
|
+
name: "SecretUpdate",
|
|
44557
|
+
requestType: SecretUpdateRequest,
|
|
44558
|
+
requestStream: false,
|
|
44559
|
+
responseType: Empty,
|
|
44560
|
+
responseStream: false,
|
|
44561
|
+
options: {}
|
|
44562
|
+
},
|
|
43912
44563
|
/** SharedVolumes */
|
|
43913
44564
|
sharedVolumeDelete: {
|
|
43914
44565
|
name: "SharedVolumeDelete",
|
|
@@ -44098,6 +44749,14 @@ var ModalClientDefinition = {
|
|
|
44098
44749
|
responseStream: false,
|
|
44099
44750
|
options: {}
|
|
44100
44751
|
},
|
|
44752
|
+
volumeGetById: {
|
|
44753
|
+
name: "VolumeGetById",
|
|
44754
|
+
requestType: VolumeGetByIdRequest,
|
|
44755
|
+
requestStream: false,
|
|
44756
|
+
responseType: VolumeGetByIdResponse,
|
|
44757
|
+
responseStream: false,
|
|
44758
|
+
options: {}
|
|
44759
|
+
},
|
|
44101
44760
|
volumeGetFile: {
|
|
44102
44761
|
name: "VolumeGetFile",
|
|
44103
44762
|
requestType: VolumeGetFileRequest,
|
|
@@ -44211,6 +44870,14 @@ var ModalClientDefinition = {
|
|
|
44211
44870
|
responseStream: true,
|
|
44212
44871
|
options: {}
|
|
44213
44872
|
},
|
|
44873
|
+
workspaceDashboardUrlGet: {
|
|
44874
|
+
name: "WorkspaceDashboardUrlGet",
|
|
44875
|
+
requestType: WorkspaceDashboardUrlRequest,
|
|
44876
|
+
requestStream: false,
|
|
44877
|
+
responseType: WorkspaceDashboardUrlResponse,
|
|
44878
|
+
responseStream: false,
|
|
44879
|
+
options: {}
|
|
44880
|
+
},
|
|
44214
44881
|
workspaceNameLookup: {
|
|
44215
44882
|
name: "WorkspaceNameLookup",
|
|
44216
44883
|
requestType: Empty,
|
|
@@ -48940,24 +49607,33 @@ var Sandbox2 = class _Sandbox {
|
|
|
48940
49607
|
throw new ClientClosedError();
|
|
48941
49608
|
}
|
|
48942
49609
|
}
|
|
49610
|
+
static #maxGetTaskIdAttempts = 600;
|
|
49611
|
+
// 5 minutes at 500ms intervals
|
|
48943
49612
|
async #getTaskId() {
|
|
48944
|
-
if (this.#taskId
|
|
49613
|
+
if (this.#taskId !== void 0) {
|
|
49614
|
+
return this.#taskId;
|
|
49615
|
+
}
|
|
49616
|
+
for (let i = 0; i < _Sandbox.#maxGetTaskIdAttempts; i++) {
|
|
48945
49617
|
const resp = await this.#client.cpClient.sandboxGetTaskId({
|
|
48946
49618
|
sandboxId: this.sandboxId
|
|
48947
49619
|
});
|
|
48948
|
-
if (!resp.taskId) {
|
|
48949
|
-
throw new Error(
|
|
48950
|
-
`Sandbox ${this.sandboxId} does not have a task ID. It may not be running.`
|
|
48951
|
-
);
|
|
48952
|
-
}
|
|
48953
49620
|
if (resp.taskResult) {
|
|
49621
|
+
if (resp.taskResult.status === 1 /* GENERIC_STATUS_SUCCESS */ || !resp.taskResult.exception) {
|
|
49622
|
+
throw new Error(`Sandbox ${this.sandboxId} has already completed`);
|
|
49623
|
+
}
|
|
48954
49624
|
throw new Error(
|
|
48955
|
-
`Sandbox ${this.sandboxId} has already completed with result: ${resp.taskResult}`
|
|
49625
|
+
`Sandbox ${this.sandboxId} has already completed with result: exception:"${resp.taskResult.exception}"`
|
|
48956
49626
|
);
|
|
48957
49627
|
}
|
|
48958
|
-
|
|
49628
|
+
if (resp.taskId) {
|
|
49629
|
+
this.#taskId = resp.taskId;
|
|
49630
|
+
return this.#taskId;
|
|
49631
|
+
}
|
|
49632
|
+
await (0, import_promises2.setTimeout)(500);
|
|
48959
49633
|
}
|
|
48960
|
-
|
|
49634
|
+
throw new Error(
|
|
49635
|
+
`Timed out waiting for task ID for Sandbox ${this.sandboxId}`
|
|
49636
|
+
);
|
|
48961
49637
|
}
|
|
48962
49638
|
async #getOrCreateCommandRouterClient(taskId) {
|
|
48963
49639
|
if (this.#commandRouterClient !== void 0) {
|
|
@@ -49270,6 +49946,9 @@ async function* outputStreamSb(cpClient, sandboxId, fileDescriptor, signal) {
|
|
|
49270
49946
|
completed = true;
|
|
49271
49947
|
break;
|
|
49272
49948
|
}
|
|
49949
|
+
if (signal?.aborted) {
|
|
49950
|
+
return;
|
|
49951
|
+
}
|
|
49273
49952
|
}
|
|
49274
49953
|
} catch (err) {
|
|
49275
49954
|
if (signal?.aborted) {
|
|
@@ -49480,28 +50159,47 @@ var AuthTokenManager = class {
|
|
|
49480
50159
|
logger;
|
|
49481
50160
|
currentToken = "";
|
|
49482
50161
|
tokenExpiry = 0;
|
|
49483
|
-
|
|
49484
|
-
running = false;
|
|
49485
|
-
fetchPromise = null;
|
|
50162
|
+
refreshPromise = null;
|
|
49486
50163
|
constructor(client2, logger) {
|
|
49487
50164
|
this.client = client2;
|
|
49488
50165
|
this.logger = logger;
|
|
49489
50166
|
}
|
|
49490
50167
|
/**
|
|
49491
50168
|
* Returns a valid auth token.
|
|
49492
|
-
* If the current token is expired and the manager is running, triggers an on-demand refresh.
|
|
49493
50169
|
*/
|
|
49494
50170
|
async getToken() {
|
|
49495
|
-
if (this.currentToken
|
|
49496
|
-
return this.
|
|
50171
|
+
if (!this.currentToken || this.isExpired()) {
|
|
50172
|
+
return this.lockedRefreshToken();
|
|
49497
50173
|
}
|
|
49498
|
-
if (this.
|
|
49499
|
-
|
|
49500
|
-
|
|
49501
|
-
|
|
50174
|
+
if (this.needsRefresh() && !this.refreshPromise) {
|
|
50175
|
+
try {
|
|
50176
|
+
await this.lockedRefreshToken();
|
|
50177
|
+
} catch (error) {
|
|
50178
|
+
this.logger.error("refreshing auth token", "error", error);
|
|
49502
50179
|
}
|
|
49503
50180
|
}
|
|
49504
|
-
|
|
50181
|
+
return this.currentToken;
|
|
50182
|
+
}
|
|
50183
|
+
/**
|
|
50184
|
+
* Ensures only one fetch is in progress at a time. Concurrent callers
|
|
50185
|
+
* await the same promise. Includes a double-check so that if another
|
|
50186
|
+
* caller already refreshed, we skip the RPC.
|
|
50187
|
+
*/
|
|
50188
|
+
async lockedRefreshToken() {
|
|
50189
|
+
if (!this.refreshPromise) {
|
|
50190
|
+
this.refreshPromise = (async () => {
|
|
50191
|
+
try {
|
|
50192
|
+
if (this.currentToken && !this.needsRefresh()) {
|
|
50193
|
+
return;
|
|
50194
|
+
}
|
|
50195
|
+
await this.fetchToken();
|
|
50196
|
+
} finally {
|
|
50197
|
+
this.refreshPromise = null;
|
|
50198
|
+
}
|
|
50199
|
+
})();
|
|
50200
|
+
}
|
|
50201
|
+
await this.refreshPromise;
|
|
50202
|
+
return this.currentToken;
|
|
49505
50203
|
}
|
|
49506
50204
|
/**
|
|
49507
50205
|
* Fetches a new auth token from the server and stores it.
|
|
@@ -49533,56 +50231,6 @@ var AuthTokenManager = class {
|
|
|
49533
50231
|
`${refreshIn}s`
|
|
49534
50232
|
);
|
|
49535
50233
|
}
|
|
49536
|
-
/**
|
|
49537
|
-
* Background loop that refreshes tokens REFRESH_WINDOW seconds before they expire.
|
|
49538
|
-
*/
|
|
49539
|
-
async backgroundRefresh() {
|
|
49540
|
-
while (this.running) {
|
|
49541
|
-
const now = Math.floor(Date.now() / 1e3);
|
|
49542
|
-
const refreshTime = this.tokenExpiry - REFRESH_WINDOW;
|
|
49543
|
-
const delay = Math.max(0, refreshTime - now) * 1e3;
|
|
49544
|
-
await new Promise((resolve) => {
|
|
49545
|
-
this.timeoutId = setTimeout(resolve, delay);
|
|
49546
|
-
this.timeoutId.unref();
|
|
49547
|
-
});
|
|
49548
|
-
if (!this.running) {
|
|
49549
|
-
return;
|
|
49550
|
-
}
|
|
49551
|
-
try {
|
|
49552
|
-
await this.runFetch();
|
|
49553
|
-
} catch (error) {
|
|
49554
|
-
this.logger.error("Failed to refresh auth token", "error", error);
|
|
49555
|
-
await new Promise((resolve) => setTimeout(resolve, 5e3));
|
|
49556
|
-
}
|
|
49557
|
-
}
|
|
49558
|
-
}
|
|
49559
|
-
/**
|
|
49560
|
-
* Fetches the initial token and starts the refresh loop.
|
|
49561
|
-
* Throws an error if the initial token fetch fails.
|
|
49562
|
-
*/
|
|
49563
|
-
async start() {
|
|
49564
|
-
if (this.running) {
|
|
49565
|
-
return;
|
|
49566
|
-
}
|
|
49567
|
-
this.running = true;
|
|
49568
|
-
try {
|
|
49569
|
-
await this.runFetch();
|
|
49570
|
-
} catch (error) {
|
|
49571
|
-
this.running = false;
|
|
49572
|
-
throw error;
|
|
49573
|
-
}
|
|
49574
|
-
this.backgroundRefresh();
|
|
49575
|
-
}
|
|
49576
|
-
/**
|
|
49577
|
-
* Stops the background refresh.
|
|
49578
|
-
*/
|
|
49579
|
-
stop() {
|
|
49580
|
-
this.running = false;
|
|
49581
|
-
if (this.timeoutId) {
|
|
49582
|
-
clearTimeout(this.timeoutId);
|
|
49583
|
-
this.timeoutId = null;
|
|
49584
|
-
}
|
|
49585
|
-
}
|
|
49586
50234
|
/**
|
|
49587
50235
|
* Extracts the exp claim from a JWT token.
|
|
49588
50236
|
*/
|
|
@@ -49607,17 +50255,9 @@ var AuthTokenManager = class {
|
|
|
49607
50255
|
const now = Math.floor(Date.now() / 1e3);
|
|
49608
50256
|
return now >= this.tokenExpiry;
|
|
49609
50257
|
}
|
|
49610
|
-
|
|
49611
|
-
|
|
49612
|
-
|
|
49613
|
-
try {
|
|
49614
|
-
await this.fetchToken();
|
|
49615
|
-
} finally {
|
|
49616
|
-
this.fetchPromise = null;
|
|
49617
|
-
}
|
|
49618
|
-
})();
|
|
49619
|
-
}
|
|
49620
|
-
return this.fetchPromise;
|
|
50258
|
+
needsRefresh() {
|
|
50259
|
+
const now = Math.floor(Date.now() / 1e3);
|
|
50260
|
+
return now >= this.tokenExpiry - REFRESH_WINDOW;
|
|
49621
50261
|
}
|
|
49622
50262
|
getCurrentToken() {
|
|
49623
50263
|
return this.currentToken;
|
|
@@ -49630,7 +50270,7 @@ var AuthTokenManager = class {
|
|
|
49630
50270
|
|
|
49631
50271
|
// src/version.ts
|
|
49632
50272
|
function getSDKVersion() {
|
|
49633
|
-
return true ? "0.7.
|
|
50273
|
+
return true ? "0.7.3-dev.0" : "0.0.0";
|
|
49634
50274
|
}
|
|
49635
50275
|
|
|
49636
50276
|
// src/logger.ts
|
|
@@ -49813,10 +50453,7 @@ var ModalClient2 = class {
|
|
|
49813
50453
|
}
|
|
49814
50454
|
close() {
|
|
49815
50455
|
this.logger.debug("Closing Modal client");
|
|
49816
|
-
|
|
49817
|
-
this.authTokenManager.stop();
|
|
49818
|
-
this.authTokenManager = null;
|
|
49819
|
-
}
|
|
50456
|
+
this.authTokenManager = null;
|
|
49820
50457
|
this.logger.debug("Modal client closed");
|
|
49821
50458
|
}
|
|
49822
50459
|
version() {
|
|
@@ -49926,7 +50563,6 @@ var ModalClient2 = class {
|
|
|
49926
50563
|
this.cpClient,
|
|
49927
50564
|
this.logger
|
|
49928
50565
|
);
|
|
49929
|
-
this.authTokenManager.start();
|
|
49930
50566
|
}
|
|
49931
50567
|
return this.authTokenManager;
|
|
49932
50568
|
};
|