@haustle/notion-orm 0.0.44 → 0.0.45

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 (406) hide show
  1. package/README.md +449 -109
  2. package/build/src/agents-sdk-resolver.d.ts +8 -0
  3. package/build/src/agents-sdk-resolver.d.ts.map +1 -0
  4. package/build/src/agents-sdk-resolver.js +23 -0
  5. package/build/src/agents-sdk-resolver.js.map +1 -0
  6. package/build/src/ast/agents/agent-file-writer.d.ts +21 -0
  7. package/build/src/ast/agents/agent-file-writer.d.ts.map +1 -0
  8. package/build/src/ast/agents/agent-file-writer.js +99 -0
  9. package/build/src/ast/agents/agent-file-writer.js.map +1 -0
  10. package/build/src/ast/agents/generate-agents-cli.d.ts +24 -0
  11. package/build/src/ast/agents/generate-agents-cli.d.ts.map +1 -0
  12. package/build/src/ast/agents/generate-agents-cli.js +193 -0
  13. package/build/src/ast/agents/generate-agents-cli.js.map +1 -0
  14. package/build/src/ast/database/database-file-writer.d.ts +37 -0
  15. package/build/src/ast/database/database-file-writer.d.ts.map +1 -0
  16. package/build/src/ast/database/database-file-writer.js +240 -0
  17. package/build/src/ast/database/database-file-writer.js.map +1 -0
  18. package/build/src/ast/database/generate-databases-cli.d.ts +27 -0
  19. package/build/src/ast/database/generate-databases-cli.d.ts.map +1 -0
  20. package/build/src/ast/database/generate-databases-cli.js +141 -0
  21. package/build/src/ast/database/generate-databases-cli.js.map +1 -0
  22. package/build/src/ast/database/notion-column-generators.d.ts +180 -0
  23. package/build/src/ast/database/notion-column-generators.d.ts.map +1 -0
  24. package/build/src/ast/database/notion-column-generators.js +269 -0
  25. package/build/src/ast/database/notion-column-generators.js.map +1 -0
  26. package/build/src/ast/database/zod-schema.d.ts +17 -0
  27. package/build/src/ast/database/zod-schema.d.ts.map +1 -0
  28. package/build/src/ast/database/zod-schema.js +5 -0
  29. package/build/src/ast/database/zod-schema.js.map +1 -0
  30. package/build/src/ast/demo/datasource-fixture-builder.d.ts +38 -0
  31. package/build/src/ast/demo/datasource-fixture-builder.d.ts.map +1 -0
  32. package/build/src/ast/demo/datasource-fixture-builder.js +274 -0
  33. package/build/src/ast/demo/datasource-fixture-builder.js.map +1 -0
  34. package/build/src/ast/demo/demo-entry-builders.d.ts +28 -0
  35. package/build/src/ast/demo/demo-entry-builders.d.ts.map +1 -0
  36. package/build/src/ast/demo/demo-entry-builders.js +133 -0
  37. package/build/src/ast/demo/demo-entry-builders.js.map +1 -0
  38. package/build/src/ast/demo/demo-playground-spec.d.ts +51 -0
  39. package/build/src/ast/demo/demo-playground-spec.d.ts.map +1 -0
  40. package/build/src/ast/demo/demo-playground-spec.js +91 -0
  41. package/build/src/ast/demo/demo-playground-spec.js.map +1 -0
  42. package/build/src/ast/demo/demo-workspace-builder.d.ts +24 -0
  43. package/build/src/ast/demo/demo-workspace-builder.d.ts.map +1 -0
  44. package/build/src/ast/demo/demo-workspace-builder.js +90 -0
  45. package/build/src/ast/demo/demo-workspace-builder.js.map +1 -0
  46. package/build/src/ast/shared/ast-builders.d.ts +112 -0
  47. package/build/src/ast/shared/ast-builders.d.ts.map +1 -0
  48. package/build/src/ast/shared/ast-builders.js +181 -0
  49. package/build/src/ast/shared/ast-builders.js.map +1 -0
  50. package/build/src/ast/shared/cached-metadata.d.ts +26 -0
  51. package/build/src/ast/shared/cached-metadata.d.ts.map +1 -0
  52. package/build/src/ast/shared/cached-metadata.js +76 -0
  53. package/build/src/ast/shared/cached-metadata.js.map +1 -0
  54. package/build/src/ast/shared/codegen-diagnostics.d.ts +23 -0
  55. package/build/src/ast/shared/codegen-diagnostics.d.ts.map +1 -0
  56. package/build/src/ast/shared/codegen-diagnostics.js +13 -0
  57. package/build/src/ast/shared/codegen-diagnostics.js.map +1 -0
  58. package/build/src/ast/shared/codegen-environment.d.ts +37 -0
  59. package/build/src/ast/shared/codegen-environment.d.ts.map +1 -0
  60. package/build/src/ast/shared/codegen-environment.js +53 -0
  61. package/build/src/ast/shared/codegen-environment.js.map +1 -0
  62. package/build/src/ast/shared/constants.d.ts +98 -0
  63. package/build/src/ast/shared/constants.d.ts.map +1 -0
  64. package/build/src/ast/shared/constants.js +145 -0
  65. package/build/src/ast/shared/constants.js.map +1 -0
  66. package/build/src/ast/shared/emit/config-emitter.d.ts +56 -0
  67. package/build/src/ast/shared/emit/config-emitter.d.ts.map +1 -0
  68. package/build/src/ast/shared/emit/config-emitter.js +454 -0
  69. package/build/src/ast/shared/emit/config-emitter.js.map +1 -0
  70. package/build/src/ast/shared/emit/emit-value-as-expression.d.ts +10 -0
  71. package/build/src/ast/shared/emit/emit-value-as-expression.d.ts.map +1 -0
  72. package/build/src/ast/shared/emit/emit-value-as-expression.js +37 -0
  73. package/build/src/ast/shared/emit/emit-value-as-expression.js.map +1 -0
  74. package/build/src/ast/shared/emit/orm-index-emitter.d.ts +61 -0
  75. package/build/src/ast/shared/emit/orm-index-emitter.d.ts.map +1 -0
  76. package/build/src/ast/shared/emit/orm-index-emitter.js +376 -0
  77. package/build/src/ast/shared/emit/orm-index-emitter.js.map +1 -0
  78. package/build/src/ast/shared/emit/registry-emitter.d.ts +35 -0
  79. package/build/src/ast/shared/emit/registry-emitter.d.ts.map +1 -0
  80. package/build/src/ast/shared/emit/registry-emitter.js +39 -0
  81. package/build/src/ast/shared/emit/registry-emitter.js.map +1 -0
  82. package/build/src/ast/shared/emit/ts-emit-core.d.ts +79 -0
  83. package/build/src/ast/shared/emit/ts-emit-core.d.ts.map +1 -0
  84. package/build/src/ast/shared/emit/ts-emit-core.js +135 -0
  85. package/build/src/ast/shared/emit/ts-emit-core.js.map +1 -0
  86. package/build/src/ast/shared/emit/ts-emit-options.d.ts +29 -0
  87. package/build/src/ast/shared/emit/ts-emit-options.d.ts.map +1 -0
  88. package/build/src/ast/shared/emit/ts-emit-options.js +29 -0
  89. package/build/src/ast/shared/emit/ts-emit-options.js.map +1 -0
  90. package/build/src/base.d.ts +21 -0
  91. package/build/src/base.d.ts.map +1 -0
  92. package/build/src/base.js +19 -0
  93. package/build/src/base.js.map +1 -0
  94. package/build/src/cli/agents-sdk-setup.d.ts +2 -0
  95. package/build/src/cli/agents-sdk-setup.d.ts.map +1 -0
  96. package/build/src/cli/agents-sdk-setup.js +107 -0
  97. package/build/src/cli/agents-sdk-setup.js.map +1 -0
  98. package/build/src/cli/helpers.d.ts +14 -0
  99. package/build/src/cli/helpers.d.ts.map +1 -0
  100. package/build/src/cli/helpers.js +125 -0
  101. package/build/src/cli/helpers.js.map +1 -0
  102. package/build/src/cli/index.d.ts +3 -0
  103. package/build/src/cli/index.d.ts.map +1 -0
  104. package/build/src/cli/index.js +244 -0
  105. package/build/src/cli/index.js.map +1 -0
  106. package/build/src/cli/sync-progress-renderer.d.ts +20 -0
  107. package/build/src/cli/sync-progress-renderer.d.ts.map +1 -0
  108. package/build/src/cli/sync-progress-renderer.js +79 -0
  109. package/build/src/cli/sync-progress-renderer.js.map +1 -0
  110. package/build/src/cli/sync-progress.d.ts +55 -0
  111. package/build/src/cli/sync-progress.d.ts.map +1 -0
  112. package/build/src/cli/sync-progress.js +120 -0
  113. package/build/src/cli/sync-progress.js.map +1 -0
  114. package/build/src/cli/sync-report.d.ts +17 -0
  115. package/build/src/cli/sync-report.d.ts.map +1 -0
  116. package/build/src/cli/sync-report.js +86 -0
  117. package/build/src/cli/sync-report.js.map +1 -0
  118. package/build/src/client/agent/AgentClient.d.ts +84 -0
  119. package/build/src/client/agent/AgentClient.d.ts.map +1 -0
  120. package/build/src/client/agent/AgentClient.js +118 -0
  121. package/build/src/client/agent/AgentClient.js.map +1 -0
  122. package/build/src/client/database/DatabaseClient.d.ts +37 -0
  123. package/build/src/client/database/DatabaseClient.d.ts.map +1 -0
  124. package/build/src/client/database/DatabaseClient.js +328 -0
  125. package/build/src/client/database/DatabaseClient.js.map +1 -0
  126. package/build/src/client/database/create/build-create-page-parameters.d.ts +9 -0
  127. package/build/src/client/database/create/build-create-page-parameters.d.ts.map +1 -0
  128. package/build/src/client/database/create/build-create-page-parameters.js +13 -0
  129. package/build/src/client/database/create/build-create-page-parameters.js.map +1 -0
  130. package/build/src/client/database/create/index.d.ts +4 -0
  131. package/build/src/client/database/create/index.d.ts.map +1 -0
  132. package/build/src/client/database/create/index.js +4 -0
  133. package/build/src/client/database/create/index.js.map +1 -0
  134. package/build/src/client/database/create/map-to-notion-properties.d.ts +14 -0
  135. package/build/src/client/database/create/map-to-notion-properties.d.ts.map +1 -0
  136. package/build/src/client/database/create/map-to-notion-properties.js +31 -0
  137. package/build/src/client/database/create/map-to-notion-properties.js.map +1 -0
  138. package/build/src/client/database/create/property-value.d.ts +16 -0
  139. package/build/src/client/database/create/property-value.d.ts.map +1 -0
  140. package/build/src/client/database/create/property-value.js +213 -0
  141. package/build/src/client/database/create/property-value.js.map +1 -0
  142. package/build/src/client/database/query/build-query-params.d.ts +11 -0
  143. package/build/src/client/database/query/build-query-params.d.ts.map +1 -0
  144. package/build/src/client/database/query/build-query-params.js +24 -0
  145. package/build/src/client/database/query/build-query-params.js.map +1 -0
  146. package/build/src/client/database/query/build-query-response.d.ts +23 -0
  147. package/build/src/client/database/query/build-query-response.d.ts.map +1 -0
  148. package/build/src/client/database/query/build-query-response.js +41 -0
  149. package/build/src/client/database/query/build-query-response.js.map +1 -0
  150. package/build/src/client/database/query/filter/builders.d.ts +4 -0
  151. package/build/src/client/database/query/filter/builders.d.ts.map +1 -0
  152. package/build/src/client/database/query/filter/builders.js +141 -0
  153. package/build/src/client/database/query/filter/builders.js.map +1 -0
  154. package/build/src/client/database/query/filter/compound.d.ts +3 -0
  155. package/build/src/client/database/query/filter/compound.d.ts.map +1 -0
  156. package/build/src/client/database/query/filter/compound.js +13 -0
  157. package/build/src/client/database/query/filter/compound.js.map +1 -0
  158. package/build/src/client/database/query/filter/index.d.ts +3 -0
  159. package/build/src/client/database/query/filter/index.d.ts.map +1 -0
  160. package/build/src/client/database/query/filter/index.js +89 -0
  161. package/build/src/client/database/query/filter/index.js.map +1 -0
  162. package/build/src/client/database/query/http-guards.d.ts +2 -0
  163. package/build/src/client/database/query/http-guards.d.ts.map +1 -0
  164. package/build/src/client/database/query/http-guards.js +10 -0
  165. package/build/src/client/database/query/http-guards.js.map +1 -0
  166. package/build/src/client/database/query/index.d.ts +5 -0
  167. package/build/src/client/database/query/index.d.ts.map +1 -0
  168. package/build/src/client/database/query/index.js +5 -0
  169. package/build/src/client/database/query/index.js.map +1 -0
  170. package/build/src/client/database/query/normalize-page-result.d.ts +15 -0
  171. package/build/src/client/database/query/normalize-page-result.d.ts.map +1 -0
  172. package/build/src/client/database/query/normalize-page-result.js +35 -0
  173. package/build/src/client/database/query/normalize-page-result.js.map +1 -0
  174. package/build/src/client/database/query/page-collection.d.ts +42 -0
  175. package/build/src/client/database/query/page-collection.d.ts.map +1 -0
  176. package/build/src/client/database/query/page-collection.js +71 -0
  177. package/build/src/client/database/query/page-collection.js.map +1 -0
  178. package/build/src/client/database/query/projection.d.ts +9 -0
  179. package/build/src/client/database/query/projection.d.ts.map +1 -0
  180. package/build/src/client/database/query/projection.js +43 -0
  181. package/build/src/client/database/query/projection.js.map +1 -0
  182. package/build/src/client/database/query/response/checkbox.d.ts +3 -0
  183. package/build/src/client/database/query/response/checkbox.d.ts.map +1 -0
  184. package/build/src/client/database/query/response/checkbox.js +7 -0
  185. package/build/src/client/database/query/response/checkbox.js.map +1 -0
  186. package/build/src/client/database/query/response/created_by.d.ts +3 -0
  187. package/build/src/client/database/query/response/created_by.d.ts.map +1 -0
  188. package/build/src/client/database/query/response/created_by.js +8 -0
  189. package/build/src/client/database/query/response/created_by.js.map +1 -0
  190. package/build/src/client/database/query/response/created_time.d.ts +3 -0
  191. package/build/src/client/database/query/response/created_time.d.ts.map +1 -0
  192. package/build/src/client/database/query/response/created_time.js +7 -0
  193. package/build/src/client/database/query/response/created_time.js.map +1 -0
  194. package/build/src/client/database/query/response/date.d.ts +6 -0
  195. package/build/src/client/database/query/response/date.d.ts.map +1 -0
  196. package/build/src/client/database/query/response/date.js +13 -0
  197. package/build/src/client/database/query/response/date.js.map +1 -0
  198. package/build/src/client/database/query/response/email.d.ts +3 -0
  199. package/build/src/client/database/query/response/email.d.ts.map +1 -0
  200. package/build/src/client/database/query/response/email.js +7 -0
  201. package/build/src/client/database/query/response/email.js.map +1 -0
  202. package/build/src/client/database/query/response/files.d.ts +6 -0
  203. package/build/src/client/database/query/response/files.d.ts.map +1 -0
  204. package/build/src/client/database/query/response/files.js +8 -0
  205. package/build/src/client/database/query/response/files.js.map +1 -0
  206. package/build/src/client/database/query/response/index.d.ts +53 -0
  207. package/build/src/client/database/query/response/index.d.ts.map +1 -0
  208. package/build/src/client/database/query/response/index.js +44 -0
  209. package/build/src/client/database/query/response/index.js.map +1 -0
  210. package/build/src/client/database/query/response/last_edited_by.d.ts +3 -0
  211. package/build/src/client/database/query/response/last_edited_by.d.ts.map +1 -0
  212. package/build/src/client/database/query/response/last_edited_by.js +8 -0
  213. package/build/src/client/database/query/response/last_edited_by.js.map +1 -0
  214. package/build/src/client/database/query/response/last_edited_time.d.ts +3 -0
  215. package/build/src/client/database/query/response/last_edited_time.d.ts.map +1 -0
  216. package/build/src/client/database/query/response/last_edited_time.js +7 -0
  217. package/build/src/client/database/query/response/last_edited_time.js.map +1 -0
  218. package/build/src/client/database/query/response/multi_select.d.ts +3 -0
  219. package/build/src/client/database/query/response/multi_select.d.ts.map +1 -0
  220. package/build/src/client/database/query/response/multi_select.js +10 -0
  221. package/build/src/client/database/query/response/multi_select.js.map +1 -0
  222. package/build/src/client/database/query/response/number.d.ts +3 -0
  223. package/build/src/client/database/query/response/number.d.ts.map +1 -0
  224. package/build/src/client/database/query/response/number.js +7 -0
  225. package/build/src/client/database/query/response/number.js.map +1 -0
  226. package/build/src/client/database/query/response/people.d.ts +3 -0
  227. package/build/src/client/database/query/response/people.d.ts.map +1 -0
  228. package/build/src/client/database/query/response/people.js +13 -0
  229. package/build/src/client/database/query/response/people.js.map +1 -0
  230. package/build/src/client/database/query/response/phone_number.d.ts +3 -0
  231. package/build/src/client/database/query/response/phone_number.d.ts.map +1 -0
  232. package/build/src/client/database/query/response/phone_number.js +7 -0
  233. package/build/src/client/database/query/response/phone_number.js.map +1 -0
  234. package/build/src/client/database/query/response/relation.d.ts +4 -0
  235. package/build/src/client/database/query/response/relation.d.ts.map +1 -0
  236. package/build/src/client/database/query/response/relation.js +14 -0
  237. package/build/src/client/database/query/response/relation.js.map +1 -0
  238. package/build/src/client/database/query/response/rich_text.d.ts +3 -0
  239. package/build/src/client/database/query/response/rich_text.d.ts.map +1 -0
  240. package/build/src/client/database/query/response/rich_text.js +12 -0
  241. package/build/src/client/database/query/response/rich_text.js.map +1 -0
  242. package/build/src/client/database/query/response/select.d.ts +3 -0
  243. package/build/src/client/database/query/response/select.d.ts.map +1 -0
  244. package/build/src/client/database/query/response/select.js +7 -0
  245. package/build/src/client/database/query/response/select.js.map +1 -0
  246. package/build/src/client/database/query/response/shared.d.ts +6 -0
  247. package/build/src/client/database/query/response/shared.d.ts.map +1 -0
  248. package/build/src/client/database/query/response/shared.js +41 -0
  249. package/build/src/client/database/query/response/shared.js.map +1 -0
  250. package/build/src/client/database/query/response/status.d.ts +3 -0
  251. package/build/src/client/database/query/response/status.d.ts.map +1 -0
  252. package/build/src/client/database/query/response/status.js +7 -0
  253. package/build/src/client/database/query/response/status.js.map +1 -0
  254. package/build/src/client/database/query/response/title.d.ts +3 -0
  255. package/build/src/client/database/query/response/title.d.ts.map +1 -0
  256. package/build/src/client/database/query/response/title.js +12 -0
  257. package/build/src/client/database/query/response/title.js.map +1 -0
  258. package/build/src/client/database/query/response/unique_id.d.ts +3 -0
  259. package/build/src/client/database/query/response/unique_id.d.ts.map +1 -0
  260. package/build/src/client/database/query/response/unique_id.js +14 -0
  261. package/build/src/client/database/query/response/unique_id.js.map +1 -0
  262. package/build/src/client/database/query/response/url.d.ts +3 -0
  263. package/build/src/client/database/query/response/url.d.ts.map +1 -0
  264. package/build/src/client/database/query/response/url.js +7 -0
  265. package/build/src/client/database/query/response/url.js.map +1 -0
  266. package/build/src/client/database/query/schema-drift-validation.d.ts +31 -0
  267. package/build/src/client/database/query/schema-drift-validation.d.ts.map +1 -0
  268. package/build/src/client/database/query/schema-drift-validation.js +68 -0
  269. package/build/src/client/database/query/schema-drift-validation.js.map +1 -0
  270. package/build/src/client/database/query/sort-transform.d.ts +6 -0
  271. package/build/src/client/database/query/sort-transform.d.ts.map +1 -0
  272. package/build/src/client/database/query/sort-transform.js +13 -0
  273. package/build/src/client/database/query/sort-transform.js.map +1 -0
  274. package/build/src/client/database/query/types.d.ts +42 -0
  275. package/build/src/client/database/query/types.d.ts.map +1 -0
  276. package/build/src/client/database/query/types.js +2 -0
  277. package/build/src/client/database/query/types.js.map +1 -0
  278. package/build/src/client/database/schema-builder.d.ts +8 -0
  279. package/build/src/client/database/schema-builder.d.ts.map +1 -0
  280. package/build/src/client/database/schema-builder.js +78 -0
  281. package/build/src/client/database/schema-builder.js.map +1 -0
  282. package/build/src/client/database/types/crud.d.ts +40 -0
  283. package/build/src/client/database/types/crud.d.ts.map +1 -0
  284. package/build/src/client/database/types/crud.js +5 -0
  285. package/build/src/client/database/types/crud.js.map +1 -0
  286. package/build/src/client/database/types/filter-capability.d.ts +30 -0
  287. package/build/src/client/database/types/filter-capability.d.ts.map +1 -0
  288. package/build/src/client/database/types/filter-capability.js +28 -0
  289. package/build/src/client/database/types/filter-capability.js.map +1 -0
  290. package/build/src/client/database/types/index.d.ts +16 -0
  291. package/build/src/client/database/types/index.d.ts.map +1 -0
  292. package/build/src/client/database/types/index.js +16 -0
  293. package/build/src/client/database/types/index.js.map +1 -0
  294. package/build/src/client/database/types/notion-database-id.d.ts +14 -0
  295. package/build/src/client/database/types/notion-database-id.d.ts.map +1 -0
  296. package/build/src/client/database/types/notion-database-id.js +9 -0
  297. package/build/src/client/database/types/notion-database-id.js.map +1 -0
  298. package/build/src/client/database/types/notion-filter-model.d.ts +98 -0
  299. package/build/src/client/database/types/notion-filter-model.d.ts.map +1 -0
  300. package/build/src/client/database/types/notion-filter-model.js +5 -0
  301. package/build/src/client/database/types/notion-filter-model.js.map +1 -0
  302. package/build/src/client/database/types/notion-id-brand.d.ts +27 -0
  303. package/build/src/client/database/types/notion-id-brand.d.ts.map +1 -0
  304. package/build/src/client/database/types/notion-id-brand.js +8 -0
  305. package/build/src/client/database/types/notion-id-brand.js.map +1 -0
  306. package/build/src/client/database/types/notion-page-id.d.ts +10 -0
  307. package/build/src/client/database/types/notion-page-id.d.ts.map +1 -0
  308. package/build/src/client/database/types/notion-page-id.js +6 -0
  309. package/build/src/client/database/types/notion-page-id.js.map +1 -0
  310. package/build/src/client/database/types/notion-user-id.d.ts +10 -0
  311. package/build/src/client/database/types/notion-user-id.d.ts.map +1 -0
  312. package/build/src/client/database/types/notion-user-id.js +6 -0
  313. package/build/src/client/database/types/notion-user-id.js.map +1 -0
  314. package/build/src/client/database/types/projection.d.ts +78 -0
  315. package/build/src/client/database/types/projection.d.ts.map +1 -0
  316. package/build/src/client/database/types/projection.js +6 -0
  317. package/build/src/client/database/types/projection.js.map +1 -0
  318. package/build/src/client/database/types/query-filter.d.ts +19 -0
  319. package/build/src/client/database/types/query-filter.d.ts.map +1 -0
  320. package/build/src/client/database/types/query-filter.js +5 -0
  321. package/build/src/client/database/types/query-filter.js.map +1 -0
  322. package/build/src/client/database/types/query-object.d.ts +42 -0
  323. package/build/src/client/database/types/query-object.d.ts.map +1 -0
  324. package/build/src/client/database/types/query-object.js +5 -0
  325. package/build/src/client/database/types/query-object.js.map +1 -0
  326. package/build/src/client/database/types/schema.d.ts +190 -0
  327. package/build/src/client/database/types/schema.d.ts.map +1 -0
  328. package/build/src/client/database/types/schema.js +41 -0
  329. package/build/src/client/database/types/schema.js.map +1 -0
  330. package/build/src/client/database/types/sort.d.ts +22 -0
  331. package/build/src/client/database/types/sort.d.ts.map +1 -0
  332. package/build/src/client/database/types/sort.js +5 -0
  333. package/build/src/client/database/types/sort.js.map +1 -0
  334. package/build/src/config/findConfigFile.d.ts +8 -0
  335. package/build/src/config/findConfigFile.d.ts.map +1 -0
  336. package/build/src/config/findConfigFile.js +18 -0
  337. package/build/src/config/findConfigFile.js.map +1 -0
  338. package/build/src/config/helpers.d.ts +7 -0
  339. package/build/src/config/helpers.d.ts.map +1 -0
  340. package/build/src/config/helpers.js +57 -0
  341. package/build/src/config/helpers.js.map +1 -0
  342. package/build/src/config/init.d.ts +7 -0
  343. package/build/src/config/init.d.ts.map +1 -0
  344. package/build/src/config/init.js +28 -0
  345. package/build/src/config/init.js.map +1 -0
  346. package/build/src/config/loadConfig.d.ts +11 -0
  347. package/build/src/config/loadConfig.d.ts.map +1 -0
  348. package/build/src/config/loadConfig.js +91 -0
  349. package/build/src/config/loadConfig.js.map +1 -0
  350. package/build/src/config/loadDotEnvFromCwd.d.ts +12 -0
  351. package/build/src/config/loadDotEnvFromCwd.d.ts.map +1 -0
  352. package/build/src/config/loadDotEnvFromCwd.js +47 -0
  353. package/build/src/config/loadDotEnvFromCwd.js.map +1 -0
  354. package/build/src/config/notion-config-filenames.d.ts +20 -0
  355. package/build/src/config/notion-config-filenames.d.ts.map +1 -0
  356. package/build/src/config/notion-config-filenames.js +24 -0
  357. package/build/src/config/notion-config-filenames.js.map +1 -0
  358. package/build/src/config/resolveNotionAuth.d.ts +18 -0
  359. package/build/src/config/resolveNotionAuth.d.ts.map +1 -0
  360. package/build/src/config/resolveNotionAuth.js +24 -0
  361. package/build/src/config/resolveNotionAuth.js.map +1 -0
  362. package/build/src/config/types.d.ts +16 -0
  363. package/build/src/config/types.d.ts.map +1 -0
  364. package/build/src/config/types.js +7 -0
  365. package/build/src/config/types.js.map +1 -0
  366. package/build/src/helpers.d.ts +22 -0
  367. package/build/src/helpers.d.ts.map +1 -0
  368. package/build/src/helpers.js +67 -0
  369. package/build/src/helpers.js.map +1 -0
  370. package/build/src/index.d.ts +15 -11
  371. package/build/src/index.d.ts.map +1 -1
  372. package/build/src/index.js +11 -116
  373. package/build/src/index.js.map +1 -1
  374. package/build/src/notion-id-patterns.d.ts +9 -0
  375. package/build/src/notion-id-patterns.d.ts.map +1 -0
  376. package/build/src/notion-id-patterns.js +9 -0
  377. package/build/src/notion-id-patterns.js.map +1 -0
  378. package/build/src/runtime-constants.d.ts +13 -0
  379. package/build/src/runtime-constants.d.ts.map +1 -0
  380. package/build/src/runtime-constants.js +13 -0
  381. package/build/src/runtime-constants.js.map +1 -0
  382. package/build/src/typeUtils.d.ts +77 -0
  383. package/build/src/typeUtils.d.ts.map +1 -0
  384. package/build/src/typeUtils.js +52 -0
  385. package/build/src/typeUtils.js.map +1 -0
  386. package/package.json +86 -32
  387. package/build/src/BuildCall.d.ts +0 -45
  388. package/build/src/BuildCall.d.ts.map +0 -1
  389. package/build/src/BuildCall.js +0 -114
  390. package/build/src/BuildCall.js.map +0 -1
  391. package/build/src/DatabaseActions.d.ts +0 -19
  392. package/build/src/DatabaseActions.d.ts.map +0 -1
  393. package/build/src/DatabaseActions.js +0 -158
  394. package/build/src/DatabaseActions.js.map +0 -1
  395. package/build/src/GenerateTypes.d.ts +0 -8
  396. package/build/src/GenerateTypes.d.ts.map +0 -1
  397. package/build/src/GenerateTypes.js +0 -257
  398. package/build/src/GenerateTypes.js.map +0 -1
  399. package/build/src/cli.d.ts +0 -3
  400. package/build/src/cli.d.ts.map +0 -1
  401. package/build/src/cli.js +0 -48
  402. package/build/src/cli.js.map +0 -1
  403. package/build/src/queryTypes.d.ts +0 -117
  404. package/build/src/queryTypes.d.ts.map +0 -1
  405. package/build/src/queryTypes.js +0 -7
  406. package/build/src/queryTypes.js.map +0 -1
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Single source of truth for user project `notion.config.*` filenames (CLI
3
+ * discovery, init, and tests). Keep this dumb: one basename plus the few
4
+ * concrete filenames we support.
5
+ */
6
+ /** Basename (no extension) for the Notion ORM config module in consuming apps. */
7
+ export declare const NOTION_CONFIG_BASENAME: "notion.config";
8
+ export declare const NOTION_CONFIG_FILENAMES: {
9
+ readonly js: "notion.config.js";
10
+ readonly ts: "notion.config.ts";
11
+ readonly mjs: "notion.config.mjs";
12
+ };
13
+ /**
14
+ * Supported filenames probed by {@link findConfigFile} in discovery order.
15
+ * `.js` stays ahead of `.ts` for legacy compatibility when both exist.
16
+ */
17
+ export declare const NOTION_CONFIG_CANDIDATE_FILENAMES: readonly ["notion.config.js", "notion.config.ts", "notion.config.mjs"];
18
+ /** Human-readable fragment for diagnostics (e.g. `js/ts/mjs`), derived from candidates. */
19
+ export declare const NOTION_CONFIG_EXTENSION_LABELS: string;
20
+ //# sourceMappingURL=notion-config-filenames.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notion-config-filenames.d.ts","sourceRoot":"","sources":["../../../src/config/notion-config-filenames.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,kFAAkF;AAClF,eAAO,MAAM,sBAAsB,EAAG,eAAwB,CAAC;AAE/D,eAAO,MAAM,uBAAuB;;;;CAI1B,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,iCAAiC,wEAIpC,CAAC;AAEX,2FAA2F;AAC3F,eAAO,MAAM,8BAA8B,QAEhC,CAAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Single source of truth for user project `notion.config.*` filenames (CLI
3
+ * discovery, init, and tests). Keep this dumb: one basename plus the few
4
+ * concrete filenames we support.
5
+ */
6
+ /** Basename (no extension) for the Notion ORM config module in consuming apps. */
7
+ export const NOTION_CONFIG_BASENAME = "notion.config";
8
+ export const NOTION_CONFIG_FILENAMES = {
9
+ js: `${NOTION_CONFIG_BASENAME}.js`,
10
+ ts: `${NOTION_CONFIG_BASENAME}.ts`,
11
+ mjs: `${NOTION_CONFIG_BASENAME}.mjs`,
12
+ };
13
+ /**
14
+ * Supported filenames probed by {@link findConfigFile} in discovery order.
15
+ * `.js` stays ahead of `.ts` for legacy compatibility when both exist.
16
+ */
17
+ export const NOTION_CONFIG_CANDIDATE_FILENAMES = [
18
+ NOTION_CONFIG_FILENAMES.js,
19
+ NOTION_CONFIG_FILENAMES.ts,
20
+ NOTION_CONFIG_FILENAMES.mjs,
21
+ ];
22
+ /** Human-readable fragment for diagnostics (e.g. `js/ts/mjs`), derived from candidates. */
23
+ export const NOTION_CONFIG_EXTENSION_LABELS = NOTION_CONFIG_CANDIDATE_FILENAMES.map((filename) => filename.slice(NOTION_CONFIG_BASENAME.length + 1)).join("/");
24
+ //# sourceMappingURL=notion-config-filenames.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notion-config-filenames.js","sourceRoot":"","sources":["../../../src/config/notion-config-filenames.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,kFAAkF;AAClF,MAAM,CAAC,MAAM,sBAAsB,GAAG,eAAwB,CAAC;AAE/D,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACtC,EAAE,EAAE,GAAG,sBAAsB,KAAK;IAClC,EAAE,EAAE,GAAG,sBAAsB,KAAK;IAClC,GAAG,EAAE,GAAG,sBAAsB,MAAM;CAC3B,CAAC;AAEX;;;GAGG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG;IAChD,uBAAuB,CAAC,EAAE;IAC1B,uBAAuB,CAAC,EAAE;IAC1B,uBAAuB,CAAC,GAAG;CAClB,CAAC;AAEX,2FAA2F;AAC3F,MAAM,CAAC,MAAM,8BAA8B,GAAG,iCAAiC,CAAC,GAAG,CAClF,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,sBAAsB,CAAC,MAAM,GAAG,CAAC,CAAC,CAC/D,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Input accepted by {@link resolveNotionAuth} and {@link NotionORMBase}.
3
+ */
4
+ export type NotionORMConfig = {
5
+ auth?: string;
6
+ };
7
+ /**
8
+ * Resolves the Notion API token using a single, predictable precedence:
9
+ *
10
+ * 1. Explicit `config.auth` (trimmed, when non-empty).
11
+ * 2. `process.env.NOTION_KEY` — populated either by the shell or by a `.env`
12
+ * file in the current project root, which this module loads automatically
13
+ * (shell values always win over `.env` values).
14
+ *
15
+ * @throws Error with actionable guidance when neither yields a non-empty string.
16
+ */
17
+ export declare function resolveNotionAuth(config: NotionORMConfig): string;
18
+ //# sourceMappingURL=resolveNotionAuth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveNotionAuth.d.ts","sourceRoot":"","sources":["../../../src/config/resolveNotionAuth.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,eAAe,GAAG,MAAM,CAajE"}
@@ -0,0 +1,24 @@
1
+ import { loadDotEnvFromCwd } from "./loadDotEnvFromCwd.js";
2
+ /**
3
+ * Resolves the Notion API token using a single, predictable precedence:
4
+ *
5
+ * 1. Explicit `config.auth` (trimmed, when non-empty).
6
+ * 2. `process.env.NOTION_KEY` — populated either by the shell or by a `.env`
7
+ * file in the current project root, which this module loads automatically
8
+ * (shell values always win over `.env` values).
9
+ *
10
+ * @throws Error with actionable guidance when neither yields a non-empty string.
11
+ */
12
+ export function resolveNotionAuth(config) {
13
+ loadDotEnvFromCwd();
14
+ const token = config.auth?.trim() || process.env.NOTION_KEY?.trim();
15
+ if (token === undefined || token.length === 0) {
16
+ throw new Error([
17
+ "Missing Notion API credentials.",
18
+ "Pass `auth` when constructing NotionORM (for example `new NotionORM({ auth: process.env.NOTION_KEY })`),",
19
+ "or set the NOTION_KEY environment variable in your shell or in a `.env` file at your project root.",
20
+ ].join(" "));
21
+ }
22
+ return token;
23
+ }
24
+ //# sourceMappingURL=resolveNotionAuth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveNotionAuth.js","sourceRoot":"","sources":["../../../src/config/resolveNotionAuth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AASxD;;;;;;;;;GASG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAuB;IACxD,iBAAiB,EAAE,CAAC;IACpB,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,IAAI,EAAE,CAAC;IACpE,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC/C,MAAM,IAAI,KAAK,CACd;YACC,iCAAiC;YACjC,0GAA0G;YAC1G,oGAAoG;SACpG,CAAC,IAAI,CAAC,GAAG,CAAC,CACX,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { z } from "zod";
2
+ export declare const notionConfigSchema: z.ZodObject<{
3
+ auth: z.ZodString;
4
+ databases: z.ZodArray<z.ZodString, "many">;
5
+ agents: z.ZodArray<z.ZodString, "many">;
6
+ }, "strip", z.ZodTypeAny, {
7
+ auth: string;
8
+ databases: string[];
9
+ agents: string[];
10
+ }, {
11
+ auth: string;
12
+ databases: string[];
13
+ agents: string[];
14
+ }>;
15
+ export type NotionConfigType = z.infer<typeof notionConfigSchema>;
16
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/config/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;EAI7B,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { z } from "zod";
2
+ export const notionConfigSchema = z.object({
3
+ auth: z.string().min(1, "Missing 'auth' field in notion config"),
4
+ databases: z.array(z.string()),
5
+ agents: z.array(z.string()),
6
+ });
7
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/config/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,uCAAuC,CAAC;IAChE,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAC9B,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;CAC3B,CAAC,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Returns a random version 4 UUID string using the built-in Web Crypto API
3
+ * (`globalThis.crypto.randomUUID()` — Node 19+ and modern browsers).
4
+ */
5
+ export declare function randomUuidV4(): string;
6
+ /** Normalizes arbitrary labels into stable camelCase identifiers for emitted symbols. */
7
+ export declare function camelize(str: string): string;
8
+ /**
9
+ * Capitalizes the first character of an identifier (e.g. camelCase module key → file stem).
10
+ * Used for generated module filenames alongside PascalCase factory exports.
11
+ */
12
+ export declare function toPascalCase(value: string): string;
13
+ /**
14
+ * Accepts dashed or undashed Notion UUIDs and returns the canonical undashed (32 hex) form.
15
+ * - With hyphens: must match dashed 8-4-4-4-12 lowercase hex.
16
+ * - Without hyphens: must be exactly 32 hex characters.
17
+ * Trims ASCII whitespace; empty / invalid shapes throw.
18
+ */
19
+ export declare function toUndashedNotionId(id: string): string;
20
+ /** Formats a canonical Notion id back into dashed UUID form for user-facing output. */
21
+ export declare function toDashedNotionId(id: string): string;
22
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/helpers.ts"],"names":[],"mappings":"AAKA;;;GAGG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAQrC;AAED,yFAAyF;AACzF,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,UAgBnC;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAKlD;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAoBrD;AAED,uFAAuF;AACvF,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAGnD"}
@@ -0,0 +1,67 @@
1
+ import { DASHED_NOTION_ID_PATTERN, UNDASHED_NOTION_ID_PATTERN, } from "./notion-id-patterns.js";
2
+ /**
3
+ * Returns a random version 4 UUID string using the built-in Web Crypto API
4
+ * (`globalThis.crypto.randomUUID()` — Node 19+ and modern browsers).
5
+ */
6
+ export function randomUuidV4() {
7
+ const crypto = globalThis.crypto;
8
+ if (crypto?.randomUUID === undefined) {
9
+ throw new Error("globalThis.crypto.randomUUID is not available (requires Node 19+ or a modern browser).");
10
+ }
11
+ return crypto.randomUUID();
12
+ }
13
+ /** Normalizes arbitrary labels into stable camelCase identifiers for emitted symbols. */
14
+ export function camelize(str) {
15
+ const tokens = str
16
+ .replace(/[^a-zA-Z0-9]+/g, " ")
17
+ .trim()
18
+ .split(/\s+/)
19
+ .filter((token) => token.length > 0)
20
+ .map((token) => token.toLowerCase());
21
+ if (tokens.length === 0) {
22
+ return "";
23
+ }
24
+ const [firstToken, ...remainingTokens] = tokens;
25
+ return `${firstToken}${remainingTokens
26
+ .map((token) => token[0].toUpperCase() + token.slice(1))
27
+ .join("")}`;
28
+ }
29
+ /**
30
+ * Capitalizes the first character of an identifier (e.g. camelCase module key → file stem).
31
+ * Used for generated module filenames alongside PascalCase factory exports.
32
+ */
33
+ export function toPascalCase(value) {
34
+ if (!value) {
35
+ return value;
36
+ }
37
+ return value[0].toUpperCase() + value.slice(1);
38
+ }
39
+ /**
40
+ * Accepts dashed or undashed Notion UUIDs and returns the canonical undashed (32 hex) form.
41
+ * - With hyphens: must match dashed 8-4-4-4-12 lowercase hex.
42
+ * - Without hyphens: must be exactly 32 hex characters.
43
+ * Trims ASCII whitespace; empty / invalid shapes throw.
44
+ */
45
+ export function toUndashedNotionId(id) {
46
+ const trimmed = id.trim();
47
+ if (trimmed.length === 0) {
48
+ throw new Error(`Invalid Notion ID: expected a non-empty string.`);
49
+ }
50
+ const lowered = trimmed.toLowerCase();
51
+ if (lowered.includes("-")) {
52
+ if (!DASHED_NOTION_ID_PATTERN.test(lowered)) {
53
+ throw new Error(`Invalid Notion ID. Expected UUID shape (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx), received '${id}'.`);
54
+ }
55
+ return lowered.replace(/-/g, "");
56
+ }
57
+ if (!UNDASHED_NOTION_ID_PATTERN.test(lowered)) {
58
+ throw new Error(`Invalid Notion ID. Expected 32 hexadecimal characters, received '${id}'.`);
59
+ }
60
+ return lowered;
61
+ }
62
+ /** Formats a canonical Notion id back into dashed UUID form for user-facing output. */
63
+ export function toDashedNotionId(id) {
64
+ const normalizedId = toUndashedNotionId(id);
65
+ return `${normalizedId.slice(0, 8)}-${normalizedId.slice(8, 12)}-${normalizedId.slice(12, 16)}-${normalizedId.slice(16, 20)}-${normalizedId.slice(20)}`;
66
+ }
67
+ //# sourceMappingURL=helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/helpers.ts"],"names":[],"mappings":"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"}
@@ -1,12 +1,16 @@
1
- /**
2
- * Responsible for consuming notion.config.js
3
- */
4
- export declare const DATABASES_DIR: string;
5
- export type NotionConfigType = {
6
- auth: string;
7
- databaseIds: string[];
8
- };
9
- export declare const createDatabaseTypes: (args: NotionConfigType) => Promise<{
10
- databaseNames: string[];
11
- }>;
1
+ import { NotionORMBase } from "./base";
2
+ export type { BrandedNotionId, DatabaseColumns, DatabaseColumnTypes, CreateSchema, DatabaseDefinition, DatabasePropertyType, DatabaseSchema, InferDatabaseColumns, InferCreateSchema, InferDatabaseSchema, NotWritableDatabaseColumnType, NotionConfigType, NotionDatabaseId, NotionIdKind, NotionORMConfig, NotionPageId, NotionUserId, Query, } from "./base";
3
+ export { AgentClient, brandedNotionIdsAsStringArray, buildZodFromColumns, DatabaseClient, NotionORMBase, resolveNotionAuth, toNotionDatabaseId, toNotionPageId, toNotionUserId, } from "./base";
4
+ export type { ObjectEntry, Simplify } from "./typeUtils";
5
+ export { objectEntries, objectKeys } from "./typeUtils";
6
+ export { randomUuidV4 } from "./helpers";
7
+ export { DASHED_NOTION_ID_PATTERN, UNDASHED_NOTION_ID_PATTERN, } from "./notion-id-patterns";
8
+ declare class NotionORM extends NotionORMBase {
9
+ databases: Record<string, never>;
10
+ agents: Record<string, never>;
11
+ constructor(config: {
12
+ auth?: string;
13
+ });
14
+ }
15
+ export default NotionORM;
12
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AASH,eAAO,MAAM,aAAa,QAA4C,CAAC;AAEvE,MAAM,MAAM,gBAAgB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,mBAAmB,SAAgB,gBAAgB;;EAyD/D,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAEvC,YAAY,EACX,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,YAAY,EACZ,kBAAkB,EAClB,oBAAoB,EACpB,cAAc,EACd,oBAAoB,EACpB,iBAAiB,EACjB,mBAAmB,EACnB,6BAA6B,EAC7B,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,KAAK,GACL,MAAM,QAAQ,CAAC;AAChB,OAAO,EACN,WAAW,EACX,6BAA6B,EAC7B,mBAAmB,EACnB,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,cAAc,GACd,MAAM,QAAQ,CAAC;AAChB,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EACN,wBAAwB,EACxB,0BAA0B,GAC1B,MAAM,sBAAsB,CAAC;AAE9B,cAAM,SAAU,SAAQ,aAAa;IAC7B,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACjC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;gBACzB,MAAM,EAAE;QACnB,IAAI,CAAC,EAAE,MAAM,CAAC;KACd;CAKD;AACD,eAAe,SAAS,CAAC"}
@@ -1,119 +1,14 @@
1
- "use strict";
2
- /**
3
- * Responsible for consuming notion.config.js
4
- */
5
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- var desc = Object.getOwnPropertyDescriptor(m, k);
8
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
- desc = { enumerable: true, get: function() { return m[k]; } };
1
+ import { NotionORMBase } from "./base.js";
2
+ export { AgentClient, brandedNotionIdsAsStringArray, buildZodFromColumns, DatabaseClient, NotionORMBase, resolveNotionAuth, toNotionDatabaseId, toNotionPageId, toNotionUserId, } from "./base.js";
3
+ export { objectEntries, objectKeys } from "./typeUtils.js";
4
+ export { randomUuidV4 } from "./helpers.js";
5
+ export { DASHED_NOTION_ID_PATTERN, UNDASHED_NOTION_ID_PATTERN, } from "./notion-id-patterns.js";
6
+ class NotionORM extends NotionORMBase {
7
+ constructor(config) {
8
+ super(config);
9
+ this.databases = {};
10
+ this.agents = {};
10
11
  }
11
- Object.defineProperty(o, k2, desc);
12
- }) : (function(o, m, k, k2) {
13
- if (k2 === undefined) k2 = k;
14
- o[k2] = m[k];
15
- }));
16
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
- Object.defineProperty(o, "default", { enumerable: true, value: v });
18
- }) : function(o, v) {
19
- o["default"] = v;
20
- });
21
- var __importStar = (this && this.__importStar) || function (mod) {
22
- if (mod && mod.__esModule) return mod;
23
- var result = {};
24
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
- __setModuleDefault(result, mod);
26
- return result;
27
- };
28
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
29
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
30
- return new (P || (P = Promise))(function (resolve, reject) {
31
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
32
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
33
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
34
- step((generator = generator.apply(thisArg, _arguments || [])).next());
35
- });
36
- };
37
- var __importDefault = (this && this.__importDefault) || function (mod) {
38
- return (mod && mod.__esModule) ? mod : { "default": mod };
39
- };
40
- Object.defineProperty(exports, "__esModule", { value: true });
41
- exports.createDatabaseTypes = exports.DATABASES_DIR = void 0;
42
- const client_1 = require("@notionhq/client");
43
- const GenerateTypes_1 = require("./GenerateTypes");
44
- const ts = __importStar(require("typescript"));
45
- const fs_1 = __importDefault(require("fs"));
46
- const path_1 = __importDefault(require("path"));
47
- exports.DATABASES_DIR = path_1.default.join(__dirname, "../../build", "db");
48
- const createDatabaseTypes = (args) => __awaiter(void 0, void 0, void 0, function* () {
49
- const { auth, databaseIds } = args;
50
- // Making sure the user is passing valid arguments
51
- if (!auth) {
52
- console.error("Please pass a valid Notion Integration Key");
53
- process.exit(1);
54
- }
55
- if (databaseIds.length < 0) {
56
- console.error("Please pass some database Ids");
57
- process.exit(1);
58
- }
59
- // Initialize client
60
- const NotionClient = new client_1.Client({
61
- auth: auth,
62
- });
63
- const databaseNames = [];
64
- const databaseClassExportStatements = [];
65
- // Remove the previous databases, so they can call get updated
66
- fs_1.default.rmdir(exports.DATABASES_DIR, () => console.log("Deleting current database types..."));
67
- for (const database_id of databaseIds) {
68
- let dbOjbect;
69
- try {
70
- // Get the database schema
71
- dbOjbect = yield NotionClient.databases.retrieve({
72
- database_id,
73
- });
74
- // Create typescript file based on schema
75
- const { databaseClassName, databaseId, databaseName } = yield (0, GenerateTypes_1.createTypescriptFileForDatabase)(dbOjbect);
76
- databaseNames.push(databaseName);
77
- databaseClassExportStatements.push(databaseExportStatement({
78
- databaseClassName,
79
- }));
80
- }
81
- catch (e) {
82
- console.error(e);
83
- return { databaseNames: [] };
84
- }
85
- }
86
- // Create a file that exports all databases
87
- createDatabaseBarrelFile({
88
- databaseClassExportStatements,
89
- });
90
- return { databaseNames };
91
- });
92
- exports.createDatabaseTypes = createDatabaseTypes;
93
- // Create the export statement for database file file
94
- // export { databaseName } from "./databaseName"
95
- function databaseExportStatement(args) {
96
- const { databaseClassName } = args;
97
- return ts.factory.createExportDeclaration(undefined, false, ts.factory.createNamedExports([
98
- ts.factory.createExportSpecifier(false, undefined, ts.factory.createIdentifier(databaseClassName)),
99
- ]), ts.factory.createStringLiteral(`./${databaseClassName}`), undefined);
100
- }
101
- // Creates file that import all generated notion database Ids
102
- function createDatabaseBarrelFile(args) {
103
- const { databaseClassExportStatements } = args;
104
- const nodes = ts.factory.createNodeArray(databaseClassExportStatements);
105
- const sourceFile = ts.createSourceFile("placeholder.ts", "", ts.ScriptTarget.ESNext, true, ts.ScriptKind.TS);
106
- const printer = ts.createPrinter();
107
- const typescriptCodeToString = printer.printList(ts.ListFormat.MultiLine, nodes, sourceFile);
108
- const transpileToJavaScript = ts.transpile(typescriptCodeToString, {
109
- module: ts.ModuleKind.None,
110
- target: ts.ScriptTarget.ES2015,
111
- });
112
- if (!fs_1.default.existsSync(exports.DATABASES_DIR)) {
113
- fs_1.default.mkdirSync(exports.DATABASES_DIR);
114
- }
115
- // Create TypeScript and JavaScript file
116
- fs_1.default.writeFileSync(path_1.default.resolve(exports.DATABASES_DIR, "index.ts"), typescriptCodeToString);
117
- fs_1.default.writeFileSync(path_1.default.resolve(exports.DATABASES_DIR, "index.js"), transpileToJavaScript);
118
12
  }
