@creator.co/wapi 1.8.4 → 1.8.6
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/README.md +2 -0
- package/dist/index.d.ts +9 -4
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/dist/package-lock.json +258 -46
- package/dist/package.json +4 -2
- package/dist/src/Logger/Logger.js +3 -2
- package/dist/src/Logger/Logger.js.map +1 -1
- package/dist/src/Server/Router.d.ts +51 -0
- package/dist/src/Server/Router.js.map +1 -1
- package/dist/src/Server/lib/container/Proxy.d.ts +14 -0
- package/dist/src/Server/lib/container/Proxy.js +70 -0
- package/dist/src/Server/lib/container/Proxy.js.map +1 -1
- package/index.ts +17 -3
- package/package.json +4 -2
- package/src/Logger/Logger.ts +4 -2
- package/src/Server/Router.ts +54 -0
- package/src/Server/lib/container/Proxy.ts +83 -1
- package/tests/Server/lib/container/RateLimit.test.ts +772 -0
package/README.md
CHANGED
|
@@ -44,6 +44,8 @@ AWS Lambda Functionality: Deploy your code as AWS Lambda functions with ease, pr
|
|
|
44
44
|
|
|
45
45
|
Hybrid HTTP Servers: Create hybrid HTTP servers that seamlessly combine serverless and container-based architectures, allowing deployment in various environments.
|
|
46
46
|
|
|
47
|
+
**Rate Limiting:** Built-in support for request rate limiting to prevent API abuse and protect downstream services. Supports both in-memory and Redis-backed stores for distributed deployments.
|
|
48
|
+
|
|
47
49
|
Crypto Utilities: WAPI provides utility classes for cryptographic operations, including encryption and decryption using AWS KMS. Securely manage sensitive data with ease.
|
|
48
50
|
|
|
49
51
|
Email Sending: The Mailer class simplifies sending emails using AWS SES. Send both raw and templated emails with customizable parameters, enhancing communication capabilities.
|
package/dist/index.d.ts
CHANGED
|
@@ -10,14 +10,14 @@ import Crypto from './src/Crypto/Crypto.js';
|
|
|
10
10
|
import JWT from './src/Crypto/JWT.js';
|
|
11
11
|
import * as Database from './src/Database/index.js';
|
|
12
12
|
import Mailer from './src/Mailer/Mailer.js';
|
|
13
|
-
import Router, { Route } from './src/Server/Router.js';
|
|
13
|
+
import Router, { Route, RateLimitConfig, GlobalRateLimitConfig, RouterConfig } from './src/Server/Router.js';
|
|
14
14
|
import AsyncSingleton from './src/Util/AsyncSingleton.js';
|
|
15
15
|
import Utils from './src/Util/Utils.js';
|
|
16
16
|
/**
|
|
17
17
|
* This module exports various classes and utilities for handling transactions, processes, events,
|
|
18
18
|
* DynamoDB transactions, routing, mailing, cryptography, JWT, configuration, Redis, responses,
|
|
19
19
|
* utilities, asynchronous singletons, routes, transaction configurations, response error types,
|
|
20
|
-
* HTTP methods, and
|
|
20
|
+
* HTTP methods, database operations, and rate limiting configurations.
|
|
21
21
|
*
|
|
22
22
|
* Classes:
|
|
23
23
|
* - Transaction
|
|
@@ -35,10 +35,15 @@ import Utils from './src/Util/Utils.js';
|
|
|
35
35
|
* - AsyncSingleton
|
|
36
36
|
* - Route
|
|
37
37
|
* - TransactionConfig
|
|
38
|
+
* - RouterConfig
|
|
38
39
|
* - Database
|
|
39
40
|
*
|
|
41
|
+
* Types:
|
|
42
|
+
* - RateLimitConfig - Route-level rate limiting configuration
|
|
43
|
+
* - GlobalRateLimitConfig - Global rate limiting configuration
|
|
44
|
+
*
|
|
40
45
|
* Enums:
|
|
41
46
|
* - ResponseErrorType
|
|
42
|
-
* -
|
|
47
|
+
* - HttpMethod
|
|
43
48
|
*/
|
|
44
|
-
export { Transaction, Process, EventProcessor, DynamoTransaction, Router, Mailer, Crypto, JWT, Configuration, Redis, Response, Utils, AsyncSingleton, Route, TransactionConfig, ResponseErrorType, HttpMethod, Database, };
|
|
49
|
+
export { Transaction, Process, EventProcessor, DynamoTransaction, Router, Mailer, Crypto, JWT, Configuration, Redis, Response, Utils, AsyncSingleton, Route, TransactionConfig, RouterConfig, RateLimitConfig, GlobalRateLimitConfig, ResponseErrorType, HttpMethod, Database, };
|
package/dist/index.js
CHANGED
|
@@ -17,7 +17,7 @@ import Utils from './src/Util/Utils.js';
|
|
|
17
17
|
* This module exports various classes and utilities for handling transactions, processes, events,
|
|
18
18
|
* DynamoDB transactions, routing, mailing, cryptography, JWT, configuration, Redis, responses,
|
|
19
19
|
* utilities, asynchronous singletons, routes, transaction configurations, response error types,
|
|
20
|
-
* HTTP methods, and
|
|
20
|
+
* HTTP methods, database operations, and rate limiting configurations.
|
|
21
21
|
*
|
|
22
22
|
* Classes:
|
|
23
23
|
* - Transaction
|
|
@@ -35,11 +35,16 @@ import Utils from './src/Util/Utils.js';
|
|
|
35
35
|
* - AsyncSingleton
|
|
36
36
|
* - Route
|
|
37
37
|
* - TransactionConfig
|
|
38
|
+
* - RouterConfig
|
|
38
39
|
* - Database
|
|
39
40
|
*
|
|
41
|
+
* Types:
|
|
42
|
+
* - RateLimitConfig - Route-level rate limiting configuration
|
|
43
|
+
* - GlobalRateLimitConfig - Global rate limiting configuration
|
|
44
|
+
*
|
|
40
45
|
* Enums:
|
|
41
46
|
* - ResponseErrorType
|
|
42
|
-
* -
|
|
47
|
+
* - HttpMethod
|
|
43
48
|
*/
|
|
44
49
|
export {
|
|
45
50
|
// Base Events
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,QAA+B,MAAM,uBAAuB,CAAA;AACnE,OAAO,iBAAiB,MAAM,sCAAsC,CAAA;AACpE,OAAO,cAAc,MAAM,mCAAmC,CAAA;AAC9D,OAAO,OAAO,MAAM,4BAA4B,CAAA;AAChD,OAAO,WAAkC,MAAM,gCAAgC,CAAA;AAC/E,OAAO,KAAK,MAAM,sBAAsB,CAAA;AACxC,OAAO,aAAa,MAAM,+BAA+B,CAAA;AACzD,OAAO,MAAM,MAAM,wBAAwB,CAAA;AAC3C,OAAO,GAAG,MAAM,qBAAqB,CAAA;AACrC,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAA;AACnD,OAAO,MAAM,MAAM,wBAAwB,CAAA;AAC3C,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,QAA+B,MAAM,uBAAuB,CAAA;AACnE,OAAO,iBAAiB,MAAM,sCAAsC,CAAA;AACpE,OAAO,cAAc,MAAM,mCAAmC,CAAA;AAC9D,OAAO,OAAO,MAAM,4BAA4B,CAAA;AAChD,OAAO,WAAkC,MAAM,gCAAgC,CAAA;AAC/E,OAAO,KAAK,MAAM,sBAAsB,CAAA;AACxC,OAAO,aAAa,MAAM,+BAA+B,CAAA;AACzD,OAAO,MAAM,MAAM,wBAAwB,CAAA;AAC3C,OAAO,GAAG,MAAM,qBAAqB,CAAA;AACrC,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAA;AACnD,OAAO,MAAM,MAAM,wBAAwB,CAAA;AAC3C,OAAO,MAKN,MAAM,wBAAwB,CAAA;AAC/B,OAAO,cAAc,MAAM,8BAA8B,CAAA;AACzD,OAAO,KAAK,MAAM,qBAAqB,CAAA;AAEvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO;AACL,cAAc;AACd,WAAW,EACX,OAAO,EACP,cAAc,EACd,iBAAiB,EACjB,MAAM;AACN,iCAAiC;AACjC,MAAM,EACN,MAAM,EACN,GAAG,EACH,aAAa,EACb,KAAK;AACL,MAAM;AACN,QAAQ;AACR,UAAU;AACV,KAAK,EACL,cAAc,EASd,UAAU,EACV,QAAQ,GACT,CAAA"}
|
package/dist/package-lock.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@creator.co/wapi",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.6",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@creator.co/wapi",
|
|
9
|
-
"version": "1.8.
|
|
9
|
+
"version": "1.8.6",
|
|
10
10
|
"license": "ISC",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@aws-sdk/client-dynamodb": "^3.651.1",
|
|
@@ -25,8 +25,9 @@
|
|
|
25
25
|
"cors": "^2.8.5",
|
|
26
26
|
"cuid": "^3.0.0",
|
|
27
27
|
"dotenv": "^16.4.1",
|
|
28
|
-
"email-templates": "^
|
|
28
|
+
"email-templates": "^13.0.0",
|
|
29
29
|
"express": "^4.22.0",
|
|
30
|
+
"express-rate-limit": "^7.5.0",
|
|
30
31
|
"json-stringify-safe": "^5.0.1",
|
|
31
32
|
"jsonwebtoken": "^9.0.2",
|
|
32
33
|
"knex": "^3.0.1",
|
|
@@ -37,6 +38,7 @@
|
|
|
37
38
|
"parse-duration": "^2.1.3",
|
|
38
39
|
"path-to-regexp": "^8.1.0",
|
|
39
40
|
"pg": "^8.11.3",
|
|
41
|
+
"rate-limit-redis": "^4.2.0",
|
|
40
42
|
"redis": "^4.7.0",
|
|
41
43
|
"sha1": "^1.1.1",
|
|
42
44
|
"stack-trace": "0.0.10",
|
|
@@ -5477,41 +5479,46 @@
|
|
|
5477
5479
|
"devOptional": true
|
|
5478
5480
|
},
|
|
5479
5481
|
"node_modules/email-templates": {
|
|
5480
|
-
"version": "
|
|
5481
|
-
"resolved": "https://registry.npmjs.org/email-templates/-/email-templates-
|
|
5482
|
-
"integrity": "sha512-
|
|
5482
|
+
"version": "13.0.0",
|
|
5483
|
+
"resolved": "https://registry.npmjs.org/email-templates/-/email-templates-13.0.0.tgz",
|
|
5484
|
+
"integrity": "sha512-hZDbGucp1VZxx+8hfLlvTx9MEIJzdw/2dNKmRiAuhdzLnuzLSaNilML8EVJW+39ZttZhrn6Mk21QwaFeVGh+Wg==",
|
|
5483
5485
|
"license": "MIT",
|
|
5484
5486
|
"dependencies": {
|
|
5485
5487
|
"@ladjs/consolidate": "^1.0.4",
|
|
5486
5488
|
"@ladjs/i18n": "^8.0.3",
|
|
5487
5489
|
"get-paths": "^0.0.7",
|
|
5488
5490
|
"html-to-text": "^9.0.5",
|
|
5489
|
-
"juice": "^
|
|
5491
|
+
"juice": "^11.0.3",
|
|
5490
5492
|
"lodash": "^4.17.21",
|
|
5491
|
-
"nodemailer": "^
|
|
5493
|
+
"nodemailer": "^7.0.12"
|
|
5492
5494
|
},
|
|
5493
5495
|
"engines": {
|
|
5494
|
-
"node": ">=
|
|
5496
|
+
"node": ">=18"
|
|
5495
5497
|
},
|
|
5496
5498
|
"optionalDependencies": {
|
|
5497
5499
|
"preview-email": "*"
|
|
5498
5500
|
}
|
|
5499
5501
|
},
|
|
5500
5502
|
"node_modules/email-templates/node_modules/cheerio": {
|
|
5501
|
-
"version": "1.0.0
|
|
5502
|
-
"resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0
|
|
5503
|
-
"integrity": "sha512-
|
|
5503
|
+
"version": "1.0.0",
|
|
5504
|
+
"resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0.tgz",
|
|
5505
|
+
"integrity": "sha512-quS9HgjQpdaXOvsZz82Oz7uxtXiy6UIsIQcpBj7HRw2M63Skasm9qlDocAM7jNuaxdhpPU7c4kJN+gA5MCu4ww==",
|
|
5506
|
+
"license": "MIT",
|
|
5504
5507
|
"dependencies": {
|
|
5505
5508
|
"cheerio-select": "^2.1.0",
|
|
5506
5509
|
"dom-serializer": "^2.0.0",
|
|
5507
5510
|
"domhandler": "^5.0.3",
|
|
5508
|
-
"domutils": "^3.0
|
|
5509
|
-
"
|
|
5510
|
-
"
|
|
5511
|
-
"parse5
|
|
5511
|
+
"domutils": "^3.1.0",
|
|
5512
|
+
"encoding-sniffer": "^0.2.0",
|
|
5513
|
+
"htmlparser2": "^9.1.0",
|
|
5514
|
+
"parse5": "^7.1.2",
|
|
5515
|
+
"parse5-htmlparser2-tree-adapter": "^7.0.0",
|
|
5516
|
+
"parse5-parser-stream": "^7.1.2",
|
|
5517
|
+
"undici": "^6.19.5",
|
|
5518
|
+
"whatwg-mimetype": "^4.0.0"
|
|
5512
5519
|
},
|
|
5513
5520
|
"engines": {
|
|
5514
|
-
"node": ">=
|
|
5521
|
+
"node": ">=18.17"
|
|
5515
5522
|
},
|
|
5516
5523
|
"funding": {
|
|
5517
5524
|
"url": "https://github.com/cheeriojs/cheerio?sponsor=1"
|
|
@@ -5521,6 +5528,7 @@
|
|
|
5521
5528
|
"version": "2.1.0",
|
|
5522
5529
|
"resolved": "https://registry.npmjs.org/cheerio-select/-/cheerio-select-2.1.0.tgz",
|
|
5523
5530
|
"integrity": "sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==",
|
|
5531
|
+
"license": "BSD-2-Clause",
|
|
5524
5532
|
"dependencies": {
|
|
5525
5533
|
"boolbase": "^1.0.0",
|
|
5526
5534
|
"css-select": "^5.1.0",
|
|
@@ -5534,17 +5542,19 @@
|
|
|
5534
5542
|
}
|
|
5535
5543
|
},
|
|
5536
5544
|
"node_modules/email-templates/node_modules/commander": {
|
|
5537
|
-
"version": "
|
|
5538
|
-
"resolved": "https://registry.npmjs.org/commander/-/commander-
|
|
5539
|
-
"integrity": "sha512-
|
|
5545
|
+
"version": "12.1.0",
|
|
5546
|
+
"resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz",
|
|
5547
|
+
"integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==",
|
|
5548
|
+
"license": "MIT",
|
|
5540
5549
|
"engines": {
|
|
5541
|
-
"node": ">=
|
|
5550
|
+
"node": ">=18"
|
|
5542
5551
|
}
|
|
5543
5552
|
},
|
|
5544
5553
|
"node_modules/email-templates/node_modules/css-select": {
|
|
5545
|
-
"version": "5.
|
|
5546
|
-
"resolved": "https://registry.npmjs.org/css-select/-/css-select-5.
|
|
5547
|
-
"integrity": "sha512-
|
|
5554
|
+
"version": "5.2.2",
|
|
5555
|
+
"resolved": "https://registry.npmjs.org/css-select/-/css-select-5.2.2.tgz",
|
|
5556
|
+
"integrity": "sha512-TizTzUddG/xYLA3NXodFM0fSbNizXjOKhqiQQwvhlspadZokn1KDy0NZFS0wuEubIYAV5/c1/lAr0TaaFXEXzw==",
|
|
5557
|
+
"license": "BSD-2-Clause",
|
|
5548
5558
|
"dependencies": {
|
|
5549
5559
|
"boolbase": "^1.0.0",
|
|
5550
5560
|
"css-what": "^6.1.0",
|
|
@@ -5560,6 +5570,7 @@
|
|
|
5560
5570
|
"version": "2.0.0",
|
|
5561
5571
|
"resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz",
|
|
5562
5572
|
"integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==",
|
|
5573
|
+
"license": "MIT",
|
|
5563
5574
|
"dependencies": {
|
|
5564
5575
|
"domelementtype": "^2.3.0",
|
|
5565
5576
|
"domhandler": "^5.0.2",
|
|
@@ -5569,10 +5580,23 @@
|
|
|
5569
5580
|
"url": "https://github.com/cheeriojs/dom-serializer?sponsor=1"
|
|
5570
5581
|
}
|
|
5571
5582
|
},
|
|
5583
|
+
"node_modules/email-templates/node_modules/dom-serializer/node_modules/entities": {
|
|
5584
|
+
"version": "4.5.0",
|
|
5585
|
+
"resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz",
|
|
5586
|
+
"integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==",
|
|
5587
|
+
"license": "BSD-2-Clause",
|
|
5588
|
+
"engines": {
|
|
5589
|
+
"node": ">=0.12"
|
|
5590
|
+
},
|
|
5591
|
+
"funding": {
|
|
5592
|
+
"url": "https://github.com/fb55/entities?sponsor=1"
|
|
5593
|
+
}
|
|
5594
|
+
},
|
|
5572
5595
|
"node_modules/email-templates/node_modules/domhandler": {
|
|
5573
5596
|
"version": "5.0.3",
|
|
5574
5597
|
"resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz",
|
|
5575
5598
|
"integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==",
|
|
5599
|
+
"license": "BSD-2-Clause",
|
|
5576
5600
|
"dependencies": {
|
|
5577
5601
|
"domelementtype": "^2.3.0"
|
|
5578
5602
|
},
|
|
@@ -5584,9 +5608,10 @@
|
|
|
5584
5608
|
}
|
|
5585
5609
|
},
|
|
5586
5610
|
"node_modules/email-templates/node_modules/domutils": {
|
|
5587
|
-
"version": "3.2.
|
|
5588
|
-
"resolved": "https://registry.npmjs.org/domutils/-/domutils-3.2.
|
|
5589
|
-
"integrity": "sha512-
|
|
5611
|
+
"version": "3.2.2",
|
|
5612
|
+
"resolved": "https://registry.npmjs.org/domutils/-/domutils-3.2.2.tgz",
|
|
5613
|
+
"integrity": "sha512-6kZKyUajlDuqlHKVX1w7gyslj9MPIXzIFiz/rGu35uC1wMi+kMhQwGhl4lt9unC9Vb9INnY9Z3/ZA3+FhASLaw==",
|
|
5614
|
+
"license": "BSD-2-Clause",
|
|
5590
5615
|
"dependencies": {
|
|
5591
5616
|
"dom-serializer": "^2.0.0",
|
|
5592
5617
|
"domelementtype": "^2.3.0",
|
|
@@ -5597,9 +5622,10 @@
|
|
|
5597
5622
|
}
|
|
5598
5623
|
},
|
|
5599
5624
|
"node_modules/email-templates/node_modules/entities": {
|
|
5600
|
-
"version": "
|
|
5601
|
-
"resolved": "https://registry.npmjs.org/entities/-/entities-
|
|
5602
|
-
"integrity": "sha512-
|
|
5625
|
+
"version": "7.0.0",
|
|
5626
|
+
"resolved": "https://registry.npmjs.org/entities/-/entities-7.0.0.tgz",
|
|
5627
|
+
"integrity": "sha512-FDWG5cmEYf2Z00IkYRhbFrwIwvdFKH07uV8dvNy0omp/Qb1xcyCWp2UDtcwJF4QZZvk0sLudP6/hAu42TaqVhQ==",
|
|
5628
|
+
"license": "BSD-2-Clause",
|
|
5603
5629
|
"engines": {
|
|
5604
5630
|
"node": ">=0.12"
|
|
5605
5631
|
},
|
|
@@ -5608,9 +5634,9 @@
|
|
|
5608
5634
|
}
|
|
5609
5635
|
},
|
|
5610
5636
|
"node_modules/email-templates/node_modules/htmlparser2": {
|
|
5611
|
-
"version": "
|
|
5612
|
-
"resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-
|
|
5613
|
-
"integrity": "sha512-
|
|
5637
|
+
"version": "9.1.0",
|
|
5638
|
+
"resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-9.1.0.tgz",
|
|
5639
|
+
"integrity": "sha512-5zfg6mHUoaer/97TxnGpxmbR7zJtPwIYFMZ/H5ucTlPZhKvtum05yiPK3Mgai3a0DyVxv7qYqoweaEd2nrYQzQ==",
|
|
5614
5640
|
"funding": [
|
|
5615
5641
|
"https://github.com/fb55/htmlparser2?sponsor=1",
|
|
5616
5642
|
{
|
|
@@ -5618,37 +5644,62 @@
|
|
|
5618
5644
|
"url": "https://github.com/sponsors/fb55"
|
|
5619
5645
|
}
|
|
5620
5646
|
],
|
|
5647
|
+
"license": "MIT",
|
|
5621
5648
|
"dependencies": {
|
|
5622
5649
|
"domelementtype": "^2.3.0",
|
|
5623
5650
|
"domhandler": "^5.0.3",
|
|
5624
|
-
"domutils": "^3.0
|
|
5625
|
-
"entities": "^4.
|
|
5651
|
+
"domutils": "^3.1.0",
|
|
5652
|
+
"entities": "^4.5.0"
|
|
5653
|
+
}
|
|
5654
|
+
},
|
|
5655
|
+
"node_modules/email-templates/node_modules/htmlparser2/node_modules/entities": {
|
|
5656
|
+
"version": "4.5.0",
|
|
5657
|
+
"resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz",
|
|
5658
|
+
"integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==",
|
|
5659
|
+
"license": "BSD-2-Clause",
|
|
5660
|
+
"engines": {
|
|
5661
|
+
"node": ">=0.12"
|
|
5662
|
+
},
|
|
5663
|
+
"funding": {
|
|
5664
|
+
"url": "https://github.com/fb55/entities?sponsor=1"
|
|
5626
5665
|
}
|
|
5627
5666
|
},
|
|
5628
5667
|
"node_modules/email-templates/node_modules/juice": {
|
|
5629
|
-
"version": "
|
|
5630
|
-
"resolved": "https://registry.npmjs.org/juice/-/juice-
|
|
5631
|
-
"integrity": "sha512-
|
|
5668
|
+
"version": "11.1.0",
|
|
5669
|
+
"resolved": "https://registry.npmjs.org/juice/-/juice-11.1.0.tgz",
|
|
5670
|
+
"integrity": "sha512-jZj/pUGFddSU7HS6ThAdiQ21IILIM23JNdFNgTacwxFUMTw/6qvMv3suv/I66Bz2xZ6yC3Vl8fWl0At/wVcH3A==",
|
|
5671
|
+
"license": "MIT",
|
|
5632
5672
|
"dependencies": {
|
|
5633
|
-
"cheerio": "1.0.0
|
|
5634
|
-
"commander": "^
|
|
5673
|
+
"cheerio": "1.0.0",
|
|
5674
|
+
"commander": "^12.1.0",
|
|
5675
|
+
"entities": "^7.0.0",
|
|
5635
5676
|
"mensch": "^0.3.4",
|
|
5636
5677
|
"slick": "^1.12.2",
|
|
5637
|
-
"web-resource-inliner": "^
|
|
5678
|
+
"web-resource-inliner": "^8.0.0"
|
|
5638
5679
|
},
|
|
5639
5680
|
"bin": {
|
|
5640
5681
|
"juice": "bin/juice"
|
|
5641
5682
|
},
|
|
5642
5683
|
"engines": {
|
|
5643
|
-
"node": ">=
|
|
5684
|
+
"node": ">=18.17"
|
|
5685
|
+
}
|
|
5686
|
+
},
|
|
5687
|
+
"node_modules/email-templates/node_modules/nodemailer": {
|
|
5688
|
+
"version": "7.0.12",
|
|
5689
|
+
"resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-7.0.12.tgz",
|
|
5690
|
+
"integrity": "sha512-H+rnK5bX2Pi/6ms3sN4/jRQvYSMltV6vqup/0SFOrxYYY/qoNvhXPlYq3e+Pm9RFJRwrMGbMIwi81M4dxpomhA==",
|
|
5691
|
+
"license": "MIT-0",
|
|
5692
|
+
"engines": {
|
|
5693
|
+
"node": ">=6.0.0"
|
|
5644
5694
|
}
|
|
5645
5695
|
},
|
|
5646
5696
|
"node_modules/email-templates/node_modules/parse5": {
|
|
5647
|
-
"version": "7.
|
|
5648
|
-
"resolved": "https://registry.npmjs.org/parse5/-/parse5-7.
|
|
5649
|
-
"integrity": "sha512-
|
|
5697
|
+
"version": "7.3.0",
|
|
5698
|
+
"resolved": "https://registry.npmjs.org/parse5/-/parse5-7.3.0.tgz",
|
|
5699
|
+
"integrity": "sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==",
|
|
5700
|
+
"license": "MIT",
|
|
5650
5701
|
"dependencies": {
|
|
5651
|
-
"entities": "^
|
|
5702
|
+
"entities": "^6.0.0"
|
|
5652
5703
|
},
|
|
5653
5704
|
"funding": {
|
|
5654
5705
|
"url": "https://github.com/inikulin/parse5?sponsor=1"
|
|
@@ -5658,6 +5709,7 @@
|
|
|
5658
5709
|
"version": "7.1.0",
|
|
5659
5710
|
"resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.1.0.tgz",
|
|
5660
5711
|
"integrity": "sha512-ruw5xyKs6lrpo9x9rCZqZZnIUntICjQAd0Wsmp396Ul9lN/h+ifgVV1x1gZHi8euej6wTfpqX8j+BFQxF0NS/g==",
|
|
5712
|
+
"license": "MIT",
|
|
5661
5713
|
"dependencies": {
|
|
5662
5714
|
"domhandler": "^5.0.3",
|
|
5663
5715
|
"parse5": "^7.0.0"
|
|
@@ -5666,6 +5718,34 @@
|
|
|
5666
5718
|
"url": "https://github.com/inikulin/parse5?sponsor=1"
|
|
5667
5719
|
}
|
|
5668
5720
|
},
|
|
5721
|
+
"node_modules/email-templates/node_modules/parse5/node_modules/entities": {
|
|
5722
|
+
"version": "6.0.1",
|
|
5723
|
+
"resolved": "https://registry.npmjs.org/entities/-/entities-6.0.1.tgz",
|
|
5724
|
+
"integrity": "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==",
|
|
5725
|
+
"license": "BSD-2-Clause",
|
|
5726
|
+
"engines": {
|
|
5727
|
+
"node": ">=0.12"
|
|
5728
|
+
},
|
|
5729
|
+
"funding": {
|
|
5730
|
+
"url": "https://github.com/fb55/entities?sponsor=1"
|
|
5731
|
+
}
|
|
5732
|
+
},
|
|
5733
|
+
"node_modules/email-templates/node_modules/web-resource-inliner": {
|
|
5734
|
+
"version": "8.0.0",
|
|
5735
|
+
"resolved": "https://registry.npmjs.org/web-resource-inliner/-/web-resource-inliner-8.0.0.tgz",
|
|
5736
|
+
"integrity": "sha512-Ezr98sqXW/+OCGoUEXuOKVR+oVFlSdn1tIySEEJdiSAw4IjrW8hQkwARSSBJTSB5Us5dnytDgL0ZDliAYBhaNA==",
|
|
5737
|
+
"license": "MIT",
|
|
5738
|
+
"dependencies": {
|
|
5739
|
+
"ansi-colors": "^4.1.1",
|
|
5740
|
+
"escape-goat": "^3.0.0",
|
|
5741
|
+
"htmlparser2": "^9.1.0",
|
|
5742
|
+
"mime": "^2.4.6",
|
|
5743
|
+
"valid-data-url": "^3.0.0"
|
|
5744
|
+
},
|
|
5745
|
+
"engines": {
|
|
5746
|
+
"node": ">=10.0.0"
|
|
5747
|
+
}
|
|
5748
|
+
},
|
|
5669
5749
|
"node_modules/emittery": {
|
|
5670
5750
|
"version": "0.13.1",
|
|
5671
5751
|
"resolved": "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz",
|
|
@@ -5702,6 +5782,31 @@
|
|
|
5702
5782
|
"node": ">=8.10.0"
|
|
5703
5783
|
}
|
|
5704
5784
|
},
|
|
5785
|
+
"node_modules/encoding-sniffer": {
|
|
5786
|
+
"version": "0.2.1",
|
|
5787
|
+
"resolved": "https://registry.npmjs.org/encoding-sniffer/-/encoding-sniffer-0.2.1.tgz",
|
|
5788
|
+
"integrity": "sha512-5gvq20T6vfpekVtqrYQsSCFZ1wEg5+wW0/QaZMWkFr6BqD3NfKs0rLCx4rrVlSWJeZb5NBJgVLswK/w2MWU+Gw==",
|
|
5789
|
+
"license": "MIT",
|
|
5790
|
+
"dependencies": {
|
|
5791
|
+
"iconv-lite": "^0.6.3",
|
|
5792
|
+
"whatwg-encoding": "^3.1.1"
|
|
5793
|
+
},
|
|
5794
|
+
"funding": {
|
|
5795
|
+
"url": "https://github.com/fb55/encoding-sniffer?sponsor=1"
|
|
5796
|
+
}
|
|
5797
|
+
},
|
|
5798
|
+
"node_modules/encoding-sniffer/node_modules/iconv-lite": {
|
|
5799
|
+
"version": "0.6.3",
|
|
5800
|
+
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",
|
|
5801
|
+
"integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
|
|
5802
|
+
"license": "MIT",
|
|
5803
|
+
"dependencies": {
|
|
5804
|
+
"safer-buffer": ">= 2.1.2 < 3.0.0"
|
|
5805
|
+
},
|
|
5806
|
+
"engines": {
|
|
5807
|
+
"node": ">=0.10.0"
|
|
5808
|
+
}
|
|
5809
|
+
},
|
|
5705
5810
|
"node_modules/entities": {
|
|
5706
5811
|
"version": "2.2.0",
|
|
5707
5812
|
"resolved": "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz",
|
|
@@ -6619,6 +6724,21 @@
|
|
|
6619
6724
|
"url": "https://opencollective.com/express"
|
|
6620
6725
|
}
|
|
6621
6726
|
},
|
|
6727
|
+
"node_modules/express-rate-limit": {
|
|
6728
|
+
"version": "7.5.1",
|
|
6729
|
+
"resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-7.5.1.tgz",
|
|
6730
|
+
"integrity": "sha512-7iN8iPMDzOMHPUYllBEsQdWVB6fPDMPqwjBaFrgr4Jgr/+okjvzAy+UHlYYL/Vs0OsOrMkwS6PJDkFlJwoxUnw==",
|
|
6731
|
+
"license": "MIT",
|
|
6732
|
+
"engines": {
|
|
6733
|
+
"node": ">= 16"
|
|
6734
|
+
},
|
|
6735
|
+
"funding": {
|
|
6736
|
+
"url": "https://github.com/sponsors/express-rate-limit"
|
|
6737
|
+
},
|
|
6738
|
+
"peerDependencies": {
|
|
6739
|
+
"express": ">= 4.11"
|
|
6740
|
+
}
|
|
6741
|
+
},
|
|
6622
6742
|
"node_modules/express/node_modules/debug": {
|
|
6623
6743
|
"version": "2.6.9",
|
|
6624
6744
|
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
|
|
@@ -9939,6 +10059,7 @@
|
|
|
9939
10059
|
"version": "6.9.16",
|
|
9940
10060
|
"resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.9.16.tgz",
|
|
9941
10061
|
"integrity": "sha512-psAuZdTIRN08HKVd/E8ObdV6NO7NTBY3KsC30F7M4H1OnmLCUNaS56FpYxyb26zWLSyYF9Ozch9KYHhHegsiOQ==",
|
|
10062
|
+
"optional": true,
|
|
9942
10063
|
"engines": {
|
|
9943
10064
|
"node": ">=6.0.0"
|
|
9944
10065
|
}
|
|
@@ -10418,6 +10539,42 @@
|
|
|
10418
10539
|
"parse5": "^6.0.1"
|
|
10419
10540
|
}
|
|
10420
10541
|
},
|
|
10542
|
+
"node_modules/parse5-parser-stream": {
|
|
10543
|
+
"version": "7.1.2",
|
|
10544
|
+
"resolved": "https://registry.npmjs.org/parse5-parser-stream/-/parse5-parser-stream-7.1.2.tgz",
|
|
10545
|
+
"integrity": "sha512-JyeQc9iwFLn5TbvvqACIF/VXG6abODeB3Fwmv/TGdLk2LfbWkaySGY72at4+Ty7EkPZj854u4CrICqNk2qIbow==",
|
|
10546
|
+
"license": "MIT",
|
|
10547
|
+
"dependencies": {
|
|
10548
|
+
"parse5": "^7.0.0"
|
|
10549
|
+
},
|
|
10550
|
+
"funding": {
|
|
10551
|
+
"url": "https://github.com/inikulin/parse5?sponsor=1"
|
|
10552
|
+
}
|
|
10553
|
+
},
|
|
10554
|
+
"node_modules/parse5-parser-stream/node_modules/entities": {
|
|
10555
|
+
"version": "6.0.1",
|
|
10556
|
+
"resolved": "https://registry.npmjs.org/entities/-/entities-6.0.1.tgz",
|
|
10557
|
+
"integrity": "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==",
|
|
10558
|
+
"license": "BSD-2-Clause",
|
|
10559
|
+
"engines": {
|
|
10560
|
+
"node": ">=0.12"
|
|
10561
|
+
},
|
|
10562
|
+
"funding": {
|
|
10563
|
+
"url": "https://github.com/fb55/entities?sponsor=1"
|
|
10564
|
+
}
|
|
10565
|
+
},
|
|
10566
|
+
"node_modules/parse5-parser-stream/node_modules/parse5": {
|
|
10567
|
+
"version": "7.3.0",
|
|
10568
|
+
"resolved": "https://registry.npmjs.org/parse5/-/parse5-7.3.0.tgz",
|
|
10569
|
+
"integrity": "sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==",
|
|
10570
|
+
"license": "MIT",
|
|
10571
|
+
"dependencies": {
|
|
10572
|
+
"entities": "^6.0.0"
|
|
10573
|
+
},
|
|
10574
|
+
"funding": {
|
|
10575
|
+
"url": "https://github.com/inikulin/parse5?sponsor=1"
|
|
10576
|
+
}
|
|
10577
|
+
},
|
|
10421
10578
|
"node_modules/parseley": {
|
|
10422
10579
|
"version": "0.12.1",
|
|
10423
10580
|
"resolved": "https://registry.npmjs.org/parseley/-/parseley-0.12.1.tgz",
|
|
@@ -11080,6 +11237,18 @@
|
|
|
11080
11237
|
"node": ">= 0.6"
|
|
11081
11238
|
}
|
|
11082
11239
|
},
|
|
11240
|
+
"node_modules/rate-limit-redis": {
|
|
11241
|
+
"version": "4.3.1",
|
|
11242
|
+
"resolved": "https://registry.npmjs.org/rate-limit-redis/-/rate-limit-redis-4.3.1.tgz",
|
|
11243
|
+
"integrity": "sha512-+a1zU8+D7L8siDK9jb14refQXz60vq427VuiplgnaLk9B2LnvGe/APLTfhwb4uNIL7eWVknh8GnRp/unCj+lMA==",
|
|
11244
|
+
"license": "MIT",
|
|
11245
|
+
"engines": {
|
|
11246
|
+
"node": ">= 16"
|
|
11247
|
+
},
|
|
11248
|
+
"peerDependencies": {
|
|
11249
|
+
"express-rate-limit": ">= 6"
|
|
11250
|
+
}
|
|
11251
|
+
},
|
|
11083
11252
|
"node_modules/raw-body": {
|
|
11084
11253
|
"version": "2.5.2",
|
|
11085
11254
|
"resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz",
|
|
@@ -12927,6 +13096,15 @@
|
|
|
12927
13096
|
"underscore": "1.x"
|
|
12928
13097
|
}
|
|
12929
13098
|
},
|
|
13099
|
+
"node_modules/undici": {
|
|
13100
|
+
"version": "6.23.0",
|
|
13101
|
+
"resolved": "https://registry.npmjs.org/undici/-/undici-6.23.0.tgz",
|
|
13102
|
+
"integrity": "sha512-VfQPToRA5FZs/qJxLIinmU59u0r7LXqoJkCzinq3ckNJp3vKEh7jTWN589YQ5+aoAC/TGRLyJLCPKcLQbM8r9g==",
|
|
13103
|
+
"license": "MIT",
|
|
13104
|
+
"engines": {
|
|
13105
|
+
"node": ">=18.17"
|
|
13106
|
+
}
|
|
13107
|
+
},
|
|
12930
13108
|
"node_modules/undici-types": {
|
|
12931
13109
|
"version": "6.19.8",
|
|
12932
13110
|
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz",
|
|
@@ -13144,6 +13322,40 @@
|
|
|
13144
13322
|
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
|
|
13145
13323
|
"integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ=="
|
|
13146
13324
|
},
|
|
13325
|
+
"node_modules/whatwg-encoding": {
|
|
13326
|
+
"version": "3.1.1",
|
|
13327
|
+
"resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-3.1.1.tgz",
|
|
13328
|
+
"integrity": "sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==",
|
|
13329
|
+
"deprecated": "Use @exodus/bytes instead for a more spec-conformant and faster implementation",
|
|
13330
|
+
"license": "MIT",
|
|
13331
|
+
"dependencies": {
|
|
13332
|
+
"iconv-lite": "0.6.3"
|
|
13333
|
+
},
|
|
13334
|
+
"engines": {
|
|
13335
|
+
"node": ">=18"
|
|
13336
|
+
}
|
|
13337
|
+
},
|
|
13338
|
+
"node_modules/whatwg-encoding/node_modules/iconv-lite": {
|
|
13339
|
+
"version": "0.6.3",
|
|
13340
|
+
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",
|
|
13341
|
+
"integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
|
|
13342
|
+
"license": "MIT",
|
|
13343
|
+
"dependencies": {
|
|
13344
|
+
"safer-buffer": ">= 2.1.2 < 3.0.0"
|
|
13345
|
+
},
|
|
13346
|
+
"engines": {
|
|
13347
|
+
"node": ">=0.10.0"
|
|
13348
|
+
}
|
|
13349
|
+
},
|
|
13350
|
+
"node_modules/whatwg-mimetype": {
|
|
13351
|
+
"version": "4.0.0",
|
|
13352
|
+
"resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-4.0.0.tgz",
|
|
13353
|
+
"integrity": "sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==",
|
|
13354
|
+
"license": "MIT",
|
|
13355
|
+
"engines": {
|
|
13356
|
+
"node": ">=18"
|
|
13357
|
+
}
|
|
13358
|
+
},
|
|
13147
13359
|
"node_modules/whatwg-url": {
|
|
13148
13360
|
"version": "5.0.0",
|
|
13149
13361
|
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@creator.co/wapi",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.6",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -35,8 +35,9 @@
|
|
|
35
35
|
"cors": "^2.8.5",
|
|
36
36
|
"cuid": "^3.0.0",
|
|
37
37
|
"dotenv": "^16.4.1",
|
|
38
|
-
"email-templates": "^
|
|
38
|
+
"email-templates": "^13.0.0",
|
|
39
39
|
"express": "^4.22.0",
|
|
40
|
+
"express-rate-limit": "^7.5.0",
|
|
40
41
|
"json-stringify-safe": "^5.0.1",
|
|
41
42
|
"jsonwebtoken": "^9.0.2",
|
|
42
43
|
"knex": "^3.0.1",
|
|
@@ -47,6 +48,7 @@
|
|
|
47
48
|
"parse-duration": "^2.1.3",
|
|
48
49
|
"path-to-regexp": "^8.1.0",
|
|
49
50
|
"pg": "^8.11.3",
|
|
51
|
+
"rate-limit-redis": "^4.2.0",
|
|
50
52
|
"redis": "^4.7.0",
|
|
51
53
|
"sha1": "^1.1.1",
|
|
52
54
|
"stack-trace": "0.0.10",
|
|
@@ -292,11 +292,12 @@ export default class Logger {
|
|
|
292
292
|
suppressSensitiveObject(value, push) {
|
|
293
293
|
Object.entries(value).forEach(([k, v]) => {
|
|
294
294
|
const lower = k.toLowerCase();
|
|
295
|
-
if (!v || !this.filterBlacklist.includes(
|
|
295
|
+
if (!v || !this.filterBlacklist.some(term => lower.includes(term))) {
|
|
296
296
|
push({ value: v, parent: value, key: k });
|
|
297
297
|
return;
|
|
298
298
|
}
|
|
299
|
-
|
|
299
|
+
const matchedTerm = this.filterBlacklist.find(term => lower.includes(term));
|
|
300
|
+
switch (matchedTerm) {
|
|
300
301
|
case 'password':
|
|
301
302
|
value[k] = '[MASKED]';
|
|
302
303
|
break;
|