@servicelabsco/nestjs-utility-services 3.0.8 → 3.0.10

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 (79) hide show
  1. package/CHANGELOG.md +85 -0
  2. package/README.md +7 -4
  3. package/dist/auth/es6.classes.d.ts +4 -2
  4. package/dist/auth/es6.classes.js +2 -0
  5. package/dist/auth/es6.classes.js.map +1 -1
  6. package/dist/common/decorators/cache.method.decorator.d.ts +11 -0
  7. package/dist/common/decorators/cache.method.decorator.js +37 -0
  8. package/dist/common/decorators/cache.method.decorator.js.map +1 -0
  9. package/dist/common/decorators/index.d.ts +3 -0
  10. package/dist/common/decorators/index.js +3 -0
  11. package/dist/common/decorators/index.js.map +1 -1
  12. package/dist/common/decorators/when.column.updated.decorator.d.ts +8 -0
  13. package/dist/common/decorators/when.column.updated.decorator.js +22 -0
  14. package/dist/common/decorators/when.column.updated.decorator.js.map +1 -0
  15. package/dist/common/decorators/when.new.record.decorator.d.ts +5 -0
  16. package/dist/common/decorators/when.new.record.decorator.js +19 -0
  17. package/dist/common/decorators/when.new.record.decorator.js.map +1 -0
  18. package/dist/common/es6.classes.d.ts +8 -1
  19. package/dist/common/es6.classes.js +9 -1
  20. package/dist/common/es6.classes.js.map +1 -1
  21. package/dist/common/interfaces/index.d.ts +2 -0
  22. package/dist/common/interfaces/index.js +2 -0
  23. package/dist/common/interfaces/index.js.map +1 -1
  24. package/dist/common/interfaces/method.cache.interface.d.ts +4 -0
  25. package/dist/common/interfaces/method.cache.interface.js +3 -0
  26. package/dist/common/interfaces/method.cache.interface.js.map +1 -0
  27. package/dist/common/interfaces/platform.registry.resolver.interface.d.ts +3 -0
  28. package/dist/common/interfaces/updated.column.interface.d.ts +7 -0
  29. package/dist/common/interfaces/updated.column.interface.js +3 -0
  30. package/dist/common/interfaces/updated.column.interface.js.map +1 -0
  31. package/dist/common/libraries/common.subscriber.d.ts +15 -4
  32. package/dist/common/libraries/common.subscriber.js +133 -32
  33. package/dist/common/libraries/common.subscriber.js.map +1 -1
  34. package/dist/common/libraries/platform.utility.d.ts +4 -0
  35. package/dist/common/libraries/platform.utility.js +12 -0
  36. package/dist/common/libraries/platform.utility.js.map +1 -1
  37. package/dist/common/libraries/record.manager.js +2 -5
  38. package/dist/common/libraries/record.manager.js.map +1 -1
  39. package/dist/platformUtility/consumers/job.consumer.js +2 -1
  40. package/dist/platformUtility/consumers/job.consumer.js.map +1 -1
  41. package/dist/platformUtility/es6.classes.d.ts +2 -3
  42. package/dist/platformUtility/es6.classes.js +0 -2
  43. package/dist/platformUtility/es6.classes.js.map +1 -1
  44. package/dist/platformUtility/services/cache.service.js +2 -0
  45. package/dist/platformUtility/services/cache.service.js.map +1 -1
  46. package/dist/platformUtility/services/local.property.service.d.ts +0 -1
  47. package/dist/platformUtility/services/local.property.service.js +1 -10
  48. package/dist/platformUtility/services/local.property.service.js.map +1 -1
  49. package/dist/platformUtility/services/platform.registry.service.d.ts +4 -0
  50. package/dist/platformUtility/services/platform.registry.service.js +12 -0
  51. package/dist/platformUtility/services/platform.registry.service.js.map +1 -1
  52. package/dist/security/es6.classes.d.ts +4 -0
  53. package/dist/security/es6.classes.js +4 -0
  54. package/dist/security/es6.classes.js.map +1 -1
  55. package/dist/system/es6.classes.d.ts +4 -5
  56. package/dist/system/es6.classes.js +0 -2
  57. package/dist/system/es6.classes.js.map +1 -1
  58. package/dist/system/jobs/client.credential.job.js +15 -4
  59. package/dist/system/jobs/client.credential.job.js.map +1 -1
  60. package/dist/system/jobs/sqs.polling.job.js +2 -5
  61. package/dist/system/jobs/sqs.polling.job.js.map +1 -1
  62. package/dist/system/jobs/sync.all.code.job.js +4 -10
  63. package/dist/system/jobs/sync.all.code.job.js.map +1 -1
  64. package/dist/system/libraries/model.sync.js +1 -5
  65. package/dist/system/libraries/model.sync.js.map +1 -1
  66. package/dist/system/services/base.service.js +2 -5
  67. package/dist/system/services/base.service.js.map +1 -1
  68. package/dist/system/services/event.detail.service.js +2 -5
  69. package/dist/system/services/event.detail.service.js.map +1 -1
  70. package/package.json +4 -1
  71. package/dist/config/entity.constants.d.ts +0 -171
  72. package/dist/config/entity.constants.js +0 -173
  73. package/dist/config/entity.constants.js.map +0 -1
  74. package/dist/platformUtility/services/es6.jobs.service.d.ts +0 -18
  75. package/dist/platformUtility/services/es6.jobs.service.js +0 -57
  76. package/dist/platformUtility/services/es6.jobs.service.js.map +0 -1
  77. package/dist/system/services/es6.jobs.service.d.ts +0 -62
  78. package/dist/system/services/es6.jobs.service.js +0 -145
  79. package/dist/system/services/es6.jobs.service.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,90 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.0.9
