@jhits/plugin-dep 0.0.10 → 0.0.12
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/actions.d.ts.map +1 -1
- package/dist/actions.js +0 -98
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +0 -7
- package/dist/types.d.ts +0 -8
- package/dist/types.d.ts.map +1 -1
- package/package.json +15 -8
- package/src/index.ts +14 -0
package/dist/actions.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../src/actions.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../src/actions.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,QAAQ,EAAe,MAAM,SAAS,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAYvC,wBAAsB,KAAK,CAAC,MAAM,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,GAAG;;;;;;;;;;;GAc9D;AAMD,wBAAsB,cAAc,CAChC,MAAM,EAAE,YAAY,EACpB,IAAI,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,EACvD,MAAM,CAAC,EAAE,MAAM;;;GAkClB;AAED,wBAAsB,YAAY,CAAC,MAAM,EAAE,YAAY,mEAQtD;AAED,wBAAsB,cAAc,CAChC,MAAM,EAAE,YAAY,EACpB,EAAE,EAAE,MAAM,EACV,IAAI,EAAE;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE;;GAS3B;AAED,wBAAsB,cAAc,CAAC,MAAM,EAAE,YAAY,EAAE,EAAE,EAAE,MAAM;;GAKp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,qBAAqB,CAAC,MAAM,EAAE,YAAY,eAK/D;AAED,wBAAsB,wBAAwB,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE;IAAE,SAAS,EAAE,GAAG,CAAA;CAAE;;GAc5F;AAMD,wBAAsB,qBAAqB,CACvC,MAAM,EAAE,YAAY,EACpB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,GAAG,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDxB;AAED,wBAAsB,kBAAkB,CACpC,MAAM,EAAE,YAAY,EACpB,IAAI,EAAE;IAAE,cAAc,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,CAAC;IAAC,GAAG,CAAC,EAAE,OAAO,CAAA;CAAE,EAC3E,MAAM,EAAE,MAAM;;GA8CjB;AAMD,wBAAsB,eAAe,CACjC,MAAM,EAAE,YAAY,EACpB,IAAI,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAAE;;GA2B1D;AAMD,wBAAsB,eAAe,CAAC,MAAM,EAAE,YAAY;;;;;;;;;;;;;;GAuBzD;AAED,wBAAsB,aAAa,CAAC,MAAM,EAAE,YAAY;;;;;;GAmBvD;AAMD,wBAAsB,UAAU;;GAE/B;AAMD,wBAAsB,mBAAmB,CAAC,MAAM,EAAE,YAAY,gBAO7D;AAED,wBAAsB,iBAAiB,CACnC,MAAM,EAAE,YAAY,EACpB,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,GAAG;;GAyChB"}
|
package/dist/actions.js
CHANGED
|
@@ -21,7 +21,6 @@ import bcrypt from 'bcryptjs';
|
|
|
21
21
|
import fs from 'fs';
|
|
22
22
|
import path from 'path';
|
|
23
23
|
import { exec, execSync } from 'child_process';
|
|
24
|
-
import nodemailer from 'nodemailer';
|
|
25
24
|
// ============================================================================
|
|
26
25
|
// AUTH ACTIONS
|
|
27
26
|
// ============================================================================
|
|
@@ -221,9 +220,6 @@ export async function subscribeNewsletter(config, data, host) {
|
|
|
221
220
|
language: data.language || 'en',
|
|
222
221
|
subscribedAt: new Date(),
|
|
223
222
|
});
|
|
224
|
-
if (config.emailConfig) {
|
|
225
|
-
await sendNewsletterWelcomeEmail(config, data.email, data.language, host);
|
|
226
|
-
}
|
|
227
223
|
return { message: 'Success' };
|
|
228
224
|
}
|
|
229
225
|
export async function listSubscribers(config) {
|
|
@@ -474,100 +470,6 @@ export async function triggerDeployment(config, signature, payload) {
|
|
|
474
470
|
// ============================================================================
|
|
475
471
|
// HELPER FUNCTIONS
|
|
476
472
|
// ============================================================================
|
|
477
|
-
async function sendNewsletterWelcomeEmail(config, email, language, host) {
|
|
478
|
-
if (!config.emailConfig)
|
|
479
|
-
return;
|
|
480
|
-
const transporter = nodemailer.createTransport({
|
|
481
|
-
host: config.emailConfig.host,
|
|
482
|
-
port: config.emailConfig.port,
|
|
483
|
-
secure: true,
|
|
484
|
-
auth: {
|
|
485
|
-
user: config.emailConfig.user,
|
|
486
|
-
pass: config.emailConfig.password,
|
|
487
|
-
},
|
|
488
|
-
connectionTimeout: 10000,
|
|
489
|
-
});
|
|
490
|
-
const isDutch = language === 'nl';
|
|
491
|
-
const baseUrl = host
|
|
492
|
-
? (host.includes('localhost') ? 'http' : 'https') + '://' + host
|
|
493
|
-
: config.baseUrl || 'https://bya.jorishummel.com';
|
|
494
|
-
const slugs = {
|
|
495
|
-
sv: '/avmälla',
|
|
496
|
-
nl: '/afmelden',
|
|
497
|
-
en: '/unsubscribe',
|
|
498
|
-
};
|
|
499
|
-
const slug = slugs[language] || slugs.en;
|
|
500
|
-
const unsubscribeUrl = `${baseUrl}${slug}?email=${encodeURIComponent(email)}`;
|
|
501
|
-
const message = isDutch
|
|
502
|
-
? `Bedankt dat je deel uitmaakt van de **Botanics & You** community.\n\n` +
|
|
503
|
-
`Wij geloven dat de natuur alles biedt wat we werkelijk nodig hebben. Terwijl we achter de schermen hard werken aan de lancering, nemen we je graag mee op reis door de wereld van kruiden en natuurlijke vitaliteit.\n\n` +
|
|
504
|
-
`**Wat kun je van ons verwachten:**\n` +
|
|
505
|
-
`• Exclusieve updates over onze lancering\n` +
|
|
506
|
-
`• Inzichten in de kracht van lokale kruiden\n` +
|
|
507
|
-
`• Tips voor een diepere verbinding met de natuur\n\n` +
|
|
508
|
-
`Bedankt voor je geduld en interesse in een natuurlijke manier van leven. We spreken je snel!`
|
|
509
|
-
: `Thank you for joining the **Botanics & You** community.\n\n` +
|
|
510
|
-
`We believe that nature provides everything we truly need. While we work hard behind the scenes for our launch, we look forward to taking you on a journey through the world of herbs and natural vitality.\n\n` +
|
|
511
|
-
`**What to expect from us:**\n` +
|
|
512
|
-
`• Exclusive updates on our upcoming launch\n` +
|
|
513
|
-
`• Insights into the healing properties of local herbs\n` +
|
|
514
|
-
`• Tips for restoring your connection with nature\n\n` +
|
|
515
|
-
`Thank you for your patience and your interest in a more natural way of living. We'll be in touch soon!`;
|
|
516
|
-
const formattedMessage = message
|
|
517
|
-
.replace(/\n/g, '<br/>')
|
|
518
|
-
.replace(/\*\*(.*?)\*\*/g, '<strong>$1</strong>')
|
|
519
|
-
.replace(/• (.*?)(<br\/>|$)/g, '<div style="margin-left: 10px; margin-bottom: 5px;">• $1</div>');
|
|
520
|
-
const html = `
|
|
521
|
-
<!DOCTYPE html>
|
|
522
|
-
<html>
|
|
523
|
-
<head>
|
|
524
|
-
<meta charset="utf-8">
|
|
525
|
-
<style>
|
|
526
|
-
body { background-color: #faf9f6; margin: 0; padding: 0; font-family: 'Georgia', serif; }
|
|
527
|
-
.container { max-width: 600px; margin: 20px auto; background-color: #ffffff; border-radius: 40px; border: 1px solid #1a2e260d; overflow: hidden; }
|
|
528
|
-
.header { padding: 40px 0 20px 0; text-align: center; }
|
|
529
|
-
.logo { width: 180px; height: auto; }
|
|
530
|
-
.content { padding: 0 50px 40px 50px; color: #1a2e26; line-height: 1.8; font-size: 15px; }
|
|
531
|
-
.footer { padding: 40px 50px; text-align: center; font-family: sans-serif; font-size: 10px; color: #a1a1aa; letter-spacing: 1px; border-top: 1px solid #faf9f6; }
|
|
532
|
-
h1 { font-weight: normal; font-style: italic; font-size: 30px; margin-bottom: 30px; color: #1a2e26; text-align: center; }
|
|
533
|
-
.divider { height: 1px; width: 40px; background-color: #1a2e2620; margin: 30px auto; }
|
|
534
|
-
</style>
|
|
535
|
-
</head>
|
|
536
|
-
<body>
|
|
537
|
-
<div class="container">
|
|
538
|
-
<div class="header">
|
|
539
|
-
<img src="cid:botanics-logo" alt="Botanics & You" class="logo">
|
|
540
|
-
</div>
|
|
541
|
-
<div class="content">
|
|
542
|
-
<h1>${isDutch ? 'Fijn dat je er bent' : "We're glad you're here"}</h1>
|
|
543
|
-
<div class="divider"></div>
|
|
544
|
-
<div>${formattedMessage}</div>
|
|
545
|
-
</div>
|
|
546
|
-
<div class="footer">
|
|
547
|
-
<strong>Botanics & You</strong> © ${new Date().getFullYear()}<br/>
|
|
548
|
-
${isDutch ? 'Natuurlijk verbonden' : 'Naturally connected'}<br/><br/>
|
|
549
|
-
<a href="${unsubscribeUrl}" style="color: #a1a1aa; text-decoration: underline;">
|
|
550
|
-
${isDutch ? 'Afmelden' : 'Unsubscribe'}
|
|
551
|
-
</a>
|
|
552
|
-
</div>
|
|
553
|
-
</div>
|
|
554
|
-
</body>
|
|
555
|
-
</html>
|
|
556
|
-
`;
|
|
557
|
-
await transporter.sendMail({
|
|
558
|
-
from: config.emailConfig.from,
|
|
559
|
-
to: email,
|
|
560
|
-
subject: isDutch ? 'Welkom bij Botanics & You' : 'Welcome to Botanics & You',
|
|
561
|
-
html,
|
|
562
|
-
attachments: [
|
|
563
|
-
{
|
|
564
|
-
filename: 'logo.png',
|
|
565
|
-
path: path.join(process.cwd(), 'public/BotanicsYouFull.png'),
|
|
566
|
-
cid: 'botanics-logo',
|
|
567
|
-
},
|
|
568
|
-
],
|
|
569
|
-
});
|
|
570
|
-
}
|
|
571
473
|
async function createNotification(config, title, description, category) {
|
|
572
474
|
try {
|
|
573
475
|
const client = await config.mongoClient;
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH;;GAEG;AACH;;;GAGG;AACH,wBAAgB,eAAe,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH;;GAEG;AACH;;;GAGG;AACH,wBAAgB,eAAe,SAiH9B"}
|
package/dist/config.js
CHANGED
|
@@ -59,13 +59,6 @@ async function getConfig() {
|
|
|
59
59
|
mongoClient: clientPromise,
|
|
60
60
|
jwtSecret: process.env.JWT_SECRET || 'secret',
|
|
61
61
|
authOptions,
|
|
62
|
-
emailConfig: process.env.EMAIL_SERVER_HOST ? {
|
|
63
|
-
host: process.env.EMAIL_SERVER_HOST,
|
|
64
|
-
port: Number(process.env.EMAIL_SERVER_PORT || 465),
|
|
65
|
-
user: process.env.EMAIL_SERVER_USER || '',
|
|
66
|
-
password: process.env.EMAIL_SERVER_PASSWORD || '',
|
|
67
|
-
from: process.env.EMAIL_FROM || '',
|
|
68
|
-
} : undefined,
|
|
69
62
|
baseUrl: process.env.NEXT_PUBLIC_BASE_URL,
|
|
70
63
|
githubWebhookSecret: process.env.GITHUB_WEBHOOK_SECRET,
|
|
71
64
|
deploymentPaths: {
|
package/dist/types.d.ts
CHANGED
|
@@ -10,14 +10,6 @@ export interface DepApiConfig {
|
|
|
10
10
|
jwtSecret: string;
|
|
11
11
|
/** NextAuth auth options (for session-based auth) */
|
|
12
12
|
authOptions?: any;
|
|
13
|
-
/** Email configuration for newsletter */
|
|
14
|
-
emailConfig?: {
|
|
15
|
-
host: string;
|
|
16
|
-
port: number;
|
|
17
|
-
user: string;
|
|
18
|
-
password: string;
|
|
19
|
-
from: string;
|
|
20
|
-
};
|
|
21
13
|
/** Base URL for email links */
|
|
22
14
|
baseUrl?: string;
|
|
23
15
|
/** GitHub webhook secret */
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAGtC,MAAM,WAAW,YAAY;IACzB,6BAA6B;IAC7B,WAAW,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IAClC,wCAAwC;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,qDAAqD;IACrD,WAAW,CAAC,EAAE,GAAG,CAAC;IAClB
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAGtC,MAAM,WAAW,YAAY;IACzB,6BAA6B;IAC7B,WAAW,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IAClC,wCAAwC;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,qDAAqD;IACrD,WAAW,CAAC,EAAE,GAAG,CAAC;IAClB,+BAA+B;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4BAA4B;IAC5B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mCAAmC;IACnC,eAAe,CAAC,EAAE;QACd,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,6BAA6B;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,6BAA6B;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,UAAU;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACjC;AAED,MAAM,WAAW,WAAW;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,GAAG,CAAC;IACV,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACpC;AAED,MAAM,MAAM,UAAU,GAAG,CACrB,GAAG,EAAE,UAAU,EACf,MAAM,EAAE,YAAY,EACpB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAC9B,OAAO,CAAC,WAAW,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,21 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jhits/plugin-dep",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.12",
|
|
4
4
|
"description": "DEPRECATED: Legacy dependencies and shared logic for JHITS (Phase out in progress)",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
8
|
-
"main": "./
|
|
9
|
-
"types": "./
|
|
8
|
+
"main": "./src/index.ts",
|
|
9
|
+
"types": "./src/index.ts",
|
|
10
10
|
"sideEffects": false,
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
13
|
-
"types": "./
|
|
14
|
-
"
|
|
15
|
-
"
|
|
13
|
+
"types": "./src/index.ts",
|
|
14
|
+
"import": "./src/index.ts",
|
|
15
|
+
"react-server": "./src/index.ts",
|
|
16
|
+
"default": "./src/index.ts"
|
|
17
|
+
},
|
|
18
|
+
"./src": {
|
|
19
|
+
"types": "./src/index.ts",
|
|
20
|
+
"import": "./src/index.ts",
|
|
21
|
+
"default": "./src/index.ts"
|
|
16
22
|
},
|
|
17
23
|
"./server": {
|
|
18
24
|
"types": "./dist/index.server.d.ts",
|
|
25
|
+
"import": "./dist/index.server.js",
|
|
19
26
|
"react-server": "./dist/index.server.js",
|
|
20
27
|
"default": "./dist/index.server.js"
|
|
21
28
|
}
|
|
@@ -32,8 +39,8 @@
|
|
|
32
39
|
"@types/bcryptjs": "^3.0.0",
|
|
33
40
|
"@types/jsonwebtoken": "^9.0.10",
|
|
34
41
|
"@types/node": "^25.2.3",
|
|
35
|
-
"@types/nodemailer": "^7.0.
|
|
36
|
-
"@jhits/plugin-core": "0.0.
|
|
42
|
+
"@types/nodemailer": "^7.0.10",
|
|
43
|
+
"@jhits/plugin-core": "0.0.8"
|
|
37
44
|
},
|
|
38
45
|
"peerDependencies": {
|
|
39
46
|
"next": ">=15.0.0"
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin Deprecated - Root Entry Point
|
|
3
|
+
*
|
|
4
|
+
* NOTE: This plugin is SERVER-ONLY and has no client UI.
|
|
5
|
+
*
|
|
6
|
+
* This file exists only to satisfy package.json "main" field requirements.
|
|
7
|
+
* It should NEVER be imported by client code.
|
|
8
|
+
*
|
|
9
|
+
* For server-side usage, ALWAYS import from '@jhits/plugin-dep/server' instead.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
// Empty export - this plugin has no client-side code
|
|
13
|
+
// Importing this will result in an empty module
|
|
14
|
+
// Use '@jhits/plugin-dep/server' for server-side imports
|