@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.
Files changed (175) hide show
  1. package/{dist/command.d.ts → command.d.ts} +0 -0
  2. package/{dist/command.js → command.js} +0 -0
  3. package/{dist/command.js.map → command.js.map} +0 -0
  4. package/{dist/date-helper.d.ts → date-helper.d.ts} +0 -0
  5. package/{dist/date-helper.js → date-helper.js} +0 -0
  6. package/{dist/date-helper.js.map → date-helper.js.map} +0 -0
  7. package/{dist/decorators → decorators}/cacheable.decorator.d.ts +0 -0
  8. package/{dist/decorators → decorators}/cacheable.decorator.js +0 -0
  9. package/{dist/decorators → decorators}/cacheable.decorator.js.map +0 -0
  10. package/{dist/decorators → decorators}/index.d.ts +0 -0
  11. package/{dist/decorators → decorators}/index.js +0 -0
  12. package/{dist/decorators → decorators}/index.js.map +0 -0
  13. package/{dist/decorators → decorators}/retryable.decorator.d.ts +0 -0
  14. package/{dist/decorators → decorators}/retryable.decorator.js +0 -0
  15. package/{dist/decorators → decorators}/retryable.decorator.js.map +0 -0
  16. package/{dist/document.d.ts → document.d.ts} +0 -0
  17. package/{dist/document.js → document.js} +0 -0
  18. package/{dist/document.js.map → document.js.map} +0 -0
  19. package/{dist/enum-helper.d.ts → enum-helper.d.ts} +0 -0
  20. package/{dist/enum-helper.js → enum-helper.js} +0 -0
  21. package/{dist/enum-helper.js.map → enum-helper.js.map} +0 -0
  22. package/{dist/errors → errors}/bad-request-error.d.ts +0 -0
  23. package/{dist/errors → errors}/bad-request-error.js +0 -0
  24. package/{dist/errors → errors}/bad-request-error.js.map +0 -0
  25. package/{dist/errors → errors}/domain-error.d.ts +0 -0
  26. package/{dist/errors → errors}/domain-error.js +0 -0
  27. package/{dist/errors → errors}/domain-error.js.map +0 -0
  28. package/{dist/errors → errors}/error-base.d.ts +0 -0
  29. package/{dist/errors → errors}/error-base.js +0 -0
  30. package/{dist/errors → errors}/error-base.js.map +0 -0
  31. package/{dist/errors → errors}/forbidden-error.d.ts +0 -0
  32. package/{dist/errors → errors}/forbidden-error.js +0 -0
  33. package/{dist/errors → errors}/forbidden-error.js.map +0 -0
  34. package/{dist/errors → errors}/index.d.ts +0 -0
  35. package/{dist/errors → errors}/index.js +0 -0
  36. package/{dist/errors → errors}/index.js.map +0 -0
  37. package/{dist/errors → errors}/not-found-error.d.ts +0 -0
  38. package/{dist/errors → errors}/not-found-error.js +0 -0
  39. package/{dist/errors → errors}/not-found-error.js.map +0 -0
  40. package/{dist/errors → errors}/not-implemented-error.d.ts +0 -0
  41. package/{dist/errors → errors}/not-implemented-error.js +0 -0
  42. package/{dist/errors → errors}/not-implemented-error.js.map +0 -0
  43. package/{dist/errors → errors}/unauthorized-error.d.ts +0 -0
  44. package/{dist/errors → errors}/unauthorized-error.js +0 -0
  45. package/{dist/errors → errors}/unauthorized-error.js.map +0 -0
  46. package/{dist/event.d.ts → event.d.ts} +0 -0
  47. package/{dist/event.js → event.js} +0 -0
  48. package/{dist/event.js.map → event.js.map} +0 -0
  49. package/{dist/guid → guid}/index.d.ts +0 -0
  50. package/{dist/guid → guid}/index.js +0 -0
  51. package/{dist/guid → guid}/index.js.map +0 -0
  52. package/{dist/index.d.ts → index.d.ts} +0 -0
  53. package/{dist/index.js → index.js} +0 -0
  54. package/{dist/index.js.map → index.js.map} +0 -0
  55. package/{dist/logger.d.ts → logger.d.ts} +0 -0
  56. package/{dist/logger.js → logger.js} +0 -0
  57. package/{dist/logger.js.map → logger.js.map} +0 -0
  58. package/{dist/maintenance-model.d.ts → maintenance-model.d.ts} +0 -0
  59. package/{dist/maintenance-model.js → maintenance-model.js} +0 -0
  60. package/{dist/maintenance-model.js.map → maintenance-model.js.map} +0 -0
  61. package/{dist/model.d.ts → model.d.ts} +0 -0
  62. package/{dist/model.js → model.js} +0 -0
  63. package/{dist/model.js.map → model.js.map} +0 -0
  64. package/my-devkit-core-1.0.44.tgz +0 -0
  65. package/package.json +7 -7
  66. package/{dist/release-model.d.ts → release-model.d.ts} +0 -0
  67. package/{dist/release-model.js → release-model.js} +0 -0
  68. package/{dist/release-model.js.map → release-model.js.map} +0 -0
  69. package/{dist/retry.d.ts → retry.d.ts} +0 -0
  70. package/{dist/retry.js → retry.js} +0 -0
  71. package/{dist/retry.js.map → retry.js.map} +0 -0
  72. package/{dist/serialize → serialize}/deserialize.d.ts +0 -0
  73. package/{dist/serialize → serialize}/deserialize.js +0 -0
  74. package/{dist/serialize → serialize}/deserialize.js.map +0 -0
  75. package/{dist/serialize → serialize}/index.d.ts +0 -0
  76. package/{dist/serialize → serialize}/index.js +0 -0
  77. package/{dist/serialize → serialize}/index.js.map +0 -0
  78. package/{dist/serialize → serialize}/serializable.d.ts +0 -0
  79. package/{dist/serialize → serialize}/serializable.js +0 -0
  80. package/{dist/serialize → serialize}/serializable.js.map +0 -0
  81. package/{dist/serialize → serialize}/serialize.d.ts +0 -0
  82. package/{dist/serialize → serialize}/serialize.js +0 -0
  83. package/{dist/serialize → serialize}/serialize.js.map +0 -0
  84. package/{dist/serialize → serialize}/type-helper.d.ts +0 -0
  85. package/{dist/serialize → serialize}/type-helper.js +0 -0
  86. package/{dist/serialize → serialize}/type-helper.js.map +0 -0
  87. package/{dist/sleep.d.ts → sleep.d.ts} +0 -0
  88. package/{dist/sleep.js → sleep.js} +0 -0
  89. package/{dist/sleep.js.map → sleep.js.map} +0 -0
  90. package/{dist/validators → validators}/custom-validators/camel-case.d.ts +0 -0
  91. package/{dist/validators → validators}/custom-validators/camel-case.js +0 -0
  92. package/{dist/validators → validators}/custom-validators/camel-case.js.map +0 -0
  93. package/{dist/validators → validators}/custom-validators/equals-to.d.ts +0 -0
  94. package/{dist/validators → validators}/custom-validators/equals-to.js +0 -0
  95. package/{dist/validators → validators}/custom-validators/equals-to.js.map +0 -0
  96. package/{dist/validators → validators}/custom-validators/greater-or-equal-than.d.ts +0 -0
  97. package/{dist/validators → validators}/custom-validators/greater-or-equal-than.js +0 -0
  98. package/{dist/validators → validators}/custom-validators/greater-or-equal-than.js.map +0 -0
  99. package/{dist/validators → validators}/custom-validators/greater-than-date.d.ts +0 -0
  100. package/{dist/validators → validators}/custom-validators/greater-than-date.js +0 -0
  101. package/{dist/validators → validators}/custom-validators/greater-than-date.js.map +0 -0
  102. package/{dist/validators → validators}/custom-validators/index.d.ts +0 -0
  103. package/{dist/validators → validators}/custom-validators/index.js +0 -0
  104. package/{dist/validators → validators}/custom-validators/index.js.map +0 -0
  105. package/{dist/validators → validators}/custom-validators/is-not-in-relative-to.d.ts +0 -0
  106. package/{dist/validators → validators}/custom-validators/is-not-in-relative-to.js +0 -0
  107. package/{dist/validators → validators}/custom-validators/is-not-in-relative-to.js.map +0 -0
  108. package/{dist/validators → validators}/custom-validators/is-optional-if.d.ts +0 -0
  109. package/{dist/validators → validators}/custom-validators/is-optional-if.js +0 -0
  110. package/{dist/validators → validators}/custom-validators/is-optional-if.js.map +0 -0
  111. package/{dist/validators → validators}/custom-validators/pascal-case.d.ts +0 -0
  112. package/{dist/validators → validators}/custom-validators/pascal-case.js +0 -0
  113. package/{dist/validators → validators}/custom-validators/pascal-case.js.map +0 -0
  114. package/{dist/validators → validators}/index.d.ts +0 -0
  115. package/{dist/validators → validators}/index.js +0 -0
  116. package/{dist/validators → validators}/index.js.map +0 -0
  117. package/{dist/validators → validators}/validate.d.ts +0 -0
  118. package/{dist/validators → validators}/validate.js +0 -0
  119. package/{dist/validators → validators}/validate.js.map +0 -0
  120. package/{dist/validators → validators}/validation-error.d.ts +0 -0
  121. package/{dist/validators → validators}/validation-error.js +0 -0
  122. package/{dist/validators → validators}/validation-error.js.map +0 -0
  123. package/{dist/vendors → vendors}/index.d.ts +0 -0
  124. package/{dist/vendors → vendors}/index.js +0 -0
  125. package/{dist/vendors → vendors}/index.js.map +0 -0
  126. package/{dist/vendors → vendors}/lodash.d.ts +0 -0
  127. package/{dist/vendors → vendors}/lodash.js +0 -0
  128. package/{dist/vendors → vendors}/lodash.js.map +0 -0
  129. package/.eslintrc.js +0 -15
  130. package/.vscode/settings.json +0 -7
  131. package/dist/package.json +0 -39
  132. package/my-devkit-core-1.0.40.tgz +0 -0
  133. package/src/command.ts +0 -9
  134. package/src/date-helper.ts +0 -26
  135. package/src/decorators/cacheable.decorator.ts +0 -20
  136. package/src/decorators/index.ts +0 -2
  137. package/src/decorators/retryable.decorator.ts +0 -11
  138. package/src/document.ts +0 -5
  139. package/src/enum-helper.ts +0 -17
  140. package/src/errors/bad-request-error.ts +0 -8
  141. package/src/errors/domain-error.ts +0 -8
  142. package/src/errors/error-base.ts +0 -3
  143. package/src/errors/forbidden-error.ts +0 -8
  144. package/src/errors/index.ts +0 -8
  145. package/src/errors/not-found-error.ts +0 -8
  146. package/src/errors/not-implemented-error.ts +0 -8
  147. package/src/errors/unauthorized-error.ts +0 -8
  148. package/src/event.ts +0 -32
  149. package/src/guid/index.ts +0 -3
  150. package/src/index.ts +0 -20
  151. package/src/logger.ts +0 -71
  152. package/src/maintenance-model.ts +0 -12
  153. package/src/model.ts +0 -15
  154. package/src/release-model.ts +0 -12
  155. package/src/retry.ts +0 -41
  156. package/src/serialize/deserialize.ts +0 -11
  157. package/src/serialize/index.ts +0 -6
  158. package/src/serialize/serializable.ts +0 -30
  159. package/src/serialize/serialize.ts +0 -7
  160. package/src/serialize/type-helper.ts +0 -167
  161. package/src/sleep.ts +0 -10
  162. package/src/validators/custom-validators/camel-case.ts +0 -18
  163. package/src/validators/custom-validators/equals-to.ts +0 -20
  164. package/src/validators/custom-validators/greater-or-equal-than.ts +0 -23
  165. package/src/validators/custom-validators/greater-than-date.ts +0 -28
  166. package/src/validators/custom-validators/index.ts +0 -7
  167. package/src/validators/custom-validators/is-not-in-relative-to.ts +0 -25
  168. package/src/validators/custom-validators/is-optional-if.ts +0 -21
  169. package/src/validators/custom-validators/pascal-case.ts +0 -18
  170. package/src/validators/index.ts +0 -24
  171. package/src/validators/validate.ts +0 -134
  172. package/src/validators/validation-error.ts +0 -27
  173. package/src/vendors/index.ts +0 -1
  174. package/src/vendors/lodash.ts +0 -62
  175. 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
