@my-devkit/core 1.0.40 → 1.0.44
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/command.d.ts → command.d.ts} +0 -0
- package/{dist/command.js → command.js} +0 -0
- package/{dist/command.js.map → command.js.map} +0 -0
- package/{dist/date-helper.d.ts → date-helper.d.ts} +0 -0
- package/{dist/date-helper.js → date-helper.js} +0 -0
- package/{dist/date-helper.js.map → date-helper.js.map} +0 -0
- package/{dist/decorators → decorators}/cacheable.decorator.d.ts +0 -0
- package/{dist/decorators → decorators}/cacheable.decorator.js +0 -0
- package/{dist/decorators → decorators}/cacheable.decorator.js.map +0 -0
- package/{dist/decorators → decorators}/index.d.ts +0 -0
- package/{dist/decorators → decorators}/index.js +0 -0
- package/{dist/decorators → decorators}/index.js.map +0 -0
- package/{dist/decorators → decorators}/retryable.decorator.d.ts +0 -0
- package/{dist/decorators → decorators}/retryable.decorator.js +0 -0
- package/{dist/decorators → decorators}/retryable.decorator.js.map +0 -0
- package/{dist/document.d.ts → document.d.ts} +0 -0
- package/{dist/document.js → document.js} +0 -0
- package/{dist/document.js.map → document.js.map} +0 -0
- package/{dist/enum-helper.d.ts → enum-helper.d.ts} +0 -0
- package/{dist/enum-helper.js → enum-helper.js} +0 -0
- package/{dist/enum-helper.js.map → enum-helper.js.map} +0 -0
- package/{dist/errors → errors}/bad-request-error.d.ts +0 -0
- package/{dist/errors → errors}/bad-request-error.js +0 -0
- package/{dist/errors → errors}/bad-request-error.js.map +0 -0
- package/{dist/errors → errors}/domain-error.d.ts +0 -0
- package/{dist/errors → errors}/domain-error.js +0 -0
- package/{dist/errors → errors}/domain-error.js.map +0 -0
- package/{dist/errors → errors}/error-base.d.ts +0 -0
- package/{dist/errors → errors}/error-base.js +0 -0
- package/{dist/errors → errors}/error-base.js.map +0 -0
- package/{dist/errors → errors}/forbidden-error.d.ts +0 -0
- package/{dist/errors → errors}/forbidden-error.js +0 -0
- package/{dist/errors → errors}/forbidden-error.js.map +0 -0
- package/{dist/errors → errors}/index.d.ts +0 -0
- package/{dist/errors → errors}/index.js +0 -0
- package/{dist/errors → errors}/index.js.map +0 -0
- package/{dist/errors → errors}/not-found-error.d.ts +0 -0
- package/{dist/errors → errors}/not-found-error.js +0 -0
- package/{dist/errors → errors}/not-found-error.js.map +0 -0
- package/{dist/errors → errors}/not-implemented-error.d.ts +0 -0
- package/{dist/errors → errors}/not-implemented-error.js +0 -0
- package/{dist/errors → errors}/not-implemented-error.js.map +0 -0
- package/{dist/errors → errors}/unauthorized-error.d.ts +0 -0
- package/{dist/errors → errors}/unauthorized-error.js +0 -0
- package/{dist/errors → errors}/unauthorized-error.js.map +0 -0
- package/{dist/event.d.ts → event.d.ts} +0 -0
- package/{dist/event.js → event.js} +0 -0
- package/{dist/event.js.map → event.js.map} +0 -0
- package/{dist/guid → guid}/index.d.ts +0 -0
- package/{dist/guid → guid}/index.js +0 -0
- package/{dist/guid → guid}/index.js.map +0 -0
- package/{dist/index.d.ts → index.d.ts} +0 -0
- package/{dist/index.js → index.js} +0 -0
- package/{dist/index.js.map → index.js.map} +0 -0
- package/{dist/logger.d.ts → logger.d.ts} +0 -0
- package/{dist/logger.js → logger.js} +0 -0
- package/{dist/logger.js.map → logger.js.map} +0 -0
- package/{dist/maintenance-model.d.ts → maintenance-model.d.ts} +0 -0
- package/{dist/maintenance-model.js → maintenance-model.js} +0 -0
- package/{dist/maintenance-model.js.map → maintenance-model.js.map} +0 -0
- package/{dist/model.d.ts → model.d.ts} +0 -0
- package/{dist/model.js → model.js} +0 -0
- package/{dist/model.js.map → model.js.map} +0 -0
- package/my-devkit-core-1.0.44.tgz +0 -0
- package/package.json +7 -7
- package/{dist/release-model.d.ts → release-model.d.ts} +0 -0
- package/{dist/release-model.js → release-model.js} +0 -0
- package/{dist/release-model.js.map → release-model.js.map} +0 -0
- package/{dist/retry.d.ts → retry.d.ts} +0 -0
- package/{dist/retry.js → retry.js} +0 -0
- package/{dist/retry.js.map → retry.js.map} +0 -0
- package/{dist/serialize → serialize}/deserialize.d.ts +0 -0
- package/{dist/serialize → serialize}/deserialize.js +0 -0
- package/{dist/serialize → serialize}/deserialize.js.map +0 -0
- package/{dist/serialize → serialize}/index.d.ts +0 -0
- package/{dist/serialize → serialize}/index.js +0 -0
- package/{dist/serialize → serialize}/index.js.map +0 -0
- package/{dist/serialize → serialize}/serializable.d.ts +0 -0
- package/{dist/serialize → serialize}/serializable.js +0 -0
- package/{dist/serialize → serialize}/serializable.js.map +0 -0
- package/{dist/serialize → serialize}/serialize.d.ts +0 -0
- package/{dist/serialize → serialize}/serialize.js +0 -0
- package/{dist/serialize → serialize}/serialize.js.map +0 -0
- package/{dist/serialize → serialize}/type-helper.d.ts +0 -0
- package/{dist/serialize → serialize}/type-helper.js +0 -0
- package/{dist/serialize → serialize}/type-helper.js.map +0 -0
- package/{dist/sleep.d.ts → sleep.d.ts} +0 -0
- package/{dist/sleep.js → sleep.js} +0 -0
- package/{dist/sleep.js.map → sleep.js.map} +0 -0
- package/{dist/validators → validators}/custom-validators/camel-case.d.ts +0 -0
- package/{dist/validators → validators}/custom-validators/camel-case.js +0 -0
- package/{dist/validators → validators}/custom-validators/camel-case.js.map +0 -0
- package/{dist/validators → validators}/custom-validators/equals-to.d.ts +0 -0
- package/{dist/validators → validators}/custom-validators/equals-to.js +0 -0
- package/{dist/validators → validators}/custom-validators/equals-to.js.map +0 -0
- package/{dist/validators → validators}/custom-validators/greater-or-equal-than.d.ts +0 -0
- package/{dist/validators → validators}/custom-validators/greater-or-equal-than.js +0 -0
- package/{dist/validators → validators}/custom-validators/greater-or-equal-than.js.map +0 -0
- package/{dist/validators → validators}/custom-validators/greater-than-date.d.ts +0 -0
- package/{dist/validators → validators}/custom-validators/greater-than-date.js +0 -0
- package/{dist/validators → validators}/custom-validators/greater-than-date.js.map +0 -0
- package/{dist/validators → validators}/custom-validators/index.d.ts +0 -0
- package/{dist/validators → validators}/custom-validators/index.js +0 -0
- package/{dist/validators → validators}/custom-validators/index.js.map +0 -0
- package/{dist/validators → validators}/custom-validators/is-not-in-relative-to.d.ts +0 -0
- package/{dist/validators → validators}/custom-validators/is-not-in-relative-to.js +0 -0
- package/{dist/validators → validators}/custom-validators/is-not-in-relative-to.js.map +0 -0
- package/{dist/validators → validators}/custom-validators/is-optional-if.d.ts +0 -0
- package/{dist/validators → validators}/custom-validators/is-optional-if.js +0 -0
- package/{dist/validators → validators}/custom-validators/is-optional-if.js.map +0 -0
- package/{dist/validators → validators}/custom-validators/pascal-case.d.ts +0 -0
- package/{dist/validators → validators}/custom-validators/pascal-case.js +0 -0
- package/{dist/validators → validators}/custom-validators/pascal-case.js.map +0 -0
- package/{dist/validators → validators}/index.d.ts +0 -0
- package/{dist/validators → validators}/index.js +0 -0
- package/{dist/validators → validators}/index.js.map +0 -0
- package/{dist/validators → validators}/validate.d.ts +0 -0
- package/{dist/validators → validators}/validate.js +0 -0
- package/{dist/validators → validators}/validate.js.map +0 -0
- package/{dist/validators → validators}/validation-error.d.ts +0 -0
- package/{dist/validators → validators}/validation-error.js +0 -0
- package/{dist/validators → validators}/validation-error.js.map +0 -0
- package/{dist/vendors → vendors}/index.d.ts +0 -0
- package/{dist/vendors → vendors}/index.js +0 -0
- package/{dist/vendors → vendors}/index.js.map +0 -0
- package/{dist/vendors → vendors}/lodash.d.ts +0 -0
- package/{dist/vendors → vendors}/lodash.js +0 -0
- package/{dist/vendors → vendors}/lodash.js.map +0 -0
- package/.eslintrc.js +0 -15
- package/.vscode/settings.json +0 -7
- package/dist/package.json +0 -39
- package/my-devkit-core-1.0.40.tgz +0 -0
- package/src/command.ts +0 -9
- package/src/date-helper.ts +0 -26
- package/src/decorators/cacheable.decorator.ts +0 -20
- package/src/decorators/index.ts +0 -2
- package/src/decorators/retryable.decorator.ts +0 -11
- package/src/document.ts +0 -5
- package/src/enum-helper.ts +0 -17
- package/src/errors/bad-request-error.ts +0 -8
- package/src/errors/domain-error.ts +0 -8
- package/src/errors/error-base.ts +0 -3
- package/src/errors/forbidden-error.ts +0 -8
- package/src/errors/index.ts +0 -8
- package/src/errors/not-found-error.ts +0 -8
- package/src/errors/not-implemented-error.ts +0 -8
- package/src/errors/unauthorized-error.ts +0 -8
- package/src/event.ts +0 -32
- package/src/guid/index.ts +0 -3
- package/src/index.ts +0 -20
- package/src/logger.ts +0 -71
- package/src/maintenance-model.ts +0 -12
- package/src/model.ts +0 -15
- package/src/release-model.ts +0 -12
- package/src/retry.ts +0 -41
- package/src/serialize/deserialize.ts +0 -11
- package/src/serialize/index.ts +0 -6
- package/src/serialize/serializable.ts +0 -30
- package/src/serialize/serialize.ts +0 -7
- package/src/serialize/type-helper.ts +0 -167
- package/src/sleep.ts +0 -10
- package/src/validators/custom-validators/camel-case.ts +0 -18
- package/src/validators/custom-validators/equals-to.ts +0 -20
- package/src/validators/custom-validators/greater-or-equal-than.ts +0 -23
- package/src/validators/custom-validators/greater-than-date.ts +0 -28
- package/src/validators/custom-validators/index.ts +0 -7
- package/src/validators/custom-validators/is-not-in-relative-to.ts +0 -25
- package/src/validators/custom-validators/is-optional-if.ts +0 -21
- package/src/validators/custom-validators/pascal-case.ts +0 -18
- package/src/validators/index.ts +0 -24
- package/src/validators/validate.ts +0 -134
- package/src/validators/validation-error.ts +0 -27
- package/src/vendors/index.ts +0 -1
- package/src/vendors/lodash.ts +0 -62
- package/tsconfig.json +0 -20
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@my-devkit/core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.44",
|
|
4
4
|
"description": "My Devkit: common tools",
|
|
5
|
-
"
|
|
6
|
-
"typings": "dist/index.d.ts",
|
|
5
|
+
"typings": "index.d.ts",
|
|
7
6
|
"keywords": [],
|
|
8
7
|
"author": "Jean-Guy BUON",
|
|
9
8
|
"license": "MIT",
|
|
@@ -12,9 +11,9 @@
|
|
|
12
11
|
"url": "https://github.com/BUONJG/my-devkit.git"
|
|
13
12
|
},
|
|
14
13
|
"scripts": {
|
|
15
|
-
"clean": "
|
|
16
|
-
"build": "
|
|
17
|
-
"watch": "
|
|
14
|
+
"clean": "npx ts-cleaner -d ./dist -s ./src || true",
|
|
15
|
+
"build": "npm run clean && tsc",
|
|
16
|
+
"watch": "npm run clean && tsc -w"
|
|
18
17
|
},
|
|
19
18
|
"dependencies": {
|
|
20
19
|
"cerialize": "0.1.18",
|
|
@@ -34,5 +33,6 @@
|
|
|
34
33
|
"ts-cleaner": "1.0.5",
|
|
35
34
|
"typescript": "^4.5.2",
|
|
36
35
|
"rimraf": "3.0.2"
|
|
37
|
-
}
|
|
36
|
+
},
|
|
37
|
+
"module": "index.js"
|
|
38
38
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/.eslintrc.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
parser: '@typescript-eslint/parser',
|
|
3
|
-
extends: [
|
|
4
|
-
'plugin:@typescript-eslint/recommended'
|
|
5
|
-
],
|
|
6
|
-
parserOptions: {
|
|
7
|
-
ecmaVersion: 2018,
|
|
8
|
-
sourceType: 'module'
|
|
9
|
-
},
|
|
10
|
-
rules: {
|
|
11
|
-
'@typescript-eslint/no-namespace': 'off',
|
|
12
|
-
'@typescript-eslint/no-explicit-any': 'off',
|
|
13
|
-
quotes: ['error', 'single', { avoidEscape: true, allowTemplateLiterals: true }]
|
|
14
|
-
}
|
|
15
|
-
}
|
package/.vscode/settings.json
DELETED
package/dist/package.json
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@my-devkit/core",
|
|
3
|
-
"version": "1.0.28",
|
|
4
|
-
"description": "My Devkit: common tools",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"typings": "dist/index.d.ts",
|
|
7
|
-
"keywords": [],
|
|
8
|
-
"author": "Jean-Guy BUON",
|
|
9
|
-
"license": "MIT",
|
|
10
|
-
"repository": {
|
|
11
|
-
"type": "git",
|
|
12
|
-
"url": "https://github.com/BUONJG/my-devkit.git"
|
|
13
|
-
},
|
|
14
|
-
"scripts": {
|
|
15
|
-
"preinstall": "npx only-allow pnpm",
|
|
16
|
-
"clean": "pnpx ts-cleaner -d ./dist -s ./src || true",
|
|
17
|
-
"build": "pnpm run clean && tsc",
|
|
18
|
-
"watch": "pnpm run clean && tsc -w"
|
|
19
|
-
},
|
|
20
|
-
"dependencies": {
|
|
21
|
-
"cerialize": "0.1.18",
|
|
22
|
-
"class-validator": "0.11.1",
|
|
23
|
-
"lodash": "4.17.21",
|
|
24
|
-
"save": "2.4.0",
|
|
25
|
-
"uuid": "8.3.2"
|
|
26
|
-
},
|
|
27
|
-
"peerDependencies": {},
|
|
28
|
-
"devDependencies": {
|
|
29
|
-
"@types/lodash": "4.14.173",
|
|
30
|
-
"@types/node": "^14.14.19",
|
|
31
|
-
"@typescript-eslint/eslint-plugin": "4.22.1",
|
|
32
|
-
"@typescript-eslint/parser": "4.22.1",
|
|
33
|
-
"cpx": "1.5.0",
|
|
34
|
-
"eslint": "7.26.0",
|
|
35
|
-
"ts-cleaner": "1.0.5",
|
|
36
|
-
"typescript": "^4.5.2",
|
|
37
|
-
"rimraf": "3.0.2"
|
|
38
|
-
}
|
|
39
|
-
}
|
|
Binary file
|
package/src/command.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { autoserializeAs, serializable } from './serialize';
|
|
2
|
-
|
|
3
|
-
export abstract class Command implements serializable.SerializableObject {
|
|
4
|
-
@autoserializeAs(String) public _type: string = null;
|
|
5
|
-
|
|
6
|
-
constructor(commandType: string) {
|
|
7
|
-
this._type = commandType;
|
|
8
|
-
}
|
|
9
|
-
}
|
package/src/date-helper.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export class DateHelper {
|
|
2
|
-
public static getUTCTimestamp(): number {
|
|
3
|
-
const now = new Date;
|
|
4
|
-
return Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate(),
|
|
5
|
-
now.getUTCHours(), now.getUTCMinutes(), now.getUTCSeconds(), now.getUTCMilliseconds());
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
public static getElapsedTime(startDate: Date): number {
|
|
9
|
-
return (new Date()).getTime() - startDate.getTime();
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
public static getReadableElapsedTime(startDate: Date): string {
|
|
13
|
-
const elapsedTime = this.getElapsedTime(startDate);
|
|
14
|
-
|
|
15
|
-
const minutes = Math.floor(elapsedTime / 60000);
|
|
16
|
-
const seconds = Math.floor(elapsedTime / 1000) - 60000 * minutes;
|
|
17
|
-
const miliseconds = elapsedTime - 60000 * minutes - 1000 * seconds;
|
|
18
|
-
|
|
19
|
-
if (minutes) {
|
|
20
|
-
return `${minutes} min ${seconds} sec ${miliseconds} ms`;
|
|
21
|
-
} else if (seconds) {
|
|
22
|
-
return `${seconds} sec ${miliseconds} ms`;
|
|
23
|
-
}
|
|
24
|
-
return `${miliseconds} ms`;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { guid } from '../guid';
|
|
2
|
-
import { Logger } from '../logger';
|
|
3
|
-
|
|
4
|
-
export function Cacheable(): MethodDecorator {
|
|
5
|
-
return (target, propertyKey, descriptor) => {
|
|
6
|
-
const originalMethod: any = descriptor.value;
|
|
7
|
-
const cachePropertyName = `__cache_${propertyKey.toString()}_${guid()}__`;
|
|
8
|
-
target[cachePropertyName] = new Map<string, any>();
|
|
9
|
-
|
|
10
|
-
(descriptor as any).value = (...args) => {
|
|
11
|
-
const cacheKey = JSON.stringify(args);
|
|
12
|
-
if (!target[cachePropertyName].has(cacheKey)) {
|
|
13
|
-
target[cachePropertyName].set(cacheKey, originalMethod.apply(this, args));
|
|
14
|
-
} else {
|
|
15
|
-
Logger.info(`Cacheable: ${target.constructor.name}.${propertyKey.toString()} result retrieved from cache`, { args });
|
|
16
|
-
}
|
|
17
|
-
return target[cachePropertyName].get(cacheKey);
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
}
|
package/src/decorators/index.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { retry } from '../retry';
|
|
2
|
-
|
|
3
|
-
export function Retryable(options?: retry.Options): MethodDecorator {
|
|
4
|
-
return (_target, _propertyKey, descriptor) => {
|
|
5
|
-
const originalMethod: any = descriptor.value;
|
|
6
|
-
|
|
7
|
-
(descriptor as any).value = async function (...args) {
|
|
8
|
-
return retry(async () => await originalMethod.apply(this, args), options);
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
}
|
package/src/document.ts
DELETED
package/src/enum-helper.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export class EnumHelper<T> {
|
|
2
|
-
constructor(private _name: string, private _members: T[]) {
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
public get name(): string {
|
|
6
|
-
return this._name;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
public get members(): T[] {
|
|
10
|
-
return [...this._members];
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
public membersNotIn(excludedMembers: T[]): T[] {
|
|
14
|
-
const notExcludedMembers = this._members.filter(m => !excludedMembers.includes(m));
|
|
15
|
-
return [...notExcludedMembers];
|
|
16
|
-
}
|
|
17
|
-
}
|
package/src/errors/error-base.ts
DELETED
package/src/errors/index.ts
DELETED