@managemint-solutions/entities 1.2.0 → 1.5.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.
@@ -9,7 +9,6 @@ export type AdditionalDetailSummary = {
9
9
  copyable: boolean;
10
10
  };
11
11
  export type AdditionalDetailsEntity = {
12
- id: number;
13
12
  mms_id: UUID;
14
13
  created_at: Date;
15
14
  created_by: UserIdentity;
@@ -19,5 +19,8 @@ export declare enum AuditTrailEntityType {
19
19
  TASKS = "tasks",
20
20
  TIMESHEETS = "timesheets",
21
21
  BILLING_TRANSACTIONS = "billing_transactions",
22
- NOTIFICATION = "notifications"
22
+ NOTIFICATION = "notifications",
23
+ SUPPORT_TICKETS = "support_tickets",
24
+ SUPPORT_MESSAGES = "support_messages",
25
+ STAFF = "staff"
23
26
  }
@@ -25,4 +25,7 @@ var AuditTrailEntityType;
25
25
  AuditTrailEntityType["TIMESHEETS"] = "timesheets";
26
26
  AuditTrailEntityType["BILLING_TRANSACTIONS"] = "billing_transactions";
27
27
  AuditTrailEntityType["NOTIFICATION"] = "notifications";
28
+ AuditTrailEntityType["SUPPORT_TICKETS"] = "support_tickets";
29
+ AuditTrailEntityType["SUPPORT_MESSAGES"] = "support_messages";
30
+ AuditTrailEntityType["STAFF"] = "staff";
28
31
  })(AuditTrailEntityType || (exports.AuditTrailEntityType = AuditTrailEntityType = {}));
@@ -13,5 +13,10 @@ export declare enum NotificationType {
13
13
  PROJECT_MANAGER_ASSIGNED = "project_manager_assigned",
14
14
  PAYMENT_FAILED = "payment_failed",
15
15
  SIGNUP_CONFIRMATION = "signup_confirmation",
16
- PASSWORD_RECOVERY = "password_recovery"
16
+ PASSWORD_RECOVERY = "password_recovery",
17
+ SUPPORT_TICKET_CREATED = "support_ticket_created",
18
+ SUPPORT_TICKET_CONFIRMATION = "support_ticket_confirmation",
19
+ SUPPORT_TICKET_REPLY = "support_ticket_reply",
20
+ SUPPORT_TICKET_CLIENT_REPLY = "support_ticket_client_reply",
21
+ SUPPORT_TICKET_RESOLVED = "support_ticket_resolved"
17
22
  }
@@ -22,5 +22,10 @@ var NotificationType;
22
22
  NotificationType["PAYMENT_FAILED"] = "payment_failed";
23
23
  NotificationType["SIGNUP_CONFIRMATION"] = "signup_confirmation";
24
24
  NotificationType["PASSWORD_RECOVERY"] = "password_recovery";
25
+ NotificationType["SUPPORT_TICKET_CREATED"] = "support_ticket_created";
26
+ NotificationType["SUPPORT_TICKET_CONFIRMATION"] = "support_ticket_confirmation";
27
+ NotificationType["SUPPORT_TICKET_REPLY"] = "support_ticket_reply";
28
+ NotificationType["SUPPORT_TICKET_CLIENT_REPLY"] = "support_ticket_client_reply";
29
+ NotificationType["SUPPORT_TICKET_RESOLVED"] = "support_ticket_resolved";
25
30
  })(NotificationType || (exports.NotificationType = NotificationType = {}));
26
31
  ;
@@ -6,7 +6,8 @@ export declare enum ResendWebhookEventType {
6
6
  EMAIL_CLICKED = "email.clicked",
7
7
  EMAIL_BOUNCED = "email.bounced",
8
8
  EMAIL_COMPLAINED = "email.complained",
9
- EMAIL_FAILED = "email.failed"
9
+ EMAIL_FAILED = "email.failed",
10
+ EMAIL_RECEIVED = "email.received"
10
11
  }
11
12
  export declare enum ResendWebhookProcessingStatus {
12
13
  RECEIVED = "received",
@@ -11,6 +11,7 @@ var ResendWebhookEventType;
11
11
  ResendWebhookEventType["EMAIL_BOUNCED"] = "email.bounced";
12
12
  ResendWebhookEventType["EMAIL_COMPLAINED"] = "email.complained";
13
13
  ResendWebhookEventType["EMAIL_FAILED"] = "email.failed";
14
+ ResendWebhookEventType["EMAIL_RECEIVED"] = "email.received";
14
15
  })(ResendWebhookEventType || (exports.ResendWebhookEventType = ResendWebhookEventType = {}));
15
16
  ;
16
17
  var ResendWebhookProcessingStatus;
@@ -26,11 +26,29 @@ export type ResendEmailEventData = {
26
26
  reason: string;
27
27
  };
28
28
  };
