@solidxai/core 0.1.16-beta.0 → 0.1.16-beta.1

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,656 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.1.16-beta.1] - 2026-08-31
4
+
5
+ ### Added
6
+
7
+ - add ModuleIconAssetService to manage module icon installation
8
+ - remove delete button visibility for user activity history
9
+ - implement default value application for required fields in import transactions
10
+ - add default values for required fields in import transactions
11
+ - enhance media type mapping to support multiple categories per extension in MediaFieldCrudManager
12
+ - update media file type definitions to expose only necessary fields for better clarity
13
+ - enhance media type handling by consolidating media file types and updating related services
14
+ - add SecretResolutionController and related DTO for reading secrets safely
15
+ - expose media type mappings and improve field label handling in MediaFieldCrudManager
16
+ - add resolve and resolveMany methods for secret management
17
+ - add normalization utilities for text fields and integrate them into LongTextFieldCrudManager and ShortTextFieldCrudManager
18
+ - implement eager installation of Chromium for Playwright UI tests
19
+ - add security header options for iframe embedding and customize frame-ancestors
20
+ - implement transaction handling for unpublishing records and restore previous version
21
+ - add createdAt field to PostChatterMessageDto and set default in service
22
+ - implement transaction handling for unpublishing records and restore previous version
23
+ - add progress reporting functionality to test runner and reporters
24
+ - add viewWidget attribute for fileSize in metadata
25
+ - add configurable UI timeouts for testing steps and update documentation
26
+ - enhance internationalisation by adding applyCreateDefaults method for localeName on create DTOs
27
+ - implement promoteRecoveredDraftPublishVersion method and integrate with CRUDService for soft-deleted records
28
+ - add default locale name for internationalised entries in test data seeding
29
+ - implement draft/publish versioning support and refactor related services
30
+ - add DraftPublishHelperService for managing draft and publish workflows
31
+ - add workflow field data provider support and related interfaces
32
+ - add asynchronous execution for workflows and enhance execution status retrieval
33
+ - implement WorkflowSecret management with CRUD operations and integrate into workflow execution
34
+ - enhance workflow definition management and add Python runtime node
35
+ - add SolidX integration nodes for login, email, and SMS
36
+ - add support for versioning and publishing in CRUD operations, including new fields in entities and filters
37
+ - enhance http.request node with query parameters and body modes
38
+ - refactor node structure and add sequential and switch nodes
39
+ - update workflow execution and definition handling
40
+ - implement workflow execution services and nodes
41
+ - implement API key generation for system admin users in ModuleMetadataSeederService
42
+ - enhance ModuleMetadataSeederService to generate and store API keys for system admin users
43
+ - add fieldConfig property to DatasourceIntrospectionMappingColumnDto and enhance field sanitization in DatasourceIntrospectionService
44
+ - enhance migration process with build and seed commands
45
+ - enhance datasource introspection with primary key detection and migration support
46
+ - enhance role creation with module linkage and resolve module metadata
47
+ - enhance action, role, and view metadata services with change detection and JSON normalization
48
+ - add introspection services for MSSQL, MySQL, and PostgreSQL
49
+ - add new dashboard controller actions to permissions
50
+ - simplify queue health permissions by consolidating patterns
51
+ - implement explicit widget permissions and unauthorized response handling
52
+ - enhance widget permission checks and add unauthorized response handling
53
+ - add Queue SLA heatmap provider and update metadata
54
+ - update queue health menu item and reorder messages
55
+ - add various dashboard providers and runtime services
56
+ - implement WhatsApp Cloud API integration
57
+ - add gupshup whatsapp provider
58
+ - add deleteByMediaRecord method to MediaStorageProvider implementations
59
+ - add updateCustomNoteMessage action to ChatterMessageController
60
+ - add secure custom-note edit API with attachment add/remove support
61
+ - implemented social media oath for facebook and microsoft
62
+ - add partialUpdate endpoint to menu-item-metadata controller and update metadata seeder relation field name
63
+ - implemented social media oath for facebook and microsoft
64
+ - add Message Tree Action and corresponding view for mqMessage
65
+ - implement processing timeout for RabbitMQ subscriber
66
+ - Add a composite index to `ChatterMessage` on `coModelName` and `coModelEntityId`, and an index to `chatterMessage` in `ChatterMessageDetails`.
67
+ - Migrate date/time transformers to UtcDateTimeTransformer.
68
+ - simplify S3 URL resolution DTO, and remove unused S3 resolution logic.
69
+
70
+ ### Fixed
71
+
72
+ - update copy-resources script to include new menu icon and correct resource path
73
+ - update copy-resources script to target the correct directory for media files
74
+ - update build script to include resource copying and add copyfiles dependency
75
+ - remove postinstall script for menu icon installation
76
+ - add postinstall script to ensure menu icon is copied to the correct directory
77
+ - ensure file operations for menu icon are awaited in create and update methods
78
+ - update menuIconUrl to point to the correct image path
79
+ - prevent caching of negative lookups in cache helper and permission metadata service
80
+ - use replaceAll for activeUserId in security rule config
81
+ - remove migration command and related services
82
+ - pass model service to convertImportedRecordToDto and apply defaults in the correct order
83
+ - remove delete permission from metadata configuration
84
+ - remove delete permission from global settings
85
+ - make currentValue optional in CreateModelSequenceDto and update seeding logic to exclude it
86
+ - change matched column type from bit to default nullable boolean
87
+ - improve error message for media deletion restriction
88
+ - use transactions entitymanager for all subscribers only for embedded db projects
89
+ - update consuming project name resolution to use parent directory
90
+ - update solidx directory path to include consuming project name
91
+ - correct package name in model generation command and update error handling in module metadata retrieval
92
+ - username
93
+ - remove type specification for encrypted column in Setting entity, to work in mssql also
94
+ - handle null or empty security rule configuration strings in repository
95
+
96
+ ### Changed
97
+
98
+ - remove ModuleIconAssetService from core module
99
+ - rename applyEntityDefaults to applyImportDefaults for clarity
100
+ - update media type handling in CreateFieldMetadataDto and FieldMetadataService
101
+ - remove onDelete cascade option from ManyToOne relationships in entity definitions
102
+ - unify datetime column types across entities using helper function
103
+ - remove explicit timestamp type for nullable date columns across entities
104
+ - update CommonEntity properties to be optional and adjust types in WorkflowTriggerExecution
105
+ - rename create-draft-publish-helper.service to draft-publish-helper.service and update imports
106
+ - inject InternationalisationHelperService in ModuleTestDataService and CrudHelperService
107
+ - separate generic delete from draft-publish and i18n cleanup in CRUDService
108
+ - remove unused boolean type and related system column definitions from DatasourceIntrospectionService
109
+ - update CrudHelperService to initialize DraftPublishHelperService directly in the class refactor: remove publishedAt sorting logic from getLayout method in ViewMetadataService
110
+ - simplify published version filtering in CRUDService
111
+ - remove handleSeedLocales method to streamline locale seeding process
112
+ - remove legacy dashboard files and add new dashboarding architecture guide
113
+ - remove unused dashboard question and variable providers, SQL expression resolver, and related subscribers
114
+ - remove redundant null check in resolveSecurityRuleConfig
115
+ - update body column type to longText using getColumnType helper in SmsTemplate entity
116
+ - update legacy entity fields to be nullable and support null types
117
+ - replace DTO introspection with explicit isUpdate flag in MediaFieldCrudManager
118
+ - make password scheme and failed login attempt columns non-nullable in UserEntity.
119
+ - make passwordScheme, passwordSchemeVersion, and failedLoginAttempts fields nullable in the User entity.
120
+
121
+ ### Documentation
122
+
123
+ - update expired discord link
124
+
125
+ ### Other
126
+
127
+ - instant logout for access token changes
128
+ - vocabulary docs added
129
+ - removed the secrets read endpoint, since it is not required now
130
+ - renamed variables for better naming
131
+ - changes to ensure path segement parsing is consisten for $res and $data fragements in the ops vocabulary e.g currently $res was not supporting brackets but only . while grabbing data from and object
132
+ - ensure missing secrets show up in the report output so the error is presented alongside the scenario step for clarity
133
+ - `${secret:...}` in the test vocabulary
134
+ - Refactor Chromium installation process and remove eager install script
135
+ - changes
136
+ - ## Phase 6 — Global Multer upload size limit
137
+ - ## Phase 5 — Dangerous-extension checks on menu-icon & settings uploads
138
+ - ## Phase 4 — Route chatter attachments through `MediaFieldCrudManager`
139
+ - ## Phase 3 — Close the `mediaMultiple` size/category gap, and align `validateAllowedExtensions`'s placement
140
+ - ## Phase 2 — Make `mediaTypes` category resolution extension-authoritative
141
+ - Per-field extension allowlist (`mediaAllowedExtensions`)
142
+ - mpin scheme version changes
143
+ - mpin related changes
144
+ - Add safe percent-decoding for uploaded file names to prevent bypassing extension checks
145
+ - Revert "Revert "Deliverable A now stands as: cache TTL (with the store swap that make…""
146
+ - Revert "Deliverable A now stands as: cache TTL (with the store swap that make…"
147
+ - fixes around handling concurrent logins properly using per deviceKey buckets.
148
+ - Deliverable A now stands as: cache TTL (with the store swap that makes it actually work), the me() null guard it necessitates, the logout verify/idempotency fix, previousValidUntil replacing the timer, and the dead validate() removed.
149
+ - fixed the request body limit to keep it as 10mb instead of 25mb by default
150
+ - changes around files name sanitization and normalization
151
+ - changes to handle variations in extension while uploading dangerous extension files
152
+ - change request body max to 25mb
153
+ - Comment out countGroupedRecords method implementation for refactoring
154
+ - show theme toggle
155
+ - rename theme registry
156
+ - remove some unusable code
157
+ - some changes
158
+ - solidx theme settings
159
+ - chagesn to testing readme
160
+ - changes to make ui.expectUrl to wait using the navigation timeout
161
+ - type fixes
162
+ - fixes around playwright context
163
+ - Scenario snap shot changes
164
+ - test run payload changes
165
+ - Testhub test run queue changes
166
+ - Screen shoot changes
167
+ - Test Life Cycle Changes.
168
+ - Testing Hub Changes
169
+ - chagesn to testing readme
170
+ - changes to support passing an explicit createdAt while posting a chatter message
171
+ - Enhance countGroupedRecords and passed internationalisation and draft publish workflow parameters in executeGroupPipeline
172
+ - rename theme registry
173
+ - changes to make ui.expectUrl to wait using the navigation timeout
174
+ - type fixes
175
+ - fixes around playwright context
176
+ - Scenario snap shot changes
177
+ - test run payload changes
178
+ - Testhub test run queue changes
179
+ - Screen shoot changes
180
+ - Test Life Cycle Changes.
181
+ - Testing Hub Changes
182
+ - remove add permisson from permisson-list-view
183
+ - removed indexes on username and mobile since it is a conditional index and it breaks for mssql since multiple nulls are not allowed on unique columns
184
+ - readme changes
185
+ - removed hardcoded type against a boolean type
186
+ - changes to the default testing setting timeout to pick from env as well
187
+ - remove duplicate code
188
+ - refactoring around chatter media security fix
189
+ - add media extension support for post chatter
190
+ - Add media upload action and validation in MediaService
191
+ - add media extension support for post chatter
192
+ - changes to ensure only id and field are returned while populating the user in chatter
193
+ - Update defaultValue types in solid-core-metadata.json to strings
194
+ - 1. changes to ensure user populated for chatter and createdBy/updatedBy has only id and fullName populate 2. Added Exclude at property level on user to exclude sensitive fields by default without having to add an exclude at the class level
195
+ - Add getMentionableUsers permission
196
+ - Add endpoint to retrieve mentionable users with search and limit options
197
+ - Add error handling nodes and enhance workflow node definitions
198
+ - Add skipHooks option to seed command and related services
199
+ - Remove type specification for matched column in WorkflowTriggerExecution entity
200
+ - Enhance workflow node definitions and runtime context handling
201
+ - remvoing redundent code
202
+ - Remove onDelete cascade option from ManyToOne relationships in SavedFilters entity
203
+ - changes
204
+ - changes
205
+ - sql injection vulnerability closed in filter queries
206
+ - Remove LocalPath
207
+ - revert changes
208
+ - revert changes
209
+ - revert changes
210
+ - re revert
211
+ - revert changes
212
+ - private-file-cleanup
213
+ - add downlaodurl
214
+ - changes to allow overriding the is allowed api keys flag thru extension user
215
+ - Revert "user enumeration"
216
+ - remove validation from username and mobile
217
+ - user create validation bugs
218
+ - add normalize for otp based also
219
+ - Disable metadata pruning by default in seed command configuration
220
+ - Update seed command to enable metadata pruning by default
221
+ - handle-case-sensitive-for-email
222
+ - Add delete permissions for ImportTransactionController in solid-core metadata
223
+ - Add permissions for import/export functionality in solid-core metadata
224
+ - Refactor role assignment for admin users to handle capability roles individually
225
+ - discard changes
226
+ - add support for static file
227
+ - Add capability roles for admin users in module metadata seeder
228
+ - Enhance module metadata seeder with event emission for start and finish; add options interface for seeding configuration
229
+ - attachment
230
+ - Add new roles and permissions for import/export functionality; refactor role permission handling
231
+ - make isPublic default true
232
+ - changes to show the image inline
233
+ - cleanup againts media's
234
+ - inline role crate false
235
+ - Implement chatter mention notification system with email templates and queue handling
236
+ - Add messageBodyMentions field to chatter message DTOs and entity
237
+ - fix-audit-bug
238
+ - changes to include signed url token for private media
239
+ - Revert "Revert "rename function name""
240
+ - Revert "Revert "add private media support""
241
+ - Add media file type constants and enhance security for media uploads
242
+ - remove some unusable code
243
+ - some changes
244
+ - handle technical error messages due to missing resource in static resources folder
245
+ - Revert "add private media support"
246
+ - Revert "rename function name"
247
+ - rename function name
248
+ - add private media support
249
+ - some fixes
250
+ - solidx session invalid changes
251
+ - add validation on get chatter message
252
+ - updatedAt value is updating now
253
+ - fix to allow linking a userKey belonging to the parent model while seeding a child model
254
+ - add security against chatter
255
+ - chatter message endpoint made public
256
+ - removed embedded db support
257
+ - Add default sorting by ID if not explicitly specified in order options
258
+ - solidx theme settings
259
+ - add icons across all the models in solid core
260
+ - media upload added behind auth
261
+ - Refactor module path resolution to use kebab-case and extract migration file writing logic into a separate method
262
+ - Implement cleanup for TypeORM datasource entities and enhance file handling in SolidTsMorphService
263
+ - class serializer interceptor added for impact of Exclude and Expose
264
+ - Enhance datasource introspection with primary key validation and user key resolution
265
+ - Concurrent Login Feature
266
+ - user enumeration
267
+ - add helper text key on settings object .........
268
+ - changes to handle case insenstive filter operations if the values are other than string by casting
269
+ - menus item fix
270
+ - changes to ensure entity manager does not get serialized as part of the message for the computed field queue
271
+ - added nodemon heartbeat to allow in-process db query execution for code generation for embedded db
272
+ - display name changed
273
+ - name changed
274
+ - added settings for configure the row click on solid list view
275
+ - Revert "Fix for this issue > stop applying lower for numeric fields."
276
+ - fixed legacy entity files names
277
+ - view metadata type field - selection static and roles required false from menu-item
278
+ - Fix for this issue > stop applying lower for numeric fields.
279
+ - refactor and add migration command
280
+ - Handling for audit subscriber to defer audit publish when in embedded db mode
281
+ - Fixed the one genuine mid-transaction second-connection case and hardened the latent spots (for embedded db)
282
+ - changes to take in option for seeding with modules in current seed method
283
+ - Fix validation logic to parse string field values as integers before applying validations
284
+ - remove computed field from instruction add one remove field command fix many-to-many on chatter log
285
+ - ad changes
286
+ - Add locale seeding functionality and enhance locale management
287
+ - subscribers now use the event’s own transaction connection instead of a second pooled one (helpful for embedded db)
288
+ - changes to avoid extra module checks before dynamically loading it
289
+ - defaulted to modulemetadataseederservice if no seeder provided
290
+ - Add Date field in Instructions Response
291
+ - ai interaction cleanup changes
292
+ - enabling create,edit,import,export on permission and lov modules
293
+ - added module to rolemetadata list view
294
+ - roles group by module changes
295
+ - Refactor dashboard providers to utilize new bucket expression and normalization functions
296
+ - Implement Datasource Management functionality with controller, service, and DTO
297
+ - added index to fields newly added as sortable and searchable
298
+ - Add archiver package to dependencies
299
+ - removed unnecessary seed file
300
+ - Add TypeORM migration helper functions and export in index
301
+ - fixes
302
+ - reverted accidental removal of the layout builder root menu
303
+ - pending cleanup of solid core menu items
304
+ - Refactor metadata: remove standalone menu items and add scheduled jobs and saved filters tree views
305
+ - Remove ChatterMessageDetails and ImportTransactionErrorLog menu items; add Chatter Messages tree view and action. Other menu sub menus cleanup done
306
+ - Add model sequence and list of values tree views to metadata, other cleanup changes
307
+ - changes for IAM
308
+ - Add clearPackageRuntime functionality and corresponding metadata action
309
+ - Add archiver dependency and implement module package export functionality
310
+ - Refactor menu cleanup logic in ModelMetadataService and ModuleMetadataService; improve error handling for file deletion and update build commands in ModulePackageService to use solidctl.
311
+ - Update solid-core-metadata.json to disable create, edit, and delete actions, and set searchable attributes to false for specific fields for media storage provider
312
+ - Add media tree view and action & media view cleanup, enhance file storage provider with file size tracking, implemented storeStreams for s3
313
+ - Remove cleanup procedures for module metadata across all SQL dialects and implement menu and action cleanup in the service layer.
314
+ - Remove unused database bootstrap service and related SQL cleanup procedures
315
+ - cleanup
316
+ - Add view and action metadata tree views with updated permissions and searchable fields
317
+ - Add view and action metadata tree views with updated permissions and searchable fields
318
+ - menu item model cleanup
319
+ - Add resumable import handling and transaction management in module package service
320
+ - Add method to retrieve Solid UI module path and enhance cleanup logging
321
+ - Enhance module metadata seeder: add validation for module name, streamline array handling for scheduled jobs, saved filters, list of values, security rules, sms templates, email templates, menus, actions, views, users, roles, media storage providers, model sequences, and models metadata.
322
+ - Implement module package management: add controller, service, and DTOs for import, export, and build operations.
323
+ - many to one left join issue fixed
324
+ - Refactor field metadata actions and views: update action types, enhance searchability, and adjust permissions for create, edit, and delete operations.
325
+ - Refactor CRUD and model metadata services to enhance group filtering and pagination; streamline response handling and improve query structure. configuration changes to support tree view in model metadata
326
+ - Update solid-core metadata: remove import/export options, rename fields, and add sortable attribute
327
+ - Enhance solid-core metadata structure for module mdtadata by removing import/export options and adding sortable attributes for fields
328
+ - Implement module metadata explorer with CRUD operations and search functionality
329
+ - Refactor module metadata paths to use a consistent directory structure and improve file resolution logic
330
+ - Bug fixs
331
+ - added frontend base url as well to the default settings
332
+ - minor cleanup
333
+ - changes to cleanup legacy table related fields
334
+ - changes for new dashboards functionality
335
+ - always print server startup line regardless of log level
336
+ - Add field quality checks and fixes checklist for backend validation
337
+ - typeo issue
338
+ - Agent table clean up
339
+ - Add manual interaction step for Playwright and update README
340
+ - provision made to unlink data rather than having to teardown everything
341
+ - provision made to unlink data rather than having to teardown everything
342
+ - changes to colour the server startup line
343
+ - Agent table clean up
344
+ - changes to avoid too many initialization logs. controlled thru the verboseBootstrap option to the boostrap helper
345
+ - removed id command options and retained the singular name option only for consistency purposes
346
+ - changes to route genertion commands thru solidctl. The refresh-module & refresh-model commands are what are eventually called and end up calling the services only, keeping calling consistent and ensuring everything is route thru solidctl generate
347
+ - got rid of fieldNamesForRefresh and fieldIdsForRefresh dead chain since it is not used now, due to fields being read in the code builder from the metadata json directly
348
+ - MCP table solid changes
349
+ - playwrite added as dependency instead
350
+ - changes to the test runner
351
+ - chatter message user resolution chagnes
352
+ - bug fix in chatter message user resolution after we moved to queues.
353
+ - moved back to beta3
354
+ - failed login attempts field added to the json and update dto and exposed in entity
355
+ - removed un-necessary index on newvalue display
356
+ - ts changes error: any
357
+ - auto addition of menus happens at the bottom now. list view layout changes for security access rules + enabled delete made welcome email & sms SystemAdminEditable
358
+ - changed model metadata service default form layout to be single column
359
+ - added typing to catch blocks + authentication service bug fixes for private registration flow
360
+ - added typing to catch blocks + authentication service bug fixes for private registration flow
361
+ - normalised @ApiTags
362
+ - enum for passwordless modes
363
+ - bug fix in how alternative actions are rendered
364
+ - queue related bug fixes
365
+ - changes to add a websocket adaptor to the bootstrap server routine
366
+ - license changes
367
+ - type fixes
368
+ - removed min and max from long text mapping
369
+ - bug fix for shortext field mapping
370
+ - changes to post the testing results to a webhook api with a test payload
371
+ - added import multer this fixes un-necessary ts errors in vscode
372
+ - ts errors fixed
373
+ - bug fix in rabbitmq subscriber optimisation in all subscribers to default to role both if not specified
374
+ - formatting changes
375
+ - facebook oauth
376
+ - Status required false
377
+ - updated gitignore
378
+ - dleete un-necessary docs
379
+ - deleted un-necessary files
380
+ - changes related to more grooming
381
+ - api added in cors
382
+ - refactor Oauth strategy
383
+ - Revert "Ft social media login"
384
+ - bug fix
385
+ - bug fix
386
+ - add new api me endpoint and role based settings
387
+ - setting changes for new ui architecture
388
+ - changes for new settings structure
389
+ - chatter task subtype and related changes
390
+ - bug fix
391
+ - fixes
392
+ - changes to get rid of angular schematics for helping with string case transformation for consistency purpose i.e (lodash is being used on frontend too) and avoid edge cases
393
+ - changes to handle import logs as well, thru configured winston log level
394
+ - change isMultiSelect to true in solid-core-metadata.json
395
+ - change isMultiSelect to false and set visibility for cronExpression, dayOfWeek, and dayOfMonth fields to false
396
+ - tightened up queue subscriber interface + fixed core subscribers that were not returning anything. all subscribers must either return a promise or if not async then the actual value
397
+ - removed authTheme setting, auth pages dark - light is now controlled by the same local storage as the rest of the app shell
398
+ - bug fix: passwordless registration should create a user with active false
399
+ - apikeys attribute was not exposed
400
+ - refactor Oauth strategy
401
+ - changes to avoid sending out encrypted setting in api responses. also removed menu item and action entries for ai settings. (temporary fix, since setting ui to be revamped soon)
402
+ - bug fix
403
+ - null check on role
404
+ - made provision to seed custom permissions
405
+ - handled seed scenario too
406
+ - upload File and expectHidden changes
407
+ - extension user cleanup and checks added
408
+ - fixed types for cleanup
409
+ - added tsc-alias as well to ensure clean imports in dist as an extra cleanup measure
410
+ - fixes bare shell imports with relative imports
411
+ - dynamic import fix
412
+ - removed unnecessary file
413
+ - fixes for 1. throw exception if extension user and no provider configured 2. fixed roles method in the extensionUserProvider interface to make it mandatory
414
+ - removed base abstract class
415
+ - added interface too
416
+ - changes
417
+ - changes to test data seeding & fixed the type for authenticationService.signup method
418
+ - changes to user dto to include the api keys toggle
419
+ - add default role to the user only if there are no roles resolved against a user
420
+ - changes to replace current extension user custom user creation logic with the use of dynamic extension user provider. cleans up creation of an extension user
421
+ - Only forward --debug when explicitly enabled.
422
+ - toolOutput field changes to json
423
+ - adding user api key entity to export
424
+ - minor optimisation to how dynamic modules are loaded
425
+ - Add Discord badge to top of README
426
+ - Fix broken BSL license link and add Discord link to README
427
+ - Add BSL 1.1 license and update package.json license field
428
+ - Seed user and roles in testing data
429
+ - removed readme.txt
430
+ - moved type and interfaces in interfaces.ts and refactored accordingly
431
+ - changed to md
432
+ - added readme
433
+ - Ai setting model change
434
+ - changes to allow encrypting setting keys
435
+ - form view clean up
436
+ - Agent table list view changes
437
+ - synchronize false
438
+ - changes to resolve the selection dynamic provider by name and token both
439
+ - changes to bypass swagger urls from csp policy
440
+ - changes to create a seperate endpoint for admin users to generate api key + custom repository created for userApiKey
441
+ - changes to fix issue around isAllowedToGenerateApiKeys not getting saved during user creation
442
+ - changes to implement the sso code and sso exchange use cases
443
+ - removed orm types / exported api key entity
444
+ - added provision to control if api key creation is allowed for the user
445
+ - api key changes for backend
446
+ - changes to bootstrap helper to read from standard env variables and avoid redundantly passing swagger options
447
+ - fix to call addRoles only if role names are present
448
+ - Revert "revert: refactor: update legacy entity fields to be nullable and support null types"
449
+ - refactor: update legacy entity fields to be nullable and support null types
450
+ - Json structure change
451
+ - Agent table metadata clean up changes
452
+ - longtext
453
+ - longtext changes
454
+ - Agent tables clean up
455
+ - fixes to seed many-to-many relation for tests
456
+ - changes to seed media in testing data
457
+ - Chatter modelUserkey and excel many to one issue
458
+ - keeping the default selectionValueType as string since this is a good default
459
+ - bug fixes around how media is done
460
+ - bug fixes
461
+ - try catch inside logEvent
462
+ - media has card based metadata
463
+ - Refresh token activity
464
+ - changes to implement the sso code and sso exchange use cases
465
+ - cleanup
466
+ - enabled kanban view on mq message
467
+ - Agent table changes
468
+ - changes to disallow deleting a model or module in production
469
+ - changelog version bumped
470
+ - changelog added
471
+ - changes to control the logging using env variables & set appropriate defaults basis environment
472
+ - chnages for logging
473
+ - Chatter queue fixs
474
+ - one more "beta" for ozzy
475
+ - additional loggging in cors helper
476
+ - changes
477
+ - Redis Queue component and rabbitMQ folder changes
478
+ - changes to track old and new fields as part of the delete entity operation
479
+ - optimizations done for audit subcriber
480
+ - changes to optimize audit subscriber code to use background jobs entirely instead of partially
481
+ - changes to push all work/processing to the chatter queue subscriber to better manage workloads & db pooling utilization
482
+ - formatting changes
483
+ - performance optimisations 1. created by updated by subscriber is not querying users again and again 2. rabbit pub / sub can now optinally switch off db persistence
484
+ - qs depth config increased
485
+ - changes to move the shouldTrackAudit check into registry to avoid unnecessary checks during runtime
486
+ - cached model metadata queries
487
+ - changse
488
+ - disabled extra loggign
489
+ - chagnes
490
+ - reduced concurrency in computed fields
491
+ - additional loggign
492
+ - added indexes to mobile & email since those are frequently queries upon
493
+ - changes to optimize the permission service methods used in the hotspot load paths within auth and access token guards
494
+ - Redis background job changes
495
+ - Chatter Rationalizing
496
+ - changes
497
+ - changes
498
+ - changes to merge the entityId sequence computed provider into the existing sequence number provider
499
+ - changes to export bootstrap helpers for server & cli nest applications
500
+ - changes to toggle the validation for selection dynamic provider. Also changes to export a bootstrap helper function
501
+ - registered the EntityIdSequenceNumComputedFieldProvider computation provider as a nest provider
502
+ - Added EntityIdSequenceNumComputedFieldProvider as an alternative simpler provider which uses the modelSequence configuration and relies on the id persisted during creation for an entity
503
+ - added index on message id in mq message table
504
+ - changes around sequence num computed field being a post computation provider error logging in rabbit mq
505
+ - changes to save model sequence id as part of post compute instead of pre compute
506
+ - changse
507
+ - Revert "High concurrency fix for alpha num and sequence num computed fields"
508
+ - High concurrency fix for alpha num and sequence num computed fields
509
+ - bug fix in cron evalutaion
510
+ - tighter logging around roles
511
+ - scheduler now supports env based specific jobs starting and others not
512
+ - reverting back to text (i.e since it is good enough for mysql too) i.e 64kb for these fields
513
+ - revert cross db changes for view-metadata-entity
514
+ - fixes
515
+ - changes to handle cross-db compatibility
516
+ - added type as simple-json
517
+ - Remove isValidateForUpdate hack that relied on checking dto.id !== undefined
518
+ - Revert "Merge branch 'media-update' into 'main'"
519
+ - Mysql related changes
520
+ - ts-morph and media storage fix
521
+ - dashboard layout menu item added
522
+ - dashboard changes
523
+ - scheduler bug fix
524
+ - made provision to execute scheduled jobs manually
525
+ - changes
526
+ - cleanup
527
+ - logging related changes and made user activity history tree view
528
+ - changes to return the wall clock time as utc for chatter as well to keep it...
529
+ - changes around dashboard question refactoring
530
+ - default tree view and action added on code generation
531
+ - Date time format changes in audit
532
+ - user activity history on otp login
533
+ - changes
534
+ - changelog added
535
+ - reverted legacy and common entity to use local date time transformer only
536
+ - added changelog
537
+ - made playwright dependency lazy
538
+ - ai interaction table user is nullable now
539
+ - rabbitmq subscriber does a prefetch now allowing for more concurrency
540
+ - formatting changes
541
+ - Version info changes
542
+ - dummy otp can now be enabled on a per user basis
543
+ - jwt token optimisation
544
+ - optimised the authentication flow in microservice adapter to cache access token
545
+ - deleted file containing secrets
546
+ - changes
547
+ - optimisation around how dummy otp is managed
548
+ - isSeeded added
549
+ - bug fix for fetch layouts
550
+ - view modes added in layout
551
+ - One to many crud manager fixes
552
+ - one-to-many-crud-manager-fixes
553
+ - Many to many crud field manager fixes
554
+ - patch endpoint added in role controller
555
+ - many-to-many field fixes
556
+ - modelSequenceFormViewChangeHandler added on field change
557
+ - changes to convert the passwordlessRegistrationValidateWhat from array to string
558
+ - changes to format group values consistently
559
+ - fixes for normalizing group values
560
+ - Revert "changes to return groupValue in the group meta response as well. groupValue is..."
561
+ - changes to return groupValue in the group meta response as well. groupValue is...
562
+ - changes to return groupValue in the group meta response as well. groupValue is...
563
+ - filter_field_granularity_supported_added_for_date_fields
564
+ - password registration/login cleanup + max failed login attempts checks added
565
+ - removed unsafe inline from CSP
566
+ - removed incorrect comment
567
+ - changes
568
+ - Revert "replaced playwright with lazy dependency"
569
+ - replaced playwright with lazy dependency
570
+ - count and average
571
+ - fixes to solid core metadata configuration
572
+ - make `s3Key` and `isPrivate` properties mandatory in `ResolveS3UrlDto`.
573
+ - solid seed now prints proper exception stack trace
574
+ - added playwright dependencies as peer dependencies
575
+ - changed playwright import to make it lazy
576
+ - issue fixes
577
+ - formatting changes
578
+ - formatting changes
579
+ - changes for test setup
580
+ - package changes
581
+ - Changes to generate an SA user with the default password for simpler experience during setup
582
+ - more changes to support form data based uploads
583
+ - changes
584
+ - changes around testing workflow
585
+ - unified testing utitlities
586
+ - added comments to the slug code
587
+ - refactored queue namespacign
588
+ - queue namespacing related chanes
589
+ - removed todo
590
+ - queue name related changes
591
+ - cag
592
+ - changrs
593
+ - queues names are now namespaced by service naem
594
+ - enabled logs
595
+ - debug logs
596
+ - testing docs updated
597
+ - changes
598
+ - cleanup
599
+ - removed old testing related fiels
600
+ - testing infra now supports data based interpolation
601
+ - testing changes: now we support fully custom test specs
602
+ - changes for test automation
603
+ - changes to tsconfig for playwright tests
604
+ - exporting typeorm db helper
605
+ - removed the files section
606
+ - changes for playwright testing
607
+ - changes to disable service controller seed method
608
+ - formatting changes
609
+ - oom issue
610
+ - logger added for chatter
611
+ - changed arg to kebab case instead of came case in schematic service
612
+ - default menu icons added
613
+ - rabbitmq subscriber: add retries, DLX queues, reconnects, and docs
614
+ - removed un-necessary log
615
+ - fix for handling non existence of fieldNamesForRemoval arg
616
+ - foirmatting canges
617
+ - Archived/solidstarters main
618
+ - version changes
619
+ - changed org : @solidstarters -> @solidxai
620
+ - removed publish script, since it is replaced with solidctl release
621
+ - chanes
622
+ - Revert "@solidstarters namespace changed to @solidx"
623
+ - @solidstarters namespace changed to @solidx
624
+ - file service interface changes
625
+ - CR in s3 file service, url options now supports isPrivateBucket allowing one to generate signed and un-signed URLs using the getUrl method
626
+ - changes to the publish script to support: 1.reverse merging main to dev to ensure latest package version is synced with dev post publish. 2. added guardrail to allow publishing from main branch only 3. added dry run option and force option i.e (in case we want to publish from another branch, but is hidden) 4. script now pushes the git version tags as well
627
+ - changes to pass minimal parameters to the schematics project and pick the rest from the metadata configuration json file (avoid long shell commands)
628
+ - test data workflow
629
+ - test-data command
630
+ - seed command updated
631
+ - changes
632
+ - changes
633
+ - seed command changes to support pruning, test-data-setup and test-data-teardown.
634
+ - seeding now supports seedData allowing us to seed fixtures for testing.
635
+ - precomputations now skip computation if value is already provided
636
+ - added utility for findOneByUserKey
637
+ - pruning related chagnes
638
+ - changes
639
+ - more changes related to pruning metadata
640
+ - pruen logs added
641
+ - module metadata seeder now does prune also
642
+ - reformatting to improve readability
643
+ - changes
644
+ - file type not allowed. Allowed: image, document, pdf. Received mimetype: application/pdf (mapped to file)
645
+ - bug fixes
646
+ - changes to cleanup the implementation by having the write method of file service return the url post write
647
+ - changes to support using the region specified in a media storage provider, instead only the default while creating an s3 client
648
+ - fixes for using the default-aws-s3 bucket for storing the settings media if default file service is s3
649
+ - changes to settings media storage logic i.e copy multer path to file service implementation write
650
+ - file service abstraction cleanup
651
+ - chagnes
652
+ - Dashboard Question Responsive
653
+
3
654
  ## [0.1.16-beta.0] - 2026-08-31
4
655
 
5
656
  ### Added
@@ -4,7 +4,7 @@
4
4
  "displayName": "Solid Core",
5
5
  "description": "Solid Core Module",
6
6
  "defaultDataSource": "default",
7
- "menuIconUrl": null,
7
+ "menuIconUrl": "media-files-storage/solid-core-menu-icon.png",
8
8
  "menuSequenceNumber": 1,
9
9
  "isSystem": true,
10
10
  "models": [
@@ -158,8 +158,8 @@ let ModuleMetadataService = ModuleMetadataService_1 = class ModuleMetadataServic
158
158
  throw new common_1.BadRequestException('Dangerous file types are not allowed for the menu icon.');
159
159
  }
160
160
  const fileStoragePath = this.getFullFilePathForDisk(this.getFileName(files[0]));
161
- this.fileService.copy(files[0].path, fileStoragePath);
162
- this.fileService.delete(files[0].path);
161
+ await this.fileService.copy(files[0].path, fileStoragePath);
162
+ await this.fileService.delete(files[0].path);
163
163
  createDto.menuIconUrl = fileStoragePath;
164
164
  }
