@infuro/cms-core 1.0.33 → 1.0.35

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 (164) hide show
  1. package/README.md +22 -6
  2. package/dist/OrderTrackPage-W3J6WIG2.js +426 -0
  3. package/dist/OrderTrackPage-Z6FCJQYY.cjs +428 -0
  4. package/dist/admin.cjs +34072 -20487
  5. package/dist/admin.d.cts +191 -9
  6. package/dist/admin.d.ts +191 -9
  7. package/dist/admin.js +33913 -20423
  8. package/dist/api.cjs +123 -16508
  9. package/dist/api.d.cts +633 -3
  10. package/dist/api.d.ts +633 -3
  11. package/dist/api.js +14 -16519
  12. package/dist/auth.cjs +196 -955
  13. package/dist/auth.d.cts +201 -42
  14. package/dist/auth.d.ts +201 -42
  15. package/dist/auth.js +4 -888
  16. package/dist/chunk-2XE4X74C.js +29602 -0
  17. package/dist/chunk-3DZRIZOD.cjs +52 -0
  18. package/dist/chunk-3KPNTQBV.cjs +620 -0
  19. package/dist/chunk-46GKADYE.cjs +84 -0
  20. package/dist/chunk-4TRPKBKO.js +589 -0
  21. package/dist/chunk-5ELSW2UP.js +150 -0
  22. package/dist/chunk-6KPQWRFW.js +171 -0
  23. package/dist/chunk-7NMT3GBR.cjs +29 -0
  24. package/dist/chunk-7YIBMQDR.cjs +86 -0
  25. package/dist/chunk-BGJAV67S.cjs +29710 -0
  26. package/dist/chunk-CNTSLED2.cjs +559 -0
  27. package/dist/chunk-CRFV5WJK.js +16 -0
  28. package/dist/chunk-D5FBNKQM.cjs +104 -0
  29. package/dist/chunk-EF2JBPDM.js +114 -0
  30. package/dist/chunk-EQPITOP6.js +543 -0
  31. package/dist/chunk-GO7PPYNU.js +76 -0
  32. package/dist/chunk-HF3L2GIT.cjs +194 -0
  33. package/dist/chunk-J7XHLOLO.js +830 -0
  34. package/dist/chunk-JBRR5UYL.js +87 -0
  35. package/dist/chunk-JC6DLWTE.js +21 -0
  36. package/dist/chunk-JHF4YYRC.cjs +188 -0
  37. package/dist/chunk-JXF23MPG.js +25 -0
  38. package/dist/chunk-MQBT33IV.js +48 -0
  39. package/dist/chunk-N44BJZ4C.cjs +123 -0
  40. package/dist/chunk-OOTLNH63.cjs +18 -0
  41. package/dist/chunk-PAMVINEX.cjs +577 -0
  42. package/dist/chunk-PNOKNSG2.cjs +222 -0
  43. package/dist/chunk-QM733NUK.js +186 -0
  44. package/dist/chunk-R73BKDRO.cjs +90 -0
  45. package/dist/chunk-SHUYVCID.js +4 -0
  46. package/dist/chunk-SYBOCAWB.js +97 -0
  47. package/dist/chunk-TDV6EJHV.js +192 -0
  48. package/dist/chunk-TFUOHI37.cjs +839 -0
  49. package/dist/chunk-TIAEXJLI.cjs +182 -0
  50. package/dist/chunk-UPLVMVRX.cjs +23 -0
  51. package/dist/chunk-USNT2KNT.cjs +6 -0
  52. package/dist/chunk-WEMDMVHQ.js +216 -0
  53. package/dist/chunk-XDSNZUW7.js +564 -0
  54. package/dist/chunk-XQ3QUHWR.cjs +83 -0
  55. package/dist/chunk-XW5ATPRW.cjs +155 -0
  56. package/dist/chunk-ZQ4X6OAU.js +82 -0
  57. package/dist/chunk-ZSVCP6N3.js +83 -0
  58. package/dist/cli.cjs +142 -84
  59. package/dist/cli.js +101 -27
  60. package/dist/email-FKR4FXFI.js +5 -0
  61. package/dist/email-KVKVPNCL.cjs +58 -0
  62. package/dist/email-queue-CGZBVVAS.js +2 -0
  63. package/dist/email-queue-TPZWLTIV.cjs +23 -0
  64. package/dist/erp-config-enabled-CUMQ6N2V.cjs +11 -0
  65. package/dist/erp-config-enabled-T37X7T34.js +2 -0
  66. package/dist/erp-order-invoice-3YISSOWW.js +3 -0
  67. package/dist/erp-order-invoice-ZR5F2KTA.cjs +12 -0
  68. package/dist/event-order-defaults-6E543227.js +2 -0
  69. package/dist/event-order-defaults-DUGDVGJI.cjs +39 -0
  70. package/dist/event-order-notifications-5GSAOYVS.cjs +27 -0
  71. package/dist/event-order-notifications-IIIF23D5.js +10 -0
  72. package/dist/hooks.cjs +259 -132
  73. package/dist/hooks.d.cts +42 -1
  74. package/dist/hooks.d.ts +42 -1
  75. package/dist/hooks.js +234 -91
  76. package/dist/index.cjs +3884 -21070
  77. package/dist/index.d.cts +2255 -749
  78. package/dist/index.d.ts +2255 -749
  79. package/dist/index.js +1925 -19891
  80. package/dist/interpolate-WAKPN56R.cjs +11 -0
  81. package/dist/interpolate-WDUWDF3I.js +2 -0
  82. package/dist/layout-36UFTHC5.cjs +11 -0
  83. package/dist/layout-AOBN26XG.js +2 -0
  84. package/dist/migrations/1778660000004-CreateCustomerAndCustomerContacts.ts +99 -0
  85. package/dist/migrations/1778660000005-AddCustomerIdToVendorCustomers.ts +39 -0
  86. package/dist/migrations/1778660000006-UpdateVendorCustomersContactNullable.ts +36 -0
  87. package/dist/migrations/1778660000007-VendorOwnerCustomerContactsPermission.ts +39 -0
  88. package/dist/migrations/1779300000000-VendorOwnerContactsPermission.ts +39 -0
  89. package/dist/migrations/1779400000000-AddCustomerContactIdToOrders.ts +33 -0
  90. package/dist/migrations/1779400000000-ConvertStatusToEnum.ts +142 -0
  91. package/dist/migrations/1779400000000-SeedDefaultCurrencies.ts +33 -0
  92. package/dist/migrations/1779500000000-VendorRolesAndPermissions.ts +102 -0
  93. package/dist/migrations/1779600000000-VendorRegistrationProfile.ts +52 -0
  94. package/dist/migrations/1779700000000-CollectionIsCatalog.ts +22 -0
  95. package/dist/migrations/1779710000000-CollectionPlatformCatalog.ts +60 -0
  96. package/dist/migrations/1779720000000-ProductCategoryPlatformCatalog.ts +157 -0
  97. package/dist/migrations/1779800000000-EventsAndEventProducts.ts +173 -0
  98. package/dist/migrations/1779810000000-BackfillVendorRoleEventsPermissions.ts +38 -0
  99. package/dist/migrations/1779820000000-FixProductsCategoryForeignKey.ts +70 -0
  100. package/dist/migrations/1779830000000-ProductTitleColumn.ts +32 -0
  101. package/dist/migrations/1779840000000-EventAboutAndVisibilityFields.ts +34 -0
  102. package/dist/migrations/1779850000000-EventCityCountrySplit.ts +43 -0
  103. package/dist/migrations/1779860000000-CreateCombos.ts +140 -0
  104. package/dist/migrations/1780100000000-OrderAttendeesEventId.ts +55 -0
  105. package/dist/migrations/1780110000000-EventContactFormId.ts +49 -0
  106. package/dist/migrations/1780130000000-ProductVariants.ts +54 -0
  107. package/dist/migrations/1780140000000-EventManagementEnhancements.ts +44 -0
  108. package/dist/migrations/1780160000000-EventRegistrationGstProductContactForm.ts +79 -0
  109. package/dist/migrations/1780170000000-ComboCurrencyPrices.ts +20 -0
  110. package/dist/migrations/1781110000000-VendorOwnerCombosPermission.ts +38 -0
  111. package/dist/migrations/1781120000000-RefundPoliciesAndRequests.ts +225 -0
  112. package/dist/migrations/1781130000000-CreateAttendees.ts +44 -0
  113. package/dist/migrations/1781140000000-EventOrderNotifications.ts +29 -0
  114. package/dist/migrations/1781150000000-EventNamedLists.ts +28 -0
  115. package/dist/migrations/1781160000000-RefundPolicyEventTiers.ts +27 -0
  116. package/dist/migrations/1781170000000-EventRefundPolicy.ts +42 -0
  117. package/dist/migrations/1781180000000-RemoveCartItemsUniqueConstraint.ts +15 -0
  118. package/dist/migrations/1781190000000-RenameProductTaxesToProductConfig.ts +84 -0
  119. package/dist/migrations/1781200000000-VendorOwnerProductConfigPermissions.ts +51 -0
  120. package/dist/migrations/1781210000000-VendorRoleProductConfigPermissions.ts +46 -0
  121. package/dist/migrations/helpers/vendor-role-seed.ts +243 -0
  122. package/dist/paid-order-erp-3USEG6WL.js +3 -0
  123. package/dist/paid-order-erp-FSQ3GSXE.cjs +12 -0
  124. package/dist/pg-boss-service-4XF2TQ2E.js +2 -0
  125. package/dist/pg-boss-service-L6MTF4EQ.cjs +15 -0
  126. package/dist/razorpay-KLO2KNCB.js +49 -0
  127. package/dist/razorpay-U23LGY72.cjs +56 -0
  128. package/dist/rbac-debug-db-D7ME7QUY.cjs +35 -0
  129. package/dist/rbac-debug-db-MTCTVNNM.js +33 -0
  130. package/dist/sms-defaults-2NL24H57.js +2 -0
  131. package/dist/sms-defaults-KCOPKQBA.cjs +19 -0
  132. package/dist/stripe-4FD27QVJ.js +51 -0
  133. package/dist/stripe-VU6OEG2D.cjs +57 -0
  134. package/dist/theme.cjs +31 -59
  135. package/dist/theme.d.cts +78 -3
  136. package/dist/theme.d.ts +78 -3
  137. package/dist/theme.js +23 -20
  138. package/dist/vendor-invite-status-77O7ZQ3U.cjs +19 -0
  139. package/dist/vendor-invite-status-PWJ3DE76.js +2 -0
  140. package/dist/whatsapp-queue-3DXA4MXU.js +2 -0
  141. package/dist/whatsapp-queue-KG65MXD5.cjs +15 -0
  142. package/package.json +147 -141
  143. package/dist/admin.cjs.map +0 -1
  144. package/dist/admin.js.map +0 -1
  145. package/dist/api.cjs.map +0 -1
  146. package/dist/api.js.map +0 -1
  147. package/dist/auth.cjs.map +0 -1
  148. package/dist/auth.js.map +0 -1
  149. package/dist/cli.cjs.map +0 -1
  150. package/dist/cli.js.map +0 -1
  151. package/dist/config-DJ5CmQvS.d.cts +0 -8
  152. package/dist/config-DJ5CmQvS.d.ts +0 -8
  153. package/dist/hooks.cjs.map +0 -1
  154. package/dist/hooks.js.map +0 -1
  155. package/dist/index-DWd5Gjc4.d.ts +0 -582
  156. package/dist/index-rZTnpK7y.d.cts +0 -582
  157. package/dist/index.cjs.map +0 -1
  158. package/dist/index.js.map +0 -1
  159. package/dist/theme.cjs.map +0 -1
  160. package/dist/theme.js.map +0 -1
  161. package/dist/types-DCVaXlPV.d.cts +0 -78
  162. package/dist/types-DCVaXlPV.d.ts +0 -78
  163. package/dist/vendor-scope-DTYhJk_I.d.cts +0 -129
  164. package/dist/vendor-scope-DTYhJk_I.d.ts +0 -129
