@milaboratories/pl-client 3.2.5 → 3.3.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/core/client.cjs +24 -56
- package/dist/core/client.cjs.map +1 -1
- package/dist/core/client.d.ts +12 -8
- package/dist/core/client.d.ts.map +1 -1
- package/dist/core/client.js +26 -58
- package/dist/core/client.js.map +1 -1
- package/dist/core/errors.cjs +20 -0
- package/dist/core/errors.cjs.map +1 -1
- package/dist/core/errors.d.ts +6 -1
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core/errors.js +19 -1
- package/dist/core/errors.js.map +1 -1
- package/dist/core/final.cjs +6 -5
- package/dist/core/final.cjs.map +1 -1
- package/dist/core/final.d.ts.map +1 -1
- package/dist/core/final.js +7 -6
- package/dist/core/final.js.map +1 -1
- package/dist/core/ll_client.cjs +18 -1
- package/dist/core/ll_client.cjs.map +1 -1
- package/dist/core/ll_client.d.ts +6 -2
- package/dist/core/ll_client.d.ts.map +1 -1
- package/dist/core/ll_client.js +19 -2
- package/dist/core/ll_client.js.map +1 -1
- package/dist/core/transaction.cjs +109 -75
- package/dist/core/transaction.cjs.map +1 -1
- package/dist/core/transaction.d.ts +30 -22
- package/dist/core/transaction.d.ts.map +1 -1
- package/dist/core/transaction.js +111 -76
- package/dist/core/transaction.js.map +1 -1
- package/dist/core/type_conversion.cjs +14 -6
- package/dist/core/type_conversion.cjs.map +1 -1
- package/dist/core/type_conversion.js +14 -6
- package/dist/core/type_conversion.js.map +1 -1
- package/dist/core/types.cjs +77 -17
- package/dist/core/types.cjs.map +1 -1
- package/dist/core/types.d.ts +49 -26
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js +66 -14
- package/dist/core/types.js.map +1 -1
- package/dist/core/user_resources.cjs +181 -0
- package/dist/core/user_resources.cjs.map +1 -0
- package/dist/core/user_resources.d.ts +75 -0
- package/dist/core/user_resources.d.ts.map +1 -0
- package/dist/core/user_resources.js +180 -0
- package/dist/core/user_resources.js.map +1 -0
- package/dist/helpers/poll.cjs +4 -4
- package/dist/helpers/poll.cjs.map +1 -1
- package/dist/helpers/poll.d.ts +3 -3
- package/dist/helpers/poll.d.ts.map +1 -1
- package/dist/helpers/poll.js +5 -5
- package/dist/helpers/poll.js.map +1 -1
- package/dist/helpers/tx_helpers.cjs +1 -1
- package/dist/helpers/tx_helpers.cjs.map +1 -1
- package/dist/helpers/tx_helpers.d.ts +3 -3
- package/dist/helpers/tx_helpers.d.ts.map +1 -1
- package/dist/helpers/tx_helpers.js +2 -2
- package/dist/helpers/tx_helpers.js.map +1 -1
- package/dist/index.cjs +16 -5
- package/dist/index.d.ts +5 -4
- package/dist/index.js +5 -4
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.cjs +724 -188
- 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 +34 -9
- 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 +37 -5
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.client.d.ts.map +1 -1
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.client.js +34 -9
- 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 +326 -136
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.d.ts.map +1 -1
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.js +724 -188
- 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 +18 -7
- 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 +11 -7
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api_types.d.ts.map +1 -1
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api_types.js +18 -7
- 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 +57 -2
- 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 +26 -3
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/base_types.d.ts.map +1 -1
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/base_types.js +57 -3
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/base_types.js.map +1 -1
- package/dist/proto-rest/plapi.d.ts +421 -207
- package/dist/proto-rest/plapi.d.ts.map +1 -1
- package/dist/test/test_config.cjs +6 -3
- package/dist/test/test_config.cjs.map +1 -1
- package/dist/test/test_config.d.ts.map +1 -1
- package/dist/test/test_config.js +7 -4
- package/dist/test/test_config.js.map +1 -1
- package/package.json +5 -5
- package/src/core/client.ts +58 -103
- package/src/core/errors.ts +23 -0
- package/src/core/final.ts +16 -6
- package/src/core/ll_client.ts +39 -3
- package/src/core/ll_transaction.test.ts +41 -6
- package/src/core/transaction.ts +176 -86
- package/src/core/type_conversion.ts +24 -9
- package/src/core/types.ts +147 -41
- package/src/core/user_resources.ts +332 -0
- package/src/helpers/poll.ts +15 -8
- package/src/helpers/state_helpers.ts +2 -2
- package/src/helpers/tx_helpers.ts +5 -5
- package/src/index.ts +1 -0
- package/src/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.client.ts +61 -14
- package/src/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.ts +1045 -379
- package/src/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api_types.ts +33 -18
- package/src/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/base_types.ts +75 -6
- package/src/proto-grpc/google/protobuf/descriptor.ts +5 -2
- package/src/proto-rest/plapi.ts +447 -225
- package/src/test/test_config.ts +8 -5
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { PlTransaction } from "../core/transaction";
|
|
2
|
-
import type { FieldData,
|
|
3
|
-
import {
|
|
2
|
+
import type { FieldData, OptionalSignedResourceId } from "../core/types";
|
|
3
|
+
import { isNotNullSignedResourceId } from "../core/types";
|
|
4
4
|
import { cachedDeserialize, notEmpty } from "@milaboratories/ts-helpers";
|
|
5
5
|
|
|
6
6
|
export interface ValErr {
|
|
7
|
-
valueId:
|
|
8
|
-
errorId:
|
|
7
|
+
valueId: OptionalSignedResourceId;
|
|
8
|
+
errorId: OptionalSignedResourceId;
|
|
9
9
|
error?: string;
|
|
10
10
|
}
|
|
11
11
|
|
|
@@ -16,7 +16,7 @@ export async function valErr(tx: PlTransaction, f: FieldData): Promise<ValErr> {
|
|
|
16
16
|
error: "",
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
-
if (
|
|
19
|
+
if (isNotNullSignedResourceId(f.error)) {
|
|
20
20
|
const e = await tx.getResourceData(f.error, true);
|
|
21
21
|
const deserializationResult = cachedDeserialize(notEmpty(e.data));
|
|
22
22
|
if (typeof deserializationResult !== "string") {
|
package/src/index.ts
CHANGED
|
@@ -9,6 +9,7 @@ export * from "./core/default_client";
|
|
|
9
9
|
export * from "./core/unauth_client";
|
|
10
10
|
export * from "./core/auth";
|
|
11
11
|
export * from "./core/final";
|
|
12
|
+
export * from "./core/user_resources";
|
|
12
13
|
export * from "./core/wire";
|
|
13
14
|
export * from "./helpers/tx_helpers";
|
|
14
15
|
export * from "./helpers/poll";
|
|
@@ -12,13 +12,19 @@ import type { MiscAPI_ListResourceTypes_Response } from "./api";
|
|
|
12
12
|
import type { MiscAPI_ListResourceTypes_Request } from "./api";
|
|
13
13
|
import type { AuthAPI_ListUserResources_Response } from "./api";
|
|
14
14
|
import type { AuthAPI_ListUserResources_Request } from "./api";
|
|
15
|
+
import type { AuthAPI_GetUserRoot_Response } from "./api";
|
|
16
|
+
import type { AuthAPI_GetUserRoot_Request } from "./api";
|
|
17
|
+
import type { AuthAPI_MintSignature_Response } from "./api";
|
|
18
|
+
import type { AuthAPI_MintSignature_Request } from "./api";
|
|
15
19
|
import type { AuthAPI_ListGrants_Response } from "./api";
|
|
16
20
|
import type { AuthAPI_ListGrants_Request } from "./api";
|
|
17
21
|
import type { ServerStreamingCall } from "@protobuf-ts/runtime-rpc";
|
|
18
|
-
import type {
|
|
19
|
-
import type {
|
|
22
|
+
import type { AuthAPI_RevokeAccess_Response } from "./api";
|
|
23
|
+
import type { AuthAPI_RevokeAccess_Request } from "./api";
|
|
20
24
|
import type { AuthAPI_GrantAccess_Response } from "./api";
|
|
21
25
|
import type { AuthAPI_GrantAccess_Request } from "./api";
|
|
26
|
+
import type { AuthAPI_GetSessionInfo_Response } from "./api";
|
|
27
|
+
import type { AuthAPI_GetSessionInfo_Request } from "./api";
|
|
22
28
|
import type { AuthAPI_GetJWTToken_Response } from "./api";
|
|
23
29
|
import type { AuthAPI_GetJWTToken_Request } from "./api";
|
|
24
30
|
import type { AuthAPI_ListMethods_Response } from "./api";
|
|
@@ -210,18 +216,34 @@ export interface IPlatformClient {
|
|
|
210
216
|
* @generated from protobuf rpc: GetJWTToken
|
|
211
217
|
*/
|
|
212
218
|
getJWTToken(input: AuthAPI_GetJWTToken_Request, options?: RpcOptions): UnaryCall<AuthAPI_GetJWTToken_Request, AuthAPI_GetJWTToken_Response>;
|
|
219
|
+
/**
|
|
220
|
+
* @generated from protobuf rpc: GetSessionInfo
|
|
221
|
+
*/
|
|
222
|
+
getSessionInfo(input: AuthAPI_GetSessionInfo_Request, options?: RpcOptions): UnaryCall<AuthAPI_GetSessionInfo_Request, AuthAPI_GetSessionInfo_Response>;
|
|
213
223
|
/**
|
|
214
224
|
* @generated from protobuf rpc: GrantAccess
|
|
215
225
|
*/
|
|
216
226
|
grantAccess(input: AuthAPI_GrantAccess_Request, options?: RpcOptions): UnaryCall<AuthAPI_GrantAccess_Request, AuthAPI_GrantAccess_Response>;
|
|
217
227
|
/**
|
|
218
|
-
* @generated from protobuf rpc:
|
|
228
|
+
* @generated from protobuf rpc: RevokeAccess
|
|
219
229
|
*/
|
|
220
|
-
|
|
230
|
+
revokeAccess(input: AuthAPI_RevokeAccess_Request, options?: RpcOptions): UnaryCall<AuthAPI_RevokeAccess_Request, AuthAPI_RevokeAccess_Response>;
|
|
221
231
|
/**
|
|
222
232
|
* @generated from protobuf rpc: ListGrants
|
|
223
233
|
*/
|
|
224
234
|
listGrants(input: AuthAPI_ListGrants_Request, options?: RpcOptions): ServerStreamingCall<AuthAPI_ListGrants_Request, AuthAPI_ListGrants_Response>;
|
|
235
|
+
/**
|
|
236
|
+
* MintSignature creates a resource signature bound to a target session.
|
|
237
|
+
* Controllers use it during workflow bootstrap to pre-sign resources
|
|
238
|
+
* so the workflow can access them under its own isolated session.
|
|
239
|
+
*
|
|
240
|
+
* @generated from protobuf rpc: MintSignature
|
|
241
|
+
*/
|
|
242
|
+
mintSignature(input: AuthAPI_MintSignature_Request, options?: RpcOptions): UnaryCall<AuthAPI_MintSignature_Request, AuthAPI_MintSignature_Response>;
|
|
243
|
+
/**
|
|
244
|
+
* @generated from protobuf rpc: GetUserRoot
|
|
245
|
+
*/
|
|
246
|
+
getUserRoot(input: AuthAPI_GetUserRoot_Request, options?: RpcOptions): UnaryCall<AuthAPI_GetUserRoot_Request, AuthAPI_GetUserRoot_Response>;
|
|
225
247
|
/**
|
|
226
248
|
* @generated from protobuf rpc: ListUserResources
|
|
227
249
|
*/
|
|
@@ -463,32 +485,57 @@ export class PlatformClient implements IPlatformClient, ServiceInfo {
|
|
|
463
485
|
const method = this.methods[23], opt = this._transport.mergeOptions(options);
|
|
464
486
|
return stackIntercept<AuthAPI_GetJWTToken_Request, AuthAPI_GetJWTToken_Response>("unary", this._transport, method, opt, input);
|
|
465
487
|
}
|
|
488
|
+
/**
|
|
489
|
+
* @generated from protobuf rpc: GetSessionInfo
|
|
490
|
+
*/
|
|
491
|
+
getSessionInfo(input: AuthAPI_GetSessionInfo_Request, options?: RpcOptions): UnaryCall<AuthAPI_GetSessionInfo_Request, AuthAPI_GetSessionInfo_Response> {
|
|
492
|
+
const method = this.methods[24], opt = this._transport.mergeOptions(options);
|
|
493
|
+
return stackIntercept<AuthAPI_GetSessionInfo_Request, AuthAPI_GetSessionInfo_Response>("unary", this._transport, method, opt, input);
|
|
494
|
+
}
|
|
466
495
|
/**
|
|
467
496
|
* @generated from protobuf rpc: GrantAccess
|
|
468
497
|
*/
|
|
469
498
|
grantAccess(input: AuthAPI_GrantAccess_Request, options?: RpcOptions): UnaryCall<AuthAPI_GrantAccess_Request, AuthAPI_GrantAccess_Response> {
|
|
470
|
-
const method = this.methods[
|
|
499
|
+
const method = this.methods[25], opt = this._transport.mergeOptions(options);
|
|
471
500
|
return stackIntercept<AuthAPI_GrantAccess_Request, AuthAPI_GrantAccess_Response>("unary", this._transport, method, opt, input);
|
|
472
501
|
}
|
|
473
502
|
/**
|
|
474
|
-
* @generated from protobuf rpc:
|
|
503
|
+
* @generated from protobuf rpc: RevokeAccess
|
|
475
504
|
*/
|
|
476
|
-
|
|
477
|
-
const method = this.methods[
|
|
478
|
-
return stackIntercept<
|
|
505
|
+
revokeAccess(input: AuthAPI_RevokeAccess_Request, options?: RpcOptions): UnaryCall<AuthAPI_RevokeAccess_Request, AuthAPI_RevokeAccess_Response> {
|
|
506
|
+
const method = this.methods[26], opt = this._transport.mergeOptions(options);
|
|
507
|
+
return stackIntercept<AuthAPI_RevokeAccess_Request, AuthAPI_RevokeAccess_Response>("unary", this._transport, method, opt, input);
|
|
479
508
|
}
|
|
480
509
|
/**
|
|
481
510
|
* @generated from protobuf rpc: ListGrants
|
|
482
511
|
*/
|
|
483
512
|
listGrants(input: AuthAPI_ListGrants_Request, options?: RpcOptions): ServerStreamingCall<AuthAPI_ListGrants_Request, AuthAPI_ListGrants_Response> {
|
|
484
|
-
const method = this.methods[
|
|
513
|
+
const method = this.methods[27], opt = this._transport.mergeOptions(options);
|
|
485
514
|
return stackIntercept<AuthAPI_ListGrants_Request, AuthAPI_ListGrants_Response>("serverStreaming", this._transport, method, opt, input);
|
|
486
515
|
}
|
|
516
|
+
/**
|
|
517
|
+
* MintSignature creates a resource signature bound to a target session.
|
|
518
|
+
* Controllers use it during workflow bootstrap to pre-sign resources
|
|
519
|
+
* so the workflow can access them under its own isolated session.
|
|
520
|
+
*
|
|
521
|
+
* @generated from protobuf rpc: MintSignature
|
|
522
|
+
*/
|
|
523
|
+
mintSignature(input: AuthAPI_MintSignature_Request, options?: RpcOptions): UnaryCall<AuthAPI_MintSignature_Request, AuthAPI_MintSignature_Response> {
|
|
524
|
+
const method = this.methods[28], opt = this._transport.mergeOptions(options);
|
|
525
|
+
return stackIntercept<AuthAPI_MintSignature_Request, AuthAPI_MintSignature_Response>("unary", this._transport, method, opt, input);
|
|
526
|
+
}
|
|
527
|
+
/**
|
|
528
|
+
* @generated from protobuf rpc: GetUserRoot
|
|
529
|
+
*/
|
|
530
|
+
getUserRoot(input: AuthAPI_GetUserRoot_Request, options?: RpcOptions): UnaryCall<AuthAPI_GetUserRoot_Request, AuthAPI_GetUserRoot_Response> {
|
|
531
|
+
const method = this.methods[29], opt = this._transport.mergeOptions(options);
|
|
532
|
+
return stackIntercept<AuthAPI_GetUserRoot_Request, AuthAPI_GetUserRoot_Response>("unary", this._transport, method, opt, input);
|
|
533
|
+
}
|
|
487
534
|
/**
|
|
488
535
|
* @generated from protobuf rpc: ListUserResources
|
|
489
536
|
*/
|
|
490
537
|
listUserResources(input: AuthAPI_ListUserResources_Request, options?: RpcOptions): ServerStreamingCall<AuthAPI_ListUserResources_Request, AuthAPI_ListUserResources_Response> {
|
|
491
|
-
const method = this.methods[
|
|
538
|
+
const method = this.methods[30], opt = this._transport.mergeOptions(options);
|
|
492
539
|
return stackIntercept<AuthAPI_ListUserResources_Request, AuthAPI_ListUserResources_Response>("serverStreaming", this._transport, method, opt, input);
|
|
493
540
|
}
|
|
494
541
|
/**
|
|
@@ -499,7 +546,7 @@ export class PlatformClient implements IPlatformClient, ServiceInfo {
|
|
|
499
546
|
* @generated from protobuf rpc: ListResourceTypes
|
|
500
547
|
*/
|
|
501
548
|
listResourceTypes(input: MiscAPI_ListResourceTypes_Request, options?: RpcOptions): UnaryCall<MiscAPI_ListResourceTypes_Request, MiscAPI_ListResourceTypes_Response> {
|
|
502
|
-
const method = this.methods[
|
|
549
|
+
const method = this.methods[31], opt = this._transport.mergeOptions(options);
|
|
503
550
|
return stackIntercept<MiscAPI_ListResourceTypes_Request, MiscAPI_ListResourceTypes_Response>("unary", this._transport, method, opt, input);
|
|
504
551
|
}
|
|
505
552
|
/**
|
|
@@ -510,14 +557,14 @@ export class PlatformClient implements IPlatformClient, ServiceInfo {
|
|
|
510
557
|
* @generated from protobuf rpc: Ping
|
|
511
558
|
*/
|
|
512
559
|
ping(input: MaintenanceAPI_Ping_Request, options?: RpcOptions): UnaryCall<MaintenanceAPI_Ping_Request, MaintenanceAPI_Ping_Response> {
|
|
513
|
-
const method = this.methods[
|
|
560
|
+
const method = this.methods[32], opt = this._transport.mergeOptions(options);
|
|
514
561
|
return stackIntercept<MaintenanceAPI_Ping_Request, MaintenanceAPI_Ping_Response>("unary", this._transport, method, opt, input);
|
|
515
562
|
}
|
|
516
563
|
/**
|
|
517
564
|
* @generated from protobuf rpc: License
|
|
518
565
|
*/
|
|
519
566
|
license(input: MaintenanceAPI_License_Request, options?: RpcOptions): UnaryCall<MaintenanceAPI_License_Request, MaintenanceAPI_License_Response> {
|
|
520
|
-
const method = this.methods[
|
|
567
|
+
const method = this.methods[33], opt = this._transport.mergeOptions(options);
|
|
521
568
|
return stackIntercept<MaintenanceAPI_License_Request, MaintenanceAPI_License_Response>("unary", this._transport, method, opt, input);
|
|
522
569
|
}
|
|
523
570
|
}
|