@servicelabsco/nestjs-utility-services 3.0.4 → 3.0.5

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 (122) hide show
  1. package/CHANGELOG.md +42 -6
  2. package/README.md +164 -60
  3. package/dist/auth/es6.classes.d.ts +3 -6
  4. package/dist/auth/es6.classes.js +2 -6
  5. package/dist/auth/es6.classes.js.map +1 -1
  6. package/dist/auth/index.d.ts +0 -2
  7. package/dist/auth/index.js +0 -2
  8. package/dist/auth/index.js.map +1 -1
  9. package/dist/config/sentry.config.d.ts +1 -1
  10. package/dist/platformUtility/es6.classes.d.ts +1 -2
  11. package/dist/platformUtility/es6.classes.js +1 -10
  12. package/dist/platformUtility/es6.classes.js.map +1 -1
  13. package/dist/platformUtility/jobs/index.d.ts +0 -1
  14. package/dist/platformUtility/jobs/index.js +0 -1
  15. package/dist/platformUtility/jobs/index.js.map +1 -1
  16. package/dist/platformUtility/services/es6.jobs.service.d.ts +1 -3
  17. package/dist/platformUtility/services/es6.jobs.service.js +1 -5
  18. package/dist/platformUtility/services/es6.jobs.service.js.map +1 -1
  19. package/dist/platformUtility/subscribers/dispatcher.subscriber.d.ts +1 -4
  20. package/dist/platformUtility/subscribers/dispatcher.subscriber.js +43 -30
  21. package/dist/platformUtility/subscribers/dispatcher.subscriber.js.map +1 -1
  22. package/dist/system/es6.classes.d.ts +8 -11
  23. package/dist/system/es6.classes.js +14 -20
  24. package/dist/system/es6.classes.js.map +1 -1
  25. package/dist/system/index.d.ts +1 -0
  26. package/dist/system/index.js +1 -0
  27. package/dist/system/index.js.map +1 -1
  28. package/dist/system/jobs/client.credential.job.d.ts +0 -2
  29. package/dist/system/jobs/client.credential.job.js +0 -4
  30. package/dist/system/jobs/client.credential.job.js.map +1 -1
  31. package/dist/system/jobs/code.fix.script.job.d.ts +0 -4
  32. package/dist/system/jobs/code.fix.script.job.js +0 -21
  33. package/dist/system/jobs/code.fix.script.job.js.map +1 -1
  34. package/dist/system/jobs/index.d.ts +0 -10
  35. package/dist/system/jobs/index.js +0 -10
  36. package/dist/system/jobs/index.js.map +1 -1
  37. package/dist/system/jobs/material.view.job.d.ts +0 -4
  38. package/dist/system/jobs/material.view.job.js +0 -21
  39. package/dist/system/jobs/material.view.job.js.map +1 -1
  40. package/dist/system/jobs/property.job.d.ts +0 -3
  41. package/dist/system/jobs/property.job.js +0 -9
  42. package/dist/system/jobs/property.job.js.map +1 -1
  43. package/dist/system/jobs/recurring.query.job.d.ts +0 -4
  44. package/dist/system/jobs/recurring.query.job.js +0 -21
  45. package/dist/system/jobs/recurring.query.job.js.map +1 -1
  46. package/dist/system/jobs/scheduled.event.job.d.ts +0 -4
  47. package/dist/system/jobs/scheduled.event.job.js +0 -21
  48. package/dist/system/jobs/scheduled.event.job.js.map +1 -1
  49. package/dist/system/services/es6.jobs.service.d.ts +1 -21
  50. package/dist/system/services/es6.jobs.service.js +1 -41
  51. package/dist/system/services/es6.jobs.service.js.map +1 -1
  52. package/dist/system/subscribers/client.credential.subscriber.d.ts +9 -0
  53. package/dist/system/subscribers/client.credential.subscriber.js +35 -0
  54. package/dist/system/subscribers/client.credential.subscriber.js.map +1 -0
  55. package/dist/system/subscribers/code.fix.script.subscriber.d.ts +11 -0
  56. package/dist/system/subscribers/code.fix.script.subscriber.js +53 -0
  57. package/dist/system/subscribers/code.fix.script.subscriber.js.map +1 -0
  58. package/dist/system/subscribers/index.d.ts +6 -0
  59. package/dist/{auth/jobs → system/subscribers}/index.js +6 -1
  60. package/dist/system/subscribers/index.js.map +1 -0
  61. package/dist/system/subscribers/material.view.subscriber.d.ts +11 -0
  62. package/dist/system/subscribers/material.view.subscriber.js +53 -0
  63. package/dist/system/subscribers/material.view.subscriber.js.map +1 -0
  64. package/dist/system/subscribers/property.subscriber.d.ts +10 -0
  65. package/dist/{auth/subscribers/session.identifier.subscriber.js → system/subscribers/property.subscriber.js} +17 -17
  66. package/dist/system/subscribers/property.subscriber.js.map +1 -0
  67. package/dist/system/subscribers/recurring.query.subscriber.d.ts +11 -0
  68. package/dist/system/subscribers/recurring.query.subscriber.js +53 -0
  69. package/dist/system/subscribers/recurring.query.subscriber.js.map +1 -0
  70. package/dist/system/subscribers/scheduled.event.subscriber.d.ts +11 -0
  71. package/dist/system/subscribers/scheduled.event.subscriber.js +53 -0
  72. package/dist/system/subscribers/scheduled.event.subscriber.js.map +1 -0
  73. package/dist/system/system.module.js +1 -1
  74. package/dist/system/system.module.js.map +1 -1
  75. package/docs/subscribe-for.md +201 -19
  76. package/package.json +1 -1
  77. package/dist/auth/jobs/index.d.ts +0 -1
  78. package/dist/auth/jobs/index.js.map +0 -1
  79. package/dist/auth/jobs/session.identifier.job.d.ts +0 -9
  80. package/dist/auth/jobs/session.identifier.job.js +0 -30
  81. package/dist/auth/jobs/session.identifier.job.js.map +0 -1
  82. package/dist/auth/services/es6.jobs.service.d.ts +0 -8
  83. package/dist/auth/services/es6.jobs.service.js +0 -37
  84. package/dist/auth/services/es6.jobs.service.js.map +0 -1
  85. package/dist/auth/subscribers/index.d.ts +0 -1
  86. package/dist/auth/subscribers/index.js +0 -18
  87. package/dist/auth/subscribers/index.js.map +0 -1
  88. package/dist/auth/subscribers/session.identifier.subscriber.d.ts +0 -12
  89. package/dist/auth/subscribers/session.identifier.subscriber.js.map +0 -1
  90. package/dist/platformUtility/jobs/remote.request.log.job.d.ts +0 -9
  91. package/dist/platformUtility/jobs/remote.request.log.job.js +0 -33
  92. package/dist/platformUtility/jobs/remote.request.log.job.js.map +0 -1
  93. package/dist/system/jobs/client.job.d.ts +0 -12
  94. package/dist/system/jobs/client.job.js +0 -46
  95. package/dist/system/jobs/client.job.js.map +0 -1
  96. package/dist/system/jobs/code.fix.log.job.d.ts +0 -9
  97. package/dist/system/jobs/code.fix.log.job.js +0 -33
  98. package/dist/system/jobs/code.fix.log.job.js.map +0 -1
  99. package/dist/system/jobs/data.log.job.d.ts +0 -9
  100. package/dist/system/jobs/data.log.job.js +0 -33
  101. package/dist/system/jobs/data.log.job.js.map +0 -1
  102. package/dist/system/jobs/executable.script.job.d.ts +0 -9
  103. package/dist/system/jobs/executable.script.job.js +0 -33
  104. package/dist/system/jobs/executable.script.job.js.map +0 -1
  105. package/dist/system/jobs/mail.event.job.d.ts +0 -9
  106. package/dist/system/jobs/mail.event.job.js +0 -33
  107. package/dist/system/jobs/mail.event.job.js.map +0 -1
  108. package/dist/system/jobs/mail.recipient.job.d.ts +0 -9
  109. package/dist/system/jobs/mail.recipient.job.js +0 -33
  110. package/dist/system/jobs/mail.recipient.job.js.map +0 -1
  111. package/dist/system/jobs/mail.validation.job.d.ts +0 -9
  112. package/dist/system/jobs/mail.validation.job.js +0 -31
  113. package/dist/system/jobs/mail.validation.job.js.map +0 -1
  114. package/dist/system/jobs/mobile.validation.job.d.ts +0 -9
  115. package/dist/system/jobs/mobile.validation.job.js +0 -31
  116. package/dist/system/jobs/mobile.validation.job.js.map +0 -1
  117. package/dist/system/jobs/report.sheet.job.d.ts +0 -9
  118. package/dist/system/jobs/report.sheet.job.js +0 -33
  119. package/dist/system/jobs/report.sheet.job.js.map +0 -1
  120. package/dist/system/jobs/sms.message.job.d.ts +0 -9
  121. package/dist/system/jobs/sms.message.job.js +0 -31
  122. package/dist/system/jobs/sms.message.job.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,15 +1,50 @@
