@farm.js/core 0.1.75 → 0.1.76
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/{agent-mcp.d-Djvao5eV.d.ts → agent-mcp.d-Cftp2kFv.d.ts} +1 -1
- package/dist/{agent-mcp.d-wA13pwmS.d.mts → agent-mcp.d-D0FMmqi0.d.mts} +1 -1
- package/dist/agent-runtime.cjs +2 -2
- package/dist/agent-runtime.d.mts +7 -5
- package/dist/agent-runtime.d.ts +7 -5
- package/dist/agent-runtime.mjs +1 -1
- package/dist/analyzer-KFJGYJS7.cjs +16 -0
- package/dist/{analyzer-LJHMFCDW.mjs → analyzer-NLQKPN74.mjs} +2 -2
- package/dist/api/node.d.mts +9 -7
- package/dist/api/node.d.ts +9 -7
- package/dist/api/route-manager.d.mts +9 -7
- package/dist/api/route-manager.d.ts +9 -7
- package/dist/api/runtime.d.mts +8 -6
- package/dist/api/runtime.d.ts +8 -6
- package/dist/api.d.mts +10 -8
- package/dist/api.d.ts +10 -8
- package/dist/{app-manifest.d-BukcP_EV.d.ts → app-manifest.d-7PmA_9hm.d.ts} +1 -1
- package/dist/{app-manifest.d-DIuqSi9k.d.mts → app-manifest.d-cpOw_sV5.d.mts} +1 -1
- package/dist/app-markdown.d.mts +8 -6
- package/dist/app-markdown.d.ts +8 -6
- package/dist/{app.d-YVuFb10p.d.mts → app.d-DUZvwnFF.d.mts} +5 -4
- package/dist/{app.d-BQqmM6Gy.d.ts → app.d-wOkxXre8.d.ts} +5 -4
- package/dist/{chunk-A5F55ZFA.mjs → chunk-2GZZVIXY.mjs} +1 -1
- package/dist/{chunk-4BS3HSY7.cjs → chunk-2JEXQAIR.cjs} +2 -2
- package/dist/{chunk-OZARLCYQ.cjs → chunk-2WKGQCAV.cjs} +162 -162
- package/dist/{chunk-B4CWYGCG.mjs → chunk-3OYFMOBY.mjs} +1 -1
- package/dist/{chunk-GNY7BO7R.mjs → chunk-5EEQNZLU.mjs} +2 -2
- package/dist/{chunk-XGDI4OUB.cjs → chunk-6ZFGWB75.cjs} +13 -1
- package/dist/{chunk-6MATGOEF.mjs → chunk-A2VFKOQL.mjs} +1 -1
- package/dist/{chunk-YL7BKHYE.cjs → chunk-BBRSPKFI.cjs} +277 -265
- package/dist/{chunk-BNTRXJL4.cjs → chunk-BYJPBJ4E.cjs} +3 -3
- package/dist/{chunk-4ZSZI6XL.cjs → chunk-CCQZDOQR.cjs} +8 -8
- package/dist/{chunk-OFIFRB62.mjs → chunk-CKBBKRBO.mjs} +34 -18
- package/dist/{chunk-IK33N2AN.cjs → chunk-DTNWLRRF.cjs} +144 -128
- package/dist/{chunk-BUC3FDYC.cjs → chunk-DVW6SKHA.cjs} +2 -2
- package/dist/{chunk-MFU7SXAB.mjs → chunk-E77ZKNPN.mjs} +1 -1
- package/dist/{chunk-YCNKS6SD.mjs → chunk-GP5BWTO7.mjs} +2 -2
- package/dist/{chunk-HT2SZKXG.mjs → chunk-H76C5AOU.mjs} +12 -0
- package/dist/{chunk-ZV76IQG7.cjs → chunk-HKGU2X4I.cjs} +2 -2
- package/dist/{chunk-4T2RB4JA.mjs → chunk-JL6XHQZF.mjs} +3 -3
- package/dist/{chunk-HV2WZFUW.mjs → chunk-MOS2N377.mjs} +1 -1
- package/dist/{chunk-IDOUCM2X.mjs → chunk-O225GNEU.mjs} +53 -41
- package/dist/{chunk-NPGXX7HN.cjs → chunk-PSNYVBWC.cjs} +3 -3
- package/dist/{chunk-WHCNJVYU.cjs → chunk-PXXG5BID.cjs} +3 -3
- package/dist/{chunk-TJVUTGED.mjs → chunk-Q4X3MX4J.mjs} +201 -3
- package/dist/{chunk-TFEODQLG.mjs → chunk-Q7JMHO5U.mjs} +2 -2
- package/dist/{chunk-JNZDTE75.cjs → chunk-QP4GYVRR.cjs} +6 -6
- package/dist/{chunk-HVJ7IACB.cjs → chunk-QTDIOZV6.cjs} +2 -2
- package/dist/{chunk-YSTKSZD2.mjs → chunk-SGQXJVFX.mjs} +1 -1
- package/dist/{chunk-KPYQ32BA.cjs → chunk-TMVVBK5S.cjs} +2 -2
- package/dist/{chunk-JMYXO572.cjs → chunk-UBXNTZCY.cjs} +205 -7
- package/dist/{chunk-2NQ3S2SJ.mjs → chunk-VDJ3CLBR.mjs} +1 -1
- package/dist/{chunk-WJ5CCQBM.cjs → chunk-WILPJVQE.cjs} +4 -4
- package/dist/{chunk-PBQGIA27.cjs → chunk-WJDMH3E7.cjs} +4 -4
- package/dist/{chunk-ZPCZWEU3.cjs → chunk-WMJQNVKX.cjs} +2 -2
- package/dist/{chunk-H7QY7ZE4.mjs → chunk-X3HUT4JU.mjs} +1 -1
- package/dist/{chunk-IVBDRAOR.cjs → chunk-XLOORES5.cjs} +1 -1
- package/dist/{chunk-QGYHE6VJ.mjs → chunk-YHE7HH2I.mjs} +19 -19
- package/dist/{chunk-4MU4QCX4.mjs → chunk-YONTMPZ6.mjs} +1 -1
- package/dist/{chunk-GLF44JKY.mjs → chunk-YQXJY7E7.mjs} +1 -1
- package/dist/cli-runtime.d-D84CwyPI.d.ts +535 -0
- package/dist/cli-runtime.d-OQY2pgwK.d.mts +535 -0
- package/dist/client/lifecycle.d.mts +1 -1
- package/dist/client/lifecycle.d.ts +1 -1
- package/dist/{client-component.d-CZ1NpHAY.d.ts → client-component.d-Bf8jZqW7.d.ts} +2 -137
- package/dist/{client-component.d-BeqVuqy2.d.mts → client-component.d-Bh6CfC5z.d.mts} +2 -137
- package/dist/{client-plugins.d-D9kWC0QB.d.ts → client-plugins.d-DuujrC8d.d.ts} +4 -4
- package/dist/{client-plugins.d-ChceYO9t.d.mts → client-plugins.d-r3K2oQ6w.d.mts} +4 -4
- package/dist/client-plugins.d.mts +7 -5
- package/dist/client-plugins.d.ts +7 -5
- package/dist/client.d.mts +12 -10
- package/dist/client.d.ts +12 -10
- package/dist/config.d.mts +7 -5
- package/dist/config.d.ts +7 -5
- package/dist/desktop.d.mts +8 -6
- package/dist/desktop.d.ts +8 -6
- package/dist/{devtools-T5I2WHRX.cjs → devtools-3WZIZ7KK.cjs} +3 -3
- package/dist/{devtools-B3W3DLPG.mjs → devtools-MBZPUH3U.mjs} +2 -2
- package/dist/docs.cjs +4 -4
- package/dist/docs.d.mts +10 -65
- package/dist/docs.d.ts +10 -65
- package/dist/docs.mjs +3 -3
- package/dist/environment/vite.cjs +3 -3
- package/dist/environment/vite.mjs +2 -2
- package/dist/handler.d-Bd5lRSvb.d.ts +62 -0
- package/dist/handler.d-SRH-AKzf.d.mts +62 -0
- package/dist/{headers.d-BawakaPv.d.mts → headers.d-CHHvyaIG.d.mts} +1 -1
- package/dist/{headers.d-Aux4JVnm.d.ts → headers.d-D-OvGikv.d.ts} +1 -1
- package/dist/index.cjs +22 -20
- package/dist/index.d-BOPsgMlI.d.mts +16 -0
- package/dist/index.d-BiUtYJUG.d.ts +16 -0
- package/dist/index.d.mts +39 -556
- package/dist/index.d.ts +39 -556
- package/dist/index.mjs +21 -19
- package/dist/integrations/orm.cjs +3 -3
- package/dist/integrations/orm.d.mts +6 -4
- package/dist/integrations/orm.d.ts +6 -4
- package/dist/integrations/orm.mjs +2 -2
- package/dist/integrations.cjs +2 -2
- package/dist/integrations.d.mts +7 -5
- package/dist/integrations.d.ts +7 -5
- package/dist/integrations.mjs +1 -1
- package/dist/internal/app-markdown-runtime.d.mts +8 -6
- package/dist/internal/app-markdown-runtime.d.ts +8 -6
- package/dist/internal/build-runtime.cjs +19 -19
- package/dist/internal/build-runtime.d.mts +10 -7
- package/dist/internal/build-runtime.d.ts +10 -7
- package/dist/internal/build-runtime.mjs +18 -18
- package/dist/internal/cli-runtime.cjs +11 -6
- package/dist/internal/cli-runtime.d.mts +45 -0
- package/dist/internal/cli-runtime.d.ts +45 -0
- package/dist/internal/cli-runtime.mjs +10 -5
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.d.mts +11 -9
- package/dist/internal/client-runtime.d.ts +11 -9
- package/dist/internal/compression-runtime.d.mts +7 -5
- package/dist/internal/compression-runtime.d.ts +7 -5
- package/dist/internal/config-runtime.cjs +4 -4
- package/dist/internal/config-runtime.d.mts +9 -7
- package/dist/internal/config-runtime.d.ts +9 -7
- package/dist/internal/config-runtime.mjs +3 -3
- package/dist/internal/infra-analytics-runtime.cjs +6 -6
- package/dist/internal/infra-analytics-runtime.mjs +4 -4
- package/dist/internal/native-server-fns.cjs +4 -4
- package/dist/internal/native-server-fns.mjs +3 -3
- package/dist/internal/product-telemetry-runtime.cjs +3 -3
- package/dist/internal/product-telemetry-runtime.mjs +2 -2
- package/dist/internal/production-runtime.cjs +7 -7
- package/dist/internal/production-runtime.d.mts +16 -14
- package/dist/internal/production-runtime.d.ts +16 -14
- package/dist/internal/production-runtime.mjs +6 -6
- package/dist/internal/start-manifest.d.mts +7 -5
- package/dist/internal/start-manifest.d.ts +7 -5
- package/dist/{lifecycle.d-OtGWAvJT.d.mts → lifecycle.d-VzcXyEyn.d.mts} +1 -1
- package/dist/{lifecycle.d-OtGWAvJT.d.ts → lifecycle.d-VzcXyEyn.d.ts} +1 -1
- package/dist/markdown.d.mts +7 -5
- package/dist/markdown.d.ts +7 -5
- package/dist/middleware.d.mts +7 -5
- package/dist/middleware.d.ts +7 -5
- package/dist/{mount.d-Ca8eb9GB.d.ts → mount.d-C2yq0Zzz.d.ts} +1 -1
- package/dist/{mount.d-BomEt2kV.d.mts → mount.d-vq1HTq5u.d.mts} +1 -1
- package/dist/{navigation-delegate.d-DJCC2jXF.d.ts → navigation-delegate.d-D7xIin3i.d.ts} +1 -1
- package/dist/{navigation-delegate.d-B1ujRkYo.d.mts → navigation-delegate.d-DS2Sqm7E.d.mts} +1 -1
- package/dist/navigation.d.mts +10 -8
- package/dist/navigation.d.ts +10 -8
- package/dist/{plugin-FD4S2QEJ.mjs → plugin-6CHZBFJD.mjs} +1 -1
- package/dist/{plugin-5BNPYCER.cjs → plugin-YXPIS3XX.cjs} +2 -2
- package/dist/plugin.cjs +12 -12
- package/dist/plugin.d.mts +11 -8
- package/dist/plugin.d.ts +11 -8
- package/dist/plugin.mjs +11 -11
- package/dist/{render-plan.d-BxRbaxYA.d.ts → render-plan.d-BCq0nfdw.d.ts} +1 -1
- package/dist/{render-plan.d-CFod_Zf-.d.mts → render-plan.d-X6KqerAM.d.mts} +1 -1
- package/dist/renderer-client.d.mts +10 -8
- package/dist/renderer-client.d.ts +10 -8
- package/dist/{request.d-DG4TeXMM.d.mts → request.d-Be9rWboC.d.mts} +1 -1
- package/dist/{request.d-DRQgaXGG.d.ts → request.d-CPdq2_kC.d.ts} +1 -1
- package/dist/request.d.mts +8 -6
- package/dist/request.d.ts +8 -6
- package/dist/{route-rendering.d-BXtZKgqu.d.mts → route-rendering.d-CIPli7Ve.d.mts} +1 -1
- package/dist/{route-rendering.d-Db07UNVG.d.ts → route-rendering.d-CKB5GhQr.d.ts} +1 -1
- package/dist/{router.d-BC3hyjf0.d.ts → router.d-CvrbOXzF.d.ts} +1 -1
- package/dist/{router.d-B61kXqxJ.d.mts → router.d-VxTgLGxN.d.mts} +1 -1
- package/dist/routes.d.mts +7 -5
- package/dist/routes.d.ts +7 -5
- package/dist/{rsc-pipeline-LJ7YCGY6.mjs → rsc-pipeline-FPE4OL57.mjs} +4 -4
- package/dist/{rsc-pipeline-VENBFYXW.cjs → rsc-pipeline-TPHK74VE.cjs} +5 -5
- package/dist/{runtime-4DWUXZHS.mjs → runtime-45BD33OJ.mjs} +3 -3
- package/dist/{runtime-UNDTYGQS.cjs → runtime-UBG657UC.cjs} +5 -5
- package/dist/{runtime.d-Cl6EBGmC.d.mts → runtime.d-Cn1jiDNI.d.mts} +1 -1
- package/dist/{runtime.d-SC95yDzr.d.ts → runtime.d-Ps54JWpo.d.ts} +1 -1
- package/dist/{schema.d-Dny9pnrm.d.mts → schema.d-BM-uVGpx.d.mts} +1 -1
- package/dist/{schema.d-Dny9pnrm.d.ts → schema.d-BM-uVGpx.d.ts} +1 -1
- package/dist/schema.d.mts +1 -1
- package/dist/schema.d.ts +1 -1
- package/dist/{index.d-r1MLpgeE.d.ts → server-components-status.d-Dhtbs5lC.d.ts} +2 -15
- package/dist/{index.d-Ccq42CPU.d.mts → server-components-status.d-DnmipSb3.d.mts} +2 -15
- package/dist/server-plugins.d.mts +9 -7
- package/dist/server-plugins.d.ts +9 -7
- package/dist/server.cjs +37 -35
- package/dist/server.d.mts +17 -14
- package/dist/server.d.ts +17 -14
- package/dist/server.mjs +16 -14
- package/dist/session-ACVUJ5XV.cjs +23 -0
- package/dist/{session-QZXZOPR2.mjs → session-ASQTJNBK.mjs} +2 -2
- package/dist/{spa-router.d-DrlXgDqY.d.mts → spa-router.d-DXm5J9rM.d.mts} +4 -4
- package/dist/{spa-router.d-DwM02Mwd.d.ts → spa-router.d-cppVufl2.d.ts} +4 -4
- package/dist/ssg.d-CI5OFl8H.d.ts +138 -0
- package/dist/ssg.d-Duzy1wQc.d.mts +138 -0
- package/dist/storage.cjs +4 -2
- package/dist/storage.d.mts +14 -4
- package/dist/storage.d.ts +14 -4
- package/dist/storage.mjs +3 -1
- package/dist/testing.d.mts +7 -5
- package/dist/testing.d.ts +7 -5
- package/dist/{types.d-BnIqOn9w.d.mts → types.d-D5cY6XjK.d.mts} +43 -2
- package/dist/{types.d-BnIqOn9w.d.ts → types.d-D5cY6XjK.d.ts} +43 -2
- package/dist/{utils.d-CHzxAshz.d.mts → utils.d-CNI-I8ZV.d.mts} +1 -1
- package/dist/{utils.d-C6KXz3uB.d.ts → utils.d-D3dfy8zh.d.ts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +12 -12
- package/dist/vite.d.mts +12 -9
- package/dist/vite.d.ts +12 -9
- package/dist/vite.mjs +11 -11
- package/package.json +10 -3
- package/dist/analyzer-23GCBYFI.cjs +0 -16
- package/dist/session-2Q72D4QV.cjs +0 -23
- /package/dist/{chunk-PMU4U2W2.cjs → chunk-22T75EML.cjs} +0 -0
- /package/dist/{chunk-5O3SK3ZC.mjs → chunk-6MNDFNZW.mjs} +0 -0
- /package/dist/{chunk-Z5ZZAGIH.mjs → chunk-LSHUCNIF.mjs} +0 -0
- /package/dist/{chunk-6DBBMQWT.cjs → chunk-OWO7KDZ3.cjs} +0 -0
|
@@ -0,0 +1,535 @@
|
|
|
1
|
+
import './utils.d-D3dfy8zh.js';
|
|
2
|
+
import { F as FarmPlugin } from './client-plugins.d-DuujrC8d.js';
|
|
3
|
+
import { R as ResolvedFarmLayer } from './layers.d-CH0bC4QL.js';
|
|
4
|
+
import './ssg.d-CI5OFl8H.js';
|
|
5
|
+
import './deployment.js';
|
|
6
|
+
import './handler.d-Bd5lRSvb.js';
|
|
7
|
+
import { R as ResolvedFarmI18nConfig } from './types.d-euATAbE4.js';
|
|
8
|
+
import { d as FarmSchemaField, F as FarmSchema, R as ResolvedSchemaField, m as FarmSqlDialect, n as FarmSqlStatement, C as CollectedSchemaModel, f as FarmSchemaMigrationStep, k as FarmSchemaReference, l as FarmSchemaTablesDeclaration, j as FarmSchemaOwnerConfig } from './schema.d-BM-uVGpx.js';
|
|
9
|
+
import './routes.js';
|
|
10
|
+
import './server-components-status.d-Dhtbs5lC.js';
|
|
11
|
+
import './types.d-D5cY6XjK.js';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Reject a list field before a scalar-only schema target can silently change
|
|
15
|
+
* its value shape. Targets that genuinely preserve arrays do not call this.
|
|
16
|
+
*/
|
|
17
|
+
declare function assertNoSchemaListField(field: Pick<FarmSchemaField, "list">, fieldPath: string, target: string): void;
|
|
18
|
+
|
|
19
|
+
interface APIRouteInfo {
|
|
20
|
+
path: string;
|
|
21
|
+
methods: string[];
|
|
22
|
+
filePath: string;
|
|
23
|
+
relativePath: string;
|
|
24
|
+
}
|
|
25
|
+
declare class APITypeGenerator {
|
|
26
|
+
private appDirs;
|
|
27
|
+
constructor(appDir: string | readonly string[]);
|
|
28
|
+
/**
|
|
29
|
+
* Scan all API route files and extract route information
|
|
30
|
+
*/
|
|
31
|
+
scanAPIRoutes(): APIRouteInfo[];
|
|
32
|
+
private scanDirectory;
|
|
33
|
+
private extractRouteInfo;
|
|
34
|
+
private extractExportedMethods;
|
|
35
|
+
private isTypeOnlyExportSpecifier;
|
|
36
|
+
/**
|
|
37
|
+
* Generate TypeScript code for the API router
|
|
38
|
+
*/
|
|
39
|
+
generateAPIRouter(routes: APIRouteInfo[], options?: {
|
|
40
|
+
outFile?: string;
|
|
41
|
+
pluginConfigs?: readonly string[];
|
|
42
|
+
pluginRoutes?: readonly {
|
|
43
|
+
path: string;
|
|
44
|
+
method: string;
|
|
45
|
+
}[];
|
|
46
|
+
}): string;
|
|
47
|
+
private getRouteImportPath;
|
|
48
|
+
private pathToRouteName;
|
|
49
|
+
private uniqueRouteName;
|
|
50
|
+
private structureToTypeString;
|
|
51
|
+
private toTypePropertyKey;
|
|
52
|
+
/**
|
|
53
|
+
* Generate the API index file
|
|
54
|
+
*/
|
|
55
|
+
generateAPIIndex(outputPath: string): void;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
interface GenerateFarmTypeArtifactsOptions {
|
|
59
|
+
root: string;
|
|
60
|
+
srcDir?: string;
|
|
61
|
+
configPath?: string;
|
|
62
|
+
plugins?: readonly FarmPlugin[];
|
|
63
|
+
extraRoutes?: string[];
|
|
64
|
+
layers?: readonly ResolvedFarmLayer[];
|
|
65
|
+
suppressLintOnLink?: boolean;
|
|
66
|
+
componentExtensions?: readonly string[];
|
|
67
|
+
routeTypesOutFile?: string;
|
|
68
|
+
apiTypesOutFile?: string;
|
|
69
|
+
envTypesOutFile?: string;
|
|
70
|
+
imageTypesOutFile?: string;
|
|
71
|
+
i18nTypesOutFile?: string;
|
|
72
|
+
i18nConfig?: ResolvedFarmI18nConfig;
|
|
73
|
+
routes?: boolean;
|
|
74
|
+
api?: boolean;
|
|
75
|
+
env?: boolean;
|
|
76
|
+
images?: boolean;
|
|
77
|
+
i18n?: boolean;
|
|
78
|
+
/** Compare generated content with disk without writing files. */
|
|
79
|
+
check?: boolean;
|
|
80
|
+
}
|
|
81
|
+
interface GenerateFarmTypeArtifactsResult {
|
|
82
|
+
typesPath?: string;
|
|
83
|
+
routeTypesPath?: string;
|
|
84
|
+
apiTypesPath?: string;
|
|
85
|
+
envTypesPath?: string;
|
|
86
|
+
imageTypesPath?: string;
|
|
87
|
+
i18nTypesPath?: string;
|
|
88
|
+
apiRoutes: APIRouteInfo[];
|
|
89
|
+
/** Generated files whose checked-in content is missing or stale. */
|
|
90
|
+
stalePaths: string[];
|
|
91
|
+
}
|
|
92
|
+
declare function generateFarmTypeArtifacts(options: GenerateFarmTypeArtifactsOptions): Promise<GenerateFarmTypeArtifactsResult>;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Columns an owner adds to a table it does not own: `extend` on a model the
|
|
96
|
+
* owner marks `external` (or does not claim). The app creates the table; the
|
|
97
|
+
* owner only asks for these columns, and only an app that allows it gets them.
|
|
98
|
+
*/
|
|
99
|
+
type FarmSchemaExtension = {
|
|
100
|
+
/** The owner's migrate name, such as `loyalty`. */
|
|
101
|
+
owner: string;
|
|
102
|
+
/** The owner's name for the model, such as `user`. */
|
|
103
|
+
modelKey: string;
|
|
104
|
+
/** The real table, after the app's renames, such as `members_auth`. */
|
|
105
|
+
table: string;
|
|
106
|
+
fields: Array<{
|
|
107
|
+
fieldKey: string;
|
|
108
|
+
field: ResolvedSchemaField;
|
|
109
|
+
}>;
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* The extensions in an owner's schema. Throws, naming the column, for a column
|
|
113
|
+
* Farm cannot add safely to a table that may already hold rows.
|
|
114
|
+
*/
|
|
115
|
+
declare function collectSchemaExtensions(owner: string, schema: FarmSchema, models?: readonly string[]): FarmSchemaExtension[];
|
|
116
|
+
/** Whether the app allows an owner to add columns to this table. */
|
|
117
|
+
declare function isSchemaExtensionAllowed(allowExtend: Record<string, readonly string[]> | undefined, extension: Pick<FarmSchemaExtension, "owner" | "modelKey" | "table">): boolean;
|
|
118
|
+
|
|
119
|
+
/** The subset of a database client this needs: run a statement, read a result. */
|
|
120
|
+
type FarmSchemaExecutor = {
|
|
121
|
+
/** Run a statement that returns nothing. */
|
|
122
|
+
execute(sql: string): Promise<void>;
|
|
123
|
+
/** Run a query and return its rows. */
|
|
124
|
+
query(sql: string, params?: unknown[]): Promise<Record<string, unknown>[]>;
|
|
125
|
+
};
|
|
126
|
+
type FarmSchemaDrift = {
|
|
127
|
+
table: string;
|
|
128
|
+
/** Declared in the schema but absent from the table. */
|
|
129
|
+
missingColumns: string[];
|
|
130
|
+
/** Present in the table but not declared. Reported, never dropped. */
|
|
131
|
+
extraColumns: string[];
|
|
132
|
+
/** Columns whose stored definition differs from the schema. */
|
|
133
|
+
changedColumns: FarmSchemaColumnDrift[];
|
|
134
|
+
/** Declared indexes that are absent from the table. */
|
|
135
|
+
missingIndexes: FarmSchemaIndexDefinition[];
|
|
136
|
+
/** Stored indexes that are not declared by the schema. */
|
|
137
|
+
extraIndexes: FarmSchemaIndexDefinition[];
|
|
138
|
+
/** Declared foreign keys that are absent from the table. */
|
|
139
|
+
missingReferences: FarmSchemaReferenceDefinition[];
|
|
140
|
+
/** Stored foreign keys that are not declared by the schema. */
|
|
141
|
+
extraReferences: FarmSchemaReferenceDefinition[];
|
|
142
|
+
};
|
|
143
|
+
type FarmSchemaColumnDefinition = {
|
|
144
|
+
type: string;
|
|
145
|
+
nullable: boolean;
|
|
146
|
+
default: string | null;
|
|
147
|
+
primaryKey: boolean;
|
|
148
|
+
};
|
|
149
|
+
type FarmSchemaColumnDrift = {
|
|
150
|
+
column: string;
|
|
151
|
+
differences: Array<"type" | "nullability" | "default" | "primaryKey">;
|
|
152
|
+
expected: FarmSchemaColumnDefinition;
|
|
153
|
+
actual: FarmSchemaColumnDefinition;
|
|
154
|
+
};
|
|
155
|
+
type FarmSchemaIndexDefinition = {
|
|
156
|
+
name: string;
|
|
157
|
+
columns: string[];
|
|
158
|
+
unique: boolean;
|
|
159
|
+
};
|
|
160
|
+
type FarmSchemaReferenceDefinition = {
|
|
161
|
+
column: string;
|
|
162
|
+
referencedTable: string;
|
|
163
|
+
referencedColumn: string;
|
|
164
|
+
onDelete: "cascade" | "restrict" | "setNull" | "noAction";
|
|
165
|
+
};
|
|
166
|
+
type FarmSchemaMigratePlan = {
|
|
167
|
+
dialect: FarmSqlDialect;
|
|
168
|
+
/** Statements for tables that do not exist yet. */
|
|
169
|
+
statements: FarmSqlStatement[];
|
|
170
|
+
/** Tables that exist and already match the schema. */
|
|
171
|
+
upToDate: string[];
|
|
172
|
+
/**
|
|
173
|
+
* Additions to tables that exist: columns that can join a table with rows
|
|
174
|
+
* (nullable, or with a default the database can write) and non-unique
|
|
175
|
+
* indexes. Applied with the rest of the plan. Anything else stays in drift.
|
|
176
|
+
*/
|
|
177
|
+
upgrades?: Array<FarmSqlStatement & {
|
|
178
|
+
table: string;
|
|
179
|
+
}>;
|
|
180
|
+
/** Tables that exist but differ in ways Farm will not change on its own. */
|
|
181
|
+
drift: FarmSchemaDrift[];
|
|
182
|
+
/**
|
|
183
|
+
* Foreign keys to other owners' tables that an existing table does not
|
|
184
|
+
* have yet. Never added automatically: they need the app's approval.
|
|
185
|
+
*/
|
|
186
|
+
addableForeignKeys?: FarmSchemaAddableForeignKey[];
|
|
187
|
+
};
|
|
188
|
+
type FarmSchemaAddableForeignKey = {
|
|
189
|
+
modelKey: string;
|
|
190
|
+
table: string;
|
|
191
|
+
column: string;
|
|
192
|
+
referencedTable: string;
|
|
193
|
+
referencedColumn: string;
|
|
194
|
+
onDelete: FarmSchemaReferenceDefinition["onDelete"];
|
|
195
|
+
};
|
|
196
|
+
/**
|
|
197
|
+
* Compare resolved models against the live database and plan what to create.
|
|
198
|
+
*
|
|
199
|
+
* Creation is derivable from the schema alone, so it is safe to emit. Changing
|
|
200
|
+
* an existing table is not: a rename and a drop-plus-add look identical here,
|
|
201
|
+
* and one of them destroys data. Differences are reported for a human instead.
|
|
202
|
+
*/
|
|
203
|
+
declare function planSchemaMigration(models: readonly CollectedSchemaModel[], dialect: FarmSqlDialect, executor: FarmSchemaExecutor): Promise<FarmSchemaMigratePlan>;
|
|
204
|
+
/** A table's columns as the database reports them, normalized per dialect. */
|
|
205
|
+
type FarmSchemaTableDescription = {
|
|
206
|
+
columns: Array<{
|
|
207
|
+
name: string;
|
|
208
|
+
type: string;
|
|
209
|
+
nullable: boolean;
|
|
210
|
+
primaryKey: boolean;
|
|
211
|
+
}>;
|
|
212
|
+
};
|
|
213
|
+
/**
|
|
214
|
+
* Read any table, owned by Farm or not, or undefined when it does not exist.
|
|
215
|
+
* Used to check references to tables the app or a library created. On
|
|
216
|
+
* Postgres and MySQL a dotted name that is not itself a table, such as
|
|
217
|
+
* Supabase's `auth.users`, is read as `schema.table`, and on Postgres an
|
|
218
|
+
* unqualified name is found through the search path.
|
|
219
|
+
*/
|
|
220
|
+
declare function describeSchemaTable(executor: FarmSchemaExecutor, dialect: FarmSqlDialect, table: string): Promise<FarmSchemaTableDescription | undefined>;
|
|
221
|
+
type FarmSchemaMigrateResult = {
|
|
222
|
+
applied: string[];
|
|
223
|
+
skipped: FarmSchemaDrift[];
|
|
224
|
+
};
|
|
225
|
+
/**
|
|
226
|
+
* Run the plan's create statements. Drift is never applied: a plan that reports
|
|
227
|
+
* differences leaves those tables untouched and says so.
|
|
228
|
+
*/
|
|
229
|
+
declare function applySchemaMigration(plan: FarmSchemaMigratePlan, executor: FarmSchemaExecutor): Promise<FarmSchemaMigrateResult>;
|
|
230
|
+
/**
|
|
231
|
+
* Column type families a foreign key can join across. Same family is fine
|
|
232
|
+
* (text and varchar, integer and bigint); different families need a cast to
|
|
233
|
+
* join and can never carry a foreign key (text and uuid, text and integer).
|
|
234
|
+
*/
|
|
235
|
+
/** @internal */
|
|
236
|
+
declare function columnTypeFamily(type: string): string | undefined;
|
|
237
|
+
type FarmSchemaExtensionStatement = FarmSqlStatement & {
|
|
238
|
+
extension: FarmSchemaExtension;
|
|
239
|
+
fieldKey: string;
|
|
240
|
+
column: string;
|
|
241
|
+
};
|
|
242
|
+
type FarmSchemaExtensionPlan = {
|
|
243
|
+
/** `ALTER TABLE … ADD COLUMN` for each column the table does not have yet. */
|
|
244
|
+
statements: FarmSchemaExtensionStatement[];
|
|
245
|
+
/** Columns already there, as `table.column`. */
|
|
246
|
+
present: string[];
|
|
247
|
+
/** Extensions whose table does not exist, so nothing can be added yet. */
|
|
248
|
+
missingTables: FarmSchemaExtension[];
|
|
249
|
+
/** Columns that exist with a type the extension does not expect. Left alone. */
|
|
250
|
+
conflicts: Array<{
|
|
251
|
+
extension: FarmSchemaExtension;
|
|
252
|
+
column: string;
|
|
253
|
+
expected: string;
|
|
254
|
+
actual: string;
|
|
255
|
+
}>;
|
|
256
|
+
/** Columns this database cannot add as declared. */
|
|
257
|
+
unsupported: Array<{
|
|
258
|
+
extension: FarmSchemaExtension;
|
|
259
|
+
column: string;
|
|
260
|
+
reason: string;
|
|
261
|
+
}>;
|
|
262
|
+
};
|
|
263
|
+
/**
|
|
264
|
+
* Plan the columns owners add to tables they do not own. Only additions:
|
|
265
|
+
* a column that exists is never altered, whatever its definition.
|
|
266
|
+
*/
|
|
267
|
+
declare function planSchemaExtensions(extensions: readonly FarmSchemaExtension[], dialect: FarmSqlDialect, executor: FarmSchemaExecutor): Promise<FarmSchemaExtensionPlan>;
|
|
268
|
+
/** Render a plan as a reviewable SQL file. */
|
|
269
|
+
declare function formatSchemaMigration(plan: FarmSchemaMigratePlan, owner: string, options?: {
|
|
270
|
+
addsColumns?: boolean;
|
|
271
|
+
}): string;
|
|
272
|
+
/** Human-readable summary of tables that exist but no longer match the schema. */
|
|
273
|
+
declare function describeSchemaDrift(drift: readonly FarmSchemaDrift[]): string;
|
|
274
|
+
/**
|
|
275
|
+
* Adapt a raw database client to the executor the planner needs.
|
|
276
|
+
*
|
|
277
|
+
* Each client reports rows differently, so the shape is detected rather than
|
|
278
|
+
* configured: `pg` returns `{ rows }`, `mysql2` returns `[rows]`, and
|
|
279
|
+
* `node:sqlite` exposes prepare/exec. A key-value storage mount has no tables,
|
|
280
|
+
* which is reported as `null` rather than an error.
|
|
281
|
+
*/
|
|
282
|
+
declare function createSchemaExecutor(client: unknown, owner: string): {
|
|
283
|
+
executor: FarmSchemaExecutor;
|
|
284
|
+
dialect: FarmSqlDialect;
|
|
285
|
+
} | null;
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* What Farm last applied for each owner, kept in the app's database: the
|
|
289
|
+
* owner's version and a snapshot of its tables. Comparing it with what the
|
|
290
|
+
* installed version declares tells the app what an upgrade changes.
|
|
291
|
+
*/
|
|
292
|
+
declare const FARM_SCHEMA_STATE_TABLE = "farm_schema_state";
|
|
293
|
+
/** An owner's tables, in database terms, independent of dialect. */
|
|
294
|
+
type FarmSchemaSnapshot = {
|
|
295
|
+
tables: Record<string, {
|
|
296
|
+
columns: Record<string, {
|
|
297
|
+
type: string;
|
|
298
|
+
nullable: boolean;
|
|
299
|
+
primaryKey: boolean;
|
|
300
|
+
unique: boolean;
|
|
301
|
+
default?: unknown;
|
|
302
|
+
}>;
|
|
303
|
+
indexes: string[];
|
|
304
|
+
}>;
|
|
305
|
+
};
|
|
306
|
+
type FarmSchemaState = {
|
|
307
|
+
version?: string;
|
|
308
|
+
snapshot: FarmSchemaSnapshot;
|
|
309
|
+
appliedAt: string;
|
|
310
|
+
};
|
|
311
|
+
type FarmSchemaChanges = {
|
|
312
|
+
addedTables: string[];
|
|
313
|
+
addedColumns: Array<{
|
|
314
|
+
table: string;
|
|
315
|
+
column: string;
|
|
316
|
+
type: string;
|
|
317
|
+
}>;
|
|
318
|
+
addedIndexes: string[];
|
|
319
|
+
/** Removed or redefined: never applied on their own. */
|
|
320
|
+
otherChanges: string[];
|
|
321
|
+
/** Columns the new version no longer has, with their old type. */
|
|
322
|
+
removedColumns?: Array<{
|
|
323
|
+
table: string;
|
|
324
|
+
column: string;
|
|
325
|
+
type: string;
|
|
326
|
+
}>;
|
|
327
|
+
};
|
|
328
|
+
|
|
329
|
+
/** Where Farm records the steps it ran for each owner. */
|
|
330
|
+
declare const FARM_SCHEMA_STEPS_TABLE = "farm_schema_steps";
|
|
331
|
+
type FarmPlannedSchemaStep = {
|
|
332
|
+
step: FarmSchemaMigrationStep;
|
|
333
|
+
/** What the step does, in the app's names. */
|
|
334
|
+
summary: string;
|
|
335
|
+
phase: "before" | "after";
|
|
336
|
+
statements: string[];
|
|
337
|
+
/**
|
|
338
|
+
* `run`: pending. `record`: the database already has the step's effect, so
|
|
339
|
+
* it is only recorded. `blocked`: it cannot run; `reason` says why.
|
|
340
|
+
*/
|
|
341
|
+
state: "run" | "record" | "blocked";
|
|
342
|
+
reason?: string;
|
|
343
|
+
/** Deletes data: runs only with `--allow-destructive`. */
|
|
344
|
+
destructive?: boolean;
|
|
345
|
+
};
|
|
346
|
+
type FarmSchemaStepPlan = {
|
|
347
|
+
steps: FarmPlannedSchemaStep[];
|
|
348
|
+
/** Steps that ran here before, but whose definition has changed since. */
|
|
349
|
+
edited: string[];
|
|
350
|
+
/** Every step, when the tables are being created fresh at this version. */
|
|
351
|
+
fresh: boolean;
|
|
352
|
+
};
|
|
353
|
+
|
|
354
|
+
/** A reference from one plugin's table to a table another plugin creates. */
|
|
355
|
+
type FarmCrossOwnerReference = {
|
|
356
|
+
/** The owner whose table holds the reference. */
|
|
357
|
+
owner: string;
|
|
358
|
+
modelKey: string;
|
|
359
|
+
fieldKey: string;
|
|
360
|
+
table: string;
|
|
361
|
+
column: string;
|
|
362
|
+
referencedOwner: string;
|
|
363
|
+
referencedTable: string;
|
|
364
|
+
referencedColumn: string;
|
|
365
|
+
onDelete: NonNullable<FarmSchemaReference["onDelete"]>;
|
|
366
|
+
};
|
|
367
|
+
|
|
368
|
+
/**
|
|
369
|
+
* Every table owner an app has configured.
|
|
370
|
+
*
|
|
371
|
+
* Plugins and integrations are both searched, because either can own storage.
|
|
372
|
+
*/
|
|
373
|
+
declare function findSchemaTableOwners(config: {
|
|
374
|
+
plugins?: readonly unknown[];
|
|
375
|
+
integrations?: Record<string, unknown> | readonly unknown[];
|
|
376
|
+
}): FarmSchemaTablesDeclaration[];
|
|
377
|
+
/** Resolve one owner's declaration into the models tooling works with. */
|
|
378
|
+
declare function collectOwnerModels(owner: FarmSchemaTablesDeclaration): CollectedSchemaModel[];
|
|
379
|
+
interface MigrateSchemaTablesOptions {
|
|
380
|
+
/** The app's resolved config, handed to the owner's `resolveClient`. */
|
|
381
|
+
config?: FarmSchemaOwnerConfig;
|
|
382
|
+
/** Write the plan to this path instead of applying it. */
|
|
383
|
+
write?: string;
|
|
384
|
+
/** Execute the plan. */
|
|
385
|
+
apply?: boolean;
|
|
386
|
+
/**
|
|
387
|
+
* What to do with columns the owner adds to tables it does not own.
|
|
388
|
+
* `"report"` when the app's ORM owns those tables: they are never altered,
|
|
389
|
+
* only reported, so the ORM's migrations stay the source of truth.
|
|
390
|
+
*/
|
|
391
|
+
extensions?: "apply" | "report";
|
|
392
|
+
/** Run migration steps that delete data, such as dropping a column. */
|
|
393
|
+
allowDestructive?: boolean;
|
|
394
|
+
log?: (message: string) => void;
|
|
395
|
+
}
|
|
396
|
+
interface MigrateSchemaTablesResult {
|
|
397
|
+
plan: FarmSchemaMigratePlan;
|
|
398
|
+
sql: string;
|
|
399
|
+
applied: string[];
|
|
400
|
+
/** Foreign keys to other owners' tables that this run did not create. */
|
|
401
|
+
foreignKeys: {
|
|
402
|
+
/** The other owner has not created its table yet. */
|
|
403
|
+
waiting: FarmCrossOwnerReference[];
|
|
404
|
+
/** On an existing table, not allowed in `schema.allowForeignKeys`. */
|
|
405
|
+
unapproved: FarmSchemaAddableForeignKey[];
|
|
406
|
+
/** On an existing SQLite table, which cannot get one. */
|
|
407
|
+
unsupported: FarmSchemaAddableForeignKey[];
|
|
408
|
+
/** Allowed, but rows already point at nothing. */
|
|
409
|
+
blocked: Array<{
|
|
410
|
+
key: FarmSchemaAddableForeignKey;
|
|
411
|
+
orphans: number;
|
|
412
|
+
}>;
|
|
413
|
+
};
|
|
414
|
+
/** What the installed version changes compared with the last applied one. */
|
|
415
|
+
upgrade?: {
|
|
416
|
+
from?: string;
|
|
417
|
+
to?: string;
|
|
418
|
+
changes: FarmSchemaChanges;
|
|
419
|
+
};
|
|
420
|
+
/** The owner's migration steps: what ran now, and what is still to do. */
|
|
421
|
+
steps: {
|
|
422
|
+
plan?: FarmSchemaStepPlan;
|
|
423
|
+
ran: string[];
|
|
424
|
+
pending: string[];
|
|
425
|
+
};
|
|
426
|
+
/** Statements and steps `--apply` would run. */
|
|
427
|
+
planned: number;
|
|
428
|
+
/** Columns the owner adds to tables it does not own. */
|
|
429
|
+
extensions: FarmSchemaExtensionPlan & {
|
|
430
|
+
/** Additions the app has not allowed in `schema.allowExtend`. */
|
|
431
|
+
unapproved: FarmSchemaExtensionStatement[];
|
|
432
|
+
/** `table.column` still missing after this run, whatever the reason. */
|
|
433
|
+
pending: string[];
|
|
434
|
+
};
|
|
435
|
+
}
|
|
436
|
+
/**
|
|
437
|
+
* Plan, and optionally apply, the tables one owner needs.
|
|
438
|
+
*
|
|
439
|
+
* Nothing is executed unless `apply` is set: the default is to hand back sql a
|
|
440
|
+
* person can read before it touches a database. Columns added to tables the
|
|
441
|
+
* owner does not own also need the app's `schema.allowExtend`.
|
|
442
|
+
*/
|
|
443
|
+
declare function migrateSchemaTables(owner: FarmSchemaTablesDeclaration, options?: MigrateSchemaTablesOptions): Promise<MigrateSchemaTablesResult>;
|
|
444
|
+
|
|
445
|
+
/**
|
|
446
|
+
* Read-only checks of every schema owner against the real database.
|
|
447
|
+
*
|
|
448
|
+
* Owners are integrations that declare a `schema` and plugins that declare
|
|
449
|
+
* tables. Their tables are compared with what the database holds, and every
|
|
450
|
+
* reference to a table someone else owns (the app's ORM, an auth library,
|
|
451
|
+
* another plugin) is checked too: the table must exist and the referenced
|
|
452
|
+
* column must have a type a foreign key can use. Nothing is written.
|
|
453
|
+
*/
|
|
454
|
+
type FarmSchemaCheckSeverity = "error" | "warning";
|
|
455
|
+
type FarmSchemaCheckCode = "schema-invalid" | "owner-conflict" | "table-conflict" | "client-missing" | "client-unavailable" | "client-unsupported" | "table-missing" | "column-missing" | "column-type" | "column-definition" | "index-missing" | "foreign-key-missing" | "reference-table-missing" | "reference-column-missing" | "reference-type" | "extend-invalid" | "extend-table-missing" | "extend-column-missing" | "extend-column-type" | "extend-column-shared" | "schema-upgrade" | "migration-step-pending" | "migration-step-blocked" | "migration-step-edited";
|
|
456
|
+
interface FarmSchemaCheckIssue {
|
|
457
|
+
severity: FarmSchemaCheckSeverity;
|
|
458
|
+
code: FarmSchemaCheckCode;
|
|
459
|
+
/** The integration key or plugin name that declares the schema. */
|
|
460
|
+
owner: string;
|
|
461
|
+
table?: string;
|
|
462
|
+
column?: string;
|
|
463
|
+
message: string;
|
|
464
|
+
/** What to do about it. */
|
|
465
|
+
hint?: string;
|
|
466
|
+
}
|
|
467
|
+
interface FarmSchemaCheckOwner {
|
|
468
|
+
name: string;
|
|
469
|
+
kind: "integration" | "plugin";
|
|
470
|
+
dialect?: FarmSqlDialect;
|
|
471
|
+
/** False when the owner stores data in a key/value mount, which has no tables. */
|
|
472
|
+
relational: boolean;
|
|
473
|
+
tables: string[];
|
|
474
|
+
/** Owners whose tables this one needs, declared or implied by its schema. */
|
|
475
|
+
dependsOn: string[];
|
|
476
|
+
}
|
|
477
|
+
interface FarmSchemaCheckReport {
|
|
478
|
+
owners: FarmSchemaCheckOwner[];
|
|
479
|
+
issues: FarmSchemaCheckIssue[];
|
|
480
|
+
/** True when there are no errors. Warnings do not fail a check. */
|
|
481
|
+
ok: boolean;
|
|
482
|
+
}
|
|
483
|
+
type FarmSchemaCheckConfig = FarmSchemaOwnerConfig & {
|
|
484
|
+
plugins?: readonly unknown[];
|
|
485
|
+
};
|
|
486
|
+
interface FarmSchemaCheckOptions {
|
|
487
|
+
/**
|
|
488
|
+
* How long connecting, and each query, may take before the owner is
|
|
489
|
+
* reported unreachable. A pg client has no connect timeout of its own, so
|
|
490
|
+
* an unreachable host would otherwise hang the check. Default 10 seconds.
|
|
491
|
+
*/
|
|
492
|
+
timeoutMs?: number;
|
|
493
|
+
}
|
|
494
|
+
type SchemaOwner = {
|
|
495
|
+
name: string;
|
|
496
|
+
kind: "integration" | "plugin";
|
|
497
|
+
schema: FarmSchema;
|
|
498
|
+
models?: readonly string[];
|
|
499
|
+
dialect?: FarmSqlDialect;
|
|
500
|
+
dependsOn?: readonly string[];
|
|
501
|
+
version?: string;
|
|
502
|
+
migrations?: readonly FarmSchemaMigrationStep[];
|
|
503
|
+
resolveClient(config: FarmSchemaCheckConfig): Promise<unknown>;
|
|
504
|
+
};
|
|
505
|
+
/**
|
|
506
|
+
* Every owner of database tables in an app: integrations that declare a
|
|
507
|
+
* `schema` and plugins that declare tables. An integration that also
|
|
508
|
+
* contributes a table-owning plugin under the same name is listed once.
|
|
509
|
+
*/
|
|
510
|
+
declare function collectSchemaOwners(config: FarmSchemaCheckConfig): SchemaOwner[];
|
|
511
|
+
declare function checkSchema(config: FarmSchemaCheckConfig, options?: FarmSchemaCheckOptions): Promise<FarmSchemaCheckReport>;
|
|
512
|
+
/** Human-readable report, grouped by owner. */
|
|
513
|
+
declare function formatSchemaCheck(report: FarmSchemaCheckReport): string;
|
|
514
|
+
|
|
515
|
+
type DependencyOwner = {
|
|
516
|
+
name: string;
|
|
517
|
+
schema: FarmSchema;
|
|
518
|
+
models?: readonly string[];
|
|
519
|
+
dependsOn?: readonly string[];
|
|
520
|
+
};
|
|
521
|
+
/**
|
|
522
|
+
* Which owners need which, by owner name: what they declare in `dependsOn`,
|
|
523
|
+
* plus what their schemas imply. A reference to, or columns added to, a
|
|
524
|
+
* table another owner creates makes that owner a dependency. An owner whose
|
|
525
|
+
* schema cannot be resolved contributes only what it declares.
|
|
526
|
+
*/
|
|
527
|
+
declare function collectSchemaDependencies(owners: readonly DependencyOwner[]): Map<string, Set<string>>;
|
|
528
|
+
/**
|
|
529
|
+
* Owners with their dependencies first, otherwise in the order given. When
|
|
530
|
+
* owners only refer to each other, every one is still listed exactly once:
|
|
531
|
+
* without foreign keys between them, either can be created first.
|
|
532
|
+
*/
|
|
533
|
+
declare function orderSchemaOwners<TOwner extends DependencyOwner>(owners: readonly TOwner[], dependencies?: ReadonlyMap<string, ReadonlySet<string>>): TOwner[];
|
|
534
|
+
|
|
535
|
+
export { APITypeGenerator as A, type GenerateFarmTypeArtifactsResult as B, type MigrateSchemaTablesResult as C, applySchemaMigration as D, assertNoSchemaListField as E, FARM_SCHEMA_STATE_TABLE as F, type GenerateFarmTypeArtifactsOptions as G, checkSchema as H, collectOwnerModels as I, collectSchemaDependencies as J, collectSchemaExtensions as K, collectSchemaOwners as L, type MigrateSchemaTablesOptions as M, columnTypeFamily as N, createSchemaExecutor as O, describeSchemaDrift as P, describeSchemaTable as Q, findSchemaTableOwners as R, formatSchemaCheck as S, formatSchemaMigration as T, generateFarmTypeArtifacts as U, isSchemaExtensionAllowed as V, migrateSchemaTables as W, orderSchemaOwners as X, planSchemaExtensions as Y, planSchemaMigration as Z, FARM_SCHEMA_STEPS_TABLE as a, type FarmCrossOwnerReference as b, type FarmSchemaAddableForeignKey as c, type FarmSchemaChanges as d, type FarmSchemaCheckCode as e, type FarmSchemaCheckConfig as f, type FarmSchemaCheckIssue as g, type FarmSchemaCheckOptions as h, type FarmSchemaCheckOwner as i, type FarmSchemaCheckReport as j, type FarmSchemaCheckSeverity as k, type FarmSchemaColumnDefinition as l, type FarmSchemaColumnDrift as m, type FarmSchemaDrift as n, type FarmSchemaExecutor as o, type FarmSchemaExtension as p, type FarmSchemaExtensionPlan as q, type FarmSchemaExtensionStatement as r, type FarmSchemaIndexDefinition as s, type FarmSchemaMigratePlan as t, type FarmSchemaMigrateResult as u, type FarmSchemaReferenceDefinition as v, type FarmSchemaSnapshot as w, type FarmSchemaState as x, type FarmSchemaStepPlan as y, type FarmSchemaTableDescription as z };
|