@galeh/chuka 1.1.2 → 1.1.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/decorators.d.ts +8 -0
- package/decorators.js +107 -0
- package/index.d.ts +202 -0
- package/index.js +167 -0
- package/middlewares.d.ts +20 -0
- package/middlewares.js +107 -0
- package/package.json +40 -49
- package/validators.d.ts +60 -0
- package/validators.js +105 -0
- package/.github/workflows/webpack.yml +0 -34
- package/config/api-extractor.decorators.json +0 -427
- package/config/api-extractor.index.json +0 -427
- package/config/api-extractor.middlewares.json +0 -427
- package/config/api-extractor.validators.json +0 -427
- package/sample/01-cats-app/package-lock.json +0 -283
- package/sample/01-cats-app/package.json +0 -19
- package/sample/01-cats-app/src/cats/cat-model.ts +0 -9
- package/sample/01-cats-app/src/cats/cats-controller.ts +0 -44
- package/sample/01-cats-app/src/cats/cats-service-interface.ts +0 -7
- package/sample/01-cats-app/src/cats/cats-service.ts +0 -27
- package/sample/01-cats-app/src/cats/create-logger.ts +0 -8
- package/sample/01-cats-app/src/main.ts +0 -30
- package/sample/01-cats-app/tsconfig.json +0 -112
- package/sample/02-socket/package-lock.json +0 -442
- package/sample/02-socket/package.json +0 -20
- package/sample/02-socket/src/controllers/http-controller.ts +0 -14
- package/sample/02-socket/src/controllers/socket-controller.ts +0 -18
- package/sample/02-socket/src/main.ts +0 -46
- package/sample/02-socket/src/middleware/create-session.ts +0 -9
- package/sample/02-socket/tsconfig.json +0 -112
- package/sample/03-authentication/db/create.sql +0 -6
- package/sample/03-authentication/package-lock.json +0 -1832
- package/sample/03-authentication/package.json +0 -23
- package/sample/03-authentication/src/config.ts +0 -21
- package/sample/03-authentication/src/controllers/auth-controller.ts +0 -54
- package/sample/03-authentication/src/enums/injection-tokens.ts +0 -5
- package/sample/03-authentication/src/enums/result-codes.ts +0 -4
- package/sample/03-authentication/src/exceptions/error.ts +0 -7
- package/sample/03-authentication/src/exceptions/password-not-found-exception.ts +0 -9
- package/sample/03-authentication/src/exceptions/unauthorized-exception.ts +0 -9
- package/sample/03-authentication/src/exceptions/user-already-exist.ts +0 -9
- package/sample/03-authentication/src/exceptions/user-not-found.ts +0 -9
- package/sample/03-authentication/src/exceptions/wrong-login-info-exception.ts +0 -8
- package/sample/03-authentication/src/main.ts +0 -42
- package/sample/03-authentication/src/middlewares/auth-handler.ts +0 -17
- package/sample/03-authentication/src/middlewares/global-error-handler.ts +0 -21
- package/sample/03-authentication/src/models/user-model.ts +0 -6
- package/sample/03-authentication/src/services/auth-service.ts +0 -50
- package/sample/03-authentication/src/services/interfaces/auth-service-interface.ts +0 -7
- package/sample/03-authentication/src/services/interfaces/user-service-interface.ts +0 -7
- package/sample/03-authentication/src/services/user-service.ts +0 -75
- package/sample/03-authentication/src/types/connection.ts +0 -3
- package/sample/03-authentication/src/types/token.ts +0 -3
- package/sample/03-authentication/src/utils/crypto.ts +0 -26
- package/sample/03-authentication/tsconfig.json +0 -112
- package/scripts/build.bash +0 -17
- package/scripts/create-package-json.js +0 -15
- package/src/app.ts +0 -197
- package/src/controller.ts +0 -204
- package/src/decorators/index.ts +0 -1
- package/src/index.ts +0 -3
- package/src/middlewares/index.ts +0 -1
- package/src/validators/body-validator.ts +0 -9
- package/src/validators/index.ts +0 -2
- package/src/validators/query-validator.ts +0 -9
- package/src/validators/validators.ts +0 -216
- package/tsconfig.json +0 -112
- package/webpack.config.js +0 -46
package/package.json
CHANGED
|
@@ -1,50 +1,41 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
|
|
42
|
-
"engines": {
|
|
43
|
-
"node": ">= 12.7"
|
|
44
|
-
},
|
|
45
|
-
"sideEffects": false,
|
|
46
|
-
"repository": {
|
|
47
|
-
"type": "git",
|
|
48
|
-
"url": "https://github.com/hgaleh/chuka.git"
|
|
49
|
-
}
|
|
50
|
-
}
|
|
2
|
+
"name": "@galeh/chuka",
|
|
3
|
+
"version": "1.1.3",
|
|
4
|
+
"description": "simple yet robust wrapper for expressjs",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"chuka",
|
|
7
|
+
"framework",
|
|
8
|
+
"web",
|
|
9
|
+
"http",
|
|
10
|
+
"rest",
|
|
11
|
+
"restful",
|
|
12
|
+
"router",
|
|
13
|
+
"app",
|
|
14
|
+
"api"
|
|
15
|
+
],
|
|
16
|
+
"author": "Hojjat Bakhtiyari <dariogaleh@gmail.com>",
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"express": "^4.18.2",
|
|
20
|
+
"express-ws": "^5.0.2",
|
|
21
|
+
"inversify": "^6.0.2",
|
|
22
|
+
"reflect-metadata": "^0.2.1",
|
|
23
|
+
"tslib": "^2.6.2",
|
|
24
|
+
"@types/express": "^4.17.21",
|
|
25
|
+
"@types/express-ws": "^3.0.4",
|
|
26
|
+
"@types/ws": "^8.5.10"
|
|
27
|
+
},
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public"
|
|
30
|
+
},
|
|
31
|
+
"engines": {
|
|
32
|
+
"node": ">= 12.7"
|
|
33
|
+
},
|
|
34
|
+
"sideEffects": false,
|
|
35
|
+
"repository": {
|
|
36
|
+
"type": "git",
|
|
37
|
+
"url": "https://github.com/hgaleh/chuka.git"
|
|
38
|
+
},
|
|
39
|
+
"type": "commonjs",
|
|
40
|
+
"main": "index.js"
|
|
41
|
+
}
|
package/validators.d.ts
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { NextFunction } from 'express';
|
|
2
|
+
import { Request as Request_2 } from 'express';
|
|
3
|
+
import { Response as Response_2 } from 'express';
|
|
4
|
+
|
|
5
|
+
export declare function and<T>(...validationFunctions: Array<Validator<T>>): Validator<T>;
|
|
6
|
+
|
|
7
|
+
declare class AtomicValidator<T> extends Validator<T> {
|
|
8
|
+
private implementation;
|
|
9
|
+
queryField?: keyof T | undefined;
|
|
10
|
+
constructor(implementation: (subject: T | T[keyof T]) => ValidatorReturn, queryField?: keyof T | undefined);
|
|
11
|
+
validate(subject: T, selectedField: keyof T): ValidatorReturn;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export declare function bodyValidator<T>(validationLogic: ValidationLogic<T>): Middleware<{
|
|
15
|
+
body: T;
|
|
16
|
+
}>;
|
|
17
|
+
|
|
18
|
+
export declare function custom<T>(validator: (obj: T) => ValidatorReturn): Validator<T>;
|
|
19
|
+
|
|
20
|
+
export declare function isDefined<T>(field?: keyof T): AtomicValidator<T>;
|
|
21
|
+
|
|
22
|
+
export declare function isNull<T>(field?: keyof T): AtomicValidator<T>;
|
|
23
|
+
|
|
24
|
+
export declare function isNumber<T>(field?: keyof T): AtomicValidator<T>;
|
|
25
|
+
|
|
26
|
+
export declare function isString<T>(field?: keyof T): AtomicValidator<T>;
|
|
27
|
+
|
|
28
|
+
export declare function isUndefined<T>(field?: keyof T): AtomicValidator<T>;
|
|
29
|
+
|
|
30
|
+
declare type MergePartial<A, B> = {
|
|
31
|
+
[k in keyof A & keyof B]: (A & B)[k] extends never ? B[k] : 0 extends 1 & (A & B)[k] ? B[k] : (A & B)[k];
|
|
32
|
+
} & Omit<A, keyof B> & Partial<Omit<B, keyof A>>;
|
|
33
|
+
|
|
34
|
+
declare interface Middleware<T> {
|
|
35
|
+
(req: MergePartial<Request_2, T>, res: Response_2, next: NextFunction): void;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export declare function not<T>(validationFunction: Validator<T>): Validator<T>;
|
|
39
|
+
|
|
40
|
+
export declare function notNull<T>(field?: keyof T): AtomicValidator<T>;
|
|
41
|
+
|
|
42
|
+
export declare function or<T>(...validationFunctions: Array<Validator<T>>): Validator<T>;
|
|
43
|
+
|
|
44
|
+
declare type RequestField<F extends PropertyKey, T> = Record<F, T>;
|
|
45
|
+
|
|
46
|
+
declare type UnArray<T> = T extends Array<infer A> ? A : T;
|
|
47
|
+
|
|
48
|
+
export declare type ValidationLogic<T> = {
|
|
49
|
+
[k in keyof T as T[k] extends Function ? never : k]?: ValidationLogic<UnArray<T[k]>> | Validator<T>;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
declare abstract class Validator<T> {
|
|
53
|
+
abstract validate(subject: T, selectedField: keyof T): ValidatorReturn;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export declare function validator<T, F extends PropertyKey>(validationLogic: ValidationLogic<T>, requestField: F): Middleware<RequestField<F, T>>;
|
|
57
|
+
|
|
58
|
+
declare type ValidatorReturn = boolean | Promise<boolean>;
|
|
59
|
+
|
|
60
|
+
export { }
|
package/validators.js
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
|
3
|
+
* This devtool is neither made for production nor for readable output files.
|
|
4
|
+
* It uses "eval()" calls to create a separate source file in the browser devtools.
|
|
5
|
+
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
|
|
6
|
+
* or disable the default devtool with "devtool: false".
|
|
7
|
+
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
|
|
8
|
+
*/
|
|
9
|
+
/******/ var __webpack_modules__ = ({
|
|
10
|
+
|
|
11
|
+
/***/ "./src/validators/body-validator.ts":
|
|
12
|
+
/*!******************************************!*\
|
|
13
|
+
!*** ./src/validators/body-validator.ts ***!
|
|
14
|
+
\******************************************/
|
|
15
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
16
|
+
|
|
17
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ bodyValidator: () => (/* binding */ bodyValidator)\n/* harmony export */ });\n/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! . */ \"./src/validators/validators.ts\");\n\nfunction bodyValidator(validationLogic) {\n return (req, res, next) => {\n (0,___WEBPACK_IMPORTED_MODULE_0__.validator)(validationLogic, 'body')(req, res, next);\n };\n}\n\n\n//# sourceURL=webpack://@galeh/chuka/./src/validators/body-validator.ts?");
|
|
18
|
+
|
|
19
|
+
/***/ }),
|
|
20
|
+
|
|
21
|
+
/***/ "./src/validators/index.ts":
|
|
22
|
+
/*!*********************************!*\
|
|
23
|
+
!*** ./src/validators/index.ts ***!
|
|
24
|
+
\*********************************/
|
|
25
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
26
|
+
|
|
27
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ and: () => (/* reexport safe */ _validators__WEBPACK_IMPORTED_MODULE_0__.and),\n/* harmony export */ bodyValidator: () => (/* reexport safe */ _body_validator__WEBPACK_IMPORTED_MODULE_1__.bodyValidator),\n/* harmony export */ custom: () => (/* reexport safe */ _validators__WEBPACK_IMPORTED_MODULE_0__.custom),\n/* harmony export */ isDefined: () => (/* reexport safe */ _validators__WEBPACK_IMPORTED_MODULE_0__.isDefined),\n/* harmony export */ isNull: () => (/* reexport safe */ _validators__WEBPACK_IMPORTED_MODULE_0__.isNull),\n/* harmony export */ isNumber: () => (/* reexport safe */ _validators__WEBPACK_IMPORTED_MODULE_0__.isNumber),\n/* harmony export */ isString: () => (/* reexport safe */ _validators__WEBPACK_IMPORTED_MODULE_0__.isString),\n/* harmony export */ isUndefined: () => (/* reexport safe */ _validators__WEBPACK_IMPORTED_MODULE_0__.isUndefined),\n/* harmony export */ not: () => (/* reexport safe */ _validators__WEBPACK_IMPORTED_MODULE_0__.not),\n/* harmony export */ notNull: () => (/* reexport safe */ _validators__WEBPACK_IMPORTED_MODULE_0__.notNull),\n/* harmony export */ or: () => (/* reexport safe */ _validators__WEBPACK_IMPORTED_MODULE_0__.or),\n/* harmony export */ validator: () => (/* reexport safe */ _validators__WEBPACK_IMPORTED_MODULE_0__.validator)\n/* harmony export */ });\n/* harmony import */ var _validators__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./validators */ \"./src/validators/validators.ts\");\n/* harmony import */ var _body_validator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./body-validator */ \"./src/validators/body-validator.ts\");\n\n\n\n\n//# sourceURL=webpack://@galeh/chuka/./src/validators/index.ts?");
|
|
28
|
+
|
|
29
|
+
/***/ }),
|
|
30
|
+
|
|
31
|
+
/***/ "./src/validators/validators.ts":
|
|
32
|
+
/*!**************************************!*\
|
|
33
|
+
!*** ./src/validators/validators.ts ***!
|
|
34
|
+
\**************************************/
|
|
35
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
36
|
+
|
|
37
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ AtomicValidator: () => (/* binding */ AtomicValidator),\n/* harmony export */ Validator: () => (/* binding */ Validator),\n/* harmony export */ and: () => (/* binding */ and),\n/* harmony export */ andAsync: () => (/* binding */ andAsync),\n/* harmony export */ custom: () => (/* binding */ custom),\n/* harmony export */ isDefined: () => (/* binding */ isDefined),\n/* harmony export */ isNull: () => (/* binding */ isNull),\n/* harmony export */ isNumber: () => (/* binding */ isNumber),\n/* harmony export */ isString: () => (/* binding */ isString),\n/* harmony export */ isUndefined: () => (/* binding */ isUndefined),\n/* harmony export */ not: () => (/* binding */ not),\n/* harmony export */ notNull: () => (/* binding */ notNull),\n/* harmony export */ or: () => (/* binding */ or),\n/* harmony export */ validator: () => (/* binding */ validator)\n/* harmony export */ });\nfunction validator(validationLogic, requestField) {\n return (req, res, next) => {\n // @ts-ignore\n applyValidation(req[requestField], validationLogic).then(errors => {\n const result = isThereAnyErrors(errors);\n if (result) {\n next(errors);\n }\n else {\n next();\n }\n }).catch(next);\n };\n}\nasync function applyValidation(obj, validationLogic) {\n const validationResult = {};\n for (const key in validationLogic) {\n const atomicValidator = validationLogic[key];\n if (atomicValidator) {\n if (atomicValidator instanceof Validator) {\n try {\n validationResult[key] = atomicValidator.validate(obj, key);\n if (validationResult[key] instanceof Promise) {\n validationResult[key] = await validationResult[key];\n console.log(`awaited result: ${validationResult[key]}`);\n }\n }\n catch (err) {\n validationResult[key] = false;\n }\n }\n else {\n if (obj[key] instanceof Array) {\n validationResult[key] = obj[key].map(objj => applyValidation(objj, atomicValidator));\n if (validationResult[key][0] instanceof Promise) {\n validationResult[key] = Promise.all(validationResult[key]);\n }\n }\n else {\n validationResult[key] = applyValidation(obj[key], atomicValidator);\n if (validationResult[key] instanceof Promise) {\n validationResult[key] = await validationResult[key];\n }\n }\n }\n }\n else {\n validationResult[key] = true;\n }\n }\n return validationResult;\n}\nfunction isThereAnyErrors(obj) {\n for (const [key, value] of Object.entries(obj)) {\n if (value === false) {\n return true;\n }\n else if (typeof value !== 'boolean') {\n const partialRes = isThereAnyErrors(value);\n if (partialRes) {\n return partialRes;\n }\n }\n }\n return false;\n}\n// type ValidationFunction<T> = (subject: T) => boolean;\nclass Validator {\n}\nclass CustomValidator extends Validator {\n constructor(validator) {\n super();\n this.validator = validator;\n }\n validate(subject, selectedField) {\n return this.validator(subject);\n }\n}\nfunction custom(validator) {\n return new CustomValidator(validator);\n}\nclass AtomicValidator extends Validator {\n constructor(implementation, queryField) {\n super();\n this.implementation = implementation;\n this.queryField = queryField;\n }\n validate(subject, selectedField) {\n return this.implementation(this.queryField ? subject[this.queryField] : subject[selectedField]);\n }\n}\nfunction isString(field) {\n return new AtomicValidator((subject) => {\n return typeof subject === 'string';\n }, field);\n}\nfunction isNumber(field) {\n return new AtomicValidator((subject) => {\n return typeof subject === 'number';\n }, field);\n}\nfunction isDefined(field) {\n return new AtomicValidator((subject) => {\n return subject != undefined;\n }, field);\n}\nfunction isUndefined(field) {\n return new AtomicValidator((subject) => {\n return subject === undefined;\n }, field);\n}\nfunction isNull(field) {\n return new AtomicValidator((subject) => {\n return subject === null;\n }, field);\n}\nfunction notNull(field) {\n return new AtomicValidator((subject) => {\n return subject !== null;\n }, field);\n}\nclass AndValidator extends Validator {\n constructor(...validationFunctions) {\n super();\n this.validationFunctions = validationFunctions;\n }\n validate(subject, selectedField) {\n return this.validationFunctions.every(eachValidator => eachValidator.validate(subject, selectedField));\n }\n}\nclass AndValidatorAsync extends Validator {\n constructor(...validationFunctions) {\n super();\n this.validationFunctions = validationFunctions;\n }\n async validate(subject, selectedField) {\n const allPromises = this.validationFunctions.map(eachValidator => eachValidator.validate(subject, selectedField));\n const allResults = await Promise.all(allPromises);\n return allResults.every(val => val);\n }\n}\nclass OrValidator extends Validator {\n constructor(...validationFunctions) {\n super();\n this.validationFunctions = validationFunctions;\n }\n validate(subject, selectedField) {\n return this.validationFunctions.some(eachValidator => eachValidator.validate(subject, selectedField));\n }\n}\nclass NotValidator extends Validator {\n constructor(validationFunctions) {\n super();\n this.validationFunction = validationFunctions;\n }\n validate(subject, selectedField) {\n return !this.validationFunction.validate(subject, selectedField);\n }\n}\nfunction and(...validationFunctions) {\n return new AndValidator(...validationFunctions);\n}\nfunction andAsync(...validationFunctions) {\n return new AndValidatorAsync(...validationFunctions);\n}\nfunction or(...validationFunctions) {\n return new OrValidator(...validationFunctions);\n}\nfunction not(validationFunction) {\n return new NotValidator(validationFunction);\n}\n\n\n//# sourceURL=webpack://@galeh/chuka/./src/validators/validators.ts?");
|
|
38
|
+
|
|
39
|
+
/***/ })
|
|
40
|
+
|
|
41
|
+
/******/ });
|
|
42
|
+
/************************************************************************/
|
|
43
|
+
/******/ // The module cache
|
|
44
|
+
/******/ var __webpack_module_cache__ = {};
|
|
45
|
+
/******/
|
|
46
|
+
/******/ // The require function
|
|
47
|
+
/******/ function __webpack_require__(moduleId) {
|
|
48
|
+
/******/ // Check if module is in cache
|
|
49
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
50
|
+
/******/ if (cachedModule !== undefined) {
|
|
51
|
+
/******/ return cachedModule.exports;
|
|
52
|
+
/******/ }
|
|
53
|
+
/******/ // Create a new module (and put it into the cache)
|
|
54
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
55
|
+
/******/ // no module.id needed
|
|
56
|
+
/******/ // no module.loaded needed
|
|
57
|
+
/******/ exports: {}
|
|
58
|
+
/******/ };
|
|
59
|
+
/******/
|
|
60
|
+
/******/ // Execute the module function
|
|
61
|
+
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
62
|
+
/******/
|
|
63
|
+
/******/ // Return the exports of the module
|
|
64
|
+
/******/ return module.exports;
|
|
65
|
+
/******/ }
|
|
66
|
+
/******/
|
|
67
|
+
/************************************************************************/
|
|
68
|
+
/******/ /* webpack/runtime/define property getters */
|
|
69
|
+
/******/ (() => {
|
|
70
|
+
/******/ // define getter functions for harmony exports
|
|
71
|
+
/******/ __webpack_require__.d = (exports, definition) => {
|
|
72
|
+
/******/ for(var key in definition) {
|
|
73
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
74
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
75
|
+
/******/ }
|
|
76
|
+
/******/ }
|
|
77
|
+
/******/ };
|
|
78
|
+
/******/ })();
|
|
79
|
+
/******/
|
|
80
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
81
|
+
/******/ (() => {
|
|
82
|
+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
83
|
+
/******/ })();
|
|
84
|
+
/******/
|
|
85
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
86
|
+
/******/ (() => {
|
|
87
|
+
/******/ // define __esModule on exports
|
|
88
|
+
/******/ __webpack_require__.r = (exports) => {
|
|
89
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
90
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
91
|
+
/******/ }
|
|
92
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
93
|
+
/******/ };
|
|
94
|
+
/******/ })();
|
|
95
|
+
/******/
|
|
96
|
+
/************************************************************************/
|
|
97
|
+
/******/
|
|
98
|
+
/******/ // startup
|
|
99
|
+
/******/ // Load entry module and return exports
|
|
100
|
+
/******/ // This entry module can't be inlined because the eval devtool is used.
|
|
101
|
+
/******/ var __webpack_exports__ = __webpack_require__("./src/validators/index.ts");
|
|
102
|
+
/******/ var __webpack_export_target__ = exports;
|
|
103
|
+
/******/ for(var i in __webpack_exports__) __webpack_export_target__[i] = __webpack_exports__[i];
|
|
104
|
+
/******/ if(__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, "__esModule", { value: true });
|
|
105
|
+
/******/
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
|
|
2
|
-
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
|
|
3
|
-
|
|
4
|
-
name: Node.js Package
|
|
5
|
-
|
|
6
|
-
on:
|
|
7
|
-
push:
|
|
8
|
-
branches: [ "master" ]
|
|
9
|
-
pull_request:
|
|
10
|
-
branches: [ "master" ]
|
|
11
|
-
|
|
12
|
-
jobs:
|
|
13
|
-
build:
|
|
14
|
-
runs-on: ubuntu-latest
|
|
15
|
-
steps:
|
|
16
|
-
- uses: actions/checkout@v4
|
|
17
|
-
- uses: actions/setup-node@v4
|
|
18
|
-
with:
|
|
19
|
-
node-version: 20
|
|
20
|
-
- run: npm ci
|
|
21
|
-
|
|
22
|
-
publish-npm:
|
|
23
|
-
needs: build
|
|
24
|
-
runs-on: ubuntu-latest
|
|
25
|
-
steps:
|
|
26
|
-
- uses: actions/checkout@v4
|
|
27
|
-
- uses: actions/setup-node@v4
|
|
28
|
-
with:
|
|
29
|
-
node-version: 20
|
|
30
|
-
registry-url: https://registry.npmjs.org/
|
|
31
|
-
- run: npm ci
|
|
32
|
-
- run: npm publish
|
|
33
|
-
env:
|
|
34
|
-
NODE_AUTH_TOKEN: ${{secrets.NPMTOKEN}}
|