@iveri/contracts 0.6.0 → 0.8.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 +30 -6
- package/dist/cjs/api/identity/access-token-payload.interface.d.ts +53 -0
- package/dist/cjs/api/identity/access-token-payload.interface.d.ts.map +1 -0
- package/dist/cjs/api/identity/access-token-payload.interface.js +3 -0
- package/dist/cjs/api/identity/access-token-payload.interface.js.map +1 -0
- package/dist/cjs/api/identity/auth.type.d.ts +21 -0
- package/dist/cjs/api/identity/auth.type.d.ts.map +1 -1
- package/dist/cjs/api/identity/index.d.ts +2 -0
- package/dist/cjs/api/identity/index.d.ts.map +1 -1
- package/dist/cjs/api/identity/index.js +2 -0
- package/dist/cjs/api/identity/index.js.map +1 -1
- package/dist/cjs/api/identity/principal-type.enum.d.ts +19 -0
- package/dist/cjs/api/identity/principal-type.enum.d.ts.map +1 -0
- package/dist/cjs/api/identity/principal-type.enum.js +23 -0
- package/dist/cjs/api/identity/principal-type.enum.js.map +1 -0
- package/dist/cjs/api/unibox/canned-reply.type.d.ts +49 -0
- package/dist/cjs/api/unibox/canned-reply.type.d.ts.map +1 -0
- package/dist/cjs/api/unibox/canned-reply.type.js +3 -0
- package/dist/cjs/api/unibox/canned-reply.type.js.map +1 -0
- package/dist/cjs/api/unibox/channel-platform.enum.d.ts +32 -0
- package/dist/cjs/api/unibox/channel-platform.enum.d.ts.map +1 -0
- package/dist/cjs/api/unibox/channel-platform.enum.js +36 -0
- package/dist/cjs/api/unibox/channel-platform.enum.js.map +1 -0
- package/dist/cjs/api/unibox/channel.type.d.ts +110 -0
- package/dist/cjs/api/unibox/channel.type.d.ts.map +1 -0
- package/dist/cjs/api/unibox/channel.type.js +3 -0
- package/dist/cjs/api/unibox/channel.type.js.map +1 -0
- package/dist/cjs/api/unibox/contact.type.d.ts +102 -0
- package/dist/cjs/api/unibox/contact.type.d.ts.map +1 -0
- package/dist/cjs/api/unibox/contact.type.js +3 -0
- package/dist/cjs/api/unibox/contact.type.js.map +1 -0
- package/dist/cjs/api/unibox/conversation-status.enum.d.ts +39 -0
- package/dist/cjs/api/unibox/conversation-status.enum.d.ts.map +1 -0
- package/dist/cjs/api/unibox/conversation-status.enum.js +43 -0
- package/dist/cjs/api/unibox/conversation-status.enum.js.map +1 -0
- package/dist/cjs/api/unibox/conversation.type.d.ts +134 -0
- package/dist/cjs/api/unibox/conversation.type.d.ts.map +1 -0
- package/dist/cjs/api/unibox/conversation.type.js +3 -0
- package/dist/cjs/api/unibox/conversation.type.js.map +1 -0
- package/dist/cjs/api/unibox/index.d.ts +13 -0
- package/dist/cjs/api/unibox/index.d.ts.map +1 -0
- package/dist/cjs/api/unibox/index.js +29 -0
- package/dist/cjs/api/unibox/index.js.map +1 -0
- package/dist/cjs/api/unibox/message-author-type.enum.d.ts +26 -0
- package/dist/cjs/api/unibox/message-author-type.enum.d.ts.map +1 -0
- package/dist/cjs/api/unibox/message-author-type.enum.js +30 -0
- package/dist/cjs/api/unibox/message-author-type.enum.js.map +1 -0
- package/dist/cjs/api/unibox/message-content-type.enum.d.ts +29 -0
- package/dist/cjs/api/unibox/message-content-type.enum.d.ts.map +1 -0
- package/dist/cjs/api/unibox/message-content-type.enum.js +33 -0
- package/dist/cjs/api/unibox/message-content-type.enum.js.map +1 -0
- package/dist/cjs/api/unibox/message-direction.enum.d.ts +23 -0
- package/dist/cjs/api/unibox/message-direction.enum.d.ts.map +1 -0
- package/dist/cjs/api/unibox/message-direction.enum.js +27 -0
- package/dist/cjs/api/unibox/message-direction.enum.js.map +1 -0
- package/dist/cjs/api/unibox/message-status.enum.d.ts +40 -0
- package/dist/cjs/api/unibox/message-status.enum.d.ts.map +1 -0
- package/dist/cjs/api/unibox/message-status.enum.js +44 -0
- package/dist/cjs/api/unibox/message-status.enum.js.map +1 -0
- package/dist/cjs/api/unibox/message.type.d.ts +120 -0
- package/dist/cjs/api/unibox/message.type.d.ts.map +1 -0
- package/dist/cjs/api/unibox/message.type.js +3 -0
- package/dist/cjs/api/unibox/message.type.js.map +1 -0
- package/dist/cjs/api/unibox/team.type.d.ts +50 -0
- package/dist/cjs/api/unibox/team.type.d.ts.map +1 -0
- package/dist/cjs/api/unibox/team.type.js +3 -0
- package/dist/cjs/api/unibox/team.type.js.map +1 -0
- package/dist/cjs/enum/user-permission.enum.d.ts +48 -1
- package/dist/cjs/enum/user-permission.enum.d.ts.map +1 -1
- package/dist/cjs/enum/user-permission.enum.js +54 -0
- package/dist/cjs/enum/user-permission.enum.js.map +1 -1
- package/dist/esm/api/identity/access-token-payload.interface.d.ts +53 -0
- package/dist/esm/api/identity/access-token-payload.interface.d.ts.map +1 -0
- package/dist/esm/api/identity/access-token-payload.interface.js +2 -0
- package/dist/esm/api/identity/access-token-payload.interface.js.map +1 -0
- package/dist/esm/api/identity/auth.type.d.ts +21 -0
- package/dist/esm/api/identity/auth.type.d.ts.map +1 -1
- package/dist/esm/api/identity/index.d.ts +2 -0
- package/dist/esm/api/identity/index.d.ts.map +1 -1
- package/dist/esm/api/identity/index.js +2 -0
- package/dist/esm/api/identity/index.js.map +1 -1
- package/dist/esm/api/identity/principal-type.enum.d.ts +19 -0
- package/dist/esm/api/identity/principal-type.enum.d.ts.map +1 -0
- package/dist/esm/api/identity/principal-type.enum.js +20 -0
- package/dist/esm/api/identity/principal-type.enum.js.map +1 -0
- package/dist/esm/api/unibox/canned-reply.type.d.ts +49 -0
- package/dist/esm/api/unibox/canned-reply.type.d.ts.map +1 -0
- package/dist/esm/api/unibox/canned-reply.type.js +2 -0
- package/dist/esm/api/unibox/canned-reply.type.js.map +1 -0
- package/dist/esm/api/unibox/channel-platform.enum.d.ts +32 -0
- package/dist/esm/api/unibox/channel-platform.enum.d.ts.map +1 -0
- package/dist/esm/api/unibox/channel-platform.enum.js +33 -0
- package/dist/esm/api/unibox/channel-platform.enum.js.map +1 -0
- package/dist/esm/api/unibox/channel.type.d.ts +110 -0
- package/dist/esm/api/unibox/channel.type.d.ts.map +1 -0
- package/dist/esm/api/unibox/channel.type.js +2 -0
- package/dist/esm/api/unibox/channel.type.js.map +1 -0
- package/dist/esm/api/unibox/contact.type.d.ts +102 -0
- package/dist/esm/api/unibox/contact.type.d.ts.map +1 -0
- package/dist/esm/api/unibox/contact.type.js +2 -0
- package/dist/esm/api/unibox/contact.type.js.map +1 -0
- package/dist/esm/api/unibox/conversation-status.enum.d.ts +39 -0
- package/dist/esm/api/unibox/conversation-status.enum.d.ts.map +1 -0
- package/dist/esm/api/unibox/conversation-status.enum.js +40 -0
- package/dist/esm/api/unibox/conversation-status.enum.js.map +1 -0
- package/dist/esm/api/unibox/conversation.type.d.ts +134 -0
- package/dist/esm/api/unibox/conversation.type.d.ts.map +1 -0
- package/dist/esm/api/unibox/conversation.type.js +2 -0
- package/dist/esm/api/unibox/conversation.type.js.map +1 -0
- package/dist/esm/api/unibox/index.d.ts +13 -0
- package/dist/esm/api/unibox/index.d.ts.map +1 -0
- package/dist/esm/api/unibox/index.js +13 -0
- package/dist/esm/api/unibox/index.js.map +1 -0
- package/dist/esm/api/unibox/message-author-type.enum.d.ts +26 -0
- package/dist/esm/api/unibox/message-author-type.enum.d.ts.map +1 -0
- package/dist/esm/api/unibox/message-author-type.enum.js +27 -0
- package/dist/esm/api/unibox/message-author-type.enum.js.map +1 -0
- package/dist/esm/api/unibox/message-content-type.enum.d.ts +29 -0
- package/dist/esm/api/unibox/message-content-type.enum.d.ts.map +1 -0
- package/dist/esm/api/unibox/message-content-type.enum.js +30 -0
- package/dist/esm/api/unibox/message-content-type.enum.js.map +1 -0
- package/dist/esm/api/unibox/message-direction.enum.d.ts +23 -0
- package/dist/esm/api/unibox/message-direction.enum.d.ts.map +1 -0
- package/dist/esm/api/unibox/message-direction.enum.js +24 -0
- package/dist/esm/api/unibox/message-direction.enum.js.map +1 -0
- package/dist/esm/api/unibox/message-status.enum.d.ts +40 -0
- package/dist/esm/api/unibox/message-status.enum.d.ts.map +1 -0
- package/dist/esm/api/unibox/message-status.enum.js +41 -0
- package/dist/esm/api/unibox/message-status.enum.js.map +1 -0
- package/dist/esm/api/unibox/message.type.d.ts +120 -0
- package/dist/esm/api/unibox/message.type.d.ts.map +1 -0
- package/dist/esm/api/unibox/message.type.js +2 -0
- package/dist/esm/api/unibox/message.type.js.map +1 -0
- package/dist/esm/api/unibox/team.type.d.ts +50 -0
- package/dist/esm/api/unibox/team.type.d.ts.map +1 -0
- package/dist/esm/api/unibox/team.type.js +2 -0
- package/dist/esm/api/unibox/team.type.js.map +1 -0
- package/dist/esm/enum/user-permission.enum.d.ts +48 -1
- package/dist/esm/enum/user-permission.enum.d.ts.map +1 -1
- package/dist/esm/enum/user-permission.enum.js +54 -0
- package/dist/esm/enum/user-permission.enum.js.map +1 -1
- package/package.json +9 -1
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import type { CursorPage } from '../../type/cursor-page.type.js';
|
|
2
|
+
import type { IsoDateTime } from '../../type/iso-date-time.type.js';
|
|
3
|
+
import type { Nullable } from '../../type/nil.type.js';
|
|
4
|
+
import type { UUID } from '../../type/uuid.type.js';
|
|
5
|
+
import type { MessageAuthorType } from './message-author-type.enum.js';
|
|
6
|
+
import type { MessageContentType } from './message-content-type.enum.js';
|
|
7
|
+
import type { MessageDirection } from './message-direction.enum.js';
|
|
8
|
+
import type { MessageStatus } from './message-status.enum.js';
|
|
9
|
+
/** A file attached to a message. Media is referenced by provider URL until `iveri-files-api` exists. */
|
|
10
|
+
export interface MessageAttachment {
|
|
11
|
+
contentType: MessageContentType;
|
|
12
|
+
/**
|
|
13
|
+
* Where the media lives.
|
|
14
|
+
*
|
|
15
|
+
* Today this is the provider's own URL, which for most platforms is short-lived and requires
|
|
16
|
+
* the channel's credentials to fetch — so it is not something a browser can render directly.
|
|
17
|
+
* Re-hosting is `iveri-files-api`'s job (build-order step 10 territory), and this field is
|
|
18
|
+
* what will point at it instead.
|
|
19
|
+
*/
|
|
20
|
+
url: Nullable<string>;
|
|
21
|
+
/** The provider's media id, which is what a re-host job would need to fetch it. */
|
|
22
|
+
externalMediaId: Nullable<string>;
|
|
23
|
+
fileName: Nullable<string>;
|
|
24
|
+
mimeType: Nullable<string>;
|
|
25
|
+
sizeBytes: Nullable<number>;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* One message in a conversation.
|
|
29
|
+
*
|
|
30
|
+
* Immutable once written, apart from `status` and its timestamps. An inbox is a record of what was
|
|
31
|
+
* said, and an editable one is not evidence of anything — which matters the first time a customer
|
|
32
|
+
* disputes what they were told.
|
|
33
|
+
*/
|
|
34
|
+
export interface Message {
|
|
35
|
+
id: UUID;
|
|
36
|
+
conversationId: UUID;
|
|
37
|
+
direction: MessageDirection;
|
|
38
|
+
authorType: MessageAuthorType;
|
|
39
|
+
/** The agent who wrote it. Null for anything not authored by a human. */
|
|
40
|
+
authorUserId: Nullable<UUID>;
|
|
41
|
+
contentType: MessageContentType;
|
|
42
|
+
/** The text, or a caption on a media message. Null when there was none. */
|
|
43
|
+
text: Nullable<string>;
|
|
44
|
+
attachments: MessageAttachment[];
|
|
45
|
+
status: MessageStatus;
|
|
46
|
+
/** Why a `FAILED` message failed, in words an agent can act on. Null otherwise. */
|
|
47
|
+
failureReason: Nullable<string>;
|
|
48
|
+
/**
|
|
49
|
+
* The provider's own message id.
|
|
50
|
+
*
|
|
51
|
+
* Inbound, this is the **idempotency key**: Conduit is at-least-once by design and a
|
|
52
|
+
* redelivered webhook must not produce a second message. Outbound, it arrives with the
|
|
53
|
+
* provider's acceptance and is what a later status webhook is matched against.
|
|
54
|
+
*/
|
|
55
|
+
externalMessageId: Nullable<string>;
|
|
56
|
+
/**
|
|
57
|
+
* The Conduit dispatch this send was submitted as.
|
|
58
|
+
*
|
|
59
|
+
* Kept so a dead letter in Conduit's outbound DLQ can be traced back to the message an agent
|
|
60
|
+
* is looking at. Conduit puts `x-conduit-dispatch-id` on every send for the same reason from
|
|
61
|
+
* the other end.
|
|
62
|
+
*/
|
|
63
|
+
dispatchId: Nullable<UUID>;
|
|
64
|
+
/**
|
|
65
|
+
* When the message was said, according to the provider — not when we stored it.
|
|
66
|
+
*
|
|
67
|
+
* These differ by however long a provider queued a webhook, which after an outage is hours.
|
|
68
|
+
* Ordering the thread by arrival would then shuffle a conversation into nonsense, so this is
|
|
69
|
+
* what the thread sorts on.
|
|
70
|
+
*/
|
|
71
|
+
sentAt: IsoDateTime;
|
|
72
|
+
deliveredAt: Nullable<IsoDateTime>;
|
|
73
|
+
readAt: Nullable<IsoDateTime>;
|
|
74
|
+
createdAt: IsoDateTime;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* `GET /api/v1/conversations/:id/messages`. Cursor-paged, **newest first**.
|
|
78
|
+
*
|
|
79
|
+
* Newest first because that is what a thread opens to, and because paging backwards through
|
|
80
|
+
* history is the direction a scroll actually goes. The client reverses a page to render it.
|
|
81
|
+
*/
|
|
82
|
+
export type MessagesPage = CursorPage<Message>;
|
|
83
|
+
/** Query for `GET /api/v1/conversations/:id/messages`. */
|
|
84
|
+
export interface GetMessagesQuery {
|
|
85
|
+
limit?: number;
|
|
86
|
+
/** Opaque cursor from the previous page's `nextCursor`. Never parse it. */
|
|
87
|
+
before?: Nullable<string>;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* `POST /api/v1/conversations/:id/messages` — an agent replying.
|
|
91
|
+
*
|
|
92
|
+
* Note what is absent: no channel, no recipient, no provider fields. The conversation already
|
|
93
|
+
* knows which channel it is on and who the contact is, and letting a caller restate either would
|
|
94
|
+
* be a way to send a message to one person through another person's thread.
|
|
95
|
+
*/
|
|
96
|
+
export interface SendMessageBody {
|
|
97
|
+
/** The reply text. Required for `TEXT`; a caption otherwise. */
|
|
98
|
+
text?: Nullable<string>;
|
|
99
|
+
contentType?: Nullable<MessageContentType>;
|
|
100
|
+
attachments?: Nullable<MessageAttachment[]>;
|
|
101
|
+
/**
|
|
102
|
+
* The caller's idempotency key, scoped to the conversation.
|
|
103
|
+
*
|
|
104
|
+
* **Strongly recommended, and forwarded to Conduit as its dispatch key.** Without one, an
|
|
105
|
+
* agent double-clicking Send messages the customer twice — and unlike an inbound duplicate,
|
|
106
|
+
* which is evidence, an outbound duplicate is a mistake the customer sees.
|
|
107
|
+
*/
|
|
108
|
+
idempotencyKey?: Nullable<string>;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* `POST /api/v1/conversations/:id/notes` — a private note in the thread.
|
|
112
|
+
*
|
|
113
|
+
* A separate endpoint from sending rather than a flag on {@link SendMessageBody}, because the
|
|
114
|
+
* difference between "the customer reads this" and "only we read this" must not be one boolean
|
|
115
|
+
* away from being wrong. It also carries a different permission: writing a note is not sending.
|
|
116
|
+
*/
|
|
117
|
+
export interface AddNoteBody {
|
|
118
|
+
text: string;
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=message.type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message.type.d.ts","sourceRoot":"","sources":["../../../../src/api/unibox/message.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D,wGAAwG;AACxG,MAAM,WAAW,iBAAiB;IAC9B,WAAW,EAAE,kBAAkB,CAAC;IAEhC;;;;;;;OAOG;IACH,GAAG,EAAE,QAAQ,CAAC,M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,CAAC,MAAM,CAAC,CAAC;CAC7B;AAED;;;;;;GAMG;AACH,MAAM,WAAW,eAAe;IAC5B,gEAAgE;IAChE,IAAI,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAExB,WAAW,CAAC,EAAE,QAAQ,CAAC,kBAAkB,CAAC,CAAC;IAE3C,WAAW,CAAC,EAAE,QAAQ,CAAC,iBAAiB,EAAE,CAAC,CAAC;IAE5C;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;CACrC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,WAAW;IACxB,IAAI,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message.type.js","sourceRoot":"","sources":["../../../../src/api/unibox/message.type.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { IsoDateTime } from '../../type/iso-date-time.type.js';
|
|
2
|
+
import type { Nullable } from '../../type/nil.type.js';
|
|
3
|
+
import type { Paginated } from '../../type/paginated.type.js';
|
|
4
|
+
import type { UUID } from '../../type/uuid.type.js';
|
|
5
|
+
/**
|
|
6
|
+
* A group of agents work is routed to — Support, Sales, Billing.
|
|
7
|
+
*
|
|
8
|
+
* **A team is not a role and not a membership.** Identity owns who exists and what they may do;
|
|
9
|
+
* this owns who is expected to answer what. Keeping them apart is what lets an agent be moved
|
|
10
|
+
* between teams without touching their permissions, which is the operation that actually happens
|
|
11
|
+
* weekly.
|
|
12
|
+
*
|
|
13
|
+
* `memberUserIds` names users in `iveri-identity-api`, so it is a loose reference with no foreign
|
|
14
|
+
* key. A user removed there leaves a stale id here; Unibox filters those out when resolving a
|
|
15
|
+
* team rather than pretending it can prevent them.
|
|
16
|
+
*/
|
|
17
|
+
export interface Team {
|
|
18
|
+
id: UUID;
|
|
19
|
+
name: string;
|
|
20
|
+
description: Nullable<string>;
|
|
21
|
+
/** Identity user ids. Order is not meaningful. */
|
|
22
|
+
memberUserIds: UUID[];
|
|
23
|
+
/**
|
|
24
|
+
* Conversations on these channels are routed to this team when nothing else claims them.
|
|
25
|
+
*
|
|
26
|
+
* Empty means the team takes no automatic routing and is assignment-only. Deliberately a list
|
|
27
|
+
* on the team rather than a team id on the channel: a channel routed to two teams during a
|
|
28
|
+
* handover period is a real thing customers ask for, and the other direction cannot express it.
|
|
29
|
+
*/
|
|
30
|
+
channelIds: UUID[];
|
|
31
|
+
createdAt: IsoDateTime;
|
|
32
|
+
updatedAt: IsoDateTime;
|
|
33
|
+
}
|
|
34
|
+
/** `GET /api/v1/teams`. Offset-paged; a tenant has a handful. */
|
|
35
|
+
export type TeamsPage = Paginated<Team>;
|
|
36
|
+
/** `POST /api/v1/teams`. */
|
|
37
|
+
export interface CreateTeamBody {
|
|
38
|
+
name: string;
|
|
39
|
+
description?: Nullable<string>;
|
|
40
|
+
memberUserIds?: Nullable<UUID[]>;
|
|
41
|
+
channelIds?: Nullable<UUID[]>;
|
|
42
|
+
}
|
|
43
|
+
/** `PATCH /api/v1/teams/:id`. Both id lists replace wholesale; omit to leave alone, `[]` clears. */
|
|
44
|
+
export interface UpdateTeamBody {
|
|
45
|
+
name?: string;
|
|
46
|
+
description?: Nullable<string>;
|
|
47
|
+
memberUserIds?: Nullable<UUID[]>;
|
|
48
|
+
channelIds?: Nullable<UUID[]>;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=team.type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"team.type.d.ts","sourceRoot":"","sources":["../../../../src/api/unibox/team.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAEpD;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,IAAI;IACjB,EAAE,EAAE,IAAI,CAAC;IAET,IAAI,EAAE,MAAM,CAAC;IAEb,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAE9B,kDAAkD;IAClD,aAAa,EAAE,IAAI,EAAE,CAAC;IAEtB;;;;;;OAMG;IACH,UAAU,EAAE,IAAI,EAAE,CAAC;IAEnB,SAAS,EAAE,WAAW,CAAC;IACvB,SAAS,EAAE,WAAW,CAAC;CAC1B;AAED,iEAAiE;AACjE,MAAM,MAAM,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;AAExC,4BAA4B;AAC5B,MAAM,WAAW,cAAc;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC/B,aAAa,CAAC,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;IACjC,UAAU,CAAC,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;CACjC;AAED,oGAAoG;AACpG,MAAM,WAAW,cAAc;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC/B,aAAa,CAAC,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;IACjC,UAAU,CAAC,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;CACjC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"team.type.js","sourceRoot":"","sources":["../../../../src/api/unibox/team.type.ts"],"names":[],"mappings":""}
|
|
@@ -128,7 +128,54 @@ export declare enum UserPermission {
|
|
|
128
128
|
*/
|
|
129
129
|
CONDUIT_DISPATCH_SEND = "conduit:dispatch:send",
|
|
130
130
|
/** Redrive a dead-lettered dispatch, or cancel one still pending. */
|
|
131
|
-
CONDUIT_DISPATCH_OPERATE = "conduit:dispatch:operate"
|
|
131
|
+
CONDUIT_DISPATCH_OPERATE = "conduit:dispatch:operate",
|
|
132
|
+
/** Read connected messaging accounts. Never exposes a channel's ingest secret. */
|
|
133
|
+
UNIBOX_CHANNEL_READ = "unibox:channel:read",
|
|
134
|
+
/**
|
|
135
|
+
* Connect, amend or disconnect a messaging account, and rotate its ingest secret.
|
|
136
|
+
*
|
|
137
|
+
* A single manage permission for the same reason as `CONDUIT_CONNECTION_MANAGE`: the
|
|
138
|
+
* dangerous act is holding the credential that lets anything post messages into a tenant's
|
|
139
|
+
* inbox, and create/update/delete carry that identically.
|
|
140
|
+
*/
|
|
141
|
+
UNIBOX_CHANNEL_MANAGE = "unibox:channel:manage",
|
|
142
|
+
/** Read contacts. Personal data — closer to a data-export permission than a config one. */
|
|
143
|
+
UNIBOX_CONTACT_READ = "unibox:contact:read",
|
|
144
|
+
/** Create, amend or delete a contact record. */
|
|
145
|
+
UNIBOX_CONTACT_MANAGE = "unibox:contact:manage",
|
|
146
|
+
/**
|
|
147
|
+
* Read the inbox and every message in it.
|
|
148
|
+
*
|
|
149
|
+
* **There is deliberately no separate `unibox:message:read`.** A conversation with its
|
|
150
|
+
* messages hidden is an empty row, so a permission that granted one without the other would
|
|
151
|
+
* describe a screen nobody can use — and the reverse would be a way to read a customer's
|
|
152
|
+
* messages while appearing to have no access to the inbox.
|
|
153
|
+
*/
|
|
154
|
+
UNIBOX_CONVERSATION_READ = "unibox:conversation:read",
|
|
155
|
+
/** Change a conversation's status — close, snooze, reopen — and write internal notes. */
|
|
156
|
+
UNIBOX_CONVERSATION_MANAGE = "unibox:conversation:manage",
|
|
157
|
+
/**
|
|
158
|
+
* Assign a conversation to an agent or a team, and take over from the AI.
|
|
159
|
+
*
|
|
160
|
+
* Separate from `UNIBOX_CONVERSATION_MANAGE` because assignment decides whose work this is.
|
|
161
|
+
* A supervisor routing a queue and an agent closing their own conversations are different
|
|
162
|
+
* jobs, and a tenant that wants only the first to reassign should be able to say so.
|
|
163
|
+
*/
|
|
164
|
+
UNIBOX_CONVERSATION_ASSIGN = "unibox:conversation:assign",
|
|
165
|
+
/**
|
|
166
|
+
* Send a message to a contact.
|
|
167
|
+
*
|
|
168
|
+
* The sharpest permission in this service, and the reason there is no `unibox:message:*`
|
|
169
|
+
* read counterpart. Everything else here moves rows around inside our own database; this one
|
|
170
|
+
* reaches a real person on their phone, through a paid channel, and cannot be taken back.
|
|
171
|
+
*/
|
|
172
|
+
UNIBOX_MESSAGE_SEND = "unibox:message:send",
|
|
173
|
+
UNIBOX_TEAM_READ = "unibox:team:read",
|
|
174
|
+
/** Create teams and change who is in them. Routing, not permissions — identity owns those. */
|
|
175
|
+
UNIBOX_TEAM_MANAGE = "unibox:team:manage",
|
|
176
|
+
UNIBOX_CANNED_REPLY_READ = "unibox:canned-reply:read",
|
|
177
|
+
/** Author the saved replies every agent in the tenant will send. */
|
|
178
|
+
UNIBOX_CANNED_REPLY_MANAGE = "unibox:canned-reply:manage"
|
|
132
179
|
}
|
|
133
180
|
/**
|
|
134
181
|
* Every member, for seeding the owner role and validating custom-role input.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-permission.enum.d.ts","sourceRoot":"","sources":["../../../src/enum/user-permission.enum.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,oBAAY,cAAc;IAItB,WAAW,gBAAgB;IAC3B,aAAa,kBAAkB;IAC/B,sFAAsF;IACtF,aAAa,kBAAkB;IAG/B,SAAS,cAAc;IACvB,WAAW,gBAAgB;IAC3B,WAAW,gBAAgB;IAC3B,WAAW,gBAAgB;IAG3B,eAAe,oBAAoB;IACnC,6EAA6E;IAC7E,iBAAiB,sBAAsB;IACvC;;;OAGG;IACH,sBAAsB,2BAA2B;IAGjD,SAAS,cAAc;IACvB,WAAW,gBAAgB;IAC3B,WAAW,gBAAgB;IAC3B,WAAW,gBAAgB;IAG3B,YAAY,iBAAiB;IAC7B,aAAa,kBAAkB;IAC/B,cAAc,mBAAmB;IAKjC,qEAAqE;IACrE,qBAAqB,0BAA0B;IAC/C,uBAAuB,4BAA4B;IACnD,uBAAuB,4BAA4B;IACnD,uBAAuB,4BAA4B;IAGnD;;;;OAIG;IACH,oBAAoB,yBAAyB;IAC7C,sBAAsB,2BAA2B;IAGjD;;;;OAIG;IACH,sBAAsB,2BAA2B;IAGjD,qBAAqB,0BAA0B;IAC/C,yFAAyF;IACzF,uBAAuB,4BAA4B;IAGnD,mEAAmE;IACnE,wBAAwB,6BAA6B;IACrD;;;;;;;OAOG;IACH,0BAA0B,+BAA+B;IAGzD,kBAAkB,uBAAuB;IACzC,2DAA2D;IAC3D,oBAAoB,yBAAyB;IAG7C;;;;;OAKG;IACH,qBAAqB,0BAA0B;IAC/C;;;;;;OAMG;IACH,wBAAwB,6BAA6B;IAGrD,wFAAwF;IACxF,sBAAsB,2BAA2B;IACjD;;;;;;;;OAQG;IACH,wBAAwB,6BAA6B;IAGrD,sEAAsE;IACtE,uBAAuB,4BAA4B;IACnD;;;;;OAKG;IACH,yBAAyB,8BAA8B;IAGvD;;;;;OAKG;IACH,qBAAqB,0BAA0B;IAC/C;;;;;;;OAOG;IACH,qBAAqB,0BAA0B;IAC/C,qEAAqE;IACrE,wBAAwB,6BAA6B;
|
|
1
|
+
{"version":3,"file":"user-permission.enum.d.ts","sourceRoot":"","sources":["../../../src/enum/user-permission.enum.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,oBAAY,cAAc;IAItB,WAAW,gBAAgB;IAC3B,aAAa,kBAAkB;IAC/B,sFAAsF;IACtF,aAAa,kBAAkB;IAG/B,SAAS,cAAc;IACvB,WAAW,gBAAgB;IAC3B,WAAW,gBAAgB;IAC3B,WAAW,gBAAgB;IAG3B,eAAe,oBAAoB;IACnC,6EAA6E;IAC7E,iBAAiB,sBAAsB;IACvC;;;OAGG;IACH,sBAAsB,2BAA2B;IAGjD,SAAS,cAAc;IACvB,WAAW,gBAAg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FAA8F;IAC9F,kBAAkB,uBAAuB;IAGzC,wBAAwB,6BAA6B;IACrD,oEAAoE;IACpE,0BAA0B,+BAA+B;CAC5D;AAED;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,EAAE,SAAS,cAAc,EAAiD,CAAC"}
|
|
@@ -150,6 +150,60 @@ var UserPermission;
|
|
|
150
150
|
UserPermission["CONDUIT_DISPATCH_SEND"] = "conduit:dispatch:send";
|
|
151
151
|
/** Redrive a dead-lettered dispatch, or cancel one still pending. */
|
|
152
152
|
UserPermission["CONDUIT_DISPATCH_OPERATE"] = "conduit:dispatch:operate";
|
|
153
|
+
// ══ unibox-api ═══════════════════════════════════════════════════════════
|
|
154
|
+
// ── Channel ─────────────────────────────────────────────────────────────
|
|
155
|
+
/** Read connected messaging accounts. Never exposes a channel's ingest secret. */
|
|
156
|
+
UserPermission["UNIBOX_CHANNEL_READ"] = "unibox:channel:read";
|
|
157
|
+
/**
|
|
158
|
+
* Connect, amend or disconnect a messaging account, and rotate its ingest secret.
|
|
159
|
+
*
|
|
160
|
+
* A single manage permission for the same reason as `CONDUIT_CONNECTION_MANAGE`: the
|
|
161
|
+
* dangerous act is holding the credential that lets anything post messages into a tenant's
|
|
162
|
+
* inbox, and create/update/delete carry that identically.
|
|
163
|
+
*/
|
|
164
|
+
UserPermission["UNIBOX_CHANNEL_MANAGE"] = "unibox:channel:manage";
|
|
165
|
+
// ── Contact ─────────────────────────────────────────────────────────────
|
|
166
|
+
/** Read contacts. Personal data — closer to a data-export permission than a config one. */
|
|
167
|
+
UserPermission["UNIBOX_CONTACT_READ"] = "unibox:contact:read";
|
|
168
|
+
/** Create, amend or delete a contact record. */
|
|
169
|
+
UserPermission["UNIBOX_CONTACT_MANAGE"] = "unibox:contact:manage";
|
|
170
|
+
// ── Conversation ────────────────────────────────────────────────────────
|
|
171
|
+
/**
|
|
172
|
+
* Read the inbox and every message in it.
|
|
173
|
+
*
|
|
174
|
+
* **There is deliberately no separate `unibox:message:read`.** A conversation with its
|
|
175
|
+
* messages hidden is an empty row, so a permission that granted one without the other would
|
|
176
|
+
* describe a screen nobody can use — and the reverse would be a way to read a customer's
|
|
177
|
+
* messages while appearing to have no access to the inbox.
|
|
178
|
+
*/
|
|
179
|
+
UserPermission["UNIBOX_CONVERSATION_READ"] = "unibox:conversation:read";
|
|
180
|
+
/** Change a conversation's status — close, snooze, reopen — and write internal notes. */
|
|
181
|
+
UserPermission["UNIBOX_CONVERSATION_MANAGE"] = "unibox:conversation:manage";
|
|
182
|
+
/**
|
|
183
|
+
* Assign a conversation to an agent or a team, and take over from the AI.
|
|
184
|
+
*
|
|
185
|
+
* Separate from `UNIBOX_CONVERSATION_MANAGE` because assignment decides whose work this is.
|
|
186
|
+
* A supervisor routing a queue and an agent closing their own conversations are different
|
|
187
|
+
* jobs, and a tenant that wants only the first to reassign should be able to say so.
|
|
188
|
+
*/
|
|
189
|
+
UserPermission["UNIBOX_CONVERSATION_ASSIGN"] = "unibox:conversation:assign";
|
|
190
|
+
// ── Message ─────────────────────────────────────────────────────────────
|
|
191
|
+
/**
|
|
192
|
+
* Send a message to a contact.
|
|
193
|
+
*
|
|
194
|
+
* The sharpest permission in this service, and the reason there is no `unibox:message:*`
|
|
195
|
+
* read counterpart. Everything else here moves rows around inside our own database; this one
|
|
196
|
+
* reaches a real person on their phone, through a paid channel, and cannot be taken back.
|
|
197
|
+
*/
|
|
198
|
+
UserPermission["UNIBOX_MESSAGE_SEND"] = "unibox:message:send";
|
|
199
|
+
// ── Team ────────────────────────────────────────────────────────────────
|
|
200
|
+
UserPermission["UNIBOX_TEAM_READ"] = "unibox:team:read";
|
|
201
|
+
/** Create teams and change who is in them. Routing, not permissions — identity owns those. */
|
|
202
|
+
UserPermission["UNIBOX_TEAM_MANAGE"] = "unibox:team:manage";
|
|
203
|
+
// ── Canned reply ────────────────────────────────────────────────────────
|
|
204
|
+
UserPermission["UNIBOX_CANNED_REPLY_READ"] = "unibox:canned-reply:read";
|
|
205
|
+
/** Author the saved replies every agent in the tenant will send. */
|
|
206
|
+
UserPermission["UNIBOX_CANNED_REPLY_MANAGE"] = "unibox:canned-reply:manage";
|
|
153
207
|
})(UserPermission || (exports.UserPermission = UserPermission = {}));
|
|
154
208
|
/**
|
|
155
209
|
* Every member, for seeding the owner role and validating custom-role input.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-permission.enum.js","sourceRoot":"","sources":["../../../src/enum/user-permission.enum.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,IAAY,
|
|
1
|
+
{"version":3,"file":"user-permission.enum.js","sourceRoot":"","sources":["../../../src/enum/user-permission.enum.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,IAAY,cA+MX;AA/MD,WAAY,cAAc;IACtB,4EAA4E;IAE5E,2EAA2E;IAC3E,6CAA2B,CAAA;IAC3B,iDAA+B,CAAA;IAC/B,sFAAsF;IACtF,iDAA+B,CAAA;IAE/B,2EAA2E;IAC3E,yCAAuB,CAAA;IACvB,6CAA2B,CAAA;IAC3B,6CAA2B,CAAA;IAC3B,6CAA2B,CAAA;IAE3B,2EAA2E;IAC3E,qDAAmC,CAAA;IACnC,6EAA6E;IAC7E,yDAAuC,CAAA;IACvC;;;OAGG;IACH,mEAAiD,CAAA;IAEjD,2EAA2E;IAC3E,yCAAuB,CAAA;IACvB,6CAA2B,CAAA;IAC3B,6CAA2B,CAAA;IAC3B,6CAA2B,CAAA;IAE3B,2EAA2E;IAC3E,+CAA6B,CAAA;IAC7B,iDAA+B,CAAA;IAC/B,mDAAiC,CAAA;IAEjC,4EAA4E;IAE5E,2EAA2E;IAC3E,qEAAqE;IACrE,iEAA+C,CAAA;IAC/C,qEAAmD,CAAA;IACnD,qEAAmD,CAAA;IACnD,qEAAmD,CAAA;IAEnD,2EAA2E;IAC3E;;;;OAIG;IACH,+DAA6C,CAAA;IAC7C,mEAAiD,CAAA;IAEjD,2EAA2E;IAC3E;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AAED;;;;;GAKG;AACU,QAAA,oBAAoB,GAA8B,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { UserPermission } from '../../enum/user-permission.enum.js';
|
|
2
|
+
import type { UUID } from '../../type/uuid.type.js';
|
|
3
|
+
import type { PrincipalType } from './principal-type.enum.js';
|
|
4
|
+
/**
|
|
5
|
+
* Claims carried by an access token.
|
|
6
|
+
*
|
|
7
|
+
* **`iveri-identity-api` issues these; every other service only verifies them.** The shape is
|
|
8
|
+
* therefore a contract owned by identity, and it lives here rather than in either repo because
|
|
9
|
+
* both sides have to agree byte for byte — a service whose idea of these claims has drifted
|
|
10
|
+
* does not fail loudly, it rejects every request or, worse, reads the wrong field and keeps
|
|
11
|
+
* going. `conduit-api` carried a hand-copied duplicate of this interface until the `pt` claim
|
|
12
|
+
* had to be added to both at once, which is exactly the drift the copy invited.
|
|
13
|
+
*
|
|
14
|
+
* Names are short and non-obvious (`tid`, `perms`) because this is JWT convention and because
|
|
15
|
+
* the token travels on every request — the registered claims are three characters for the same
|
|
16
|
+
* reason.
|
|
17
|
+
*
|
|
18
|
+
* **Permissions are embedded rather than resolved per request.** That is the whole point of a
|
|
19
|
+
* JWT here: any Iveri service verifies a token with the shared secret and never calls identity
|
|
20
|
+
* on the hot path. The cost is staleness — revoking a role does not invalidate access tokens
|
|
21
|
+
* already issued, so a removed permission survives up to identity's `JWT_ACCESS_TOKEN_TTL`
|
|
22
|
+
* (15 minutes by default), or `JWT_SERVICE_TOKEN_TTL` for a service token. Anything needing
|
|
23
|
+
* immediate revocation must check state at the point of use, not rely on the token.
|
|
24
|
+
*/
|
|
25
|
+
export interface AccessTokenPayload {
|
|
26
|
+
/**
|
|
27
|
+
* Subject — **the principal**, which is a user id or an API key id depending on {@link pt}.
|
|
28
|
+
*
|
|
29
|
+
* Read it together with `pt` or not at all. Treating it as a user id unconditionally is the
|
|
30
|
+
* one mistake this shape is arranged to prevent.
|
|
31
|
+
*/
|
|
32
|
+
sub: UUID;
|
|
33
|
+
/**
|
|
34
|
+
* Which kind of principal `sub` names.
|
|
35
|
+
*
|
|
36
|
+
* Required, so adding the service-token path could not silently leave a consumer reading a
|
|
37
|
+
* machine's `sub` as a person's id.
|
|
38
|
+
*/
|
|
39
|
+
pt: PrincipalType;
|
|
40
|
+
/** Tenant the token is scoped to. Becomes `RequestContext.tenantId`; never trusted from a header. */
|
|
41
|
+
tid: UUID;
|
|
42
|
+
/** Permissions resolved from the principal's roles — or from the API key's grant — at issue time. */
|
|
43
|
+
perms: UserPermission[];
|
|
44
|
+
/** Issued-at, seconds since epoch. Set by the signer. */
|
|
45
|
+
iat?: number;
|
|
46
|
+
/** Expiry, seconds since epoch. Set by the signer. */
|
|
47
|
+
exp?: number;
|
|
48
|
+
/** Issuer, verified on every decode so a token from another Iveri environment is rejected. */
|
|
49
|
+
iss?: string;
|
|
50
|
+
/** Audience, verified alongside `iss`. */
|
|
51
|
+
aud?: string;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=access-token-payload.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"access-token-payload.interface.d.ts","sourceRoot":"","sources":["../../../../src/api/identity/access-token-payload.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,WAAW,kBAAkB;IAC/B;;;;;OAKG;IACH,GAAG,EAAE,IAAI,CAAC;IAEV;;;;;OAKG;IACH,EAAE,EAAE,aAAa,CAAC;IAElB,qGAAqG;IACrG,GAAG,EAAE,IAAI,CAAC;IAEV,qGAAqG;IACrG,KAAK,EAAE,cAAc,EAAE,CAAC;IAExB,yDAAyD;IACzD,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb,sDAAsD;IACtD,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb,8FAA8F;IAC9F,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb,0CAA0C;IAC1C,GAAG,CAAC,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"access-token-payload.interface.js","sourceRoot":"","sources":["../../../../src/api/identity/access-token-payload.interface.ts"],"names":[],"mappings":""}
|
|
@@ -51,6 +51,27 @@ export interface AuthTokens {
|
|
|
51
51
|
/** Lifetime of `accessToken` in seconds, not of `refreshToken`. */
|
|
52
52
|
expiresInSeconds: number;
|
|
53
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* Returned by `POST /auth/token` — the API-key-for-JWT exchange a service makes so that other
|
|
56
|
+
* Iveri services can authorize it **without calling identity**.
|
|
57
|
+
*
|
|
58
|
+
* **There is deliberately no refresh token.** The API key already is the long-lived credential,
|
|
59
|
+
* and it is revocable by a row. A refresh token here would be a second long-lived credential
|
|
60
|
+
* with its own independent lifetime, rotation rule and leak story, obtained from the first —
|
|
61
|
+
* so revoking the key would no longer be enough to stop the caller. A service re-exchanges
|
|
62
|
+
* instead, which costs one call per {@link expiresInSeconds}.
|
|
63
|
+
*
|
|
64
|
+
* The key travels as `x-api-key`, so this call has no request body.
|
|
65
|
+
*/
|
|
66
|
+
export interface ServiceToken {
|
|
67
|
+
/** Send as `Authorization: Bearer <accessToken>`. Carries `pt: 'service'`. */
|
|
68
|
+
accessToken: string;
|
|
69
|
+
/**
|
|
70
|
+
* Lifetime in seconds. Shorter than a human session's: a service re-exchanges with nobody
|
|
71
|
+
* waiting, so the revocation window is cheap to shrink.
|
|
72
|
+
*/
|
|
73
|
+
expiresInSeconds: number;
|
|
74
|
+
}
|
|
54
75
|
/**
|
|
55
76
|
* Who the caller is. Returned by `GET /auth/me` and nested inside {@link AuthSession}.
|
|
56
77
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.type.d.ts","sourceRoot":"","sources":["../../../../src/api/identity/auth.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAE5D,8EAA8E;AAC9E,MAAM,WAAW,UAAU;IACvB,UAAU,EAAE,MAAM,CAAC;IAEnB,sEAAsE;IACtE,UAAU,EAAE,MAAM,CAAC;IAEnB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,0BAA0B;AAC1B,MAAM,WAAW,SAAS;IACtB;;;;;OAKG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,oDAAoD;AACpD,MAAM,WAAW,gBAAgB;IAC7B,YAAY,EAAE,MAAM,CAAC;CACxB;AAED,iGAAiG;AACjG,MAAM,WAAW,oBAAoB;IACjC,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,+EAA+E;AAC/E,MAAM,WAAW,UAAU;IACvB,qDAAqD;IACrD,WAAW,EAAE,MAAM,CAAC;IAEpB;;;;;;;;OAQG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB,mEAAmE;IACnE,gBAAgB,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;;;;;;;GAWG;AACH,MA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AED;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IACxB,SAAS,EAAE,SAAS,CAAC;IACrB,MAAM,EAAE,UAAU,CAAC;CACtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/identity/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/identity/index.ts"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAC;AACpD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/identity/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/identity/index.ts"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAC;AACpD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What kind of principal an access token was minted for.
|
|
3
|
+
*
|
|
4
|
+
* It exists because `sub` alone cannot answer the question. A JWT's subject is *the principal*,
|
|
5
|
+
* and identity issues tokens for two kinds of them: a person who logged in, and a service that
|
|
6
|
+
* exchanged an API key. Both put a UUID in `sub`, and the two UUIDs mean entirely different
|
|
7
|
+
* things — one names a row in `user`, the other a row in `api_key`.
|
|
8
|
+
*
|
|
9
|
+
* A consumer that reads `sub` as a user id without checking this claim attributes a machine's
|
|
10
|
+
* actions to a user who does not exist. That is why every guard branches on it, and why it is
|
|
11
|
+
* required rather than optional: `tsc` then makes the branch impossible to forget.
|
|
12
|
+
*/
|
|
13
|
+
export declare enum PrincipalType {
|
|
14
|
+
/** A person, authenticated by password. `sub` is their `user.id`. */
|
|
15
|
+
USER = "user",
|
|
16
|
+
/** A service, authenticated by API key. `sub` is the `api_key.id`, and there is no user. */
|
|
17
|
+
SERVICE = "service"
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=principal-type.enum.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"principal-type.enum.d.ts","sourceRoot":"","sources":["../../../../src/api/identity/principal-type.enum.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,oBAAY,aAAa;IACrB,qEAAqE;IACrE,IAAI,SAAS;IAEb,4FAA4F;IAC5F,OAAO,YAAY;CACtB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What kind of principal an access token was minted for.
|
|
3
|
+
*
|
|
4
|
+
* It exists because `sub` alone cannot answer the question. A JWT's subject is *the principal*,
|
|
5
|
+
* and identity issues tokens for two kinds of them: a person who logged in, and a service that
|
|
6
|
+
* exchanged an API key. Both put a UUID in `sub`, and the two UUIDs mean entirely different
|
|
7
|
+
* things — one names a row in `user`, the other a row in `api_key`.
|
|
8
|
+
*
|
|
9
|
+
* A consumer that reads `sub` as a user id without checking this claim attributes a machine's
|
|
10
|
+
* actions to a user who does not exist. That is why every guard branches on it, and why it is
|
|
11
|
+
* required rather than optional: `tsc` then makes the branch impossible to forget.
|
|
12
|
+
*/
|
|
13
|
+
export var PrincipalType;
|
|
14
|
+
(function (PrincipalType) {
|
|
15
|
+
/** A person, authenticated by password. `sub` is their `user.id`. */
|
|
16
|
+
PrincipalType["USER"] = "user";
|
|
17
|
+
/** A service, authenticated by API key. `sub` is the `api_key.id`, and there is no user. */
|
|
18
|
+
PrincipalType["SERVICE"] = "service";
|
|
19
|
+
})(PrincipalType || (PrincipalType = {}));
|
|
20
|
+
//# sourceMappingURL=principal-type.enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"principal-type.enum.js","sourceRoot":"","sources":["../../../../src/api/identity/principal-type.enum.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,MAAM,CAAN,IAAY,aAMX;AAND,WAAY,aAAa;IACrB,qEAAqE;IACrE,8BAAa,CAAA;IAEb,4FAA4F;IAC5F,oCAAmB,CAAA;AACvB,CAAC,EANW,aAAa,KAAb,aAAa,QAMxB"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { IsoDateTime } from '../../type/iso-date-time.type.js';
|
|
2
|
+
import type { Nullable } from '../../type/nil.type.js';
|
|
3
|
+
import type { Paginated } from '../../type/paginated.type.js';
|
|
4
|
+
import type { UUID } from '../../type/uuid.type.js';
|
|
5
|
+
/**
|
|
6
|
+
* A saved reply an agent can insert into a message.
|
|
7
|
+
*
|
|
8
|
+
* **Inserted into the composer, never sent by itself.** A canned reply is text an agent chooses
|
|
9
|
+
* and can edit before sending — it is not an automation, and there is no endpoint that sends one
|
|
10
|
+
* directly. That line is what keeps this out of §14's no-scripting territory: the moment a saved
|
|
11
|
+
* reply can fire on a condition, we have built a rules engine in a chat product.
|
|
12
|
+
*/
|
|
13
|
+
export interface CannedReply {
|
|
14
|
+
id: UUID;
|
|
15
|
+
/** What an agent types to find it, e.g. `/hours`. Unique within the tenant. */
|
|
16
|
+
shortcut: string;
|
|
17
|
+
title: string;
|
|
18
|
+
/**
|
|
19
|
+
* The text, with `{{placeholders}}` substituted client-side at insert time.
|
|
20
|
+
*
|
|
21
|
+
* Substitution is the client's job on purpose. The server would have to resolve them at send
|
|
22
|
+
* time, which means an agent could send a message whose final text they never saw — and the
|
|
23
|
+
* one thing an agent must always be able to do is read what they are about to send.
|
|
24
|
+
*/
|
|
25
|
+
body: string;
|
|
26
|
+
/** For grouping in the picker. Null is the ungrouped bucket. */
|
|
27
|
+
category: Nullable<string>;
|
|
28
|
+
createdByUserId: Nullable<UUID>;
|
|
29
|
+
createdAt: IsoDateTime;
|
|
30
|
+
updatedAt: IsoDateTime;
|
|
31
|
+
}
|
|
32
|
+
/** `GET /api/v1/canned-replies`. Offset-paged. */
|
|
33
|
+
export type CannedRepliesPage = Paginated<CannedReply>;
|
|
34
|
+
/** `POST /api/v1/canned-replies`. */
|
|
35
|
+
export interface CreateCannedReplyBody {
|
|
36
|
+
/** Lowercase, `[a-z0-9-]`, no leading slash — the UI supplies that. */
|
|
37
|
+
shortcut: string;
|
|
38
|
+
title: string;
|
|
39
|
+
body: string;
|
|
40
|
+
category?: Nullable<string>;
|
|
41
|
+
}
|
|
42
|
+
/** `PATCH /api/v1/canned-replies/:id`. */
|
|
43
|
+
export interface UpdateCannedReplyBody {
|
|
44
|
+
shortcut?: string;
|
|
45
|
+
title?: string;
|
|
46
|
+
body?: string;
|
|
47
|
+
category?: Nullable<string>;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=canned-reply.type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"canned-reply.type.d.ts","sourceRoot":"","sources":["../../../../src/api/unibox/canned-reply.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAEpD;;;;;;;GAOG;AACH,MAAM,WAAW,WAAW;IACxB,EAAE,EAAE,IAAI,CAAC;IAET,+EAA+E;IAC/E,QAAQ,EAAE,MAAM,CAAC;IAEjB,KAAK,EAAE,MAAM,CAAC;IAEd;;;;;;OAMG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb,gEAAgE;IAChE,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAE3B,eAAe,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;IAEhC,SAAS,EAAE,WAAW,CAAC;IACvB,SAAS,EAAE,WAAW,CAAC;CAC1B;AAED,kDAAkD;AAClD,MAAM,MAAM,iBAAiB,GAAG,SAAS,CAAC,WAAW,CAAC,CAAC;AAEvD,qCAAqC;AACrC,MAAM,WAAW,qBAAqB;IAClC,uEAAuE;IACvE,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;CAC/B;AAED,0CAA0C;AAC1C,MAAM,WAAW,qBAAqB;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;CAC/B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"canned-reply.type.js","sourceRoot":"","sources":["../../../../src/api/unibox/canned-reply.type.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The messaging network a channel is connected to.
|
|
3
|
+
*
|
|
4
|
+
* This is Unibox's vocabulary, not Conduit's. Conduit knows about *connectors* — a set of hosts
|
|
5
|
+
* and operations someone wrote down — and has no idea that any of them carry conversations.
|
|
6
|
+
* Unibox knows that a WhatsApp message and an Instagram message are the same kind of thing and
|
|
7
|
+
* belong in one inbox, which is the whole product.
|
|
8
|
+
*
|
|
9
|
+
* The members are the platforms Unibox can **normalize**, which is a stricter bar than the ones
|
|
10
|
+
* Conduit can talk to: normalizing means we can read a provider's webhook into a contact, a
|
|
11
|
+
* conversation and a message, and write a reply back. Adding one is a normalizer plus a
|
|
12
|
+
* connector manifest, and is a minor version here.
|
|
13
|
+
*/
|
|
14
|
+
export declare enum ChannelPlatform {
|
|
15
|
+
/** WhatsApp Cloud API. The first real platform, and the one `conduit-api` ships a manifest for. */
|
|
16
|
+
WHATSAPP = "whatsapp",
|
|
17
|
+
/** Instagram Direct, via the Messenger Platform. */
|
|
18
|
+
INSTAGRAM = "instagram",
|
|
19
|
+
/** Facebook Messenger. */
|
|
20
|
+
MESSENGER = "messenger",
|
|
21
|
+
/**
|
|
22
|
+
* A loopback platform for local development and tests, matching Conduit's `local-echo`
|
|
23
|
+
* connector.
|
|
24
|
+
*
|
|
25
|
+
* It exists for the same reason that connector does: the entire pipeline — receive,
|
|
26
|
+
* normalize, thread, reply, dispatch — is provable without a Meta app, and a real Meta app
|
|
27
|
+
* would only prove we can talk to Meta. It is a first-class member rather than a test double
|
|
28
|
+
* so the normalizer registry has no branch that only exists under Jest.
|
|
29
|
+
*/
|
|
30
|
+
ECHO = "echo"
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=channel-platform.enum.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channel-platform.enum.d.ts","sourceRoot":"","sources":["../../../../src/api/unibox/channel-platform.enum.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,oBAAY,eAAe;IACvB,mGAAmG;IACnG,QAAQ,aAAa;IAErB,oDAAoD;IACpD,SAAS,cAAc;IAEvB,0BAA0B;IAC1B,SAAS,cAAc;IAEvB;;;;;;;;OAQG;IACH,IAAI,SAAS;CAChB"}
|