@ainsleydev/payload-helper 0.0.40 → 0.1.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 (36) hide show
  1. package/README.md +76 -0
  2. package/dist/cli/bin.js +20 -0
  3. package/dist/cli/bin.js.map +1 -1
  4. package/dist/cli/commands/preview-emails.d.ts +5 -0
  5. package/dist/cli/commands/preview-emails.js +123 -0
  6. package/dist/cli/commands/preview-emails.js.map +1 -0
  7. package/dist/email/ForgotPasswordEmail.d.ts +38 -0
  8. package/dist/email/ForgotPasswordEmail.js +61 -0
  9. package/dist/email/ForgotPasswordEmail.js.map +1 -0
  10. package/dist/email/ForgotPasswordEmail.test.d.ts +1 -0
  11. package/dist/email/ForgotPasswordEmail.test.js +202 -0
  12. package/dist/email/ForgotPasswordEmail.test.js.map +1 -0
  13. package/dist/email/VerifyAccountEmail.d.ts +38 -0
  14. package/dist/email/VerifyAccountEmail.js +61 -0
  15. package/dist/email/VerifyAccountEmail.js.map +1 -0
  16. package/dist/email/VerifyAccountEmail.test.d.ts +1 -0
  17. package/dist/email/VerifyAccountEmail.test.js +212 -0
  18. package/dist/email/VerifyAccountEmail.test.js.map +1 -0
  19. package/dist/index.d.ts +6 -1
  20. package/dist/index.js +13 -0
  21. package/dist/index.js.map +1 -1
  22. package/dist/plugin/email.d.ts +10 -0
  23. package/dist/plugin/email.js +98 -0
  24. package/dist/plugin/email.js.map +1 -0
  25. package/dist/plugin/email.test.js +265 -0
  26. package/dist/plugin/email.test.js.map +1 -0
  27. package/dist/types.d.ts +134 -0
  28. package/dist/types.js +3 -1
  29. package/dist/types.js.map +1 -1
  30. package/package.json +27 -14
  31. package/dist/plugin/icon.d.ts +0 -6
  32. package/dist/plugin/icon.js +0 -26
  33. package/dist/plugin/icon.js.map +0 -1
  34. package/dist/plugin/logo.d.ts +0 -6
  35. package/dist/plugin/logo.js +0 -26
  36. package/dist/plugin/logo.js.map +0 -1
