@milaboratories/pl-client 2.18.5 → 3.1.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/dist/_virtual/_rolldown/runtime.cjs +12 -22
- package/dist/_virtual/_rolldown/runtime.js +6 -11
- package/dist/core/PromiseTracker.cjs +2 -3
- package/dist/core/PromiseTracker.cjs.map +1 -1
- package/dist/core/PromiseTracker.d.ts.map +1 -0
- package/dist/core/PromiseTracker.js +1 -2
- package/dist/core/PromiseTracker.js.map +1 -1
- package/dist/core/StatefulPromise.cjs +1 -2
- package/dist/core/StatefulPromise.cjs.map +1 -1
- package/dist/core/StatefulPromise.js +1 -1
- package/dist/core/StatefulPromise.js.map +1 -1
- package/dist/core/abstract_stream.d.ts.map +1 -0
- package/dist/core/advisory_locks.cjs +1 -2
- package/dist/core/advisory_locks.cjs.map +1 -1
- package/dist/core/advisory_locks.js +1 -1
- package/dist/core/advisory_locks.js.map +1 -1
- package/dist/core/auth.cjs +2 -3
- package/dist/core/auth.cjs.map +1 -1
- package/dist/core/auth.d.ts.map +1 -0
- package/dist/core/auth.js +1 -2
- package/dist/core/auth.js.map +1 -1
- package/dist/core/cache.d.ts.map +1 -0
- package/dist/core/client.cjs +63 -36
- package/dist/core/client.cjs.map +1 -1
- package/dist/core/client.d.ts +3 -1
- package/dist/core/client.d.ts.map +1 -0
- package/dist/core/client.js +54 -27
- package/dist/core/client.js.map +1 -1
- package/dist/core/config.cjs +16 -17
- package/dist/core/config.cjs.map +1 -1
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +16 -16
- package/dist/core/config.js.map +1 -1
- package/dist/core/default_client.cjs +6 -7
- package/dist/core/default_client.cjs.map +1 -1
- package/dist/core/default_client.d.ts.map +1 -0
- package/dist/core/default_client.js +1 -2
- package/dist/core/default_client.js.map +1 -1
- package/dist/core/driver.cjs +1 -2
- package/dist/core/driver.cjs.map +1 -1
- package/dist/core/driver.d.ts.map +1 -0
- package/dist/core/driver.js +1 -1
- package/dist/core/error_resource.cjs +1 -2
- package/dist/core/error_resource.cjs.map +1 -1
- package/dist/core/error_resource.js +1 -1
- package/dist/core/errors.cjs +11 -4
- package/dist/core/errors.cjs.map +1 -1
- package/dist/core/errors.d.ts +2 -1
- package/dist/core/errors.d.ts.map +1 -0
- package/dist/core/errors.js +9 -3
- package/dist/core/errors.js.map +1 -1
- package/dist/core/final.cjs +3 -4
- package/dist/core/final.cjs.map +1 -1
- package/dist/core/final.d.ts.map +1 -0
- package/dist/core/final.js +1 -2
- package/dist/core/final.js.map +1 -1
- package/dist/core/ll_client.cjs +35 -18
- package/dist/core/ll_client.cjs.map +1 -1
- package/dist/core/ll_client.d.ts +6 -1
- package/dist/core/ll_client.d.ts.map +1 -0
- package/dist/core/ll_client.js +25 -8
- package/dist/core/ll_client.js.map +1 -1
- package/dist/core/ll_transaction.cjs +4 -5
- package/dist/core/ll_transaction.cjs.map +1 -1
- package/dist/core/ll_transaction.d.ts.map +1 -0
- package/dist/core/ll_transaction.js +1 -2
- package/dist/core/ll_transaction.js.map +1 -1
- package/dist/core/stat.cjs +1 -2
- package/dist/core/stat.cjs.map +1 -1
- package/dist/core/stat.d.ts.map +1 -0
- package/dist/core/stat.js +1 -1
- package/dist/core/transaction.cjs +32 -21
- package/dist/core/transaction.cjs.map +1 -1
- package/dist/core/transaction.d.ts.map +1 -0
- package/dist/core/transaction.js +23 -12
- package/dist/core/transaction.js.map +1 -1
- package/dist/core/type_conversion.cjs +8 -9
- package/dist/core/type_conversion.cjs.map +1 -1
- package/dist/core/type_conversion.js +4 -5
- package/dist/core/type_conversion.js.map +1 -1
- package/dist/core/types.cjs +3 -4
- package/dist/core/types.cjs.map +1 -1
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +2 -3
- package/dist/core/types.js.map +1 -1
- package/dist/core/unauth_client.cjs +4 -5
- package/dist/core/unauth_client.cjs.map +1 -1
- package/dist/core/unauth_client.d.ts.map +1 -0
- package/dist/core/unauth_client.js +1 -2
- package/dist/core/unauth_client.js.map +1 -1
- package/dist/core/websocket_stream.cjs +4 -5
- package/dist/core/websocket_stream.cjs.map +1 -1
- package/dist/core/websocket_stream.js +1 -2
- package/dist/core/websocket_stream.js.map +1 -1
- package/dist/core/wire.d.ts.map +1 -0
- package/dist/helpers/pl.cjs +12 -14
- package/dist/helpers/pl.cjs.map +1 -1
- package/dist/helpers/pl.d.ts.map +1 -0
- package/dist/helpers/pl.js +5 -7
- package/dist/helpers/pl.js.map +1 -1
- package/dist/helpers/poll.cjs +3 -4
- package/dist/helpers/poll.cjs.map +1 -1
- package/dist/helpers/poll.d.ts.map +1 -0
- package/dist/helpers/poll.js +1 -2
- package/dist/helpers/poll.js.map +1 -1
- package/dist/helpers/retry_strategy.cjs +1 -2
- package/dist/helpers/retry_strategy.cjs.map +1 -1
- package/dist/helpers/retry_strategy.js +1 -1
- package/dist/helpers/retry_strategy.js.map +1 -1
- package/dist/helpers/tx_helpers.cjs +3 -4
- package/dist/helpers/tx_helpers.cjs.map +1 -1
- package/dist/helpers/tx_helpers.d.ts.map +1 -0
- package/dist/helpers/tx_helpers.js +1 -2
- package/dist/helpers/tx_helpers.js.map +1 -1
- package/dist/index.cjs +34 -34
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -3
- package/dist/proto-grpc/github.com/googleapis/googleapis/google/rpc/status.cjs +3 -4
- package/dist/proto-grpc/github.com/googleapis/googleapis/google/rpc/status.cjs.map +1 -1
- package/dist/proto-grpc/github.com/googleapis/googleapis/google/rpc/status.d.ts.map +1 -0
- package/dist/proto-grpc/github.com/googleapis/googleapis/google/rpc/status.js +1 -2
- package/dist/proto-grpc/github.com/googleapis/googleapis/google/rpc/status.js.map +1 -1
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.cjs +2039 -644
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.cjs.map +1 -1
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.client.cjs +62 -13
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.client.cjs.map +1 -1
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.client.d.ts +78 -8
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.client.d.ts.map +1 -0
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.client.js +60 -11
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.client.js.map +1 -1
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.d.ts +658 -51
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.d.ts.map +1 -0
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.js +2033 -639
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.js.map +1 -1
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api_types.cjs +251 -22
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api_types.cjs.map +1 -1
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api_types.d.ts +104 -10
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api_types.d.ts.map +1 -0
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api_types.js +248 -19
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api_types.js.map +1 -1
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/base_types.cjs +28 -15
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/base_types.cjs.map +1 -1
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/base_types.d.ts +4 -0
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/base_types.d.ts.map +1 -0
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/base_types.js +27 -14
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/base_types.js.map +1 -1
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/resource_types.cjs +17 -16
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/resource_types.cjs.map +1 -1
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/resource_types.d.ts +4 -0
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/resource_types.d.ts.map +1 -0
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/resource_types.js +15 -14
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/resource_types.js.map +1 -1
- package/dist/proto-grpc/google/protobuf/any.cjs +2 -3
- package/dist/proto-grpc/google/protobuf/any.cjs.map +1 -1
- package/dist/proto-grpc/google/protobuf/any.d.ts.map +1 -0
- package/dist/proto-grpc/google/protobuf/any.js +1 -2
- package/dist/proto-grpc/google/protobuf/any.js.map +1 -1
- package/dist/proto-grpc/google/protobuf/duration.cjs +2 -3
- package/dist/proto-grpc/google/protobuf/duration.cjs.map +1 -1
- package/dist/proto-grpc/google/protobuf/duration.d.ts.map +1 -0
- package/dist/proto-grpc/google/protobuf/duration.js +1 -2
- package/dist/proto-grpc/google/protobuf/duration.js.map +1 -1
- package/dist/proto-grpc/google/protobuf/timestamp.cjs +2 -3
- package/dist/proto-grpc/google/protobuf/timestamp.cjs.map +1 -1
- package/dist/proto-grpc/google/protobuf/timestamp.d.ts.map +1 -0
- package/dist/proto-grpc/google/protobuf/timestamp.js +1 -2
- package/dist/proto-grpc/google/protobuf/timestamp.js.map +1 -1
- package/dist/proto-grpc/google/rpc/code.cjs +1 -2
- package/dist/proto-grpc/google/rpc/code.cjs.map +1 -1
- package/dist/proto-grpc/google/rpc/code.d.ts.map +1 -0
- package/dist/proto-grpc/google/rpc/code.js +1 -1
- package/dist/proto-grpc/google/rpc/code.js.map +1 -1
- package/dist/proto-rest/index.cjs +8 -9
- package/dist/proto-rest/index.cjs.map +1 -1
- package/dist/proto-rest/index.d.ts.map +1 -0
- package/dist/proto-rest/index.js +1 -2
- package/dist/proto-rest/index.js.map +1 -1
- package/dist/proto-rest/plapi.d.ts +281 -28
- package/dist/proto-rest/plapi.d.ts.map +1 -0
- package/dist/test/tcp-proxy.cjs +2 -3
- package/dist/test/tcp-proxy.cjs.map +1 -1
- package/dist/test/tcp-proxy.d.ts.map +1 -0
- package/dist/test/tcp-proxy.js +1 -2
- package/dist/test/tcp-proxy.js.map +1 -1
- package/dist/test/test_config.cjs +16 -19
- package/dist/test/test_config.cjs.map +1 -1
- package/dist/test/test_config.d.ts.map +1 -0
- package/dist/test/test_config.js +3 -6
- package/dist/test/test_config.js.map +1 -1
- package/dist/util/pl.cjs +1 -2
- package/dist/util/pl.cjs.map +1 -1
- package/dist/util/pl.js +1 -1
- package/dist/util/util.cjs +1 -2
- package/dist/util/util.cjs.map +1 -1
- package/dist/util/util.js +1 -1
- package/package.json +8 -8
- package/src/core/client.ts +80 -30
- package/src/core/errors.ts +11 -0
- package/src/core/ll_client.test.ts +8 -0
- package/src/core/ll_client.ts +30 -2
- package/src/core/ll_transaction.test.ts +12 -2
- package/src/core/transaction.ts +41 -10
- package/src/core/type_conversion.ts +1 -1
- package/src/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.client.ts +119 -15
- package/src/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.ts +2274 -322
- package/src/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api_types.ts +276 -20
- package/src/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/base_types.ts +11 -0
- package/src/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/import.ts +2 -2
- package/src/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/resource_types.ts +11 -0
- package/src/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/ws-test.ts +3 -3
- package/src/proto-grpc/google/protobuf/descriptor.ts +2 -5
- package/src/proto-grpc/google/protobuf/struct.ts +1 -1
- package/src/proto-rest/plapi.ts +293 -22
package/src/core/transaction.ts
CHANGED
|
@@ -366,6 +366,7 @@ export class PlTransaction {
|
|
|
366
366
|
id: localId,
|
|
367
367
|
data: Buffer.from(name),
|
|
368
368
|
errorIfExists,
|
|
369
|
+
colorProof: new Uint8Array(0),
|
|
369
370
|
},
|
|
370
371
|
},
|
|
371
372
|
(r) => r.resourceCreateSingleton.resourceId as ResourceId,
|
|
@@ -429,6 +430,7 @@ export class PlTransaction {
|
|
|
429
430
|
id: localId,
|
|
430
431
|
data:
|
|
431
432
|
data === undefined ? undefined : typeof data === "string" ? Buffer.from(data) : data,
|
|
433
|
+
colorProof: new Uint8Array(0),
|
|
432
434
|
},
|
|
433
435
|
}),
|
|
434
436
|
(r) => r.resourceCreateStruct.resourceId,
|
|
@@ -447,6 +449,7 @@ export class PlTransaction {
|
|
|
447
449
|
id: localId,
|
|
448
450
|
data:
|
|
449
451
|
data === undefined ? undefined : typeof data === "string" ? Buffer.from(data) : data,
|
|
452
|
+
colorProof: new Uint8Array(0),
|
|
450
453
|
},
|
|
451
454
|
}),
|
|
452
455
|
(r) => r.resourceCreateEphemeral.resourceId,
|
|
@@ -469,6 +472,7 @@ export class PlTransaction {
|
|
|
469
472
|
id: localId,
|
|
470
473
|
data: typeof data === "string" ? Buffer.from(data) : data,
|
|
471
474
|
errorIfExists,
|
|
475
|
+
colorProof: new Uint8Array(0),
|
|
472
476
|
},
|
|
473
477
|
}),
|
|
474
478
|
(r) => r.resourceCreateValue.resourceId,
|
|
@@ -518,12 +522,18 @@ export class PlTransaction {
|
|
|
518
522
|
}
|
|
519
523
|
|
|
520
524
|
public removeResource(rId: ResourceId): void {
|
|
521
|
-
this.sendVoidAsync({
|
|
525
|
+
this.sendVoidAsync({
|
|
526
|
+
oneofKind: "resourceRemove",
|
|
527
|
+
resourceRemove: { resourceId: rId },
|
|
528
|
+
});
|
|
522
529
|
}
|
|
523
530
|
|
|
524
531
|
public resourceExists(rId: ResourceId): Promise<boolean> {
|
|
525
532
|
return this.sendSingleAndParse(
|
|
526
|
-
{
|
|
533
|
+
{
|
|
534
|
+
oneofKind: "resourceExists",
|
|
535
|
+
resourceExists: { resourceId: rId },
|
|
536
|
+
},
|
|
527
537
|
(r) => r.resourceExists.exists,
|
|
528
538
|
);
|
|
529
539
|
}
|
|
@@ -581,7 +591,10 @@ export class PlTransaction {
|
|
|
581
591
|
const result = await this.sendSingleAndParse(
|
|
582
592
|
{
|
|
583
593
|
oneofKind: "resourceGet",
|
|
584
|
-
resourceGet: {
|
|
594
|
+
resourceGet: {
|
|
595
|
+
resourceId: toResourceId(rId),
|
|
596
|
+
loadFields: loadFields,
|
|
597
|
+
},
|
|
585
598
|
},
|
|
586
599
|
(r) => protoToResource(notEmpty(r.resourceGet.resource)),
|
|
587
600
|
);
|
|
@@ -665,7 +678,7 @@ export class PlTransaction {
|
|
|
665
678
|
this._stat.inputsLocked++;
|
|
666
679
|
this.sendVoidAsync({
|
|
667
680
|
oneofKind: "resourceLockInputs",
|
|
668
|
-
resourceLockInputs: { resourceId: toResourceId(rId) },
|
|
681
|
+
resourceLockInputs: { resourceId: toResourceId(rId), resourceSignature: new Uint8Array(0) },
|
|
669
682
|
});
|
|
670
683
|
}
|
|
671
684
|
|
|
@@ -677,7 +690,7 @@ export class PlTransaction {
|
|
|
677
690
|
this._stat.outputsLocked++;
|
|
678
691
|
this.sendVoidAsync({
|
|
679
692
|
oneofKind: "resourceLockOutputs",
|
|
680
|
-
resourceLockOutputs: { resourceId: toResourceId(rId) },
|
|
693
|
+
resourceLockOutputs: { resourceId: toResourceId(rId), resourceSignature: new Uint8Array(0) },
|
|
681
694
|
});
|
|
682
695
|
}
|
|
683
696
|
|
|
@@ -689,7 +702,10 @@ export class PlTransaction {
|
|
|
689
702
|
public setResourceError(rId: AnyResourceRef, ref: AnyResourceRef): void {
|
|
690
703
|
this.sendVoidAsync({
|
|
691
704
|
oneofKind: "resourceSetError",
|
|
692
|
-
resourceSetError: {
|
|
705
|
+
resourceSetError: {
|
|
706
|
+
resourceId: toResourceId(rId),
|
|
707
|
+
errorResourceId: toResourceId(ref),
|
|
708
|
+
},
|
|
693
709
|
});
|
|
694
710
|
}
|
|
695
711
|
|
|
@@ -743,7 +759,10 @@ export class PlTransaction {
|
|
|
743
759
|
this._stat.fieldsSet++;
|
|
744
760
|
this.sendVoidAsync({
|
|
745
761
|
oneofKind: "fieldSetError",
|
|
746
|
-
fieldSetError: {
|
|
762
|
+
fieldSetError: {
|
|
763
|
+
field: toFieldId(fId),
|
|
764
|
+
errorResourceId: toResourceId(ref),
|
|
765
|
+
},
|
|
747
766
|
});
|
|
748
767
|
}
|
|
749
768
|
|
|
@@ -776,7 +795,11 @@ export class PlTransaction {
|
|
|
776
795
|
const result = await this.sendMultiAndParse(
|
|
777
796
|
{
|
|
778
797
|
oneofKind: "resourceKeyValueList",
|
|
779
|
-
resourceKeyValueList: {
|
|
798
|
+
resourceKeyValueList: {
|
|
799
|
+
resourceId: toResourceId(rId),
|
|
800
|
+
startFrom: "",
|
|
801
|
+
limit: 0,
|
|
802
|
+
},
|
|
780
803
|
},
|
|
781
804
|
(r) => r.map((e) => e.resourceKeyValueList.record!),
|
|
782
805
|
);
|
|
@@ -815,6 +838,7 @@ export class PlTransaction {
|
|
|
815
838
|
oneofKind: "resourceKeyValueSet",
|
|
816
839
|
resourceKeyValueSet: {
|
|
817
840
|
resourceId: toResourceId(rId),
|
|
841
|
+
resourceSignature: new Uint8Array(0),
|
|
818
842
|
key,
|
|
819
843
|
value: toBytes(value),
|
|
820
844
|
},
|
|
@@ -826,6 +850,7 @@ export class PlTransaction {
|
|
|
826
850
|
oneofKind: "resourceKeyValueDelete",
|
|
827
851
|
resourceKeyValueDelete: {
|
|
828
852
|
resourceId: toResourceId(rId),
|
|
853
|
+
resourceSignature: new Uint8Array(0),
|
|
829
854
|
key,
|
|
830
855
|
},
|
|
831
856
|
});
|
|
@@ -836,7 +861,10 @@ export class PlTransaction {
|
|
|
836
861
|
const result = await this.sendSingleAndParse(
|
|
837
862
|
{
|
|
838
863
|
oneofKind: "resourceKeyValueGet",
|
|
839
|
-
resourceKeyValueGet: {
|
|
864
|
+
resourceKeyValueGet: {
|
|
865
|
+
resourceId: toResourceId(rId),
|
|
866
|
+
key,
|
|
867
|
+
},
|
|
840
868
|
},
|
|
841
869
|
(r) => r.resourceKeyValueGet.value,
|
|
842
870
|
);
|
|
@@ -864,7 +892,10 @@ export class PlTransaction {
|
|
|
864
892
|
const result = await this.sendSingleAndParse(
|
|
865
893
|
{
|
|
866
894
|
oneofKind: "resourceKeyValueGetIfExists",
|
|
867
|
-
resourceKeyValueGetIfExists: {
|
|
895
|
+
resourceKeyValueGetIfExists: {
|
|
896
|
+
resourceId: toResourceId(rId),
|
|
897
|
+
key,
|
|
898
|
+
},
|
|
868
899
|
},
|
|
869
900
|
(r) =>
|
|
870
901
|
r.resourceKeyValueGetIfExists.exists ? r.resourceKeyValueGetIfExists.value : undefined,
|
|
@@ -30,7 +30,7 @@ function resourceIsDeleted(proto: Resource): boolean {
|
|
|
30
30
|
export function protoToResource(proto: Resource): ResourceData {
|
|
31
31
|
if (resourceIsDeleted(proto)) throwPlNotFoundError("resource deleted");
|
|
32
32
|
return {
|
|
33
|
-
id: proto.
|
|
33
|
+
id: proto.resourceId as ResourceId,
|
|
34
34
|
originalResourceId: proto.originalResourceId as OptionalResourceId,
|
|
35
35
|
type: notEmpty(proto.type),
|
|
36
36
|
data: proto.data,
|
|
@@ -10,6 +10,15 @@ import type { MaintenanceAPI_Ping_Response } from "./api";
|
|
|
10
10
|
import type { MaintenanceAPI_Ping_Request } from "./api";
|
|
11
11
|
import type { MiscAPI_ListResourceTypes_Response } from "./api";
|
|
12
12
|
import type { MiscAPI_ListResourceTypes_Request } from "./api";
|
|
13
|
+
import type { AuthAPI_ListUserResources_Response } from "./api";
|
|
14
|
+
import type { AuthAPI_ListUserResources_Request } from "./api";
|
|
15
|
+
import type { AuthAPI_ListGrants_Response } from "./api";
|
|
16
|
+
import type { AuthAPI_ListGrants_Request } from "./api";
|
|
17
|
+
import type { ServerStreamingCall } from "@protobuf-ts/runtime-rpc";
|
|
18
|
+
import type { AuthAPI_RevokeGrant_Response } from "./api";
|
|
19
|
+
import type { AuthAPI_RevokeGrant_Request } from "./api";
|
|
20
|
+
import type { AuthAPI_GrantAccess_Response } from "./api";
|
|
21
|
+
import type { AuthAPI_GrantAccess_Request } from "./api";
|
|
13
22
|
import type { AuthAPI_GetJWTToken_Response } from "./api";
|
|
14
23
|
import type { AuthAPI_GetJWTToken_Request } from "./api";
|
|
15
24
|
import type { AuthAPI_ListMethods_Response } from "./api";
|
|
@@ -20,6 +29,8 @@ import type { LocksAPI_Lease_Update_Response } from "./api";
|
|
|
20
29
|
import type { LocksAPI_Lease_Update_Request } from "./api";
|
|
21
30
|
import type { LocksAPI_Lease_Create_Response } from "./api";
|
|
22
31
|
import type { LocksAPI_Lease_Create_Request } from "./api";
|
|
32
|
+
import type { LocksAPI_LockFieldValues_Create_Response } from "./api";
|
|
33
|
+
import type { LocksAPI_LockFieldValues_Create_Request } from "./api";
|
|
23
34
|
import type { ControllerAPI_ClearFeatures_Response } from "./api";
|
|
24
35
|
import type { ControllerAPI_ClearFeatures_Request } from "./api";
|
|
25
36
|
import type { ControllerAPI_SetFeatures_Response } from "./api";
|
|
@@ -148,10 +159,33 @@ export interface IPlatformClient {
|
|
|
148
159
|
* @generated from protobuf rpc: ControllerClearFeatures
|
|
149
160
|
*/
|
|
150
161
|
controllerClearFeatures(input: ControllerAPI_ClearFeatures_Request, options?: RpcOptions): UnaryCall<ControllerAPI_ClearFeatures_Request, ControllerAPI_ClearFeatures_Response>;
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
162
|
+
//
|
|
163
|
+
// Locks
|
|
164
|
+
//
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* LockFieldValues gets the resource and obtains a lock on all resolved values of listed fields:
|
|
168
|
+
* - get the resource that will take the lock ('FOR' resource) (lock cannot be obtained 'FOR' or 'ON' deleted resource)
|
|
169
|
+
* - list resource's fields, take fields with names set in request
|
|
170
|
+
* - get resolved values of listed fields (IDs of 'ON' resources).
|
|
171
|
+
* - acquire lock on all 'ON' resources, marking 'FOR' resource as an owner.
|
|
172
|
+
*
|
|
173
|
+
* Lock logic constraints:
|
|
174
|
+
* - Locking is optimistic: if two processes try to obtain a lock on the same resource, one of them
|
|
175
|
+
* succeeds, while the other fails with an error (no long waiting)
|
|
176
|
+
* - Only resolved reference can be locked: to obtain a lock for a particular field's value, the backend needs to know
|
|
177
|
+
* the resource ID this field points to. Unless all listed field references are resolved to a final ID, the lock will fail.
|
|
178
|
+
* - Only an original resource can be locked: if a resource is 'pure' (supports deduplication), it has to pass deduplication before
|
|
179
|
+
* being lockable. An attempt to lock a resource that has not become original will fail.
|
|
180
|
+
* - Locking is a one-way operation: it cannot be 'released' or 'revoked'.
|
|
181
|
+
*
|
|
182
|
+
* @generated from protobuf rpc: LockFieldValues
|
|
183
|
+
*/
|
|
184
|
+
lockFieldValues(input: LocksAPI_LockFieldValues_Create_Request, options?: RpcOptions): UnaryCall<LocksAPI_LockFieldValues_Create_Request, LocksAPI_LockFieldValues_Create_Response>;
|
|
185
|
+
/**
|
|
186
|
+
* LeaseResource creates a lease for a resource. A lease is a temporary lock that needs periodic renewal to stay valid.
|
|
187
|
+
* Leases are a separate mechanism from locks: leases are focused on 'clients', while locks are focused on 'resources'.
|
|
188
|
+
* To keep the lease active, the client needs the lease ID that is generated when a lease is created and used for lease updates.
|
|
155
189
|
*
|
|
156
190
|
* @generated from protobuf rpc: LeaseResource
|
|
157
191
|
*/
|
|
@@ -176,6 +210,22 @@ export interface IPlatformClient {
|
|
|
176
210
|
* @generated from protobuf rpc: GetJWTToken
|
|
177
211
|
*/
|
|
178
212
|
getJWTToken(input: AuthAPI_GetJWTToken_Request, options?: RpcOptions): UnaryCall<AuthAPI_GetJWTToken_Request, AuthAPI_GetJWTToken_Response>;
|
|
213
|
+
/**
|
|
214
|
+
* @generated from protobuf rpc: GrantAccess
|
|
215
|
+
*/
|
|
216
|
+
grantAccess(input: AuthAPI_GrantAccess_Request, options?: RpcOptions): UnaryCall<AuthAPI_GrantAccess_Request, AuthAPI_GrantAccess_Response>;
|
|
217
|
+
/**
|
|
218
|
+
* @generated from protobuf rpc: RevokeGrant
|
|
219
|
+
*/
|
|
220
|
+
revokeGrant(input: AuthAPI_RevokeGrant_Request, options?: RpcOptions): UnaryCall<AuthAPI_RevokeGrant_Request, AuthAPI_RevokeGrant_Response>;
|
|
221
|
+
/**
|
|
222
|
+
* @generated from protobuf rpc: ListGrants
|
|
223
|
+
*/
|
|
224
|
+
listGrants(input: AuthAPI_ListGrants_Request, options?: RpcOptions): ServerStreamingCall<AuthAPI_ListGrants_Request, AuthAPI_ListGrants_Response>;
|
|
225
|
+
/**
|
|
226
|
+
* @generated from protobuf rpc: ListUserResources
|
|
227
|
+
*/
|
|
228
|
+
listUserResources(input: AuthAPI_ListUserResources_Request, options?: RpcOptions): ServerStreamingCall<AuthAPI_ListUserResources_Request, AuthAPI_ListUserResources_Response>;
|
|
179
229
|
/**
|
|
180
230
|
*
|
|
181
231
|
* Other stuff
|
|
@@ -344,29 +394,55 @@ export class PlatformClient implements IPlatformClient, ServiceInfo {
|
|
|
344
394
|
const method = this.methods[17], opt = this._transport.mergeOptions(options);
|
|
345
395
|
return stackIntercept<ControllerAPI_ClearFeatures_Request, ControllerAPI_ClearFeatures_Response>("unary", this._transport, method, opt, input);
|
|
346
396
|
}
|
|
397
|
+
//
|
|
398
|
+
// Locks
|
|
399
|
+
//
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* LockFieldValues gets the resource and obtains a lock on all resolved values of listed fields:
|
|
403
|
+
* - get the resource that will take the lock ('FOR' resource) (lock cannot be obtained 'FOR' or 'ON' deleted resource)
|
|
404
|
+
* - list resource's fields, take fields with names set in request
|
|
405
|
+
* - get resolved values of listed fields (IDs of 'ON' resources).
|
|
406
|
+
* - acquire lock on all 'ON' resources, marking 'FOR' resource as an owner.
|
|
407
|
+
*
|
|
408
|
+
* Lock logic constraints:
|
|
409
|
+
* - Locking is optimistic: if two processes try to obtain a lock on the same resource, one of them
|
|
410
|
+
* succeeds, while the other fails with an error (no long waiting)
|
|
411
|
+
* - Only resolved reference can be locked: to obtain a lock for a particular field's value, the backend needs to know
|
|
412
|
+
* the resource ID this field points to. Unless all listed field references are resolved to a final ID, the lock will fail.
|
|
413
|
+
* - Only an original resource can be locked: if a resource is 'pure' (supports deduplication), it has to pass deduplication before
|
|
414
|
+
* being lockable. An attempt to lock a resource that has not become original will fail.
|
|
415
|
+
* - Locking is a one-way operation: it cannot be 'released' or 'revoked'.
|
|
416
|
+
*
|
|
417
|
+
* @generated from protobuf rpc: LockFieldValues
|
|
418
|
+
*/
|
|
419
|
+
lockFieldValues(input: LocksAPI_LockFieldValues_Create_Request, options?: RpcOptions): UnaryCall<LocksAPI_LockFieldValues_Create_Request, LocksAPI_LockFieldValues_Create_Response> {
|
|
420
|
+
const method = this.methods[18], opt = this._transport.mergeOptions(options);
|
|
421
|
+
return stackIntercept<LocksAPI_LockFieldValues_Create_Request, LocksAPI_LockFieldValues_Create_Response>("unary", this._transport, method, opt, input);
|
|
422
|
+
}
|
|
347
423
|
/**
|
|
348
|
-
*
|
|
349
|
-
*
|
|
350
|
-
*
|
|
424
|
+
* LeaseResource creates a lease for a resource. A lease is a temporary lock that needs periodic renewal to stay valid.
|
|
425
|
+
* Leases are a separate mechanism from locks: leases are focused on 'clients', while locks are focused on 'resources'.
|
|
426
|
+
* To keep the lease active, the client needs the lease ID that is generated when a lease is created and used for lease updates.
|
|
351
427
|
*
|
|
352
428
|
* @generated from protobuf rpc: LeaseResource
|
|
353
429
|
*/
|
|
354
430
|
leaseResource(input: LocksAPI_Lease_Create_Request, options?: RpcOptions): UnaryCall<LocksAPI_Lease_Create_Request, LocksAPI_Lease_Create_Response> {
|
|
355
|
-
const method = this.methods[
|
|
431
|
+
const method = this.methods[19], opt = this._transport.mergeOptions(options);
|
|
356
432
|
return stackIntercept<LocksAPI_Lease_Create_Request, LocksAPI_Lease_Create_Response>("unary", this._transport, method, opt, input);
|
|
357
433
|
}
|
|
358
434
|
/**
|
|
359
435
|
* @generated from protobuf rpc: UpdateLease
|
|
360
436
|
*/
|
|
361
437
|
updateLease(input: LocksAPI_Lease_Update_Request, options?: RpcOptions): UnaryCall<LocksAPI_Lease_Update_Request, LocksAPI_Lease_Update_Response> {
|
|
362
|
-
const method = this.methods[
|
|
438
|
+
const method = this.methods[20], opt = this._transport.mergeOptions(options);
|
|
363
439
|
return stackIntercept<LocksAPI_Lease_Update_Request, LocksAPI_Lease_Update_Response>("unary", this._transport, method, opt, input);
|
|
364
440
|
}
|
|
365
441
|
/**
|
|
366
442
|
* @generated from protobuf rpc: ReleaseLease
|
|
367
443
|
*/
|
|
368
444
|
releaseLease(input: LocksAPI_Lease_Release_Request, options?: RpcOptions): UnaryCall<LocksAPI_Lease_Release_Request, LocksAPI_Lease_Release_Response> {
|
|
369
|
-
const method = this.methods[
|
|
445
|
+
const method = this.methods[21], opt = this._transport.mergeOptions(options);
|
|
370
446
|
return stackIntercept<LocksAPI_Lease_Release_Request, LocksAPI_Lease_Release_Response>("unary", this._transport, method, opt, input);
|
|
371
447
|
}
|
|
372
448
|
/**
|
|
@@ -377,16 +453,44 @@ export class PlatformClient implements IPlatformClient, ServiceInfo {
|
|
|
377
453
|
* @generated from protobuf rpc: AuthMethods
|
|
378
454
|
*/
|
|
379
455
|
authMethods(input: AuthAPI_ListMethods_Request, options?: RpcOptions): UnaryCall<AuthAPI_ListMethods_Request, AuthAPI_ListMethods_Response> {
|
|
380
|
-
const method = this.methods[
|
|
456
|
+
const method = this.methods[22], opt = this._transport.mergeOptions(options);
|
|
381
457
|
return stackIntercept<AuthAPI_ListMethods_Request, AuthAPI_ListMethods_Response>("unary", this._transport, method, opt, input);
|
|
382
458
|
}
|
|
383
459
|
/**
|
|
384
460
|
* @generated from protobuf rpc: GetJWTToken
|
|
385
461
|
*/
|
|
386
462
|
getJWTToken(input: AuthAPI_GetJWTToken_Request, options?: RpcOptions): UnaryCall<AuthAPI_GetJWTToken_Request, AuthAPI_GetJWTToken_Response> {
|
|
387
|
-
const method = this.methods[
|
|
463
|
+
const method = this.methods[23], opt = this._transport.mergeOptions(options);
|
|
388
464
|
return stackIntercept<AuthAPI_GetJWTToken_Request, AuthAPI_GetJWTToken_Response>("unary", this._transport, method, opt, input);
|
|
389
465
|
}
|
|
466
|
+
/**
|
|
467
|
+
* @generated from protobuf rpc: GrantAccess
|
|
468
|
+
*/
|
|
469
|
+
grantAccess(input: AuthAPI_GrantAccess_Request, options?: RpcOptions): UnaryCall<AuthAPI_GrantAccess_Request, AuthAPI_GrantAccess_Response> {
|
|
470
|
+
const method = this.methods[24], opt = this._transport.mergeOptions(options);
|
|
471
|
+
return stackIntercept<AuthAPI_GrantAccess_Request, AuthAPI_GrantAccess_Response>("unary", this._transport, method, opt, input);
|
|
472
|
+
}
|
|
473
|
+
/**
|
|
474
|
+
* @generated from protobuf rpc: RevokeGrant
|
|
475
|
+
*/
|
|
476
|
+
revokeGrant(input: AuthAPI_RevokeGrant_Request, options?: RpcOptions): UnaryCall<AuthAPI_RevokeGrant_Request, AuthAPI_RevokeGrant_Response> {
|
|
477
|
+
const method = this.methods[25], opt = this._transport.mergeOptions(options);
|
|
478
|
+
return stackIntercept<AuthAPI_RevokeGrant_Request, AuthAPI_RevokeGrant_Response>("unary", this._transport, method, opt, input);
|
|
479
|
+
}
|
|
480
|
+
/**
|
|
481
|
+
* @generated from protobuf rpc: ListGrants
|
|
482
|
+
*/
|
|
483
|
+
listGrants(input: AuthAPI_ListGrants_Request, options?: RpcOptions): ServerStreamingCall<AuthAPI_ListGrants_Request, AuthAPI_ListGrants_Response> {
|
|
484
|
+
const method = this.methods[26], opt = this._transport.mergeOptions(options);
|
|
485
|
+
return stackIntercept<AuthAPI_ListGrants_Request, AuthAPI_ListGrants_Response>("serverStreaming", this._transport, method, opt, input);
|
|
486
|
+
}
|
|
487
|
+
/**
|
|
488
|
+
* @generated from protobuf rpc: ListUserResources
|
|
489
|
+
*/
|
|
490
|
+
listUserResources(input: AuthAPI_ListUserResources_Request, options?: RpcOptions): ServerStreamingCall<AuthAPI_ListUserResources_Request, AuthAPI_ListUserResources_Response> {
|
|
491
|
+
const method = this.methods[27], opt = this._transport.mergeOptions(options);
|
|
492
|
+
return stackIntercept<AuthAPI_ListUserResources_Request, AuthAPI_ListUserResources_Response>("serverStreaming", this._transport, method, opt, input);
|
|
493
|
+
}
|
|
390
494
|
/**
|
|
391
495
|
*
|
|
392
496
|
* Other stuff
|
|
@@ -395,7 +499,7 @@ export class PlatformClient implements IPlatformClient, ServiceInfo {
|
|
|
395
499
|
* @generated from protobuf rpc: ListResourceTypes
|
|
396
500
|
*/
|
|
397
501
|
listResourceTypes(input: MiscAPI_ListResourceTypes_Request, options?: RpcOptions): UnaryCall<MiscAPI_ListResourceTypes_Request, MiscAPI_ListResourceTypes_Response> {
|
|
398
|
-
const method = this.methods[
|
|
502
|
+
const method = this.methods[28], opt = this._transport.mergeOptions(options);
|
|
399
503
|
return stackIntercept<MiscAPI_ListResourceTypes_Request, MiscAPI_ListResourceTypes_Response>("unary", this._transport, method, opt, input);
|
|
400
504
|
}
|
|
401
505
|
/**
|
|
@@ -406,14 +510,14 @@ export class PlatformClient implements IPlatformClient, ServiceInfo {
|
|
|
406
510
|
* @generated from protobuf rpc: Ping
|
|
407
511
|
*/
|
|
408
512
|
ping(input: MaintenanceAPI_Ping_Request, options?: RpcOptions): UnaryCall<MaintenanceAPI_Ping_Request, MaintenanceAPI_Ping_Response> {
|
|
409
|
-
const method = this.methods[
|
|
513
|
+
const method = this.methods[29], opt = this._transport.mergeOptions(options);
|
|
410
514
|
return stackIntercept<MaintenanceAPI_Ping_Request, MaintenanceAPI_Ping_Response>("unary", this._transport, method, opt, input);
|
|
411
515
|
}
|
|
412
516
|
/**
|
|
413
517
|
* @generated from protobuf rpc: License
|
|
414
518
|
*/
|
|
415
519
|
license(input: MaintenanceAPI_License_Request, options?: RpcOptions): UnaryCall<MaintenanceAPI_License_Request, MaintenanceAPI_License_Response> {
|
|
416
|
-
const method = this.methods[
|
|
520
|
+
const method = this.methods[30], opt = this._transport.mergeOptions(options);
|
|
417
521
|
return stackIntercept<MaintenanceAPI_License_Request, MaintenanceAPI_License_Response>("unary", this._transport, method, opt, input);
|
|
418
522
|
}
|
|
419
523
|
}
|