@iveri/contracts 0.129.0 → 0.131.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/README.md
CHANGED
|
@@ -305,6 +305,11 @@ Conduit's outbox.
|
|
|
305
305
|
`localization:render` permissions.
|
|
306
306
|
- Version `0.100.0` adds `notification:send-any`, the password-reset bodies and Conduit's usage metrics.
|
|
307
307
|
- Version `0.101.0` adds `UsageHistory`, a company's closed months of a product by metric.
|
|
308
|
+
- Version `0.131.0` adds `mobility:dispatch:create-any`, `mobility:dispatch:read-any`, `mobility:dispatch:operate-any`,
|
|
309
|
+
`mobility:worker:read-any` and `mobility:worker:rating:submit-any`, so taxi's and delivery's operator-workspace keys
|
|
310
|
+
dispatch, observe, release and rate in the company a request names.
|
|
311
|
+
- Version `0.130.0` adds `profile:read-any`, so a product's operator-workspace key reads the public profile
|
|
312
|
+
of somebody in the company a request names.
|
|
308
313
|
- Version `0.128.0` adds `CommerceRefusal.ORDER_MOVED_ON` (`order-moved-on`), a stale order or shipment status change.
|
|
309
314
|
- Version `0.127.0` adds `UniboxRefusal` and `SocialRefusal.STORAGE_UNAVAILABLE` (`storage-unavailable`).
|
|
310
315
|
- Version `0.123.0` adds `HrRefusal`, the HR refusals a client says in the reader's language.
|
|
@@ -38,6 +38,12 @@ export declare enum UserPermission {
|
|
|
38
38
|
* permission at all — it is the subject of the presented token.
|
|
39
39
|
*/
|
|
40
40
|
PROFILE_READ = "profile:read",
|
|
41
|
+
/**
|
|
42
|
+
* Read the public profile of somebody in a company the request names in `tenantId`, rather than the token's own. A
|
|
43
|
+
* platform permission: held only by a service credential in Iveri's operator workspace, beside `profile:read`, so a
|
|
44
|
+
* product sold to many companies names each company's people in the conversations it opens for them.
|
|
45
|
+
*/
|
|
46
|
+
PROFILE_READ_ANY = "profile:read-any",
|
|
41
47
|
MEMBERSHIP_READ = "membership:read",
|
|
42
48
|
/** Suspend or reactivate someone's access without deleting their account. */
|
|
43
49
|
MEMBERSHIP_UPDATE = "membership:update",
|
|
@@ -416,6 +422,12 @@ export declare enum UserPermission {
|
|
|
416
422
|
REALTIME_EVENT_PUBLISH_ANY = "realtime:event:publish-any",
|
|
417
423
|
/** Read worker profiles and operational availability inside the caller's tenant. */
|
|
418
424
|
MOBILITY_WORKER_READ = "mobility:worker:read",
|
|
425
|
+
/**
|
|
426
|
+
* Read a worker in a company the request names in `tenantId`, rather than the token's own. A platform permission:
|
|
427
|
+
* held only by a service credential in Iveri's operator workspace, beside `mobility:worker:read`, so a product sold
|
|
428
|
+
* to many companies (taxi, delivery) resolves the driver or courier on each company's ride or job from one key.
|
|
429
|
+
*/
|
|
430
|
+
MOBILITY_WORKER_READ_ANY = "mobility:worker:read-any",
|
|
419
431
|
/** Enrol workers, amend their capabilities, and suspend or reactivate them. */
|
|
420
432
|
MOBILITY_WORKER_MANAGE = "mobility:worker:manage",
|
|
421
433
|
/** Go online or offline. Assignment-owned `busy` cannot be requested through this grant. */
|
|
@@ -431,16 +443,37 @@ export declare enum UserPermission {
|
|
|
431
443
|
* somebody's capabilities and employment.
|
|
432
444
|
*/
|
|
433
445
|
MOBILITY_WORKER_RATING_SUBMIT = "mobility:worker:rating:submit",
|
|
446
|
+
/**
|
|
447
|
+
* Record a rating for an assignment in a company the request names in `tenantId`. A platform permission, held beside
|
|
448
|
+
* `mobility:worker:rating:submit` only by a product's operator-workspace key.
|
|
449
|
+
*/
|
|
450
|
+
MOBILITY_WORKER_RATING_SUBMIT_ANY = "mobility:worker:rating:submit-any",
|
|
434
451
|
/** Read a worker's latest raw coordinate. Separate because location is sensitive operational data. */
|
|
435
452
|
MOBILITY_WORKER_LOCATION_READ = "mobility:worker:location:read",
|
|
436
453
|
/** Submit the caller's own device heartbeat; a worker may never update somebody else's location. */
|
|
437
454
|
MOBILITY_WORKER_LOCATION_UPDATE = "mobility:worker:location:update",
|
|
438
455
|
/** Read dispatch aggregate state and its pickup coordinate inside the caller's tenant. */
|
|
439
456
|
MOBILITY_DISPATCH_READ = "mobility:dispatch:read",
|
|
457
|
+
/**
|
|
458
|
+
* Read a dispatch and its assignment in a company the request names in `tenantId`. A platform permission, held beside
|
|
459
|
+
* `mobility:dispatch:read` only by a product's operator-workspace key.
|
|
460
|
+
*/
|
|
461
|
+
MOBILITY_DISPATCH_READ_ANY = "mobility:dispatch:read-any",
|
|
440
462
|
/** Submit a dispatch request for a vertical-owned ride or delivery job. */
|
|
441
463
|
MOBILITY_DISPATCH_CREATE = "mobility:dispatch:create",
|
|
464
|
+
/**
|
|
465
|
+
* Submit a dispatch into a company the request names in `tenantId`. A platform permission, held beside
|
|
466
|
+
* `mobility:dispatch:create` only by a product's operator-workspace key. The dispatch is filed in, and offered only
|
|
467
|
+
* to the workers of, the company it names.
|
|
468
|
+
*/
|
|
469
|
+
MOBILITY_DISPATCH_CREATE_ANY = "mobility:dispatch:create-any",
|
|
442
470
|
/** Cancel, expire, or manually operate a dispatch; intentionally not granted to ordinary submitters. */
|
|
443
471
|
MOBILITY_DISPATCH_OPERATE = "mobility:dispatch:operate",
|
|
472
|
+
/**
|
|
473
|
+
* Cancel a dispatch or release an assignment in a company the request names in `tenantId`. A platform permission,
|
|
474
|
+
* held beside `mobility:dispatch:operate` only by a product's operator-workspace key.
|
|
475
|
+
*/
|
|
476
|
+
MOBILITY_DISPATCH_OPERATE_ANY = "mobility:dispatch:operate-any",
|
|
444
477
|
/** Read only the dispatch offers addressed to the caller's own worker profile. */
|
|
445
478
|
MOBILITY_DISPATCH_OFFER_READ = "mobility:dispatch-offer:read",
|
|
446
479
|
/** Accept or reject only an offer addressed to the caller's own worker profile. */
|
|
@@ -43,6 +43,12 @@ export var UserPermission;
|
|
|
43
43
|
* permission at all — it is the subject of the presented token.
|
|
44
44
|
*/
|
|
45
45
|
UserPermission["PROFILE_READ"] = "profile:read";
|
|
46
|
+
/**
|
|
47
|
+
* Read the public profile of somebody in a company the request names in `tenantId`, rather than the token's own. A
|
|
48
|
+
* platform permission: held only by a service credential in Iveri's operator workspace, beside `profile:read`, so a
|
|
49
|
+
* product sold to many companies names each company's people in the conversations it opens for them.
|
|
50
|
+
*/
|
|
51
|
+
UserPermission["PROFILE_READ_ANY"] = "profile:read-any";
|
|
46
52
|
// ── Membership ──────────────────────────────────────────────────────────
|
|
47
53
|
UserPermission["MEMBERSHIP_READ"] = "membership:read";
|
|
48
54
|
/** Suspend or reactivate someone's access without deleting their account. */
|
|
@@ -480,6 +486,12 @@ export var UserPermission;
|
|
|
480
486
|
// ══ iveri-mobility-api ══════════════════════════════════════════════════
|
|
481
487
|
/** Read worker profiles and operational availability inside the caller's tenant. */
|
|
482
488
|
UserPermission["MOBILITY_WORKER_READ"] = "mobility:worker:read";
|
|
489
|
+
/**
|
|
490
|
+
* Read a worker in a company the request names in `tenantId`, rather than the token's own. A platform permission:
|
|
491
|
+
* held only by a service credential in Iveri's operator workspace, beside `mobility:worker:read`, so a product sold
|
|
492
|
+
* to many companies (taxi, delivery) resolves the driver or courier on each company's ride or job from one key.
|
|
493
|
+
*/
|
|
494
|
+
UserPermission["MOBILITY_WORKER_READ_ANY"] = "mobility:worker:read-any";
|
|
483
495
|
/** Enrol workers, amend their capabilities, and suspend or reactivate them. */
|
|
484
496
|
UserPermission["MOBILITY_WORKER_MANAGE"] = "mobility:worker:manage";
|
|
485
497
|
/** Go online or offline. Assignment-owned `busy` cannot be requested through this grant. */
|
|
@@ -495,16 +507,37 @@ export var UserPermission;
|
|
|
495
507
|
* somebody's capabilities and employment.
|
|
496
508
|
*/
|
|
497
509
|
UserPermission["MOBILITY_WORKER_RATING_SUBMIT"] = "mobility:worker:rating:submit";
|
|
510
|
+
/**
|
|
511
|
+
* Record a rating for an assignment in a company the request names in `tenantId`. A platform permission, held beside
|
|
512
|
+
* `mobility:worker:rating:submit` only by a product's operator-workspace key.
|
|
513
|
+
*/
|
|
514
|
+
UserPermission["MOBILITY_WORKER_RATING_SUBMIT_ANY"] = "mobility:worker:rating:submit-any";
|
|
498
515
|
/** Read a worker's latest raw coordinate. Separate because location is sensitive operational data. */
|
|
499
516
|
UserPermission["MOBILITY_WORKER_LOCATION_READ"] = "mobility:worker:location:read";
|
|
500
517
|
/** Submit the caller's own device heartbeat; a worker may never update somebody else's location. */
|
|
501
518
|
UserPermission["MOBILITY_WORKER_LOCATION_UPDATE"] = "mobility:worker:location:update";
|
|
502
519
|
/** Read dispatch aggregate state and its pickup coordinate inside the caller's tenant. */
|
|
503
520
|
UserPermission["MOBILITY_DISPATCH_READ"] = "mobility:dispatch:read";
|
|
521
|
+
/**
|
|
522
|
+
* Read a dispatch and its assignment in a company the request names in `tenantId`. A platform permission, held beside
|
|
523
|
+
* `mobility:dispatch:read` only by a product's operator-workspace key.
|
|
524
|
+
*/
|
|
525
|
+
UserPermission["MOBILITY_DISPATCH_READ_ANY"] = "mobility:dispatch:read-any";
|
|
504
526
|
/** Submit a dispatch request for a vertical-owned ride or delivery job. */
|
|
505
527
|
UserPermission["MOBILITY_DISPATCH_CREATE"] = "mobility:dispatch:create";
|
|
528
|
+
/**
|
|
529
|
+
* Submit a dispatch into a company the request names in `tenantId`. A platform permission, held beside
|
|
530
|
+
* `mobility:dispatch:create` only by a product's operator-workspace key. The dispatch is filed in, and offered only
|
|
531
|
+
* to the workers of, the company it names.
|
|
532
|
+
*/
|
|
533
|
+
UserPermission["MOBILITY_DISPATCH_CREATE_ANY"] = "mobility:dispatch:create-any";
|
|
506
534
|
/** Cancel, expire, or manually operate a dispatch; intentionally not granted to ordinary submitters. */
|
|
507
535
|
UserPermission["MOBILITY_DISPATCH_OPERATE"] = "mobility:dispatch:operate";
|
|
536
|
+
/**
|
|
537
|
+
* Cancel a dispatch or release an assignment in a company the request names in `tenantId`. A platform permission,
|
|
538
|
+
* held beside `mobility:dispatch:operate` only by a product's operator-workspace key.
|
|
539
|
+
*/
|
|
540
|
+
UserPermission["MOBILITY_DISPATCH_OPERATE_ANY"] = "mobility:dispatch:operate-any";
|
|
508
541
|
/** Read only the dispatch offers addressed to the caller's own worker profile. */
|
|
509
542
|
UserPermission["MOBILITY_DISPATCH_OFFER_READ"] = "mobility:dispatch-offer:read";
|
|
510
543
|
/** Accept or reject only an offer addressed to the caller's own worker profile. */
|
|
@@ -767,8 +800,14 @@ export const PLATFORM_PERMISSIONS = Object.freeze([
|
|
|
767
800
|
UserPermission.BILLING_USAGE_READ_ANY,
|
|
768
801
|
UserPermission.NOTIFICATION_SEND_ANY,
|
|
769
802
|
UserPermission.CHAT_EMBED_MANAGE_ANY,
|
|
803
|
+
UserPermission.PROFILE_READ_ANY,
|
|
770
804
|
UserPermission.REALTIME_SUBSCRIPTION_GRANT_ISSUE_ANY,
|
|
771
805
|
UserPermission.REALTIME_EVENT_PUBLISH_ANY,
|
|
806
|
+
UserPermission.MOBILITY_WORKER_READ_ANY,
|
|
807
|
+
UserPermission.MOBILITY_WORKER_RATING_SUBMIT_ANY,
|
|
808
|
+
UserPermission.MOBILITY_DISPATCH_READ_ANY,
|
|
809
|
+
UserPermission.MOBILITY_DISPATCH_CREATE_ANY,
|
|
810
|
+
UserPermission.MOBILITY_DISPATCH_OPERATE_ANY,
|
|
772
811
|
]);
|
|
773
812
|
/** Whether a permission acts across companies, and so may only be held in Iveri's operator workspace. */
|
|
774
813
|
export function isPlatformPermission(permission) {
|