@antelopejs/dms-saas 0.3.1 → 0.3.3
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 -86
- package/dist/config/runtime.d.ts +0 -1
- package/dist/config/runtime.js +0 -7
- package/dist/config/runtime.js.map +1 -1
- package/dist/data-api/platformOwner/index.d.ts +0 -1
- package/dist/data-api/platformOwner/index.js +0 -1
- package/dist/data-api/platformOwner/index.js.map +1 -1
- package/dist/data-api/tenant/index.d.ts +0 -1
- package/dist/data-api/tenant/index.js +0 -1
- package/dist/data-api/tenant/index.js.map +1 -1
- package/dist/notifications/subjects.d.ts +0 -2
- package/dist/notifications/subjects.js +1 -13
- package/dist/notifications/subjects.js.map +1 -1
- package/dist/pages/platform/categories.d.ts +0 -1
- package/dist/pages/platform/categories.js +1 -8
- package/dist/pages/platform/categories.js.map +1 -1
- package/dist/pages/platform/index.d.ts +0 -1
- package/dist/pages/platform/index.js +0 -1
- package/dist/pages/platform/index.js.map +1 -1
- package/dist/pages/tenant/index.d.ts +0 -1
- package/dist/pages/tenant/index.js +0 -1
- package/dist/pages/tenant/index.js.map +1 -1
- package/dist/routes/platformOwner/index.d.ts +0 -1
- package/dist/routes/platformOwner/index.js +0 -1
- package/dist/routes/platformOwner/index.js.map +1 -1
- package/dist/routes/public/register.js +1 -3
- package/dist/routes/public/register.js.map +1 -1
- package/dist/routes/tenant/index.d.ts +0 -1
- package/dist/routes/tenant/index.js +0 -1
- package/dist/routes/tenant/index.js.map +1 -1
- package/dist/routes/tenant/tenant-billing.d.ts +2 -1
- package/dist/routes/tenant/tenant-billing.js +14 -11
- package/dist/routes/tenant/tenant-billing.js.map +1 -1
- package/dist/stripe/webhook-handlers.js +19 -20
- package/dist/stripe/webhook-handlers.js.map +1 -1
- package/dist/stripe/webhook-shared.js +9 -11
- package/dist/stripe/webhook-shared.js.map +1 -1
- package/dist/types/config.d.ts +0 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/keyed-insert.d.ts +7 -0
- package/dist/utils/keyed-insert.js +14 -0
- package/dist/utils/keyed-insert.js.map +1 -0
- package/dist/workspaces/provisioning.js +22 -27
- package/dist/workspaces/provisioning.js.map +1 -1
- package/frontend-vue/i18n/locales/saas-en-GB.json +1 -142
- package/frontend-vue/i18n/locales/saas-fr-FR.json +1 -142
- package/package.json +7 -9
- package/dist/data-api/platformOwner/support.d.ts +0 -58
- package/dist/data-api/platformOwner/support.js +0 -111
- package/dist/data-api/platformOwner/support.js.map +0 -1
- package/dist/data-api/support-fields.d.ts +0 -49
- package/dist/data-api/support-fields.js +0 -166
- package/dist/data-api/support-fields.js.map +0 -1
- package/dist/data-api/support-routes.d.ts +0 -10
- package/dist/data-api/support-routes.js +0 -71
- package/dist/data-api/support-routes.js.map +0 -1
- package/dist/data-api/tenant/support.d.ts +0 -39
- package/dist/data-api/tenant/support.js +0 -53
- package/dist/data-api/tenant/support.js.map +0 -1
- package/dist/pages/platform/support.d.ts +0 -9
- package/dist/pages/platform/support.js +0 -29
- package/dist/pages/platform/support.js.map +0 -1
- package/dist/pages/tenant/support.d.ts +0 -9
- package/dist/pages/tenant/support.js +0 -27
- package/dist/pages/tenant/support.js.map +0 -1
- package/dist/routes/platformOwner/support.d.ts +0 -21
- package/dist/routes/platformOwner/support.js +0 -180
- package/dist/routes/platformOwner/support.js.map +0 -1
- package/dist/routes/tenant/support.d.ts +0 -27
- package/dist/routes/tenant/support.js +0 -185
- package/dist/routes/tenant/support.js.map +0 -1
- package/dist/support/admissions.d.ts +0 -36
- package/dist/support/admissions.js +0 -136
- package/dist/support/admissions.js.map +0 -1
- package/dist/support/attachments.d.ts +0 -12
- package/dist/support/attachments.js +0 -56
- package/dist/support/attachments.js.map +0 -1
- package/dist/support/config.d.ts +0 -19
- package/dist/support/config.js +0 -75
- package/dist/support/config.js.map +0 -1
- package/dist/support/index.d.ts +0 -6
- package/dist/support/index.js +0 -23
- package/dist/support/index.js.map +0 -1
- package/dist/support/operations.d.ts +0 -51
- package/dist/support/operations.js +0 -109
- package/dist/support/operations.js.map +0 -1
- package/dist/support/plans.d.ts +0 -6
- package/dist/support/plans.js +0 -130
- package/dist/support/plans.js.map +0 -1
- package/dist/support/publications.d.ts +0 -8
- package/dist/support/publications.js +0 -106
- package/dist/support/publications.js.map +0 -1
- package/dist/support/recovery.d.ts +0 -7
- package/dist/support/recovery.js +0 -43
- package/dist/support/recovery.js.map +0 -1
- package/dist/support/service.d.ts +0 -51
- package/dist/support/service.js +0 -143
- package/dist/support/service.js.map +0 -1
- package/dist/support/transitions.d.ts +0 -4
- package/dist/support/transitions.js +0 -29
- package/dist/support/transitions.js.map +0 -1
- package/dist/support/uploads.d.ts +0 -39
- package/dist/support/uploads.js +0 -115
- package/dist/support/uploads.js.map +0 -1
- package/dist/support/validation.d.ts +0 -15
- package/dist/support/validation.js +0 -54
- package/dist/support/validation.js.map +0 -1
- package/frontend-vue/app/components/PlatformSupport.vue +0 -461
- package/frontend-vue/app/components/SupportAttachmentUpload.vue +0 -140
- package/frontend-vue/app/components/SupportThreadHistory.vue +0 -139
- package/frontend-vue/app/components/TenantSupport.vue +0 -415
- package/frontend-vue/app/composables/useSupportRequest.ts +0 -74
- package/frontend-vue/app/types/support.ts +0 -123
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
interface PendingSupportRequest {
|
|
2
|
-
requestId: string;
|
|
3
|
-
fingerprint: string;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
interface SupportRequestIdentity {
|
|
7
|
-
requestId: string;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
interface SupportTransportError {
|
|
11
|
-
statusCode?: number;
|
|
12
|
-
status?: number;
|
|
13
|
-
data?: unknown;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
type SupportRequestBody<T> = T & SupportRequestIdentity;
|
|
17
|
-
type SupportSender<T, R> = (body: SupportRequestBody<T>) => Promise<R>;
|
|
18
|
-
const TERMINAL_STATUSES = new Set([400, 409, 422]);
|
|
19
|
-
const STORAGE_PREFIX = "saas:support-request:";
|
|
20
|
-
|
|
21
|
-
async function fingerprint(payload: string): Promise<string> {
|
|
22
|
-
const bytes = await crypto.subtle.digest(
|
|
23
|
-
"SHA-256",
|
|
24
|
-
new TextEncoder().encode(payload),
|
|
25
|
-
);
|
|
26
|
-
return Array.from(new Uint8Array(bytes), (byte) =>
|
|
27
|
-
byte.toString(16).padStart(2, "0"),
|
|
28
|
-
).join("");
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function isTerminal(error: unknown): boolean {
|
|
32
|
-
const result = error as SupportTransportError | null;
|
|
33
|
-
return (
|
|
34
|
-
TERMINAL_STATUSES.has(result?.statusCode ?? result?.status ?? 0) &&
|
|
35
|
-
typeof result?.data === "string" &&
|
|
36
|
-
result.data.startsWith("saas.errors.support.")
|
|
37
|
-
);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function clearPending(key: string, value: string): void {
|
|
41
|
-
if (sessionStorage.getItem(key) === value) sessionStorage.removeItem(key);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/** Retains request identity across ambiguous transport and page reloads, without storing message content. */
|
|
45
|
-
export async function sendSupportRequest<T extends object, R>(
|
|
46
|
-
scope: string,
|
|
47
|
-
body: T,
|
|
48
|
-
send: SupportSender<T, R>,
|
|
49
|
-
): Promise<R> {
|
|
50
|
-
const payload = JSON.stringify(body);
|
|
51
|
-
const digest = await fingerprint(payload);
|
|
52
|
-
const key = `${STORAGE_PREFIX}${scope}`;
|
|
53
|
-
const saved = sessionStorage.getItem(key);
|
|
54
|
-
const pending: PendingSupportRequest = saved
|
|
55
|
-
? JSON.parse(saved)
|
|
56
|
-
: { requestId: crypto.randomUUID(), fingerprint: digest };
|
|
57
|
-
if (pending.fingerprint !== digest)
|
|
58
|
-
throw new Error(
|
|
59
|
-
"Retry the pending support request unchanged before submitting different content.",
|
|
60
|
-
);
|
|
61
|
-
const value = JSON.stringify(pending);
|
|
62
|
-
sessionStorage.setItem(key, value);
|
|
63
|
-
try {
|
|
64
|
-
const result = await send({
|
|
65
|
-
...JSON.parse(payload),
|
|
66
|
-
requestId: pending.requestId,
|
|
67
|
-
} as SupportRequestBody<T>);
|
|
68
|
-
clearPending(key, value);
|
|
69
|
-
return result;
|
|
70
|
-
} catch (error) {
|
|
71
|
-
if (isTerminal(error)) clearPending(key, value);
|
|
72
|
-
throw error;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
export type SupportPriority = "low" | "normal" | "high" | "urgent";
|
|
2
|
-
export type SupportStatus =
|
|
3
|
-
| "open"
|
|
4
|
-
| "in_progress"
|
|
5
|
-
| "waiting_customer"
|
|
6
|
-
| "resolved"
|
|
7
|
-
| "closed";
|
|
8
|
-
export type SupportCategory =
|
|
9
|
-
| "question"
|
|
10
|
-
| "incident"
|
|
11
|
-
| "billing"
|
|
12
|
-
| "feature_request";
|
|
13
|
-
|
|
14
|
-
export interface SupportTicketView {
|
|
15
|
-
_id: string;
|
|
16
|
-
subject: string;
|
|
17
|
-
category: SupportCategory;
|
|
18
|
-
priority: SupportPriority;
|
|
19
|
-
status: SupportStatus;
|
|
20
|
-
createdBy: string;
|
|
21
|
-
assignedTo: string | null;
|
|
22
|
-
lastMessageAt: string;
|
|
23
|
-
createdAt: string;
|
|
24
|
-
updatedAt: string;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export interface SupportMessageView {
|
|
28
|
-
_id: string;
|
|
29
|
-
ticketId: string;
|
|
30
|
-
authorId: string;
|
|
31
|
-
authorType: "tenant" | "platform";
|
|
32
|
-
body: string;
|
|
33
|
-
attachments: string[];
|
|
34
|
-
createdAt: string;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export interface SupportPageView<T> {
|
|
38
|
-
results: T[];
|
|
39
|
-
total: number;
|
|
40
|
-
offset: number;
|
|
41
|
-
limit: number;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export type SupportTicketEventType = "status_changed" | "assignment_changed";
|
|
45
|
-
|
|
46
|
-
export interface SupportTicketEventView {
|
|
47
|
-
_id: string;
|
|
48
|
-
ticketId: string;
|
|
49
|
-
actorId: string;
|
|
50
|
-
actorName: string;
|
|
51
|
-
type: SupportTicketEventType;
|
|
52
|
-
previousValue: string | null;
|
|
53
|
-
newValue: string | null;
|
|
54
|
-
createdAt: string;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export interface SupportThreadView {
|
|
58
|
-
ticket: SupportTicketView;
|
|
59
|
-
messages: SupportPageView<SupportMessageView>;
|
|
60
|
-
events: SupportPageView<SupportTicketEventView>;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export interface SupportTicketDetailView {
|
|
64
|
-
ticket: SupportTicketView;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export interface SupportPolicyView {
|
|
68
|
-
level: "community" | "email" | "priority" | "dedicated";
|
|
69
|
-
responseTargetHours: number | null;
|
|
70
|
-
businessHoursOnly: boolean;
|
|
71
|
-
priorities: SupportPriority[];
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export interface SupportConfigView {
|
|
75
|
-
policy: SupportPolicyView;
|
|
76
|
-
uploadPath: string;
|
|
77
|
-
maxAttachmentSize: number;
|
|
78
|
-
allowedMimetypes: string[];
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
export interface SupportAttachmentView {
|
|
82
|
-
resourceKey: string;
|
|
83
|
-
filename: string;
|
|
84
|
-
size: number;
|
|
85
|
-
mimetype: string;
|
|
86
|
-
url: string;
|
|
87
|
-
expiresAt?: number;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
export interface SupportTicketDraft {
|
|
91
|
-
subject: string;
|
|
92
|
-
category: SupportCategory;
|
|
93
|
-
priority: SupportPriority;
|
|
94
|
-
body: string;
|
|
95
|
-
attachments: string[];
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
export interface PlatformSupportTicketView extends SupportTicketView {
|
|
99
|
-
_instance: string;
|
|
100
|
-
tenantName: string;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
export interface PlatformSupportTicketDetailView {
|
|
104
|
-
ticket: SupportTicketView;
|
|
105
|
-
tenantId: string;
|
|
106
|
-
tenantName: string;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
export interface PlatformSupportThreadView extends PlatformSupportTicketDetailView {
|
|
110
|
-
messages: SupportPageView<SupportMessageView>;
|
|
111
|
-
events: SupportPageView<SupportTicketEventView>;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
export interface PlatformOwnerOptionView {
|
|
115
|
-
_id: string;
|
|
116
|
-
name: string;
|
|
117
|
-
email: string;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
export interface SupportTicketPatch {
|
|
121
|
-
status?: SupportStatus;
|
|
122
|
-
assignedTo?: string | null;
|
|
123
|
-
}
|