@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,10 @@
1
+ function hasStatus(error) {
2
+ return (typeof error === "object" &&
3
+ error !== null &&
4
+ "status" in error &&
5
+ typeof error.status === "number");
6
+ }
7
+ export function isNotFoundError(error) {
8
+ return hasStatus(error) && error.status === 404;
9
+ }
10
+ //# sourceMappingURL=http-guards.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http-guards.js","sourceRoot":"","sources":["../../../../../src/client/database/query/http-guards.ts"],"names":[],"mappings":"AAAA,SAAS,SAAS,CAAC,KAAc;IAChC,OAAO,CACN,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,QAAQ,IAAI,KAAK;QACjB,OAAO,KAAK,CAAC,MAAM,KAAK,QAAQ,CAChC,CAAC;AACH,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,KAAc;IAC7C,OAAO,SAAS,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,GAAG,CAAC;AACjD,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { buildQueryResponse } from "./build-query-response";
2
+ export { transformQueryFilterToApiFilter } from "./filter";
3
+ export { isFullPage, isPageWithProperties, normalizePageResult, } from "./normalize-page-result";
4
+ export { transformQuerySortToApiSorts } from "./sort-transform";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/client/database/query/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,+BAA+B,EAAE,MAAM,UAAU,CAAC;AAC3D,OAAO,EACN,UAAU,EACV,oBAAoB,EACpB,mBAAmB,GACnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,4BAA4B,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { buildQueryResponse } from "./build-query-response.js";
2
+ export { transformQueryFilterToApiFilter } from "./filter/index.js";
3
+ export { isFullPage, isPageWithProperties, normalizePageResult, } from "./normalize-page-result.js";
4
+ export { transformQuerySortToApiSorts } from "./sort-transform.js";
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/client/database/query/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,+BAA+B,EAAE,MAAM,UAAU,CAAC;AAC3D,OAAO,EACN,UAAU,EACV,oBAAoB,EACpB,mBAAmB,GACnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,4BAA4B,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { GetPageResponse, PageObjectResponse, QueryDataSourceResponse } from "@notionhq/client/build/src/api-endpoints";
2
+ import type { DatabaseColumns, DatabasePropertyValue } from "../types";
3
+ import type { NormalizablePageResult, QueryDataSourcePageResultWithProperties } from "./types";
4
+ /** Narrows Notion query results to page payloads that expose a property map. */
5
+ export declare function isPageWithProperties(result: QueryDataSourceResponse["results"][number]): result is QueryDataSourcePageResultWithProperties;
6
+ /** Narrows a pages.retrieve response to a full page with properties. */
7
+ export declare function isFullPage(page: GetPageResponse): page is PageObjectResponse;
8
+ /** True when a full page belongs to the current data source-backed database client. */
9
+ export declare function isPageInDataSource(page: PageObjectResponse, dataSourceId: string): boolean;
10
+ /** Converts a raw Notion page into the camelized shape exposed by the client. */
11
+ export declare function normalizePageResult<DatabaseSchemaType extends Record<string, DatabasePropertyValue>>(args: {
12
+ result: NormalizablePageResult;
13
+ columns: DatabaseColumns;
14
+ }): Partial<DatabaseSchemaType>;
15
+ //# sourceMappingURL=normalize-page-result.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"normalize-page-result.d.ts","sourceRoot":"","sources":["../../../../../src/client/database/query/normalize-page-result.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,eAAe,EACf,kBAAkB,EAClB,uBAAuB,EACvB,MAAM,0CAA0C,CAAC;AAGlD,OAAO,KAAK,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAEvE,OAAO,KAAK,EACX,sBAAsB,EACtB,uCAAuC,EACvC,MAAM,SAAS,CAAC;AAEjB,gFAAgF;AAChF,wBAAgB,oBAAoB,CACnC,MAAM,EAAE,uBAAuB,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,GAChD,MAAM,IAAI,uCAAuC,CAEnD;AAED,wEAAwE;AACxE,wBAAgB,UAAU,CAAC,IAAI,EAAE,eAAe,GAAG,IAAI,IAAI,kBAAkB,CAE5E;AAED,uFAAuF;AACvF,wBAAgB,kBAAkB,CACjC,IAAI,EAAE,kBAAkB,EACxB,YAAY,EAAE,MAAM,GAClB,OAAO,CAKT;AAED,iFAAiF;AACjF,wBAAgB,mBAAmB,CAClC,kBAAkB,SAAS,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,EAC/D,IAAI,EAAE;IAAE,MAAM,EAAE,sBAAsB,CAAC;IAAC,OAAO,EAAE,eAAe,CAAA;CAAE,+BAoBnE"}
@@ -0,0 +1,35 @@
1
+ import { camelize } from "../../../helpers.js";
2
+ import { objectEntries } from "../../../typeUtils.js";
3
+ import { getSimplifiedResult } from "./response/index.js";
4
+ /** Narrows Notion query results to page payloads that expose a property map. */
5
+ export function isPageWithProperties(result) {
6
+ return result.object === "page" && "properties" in result;
7
+ }
8
+ /** Narrows a pages.retrieve response to a full page with properties. */
9
+ export function isFullPage(page) {
10
+ return "properties" in page;
11
+ }
12
+ /** True when a full page belongs to the current data source-backed database client. */
13
+ export function isPageInDataSource(page, dataSourceId) {
14
+ return (page.parent.type === "data_source_id" &&
15
+ page.parent.data_source_id === dataSourceId);
16
+ }
17
+ /** Converts a raw Notion page into the camelized shape exposed by the client. */
18
+ export function normalizePageResult(args) {
19
+ const normalizedResult = {};
20
+ for (const [columnName, propertyValue] of objectEntries(args.result.properties)) {
21
+ const camelizedColumnName = camelize(columnName);
22
+ const columnType = args.columns[camelizedColumnName]?.type;
23
+ if (!columnType) {
24
+ continue;
25
+ }
26
+ Object.assign(normalizedResult, {
27
+ [camelizedColumnName]: getSimplifiedResult({
28
+ columnType,
29
+ propertyValue,
30
+ }),
31
+ });
32
+ }
33
+ return normalizedResult;
34
+ }
35
+ //# sourceMappingURL=normalize-page-result.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"normalize-page-result.js","sourceRoot":"","sources":["../../../../../src/client/database/query/normalize-page-result.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAMjD,gFAAgF;AAChF,MAAM,UAAU,oBAAoB,CACnC,MAAkD;IAElD,OAAO,MAAM,CAAC,MAAM,KAAK,MAAM,IAAI,YAAY,IAAI,MAAM,CAAC;AAC3D,CAAC;AAED,wEAAwE;AACxE,MAAM,UAAU,UAAU,CAAC,IAAqB;IAC/C,OAAO,YAAY,IAAI,IAAI,CAAC;AAC7B,CAAC;AAED,uFAAuF;AACvF,MAAM,UAAU,kBAAkB,CACjC,IAAwB,EACxB,YAAoB;IAEpB,OAAO,CACN,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,gBAAgB;QACrC,IAAI,CAAC,MAAM,CAAC,cAAc,KAAK,YAAY,CAC3C,CAAC;AACH,CAAC;AAED,iFAAiF;AACjF,MAAM,UAAU,mBAAmB,CAEjC,IAAkE;IACnE,MAAM,gBAAgB,GAAgC,EAAE,CAAC;IACzD,KAAK,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,IAAI,aAAa,CACtD,IAAI,CAAC,MAAM,CAAC,UAAU,CACtB,EAAE,CAAC;QACH,MAAM,mBAAmB,GAAG,QAAQ,CAAC,UAAU,CAAC,CAAC;QACjD,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,mBAAmB,CAAC,EAAE,IAAI,CAAC;QAC3D,IAAI,CAAC,UAAU,EAAE,CAAC;YACjB,SAAS;QACV,CAAC;QAED,MAAM,CAAC,MAAM,CAAC,gBAAgB,EAAE;YAC/B,CAAC,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;gBAC1C,UAAU;gBACV,aAAa;aACb,CAAC;SACF,CAAC,CAAC;IACJ,CAAC;IAED,OAAO,gBAAgB,CAAC;AACzB,CAAC"}
@@ -0,0 +1,42 @@
1
+ import type { Client } from "@notionhq/client";
2
+ import type { DatabaseColumns, DatabaseDefinition, DatabaseSchema, QueryFilter, QuerySort } from "../types";
3
+ type MatchingQueryRow<Definition extends DatabaseDefinition> = {
4
+ id: string;
5
+ data: Partial<DatabaseSchema<Definition>>;
6
+ };
7
+ type MatchingQueryRowsPage<Definition extends DatabaseDefinition> = {
8
+ rows: MatchingQueryRow<Definition>[];
9
+ hasMore: boolean;
10
+ nextCursor: string | undefined;
11
+ };
12
+ export declare function findRowWithPageId<Definition extends DatabaseDefinition>(args: {
13
+ client: Client;
14
+ dataSourceId: string;
15
+ columns: DatabaseColumns;
16
+ where?: QueryFilter<Definition>;
17
+ sortBy?: QuerySort<Definition>;
18
+ size: number;
19
+ after?: string;
20
+ validateSchema: (result: Partial<DatabaseSchema<Definition>>) => void;
21
+ }): Promise<MatchingQueryRowsPage<Definition>>;
22
+ export declare function collectPageIdsMatchingFilter<Definition extends DatabaseDefinition>(args: {
23
+ client: Client;
24
+ dataSourceId: string;
25
+ columns: DatabaseColumns;
26
+ where?: QueryFilter<Definition>;
27
+ validateSchema: (result: Partial<DatabaseSchema<Definition>>) => void;
28
+ }): Promise<string[]>;
29
+ export declare function findMatchingQueryRowsWithNotionPageIds<Definition extends DatabaseDefinition>(args: {
30
+ client: Client;
31
+ dataSourceId: string;
32
+ columns: DatabaseColumns;
33
+ where?: QueryFilter<Definition>;
34
+ sortBy?: QuerySort<Definition>;
35
+ size: number;
36
+ validateSchema: (result: Partial<DatabaseSchema<Definition>>) => void;
37
+ }): Promise<Array<{
38
+ id: string;
39
+ data: Partial<DatabaseSchema<Definition>>;
40
+ }>>;
41
+ export {};
42
+ //# sourceMappingURL=page-collection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"page-collection.d.ts","sourceRoot":"","sources":["../../../../../src/client/database/query/page-collection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,KAAK,EACX,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,WAAW,EACX,SAAS,EACT,MAAM,UAAU,CAAC;AAIlB,KAAK,gBAAgB,CAAC,UAAU,SAAS,kBAAkB,IAAI;IAC9D,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC;CAC1C,CAAC;AAEF,KAAK,qBAAqB,CAAC,UAAU,SAAS,kBAAkB,IAAI;IACnE,IAAI,EAAE,gBAAgB,CAAC,UAAU,CAAC,EAAE,CAAC;IACrC,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;CAC/B,CAAC;AA4BF,wBAAsB,iBAAiB,CACtC,UAAU,SAAS,kBAAkB,EACpC,IAAI,EAAE;IACP,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,eAAe,CAAC;IACzB,KAAK,CAAC,EAAE,WAAW,CAAC,UAAU,CAAC,CAAC;IAChC,MAAM,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,CACf,MAAM,EAAE,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,KACvC,IAAI,CAAC;CACV,GAAG,OAAO,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC,CAmB7C;AAED,wBAAsB,4BAA4B,CACjD,UAAU,SAAS,kBAAkB,EACpC,IAAI,EAAE;IACP,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,eAAe,CAAC;IACzB,KAAK,CAAC,EAAE,WAAW,CAAC,UAAU,CAAC,CAAC;IAChC,cAAc,EAAE,CACf,MAAM,EAAE,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,KACvC,IAAI,CAAC;CACV,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CA0BpB;AAED,wBAAsB,sCAAsC,CAC3D,UAAU,SAAS,kBAAkB,EACpC,IAAI,EAAE;IACP,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,eAAe,CAAC;IACzB,KAAK,CAAC,EAAE,WAAW,CAAC,UAAU,CAAC,CAAC;IAChC,MAAM,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,CACf,MAAM,EAAE,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,KACvC,IAAI,CAAC;CACV,GAAG,OAAO,CAAC,KAAK,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAAA;CAAE,CAAC,CAAC,CAM5E"}
@@ -0,0 +1,71 @@
1
+ import { buildDataSourceQueryParams } from "./build-query-params.js";
2
+ import { isPageWithProperties, normalizePageResult } from "./normalize-page-result.js";
3
+ function normalizeMatchingQueryRowsWithNotionPageIds(args) {
4
+ const rows = [];
5
+ for (const result of args.results) {
6
+ if (!isPageWithProperties(result)) {
7
+ continue;
8
+ }
9
+ const normalizedResult = normalizePageResult({
10
+ result,
11
+ columns: args.columns,
12
+ });
13
+ if (rows.length === 0) {
14
+ args.validateSchema(normalizedResult);
15
+ }
16
+ rows.push({ id: result.id, data: normalizedResult });
17
+ }
18
+ return rows;
19
+ }
20
+ export async function findRowWithPageId(args) {
21
+ const params = buildDataSourceQueryParams({
22
+ dataSourceId: args.dataSourceId,
23
+ columns: args.columns,
24
+ where: args.where,
25
+ sortBy: args.sortBy,
26
+ size: args.size,
27
+ after: args.after,
28
+ });
29
+ const response = await args.client.dataSources.query(params);
30
+ return {
31
+ rows: normalizeMatchingQueryRowsWithNotionPageIds({
32
+ results: response.results,
33
+ columns: args.columns,
34
+ validateSchema: args.validateSchema,
35
+ }),
36
+ hasMore: response.has_more,
37
+ nextCursor: response.next_cursor ?? undefined,
38
+ };
39
+ }
40
+ export async function collectPageIdsMatchingFilter(args) {
41
+ const ids = [];
42
+ let cursor;
43
+ let hasMore = true;
44
+ let hasValidatedFirstRow = false;
45
+ while (hasMore) {
46
+ const response = await findRowWithPageId({
47
+ client: args.client,
48
+ dataSourceId: args.dataSourceId,
49
+ columns: args.columns,
50
+ where: args.where,
51
+ size: 100,
52
+ after: cursor,
53
+ validateSchema: hasValidatedFirstRow
54
+ ? () => { }
55
+ : args.validateSchema,
56
+ });
57
+ for (const row of response.rows) {
58
+ ids.push(row.id);
59
+ }
60
+ hasValidatedFirstRow || (hasValidatedFirstRow = response.rows.length > 0);
61
+ hasMore = response.hasMore;
62
+ cursor = response.nextCursor;
63
+ }
64
+ return ids;
65
+ }
66
+ export async function findMatchingQueryRowsWithNotionPageIds(args) {
67
+ return (await findRowWithPageId({
68
+ ...args,
69
+ })).rows;
70
+ }
71
+ //# sourceMappingURL=page-collection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"page-collection.js","sourceRoot":"","sources":["../../../../../src/client/database/query/page-collection.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAapF,SAAS,2CAA2C,CAElD,IAMD;IACA,MAAM,IAAI,GAAmC,EAAE,CAAC;IAChD,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;QACnC,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,EAAE,CAAC;YACnC,SAAS;QACV,CAAC;QACD,MAAM,gBAAgB,GAAG,mBAAmB,CAA6B;YACxE,MAAM;YACN,OAAO,EAAE,IAAI,CAAC,OAAO;SACrB,CAAC,CAAC;QACH,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACvB,IAAI,CAAC,cAAc,CAAC,gBAAgB,CAAC,CAAC;QACvC,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,CAAC,CAAC;IACtD,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAErC,IAWD;IACA,MAAM,MAAM,GAAG,0BAA0B,CAAC;QACzC,YAAY,EAAE,IAAI,CAAC,YAAY;QAC/B,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,KAAK,EAAE,IAAI,CAAC,KAAK;KACjB,CAAC,CAAC;IACH,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAC7D,OAAO;QACN,IAAI,EAAE,2CAA2C,CAAC;YACjD,OAAO,EAAE,QAAQ,CAAC,OAAO;YACzB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,cAAc,EAAE,IAAI,CAAC,cAAc;SACnC,CAAC;QACF,OAAO,EAAE,QAAQ,CAAC,QAAQ;QAC1B,UAAU,EAAE,QAAQ,CAAC,WAAW,IAAI,SAAS;KAC7C,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAEhD,IAQD;IACA,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,IAAI,MAA0B,CAAC;IAC/B,IAAI,OAAO,GAAG,IAAI,CAAC;IACnB,IAAI,oBAAoB,GAAG,KAAK,CAAC;IACjC,OAAO,OAAO,EAAE,CAAC;QAChB,MAAM,QAAQ,GACb,MAAM,iBAAiB,CAAa;YACpC,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,IAAI,EAAE,GAAG;YACT,KAAK,EAAE,MAAM;YACb,cAAc,EAAE,oBAAoB;gBACnC,CAAC,CAAC,GAAG,EAAE,GAAE,CAAC;gBACV,CAAC,CAAC,IAAI,CAAC,cAAc;SACtB,CAAC,CAAC;QACH,KAAK,MAAM,GAAG,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC;YACjC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAClB,CAAC;QACD,oBAAoB,KAApB,oBAAoB,GAAK,QAAQ,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAC;QAClD,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC;QAC3B,MAAM,GAAG,QAAQ,CAAC,UAAU,CAAC;IAC9B,CAAC;IACD,OAAO,GAAG,CAAC;AACZ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,sCAAsC,CAE1D,IAUD;IACA,OAAO,CACN,MAAM,iBAAiB,CAAC;QACvB,GAAG,IAAI;KACP,CAAC,CACF,CAAC,IAAI,CAAC;AACR,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { DatabasePropertyValue, Projection, ProjectionPropertyName } from "../types";
2
+ export type NormalizedProjection<PropertyName extends string | number> = {
3
+ mode: "none" | "select" | "omit";
4
+ keys: Set<PropertyName>;
5
+ };
6
+ export declare function normalizeProjection<DatabaseSchemaType extends Record<string, DatabasePropertyValue>>(projection?: Projection<DatabaseSchemaType>): NormalizedProjection<ProjectionPropertyName<DatabaseSchemaType>>;
7
+ export declare function applyProjectionToRow<DatabaseSchemaType extends Record<string, DatabasePropertyValue>>(row: Partial<DatabaseSchemaType>, projection: NormalizedProjection<ProjectionPropertyName<DatabaseSchemaType>>): Partial<DatabaseSchemaType>;
8
+ export declare function applyProjection<DatabaseSchemaType extends Record<string, DatabasePropertyValue>>(results: Partial<DatabaseSchemaType>[], projection: NormalizedProjection<ProjectionPropertyName<DatabaseSchemaType>>): Partial<DatabaseSchemaType>[];
9
+ //# sourceMappingURL=projection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"projection.d.ts","sourceRoot":"","sources":["../../../../../src/client/database/query/projection.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACX,qBAAqB,EACrB,UAAU,EACV,sBAAsB,EACtB,MAAM,UAAU,CAAC;AAElB,MAAM,MAAM,oBAAoB,CAAC,YAAY,SAAS,MAAM,GAAG,MAAM,IAAI;IACxE,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;IACjC,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,CAAC;CACxB,CAAC;AAEF,wBAAgB,mBAAmB,CAClC,kBAAkB,SAAS,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,EAEhE,UAAU,CAAC,EAAE,UAAU,CAAC,kBAAkB,CAAC,GACzC,oBAAoB,CAAC,sBAAsB,CAAC,kBAAkB,CAAC,CAAC,CAiBlE;AAED,wBAAgB,oBAAoB,CACnC,kBAAkB,SAAS,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,EAEhE,GAAG,EAAE,OAAO,CAAC,kBAAkB,CAAC,EAChC,UAAU,EAAE,oBAAoB,CAAC,sBAAsB,CAAC,kBAAkB,CAAC,CAAC,GAC1E,OAAO,CAAC,kBAAkB,CAAC,CAkB7B;AAED,wBAAgB,eAAe,CAC9B,kBAAkB,SAAS,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,EAEhE,OAAO,EAAE,OAAO,CAAC,kBAAkB,CAAC,EAAE,EACtC,UAAU,EAAE,oBAAoB,CAAC,sBAAsB,CAAC,kBAAkB,CAAC,CAAC,GAC1E,OAAO,CAAC,kBAAkB,CAAC,EAAE,CAK/B"}
@@ -0,0 +1,43 @@
1
+ import { PACKAGE_RUNTIME_CONSTANTS } from "../../../runtime-constants.js";
2
+ export function normalizeProjection(projection) {
3
+ const select = projection?.select;
4
+ const omit = projection?.omit;
5
+ const hasSelect = select != null && select.length > 0;
6
+ const hasOmit = omit != null && omit.length > 0;
7
+ if (hasSelect && hasOmit) {
8
+ throw new Error(`${PACKAGE_RUNTIME_CONSTANTS.PACKAGE_LOG_PREFIX} Projection: use either select or omit, not both.`);
9
+ }
10
+ if (hasSelect) {
11
+ return { mode: "select", keys: new Set(select) };
12
+ }
13
+ if (hasOmit) {
14
+ return { mode: "omit", keys: new Set(omit) };
15
+ }
16
+ return { mode: "none", keys: new Set() };
17
+ }
18
+ export function applyProjectionToRow(row, projection) {
19
+ if (projection.mode === "select") {
20
+ const projected = {};
21
+ for (const key of projection.keys) {
22
+ if (key in row) {
23
+ projected[key] = row[key];
24
+ }
25
+ }
26
+ return projected;
27
+ }
28
+ if (projection.mode === "omit") {
29
+ const projected = { ...row };
30
+ for (const key of projection.keys) {
31
+ delete projected[key];
32
+ }
33
+ return projected;
34
+ }
35
+ return row;
36
+ }
37
+ export function applyProjection(results, projection) {
38
+ if (projection.mode === "none") {
39
+ return results;
40
+ }
41
+ return results.map((row) => applyProjectionToRow(row, projection));
42
+ }
43
+ //# sourceMappingURL=projection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"projection.js","sourceRoot":"","sources":["../../../../../src/client/database/query/projection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAYvE,MAAM,UAAU,mBAAmB,CAGlC,UAA2C;IAE3C,MAAM,MAAM,GAAG,UAAU,EAAE,MAAM,CAAC;IAClC,MAAM,IAAI,GAAG,UAAU,EAAE,IAAI,CAAC;IAC9B,MAAM,SAAS,GAAG,MAAM,IAAI,IAAI,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;IACtD,MAAM,OAAO,GAAG,IAAI,IAAI,IAAI,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;IAChD,IAAI,SAAS,IAAI,OAAO,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CACd,GAAG,yBAAyB,CAAC,kBAAkB,mDAAmD,CAClG,CAAC;IACH,CAAC;IACD,IAAI,SAAS,EAAE,CAAC;QACf,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;IAClD,CAAC;IACD,IAAI,OAAO,EAAE,CAAC;QACb,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;IAC9C,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,GAAG,EAAE,EAAE,CAAC;AAC1C,CAAC;AAED,MAAM,UAAU,oBAAoB,CAGnC,GAAgC,EAChC,UAA4E;IAE5E,IAAI,UAAU,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;QAClC,MAAM,SAAS,GAAgC,EAAE,CAAC;QAClD,KAAK,MAAM,GAAG,IAAI,UAAU,CAAC,IAAI,EAAE,CAAC;YACnC,IAAI,GAAG,IAAI,GAAG,EAAE,CAAC;gBAChB,SAAS,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;YAC3B,CAAC;QACF,CAAC;QACD,OAAO,SAAS,CAAC;IAClB,CAAC;IACD,IAAI,UAAU,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;QAChC,MAAM,SAAS,GAAgC,EAAE,GAAG,GAAG,EAAE,CAAC;QAC1D,KAAK,MAAM,GAAG,IAAI,UAAU,CAAC,IAAI,EAAE,CAAC;YACnC,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC;QACvB,CAAC;QACD,OAAO,SAAS,CAAC;IAClB,CAAC;IACD,OAAO,GAAG,CAAC;AACZ,CAAC;AAED,MAAM,UAAU,eAAe,CAG9B,OAAsC,EACtC,UAA4E;IAE5E,IAAI,UAAU,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;QAChC,OAAO,OAAO,CAAC;IAChB,CAAC;IACD,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,oBAAoB,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC,CAAC;AACpE,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { NotionPropertyValue } from "../types";
2
+ export declare function resolveCheckbox(property: NotionPropertyValue): boolean | null;
3
+ //# sourceMappingURL=checkbox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../../../../../src/client/database/query/response/checkbox.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAEpD,wBAAgB,eAAe,CAAC,QAAQ,EAAE,mBAAmB,kBAK5D"}
@@ -0,0 +1,7 @@
1
+ export function resolveCheckbox(property) {
2
+ if (property.type !== "checkbox") {
3
+ return null;
4
+ }
5
+ return Boolean(property.checkbox);
6
+ }
7
+ //# sourceMappingURL=checkbox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkbox.js","sourceRoot":"","sources":["../../../../../../src/client/database/query/response/checkbox.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,eAAe,CAAC,QAA6B;IAC5D,IAAI,QAAQ,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;QAClC,OAAO,IAAI,CAAC;IACb,CAAC;IACD,OAAO,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AACnC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { NotionPropertyValue } from "../types";
2
+ export declare function resolveCreatedBy(property: NotionPropertyValue): string | null;
3
+ //# sourceMappingURL=created_by.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"created_by.d.ts","sourceRoot":"","sources":["../../../../../../src/client/database/query/response/created_by.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAGpD,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,mBAAmB,iBAK7D"}
@@ -0,0 +1,8 @@
1
+ import { resolveUserNameOrId } from "./shared.js";
2
+ export function resolveCreatedBy(property) {
3
+ if (property.type !== "created_by") {
4
+ return null;
5
+ }
6
+ return resolveUserNameOrId(property.created_by);
7
+ }
8
+ //# sourceMappingURL=created_by.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"created_by.js","sourceRoot":"","sources":["../../../../../../src/client/database/query/response/created_by.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE/C,MAAM,UAAU,gBAAgB,CAAC,QAA6B;IAC7D,IAAI,QAAQ,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;QACpC,OAAO,IAAI,CAAC;IACb,CAAC;IACD,OAAO,mBAAmB,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;AACjD,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { NotionPropertyValue } from "../types";
2
+ export declare function resolveCreatedTime(property: NotionPropertyValue): string | null;
3
+ //# sourceMappingURL=created_time.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"created_time.d.ts","sourceRoot":"","sources":["../../../../../../src/client/database/query/response/created_time.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAEpD,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,mBAAmB,iBAK/D"}
@@ -0,0 +1,7 @@
1
+ export function resolveCreatedTime(property) {
2
+ if (property.type !== "created_time") {
3
+ return null;
4
+ }
5
+ return property.created_time ?? null;
6
+ }
7
+ //# sourceMappingURL=created_time.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"created_time.js","sourceRoot":"","sources":["../../../../../../src/client/database/query/response/created_time.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,kBAAkB,CAAC,QAA6B;IAC/D,IAAI,QAAQ,CAAC,IAAI,KAAK,cAAc,EAAE,CAAC;QACtC,OAAO,IAAI,CAAC;IACb,CAAC;IACD,OAAO,QAAQ,CAAC,YAAY,IAAI,IAAI,CAAC;AACtC,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { NotionPropertyValue } from "../types";
2
+ export declare function resolveDate(property: NotionPropertyValue): {
3
+ start: string;
4
+ end: string | undefined;
5
+ } | null;
6
+ //# sourceMappingURL=date.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date.d.ts","sourceRoot":"","sources":["../../../../../../src/client/database/query/response/date.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAEpD,wBAAgB,WAAW,CAAC,QAAQ,EAAE,mBAAmB;;;SAaxD"}
@@ -0,0 +1,13 @@
1
+ export function resolveDate(property) {
2
+ if (property.type !== "date") {
3
+ return null;
4
+ }
5
+ if (property.date && typeof property.date.start === "string") {
6
+ return {
7
+ start: property.date.start,
8
+ end: property.date.end ?? undefined,
9
+ };
10
+ }
11
+ return null;
12
+ }
13
+ //# sourceMappingURL=date.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date.js","sourceRoot":"","sources":["../../../../../../src/client/database/query/response/date.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,WAAW,CAAC,QAA6B;IACxD,IAAI,QAAQ,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;QAC9B,OAAO,IAAI,CAAC;IACb,CAAC;IAED,IAAI,QAAQ,CAAC,IAAI,IAAI,OAAO,QAAQ,CAAC,IAAI,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9D,OAAO;YACN,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,KAAK;YAC1B,GAAG,EAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,IAAI,SAAS;SACnC,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC;AACb,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { NotionPropertyValue } from "../types";
2
+ export declare function resolveEmail(property: NotionPropertyValue): string | null;
3
+ //# sourceMappingURL=email.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email.d.ts","sourceRoot":"","sources":["../../../../../../src/client/database/query/response/email.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAEpD,wBAAgB,YAAY,CAAC,QAAQ,EAAE,mBAAmB,iBAKzD"}
@@ -0,0 +1,7 @@
1
+ export function resolveEmail(property) {
2
+ if (property.type !== "email") {
3
+ return null;
4
+ }
5
+ return property.email;
6
+ }
7
+ //# sourceMappingURL=email.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email.js","sourceRoot":"","sources":["../../../../../../src/client/database/query/response/email.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,YAAY,CAAC,QAA6B;IACzD,IAAI,QAAQ,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;QAC/B,OAAO,IAAI,CAAC;IACb,CAAC;IACD,OAAO,QAAQ,CAAC,KAAK,CAAC;AACvB,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { NotionPropertyValue } from "../types";
2
+ export declare function resolveFiles(property: NotionPropertyValue): {
3
+ name: string;
4
+ url: string;
5
+ }[] | null;
6
+ //# sourceMappingURL=files.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../../../../../src/client/database/query/response/files.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAGpD,wBAAgB,YAAY,CAAC,QAAQ,EAAE,mBAAmB;;;WAKzD"}
@@ -0,0 +1,8 @@
1
+ import { resolveFilesValue } from "./shared.js";
2
+ export function resolveFiles(property) {
3
+ if (property.type !== "files") {
4
+ return null;
5
+ }
6
+ return resolveFilesValue(property.files);
7
+ }
8
+ //# sourceMappingURL=files.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"files.js","sourceRoot":"","sources":["../../../../../../src/client/database/query/response/files.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,MAAM,UAAU,YAAY,CAAC,QAA6B;IACzD,IAAI,QAAQ,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;QAC/B,OAAO,IAAI,CAAC;IACb,CAAC;IACD,OAAO,iBAAiB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC1C,CAAC"}
@@ -0,0 +1,53 @@
1
+ import type { SupportedNotionColumnType } from "../../types";
2
+ import type { NotionPropertyValue } from "../types";
3
+ import { resolveCheckbox } from "./checkbox";
4
+ import { resolveCreatedBy } from "./created_by";
5
+ import { resolveCreatedTime } from "./created_time";
6
+ import { resolveDate } from "./date";
7
+ import { resolveEmail } from "./email";
8
+ import { resolveFiles } from "./files";
9
+ import { resolveLastEditedBy } from "./last_edited_by";
10
+ import { resolveLastEditedTime } from "./last_edited_time";
11
+ import { resolveMultiSelect } from "./multi_select";
12
+ import { resolveNumber } from "./number";
13
+ import { resolvePeople } from "./people";
14
+ import { resolvePhoneNumber } from "./phone_number";
15
+ import { resolveRelation } from "./relation";
16
+ import { resolveRichText } from "./rich_text";
17
+ import { resolveSelect } from "./select";
18
+ import { resolveStatus } from "./status";
19
+ import { resolveTitle } from "./title";
20
+ import { resolveUniqueId } from "./unique_id";
21
+ import { resolveUrl } from "./url";
22
+ export declare const simplifiedPropertyValueTransformers: {
23
+ readonly files: typeof resolveFiles;
24
+ readonly people: typeof resolvePeople;
25
+ readonly relation: typeof resolveRelation;
26
+ readonly created_by: typeof resolveCreatedBy;
27
+ readonly last_edited_by: typeof resolveLastEditedBy;
28
+ readonly created_time: typeof resolveCreatedTime;
29
+ readonly last_edited_time: typeof resolveLastEditedTime;
30
+ readonly url: typeof resolveUrl;
31
+ readonly phone_number: typeof resolvePhoneNumber;
32
+ readonly title: typeof resolveTitle;
33
+ readonly email: typeof resolveEmail;
34
+ readonly checkbox: typeof resolveCheckbox;
35
+ readonly date: typeof resolveDate;
36
+ readonly multi_select: typeof resolveMultiSelect;
37
+ readonly status: typeof resolveStatus;
38
+ readonly number: typeof resolveNumber;
39
+ readonly rich_text: typeof resolveRichText;
40
+ readonly select: typeof resolveSelect;
41
+ readonly unique_id: typeof resolveUniqueId;
42
+ };
43
+ export declare function getSimplifiedResult(args: {
44
+ columnType: SupportedNotionColumnType;
45
+ propertyValue: NotionPropertyValue;
46
+ }): string | number | boolean | string[] | {
47
+ name: string;
48
+ url: string;
49
+ }[] | {
50
+ start: string;
51
+ end: string | undefined;
52
+ } | null;
53
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/client/database/query/response/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,KAAK,EAAE,mBAAmB,EAAoB,MAAM,UAAU,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;CAoBwB,CAAC;AAEzE,wBAAgB,mBAAmB,CAAC,IAAI,EAAE;IACzC,UAAU,EAAE,yBAAyB,CAAC;IACtC,aAAa,EAAE,mBAAmB,CAAC;CACnC;;;;;;SAIA"}
@@ -0,0 +1,44 @@
1
+ import { resolveCheckbox } from "./checkbox.js";
2
+ import { resolveCreatedBy } from "./created_by.js";
3
+ import { resolveCreatedTime } from "./created_time.js";
4
+ import { resolveDate } from "./date.js";
5
+ import { resolveEmail } from "./email.js";
6
+ import { resolveFiles } from "./files.js";
7
+ import { resolveLastEditedBy } from "./last_edited_by.js";
8
+ import { resolveLastEditedTime } from "./last_edited_time.js";
9
+ import { resolveMultiSelect } from "./multi_select.js";
10
+ import { resolveNumber } from "./number.js";
11
+ import { resolvePeople } from "./people.js";
12
+ import { resolvePhoneNumber } from "./phone_number.js";
13
+ import { resolveRelation } from "./relation.js";
14
+ import { resolveRichText } from "./rich_text.js";
15
+ import { resolveSelect } from "./select.js";
16
+ import { resolveStatus } from "./status.js";
17
+ import { resolveTitle } from "./title.js";
18
+ import { resolveUniqueId } from "./unique_id.js";
19
+ import { resolveUrl } from "./url.js";
20
+ export const simplifiedPropertyValueTransformers = {
21
+ files: resolveFiles,
22
+ people: resolvePeople,
23
+ relation: resolveRelation,
24
+ created_by: resolveCreatedBy,
25
+ last_edited_by: resolveLastEditedBy,
26
+ created_time: resolveCreatedTime,
27
+ last_edited_time: resolveLastEditedTime,
28
+ url: resolveUrl,
29
+ phone_number: resolvePhoneNumber,
30
+ title: resolveTitle,
31
+ email: resolveEmail,
32
+ checkbox: resolveCheckbox,
33
+ date: resolveDate,
34
+ multi_select: resolveMultiSelect,
35
+ status: resolveStatus,
36
+ number: resolveNumber,
37
+ rich_text: resolveRichText,
38
+ select: resolveSelect,
39
+ unique_id: resolveUniqueId,
40
+ };
41
+ export function getSimplifiedResult(args) {
42
+ return simplifiedPropertyValueTransformers[args.columnType](args.propertyValue);
43
+ }
44
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/client/database/query/response/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,MAAM,CAAC,MAAM,mCAAmC,GAAG;IAClD,KAAK,EAAE,YAAY;IACnB,MAAM,EAAE,aAAa;IACrB,QAAQ,EAAE,eAAe;IACzB,UAAU,EAAE,gBAAgB;IAC5B,cAAc,EAAE,mBAAmB;IACnC,YAAY,EAAE,kBAAkB;IAChC,gBAAgB,EAAE,qBAAqB;IACvC,GAAG,EAAE,UAAU;IACf,YAAY,EAAE,kBAAkB;IAChC,KAAK,EAAE,YAAY;IACnB,KAAK,EAAE,YAAY;IACnB,QAAQ,EAAE,eAAe;IACzB,IAAI,EAAE,WAAW;IACjB,YAAY,EAAE,kBAAkB;IAChC,MAAM,EAAE,aAAa;IACrB,MAAM,EAAE,aAAa;IACrB,SAAS,EAAE,eAAe;IAC1B,MAAM,EAAE,aAAa;IACrB,SAAS,EAAE,eAAe;CAC6C,CAAC;AAEzE,MAAM,UAAU,mBAAmB,CAAC,IAGnC;IACA,OAAO,mCAAmC,CAAC,IAAI,CAAC,UAAU,CAAC,CAC1D,IAAI,CAAC,aAAa,CAClB,CAAC;AACH,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { NotionPropertyValue } from "../types";
2
+ export declare function resolveLastEditedBy(property: NotionPropertyValue): string | null;
3
+ //# sourceMappingURL=last_edited_by.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"last_edited_by.d.ts","sourceRoot":"","sources":["../../../../../../src/client/database/query/response/last_edited_by.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAGpD,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,mBAAmB,iBAKhE"}
@@ -0,0 +1,8 @@
1
+ import { resolveUserNameOrId } from "./shared.js";
2
+ export function resolveLastEditedBy(property) {
3
+ if (property.type !== "last_edited_by") {
4
+ return null;
5
+ }
6
+ return resolveUserNameOrId(property.last_edited_by);
7
+ }
8
+ //# sourceMappingURL=last_edited_by.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"last_edited_by.js","sourceRoot":"","sources":["../../../../../../src/client/database/query/response/last_edited_by.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE/C,MAAM,UAAU,mBAAmB,CAAC,QAA6B;IAChE,IAAI,QAAQ,CAAC,IAAI,KAAK,gBAAgB,EAAE,CAAC;QACxC,OAAO,IAAI,CAAC;IACb,CAAC;IACD,OAAO,mBAAmB,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;AACrD,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { NotionPropertyValue } from "../types";
2
+ export declare function resolveLastEditedTime(property: NotionPropertyValue): string | null;
3
+ //# sourceMappingURL=last_edited_time.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"last_edited_time.d.ts","sourceRoot":"","sources":["../../../../../../src/client/database/query/response/last_edited_time.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAEpD,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,mBAAmB,iBAKlE"}
@@ -0,0 +1,7 @@
1
+ export function resolveLastEditedTime(property) {
2
+ if (property.type !== "last_edited_time") {
3
+ return null;
4
+ }
5
+ return property.last_edited_time ?? null;
6
+ }
7
+ //# sourceMappingURL=last_edited_time.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"last_edited_time.js","sourceRoot":"","sources":["../../../../../../src/client/database/query/response/last_edited_time.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,qBAAqB,CAAC,QAA6B;IAClE,IAAI,QAAQ,CAAC,IAAI,KAAK,kBAAkB,EAAE,CAAC;QAC1C,OAAO,IAAI,CAAC;IACb,CAAC;IACD,OAAO,QAAQ,CAAC,gBAAgB,IAAI,IAAI,CAAC;AAC1C,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { NotionPropertyValue } from "../types";
2
+ export declare function resolveMultiSelect(property: NotionPropertyValue): string[] | null;
3
+ //# sourceMappingURL=multi_select.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"multi_select.d.ts","sourceRoot":"","sources":["../../../../../../src/client/database/query/response/multi_select.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAEpD,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,mBAAmB,mBAU/D"}
@@ -0,0 +1,10 @@
1
+ export function resolveMultiSelect(property) {
2
+ if (property.type !== "multi_select") {
3
+ return null;
4
+ }
5
+ if (!property.multi_select) {
6
+ return null;
7
+ }
8
+ return property.multi_select.map(({ name }) => name);
9
+ }
10
+ //# sourceMappingURL=multi_select.js.map