orbitx-core-models 11.103.0 → 11.112.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.
Files changed (52) hide show
  1. package/dist/index.d.ts +14 -2
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +29 -1
  4. package/dist/interfaces/agent.interface.d.ts +6 -1
  5. package/dist/interfaces/agent.interface.d.ts.map +1 -1
  6. package/dist/interfaces/callSession.interface.d.ts +6 -0
  7. package/dist/interfaces/callSession.interface.d.ts.map +1 -1
  8. package/dist/interfaces/request.interface.d.ts +33 -0
  9. package/dist/interfaces/request.interface.d.ts.map +1 -0
  10. package/dist/interfaces/request.interface.js +2 -0
  11. package/dist/interfaces/role.interface.d.ts +12 -0
  12. package/dist/interfaces/role.interface.d.ts.map +1 -0
  13. package/dist/interfaces/role.interface.js +2 -0
  14. package/dist/interfaces/user.interface.d.ts +5 -0
  15. package/dist/interfaces/user.interface.d.ts.map +1 -1
  16. package/dist/models/agent.model.d.ts.map +1 -1
  17. package/dist/models/agent.model.js +21 -2
  18. package/dist/models/callSession.model.d.ts.map +1 -1
  19. package/dist/models/callSession.model.js +12 -0
  20. package/dist/models/request.model.d.ts +9 -0
  21. package/dist/models/request.model.d.ts.map +1 -0
  22. package/dist/models/request.model.js +150 -0
  23. package/dist/models/role.model.d.ts +8 -0
  24. package/dist/models/role.model.d.ts.map +1 -0
  25. package/dist/models/role.model.js +72 -0
  26. package/dist/models/user.model.d.ts.map +1 -1
  27. package/dist/models/user.model.js +21 -0
  28. package/dist/permissions/resolve.d.ts +50 -0
  29. package/dist/permissions/resolve.d.ts.map +1 -0
  30. package/dist/permissions/resolve.js +68 -0
  31. package/dist/permissions/seeds/roles.seed.d.ts +19 -0
  32. package/dist/permissions/seeds/roles.seed.d.ts.map +1 -0
  33. package/dist/permissions/seeds/roles.seed.js +169 -0
  34. package/dist/permissions/treeUtils.d.ts +9 -0
  35. package/dist/permissions/treeUtils.d.ts.map +1 -0
  36. package/dist/permissions/treeUtils.js +46 -0
  37. package/dist/permissions/trees/client.tree.d.ts +3 -0
  38. package/dist/permissions/trees/client.tree.d.ts.map +1 -0
  39. package/dist/permissions/trees/client.tree.js +99 -0
  40. package/dist/permissions/trees/employee.tree.d.ts +3 -0
  41. package/dist/permissions/trees/employee.tree.d.ts.map +1 -0
  42. package/dist/permissions/trees/employee.tree.js +35 -0
  43. package/dist/permissions/trees/ops.tree.d.ts +3 -0
  44. package/dist/permissions/trees/ops.tree.d.ts.map +1 -0
  45. package/dist/permissions/trees/ops.tree.js +173 -0
  46. package/dist/permissions/trees/partner.tree.d.ts +3 -0
  47. package/dist/permissions/trees/partner.tree.d.ts.map +1 -0
  48. package/dist/permissions/trees/partner.tree.js +71 -0
  49. package/dist/permissions/types.d.ts +9 -0
  50. package/dist/permissions/types.d.ts.map +1 -0
  51. package/dist/permissions/types.js +4 -0
  52. package/package.json +1 -1