4
+
5
+ ### Added
6
+
7
+ - **`@CacheMethod()` — cache an async method's result through `CacheService` in one line.**
8
+ Replaces the hand-written get → miss → load → set block:
9
+
10
+ ```ts
11
+ @CacheMethod({ key: (identifier: string) => `inbound.webhook.${identifier}.key`, ttlMinutes: 10 })
12
+ protected async identifyWebhook(identifier: string): Promise<InboundWebhookEntity | null> {
13
+ return InboundWebhookEntity.findOne({ where: { identifier } });
14
+ }
15
+ ```
16
+
17
+ - hit → the cached value is returned without running the method (`0` / `false` / `''` count
18
+ as hits); an optional `hydrate: (raw) => MyEntity.create(raw)` restores class instances,
19
+ since cached values round-trip through JSON;
20
+ - miss → the method runs and a non-null result is cached for `ttlMinutes`; `null` /
21
+ `undefined` is not cached;
22
+ - `key` receives the method's arguments (type-checked against them) with `this` bound to the
23
+ instance; keys are the same strings `CacheService.get/set/delete` take, so existing
24
+ hand-written caches keep their entries and `cacheService.delete(key)` evicts;
25
+ - `CacheService` installs itself as the store (`CacheMethod.useCache(this)`), so the decorator
26
+ works on DI services and plain `new`-ed library classes alike. Without it (unit tests, apps
27
+ without `CacheService`) the method runs uncached; a failed cache write is logged and the
28
+ fresh result returned.
29
+
30
+ - **`@WhenColumnUpdated()` — the `isColumnUpdated` guard of a `CommonJob` database-event
31
+ handler as a decorator.**
32
+
33
+ ```ts
34
+ @WhenColumnUpdated(['active', 'deleted_at'])
35
+ async refreshCacheKey(evt: DatabaseEventDto<ClientCredentialEntity>) {
36
+ await this.clientCredentialService.setCredentialCache(evt.entity.identifier);
37
+ }
38
+ ```
39
+
40
+ - runs for inserts and for updates touching any listed column (exactly `isColumnUpdated`);
41
+ otherwise skipped, resolving to `undefined`; all arguments are forwarded;
42
+ - compile-time checked: only on `CommonJob` methods whose first parameter is a
43
+ `DatabaseEventDto<Entity>`, and every column must be a property of `Entity` (a typo fails
44
+ with `unknownColumns: "<name>"`); the `CommonJob` requirement is also enforced at class
45
+ definition.
46
+ - `ClientCredentialJob.refreshCacheKey` uses it.
47
+
48
+ - **`@WhenNewRecord()` — the `isNewRecord` guard as a decorator.** The method runs only for a
49
+ newly created record (no / empty `databaseEntity`); updates resolve to `undefined`. Same
50
+ compile-time and class-definition checks as `@WhenColumnUpdated()` (`CommonJob` methods,
51
+ first parameter a `DatabaseEventDto`). `ClientCredentialJob.setKey` uses it.
52
+
53
+ ### Changed
54
+
55
+ - **nu no longer ships generated registry files.** `LocalPropertyService` stops registering entities
56
+ from `config/entity.constants.ts`, and that file plus `platformUtility/` and
57
+ `system/services/es6.jobs.service.ts` (`Es6JobsService`) are gone: `PlatformRegistryService`
58
+ (3.0.8) derives the same entity and job hashes from TypeORM metadata and the Nest container.
59
+ `PlatformUtility.getEntity` / `getJob` / `getService` and `setEntities` / `setJobs` /
60
+ `setServices` are unchanged, so consumers that still register explicitly keep working.
61
+ - Generated with `@servicelabsco/slabs-dev-cli` ≥ 1.0.14, which stops emitting these files for any
62
+ repo on nu ≥ 3.0.8 and always emits the core `controllers` / `entities` / `jobs` / `services` /
63
+ `subscribers` keys in `es6.classes.ts`.
64
+
65
+ ### Fixed
66
+
67
+ - **`CommonSubscriber` no longer reports equal-but-differently-typed values as updated columns.**
68
+ TypeORM's `updatedColumns` normalises timestamps and json but compares everything else with
69
+ `===`; the re-check now compares by column type, reading the `ColumnMetadata` TypeORM passes
70
+ (no per-column `findColumnWithPropertyName` scan or `type.toString()`):
71
+ - decimals (`float`, `numeric`, `decimal`, `real`, ...) by value, rounded to `scale` when set —
72
+ `'12.50'` vs `12.5`, float noise below the scale; a `float` without a scale compared exactly
73
+ (previously `10 ** undefined` = `NaN`, so it was never normalised);
74
+ - integers (`Number`, `int`, `bigint`, ...) by value, BigInt-safe — `'5'` vs `5`, pg `bigint`
75
+ strings;
76
+ - booleans by the literals Postgres accepts — `'false'` / `'f'` / `0` vs `false`, `'yes'` / `1`
77
+ vs `true` (previously `'false'` counted as changed); an unrecognised value stays changed;
78
+ - `date` columns by calendar date — an ISO string or `Date` vs the stored `YYYY-MM-DD`.
79
+
80
+ Backward compatible: `float`, `Number` and `Boolean` columns (the types normalised before) keep
81
+ the `value || 0` / `value || false` rule exactly (`null` / `''` / `NaN` equal `0` / `false`);
82
+ newly normalised types treat `null` as distinct, and exact types beyond double precision are
83
+ compared as text. A differential run of old vs new over 3,336 value pairs across every column
84
+ type found no case where a column the old code treated as unchanged is now reported; every
85
+ difference is an equal value in another form. Any other column TypeORM reports (text,
86
+ timestamps, json, ...) is kept as before.
87
+
3
88
  ## 3.0.8