@@ -0,0 +1,265 @@
1
+ import { describe, expect, test, vi } from 'vitest';
2
+ import { injectEmailTemplates } from './email.js';
3
+ // Mock the email templates module
4
+ vi.mock('@ainsleydev/email-templates', ()=>({
5
+ renderEmail: vi.fn(async ()=>'<html>Mocked Email</html>')
6
+ }));
7
+ describe('injectEmailTemplates', ()=>{
8
+ const mockEmailConfig = {
9
+ frontEndUrl: 'https://example.com',
10
+ theme: {
11
+ branding: {
12
+ companyName: 'Test Company'
13
+ }
14
+ },
15
+ forgotPassword: {
16
+ heading: 'Reset Your Password',
17
+ bodyText: 'Click below to reset your password'
18
+ },
19
+ verifyAccount: {
20
+ heading: 'Verify Your Account',
21
+ bodyText: 'Click below to verify your account'
22
+ }
23
+ };
24
+ test('should inject email templates into auth-enabled collections', ()=>{
25
+ const config = {
26
+ collections: [
27
+ {
28
+ slug: 'users',
29
+ fields: [],
30
+ auth: true
31
+ }
32
+ ],
33
+ serverURL: 'https://api.example.com'
34
+ };
35
+ const result = injectEmailTemplates(config, mockEmailConfig);
36
+ const usersCollection = result.collections?.[0];
37
+ expect(usersCollection).toBeDefined();
38
+ expect(typeof usersCollection?.auth).toBe('object');
39
+ if (typeof usersCollection?.auth === 'object') {
40
+ expect(usersCollection.auth.forgotPassword).toBeDefined();
41
+ expect(usersCollection.auth.verify).toBeDefined();
42
+ expect(usersCollection.auth.forgotPassword?.generateEmailHTML).toBeDefined();
43
+ expect(usersCollection.auth.verify?.generateEmailHTML).toBeDefined();
44
+ }
45
+ });
46
+ test('should not inject email templates into non-auth collections', ()=>{
47
+ const config = {
48
+ collections: [
49
+ {
50
+ slug: 'posts',
51
+ fields: []
52
+ }
53
+ ],
54
+ serverURL: 'https://api.example.com'
55
+ };
56
+ const result = injectEmailTemplates(config, mockEmailConfig);
57
+ const postsCollection = result.collections?.[0];
58
+ expect(postsCollection).toBeDefined();
59
+ expect(postsCollection?.auth).toBeUndefined();
60
+ });
61
+ test('should return config unchanged when no auth-enabled collections exist', ()=>{
62
+ const config = {
63
+ collections: [
64
+ {
65
+ slug: 'posts',
66
+ fields: []
67
+ },
68
+ {
69
+ slug: 'media',
70
+ fields: []
71
+ }
72
+ ],
73
+ serverURL: 'https://api.example.com'
74
+ };
75
+ const result = injectEmailTemplates(config, mockEmailConfig);
76
+ expect(result.collections).toEqual(config.collections);
77
+ });
78
+ test('should handle auth as boolean and convert to object', ()=>{
79
+ const config = {
80
+ collections: [
81
+ {
82
+ slug: 'users',
83
+ fields: [],
84
+ auth: true
85
+ }
86
+ ],
87
+ serverURL: 'https://api.example.com'
88
+ };
89
+ const result = injectEmailTemplates(config, mockEmailConfig);
90
+ const usersCollection = result.collections?.[0];
91
+ expect(typeof usersCollection?.auth).toBe('object');
92
+ });
93
+ test('should preserve existing auth configuration', ()=>{
94
+ const config = {
95
+ collections: [
96
+ {
97
+ slug: 'users',
98
+ fields: [],
99
+ auth: {
100
+ tokenExpiration: 7200,
101
+ maxLoginAttempts: 5
102
+ }
103
+ }
104
+ ],
105
+ serverURL: 'https://api.example.com'
106
+ };
107
+ const result = injectEmailTemplates(config, mockEmailConfig);
108
+ const usersCollection = result.collections?.[0];
109
+ if (typeof usersCollection?.auth === 'object') {
110
+ expect(usersCollection.auth.tokenExpiration).toBe(7200);
111
+ expect(usersCollection.auth.maxLoginAttempts).toBe(5);
112
+ }
113
+ });
114
+ test('should merge theme with websiteUrl from frontEndUrl', ()=>{
115
+ const config = {
116
+ collections: [
117
+ {
118
+ slug: 'users',
119
+ fields: [],
120
+ auth: true
121
+ }
122
+ ],
123
+ serverURL: 'https://api.example.com'
124
+ };
125
+ const emailConfig = {
126
+ frontEndUrl: 'https://custom-frontend.com',
127
+ theme: {
128
+ branding: {
129
+ companyName: 'Test Company'
130
+ }
131
+ }
132
+ };
133
+ const result = injectEmailTemplates(config, emailConfig);
134
+ // The theme should have websiteUrl merged into branding
135
+ // This is tested indirectly through the generateEmailHTML function
136
+ const usersCollection = result.collections?.[0];
137
+ expect(usersCollection).toBeDefined();
138
+ });
139
+ test('should use serverURL when frontEndUrl is not provided', ()=>{
140
+ const config = {
141
+ collections: [
142
+ {
143
+ slug: 'users',
144
+ fields: [],
145
+ auth: true
146
+ }
147
+ ],
148
+ serverURL: 'https://api.example.com'
149
+ };
150
+ const emailConfig = {
151
+ // No frontEndUrl provided
152
+ theme: {
153
+ branding: {
154
+ companyName: 'Test Company'
155
+ }
156
+ }
157
+ };
158
+ const result = injectEmailTemplates(config, emailConfig);
159
+ const usersCollection = result.collections?.[0];
160
+ expect(usersCollection).toBeDefined();
161
+ // The websiteUrl should default to serverURL
162
+ });
163
+ test('should handle multiple auth-enabled collections', ()=>{
164
+ const config = {
165
+ collections: [
166
+ {
167
+ slug: 'users',
168
+ fields: [],
169
+ auth: true
170
+ },
171
+ {
172
+ slug: 'admins',
173
+ fields: [],
174
+ auth: {
175
+ tokenExpiration: 3600
176
+ }
177
+ },
178
+ {
179
+ slug: 'posts',
180
+ fields: []
181
+ }
182
+ ],
183
+ serverURL: 'https://api.example.com'
184
+ };
185
+ const result = injectEmailTemplates(config, mockEmailConfig);
186
+ expect(result.collections).toHaveLength(3);
187
+ const usersCollection = result.collections?.[0];
188
+ const adminsCollection = result.collections?.[1];
189
+ const postsCollection = result.collections?.[2];
190
+ // Users should have email templates
191
+ if (typeof usersCollection?.auth === 'object') {
192
+ expect(usersCollection.auth.forgotPassword?.generateEmailHTML).toBeDefined();
193
+ expect(usersCollection.auth.verify?.generateEmailHTML).toBeDefined();
194
+ }
195
+ // Admins should have email templates and preserve existing config
196
+ if (typeof adminsCollection?.auth === 'object') {
197
+ expect(adminsCollection.auth.forgotPassword?.generateEmailHTML).toBeDefined();
198
+ expect(adminsCollection.auth.verify?.generateEmailHTML).toBeDefined();
199
+ expect(adminsCollection.auth.tokenExpiration).toBe(3600);
200
+ }
201
+ // Posts should remain unchanged
202
+ expect(postsCollection?.auth).toBeUndefined();
203
+ });
204
+ test('should handle empty collections array', ()=>{
205
+ const config = {
206
+ collections: [],
207
+ serverURL: 'https://api.example.com'
208
+ };
209
+ const result = injectEmailTemplates(config, mockEmailConfig);
210
+ expect(result.collections).toEqual([]);
211
+ });
212
+ test('should handle config without collections property', ()=>{
213
+ const config = {
214
+ serverURL: 'https://api.example.com'
215
+ };
216
+ const result = injectEmailTemplates(config, mockEmailConfig);
217
+ expect(result.collections).toBeUndefined();
218
+ });
219
+ test('should preserve existing forgotPassword configuration', ()=>{
220
+ const config = {
221
+ collections: [
222
+ {
223
+ slug: 'users',
224
+ fields: [],
225
+ auth: {
226
+ forgotPassword: {
227
+ generateEmailSubject: ()=>'Custom Subject'
228
+ }
229
+ }
230
+ }
231
+ ],
232
+ serverURL: 'https://api.example.com'
233
+ };
234
+ const result = injectEmailTemplates(config, mockEmailConfig);
235
+ const usersCollection = result.collections?.[0];
236
+ if (typeof usersCollection?.auth === 'object') {
237
+ expect(usersCollection.auth.forgotPassword?.generateEmailSubject).toBeDefined();
238
+ expect(usersCollection.auth.forgotPassword?.generateEmailHTML).toBeDefined();
239
+ }
240
+ });
241
+ test('should preserve existing verify configuration', ()=>{
242
+ const config = {
243
+ collections: [
244
+ {
245
+ slug: 'users',
246
+ fields: [],
247
+ auth: {
248
+ verify: {
249
+ generateEmailSubject: ()=>'Custom Verify Subject'
250
+ }
251
+ }
252
+ }
253
+ ],
254
+ serverURL: 'https://api.example.com'
255
+ };
256
+ const result = injectEmailTemplates(config, mockEmailConfig);
257
+ const usersCollection = result.collections?.[0];
258
+ if (typeof usersCollection?.auth === 'object') {
259
+ expect(usersCollection.auth.verify?.generateEmailSubject).toBeDefined();
260
+ expect(usersCollection.auth.verify?.generateEmailHTML).toBeDefined();
261
+ }
262
+ });
263
+ });
264
+
265
+ //# sourceMappingURL=email.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/plugin/email.test.ts"],"sourcesContent":["import type { CollectionConfig, Config } from 'payload';\nimport { describe, expect, test, vi } from 'vitest';\nimport type { EmailConfig } from '../types.js';\nimport { injectEmailTemplates } from './email.js';\n\n// Mock the email templates module\nvi.mock('@ainsleydev/email-templates', () => ({\n\trenderEmail: vi.fn(async () => '<html>Mocked Email</html>'),\n}));\n\ndescribe('injectEmailTemplates', () => {\n\tconst mockEmailConfig: EmailConfig = {\n\t\tfrontEndUrl: 'https://example.com',\n\t\ttheme: {\n\t\t\tbranding: {\n\t\t\t\tcompanyName: 'Test Company',\n\t\t\t},\n\t\t},\n\t\tforgotPassword: {\n\t\t\theading: 'Reset Your Password',\n\t\t\tbodyText: 'Click below to reset your password',\n\t\t},\n\t\tverifyAccount: {\n\t\t\theading: 'Verify Your Account',\n\t\t\tbodyText: 'Click below to verify your account',\n\t\t},\n\t};\n\n\ttest('should inject email templates into auth-enabled collections', () => {\n\t\tconst config: Config = {\n\t\t\tcollections: [\n\t\t\t\t{\n\t\t\t\t\tslug: 'users',\n\t\t\t\t\tfields: [],\n\t\t\t\t\tauth: true,\n\t\t\t\t},\n\t\t\t] as CollectionConfig[],\n\t\t\tserverURL: 'https://api.example.com',\n\t\t};\n\n\t\tconst result = injectEmailTemplates(config, mockEmailConfig);\n\n\t\tconst usersCollection = result.collections?.[0];\n\t\texpect(usersCollection).toBeDefined();\n\t\texpect(typeof usersCollection?.auth).toBe('object');\n\n\t\tif (typeof usersCollection?.auth === 'object') {\n\t\t\texpect(usersCollection.auth.forgotPassword).toBeDefined();\n\t\t\texpect(usersCollection.auth.verify).toBeDefined();\n\t\t\texpect(usersCollection.auth.forgotPassword?.generateEmailHTML).toBeDefined();\n\t\t\texpect(usersCollection.auth.verify?.generateEmailHTML).toBeDefined();\n\t\t}\n\t});\n\n\ttest('should not inject email templates into non-auth collections', () => {\n\t\tconst config: Config = {\n\t\t\tcollections: [\n\t\t\t\t{\n\t\t\t\t\tslug: 'posts',\n\t\t\t\t\tfields: [],\n\t\t\t\t\t// No auth property\n\t\t\t\t},\n\t\t\t] as CollectionConfig[],\n\t\t\tserverURL: 'https://api.example.com',\n\t\t};\n\n\t\tconst result = injectEmailTemplates(config, mockEmailConfig);\n\n\t\tconst postsCollection = result.collections?.[0];\n\t\texpect(postsCollection).toBeDefined();\n\t\texpect(postsCollection?.auth).toBeUndefined();\n\t});\n\n\ttest('should return config unchanged when no auth-enabled collections exist', () => {\n\t\tconst config: Config = {\n\t\t\tcollections: [\n\t\t\t\t{\n\t\t\t\t\tslug: 'posts',\n\t\t\t\t\tfields: [],\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tslug: 'media',\n\t\t\t\t\tfields: [],\n\t\t\t\t},\n\t\t\t] as CollectionConfig[],\n\t\t\tserverURL: 'https://api.example.com',\n\t\t};\n\n\t\tconst result = injectEmailTemplates(config, mockEmailConfig);\n\n\t\texpect(result.collections).toEqual(config.collections);\n\t});\n\n\ttest('should handle auth as boolean and convert to object', () => {\n\t\tconst config: Config = {\n\t\t\tcollections: [\n\t\t\t\t{\n\t\t\t\t\tslug: 'users',\n\t\t\t\t\tfields: [],\n\t\t\t\t\tauth: true,\n\t\t\t\t},\n\t\t\t] as CollectionConfig[],\n\t\t\tserverURL: 'https://api.example.com',\n\t\t};\n\n\t\tconst result = injectEmailTemplates(config, mockEmailConfig);\n\n\t\tconst usersCollection = result.collections?.[0];\n\t\texpect(typeof usersCollection?.auth).toBe('object');\n\t});\n\n\ttest('should preserve existing auth configuration', () => {\n\t\tconst config: Config = {\n\t\t\tcollections: [\n\t\t\t\t{\n\t\t\t\t\tslug: 'users',\n\t\t\t\t\tfields: [],\n\t\t\t\t\tauth: {\n\t\t\t\t\t\ttokenExpiration: 7200,\n\t\t\t\t\t\tmaxLoginAttempts: 5,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t] as CollectionConfig[],\n\t\t\tserverURL: 'https://api.example.com',\n\t\t};\n\n\t\tconst result = injectEmailTemplates(config, mockEmailConfig);\n\n\t\tconst usersCollection = result.collections?.[0];\n\t\tif (typeof usersCollection?.auth === 'object') {\n\t\t\texpect(usersCollection.auth.tokenExpiration).toBe(7200);\n\t\t\texpect(usersCollection.auth.maxLoginAttempts).toBe(5);\n\t\t}\n\t});\n\n\ttest('should merge theme with websiteUrl from frontEndUrl', () => {\n\t\tconst config: Config = {\n\t\t\tcollections: [\n\t\t\t\t{\n\t\t\t\t\tslug: 'users',\n\t\t\t\t\tfields: [],\n\t\t\t\t\tauth: true,\n\t\t\t\t},\n\t\t\t] as CollectionConfig[],\n\t\t\tserverURL: 'https://api.example.com',\n\t\t};\n\n\t\tconst emailConfig: EmailConfig = {\n\t\t\tfrontEndUrl: 'https://custom-frontend.com',\n\t\t\ttheme: {\n\t\t\t\tbranding: {\n\t\t\t\t\tcompanyName: 'Test Company',\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\n\t\tconst result = injectEmailTemplates(config, emailConfig);\n\n\t\t// The theme should have websiteUrl merged into branding\n\t\t// This is tested indirectly through the generateEmailHTML function\n\t\tconst usersCollection = result.collections?.[0];\n\t\texpect(usersCollection).toBeDefined();\n\t});\n\n\ttest('should use serverURL when frontEndUrl is not provided', () => {\n\t\tconst config: Config = {\n\t\t\tcollections: [\n\t\t\t\t{\n\t\t\t\t\tslug: 'users',\n\t\t\t\t\tfields: [],\n\t\t\t\t\tauth: true,\n\t\t\t\t},\n\t\t\t] as CollectionConfig[],\n\t\t\tserverURL: 'https://api.example.com',\n\t\t};\n\n\t\tconst emailConfig: EmailConfig = {\n\t\t\t// No frontEndUrl provided\n\t\t\ttheme: {\n\t\t\t\tbranding: {\n\t\t\t\t\tcompanyName: 'Test Company',\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\n\t\tconst result = injectEmailTemplates(config, emailConfig);\n\n\t\tconst usersCollection = result.collections?.[0];\n\t\texpect(usersCollection).toBeDefined();\n\t\t// The websiteUrl should default to serverURL\n\t});\n\n\ttest('should handle multiple auth-enabled collections', () => {\n\t\tconst config: Config = {\n\t\t\tcollections: [\n\t\t\t\t{\n\t\t\t\t\tslug: 'users',\n\t\t\t\t\tfields: [],\n\t\t\t\t\tauth: true,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tslug: 'admins',\n\t\t\t\t\tfields: [],\n\t\t\t\t\tauth: {\n\t\t\t\t\t\ttokenExpiration: 3600,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tslug: 'posts',\n\t\t\t\t\tfields: [],\n\t\t\t\t\t// No auth\n\t\t\t\t},\n\t\t\t] as CollectionConfig[],\n\t\t\tserverURL: 'https://api.example.com',\n\t\t};\n\n\t\tconst result = injectEmailTemplates(config, mockEmailConfig);\n\n\t\texpect(result.collections).toHaveLength(3);\n\n\t\tconst usersCollection = result.collections?.[0];\n\t\tconst adminsCollection = result.collections?.[1];\n\t\tconst postsCollection = result.collections?.[2];\n\n\t\t// Users should have email templates\n\t\tif (typeof usersCollection?.auth === 'object') {\n\t\t\texpect(usersCollection.auth.forgotPassword?.generateEmailHTML).toBeDefined();\n\t\t\texpect(usersCollection.auth.verify?.generateEmailHTML).toBeDefined();\n\t\t}\n\n\t\t// Admins should have email templates and preserve existing config\n\t\tif (typeof adminsCollection?.auth === 'object') {\n\t\t\texpect(adminsCollection.auth.forgotPassword?.generateEmailHTML).toBeDefined();\n\t\t\texpect(adminsCollection.auth.verify?.generateEmailHTML).toBeDefined();\n\t\t\texpect(adminsCollection.auth.tokenExpiration).toBe(3600);\n\t\t}\n\n\t\t// Posts should remain unchanged\n\t\texpect(postsCollection?.auth).toBeUndefined();\n\t});\n\n\ttest('should handle empty collections array', () => {\n\t\tconst config: Config = {\n\t\t\tcollections: [],\n\t\t\tserverURL: 'https://api.example.com',\n\t\t};\n\n\t\tconst result = injectEmailTemplates(config, mockEmailConfig);\n\n\t\texpect(result.collections).toEqual([]);\n\t});\n\n\ttest('should handle config without collections property', () => {\n\t\tconst config: Config = {\n\t\t\tserverURL: 'https://api.example.com',\n\t\t};\n\n\t\tconst result = injectEmailTemplates(config, mockEmailConfig);\n\n\t\texpect(result.collections).toBeUndefined();\n\t});\n\n\ttest('should preserve existing forgotPassword configuration', () => {\n\t\tconst config: Config = {\n\t\t\tcollections: [\n\t\t\t\t{\n\t\t\t\t\tslug: 'users',\n\t\t\t\t\tfields: [],\n\t\t\t\t\tauth: {\n\t\t\t\t\t\tforgotPassword: {\n\t\t\t\t\t\t\tgenerateEmailSubject: () => 'Custom Subject',\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t] as CollectionConfig[],\n\t\t\tserverURL: 'https://api.example.com',\n\t\t};\n\n\t\tconst result = injectEmailTemplates(config, mockEmailConfig);\n\n\t\tconst usersCollection = result.collections?.[0];\n\t\tif (typeof usersCollection?.auth === 'object') {\n\t\t\texpect(usersCollection.auth.forgotPassword?.generateEmailSubject).toBeDefined();\n\t\t\texpect(usersCollection.auth.forgotPassword?.generateEmailHTML).toBeDefined();\n\t\t}\n\t});\n\n\ttest('should preserve existing verify configuration', () => {\n\t\tconst config: Config = {\n\t\t\tcollections: [\n\t\t\t\t{\n\t\t\t\t\tslug: 'users',\n\t\t\t\t\tfields: [],\n\t\t\t\t\tauth: {\n\t\t\t\t\t\tverify: {\n\t\t\t\t\t\t\tgenerateEmailSubject: () => 'Custom Verify Subject',\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t] as CollectionConfig[],\n\t\t\tserverURL: 'https://api.example.com',\n\t\t};\n\n\t\tconst result = injectEmailTemplates(config, mockEmailConfig);\n\n\t\tconst usersCollection = result.collections?.[0];\n\t\tif (typeof usersCollection?.auth === 'object') {\n\t\t\texpect(usersCollection.auth.verify?.generateEmailSubject).toBeDefined();\n\t\t\texpect(usersCollection.auth.verify?.generateEmailHTML).toBeDefined();\n\t\t}\n\t});\n});\n"],"names":["describe","expect","test","vi","injectEmailTemplates","mock","renderEmail","fn","mockEmailConfig","frontEndUrl","theme","branding","companyName","forgotPassword","heading","bodyText","verifyAccount","config","collections","slug","fields","auth","serverURL","result","usersCollection","toBeDefined","toBe","verify","generateEmailHTML","postsCollection","toBeUndefined","toEqual","tokenExpiration","maxLoginAttempts","emailConfig","toHave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AAEwB,sBAAsBZ,WAAW;YAC7ExB,OAAOuB,gBAAgBH,IAAI,CAACR,cAAc,EAAEe,mBAAmBH,WAAW;QAC3E;IACD;IAEAvB,KAAK,iDAAiD;QACrD,MAAMe,SAAiB;YACtBC,aAAa;gBACZ;oBACCC,MAAM;oBACNC,QAAQ,EAAE;oBACVC,MAAM;wBACLM,QAAQ;4BACPU,sBAAsB,IAAM;wBAC7B;oBACD;gBACD;aACA;YACDf,WAAW;QACZ;QAEA,MAAMC,SAASnB,qBAAqBa,QAAQT;QAE5C,MAAMgB,kBAAkBD,OAAOL,WAAW,EAAE,CAAC,EAAE;QAC/C,IAAI,OAAOM,iBAAiBH,SAAS,UAAU;YAC9CpB,OAAOuB,gBAAgBH,IAAI,CAACM,MAAM,EAAEU,sBAAsBZ,WAAW;YACrExB,OAAOuB,gBAAgBH,IAAI,CAACM,MAAM,EAAEC,mBAAmBH,WAAW;QACnE;IACD;AACD"}
package/dist/types.d.ts CHANGED
@@ -1,38 +1,172 @@
1
+ import type { PartialEmailTheme } from '@ainsleydev/email-templates';
1
2
  import type { GlobalConfig, Tab } from 'payload';
