@iveri/contracts 0.128.0 → 0.130.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 +2 -0
- package/dist/api/unibox/conversation.type.d.ts +6 -0
- package/dist/api/unibox/index.d.ts +1 -0
- package/dist/api/unibox/index.js +1 -0
- package/dist/api/unibox/message.type.d.ts +8 -0
- package/dist/api/unibox/unibox-system-note.type.d.ts +37 -0
- package/dist/api/unibox/unibox-system-note.type.js +16 -0
- package/dist/enum/user-permission.enum.d.ts +6 -0
- package/dist/enum/user-permission.enum.js +7 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -305,6 +305,8 @@ 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.130.0` adds `profile:read-any`, so a product's operator-workspace key reads the public profile
|
|
309
|
+
of somebody in the company a request names.
|
|
308
310
|
- Version `0.128.0` adds `CommerceRefusal.ORDER_MOVED_ON` (`order-moved-on`), a stale order or shipment status change.
|
|
309
311
|
- Version `0.127.0` adds `UniboxRefusal` and `SocialRefusal.STORAGE_UNAVAILABLE` (`storage-unavailable`).
|
|
310
312
|
- Version `0.123.0` adds `HrRefusal`, the HR refusals a client says in the reader's language.
|
|
@@ -5,6 +5,7 @@ import type { UUID } from '../../type/uuid.type.js';
|
|
|
5
5
|
import type { ChannelPlatform } from './channel-platform.enum.js';
|
|
6
6
|
import type { ConversationStatus } from './conversation-status.enum.js';
|
|
7
7
|
import type { Message } from './message.type.js';
|
|
8
|
+
import type { UniboxSystemNote } from './unibox-system-note.type.js';
|
|
8
9
|
/**
|
|
9
10
|
* One thread between a tenant and a contact, on one channel.
|
|
10
11
|
*
|
|
@@ -41,6 +42,11 @@ export interface Conversation {
|
|
|
41
42
|
unreadCount: number;
|
|
42
43
|
/** First ~200 characters of the last message, for the list. Null on an empty conversation. */
|
|
43
44
|
lastMessagePreview: Nullable<string>;
|
|
45
|
+
/**
|
|
46
|
+
* The last message's `systemNote` when the last message is a line `unibox-api` wrote itself, so the list can word it
|
|
47
|
+
* in the reader's language instead of showing the English preview. Null otherwise.
|
|
48
|
+
*/
|
|
49
|
+
lastMessageSystemNote: Nullable<UniboxSystemNote>;
|
|
44
50
|
/** Sorts the inbox. Null only for a conversation created before its first message. */
|
|
45
51
|
lastMessageAt: Nullable<IsoDateTime>;
|
|
46
52
|
/** When the contact last said something. Drives "waiting on us" without reading the messages. */
|
package/dist/api/unibox/index.js
CHANGED
|
@@ -6,6 +6,7 @@ import type { MessageAuthorType } from './message-author-type.enum.js';
|
|
|
6
6
|
import type { MessageContentType } from './message-content-type.enum.js';
|
|
7
7
|
import type { MessageDirection } from './message-direction.enum.js';
|
|
8
8
|
import type { MessageStatus } from './message-status.enum.js';
|
|
9
|
+
import type { UniboxSystemNote } from './unibox-system-note.type.js';
|
|
9
10
|
/** A file attached to a message. Media is referenced by provider URL until `iveri-files-api` exists. */
|
|
10
11
|
export interface MessageAttachment {
|
|
11
12
|
contentType: MessageContentType;
|
|
@@ -41,6 +42,13 @@ export interface Message {
|
|
|
41
42
|
contentType: MessageContentType;
|
|
42
43
|
/** The text, or a caption on a media message. Null when there was none. */
|
|
43
44
|
text: Nullable<string>;
|
|
45
|
+
/**
|
|
46
|
+
* What a line `unibox-api` wrote itself says, as data a client words in the reader's language.
|
|
47
|
+
*
|
|
48
|
+
* Set only on a system note (`authorType` `system`, `direction` `internal`), and null on every message a person
|
|
49
|
+
* wrote. A system note from before this field existed is null too, and its `text` is all there is.
|
|
50
|
+
*/
|
|
51
|
+
systemNote: Nullable<UniboxSystemNote>;
|
|
44
52
|
attachments: MessageAttachment[];
|
|
45
53
|
status: MessageStatus;
|
|
46
54
|
/** Why a `FAILED` message failed, in words an agent can act on. Null otherwise. */
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { UUID } from '../../type/uuid.type.js';
|
|
2
|
+
import type { ConversationStatus } from './conversation-status.enum.js';
|
|
3
|
+
/**
|
|
4
|
+
* The kinds of line `unibox-api` writes into a thread itself, rather than an agent or a contact.
|
|
5
|
+
*
|
|
6
|
+
* An inbox read in Georgian cannot show a sentence the API composed in English, so the API says **what happened** and
|
|
7
|
+
* the client words it. The English `text` is still written beside it, for an export, a log and any client that does not
|
|
8
|
+
* know this list.
|
|
9
|
+
*/
|
|
10
|
+
export declare enum UniboxNoteKind {
|
|
11
|
+
/** An agent moved the conversation to another status. Carries `status`. */
|
|
12
|
+
STATUS_CHANGED = "status-changed",
|
|
13
|
+
/** The conversation was handed to a person. Carries `toUserId`. */
|
|
14
|
+
HANDED_OVER = "handed-over",
|
|
15
|
+
/** A snooze ran out and the conversation came back to the inbox as open. */
|
|
16
|
+
SNOOZE_ENDED = "snooze-ended"
|
|
17
|
+
}
|
|
18
|
+
export interface UniboxStatusChangedNote {
|
|
19
|
+
kind: UniboxNoteKind.STATUS_CHANGED;
|
|
20
|
+
/** The status the conversation moved to. */
|
|
21
|
+
status: ConversationStatus;
|
|
22
|
+
}
|
|
23
|
+
export interface UniboxHandedOverNote {
|
|
24
|
+
kind: UniboxNoteKind.HANDED_OVER;
|
|
25
|
+
/** The identity user the conversation was handed to. A client names them; it never prints the id. */
|
|
26
|
+
toUserId: UUID;
|
|
27
|
+
}
|
|
28
|
+
export interface UniboxSnoozeEndedNote {
|
|
29
|
+
kind: UniboxNoteKind.SNOOZE_ENDED;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* What a system line in a thread says, as data.
|
|
33
|
+
*
|
|
34
|
+
* **A client that meets a `kind` it does not know shows the message's `text`**, so a new kind can ship in the API
|
|
35
|
+
* before every client has a sentence for it.
|
|
36
|
+
*/
|
|
37
|
+
export type UniboxSystemNote = UniboxStatusChangedNote | UniboxHandedOverNote | UniboxSnoozeEndedNote;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The kinds of line `unibox-api` writes into a thread itself, rather than an agent or a contact.
|
|
3
|
+
*
|
|
4
|
+
* An inbox read in Georgian cannot show a sentence the API composed in English, so the API says **what happened** and
|
|
5
|
+
* the client words it. The English `text` is still written beside it, for an export, a log and any client that does not
|
|
6
|
+
* know this list.
|
|
7
|
+
*/
|
|
8
|
+
export var UniboxNoteKind;
|
|
9
|
+
(function (UniboxNoteKind) {
|
|
10
|
+
/** An agent moved the conversation to another status. Carries `status`. */
|
|
11
|
+
UniboxNoteKind["STATUS_CHANGED"] = "status-changed";
|
|
12
|
+
/** The conversation was handed to a person. Carries `toUserId`. */
|
|
13
|
+
UniboxNoteKind["HANDED_OVER"] = "handed-over";
|
|
14
|
+
/** A snooze ran out and the conversation came back to the inbox as open. */
|
|
15
|
+
UniboxNoteKind["SNOOZE_ENDED"] = "snooze-ended";
|
|
16
|
+
})(UniboxNoteKind || (UniboxNoteKind = {}));
|
|
@@ -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",
|
|
@@ -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. */
|
|
@@ -767,6 +773,7 @@ export const PLATFORM_PERMISSIONS = Object.freeze([
|
|
|
767
773
|
UserPermission.BILLING_USAGE_READ_ANY,
|
|
768
774
|
UserPermission.NOTIFICATION_SEND_ANY,
|
|
769
775
|
UserPermission.CHAT_EMBED_MANAGE_ANY,
|
|
776
|
+
UserPermission.PROFILE_READ_ANY,
|
|
770
777
|
UserPermission.REALTIME_SUBSCRIPTION_GRANT_ISSUE_ANY,
|
|
771
778
|
UserPermission.REALTIME_EVENT_PUBLISH_ANY,
|
|
772
779
|
]);
|