@ada-cx/messaging-bridge 1.6.3 → 1.7.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.
|
@@ -192,6 +192,14 @@ export interface StagedAttachmentRejection {
|
|
|
192
192
|
/** `too_many` is new with multi-image staging: an exhaustive switch written
|
|
193
193
|
* against the single-image contract needs a case for it. */
|
|
194
194
|
error: "unsupported_type" | "too_large" | "too_many" | "unavailable" | "upload_failed";
|
|
195
|
+
/** The refused file's name, as the chatter's device reported it. Absent when
|
|
196
|
+
* several files of one `chat.attachment.stage` batch were refused, because
|
|
197
|
+
* the one slot can name only one of them. It is user content: show it, and
|
|
198
|
+
* keep it out of logs and monitoring. */
|
|
199
|
+
name?: string;
|
|
200
|
+
/** The refused file's extension in capitals, as in "PDF". Kept when several
|
|
201
|
+
* files of one batch were refused only while they all share it. */
|
|
202
|
+
fileType?: string;
|
|
195
203
|
}
|
|
196
204
|
export interface DownloadableMessage extends BaseMessage {
|
|
197
205
|
type: "downloadable";
|
|
@@ -558,6 +566,8 @@ export interface AppDisplayState {
|
|
|
558
566
|
"liveAgent.platform.name"?: string | null;
|
|
559
567
|
"liveAgent.platform.departmentId"?: number | null;
|
|
560
568
|
"liveAgent.queuePosition"?: number | null;
|
|
569
|
+
/** The estimated wait in whole minutes. Never set together with `queuePosition`. */
|
|
570
|
+
"liveAgent.queueWaitMinutes"?: number | null;
|
|
561
571
|
/** A queue-cancel POST is in flight; the banner's Cancel is disabled while true. */
|
|
562
572
|
"liveAgent.queueCancelPending"?: boolean;
|
|
563
573
|
"liveAgent.handoff.lastEvent"?: {
|
|
@@ -844,6 +854,10 @@ export interface AppEvents {
|
|
|
844
854
|
"chat.attachment.stage": {
|
|
845
855
|
file: File;
|
|
846
856
|
allowMultiple?: boolean;
|
|
857
|
+
/** Shared by every file of one pick or drop. Core then names a refused
|
|
858
|
+
* file in `chat.attachmentRejection` only while it is the one refusal of
|
|
859
|
+
* its batch. Without it, each stage is its own batch. */
|
|
860
|
+
batchId?: string;
|
|
847
861
|
};
|
|
848
862
|
/** Drop the staged image named by `id`; ignored once another pick replaced it. */
|
|
849
863
|
"chat.attachment.remove": {
|
|
@@ -48,6 +48,26 @@ export declare const IMAGE_ATTACHMENT_MIME_TYPES: readonly string[];
|
|
|
48
48
|
* them out in a MIME-only filter.
|
|
49
49
|
*/
|
|
50
50
|
export declare const IMAGE_ATTACHMENT_ACCEPT: string;
|
|
51
|
+
/**
|
|
52
|
+
* The most characters a refused file's name takes in an upload error, so the
|
|
53
|
+
* name fits one line of the toast in a 320px window.
|
|
54
|
+
*/
|
|
55
|
+
export declare const REFUSED_FILE_NAME_MAX_LENGTH = 32;
|
|
56
|
+
/**
|
|
57
|
+
* The file name to show in front of an upload error. A long name loses its
|
|
58
|
+
* middle, so the extension stays visible. Returns null when no name is left.
|
|
59
|
+
*/
|
|
60
|
+
export declare function formatRefusedFileName(
|
|
61
|
+
name: string | null | undefined,
|
|
62
|
+
): string | null;
|
|
63
|
+
/**
|
|
64
|
+
* The refused file's type as its extension in capitals, as in "PDF", for an
|
|
65
|
+
* upload error that says which type was refused. Returns null when the name has
|
|
66
|
+
* no usable extension; the error then falls back to "This file type".
|
|
67
|
+
*/
|
|
68
|
+
export declare function refusedFileTypeLabel(
|
|
69
|
+
name: string | null | undefined,
|
|
70
|
+
): string | null;
|
|
51
71
|
/** Typed bridge contract for file-upload failures shown to the chatter. */
|
|
52
72
|
export interface FileUploadErrorData {
|
|
53
73
|
reason?: FileUploadErrorReason;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ada-cx/messaging-bridge",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "Types, test mocks, and a thin CDN loader for building a custom app UI on Ada Messaging's bridge contract. The bridge runtime always loads from Ada's CDN.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "ISC",
|