orbitx-core-models 11.104.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 +5 -0
  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 +20 -0
  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 @@
1
+ {"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../src/permissions/resolve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGpC,MAAM,WAAW,gBAAgB;IAC/B,cAAc,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;IACnC,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC/B;;;OAGG;IACH,MAAM,CAAC,EAAE;QAAE,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,GAAG,OAAO,CAAC;CAC/C;AAED;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,gBAAgB,GAAG,GAAG,CAAC,MAAM,CAAC,CAYjF;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAE5E;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,gBAAgB,CAkB1F;AAED,mFAAmF;AACnF,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,EAAE,CAEhE;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,SAAS,EACpB,eAAe,EAAE,MAAM,EAAE,EACzB,SAAS,EAAE,MAAM,EAAE,GAClB,gBAAgB,CAElB"}
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.resolveEffectivePermissions = resolveEffectivePermissions;
4
+ exports.hasPermission = hasPermission;
5
+ exports.validateGrantedKeys = validateGrantedKeys;
6
+ exports.getFullAccessKeys = getFullAccessKeys;
7
+ exports.validateExtraKeys = validateExtraKeys;
8
+ const treeUtils_1 = require("./treeUtils");
9
+ /**
10
+ * Single source of truth for "what can this user/agent actually do", used
11
+ * identically by every backend's requirePermission middleware and by each
12
+ * frontend's usePermissions() hook (via the effectivePermissions the login/
13
+ * `GET /me` response should expose). Does not hit the DB — the caller is
14
+ * responsible for populating `roleId` beforehand when in "role" mode.
15
+ */
16
+ function resolveEffectivePermissions(source) {
17
+ var _a, _b;
18
+ if (source.permissionMode === "custom") {
19
+ return new Set((_a = source.permissionKeys) !== null && _a !== void 0 ? _a : []);
20
+ }
21
+ const role = source.roleId;
22
+ const keys = new Set();
23
+ if (role && Array.isArray(role.grantedKeys)) {
24
+ role.grantedKeys.forEach((k) => keys.add(k));
25
+ }
26
+ ((_b = source.extraPermissionKeys) !== null && _b !== void 0 ? _b : []).forEach((k) => keys.add(k));
27
+ return keys;
28
+ }
29
+ function hasPermission(source, key) {
30
+ return resolveEffectivePermissions(source).has(key);
31
+ }
32
+ /**
33
+ * Enforces the parent-gates-children rule server-side: a submitted set is
34
+ * only valid if every key exists in that dashboard's tree AND every key's
35
+ * full ancestor chain is also present in the set. Run this on every write
36
+ * path that accepts a custom permission set or a new Role's grantedKeys —
37
+ * never trust client-side tree-editor state alone.
38
+ */
39
+ function validateGrantedKeys(dashboard, keys) {
40
+ const errors = [];
41
+ const validKeys = new Set((0, treeUtils_1.getAllKeys)(dashboard));
42
+ const keySet = new Set(keys);
43
+ for (const key of keys) {
44
+ if (!validKeys.has(key)) {
45
+ errors.push(`Unknown permission key "${key}" for dashboard "${dashboard}"`);
46
+ continue;
47
+ }
48
+ for (const ancestor of (0, treeUtils_1.getAncestorKeys)(key)) {
49
+ if (!keySet.has(ancestor)) {
50
+ errors.push(`"${key}" is granted but its required parent "${ancestor}" is not`);
51
+ }
52
+ }
53
+ }
54
+ return { valid: errors.length === 0, errors };
55
+ }
56
+ /** Every key in a dashboard's tree, granted at once -- for "full access" roles. */
57
+ function getFullAccessKeys(dashboard) {
58
+ return (0, treeUtils_1.getAllKeys)(dashboard);
59
+ }
60
+ /**
61
+ * Validates a role's extraPermissionKeys against the UNION of the role's own
62
+ * grantedKeys and the extras -- an extra key's parent may already be covered
63
+ * by the role itself, so it doesn't need to be duplicated into the extras
64
+ * list. Call this on every write path that accepts extraPermissionKeys.
65
+ */
66
+ function validateExtraKeys(dashboard, roleGrantedKeys, extraKeys) {
67
+ return validateGrantedKeys(dashboard, [...roleGrantedKeys, ...extraKeys]);
68
+ }
@@ -0,0 +1,19 @@
1
+ import { Dashboard } from "../types";
2
+ /**
3
+ * DRAFT SEED DATA -- transcribed by hand from the client's "Role & Access" PDF.
4
+ * This is the highest content-accuracy-risk piece of the whole RBAC build: a
5
+ * wrong key here silently over- or under-grants real production access.
6
+ *
7
+ * DO NOT run this against production until a human has reviewed the
8
+ * `grantedKeys` list for every role below against the original spec and
9
+ * signed off. Treat this file as a reviewable table, not settled code.
10
+ */
11
+ export interface RoleSeed {
12
+ dashboard: Dashboard;
13
+ key: string;
14
+ label: string;
15
+ isSystemRole: true;
16
+ grantedKeys: string[];
17
+ }
18
+ export declare const roleSeeds: RoleSeed[];
19
+ //# sourceMappingURL=roles.seed.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"roles.seed.d.ts","sourceRoot":"","sources":["../../../src/permissions/seeds/roles.seed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAGrC;;;;;;;;GAQG;AACH,MAAM,WAAW,QAAQ;IACvB,SAAS,EAAE,SAAS,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,IAAI,CAAC;IACnB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,eAAO,MAAM,SAAS,EAAE,QAAQ,EAuK/B,CAAC"}
@@ -0,0 +1,169 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.roleSeeds = void 0;
4
+ const resolve_1 = require("../resolve");
5
+ exports.roleSeeds = [
6
+ // ── Operations Dashboard ──────────────────────────────────────────────
7
+ {
8
+ dashboard: "ops",
9
+ key: "global-admin",
10
+ label: "Global Admin",
11
+ isSystemRole: true,
12
+ // Near-full access per spec -- modeled as literally every node in the
13
+ // Ops tree, since the spec's global-admin list covers every top-level
14
+ // section that exists.
15
+ grantedKeys: (0, resolve_1.getFullAccessKeys)("ops"),
16
+ },
17
+ {
18
+ dashboard: "ops",
19
+ key: "team-lead-chat",
20
+ label: "Team Lead (Chat)",
21
+ isSystemRole: true,
22
+ grantedKeys: [
23
+ "profile",
24
+ "profile.editPersonalInformation",
25
+ "profile.updatePassword",
26
+ "profile.twoFactorAuthentication",
27
+ "profile.viewSessions",
28
+ "status",
29
+ "dashboard",
30
+ "dashboard.liveChat",
31
+ "employees",
32
+ "logs",
33
+ "logs.detailedLogView",
34
+ "inbox",
35
+ "leads",
36
+ "leads.forward",
37
+ "leads.viewScript",
38
+ "leads.viewConversation",
39
+ "leads.company",
40
+ "leads.chatHistory",
41
+ "conversations",
42
+ "conversations.viewLead",
43
+ "chatFlux",
44
+ ],
45
+ },
46
+ {
47
+ dashboard: "ops",
48
+ key: "acc-manager-client",
49
+ label: "Account Manager (Client)",
50
+ isSystemRole: true,
51
+ grantedKeys: [
52
+ "profile",
53
+ "profile.editPersonalInformation",
54
+ "profile.updatePassword",
55
+ "profile.twoFactorAuthentication",
56
+ "profile.viewSessions",
57
+ "status",
58
+ "companies",
59
+ "companies.createCompany",
60
+ "companies.account",
61
+ "companies.account.basicInformation",
62
+ "companies.account.contactInformation",
63
+ "companies.account.hoursCallConnect",
64
+ "companies.account.leadForm",
65
+ "companies.account.users",
66
+ "companies.account.script",
67
+ "companies.account.appointmentScheduling",
68
+ "companies.account.retainerScheduling",
69
+ "companies.branding",
70
+ "companies.branding.widget",
71
+ "companies.branding.aliases",
72
+ "companies.branding.exitPopUp",
73
+ "companies.branding.appearance",
74
+ "companies.plansAddOns",
75
+ "companies.plansAddOns.chatX",
76
+ "companies.plansAddOns.addOns",
77
+ "companies.integrations",
78
+ "tickets",
79
+ "tickets.updateTicket",
80
+ "requests",
81
+ "requests.updateRequest",
82
+ "scripts",
83
+ "scripts.createVertical",
84
+ "scripts.updateVertical",
85
+ "scripts.deleteVertical",
86
+ "billing",
87
+ "billing.invoices",
88
+ "billing.paymentMethod",
89
+ "billing.adjustBillingCycle",
90
+ "invoices",
91
+ "invoices.createNewInvoice",
92
+ ],
93
+ },
94
+ {
95
+ dashboard: "ops",
96
+ key: "acc-manager-partner",
97
+ label: "Account Manager (Partner)",
98
+ isSystemRole: true,
99
+ grantedKeys: [
100
+ "profile",
101
+ "profile.editPersonalInformation",
102
+ "profile.updatePassword",
103
+ "profile.twoFactorAuthentication",
104
+ "profile.viewSessions",
105
+ "status",
106
+ "partners",
107
+ "partners.createPartner",
108
+ "partners.account",
109
+ "partners.account.basicInformation",
110
+ "partners.account.contactInformation",
111
+ "partners.account.users",
112
+ "partners.account.bankInformation",
113
+ "partners.payouts",
114
+ "partners.payouts.transfers",
115
+ "partners.payouts.withdrawals",
116
+ "partners.payouts.processPayout",
117
+ "tickets",
118
+ "tickets.updateTicket",
119
+ "requests",
120
+ "requests.updateRequest",
121
+ "reviews",
122
+ "reviews.updateReview",
123
+ ],
124
+ },
125
+ // ── Employee Dashboard (created from Ops per the spec's own note) ──────
126
+ {
127
+ dashboard: "employee",
128
+ key: "associate-agent",
129
+ label: "Associate Agent",
130
+ isSystemRole: true,
131
+ grantedKeys: [
132
+ "profile",
133
+ "dashboard",
134
+ "inbox",
135
+ "inbox.searchLiveChatsOnly",
136
+ "leads",
137
+ "leads.viewScript",
138
+ "leads.viewConversations",
139
+ "conversations",
140
+ "conversations.viewLead",
141
+ ],
142
+ },
143
+ {
144
+ dashboard: "employee",
145
+ key: "executive-agent",
146
+ label: "Executive Agent",
147
+ isSystemRole: true,
148
+ // Strict superset of associate-agent per spec -- every node checked.
149
+ grantedKeys: (0, resolve_1.getFullAccessKeys)("employee"),
150
+ },
151
+ // ── Partner Dashboard ───────────────────────────────────────────────────
152
+ {
153
+ dashboard: "partner",
154
+ key: "partner-admin",
155
+ label: "Admin",
156
+ isSystemRole: true,
157
+ // Full tree per spec. Assignable to the account owner AND, per the
158
+ // client's explicit confirmation, to additional team members later.
159
+ grantedKeys: (0, resolve_1.getFullAccessKeys)("partner"),
160
+ },
161
+ // ── Client Dashboard ────────────────────────────────────────────────────
162
+ {
163
+ dashboard: "client",
164
+ key: "client-admin",
165
+ label: "Admin",
166
+ isSystemRole: true,
167
+ grantedKeys: (0, resolve_1.getFullAccessKeys)("client"),
168
+ },
169
+ ];
@@ -0,0 +1,9 @@
1
+ import { Dashboard, PermissionNode } from "./types";
2
+ export declare function getTree(dashboard: Dashboard): PermissionNode[];
3
+ /** Every valid key in a dashboard's tree, parents and leaves alike. */
4
+ export declare function getAllKeys(dashboard: Dashboard): string[];
5
+ /** "companies.account.leadForm" -> "companies.account" (or null for a top-level key). */
6
+ export declare function getParentKey(key: string): string | null;
7
+ /** A key's full ancestor chain, nearest-parent-last excluded... actually root-first. */
8
+ export declare function getAncestorKeys(key: string): string[];
9
+ //# sourceMappingURL=treeUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"treeUtils.d.ts","sourceRoot":"","sources":["../../src/permissions/treeUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAapD,wBAAgB,OAAO,CAAC,SAAS,EAAE,SAAS,GAAG,cAAc,EAAE,CAE9D;AAED,uEAAuE;AACvE,wBAAgB,UAAU,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,EAAE,CAUzD;AAED,yFAAyF;AACzF,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGvD;AAED,wFAAwF;AACxF,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAOrD"}
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getTree = getTree;
4
+ exports.getAllKeys = getAllKeys;
5
+ exports.getParentKey = getParentKey;
6
+ exports.getAncestorKeys = getAncestorKeys;
7
+ const ops_tree_1 = require("./trees/ops.tree");
8
+ const employee_tree_1 = require("./trees/employee.tree");
9
+ const partner_tree_1 = require("./trees/partner.tree");
10
+ const client_tree_1 = require("./trees/client.tree");
11
+ const TREES = {
12
+ ops: ops_tree_1.opsTree,
13
+ employee: employee_tree_1.employeeTree,
14
+ partner: partner_tree_1.partnerTree,
15
+ client: client_tree_1.clientTree,
16
+ };
17
+ function getTree(dashboard) {
18
+ return TREES[dashboard];
19
+ }
20
+ /** Every valid key in a dashboard's tree, parents and leaves alike. */
21
+ function getAllKeys(dashboard) {
22
+ const keys = [];
23
+ const walk = (nodes) => {
24
+ for (const node of nodes) {
25
+ keys.push(node.key);
26
+ if (node.children)
27
+ walk(node.children);
28
+ }
29
+ };
30
+ walk(TREES[dashboard]);
31
+ return keys;
32
+ }
33
+ /** "companies.account.leadForm" -> "companies.account" (or null for a top-level key). */
34
+ function getParentKey(key) {
35
+ const idx = key.lastIndexOf(".");
36
+ return idx === -1 ? null : key.slice(0, idx);
37
+ }
38
+ /** A key's full ancestor chain, nearest-parent-last excluded... actually root-first. */
39
+ function getAncestorKeys(key) {
40
+ const parts = key.split(".");
41
+ const ancestors = [];
42
+ for (let i = 1; i < parts.length; i++) {
43
+ ancestors.push(parts.slice(0, i).join("."));
44
+ }
45
+ return ancestors;
46
+ }
@@ -0,0 +1,3 @@
1
+ import { PermissionNode } from "../types";
2
+ export declare const clientTree: PermissionNode[];
3
+ //# sourceMappingURL=client.tree.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.tree.d.ts","sourceRoot":"","sources":["../../../src/permissions/trees/client.tree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAM1C,eAAO,MAAM,UAAU,EAAE,cAAc,EA2FtC,CAAC"}
@@ -0,0 +1,99 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.clientTree = void 0;
4
+ // Transcribed from the client's "Role & Access" spec (Client Dashboard section).
5
+ // Only one predefined role exists here ("admin", full tree) -- same note as Partner:
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 client dashboard."
8
+ exports.clientTree = [
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.liveChat", label: "Live Chat" },
24
+ { key: "dashboard.website", label: "Website" },
25
+ ],
26
+ },
27
+ {
28
+ key: "company",
29
+ label: "Company",
30
+ children: [
31
+ {
32
+ key: "company.account",
33
+ label: "Account",
34
+ children: [
35
+ { key: "company.account.basicInformation", label: "Basic Information" },
36
+ { key: "company.account.contactInformation", label: "Contact Information" },
37
+ { key: "company.account.hoursCallConnect", label: "Hours/Call Connect" },
38
+ { key: "company.account.leadForm", label: "Lead Form" },
39
+ { key: "company.account.users", label: "Users" },
40
+ { key: "company.account.script", label: "Script" },
41
+ { key: "company.account.appointment", label: "Appointment Scheduling" },
42
+ { key: "company.account.retainerSigning", label: "Retainer Signing" },
43
+ ],
44
+ },
45
+ {
46
+ key: "company.branding",
47
+ label: "Branding",
48
+ children: [
49
+ { key: "company.branding.widget", label: "Widget" },
50
+ { key: "company.branding.aliases", label: "Aliases" },
51
+ { key: "company.branding.exitPopUp", label: "Exit Pop Up" },
52
+ { key: "company.branding.appearance", label: "Appearance" },
53
+ ],
54
+ },
55
+ {
56
+ key: "company.plansAddOns",
57
+ label: "Plans & Add Ons",
58
+ children: [
59
+ { key: "company.plansAddOns.chatX", label: "CHAT-X" },
60
+ { key: "company.plansAddOns.addOns", label: "Add Ons" },
61
+ ],
62
+ },
63
+ { key: "company.integrations", label: "Integrations" },
64
+ ],
65
+ },
66
+ {
67
+ key: "leads",
68
+ label: "Leads",
69
+ children: [
70
+ { key: "leads.viewConversations", label: "View Conversations" },
71
+ { key: "leads.forward", label: "Forward" },
72
+ { key: "leads.dispute", label: "Dispute" },
73
+ ],
74
+ },
75
+ {
76
+ key: "requests",
77
+ label: "Requests",
78
+ children: [
79
+ { key: "requests.createRequest", label: "Create Request" },
80
+ { key: "requests.viewRequest", label: "View Request" },
81
+ ],
82
+ },
83
+ {
84
+ key: "tickets",
85
+ label: "Tickets",
86
+ children: [
87
+ { key: "tickets.createTicket", label: "Create Ticket" },
88
+ { key: "tickets.viewTicket", label: "View Ticket" },
89
+ ],
90
+ },
91
+ {
92
+ key: "billing",
93
+ label: "Billing",
94
+ children: [
95
+ { key: "billing.addRemovePaymentMethod", label: "Add / Remove Payment Method" },
96
+ { key: "billing.invoices", label: "Invoices" },
97
+ ],
98
+ },
99
+ ];
@@ -0,0 +1,3 @@
1
+ import { PermissionNode } from "../types";
2
+ export declare const employeeTree: PermissionNode[];
3
+ //# sourceMappingURL=employee.tree.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"employee.tree.d.ts","sourceRoot":"","sources":["../../../src/permissions/trees/employee.tree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAM1C,eAAO,MAAM,YAAY,EAAE,cAAc,EA2BxC,CAAC"}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.employeeTree = void 0;
4
+ // Transcribed from the client's "Role & Access" spec (Employee Dashboard section).
5
+ // Note: the spec shows "Leads" nested under a "Portal" heading, but Portal has no
6
+ // checkbox of its own and no other children — modeled here as a pure nav grouping
7
+ // label, not a permission node, matching how "Leads" is a top-level node elsewhere.
8
+ exports.employeeTree = [
9
+ { key: "profile", label: "Profile" },
10
+ { key: "dashboard", label: "Dashboard" },
11
+ {
12
+ key: "inbox",
13
+ label: "Inbox",
14
+ children: [
15
+ { key: "inbox.searchLiveChatsOnly", label: "Search [Live Chats Only]" },
16
+ { key: "inbox.searchEndedShelvedChats", label: "Search [Ended / Shelved Chats]" },
17
+ ],
18
+ },
19
+ {
20
+ key: "leads",
21
+ label: "Leads",
22
+ children: [
23
+ { key: "leads.forward", label: "Forward" },
24
+ { key: "leads.viewScript", label: "View Script" },
25
+ { key: "leads.viewConversations", label: "View Conversations" },
26
+ { key: "leads.viewCompany", label: "View Company" },
27
+ { key: "leads.chatHistory", label: "Chat History" },
28
+ ],
29
+ },
30
+ {
31
+ key: "conversations",
32
+ label: "Conversations",
33
+ children: [{ key: "conversations.viewLead", label: "View Lead" }],
34
+ },
35
+ ];
@@ -0,0 +1,3 @@
1
+ import { PermissionNode } from "../types";
2
+ export declare const opsTree: PermissionNode[];
3
+ //# sourceMappingURL=ops.tree.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ops.tree.d.ts","sourceRoot":"","sources":["../../../src/permissions/trees/ops.tree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAQ1C,eAAO,MAAM,OAAO,EAAE,cAAc,EAmKnC,CAAC"}
@@ -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