@infuro/cms-core 1.0.72 → 1.0.74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin.cjs +543 -120
- package/dist/admin.js +545 -122
- package/dist/api.cjs +37 -37
- package/dist/api.d.cts +13 -6
- package/dist/api.d.ts +13 -6
- package/dist/api.js +5 -5
- package/dist/auth.cjs +11 -11
- package/dist/auth.d.cts +15 -0
- package/dist/auth.d.ts +15 -0
- package/dist/auth.js +1 -1
- package/dist/{chunk-BQQMTQ4C.cjs → chunk-25T6HP5T.cjs} +2 -2
- package/dist/{chunk-TTOEY7AH.cjs → chunk-2JV4EDY3.cjs} +3 -3
- package/dist/{chunk-LJ5C4RBF.js → chunk-6TRH3VY7.js} +1 -1
- package/dist/{chunk-4MNVIGVJ.cjs → chunk-D3SR6CYU.cjs} +3 -3
- package/dist/{chunk-PQJIJ4ZX.js → chunk-DAUBLBTP.js} +1 -1
- package/dist/{chunk-SCE2GIKH.js → chunk-DEGN4BTH.js} +9 -0
- package/dist/{chunk-CKTRA3Q2.cjs → chunk-F3FKBNMQ.cjs} +9 -0
- package/dist/{chunk-SRGDHASW.cjs → chunk-H4UIIBFD.cjs} +2571 -2096
- package/dist/{chunk-YHVA5NHI.js → chunk-LUSJITTI.js} +43 -6
- package/dist/{chunk-43UVXBEH.js → chunk-OQOO2JMB.js} +2529 -2054
- package/dist/{chunk-HZZTDM5J.js → chunk-R5HLPH6P.js} +1 -1
- package/dist/{chunk-3LF4RYAJ.js → chunk-X3IJG25M.js} +1 -1
- package/dist/{chunk-2JHGIWH7.cjs → chunk-X5ILLSTD.cjs} +43 -6
- package/dist/{chunk-NIBEGDD4.cjs → chunk-ZBSH4GWB.cjs} +1 -1
- package/dist/{email-queue-MWP4R67H.js → email-queue-5TOJJT3P.js} +3 -3
- package/dist/{email-queue-BJDH2ID7.cjs → email-queue-X2A46VD3.cjs} +7 -7
- package/dist/{emit-order-notification-trigger-TBXAZAPS.js → emit-order-notification-trigger-3RAVWKLG.js} +1 -1
- package/dist/{emit-order-notification-trigger-I4HQSTEN.cjs → emit-order-notification-trigger-MY3KP7CD.cjs} +3 -3
- package/dist/{erp-order-invoice-5O42ZKC5.cjs → erp-order-invoice-23BDWC2H.cjs} +6 -6
- package/dist/{erp-order-invoice-JEQKFXG4.js → erp-order-invoice-SEZZUDMW.js} +2 -2
- package/dist/generate-local-invoice-pdf-V5FHS23Z.js +3 -0
- package/dist/{generate-local-invoice-pdf-2NCA2WBL.cjs → generate-local-invoice-pdf-XYBVKHNP.cjs} +2 -2
- package/dist/index.cjs +243 -243
- package/dist/index.d.cts +31 -9
- package/dist/index.d.ts +31 -9
- package/dist/index.js +10 -10
- package/dist/migrations/1783400000000-MakeProductConfigTaxIdNullable.ts +40 -0
- package/dist/{order-completion-otp-handlers-KHLZQQJX.js → order-completion-otp-handlers-2WOFSORP.js} +4 -4
- package/dist/{order-completion-otp-handlers-2ZKRK5SN.cjs → order-completion-otp-handlers-EWY47XUA.cjs} +6 -6
- package/dist/{order-notification-dispatcher-Z3MXNF4U.js → order-notification-dispatcher-COR2ZHM3.js} +4 -4
- package/dist/{order-notification-dispatcher-37KDVHBM.cjs → order-notification-dispatcher-KTOAMMSD.cjs} +9 -9
- package/package.json +1 -1
- package/dist/generate-local-invoice-pdf-XUH6GYEJ.js +0 -3
package/dist/api.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var chunkH4UIIBFD_cjs = require('./chunk-H4UIIBFD.cjs');
|
|
4
|
+
require('./chunk-2JV4EDY3.cjs');
|
|
5
5
|
require('./chunk-KB7EBYPR.cjs');
|
|
6
6
|
require('./chunk-KJB5LBFQ.cjs');
|
|
7
7
|
require('./chunk-K742UE6S.cjs');
|
|
@@ -11,10 +11,10 @@ require('./chunk-JRW3GQD4.cjs');
|
|
|
11
11
|
require('./chunk-Y54WDY2O.cjs');
|
|
12
12
|
require('./chunk-PRXVSSIF.cjs');
|
|
13
13
|
require('./chunk-QN6PZLAP.cjs');
|
|
14
|
-
require('./chunk-
|
|
15
|
-
require('./chunk-
|
|
14
|
+
require('./chunk-D3SR6CYU.cjs');
|
|
15
|
+
require('./chunk-25T6HP5T.cjs');
|
|
16
16
|
require('./chunk-RQCXRCYM.cjs');
|
|
17
|
-
require('./chunk-
|
|
17
|
+
require('./chunk-X5ILLSTD.cjs');
|
|
18
18
|
require('./chunk-E62LKM6Z.cjs');
|
|
19
19
|
require('./chunk-47G65M5Q.cjs');
|
|
20
20
|
require('./chunk-EYUBL7YH.cjs');
|
|
@@ -29,131 +29,131 @@ require('./chunk-XHPRD45G.cjs');
|
|
|
29
29
|
|
|
30
30
|
Object.defineProperty(exports, "autoExpireOrderIfPaymentTimeExceeded", {
|
|
31
31
|
enumerable: true,
|
|
32
|
-
get: function () { return
|
|
32
|
+
get: function () { return chunkH4UIIBFD_cjs.autoExpireOrderIfPaymentTimeExceeded; }
|
|
33
33
|
});
|
|
34
34
|
Object.defineProperty(exports, "createAnalyticsHandlers", {
|
|
35
35
|
enumerable: true,
|
|
36
|
-
get: function () { return
|
|
36
|
+
get: function () { return chunkH4UIIBFD_cjs.createAnalyticsHandlers; }
|
|
37
37
|
});
|
|
38
38
|
Object.defineProperty(exports, "createBlogBySlugHandler", {
|
|
39
39
|
enumerable: true,
|
|
40
|
-
get: function () { return
|
|
40
|
+
get: function () { return chunkH4UIIBFD_cjs.createBlogBySlugHandler; }
|
|
41
41
|
});
|
|
42
42
|
Object.defineProperty(exports, "createChangePasswordHandler", {
|
|
43
43
|
enumerable: true,
|
|
44
|
-
get: function () { return
|
|
44
|
+
get: function () { return chunkH4UIIBFD_cjs.createChangePasswordHandler; }
|
|
45
45
|
});
|
|
46
46
|
Object.defineProperty(exports, "createCmsApiHandler", {
|
|
47
47
|
enumerable: true,
|
|
48
|
-
get: function () { return
|
|
48
|
+
get: function () { return chunkH4UIIBFD_cjs.createCmsApiHandler; }
|
|
49
49
|
});
|
|
50
50
|
Object.defineProperty(exports, "createCrudByIdHandler", {
|
|
51
51
|
enumerable: true,
|
|
52
|
-
get: function () { return
|
|
52
|
+
get: function () { return chunkH4UIIBFD_cjs.createCrudByIdHandler; }
|
|
53
53
|
});
|
|
54
54
|
Object.defineProperty(exports, "createCrudHandler", {
|
|
55
55
|
enumerable: true,
|
|
56
|
-
get: function () { return
|
|
56
|
+
get: function () { return chunkH4UIIBFD_cjs.createCrudHandler; }
|
|
57
57
|
});
|
|
58
58
|
Object.defineProperty(exports, "createDashboardStatsHandler", {
|
|
59
59
|
enumerable: true,
|
|
60
|
-
get: function () { return
|
|
60
|
+
get: function () { return chunkH4UIIBFD_cjs.createDashboardStatsHandler; }
|
|
61
61
|
});
|
|
62
62
|
Object.defineProperty(exports, "createEcommerceAnalyticsHandler", {
|
|
63
63
|
enumerable: true,
|
|
64
|
-
get: function () { return
|
|
64
|
+
get: function () { return chunkH4UIIBFD_cjs.createEcommerceAnalyticsHandler; }
|
|
65
65
|
});
|
|
66
66
|
Object.defineProperty(exports, "createForgotPasswordHandler", {
|
|
67
67
|
enumerable: true,
|
|
68
|
-
get: function () { return
|
|
68
|
+
get: function () { return chunkH4UIIBFD_cjs.createForgotPasswordHandler; }
|
|
69
69
|
});
|
|
70
70
|
Object.defineProperty(exports, "createFormBySlugHandler", {
|
|
71
71
|
enumerable: true,
|
|
72
|
-
get: function () { return
|
|
72
|
+
get: function () { return chunkH4UIIBFD_cjs.createFormBySlugHandler; }
|
|
73
73
|
});
|
|
74
74
|
Object.defineProperty(exports, "createInviteAcceptHandler", {
|
|
75
75
|
enumerable: true,
|
|
76
|
-
get: function () { return
|
|
76
|
+
get: function () { return chunkH4UIIBFD_cjs.createInviteAcceptHandler; }
|
|
77
77
|
});
|
|
78
78
|
Object.defineProperty(exports, "createJobScheduleHandlers", {
|
|
79
79
|
enumerable: true,
|
|
80
|
-
get: function () { return
|
|
80
|
+
get: function () { return chunkH4UIIBFD_cjs.createJobScheduleHandlers; }
|
|
81
81
|
});
|
|
82
82
|
Object.defineProperty(exports, "createLlmAgentKnowledgeHandlers", {
|
|
83
83
|
enumerable: true,
|
|
84
|
-
get: function () { return
|
|
84
|
+
get: function () { return chunkH4UIIBFD_cjs.createLlmAgentKnowledgeHandlers; }
|
|
85
85
|
});
|
|
86
86
|
Object.defineProperty(exports, "createMediaZipExtractHandler", {
|
|
87
87
|
enumerable: true,
|
|
88
|
-
get: function () { return
|
|
88
|
+
get: function () { return chunkH4UIIBFD_cjs.createMediaZipExtractHandler; }
|
|
89
89
|
});
|
|
90
90
|
Object.defineProperty(exports, "createSetPasswordHandler", {
|
|
91
91
|
enumerable: true,
|
|
92
|
-
get: function () { return
|
|
92
|
+
get: function () { return chunkH4UIIBFD_cjs.createSetPasswordHandler; }
|
|
93
93
|
});
|
|
94
94
|
Object.defineProperty(exports, "createSettingsApiHandlers", {
|
|
95
95
|
enumerable: true,
|
|
96
|
-
get: function () { return
|
|
96
|
+
get: function () { return chunkH4UIIBFD_cjs.createSettingsApiHandlers; }
|
|
97
97
|
});
|
|
98
98
|
Object.defineProperty(exports, "createStorefrontApiHandler", {
|
|
99
99
|
enumerable: true,
|
|
100
|
-
get: function () { return
|
|
100
|
+
get: function () { return chunkH4UIIBFD_cjs.createStorefrontApiHandler; }
|
|
101
101
|
});
|
|
102
102
|
Object.defineProperty(exports, "createUploadHandler", {
|
|
103
103
|
enumerable: true,
|
|
104
|
-
get: function () { return
|
|
104
|
+
get: function () { return chunkH4UIIBFD_cjs.createUploadHandler; }
|
|
105
105
|
});
|
|
106
106
|
Object.defineProperty(exports, "createUserAuthApiRouter", {
|
|
107
107
|
enumerable: true,
|
|
108
|
-
get: function () { return
|
|
108
|
+
get: function () { return chunkH4UIIBFD_cjs.createUserAuthApiRouter; }
|
|
109
109
|
});
|
|
110
110
|
Object.defineProperty(exports, "createUserAvatarHandler", {
|
|
111
111
|
enumerable: true,
|
|
112
|
-
get: function () { return
|
|
112
|
+
get: function () { return chunkH4UIIBFD_cjs.createUserAvatarHandler; }
|
|
113
113
|
});
|
|
114
114
|
Object.defineProperty(exports, "createUserProfileHandler", {
|
|
115
115
|
enumerable: true,
|
|
116
|
-
get: function () { return
|
|
116
|
+
get: function () { return chunkH4UIIBFD_cjs.createUserProfileHandler; }
|
|
117
117
|
});
|
|
118
118
|
Object.defineProperty(exports, "createUsersApiHandlers", {
|
|
119
119
|
enumerable: true,
|
|
120
|
-
get: function () { return
|
|
120
|
+
get: function () { return chunkH4UIIBFD_cjs.createUsersApiHandlers; }
|
|
121
121
|
});
|
|
122
122
|
Object.defineProperty(exports, "createVendorDashboardHandler", {
|
|
123
123
|
enumerable: true,
|
|
124
|
-
get: function () { return
|
|
124
|
+
get: function () { return chunkH4UIIBFD_cjs.createVendorDashboardHandler; }
|
|
125
125
|
});
|
|
126
126
|
Object.defineProperty(exports, "createVendorOnboardHandlers", {
|
|
127
127
|
enumerable: true,
|
|
128
|
-
get: function () { return
|
|
128
|
+
get: function () { return chunkH4UIIBFD_cjs.createVendorOnboardHandlers; }
|
|
129
129
|
});
|
|
130
130
|
Object.defineProperty(exports, "getPublicSettingsGroup", {
|
|
131
131
|
enumerable: true,
|
|
132
|
-
get: function () { return
|
|
132
|
+
get: function () { return chunkH4UIIBFD_cjs.getPublicSettingsGroup; }
|
|
133
133
|
});
|
|
134
134
|
Object.defineProperty(exports, "mergeGuardrailsIntoSystemPrompt", {
|
|
135
135
|
enumerable: true,
|
|
136
|
-
get: function () { return
|
|
136
|
+
get: function () { return chunkH4UIIBFD_cjs.mergeGuardrailsIntoSystemPrompt; }
|
|
137
137
|
});
|
|
138
138
|
Object.defineProperty(exports, "parseLlmAgentValidationRules", {
|
|
139
139
|
enumerable: true,
|
|
140
|
-
get: function () { return
|
|
140
|
+
get: function () { return chunkH4UIIBFD_cjs.parseLlmAgentValidationRules; }
|
|
141
141
|
});
|
|
142
142
|
Object.defineProperty(exports, "simpleDecrypt", {
|
|
143
143
|
enumerable: true,
|
|
144
|
-
get: function () { return
|
|
144
|
+
get: function () { return chunkH4UIIBFD_cjs.simpleDecrypt; }
|
|
145
145
|
});
|
|
146
146
|
Object.defineProperty(exports, "simpleEncrypt", {
|
|
147
147
|
enumerable: true,
|
|
148
|
-
get: function () { return
|
|
148
|
+
get: function () { return chunkH4UIIBFD_cjs.simpleEncrypt; }
|
|
149
149
|
});
|
|
150
150
|
Object.defineProperty(exports, "validateUserMessageAgainstAgentRules", {
|
|
151
151
|
enumerable: true,
|
|
152
|
-
get: function () { return
|
|
152
|
+
get: function () { return chunkH4UIIBFD_cjs.validateUserMessageAgainstAgentRules; }
|
|
153
153
|
});
|
|
154
154
|
Object.defineProperty(exports, "validateUserMessageAgainstStructuredRules", {
|
|
155
155
|
enumerable: true,
|
|
156
|
-
get: function () { return
|
|
156
|
+
get: function () { return chunkH4UIIBFD_cjs.validateUserMessageAgainstStructuredRules; }
|
|
157
157
|
});
|
|
158
158
|
Object.defineProperty(exports, "createCmsAuthBundle", {
|
|
159
159
|
enumerable: true,
|
package/dist/api.d.cts
CHANGED
|
@@ -25,6 +25,14 @@ interface SessionUser {
|
|
|
25
25
|
adminAccess?: boolean;
|
|
26
26
|
/** Vendor stores this user can access (from vendor_users). */
|
|
27
27
|
vendorIds?: number[];
|
|
28
|
+
/** Full list of accessible vendor stores with names & roles */
|
|
29
|
+
vendorStores?: Array<{
|
|
30
|
+
id: number;
|
|
31
|
+
name: string;
|
|
32
|
+
slug?: string;
|
|
33
|
+
roleName?: string;
|
|
34
|
+
isOwner?: boolean;
|
|
35
|
+
}>;
|
|
28
36
|
/** Active vendor for scoped CRUD (vendor staff). */
|
|
29
37
|
activeVendorId?: number | null;
|
|
30
38
|
/** @deprecated Prefer isVendorRoleOwner / vendorRoleId. Legacy owner|staff hint. */
|
|
@@ -479,10 +487,6 @@ declare function createLlmAgentKnowledgeHandlers(config: LlmAgentKnowledgeApiCon
|
|
|
479
487
|
unlink(req: Request, slug: string, documentIdStr: string): Promise<Response>;
|
|
480
488
|
} | null;
|
|
481
489
|
|
|
482
|
-
/**
|
|
483
|
-
* Single CMS API handler: dashboard, analytics, upload, media zip extract, blog/form by slug, users API, user auth, CRUD. Mount once (e.g. app/api/[[...path]]/route.ts).
|
|
484
|
-
*/
|
|
485
|
-
|
|
486
490
|
/** CMS instance with getPlugin; when provided, analytics and userAuth.sendEmail can be resolved from plugins when not passed. */
|
|
487
491
|
type CmsGetter = () => Promise<{
|
|
488
492
|
getPlugin: (name: string) => unknown;
|
|
@@ -546,9 +550,10 @@ interface CmsApiHandlerConfig {
|
|
|
546
550
|
/** Same as `getSessionUser` (from `createAuthHelpers().getAuthenticatedUser`). */
|
|
547
551
|
getAuthenticatedUser?: () => Promise<SessionUser | null>;
|
|
548
552
|
}
|
|
549
|
-
|
|
550
|
-
handle(method: string, pathInput: string[], req: Request)
|
|
553
|
+
type CmsApiHandler = {
|
|
554
|
+
handle: (method: string, pathInput: string[], req: Request) => Promise<Response>;
|
|
551
555
|
};
|
|
556
|
+
declare function createCmsApiHandler(config: CmsApiHandlerConfig): CmsApiHandler;
|
|
552
557
|
|
|
553
558
|
type VendorOwnerActivation = 'invite' | 'password' | 'membership';
|
|
554
559
|
interface VendorOnboardHandlersConfig {
|
|
@@ -574,6 +579,8 @@ declare function createVendorOnboardHandlers(config: VendorOnboardHandlersConfig
|
|
|
574
579
|
resendInvite(req: Request, vendorIdStr: string): Promise<Response>;
|
|
575
580
|
/** POST /api/admin/vendor/switch — set active vendor in session (JWT update via client) */
|
|
576
581
|
switchVendor(req: Request): Promise<Response>;
|
|
582
|
+
/** GET /api/admin/vendor/context — get user's vendor stores, roles and active vendor */
|
|
583
|
+
getVendorContext(req?: Request): Promise<Response>;
|
|
577
584
|
/** GET /api/admin/vendor/team */
|
|
578
585
|
listTeam(): Promise<Response>;
|
|
579
586
|
/** POST /api/admin/vendor/team — invite staff (set-password for new; accept-only for existing vendor people) */
|
package/dist/api.d.ts
CHANGED
|
@@ -25,6 +25,14 @@ interface SessionUser {
|
|
|
25
25
|
adminAccess?: boolean;
|
|
26
26
|
/** Vendor stores this user can access (from vendor_users). */
|
|
27
27
|
vendorIds?: number[];
|
|
28
|
+
/** Full list of accessible vendor stores with names & roles */
|
|
29
|
+
vendorStores?: Array<{
|
|
30
|
+
id: number;
|
|
31
|
+
name: string;
|
|
32
|
+
slug?: string;
|
|
33
|
+
roleName?: string;
|
|
34
|
+
isOwner?: boolean;
|
|
35
|
+
}>;
|
|
28
36
|
/** Active vendor for scoped CRUD (vendor staff). */
|
|
29
37
|
activeVendorId?: number | null;
|
|
30
38
|
/** @deprecated Prefer isVendorRoleOwner / vendorRoleId. Legacy owner|staff hint. */
|
|
@@ -479,10 +487,6 @@ declare function createLlmAgentKnowledgeHandlers(config: LlmAgentKnowledgeApiCon
|
|
|
479
487
|
unlink(req: Request, slug: string, documentIdStr: string): Promise<Response>;
|
|
480
488
|
} | null;
|
|
481
489
|
|
|
482
|
-
/**
|
|
483
|
-
* Single CMS API handler: dashboard, analytics, upload, media zip extract, blog/form by slug, users API, user auth, CRUD. Mount once (e.g. app/api/[[...path]]/route.ts).
|
|
484
|
-
*/
|
|
485
|
-
|
|
486
490
|
/** CMS instance with getPlugin; when provided, analytics and userAuth.sendEmail can be resolved from plugins when not passed. */
|
|
487
491
|
type CmsGetter = () => Promise<{
|
|
488
492
|
getPlugin: (name: string) => unknown;
|
|
@@ -546,9 +550,10 @@ interface CmsApiHandlerConfig {
|
|
|
546
550
|
/** Same as `getSessionUser` (from `createAuthHelpers().getAuthenticatedUser`). */
|
|
547
551
|
getAuthenticatedUser?: () => Promise<SessionUser | null>;
|
|
548
552
|
}
|
|
549
|
-
|
|
550
|
-
handle(method: string, pathInput: string[], req: Request)
|
|
553
|
+
type CmsApiHandler = {
|
|
554
|
+
handle: (method: string, pathInput: string[], req: Request) => Promise<Response>;
|
|
551
555
|
};
|
|
556
|
+
declare function createCmsApiHandler(config: CmsApiHandlerConfig): CmsApiHandler;
|
|
552
557
|
|
|
553
558
|
type VendorOwnerActivation = 'invite' | 'password' | 'membership';
|
|
554
559
|
interface VendorOnboardHandlersConfig {
|
|
@@ -574,6 +579,8 @@ declare function createVendorOnboardHandlers(config: VendorOnboardHandlersConfig
|
|
|
574
579
|
resendInvite(req: Request, vendorIdStr: string): Promise<Response>;
|
|
575
580
|
/** POST /api/admin/vendor/switch — set active vendor in session (JWT update via client) */
|
|
576
581
|
switchVendor(req: Request): Promise<Response>;
|
|
582
|
+
/** GET /api/admin/vendor/context — get user's vendor stores, roles and active vendor */
|
|
583
|
+
getVendorContext(req?: Request): Promise<Response>;
|
|
577
584
|
/** GET /api/admin/vendor/team */
|
|
578
585
|
listTeam(): Promise<Response>;
|
|
579
586
|
/** POST /api/admin/vendor/team — invite staff (set-password for new; accept-only for existing vendor people) */
|
package/dist/api.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { autoExpireOrderIfPaymentTimeExceeded, createAnalyticsHandlers, createBlogBySlugHandler, createChangePasswordHandler, createCmsApiHandler, createCrudByIdHandler, createCrudHandler, createDashboardStatsHandler, createEcommerceAnalyticsHandler, createForgotPasswordHandler, createFormBySlugHandler, createInviteAcceptHandler, createJobScheduleHandlers, createLlmAgentKnowledgeHandlers, createMediaZipExtractHandler, createSetPasswordHandler, createSettingsApiHandlers, createStorefrontApiHandler, createUploadHandler, createUserAuthApiRouter, createUserAvatarHandler, createUserProfileHandler, createUsersApiHandlers, createVendorDashboardHandler, createVendorOnboardHandlers, getPublicSettingsGroup, mergeGuardrailsIntoSystemPrompt, parseLlmAgentValidationRules, simpleDecrypt, simpleEncrypt, validateUserMessageAgainstAgentRules, validateUserMessageAgainstStructuredRules } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { autoExpireOrderIfPaymentTimeExceeded, createAnalyticsHandlers, createBlogBySlugHandler, createChangePasswordHandler, createCmsApiHandler, createCrudByIdHandler, createCrudHandler, createDashboardStatsHandler, createEcommerceAnalyticsHandler, createForgotPasswordHandler, createFormBySlugHandler, createInviteAcceptHandler, createJobScheduleHandlers, createLlmAgentKnowledgeHandlers, createMediaZipExtractHandler, createSetPasswordHandler, createSettingsApiHandlers, createStorefrontApiHandler, createUploadHandler, createUserAuthApiRouter, createUserAvatarHandler, createUserProfileHandler, createUsersApiHandlers, createVendorDashboardHandler, createVendorOnboardHandlers, getPublicSettingsGroup, mergeGuardrailsIntoSystemPrompt, parseLlmAgentValidationRules, simpleDecrypt, simpleEncrypt, validateUserMessageAgainstAgentRules, validateUserMessageAgainstStructuredRules } from './chunk-OQOO2JMB.js';
|
|
2
|
+
import './chunk-X3IJG25M.js';
|
|
3
3
|
import './chunk-ECUGNV2I.js';
|
|
4
4
|
import './chunk-K6JT7BKY.js';
|
|
5
5
|
import './chunk-W2ZTGLUH.js';
|
|
@@ -9,10 +9,10 @@ import './chunk-5NVGWJSY.js';
|
|
|
9
9
|
import './chunk-2BNVRFUQ.js';
|
|
10
10
|
import './chunk-JYRFSFXH.js';
|
|
11
11
|
import './chunk-CFUSYGSA.js';
|
|
12
|
-
import './chunk-
|
|
13
|
-
import './chunk-
|
|
12
|
+
import './chunk-6TRH3VY7.js';
|
|
13
|
+
import './chunk-DAUBLBTP.js';
|
|
14
14
|
import './chunk-WQZ4AH2P.js';
|
|
15
|
-
import './chunk-
|
|
15
|
+
import './chunk-LUSJITTI.js';
|
|
16
16
|
import './chunk-K6RXCLD5.js';
|
|
17
17
|
import './chunk-5DSY3GQI.js';
|
|
18
18
|
import './chunk-YDMHG6BA.js';
|
package/dist/auth.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkF3FKBNMQ_cjs = require('./chunk-F3FKBNMQ.cjs');
|
|
4
4
|
var chunkFNLF6G2N_cjs = require('./chunk-FNLF6G2N.cjs');
|
|
5
5
|
var chunkLCZZ3S4I_cjs = require('./chunk-LCZZ3S4I.cjs');
|
|
6
6
|
require('./chunk-4WZNRVEZ.cjs');
|
|
@@ -11,43 +11,43 @@ require('./chunk-XHPRD45G.cjs');
|
|
|
11
11
|
|
|
12
12
|
Object.defineProperty(exports, "AUTH_PROVIDERS_SETTINGS_GROUP", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
14
|
+
get: function () { return chunkF3FKBNMQ_cjs.AUTH_PROVIDERS_SETTINGS_GROUP; }
|
|
15
15
|
});
|
|
16
16
|
Object.defineProperty(exports, "buildNextAuthOptions", {
|
|
17
17
|
enumerable: true,
|
|
18
|
-
get: function () { return
|
|
18
|
+
get: function () { return chunkF3FKBNMQ_cjs.buildNextAuthOptions; }
|
|
19
19
|
});
|
|
20
20
|
Object.defineProperty(exports, "buildStorefrontNextAuthOptions", {
|
|
21
21
|
enumerable: true,
|
|
22
|
-
get: function () { return
|
|
22
|
+
get: function () { return chunkF3FKBNMQ_cjs.buildStorefrontNextAuthOptions; }
|
|
23
23
|
});
|
|
24
24
|
Object.defineProperty(exports, "createCustomerUserFromGoogleOAuth", {
|
|
25
25
|
enumerable: true,
|
|
26
|
-
get: function () { return
|
|
26
|
+
get: function () { return chunkF3FKBNMQ_cjs.createCustomerUserFromGoogleOAuth; }
|
|
27
27
|
});
|
|
28
28
|
Object.defineProperty(exports, "getNextAuthOptions", {
|
|
29
29
|
enumerable: true,
|
|
30
|
-
get: function () { return
|
|
30
|
+
get: function () { return chunkF3FKBNMQ_cjs.getNextAuthOptions; }
|
|
31
31
|
});
|
|
32
32
|
Object.defineProperty(exports, "getStorefrontNextAuthOptions", {
|
|
33
33
|
enumerable: true,
|
|
34
|
-
get: function () { return
|
|
34
|
+
get: function () { return chunkF3FKBNMQ_cjs.getStorefrontNextAuthOptions; }
|
|
35
35
|
});
|
|
36
36
|
Object.defineProperty(exports, "googleOAuthRedirectUri", {
|
|
37
37
|
enumerable: true,
|
|
38
|
-
get: function () { return
|
|
38
|
+
get: function () { return chunkF3FKBNMQ_cjs.googleOAuthRedirectUri; }
|
|
39
39
|
});
|
|
40
40
|
Object.defineProperty(exports, "isGoogleAuthPubliclyEnabled", {
|
|
41
41
|
enumerable: true,
|
|
42
|
-
get: function () { return
|
|
42
|
+
get: function () { return chunkF3FKBNMQ_cjs.isGoogleAuthPubliclyEnabled; }
|
|
43
43
|
});
|
|
44
44
|
Object.defineProperty(exports, "resolveGoogleAuthConfig", {
|
|
45
45
|
enumerable: true,
|
|
46
|
-
get: function () { return
|
|
46
|
+
get: function () { return chunkF3FKBNMQ_cjs.resolveGoogleAuthConfig; }
|
|
47
47
|
});
|
|
48
48
|
Object.defineProperty(exports, "seedAdministratorPermissions", {
|
|
49
49
|
enumerable: true,
|
|
50
|
-
get: function () { return
|
|
50
|
+
get: function () { return chunkF3FKBNMQ_cjs.seedAdministratorPermissions; }
|
|
51
51
|
});
|
|
52
52
|
Object.defineProperty(exports, "OPEN_ENDPOINTS", {
|
|
53
53
|
enumerable: true,
|
package/dist/auth.d.cts
CHANGED
|
@@ -43,6 +43,14 @@ interface SessionUser {
|
|
|
43
43
|
adminAccess?: boolean;
|
|
44
44
|
/** Vendor stores this user can access (from vendor_users). */
|
|
45
45
|
vendorIds?: number[];
|
|
46
|
+
/** Full list of accessible vendor stores with names & roles */
|
|
47
|
+
vendorStores?: Array<{
|
|
48
|
+
id: number;
|
|
49
|
+
name: string;
|
|
50
|
+
slug?: string;
|
|
51
|
+
roleName?: string;
|
|
52
|
+
isOwner?: boolean;
|
|
53
|
+
}>;
|
|
46
54
|
/** Active vendor for scoped CRUD (vendor staff). */
|
|
47
55
|
activeVendorId?: number | null;
|
|
48
56
|
/** @deprecated Prefer isVendorRoleOwner / vendorRoleId. Legacy owner|staff hint. */
|
|
@@ -292,6 +300,13 @@ interface NextAuthUser {
|
|
|
292
300
|
}>;
|
|
293
301
|
};
|
|
294
302
|
vendorIds?: number[];
|
|
303
|
+
vendorStores?: Array<{
|
|
304
|
+
id: number;
|
|
305
|
+
name: string;
|
|
306
|
+
slug?: string;
|
|
307
|
+
roleName?: string;
|
|
308
|
+
isOwner?: boolean;
|
|
309
|
+
}>;
|
|
295
310
|
activeVendorId?: number | null;
|
|
296
311
|
vendorRole?: 'owner' | 'staff' | null;
|
|
297
312
|
vendorRoleId?: number | null;
|
package/dist/auth.d.ts
CHANGED
|
@@ -43,6 +43,14 @@ interface SessionUser {
|
|
|
43
43
|
adminAccess?: boolean;
|
|
44
44
|
/** Vendor stores this user can access (from vendor_users). */
|
|
45
45
|
vendorIds?: number[];
|
|
46
|
+
/** Full list of accessible vendor stores with names & roles */
|
|
47
|
+
vendorStores?: Array<{
|
|
48
|
+
id: number;
|
|
49
|
+
name: string;
|
|
50
|
+
slug?: string;
|
|
51
|
+
roleName?: string;
|
|
52
|
+
isOwner?: boolean;
|
|
53
|
+
}>;
|
|
46
54
|
/** Active vendor for scoped CRUD (vendor staff). */
|
|
47
55
|
activeVendorId?: number | null;
|
|
48
56
|
/** @deprecated Prefer isVendorRoleOwner / vendorRoleId. Legacy owner|staff hint. */
|
|
@@ -292,6 +300,13 @@ interface NextAuthUser {
|
|
|
292
300
|
}>;
|
|
293
301
|
};
|
|
294
302
|
vendorIds?: number[];
|
|
303
|
+
vendorStores?: Array<{
|
|
304
|
+
id: number;
|
|
305
|
+
name: string;
|
|
306
|
+
slug?: string;
|
|
307
|
+
roleName?: string;
|
|
308
|
+
isOwner?: boolean;
|
|
309
|
+
}>;
|
|
295
310
|
activeVendorId?: number | null;
|
|
296
311
|
vendorRole?: 'owner' | 'staff' | null;
|
|
297
312
|
vendorRoleId?: number | null;
|
package/dist/auth.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { AUTH_PROVIDERS_SETTINGS_GROUP, buildNextAuthOptions, buildStorefrontNextAuthOptions, createCustomerUserFromGoogleOAuth, getNextAuthOptions, getStorefrontNextAuthOptions, googleOAuthRedirectUri, isGoogleAuthPubliclyEnabled, resolveGoogleAuthConfig, seedAdministratorPermissions } from './chunk-
|
|
1
|
+
export { AUTH_PROVIDERS_SETTINGS_GROUP, buildNextAuthOptions, buildStorefrontNextAuthOptions, createCustomerUserFromGoogleOAuth, getNextAuthOptions, getStorefrontNextAuthOptions, googleOAuthRedirectUri, isGoogleAuthPubliclyEnabled, resolveGoogleAuthConfig, seedAdministratorPermissions } from './chunk-DEGN4BTH.js';
|
|
2
2
|
export { OPEN_ENDPOINTS, PERMISSION_REQUIRED_ENDPOINTS, RBAC_ADMIN_ONLY_ENTITIES, canManageRoles, createAuthHelpers, createCmsAuthBundle, getRequiredPermission, isOpenEndpoint, isPublicMethod, sessionHasEntityAccess } from './chunk-NQF6H656.js';
|
|
3
3
|
export { ADMIN_GROUP_NAME, SUPER_ADMIN_GROUP_ID, VENDOR_ADMIN_GROUP_ID, VENDOR_GROUP_NAME, 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-CJY2HUJC.js';
|
|
4
4
|
import './chunk-BK5XW5XH.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkRQCXRCYM_cjs = require('./chunk-RQCXRCYM.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunkX5ILLSTD_cjs = require('./chunk-X5ILLSTD.cjs');
|
|
5
5
|
var chunkE62LKM6Z_cjs = require('./chunk-E62LKM6Z.cjs');
|
|
6
6
|
var chunk47G65M5Q_cjs = require('./chunk-47G65M5Q.cjs');
|
|
7
7
|
var chunkEYUBL7YH_cjs = require('./chunk-EYUBL7YH.cjs');
|
|
@@ -277,7 +277,7 @@ async function buildLocalInvoicePdfForOrder(ds, entityMap, orderId) {
|
|
|
277
277
|
const baseUrl = process.env.NEXTAUTH_URL || process.env.PUBLIC_APP_URL || "";
|
|
278
278
|
const qrData = qrToken ? baseUrl ? `${baseUrl.replace(/\/$/, "")}/track/${qrToken}` : `/track/${qrToken}` : String(o.orderNumber || orderId);
|
|
279
279
|
const includeQrCode = store.invoice_include_qr === "true" || store.invoiceIncludeQr === "true";
|
|
280
|
-
const bytes = await
|
|
280
|
+
const bytes = await chunkX5ILLSTD_cjs.generateLocalInvoicePdf({
|
|
281
281
|
templateId: chunkE62LKM6Z_cjs.normalizeInvoiceTemplateId(store.invoiceTemplate),
|
|
282
282
|
orderNumber: String(o.orderNumber || orderId),
|
|
283
283
|
orderDate: o.createdAt || /* @__PURE__ */ new Date(),
|
|
@@ -4,7 +4,7 @@ var chunkKJB5LBFQ_cjs = require('./chunk-KJB5LBFQ.cjs');
|
|
|
4
4
|
var chunkK742UE6S_cjs = require('./chunk-K742UE6S.cjs');
|
|
5
5
|
var chunkCIZZX57T_cjs = require('./chunk-CIZZX57T.cjs');
|
|
6
6
|
var chunkQN6PZLAP_cjs = require('./chunk-QN6PZLAP.cjs');
|
|
7
|
-
var
|
|
7
|
+
var chunkD3SR6CYU_cjs = require('./chunk-D3SR6CYU.cjs');
|
|
8
8
|
var chunkEYUBL7YH_cjs = require('./chunk-EYUBL7YH.cjs');
|
|
9
9
|
var chunkXHPRD45G_cjs = require('./chunk-XHPRD45G.cjs');
|
|
10
10
|
var crypto = require('crypto');
|
|
@@ -1062,7 +1062,7 @@ async function sendChatLeadEmail(cms, emailSettings, brandingSettings, input) {
|
|
|
1062
1062
|
};
|
|
1063
1063
|
let anySent = false;
|
|
1064
1064
|
for (const to of recipients) {
|
|
1065
|
-
await
|
|
1065
|
+
await chunkD3SR6CYU_cjs.queueEmail(cms, {
|
|
1066
1066
|
to,
|
|
1067
1067
|
templateName: "chatLead",
|
|
1068
1068
|
ctx
|
|
@@ -2091,7 +2091,7 @@ async function sendEmailForTrigger(triggerKey, orderId, audienceType, variables,
|
|
|
2091
2091
|
companyDetails
|
|
2092
2092
|
});
|
|
2093
2093
|
const cms = await getCms();
|
|
2094
|
-
await
|
|
2094
|
+
await chunkD3SR6CYU_cjs.queueEmail(cms, {
|
|
2095
2095
|
to: contactEmail,
|
|
2096
2096
|
subject,
|
|
2097
2097
|
html,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isOrderEligibleForInvoiceEmail, resolveOrderInvoicePdfBytes } from './chunk-
|
|
1
|
+
import { isOrderEligibleForInvoiceEmail, resolveOrderInvoicePdfBytes } from './chunk-DAUBLBTP.js';
|
|
2
2
|
import { __name } from './chunk-5BKT4CS5.js';
|
|
3
3
|
|
|
4
4
|
// src/plugins/email/email-queue.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk25T6HP5T_cjs = require('./chunk-25T6HP5T.cjs');
|
|
4
4
|
var chunkXHPRD45G_cjs = require('./chunk-XHPRD45G.cjs');
|
|
5
5
|
|
|
6
6
|
// src/plugins/email/email-queue.ts
|
|
@@ -50,13 +50,13 @@ async function resolveInvoiceAttachmentForJob(cms, payload, options) {
|
|
|
50
50
|
invoiceAttached: false
|
|
51
51
|
};
|
|
52
52
|
const o = order;
|
|
53
|
-
if (!
|
|
53
|
+
if (!chunk25T6HP5T_cjs.isOrderEligibleForInvoiceEmail(o.status, o.orderKind)) {
|
|
54
54
|
return {
|
|
55
55
|
attachments: payload.attachments,
|
|
56
56
|
invoiceAttached: false
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
|
-
const resolved = await
|
|
59
|
+
const resolved = await chunk25T6HP5T_cjs.resolveOrderInvoicePdfBytes(cms, dataSource, entityMap, payload.orderId);
|
|
60
60
|
if ("error" in resolved) {
|
|
61
61
|
console.warn("[email] order invoice attach failed", {
|
|
62
62
|
orderId: payload.orderId,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isErpIntegrationEnabled } from './chunk-WQZ4AH2P.js';
|
|
2
|
-
import { generateLocalInvoicePdf } from './chunk-
|
|
2
|
+
import { generateLocalInvoicePdf } from './chunk-LUSJITTI.js';
|
|
3
3
|
import { normalizeInvoiceTemplateId } from './chunk-K6RXCLD5.js';
|
|
4
4
|
import { resolveInvoiceAssetUrl } from './chunk-5DSY3GQI.js';
|
|
5
5
|
import { mergeEmailLayoutCompanyDetails, getCompanyDetailsFromSettings } from './chunk-YDMHG6BA.js';
|
|
@@ -409,6 +409,7 @@ function sessionUserFromNextAuthUser(user) {
|
|
|
409
409
|
entityPerms,
|
|
410
410
|
adminAccess,
|
|
411
411
|
vendorIds,
|
|
412
|
+
vendorStores: user.vendorStores ?? [],
|
|
412
413
|
activeVendorId: user.activeVendorId ?? vendorIds[0] ?? null,
|
|
413
414
|
vendorRole,
|
|
414
415
|
vendorRoleId: user.vendorRoleId ?? null,
|
|
@@ -735,6 +736,7 @@ function getNextAuthOptions(config) {
|
|
|
735
736
|
token.entityPerms = u.entityPerms;
|
|
736
737
|
token.adminAccess = u.adminAccess;
|
|
737
738
|
token.vendorIds = u.vendorIds;
|
|
739
|
+
token.vendorStores = u.vendorStores;
|
|
738
740
|
token.activeVendorId = u.activeVendorId;
|
|
739
741
|
token.vendorRole = u.vendorRole;
|
|
740
742
|
token.vendorRoleId = u.vendorRoleId;
|
|
@@ -753,6 +755,12 @@ function getNextAuthOptions(config) {
|
|
|
753
755
|
if (typeof s.name === "string") t.name = s.name;
|
|
754
756
|
if (typeof s.email === "string") t.email = s.email;
|
|
755
757
|
if (typeof s.activeVendorId === "number") t.activeVendorId = s.activeVendorId;
|
|
758
|
+
if ("vendorStores" in s) t.vendorStores = s.vendorStores;
|
|
759
|
+
if ("vendorRole" in s) t.vendorRole = s.vendorRole;
|
|
760
|
+
if ("vendorRoleId" in s) t.vendorRoleId = s.vendorRoleId;
|
|
761
|
+
if ("vendorRoleName" in s) t.vendorRoleName = s.vendorRoleName;
|
|
762
|
+
if ("isVendorRoleOwner" in s) t.isVendorRoleOwner = s.isVendorRoleOwner;
|
|
763
|
+
if ("vendorEntityPerms" in s) t.vendorEntityPerms = s.vendorEntityPerms;
|
|
756
764
|
}
|
|
757
765
|
return token;
|
|
758
766
|
},
|
|
@@ -773,6 +781,7 @@ function getNextAuthOptions(config) {
|
|
|
773
781
|
session.user.entityPerms = t.entityPerms;
|
|
774
782
|
session.user.adminAccess = t.adminAccess;
|
|
775
783
|
session.user.vendorIds = t.vendorIds;
|
|
784
|
+
session.user.vendorStores = t.vendorStores;
|
|
776
785
|
session.user.activeVendorId = t.activeVendorId;
|
|
777
786
|
session.user.vendorRole = t.vendorRole;
|
|
778
787
|
session.user.vendorRoleId = t.vendorRoleId;
|
|
@@ -416,6 +416,7 @@ function sessionUserFromNextAuthUser(user) {
|
|
|
416
416
|
entityPerms,
|
|
417
417
|
adminAccess,
|
|
418
418
|
vendorIds,
|
|
419
|
+
vendorStores: user.vendorStores ?? [],
|
|
419
420
|
activeVendorId: user.activeVendorId ?? vendorIds[0] ?? null,
|
|
420
421
|
vendorRole,
|
|
421
422
|
vendorRoleId: user.vendorRoleId ?? null,
|
|
@@ -742,6 +743,7 @@ function getNextAuthOptions(config) {
|
|
|
742
743
|
token.entityPerms = u.entityPerms;
|
|
743
744
|
token.adminAccess = u.adminAccess;
|
|
744
745
|
token.vendorIds = u.vendorIds;
|
|
746
|
+
token.vendorStores = u.vendorStores;
|
|
745
747
|
token.activeVendorId = u.activeVendorId;
|
|
746
748
|
token.vendorRole = u.vendorRole;
|
|
747
749
|
token.vendorRoleId = u.vendorRoleId;
|
|
@@ -760,6 +762,12 @@ function getNextAuthOptions(config) {
|
|
|
760
762
|
if (typeof s.name === "string") t.name = s.name;
|
|
761
763
|
if (typeof s.email === "string") t.email = s.email;
|
|
762
764
|
if (typeof s.activeVendorId === "number") t.activeVendorId = s.activeVendorId;
|
|
765
|
+
if ("vendorStores" in s) t.vendorStores = s.vendorStores;
|
|
766
|
+
if ("vendorRole" in s) t.vendorRole = s.vendorRole;
|
|
767
|
+
if ("vendorRoleId" in s) t.vendorRoleId = s.vendorRoleId;
|
|
768
|
+
if ("vendorRoleName" in s) t.vendorRoleName = s.vendorRoleName;
|
|
769
|
+
if ("isVendorRoleOwner" in s) t.isVendorRoleOwner = s.isVendorRoleOwner;
|
|
770
|
+
if ("vendorEntityPerms" in s) t.vendorEntityPerms = s.vendorEntityPerms;
|
|
763
771
|
}
|
|
764
772
|
return token;
|
|
765
773
|
},
|
|
@@ -780,6 +788,7 @@ function getNextAuthOptions(config) {
|
|
|
780
788
|
session.user.entityPerms = t.entityPerms;
|
|
781
789
|
session.user.adminAccess = t.adminAccess;
|
|
782
790
|
session.user.vendorIds = t.vendorIds;
|
|
791
|
+
session.user.vendorStores = t.vendorStores;
|
|
783
792
|
session.user.activeVendorId = t.activeVendorId;
|
|
784
793
|
session.user.vendorRole = t.vendorRole;
|
|
785
794
|
session.user.vendorRoleId = t.vendorRoleId;
|