3
+ /**
4
+ * Configuration for the Settings global.
5
+ */
2
6
  export type SettingsConfig = {
7
+ /**
8
+ * Additional tabs to add to the Settings global.
9
+ */
3
10
  additionalTabs?: Tab[];
11
+ /**
12
+ * Function to override the entire Settings global configuration.
13
+ */
4
14
  override: (args: {
5
15
  config: GlobalConfig;
6
16
  }) => GlobalConfig;
7
17
  };
18
+ /**
19
+ * Configuration for web server cache invalidation.
20
+ */
8
21
  export type WebServerConfig = {
22
+ /**
23
+ * Optional API key for authenticating cache invalidation requests.
24
+ */
9
25
  apiKey?: string;
26
+ /**
27
+ * Base URL of the web server.
28
+ */
10
29
  baseURL: string;
30
+ /**
31
+ * Endpoint path for cache invalidation.
32
+ */
11
33
  cacheEndpoint: string;
12
34
  };
35
+ /**
36
+ * Configuration for the admin panel logo.
37
+ */
13
38
  export type AdminLogoConfig = {
39
+ /**
40
+ * Path to the logo image file.
41
+ */
14
42
  path: string;
43
+ /**
44
+ * Optional path to the dark mode logo image file.
45
+ */
15
46
  darkModePath?: string;
47
+ /**
48
+ * Optional width of the logo in pixels.
49
+ */
16
50
  width?: number;
51
+ /**
52
+ * Optional height of the logo in pixels.
53
+ */
17
54
  height?: number;
55
+ /**
56
+ * Optional alt text for the logo image.
57
+ */
18
58
  alt?: string;
59
+ /**
60
+ * Optional CSS class name for the logo.
61
+ */
19
62
  className?: string;
20
63
  };
