@milaboratories/pl-client 2.18.4 → 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 +4 -4
  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
@@ -4,6 +4,22 @@
4
4
  */
5
5
 
6
6
  export interface paths {
7
+ "/v1/auth/grant-access": {
8
+ parameters: {
9
+ query?: never;
10
+ header?: never;
11
+ path?: never;
12
+ cookie?: never;
13
+ };
14
+ get?: never;
15
+ put?: never;
16
+ post: operations["Platform_GrantAccess"];
17
+ delete?: never;
18
+ options?: never;
19
+ head?: never;
20
+ patch?: never;
21
+ trace?: never;
22
+ };
7
23
  "/v1/auth/jwt-token": {
8
24
  parameters: {
9
25
  query?: never;
@@ -37,6 +53,22 @@ export interface paths {
37
53
  patch?: never;
38
54
  trace?: never;
39
55
  };
56
+ "/v1/auth/revoke-grant": {
57
+ parameters: {
58
+ query?: never;
59
+ header?: never;
60
+ path?: never;
61
+ cookie?: never;
62
+ };
63
+ get?: never;
64
+ put?: never;
65
+ post: operations["Platform_RevokeGrant"];
66
+ delete?: never;
67
+ options?: never;
68
+ head?: never;
69
+ patch?: never;
70
+ trace?: never;
71
+ };
40
72
  "/v1/controller/aliases-and-urls": {
41
73
  parameters: {
42
74
  query?: never;
@@ -230,7 +262,7 @@ export interface paths {
230
262
  patch?: never;
231
263
  trace?: never;
232
264
  };
233
- "/v1/locks/lease": {
265
+ "/v1/locks/lease/create": {
234
266
  parameters: {
235
267
  query?: never;
236
268
  header?: never;
@@ -238,10 +270,78 @@ export interface paths {
238
270
  cookie?: never;
239
271
  };
240
272
  get?: never;
241
- put: operations["Platform_UpdateLease"];
242
- /** @description Locks */
273
+ put?: never;
274
+ /**
275
+ * @description LeaseResource creates a lease for a resource. A lease is a temporary lock that needs periodic renewal to stay valid.
276
+ * Leases are a separate mechanism from locks: leases are focused on 'clients', while locks are focused on 'resources'.
277
+ * To keep the lease active, the client needs the lease ID that is generated when a lease is created and used for lease updates.
278
+ */
243
279
  post: operations["Platform_LeaseResource"];
244
- delete: operations["Platform_ReleaseLease"];
280
+ delete?: never;
281
+ options?: never;
282
+ head?: never;
283
+ patch?: never;
284
+ trace?: never;
285
+ };
286
+ "/v1/locks/lease/release": {
287
+ parameters: {
288
+ query?: never;
289
+ header?: never;
290
+ path?: never;
291
+ cookie?: never;
292
+ };
293
+ get?: never;
294
+ put?: never;
295
+ post: operations["Platform_ReleaseLease"];
296
+ delete?: never;
297
+ options?: never;
298
+ head?: never;
299
+ patch?: never;
300
+ trace?: never;
301
+ };
302
+ "/v1/locks/lease/update": {
303
+ parameters: {
304
+ query?: never;
305
+ header?: never;
306
+ path?: never;
307
+ cookie?: never;
308
+ };
309
+ get?: never;
310
+ put?: never;
311
+ post: operations["Platform_UpdateLease"];
312
+ delete?: never;
313
+ options?: never;
314
+ head?: never;
315
+ patch?: never;
316
+ trace?: never;
317
+ };
318
+ "/v1/locks/lock/create": {
319
+ parameters: {
320
+ query?: never;
321
+ header?: never;
322
+ path?: never;
323
+ cookie?: never;
324
+ };
325
+ get?: never;
326
+ put?: never;
327
+ /**
328
+ * @description LockFieldValues gets the resource and obtains a lock on all resolved values of listed fields:
329
+ * - get the resource that will take the lock ('FOR' resource) (lock cannot be obtained 'FOR' or 'ON' deleted resource)
330
+ * - list resource's fields, take fields with names set in request
331
+ * - get resolved values of listed fields (IDs of 'ON' resources).
332
+ * - acquire lock on all 'ON' resources, marking 'FOR' resource as an owner.
333
+ *
334
+ * Lock logic constraints:
335
+ * - Locking is optimistic: if two processes try to obtain a lock on the same resource, one of them
336
+ * succeeds, while the other fails with an error (no long waiting)
337
+ * - Only resolved reference can be locked: to obtain a lock for a particular field's value, the backend needs to know
338
+ * the resource ID this field points to. Unless all listed field references are resolved to a final ID, the lock will fail.
339
+ * - Only an original resource can be locked: if a resource is 'pure' (supports deduplication), it has to pass deduplication before
340
+ * being lockable. An attempt to lock a resource that has not become original will fail.
341
+ * - Locking is a one-way operation: it cannot be 'released' or 'revoked'.
342
+ */
343
+ post: operations["Platform_LockFieldValues"];
344
+ delete?: never;
245
345
  options?: never;
246
346
  head?: never;
247
347
  patch?: never;
@@ -385,6 +485,8 @@ export interface components {
385
485
  DetachFilter_Response: Record<string, never>;
386
486
  Exists_Request: {
387
487
  resourceId: string;
488
+ /** Format: bytes */
489
+ resourceSignature: string;
388
490
  };
389
491
  Exists_Response: {
390
492
  exists: boolean;
@@ -396,28 +498,41 @@ export interface components {
396
498
  type: number;
397
499
  features: components["schemas"]["Resource_Features"];
398
500
  /**
399
- * @description _resolved_ value of field or _assigned_ if the field was assigned to a resource.
400
- * If field refers to another field, it will get
401
- * value only when this chain of references ends up with direct resource
402
- * reference. At that moment all fields in the chain will get their values
501
+ * @description _resolved_ value of a field or _assigned_ if the field was assigned to a resource.
502
+ * If a field refers to another field, it will get
503
+ * a value only when this chain of references ends up with a direct resource
504
+ * reference. At that moment, all fields in the chain will get their values
403
505
  * resolved and will start to refer to the same resource directly.
404
506
  */
405
507
  value: string;
508
+ /**
509
+ * Format: bytes
510
+ * @description Signature for value resource ID, inheriting the parent resource's color.
511
+ * Populated server-side when the parent resource has a known color in the current TX.
512
+ */
513
+ valueSignature: string;
406
514
  /**
407
515
  * Format: enum
408
- * @description If the value was empty, assigned or finally resolved.
516
+ * @description Whether the value is empty, assigned, or finally resolved.
409
517
  */
410
518
  valueStatus: number;
411
519
  /** @description If the value is in its final state (ready, duplicate or error) */
412
520
  valueIsFinal: boolean;
413
521
  /**
414
- * @description Resource error resource id if any.
415
- * Is intended to report problems _from_ platform to client.
522
+ * @description Error resource ID, if any.
523
+ * Is intended to report problems _from_ the platform to the client.
416
524
  */
417
525
  error: string;
526
+ /**
527
+ * Format: bytes
528
+ * @description Signature for error resource ID, inheriting the parent resource's color.
529
+ */
530
+ errorSignature: string;
418
531
  };
419
532
  FieldRef: {
420
533
  resourceId: string;
534
+ /** Format: bytes */
535
+ resourceSignature: string;
421
536
  fieldName: string;
422
537
  };
423
538
  FieldSchema: {
@@ -427,9 +542,13 @@ export interface components {
427
542
  };
428
543
  GetJWTToken_Request: {
429
544
  expiration: string;
545
+ /** Format: enum */
546
+ requestedRole: number;
430
547
  };
431
548
  GetJWTToken_Response: {
432
549
  token: string;
550
+ /** Format: bytes */
551
+ sessionId: string;
433
552
  };
434
553
  GetNotifications_Request: {
435
554
  controllerType: string;
@@ -448,6 +567,8 @@ export interface components {
448
567
  };
449
568
  Get_Request: {
450
569
  resourceId: string;
570
+ /** Format: bytes */
571
+ resourceSignature: string;
451
572
  loadFields: boolean;
452
573
  };
453
574
  Get_Response: {
@@ -460,6 +581,18 @@ export interface components {
460
581
  } & {
461
582
  [key: string]: unknown;
462
583
  };
584
+ GrantAccess_Request: {
585
+ resourceId: string;
586
+ /** Format: bytes */
587
+ resourceSignature: string;
588
+ targetUser: string;
589
+ permissions: components["schemas"]["Grant_Permissions"];
590
+ };
591
+ GrantAccess_Response: Record<string, never>;
592
+ /** @description Permissions describes access level for a grant. */
593
+ Grant_Permissions: {
594
+ writable: boolean;
595
+ };
463
596
  License_Response: {
464
597
  /** Format: int32 */
465
598
  status: number;
@@ -507,6 +640,7 @@ export interface components {
507
640
  resourceCreated: boolean;
508
641
  resourceDeleted: boolean;
509
642
  resourceReady: boolean;
643
+ resourceRecovered: boolean;
510
644
  resourceDuplicate: boolean;
511
645
  resourceError: boolean;
512
646
  /** @description Field events */
@@ -542,6 +676,7 @@ export interface components {
542
676
  allOutputsSet: boolean;
543
677
  genericOtwSet: boolean;
544
678
  dynamicChanged: boolean;
679
+ resourceRecovered: boolean;
545
680
  };
546
681
  Notification_FieldChange: {
547
682
  old: components["schemas"]["Field"];
@@ -550,7 +685,6 @@ export interface components {
550
685
  Ping_Response: {
551
686
  coreVersion: string;
552
687
  coreFullVersion: string;
553
- serverInfo: string;
554
688
  /** Format: enum */
555
689
  compression: number;
556
690
  /**
@@ -578,6 +712,8 @@ export interface components {
578
712
  Release_Request: {
579
713
  resourceId: string;
580
714
  /** Format: bytes */
715
+ resourceSignature: string;
716
+ /** Format: bytes */
581
717
  leaseId: string;
582
718
  };
583
719
  Release_Response: Record<string, never>;
@@ -586,7 +722,9 @@ export interface components {
586
722
  };
587
723
  RemoveAliasesAndUrls_Response: Record<string, never>;
588
724
  Resource: {
589
- id: string;
725
+ resourceId: string;
726
+ /** Format: bytes */
727
+ resourceSignature: string;
590
728
  /** Format: bytes */
591
729
  canonicalId: string;
592
730
  /** Format: enum */
@@ -618,6 +756,33 @@ export interface components {
618
756
  ResourceSchema: {
619
757
  type: components["schemas"]["ResourceType"];
620
758
  fields: components["schemas"]["FieldSchema"][];
759
+ /** @description Access restriction flags for non-controller roles */
760
+ accessFlags: components["schemas"]["ResourceSchema_AccessFlags"];
761
+ freeInputs: boolean;
762
+ freeOutputs: boolean;
763
+ };
764
+ ResourceSchema_AccessFlags: {
765
+ /**
766
+ * @description Deny-list approach: default = allowed (true)
767
+ * Controllers set these to false to restrict non-controller roles (role='u', role='w')
768
+ */
769
+ createResource: boolean;
770
+ /** @description IMPORTANT: read_fields=false with write_fields=true is a forbidden combination */
771
+ readFields: boolean;
772
+ writeFields: boolean;
773
+ /** @description IMPORTANT: read_kv=false with write_kv=true is a forbidden combination */
774
+ readKv: boolean;
775
+ writeKv: boolean;
776
+ /**
777
+ * @description Per-field-type overrides (map: field_type → bool)
778
+ * When defined for a field type, overrides resource-level flags
779
+ */
780
+ readByFieldType: {
781
+ [key: string]: boolean;
782
+ };
783
+ writeByFieldType: {
784
+ [key: string]: boolean;
785
+ };
621
786
  };
622
787
  ResourceType: {
623
788
  name: string;
@@ -626,6 +791,13 @@ export interface components {
626
791
  Resource_Features: {
627
792
  ephemeral: boolean;
628
793
  };
794
+ RevokeGrant_Request: {
795
+ resourceId: string;
796
+ /** Format: bytes */
797
+ resourceSignature: string;
798
+ targetUser: string;
799
+ };
800
+ RevokeGrant_Response: Record<string, never>;
629
801
  SetFeatures_Request: {
630
802
  features: components["schemas"]["ResourceAPIFeature"][];
631
803
  };
@@ -676,6 +848,39 @@ export interface components {
676
848
  }
677
849
  export type $defs = Record<string, never>;
678
850
  export interface operations {
851
+ Platform_GrantAccess: {
852
+ parameters: {
853
+ query?: never;
854
+ header?: never;
855
+ path?: never;
856
+ cookie?: never;
857
+ };
858
+ requestBody: {
859
+ content: {
860
+ "application/json": components["schemas"]["GrantAccess_Request"];
861
+ };
862
+ };
863
+ responses: {
864
+ /** @description OK */
865
+ 200: {
866
+ headers: {
867
+ [name: string]: unknown;
868
+ };
869
+ content: {
870
+ "application/json": components["schemas"]["GrantAccess_Response"];
871
+ };
872
+ };
873
+ /** @description Default error response */
874
+ default: {
875
+ headers: {
876
+ [name: string]: unknown;
877
+ };
878
+ content: {
879
+ "application/json": components["schemas"]["Status"];
880
+ };
881
+ };
882
+ };
883
+ };
679
884
  Platform_GetJWTToken: {
680
885
  parameters: {
681
886
  query?: never;
@@ -738,6 +943,39 @@ export interface operations {
738
943
  };
739
944
  };
740
945
  };
946
+ Platform_RevokeGrant: {
947
+ parameters: {
948
+ query?: never;
949
+ header?: never;
950
+ path?: never;
951
+ cookie?: never;
952
+ };
953
+ requestBody: {
954
+ content: {
955
+ "application/json": components["schemas"]["RevokeGrant_Request"];
956
+ };
957
+ };
958
+ responses: {
959
+ /** @description OK */
960
+ 200: {
961
+ headers: {
962
+ [name: string]: unknown;
963
+ };
964
+ content: {
965
+ "application/json": components["schemas"]["RevokeGrant_Response"];
966
+ };
967
+ };
968
+ /** @description Default error response */
969
+ default: {
970
+ headers: {
971
+ [name: string]: unknown;
972
+ };
973
+ content: {
974
+ "application/json": components["schemas"]["Status"];
975
+ };
976
+ };
977
+ };
978
+ };
741
979
  Platform_WriteControllerAliasesAndUrls: {
742
980
  parameters: {
743
981
  query?: never;
@@ -1196,7 +1434,7 @@ export interface operations {
1196
1434
  };
1197
1435
  };
1198
1436
  };
1199
- Platform_UpdateLease: {
1437
+ Platform_LeaseResource: {
1200
1438
  parameters: {
1201
1439
  query?: never;
1202
1440
  header?: never;
@@ -1205,7 +1443,7 @@ export interface operations {
1205
1443
  };
1206
1444
  requestBody: {
1207
1445
  content: {
1208
- "application/json": components["schemas"]["Update_Request"];
1446
+ "application/json": components["schemas"]["Create_Request"];
1209
1447
  };
1210
1448
  };
1211
1449
  responses: {
@@ -1215,7 +1453,7 @@ export interface operations {
1215
1453
  [name: string]: unknown;
1216
1454
  };
1217
1455
  content: {
1218
- "application/json": components["schemas"]["Update_Response"];
1456
+ "application/json": components["schemas"]["Create_Response"];
1219
1457
  };
1220
1458
  };
1221
1459
  /** @description Default error response */
@@ -1229,7 +1467,7 @@ export interface operations {
1229
1467
  };
1230
1468
  };
1231
1469
  };
1232
- Platform_LeaseResource: {
1470
+ Platform_ReleaseLease: {
1233
1471
  parameters: {
1234
1472
  query?: never;
1235
1473
  header?: never;
@@ -1238,7 +1476,7 @@ export interface operations {
1238
1476
  };
1239
1477
  requestBody: {
1240
1478
  content: {
1241
- "application/json": components["schemas"]["Create_Request"];
1479
+ "application/json": components["schemas"]["Release_Request"];
1242
1480
  };
1243
1481
  };
1244
1482
  responses: {
@@ -1248,7 +1486,7 @@ export interface operations {
1248
1486
  [name: string]: unknown;
1249
1487
  };
1250
1488
  content: {
1251
- "application/json": components["schemas"]["Create_Response"];
1489
+ "application/json": components["schemas"]["Release_Response"];
1252
1490
  };
1253
1491
  };
1254
1492
  /** @description Default error response */
@@ -1262,7 +1500,7 @@ export interface operations {
1262
1500
  };
1263
1501
  };
1264
1502
  };
1265
- Platform_ReleaseLease: {
1503
+ Platform_UpdateLease: {
1266
1504
  parameters: {
1267
1505
  query?: never;
1268
1506
  header?: never;
@@ -1271,7 +1509,7 @@ export interface operations {
1271
1509
  };
1272
1510
  requestBody: {
1273
1511
  content: {
1274
- "application/json": components["schemas"]["Release_Request"];
1512
+ "application/json": components["schemas"]["Update_Request"];
1275
1513
  };
1276
1514
  };
1277
1515
  responses: {
@@ -1281,7 +1519,40 @@ export interface operations {
1281
1519
  [name: string]: unknown;
1282
1520
  };
1283
1521
  content: {
1284
- "application/json": components["schemas"]["Release_Response"];
1522
+ "application/json": components["schemas"]["Update_Response"];
1523
+ };
1524
+ };
1525
+ /** @description Default error response */
1526
+ default: {
1527
+ headers: {
1528
+ [name: string]: unknown;
1529
+ };
1530
+ content: {
1531
+ "application/json": components["schemas"]["Status"];
1532
+ };
1533
+ };
1534
+ };
1535
+ };
1536
+ Platform_LockFieldValues: {
1537
+ parameters: {
1538
+ query?: never;
1539
+ header?: never;
1540
+ path?: never;
1541
+ cookie?: never;
1542
+ };
1543
+ requestBody: {
1544
+ content: {
1545
+ "application/json": components["schemas"]["Create_Request"];
1546
+ };
1547
+ };
1548
+ responses: {
1549
+ /** @description OK */
1550
+ 200: {
1551
+ headers: {
1552
+ [name: string]: unknown;
1553
+ };
1554
+ content: {
1555
+ "application/json": components["schemas"]["Create_Response"];
1285
1556
  };
1286
1557
  };
1287
1558
  /** @description Default error response */