@milaboratories/pl-client 3.2.4 → 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.
Files changed (112) hide show
  1. package/dist/core/client.cjs +24 -56
  2. package/dist/core/client.cjs.map +1 -1
  3. package/dist/core/client.d.ts +12 -8
  4. package/dist/core/client.d.ts.map +1 -1
  5. package/dist/core/client.js +26 -58
  6. package/dist/core/client.js.map +1 -1
  7. package/dist/core/errors.cjs +20 -0
  8. package/dist/core/errors.cjs.map +1 -1
  9. package/dist/core/errors.d.ts +6 -1
  10. package/dist/core/errors.d.ts.map +1 -1
  11. package/dist/core/errors.js +19 -1
  12. package/dist/core/errors.js.map +1 -1
  13. package/dist/core/final.cjs +6 -5
  14. package/dist/core/final.cjs.map +1 -1
  15. package/dist/core/final.d.ts.map +1 -1
  16. package/dist/core/final.js +7 -6
  17. package/dist/core/final.js.map +1 -1
  18. package/dist/core/ll_client.cjs +18 -1
  19. package/dist/core/ll_client.cjs.map +1 -1
  20. package/dist/core/ll_client.d.ts +6 -2
  21. package/dist/core/ll_client.d.ts.map +1 -1
  22. package/dist/core/ll_client.js +19 -2
  23. package/dist/core/ll_client.js.map +1 -1
  24. package/dist/core/transaction.cjs +109 -75
  25. package/dist/core/transaction.cjs.map +1 -1
  26. package/dist/core/transaction.d.ts +30 -22
  27. package/dist/core/transaction.d.ts.map +1 -1
  28. package/dist/core/transaction.js +111 -76
  29. package/dist/core/transaction.js.map +1 -1
  30. package/dist/core/type_conversion.cjs +14 -6
  31. package/dist/core/type_conversion.cjs.map +1 -1
  32. package/dist/core/type_conversion.js +14 -6
  33. package/dist/core/type_conversion.js.map +1 -1
  34. package/dist/core/types.cjs +77 -17
  35. package/dist/core/types.cjs.map +1 -1
  36. package/dist/core/types.d.ts +49 -26
  37. package/dist/core/types.d.ts.map +1 -1
  38. package/dist/core/types.js +66 -14
  39. package/dist/core/types.js.map +1 -1
  40. package/dist/core/user_resources.cjs +181 -0
  41. package/dist/core/user_resources.cjs.map +1 -0
  42. package/dist/core/user_resources.d.ts +75 -0
  43. package/dist/core/user_resources.d.ts.map +1 -0
  44. package/dist/core/user_resources.js +180 -0
  45. package/dist/core/user_resources.js.map +1 -0
  46. package/dist/helpers/poll.cjs +4 -4
  47. package/dist/helpers/poll.cjs.map +1 -1
  48. package/dist/helpers/poll.d.ts +3 -3
  49. package/dist/helpers/poll.d.ts.map +1 -1
  50. package/dist/helpers/poll.js +5 -5
  51. package/dist/helpers/poll.js.map +1 -1
  52. package/dist/helpers/tx_helpers.cjs +1 -1
  53. package/dist/helpers/tx_helpers.cjs.map +1 -1
  54. package/dist/helpers/tx_helpers.d.ts +3 -3
  55. package/dist/helpers/tx_helpers.d.ts.map +1 -1
  56. package/dist/helpers/tx_helpers.js +2 -2
  57. package/dist/helpers/tx_helpers.js.map +1 -1
  58. package/dist/index.cjs +16 -5
  59. package/dist/index.d.ts +5 -4
  60. package/dist/index.js +5 -4
  61. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.cjs +724 -188
  62. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.cjs.map +1 -1
  63. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.client.cjs +34 -9
  64. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.client.cjs.map +1 -1
  65. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.client.d.ts +37 -5
  66. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.client.d.ts.map +1 -1
  67. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.client.js +34 -9
  68. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.client.js.map +1 -1
  69. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.d.ts +326 -136
  70. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.d.ts.map +1 -1
  71. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.js +724 -188
  72. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.js.map +1 -1
  73. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api_types.cjs +18 -7
  74. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api_types.cjs.map +1 -1
  75. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api_types.d.ts +11 -7
  76. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api_types.d.ts.map +1 -1
  77. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api_types.js +18 -7
  78. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api_types.js.map +1 -1
  79. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/base_types.cjs +57 -2
  80. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/base_types.cjs.map +1 -1
  81. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/base_types.d.ts +26 -3
  82. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/base_types.d.ts.map +1 -1
  83. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/base_types.js +57 -3
  84. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/base_types.js.map +1 -1
  85. package/dist/proto-rest/plapi.d.ts +421 -207
  86. package/dist/proto-rest/plapi.d.ts.map +1 -1
  87. package/dist/test/test_config.cjs +6 -3
  88. package/dist/test/test_config.cjs.map +1 -1
  89. package/dist/test/test_config.d.ts.map +1 -1
  90. package/dist/test/test_config.js +7 -4
  91. package/dist/test/test_config.js.map +1 -1
  92. package/package.json +5 -5
  93. package/src/core/client.ts +58 -103
  94. package/src/core/errors.ts +23 -0
  95. package/src/core/final.ts +16 -6
  96. package/src/core/ll_client.ts +39 -3
  97. package/src/core/ll_transaction.test.ts +41 -6
  98. package/src/core/transaction.ts +176 -86
  99. package/src/core/type_conversion.ts +24 -9
  100. package/src/core/types.ts +147 -41
  101. package/src/core/user_resources.ts +332 -0
  102. package/src/helpers/poll.ts +15 -8
  103. package/src/helpers/state_helpers.ts +2 -2
  104. package/src/helpers/tx_helpers.ts +5 -5
  105. package/src/index.ts +1 -0
  106. package/src/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.client.ts +61 -14
  107. package/src/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.ts +1045 -379
  108. package/src/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api_types.ts +33 -18
  109. package/src/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/base_types.ts +75 -6
  110. package/src/proto-grpc/google/protobuf/descriptor.ts +5 -2
  111. package/src/proto-rest/plapi.ts +447 -225
  112. package/src/test/test_config.ts +8 -5
@@ -1,11 +1,11 @@
1
1
  import type { PlTransaction } from "../core/transaction";
2
- import type { FieldData, OptionalResourceId } from "../core/types";
3
- import { isNotNullResourceId } from "../core/types";
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: OptionalResourceId;
8
- errorId: OptionalResourceId;
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 (isNotNullResourceId(f.error)) {
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 { AuthAPI_RevokeGrant_Response } from "./api";
19
- import type { AuthAPI_RevokeGrant_Request } from "./api";
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: RevokeGrant
228
+ * @generated from protobuf rpc: RevokeAccess
219
229
  */
220
- revokeGrant(input: AuthAPI_RevokeGrant_Request, options?: RpcOptions): UnaryCall<AuthAPI_RevokeGrant_Request, AuthAPI_RevokeGrant_Response>;
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[24], opt = this._transport.mergeOptions(options);
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: RevokeGrant
503
+ * @generated from protobuf rpc: RevokeAccess
475
504
  */
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);
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[26], opt = this._transport.mergeOptions(options);
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[27], opt = this._transport.mergeOptions(options);
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[28], opt = this._transport.mergeOptions(options);
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[29], opt = this._transport.mergeOptions(options);
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[30], opt = this._transport.mergeOptions(options);
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
  }