4
89
 
5
90
  ### Changed
package/README.md CHANGED
@@ -149,10 +149,13 @@ yarn m:rev # revert last
149
149
  **Commit helper:** `yarn save` → `commit.sh` (pull, optional build / `syncClassess`,
150
150
  format, commit message with JIRA id from branch name).
151
151
 
152
- **Publish:** regenerate barrels (`slnu` / `scan.index`), `yarn build`, then publish.
153
- `prepublishOnly` requires `dist/index.js` and `dist/index.d.ts`. Prefer
154
- `npm publish --otp=…` if Yarn’s publish + 2FA mis-reports success; npm may stage
155
- versions for malware scanning for a few minutes before they appear on the site.
152
+ **Publish:** regenerate barrels (`slnu` / `scan.index`), `yarn build`, then
153
+ `yarn publish:npm -- --otp=…` (preferred) or `npm publish --otp=…`.
154
+ `prepublishOnly` checks `dist/index.js` / `dist/index.d.ts`. **`postpublish` /
155
+ `yarn wait:npm`** polls until `dist-tags.latest` matches `package.json`. Full
156
+ CLI + wait output is written under **`logs/publish/`** (gitignored); open
157
+ `logs/publish/latest.log` when debugging a sticky or false publish. Tunables:
158
+ `NPM_WAIT_TIMEOUT_MS` / `NPM_WAIT_INTERVAL_MS`.
156
159
 
157
160
  ---
158
161
 
@@ -30,10 +30,12 @@ import { SocialService } from './services/social.service';
30
30
  import { UserService } from './services/user.service';
31
31
  declare const es6Classes: {
32
32
  controllers: (typeof AdminAuthController | typeof SocialController | typeof UserController)[];
33
- dtos: (typeof UserRolesAccessObjectDto | typeof SessionIdentifierAttributesDto | typeof PermissionAssignmentDto | typeof RoleAssignmentDto | typeof UserLoginDto | typeof CreateUserDto | typeof OfflineUserDto | typeof UpdateUserDto)[];
34
- entities: (typeof CreatorEntity | typeof CountryEntity | typeof UserReferralEntity | typeof DeviceTokenEntity | typeof RefreshTokenEntity | typeof SessionIdentifierEntity | typeof SocialIdentityEntity)[];
33
+ dtos: (typeof UserRolesAccessObjectDto | typeof PermissionAssignmentDto | typeof RoleAssignmentDto | typeof UserLoginDto | typeof SessionIdentifierAttributesDto | typeof CreateUserDto | typeof OfflineUserDto | typeof UpdateUserDto)[];
34
+ entities: (typeof CreatorEntity | typeof UserReferralEntity | typeof DeviceTokenEntity | typeof RefreshTokenEntity | typeof SessionIdentifierEntity | typeof SocialIdentityEntity | typeof CountryEntity)[];
35
35
  interfaces: any[];
36
+ jobs: any[];
36
37
  middlewares: (typeof BasicAuthMiddleware | typeof ClientConnectMiddleware | typeof InternalMiddleware | typeof JwtMiddleware | typeof RestrictedMiddleware)[];
37
38
  services: (typeof AccessService | typeof RefreshTokenService | typeof UserService | typeof AuthService | typeof DeviceTokenService | typeof SocialIdentityService | typeof SocialService)[];
39
+ subscribers: any[];
38
40
  };
39
41
  export default es6Classes;
@@ -58,8 +58,10 @@ const es6Classes = {
58
58
  user_referral_entity_1.UserReferralEntity,
59
59
  ],
60
60
  interfaces: [],
61
+ jobs: [],
61
62
  middlewares: [basic_auth_middleware_1.BasicAuthMiddleware, client_connect_middleware_1.ClientConnectMiddleware, internal_middleware_1.InternalMiddleware, jwt_middleware_1.JwtMiddleware, restricted_middleware_1.RestrictedMiddleware],
62
63
  services: [access_service_1.AccessService, auth_service_1.AuthService, device_token_service_1.DeviceTokenService, refresh_token_service_1.RefreshTokenService, social_identity_service_1.SocialIdentityService, social_service_1.SocialService, user_service_1.UserService],
64
+ subscribers: [],
63
65
  };
64
66
  exports.default = es6Classes;
