@solidxai/core 0.1.10-beta.0 → 0.1.10-beta.3

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 (56) hide show
  1. package/.claude/settings.local.json +15 -0
  2. package/dist/commands/run-tests.command.d.ts +2 -0
  3. package/dist/commands/run-tests.command.d.ts.map +1 -1
  4. package/dist/commands/run-tests.command.js +49 -17
  5. package/dist/commands/run-tests.command.js.map +1 -1
  6. package/dist/controllers/user.controller.d.ts.map +1 -1
  7. package/dist/controllers/user.controller.js.map +1 -1
  8. package/dist/helpers/bootstrap.helper.d.ts.map +1 -1
  9. package/dist/helpers/bootstrap.helper.js +2 -0
  10. package/dist/helpers/bootstrap.helper.js.map +1 -1
  11. package/dist/services/crud.service.js.map +1 -1
  12. package/dist/services/field-metadata.service.js +2 -2
  13. package/dist/services/field-metadata.service.js.map +1 -1
  14. package/dist/services/queues/database-subscriber.service.js +3 -3
  15. package/dist/services/queues/database-subscriber.service.js.map +1 -1
  16. package/dist/services/queues/rabbitmq-subscriber.service.js +4 -4
  17. package/dist/services/queues/rabbitmq-subscriber.service.js.map +1 -1
  18. package/dist/services/queues/redis-subscriber.service.d.ts.map +1 -1
  19. package/dist/services/queues/redis-subscriber.service.js +4 -1
  20. package/dist/services/queues/redis-subscriber.service.js.map +1 -1
  21. package/dist/solid-core.module.d.ts +1 -0
  22. package/dist/solid-core.module.d.ts.map +1 -1
  23. package/dist/solid-core.module.js +1 -0
  24. package/dist/solid-core.module.js.map +1 -1
  25. package/dist/testing/reporter/webhook-reporter.d.ts +54 -0
  26. package/dist/testing/reporter/webhook-reporter.d.ts.map +1 -0
  27. package/dist/testing/reporter/webhook-reporter.js +74 -0
  28. package/dist/testing/reporter/webhook-reporter.js.map +1 -0
  29. package/package.json +5 -1
  30. package/src/commands/run-tests.command.ts +45 -17
  31. package/src/controllers/user.controller.ts +16 -16
  32. package/src/helpers/bootstrap.helper.ts +3 -0
  33. package/src/services/1.js +6 -0
  34. package/src/services/crud.service.ts +2 -2
  35. package/src/services/field-metadata.service.ts +2 -2
  36. package/src/services/queues/database-subscriber.service.ts +6 -6
  37. package/src/services/queues/rabbitmq-subscriber.service.ts +5 -5
  38. package/src/services/queues/redis-subscriber.service.ts +5 -2
  39. package/src/solid-core.module.ts +1 -0
  40. package/src/testing/reporter/webhook-reporter.ts +116 -0
  41. package/dist-tests/api/authenticate.spec.js +0 -119
  42. package/dist-tests/api/authenticate.spec.js.map +0 -1
  43. package/dist-tests/api/crud-service.findOne.cityMaster.spec.js +0 -97
  44. package/dist-tests/api/crud-service.findOne.cityMaster.spec.js.map +0 -1
  45. package/dist-tests/api/ping.spec.js +0 -21
  46. package/dist-tests/api/ping.spec.js.map +0 -1
  47. package/dist-tests/helpers/auth.js +0 -41
  48. package/dist-tests/helpers/auth.js.map +0 -1
  49. package/dist-tests/helpers/env.js +0 -11
  50. package/dist-tests/helpers/env.js.map +0 -1
  51. package/docs/grouping-enhancements.md +0 -89
  52. package/docs/java-spring/README.md +0 -3
  53. package/docs/java-spring/solid-core-module-deep-dive-report.md +0 -1317
  54. package/docs/seed-changes.md +0 -65
  55. package/docs/test-data-workflow.md +0 -200
  56. package/docs/type-declaration-import-issue.md +0 -24
