@rytass/bpm-core-nestjs-module 0.7.0 → 0.9.0

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 (100) hide show
  1. package/CHANGELOG.md +116 -0
  2. package/README.md +58 -1
  3. package/package.json +9 -2
  4. package/src/index.d.ts +1 -0
  5. package/src/index.js +1 -0
  6. package/src/index.js.map +1 -1
  7. package/src/lib/bpm/bpm-root.module.d.ts +15 -0
  8. package/src/lib/bpm/bpm-root.module.js +12 -0
  9. package/src/lib/bpm/bpm-root.module.js.map +1 -1
  10. package/src/lib/calendar/calendar.module.d.ts +5 -1
  11. package/src/lib/calendar/calendar.module.js +1 -0
  12. package/src/lib/calendar/calendar.module.js.map +1 -1
  13. package/src/lib/form/form-schema.validator.js +177 -10
  14. package/src/lib/form/form-schema.validator.js.map +1 -1
  15. package/src/lib/form/form.service.d.ts +19 -1
  16. package/src/lib/form/form.service.js +56 -6
  17. package/src/lib/form/form.service.js.map +1 -1
  18. package/src/lib/form-data-source/form-data-source-value-resolver.service.d.ts +16 -0
  19. package/src/lib/form-data-source/form-data-source-value-resolver.service.js +401 -0
  20. package/src/lib/form-data-source/form-data-source-value-resolver.service.js.map +1 -0
  21. package/src/lib/form-data-source/form-data-source.errors.d.ts +34 -0
  22. package/src/lib/form-data-source/form-data-source.errors.js +43 -0
  23. package/src/lib/form-data-source/form-data-source.errors.js.map +1 -0
  24. package/src/lib/form-data-source/form-data-source.module.d.ts +9 -0
  25. package/src/lib/form-data-source/form-data-source.module.js +55 -0
  26. package/src/lib/form-data-source/form-data-source.module.js.map +1 -0
  27. package/src/lib/form-data-source/form-data-source.queries.d.ts +57 -0
  28. package/src/lib/form-data-source/form-data-source.queries.js +293 -0
  29. package/src/lib/form-data-source/form-data-source.queries.js.map +1 -0
  30. package/src/lib/form-data-source/form-data-source.service.d.ts +72 -0
  31. package/src/lib/form-data-source/form-data-source.service.js +646 -0
  32. package/src/lib/form-data-source/form-data-source.service.js.map +1 -0
  33. package/src/lib/form-data-source/form-data-source.types.d.ts +88 -0
  34. package/src/lib/form-data-source/form-data-source.types.js +29 -0
  35. package/src/lib/form-data-source/form-data-source.types.js.map +1 -0
  36. package/src/lib/form-data-source/index.d.ts +5 -0
  37. package/src/lib/form-data-source/index.js +9 -0
  38. package/src/lib/form-data-source/index.js.map +1 -0
  39. package/src/lib/migrations/0000000018000-notification-archive.d.ts +6 -0
  40. package/src/lib/migrations/0000000018000-notification-archive.js +28 -0
  41. package/src/lib/migrations/0000000018000-notification-archive.js.map +1 -0
  42. package/src/lib/migrations/0000000019000-approval-template-activation.d.ts +6 -0
  43. package/src/lib/migrations/0000000019000-approval-template-activation.js +29 -0
  44. package/src/lib/migrations/0000000019000-approval-template-activation.js.map +1 -0
  45. package/src/lib/migrations/0000000020000-form-data-option-snapshots.d.ts +6 -0
  46. package/src/lib/migrations/0000000020000-form-data-option-snapshots.js +22 -0
  47. package/src/lib/migrations/0000000020000-form-data-option-snapshots.js.map +1 -0
  48. package/src/lib/migrations/index.d.ts +3 -0
  49. package/src/lib/migrations/index.js +9 -0
  50. package/src/lib/migrations/index.js.map +1 -1
  51. package/src/lib/notification/index.d.ts +3 -0
  52. package/src/lib/notification/index.js +3 -0
  53. package/src/lib/notification/index.js.map +1 -1
  54. package/src/lib/notification/notification-observer.token.d.ts +52 -0
  55. package/src/lib/notification/notification-observer.token.js +5 -0
  56. package/src/lib/notification/notification-observer.token.js.map +1 -0
  57. package/src/lib/notification/notification.entity.d.ts +11 -0
  58. package/src/lib/notification/notification.entity.js +17 -0
  59. package/src/lib/notification/notification.entity.js.map +1 -1
  60. package/src/lib/notification/notification.mutations.d.ts +2 -0
  61. package/src/lib/notification/notification.mutations.js +28 -0
  62. package/src/lib/notification/notification.mutations.js.map +1 -1
  63. package/src/lib/notification/notification.queries.d.ts +2 -2
  64. package/src/lib/notification/notification.queries.js +12 -8
  65. package/src/lib/notification/notification.queries.js.map +1 -1
  66. package/src/lib/notification/notification.service.d.ts +34 -2
  67. package/src/lib/notification/notification.service.js +116 -3
  68. package/src/lib/notification/notification.service.js.map +1 -1
  69. package/src/lib/template/approval-template.entity.d.ts +13 -0
  70. package/src/lib/template/approval-template.entity.js +12 -1
  71. package/src/lib/template/approval-template.entity.js.map +1 -1
  72. package/src/lib/template/template.enums.d.ts +5 -0
  73. package/src/lib/template/template.enums.js +10 -1
  74. package/src/lib/template/template.enums.js.map +1 -1
  75. package/src/lib/template/template.mutations.d.ts +2 -0
  76. package/src/lib/template/template.mutations.js +20 -0
  77. package/src/lib/template/template.mutations.js.map +1 -1
  78. package/src/lib/template/template.queries.d.ts +3 -3
  79. package/src/lib/template/template.queries.js +14 -4
  80. package/src/lib/template/template.queries.js.map +1 -1
  81. package/src/lib/template/template.service.d.ts +7 -2
  82. package/src/lib/template/template.service.js +56 -11
  83. package/src/lib/template/template.service.js.map +1 -1
  84. package/src/lib/template/workflow-definition.validator.js +11 -0
  85. package/src/lib/template/workflow-definition.validator.js.map +1 -1
  86. package/src/lib/workflow-engine/approval-instance.entity.d.ts +3 -0
  87. package/src/lib/workflow-engine/approval-instance.entity.js +15 -0
  88. package/src/lib/workflow-engine/approval-instance.entity.js.map +1 -1
  89. package/src/lib/workflow-engine/dto/resubmit-approval-instance.input.d.ts +5 -1
  90. package/src/lib/workflow-engine/dto/resubmit-approval-instance.input.js +6 -2
  91. package/src/lib/workflow-engine/dto/resubmit-approval-instance.input.js.map +1 -1
  92. package/src/lib/workflow-engine/dto/submit-approval-instance.input.d.ts +5 -1
  93. package/src/lib/workflow-engine/dto/submit-approval-instance.input.js +6 -2
  94. package/src/lib/workflow-engine/dto/submit-approval-instance.input.js.map +1 -1
  95. package/src/lib/workflow-engine/workflow-engine.mutations.d.ts +3 -2
  96. package/src/lib/workflow-engine/workflow-engine.mutations.js +8 -6
  97. package/src/lib/workflow-engine/workflow-engine.mutations.js.map +1 -1
  98. package/src/lib/workflow-engine/workflow-engine.service.d.ts +18 -3
  99. package/src/lib/workflow-engine/workflow-engine.service.js +212 -7
  100. package/src/lib/workflow-engine/workflow-engine.service.js.map +1 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,49 @@