65
67
  //# sourceMappingURL=es6.classes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"es6.classes.js","sourceRoot":"","sources":["../../src/auth/es6.classes.ts"],"names":[],"mappings":";;AAAA,+EAA0E;AAC1E,uEAAmE;AACnE,mEAA+D;AAC/D,4DAAuD;AACvD,8DAAyD;AACzD,gFAA2E;AAC3E,oEAA+D;AAC/D,gGAA0F;AAC1F,4DAAuD;AACvD,4DAAuD;AACvD,oEAA+D;AAC/D,0DAAqD;AACrD,sFAA+E;AAC/E,8DAA0D;AAC1D,8DAA0D;AAC1D,wEAAmE;AACnE,0EAAqE;AACrE,oFAA+E;AAC/E,8EAAyE;AACzE,wDAAoD;AACpD,0EAAqE;AACrE,+EAA0E;AAC1E,uFAAkF;AAClF,2EAAuE;AACvE,iEAA6D;AAC7D,+EAA2E;AAC3E,8DAA0D;AAC1D,0DAAsD;AACtD,0EAAqE;AACrE,4EAAuE;AACvE,gFAA2E;AAC3E,8DAA0D;AAC1D,0DAAsD;AAEtD,MAAM,UAAU,GAAG;IACf,WAAW,EAAE,CAAC,2CAAmB,EAAE,oCAAgB,EAAE,gCAAc,CAAC;IACpE,IAAI,EAAE;QACF,+BAAa;QACb,iCAAc;QACd,mDAAuB;QACvB,uCAAiB;QACjB,kEAA8B;QAC9B,+BAAa;QACb,+BAAa;QACb,uCAAiB;QACjB,6BAAY;QACZ,uDAAwB;KAC3B;IACD,QAAQ,EAAE;QACN,8BAAa;QACb,8BAAa;QACb,uC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AiB;QACjB,yCAAkB;QAClB,mDAAuB;QACvB,6CAAoB;QACpB,wBAAU;QACV,yCAAkB;KACrB;IACD,UAAU,EAAE,EAAE;IACd,IAAI,EAAE,EAAE;IACR,WAAW,EAAE,CAAC,2CAAmB,EAAE,mDAAuB,EAAE,wCAAkB,EAAE,8BAAa,EAAE,4CAAoB,CAAC;IACpH,QAAQ,EAAE,CAAC,8BAAa,EAAE,0BAAW,EAAE,yCAAkB,EAAE,2CAAmB,EAAE,+CAAqB,EAAE,8BAAa,EAAE,0BAAW,CAAC;IAClI,WAAW,EAAE,EAAE;CAClB,CAAC;AAEF,kBAAe,UAAU,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { MethodCacheInterface } from '../interfaces/method.cache.interface';
2
+ export interface CacheMethodOptions<A extends any[] = any[], R = any> {
3
+ key: (this: any, ...args: A) => string;
4
+ ttlMinutes: number;
5
+ hydrate?: (raw: any) => R;
6
+ }
7
+ export declare function CacheMethod<A extends any[], R>(options: CacheMethodOptions<A, R>): (_target: object, _propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<(...args: A) => Promise<R>>) => TypedPropertyDescriptor<(...args: A) => Promise<R>>;
8
+ export declare namespace CacheMethod {
9
+ var useCache: (cache?: MethodCacheInterface) => void;
10
+ }
11
+ export { CacheMethod as CacheMethodDecorator };
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CacheMethod = CacheMethod;
4
+ exports.CacheMethodDecorator = CacheMethod;
5
+ const custom_logger_1 = require("../libraries/custom.logger");
6
+ let store;
7
+ function CacheMethod(options) {
8
+ if (!(options.ttlMinutes > 0))
9
+ throw new Error(`@CacheMethod: ttlMinutes must be > 0, got ${options.ttlMinutes}`);
10
+ return (_target, _propertyKey, descriptor) => {
11
+ const original = descriptor.value;
12
+ descriptor.value = async function (...args) {
13
+ const cache = store;
14
+ if (!cache)
15
+ return original.apply(this, args);
16
+ const key = options.key.apply(this, args);
17
+ const cached = await cache.get(key, null);
18
+ if (cached !== null && cached !== undefined)
19
+ return options.hydrate ? options.hydrate(cached) : cached;
20
+ const result = await original.apply(this, args);
21
+ if (result === null || result === undefined)
22
+ return result;
23
+ try {
24
+ await cache.set(key, result, new Date(Date.now() + options.ttlMinutes * 60_000));
25
+ }
26
+ catch (error) {
27
+ custom_logger_1.CustomLogger.error(`@CacheMethod: caching failed for key=${key}; returning uncached result`, error);
28
+ }
29
+ return result;
30
+ };
31
+ return descriptor;
32
+ };
33
+ }
34
+ CacheMethod.useCache = (cache) => {
35
+ store = cache;
36
+ };
37
+ //# sourceMappingURL=cache.method.decorator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache.method.decorator.js","sourceRoot":"","sources":["../../../src/common/decorators/cache.method.decorator.ts"],"names":[],"mappings":";;AAqDA,kCAiCC;AAauB,2CAAoB;AAnG5C,8DAA0D;AAuB1D,IAAI,KAAuC,CAAC;AA8B5C,SAAgB,WAAW,CAAqB,OAAiC;IAC7E,IAAI,CAAC,CAAC,OAAO,CAAC,UAAU,GAAG,CAAC,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,6CAA6C,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;IAElH,OAAO,CACH,OAAe,EACf,YAA6B,EAC7B,UAA+D,EACZ,EAAE;QACrD,MAAM,QAAQ,GAAG,UAAU,CAAC,KAAK,CAAC;QAElC,UAAU,CAAC,KAAK,GAAG,KAAK,WAAsB,GAAG,IAAO;YACpD,MAAM,KAAK,GAAG,KAAK,CAAC;YACpB,IAAI,CAAC,KAAK;gBAAE,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YAE9C,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YAE1C,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;YAC1C,IAAI,MAAM,KAAK,IAAI,IAAI,MAAM,KAAK,SAAS;gBAAE,OAAO,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;YAEvG,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YAChD,IAAI,MAAM,KAAK,IAAI,IAAI,MAAM,KAAK,SAAS;gBAAE,OAAO,MAAM,CAAC;YAE3D,IAAI,CAAC;gBACD,MAAM,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,OAAO,CAAC,UAAU,GAAG,MAAM,CAAC,CAAC,CAAC;YACrF,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACb,4BAAY,CAAC,KAAK,CAAC,wCAAwC,GAAG,6BAA6B,EAAE,KAAK,CAAC,CAAC;YACxG,CAAC;YAED,OAAO,MAAM,CAAC;QAClB,CAAC,CAAC;QAEF,OAAO,UAAU,CAAC;IACtB,CAAC,CAAC;AACN,CAAC;AAQD,WAAW,CAAC,QAAQ,GAAG,CAAC,KAA4B,EAAQ,EAAE;IAC1D,KAAK,GAAG,KAAK,CAAC;AAClB,CAAC,CAAC"}
@@ -1 +1,4 @@
1
+ export * from './cache.method.decorator';
1
2
  export * from './public.exposed.decorator';