1
1
  # Changelog
2
2
 
3
- ## Unreleased
3
+ ## 3.0.5
4
+
5
+ ### Changed
6
+
7
+ - **`@SubscribeFor` may coexist with a standalone TypeORM subscriber on the same entity.**
8
+ `DispatcherSubscriber` no longer throws at boot. After-hooks fan out to bound jobs only.
9
+ Do not also `delayedDispatch` the same job from the subscriber. See
10
+ [docs/subscribe-for.md](docs/subscribe-for.md).
11
+
12
+ - **Pre-persist hooks stay on subscribers, not jobs.** `DispatcherSubscriber` no longer
13
+ routes `beforeInsert` / `beforeUpdate` to `@SubscribeFor` jobs. Platform mutation hooks
14
+ for credentials, properties, cron/script validation, and scheduling defaults live on
15
+ restored standalone subscribers again (`PropertySubscriber`, `ClientCredentialSubscriber`,
16
+ `CodeFixScriptSubscriber`, `MaterialViewSubscriber`, `RecurringQuerySubscriber`,
17
+ `ScheduledEventSubscriber`). Jobs remain post-persist queue work only.
18
+ **Breaking for apps that moved pre-persist logic onto a job** (as suggested in 3.0.0):
19
+ those hooks silently stop running. `DispatcherSubscriber` now logs an error (console +
20
+ Sentry) at boot for every `@SubscribeFor` job that still defines `beforeInsert` /
21
+ `beforeUpdate` — move that logic to a standalone subscriber.
22
+
23
+ - **Consumer guide expanded** in [docs/subscribe-for.md](docs/subscribe-for.md): when to use
24
+ a job vs subscriber, how apps attach side effects to NU entities, wiring checklist,
25
+ and anti-patterns.
26
+
27
+ ### Removed
28
+
29
+ - **No-op `@SubscribeFor` jobs** that only enqueued pointless queue work:
30
+ `SmsMessageJob`, `MailValidationJob`, `MobileValidationJob`, `CodeFixLogJob`,
31
+ `DataLogJob`, `ExecutableScriptJob`, `MailEventJob`, `MailRecipientJob`,
32
+ `ReportSheetJob`, `ClientJob`, `RemoteRequestLogJob`, plus auth
33
+ `SessionIdentifierJob` / `SessionIdentifierSubscriber` (and auth `Es6JobsService`,
34
+ which only registered that job). Breaking for apps that imported or extended these
35
+ classes. Jobs already queued (or drained) with these hashes fail with
36
+ `data.job not found` — fix or purge their trigger points. Entities and `SourceHash` polymorphic IDs are
37
+ unchanged.
38
+
39
+ ## 3.0.4
4
40
 
5
41
  ### Changed
6
42
 
7
43
  - **`@SubscribeFor` supports multiple jobs per entity.** `SubscriberRegistry` stores
8
44
  `Map<Entity, Job[]>`. `DispatcherSubscriber` fans out `afterInsert`/`afterUpdate` to every
9
- bound job (registration order, sequential enqueue). `beforeInsert`/`beforeUpdate` still run on
10
- the **first** registered job only. Standalone TypeORM subscribers remain forbidden on entities
11
- that already have `@SubscribeFor` job(s). Consuming apps can add e.g. `LocalDocumentJob` with
12
- `@SubscribeFor(DocumentEntity)` without wrapping platform `DocumentJob`.
45
+ bound job (registration order, sequential enqueue). Consuming apps can add e.g.
46
+ `LocalDocumentJob` with `@SubscribeFor(DocumentEntity)` without wrapping platform
47
+ `DocumentJob`.
13
48
 
14
49
  ## 3.0.0 — audit remediation (BREAKING)
15
50
 
@@ -65,7 +100,8 @@ exist. The barrels come from the out-of-repo `slnu` step, not `nest build`; run
65
100
 
66
101
  - `EventLogEntity`, `SystemLogEntity`, `LoggerService`, `test.mongo.job`, `test.mentity`,
67
102
  `role.mapping`, `sql.safety` (its helpers are now instance methods on `SqlService`), and ~28
68
- subscriber stubs (folded into jobs via the `@SubscribeFor` registry).
103
+ pass-through subscriber stubs (folded into jobs via `@SubscribeFor`; mutation-hook subscribers
104
+ for credentials/properties/cron validation were restored in 3.0.5 — see above).
69
105
  - `CommonJob` logging helpers (`log` / `info` / `warn` / `error` / `saveLogs`, `logIdentifier`,
70
106
  `logJobActivity`, `disableLogging`).
