@gqlkit-ts/cli 0.0.1 → 0.2.0

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.
Files changed (362) hide show
  1. package/LICENSE +21 -0
  2. package/dist/auto-type-generator/auto-type-generator.d.ts +62 -0
  3. package/dist/auto-type-generator/auto-type-generator.d.ts.map +1 -0
  4. package/dist/auto-type-generator/auto-type-generator.js +540 -0
  5. package/dist/auto-type-generator/auto-type-generator.js.map +1 -0
  6. package/dist/auto-type-generator/index.d.ts +4 -0
  7. package/dist/auto-type-generator/index.d.ts.map +1 -0
  8. package/dist/auto-type-generator/index.js +3 -0
  9. package/dist/auto-type-generator/index.js.map +1 -0
  10. package/dist/auto-type-generator/inline-enum-collector.d.ts +31 -0
  11. package/dist/auto-type-generator/inline-enum-collector.d.ts.map +1 -0
  12. package/dist/auto-type-generator/inline-enum-collector.js +157 -0
  13. package/dist/auto-type-generator/inline-enum-collector.js.map +1 -0
  14. package/dist/auto-type-generator/name-collision-validator.d.ts +17 -0
  15. package/dist/auto-type-generator/name-collision-validator.d.ts.map +1 -0
  16. package/dist/auto-type-generator/name-collision-validator.js +68 -0
  17. package/dist/auto-type-generator/name-collision-validator.js.map +1 -0
  18. package/dist/auto-type-generator/naming-convention.d.ts +44 -0
  19. package/dist/auto-type-generator/naming-convention.d.ts.map +1 -0
  20. package/dist/auto-type-generator/naming-convention.js +67 -0
  21. package/dist/auto-type-generator/naming-convention.js.map +1 -0
  22. package/dist/cli.d.ts +2 -0
  23. package/dist/cli.d.ts.map +1 -0
  24. package/dist/cli.js +11 -0
  25. package/dist/cli.js.map +1 -0
  26. package/dist/commands/gen.d.ts +32 -0
  27. package/dist/commands/gen.d.ts.map +1 -0
  28. package/dist/commands/gen.js +101 -0
  29. package/dist/commands/gen.js.map +1 -0
  30. package/dist/commands/main.d.ts +12 -0
  31. package/dist/commands/main.d.ts.map +1 -0
  32. package/dist/commands/main.js +5 -0
  33. package/dist/commands/main.js.map +1 -0
  34. package/dist/config/define-config.d.ts +26 -0
  35. package/dist/config/define-config.d.ts.map +1 -0
  36. package/dist/config/define-config.js +27 -0
  37. package/dist/config/define-config.js.map +1 -0
  38. package/dist/config/index.d.ts +3 -0
  39. package/dist/config/index.d.ts.map +1 -0
  40. package/dist/config/index.js +2 -0
  41. package/dist/config/index.js.map +1 -0
  42. package/dist/config/types.d.ts +131 -0
  43. package/dist/config/types.d.ts.map +1 -0
  44. package/dist/config/types.js +2 -0
  45. package/dist/config/types.js.map +1 -0
  46. package/dist/config-loader/index.d.ts +3 -0
  47. package/dist/config-loader/index.d.ts.map +1 -0
  48. package/dist/config-loader/index.js +2 -0
  49. package/dist/config-loader/index.js.map +1 -0
  50. package/dist/config-loader/loader.d.ts +50 -0
  51. package/dist/config-loader/loader.d.ts.map +1 -0
  52. package/dist/config-loader/loader.js +78 -0
  53. package/dist/config-loader/loader.js.map +1 -0
  54. package/dist/config-loader/validator.d.ts +13 -0
  55. package/dist/config-loader/validator.d.ts.map +1 -0
  56. package/dist/config-loader/validator.js +497 -0
  57. package/dist/config-loader/validator.js.map +1 -0
  58. package/dist/gen-orchestrator/hook-executor/hook-executor.d.ts +25 -0
  59. package/dist/gen-orchestrator/hook-executor/hook-executor.d.ts.map +1 -0
  60. package/dist/gen-orchestrator/hook-executor/hook-executor.js +68 -0
  61. package/dist/gen-orchestrator/hook-executor/hook-executor.js.map +1 -0
  62. package/dist/gen-orchestrator/orchestrator.d.ts +30 -0
  63. package/dist/gen-orchestrator/orchestrator.d.ts.map +1 -0
  64. package/dist/gen-orchestrator/orchestrator.js +505 -0
  65. package/dist/gen-orchestrator/orchestrator.js.map +1 -0
  66. package/dist/gen-orchestrator/reporter/diagnostic-reporter.d.ts +9 -0
  67. package/dist/gen-orchestrator/reporter/diagnostic-reporter.d.ts.map +1 -0
  68. package/dist/gen-orchestrator/reporter/diagnostic-reporter.js +32 -0
  69. package/dist/gen-orchestrator/reporter/diagnostic-reporter.js.map +1 -0
  70. package/dist/gen-orchestrator/reporter/progress-reporter.d.ts +19 -0
  71. package/dist/gen-orchestrator/reporter/progress-reporter.d.ts.map +1 -0
  72. package/dist/gen-orchestrator/reporter/progress-reporter.js +38 -0
  73. package/dist/gen-orchestrator/reporter/progress-reporter.js.map +1 -0
  74. package/dist/gen-orchestrator/writer/file-writer.d.ts +13 -0
  75. package/dist/gen-orchestrator/writer/file-writer.d.ts.map +1 -0
  76. package/dist/gen-orchestrator/writer/file-writer.js +22 -0
  77. package/dist/gen-orchestrator/writer/file-writer.js.map +1 -0
  78. package/dist/index.d.ts +3 -0
  79. package/dist/index.d.ts.map +1 -0
  80. package/dist/index.js +2 -0
  81. package/dist/index.js.map +1 -0
  82. package/dist/resolver-extractor/extract-resolvers.d.ts +49 -0
  83. package/dist/resolver-extractor/extract-resolvers.d.ts.map +1 -0
  84. package/dist/resolver-extractor/extract-resolvers.js +2 -0
  85. package/dist/resolver-extractor/extract-resolvers.js.map +1 -0
  86. package/dist/resolver-extractor/extractor/define-api-extractor.d.ts +60 -0
  87. package/dist/resolver-extractor/extractor/define-api-extractor.d.ts.map +1 -0
  88. package/dist/resolver-extractor/extractor/define-api-extractor.js +509 -0
  89. package/dist/resolver-extractor/extractor/define-api-extractor.js.map +1 -0
  90. package/dist/resolver-extractor/index.d.ts +5 -0
  91. package/dist/resolver-extractor/index.d.ts.map +1 -0
  92. package/dist/resolver-extractor/index.js +2 -0
  93. package/dist/resolver-extractor/index.js.map +1 -0
  94. package/dist/resolver-extractor/validator/abstract-resolver-validator.d.ts +25 -0
  95. package/dist/resolver-extractor/validator/abstract-resolver-validator.d.ts.map +1 -0
  96. package/dist/resolver-extractor/validator/abstract-resolver-validator.js +172 -0
  97. package/dist/resolver-extractor/validator/abstract-resolver-validator.js.map +1 -0
  98. package/dist/resolver-extractor/validator/only-validator.d.ts +61 -0
  99. package/dist/resolver-extractor/validator/only-validator.d.ts.map +1 -0
  100. package/dist/resolver-extractor/validator/only-validator.js +76 -0
  101. package/dist/resolver-extractor/validator/only-validator.js.map +1 -0
  102. package/dist/schema-generator/builder/ast-builder.d.ts +7 -0
  103. package/dist/schema-generator/builder/ast-builder.d.ts.map +1 -0
  104. package/dist/schema-generator/builder/ast-builder.js +417 -0
  105. package/dist/schema-generator/builder/ast-builder.js.map +1 -0
  106. package/dist/schema-generator/emitter/code-emitter.d.ts +15 -0
  107. package/dist/schema-generator/emitter/code-emitter.d.ts.map +1 -0
  108. package/dist/schema-generator/emitter/code-emitter.js +216 -0
  109. package/dist/schema-generator/emitter/code-emitter.js.map +1 -0
  110. package/dist/schema-generator/emitter/sdl-emitter.d.ts +7 -0
  111. package/dist/schema-generator/emitter/sdl-emitter.d.ts.map +1 -0
  112. package/dist/schema-generator/emitter/sdl-emitter.js +11 -0
  113. package/dist/schema-generator/emitter/sdl-emitter.js.map +1 -0
  114. package/dist/schema-generator/generate-schema.d.ts +26 -0
  115. package/dist/schema-generator/generate-schema.d.ts.map +1 -0
  116. package/dist/schema-generator/generate-schema.js +93 -0
  117. package/dist/schema-generator/generate-schema.js.map +1 -0
  118. package/dist/schema-generator/index.d.ts +4 -0
  119. package/dist/schema-generator/index.d.ts.map +1 -0
  120. package/dist/schema-generator/index.js +2 -0
  121. package/dist/schema-generator/index.js.map +1 -0
  122. package/dist/schema-generator/integrator/result-integrator.d.ts +113 -0
  123. package/dist/schema-generator/integrator/result-integrator.d.ts.map +1 -0
  124. package/dist/schema-generator/integrator/result-integrator.js +438 -0
  125. package/dist/schema-generator/integrator/result-integrator.js.map +1 -0
  126. package/dist/schema-generator/pruner/schema-pruner.d.ts +16 -0
  127. package/dist/schema-generator/pruner/schema-pruner.d.ts.map +1 -0
  128. package/dist/schema-generator/pruner/schema-pruner.js +66 -0
  129. package/dist/schema-generator/pruner/schema-pruner.js.map +1 -0
  130. package/dist/schema-generator/resolver-collector/resolver-collector.d.ts +24 -0
  131. package/dist/schema-generator/resolver-collector/resolver-collector.d.ts.map +1 -0
  132. package/dist/schema-generator/resolver-collector/resolver-collector.js +61 -0
  133. package/dist/schema-generator/resolver-collector/resolver-collector.js.map +1 -0
  134. package/dist/shared/constants.d.ts +54 -0
  135. package/dist/shared/constants.d.ts.map +1 -0
  136. package/dist/shared/constants.js +109 -0
  137. package/dist/shared/constants.js.map +1 -0
  138. package/dist/shared/default-value-detector.d.ts +40 -0
  139. package/dist/shared/default-value-detector.d.ts.map +1 -0
  140. package/dist/shared/default-value-detector.js +124 -0
  141. package/dist/shared/default-value-detector.js.map +1 -0
  142. package/dist/shared/diagnostics.d.ts +4 -0
  143. package/dist/shared/diagnostics.d.ts.map +1 -0
  144. package/dist/shared/diagnostics.js +25 -0
  145. package/dist/shared/diagnostics.js.map +1 -0
  146. package/dist/shared/directive-definition-extractor.d.ts +64 -0
  147. package/dist/shared/directive-definition-extractor.d.ts.map +1 -0
  148. package/dist/shared/directive-definition-extractor.js +399 -0
  149. package/dist/shared/directive-definition-extractor.js.map +1 -0
  150. package/dist/shared/directive-detector.d.ts +102 -0
  151. package/dist/shared/directive-detector.d.ts.map +1 -0
  152. package/dist/shared/directive-detector.js +415 -0
  153. package/dist/shared/directive-detector.js.map +1 -0
  154. package/dist/shared/file-scanner.d.ts +25 -0
  155. package/dist/shared/file-scanner.d.ts.map +1 -0
  156. package/dist/shared/file-scanner.js +101 -0
  157. package/dist/shared/file-scanner.js.map +1 -0
  158. package/dist/shared/index.d.ts +10 -0
  159. package/dist/shared/index.d.ts.map +1 -0
  160. package/dist/shared/index.js +6 -0
  161. package/dist/shared/index.js.map +1 -0
  162. package/dist/shared/inline-object-extractor.d.ts +13 -0
  163. package/dist/shared/inline-object-extractor.d.ts.map +1 -0
  164. package/dist/shared/inline-object-extractor.js +65 -0
  165. package/dist/shared/inline-object-extractor.js.map +1 -0
  166. package/dist/shared/inline-object-utils.d.ts +7 -0
  167. package/dist/shared/inline-object-utils.d.ts.map +1 -0
  168. package/dist/shared/inline-object-utils.js +23 -0
  169. package/dist/shared/inline-object-utils.js.map +1 -0
  170. package/dist/shared/interface-detector.d.ts +23 -0
  171. package/dist/shared/interface-detector.d.ts.map +1 -0
  172. package/dist/shared/interface-detector.js +133 -0
  173. package/dist/shared/interface-detector.js.map +1 -0
  174. package/dist/shared/interface-validator.d.ts +9 -0
  175. package/dist/shared/interface-validator.d.ts.map +1 -0
  176. package/dist/shared/interface-validator.js +152 -0
  177. package/dist/shared/interface-validator.js.map +1 -0
  178. package/dist/shared/metadata-detector.d.ts +65 -0
  179. package/dist/shared/metadata-detector.d.ts.map +1 -0
  180. package/dist/shared/metadata-detector.js +333 -0
  181. package/dist/shared/metadata-detector.js.map +1 -0
  182. package/dist/shared/path-utils.d.ts +2 -0
  183. package/dist/shared/path-utils.d.ts.map +1 -0
  184. package/dist/shared/path-utils.js +4 -0
  185. package/dist/shared/path-utils.js.map +1 -0
  186. package/dist/shared/program-factory.d.ts +14 -0
  187. package/dist/shared/program-factory.d.ts.map +1 -0
  188. package/dist/shared/program-factory.js +29 -0
  189. package/dist/shared/program-factory.js.map +1 -0
  190. package/dist/shared/source-location.d.ts +11 -0
  191. package/dist/shared/source-location.d.ts.map +1 -0
  192. package/dist/shared/source-location.js +15 -0
  193. package/dist/shared/source-location.js.map +1 -0
  194. package/dist/shared/tsconfig-loader.d.ts +13 -0
  195. package/dist/shared/tsconfig-loader.d.ts.map +1 -0
  196. package/dist/shared/tsconfig-loader.js +90 -0
  197. package/dist/shared/tsconfig-loader.js.map +1 -0
  198. package/dist/shared/tsdoc-parser.d.ts +12 -0
  199. package/dist/shared/tsdoc-parser.d.ts.map +1 -0
  200. package/dist/shared/tsdoc-parser.js +101 -0
  201. package/dist/shared/tsdoc-parser.js.map +1 -0
  202. package/dist/shared/type-converter.d.ts +3 -0
  203. package/dist/shared/type-converter.d.ts.map +1 -0
  204. package/dist/shared/type-converter.js +83 -0
  205. package/dist/shared/type-converter.js.map +1 -0
  206. package/dist/shared/typescript-utils.d.ts +82 -0
  207. package/dist/shared/typescript-utils.d.ts.map +1 -0
  208. package/dist/shared/typescript-utils.js +197 -0
  209. package/dist/shared/typescript-utils.js.map +1 -0
  210. package/dist/type-extractor/collector/result-collector.d.ts +7 -0
  211. package/dist/type-extractor/collector/result-collector.d.ts.map +1 -0
  212. package/dist/type-extractor/collector/result-collector.js +35 -0
  213. package/dist/type-extractor/collector/result-collector.js.map +1 -0
  214. package/dist/type-extractor/collector/scalar-collector.d.ts +108 -0
  215. package/dist/type-extractor/collector/scalar-collector.d.ts.map +1 -0
  216. package/dist/type-extractor/collector/scalar-collector.js +123 -0
  217. package/dist/type-extractor/collector/scalar-collector.js.map +1 -0
  218. package/dist/type-extractor/converter/field-eligibility.d.ts +34 -0
  219. package/dist/type-extractor/converter/field-eligibility.d.ts.map +1 -0
  220. package/dist/type-extractor/converter/field-eligibility.js +89 -0
  221. package/dist/type-extractor/converter/field-eligibility.js.map +1 -0
  222. package/dist/type-extractor/converter/graphql-converter.d.ts +7 -0
  223. package/dist/type-extractor/converter/graphql-converter.d.ts.map +1 -0
  224. package/dist/type-extractor/converter/graphql-converter.js +338 -0
  225. package/dist/type-extractor/converter/graphql-converter.js.map +1 -0
  226. package/dist/type-extractor/extract-types.d.ts +2 -0
  227. package/dist/type-extractor/extract-types.d.ts.map +1 -0
  228. package/dist/type-extractor/extract-types.js +2 -0
  229. package/dist/type-extractor/extract-types.js.map +1 -0
  230. package/dist/type-extractor/extractor/field-type-resolver.d.ts +28 -0
  231. package/dist/type-extractor/extractor/field-type-resolver.d.ts.map +1 -0
  232. package/dist/type-extractor/extractor/field-type-resolver.js +394 -0
  233. package/dist/type-extractor/extractor/field-type-resolver.js.map +1 -0
  234. package/dist/type-extractor/extractor/type-extractor.d.ts +36 -0
  235. package/dist/type-extractor/extractor/type-extractor.d.ts.map +1 -0
  236. package/dist/type-extractor/extractor/type-extractor.js +1082 -0
  237. package/dist/type-extractor/extractor/type-extractor.js.map +1 -0
  238. package/dist/type-extractor/extractor/type-name-collector.d.ts +24 -0
  239. package/dist/type-extractor/extractor/type-name-collector.d.ts.map +1 -0
  240. package/dist/type-extractor/extractor/type-name-collector.js +102 -0
  241. package/dist/type-extractor/extractor/type-name-collector.js.map +1 -0
  242. package/dist/type-extractor/index.d.ts +4 -0
  243. package/dist/type-extractor/index.d.ts.map +1 -0
  244. package/dist/type-extractor/index.js +2 -0
  245. package/dist/type-extractor/index.js.map +1 -0
  246. package/dist/type-extractor/mapper/scalar-base-type-mapper.d.ts +89 -0
  247. package/dist/type-extractor/mapper/scalar-base-type-mapper.d.ts.map +1 -0
  248. package/dist/type-extractor/mapper/scalar-base-type-mapper.js +158 -0
  249. package/dist/type-extractor/mapper/scalar-base-type-mapper.js.map +1 -0
  250. package/dist/type-extractor/types/diagnostics.d.ts +17 -0
  251. package/dist/type-extractor/types/diagnostics.d.ts.map +1 -0
  252. package/dist/type-extractor/types/diagnostics.js +2 -0
  253. package/dist/type-extractor/types/diagnostics.js.map +1 -0
  254. package/dist/type-extractor/types/graphql.d.ts +42 -0
  255. package/dist/type-extractor/types/graphql.d.ts.map +1 -0
  256. package/dist/type-extractor/types/graphql.js +2 -0
  257. package/dist/type-extractor/types/graphql.js.map +1 -0
  258. package/dist/type-extractor/types/index.d.ts +6 -0
  259. package/dist/type-extractor/types/index.d.ts.map +1 -0
  260. package/dist/type-extractor/types/index.js +2 -0
  261. package/dist/type-extractor/types/index.js.map +1 -0
  262. package/dist/type-extractor/types/ts-type-reference-factory.d.ts +39 -0
  263. package/dist/type-extractor/types/ts-type-reference-factory.d.ts.map +1 -0
  264. package/dist/type-extractor/types/ts-type-reference-factory.js +69 -0
  265. package/dist/type-extractor/types/ts-type-reference-factory.js.map +1 -0
  266. package/dist/type-extractor/types/typescript.d.ts +106 -0
  267. package/dist/type-extractor/types/typescript.d.ts.map +1 -0
  268. package/dist/type-extractor/types/typescript.js +2 -0
  269. package/dist/type-extractor/types/typescript.js.map +1 -0
  270. package/dist/type-extractor/validator/type-validator.d.ts +11 -0
  271. package/dist/type-extractor/validator/type-validator.d.ts.map +1 -0
  272. package/dist/type-extractor/validator/type-validator.js +53 -0
  273. package/dist/type-extractor/validator/type-validator.js.map +1 -0
  274. package/docs/configuration.md +163 -0
  275. package/docs/getting-started.md +117 -0
  276. package/docs/index.md +33 -0
  277. package/docs/integration/apollo.md +109 -0
  278. package/docs/integration/drizzle.md +191 -0
  279. package/docs/integration/yoga.md +108 -0
  280. package/docs/schema/abstract-resolvers.md +146 -0
  281. package/docs/schema/directives.md +196 -0
  282. package/docs/schema/documentation.md +176 -0
  283. package/docs/schema/enums.md +370 -0
  284. package/docs/schema/fields.md +186 -0
  285. package/docs/schema/index.md +38 -0
  286. package/docs/schema/inputs.md +279 -0
  287. package/docs/schema/interfaces.md +178 -0
  288. package/docs/schema/objects.md +188 -0
  289. package/docs/schema/queries-mutations.md +207 -0
  290. package/docs/schema/scalars.md +194 -0
  291. package/docs/schema/unions.md +90 -0
  292. package/docs/what-is-gqlkit.md +22 -0
  293. package/package.json +66 -7
  294. package/src/auto-type-generator/auto-type-generator.ts +925 -0
  295. package/src/auto-type-generator/index.ts +21 -0
  296. package/src/auto-type-generator/inline-enum-collector.ts +290 -0
  297. package/src/auto-type-generator/name-collision-validator.ts +119 -0
  298. package/src/auto-type-generator/naming-convention.ts +126 -0
  299. package/src/cli.ts +11 -0
  300. package/src/commands/gen.ts +141 -0
  301. package/src/commands/main.ts +5 -0
  302. package/src/config/define-config.ts +28 -0
  303. package/src/config/index.ts +7 -0
  304. package/src/config/types.ts +144 -0
  305. package/src/config-loader/index.ts +14 -0
  306. package/src/config-loader/loader.ts +143 -0
  307. package/src/config-loader/validator.ts +672 -0
  308. package/src/gen-orchestrator/hook-executor/hook-executor.ts +117 -0
  309. package/src/gen-orchestrator/orchestrator.ts +784 -0
  310. package/src/gen-orchestrator/reporter/diagnostic-reporter.ts +44 -0
  311. package/src/gen-orchestrator/reporter/progress-reporter.ts +61 -0
  312. package/src/gen-orchestrator/writer/file-writer.ts +38 -0
  313. package/src/index.ts +2 -0
  314. package/src/resolver-extractor/extract-resolvers.ts +63 -0
  315. package/src/resolver-extractor/extractor/define-api-extractor.ts +806 -0
  316. package/src/resolver-extractor/index.ts +19 -0
  317. package/src/resolver-extractor/validator/abstract-resolver-validator.ts +251 -0
  318. package/src/resolver-extractor/validator/only-validator.ts +158 -0
  319. package/src/schema-generator/builder/ast-builder.ts +706 -0
  320. package/src/schema-generator/emitter/code-emitter.ts +351 -0
  321. package/src/schema-generator/emitter/sdl-emitter.ts +13 -0
  322. package/src/schema-generator/generate-schema.ts +170 -0
  323. package/src/schema-generator/index.ts +19 -0
  324. package/src/schema-generator/integrator/result-integrator.ts +690 -0
  325. package/src/schema-generator/pruner/schema-pruner.ts +112 -0
  326. package/src/schema-generator/resolver-collector/resolver-collector.ts +123 -0
  327. package/src/shared/constants.ts +122 -0
  328. package/src/shared/default-value-detector.ts +172 -0
  329. package/src/shared/diagnostics.ts +35 -0
  330. package/src/shared/directive-definition-extractor.ts +564 -0
  331. package/src/shared/directive-detector.ts +556 -0
  332. package/src/shared/file-scanner.ts +170 -0
  333. package/src/shared/index.ts +32 -0
  334. package/src/shared/inline-object-extractor.ts +102 -0
  335. package/src/shared/inline-object-utils.ts +23 -0
  336. package/src/shared/interface-detector.ts +176 -0
  337. package/src/shared/interface-validator.ts +211 -0
  338. package/src/shared/metadata-detector.ts +443 -0
  339. package/src/shared/path-utils.ts +3 -0
  340. package/src/shared/program-factory.ts +51 -0
  341. package/src/shared/source-location.ts +27 -0
  342. package/src/shared/tsconfig-loader.ts +126 -0
  343. package/src/shared/tsdoc-parser.ts +155 -0
  344. package/src/shared/type-converter.ts +99 -0
  345. package/src/shared/typescript-utils.ts +246 -0
  346. package/src/type-extractor/collector/result-collector.ts +57 -0
  347. package/src/type-extractor/collector/scalar-collector.ts +254 -0
  348. package/src/type-extractor/converter/field-eligibility.ts +112 -0
  349. package/src/type-extractor/converter/graphql-converter.ts +459 -0
  350. package/src/type-extractor/extract-types.ts +1 -0
  351. package/src/type-extractor/extractor/field-type-resolver.ts +569 -0
  352. package/src/type-extractor/extractor/type-extractor.ts +1567 -0
  353. package/src/type-extractor/extractor/type-name-collector.ts +130 -0
  354. package/src/type-extractor/index.ts +20 -0
  355. package/src/type-extractor/mapper/scalar-base-type-mapper.ts +265 -0
  356. package/src/type-extractor/types/diagnostics.ts +99 -0
  357. package/src/type-extractor/types/graphql.ts +55 -0
  358. package/src/type-extractor/types/index.ts +37 -0
  359. package/src/type-extractor/types/ts-type-reference-factory.ts +137 -0
  360. package/src/type-extractor/types/typescript.ts +133 -0
  361. package/src/type-extractor/validator/type-validator.ts +77 -0
  362. package/README.md +0 -45
