@managemint-solutions/sdk 0.18.0 → 0.20.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/dist/additional-details/dto.js +2 -2
- package/dist/audit/dto.js +10 -3
- package/dist/audit/dto.js.map +1 -1
- package/dist/billing/dto.d.ts +4 -0
- package/dist/billing/dto.js +5 -1
- package/dist/billing/dto.js.map +1 -1
- package/dist/client.d.ts +2 -0
- package/dist/client.js +3 -0
- package/dist/client.js.map +1 -1
- package/dist/clients/dto.js +4 -4
- package/dist/index.d.ts +4 -1
- package/dist/index.js +12 -1
- package/dist/index.js.map +1 -1
- package/dist/notes/dto.js +2 -2
- package/dist/notifications/dto.js +1 -1
- package/dist/notifications/index.d.ts +8 -0
- package/dist/notifications/index.js +17 -2
- package/dist/notifications/index.js.map +1 -1
- package/dist/organizations/dto.js +1 -1
- package/dist/projects/dto.js +14 -9
- package/dist/projects/dto.js.map +1 -1
- package/dist/service-client/index.d.ts +2 -0
- package/dist/service-client/index.js +7 -0
- package/dist/service-client/index.js.map +1 -1
- package/dist/statuses/dto.js +1 -1
- package/dist/support/tickets/dto.d.ts +33 -0
- package/dist/support/tickets/dto.js +141 -0
- package/dist/support/tickets/dto.js.map +1 -0
- package/dist/support/tickets/index.d.ts +161 -0
- package/dist/support/tickets/index.js +443 -0
- package/dist/support/tickets/index.js.map +1 -0
- package/dist/supporting-files/dto.js +2 -2
- package/dist/tasks/dto.js +20 -13
- package/dist/tasks/dto.js.map +1 -1
- package/dist/transforms.d.ts +2 -2
- package/dist/transforms.js +10 -6
- package/dist/transforms.js.map +1 -1
- package/dist/users/dto.d.ts +30 -1
- package/dist/users/dto.js +126 -2
- package/dist/users/dto.js.map +1 -1
- package/dist/users/index.d.ts +13 -0
- package/dist/users/index.js +32 -0
- package/dist/users/index.js.map +1 -1
- package/dist/users/paths.d.ts +24 -0
- package/dist/users/paths.js +39 -0
- package/dist/users/paths.js.map +1 -0
- package/package.json +8 -3
|
@@ -0,0 +1,443 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.SupportTicketsAdminResource = exports.SupportTicketsResource = void 0;
|
|
18
|
+
const enum_1 = require("@managemint-solutions/entities/support/tickets/enum");
|
|
19
|
+
const enum_2 = require("@managemint-solutions/entities/audit-trail/enum");
|
|
20
|
+
const audit_1 = require("../../audit");
|
|
21
|
+
const errors_1 = require("../../errors");
|
|
22
|
+
const transforms_1 = require("../../transforms");
|
|
23
|
+
__exportStar(require("./dto"), exports);
|
|
24
|
+
const SUPPORT_TICKETS_TABLE = {
|
|
25
|
+
table: 'support_tickets',
|
|
26
|
+
entityType: enum_2.AuditTrailEntityType.SUPPORT_TICKETS,
|
|
27
|
+
};
|
|
28
|
+
const SUPPORT_MESSAGES_TABLE = {
|
|
29
|
+
table: 'support_messages',
|
|
30
|
+
entityType: enum_2.AuditTrailEntityType.SUPPORT_MESSAGES,
|
|
31
|
+
};
|
|
32
|
+
// The public contract is the shared entities types; the casts at the returns declare the shape
|
|
33
|
+
// these select strings produce (the columns are defined in the api's supabase/migrations).
|
|
34
|
+
// `staff` is embedded through the `assigned_to` column, the same way every other embed here
|
|
35
|
+
// names its foreign key column rather than the constraint behind it.
|
|
36
|
+
const STAFF_EMBED = `(
|
|
37
|
+
mms_id,
|
|
38
|
+
name,
|
|
39
|
+
surname
|
|
40
|
+
)`;
|
|
41
|
+
const SUPPORT_TICKET_LIST_SELECT = `
|
|
42
|
+
mms_id,
|
|
43
|
+
created_at,
|
|
44
|
+
updated_at,
|
|
45
|
+
subject,
|
|
46
|
+
status,
|
|
47
|
+
priority,
|
|
48
|
+
category,
|
|
49
|
+
assigned_to_staff:staff!assigned_to ${STAFF_EMBED}
|
|
50
|
+
`;
|
|
51
|
+
const SUPPORT_TICKET_DETAIL_SELECT = `
|
|
52
|
+
mms_id,
|
|
53
|
+
created_at,
|
|
54
|
+
created_by:user_profiles!created_by ${transforms_1.USER_PROFILE_EMBED},
|
|
55
|
+
updated_at,
|
|
56
|
+
subject,
|
|
57
|
+
description,
|
|
58
|
+
status,
|
|
59
|
+
priority,
|
|
60
|
+
category,
|
|
61
|
+
assigned_to_staff:staff!assigned_to ${STAFF_EMBED},
|
|
62
|
+
attachments,
|
|
63
|
+
resolved_at,
|
|
64
|
+
closed_at
|
|
65
|
+
`;
|
|
66
|
+
const SUPPORT_MESSAGE_SELECT = `
|
|
67
|
+
mms_id,
|
|
68
|
+
created_at,
|
|
69
|
+
created_by:user_profiles!created_by ${transforms_1.USER_PROFILE_EMBED},
|
|
70
|
+
author_type,
|
|
71
|
+
author_email,
|
|
72
|
+
source,
|
|
73
|
+
body,
|
|
74
|
+
attachments
|
|
75
|
+
`;
|
|
76
|
+
/**
|
|
77
|
+
* The statuses a client reply may move a ticket out of — every one but `closed`, which is
|
|
78
|
+
* terminal. `resolved` is deliberately in the list: a reply reopens a resolved ticket.
|
|
79
|
+
*/
|
|
80
|
+
const CLIENT_REPLY_FROM = [
|
|
81
|
+
enum_1.SupportTicketStatus.OPEN,
|
|
82
|
+
enum_1.SupportTicketStatus.AWAITING_AGENT,
|
|
83
|
+
enum_1.SupportTicketStatus.AWAITING_USER,
|
|
84
|
+
enum_1.SupportTicketStatus.RESOLVED,
|
|
85
|
+
];
|
|
86
|
+
/**
|
|
87
|
+
* The statuses an agent reply may move a ticket out of. `resolved` is absent — an agent writing
|
|
88
|
+
* on a resolved ticket is a parting note, not a reason to put the ball back in the client's court.
|
|
89
|
+
*/
|
|
90
|
+
const AGENT_REPLY_FROM = [
|
|
91
|
+
enum_1.SupportTicketStatus.OPEN,
|
|
92
|
+
enum_1.SupportTicketStatus.AWAITING_AGENT,
|
|
93
|
+
enum_1.SupportTicketStatus.AWAITING_USER,
|
|
94
|
+
];
|
|
95
|
+
/** The statuses `resolve` may move a ticket out of — anything still live. */
|
|
96
|
+
const RESOLVABLE_FROM = [
|
|
97
|
+
enum_1.SupportTicketStatus.OPEN,
|
|
98
|
+
enum_1.SupportTicketStatus.AWAITING_AGENT,
|
|
99
|
+
enum_1.SupportTicketStatus.AWAITING_USER,
|
|
100
|
+
];
|
|
101
|
+
/** The 400 a portal or admin reply gets when the thread is over. */
|
|
102
|
+
const ticketClosed = () => new errors_1.SupabaseClientError({
|
|
103
|
+
status: 400,
|
|
104
|
+
error: 'Ticket Closed',
|
|
105
|
+
message: 'This ticket is closed and can no longer be replied to.',
|
|
106
|
+
});
|
|
107
|
+
/**
|
|
108
|
+
* A member's own tickets. Every read and write is scoped by `organization_id`, matching the RLS
|
|
109
|
+
* policies, and both tables are audited: `support_tickets` for the ticket and its status moves,
|
|
110
|
+
* `support_messages` for the thread.
|
|
111
|
+
*
|
|
112
|
+
* The write payloads are deliberately narrow. Members hold an INSERT grant on `support_messages`
|
|
113
|
+
* that omits `author_type`/`author_email`/`source`/`email_message_id` — the column defaults do
|
|
114
|
+
* that work, so a member cannot forge an agent message — and an UPDATE grant on
|
|
115
|
+
* `support_tickets` of `(status, updated_at)` only, which is why assignment, resolution and
|
|
116
|
+
* closure live on the admin resource instead.
|
|
117
|
+
*/
|
|
118
|
+
class SupportTicketsResource {
|
|
119
|
+
supabase;
|
|
120
|
+
auth;
|
|
121
|
+
ticketsTable;
|
|
122
|
+
messagesTable;
|
|
123
|
+
constructor(supabase, auth, audit) {
|
|
124
|
+
this.supabase = supabase;
|
|
125
|
+
this.auth = auth;
|
|
126
|
+
this.ticketsTable = (0, audit_1.auditedTable)(supabase, auth, audit, SUPPORT_TICKETS_TABLE);
|
|
127
|
+
this.messagesTable = (0, audit_1.auditedTable)(supabase, auth, audit, SUPPORT_MESSAGES_TABLE);
|
|
128
|
+
}
|
|
129
|
+
async list(query) {
|
|
130
|
+
// `order` returns `this`, so the builder stays a filter builder and the conditional filter
|
|
131
|
+
// below can be reassigned onto it without a cast.
|
|
132
|
+
let ticketsQuery = this.supabase
|
|
133
|
+
.from('support_tickets')
|
|
134
|
+
.select(SUPPORT_TICKET_LIST_SELECT)
|
|
135
|
+
.eq('organization_id', this.auth.organization_id)
|
|
136
|
+
.eq('deleted', false)
|
|
137
|
+
.order('created_at', { ascending: false });
|
|
138
|
+
if (query.status) {
|
|
139
|
+
ticketsQuery = ticketsQuery.eq('status', query.status);
|
|
140
|
+
}
|
|
141
|
+
const { data, error } = await ticketsQuery;
|
|
142
|
+
if (error)
|
|
143
|
+
throw (0, errors_1.mapPostgrestError)(error);
|
|
144
|
+
return data;
|
|
145
|
+
}
|
|
146
|
+
async getById(ticketId) {
|
|
147
|
+
const { data, error } = await this.supabase
|
|
148
|
+
.from('support_tickets')
|
|
149
|
+
.select(SUPPORT_TICKET_DETAIL_SELECT)
|
|
150
|
+
.eq('mms_id', ticketId)
|
|
151
|
+
.eq('organization_id', this.auth.organization_id)
|
|
152
|
+
.single();
|
|
153
|
+
if (error)
|
|
154
|
+
throw (0, errors_1.mapPostgrestError)(error);
|
|
155
|
+
return data;
|
|
156
|
+
}
|
|
157
|
+
/** The thread, oldest first — it is a conversation, and it is append-only. */
|
|
158
|
+
async messages(ticketId) {
|
|
159
|
+
const { data, error } = await this.supabase
|
|
160
|
+
.from('support_messages')
|
|
161
|
+
.select(SUPPORT_MESSAGE_SELECT)
|
|
162
|
+
.eq('organization_id', this.auth.organization_id)
|
|
163
|
+
.eq('ticket_id', ticketId)
|
|
164
|
+
.order('created_at', { ascending: true });
|
|
165
|
+
if (error)
|
|
166
|
+
throw (0, errors_1.mapPostgrestError)(error);
|
|
167
|
+
return data;
|
|
168
|
+
}
|
|
169
|
+
async create(input) {
|
|
170
|
+
// `status` is left out, and so are `priority`/`category` when the caller sent nothing: the
|
|
171
|
+
// column defaults (`open`, `normal`, `other`) are what a new ticket is meant to start as.
|
|
172
|
+
const row = await this.ticketsTable.insert({
|
|
173
|
+
subject: input.subject,
|
|
174
|
+
description: input.description,
|
|
175
|
+
...(input.priority ? { priority: input.priority } : {}),
|
|
176
|
+
...(input.category ? { category: input.category } : {}),
|
|
177
|
+
attachments: input.attachments ?? [],
|
|
178
|
+
organization_id: this.auth.organization_id,
|
|
179
|
+
created_by: this.auth.mms_id,
|
|
180
|
+
});
|
|
181
|
+
return this.getById(row.mms_id);
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* A client's reply. The status is read first because a closed ticket must be refused outright
|
|
185
|
+
* — no row written, a 400 back — rather than silently swallowed by the compare-and-set below.
|
|
186
|
+
*
|
|
187
|
+
* Everything else moves the ticket to `awaiting_agent`, including `resolved`, which is what
|
|
188
|
+
* reopens it. The move is guarded so a reply that races the agent closing the ticket loses
|
|
189
|
+
* cleanly: the message stands, the status does not move.
|
|
190
|
+
*/
|
|
191
|
+
async reply(ticketId, input) {
|
|
192
|
+
const { data, error } = await this.supabase
|
|
193
|
+
.from('support_tickets')
|
|
194
|
+
.select('mms_id, status')
|
|
195
|
+
.eq('mms_id', ticketId)
|
|
196
|
+
.eq('organization_id', this.auth.organization_id)
|
|
197
|
+
.single();
|
|
198
|
+
if (error)
|
|
199
|
+
throw (0, errors_1.mapPostgrestError)(error);
|
|
200
|
+
if (data.status === enum_1.SupportTicketStatus.CLOSED) {
|
|
201
|
+
throw ticketClosed();
|
|
202
|
+
}
|
|
203
|
+
// Only the columns the member's INSERT grant covers — `author_type`, `source` and the rest
|
|
204
|
+
// are the table's defaults, not this caller's to state.
|
|
205
|
+
const row = await this.messagesTable.insert({
|
|
206
|
+
ticket_id: ticketId,
|
|
207
|
+
body: input.body,
|
|
208
|
+
attachments: input.attachments ?? [],
|
|
209
|
+
organization_id: this.auth.organization_id,
|
|
210
|
+
created_by: this.auth.mms_id,
|
|
211
|
+
});
|
|
212
|
+
await this.ticketsTable.updateWhere(ticketId, (query) => query.in('status', CLIENT_REPLY_FROM), {
|
|
213
|
+
status: enum_1.SupportTicketStatus.AWAITING_AGENT,
|
|
214
|
+
updated_at: new Date().toISOString(),
|
|
215
|
+
});
|
|
216
|
+
return this.messageById(row.mms_id);
|
|
217
|
+
}
|
|
218
|
+
/** The just-written message, re-read so the caller gets the entity shape, embed and all. */
|
|
219
|
+
async messageById(messageId) {
|
|
220
|
+
const { data, error } = await this.supabase
|
|
221
|
+
.from('support_messages')
|
|
222
|
+
.select(SUPPORT_MESSAGE_SELECT)
|
|
223
|
+
.eq('mms_id', messageId)
|
|
224
|
+
.eq('organization_id', this.auth.organization_id)
|
|
225
|
+
.single();
|
|
226
|
+
if (error)
|
|
227
|
+
throw (0, errors_1.mapPostgrestError)(error);
|
|
228
|
+
return data;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
exports.SupportTicketsResource = SupportTicketsResource;
|
|
232
|
+
/**
|
|
233
|
+
* The reply tokens, in their own table. Nothing here is granted to `authenticated` at all, which
|
|
234
|
+
* is what lets `support_tickets` keep full column grants — and so lets every member-side audited
|
|
235
|
+
* write, which pre-reads with `select('*')`, work at all.
|
|
236
|
+
*/
|
|
237
|
+
const SUPPORT_TICKET_EMAIL_TOKENS = 'support_ticket_email_tokens';
|
|
238
|
+
const SUPPORT_TICKET_SECRETS_SELECT = `
|
|
239
|
+
mms_id,
|
|
240
|
+
organization_id,
|
|
241
|
+
created_at,
|
|
242
|
+
created_by,
|
|
243
|
+
subject,
|
|
244
|
+
description,
|
|
245
|
+
status,
|
|
246
|
+
priority,
|
|
247
|
+
category,
|
|
248
|
+
assigned_to,
|
|
249
|
+
deleted
|
|
250
|
+
`;
|
|
251
|
+
/** A token row with the ticket it points at, read from the foreign key's own side. */
|
|
252
|
+
const SUPPORT_TICKET_BY_TOKEN_SELECT = `
|
|
253
|
+
email_token,
|
|
254
|
+
ticket:support_tickets!ticket_id (${SUPPORT_TICKET_SECRETS_SELECT})
|
|
255
|
+
`;
|
|
256
|
+
/**
|
|
257
|
+
* The agent's side of support, on the service client: the inbound email webhook, which knows only
|
|
258
|
+
* a reply token, and the shared-secret admin routes. RLS reserves everything here to the service
|
|
259
|
+
* role — `assigned_to`, `resolved_at`, `closed_at` and the agent columns on a message are all
|
|
260
|
+
* outside a member's grants, and `support_ticket_email_tokens` is outside every member's grant
|
|
261
|
+
* entirely.
|
|
262
|
+
*
|
|
263
|
+
* Reads that answer "which tenant is this?" are unscoped by necessity; every write is attributed
|
|
264
|
+
* to the row's own organization, with the actor being the matched user for an inbound client mail
|
|
265
|
+
* and `null` for agent and system work.
|
|
266
|
+
*/
|
|
267
|
+
class SupportTicketsAdminResource {
|
|
268
|
+
supabase;
|
|
269
|
+
tableFor;
|
|
270
|
+
constructor(supabase, tableFor) {
|
|
271
|
+
this.supabase = supabase;
|
|
272
|
+
this.tableFor = tableFor;
|
|
273
|
+
}
|
|
274
|
+
tickets(organizationId, actorMmsId = null) {
|
|
275
|
+
return this.tableFor(organizationId, actorMmsId, SUPPORT_TICKETS_TABLE);
|
|
276
|
+
}
|
|
277
|
+
messages(organizationId, actorMmsId = null) {
|
|
278
|
+
return this.tableFor(organizationId, actorMmsId, SUPPORT_MESSAGES_TABLE);
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Every organization's tickets in one list. Deliberately unscoped: the sole support agent works
|
|
282
|
+
* across tenants, and this read is what the service role exists for.
|
|
283
|
+
*/
|
|
284
|
+
async listAll() {
|
|
285
|
+
const { data, error } = await this.supabase
|
|
286
|
+
.from('support_tickets')
|
|
287
|
+
.select(`organization_id, ${SUPPORT_TICKET_LIST_SELECT}`)
|
|
288
|
+
.eq('deleted', false)
|
|
289
|
+
.order('created_at', { ascending: false });
|
|
290
|
+
if (error)
|
|
291
|
+
throw (0, errors_1.mapPostgrestError)(error);
|
|
292
|
+
return data;
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* The ticket behind a reply address. Read from the token table, which is the side that holds
|
|
296
|
+
* the foreign key, so the ticket arrives embedded and one query answers the whole question.
|
|
297
|
+
* Also unscoped by necessity — an inbound email carries nothing but the token, and the row it
|
|
298
|
+
* matches is what says which tenant it belongs to. No match means the mail was never ticket
|
|
299
|
+
* mail, and neither is a soft-deleted ticket.
|
|
300
|
+
*/
|
|
301
|
+
async findByEmailToken(token) {
|
|
302
|
+
const { data, error } = await this.supabase
|
|
303
|
+
.from(SUPPORT_TICKET_EMAIL_TOKENS)
|
|
304
|
+
.select(SUPPORT_TICKET_BY_TOKEN_SELECT)
|
|
305
|
+
.eq('email_token', token)
|
|
306
|
+
.maybeSingle();
|
|
307
|
+
if (error)
|
|
308
|
+
throw (0, errors_1.mapPostgrestError)(error);
|
|
309
|
+
const row = (data ?? null);
|
|
310
|
+
if (!row?.ticket || row.ticket.deleted)
|
|
311
|
+
return null;
|
|
312
|
+
return { ...row.ticket, email_token: row.email_token };
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* The same shape by id, for the admin routes, which already know the ticket they are acting on.
|
|
316
|
+
* The ticket is read first and on its own: an admin must be able to work a ticket whose token
|
|
317
|
+
* row is missing, so the token is looked up separately and its absence is a `null`, not a 404.
|
|
318
|
+
*/
|
|
319
|
+
async getWithSecrets(ticketId) {
|
|
320
|
+
const { data, error } = await this.supabase
|
|
321
|
+
.from('support_tickets')
|
|
322
|
+
.select(SUPPORT_TICKET_SECRETS_SELECT)
|
|
323
|
+
.eq('mms_id', ticketId)
|
|
324
|
+
.single();
|
|
325
|
+
if (error)
|
|
326
|
+
throw (0, errors_1.mapPostgrestError)(error);
|
|
327
|
+
const ticket = data;
|
|
328
|
+
return { ...ticket, email_token: await this.emailToken(ticketId) };
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Mints the ticket's reply token. The api calls it as soon as a member's ticket is created,
|
|
332
|
+
* and the address `support+<token>@…` is built from what comes back.
|
|
333
|
+
*
|
|
334
|
+
* A plain insert, deliberately unaudited: there is no `AuditTrailEntityType` for the table, and
|
|
335
|
+
* `audit_logs` is readable by any member holding `read_logs` — so a token snapshotted into a
|
|
336
|
+
* change set would be the one leak the separate table exists to prevent.
|
|
337
|
+
*/
|
|
338
|
+
async createEmailToken(ticketId) {
|
|
339
|
+
const { data, error } = await this.supabase
|
|
340
|
+
.from(SUPPORT_TICKET_EMAIL_TOKENS)
|
|
341
|
+
.insert({ ticket_id: ticketId })
|
|
342
|
+
.select('email_token')
|
|
343
|
+
.single();
|
|
344
|
+
if (error)
|
|
345
|
+
throw (0, errors_1.mapPostgrestError)(error);
|
|
346
|
+
return data.email_token;
|
|
347
|
+
}
|
|
348
|
+
async emailToken(ticketId) {
|
|
349
|
+
const { data, error } = await this.supabase
|
|
350
|
+
.from(SUPPORT_TICKET_EMAIL_TOKENS)
|
|
351
|
+
.select('email_token')
|
|
352
|
+
.eq('ticket_id', ticketId)
|
|
353
|
+
.maybeSingle();
|
|
354
|
+
if (error)
|
|
355
|
+
throw (0, errors_1.mapPostgrestError)(error);
|
|
356
|
+
return data?.email_token ?? null;
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* An agent's reply, from the mail Scott sends or from the admin route. The ball goes back to
|
|
360
|
+
* the client — but only from a live status, so writing on a resolved or closed ticket leaves it
|
|
361
|
+
* where it is.
|
|
362
|
+
*/
|
|
363
|
+
async addAgentMessage(ticket, message) {
|
|
364
|
+
// No user is behind agent work, so the audit actor stays null — `audit_logs.created_by` is
|
|
365
|
+
// nullable precisely for this.
|
|
366
|
+
const row = await this.messages(ticket.organization_id).insert({
|
|
367
|
+
ticket_id: ticket.mms_id,
|
|
368
|
+
organization_id: ticket.organization_id,
|
|
369
|
+
created_by: null,
|
|
370
|
+
author_type: enum_1.SupportMessageAuthorType.AGENT,
|
|
371
|
+
author_email: message.author_email,
|
|
372
|
+
source: message.source,
|
|
373
|
+
email_message_id: message.email_message_id ?? null,
|
|
374
|
+
body: message.body,
|
|
375
|
+
attachments: message.attachments ?? [],
|
|
376
|
+
});
|
|
377
|
+
await this.tickets(ticket.organization_id).updateWhere(ticket.mms_id, (query) => query.in('status', AGENT_REPLY_FROM), {
|
|
378
|
+
status: enum_1.SupportTicketStatus.AWAITING_USER,
|
|
379
|
+
updated_at: new Date().toISOString(),
|
|
380
|
+
});
|
|
381
|
+
return row;
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* A client's reply that arrived by email. `userMmsId` is the profile the From header was matched
|
|
385
|
+
* to — the classification the webhook has already done — so the message and the status move are
|
|
386
|
+
* attributed to them exactly as a portal reply would be, reopening a resolved ticket.
|
|
387
|
+
*/
|
|
388
|
+
async addInboundUserMessage(ticket, userMmsId, message) {
|
|
389
|
+
const row = await this.messages(ticket.organization_id, userMmsId).insert({
|
|
390
|
+
ticket_id: ticket.mms_id,
|
|
391
|
+
organization_id: ticket.organization_id,
|
|
392
|
+
created_by: userMmsId,
|
|
393
|
+
author_type: enum_1.SupportMessageAuthorType.USER,
|
|
394
|
+
author_email: message.author_email,
|
|
395
|
+
source: enum_1.SupportMessageSource.EMAIL,
|
|
396
|
+
email_message_id: message.email_message_id ?? null,
|
|
397
|
+
body: message.body,
|
|
398
|
+
attachments: message.attachments ?? [],
|
|
399
|
+
});
|
|
400
|
+
await this.tickets(ticket.organization_id, userMmsId).updateWhere(ticket.mms_id, (query) => query.in('status', CLIENT_REPLY_FROM), {
|
|
401
|
+
status: enum_1.SupportTicketStatus.AWAITING_AGENT,
|
|
402
|
+
updated_at: new Date().toISOString(),
|
|
403
|
+
});
|
|
404
|
+
return row;
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* Puts a ticket on a staff member. Works for a first assign and a reassign alike, and refuses
|
|
408
|
+
* on a closed ticket — the guard is `status <> closed`, so losing that race writes nothing and
|
|
409
|
+
* returns null.
|
|
410
|
+
*
|
|
411
|
+
* A first assign additionally puts the ticket in the agent's queue, but only from `open`: a
|
|
412
|
+
* thread that has already moved on keeps the status it earned, and a reassign never touches
|
|
413
|
+
* status at all. That flip is its own compare-and-set rather than part of the patch above, so
|
|
414
|
+
* a status that moves between the two never gets overwritten.
|
|
415
|
+
*/
|
|
416
|
+
async assign(ticketId, staffMmsId) {
|
|
417
|
+
const ticket = await this.getWithSecrets(ticketId);
|
|
418
|
+
const firstAssign = ticket.assigned_to === null;
|
|
419
|
+
const table = this.tickets(ticket.organization_id);
|
|
420
|
+
const at = new Date().toISOString();
|
|
421
|
+
const assigned = await table.updateWhere(ticketId, (query) => query.neq('status', enum_1.SupportTicketStatus.CLOSED), { assigned_to: staffMmsId, updated_at: at });
|
|
422
|
+
if (!assigned)
|
|
423
|
+
return null;
|
|
424
|
+
if (!firstAssign)
|
|
425
|
+
return assigned;
|
|
426
|
+
const queued = await table.updateWhere(ticketId, (query) => query.eq('status', enum_1.SupportTicketStatus.OPEN), { status: enum_1.SupportTicketStatus.AWAITING_AGENT, updated_at: at });
|
|
427
|
+
return queued ?? assigned;
|
|
428
|
+
}
|
|
429
|
+
/** Resolves a live ticket. Concurrent resolves settle on one write; the loser returns null. */
|
|
430
|
+
async resolve(ticketId) {
|
|
431
|
+
const ticket = await this.getWithSecrets(ticketId);
|
|
432
|
+
const at = new Date().toISOString();
|
|
433
|
+
return this.tickets(ticket.organization_id).updateWhere(ticketId, (query) => query.in('status', RESOLVABLE_FROM), { status: enum_1.SupportTicketStatus.RESOLVED, resolved_at: at, updated_at: at });
|
|
434
|
+
}
|
|
435
|
+
/** Closes a ticket from any status but closed. Terminal — nothing reopens it. */
|
|
436
|
+
async close(ticketId) {
|
|
437
|
+
const ticket = await this.getWithSecrets(ticketId);
|
|
438
|
+
const at = new Date().toISOString();
|
|
439
|
+
return this.tickets(ticket.organization_id).updateWhere(ticketId, (query) => query.neq('status', enum_1.SupportTicketStatus.CLOSED), { status: enum_1.SupportTicketStatus.CLOSED, closed_at: at, updated_at: at });
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
exports.SupportTicketsAdminResource = SupportTicketsAdminResource;
|
|
443
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/support/tickets/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAMA,8EAI6D;AAC7D,0EAAuF;AAEvF,uCAMqB;AAErB,yCAAsE;AACtE,iDAAsD;AAGtD,wCAAsB;AAEtB,MAAM,qBAAqB,GAAG;IAC5B,KAAK,EAAE,iBAAiB;IACxB,UAAU,EAAE,2BAAoB,CAAC,eAAe;CACxC,CAAC;AAEX,MAAM,sBAAsB,GAAG;IAC7B,KAAK,EAAE,kBAAkB;IACzB,UAAU,EAAE,2BAAoB,CAAC,gBAAgB;CACzC,CAAC;AAEX,+FAA+F;AAC/F,2FAA2F;AAC3F,4FAA4F;AAC5F,qEAAqE;AACrE,MAAM,WAAW,GAAG;;;;UAID,CAAC;AAEpB,MAAM,0BAA0B,GAAG;;;;;;;;8CAQW,WAAW;OACzC,CAAC;AAEjB,MAAM,4BAA4B,GAAG;;;8CAGS,+BAAkB;;;;;;;8CAOlB,WAAW;;;;OAIzC,CAAC;AAEjB,MAAM,sBAAsB,GAAG;;;8CAGe,+BAAkB;;;;;;OAMhD,CAAC;AAEjB;;;GAGG;AACH,MAAM,iBAAiB,GAA0B;IAC/C,0BAAmB,CAAC,IAAI;IACxB,0BAAmB,CAAC,cAAc;IAClC,0BAAmB,CAAC,aAAa;IACjC,0BAAmB,CAAC,QAAQ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MAAM,EAAE,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QAEpC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,WAAW,CACrD,QAAQ,EACR,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,0BAAmB,CAAC,MAAM,CAAC,EAC1D,EAAE,MAAM,EAAE,0BAAmB,CAAC,MAAM,EAAE,SAAS,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,CACtE,CAAC;IACJ,CAAC;CACF;AAhOD,kEAgOC"}
|
|
@@ -20,7 +20,7 @@ class SupportingFileIdDto {
|
|
|
20
20
|
}
|
|
21
21
|
exports.SupportingFileIdDto = SupportingFileIdDto;
|
|
22
22
|
__decorate([
|
|
23
|
-
(0, class_validator_1.IsUUID)('
|
|
23
|
+
(0, class_validator_1.IsUUID)('7', { message: 'Invalid supporting file ID format' }),
|
|
24
24
|
__metadata("design:type", String)
|
|
25
25
|
], SupportingFileIdDto.prototype, "supportingFileId", void 0);
|
|
26
26
|
class GetSupportingFilesDto {
|
|
@@ -33,7 +33,7 @@ __decorate([
|
|
|
33
33
|
__metadata("design:type", String)
|
|
34
34
|
], GetSupportingFilesDto.prototype, "entity", void 0);
|
|
35
35
|
__decorate([
|
|
36
|
-
(0, class_validator_1.IsUUID)('
|
|
36
|
+
(0, class_validator_1.IsUUID)('7', { message: 'Invalid entity ID format' }),
|
|
37
37
|
__metadata("design:type", String)
|
|
38
38
|
], GetSupportingFilesDto.prototype, "entityId", void 0);
|
|
39
39
|
//# sourceMappingURL=dto.js.map
|
package/dist/tasks/dto.js
CHANGED
|
@@ -21,7 +21,7 @@ class TaskIdDto {
|
|
|
21
21
|
}
|
|
22
22
|
exports.TaskIdDto = TaskIdDto;
|
|
23
23
|
__decorate([
|
|
24
|
-
(0, class_validator_1.IsUUID)('
|
|
24
|
+
(0, class_validator_1.IsUUID)('7', { message: 'Invalid project ID format' }) // sic — the api's message, kept for parity
|
|
25
25
|
,
|
|
26
26
|
__metadata("design:type", String)
|
|
27
27
|
], TaskIdDto.prototype, "taskId", void 0);
|
|
@@ -73,19 +73,22 @@ __decorate([
|
|
|
73
73
|
(0, class_validator_1.IsOptional)(),
|
|
74
74
|
(0, validators_1.IsNullable)(),
|
|
75
75
|
(0, class_transformer_1.Transform)(({ value }) => (0, transforms_1.parseEntityIdFilter)(value), { toClassOnly: true }),
|
|
76
|
-
(0, class_validator_1.IsUUID)('
|
|
76
|
+
(0, class_validator_1.IsUUID)('7', { message: 'Invalid client ID format' }),
|
|
77
77
|
__metadata("design:type", Object)
|
|
78
78
|
], GetTasksDto.prototype, "client_id", void 0);
|
|
79
79
|
__decorate([
|
|
80
80
|
(0, class_validator_1.IsOptional)(),
|
|
81
81
|
(0, validators_1.IsNullable)(),
|
|
82
82
|
(0, class_transformer_1.Transform)(({ value }) => (0, transforms_1.parseEntityIdFilter)(value), { toClassOnly: true }),
|
|
83
|
-
(0, class_validator_1.IsUUID)('
|
|
83
|
+
(0, class_validator_1.IsUUID)('7', { message: 'Invalid project ID format' }),
|
|
84
84
|
__metadata("design:type", Object)
|
|
85
85
|
], GetTasksDto.prototype, "project_id", void 0);
|
|
86
86
|
__decorate([
|
|
87
87
|
(0, class_validator_1.IsOptional)(),
|
|
88
|
-
(0, validators_1.IsNullable)()
|
|
88
|
+
(0, validators_1.IsNullable)()
|
|
89
|
+
// Still v4: the assignee is a `users.mms_id`, and that column carries the GoTrue auth uid the
|
|
90
|
+
// signup trigger copies out of `auth.users.id` — the table's uuidv7 default never fires.
|
|
91
|
+
,
|
|
89
92
|
(0, class_validator_1.IsUUID)('4', { message: 'Invalid assigned to ID format' }),
|
|
90
93
|
__metadata("design:type", Object)
|
|
91
94
|
], GetTasksDto.prototype, "assigned_to_id", void 0);
|
|
@@ -129,7 +132,7 @@ __decorate([
|
|
|
129
132
|
(0, class_validator_1.IsOptional)(),
|
|
130
133
|
(0, validators_1.IsNullable)(),
|
|
131
134
|
(0, class_transformer_1.Transform)(({ value }) => value ? value.split(',').map((id) => id.trim()) : null, { toClassOnly: true }),
|
|
132
|
-
(0, class_validator_1.IsUUID)('
|
|
135
|
+
(0, class_validator_1.IsUUID)('7', { each: true, message: 'Invalid status ID format' }),
|
|
133
136
|
__metadata("design:type", Object)
|
|
134
137
|
], GetTasksDto.prototype, "status_id_in", void 0);
|
|
135
138
|
__decorate([
|
|
@@ -187,7 +190,7 @@ __decorate([
|
|
|
187
190
|
__decorate([
|
|
188
191
|
(0, class_validator_1.IsOptional)(),
|
|
189
192
|
(0, validators_1.IsNullable)(),
|
|
190
|
-
(0, class_validator_1.IsUUID)('
|
|
193
|
+
(0, class_validator_1.IsUUID)('7', { each: true, message: 'Each status ID must be a valid UUID v7' }),
|
|
191
194
|
__metadata("design:type", Object)
|
|
192
195
|
], CreateTaskDto.prototype, "status_id", void 0);
|
|
193
196
|
__decorate([
|
|
@@ -199,20 +202,22 @@ __decorate([
|
|
|
199
202
|
], CreateTaskDto.prototype, "priority", void 0);
|
|
200
203
|
__decorate([
|
|
201
204
|
(0, class_validator_1.IsOptional)(),
|
|
202
|
-
(0, validators_1.IsNullable)()
|
|
205
|
+
(0, validators_1.IsNullable)()
|
|
206
|
+
// Still v4 — an assignee is a `users.mms_id`, the GoTrue auth uid (see GetTasksDto).
|
|
207
|
+
,
|
|
203
208
|
(0, class_validator_1.IsUUID)('4', { message: 'Invalid assigned to ID format' }),
|
|
204
209
|
__metadata("design:type", Object)
|
|
205
210
|
], CreateTaskDto.prototype, "assigned_to_id", void 0);
|
|
206
211
|
__decorate([
|
|
207
212
|
(0, class_validator_1.IsOptional)(),
|
|
208
213
|
(0, validators_1.IsNullable)(),
|
|
209
|
-
(0, class_validator_1.IsUUID)('
|
|
214
|
+
(0, class_validator_1.IsUUID)('7', { message: 'Invalid project ID format' }),
|
|
210
215
|
__metadata("design:type", Object)
|
|
211
216
|
], CreateTaskDto.prototype, "project_id", void 0);
|
|
212
217
|
__decorate([
|
|
213
218
|
(0, class_validator_1.IsOptional)(),
|
|
214
219
|
(0, validators_1.IsNullable)(),
|
|
215
|
-
(0, class_validator_1.IsUUID)('
|
|
220
|
+
(0, class_validator_1.IsUUID)('7', { message: 'Invalid client ID format' }),
|
|
216
221
|
__metadata("design:type", Object)
|
|
217
222
|
], CreateTaskDto.prototype, "client_id", void 0);
|
|
218
223
|
class UpdateTaskDto {
|
|
@@ -257,7 +262,7 @@ __decorate([
|
|
|
257
262
|
__decorate([
|
|
258
263
|
(0, class_validator_1.IsOptional)(),
|
|
259
264
|
(0, validators_1.IsNullable)(),
|
|
260
|
-
(0, class_validator_1.IsUUID)('
|
|
265
|
+
(0, class_validator_1.IsUUID)('7', { each: true, message: 'Each status ID must be a valid UUID v7' }),
|
|
261
266
|
__metadata("design:type", Object)
|
|
262
267
|
], UpdateTaskDto.prototype, "status_id", void 0);
|
|
263
268
|
__decorate([
|
|
@@ -269,20 +274,22 @@ __decorate([
|
|
|
269
274
|
], UpdateTaskDto.prototype, "priority", void 0);
|
|
270
275
|
__decorate([
|
|
271
276
|
(0, class_validator_1.IsOptional)(),
|
|
272
|
-
(0, validators_1.IsNullable)()
|
|
277
|
+
(0, validators_1.IsNullable)()
|
|
278
|
+
// Still v4 — an assignee is a `users.mms_id`, the GoTrue auth uid (see GetTasksDto).
|
|
279
|
+
,
|
|
273
280
|
(0, class_validator_1.IsUUID)('4', { message: 'Invalid assigned to ID format' }),
|
|
274
281
|
__metadata("design:type", Object)
|
|
275
282
|
], UpdateTaskDto.prototype, "assigned_to_id", void 0);
|
|
276
283
|
__decorate([
|
|
277
284
|
(0, class_validator_1.IsOptional)(),
|
|
278
285
|
(0, validators_1.IsNullable)(),
|
|
279
|
-
(0, class_validator_1.IsUUID)('
|
|
286
|
+
(0, class_validator_1.IsUUID)('7', { message: 'Invalid project ID format' }),
|
|
280
287
|
__metadata("design:type", Object)
|
|
281
288
|
], UpdateTaskDto.prototype, "project_id", void 0);
|
|
282
289
|
__decorate([
|
|
283
290
|
(0, class_validator_1.IsOptional)(),
|
|
284
291
|
(0, validators_1.IsNullable)(),
|
|
285
|
-
(0, class_validator_1.IsUUID)('
|
|
292
|
+
(0, class_validator_1.IsUUID)('7', { message: 'Invalid client ID format' }),
|
|
286
293
|
__metadata("design:type", Object)
|
|
287
294
|
], UpdateTaskDto.prototype, "client_id", void 0);
|
|
288
295
|
//# sourceMappingURL=dto.js.map
|
package/dist/tasks/dto.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dto.js","sourceRoot":"","sources":["../../src/tasks/dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA8I;AAC9I,yDAA8C;AAO9C,8CAAoD;AACpD,8CAA2C;AAE3C,+FAA+F;AAC/F,8BAA8B;AAE9B,MAAa,SAAS;IAEX,MAAM,CAAU;CAC1B;AAHD,8BAGC;AADU;IADR,IAAA,wBAAM,EAAC,GAAG,EAAE,EAAE,OAAO,EAAE,2BAA2B,EAAE,CAAC,CAAC,2CAA2C;;;yCACzE;AAG3B,kGAAkG;AAClG,gGAAgG;AAChG,2EAA2E;AAC3E,MAAa,WAAW;IAMb,MAAM,CAAiB;IAMvB,IAAI,GAAW,CAAC,CAAC;IAOjB,SAAS,GAAW,EAAE,CAAC;IAMvB,SAAS,CAAiB;IAM1B,UAAU,CAAiB;
|
|
1
|
+
{"version":3,"file":"dto.js","sourceRoot":"","sources":["../../src/tasks/dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA8I;AAC9I,yDAA8C;AAO9C,8CAAoD;AACpD,8CAA2C;AAE3C,+FAA+F;AAC/F,8BAA8B;AAE9B,MAAa,SAAS;IAEX,MAAM,CAAU;CAC1B;AAHD,8BAGC;AADU;IADR,IAAA,wBAAM,EAAC,GAAG,EAAE,EAAE,OAAO,EAAE,2BAA2B,EAAE,CAAC,CAAC,2CAA2C;;;yCACzE;AAG3B,kGAAkG;AAClG,gGAAgG;A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` / `project_id` list filters accept either a plain UUID
|
|
3
|
+
* The `client_id` / `project_id` list filters accept either a plain UUID v7 or the base64-JSON
|
|
4
4
|
* option value the portal's selects send (`{ mms_id }`, or `{ id }` as a fallback). Anything that
|
|
5
|
-
* is not one of those — including a value that decodes to JSON without a UUID
|
|
5
|
+
* is not one of those — including a value that decodes to JSON without a UUID v7 — cannot filter
|
|
6
6
|
* anything, so it becomes `null` and the filter is skipped.
|
|
7
7
|
*/
|
|
8
8
|
export declare const parseEntityIdFilter: (value: unknown) => string | null;
|