71
107
  - `CommonMapperJob` is no longer generic — `extends CommonMapperJob<Foo>` must become
package/README.md CHANGED
@@ -1,91 +1,195 @@
1
- <p align="center">
2
- <a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo-small.svg" width="200" alt="Nest Logo" /></a>
3
- </p>
1
+ # `@servicelabsco/nestjs-utility-services`
4
2
 
5
- [circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456
6
- [circleci-url]: https://circleci.com/gh/nestjs/nest
3
+ **NU** is the shared NestJS foundation for Finnoto / ServiceLabs backend apps
4
+ (expense, access-manager, and sibling products). It is published to npm as a
5
+ library and reused so auth, metadata-driven admin, jobs, storage, mail, and
6
+ infra wiring stay consistent across products instead of being copied per repo.
7
7
 
8
- <p align="center">A progressive <a href="http://nodejs.org" target="_blank">Node.js</a> framework for building efficient and scalable server-side applications.</p>
9
- <p align="center">
10
- <a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/v/@nestjs/core.svg" alt="NPM Version" /></a>
11
- <a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/l/@nestjs/core.svg" alt="Package License" /></a>
12
- <a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/dm/@nestjs/common.svg" alt="NPM Downloads" /></a>
13
- <a href="https://circleci.com/gh/nestjs/nest" target="_blank"><img src="https://img.shields.io/circleci/build/github/nestjs/nest/master" alt="CircleCI" /></a>
14
- <a href="https://coveralls.io/github/nestjs/nest?branch=master" target="_blank"><img src="https://coveralls.io/repos/github/nestjs/nest/badge.svg?branch=master#9" alt="Coverage" /></a>
15
- <a href="https://discord.gg/G7Qnnhy" target="_blank"><img src="https://img.shields.io/badge/discord-online-brightgreen.svg" alt="Discord"/></a>
16
- <a href="https://opencollective.com/nest#backer" target="_blank"><img src="https://opencollective.com/nest/backers/badge.svg" alt="Backers on Open Collective" /></a>
17
- <a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://opencollective.com/nest/sponsors/badge.svg" alt="Sponsors on Open Collective" /></a>
18
- <a href="https://paypal.me/kamilmysliwiec" target="_blank"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg"/></a>
19
- <a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://img.shields.io/badge/Support%20us-Open%20Collective-41B883.svg" alt="Support us"></a>
20
- <a href="https://twitter.com/nestframework" target="_blank"><img src="https://img.shields.io/twitter/follow/nestframework.svg?style=social&label=Follow"></a>
21
- </p>
22
- <!--[![Backers on Open Collective](https://opencollective.com/nest/backers/badge.svg)](https://opencollective.com/nest#backer)
23
- [![Sponsors on Open Collective](https://opencollective.com/nest/sponsors/badge.svg)](https://opencollective.com/nest#sponsor)-->
8
+ | | |
9
+ | --- | --- |
10
+ | **Package** | [`@servicelabsco/nestjs-utility-services`](https://www.npmjs.com/package/@servicelabsco/nestjs-utility-services) |
11
+ | **Repo** | [servicelabsco/nestjs-utility-services](https://github.com/servicelabsco/nestjs-utility-services) |
12
+ | **Node** | `^24.11.0` (required from **3.x**) |
13
+ | **Runtime entry** | `dist/index.js` · types `dist/index.d.ts` |
14
+ | **License** | MIT |
24
15
 
25
- ## Description
16
+ Anything exported from the five modules below is part of the **public API** for
17
+ consuming apps. Treat breaking changes as major releases.
26
18
 
27
- NestJS utility library (`@servicelabsco/nestjs-utility-services`) — auth, system
28
- domain, platform services, jobs, and shared framework primitives for Finnoto apps.
19
+ ---
29
20
 
30
- ### Sentry reporting
21
+ ## What this package is
31
22
 
32
- Consuming apps must wire early SDK init plus `SentryReportingModule`. See
33
- **[docs/sentry-reporting.md](docs/sentry-reporting.md)** for the full integration
34
- checklist (`instrument.ts`, `AppModule`, env vars, workers).
23
+ Two shapes of the same codebase:
35
24
 
36
- ### Upgrading to 3.x
25
+ 1. **Publishable library** — apps `yarn add` this package and import modules,
26
+ entities, services, jobs, DTOs, and helpers.
27
+ 2. **Standalone Nest app** — `main.ts` (HTTP API) and `worker.ts` (BullMQ worker)
28
+ for developing and validating the library locally (migrations, `/health`,
29
+ wiring).
37
30
 
38
- **[docs/upgrade-3.0-backward-compatibility.md](docs/upgrade-3.0-backward-compatibility.md)**
39
- breaker-by-breaker migration guide (internal auth, SSRF, PDF URLs, scripts, access checks,
40
- sessions, SES, migrations) and which escape hatches exist.
31
+ It is the **platform layer**, not a single product:
41
32
 
42
- ### `@SubscribeFor` (entity job bindings)
33
+ - Identity & access (JWT sessions, roles, permissions, internal service tokens)
34
+ - Metadata-driven system domain (menus, models, forms, reports, scripts, templates)
35
+ - Background work (BullMQ jobs, scheduled events, material views, code-fix)
36
+ - Cloud & messaging (S3/R2, SQS, Dynamo, Redis, mail, SMS, FCM, PDF)
37
+ - Shared Nest/TypeORM primitives (`CommonEntity`, `CommonJob`, exceptions, Auth context)
43
38
 
44
- Multiple jobs may bind the same entity; after-hooks fan out, before-hooks stay on the first job.
45
- See **[docs/subscribe-for.md](docs/subscribe-for.md)**.
39
+ Downstream apps (e.g. Finnoto Expense) extend this with product-specific modules
40
+ and optionally bind extra jobs to shared entities via `@SubscribeFor`.
46
41
 
47
- ## Installation
42
+ ---
43
+
44
+ ## Modules
45
+
46
+ Re-exported from the package root:
47
+
48
+ | Module | Responsibility |
49
+ | --- | --- |
50
+ | **`auth`** | Users, sessions, JWT + refresh tokens, social login, device tokens, role/permission assignment. Middlewares: `JwtMiddleware`, `BasicAuthMiddleware`, `InternalMiddleware`, `RestrictedMiddleware`. |
51
+ | **`common`** | Framework bases used everywhere: `CommonEntity` / `CommonMongoEntity`, `CommonService`, `CommonJob` / `CommonMapperJob` / `CommonConsumer`, `CommonSubscriber`, static `Auth` (request/job context), domain exceptions, migration helpers, list/report/script evaluators and managers. Nest `@Module` is empty — the exports are the value. |
52
+ | **`platformUtility`** | Infra services: storage (S3 / Cloudflare R2), SQS, DynamoDB, Redis + `CacheService`, BullMQ (`QueueService`, `JobConsumer`), mail (SMTP / SES / Emithook), SMS, FCM, `RemoteRequestService` (SSRF-aware), PDF, SQL helpers, zip, maintenance, audit, startup/shutdown, Sentry reporting module. |
53
+ | **`security`** | Security-related TypeORM entities (`forFeature`); thin module. |
54
+ | **`system`** | Largest surface: ~70 entities (menus, roles, permissions, models, columns, relationships, properties, lookups, forms, reports, charts, scripts, scheduled events, mail/SMS/WhatsApp templates, documents). Admin/API controllers, domain services, and jobs for recurring work, material views, code-fix, and scheduled execution. Entity events route through `DispatcherSubscriber` + `@SubscribeFor`. |
55
+
56
+ Also exported: **`WorkerService`** for the queue-worker process.
57
+
58
+ ### How Nest wires classes
59
+
60
+ Each module folder has an **`es6.classes.ts`** that lists controllers, services,
61
+ entities, jobs, subscribers, etc. The module file spreads those arrays into
62
+ `@Module({ ... })`. New classes must be registered there (or regenerated via
63
+ `slnu syncClassess`) or they will not enter Nest DI.
64
+
65
+ ---
66
+
67
+ ## Install (consuming applications)
48
68
 
49
69
  ```bash
50
- $ yarn install
70
+ yarn add @servicelabsco/nestjs-utility-services
51
71
  ```
52
72
 
53
- ## Running the app
73
+ ```ts
74
+ import {
75
+ AuthModule,
76
+ PlatformUtilityModule,
77
+ SystemModule,
78
+ SecurityModule,
79
+ CommonModule,
80
+ // entities, jobs, Auth, SubscribeFor, exceptions, …
81
+ } from '@servicelabsco/nestjs-utility-services';
82
+ ```
54
83
 
55
- ```bash
56
- # development
57
- $ yarn run start
84
+ Typical host app also configures:
85
+
86
+ - TypeORM **write** + **read** Postgres (and optional Mongo) — entity globs include
87
+ this package and other `@servicelabsco/*` packages
88
+ - BullMQ (`BULL_QUEUE_NAME`; set `BULL_QUEUE_WORKER=true` only on worker processes)
89
+ - Env/secrets used by middlewares and platform services (`INTERNAL_SERVER_KEY`,
90
+ CORS, mail, AWS/R2, Sentry, etc.)
91
+
92
+ Use **`Auth.user()` / `Auth.id()` / `Auth.check()`** for the current user — not
93
+ manual request injection — so jobs and HTTP share the same context.
94
+
95
+ ---
58
96
 
59
- # watch mode
60
- $ yarn run start:dev
97
+ ## Runtime model
61
98
 
62
- # production mode
63
- $ yarn run start:prod
64
99
  ```
100
+ ┌─────────────────┐ ┌──────────────────┐
101
+ │ main.ts (API) │ │ worker.ts │
102
+ │ HTTP + Nest │ │ same AppModule │
103
+ │ no consumers │ │ BullMQ consumer │
104
+ └────────┬────────┘ └────────┬─────────┘
105
+ │ │
106
+ └───────────┬───────────┘
107
+
108
+ Auth · System · Platform
109
+ Postgres (rw/ro) · Redis · Queues
110
+ Optional Mongo · S3/R2 · Mail/SMS
111
+ ```
112
+
113
+ - **Middleware (all routes):** `MaintenanceMiddleware` → `JwtMiddleware` →
114
+ `BasicAuthMiddleware`. `RestrictedMiddleware` on `api/*`. `InternalMiddleware`
115
+ on `internal/*` (service-to-service token).
116
+ - **Health:** Terminus `/health` (DB, Redis, filesystem); `/health/runtime-check`
117
+ for cron-parser + cache sanity (`yarn runtime-check`).
118
+ - **Migrations:** TypeORM table `sys_migrations`; this package’s migrations plus
119
+ sibling `@servicelabsco/*` migrations can run in the same database.
65
120
 
66
- ## Test
121
+ ---
122
+
123
+ ## Local development (this repository)
67
124
 
68
125
  ```bash
69
- # unit tests
70
- $ yarn run test
126
+ yarn install
127
+ yarn build # nest build → dist/
128
+ yarn start:dev # API watch mode
129
+ yarn start:prod # node dist/main
130
+ yarn test # unit specs next to source
131
+ yarn test:e2e
132
+ yarn test:cov
133
+ yarn lint
134
+ yarn format
135
+ ```
71
136
 
72
- # e2e tests
73
- $ yarn run test:e2e
137
+ **Migrations**
74
138
 
75
- # test coverage
76
- $ yarn run test:cov
139
+ ```bash
140
+ yarn m:g <Name> # generate from entity diff
141
+ yarn m:c <Name> # empty migration
142
+ yarn m:r # run pending (ts-node)
143
+ yarn m:rd # run against dist
144
+ yarn m:rev # revert last
77
145
  ```
78
146
 
79
- ## Support
147
+ **Worker:** run `worker.ts` with `BULL_QUEUE_WORKER=true` (and queue/Redis env).
148
+
149
+ **Commit helper:** `yarn save` → `commit.sh` (pull, optional build / `syncClassess`,
150
+ format, commit message with JIRA id from branch name).
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.
156
+
157
+ ---
158
+
159
+ ## Documentation
160
+
161
+ | Doc | Contents |
162
+ | --- | --- |
163
+ | [CHANGELOG.md](CHANGELOG.md) | Version history and breaking changes |
164
+ | [docs/upgrade-3.0-backward-compatibility.md](docs/upgrade-3.0-backward-compatibility.md) | 3.x upgrade runbook (auth, SSRF, PDF, scripts, sessions, SES, migrations) |
165
+ | [docs/sentry-reporting.md](docs/sentry-reporting.md) | Sentry init + `SentryReportingModule` for consumers |
166
+ | [docs/subscribe-for.md](docs/subscribe-for.md) | **Jobs & subscribers for consuming apps** — when to use `@SubscribeFor` vs a standalone subscriber, wiring, anti-patterns |
167
+ | [docs/migrations.md](docs/migrations.md) | Safe TypeORM migration playbook |
168
+ | [docs/refresh-token-security.md](docs/refresh-token-security.md) | Refresh-token hardening notes |
169
+
170
+ Agent-oriented repo guides: `CLAUDE.md` / `AGENTS.md` (conventions, DI, naming).
171
+
172
+ ---
173
+
174
+ ## Design conventions (summary)
80
175
 
81
- Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support).
176
+ - Entities extend **`CommonEntity`** (Postgres) or **`CommonMongoEntity`** (Mongo);
177
+ filenames `*.entity.ts` / `*.mentity.ts`.
178
+ - Services extend **`CommonService`**; jobs **`CommonJob`** / **`CommonMapperJob`**;
179
+ consumers **`CommonConsumer`**.
180
+ - Prefer project exceptions (`OperationException`, `AccessException`, …) over raw
181
+ `HttpException`.
182
+ - Entity→job side effects: prefer **`@SubscribeFor(Entity)`** on the job for post-persist
183
+ work; multiple jobs per entity are supported. Standalone subscribers own before*/mutation
184
+ hooks — do not also `delayedDispatch` the same job from the subscriber. Full guide:
185
+ [docs/subscribe-for.md](docs/subscribe-for.md).
186
+ - Filename ↔ PascalCase export naming is required so `slnu syncClassess` can
187
+ regenerate `es6.classes.ts`.
82
188
 
83
- ## Stay in touch
189
+ ---
84
190
 
85
- - Author - [Kamil Myśliwiec](https://kamilmysliwiec.com)
86
- - Website - [https://nestjs.com](https://nestjs.com/)
87
- - Twitter - [@nestframework](https://twitter.com/nestframework)
191
+ ## Who maintains this
88
192
 
89
- ## License
193
+ ServiceLabs / Finnoto platform. Author: Hemant Kumar Sah.
90
194
 
91
- Nest is [MIT licensed](LICENSE).
195
+ Issues and PRs: [github.com/servicelabsco/nestjs-utility-services](https://github.com/servicelabsco/nestjs-utility-services).
@@ -16,7 +16,6 @@ import { RefreshTokenEntity } from './entities/refresh.token.entity';
16
16
  import { SessionIdentifierEntity } from './entities/session.identifier.entity';
17
17
  import { SocialIdentityEntity } from './entities/social.identity.entity';
18
18
  import { UserReferralEntity } from './entities/user.referral.entity';
19
- import { SessionIdentifierJob } from './jobs/session.identifier.job';
20
19
  import { BasicAuthMiddleware } from './middlewares/basic.auth.middleware';
21
20
  import { ClientConnectMiddleware } from './middlewares/client.connect.middleware';
22
21
  import { InternalMiddleware } from './middlewares/internal.middleware';
@@ -25,20 +24,18 @@ import { RestrictedMiddleware } from './middlewares/restricted.middleware';
25
24
  import { AccessService } from './services/access.service';
26
25
  import { AuthService } from './services/auth.service';
27
26
  import { DeviceTokenService } from './services/device.token.service';
28
- import { Es6JobsService } from './services/es6.jobs.service';
29
27
  import { RefreshTokenService } from './services/refresh.token.service';
30
28
  import { SocialIdentityService } from './services/social.identity.service';
31
29
  import { SocialService } from './services/social.service';
32
30
  import { UserService } from './services/user.service';
33
- import { SessionIdentifierSubscriber } from './subscribers/session.identifier.subscriber';
34
31
  declare const es6Classes: {
35
32
  controllers: (typeof AdminAuthController | typeof SocialController | typeof UserController)[];
36
33
  dtos: (typeof UserRolesAccessObjectDto | typeof SessionIdentifierAttributesDto | typeof PermissionAssignmentDto | typeof RoleAssignmentDto | typeof UserLoginDto | typeof CreateUserDto | typeof OfflineUserDto | typeof UpdateUserDto)[];
37
34
  entities: (typeof CreatorEntity | typeof CountryEntity | typeof UserReferralEntity | typeof DeviceTokenEntity | typeof RefreshTokenEntity | typeof SessionIdentifierEntity | typeof SocialIdentityEntity)[];
38
35
  interfaces: any[];
39
- jobs: (typeof SessionIdentifierJob)[];
36
+ jobs: any[];
40
37
  middlewares: (typeof BasicAuthMiddleware | typeof ClientConnectMiddleware | typeof InternalMiddleware | typeof JwtMiddleware | typeof RestrictedMiddleware)[];
41
- services: (typeof AccessService | typeof RefreshTokenService | typeof UserService | typeof AuthService | typeof DeviceTokenService | typeof SocialIdentityService | typeof SocialService | typeof Es6JobsService)[];
42
- subscribers: (typeof SessionIdentifierSubscriber)[];
38
+ services: (typeof AccessService | typeof RefreshTokenService | typeof UserService | typeof AuthService | typeof DeviceTokenService | typeof SocialIdentityService | typeof SocialService)[];
39
+ subscribers: any[];
43
40
  };
44
41
  export default es6Classes;
@@ -21,7 +21,6 @@ const session_identifier_entity_1 = require("./entities/session.identifier.entit
21
21
  const social_identity_entity_1 = require("./entities/social.identity.entity");
22
22
  const user_entity_1 = require("./entities/user.entity");
23
23
  const user_referral_entity_1 = require("./entities/user.referral.entity");
24
- const session_identifier_job_1 = require("./jobs/session.identifier.job");
25
24
  const basic_auth_middleware_1 = require("./middlewares/basic.auth.middleware");
26
25
  const client_connect_middleware_1 = require("./middlewares/client.connect.middleware");
27
26
  const internal_middleware_1 = require("./middlewares/internal.middleware");
@@ -30,12 +29,10 @@ const restricted_middleware_1 = require("./middlewares/restricted.middleware");
30
29
  const access_service_1 = require("./services/access.service");
31
30
  const auth_service_1 = require("./services/auth.service");
32
31
  const device_token_service_1 = require("./services/device.token.service");
33
- const es6_jobs_service_1 = require("./services/es6.jobs.service");
34
32
  const refresh_token_service_1 = require("./services/refresh.token.service");
35
33
  const social_identity_service_1 = require("./services/social.identity.service");
36
34
  const social_service_1 = require("./services/social.service");
37
35
  const user_service_1 = require("./services/user.service");
38
- const session_identifier_subscriber_1 = require("./subscribers/session.identifier.subscriber");
39
36
  const es6Classes = {
40
37
  controllers: [admin_auth_controller_1.AdminAuthController, social_controller_1.SocialController, user_controller_1.UserController],
41
38
  dtos: [
@@ -61,19 +58,18 @@ const es6Classes = {
61
58
  user_referral_entity_1.UserReferralEntity,
62
59
  ],
63
60
  interfaces: [],
64
- jobs: [session_identifier_job_1.SessionIdentifierJob],
61
+ jobs: [],
65
62
  middlewares: [basic_auth_middleware_1.BasicAuthMiddleware, client_connect_middleware_1.ClientConnectMiddleware, internal_middleware_1.InternalMiddleware, jwt_middleware_1.JwtMiddleware, restricted_middleware_1.RestrictedMiddleware],
66
63
  services: [
67
64
  access_service_1.AccessService,
68
65
  auth_service_1.AuthService,
69
66
  device_token_service_1.DeviceTokenService,
70
- es6_jobs_service_1.Es6JobsService,
71
67
  refresh_token_service_1.RefreshTokenService,
72
68
  social_identity_service_1.SocialIdentityService,
73
69
  social_service_1.SocialService,
74
70
  user_service_1.UserService,
75
71
  ],
76
- subscribers: [session_identifier_subscriber_1.SessionIdentifierSubscriber],
72
+ subscribers: [],
77
73
  };
78
74
  exports.default = es6Classes;
79
75
  //# 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,0EAAqE;AACrE,+EAA0E;AAC1E,uFAAkF;AAClF,2EAAuE;AACvE,iEAA6D;AAC7D,+EAA2E;AAC3E,8DAA0D;AAC1D,0DAAsD;AACtD,0EAAqE;AACrE,kEAA6D;AAC7D,4EAAuE;AACvE,gFAA2E;AAC3E,8DAA0D;AAC1D,0DAAsD;AACtD,+FAA0F;AAE1F,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,uCAAiB;QACjB,yCAAkB;QAClB,mDAAuB;QACvB,6CAAoB;QACpB,wBAAU;QACV,yCAAkB;KACrB;IACD,UAAU,EAAE,EAAE;IACd,IAAI,EAAE,CAAC,6CAAoB,CAAC;IAC5B,WAAW,EAAE,CAAC,2CAAmB,EAAE,mDAAuB,EAAE,wCAAkB,EAAE,8BAAa,EAAE,4CAAoB,CAAC;IACpH,QAAQ,EAAE;QACN,8BAAa;QACb,0BAAW;QACX,yCAAkB;QAClB,iCAAc;QACd,2CAAmB;QACnB,+CAAqB;QACrB,8BAAa;QACb,0BAAW;KACd;IACD,WAAW,EAAE,CAAC,2DAA2B,CAAC;CAC7C,CAAC;AAEF,kBAAe,UAAU,CAAC"}
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,uCAAiB;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;QACN,8BAAa;QACb,0BAAW;QACX,yCAAkB;QAClB,2CAAmB;QACnB,+CAAqB;QACrB,8BAAa;QACb,0BAAW;KACd;IACD,WAAW,EAAE,EAAE;CAClB,CAAC;AAEF,kBAAe,UAAU,CAAC"}
@@ -2,8 +2,6 @@ export * from './controllers';
2
2
  export * from './dtos';
3
3
  export * from './entities';
4
4
  export * from './interfaces';
5
- export * from './jobs';
6
5
  export * from './middlewares';
7
6
  export * from './services';
8
- export * from './subscribers';
9
7
  export * from './auth.module';
@@ -18,9 +18,7 @@ __exportStar(require("./controllers"), exports);
18
18
  __exportStar(require("./dtos"), exports);
19
19
  __exportStar(require("./entities"), exports);
20
20
  __exportStar(require("./interfaces"), exports);
21
- __exportStar(require("./jobs"), exports);
22
21
  __exportStar(require("./middlewares"), exports);
23
22
  __exportStar(require("./services"), exports);
24
- __exportStar(require("./subscribers"), exports);
25
23
  __exportStar(require("./auth.module"), exports);
26
24
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAAA,yCAAuB;AAAA,6CAA2B;AAAA,+CAA6B;AAAA,yCAAuB;AAAA,gDAA8B;AAAA,6CAA2B;AAAA,gDAA8B;AAAA,gDAA6B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAAA,yCAAuB;AAAA,6CAA2B;AAAA,+CAA6B;AAAA,gDAA8B;AAAA,6CAA2B;AAAA,gDAA6B"}
@@ -1,2 +1,2 @@
1
- declare const sentryConfig: import("@sentry/nestjs").NodeOptions;
1
+ declare const sentryConfig: import("@sentry/node").NodeOptions;
2
2
  export = sentryConfig;
@@ -29,7 +29,6 @@ import { ProcessSesDeliveryWebhookJob } from './jobs/process.ses.delivery.webhoo
29
29
  import { ProcessTrackingWebhookJob } from './jobs/process.tracking.webhook.job';
30
30
  import { RecordWatcherJob } from './jobs/record.watcher.job';
31
31
  import { ReloadPendingBullJob } from './jobs/reload.pending.bull.job';
32
- import { RemoteRequestLogJob } from './jobs/remote.request.log.job';
33
32
  import { TestJob } from './jobs/test.job';
34
33
  import { CommonSmsService } from './libraries/common.sms.service';
35
34
  import { CommonSqsPolling } from './libraries/common.sqs.polling';
@@ -93,7 +92,7 @@ declare const es6Classes: {
93
92
  filters: (typeof SentryReportingFilter)[];
94
93
  interceptors: (typeof SentryUserScopeInterceptor)[];
95
94
  interfaces: any[];
96
- jobs: (typeof TestJob | typeof LoadFailedBullJob | typeof ProcessSesDeliveryWebhookJob | typeof ProcessTrackingWebhookJob | typeof RecordWatcherJob | typeof ReloadPendingBullJob | typeof RemoteRequestLogJob)[];
95
+ jobs: (typeof TestJob | typeof LoadFailedBullJob | typeof ProcessSesDeliveryWebhookJob | typeof ProcessTrackingWebhookJob | typeof RecordWatcherJob | typeof ReloadPendingBullJob)[];
97
96
  libraries: (typeof ProcessAuditLogData | typeof ProcessCommonMail | typeof ProcessEmithookMail | typeof ProcessSesMail | typeof ProcessSesRawMail | typeof ProcessSmtpMail | typeof SentryContext | typeof CommonSmsService | typeof CommonSqsPolling | typeof FileSystemUtility | typeof CreateEntityConstantsFile | typeof CreateEs6ClassesFile | typeof CreateEs6JobsFile | typeof CreateEs6ServiceFile | typeof CreateIndexFile | typeof ProcessKaleyraCallbackResponse | typeof ProcessKaleyraSms | typeof SentryBootstrap | typeof SetSmsMessage)[];
98
97
  middlewares: (typeof MaintenanceMiddleware | typeof TrimPipe)[];
99
98
  services: (typeof RedisService | typeof CacheService | typeof AwsConfigService | typeof AwsClientFactory | typeof R2ConfigService | typeof SqlService | typeof LocalPropertyService | typeof SqsService | typeof QueueService | typeof DynamoService | typeof AuditService | typeof RemoteRequestService | typeof EmithookMailService | typeof MailService | typeof ZipService | typeof MaintenanceService | typeof SesMailNotificationService | typeof AwsSecretService | typeof Es6JobsService | typeof PdfService | typeof Es6Service | typeof FcmNotificationService | typeof S3Service | typeof ShutdownService | typeof SmsService | typeof SplitPdfService | typeof StartupService)[];
@@ -36,7 +36,6 @@ const process_ses_delivery_webhook_job_1 = require("./jobs/process.ses.delivery.
36
36
  const process_tracking_webhook_job_1 = require("./jobs/process.tracking.webhook.job");
37
37
  const record_watcher_job_1 = require("./jobs/record.watcher.job");
38
38
  const reload_pending_bull_job_1 = require("./jobs/reload.pending.bull.job");
39
- const remote_request_log_job_1 = require("./jobs/remote.request.log.job");
40
39
  const test_job_1 = require("./jobs/test.job");
41
40
  const common_sms_service_1 = require("./libraries/common.sms.service");
42
41
  const common_sqs_polling_1 = require("./libraries/common.sqs.polling");
@@ -123,15 +122,7 @@ const es6Classes = {
123
122
  filters: [sentry_reporting_filter_1.SentryReportingFilter],
124
123
  interceptors: [sentry_user_scope_interceptor_1.SentryUserScopeInterceptor],
125
124
  interfaces: [],
126
- jobs: [
127
- load_failed_bull_job_1.LoadFailedBullJob,
128
- process_ses_delivery_webhook_job_1.ProcessSesDeliveryWebhookJob,
129
- process_tracking_webhook_job_1.ProcessTrackingWebhookJob,
130
- record_watcher_job_1.RecordWatcherJob,
131
- reload_pending_bull_job_1.ReloadPendingBullJob,
132
- remote_request_log_job_1.RemoteRequestLogJob,
133
- test_job_1.TestJob,
134
- ],
125
+ jobs: [load_failed_bull_job_1.LoadFailedBullJob, process_ses_delivery_webhook_job_1.ProcessSesDeliveryWebhookJob, process_tracking_webhook_job_1.ProcessTrackingWebhookJob, record_watcher_job_1.RecordWatcherJob, reload_pending_bull_job_1.ReloadPendingBullJob, test_job_1.TestJob],
135
126
  libraries: [
136
127
  common_sms_service_1.CommonSmsService,
137
128
  common_sqs_polling_1.CommonSqsPolling,
@@ -1 +1 @@
1
- {"version":3,"file":"es6.classes.js","sourceRoot":"","sources":["../../src/platformUtility/es6.classes.ts"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"es6.classes.js","sourceRoot":"","sources":["../../src/platformUtility/es6.classes.ts"],"names":[],"mappings":"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"}
@@ -3,5 +3,4 @@ export * from './process.ses.delivery.webhook.job';
3
3
  export * from './process.tracking.webhook.job';
4
4
  export * from './record.watcher.job';
5
5
  export * from './reload.pending.bull.job';
6
- export * from './remote.request.log.job';
7
6
  export * from './test.job';
@@ -19,6 +19,5 @@ __exportStar(require("./process.ses.delivery.webhook.job"), exports);
19
19
  __exportStar(require("./process.tracking.webhook.job"), exports);
20
20
  __exportStar(require("./record.watcher.job"), exports);
21
21
  __exportStar(require("./reload.pending.bull.job"), exports);
22
- __exportStar(require("./remote.request.log.job"), exports);
23
22
  __exportStar(require("./test.job"), exports);
24
23
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/platformUtility/jobs/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAuC;AAAA,qEAAmD;AAAA,iEAA+C;AAAA,uDAAqC;AAAA,4DAA0C;AAAA,2DAAyC;AAAA,6CAA0B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/platformUtility/jobs/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAuC;AAAA,qEAAmD;AAAA,iEAA+C;AAAA,uDAAqC;AAAA,4DAA0C;AAAA,6CAA0B"}
@@ -3,7 +3,6 @@ import { ProcessSesDeliveryWebhookJob } from '../jobs/process.ses.delivery.webho
3
3
  import { ProcessTrackingWebhookJob } from '../jobs/process.tracking.webhook.job';
4
4
  import { RecordWatcherJob } from '../jobs/record.watcher.job';
5
5
  import { ReloadPendingBullJob } from '../jobs/reload.pending.bull.job';
6
- import { RemoteRequestLogJob } from '../jobs/remote.request.log.job';
7
6
  import { TestJob } from '../jobs/test.job';
8
7
  export declare class Es6JobsService {
9
8
  private readonly loadFailedBullJob;
@@ -11,10 +10,9 @@ export declare class Es6JobsService {
11
10
  private readonly processTrackingWebhookJob;
12
11
  private readonly recordWatcherJob;
13
12
  private readonly reloadPendingBullJob;
14
- private readonly remoteRequestLogJob;
15
13
  private readonly testJob;
16
14
  private jobs;
17
- constructor(loadFailedBullJob: LoadFailedBullJob, processSesDeliveryWebhookJob: ProcessSesDeliveryWebhookJob, processTrackingWebhookJob: ProcessTrackingWebhookJob, recordWatcherJob: RecordWatcherJob, reloadPendingBullJob: ReloadPendingBullJob, remoteRequestLogJob: RemoteRequestLogJob, testJob: TestJob);
15
+ constructor(loadFailedBullJob: LoadFailedBullJob, processSesDeliveryWebhookJob: ProcessSesDeliveryWebhookJob, processTrackingWebhookJob: ProcessTrackingWebhookJob, recordWatcherJob: RecordWatcherJob, reloadPendingBullJob: ReloadPendingBullJob, testJob: TestJob);
18
16
  alignJobs(): void;
19
17
  setJobs(): void;
20
18
  }
@@ -16,17 +16,15 @@ const process_ses_delivery_webhook_job_1 = require("../jobs/process.ses.delivery
16
16
  const process_tracking_webhook_job_1 = require("../jobs/process.tracking.webhook.job");
17
17
  const record_watcher_job_1 = require("../jobs/record.watcher.job");
18
18
  const reload_pending_bull_job_1 = require("../jobs/reload.pending.bull.job");
19
- const remote_request_log_job_1 = require("../jobs/remote.request.log.job");
20
19
  const test_job_1 = require("../jobs/test.job");
21
20
  const platform_utility_1 = require("../../common/libraries/platform.utility");
22
21
  let Es6JobsService = class Es6JobsService {
23
- constructor(loadFailedBullJob, processSesDeliveryWebhookJob, processTrackingWebhookJob, recordWatcherJob, reloadPendingBullJob, remoteRequestLogJob, testJob) {
22
+ constructor(loadFailedBullJob, processSesDeliveryWebhookJob, processTrackingWebhookJob, recordWatcherJob, reloadPendingBullJob, testJob) {
24
23
  this.loadFailedBullJob = loadFailedBullJob;
25
24
  this.processSesDeliveryWebhookJob = processSesDeliveryWebhookJob;
26
25
  this.processTrackingWebhookJob = processTrackingWebhookJob;
27
26
  this.recordWatcherJob = recordWatcherJob;
28
27
  this.reloadPendingBullJob = reloadPendingBullJob;
29
- this.remoteRequestLogJob = remoteRequestLogJob;
30
28
  this.testJob = testJob;
31
29
  this.jobs = {};
32
30
  this.alignJobs();
@@ -39,7 +37,6 @@ let Es6JobsService = class Es6JobsService {
39
37
  fd9a3406400161c9dae9f327f10eaa49: this.processTrackingWebhookJob,
40
38
  '2d5219897af8f7809c63c7ad538795f2': this.recordWatcherJob,
41
39
  '2585362654581cff4f70fffe0249af26': this.reloadPendingBullJob,
42
- b00707a36583a5f7078a30ce50932f42: this.remoteRequestLogJob,
43
40
  ba4c3857dfa9feac842416d9c39d0edd: this.testJob,
44
41
  };
45
42
  }
@@ -55,7 +52,6 @@ exports.Es6JobsService = Es6JobsService = __decorate([
55
52
  process_tracking_webhook_job_1.ProcessTrackingWebhookJob,
56
53
  record_watcher_job_1.RecordWatcherJob,
57
54
  reload_pending_bull_job_1.ReloadPendingBullJob,
58
- remote_request_log_job_1.RemoteRequestLogJob,
59
55
  test_job_1.TestJob])
60
56
  ], Es6JobsService);
61
57
  //# sourceMappingURL=es6.jobs.service.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"es6.jobs.service.js","sourceRoot":"","sources":["../../../src/platformUtility/services/es6.jobs.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,uEAAiE;AACjE,+FAAwF;AACxF,uFAAiF;AACjF,mEAA8D;AAC9D,6EAAuE;AACvE,2EAAqE;AACrE,+CAA2C;AAC3C,8EAA0E;AAQnE,IAAM,cAAc,GAApB,MAAM,cAAc;IAGvB,YACqB,iBAAoC,EACpC,4BAA0D,EAC1D,yBAAoD,EACpD,gBAAkC,EAClC,oBAA0C,EAC1C,mBAAwC,EACxC,OAAgB;QANhB,sBAAiB,GAAjB,iBAAiB,CAAmB;QACpC,iCAA4B,GAA5B,4BAA4B,CAA8B;QAC1D,8BAAyB,GAAzB,yBAAyB,CAA2B;QACpD,qBAAgB,GAAhB,gBAAgB,CAAkB;QAClC,yBAAoB,GAApB,oBAAoB,CAAsB;QAC1C,wBAAmB,GAAnB,mBAAmB,CAAqB;QACxC,YAAO,GAAP,OAAO,CAAS;QAT7B,SAAI,GAAG,EAAE,CAAC;QAWd,IAAI,CAAC,SAAS,EAAE,CAAC;QACjB,IAAI,CAAC,OAAO,EAAE,CAAC;IACnB,CAAC;IAMD,SAAS;QACL,IAAI,CAAC,IAAI,GAAG;YACR,gCAAgC,EAAE,IAAI,CAAC,iBAAiB;YACxD,kCAAkC,EAAE,IAAI,CAAC,4BAA4B;YACrE,gCAAgC,EAAE,IAAI,CAAC,yBAAyB;YAChE,kCAAkC,EAAE,IAAI,CAAC,gBAAgB;YACzD,kCAAkC,EAAE,IAAI,CAAC,oBAAoB;YAC7D,gCAAgC,EAAE,IAAI,CAAC,mBAAmB;YAC1D,gCAAgC,EAAE,IAAI,CAAC,OAAO;SACjD,CAAC;IACN,CAAC;IAMD,OAAO;QACH,kCAAe,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;CACJ,CAAA;AAvCY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,mBAAU,GAAE;qCAK+B,wCAAiB;QACN,+DAA4B;QAC/B,wDAAyB;QAClC,qCAAgB;QACZ,8CAAoB;QACrB,4CAAmB;QAC/B,kBAAO;GAV5B,cAAc,CAuC1B"}
1
+ {"version":3,"file":"es6.jobs.service.js","sourceRoot":"","sources":["../../../src/platformUtility/services/es6.jobs.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,uEAAiE;AACjE,+FAAwF;AACxF,uFAAiF;AACjF,mEAA8D;AAC9D,6EAAuE;AACvE,+CAA2C;AAC3C,8EAA0E;AAQnE,IAAM,cAAc,GAApB,MAAM,cAAc;IAGvB,YACqB,iBAAoC,EACpC,4BAA0D,EAC1D,yBAAoD,EACpD,gBAAkC,EAClC,oBAA0C,EAC1C,OAAgB;QALhB,sBAAiB,GAAjB,iBAAiB,CAAmB;QACpC,iCAA4B,GAA5B,4BAA4B,CAA8B;QAC1D,8BAAyB,GAAzB,yBAAyB,CAA2B;QACpD,qBAAgB,GAAhB,gBAAgB,CAAkB;QAClC,yBAAoB,GAApB,oBAAoB,CAAsB;QAC1C,YAAO,GAAP,OAAO,CAAS;QAR7B,SAAI,GAAG,EAAE,CAAC;QAUd,IAAI,CAAC,SAAS,EAAE,CAAC;QACjB,IAAI,CAAC,OAAO,EAAE,CAAC;IACnB,CAAC;IAMD,SAAS;QACL,IAAI,CAAC,IAAI,GAAG;YACR,gCAAgC,EAAE,IAAI,CAAC,iBAAiB;YACxD,kCAAkC,EAAE,IAAI,CAAC,4BAA4B;YACrE,gCAAgC,EAAE,IAAI,CAAC,yBAAyB;YAChE,kCAAkC,EAAE,IAAI,CAAC,gBAAgB;YACzD,kCAAkC,EAAE,IAAI,CAAC,oBAAoB;YAC7D,gCAAgC,EAAE,IAAI,CAAC,OAAO;SACjD,CAAC;IACN,CAAC;IAMD,OAAO;QACH,kCAAe,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;CACJ,CAAA;AArCY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,mBAAU,GAAE;qCAK+B,wCAAiB;QACN,+DAA4B;QAC/B,wDAAyB;QAClC,qCAAgB;QACZ,8CAAoB;QACjC,kBAAO;GAT5B,cAAc,CAqC1B"}
@@ -8,11 +8,8 @@ export declare class DispatcherSubscriber extends CommonSubscriber<any> implemen
8
8
  private readonly jobs;
9
9
  constructor(dataSource: DataSource, moduleRef: ModuleRef);
10
10
  onModuleInit(): Promise<void>;
11
- beforeInsert(evt: InsertEvent<any>): Promise<any>;
12
- beforeUpdate(evt: UpdateEvent<any>): Promise<any>;
11
+ private warnIgnoredPrePersistHooks;
13
12
  afterInsert(evt: InsertEvent<any>): Promise<any>;
14
13
  afterUpdate(evt: UpdateEvent<any>): Promise<any>;
15
14
  private routeDispatch;
16
- private routeBeforeHook;
17
- private assertNoConflicts;
18
15
  }