@solidxai/core 0.1.20-beta.2 → 0.1.20-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/CHANGELOG.md +23 -0
- package/dist/controllers/chatter-message-archive.controller.d.ts +22 -0
- package/dist/controllers/chatter-message-archive.controller.d.ts.map +1 -0
- package/dist/controllers/chatter-message-archive.controller.js +69 -0
- package/dist/controllers/chatter-message-archive.controller.js.map +1 -0
- package/dist/controllers/module-package.controller.d.ts +493 -1
- package/dist/controllers/module-package.controller.d.ts.map +1 -1
- package/dist/controllers/module-package.controller.js +47 -3
- package/dist/controllers/module-package.controller.js.map +1 -1
- package/dist/decorators/chatter-message-archive-provider.decorator.d.ts +3 -0
- package/dist/decorators/chatter-message-archive-provider.decorator.d.ts.map +1 -0
- package/dist/decorators/chatter-message-archive-provider.decorator.js +8 -0
- package/dist/decorators/chatter-message-archive-provider.decorator.js.map +1 -0
- package/dist/dtos/confirm-module-package-import.dto.d.ts +2 -0
- package/dist/dtos/confirm-module-package-import.dto.d.ts.map +1 -1
- package/dist/dtos/confirm-module-package-import.dto.js +20 -1
- package/dist/dtos/confirm-module-package-import.dto.js.map +1 -1
- package/dist/dtos/create-module-metadata.dto.d.ts +1 -0
- package/dist/dtos/create-module-metadata.dto.d.ts.map +1 -1
- package/dist/dtos/create-module-metadata.dto.js +7 -1
- package/dist/dtos/create-module-metadata.dto.js.map +1 -1
- package/dist/dtos/export-module-package.dto.d.ts +7 -0
- package/dist/dtos/export-module-package.dto.d.ts.map +1 -0
- package/dist/dtos/export-module-package.dto.js +44 -0
- package/dist/dtos/export-module-package.dto.js.map +1 -0
- package/dist/dtos/run-module-package-seed.dto.d.ts +1 -0
- package/dist/dtos/run-module-package-seed.dto.d.ts.map +1 -1
- package/dist/dtos/run-module-package-seed.dto.js +11 -1
- package/dist/dtos/run-module-package-seed.dto.js.map +1 -1
- package/dist/dtos/validate-module-package-import.dto.d.ts +4 -0
- package/dist/dtos/validate-module-package-import.dto.d.ts.map +1 -0
- package/dist/dtos/validate-module-package-import.dto.js +30 -0
- package/dist/dtos/validate-module-package-import.dto.js.map +1 -0
- package/dist/entities/agent-registry.entity.js.map +1 -1
- package/dist/entities/module-metadata.entity.d.ts +1 -0
- package/dist/entities/module-metadata.entity.d.ts.map +1 -1
- package/dist/entities/module-metadata.entity.js +5 -1
- package/dist/entities/module-metadata.entity.js.map +1 -1
- package/dist/helpers/agent-required-inputs.d.ts.map +1 -1
- package/dist/helpers/agent-required-inputs.js +25 -1
- package/dist/helpers/agent-required-inputs.js.map +1 -1
- package/dist/helpers/bootstrap.helper.d.ts +1 -1
- package/dist/helpers/bootstrap.helper.d.ts.map +1 -1
- package/dist/helpers/bootstrap.helper.js +9 -3
- package/dist/helpers/bootstrap.helper.js.map +1 -1
- package/dist/helpers/solid-registry.d.ts +4 -0
- package/dist/helpers/solid-registry.d.ts.map +1 -1
- package/dist/helpers/solid-registry.js +11 -0
- package/dist/helpers/solid-registry.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/interfaces/chatter-message-archive.interface.d.ts +22 -0
- package/dist/interfaces/chatter-message-archive.interface.d.ts.map +1 -0
- package/dist/interfaces/chatter-message-archive.interface.js +3 -0
- package/dist/interfaces/chatter-message-archive.interface.js.map +1 -0
- package/dist/seeders/module-metadata-seeder.service.js +1 -1
- package/dist/seeders/module-metadata-seeder.service.js.map +1 -1
- package/dist/seeders/seed-data/solid-core-metadata.json +102 -10
- package/dist/services/agent-tool-registry.service.d.ts.map +1 -1
- package/dist/services/agent-tool-registry.service.js +10 -6
- package/dist/services/agent-tool-registry.service.js.map +1 -1
- package/dist/services/chatter-message-archive.service.d.ts +17 -0
- package/dist/services/chatter-message-archive.service.d.ts.map +1 -0
- package/dist/services/chatter-message-archive.service.js +82 -0
- package/dist/services/chatter-message-archive.service.js.map +1 -0
- package/dist/services/model-metadata.service.js +1 -1
- package/dist/services/model-metadata.service.js.map +1 -1
- package/dist/services/module-package.service.d.ts +162 -3
- package/dist/services/module-package.service.d.ts.map +1 -1
- package/dist/services/module-package.service.js +465 -18
- package/dist/services/module-package.service.js.map +1 -1
- package/dist/services/settings/default-settings-provider.service.d.ts +20 -0
- package/dist/services/settings/default-settings-provider.service.d.ts.map +1 -1
- package/dist/services/settings/default-settings-provider.service.js +11 -0
- package/dist/services/settings/default-settings-provider.service.js.map +1 -1
- package/dist/services/solid-introspect.service.d.ts.map +1 -1
- package/dist/services/solid-introspect.service.js +5 -0
- package/dist/services/solid-introspect.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/adapters/ui/playwright-adapter.d.ts +4 -0
- package/dist/testing/adapters/ui/playwright-adapter.d.ts.map +1 -1
- package/dist/testing/adapters/ui/playwright-adapter.js +35 -0
- package/dist/testing/adapters/ui/playwright-adapter.js.map +1 -1
- package/dist/testing/core/interpolation.d.ts.map +1 -1
- package/dist/testing/core/interpolation.js +38 -2
- package/dist/testing/core/interpolation.js.map +1 -1
- package/dist/testing/steps/ui/actions.step.d.ts.map +1 -1
- package/dist/testing/steps/ui/actions.step.js +40 -3
- package/dist/testing/steps/ui/actions.step.js.map +1 -1
- package/dist/testing/steps/ui/navigation.step.d.ts.map +1 -1
- package/dist/testing/steps/ui/navigation.step.js +39 -0
- package/dist/testing/steps/ui/navigation.step.js.map +1 -1
- package/package.json +4 -2
- package/src/controllers/chatter-message-archive.controller.ts +32 -0
- package/src/controllers/module-package.controller.ts +33 -1
- package/src/decorators/chatter-message-archive-provider.decorator.ts +4 -0
- package/src/dtos/confirm-module-package-import.dto.ts +17 -1
- package/src/dtos/create-module-metadata.dto.ts +5 -0
- package/src/dtos/export-module-package.dto.ts +23 -0
- package/src/dtos/run-module-package-seed.dto.ts +8 -0
- package/src/dtos/validate-module-package-import.dto.ts +11 -0
- package/src/entities/agent-registry.entity.ts +1 -1
- package/src/entities/module-metadata.entity.ts +3 -0
- package/src/helpers/agent-required-inputs.ts +18 -1
- package/src/helpers/bootstrap.helper.ts +15 -6
- package/src/helpers/solid-registry.ts +14 -0
- package/src/index.ts +3 -0
- package/src/interfaces/chatter-message-archive.interface.ts +22 -0
- package/src/seeders/module-metadata-seeder.service.ts +2 -2
- package/src/seeders/seed-data/solid-core-metadata.json +102 -10
- package/src/services/agent-tool-registry.service.ts +10 -6
- package/src/services/chatter-message-archive.service.ts +72 -0
- package/src/services/model-metadata.service.ts +1 -1
- package/src/services/module-package.service.ts +597 -14
- package/src/services/settings/default-settings-provider.service.ts +11 -0
- package/src/services/solid-introspect.service.ts +6 -0
- package/src/solid-core.module.ts +4 -0
- package/src/testing/adapters/ui/playwright-adapter.ts +44 -0
- package/src/testing/core/interpolation.ts +42 -2
- package/src/testing/steps/ui/actions.step.ts +52 -4
- package/src/testing/steps/ui/navigation.step.ts +56 -0
- package/.claude/settings.json +0 -17
- package/.claude/settings.local.json +0 -16
- package/CLAUDE.md +0 -26
|
@@ -22,6 +22,17 @@ const timeoutFromEnv = (value: string | undefined, fallback: number): number =>
|
|
|
22
22
|
// 1.
|
|
23
23
|
const getSolidCoreSettings = (isProd: boolean) =>
|
|
24
24
|
[
|
|
25
|
+
{
|
|
26
|
+
moduleName: "solid-core",
|
|
27
|
+
key: "CHATTER_MESSAGES_TO_ARCHIVE_AFTER_DAYS",
|
|
28
|
+
value: 180,
|
|
29
|
+
level: SettingLevel.SystemAdminEditable,
|
|
30
|
+
label: "Archive Chatter Messages After (Days)",
|
|
31
|
+
group: "chatter-settings",
|
|
32
|
+
sortOrder: 10,
|
|
33
|
+
controlType: "numeric",
|
|
34
|
+
helpText: "Messages older than this many days are moved to the configured chatter archive store. Set to 0 to archive all messages on the next run.",
|
|
35
|
+
},
|
|
25
36
|
{
|
|
26
37
|
moduleName: "solid-core",
|
|
27
38
|
key: "iamGoogleOAuthEnabled",
|
|
@@ -27,6 +27,7 @@ import { CRUDService } from './crud.service';
|
|
|
27
27
|
import { IS_SETTINGS_PROVIDER } from 'src/decorators/settings-provider.decorator';
|
|
28
28
|
import { IS_SMS_PROVIDER } from 'src/decorators/sms-provider.decorator';
|
|
29
29
|
import { SettingService } from 'src/services/setting.service';
|
|
30
|
+
import { IS_CHATTER_MESSAGE_ARCHIVE_PROVIDER } from 'src/decorators/chatter-message-archive-provider.decorator';
|
|
30
31
|
|
|
31
32
|
export const coreSubscriberClasses = [
|
|
32
33
|
AuditSubscriber,
|
|
@@ -158,6 +159,11 @@ export class SolidIntrospectService implements OnApplicationBootstrap {
|
|
|
158
159
|
this.solidRegistry.registerExtensionUserCreationProvider(provider);
|
|
159
160
|
});
|
|
160
161
|
|
|
162
|
+
const chatterArchiveProviders = this.discoveryService.getProviders().filter((provider) => {
|
|
163
|
+
return !!provider.instance && !!this.reflector.get<boolean>(IS_CHATTER_MESSAGE_ARCHIVE_PROVIDER, provider.instance.constructor);
|
|
164
|
+
});
|
|
165
|
+
chatterArchiveProviders.forEach(provider => this.solidRegistry.registerChatterMessageArchiveProvider(provider));
|
|
166
|
+
|
|
161
167
|
// Register the core subscribers against all the configured database modules / datasources
|
|
162
168
|
await this.bootstrapCoreTypeOrmSubscribers(solidDatabaseModules);
|
|
163
169
|
await this.cacheAuditableModels();
|
package/src/solid-core.module.ts
CHANGED
|
@@ -211,6 +211,7 @@ import { ScheduleModule } from "@nestjs/schedule";
|
|
|
211
211
|
import { ClsModule } from "nestjs-cls";
|
|
212
212
|
import { ChatterMessageDetailsController } from "./controllers/chatter-message-details.controller";
|
|
213
213
|
import { ChatterMessageController } from "./controllers/chatter-message.controller";
|
|
214
|
+
import { ChatterMessageArchiveController } from './controllers/chatter-message-archive.controller';
|
|
214
215
|
|
|
215
216
|
import { ExportTemplateController } from './controllers/export-template.controller';
|
|
216
217
|
import { ExportTransactionController } from './controllers/export-transaction.controller';
|
|
@@ -327,6 +328,7 @@ import { PermissionMetadataSeederService } from './seeders/permission-metadata-s
|
|
|
327
328
|
import { SystemFieldsSeederService } from './seeders/system-fields-seeder.service';
|
|
328
329
|
import { ChatterMessageDetailsService } from './services/chatter-message-details.service';
|
|
329
330
|
import { ChatterMessageService } from './services/chatter-message.service';
|
|
331
|
+
import { ChatterMessageArchiveService } from './services/chatter-message-archive.service';
|
|
330
332
|
import { ConcatComputedFieldProvider } from './services/computed-fields/concat-computed-field-provider.service';
|
|
331
333
|
import { AlphaNumExternalIdComputationProvider } from './services/computed-fields/entity/alpha-num-external-id-computed-field-provider';
|
|
332
334
|
import { ConcatEntityComputedFieldProvider } from './services/computed-fields/entity/concat-entity-computed-field-provider.service';
|
|
@@ -664,6 +666,7 @@ import { AgentToolRegistryService } from "./services/agent-tool-registry.service
|
|
|
664
666
|
ActionMetadataController,
|
|
665
667
|
AuthenticationController,
|
|
666
668
|
ChatterMessageController,
|
|
669
|
+
ChatterMessageArchiveController,
|
|
667
670
|
ChatterMessageDetailsController,
|
|
668
671
|
EmailTemplateController,
|
|
669
672
|
ExportTemplateController,
|
|
@@ -973,6 +976,7 @@ import { AgentToolRegistryService } from "./services/agent-tool-registry.service
|
|
|
973
976
|
RequestContextService,
|
|
974
977
|
SavedFiltersService,
|
|
975
978
|
ChatterMessageService,
|
|
979
|
+
ChatterMessageArchiveService,
|
|
976
980
|
ChatterMessageDetailsService,
|
|
977
981
|
LocaleService,
|
|
978
982
|
AuditSubscriber,
|
|
@@ -282,6 +282,50 @@ export class PlaywrightAdapter {
|
|
|
282
282
|
}
|
|
283
283
|
}
|
|
284
284
|
|
|
285
|
+
/**
|
|
286
|
+
* Multi-tab support. The onboarding flow needs a second site (the BI OTP portal)
|
|
287
|
+
* open at the same time as the in-progress SPA, without destroying it. Opening a
|
|
288
|
+
* new tab keeps the original page alive on the context; switching just re-points
|
|
289
|
+
* `this.page` so every existing ui.* step targets the active tab.
|
|
290
|
+
*/
|
|
291
|
+
async openTab(url?: string, timeoutMs?: number): Promise<void> {
|
|
292
|
+
if (!this.context) throw new Error("Cannot open a tab before the browser context is started.");
|
|
293
|
+
const page = await this.context.newPage();
|
|
294
|
+
this.attachCaptureListeners(page);
|
|
295
|
+
this.page = page;
|
|
296
|
+
if (url) {
|
|
297
|
+
await page.goto(this.resolveUrl(url), {
|
|
298
|
+
timeout: this.resolveNavigationTimeout(timeoutMs),
|
|
299
|
+
waitUntil: "domcontentloaded",
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
/** Switch the active page to the tab at `index` (0 = first/onboarding tab). */
|
|
305
|
+
switchTab(index: number): void {
|
|
306
|
+
if (!this.context) throw new Error("No browser context; cannot switch tabs.");
|
|
307
|
+
const pages = this.context.pages();
|
|
308
|
+
if (index < 0 || index >= pages.length) {
|
|
309
|
+
throw new Error(`switchTab: index ${index} out of range (open tabs: ${pages.length}).`);
|
|
310
|
+
}
|
|
311
|
+
this.page = pages[index];
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/** Number of currently open tabs. */
|
|
315
|
+
tabCount(): number {
|
|
316
|
+
return this.context ? this.context.pages().length : 0;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
/** Close the active tab and make the first remaining tab active. */
|
|
320
|
+
async closeTab(): Promise<void> {
|
|
321
|
+
if (!this.context || !this.page) return;
|
|
322
|
+
const current = this.page;
|
|
323
|
+
const pages = this.context.pages();
|
|
324
|
+
if (pages.length <= 1) return; // never close the last tab
|
|
325
|
+
await current.close();
|
|
326
|
+
this.page = this.context.pages()[0];
|
|
327
|
+
}
|
|
328
|
+
|
|
285
329
|
resolveUrl(url: string): string {
|
|
286
330
|
if (isAbsoluteUrl(url)) return url;
|
|
287
331
|
if (this.baseUrl) {
|
|
@@ -122,9 +122,49 @@ function resolveToken(token: string, ctx: TestContext): TokenResolution {
|
|
|
122
122
|
throw new Error(`Unknown interpolation token: "${token}"`);
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
+
// Apply an inline pipe transform to a resolved value.
|
|
126
|
+
// Supported: `path | match:REGEX` (returns capture group 1 if present, else the
|
|
127
|
+
// whole match) and `path | default:VALUE` (fallback when the match is empty).
|
|
128
|
+
function applyTransform(value: unknown, name: string, arg: string | undefined): unknown {
|
|
129
|
+
if (name === "match") {
|
|
130
|
+
if (!arg) throw new Error('Transform "match" requires a regex argument');
|
|
131
|
+
const str = typeof value === "string" ? value : JSON.stringify(value);
|
|
132
|
+
const re = new RegExp(arg);
|
|
133
|
+
const m = str.match(re);
|
|
134
|
+
if (!m) throw new Error(`Transform "match:${arg}" found no match in resolved value`);
|
|
135
|
+
return m[1] !== undefined ? m[1] : m[0];
|
|
136
|
+
}
|
|
137
|
+
if (name === "default") {
|
|
138
|
+
return value === undefined || value === null || value === "" ? arg : value;
|
|
139
|
+
}
|
|
140
|
+
throw new Error(`Unknown interpolation transform: "${name}"`);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// Split a token into its base (before the first `|`) and an ordered list of
|
|
144
|
+
// transforms. Each transform is `name:arg` (arg may itself contain `:`).
|
|
145
|
+
function resolveTokenWithTransforms(token: string, ctx: TestContext): TokenResolution {
|
|
146
|
+
const pipeIdx = token.indexOf("|");
|
|
147
|
+
if (pipeIdx === -1) {
|
|
148
|
+
return resolveToken(token, ctx);
|
|
149
|
+
}
|
|
150
|
+
const base = token.slice(0, pipeIdx).trim();
|
|
151
|
+
const rest = token.slice(pipeIdx + 1);
|
|
152
|
+
const resolved = resolveToken(base, ctx);
|
|
153
|
+
let value = resolved.value;
|
|
154
|
+
for (const rawTransform of rest.split("|")) {
|
|
155
|
+
const t = rawTransform.trim();
|
|
156
|
+
if (!t) continue;
|
|
157
|
+
const colon = t.indexOf(":");
|
|
158
|
+
const name = (colon === -1 ? t : t.slice(0, colon)).trim();
|
|
159
|
+
const arg = colon === -1 ? undefined : t.slice(colon + 1).trim();
|
|
160
|
+
value = applyTransform(value, name, arg);
|
|
161
|
+
}
|
|
162
|
+
return { value, raw: false };
|
|
163
|
+
}
|
|
164
|
+
|
|
125
165
|
export function interpolateString(input: string, ctx: TestContext): string {
|
|
126
166
|
return input.replace(TOKEN_REGEX, (_match, token: string) => {
|
|
127
|
-
const resolved =
|
|
167
|
+
const resolved = resolveTokenWithTransforms(token, ctx);
|
|
128
168
|
return typeof resolved.value === "string"
|
|
129
169
|
? resolved.value
|
|
130
170
|
: JSON.stringify(resolved.value);
|
|
@@ -135,7 +175,7 @@ export function interpolateDeep<T>(input: T, ctx: TestContext): T {
|
|
|
135
175
|
if (typeof input === "string") {
|
|
136
176
|
const tokenMatch = input.match(/^\$\{([^}]+)\}$/);
|
|
137
177
|
if (tokenMatch) {
|
|
138
|
-
const resolved =
|
|
178
|
+
const resolved = resolveTokenWithTransforms(tokenMatch[1], ctx);
|
|
139
179
|
if (resolved.raw) {
|
|
140
180
|
return resolved.value as T;
|
|
141
181
|
}
|
|
@@ -2,8 +2,9 @@ import type { TestContext } from "../../contracts/runtime-context.types";
|
|
|
2
2
|
import type { OpStep } from "../../contracts/testing-metadata.types";
|
|
3
3
|
import { StepRegistry } from "../../core/step-registry";
|
|
4
4
|
|
|
5
|
-
type ClickInput = { selector: string; timeoutMs?: number };
|
|
5
|
+
type ClickInput = { selector: string; timeoutMs?: number; optional?: boolean; force?: boolean; js?: boolean };
|
|
6
6
|
type PressInput = { selector: string; key: string; timeoutMs?: number };
|
|
7
|
+
type TypeInput = { selector: string; value: string; delayMs?: number; clear?: boolean; timeoutMs?: number };
|
|
7
8
|
|
|
8
9
|
function requirePage(ctx: TestContext, op: string) {
|
|
9
10
|
if (!ctx.ui || !ctx.ui.page) {
|
|
@@ -19,9 +20,32 @@ export function registerActionSteps(registry: StepRegistry): void {
|
|
|
19
20
|
if (!input.selector) {
|
|
20
21
|
throw new Error('Missing "selector" in step.with for op "ui.click"');
|
|
21
22
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
// `optional: true` lets a step dismiss a maybe-present element (e.g. an
|
|
24
|
+
// intermittent popup): if the element never appears/clicks in time, swallow
|
|
25
|
+
// the error instead of failing the scenario.
|
|
26
|
+
try {
|
|
27
|
+
// `js: true` invokes the element's native .click() in page context — the last
|
|
28
|
+
// resort for a button a real click can't reach (e.g. a fixed drawer rendered
|
|
29
|
+
// outside the viewport in headless). Waits for it to be attached first.
|
|
30
|
+
if (input.js) {
|
|
31
|
+
const loc = page.locator(input.selector).first();
|
|
32
|
+
await loc.waitFor({ state: "attached", timeout: ctx.ui?.resolveTimeout(input.timeoutMs) });
|
|
33
|
+
await loc.evaluate((el: any) => el.click());
|
|
34
|
+
} else if (input.force) {
|
|
35
|
+
// `force: true` bypasses actionability checks (e.g. an overlay intercepting
|
|
36
|
+
// pointer events on a drawer/sheet button). Playwright's force still refuses
|
|
37
|
+
// to click an element outside the viewport, so scroll it into view first.
|
|
38
|
+
const loc = page.locator(input.selector).first();
|
|
39
|
+
await loc.scrollIntoViewIfNeeded({ timeout: ctx.ui?.resolveTimeout(input.timeoutMs) });
|
|
40
|
+
await loc.click({ timeout: ctx.ui?.resolveTimeout(input.timeoutMs), force: true });
|
|
41
|
+
} else {
|
|
42
|
+
await page.click(input.selector, {
|
|
43
|
+
timeout: ctx.ui?.resolveTimeout(input.timeoutMs),
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
} catch (err) {
|
|
47
|
+
if (!input.optional) throw err;
|
|
48
|
+
}
|
|
25
49
|
});
|
|
26
50
|
|
|
27
51
|
registry.register("ui.press", async (ctx: TestContext, step: OpStep) => {
|
|
@@ -37,4 +61,28 @@ export function registerActionSteps(registry: StepRegistry): void {
|
|
|
37
61
|
timeout: ctx.ui?.resolveTimeout(input.timeoutMs),
|
|
38
62
|
});
|
|
39
63
|
});
|
|
64
|
+
|
|
65
|
+
// Type a value character-by-character with real keystrokes (keydown/input/keyup
|
|
66
|
+
// per char), unlike ui.fill which sets the value in one shot. Needed for inputs
|
|
67
|
+
// whose framework validation only re-runs on genuine keystroke events. `clear`
|
|
68
|
+
// (default true) empties the field first.
|
|
69
|
+
registry.register("ui.type", async (ctx: TestContext, step: OpStep) => {
|
|
70
|
+
const page = requirePage(ctx, "ui.type");
|
|
71
|
+
const input = (step.with ?? {}) as TypeInput;
|
|
72
|
+
if (!input.selector) {
|
|
73
|
+
throw new Error('Missing "selector" in step.with for op "ui.type"');
|
|
74
|
+
}
|
|
75
|
+
if (input.value === undefined || input.value === null) {
|
|
76
|
+
throw new Error('Missing "value" in step.with for op "ui.type"');
|
|
77
|
+
}
|
|
78
|
+
const timeout = ctx.ui?.resolveTimeout(input.timeoutMs);
|
|
79
|
+
const locator = page.locator(input.selector);
|
|
80
|
+
if (input.clear !== false) {
|
|
81
|
+
await locator.fill("", { timeout });
|
|
82
|
+
}
|
|
83
|
+
await locator.pressSequentially(String(input.value), {
|
|
84
|
+
delay: input.delayMs ?? 30,
|
|
85
|
+
timeout,
|
|
86
|
+
});
|
|
87
|
+
});
|
|
40
88
|
}
|
|
@@ -4,6 +4,9 @@ import { StepRegistry } from "../../core/step-registry";
|
|
|
4
4
|
|
|
5
5
|
type GotoInput = { url: string; timeoutMs?: number };
|
|
6
6
|
type ExpectUrlInput = { equals?: string; contains?: string; timeoutMs?: number };
|
|
7
|
+
type NewTabInput = { url?: string; timeoutMs?: number };
|
|
8
|
+
type SwitchTabInput = { index: number };
|
|
9
|
+
type StoreTextInput = { selector: string; match?: string; timeoutMs?: number; readValue?: boolean };
|
|
7
10
|
|
|
8
11
|
function requirePage(ctx: TestContext, op: string) {
|
|
9
12
|
if (!ctx.ui || !ctx.ui.page) {
|
|
@@ -56,4 +59,57 @@ export function registerNavigationSteps(registry: StepRegistry): void {
|
|
|
56
59
|
);
|
|
57
60
|
}
|
|
58
61
|
});
|
|
62
|
+
|
|
63
|
+
// Open a new tab (optionally navigating it) and make it the active page. The
|
|
64
|
+
// previous tab stays alive on the context, so a long-running SPA flow is not
|
|
65
|
+
// destroyed while we visit another site (e.g. to read an OTP).
|
|
66
|
+
registry.register("ui.newTab", async (ctx: TestContext, step: OpStep) => {
|
|
67
|
+
if (!ctx.ui) throw new Error('Missing UI adapter on context for op "ui.newTab"');
|
|
68
|
+
const input = (step.with ?? {}) as NewTabInput;
|
|
69
|
+
await ctx.ui.openTab(input.url, input.timeoutMs);
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
// Switch the active tab. `index` 0 is the first/original (onboarding) tab.
|
|
73
|
+
registry.register("ui.switchTab", async (ctx: TestContext, step: OpStep) => {
|
|
74
|
+
if (!ctx.ui) throw new Error('Missing UI adapter on context for op "ui.switchTab"');
|
|
75
|
+
const input = (step.with ?? {}) as SwitchTabInput;
|
|
76
|
+
if (input.index === undefined || input.index === null) {
|
|
77
|
+
throw new Error('Missing "index" in step.with for op "ui.switchTab"');
|
|
78
|
+
}
|
|
79
|
+
ctx.ui.switchTab(Number(input.index));
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
// Close the active tab and make the first remaining tab active. Never closes
|
|
83
|
+
// the last tab. Use after reading data from a secondary tab (e.g. the OTP portal).
|
|
84
|
+
registry.register("ui.closeTab", async (ctx: TestContext) => {
|
|
85
|
+
if (!ctx.ui) throw new Error('Missing UI adapter on context for op "ui.closeTab"');
|
|
86
|
+
await ctx.ui.closeTab();
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
// Read a selector's visible text and RETURN it, so `saveAs` can capture it into
|
|
90
|
+
// ${res:...}. With `match`, returns capture group 1 (else the whole match) of the
|
|
91
|
+
// regex applied to the text — e.g. pull a 4-digit OTP out of an SMS row.
|
|
92
|
+
registry.register("ui.storeText", async (ctx: TestContext, step: OpStep) => {
|
|
93
|
+
const page = requirePage(ctx, "ui.storeText");
|
|
94
|
+
const input = (step.with ?? {}) as StoreTextInput;
|
|
95
|
+
if (!input.selector) {
|
|
96
|
+
throw new Error('Missing "selector" in step.with for op "ui.storeText"');
|
|
97
|
+
}
|
|
98
|
+
// `readValue: true` reads an <input>/<textarea>/<select> current value via
|
|
99
|
+
// inputValue() instead of innerText() — innerText is empty for form controls.
|
|
100
|
+
const loc = page.locator(input.selector).first();
|
|
101
|
+
const text = input.readValue
|
|
102
|
+
? await loc.inputValue({ timeout: ctx.ui?.resolveTimeout(input.timeoutMs) })
|
|
103
|
+
: await loc.innerText({ timeout: ctx.ui?.resolveTimeout(input.timeoutMs) });
|
|
104
|
+
if (input.match) {
|
|
105
|
+
const m = text.match(new RegExp(input.match));
|
|
106
|
+
if (!m) {
|
|
107
|
+
throw new Error(
|
|
108
|
+
`ui.storeText: regex "${input.match}" found no match in text "${text.slice(0, 120)}"`,
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
return m[1] !== undefined ? m[1] : m[0];
|
|
112
|
+
}
|
|
113
|
+
return text;
|
|
114
|
+
});
|
|
59
115
|
}
|
package/.claude/settings.json
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"permissions": {
|
|
3
|
-
"allow": [
|
|
4
|
-
"WebFetch(domain:api.github.com)",
|
|
5
|
-
"Read(//Users/oswald/projects/Solid_Starters/solid-core-ui/**)",
|
|
6
|
-
"Bash(grep -E \"\\\\.md|\\\\.json|\\\\.config|\\\\.ts$|\\\\.js$\")",
|
|
7
|
-
"Bash(xargs basename -a)",
|
|
8
|
-
"Read(//Users/oswald/projects/Solid_Starters/solid-code-builder/**)",
|
|
9
|
-
"Bash(grep -E \"\\\\.\\(md|json\\)$|^d\")",
|
|
10
|
-
"Bash(ls -la /Users/oswald/projects/Solid_Starters/solid-code-builder/*.json)"
|
|
11
|
-
],
|
|
12
|
-
"additionalDirectories": [
|
|
13
|
-
"/Users/oswald/projects/Solid_Starters/solid-core-ui",
|
|
14
|
-
"/Users/oswald/projects/Solid_Starters/solid-code-builder"
|
|
15
|
-
]
|
|
16
|
-
}
|
|
17
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"permissions": {
|
|
3
|
-
"allow": [
|
|
4
|
-
"Bash(node -e:*)",
|
|
5
|
-
"WebFetch(domain:docs.solidxai.com)",
|
|
6
|
-
"WebFetch(domain:github.com)",
|
|
7
|
-
"Read(//Users/oswald/projects/Solid_Starters/solidctl/**)",
|
|
8
|
-
"Read(//Users/oswald/projects/Solid_Starters/**)",
|
|
9
|
-
"Bash(find /Users/oswald/projects/Solid_Starters/solid-core-module -type d -name migration* -o -name *database*)",
|
|
10
|
-
"Bash(node verify-imports.js)"
|
|
11
|
-
],
|
|
12
|
-
"additionalDirectories": [
|
|
13
|
-
"/Users/oswald/projects/Solid_Starters/solidctl"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
16
|
-
}
|
package/CLAUDE.md
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
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
|