64
+ /**
65
+ * Configuration for the admin panel icon/favicon.
66
+ */
21
67
  export type AdminIconConfig = {
68
+ /**
69
+ * Path to the icon image file.
70
+ */
22
71
  path: string;
72
+ /**
73
+ * Optional path to the dark mode icon image file.
74
+ */
23
75
  darkModePath?: string;
76
+ /**
77
+ * Optional width of the icon in pixels.
78
+ */
24
79
  width?: number;
80
+ /**
81
+ * Optional height of the icon in pixels.
82
+ */
25
83
  height?: number;
84
+ /**
85
+ * Optional alt text for the icon image.
86
+ */
26
87
  alt?: string;
88
+ /**
89
+ * Optional CSS class name for the icon.
90
+ */
27
91
  className?: string;
28
92
  };
93
+ /**
94
+ * Configuration for admin panel customization.
95
+ */
29
96
  export type AdminConfig = {
97
+ /**
98
+ * Optional logo configuration for the admin panel.
99
+ */
30
100
  logo?: AdminLogoConfig;
101
+ /**
102
+ * Optional icon/favicon configuration for the admin panel.
103
+ */
31
104
  icon?: AdminIconConfig;
32
105
  };
106
+ /**
107
+ * Content overrides for customizing email template text.
108
+ */
109
+ export type EmailContentOverrides = {
110
+ /**
111
+ * Optional preview text shown in email clients before opening.
112
+ */
113
+ previewText?: string;
114
+ /**
115
+ * Optional heading text displayed at the top of the email.
116
+ */
117
+ heading?: string;
118
+ /**
119
+ * Optional body text content of the email.
120
+ */
121
+ bodyText?: string;
122
+ /**
123
+ * Optional button text for the call-to-action button.
124
+ */
125
+ buttonText?: string;
126
+ };
127
+ /**
128
+ * Configuration for email templates used in authentication flows.
129
+ */
130
+ export type EmailConfig = {
131
+ /**
132
+ * Optional front-end URL override for email links. If not provided, uses Payload's serverUrl.
133
+ */
134
+ frontEndUrl?: string;
135
+ /**
136
+ * Optional theme customization for email templates (colors, branding, etc.).
137
+ */
138
+ theme?: PartialEmailTheme;
139
+ /**
140
+ * Optional content overrides for the forgot password email template.
141
+ */
142
+ forgotPassword?: EmailContentOverrides;
143
+ /**
144
+ * Optional content overrides for the verify account email template.
145
+ */
146
+ verifyAccount?: EmailContentOverrides;
147
+ };
148
+ /**
149
+ * Main configuration object for the Payload Helper plugin.
150
+ */
33
151
  export type PayloadHelperPluginConfig = {
152
+ /**
153
+ * The name of the site, used throughout the admin panel and emails.
154
+ */
34
155
  siteName: string;
156
+ /**
157
+ * Optional settings global configuration.
158
+ */
35
159
  settings?: SettingsConfig;
160
+ /**
161
+ * Optional web server configuration for cache invalidation.
162
+ */
36
163
  webServer?: WebServerConfig;
164
+ /**
165
+ * Optional admin panel customization (logo, icon).
166
+ */
37
167
  admin?: AdminConfig;
168
+ /**
169
+ * Optional email template configuration for authentication emails.
170
+ */
171
+ email?: EmailConfig;
38
172
  };