29
+ /**
30
+ * One inbound email as `email.received` delivers it. The payload is metadata
31
+ * only — body text and attachment bytes are fetched from the receiving API
32
+ * with `email_id`.
33
+ */
34
+ export type ResendInboundEmailData = {
35
+ email_id: string;
36
+ from: string;
37
+ to: string[];
38
+ cc: string[];
39
+ message_id: string;
40
+ subject: string;
41
+ attachments: {
42
+ filename: string;
43
+ content_type: string;
44
+ size: number;
45
+ }[];
46
+ };
29
47
  /**
30
48
  * The webhook envelope. `type` is wider than the enum on purpose: Resend also
31
- * emits event families we do not subscribe to (email.received, domain.*,
32
- * contact.*, suppression.*) and an unknown type must still parse so the
33
- * receiver can acknowledge it.
49
+ * emits event families we do not subscribe to (domain.*, contact.*,
50
+ * suppression.*) and an unknown type must still parse so the receiver can
51
+ * acknowledge it.
34
52
  */
35
53
  export type ResendWebhookEventPayload = {
36
54
  type: ResendWebhookEventType | string;
@@ -0,0 +1,15 @@
1
+ import { UUID } from 'crypto';
2
+ export type StaffIdentity = {
3
+ mms_id: UUID;
4
+ name: string;
5
+ surname: string;
6
+ };
7
+ export type StaffEntity = {
8
+ mms_id: UUID;
9
+ created_at: string;
10
+ updated_at: string | null;
11
+ name: string;
12
+ surname: string;
13
+ deleted: boolean;
14
+ deleted_at: string | null;
15
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,22 @@
1
+ import { SupportAttachment } from '..';
2
+ import { SupportTicketCategory, SupportTicketPriority, SupportTicketStatus } from '../enum';
3
+ export type SupportTicketIdDto = {
4
+ ticketId: string;
5
+ };
6
+ export type GetSupportTicketsDto = {
7
+ status?: SupportTicketStatus | null;
8
+ };
9
+ export type CreateSupportTicketDto = {
10
+ subject: string;
11
+ description: string;
12
+ priority?: SupportTicketPriority | null;
13
+ category?: SupportTicketCategory | null;
14
+ attachments?: SupportAttachment[] | null;
15
+ };
16
+ export type ReplySupportTicketDto = {
17
+ body: string;
18
+ attachments?: SupportAttachment[] | null;
19
+ };
20
+ export type AssignSupportTicketDto = {
21
+ assigned_to: string;
22
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,27 @@
1
+ export declare enum SupportTicketStatus {
2
+ OPEN = "open",
3
+ AWAITING_AGENT = "awaiting_agent",
4
+ AWAITING_USER = "awaiting_user",
5
+ RESOLVED = "resolved",
6
+ CLOSED = "closed"
7
+ }
8
+ export declare enum SupportTicketPriority {
9
+ LOW = "low",
10
+ NORMAL = "normal",
11
+ HIGH = "high"
12
+ }
13
+ export declare enum SupportTicketCategory {
14
+ BILLING = "billing",
15
+ BUG = "bug",
16
+ QUESTION = "question",
17
+ OTHER = "other"
18
+ }
19
+ export declare enum SupportMessageAuthorType {
20
+ USER = "user",
21
+ AGENT = "agent"
22
+ }
23
+ export declare enum SupportMessageSource {
24
+ PORTAL = "portal",
25
+ EMAIL = "email",
26
+ API = "api"
27
+ }
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SupportMessageSource = exports.SupportMessageAuthorType = exports.SupportTicketCategory = exports.SupportTicketPriority = exports.SupportTicketStatus = void 0;
4
+ var SupportTicketStatus;
5
+ (function (SupportTicketStatus) {
6
+ SupportTicketStatus["OPEN"] = "open";
7
+ SupportTicketStatus["AWAITING_AGENT"] = "awaiting_agent";
8
+ SupportTicketStatus["AWAITING_USER"] = "awaiting_user";
9
+ SupportTicketStatus["RESOLVED"] = "resolved";
10
+ SupportTicketStatus["CLOSED"] = "closed";
11
+ })(SupportTicketStatus || (exports.SupportTicketStatus = SupportTicketStatus = {}));
12
+ ;
13
+ var SupportTicketPriority;
14
+ (function (SupportTicketPriority) {
15
+ SupportTicketPriority["LOW"] = "low";
16
+ SupportTicketPriority["NORMAL"] = "normal";
17
+ SupportTicketPriority["HIGH"] = "high";
18
+ })(SupportTicketPriority || (exports.SupportTicketPriority = SupportTicketPriority = {}));
19
+ ;
20
+ var SupportTicketCategory;
21
+ (function (SupportTicketCategory) {
22
+ SupportTicketCategory["BILLING"] = "billing";
23
+ SupportTicketCategory["BUG"] = "bug";
24
+ SupportTicketCategory["QUESTION"] = "question";
25
+ SupportTicketCategory["OTHER"] = "other";
26
+ })(SupportTicketCategory || (exports.SupportTicketCategory = SupportTicketCategory = {}));
27
+ ;
28
+ var SupportMessageAuthorType;
29
+ (function (SupportMessageAuthorType) {
30
+ SupportMessageAuthorType["USER"] = "user";
31
+ SupportMessageAuthorType["AGENT"] = "agent";
32
+ })(SupportMessageAuthorType || (exports.SupportMessageAuthorType = SupportMessageAuthorType = {}));
33
+ ;
34
+ var SupportMessageSource;
35
+ (function (SupportMessageSource) {
36
+ SupportMessageSource["PORTAL"] = "portal";
37
+ SupportMessageSource["EMAIL"] = "email";
38
+ SupportMessageSource["API"] = "api";
39
+ })(SupportMessageSource || (exports.SupportMessageSource = SupportMessageSource = {}));
40
+ ;
@@ -0,0 +1,51 @@
1
+ import { UUID } from 'crypto';
2
+ import { StaffIdentity } from '../../staff';
3
+ import { UserIdentity } from '../../users';
4
+ import { SupportMessageAuthorType, SupportMessageSource, SupportTicketCategory, SupportTicketPriority, SupportTicketStatus } from './enum';
5
+ export type SupportAttachment = {
6
+ path: string;
7
+ filename: string;
8
+ size: number;
9
+ content_type: string;
10
+ /** Short-lived signed URL, minted when a ticket is read. Never stored. */
11
+ url?: string;
12
+ };
13
+ export type SupportTicketIdentity = {
14
+ mms_id: UUID;
15
+ subject: string;
16
+ };
17
+ export type SupportTicketSummary = {
18
+ mms_id: UUID;
19
+ created_at: string;
20
+ updated_at: string | null;
21
+ subject: string;
22
+ status: SupportTicketStatus;
23
+ priority: SupportTicketPriority;
24
+ category: SupportTicketCategory;
25
+ assigned_to_staff: StaffIdentity | null;
26
+ };
27
+ export type SupportTicketEntity = {
28
+ mms_id: UUID;
29
+ created_at: string;
30
+ created_by: UserIdentity;
31
+ updated_at: string | null;
32
+ subject: string;
33
+ description: string;
34
+ status: SupportTicketStatus;
35
+ priority: SupportTicketPriority;
36
+ category: SupportTicketCategory;
37
+ assigned_to_staff: StaffIdentity | null;
38
+ attachments: SupportAttachment[];
39
+ resolved_at: string | null;
40
+ closed_at: string | null;
41
+ };
42
+ export type SupportMessageEntity = {
43
+ mms_id: UUID;
44
+ created_at: string;
45
+ created_by: UserIdentity | null;
46
+ author_type: SupportMessageAuthorType;
47
+ author_email: string | null;
48
+ source: SupportMessageSource;
49
+ body: string;
50
+ attachments: SupportAttachment[];
51
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -42,3 +42,31 @@ export type UpdateUserDto = {
42
42
  emergency_contact_phone?: string | null;
43
43
  emergency_contact_email?: string | null;
44
44
  };
45
+ /**
46
+ * What a member may change about themselves, via `PATCH /users/me`.
47
+ *
48
+ * Deliberately narrower than UpdateUserDto, which is the *directory admin* contract
49
+ * behind `update_users`. Absent here on purpose:
50
+ * job_title, employment_type,
51
+ * start_date, end_date - HR-owned work details, not self-service
52
+ * manager_id - an org structure decision
53
+ * email - GoTrue's, changed through the auth flow
54
+ * profile_image - set by POST /users/me/profile-image, never by the client
55
+ */
56
+ export type UpdateMyProfileDto = {
57
+ name: string;
58
+ surname: string;
59
+ phone: string;
60
+ country_code: string;
61
+ birthday?: string | null;
62
+ social_facebook?: string | null;
63
+ social_linkedin?: string | null;
64
+ social_twitter?: string | null;
65
+ social_instagram?: string | null;
66
+ social_github?: string | null;
67
+ social_website?: string | null;
68
+ emergency_contact_name?: string | null;
69
+ emergency_contact_relationship?: EmergencyContactRelationship | null;
70
+ emergency_contact_phone?: string | null;
71
+ emergency_contact_email?: string | null;
72
+ };
@@ -55,7 +55,6 @@ export interface CrudPermission {
55
55
  delete: boolean;
56
56
  }
57
57
  export interface PermissionsEntity {
58
- id: number;
59
58
  mms_id: string;
60
59
  user_id: string;
61
60
  organization_id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@managemint-solutions/entities",
3
- "version": "1.2.0",
3
+ "version": "1.5.0",
4
4
  "description": "Entity types used by both the api and portal",
5
5
  "homepage": "https://github.com/ManageMint-Solutions/managemint-solutions-entities#readme",
6
6
  "bugs": {