13
+ export default NotionORM;
119
14
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAsBvC,OAAO,EACN,WAAW,EACX,6BAA6B,EAC7B,mBAAmB,EACnB,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,cAAc,GACd,MAAM,QAAQ,CAAC;AAEhB,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EACN,wBAAwB,EACxB,0BAA0B,GAC1B,MAAM,sBAAsB,CAAC;AAE9B,MAAM,SAAU,SAAQ,aAAa;IAGpC,YAAY,MAEX;QACA,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;QACpB,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;IAClB,CAAC;CACD;AACD,eAAe,SAAS,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Canonical Notion UUID string shapes (lowercase hex). Callers should
3
+ * {@link String.prototype.toLowerCase toLowerCase} user input before testing.
4
+ */
5
+ /** Undashed 32-char hex (canonical Notion id storage form). */
6
+ export declare const UNDASHED_NOTION_ID_PATTERN: RegExp;
7
+ /** Dashed form: 8-4-4-4-12 lowercase hex. */
8
+ export declare const DASHED_NOTION_ID_PATTERN: RegExp;
9
+ //# sourceMappingURL=notion-id-patterns.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notion-id-patterns.d.ts","sourceRoot":"","sources":["../../src/notion-id-patterns.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,+DAA+D;AAC/D,eAAO,MAAM,0BAA0B,QAAmB,CAAC;AAE3D,6CAA6C;AAC7C,eAAO,MAAM,wBAAwB,QAC4B,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Canonical Notion UUID string shapes (lowercase hex). Callers should
3
+ * {@link String.prototype.toLowerCase toLowerCase} user input before testing.
4
+ */
5
+ /** Undashed 32-char hex (canonical Notion id storage form). */
6
+ export const UNDASHED_NOTION_ID_PATTERN = /^[0-9a-f]{32}$/;
7
+ /** Dashed form: 8-4-4-4-12 lowercase hex. */
8
+ export const DASHED_NOTION_ID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
9
+ //# sourceMappingURL=notion-id-patterns.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notion-id-patterns.js","sourceRoot":"","sources":["../../src/notion-id-patterns.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,+DAA+D;AAC/D,MAAM,CAAC,MAAM,0BAA0B,GAAG,gBAAgB,CAAC;AAE3D,6CAA6C;AAC7C,MAAM,CAAC,MAAM,wBAAwB,GACpC,gEAAgE,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Runtime-only constants shared by the published package surface, CLI, and
3
+ * generated clients. Keeping these outside `src/ast/` avoids making runtime
4
+ * code look like it depends on codegen internals.
5
+ */
6
+ export declare const PACKAGE_RUNTIME_CONSTANTS: {
7
+ readonly NOTION_API_VERSION: "2026-03-11";
8
+ readonly PACKAGE_LOG_PREFIX: "[@haustle/notion-orm]";
9
+ readonly CLI_GENERATE_COMMAND: "notion sync";
10
+ readonly SCHEMA_DRIFT_PREFIX: "Schema drift detected";
11
+ readonly SCHEMA_DRIFT_HELP_MESSAGE: "To easily fix this, please run `notion sync` to refresh all database schemas.";
12
+ };
13
+ //# sourceMappingURL=runtime-constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-constants.d.ts","sourceRoot":"","sources":["../../src/runtime-constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,yBAAyB;;;;;;CAW5B,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Runtime-only constants shared by the published package surface, CLI, and
3
+ * generated clients. Keeping these outside `src/ast/` avoids making runtime
4
+ * code look like it depends on codegen internals.
5
+ */
6
+ export const PACKAGE_RUNTIME_CONSTANTS = {
7
+ NOTION_API_VERSION: "2026-03-11",
8
+ PACKAGE_LOG_PREFIX: "[@haustle/notion-orm]",
9
+ CLI_GENERATE_COMMAND: "notion sync",
10
+ SCHEMA_DRIFT_PREFIX: "Schema drift detected",
11
+ SCHEMA_DRIFT_HELP_MESSAGE: "To easily fix this, please run `notion sync` to refresh all database schemas.",
12
+ };
13
+ //# sourceMappingURL=runtime-constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-constants.js","sourceRoot":"","sources":["../../src/runtime-constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACxC,kBAAkB,EAAE,YAAY;IAEhC,kBAAkB,EAAE,uBAAuB;IAE3C,oBAAoB,EAAE,aAAa;IAEnC,mBAAmB,EAAE,uBAAuB;IAE5C,yBAAyB,EACxB,+EAA+E;CACvE,CAAC"}
@@ -0,0 +1,77 @@
1
+ /**
2
+ * The type of a string key of the object T.
3
+ *
4
+ * This used in objectKeys and objectEntries, because Object.keys and
5
+ * Object.entries only return string-keys.
6
+ */
7
+ type StringKeyOfObject<T> = T extends unknown ? Exclude<keyof T, symbol> : never;
8
+ /**
9
+ * Like Object.keys, but unsound in exchange for more convenience.
10
+ *
11
+ * Casts the result of Object.keys to the known keys of an object type,
12
+ * even though JavaScript objects may contain additional keys.
13
+ *
14
+ * Only use this function when you know/control the provenance of the object
15
+ * you're iterating, and can verify it contains exactly the keys declared
16
+ * to the type system.
17
+ *
18
+ * Example:
19
+ * ```
20
+ * const o = {x: "ok", y: 10}
21
+ * o["z"] = "UNTRACKED_KEY"
22
+ * const safeKeys = Object.keys(o)
23
+ * const unsafeKeys = objectKeys(o)
24
+ * ```
25
+ * => const safeKeys: string[]
26
+ * => const unsafeKeys: ("x" | "y")[] // Missing "z"
27
+ */
28
+ export declare const objectKeys: <T>(obj: T) => Array<StringKeyOfObject<T>>;
29
+ /**
30
+ * Like Object.entries, but returns a more specific type which can be less safe.
31
+ *
32
+ * Note: includes `undefined` for optional properties -- TypeScript allows a
33
+ * property `a?: string` to be explicitly set to `a: undefined`, in which case
34
+ * it will show up in Object.entries.
35
+ *
36
+ * Example:
37
+ * ```
38
+ * const o = {x: "ok", y: 10}
39
+ * const unsafeEntries = Object.entries(o)
40
+ * const safeEntries = objectEntries(o)
41
+ * ```
42
+ * => const unsafeEntries: [string, string | number][]
43
+ * => const safeEntries: ObjectEntry<{
44
+ * x: string;
45
+ * y: number;
46
+ * }>[]
47
+ *
48
+ * See `ObjectEntry` above.
49
+ *
50
+ * Note that Object.entries collapses all possible values into a single union
51
+ * while objectEntries results in a union of 2-tuples.
52
+ *
53
+ * Only use this function when you know/control the provenance of the object
54
+ * you're iterating, and can verify it contains exactly the keys declared
55
+ * to the type system.
56
+ *
57
+ */
58
+ export declare const objectEntries: <T>(o: T) => Array<ObjectEntry<T>>;
59
+ /**
60
+ * The type of a single item in `Object.entries<T>(value: T)`.
61
+ *
62
+ * Example:
63
+ * ```
64
+ * interface T {x: string; y: number}
65
+ * type T2 = ObjectEntry<T>
66
+ * ```
67
+ * => type T2 = ["x", string] | ["y", number]
68
+ */
69
+ export type ObjectEntry<T> = T extends unknown ? {
70
+ [K in Exclude<keyof T, symbol>]: [K, T[K]];
71
+ }[Exclude<keyof T, symbol>] : never;
72
+ /** Flattens intersections / mapped types for clearer hover output. */
73
+ export type Simplify<T> = {
74
+ [K in keyof T]: T[K];
75
+ } & {};
76
+ export {};
77
+ //# sourceMappingURL=typeUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typeUtils.d.ts","sourceRoot":"","sources":["../../src/typeUtils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,KAAK,iBAAiB,CAAC,CAAC,IAAI,CAAC,SAAS,OAAO,GAC1C,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,GACxB,KAAK,CAAC;AAET;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,UAAU,EAAkB,CAAC,CAAC,EAC1C,GAAG,EAAE,CAAC,KACF,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC;AAEjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,aAAa,EAAqB,CAAC,CAAC,EAChD,CAAC,EAAE,CAAC,KACA,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;AAE3B;;;;;;;;;GASG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,OAAO,GAC3C;KACC,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;CAC1C,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,GAC1B,KAAK,CAAC;AAET,sEAAsE;AACtE,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAE,GAAG,EAAE,CAAC"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Like Object.keys, but unsound in exchange for more convenience.
3
+ *
4
+ * Casts the result of Object.keys to the known keys of an object type,
5
+ * even though JavaScript objects may contain additional keys.
6
+ *
7
+ * Only use this function when you know/control the provenance of the object
8
+ * you're iterating, and can verify it contains exactly the keys declared
9
+ * to the type system.
10
+ *
11
+ * Example:
12
+ * ```
13
+ * const o = {x: "ok", y: 10}
14
+ * o["z"] = "UNTRACKED_KEY"
15
+ * const safeKeys = Object.keys(o)
16
+ * const unsafeKeys = objectKeys(o)
17
+ * ```
18
+ * => const safeKeys: string[]
19
+ * => const unsafeKeys: ("x" | "y")[] // Missing "z"
20
+ */
21
+ export const objectKeys = Object.keys;
22
+ /**
23
+ * Like Object.entries, but returns a more specific type which can be less safe.
24
+ *
25
+ * Note: includes `undefined` for optional properties -- TypeScript allows a
26
+ * property `a?: string` to be explicitly set to `a: undefined`, in which case
27
+ * it will show up in Object.entries.
28
+ *
29
+ * Example:
30
+ * ```
31
+ * const o = {x: "ok", y: 10}
32
+ * const unsafeEntries = Object.entries(o)
33
+ * const safeEntries = objectEntries(o)
34
+ * ```
35
+ * => const unsafeEntries: [string, string | number][]
36
+ * => const safeEntries: ObjectEntry<{
37
+ * x: string;
38
+ * y: number;
39
+ * }>[]
40
+ *
41
+ * See `ObjectEntry` above.
42
+ *
43
+ * Note that Object.entries collapses all possible values into a single union
44
+ * while objectEntries results in a union of 2-tuples.
45
+ *
46
+ * Only use this function when you know/control the provenance of the object
47
+ * you're iterating, and can verify it contains exactly the keys declared
48
+ * to the type system.
49
+ *
50
+ */
51
+ export const objectEntries = Object.entries;
52
+ //# sourceMappingURL=typeUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typeUtils.js","sourceRoot":"","sources":["../../src/typeUtils.ts"],"names":[],"mappings":"AAUA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,IAED,CAAC;AAEjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,OAEV,CAAC"}