package/dist/types.js CHANGED
@@ -1,4 +1,6 @@
1
1
  // import type { SEOPluginConfig } from "@payloadcms/plugin-seo/types";
2
- export { };
2
+ /**
3
+ * Main configuration object for the Payload Helper plugin.
4
+ */ export { };
3
5
 
4
6
  //# sourceMappingURL=types.js.map
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/types.ts"],"sourcesContent":["// import type { SEOPluginConfig } from \"@payloadcms/plugin-seo/types\";\nimport type { GlobalConfig, Tab, TextField, TextareaField, UploadField } from 'payload';\n// import type {SEOPluginConfig} from \"@payloadcms/plugin-seo/dist/types.js\";\n\nexport type SettingsConfig = {\n\tadditionalTabs?: Tab[];\n\toverride: (args: {\n\t\tconfig: GlobalConfig;\n\t}) => GlobalConfig;\n};\n\nexport type WebServerConfig = {\n\tapiKey?: string;\n\tbaseURL: string;\n\tcacheEndpoint: string;\n};\n\n// export type SEOConfig = Omit<SEOPluginConfig, 'uploadsCollection' | 'tabbedUI'>;\n//\n// export type S3Config = {\n// \tenabled: boolean;\n// \tbucket: string\n// \tconfig: AWS.S3ClientConfig;\n// }\n\nexport type AdminLogoConfig = {\n\tpath: string;\n\tdarkModePath?: string;\n\twidth?: number;\n\theight?: number;\n\talt?: string;\n\tclassName?: string;\n};\n\nexport type AdminIconConfig = {\n\tpath: string;\n\tdarkModePath?: string;\n\twidth?: number;\n\theight?: number;\n\talt?: string;\n\tclassName?: string;\n};\n\nexport type AdminConfig = {\n\tlogo?: AdminLogoConfig;\n\ticon?: AdminIconConfig;\n};\n\nexport type PayloadHelperPluginConfig = {\n\tsiteName: string;\n\tsettings?: SettingsConfig;\n\t// seo?: SEOConfig;\n\twebServer?: WebServerConfig;\n\tadmin?: AdminConfig;\n};\n"],"names":[],"mappings":"AAAA,uEAAuE;AAgDvE,WAME"}
1
+ {"version":3,"sources":["../src/types.ts"],"sourcesContent":["// import type { SEOPluginConfig } from \"@payloadcms/plugin-seo/types\";\nimport type { PartialEmailTheme } from '@ainsleydev/email-templates';\nimport type { GlobalConfig, Tab, TextField, TextareaField, UploadField } from 'payload';\n// import type {SEOPluginConfig} from \"@payloadcms/plugin-seo/dist/types.js\";\n\n/**\n * Configuration for the Settings global.\n */\nexport type SettingsConfig = {\n\t/**\n\t * Additional tabs to add to the Settings global.\n\t */\n\tadditionalTabs?: Tab[];\n\t/**\n\t * Function to override the entire Settings global configuration.\n\t */\n\toverride: (args: {\n\t\tconfig: GlobalConfig;\n\t}) => GlobalConfig;\n};\n\n/**\n * Configuration for web server cache invalidation.\n */\nexport type WebServerConfig = {\n\t/**\n\t * Optional API key for authenticating cache invalidation requests.\n\t */\n\tapiKey?: string;\n\t/**\n\t * Base URL of the web server.\n\t */\n\tbaseURL: string;\n\t/**\n\t * Endpoint path for cache invalidation.\n\t */\n\tcacheEndpoint: string;\n};\n\n// export type SEOConfig = Omit<SEOPluginConfig, 'uploadsCollection' | 'tabbedUI'>;\n//\n// export type S3Config = {\n// \tenabled: boolean;\n// \tbucket: string\n// \tconfig: AWS.S3ClientConfig;\n// }\n\n/**\n * Configuration for the admin panel logo.\n */\nexport type AdminLogoConfig = {\n\t/**\n\t * Path to the logo image file.\n\t */\n\tpath: string;\n\t/**\n\t * Optional path to the dark mode logo image file.\n\t */\n\tdarkModePath?: string;\n\t/**\n\t * Optional width of the logo in pixels.\n\t */\n\twidth?: number;\n\t/**\n\t * Optional height of the logo in pixels.\n\t */\n\theight?: number;\n\t/**\n\t * Optional alt text for the logo image.\n\t */\n\talt?: string;\n\t/**\n\t * Optional CSS class name for the logo.\n\t */\n\tclassName?: string;\n};\n\n/**\n * Configuration for the admin panel icon/favicon.\n */\nexport type AdminIconConfig = {\n\t/**\n\t * Path to the icon image file.\n\t */\n\tpath: string;\n\t/**\n\t * Optional path to the dark mode icon image file.\n\t */\n\tdarkModePath?: string;\n\t/**\n\t * Optional width of the icon in pixels.\n\t */\n\twidth?: number;\n\t/**\n\t * Optional height of the icon in pixels.\n\t */\n\theight?: number;\n\t/**\n\t * Optional alt text for the icon image.\n\t */\n\talt?: string;\n\t/**\n\t * Optional CSS class name for the icon.\n\t */\n\tclassName?: string;\n};\n\n/**\n * Configuration for admin panel customization.\n */\nexport type AdminConfig = {\n\t/**\n\t * Optional logo configuration for the admin panel.\n\t */\n\tlogo?: AdminLogoConfig;\n\t/**\n\t * Optional icon/favicon configuration for the admin panel.\n\t */\n\ticon?: AdminIconConfig;\n};\n\n/**\n * Content overrides for customizing email template text.\n */\nexport type EmailContentOverrides = {\n\t/**\n\t * Optional preview text shown in email clients before opening.\n\t */\n\tpreviewText?: string;\n\t/**\n\t * Optional heading text displayed at the top of the email.\n\t */\n\theading?: string;\n\t/**\n\t * Optional body text content of the email.\n\t */\n\tbodyText?: string;\n\t/**\n\t * Optional button text for the call-to-action button.\n\t */\n\tbuttonText?: string;\n};\n\n/**\n * Configuration for email templates used in authentication flows.\n */\nexport type EmailConfig = {\n\t/**\n\t * Optional front-end URL override for email links. If not provided, uses Payload's serverUrl.\n\t */\n\tfrontEndUrl?: string;\n\n\t/**\n\t * Optional theme customization for email templates (colors, branding, etc.).\n\t */\n\ttheme?: PartialEmailTheme;\n\n\t/**\n\t * Optional content overrides for the forgot password email template.\n\t */\n\tforgotPassword?: EmailContentOverrides;\n\n\t/**\n\t * Optional content overrides for the verify account email template.\n\t */\n\tverifyAccount?: EmailContentOverrides;\n};\n\n/**\n * Main configuration object for the Payload Helper plugin.\n */\nexport type PayloadHelperPluginConfig = {\n\t/**\n\t * The name of the site, used throughout the admin panel and emails.\n\t */\n\tsiteName: string;\n\t/**\n\t * Optional settings global configuration.\n\t */\n\tsettings?: SettingsConfig;\n\t// seo?: SEOConfig;\n\t/**\n\t * Optional web server configuration for cache invalidation.\n\t */\n\twebServer?: WebServerConfig;\n\t/**\n\t * Optional admin panel customization (logo, icon).\n\t */\n\tadmin?: AdminConfig;\n\t/**\n\t * Optional email template configuration for authentication emails.\n\t */\n\temail?: EmailConfig;\n};\n"],"names":[],"mappings":"AAAA,uEAAuE;AAwKvE;;CAEC,GACD,WAsBE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ainsleydev/payload-helper",
3
- "version": "0.0.40",
3
+ "version": "0.1.0",
4
4
  "description": "Payload CMS utilities, collections and global types for ainsley.dev builds",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -23,6 +23,19 @@
23
23
  },