165
165
  const moduleMetadata = this.moduleMetadataRepo.create(createDto);
@@ -249,8 +249,8 @@ let ModuleMetadataService = ModuleMetadataService_1 = class ModuleMetadataServic
249
249
  throw new common_1.BadRequestException('Dangerous file types are not allowed for the menu icon.');
250
250
  }
251
251
  const fileStoragePath = this.getFullFilePathForDisk(this.getFileName(files[0]));
252
- this.fileService.copy(files[0].path, fileStoragePath);
253
- this.fileService.delete(files[0].path);
252
+ await this.fileService.copy(files[0].path, fileStoragePath);
253
+ await this.fileService.delete(files[0].path);
254
254
  module.menuIconUrl = fileStoragePath;
255
255
  }
256
256
  return manager.save(module_metadata_entity_1.ModuleMetadata, module);
@@ -1 +1 @@
1
- {"version":3,"file":"module-metadata.service.js","sourceRoot":"","sources":["../../src/services/module-metadata.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAAgH;AAChH,6CAAmD;AACnD,oGAAyG;AAEzG,qCAA4E;AAC5E,+EAAoE;AAEpE,qFAAyE;AACzE,+EAAoE;AAEpE,4DAAoD;AAEpD,gDAAkC;AAClC,2CAA6B;AAC7B,gEAA8D;AAC9D,oEAAsE;AACtE,qGAAuF;AACvF,8FAAyF;AACzF,yFAAqF;AACrF,sGAAiG;AACjG,iCAAoD;AACpD,+DAA+E;AAG/E,oEAGsC;AACtC,gEAA4D;AAC5D,8DAA0D;AAE1D,+DAA0D;AAC1D,qEAAgE;AAChE,uDAAmD;AAG5C,IAAM,qBAAqB,6BAA3B,MAAM,qBAAqB;IAGhC,YAEE,UAAuC,EAGtB,kBAA4C,EAC5C,iBAAoC,EACpC,gBAAkC,EAClC,cAA8B,EAC9B,WAA4B,EAC5B,cAA8B,EAE9B,wBAAyD,EAE1E,oBAA2D,EAC1C,aAA4B,EAC5B,2BAAwD;QAdxD,eAAU,GAAV,UAAU,CAAY;QAGtB,uBAAkB,GAAlB,kBAAkB,CAA0B;QAC5C,sBAAiB,GAAjB,iBAAiB,CAAmB;QACpC,qBAAgB,GAAhB,gBAAgB,CAAkB;QAClC,mBAAc,GAAd,cAAc,CAAgB;QAC9B,gBAAW,GAAX,WAAW,CAAiB;QAC5B,mBAAc,GAAd,cAAc,CAAgB;QAE9B,6BAAwB,GAAxB,wBAAwB,CAAiC;QAEzD,yBAAoB,GAApB,oBAAoB,CAAsB;QAC1C,kBAAa,GAAb,aAAa,CAAe;QAC5B,gCAA2B,GAA3B,2BAA2B,CAA6B;QAlB1D,WAAM,GAAG,IAAI,eAAM,CAAC,uBAAqB,CAAC,IAAI,CAAC,CAAC;IAmB7D,CAAC;IAEL,KAAK,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;QACjB,sBAAe;QACZ,gCAAc;QAEJ,oEAA+B;QAEnC,6CAAoB;QAC3B,8BAAa;QACC,4DAA2B;GAnBhE,qBAAqB,CA2kBjC","sourcesContent":["import { BadRequestException, forwardRef, Inject, Injectable, Logger, NotFoundException } from '@nestjs/common';\nimport { InjectDataSource } from '@nestjs/typeorm';\nimport { DEFAULT_MEDIA_FILE_STORAGE_DIR } from \"src/services/settings/default-settings-provider.service\";\nimport type { SolidCoreSetting } from \"src/services/settings/default-settings-provider.service\";\nimport { DataSource, EntityManager, In, SelectQueryBuilder } from 'typeorm';\nimport { ActionMetadata } from '../entities/action-metadata.entity';\nimport { CreateModuleMetadataDto } from '../dtos/create-module-metadata.dto';\nimport { MenuItemMetadata } from '../entities/menu-item-metadata.entity';\nimport { ModuleMetadata } from '../entities/module-metadata.entity';\n\nimport { classify } from '../helpers/string.helper';\nimport { ConfigService } from '@nestjs/config';\nimport * as fs from 'fs/promises'; // Use the Promise-based version of fs for async/await\nimport * as path from 'path'; // To handle file paths\nimport { ERROR_MESSAGES } from 'src/constants/error-messages';\nimport { isDangerousMediaFile } from 'src/constants/media-file-types';\nimport { DisallowInProduction } from 'src/decorators/disallow-in-production.decorator';\nimport { ModuleMetadataHelperService } from 'src/helpers/module-metadata-helper.service';\nimport { ModuleMetadataRepository } from 'src/repository/module-metadata.repository';\nimport { PermissionMetadataSeederService } from 'src/seeders/permission-metadata-seeder.service';\nimport { DiskFileService } from 'src/services/file';\nimport { sanitizeStoredMediaFileName } from 'src/services/media-storage.utils';\nimport { BasicFilterDto } from '../dtos/basic-filters.dto';\nimport { UpdateModuleMetadataDto } from '../dtos/update-module-metadata.dto';\nimport {\n ADD_MODULE_COMMAND,\n SchematicService,\n} from '../helpers/schematic.service';\nimport { CommandService } from '../helpers/command.service';\nimport { SolidRegistry } from '../helpers/solid-registry';\nimport { CodeGenerationOptions, ModuleMetadataConfiguration } from '../interfaces';\nimport { CrudHelperService } from './crud-helper.service';\nimport { ModelMetadataService } from './model-metadata.service';\nimport { SettingService } from './setting.service';\n\n@Injectable()\nexport class ModuleMetadataService {\n private readonly logger = new Logger(ModuleMetadataService.name);\n\n constructor(\n @InjectDataSource()\n private readonly dataSource: DataSource,\n // @InjectRepository(ModuleMetadata)\n // private readonly moduleMetadataRepo: Repository<ModuleMetadata>,\n private readonly moduleMetadataRepo: ModuleMetadataRepository,\n private readonly crudHelperService: CrudHelperService,\n private readonly schematicService: SchematicService,\n private readonly commandService: CommandService,\n private readonly fileService: DiskFileService,\n private readonly settingService: SettingService,\n\n private readonly permissionsSeederService: PermissionMetadataSeederService,\n @Inject(forwardRef(() => ModelMetadataService))\n private readonly modelMetadataService: ModelMetadataService,\n private readonly solidRegistry: SolidRegistry,\n private readonly moduleMetadataHelperService: ModuleMetadataHelperService,\n ) { }\n\n async findMany(basicFilterDto: BasicFilterDto) {\n const alias = 'moduleMetadata';\n // Extract the required keys from the input query\n let { limit, offset } = basicFilterDto;\n\n // Create above query on pincode table using query builder\n var qb: SelectQueryBuilder<ModuleMetadata> = await this.moduleMetadataRepo.createSecurityRuleAwareQueryBuilder(alias)\n qb = await this.crudHelperService.buildFilterQuery(qb, basicFilterDto, alias);\n\n // Get the records and the count\n const [entities, count] = await qb.getManyAndCount();\n\n const currentPage = Math.floor(offset / limit) + 1;\n const totalPages = Math.ceil(count / limit);\n\n const nextPage = currentPage < totalPages ? currentPage + 1 : null;\n const prevPage = currentPage > 1 ? currentPage - 1 : null;\n\n const r = {\n meta: {\n totalRecords: count,\n currentPage: currentPage,\n nextPage: nextPage,\n prevPage: prevPage,\n totalPages: totalPages,\n perPage: +limit,\n },\n records: entities\n };\n return r\n }\n\n async find(basicFilterDto: BasicFilterDto) {\n return this.findMany(basicFilterDto);\n }\n\n async findOneByUserKey(name: string, relations = {}) {\n if (!name) {\n throw new BadRequestException(ERROR_MESSAGES.ENTITY_NAME_REQUIRED);\n }\n const entity = await this.moduleMetadataRepo.findOne({\n where: {\n name: name,\n },\n relations: relations,\n });\n return entity;\n }\n\n async findOne(id: number, relations = {}) {\n if (!id) {\n throw new BadRequestException(ERROR_MESSAGES.ENTITY_ID_REQUIRED);\n }\n const entity = await this.moduleMetadataRepo.findOne({\n where: {\n id: id,\n },\n relations: relations,\n });\n if (!entity) {\n throw new NotFoundException(ERROR_MESSAGES.ENTITY_NOT_FOUND());\n }\n return entity;\n }\n\n async create(createDto: CreateModuleMetadataDto, files: Express.Multer.File[] = []) {\n try {\n return await this.dataSource.transaction(async (manager: EntityManager) => {\n // Step 1: Write initial data to the database\n const module = await this.createInDB(manager, createDto, files);\n await this.createInFile(module);\n return module\n });\n } catch (error: any) {\n // console.error('Transaction failed:', error);\n this.logger.error('Transaction failed:', error);\n throw error;\n }\n }\n\n async createInDB(manager: EntityManager, createDto: CreateModuleMetadataDto, files: Express.Multer.File[] = []) {\n if (files.length > 0) {\n if (isDangerousMediaFile(files[0])) {\n throw new BadRequestException('Dangerous file types are not allowed for the menu icon.');\n }\n const fileStoragePath = this.getFullFilePathForDisk(this.getFileName(files[0]));\n this.fileService.copy(files[0].path, fileStoragePath);\n this.fileService.delete(files[0].path);\n createDto.menuIconUrl = fileStoragePath;\n }\n const moduleMetadata = this.moduleMetadataRepo.create(createDto);\n return manager.save(moduleMetadata); // Use the provided manager to perform DB operations\n }\n\n async createInFile(module: ModuleMetadata) {\n try {\n // Prepare the metadata JSON structure\n\n const moduleMetaDataJson: ModuleMetadataConfiguration = {\n moduleMetadata: {\n name: module?.name,\n displayName: module?.displayName,\n description: module?.description,\n defaultDataSource: module?.defaultDataSource,\n menuIconUrl: module?.menuIconUrl,\n menuSequenceNumber: module?.menuSequenceNumber,\n isSystem: module?.isSystem,\n models: [],\n },\n roles: [],\n users: [],\n actions: [\n {\n displayName: `${module?.name} Home`,\n name: `${module?.name}-home-action`,\n type: \"custom\",\n domain: \"\",\n context: \"\",\n customComponent: `/admin/core/${module?.name}/home`,\n customIsModal: true,\n serverEndpoint: \"\",\n viewUserKey: \"\",\n moduleUserKey: module?.name,\n modelUserKey: \"\"\n }\n ],\n menus: [\n {\n displayName: \"Home\",\n name: `${module?.name}-home-menu`,\n sequenceNumber: 1,\n actionUserKey: `${module?.name}-home-action`,\n moduleUserKey: module?.name,\n parentMenuItemUserKey: \"\",\n iconName: \"home\"\n }\n ],\n views: [],\n emailTemplates: [],\n smsTemplates: [],\n mediaStorageProviders: [],\n securityRules: [],\n };\n\n // Convert the object to JSON string\n const metadataJson = JSON.stringify(moduleMetaDataJson, null, 2);\n\n const filePath = await this.moduleMetadataHelperService.getModuleMetadataFilePath(module.name);\n const folderPath = path.dirname(filePath);\n\n // Ensure the folder exists\n await fs.mkdir(folderPath, { recursive: true });\n\n // Write the JSON to the file\n await fs.writeFile(filePath, metadataJson);\n\n } catch (error: any) {\n // console.error('File creation failed:', error);\n this.logger.error('File creation failed:', error);\n throw new Error(ERROR_MESSAGES.FILE_WRITE_FAILED); // Trigger rollback\n }\n }\n\n async update(id: number, updateModuleMetadataDto: UpdateModuleMetadataDto, files: Express.Multer.File[] = []) {\n try {\n return await this.dataSource.transaction(async (manager: EntityManager) => {\n // Step 1: Write initial data to the database\n const module = await this.updateInDB(manager, id, updateModuleMetadataDto, files);\n await this.updateInFile(module);\n return module\n });\n } catch (error: any) {\n // console.error('Transaction failed:', error);\n this.logger.error('Transaction failed:', error);\n throw error;\n }\n }\n\n async updateInDB(manager: EntityManager, id: number, updateModuleMetadataDto: UpdateModuleMetadataDto, files: Express.Multer.File[] = []) {\n\n const module = await this.moduleMetadataRepo.preload({\n id,\n ...updateModuleMetadataDto,\n });\n\n if (!module) {\n throw new NotFoundException(ERROR_MESSAGES.MODULE_ID_NOT_FOUND(id));\n }\n if (files.length > 0) {\n if (isDangerousMediaFile(files[0])) {\n throw new BadRequestException('Dangerous file types are not allowed for the menu icon.');\n }\n\n const fileStoragePath = this.getFullFilePathForDisk(this.getFileName(files[0]));\n this.fileService.copy(files[0].path, fileStoragePath);\n this.fileService.delete(files[0].path);\n module.menuIconUrl = fileStoragePath;\n }\n return manager.save(ModuleMetadata, module);\n }\n\n async updateInFile(module: ModuleMetadata) {\n try {\n const filePath = await this.moduleMetadataHelperService.getModuleMetadataFilePath(module.name);\n\n // Read the existing JSON file\n let metaData;\n try {\n metaData = await this.moduleMetadataHelperService.getModuleMetadataConfiguration(filePath);\n\n } catch (error: any) {\n metaData = {\n moduleMetadata: {\n name: null,\n displayName: null,\n description: null,\n defaultDataSource: null,\n menuIconUrl: null,\n menuSequenceNumber: null,\n isSystem: null,\n models: [],\n },\n roles: [],\n users: [],\n actions: [],\n menus: [],\n views: [],\n emailTemplates: [],\n smsTemplates: [],\n mediaStorageProviders: [],\n };\n }\n\n metaData.moduleMetadata.name = module?.name;\n metaData.moduleMetadata.displayName = module?.displayName;\n metaData.moduleMetadata.description = module?.description;\n metaData.moduleMetadata.defaultDataSource = module?.defaultDataSource;\n metaData.moduleMetadata.menuIconUrl = module?.menuIconUrl;\n metaData.moduleMetadata.menuSequenceNumber = module?.menuSequenceNumber;\n metaData.moduleMetadata.isSystem = module?.isSystem;\n\n // Write the JSON to the file\n const updatedContent = JSON.stringify(metaData, null, 2);\n await fs.writeFile(filePath, updatedContent);\n\n } catch (error: any) {\n // console.error('File creation failed:', error);\n this.logger.error('File creation failed:', error);\n throw new Error(ERROR_MESSAGES.FILE_WRITE_FAILED); // Trigger rollback\n }\n }\n\n async upsert(updateModuleMetadataDto: UpdateModuleMetadataDto) {\n this.logger.debug(`Module Upsert called for : ${updateModuleMetadataDto.name}`);\n // First check if module already exists using name\n const existingModuleMetadata = await this.moduleMetadataRepo.findOne({\n where: {\n name: updateModuleMetadataDto.name\n }\n })\n const { models, ...restUpdateModuleMetadataDto } = updateModuleMetadataDto;\n // if found\n if (existingModuleMetadata) {\n const updatedModuleMetadata = { ...existingModuleMetadata, ...restUpdateModuleMetadataDto };\n return this.moduleMetadataRepo.save(updatedModuleMetadata);\n }\n // if not found - create new \n else {\n const moduleMetadata = this.moduleMetadataRepo.create(restUpdateModuleMetadataDto);\n return this.moduleMetadataRepo.save(moduleMetadata);\n }\n }\n\n async removeByName(name: string) {\n const entity = await this.findOneByUserKey(name);\n if (entity) {\n await this.moduleMetadataRepo.remove(entity);\n }\n }\n\n @DisallowInProduction()\n async remove(id: number) {\n const entity = await this.findOne(id);\n await this.cleanupOnDelete(entity.id);\n const r = await this.moduleMetadataRepo.remove(entity);\n return r\n }\n\n async cleanupOnDelete(moduleEntityId: number) {\n const moduleEntity = await this.moduleMetadataRepo.findOne({\n where: {\n // @ts-ignore\n id: moduleEntityId,\n }\n });\n\n if (!moduleEntity) {\n this.logger.log(`Invalid moduleEntityId: ${moduleEntityId} unable to resolve model metadata`);\n return;\n }\n if (moduleEntity.id !== moduleEntityId) {\n this.logger.log(`Invalid moduleEntityId: ${moduleEntityId} unable to resolve model metadata id ${moduleEntity.id} not matching with the one passed as argument ${moduleEntityId}`);\n return;\n }\n\n this.logger.log(`Cleaning up for module: ${moduleEntity.name}.`);\n\n const modulePath = await this.moduleMetadataHelperService.getModulePath(moduleEntity.name);\n const solidUiModulePath = await this.moduleMetadataHelperService.getSolidUiModulePath(moduleEntity.name);\n if (modulePath) {\n\n this.logger.log(`Module path: ${modulePath}`);\n this.logger.log(`Solid UI module path: ${solidUiModulePath}`);\n\n // Metadata file to be deleted\n const moduleMetadataPAth = await this.moduleMetadataHelperService.getModuleMetadataFolderPath(moduleEntity.name)\n this.logger.log(`About to delete module metadata path: ${moduleMetadataPAth}`);\n\n try {\n await fs.rm(modulePath, { recursive: true, force: true });\n if (solidUiModulePath) {\n await fs.rm(solidUiModulePath, { recursive: true, force: true });\n this.logger.log(`Deleted solid-ui module path: ${solidUiModulePath}`);\n }\n await fs.rm(moduleMetadataPAth, { recursive: true, force: true });\n this.logger.log(`Deleted file: ${moduleMetadataPAth}`);\n } catch (error: any) {\n this.logger.error(`Error deleting file: ${moduleMetadataPAth}`, error);\n throw new Error(ERROR_MESSAGES.FILE_DELETE_FAILED); // Trigger rollback\n }\n }\n await this.cleanupAssociatedMenusAndActions(moduleEntity.id);\n }\n\n private async cleanupAssociatedMenusAndActions(moduleId: number) {\n const actionRepo = this.dataSource.getRepository(ActionMetadata);\n const menuRepo = this.dataSource.getRepository(MenuItemMetadata);\n\n const actions = await actionRepo.find({\n where: {\n module: { id: moduleId },\n },\n });\n const actionIds = actions.map((action) => action.id);\n\n const menus = await this.findMenusForModuleCleanup(moduleId, actionIds);\n if (menus.length > 0) {\n const menuIds = menus.map((menu) => menu.id).filter(Boolean);\n for (const menu of menus) {\n if (menu.roles?.length) {\n await this.dataSource\n .createQueryBuilder()\n .relation(MenuItemMetadata, 'roles')\n .of(menu.id)\n .remove(menu.roles.map((role) => role.id));\n }\n }\n\n if (menuIds.length > 0) {\n await menuRepo\n .createQueryBuilder()\n .update(MenuItemMetadata)\n .set({ parentMenuItem: null as any })\n .where('id IN (:...menuIds)', { menuIds })\n .execute();\n\n await menuRepo\n .createQueryBuilder()\n .delete()\n .from(MenuItemMetadata)\n .where('id IN (:...menuIds)', { menuIds })\n .execute();\n }\n\n this.logger.log(`Deleted ${menus.length} menu metadata record(s) for module id ${moduleId}`);\n }\n\n if (actions.length > 0) {\n await actionRepo.remove(actions);\n this.logger.log(`Deleted ${actions.length} action metadata record(s) for module id ${moduleId}`);\n }\n }\n\n private async findMenusForModuleCleanup(moduleId: number, actionIds: number[]) {\n const menuRepo = this.dataSource.getRepository(MenuItemMetadata);\n const menusById = new Map<number, MenuItemMetadata>();\n\n const rootMenus = await menuRepo.find({\n where: [\n {\n module: { id: moduleId },\n },\n ...(actionIds.length > 0\n ? [\n {\n action: { id: In(actionIds) },\n },\n ]\n : []),\n ],\n relations: ['roles', 'action', 'parentMenuItem'],\n });\n\n rootMenus.forEach((menu) => menusById.set(menu.id, menu));\n\n let parentIds = rootMenus.map((menu) => menu.id);\n while (parentIds.length > 0) {\n const childMenus = await menuRepo.find({\n where: {\n parentMenuItem: { id: In(parentIds) },\n },\n relations: ['roles', 'action', 'parentMenuItem'],\n });\n\n const nextParentIds: number[] = [];\n for (const childMenu of childMenus) {\n if (!menusById.has(childMenu.id)) {\n menusById.set(childMenu.id, childMenu);\n nextParentIds.push(childMenu.id);\n }\n }\n\n parentIds = nextParentIds;\n }\n\n return Array.from(menusById.values());\n }\n\n async deleteMany(ids: number[]): Promise<any> {\n if (!ids || ids.length === 0) {\n throw new Error(ERROR_MESSAGES.DELETE_IDS_REQUIRED);\n }\n const removedEntities = [];\n for (let i = 0; i < ids.length; i++) {\n const id = ids[i]\n const entity = await this.moduleMetadataRepo.findOne({\n where: {\n //@ts-ignore\n id: id,\n }\n });\n if (!entity) {\n this.logger.warn(`Module metadata with id ${id} not found. Skipping deleteMany cleanup for this id.`);\n continue;\n }\n\n await this.cleanupOnDelete(entity.id);\n removedEntities.push(await this.moduleMetadataRepo.remove(entity));\n }\n\n return removedEntities\n }\n\n async refreshPermission() {\n await this.permissionsSeederService.seed();\n return true\n }\n\n @DisallowInProduction()\n async seedModuleFromMetadata(moduleId: number) {\n const module = await this.findOne(moduleId);\n const seeder = this.solidRegistry\n .getSeeders()\n .filter((registeredSeeder) => registeredSeeder.name === 'ModuleMetadataSeederService')\n .map((registeredSeeder) => registeredSeeder.instance)\n .pop();\n\n if (!seeder || typeof seeder.seed !== 'function') {\n throw new NotFoundException('ModuleMetadataSeederService not found. Cannot seed module metadata.');\n }\n\n await seeder.seed({\n modulesToSeed: [module.name],\n seedGlobalMetadata: false,\n });\n\n return {\n success: true,\n moduleName: module.name,\n message: `Seeded metadata for module ${module.name}.`,\n };\n }\n\n @DisallowInProduction()\n async generateCodeViaCtl(moduleId: number): Promise<string> {\n const module = await this.findOne(moduleId);\n return this.commandService.executeCommandWithArgs({\n command: 'npx',\n args: ['@solidxai/solidctl@latest', 'generate', 'module', `--name=${module.name}`],\n cwd: path.join(process.cwd(), '..'),\n });\n }\n\n @DisallowInProduction()\n async generateCode(options: CodeGenerationOptions): Promise<string> {\n if (!options.moduleId && !options.moduleUserKey) {\n throw new BadRequestException(ERROR_MESSAGES.MODEL_REQUIRED_FOR_CODE_GENERATION);\n }\n const module = options.moduleId ? await this.findOne(options.moduleId) : await this.findOneByUserKey(options.moduleUserKey);\n\n // Check if the module exists\n if (!module) {\n throw new NotFoundException(ERROR_MESSAGES.MODULE_ID_NOT_FOUND(options.moduleId));\n }\n\n // Check if the module name already exists and is loaded\n const moduleInstance = this.solidRegistry.getModule(`${classify(module.name)}Module`);\n\n if (!moduleInstance) {\n const addModuleOutput = await this.generateAddModuleCode(options);\n const refreshModuleOutput = await this.generateRefreshModuleCode(options);\n return `${addModuleOutput}\\n${refreshModuleOutput}`;\n } else {\n return await this.generateRefreshModuleCode(options);\n }\n }\n\n private async generateAddModuleCode(options: CodeGenerationOptions = { dryRun: false }): Promise<string> {\n if (!options.moduleId && !options.moduleUserKey) {\n throw new BadRequestException(ERROR_MESSAGES.MODEL_REQUIRED_FOR_CODE_GENERATION);\n }\n const module = options.moduleId ? await this.findOne(options.moduleId) : await this.findOneByUserKey(options.moduleUserKey);\n\n //Generate the module\n const output = await this.schematicService.executeSchematicCommand(\n ADD_MODULE_COMMAND,\n { module: module.name },\n options.dryRun ?? false\n );\n this.logger.debug(`Schematic output : ${output}`);\n return output;\n }\n\n private async generateRefreshModuleCode(options: CodeGenerationOptions): Promise<string> {\n const query = {\n relations: { models: { fields: true } },\n };\n const module = options.moduleId ? await this.findOne(options.moduleId, query.relations) : await this.findOneByUserKey(options.moduleUserKey, query.relations);\n const outputLines = []\n for (const model of module.models) {\n const codeGenerationOptions = {\n modelId: model.id,\n dryRun: options.dryRun,\n };\n const output = await this.modelMetadataService.handleGenerateCode(codeGenerationOptions);\n this.logger.debug(`Schematic output : ${output}`);\n outputLines.push(output)\n }\n return outputLines.join('\\n');\n }\n\n private getFullFilePathForDisk(fileName: string): string {\n const base = this.settingService.getConfigValue<SolidCoreSetting>(\"fileStorageDir\")\n || DEFAULT_MEDIA_FILE_STORAGE_DIR;\n if (path.isAbsolute(fileName) || fileName.startsWith(`${base}/`)) {\n return fileName;\n }\n return `${base}/${fileName}`;\n }\n\n private getFileName(file: Express.Multer.File): string {\n // originalname is attacker-controlled and feeds straight into a storage path.\n return `${file.filename}-${sanitizeStoredMediaFileName(file.originalname)}`;\n }\n\n}\n"]}
1
+ {"version":3,"file":"module-metadata.service.js","sourceRoot":"","sources":["../../src/services/module-metadata.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAAgH;AAChH,6CAAmD;AACnD,oGAAyG;AAEzG,qCAA4E;AAC5E,+EAAoE;AAEpE,qFAAyE;AACzE,+EAAoE;AAEpE,4DAAoD;AAEpD,gDAAkC;AAClC,2CAA6B;AAC7B,gEAA8D;AAC9D,oEAAsE;AACtE,qGAAuF;AACvF,8FAAyF;AACzF,yFAAqF;AACrF,sGAAiG;AACjG,iCAAoD;AACpD,+DAA+E;AAG/E,oEAGsC;AACtC,gEAA4D;AAC5D,8DAA0D;AAE1D,+DAA0D;AAC1D,qEAAgE;AAChE,uDAAmD;AAG5C,IAAM,qBAAqB,6BAA3B,MAAM,qBAAqB;IAGhC,YAEE,UAAuC,EAGtB,kBAA4C,EAC5C,iBAAoC,EACpC,gBAAkC,EAClC,cAA8B,EAC9B,WAA4B,EAC5B,cAA8B,EAE9B,wBAAyD,EAE1E,oBAA2D,EAC1C,aAA4B,EAC5B,2BAAwD;QAdxD,eAAU,GAAV,UAAU,CAAY;QAGtB,uBAAkB,GAAlB,kBAAkB,CAA0B;QAC5C,sBAAiB,GAAjB,iBAAiB,CAAmB;QACpC,qBAAgB,GAAhB,gBAAgB,CAAkB;QAClC,mBAAc,GAAd,cAAc,CAAgB;QAC9B,gBAAW,GAAX,WAAW,CAAiB;QAC5B,mBAAc,GAAd,cAAc,CAAgB;QAE9B,6BAAwB,GAAxB,wBAAwB,CAAiC;QAEzD,yBAAoB,GAApB,oBAAoB,CAAsB;QAC1C,kBAAa,GAAb,aAAa,CAAe;QAC5B,gCAA2B,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A,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,6CAAoB,CAAC,CAAC,CAAA;qCAXlB,oBAAU;QAGF,qDAAwB;QACzB,uCAAiB;QAClB,oCAAgB;QAClB,gCAAc;QACjB,sBAAe;QACZ,gCAAc;QAEJ,oEAA+B;QAEnC,6CAAoB;QAC3B,8BAAa;QACC,4DAA2B;GAnBhE,qBAAqB,CA2kBjC","sourcesContent":["import { BadRequestException, forwardRef, Inject, Injectable, Logger, NotFoundException } from '@nestjs/common';\nimport { InjectDataSource } from '@nestjs/typeorm';\nimport { DEFAULT_MEDIA_FILE_STORAGE_DIR } from \"src/services/settings/default-settings-provider.service\";\nimport type { SolidCoreSetting } from \"src/services/settings/default-settings-provider.service\";\nimport { DataSource, EntityManager, In, SelectQueryBuilder } from 'typeorm';\nimport { ActionMetadata } from '../entities/action-metadata.entity';\nimport { CreateModuleMetadataDto } from '../dtos/create-module-metadata.dto';\nimport { MenuItemMetadata } from '../entities/menu-item-metadata.entity';\nimport { ModuleMetadata } from '../entities/module-metadata.entity';\n\nimport { classify } from '../helpers/string.helper';\nimport { ConfigService } from '@nestjs/config';\nimport * as fs from 'fs/promises'; // Use the Promise-based version of fs for async/await\nimport * as path from 'path'; // To handle file paths\nimport { ERROR_MESSAGES } from 'src/constants/error-messages';\nimport { isDangerousMediaFile } from 'src/constants/media-file-types';\nimport { DisallowInProduction } from 'src/decorators/disallow-in-production.decorator';\nimport { ModuleMetadataHelperService } from 'src/helpers/module-metadata-helper.service';\nimport { ModuleMetadataRepository } from 'src/repository/module-metadata.repository';\nimport { PermissionMetadataSeederService } from 'src/seeders/permission-metadata-seeder.service';\nimport { DiskFileService } from 'src/services/file';\nimport { sanitizeStoredMediaFileName } from 'src/services/media-storage.utils';\nimport { BasicFilterDto } from '../dtos/basic-filters.dto';\nimport { UpdateModuleMetadataDto } from '../dtos/update-module-metadata.dto';\nimport {\n ADD_MODULE_COMMAND,\n SchematicService,\n} from '../helpers/schematic.service';\nimport { CommandService } from '../helpers/command.service';\nimport { SolidRegistry } from '../helpers/solid-registry';\nimport { CodeGenerationOptions, ModuleMetadataConfiguration } from '../interfaces';\nimport { CrudHelperService } from './crud-helper.service';\nimport { ModelMetadataService } from './model-metadata.service';\nimport { SettingService } from './setting.service';\n\n@Injectable()\nexport class ModuleMetadataService {\n private readonly logger = new Logger(ModuleMetadataService.name);\n\n constructor(\n @InjectDataSource()\n private readonly dataSource: DataSource,\n // @InjectRepository(ModuleMetadata)\n // private readonly moduleMetadataRepo: Repository<ModuleMetadata>,\n private readonly moduleMetadataRepo: ModuleMetadataRepository,\n private readonly crudHelperService: CrudHelperService,\n private readonly schematicService: SchematicService,\n private readonly commandService: CommandService,\n private readonly fileService: DiskFileService,\n private readonly settingService: SettingService,\n\n private readonly permissionsSeederService: PermissionMetadataSeederService,\n @Inject(forwardRef(() => ModelMetadataService))\n private readonly modelMetadataService: ModelMetadataService,\n private readonly solidRegistry: SolidRegistry,\n private readonly moduleMetadataHelperService: ModuleMetadataHelperService,\n ) { }\n\n async findMany(basicFilterDto: BasicFilterDto) {\n const alias = 'moduleMetadata';\n // Extract the required keys from the input query\n let { limit, offset } = basicFilterDto;\n\n // Create above query on pincode table using query builder\n var qb: SelectQueryBuilder<ModuleMetadata> = await this.moduleMetadataRepo.createSecurityRuleAwareQueryBuilder(alias)\n qb = await this.crudHelperService.buildFilterQuery(qb, basicFilterDto, alias);\n\n // Get the records and the count\n const [entities, count] = await qb.getManyAndCount();\n\n const currentPage = Math.floor(offset / limit) + 1;\n const totalPages = Math.ceil(count / limit);\n\n const nextPage = currentPage < totalPages ? currentPage + 1 : null;\n const prevPage = currentPage > 1 ? currentPage - 1 : null;\n\n const r = {\n meta: {\n totalRecords: count,\n currentPage: currentPage,\n nextPage: nextPage,\n prevPage: prevPage,\n totalPages: totalPages,\n perPage: +limit,\n },\n records: entities\n };\n return r\n }\n\n async find(basicFilterDto: BasicFilterDto) {\n return this.findMany(basicFilterDto);\n }\n\n async findOneByUserKey(name: string, relations = {}) {\n if (!name) {\n throw new BadRequestException(ERROR_MESSAGES.ENTITY_NAME_REQUIRED);\n }\n const entity = await this.moduleMetadataRepo.findOne({\n where: {\n name: name,\n },\n relations: relations,\n });\n return entity;\n }\n\n async findOne(id: number, relations = {}) {\n if (!id) {\n throw new BadRequestException(ERROR_MESSAGES.ENTITY_ID_REQUIRED);\n }\n const entity = await this.moduleMetadataRepo.findOne({\n where: {\n id: id,\n },\n relations: relations,\n });\n if (!entity) {\n throw new NotFoundException(ERROR_MESSAGES.ENTITY_NOT_FOUND());\n }\n return entity;\n }\n\n async create(createDto: CreateModuleMetadataDto, files: Express.Multer.File[] = []) {\n try {\n return await this.dataSource.transaction(async (manager: EntityManager) => {\n // Step 1: Write initial data to the database\n const module = await this.createInDB(manager, createDto, files);\n await this.createInFile(module);\n return module\n });\n } catch (error: any) {\n // console.error('Transaction failed:', error);\n this.logger.error('Transaction failed:', error);\n throw error;\n }\n }\n\n async createInDB(manager: EntityManager, createDto: CreateModuleMetadataDto, files: Express.Multer.File[] = []) {\n if (files.length > 0) {\n if (isDangerousMediaFile(files[0])) {\n throw new BadRequestException('Dangerous file types are not allowed for the menu icon.');\n }\n const fileStoragePath = this.getFullFilePathForDisk(this.getFileName(files[0]));\n await this.fileService.copy(files[0].path, fileStoragePath);\n await this.fileService.delete(files[0].path);\n createDto.menuIconUrl = fileStoragePath;\n }\n const moduleMetadata = this.moduleMetadataRepo.create(createDto);\n return manager.save(moduleMetadata); // Use the provided manager to perform DB operations\n }\n\n async createInFile(module: ModuleMetadata) {\n try {\n // Prepare the metadata JSON structure\n\n const moduleMetaDataJson: ModuleMetadataConfiguration = {\n moduleMetadata: {\n name: module?.name,\n displayName: module?.displayName,\n description: module?.description,\n defaultDataSource: module?.defaultDataSource,\n menuIconUrl: module?.menuIconUrl,\n menuSequenceNumber: module?.menuSequenceNumber,\n isSystem: module?.isSystem,\n models: [],\n },\n roles: [],\n users: [],\n actions: [\n {\n displayName: `${module?.name} Home`,\n name: `${module?.name}-home-action`,\n type: \"custom\",\n domain: \"\",\n context: \"\",\n customComponent: `/admin/core/${module?.name}/home`,\n customIsModal: true,\n serverEndpoint: \"\",\n viewUserKey: \"\",\n moduleUserKey: module?.name,\n modelUserKey: \"\"\n }\n ],\n menus: [\n {\n displayName: \"Home\",\n name: `${module?.name}-home-menu`,\n sequenceNumber: 1,\n actionUserKey: `${module?.name}-home-action`,\n moduleUserKey: module?.name,\n parentMenuItemUserKey: \"\",\n iconName: \"home\"\n }\n ],\n views: [],\n emailTemplates: [],\n smsTemplates: [],\n mediaStorageProviders: [],\n securityRules: [],\n };\n\n // Convert the object to JSON string\n const metadataJson = JSON.stringify(moduleMetaDataJson, null, 2);\n\n const filePath = await this.moduleMetadataHelperService.getModuleMetadataFilePath(module.name);\n const folderPath = path.dirname(filePath);\n\n // Ensure the folder exists\n await fs.mkdir(folderPath, { recursive: true });\n\n // Write the JSON to the file\n await fs.writeFile(filePath, metadataJson);\n\n } catch (error: any) {\n // console.error('File creation failed:', error);\n this.logger.error('File creation failed:', error);\n throw new Error(ERROR_MESSAGES.FILE_WRITE_FAILED); // Trigger rollback\n }\n }\n\n async update(id: number, updateModuleMetadataDto: UpdateModuleMetadataDto, files: Express.Multer.File[] = []) {\n try {\n return await this.dataSource.transaction(async (manager: EntityManager) => {\n // Step 1: Write initial data to the database\n const module = await this.updateInDB(manager, id, updateModuleMetadataDto, files);\n await this.updateInFile(module);\n return module\n });\n } catch (error: any) {\n // console.error('Transaction failed:', error);\n this.logger.error('Transaction failed:', error);\n throw error;\n }\n }\n\n async updateInDB(manager: EntityManager, id: number, updateModuleMetadataDto: UpdateModuleMetadataDto, files: Express.Multer.File[] = []) {\n\n const module = await this.moduleMetadataRepo.preload({\n id,\n ...updateModuleMetadataDto,\n });\n\n if (!module) {\n throw new NotFoundException(ERROR_MESSAGES.MODULE_ID_NOT_FOUND(id));\n }\n if (files.length > 0) {\n if (isDangerousMediaFile(files[0])) {\n throw new BadRequestException('Dangerous file types are not allowed for the menu icon.');\n }\n\n const fileStoragePath = this.getFullFilePathForDisk(this.getFileName(files[0]));\n await this.fileService.copy(files[0].path, fileStoragePath);\n await this.fileService.delete(files[0].path);\n module.menuIconUrl = fileStoragePath;\n }\n return manager.save(ModuleMetadata, module);\n }\n\n async updateInFile(module: ModuleMetadata) {\n try {\n const filePath = await this.moduleMetadataHelperService.getModuleMetadataFilePath(module.name);\n\n // Read the existing JSON file\n let metaData;\n try {\n metaData = await this.moduleMetadataHelperService.getModuleMetadataConfiguration(filePath);\n\n } catch (error: any) {\n metaData = {\n moduleMetadata: {\n name: null,\n displayName: null,\n description: null,\n defaultDataSource: null,\n menuIconUrl: null,\n menuSequenceNumber: null,\n isSystem: null,\n models: [],\n },\n roles: [],\n users: [],\n actions: [],\n menus: [],\n views: [],\n emailTemplates: [],\n smsTemplates: [],\n mediaStorageProviders: [],\n };\n }\n\n metaData.moduleMetadata.name = module?.name;\n metaData.moduleMetadata.displayName = module?.displayName;\n metaData.moduleMetadata.description = module?.description;\n metaData.moduleMetadata.defaultDataSource = module?.defaultDataSource;\n metaData.moduleMetadata.menuIconUrl = module?.menuIconUrl;\n metaData.moduleMetadata.menuSequenceNumber = module?.menuSequenceNumber;\n metaData.moduleMetadata.isSystem = module?.isSystem;\n\n // Write the JSON to the file\n const updatedContent = JSON.stringify(metaData, null, 2);\n await fs.writeFile(filePath, updatedContent);\n\n } catch (error: any) {\n // console.error('File creation failed:', error);\n this.logger.error('File creation failed:', error);\n throw new Error(ERROR_MESSAGES.FILE_WRITE_FAILED); // Trigger rollback\n }\n }\n\n async upsert(updateModuleMetadataDto: UpdateModuleMetadataDto) {\n this.logger.debug(`Module Upsert called for : ${updateModuleMetadataDto.name}`);\n // First check if module already exists using name\n const existingModuleMetadata = await this.moduleMetadataRepo.findOne({\n where: {\n name: updateModuleMetadataDto.name\n }\n })\n const { models, ...restUpdateModuleMetadataDto } = updateModuleMetadataDto;\n // if found\n if (existingModuleMetadata) {\n const updatedModuleMetadata = { ...existingModuleMetadata, ...restUpdateModuleMetadataDto };\n return this.moduleMetadataRepo.save(updatedModuleMetadata);\n }\n // if not found - create new \n else {\n const moduleMetadata = this.moduleMetadataRepo.create(restUpdateModuleMetadataDto);\n return this.moduleMetadataRepo.save(moduleMetadata);\n }\n }\n\n async removeByName(name: string) {\n const entity = await this.findOneByUserKey(name);\n if (entity) {\n await this.moduleMetadataRepo.remove(entity);\n }\n }\n\n @DisallowInProduction()\n async remove(id: number) {\n const entity = await this.findOne(id);\n await this.cleanupOnDelete(entity.id);\n const r = await this.moduleMetadataRepo.remove(entity);\n return r\n }\n\n async cleanupOnDelete(moduleEntityId: number) {\n const moduleEntity = await this.moduleMetadataRepo.findOne({\n where: {\n // @ts-ignore\n id: moduleEntityId,\n }\n });\n\n if (!moduleEntity) {\n this.logger.log(`Invalid moduleEntityId: ${moduleEntityId} unable to resolve model metadata`);\n return;\n }\n if (moduleEntity.id !== moduleEntityId) {\n this.logger.log(`Invalid moduleEntityId: ${moduleEntityId} unable to resolve model metadata id ${moduleEntity.id} not matching with the one passed as argument ${moduleEntityId}`);\n return;\n }\n\n this.logger.log(`Cleaning up for module: ${moduleEntity.name}.`);\n\n const modulePath = await this.moduleMetadataHelperService.getModulePath(moduleEntity.name);\n const solidUiModulePath = await this.moduleMetadataHelperService.getSolidUiModulePath(moduleEntity.name);\n if (modulePath) {\n\n this.logger.log(`Module path: ${modulePath}`);\n this.logger.log(`Solid UI module path: ${solidUiModulePath}`);\n\n // Metadata file to be deleted\n const moduleMetadataPAth = await this.moduleMetadataHelperService.getModuleMetadataFolderPath(moduleEntity.name)\n this.logger.log(`About to delete module metadata path: ${moduleMetadataPAth}`);\n\n try {\n await fs.rm(modulePath, { recursive: true, force: true });\n if (solidUiModulePath) {\n await fs.rm(solidUiModulePath, { recursive: true, force: true });\n this.logger.log(`Deleted solid-ui module path: ${solidUiModulePath}`);\n }\n await fs.rm(moduleMetadataPAth, { recursive: true, force: true });\n this.logger.log(`Deleted file: ${moduleMetadataPAth}`);\n } catch (error: any) {\n this.logger.error(`Error deleting file: ${moduleMetadataPAth}`, error);\n throw new Error(ERROR_MESSAGES.FILE_DELETE_FAILED); // Trigger rollback\n }\n }\n await this.cleanupAssociatedMenusAndActions(moduleEntity.id);\n }\n\n private async cleanupAssociatedMenusAndActions(moduleId: number) {\n const actionRepo = this.dataSource.getRepository(ActionMetadata);\n const menuRepo = this.dataSource.getRepository(MenuItemMetadata);\n\n const actions = await actionRepo.find({\n where: {\n module: { id: moduleId },\n },\n });\n const actionIds = actions.map((action) => action.id);\n\n const menus = await this.findMenusForModuleCleanup(moduleId, actionIds);\n if (menus.length > 0) {\n const menuIds = menus.map((menu) => menu.id).filter(Boolean);\n for (const menu of menus) {\n if (menu.roles?.length) {\n await this.dataSource\n .createQueryBuilder()\n .relation(MenuItemMetadata, 'roles')\n .of(menu.id)\n .remove(menu.roles.map((role) => role.id));\n }\n }\n\n if (menuIds.length > 0) {\n await menuRepo\n .createQueryBuilder()\n .update(MenuItemMetadata)\n .set({ parentMenuItem: null as any })\n .where('id IN (:...menuIds)', { menuIds })\n .execute();\n\n await menuRepo\n .createQueryBuilder()\n .delete()\n .from(MenuItemMetadata)\n .where('id IN (:...menuIds)', { menuIds })\n .execute();\n }\n\n this.logger.log(`Deleted ${menus.length} menu metadata record(s) for module id ${moduleId}`);\n }\n\n if (actions.length > 0) {\n await actionRepo.remove(actions);\n this.logger.log(`Deleted ${actions.length} action metadata record(s) for module id ${moduleId}`);\n }\n }\n\n private async findMenusForModuleCleanup(moduleId: number, actionIds: number[]) {\n const menuRepo = this.dataSource.getRepository(MenuItemMetadata);\n const menusById = new Map<number, MenuItemMetadata>();\n\n const rootMenus = await menuRepo.find({\n where: [\n {\n module: { id: moduleId },\n },\n ...(actionIds.length > 0\n ? [\n {\n action: { id: In(actionIds) },\n },\n ]\n : []),\n ],\n relations: ['roles', 'action', 'parentMenuItem'],\n });\n\n rootMenus.forEach((menu) => menusById.set(menu.id, menu));\n\n let parentIds = rootMenus.map((menu) => menu.id);\n while (parentIds.length > 0) {\n const childMenus = await menuRepo.find({\n where: {\n parentMenuItem: { id: In(parentIds) },\n },\n relations: ['roles', 'action', 'parentMenuItem'],\n });\n\n const nextParentIds: number[] = [];\n for (const childMenu of childMenus) {\n if (!menusById.has(childMenu.id)) {\n menusById.set(childMenu.id, childMenu);\n nextParentIds.push(childMenu.id);\n }\n }\n\n parentIds = nextParentIds;\n }\n\n return Array.from(menusById.values());\n }\n\n async deleteMany(ids: number[]): Promise<any> {\n if (!ids || ids.length === 0) {\n throw new Error(ERROR_MESSAGES.DELETE_IDS_REQUIRED);\n }\n const removedEntities = [];\n for (let i = 0; i < ids.length; i++) {\n const id = ids[i]\n const entity = await this.moduleMetadataRepo.findOne({\n where: {\n //@ts-ignore\n id: id,\n }\n });\n if (!entity) {\n this.logger.warn(`Module metadata with id ${id} not found. Skipping deleteMany cleanup for this id.`);\n continue;\n }\n\n await this.cleanupOnDelete(entity.id);\n removedEntities.push(await this.moduleMetadataRepo.remove(entity));\n }\n\n return removedEntities\n }\n\n async refreshPermission() {\n await this.permissionsSeederService.seed();\n return true\n }\n\n @DisallowInProduction()\n async seedModuleFromMetadata(moduleId: number) {\n const module = await this.findOne(moduleId);\n const seeder = this.solidRegistry\n .getSeeders()\n .filter((registeredSeeder) => registeredSeeder.name === 'ModuleMetadataSeederService')\n .map((registeredSeeder) => registeredSeeder.instance)\n .pop();\n\n if (!seeder || typeof seeder.seed !== 'function') {\n throw new NotFoundException('ModuleMetadataSeederService not found. Cannot seed module metadata.');\n }\n\n await seeder.seed({\n modulesToSeed: [module.name],\n seedGlobalMetadata: false,\n });\n\n return {\n success: true,\n moduleName: module.name,\n message: `Seeded metadata for module ${module.name}.`,\n };\n }\n\n @DisallowInProduction()\n async generateCodeViaCtl(moduleId: number): Promise<string> {\n const module = await this.findOne(moduleId);\n return this.commandService.executeCommandWithArgs({\n command: 'npx',\n args: ['@solidxai/solidctl@latest', 'generate', 'module', `--name=${module.name}`],\n cwd: path.join(process.cwd(), '..'),\n });\n }\n\n @DisallowInProduction()\n async generateCode(options: CodeGenerationOptions): Promise<string> {\n if (!options.moduleId && !options.moduleUserKey) {\n throw new BadRequestException(ERROR_MESSAGES.MODEL_REQUIRED_FOR_CODE_GENERATION);\n }\n const module = options.moduleId ? await this.findOne(options.moduleId) : await this.findOneByUserKey(options.moduleUserKey);\n\n // Check if the module exists\n if (!module) {\n throw new NotFoundException(ERROR_MESSAGES.MODULE_ID_NOT_FOUND(options.moduleId));\n }\n\n // Check if the module name already exists and is loaded\n const moduleInstance = this.solidRegistry.getModule(`${classify(module.name)}Module`);\n\n if (!moduleInstance) {\n const addModuleOutput = await this.generateAddModuleCode(options);\n const refreshModuleOutput = await this.generateRefreshModuleCode(options);\n return `${addModuleOutput}\\n${refreshModuleOutput}`;\n } else {\n return await this.generateRefreshModuleCode(options);\n }\n }\n\n private async generateAddModuleCode(options: CodeGenerationOptions = { dryRun: false }): Promise<string> {\n if (!options.moduleId && !options.moduleUserKey) {\n throw new BadRequestException(ERROR_MESSAGES.MODEL_REQUIRED_FOR_CODE_GENERATION);\n }\n const module = options.moduleId ? await this.findOne(options.moduleId) : await this.findOneByUserKey(options.moduleUserKey);\n\n //Generate the module\n const output = await this.schematicService.executeSchematicCommand(\n ADD_MODULE_COMMAND,\n { module: module.name },\n options.dryRun ?? false\n );\n this.logger.debug(`Schematic output : ${output}`);\n return output;\n }\n\n private async generateRefreshModuleCode(options: CodeGenerationOptions): Promise<string> {\n const query = {\n relations: { models: { fields: true } },\n };\n const module = options.moduleId ? await this.findOne(options.moduleId, query.relations) : await this.findOneByUserKey(options.moduleUserKey, query.relations);\n const outputLines = []\n for (const model of module.models) {\n const codeGenerationOptions = {\n modelId: model.id,\n dryRun: options.dryRun,\n };\n const output = await this.modelMetadataService.handleGenerateCode(codeGenerationOptions);\n this.logger.debug(`Schematic output : ${output}`);\n outputLines.push(output)\n }\n return outputLines.join('\\n');\n }\n\n private getFullFilePathForDisk(fileName: string): string {\n const base = this.settingService.getConfigValue<SolidCoreSetting>(\"fileStorageDir\")\n || DEFAULT_MEDIA_FILE_STORAGE_DIR;\n if (path.isAbsolute(fileName) || fileName.startsWith(`${base}/`)) {\n return fileName;\n }\n return `${base}/${fileName}`;\n }\n\n private getFileName(file: Express.Multer.File): string {\n // originalname is attacker-controlled and feeds straight into a storage path.\n return `${file.filename}-${sanitizeStoredMediaFileName(file.originalname)}`;\n }\n\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solidxai/core",
3
- "version": "0.1.16-beta.0",
3
+ "version": "0.1.16-beta.1",
4
4
  "description": "This module is a NestJS module containing all the required core providers required by a Solid application",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -12,7 +12,8 @@
12
12
  "solidCore": "dist/cli.js"
13
13
  },
14
14
  "scripts": {
15
- "build": "nest build && tsc-alias",
15
+ "build": "nest build && tsc-alias && npm run copy-resources",
16
+ "copy-resources": "copyfiles -u 1 \"resources/**/*\" dist/resources",
16
17
  "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
17
18
  "start": "nest start",
18
19
  "start:dev": "nest start --watch",
@@ -149,6 +150,7 @@
149
150
  "@types/qs": "^6.9.15",
150
151
  "@types/supertest": "^2.0.12",
151
152
  "@types/uuid": "^9.0.8",
153
+ "copyfiles": "^2.4.1",
152
154
  "@typescript-eslint/eslint-plugin": "^6.0.0",
153
155
  "@typescript-eslint/parser": "^6.0.0",
154
156
  "eslint": "^8.42.0",
@@ -4,7 +4,7 @@
4
4
  "displayName": "Solid Core",
5
5
  "description": "Solid Core Module",
6
6
  "defaultDataSource": "default",
7
- "menuIconUrl": null,
7
+ "menuIconUrl": "media-files-storage/solid-core-menu-icon.png",
8
8
  "menuSequenceNumber": 1,
9
9
  "isSystem": true,
10
10
  "models": [
@@ -142,8 +142,8 @@ export class ModuleMetadataService {
142
142
  throw new BadRequestException('Dangerous file types are not allowed for the menu icon.');
143
143
  }
144
144
  const fileStoragePath = this.getFullFilePathForDisk(this.getFileName(files[0]));
145
- this.fileService.copy(files[0].path, fileStoragePath);
146
- this.fileService.delete(files[0].path);
145
+ await this.fileService.copy(files[0].path, fileStoragePath);
146
+ await this.fileService.delete(files[0].path);
147
147
  createDto.menuIconUrl = fileStoragePath;
148
148
  }
149
149
  const moduleMetadata = this.moduleMetadataRepo.create(createDto);
@@ -250,8 +250,8 @@ export class ModuleMetadataService {
250
250
  }
251
251
 
252
252
  const fileStoragePath = this.getFullFilePathForDisk(this.getFileName(files[0]));
253
- this.fileService.copy(files[0].path, fileStoragePath);
254
- this.fileService.delete(files[0].path);
253
+ await this.fileService.copy(files[0].path, fileStoragePath);
254
+ await this.fileService.delete(files[0].path);
255
255
  module.menuIconUrl = fileStoragePath;
256
256
  }
257
257
  return manager.save(ModuleMetadata, module);