@milaboratories/pl-client 2.18.5 → 3.0.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 (52) hide show
  1. package/dist/core/ll_client.cjs +11 -5
  2. package/dist/core/ll_client.cjs.map +1 -1
  3. package/dist/core/ll_client.js +12 -6
  4. package/dist/core/ll_client.js.map +1 -1
  5. package/dist/core/transaction.cjs +2 -2
  6. package/dist/core/transaction.cjs.map +1 -1
  7. package/dist/core/transaction.js +2 -2
  8. package/dist/core/transaction.js.map +1 -1
  9. package/dist/core/type_conversion.cjs +1 -1
  10. package/dist/core/type_conversion.cjs.map +1 -1
  11. package/dist/core/type_conversion.js +1 -1
  12. package/dist/core/type_conversion.js.map +1 -1
  13. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.cjs +1957 -256
  14. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.cjs.map +1 -1
  15. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.client.cjs +59 -9
  16. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.client.cjs.map +1 -1
  17. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.client.d.ts +74 -4
  18. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.client.js +59 -9
  19. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.client.js.map +1 -1
  20. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.d.ts +658 -51
  21. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.js +1957 -257
  22. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.js.map +1 -1
  23. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api_types.cjs +247 -17
  24. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api_types.cjs.map +1 -1
  25. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api_types.d.ts +104 -10
  26. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api_types.js +247 -17
  27. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api_types.js.map +1 -1
  28. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/base_types.cjs +26 -12
  29. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/base_types.cjs.map +1 -1
  30. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/base_types.d.ts +4 -0
  31. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/base_types.js +26 -12
  32. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/base_types.js.map +1 -1
  33. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/resource_types.cjs +11 -0
  34. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/resource_types.cjs.map +1 -1
  35. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/resource_types.d.ts +4 -0
  36. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/resource_types.js +11 -0
  37. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/resource_types.js.map +1 -1
  38. package/dist/proto-rest/plapi.d.ts +281 -28
  39. package/package.json +2 -2
  40. package/src/core/ll_client.ts +9 -2
  41. package/src/core/transaction.ts +33 -8
  42. package/src/core/type_conversion.ts +1 -1
  43. package/src/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.client.ts +119 -15
  44. package/src/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.ts +2270 -322
  45. package/src/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api_types.ts +276 -20
  46. package/src/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/base_types.ts +11 -0
  47. package/src/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/import.ts +2 -2
  48. package/src/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/resource_types.ts +11 -0
  49. package/src/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/ws-test.ts +3 -3
  50. package/src/proto-grpc/google/protobuf/descriptor.ts +2 -5
  51. package/src/proto-grpc/google/protobuf/struct.ts +1 -1
  52. package/src/proto-rest/plapi.ts +293 -22
@@ -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
- * Locks
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
- * Locks
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[18], opt = this._transport.mergeOptions(options);
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[19], opt = this._transport.mergeOptions(options);
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[20], opt = this._transport.mergeOptions(options);
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[21], opt = this._transport.mergeOptions(options);
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[22], opt = this._transport.mergeOptions(options);
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[23], opt = this._transport.mergeOptions(options);
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[24], opt = this._transport.mergeOptions(options);
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[25], opt = this._transport.mergeOptions(options);
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
  }