@@ -0,0 +1,28 @@
1
+ import ts from "typescript";
2
+ import type { ScalarBaseTypeMappingTable, ScalarMappingContext } from "../mapper/scalar-base-type-mapper.js";
3
+ import type { TSTypeReference } from "../types/typescript.js";
4
+ import type { GlobalTypeMapping } from "./type-extractor.js";
5
+ export interface FieldTypeResolverContext {
6
+ readonly checker: ts.TypeChecker;
7
+ readonly knownTypeNames: ReadonlySet<string>;
8
+ readonly knownTypeSymbols: ReadonlyMap<string, ts.Symbol>;
9
+ readonly underlyingSymbolToTypeName: ReadonlyMap<ts.Symbol, string>;
10
+ readonly globalTypeMappings: ReadonlyArray<GlobalTypeMapping>;
11
+ readonly sourceFiles: ReadonlySet<string>;
12
+ /** Scalar base type mapping table for automatic base type -> scalar mapping */
13
+ readonly scalarMappingTable: ScalarBaseTypeMappingTable | null;
14
+ /** Current resolution context for scalar mapping (input or output) */
15
+ readonly scalarMappingContext: ScalarMappingContext;
16
+ }
17
+ /**
18
+ * Resolves a TypeScript type to a TSTypeReference for use in field context.
19
+ *
20
+ * This function is specifically for field type resolution (not type declarations).
21
+ * Key differences from type declaration context:
22
+ * - Uses knownTypeNames to determine if a type exists in the schema
23
+ * - Intersection types are always treated as inline objects
24
+ * - Utility types (both builtin and user-defined) are treated as inline objects
25
+ * unless they are explicitly declared in the schema
26
+ */
27
+ export declare function resolveFieldType(type: ts.Type, typeNode: ts.TypeNode | undefined, ctx: FieldTypeResolverContext): TSTypeReference;
28
+ //# sourceMappingURL=field-type-resolver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"field-type-resolver.d.ts","sourceRoot":"","sources":["../../../src/type-extractor/extractor/field-type-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAkB5B,OAAO,KAAK,EACV,0BAA0B,EAC1B,oBAAoB,EACrB,MAAM,sCAAsC,CAAC;AAY9C,OAAO,KAAK,EAEV,eAAe,EAChB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC,WAAW,CAAC;IACjC,QAAQ,CAAC,cAAc,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC7C,QAAQ,CAAC,gBAAgB,EAAE,WAAW,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC;IAC1D,QAAQ,CAAC,0BAA0B,EAAE,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpE,QAAQ,CAAC,kBAAkB,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC;IAC9D,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC1C,+EAA+E;IAC/E,QAAQ,CAAC,kBAAkB,EAAE,0BAA0B,GAAG,IAAI,CAAC;IAC/D,sEAAsE;IACtE,QAAQ,CAAC,oBAAoB,EAAE,oBAAoB,CAAC;CACrD;AASD;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,EAAE,CAAC,IAAI,EACb,QAAQ,EAAE,EAAE,CAAC,QAAQ,GAAG,SAAS,EACjC,GAAG,EAAE,wBAAwB,GAC5B,eAAe,CAMjB"}
@@ -0,0 +1,394 @@
1
+ import ts from "typescript";
2
+ import { isInternalTypeSymbol } from "../../shared/constants.js";
3
+ import { extractInlineObjectProperties as extractInlineObjectPropertiesShared } from "../../shared/inline-object-extractor.js";
4
+ import { isInlineObjectType } from "../../shared/inline-object-utils.js";
5
+ import { detectScalarMetadata } from "../../shared/metadata-detector.js";
6
+ import { extractTsDocFromSymbol, } from "../../shared/tsdoc-parser.js";
7
+ import { findEnumParentSymbol, findNonNullTypeNode, getNonNullableTypes, getTypeNameFromNode, isBooleanUnion, isNullableUnion, resolveOriginalSymbol, } from "../../shared/typescript-utils.js";
8
+ import { lookupScalarMapping } from "../mapper/scalar-base-type-mapper.js";
9
+ import { createArrayType, createInlineEnumType, createInlineObjectType, createLiteralType, createPrimitiveType, createReferenceType, createScalarType, createUnionType, } from "../types/ts-type-reference-factory.js";
10
+ /**
11
+ * Resolves a TypeScript type to a TSTypeReference for use in field context.
12
+ *
13
+ * This function is specifically for field type resolution (not type declarations).
14
+ * Key differences from type declaration context:
15
+ * - Uses knownTypeNames to determine if a type exists in the schema
16
+ * - Intersection types are always treated as inline objects
17
+ * - Utility types (both builtin and user-defined) are treated as inline objects
18
+ * unless they are explicitly declared in the schema
19
+ */
20
+ export function resolveFieldType(type, typeNode, ctx) {
21
+ const internalCtx = {
22
+ ...ctx,
23
+ visitedTypes: new WeakSet(),
24
+ };
25
+ return resolveFieldTypeInternal(type, typeNode, internalCtx);
26
+ }
27
+ function resolveFieldTypeInternal(type, typeNode, ctx) {
28
+ const { checker, knownTypeNames, globalTypeMappings } = ctx;
29
+ // Scalar detection
30
+ const metadataResult = detectScalarMetadata(type, checker);
31
+ if (metadataResult.scalarName &&
32
+ !metadataResult.isPrimitive &&
33
+ !metadataResult.isList) {
34
+ return createScalarType({
35
+ name: metadataResult.scalarName,
36
+ scalarInfo: {
37
+ scalarName: metadataResult.scalarName,
38
+ typeName: metadataResult.scalarName,
39
+ baseType: undefined,
40
+ isCustom: true,
41
+ only: metadataResult.only,
42
+ },
43
+ nullable: metadataResult.nullable,
44
+ });
45
+ }
46
+ // Boolean union handling
47
+ if (isBooleanUnion(type)) {
48
+ const nullable = isNullableUnion(type);
49
+ return createPrimitiveType({ name: "boolean", nullable });
50
+ }
51
+ // Union type handling
52
+ if (type.isUnion()) {
53
+ const nullable = isNullableUnion(type);
54
+ // Preserve type alias name for enum types (string literal unions)
55
+ const aliasSymbol = type.aliasSymbol;
56
+ if (aliasSymbol) {
57
+ const name = aliasSymbol.getName();
58
+ if (isKnownSchemaType(name, aliasSymbol, ctx)) {
59
+ return createReferenceType({ name, nullable });
60
+ }
61
+ }
62
+ // Fallback: Extract name from typeNode when aliasSymbol is not available (e.g., re-exported types)
63
+ if (typeNode && ts.isTypeReferenceNode(typeNode)) {
64
+ const typeName = getTypeNameFromNode(typeNode);
65
+ const nodeSymbol = checker.getSymbolAtLocation(typeNode.typeName);
66
+ if (typeName &&
67
+ isKnownSchemaType(typeName, nodeSymbol ?? undefined, ctx)) {
68
+ return createReferenceType({ name: typeName, nullable });
69
+ }
70
+ }
71
+ const nonNullTypes = getNonNullableTypes(type);
72
+ // Check if all non-null types belong to the same enum
73
+ const enumParentSymbol = findEnumParentSymbol(nonNullTypes);
74
+ if (enumParentSymbol) {
75
+ const enumName = enumParentSymbol.getName();
76
+ // If enum is in knownTypeNames, treat as reference type
77
+ if (isKnownSchemaType(enumName, enumParentSymbol, ctx)) {
78
+ return createReferenceType({ name: enumName, nullable });
79
+ }
80
+ // External enum: extract members and treat as inline enum
81
+ const externalEnumResult = tryExtractExternalEnumAsInlineEnum(enumParentSymbol, checker);
82
+ if (externalEnumResult) {
83
+ return createInlineEnumType({
84
+ members: externalEnumResult.members,
85
+ nullable,
86
+ externalEnumSymbol: enumParentSymbol,
87
+ externalEnumDescription: externalEnumResult.description,
88
+ externalEnumDeprecated: externalEnumResult.deprecated,
89
+ });
90
+ }
91
+ }
92
+ // Check if all non-null types are string literals (inline enum)
93
+ const inlineEnumResult = tryExtractAsInlineEnum(nonNullTypes);
94
+ if (inlineEnumResult) {
95
+ return createInlineEnumType({
96
+ members: inlineEnumResult,
97
+ nullable,
98
+ externalEnumSymbol: null,
99
+ externalEnumDescription: null,
100
+ externalEnumDeprecated: null,
101
+ });
102
+ }
103
+ if (nonNullTypes.length === 1) {
104
+ const nonNullTypeNode = typeNode && ts.isUnionTypeNode(typeNode)
105
+ ? findNonNullTypeNode(typeNode)
106
+ : undefined;
107
+ const innerResult = resolveFieldTypeInternal(nonNullTypes[0], nonNullTypeNode, ctx);
108
+ return { ...innerResult, nullable };
109
+ }
110
+ const memberResults = nonNullTypes.map((t) => resolveFieldTypeInternal(t, undefined, ctx));
111
+ return createUnionType({ members: memberResults, nullable });
112
+ }
113
+ // Array type handling
114
+ if (checker.isArrayType(type)) {
115
+ const typeArgs = type.typeArguments;
116
+ const elementType = typeArgs?.[0];
117
+ let elementTypeNode;
118
+ if (typeNode && ts.isArrayTypeNode(typeNode)) {
119
+ elementTypeNode = typeNode.elementType;
120
+ }
121
+ const elementResult = elementType
122
+ ? resolveFieldTypeInternal(elementType, elementTypeNode, ctx)
123
+ : createPrimitiveType({ name: "unknown", nullable: false });
124
+ return createArrayType(elementResult);
125
+ }
126
+ // Primitive types
127
+ const typeString = checker.typeToString(type);
128
+ if (type.flags & ts.TypeFlags.String) {
129
+ return createPrimitiveType({ name: "string", nullable: false });
130
+ }
131
+ if (type.flags & ts.TypeFlags.Number) {
132
+ return createPrimitiveType({ name: "number", nullable: false });
133
+ }
134
+ if (type.flags & ts.TypeFlags.Boolean ||
135
+ type.flags & ts.TypeFlags.BooleanLiteral) {
136
+ return createPrimitiveType({ name: "boolean", nullable: false });
137
+ }
138
+ if (type.flags & ts.TypeFlags.StringLiteral) {
139
+ return createLiteralType(typeString.replace(/"/g, ""));
140
+ }
141
+ if (type.flags & ts.TypeFlags.NumberLiteral) {
142
+ return createLiteralType(typeString);
143
+ }
144
+ // Intersection types in field context are ALWAYS treated as inline objects
145
+ // GraphQL doesn't have intersection types, so we must expand them
146
+ if (type.isIntersection()) {
147
+ // If the intersection has an alias that's in knownTypeNames, use it
148
+ if (type.aliasSymbol) {
149
+ const aliasName = type.aliasSymbol.getName();
150
+ if (isKnownSchemaType(aliasName, type.aliasSymbol, ctx)) {
151
+ return createReferenceType({ name: aliasName, nullable: false });
152
+ }
153
+ }
154
+ // Otherwise, treat as inline object
155
+ return tryExtractAsInlineObject(type, ctx);
156
+ }
157
+ // Inline object type handling
158
+ if (isInlineObjectType(type)) {
159
+ // Check if typeNode references a known type
160
+ if (typeNode && ts.isTypeReferenceNode(typeNode)) {
161
+ const typeName = getTypeNameFromNode(typeNode);
162
+ const nodeSymbol = checker.getSymbolAtLocation(typeNode.typeName);
163
+ if (typeName &&
164
+ isKnownSchemaType(typeName, nodeSymbol ?? undefined, ctx)) {
165
+ return createReferenceType({ name: typeName, nullable: false });
166
+ }
167
+ }
168
+ return tryExtractAsInlineObject(type, ctx);
169
+ }
170
+ // Mapped types (utility types like Omit, Pick, user-defined utilities)
171
+ if (type.flags & ts.TypeFlags.Object) {
172
+ const objectType = type;
173
+ if (objectType.objectFlags & ts.ObjectFlags.Mapped) {
174
+ // Check if typeNode references a known type (schema-defined type)
175
+ if (typeNode && ts.isTypeReferenceNode(typeNode)) {
176
+ const typeName = getTypeNameFromNode(typeNode);
177
+ const nodeSymbol = checker.getSymbolAtLocation(typeNode.typeName);
178
+ if (typeName &&
179
+ isKnownSchemaType(typeName, nodeSymbol ?? undefined, ctx)) {
180
+ return createReferenceType({ name: typeName, nullable: false });
181
+ }
182
+ }
183
+ // Not a known type - treat as inline object
184
+ return tryExtractAsInlineObject(type, ctx);
185
+ }
186
+ }
187
+ // Extract type name from typeNode first (takes precedence over type.symbol).
188
+ // This handles cases like:
189
+ // - `typeof def` where the type's symbol is internal (__type, __object)
190
+ // - `Simplify<T>` where the typeNode is the declared alias name but type.symbol is the expanded type
191
+ if (typeNode && ts.isTypeReferenceNode(typeNode)) {
192
+ const typeName = getTypeNameFromNode(typeNode);
193
+ const nodeSymbol = checker.getSymbolAtLocation(typeNode.typeName);
194
+ if (typeName && isKnownSchemaType(typeName, nodeSymbol ?? undefined, ctx)) {
195
+ return createReferenceType({ name: typeName, nullable: false });
196
+ }
197
+ }
198
+ // Named type reference (symbol-based lookup)
199
+ if (type.symbol) {
200
+ const symbolName = type.symbol.getName();
201
+ if (!isInternalTypeSymbol(symbolName)) {
202
+ // Check for global type mappings (custom scalars)
203
+ const globalMapping = globalTypeMappings.find((m) => m.typeName === symbolName);
204
+ if (globalMapping) {
205
+ return createScalarType({
206
+ name: globalMapping.scalarName,
207
+ scalarInfo: {
208
+ scalarName: globalMapping.scalarName,
209
+ typeName: globalMapping.typeName,
210
+ baseType: undefined,
211
+ isCustom: true,
212
+ only: globalMapping.only,
213
+ },
214
+ nullable: false,
215
+ });
216
+ }
217
+ // Check if it's a known type by symbol comparison
218
+ if (isKnownSchemaType(symbolName, type.symbol, ctx)) {
219
+ return createReferenceType({ name: symbolName, nullable: false });
220
+ }
221
+ // Check if the symbol is the underlying type of a schema type alias
222
+ // For `type User = ExternalUser;`, this allows `ExternalUser` to be recognized as `User`
223
+ const resolvedSymbol = resolveOriginalSymbol(type.symbol, checker);
224
+ const schemaTypeName = ctx.underlyingSymbolToTypeName.get(resolvedSymbol);
225
+ if (schemaTypeName) {
226
+ return createReferenceType({ name: schemaTypeName, nullable: false });
227
+ }
228
+ // If the name exists in schema but symbol doesn't match,
229
+ // it's a different type with the same name
230
+ if (knownTypeNames.has(symbolName)) {
231
+ // Check if the type is declared within schema files (local shadowing)
232
+ if (isTypeFromSchemaFiles(type.symbol, ctx.sourceFiles)) {
233
+ // Local shadowing - use name matching for backwards compatibility
234
+ return createReferenceType({ name: symbolName, nullable: false });
235
+ }
236
+ // Type from outside schema files - expand as inline object
237
+ return tryExtractAsInlineObject(type, ctx);
238
+ }
239
+ // Check for scalar base type mapping
240
+ // This allows automatic mapping of base types (e.g., Date) to scalar types (e.g., DateTime)
241
+ if (ctx.scalarMappingTable) {
242
+ const scalarMappingResult = lookupScalarMapping({
243
+ baseTypeSymbol: resolvedSymbol,
244
+ context: ctx.scalarMappingContext,
245
+ table: ctx.scalarMappingTable,
246
+ });
247
+ if (scalarMappingResult.mapping) {
248
+ return createScalarType({
249
+ name: scalarMappingResult.mapping.scalarName,
250
+ scalarInfo: {
251
+ scalarName: scalarMappingResult.mapping.scalarName,
252
+ typeName: scalarMappingResult.mapping.sourceTypeName,
253
+ baseType: undefined,
254
+ isCustom: true,
255
+ only: scalarMappingResult.mapping.only,
256
+ },
257
+ nullable: false,
258
+ });
259
+ }
260
+ // Note: Conflicts are handled at the pipeline level, not here
261
+ }
262
+ // Check for external TypeScript enum (not in knownTypeNames)
263
+ // When a field uses an enum type directly (not as a union), handle it here
264
+ // Check both symbol flags and declarations since the flags may vary
265
+ const isEnumSymbol = (resolvedSymbol.flags & ts.SymbolFlags.Enum) !== 0 ||
266
+ resolvedSymbol.getDeclarations()?.some(ts.isEnumDeclaration) === true;
267
+ if (isEnumSymbol) {
268
+ const externalEnumResult = tryExtractExternalEnumAsInlineEnum(resolvedSymbol, checker);
269
+ if (externalEnumResult) {
270
+ return createInlineEnumType({
271
+ members: externalEnumResult.members,
272
+ nullable: false,
273
+ externalEnumSymbol: resolvedSymbol,
274
+ externalEnumDescription: externalEnumResult.description,
275
+ externalEnumDeprecated: externalEnumResult.deprecated,
276
+ });
277
+ }
278
+ }
279
+ // Unknown type - still return reference but it will likely cause validation error later
280
+ return createReferenceType({ name: symbolName, nullable: false });
281
+ }
282
+ }
283
+ return createReferenceType({ name: typeString, nullable: false });
284
+ }
285
+ function tryExtractAsInlineObject(type, ctx) {
286
+ const { visitedTypes } = ctx;
287
+ if (visitedTypes.has(type)) {
288
+ // Cycle detected, return a placeholder reference
289
+ const typeName = type.symbol?.getName() ?? "Unknown";
290
+ return createReferenceType({ name: typeName, nullable: false });
291
+ }
292
+ visitedTypes.add(type);
293
+ const inlineProperties = extractInlineObjectPropertiesShared(type, ctx.checker, (propType) => resolveFieldTypeInternal(propType, undefined, ctx));
294
+ return createInlineObjectType(inlineProperties);
295
+ }
296
+ /**
297
+ * Checks if all types are string literals and extracts them as inline enum members.
298
+ * Returns null if any type is not a string literal.
299
+ */
300
+ function tryExtractAsInlineEnum(types) {
301
+ if (types.length === 0) {
302
+ return null;
303
+ }
304
+ const members = [];
305
+ for (const type of types) {
306
+ if (!(type.flags & ts.TypeFlags.StringLiteral)) {
307
+ return null;
308
+ }
309
+ const literalType = type;
310
+ const value = literalType.value;
311
+ members.push({
312
+ value,
313
+ description: null,
314
+ deprecated: null,
315
+ });
316
+ }
317
+ return members;
318
+ }
319
+ /**
320
+ * Extracts enum members from an external TypeScript enum symbol.
321
+ * Returns the member info including TSDoc description and deprecated status,
322
+ * as well as the enum type's own TSDoc information.
323
+ * Returns null if the enum declaration cannot be found or has no valid members.
324
+ */
325
+ function tryExtractExternalEnumAsInlineEnum(enumSymbol, checker) {
326
+ const declarations = enumSymbol.getDeclarations();
327
+ if (!declarations || declarations.length === 0) {
328
+ return null;
329
+ }
330
+ const enumDeclaration = declarations.find(ts.isEnumDeclaration);
331
+ if (!enumDeclaration) {
332
+ return null;
333
+ }
334
+ const members = [];
335
+ for (const member of enumDeclaration.members) {
336
+ const initializer = member.initializer;
337
+ if (!initializer || !ts.isStringLiteral(initializer)) {
338
+ continue;
339
+ }
340
+ const value = initializer.text;
341
+ const memberSymbol = checker.getSymbolAtLocation(member.name);
342
+ const tsdocInfo = memberSymbol
343
+ ? extractTsDocFromSymbol(memberSymbol, checker)
344
+ : { description: null, deprecated: null };
345
+ members.push({
346
+ value,
347
+ description: tsdocInfo.description,
348
+ deprecated: tsdocInfo.deprecated,
349
+ });
350
+ }
351
+ if (members.length === 0) {
352
+ return null;
353
+ }
354
+ // Extract TSDoc from the enum type itself
355
+ const enumTsDoc = extractTsDocFromSymbol(enumSymbol, checker);
356
+ return {
357
+ members,
358
+ description: enumTsDoc.description,
359
+ deprecated: enumTsDoc.deprecated,
360
+ };
361
+ }
362
+ /**
363
+ * Checks if a type's symbol matches the known schema type symbol.
364
+ * Returns true if both name matches AND symbol matches (or if symbol comparison is not possible).
365
+ */
366
+ function isKnownSchemaType(name, typeSymbol, ctx) {
367
+ const { knownTypeNames, knownTypeSymbols, checker } = ctx;
368
+ if (!knownTypeNames.has(name)) {
369
+ return false;
370
+ }
371
+ const schemaSymbol = knownTypeSymbols.get(name);
372
+ if (!schemaSymbol || !typeSymbol) {
373
+ return false;
374
+ }
375
+ const resolvedTypeSymbol = resolveOriginalSymbol(typeSymbol, checker);
376
+ return resolvedTypeSymbol === schemaSymbol;
377
+ }
378
+ /**
379
+ * Checks if a type's symbol is declared within the schema source files.
380
+ * Returns true if the type is a local definition (shadowing), false if from external files.
381
+ */
382
+ function isTypeFromSchemaFiles(symbol, sourceFiles) {
383
+ const declarations = symbol.getDeclarations();
384
+ if (!declarations || declarations.length === 0) {
385
+ return false;
386
+ }
387
+ const declaration = declarations[0];
388
+ if (!declaration) {
389
+ return false;
390
+ }
391
+ const sourceFile = declaration.getSourceFile();
392
+ return sourceFiles.has(sourceFile.fileName);
393
+ }
394
+ //# sourceMappingURL=field-type-resolver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"field-type-resolver.js","sourceRoot":"","sources":["../../../src/type-extractor/extractor/field-type-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,6BAA6B,IAAI,mCAAmC,EAAE,MAAM,yCAAyC,CAAC;AAC/H,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAEL,sBAAsB,GACvB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,qBAAqB,GACtB,MAAM,kCAAk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SAAS,iBAAiB,CACxB,IAAY,EACZ,UAAiC,EACjC,GAA6B;IAE7B,MAAM,EAAE,cAAc,EAAE,gBAAgB,EAAE,OAAO,EAAE,GAAG,GAAG,CAAC;IAE1D,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;QAC9B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,YAAY,GAAG,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAChD,IAAI,CAAC,YAAY,IAAI,CAAC,UAAU,EAAE,CAAC;QACjC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,kBAAkB,GAAG,qBAAqB,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IACtE,OAAO,kBAAkB,KAAK,YAAY,CAAC;AAC7C,CAAC;AAED;;;GAGG;AACH,SAAS,qBAAqB,CAC5B,MAAiB,EACjB,WAAgC;IAEhC,MAAM,YAAY,GAAG,MAAM,CAAC,eAAe,EAAE,CAAC;IAC9C,IAAI,CAAC,YAAY,IAAI,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC/C,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,WAAW,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;IACpC,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,UAAU,GAAG,WAAW,CAAC,aAAa,EAAE,CAAC;IAC/C,OAAO,WAAW,CAAC,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;AAC9C,CAAC"}
@@ -0,0 +1,36 @@
1
+ import ts from "typescript";
2
+ import type { ScalarMetadataInfo } from "../collector/scalar-collector.js";
3
+ import type { ScalarBaseTypeMappingTable } from "../mapper/scalar-base-type-mapper.js";
4
+ import { type Diagnostic, type ExtractedTypeInfo } from "../types/index.js";
5
+ /**
6
+ * Global type mapping configuration.
7
+ * Maps TypeScript type names to GraphQL scalar names when tsType.from is omitted.
8
+ */
9
+ export interface GlobalTypeMapping {
10
+ /** TypeScript type name (e.g., "Date", "URL") */
11
+ readonly typeName: string;
12
+ /** GraphQL scalar name (e.g., "DateTime", "URL") */
13
+ readonly scalarName: string;
14
+ /** Usage constraint */
15
+ readonly only: "input" | "output" | null;
16
+ }
17
+ export interface ExtractionOptions {
18
+ /** Global type mappings from config (scalars with tsType.from omitted) */
19
+ readonly globalTypeMappings: ReadonlyArray<GlobalTypeMapping>;
20
+ /** Set of type names declared in the schema (from Phase 1 collection) */
21
+ readonly knownTypeNames: ReadonlySet<string>;
22
+ /** Map of type names to their symbols (from Phase 1 collection) */
23
+ readonly knownTypeSymbols: ReadonlyMap<string, ts.Symbol>;
24
+ /** Map of underlying symbols to schema type names (for type alias resolution) */
25
+ readonly underlyingSymbolToTypeName: ReadonlyMap<ts.Symbol, string>;
26
+ /** Scalar base type mapping table for automatic base type -> scalar mapping */
27
+ readonly scalarMappingTable: ScalarBaseTypeMappingTable | null;
28
+ }
29
+ export interface ExtractionResult {
30
+ readonly types: ReadonlyArray<ExtractedTypeInfo>;
31
+ readonly diagnostics: ReadonlyArray<Diagnostic>;
32
+ readonly detectedScalarNames: ReadonlyArray<string>;
33
+ readonly detectedScalars: ReadonlyArray<ScalarMetadataInfo>;
34
+ }
35
+ export declare function extractTypesFromProgram(program: ts.Program, sourceFiles: ReadonlyArray<string>, options: ExtractionOptions): ExtractionResult;
36
+ //# sourceMappingURL=type-extractor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type-extractor.d.ts","sourceRoot":"","sources":["../../../src/type-extractor/extractor/type-extractor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,YAAY,CAAC;AAyC5B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,KAAK,EACV,0BAA0B,EAE3B,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAQL,KAAK,UAAU,EAEf,KAAK,iBAAi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