24
24
  "main": "./dist/index.js",
25
25
  "types": "./dist/index.d.ts",
26
+ "exports": {
27
+ ".": {
28
+ "types": "./dist/index.d.ts",
29
+ "import": "./dist/index.js",
30
+ "default": "./dist/index.js"
31
+ },
32
+ "./dist/admin/components/*": {
33
+ "types": "./dist/admin/components/*.d.ts",
34
+ "import": "./dist/admin/components/*.js",
35
+ "default": "./dist/admin/components/*.js"
36
+ },
37
+ "./package.json": "./package.json"
38
+ },
26
39
  "bin": {
27
40
  "payload-helper": "bin.js"
28
41
  },
@@ -39,19 +52,20 @@
39
52
  "dependencies": {
40
53
  "@lexical/headless": "0.38.2",
41
54
  "@lexical/html": "0.38.2",
42
- "@nouance/payload-better-fields-plugin": "^1.4.1",
55
+ "@nouance/payload-better-fields-plugin": "^2.0.2",
43
56
  "@payloadcms/db-sqlite": "3.63.0",
44
57
  "@payloadcms/plugin-form-builder": "3.63.0",
45
58
  "@payloadcms/plugin-seo": "3.63.0",
46
59
  "@payloadcms/richtext-lexical": "3.63.0",
47
60
  "@types/json-schema": "^7.0.15",
48
61
  "chalk": "^5.3.0",
49
- "commander": "^12.1.0",
62
+ "commander": "^14.0.2",
50
63
  "dotenv": "^16.4.5",
51
- "jsdom": "^24.1.1",
52
- "lexical": "0.28.0",
53
- "mime-types": "^2.1.35",
54
- "payload": "3.63.0"
64
+ "jsdom": "^27.2.0",
65
+ "lexical": "0.38.2",
66
+ "mime-types": "^3.0.1",
67
+ "payload": "3.63.0",
68
+ "@ainsleydev/email-templates": "0.0.3"
55
69
  },
