@managemint-solutions/sdk 0.22.3 → 0.23.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/client.d.ts CHANGED
@@ -11,7 +11,6 @@ import { OrganizationsResource } from './organizations';
11
11
  import { PermissionsResource } from './permissions';
12
12
  import { ProjectsResource } from './projects';
13
13
  import { StatusesResource } from './statuses';
14
- import { SupportTicketsResource } from './support/tickets';
15
14
  import { SupportingFilesResource } from './supporting-files';
16
15
  import { TasksResource } from './tasks';
17
16
  import { UsersResource } from './users';
@@ -52,7 +51,6 @@ export declare class SupabaseClient {
52
51
  readonly permissions: PermissionsResource;
53
52
  readonly users: UsersResource;
54
53
  readonly supportingFiles: SupportingFilesResource;
55
- readonly supportTickets: SupportTicketsResource;
56
54
  readonly clients: ClientsResource;
57
55
  readonly projects: ProjectsResource;
58
56
  readonly tasks: TasksResource;
package/dist/client.js CHANGED
@@ -13,7 +13,6 @@ const organizations_1 = require("./organizations");
13
13
  const permissions_1 = require("./permissions");
14
14
  const projects_1 = require("./projects");
15
15
  const statuses_1 = require("./statuses");
16
- const tickets_1 = require("./support/tickets");
17
16
  const supporting_files_1 = require("./supporting-files");
18
17
  const tasks_1 = require("./tasks");
19
18
  const users_1 = require("./users");
@@ -36,7 +35,6 @@ class SupabaseClient {
36
35
  permissions;
37
36
  users;
38
37
  supportingFiles;
39
- supportTickets;
40
38
  clients;
41
39
  projects;
42
40
  tasks;
@@ -56,7 +54,6 @@ class SupabaseClient {
56
54
  this.permissions = new permissions_1.PermissionsResource(this.supabase, this.auth, this.audit);
57
55
  this.users = new users_1.UsersResource(this.supabase, this.auth, this.audit);
58
56
  this.supportingFiles = new supporting_files_1.SupportingFilesResource(this.supabase, this.auth, this.audit);
59
- this.supportTickets = new tickets_1.SupportTicketsResource(this.supabase, this.auth, this.audit);
60
57
  this.clients = new clients_1.ClientsResource(this.supabase, this.auth, this.audit);
61
58
  this.projects = new projects_1.ProjectsResource(this.supabase, this.auth, this.audit);
62
59
  this.tasks = new tasks_1.TasksResource(this.supabase, this.auth, this.audit);
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";;;AACA,iCAA2D;AAC3D,mCAAgE;AAChE,6DAAiE;AACjE,uCAA4C;AAC5C,mCAAwC;AACxC,mDAAwD;AACxD,uCAAiD;AACjD,iDAA2D;AAC3D,mDAAwD;AACxD,+CAAoD;AACpD,yCAA8C;AAC9C,yCAA8C;AAC9C,+CAA2D;AAC3D,yDAA6D;AAC7D,mCAAwC;AACxC,mCAAwC;AAyBxC;;;;GAIG;AACH,MAAa,cAAc;IAChB,QAAQ,CAAsB,CAAC,4CAA4C;IAC3E,IAAI,CAAc;IAClB,KAAK,CAAgB;IACrB,QAAQ,CAAmB;IAC3B,iBAAiB,CAA4B;IAC7C,KAAK,CAAgB;IACrB,aAAa,CAAwB;IACrC,OAAO,CAAuB;IAC9B,QAAQ,CAAwB;IAChC,aAAa,CAAwB;IACrC,WAAW,CAAsB;IACjC,KAAK,CAAgB;IACrB,eAAe,CAA0B;IACzC,cAAc,CAAyB;IACvC,OAAO,CAAkB;IACzB,QAAQ,CAAmB;IAC3B,KAAK,CAAgB;IAE9B,YAAY,MAA4B;QACtC,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACxB,IAAI,CAAC,QAAQ;YACX,MAAM,CAAC,MAAM,IAAI,IAAA,sBAAe,EAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;QAC/E,qEAAqE;QACrE,IAAI,CAAC,KAAK,GAAG,IAAI,qBAAa,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;QAC9E,IAAI,CAAC,QAAQ,GAAG,IAAI,2BAAgB,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAA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AC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;QACrF,IAAI,CAAC,WAAW,GAAG,IAAI,iCAAmB,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;QACjF,IAAI,CAAC,KAAK,GAAG,IAAI,qBAAa,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;QACrE,IAAI,CAAC,eAAe,GAAG,IAAI,0CAAuB,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;QACzF,IAAI,CAAC,OAAO,GAAG,IAAI,yBAAe,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;QACzE,IAAI,CAAC,QAAQ,GAAG,IAAI,2BAAgB,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;QAC3E,IAAI,CAAC,KAAK,GAAG,IAAI,qBAAa,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;IACvE,CAAC;CACF;AAtCD,wCAsCC;AAEM,MAAM,oBAAoB,GAAG,CAAC,MAA4B,EAAkB,EAAE,CACnF,IAAI,cAAc,CAAC,MAAM,CAAC,CAAC;AADhB,QAAA,oBAAoB,wBACJ"}
package/dist/index.d.ts CHANGED
@@ -43,9 +43,6 @@ export { WebhookEventsResource } from './webhook-events';
43
43
  export type { ClaimOutcome, WebhookEventRow, WebhookEventsTable } from './webhook-events';
44
44
  export { SupportingFilesResource } from './supporting-files';
45
45
  export { GetSupportingFilesDto, SupportingFileIdDto } from './supporting-files';
46
- export { SupportTicketsResource, SupportTicketsAdminResource } from './support/tickets';
47
- export type { SupportAgentMessageInput, SupportAuditedTableFactory, SupportInboundMessageInput, SupportTicketAdminSummary, SupportTicketWithSecrets, } from './support/tickets';
48
- export { AssignSupportTicketDto, CreateSupportTicketDto, GetSupportTicketsDto, ReplySupportTicketDto, SupportAttachmentDto, SupportTicketIdDto, } from './support/tickets';
49
46
  export { ClientsResource } from './clients';
50
47
  export { ClientIdDto, CreateClientDto, GetClientsDto, UpdateClientDto } from './clients';
51
48
  export { ProjectsResource } from './projects';
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@
4
4
  // reachable only from inside. The `./nest` entrypoint is listed separately, in src/nest/index.ts.
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.OrganizationSignupResource = exports.OrganizationsResource = exports.OrganizationPaymentMethodsResource = exports.OrganizationInvitesResource = exports.NotificationIdDto = exports.GetNotificationsDto = exports.NotificationsOutboxResource = exports.NotificationsResource = exports.NoteIdDto = exports.GetNotesDto = exports.AddNoteDto = exports.NotesResource = exports.UpdateAdditionalDetailsDto = exports.IsAdditionalDetailsValueByType = exports.GetAdditionalDetailsDto = exports.AdditionalDetailsIdDto = exports.AddAdditionalDetailsDto = exports.AdditionalDetailsResource = exports.UpdateStatusDto = exports.StatusIdDto = exports.GetStatusesDto = exports.AddStatusDto = exports.StatusesResource = exports.InvoiceIdDto = exports.GetInvoicesQueryDto = exports.InvoicesResource = exports.InvoicesReadsResource = exports.ReinstateSubscriptionDto = exports.PurchaseModuleDto = exports.InitialPaymentDto = exports.CancelSubscriptionDto = exports.BillingResource = exports.BillingReadsResource = exports.GetAuditTrailDto = exports.AuditResource = exports.IsNullable = exports.SupabaseClientError = exports.createSupabaseServiceClient = exports.SupabaseOrganizationScope = exports.SupabaseServiceClient = exports.SignInDto = exports.SendPasswordResetEmailDto = exports.ResetPasswordDto = exports.ExchangeTokenHashDto = exports.ExchangeRefreshTokenDto = exports.createSupabaseAuthClient = exports.SupabaseAuthClient = exports.verifyAccessToken = exports.createSupabaseClient = exports.SupabaseClient = void 0;
7
- exports.monthlyTotalMinor = exports.PricebooksResource = exports.UpdateTaskDto = exports.TaskIdDto = exports.GetTasksDto = exports.CreateTaskDto = exports.TasksResource = exports.UpdateProjectDto = exports.ProjectIdDto = exports.GetProjectsDto = exports.CreateProjectDto = exports.ProjectsResource = exports.UpdateClientDto = exports.GetClientsDto = exports.CreateClientDto = exports.ClientIdDto = exports.ClientsResource = exports.SupportTicketIdDto = exports.SupportAttachmentDto = exports.ReplySupportTicketDto = exports.GetSupportTicketsDto = exports.CreateSupportTicketDto = exports.AssignSupportTicketDto = exports.SupportTicketsAdminResource = exports.SupportTicketsResource = exports.SupportingFileIdDto = exports.GetSupportingFilesDto = exports.SupportingFilesResource = exports.WebhookEventsResource = exports.UserIdDto = exports.UpdateUserDto = exports.UpdateMyProfileDto = exports.GetUsersQueryDto = exports.AddUserDto = exports.UsersResource = exports.UpdatePermissionsDto = exports.PermissionsResource = exports.UpdateOrganizationDto = exports.CreateOrganizationDto = void 0;
7
+ exports.monthlyTotalMinor = exports.PricebooksResource = exports.UpdateTaskDto = exports.TaskIdDto = exports.GetTasksDto = exports.CreateTaskDto = exports.TasksResource = exports.UpdateProjectDto = exports.ProjectIdDto = exports.GetProjectsDto = exports.CreateProjectDto = exports.ProjectsResource = exports.UpdateClientDto = exports.GetClientsDto = exports.CreateClientDto = exports.ClientIdDto = exports.ClientsResource = exports.SupportingFileIdDto = exports.GetSupportingFilesDto = exports.SupportingFilesResource = exports.WebhookEventsResource = exports.UserIdDto = exports.UpdateUserDto = exports.UpdateMyProfileDto = exports.GetUsersQueryDto = exports.AddUserDto = exports.UsersResource = exports.UpdatePermissionsDto = exports.PermissionsResource = exports.UpdateOrganizationDto = exports.CreateOrganizationDto = void 0;
8
8
  var client_1 = require("./client");
9
9
  Object.defineProperty(exports, "SupabaseClient", { enumerable: true, get: function () { return client_1.SupabaseClient; } });
10
10
  Object.defineProperty(exports, "createSupabaseClient", { enumerable: true, get: function () { return client_1.createSupabaseClient; } });
@@ -101,16 +101,6 @@ Object.defineProperty(exports, "SupportingFilesResource", { enumerable: true, ge
101
101
  var supporting_files_2 = require("./supporting-files");
102
102
  Object.defineProperty(exports, "GetSupportingFilesDto", { enumerable: true, get: function () { return supporting_files_2.GetSupportingFilesDto; } });
103
103
  Object.defineProperty(exports, "SupportingFileIdDto", { enumerable: true, get: function () { return supporting_files_2.SupportingFileIdDto; } });
104
- var tickets_1 = require("./support/tickets");
105
- Object.defineProperty(exports, "SupportTicketsResource", { enumerable: true, get: function () { return tickets_1.SupportTicketsResource; } });
106
- Object.defineProperty(exports, "SupportTicketsAdminResource", { enumerable: true, get: function () { return tickets_1.SupportTicketsAdminResource; } });
107
- var tickets_2 = require("./support/tickets");
108
- Object.defineProperty(exports, "AssignSupportTicketDto", { enumerable: true, get: function () { return tickets_2.AssignSupportTicketDto; } });
109
- Object.defineProperty(exports, "CreateSupportTicketDto", { enumerable: true, get: function () { return tickets_2.CreateSupportTicketDto; } });
110
- Object.defineProperty(exports, "GetSupportTicketsDto", { enumerable: true, get: function () { return tickets_2.GetSupportTicketsDto; } });
111
- Object.defineProperty(exports, "ReplySupportTicketDto", { enumerable: true, get: function () { return tickets_2.ReplySupportTicketDto; } });
112
- Object.defineProperty(exports, "SupportAttachmentDto", { enumerable: true, get: function () { return tickets_2.SupportAttachmentDto; } });
113
- Object.defineProperty(exports, "SupportTicketIdDto", { enumerable: true, get: function () { return tickets_2.SupportTicketIdDto; } });
114
104
  var clients_1 = require("./clients");
115
105
  Object.defineProperty(exports, "ClientsResource", { enumerable: true, get: function () { return clients_1.ClientsResource; } });
116
106
  var clients_2 = require("./clients");
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,kGAAkG;AAClG,8FAA8F;AAC9F,kGAAkG;;;;AAElG,mCAAgE;AAAvD,wGAAA,cAAc,OAAA;AAAE,8GAAA,oBAAoB,OAAA;AAG7C,+BAA2C;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AAmB,OAAA;AAE5B,6CAAqD;AAA5C,mHAAA,oBAAoB,OAAA;AAE7B,iCAAwC;AAA/B,sGAAA,aAAa,OAAA;AAEtB,iCAMiB;AALf,mGAAA,UAAU,OAAA;AACV,yGAAA,gBAAgB,OAAA;AAChB,2GAAA,kBAAkB,OAAA;AAClB,sGAAA,aAAa,OAAA;AACb,kGAAA,SAAS,OAAA;AAGX,mDAAyD;AAAhD,uHAAA,qBAAqB,OAAA;AAG9B,uDAA6D;AAApD,2HAAA,uBAAuB,OAAA;AAChC,uDAAgF;AAAvE,yHAAA,qBAAqB,OAAA;AAAE,uHAAA,mBAAmB,OAAA;AAEnD,qCAA4C;AAAnC,0GAAA,eAAe,OAAA;AACxB,qCAAyF;AAAhF,sGAAA,WAAW,OAAA;AAAE,0GAAA,eAAe,OAAA;AAAE,wGAAA,aAAa,OAAA;AAAE,0GAAA,eAAe,OAAA;AAErE,uCAA8C;AAArC,4GAAA,gBAAgB,OAAA;AACzB,uCAA8F;AAArF,4GAAA,gBAAgB,OAAA;AAAE,0GAAA,cAAc,OAAA;AAAE,wGAAA,YAAY,OAAA;AAAE,4GAAA,gBAAgB,OAAA;AAEzE,iCAAwC;AAA/B,sGAAA,aAAa,OAAA;AACtB,iCAA+E;AAAtE,sGAAA,aAAa,OAAA;AAAE,oGAAA,WAAW,OAAA;AAAE,kGAAA,SAAS,OAAA;AAAE,sGAAA,aAAa,OAAA;AAE7D,2CAAqE;AAA5D,gHAAA,kBAAkB,OAAA;AAAE,+GAAA,iBAAiB,OAAA"}
@@ -7,7 +7,6 @@ import { OrganizationInvitesResource } from '../organization-invites';
7
7
  import { OrganizationPaymentMethodsResource, type PaymentMethodLookupColumn } from '../organization-payment-methods';
8
8
  import { OrganizationsResource, OrganizationSignupResource } from '../organizations';
9
9
  import { PermissionsResource } from '../permissions';
10
- import { SupportTicketsAdminResource } from '../support/tickets';
11
10
  import { UsersResource } from '../users';
12
11
  import { WebhookEventsResource } from '../webhook-events';
13
12
  export type SupabaseServiceClientConfig = {
@@ -58,7 +57,6 @@ export declare class SupabaseServiceClient {
58
57
  readonly signup: OrganizationSignupResource;
59
58
  readonly paystackEvents: WebhookEventsResource;
60
59
  readonly resendEvents: WebhookEventsResource;
61
- readonly supportTicketsAdmin: SupportTicketsAdminResource;
62
60
  constructor(config: SupabaseServiceClientConfig);
63
61
  /**
64
62
  * Scope to one organization once it is known. `actorMmsId` stays `null` for system work —
@@ -12,7 +12,6 @@ const organization_invites_1 = require("../organization-invites");
12
12
  const organization_payment_methods_1 = require("../organization-payment-methods");
13
13
  const organizations_1 = require("../organizations");
14
14
  const permissions_1 = require("../permissions");
15
- const tickets_1 = require("../support/tickets");
16
15
  const users_1 = require("../users");
17
16
  const webhook_events_1 = require("../webhook-events");
18
17
  /**
@@ -70,7 +69,6 @@ class SupabaseServiceClient {
70
69
  signup;
71
70
  paystackEvents;
72
71
  resendEvents;
73
- supportTicketsAdmin;
74
72
  constructor(config) {
75
73
  this.config = config;
76
74
  this.supabase = (0, auth_1.createRawClient)(config.url, config.serviceRoleKey);
@@ -83,11 +81,6 @@ class SupabaseServiceClient {
83
81
  table: 'notifications',
84
82
  entityType: enum_1.AuditTrailEntityType.NOTIFICATION,
85
83
  }));
86
- // Support spans organizations too — an inbound email knows only a reply token, and the ticket
87
- // it matches is what supplies the tenant — so this takes the same kind of factory. Its writes
88
- // name an actor as well: an inbound client mail is attributed to the user it was matched to,
89
- // agent and system work to nobody.
90
- this.supportTicketsAdmin = new tickets_1.SupportTicketsAdminResource(this.supabase, (organizationId, actorMmsId, options) => this.forOrganization(organizationId, actorMmsId).table(options));
91
84
  }
92
85
  /**
93
86
  * Scope to one organization once it is known. `actorMmsId` stays `null` for system work —
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/service-client/index.ts"],"names":[],"mappings":";;;AAAA,kCAA0C;AAC1C,oCAQkB;AAClB,0EAAuF;AAEvF,wCAA6C;AAC7C,kDAAuD;AACvD,oDAA+D;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E,MAAM,IAAA,0BAAiB,EAAC,KAAK,CAAC,CAAC;QAE1C,OAAO,IAAI,CAAC,CAAC,CAAC,IAAA,yBAAiB,EAAC,IAA+B,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC1E,CAAC;CACF;AA9FD,sDA8FC;AAEM,MAAM,2BAA2B,GAAG,CACzC,MAAmC,EACZ,EAAE,CAAC,IAAI,qBAAqB,CAAC,MAAM,CAAC,CAAC;AAFjD,QAAA,2BAA2B,+BAEsB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@managemint-solutions/sdk",
3
- "version": "0.22.3",
3
+ "version": "0.23.0",
4
4
  "description": "Typed Supabase data-access SDK for ManageMint Solutions",
5
5
  "license": "UNLICENSED",
6
6
  "author": "Scott Bebington <scottbebington@gmail.com>",
@@ -47,7 +47,7 @@
47
47
  "testEnvironment": "node"
48
48
  },
49
49
  "dependencies": {
50
- "@managemint-solutions/entities": "^1.7.1"
50
+ "@managemint-solutions/entities": "^1.8.0"
51
51
  },
52
52
  "peerDependencies": {
53
53
  "@nestjs/common": "^11.0.0",
@@ -1,33 +0,0 @@
1
- import type { SupportAttachment } from '@managemint-solutions/entities/support/tickets';
2
- import type { AssignSupportTicketDto as AssignSupportTicketDtoType, CreateSupportTicketDto as CreateSupportTicketDtoType, GetSupportTicketsDto as GetSupportTicketsDtoType, ReplySupportTicketDto as ReplySupportTicketDtoType, SupportTicketIdDto as SupportTicketIdDtoType } from '@managemint-solutions/entities/support/tickets/dto';
3
- import { SupportTicketCategory, SupportTicketPriority, SupportTicketStatus } from '@managemint-solutions/entities/support/tickets/enum';
4
- /**
5
- * One already-uploaded file, as the upload route handed it back. `url` is deliberately absent:
6
- * it is a short-lived signed link minted when a ticket is read, never stored and never sent in.
7
- */
8
- export declare class SupportAttachmentDto implements SupportAttachment {
9
- readonly path: string;
10
- readonly filename: string;
11
- readonly size: number;
12
- readonly content_type: string;
13
- }
14
- export declare class SupportTicketIdDto implements SupportTicketIdDtoType {
15
- readonly ticketId: string;
16
- }
17
- export declare class GetSupportTicketsDto implements GetSupportTicketsDtoType {
18
- readonly status?: SupportTicketStatus | null;
19
- }
20
- export declare class CreateSupportTicketDto implements CreateSupportTicketDtoType {
21
- readonly subject: string;
22
- readonly description: string;
23
- readonly priority?: SupportTicketPriority | null;
24
- readonly category?: SupportTicketCategory | null;
25
- readonly attachments?: SupportAttachmentDto[] | null;
26
- }
27
- export declare class ReplySupportTicketDto implements ReplySupportTicketDtoType {
28
- readonly body: string;
29
- readonly attachments?: SupportAttachmentDto[] | null;
30
- }
31
- export declare class AssignSupportTicketDto implements AssignSupportTicketDtoType {
32
- readonly assigned_to: string;
33
- }
@@ -1,141 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.AssignSupportTicketDto = exports.ReplySupportTicketDto = exports.CreateSupportTicketDto = exports.GetSupportTicketsDto = exports.SupportTicketIdDto = exports.SupportAttachmentDto = void 0;
13
- const class_transformer_1 = require("class-transformer");
14
- const class_validator_1 = require("class-validator");
15
- const enum_1 = require("@managemint-solutions/entities/support/tickets/enum");
16
- const validators_1 = require("../../validators");
17
- // class-validator versions of the shared DTO types from @managemint-solutions/entities.
18
- // Each class `implements` its entities type so the wire contract cannot drift.
19
- /**
20
- * One already-uploaded file, as the upload route handed it back. `url` is deliberately absent:
21
- * it is a short-lived signed link minted when a ticket is read, never stored and never sent in.
22
- */
23
- class SupportAttachmentDto {
24
- path;
25
- filename;
26
- size;
27
- content_type;
28
- }
29
- exports.SupportAttachmentDto = SupportAttachmentDto;
30
- __decorate([
31
- (0, class_validator_1.IsString)({ message: 'Invalid attachment path' }),
32
- (0, class_validator_1.MinLength)(1, { message: 'Attachment path cannot be empty' }),
33
- (0, class_validator_1.MaxLength)(1024, { message: 'Attachment path cannot exceed 1024 characters' }),
34
- __metadata("design:type", String)
35
- ], SupportAttachmentDto.prototype, "path", void 0);
36
- __decorate([
37
- (0, class_validator_1.IsString)({ message: 'Invalid attachment file name' }),
38
- (0, class_validator_1.MinLength)(1, { message: 'Attachment file name cannot be empty' }),
39
- (0, class_validator_1.MaxLength)(255, { message: 'Attachment file name cannot exceed 255 characters' }),
40
- __metadata("design:type", String)
41
- ], SupportAttachmentDto.prototype, "filename", void 0);
42
- __decorate([
43
- (0, class_validator_1.IsInt)({ message: 'Attachment size must be an integer' }),
44
- (0, class_validator_1.Min)(0, { message: 'Attachment size cannot be negative' }),
45
- __metadata("design:type", Number)
46
- ], SupportAttachmentDto.prototype, "size", void 0);
47
- __decorate([
48
- (0, class_validator_1.IsString)({ message: 'Invalid attachment content type' }),
49
- (0, class_validator_1.MinLength)(1, { message: 'Attachment content type cannot be empty' }),
50
- (0, class_validator_1.MaxLength)(255, { message: 'Attachment content type cannot exceed 255 characters' }),
51
- __metadata("design:type", String)
52
- ], SupportAttachmentDto.prototype, "content_type", void 0);
53
- // `mms_id` columns default to `public.uuidv7()`, so the id params check for a v7 UUID.
54
- class SupportTicketIdDto {
55
- ticketId;
56
- }
57
- exports.SupportTicketIdDto = SupportTicketIdDto;
58
- __decorate([
59
- (0, class_validator_1.IsUUID)('7', { message: 'Invalid ticket ID format' }),
60
- __metadata("design:type", String)
61
- ], SupportTicketIdDto.prototype, "ticketId", void 0);
62
- class GetSupportTicketsDto {
63
- status;
64
- }
65
- exports.GetSupportTicketsDto = GetSupportTicketsDto;
66
- __decorate([
67
- (0, class_validator_1.IsOptional)(),
68
- (0, validators_1.IsNullable)(),
69
- (0, class_validator_1.IsEnum)(enum_1.SupportTicketStatus, { message: 'Invalid ticket status' }),
70
- __metadata("design:type", Object)
71
- ], GetSupportTicketsDto.prototype, "status", void 0);
72
- class CreateSupportTicketDto {
73
- subject;
74
- description;
75
- priority;
76
- category;
77
- attachments;
78
- }
79
- exports.CreateSupportTicketDto = CreateSupportTicketDto;
80
- __decorate([
81
- (0, class_validator_1.IsString)({ message: 'Invalid subject' }),
82
- (0, class_validator_1.MinLength)(1, { message: 'Subject cannot be empty' }),
83
- (0, class_validator_1.MaxLength)(200, { message: 'Subject cannot exceed 200 characters' }),
84
- __metadata("design:type", String)
85
- ], CreateSupportTicketDto.prototype, "subject", void 0);
86
- __decorate([
87
- (0, class_validator_1.IsString)({ message: 'Invalid description' }),
88
- (0, class_validator_1.MinLength)(1, { message: 'Description cannot be empty' }),
89
- (0, class_validator_1.MaxLength)(10000, { message: 'Description cannot exceed 10000 characters' }),
90
- __metadata("design:type", String)
91
- ], CreateSupportTicketDto.prototype, "description", void 0);
92
- __decorate([
93
- (0, class_validator_1.IsOptional)(),
94
- (0, validators_1.IsNullable)(),
95
- (0, class_validator_1.IsEnum)(enum_1.SupportTicketPriority, { message: 'Invalid priority' }),
96
- __metadata("design:type", Object)
97
- ], CreateSupportTicketDto.prototype, "priority", void 0);
98
- __decorate([
99
- (0, class_validator_1.IsOptional)(),
100
- (0, validators_1.IsNullable)(),
101
- (0, class_validator_1.IsEnum)(enum_1.SupportTicketCategory, { message: 'Invalid category' }),
102
- __metadata("design:type", Object)
103
- ], CreateSupportTicketDto.prototype, "category", void 0);
104
- __decorate([
105
- (0, class_validator_1.IsOptional)(),
106
- (0, validators_1.IsNullable)(),
107
- (0, class_validator_1.IsArray)({ message: 'Attachments must be an array' }),
108
- (0, class_validator_1.ArrayMaxSize)(10, { message: 'A ticket cannot have more than 10 attachments' }),
109
- (0, class_validator_1.ValidateNested)({ each: true, message: 'Invalid attachment' }),
110
- (0, class_transformer_1.Type)(() => SupportAttachmentDto),
111
- __metadata("design:type", Object)
112
- ], CreateSupportTicketDto.prototype, "attachments", void 0);
113
- class ReplySupportTicketDto {
114
- body;
115
- attachments;
116
- }
117
- exports.ReplySupportTicketDto = ReplySupportTicketDto;
118
- __decorate([
119
- (0, class_validator_1.IsString)({ message: 'Invalid message body' }),
120
- (0, class_validator_1.MinLength)(1, { message: 'Message body cannot be empty' }),
121
- (0, class_validator_1.MaxLength)(10000, { message: 'Message body cannot exceed 10000 characters' }),
122
- __metadata("design:type", String)
123
- ], ReplySupportTicketDto.prototype, "body", void 0);
124
- __decorate([
125
- (0, class_validator_1.IsOptional)(),
126
- (0, validators_1.IsNullable)(),
127
- (0, class_validator_1.IsArray)({ message: 'Attachments must be an array' }),
128
- (0, class_validator_1.ArrayMaxSize)(10, { message: 'A message cannot have more than 10 attachments' }),
129
- (0, class_validator_1.ValidateNested)({ each: true, message: 'Invalid attachment' }),
130
- (0, class_transformer_1.Type)(() => SupportAttachmentDto),
131
- __metadata("design:type", Object)
132
- ], ReplySupportTicketDto.prototype, "attachments", void 0);
133
- class AssignSupportTicketDto {
134
- assigned_to;
135
- }
136
- exports.AssignSupportTicketDto = AssignSupportTicketDto;
137
- __decorate([
138
- (0, class_validator_1.IsUUID)('7', { message: 'Invalid staff ID format' }),
139
- __metadata("design:type", String)
140
- ], AssignSupportTicketDto.prototype, "assigned_to", void 0);
141
- //# sourceMappingURL=dto.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dto.js","sourceRoot":"","sources":["../../../src/support/tickets/dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAAyC;AACzC,qDAYyB;AASzB,8EAI6D;AAC7D,iDAA8C;AAE9C,wFAAwF;AACxF,+EAA+E;AAE/E;;;GAGG;AACH,MAAa,oBAAoB;IAItB,IAAI,CAAU;IAKd,Q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AE,CAAC;IAC7D,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,oBAAoB,CAAC;;2DACoB;AAGvD,MAAa,qBAAqB;IAIvB,IAAI,CAAU;IAQd,WAAW,CAAiC;CACtD;AAbD,sDAaC;AATU;IAHR,IAAA,0BAAQ,EAAC,EAAE,OAAO,EAAE,sBAAsB,EAAE,CAAC;IAC7C,IAAA,2BAAS,EAAC,CAAC,EAAE,EAAE,OAAO,EAAE,8BAA8B,EAAE,CAAC;IACzD,IAAA,2BAAS,EAAC,KAAK,EAAE,EAAE,OAAO,EAAE,6CAA6C,EAAE,CAAC;;mDACtD;AAQd;IANR,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAU,GAAE;IACZ,IAAA,yBAAO,EAAC,EAAE,OAAO,EAAE,8BAA8B,EAAE,CAAC;IACpD,IAAA,8BAAY,EAAC,EAAE,EAAE,EAAE,OAAO,EAAE,gDAAgD,EAAE,CAAC;IAC/E,IAAA,gCAAc,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,oBAAoB,EAAE,CAAC;IAC7D,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,oBAAoB,CAAC;;0DACoB;AAGvD,MAAa,sBAAsB;IAExB,WAAW,CAAU;CAC/B;AAHD,wDAGC;AADU;IADR,IAAA,wBAAM,EAAC,GAAG,EAAE,EAAE,OAAO,EAAE,yBAAyB,EAAE,CAAC;;2DACtB"}
@@ -1,161 +0,0 @@
1
- import type { SupportAttachment, SupportMessageEntity, SupportTicketEntity, SupportTicketSummary } from '@managemint-solutions/entities/support/tickets';
2
- import { SupportMessageSource, SupportTicketStatus } from '@managemint-solutions/entities/support/tickets/enum';
3
- import type { AuthContext } from '../../auth';
4
- import { type AuditedTable, type AuditedTableOptions, type AuditResource, type AuditRow } from '../../audit';
5
- import type { TypedSupabaseClient } from '../../client';
6
- import type { CreateSupportTicketDto, GetSupportTicketsDto, ReplySupportTicketDto } from './dto';
7
- export * from './dto';
8
- /**
9
- * A member's own tickets. Every read and write is scoped by `organization_id`, matching the RLS
10
- * policies, and both tables are audited: `support_tickets` for the ticket and its status moves,
11
- * `support_messages` for the thread.
12
- *
13
- * The write payloads are deliberately narrow. Members hold an INSERT grant on `support_messages`
14
- * that omits `author_type`/`author_email`/`source`/`email_message_id` — the column defaults do
15
- * that work, so a member cannot forge an agent message — and an UPDATE grant on
16
- * `support_tickets` of `(status, updated_at)` only, which is why assignment, resolution and
17
- * closure live on the admin resource instead.
18
- */
19
- export declare class SupportTicketsResource {
20
- private readonly supabase;
21
- private readonly auth;
22
- private readonly ticketsTable;
23
- private readonly messagesTable;
24
- constructor(supabase: TypedSupabaseClient, auth: AuthContext, audit: AuditResource);
25
- list(query: GetSupportTicketsDto): Promise<SupportTicketSummary[]>;
26
- getById(ticketId: string): Promise<SupportTicketEntity>;
27
- /** The thread, oldest first — it is a conversation, and it is append-only. */
28
- messages(ticketId: string): Promise<SupportMessageEntity[]>;
29
- create(input: CreateSupportTicketDto): Promise<SupportTicketEntity>;
30
- /**
31
- * A client's reply. The status is read first because a closed ticket must be refused outright
32
- * — no row written, a 400 back — rather than silently swallowed by the compare-and-set below.
33
- *
34
- * Everything else moves the ticket to `awaiting_agent`, including `resolved`, which is what
35
- * reopens it. The move is guarded so a reply that races the agent closing the ticket loses
36
- * cleanly: the message stands, the status does not move.
37
- */
38
- reply(ticketId: string, input: ReplySupportTicketDto): Promise<SupportMessageEntity>;
39
- /** The just-written message, re-read so the caller gets the entity shape, embed and all. */
40
- private messageById;
41
- }
42
- /**
43
- * How the admin resource reaches an audited table once the row has told it which organization —
44
- * and, where there is one, which user — the write belongs to. The same shape as the outbox's
45
- * `OrganizationTableFactory`, and for the same reason: the resource spans organizations, so it
46
- * cannot be built inside one.
47
- */
48
- export type SupportAuditedTableFactory = (organizationId: string, actorMmsId: string | null, options: AuditedTableOptions) => AuditedTable;
49
- /** A ticket as the admin side reads it — tenancy and the reply token included. */
50
- export type SupportTicketWithSecrets = {
51
- mms_id: string;
52
- organization_id: string;
53
- created_at: string;
54
- created_by: string | null;
55
- subject: string;
56
- description: string;
57
- status: SupportTicketStatus;
58
- priority: string;
59
- category: string;
60
- assigned_to: string | null;
61
- deleted: boolean;
62
- /**
63
- * The secret behind `support+<token>@…`, from the ticket's row in
64
- * `support_ticket_email_tokens`. `null` when the ticket has no token row — a ticket whose
65
- * token insert never landed can still be worked on, it just has no replyable address.
66
- */
67
- email_token: string | null;
68
- };
69
- /** A cross-organization row of `listAll` — the summary plus the tenant it belongs to. */
70
- export type SupportTicketAdminSummary = SupportTicketSummary & {
71
- organization_id: string;
72
- };
73
- /** What the agent side supplies when it writes into a thread. */
74
- export type SupportAgentMessageInput = {
75
- body: string;
76
- author_email: string | null;
77
- source: SupportMessageSource;
78
- email_message_id?: string | null;
79
- attachments?: SupportAttachment[] | null;
80
- };
81
- /** What an inbound client email supplies. Its source is always email, so it is not asked for. */
82
- export type SupportInboundMessageInput = {
83
- body: string;
84
- author_email: string | null;
85
- email_message_id?: string | null;
86
- attachments?: SupportAttachment[] | null;
87
- };
88
- /**
89
- * The agent's side of support, on the service client: the inbound email webhook, which knows only
90
- * a reply token, and the shared-secret admin routes. RLS reserves everything here to the service
91
- * role — `assigned_to`, `resolved_at`, `closed_at` and the agent columns on a message are all
92
- * outside a member's grants, and `support_ticket_email_tokens` is outside every member's grant
93
- * entirely.
94
- *
95
- * Reads that answer "which tenant is this?" are unscoped by necessity; every write is attributed
96
- * to the row's own organization, with the actor being the matched user for an inbound client mail
97
- * and `null` for agent and system work.
98
- */
99
- export declare class SupportTicketsAdminResource {
100
- private readonly supabase;
101
- private readonly tableFor;
102
- constructor(supabase: TypedSupabaseClient, tableFor: SupportAuditedTableFactory);
103
- private tickets;
104
- private messages;
105
- /**
106
- * Every organization's tickets in one list. Deliberately unscoped: the sole support agent works
107
- * across tenants, and this read is what the service role exists for.
108
- */
109
- listAll(): Promise<SupportTicketAdminSummary[]>;
110
- /**
111
- * The ticket behind a reply address. Read from the token table, which is the side that holds
112
- * the foreign key, so the ticket arrives embedded and one query answers the whole question.
113
- * Also unscoped by necessity — an inbound email carries nothing but the token, and the row it
114
- * matches is what says which tenant it belongs to. No match means the mail was never ticket
115
- * mail, and neither is a soft-deleted ticket.
116
- */
117
- findByEmailToken(token: string): Promise<SupportTicketWithSecrets | null>;
118
- /**
119
- * The same shape by id, for the admin routes, which already know the ticket they are acting on.
120
- * The ticket is read first and on its own: an admin must be able to work a ticket whose token
121
- * row is missing, so the token is looked up separately and its absence is a `null`, not a 404.
122
- */
123
- getWithSecrets(ticketId: string): Promise<SupportTicketWithSecrets>;
124
- /**
125
- * Mints the ticket's reply token. The api calls it as soon as a member's ticket is created,
126
- * and the address `support+<token>@…` is built from what comes back.
127
- *
128
- * A plain insert, deliberately unaudited: there is no `AuditTrailEntityType` for the table, and
129
- * `audit_logs` is readable by any member holding `read_logs` — so a token snapshotted into a
130
- * change set would be the one leak the separate table exists to prevent.
131
- */
132
- createEmailToken(ticketId: string): Promise<string>;
133
- private emailToken;
134
- /**
135
- * An agent's reply, from the mail Scott sends or from the admin route. The ball goes back to
136
- * the client — but only from a live status, so writing on a resolved or closed ticket leaves it
137
- * where it is.
138
- */
139
- addAgentMessage(ticket: SupportTicketWithSecrets, message: SupportAgentMessageInput): Promise<AuditRow>;
140
- /**
141
- * A client's reply that arrived by email. `userMmsId` is the profile the From header was matched
142
- * to — the classification the webhook has already done — so the message and the status move are
143
- * attributed to them exactly as a portal reply would be, reopening a resolved ticket.
144
- */
145
- addInboundUserMessage(ticket: SupportTicketWithSecrets, userMmsId: string, message: SupportInboundMessageInput): Promise<AuditRow>;
146
- /**
147
- * Puts a ticket on a staff member. Works for a first assign and a reassign alike, and refuses
148
- * on a closed ticket — the guard is `status <> closed`, so losing that race writes nothing and
149
- * returns null.
150
- *
151
- * A first assign additionally puts the ticket in the agent's queue, but only from `open`: a
152
- * thread that has already moved on keeps the status it earned, and a reassign never touches
153
- * status at all. That flip is its own compare-and-set rather than part of the patch above, so
154
- * a status that moves between the two never gets overwritten.
155
- */
156
- assign(ticketId: string, staffMmsId: string): Promise<AuditRow | null>;
157
- /** Resolves a live ticket. Concurrent resolves settle on one write; the loser returns null. */
158
- resolve(ticketId: string): Promise<AuditRow | null>;
159
- /** Closes a ticket from any status but closed. Terminal — nothing reopens it. */
160
- close(ticketId: string): Promise<AuditRow | null>;
161
- }
@@ -1,443 +0,0 @@
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
@@ -1 +0,0 @@
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;;;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