1
+ ## 0.9.0 (2026-08-17)
2
+
3
+ ### 🚀 Features
4
+
5
+ - **notification:** lift routing fields onto the created event ([e02270b](https://github.com/Rytass/BPMCore/commit/e02270b))
6
+ - **notification:** let a host observe notifications as they are created ([#21](https://github.com/Rytass/BPMCore/pull/21))
7
+ - **shared:** detect a quorum no approver set can ever satisfy ([5671497](https://github.com/Rytass/BPMCore/commit/5671497))
8
+ - **shared:** expose the decision policy to the workflow toolset ([f6152b0](https://github.com/Rytass/BPMCore/commit/f6152b0))
9
+
10
+ ### 🩹 Fixes
11
+
12
+ - ⚠️ **template:** reject deleting a referenced category ([#16](https://github.com/Rytass/BPMCore/pull/16))
13
+ - **template:** let a template actually change category ([#17](https://github.com/Rytass/BPMCore/pull/17))
14
+ - **shared:** keep an approver change from discarding a workable policy ([ea6afbe](https://github.com/Rytass/BPMCore/commit/ea6afbe))
15
+ - **template:** block publishing a deadlocked quorum node ([89ab6a2](https://github.com/Rytass/BPMCore/commit/89ab6a2))
16
+ - **e2e:** poll on the expected value in the quorum threshold sanitiser spec ([099529f](https://github.com/Rytass/BPMCore/commit/099529f))
17
+ - **bpm-core-react:** correct decision-policy panel review findings ([ebf0337](https://github.com/Rytass/BPMCore/commit/ebf0337))
18
+
19
+ ### ⚠️ Breaking Changes
20
+
21
+ - **template:** reject deleting a referenced category ([#16](https://github.com/Rytass/BPMCore/pull/16))
22
+ `deleteApprovalTemplateCategory` now throws
23
+ `BadRequestException` when templates still reference the category, instead
24
+ of deactivating it and reporting success.
25
+ The old behaviour substituted a different operation for the one requested
26
+ and returned the same entity type either way, so a caller could not tell
27
+ that the delete had not happened — nor that `isActive` had been flipped as
28
+ a side effect it never asked for. Downstream, the category vanished from
29
+ groupings because it was now inactive, with nothing to explain why.
30
+ Deactivation is not lost: `deactivateApprovalTemplateCategory(id)` has
31
+ always existed and is unchanged, so the fallback was never the only way to
32
+ reach that state.
33
+ The designer's category screen already wraps the call in try/catch and
34
+ surfaces the message, and it only closes the confirmation dialog on
35
+ success, so the new error reaches the author without a UI change.
36
+ Reported by a consumer on 0.7.0, who had to re-implement the reference
37
+ check ahead of the call to avoid telling users something had been deleted
38
+ when it had not.
39
+ Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
40
+
41
+ ### ❤️ Thank You
42
+
43
+ - Chia Yu Pai @fantasywind
44
+ - Claude Opus 5
45
+ - Kai-Chieh Yang
46
+
1
47
  ## 0.7.0 (2026-08-10)
2
48
 
3
49
  ### 🚀 Features
@@ -23,6 +69,27 @@ file.
23
69
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
24
70
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
25
71
 
72
+ ## Unreleased
73
+
74
+ ### Added
75
+
76
+ - Form schema parsing now supports additive versioned option-source references
77
+ and structural lint for bindings, dependency cycles, and dynamic defaults.
78
+ - Added `FORM_DATA_SOURCE_VALUE_NOT_RESOLVED` so a submitted value that is no
79
+ longer selectable is reported separately from a provider contract breach.
80
+ - Added the host-provided versioned DataSource registry contract, guarded
81
+ GraphQL catalog/preview/runtime queries, provider limits, and stable error
82
+ codes for dynamic form options.
83
+ - Added server-side dynamic option resolution for submit/resubmit, persisted
84
+ option-label snapshots, optimistic revision protection around resubmit, and
85
+ the reversible `form_data_option_snapshot` migration.
86
+ - Resubmit mutations now return the refreshed persisted instance after dynamic
87
+ option resolution and workflow processing, keeping GraphQL JSON accessors in
88
+ sync with the committed form data and option snapshot.
89
+ - GraphQL DataSource input DTOs now carry explicit validation metadata so hosts
90
+ using `ValidationPipe({ forbidUnknownValues: true })` can call preview/runtime
91
+ option queries without bypassing input validation.
92
+
26
93
  Releases are managed by [`nx release`](https://nx.dev/recipes/nx-release) with
27
94
  Conventional Commits — see `nx.json` for the release config.
28
95
 
@@ -41,6 +108,55 @@ Conventional Commits — see `nx.json` for the release config.
41
108
 
42
109
  ### Fixed
43
110
 
111
+ - **Rolling back to an archived version now honours the registry gate.**
112
+ `rollbackFormDefinitionVersion` republished an archived form without checking
113
+ the host registry, so a version referencing a source the host had dropped
114
+ could become current again.
115
+ - **An illegal empty value no longer counts as "cleared".** `''` clears a
116
+ single-select and `[]` clears a multiple one; the mismatched shapes are
117
+ rejected instead of persisting a value the primitive contract forbids.
118
+ - **A corrupt instance form snapshot returns a controlled error.** Snapshot
119
+ readers dereferenced field entries, so `fields: [null]` raised a `TypeError`
120
+ out of submit/resubmit; such a snapshot is now rejected as invalid.
121
+ - **A `SET_FORM_FIELD` service task no longer leaves a wrong option label.**
122
+ Writing into a DataSource-backed field kept the previous option snapshot, so
123
+ instance history rendered the old label next to the new value. The snapshot
124
+ for that field is now dropped (the raw value is shown instead) and the
125
+ activity log records which field was cleared. The service task runs inside the
126
+ write transaction, so re-resolving through the host provider there would
127
+ breach the ADR's transaction boundary.
128
+ - **Clearing a dynamic option now removes its snapshot on resubmit.** A host
129
+ without a registry kept the old label for a field the user had emptied. An
130
+ empty array only clears a `multiple` field; on a single-select it stays an
131
+ illegal value instead of silently dropping the snapshot.
132
+ - **A binding-only preview failure now reports `FORM_DATA_SOURCE_INVALID_BINDING`.**
133
+ Binding lint lines stay prose because they quote a host-chosen parameter name,
134
+ so they carried no code and the preview fell back to `INVALID_DESCRIPTOR` —
135
+ telling the designer to contact an administrator about a binding they could
136
+ fix themselves. The code is now derived from the line shape.
137
+ - **The preview error code now follows the first lint error.** It was picked by
138
+ scanning the error-code list for a substring match, so the reported code
139
+ depended on enum declaration order and would misfire once one code became a
140
+ substring of another. It is now read only from the code-bearing lint shape
141
+ `<path>.dataSource <CODE>`, so prose such as an unbound parameter whose name
142
+ looks like a code is no longer reported as that code.
143
+ - **Publish lint no longer mislabels an unregistered DataSource key.** A key the
144
+ host never registered reported `FORM_DATA_SOURCE_VERSION_MISSING`, telling
145
+ designers to pick another version of a source that no longer exists. It now
146
+ reports `FORM_DATA_SOURCE_MISSING`, matching the runtime query path, and an
147
+ unsupported bounded control is reported once instead of twice.
148
+ - **A host without a DataSource registry can no longer publish or submit
149
+ dynamic option fields — but drafts stay editable.** The registry check runs
150
+ only where a published version is produced, so a draft that references an
151
+ unavailable source is still saved verbatim, as the ADR requires. Both the publish lint and the submit/resubmit
152
+ resolution degraded to no-ops when no registry was provided, so a
153
+ DataSource-backed value could reach the database with nothing able to
154
+ validate it. Both paths now fail with `FORM_DATA_SOURCE_MISSING`; static
155
+ forms are unaffected.
156
+ - **`initiatorMemberId` is no longer a required GraphQL input.** Submit and
157
+ resubmit inputs demanded a value the resolver always replaced with the
158
+ authenticated member id. The field is now optional and deprecated; the engine
159
+ still requires the server-derived id.
44
160
  - **Manager resolution priority now respected.**
45
161
  `resolveManagerResolutionCandidates` previously returned every active
46
162
  resolution regardless of priority. Now it keeps only the top-priority
package/README.md CHANGED
@@ -12,6 +12,13 @@ application owns runtime infrastructure such as GraphQL setup, TypeORM
12
12
  connection setup, auth/session handling, Vault or secret loading, member
13
13
  directory integration, storage adapters, and deployment.
14
14
 
15
+ Form Definition parsing accepts the additive static/DataSource option-source
16
+ shape and performs structural publish lint for source XOR, selection mode,
17
+ direct bindings, duplicate parameters, field references, dependency cycles,
18
+ and dynamic default-value prohibition. Hosts can register versioned DataSources
19
+ through `BPMRootModule`; the runtime validates bindings, bounds provider calls,
20
+ and keeps transport details and credentials out of form JSON.
21
+
15
22
  ## Package Status
16
23
 
17
24
  Current version: `0.1.10`
@@ -121,7 +128,7 @@ import { HostSessionService } from './host-session.service';
121
128
  sortSchema: true,
122
129
  }),
123
130
  }),
124
- BPMRootModule.forRoot({
131
+ BPMRootModule.forRoot({
125
132
  imports: [HostAuthModule],
126
133
  authContextFactory: buildBPMAuthContextFromExecutionContext,
127
134
  memberResolverProvider: {
@@ -375,6 +382,54 @@ configureBPMClient({
375
382
  });
376
383
  ```
377
384
 
385
+ ### Dynamic form option DataSources
386
+
387
+ The host owns the actual ERP, database, or integration-bus implementation. It
388
+ registers one versioned catalog provider; a form stores only the source key,
389
+ version, and field/constant bindings:
390
+
391
+ ```ts
392
+ import {
393
+ BPM_FORM_DATA_SOURCE_REGISTRY,
394
+ BPM_MEMBER_RESOLVER,
395
+ BPMRootModule,
396
+ } from '@rytass/bpm-core-nestjs-module';
397
+ import { HostFormDataSourceRegistry } from './host-form-data-source.registry';
398
+
399
+ BPMRootModule.forRoot({
400
+ formDataSourceRegistryProvider: {
401
+ provide: BPM_FORM_DATA_SOURCE_REGISTRY,
402
+ useClass: HostFormDataSourceRegistry,
403
+ },
404
+ memberResolverProvider: {
405
+ provide: BPM_MEMBER_RESOLVER,
406
+ useClass: HostBPMMemberResolver,
407
+ },
408
+ });
409
+ ```
410
+
411
+ `formDataSources` and `previewFormFieldOptions` are designer-only GraphQL
412
+ queries. `formFieldOptions` is an authenticated runtime query whose source
413
+ reference comes from the server's published form version or returned-instance
414
+ snapshot. Missing registry versions, unsupported controls, incomplete
415
+ bindings, provider failures, and over-limit results return stable DataSource
416
+ error codes.
417
+
418
+ On submit, the engine resolves every selected DataSource-backed value on the
419
+ server and stores the returned labels, source version, binding hash, and
420
+ validation timestamp in `approval_instances.form_data_option_snapshot`. A
421
+ resubmit resolves outside the database transaction, then rechecks the
422
+ instance revision under the transaction lock before writing form data and its
423
+ snapshot atomically. This keeps historical labels readable even when a host
424
+ later removes a registry version, while changed bindings or an `ALWAYS`
425
+ revalidation policy still require a live provider call.
426
+
427
+ The repository wrapper host demonstrates the contract with
428
+ `ApiFormDataSourceRegistry` and the seeded `demo.cost-centers@1` family. Its
429
+ database table and reset ownership remain in `apps/api`; an external host should
430
+ replace that provider through `BPMRootModule.forRoot()` and keep its own source
431
+ data and authorization rules outside the BPM package.
432
+
378
433
  This requires the wrapper host's auth middleware to honor `Authorization`
379
434
  headers (member-base hosts can be configured to do so via
380
435
  `authStrategy: 'jwt'` in addition to `cookieMode: true`).
@@ -812,6 +867,7 @@ BPMRootModule.forRootAsync({
812
867
  | `attachmentStorageProvider` | local `.storage/attachments` | Host-provided `@rytass/storages` adapter. |
813
868
  | `workflowServiceTaskDispatcherProvider` | built-in `fetch` dispatcher | Host provider for executable workflow `WEBHOOK` service tasks. |
814
869
  | `businessCalendarProvider` | Monday–Friday calendar | Host provider for `BPM_BUSINESS_CALENDAR`, used by `BUSINESS_DAY` SLAs. BPMCore ships no holiday data. |
870
+ | `formDataSourceRegistryProvider` | Empty catalog | Single host provider for versioned Select / AutoComplete / Radio / Checkbox DataSources. |
815
871
  | `attachmentRoutePrefix` | `/attachments` | Drives both the BPM signed URL path and the Nest controller mount path for `AttachmentController`. Must be set at module wiring time (see "Attachment Storage" below). |
816
872
  | `attachmentStorageProviderId` | `local` | Value stored on attachment metadata for the active adapter. |
817
873
  | `attachmentPublicBaseUrl` | `http://localhost:17603` | Public base URL for signed attachment URLs. |
@@ -1281,6 +1337,7 @@ Importing `BPMRootModule` registers GraphQL resolvers for:
1281
1337
  - Organization units, positions, memberships, manager resolution, and summary.
1282
1338
  - Member profile lookup and member metadata cache inspection.
1283
1339
  - Form definitions and form definition versions.
1340
+ - Form option DataSource catalog, designer preview, and authenticated runtime option queries.
1284
1341
  - Approval templates, template versions, categories, validation, and dry run.
1285
1342
  - Workflow instances, tokens, tasks, task candidates, decisions, activity logs,
1286
1343
  submit/process/approve/return/cancel/resubmit operations.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rytass/bpm-core-nestjs-module",
3
- "version": "0.7.0",
3
+ "version": "0.9.0",
4
4
  "description": "Embeddable NestJS BPM approval workflow module: workflow engine, approval templates, forms, organization/member contracts, attachments, signatures, notifications, delegation, and TypeORM migrations.",
5
5
  "keywords": [
6
6
  "bpm",
@@ -57,6 +57,9 @@
57
57
  "form": [
58
58
  "./src/lib/form/index.d.ts"
59
59
  ],
60
+ "form-data-source": [
61
+ "./src/lib/form-data-source/index.d.ts"
62
+ ],
60
63
  "identity": [
61
64
  "./src/lib/identity/index.d.ts"
62
65
  ],
@@ -114,6 +117,10 @@
114
117
  "types": "./src/lib/form/index.d.ts",
115
118
  "default": "./src/lib/form/index.js"
116
119
  },
120
+ "./form-data-source": {
121
+ "types": "./src/lib/form-data-source/index.d.ts",
122
+ "default": "./src/lib/form-data-source/index.js"
123
+ },
117
124
  "./identity": {
118
125
  "types": "./src/lib/identity/index.d.ts",
119
126
  "default": "./src/lib/identity/index.js"
@@ -148,7 +155,7 @@
148
155
  "@nestjs/core": "^11.0.0",
149
156
  "@nestjs/graphql": "^13.4.0",
150
157
  "@nestjs/typeorm": "^11.0.1",
151
- "@rytass/bpm-core-shared": "^0.7.0",
158
+ "@rytass/bpm-core-shared": "^0.9.0",
152
159
  "@rytass/secret-adapter-vault-nestjs": "^0.4.5 || ^0.5.0 || ^0.6.0",
153
160
  "express": "^4.0.0 || ^5.0.0",
154
161
  "graphql": "^16.0.0",
package/src/index.d.ts CHANGED
@@ -7,6 +7,7 @@ export * from './lib/condition';
7
7
  export * from './lib/database';
8
8
  export * from './lib/delegation';
9
9
  export * from './lib/form';
10
+ export * from './lib/form-data-source';
10
11
  export * from './lib/identity';
11
12
  export * from './lib/notification';
12
13
  export * from './lib/organization';
package/src/index.js CHANGED
@@ -10,6 +10,7 @@ tslib_1.__exportStar(require("./lib/condition"), exports);
10
10
  tslib_1.__exportStar(require("./lib/database"), exports);
11
11
  tslib_1.__exportStar(require("./lib/delegation"), exports);
12
12
  tslib_1.__exportStar(require("./lib/form"), exports);
13
+ tslib_1.__exportStar(require("./lib/form-data-source"), exports);
13
14
  tslib_1.__exportStar(require("./lib/identity"), exports);
14
15
  tslib_1.__exportStar(require("./lib/notification"), exports);
15
16
  tslib_1.__exportStar(require("./lib/organization"), exports);
package/src/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/bpm-core/src/index.ts"],"names":[],"mappings":";;;AAAA,2DAAiC;AACjC,oDAA0B;AAC1B,yDAA+B;AAC/B,yDAA+B;AAC/B,uDAA6B;AAC7B,0DAAgC;AAChC,yDAA+B;AAC/B,2DAAiC;AACjC,qDAA2B;AAC3B,yDAA+B;AAC/B,6DAAmC;AACnC,6DAAmC;AACnC,0DAAgC;AAChC,yDAA+B;AAC/B,gEAAsC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/bpm-core/src/index.ts"],"names":[],"mappings":";;;AAAA,2DAAiC;AACjC,oDAA0B;AAC1B,yDAA+B;AAC/B,yDAA+B;AAC/B,uDAA6B;AAC7B,0DAAgC;AAChC,yDAA+B;AAC/B,2DAAiC;AACjC,qDAA2B;AAC3B,iEAAuC;AACvC,yDAA+B;AAC/B,6DAAmC;AACnC,6DAAmC;AACnC,0DAAgC;AAChC,yDAA+B;AAC/B,gEAAsC"}
@@ -4,6 +4,7 @@ import { BPMRootAttachmentOptions } from '../attachment/attachment-options';
4
4
  import { AttachmentStorage } from '../attachment/attachment-storage.token';
5
5
  import { BPMAuthModuleOptions } from '../bpm-auth/bpm-auth.options';
6
6
  import { BPMBusinessCalendar } from '../calendar/business-calendar.token';
7
+ import { BPMFormDataSourceRegistry } from '../form-data-source';
7
8
  import { BPMRootIdentityOptions } from '../identity/identity-options';
8
9
  import { BPMMemberResolver } from '../identity/member-resolver.interface';
9
10
  import { BPMRootNotificationOptions } from '../notification/notification-options';
@@ -38,6 +39,14 @@ export interface BPMRootModuleOptions extends Pick<ModuleMetadata, 'imports'>, B
38
39
  * own `BPM_BUSINESS_CALENDAR` provider here.
39
40
  */
40
41
  readonly businessCalendarProvider?: Provider<BPMBusinessCalendar>;
42
+ /**
43
+ * Host-provided registry containing versioned form option DataSources.
44
+ *
45
+ * The registry is a single provider so a published form reference always
46
+ * resolves against one coherent catalog. When omitted, BPM exposes an
47
+ * empty catalog and keeps existing hosts bootstrap-compatible.
48
+ */
49
+ readonly formDataSourceRegistryProvider?: Provider<BPMFormDataSourceRegistry>;
41
50
  /**
42
51
  * Host-provided member resolver provider.
43
52
  *
@@ -90,6 +99,12 @@ export interface BPMRootModuleAsyncOptions extends Pick<ModuleMetadata, 'imports
90
99
  * are required, use a Nest provider with `useFactory` / `inject` here.
91
100
  */
92
101
  readonly businessCalendarProvider?: Provider<BPMBusinessCalendar>;
102
+ /**
103
+ * Host-provided versioned form option DataSource registry. This provider is
104
+ * static at module wiring time; secrets and repositories can be injected
105
+ * through its Nest `useFactory`, `useClass`, or `useExisting` definition.
106
+ */
107
+ readonly formDataSourceRegistryProvider?: Provider<BPMFormDataSourceRegistry>;
93
108
  /**
94
109
  * Providers injected into `useFactory`.
95
110
  *
@@ -9,6 +9,7 @@ const bpm_auth_module_1 = require("../bpm-auth/bpm-auth.module");
9
9
  const calendar_module_1 = require("../calendar/calendar.module");
10
10
  const delegation_module_1 = require("../delegation/delegation.module");
11
11
  const form_module_1 = require("../form/form.module");
12
+ const form_data_source_1 = require("../form-data-source");
12
13
  const identity_module_1 = require("../identity/identity.module");
13
14
  const notification_module_1 = require("../notification/notification.module");
14
15
  const notification_options_module_1 = require("../notification/notification-options.module");
@@ -89,6 +90,7 @@ let BPMRootModule = BPMRootModule_1 = class BPMRootModule {
89
90
  organization_module_1.OrganizationModule,
90
91
  attachment_module_1.AttachmentModule,
91
92
  form_module_1.FormModule,
93
+ form_data_source_1.FormDataSourceModule,
92
94
  template_module_1.TemplateModule,
93
95
  delegation_module_1.DelegationModule,
94
96
  notification_module_1.NotificationModule,
@@ -103,6 +105,7 @@ let BPMRootModule = BPMRootModule_1 = class BPMRootModule {
103
105
  }),
104
106
  calendar_module_1.CalendarModule.forRoot({
105
107
  businessCalendarProvider: options.businessCalendarProvider,
108
+ imports: options.imports,
106
109
  }),
107
110
  bpm_auth_module_1.BPMAuthModule.forRootAsync(authOptions),
108
111
  identity_module_1.IdentityModule.forRootAsync({
@@ -120,6 +123,10 @@ let BPMRootModule = BPMRootModule_1 = class BPMRootModule {
120
123
  useFactory: options.useFactory,
121
124
  }),
122
125
  form_module_1.FormModule,
126
+ form_data_source_1.FormDataSourceModule.forRoot({
127
+ imports: options.imports,
128
+ registryProvider: options.formDataSourceRegistryProvider,
129
+ }),
123
130
  template_module_1.TemplateModule,
124
131
  delegation_module_1.DelegationModule,
125
132
  notification_module_1.NotificationModule,
@@ -146,6 +153,7 @@ function createBPMFeatureModules(options) {
146
153
  notification_options_module_1.NotificationOptionsModule.forRoot(options),
147
154
  calendar_module_1.CalendarModule.forRoot({
148
155
  businessCalendarProvider: options.businessCalendarProvider,
156
+ imports: options.imports,
149
157
  }),
150
158
  bpm_auth_module_1.BPMAuthModule.forRoot(createBPMAuthModuleOptions(options)),
151
159
  identity_module_1.IdentityModule.forRoot({
@@ -160,6 +168,10 @@ function createBPMFeatureModules(options) {
160
168
  storageProvider: options.attachmentStorageProvider,
161
169
  }),
162
170
  form_module_1.FormModule,
171
+ form_data_source_1.FormDataSourceModule.forRoot({
172
+ imports: options.imports,
173
+ registryProvider: options.formDataSourceRegistryProvider,
174
+ }),
163
175
  template_module_1.TemplateModule,
164
176
  delegation_module_1.DelegationModule,
165
177
  notification_module_1.NotificationModule,
@@ -1 +1 @@
1
- {"version":3,"file":"bpm-root.module.js","sourceRoot":"","sources":["../../../../../../libs/bpm-core/src/lib/bpm/bpm-root.module.ts"],"names":[],"mappings":";;;;;AAAA,2CAMwB;AAGxB,uEAAmE;AAEnE,iEAA4D;AAM5D,iEAA6D;AAC7D,uEAAmE;AACnE,qDAAiD;AAEjD,iEAA6D;AAE7D,6EAAyE;AACzE,6FAAwF;AAExF,6EAAyE;AAEzE,oEAAgE;AAChE,iEAA6D;AAC7D,sFAAiF;AAoJjF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEI,IAAM,aAAa,qBAAnB,MAAM,aAAa;IACxB;;;OAGG;IACH,MAAM,CAAC,OAAO,CAAC,OAA6B;QAC1C,MAAM,cAAc,GAAG,uBAAuB,CAAC,OAAO,CAAC,CAAC;QAExD,OAAO;YACL,OAAO,EAAE,CAAC,GAAG,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AAe,EAAE,OAAO,CAAC,yBAAyB;SACnD,CAAC;QACF,wBAAU;QACV,gCAAc;QACd,oCAAgB;QAChB,wCAAkB;QAClB,kCAAe,CAAC,OAAO,CAAC,OAAO,CAAC;QAChC,6CAAoB,CAAC,OAAO,CAAC;YAC3B,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,6BAA6B,EAC3B,OAAO,CAAC,qCAAqC;SAChD,CAAC;KACH,CAAC;AACJ,CAAC;AAED,SAAS,0BAA0B,CACjC,OAAgE;IAEhE,OAAO;QACL,cAAc,EAAE,OAAO,CAAC,kBAAkB;KAC3C,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"bpm-root.module.js","sourceRoot":"","sources":["../../../../../../libs/bpm-core/src/lib/bpm/bpm-root.module.ts"],"names":[],"mappings":";;;;;AAAA,2CAMwB;AAGxB,uEAAmE;AAEnE,iEAA4D;AAM5D,iEAA6D;AAC7D,uEAAmE;AACnE,qDAAiD;AACjD,0DAI6B;AAE7B,iEAA6D;AAE7D,6EAAyE;AACzE,6FAAwF;AAExF,6EAAyE;AAEzE,oEAAgE;AAChE,iEAA6D;AAC7D,sFAAiF;AAoKjF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEI,IAAM,aAAa,qBAAnB,MAAM,aAAa;IACxB;;;OAGG;IACH,MAAM,CAAC,OAAO,CAAC,OAA6B;QAC1C,MAAM,cAAc,GAAG,uBAAuB,CAAC,OAAO,CAAC,CAAC;QAExD,OAAO;YACL,OAAO,EAAE,CAAC,GAAG,cAAc,CAAC;YAC5B,OAAO,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC,EAAE,GAAG,cAAc,CAAC;YACxD,MAAM,EAAE,eAAa;SACtB,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,YAAY,CAAC,OAAkC;QACpD,MAAM,WAAW,GAA8B;YAC7C,OAAO,EAAE,OAAO,CAAC,OAAO;YAC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oB,CAAC,OAAO,CAAC;YAC3B,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,gBAAgB,EAAE,OAAO,CAAC,8BAA8B;SACnB,CAAC;QACxC,gCAAc;QACd,oCAAgB;QAChB,wCAAkB;QAClB,kCAAe,CAAC,OAAO,CAAC,OAAO,CAAC;QAChC,6CAAoB,CAAC,OAAO,CAAC;YAC3B,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,6BAA6B,EAC3B,OAAO,CAAC,qCAAqC;SAChD,CAAC;KACH,CAAC;AACJ,CAAC;AAED,SAAS,0BAA0B,CACjC,OAAgE;IAEhE,OAAO;QACL,cAAc,EAAE,OAAO,CAAC,kBAAkB;KAC3C,CAAC;AACJ,CAAC"}
@@ -1,9 +1,13 @@
1
1
  import { DynamicModule, Provider } from '@nestjs/common';
2
+ import { ModuleMetadata } from '@nestjs/common/interfaces';
2
3
  import { BPMBusinessCalendar } from './business-calendar.token';
3
- export interface CalendarModuleOptions {
4
+ export interface CalendarModuleOptions extends Pick<ModuleMetadata, 'imports'> {
4
5
  /**
5
6
  * Host-provided business calendar. When omitted, BPM falls back to a
6
7
  * Monday–Friday calendar with no holiday knowledge.
8
+ *
9
+ * A `useClass` or `useFactory` provider may depend on host services, so the
10
+ * modules exporting them have to be listed in `imports`.
7
11
  */
8
12
  readonly businessCalendarProvider?: Provider<BPMBusinessCalendar>;
9
13
  }
@@ -16,6 +16,7 @@ let CalendarModule = CalendarModule_1 = class CalendarModule {
16
16
  static forRoot(options = {}) {
17
17
  return {
18
18
  exports: [sla_schedule_service_1.BPMSlaScheduleService],
19
+ imports: options.imports ? [...options.imports] : [],
19
20
  module: CalendarModule_1,
20
21
  providers: [
21
22
  options.businessCalendarProvider ?? business_calendar_provider_1.defaultBusinessCalendarProvider,
@@ -1 +1 @@
1
- {"version":3,"file":"calendar.module.js","sourceRoot":"","sources":["../../../../../../libs/bpm-core/src/lib/calendar/calendar.module.ts"],"names":[],"mappings":";;;;;AAAA,2CAAyE;AAEzE,6EAA+E;AAC/E,iEAA+D;AAU/D;;;;;GAKG;AAGI,IAAM,cAAc,sBAApB,MAAM,cAAc;IACzB,MAAM,CAAC,OAAO,CAAC,UAAiC,EAAE;QAChD,OAAO;YACL,OAAO,EAAE,CAAC,4CAAqB,CAAC;YAChC,MAAM,EAAE,gBAAc;YACtB,SAAS,EAAE;gBACT,OAAO,CAAC,wBAAwB,IAAI,4DAA+B;gBACnE,4CAAqB;aACtB;SACF,CAAC;IACJ,CAAC;CACF,CAAA;AAXY,wCAAc;yBAAd,cAAc;IAF1B,IAAA,eAAM,GAAE;IACR,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,cAAc,CAW1B"}
1
+ {"version":3,"file":"calendar.module.js","sourceRoot":"","sources":["../../../../../../libs/bpm-core/src/lib/calendar/calendar.module.ts"],"names":[],"mappings":";;;;;AAAA,2CAAyE;AAGzE,6EAA+E;AAC/E,iEAA+D;AAa/D;;;;;GAKG;AAGI,IAAM,cAAc,sBAApB,MAAM,cAAc;IACzB,MAAM,CAAC,OAAO,CAAC,UAAiC,EAAE;QAChD,OAAO;YACL,OAAO,EAAE,CAAC,4CAAqB,CAAC;YAChC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE;YACpD,MAAM,EAAE,gBAAc;YACtB,SAAS,EAAE;gBACT,OAAO,CAAC,wBAAwB,IAAI,4DAA+B;gBACnE,4CAAqB;aACtB;SACF,CAAC;IACJ,CAAC;CACF,CAAA;AAZY,wCAAc;yBAAd,cAAc;IAF1B,IAAA,eAAM,GAAE;IACR,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,cAAc,CAY1B"}