@@ -1,65 +0,0 @@
1
- # Seeding Enhancements Summary
2
-
3
- ## Overview
4
- This document summarizes the changes made to seeding behavior in `solid-core`:
5
- - Metadata pruning support across targets.
6
- - CLI flags for selective modules and pruning.
7
-
8
- ## Pruning Support
9
- Pruning is now available for most metadata targets. When enabled, records present in the DB but missing from JSON are removed. This is done in two phases:
10
- 1. Identify records in DB not present in JSON.
11
- 2. Delete those records before normal upsert seeding.
12
-
13
- ### Targets with Pruning
14
- - Module models + fields (with model-level pruning).
15
- - Views, actions, menus (with join cleanup).
16
- - Security rules, list of values, dashboards.
17
- - Scheduled jobs, saved filters, model sequences.
18
- - Permissions (also clears role-permission join table).
19
-
20
- ### Targets WITHOUT Pruning (conservative)
21
- - Module metadata itself
22
- - Media storage providers
23
- - Roles
24
- - Users
25
- - Email templates
26
- - SMS templates
27
- - System fields (global)
28
- - Default settings (global)
29
-
30
- ### Pruning Mode
31
- Pruning runs **only** when `--prune` is provided. If omitted, pruning is skipped.
32
-
33
- ## CLI Changes
34
- ### Modules to Seed
35
- `--conf` was removed. Use:
36
- ```
37
- --modules-to-seed venue,reports
38
- ```
39
- This passes `modulesToSeed` to the seeder as an array.
40
-
41
- ## Sample Commands
42
- ### Default seeding
43
- ```
44
- npx @solidxai/solidctl seed
45
- ```
46
-
47
- ### Select modules only
48
- ```
49
- npx @solidxai/solidctl seed --modules-to-seed venue,reports
50
- ```
51
-
52
- ### Pruning enabled
53
- ```
54
- npx @solidxai/solidctl seed --modules-to-seed venue --prune
55
- ```
56
-
57
- ### Pruning enabled (all modules)
58
- ```
59
- npx @solidxai/solidctl seed --prune
60
- ```
61
-
62
- ## Files Touched (Key)
63
- - `src/seeders/module-metadata-seeder.service.ts`
64
- - `src/commands/seed.command.ts`
65
- - `src/repository/solid-base.repository.ts` (added `findOneByUserKey`)
@@ -1,200 +0,0 @@
1
- # Test Data Workflow
2
-
3
- This document describes the end-to-end workflow for creating isolated test databases, seeding metadata, loading test data, and tearing everything down.
4
-
5
- ## Overview
6
- The workflow is designed to:
7
- - Create one **test database per configured datasource** in the project.
8
- - Point the app to those new databases via `.env` updates.
9
- - Seed all metadata into the fresh databases.
10
- - Load model-specific `testData` entries from module metadata JSON files.
11
- - Cleanly reverse everything at the end.
12
-
13
- The commands below are the canonical flow.
14
-
15
- ---
16
-
17
- ## Step 1: Create test datasources
18
-
19
- Command:
20
- ```
21
- npx @solidxai/solidctl test data --setup
22
- ```
23
-
24
- What this does:
25
- - Reads all configured datasources from the Solid registry (`SolidRegistry.getSolidDatabaseModules()`), and uses their `name()` values.
26
- - Generates a unique **run name** (two words, underscore-separated, e.g. `steady_wolf`).
27
- - Builds a **timestamped database name** per datasource:
28
- - `<datasource>_<timestamp>_<runName>`
29
- - Backs up the current `.env` into `.env.backup.<runName>`.
30
- - Rewrites `.env` in-place with new `*_DATABASE_NAME` values.
31
- - Creates the databases/schemas using TypeORM and the configured connection info.
32
- - Writes a `.solidx-test-manifest` with the run name + database names so the teardown can reverse everything later.
33
-
34
- Example output:
35
- ```
36
- ▶ Running solid test data
37
- Creating test datasource environment file and manifest.
38
- Backed up .env to .env.backup.steady_wolf and applied new test datasource names to .env.
39
- Creating test database/schema "default_20260201234402_steady_wolf" on datasource "default"...
40
-
41
- ============================================================
42
- TEST DATASOURCE ENVIRONMENT CREATED
43
- ------------------------------------------------------------
44
- Run name : steady_wolf
45
- Env backup : .env.backup.steady_wolf
46
-
47
- Test databases/schemas created:
48
- - default: default_20260201234402_steady_wolf
49
-
50
- Next steps:
51
- 1) Using updated .env with test datasource names
52
- 2) Run solid seed as usual
53
- 3) Proceed with loading the test data for each module
54
- 4) Run the test cases
55
- 5) Tear down
56
- ============================================================
57
-
58
- ✔ solid test data completed
59
- ```
60
-
61
- Rationale:
62
- - The `.env` rewrite guarantees the app connects to fresh databases without changing code.
63
- - The manifest records the run so deletion is safe and deterministic.
64
-
65
- ---
66
-
67
- ## Step 2: Seed metadata into the new databases
68
-
69
- Command:
70
- ```
71
- npx @solidxai/solidctl seed
72
- ```
73
-
74
- What this does:
75
- - Seeds full module metadata into the **fresh test databases**.
76
- - Generates the `sa` user if needed and prints its password.
77
- - Ensures all models, fields, roles, permissions, views, actions, etc. exist before loading test data.
78
-
79
- Example output (truncated):
80
- ```
81
- ▶ Running solid seed
82
- ▶ Pruning disabled: existing metadata will be kept.
83
- ▶ No modulesToSeed provided. Seeding ALL modules.
84
- ▶ Seeding Metadata for Module: solid-core
85
- ✔ [solid-core] Module/Model/Fields seeded (upserted 376)
86
- ...
87
- ✔ Seeding completed.
88
- ✔ solid seed completed
89
- ```
90
-
91
- Rationale:
92
- - Test data relies on model metadata and relationships; this ensures the schema and reference data are ready.
93
-
94
- ---
95
-
96
- ## Step 3: Load test data
97
-
98
- Command:
99
- ```
100
- npx @solidxai/solidctl test data --load
101
- ```
102
-
103
- What this does:
104
- - Reads all module metadata files (or a subset if `--modules-to-test` is provided).
105
- - Looks for `testData` arrays in each metadata file.
106
- - Resolves the correct repository for each model (repository name pattern: `<ModelName>Repository`).
107
- - Performs **upsert-style** inserts using the model’s `userKeyFieldUserKey`.
108
- - Resolves many-to-one relations using `${fieldName}UserKey`.
109
-
110
- Example output:
111
- ```
112
- ▶ Running solid test data
113
- Test data setup for all modules.
114
- Processing test data for module: solid-core
115
- ✔ Test data setup complete for module: solid-core
116
- Processing test data for module: venue
117
- ✔ Test data setup complete for module: venue
118
- ✔ solid test data completed
119
- ```
120
-
121
- Rationale:
122
- - This keeps test fixtures human-readable and tied to module metadata.
123
-
124
- ---
125
-
126
-
127
- ## Step 4: Run Tests
128
- ```
129
- npx @solidxai/solidctl test run --module venue --api-base-url http://localhost:3000 --ui-base-url http://localhost:5173 --headless false
130
- ```
131
-
132
- ```
133
- npx @solidxai/solidctl test run --module venue --list-specs
134
- ```
135
-
136
- What this does:
137
- - Loads `testing.scenarios` from the module metadata file.
138
- - Applies `--scenario-ids` or `--include-tags` filtering if provided.
139
- - Boots API and UI adapters with the supplied base URLs.
140
- - Registers any custom test specs listed in `testing.specs`.
141
- - Executes scenarios in order with fail‑fast behavior.
142
-
143
- Useful variants:
144
- ```
145
- npx @solidxai/solidctl test run --module venue --scenario-ids api-authenticate-success,api-create-states
146
- ```
147
-
148
- ```
149
- npx @solidxai/solidctl test run --module venue --include-tags smoke
150
- ```
151
-
152
- ```
153
- npx @solidxai/solidctl test run --module venue --api-base-url http://localhost:3000 --headless true
154
- ```
155
-
156
- ```
157
- npx @solidxai/solidctl test run --module venue --headless false
158
- ```
159
-
160
- Notes:
161
- - If your scenario depends on a previous scenario’s `saveAs` output (e.g., `loginSuccess`), ensure the auth scenario runs first.
162
- - For UI tests, `--ui-base-url` should point to a running frontend server.
163
- - `--list-specs` prints registered custom `test.spec` ids and exits.
164
-
165
-
166
- ## Step 5: Tear everything down
167
-
168
- Command:
169
- ```
170
- npx @solidxai/solidctl test data --teardown
171
- ```
172
-
173
- What this does:
174
- - Restores `.env` from the latest `.env.backup.<runName>`.
175
- - Deletes all `.env.backup.<runName>` files created by the workflow.
176
- - Drops each test database/schema recorded in `.solidx-test-manifest`.
177
- - Deletes the manifest file.
178
-
179
- Example output:
180
- ```
181
- ▶ Running solid test data
182
- Deleting test datasource environment and databases.
183
- Dropping test database/schema "default_20260201234402_steady_wolf" on datasource "default"...
184
- ✔ Test datasource env files and manifest deleted; test databases dropped.
185
- ✔ solid test data completed
186
- ```
187
-
188
- Rationale:
189
- - Keeps the local environment clean and restores the original `.env` safely.
190
-
191
- ---
192
-
193
- ## Optional: Limit modules for test data load
194
-
195
- You can restrict test data loading to a subset of modules:
196
- ```
197
- npx @solidxai/solidctl test data --load --modules-to-test venue,reports
198
- ```
199
-
200
- Only the listed modules are processed.
@@ -1,24 +0,0 @@
1
- # Issue: Consumer sees `Property 'id' does not exist on type 'VenueUser'`
2
-
3
- ## Summary
4
- The published declaration files in `dist/` import internal types using `src/...` module specifiers. In a consuming project, TypeScript resolves those imports against the consumer's `src` path (or fails), which can cause `User` to extend a different `CommonEntity` that does not define `id`. This leads to `Property 'id' does not exist on type 'VenueUser'` even though `CommonEntity` in the library defines it.
5
-
6
- ## Evidence
7
- - `dist/entities/user.entity.d.ts` starts with:
8
- - `import { CommonEntity } from "src/entities/common.entity";`
9
- - `dist/entities/common.entity.d.ts` correctly contains:
10
- - `id: number;`
11
-
12
- Because the import is `src/...`, the consumer may resolve it to their own `src` tree instead of the library's `dist` types.
13
-
14
- ## Root Cause
15
- Library declarations are not portable because internal imports are using absolute `src/...` aliases. These aliases are not part of Node module resolution, so consumers resolve them differently.
16
-
17
- ## Fix Options
18
- 1. **Preferred:** Replace internal imports in `src/` with relative paths so emitted `.d.ts` files are portable.
19
- 2. **Alternative:** Keep `src/*` aliases but add a post-build step (e.g., `tsc-alias`) to rewrite `dist/**/*.d.ts` imports to relative paths.
20
-
21
- ## Next Steps
22
- - Decide on option 1 or 2.
23
- - Rebuild and verify `dist/**/*.d.ts` no longer import from `src/...`.
24
- - Publish a new package version and ensure the consuming app resolves `User` and `CommonEntity` from the same package instance.