@solidxai/core 0.1.18-beta.0 → 0.1.19-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1353 -0
- package/CLAUDE.md +26 -0
- package/dist/commands/seed.command.d.ts +2 -0
- package/dist/commands/seed.command.d.ts.map +1 -1
- package/dist/commands/seed.command.js +10 -2
- package/dist/commands/seed.command.js.map +1 -1
- package/dist/constants/error-messages.d.ts +2 -0
- package/dist/constants/error-messages.d.ts.map +1 -1
- package/dist/constants/error-messages.js +2 -0
- package/dist/constants/error-messages.js.map +1 -1
- package/dist/decorators/login-extension-provider.decorator.d.ts +3 -0
- package/dist/decorators/login-extension-provider.decorator.d.ts.map +1 -0
- package/dist/decorators/login-extension-provider.decorator.js +8 -0
- package/dist/decorators/login-extension-provider.decorator.js.map +1 -0
- package/dist/helpers/bootstrap.helper.d.ts +1 -0
- package/dist/helpers/bootstrap.helper.d.ts.map +1 -1
- package/dist/helpers/bootstrap.helper.js +7 -6
- package/dist/helpers/bootstrap.helper.js.map +1 -1
- package/dist/helpers/solid-core-error-codes-provider.service.d.ts.map +1 -1
- package/dist/helpers/solid-core-error-codes-provider.service.js +18 -0
- package/dist/helpers/solid-core-error-codes-provider.service.js.map +1 -1
- package/dist/helpers/solid-registry.d.ts +5 -1
- package/dist/helpers/solid-registry.d.ts.map +1 -1
- package/dist/helpers/solid-registry.js +16 -0
- package/dist/helpers/solid-registry.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/interfaces.d.ts +24 -0
- package/dist/interfaces.d.ts.map +1 -1
- package/dist/interfaces.js +6 -1
- package/dist/interfaces.js.map +1 -1
- package/dist/seeders/seed-data/solid-core-metadata.json +1 -0
- package/dist/services/authentication.service.d.ts +11 -1
- package/dist/services/authentication.service.d.ts.map +1 -1
- package/dist/services/authentication.service.js +70 -4
- package/dist/services/authentication.service.js.map +1 -1
- package/dist/services/dashboard-providers/mq-dashboard-recent-failures-provider.service.d.ts +21 -1
- package/dist/services/dashboard-providers/mq-dashboard-recent-failures-provider.service.d.ts.map +1 -1
- package/dist/services/dashboard-providers/mq-dashboard-recent-failures-provider.service.js +10 -10
- package/dist/services/dashboard-providers/mq-dashboard-recent-failures-provider.service.js.map +1 -1
- package/dist/services/solid-introspect.service.d.ts +1 -0
- package/dist/services/solid-introspect.service.d.ts.map +1 -1
- package/dist/services/solid-introspect.service.js +11 -0
- package/dist/services/solid-introspect.service.js.map +1 -1
- package/package.json +1 -1
- package/src/commands/seed.command.ts +7 -2
- package/src/constants/error-messages.ts +2 -0
- package/src/decorators/login-extension-provider.decorator.ts +6 -0
- package/src/helpers/bootstrap.helper.ts +31 -8
- package/src/helpers/solid-core-error-codes-provider.service.ts +21 -0
- package/src/helpers/solid-registry.ts +19 -1
- package/src/index.ts +1 -0
- package/src/interfaces.ts +93 -0
- package/src/seeders/seed-data/solid-core-metadata.json +1 -0
- package/src/services/authentication.service.ts +135 -3
- package/src/services/dashboard-providers/mq-dashboard-recent-failures-provider.service.ts +31 -13
- package/src/services/solid-introspect.service.ts +13 -0
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# This is the SolidX API project.
|
|
2
|
+
This is included as a dependency in consuming projects.
|
|
3
|
+
|
|
4
|
+
# SolidX UI
|
|
5
|
+
# The corresponding UI project is at the below path:
|
|
6
|
+
/Users/oswald/projects/Solid_Starters/solid-core-ui
|
|
7
|
+
|
|
8
|
+
# SolidX Docs
|
|
9
|
+
# The documentation project is at the below path:
|
|
10
|
+
/Users/oswald/projects/solidxai-docs
|
|
11
|
+
|
|
12
|
+
# SolidX Agent
|
|
13
|
+
# The agent project which has the skills for helping users configure, build and use SolidX is at the below path:
|
|
14
|
+
/Users/oswald/projects/Solid_Starters/agent
|
|
15
|
+
|
|
16
|
+
# SolidX Control Plane Commands
|
|
17
|
+
# The control plane commands for managing SolidX instances are in the below path:
|
|
18
|
+
/Users/oswald/projects/Solid_Starters/solidctl
|
|
19
|
+
|
|
20
|
+
# Testing reference project
|
|
21
|
+
# This is the reference library management project that is used for testing and development of SolidX features. It is located at the below path:
|
|
22
|
+
/Users/oswald/projects/Solid_Starters/solid-library-management
|
|
23
|
+
|
|
24
|
+
# Code Builder project
|
|
25
|
+
# This is the project that contains the code builder which generates code based on user input and templates. It is located at the below path:
|
|
26
|
+
/Users/oswald/projects/Solid_Starters/solid-code-builder
|
|
@@ -5,6 +5,7 @@ interface SeedCommandOptions {
|
|
|
5
5
|
modulesToSeed?: string;
|
|
6
6
|
prune?: boolean;
|
|
7
7
|
skipHooks?: boolean;
|
|
8
|
+
verbose?: boolean;
|
|
8
9
|
}
|
|
9
10
|
export declare class SeedCommand extends CommandRunner {
|
|
10
11
|
private readonly solidRegistry;
|
|
@@ -15,6 +16,7 @@ export declare class SeedCommand extends CommandRunner {
|
|
|
15
16
|
parseString(val: string): string;
|
|
16
17
|
parsePrune(): boolean;
|
|
17
18
|
parseSkipHooks(): boolean;
|
|
19
|
+
parseVerbose(): boolean;
|
|
18
20
|
}
|
|
19
21
|
export {};
|
|
20
22
|
//# sourceMappingURL=seed.command.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seed.command.d.ts","sourceRoot":"","sources":["../../src/commands/seed.command.ts"],"names":[],"mappings":"AACA,OAAO,EAAW,aAAa,EAAU,MAAM,gBAAgB,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAG3D,UAAU,kBAAkB;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"seed.command.d.ts","sourceRoot":"","sources":["../../src/commands/seed.command.ts"],"names":[],"mappings":"AACA,OAAO,EAAW,aAAa,EAAU,MAAM,gBAAgB,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAG3D,UAAU,kBAAkB;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,qBACa,WAAY,SAAQ,aAAa;IAGhC,OAAO,CAAC,QAAQ,CAAC,aAAa;IAF1C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAgC;gBAE1B,aAAa,EAAE,aAAa;IAInD,GAAG,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IAwD7E,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAKvC,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAKhC,UAAU,IAAI,OAAO;IAKrB,cAAc,IAAI,OAAO;IAKzB,YAAY,IAAI,OAAO;CAGxB"}
|
|
@@ -63,8 +63,7 @@ let SeedCommand = SeedCommand_1 = class SeedCommand extends nest_commander_1.Com
|
|
|
63
63
|
.map((seeder) => seeder.instance)
|
|
64
64
|
.pop();
|
|
65
65
|
if (!seeder) {
|
|
66
|
-
|
|
67
|
-
return;
|
|
66
|
+
throw new Error(`Seeder service ${options.seeder} not found. Does your service have a seed() method?`);
|
|
68
67
|
}
|
|
69
68
|
this.logger.log(`Running the seed() method for seeder: ${seeder.constructor.name}`);
|
|
70
69
|
await seeder.seed(parsedConf);
|
|
@@ -81,6 +80,9 @@ let SeedCommand = SeedCommand_1 = class SeedCommand extends nest_commander_1.Com
|
|
|
81
80
|
parseSkipHooks() {
|
|
82
81
|
return true;
|
|
83
82
|
}
|
|
83
|
+
parseVerbose() {
|
|
84
|
+
return true;
|
|
85
|
+
}
|
|
84
86
|
};
|
|
85
87
|
exports.SeedCommand = SeedCommand;
|
|
86
88
|
__decorate([
|
|
@@ -107,6 +109,12 @@ __decorate([
|
|
|
107
109
|
__metadata("design:paramtypes", []),
|
|
108
110
|
__metadata("design:returntype", Boolean)
|
|
109
111
|
], SeedCommand.prototype, "parseSkipHooks", null);
|
|
112
|
+
__decorate([
|
|
113
|
+
(0, nest_commander_1.Option)({ flags: '-v, --verbose', description: 'Show detailed Nest/Winston logs during seeding.' }),
|
|
114
|
+
__metadata("design:type", Function),
|
|
115
|
+
__metadata("design:paramtypes", []),
|
|
116
|
+
__metadata("design:returntype", Boolean)
|
|
117
|
+
], SeedCommand.prototype, "parseVerbose", null);
|
|
110
118
|
exports.SeedCommand = SeedCommand = SeedCommand_1 = __decorate([
|
|
111
119
|
(0, nest_commander_1.Command)({ name: 'seed', description: 'Install seed data for a given module' }),
|
|
112
120
|
__metadata("design:paramtypes", [solid_registry_1.SolidRegistry])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seed.command.js","sourceRoot":"","sources":["../../src/commands/seed.command.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAwC;AACxC,mDAAgE;AAChE,8DAA2D;
|
|
1
|
+
{"version":3,"file":"seed.command.js","sourceRoot":"","sources":["../../src/commands/seed.command.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAwC;AACxC,mDAAgE;AAChE,8DAA2D;AAYpD,IAAM,WAAW,mBAAjB,MAAM,WAAY,SAAQ,8BAAa;IAG5C,YAA6B,aAA4B;QACvD,KAAK,EAAE,CAAC;QADmB,kBAAa,GAAb,aAAa,CAAe;QAFxC,WAAM,GAAG,IAAI,eAAM,CAAC,aAAW,CAAC,IAAI,CAAC,CAAC;IAIvD,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,WAAqB,EAAE,OAA4B;QAC3D,IAAI,UAAU,GAAuC,IAAI,CAAC;QAC1D,IAAI,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AAe,EAAE,WAAW,EAAE,iDAAiD,EAAE,CAAC;;;;+CAGlG;sBArFU,WAAW;IADvB,IAAA,wBAAO,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,sCAAsC,EAAE,CAAC;qCAIjC,8BAAa;GAH9C,WAAW,CAsFvB","sourcesContent":["import { Logger } from '@nestjs/common';\nimport { Command, CommandRunner, Option } from 'nest-commander';\nimport { SolidRegistry } from 'src/helpers/solid-registry';\nimport { ModuleMetadataSeederOptions } from 'src/interfaces';\n\ninterface SeedCommandOptions {\n seeder?: string;\n modulesToSeed?: string;\n prune?: boolean;\n skipHooks?: boolean;\n verbose?: boolean;\n}\n\n@Command({ name: 'seed', description: 'Install seed data for a given module' })\nexport class SeedCommand extends CommandRunner {\n private readonly logger = new Logger(SeedCommand.name);\n\n constructor(private readonly solidRegistry: SolidRegistry) {\n super();\n }\n\n async run(passedParam: string[], options?: SeedCommandOptions): Promise<void> {\n let parsedConf: ModuleMetadataSeederOptions | null = null;\n if (options?.modulesToSeed) {\n const modulesToSeed = options.modulesToSeed\n .split(',')\n .map((m) => m.trim())\n .filter(Boolean);\n parsedConf = {\n modulesToSeed,\n pruneMetadata: false,\n seedGlobalMetadata: true,\n skipHooks: false,\n };\n this.logger.log(`Modules to seed: ${modulesToSeed.join(', ')}`);\n } else {\n this.logger.log('No --modules-to-seed flag provided. Running with default seeder behavior.');\n }\n\n if (options?.prune) {\n parsedConf = parsedConf ?? {\n modulesToSeed: null,\n pruneMetadata: false,\n seedGlobalMetadata: true,\n skipHooks: false,\n };\n parsedConf.pruneMetadata = true;\n }\n\n if (options?.skipHooks) {\n parsedConf = parsedConf ?? {\n modulesToSeed: null,\n pruneMetadata: false,\n seedGlobalMetadata: true,\n skipHooks: false,\n };\n parsedConf.skipHooks = true;\n this.logger.log('Skipping pre-seed and post-seed hooks.');\n }\n\n const seeder = this.solidRegistry\n .getSeeders()\n .filter((seeder) => seeder.name === options.seeder)\n .map((seeder) => seeder.instance)\n .pop();\n if (!seeder) {\n throw new Error(`Seeder service ${options.seeder} not found. Does your service have a seed() method?`);\n }\n this.logger.log(`Running the seed() method for seeder: ${seeder.constructor.name}`);\n await seeder.seed(parsedConf);\n }\n\n /**\n * This parameter will be useful, to support seeders with the same name in different modules\n * Currently the seeder service won't support seeder with same classname within a module\n **/\n @Option({ flags: '-m, --modules-to-seed [module names]', description: 'Comma-separated list of module names to seed.', required: false })\n parseModulesToSeed(val: string): string {\n return val;\n }\n\n @Option({ flags: '-s, --seeder [seeder name]', description: 'The seeder to run.', required: true, defaultValue: 'ModuleMetadataSeederService' })\n parseString(val: string): string {\n return val;\n }\n\n @Option({ flags: '--prune', description: 'Prune metadata not present in JSON.' })\n parsePrune(): boolean {\n return true;\n }\n\n @Option({ flags: '--skip-hooks', description: 'Skip emitting pre-seed and post-seed lifecycle hooks/events.' })\n parseSkipHooks(): boolean {\n return true;\n }\n\n @Option({ flags: '-v, --verbose', description: 'Show detailed Nest/Winston logs during seeding.' })\n parseVerbose(): boolean {\n return true;\n }\n}\n"]}
|
|
@@ -29,6 +29,8 @@ export declare const ERROR_MESSAGES: {
|
|
|
29
29
|
LOGOUT_FAILED: string;
|
|
30
30
|
INVALID_CREDENTIALS: string;
|
|
31
31
|
LOGIN_FAILED: string;
|
|
32
|
+
LOGIN_DENIED_BY_EXTENSION: string;
|
|
33
|
+
LOGIN_EXTENSION_UNAVAILABLE: string;
|
|
32
34
|
OLD_PASSWORD_INCORRECT: string;
|
|
33
35
|
INVALID_NEW_PASSWORD: string;
|
|
34
36
|
PASSWORDS_DO_NOT_MATCH: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-messages.d.ts","sourceRoot":"","sources":["../../src/constants/error-messages.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"error-messages.d.ts","sourceRoot":"","sources":["../../src/constants/error-messages.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BA2CE,MAAM,EAAE;2CACM,MAAM;+BAClB,MAAM;uCACE,MAAM;;;;;;;;;;;;;;;;;6BAiChB,MAAM;;;;0BAOT,MAAM,GAAG,MAAM;mCACN,MAAM;;;;;;mCASN,MAAM,GAAG,MAAM;qCACb,MAAM;yDACc,MAAM;qCAC1B,MAAM;;mCAIR,MAAM;8BACX,MAAM,GAAG,MAAM;gCAGb,MAAM,GAAG,MAAM;;;kCAKb,MAAM,GAAG,MAAM;qCACZ,MAAM;8CAGG,MAAM,GAAG,MAAM;;yCAIpB,MAAM;;;;;;;;;;;;yBA0BtC,MAAM,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;CAElD,CAAC"}
|
|
@@ -32,6 +32,8 @@ exports.ERROR_MESSAGES = {
|
|
|
32
32
|
LOGOUT_FAILED: 'Logout failed due to an unexpected error.',
|
|
33
33
|
INVALID_CREDENTIALS: 'Invalid credentials',
|
|
34
34
|
LOGIN_FAILED: 'Login Failed',
|
|
35
|
+
LOGIN_DENIED_BY_EXTENSION: 'Login was denied by an external verification check.',
|
|
36
|
+
LOGIN_EXTENSION_UNAVAILABLE: 'An external verification check is temporarily unavailable. Please try again.',
|
|
35
37
|
OLD_PASSWORD_INCORRECT: 'You have specified an incorrect old password.',
|
|
36
38
|
INVALID_NEW_PASSWORD: 'Invalid new password.',
|
|
37
39
|
PASSWORDS_DO_NOT_MATCH: 'New passwords are not matching.',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-messages.js","sourceRoot":"","sources":["../../src/constants/error-messages.ts"],"names":[],"mappings":";;;AAEa,QAAA,cAAc,GAAG;IAE1B,cAAc,EAAE,sBAAsB;IACtC,eAAe,EAAE,gCAAgC;IACjD,aAAa,EAAE,mBAAmB;IAClC,eAAe,EAAE,sEAAsE;IACvF,kBAAkB,EAAE,0BAA0B;IAC9C,4BAA4B,EAAE,o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yDAAyD;IAG7F,gBAAgB,EAAE,CAAC,UAAkB,EAAE,EAAE,CAAC,oBAAoB,UAAU,aAAa;IACrF,mBAAmB,EAAE,CAAC,EAAmB,EAAE,EAAE,CAAC,kBAAkB,EAAE,aAAa;IAG/E,gBAAgB,EAAE,CAAC,MAAwB,EAAE,EAAE,CAAC,SAAS,MAAM,CAAC,CAAC,CAAC,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,aAAa;IAChG,oBAAoB,EAAE,6CAA6C;IACnE,kBAAkB,EAAE,2CAA2C;IAG/D,uBAAuB,EAAE,CAAC,EAAmB,EAAE,EAAE,CAAC,wDAAwD,EAAE,GAAG;IAC/G,yBAAyB,EAAE,CAAC,GAAW,EAAE,EAAE,CAAC,iCAAiC,GAAG,EAAE;IAGlF,mCAAmC,EAAE,CAAC,EAAmB,EAAE,EAAE,CAAC,gCAAgC,EAAE,aAAa;IAC7G,gCAAgC,EAAE,kCAAkC;IAGpE,wBAAwB,EAAE,CAAC,QAAgB,EAAE,EAAE,CAAC,6BAA6B,QAAQ,EAAE;IAGvF,gCAAgC,EAAE,gEAAgE;IAClG,+BAA+B,EAAE,iFAAiF;IAClH,6BAA6B,EAAE,uCAAuC;IAEtE,4CAA4C,EAAE,wBAAwB;IAQtE,YAAY,EAAE,eAAe;IAC7B,WAAW,EAAE,qEAAqE;IAClF,YAAY,EAAE,0EAA0E;IACxF,gBAAgB,EAAE,8BAA8B;IAChD,mBAAmB,EAAE,yCAAyC;IAC9D,oBAAoB,EAAE,iEAAiE;IACvF,yBAAyB,EAAE,mCAAmC;IAE9D,mBAAmB,EAAE;QACrB,UAAU,EAAE,CAAC,KAAc,EAAE,EAAE,CAC7B,wCAAwC,KAAK,IAAI,OAAO,WAAW;KACtB;CAElD,CAAC","sourcesContent":["// backend/common/constants/error-messages.ts\n\nexport const ERROR_MESSAGES = {\n //authentication errors\n USER_NOT_FOUND: 'User does not exist.',\n USER_NOT_ACTIVE: 'User profile is not activated.',\n USER_INACTIVE: 'User is inactive.',\n ACCOUNT_BLOCKED: 'Your account has been blocked due to multiple failed login attempts.',\n PASSWORD_INCORRECT: 'Password does not match.',\n PUBLIC_REGISTRATION_DISABLED: 'Public registrations are disabled.',\n UNIQUE_CONSTRAINT_VIOLATION: 'A unique constraint violation occurred.',\n PASSWORDLESS_REGISTRATION_DISABLED: 'Passwordless registration is not enabled.',\n REGISTRATION_REQUIRES_CONTACT: 'Either mobile or email is required for initiating registration.',\n EMAIL_REQUIRED_FOR_VALIDATION: 'Email is required for email validation source.',\n MOBILE_REQUIRED_FOR_VALIDATION: 'Mobile is required for mobile validation source.',\n USER_ALREADY_EXISTS: 'User already exists. Please sign in.',\n VALIDATION_SOURCE_REQUIRED: 'At least one validation source is required.',\n INVALID_OTP: 'Invalid OTP.',\n OTP_EXPIRED: 'OTP has expired.',\n INVALID_VERIFICATION_TYPE: 'Invalid type. Must be either email or mobile.',\n NON_LOCAL_PROVIDER: 'User seems to have used a passwordless mode to authenticate.',\n USER_ID_MISMATCH: \"User ID's do not match.\",\n USERNAME_MISMATCH: \"User username's do not match.\",\n INCORRECT_CURRENT_PASSWORD: 'Incorrect current password specified.',\n PASSWORD_REUSED: 'Try a different password',\n INVALID_VERIFICATION_TOKEN: 'Invalid verification token',\n INVALID_REFRESH_TOKEN: 'Invalid refresh token',\n ACCESS_DENIED: 'Access denied',\n INVALID_USER_PROFILE: 'Invalid user profile',\n GOOGLE_OAUTH_PROFILE_FETCH_FAILED: 'Failed to fetch user profile from Google OAuth service',\n MICROSOFT_ACTIVE_DIRECTORY_OAUTH_PROFILE_FETCH_FAILED: 'Failed to fetch user profile from Microsoft Active Directory OAuth service',\n LOGOUT_FAILED: 'Logout failed due to an unexpected error.',\n\n INVALID_CREDENTIALS: 'Invalid credentials',\n LOGIN_FAILED: 'Login Failed',\n OLD_PASSWORD_INCORRECT: 'You have specified an incorrect old password.',\n INVALID_NEW_PASSWORD: 'Invalid new password.',\n PASSWORDS_DO_NOT_MATCH: 'New passwords are not matching.',\n\n // user management errors\n DELETE_SELF_NOT_ALLOWED: 'Deleting logged-in user is not allowed.',\n DELETE_IDS_REQUIRED: 'At least one ID is required for deletion.',\n USER_MISSING_ID: 'User must exist before initializing roles.',\n ROLES_NOT_FOUND: (roles: string[]) => `The following roles were not found: ${roles.join(', ')}`,\n USER_NOT_FOUND_BY_USERNAME: (username: string) => `User with username '${username}' not found.`,\n ROLE_NOT_FOUND: (roleName: string) => `Role '${roleName}' not found.`,\n PERMISSION_NOT_EXIST: (permission: string) => `Permission '${permission}' does not exist.`,\n\n // session errors\n SESSION_INVALID: 'Your session is no longer valid. Please log in again.',\n SESSION_EXPIRED: 'Your session has expired. Please log in again.',\n\n // filter errors\n GROUP_BY_LIMIT: 'buildFilterQuery: Only 1 Group by field is supported currently.',\n INVALID_GROUP_BY_COUNT: 'Exactly one groupBy field is required to count grouped records.',\n\n // general errors\n FORBIDDEN: 'Forbidden',\n RESOURCE_NOT_FOUND: 'The requested resource was not found.',\n\n\n // database errors\n DUPLICATE_ENTRY: 'Duplicate entry. A record with similar unique fields already exists.',\n\n // validation errors\n ID_REQUIRED_FOR_UPDATE: 'Id is required for update.',\n ID_REQUIRED_FOR_DELETE: 'Id is required for deletion.',\n\n // CRUD service errors\n RELATION_TYPE_NOT_SUPPORTED: 'Relation type not supported in CRUD service.',\n NO_SOFT_DELETED_RECORD_FOUND: 'No soft-deleted record found with the given ID.',\n CONFLICTING_RECORD_ON_UNARCHIVE: 'Another record is conflicting with the record you are attempting to Un-Archive, either delete or change the other record so as to avoid this conflict.',\n NO_SOFT_DELETED_RECORDS_FOUND: 'No matching soft-deleted records found.',\n EMPTY_PATH_PARTS: 'Path parts cannot be empty',\n\n\n // CSV/Excel service errors\n MISSING_HEADERS_OR_FUNCTION: 'Either headers or data records function must be provided.',\n INVALID_CHUNK_SIZE: 'Chunk size must be greater than 0 when data records function is provided.',\n INVALID_FORMAT: (format: string) => `Invalid ${format} format`,\n\n\n //field errors\n INVALID_INVERSE_FIELD_TYPE: 'Only relation fields can have inverse fields.',\n MODEL_AND_MODULE_REQUIRED_TO_UPDATE_INVERSE_FIELD: 'Model and module are required to update inverse field.',\n MODEL_NAME_AND_MODULE_NAME_REQUIRED_TO_CREATE_INVERSE_FIELD: 'Model name and module name are required to create inverse field.',\n FIELD_NOT_FOUND: (id: number | string) => `No field with id #${id} exists`,\n PROVIDER_NOT_FOUND: (provider: string) => `Field incorrectly configured. No provider with name ${provider} registered in backend.`,\n FILE_WRITE_FAILED: 'File creation failed, rolling back transaction',\n FILE_DELETE_FAILED: 'File deletion failed, rolling back transaction',\n // file service errors\n FILE_NOT_FOUND: 'File not found',\n FILE_COPY_ERROR: 'Error copying file',\n S3_CLIENT_NOT_INITIALIZED: 'S3 Client not initialized. Please check the S3 configuration.',\n\n // model errors\n MODEL_METADATA_NOT_FOUND: (id: string | number) => `Model metadata with ID ${id} not found.`,\n MODEL_SERVICE_NOT_FOUND: (model: string) => `Model service for ${model} not found.`,\n RELATION_CO_MODEL_NOT_DEFINED_FOR_FIELD: (fieldName: string) => `Relation coModelSingularName is not defined for relation field ${fieldName}`,\n MODEL_NOT_FOUND: (singularName?: string) => `Model${singularName ? ` with singular name \"${singularName}\"` : ''} not found.`,\n MODEL_REQUIRED_FOR_CODE_GENERATION: 'Model ID or Model Name is required for generating code.',\n\n //module errors\n MODULE_NOT_FOUND: (moduleName: string) => `Module with name ${moduleName} not found.`,\n MODULE_ID_NOT_FOUND: (id: string | number) => `Module with ID ${id} not found.`,\n\n //entity errors\n ENTITY_NOT_FOUND: (entity?: string | number) => `Entity${entity ? ' ' + entity : ''} not found.`,\n ENTITY_NAME_REQUIRED: 'Entity name is required to find the entity.',\n ENTITY_ID_REQUIRED: 'Entity ID is required to find the entity.',\n\n // import errors\n NO_ERROR_LOG_FOR_IMPORT: (id: string | number) => `No error log entries found for import transaction ID ${id}.`,\n FILE_READ_FAILED_FROM_URL: (url: string) => `Failed to read file from URL: ${url}`,\n\n // media storage provider errors\n MEDIA_STORAGE_PROVIDER_ID_NOT_FOUND: (id: number | string) => `Media Storage Provider with #${id} not found.`,\n MEDIA_STORAGE_PROVIDER_NOT_FOUND: 'Media Storage Provider not found',\n\n // SQL errors\n UNSUPPORTED_SQL_OPERATOR: (operator: string) => `Unsupported SQL operator: ${operator}`,\n\n // AI interaction errors\n PYTHON_EXECUTABLE_NOT_CONFIGURED: 'SolidX AI MCP python executable or client path not configured.',\n UNABLE_TO_RESOLVE_SOLID_COMMAND: 'Unable to resolve a solid_ command that was used to come up with this response.',\n UNABLE_TO_RESOLVE_MCP_HANDLER: 'Unable to resolve a mcp tool handler.',\n\n DEFAULT_REGEX_PATTERN_NOT_MATCHING_ERROR_MSG: 'Invalid regex pattern.',\n\n // MPIN errors.\n // MPIN_INVALID is deliberately shared by \"wrong MPIN\" and \"unknown handle\",\n // so a failed sign-in never reveals whether the credential handle was real.\n // MPIN_REVOKED is separate and is returned for any attempt against a\n // deactivated credential - it discloses nothing useful, since a dead\n // credential grants no capability, and it lets the client stop retrying.\n MPIN_INVALID: 'Invalid MPIN.',\n MPIN_LOCKED: 'MPIN sign-in is temporarily locked due to repeated failed attempts.',\n MPIN_REVOKED: 'MPIN sign-in has been disabled for this device. Please sign in normally.',\n MPIN_NOT_ENABLED: 'MPIN sign-in is not enabled.',\n MPIN_FORMAT_INVALID: 'MPIN does not meet the required format.',\n MPIN_TOO_PREDICTABLE: 'MPIN is too easy to guess. Avoid repeated or sequential digits.',\n MPIN_CREDENTIAL_NOT_FOUND: 'MPIN device credential not found.',\n\n PERMISSION_MESSAGES: {\n insertMany: (model?: string) =>\n `You do not have permission to import ${model ?? 'these'} records.`,\n } as Record<string, (model?: string) => string>,\n\n};\n"]}
|
|
1
|
+
{"version":3,"file":"error-messages.js","sourceRoot":"","sources":["../../src/constants/error-messages.ts"],"names":[],"mappings":";;;AAEa,QAAA,cAAc,GAAG;IAE1B,cAAc,EAAE,sBAAsB;IACtC,eAAe,EAAE,gCAAgC;IACjD,aAAa,E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W;KACtB;CAElD,CAAC","sourcesContent":["// backend/common/constants/error-messages.ts\n\nexport const ERROR_MESSAGES = {\n //authentication errors\n USER_NOT_FOUND: 'User does not exist.',\n USER_NOT_ACTIVE: 'User profile is not activated.',\n USER_INACTIVE: 'User is inactive.',\n ACCOUNT_BLOCKED: 'Your account has been blocked due to multiple failed login attempts.',\n PASSWORD_INCORRECT: 'Password does not match.',\n PUBLIC_REGISTRATION_DISABLED: 'Public registrations are disabled.',\n UNIQUE_CONSTRAINT_VIOLATION: 'A unique constraint violation occurred.',\n PASSWORDLESS_REGISTRATION_DISABLED: 'Passwordless registration is not enabled.',\n REGISTRATION_REQUIRES_CONTACT: 'Either mobile or email is required for initiating registration.',\n EMAIL_REQUIRED_FOR_VALIDATION: 'Email is required for email validation source.',\n MOBILE_REQUIRED_FOR_VALIDATION: 'Mobile is required for mobile validation source.',\n USER_ALREADY_EXISTS: 'User already exists. Please sign in.',\n VALIDATION_SOURCE_REQUIRED: 'At least one validation source is required.',\n INVALID_OTP: 'Invalid OTP.',\n OTP_EXPIRED: 'OTP has expired.',\n INVALID_VERIFICATION_TYPE: 'Invalid type. Must be either email or mobile.',\n NON_LOCAL_PROVIDER: 'User seems to have used a passwordless mode to authenticate.',\n USER_ID_MISMATCH: \"User ID's do not match.\",\n USERNAME_MISMATCH: \"User username's do not match.\",\n INCORRECT_CURRENT_PASSWORD: 'Incorrect current password specified.',\n PASSWORD_REUSED: 'Try a different password',\n INVALID_VERIFICATION_TOKEN: 'Invalid verification token',\n INVALID_REFRESH_TOKEN: 'Invalid refresh token',\n ACCESS_DENIED: 'Access denied',\n INVALID_USER_PROFILE: 'Invalid user profile',\n GOOGLE_OAUTH_PROFILE_FETCH_FAILED: 'Failed to fetch user profile from Google OAuth service',\n MICROSOFT_ACTIVE_DIRECTORY_OAUTH_PROFILE_FETCH_FAILED: 'Failed to fetch user profile from Microsoft Active Directory OAuth service',\n LOGOUT_FAILED: 'Logout failed due to an unexpected error.',\n\n INVALID_CREDENTIALS: 'Invalid credentials',\n LOGIN_FAILED: 'Login Failed',\n LOGIN_DENIED_BY_EXTENSION: 'Login was denied by an external verification check.',\n LOGIN_EXTENSION_UNAVAILABLE: 'An external verification check is temporarily unavailable. Please try again.',\n OLD_PASSWORD_INCORRECT: 'You have specified an incorrect old password.',\n INVALID_NEW_PASSWORD: 'Invalid new password.',\n PASSWORDS_DO_NOT_MATCH: 'New passwords are not matching.',\n\n // user management errors\n DELETE_SELF_NOT_ALLOWED: 'Deleting logged-in user is not allowed.',\n DELETE_IDS_REQUIRED: 'At least one ID is required for deletion.',\n USER_MISSING_ID: 'User must exist before initializing roles.',\n ROLES_NOT_FOUND: (roles: string[]) => `The following roles were not found: ${roles.join(', ')}`,\n USER_NOT_FOUND_BY_USERNAME: (username: string) => `User with username '${username}' not found.`,\n ROLE_NOT_FOUND: (roleName: string) => `Role '${roleName}' not found.`,\n PERMISSION_NOT_EXIST: (permission: string) => `Permission '${permission}' does not exist.`,\n\n // session errors\n SESSION_INVALID: 'Your session is no longer valid. Please log in again.',\n SESSION_EXPIRED: 'Your session has expired. Please log in again.',\n\n // filter errors\n GROUP_BY_LIMIT: 'buildFilterQuery: Only 1 Group by field is supported currently.',\n INVALID_GROUP_BY_COUNT: 'Exactly one groupBy field is required to count grouped records.',\n\n // general errors\n FORBIDDEN: 'Forbidden',\n RESOURCE_NOT_FOUND: 'The requested resource was not found.',\n\n\n // database errors\n DUPLICATE_ENTRY: 'Duplicate entry. A record with similar unique fields already exists.',\n\n // validation errors\n ID_REQUIRED_FOR_UPDATE: 'Id is required for update.',\n ID_REQUIRED_FOR_DELETE: 'Id is required for deletion.',\n\n // CRUD service errors\n RELATION_TYPE_NOT_SUPPORTED: 'Relation type not supported in CRUD service.',\n NO_SOFT_DELETED_RECORD_FOUND: 'No soft-deleted record found with the given ID.',\n CONFLICTING_RECORD_ON_UNARCHIVE: 'Another record is conflicting with the record you are attempting to Un-Archive, either delete or change the other record so as to avoid this conflict.',\n NO_SOFT_DELETED_RECORDS_FOUND: 'No matching soft-deleted records found.',\n EMPTY_PATH_PARTS: 'Path parts cannot be empty',\n\n\n // CSV/Excel service errors\n MISSING_HEADERS_OR_FUNCTION: 'Either headers or data records function must be provided.',\n INVALID_CHUNK_SIZE: 'Chunk size must be greater than 0 when data records function is provided.',\n INVALID_FORMAT: (format: string) => `Invalid ${format} format`,\n\n\n //field errors\n INVALID_INVERSE_FIELD_TYPE: 'Only relation fields can have inverse fields.',\n MODEL_AND_MODULE_REQUIRED_TO_UPDATE_INVERSE_FIELD: 'Model and module are required to update inverse field.',\n MODEL_NAME_AND_MODULE_NAME_REQUIRED_TO_CREATE_INVERSE_FIELD: 'Model name and module name are required to create inverse field.',\n FIELD_NOT_FOUND: (id: number | string) => `No field with id #${id} exists`,\n PROVIDER_NOT_FOUND: (provider: string) => `Field incorrectly configured. No provider with name ${provider} registered in backend.`,\n FILE_WRITE_FAILED: 'File creation failed, rolling back transaction',\n FILE_DELETE_FAILED: 'File deletion failed, rolling back transaction',\n // file service errors\n FILE_NOT_FOUND: 'File not found',\n FILE_COPY_ERROR: 'Error copying file',\n S3_CLIENT_NOT_INITIALIZED: 'S3 Client not initialized. Please check the S3 configuration.',\n\n // model errors\n MODEL_METADATA_NOT_FOUND: (id: string | number) => `Model metadata with ID ${id} not found.`,\n MODEL_SERVICE_NOT_FOUND: (model: string) => `Model service for ${model} not found.`,\n RELATION_CO_MODEL_NOT_DEFINED_FOR_FIELD: (fieldName: string) => `Relation coModelSingularName is not defined for relation field ${fieldName}`,\n MODEL_NOT_FOUND: (singularName?: string) => `Model${singularName ? ` with singular name \"${singularName}\"` : ''} not found.`,\n MODEL_REQUIRED_FOR_CODE_GENERATION: 'Model ID or Model Name is required for generating code.',\n\n //module errors\n MODULE_NOT_FOUND: (moduleName: string) => `Module with name ${moduleName} not found.`,\n MODULE_ID_NOT_FOUND: (id: string | number) => `Module with ID ${id} not found.`,\n\n //entity errors\n ENTITY_NOT_FOUND: (entity?: string | number) => `Entity${entity ? ' ' + entity : ''} not found.`,\n ENTITY_NAME_REQUIRED: 'Entity name is required to find the entity.',\n ENTITY_ID_REQUIRED: 'Entity ID is required to find the entity.',\n\n // import errors\n NO_ERROR_LOG_FOR_IMPORT: (id: string | number) => `No error log entries found for import transaction ID ${id}.`,\n FILE_READ_FAILED_FROM_URL: (url: string) => `Failed to read file from URL: ${url}`,\n\n // media storage provider errors\n MEDIA_STORAGE_PROVIDER_ID_NOT_FOUND: (id: number | string) => `Media Storage Provider with #${id} not found.`,\n MEDIA_STORAGE_PROVIDER_NOT_FOUND: 'Media Storage Provider not found',\n\n // SQL errors\n UNSUPPORTED_SQL_OPERATOR: (operator: string) => `Unsupported SQL operator: ${operator}`,\n\n // AI interaction errors\n PYTHON_EXECUTABLE_NOT_CONFIGURED: 'SolidX AI MCP python executable or client path not configured.',\n UNABLE_TO_RESOLVE_SOLID_COMMAND: 'Unable to resolve a solid_ command that was used to come up with this response.',\n UNABLE_TO_RESOLVE_MCP_HANDLER: 'Unable to resolve a mcp tool handler.',\n\n DEFAULT_REGEX_PATTERN_NOT_MATCHING_ERROR_MSG: 'Invalid regex pattern.',\n\n // MPIN errors.\n // MPIN_INVALID is deliberately shared by \"wrong MPIN\" and \"unknown handle\",\n // so a failed sign-in never reveals whether the credential handle was real.\n // MPIN_REVOKED is separate and is returned for any attempt against a\n // deactivated credential - it discloses nothing useful, since a dead\n // credential grants no capability, and it lets the client stop retrying.\n MPIN_INVALID: 'Invalid MPIN.',\n MPIN_LOCKED: 'MPIN sign-in is temporarily locked due to repeated failed attempts.',\n MPIN_REVOKED: 'MPIN sign-in has been disabled for this device. Please sign in normally.',\n MPIN_NOT_ENABLED: 'MPIN sign-in is not enabled.',\n MPIN_FORMAT_INVALID: 'MPIN does not meet the required format.',\n MPIN_TOO_PREDICTABLE: 'MPIN is too easy to guess. Avoid repeated or sequential digits.',\n MPIN_CREDENTIAL_NOT_FOUND: 'MPIN device credential not found.',\n\n PERMISSION_MESSAGES: {\n insertMany: (model?: string) =>\n `You do not have permission to import ${model ?? 'these'} records.`,\n } as Record<string, (model?: string) => string>,\n\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"login-extension-provider.decorator.d.ts","sourceRoot":"","sources":["../../src/decorators/login-extension-provider.decorator.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,2BAA2B,gCAAgC,CAAC;AAEzE,eAAO,MAAM,sBAAsB,wDACa,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LoginExtensionProvider = exports.IS_LOGIN_EXTENSION_PROVIDER = void 0;
|
|
4
|
+
const common_1 = require("@nestjs/common");
|
|
5
|
+
exports.IS_LOGIN_EXTENSION_PROVIDER = "IS_LOGIN_EXTENSION_PROVIDER";
|
|
6
|
+
const LoginExtensionProvider = () => (0, common_1.SetMetadata)(exports.IS_LOGIN_EXTENSION_PROVIDER, true);
|
|
7
|
+
exports.LoginExtensionProvider = LoginExtensionProvider;
|
|
8
|
+
//# sourceMappingURL=login-extension-provider.decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"login-extension-provider.decorator.js","sourceRoot":"","sources":["../../src/decorators/login-extension-provider.decorator.ts"],"names":[],"mappings":";;;AAAA,2CAA6C;AAEhC,QAAA,2BAA2B,GAAG,6BAA6B,CAAC;AAElE,MAAM,sBAAsB,GAAG,GAAG,EAAE,CACzC,IAAA,oBAAW,EAAC,mCAA2B,EAAE,IAAI,CAAC,CAAC;AADpC,QAAA,sBAAsB,0BACc","sourcesContent":["import { SetMetadata } from \"@nestjs/common\";\n\nexport const IS_LOGIN_EXTENSION_PROVIDER = \"IS_LOGIN_EXTENSION_PROVIDER\";\n\nexport const LoginExtensionProvider = () =>\n SetMetadata(IS_LOGIN_EXTENSION_PROVIDER, true);\n"]}
|
|
@@ -12,6 +12,7 @@ export interface SolidBootstrapOptions {
|
|
|
12
12
|
security?: SolidSecurityOptions;
|
|
13
13
|
verboseBootstrap?: boolean;
|
|
14
14
|
bodyLimit?: string;
|
|
15
|
+
captureRawBody?: boolean;
|
|
15
16
|
}
|
|
16
17
|
export declare function bootstrapSolidApp(appModuleFactory: () => Promise<any>, options?: SolidBootstrapOptions): Promise<NestExpressApplication>;
|
|
17
18
|
export declare function bootstrapSolidCli(appModuleFactory: () => Promise<any>): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap.helper.d.ts","sourceRoot":"","sources":["../../src/helpers/bootstrap.helper.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAalE,OAAO,EAGL,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,mBAAmB,CAAC;AAyB3B,MAAM,WAAW,mBAAmB;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,qBAAqB;IAEpC,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,OAAO,CAAC,EAAE,mBAAmB,GAAG,KAAK,CAAC;IAEtC,0BAA0B,CAAC,EAAE,OAAO,CAAC,uBAAuB,CAAC,CAAC;IAE9D,QAAQ,CAAC,EAAE,oBAAoB,CAAC;IAEhC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAU3B,SAAS,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"bootstrap.helper.d.ts","sourceRoot":"","sources":["../../src/helpers/bootstrap.helper.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAalE,OAAO,EAGL,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,mBAAmB,CAAC;AAyB3B,MAAM,WAAW,mBAAmB;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,qBAAqB;IAEpC,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,OAAO,CAAC,EAAE,mBAAmB,GAAG,KAAK,CAAC;IAEtC,0BAA0B,CAAC,EAAE,OAAO,CAAC,uBAAuB,CAAC,CAAC;IAE9D,QAAQ,CAAC,EAAE,oBAAoB,CAAC;IAEhC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAU3B,SAAS,CAAC,EAAE,MAAM,CAAC;IAYnB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAeD,wBAAsB,iBAAiB,CACrC,gBAAgB,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,EACpC,OAAO,GAAE,qBAA0B,GAClC,OAAO,CAAC,sBAAsB,CAAC,CAuJjC;AAgBD,wBAAsB,iBAAiB,CACrC,gBAAgB,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,GACnC,OAAO,CAAC,IAAI,CAAC,CA4Cf"}
|
|
@@ -36,11 +36,12 @@ function registerGlobalProcessHandlers() {
|
|
|
36
36
|
}
|
|
37
37
|
async function bootstrapSolidApp(appModuleFactory, options = {}) {
|
|
38
38
|
registerGlobalProcessHandlers();
|
|
39
|
-
const { globalPrefix = 'api', swagger = {}, permissionsPolicyOverrides = {}, security = {}, verboseBootstrap = false, bodyLimit = '10mb', } = options;
|
|
39
|
+
const { globalPrefix = 'api', swagger = {}, permissionsPolicyOverrides = {}, security = {}, verboseBootstrap = false, bodyLimit = '10mb', captureRawBody = false, } = options;
|
|
40
40
|
const startTime = Date.now();
|
|
41
41
|
const appModule = await appModuleFactory();
|
|
42
42
|
const app = await core_1.NestFactory.create(appModule, {
|
|
43
43
|
bodyParser: false,
|
|
44
|
+
rawBody: captureRawBody,
|
|
44
45
|
logger: nest_winston_1.WinstonModule.createLogger({ ...(0, winston_logger_1.createWinstonLoggerConfig)(), level: verboseBootstrap ? 'debug' : 'error' }),
|
|
45
46
|
});
|
|
46
47
|
const apiEnabled = (0, environment_helper_1.parseBooleanEnv)('API_ENABLED', true);
|
|
@@ -140,12 +141,12 @@ async function bootstrapSolidCli(appModuleFactory) {
|
|
|
140
141
|
if (idx !== -1)
|
|
141
142
|
process.argv.splice(idx, 1);
|
|
142
143
|
}
|
|
143
|
-
const appModule = await appModuleFactory();
|
|
144
|
-
process.env.SOLID_CLI_RUNNING = 'true';
|
|
145
|
-
const app = await nest_commander_1.CommandFactory.createWithoutRunning(appModule, {
|
|
146
|
-
logger: showLogs ? ['debug', 'error', 'fatal', 'log', 'verbose', 'warn'] : false,
|
|
147
|
-
});
|
|
148
144
|
try {
|
|
145
|
+
const appModule = await appModuleFactory();
|
|
146
|
+
process.env.SOLID_CLI_RUNNING = 'true';
|
|
147
|
+
const app = await nest_commander_1.CommandFactory.createWithoutRunning(appModule, {
|
|
148
|
+
logger: showLogs ? ['debug', 'error', 'fatal', 'log', 'verbose', 'warn'] : ['error', 'fatal'],
|
|
149
|
+
});
|
|
149
150
|
await nest_commander_1.CommandFactory.runApplication(app);
|
|
150
151
|
}
|
|
151
152
|
catch (e) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap.helper.js","sourceRoot":"","sources":["../../src/helpers/bootstrap.helper.ts"],"names":[],"mappings":";;;;;AAuFA,8CAmJC;AAgBD,8CA0CC;AApSD,2CAA4E;AAC5E,uCAAsD;AAEtD,qDAAgD;AAChD,6CAAiE;AAEjE,oDAA4B;AAC5B,4CAAoB;AACpB,2BAAgC;AAChC,+BAA+B;AAC/B,+CAA2E;AAC3E,mDAAgD;AAChD,sDAA8D;AAC9D,yFAAoF;AACpF,+CAAwD;AACxD,uDAK2B;AAC3B,6DAAuD;AAIvD,SAAS,6BAA6B;IACpC,OAAO,CAAC,EAAE,CAAC,oBAAoB,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE;QACnD,OAAO,CAA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,CAAC;IAC3C,OAAO,CAAC,GAAG,CAAC,iBAAiB,GAAG,MAAM,CAAC;IAGvC,MAAM,GAAG,GAAG,MAAM,+BAAc,CAAC,oBAAoB,CAAC,SAAS,EAAE;QAC/D,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK;KACjF,CAAC,CAAC;IAEH,IAAI,CAAC;QACH,MAAM,+BAAc,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;IAC3C,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,CAAC,KAAK,CAAC,sCAAsC,EAAE,CAAC,CAAC,CAAC;QACzD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC","sourcesContent":["import { ClassSerializerInterceptor, ValidationPipe } from '@nestjs/common';\nimport { NestFactory, Reflector } from '@nestjs/core';\nimport { NestExpressApplication } from '@nestjs/platform-express';\nimport { WsAdapter } from '@nestjs/platform-ws';\nimport { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';\nimport { NextFunction, Request, Response } from 'express';\nimport helmet from 'helmet';\nimport qs from 'qs';\nimport { existsSync } from 'fs';\nimport { resolve } from 'path';\nimport { WINSTON_MODULE_NEST_PROVIDER, WinstonModule } from 'nest-winston';\nimport { CommandFactory } from 'nest-commander';\nimport { createWinstonLoggerConfig } from '../winston.logger';\nimport { WrapResponseInterceptor } from '../interceptors/wrap-response.interceptor';\nimport { buildDefaultCorsOptions } from './cors.helper';\nimport {\n buildDefaultSecurityHeaderOptions,\n buildPermissionsPolicyHeader,\n PermissionsPolicyConfig,\n SolidSecurityOptions,\n} from './security.helper';\nimport { parseBooleanEnv } from './environment.helper';\n\n// ---- Shared process handlers ----\n\nfunction registerGlobalProcessHandlers() {\n process.on('unhandledRejection', (reason, promise) => {\n console.error('Unhandled Rejection at:', promise, 'reason:', reason);\n });\n\n process.on('uncaughtException', (err) => {\n console.error('Uncaught Exception thrown:', err);\n });\n\n // Suppress pg deprecation warning caused by TypeORM's internal query scheduling\n process.on('warning', (warning) => {\n if (warning.name === 'DeprecationWarning' && (warning.message.includes('client.query()') || warning.message.includes('punycode'))) {\n return;\n }\n console.warn(warning);\n });\n}\n\n// ---- HTTP server bootstrap ----\n\nexport interface SolidSwaggerOptions {\n title?: string;\n description?: string;\n version?: string;\n}\n\nexport interface SolidBootstrapOptions {\n /** Global API prefix. Defaults to 'api'. Set to '' to disable. */\n globalPrefix?: string;\n /** Swagger configuration. Set to false to disable Swagger entirely. */\n swagger?: SolidSwaggerOptions | false;\n /** Permissions-Policy header overrides (merged with defaults). */\n permissionsPolicyOverrides?: Partial<PermissionsPolicyConfig>;\n /** Security header overrides, including iframe frame-ancestor allowlists. */\n security?: SolidSecurityOptions;\n /** Show full NestJS init logs during bootstrap (route mapping, module deps, pollers). Defaults to false. */\n verboseBootstrap?: boolean;\n /**\n * Max request body size for JSON and urlencoded payloads, as a `bytes`-compatible\n * string (e.g. '10mb', '512kb'). Defaults to '10mb'.\n *\n * Does NOT apply to multipart/form-data uploads: body-parser matches on Content-Type,\n * so multipart requests skip these parsers entirely and are handled by Multer. Raise\n * this only for large structured JSON (e.g. /bulk arrays), bearing in mind the parsed\n * object graph can retain several times the raw byte size.\n */\n bodyLimit?: string;\n}\n\n/**\n * Bootstraps a SolidX NestJS HTTP application with sensible defaults:\n * security headers, CORS, Winston logger, ValidationPipe,\n * WrapResponseInterceptor, qs deep query parsing, Swagger, and the\n * pg BIGINT type parser.\n *\n * @example\n * // main.ts\n * bootstrapSolidApp(() => AppModule.forRoot(), {\n * swagger: { title: 'My API', description: 'My API description' },\n * security: { frameAncestors: [\"'self'\", 'https://portal.example.com'] },\n * });\n */\nexport async function bootstrapSolidApp(\n appModuleFactory: () => Promise<any>,\n options: SolidBootstrapOptions = {},\n): Promise<NestExpressApplication> {\n registerGlobalProcessHandlers();\n\n const {\n globalPrefix = 'api',\n swagger = {},\n permissionsPolicyOverrides = {},\n security = {},\n verboseBootstrap = false,\n bodyLimit = '10mb',\n } = options;\n\n const startTime = Date.now();\n const appModule = await appModuleFactory();\n const app = await NestFactory.create<NestExpressApplication>(appModule, {\n // Nest's default parsers are registered during init() with a 100kb limit, ahead of\n // any module middleware. Disable them so the parsers below own the limit outright.\n bodyParser: false,\n logger: WinstonModule.createLogger({ ...createWinstonLoggerConfig(), level: verboseBootstrap ? 'debug' : 'error' }),\n });\n\n const apiEnabled = parseBooleanEnv('API_ENABLED', true);\n\n if (!apiEnabled) {\n await app.init();\n app\n .get(WINSTON_MODULE_NEST_PROVIDER)\n .log('API server disabled via API_ENABLED=false. Skipping HTTP listen.', 'Bootstrap');\n return app;\n }\n\n // Health check at root path\n const server = app.getHttpAdapter().getInstance();\n server.get('/', (_req, res) => res.status(200).send('SOLID OK'));\n\n // Security headers\n app.use(helmet(buildDefaultSecurityHeaderOptions(security)));\n\n // Nest's Swagger UI HTML injects inline styles; keep CSP strict elsewhere.\n const isSwaggerPath = (path: string) =>\n path === '/docs' ||\n path === '/docs/' ||\n path.startsWith('/docs/') ||\n path === '/docs-json' ||\n path === '/docs-yaml';\n\n app.use((req: Request, res: Response, next: NextFunction) => {\n if (isSwaggerPath(req.path)) {\n res.removeHeader('Content-Security-Policy');\n }\n next();\n });\n\n // Permissions-Policy header\n app.use((_req: Request, res: Response, next: NextFunction) => {\n res.setHeader('Permissions-Policy', buildPermissionsPolicyHeader(permissionsPolicyOverrides));\n next();\n });\n\n const port = process.env.PORT || 3000;\n\n if (globalPrefix) {\n app.setGlobalPrefix(globalPrefix);\n }\n\n // qs-based deep query parsing (dot notation, nested objects, arrays)\n app.use((req: Request, _res: Response, next: NextFunction) => {\n if (req.query) {\n req.query = qs.parse(req.url.split('?')[1], {\n allowDots: true,\n depth: 20,\n arrayLimit: 100,\n });\n }\n next();\n });\n\n // Body parsers — replaces Nest's default 100kb parsers (disabled via bodyParser: false).\n // Registered here so the middleware order Nest applied by default is preserved:\n // helmet -> CSP -> Permissions-Policy -> qs -> body parsers -> routes.\n app.useBodyParser('json', { limit: bodyLimit });\n app.useBodyParser('urlencoded', { limit: bodyLimit, extended: true });\n\n // Global ValidationPipe\n app.useGlobalPipes(\n new ValidationPipe({\n transform: true,\n transformOptions: { enableImplicitConversion: true },\n }),\n );\n\n // Swagger\n if (swagger !== false) {\n const { title = process.env.SOLID_APP_NAME, description = process.env.SOLID_APP_DESCRIPTION, version = '1.0' } = swagger;\n const swaggerConfig = new DocumentBuilder()\n .setTitle(title)\n .setDescription(description)\n .setVersion(version)\n .setExternalDoc('Postman Collection', '/docs-json')\n .addBearerAuth(\n {\n description: 'Please enter token in following format: Bearer <JWT>',\n name: 'Authorization',\n bearerFormat: 'Bearer',\n scheme: 'Bearer',\n type: 'http',\n in: 'Header',\n },\n 'jwt',\n )\n .build();\n const document = SwaggerModule.createDocument(app, swaggerConfig);\n SwaggerModule.setup('/docs', app, document);\n }\n\n // Global interceptor\n app.useGlobalInterceptors(\n new ClassSerializerInterceptor(app.get(Reflector), {\n enableImplicitConversion: true, // optional but handy\n // groups: ['client'], // if you use groups\n }),\n new WrapResponseInterceptor()\n );\n\n // CORS\n app.enableCors(buildDefaultCorsOptions());\n\n // Fix pg returning BIGINT columns as strings\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const types = require('pg').types;\n types.setTypeParser(types.builtins.INT8, (val: string) => parseInt(val));\n\n app.useWebSocketAdapter(new WsAdapter(app));\n\n await app.listen(port);\n\n // Wire up Winston as the runtime logger only AFTER listen — this suppresses all\n // framework init noise (route mapping, module deps, onModuleInit) during boot.\n app.useLogger(app.get(WINSTON_MODULE_NEST_PROVIDER));\n\n const elapsed = ((Date.now() - startTime) / 1000).toFixed(2);\n process.stdout.write(`\\x1b[32mServer started on port ${port} in ${elapsed}s\\x1b[0m\\n`);\n\n return app;\n}\n\n// ---- CLI bootstrap ----\n\n/**\n * Bootstraps a SolidX NestJS CLI application using nest-commander.\n * Handles verbose flag stripping, project root validation, and clean process exit.\n *\n * @example\n * // main-cli.ts\n * #!/usr/bin/env node\n * import { bootstrapSolidCli } from '@solidxai/core';\n * import { AppModule } from './app.module';\n *\n * bootstrapSolidCli(() => AppModule.forRoot());\n */\nexport async function bootstrapSolidCli(\n appModuleFactory: () => Promise<any>,\n): Promise<void> {\n registerGlobalProcessHandlers();\n\n process.on('exit', (code) => {\n if (code !== 0) {\n console.error(`Exiting with error status code: ${code}`);\n }\n });\n\n // Validate that cwd is a valid Solid API project\n const packageJsonPath = resolve(process.cwd(), 'package.json');\n if (!existsSync(packageJsonPath)) {\n console.error('Does not seem to be a valid solid-api project.');\n console.error('Exit reason: missing package.json in the current directory.');\n process.exit(1);\n }\n\n // Strip --verbose / -v before nest-commander processes argv\n const showLogs = process.argv.includes('--verbose') || process.argv.includes('-v');\n for (const flag of ['--verbose', '-v']) {\n const idx = process.argv.indexOf(flag);\n if (idx !== -1) process.argv.splice(idx, 1);\n }\n\n const appModule = await appModuleFactory();\n process.env.SOLID_CLI_RUNNING = 'true';\n\n // @ts-ignore\n const app = await CommandFactory.createWithoutRunning(appModule, {\n logger: showLogs ? ['debug', 'error', 'fatal', 'log', 'verbose', 'warn'] : false,\n });\n\n try {\n await CommandFactory.runApplication(app);\n } catch (e) {\n console.error('CLI exited abruptly due to an error:', e);\n process.exit(1);\n }\n\n process.exit(0);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"bootstrap.helper.js","sourceRoot":"","sources":["../../src/helpers/bootstrap.helper.ts"],"names":[],"mappings":";;;;;AAmGA,8CA0JC;AAgBD,8CA8CC;AA3TD,2CAA4E;AAC5E,uCAAsD;AAEtD,qDAAgD;AAChD,6CAAiE;AAEjE,oDAA4B;AAC5B,4CAAoB;AACpB,2BAAgC;AAChC,+BAA+B;AAC/B,+CAA2E;AAC3E,mDAAgD;AAChD,sDAA8D;A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G,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACvC,IAAI,GAAG,KAAK,CAAC,CAAC;YAAE,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;IAC9C,CAAC;IAED,IAAI,CAAC;QACH,MAAM,SAAS,GAAG,MAAM,gBAAgB,EAAE,CAAC;QAC3C,OAAO,CAAC,GAAG,CAAC,iBAAiB,GAAG,MAAM,CAAC;QAGvC,MAAM,GAAG,GAAG,MAAM,+BAAc,CAAC,oBAAoB,CAAC,SAAS,EAAE;YAK/D,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC;SAC9F,CAAC,CAAC;QAEH,MAAM,+BAAc,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;IAC3C,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,CAAC,KAAK,CAAC,sCAAsC,EAAE,CAAC,CAAC,CAAC;QACzD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC","sourcesContent":["import { ClassSerializerInterceptor, ValidationPipe } from '@nestjs/common';\nimport { NestFactory, Reflector } from '@nestjs/core';\nimport { NestExpressApplication } from '@nestjs/platform-express';\nimport { WsAdapter } from '@nestjs/platform-ws';\nimport { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';\nimport { NextFunction, Request, Response } from 'express';\nimport helmet from 'helmet';\nimport qs from 'qs';\nimport { existsSync } from 'fs';\nimport { resolve } from 'path';\nimport { WINSTON_MODULE_NEST_PROVIDER, WinstonModule } from 'nest-winston';\nimport { CommandFactory } from 'nest-commander';\nimport { createWinstonLoggerConfig } from '../winston.logger';\nimport { WrapResponseInterceptor } from '../interceptors/wrap-response.interceptor';\nimport { buildDefaultCorsOptions } from './cors.helper';\nimport {\n buildDefaultSecurityHeaderOptions,\n buildPermissionsPolicyHeader,\n PermissionsPolicyConfig,\n SolidSecurityOptions,\n} from './security.helper';\nimport { parseBooleanEnv } from './environment.helper';\n\n// ---- Shared process handlers ----\n\nfunction registerGlobalProcessHandlers() {\n process.on('unhandledRejection', (reason, promise) => {\n console.error('Unhandled Rejection at:', promise, 'reason:', reason);\n });\n\n process.on('uncaughtException', (err) => {\n console.error('Uncaught Exception thrown:', err);\n });\n\n // Suppress pg deprecation warning caused by TypeORM's internal query scheduling\n process.on('warning', (warning) => {\n if (warning.name === 'DeprecationWarning' && (warning.message.includes('client.query()') || warning.message.includes('punycode'))) {\n return;\n }\n console.warn(warning);\n });\n}\n\n// ---- HTTP server bootstrap ----\n\nexport interface SolidSwaggerOptions {\n title?: string;\n description?: string;\n version?: string;\n}\n\nexport interface SolidBootstrapOptions {\n /** Global API prefix. Defaults to 'api'. Set to '' to disable. */\n globalPrefix?: string;\n /** Swagger configuration. Set to false to disable Swagger entirely. */\n swagger?: SolidSwaggerOptions | false;\n /** Permissions-Policy header overrides (merged with defaults). */\n permissionsPolicyOverrides?: Partial<PermissionsPolicyConfig>;\n /** Security header overrides, including iframe frame-ancestor allowlists. */\n security?: SolidSecurityOptions;\n /** Show full NestJS init logs during bootstrap (route mapping, module deps, pollers). Defaults to false. */\n verboseBootstrap?: boolean;\n /**\n * Max request body size for JSON and urlencoded payloads, as a `bytes`-compatible\n * string (e.g. '10mb', '512kb'). Defaults to '10mb'.\n *\n * Does NOT apply to multipart/form-data uploads: body-parser matches on Content-Type,\n * so multipart requests skip these parsers entirely and are handled by Multer. Raise\n * this only for large structured JSON (e.g. /bulk arrays), bearing in mind the parsed\n * object graph can retain several times the raw byte size.\n */\n bodyLimit?: string;\n /**\n * When true, the original request bytes are captured onto `request.rawBody` (a `Buffer`)\n * alongside the normal parsed `request.body`, for JSON and urlencoded requests. Needed to verify\n * a webhook's HMAC signature (GitHub, GitLab, Stripe, ...): the signature is computed over the\n * exact bytes the sender transmitted, and `JSON.stringify(request.body)` is not guaranteed to\n * reproduce them byte-for-byte (key order, numeric formatting, unicode escaping can all differ).\n *\n * Defaults to false — capturing every request body a second time has a real memory cost at scale,\n * and only a route that actually verifies a signature needs it. Opt in per application, not per\n * route: NestJS wires this at `NestFactory.create()` time, before any route exists to opt out.\n */\n captureRawBody?: boolean;\n}\n\n/**\n * Bootstraps a SolidX NestJS HTTP application with sensible defaults:\n * security headers, CORS, Winston logger, ValidationPipe,\n * WrapResponseInterceptor, qs deep query parsing, Swagger, and the\n * pg BIGINT type parser.\n *\n * @example\n * // main.ts\n * bootstrapSolidApp(() => AppModule.forRoot(), {\n * swagger: { title: 'My API', description: 'My API description' },\n * security: { frameAncestors: [\"'self'\", 'https://portal.example.com'] },\n * });\n */\nexport async function bootstrapSolidApp(\n appModuleFactory: () => Promise<any>,\n options: SolidBootstrapOptions = {},\n): Promise<NestExpressApplication> {\n registerGlobalProcessHandlers();\n\n const {\n globalPrefix = 'api',\n swagger = {},\n permissionsPolicyOverrides = {},\n security = {},\n verboseBootstrap = false,\n bodyLimit = '10mb',\n captureRawBody = false,\n } = options;\n\n const startTime = Date.now();\n const appModule = await appModuleFactory();\n const app = await NestFactory.create<NestExpressApplication>(appModule, {\n // Nest's default parsers are registered during init() with a 100kb limit, ahead of\n // any module middleware. Disable them so the parsers below own the limit outright.\n bodyParser: false,\n // Raw-body capture is threaded through by NestApplication.useBodyParser() from THIS option —\n // not from any argument passed to the useBodyParser() calls below. It must be requested here,\n // at creation time, or request.rawBody is never populated no matter how useBodyParser is called\n // later (verified against the installed @nestjs/core: NestApplication#useBodyParser reads\n // `this.appOptions.rawBody` itself and ignores any rawBody-shaped argument a caller supplies).\n rawBody: captureRawBody,\n logger: WinstonModule.createLogger({ ...createWinstonLoggerConfig(), level: verboseBootstrap ? 'debug' : 'error' }),\n });\n\n const apiEnabled = parseBooleanEnv('API_ENABLED', true);\n\n if (!apiEnabled) {\n await app.init();\n app\n .get(WINSTON_MODULE_NEST_PROVIDER)\n .log('API server disabled via API_ENABLED=false. Skipping HTTP listen.', 'Bootstrap');\n return app;\n }\n\n // Health check at root path\n const server = app.getHttpAdapter().getInstance();\n server.get('/', (_req, res) => res.status(200).send('SOLID OK'));\n\n // Security headers\n app.use(helmet(buildDefaultSecurityHeaderOptions(security)));\n\n // Nest's Swagger UI HTML injects inline styles; keep CSP strict elsewhere.\n const isSwaggerPath = (path: string) =>\n path === '/docs' ||\n path === '/docs/' ||\n path.startsWith('/docs/') ||\n path === '/docs-json' ||\n path === '/docs-yaml';\n\n app.use((req: Request, res: Response, next: NextFunction) => {\n if (isSwaggerPath(req.path)) {\n res.removeHeader('Content-Security-Policy');\n }\n next();\n });\n\n // Permissions-Policy header\n app.use((_req: Request, res: Response, next: NextFunction) => {\n res.setHeader('Permissions-Policy', buildPermissionsPolicyHeader(permissionsPolicyOverrides));\n next();\n });\n\n const port = process.env.PORT || 3000;\n\n if (globalPrefix) {\n app.setGlobalPrefix(globalPrefix);\n }\n\n // qs-based deep query parsing (dot notation, nested objects, arrays)\n app.use((req: Request, _res: Response, next: NextFunction) => {\n if (req.query) {\n req.query = qs.parse(req.url.split('?')[1], {\n allowDots: true,\n depth: 20,\n arrayLimit: 100,\n });\n }\n next();\n });\n\n // Body parsers — replaces Nest's default 100kb parsers (disabled via bodyParser: false).\n // Registered here so the middleware order Nest applied by default is preserved:\n // helmet -> CSP -> Permissions-Policy -> qs -> body parsers -> routes.\n app.useBodyParser('json', { limit: bodyLimit });\n app.useBodyParser('urlencoded', { limit: bodyLimit, extended: true });\n\n // Global ValidationPipe\n app.useGlobalPipes(\n new ValidationPipe({\n transform: true,\n transformOptions: { enableImplicitConversion: true },\n }),\n );\n\n // Swagger\n if (swagger !== false) {\n const { title = process.env.SOLID_APP_NAME, description = process.env.SOLID_APP_DESCRIPTION, version = '1.0' } = swagger;\n const swaggerConfig = new DocumentBuilder()\n .setTitle(title)\n .setDescription(description)\n .setVersion(version)\n .setExternalDoc('Postman Collection', '/docs-json')\n .addBearerAuth(\n {\n description: 'Please enter token in following format: Bearer <JWT>',\n name: 'Authorization',\n bearerFormat: 'Bearer',\n scheme: 'Bearer',\n type: 'http',\n in: 'Header',\n },\n 'jwt',\n )\n .build();\n const document = SwaggerModule.createDocument(app, swaggerConfig);\n SwaggerModule.setup('/docs', app, document);\n }\n\n // Global interceptor\n app.useGlobalInterceptors(\n new ClassSerializerInterceptor(app.get(Reflector), {\n enableImplicitConversion: true, // optional but handy\n // groups: ['client'], // if you use groups\n }),\n new WrapResponseInterceptor()\n );\n\n // CORS\n app.enableCors(buildDefaultCorsOptions());\n\n // Fix pg returning BIGINT columns as strings\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const types = require('pg').types;\n types.setTypeParser(types.builtins.INT8, (val: string) => parseInt(val));\n\n app.useWebSocketAdapter(new WsAdapter(app));\n\n await app.listen(port);\n\n // Wire up Winston as the runtime logger only AFTER listen — this suppresses all\n // framework init noise (route mapping, module deps, onModuleInit) during boot.\n app.useLogger(app.get(WINSTON_MODULE_NEST_PROVIDER));\n\n const elapsed = ((Date.now() - startTime) / 1000).toFixed(2);\n process.stdout.write(`\\x1b[32mServer started on port ${port} in ${elapsed}s\\x1b[0m\\n`);\n\n return app;\n}\n\n// ---- CLI bootstrap ----\n\n/**\n * Bootstraps a SolidX NestJS CLI application using nest-commander.\n * Handles verbose flag stripping, project root validation, and clean process exit.\n *\n * @example\n * // main-cli.ts\n * #!/usr/bin/env node\n * import { bootstrapSolidCli } from '@solidxai/core';\n * import { AppModule } from './app.module';\n *\n * bootstrapSolidCli(() => AppModule.forRoot());\n */\nexport async function bootstrapSolidCli(\n appModuleFactory: () => Promise<any>,\n): Promise<void> {\n registerGlobalProcessHandlers();\n\n process.on('exit', (code) => {\n if (code !== 0) {\n console.error(`Exiting with error status code: ${code}`);\n }\n });\n\n // Validate that cwd is a valid Solid API project\n const packageJsonPath = resolve(process.cwd(), 'package.json');\n if (!existsSync(packageJsonPath)) {\n console.error('Does not seem to be a valid solid-api project.');\n console.error('Exit reason: missing package.json in the current directory.');\n process.exit(1);\n }\n\n // Strip --verbose / -v before nest-commander processes argv\n const showLogs = process.argv.includes('--verbose') || process.argv.includes('-v');\n for (const flag of ['--verbose', '-v']) {\n const idx = process.argv.indexOf(flag);\n if (idx !== -1) process.argv.splice(idx, 1);\n }\n\n try {\n const appModule = await appModuleFactory();\n process.env.SOLID_CLI_RUNNING = 'true';\n\n // @ts-ignore\n const app = await CommandFactory.createWithoutRunning(appModule, {\n // Keep normal CLI runs quiet, but never hide errors. Seeders and other CLI\n // commands often catch domain/database errors and report them through the\n // Nest logger; disabling the logger entirely would leave the wrapper with\n // only the generic non-zero exit status.\n logger: showLogs ? ['debug', 'error', 'fatal', 'log', 'verbose', 'warn'] : ['error', 'fatal'],\n });\n\n await CommandFactory.runApplication(app);\n } catch (e) {\n console.error('CLI exited abruptly due to an error:', e);\n process.exit(1);\n }\n\n process.exit(0);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solid-core-error-codes-provider.service.d.ts","sourceRoot":"","sources":["../../src/helpers/solid-core-error-codes-provider.service.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAG1E,qBAEa,2BAA4B,YAAW,kBAAkB;IAClE,IAAI,IAAI,MAAM;IAId,KAAK,IAAI,aAAa,CAAC,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"solid-core-error-codes-provider.service.d.ts","sourceRoot":"","sources":["../../src/helpers/solid-core-error-codes-provider.service.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAG1E,qBAEa,2BAA4B,YAAW,kBAAkB;IAClE,IAAI,IAAI,MAAM;IAId,KAAK,IAAI,aAAa,CAAC,SAAS,CAAC;IAkJjC,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS;CAI/C"}
|
|
@@ -79,6 +79,24 @@ let SolidCoreErrorCodesProvider = class SolidCoreErrorCodesProvider {
|
|
|
79
79
|
httpStatus: 400,
|
|
80
80
|
},
|
|
81
81
|
},
|
|
82
|
+
{
|
|
83
|
+
code: 'solidx-login-denied-by-extension',
|
|
84
|
+
priority: 120,
|
|
85
|
+
match: (txt) => txt.includes(error_messages_1.ERROR_MESSAGES.LOGIN_DENIED_BY_EXTENSION.toLowerCase()),
|
|
86
|
+
meta: {
|
|
87
|
+
message: error_messages_1.ERROR_MESSAGES.LOGIN_DENIED_BY_EXTENSION,
|
|
88
|
+
httpStatus: 401,
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
code: 'solidx-login-extension-unavailable',
|
|
93
|
+
priority: 120,
|
|
94
|
+
match: (txt) => txt.includes(error_messages_1.ERROR_MESSAGES.LOGIN_EXTENSION_UNAVAILABLE.toLowerCase()),
|
|
95
|
+
meta: {
|
|
96
|
+
message: error_messages_1.ERROR_MESSAGES.LOGIN_EXTENSION_UNAVAILABLE,
|
|
97
|
+
httpStatus: 503,
|
|
98
|
+
},
|
|
99
|
+
},
|
|
82
100
|
{
|
|
83
101
|
code: 'solidx-mcp-server-unavailable',
|
|
84
102
|
priority: 100,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solid-core-error-codes-provider.service.js","sourceRoot":"","sources":["../../src/helpers/solid-core-error-codes-provider.service.ts"],"names":[],"mappings":";;;;;;;;;AACA,2CAA4C;AAC5C,gEAA8D;AAC9D,iGAAkF;AAM3E,IAAM,2BAA2B,GAAjC,MAAM,2BAA2B;IACpC,IAAI;QACA,OAAO,4BAA4B,CAAC;IACxC,CAAC;IAED,KAAK;QACD,OAAO;YACH;gBACI,IAAI,EAAE,wBAAwB;gBA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AE,yBAAyB;gBAC/B,QAAQ,EAAE,EAAE;gBACZ,KAAK,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,mBAAmB,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,eAAe,CAAC;gBAClF,IAAI,EAAE;oBACF,OAAO,EAAE,qEAAqE;oBAC9E,UAAU,EAAE,GAAG;iBAClB;aACJ;YACD;gBACI,IAAI,EAAE,6BAA6B;gBACnC,QAAQ,EAAE,EAAE;gBACZ,KAAK,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,sBAAsB,CAAC;gBACpD,IAAI,EAAE;oBACF,OAAO,EACH,wEAAwE;oBAC5E,UAAU,EAAE,GAAG;iBAClB;aACJ;YACD;gBACI,IAAI,EAAE,sBAAsB;gBAC5B,QAAQ,EAAE,CAAC,CAAC;gBACZ,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI;gBACrB,IAAI,EAAE;oBACF,OAAO,EAAE,+BAA+B;oBACxC,UAAU,EAAE,GAAG;iBAClB;aACJ;SACJ,CAAC;IACN,CAAC;IAGD,OAAO,CAAC,IAAY;QAChB,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;QACvD,OAAO,IAAI,EAAE,IAAI,CAAC;IACtB,CAAC;CACJ,CAAA;AAtIY,kEAA2B;sCAA3B,2BAA2B;IAFvC,IAAA,kDAAiB,GAAE;IACnB,IAAA,mBAAU,GAAE;GACA,2BAA2B,CAsIvC","sourcesContent":["// src/common/errors/providers/solidcore-error-code.provider.ts\nimport { Injectable } from '@nestjs/common';\nimport { ERROR_MESSAGES } from 'src/constants/error-messages';\nimport { ErrorCodeProvider } from 'src/decorators/error-codes-provider.decorator';\nimport { ErrorMeta, ErrorRule, IErrorCodeProvider } from 'src/interfaces';\n\n\n@ErrorCodeProvider()\n@Injectable()\nexport class SolidCoreErrorCodesProvider implements IErrorCodeProvider {\n name(): string {\n return 'SolidCoreErrorCodeProvider';\n }\n\n rules(): ReadonlyArray<ErrorRule> {\n return [\n {\n code: 'solidx-session-invalid',\n priority: 110,\n match: (txt) => txt.includes(ERROR_MESSAGES.SESSION_INVALID.toLowerCase()),\n meta: {\n message: ERROR_MESSAGES.SESSION_INVALID,\n httpStatus: 401,\n },\n },\n {\n code: 'solidx-session-expired',\n priority: 110,\n match: (txt) => txt.includes(ERROR_MESSAGES.SESSION_EXPIRED.toLowerCase()),\n meta: {\n message: ERROR_MESSAGES.SESSION_EXPIRED,\n httpStatus: 401,\n },\n },\n // MPIN rules sit above the generic session rules so that an MPIN\n // failure is never reported as a session problem. The three codes\n // drive three different client behaviours: retry, wait, and\n // discard-the-handle.\n {\n code: 'solidx-mpin-locked',\n priority: 120,\n match: (txt) => txt.includes(ERROR_MESSAGES.MPIN_LOCKED.toLowerCase()),\n meta: {\n message: ERROR_MESSAGES.MPIN_LOCKED,\n httpStatus: 401,\n },\n },\n {\n code: 'solidx-mpin-revoked',\n priority: 120,\n match: (txt) => txt.includes(ERROR_MESSAGES.MPIN_REVOKED.toLowerCase()),\n meta: {\n message: ERROR_MESSAGES.MPIN_REVOKED,\n httpStatus: 401,\n },\n },\n {\n code: 'solidx-mpin-invalid',\n priority: 120,\n match: (txt) => txt.includes(ERROR_MESSAGES.MPIN_INVALID.toLowerCase()),\n meta: {\n message: ERROR_MESSAGES.MPIN_INVALID,\n httpStatus: 401,\n },\n },\n // Setup-time rejections. Distinct codes so the client can say\n // \"choose a less predictable PIN\" rather than parsing a message.\n // Safe to distinguish: both occur only on bearer-authenticated\n // routes, so neither discloses anything.\n {\n code: 'solidx-mpin-too-predictable',\n priority: 120,\n match: (txt) => txt.includes(ERROR_MESSAGES.MPIN_TOO_PREDICTABLE.toLowerCase()),\n meta: {\n message: ERROR_MESSAGES.MPIN_TOO_PREDICTABLE,\n httpStatus: 400,\n },\n },\n {\n code: 'solidx-mpin-format-invalid',\n priority: 120,\n match: (txt) => txt.includes(ERROR_MESSAGES.MPIN_FORMAT_INVALID.toLowerCase()),\n meta: {\n message: ERROR_MESSAGES.MPIN_FORMAT_INVALID,\n httpStatus: 400,\n },\n },\n {\n code: 'solidx-mcp-server-unavailable',\n priority: 100,\n match: (txt) =>\n txt.includes('all connection attempts failed') &&\n txt.includes('unhandled errors in a taskgroup (1 sub-exception)'),\n meta: {\n message: 'SolidX MCP server is unreachable. Please verify the MCP endpoint.',\n httpStatus: 503,\n },\n },\n {\n code: 'solidx-resource-not-found',\n priority: 95,\n match: (txt) => txt.includes('enoent') && txt.includes('no such file or directory'),\n meta: {\n message: ERROR_MESSAGES.RESOURCE_NOT_FOUND,\n httpStatus: 404,\n },\n },\n {\n code: 'solidx-db-duplicate-key',\n priority: 90,\n match: (txt) => txt.includes('unique constraint') || txt.includes('duplicate key'),\n meta: {\n message: 'Duplicate key violation. A record with these values already exists.',\n httpStatus: 409,\n },\n },\n {\n code: 'solidx-db-foreign-key-error',\n priority: 90,\n match: (txt) => txt.includes('violates foreign key'),\n meta: {\n message:\n 'Foreign key constraint prevents this operation due to related records.',\n httpStatus: 409,\n },\n },\n {\n code: 'solidx-unknown-error',\n priority: -1, // last resort\n match: (_txt) => true, // fallback catch-all\n meta: {\n message: 'An unexpected error occurred.',\n httpStatus: 500,\n },\n },\n ];\n }\n\n // Optional explicit meta resolution (if you want)\n resolve(code: string): ErrorMeta | undefined {\n const rule = this.rules().find((r) => r.code === code);\n return rule?.meta;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"solid-core-error-codes-provider.service.js","sourceRoot":"","sources":["../../src/helpers/solid-core-error-codes-provider.service.ts"],"names":[],"mappings":";;;;;;;;;AACA,2CAA4C;AAC5C,gEAA8D;AAC9D,iGAAkF;AAM3E,IAAM,2BAA2B,GAAjC,MAAM,2BAA2B;IACpC,IAAI;QACA,OAAO,4BAA4B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I;gBACrB,IAAI,EAAE;oBACF,OAAO,EAAE,+BAA+B;oBACxC,UAAU,EAAE,GAAG;iBAClB;aACJ;SACJ,CAAC;IACN,CAAC;IAGD,OAAO,CAAC,IAAY;QAChB,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;QACvD,OAAO,IAAI,EAAE,IAAI,CAAC;IACtB,CAAC;CACJ,CAAA;AA3JY,kEAA2B;sCAA3B,2BAA2B;IAFvC,IAAA,kDAAiB,GAAE;IACnB,IAAA,mBAAU,GAAE;GACA,2BAA2B,CA2JvC","sourcesContent":["// src/common/errors/providers/solidcore-error-code.provider.ts\nimport { Injectable } from '@nestjs/common';\nimport { ERROR_MESSAGES } from 'src/constants/error-messages';\nimport { ErrorCodeProvider } from 'src/decorators/error-codes-provider.decorator';\nimport { ErrorMeta, ErrorRule, IErrorCodeProvider } from 'src/interfaces';\n\n\n@ErrorCodeProvider()\n@Injectable()\nexport class SolidCoreErrorCodesProvider implements IErrorCodeProvider {\n name(): string {\n return 'SolidCoreErrorCodeProvider';\n }\n\n rules(): ReadonlyArray<ErrorRule> {\n return [\n {\n code: 'solidx-session-invalid',\n priority: 110,\n match: (txt) => txt.includes(ERROR_MESSAGES.SESSION_INVALID.toLowerCase()),\n meta: {\n message: ERROR_MESSAGES.SESSION_INVALID,\n httpStatus: 401,\n },\n },\n {\n code: 'solidx-session-expired',\n priority: 110,\n match: (txt) => txt.includes(ERROR_MESSAGES.SESSION_EXPIRED.toLowerCase()),\n meta: {\n message: ERROR_MESSAGES.SESSION_EXPIRED,\n httpStatus: 401,\n },\n },\n // MPIN rules sit above the generic session rules so that an MPIN\n // failure is never reported as a session problem. The three codes\n // drive three different client behaviours: retry, wait, and\n // discard-the-handle.\n {\n code: 'solidx-mpin-locked',\n priority: 120,\n match: (txt) => txt.includes(ERROR_MESSAGES.MPIN_LOCKED.toLowerCase()),\n meta: {\n message: ERROR_MESSAGES.MPIN_LOCKED,\n httpStatus: 401,\n },\n },\n {\n code: 'solidx-mpin-revoked',\n priority: 120,\n match: (txt) => txt.includes(ERROR_MESSAGES.MPIN_REVOKED.toLowerCase()),\n meta: {\n message: ERROR_MESSAGES.MPIN_REVOKED,\n httpStatus: 401,\n },\n },\n {\n code: 'solidx-mpin-invalid',\n priority: 120,\n match: (txt) => txt.includes(ERROR_MESSAGES.MPIN_INVALID.toLowerCase()),\n meta: {\n message: ERROR_MESSAGES.MPIN_INVALID,\n httpStatus: 401,\n },\n },\n // Setup-time rejections. Distinct codes so the client can say\n // \"choose a less predictable PIN\" rather than parsing a message.\n // Safe to distinguish: both occur only on bearer-authenticated\n // routes, so neither discloses anything.\n {\n code: 'solidx-mpin-too-predictable',\n priority: 120,\n match: (txt) => txt.includes(ERROR_MESSAGES.MPIN_TOO_PREDICTABLE.toLowerCase()),\n meta: {\n message: ERROR_MESSAGES.MPIN_TOO_PREDICTABLE,\n httpStatus: 400,\n },\n },\n {\n code: 'solidx-mpin-format-invalid',\n priority: 120,\n match: (txt) => txt.includes(ERROR_MESSAGES.MPIN_FORMAT_INVALID.toLowerCase()),\n meta: {\n message: ERROR_MESSAGES.MPIN_FORMAT_INVALID,\n httpStatus: 400,\n },\n },\n // Login extension rules sit at the same priority as the MPIN rules,\n // above the generic session rules, so a denial or an unavailable\n // check is never misreported as a session problem.\n {\n code: 'solidx-login-denied-by-extension',\n priority: 120,\n match: (txt) => txt.includes(ERROR_MESSAGES.LOGIN_DENIED_BY_EXTENSION.toLowerCase()),\n meta: {\n message: ERROR_MESSAGES.LOGIN_DENIED_BY_EXTENSION,\n httpStatus: 401,\n },\n },\n {\n code: 'solidx-login-extension-unavailable',\n priority: 120,\n match: (txt) => txt.includes(ERROR_MESSAGES.LOGIN_EXTENSION_UNAVAILABLE.toLowerCase()),\n meta: {\n message: ERROR_MESSAGES.LOGIN_EXTENSION_UNAVAILABLE,\n httpStatus: 503,\n },\n },\n {\n code: 'solidx-mcp-server-unavailable',\n priority: 100,\n match: (txt) =>\n txt.includes('all connection attempts failed') &&\n txt.includes('unhandled errors in a taskgroup (1 sub-exception)'),\n meta: {\n message: 'SolidX MCP server is unreachable. Please verify the MCP endpoint.',\n httpStatus: 503,\n },\n },\n {\n code: 'solidx-resource-not-found',\n priority: 95,\n match: (txt) => txt.includes('enoent') && txt.includes('no such file or directory'),\n meta: {\n message: ERROR_MESSAGES.RESOURCE_NOT_FOUND,\n httpStatus: 404,\n },\n },\n {\n code: 'solidx-db-duplicate-key',\n priority: 90,\n match: (txt) => txt.includes('unique constraint') || txt.includes('duplicate key'),\n meta: {\n message: 'Duplicate key violation. A record with these values already exists.',\n httpStatus: 409,\n },\n },\n {\n code: 'solidx-db-foreign-key-error',\n priority: 90,\n match: (txt) => txt.includes('violates foreign key'),\n meta: {\n message:\n 'Foreign key constraint prevents this operation due to related records.',\n httpStatus: 409,\n },\n },\n {\n code: 'solidx-unknown-error',\n priority: -1, // last resort\n match: (_txt) => true, // fallback catch-all\n meta: {\n message: 'An unexpected error occurred.',\n httpStatus: 500,\n },\n },\n ];\n }\n\n // Optional explicit meta resolution (if you want)\n resolve(code: string): ErrorMeta | undefined {\n const rule = this.rules().find((r) => r.code === code);\n return rule?.meta;\n }\n}\n"]}
|
|
@@ -6,7 +6,7 @@ import { CommonEntity } from '../entities/common.entity';
|
|
|
6
6
|
import { Locale } from '../entities/locale.entity';
|
|
7
7
|
import { SecurityRule } from '../entities/security-rule.entity';
|
|
8
8
|
import { IScheduledJob } from '../services/scheduled-jobs/scheduled-job.interface';
|
|
9
|
-
import { IDashboardWidgetDataProvider, IErrorCodeProvider, ISecurityRuleConfigProvider, ISelectionProvider, ISelectionProviderContext, ISolidDatabaseModule, IWorkflowFieldDataProvider } from "../interfaces";
|
|
9
|
+
import { IDashboardWidgetDataProvider, IErrorCodeProvider, ILoginExtensionProvider, ISecurityRuleConfigProvider, ISelectionProvider, ISelectionProviderContext, ISolidDatabaseModule, IWorkflowFieldDataProvider } from "../interfaces";
|
|
10
10
|
import { ObjectLiteral } from 'typeorm';
|
|
11
11
|
type ControllerMetadata = {
|
|
12
12
|
name: string;
|
|
@@ -77,10 +77,12 @@ export declare class SolidRegistry {
|
|
|
77
77
|
private securityRuleConfigProviders;
|
|
78
78
|
private errorCodeProviders;
|
|
79
79
|
private settingsProviders;
|
|
80
|
+
private loginExtensionProviders;
|
|
80
81
|
private auditableModels;
|
|
81
82
|
registerExtensionUserCreationProvider(provider: InstanceWrapper): void;
|
|
82
83
|
getExtensionUserCreationProvider<T extends User = User>(): IExtensionUserCreationProvider<T, any> | null;
|
|
83
84
|
registerErrorCodeProvider(errorCodeProvider: InstanceWrapper): void;
|
|
85
|
+
registerLoginExtensionProvider(loginExtensionProvider: InstanceWrapper): void;
|
|
84
86
|
registerWhatsappProvider(whatsappProvider: InstanceWrapper): void;
|
|
85
87
|
registerSmsProvider(smsProvider: InstanceWrapper): void;
|
|
86
88
|
registerSecurityRuleConfigProvider(securityRuleConfigProvider: InstanceWrapper): void;
|
|
@@ -116,6 +118,8 @@ export declare class SolidRegistry {
|
|
|
116
118
|
getDashboardWidgetDataProviderInstance(name: string): IDashboardWidgetDataProvider | undefined;
|
|
117
119
|
getErrorCodeProviders(): Array<InstanceWrapper>;
|
|
118
120
|
getErrorCodeProviderInstance(name: string): IErrorCodeProvider | undefined;
|
|
121
|
+
getLoginExtensionProviders(): Array<InstanceWrapper>;
|
|
122
|
+
getLoginExtensionProviderInstance(name: string): ILoginExtensionProvider | undefined;
|
|
119
123
|
getComputedFieldProviders(): Array<InstanceWrapper>;
|
|
120
124
|
getScheduledJobProviders(): Array<InstanceWrapper>;
|
|
121
125
|
getScheduledJobProviderInstance(name: string): IScheduledJob;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solid-registry.d.ts","sourceRoot":"","sources":["../../src/helpers/solid-registry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,e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MAAM,GAAG,OAAO;IAIpD,mBAAmB,IAAI,CAAC,MAAM,YAAY,GAAG,WAAW,GAAG,WAAW,CAAC,EAAE;IAMzE,8BAA8B,CAAC,CAAC,SAAS,yBAAyB,KAAK,kBAAkB,CAAC,CAAC,CAAC;CAQ7F"}
|
|
@@ -57,6 +57,7 @@ let SolidRegistry = SolidRegistry_1 = class SolidRegistry {
|
|
|
57
57
|
this.securityRuleConfigProviders = new Set();
|
|
58
58
|
this.errorCodeProviders = new Set();
|
|
59
59
|
this.settingsProviders = new Set();
|
|
60
|
+
this.loginExtensionProviders = new Set();
|
|
60
61
|
this.auditableModels = new Set();
|
|
61
62
|
}
|
|
62
63
|
registerExtensionUserCreationProvider(provider) {
|
|
@@ -72,6 +73,9 @@ let SolidRegistry = SolidRegistry_1 = class SolidRegistry {
|
|
|
72
73
|
registerErrorCodeProvider(errorCodeProvider) {
|
|
73
74
|
this.errorCodeProviders.add(errorCodeProvider);
|
|
74
75
|
}
|
|
76
|
+
registerLoginExtensionProvider(loginExtensionProvider) {
|
|
77
|
+
this.loginExtensionProviders.add(loginExtensionProvider);
|
|
78
|
+
}
|
|
75
79
|
registerWhatsappProvider(whatsappProvider) {
|
|
76
80
|
this.whatsappProviders.add(whatsappProvider);
|
|
77
81
|
}
|
|
@@ -215,6 +219,18 @@ let SolidRegistry = SolidRegistry_1 = class SolidRegistry {
|
|
|
215
219
|
}
|
|
216
220
|
return undefined;
|
|
217
221
|
}
|
|
222
|
+
getLoginExtensionProviders() {
|
|
223
|
+
return Array.from(this.loginExtensionProviders);
|
|
224
|
+
}
|
|
225
|
+
getLoginExtensionProviderInstance(name) {
|
|
226
|
+
const providers = this.getLoginExtensionProviders();
|
|
227
|
+
for (let i = 0; i < providers.length; i++) {
|
|
228
|
+
const p = providers[i];
|
|
229
|
+
if (p.instance?.name?.() === name)
|
|
230
|
+
return p.instance;
|
|
231
|
+
}
|
|
232
|
+
return undefined;
|
|
233
|
+
}
|
|
218
234
|
getComputedFieldProviders() {
|
|
219
235
|
return Array.from(this.computedFieldProviders);
|
|
220
236
|
}
|