56
70
  "peerDependencies": {
57
71
  "@payloadcms/ui": "3.x",
@@ -59,23 +73,22 @@
59
73
  "react": "^18.0.0 || ^19.0.0"
60
74
  },
61
75
  "devDependencies": {
62
- "@jest/globals": "^29.7.0",
63
76
  "@payloadcms/ui": "3.63.0",
64
77
  "@swc/cli": "^0.7.8",
65
78
  "@swc/core": "^1.7.2",
66
- "@types/jest": "^29.5.12",
67
- "@types/jsdom": "^21.1.7",
68
- "@types/mime-types": "^2.1.4",
79
+ "@types/jest": "^30.0.0",
80
+ "@types/jsdom": "^27.0.0",
81
+ "@types/mime-types": "^3.0.1",
69
82
  "@types/node": "^24.10.1",
70
83
  "@types/react": "^18.3.26",
71
- "jest": "^29.7.0",
84
+ "jest": "^30.2.0",
72
85
  "json-schema": "^0.4.0",
73
86
  "next": "^16.0.1",
74
87
  "react": "^19.2.0",
75
88
  "rimraf": "6.1.0",
76
- "ts-jest": "^29.2.3",
77
89
  "ts-node": "^10.9.2",
78
90
  "typescript": "^5.5.4",
91
+ "vitest": "^2.0.5",
79
92
  "@ainsleydev/eslint-config": "0.0.9"
80
93
  },
81
94
  "engines": {
@@ -89,6 +102,6 @@
89
102
  "format": "biome check --write --unsafe .",
90
103
  "lint": "biome lint --write .",
91
104
  "clean": "rimraf {dist,*.tsbuildinfo}",
92
- "test": "jest --passWithNoTests"
105
+ "test": "vitest run"
93
106
  }
94
107
  }
