joist-codegen 2.3.0-next.7 → 2.3.0-next.70
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/build/EntityDbMetadata.cjs +642 -0
- package/build/EntityDbMetadata.cjs.map +1 -0
- package/build/EntityDbMetadata.d.cts +299 -0
- package/build/EntityDbMetadata.d.cts.map +1 -0
- package/build/EntityDbMetadata.d.mts +299 -0
- package/build/EntityDbMetadata.d.mts.map +1 -0
- package/build/EntityDbMetadata.js +519 -661
- package/build/EntityDbMetadata.js.map +1 -1
- package/build/_virtual/_rolldown/runtime.cjs +23 -0
- package/build/_virtual/_rolldown/runtime.js +5 -0
- package/build/assignTags.cjs +45 -0
- package/build/assignTags.cjs.map +1 -0
- package/build/{assignTags.d.ts → assignTags.d.cts} +8 -4
- package/build/assignTags.d.cts.map +1 -0
- package/build/assignTags.d.mts +16 -0
- package/build/assignTags.d.mts.map +1 -0
- package/build/assignTags.js +37 -59
- package/build/assignTags.js.map +1 -1
- package/build/codemods/Codemod.cjs +2 -0
- package/build/codemods/Codemod.d.cts +17 -0
- package/build/codemods/Codemod.d.cts.map +1 -0
- package/build/codemods/Codemod.d.mts +17 -0
- package/build/codemods/Codemod.d.mts.map +1 -0
- package/build/codemods/Codemod.js +2 -3
- package/build/codemods/JscodeshiftMod.cjs +42 -0
- package/build/codemods/JscodeshiftMod.cjs.map +1 -0
- package/build/codemods/JscodeshiftMod.d.cts +14 -0
- package/build/codemods/JscodeshiftMod.d.cts.map +1 -0
- package/build/codemods/JscodeshiftMod.d.mts +14 -0
- package/build/codemods/JscodeshiftMod.d.mts.map +1 -0
- package/build/codemods/JscodeshiftMod.js +33 -33
- package/build/codemods/JscodeshiftMod.js.map +1 -1
- package/build/codemods/codemod_0001-rename_has_async_property.cjs +30 -0
- package/build/codemods/codemod_0001-rename_has_async_property.cjs.map +1 -0
- package/build/codemods/codemod_0001-rename_has_async_property.d.cts +9 -0
- package/build/codemods/codemod_0001-rename_has_async_property.d.cts.map +1 -0
- package/build/codemods/codemod_0001-rename_has_async_property.d.mts +9 -0
- package/build/codemods/codemod_0001-rename_has_async_property.d.mts.map +1 -0
- package/build/codemods/codemod_0001-rename_has_async_property.js +21 -25
- package/build/codemods/codemod_0001-rename_has_async_property.js.map +1 -1
- package/build/codemods/codemod_0002-rename_async_query_fields.cjs +50 -0
- package/build/codemods/codemod_0002-rename_async_query_fields.cjs.map +1 -0
- package/build/codemods/codemod_0002-rename_async_query_fields.d.cts +9 -0
- package/build/codemods/codemod_0002-rename_async_query_fields.d.cts.map +1 -0
- package/build/codemods/codemod_0002-rename_async_query_fields.d.mts +9 -0
- package/build/codemods/codemod_0002-rename_async_query_fields.d.mts.map +1 -0
- package/build/codemods/codemod_0002-rename_async_query_fields.js +38 -52
- package/build/codemods/codemod_0002-rename_async_query_fields.js.map +1 -1
- package/build/codemods/codemod_0003-rename_find_paginated.cjs +25 -0
- package/build/codemods/codemod_0003-rename_find_paginated.cjs.map +1 -0
- package/build/codemods/codemod_0003-rename_find_paginated.d.cts +9 -0
- package/build/codemods/codemod_0003-rename_find_paginated.d.cts.map +1 -0
- package/build/codemods/codemod_0003-rename_find_paginated.d.mts +9 -0
- package/build/codemods/codemod_0003-rename_find_paginated.d.mts.map +1 -0
- package/build/codemods/codemod_0003-rename_find_paginated.js +17 -26
- package/build/codemods/codemod_0003-rename_find_paginated.js.map +1 -1
- package/build/codemods/index.cjs +49 -0
- package/build/codemods/index.cjs.map +1 -0
- package/build/codemods/index.d.cts +12 -0
- package/build/codemods/index.d.cts.map +1 -0
- package/build/codemods/index.d.mts +12 -0
- package/build/codemods/index.d.mts.map +1 -0
- package/build/codemods/index.js +34 -42
- package/build/codemods/index.js.map +1 -1
- package/build/config.cjs +377 -0
- package/build/config.cjs.map +1 -0
- package/build/config.d.cts +181 -0
- package/build/config.d.cts.map +1 -0
- package/build/config.d.mts +181 -0
- package/build/config.d.mts.map +1 -0
- package/build/config.js +309 -347
- package/build/config.js.map +1 -1
- package/build/docs/cache.cjs +62 -0
- package/build/docs/cache.cjs.map +1 -0
- package/build/docs/cache.d.cts +17 -0
- package/build/docs/cache.d.cts.map +1 -0
- package/build/docs/cache.d.mts +17 -0
- package/build/docs/cache.d.mts.map +1 -0
- package/build/docs/cache.js +52 -53
- package/build/docs/cache.js.map +1 -1
- package/build/docs/generate-metadata-docs.cjs +32 -0
- package/build/docs/generate-metadata-docs.cjs.map +1 -0
- package/build/docs/generate-metadata-docs.d.cts +9 -0
- package/build/docs/generate-metadata-docs.d.cts.map +1 -0
- package/build/docs/generate-metadata-docs.d.mts +9 -0
- package/build/docs/generate-metadata-docs.d.mts.map +1 -0
- package/build/docs/generate-metadata-docs.js +19 -24
- package/build/docs/generate-metadata-docs.js.map +1 -1
- package/build/docs/index.cjs +90 -0
- package/build/docs/index.cjs.map +1 -0
- package/build/docs/index.d.cts +16 -0
- package/build/docs/index.d.cts.map +1 -0
- package/build/docs/index.d.mts +16 -0
- package/build/docs/index.d.mts.map +1 -0
- package/build/docs/index.js +75 -80
- package/build/docs/index.js.map +1 -1
- package/build/docs/markdown.cjs +181 -0
- package/build/docs/markdown.cjs.map +1 -0
- package/build/docs/{markdown.d.ts → markdown.d.cts} +14 -12
- package/build/docs/markdown.d.cts.map +1 -0
- package/build/docs/markdown.d.mts +32 -0
- package/build/docs/markdown.d.mts.map +1 -0
- package/build/docs/markdown.js +152 -220
- package/build/docs/markdown.js.map +1 -1
- package/build/docs/parsing.cjs +117 -0
- package/build/docs/parsing.cjs.map +1 -0
- package/build/docs/parsing.d.cts +48 -0
- package/build/docs/parsing.d.cts.map +1 -0
- package/build/docs/parsing.d.mts +48 -0
- package/build/docs/parsing.d.mts.map +1 -0
- package/build/docs/parsing.js +89 -88
- package/build/docs/parsing.js.map +1 -1
- package/build/findEntityScopes.cjs +119 -0
- package/build/findEntityScopes.cjs.map +1 -0
- package/build/findEntityScopes.d.cts +14 -0
- package/build/findEntityScopes.d.cts.map +1 -0
- package/build/findEntityScopes.d.mts +14 -0
- package/build/findEntityScopes.d.mts.map +1 -0
- package/build/findEntityScopes.js +83 -111
- package/build/findEntityScopes.js.map +1 -1
- package/build/foreignKeyOrdering.cjs +52 -0
- package/build/foreignKeyOrdering.cjs.map +1 -0
- package/build/foreignKeyOrdering.d.cts +8 -0
- package/build/foreignKeyOrdering.d.cts.map +1 -0
- package/build/foreignKeyOrdering.d.mts +8 -0
- package/build/foreignKeyOrdering.d.mts.map +1 -0
- package/build/foreignKeyOrdering.js +46 -55
- package/build/foreignKeyOrdering.js.map +1 -1
- package/build/generate.cjs +128 -0
- package/build/generate.cjs.map +1 -0
- package/build/generate.d.cts +17 -0
- package/build/generate.d.cts.map +1 -0
- package/build/generate.d.mts +17 -0
- package/build/generate.d.mts.map +1 -0
- package/build/generate.js +111 -124
- package/build/generate.js.map +1 -1
- package/build/generateEntitiesFile.cjs +46 -0
- package/build/generateEntitiesFile.cjs.map +1 -0
- package/build/generateEntitiesFile.d.cts +11 -0
- package/build/generateEntitiesFile.d.cts.map +1 -0
- package/build/generateEntitiesFile.d.mts +11 -0
- package/build/generateEntitiesFile.d.mts.map +1 -0
- package/build/generateEntitiesFile.js +28 -25
- package/build/generateEntitiesFile.js.map +1 -1
- package/build/generateEntityCodegenFile.cjs +1009 -0
- package/build/generateEntityCodegenFile.cjs.map +1 -0
- package/build/generateEntityCodegenFile.d.cts +16 -0
- package/build/generateEntityCodegenFile.d.cts.map +1 -0
- package/build/generateEntityCodegenFile.d.mts +16 -0
- package/build/generateEntityCodegenFile.d.mts.map +1 -0
- package/build/generateEntityCodegenFile.js +792 -827
- package/build/generateEntityCodegenFile.js.map +1 -1
- package/build/generateEntityFile.cjs +23 -0
- package/build/generateEntityFile.cjs.map +1 -0
- package/build/generateEntityFile.d.cts +9 -0
- package/build/generateEntityFile.d.cts.map +1 -0
- package/build/generateEntityFile.d.mts +9 -0
- package/build/generateEntityFile.d.mts.map +1 -0
- package/build/generateEntityFile.js +11 -8
- package/build/generateEntityFile.js.map +1 -1
- package/build/generateEntityTestFile.cjs +25 -0
- package/build/generateEntityTestFile.cjs.map +1 -0
- package/build/generateEntityTestFile.d.cts +9 -0
- package/build/generateEntityTestFile.d.cts.map +1 -0
- package/build/generateEntityTestFile.d.mts +9 -0
- package/build/generateEntityTestFile.d.mts.map +1 -0
- package/build/generateEntityTestFile.js +10 -7
- package/build/generateEntityTestFile.js.map +1 -1
- package/build/generateEnumFile.cjs +73 -0
- package/build/generateEnumFile.cjs.map +1 -0
- package/build/generateEnumFile.d.cts +9 -0
- package/build/generateEnumFile.d.cts.map +1 -0
- package/build/generateEnumFile.d.mts +9 -0
- package/build/generateEnumFile.d.mts.map +1 -0
- package/build/generateEnumFile.js +33 -43
- package/build/generateEnumFile.js.map +1 -1
- package/build/generateFactoriesFiles.cjs +28 -0
- package/build/generateFactoriesFiles.cjs.map +1 -0
- package/build/generateFactoriesFiles.d.cts +7 -0
- package/build/generateFactoriesFiles.d.cts.map +1 -0
- package/build/generateFactoriesFiles.d.mts +7 -0
- package/build/generateFactoriesFiles.d.mts.map +1 -0
- package/build/generateFactoriesFiles.js +21 -16
- package/build/generateFactoriesFiles.js.map +1 -1
- package/build/generateFlushFunction.cjs +61 -0
- package/build/generateFlushFunction.cjs.map +1 -0
- package/build/{generateFlushFunction.d.ts → generateFlushFunction.d.cts} +8 -5
- package/build/generateFlushFunction.d.cts.map +1 -0
- package/build/generateFlushFunction.d.mts +23 -0
- package/build/generateFlushFunction.d.mts.map +1 -0
- package/build/generateFlushFunction.js +32 -78
- package/build/generateFlushFunction.js.map +1 -1
- package/build/generateMetadataFile.cjs +307 -0
- package/build/generateMetadataFile.cjs.map +1 -0
- package/build/generateMetadataFile.d.cts +10 -0
- package/build/generateMetadataFile.d.cts.map +1 -0
- package/build/generateMetadataFile.d.mts +10 -0
- package/build/generateMetadataFile.d.mts.map +1 -0
- package/build/generateMetadataFile.js +148 -156
- package/build/generateMetadataFile.js.map +1 -1
- package/build/generatePgEnumFile.cjs +21 -0
- package/build/generatePgEnumFile.cjs.map +1 -0
- package/build/generatePgEnumFile.d.cts +9 -0
- package/build/generatePgEnumFile.d.cts.map +1 -0
- package/build/generatePgEnumFile.d.mts +9 -0
- package/build/generatePgEnumFile.d.mts.map +1 -0
- package/build/generatePgEnumFile.js +12 -9
- package/build/generatePgEnumFile.js.map +1 -1
- package/build/index.cjs +135 -0
- package/build/index.cjs.map +1 -0
- package/build/index.d.cts +12 -0
- package/build/index.d.cts.map +1 -0
- package/build/index.d.mts +12 -0
- package/build/index.d.mts.map +1 -0
- package/build/index.js +108 -127
- package/build/index.js.map +1 -1
- package/build/inheritance.cjs +241 -0
- package/build/inheritance.cjs.map +1 -0
- package/build/inheritance.d.cts +13 -0
- package/build/inheritance.d.cts.map +1 -0
- package/build/inheritance.d.mts +13 -0
- package/build/inheritance.d.mts.map +1 -0
- package/build/inheritance.js +221 -247
- package/build/inheritance.js.map +1 -1
- package/build/installSkills.cjs +68 -0
- package/build/installSkills.cjs.map +1 -0
- package/build/installSkills.d.cts +16 -0
- package/build/installSkills.d.cts.map +1 -0
- package/build/installSkills.d.mts +16 -0
- package/build/installSkills.d.mts.map +1 -0
- package/build/installSkills.js +67 -0
- package/build/installSkills.js.map +1 -0
- package/build/keywords.cjs +7 -0
- package/build/keywords.cjs.map +1 -0
- package/build/keywords.d.cts +5 -0
- package/build/keywords.d.cts.map +1 -0
- package/build/keywords.d.mts +5 -0
- package/build/keywords.d.mts.map +1 -0
- package/build/keywords.js +5 -4
- package/build/keywords.js.map +1 -1
- package/build/loadMetadata.cjs +39 -0
- package/build/loadMetadata.cjs.map +1 -0
- package/build/loadMetadata.d.cts +31 -0
- package/build/loadMetadata.d.cts.map +1 -0
- package/build/loadMetadata.d.mts +31 -0
- package/build/loadMetadata.d.mts.map +1 -0
- package/build/loadMetadata.js +32 -39
- package/build/loadMetadata.js.map +1 -1
- package/build/logger.cjs +28 -0
- package/build/logger.cjs.map +1 -0
- package/build/logger.d.cts +13 -0
- package/build/logger.d.cts.map +1 -0
- package/build/logger.d.mts +13 -0
- package/build/logger.d.mts.map +1 -0
- package/build/logger.js +17 -16
- package/build/logger.js.map +1 -1
- package/build/scanEntityFiles.cjs +46 -0
- package/build/scanEntityFiles.cjs.map +1 -0
- package/build/scanEntityFiles.d.cts +8 -0
- package/build/scanEntityFiles.d.cts.map +1 -0
- package/build/scanEntityFiles.d.mts +8 -0
- package/build/scanEntityFiles.d.mts.map +1 -0
- package/build/scanEntityFiles.js +37 -42
- package/build/scanEntityFiles.js.map +1 -1
- package/build/sortForeignKeys.cjs +99 -0
- package/build/sortForeignKeys.cjs.map +1 -0
- package/build/{sortForeignKeys.d.ts → sortForeignKeys.d.cts} +8 -5
- package/build/sortForeignKeys.d.cts.map +1 -0
- package/build/sortForeignKeys.d.mts +35 -0
- package/build/sortForeignKeys.d.mts.map +1 -0
- package/build/sortForeignKeys.js +88 -117
- package/build/sortForeignKeys.js.map +1 -1
- package/build/symbols.cjs +238 -0
- package/build/symbols.cjs.map +1 -0
- package/build/symbols.d.cts +120 -0
- package/build/symbols.d.cts.map +1 -0
- package/build/symbols.d.mts +120 -0
- package/build/symbols.d.mts.map +1 -0
- package/build/symbols.js +121 -113
- package/build/symbols.js.map +1 -1
- package/build/tsdoc.cjs +22 -0
- package/build/tsdoc.cjs.map +1 -0
- package/build/tsdoc.d.cts +15 -0
- package/build/tsdoc.d.cts.map +1 -0
- package/build/tsdoc.d.mts +15 -0
- package/build/tsdoc.d.mts.map +1 -0
- package/build/tsdoc.js +18 -15
- package/build/tsdoc.js.map +1 -1
- package/build/utils.cjs +173 -0
- package/build/utils.cjs.map +1 -0
- package/build/utils.d.cts +34 -0
- package/build/utils.d.cts.map +1 -0
- package/build/utils.d.mts +34 -0
- package/build/utils.d.mts.map +1 -0
- package/build/utils.js +112 -166
- package/build/utils.js.map +1 -1
- package/build/write-json-schema.cjs +23 -0
- package/build/write-json-schema.cjs.map +1 -0
- package/build/write-json-schema.d.cts +1 -0
- package/build/write-json-schema.d.mts +1 -0
- package/build/write-json-schema.js +19 -13
- package/build/write-json-schema.js.map +1 -1
- package/package.json +37 -17
- package/skills/joist-docs/SKILL.md +133 -0
- package/skills/joist-em-basics/SKILL.md +114 -0
- package/skills/joist-partial-updates/SKILL.md +352 -0
- package/skills/joist-reactive-hints/SKILL.md +150 -0
- package/skills/joist-test-factories/SKILL.md +397 -0
- package/skills/joist-upsert/SKILL.md +95 -0
- package/build/EntityDbMetadata.d.ts +0 -269
- package/build/EntityDbMetadata.d.ts.map +0 -1
- package/build/EntityDbMetadata.test.d.ts +0 -2
- package/build/EntityDbMetadata.test.d.ts.map +0 -1
- package/build/EntityDbMetadata.test.js +0 -211
- package/build/EntityDbMetadata.test.js.map +0 -1
- package/build/assignTags.d.ts.map +0 -1
- package/build/codemods/Codemod.d.ts +0 -14
- package/build/codemods/Codemod.d.ts.map +0 -1
- package/build/codemods/Codemod.js.map +0 -1
- package/build/codemods/JscodeshiftMod.d.ts +0 -11
- package/build/codemods/JscodeshiftMod.d.ts.map +0 -1
- package/build/codemods/__tests__/codemod_0001-rename_has_async_property.test.d.ts +0 -2
- package/build/codemods/__tests__/codemod_0001-rename_has_async_property.test.d.ts.map +0 -1
- package/build/codemods/__tests__/codemod_0001-rename_has_async_property.test.js +0 -9
- package/build/codemods/__tests__/codemod_0001-rename_has_async_property.test.js.map +0 -1
- package/build/codemods/__tests__/codemod_0002-rename_async_query_fields.test.d.ts +0 -2
- package/build/codemods/__tests__/codemod_0002-rename_async_query_fields.test.d.ts.map +0 -1
- package/build/codemods/__tests__/codemod_0002-rename_async_query_fields.test.js +0 -9
- package/build/codemods/__tests__/codemod_0002-rename_async_query_fields.test.js.map +0 -1
- package/build/codemods/__tests__/codemod_0003-rename_find_paginated.test.d.ts +0 -2
- package/build/codemods/__tests__/codemod_0003-rename_find_paginated.test.d.ts.map +0 -1
- package/build/codemods/__tests__/codemod_0003-rename_find_paginated.test.js +0 -9
- package/build/codemods/__tests__/codemod_0003-rename_find_paginated.test.js.map +0 -1
- package/build/codemods/codemod_0001-rename_has_async_property.d.ts +0 -7
- package/build/codemods/codemod_0001-rename_has_async_property.d.ts.map +0 -1
- package/build/codemods/codemod_0002-rename_async_query_fields.d.ts +0 -7
- package/build/codemods/codemod_0002-rename_async_query_fields.d.ts.map +0 -1
- package/build/codemods/codemod_0003-rename_find_paginated.d.ts +0 -7
- package/build/codemods/codemod_0003-rename_find_paginated.d.ts.map +0 -1
- package/build/codemods/index.d.ts +0 -9
- package/build/codemods/index.d.ts.map +0 -1
- package/build/codemods/index.test.d.ts +0 -2
- package/build/codemods/index.test.d.ts.map +0 -1
- package/build/codemods/index.test.js +0 -24
- package/build/codemods/index.test.js.map +0 -1
- package/build/config.d.ts +0 -167
- package/build/config.d.ts.map +0 -1
- package/build/config.test.d.ts +0 -2
- package/build/config.test.d.ts.map +0 -1
- package/build/config.test.js +0 -78
- package/build/config.test.js.map +0 -1
- package/build/docs/cache.d.ts +0 -14
- package/build/docs/cache.d.ts.map +0 -1
- package/build/docs/cache.test.d.ts +0 -2
- package/build/docs/cache.test.d.ts.map +0 -1
- package/build/docs/cache.test.js +0 -47
- package/build/docs/cache.test.js.map +0 -1
- package/build/docs/generate-metadata-docs.d.ts +0 -6
- package/build/docs/generate-metadata-docs.d.ts.map +0 -1
- package/build/docs/index.d.ts +0 -9
- package/build/docs/index.d.ts.map +0 -1
- package/build/docs/index.test.d.ts +0 -2
- package/build/docs/index.test.d.ts.map +0 -1
- package/build/docs/index.test.js +0 -100
- package/build/docs/index.test.js.map +0 -1
- package/build/docs/markdown.d.ts.map +0 -1
- package/build/docs/markdown.test.d.ts +0 -2
- package/build/docs/markdown.test.d.ts.map +0 -1
- package/build/docs/markdown.test.js +0 -280
- package/build/docs/markdown.test.js.map +0 -1
- package/build/docs/parsing.d.ts +0 -42
- package/build/docs/parsing.d.ts.map +0 -1
- package/build/docs/parsing.test.d.ts +0 -2
- package/build/docs/parsing.test.d.ts.map +0 -1
- package/build/docs/parsing.test.js +0 -190
- package/build/docs/parsing.test.js.map +0 -1
- package/build/findEntityScopes.d.ts +0 -11
- package/build/findEntityScopes.d.ts.map +0 -1
- package/build/foreignKeyOrdering.d.ts +0 -3
- package/build/foreignKeyOrdering.d.ts.map +0 -1
- package/build/generate.d.ts +0 -12
- package/build/generate.d.ts.map +0 -1
- package/build/generateEntitiesFile.d.ts +0 -7
- package/build/generateEntitiesFile.d.ts.map +0 -1
- package/build/generateEntityCodegenFile.d.ts +0 -11
- package/build/generateEntityCodegenFile.d.ts.map +0 -1
- package/build/generateEntityFile.d.ts +0 -6
- package/build/generateEntityFile.d.ts.map +0 -1
- package/build/generateEntityTestFile.d.ts +0 -6
- package/build/generateEntityTestFile.d.ts.map +0 -1
- package/build/generateEnumFile.d.ts +0 -5
- package/build/generateEnumFile.d.ts.map +0 -1
- package/build/generateFactoriesFiles.d.ts +0 -4
- package/build/generateFactoriesFiles.d.ts.map +0 -1
- package/build/generateFlushFunction.d.ts.map +0 -1
- package/build/generateMetadataFile.d.ts +0 -5
- package/build/generateMetadataFile.d.ts.map +0 -1
- package/build/generatePgEnumFile.d.ts +0 -5
- package/build/generatePgEnumFile.d.ts.map +0 -1
- package/build/index.d.ts +0 -11
- package/build/index.d.ts.map +0 -1
- package/build/inheritance.d.ts +0 -10
- package/build/inheritance.d.ts.map +0 -1
- package/build/keywords.d.ts +0 -2
- package/build/keywords.d.ts.map +0 -1
- package/build/loadMetadata.d.ts +0 -26
- package/build/loadMetadata.d.ts.map +0 -1
- package/build/logger.d.ts +0 -10
- package/build/logger.d.ts.map +0 -1
- package/build/scanEntityFiles.d.ts +0 -5
- package/build/scanEntityFiles.d.ts.map +0 -1
- package/build/sortForeignKeys.d.ts.map +0 -1
- package/build/symbols.d.ts +0 -108
- package/build/symbols.d.ts.map +0 -1
- package/build/tsdoc.d.ts +0 -12
- package/build/tsdoc.d.ts.map +0 -1
- package/build/utils.d.ts +0 -31
- package/build/utils.d.ts.map +0 -1
- package/build/write-json-schema.d.ts +0 -2
- package/build/write-json-schema.d.ts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.cjs","names":["createFromBuffer","readFileSync","getPath","z","groupBy","getStiEntities","trueIfResolved","getLatestCodemodVersion","sortKeys","parse","join","existsSync","dirname"],"sources":["../src/config.ts"],"sourcesContent":["import { existsSync, promises as fs, readFileSync } from \"fs\";\nimport { dirname, join } from \"path\";\n\nimport { createFromBuffer } from \"@dprint/formatter\";\nimport { getPath } from \"@dprint/json\";\nimport { groupBy } from \"joist-utils\";\nimport { type ParseError, parse } from \"jsonc-parser\";\nimport { z } from \"zod\";\n\nimport { getLatestCodemodVersion } from \"./codemods/index.ts\";\nimport { type DbMetadata, type Entity, type EntityDbMetadata } from \"./EntityDbMetadata.ts\";\nimport { getStiEntities } from \"./inheritance.ts\";\nimport { logger } from \"./logger.ts\";\nimport { fail, sortKeys, trueIfResolved } from \"./utils.ts\";\n\nconst jsonFormatter = createFromBuffer(readFileSync(getPath()));\n\nconst fieldConfig = z\n .object({\n // For getters & ReactiveFields\n derived: z.optional(z.union([z.literal(\"sync\"), z.literal(\"async\")])),\n protected: z.optional(z.boolean()),\n ignore: z.optional(z.boolean()),\n superstruct: z.optional(z.string()),\n zodSchema: z.optional(z.string()),\n type: z.optional(z.string()),\n serde: z.optional(z.string()),\n stiDiscriminator: z.optional(z.record(z.string(), z.string())),\n stiType: z.optional(z.string()),\n // Allow subclasses to mark fields as required\n notNull: z.optional(z.boolean()),\n // Allow overriding scanEntities default detection for fields with defaults added by helpers\n hasDefault: z.optional(z.boolean()),\n // Exclude a (large jsonb/text) column from the default SELECT and expose it as a lazy-loaded LazyField\n lazy: z.optional(z.boolean()),\n })\n .strict();\n\nexport type FieldConfig = z.infer<typeof fieldConfig>;\n\nconst relationConfig = z\n .object({\n // For ReactiveReferences\n derived: z.optional(z.literal(\"async\")),\n polymorphic: z.optional(z.union([z.literal(\"notNull\"), z.literal(true)])),\n large: z.optional(z.boolean()),\n orderBy: z.optional(z.string()),\n /**\n * Controls whether this collection's `.get`/`.load` hide soft-deleted entities.\n *\n * Defaults to `\"exclude\"` (soft-deleted entities are hidden); set to `\"include\"` to have\n * this specific o2m/m2m always return soft-deleted entities from `.get`/`.load`.\n */\n softDeletes: z.optional(z.union([z.literal(\"include\"), z.literal(\"exclude\")])),\n // Allow pushing m2o/m2m/o2o relations in a base type (Task) down to a subtype (TaskOld)\n stiType: z.optional(z.string()),\n /**\n * Allow specializing a base type relation (SmallPublisher.group: SmallPublisherGroup).\n *\n * Self-referential FKs also support `subType: \"self\"` that means each subtype will point\n * at its own subtype.\n */\n subType: z.optional(z.string()),\n /** Allow skipping self-referential fields getting a `...Recursive` relation. */\n skipRecursiveRelations: z.optional(z.boolean()),\n // Allow marking m2o FKs as required on subclasses\n notNull: z.optional(z.boolean()),\n // Allow overriding scanEntities default detection for fields with defaults added by helpers\n hasDefault: z.optional(z.boolean()),\n })\n .strict();\n\nexport type RelationConfig = z.infer<typeof relationConfig>;\n\nconst uniqueByConfig = z\n .union([z.string(), z.array(z.string()), z.array(z.array(z.string()))])\n .transform(normalizeUniqueByConfig);\n\nconst entityConfig = z\n .object({\n tag: z.string(),\n tableName: z.optional(z.string()),\n fields: z.optional(z.record(z.string(), fieldConfig)),\n relations: z.optional(z.record(z.string(), relationConfig)),\n /** Whether this entity should be abstract, e.g. for inheritance a subtype must be instantiated instead of this type. */\n abstract: z.optional(z.boolean()),\n orderBy: z.optional(z.string()),\n uniqueBy: z.optional(uniqueByConfig),\n })\n .strict();\n\nexport type EntityConfig = z.infer<typeof entityConfig>;\n\nconst timestampConfig = z\n .object({\n /** The names to check for this timestamp, i.e. `created_at` `created`, etc. */\n names: z.array(z.string()),\n /** Whether this timestamp column is required to consider a table an entity, defaults to `false`. */\n required: z.optional(z.boolean()),\n })\n .strict();\n\nexport type TimestampConfig = z.infer<typeof timestampConfig>;\n\nexport const config = z\n .object({\n /** The _build-time_ database URL for reading database metadata. */\n databaseUrl: z.optional(z.string()),\n /** Your application's request-level `Context` type. */\n contextType: z.optional(z.string()),\n /** Your application's database client's `Transaction` type. */\n transactionType: z.optional(z.string()),\n /**\n * Allows the user to specify the `updated_at` / `created_at` column names to look up, and if they're optional.\n *\n * We default to looking for `updated_at`, `updatedAt`, `created_at`, `createdAt`, and optional to true,\n * e.g. tables are not required to have both timestamp columns to be considered entities.\n *\n * These defaults are the most lenient, to facilitate running Joist against an existing schema and\n * seeing all of your entities, regardless of your previous conventions.\n */\n timestampColumns: z.optional(\n z.object({\n createdAt: z.optional(timestampConfig),\n updatedAt: z.optional(timestampConfig),\n deletedAt: z.optional(timestampConfig),\n }),\n ),\n /**\n * Allows the user to have codegen output `Temporal` types instead of the base JS `Date`\n *\n * Additionally, allows for specifying the default time zone for `Temporal` types when converting dates to/from\n * the database.\n */\n temporal: z.optional(z.union([z.boolean(), z.object({ timeZone: z.string() })])),\n /**\n * By default, we create a `flush_database` function for fast testing.\n *\n * However, if you don't want to use this, or you have your own bespoke function like we do\n * that is more application-aware, then you can disable Joist's out-of-the-box one.\n *\n * If you have more than one test database, you can set `createFlushFunction` to the array\n * of test database names, i.e. `mydb_test_1`, `mydb_test_2`, etc.\n */\n createFlushFunction: z.optional(z.union([z.boolean(), z.array(z.string())])),\n entitiesDirectory: z.string().default(\"./src/entities\"),\n codegenPlugins: z.optional(z.array(z.string())),\n entities: z.record(z.string(), entityConfig).default({}),\n ignoredTables: z.optional(z.array(z.string())),\n /** The type of entity `id` fields; defaults to `tagged-string`. */\n idType: z.optional(z.union([z.literal(\"tagged-string\"), z.literal(\"untagged-string\"), z.literal(\"number\")])),\n /** The separator between entity tags and ids; defaults to `:`, and `\"\"` disables the separator. */\n tagDelimiter: z.optional(z.string()),\n /** How we should support non-deferred foreign keys. */\n nonDeferredForeignKeys: z.optional(z.union([z.literal(\"error\"), z.literal(\"warn\"), z.literal(\"ignore\")])),\n /** Enables esm output. */\n esm: z.optional(z.boolean()),\n /** Controls the style of GraphQL pagination scaffolding. */\n paginationStyle: z.optional(z.union([z.literal(\"cursor\"), z.literal(\"limit\")])).default(\"cursor\"),\n /** Enables documentation syncing between .md files and JSDocs. */\n docs: z.optional(z.boolean()),\n /** Installs Joist's bundled Agent Skills into `.claude/skills` and `.agents/skills`; on by default, set `false` to disable. */\n skills: z.optional(z.boolean()),\n /** Output a metadata-docs.ts file with entity/field documentation available at runtime. */\n outputDocs: z.optional(z.boolean()),\n /** Auto-set by probing the project's `tsconfig.json` file. */\n allowImportingTsExtensions: z.optional(z.boolean()),\n /** The latest Joist codemod counter that has been applied to this project. */\n codemodVersion: z.number().int().min(0).default(0),\n\n /** A list of postgres schemas to use for finding tables */\n schemas: z.optional(z.array(z.string())),\n })\n .strict();\n\nexport type Config = z.infer<typeof config> & {\n // We don't persist this, and instead just use it as a cache\n __tableToEntityName?: Record<string, string>;\n};\n\nexport const ormMaintainedFields = [\"createdAt\", \"updatedAt\"];\n\n/** Ensure the user doesn't have any typos in their config. */\nexport function warnInvalidConfigEntries(config: Config, db: DbMetadata): void {\n const entitiesByName = groupBy(db.entities, (e) => e.name);\n for (const [entityName, entityConfig] of Object.entries(config.entities)) {\n const entities = entitiesByName[entityName];\n if (!entities) {\n logger.warn(`Found config for non-existent entity ${entityName}`);\n continue;\n }\n // We don't have keyBy...\n const [entity] = entities;\n\n // Check fields\n const fields = [...entity.primitives, ...entity.enums];\n for (const [name, config] of Object.entries(entityConfig.fields || {})) {\n if (config.ignore) continue;\n let field = fields.find((f) => f.fieldName === name);\n // STI types might be in the base type\n if (!field && entity.stiDiscriminatorField) {\n const stiEntities = getStiEntities(db.entities).get(entity.name)?.subTypes;\n field = stiEntities?.flatMap((st) => [...st.primitives, ...st.enums]).find((f) => f.fieldName === name);\n }\n if (!field) logger.warn(`Found config for non-existent field ${entityName}.${name}`);\n }\n\n // Check relations\n const relations = [\n ...entity.manyToOnes,\n ...entity.oneToManys,\n ...entity.manyToManys,\n ...entity.manyToManyEnums,\n ...entity.oneToOnes,\n ...entity.largeOneToManys,\n ...entity.largeManyToManys,\n ...entity.polymorphics,\n ];\n for (const [name, _] of Object.entries(entityConfig.relations || {})) {\n let relation = relations.find((r) => r.fieldName === name);\n // STI types might be in the subtypes\n if (!relation && entity.stiDiscriminatorField) {\n const stiEntities = getStiEntities(db.entities).get(entity.name)?.subTypes;\n relation = stiEntities\n ?.flatMap((entity) => [\n ...entity.manyToOnes,\n ...entity.oneToManys,\n ...entity.manyToManys,\n ...entity.oneToOnes,\n ...entity.largeOneToManys,\n ...entity.largeManyToManys,\n ...entity.polymorphics,\n ])\n ?.find((f) => f.fieldName === name);\n }\n // CTI subtype specializations (i.e. SmallPublisher.group: SmallPublisherGroup) need to look in the base type\n if (!relation && entity.baseType) {\n const baseType = entity.baseType;\n relation = [\n ...baseType.manyToOnes,\n ...baseType.oneToManys,\n ...baseType.manyToManys,\n ...baseType.oneToOnes,\n ...baseType.largeOneToManys,\n ...baseType.largeManyToManys,\n ...baseType.polymorphics,\n ].find((f) => f.fieldName === name);\n }\n\n if (!relation) logger.warn(`Found config for non-existent relation ${entityName}.${name}`);\n }\n\n const uniqueFields = [\n ...entity.primitives,\n ...entity.enums,\n ...entity.pgEnums,\n ...entity.manyToOnes,\n ...entity.polymorphics,\n ];\n for (const uniqueBy of entityConfig.uniqueBy || []) {\n for (const name of uniqueBy) {\n const field = uniqueFields.find((f) => f.fieldName === name);\n if (!field) {\n logger.warn(`Found uniqueBy for non-existent or non-queryable field ${entityName}.${name}`);\n } else if (field.kind === \"primitive\" && (field.derived || field.isArray || field.customSerde)) {\n logger.warn(`Found uniqueBy for unsupported primitive field ${entityName}.${name}`);\n } else if (field.kind === \"enum\" && (field.derived || field.isArray)) {\n logger.warn(`Found uniqueBy for unsupported enum field ${entityName}.${name}`);\n }\n }\n }\n }\n}\n\nexport function isGetterField(config: Config, entity: Entity, fieldName: string): boolean {\n return config.entities[entity.name]?.fields?.[fieldName]?.derived === \"sync\";\n}\n\nexport function isReactiveField(config: Config, entity: Entity, fieldName: string): boolean {\n return config.entities[entity.name]?.fields?.[fieldName]?.derived === \"async\";\n}\n\nexport function isReactiveReference(config: Config, entity: Entity, fieldName: string): boolean {\n return config.entities[entity.name]?.relations?.[fieldName]?.derived === \"async\";\n}\n\n/** Returns true if this m2m relation is configured as a ReactiveManyToMany (derived: async). */\nexport function isReactiveManyToMany(config: Config, entity: Entity, fieldName: string): boolean {\n return config.entities[entity.name]?.relations?.[fieldName]?.derived === \"async\";\n}\n\nexport function isProtected(config: Config, entity: Entity, fieldName: string): boolean {\n return config.entities[entity.name]?.fields?.[fieldName]?.protected === true;\n}\n\n/** Whether a column should be excluded from the default SELECT and exposed as a lazy-loaded `LazyField`. */\nexport function isLazyField(config: Config, entity: Entity, fieldName: string): boolean {\n return config.entities[entity.name]?.fields?.[fieldName]?.lazy === true;\n}\n\nexport function serdeConfig(config: Config, entity: Entity, fieldName: string): string | undefined {\n return config.entities[entity.name]?.fields?.[fieldName]?.serde;\n}\n\nexport function superstructConfig(config: Config, entity: Entity, fieldName: string): string | undefined {\n return config.entities[entity.name]?.fields?.[fieldName]?.superstruct;\n}\n\nexport function zodSchemaConfig(config: Config, entity: Entity, fieldName: string): string | undefined {\n return config.entities[entity.name]?.fields?.[fieldName]?.zodSchema;\n}\n\nexport function fieldTypeConfig(config: Config, entity: Entity, fieldName: string): string | undefined {\n return config.entities[entity.name]?.fields?.[fieldName]?.type;\n}\n\nexport function isLargeCollection(config: Config, entity: Entity, fieldName: string): boolean {\n return config.entities[entity.name]?.relations?.[fieldName]?.large === true;\n}\n\n/** Whether a collection should include (or exclude) soft-deleted entities from `.get`/`.load`. */\nexport function softDeletesConfig(\n config: Config,\n entity: Entity,\n fieldName: string,\n): \"include\" | \"exclude\" | undefined {\n return config.entities[entity.name]?.relations?.[fieldName]?.softDeletes;\n}\n\nexport function isFieldIgnored(\n config: Config,\n entity: Entity,\n fieldName: string,\n notNull: boolean = false,\n hasDefault: boolean = false,\n): boolean {\n const ignore = config.entities[entity.name]?.fields?.[fieldName]?.ignore === true;\n if (ignore && notNull && !hasDefault) {\n fail(\n `notNull field ${entity.name}.${fieldName} cannot be ignored. Alter the column to be optional or have a default value prior to ignoring it.`,\n );\n }\n return ignore;\n}\n\nexport function isFieldHasDefault(config: Config, entity: Entity, fieldName: string): boolean {\n const entityConfig = config.entities[entity.name] ?? {};\n const fieldConfig = entityConfig.fields?.[fieldName] ?? entityConfig.relations?.[fieldName] ?? {};\n return fieldConfig.hasDefault === true;\n}\n\nconst configPath = \"./joist-config.json\";\n\nexport async function loadConfig(): Promise<Config> {\n const exists = await trueIfResolved(fs.access(configPath));\n if (exists) {\n const content = await fs.readFile(configPath);\n const result = config.safeParse(stripLegacyConfigKeys(JSON.parse(content.toString())));\n if (!result.success) {\n throw new Error(\n `Invalid joist-config.json: ${result.error.issues\n .map((ze) => `${ze.path.map(String).join(\"/\")} ${ze.message}`)\n .join(\"\\n\")}`,\n );\n }\n result.data.allowImportingTsExtensions ??= projectIsUsingEsmWithImports();\n return result.data;\n }\n // Brand-new projects should not be prompted to run historical codemods.\n const initial = config.parse({ codemodVersion: getLatestCodemodVersion() });\n initial.allowImportingTsExtensions ??= projectIsUsingEsmWithImports();\n return initial;\n}\n\n/**\n * Writes the potentially-updated config entry back to `joist-config.json`.\n *\n * We format the output with prettier so it should both a) look nice and b) be deterministic,\n * such that no changes to the config show up as noops to the scm.\n */\nexport async function writeConfig(config: Config): Promise<void> {\n const sorted: Partial<Config> = sortKeys(config);\n delete sorted.__tableToEntityName;\n delete sorted.allowImportingTsExtensions;\n if (sorted.paginationStyle === \"cursor\") {\n delete sorted.paginationStyle;\n }\n const input = JSON.stringify(sorted);\n const content = jsonFormatter.formatText({ filePath: \"test.json\", fileText: input });\n await fs.writeFile(configPath, content);\n}\n\nexport function stripStiPlaceholders(config: Config, entities: EntityDbMetadata[]): void {\n // Defacto (with today's setup) the config of STI entities lives on the base entity,\n // so don't write confusing subtype-specific entries into the config file.\n // ...hopefully we don't have any code accidentally looking for the STI config...\n for (const entity of entities) {\n if (entity.inheritanceType === \"sti\" && entity.stiDiscriminatorValue) {\n delete config.entities[entity.name];\n }\n }\n}\n\n/** Applies defaults to the timestamp config. */\nexport function getTimestampConfig(config: Config): {\n updatedAtConf: Required<TimestampConfig>;\n createdAtConf: Required<TimestampConfig>;\n deletedAtConf: Required<TimestampConfig>;\n} {\n return {\n createdAtConf: {\n names: [\"created_at\", \"createdAt\"],\n required: false,\n ...config?.timestampColumns?.createdAt,\n },\n updatedAtConf: {\n names: [\"updated_at\", \"updatedAt\"],\n required: false,\n ...config?.timestampColumns?.updatedAt,\n },\n deletedAtConf: {\n names: [\"deleted_at\", \"deletedAt\"],\n required: false,\n ...config?.timestampColumns?.deletedAt,\n },\n };\n}\n\nfunction projectIsUsingEsmWithImports(): boolean {\n // Attempt to find the project's tsconfig.json in the current directory or up the directory hierarchy\n const configPath = findTsConfigFile(process.cwd());\n if (!configPath) {\n return false;\n }\n try {\n // Use jsonc-parser to parse the tsconfig.json file (not the old tsc readConfigFile which was\n // dropped in TypeScript 7), allowing for comments and trailing commas.\n const errors: ParseError[] = [];\n const parsed: unknown = parse(readFileSync(configPath, \"utf8\"), errors, { allowTrailingComma: true });\n if (errors.length > 0 || typeof parsed !== \"object\" || parsed === null || Array.isArray(parsed)) return false;\n const compilerOptions = (parsed as Record<string, unknown>).compilerOptions;\n return (\n typeof compilerOptions === \"object\" &&\n compilerOptions !== null &&\n !Array.isArray(compilerOptions) &&\n (compilerOptions as Record<string, unknown>).allowImportingTsExtensions === true\n );\n } catch {\n return false;\n }\n}\n\n/** Normalizes `uniqueBy` config sugar into runtime identity candidates. */\nfunction normalizeUniqueByConfig(uniqueBy: string | string[] | string[][]): string[][] {\n if (typeof uniqueBy === \"string\") return [[uniqueBy]];\n if (uniqueBy.every((field) => typeof field === \"string\")) return [uniqueBy];\n return uniqueBy;\n}\n\nfunction stripLegacyConfigKeys(raw: unknown): unknown {\n if (!raw || typeof raw !== \"object\" || Array.isArray(raw)) {\n return raw;\n }\n // Accept old configs so the deprecated key disappears on the next write.\n const parsed = { ...(raw as Record<string, unknown>) };\n delete parsed.version;\n return parsed;\n}\n\n/** Finds the nearest `tsconfig.json` in `directory` or one of its ancestors. */\nfunction findTsConfigFile(directory: string): string | undefined {\n while (true) {\n const fileName = join(directory, \"tsconfig.json\");\n if (existsSync(fileName)) return fileName;\n const parent = dirname(directory);\n if (parent === directory) return undefined;\n directory = parent;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAeA,MAAM,iBAAA,GAAgBA,kBAAAA,iBAAAA,EAAAA,GAAiBC,GAAAA,aAAAA,EAAAA,GAAaC,aAAAA,QAAAA,CAAQ,CAAC,CAAC;AAE9D,MAAM,cAAcC,IAAAA,EACjB,OAAO;CAEN,SAASA,IAAAA,EAAE,SAASA,IAAAA,EAAE,MAAM,CAACA,IAAAA,EAAE,QAAQ,MAAM,GAAGA,IAAAA,EAAE,QAAQ,OAAO,CAAC,CAAC,CAAC;CACpE,WAAWA,IAAAA,EAAE,SAASA,IAAAA,EAAE,QAAQ,CAAC;CACjC,QAAQA,IAAAA,EAAE,SAASA,IAAAA,EAAE,QAAQ,CAAC;CAC9B,aAAaA,IAAAA,EAAE,SAASA,IAAAA,EAAE,OAAO,CAAC;CAClC,WAAWA,IAAAA,EAAE,SAASA,IAAAA,EAAE,OAAO,CAAC;CAChC,MAAMA,IAAAA,EAAE,SAASA,IAAAA,EAAE,OAAO,CAAC;CAC3B,OAAOA,IAAAA,EAAE,SAASA,IAAAA,EAAE,OAAO,CAAC;CAC5B,kBAAkBA,IAAAA,EAAE,SAASA,IAAAA,EAAE,OAAOA,IAAAA,EAAE,OAAO,GAAGA,IAAAA,EAAE,OAAO,CAAC,CAAC;CAC7D,SAASA,IAAAA,EAAE,SAASA,IAAAA,EAAE,OAAO,CAAC;CAE9B,SAASA,IAAAA,EAAE,SAASA,IAAAA,EAAE,QAAQ,CAAC;CAE/B,YAAYA,IAAAA,EAAE,SAASA,IAAAA,EAAE,QAAQ,CAAC;CAElC,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,GAAG,OAAO;EACxG,MAAM,kBAAmB,OAAmC;EAC5D,OACE,OAAO,oBAAoB,YAC3B,oBAAoB,QACpB,CAAC,MAAM,QAAQ,eAAe,KAC7B,gBAA4C,+BAA+B;CAEhF,QAAQ;EACN,OAAO;CACT;AACF;;AAGA,SAAS,wBAAwB,UAAsD;CACrF,IAAI,OAAO,aAAa,UAAU,OAAO,CAAC,CAAC,QAAQ,CAAC;CACpD,IAAI,SAAS,OAAO,UAAU,OAAO,UAAU,QAAQ,GAAG,OAAO,CAAC,QAAQ;CAC1E,OAAO;AACT;AAEA,SAAS,sBAAsB,KAAuB;CACpD,IAAI,CAAC,OAAO,OAAO,QAAQ,YAAY,MAAM,QAAQ,GAAG,GACtD,OAAO;CAGT,MAAM,SAAS,EAAE,GAAI,IAAgC;CACrD,OAAO,OAAO;CACd,OAAO;AACT;;AAGA,SAAS,iBAAiB,WAAuC;CAC/D,OAAO,MAAM;EACX,MAAM,YAAA,GAAWS,KAAAA,KAAAA,CAAK,WAAW,eAAe;EAChD,KAAA,GAAIC,GAAAA,WAAAA,CAAW,QAAQ,GAAG,OAAO;EACjC,MAAM,UAAA,GAASC,KAAAA,QAAAA,CAAQ,SAAS;EAChC,IAAI,WAAW,WAAW,OAAO,KAAA;EACjC,YAAY;CACd;AACF"}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { DbMetadata, Entity, EntityDbMetadata } from "./EntityDbMetadata.cjs";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region src/config.d.ts
|
|
4
|
+
declare const fieldConfig: z.ZodObject<{
|
|
5
|
+
derived: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"sync">, z.ZodLiteral<"async">]>>;
|
|
6
|
+
protected: z.ZodOptional<z.ZodBoolean>;
|
|
7
|
+
ignore: z.ZodOptional<z.ZodBoolean>;
|
|
8
|
+
superstruct: z.ZodOptional<z.ZodString>;
|
|
9
|
+
zodSchema: z.ZodOptional<z.ZodString>;
|
|
10
|
+
type: z.ZodOptional<z.ZodString>;
|
|
11
|
+
serde: z.ZodOptional<z.ZodString>;
|
|
12
|
+
stiDiscriminator: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
13
|
+
stiType: z.ZodOptional<z.ZodString>;
|
|
14
|
+
notNull: z.ZodOptional<z.ZodBoolean>;
|
|
15
|
+
hasDefault: z.ZodOptional<z.ZodBoolean>;
|
|
16
|
+
lazy: z.ZodOptional<z.ZodBoolean>;
|
|
17
|
+
}, z.core.$strict>;
|
|
18
|
+
type FieldConfig = z.infer<typeof fieldConfig>;
|
|
19
|
+
declare const relationConfig: z.ZodObject<{
|
|
20
|
+
derived: z.ZodOptional<z.ZodLiteral<"async">>;
|
|
21
|
+
polymorphic: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"notNull">, z.ZodLiteral<true>]>>;
|
|
22
|
+
large: z.ZodOptional<z.ZodBoolean>;
|
|
23
|
+
orderBy: z.ZodOptional<z.ZodString>;
|
|
24
|
+
softDeletes: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"include">, z.ZodLiteral<"exclude">]>>;
|
|
25
|
+
stiType: z.ZodOptional<z.ZodString>;
|
|
26
|
+
subType: z.ZodOptional<z.ZodString>;
|
|
27
|
+
skipRecursiveRelations: z.ZodOptional<z.ZodBoolean>;
|
|
28
|
+
notNull: z.ZodOptional<z.ZodBoolean>;
|
|
29
|
+
hasDefault: z.ZodOptional<z.ZodBoolean>;
|
|
30
|
+
}, z.core.$strict>;
|
|
31
|
+
type RelationConfig = z.infer<typeof relationConfig>;
|
|
32
|
+
declare const entityConfig: z.ZodObject<{
|
|
33
|
+
tag: z.ZodString;
|
|
34
|
+
tableName: z.ZodOptional<z.ZodString>;
|
|
35
|
+
fields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
36
|
+
derived: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"sync">, z.ZodLiteral<"async">]>>;
|
|
37
|
+
protected: z.ZodOptional<z.ZodBoolean>;
|
|
38
|
+
ignore: z.ZodOptional<z.ZodBoolean>;
|
|
39
|
+
superstruct: z.ZodOptional<z.ZodString>;
|
|
40
|
+
zodSchema: z.ZodOptional<z.ZodString>;
|
|
41
|
+
type: z.ZodOptional<z.ZodString>;
|
|
42
|
+
serde: z.ZodOptional<z.ZodString>;
|
|
43
|
+
stiDiscriminator: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
44
|
+
stiType: z.ZodOptional<z.ZodString>;
|
|
45
|
+
notNull: z.ZodOptional<z.ZodBoolean>;
|
|
46
|
+
hasDefault: z.ZodOptional<z.ZodBoolean>;
|
|
47
|
+
lazy: z.ZodOptional<z.ZodBoolean>;
|
|
48
|
+
}, z.core.$strict>>>;
|
|
49
|
+
relations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
50
|
+
derived: z.ZodOptional<z.ZodLiteral<"async">>;
|
|
51
|
+
polymorphic: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"notNull">, z.ZodLiteral<true>]>>;
|
|
52
|
+
large: z.ZodOptional<z.ZodBoolean>;
|
|
53
|
+
orderBy: z.ZodOptional<z.ZodString>;
|
|
54
|
+
softDeletes: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"include">, z.ZodLiteral<"exclude">]>>;
|
|
55
|
+
stiType: z.ZodOptional<z.ZodString>;
|
|
56
|
+
subType: z.ZodOptional<z.ZodString>;
|
|
57
|
+
skipRecursiveRelations: z.ZodOptional<z.ZodBoolean>;
|
|
58
|
+
notNull: z.ZodOptional<z.ZodBoolean>;
|
|
59
|
+
hasDefault: z.ZodOptional<z.ZodBoolean>;
|
|
60
|
+
}, z.core.$strict>>>;
|
|
61
|
+
abstract: z.ZodOptional<z.ZodBoolean>;
|
|
62
|
+
orderBy: z.ZodOptional<z.ZodString>;
|
|
63
|
+
uniqueBy: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodArray<z.ZodString>>]>, z.ZodTransform<string[][], string | string[] | string[][]>>>;
|
|
64
|
+
}, z.core.$strict>;
|
|
65
|
+
type EntityConfig = z.infer<typeof entityConfig>;
|
|
66
|
+
declare const timestampConfig: z.ZodObject<{
|
|
67
|
+
names: z.ZodArray<z.ZodString>;
|
|
68
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
69
|
+
}, z.core.$strict>;
|
|
70
|
+
type TimestampConfig = z.infer<typeof timestampConfig>;
|
|
71
|
+
declare const config: z.ZodObject<{
|
|
72
|
+
databaseUrl: z.ZodOptional<z.ZodString>;
|
|
73
|
+
contextType: z.ZodOptional<z.ZodString>;
|
|
74
|
+
transactionType: z.ZodOptional<z.ZodString>;
|
|
75
|
+
timestampColumns: z.ZodOptional<z.ZodObject<{
|
|
76
|
+
createdAt: z.ZodOptional<z.ZodObject<{
|
|
77
|
+
names: z.ZodArray<z.ZodString>;
|
|
78
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
79
|
+
}, z.core.$strict>>;
|
|
80
|
+
updatedAt: z.ZodOptional<z.ZodObject<{
|
|
81
|
+
names: z.ZodArray<z.ZodString>;
|
|
82
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
83
|
+
}, z.core.$strict>>;
|
|
84
|
+
deletedAt: z.ZodOptional<z.ZodObject<{
|
|
85
|
+
names: z.ZodArray<z.ZodString>;
|
|
86
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
87
|
+
}, z.core.$strict>>;
|
|
88
|
+
}, z.core.$strip>>;
|
|
89
|
+
temporal: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
|
|
90
|
+
timeZone: z.ZodString;
|
|
91
|
+
}, z.core.$strip>]>>;
|
|
92
|
+
createFlushFunction: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodArray<z.ZodString>]>>;
|
|
93
|
+
entitiesDirectory: z.ZodDefault<z.ZodString>;
|
|
94
|
+
codegenPlugins: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
95
|
+
entities: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
96
|
+
tag: z.ZodString;
|
|
97
|
+
tableName: z.ZodOptional<z.ZodString>;
|
|
98
|
+
fields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
99
|
+
derived: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"sync">, z.ZodLiteral<"async">]>>;
|
|
100
|
+
protected: z.ZodOptional<z.ZodBoolean>;
|
|
101
|
+
ignore: z.ZodOptional<z.ZodBoolean>;
|
|
102
|
+
superstruct: z.ZodOptional<z.ZodString>;
|
|
103
|
+
zodSchema: z.ZodOptional<z.ZodString>;
|
|
104
|
+
type: z.ZodOptional<z.ZodString>;
|
|
105
|
+
serde: z.ZodOptional<z.ZodString>;
|
|
106
|
+
stiDiscriminator: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
107
|
+
stiType: z.ZodOptional<z.ZodString>;
|
|
108
|
+
notNull: z.ZodOptional<z.ZodBoolean>;
|
|
109
|
+
hasDefault: z.ZodOptional<z.ZodBoolean>;
|
|
110
|
+
lazy: z.ZodOptional<z.ZodBoolean>;
|
|
111
|
+
}, z.core.$strict>>>;
|
|
112
|
+
relations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
113
|
+
derived: z.ZodOptional<z.ZodLiteral<"async">>;
|
|
114
|
+
polymorphic: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"notNull">, z.ZodLiteral<true>]>>;
|
|
115
|
+
large: z.ZodOptional<z.ZodBoolean>;
|
|
116
|
+
orderBy: z.ZodOptional<z.ZodString>;
|
|
117
|
+
softDeletes: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"include">, z.ZodLiteral<"exclude">]>>;
|
|
118
|
+
stiType: z.ZodOptional<z.ZodString>;
|
|
119
|
+
subType: z.ZodOptional<z.ZodString>;
|
|
120
|
+
skipRecursiveRelations: z.ZodOptional<z.ZodBoolean>;
|
|
121
|
+
notNull: z.ZodOptional<z.ZodBoolean>;
|
|
122
|
+
hasDefault: z.ZodOptional<z.ZodBoolean>;
|
|
123
|
+
}, z.core.$strict>>>;
|
|
124
|
+
abstract: z.ZodOptional<z.ZodBoolean>;
|
|
125
|
+
orderBy: z.ZodOptional<z.ZodString>;
|
|
126
|
+
uniqueBy: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodArray<z.ZodString>>]>, z.ZodTransform<string[][], string | string[] | string[][]>>>;
|
|
127
|
+
}, z.core.$strict>>>;
|
|
128
|
+
ignoredTables: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
129
|
+
idType: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"tagged-string">, z.ZodLiteral<"untagged-string">, z.ZodLiteral<"number">]>>;
|
|
130
|
+
tagDelimiter: z.ZodOptional<z.ZodString>;
|
|
131
|
+
nonDeferredForeignKeys: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"error">, z.ZodLiteral<"warn">, z.ZodLiteral<"ignore">]>>;
|
|
132
|
+
esm: z.ZodOptional<z.ZodBoolean>;
|
|
133
|
+
paginationStyle: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"cursor">, z.ZodLiteral<"limit">]>>>;
|
|
134
|
+
docs: z.ZodOptional<z.ZodBoolean>;
|
|
135
|
+
skills: z.ZodOptional<z.ZodBoolean>;
|
|
136
|
+
outputDocs: z.ZodOptional<z.ZodBoolean>;
|
|
137
|
+
allowImportingTsExtensions: z.ZodOptional<z.ZodBoolean>;
|
|
138
|
+
codemodVersion: z.ZodDefault<z.ZodNumber>;
|
|
139
|
+
schemas: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
140
|
+
}, z.core.$strict>;
|
|
141
|
+
type Config = z.infer<typeof config> & {
|
|
142
|
+
__tableToEntityName?: Record<string, string>;
|
|
143
|
+
};
|
|
144
|
+
declare const ormMaintainedFields: string[];
|
|
145
|
+
/** Ensure the user doesn't have any typos in their config. */
|
|
146
|
+
declare function warnInvalidConfigEntries(config: Config, db: DbMetadata): void;
|
|
147
|
+
declare function isGetterField(config: Config, entity: Entity, fieldName: string): boolean;
|
|
148
|
+
declare function isReactiveField(config: Config, entity: Entity, fieldName: string): boolean;
|
|
149
|
+
declare function isReactiveReference(config: Config, entity: Entity, fieldName: string): boolean;
|
|
150
|
+
/** Returns true if this m2m relation is configured as a ReactiveManyToMany (derived: async). */
|
|
151
|
+
declare function isReactiveManyToMany(config: Config, entity: Entity, fieldName: string): boolean;
|
|
152
|
+
declare function isProtected(config: Config, entity: Entity, fieldName: string): boolean;
|
|
153
|
+
/** Whether a column should be excluded from the default SELECT and exposed as a lazy-loaded `LazyField`. */
|
|
154
|
+
declare function isLazyField(config: Config, entity: Entity, fieldName: string): boolean;
|
|
155
|
+
declare function serdeConfig(config: Config, entity: Entity, fieldName: string): string | undefined;
|
|
156
|
+
declare function superstructConfig(config: Config, entity: Entity, fieldName: string): string | undefined;
|
|
157
|
+
declare function zodSchemaConfig(config: Config, entity: Entity, fieldName: string): string | undefined;
|
|
158
|
+
declare function fieldTypeConfig(config: Config, entity: Entity, fieldName: string): string | undefined;
|
|
159
|
+
declare function isLargeCollection(config: Config, entity: Entity, fieldName: string): boolean;
|
|
160
|
+
/** Whether a collection should include (or exclude) soft-deleted entities from `.get`/`.load`. */
|
|
161
|
+
declare function softDeletesConfig(config: Config, entity: Entity, fieldName: string): "include" | "exclude" | undefined;
|
|
162
|
+
declare function isFieldIgnored(config: Config, entity: Entity, fieldName: string, notNull?: boolean, hasDefault?: boolean): boolean;
|
|
163
|
+
declare function isFieldHasDefault(config: Config, entity: Entity, fieldName: string): boolean;
|
|
164
|
+
declare function loadConfig(): Promise<Config>;
|
|
165
|
+
/**
|
|
166
|
+
* Writes the potentially-updated config entry back to `joist-config.json`.
|
|
167
|
+
*
|
|
168
|
+
* We format the output with prettier so it should both a) look nice and b) be deterministic,
|
|
169
|
+
* such that no changes to the config show up as noops to the scm.
|
|
170
|
+
*/
|
|
171
|
+
declare function writeConfig(config: Config): Promise<void>;
|
|
172
|
+
declare function stripStiPlaceholders(config: Config, entities: EntityDbMetadata[]): void;
|
|
173
|
+
/** Applies defaults to the timestamp config. */
|
|
174
|
+
declare function getTimestampConfig(config: Config): {
|
|
175
|
+
updatedAtConf: Required<TimestampConfig>;
|
|
176
|
+
createdAtConf: Required<TimestampConfig>;
|
|
177
|
+
deletedAtConf: Required<TimestampConfig>;
|
|
178
|
+
};
|
|
179
|
+
//#endregion
|
|
180
|
+
export { Config, EntityConfig, FieldConfig, RelationConfig, TimestampConfig, config, fieldTypeConfig, getTimestampConfig, isFieldHasDefault, isFieldIgnored, isGetterField, isLargeCollection, isLazyField, isProtected, isReactiveField, isReactiveManyToMany, isReactiveReference, loadConfig, ormMaintainedFields, serdeConfig, softDeletesConfig, stripStiPlaceholders, superstructConfig, warnInvalidConfigEntries, writeConfig, zodSchemaConfig };
|
|
181
|
+
//# sourceMappingURL=config.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.cts","names":[],"sources":["../src/config.ts"],"mappings":";;;cAiBM,aAAW,EAAA;;;;;;;;;;;;;GAmBN,EAAA,KAAA;KAEC,cAAc,EAAE,aAAa;cAEnC,gBAAc,EAAA;;;;;;;;;;;GA8BT,EAAA,KAAA;KAEC,iBAAiB,EAAE,aAAa;cAMtC,cAAY,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAWP,EAAA,KAAA;KAEC,eAAe,EAAE,aAAa;cAEpC,iBAAe,EAAA;;;GAOV,EAAA,KAAA;KAEC,kBAAkB,EAAE,aAAa;cAEhC,QAAM,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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ZodOptional<z.ZodBoolean>;
|
|
8
|
+
superstruct: z.ZodOptional<z.ZodString>;
|
|
9
|
+
zodSchema: z.ZodOptional<z.ZodString>;
|
|
10
|
+
type: z.ZodOptional<z.ZodString>;
|
|
11
|
+
serde: z.ZodOptional<z.ZodString>;
|
|
12
|
+
stiDiscriminator: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
13
|
+
stiType: z.ZodOptional<z.ZodString>;
|
|
14
|
+
notNull: z.ZodOptional<z.ZodBoolean>;
|
|
15
|
+
hasDefault: z.ZodOptional<z.ZodBoolean>;
|
|
16
|
+
lazy: z.ZodOptional<z.ZodBoolean>;
|
|
17
|
+
}, z.core.$strict>;
|
|
18
|
+
type FieldConfig = z.infer<typeof fieldConfig>;
|
|
19
|
+
declare const relationConfig: z.ZodObject<{
|
|
20
|
+
derived: z.ZodOptional<z.ZodLiteral<"async">>;
|
|
21
|
+
polymorphic: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"notNull">, z.ZodLiteral<true>]>>;
|
|
22
|
+
large: z.ZodOptional<z.ZodBoolean>;
|
|
23
|
+
orderBy: z.ZodOptional<z.ZodString>;
|
|
24
|
+
softDeletes: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"include">, z.ZodLiteral<"exclude">]>>;
|
|
25
|
+
stiType: z.ZodOptional<z.ZodString>;
|
|
26
|
+
subType: z.ZodOptional<z.ZodString>;
|
|
27
|
+
skipRecursiveRelations: z.ZodOptional<z.ZodBoolean>;
|
|
28
|
+
notNull: z.ZodOptional<z.ZodBoolean>;
|
|
29
|
+
hasDefault: z.ZodOptional<z.ZodBoolean>;
|
|
30
|
+
}, z.core.$strict>;
|
|
31
|
+
type RelationConfig = z.infer<typeof relationConfig>;
|
|
32
|
+
declare const entityConfig: z.ZodObject<{
|
|
33
|
+
tag: z.ZodString;
|
|
34
|
+
tableName: z.ZodOptional<z.ZodString>;
|
|
35
|
+
fields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
36
|
+
derived: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"sync">, z.ZodLiteral<"async">]>>;
|
|
37
|
+
protected: z.ZodOptional<z.ZodBoolean>;
|
|
38
|
+
ignore: z.ZodOptional<z.ZodBoolean>;
|
|
39
|
+
superstruct: z.ZodOptional<z.ZodString>;
|
|
40
|
+
zodSchema: z.ZodOptional<z.ZodString>;
|
|
41
|
+
type: z.ZodOptional<z.ZodString>;
|
|
42
|
+
serde: z.ZodOptional<z.ZodString>;
|
|
43
|
+
stiDiscriminator: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
44
|
+
stiType: z.ZodOptional<z.ZodString>;
|
|
45
|
+
notNull: z.ZodOptional<z.ZodBoolean>;
|
|
46
|
+
hasDefault: z.ZodOptional<z.ZodBoolean>;
|
|
47
|
+
lazy: z.ZodOptional<z.ZodBoolean>;
|
|
48
|
+
}, z.core.$strict>>>;
|
|
49
|
+
relations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
50
|
+
derived: z.ZodOptional<z.ZodLiteral<"async">>;
|
|
51
|
+
polymorphic: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"notNull">, z.ZodLiteral<true>]>>;
|
|
52
|
+
large: z.ZodOptional<z.ZodBoolean>;
|
|
53
|
+
orderBy: z.ZodOptional<z.ZodString>;
|
|
54
|
+
softDeletes: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"include">, z.ZodLiteral<"exclude">]>>;
|
|
55
|
+
stiType: z.ZodOptional<z.ZodString>;
|
|
56
|
+
subType: z.ZodOptional<z.ZodString>;
|
|
57
|
+
skipRecursiveRelations: z.ZodOptional<z.ZodBoolean>;
|
|
58
|
+
notNull: z.ZodOptional<z.ZodBoolean>;
|
|
59
|
+
hasDefault: z.ZodOptional<z.ZodBoolean>;
|
|
60
|
+
}, z.core.$strict>>>;
|
|
61
|
+
abstract: z.ZodOptional<z.ZodBoolean>;
|
|
62
|
+
orderBy: z.ZodOptional<z.ZodString>;
|
|
63
|
+
uniqueBy: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodArray<z.ZodString>>]>, z.ZodTransform<string[][], string | string[] | string[][]>>>;
|
|
64
|
+
}, z.core.$strict>;
|
|
65
|
+
type EntityConfig = z.infer<typeof entityConfig>;
|
|
66
|
+
declare const timestampConfig: z.ZodObject<{
|
|
67
|
+
names: z.ZodArray<z.ZodString>;
|
|
68
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
69
|
+
}, z.core.$strict>;
|
|
70
|
+
type TimestampConfig = z.infer<typeof timestampConfig>;
|
|
71
|
+
declare const config: z.ZodObject<{
|
|
72
|
+
databaseUrl: z.ZodOptional<z.ZodString>;
|
|
73
|
+
contextType: z.ZodOptional<z.ZodString>;
|
|
74
|
+
transactionType: z.ZodOptional<z.ZodString>;
|
|
75
|
+
timestampColumns: z.ZodOptional<z.ZodObject<{
|
|
76
|
+
createdAt: z.ZodOptional<z.ZodObject<{
|
|
77
|
+
names: z.ZodArray<z.ZodString>;
|
|
78
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
79
|
+
}, z.core.$strict>>;
|
|
80
|
+
updatedAt: z.ZodOptional<z.ZodObject<{
|
|
81
|
+
names: z.ZodArray<z.ZodString>;
|
|
82
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
83
|
+
}, z.core.$strict>>;
|
|
84
|
+
deletedAt: z.ZodOptional<z.ZodObject<{
|
|
85
|
+
names: z.ZodArray<z.ZodString>;
|
|
86
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
87
|
+
}, z.core.$strict>>;
|
|
88
|
+
}, z.core.$strip>>;
|
|
89
|
+
temporal: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
|
|
90
|
+
timeZone: z.ZodString;
|
|
91
|
+
}, z.core.$strip>]>>;
|
|
92
|
+
createFlushFunction: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodArray<z.ZodString>]>>;
|
|
93
|
+
entitiesDirectory: z.ZodDefault<z.ZodString>;
|
|
94
|
+
codegenPlugins: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
95
|
+
entities: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
96
|
+
tag: z.ZodString;
|
|
97
|
+
tableName: z.ZodOptional<z.ZodString>;
|
|
98
|
+
fields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
99
|
+
derived: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"sync">, z.ZodLiteral<"async">]>>;
|
|
100
|
+
protected: z.ZodOptional<z.ZodBoolean>;
|
|
101
|
+
ignore: z.ZodOptional<z.ZodBoolean>;
|
|
102
|
+
superstruct: z.ZodOptional<z.ZodString>;
|
|
103
|
+
zodSchema: z.ZodOptional<z.ZodString>;
|
|
104
|
+
type: z.ZodOptional<z.ZodString>;
|
|
105
|
+
serde: z.ZodOptional<z.ZodString>;
|
|
106
|
+
stiDiscriminator: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
107
|
+
stiType: z.ZodOptional<z.ZodString>;
|
|
108
|
+
notNull: z.ZodOptional<z.ZodBoolean>;
|
|
109
|
+
hasDefault: z.ZodOptional<z.ZodBoolean>;
|
|
110
|
+
lazy: z.ZodOptional<z.ZodBoolean>;
|
|
111
|
+
}, z.core.$strict>>>;
|
|
112
|
+
relations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
113
|
+
derived: z.ZodOptional<z.ZodLiteral<"async">>;
|
|
114
|
+
polymorphic: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"notNull">, z.ZodLiteral<true>]>>;
|
|
115
|
+
large: z.ZodOptional<z.ZodBoolean>;
|
|
116
|
+
orderBy: z.ZodOptional<z.ZodString>;
|
|
117
|
+
softDeletes: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"include">, z.ZodLiteral<"exclude">]>>;
|
|
118
|
+
stiType: z.ZodOptional<z.ZodString>;
|
|
119
|
+
subType: z.ZodOptional<z.ZodString>;
|
|
120
|
+
skipRecursiveRelations: z.ZodOptional<z.ZodBoolean>;
|
|
121
|
+
notNull: z.ZodOptional<z.ZodBoolean>;
|
|
122
|
+
hasDefault: z.ZodOptional<z.ZodBoolean>;
|
|
123
|
+
}, z.core.$strict>>>;
|
|
124
|
+
abstract: z.ZodOptional<z.ZodBoolean>;
|
|
125
|
+
orderBy: z.ZodOptional<z.ZodString>;
|
|
126
|
+
uniqueBy: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodArray<z.ZodString>>]>, z.ZodTransform<string[][], string | string[] | string[][]>>>;
|
|
127
|
+
}, z.core.$strict>>>;
|
|
128
|
+
ignoredTables: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
129
|
+
idType: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"tagged-string">, z.ZodLiteral<"untagged-string">, z.ZodLiteral<"number">]>>;
|
|
130
|
+
tagDelimiter: z.ZodOptional<z.ZodString>;
|
|
131
|
+
nonDeferredForeignKeys: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"error">, z.ZodLiteral<"warn">, z.ZodLiteral<"ignore">]>>;
|
|
132
|
+
esm: z.ZodOptional<z.ZodBoolean>;
|
|
133
|
+
paginationStyle: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"cursor">, z.ZodLiteral<"limit">]>>>;
|
|
134
|
+
docs: z.ZodOptional<z.ZodBoolean>;
|
|
135
|
+
skills: z.ZodOptional<z.ZodBoolean>;
|
|
136
|
+
outputDocs: z.ZodOptional<z.ZodBoolean>;
|
|
137
|
+
allowImportingTsExtensions: z.ZodOptional<z.ZodBoolean>;
|
|
138
|
+
codemodVersion: z.ZodDefault<z.ZodNumber>;
|
|
139
|
+
schemas: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
140
|
+
}, z.core.$strict>;
|
|
141
|
+
type Config = z.infer<typeof config> & {
|
|
142
|
+
__tableToEntityName?: Record<string, string>;
|
|
143
|
+
};
|
|
144
|
+
declare const ormMaintainedFields: string[];
|
|
145
|
+
/** Ensure the user doesn't have any typos in their config. */
|
|
146
|
+
declare function warnInvalidConfigEntries(config: Config, db: DbMetadata): void;
|
|
147
|
+
declare function isGetterField(config: Config, entity: Entity, fieldName: string): boolean;
|
|
148
|
+
declare function isReactiveField(config: Config, entity: Entity, fieldName: string): boolean;
|
|
149
|
+
declare function isReactiveReference(config: Config, entity: Entity, fieldName: string): boolean;
|
|
150
|
+
/** Returns true if this m2m relation is configured as a ReactiveManyToMany (derived: async). */
|
|
151
|
+
declare function isReactiveManyToMany(config: Config, entity: Entity, fieldName: string): boolean;
|
|
152
|
+
declare function isProtected(config: Config, entity: Entity, fieldName: string): boolean;
|
|
153
|
+
/** Whether a column should be excluded from the default SELECT and exposed as a lazy-loaded `LazyField`. */
|
|
154
|
+
declare function isLazyField(config: Config, entity: Entity, fieldName: string): boolean;
|
|
155
|
+
declare function serdeConfig(config: Config, entity: Entity, fieldName: string): string | undefined;
|
|
156
|
+
declare function superstructConfig(config: Config, entity: Entity, fieldName: string): string | undefined;
|
|
157
|
+
declare function zodSchemaConfig(config: Config, entity: Entity, fieldName: string): string | undefined;
|
|
158
|
+
declare function fieldTypeConfig(config: Config, entity: Entity, fieldName: string): string | undefined;
|
|
159
|
+
declare function isLargeCollection(config: Config, entity: Entity, fieldName: string): boolean;
|
|
160
|
+
/** Whether a collection should include (or exclude) soft-deleted entities from `.get`/`.load`. */
|
|
161
|
+
declare function softDeletesConfig(config: Config, entity: Entity, fieldName: string): "include" | "exclude" | undefined;
|
|
162
|
+
declare function isFieldIgnored(config: Config, entity: Entity, fieldName: string, notNull?: boolean, hasDefault?: boolean): boolean;
|
|
163
|
+
declare function isFieldHasDefault(config: Config, entity: Entity, fieldName: string): boolean;
|
|
164
|
+
declare function loadConfig(): Promise<Config>;
|
|
165
|
+
/**
|
|
166
|
+
* Writes the potentially-updated config entry back to `joist-config.json`.
|
|
167
|
+
*
|
|
168
|
+
* We format the output with prettier so it should both a) look nice and b) be deterministic,
|
|
169
|
+
* such that no changes to the config show up as noops to the scm.
|
|
170
|
+
*/
|
|
171
|
+
declare function writeConfig(config: Config): Promise<void>;
|
|
172
|
+
declare function stripStiPlaceholders(config: Config, entities: EntityDbMetadata[]): void;
|
|
173
|
+
/** Applies defaults to the timestamp config. */
|
|
174
|
+
declare function getTimestampConfig(config: Config): {
|
|
175
|
+
updatedAtConf: Required<TimestampConfig>;
|
|
176
|
+
createdAtConf: Required<TimestampConfig>;
|
|
177
|
+
deletedAtConf: Required<TimestampConfig>;
|
|
178
|
+
};
|
|
179
|
+
//#endregion
|
|
180
|
+
export { Config, EntityConfig, FieldConfig, RelationConfig, TimestampConfig, config, fieldTypeConfig, getTimestampConfig, isFieldHasDefault, isFieldIgnored, isGetterField, isLargeCollection, isLazyField, isProtected, isReactiveField, isReactiveManyToMany, isReactiveReference, loadConfig, ormMaintainedFields, serdeConfig, softDeletesConfig, stripStiPlaceholders, superstructConfig, warnInvalidConfigEntries, writeConfig, zodSchemaConfig };
|
|
181
|
+
//# sourceMappingURL=config.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.mts","names":[],"sources":["../src/config.ts"],"mappings":";;;cAiBM,aAAW,EAAA;;;;;;;;;;;;;GAmBN,EAAA,KAAA;KAEC,cAAc,EAAE,aAAa;cAEnC,gBAAc,EAAA;;;;;;;;;;;GA8BT,EAAA,KAAA;KAEC,iBAAiB,EAAE,aAAa;cAMtC,cAAY,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAWP,EAAA,KAAA;KAEC,eAAe,EAAE,aAAa;cAEpC,iBAAe,EAAA;;;GAOV,EAAA,KAAA;KAEC,kBA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