package/dist/auth.js CHANGED
@@ -1,888 +1,4 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropNames = Object.getOwnPropertyNames;
3
- var __esm = (fn, res) => function __init() {
4
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
5
- };
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
-
11
- // src/auth/permission-entities.ts
12
- function isSuperAdminGroupName(name) {
13
- return name === ADMIN_GROUP_NAME;
14
- }
15
- function getPermissionableEntityKeys(entityMap) {
16
- const fromMap = Object.keys(entityMap).filter((k) => !PERMISSION_ENTITY_INTERNAL_EXCLUDE.has(k));
17
- const logical = PERMISSION_LOGICAL_ENTITIES.filter((k) => !fromMap.includes(k));
18
- return [...fromMap.sort(), ...logical].filter((k, i, a) => a.indexOf(k) === i);
19
- }
20
- function permissionRowsToRecord(rows) {
21
- const out = {};
22
- if (!rows?.length) return out;
23
- for (const p of rows) {
24
- out[p.entity] = {
25
- c: !!p.canCreate,
26
- r: !!p.canRead,
27
- u: !!p.canUpdate,
28
- d: !!p.canDelete
29
- };
30
- }
31
- return out;
32
- }
33
- function hasEntityPermission(record, entity, action) {
34
- const p = record?.[entity];
35
- if (!p) return false;
36
- if (action === "create") return p.c;
37
- if (action === "read") return p.r;
38
- if (action === "update") return p.u;
39
- return p.d;
40
- }
41
- var PERMISSION_ENTITY_INTERNAL_EXCLUDE, PERMISSION_LOGICAL_ENTITIES, ADMIN_GROUP_NAME;
42
- var init_permission_entities = __esm({
43
- "src/auth/permission-entities.ts"() {
44
- "use strict";
45
- PERMISSION_ENTITY_INTERNAL_EXCLUDE = /* @__PURE__ */ new Set([
46
- "users",
47
- "password_reset_tokens",
48
- "user_groups",
49
- "permissions",
50
- "comments",
51
- "form_fields",
52
- "configs",
53
- "knowledge_base_chunks",
54
- "carts",
55
- "cart_items",
56
- "wishlists",
57
- "wishlist_items",
58
- "message_templates",
59
- "vendor_users"
60
- ]);
61
- PERMISSION_LOGICAL_ENTITIES = [
62
- "users",
63
- "forms",
64
- "form_submissions",
65
- "dashboard",
66
- "upload",
67
- "settings",
68
- "analytics",
69
- "chat"
70
- ];
71
- ADMIN_GROUP_NAME = "Administrator";
72
- }
73
- });
74
-
75
- // src/auth/vendor-scope.ts
76
- function isVendorGroupName(name) {
77
- if (!name?.trim()) return false;
78
- const n = name.trim().toLowerCase();
79
- return n === VENDOR_OWNER_GROUP_NAME.toLowerCase() || n.includes("vendor");
80
- }
81
- function isPlatformAdministrator(user) {
82
- if (!user?.email) return false;
83
- return !!(user.isRBACAdmin || isSuperAdminGroupName(user.groupName));
84
- }
85
- function isVendorPortalUser(user) {
86
- if (user?.isVendorPortal === true) return true;
87
- if (!user?.email || isPlatformAdministrator(user)) return false;
88
- if ((user.vendorIds?.length ?? 0) > 0) return true;
89
- return isVendorGroupName(user.groupName);
90
- }
91
- function isVendorStaff(user) {
92
- return isVendorPortalUser(user);
93
- }
94
- function isVendorOwner(user) {
95
- if (user?.isVendorOwner === true) return true;
96
- if (!user?.email || isPlatformAdministrator(user)) return false;
97
- if (user.vendorRole === "staff") return false;
98
- if (user.vendorRole === "owner") return true;
99
- if (!isVendorPortalUser(user)) return false;
100
- return user.groupName?.trim().toLowerCase() === VENDOR_OWNER_GROUP_NAME.toLowerCase();
101
- }
102
- function canManageVendorTeam(user) {
103
- return isPlatformAdministrator(user) || isVendorOwner(user);
104
- }
105
- function canManageVendorRoles(user) {
106
- return isPlatformAdministrator(user) || isVendorOwner(user);
107
- }
108
- function canOnboardVendors(user) {
109
- return isPlatformAdministrator(user);
110
- }
111
- function resolveVendorScopeFromSessionUser(user) {
112
- if (!user?.email) return { type: "deny" };
113
- if (isPlatformAdministrator(user)) return { type: "all" };
114
- const vendorIds = user.vendorIds ?? [];
115
- if (vendorIds.length === 0) return { type: "deny" };
116
- const preferred = user.activeVendorId ?? vendorIds[0];
117
- const vendorId = vendorIds.includes(preferred) ? preferred : vendorIds[0];
118
- return { type: "vendor", vendorId, vendorIds };
119
- }
120
- function vendorPortalFlagsFromUser(input) {
121
- const vendorIds = input.vendorIds ?? [];
122
- const isVendorPortal = !input.isRBACAdmin && (vendorIds.length > 0 || isVendorGroupName(input.groupName));
123
- const isVendorOwner2 = isVendorPortal && input.vendorRole !== "staff" && (input.vendorRole === "owner" || input.groupName?.trim().toLowerCase() === VENDOR_OWNER_GROUP_NAME.toLowerCase());
124
- return { isVendorPortal, isVendorOwner: isVendorOwner2 };
125
- }
126
- var VENDOR_SCOPED_STORE_ENTITIES, VENDOR_STORE_RBAC_ENTITIES, VENDOR_OWNER_GROUP_NAME;
127
- var init_vendor_scope = __esm({
128
- "src/auth/vendor-scope.ts"() {
129
- "use strict";
130
- init_permission_entities();
131
- VENDOR_SCOPED_STORE_ENTITIES = /* @__PURE__ */ new Set([
132
- "products",
133
- "collections",
134
- "brands",
135
- "product_categories",
136
- "orders",
137
- "payments",
138
- "taxes",
139
- "attributes",
140
- "vendor_customers",
141
- "discounts"
142
- ]);
143
- VENDOR_STORE_RBAC_ENTITIES = /* @__PURE__ */ new Set([
144
- ...VENDOR_SCOPED_STORE_ENTITIES,
145
- "order_discounts",
146
- "order_addresses"
147
- ]);
148
- VENDOR_OWNER_GROUP_NAME = "Vendor Owner";
149
- }
150
- });
151
-
152
- // src/auth/rbac-debug-db.ts
153
- var rbac_debug_db_exports = {};
154
- __export(rbac_debug_db_exports, {
155
- loadDbPermissionsForUser: () => loadDbPermissionsForUser
156
- });
157
- async function loadDbPermissionsForUser(dataSource, userId) {
158
- const rows = await dataSource.query(
159
- `
160
- SELECT u."groupId" AS "groupId", g.name AS "groupName",
161
- p.entity, p."canCreate", p."canRead", p."canUpdate", p."canDelete"
162
- FROM users u
163
- LEFT JOIN user_groups g ON g.id = u."groupId" AND g.deleted = false
164
- LEFT JOIN permissions p ON p."groupId" = g.id
165
- WHERE u.id = $1
166
- `,
167
- [userId]
168
- );
169
- const groupId = rows[0]?.groupId ?? null;
170
- const groupName = rows[0]?.groupName ?? null;
171
- const permRows = rows.filter((r) => r.entity).map((r) => ({
172
- entity: r.entity,
173
- canCreate: !!r.canCreate,
174
- canRead: !!r.canRead,
175
- canUpdate: !!r.canUpdate,
176
- canDelete: !!r.canDelete
177
- }));
178
- return {
179
- groupId,
180
- groupName,
181
- dbEntityPerms: summarizeEntityPerms(permissionRowsToRecord(permRows))
182
- };
183
- }
184
- var init_rbac_debug_db = __esm({
185
- "src/auth/rbac-debug-db.ts"() {
186
- "use strict";
187
- init_permission_entities();
188
- init_rbac_debug();
189
- }
190
- });
191
-
192
- // src/auth/rbac-debug.ts
193
- function isRbacDebugEnabled() {
194
- const v = process.env.CMS_RBAC_DEBUG?.trim().toLowerCase();
195
- if (v === "1" || v === "true" || v === "yes") return true;
196
- if (v === "0" || v === "false" || v === "no") return false;
197
- return process.env.NODE_ENV === "development";
198
- }
199
- function logRbac(message, data) {
200
- if (!isRbacDebugEnabled()) return;
201
- if (data) console.info(LOG_PREFIX, message, data);
202
- else console.info(LOG_PREFIX, message);
203
- }
204
- function summarizeEntityPerms(entityPerms) {
205
- const out = {};
206
- if (!entityPerms) return out;
207
- for (const [entity, p] of Object.entries(entityPerms)) {
208
- out[entity] = { c: p.c, r: p.r, u: p.u, d: p.d };
209
- }
210
- return out;
211
- }
212
- function vendorPortalFallbackReason(user, entity, action) {
213
- if (!isVendorPortalUser(user)) return null;
214
- if (entity === "dashboard" && action === "read") return "vendor_portal_dashboard_fallback";
215
- if (entity === "analytics" && action === "read") return "vendor_portal_analytics_fallback";
216
- if (entity === "settings" && action === "read") return "vendor_portal_settings_read_fallback";
217
- if (VENDOR_STORE_RBAC_ENTITIES.has(entity) && action === "read") return "vendor_portal_store_read_fallback";
218
- return null;
219
- }
220
- function explainSessionEntityAccess(user, entity, action) {
221
- const userSnapshot = {
222
- email: user?.email ?? null,
223
- id: user?.id ?? null,
224
- groupId: user?.groupId ?? null,
225
- groupName: user?.groupName ?? null,
226
- isRBACAdmin: user?.isRBACAdmin ?? false,
227
- adminAccess: user?.adminAccess ?? null,
228
- vendorIds: user?.vendorIds ?? [],
229
- activeVendorId: user?.activeVendorId ?? null,
230
- vendorRole: user?.vendorRole ?? null,
231
- isVendorPortal: user?.isVendorPortal ?? false,
232
- isVendorOwner: user?.isVendorOwner ?? false,
233
- isVendorPortalComputed: isVendorPortalUser(user),
234
- isVendorOwnerComputed: isVendorOwner(user),
235
- jwtEntityPerms: summarizeEntityPerms(user?.entityPerms),
236
- jwtEntityPermForTarget: user?.entityPerms?.[entity] ?? null
237
- };
238
- if (!user?.email) {
239
- return { allowed: false, reason: "no_session_email", userSnapshot };
240
- }
241
- if (user.isRBACAdmin) {
242
- return { allowed: true, reason: "platform_administrator", userSnapshot };
243
- }
244
- const vendorIds = user.vendorIds ?? [];
245
- const isStaff = user.vendorRole === "staff";
246
- if (vendorIds.length > 0) {
247
- if (entity === "dashboard" && action === "read") {
248
- return { allowed: true, reason: "vendor_link_dashboard_read", userSnapshot };
249
- }
250
- if (entity === "analytics" && action === "read") {
251
- return { allowed: true, reason: "vendor_link_analytics_read", userSnapshot };
252
- }
253
- if (entity === "settings") {
254
- if (action === "read") {
255
- return { allowed: true, reason: "vendor_link_settings_read", userSnapshot };
256
- }
257
- if (action === "update" && !isStaff) {
258
- return { allowed: true, reason: "vendor_link_settings_update", userSnapshot };
259
- }
260
- }
261
- if (VENDOR_STORE_RBAC_ENTITIES.has(entity)) {
262
- if (isStaff && action === "read") {
263
- return { allowed: true, reason: "vendor_staff_store_read", userSnapshot };
264
- }
265
- if (!isStaff) {
266
- return { allowed: true, reason: "vendor_link_store_full", userSnapshot };
267
- }
268
- return {
269
- allowed: false,
270
- reason: "vendor_staff_store_write_denied",
271
- userSnapshot
272
- };
273
- }
274
- }
275
- if (isVendorPortalUser(user) && isVendorOwner(user)) {
276
- if (entity === "dashboard" && action === "read") {
277
- return { allowed: true, reason: "vendor_owner_group_dashboard", userSnapshot };
278
- }
279
- if (entity === "analytics" && action === "read") {
280
- return { allowed: true, reason: "vendor_owner_group_analytics", userSnapshot };
281
- }
282
- if (entity === "settings" && (action === "read" || action === "update")) {
283
- return { allowed: true, reason: "vendor_owner_group_settings", userSnapshot };
284
- }
285
- if (VENDOR_STORE_RBAC_ENTITIES.has(entity)) {
286
- return { allowed: true, reason: "vendor_owner_group_store", userSnapshot };
287
- }
288
- }
289
- const vendorPortalReason = vendorPortalFallbackReason(user, entity, action);
290
- if (vendorPortalReason) {
291
- return { allowed: true, reason: vendorPortalReason, userSnapshot };
292
- }
293
- const explicit = user.entityPerms?.[entity];
294
- if (explicit !== void 0) {
295
- const allowed2 = hasEntityPermission(user.entityPerms, entity, action);
296
- return {
297
- allowed: allowed2,
298
- reason: allowed2 ? "jwt_entity_perms_allow" : "jwt_entity_perms_deny",
299
- userSnapshot
300
- };
301
- }
302
- const allowed = hasEntityPermission(user.entityPerms, entity, action);
303
- return {
304
- allowed,
305
- reason: allowed ? "entity_perms_fallback_allow" : "no_matching_rule",
306
- userSnapshot
307
- };
308
- }
309
- async function logEntityAccessDecision(dataSource, context, user, entity, action, extra) {
310
- if (!isRbacDebugEnabled()) return;
311
- const explanation = explainSessionEntityAccess(user, entity, action);
312
- let dbPermissions;
313
- if (dataSource && user?.id) {
314
- const id = Number(user.id);
315
- if (Number.isFinite(id)) {
316
- try {
317
- const { loadDbPermissionsForUser: loadDbPermissionsForUser2 } = await Promise.resolve().then(() => (init_rbac_debug_db(), rbac_debug_db_exports));
318
- dbPermissions = await loadDbPermissionsForUser2(dataSource, id);
319
- } catch (e) {
320
- dbPermissions = { error: e instanceof Error ? e.message : String(e) };
321
- }
322
- }
323
- }
324
- logRbac(context, {
325
- entity,
326
- action,
327
- allowed: explanation.allowed,
328
- reason: explanation.reason,
329
- ...explanation.userSnapshot,
330
- dbPermissions,
331
- ...extra
332
- });
333
- }
334
- var LOG_PREFIX;
335
- var init_rbac_debug = __esm({
336
- "src/auth/rbac-debug.ts"() {
337
- "use strict";
338
- init_permission_entities();
339
- init_vendor_scope();
340
- LOG_PREFIX = "[cms-rbac]";
341
- }
342
- });
343
-
344
- // src/auth/helpers.ts
345
- init_rbac_debug();
346
- init_vendor_scope();
347
- var RBAC_ADMIN_ONLY_ENTITIES = /* @__PURE__ */ new Set(["users", "user_groups", "permissions"]);
348
- function sessionHasEntityAccess(user, entity, action) {
349
- return explainSessionEntityAccess(user, entity, action).allowed;
350
- }
351
- function canManageRoles(user) {
352
- return !!(user?.email && user.isRBACAdmin);
353
- }
354
- var OPEN_ENDPOINTS = [
355
- { "/api/contacts": ["POST"] },
356
- { "/api/form-submissions": ["POST"] },
357
- { "/api/blogs": ["GET"] }
358
- ];
359
- var PERMISSION_REQUIRED_ENDPOINTS = {};
360
- function isOpenEndpoint(pathname) {
361
- return OPEN_ENDPOINTS.some((endpoint) => pathname.startsWith(Object.keys(endpoint)[0]));
362
- }
363
- function getRequiredPermission(pathname) {
364
- return null;
365
- }
366
- function isPublicMethod(pathname, method) {
367
- for (const endpoint of OPEN_ENDPOINTS) {
368
- const key = Object.keys(endpoint)[0];
369
- if (pathname.startsWith(key) && endpoint[key].includes(method)) return true;
370
- }
371
- return false;
372
- }
373
- function createAuthHelpers(getSession, NextResponse) {
374
- return createAuthHelpersFromGetSession(getSession, NextResponse);
375
- }
376
- function createCmsAuthBundle(getSession, NextResponse) {
377
- const auth = createAuthHelpers(getSession, NextResponse);
378
- return {
379
- requireAuth: auth.requireAuth,
380
- requireAdminAccess: auth.requireAdminAccess,
381
- requireEntityPermission: auth.requireEntityPermission,
382
- getSessionUser: auth.getAuthenticatedUser,
383
- getAuthenticatedUser: auth.getAuthenticatedUser
384
- };
385
- }
386
- function createAuthHelpersFromGetSession(getSession, NextResponse) {
387
- return {
388
- async requireAuth() {
389
- const session = await getSession();
390
- if (!session?.user?.email) {
391
- return NextResponse.json({ error: "Unauthorized" }, { status: 401 });
392
- }
393
- return null;
394
- },
395
- async requirePermission() {
396
- const session = await getSession();
397
- if (!session?.user?.email) {
398
- return NextResponse.json({ error: "Unauthorized" }, { status: 401 });
399
- }
400
- return null;
401
- },
402
- async requireEntityPermission(_req, entity, action) {
403
- const session = await getSession();
404
- if (!session?.user?.email) {
405
- return NextResponse.json({ error: "Unauthorized" }, { status: 401 });
406
- }
407
- const u = session.user;
408
- const allowed = sessionHasEntityAccess(u, entity, action);
409
- const { reason } = explainSessionEntityAccess(u, entity, action);
410
- logRbac("authHelpers.requireEntityPermission", {
411
- entity,
412
- action,
413
- allowed,
414
- reason,
415
- email: u.email,
416
- groupName: u.groupName,
417
- vendorIds: u.vendorIds,
418
- isVendorPortal: u.isVendorPortal,
419
- isVendorOwner: u.isVendorOwner
420
- });
421
- if (allowed) return null;
422
- return NextResponse.json({ error: "Forbidden", entity, action, reason }, { status: 403 });
423
- },
424
- async requireAdminAccess() {
425
- const session = await getSession();
426
- if (!session?.user?.email) {
427
- return NextResponse.json({ error: "Unauthorized" }, { status: 401 });
428
- }
429
- const u = session.user;
430
- if (u.isRBACAdmin) return null;
431
- if (isVendorPortalUser(u)) return null;
432
- if (u.adminAccess === true) return null;
433
- if (u.adminAccess === false) {
434
- logRbac("requireAdminAccess denied (adminAccess:false)", {
435
- email: u.email,
436
- groupName: u.groupName,
437
- isVendorPortal: u.isVendorPortal
438
- });
439
- return NextResponse.json({ error: "Forbidden", reason: "admin_access" }, { status: 403 });
440
- }
441
- logRbac("requireAdminAccess denied (no matching rule)", {
442
- email: u.email,
443
- adminAccess: u.adminAccess,
444
- groupName: u.groupName,
445
- isVendorPortal: u.isVendorPortal
446
- });
447
- return NextResponse.json({ error: "Forbidden", reason: "admin_access" }, { status: 403 });
448
- },
449
- async getAuthenticatedUser() {
450
- const session = await getSession();
451
- return session?.user ?? null;
452
- }
453
- };
454
- }
455
-
456
- // src/auth/index.ts
457
- init_rbac_debug();
458
- init_vendor_scope();
459
- init_permission_entities();
460
-
461
- // src/auth/seed-permissions.ts
462
- init_permission_entities();
463
- async function seedAdministratorPermissions(dataSource, entityMap) {
464
- const entities = getPermissionableEntityKeys(entityMap);
465
- const groupRepo = dataSource.getRepository(entityMap.user_groups);
466
- const permRepo = dataSource.getRepository(entityMap.permissions);
467
- const adminGroup = await groupRepo.findOne({ where: { name: ADMIN_GROUP_NAME, deleted: false } });
468
- console.log("ADMIN GROUP", adminGroup);
469
- if (!adminGroup) return;
470
- const fullCrud = { canCreate: true, canRead: true, canUpdate: true, canDelete: true };
471
- for (const entity of entities) {
472
- const existing = await permRepo.findOne({
473
- where: { groupId: adminGroup.id, entity }
474
- });
475
- console.log("EXISTING", existing);
476
- if (existing) {
477
- existing.canCreate = true;
478
- existing.canRead = true;
479
- existing.canUpdate = true;
480
- existing.canDelete = true;
481
- await permRepo.save(existing);
482
- } else {
483
- await permRepo.save(
484
- permRepo.create({
485
- groupId: adminGroup.id,
486
- entity,
487
- ...fullCrud
488
- })
489
- );
490
- }
491
- }
492
- }
493
-
494
- // src/auth/middleware.ts
495
- import { getToken } from "next-auth/jwt";
496
-
497
- // src/auth/auth-debug.ts
498
- var LOG_PREFIX2 = "[cms-auth]";
499
- function isAuthDebugEnabled() {
500
- const v = process.env.CMS_AUTH_DEBUG?.trim().toLowerCase();
501
- if (v === "1" || v === "true" || v === "yes") return true;
502
- if (v === "0" || v === "false" || v === "no") return false;
503
- return process.env.NODE_ENV === "development";
504
- }
505
- function isAuthDebugClientEnabled() {
506
- if (typeof window === "undefined") return false;
507
- const v = process.env.NEXT_PUBLIC_CMS_AUTH_DEBUG?.trim().toLowerCase();
508
- if (v === "1" || v === "true" || v === "yes") return true;
509
- if (v === "0" || v === "false" || v === "no") return false;
510
- return process.env.NODE_ENV === "development";
511
- }
512
- function logAuth(message, data) {
513
- if (!isAuthDebugEnabled()) return;
514
- if (data) console.info(LOG_PREFIX2, message, data);
515
- else console.info(LOG_PREFIX2, message);
516
- }
517
- function logAuthClient(message, data) {
518
- if (!isAuthDebugClientEnabled()) return;
519
- if (data) console.info(LOG_PREFIX2, message, data);
520
- else console.info(LOG_PREFIX2, message);
521
- }
522
- function summarizeSessionUserForLog(user) {
523
- if (!user || typeof user !== "object") return { present: false };
524
- const u = user;
525
- return {
526
- present: true,
527
- email: u.email ?? null,
528
- id: u.id ?? null,
529
- adminAccess: u.adminAccess ?? null,
530
- isRBACAdmin: u.isRBACAdmin ?? null,
531
- isVendorPortal: u.isVendorPortal ?? null,
532
- groupName: u.groupName ?? null
533
- };
534
- }
535
- function nextAuthCookieDebugInfo() {
536
- const nextAuthUrl = process.env.NEXTAUTH_URL ?? "(unset)";
537
- const isHttps = nextAuthUrl.startsWith("https");
538
- return {
539
- nextAuthUrl,
540
- hasSecret: Boolean(process.env.NEXTAUTH_SECRET),
541
- cookieName: isHttps ? "__Secure-next-auth.session-token" : "next-auth.session-token",
542
- cookieSecure: isHttps,
543
- nodeEnv: process.env.NODE_ENV ?? "(unset)"
544
- };
545
- }
546
-
547
- // src/auth/middleware.ts
548
- var defaultPublicApiMethods = {
549
- "/api/contacts": ["POST"],
550
- "/api/form-submissions": ["POST"],
551
- "/api/blogs": ["GET"],
552
- "/api/forms": ["GET"],
553
- "/api/auth": ["GET", "POST"],
554
- "/api/health": ["GET"],
555
- "/api/users/forgot-password": ["POST"],
556
- "/api/users/set-password": ["POST"],
557
- "/api/users/invite": ["POST"]
558
- };
559
- function legacyGetSessionToken(request) {
560
- const secure = request.cookies.get("__Secure-next-auth.session-token")?.value;
561
- const regular = request.cookies.get("next-auth.session-token")?.value;
562
- return secure ?? regular;
563
- }
564
- function sessionCookiePresence(request) {
565
- const secure = request.cookies.get("__Secure-next-auth.session-token")?.value;
566
- const regular = request.cookies.get("next-auth.session-token")?.value;
567
- const hasChunked = Boolean(request.cookies.get("next-auth.session-token.0")?.value) || Boolean(request.cookies.get("__Secure-next-auth.session-token.0")?.value);
568
- return {
569
- hasSecureToken: Boolean(secure),
570
- hasRegularToken: Boolean(regular),
571
- hasChunkedToken: hasChunked,
572
- resolved: Boolean(secure ?? regular)
573
- };
574
- }
575
- function isPublicMethod2(pathname, method, publicApiMethods) {
576
- for (const [endpoint, methods] of Object.entries(publicApiMethods)) {
577
- if (pathname.startsWith(endpoint) && methods.includes(method)) return true;
578
- }
579
- return false;
580
- }
581
- async function hasValidSession(request, secret, legacyGetToken) {
582
- if (request.req) {
583
- const token = await getToken({ req: request.req, secret });
584
- return token != null;
585
- }
586
- return Boolean(legacyGetToken(request));
587
- }
588
- function createCmsMiddleware(config = {}) {
589
- const {
590
- publicAdminPaths = ["/admin/signin", "/admin/forgot-password", "/admin/reset-password", "/admin/invite"],
591
- publicApiMethods = defaultPublicApiMethods,
592
- signInPath = "/admin/signin",
593
- getSessionToken = legacyGetSessionToken,
594
- secret = process.env.NEXTAUTH_SECRET
595
- } = config;
596
- return async function cmsMiddleware(request) {
597
- const pathname = request.nextUrl.pathname;
598
- const method = request.method;
599
- if (publicAdminPaths.some((p) => pathname === p || pathname.startsWith(p + "/"))) {
600
- return { type: "next" };
601
- }
602
- if (pathname.startsWith("/admin")) {
603
- const authenticated = await hasValidSession(request, secret, getSessionToken);
604
- const cookies = sessionCookiePresence(request);
605
- if (!authenticated) {
606
- logAuth("middleware: admin redirect to signin (no session)", {
607
- pathname,
608
- method,
609
- usesGetToken: Boolean(request.req),
610
- ...cookies,
611
- expectedCookieName: process.env.NEXTAUTH_URL?.startsWith("https") ? "__Secure-next-auth.session-token" : "next-auth.session-token"
612
- });
613
- return { type: "redirect", url: new URL(signInPath, request.url).toString() };
614
- }
615
- logAuth("middleware: admin allowed", {
616
- pathname,
617
- method,
618
- usesGetToken: Boolean(request.req),
619
- ...cookies
620
- });
621
- }
622
- if (pathname.startsWith("/api")) {
623
- if (isPublicMethod2(pathname, method, publicApiMethods)) {
624
- return { type: "next" };
625
- }
626
- const authenticated = await hasValidSession(request, secret, getSessionToken);
627
- if (!authenticated) {
628
- logAuth("middleware: api 401 (no session)", {
629
- pathname,
630
- method,
631
- usesGetToken: Boolean(request.req),
632
- ...sessionCookiePresence(request)
633
- });
634
- return { type: "json", status: 401, body: { error: "Unauthorized" } };
635
- }
636
- }
637
- return { type: "next" };
638
- };
639
- }
640
-
641
- // src/auth/nextauth-options.ts
642
- init_permission_entities();
643
- init_vendor_scope();
644
- import _CredentialsProvider from "next-auth/providers/credentials";
645
- var CredentialsProvider = _CredentialsProvider.default ?? _CredentialsProvider;
646
- function sessionUserFromNextAuthUser(user) {
647
- const g = user.group;
648
- const isRBACAdmin = isSuperAdminGroupName(g?.name);
649
- const entityPerms = permissionRowsToRecord(g?.permissions);
650
- const rawAdminAccess = user.adminAccess;
651
- const adminAccess = rawAdminAccess === true ? true : rawAdminAccess === false ? false : void 0;
652
- const vendorIds = user.vendorIds ?? [];
653
- const vendorRole = user.vendorRole ?? null;
654
- const { isVendorPortal, isVendorOwner: isVendorOwner2 } = vendorPortalFlagsFromUser({
655
- email: user.email,
656
- isRBACAdmin,
657
- groupName: g?.name,
658
- vendorIds,
659
- vendorRole
660
- });
661
- return {
662
- id: user.id.toString(),
663
- email: user.email,
664
- name: user.name,
665
- groupId: user.groupId ?? void 0,
666
- groupName: g?.name ?? void 0,
667
- isRBACAdmin,
668
- entityPerms,
669
- adminAccess,
670
- vendorIds,
671
- activeVendorId: user.activeVendorId ?? vendorIds[0] ?? null,
672
- vendorRole,
673
- isVendorPortal,
674
- isVendorOwner: isVendorOwner2
675
- };
676
- }
677
- function getNextAuthOptions(config) {
678
- const {
679
- getUserByEmail,
680
- comparePassword,
681
- signInPage = "/admin/signin",
682
- secret,
683
- extend,
684
- enablePasswordLogin = true,
685
- enableOtpLogin = false,
686
- authorizeOtp
687
- } = config;
688
- logAuth("getNextAuthOptions init", nextAuthCookieDebugInfo());
689
- const providers = [];
690
- if (enablePasswordLogin) {
691
- providers.push(
692
- CredentialsProvider({
693
- name: "credentials",
694
- credentials: {
695
- email: { label: "Email", type: "email" },
696
- password: { label: "Password", type: "password" }
697
- },
698
- async authorize(credentials) {
699
- const email = credentials?.email?.trim() ?? "";
700
- if (!email || !credentials?.password) {
701
- logAuth("authorize(credentials) rejected", { reason: "missing_email_or_password" });
702
- return null;
703
- }
704
- try {
705
- const user = await getUserByEmail(email);
706
- if (!user) {
707
- logAuth("authorize(credentials) rejected", { reason: "user_not_found", email });
708
- return null;
709
- }
710
- if (user.blocked) {
711
- logAuth("authorize(credentials) rejected", { reason: "blocked", email, userId: user.id });
712
- return null;
713
- }
714
- if (user.deleted) {
715
- logAuth("authorize(credentials) rejected", { reason: "deleted", email, userId: user.id });
716
- return null;
717
- }
718
- if (!user.password) {
719
- logAuth("authorize(credentials) rejected", { reason: "no_password", email, userId: user.id });
720
- return null;
721
- }
722
- const valid = await comparePassword(credentials.password, user.password);
723
- if (!valid) {
724
- logAuth("authorize(credentials) rejected", { reason: "invalid_password", email, userId: user.id });
725
- return null;
726
- }
727
- const sessionUser = sessionUserFromNextAuthUser(user);
728
- logAuth("authorize(credentials) ok", summarizeSessionUserForLog(sessionUser));
729
- return sessionUser;
730
- } catch (err) {
731
- console.error("[cms-auth] authorize error (credentials):", err instanceof Error ? err.message : err);
732
- logAuth("authorize(credentials) error", {
733
- email,
734
- message: err instanceof Error ? err.message : String(err)
735
- });
736
- return null;
737
- }
738
- }
739
- })
740
- );
741
- }
742
- if (enableOtpLogin && authorizeOtp) {
743
- providers.push(
744
- CredentialsProvider({
745
- id: "otp",
746
- name: "otp",
747
- credentials: {
748
- identifier: { label: "Email or phone", type: "text" },
749
- code: { label: "Code", type: "text" },
750
- channel: { label: "Channel", type: "text" }
751
- },
752
- async authorize(credentials) {
753
- const identifier = typeof credentials?.identifier === "string" ? credentials.identifier.trim() : "";
754
- const code = typeof credentials?.code === "string" ? credentials.code.trim() : "";
755
- const ch = credentials?.channel === "sms" ? "sms" : "email";
756
- if (!identifier || !code) return null;
757
- try {
758
- const user = await authorizeOtp({ identifier, channel: ch, code });
759
- if (!user || user.blocked || user.deleted) return null;
760
- return sessionUserFromNextAuthUser(user);
761
- } catch (err) {
762
- console.error("[cms-auth] authorize error (otp):", err instanceof Error ? err.message : err);
763
- return null;
764
- }
765
- }
766
- })
767
- );
768
- }
769
- const options = {
770
- secret: secret ?? process.env.NEXTAUTH_SECRET,
771
- providers,
772
- session: { strategy: "jwt" },
773
- pages: { signIn: signInPage },
774
- cookies: {
775
- sessionToken: {
776
- name: process.env.NEXTAUTH_URL?.startsWith("https") ? "__Secure-next-auth.session-token" : "next-auth.session-token",
777
- options: {
778
- httpOnly: true,
779
- sameSite: "lax",
780
- path: "/",
781
- secure: process.env.NEXTAUTH_URL?.startsWith("https") ?? false
782
- }
783
- }
784
- },
785
- callbacks: {
786
- async jwt({ token, user, trigger, session }) {
787
- if (user) {
788
- logAuth("jwt callback: new sign-in", {
789
- trigger,
790
- user: summarizeSessionUserForLog(user)
791
- });
792
- const u = user;
793
- token.id = u.id;
794
- token.groupId = u.groupId;
795
- token.groupName = u.groupName;
796
- token.isRBACAdmin = u.isRBACAdmin;
797
- token.entityPerms = u.entityPerms;
798
- token.adminAccess = u.adminAccess;
799
- token.vendorIds = u.vendorIds;
800
- token.activeVendorId = u.activeVendorId;
801
- token.vendorRole = u.vendorRole;
802
- token.isVendorPortal = u.isVendorPortal;
803
- token.isVendorOwner = u.isVendorOwner;
804
- }
805
- if (trigger === "update" && session && typeof session === "object") {
806
- logAuth("jwt callback: session update", { trigger });
807
- const s = session;
808
- const t = token;
809
- if (typeof s.name === "string") t.name = s.name;
810
- if (typeof s.email === "string") t.email = s.email;
811
- if (typeof s.activeVendorId === "number") t.activeVendorId = s.activeVendorId;
812
- }
813
- return token;
814
- },
815
- async session({ session, token }) {
816
- const t = token;
817
- logAuth("session callback", {
818
- tokenHasId: t.id != null,
819
- tokenEmail: typeof t.email === "string" ? t.email : null,
820
- sessionUser: summarizeSessionUserForLog(session.user)
821
- });
822
- if (session.user) {
823
- if (typeof t.name === "string") session.user.name = t.name;
824
- if (typeof t.email === "string") session.user.email = t.email;
825
- session.user.id = t.id;
826
- session.user.groupId = t.groupId;
827
- session.user.groupName = t.groupName;
828
- session.user.isRBACAdmin = t.isRBACAdmin;
829
- session.user.entityPerms = t.entityPerms;
830
- session.user.adminAccess = t.adminAccess;
831
- session.user.vendorIds = t.vendorIds;
832
- session.user.activeVendorId = t.activeVendorId;
833
- session.user.vendorRole = t.vendorRole;
834
- session.user.isVendorPortal = t.isVendorPortal;
835
- session.user.isVendorOwner = t.isVendorOwner;
836
- }
837
- return session;
838
- }
839
- }
840
- };
841
- return extend ? extend(options) : options;
842
- }
843
- export {
844
- ADMIN_GROUP_NAME,
845
- OPEN_ENDPOINTS,
846
- PERMISSION_REQUIRED_ENDPOINTS,
847
- RBAC_ADMIN_ONLY_ENTITIES,
848
- VENDOR_OWNER_GROUP_NAME,
849
- VENDOR_SCOPED_STORE_ENTITIES,
850
- VENDOR_STORE_RBAC_ENTITIES,
851
- canManageRoles,
852
- canManageVendorRoles,
853
- canManageVendorTeam,
854
- canOnboardVendors,
855
- createAuthHelpers,
856
- createCmsAuthBundle,
857
- createCmsMiddleware,
858
- defaultPublicApiMethods,
859
- explainSessionEntityAccess,
860
- getNextAuthOptions,
861
- getPermissionableEntityKeys,
862
- getRequiredPermission,
863
- hasEntityPermission,
864
- isAuthDebugClientEnabled,
865
- isAuthDebugEnabled,
866
- isOpenEndpoint,
867
- isPlatformAdministrator,
868
- isPublicMethod,
869
- isRbacDebugEnabled,
870
- isSuperAdminGroupName,
871
- isVendorGroupName,
872
- isVendorOwner,
873
- isVendorPortalUser,
874
- isVendorStaff,
875
- logAuth,
876
- logAuthClient,
877
- logEntityAccessDecision,
878
- logRbac,
879
- nextAuthCookieDebugInfo,
880
- permissionRowsToRecord,
881
- resolveVendorScopeFromSessionUser,
882
- seedAdministratorPermissions,
883
- sessionHasEntityAccess,
884
- summarizeEntityPerms,
885
- summarizeSessionUserForLog,
886
- vendorPortalFlagsFromUser
887
- };
888
- //# sourceMappingURL=auth.js.map
1
+ export { createCmsMiddleware, defaultPublicApiMethods, getNextAuthOptions, getStorefrontNextAuthOptions, isAuthDebugClientEnabled, isAuthDebugEnabled, logAuth, logAuthClient, nextAuthCookieDebugInfo, seedAdministratorPermissions, summarizeSessionUserForLog } from './chunk-EQPITOP6.js';
2
+ export { OPEN_ENDPOINTS, PERMISSION_REQUIRED_ENDPOINTS, RBAC_ADMIN_ONLY_ENTITIES, canManageRoles, createAuthHelpers, createCmsAuthBundle, getRequiredPermission, isOpenEndpoint, isPublicMethod, sessionHasEntityAccess } from './chunk-6KPQWRFW.js';
3
+ export { ADMIN_GROUP_NAME, SUPER_ADMIN_GROUP_ID, VENDOR_ADMIN_GROUP_ID, VENDOR_OWNER_GROUP_NAME, VENDOR_SCOPED_STORE_ENTITIES, VENDOR_STORE_RBAC_ENTITIES, canManageVendorRoles, canManageVendorTeam, canOnboardVendors, explainSessionEntityAccess, getPermissionableEntityKeys, hasEntityPermission, isPlatformAdministrator, isRbacDebugEnabled, isSuperAdmin, isSuperAdminGroupName, isVendorAdmin, isVendorGroupName, isVendorOwner, isVendorPortalUser, isVendorStaff, logEntityAccessDecision, logRbac, permissionRowsToRecord, resolveVendorScopeFromSessionUser, summarizeEntityPerms, vendorPortalFlagsFromUser } from './chunk-4TRPKBKO.js';
4
+ import './chunk-SHUYVCID.js';