prisma-next 0.5.0-dev.8 → 0.5.0-dev.80
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/cli-errors-B9OBbled.d.mts +3 -0
- package/dist/cli-errors-D3_sMh2K.mjs +33 -0
- package/dist/cli-errors-D3_sMh2K.mjs.map +1 -0
- package/dist/cli.mjs +16 -78
- package/dist/cli.mjs.map +1 -1
- package/dist/client-qVH-rEgd.mjs +1595 -0
- package/dist/client-qVH-rEgd.mjs.map +1 -0
- package/dist/{result-handler-Ba3zWQsI.mjs → command-helpers-BeZHkxV8.mjs} +70 -47
- package/dist/command-helpers-BeZHkxV8.mjs.map +1 -0
- package/dist/commands/contract-emit.d.mts.map +1 -1
- package/dist/commands/contract-emit.mjs +2 -4
- package/dist/commands/contract-infer.d.mts.map +1 -1
- package/dist/commands/contract-infer.mjs +2 -4
- package/dist/commands/db-init.d.mts.map +1 -1
- package/dist/commands/db-init.mjs +16 -13
- package/dist/commands/db-init.mjs.map +1 -1
- package/dist/commands/db-schema.d.mts.map +1 -1
- package/dist/commands/db-schema.mjs +6 -7
- package/dist/commands/db-schema.mjs.map +1 -1
- package/dist/commands/db-sign.d.mts.map +1 -1
- package/dist/commands/db-sign.mjs +9 -9
- package/dist/commands/db-sign.mjs.map +1 -1
- package/dist/commands/db-update.d.mts.map +1 -1
- package/dist/commands/db-update.mjs +15 -13
- package/dist/commands/db-update.mjs.map +1 -1
- package/dist/commands/db-verify.d.mts.map +1 -1
- package/dist/commands/db-verify.mjs +1 -321
- package/dist/commands/migration-apply.d.mts +28 -13
- package/dist/commands/migration-apply.d.mts.map +1 -1
- package/dist/commands/migration-apply.mjs +55 -151
- package/dist/commands/migration-apply.mjs.map +1 -1
- package/dist/commands/migration-new.d.mts +0 -1
- package/dist/commands/migration-new.d.mts.map +1 -1
- package/dist/commands/migration-new.mjs +34 -40
- package/dist/commands/migration-new.mjs.map +1 -1
- package/dist/commands/migration-plan.d.mts +33 -6
- package/dist/commands/migration-plan.d.mts.map +1 -1
- package/dist/commands/migration-plan.mjs +2 -348
- package/dist/commands/migration-ref.d.mts +1 -1
- package/dist/commands/migration-ref.d.mts.map +1 -1
- package/dist/commands/migration-ref.mjs +8 -12
- package/dist/commands/migration-ref.mjs.map +1 -1
- package/dist/commands/migration-show.d.mts +13 -7
- package/dist/commands/migration-show.d.mts.map +1 -1
- package/dist/commands/migration-show.mjs +35 -36
- package/dist/commands/migration-show.mjs.map +1 -1
- package/dist/commands/migration-status.d.mts +126 -5
- package/dist/commands/migration-status.d.mts.map +1 -1
- package/dist/commands/migration-status.mjs +2 -4
- package/dist/{config-loader-C25b63rJ.mjs → config-loader-B6sJjXTv.mjs} +3 -5
- package/dist/config-loader-B6sJjXTv.mjs.map +1 -0
- package/dist/config-loader.d.mts +0 -1
- package/dist/config-loader.d.mts.map +1 -1
- package/dist/config-loader.mjs +2 -3
- package/dist/contract-emit-9DBda5Ou.mjs +150 -0
- package/dist/contract-emit-9DBda5Ou.mjs.map +1 -0
- package/dist/contract-emit-B77TsJqf.mjs +327 -0
- package/dist/contract-emit-B77TsJqf.mjs.map +1 -0
- package/dist/{contract-enrichment-CAOELa-H.mjs → contract-enrichment-Dani0mMW.mjs} +4 -6
- package/dist/contract-enrichment-Dani0mMW.mjs.map +1 -0
- package/dist/{contract-infer-D9cC3rJm.mjs → contract-infer-BK9YFGEG.mjs} +13 -22
- package/dist/contract-infer-BK9YFGEG.mjs.map +1 -0
- package/dist/db-verify-C0y1PCO2.mjs +404 -0
- package/dist/db-verify-C0y1PCO2.mjs.map +1 -0
- package/dist/exports/config-types.mjs +1 -2
- package/dist/exports/control-api.d.mts +101 -586
- package/dist/exports/control-api.d.mts.map +1 -1
- package/dist/exports/control-api.mjs +4 -6
- package/dist/exports/index.d.mts.map +1 -1
- package/dist/exports/index.mjs +28 -30
- package/dist/exports/index.mjs.map +1 -1
- package/dist/exports/init-output.d.mts +2 -4
- package/dist/exports/init-output.d.mts.map +1 -1
- package/dist/exports/init-output.mjs +2 -3
- package/dist/extension-pack-inputs-C7xgE-vv.mjs +74 -0
- package/dist/extension-pack-inputs-C7xgE-vv.mjs.map +1 -0
- package/dist/{framework-components-Cr--XBKy.mjs → framework-components-ChqVUxR-.mjs} +3 -4
- package/dist/{framework-components-Cr--XBKy.mjs.map → framework-components-ChqVUxR-.mjs.map} +1 -1
- package/dist/global-flags-Icqpxk23.d.mts +12 -0
- package/dist/global-flags-Icqpxk23.d.mts.map +1 -0
- package/dist/helpers-eqdN8tH6.mjs +25 -0
- package/dist/helpers-eqdN8tH6.mjs.map +1 -0
- package/dist/{init-C5220SY9.mjs → init-CoDVPvQ4.mjs} +26 -35
- package/dist/init-CoDVPvQ4.mjs.map +1 -0
- package/dist/{inspect-live-schema-yrHAvG71.mjs → inspect-live-schema-CWYxGKlb.mjs} +10 -11
- package/dist/inspect-live-schema-CWYxGKlb.mjs.map +1 -0
- package/dist/migration-cli.d.mts +41 -12
- package/dist/migration-cli.d.mts.map +1 -1
- package/dist/migration-cli.mjs +309 -86
- package/dist/migration-cli.mjs.map +1 -1
- package/dist/{migration-command-scaffold-B3B09et6.mjs → migration-command-scaffold-B5dORFEv.mjs} +8 -9
- package/dist/migration-command-scaffold-B5dORFEv.mjs.map +1 -0
- package/dist/migration-plan-C6lVaHsO.mjs +554 -0
- package/dist/migration-plan-C6lVaHsO.mjs.map +1 -0
- package/dist/{migration-status-DUMiH8_G.mjs → migration-status-CZ-D5k7k.mjs} +272 -65
- package/dist/migration-status-CZ-D5k7k.mjs.map +1 -0
- package/dist/migrations-D_UJnpuW.mjs +216 -0
- package/dist/migrations-D_UJnpuW.mjs.map +1 -0
- package/dist/{output-BpcQrnnq.mjs → output-B16Kefzx.mjs} +9 -3
- package/dist/output-B16Kefzx.mjs.map +1 -0
- package/dist/{progress-adapter-DvQWB1nK.mjs → progress-adapter-DFfvZcYL.mjs} +2 -2
- package/dist/{progress-adapter-DvQWB1nK.mjs.map → progress-adapter-DFfvZcYL.mjs.map} +1 -1
- package/dist/result-handler-rmPVKIP2.mjs +25 -0
- package/dist/result-handler-rmPVKIP2.mjs.map +1 -0
- package/dist/rolldown-runtime-twds-ZHy.mjs +14 -0
- package/dist/{terminal-ui-C3ZLwQxK.mjs → terminal-ui-C_hFNbAn.mjs} +4 -28
- package/dist/terminal-ui-C_hFNbAn.mjs.map +1 -0
- package/dist/types-D7x-IFLO.d.mts +858 -0
- package/dist/types-D7x-IFLO.d.mts.map +1 -0
- package/dist/{verify-Bkycc-Tf.mjs → verify-CiwNWM9N.mjs} +3 -4
- package/dist/verify-CiwNWM9N.mjs.map +1 -0
- package/package.json +19 -17
- package/dist/cli-errors-BFYgBH3L.d.mts +0 -4
- package/dist/cli-errors-Cd79vmTH.mjs +0 -5
- package/dist/client-CrsnY58k.mjs +0 -997
- package/dist/client-CrsnY58k.mjs.map +0 -1
- package/dist/commands/db-verify.mjs.map +0 -1
- package/dist/commands/migration-plan.mjs.map +0 -1
- package/dist/config-loader-C25b63rJ.mjs.map +0 -1
- package/dist/contract-emit--feXyNd7.mjs +0 -4
- package/dist/contract-emit-NJ01hiiv.mjs +0 -195
- package/dist/contract-emit-NJ01hiiv.mjs.map +0 -1
- package/dist/contract-emit-V5SSitUT.mjs +0 -122
- package/dist/contract-emit-V5SSitUT.mjs.map +0 -1
- package/dist/contract-enrichment-CAOELa-H.mjs.map +0 -1
- package/dist/contract-infer-D9cC3rJm.mjs.map +0 -1
- package/dist/extract-operation-statements-DsFfxXVZ.mjs +0 -13
- package/dist/extract-operation-statements-DsFfxXVZ.mjs.map +0 -1
- package/dist/extract-sql-ddl-D9UbZDyz.mjs +0 -26
- package/dist/extract-sql-ddl-D9UbZDyz.mjs.map +0 -1
- package/dist/init-C5220SY9.mjs.map +0 -1
- package/dist/inspect-live-schema-yrHAvG71.mjs.map +0 -1
- package/dist/migration-command-scaffold-B3B09et6.mjs.map +0 -1
- package/dist/migration-status-DUMiH8_G.mjs.map +0 -1
- package/dist/migrations-Bo5WtTla.mjs +0 -153
- package/dist/migrations-Bo5WtTla.mjs.map +0 -1
- package/dist/output-BpcQrnnq.mjs.map +0 -1
- package/dist/result-handler-Ba3zWQsI.mjs.map +0 -1
- package/dist/terminal-ui-C3ZLwQxK.mjs.map +0 -1
- package/dist/validate-contract-deps-B_Cs29TL.mjs +0 -37
- package/dist/validate-contract-deps-B_Cs29TL.mjs.map +0 -1
- package/dist/verify-Bkycc-Tf.mjs.map +0 -1
|
@@ -1,624 +1,139 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { ControlAdapterDescriptor, ControlDriverDescriptor, ControlExtensionDescriptor, ControlFamilyDescriptor, ControlStack, ControlTargetDescriptor, CoreSchemaView, MigrationPlanOperation, MigrationPlannerConflict, SignDatabaseResult, SignDatabaseResult as SignDatabaseResult$1, VerifyDatabaseResult, VerifyDatabaseResult as VerifyDatabaseResult$1, VerifyDatabaseSchemaResult, VerifyDatabaseSchemaResult as VerifyDatabaseSchemaResult$1 } from "@prisma-next/framework-components/control";
|
|
1
|
+
import { A as ExecuteDbVerifyOptions, C as EmitSuccess, D as SchemaVerifyOptions, E as OnControlProgress, M as executeDbVerify, O as SignOptions, S as EmitResult, _ as DbUpdateSuccess, a as ControlClient, b as EmitFailureCode, c as DbInitFailure, d as DbInitResult, f as DbInitSuccess, g as DbUpdateResult, h as DbUpdateOptions, i as ControlActionName, j as ExecuteDbVerifyResult, k as VerifyOptions, l as DbInitFailureCode, m as DbUpdateFailureCode, n as ContractEmitOptions, o as ControlClientOptions, p as DbUpdateFailure, r as ContractEmitResult, s as ControlProgressEvent, u as DbInitOptions, v as EmitContractConfig, w as IntrospectOptions, x as EmitOptions, y as EmitFailure } from "../types-D7x-IFLO.mjs";
|
|
2
|
+
import { ControlDriverInstance, ControlExtensionDescriptor, ControlFamilyInstance, ControlStack, SignDatabaseResult, TargetMigrationsCapability, VerifyDatabaseResult, VerifyDatabaseSchemaResult } from "@prisma-next/framework-components/control";
|
|
4
3
|
import { TargetBoundComponentDescriptor } from "@prisma-next/framework-components/components";
|
|
5
|
-
import { Contract
|
|
6
|
-
|
|
7
|
-
//#region src/control-api/types.d.ts
|
|
4
|
+
import { Contract } from "@prisma-next/contract/types";
|
|
8
5
|
|
|
6
|
+
//#region src/control-api/client.d.ts
|
|
9
7
|
/**
|
|
10
|
-
*
|
|
8
|
+
* Creates a programmatic control client for Prisma Next operations.
|
|
11
9
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
10
|
+
* The client accepts framework component descriptors at creation time,
|
|
11
|
+
* manages driver lifecycle via connect()/close(), and exposes domain
|
|
12
|
+
* operations that delegate to the existing family instance methods.
|
|
14
13
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* are not compatible with the base ControlFamilyDescriptor type due to TypeScript
|
|
18
|
-
* variance rules. The client implementation casts these internally.
|
|
14
|
+
* @see {@link ControlClient} for the client interface
|
|
15
|
+
* @see README.md "Programmatic Control API" section for usage examples
|
|
19
16
|
*/
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
readonly adapter: ControlAdapterDescriptor<any, any, any>;
|
|
24
|
-
/** Optional - control client can be created without driver for offline operations */
|
|
25
|
-
readonly driver?: ControlDriverDescriptor<any, any, any, any>;
|
|
26
|
-
readonly extensionPacks?: ReadonlyArray<ControlExtensionDescriptor<any, any, any>>;
|
|
27
|
-
/**
|
|
28
|
-
* Optional default connection for auto-connect.
|
|
29
|
-
* When provided, operations will auto-connect if not already connected.
|
|
30
|
-
* The type is driver-specific (e.g., string URL for Postgres).
|
|
31
|
-
*/
|
|
32
|
-
readonly connection?: unknown;
|
|
33
|
-
}
|
|
17
|
+
declare function createControlClient(options: ControlClientOptions): ControlClient;
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region src/control-api/contract-enrichment.d.ts
|
|
34
20
|
/**
|
|
35
|
-
*
|
|
21
|
+
* Enriches a raw contract with framework-derived metadata: capabilities from all component descriptors and extension pack metadata from extension descriptors. Produces deterministically sorted output.
|
|
36
22
|
*/
|
|
37
|
-
|
|
23
|
+
declare function enrichContract(ir: Contract, components: ReadonlyArray<TargetBoundComponentDescriptor<string, string>>): Contract;
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region src/control-api/operations/contract-emit.d.ts
|
|
38
26
|
/**
|
|
39
|
-
*
|
|
27
|
+
* Canonical contract emit operation.
|
|
40
28
|
*
|
|
41
|
-
*
|
|
42
|
-
* - `
|
|
43
|
-
* -
|
|
29
|
+
* This is the SINGLE publication path used by both the CLI command
|
|
30
|
+
* (`prisma-next contract emit`) and the Vite plugin
|
|
31
|
+
* (`@prisma-next/vite-plugin-contract-emit`). New callers must go through this
|
|
32
|
+
* function rather than re-implementing load → emit → publish.
|
|
44
33
|
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
34
|
+
* The whole flow (load config → resolve source → emit bytes → atomic publish)
|
|
35
|
+
* is serialized per output JSON path via `queueEmitByOutput`. Concurrent calls
|
|
36
|
+
* for the same output line up FIFO; the user-visible outcome is "last
|
|
37
|
+
* submission wins on disk" without any supersession bookkeeping. Within a
|
|
38
|
+
* single emit, `publishContractArtifactPair` stages temp files, renames
|
|
39
|
+
* `contract.d.ts` before `contract.json`, and attempts to restore the previous
|
|
40
|
+
* pair if either rename fails — so type-only consumers never observe a
|
|
41
|
+
* mismatched pair.
|
|
47
42
|
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
43
|
+
* @throws {CliStructuredError} on config/source/validation problems
|
|
44
|
+
* @throws {DOMException} `AbortError` if cancelled via `signal`
|
|
50
45
|
*/
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
readonly spanId: string;
|
|
55
|
-
readonly parentSpanId?: string;
|
|
56
|
-
readonly label: string;
|
|
57
|
-
} | {
|
|
58
|
-
readonly action: ControlActionName;
|
|
59
|
-
readonly kind: 'spanEnd';
|
|
60
|
-
readonly spanId: string;
|
|
61
|
-
readonly outcome: 'ok' | 'skipped' | 'error';
|
|
62
|
-
};
|
|
46
|
+
declare function executeContractEmit(options: ContractEmitOptions): Promise<ContractEmitResult>;
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region src/control-api/operations/db-init.d.ts
|
|
63
49
|
/**
|
|
64
|
-
*
|
|
50
|
+
* Options for executing the `db init` operation.
|
|
65
51
|
*
|
|
66
|
-
*
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
*
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
*/
|
|
80
|
-
readonly connection?: unknown;
|
|
81
|
-
/** Optional progress callback for observing operation progress */
|
|
82
|
-
readonly onProgress?: OnControlProgress;
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Options for the schemaVerify operation.
|
|
86
|
-
*/
|
|
87
|
-
interface SchemaVerifyOptions {
|
|
88
|
-
/** Contract or unvalidated JSON - validated at runtime via familyInstance.validateContract() */
|
|
89
|
-
readonly contract: unknown;
|
|
90
|
-
/**
|
|
91
|
-
* Whether to use strict mode for schema verification.
|
|
92
|
-
* In strict mode, extra tables/columns are reported as issues.
|
|
93
|
-
* Default: false (tolerant mode - allows superset)
|
|
94
|
-
*/
|
|
95
|
-
readonly strict?: boolean;
|
|
96
|
-
/**
|
|
97
|
-
* Database connection. If provided, schemaVerify will connect before executing.
|
|
98
|
-
* If omitted, the client must already be connected.
|
|
99
|
-
* The type is driver-specific (e.g., string URL for Postgres).
|
|
100
|
-
*/
|
|
101
|
-
readonly connection?: unknown;
|
|
102
|
-
/** Optional progress callback for observing operation progress */
|
|
103
|
-
readonly onProgress?: OnControlProgress;
|
|
104
|
-
}
|
|
105
|
-
/**
|
|
106
|
-
* Options for the sign operation.
|
|
107
|
-
*/
|
|
108
|
-
interface SignOptions {
|
|
109
|
-
/** Contract or unvalidated JSON - validated at runtime via familyInstance.validateContract() */
|
|
110
|
-
readonly contract: unknown;
|
|
111
|
-
/**
|
|
112
|
-
* Path to the contract file (for metadata in the result).
|
|
113
|
-
*/
|
|
114
|
-
readonly contractPath?: string;
|
|
115
|
-
/**
|
|
116
|
-
* Path to the config file (for metadata in the result).
|
|
117
|
-
*/
|
|
118
|
-
readonly configPath?: string;
|
|
119
|
-
/**
|
|
120
|
-
* Database connection. If provided, sign will connect before executing.
|
|
121
|
-
* If omitted, the client must already be connected.
|
|
122
|
-
* The type is driver-specific (e.g., string URL for Postgres).
|
|
123
|
-
*/
|
|
124
|
-
readonly connection?: unknown;
|
|
125
|
-
/** Optional progress callback for observing operation progress */
|
|
126
|
-
readonly onProgress?: OnControlProgress;
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* Options for the dbInit operation.
|
|
130
|
-
*/
|
|
131
|
-
interface DbInitOptions {
|
|
132
|
-
/** Contract or unvalidated JSON - validated at runtime via familyInstance.validateContract() */
|
|
133
|
-
readonly contract: unknown;
|
|
134
|
-
/**
|
|
135
|
-
* Mode for the dbInit operation.
|
|
136
|
-
* - 'plan': Returns planned operations without applying
|
|
137
|
-
* - 'apply': Applies operations and writes marker
|
|
138
|
-
*/
|
|
139
|
-
readonly mode: 'plan' | 'apply';
|
|
140
|
-
/**
|
|
141
|
-
* Database connection. If provided, dbInit will connect before executing.
|
|
142
|
-
* If omitted, the client must already be connected.
|
|
143
|
-
* The type is driver-specific (e.g., string URL for Postgres).
|
|
144
|
-
*/
|
|
145
|
-
readonly connection?: unknown;
|
|
146
|
-
/** Optional progress callback for observing operation progress */
|
|
147
|
-
readonly onProgress?: OnControlProgress;
|
|
148
|
-
}
|
|
149
|
-
/**
|
|
150
|
-
* Options for the dbUpdate operation.
|
|
52
|
+
* `db init` runs the loader → planner → runner pipeline:
|
|
53
|
+
*
|
|
54
|
+
* 1. {@link executeAggregateApply} loads a `ContractSpaceAggregate` via
|
|
55
|
+
* {@link import('@prisma-next/migration-tools/aggregate').loadContractSpaceAggregate}
|
|
56
|
+
* from the supplied descriptor set + on-disk on-disk artefacts.
|
|
57
|
+
* 2. The aggregate planner runs with `callerPolicy.ignoreGraphFor`
|
|
58
|
+
* locked to the app member — synth strategy for the app, graph-walk
|
|
59
|
+
* for every extension.
|
|
60
|
+
* 3. The runner's `executeAcrossSpaces` applies the per-space plans
|
|
61
|
+
* inside one outer transaction.
|
|
62
|
+
*
|
|
63
|
+
* `extensionPacks` mirrors `Config.extensionPacks` (descriptor list).
|
|
64
|
+
* The loader (sub-spec § Loader) is the sole descriptor-import boundary.
|
|
151
65
|
*/
|
|
152
|
-
interface
|
|
153
|
-
|
|
154
|
-
readonly
|
|
155
|
-
|
|
156
|
-
* Mode for the dbUpdate operation.
|
|
157
|
-
* - 'plan': Returns planned operations without applying
|
|
158
|
-
* - 'apply': Applies operations and writes marker/ledger
|
|
159
|
-
*/
|
|
66
|
+
interface ExecuteDbInitOptions<TFamilyId extends string, TTargetId extends string> {
|
|
67
|
+
readonly driver: ControlDriverInstance<TFamilyId, TTargetId>;
|
|
68
|
+
readonly familyInstance: ControlFamilyInstance<TFamilyId, unknown>;
|
|
69
|
+
readonly contract: Contract;
|
|
160
70
|
readonly mode: 'plan' | 'apply';
|
|
71
|
+
readonly migrations: TargetMigrationsCapability<TFamilyId, TTargetId, ControlFamilyInstance<TFamilyId, unknown>>;
|
|
72
|
+
readonly frameworkComponents: ReadonlyArray<TargetBoundComponentDescriptor<TFamilyId, TTargetId>>;
|
|
161
73
|
/**
|
|
162
|
-
*
|
|
163
|
-
*
|
|
164
|
-
* The type is driver-specific (e.g., string URL for Postgres).
|
|
165
|
-
*/
|
|
166
|
-
readonly connection?: unknown;
|
|
167
|
-
/**
|
|
168
|
-
* When true, allows applying plans that contain destructive operations
|
|
169
|
-
* (e.g., DROP TABLE, DROP COLUMN, ALTER TYPE).
|
|
170
|
-
* When false (default), the operation returns a failure if the plan
|
|
171
|
-
* includes destructive operations, prompting the user to confirm interactively
|
|
172
|
-
* or re-run with -y/--yes.
|
|
74
|
+
* On-disk migrations directory the aggregate loader reads on-disk
|
|
75
|
+
* artefacts from. Required.
|
|
173
76
|
*/
|
|
174
|
-
readonly
|
|
175
|
-
/** Optional progress callback for observing operation progress */
|
|
176
|
-
readonly onProgress?: OnControlProgress;
|
|
177
|
-
}
|
|
178
|
-
/**
|
|
179
|
-
* Options for the introspect operation.
|
|
180
|
-
*/
|
|
181
|
-
interface IntrospectOptions {
|
|
77
|
+
readonly migrationsDir: string;
|
|
182
78
|
/**
|
|
183
|
-
*
|
|
79
|
+
* Resolved adapter target id. Threaded through to the loader for
|
|
80
|
+
* target-consistency checks across descriptors and the app contract.
|
|
184
81
|
*/
|
|
185
|
-
readonly
|
|
82
|
+
readonly targetId: TTargetId;
|
|
186
83
|
/**
|
|
187
|
-
*
|
|
188
|
-
*
|
|
189
|
-
*
|
|
84
|
+
* Declared extension descriptors. Defaults to an empty list, which
|
|
85
|
+
* routes through the same loader → planner → runner pipeline with no
|
|
86
|
+
* extension members in the aggregate.
|
|
190
87
|
*/
|
|
191
|
-
readonly
|
|
88
|
+
readonly extensionPacks?: ReadonlyArray<ControlExtensionDescriptor<TFamilyId, TTargetId>>;
|
|
192
89
|
/** Optional progress callback for observing operation progress */
|
|
193
90
|
readonly onProgress?: OnControlProgress;
|
|
194
91
|
}
|
|
195
92
|
/**
|
|
196
|
-
*
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
*/
|
|
202
|
-
readonly source: ContractSourceProvider;
|
|
203
|
-
/**
|
|
204
|
-
* Output path for contract.json.
|
|
205
|
-
* The .d.ts types file will be colocated (e.g., contract.json → contract.d.ts).
|
|
206
|
-
*/
|
|
207
|
-
readonly output: string;
|
|
208
|
-
}
|
|
209
|
-
/**
|
|
210
|
-
* Options for the emit operation.
|
|
211
|
-
*/
|
|
212
|
-
interface EmitOptions {
|
|
213
|
-
/**
|
|
214
|
-
* Contract configuration containing source, output, and types paths.
|
|
215
|
-
*/
|
|
216
|
-
readonly contractConfig: EmitContractConfig;
|
|
217
|
-
/** Optional progress callback for observing operation progress */
|
|
218
|
-
readonly onProgress?: OnControlProgress;
|
|
219
|
-
}
|
|
220
|
-
/**
|
|
221
|
-
* Successful dbInit result.
|
|
222
|
-
*/
|
|
223
|
-
interface DbInitSuccess {
|
|
224
|
-
readonly mode: 'plan' | 'apply';
|
|
225
|
-
readonly plan: {
|
|
226
|
-
readonly operations: ReadonlyArray<{
|
|
227
|
-
readonly id: string;
|
|
228
|
-
readonly label: string;
|
|
229
|
-
readonly operationClass: string;
|
|
230
|
-
}>;
|
|
231
|
-
readonly sql?: ReadonlyArray<string>;
|
|
232
|
-
};
|
|
233
|
-
readonly destination: {
|
|
234
|
-
readonly storageHash: string;
|
|
235
|
-
readonly profileHash?: string;
|
|
236
|
-
};
|
|
237
|
-
readonly execution?: {
|
|
238
|
-
readonly operationsPlanned: number;
|
|
239
|
-
readonly operationsExecuted: number;
|
|
240
|
-
};
|
|
241
|
-
readonly marker?: {
|
|
242
|
-
readonly storageHash: string;
|
|
243
|
-
readonly profileHash?: string;
|
|
244
|
-
};
|
|
245
|
-
readonly summary: string;
|
|
246
|
-
}
|
|
247
|
-
/**
|
|
248
|
-
* Failure codes for dbInit operation.
|
|
249
|
-
*/
|
|
250
|
-
type DbInitFailureCode = 'PLANNING_FAILED' | 'MARKER_ORIGIN_MISMATCH' | 'RUNNER_FAILED';
|
|
251
|
-
/**
|
|
252
|
-
* Failure details for dbInit operation.
|
|
253
|
-
*/
|
|
254
|
-
interface DbInitFailure {
|
|
255
|
-
readonly code: DbInitFailureCode;
|
|
256
|
-
readonly summary: string;
|
|
257
|
-
readonly why: string | undefined;
|
|
258
|
-
readonly conflicts: ReadonlyArray<MigrationPlannerConflict> | undefined;
|
|
259
|
-
readonly meta: Record<string, unknown> | undefined;
|
|
260
|
-
readonly marker?: {
|
|
261
|
-
readonly storageHash?: string;
|
|
262
|
-
readonly profileHash?: string;
|
|
263
|
-
};
|
|
264
|
-
readonly destination?: {
|
|
265
|
-
readonly storageHash: string;
|
|
266
|
-
readonly profileHash?: string | undefined;
|
|
267
|
-
};
|
|
268
|
-
}
|
|
269
|
-
/**
|
|
270
|
-
* Result type for dbInit operation.
|
|
271
|
-
* Uses Result pattern: success returns DbInitSuccess, failure returns DbInitFailure.
|
|
93
|
+
* Execute `db init` against the configured contract.
|
|
94
|
+
*
|
|
95
|
+
* Routes through the loader → planner → runner pipeline (sub-spec
|
|
96
|
+
* "Commit-by-commit § Commit 4"). Always additive-only; destructive
|
|
97
|
+
* changes belong to `db update`.
|
|
272
98
|
*/
|
|
273
|
-
|
|
99
|
+
declare function executeDbInit<TFamilyId extends string, TTargetId extends string>(options: ExecuteDbInitOptions<TFamilyId, TTargetId>): Promise<DbInitResult>;
|
|
100
|
+
//#endregion
|
|
101
|
+
//#region src/control-api/operations/db-update.d.ts
|
|
274
102
|
/**
|
|
275
|
-
*
|
|
276
|
-
|
|
277
|
-
|
|
103
|
+
* Options for the `db update` operation.
|
|
104
|
+
*
|
|
105
|
+
* Same loader → planner → runner pipeline as `db init`, but with the
|
|
106
|
+
* widened operation policy (additive + widening + destructive). The
|
|
107
|
+
* destructive-change confirmation gate runs at this layer: when
|
|
108
|
+
* `mode === 'apply'` and `acceptDataLoss` is `false`, the operation
|
|
109
|
+
* pre-plans, surfaces destructive ops to the caller, and aborts.
|
|
110
|
+
*/
|
|
111
|
+
interface ExecuteDbUpdateOptions<TFamilyId extends string, TTargetId extends string> {
|
|
112
|
+
readonly driver: ControlDriverInstance<TFamilyId, TTargetId>;
|
|
113
|
+
readonly familyInstance: ControlFamilyInstance<TFamilyId, unknown>;
|
|
114
|
+
readonly contract: Contract;
|
|
278
115
|
readonly mode: 'plan' | 'apply';
|
|
279
|
-
readonly
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
readonly sql?: ReadonlyArray<string>;
|
|
286
|
-
};
|
|
287
|
-
readonly destination: {
|
|
288
|
-
readonly storageHash: string;
|
|
289
|
-
readonly profileHash?: string;
|
|
290
|
-
};
|
|
291
|
-
readonly execution?: {
|
|
292
|
-
readonly operationsPlanned: number;
|
|
293
|
-
readonly operationsExecuted: number;
|
|
294
|
-
};
|
|
295
|
-
readonly marker?: {
|
|
296
|
-
readonly storageHash: string;
|
|
297
|
-
readonly profileHash?: string;
|
|
298
|
-
};
|
|
299
|
-
readonly summary: string;
|
|
300
|
-
}
|
|
301
|
-
/**
|
|
302
|
-
* Failure codes for dbUpdate operation.
|
|
303
|
-
*/
|
|
304
|
-
type DbUpdateFailureCode = 'PLANNING_FAILED' | 'RUNNER_FAILED' | 'DESTRUCTIVE_CHANGES';
|
|
305
|
-
/**
|
|
306
|
-
* Failure details for dbUpdate operation.
|
|
307
|
-
*/
|
|
308
|
-
interface DbUpdateFailure {
|
|
309
|
-
readonly code: DbUpdateFailureCode;
|
|
310
|
-
readonly summary: string;
|
|
311
|
-
readonly why: string | undefined;
|
|
312
|
-
readonly conflicts: ReadonlyArray<MigrationPlannerConflict> | undefined;
|
|
313
|
-
readonly meta: Record<string, unknown> | undefined;
|
|
314
|
-
}
|
|
315
|
-
/**
|
|
316
|
-
* Result type for dbUpdate operation.
|
|
317
|
-
* Uses Result pattern: success returns DbUpdateSuccess, failure returns DbUpdateFailure.
|
|
318
|
-
*/
|
|
319
|
-
type DbUpdateResult = Result<DbUpdateSuccess, DbUpdateFailure>;
|
|
320
|
-
/**
|
|
321
|
-
* Successful emit result.
|
|
322
|
-
* Contains the hashes and paths of emitted files.
|
|
323
|
-
*/
|
|
324
|
-
interface EmitSuccess {
|
|
325
|
-
/** Storage hash of the emitted contract */
|
|
326
|
-
readonly storageHash: string;
|
|
327
|
-
/** Execution hash of the emitted contract (if execution section exists) */
|
|
328
|
-
readonly executionHash?: string;
|
|
329
|
-
/** Profile hash of the emitted contract (target-specific) */
|
|
330
|
-
readonly profileHash: string;
|
|
331
|
-
/** The emitted contract as JSON string */
|
|
332
|
-
readonly contractJson: string;
|
|
333
|
-
/** The emitted contract TypeScript declarations */
|
|
334
|
-
readonly contractDts: string;
|
|
335
|
-
}
|
|
336
|
-
/**
|
|
337
|
-
* Failure codes for emit operation.
|
|
338
|
-
*/
|
|
339
|
-
type EmitFailureCode = 'CONTRACT_SOURCE_INVALID' | 'CONTRACT_VALIDATION_FAILED' | 'EMIT_FAILED';
|
|
340
|
-
/**
|
|
341
|
-
* Failure details for emit operation.
|
|
342
|
-
*/
|
|
343
|
-
interface EmitFailure {
|
|
344
|
-
readonly code: EmitFailureCode;
|
|
345
|
-
readonly summary: string;
|
|
346
|
-
readonly why: string | undefined;
|
|
347
|
-
readonly meta: Record<string, unknown> | undefined;
|
|
348
|
-
readonly diagnostics?: ContractSourceDiagnostics;
|
|
349
|
-
}
|
|
350
|
-
/**
|
|
351
|
-
* Result type for emit operation.
|
|
352
|
-
* Uses Result pattern: success returns EmitSuccess, failure returns EmitFailure.
|
|
353
|
-
*/
|
|
354
|
-
type EmitResult = Result<EmitSuccess, EmitFailure>;
|
|
355
|
-
/**
|
|
356
|
-
* A pre-planned migration step ready for execution.
|
|
357
|
-
* Contains the manifest metadata and the serialized operations from ops.json.
|
|
358
|
-
*/
|
|
359
|
-
interface MigrationApplyStep {
|
|
360
|
-
readonly dirName: string;
|
|
361
|
-
readonly from: string;
|
|
362
|
-
readonly to: string;
|
|
363
|
-
readonly toContract: Contract;
|
|
364
|
-
readonly operations: readonly MigrationPlanOperation[];
|
|
365
|
-
}
|
|
366
|
-
/**
|
|
367
|
-
* Options for the migrationApply operation.
|
|
368
|
-
*/
|
|
369
|
-
interface MigrationApplyOptions {
|
|
370
|
-
/**
|
|
371
|
-
* Hash of the database state this apply path starts from.
|
|
372
|
-
* This is resolved by the caller (typically the CLI orchestration layer).
|
|
373
|
-
*/
|
|
374
|
-
readonly originHash: string;
|
|
375
|
-
/**
|
|
376
|
-
* Hash of the target contract this apply path must reach.
|
|
377
|
-
* This is resolved by the caller (typically the CLI orchestration layer).
|
|
378
|
-
*/
|
|
379
|
-
readonly destinationHash: string;
|
|
380
|
-
/**
|
|
381
|
-
* Ordered list of migrations to execute from originHash to destinationHash.
|
|
382
|
-
* The execution layer does not choose defaults; it only executes this explicit path.
|
|
383
|
-
*/
|
|
384
|
-
readonly pendingMigrations: readonly MigrationApplyStep[];
|
|
385
|
-
/**
|
|
386
|
-
* Database connection. If provided, migrationApply will connect before executing.
|
|
387
|
-
* If omitted, the client must already be connected.
|
|
388
|
-
*/
|
|
389
|
-
readonly connection?: unknown;
|
|
390
|
-
/** Optional progress callback for observing operation progress */
|
|
116
|
+
readonly migrations: TargetMigrationsCapability<TFamilyId, TTargetId, ControlFamilyInstance<TFamilyId, unknown>>;
|
|
117
|
+
readonly frameworkComponents: ReadonlyArray<TargetBoundComponentDescriptor<TFamilyId, TTargetId>>;
|
|
118
|
+
readonly acceptDataLoss?: boolean;
|
|
119
|
+
readonly migrationsDir: string;
|
|
120
|
+
readonly targetId: TTargetId;
|
|
121
|
+
readonly extensionPacks?: ReadonlyArray<ControlExtensionDescriptor<TFamilyId, TTargetId>>;
|
|
391
122
|
readonly onProgress?: OnControlProgress;
|
|
392
123
|
}
|
|
393
124
|
/**
|
|
394
|
-
*
|
|
395
|
-
*/
|
|
396
|
-
interface MigrationApplyAppliedEntry {
|
|
397
|
-
readonly dirName: string;
|
|
398
|
-
readonly from: string;
|
|
399
|
-
readonly to: string;
|
|
400
|
-
readonly operationsExecuted: number;
|
|
401
|
-
}
|
|
402
|
-
/**
|
|
403
|
-
* Successful migrationApply result.
|
|
404
|
-
*/
|
|
405
|
-
interface MigrationApplySuccess {
|
|
406
|
-
readonly migrationsApplied: number;
|
|
407
|
-
readonly markerHash: string;
|
|
408
|
-
readonly applied: readonly MigrationApplyAppliedEntry[];
|
|
409
|
-
readonly summary: string;
|
|
410
|
-
}
|
|
411
|
-
/**
|
|
412
|
-
* Failure codes for migrationApply operation.
|
|
413
|
-
*/
|
|
414
|
-
type MigrationApplyFailureCode = 'RUNNER_FAILED' | 'MIGRATION_PATH_NOT_FOUND';
|
|
415
|
-
/**
|
|
416
|
-
* Failure details for migrationApply operation.
|
|
417
|
-
*/
|
|
418
|
-
interface MigrationApplyFailure {
|
|
419
|
-
readonly code: MigrationApplyFailureCode;
|
|
420
|
-
readonly summary: string;
|
|
421
|
-
readonly why: string | undefined;
|
|
422
|
-
readonly meta: Record<string, unknown> | undefined;
|
|
423
|
-
}
|
|
424
|
-
/**
|
|
425
|
-
* Result type for migrationApply operation.
|
|
426
|
-
*/
|
|
427
|
-
type MigrationApplyResult = Result<MigrationApplySuccess, MigrationApplyFailure>;
|
|
428
|
-
/**
|
|
429
|
-
* Options for the standalone executeContractEmit function.
|
|
430
|
-
* Used by tooling (e.g., Vite plugin) that needs to emit contracts
|
|
431
|
-
* without the full ControlClient infrastructure.
|
|
432
|
-
*/
|
|
433
|
-
interface ContractEmitOptions {
|
|
434
|
-
/** Path to the prisma-next.config.ts file */
|
|
435
|
-
readonly configPath: string;
|
|
436
|
-
/** Optional AbortSignal for cancellation support */
|
|
437
|
-
readonly signal?: AbortSignal;
|
|
438
|
-
}
|
|
439
|
-
/**
|
|
440
|
-
* Result from the standalone executeContractEmit function.
|
|
441
|
-
*/
|
|
442
|
-
interface ContractEmitResult {
|
|
443
|
-
/** Hash of the storage contract (schema-level) */
|
|
444
|
-
readonly storageHash: string;
|
|
445
|
-
/** Hash of the execution contract (if execution section exists) */
|
|
446
|
-
readonly executionHash?: string;
|
|
447
|
-
/** Hash of the profile (target+extensions) */
|
|
448
|
-
readonly profileHash: string;
|
|
449
|
-
/** Paths to the emitted files */
|
|
450
|
-
readonly files: {
|
|
451
|
-
/** Path to the emitted contract.json file */
|
|
452
|
-
readonly json: string;
|
|
453
|
-
/** Path to the emitted contract.d.ts file */
|
|
454
|
-
readonly dts: string;
|
|
455
|
-
};
|
|
456
|
-
}
|
|
457
|
-
/**
|
|
458
|
-
* Programmatic control client for Prisma Next operations.
|
|
459
|
-
*
|
|
460
|
-
* Lifecycle: `connect(connection)` before operations, `close()` when done.
|
|
461
|
-
* Both `init()` and `connect()` are auto-called by operations if needed,
|
|
462
|
-
* but `connect()` requires a connection so must be called explicitly first
|
|
463
|
-
* unless a default connection was provided in options.
|
|
125
|
+
* Execute `db update` against the configured contract.
|
|
464
126
|
*
|
|
465
|
-
*
|
|
127
|
+
* Routes through the loader → planner → runner pipeline. Destructive
|
|
128
|
+
* operations require either `acceptDataLoss: true` or a prior
|
|
129
|
+
* `mode: 'plan'` invocation that surfaces the destructive ops; the
|
|
130
|
+
* confirmation gate is implemented here so the lower-level applier
|
|
131
|
+
* remains policy-agnostic.
|
|
466
132
|
*/
|
|
467
|
-
|
|
468
|
-
/**
|
|
469
|
-
* Initializes the client by creating the control plane stack,
|
|
470
|
-
* family instance, and validating framework components.
|
|
471
|
-
*
|
|
472
|
-
* Idempotent (safe to call multiple times).
|
|
473
|
-
* Called automatically by `connect()` if not already initialized.
|
|
474
|
-
*/
|
|
475
|
-
init(): void;
|
|
476
|
-
/**
|
|
477
|
-
* Establishes a database connection.
|
|
478
|
-
* Auto-calls `init()` if not already initialized.
|
|
479
|
-
* Must be called before any database operations unless a default connection
|
|
480
|
-
* was provided in options.
|
|
481
|
-
*
|
|
482
|
-
* @param connection - Driver-specific connection input (e.g., URL string for Postgres).
|
|
483
|
-
* If omitted, uses the default connection from options (if provided).
|
|
484
|
-
* @throws If connection fails, already connected, driver is not configured,
|
|
485
|
-
* or no connection provided and no default connection in options.
|
|
486
|
-
*/
|
|
487
|
-
connect(connection?: unknown): Promise<void>;
|
|
488
|
-
/**
|
|
489
|
-
* Closes the database connection.
|
|
490
|
-
* Idempotent (safe to call multiple times).
|
|
491
|
-
* After close(), can call `connect()` again with same or different URL.
|
|
492
|
-
*/
|
|
493
|
-
close(): Promise<void>;
|
|
494
|
-
/**
|
|
495
|
-
* Verifies database marker matches the contract.
|
|
496
|
-
* Compares storageHash and profileHash.
|
|
497
|
-
*
|
|
498
|
-
* @returns Structured result (ok: false for mismatch, not throwing)
|
|
499
|
-
* @throws If not connected or infrastructure failure
|
|
500
|
-
*/
|
|
501
|
-
verify(options: VerifyOptions): Promise<VerifyDatabaseResult$1>;
|
|
502
|
-
/**
|
|
503
|
-
* Verifies database schema satisfies the contract requirements.
|
|
504
|
-
*
|
|
505
|
-
* @param options.strict - If true, extra tables/columns are issues. Default: false
|
|
506
|
-
* @returns Structured result with schema issues
|
|
507
|
-
* @throws If not connected or infrastructure failure
|
|
508
|
-
*/
|
|
509
|
-
schemaVerify(options: SchemaVerifyOptions): Promise<VerifyDatabaseSchemaResult$1>;
|
|
510
|
-
/**
|
|
511
|
-
* Signs the database with a contract signature.
|
|
512
|
-
* Writes or updates the signature if schema verification passes.
|
|
513
|
-
* Idempotent (no-op if signature already matches).
|
|
514
|
-
*
|
|
515
|
-
* @returns Structured result
|
|
516
|
-
* @throws If not connected or infrastructure failure
|
|
517
|
-
*/
|
|
518
|
-
sign(options: SignOptions): Promise<SignDatabaseResult$1>;
|
|
519
|
-
/**
|
|
520
|
-
* Initializes database schema from contract.
|
|
521
|
-
* Uses additive-only policy (no destructive changes).
|
|
522
|
-
*
|
|
523
|
-
* @param options.mode - 'plan' to preview, 'apply' to execute
|
|
524
|
-
* @returns Result pattern: Ok with planned/executed operations, NotOk with failure details
|
|
525
|
-
* @throws If not connected, target doesn't support migrations, or infrastructure failure
|
|
526
|
-
*/
|
|
527
|
-
dbInit(options: DbInitOptions): Promise<DbInitResult>;
|
|
528
|
-
/**
|
|
529
|
-
* Updates a database schema to match the current contract.
|
|
530
|
-
* Creates the signature table if it does not exist. No preconditions required.
|
|
531
|
-
* Allows additive, widening, and destructive operation classes.
|
|
532
|
-
*
|
|
533
|
-
* @param options.mode - 'plan' to preview, 'apply' to execute
|
|
534
|
-
* @returns Result pattern: Ok with planned/executed operations, NotOk with failure details
|
|
535
|
-
* @throws If not connected, target doesn't support migrations, or infrastructure failure
|
|
536
|
-
*/
|
|
537
|
-
dbUpdate(options: DbUpdateOptions): Promise<DbUpdateResult>;
|
|
538
|
-
/**
|
|
539
|
-
* Reads the contract marker from the database.
|
|
540
|
-
* Returns null if no marker exists (fresh database).
|
|
541
|
-
*
|
|
542
|
-
* @throws If not connected or infrastructure failure
|
|
543
|
-
*/
|
|
544
|
-
readMarker(): Promise<ContractMarkerRecord | null>;
|
|
545
|
-
/**
|
|
546
|
-
* Applies pre-planned on-disk migrations to the database.
|
|
547
|
-
* Each migration runs in its own transaction with full execution checks.
|
|
548
|
-
* Resume-safe: re-running after failure picks up from the last applied migration.
|
|
549
|
-
*
|
|
550
|
-
* @param options.originHash - Explicit source hash for the apply path
|
|
551
|
-
* @param options.destinationHash - Explicit destination hash for the apply path
|
|
552
|
-
* @param options.pendingMigrations - Ordered migrations to execute
|
|
553
|
-
* @returns Result pattern: Ok with applied details, NotOk with failure details
|
|
554
|
-
* @throws If not connected, target doesn't support migrations, or infrastructure failure
|
|
555
|
-
*/
|
|
556
|
-
migrationApply(options: MigrationApplyOptions): Promise<MigrationApplyResult>;
|
|
557
|
-
/**
|
|
558
|
-
* Introspects the database schema.
|
|
559
|
-
*
|
|
560
|
-
* @returns Raw schema IR
|
|
561
|
-
* @throws If not connected or infrastructure failure
|
|
562
|
-
*/
|
|
563
|
-
introspect(options?: IntrospectOptions): Promise<unknown>;
|
|
564
|
-
/**
|
|
565
|
-
* Converts a schema IR to a schema view for CLI tree rendering.
|
|
566
|
-
* Delegates to the family instance's toSchemaView method.
|
|
567
|
-
*
|
|
568
|
-
* @param schemaIR - The schema IR from introspect()
|
|
569
|
-
* @returns CoreSchemaView if the family supports it, undefined otherwise
|
|
570
|
-
*/
|
|
571
|
-
toSchemaView(schemaIR: unknown): CoreSchemaView | undefined;
|
|
572
|
-
/**
|
|
573
|
-
* Emits the contract to JSON and TypeScript declarations.
|
|
574
|
-
* This is an offline operation that does NOT require a database connection.
|
|
575
|
-
* Uses `init()` to create the stack but does NOT call `connect()`.
|
|
576
|
-
*
|
|
577
|
-
* @returns Result pattern: Ok with emit details, NotOk with failure details
|
|
578
|
-
*/
|
|
579
|
-
emit(options: EmitOptions): Promise<EmitResult>;
|
|
580
|
-
}
|
|
133
|
+
declare function executeDbUpdate<TFamilyId extends string, TTargetId extends string>(options: ExecuteDbUpdateOptions<TFamilyId, TTargetId>): Promise<DbUpdateResult>;
|
|
581
134
|
//#endregion
|
|
582
|
-
//#region src/
|
|
583
|
-
|
|
584
|
-
* Creates a programmatic control client for Prisma Next operations.
|
|
585
|
-
*
|
|
586
|
-
* The client accepts framework component descriptors at creation time,
|
|
587
|
-
* manages driver lifecycle via connect()/close(), and exposes domain
|
|
588
|
-
* operations that delegate to the existing family instance methods.
|
|
589
|
-
*
|
|
590
|
-
* @see {@link ControlClient} for the client interface
|
|
591
|
-
* @see README.md "Programmatic Control API" section for usage examples
|
|
592
|
-
*/
|
|
593
|
-
declare function createControlClient(options: ControlClientOptions): ControlClient;
|
|
594
|
-
//#endregion
|
|
595
|
-
//#region src/control-api/contract-enrichment.d.ts
|
|
596
|
-
/**
|
|
597
|
-
* Enriches a raw contract with framework-derived metadata:
|
|
598
|
-
* capabilities from all component descriptors and extension pack metadata
|
|
599
|
-
* from extension descriptors. Produces deterministically sorted output.
|
|
600
|
-
*/
|
|
601
|
-
declare function enrichContract(ir: Contract, components: ReadonlyArray<TargetBoundComponentDescriptor<string, string>>): Contract;
|
|
602
|
-
//#endregion
|
|
603
|
-
//#region src/control-api/operations/contract-emit.d.ts
|
|
604
|
-
/**
|
|
605
|
-
* Executes the contract emit operation.
|
|
606
|
-
*
|
|
607
|
-
* This is an offline operation that:
|
|
608
|
-
* 1. Loads the Prisma Next config from the specified path
|
|
609
|
-
* 2. Resolves the contract source from config
|
|
610
|
-
* 3. Creates a control plane stack and family instance
|
|
611
|
-
* 4. Emits contract artifacts (JSON and DTS)
|
|
612
|
-
* 5. Writes files to the paths specified in config
|
|
613
|
-
*
|
|
614
|
-
* Supports AbortSignal for cancellation, enabling "last change wins" behavior.
|
|
615
|
-
*
|
|
616
|
-
* @param options - Options including configPath and optional signal
|
|
617
|
-
* @returns File paths and hashes of emitted artifacts
|
|
618
|
-
* @throws If config loading fails, contract is invalid, or file I/O fails
|
|
619
|
-
* @throws signal.reason if cancelled via AbortSignal (typically DOMException with name 'AbortError')
|
|
620
|
-
*/
|
|
621
|
-
declare function executeContractEmit(options: ContractEmitOptions): Promise<ContractEmitResult>;
|
|
135
|
+
//#region src/utils/emit-queue.d.ts
|
|
136
|
+
declare function disposeEmitQueue(outputJsonPath: string): void;
|
|
622
137
|
//#endregion
|
|
623
|
-
export { type ContractEmitOptions, type ContractEmitResult, type ControlActionName, type ControlClient, type ControlClientOptions, type ControlProgressEvent, type ControlStack, type DbInitFailure, type DbInitFailureCode, type DbInitOptions, type DbInitResult, type DbInitSuccess, type DbUpdateFailure, type DbUpdateFailureCode, type DbUpdateOptions, type DbUpdateResult, type DbUpdateSuccess, type EmitContractConfig, type EmitFailure, type EmitFailureCode, type EmitOptions, type EmitResult, type EmitSuccess, type IntrospectOptions, type OnControlProgress, type SchemaVerifyOptions, type SignDatabaseResult, type SignOptions, type VerifyDatabaseResult, type VerifyDatabaseSchemaResult, type VerifyOptions, createControlClient, enrichContract, executeContractEmit };
|
|
138
|
+
export { type ContractEmitOptions, type ContractEmitResult, type ControlActionName, type ControlClient, type ControlClientOptions, type ControlProgressEvent, type ControlStack, type DbInitFailure, type DbInitFailureCode, type DbInitOptions, type DbInitResult, type DbInitSuccess, type DbUpdateFailure, type DbUpdateFailureCode, type DbUpdateOptions, type DbUpdateResult, type DbUpdateSuccess, type EmitContractConfig, type EmitFailure, type EmitFailureCode, type EmitOptions, type EmitResult, type EmitSuccess, type ExecuteDbInitOptions, type ExecuteDbUpdateOptions, type ExecuteDbVerifyOptions, type ExecuteDbVerifyResult, type IntrospectOptions, type OnControlProgress, type SchemaVerifyOptions, type SignDatabaseResult, type SignOptions, type VerifyDatabaseResult, type VerifyDatabaseSchemaResult, type VerifyOptions, createControlClient, disposeEmitQueue, enrichContract, executeContractEmit, executeDbInit, executeDbUpdate, executeDbVerify };
|
|
624
139
|
//# sourceMappingURL=control-api.d.mts.map
|