@solidxai/core 0.1.5-beta.2 → 0.1.5-beta.4
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/dist/commands/info.command.d.ts +3 -1
- package/dist/commands/info.command.d.ts.map +1 -1
- package/dist/commands/info.command.js +6 -2
- package/dist/commands/info.command.js.map +1 -1
- package/dist/controllers/info.controller.d.ts +7 -0
- package/dist/controllers/info.controller.d.ts.map +1 -0
- package/dist/controllers/info.controller.js +39 -0
- package/dist/controllers/info.controller.js.map +1 -0
- package/dist/entities/ai-interaction.entity.d.ts.map +1 -1
- package/dist/entities/ai-interaction.entity.js +1 -1
- package/dist/entities/ai-interaction.entity.js.map +1 -1
- package/dist/entities/dashboard-question-sql-dataset-config.entity.d.ts.map +1 -1
- package/dist/entities/dashboard-question-sql-dataset-config.entity.js.map +1 -1
- package/dist/entities/dashboard-question.entity.d.ts.map +1 -1
- package/dist/entities/dashboard-question.entity.js.map +1 -1
- package/dist/entities/dashboard-variable.entity.d.ts.map +1 -1
- package/dist/entities/dashboard-variable.entity.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/interfaces.d.ts +1 -0
- package/dist/interfaces.d.ts.map +1 -1
- package/dist/interfaces.js.map +1 -1
- package/dist/seeders/seed-data/solid-core-metadata.json +1 -1
- package/dist/services/info.service.d.ts +18 -0
- package/dist/services/info.service.d.ts.map +1 -0
- package/dist/services/info.service.js +96 -0
- package/dist/services/info.service.js.map +1 -0
- package/dist/services/queues/rabbitmq-subscriber.service.d.ts.map +1 -1
- package/dist/services/queues/rabbitmq-subscriber.service.js +6 -1
- package/dist/services/queues/rabbitmq-subscriber.service.js.map +1 -1
- package/dist/solid-core.module.d.ts.map +1 -1
- package/dist/solid-core.module.js +4 -0
- package/dist/solid-core.module.js.map +1 -1
- package/dist/testing/runner/run-from-metadata.d.ts.map +1 -1
- package/dist/testing/runner/run-from-metadata.js +35 -2
- package/dist/testing/runner/run-from-metadata.js.map +1 -1
- package/package.json +1 -1
- package/src/commands/info.command.ts +3 -0
- package/src/controllers/info.controller.ts +15 -0
- package/src/entities/ai-interaction.entity.ts +17 -2
- package/src/entities/dashboard-question-sql-dataset-config.entity.ts +9 -1
- package/src/entities/dashboard-question.entity.ts +10 -0
- package/src/entities/dashboard-variable.entity.ts +9 -0
- package/src/index.ts +2 -0
- package/src/interfaces.ts +1 -0
- package/src/seeders/seed-data/solid-core-metadata.json +1 -1
- package/src/services/info.service.ts +60 -0
- package/src/services/queues/rabbitmq-subscriber.service.ts +7 -1
- package/src/solid-core.module.ts +4 -0
- package/src/testing/runner/run-from-metadata.ts +1 -1
|
@@ -1,8 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
36
|
exports.runFromMetadata = runFromMetadata;
|
|
4
37
|
const api_adapter_1 = require("../adapters/api/api-adapter");
|
|
5
|
-
const playwright_adapter_1 = require("../adapters/ui/playwright-adapter");
|
|
6
38
|
const api_1 = require("../steps/api");
|
|
7
39
|
const ui_1 = require("../steps/ui");
|
|
8
40
|
const assert_1 = require("../steps/assert");
|
|
@@ -50,7 +82,8 @@ async function runFromMetadata(opts) {
|
|
|
50
82
|
const resources = new resource_store_1.SimpleResourceStore();
|
|
51
83
|
const reporter = opts.reporter ?? new console_reporter_1.ConsoleReporter();
|
|
52
84
|
const api = new api_adapter_1.ApiAdapter(opts.api);
|
|
53
|
-
const
|
|
85
|
+
const { PlaywrightAdapter } = await Promise.resolve().then(() => __importStar(require("../adapters/ui/playwright-adapter")));
|
|
86
|
+
const ui = new PlaywrightAdapter(opts.ui);
|
|
54
87
|
const ctxBase = { resources, reporter, api, ui, specRegistry, testData, options: opts.options };
|
|
55
88
|
const uiStarted = { value: false };
|
|
56
89
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-from-metadata.js","sourceRoot":"","sources":["../../../src/testing/runner/run-from-metadata.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"run-from-metadata.js","sourceRoot":"","sources":["../../../src/testing/runner/run-from-metadata.ts"],"names":[],"mappings":";;;;;;;;;;;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AAW,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAC9C,CAAC;IACH,CAAC;YAAS,CAAC;QACT,IAAI,SAAS,CAAC,KAAK,EAAE,CAAC;YACpB,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC;QAClB,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["import type { Reporter } from \"../reporter/reporter.types\";\nimport type { TestingMetadata, TestingDataRecord } from \"../contracts/testing-metadata.types\";\nimport type { ApiAdapterOptions } from \"../adapters/api/api.types\";\nimport type { PlaywrightAdapterOptions } from \"../adapters/ui/ui.types\";\nimport { ApiAdapter } from \"../adapters/api/api-adapter\";\nimport { registerApiSteps } from \"../steps/api\";\nimport { registerUiSteps } from \"../steps/ui\";\nimport { registerAssertSteps } from \"../steps/assert\";\nimport { registerUtilSteps } from \"../steps/util\";\nimport { registerTestSteps } from \"../steps/test\";\nimport { SimpleResourceStore } from \"../core/resource-store\";\nimport { StepRegistry } from \"../core/step-registry\";\nimport { SpecRegistry } from \"../core/spec-registry\";\nimport { TestingEngine } from \"../core/testing-engine\";\nimport { filterScenarios } from \"./scenario-filter\";\nimport { ensureUiStarted, scenarioNeedsUi } from \"./lifecycle\";\nimport { ConsoleReporter } from \"../reporter/console-reporter\";\n\n\nfunction buildTestDataIndex(data?: TestingDataRecord[]): Record<string, Record<string, any>> {\n const index: Record<string, Record<string, any>> = {};\n if (!Array.isArray(data)) return index;\n for (const record of data) {\n if (!record?.modelUserKey || !record?.recUserKeyValue) continue;\n if (!index[record.modelUserKey]) {\n index[record.modelUserKey] = {};\n }\n index[record.modelUserKey][record.recUserKeyValue] = record.data ?? {};\n }\n return index;\n}\n\nexport type RunnerOptions = {\n metadata: TestingMetadata;\n scenarioIds?: string[];\n includeTags?: string[];\n skipScenarioIds?: string[];\n reporter?: Reporter;\n api?: ApiAdapterOptions;\n ui?: PlaywrightAdapterOptions;\n defaults?: { timeoutMs?: number; retries?: number };\n options?: { printApiLogs?: boolean };\n specs?: (registry: SpecRegistry) => void;\n};\n\nexport async function runFromMetadata(opts: RunnerOptions): Promise<void> {\n const registry = new StepRegistry();\n registerApiSteps(registry);\n registerUiSteps(registry);\n registerAssertSteps(registry);\n registerUtilSteps(registry);\n registerTestSteps(registry);\n\n const engine = new TestingEngine(registry, opts.defaults);\n const scenarios = filterScenarios(opts.metadata.testing.scenarios, {\n scenarioIds: opts.scenarioIds,\n includeTags: opts.includeTags,\n skipScenarioIds: opts.skipScenarioIds,\n });\n\n const specRegistry = new SpecRegistry();\n const testData = buildTestDataIndex(opts.metadata.testing?.data);\n if (opts.specs) {\n opts.specs(specRegistry);\n }\n\n const resources = new SimpleResourceStore();\n const reporter = opts.reporter ?? new ConsoleReporter();\n const api = new ApiAdapter(opts.api);\n const { PlaywrightAdapter } = await import(\"../adapters/ui/playwright-adapter\");\n const ui = new PlaywrightAdapter(opts.ui);\n const ctxBase = { resources, reporter, api, ui, specRegistry, testData, options: opts.options };\n const uiStarted = { value: false };\n\n try {\n for (const scenario of scenarios) {\n if (scenarioNeedsUi(scenario)) {\n await ensureUiStarted(ctxBase, uiStarted);\n }\n await engine.runScenario(scenario, ctxBase);\n }\n } finally {\n if (uiStarted.value) {\n await ui.stop();\n }\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solidxai/core",
|
|
3
|
-
"version": "0.1.5-beta.
|
|
3
|
+
"version": "0.1.5-beta.4",
|
|
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",
|
|
@@ -4,6 +4,7 @@ import { ISolidDatabaseModule } from 'src/interfaces';
|
|
|
4
4
|
import { getDynamicModuleNames } from 'src/helpers/module.helper';
|
|
5
5
|
import { SolidRegistry } from 'src/helpers/solid-registry';
|
|
6
6
|
import { SettingService } from 'src/services/setting.service';
|
|
7
|
+
import { InfoService } from 'src/services/info.service';
|
|
7
8
|
|
|
8
9
|
interface InfoCommandOptions {
|
|
9
10
|
detailed?: boolean;
|
|
@@ -16,6 +17,7 @@ export class InfoCommand extends CommandRunner {
|
|
|
16
17
|
constructor(
|
|
17
18
|
private readonly solidRegistry: SolidRegistry,
|
|
18
19
|
private readonly settingService: SettingService,
|
|
20
|
+
private readonly infoService: InfoService,
|
|
19
21
|
) {
|
|
20
22
|
super();
|
|
21
23
|
}
|
|
@@ -25,6 +27,7 @@ export class InfoCommand extends CommandRunner {
|
|
|
25
27
|
const dataSources = this.getDataSources();
|
|
26
28
|
|
|
27
29
|
const output: Record<string, any> = {
|
|
30
|
+
packages: this.infoService.getPackageVersions(),
|
|
28
31
|
modules: {
|
|
29
32
|
count: enabledModules.length,
|
|
30
33
|
names: enabledModules,
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Controller, Get } from '@nestjs/common';
|
|
2
|
+
import { ApiBearerAuth, ApiTags } from '@nestjs/swagger';
|
|
3
|
+
import { InfoService } from '../services/info.service';
|
|
4
|
+
|
|
5
|
+
@ApiTags('Solid Core')
|
|
6
|
+
@ApiBearerAuth('jwt')
|
|
7
|
+
@Controller('info')
|
|
8
|
+
export class InfoController {
|
|
9
|
+
constructor(private readonly infoService: InfoService) {}
|
|
10
|
+
|
|
11
|
+
@Get('/versions')
|
|
12
|
+
getVersions() {
|
|
13
|
+
return this.infoService.getPackageVersions();
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -5,38 +5,51 @@ import { User } from 'src/entities/user.entity'
|
|
|
5
5
|
@Entity("ss_ai_interactions")
|
|
6
6
|
export class AiInteraction extends CommonEntity {
|
|
7
7
|
@Index()
|
|
8
|
-
@ManyToOne(() => User, { nullable:
|
|
8
|
+
@ManyToOne(() => User, { nullable: true })
|
|
9
9
|
@JoinColumn()
|
|
10
10
|
user: User;
|
|
11
|
+
|
|
11
12
|
@Index()
|
|
12
13
|
@Column({ type: "varchar" })
|
|
13
14
|
threadId: string;
|
|
15
|
+
|
|
14
16
|
@Column({ type: "varchar" })
|
|
15
17
|
role: string;
|
|
18
|
+
|
|
16
19
|
@Column({ type: "text" })
|
|
17
20
|
message: string;
|
|
21
|
+
|
|
18
22
|
@Column({ type: "varchar", nullable: true })
|
|
19
23
|
contentType: string;
|
|
24
|
+
|
|
20
25
|
@Index()
|
|
21
26
|
@Column({ type: "varchar", nullable: true })
|
|
22
27
|
status: string;
|
|
28
|
+
|
|
23
29
|
@Column({ type: "text", nullable: true })
|
|
24
30
|
errorMessage: string;
|
|
31
|
+
|
|
25
32
|
@Column({ type: "varchar", nullable: true })
|
|
26
33
|
modelUsed: string;
|
|
34
|
+
|
|
27
35
|
@Column({ type: "integer", nullable: true })
|
|
28
36
|
responseTimeMs: number;
|
|
37
|
+
|
|
29
38
|
@Column({ type: "simple-json", nullable: true })
|
|
30
39
|
metadata: any;
|
|
40
|
+
|
|
31
41
|
@Column({ nullable: true, default: false })
|
|
32
42
|
isApplied: boolean = false;
|
|
43
|
+
|
|
33
44
|
@Index()
|
|
34
45
|
@ManyToOne(() => AiInteraction, { nullable: true })
|
|
35
46
|
@JoinColumn()
|
|
36
47
|
parentInteraction: AiInteraction;
|
|
48
|
+
|
|
37
49
|
@Index({ unique: true })
|
|
38
50
|
@Column({ type: "varchar" })
|
|
39
51
|
externalId: string;
|
|
52
|
+
|
|
40
53
|
@Column({ nullable: true, default: false })
|
|
41
54
|
isAutoApply: boolean = false;
|
|
42
55
|
|
|
@@ -48,8 +61,10 @@ export class AiInteraction extends CommonEntity {
|
|
|
48
61
|
|
|
49
62
|
@Column({ type: "integer", nullable: true })
|
|
50
63
|
totalTokens: number;
|
|
64
|
+
|
|
51
65
|
@Column({ type: "text", nullable: true })
|
|
52
66
|
originalMessage: string;
|
|
67
|
+
|
|
53
68
|
@Column({ nullable: true, default: false })
|
|
54
69
|
isEdited: boolean = false;
|
|
55
|
-
}
|
|
70
|
+
}
|
|
@@ -7,22 +7,30 @@ export class DashboardQuestionSqlDatasetConfig extends CommonEntity {
|
|
|
7
7
|
@Index({ unique: true })
|
|
8
8
|
@Column({ type: "varchar" })
|
|
9
9
|
datasetName: string;
|
|
10
|
+
|
|
10
11
|
@Column({ type: "varchar" })
|
|
11
12
|
datasetDisplayName: string;
|
|
13
|
+
|
|
12
14
|
@Column({ type: "text", nullable: true })
|
|
13
15
|
description: string;
|
|
16
|
+
|
|
14
17
|
@Column({ type: "text" })
|
|
15
18
|
sql: string;
|
|
19
|
+
|
|
16
20
|
@Column({ type: "varchar" })
|
|
17
21
|
labelColumnName: string;
|
|
22
|
+
|
|
18
23
|
@Column({ type: "varchar" })
|
|
19
24
|
valueColumnName: string;
|
|
25
|
+
|
|
20
26
|
@ManyToOne(() => DashboardQuestion, { nullable: false })
|
|
21
27
|
@JoinColumn()
|
|
22
28
|
question: DashboardQuestion;
|
|
29
|
+
|
|
23
30
|
@Column({ type: "text", nullable: true })
|
|
24
31
|
options: any;
|
|
32
|
+
|
|
25
33
|
@Index({ unique: true })
|
|
26
34
|
@Column({ type: "varchar", nullable: false })
|
|
27
35
|
externalId: string;
|
|
28
|
-
}
|
|
36
|
+
}
|
|
@@ -8,27 +8,37 @@ export class DashboardQuestion extends CommonEntity {
|
|
|
8
8
|
@Index({ unique: true })
|
|
9
9
|
@Column({ type: "varchar" })
|
|
10
10
|
name: string;
|
|
11
|
+
|
|
11
12
|
@Index()
|
|
12
13
|
@Column({})
|
|
13
14
|
sourceType: string;
|
|
15
|
+
|
|
14
16
|
@Index()
|
|
15
17
|
@Column({})
|
|
16
18
|
visualisedAs: string;
|
|
19
|
+
|
|
17
20
|
@Column({ type: "varchar", nullable: true })
|
|
18
21
|
providerName: string;
|
|
22
|
+
|
|
19
23
|
@ManyToOne(() => Dashboard, { nullable: true })
|
|
20
24
|
@JoinColumn()
|
|
21
25
|
dashboard: Dashboard;
|
|
26
|
+
|
|
22
27
|
@OneToMany(() => DashboardQuestionSqlDatasetConfig, dashboardQuestionSqlDatasetConfig => dashboardQuestionSqlDatasetConfig.question, { cascade: true })
|
|
23
28
|
questionSqlDatasetConfigs: DashboardQuestionSqlDatasetConfig[];
|
|
29
|
+
|
|
24
30
|
@Column({ type: "simple-json", nullable: true })
|
|
25
31
|
chartOptions: any;
|
|
32
|
+
|
|
26
33
|
@Column({ type: "text", nullable: true })
|
|
27
34
|
labelSql: string;
|
|
35
|
+
|
|
28
36
|
@Column({ type: "text", nullable: true })
|
|
29
37
|
kpiSql: string;
|
|
38
|
+
|
|
30
39
|
@Column({ type: "integer", nullable: true })
|
|
31
40
|
sequenceNumber: number;
|
|
41
|
+
|
|
32
42
|
@Index({ unique: true })
|
|
33
43
|
@Column({ type: "varchar", nullable: false })
|
|
34
44
|
externalId: string;
|
|
@@ -7,24 +7,33 @@ export class DashboardVariable extends CommonEntity {
|
|
|
7
7
|
@Index({ unique: true })
|
|
8
8
|
@Column({ type: "varchar" })
|
|
9
9
|
variableName: string;
|
|
10
|
+
|
|
10
11
|
@Index()
|
|
11
12
|
@Column({ type: "varchar" })
|
|
12
13
|
variableType: string;
|
|
14
|
+
|
|
13
15
|
@Column({ type: "simple-json", nullable: true })
|
|
14
16
|
selectionStaticValues: any;
|
|
17
|
+
|
|
15
18
|
@Column({ nullable: true })
|
|
16
19
|
selectionDynamicSourceType: string;
|
|
20
|
+
|
|
17
21
|
@Column({ type: "text", nullable: true })
|
|
18
22
|
selectionDynamicSQL: string;
|
|
23
|
+
|
|
19
24
|
@Column({ type: "varchar", nullable: true })
|
|
20
25
|
selectionDynamicProviderName: string;
|
|
26
|
+
|
|
21
27
|
@Column({ nullable: true, default: true })
|
|
22
28
|
isMultiSelect: boolean = true;
|
|
29
|
+
|
|
23
30
|
@ManyToOne(() => Dashboard, { nullable: true })
|
|
24
31
|
@JoinColumn()
|
|
25
32
|
dashboard: Dashboard;
|
|
33
|
+
|
|
26
34
|
@Column({ type: "text", nullable: true })
|
|
27
35
|
defaultValue: string;
|
|
36
|
+
|
|
28
37
|
@Column({ type: "varchar", nullable: true })
|
|
29
38
|
defaultOperator: string;
|
|
30
39
|
}
|
package/src/index.ts
CHANGED
|
@@ -264,6 +264,8 @@ export * from './services/user.service'
|
|
|
264
264
|
export * from './services/view-metadata.service'
|
|
265
265
|
export * from './services/whatsapp/Msg91WhatsappService' //rename
|
|
266
266
|
export * from './services/setting.service'
|
|
267
|
+
export * from './services/info.service'
|
|
268
|
+
export * from './controllers/info.controller'
|
|
267
269
|
export * from './services/settings/default-settings-provider.service'
|
|
268
270
|
export * from './services/security-rule.service'
|
|
269
271
|
export * from './services/request-context.service'
|
package/src/interfaces.ts
CHANGED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { Injectable, Logger } from '@nestjs/common';
|
|
2
|
+
import * as fs from 'fs';
|
|
3
|
+
import * as path from 'path';
|
|
4
|
+
|
|
5
|
+
interface PackageVersionInfo {
|
|
6
|
+
repo: 'local' | 'npm';
|
|
7
|
+
version: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface SolidVersionsInfo {
|
|
11
|
+
'solid-core': PackageVersionInfo;
|
|
12
|
+
'solid-core-ui': PackageVersionInfo;
|
|
13
|
+
'solid-code-builder': PackageVersionInfo;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@Injectable()
|
|
17
|
+
export class InfoService {
|
|
18
|
+
private readonly logger = new Logger(InfoService.name);
|
|
19
|
+
|
|
20
|
+
getPackageVersions(): SolidVersionsInfo {
|
|
21
|
+
return {
|
|
22
|
+
'solid-core': this.getPackageInfo('@solidxai/core'),
|
|
23
|
+
'solid-core-ui': this.getPackageInfo('@solidxai/core-ui'),
|
|
24
|
+
'solid-code-builder': this.getPackageInfo('@solidxai/code-builder'),
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
private getPackageInfo(packageName: string): PackageVersionInfo {
|
|
29
|
+
const result = this.resolvePackageJson(packageName);
|
|
30
|
+
if (result) return result;
|
|
31
|
+
|
|
32
|
+
const siblingUiPath = path.resolve(process.cwd(), '..', 'solid-ui', 'node_modules', packageName, 'package.json');
|
|
33
|
+
const siblingResult = this.readPackageJson(siblingUiPath);
|
|
34
|
+
if (siblingResult) return siblingResult;
|
|
35
|
+
|
|
36
|
+
this.logger.warn(`Could not resolve package: ${packageName}`);
|
|
37
|
+
return { repo: 'npm', version: 'not installed' };
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
private resolvePackageJson(packageName: string): PackageVersionInfo | null {
|
|
41
|
+
try {
|
|
42
|
+
const pkgJsonPath = require.resolve(`${packageName}/package.json`);
|
|
43
|
+
return this.readPackageJson(pkgJsonPath);
|
|
44
|
+
} catch {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
private readPackageJson(pkgJsonPath: string): PackageVersionInfo | null {
|
|
50
|
+
try {
|
|
51
|
+
if (!fs.existsSync(pkgJsonPath)) return null;
|
|
52
|
+
const pkgJson = JSON.parse(fs.readFileSync(pkgJsonPath, 'utf-8'));
|
|
53
|
+
const version = pkgJson.version ? `v${pkgJson.version}` : 'unknown';
|
|
54
|
+
const repo = pkgJsonPath.includes(path.sep + 'node_modules' + path.sep) ? 'npm' : 'local';
|
|
55
|
+
return { repo, version };
|
|
56
|
+
} catch {
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -97,6 +97,12 @@ export abstract class RabbitMqSubscriber<T> implements OnModuleInit, QueueSubscr
|
|
|
97
97
|
await this.cleanup();
|
|
98
98
|
this.logger.log(`RabbitMqSubscriber in connectAndConsume for queue: ${queueName} and url: ${this.url}`);
|
|
99
99
|
|
|
100
|
+
const options = this.options();
|
|
101
|
+
const prefetch = options.prefetch ?? 1;
|
|
102
|
+
if (prefetch < 1) {
|
|
103
|
+
throw new Error(`RabbitMqSubscriber prefetch must be >= 1 for queue ${queueName}`);
|
|
104
|
+
}
|
|
105
|
+
|
|
100
106
|
let connection: amqp.Connection;
|
|
101
107
|
try {
|
|
102
108
|
connection = await this.establishConnection();
|
|
@@ -133,7 +139,7 @@ export abstract class RabbitMqSubscriber<T> implements OnModuleInit, QueueSubscr
|
|
|
133
139
|
});
|
|
134
140
|
|
|
135
141
|
// Process one message at a time per consumer to avoid parallel work on the same subscriber instance.
|
|
136
|
-
await channel.prefetch(
|
|
142
|
+
await channel.prefetch(prefetch);
|
|
137
143
|
|
|
138
144
|
// Use a direct exchange with a stable routing key so retry DLX can route back to the main queue.
|
|
139
145
|
const exchangeName = `${queueName}.exchange`;
|
package/src/solid-core.module.ts
CHANGED
|
@@ -145,6 +145,8 @@ import { SavedFiltersController } from './controllers/saved-filters.controller';
|
|
|
145
145
|
import { ScheduledJobController } from './controllers/scheduled-job.controller';
|
|
146
146
|
import { SecurityRuleController } from './controllers/security-rule.controller';
|
|
147
147
|
import { SettingController } from './controllers/setting.controller';
|
|
148
|
+
import { InfoController } from './controllers/info.controller';
|
|
149
|
+
import { InfoService } from './services/info.service';
|
|
148
150
|
import { UserActivityHistoryController } from './controllers/user-activity-history.controller';
|
|
149
151
|
import { UserViewMetadataController } from './controllers/user-view-metadata.controller';
|
|
150
152
|
import { UserController } from './controllers/user.controller';
|
|
@@ -436,6 +438,7 @@ import { ListOfRolesSelectionProvider } from './services/selection-providers/lis
|
|
|
436
438
|
SecurityRuleController,
|
|
437
439
|
ServiceController,
|
|
438
440
|
SettingController,
|
|
441
|
+
InfoController,
|
|
439
442
|
SmsTemplateController,
|
|
440
443
|
TestController,
|
|
441
444
|
TestQueueController,
|
|
@@ -475,6 +478,7 @@ import { ListOfRolesSelectionProvider } from './services/selection-providers/lis
|
|
|
475
478
|
RefreshModelCommand,
|
|
476
479
|
RefreshModuleCommand,
|
|
477
480
|
InfoCommand,
|
|
481
|
+
InfoService,
|
|
478
482
|
SolidIntrospectService,
|
|
479
483
|
DiscoveryService,
|
|
480
484
|
R2RHelperService,
|
|
@@ -3,7 +3,6 @@ import type { TestingMetadata, TestingDataRecord } from "../contracts/testing-me
|
|
|
3
3
|
import type { ApiAdapterOptions } from "../adapters/api/api.types";
|
|
4
4
|
import type { PlaywrightAdapterOptions } from "../adapters/ui/ui.types";
|
|
5
5
|
import { ApiAdapter } from "../adapters/api/api-adapter";
|
|
6
|
-
import { PlaywrightAdapter } from "../adapters/ui/playwright-adapter";
|
|
7
6
|
import { registerApiSteps } from "../steps/api";
|
|
8
7
|
import { registerUiSteps } from "../steps/ui";
|
|
9
8
|
import { registerAssertSteps } from "../steps/assert";
|
|
@@ -68,6 +67,7 @@ export async function runFromMetadata(opts: RunnerOptions): Promise<void> {
|
|
|
68
67
|
const resources = new SimpleResourceStore();
|
|
69
68
|
const reporter = opts.reporter ?? new ConsoleReporter();
|
|
70
69
|
const api = new ApiAdapter(opts.api);
|
|
70
|
+
const { PlaywrightAdapter } = await import("../adapters/ui/playwright-adapter");
|
|
71
71
|
const ui = new PlaywrightAdapter(opts.ui);
|
|
72
72
|
const ctxBase = { resources, reporter, api, ui, specRegistry, testData, options: opts.options };
|
|
73
73
|
const uiStarted = { value: false };
|