3
+ export * from './when.column.updated.decorator';
4
+ export * from './when.new.record.decorator';
@@ -14,5 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./cache.method.decorator"), exports);
17
18
  __exportStar(require("./public.exposed.decorator"), exports);
19
+ __exportStar(require("./when.column.updated.decorator"), exports);
20
+ __exportStar(require("./when.new.record.decorator"), exports);
18
21
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/decorators/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6DAA0C"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/decorators/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2DAAyC;AAAA,6DAA2C;AAAA,kEAAgD;AAAA,8DAA2C"}
@@ -0,0 +1,8 @@
1
+ import type { DatabaseEventDto } from '../dtos/database.event.dto';
2
+ import { CommonJob } from '../libraries/common.job';
3
+ type DatabaseEventMethod<E> = (evt: DatabaseEventDto<E>, ...rest: any[]) => Promise<any>;
4
+ type KnownColumns<E, C extends string> = [Exclude<C, keyof E>] extends [never] ? unknown : {
5
+ unknownColumns: Exclude<C, keyof E>;
6
+ };
7
+ export declare function WhenColumnUpdated<C extends string>(columns: C | C[]): <E>(target: CommonJob, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<DatabaseEventMethod<E>> & KnownColumns<E, C>) => void;
8
+ export { WhenColumnUpdated as WhenColumnUpdatedDecorator };
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WhenColumnUpdated = WhenColumnUpdated;
4
+ exports.WhenColumnUpdatedDecorator = WhenColumnUpdated;
5
+ const common_job_1 = require("../libraries/common.job");
6
+ function WhenColumnUpdated(columns) {
7
+ const list = Array.isArray(columns) ? columns : [columns];
8
+ if (!list.length)
9
+ throw new Error('@WhenColumnUpdated: pass at least one column');
10
+ return (target, propertyKey, descriptor) => {
11
+ if (!(target instanceof common_job_1.CommonJob)) {
12
+ throw new Error(`@WhenColumnUpdated: ${String(propertyKey)} must be a method of a CommonJob subclass`);
13
+ }
14
+ const original = descriptor.value;
15
+ descriptor.value = async function (evt, ...rest) {
16
+ if (!this['isColumnUpdated'](evt, list))
17
+ return undefined;
18
+ return original.apply(this, [evt, ...rest]);
19
+ };
20
+ };
21
+ }
22
+ //# sourceMappingURL=when.column.updated.decorator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"when.column.updated.decorator.js","sourceRoot":"","sources":["../../../src/common/decorators/when.column.updated.decorator.ts"],"names":[],"mappings":";;AAuCA,8CAqBC;AAG6B,uDAA0B;AA9DxD,wDAAoD;AAsCpD,SAAgB,iBAAiB,CAAmB,OAAgB;IAChE,MAAM,IAAI,GAAa,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;IACpE,IAAI,CAAC,IAAI,CAAC,MAAM;QAAE,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;IAElF,OAAO,CACH,MAAiB,EACjB,WAA4B,EAC5B,UAAgF,EAC5E,EAAE;QACN,IAAI,CAAC,CAAC,MAAM,YAAY,sBAAS,CAAC,EAAE,CAAC;YACjC,MAAM,IAAI,KAAK,CAAC,uBAAuB,MAAM,CAAC,WAAW,CAAC,2CAA2C,CAAC,CAAC;QAC3G,CAAC;QAED,MAAM,QAAQ,GAAG,UAAU,CAAC,KAAK,CAAC;QAElC,UAAU,CAAC,KAAK,GAAG,KAAK,WAA4B,GAAwB,EAAE,GAAG,IAAW;YACxF,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC;gBAAE,OAAO,SAAS,CAAC;YAE1D,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC;QAChD,CAAC,CAAC;IACN,CAAC,CAAC;AACN,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { DatabaseEventDto } from '../dtos/database.event.dto';
2
+ import { CommonJob } from '../libraries/common.job';
3
+ type DatabaseEventMethod<E> = (evt: DatabaseEventDto<E>, ...rest: any[]) => Promise<any>;
4
+ export declare function WhenNewRecord(): <E>(target: CommonJob, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<DatabaseEventMethod<E>>) => void;
5
+ export { WhenNewRecord as WhenNewRecordDecorator };
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WhenNewRecord = WhenNewRecord;
4
+ exports.WhenNewRecordDecorator = WhenNewRecord;
5
+ const common_job_1 = require("../libraries/common.job");
6
+ function WhenNewRecord() {
7
+ return (target, propertyKey, descriptor) => {
8
+ if (!(target instanceof common_job_1.CommonJob)) {
9
+ throw new Error(`@WhenNewRecord: ${String(propertyKey)} must be a method of a CommonJob subclass`);
10
+ }
11
+ const original = descriptor.value;
12
+ descriptor.value = async function (evt, ...rest) {
13
+ if (!this['isNewRecord'](evt))
14
+ return undefined;
15
+ return original.apply(this, [evt, ...rest]);
16
+ };
17
+ };
18
+ }
19
+ //# sourceMappingURL=when.new.record.decorator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"when.new.record.decorator.js","sourceRoot":"","sources":["../../../src/common/decorators/when.new.record.decorator.ts"],"names":[],"mappings":";;AA6BA,sCAcC;AAGyB,+CAAsB;AA7ChD,wDAAoD;AA4BpD,SAAgB,aAAa;IACzB,OAAO,CAAI,MAAiB,EAAE,WAA4B,EAAE,UAA2D,EAAQ,EAAE;QAC7H,IAAI,CAAC,CAAC,MAAM,YAAY,sBAAS,CAAC,EAAE,CAAC;YACjC,MAAM,IAAI,KAAK,CAAC,mBAAmB,MAAM,CAAC,WAAW,CAAC,2CAA2C,CAAC,CAAC;QACvG,CAAC;QAED,MAAM,QAAQ,GAAG,UAAU,CAAC,KAAK,CAAC;QAElC,UAAU,CAAC,KAAK,GAAG,KAAK,WAA4B,GAAwB,EAAE,GAAG,IAAW;YACxF,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC;gBAAE,OAAO,SAAS,CAAC;YAEhD,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC;QAChD,CAAC,CAAC;IACN,CAAC,CAAC;AACN,CAAC"}
@@ -1,5 +1,7 @@
1
1
  import { RedisIoAdapter } from './adapters/redis.io.adapter';