@@ -1,6 +0,0 @@
1
- import type { Config } from 'payload';
2
- import type { AdminIconConfig } from '../types.js';
3
- /**
4
- * Injects the admin Icon component into the Payload config.
5
- */
6
- export declare const injectAdminIcon: (config: Config, iconConfig: AdminIconConfig, siteName: string) => Config;
@@ -1,26 +0,0 @@
1
- /**
2
- * Injects the admin Icon component into the Payload config.
3
- */ export const injectAdminIcon = (config, iconConfig, siteName)=>({
4
- ...config,
5
- admin: {
6
- ...config.admin,
7
- components: {
8
- ...config.admin?.components,
9
- graphics: {
10
- ...config.admin?.components?.graphics,
11
- Icon: {
12
- path: '@ainsleydev/payload-helper/dist/admin/components/Icon',
13
- exportName: 'Icon',
14
- clientProps: {
15
- config: {
16
- ...iconConfig,
17
- alt: iconConfig.alt || siteName
18
- }
19
- }
20
- }
21
- }
22
- }
23
- }
24
- });
25
-
26
- //# sourceMappingURL=icon.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/plugin/icon.ts"],"sourcesContent":["import type { Config } from 'payload';\nimport type { AdminIconConfig } from '../types.js';\n\n/**\n * Injects the admin Icon component into the Payload config.\n */\nexport const injectAdminIcon = (\n\tconfig: Config,\n\ticonConfig: AdminIconConfig,\n\tsiteName: string,\n): Config => ({\n\t...config,\n\tadmin: {\n\t\t...config.admin,\n\t\tcomponents: {\n\t\t\t...config.admin?.components,\n\t\t\tgraphics: {\n\t\t\t\t...config.admin?.components?.graphics,\n\t\t\t\tIcon: {\n\t\t\t\t\tpath: '@ainsleydev/payload-helper/dist/admin/components/Icon',\n\t\t\t\t\texportName: 'Icon',\n\t\t\t\t\tclientProps: {\n\t\t\t\t\t\tconfig: {\n\t\t\t\t\t\t\t...iconConfig,\n\t\t\t\t\t\t\talt: iconConfig.alt || siteName,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t},\n});\n"],"names":["injectAdminIcon","config","iconConfig","siteName","admin","components","graphics","Icon","path","exportName","clientProps","alt"],"mappings":"AAGA;;CAEC,GACD,OAAO,MAAMA,kBAAkB,CAC9BC,QACAC,YACAC,WACa,CAAA;QACb,GAAGF,MAAM;QACTG,OAAO;YACN,GAAGH,OAAOG,KAAK;YACfC,YAAY;gBACX,GAAGJ,OAAOG,KAAK,EAAEC,UAAU;gBAC3BC,UAAU;oBACT,GAAGL,OAAOG,KAAK,EAAEC,YAAYC,QAAQ;oBACrCC,MAAM;wBACLC,MAAM;wBACNC,YAAY;wBACZC,aAAa;4BACZT,QAAQ;gCACP,GAAGC,UAAU;gCACbS,KAAKT,WAAWS,GAAG,IAAIR;4BACxB;wBACD;oBACD;gBACD;YACD;QACD;IACD,CAAA,EAAG"}
@@ -1,6 +0,0 @@
1
- import type { Config } from 'payload';
2
- import type { AdminLogoConfig } from '../types.js';
3
- /**
4
- * Injects the admin Logo component into the Payload config.
5
- */
6
- export declare const injectAdminLogo: (config: Config, logoConfig: AdminLogoConfig, siteName: string) => Config;
@@ -1,26 +0,0 @@
1
- /**
2
- * Injects the admin Logo component into the Payload config.
3
- */ export const injectAdminLogo = (config, logoConfig, siteName)=>({
4
- ...config,
5
- admin: {
6
- ...config.admin,
7
- components: {
8
- ...config.admin?.components,
9
- graphics: {
10
- ...config.admin?.components?.graphics,
11
- Logo: {
12
- path: '@ainsleydev/payload-helper/dist/admin/components/Logo',
13
- exportName: 'Logo',
14
- clientProps: {
15
- config: {
16
- ...logoConfig,
17
- alt: logoConfig.alt || siteName
18
- }
19
- }
20
- }
21
- }
22
- }
23
- }
24
- });
25
-
26
- //# sourceMappingURL=logo.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/plugin/logo.ts"],"sourcesContent":["import type { Config } from 'payload';\nimport type { AdminLogoConfig } from '../types.js';\n\n/**\n * Injects the admin Logo component into the Payload config.\n */\nexport const injectAdminLogo = (\n\tconfig: Config,\n\tlogoConfig: AdminLogoConfig,\n\tsiteName: string,\n): Config => ({\n\t...config,\n\tadmin: {\n\t\t...config.admin,\n\t\tcomponents: {\n\t\t\t...config.admin?.components,\n\t\t\tgraphics: {\n\t\t\t\t...config.admin?.components?.graphics,\n\t\t\t\tLogo: {\n\t\t\t\t\tpath: '@ainsleydev/payload-helper/dist/admin/components/Logo',\n\t\t\t\t\texportName: 'Logo',\n\t\t\t\t\tclientProps: {\n\t\t\t\t\t\tconfig: {\n\t\t\t\t\t\t\t...logoConfig,\n\t\t\t\t\t\t\talt: logoConfig.alt || siteName,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t},\n});\n"],"names":["injectAdminLogo","config","logoConfig","siteName","admin","components","graphics","Logo","path","exportName","clientProps","alt"],"mappings":"AAGA;;CAEC,GACD,OAAO,MAAMA,kBAAkB,CAC9BC,QACAC,YACAC,WACa,CAAA;QACb,GAAGF,MAAM;QACTG,OAAO;YACN,GAAGH,OAAOG,KAAK;YACfC,YAAY;gBACX,GAAGJ,OAAOG,KAAK,EAAEC,UAAU;gBAC3BC,UAAU;oBACT,GAAGL,OAAOG,KAAK,EAAEC,YAAYC,QAAQ;oBACrCC,MAAM;wBACLC,MAAM;wBACNC,YAAY;wBACZC,aAAa;4BACZT,QAAQ;gCACP,GAAGC,UAAU;gCACbS,KAAKT,WAAWS,GAAG,IAAIR;4BACxB;wBACD;oBACD;gBACD;YACD;QACD;IACD,CAAA,EAAG"}