@webority/support-react 0.148.0 → 0.150.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 +0 -6
- package/dist/guidance.json +1 -1
- package/dist/support-react.js +1 -1
- package/dist/types/ReportIssue.d.ts +23 -24
- package/dist/types/ReportIssue.meta.d.ts +2 -54
- package/dist/types/SupportCenter.d.ts +17 -18
- package/dist/types/SupportCenter.meta.d.ts +2 -58
- package/dist/types/SupportContact.d.ts +4 -6
- package/dist/types/SupportContact.meta.d.ts +2 -25
- package/dist/types/SupportProvider.d.ts +16 -16
- package/dist/types/agent/SupportAgentProvider.d.ts +14 -12
- package/dist/types/agent/SupportAgentTicket.d.ts +6 -7
- package/dist/types/agent/SupportQueue.d.ts +18 -18
- package/dist/types/agent/SupportQueue.meta.d.ts +1 -1
- package/dist/types/agent/client.d.ts +213 -83
- package/dist/types/agent/context.d.ts +36 -65
- package/dist/types/agent/labels.d.ts +80 -79
- package/dist/types/client.d.ts +242 -167
- package/dist/types/components/AttachmentField.d.ts +5 -11
- package/dist/types/components/AttachmentThumb.d.ts +6 -12
- package/dist/types/components/MessageThread.d.ts +6 -13
- package/dist/types/components/NewTicketModal.d.ts +12 -16
- package/dist/types/components/RatingPanel.d.ts +13 -14
- package/dist/types/components/ReplyBox.d.ts +11 -11
- package/dist/types/components/SuggestedAnswers.d.ts +6 -9
- package/dist/types/components/SupportTime.d.ts +8 -10
- package/dist/types/components/TicketDetail.d.ts +11 -12
- package/dist/types/components/TicketForm.d.ts +31 -39
- package/dist/types/components/TicketList.d.ts +31 -25
- package/dist/types/context.d.ts +30 -49
- package/dist/types/helpCentre/HelpArticle.d.ts +11 -9
- package/dist/types/helpCentre/HelpArticle.meta.d.ts +2 -34
- package/dist/types/helpCentre/HelpCentre.d.ts +11 -9
- package/dist/types/helpCentre/HelpCentre.meta.d.ts +2 -33
- package/dist/types/helpCentre/client.d.ts +25 -59
- package/dist/types/helpCentre/labels.d.ts +19 -19
- package/dist/types/helpCentre/useHelpCentre.d.ts +8 -20
- package/dist/types/index.d.ts +18 -15
- package/dist/types/labels.d.ts +8 -8
- package/dist/types/lib/errors.d.ts +4 -4
- package/dist/types/lib/files.d.ts +43 -31
- package/dist/types/lib/status.d.ts +8 -3
- package/dist/types/lib/subject.d.ts +3 -3
- package/dist/types/lib/url.d.ts +4 -4
- package/dist/types/lib/useDebouncedValue.d.ts +3 -3
- package/package.json +9 -8
|
@@ -1,61 +1,56 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import type { AgentAssignment, AgentCategoryChange, AgentPriorityChange, AgentQueueCounts, AgentReplyInput, AgentSettings, AgentStatusChange, AgentTicket, AgentTicketListQuery, AgentTicketQueueItem, AgentUser, SupportAgentClient } from "./client.ts";
|
|
3
|
+
/** Runs a load once per provider and client and hands the same answer to every caller; `fresh` loads again. */
|
|
4
|
+
export type SupportAgentSharedLoad<T> = (load: () => Promise<T>, fresh?: boolean) => Promise<T>;
|
|
5
|
+
export interface SupportAgentContextValue {
|
|
6
|
+
client: SupportAgentClient;
|
|
7
|
+
loadAgents: SupportAgentSharedLoad<readonly AgentUser[]>;
|
|
8
|
+
loadSettings: SupportAgentSharedLoad<AgentSettings>;
|
|
5
9
|
timeZone: string;
|
|
6
|
-
renderTime?: (iso: string) =>
|
|
10
|
+
renderTime?: (iso: string) => ReactNode;
|
|
11
|
+
statusTones?: Record<string, string>;
|
|
7
12
|
labels?: Record<string, Record<string, string>>;
|
|
8
|
-
}
|
|
13
|
+
}
|
|
14
|
+
export declare const SupportAgentContext: import("react").Context<SupportAgentContextValue | null>;
|
|
9
15
|
/**
|
|
10
16
|
* The agent support client the nearest SupportAgentProvider holds.
|
|
11
|
-
*
|
|
12
|
-
* @returns {import('./client.js').SupportAgentClient}
|
|
13
17
|
*/
|
|
14
|
-
export declare function useSupportAgentClient():
|
|
18
|
+
export declare function useSupportAgentClient(): SupportAgentClient;
|
|
15
19
|
/**
|
|
16
20
|
* The IANA time zone the nearest SupportAgentProvider shows times in.
|
|
17
|
-
*
|
|
18
|
-
* @returns {string}
|
|
19
21
|
*/
|
|
20
22
|
export declare function useSupportAgentTimeZone(): string;
|
|
21
23
|
/**
|
|
22
24
|
* The product's own time renderer the nearest SupportAgentProvider holds, or null for the built-in one.
|
|
23
|
-
*
|
|
24
|
-
* @returns {((iso: string) => import('react').ReactNode)|null}
|
|
25
25
|
*/
|
|
26
|
-
export declare function useSupportAgentRenderTime(): ((iso: string) =>
|
|
26
|
+
export declare function useSupportAgentRenderTime(): ((iso: string) => ReactNode) | null;
|
|
27
|
+
/**
|
|
28
|
+
* The tone of a ticket status's pill: the nearest SupportAgentProvider's statusTones over the built-in tones.
|
|
29
|
+
*/
|
|
30
|
+
export declare function useSupportAgentStatusTone(): (status: string) => string;
|
|
27
31
|
/**
|
|
28
32
|
* The labels for one scope, with any the provider overrides merged over the defaults.
|
|
29
|
-
*
|
|
30
|
-
* @param {string} scope
|
|
31
|
-
* @param {Record<string, string>} defaults
|
|
32
|
-
* @returns {Record<string, string>}
|
|
33
33
|
*/
|
|
34
|
-
export declare function useSupportAgentLabels(scope: string, defaults:
|
|
34
|
+
export declare function useSupportAgentLabels<T extends Record<string, string>>(scope: string, defaults: T): T;
|
|
35
35
|
/**
|
|
36
36
|
* One page of the tickets in the agent's queue, filtered and searched on the server. Loads again
|
|
37
37
|
* whenever any part of the query changes; an answer for a query that has since moved on is dropped.
|
|
38
|
-
*
|
|
39
|
-
* @param {import('./client.js').AgentTicketListQuery} [query]
|
|
40
|
-
* @returns {{ tickets: any[], totalCount: number, totalPages: number, loading: boolean, error: any, reload: () => void }}
|
|
41
38
|
*/
|
|
42
|
-
export declare function useSupportQueue(query?:
|
|
43
|
-
tickets:
|
|
39
|
+
export declare function useSupportQueue(query?: AgentTicketListQuery): {
|
|
40
|
+
tickets: AgentTicketQueueItem[];
|
|
44
41
|
totalCount: number;
|
|
45
42
|
totalPages: number;
|
|
46
43
|
loading: boolean;
|
|
47
|
-
error:
|
|
44
|
+
error: unknown;
|
|
48
45
|
reload: () => void;
|
|
49
46
|
};
|
|
50
47
|
/**
|
|
51
48
|
* How many tickets are in each queue bucket, for labelling the counts strip.
|
|
52
|
-
*
|
|
53
|
-
* @returns {{ counts: any|null, loading: boolean, error: any, reload: () => void }}
|
|
54
49
|
*/
|
|
55
50
|
export declare function useSupportQueueCounts(): {
|
|
56
|
-
counts:
|
|
51
|
+
counts: AgentQueueCounts | null;
|
|
57
52
|
loading: boolean;
|
|
58
|
-
error:
|
|
53
|
+
error: unknown;
|
|
59
54
|
reload: () => void;
|
|
60
55
|
};
|
|
61
56
|
/**
|
|
@@ -63,58 +58,34 @@ export declare function useSupportQueueCounts(): {
|
|
|
63
58
|
* updated ticket and replaces the one held here. The ticket refreshes every 30 seconds while the
|
|
64
59
|
* page is visible, and never while a change is in flight.
|
|
65
60
|
*
|
|
66
|
-
*
|
|
67
|
-
* @returns {{
|
|
68
|
-
* ticket: any, loading: boolean, error: any, reload: () => void,
|
|
69
|
-
* reply: (input: Parameters<import('./client.js').SupportAgentClient['reply']>[1]) => Promise<any>,
|
|
70
|
-
* changeStatus: (input: { version: string, status: string }) => Promise<any>,
|
|
71
|
-
* changePriority: (input: { version: string, priority: string }) => Promise<any>,
|
|
72
|
-
* changeCategory: (input: { version: string, category: string }) => Promise<any>,
|
|
73
|
-
* assign: (input: { version: string, agentUserId: number | null }) => Promise<any>
|
|
74
|
-
* }}
|
|
61
|
+
* The id is the ticket's id; nothing loads while it is empty.
|
|
75
62
|
*/
|
|
76
63
|
export declare function useSupportAgentTicket(id: string | null | undefined): {
|
|
77
|
-
ticket:
|
|
64
|
+
ticket: AgentTicket | null;
|
|
78
65
|
loading: boolean;
|
|
79
|
-
error:
|
|
66
|
+
error: unknown;
|
|
80
67
|
reload: () => void;
|
|
81
|
-
reply: (input:
|
|
82
|
-
changeStatus: (input:
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
changePriority: (input: {
|
|
87
|
-
version: string;
|
|
88
|
-
priority: string;
|
|
89
|
-
}) => Promise<any>;
|
|
90
|
-
changeCategory: (input: {
|
|
91
|
-
version: string;
|
|
92
|
-
category: string;
|
|
93
|
-
}) => Promise<any>;
|
|
94
|
-
assign: (input: {
|
|
95
|
-
version: string;
|
|
96
|
-
agentUserId: number | null;
|
|
97
|
-
}) => Promise<any>;
|
|
68
|
+
reply: (input: AgentReplyInput) => Promise<AgentTicket>;
|
|
69
|
+
changeStatus: (input: AgentStatusChange) => Promise<AgentTicket>;
|
|
70
|
+
changePriority: (input: AgentPriorityChange) => Promise<AgentTicket>;
|
|
71
|
+
changeCategory: (input: AgentCategoryChange) => Promise<AgentTicket>;
|
|
72
|
+
assign: (input: AgentAssignment) => Promise<AgentTicket>;
|
|
98
73
|
};
|
|
99
74
|
/**
|
|
100
75
|
* The agents a ticket can be assigned to. Loaded once per provider and shared.
|
|
101
|
-
*
|
|
102
|
-
* @returns {{ agents: any[], loading: boolean, error: any, reload: () => void }}
|
|
103
76
|
*/
|
|
104
77
|
export declare function useSupportAgents(): {
|
|
105
|
-
agents:
|
|
78
|
+
agents: readonly AgentUser[];
|
|
106
79
|
loading: boolean;
|
|
107
|
-
error:
|
|
80
|
+
error: unknown;
|
|
108
81
|
reload: () => void;
|
|
109
82
|
};
|
|
110
83
|
/**
|
|
111
84
|
* The agent-side settings (categories, priorities, statuses). Loaded once per provider and shared.
|
|
112
|
-
*
|
|
113
|
-
* @returns {{ settings: any|null, loading: boolean, error: any, reload: () => void }}
|
|
114
85
|
*/
|
|
115
86
|
export declare function useSupportAgentSettings(): {
|
|
116
|
-
settings:
|
|
87
|
+
settings: AgentSettings | null;
|
|
117
88
|
loading: boolean;
|
|
118
|
-
error:
|
|
89
|
+
error: unknown;
|
|
119
90
|
reload: () => void;
|
|
120
91
|
};
|
|
@@ -1,84 +1,85 @@
|
|
|
1
1
|
/** Strings the support agent queue and ticket page show. Scope names: supportQueue, agentTicket. */
|
|
2
2
|
export declare const AGENT_LABELS: {
|
|
3
|
-
supportQueue: {
|
|
4
|
-
countOpen:
|
|
5
|
-
countInProgress:
|
|
6
|
-
countWaiting:
|
|
7
|
-
countOverdue:
|
|
8
|
-
countUnassigned:
|
|
9
|
-
filterStatus:
|
|
10
|
-
filterPriority:
|
|
11
|
-
filterCategory:
|
|
12
|
-
filterPlace:
|
|
13
|
-
filterAssignee:
|
|
14
|
-
filterUnassignedOnly:
|
|
15
|
-
filterOverdueOnly:
|
|
16
|
-
filterSearch:
|
|
17
|
-
filterAny:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
3
|
+
readonly supportQueue: {
|
|
4
|
+
readonly countOpen: "Open";
|
|
5
|
+
readonly countInProgress: "In progress";
|
|
6
|
+
readonly countWaiting: "Waiting";
|
|
7
|
+
readonly countOverdue: "Overdue";
|
|
8
|
+
readonly countUnassigned: "Unassigned";
|
|
9
|
+
readonly filterStatus: "Status";
|
|
10
|
+
readonly filterPriority: "Priority";
|
|
11
|
+
readonly filterCategory: "Category";
|
|
12
|
+
readonly filterPlace: "Place";
|
|
13
|
+
readonly filterAssignee: "Assignee";
|
|
14
|
+
readonly filterUnassignedOnly: "Unassigned only";
|
|
15
|
+
readonly filterOverdueOnly: "Overdue only";
|
|
16
|
+
readonly filterSearch: "Search";
|
|
17
|
+
readonly filterAny: "All";
|
|
18
|
+
readonly resetFilters: "Reset filters";
|
|
19
|
+
readonly columnNumber: "Number";
|
|
20
|
+
readonly columnPlace: "Place";
|
|
21
|
+
readonly columnSubject: "Subject";
|
|
22
|
+
readonly columnCategory: "Category";
|
|
23
|
+
readonly columnStatus: "Status";
|
|
24
|
+
readonly columnPriority: "Priority";
|
|
25
|
+
readonly columnAssignee: "Assignee";
|
|
26
|
+
readonly columnDue: "Due";
|
|
27
|
+
readonly loading: "Loading tickets...";
|
|
28
|
+
readonly empty: "No tickets match these filters.";
|
|
29
|
+
readonly error: "We could not load the tickets. Try again.";
|
|
30
|
+
readonly retry: "Try again";
|
|
31
|
+
readonly heading: "Ticket queue";
|
|
32
|
+
readonly tableLabel: "Tickets in this queue";
|
|
33
|
+
readonly settingsError: "We could not load the queue settings.";
|
|
34
|
+
readonly overdueMark: "Overdue";
|
|
35
|
+
readonly noAssignee: "Unassigned";
|
|
36
|
+
readonly emptyUnfiltered: "No tickets in this queue yet.";
|
|
36
37
|
};
|
|
37
|
-
agentTicket: {
|
|
38
|
-
reply:
|
|
39
|
-
internalNote:
|
|
40
|
-
send:
|
|
41
|
-
savedReplies:
|
|
42
|
-
attachFiles:
|
|
43
|
-
status:
|
|
44
|
-
priority:
|
|
45
|
-
category:
|
|
46
|
-
assignee:
|
|
47
|
-
unassigned:
|
|
48
|
-
internal:
|
|
49
|
-
backToQueue:
|
|
50
|
-
stale:
|
|
51
|
-
reload:
|
|
52
|
-
loading:
|
|
53
|
-
empty:
|
|
54
|
-
error:
|
|
55
|
-
retry:
|
|
56
|
-
emptyReply:
|
|
57
|
-
actionFailed:
|
|
58
|
-
attachmentFailed:
|
|
59
|
-
none:
|
|
60
|
-
customer:
|
|
61
|
-
supportTeam:
|
|
62
|
-
overdue:
|
|
63
|
-
detailsLabel:
|
|
64
|
-
controlsLabel:
|
|
65
|
-
fieldTicket:
|
|
66
|
-
fieldAccount:
|
|
67
|
-
fieldRealm:
|
|
68
|
-
fieldReporter:
|
|
69
|
-
fieldEmail:
|
|
70
|
-
fieldRaised:
|
|
71
|
-
fieldUpdated:
|
|
72
|
-
fieldReplyDue:
|
|
73
|
-
fieldResolutionDue:
|
|
74
|
-
mode:
|
|
75
|
-
replyHint:
|
|
76
|
-
noteHint:
|
|
77
|
-
body:
|
|
78
|
-
insertSaved:
|
|
79
|
-
attachedFiles:
|
|
80
|
-
removeFile:
|
|
81
|
-
formLabel:
|
|
82
|
-
conversation:
|
|
38
|
+
readonly agentTicket: {
|
|
39
|
+
readonly reply: "Reply";
|
|
40
|
+
readonly internalNote: "Internal note";
|
|
41
|
+
readonly send: "Send";
|
|
42
|
+
readonly savedReplies: "Saved replies";
|
|
43
|
+
readonly attachFiles: "Attach files";
|
|
44
|
+
readonly status: "Status";
|
|
45
|
+
readonly priority: "Priority";
|
|
46
|
+
readonly category: "Category";
|
|
47
|
+
readonly assignee: "Assignee";
|
|
48
|
+
readonly unassigned: "Unassigned";
|
|
49
|
+
readonly internal: "Internal";
|
|
50
|
+
readonly backToQueue: "Back to queue";
|
|
51
|
+
readonly stale: "Someone else changed this ticket just now. Reload it and try again.";
|
|
52
|
+
readonly reload: "Reload";
|
|
53
|
+
readonly loading: "Loading ticket...";
|
|
54
|
+
readonly empty: "No messages yet.";
|
|
55
|
+
readonly error: "We could not load this ticket. Try again.";
|
|
56
|
+
readonly retry: "Try again";
|
|
57
|
+
readonly emptyReply: "Write a message before you send it.";
|
|
58
|
+
readonly actionFailed: "The change was not saved. Please try again.";
|
|
59
|
+
readonly attachmentFailed: "This file could not be opened. Try again.";
|
|
60
|
+
readonly none: "None";
|
|
61
|
+
readonly customer: "Customer";
|
|
62
|
+
readonly supportTeam: "Support team";
|
|
63
|
+
readonly overdue: "Overdue";
|
|
64
|
+
readonly detailsLabel: "Ticket details";
|
|
65
|
+
readonly controlsLabel: "Ticket controls";
|
|
66
|
+
readonly fieldTicket: "Ticket";
|
|
67
|
+
readonly fieldAccount: "Account";
|
|
68
|
+
readonly fieldRealm: "Realm";
|
|
69
|
+
readonly fieldReporter: "Reporter";
|
|
70
|
+
readonly fieldEmail: "Email";
|
|
71
|
+
readonly fieldRaised: "Raised";
|
|
72
|
+
readonly fieldUpdated: "Updated";
|
|
73
|
+
readonly fieldReplyDue: "Reply due";
|
|
74
|
+
readonly fieldResolutionDue: "Resolution due";
|
|
75
|
+
readonly mode: "Reply or internal note";
|
|
76
|
+
readonly replyHint: "The customer sees this reply.";
|
|
77
|
+
readonly noteHint: "Only the support team sees an internal note.";
|
|
78
|
+
readonly body: "Message";
|
|
79
|
+
readonly insertSaved: "Insert a saved reply";
|
|
80
|
+
readonly attachedFiles: "Attached files";
|
|
81
|
+
readonly removeFile: "Remove {name}";
|
|
82
|
+
readonly formLabel: "Reply to this ticket";
|
|
83
|
+
readonly conversation: "Conversation";
|
|
83
84
|
};
|
|
84
85
|
};
|