@medyll/idae-machine 0.136.2 → 0.136.5
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/config.d.ts
CHANGED
|
@@ -14,4 +14,4 @@ export declare const API_URL: string;
|
|
|
14
14
|
* Available organizations/tenants. Centralized here to avoid hardcoding in multiple places.
|
|
15
15
|
* This list should be kept in sync with the actual available organizations in the system.
|
|
16
16
|
*/
|
|
17
|
-
export declare const ORGS: readonly ["
|
|
17
|
+
export declare const ORGS: readonly ["demo", "crfr", "idaenext", "tactac", "latent"];
|
package/dist/config.js
CHANGED
|
@@ -16,4 +16,4 @@ export const API_URL = import.meta.env.PUBLIC_API_URL ??
|
|
|
16
16
|
* Available organizations/tenants. Centralized here to avoid hardcoding in multiple places.
|
|
17
17
|
* This list should be kept in sync with the actual available organizations in the system.
|
|
18
18
|
*/
|
|
19
|
-
export const ORGS = ['
|
|
19
|
+
export const ORGS = ['demo', 'crfr', 'idaenext', 'tactac', 'latent'];
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* groupFieldBy → HOW to group them (looked up in appscheme_field, grouped on its FK)
|
|
10
10
|
*/
|
|
11
11
|
export declare function useViewFields(collection: () => string | undefined, view: () => string | undefined, groupFieldBy?: () => string | undefined): {
|
|
12
|
-
readonly fieldNames:
|
|
12
|
+
readonly fieldNames: string[];
|
|
13
13
|
readonly fieldKinds: Record<string, {
|
|
14
14
|
kind: "scalar" | "fk";
|
|
15
15
|
fieldName: string;
|
|
@@ -336,8 +336,9 @@ undefined client-side. publishModel writes both the flags and the equivalent
|
|
|
336
336
|
</space-header-recent>
|
|
337
337
|
{/if}
|
|
338
338
|
|
|
339
|
-
|
|
340
|
-
|
|
339
|
+
<space-overview>
|
|
340
|
+
{#if classificationPanels.some((p) => p.options.length)}
|
|
341
|
+
<space-classifications>
|
|
341
342
|
{#each classificationPanels as panel (panel.fkName)}
|
|
342
343
|
{#if panel.options.length}
|
|
343
344
|
<Tile title={panel.fkName}>
|
|
@@ -352,11 +353,11 @@ undefined client-side. publishModel writes both the flags and the equivalent
|
|
|
352
353
|
</Tile>
|
|
353
354
|
{/if}
|
|
354
355
|
{/each}
|
|
355
|
-
|
|
356
|
-
|
|
356
|
+
</space-classifications>
|
|
357
|
+
{/if}
|
|
357
358
|
|
|
358
|
-
|
|
359
|
-
|
|
359
|
+
{#if forwardFkPanels.length}
|
|
360
|
+
<space-repartitions>
|
|
360
361
|
{#each forwardFkPanels as panel (panel.fkName)}
|
|
361
362
|
<Tile
|
|
362
363
|
title={panel.meta?.name ?? panel.targetCollection}
|
|
@@ -372,30 +373,11 @@ undefined client-side. publishModel writes both the flags and the equivalent
|
|
|
372
373
|
{/if}
|
|
373
374
|
</Tile>
|
|
374
375
|
{/each}
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
{#if seeAlsoGroups.length}
|
|
379
|
-
<space-see-also>
|
|
380
|
-
<Tile title="Voir aussi">
|
|
381
|
-
{#each seeAlsoGroups as group (group.key)}
|
|
382
|
-
<space-see-also-group>
|
|
383
|
-
<h4>{group.label}</h4>
|
|
384
|
-
{#each group.items as item (item.collection)}
|
|
385
|
-
<button type="button" class="space-see-also-item" onclick={() => openSpace(item.collection)}>
|
|
386
|
-
{#if item.icon}<Icon icon={item.icon} />{/if}
|
|
387
|
-
{item.name}
|
|
388
|
-
<DataCount collection={item.collection} />
|
|
389
|
-
</button>
|
|
390
|
-
{/each}
|
|
391
|
-
</space-see-also-group>
|
|
392
|
-
{/each}
|
|
393
|
-
</Tile>
|
|
394
|
-
</space-see-also>
|
|
395
|
-
{/if}
|
|
376
|
+
</space-repartitions>
|
|
377
|
+
{/if}
|
|
396
378
|
|
|
397
|
-
|
|
398
|
-
|
|
379
|
+
{#if dateFieldsStatic.length}
|
|
380
|
+
<space-periods>
|
|
399
381
|
<Tile title="Périodes">
|
|
400
382
|
{#snippet header()}
|
|
401
383
|
<select class="form-select" bind:value={periodField}>
|
|
@@ -408,19 +390,43 @@ undefined client-side. publishModel writes both the flags and the equivalent
|
|
|
408
390
|
<InfoLine label={period.label} value={period.count} />
|
|
409
391
|
{/each}
|
|
410
392
|
</Tile>
|
|
411
|
-
|
|
412
|
-
|
|
393
|
+
</space-periods>
|
|
394
|
+
{/if}
|
|
395
|
+
</space-overview>
|
|
396
|
+
|
|
397
|
+
<!-- app_explorer_home: central list with reverse relations alongside it. -->
|
|
398
|
+
<space-workspace>
|
|
399
|
+
<space-list>
|
|
400
|
+
<DataList
|
|
401
|
+
{collection}
|
|
402
|
+
where={listWhere}
|
|
403
|
+
{prefsScope}
|
|
404
|
+
sortBy={logicScheme?.defaultSort}
|
|
405
|
+
link="loadInDialog:fiche"
|
|
406
|
+
pageSize={30}
|
|
407
|
+
/>
|
|
408
|
+
</space-list>
|
|
409
|
+
|
|
410
|
+
{#if seeAlsoGroups.length}
|
|
411
|
+
<space-related>
|
|
412
|
+
<Tile title="Voir aussi">
|
|
413
|
+
{#each seeAlsoGroups as group (group.key)}
|
|
414
|
+
<space-see-also-group>
|
|
415
|
+
<h4>{group.label}</h4>
|
|
416
|
+
{#each group.items as item (item.collection)}
|
|
417
|
+
<button type="button" class="space-see-also-item" onclick={() => openSpace(item.collection)}>
|
|
418
|
+
{#if item.icon}<Icon icon={item.icon} />{/if}
|
|
419
|
+
{item.name}
|
|
420
|
+
<DataCount collection={item.collection} />
|
|
421
|
+
</button>
|
|
422
|
+
{/each}
|
|
423
|
+
</space-see-also-group>
|
|
424
|
+
{/each}
|
|
425
|
+
</Tile>
|
|
426
|
+
</space-related>
|
|
427
|
+
{/if}
|
|
428
|
+
</space-workspace>
|
|
413
429
|
|
|
414
|
-
<space-list>
|
|
415
|
-
<DataList
|
|
416
|
-
{collection}
|
|
417
|
-
where={listWhere}
|
|
418
|
-
{prefsScope}
|
|
419
|
-
sortBy={logicScheme?.defaultSort}
|
|
420
|
-
link="loadInDialog:fiche"
|
|
421
|
-
pageSize={30}
|
|
422
|
-
/>
|
|
423
|
-
</space-list>
|
|
424
430
|
</space-main>
|
|
425
431
|
|
|
426
432
|
<space-search>
|
|
@@ -444,14 +450,15 @@ undefined client-side. publishModel writes both the flags and the equivalent
|
|
|
444
450
|
grid-template-columns: 1fr minmax(calc(var(--gutter-3xl) * 4), calc(var(--gutter-3xl) * 5.5));
|
|
445
451
|
gap: var(--gutter-sm);
|
|
446
452
|
padding: var(--pad-sm);
|
|
447
|
-
|
|
448
|
-
|
|
453
|
+
min-block-size: 100%;
|
|
454
|
+
overflow: hidden;
|
|
449
455
|
}
|
|
450
456
|
space-main {
|
|
451
457
|
display: flex;
|
|
452
458
|
flex-direction: column;
|
|
453
459
|
gap: var(--gutter-sm);
|
|
454
460
|
min-width: 0;
|
|
461
|
+
min-block-size: 0;
|
|
455
462
|
}
|
|
456
463
|
space-header {
|
|
457
464
|
display: flex;
|
|
@@ -491,6 +498,11 @@ undefined client-side. publishModel writes both the flags and the equivalent
|
|
|
491
498
|
grid-template-columns: repeat(auto-fit, minmax(calc(var(--gutter-3xl) * 4), 1fr));
|
|
492
499
|
gap: var(--gutter-sm);
|
|
493
500
|
}
|
|
501
|
+
space-overview {
|
|
502
|
+
display: flex;
|
|
503
|
+
flex-direction: column;
|
|
504
|
+
gap: var(--gutter-sm);
|
|
505
|
+
}
|
|
494
506
|
.space-fk-count {
|
|
495
507
|
font-weight: var(--font-semibold);
|
|
496
508
|
}
|
|
@@ -501,8 +513,16 @@ undefined client-side. publishModel writes both the flags and the equivalent
|
|
|
501
513
|
color: var(--color-critical);
|
|
502
514
|
font-size: var(--text-sm);
|
|
503
515
|
}
|
|
504
|
-
space-
|
|
516
|
+
space-workspace {
|
|
517
|
+
display: grid;
|
|
518
|
+
grid-template-columns: minmax(0, 1fr) minmax(calc(var(--gutter-3xl) * 4), calc(var(--gutter-3xl) * 5.5));
|
|
519
|
+
gap: var(--gutter-sm);
|
|
520
|
+
flex: 1;
|
|
521
|
+
min-block-size: 0;
|
|
522
|
+
}
|
|
523
|
+
space-related {
|
|
505
524
|
display: block;
|
|
525
|
+
overflow: auto;
|
|
506
526
|
}
|
|
507
527
|
space-see-also-group {
|
|
508
528
|
display: flex;
|
|
@@ -533,6 +553,7 @@ undefined client-side. publishModel writes both the flags and the equivalent
|
|
|
533
553
|
space-list {
|
|
534
554
|
display: block;
|
|
535
555
|
min-block-size: 0;
|
|
556
|
+
overflow: auto;
|
|
536
557
|
}
|
|
537
558
|
space-search {
|
|
538
559
|
display: flex;
|
|
@@ -544,6 +565,7 @@ undefined client-side. publishModel writes both the flags and the equivalent
|
|
|
544
565
|
border: var(--border-width) solid var(--color-border);
|
|
545
566
|
border-radius: var(--radius-xs);
|
|
546
567
|
background: var(--color-surface-alt);
|
|
568
|
+
overflow: auto;
|
|
547
569
|
}
|
|
548
570
|
space-search-fk-filters {
|
|
549
571
|
display: flex;
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"bin": {
|
|
5
5
|
"idae-machine": "./cli.cjs"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.136.
|
|
7
|
+
"version": "0.136.5",
|
|
8
8
|
"files": [
|
|
9
9
|
"dist",
|
|
10
10
|
"!dist/**/*.test.*",
|
|
@@ -35,37 +35,37 @@
|
|
|
35
35
|
"directory": "."
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@eslint/compat": "^2.0
|
|
38
|
+
"@eslint/compat": "^2.1.0",
|
|
39
39
|
"@eslint/js": "^10.0.1",
|
|
40
|
-
"@playwright/test": "^1.
|
|
41
|
-
"@semantic-release/github": "^12.0.
|
|
40
|
+
"@playwright/test": "^1.62.1",
|
|
41
|
+
"@semantic-release/github": "^12.0.9",
|
|
42
42
|
"@sveltejs/adapter-auto": "^7.0.1",
|
|
43
|
-
"@sveltejs/kit": "^2.
|
|
44
|
-
"@sveltejs/package": "^2.5.
|
|
45
|
-
"@sveltejs/vite-plugin-svelte": "^7.
|
|
46
|
-
"@testing-library/jest-dom": "^
|
|
47
|
-
"@testing-library/svelte": "^5.
|
|
48
|
-
"eslint": "^10.
|
|
43
|
+
"@sveltejs/kit": "^2.70.2",
|
|
44
|
+
"@sveltejs/package": "^2.5.8",
|
|
45
|
+
"@sveltejs/vite-plugin-svelte": "^7.2.0",
|
|
46
|
+
"@testing-library/jest-dom": "^7.0.0",
|
|
47
|
+
"@testing-library/svelte": "^5.4.2",
|
|
48
|
+
"eslint": "^10.8.0",
|
|
49
49
|
"eslint-config-prettier": "^10.1.8",
|
|
50
|
-
"eslint-plugin-svelte": "^3.
|
|
50
|
+
"eslint-plugin-svelte": "^3.22.0",
|
|
51
51
|
"fake-indexeddb": "^6.2.5",
|
|
52
|
-
"globals": "^17.
|
|
53
|
-
"jsdom": "^29.
|
|
54
|
-
"mongodb": "^7.
|
|
55
|
-
"prettier": "^3.
|
|
56
|
-
"prettier-plugin-svelte": "^
|
|
57
|
-
"publint": "^0.3.
|
|
58
|
-
"svelte": "^5.
|
|
59
|
-
"svelte-check": "^4.4
|
|
60
|
-
"typescript": "^6.0.
|
|
61
|
-
"typescript-eslint": "^8.
|
|
62
|
-
"vite": "^8.0
|
|
63
|
-
"vitest": "^4.1.
|
|
52
|
+
"globals": "^17.8.0",
|
|
53
|
+
"jsdom": "^29.1.1",
|
|
54
|
+
"mongodb": "^7.5.0",
|
|
55
|
+
"prettier": "^3.9.6",
|
|
56
|
+
"prettier-plugin-svelte": "^4.1.1",
|
|
57
|
+
"publint": "^0.3.22",
|
|
58
|
+
"svelte": "^5.56.8",
|
|
59
|
+
"svelte-check": "^4.7.4",
|
|
60
|
+
"typescript": "^6.0.3",
|
|
61
|
+
"typescript-eslint": "^8.65.0",
|
|
62
|
+
"vite": "^8.2.0",
|
|
63
|
+
"vitest": "^4.1.10",
|
|
64
64
|
"@medyll/idae-eslint-config": "0.1.6",
|
|
65
|
-
"@medyll/idae-router": "0.1.1",
|
|
66
65
|
"@medyll/idae-shared": "1.0.5",
|
|
66
|
+
"@medyll/qoolie": "0.0.3",
|
|
67
67
|
"@medyll/idae-socket": "0.0.5",
|
|
68
|
-
"@medyll/
|
|
68
|
+
"@medyll/idae-router": "0.1.1"
|
|
69
69
|
},
|
|
70
70
|
"scope": "medyll",
|
|
71
71
|
"keywords": [
|
|
@@ -78,14 +78,14 @@
|
|
|
78
78
|
],
|
|
79
79
|
"dependencies": {
|
|
80
80
|
"@iconify-json/ph": "^1.2.2",
|
|
81
|
-
"@iconify/svelte": "^5.2.
|
|
81
|
+
"@iconify/svelte": "^5.2.2",
|
|
82
82
|
"@medyll/css-base": "^0.7.10",
|
|
83
83
|
"command": "^1.1.1",
|
|
84
|
-
"commander": "^
|
|
84
|
+
"commander": "^15.0.0",
|
|
85
85
|
"@medyll/idae-api": "0.187.3",
|
|
86
86
|
"@medyll/idae-idbql": "0.185.3",
|
|
87
87
|
"@medyll/idae-be": "1.96.3",
|
|
88
|
-
"@medyll/qoolie": "0.0.
|
|
88
|
+
"@medyll/qoolie": "0.0.3"
|
|
89
89
|
},
|
|
90
90
|
"scripts": {
|
|
91
91
|
"dev": "vite dev --host",
|
package/dist/main/machine.d.ts
DELETED
|
@@ -1,272 +0,0 @@
|
|
|
1
|
-
import { MachineDb } from './machineDb.js';
|
|
2
|
-
import { createQoolie, type SyncConfig, type SyncErrorContext, type ResultSet } from '@medyll/qoolie';
|
|
3
|
-
import { useQoolieQuery } from '@medyll/qoolie/svelte';
|
|
4
|
-
import type { EventDataClientInstance } from '@medyll/idae-socket';
|
|
5
|
-
import { be as _be } from '@medyll/idae-be';
|
|
6
|
-
import { MachineRouter, type MachineRouterConfig } from './machine/MachineRouter.js';
|
|
7
|
-
import { type SchemaDiagnosticReport } from './machineSchemaDoctor.js';
|
|
8
|
-
import { type ComponentRegistry } from './router/componentRegistry.js';
|
|
9
|
-
import type { IdaeMenuManager } from '../idae/menu/IdaeMenuManager.js';
|
|
10
|
-
import type { MachineModel } from '../types/index.js';
|
|
11
|
-
type SyncEvent = {
|
|
12
|
-
type: string;
|
|
13
|
-
collection?: string;
|
|
14
|
-
entryId?: string;
|
|
15
|
-
reason?: unknown;
|
|
16
|
-
};
|
|
17
|
-
export type MachineBootPhase = 'boot' | 'schema' | 'model' | 'storage' | 'frames' | 'seed' | 'ui';
|
|
18
|
-
export type MachineBootStatus = 'start' | 'done' | 'error';
|
|
19
|
-
export interface MachineBootTraceEntry {
|
|
20
|
-
phase: MachineBootPhase;
|
|
21
|
-
status: MachineBootStatus;
|
|
22
|
-
at: string;
|
|
23
|
-
detail?: string;
|
|
24
|
-
}
|
|
25
|
-
export interface MachineStoreDiagnostic {
|
|
26
|
-
collection: string;
|
|
27
|
-
calls: number;
|
|
28
|
-
}
|
|
29
|
-
export type MachineComponentRegistry = Readonly<Pick<ComponentRegistry, 'register' | 'registerMany' | 'unregister' | 'resolve' | 'has' | 'keys'>>;
|
|
30
|
-
/**
|
|
31
|
-
* @class Machine
|
|
32
|
-
* @role Main entry point for managing the IDBQL connection and centralized data access.
|
|
33
|
-
*/
|
|
34
|
-
export declare class Machine {
|
|
35
|
-
/**
|
|
36
|
-
* Static registry of named Machine instances
|
|
37
|
-
*/
|
|
38
|
-
static instanceRegistry: Record<string, Machine>;
|
|
39
|
-
/**
|
|
40
|
-
* Instance name (optional)
|
|
41
|
-
*/
|
|
42
|
-
instanceName?: string;
|
|
43
|
-
/**
|
|
44
|
-
* Qoolie instance — data layer (IndexedDB + optional sync)
|
|
45
|
-
*/
|
|
46
|
-
_qoolie: ReturnType<typeof createQoolie> | undefined;
|
|
47
|
-
/**
|
|
48
|
-
* Centralized access to schema and collection logic
|
|
49
|
-
*/
|
|
50
|
-
_machineDb: MachineDb;
|
|
51
|
-
/**
|
|
52
|
-
* Database name (IDB). Derived from org+domain if not explicit.
|
|
53
|
-
*/
|
|
54
|
-
_dbName: string;
|
|
55
|
-
/**
|
|
56
|
-
* Schema version
|
|
57
|
-
*/
|
|
58
|
-
_version: number;
|
|
59
|
-
/** System/framework collections (appscheme, appuser_*, …). Usually omitted — schema is fetched during boot(). */
|
|
60
|
-
_core?: MachineModel;
|
|
61
|
-
/** Application business collections (vehicle, reservation, …). */
|
|
62
|
-
_business?: MachineModel;
|
|
63
|
-
/**
|
|
64
|
-
* Effective model = system collections + business model. Built once at boot().
|
|
65
|
-
*/
|
|
66
|
-
_effectiveModel: MachineModel;
|
|
67
|
-
/** Organisation identifier — prefixes all DB names. e.g. 'test', 'crfr' */
|
|
68
|
-
_org?: string;
|
|
69
|
-
/** Domain/site name. e.g. 'machine', 'sitebase' */
|
|
70
|
-
_domain?: string;
|
|
71
|
-
/**
|
|
72
|
-
* Schema router instance (lazy-initialized)
|
|
73
|
-
*/
|
|
74
|
-
_router?: MachineRouter;
|
|
75
|
-
/** Global sync config forwarded to createQoolie(). false = sync disabled. */
|
|
76
|
-
_syncOptions?: SyncConfig | false;
|
|
77
|
-
/** Reactive state engine: 'svelte5' (default) | 'stator' */
|
|
78
|
-
_stateEngine?: 'svelte5' | 'stator';
|
|
79
|
-
/** Qoolie lifecycle hooks */
|
|
80
|
-
_hooks?: {
|
|
81
|
-
onSyncEvent?: (event: SyncEvent) => void;
|
|
82
|
-
onError?: (error: Error, context: SyncErrorContext) => void;
|
|
83
|
-
};
|
|
84
|
-
/** Seed data for mobile-first mode — auto-called with onlyIfEmpty on boot if mode === 'mobile-first' */
|
|
85
|
-
_seed?: Record<string, unknown[]>;
|
|
86
|
-
/** Frame manager — handles dynamic frame registration and content loading */
|
|
87
|
-
private readonly _frameManager;
|
|
88
|
-
/** Menu manager — created during boot to avoid module-level machine dependency. */
|
|
89
|
-
private _menuManager?;
|
|
90
|
-
/** Cleanup fn returned by setupContextMenuListener — called in destroy(). */
|
|
91
|
-
private _contextMenuCleanup?;
|
|
92
|
-
/** Last boot trace — intentionally plain data so recovery screens can render it after failure. */
|
|
93
|
-
private _bootTrace;
|
|
94
|
-
/** Last pure schema inspection, refreshed whenever the effective model changes. */
|
|
95
|
-
private _schemaDiagnostics;
|
|
96
|
-
/** Development signal for spotting repeated store subscriptions per collection. */
|
|
97
|
-
private _storeAccessCounts;
|
|
98
|
-
/**
|
|
99
|
-
* Promise that resolves when boot() has completed.
|
|
100
|
-
* Use `await machine.ready` after createInstance() to ensure the machine is fully initialized.
|
|
101
|
-
*/
|
|
102
|
-
ready: Promise<void>;
|
|
103
|
-
/**
|
|
104
|
-
* Main constructor
|
|
105
|
-
* @role Constructor
|
|
106
|
-
* @param {string=} dbName The name of the database.
|
|
107
|
-
* @param {number=} version The schema version number.
|
|
108
|
-
* @param {MachineModel=} business The business data model.
|
|
109
|
-
*/
|
|
110
|
-
constructor(dbName?: string, version?: number, business?: MachineModel);
|
|
111
|
-
/**
|
|
112
|
-
* Initialize the machine with configuration parameters.
|
|
113
|
-
* dbName is derived from org+domain when both are provided and no explicit dbName is given.
|
|
114
|
-
* @role Initializer
|
|
115
|
-
*/
|
|
116
|
-
init(options?: {
|
|
117
|
-
dbName?: string;
|
|
118
|
-
version?: number;
|
|
119
|
-
/** System/framework collections. Usually omitted — schema is fetched from the server during boot(). */
|
|
120
|
-
core?: MachineModel;
|
|
121
|
-
/** Application business collections (vehicle, reservation, …). */
|
|
122
|
-
business?: MachineModel;
|
|
123
|
-
org?: string;
|
|
124
|
-
domain?: string;
|
|
125
|
-
sync?: SyncConfig | false;
|
|
126
|
-
stateEngine?: 'svelte5' | 'stator';
|
|
127
|
-
hooks?: {
|
|
128
|
-
onSyncEvent?: (event: SyncEvent) => void;
|
|
129
|
-
onError?: (error: Error, context: SyncErrorContext) => void;
|
|
130
|
-
};
|
|
131
|
-
/** Seed data for mobile-first mode. When sync.mode === 'mobile-first', boot() auto-calls seed(seed, { onlyIfEmpty: true }). */
|
|
132
|
-
seed?: Record<string, unknown[]>;
|
|
133
|
-
}): void;
|
|
134
|
-
/** Fully qualified DB name for a given base: {org}_{base} */
|
|
135
|
-
moduleDbName(base: string): string;
|
|
136
|
-
private markBoot;
|
|
137
|
-
get bootTrace(): readonly MachineBootTraceEntry[];
|
|
138
|
-
get schemaDiagnostics(): SchemaDiagnosticReport;
|
|
139
|
-
get storeDiagnostics(): readonly MachineStoreDiagnostic[];
|
|
140
|
-
/** Pending IDB upgrade scheduled by drift detection — consumed by next createStore(). */
|
|
141
|
-
private _pendingIdbUpgrade;
|
|
142
|
-
private createStore;
|
|
143
|
-
private _scheduleDrift;
|
|
144
|
-
/**
|
|
145
|
-
* Shared model-rebuild sequence for both the initial boot path and the onDrift
|
|
146
|
-
* schema-reload path. Keeps the two callers in sync without duplication.
|
|
147
|
-
*
|
|
148
|
-
* replaceExisting=false → initial boot: read actual IDB version first (never downgrade).
|
|
149
|
-
* replaceExisting=true → schema drift reload: skip version check (already managed).
|
|
150
|
-
*/
|
|
151
|
-
private _applyModel;
|
|
152
|
-
/**
|
|
153
|
-
* @framework-bootstrap — called automatically during boot().
|
|
154
|
-
* Not for application code. Detects IDB drift and upgrades stores immediately.
|
|
155
|
-
*/
|
|
156
|
-
upgradeIdb(): Promise<void>;
|
|
157
|
-
/**
|
|
158
|
-
* Atomic boot — single async entry point for the app shell.
|
|
159
|
-
*
|
|
160
|
-
* Resolves the schema (server or local), builds MachineDb, adapts IDB drift,
|
|
161
|
-
* creates the qoolie store. Returns only once `machine.logic` + `machine.store`
|
|
162
|
-
* are ready. UI must `await machine.boot(...)` before mounting machine-aware
|
|
163
|
-
* components — no partial render, no reactivity races.
|
|
164
|
-
*
|
|
165
|
-
* Data hydration (IDB ← server) is owned by qoolie's sync layer, not by boot.
|
|
166
|
-
*
|
|
167
|
-
* @param options - Same shape as init(); typically { org, domain, version, sync }.
|
|
168
|
-
* @throws If sync is enabled but schema is unavailable (no cache, no network, no local model).
|
|
169
|
-
*/
|
|
170
|
-
boot(options?: Parameters<Machine['init']>[0]): Promise<void>;
|
|
171
|
-
/**
|
|
172
|
-
* Get the IDbBase (schema logic) instance.
|
|
173
|
-
* Recommended accessor for schema and collection logic.
|
|
174
|
-
* @role Accessor
|
|
175
|
-
* @return {MachineDb} The schema and collection logic instance.
|
|
176
|
-
*/
|
|
177
|
-
get logic(): MachineDb;
|
|
178
|
-
/**
|
|
179
|
-
* Reactive collection reader — returns live-updating { records } via Svelte 5 runes.
|
|
180
|
-
* `records` is a ResultSet<T> (array + .sortBy/.groupBy/.getPage/.distinct/…).
|
|
181
|
-
* Usage: const { records } = machine.store('users');
|
|
182
|
-
* const { records } = machine.store('users', { status: 'active' });
|
|
183
|
-
*
|
|
184
|
-
* Must be called from within a Svelte component or .svelte.ts context.
|
|
185
|
-
* For imperative CRUD use machine.collection(name) instead.
|
|
186
|
-
*/
|
|
187
|
-
store<T = any>(name: string, query?: Parameters<typeof useQoolieQuery>[2]): {
|
|
188
|
-
records: ResultSet<T>;
|
|
189
|
-
};
|
|
190
|
-
/**
|
|
191
|
-
* Direct collection accessor — returns the QoolieCollection for CRUD ops, with
|
|
192
|
-
* create/update/updateWhere wrapped to denormalize FK target snapshots into
|
|
193
|
-
* `record.fks.<field>` before persisting (single write choke-point — see
|
|
194
|
-
* MachineFkFold). Every other method forwards untouched.
|
|
195
|
-
* Usage: await machine.collection('users').create(data)
|
|
196
|
-
* await machine.collection('users').get(id)
|
|
197
|
-
* Note: machine.logic.collection(name) returns the MachineScheme (schema layer).
|
|
198
|
-
*/
|
|
199
|
-
collection(name: string): any;
|
|
200
|
-
/** Access rights manager — checkAccess, setCurrentUser, setPolicies, etc. */
|
|
201
|
-
get rights(): import("./machine/MachineRights.js").MachineRights;
|
|
202
|
-
/**
|
|
203
|
-
* Generic write dispatcher — `machine.action(collection, vars, opts?)`.
|
|
204
|
-
* One imperative entry point for every user-scoped write (prefs, history, activity, …).
|
|
205
|
-
* Auto-injects `userId` + `id`. Use opts for upsert / bump / touch / code-template behavior.
|
|
206
|
-
*/
|
|
207
|
-
get action(): import("./machine/MachineAction.js").MachineActionCallable;
|
|
208
|
-
/**
|
|
209
|
-
* Sync controller — pause/resume/status/flush/dlq.
|
|
210
|
-
* Only available when sync is enabled in init() options.
|
|
211
|
-
*/
|
|
212
|
-
get sync(): any;
|
|
213
|
-
/**
|
|
214
|
-
* Socket client — EventDataClientInstance from idae-socket, owned by qoolie's
|
|
215
|
-
* push listener (single connection). Available when `sync.push.protocol === 'socketio'`
|
|
216
|
-
* and the listener has connected. Configure via `init({ sync: { push: { protocol: 'socketio', ... } } })`.
|
|
217
|
-
*/
|
|
218
|
-
get socket(): EventDataClientInstance | undefined;
|
|
219
|
-
/**
|
|
220
|
-
* Release all Qoolie resources (stops sync adapter, clears collections).
|
|
221
|
-
* Call when the Machine instance is no longer needed.
|
|
222
|
-
*/
|
|
223
|
-
destroy(): void;
|
|
224
|
-
/** Pre-fetch collections into IDB before UI renders. Derives list from model when not provided. */
|
|
225
|
-
warmup(collections?: string[]): Promise<void>;
|
|
226
|
-
resetClientData(): Promise<void>;
|
|
227
|
-
/**
|
|
228
|
-
* Get or create the MachineRouter instance (lazy).
|
|
229
|
-
* @role Accessor
|
|
230
|
-
* @return {MachineRouter} The machine router instance.
|
|
231
|
-
*/
|
|
232
|
-
get router(): MachineRouter;
|
|
233
|
-
initRouter(config: MachineRouterConfig): MachineRouter;
|
|
234
|
-
private _buildRouter;
|
|
235
|
-
/** Compute a record label from `template.presentation`. Used by nav history writes and dialog titles. @internal */
|
|
236
|
-
_renderLabel(collection: string, collectionId: string | number): Promise<string | undefined>;
|
|
237
|
-
/** Access to the frame manager singleton. */
|
|
238
|
-
get framer(): import("./frame/MachineFrameManager.js").MachineFrameManager;
|
|
239
|
-
/**
|
|
240
|
-
* Access to the menu manager. Created lazily. Snapshot reader wired on first
|
|
241
|
-
* access so `getTree`/`getFlatItems`/`isVisible` read live appuser_prefs/
|
|
242
|
-
* appscheme/appscheme_type via machine.store (reactive read layer) instead of
|
|
243
|
-
* staying empty forever. Component-level reactivity belongs in
|
|
244
|
-
* useMenuTree.svelte.ts, not here — this getter only guarantees the manager
|
|
245
|
-
* is never wired to stale/empty data.
|
|
246
|
-
*/
|
|
247
|
-
get menu(): IdaeMenuManager;
|
|
248
|
-
/** Access to the component registry singleton. */
|
|
249
|
-
get componentRegistry(): Readonly<Pick<ComponentRegistry, "keys" | "register" | "registerMany" | "unregister" | "resolve" | "has">>;
|
|
250
|
-
/** DOM manipulation utility — wraps @medyll/idae-be. Usage: machine.be('#el').addClass('active') */
|
|
251
|
-
get be(): typeof _be;
|
|
252
|
-
/**
|
|
253
|
-
* Create and register a new Machine instance.
|
|
254
|
-
* Registers the instance in the static registry for later retrieval.
|
|
255
|
-
* @role Factory method
|
|
256
|
-
* @param {string} [instanceName] Optional name to register the instance under.
|
|
257
|
-
* @param {string} [dbName] Database name for the new instance.
|
|
258
|
-
* @param {number} [version] Schema version for the new instance.
|
|
259
|
-
* @param {MachineModel} [business] Business data model for the new instance.
|
|
260
|
-
* @returns {Machine} The newly created and started Machine instance.
|
|
261
|
-
*/
|
|
262
|
-
createInstance(instanceName?: string, dbName?: string, version?: number, business?: MachineModel): Machine;
|
|
263
|
-
/**
|
|
264
|
-
* Get a Machine instance by name from the registry.
|
|
265
|
-
* @role Accessor
|
|
266
|
-
* @param {string} instanceName The name of the instance.
|
|
267
|
-
* @return {Machine | undefined} The Machine instance, or undefined if not found.
|
|
268
|
-
*/
|
|
269
|
-
static instance(instanceName: string): Machine | undefined;
|
|
270
|
-
}
|
|
271
|
-
export { buildLoadInUrl } from './frame/frameUrl.js';
|
|
272
|
-
export declare const machine: Machine;
|