2
+ import { CacheMethodDecorator } from './decorators/cache.method.decorator';
2
3
  import { PublicExposedDecorator } from './decorators/public.exposed.decorator';
4
+ import { WhenColumnUpdatedDecorator } from './decorators/when.column.updated.decorator';
3
5
  import { AggregationParamDto } from './dtos/aggregation.param.dto';
4
6
  import { CaptureRecordIndexDto } from './dtos/capture.record.index.dto';
5
7
  import { CaptureRecordShowDto } from './dtos/capture.record.show.dto';
@@ -43,10 +45,13 @@ declare const es6Classes: {
43
45
  DEFAULT_ADMIN: number;
44
46
  INTERNAL: number;
45
47
  })[];
46
- decorators: (typeof PublicExposedDecorator)[];
48
+ controllers: any[];
49
+ decorators: (typeof CacheMethodDecorator | typeof PublicExposedDecorator | typeof WhenColumnUpdatedDecorator)[];
47
50
  dtos: (typeof MetaDataDto | typeof DatabaseEventDto | typeof LayoutColumnDbDto | typeof GenericIndexParamDto | typeof RecordDataManagerDto | typeof RecordTabDto | typeof AggregationParamDto | typeof GroupParamDto | typeof ReportBodyDto | typeof ReportDataManagerDto | typeof CaptureRecordIndexDto | typeof CaptureRecordShowDto | typeof ForeignMigrationDto | typeof GenericShowParamDto | typeof IndexColumnDto | typeof JsonFieldConditionDto | typeof KeyValueParamDto | typeof RenameColumnDto)[];
51
+ entities: any[];
48
52
  exceptions: (typeof NoLoggedUserException)[];
49
53
  interfaces: any[];
54
+ jobs: any[];
50
55
  libraries: (typeof CommonJob | typeof CachedProperty | typeof GenericIndexParser | typeof GenericShowParser | typeof DataManager | typeof ListManager | typeof RecordManager | typeof ReportDataManager | typeof ReportListManager | {
51
56
  register(entity: new (...args: any[]) => any, job: new (...args: any[]) => any): void;
52
57
  jobsFor(entity: new (...args: any[]) => any): (new (...args: any[]) => any)[];
@@ -54,5 +59,7 @@ declare const es6Classes: {
54
59
  size(): number;
55
60
  clear(): void;
56
61
  } | typeof BaseMigrationUtility | typeof CommonConsumer | typeof DatabaseEventEvaluator | typeof Money | typeof SeederUtility)[];
62
+ services: any[];
63
+ subscribers: any[];
57
64
  };