Binary file
package/package.json CHANGED
@@ -1,9 +1,8 @@
1
1
  {
2
2
  "name": "@my-devkit/core",
3
- "version": "1.0.40",
3
+ "version": "1.0.44",
4
4
  "description": "My Devkit: common tools",
5
- "main": "dist/index.js",
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": "pnpx ts-cleaner -d ./dist -s ./src || true",
16
- "build": "pnpm run clean && tsc",
17
- "watch": "pnpm run clean && tsc -w"
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
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
- }
@@ -1,7 +0,0 @@
1
- {
2
- "typescript.tsdk": "./node_modules/typescript/lib",
3
- "editor.tabSize": 4,
4
- "files.exclude": {
5
- "**/.vscode": true
6
- }
7
- }
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
- }
@@ -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
- }
@@ -1,2 +0,0 @@
1
- export * from './cacheable.decorator';
2
- export * from './retryable.decorator';
@@ -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
@@ -1,5 +0,0 @@
1
- import { serializable } from './serialize';
2
-
3
- export interface Document extends serializable.SerializableObject {
4
- _path: string;
5
- }
@@ -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
- }
@@ -1,8 +0,0 @@
1
- import { ErrorBase } from './error-base';
2
-
3
- export class BadRequestError extends Error implements ErrorBase {
4
- constructor(public message: string) {
5
- super(message);
6
- this.name = 'BadRequestError';
7
- }
8
- }
@@ -1,8 +0,0 @@
1
- import { ErrorBase } from './error-base';
2
-
3
- export class DomainError extends Error implements ErrorBase {
4
- constructor(public message: string) {
5
- super(message);
6
- this.name = 'DomainError';
7
- }
8
- }
@@ -1,3 +0,0 @@
1
- export interface ErrorBase extends Error {
2
- message: string;
3
- }
@@ -1,8 +0,0 @@
1
- import { ErrorBase } from './error-base';
2
-
3
- export class ForbiddenError extends Error implements ErrorBase {
4
- constructor(public message: string) {
5
- super(message);
6
- this.name = 'ForbiddenError';
7
- }
8
- }
@@ -1,8 +0,0 @@
1
- export * from './error-base';
2
-
3
- export * from './bad-request-error';
4
- export * from './forbidden-error';
5
- export * from './not-found-error';
6
- export * from './not-implemented-error';
7
- export * from './unauthorized-error';
8
- export * from './domain-error';
@@ -1,8 +0,0 @@
1
- import { ErrorBase } from './error-base';
2
-
3
- export class NotFoundError extends Error implements ErrorBase {
4
- constructor(public message: string) {
5
- super(message);
6
- this.name = 'NotFoundError';
7
- }
8
- }
@@ -1,8 +0,0 @@
1
- import { ErrorBase } from './error-base';
2
-
3
- export class NotImplementedError extends Error implements ErrorBase {
4
- constructor(public message: string) {
5
- super(message);
6
- this.name = 'NotImplementedError';
7
- }
8
- }
@@ -1,8 +0,0 @@
1
- import { ErrorBase } from './error-base';
2
-
3
- export class UnauthorizedError extends Error implements ErrorBase {
4
- constructor(public message: string) {
5
- super(message);
6
- this.name = 'UnauthorizedError';
7
- }
8
- }