@noormdev/sdk 1.0.0-alpha.27 → 1.0.0-alpha.29
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/{chunk-3UDETNWW.js → chunk-5AYPF5D5.js} +4 -4
- package/dist/{chunk-3UDETNWW.js.map → chunk-5AYPF5D5.js.map} +1 -1
- package/dist/{chunk-ZKYTJJIF.js → chunk-DE3NJ22A.js} +3 -3
- package/dist/{chunk-ZKYTJJIF.js.map → chunk-DE3NJ22A.js.map} +1 -1
- package/dist/{chunk-UDUDHOIB.js → chunk-DLQES4PM.js} +2 -2
- package/dist/{chunk-UDUDHOIB.js.map → chunk-DLQES4PM.js.map} +1 -1
- package/dist/{engine-27DNMF4T.js → engine-GMQXUPNB.js} +4 -4
- package/dist/{engine-27DNMF4T.js.map → engine-GMQXUPNB.js.map} +1 -1
- package/dist/index.d.ts +358 -0
- package/dist/index.js +171 -4
- package/dist/index.js.map +1 -1
- package/dist/{storage-TZNQBIX3.js → storage-WQURRPCA.js} +4 -4
- package/dist/{storage-TZNQBIX3.js.map → storage-WQURRPCA.js.map} +1 -1
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { createRequire } from 'module';
|
|
2
|
-
export { eta, isTemplate, processFile, processFiles, renderTemplate } from './chunk-
|
|
2
|
+
export { eta, isTemplate, processFile, processFiles, renderTemplate } from './chunk-5AYPF5D5.js';
|
|
3
3
|
import './chunk-UOFJT5PY.js';
|
|
4
|
-
import './chunk-
|
|
4
|
+
import './chunk-DLQES4PM.js';
|
|
5
5
|
import './chunk-TBRUDUBQ.js';
|
|
6
6
|
import './chunk-YJBKNUTP.js';
|
|
7
7
|
import './chunk-D2XW2UOP.js';
|
|
8
8
|
|
|
9
9
|
createRequire(import.meta.url);
|
|
10
|
-
//# sourceMappingURL=engine-
|
|
11
|
-
//# sourceMappingURL=engine-
|
|
10
|
+
//# sourceMappingURL=engine-GMQXUPNB.js.map
|
|
11
|
+
//# sourceMappingURL=engine-GMQXUPNB.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"engine-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"engine-GMQXUPNB.js"}
|
package/dist/index.d.ts
CHANGED
|
@@ -53,6 +53,23 @@ export interface ConnectionResult {
|
|
|
53
53
|
dialect: Dialect;
|
|
54
54
|
destroy: () => Promise<void>;
|
|
55
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* Logger Types
|
|
58
|
+
*
|
|
59
|
+
* Type definitions for the noorm logging system.
|
|
60
|
+
* The logger captures observer events and streams them
|
|
61
|
+
* to a log file with configurable verbosity.
|
|
62
|
+
*/
|
|
63
|
+
/**
|
|
64
|
+
* Log verbosity levels.
|
|
65
|
+
*
|
|
66
|
+
* - silent: No logging
|
|
67
|
+
* - error: Errors only
|
|
68
|
+
* - warn: Errors + warnings
|
|
69
|
+
* - info: Errors + warnings + info (default)
|
|
70
|
+
* - verbose: All events including debug
|
|
71
|
+
*/
|
|
72
|
+
export type LogLevel = "silent" | "error" | "warn" | "info" | "verbose";
|
|
56
73
|
/**
|
|
57
74
|
* Full configuration object.
|
|
58
75
|
*
|
|
@@ -2128,6 +2145,16 @@ export declare class ChangesNamespace {
|
|
|
2128
2145
|
* ```
|
|
2129
2146
|
*/
|
|
2130
2147
|
ff(): Promise<BatchChangeResult>;
|
|
2148
|
+
/**
|
|
2149
|
+
* Apply the next N pending changes (default 1).
|
|
2150
|
+
*
|
|
2151
|
+
* @example
|
|
2152
|
+
* ```typescript
|
|
2153
|
+
* const result = await ctx.noorm.changes.next()
|
|
2154
|
+
* const result = await ctx.noorm.changes.next(3)
|
|
2155
|
+
* ```
|
|
2156
|
+
*/
|
|
2157
|
+
next(count?: number): Promise<BatchChangeResult>;
|
|
2131
2158
|
/**
|
|
2132
2159
|
* Get status of all changes (merged disk + DB).
|
|
2133
2160
|
*
|
|
@@ -2155,6 +2182,43 @@ export declare class ChangesNamespace {
|
|
|
2155
2182
|
* ```
|
|
2156
2183
|
*/
|
|
2157
2184
|
history(limit?: number): Promise<ChangeHistoryRecord[]>;
|
|
2185
|
+
/**
|
|
2186
|
+
* Get execution history for a specific change by name.
|
|
2187
|
+
*
|
|
2188
|
+
* Returns all operation records for the given change, most recent first.
|
|
2189
|
+
*
|
|
2190
|
+
* @example
|
|
2191
|
+
* ```typescript
|
|
2192
|
+
* const records = await ctx.noorm.changes.historyForChange('2024-01-15-add-users')
|
|
2193
|
+
* ```
|
|
2194
|
+
*/
|
|
2195
|
+
historyForChange(name: string, limit?: number): Promise<ChangeHistoryRecord[]>;
|
|
2196
|
+
/**
|
|
2197
|
+
* Rewind applied changes in reverse order back to (and including) the named change.
|
|
2198
|
+
*
|
|
2199
|
+
* When a string is passed, reverts until and including that change.
|
|
2200
|
+
* When a number is passed, reverts that many recent changes.
|
|
2201
|
+
*
|
|
2202
|
+
* @example
|
|
2203
|
+
* ```typescript
|
|
2204
|
+
* const result = await ctx.noorm.changes.rewind('2024-01-15-add-users')
|
|
2205
|
+
* const result = await ctx.noorm.changes.rewind(3)
|
|
2206
|
+
* ```
|
|
2207
|
+
*/
|
|
2208
|
+
rewind(target: number | string): Promise<BatchChangeResult>;
|
|
2209
|
+
/**
|
|
2210
|
+
* Get per-file execution records for a specific operation ID.
|
|
2211
|
+
*
|
|
2212
|
+
* Use the `id` from a `ChangeHistoryRecord` to drill into individual
|
|
2213
|
+
* file-level results for that operation.
|
|
2214
|
+
*
|
|
2215
|
+
* @example
|
|
2216
|
+
* ```typescript
|
|
2217
|
+
* const records = await ctx.noorm.changes.historyForChange('2024-01-15-add-users')
|
|
2218
|
+
* const files = await ctx.noorm.changes.getFileHistory(records[0].id)
|
|
2219
|
+
* ```
|
|
2220
|
+
*/
|
|
2221
|
+
getFileHistory(operationId: number): Promise<FileHistoryRecord[]>;
|
|
2158
2222
|
}
|
|
2159
2223
|
export declare class RunNamespace {
|
|
2160
2224
|
#private;
|
|
@@ -2238,6 +2302,41 @@ export interface TableSummary {
|
|
|
2238
2302
|
columnCount: number;
|
|
2239
2303
|
rowCountEstimate?: number;
|
|
2240
2304
|
}
|
|
2305
|
+
/**
|
|
2306
|
+
* View summary for list display.
|
|
2307
|
+
*/
|
|
2308
|
+
export interface ViewSummary {
|
|
2309
|
+
name: string;
|
|
2310
|
+
schema?: string;
|
|
2311
|
+
columnCount: number;
|
|
2312
|
+
isUpdatable: boolean;
|
|
2313
|
+
}
|
|
2314
|
+
/**
|
|
2315
|
+
* Stored procedure summary for list display.
|
|
2316
|
+
*/
|
|
2317
|
+
export interface ProcedureSummary {
|
|
2318
|
+
name: string;
|
|
2319
|
+
schema?: string;
|
|
2320
|
+
parameterCount: number;
|
|
2321
|
+
}
|
|
2322
|
+
/**
|
|
2323
|
+
* Function summary for list display.
|
|
2324
|
+
*/
|
|
2325
|
+
export interface FunctionSummary {
|
|
2326
|
+
name: string;
|
|
2327
|
+
schema?: string;
|
|
2328
|
+
parameterCount: number;
|
|
2329
|
+
returnType: string;
|
|
2330
|
+
}
|
|
2331
|
+
/**
|
|
2332
|
+
* Type/Enum summary for list display.
|
|
2333
|
+
*/
|
|
2334
|
+
export interface TypeSummary {
|
|
2335
|
+
name: string;
|
|
2336
|
+
schema?: string;
|
|
2337
|
+
kind: "enum" | "composite" | "domain" | "other";
|
|
2338
|
+
valueCount?: number;
|
|
2339
|
+
}
|
|
2241
2340
|
/**
|
|
2242
2341
|
* Index summary for list display.
|
|
2243
2342
|
*/
|
|
@@ -2276,6 +2375,16 @@ export interface ColumnDetail {
|
|
|
2276
2375
|
isPrimaryKey: boolean;
|
|
2277
2376
|
ordinalPosition: number;
|
|
2278
2377
|
}
|
|
2378
|
+
/**
|
|
2379
|
+
* Parameter detail for procedures/functions.
|
|
2380
|
+
*/
|
|
2381
|
+
export interface ParameterDetail {
|
|
2382
|
+
name: string;
|
|
2383
|
+
dataType: string;
|
|
2384
|
+
mode: "IN" | "OUT" | "INOUT";
|
|
2385
|
+
defaultValue?: string;
|
|
2386
|
+
ordinalPosition: number;
|
|
2387
|
+
}
|
|
2279
2388
|
/**
|
|
2280
2389
|
* Full table detail.
|
|
2281
2390
|
*/
|
|
@@ -2287,6 +2396,48 @@ export interface TableDetail {
|
|
|
2287
2396
|
foreignKeys: ForeignKeySummary[];
|
|
2288
2397
|
rowCountEstimate?: number;
|
|
2289
2398
|
}
|
|
2399
|
+
/**
|
|
2400
|
+
* Full view detail.
|
|
2401
|
+
*/
|
|
2402
|
+
export interface ViewDetail {
|
|
2403
|
+
name: string;
|
|
2404
|
+
schema?: string;
|
|
2405
|
+
columns: ColumnDetail[];
|
|
2406
|
+
definition?: string;
|
|
2407
|
+
isUpdatable: boolean;
|
|
2408
|
+
}
|
|
2409
|
+
/**
|
|
2410
|
+
* Full procedure detail.
|
|
2411
|
+
*/
|
|
2412
|
+
export interface ProcedureDetail {
|
|
2413
|
+
name: string;
|
|
2414
|
+
schema?: string;
|
|
2415
|
+
parameters: ParameterDetail[];
|
|
2416
|
+
definition?: string;
|
|
2417
|
+
}
|
|
2418
|
+
/**
|
|
2419
|
+
* Full function detail.
|
|
2420
|
+
*/
|
|
2421
|
+
export interface FunctionDetail {
|
|
2422
|
+
name: string;
|
|
2423
|
+
schema?: string;
|
|
2424
|
+
parameters: ParameterDetail[];
|
|
2425
|
+
returnType: string;
|
|
2426
|
+
definition?: string;
|
|
2427
|
+
language?: string;
|
|
2428
|
+
}
|
|
2429
|
+
/**
|
|
2430
|
+
* Full type detail.
|
|
2431
|
+
*/
|
|
2432
|
+
export interface TypeDetail {
|
|
2433
|
+
name: string;
|
|
2434
|
+
schema?: string;
|
|
2435
|
+
kind: "enum" | "composite" | "domain" | "other";
|
|
2436
|
+
values?: string[];
|
|
2437
|
+
attributes?: ColumnDetail[];
|
|
2438
|
+
baseType?: string;
|
|
2439
|
+
definition?: string;
|
|
2440
|
+
}
|
|
2290
2441
|
/**
|
|
2291
2442
|
* Teardown Types
|
|
2292
2443
|
*
|
|
@@ -2401,6 +2552,96 @@ export declare class DbNamespace {
|
|
|
2401
2552
|
* ```
|
|
2402
2553
|
*/
|
|
2403
2554
|
describeTable(name: string, schema?: string): Promise<TableDetail | null>;
|
|
2555
|
+
/**
|
|
2556
|
+
* List all views in the database.
|
|
2557
|
+
*
|
|
2558
|
+
* @example
|
|
2559
|
+
* ```typescript
|
|
2560
|
+
* const views = await ctx.noorm.db.listViews()
|
|
2561
|
+
* ```
|
|
2562
|
+
*/
|
|
2563
|
+
listViews(): Promise<ViewSummary[]>;
|
|
2564
|
+
/**
|
|
2565
|
+
* Get detailed information about a view.
|
|
2566
|
+
*
|
|
2567
|
+
* @example
|
|
2568
|
+
* ```typescript
|
|
2569
|
+
* const detail = await ctx.noorm.db.describeView('active_users')
|
|
2570
|
+
* ```
|
|
2571
|
+
*/
|
|
2572
|
+
describeView(name: string, schema?: string): Promise<ViewDetail | null>;
|
|
2573
|
+
/**
|
|
2574
|
+
* List all stored procedures in the database.
|
|
2575
|
+
*
|
|
2576
|
+
* @example
|
|
2577
|
+
* ```typescript
|
|
2578
|
+
* const procs = await ctx.noorm.db.listProcedures()
|
|
2579
|
+
* ```
|
|
2580
|
+
*/
|
|
2581
|
+
listProcedures(): Promise<ProcedureSummary[]>;
|
|
2582
|
+
/**
|
|
2583
|
+
* Get detailed information about a stored procedure.
|
|
2584
|
+
*
|
|
2585
|
+
* @example
|
|
2586
|
+
* ```typescript
|
|
2587
|
+
* const detail = await ctx.noorm.db.describeProcedure('sp_update_user')
|
|
2588
|
+
* ```
|
|
2589
|
+
*/
|
|
2590
|
+
describeProcedure(name: string, schema?: string): Promise<ProcedureDetail | null>;
|
|
2591
|
+
/**
|
|
2592
|
+
* List all functions in the database.
|
|
2593
|
+
*
|
|
2594
|
+
* @example
|
|
2595
|
+
* ```typescript
|
|
2596
|
+
* const fns = await ctx.noorm.db.listFunctions()
|
|
2597
|
+
* ```
|
|
2598
|
+
*/
|
|
2599
|
+
listFunctions(): Promise<FunctionSummary[]>;
|
|
2600
|
+
/**
|
|
2601
|
+
* Get detailed information about a function.
|
|
2602
|
+
*
|
|
2603
|
+
* @example
|
|
2604
|
+
* ```typescript
|
|
2605
|
+
* const detail = await ctx.noorm.db.describeFunction('fn_get_user')
|
|
2606
|
+
* ```
|
|
2607
|
+
*/
|
|
2608
|
+
describeFunction(name: string, schema?: string): Promise<FunctionDetail | null>;
|
|
2609
|
+
/**
|
|
2610
|
+
* List all custom types in the database.
|
|
2611
|
+
*
|
|
2612
|
+
* @example
|
|
2613
|
+
* ```typescript
|
|
2614
|
+
* const types = await ctx.noorm.db.listTypes()
|
|
2615
|
+
* ```
|
|
2616
|
+
*/
|
|
2617
|
+
listTypes(): Promise<TypeSummary[]>;
|
|
2618
|
+
/**
|
|
2619
|
+
* Get detailed information about a custom type.
|
|
2620
|
+
*
|
|
2621
|
+
* @example
|
|
2622
|
+
* ```typescript
|
|
2623
|
+
* const detail = await ctx.noorm.db.describeType('user_status')
|
|
2624
|
+
* ```
|
|
2625
|
+
*/
|
|
2626
|
+
describeType(name: string, schema?: string): Promise<TypeDetail | null>;
|
|
2627
|
+
/**
|
|
2628
|
+
* List all indexes in the database.
|
|
2629
|
+
*
|
|
2630
|
+
* @example
|
|
2631
|
+
* ```typescript
|
|
2632
|
+
* const indexes = await ctx.noorm.db.listIndexes()
|
|
2633
|
+
* ```
|
|
2634
|
+
*/
|
|
2635
|
+
listIndexes(): Promise<IndexSummary[]>;
|
|
2636
|
+
/**
|
|
2637
|
+
* List all foreign keys in the database.
|
|
2638
|
+
*
|
|
2639
|
+
* @example
|
|
2640
|
+
* ```typescript
|
|
2641
|
+
* const fks = await ctx.noorm.db.listForeignKeys()
|
|
2642
|
+
* ```
|
|
2643
|
+
*/
|
|
2644
|
+
listForeignKeys(): Promise<ForeignKeySummary[]>;
|
|
2404
2645
|
/**
|
|
2405
2646
|
* Get database overview with counts of all object types.
|
|
2406
2647
|
*
|
|
@@ -3143,6 +3384,10 @@ export type ShutdownReason = "signal" | "user" | "error" | "programmatic";
|
|
|
3143
3384
|
* Application mode.
|
|
3144
3385
|
*/
|
|
3145
3386
|
export type AppMode = "tui" | "headless";
|
|
3387
|
+
/**
|
|
3388
|
+
* Signal types we handle.
|
|
3389
|
+
*/
|
|
3390
|
+
export type Signal = "SIGINT" | "SIGTERM" | "SIGHUP";
|
|
3146
3391
|
/**
|
|
3147
3392
|
* Type definitions for auto-update feature.
|
|
3148
3393
|
*
|
|
@@ -3445,6 +3690,11 @@ export interface DtEvents {
|
|
|
3445
3690
|
* - `vault:*` - Vault operations
|
|
3446
3691
|
* - `transfer:*` - Data transfer operations
|
|
3447
3692
|
* - `dt:*` - .dt format export/import/stream operations
|
|
3693
|
+
* - `version:*` - Version checking and migration
|
|
3694
|
+
* - `logger:*` - Logger lifecycle
|
|
3695
|
+
* - `teardown:*` - Database teardown/truncate operations
|
|
3696
|
+
* - `sql-terminal:*` - SQL terminal query execution
|
|
3697
|
+
* - `init:*` - Project initialization
|
|
3448
3698
|
* - `error` - Catch-all errors
|
|
3449
3699
|
*/
|
|
3450
3700
|
export interface NoormEvents extends SettingsEvents, UpdateEvents, VaultEvents, TransferEvents, DtEvents {
|
|
@@ -3515,6 +3765,10 @@ export interface NoormEvents extends SettingsEvents, UpdateEvents, VaultEvents,
|
|
|
3515
3765
|
fileCount: number;
|
|
3516
3766
|
configName: string;
|
|
3517
3767
|
};
|
|
3768
|
+
"run:files": {
|
|
3769
|
+
fileCount: number;
|
|
3770
|
+
configName: string;
|
|
3771
|
+
};
|
|
3518
3772
|
"lock:acquiring": {
|
|
3519
3773
|
configName: string;
|
|
3520
3774
|
identity: string;
|
|
@@ -3602,6 +3856,25 @@ export interface NoormEvents extends SettingsEvents, UpdateEvents, VaultEvents,
|
|
|
3602
3856
|
configName: string;
|
|
3603
3857
|
tables: string[];
|
|
3604
3858
|
};
|
|
3859
|
+
"db:dual:connecting": {
|
|
3860
|
+
source: string;
|
|
3861
|
+
destination: string;
|
|
3862
|
+
};
|
|
3863
|
+
"db:dual:connected": {
|
|
3864
|
+
source: string;
|
|
3865
|
+
destination: string;
|
|
3866
|
+
};
|
|
3867
|
+
"db:dual:disconnecting": {
|
|
3868
|
+
source: string;
|
|
3869
|
+
destination: string;
|
|
3870
|
+
};
|
|
3871
|
+
"db:dual:disconnected": {
|
|
3872
|
+
source: string;
|
|
3873
|
+
destination: string;
|
|
3874
|
+
};
|
|
3875
|
+
"db:dual:cleanup-warning": {
|
|
3876
|
+
errors: string[];
|
|
3877
|
+
};
|
|
3605
3878
|
"template:render": {
|
|
3606
3879
|
filepath: string;
|
|
3607
3880
|
durationMs: number;
|
|
@@ -3671,6 +3944,13 @@ export interface NoormEvents extends SettingsEvents, UpdateEvents, VaultEvents,
|
|
|
3671
3944
|
error: Error;
|
|
3672
3945
|
type?: "exception" | "rejection";
|
|
3673
3946
|
};
|
|
3947
|
+
"app:signal": {
|
|
3948
|
+
signal: Signal;
|
|
3949
|
+
};
|
|
3950
|
+
"app:exception": {
|
|
3951
|
+
error: Error;
|
|
3952
|
+
type: "exception" | "rejection";
|
|
3953
|
+
};
|
|
3674
3954
|
"router:navigated": {
|
|
3675
3955
|
from: string;
|
|
3676
3956
|
to: string;
|
|
@@ -3680,6 +3960,84 @@ export interface NoormEvents extends SettingsEvents, UpdateEvents, VaultEvents,
|
|
|
3680
3960
|
popped: string;
|
|
3681
3961
|
to: string;
|
|
3682
3962
|
};
|
|
3963
|
+
"init:complete": {
|
|
3964
|
+
projectRoot: string;
|
|
3965
|
+
hasIdentity: boolean;
|
|
3966
|
+
};
|
|
3967
|
+
"version:schema:checking": {
|
|
3968
|
+
current: number;
|
|
3969
|
+
};
|
|
3970
|
+
"version:schema:migrating": {
|
|
3971
|
+
from: number;
|
|
3972
|
+
to: number;
|
|
3973
|
+
};
|
|
3974
|
+
"version:schema:migrated": {
|
|
3975
|
+
from: number;
|
|
3976
|
+
to: number;
|
|
3977
|
+
durationMs: number;
|
|
3978
|
+
};
|
|
3979
|
+
"version:state:migrating": {
|
|
3980
|
+
from: number;
|
|
3981
|
+
to: number;
|
|
3982
|
+
};
|
|
3983
|
+
"version:state:migrated": {
|
|
3984
|
+
from: number;
|
|
3985
|
+
to: number;
|
|
3986
|
+
};
|
|
3987
|
+
"version:settings:migrating": {
|
|
3988
|
+
from: number;
|
|
3989
|
+
to: number;
|
|
3990
|
+
};
|
|
3991
|
+
"version:settings:migrated": {
|
|
3992
|
+
from: number;
|
|
3993
|
+
to: number;
|
|
3994
|
+
};
|
|
3995
|
+
"version:mismatch": {
|
|
3996
|
+
layer: "schema" | "state" | "settings";
|
|
3997
|
+
current: number;
|
|
3998
|
+
expected: number;
|
|
3999
|
+
};
|
|
4000
|
+
"logger:started": {
|
|
4001
|
+
file: string;
|
|
4002
|
+
level: LogLevel;
|
|
4003
|
+
};
|
|
4004
|
+
"logger:rotated": {
|
|
4005
|
+
oldFile: string;
|
|
4006
|
+
newFile: string;
|
|
4007
|
+
};
|
|
4008
|
+
"teardown:start": {
|
|
4009
|
+
type: "truncate" | "schema";
|
|
4010
|
+
};
|
|
4011
|
+
"teardown:progress": {
|
|
4012
|
+
category: string;
|
|
4013
|
+
object: string | null;
|
|
4014
|
+
action: string;
|
|
4015
|
+
};
|
|
4016
|
+
"teardown:error": {
|
|
4017
|
+
error: Error;
|
|
4018
|
+
object: string | null;
|
|
4019
|
+
};
|
|
4020
|
+
"teardown:complete": {
|
|
4021
|
+
result: TruncateResult | TeardownResult;
|
|
4022
|
+
};
|
|
4023
|
+
"sql-terminal:execute:before": {
|
|
4024
|
+
query: string;
|
|
4025
|
+
configName: string;
|
|
4026
|
+
};
|
|
4027
|
+
"sql-terminal:execute:after": {
|
|
4028
|
+
query: string;
|
|
4029
|
+
configName: string;
|
|
4030
|
+
success: true;
|
|
4031
|
+
durationMs: number;
|
|
4032
|
+
rowCount: number;
|
|
4033
|
+
rowsAffected: number | undefined;
|
|
4034
|
+
} | {
|
|
4035
|
+
query: string;
|
|
4036
|
+
configName: string;
|
|
4037
|
+
success: false;
|
|
4038
|
+
durationMs: number;
|
|
4039
|
+
error: string;
|
|
4040
|
+
};
|
|
3683
4041
|
error: {
|
|
3684
4042
|
source: string;
|
|
3685
4043
|
error: Error;
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createRequire } from 'module';
|
|
2
|
-
import { processFile, DtReader, isTemplate, FORMAT_VERSION, DT_EXTENSIONS, encryptWithPassphrase, ENCODED_TYPES } from './chunk-
|
|
2
|
+
import { processFile, DtReader, isTemplate, FORMAT_VERSION, DT_EXTENSIONS, encryptWithPassphrase, ENCODED_TYPES } from './chunk-5AYPF5D5.js';
|
|
3
3
|
import './chunk-UOFJT5PY.js';
|
|
4
|
-
import { initializeVault, getVaultStatus, setVaultSecret, getVaultSecret, getAllVaultSecrets, listVaultSecretKeys, deleteVaultSecret, vaultSecretExists, getVaultKey, noormDb, getNoormTables, encryptVaultKey } from './chunk-
|
|
5
|
-
import { makeNestedConfig, gigabytes, observer, attempt, retry, clone, merge, attemptSync, ObserverRelay } from './chunk-
|
|
4
|
+
import { initializeVault, getVaultStatus, setVaultSecret, getVaultSecret, getAllVaultSecrets, listVaultSecretKeys, deleteVaultSecret, vaultSecretExists, getVaultKey, noormDb, getNoormTables, encryptVaultKey } from './chunk-DE3NJ22A.js';
|
|
5
|
+
import { makeNestedConfig, gigabytes, observer, attempt, retry, clone, merge, attemptSync, ObserverRelay } from './chunk-DLQES4PM.js';
|
|
6
6
|
import { dist_default } from './chunk-TBRUDUBQ.js';
|
|
7
7
|
import { require_dist } from './chunk-YJBKNUTP.js';
|
|
8
8
|
import { __commonJS, __export, __toESM } from './chunk-D2XW2UOP.js';
|
|
@@ -17747,7 +17747,8 @@ var ChangeHistory = class {
|
|
|
17747
17747
|
direction: data2.direction,
|
|
17748
17748
|
status: "pending",
|
|
17749
17749
|
config_name: this.#configName,
|
|
17750
|
-
executed_by: data2.executedBy
|
|
17750
|
+
executed_by: data2.executedBy,
|
|
17751
|
+
cli_version: getCurrentVersion()
|
|
17751
17752
|
});
|
|
17752
17753
|
let id;
|
|
17753
17754
|
if (this.#dialect === "mssql") {
|
|
@@ -17943,6 +17944,7 @@ var ChangeHistory = class {
|
|
|
17943
17944
|
status: "success",
|
|
17944
17945
|
config_name: this.#configName,
|
|
17945
17946
|
executed_by: executedBy,
|
|
17947
|
+
cli_version: getCurrentVersion(),
|
|
17946
17948
|
error_message: reason ?? "",
|
|
17947
17949
|
duration_ms: 0,
|
|
17948
17950
|
checksum: ""
|
|
@@ -20109,6 +20111,18 @@ var ChangesNamespace = class {
|
|
|
20109
20111
|
async ff() {
|
|
20110
20112
|
return this.#getManager().ff();
|
|
20111
20113
|
}
|
|
20114
|
+
/**
|
|
20115
|
+
* Apply the next N pending changes (default 1).
|
|
20116
|
+
*
|
|
20117
|
+
* @example
|
|
20118
|
+
* ```typescript
|
|
20119
|
+
* const result = await ctx.noorm.changes.next()
|
|
20120
|
+
* const result = await ctx.noorm.changes.next(3)
|
|
20121
|
+
* ```
|
|
20122
|
+
*/
|
|
20123
|
+
async next(count = 1) {
|
|
20124
|
+
return this.#getManager().next(count);
|
|
20125
|
+
}
|
|
20112
20126
|
// ─────────────────────────────────────────────────────
|
|
20113
20127
|
// Status & history (connected)
|
|
20114
20128
|
// ─────────────────────────────────────────────────────
|
|
@@ -20148,6 +20162,49 @@ var ChangesNamespace = class {
|
|
|
20148
20162
|
async history(limit) {
|
|
20149
20163
|
return this.#getManager().getHistory(void 0, limit);
|
|
20150
20164
|
}
|
|
20165
|
+
/**
|
|
20166
|
+
* Get execution history for a specific change by name.
|
|
20167
|
+
*
|
|
20168
|
+
* Returns all operation records for the given change, most recent first.
|
|
20169
|
+
*
|
|
20170
|
+
* @example
|
|
20171
|
+
* ```typescript
|
|
20172
|
+
* const records = await ctx.noorm.changes.historyForChange('2024-01-15-add-users')
|
|
20173
|
+
* ```
|
|
20174
|
+
*/
|
|
20175
|
+
async historyForChange(name, limit) {
|
|
20176
|
+
return this.#getManager().getHistory(name, limit);
|
|
20177
|
+
}
|
|
20178
|
+
/**
|
|
20179
|
+
* Rewind applied changes in reverse order back to (and including) the named change.
|
|
20180
|
+
*
|
|
20181
|
+
* When a string is passed, reverts until and including that change.
|
|
20182
|
+
* When a number is passed, reverts that many recent changes.
|
|
20183
|
+
*
|
|
20184
|
+
* @example
|
|
20185
|
+
* ```typescript
|
|
20186
|
+
* const result = await ctx.noorm.changes.rewind('2024-01-15-add-users')
|
|
20187
|
+
* const result = await ctx.noorm.changes.rewind(3)
|
|
20188
|
+
* ```
|
|
20189
|
+
*/
|
|
20190
|
+
async rewind(target) {
|
|
20191
|
+
return this.#getManager().rewind(target);
|
|
20192
|
+
}
|
|
20193
|
+
/**
|
|
20194
|
+
* Get per-file execution records for a specific operation ID.
|
|
20195
|
+
*
|
|
20196
|
+
* Use the `id` from a `ChangeHistoryRecord` to drill into individual
|
|
20197
|
+
* file-level results for that operation.
|
|
20198
|
+
*
|
|
20199
|
+
* @example
|
|
20200
|
+
* ```typescript
|
|
20201
|
+
* const records = await ctx.noorm.changes.historyForChange('2024-01-15-add-users')
|
|
20202
|
+
* const files = await ctx.noorm.changes.getFileHistory(records[0].id)
|
|
20203
|
+
* ```
|
|
20204
|
+
*/
|
|
20205
|
+
async getFileHistory(operationId) {
|
|
20206
|
+
return this.#getManager().getFileHistory(operationId);
|
|
20207
|
+
}
|
|
20151
20208
|
// ─────────────────────────────────────────────────────
|
|
20152
20209
|
// Private
|
|
20153
20210
|
// ─────────────────────────────────────────────────────
|
|
@@ -23679,6 +23736,116 @@ var DbNamespace = class {
|
|
|
23679
23736
|
async describeTable(name, schema) {
|
|
23680
23737
|
return fetchDetail(this.#kysely, this.#dialect, "tables", name, schema);
|
|
23681
23738
|
}
|
|
23739
|
+
/**
|
|
23740
|
+
* List all views in the database.
|
|
23741
|
+
*
|
|
23742
|
+
* @example
|
|
23743
|
+
* ```typescript
|
|
23744
|
+
* const views = await ctx.noorm.db.listViews()
|
|
23745
|
+
* ```
|
|
23746
|
+
*/
|
|
23747
|
+
async listViews() {
|
|
23748
|
+
return fetchList(this.#kysely, this.#dialect, "views");
|
|
23749
|
+
}
|
|
23750
|
+
/**
|
|
23751
|
+
* Get detailed information about a view.
|
|
23752
|
+
*
|
|
23753
|
+
* @example
|
|
23754
|
+
* ```typescript
|
|
23755
|
+
* const detail = await ctx.noorm.db.describeView('active_users')
|
|
23756
|
+
* ```
|
|
23757
|
+
*/
|
|
23758
|
+
async describeView(name, schema) {
|
|
23759
|
+
return fetchDetail(this.#kysely, this.#dialect, "views", name, schema);
|
|
23760
|
+
}
|
|
23761
|
+
/**
|
|
23762
|
+
* List all stored procedures in the database.
|
|
23763
|
+
*
|
|
23764
|
+
* @example
|
|
23765
|
+
* ```typescript
|
|
23766
|
+
* const procs = await ctx.noorm.db.listProcedures()
|
|
23767
|
+
* ```
|
|
23768
|
+
*/
|
|
23769
|
+
async listProcedures() {
|
|
23770
|
+
return fetchList(this.#kysely, this.#dialect, "procedures");
|
|
23771
|
+
}
|
|
23772
|
+
/**
|
|
23773
|
+
* Get detailed information about a stored procedure.
|
|
23774
|
+
*
|
|
23775
|
+
* @example
|
|
23776
|
+
* ```typescript
|
|
23777
|
+
* const detail = await ctx.noorm.db.describeProcedure('sp_update_user')
|
|
23778
|
+
* ```
|
|
23779
|
+
*/
|
|
23780
|
+
async describeProcedure(name, schema) {
|
|
23781
|
+
return fetchDetail(this.#kysely, this.#dialect, "procedures", name, schema);
|
|
23782
|
+
}
|
|
23783
|
+
/**
|
|
23784
|
+
* List all functions in the database.
|
|
23785
|
+
*
|
|
23786
|
+
* @example
|
|
23787
|
+
* ```typescript
|
|
23788
|
+
* const fns = await ctx.noorm.db.listFunctions()
|
|
23789
|
+
* ```
|
|
23790
|
+
*/
|
|
23791
|
+
async listFunctions() {
|
|
23792
|
+
return fetchList(this.#kysely, this.#dialect, "functions");
|
|
23793
|
+
}
|
|
23794
|
+
/**
|
|
23795
|
+
* Get detailed information about a function.
|
|
23796
|
+
*
|
|
23797
|
+
* @example
|
|
23798
|
+
* ```typescript
|
|
23799
|
+
* const detail = await ctx.noorm.db.describeFunction('fn_get_user')
|
|
23800
|
+
* ```
|
|
23801
|
+
*/
|
|
23802
|
+
async describeFunction(name, schema) {
|
|
23803
|
+
return fetchDetail(this.#kysely, this.#dialect, "functions", name, schema);
|
|
23804
|
+
}
|
|
23805
|
+
/**
|
|
23806
|
+
* List all custom types in the database.
|
|
23807
|
+
*
|
|
23808
|
+
* @example
|
|
23809
|
+
* ```typescript
|
|
23810
|
+
* const types = await ctx.noorm.db.listTypes()
|
|
23811
|
+
* ```
|
|
23812
|
+
*/
|
|
23813
|
+
async listTypes() {
|
|
23814
|
+
return fetchList(this.#kysely, this.#dialect, "types");
|
|
23815
|
+
}
|
|
23816
|
+
/**
|
|
23817
|
+
* Get detailed information about a custom type.
|
|
23818
|
+
*
|
|
23819
|
+
* @example
|
|
23820
|
+
* ```typescript
|
|
23821
|
+
* const detail = await ctx.noorm.db.describeType('user_status')
|
|
23822
|
+
* ```
|
|
23823
|
+
*/
|
|
23824
|
+
async describeType(name, schema) {
|
|
23825
|
+
return fetchDetail(this.#kysely, this.#dialect, "types", name, schema);
|
|
23826
|
+
}
|
|
23827
|
+
/**
|
|
23828
|
+
* List all indexes in the database.
|
|
23829
|
+
*
|
|
23830
|
+
* @example
|
|
23831
|
+
* ```typescript
|
|
23832
|
+
* const indexes = await ctx.noorm.db.listIndexes()
|
|
23833
|
+
* ```
|
|
23834
|
+
*/
|
|
23835
|
+
async listIndexes() {
|
|
23836
|
+
return fetchList(this.#kysely, this.#dialect, "indexes");
|
|
23837
|
+
}
|
|
23838
|
+
/**
|
|
23839
|
+
* List all foreign keys in the database.
|
|
23840
|
+
*
|
|
23841
|
+
* @example
|
|
23842
|
+
* ```typescript
|
|
23843
|
+
* const fks = await ctx.noorm.db.listForeignKeys()
|
|
23844
|
+
* ```
|
|
23845
|
+
*/
|
|
23846
|
+
async listForeignKeys() {
|
|
23847
|
+
return fetchList(this.#kysely, this.#dialect, "foreignKeys");
|
|
23848
|
+
}
|
|
23682
23849
|
/**
|
|
23683
23850
|
* Get database overview with counts of all object types.
|
|
23684
23851
|
*
|