58
65
  export default es6Classes;
@@ -3,7 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const redis_io_adapter_1 = require("./adapters/redis.io.adapter");
4
4
  const role_constants_1 = require("./constants/role.constants");
5
5
  const user_constants_1 = require("./constants/user.constants");
6
+ const cache_method_decorator_1 = require("./decorators/cache.method.decorator");
6
7
  const public_exposed_decorator_1 = require("./decorators/public.exposed.decorator");
8
+ const when_column_updated_decorator_1 = require("./decorators/when.column.updated.decorator");
9
+ const when_new_record_decorator_1 = require("./decorators/when.new.record.decorator");
7
10
  const aggregation_param_dto_1 = require("./dtos/aggregation.param.dto");
8
11
  const capture_record_index_dto_1 = require("./dtos/capture.record.index.dto");
9
12
  const capture_record_show_dto_1 = require("./dtos/capture.record.show.dto");
@@ -70,7 +73,8 @@ const subscriber_registry_1 = require("./libraries/subscriber.registry");
70
73
  const es6Classes = {
71
74
  adapters: [redis_io_adapter_1.RedisIoAdapter],
72
75
  constants: [role_constants_1.RoleConstants, user_constants_1.UserConstants],
73
- decorators: [public_exposed_decorator_1.PublicExposedDecorator],
76
+ controllers: [],
77
+ decorators: [cache_method_decorator_1.CacheMethodDecorator, public_exposed_decorator_1.PublicExposedDecorator, when_column_updated_decorator_1.WhenColumnUpdatedDecorator, when_new_record_decorator_1.WhenNewRecordDecorator],
74
78
  dtos: [
75
79
  aggregation_param_dto_1.AggregationParamDto,
76
80
  capture_record_index_dto_1.CaptureRecordIndexDto,
@@ -94,6 +98,7 @@ const es6Classes = {
94
98
  report_body_dto_1.ReportBodyDto,
95
99
  report_data_manager_dto_1.ReportDataManagerDto,
96
100
  ],
101
+ entities: [],
97
102
  exceptions: [
98
103
  access_exception_1.AccessException,
99
104
  form_exception_1.FormException,
@@ -104,6 +109,7 @@ const es6Classes = {
104
109
  too_many_attempts_exception_1.TooManyAttemptsException,
105
110
  ],
106
111
  interfaces: [],
112
+ jobs: [],
107
113
  libraries: [
108
114
  auth_1.Auth,
109
115
  base_migration_utility_1.BaseMigrationUtility,
@@ -141,6 +147,8 @@ const es6Classes = {
141
147
  sentry_sdk_1.SentrySdk,
142
148
  subscriber_registry_1.SubscriberRegistry,
143
149
  ],
150
+ services: [],
151
+ subscribers: [],
144
152
  };
145
153
  exports.default = es6Classes;
146
154
  //# sourceMappingURL=es6.classes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"es6.classes.js","sourceRoot":"","sources":["../../src/common/es6.classes.ts"],"names":[],"mappings":";;AAAA,kEAA6D;AAC7D,+DAA2D;AAC3D,+DAA2D;AAC3D,oFAA+E;AAC/E,wEAAmE;AACnE,8EAAwE;AACxE,4EAAsE;AACtE,kEAA6D;AAC7D,wEAAmE;AACnE,4EAAsE;AACtE,0EAAoE;AACpE,4DAAuD;AACvD,8DAAyD;AACzD,8DAAyD;AACzD,oFAA8E;AAC9E,8EAAwE;AACxE,oEAA8D;AAC9D,oEAA8D;AAC9D,sEAAgE;AAChE,wDAAmD;AACnD,4EAAsE;AACtE,0DAAqD;AACrD,gEAA2D;AAC3D,4DAAuD;AACvD,4EAAsE;AACtE,oEAAgE;AAChE,gEAA4D;AAC5D,8EAA0E;AAC1E,oFAA8E;AAC9E,0EAAsE;AACtE,gFAA4E;AAC5E,0FAAoF;AACpF,2CAAwC;AACxC,+EAA0E;AAC1E,iEAA6D;AAC7D,2DAAuD;AACvD,iEAA6D;AAC7D,6DAAyD;AACzD,uDAAmD;AACnD,qEAAgE;AAChE,yEAAoE;AACpE,+DAA2D;AAC3D,qEAAiE;AACjE,2DAAuD;AACvD,6DAAyD;AACzD,2DAAuD;AACvD,mFAA8E;AAC9E,qDAAiD;AACjD,uFAAkF;AAClF,mEAA+D;AAC/D,2EAAsE;AACtE,yEAAoE;AAC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,uCAAiB;QACjB,mDAAuB;QACvB,8BAAa;QACb,sBAAS;QACT,wCAAkB;KACrB;CACJ,CAAC;AAEF,kBAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"es6.classes.js","sourceRoot":"","sources":["../../src/common/es6.classes.ts"],"names":[],"mappings":";;AAAA,kEAA6D;AAC7D,+DAA2D;AAC3D,+DAA2D;AAC3D,gFAA2E;AAC3E,oFAA+E;AAC/E,8FAAwF;AACxF,sFAAgF;AAChF,wEAAmE;AACnE,8EAAwE;AACxE,4EAAsE;AACtE,kEAA6D;AAC7D,wEAAmE;AACnE,4EAAsE;AACtE,0EAAoE;AACpE,4DAAuD;AACvD,8DAAyD;AACzD,8DAAyD;AACzD,oFAA8E;AAC9E,8EAAwE;AACxE,oEAA8D;AAC9D,oEAA8D;AAC9D,sEAAgE;AAChE,wDAAmD;AACnD,4EAAsE;AACtE,0DAAqD;AACrD,gEAA2D;AAC3D,4DAAuD;AACvD,4EAAsE;AACtE,oEAAgE;AAChE,gEAA4D;AAC5D,8EAA0E;AAC1E,oFAA8E;AAC9E,0EAAsE;AACtE,gFAA4E;AAC5E,0FAAoF;AACpF,2CAAwC;AACxC,+EAA0E;AAC1E,iEAA6D;AAC7D,2DAAuD;AACvD,iEAA6D;AAC7D,6DAAyD;AACzD,uDAAmD;AACnD,qEAAgE;AAChE,yEAAoE;AACpE,+DAA2D;AAC3D,qEAAiE;AACjE,2DAAuD;AACvD,6DAAyD;AACzD,2DAAuD;AACvD,mFAA8E;AAC9E,qDAAiD;AACjD,uFAAkF;AAClF,mEAA+D;AAC/D,2EAAsE;AACtE,yEAAoE;AACpE,2CAAwC;AACxC,+DAA2D;AAC3D,2DAAuD;AACvD,2DAAuD;AACvD,qEAAiE;AACjE,6CAA0C;AAC1C,mEAA+D;AAC/D,+DAA2D;AAC3D,uEAAkE;AAClE,yEAAoE;AACpE,yEAAoE;AACpE,qFAAgF;AAChF,+DAA2D;AAC3D,uDAAmD;AACnD,yEAAqE;AAErE,M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AAE;CAClB,CAAC;AAEF,kBAAe,UAAU,CAAC"}
@@ -1 +1,3 @@
1
+ export * from './method.cache.interface';
1
2
  export * from './platform.registry.resolver.interface';
3
+ export * from './updated.column.interface';
@@ -14,5 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./method.cache.interface"), exports);
17
18
  __exportStar(require("./platform.registry.resolver.interface"), exports);
19
+ __exportStar(require("./updated.column.interface"), exports);
18
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/interfaces/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yEAAsD"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/interfaces/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2DAAyC;AAAA,yEAAuD;AAAA,6DAA0C"}
@@ -0,0 +1,4 @@
1
+ export interface MethodCacheInterface {
2
+ get(key: string, defaultValue?: any): Promise<any>;
3
+ set(key: string, value: any, expiresAt?: Date): Promise<any>;
4
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=method.cache.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"method.cache.interface.js","sourceRoot":"","sources":["../../../src/common/interfaces/method.cache.interface.ts"],"names":[],"mappings":""}
@@ -2,4 +2,7 @@ export interface PlatformRegistryResolverInterface {
2
2
  entity(hash: string): any;
3
3
  job(hash: string): any;
4
4
  service(hash: string): any;
5
+ entityHashes?(): string[];
6
+ jobHashes?(): string[];
7
+ serviceHashes?(): string[];
5
8
  }
@@ -0,0 +1,7 @@
1
+ export interface UpdatedColumnInterface {
2
+ databaseName: string;
3
+ type: unknown;
4
+ scale?: number;
5
+ utc?: boolean;
6
+ getEntityValue(entity: object): any;
7
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=updated.column.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"updated.column.interface.js","sourceRoot":"","sources":["../../../src/common/interfaces/updated.column.interface.ts"],"names":[],"mappings":""}
@@ -19,11 +19,22 @@ export declare class CommonSubscriber<T> implements EntitySubscriberInterface<T>
19
19
  protected getInsertEventData(event: any): DatabaseEventDto<T>;
20
20
  private getMetadata;
21
21
  private isMongoEntity;
22
+ private static readonly DECIMAL_TYPES;
23
+ private static readonly INTEGER_TYPES;
24
+ private static readonly BOOLEAN_TYPES;
25
+ private static readonly LEGACY_EMPTY_AS_ZERO_TYPES;
26
+ private static readonly TRUE_LITERALS;
27
+ private static readonly FALSE_LITERALS;
22
28
  private getUpdatedRecords;
23
- private normalizeUpdatedColumns;
24
- private handleFloatColumn;
25
- private handleNumberColumn;
26
- private handleBooleanColumn;
29
+ private isValueChanged;
30
+ private isDecimalChanged;
31
+ private isIntegerChanged;
32
+ private isBooleanChanged;
33
+ private isEmpty;
34
+ private toNumber;
35
+ private toBigInt;
36
+ private toBoolean;
37
+ private toDateString;
27
38
  afterRemove(_event: RemoveEvent<T>): Promise<void>;
28
39
  isColumnUpdated(event: any, column: any): boolean;
29
40
  isNewRecord(event: any): boolean;