joist-codegen 2.3.0-next.6 → 2.3.0-next.61
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 +608 -0
- package/build/EntityDbMetadata.cjs.map +1 -0
- package/build/EntityDbMetadata.d.cts +274 -0
- package/build/EntityDbMetadata.d.cts.map +1 -0
- package/build/EntityDbMetadata.d.mts +274 -0
- package/build/EntityDbMetadata.d.mts.map +1 -0
- package/build/EntityDbMetadata.js +485 -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 +127 -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 +110 -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 +955 -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 +738 -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 +290 -0
- package/build/generateMetadataFile.cjs.map +1 -0
- package/build/generateMetadataFile.d.cts +8 -0
- package/build/generateMetadataFile.d.cts.map +1 -0
- package/build/generateMetadataFile.d.mts +8 -0
- package/build/generateMetadataFile.d.mts.map +1 -0
- package/build/generateMetadataFile.js +116 -140
- 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 +213 -0
- package/build/inheritance.cjs.map +1 -0
- package/build/inheritance.d.cts +12 -0
- package/build/inheritance.d.cts.map +1 -0
- package/build/inheritance.d.mts +12 -0
- package/build/inheritance.d.mts.map +1 -0
- package/build/inheritance.js +193 -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 +228 -0
- package/build/symbols.cjs.map +1 -0
- package/build/symbols.d.cts +115 -0
- package/build/symbols.d.cts.map +1 -0
- package/build/symbols.d.mts +115 -0
- package/build/symbols.d.mts.map +1 -0
- package/build/symbols.js +116 -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,274 @@
|
|
|
1
|
+
import { Config } from "./config.mjs";
|
|
2
|
+
import { EnumMetadata, EnumRow, PgEnumMetadata } from "./loadMetadata.mjs";
|
|
3
|
+
import { Action, Column, M2MRelation, M2ORelation, O2MRelation, Table } from "pg-structure";
|
|
4
|
+
import { Code, Import } from "ts-poet";
|
|
5
|
+
//#region src/EntityDbMetadata.d.ts
|
|
6
|
+
/** All the entities + enums in our database. */
|
|
7
|
+
interface DbMetadata {
|
|
8
|
+
entities: EntityDbMetadata[];
|
|
9
|
+
/** Type name i.e. `Author` to metadata. */
|
|
10
|
+
entitiesByName: Record<string, EntityDbMetadata>;
|
|
11
|
+
enums: EnumMetadata;
|
|
12
|
+
pgEnums: PgEnumMetadata;
|
|
13
|
+
joinTables: string[];
|
|
14
|
+
/** Other non-joist tables in the schema. */
|
|
15
|
+
otherTables: string[];
|
|
16
|
+
totalTables: number;
|
|
17
|
+
}
|
|
18
|
+
/** Codegen-time metadata about a given domain entity. */
|
|
19
|
+
type Entity = {
|
|
20
|
+
name: string;
|
|
21
|
+
/** The _type_ symbol pointing to the entity itself. */
|
|
22
|
+
type: Import;
|
|
23
|
+
/** The symbol pointing to the entity itself. */
|
|
24
|
+
typeSymbol: Import;
|
|
25
|
+
/** The symbol pointing to the entity itself, directly rather than via entities.ts */
|
|
26
|
+
typeForMetadataFile: Import;
|
|
27
|
+
/** The name of the entity's runtime metadata const. */
|
|
28
|
+
metaName: string;
|
|
29
|
+
/** The symbol pointing to the entity's runtime metadata const. */
|
|
30
|
+
metaType: Import;
|
|
31
|
+
/** The symbol pointing to the entity's EntityId type. */
|
|
32
|
+
idType: Import;
|
|
33
|
+
/** The symbol pointing to the entity's Order type. */
|
|
34
|
+
orderType: Import;
|
|
35
|
+
/** The symbol pointing to the entity's config const. */
|
|
36
|
+
configConst: Import;
|
|
37
|
+
optsType: Import;
|
|
38
|
+
/** i.e. `AuthorId` (or `Author_Id` on conflict). */
|
|
39
|
+
idName: string;
|
|
40
|
+
/** i.e. `AuthorFields`. */
|
|
41
|
+
fieldsName: string;
|
|
42
|
+
/** i.e. `AuthorOpts`. */
|
|
43
|
+
optsName: string;
|
|
44
|
+
/** i.e. `AuthorIdsOpts`. */
|
|
45
|
+
idsOptsName: string;
|
|
46
|
+
/** i.e. `AuthorFilter`. */
|
|
47
|
+
filterName: string;
|
|
48
|
+
/** i.e. `AuthorGraphQLFilter`. */
|
|
49
|
+
graphqlFilterName: string;
|
|
50
|
+
/** i.e. `AuthorOrder`. */
|
|
51
|
+
orderName: string;
|
|
52
|
+
/** i.e. `AuthorFactoryExtras`. */
|
|
53
|
+
factoryExtrasName: string;
|
|
54
|
+
/** i.e. `AuthorScope`. */
|
|
55
|
+
scopeName: string;
|
|
56
|
+
/** i.e. `AuthorScopes`. */
|
|
57
|
+
scopesName: string;
|
|
58
|
+
};
|
|
59
|
+
type DatabaseColumnType = "boolean" | "int" | "uuid" | "numeric" | "smallint" | "integer" | "bigint" | "decimal" | "real" | "smallserial" | "serial" | "bigserial" | "double precision" | "text" | "citext" | "character varying" | "varchar" | "time without time zone" | "timestamp with time zone" | "timestamp without time zone" | "date" | "jsonb" | "bytea" | "tsvector" | "tstzrange";
|
|
60
|
+
/**
|
|
61
|
+
* A logical entity field.
|
|
62
|
+
*
|
|
63
|
+
* I.e. it may be a physical db column, or multiple physical db columns, or a "virtual" field like
|
|
64
|
+
* the one-to-many collection side of a many-to-one foreign key. */
|
|
65
|
+
interface Field {
|
|
66
|
+
fieldName: string;
|
|
67
|
+
ignore?: boolean;
|
|
68
|
+
}
|
|
69
|
+
type PrimitiveTypescriptType = "boolean" | "string" | "number" | "Object" | "bigint" | "Uint8Array" | Code;
|
|
70
|
+
type PrimitiveField = Field & {
|
|
71
|
+
kind: "primitive";
|
|
72
|
+
columnName: string;
|
|
73
|
+
columnType: DatabaseColumnType;
|
|
74
|
+
columnDefault: number | boolean | string | null;
|
|
75
|
+
fieldType: PrimitiveTypescriptType | Import;
|
|
76
|
+
rawFieldType: PrimitiveTypescriptType;
|
|
77
|
+
notNull: boolean;
|
|
78
|
+
derived: "orm" | "sync" | "async" | false;
|
|
79
|
+
protected: boolean;
|
|
80
|
+
unique: boolean;
|
|
81
|
+
superstruct: Import | undefined;
|
|
82
|
+
zodSchema: Import | undefined;
|
|
83
|
+
customSerde: Import | undefined;
|
|
84
|
+
isArray: boolean;
|
|
85
|
+
hasConfigDefault: boolean;
|
|
86
|
+
lazy?: boolean;
|
|
87
|
+
};
|
|
88
|
+
type EnumField = Field & {
|
|
89
|
+
kind: "enum";
|
|
90
|
+
columnName: string;
|
|
91
|
+
columnType: DatabaseColumnType;
|
|
92
|
+
columnDefault: number | boolean | string | null;
|
|
93
|
+
derived: "sync" | "async" | false;
|
|
94
|
+
enumName: string;
|
|
95
|
+
enumType: Import;
|
|
96
|
+
enumDetailType: Import;
|
|
97
|
+
enumDetailsType: Import;
|
|
98
|
+
enumRows: EnumRow[];
|
|
99
|
+
notNull: boolean;
|
|
100
|
+
isArray: boolean;
|
|
101
|
+
hasConfigDefault: boolean;
|
|
102
|
+
};
|
|
103
|
+
type PgEnumField = Field & {
|
|
104
|
+
kind: "pg-enum";
|
|
105
|
+
columnName: string;
|
|
106
|
+
columnDefault: number | boolean | string | null;
|
|
107
|
+
/** I.e. `favorite_shape`. */
|
|
108
|
+
dbType: string;
|
|
109
|
+
/** I.e. `FavoriteShape`. */
|
|
110
|
+
enumName: string;
|
|
111
|
+
enumType: Import;
|
|
112
|
+
enumValues: string[];
|
|
113
|
+
notNull: boolean;
|
|
114
|
+
hasConfigDefault: boolean;
|
|
115
|
+
};
|
|
116
|
+
/** I.e. a `Book.author` reference pointing to an `Author`. */
|
|
117
|
+
type ManyToOneField = Field & {
|
|
118
|
+
kind: "m2o";
|
|
119
|
+
columnName: string;
|
|
120
|
+
dbType: string;
|
|
121
|
+
otherFieldName: string;
|
|
122
|
+
otherEntity: Entity;
|
|
123
|
+
notNull: boolean;
|
|
124
|
+
isDeferredAndDeferrable: boolean;
|
|
125
|
+
constraintName: string;
|
|
126
|
+
derived: "async" | false;
|
|
127
|
+
hasConfigDefault: boolean;
|
|
128
|
+
onDelete: Action;
|
|
129
|
+
};
|
|
130
|
+
/** I.e. a `Author.books` collection. */
|
|
131
|
+
type OneToManyField = Field & {
|
|
132
|
+
kind: "o2m";
|
|
133
|
+
singularName: string;
|
|
134
|
+
otherEntity: Entity;
|
|
135
|
+
otherFieldName: string;
|
|
136
|
+
otherColumnName: string;
|
|
137
|
+
otherColumnNotNull: boolean;
|
|
138
|
+
isLargeCollection: boolean;
|
|
139
|
+
orderBy: {
|
|
140
|
+
field: string;
|
|
141
|
+
direction: "ASC" | "DESC";
|
|
142
|
+
} | undefined;
|
|
143
|
+
softDeletes: "include" | "exclude" | undefined;
|
|
144
|
+
};
|
|
145
|
+
/** I.e. a `Author.image` reference when `image.author_id` is unique. */
|
|
146
|
+
type OneToOneField = Field & {
|
|
147
|
+
kind: "o2o";
|
|
148
|
+
otherEntity: Entity;
|
|
149
|
+
otherFieldName: string;
|
|
150
|
+
otherColumnName: string;
|
|
151
|
+
otherColumnNotNull: boolean;
|
|
152
|
+
};
|
|
153
|
+
type ManyToManyField = Field & {
|
|
154
|
+
kind: "m2m";
|
|
155
|
+
joinTableName: string;
|
|
156
|
+
singularName: string;
|
|
157
|
+
columnName: string;
|
|
158
|
+
otherEntity: Entity;
|
|
159
|
+
otherFieldName: string;
|
|
160
|
+
otherColumnName: string;
|
|
161
|
+
isLargeCollection: boolean;
|
|
162
|
+
isDeferredAndDeferrable: boolean;
|
|
163
|
+
derived: "async" | "otherSide" | false;
|
|
164
|
+
softDeletes: "include" | "exclude" | undefined;
|
|
165
|
+
/** Whether the join table has a surrogate `id` PK; if false the FK pair is the composite PK. */
|
|
166
|
+
hasJoinTableId: boolean;
|
|
167
|
+
};
|
|
168
|
+
/** I.e. a `Publisher.logoColors` m2m to the `color` enum table, backed by `publisher_logo_colors`. */
|
|
169
|
+
type ManyToManyEnumField = Field & {
|
|
170
|
+
kind: "m2mEnum";
|
|
171
|
+
joinTableName: string;
|
|
172
|
+
/** The entity's FK column, e.g. `publisher_id`. */
|
|
173
|
+
columnName: string;
|
|
174
|
+
/** The enum's FK column, e.g. `logo_color_id`. */
|
|
175
|
+
otherColumnName: string;
|
|
176
|
+
enumName: string;
|
|
177
|
+
enumType: Import;
|
|
178
|
+
enumDetailType: Import;
|
|
179
|
+
enumDetailsType: Import;
|
|
180
|
+
enumRows: EnumRow[];
|
|
181
|
+
/** Whether the join table has a surrogate `id` PK; if false the FK pair is the composite PK. */
|
|
182
|
+
hasJoinTableId: boolean;
|
|
183
|
+
};
|
|
184
|
+
/** I.e. a `Comment.parent` reference that groups `comments.parent_book_id` and `comments.parent_book_review_id`. */
|
|
185
|
+
type PolymorphicField = Field & {
|
|
186
|
+
kind: "poly";
|
|
187
|
+
fieldType: string;
|
|
188
|
+
notNull: boolean;
|
|
189
|
+
hasConfigDefault: boolean;
|
|
190
|
+
components: PolymorphicFieldComponent[];
|
|
191
|
+
};
|
|
192
|
+
type PolymorphicFieldComponent = {
|
|
193
|
+
columnName: string;
|
|
194
|
+
otherFieldName: string;
|
|
195
|
+
otherEntity: Entity;
|
|
196
|
+
isDeferredAndDeferrable: boolean;
|
|
197
|
+
constraintName: string;
|
|
198
|
+
notNull: false;
|
|
199
|
+
};
|
|
200
|
+
type FieldNameOverrides = {
|
|
201
|
+
fieldName?: string;
|
|
202
|
+
otherFieldName?: string;
|
|
203
|
+
};
|
|
204
|
+
/** Adapts the generally-great pg-structure metadata into our specific ORM types. */
|
|
205
|
+
declare class EntityDbMetadata {
|
|
206
|
+
entity: Entity;
|
|
207
|
+
primaryKey: PrimitiveField;
|
|
208
|
+
primitives: PrimitiveField[];
|
|
209
|
+
enums: EnumField[];
|
|
210
|
+
pgEnums: PgEnumField[];
|
|
211
|
+
manyToOnes: ManyToOneField[];
|
|
212
|
+
oneToManys: OneToManyField[];
|
|
213
|
+
largeOneToManys: OneToManyField[];
|
|
214
|
+
oneToOnes: OneToOneField[];
|
|
215
|
+
manyToManys: ManyToManyField[];
|
|
216
|
+
largeManyToManys: ManyToManyField[];
|
|
217
|
+
manyToManyEnums: ManyToManyEnumField[];
|
|
218
|
+
polymorphics: PolymorphicField[];
|
|
219
|
+
tableName: string;
|
|
220
|
+
tagName: string;
|
|
221
|
+
createdAt: PrimitiveField | undefined;
|
|
222
|
+
updatedAt: PrimitiveField | undefined;
|
|
223
|
+
deletedAt: PrimitiveField | undefined;
|
|
224
|
+
baseClassName: string | undefined;
|
|
225
|
+
baseType: EntityDbMetadata | undefined;
|
|
226
|
+
subTypes: EntityDbMetadata[];
|
|
227
|
+
inheritanceType: "sti" | "cti" | undefined;
|
|
228
|
+
/** This will only be set on the base meta. */
|
|
229
|
+
stiDiscriminatorField?: string;
|
|
230
|
+
/** This will only be set on the sub metas. */
|
|
231
|
+
stiDiscriminatorValue?: number;
|
|
232
|
+
abstract: boolean;
|
|
233
|
+
nonDeferredFkOrder: number;
|
|
234
|
+
uniqueConstraints?: string[][];
|
|
235
|
+
constructor(config: Config, table: Table, enums?: EnumMetadata);
|
|
236
|
+
get name(): string;
|
|
237
|
+
get nonDeferredFks(): Array<ManyToOneField | PolymorphicFieldComponent>;
|
|
238
|
+
get nonDeferredManyToManyFks(): Array<ManyToManyField>;
|
|
239
|
+
}
|
|
240
|
+
/** Finds the field name for o2o side of a o2o/m2o. */
|
|
241
|
+
declare function oneToOneName(config: Config, refEntity: Entity, keyEntity: Entity, r: M2ORelation | O2MRelation): string;
|
|
242
|
+
declare function referenceName(config: Config, entity: Entity, r: M2ORelation | O2MRelation): string;
|
|
243
|
+
declare function manyToManyName(column: Column): string;
|
|
244
|
+
/** Returns the collection name to use on `entity` when referring to `otherEntity`s. */
|
|
245
|
+
declare function collectionName(config: Config, singleEntity: Entity, collectionEntity: Entity, r: M2ORelation | O2MRelation | M2MRelation): {
|
|
246
|
+
fieldName: string;
|
|
247
|
+
singularName: string;
|
|
248
|
+
};
|
|
249
|
+
declare function failIfOverlappingFieldNames(entity: EntityDbMetadata): void;
|
|
250
|
+
declare function makeEntity(entityName: string): Entity;
|
|
251
|
+
/**
|
|
252
|
+
* Collapses the per-relation `otherEntity` copies down to the one primary `Entity` per name.
|
|
253
|
+
*
|
|
254
|
+
* `makeEntity` mints a fresh `Entity` for every relation's `otherEntity`, so each entity ends up with
|
|
255
|
+
* many duplicate objects floating around. Pointing them all at the single `entitiesByName[name].entity`
|
|
256
|
+
* instance means later passes (i.e. `resolveNameConflicts`) only have to update one object per name.
|
|
257
|
+
*
|
|
258
|
+
* Must run after inheritance, since STI/CTI specialization both adds and re-points `otherEntity`s.
|
|
259
|
+
*/
|
|
260
|
+
declare function canonicalizeOtherEntities(db: DbMetadata): void;
|
|
261
|
+
/**
|
|
262
|
+
* Rewrites codegen'd type names that collide with another exported type name.
|
|
263
|
+
*
|
|
264
|
+
* `makeEntity` defaults each name to the conventional `${name}<Suffix>`, but if a separate entity or
|
|
265
|
+
* enum is literally named e.g. `AuthorScope` or `AuthorOrder`, our generated type of the same name
|
|
266
|
+
* would collide with it, so we fall back to `Author_Scope` / `Author_Order`.
|
|
267
|
+
*
|
|
268
|
+
* Relies on `canonicalizeOtherEntities` having run, so mutating each primary `meta.entity` also updates
|
|
269
|
+
* the `otherEntity` references that point at it (e.g. `Book.author: AuthorId` follows `Author`'s rename).
|
|
270
|
+
*/
|
|
271
|
+
declare function resolveNameConflicts(config: Config, db: DbMetadata): void;
|
|
272
|
+
//#endregion
|
|
273
|
+
export { DatabaseColumnType, DbMetadata, Entity, EntityDbMetadata, EnumField, FieldNameOverrides, ManyToManyEnumField, ManyToManyField, ManyToOneField, OneToManyField, OneToOneField, PgEnumField, PolymorphicField, PolymorphicFieldComponent, PrimitiveField, PrimitiveTypescriptType, canonicalizeOtherEntities, collectionName, failIfOverlappingFieldNames, makeEntity, manyToManyName, oneToOneName, referenceName, resolveNameConflicts };
|
|
274
|
+
//# sourceMappingURL=EntityDbMetadata.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EntityDbMetadata.d.mts","names":[],"sources":["../src/EntityDbMetadata.ts"],"mappings":";;;;;;UAmDiB;EACf,UAAU;;EAEV,gBAAgB,eAAe;EAC/B,OAAO;EACP,SAAS;EACT;;EAEA;EACA;;;KAIU;EACV;;EAEA,MAAM;;EAEN,YAAY;;EAEZ,qBAAqB;;EAErB;;EAEA,UAAU;;EAEV,QAAQ;;EAER,WAAW;;EAEX,aAAa;EACb,UAAU;;EAKV;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;KAGU;;;;;;UAgCF;EACR;EACA;;KAGU,iGAAiG;KAEjG,iBAAiB;EAC3B;EACA;EACA,YAAY;EACZ;EAEA,WAAW,0BAA0B;EACrC,cAAc;EACd;EACA;EACA;EACA;EACA,aAAa;EACb,WAAW;EACX,aAAa;EACb;EACA;EACA;;KAGU,YAAY;EACtB;EACA;EACA,YAAY;EACZ;EACA;EACA;EACA,UAAU;EACV,gBAAgB;EAChB,iBAAiB;EACjB,UAAU;EACV;EACA;EACA;;KAGU,cAAc;EACxB;EACA;EACA;;EAEA;;EAEA;EACA,UAAU;EACV;EACA;EACA;;;KAIU,iBAAiB;EAC3B;EACA;EACA;EACA;EACA,aAAa;EACb;EACA;EACA;EACA;EACA;EACA,UAAU;;;KAIA,iBAAiB;EAC3B;EACA;EACA,aAAa;EACb;EACA;EACA;EACA;EACA;IAAW;IAAe;;EAC1B;;;KAIU,gBAAgB;EAC1B;EACA,aAAa;EACb;EACA;EACA;;KAGU,kBAAkB;EAC5B;EACA;EACA;EACA;EACA,aAAa;EACb;EACA;EACA;EACA;EACA;EACA;;EAEA;;;KAIU,sBAAsB;EAChC;EACA;;EAEA;;EAEA;EACA;EACA,UAAU;EACV,gBAAgB;EAChB,iBAAiB;EACjB,UAAU;;EAEV;;;KAIU,mBAAmB;EAC7B;EACA;EACA;EACA;EACA,YAAY;;KAGF;EACV;EACA;EACA,aAAa;EACb;EACA;EACA;;KAGU;EACV;EACA;;;cAIW;EACX,QAAQ;EACR,YAAY;EACZ,YAAY;EACZ,OAAO;EACP,SAAS;EACT,YAAY;EACZ,YAAY;EACZ,iBAAiB;EACjB,WAAW;EACX,aAAa;EACb,kBAAkB;EAClB,iBAAiB;EACjB,cAAc;EACd;EACA;EACA,WAAW;EACX,WAAW;EACX,WAAW;EACX;EACA,UAAU;EACV,UAAU;EACV;;EAEA;;EAEA;EACA;EACA;EACA;EAEA,YAAY,QAAQ,QAAQ,OAAO,OAAO,QAAO;MAuG7C;MAIA,kBAAkB,MAAM,iBAAiB;MAOzC,4BAA4B,MAAM;;;iBAwZxB,aACd,QAAQ,QAER,WAAW,QAEX,WAAW,QACX,GAAG,cAAc;iBAgCH,cAAc,QAAQ,QAAQ,QAAQ,QAAQ,GAAG,cAAc;iBAmB/D,eAAe,QAAQ;;iBAUvB,eACd,QAAQ,QAER,cAAc,QAEd,kBAAkB,QAClB,GAAG,cAAc,cAAc;EAC5B;EAAmB;;iBA4BR,4BAA4B,QAAQ;iBAwBpC,WAAW,qBAAqB;;;;;;;;;;iBA6BhC,0BAA0B,IAAI;;;;;;;;;;;iBA6B9B,qBAAqB,QAAQ,QAAQ,IAAI"}
|