@webority/mobile-support 0.0.9
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/LICENSE +21 -0
- package/README.md +146 -0
- package/lib/commonjs/SupportProvider.js +335 -0
- package/lib/commonjs/client.js +164 -0
- package/lib/commonjs/clipboard.js +10 -0
- package/lib/commonjs/components/Attachments.js +246 -0
- package/lib/commonjs/components/NewSupportTicket.js +210 -0
- package/lib/commonjs/components/PhotoTray.js +141 -0
- package/lib/commonjs/components/SupportContact.js +134 -0
- package/lib/commonjs/components/SupportTicketDetail.js +348 -0
- package/lib/commonjs/components/SupportTicketList.js +279 -0
- package/lib/commonjs/device.js +29 -0
- package/lib/commonjs/files.js +37 -0
- package/lib/commonjs/format.js +29 -0
- package/lib/commonjs/index.js +97 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/photos.js +67 -0
- package/lib/commonjs/report/ReportIssueButton.js +57 -0
- package/lib/commonjs/report/captureAndReport.js +34 -0
- package/lib/commonjs/report/index.js +20 -0
- package/lib/commonjs/share/index.js +44 -0
- package/lib/commonjs/types.js +2 -0
- package/lib/commonjs/validation.js +45 -0
- package/lib/module/SupportProvider.js +323 -0
- package/lib/module/client.js +156 -0
- package/lib/module/clipboard.js +5 -0
- package/lib/module/components/Attachments.js +240 -0
- package/lib/module/components/NewSupportTicket.js +205 -0
- package/lib/module/components/PhotoTray.js +136 -0
- package/lib/module/components/SupportContact.js +129 -0
- package/lib/module/components/SupportTicketDetail.js +343 -0
- package/lib/module/components/SupportTicketList.js +273 -0
- package/lib/module/device.js +24 -0
- package/lib/module/files.js +31 -0
- package/lib/module/format.js +23 -0
- package/lib/module/index.js +10 -0
- package/lib/module/package.json +1 -0
- package/lib/module/photos.js +61 -0
- package/lib/module/report/ReportIssueButton.js +52 -0
- package/lib/module/report/captureAndReport.js +29 -0
- package/lib/module/report/index.js +12 -0
- package/lib/module/share/index.js +37 -0
- package/lib/module/types.js +2 -0
- package/lib/module/validation.js +38 -0
- package/lib/typescript/commonjs/SupportProvider.d.ts +82 -0
- package/lib/typescript/commonjs/client.d.ts +63 -0
- package/lib/typescript/commonjs/clipboard.d.ts +3 -0
- package/lib/typescript/commonjs/components/Attachments.d.ts +16 -0
- package/lib/typescript/commonjs/components/NewSupportTicket.d.ts +12 -0
- package/lib/typescript/commonjs/components/PhotoTray.d.ts +17 -0
- package/lib/typescript/commonjs/components/SupportContact.d.ts +7 -0
- package/lib/typescript/commonjs/components/SupportTicketDetail.d.ts +7 -0
- package/lib/typescript/commonjs/components/SupportTicketList.d.ts +28 -0
- package/lib/typescript/commonjs/device.d.ts +6 -0
- package/lib/typescript/commonjs/files.d.ts +10 -0
- package/lib/typescript/commonjs/format.d.ts +10 -0
- package/lib/typescript/commonjs/index.d.ts +15 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/photos.d.ts +16 -0
- package/lib/typescript/commonjs/report/ReportIssueButton.d.ts +14 -0
- package/lib/typescript/commonjs/report/captureAndReport.d.ts +15 -0
- package/lib/typescript/commonjs/report/index.d.ts +11 -0
- package/lib/typescript/commonjs/share/index.d.ts +10 -0
- package/lib/typescript/commonjs/types.d.ts +152 -0
- package/lib/typescript/commonjs/validation.d.ts +10 -0
- package/lib/typescript/module/SupportProvider.d.ts +82 -0
- package/lib/typescript/module/client.d.ts +63 -0
- package/lib/typescript/module/clipboard.d.ts +3 -0
- package/lib/typescript/module/components/Attachments.d.ts +16 -0
- package/lib/typescript/module/components/NewSupportTicket.d.ts +12 -0
- package/lib/typescript/module/components/PhotoTray.d.ts +17 -0
- package/lib/typescript/module/components/SupportContact.d.ts +7 -0
- package/lib/typescript/module/components/SupportTicketDetail.d.ts +7 -0
- package/lib/typescript/module/components/SupportTicketList.d.ts +28 -0
- package/lib/typescript/module/device.d.ts +6 -0
- package/lib/typescript/module/files.d.ts +10 -0
- package/lib/typescript/module/format.d.ts +10 -0
- package/lib/typescript/module/index.d.ts +15 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/photos.d.ts +16 -0
- package/lib/typescript/module/report/ReportIssueButton.d.ts +14 -0
- package/lib/typescript/module/report/captureAndReport.d.ts +15 -0
- package/lib/typescript/module/report/index.d.ts +11 -0
- package/lib/typescript/module/share/index.d.ts +10 -0
- package/lib/typescript/module/types.d.ts +152 -0
- package/lib/typescript/module/validation.d.ts +10 -0
- package/package.json +124 -0
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wire shapes of the Webority Support HTTP contract. Field names are the camelCase
|
|
3
|
+
* of the backend's view records and enums travel as their member names, so these
|
|
4
|
+
* mirror `Webority.Support/SupportViews.cs` and `SupportEnums.cs` exactly.
|
|
5
|
+
*/
|
|
6
|
+
export type SupportTicketStatus = 'Open' | 'InProgress' | 'Resolved' | 'Closed';
|
|
7
|
+
export type SupportTicketPriority = 'Low' | 'Normal' | 'High' | 'Urgent';
|
|
8
|
+
export type SupportMessageAuthorKind = 'Customer' | 'Agent' | 'System';
|
|
9
|
+
export type SupportAttachmentKind = 'Screenshot' | 'File';
|
|
10
|
+
export type SupportSatisfaction = 'Satisfied' | 'Unsatisfied';
|
|
11
|
+
export interface SupportContactInfo {
|
|
12
|
+
productName: string;
|
|
13
|
+
supportEmail: string;
|
|
14
|
+
supportName: string;
|
|
15
|
+
supportPhone: string | null;
|
|
16
|
+
supportHours: string | null;
|
|
17
|
+
categories: string[];
|
|
18
|
+
maxAttachmentBytes: number;
|
|
19
|
+
maxAttachmentsPerMessage: number;
|
|
20
|
+
allowedContentTypes: string[];
|
|
21
|
+
subjectMaxLength: number;
|
|
22
|
+
bodyMaxLength: number;
|
|
23
|
+
satisfactionCommentMaxLength: number;
|
|
24
|
+
}
|
|
25
|
+
export interface SupportTicketSummary {
|
|
26
|
+
id: string;
|
|
27
|
+
number: string;
|
|
28
|
+
category: string;
|
|
29
|
+
subject: string;
|
|
30
|
+
status: SupportTicketStatus;
|
|
31
|
+
statusLabel: string;
|
|
32
|
+
messageCount: number;
|
|
33
|
+
awaitingCustomer: boolean;
|
|
34
|
+
createdDateTimeUtc: string;
|
|
35
|
+
updatedDateTimeUtc: string;
|
|
36
|
+
}
|
|
37
|
+
/** The fleet pagination shape `GET {base}/tickets` returns. */
|
|
38
|
+
export interface SupportPage<T> {
|
|
39
|
+
items: T[];
|
|
40
|
+
page: number;
|
|
41
|
+
pageSize: number;
|
|
42
|
+
totalCount: number;
|
|
43
|
+
totalPages: number;
|
|
44
|
+
}
|
|
45
|
+
/** `GET {base}/tickets`. Empty or missing fields are left off the request. */
|
|
46
|
+
export interface SupportTicketQuery {
|
|
47
|
+
status?: SupportTicketStatus;
|
|
48
|
+
/** Matches the subject or the ticket number. */
|
|
49
|
+
search?: string;
|
|
50
|
+
/** 1-based. The server defaults to 1. */
|
|
51
|
+
page?: number;
|
|
52
|
+
/** The server defaults to 20 and caps at 100. */
|
|
53
|
+
pageSize?: number;
|
|
54
|
+
}
|
|
55
|
+
/** `GET {base}/tickets/counts`: the caller's tickets by status. */
|
|
56
|
+
export interface SupportTicketCounts {
|
|
57
|
+
open: number;
|
|
58
|
+
inProgress: number;
|
|
59
|
+
resolved: number;
|
|
60
|
+
closed: number;
|
|
61
|
+
total: number;
|
|
62
|
+
}
|
|
63
|
+
export interface SupportAttachmentView {
|
|
64
|
+
id: string;
|
|
65
|
+
fileName: string;
|
|
66
|
+
contentType: string;
|
|
67
|
+
sizeBytes: number;
|
|
68
|
+
kind: SupportAttachmentKind;
|
|
69
|
+
}
|
|
70
|
+
export interface SupportMessageView {
|
|
71
|
+
id: string;
|
|
72
|
+
authorKind: SupportMessageAuthorKind;
|
|
73
|
+
authorName: string | null;
|
|
74
|
+
body: string;
|
|
75
|
+
isInternal: boolean;
|
|
76
|
+
createdDateTimeUtc: string;
|
|
77
|
+
attachments: SupportAttachmentView[];
|
|
78
|
+
}
|
|
79
|
+
export interface SupportTicketDetail {
|
|
80
|
+
id: string;
|
|
81
|
+
number: string;
|
|
82
|
+
/** Null on the customer view: internal ids never leave the platform. */
|
|
83
|
+
accountId: number | null;
|
|
84
|
+
/** Null on the customer view. */
|
|
85
|
+
realm: string | null;
|
|
86
|
+
category: string;
|
|
87
|
+
subject: string;
|
|
88
|
+
status: SupportTicketStatus;
|
|
89
|
+
statusLabel: string;
|
|
90
|
+
priority: SupportTicketPriority | null;
|
|
91
|
+
reporterName: string;
|
|
92
|
+
reporterEmail: string;
|
|
93
|
+
assignedAgentUserId: number | null;
|
|
94
|
+
assignedAgentName: string | null;
|
|
95
|
+
dueDateTimeUtc: string | null;
|
|
96
|
+
isOverdue: boolean;
|
|
97
|
+
pageUrl: string | null;
|
|
98
|
+
userAgent: string | null;
|
|
99
|
+
appVersion: string | null;
|
|
100
|
+
satisfaction: SupportSatisfaction | null;
|
|
101
|
+
satisfactionComment: string | null;
|
|
102
|
+
canReopen: boolean;
|
|
103
|
+
canRate: boolean;
|
|
104
|
+
createdDateTimeUtc: string;
|
|
105
|
+
updatedDateTimeUtc: string;
|
|
106
|
+
resolvedDateTimeUtc: string | null;
|
|
107
|
+
closedDateTimeUtc: string | null;
|
|
108
|
+
messages: SupportMessageView[];
|
|
109
|
+
/** Opaque. Changes whenever the ticket changes. */
|
|
110
|
+
version: string;
|
|
111
|
+
}
|
|
112
|
+
/** A local file as React Native's FormData takes it. */
|
|
113
|
+
export interface SupportFilePart {
|
|
114
|
+
uri: string;
|
|
115
|
+
name: string;
|
|
116
|
+
type: string;
|
|
117
|
+
/** Bytes, when the picker knew it. Used for the size check only; never sent. */
|
|
118
|
+
size?: number;
|
|
119
|
+
}
|
|
120
|
+
export interface NewSupportTicketInput {
|
|
121
|
+
category: string;
|
|
122
|
+
subject: string;
|
|
123
|
+
body: string;
|
|
124
|
+
pageUrl?: string;
|
|
125
|
+
userAgent?: string;
|
|
126
|
+
appVersion?: string;
|
|
127
|
+
files?: SupportFilePart[];
|
|
128
|
+
screenshots?: SupportFilePart[];
|
|
129
|
+
}
|
|
130
|
+
export interface SupportReplyInput {
|
|
131
|
+
body: string;
|
|
132
|
+
files?: SupportFilePart[];
|
|
133
|
+
screenshots?: SupportFilePart[];
|
|
134
|
+
}
|
|
135
|
+
export interface SupportRatingInput {
|
|
136
|
+
satisfaction: SupportSatisfaction;
|
|
137
|
+
comment?: string;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* What the report-an-issue flow hands to the new ticket screen: the captured
|
|
141
|
+
* screenshot and where it was taken.
|
|
142
|
+
*/
|
|
143
|
+
export interface SupportTicketDraft {
|
|
144
|
+
category?: string;
|
|
145
|
+
subject?: string;
|
|
146
|
+
body?: string;
|
|
147
|
+
pageUrl?: string;
|
|
148
|
+
userAgent?: string;
|
|
149
|
+
appVersion?: string;
|
|
150
|
+
screenshots?: SupportFilePart[];
|
|
151
|
+
}
|
|
152
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { SupportContactInfo, SupportFilePart } from './types';
|
|
2
|
+
export declare const validateCategory: (category: string, config: SupportContactInfo) => string | undefined;
|
|
3
|
+
/** Limits come from GET /settings, so the product's own values are the only copy. */
|
|
4
|
+
type Limits = Pick<SupportContactInfo, 'subjectMaxLength' | 'bodyMaxLength'>;
|
|
5
|
+
export declare const validateSubject: (subject: string, limits: Limits) => string | undefined;
|
|
6
|
+
export declare const validateBody: (body: string, limits: Limits) => string | undefined;
|
|
7
|
+
/** Checks every file on one message against the product's limits. The first problem wins. */
|
|
8
|
+
export declare const validateFiles: (files: SupportFilePart[], config: SupportContactInfo) => string | undefined;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=validation.d.ts.map
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import { SupportApiError, type SupportClient } from './client.js';
|
|
3
|
+
import type { NewSupportTicketInput, SupportAttachmentView, SupportContactInfo, SupportRatingInput, SupportReplyInput, SupportTicketCounts, SupportTicketDetail, SupportTicketStatus, SupportTicketSummary } from './types.js';
|
|
4
|
+
/** A downloaded attachment, ready for the OS to open. */
|
|
5
|
+
export interface SupportFileToOpen {
|
|
6
|
+
/** A `file://` URI in the app's cache. */
|
|
7
|
+
uri: string;
|
|
8
|
+
name: string;
|
|
9
|
+
contentType: string;
|
|
10
|
+
}
|
|
11
|
+
/** Hands a downloaded file to the OS. `shareSupportFile` from the `/share` entry is one. */
|
|
12
|
+
export type SupportFileOpener = (file: SupportFileToOpen) => Promise<void>;
|
|
13
|
+
type AttachmentOpener = (attachment: Pick<SupportAttachmentView, 'id' | 'fileName' | 'contentType'>) => Promise<void>;
|
|
14
|
+
export interface SupportProviderProps {
|
|
15
|
+
client: SupportClient;
|
|
16
|
+
/**
|
|
17
|
+
* Opens a file that is not an image (a PDF, a text file). Leave it out and those
|
|
18
|
+
* attachments show their name and size only.
|
|
19
|
+
*/
|
|
20
|
+
openFile?: SupportFileOpener;
|
|
21
|
+
children: React.ReactNode;
|
|
22
|
+
}
|
|
23
|
+
export declare const SupportProvider: React.FC<SupportProviderProps>;
|
|
24
|
+
export declare const useSupportClient: () => SupportClient;
|
|
25
|
+
/** @internal Used by the attachment thumbnails. */
|
|
26
|
+
export declare const useAttachmentLoader: () => (attachment: Pick<SupportAttachmentView, "id" | "contentType">) => Promise<string>;
|
|
27
|
+
/** @internal Used by the file rows; null when the app gave no `openFile`. */
|
|
28
|
+
export declare const useAttachmentOpener: () => AttachmentOpener | null;
|
|
29
|
+
export interface SupportConfigState {
|
|
30
|
+
config: SupportContactInfo | null;
|
|
31
|
+
loading: boolean;
|
|
32
|
+
error: SupportApiError | null;
|
|
33
|
+
reload: () => Promise<void>;
|
|
34
|
+
}
|
|
35
|
+
export declare const useSupportConfig: () => SupportConfigState;
|
|
36
|
+
export interface SupportTicketsOptions {
|
|
37
|
+
/** Tickets per page. The server defaults to 20 and caps at 100. */
|
|
38
|
+
pageSize?: number;
|
|
39
|
+
}
|
|
40
|
+
export interface SupportTicketsState {
|
|
41
|
+
/** Every page loaded so far for the current status and search. */
|
|
42
|
+
tickets: SupportTicketSummary[];
|
|
43
|
+
/** All of the caller's tickets by status, whatever the filter. Null until first loaded. */
|
|
44
|
+
counts: SupportTicketCounts | null;
|
|
45
|
+
status: SupportTicketStatus | null;
|
|
46
|
+
search: string;
|
|
47
|
+
/** Null shows every status. Starts again from the first page. */
|
|
48
|
+
setStatus: (status: SupportTicketStatus | null) => void;
|
|
49
|
+
/** Matches the subject or the ticket number. Starts again from the first page. */
|
|
50
|
+
setSearch: (search: string) => void;
|
|
51
|
+
/** The first page for the current status and search is loading. */
|
|
52
|
+
loading: boolean;
|
|
53
|
+
refreshing: boolean;
|
|
54
|
+
loadingMore: boolean;
|
|
55
|
+
hasMore: boolean;
|
|
56
|
+
error: SupportApiError | null;
|
|
57
|
+
/** The last failed next page. The pages already loaded stay. */
|
|
58
|
+
loadMoreError: SupportApiError | null;
|
|
59
|
+
/** Reloads the counts and the first page. */
|
|
60
|
+
refresh: () => Promise<void>;
|
|
61
|
+
/** Loads the next page, when there is one and nothing else is loading. */
|
|
62
|
+
loadMore: () => Promise<void>;
|
|
63
|
+
createTicket: (input: NewSupportTicketInput) => Promise<SupportTicketDetail>;
|
|
64
|
+
}
|
|
65
|
+
export declare const useSupportTickets: (options?: SupportTicketsOptions) => SupportTicketsState;
|
|
66
|
+
/** Raises a ticket and tells every mounted ticket list to refetch. */
|
|
67
|
+
export declare const useCreateSupportTicket: () => ((input: NewSupportTicketInput) => Promise<SupportTicketDetail>);
|
|
68
|
+
export interface SupportTicketState {
|
|
69
|
+
ticket: SupportTicketDetail | null;
|
|
70
|
+
loading: boolean;
|
|
71
|
+
error: SupportApiError | null;
|
|
72
|
+
/** The last reply, reopen or rating failure, for showing beside the action. */
|
|
73
|
+
actionError: SupportApiError | null;
|
|
74
|
+
busy: boolean;
|
|
75
|
+
reload: () => Promise<void>;
|
|
76
|
+
reply: (input: SupportReplyInput) => Promise<boolean>;
|
|
77
|
+
reopen: () => Promise<boolean>;
|
|
78
|
+
rate: (input: SupportRatingInput) => Promise<boolean>;
|
|
79
|
+
}
|
|
80
|
+
export declare const useSupportTicket: (id: string) => SupportTicketState;
|
|
81
|
+
export {};
|
|
82
|
+
//# sourceMappingURL=SupportProvider.d.ts.map
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { NewSupportTicketInput, SupportAttachmentView, SupportContactInfo, SupportPage, SupportRatingInput, SupportReplyInput, SupportTicketCounts, SupportTicketDetail, SupportTicketQuery, SupportTicketSummary } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* The slice of an HTTP client the support client needs. The app's signed-in
|
|
4
|
+
* axios instance (mobile-core's `userClient`, or its own) satisfies it as is, so
|
|
5
|
+
* whatever it adds to a request (bearer token, tenant header, refresh on 401)
|
|
6
|
+
* applies to support calls too. Declared structurally so no axios type leaks into
|
|
7
|
+
* this package's declarations.
|
|
8
|
+
*/
|
|
9
|
+
export interface SupportHttpRequestConfig {
|
|
10
|
+
headers?: Record<string, string>;
|
|
11
|
+
timeout?: number;
|
|
12
|
+
responseType?: 'arraybuffer' | 'json';
|
|
13
|
+
}
|
|
14
|
+
export interface SupportHttpClient {
|
|
15
|
+
get<T = unknown>(url: string, config?: SupportHttpRequestConfig): Promise<{
|
|
16
|
+
data: T;
|
|
17
|
+
}>;
|
|
18
|
+
post<T = unknown>(url: string, body?: unknown, config?: SupportHttpRequestConfig): Promise<{
|
|
19
|
+
data: T;
|
|
20
|
+
}>;
|
|
21
|
+
}
|
|
22
|
+
export declare const OFFLINE_MESSAGE = "You are offline. Check your connection and try again.";
|
|
23
|
+
export declare const GENERIC_MESSAGE = "Something went wrong. Try again in a moment.";
|
|
24
|
+
/**
|
|
25
|
+
* A failed support call. `message` is written for the person and is shown as is;
|
|
26
|
+
* `code` is the backend's stable code, for branching only.
|
|
27
|
+
*/
|
|
28
|
+
export declare class SupportApiError extends Error {
|
|
29
|
+
readonly code: string;
|
|
30
|
+
readonly status: number | null;
|
|
31
|
+
constructor(code: string, message: string, status: number | null);
|
|
32
|
+
}
|
|
33
|
+
/** Turns whatever the HTTP client threw into a SupportApiError. */
|
|
34
|
+
export declare const toSupportApiError: (error: unknown) => SupportApiError;
|
|
35
|
+
export declare const encodeBase64: (buffer: ArrayBuffer) => string;
|
|
36
|
+
export interface SupportClient {
|
|
37
|
+
readonly basePath: string;
|
|
38
|
+
getConfig(): Promise<SupportContactInfo>;
|
|
39
|
+
/** One page of the caller's tickets, most recently updated first. */
|
|
40
|
+
listTickets(query?: SupportTicketQuery): Promise<SupportPage<SupportTicketSummary>>;
|
|
41
|
+
/** The caller's tickets counted by status, for labelling the status filters. */
|
|
42
|
+
getTicketCounts(): Promise<SupportTicketCounts>;
|
|
43
|
+
getTicket(id: string): Promise<SupportTicketDetail>;
|
|
44
|
+
createTicket(input: NewSupportTicketInput): Promise<SupportTicketDetail>;
|
|
45
|
+
reply(id: string, input: SupportReplyInput): Promise<SupportTicketDetail>;
|
|
46
|
+
reopen(id: string): Promise<SupportTicketDetail>;
|
|
47
|
+
rate(id: string, input: SupportRatingInput): Promise<SupportTicketDetail>;
|
|
48
|
+
/** An attachment's raw bytes, fetched through the same authenticated client. */
|
|
49
|
+
getAttachmentBytes(id: string): Promise<ArrayBuffer>;
|
|
50
|
+
/**
|
|
51
|
+
* An attachment's bytes as a `data:` URI an `<Image>` can show. Fetched through
|
|
52
|
+
* the same authenticated client as every other call.
|
|
53
|
+
*/
|
|
54
|
+
getAttachmentDataUri(attachment: Pick<SupportAttachmentView, 'id' | 'contentType'>): Promise<string>;
|
|
55
|
+
/**
|
|
56
|
+
* The person's yes to a support action an assistant prepared (raise a ticket, reply on
|
|
57
|
+
* one, reopen one). Only this call completes it. Resolves to the ticket it acted on; an
|
|
58
|
+
* expired or unknown token rejects with the code `action_expired`.
|
|
59
|
+
*/
|
|
60
|
+
confirmAction(token: string): Promise<SupportTicketDetail>;
|
|
61
|
+
}
|
|
62
|
+
export declare const createSupportClient: (http: SupportHttpClient, basePath?: string) => SupportClient;
|
|
63
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { SupportAttachmentView } from '../types.js';
|
|
3
|
+
/** A message's files: images as tappable thumbnails, anything else as a file row. */
|
|
4
|
+
export declare const AttachmentList: React.FC<{
|
|
5
|
+
attachments: SupportAttachmentView[];
|
|
6
|
+
onOpenImage: (uri: string, name: string) => void;
|
|
7
|
+
}>;
|
|
8
|
+
/** Full-screen view of one image with pinch to zoom. */
|
|
9
|
+
export declare const ImageViewer: React.FC<{
|
|
10
|
+
image: {
|
|
11
|
+
uri: string;
|
|
12
|
+
name: string;
|
|
13
|
+
} | null;
|
|
14
|
+
onClose: () => void;
|
|
15
|
+
}>;
|
|
16
|
+
//# sourceMappingURL=Attachments.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { SupportTicketDetail, SupportTicketDraft } from '../types.js';
|
|
3
|
+
export interface NewSupportTicketProps {
|
|
4
|
+
/** Called with the created ticket; navigate to its detail from here. */
|
|
5
|
+
onCreated: (ticket: SupportTicketDetail) => void;
|
|
6
|
+
onCancel?: () => void;
|
|
7
|
+
/** Prefill, typically from the report-an-issue button: screenshot, page and device. */
|
|
8
|
+
initialDraft?: SupportTicketDraft;
|
|
9
|
+
testID?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const NewSupportTicket: React.FC<NewSupportTicketProps>;
|
|
12
|
+
//# sourceMappingURL=NewSupportTicket.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { SupportFilePart } from '../types.js';
|
|
3
|
+
export interface PhotoTrayProps {
|
|
4
|
+
photos: SupportFilePart[];
|
|
5
|
+
onChange: (photos: SupportFilePart[]) => void;
|
|
6
|
+
/** Photos this message may still take, after anything else attached to it. */
|
|
7
|
+
remaining: number;
|
|
8
|
+
maxBytes: number;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
/** A heading above the tray. */
|
|
11
|
+
label?: string;
|
|
12
|
+
/** False shows the photos with remove buttons only, for a prefilled screenshot. */
|
|
13
|
+
allowAdd?: boolean;
|
|
14
|
+
}
|
|
15
|
+
/** Photos on a message: thumbnails with remove buttons, plus library and camera buttons. */
|
|
16
|
+
export declare const PhotoTray: React.FC<PhotoTrayProps>;
|
|
17
|
+
//# sourceMappingURL=PhotoTray.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
export interface SupportContactProps {
|
|
3
|
+
testID?: string;
|
|
4
|
+
}
|
|
5
|
+
/** How to reach the support team: email with copy and compose, phone, and hours. */
|
|
6
|
+
export declare const SupportContact: React.FC<SupportContactProps>;
|
|
7
|
+
//# sourceMappingURL=SupportContact.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type StatusBadgeTone } from '@webority/mobile-ui';
|
|
2
|
+
import type React from 'react';
|
|
3
|
+
import type { SupportTicketCounts, SupportTicketStatus, SupportTicketSummary } from '../types.js';
|
|
4
|
+
export declare const STATUS_TONES: Record<SupportTicketStatus, StatusBadgeTone>;
|
|
5
|
+
declare const ALL = "all";
|
|
6
|
+
export interface StatusFilterOption {
|
|
7
|
+
value: SupportTicketStatus | typeof ALL;
|
|
8
|
+
label: string;
|
|
9
|
+
count: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* All, then each status that has tickets. The selected status stays even at
|
|
13
|
+
* zero, so the chip the person is on never vanishes under them.
|
|
14
|
+
*/
|
|
15
|
+
export declare const statusFilterOptions: (counts: SupportTicketCounts, selected: SupportTicketStatus | null) => StatusFilterOption[];
|
|
16
|
+
export interface SupportTicketListProps {
|
|
17
|
+
onOpenTicket: (ticket: SupportTicketSummary) => void;
|
|
18
|
+
/** Shows a New ticket button in the header and the empty state. */
|
|
19
|
+
onNewTicket?: () => void;
|
|
20
|
+
/** Content above the list, for example a SupportContact card. */
|
|
21
|
+
header?: React.ReactElement;
|
|
22
|
+
/** Tickets per page. Default 20. */
|
|
23
|
+
pageSize?: number;
|
|
24
|
+
testID?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare const SupportTicketList: React.FC<SupportTicketListProps>;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=SupportTicketList.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { SupportAttachmentView } from './types.js';
|
|
2
|
+
/** A server-supplied name reduced to one path segment, so it cannot leave the cache folder. */
|
|
3
|
+
export declare const safeFileName: (name: string) => string;
|
|
4
|
+
/**
|
|
5
|
+
* Writes an attachment to the app's cache and returns its `file://` URI. The id
|
|
6
|
+
* prefix keeps two tickets' `report.pdf` apart. Attachments never change once
|
|
7
|
+
* stored, so a file already on disk is reused rather than fetched again.
|
|
8
|
+
*/
|
|
9
|
+
export declare const saveAttachmentToCache: (attachment: Pick<SupportAttachmentView, "id" | "fileName">, loadBytes: () => Promise<ArrayBuffer>) => Promise<string>;
|
|
10
|
+
//# sourceMappingURL=files.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A timestamp in the device's own time zone. The backend sends UTC; mobile-core's
|
|
3
|
+
* formatter goes through Intl without pinning a zone, so the reader sees their
|
|
4
|
+
* own clock.
|
|
5
|
+
*/
|
|
6
|
+
export declare const formatWhen: (utc: string | null | undefined) => string;
|
|
7
|
+
/** A byte count as a person reads it. */
|
|
8
|
+
export declare const formatBytes: (bytes: number) => string;
|
|
9
|
+
export declare const isImage: (contentType: string) => boolean;
|
|
10
|
+
//# sourceMappingURL=format.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type { SupportClient, SupportHttpClient, SupportHttpRequestConfig } from './client.js';
|
|
2
|
+
export { createSupportClient, SupportApiError, toSupportApiError } from './client.js';
|
|
3
|
+
export type { NewSupportTicketProps } from './components/NewSupportTicket.js';
|
|
4
|
+
export { NewSupportTicket } from './components/NewSupportTicket.js';
|
|
5
|
+
export type { SupportContactProps } from './components/SupportContact.js';
|
|
6
|
+
export { SupportContact } from './components/SupportContact.js';
|
|
7
|
+
export type { SupportTicketDetailProps } from './components/SupportTicketDetail.js';
|
|
8
|
+
export { SupportTicketDetail } from './components/SupportTicketDetail.js';
|
|
9
|
+
export type { SupportTicketListProps } from './components/SupportTicketList.js';
|
|
10
|
+
export { SupportTicketList } from './components/SupportTicketList.js';
|
|
11
|
+
export { describeDevice } from './device.js';
|
|
12
|
+
export type { SupportConfigState, SupportFileOpener, SupportFileToOpen, SupportProviderProps, SupportTicketState, SupportTicketsOptions, SupportTicketsState } from './SupportProvider.js';
|
|
13
|
+
export { SupportProvider, useCreateSupportTicket, useSupportClient, useSupportConfig, useSupportTicket, useSupportTickets } from './SupportProvider.js';
|
|
14
|
+
export type { NewSupportTicketInput, SupportAttachmentKind, SupportAttachmentView, SupportContactInfo, SupportFilePart, SupportMessageAuthorKind, SupportMessageView, SupportPage, SupportRatingInput, SupportReplyInput, SupportSatisfaction, SupportTicketCounts, SupportTicketDetail as SupportTicketDetailView, SupportTicketDraft, SupportTicketPriority, SupportTicketQuery, SupportTicketStatus, SupportTicketSummary } from './types.js';
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { SupportFilePart } from './types.js';
|
|
2
|
+
export type PhotoSource = 'library' | 'camera';
|
|
3
|
+
export declare class PhotoPermissionError extends Error {
|
|
4
|
+
readonly source: PhotoSource;
|
|
5
|
+
constructor(source: PhotoSource);
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Lets the person pick or take photos and returns them ready to upload,
|
|
9
|
+
* compressed to fit the product's per-file limit. An empty list means they
|
|
10
|
+
* cancelled.
|
|
11
|
+
*/
|
|
12
|
+
export declare const pickPhotos: (source: PhotoSource, options: {
|
|
13
|
+
maxCount: number;
|
|
14
|
+
maxBytes: number;
|
|
15
|
+
}) => Promise<SupportFilePart[]>;
|
|
16
|
+
//# sourceMappingURL=photos.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type ButtonProps } from '@webority/mobile-ui';
|
|
2
|
+
import type React from 'react';
|
|
3
|
+
import type { SupportTicketDraft } from '../types.js';
|
|
4
|
+
import { type CaptureAndReportOptions } from './captureAndReport.js';
|
|
5
|
+
export interface ReportIssueButtonProps extends CaptureAndReportOptions, Omit<ButtonProps, 'onPress' | 'title' | 'children' | 'loading'> {
|
|
6
|
+
/** Open the new ticket screen with this draft, for example `navigation.navigate('NewTicket', { draft })`. */
|
|
7
|
+
onReport: (draft: SupportTicketDraft) => void;
|
|
8
|
+
/** Called when the screen could not be captured. The draft still opens, without a screenshot. */
|
|
9
|
+
onCaptureError?: (error: unknown) => void;
|
|
10
|
+
title?: string;
|
|
11
|
+
}
|
|
12
|
+
/** A button that screenshots the current screen and hands a prefilled ticket draft to the app. */
|
|
13
|
+
export declare const ReportIssueButton: React.FC<ReportIssueButtonProps>;
|
|
14
|
+
//# sourceMappingURL=ReportIssueButton.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { SupportTicketDraft } from '../types.js';
|
|
2
|
+
export interface CaptureAndReportOptions {
|
|
3
|
+
/** The current screen or route name. Sent as the ticket's page. */
|
|
4
|
+
screenName: string;
|
|
5
|
+
/** The app's user-visible version, for example from its compiled appsettings. */
|
|
6
|
+
appVersion?: string;
|
|
7
|
+
category?: string;
|
|
8
|
+
subject?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Captures what is on screen right now and returns a draft for NewSupportTicket
|
|
12
|
+
* with the image under `screenshots`, plus the page, device and app version.
|
|
13
|
+
*/
|
|
14
|
+
export declare const captureAndReport: (options: CaptureAndReportOptions) => Promise<SupportTicketDraft>;
|
|
15
|
+
//# sourceMappingURL=captureAndReport.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Report an issue. A separate entry point because it names react-native-view-shot,
|
|
3
|
+
* an optional peer: Metro resolves every require reachable from an import, so
|
|
4
|
+
* keeping it off the main barrel lets an app skip the package when it does not
|
|
5
|
+
* use this button.
|
|
6
|
+
*/
|
|
7
|
+
export type { CaptureAndReportOptions } from './captureAndReport.js';
|
|
8
|
+
export { captureAndReport } from './captureAndReport.js';
|
|
9
|
+
export type { ReportIssueButtonProps } from './ReportIssueButton.js';
|
|
10
|
+
export { ReportIssueButton } from './ReportIssueButton.js';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { SupportFileOpener } from '../SupportProvider.js';
|
|
2
|
+
export declare class SupportShareUnavailableError extends Error {
|
|
3
|
+
constructor();
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Hands a downloaded attachment to the OS share sheet, where the person can open
|
|
7
|
+
* it in a viewer or save it. Pass it to `SupportProvider` as `openFile`.
|
|
8
|
+
*/
|
|
9
|
+
export declare const shareSupportFile: SupportFileOpener;
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|