@iveri/contracts 0.133.0 → 0.135.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.135.0` adds `conduit:dispatch:send-any` and `unibox:realtime:publish-any`, and an optional `tenantId` on
|
|
309
|
+
`SubmitDispatchBody` and `PublishConversationEventBody`, so Unibox sends replies and inbox hints for the company a
|
|
310
|
+
request names.
|
|
311
|
+
- Version `0.134.0` adds `delivery:job:create-any`, `delivery:job:read-any` and `delivery:job:operate-any`, so a shop's
|
|
312
|
+
and a restaurant's operator-workspace keys ask for, confirm and follow a courier in the company a request names.
|
|
308
313
|
- Version `0.131.0` adds `mobility:dispatch:create-any`, `mobility:dispatch:read-any`, `mobility:dispatch:operate-any`,
|
|
309
314
|
`mobility:worker:read-any` and `mobility:worker:rating:submit-any`, so taxi's and delivery's operator-workspace keys
|
|
310
315
|
dispatch, observe, release and rate in the company a request names.
|
|
@@ -117,6 +117,12 @@ export interface GetDispatchesQuery {
|
|
|
117
117
|
* target. Accepting a URL would make this an authenticated open proxy sitting inside our network.
|
|
118
118
|
*/
|
|
119
119
|
export interface SubmitDispatchBody {
|
|
120
|
+
/**
|
|
121
|
+
* The company to send for, when it is not the token's own. Accepted only from a token holding
|
|
122
|
+
* `conduit:dispatch:send-any` issued in Iveri's operator workspace; anything else naming one is a 403. The connection
|
|
123
|
+
* is looked up in the company named, so a dispatch can only ever leave through that company's own connections.
|
|
124
|
+
*/
|
|
125
|
+
tenantId?: UUID;
|
|
120
126
|
/** Which connection to send through, by its tenant-scoped key. */
|
|
121
127
|
connectionKey: string;
|
|
122
128
|
/** Which of the connector's operations to invoke, by key. */
|
|
@@ -23,12 +23,14 @@ export declare const MAX_REALTIME_EVENT_NAME_LENGTH = 128;
|
|
|
23
23
|
/**
|
|
24
24
|
* The body a publishing service POSTs to `unibox-realtime`.
|
|
25
25
|
*
|
|
26
|
-
* **
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
26
|
+
* **The tenant comes from the publisher's own access token**, so a company's own credential can only ever reach that
|
|
27
|
+
* company's subscribers. `tenantId` is the one exception, and it is not a body field anyone may fill: it is accepted
|
|
28
|
+
* only from a token holding `unibox:realtime:publish-any` issued in Iveri's operator workspace, and anything else naming
|
|
29
|
+
* one is a 403 rather than an event quietly published for the token's own company.
|
|
30
30
|
*/
|
|
31
31
|
export interface PublishConversationEventBody {
|
|
32
|
+
/** The company whose inbox hears the event, when it is not the token's own. See the interface comment. */
|
|
33
|
+
tenantId?: UUID;
|
|
32
34
|
conversationId: UUID;
|
|
33
35
|
event: RealtimeConversationEvent;
|
|
34
36
|
/** Identifiers only. Never message content — see {@link RealtimeConversationEvent}. */
|
|
@@ -148,6 +148,13 @@ export declare enum UserPermission {
|
|
|
148
148
|
CONDUIT_DISPATCH_SEND = "conduit:dispatch:send",
|
|
149
149
|
/** Redrive a dead-lettered dispatch, or cancel one still pending. */
|
|
150
150
|
CONDUIT_DISPATCH_OPERATE = "conduit:dispatch:operate",
|
|
151
|
+
/**
|
|
152
|
+
* Submit an outbound request for a company the request names in `tenantId`, rather than the token's own. A platform
|
|
153
|
+
* permission, held beside {@link UserPermission.CONDUIT_DISPATCH_SEND} only by a service credential in Iveri's
|
|
154
|
+
* operator workspace, so one product (`unibox-api`) sends each company's replies through that company's own
|
|
155
|
+
* connections. The connection is looked up in the named company, so it can never reach another company's.
|
|
156
|
+
*/
|
|
157
|
+
CONDUIT_DISPATCH_SEND_ANY = "conduit:dispatch:send-any",
|
|
151
158
|
/** Read the tenant's product catalog, including prices and availability. */
|
|
152
159
|
COMMERCE_CATALOG_READ = "commerce:catalog:read",
|
|
153
160
|
/** Create, edit, archive or restore products in the tenant's catalog. */
|
|
@@ -228,6 +235,12 @@ export declare enum UserPermission {
|
|
|
228
235
|
* reading the inbox over HTTP, because it is the same data arriving by another route.
|
|
229
236
|
*/
|
|
230
237
|
UNIBOX_REALTIME_PUBLISH = "unibox:realtime:publish",
|
|
238
|
+
/**
|
|
239
|
+
* Publish a conversation event into a company the request names in `tenantId`, rather than the token's own. A
|
|
240
|
+
* platform permission, held beside {@link UserPermission.UNIBOX_REALTIME_PUBLISH} only by `unibox-api`'s credential in
|
|
241
|
+
* Iveri's operator workspace, so each company's inbox hears its own conversations from one key.
|
|
242
|
+
*/
|
|
243
|
+
UNIBOX_REALTIME_PUBLISH_ANY = "unibox:realtime:publish-any",
|
|
231
244
|
/** Allows a trusted service principal to submit bounded conversation context for generation. */
|
|
232
245
|
UNIBOX_AI_RUN = "unibox:ai:run",
|
|
233
246
|
/** Read tenant MCP server metadata; credential values are never returned. */
|
|
@@ -494,10 +507,28 @@ export declare enum UserPermission {
|
|
|
494
507
|
TAXI_RIDE_DRIVE = "taxi:ride:drive",
|
|
495
508
|
/** Read delivery job and quote data in the caller's tenant; endpoints still check ownership. */
|
|
496
509
|
DELIVERY_JOB_READ = "delivery:job:read",
|
|
510
|
+
/**
|
|
511
|
+
* Read a delivery job in a company the request names in `tenantId`. A platform permission, held beside
|
|
512
|
+
* `delivery:job:read` only by a product's operator-workspace key, so a shop or a restaurant sold to many companies
|
|
513
|
+
* follows each company's parcel from one key.
|
|
514
|
+
*/
|
|
515
|
+
DELIVERY_JOB_READ_ANY = "delivery:job:read-any",
|
|
497
516
|
/** Create a delivery job and receive its quote. The sender-facing grant. */
|
|
498
517
|
DELIVERY_JOB_CREATE = "delivery:job:create",
|
|
518
|
+
/**
|
|
519
|
+
* Request and confirm a delivery job in a company the request names in `tenantId`. A platform permission, held
|
|
520
|
+
* beside `delivery:job:create` only by a product's operator-workspace key. The job is filed in, priced by and
|
|
521
|
+
* offered only to the couriers of the company it names, and counted against that company's Delivery licence.
|
|
522
|
+
*/
|
|
523
|
+
DELIVERY_JOB_CREATE_ANY = "delivery:job:create-any",
|
|
499
524
|
/** Confirm or cancel a delivery job; operator actions on another sender's job require this grant. */
|
|
500
525
|
DELIVERY_JOB_OPERATE = "delivery:job:operate",
|
|
526
|
+
/**
|
|
527
|
+
* Operate a named company's deliveries as that company, with no sender behind the job. A platform permission, held
|
|
528
|
+
* beside `delivery:job:operate` only by a product's operator-workspace key; without it, `delivery:job:operate`
|
|
529
|
+
* does not reach into a company a request names.
|
|
530
|
+
*/
|
|
531
|
+
DELIVERY_JOB_OPERATE_ANY = "delivery:job:operate-any",
|
|
501
532
|
/** Read and advance only jobs assigned to the caller's own courier worker. */
|
|
502
533
|
DELIVERY_JOB_DELIVER = "delivery:job:deliver",
|
|
503
534
|
/** Read a clinic's specialties, locations, rooms, devices, treatments and staff. */
|
|
@@ -167,6 +167,13 @@ export var UserPermission;
|
|
|
167
167
|
UserPermission["CONDUIT_DISPATCH_SEND"] = "conduit:dispatch:send";
|
|
168
168
|
/** Redrive a dead-lettered dispatch, or cancel one still pending. */
|
|
169
169
|
UserPermission["CONDUIT_DISPATCH_OPERATE"] = "conduit:dispatch:operate";
|
|
170
|
+
/**
|
|
171
|
+
* Submit an outbound request for a company the request names in `tenantId`, rather than the token's own. A platform
|
|
172
|
+
* permission, held beside {@link UserPermission.CONDUIT_DISPATCH_SEND} only by a service credential in Iveri's
|
|
173
|
+
* operator workspace, so one product (`unibox-api`) sends each company's replies through that company's own
|
|
174
|
+
* connections. The connection is looked up in the named company, so it can never reach another company's.
|
|
175
|
+
*/
|
|
176
|
+
UserPermission["CONDUIT_DISPATCH_SEND_ANY"] = "conduit:dispatch:send-any";
|
|
170
177
|
// ══ commerce-api ═════════════════════════════════════════════════════════
|
|
171
178
|
// ── Catalog ─────────────────────────────────────────────────────────────
|
|
172
179
|
/** Read the tenant's product catalog, including prices and availability. */
|
|
@@ -274,6 +281,12 @@ export var UserPermission;
|
|
|
274
281
|
* reading the inbox over HTTP, because it is the same data arriving by another route.
|
|
275
282
|
*/
|
|
276
283
|
UserPermission["UNIBOX_REALTIME_PUBLISH"] = "unibox:realtime:publish";
|
|
284
|
+
/**
|
|
285
|
+
* Publish a conversation event into a company the request names in `tenantId`, rather than the token's own. A
|
|
286
|
+
* platform permission, held beside {@link UserPermission.UNIBOX_REALTIME_PUBLISH} only by `unibox-api`'s credential in
|
|
287
|
+
* Iveri's operator workspace, so each company's inbox hears its own conversations from one key.
|
|
288
|
+
*/
|
|
289
|
+
UserPermission["UNIBOX_REALTIME_PUBLISH_ANY"] = "unibox:realtime:publish-any";
|
|
277
290
|
// ── AI runtime ──────────────────────────────────────────────────────────
|
|
278
291
|
/** Allows a trusted service principal to submit bounded conversation context for generation. */
|
|
279
292
|
UserPermission["UNIBOX_AI_RUN"] = "unibox:ai:run";
|
|
@@ -560,10 +573,28 @@ export var UserPermission;
|
|
|
560
573
|
// ══ delivery-api ═══════════════════════════════════════════════════════
|
|
561
574
|
/** Read delivery job and quote data in the caller's tenant; endpoints still check ownership. */
|
|
562
575
|
UserPermission["DELIVERY_JOB_READ"] = "delivery:job:read";
|
|
576
|
+
/**
|
|
577
|
+
* Read a delivery job in a company the request names in `tenantId`. A platform permission, held beside
|
|
578
|
+
* `delivery:job:read` only by a product's operator-workspace key, so a shop or a restaurant sold to many companies
|
|
579
|
+
* follows each company's parcel from one key.
|
|
580
|
+
*/
|
|
581
|
+
UserPermission["DELIVERY_JOB_READ_ANY"] = "delivery:job:read-any";
|
|
563
582
|
/** Create a delivery job and receive its quote. The sender-facing grant. */
|
|
564
583
|
UserPermission["DELIVERY_JOB_CREATE"] = "delivery:job:create";
|
|
584
|
+
/**
|
|
585
|
+
* Request and confirm a delivery job in a company the request names in `tenantId`. A platform permission, held
|
|
586
|
+
* beside `delivery:job:create` only by a product's operator-workspace key. The job is filed in, priced by and
|
|
587
|
+
* offered only to the couriers of the company it names, and counted against that company's Delivery licence.
|
|
588
|
+
*/
|
|
589
|
+
UserPermission["DELIVERY_JOB_CREATE_ANY"] = "delivery:job:create-any";
|
|
565
590
|
/** Confirm or cancel a delivery job; operator actions on another sender's job require this grant. */
|
|
566
591
|
UserPermission["DELIVERY_JOB_OPERATE"] = "delivery:job:operate";
|
|
592
|
+
/**
|
|
593
|
+
* Operate a named company's deliveries as that company, with no sender behind the job. A platform permission, held
|
|
594
|
+
* beside `delivery:job:operate` only by a product's operator-workspace key; without it, `delivery:job:operate`
|
|
595
|
+
* does not reach into a company a request names.
|
|
596
|
+
*/
|
|
597
|
+
UserPermission["DELIVERY_JOB_OPERATE_ANY"] = "delivery:job:operate-any";
|
|
567
598
|
/** Read and advance only jobs assigned to the caller's own courier worker. */
|
|
568
599
|
UserPermission["DELIVERY_JOB_DELIVER"] = "delivery:job:deliver";
|
|
569
600
|
// Clinic
|
|
@@ -808,6 +839,11 @@ export const PLATFORM_PERMISSIONS = Object.freeze([
|
|
|
808
839
|
UserPermission.MOBILITY_DISPATCH_READ_ANY,
|
|
809
840
|
UserPermission.MOBILITY_DISPATCH_CREATE_ANY,
|
|
810
841
|
UserPermission.MOBILITY_DISPATCH_OPERATE_ANY,
|
|
842
|
+
UserPermission.CONDUIT_DISPATCH_SEND_ANY,
|
|
843
|
+
UserPermission.UNIBOX_REALTIME_PUBLISH_ANY,
|
|
844
|
+
UserPermission.DELIVERY_JOB_READ_ANY,
|
|
845
|
+
UserPermission.DELIVERY_JOB_CREATE_ANY,
|
|
846
|
+
UserPermission.DELIVERY_JOB_OPERATE_ANY,
|
|
811
847
|
]);
|
|
812
848
|
/** Whether a permission acts across companies, and so may only be held in Iveri's operator workspace. */
|
|
813
849
|
export function isPlatformPermission(permission) {
|