@creator.co/wapi 1.9.2 → 1.9.3
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/package-lock.json +85 -65
- package/dist/package.json +9 -6
- package/dist/src/Server/Router.d.ts +10 -9
- package/dist/src/Server/Router.js.map +1 -1
- package/dist/src/Validation/Validator.d.ts +3 -3
- package/dist/src/Validation/Validator.js +2 -2
- package/dist/src/Validation/Validator.js.map +1 -1
- package/package.json +9 -6
- package/src/Server/Router.ts +10 -9
- package/src/Validation/Validator.ts +3 -3
package/dist/package-lock.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@creator.co/wapi",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.3",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@creator.co/wapi",
|
|
9
|
-
"version": "1.9.
|
|
9
|
+
"version": "1.9.3",
|
|
10
10
|
"license": "ISC",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@aws-sdk/client-dynamodb": "^3.730.0",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"cors": "^2.8.5",
|
|
26
26
|
"cuid": "^3.0.0",
|
|
27
27
|
"dotenv": "^16.4.1",
|
|
28
|
-
"email-templates": "^13.0.
|
|
28
|
+
"email-templates": "^13.0.1",
|
|
29
29
|
"express": "^4.22.0",
|
|
30
30
|
"express-rate-limit": "^7.5.0",
|
|
31
31
|
"json-stringify-safe": "^5.0.1",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"knex-stringcase": "^1.4.6",
|
|
35
35
|
"kysely": "^0.28.14",
|
|
36
36
|
"node-cache": "^5.1.2",
|
|
37
|
-
"nodemailer": "^8.0.
|
|
37
|
+
"nodemailer": "^8.0.5",
|
|
38
38
|
"object-hash": "^3.0.0",
|
|
39
39
|
"parse-duration": "^2.1.3",
|
|
40
40
|
"path-to-regexp": "^8.4.0",
|
|
@@ -42,8 +42,7 @@
|
|
|
42
42
|
"rate-limit-redis": "^4.2.0",
|
|
43
43
|
"redis": "^4.7.0",
|
|
44
44
|
"sha1": "^1.1.1",
|
|
45
|
-
"stack-trace": "0.0.10"
|
|
46
|
-
"zod": "^3.23.4"
|
|
45
|
+
"stack-trace": "0.0.10"
|
|
47
46
|
},
|
|
48
47
|
"devDependencies": {
|
|
49
48
|
"@go-task/cli": "^3.39.0",
|
|
@@ -74,7 +73,11 @@
|
|
|
74
73
|
"supertest": "^7.1.1",
|
|
75
74
|
"ts-jest": "^29.2.5",
|
|
76
75
|
"ts-node": "^10.9.1",
|
|
77
|
-
"typescript": "^5.5.0"
|
|
76
|
+
"typescript": "^5.5.0",
|
|
77
|
+
"zod": "^3.25.76"
|
|
78
|
+
},
|
|
79
|
+
"peerDependencies": {
|
|
80
|
+
"zod": "^3.23.4"
|
|
78
81
|
}
|
|
79
82
|
},
|
|
80
83
|
"node_modules/@ampproject/remapping": {
|
|
@@ -2633,19 +2636,6 @@
|
|
|
2633
2636
|
"go-npm": "bin/index.js"
|
|
2634
2637
|
}
|
|
2635
2638
|
},
|
|
2636
|
-
"node_modules/@hapi/boom": {
|
|
2637
|
-
"version": "10.0.1",
|
|
2638
|
-
"resolved": "https://registry.npmjs.org/@hapi/boom/-/boom-10.0.1.tgz",
|
|
2639
|
-
"integrity": "sha512-ERcCZaEjdH3OgSJlyjVk8pHIFeus91CjKP3v+MpgBNp5IvGzP2l/bRiD78nqYcKPaZdbKkK5vDBVPd2ohHBlsA==",
|
|
2640
|
-
"dependencies": {
|
|
2641
|
-
"@hapi/hoek": "^11.0.2"
|
|
2642
|
-
}
|
|
2643
|
-
},
|
|
2644
|
-
"node_modules/@hapi/hoek": {
|
|
2645
|
-
"version": "11.0.7",
|
|
2646
|
-
"resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-11.0.7.tgz",
|
|
2647
|
-
"integrity": "sha512-HV5undWkKzcB4RZUusqOpcgxOaq6VOAH7zhhIr2g3G8NF/MlFO75SjOr2NfuSx0Mh40+1FqCkagKLJRykUWoFQ=="
|
|
2648
|
-
},
|
|
2649
2639
|
"node_modules/@humanwhocodes/config-array": {
|
|
2650
2640
|
"version": "0.11.14",
|
|
2651
2641
|
"resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz",
|
|
@@ -3256,35 +3246,51 @@
|
|
|
3256
3246
|
"version": "1.0.3",
|
|
3257
3247
|
"resolved": "https://registry.npmjs.org/@ladjs/country-language/-/country-language-1.0.3.tgz",
|
|
3258
3248
|
"integrity": "sha512-FJROu9/hh4eqVAGDyfL8vpv6Vb0qKHX1ozYLRZ+beUzD5xFf+3r0J+SVIWKviEa7W524Qvqou+ta1WrsRgzxGw==",
|
|
3249
|
+
"license": "MIT",
|
|
3259
3250
|
"engines": {
|
|
3260
3251
|
"node": ">= 14"
|
|
3261
3252
|
}
|
|
3262
3253
|
},
|
|
3263
3254
|
"node_modules/@ladjs/i18n": {
|
|
3264
|
-
"version": "
|
|
3265
|
-
"resolved": "https://registry.npmjs.org/@ladjs/i18n/-/i18n-
|
|
3266
|
-
"integrity": "sha512-
|
|
3255
|
+
"version": "10.0.0",
|
|
3256
|
+
"resolved": "https://registry.npmjs.org/@ladjs/i18n/-/i18n-10.0.0.tgz",
|
|
3257
|
+
"integrity": "sha512-t3NvAN+ClirgAxvN0Gu28x/RXNhQ9jtn+owPvap3O0DrcaDXwuQFr/DfJVQYw8FMBCzcHwkwdmlQ5DN6yH+QYA==",
|
|
3258
|
+
"license": "MIT",
|
|
3267
3259
|
"dependencies": {
|
|
3268
|
-
"@hapi/boom": "^10.0.0",
|
|
3269
3260
|
"@ladjs/country-language": "^1.0.1",
|
|
3270
|
-
"boolean": "3.2.0",
|
|
3271
3261
|
"i18n": "^0.15.0",
|
|
3272
3262
|
"i18n-locales": "^0.0.5",
|
|
3273
3263
|
"lodash": "^4.17.21",
|
|
3274
3264
|
"multimatch": "5",
|
|
3275
|
-
"punycode": "^2.
|
|
3276
|
-
"qs": "^6.
|
|
3265
|
+
"punycode": "^2.3.1",
|
|
3266
|
+
"qs": "^6.14.0",
|
|
3277
3267
|
"titleize": "2",
|
|
3278
|
-
"tlds": "^1.
|
|
3268
|
+
"tlds": "^1.261.0"
|
|
3279
3269
|
},
|
|
3280
3270
|
"engines": {
|
|
3281
|
-
"node": ">=
|
|
3271
|
+
"node": ">=18"
|
|
3272
|
+
}
|
|
3273
|
+
},
|
|
3274
|
+
"node_modules/@ladjs/i18n/node_modules/qs": {
|
|
3275
|
+
"version": "6.15.1",
|
|
3276
|
+
"resolved": "https://registry.npmjs.org/qs/-/qs-6.15.1.tgz",
|
|
3277
|
+
"integrity": "sha512-6YHEFRL9mfgcAvql/XhwTvf5jKcOiiupt2FiJxHkiX1z4j7WL8J/jRHYLluORvc1XxB5rV20KoeK00gVJamspg==",
|
|
3278
|
+
"license": "BSD-3-Clause",
|
|
3279
|
+
"dependencies": {
|
|
3280
|
+
"side-channel": "^1.1.0"
|
|
3281
|
+
},
|
|
3282
|
+
"engines": {
|
|
3283
|
+
"node": ">=0.6"
|
|
3284
|
+
},
|
|
3285
|
+
"funding": {
|
|
3286
|
+
"url": "https://github.com/sponsors/ljharb"
|
|
3282
3287
|
}
|
|
3283
3288
|
},
|
|
3284
3289
|
"node_modules/@messageformat/core": {
|
|
3285
3290
|
"version": "3.4.0",
|
|
3286
3291
|
"resolved": "https://registry.npmjs.org/@messageformat/core/-/core-3.4.0.tgz",
|
|
3287
3292
|
"integrity": "sha512-NgCFubFFIdMWJGN5WuQhHCNmzk7QgiVfrViFxcS99j7F5dDS5EP6raR54I+2ydhe4+5/XTn/YIEppFaqqVWHsw==",
|
|
3293
|
+
"license": "MIT",
|
|
3288
3294
|
"dependencies": {
|
|
3289
3295
|
"@messageformat/date-skeleton": "^1.0.0",
|
|
3290
3296
|
"@messageformat/number-skeleton": "^1.0.0",
|
|
@@ -3297,17 +3303,20 @@
|
|
|
3297
3303
|
"node_modules/@messageformat/date-skeleton": {
|
|
3298
3304
|
"version": "1.1.0",
|
|
3299
3305
|
"resolved": "https://registry.npmjs.org/@messageformat/date-skeleton/-/date-skeleton-1.1.0.tgz",
|
|
3300
|
-
"integrity": "sha512-rmGAfB1tIPER+gh3p/RgA+PVeRE/gxuQ2w4snFWPF5xtb5mbWR7Cbw7wCOftcUypbD6HVoxrVdyyghPm3WzP5A=="
|
|
3306
|
+
"integrity": "sha512-rmGAfB1tIPER+gh3p/RgA+PVeRE/gxuQ2w4snFWPF5xtb5mbWR7Cbw7wCOftcUypbD6HVoxrVdyyghPm3WzP5A==",
|
|
3307
|
+
"license": "MIT"
|
|
3301
3308
|
},
|
|
3302
3309
|
"node_modules/@messageformat/number-skeleton": {
|
|
3303
3310
|
"version": "1.2.0",
|
|
3304
3311
|
"resolved": "https://registry.npmjs.org/@messageformat/number-skeleton/-/number-skeleton-1.2.0.tgz",
|
|
3305
|
-
"integrity": "sha512-xsgwcL7J7WhlHJ3RNbaVgssaIwcEyFkBqxHdcdaiJzwTZAWEOD8BuUFxnxV9k5S0qHN3v/KzUpq0IUpjH1seRg=="
|
|
3312
|
+
"integrity": "sha512-xsgwcL7J7WhlHJ3RNbaVgssaIwcEyFkBqxHdcdaiJzwTZAWEOD8BuUFxnxV9k5S0qHN3v/KzUpq0IUpjH1seRg==",
|
|
3313
|
+
"license": "MIT"
|
|
3306
3314
|
},
|
|
3307
3315
|
"node_modules/@messageformat/parser": {
|
|
3308
3316
|
"version": "5.1.1",
|
|
3309
3317
|
"resolved": "https://registry.npmjs.org/@messageformat/parser/-/parser-5.1.1.tgz",
|
|
3310
3318
|
"integrity": "sha512-3p0YRGCcTUCYvBKLIxtDDyrJ0YijGIwrTRu1DT8gIviIDZru8H23+FkY6MJBzM1n9n20CiM4VeDYuBsrrwnLjg==",
|
|
3319
|
+
"license": "MIT",
|
|
3311
3320
|
"dependencies": {
|
|
3312
3321
|
"moo": "^0.5.1"
|
|
3313
3322
|
}
|
|
@@ -4979,7 +4988,8 @@
|
|
|
4979
4988
|
"node_modules/@types/minimatch": {
|
|
4980
4989
|
"version": "3.0.5",
|
|
4981
4990
|
"resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.5.tgz",
|
|
4982
|
-
"integrity": "sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ=="
|
|
4991
|
+
"integrity": "sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==",
|
|
4992
|
+
"license": "MIT"
|
|
4983
4993
|
},
|
|
4984
4994
|
"node_modules/@types/node": {
|
|
4985
4995
|
"version": "20.16.5",
|
|
@@ -5554,6 +5564,7 @@
|
|
|
5554
5564
|
"version": "3.0.0",
|
|
5555
5565
|
"resolved": "https://registry.npmjs.org/array-differ/-/array-differ-3.0.0.tgz",
|
|
5556
5566
|
"integrity": "sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg==",
|
|
5567
|
+
"license": "MIT",
|
|
5557
5568
|
"engines": {
|
|
5558
5569
|
"node": ">=8"
|
|
5559
5570
|
}
|
|
@@ -5783,6 +5794,7 @@
|
|
|
5783
5794
|
"version": "2.0.1",
|
|
5784
5795
|
"resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz",
|
|
5785
5796
|
"integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==",
|
|
5797
|
+
"license": "MIT",
|
|
5786
5798
|
"engines": {
|
|
5787
5799
|
"node": ">=8"
|
|
5788
5800
|
}
|
|
@@ -6076,12 +6088,6 @@
|
|
|
6076
6088
|
"resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz",
|
|
6077
6089
|
"integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww=="
|
|
6078
6090
|
},
|
|
6079
|
-
"node_modules/boolean": {
|
|
6080
|
-
"version": "3.2.0",
|
|
6081
|
-
"resolved": "https://registry.npmjs.org/boolean/-/boolean-3.2.0.tgz",
|
|
6082
|
-
"integrity": "sha512-d0II/GO9uf9lfUHH2BQsjxzRJZBdsjgsBiW4BvhWk/3qoKwQFjIDVN19PfX8F2D/r9PCMTtLWjYVCFrpeYUzsw==",
|
|
6083
|
-
"deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."
|
|
6084
|
-
},
|
|
6085
6091
|
"node_modules/bowser": {
|
|
6086
6092
|
"version": "2.14.1",
|
|
6087
6093
|
"resolved": "https://registry.npmjs.org/bowser/-/bowser-2.14.1.tgz",
|
|
@@ -6768,9 +6774,10 @@
|
|
|
6768
6774
|
}
|
|
6769
6775
|
},
|
|
6770
6776
|
"node_modules/debug": {
|
|
6771
|
-
"version": "4.3
|
|
6772
|
-
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.
|
|
6773
|
-
"integrity": "sha512-
|
|
6777
|
+
"version": "4.4.3",
|
|
6778
|
+
"resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",
|
|
6779
|
+
"integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",
|
|
6780
|
+
"license": "MIT",
|
|
6774
6781
|
"dependencies": {
|
|
6775
6782
|
"ms": "^2.1.3"
|
|
6776
6783
|
},
|
|
@@ -7103,13 +7110,13 @@
|
|
|
7103
7110
|
"devOptional": true
|
|
7104
7111
|
},
|
|
7105
7112
|
"node_modules/email-templates": {
|
|
7106
|
-
"version": "13.0.
|
|
7107
|
-
"resolved": "https://registry.npmjs.org/email-templates/-/email-templates-13.0.
|
|
7108
|
-
"integrity": "sha512-
|
|
7113
|
+
"version": "13.0.1",
|
|
7114
|
+
"resolved": "https://registry.npmjs.org/email-templates/-/email-templates-13.0.1.tgz",
|
|
7115
|
+
"integrity": "sha512-kIH40FwhiE20Fh5DR1wrVM0HETYPoqfihUAgUwZtZgPK6VJNTCdJzTo7yxcgYmvMmKgqGJFSXE8/pEkeVmjuDg==",
|
|
7109
7116
|
"license": "MIT",
|
|
7110
7117
|
"dependencies": {
|
|
7111
7118
|
"@ladjs/consolidate": "^1.0.4",
|
|
7112
|
-
"@ladjs/i18n": "^
|
|
7119
|
+
"@ladjs/i18n": "^10.0.0",
|
|
7113
7120
|
"get-paths": "^0.0.7",
|
|
7114
7121
|
"html-to-text": "^9.0.5",
|
|
7115
7122
|
"juice": "^11.0.3",
|
|
@@ -8446,6 +8453,7 @@
|
|
|
8446
8453
|
"version": "1.6.10",
|
|
8447
8454
|
"resolved": "https://registry.npmjs.org/fast-printf/-/fast-printf-1.6.10.tgz",
|
|
8448
8455
|
"integrity": "sha512-GwTgG9O4FVIdShhbVF3JxOgSBY2+ePGsu2V/UONgoCPzF9VY6ZdBMKsHKCYQHZwNk3qNouUolRDsgVxcVA5G1w==",
|
|
8456
|
+
"license": "BSD-3-Clause",
|
|
8449
8457
|
"engines": {
|
|
8450
8458
|
"node": ">=10.0"
|
|
8451
8459
|
}
|
|
@@ -9311,14 +9319,15 @@
|
|
|
9311
9319
|
}
|
|
9312
9320
|
},
|
|
9313
9321
|
"node_modules/i18n": {
|
|
9314
|
-
"version": "0.15.
|
|
9315
|
-
"resolved": "https://registry.npmjs.org/i18n/-/i18n-0.15.
|
|
9316
|
-
"integrity": "sha512-
|
|
9322
|
+
"version": "0.15.3",
|
|
9323
|
+
"resolved": "https://registry.npmjs.org/i18n/-/i18n-0.15.3.tgz",
|
|
9324
|
+
"integrity": "sha512-tW/AA5R4lJZLnd60Agcd0PfXB1C2G7UqTrdNewuv/SIYdxcHkCE8w4Zx1SgCjJ+2BLuAAGIG/KXb/xNYF1lO5Q==",
|
|
9325
|
+
"license": "MIT",
|
|
9317
9326
|
"dependencies": {
|
|
9318
|
-
"@messageformat/core": "^3.
|
|
9319
|
-
"debug": "^4.
|
|
9320
|
-
"fast-printf": "^1.6.
|
|
9321
|
-
"make-plural": "^7.
|
|
9327
|
+
"@messageformat/core": "^3.4.0",
|
|
9328
|
+
"debug": "^4.4.3",
|
|
9329
|
+
"fast-printf": "^1.6.10",
|
|
9330
|
+
"make-plural": "^7.4.0",
|
|
9322
9331
|
"math-interval-parser": "^2.0.1",
|
|
9323
9332
|
"mustache": "^4.2.0"
|
|
9324
9333
|
},
|
|
@@ -9333,6 +9342,7 @@
|
|
|
9333
9342
|
"version": "0.0.5",
|
|
9334
9343
|
"resolved": "https://registry.npmjs.org/i18n-locales/-/i18n-locales-0.0.5.tgz",
|
|
9335
9344
|
"integrity": "sha512-Kve1AHy6rqyfJHPy8MIvaKBKhHhHPXV+a/TgMkjp3UBhO3gfWR40ZQn8Xy7LI6g3FhmbvkFtv+GCZy6yvuyeHQ==",
|
|
9345
|
+
"license": "MIT",
|
|
9336
9346
|
"dependencies": {
|
|
9337
9347
|
"@ladjs/country-language": "^0.2.1"
|
|
9338
9348
|
}
|
|
@@ -9341,6 +9351,7 @@
|
|
|
9341
9351
|
"version": "0.2.1",
|
|
9342
9352
|
"resolved": "https://registry.npmjs.org/@ladjs/country-language/-/country-language-0.2.1.tgz",
|
|
9343
9353
|
"integrity": "sha512-e3AmT7jUnfNE6e2mx2+cPYiWdFW3McySDGRhQEYE6SksjZTMj0PTp+R9x1xG89tHRTsyMNJFl9J4HtZPWZzi1Q==",
|
|
9354
|
+
"license": "MIT",
|
|
9344
9355
|
"dependencies": {
|
|
9345
9356
|
"underscore": "~1.13.1",
|
|
9346
9357
|
"underscore.deep": "~0.5.1"
|
|
@@ -11402,9 +11413,10 @@
|
|
|
11402
11413
|
"dev": true
|
|
11403
11414
|
},
|
|
11404
11415
|
"node_modules/make-plural": {
|
|
11405
|
-
"version": "7.
|
|
11406
|
-
"resolved": "https://registry.npmjs.org/make-plural/-/make-plural-7.
|
|
11407
|
-
"integrity": "sha512-
|
|
11416
|
+
"version": "7.5.0",
|
|
11417
|
+
"resolved": "https://registry.npmjs.org/make-plural/-/make-plural-7.5.0.tgz",
|
|
11418
|
+
"integrity": "sha512-0booA+aVYyVFoR67JBHdfVk0U08HmrBH2FrtmBqBa+NldlqXv/G2Z9VQuQq6Wgp2jDWdybEWGfBkk1cq5264WA==",
|
|
11419
|
+
"license": "Unicode-DFS-2016"
|
|
11408
11420
|
},
|
|
11409
11421
|
"node_modules/makeerror": {
|
|
11410
11422
|
"version": "1.0.12",
|
|
@@ -11419,6 +11431,7 @@
|
|
|
11419
11431
|
"version": "2.0.1",
|
|
11420
11432
|
"resolved": "https://registry.npmjs.org/math-interval-parser/-/math-interval-parser-2.0.1.tgz",
|
|
11421
11433
|
"integrity": "sha512-VmlAmb0UJwlvMyx8iPhXUDnVW1F9IrGEd9CIOmv+XL8AErCUUuozoDMrgImvnYt2A+53qVX/tPW6YJurMKYsvA==",
|
|
11434
|
+
"license": "MIT",
|
|
11422
11435
|
"engines": {
|
|
11423
11436
|
"node": ">=0.10.0"
|
|
11424
11437
|
}
|
|
@@ -11569,9 +11582,10 @@
|
|
|
11569
11582
|
}
|
|
11570
11583
|
},
|
|
11571
11584
|
"node_modules/moo": {
|
|
11572
|
-
"version": "0.5.
|
|
11573
|
-
"resolved": "https://registry.npmjs.org/moo/-/moo-0.5.
|
|
11574
|
-
"integrity": "sha512-
|
|
11585
|
+
"version": "0.5.3",
|
|
11586
|
+
"resolved": "https://registry.npmjs.org/moo/-/moo-0.5.3.tgz",
|
|
11587
|
+
"integrity": "sha512-m2fmM2dDm7GZQsY7KK2cme8agi+AAljILjQnof7p1ZMDe6dQ4bdnSMx0cPppudoeNv5hEFQirN6u+O4fDE0IWA==",
|
|
11588
|
+
"license": "BSD-3-Clause"
|
|
11575
11589
|
},
|
|
11576
11590
|
"node_modules/ms": {
|
|
11577
11591
|
"version": "2.1.3",
|
|
@@ -11582,6 +11596,7 @@
|
|
|
11582
11596
|
"version": "5.0.0",
|
|
11583
11597
|
"resolved": "https://registry.npmjs.org/multimatch/-/multimatch-5.0.0.tgz",
|
|
11584
11598
|
"integrity": "sha512-ypMKuglUrZUD99Tk2bUQ+xNQj43lPEfAeX2o9cTteAmShXy2VHDJpuwu1o0xqoKCt9jLVAvwyFKdLTPXKAfJyA==",
|
|
11599
|
+
"license": "MIT",
|
|
11585
11600
|
"dependencies": {
|
|
11586
11601
|
"@types/minimatch": "^3.0.3",
|
|
11587
11602
|
"array-differ": "^3.0.0",
|
|
@@ -11695,9 +11710,9 @@
|
|
|
11695
11710
|
"devOptional": true
|
|
11696
11711
|
},
|
|
11697
11712
|
"node_modules/nodemailer": {
|
|
11698
|
-
"version": "8.0.
|
|
11699
|
-
"resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-8.0.
|
|
11700
|
-
"integrity": "sha512-
|
|
11713
|
+
"version": "8.0.5",
|
|
11714
|
+
"resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-8.0.5.tgz",
|
|
11715
|
+
"integrity": "sha512-0PF8Yb1yZuQfQbq+5/pZJrtF6WQcjTd5/S4JOHs9PGFxuTqoB/icwuB44pOdURHJbRKX1PPoJZtY7R4VUoCC8w==",
|
|
11701
11716
|
"license": "MIT-0",
|
|
11702
11717
|
"engines": {
|
|
11703
11718
|
"node": ">=6.0.0"
|
|
@@ -13462,7 +13477,8 @@
|
|
|
13462
13477
|
"node_modules/safe-identifier": {
|
|
13463
13478
|
"version": "0.4.2",
|
|
13464
13479
|
"resolved": "https://registry.npmjs.org/safe-identifier/-/safe-identifier-0.4.2.tgz",
|
|
13465
|
-
"integrity": "sha512-6pNbSMW6OhAi9j+N8V+U715yBQsaWJ7eyEUaOrawX+isg5ZxhUlV1NipNtgaKHmFGiABwt+ZF04Ii+3Xjkg+8w=="
|
|
13480
|
+
"integrity": "sha512-6pNbSMW6OhAi9j+N8V+U715yBQsaWJ7eyEUaOrawX+isg5ZxhUlV1NipNtgaKHmFGiABwt+ZF04Ii+3Xjkg+8w==",
|
|
13481
|
+
"license": "ISC"
|
|
13466
13482
|
},
|
|
13467
13483
|
"node_modules/safe-push-apply": {
|
|
13468
13484
|
"version": "1.0.0",
|
|
@@ -14305,6 +14321,7 @@
|
|
|
14305
14321
|
"version": "2.1.0",
|
|
14306
14322
|
"resolved": "https://registry.npmjs.org/titleize/-/titleize-2.1.0.tgz",
|
|
14307
14323
|
"integrity": "sha512-m+apkYlfiQTKLW+sI4vqUkwMEzfgEUEYSqljx1voUE3Wz/z1ZsxyzSxvH2X8uKVrOp7QkByWt0rA6+gvhCKy6g==",
|
|
14324
|
+
"license": "MIT",
|
|
14308
14325
|
"engines": {
|
|
14309
14326
|
"node": ">=6"
|
|
14310
14327
|
}
|
|
@@ -14763,6 +14780,7 @@
|
|
|
14763
14780
|
"version": "0.5.3",
|
|
14764
14781
|
"resolved": "https://registry.npmjs.org/underscore.deep/-/underscore.deep-0.5.3.tgz",
|
|
14765
14782
|
"integrity": "sha512-4OuSOlFNkiVFVc3khkeG112Pdu1gbitMj7t9B9ENb61uFmN70Jq7Iluhi3oflcSgexkKfDdJ5XAJET2gEq6ikA==",
|
|
14783
|
+
"license": "BSD",
|
|
14766
14784
|
"engines": {
|
|
14767
14785
|
"node": ">=0.10.x"
|
|
14768
14786
|
},
|
|
@@ -15365,9 +15383,11 @@
|
|
|
15365
15383
|
}
|
|
15366
15384
|
},
|
|
15367
15385
|
"node_modules/zod": {
|
|
15368
|
-
"version": "3.
|
|
15369
|
-
"resolved": "https://registry.npmjs.org/zod/-/zod-3.
|
|
15370
|
-
"integrity": "sha512-
|
|
15386
|
+
"version": "3.25.76",
|
|
15387
|
+
"resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz",
|
|
15388
|
+
"integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==",
|
|
15389
|
+
"dev": true,
|
|
15390
|
+
"license": "MIT",
|
|
15371
15391
|
"funding": {
|
|
15372
15392
|
"url": "https://github.com/sponsors/colinhacks"
|
|
15373
15393
|
}
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@creator.co/wapi",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"cors": "^2.8.5",
|
|
40
40
|
"cuid": "^3.0.0",
|
|
41
41
|
"dotenv": "^16.4.1",
|
|
42
|
-
"email-templates": "^13.0.
|
|
42
|
+
"email-templates": "^13.0.1",
|
|
43
43
|
"express": "^4.22.0",
|
|
44
44
|
"express-rate-limit": "^7.5.0",
|
|
45
45
|
"json-stringify-safe": "^5.0.1",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"knex-stringcase": "^1.4.6",
|
|
49
49
|
"kysely": "^0.28.14",
|
|
50
50
|
"node-cache": "^5.1.2",
|
|
51
|
-
"nodemailer": "^8.0.
|
|
51
|
+
"nodemailer": "^8.0.5",
|
|
52
52
|
"object-hash": "^3.0.0",
|
|
53
53
|
"parse-duration": "^2.1.3",
|
|
54
54
|
"path-to-regexp": "^8.4.0",
|
|
@@ -56,8 +56,7 @@
|
|
|
56
56
|
"rate-limit-redis": "^4.2.0",
|
|
57
57
|
"redis": "^4.7.0",
|
|
58
58
|
"sha1": "^1.1.1",
|
|
59
|
-
"stack-trace": "0.0.10"
|
|
60
|
-
"zod": "^3.23.4"
|
|
59
|
+
"stack-trace": "0.0.10"
|
|
61
60
|
},
|
|
62
61
|
"devDependencies": {
|
|
63
62
|
"@go-task/cli": "^3.39.0",
|
|
@@ -88,6 +87,10 @@
|
|
|
88
87
|
"supertest": "^7.1.1",
|
|
89
88
|
"ts-jest": "^29.2.5",
|
|
90
89
|
"ts-node": "^10.9.1",
|
|
91
|
-
"typescript": "^5.5.0"
|
|
90
|
+
"typescript": "^5.5.0",
|
|
91
|
+
"zod": "^3.25.76"
|
|
92
|
+
},
|
|
93
|
+
"peerDependencies": {
|
|
94
|
+
"zod": "^3.23.4"
|
|
92
95
|
}
|
|
93
96
|
}
|
|
@@ -50,9 +50,9 @@ export interface GlobalRateLimitConfig {
|
|
|
50
50
|
* @property {string} path - The path of the route.
|
|
51
51
|
* @property {string} method - The HTTP method of the route.
|
|
52
52
|
* @property {TransactionExecution<Transaction<InputType, OutputType | ResponseErrorType>, OutputType | ResponseErrorType>} handler - The handler function for the route.
|
|
53
|
-
* @property {?z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any>}[inputSchema] - The input schema for validating the input data.
|
|
54
|
-
* @property {?z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any>}[pathSchema] - The path schema for validating the path data.
|
|
55
|
-
* @property {?z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any>}[querySchema] - The query schema for validating the query data.
|
|
53
|
+
* @property {?z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any> | z.ZodEffects<any>}[inputSchema] - The input schema for validating the input data. ZodEffects is supported so schemas using .refine/.superRefine/.transform can be passed directly.
|
|
54
|
+
* @property {?z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any> | z.ZodEffects<any>}[pathSchema] - The path schema for validating the path data.
|
|
55
|
+
* @property {?z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any> | z.ZodEffects<any>}[querySchema] - The query schema for validating the query data.
|
|
56
56
|
*/
|
|
57
57
|
export interface Route<InputType = never, OutputType = never, PathParamsType = StringMap, QueryParamsType = StringMap> {
|
|
58
58
|
/**
|
|
@@ -74,22 +74,23 @@ export interface Route<InputType = never, OutputType = never, PathParamsType = S
|
|
|
74
74
|
handler: TransactionExecution<Transaction<InputType, OutputType | ResponseErrorType, never, PathParamsType, QueryParamsType>, OutputType | ResponseErrorType>;
|
|
75
75
|
/**
|
|
76
76
|
* An optional input schema for validating the structure of the input data.
|
|
77
|
+
* ZodEffects is supported so schemas wrapped with .refine/.superRefine/.transform can be used directly.
|
|
77
78
|
*
|
|
78
|
-
* @type {?z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any>}
|
|
79
|
+
* @type {?z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any> | z.ZodEffects<any>}
|
|
79
80
|
*/
|
|
80
|
-
inputSchema?: z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any>;
|
|
81
|
+
inputSchema?: z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any> | z.ZodEffects<any>;
|
|
81
82
|
/**
|
|
82
83
|
* An optional input schema for validating the structure of the path params.
|
|
83
84
|
*
|
|
84
|
-
* @type {?z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any>}
|
|
85
|
+
* @type {?z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any> | z.ZodEffects<any>}
|
|
85
86
|
*/
|
|
86
|
-
pathSchema?: z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any>;
|
|
87
|
+
pathSchema?: z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any> | z.ZodEffects<any>;
|
|
87
88
|
/**
|
|
88
89
|
* An optional input schema for validating the structure of the query params.
|
|
89
90
|
*
|
|
90
|
-
* @type {?z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any>}
|
|
91
|
+
* @type {?z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any> | z.ZodEffects<any>}
|
|
91
92
|
*/
|
|
92
|
-
querySchema?: z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any>;
|
|
93
|
+
querySchema?: z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any> | z.ZodEffects<any>;
|
|
93
94
|
/**
|
|
94
95
|
* An optional openApi object with extra metadata for docs generation.
|
|
95
96
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Router.js","sourceRoot":"","sources":["../../../src/Server/Router.ts"],"names":[],"mappings":"AAMA,OAAO,eAAe,MAAM,0BAA0B,CAAA;AACtD,OAAO,MAAM,MAAM,iBAAiB,CAAA;AAQpC,OAAO,KAAK,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"Router.js","sourceRoot":"","sources":["../../../src/Server/Router.ts"],"names":[],"mappings":"AAMA,OAAO,eAAe,MAAM,0BAA0B,CAAA;AACtD,OAAO,MAAM,MAAM,iBAAiB,CAAA;AAQpC,OAAO,KAAK,MAAM,kBAAkB,CAAA;AAsMpC;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,MAAM;IAUzB;;;;OAIG;IACH,YAAY,MAAoB;QAC9B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,CAAA;IACrF,CAAC;IAED;;;OAGG;IACI,SAAS;QACd,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAA;IAChC,CAAC;IAED;;;OAGG;IACK,WAAW;QACjB,OAAO,KAAK,CAAC,qBAAqB,EAAE,CAAA;IACtC,CAAC;CACF"}
|
|
@@ -3,15 +3,15 @@ import Response, { ResponseErrorType } from '../API/Response.js';
|
|
|
3
3
|
/**
|
|
4
4
|
* Validates the given data against the provided schema.
|
|
5
5
|
* @param {any} data - The data to be validated.
|
|
6
|
-
* @param {z.ZodObject<any>} schema - The schema to validate against.
|
|
6
|
+
* @param {z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any> | z.ZodEffects<any>} schema - The schema to validate against.
|
|
7
7
|
* @returns {boolean | Response<ResponseErrorType>} - Returns true if the data is valid, otherwise returns a response object with an error message.
|
|
8
8
|
*/
|
|
9
9
|
export default class Validator {
|
|
10
10
|
/**
|
|
11
11
|
* Validates the given data against the provided schema.
|
|
12
12
|
* @param {any} data - The data to be validated.
|
|
13
|
-
* @param {z.ZodObject<any> | z.ZodUnion<any>} schema - The schema to validate against.
|
|
13
|
+
* @param {z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any> | z.ZodEffects<any>} schema - The schema to validate against.
|
|
14
14
|
* @returns {boolean | Response<ResponseErrorType>} - Returns either true if the data is valid or a Response object with an error message if validation fails.
|
|
15
15
|
*/
|
|
16
|
-
static validateSchema(data: any, schema: z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any>): boolean | Response<ResponseErrorType>;
|
|
16
|
+
static validateSchema(data: any, schema: z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any> | z.ZodEffects<any>): boolean | Response<ResponseErrorType>;
|
|
17
17
|
}
|
|
@@ -4,14 +4,14 @@ import Globals from '../Globals.js';
|
|
|
4
4
|
/**
|
|
5
5
|
* Validates the given data against the provided schema.
|
|
6
6
|
* @param {any} data - The data to be validated.
|
|
7
|
-
* @param {z.ZodObject<any>} schema - The schema to validate against.
|
|
7
|
+
* @param {z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any> | z.ZodEffects<any>} schema - The schema to validate against.
|
|
8
8
|
* @returns {boolean | Response<ResponseErrorType>} - Returns true if the data is valid, otherwise returns a response object with an error message.
|
|
9
9
|
*/
|
|
10
10
|
export default class Validator {
|
|
11
11
|
/**
|
|
12
12
|
* Validates the given data against the provided schema.
|
|
13
13
|
* @param {any} data - The data to be validated.
|
|
14
|
-
* @param {z.ZodObject<any> | z.ZodUnion<any>} schema - The schema to validate against.
|
|
14
|
+
* @param {z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any> | z.ZodEffects<any>} schema - The schema to validate against.
|
|
15
15
|
* @returns {boolean | Response<ResponseErrorType>} - Returns either true if the data is valid or a Response object with an error message if validation fails.
|
|
16
16
|
*/
|
|
17
17
|
static validateSchema(data, schema) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Validator.js","sourceRoot":"","sources":["../../../src/Validation/Validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,QAA+B,MAAM,oBAAoB,CAAA;AAChE,OAAO,OAAO,MAAM,eAAe,CAAA;AAEnC;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAO,SAAS;IAC5B;;;;;OAKG;IACI,MAAM,CAAC,cAAc,CAC1B,IAAS,EACT,
|
|
1
|
+
{"version":3,"file":"Validator.js","sourceRoot":"","sources":["../../../src/Validation/Validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,QAA+B,MAAM,oBAAoB,CAAA;AAChE,OAAO,OAAO,MAAM,eAAe,CAAA;AAEnC;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAO,SAAS;IAC5B;;;;;OAKG;IACI,MAAM,CAAC,cAAc,CAC1B,IAAS,EACT,MAA4F;QAE5F,IAAI,KAAK,EAAE,cAAc,CAAA;QAEzB,yCAAyC;QACzC,IAAI,CAAC;YACH,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;YAClB,cAAc,GAAG,IAAI,CAAA;QACvB,CAAC;QAAC,OAAO,GAAqB,EAAE,CAAC;YAC/B,IAAI,GAAG,YAAY,CAAC,CAAC,QAAQ;gBAAE,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;;gBACzD,KAAK,GAAG,2BAA2B,CAAA,CAAC,8BAA8B;QACzE,CAAC;QAED,mBAAmB;QACnB,IAAI,CAAC,cAAc,IAAI,KAAK,EAAE,CAAC;YAC7B,OAAO,QAAQ,CAAC,kBAAkB,CAChC,OAAO,CAAC,2BAA2B,EACnC,OAAO,CAAC,sBAAsB,EAC9B,EAAE,iBAAiB,EAAE,KAAK,EAAE,CAC7B,CAAA;QACH,CAAC;aAAM,CAAC;YACN,OAAO,IAAI,CAAA;QACb,CAAC;IACH,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@creator.co/wapi",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"cors": "^2.8.5",
|
|
40
40
|
"cuid": "^3.0.0",
|
|
41
41
|
"dotenv": "^16.4.1",
|
|
42
|
-
"email-templates": "^13.0.
|
|
42
|
+
"email-templates": "^13.0.1",
|
|
43
43
|
"express": "^4.22.0",
|
|
44
44
|
"express-rate-limit": "^7.5.0",
|
|
45
45
|
"json-stringify-safe": "^5.0.1",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"knex-stringcase": "^1.4.6",
|
|
49
49
|
"kysely": "^0.28.14",
|
|
50
50
|
"node-cache": "^5.1.2",
|
|
51
|
-
"nodemailer": "^8.0.
|
|
51
|
+
"nodemailer": "^8.0.5",
|
|
52
52
|
"object-hash": "^3.0.0",
|
|
53
53
|
"parse-duration": "^2.1.3",
|
|
54
54
|
"path-to-regexp": "^8.4.0",
|
|
@@ -56,8 +56,7 @@
|
|
|
56
56
|
"rate-limit-redis": "^4.2.0",
|
|
57
57
|
"redis": "^4.7.0",
|
|
58
58
|
"sha1": "^1.1.1",
|
|
59
|
-
"stack-trace": "0.0.10"
|
|
60
|
-
"zod": "^3.23.4"
|
|
59
|
+
"stack-trace": "0.0.10"
|
|
61
60
|
},
|
|
62
61
|
"devDependencies": {
|
|
63
62
|
"@go-task/cli": "^3.39.0",
|
|
@@ -88,6 +87,10 @@
|
|
|
88
87
|
"supertest": "^7.1.1",
|
|
89
88
|
"ts-jest": "^29.2.5",
|
|
90
89
|
"ts-node": "^10.9.1",
|
|
91
|
-
"typescript": "^5.5.0"
|
|
90
|
+
"typescript": "^5.5.0",
|
|
91
|
+
"zod": "^3.25.76"
|
|
92
|
+
},
|
|
93
|
+
"peerDependencies": {
|
|
94
|
+
"zod": "^3.23.4"
|
|
92
95
|
}
|
|
93
96
|
}
|
package/src/Server/Router.ts
CHANGED
|
@@ -62,9 +62,9 @@ export interface GlobalRateLimitConfig {
|
|
|
62
62
|
* @property {string} path - The path of the route.
|
|
63
63
|
* @property {string} method - The HTTP method of the route.
|
|
64
64
|
* @property {TransactionExecution<Transaction<InputType, OutputType | ResponseErrorType>, OutputType | ResponseErrorType>} handler - The handler function for the route.
|
|
65
|
-
* @property {?z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any>}[inputSchema] - The input schema for validating the input data.
|
|
66
|
-
* @property {?z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any>}[pathSchema] - The path schema for validating the path data.
|
|
67
|
-
* @property {?z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any>}[querySchema] - The query schema for validating the query data.
|
|
65
|
+
* @property {?z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any> | z.ZodEffects<any>}[inputSchema] - The input schema for validating the input data. ZodEffects is supported so schemas using .refine/.superRefine/.transform can be passed directly.
|
|
66
|
+
* @property {?z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any> | z.ZodEffects<any>}[pathSchema] - The path schema for validating the path data.
|
|
67
|
+
* @property {?z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any> | z.ZodEffects<any>}[querySchema] - The query schema for validating the query data.
|
|
68
68
|
*/
|
|
69
69
|
export interface Route<
|
|
70
70
|
InputType = never,
|
|
@@ -100,24 +100,25 @@ export interface Route<
|
|
|
100
100
|
>
|
|
101
101
|
/**
|
|
102
102
|
* An optional input schema for validating the structure of the input data.
|
|
103
|
+
* ZodEffects is supported so schemas wrapped with .refine/.superRefine/.transform can be used directly.
|
|
103
104
|
*
|
|
104
|
-
* @type {?z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any>}
|
|
105
|
+
* @type {?z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any> | z.ZodEffects<any>}
|
|
105
106
|
*/
|
|
106
|
-
inputSchema?: z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any>
|
|
107
|
+
inputSchema?: z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any> | z.ZodEffects<any>
|
|
107
108
|
|
|
108
109
|
/**
|
|
109
110
|
* An optional input schema for validating the structure of the path params.
|
|
110
111
|
*
|
|
111
|
-
* @type {?z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any>}
|
|
112
|
+
* @type {?z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any> | z.ZodEffects<any>}
|
|
112
113
|
*/
|
|
113
|
-
pathSchema?: z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any>
|
|
114
|
+
pathSchema?: z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any> | z.ZodEffects<any>
|
|
114
115
|
|
|
115
116
|
/**
|
|
116
117
|
* An optional input schema for validating the structure of the query params.
|
|
117
118
|
*
|
|
118
|
-
* @type {?z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any>}
|
|
119
|
+
* @type {?z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any> | z.ZodEffects<any>}
|
|
119
120
|
*/
|
|
120
|
-
querySchema?: z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any>
|
|
121
|
+
querySchema?: z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any> | z.ZodEffects<any>
|
|
121
122
|
|
|
122
123
|
/**
|
|
123
124
|
* An optional openApi object with extra metadata for docs generation.
|
|
@@ -6,19 +6,19 @@ import Globals from '../Globals.js'
|
|
|
6
6
|
/**
|
|
7
7
|
* Validates the given data against the provided schema.
|
|
8
8
|
* @param {any} data - The data to be validated.
|
|
9
|
-
* @param {z.ZodObject<any>} schema - The schema to validate against.
|
|
9
|
+
* @param {z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any> | z.ZodEffects<any>} schema - The schema to validate against.
|
|
10
10
|
* @returns {boolean | Response<ResponseErrorType>} - Returns true if the data is valid, otherwise returns a response object with an error message.
|
|
11
11
|
*/
|
|
12
12
|
export default class Validator {
|
|
13
13
|
/**
|
|
14
14
|
* Validates the given data against the provided schema.
|
|
15
15
|
* @param {any} data - The data to be validated.
|
|
16
|
-
* @param {z.ZodObject<any> | z.ZodUnion<any>} schema - The schema to validate against.
|
|
16
|
+
* @param {z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any> | z.ZodEffects<any>} schema - The schema to validate against.
|
|
17
17
|
* @returns {boolean | Response<ResponseErrorType>} - Returns either true if the data is valid or a Response object with an error message if validation fails.
|
|
18
18
|
*/
|
|
19
19
|
public static validateSchema(
|
|
20
20
|
data: any,
|
|
21
|
-
schema: z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any>
|
|
21
|
+
schema: z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any> | z.ZodEffects<any>
|
|
22
22
|
): boolean | Response<ResponseErrorType> {
|
|
23
23
|
let error, validatedInput
|
|
24
24
|
|