@@ -0,0 +1,173 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.opsTree = void 0;
4
+ // Transcribed from the client's "Role & Access" spec (Ops Dashboard section).
5
+ // "Billing" (Invoices / Payment Method / Adjust Billing Cycle) is a Company
6
+ // concept only -- companies are billed for the product, partners are paid
7
+ // out (see partners.payouts). The spec's global-admin listing nested a
8
+ // "Billing" step under Partners, but per the client that's a doc typo
9
+ // (confirmed 2026-09-12): partners have earnings/payouts, not billing.
10
+ exports.opsTree = [
11
+ {
12
+ key: "profile",
13
+ label: "Profile",
14
+ children: [
15
+ { key: "profile.editPersonalInformation", label: "Edit Personal Information" },
16
+ { key: "profile.updatePassword", label: "Update Password" },
17
+ { key: "profile.twoFactorAuthentication", label: "Two Factor Authentication" },
18
+ { key: "profile.viewSessions", label: "View Sessions" },
19
+ ],
20
+ },
21
+ { key: "status", label: "Status" },
22
+ {
23
+ key: "dashboard",
24
+ label: "Dashboard",
25
+ children: [
26
+ { key: "dashboard.liveChat", label: "Live Chat" },
27
+ { key: "dashboard.companies", label: "Companies" },
28
+ { key: "dashboard.partners", label: "Partners" },
29
+ { key: "dashboard.revenue", label: "Revenue" },
30
+ ],
31
+ },
32
+ {
33
+ key: "companies",
34
+ label: "Companies",
35
+ children: [
36
+ { key: "companies.createCompany", label: "Create Company" },
37
+ {
38
+ key: "companies.account",
39
+ label: "Account",
40
+ children: [
41
+ { key: "companies.account.basicInformation", label: "Basic Information" },
42
+ { key: "companies.account.contactInformation", label: "Contact Information" },
43
+ { key: "companies.account.hoursCallConnect", label: "Hours/Call Connect" },
44
+ { key: "companies.account.leadForm", label: "Lead Form" },
45
+ { key: "companies.account.users", label: "Users" },
46
+ { key: "companies.account.script", label: "Script" },
47
+ { key: "companies.account.appointmentScheduling", label: "Appointment Scheduling" },
48
+ { key: "companies.account.retainerScheduling", label: "Retainer Scheduling" },
49
+ ],
50
+ },
51
+ {
52
+ key: "companies.branding",
53
+ label: "Branding",
54
+ children: [
55
+ { key: "companies.branding.widget", label: "Widget" },
56
+ { key: "companies.branding.aliases", label: "Aliases" },
57
+ { key: "companies.branding.exitPopUp", label: "Exit Pop Up" },
58
+ { key: "companies.branding.appearance", label: "Appearance" },
59
+ ],
60
+ },
61
+ {
62
+ key: "companies.plansAddOns",
63
+ label: "Plans & Add Ons",
64
+ children: [
65
+ { key: "companies.plansAddOns.chatX", label: "CHAT-X" },
66
+ { key: "companies.plansAddOns.addOns", label: "Add Ons" },
67
+ ],
68
+ },
69
+ { key: "companies.integrations", label: "Integrations" },
70
+ ],
71
+ },
72
+ {
73
+ key: "partners",
74
+ label: "Partners",
75
+ children: [
76
+ { key: "partners.createPartner", label: "Create Partner" },
77
+ {
78
+ key: "partners.account",
79
+ label: "Account",
80
+ children: [
81
+ { key: "partners.account.basicInformation", label: "Basic Information" },
82
+ { key: "partners.account.contactInformation", label: "Contact Information" },
83
+ { key: "partners.account.users", label: "Users" },
84
+ { key: "partners.account.bankInformation", label: "Bank Information" },
85
+ ],
86
+ },
87
+ {
88
+ key: "partners.payouts",
89
+ label: "Payouts",
90
+ children: [
91
+ { key: "partners.payouts.transfers", label: "Transfers" },
92
+ { key: "partners.payouts.withdrawals", label: "Withdrawals" },
93
+ { key: "partners.payouts.processPayout", label: "Process Payout" },
94
+ ],
95
+ },
96
+ ],
97
+ },
98
+ {
99
+ key: "billing",
100
+ label: "Billing",
101
+ children: [
102
+ { key: "billing.invoices", label: "Invoices" },
103
+ { key: "billing.paymentMethod", label: "Payment Method" },
104
+ { key: "billing.adjustBillingCycle", label: "Adjust Billing Cycle" },
105
+ ],
106
+ },
107
+ {
108
+ key: "invoices",
109
+ label: "Invoices",
110
+ children: [{ key: "invoices.createNewInvoice", label: "Create New Invoice" }],
111
+ },
112
+ { key: "inbox", label: "Inbox" },
113
+ {
114
+ key: "leads",
115
+ label: "Leads",
116
+ children: [
117
+ { key: "leads.forward", label: "Forward" },
118
+ { key: "leads.viewScript", label: "View Script" },
119
+ { key: "leads.viewConversation", label: "View Conversation" },
120
+ { key: "leads.company", label: "Company" },
121
+ { key: "leads.chatHistory", label: "Chat History" },
122
+ ],
123
+ },
124
+ {
125
+ key: "conversations",
126
+ label: "Conversations",
127
+ children: [{ key: "conversations.viewLead", label: "View Lead" }],
128
+ },
129
+ {
130
+ key: "tickets",
131
+ label: "Tickets",
132
+ children: [{ key: "tickets.updateTicket", label: "Update Ticket" }],
133
+ },
134
+ {
135
+ key: "requests",
136
+ label: "Requests",
137
+ children: [{ key: "requests.updateRequest", label: "Update Request" }],
138
+ },
139
+ {
140
+ key: "reviews",
141
+ label: "Reviews",
142
+ children: [{ key: "reviews.updateReview", label: "Update Review" }],
143
+ },
144
+ {
145
+ key: "logs",
146
+ label: "Logs",
147
+ children: [{ key: "logs.detailedLogView", label: "Detailed Log View" }],
148
+ },
149
+ {
150
+ key: "profiles",
151
+ label: "Profiles",
152
+ children: [{ key: "profiles.createProfile", label: "Create Profile" }],
153
+ },
154
+ { key: "employees", label: "Employees" },
155
+ {
156
+ key: "groups",
157
+ label: "Groups",
158
+ children: [{ key: "groups.createGroup", label: "Create Group" }],
159
+ },
160
+ {
161
+ key: "scripts",
162
+ label: "Scripts",
163
+ children: [
164
+ { key: "scripts.createVertical", label: "Create Vertical" },
165
+ { key: "scripts.updateVertical", label: "Update Vertical" },
166
+ { key: "scripts.deleteVertical", label: "Delete Vertical" },
167
+ ],
168
+ },
169
+ { key: "updates", label: "Updates" },
170
+ { key: "settings", label: "Settings" },
171
+ // Reserved: feature not yet specified/built. No route is gated on this today.
172
+ { key: "chatFlux", label: "Chat Flux" },
173
+ ];
@@ -0,0 +1,3 @@
1
+ import { PermissionNode } from "../types";
2
+ export declare const partnerTree: PermissionNode[];
3
+ //# sourceMappingURL=partner.tree.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"partner.tree.d.ts","sourceRoot":"","sources":["../../../src/permissions/trees/partner.tree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAM1C,eAAO,MAAM,WAAW,EAAE,cAAc,EA+DvC,CAAC"}
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.partnerTree = void 0;
4
+ // Transcribed from the client's "Role & Access" spec (Partner Dashboard section).
5
+ // Only one predefined role exists here ("admin", full tree) -- the doc's own note:
6
+ // "An admin can control custom access from the above tree of a new or old user,
7
+ // there are no more pre-made roles for partner dashboard."
8
+ exports.partnerTree = [
9
+ {
10
+ key: "profile",
11
+ label: "Profile",
12
+ children: [
13
+ { key: "profile.editPersonalInformation", label: "Edit Personal Information" },
14
+ { key: "profile.updatePassword", label: "Update Password" },
15
+ { key: "profile.twoFactorAuthentication", label: "Two Factor Authentication" },
16
+ { key: "profile.viewSessions", label: "View Sessions" },
17
+ ],
18
+ },
19
+ {
20
+ key: "dashboard",
21
+ label: "Dashboard",
22
+ children: [
23
+ { key: "dashboard.analytics", label: "Analytics" },
24
+ { key: "dashboard.estimator", label: "Estimator" },
25
+ ],
26
+ },
27
+ { key: "referrals", label: "Referrals" },
28
+ { key: "leads", label: "Leads" },
29
+ {
30
+ key: "account",
31
+ label: "Account",
32
+ children: [
33
+ {
34
+ key: "account.details",
35
+ label: "Account",
36
+ children: [
37
+ { key: "account.details.basicInformation", label: "Basic Information" },
38
+ { key: "account.details.contactInformation", label: "Contact Information" },
39
+ { key: "account.details.users", label: "Users" },
40
+ { key: "account.details.bankInformation", label: "Bank Information" },
41
+ ],
42
+ },
43
+ {
44
+ key: "account.branding",
45
+ label: "Branding",
46
+ children: [{ key: "account.branding.appearance", label: "Appearance" }],
47
+ },
48
+ ],
49
+ },
50
+ {
51
+ key: "wallet",
52
+ label: "Wallet",
53
+ children: [{ key: "wallet.withdrawFunds", label: "Withdraw Funds" }],
54
+ },
55
+ {
56
+ key: "reviews",
57
+ label: "Reviews",
58
+ children: [{ key: "reviews.submitReviews", label: "Submit Reviews" }],
59
+ },
60
+ {
61
+ key: "requests",
62
+ label: "Requests",
63
+ children: [{ key: "requests.createRequest", label: "Create Request" }],
64
+ },
65
+ {
66
+ key: "tickets",
67
+ label: "Tickets",
68
+ children: [{ key: "tickets.createTicket", label: "Create Ticket" }],
69
+ },
70
+ { key: "leadTarget", label: "Lead Target" },
71
+ ];
@@ -0,0 +1,9 @@
1
+ export type Dashboard = "ops" | "employee" | "partner" | "client";
2
+ export interface PermissionNode {
3
+ /** Dot-path unique within a dashboard's tree, e.g. "companies.account.leadForm" */
4
+ key: string;
5
+ label: string;
6
+ children?: PermissionNode[];
7
+ }
8
+ export declare const DASHBOARDS: Dashboard[];
9
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/permissions/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,UAAU,GAAG,SAAS,GAAG,QAAQ,CAAC;AAElE,MAAM,WAAW,cAAc;IAC7B,mFAAmF;IACnF,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,cAAc,EAAE,CAAC;CAC7B;AAED,eAAO,MAAM,UAAU,EAAE,SAAS,EAA6C,CAAC"}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DASHBOARDS = void 0;
4
+ exports.DASHBOARDS = ["ops", "employee", "partner", "client"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orbitx-core-models",
3
- "version": "11.103.0",
3
+ "version": "11.112.0",
4
4
  "description": "Shared Mongoose models and interfaces for OrbitX services",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",