@ikonintegration/ikapi 5.0.14 → 5.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.
- package/.github/workflows/npmpublish.yml +3 -3
- package/.github/workflows/prs.yml +1 -1
- package/README.md +1 -2
- package/dist/package-lock.json +3629 -3011
- package/dist/package.json +48 -48
- package/dist/src/BaseEvent/Transaction.d.ts +3 -3
- package/dist/src/BaseEvent/Transaction.js +1 -1
- package/dist/src/BaseEvent/Transaction.js.map +1 -1
- package/dist/src/Cache/Redis.js +18 -9
- package/dist/src/Cache/Redis.js.map +1 -1
- package/dist/src/Mailer/Mailer.d.ts +10 -2
- package/dist/src/Mailer/Mailer.js +30 -9
- package/dist/src/Mailer/Mailer.js.map +1 -1
- package/eslint.config.cjs +97 -0
- package/package.json +48 -48
- package/src/Cache/Redis.ts +18 -9
- package/src/Config/Configuration.ts +1 -1
- package/src/Mailer/Mailer.ts +37 -7
- package/tsconfig.json +12 -7
- package/tsconfig.smoke.json +2 -6
- package/.eslintrc.cjs +0 -82
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ikonintegration/ikapi",
|
|
3
|
-
"version": "5.0
|
|
3
|
+
"version": "5.1.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -19,65 +19,65 @@
|
|
|
19
19
|
"author": "",
|
|
20
20
|
"license": "ISC",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@aws-sdk/client-dynamodb": "^3.
|
|
23
|
-
"@aws-sdk/client-eventbridge": "^3.
|
|
24
|
-
"@aws-sdk/client-kms": "^3.
|
|
25
|
-
"@aws-sdk/client-secrets-manager": "^3.
|
|
26
|
-
"@aws-sdk/client-ses": "^3.
|
|
27
|
-
"@aws-sdk/client-sns": "^3.
|
|
28
|
-
"@aws-sdk/client-ssm": "^3.
|
|
29
|
-
"@aws-sdk/credential-provider-node": "^3.
|
|
30
|
-
"@aws-sdk/util-dynamodb": "^3.
|
|
31
|
-
"@smithy/node-http-handler": "^
|
|
32
|
-
"@types/email-templates": "^10.0.
|
|
33
|
-
"@types/nodemailer": "^
|
|
34
|
-
"@types/object-hash": "^3.0.
|
|
22
|
+
"@aws-sdk/client-dynamodb": "^3.988.0",
|
|
23
|
+
"@aws-sdk/client-eventbridge": "^3.988.0",
|
|
24
|
+
"@aws-sdk/client-kms": "^3.988.0",
|
|
25
|
+
"@aws-sdk/client-secrets-manager": "^3.988.0",
|
|
26
|
+
"@aws-sdk/client-ses": "^3.988.0",
|
|
27
|
+
"@aws-sdk/client-sns": "^3.988.0",
|
|
28
|
+
"@aws-sdk/client-ssm": "^3.988.0",
|
|
29
|
+
"@aws-sdk/credential-provider-node": "^3.972.7",
|
|
30
|
+
"@aws-sdk/util-dynamodb": "^3.988.0",
|
|
31
|
+
"@smithy/node-http-handler": "^4.4.10",
|
|
32
|
+
"@types/email-templates": "^10.0.4",
|
|
33
|
+
"@types/nodemailer": "^7.0.9",
|
|
34
|
+
"@types/object-hash": "^3.0.6",
|
|
35
35
|
"abind": "^1.0.5",
|
|
36
|
-
"cors": "^2.8.
|
|
36
|
+
"cors": "^2.8.6",
|
|
37
37
|
"cuid": "^3.0.0",
|
|
38
|
-
"dotenv": "^
|
|
39
|
-
"email-templates": "^
|
|
40
|
-
"express": "^
|
|
38
|
+
"dotenv": "^17.2.4",
|
|
39
|
+
"email-templates": "^13.0.1",
|
|
40
|
+
"express": "^5.2.1",
|
|
41
41
|
"json-stringify-safe": "^5.0.1",
|
|
42
|
-
"kysely": "^0.
|
|
42
|
+
"kysely": "^0.28.11",
|
|
43
43
|
"node-cache": "^5.1.2",
|
|
44
44
|
"object-hash": "^3.0.0",
|
|
45
|
-
"parse-duration": "^2.1.
|
|
46
|
-
"path-to-regexp": "^8.
|
|
47
|
-
"pg": "^8.
|
|
48
|
-
"redis": "^
|
|
45
|
+
"parse-duration": "^2.1.5",
|
|
46
|
+
"path-to-regexp": "^8.3.0",
|
|
47
|
+
"pg": "^8.18.0",
|
|
48
|
+
"redis": "^5.10.0",
|
|
49
49
|
"sha1": "^1.1.1",
|
|
50
50
|
"stack-trace": "0.0.10",
|
|
51
|
-
"zod": "^3.
|
|
51
|
+
"zod": "^4.3.6"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@go-task/cli": "^3.
|
|
55
|
-
"@jest/globals": "^
|
|
56
|
-
"@types/aws-lambda": "^8.10.
|
|
57
|
-
"@types/chai": "^
|
|
58
|
-
"@types/cors": "^2.8.
|
|
59
|
-
"@types/express": "^
|
|
60
|
-
"@types/jest": "^
|
|
61
|
-
"@types/node": "^
|
|
54
|
+
"@go-task/cli": "^3.48.0",
|
|
55
|
+
"@jest/globals": "^30.2.0",
|
|
56
|
+
"@types/aws-lambda": "^8.10.160",
|
|
57
|
+
"@types/chai": "^5.2.3",
|
|
58
|
+
"@types/cors": "^2.8.19",
|
|
59
|
+
"@types/express": "^5.0.6",
|
|
60
|
+
"@types/jest": "^30.0.0",
|
|
61
|
+
"@types/node": "^25.2.3",
|
|
62
62
|
"@types/path-to-regexp": "^1.7.0",
|
|
63
|
-
"@types/pg": "^8.
|
|
64
|
-
"@types/supertest": "^6.0.
|
|
65
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
66
|
-
"@typescript-eslint/parser": "^
|
|
63
|
+
"@types/pg": "^8.16.0",
|
|
64
|
+
"@types/supertest": "^6.0.3",
|
|
65
|
+
"@typescript-eslint/eslint-plugin": "^8.55.0",
|
|
66
|
+
"@typescript-eslint/parser": "^8.55.0",
|
|
67
67
|
"aws-lambda": "^1.0.7",
|
|
68
|
-
"aws-sdk-client-mock": "^4.
|
|
69
|
-
"chai": "^
|
|
70
|
-
"eslint": "^
|
|
71
|
-
"eslint-config-prettier": "^
|
|
72
|
-
"eslint-plugin-import": "^2.
|
|
73
|
-
"eslint-plugin-prettier": "^5.
|
|
68
|
+
"aws-sdk-client-mock": "^4.1.0",
|
|
69
|
+
"chai": "^6.2.2",
|
|
70
|
+
"eslint": "^9.39.2",
|
|
71
|
+
"eslint-config-prettier": "^10.1.8",
|
|
72
|
+
"eslint-plugin-import": "^2.32.0",
|
|
73
|
+
"eslint-plugin-prettier": "^5.5.5",
|
|
74
74
|
"eslint-plugin-require-extensions": "^0.1.3",
|
|
75
|
-
"jest": "^
|
|
75
|
+
"jest": "^30.2.0",
|
|
76
76
|
"jest-junit": "^16.0.0",
|
|
77
|
-
"prettier": "^3.
|
|
78
|
-
"supertest": "^7.
|
|
79
|
-
"ts-jest": "^29.
|
|
80
|
-
"ts-node": "^10.9.
|
|
81
|
-
"typescript": "^5.
|
|
77
|
+
"prettier": "^3.8.1",
|
|
78
|
+
"supertest": "^7.2.2",
|
|
79
|
+
"ts-jest": "^29.4.6",
|
|
80
|
+
"ts-node": "^10.9.2",
|
|
81
|
+
"typescript": "^5.9.3"
|
|
82
82
|
}
|
|
83
83
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { APIGatewayEvent, Context, DynamoDBStreamEvent, SQSEvent } from 'aws-lambda';
|
|
1
|
+
import type { APIGatewayEvent, Context, DynamoDBStreamEvent, EventBridgeEvent, SQSEvent } from 'aws-lambda';
|
|
2
2
|
import Request from '../API/Request.js';
|
|
3
3
|
import Response, { ResponseErrorType } from '../API/Response.js';
|
|
4
4
|
import type { DatabaseImplType, DatabaseTransactionType, DatabaseType, DbConfig } from '../Database/types.js';
|
|
@@ -95,12 +95,12 @@ export default class Transaction<InputType = never, ResponseInnerType = null, Mi
|
|
|
95
95
|
responseProxy: ((response: Response<ResponseInnerType>) => Promise<void>) | null;
|
|
96
96
|
/**
|
|
97
97
|
* Constructs a new instance of the Transaction class.
|
|
98
|
-
* @param {APIGatewayEvent | SQSEvent | DynamoDBStreamEvent} event - The event object passed to the Lambda function.
|
|
98
|
+
* @param {APIGatewayEvent | SQSEvent | DynamoDBStreamEvent | EventBridgeEvent<string, any>} event - The event object passed to the Lambda function.
|
|
99
99
|
* @param {Context} context - The context object passed to the Lambda function.
|
|
100
100
|
* @param {TransactionConfig} [config] - Optional configuration object for the transaction.
|
|
101
101
|
* @returns None
|
|
102
102
|
*/
|
|
103
|
-
constructor(event: APIGatewayEvent | SQSEvent | DynamoDBStreamEvent, context: Context, config?: TransactionConfig);
|
|
103
|
+
constructor(event: APIGatewayEvent | SQSEvent | DynamoDBStreamEvent | EventBridgeEvent<string, any>, context: Context, config?: TransactionConfig);
|
|
104
104
|
/**
|
|
105
105
|
* Executes a transaction using the provided execution function and returns a promise
|
|
106
106
|
* that resolves to the response or miscellaneous response.
|
|
@@ -22,7 +22,7 @@ import Publisher from '../Publisher/Publisher.js';
|
|
|
22
22
|
export default class Transaction {
|
|
23
23
|
/**
|
|
24
24
|
* Constructs a new instance of the Transaction class.
|
|
25
|
-
* @param {APIGatewayEvent | SQSEvent | DynamoDBStreamEvent} event - The event object passed to the Lambda function.
|
|
25
|
+
* @param {APIGatewayEvent | SQSEvent | DynamoDBStreamEvent | EventBridgeEvent<string, any>} event - The event object passed to the Lambda function.
|
|
26
26
|
* @param {Context} context - The context object passed to the Lambda function.
|
|
27
27
|
* @param {TransactionConfig} [config] - Optional configuration object for the transaction.
|
|
28
28
|
* @returns None
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Transaction.js","sourceRoot":"","sources":["../../../src/BaseEvent/Transaction.ts"],"names":[],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"Transaction.js","sourceRoot":"","sources":["../../../src/BaseEvent/Transaction.ts"],"names":[],"mappings":";;;;;;;;;AAQA,OAAO,OAAO,MAAM,mBAAmB,CAAA;AACvC,OAAO,QAA+B,MAAM,oBAAoB,CAAA;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAQhE,OAAO,OAAO,MAAM,eAAe,CAAA;AACnC,OAAO,MAAwB,MAAM,qBAAqB,CA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C,CAAA;gBAC9D,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;gBACxB,SAAS;gBACT,IAAI,IAAI,CAAC,YAAY;oBAAE,MAAM,CAAC,CAAA;YAChC,CAAC;QACH,CAAC;KAAA;IAED;;;;;OAKG;IACW,kBAAkB,CAAC,aAAa;;YAC5C,IAAI,CAAC;gBACH,MAAM,aAAa,EAAE,CAAA;YACvB,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACX,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAA;gBAClD,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAA;gBACxB,SAAS;gBACT,IAAI,IAAI,CAAC,YAAY;oBAAE,MAAM,CAAC,CAAA;YAChC,CAAC;oBAAS,CAAC;gBACT,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAA;YACxC,CAAC;QACH,CAAC;KAAA;IAED;;;;;OAKG;IACO,gBAAgB,CAAC,KAAa,EAAE,IAAY;QACpD,OAAO,QAAQ,CAAC,8BAA8B,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;IAC7D,CAAC;CACF"}
|
package/dist/src/Cache/Redis.js
CHANGED
|
@@ -35,11 +35,16 @@ class Redis {
|
|
|
35
35
|
static redisClientConnection(config) {
|
|
36
36
|
return __awaiter(this, void 0, void 0, function* () {
|
|
37
37
|
console.debug('Starting remote client cache connection');
|
|
38
|
-
const connection = _a.ClientFactory(Object.assign(Object.assign({ username: config.username }, (config.password ? { password: config.password } : {})), { disableOfflineQueue: true, socket:
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
const connection = _a.ClientFactory(Object.assign(Object.assign({ username: config.username }, (config.password ? { password: config.password } : {})), { disableOfflineQueue: true, socket: config.enableTLS
|
|
39
|
+
? {
|
|
40
|
+
host: config.hostname,
|
|
41
|
+
tls: true,
|
|
42
|
+
connectTimeout: 10000,
|
|
43
|
+
}
|
|
44
|
+
: {
|
|
45
|
+
host: config.hostname,
|
|
46
|
+
connectTimeout: 10000,
|
|
47
|
+
} }));
|
|
43
48
|
yield connection.connect();
|
|
44
49
|
return connection;
|
|
45
50
|
});
|
|
@@ -48,10 +53,14 @@ class Redis {
|
|
|
48
53
|
return __awaiter(this, void 0, void 0, function* () {
|
|
49
54
|
console.debug('Starting remote cluster cache connection');
|
|
50
55
|
const connection = _a.ClusterFactory({
|
|
51
|
-
defaults: Object.assign(Object.assign({ username: config.username }, (config.password ? { password: config.password } : {})), { socket:
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
56
|
+
defaults: Object.assign(Object.assign({ username: config.username }, (config.password ? { password: config.password } : {})), { socket: config.enableTLS
|
|
57
|
+
? {
|
|
58
|
+
tls: true,
|
|
59
|
+
connectTimeout: 10000,
|
|
60
|
+
}
|
|
61
|
+
: {
|
|
62
|
+
connectTimeout: 10000,
|
|
63
|
+
} }),
|
|
55
64
|
rootNodes: [
|
|
56
65
|
{
|
|
57
66
|
url: `redis://${config.username}:${config.username}@${config.hostname}:6379`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Redis.js","sourceRoot":"","sources":["../../../src/Cache/Redis.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAqC,aAAa,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAGtF,OAAO,cAAc,MAAM,2BAA2B,CAAA;AACtD;;GAEG;AACH,MAAqB,KAAK;IAkBjB,MAAM,CAAC,UAAU,CACtB,MAA4B;QAE5B,OAAO,EAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;IACzC,CAAC;IAEO,MAAM,CAAO,iBAAiB,CACpC,MAA4B;;YAE5B,IAAI,MAAM,CAAC,WAAW;gBAAE,OAAO,EAAK,CAAC,sBAAsB,CAAC,MAAM,CAAC,CAAA;;gBAC9D,OAAO,EAAK,CA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AM,CAAC,EAAC,EAAE,kDAAC,OAAA,CAAC,CAAC,MAAM,CAAA,GAAA,CAAC,AAHvB,CAGuB;AAE/C;;;GAGG;AACY,mBAAa,GAAG,YAAY,AAAf,CAAe;AAE3C;;;GAGG;AACY,oBAAc,GAAG,aAAa,AAAhB,CAAgB;eAhB1B,KAAK"}
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import Email from 'email-templates';
|
|
2
|
+
export declare class MailerRenderError extends Error {
|
|
3
|
+
readonly cause?: unknown | undefined;
|
|
4
|
+
constructor(message: string, cause?: unknown | undefined);
|
|
5
|
+
}
|
|
6
|
+
export declare class MailerSendError extends Error {
|
|
7
|
+
readonly cause?: unknown | undefined;
|
|
8
|
+
constructor(message: string, cause?: unknown | undefined);
|
|
9
|
+
}
|
|
2
10
|
export default class Mailer {
|
|
3
11
|
/**
|
|
4
12
|
* The starting point of a range.
|
|
@@ -32,7 +40,7 @@ export default class Mailer {
|
|
|
32
40
|
* @param {string} [optionalReplyTo] - The optional reply-to address for the email.
|
|
33
41
|
* @param {any[]} [optionalAttachments] - The optional attachments to include
|
|
34
42
|
*/
|
|
35
|
-
sendRawEmail(to: string | Array<string>, htmlMessage: string, subject: string, optionalCC?: string | Array<string>, optionalFrom?: string, optionalReplyTo?: string, optionalAttachments?: any[], optionalTransport?: Email.NodeMailerTransportOptions): Promise<
|
|
43
|
+
sendRawEmail(to: string | Array<string>, htmlMessage: string, subject: string, optionalCC?: string | Array<string>, optionalFrom?: string, optionalReplyTo?: string, optionalAttachments?: any[], optionalTransport?: Email.NodeMailerTransportOptions): Promise<any>;
|
|
36
44
|
/**
|
|
37
45
|
* Sends a templated email to the specified recipients.
|
|
38
46
|
* @param {string | Array<string>} to - The email address(es) of the recipient(s).
|
|
@@ -44,7 +52,7 @@ export default class Mailer {
|
|
|
44
52
|
* @param {any[]} [optionalAttachments] - An array
|
|
45
53
|
* @param {Record<string, string>} [optionalHeaders] - Optional headers to be added to the message. Passed in a key value object.
|
|
46
54
|
*/
|
|
47
|
-
sendTemplatedEmail(to: string | Array<string>, templates: string | Array<string>, data: object, optionalCC?: string | Array<string>, optionalFrom?: string, optionalReplyTo?: string, optionalAttachments?: any[], optionalHeaders?: Record<string, string>, optionalTransport?: Email.NodeMailerTransportOptions): Promise<
|
|
55
|
+
sendTemplatedEmail(to: string | Array<string>, templates: string | Array<string>, data: object, optionalCC?: string | Array<string>, optionalFrom?: string, optionalReplyTo?: string, optionalAttachments?: any[], optionalHeaders?: Record<string, string>, optionalTransport?: Email.NodeMailerTransportOptions): Promise<any>;
|
|
48
56
|
/**
|
|
49
57
|
* Creates a new SMTP transporter for sending emails using NodeMailer.
|
|
50
58
|
* @param {string} host - The SMTP server host.
|
|
@@ -12,6 +12,20 @@ import * as SES from '@aws-sdk/client-ses';
|
|
|
12
12
|
import { defaultProvider } from '@aws-sdk/credential-provider-node';
|
|
13
13
|
import Email from 'email-templates';
|
|
14
14
|
import nodemailer from 'nodemailer';
|
|
15
|
+
export class MailerRenderError extends Error {
|
|
16
|
+
constructor(message, cause) {
|
|
17
|
+
super(message);
|
|
18
|
+
this.cause = cause;
|
|
19
|
+
this.name = 'MailerRenderError';
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export class MailerSendError extends Error {
|
|
23
|
+
constructor(message, cause) {
|
|
24
|
+
super(message);
|
|
25
|
+
this.cause = cause;
|
|
26
|
+
this.name = 'MailerSendError';
|
|
27
|
+
}
|
|
28
|
+
}
|
|
15
29
|
export default class Mailer {
|
|
16
30
|
/**
|
|
17
31
|
* Constructs a new instance of the EmailSender class.
|
|
@@ -28,12 +42,12 @@ export default class Mailer {
|
|
|
28
42
|
this.from = defaultFrom;
|
|
29
43
|
this.transporter = nodemailer.createTransport({
|
|
30
44
|
SES: {
|
|
31
|
-
|
|
45
|
+
sesClient: new SES.SESClient({
|
|
32
46
|
credentials: defaultProvider(),
|
|
33
47
|
apiVersion: '2010-12-01',
|
|
34
48
|
region,
|
|
35
49
|
}),
|
|
36
|
-
|
|
50
|
+
SendEmailCommand: SES.SendEmailCommand,
|
|
37
51
|
},
|
|
38
52
|
});
|
|
39
53
|
}
|
|
@@ -61,11 +75,11 @@ export default class Mailer {
|
|
|
61
75
|
let resp = null;
|
|
62
76
|
try {
|
|
63
77
|
resp = yield email.send();
|
|
64
|
-
console.debug('Mailer resp:', resp);
|
|
78
|
+
console.debug('Mailer resp suppressed due to raw size:', typeof resp === 'object' ? resp === null || resp === void 0 ? void 0 : resp.messageId : 'resp not recognized');
|
|
65
79
|
}
|
|
66
80
|
catch (e) {
|
|
67
81
|
console.error('Mailer error:', e);
|
|
68
|
-
throw e;
|
|
82
|
+
throw new MailerSendError('Failed to send raw email', e);
|
|
69
83
|
}
|
|
70
84
|
return resp;
|
|
71
85
|
});
|
|
@@ -93,14 +107,21 @@ export default class Mailer {
|
|
|
93
107
|
});
|
|
94
108
|
//
|
|
95
109
|
let resp = null;
|
|
110
|
+
let chosenTemplate;
|
|
111
|
+
try {
|
|
112
|
+
chosenTemplate = yield this.chooseTemplate(templates, data);
|
|
113
|
+
}
|
|
114
|
+
catch (e) {
|
|
115
|
+
console.error('Mailer template rendering error:', e);
|
|
116
|
+
throw new MailerRenderError(`Failed to render template: ${Array.isArray(templates) ? templates.join(', ') : templates}`, e);
|
|
117
|
+
}
|
|
96
118
|
try {
|
|
97
|
-
const chosenTemplate = yield this.chooseTemplate(templates, data);
|
|
98
119
|
resp = yield email.send({ template: chosenTemplate, locals: data });
|
|
99
|
-
console.debug('Mailer resp:', resp);
|
|
120
|
+
console.debug('Mailer resp suppressed due to raw size:', typeof resp === 'object' ? resp === null || resp === void 0 ? void 0 : resp.messageId : 'resp not recognized');
|
|
100
121
|
}
|
|
101
122
|
catch (e) {
|
|
102
|
-
console.error('Mailer error:', e);
|
|
103
|
-
throw e;
|
|
123
|
+
console.error('Mailer send error:', e);
|
|
124
|
+
throw new MailerSendError('Failed to send templated email', e);
|
|
104
125
|
}
|
|
105
126
|
return resp;
|
|
106
127
|
});
|
|
@@ -145,7 +166,7 @@ export default class Mailer {
|
|
|
145
166
|
if (yield this.canRenderTemplate(templates, data))
|
|
146
167
|
return templates;
|
|
147
168
|
}
|
|
148
|
-
throw new
|
|
169
|
+
throw new MailerRenderError(`Could not render email with template ${templates} and following data. Please, check logs above! ` +
|
|
149
170
|
JSON.stringify(data, null, 2));
|
|
150
171
|
});
|
|
151
172
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Mailer.js","sourceRoot":"","sources":["../../../src/Mailer/Mailer.ts"],"names":[],"mappings":";;;;;;;;;AAAA,sCAAsC;AACtC,OAAO,KAAK,GAAG,MAAM,qBAAqB,CAAA;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,KAAK,MAAM,iBAAiB,CAAA;AACnC,OAAO,UAAU,MAAM,YAAY,CAAA;AAGnC,MAAM,CAAC,OAAO,OAAO,MAAM;IAmBzB;;;;;OAKG;IACH,YAAY,WAAmB,EAAE,MAAc;QAnB/C;;;WAGG;QACc,wBAAmB,GAAW,MAAM,CAAA;QAgBnD,IAAI,CAAC,IAAI,GAAG,WAAW,CAAA;QACvB,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC,eAAe,CAAC;YAC5C,GAAG,EAAE;gBACH,
|
|
1
|
+
{"version":3,"file":"Mailer.js","sourceRoot":"","sources":["../../../src/Mailer/Mailer.ts"],"names":[],"mappings":";;;;;;;;;AAAA,sCAAsC;AACtC,OAAO,KAAK,GAAG,MAAM,qBAAqB,CAAA;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,KAAK,MAAM,iBAAiB,CAAA;AACnC,OAAO,UAAU,MAAM,YAAY,CAAA;AAGnC,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IAC1C,YACE,OAAe,EACC,KAAe;QAE/B,KAAK,CAAC,OAAO,CAAC,CAAA;QAFE,UAAK,GAAL,KAAK,CAAU;QAG/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I,MAAM,CAAO,cAAc,CAAC,QAAgB,EAAE,IAAY;;YAC/D,IAAI,eAAe,GAAkB,IAAI,CAAA;YACzC,IAAI,CAAC;gBACH,MAAM,KAAK,GAAG,IAAI,KAAK,EAAE,CAAA;gBACzB,eAAe,GAAG,MAAM,KAAK,CAAC,MAAM,CAAC,GAAG,QAAQ,EAAE,EAAE,IAAI,CAAC,CAAA;YAC3D,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACX,OAAO,CAAC,GAAG,CAAC,wDAAwD,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAA;YACpF,CAAC;YACD,OAAO,eAAe,CAAA;QACxB,CAAC;KAAA;CACF"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
const { fixupConfigRules, fixupPluginRules } = require('@eslint/compat')
|
|
2
|
+
const { FlatCompat } = require('@eslint/eslintrc')
|
|
3
|
+
const js = require('@eslint/js')
|
|
4
|
+
const typescriptEslint = require('@typescript-eslint/eslint-plugin')
|
|
5
|
+
const tsParser = require('@typescript-eslint/parser')
|
|
6
|
+
const { defineConfig, globalIgnores } = require('eslint/config')
|
|
7
|
+
const prettier = require('eslint-plugin-prettier')
|
|
8
|
+
const requireExtensions = require('eslint-plugin-require-extensions')
|
|
9
|
+
const globals = require('globals')
|
|
10
|
+
|
|
11
|
+
const compat = new FlatCompat({
|
|
12
|
+
baseDirectory: __dirname,
|
|
13
|
+
recommendedConfig: js.configs.recommended,
|
|
14
|
+
allConfig: js.configs.all,
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
module.exports = defineConfig([
|
|
18
|
+
{
|
|
19
|
+
extends: fixupConfigRules(
|
|
20
|
+
compat.extends(
|
|
21
|
+
'eslint:recommended',
|
|
22
|
+
'plugin:@typescript-eslint/recommended',
|
|
23
|
+
'plugin:prettier/recommended',
|
|
24
|
+
'plugin:import/recommended',
|
|
25
|
+
'plugin:import/typescript',
|
|
26
|
+
'plugin:require-extensions/recommended',
|
|
27
|
+
'prettier'
|
|
28
|
+
)
|
|
29
|
+
),
|
|
30
|
+
|
|
31
|
+
languageOptions: {
|
|
32
|
+
parser: tsParser,
|
|
33
|
+
|
|
34
|
+
globals: {
|
|
35
|
+
...globals.node,
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
plugins: {
|
|
40
|
+
'@typescript-eslint': fixupPluginRules(typescriptEslint),
|
|
41
|
+
prettier: fixupPluginRules(prettier),
|
|
42
|
+
'require-extensions': fixupPluginRules(requireExtensions),
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
rules: {
|
|
46
|
+
'import/extensions': ['error', 'always'],
|
|
47
|
+
|
|
48
|
+
'prettier/prettier': [
|
|
49
|
+
0,
|
|
50
|
+
{
|
|
51
|
+
tabWidth: 2,
|
|
52
|
+
useTabs: false,
|
|
53
|
+
bracketSameLine: false,
|
|
54
|
+
semi: false,
|
|
55
|
+
arrowParens: 'avoid',
|
|
56
|
+
jsxSingleQuote: true,
|
|
57
|
+
printWidth: 120,
|
|
58
|
+
singleQuote: true,
|
|
59
|
+
quoteProps: 'as-needed',
|
|
60
|
+
htmlWhitespaceSensitivity: 'css',
|
|
61
|
+
proseWrap: 'preserve',
|
|
62
|
+
bracketSpacing: true,
|
|
63
|
+
embeddedLanguageFormatting: 'auto',
|
|
64
|
+
endOfLine: 'lf',
|
|
65
|
+
trailingComma: 'es5',
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
|
|
69
|
+
'@typescript-eslint/ban-ts-comment': 0,
|
|
70
|
+
'import/no-named-as-default-member': 0,
|
|
71
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
|
72
|
+
'@typescript-eslint/no-empty-object-type': 'off',
|
|
73
|
+
|
|
74
|
+
'import/no-unresolved': [
|
|
75
|
+
'error',
|
|
76
|
+
{
|
|
77
|
+
ignore: ['\\.js$'],
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
|
|
81
|
+
'import/order': [
|
|
82
|
+
'error',
|
|
83
|
+
{
|
|
84
|
+
groups: ['builtin', 'external', 'internal', ['sibling', 'parent'], 'index', 'unknown'],
|
|
85
|
+
|
|
86
|
+
'newlines-between': 'always',
|
|
87
|
+
|
|
88
|
+
alphabetize: {
|
|
89
|
+
order: 'asc',
|
|
90
|
+
caseInsensitive: true,
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
],
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
globalIgnores(['**/node_modules', '**/dist', '**/build', 'eslint.config.cjs']),
|
|
97
|
+
])
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ikonintegration/ikapi",
|
|
3
|
-
"version": "5.0
|
|
3
|
+
"version": "5.1.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -19,65 +19,65 @@
|
|
|
19
19
|
"author": "",
|
|
20
20
|
"license": "ISC",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@aws-sdk/client-dynamodb": "^3.
|
|
23
|
-
"@aws-sdk/client-eventbridge": "^3.
|
|
24
|
-
"@aws-sdk/client-kms": "^3.
|
|
25
|
-
"@aws-sdk/client-secrets-manager": "^3.
|
|
26
|
-
"@aws-sdk/client-ses": "^3.
|
|
27
|
-
"@aws-sdk/client-sns": "^3.
|
|
28
|
-
"@aws-sdk/client-ssm": "^3.
|
|
29
|
-
"@aws-sdk/credential-provider-node": "^3.
|
|
30
|
-
"@aws-sdk/util-dynamodb": "^3.
|
|
31
|
-
"@smithy/node-http-handler": "^
|
|
32
|
-
"@types/email-templates": "^10.0.
|
|
33
|
-
"@types/nodemailer": "^
|
|
34
|
-
"@types/object-hash": "^3.0.
|
|
22
|
+
"@aws-sdk/client-dynamodb": "^3.988.0",
|
|
23
|
+
"@aws-sdk/client-eventbridge": "^3.988.0",
|
|
24
|
+
"@aws-sdk/client-kms": "^3.988.0",
|
|
25
|
+
"@aws-sdk/client-secrets-manager": "^3.988.0",
|
|
26
|
+
"@aws-sdk/client-ses": "^3.988.0",
|
|
27
|
+
"@aws-sdk/client-sns": "^3.988.0",
|
|
28
|
+
"@aws-sdk/client-ssm": "^3.988.0",
|
|
29
|
+
"@aws-sdk/credential-provider-node": "^3.972.7",
|
|
30
|
+
"@aws-sdk/util-dynamodb": "^3.988.0",
|
|
31
|
+
"@smithy/node-http-handler": "^4.4.10",
|
|
32
|
+
"@types/email-templates": "^10.0.4",
|
|
33
|
+
"@types/nodemailer": "^7.0.9",
|
|
34
|
+
"@types/object-hash": "^3.0.6",
|
|
35
35
|
"abind": "^1.0.5",
|
|
36
|
-
"cors": "^2.8.
|
|
36
|
+
"cors": "^2.8.6",
|
|
37
37
|
"cuid": "^3.0.0",
|
|
38
|
-
"dotenv": "^
|
|
39
|
-
"email-templates": "^
|
|
40
|
-
"express": "^
|
|
38
|
+
"dotenv": "^17.2.4",
|
|
39
|
+
"email-templates": "^13.0.1",
|
|
40
|
+
"express": "^5.2.1",
|
|
41
41
|
"json-stringify-safe": "^5.0.1",
|
|
42
|
-
"kysely": "^0.
|
|
42
|
+
"kysely": "^0.28.11",
|
|
43
43
|
"node-cache": "^5.1.2",
|
|
44
44
|
"object-hash": "^3.0.0",
|
|
45
|
-
"parse-duration": "^2.1.
|
|
46
|
-
"path-to-regexp": "^8.
|
|
47
|
-
"pg": "^8.
|
|
48
|
-
"redis": "^
|
|
45
|
+
"parse-duration": "^2.1.5",
|
|
46
|
+
"path-to-regexp": "^8.3.0",
|
|
47
|
+
"pg": "^8.18.0",
|
|
48
|
+
"redis": "^5.10.0",
|
|
49
49
|
"sha1": "^1.1.1",
|
|
50
50
|
"stack-trace": "0.0.10",
|
|
51
|
-
"zod": "^3.
|
|
51
|
+
"zod": "^4.3.6"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@go-task/cli": "^3.
|
|
55
|
-
"@jest/globals": "^
|
|
56
|
-
"@types/aws-lambda": "^8.10.
|
|
57
|
-
"@types/chai": "^
|
|
58
|
-
"@types/cors": "^2.8.
|
|
59
|
-
"@types/express": "^
|
|
60
|
-
"@types/jest": "^
|
|
61
|
-
"@types/node": "^
|
|
54
|
+
"@go-task/cli": "^3.48.0",
|
|
55
|
+
"@jest/globals": "^30.2.0",
|
|
56
|
+
"@types/aws-lambda": "^8.10.160",
|
|
57
|
+
"@types/chai": "^5.2.3",
|
|
58
|
+
"@types/cors": "^2.8.19",
|
|
59
|
+
"@types/express": "^5.0.6",
|
|
60
|
+
"@types/jest": "^30.0.0",
|
|
61
|
+
"@types/node": "^25.2.3",
|
|
62
62
|
"@types/path-to-regexp": "^1.7.0",
|
|
63
|
-
"@types/pg": "^8.
|
|
64
|
-
"@types/supertest": "^6.0.
|
|
65
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
66
|
-
"@typescript-eslint/parser": "^
|
|
63
|
+
"@types/pg": "^8.16.0",
|
|
64
|
+
"@types/supertest": "^6.0.3",
|
|
65
|
+
"@typescript-eslint/eslint-plugin": "^8.55.0",
|
|
66
|
+
"@typescript-eslint/parser": "^8.55.0",
|
|
67
67
|
"aws-lambda": "^1.0.7",
|
|
68
|
-
"aws-sdk-client-mock": "^4.
|
|
69
|
-
"chai": "^
|
|
70
|
-
"eslint": "^
|
|
71
|
-
"eslint-config-prettier": "^
|
|
72
|
-
"eslint-plugin-import": "^2.
|
|
73
|
-
"eslint-plugin-prettier": "^5.
|
|
68
|
+
"aws-sdk-client-mock": "^4.1.0",
|
|
69
|
+
"chai": "^6.2.2",
|
|
70
|
+
"eslint": "^9.39.2",
|
|
71
|
+
"eslint-config-prettier": "^10.1.8",
|
|
72
|
+
"eslint-plugin-import": "^2.32.0",
|
|
73
|
+
"eslint-plugin-prettier": "^5.5.5",
|
|
74
74
|
"eslint-plugin-require-extensions": "^0.1.3",
|
|
75
|
-
"jest": "^
|
|
75
|
+
"jest": "^30.2.0",
|
|
76
76
|
"jest-junit": "^16.0.0",
|
|
77
|
-
"prettier": "^3.
|
|
78
|
-
"supertest": "^7.
|
|
79
|
-
"ts-jest": "^29.
|
|
80
|
-
"ts-node": "^10.9.
|
|
81
|
-
"typescript": "^5.
|
|
77
|
+
"prettier": "^3.8.1",
|
|
78
|
+
"supertest": "^7.2.2",
|
|
79
|
+
"ts-jest": "^29.4.6",
|
|
80
|
+
"ts-node": "^10.9.2",
|
|
81
|
+
"typescript": "^5.9.3"
|
|
82
82
|
}
|
|
83
83
|
}
|
package/src/Cache/Redis.ts
CHANGED
|
@@ -51,11 +51,16 @@ export default class Redis {
|
|
|
51
51
|
username: config.username,
|
|
52
52
|
...(config.password ? { password: config.password } : {}),
|
|
53
53
|
disableOfflineQueue: true,
|
|
54
|
-
socket:
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
54
|
+
socket: config.enableTLS
|
|
55
|
+
? {
|
|
56
|
+
host: config.hostname,
|
|
57
|
+
tls: true,
|
|
58
|
+
connectTimeout: 10000,
|
|
59
|
+
}
|
|
60
|
+
: {
|
|
61
|
+
host: config.hostname,
|
|
62
|
+
connectTimeout: 10000,
|
|
63
|
+
},
|
|
59
64
|
})
|
|
60
65
|
await connection.connect()
|
|
61
66
|
|
|
@@ -70,10 +75,14 @@ export default class Redis {
|
|
|
70
75
|
defaults: {
|
|
71
76
|
username: config.username,
|
|
72
77
|
...(config.password ? { password: config.password } : {}),
|
|
73
|
-
socket:
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
78
|
+
socket: config.enableTLS
|
|
79
|
+
? {
|
|
80
|
+
tls: true,
|
|
81
|
+
connectTimeout: 10000,
|
|
82
|
+
}
|
|
83
|
+
: {
|
|
84
|
+
connectTimeout: 10000,
|
|
85
|
+
},
|
|
77
86
|
},
|
|
78
87
|
rootNodes: [
|
|
79
88
|
{
|