@party-stack/ontology 0.19.0 → 0.19.1

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 (402) hide show
  1. package/lib/OntologyPullConfig.d.ts +15 -13
  2. package/lib/OntologyPullConfig.d.ts.map +1 -1
  3. package/lib/OntologyPullConfig.js +0 -1
  4. package/lib/_virtual/_rolldown/runtime.js +13 -0
  5. package/lib/cli/format.d.ts +4 -0
  6. package/lib/cli/format.d.ts.map +1 -0
  7. package/lib/cli/format.js +19 -0
  8. package/lib/cli/format.js.map +1 -0
  9. package/lib/cli/generate.d.ts +6 -5
  10. package/lib/cli/generate.d.ts.map +1 -1
  11. package/lib/cli/generate.js +86 -110
  12. package/lib/cli/generate.js.map +1 -1
  13. package/lib/cli/index.d.ts +1 -3
  14. package/lib/cli/index.js +42 -59
  15. package/lib/cli/index.js.map +1 -1
  16. package/lib/cli/pull.d.ts +3 -1
  17. package/lib/cli/pull.d.ts.map +1 -1
  18. package/lib/cli/pull.js +42 -60
  19. package/lib/cli/pull.js.map +1 -1
  20. package/lib/examples/blog.d.ts +347 -345
  21. package/lib/examples/blog.d.ts.map +1 -1
  22. package/lib/examples/blog.js +350 -337
  23. package/lib/examples/blog.js.map +1 -1
  24. package/lib/examples/blog.live-queries.d.ts +8 -3
  25. package/lib/examples/blog.live-queries.d.ts.map +1 -1
  26. package/lib/examples/blog.live-queries.js +28 -44
  27. package/lib/examples/blog.live-queries.js.map +1 -1
  28. package/lib/examples/generated/constants.d.ts +1 -2
  29. package/lib/examples/generated/constants.js +0 -2
  30. package/lib/examples/generated/live.d.ts +5 -3
  31. package/lib/examples/generated/live.d.ts.map +1 -1
  32. package/lib/examples/generated/live.js +12 -8
  33. package/lib/examples/generated/live.js.map +1 -1
  34. package/lib/examples/generated/types.d.ts +52 -50
  35. package/lib/examples/generated/types.d.ts.map +1 -1
  36. package/lib/examples/generated/types.js +0 -2
  37. package/lib/generate/builders.d.ts +8 -5
  38. package/lib/generate/builders.d.ts.map +1 -1
  39. package/lib/generate/builders.js +53 -55
  40. package/lib/generate/builders.js.map +1 -1
  41. package/lib/generate/constants.d.ts +3 -1
  42. package/lib/generate/constants.d.ts.map +1 -1
  43. package/lib/generate/constants.js +23 -26
  44. package/lib/generate/constants.js.map +1 -1
  45. package/lib/generate/index.d.ts +6 -6
  46. package/lib/generate/index.js +6 -6
  47. package/lib/generate/live.d.ts +8 -6
  48. package/lib/generate/live.d.ts.map +1 -1
  49. package/lib/generate/live.js +43 -42
  50. package/lib/generate/live.js.map +1 -1
  51. package/lib/generate/ontology.d.ts +4 -2
  52. package/lib/generate/ontology.d.ts.map +1 -1
  53. package/lib/generate/ontology.js +453 -354
  54. package/lib/generate/ontology.js.map +1 -1
  55. package/lib/generate/types.d.ts +7 -6
  56. package/lib/generate/types.d.ts.map +1 -1
  57. package/lib/generate/types.js +190 -262
  58. package/lib/generate/types.js.map +1 -1
  59. package/lib/generate/utils/buildJsDocs.d.ts +7 -4
  60. package/lib/generate/utils/buildJsDocs.d.ts.map +1 -1
  61. package/lib/generate/utils/buildJsDocs.js +14 -10
  62. package/lib/generate/utils/buildJsDocs.js.map +1 -1
  63. package/lib/index.d.ts +30 -13
  64. package/lib/index.js +18 -10
  65. package/lib/infer.d.ts +129 -152
  66. package/lib/infer.d.ts.map +1 -1
  67. package/lib/infer.js +10 -6
  68. package/lib/infer.js.map +1 -1
  69. package/lib/installation/createMetaOntologyConfiguration.d.ts +6 -3
  70. package/lib/installation/createMetaOntologyConfiguration.d.ts.map +1 -1
  71. package/lib/installation/createMetaOntologyConfiguration.js +13 -11
  72. package/lib/installation/createMetaOntologyConfiguration.js.map +1 -1
  73. package/lib/installation/createOntologyBackendInstallation.d.ts +3 -1
  74. package/lib/installation/createOntologyBackendInstallation.d.ts.map +1 -1
  75. package/lib/installation/createOntologyBackendInstallation.js +205 -268
  76. package/lib/installation/createOntologyBackendInstallation.js.map +1 -1
  77. package/lib/installation/index.d.ts +4 -4
  78. package/lib/installation/index.js +3 -3
  79. package/lib/installation/types.d.ts +83 -80
  80. package/lib/installation/types.d.ts.map +1 -1
  81. package/lib/installation/types.js +0 -1
  82. package/lib/ir/generated/builders.d.ts +294 -382
  83. package/lib/ir/generated/builders.d.ts.map +1 -1
  84. package/lib/ir/generated/builders.js +180 -119
  85. package/lib/ir/generated/builders.js.map +1 -1
  86. package/lib/ir/generated/constants.d.ts +137 -135
  87. package/lib/ir/generated/constants.d.ts.map +1 -1
  88. package/lib/ir/generated/constants.js +162 -129
  89. package/lib/ir/generated/constants.js.map +1 -1
  90. package/lib/ir/generated/types.d.ts +239 -234
  91. package/lib/ir/generated/types.d.ts.map +1 -1
  92. package/lib/ir/generated/types.js +0 -2
  93. package/lib/ir/index.d.ts +4 -4
  94. package/lib/ir/index.js +3 -4
  95. package/lib/ir/schema.d.ts +2174 -2172
  96. package/lib/ir/schema.d.ts.map +1 -1
  97. package/lib/ir/schema.js +1184 -1343
  98. package/lib/ir/schema.js.map +1 -1
  99. package/lib/ir/validate.d.ts +5 -3
  100. package/lib/ir/validate.d.ts.map +1 -1
  101. package/lib/ir/validate.js +589 -707
  102. package/lib/ir/validate.js.map +1 -1
  103. package/lib/json/index.d.ts +10 -8
  104. package/lib/json/index.d.ts.map +1 -1
  105. package/lib/json/index.js +101 -135
  106. package/lib/json/index.js.map +1 -1
  107. package/lib/lenses.d.ts +7 -4
  108. package/lib/lenses.d.ts.map +1 -1
  109. package/lib/lenses.js +96 -132
  110. package/lib/lenses.js.map +1 -1
  111. package/lib/live/LiveOntology.d.ts +55 -60
  112. package/lib/live/LiveOntology.d.ts.map +1 -1
  113. package/lib/live/LiveOntology.js +98 -124
  114. package/lib/live/LiveOntology.js.map +1 -1
  115. package/lib/live/OntologyBackendAdapter.d.ts +79 -76
  116. package/lib/live/OntologyBackendAdapter.d.ts.map +1 -1
  117. package/lib/live/OntologyBackendAdapter.js +0 -1
  118. package/lib/live/actions/createLiveOntologyAction.d.ts +27 -24
  119. package/lib/live/actions/createLiveOntologyAction.d.ts.map +1 -1
  120. package/lib/live/actions/createLiveOntologyAction.js +24 -21
  121. package/lib/live/actions/createLiveOntologyAction.js.map +1 -1
  122. package/lib/live/actions/createLiveOntologyActions.d.ts +23 -20
  123. package/lib/live/actions/createLiveOntologyActions.d.ts.map +1 -1
  124. package/lib/live/actions/createLiveOntologyActions.js +131 -161
  125. package/lib/live/actions/createLiveOntologyActions.js.map +1 -1
  126. package/lib/live/actions/prepareActionParameters.d.ts +14 -11
  127. package/lib/live/actions/prepareActionParameters.d.ts.map +1 -1
  128. package/lib/live/actions/prepareActionParameters.js +190 -228
  129. package/lib/live/actions/prepareActionParameters.js.map +1 -1
  130. package/lib/live/attachments/attachmentSources.d.ts +7 -4
  131. package/lib/live/attachments/attachmentSources.d.ts.map +1 -1
  132. package/lib/live/attachments/attachmentSources.js +55 -71
  133. package/lib/live/attachments/attachmentSources.js.map +1 -1
  134. package/lib/live/attachments/createLiveOntologyAttachments.d.ts +47 -45
  135. package/lib/live/attachments/createLiveOntologyAttachments.d.ts.map +1 -1
  136. package/lib/live/attachments/createLiveOntologyAttachments.js +65 -83
  137. package/lib/live/attachments/createLiveOntologyAttachments.js.map +1 -1
  138. package/lib/live/attachments/types.d.ts +10 -9
  139. package/lib/live/attachments/types.d.ts.map +1 -1
  140. package/lib/live/attachments/types.js +0 -1
  141. package/lib/live/attachments/unsupportedOntologyAttachmentsAdapter.d.ts +3 -1
  142. package/lib/live/attachments/unsupportedOntologyAttachmentsAdapter.d.ts.map +1 -1
  143. package/lib/live/attachments/unsupportedOntologyAttachmentsAdapter.js +5 -3
  144. package/lib/live/attachments/unsupportedOntologyAttachmentsAdapter.js.map +1 -1
  145. package/lib/live/expression.d.ts +16 -14
  146. package/lib/live/expression.d.ts.map +1 -1
  147. package/lib/live/expression.js +142 -223
  148. package/lib/live/expression.js.map +1 -1
  149. package/lib/live/index.d.ts +12 -9
  150. package/lib/live/index.js +6 -8
  151. package/lib/live/mutators/OntologyEdits.d.ts +12 -9
  152. package/lib/live/mutators/OntologyEdits.d.ts.map +1 -1
  153. package/lib/live/mutators/OntologyEdits.js +57 -74
  154. package/lib/live/mutators/OntologyEdits.js.map +1 -1
  155. package/lib/live/mutators/createMutatorTx.d.ts +7 -5
  156. package/lib/live/mutators/createMutatorTx.d.ts.map +1 -1
  157. package/lib/live/mutators/createMutatorTx.js +53 -69
  158. package/lib/live/mutators/createMutatorTx.js.map +1 -1
  159. package/lib/live/mutators/runOptimisticAction.d.ts +16 -13
  160. package/lib/live/mutators/runOptimisticAction.d.ts.map +1 -1
  161. package/lib/live/mutators/runOptimisticAction.js +26 -26
  162. package/lib/live/mutators/runOptimisticAction.js.map +1 -1
  163. package/lib/live/mutators/types.d.ts +18 -16
  164. package/lib/live/mutators/types.d.ts.map +1 -1
  165. package/lib/live/mutators/types.js +0 -1
  166. package/lib/live/objects/OntologyObject.d.ts +2 -0
  167. package/lib/live/objects/OntologyObject.d.ts.map +1 -1
  168. package/lib/live/objects/OntologyObject.js +0 -1
  169. package/lib/live/objects/createLiveOntologyObjectCollection.d.ts +13 -10
  170. package/lib/live/objects/createLiveOntologyObjectCollection.d.ts.map +1 -1
  171. package/lib/live/objects/createLiveOntologyObjectCollection.js +48 -49
  172. package/lib/live/objects/createLiveOntologyObjectCollection.js.map +1 -1
  173. package/lib/live/objects/ontologyObjectCollectionId.d.ts +2 -0
  174. package/lib/live/objects/ontologyObjectCollectionId.d.ts.map +1 -1
  175. package/lib/live/objects/ontologyObjectCollectionId.js +6 -2
  176. package/lib/live/objects/ontologyObjectCollectionId.js.map +1 -1
  177. package/lib/live/outbox/createOntologyOutbox.d.ts +16 -14
  178. package/lib/live/outbox/createOntologyOutbox.d.ts.map +1 -1
  179. package/lib/live/outbox/createOntologyOutbox.js +275 -326
  180. package/lib/live/outbox/createOntologyOutbox.js.map +1 -1
  181. package/lib/live/outbox/leaderExecutor.d.ts +15 -13
  182. package/lib/live/outbox/leaderExecutor.d.ts.map +1 -1
  183. package/lib/live/outbox/leaderExecutor.js +114 -153
  184. package/lib/live/outbox/leaderExecutor.js.map +1 -1
  185. package/lib/live/outbox/outboxService.d.ts +4 -2
  186. package/lib/live/outbox/outboxService.d.ts.map +1 -1
  187. package/lib/live/outbox/outboxService.js +66 -71
  188. package/lib/live/outbox/outboxService.js.map +1 -1
  189. package/lib/live/outbox/projectionManager.d.ts +26 -24
  190. package/lib/live/outbox/projectionManager.d.ts.map +1 -1
  191. package/lib/live/outbox/projectionManager.js +121 -147
  192. package/lib/live/outbox/projectionManager.js.map +1 -1
  193. package/lib/live/outbox/repository.d.ts +27 -25
  194. package/lib/live/outbox/repository.d.ts.map +1 -1
  195. package/lib/live/outbox/repository.js +192 -241
  196. package/lib/live/outbox/repository.js.map +1 -1
  197. package/lib/live/outbox/service.d.ts +52 -50
  198. package/lib/live/outbox/service.d.ts.map +1 -1
  199. package/lib/live/outbox/service.js +5 -1
  200. package/lib/live/outbox/service.js.map +1 -1
  201. package/lib/live/outbox/types.d.ts +35 -33
  202. package/lib/live/outbox/types.d.ts.map +1 -1
  203. package/lib/live/outbox/types.js +10 -6
  204. package/lib/live/outbox/types.js.map +1 -1
  205. package/lib/live/waitForCollectionReady.d.ts +3 -1
  206. package/lib/live/waitForCollectionReady.d.ts.map +1 -1
  207. package/lib/live/waitForCollectionReady.js +44 -65
  208. package/lib/live/waitForCollectionReady.js.map +1 -1
  209. package/lib/meta/createLocalMetaOntologyBackendAdapter.d.ts +5 -2
  210. package/lib/meta/createLocalMetaOntologyBackendAdapter.d.ts.map +1 -1
  211. package/lib/meta/createLocalMetaOntologyBackendAdapter.js +37 -39
  212. package/lib/meta/createLocalMetaOntologyBackendAdapter.js.map +1 -1
  213. package/lib/meta/generated/constants.d.ts +137 -135
  214. package/lib/meta/generated/constants.d.ts.map +1 -1
  215. package/lib/meta/generated/constants.js +162 -129
  216. package/lib/meta/generated/constants.js.map +1 -1
  217. package/lib/meta/generated/live.d.ts +5 -2
  218. package/lib/meta/generated/live.d.ts.map +1 -1
  219. package/lib/meta/generated/live.js +12 -8
  220. package/lib/meta/generated/live.js.map +1 -1
  221. package/lib/meta/generated/types.d.ts +233 -231
  222. package/lib/meta/generated/types.d.ts.map +1 -1
  223. package/lib/meta/generated/types.js +0 -2
  224. package/lib/meta/ontology.d.ts +23 -21
  225. package/lib/meta/ontology.d.ts.map +1 -1
  226. package/lib/meta/ontology.js +100 -104
  227. package/lib/meta/ontology.js.map +1 -1
  228. package/lib/meta/pull.d.ts +8 -6
  229. package/lib/meta/pull.d.ts.map +1 -1
  230. package/lib/meta/pull.js +39 -52
  231. package/lib/meta/pull.js.map +1 -1
  232. package/lib/utils/index.d.ts +8 -8
  233. package/lib/utils/index.js +5 -6
  234. package/lib/utils/links.d.ts +34 -32
  235. package/lib/utils/links.d.ts.map +1 -1
  236. package/lib/utils/links.js +10 -17
  237. package/lib/utils/links.js.map +1 -1
  238. package/lib/utils/paths.d.ts +2 -0
  239. package/lib/utils/paths.d.ts.map +1 -1
  240. package/lib/utils/paths.js +32 -44
  241. package/lib/utils/paths.js.map +1 -1
  242. package/lib/utils/provide.d.ts +2 -0
  243. package/lib/utils/provide.d.ts.map +1 -1
  244. package/lib/utils/provide.js +7 -9
  245. package/lib/utils/provide.js.map +1 -1
  246. package/lib/utils/targets.d.ts +20 -18
  247. package/lib/utils/targets.d.ts.map +1 -1
  248. package/lib/utils/targets.js +0 -1
  249. package/lib/utils/typeNames.d.ts +10 -8
  250. package/lib/utils/typeNames.d.ts.map +1 -1
  251. package/lib/utils/typeNames.js +0 -1
  252. package/lib/utils/types.d.ts +6 -4
  253. package/lib/utils/types.d.ts.map +1 -1
  254. package/lib/utils/types.js +38 -38
  255. package/lib/utils/types.js.map +1 -1
  256. package/lib/utils/uncertain.d.ts +5 -3
  257. package/lib/utils/uncertain.d.ts.map +1 -1
  258. package/lib/utils/uncertain.js +11 -9
  259. package/lib/utils/uncertain.js.map +1 -1
  260. package/lib/utils/validation.d.ts +4 -2
  261. package/lib/utils/validation.d.ts.map +1 -1
  262. package/lib/utils/validation.js +0 -1
  263. package/lib/utils/values.d.ts +21 -18
  264. package/lib/utils/values.d.ts.map +1 -1
  265. package/lib/utils/values.js +0 -1
  266. package/package.json +19 -23
  267. package/lib/OntologyPullConfig.js.map +0 -1
  268. package/lib/cli/index.d.ts.map +0 -1
  269. package/lib/cli/index.test.d.ts +0 -2
  270. package/lib/cli/index.test.d.ts.map +0 -1
  271. package/lib/cli/index.test.js +0 -34
  272. package/lib/cli/index.test.js.map +0 -1
  273. package/lib/cli/pull.test.d.ts +0 -2
  274. package/lib/cli/pull.test.d.ts.map +0 -1
  275. package/lib/cli/pull.test.js +0 -125
  276. package/lib/cli/pull.test.js.map +0 -1
  277. package/lib/examples/generated/constants.d.ts.map +0 -1
  278. package/lib/examples/generated/constants.js.map +0 -1
  279. package/lib/examples/generated/types.js.map +0 -1
  280. package/lib/generate/builders.test.d.ts +0 -2
  281. package/lib/generate/builders.test.d.ts.map +0 -1
  282. package/lib/generate/builders.test.js +0 -49
  283. package/lib/generate/builders.test.js.map +0 -1
  284. package/lib/generate/index.d.ts.map +0 -1
  285. package/lib/generate/index.js.map +0 -1
  286. package/lib/generate/live.test.d.ts +0 -2
  287. package/lib/generate/live.test.d.ts.map +0 -1
  288. package/lib/generate/live.test.js +0 -22
  289. package/lib/generate/live.test.js.map +0 -1
  290. package/lib/generate/ontology.test.d.ts +0 -2
  291. package/lib/generate/ontology.test.d.ts.map +0 -1
  292. package/lib/generate/ontology.test.js +0 -157
  293. package/lib/generate/ontology.test.js.map +0 -1
  294. package/lib/generate/types.test.d.ts +0 -2
  295. package/lib/generate/types.test.d.ts.map +0 -1
  296. package/lib/generate/types.test.js +0 -304
  297. package/lib/generate/types.test.js.map +0 -1
  298. package/lib/index.d.ts.map +0 -1
  299. package/lib/index.js.map +0 -1
  300. package/lib/infer.test.d.ts +0 -2
  301. package/lib/infer.test.d.ts.map +0 -1
  302. package/lib/infer.test.js +0 -125
  303. package/lib/infer.test.js.map +0 -1
  304. package/lib/installation/createMetaOntologyConfiguration.test.d.ts +0 -2
  305. package/lib/installation/createMetaOntologyConfiguration.test.d.ts.map +0 -1
  306. package/lib/installation/createMetaOntologyConfiguration.test.js +0 -20
  307. package/lib/installation/createMetaOntologyConfiguration.test.js.map +0 -1
  308. package/lib/installation/createOntologyBackendInstallation.test.d.ts +0 -2
  309. package/lib/installation/createOntologyBackendInstallation.test.d.ts.map +0 -1
  310. package/lib/installation/createOntologyBackendInstallation.test.js +0 -320
  311. package/lib/installation/createOntologyBackendInstallation.test.js.map +0 -1
  312. package/lib/installation/index.d.ts.map +0 -1
  313. package/lib/installation/index.js.map +0 -1
  314. package/lib/installation/types.js.map +0 -1
  315. package/lib/ir/generated/types.js.map +0 -1
  316. package/lib/ir/index.d.ts.map +0 -1
  317. package/lib/ir/index.js.map +0 -1
  318. package/lib/ir/validate.test.d.ts +0 -2
  319. package/lib/ir/validate.test.d.ts.map +0 -1
  320. package/lib/ir/validate.test.js +0 -1061
  321. package/lib/ir/validate.test.js.map +0 -1
  322. package/lib/json/index.test.d.ts +0 -2
  323. package/lib/json/index.test.d.ts.map +0 -1
  324. package/lib/json/index.test.js +0 -142
  325. package/lib/json/index.test.js.map +0 -1
  326. package/lib/lenses.test.d.ts +0 -2
  327. package/lib/lenses.test.d.ts.map +0 -1
  328. package/lib/lenses.test.js +0 -80
  329. package/lib/lenses.test.js.map +0 -1
  330. package/lib/live/LiveOntology.test.d.ts +0 -2
  331. package/lib/live/LiveOntology.test.d.ts.map +0 -1
  332. package/lib/live/LiveOntology.test.js +0 -507
  333. package/lib/live/LiveOntology.test.js.map +0 -1
  334. package/lib/live/OntologyBackendAdapter.js.map +0 -1
  335. package/lib/live/actions/createLiveOntologyAction.test.d.ts +0 -2
  336. package/lib/live/actions/createLiveOntologyAction.test.d.ts.map +0 -1
  337. package/lib/live/actions/createLiveOntologyAction.test.js +0 -232
  338. package/lib/live/actions/createLiveOntologyAction.test.js.map +0 -1
  339. package/lib/live/actions/prepareActionParameters.test.d.ts +0 -2
  340. package/lib/live/actions/prepareActionParameters.test.d.ts.map +0 -1
  341. package/lib/live/actions/prepareActionParameters.test.js +0 -165
  342. package/lib/live/actions/prepareActionParameters.test.js.map +0 -1
  343. package/lib/live/attachments/attachmentMetadata.test.d.ts +0 -2
  344. package/lib/live/attachments/attachmentMetadata.test.d.ts.map +0 -1
  345. package/lib/live/attachments/attachmentMetadata.test.js +0 -73
  346. package/lib/live/attachments/attachmentMetadata.test.js.map +0 -1
  347. package/lib/live/attachments/createLiveOntologyAttachments.test.d.ts +0 -2
  348. package/lib/live/attachments/createLiveOntologyAttachments.test.d.ts.map +0 -1
  349. package/lib/live/attachments/createLiveOntologyAttachments.test.js +0 -363
  350. package/lib/live/attachments/createLiveOntologyAttachments.test.js.map +0 -1
  351. package/lib/live/attachments/types.js.map +0 -1
  352. package/lib/live/expression.test.d.ts +0 -2
  353. package/lib/live/expression.test.d.ts.map +0 -1
  354. package/lib/live/expression.test.js +0 -311
  355. package/lib/live/expression.test.js.map +0 -1
  356. package/lib/live/index.d.ts.map +0 -1
  357. package/lib/live/index.js.map +0 -1
  358. package/lib/live/mutators/OntologyEdits.test.d.ts +0 -2
  359. package/lib/live/mutators/OntologyEdits.test.d.ts.map +0 -1
  360. package/lib/live/mutators/OntologyEdits.test.js +0 -85
  361. package/lib/live/mutators/OntologyEdits.test.js.map +0 -1
  362. package/lib/live/mutators/createMutatorTx.test.d.ts +0 -2
  363. package/lib/live/mutators/createMutatorTx.test.d.ts.map +0 -1
  364. package/lib/live/mutators/createMutatorTx.test.js +0 -180
  365. package/lib/live/mutators/createMutatorTx.test.js.map +0 -1
  366. package/lib/live/mutators/types.js.map +0 -1
  367. package/lib/live/objects/OntologyObject.js.map +0 -1
  368. package/lib/live/objects/createLiveOntologyObjectCollection.test.d.ts +0 -2
  369. package/lib/live/objects/createLiveOntologyObjectCollection.test.d.ts.map +0 -1
  370. package/lib/live/objects/createLiveOntologyObjectCollection.test.js +0 -310
  371. package/lib/live/objects/createLiveOntologyObjectCollection.test.js.map +0 -1
  372. package/lib/live/outbox/createOntologyOutbox.test.d.ts +0 -2
  373. package/lib/live/outbox/createOntologyOutbox.test.d.ts.map +0 -1
  374. package/lib/live/outbox/createOntologyOutbox.test.js +0 -1030
  375. package/lib/live/outbox/createOntologyOutbox.test.js.map +0 -1
  376. package/lib/meta/generated/types.js.map +0 -1
  377. package/lib/meta/ontology.test.d.ts +0 -2
  378. package/lib/meta/ontology.test.d.ts.map +0 -1
  379. package/lib/meta/ontology.test.js +0 -84
  380. package/lib/meta/ontology.test.js.map +0 -1
  381. package/lib/utils/index.d.ts.map +0 -1
  382. package/lib/utils/index.js.map +0 -1
  383. package/lib/utils/links.test.d.ts +0 -2
  384. package/lib/utils/links.test.d.ts.map +0 -1
  385. package/lib/utils/links.test.js +0 -109
  386. package/lib/utils/links.test.js.map +0 -1
  387. package/lib/utils/paths.test.d.ts +0 -2
  388. package/lib/utils/paths.test.d.ts.map +0 -1
  389. package/lib/utils/paths.test.js +0 -33
  390. package/lib/utils/paths.test.js.map +0 -1
  391. package/lib/utils/targets.js.map +0 -1
  392. package/lib/utils/typeNames.js.map +0 -1
  393. package/lib/utils/types.test.d.ts +0 -2
  394. package/lib/utils/types.test.d.ts.map +0 -1
  395. package/lib/utils/types.test.js +0 -157
  396. package/lib/utils/types.test.js.map +0 -1
  397. package/lib/utils/uncertain.test.d.ts +0 -2
  398. package/lib/utils/uncertain.test.d.ts.map +0 -1
  399. package/lib/utils/uncertain.test.js +0 -14
  400. package/lib/utils/uncertain.test.js.map +0 -1
  401. package/lib/utils/validation.js.map +0 -1
  402. package/lib/utils/values.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/generate/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,OAAO,EAAuB,MAAM,UAAU,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AG,eAAe,OAAO,aAAa,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC;AAChF,CAAC"}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../src/generate/types.ts"],"sourcesContent":["import { pascalCase } from \"change-case\";\nimport { CodeBlockWriter, Project, Writers, type WriterFunction } from \"ts-morph\";\nimport { ImageMediaTypeOptions } from \"../ir/generated/constants.js\";\nimport { unwrapType } from \"../utils/types.js\";\nimport { buildJsDocs } from \"./utils/buildJsDocs.js\";\nimport type {\n OntologyIR,\n ObjectTypeDef,\n StructTypeDef,\n TypeDef,\n UnionTypeDef,\n} from \"../ir/generated/types.js\";\n\nfunction withWriter(fn: WriterFunction): string {\n const writer = new CodeBlockWriter();\n fn(writer);\n return writer.toString();\n}\n\nfunction union(options: string[]): string {\n if (options.length === 0) {\n return \"never\";\n }\n if (options.length === 1) {\n return options[0]!;\n }\n return withWriter(Writers.unionType(options[0]!, options[1]!, ...options.slice(2)));\n}\n\nfunction renderPropertyName(name: string): string {\n return /^[$A-Z_][0-9A-Z_$]*$/i.test(name) ? name : JSON.stringify(name);\n}\n\nexport interface GenerateTypeDefinitionsOpts {\n valuesImportPath?: string;\n objectTypes?: ReadonlyMap<string, ObjectTypeDef>;\n}\n\ninterface GenerateTypeContext {\n objectTypes?: ReadonlyMap<string, ObjectTypeDef>;\n}\n\nexport function generateForTypeDef(type: TypeDef, ctx: GenerateTypeContext = {}): string {\n switch (type.kind) {\n case \"string\": {\n if (type.value.constraint?.kind === \"enum\") {\n const options = type.value.constraint.value.options;\n return union(options.map((option) => `\"${option.value}\"`));\n }\n return \"string\";\n }\n\n case \"boolean\":\n return \"boolean\";\n\n case \"integer\":\n return \"v.integer\";\n\n case \"float\":\n return \"v.float\";\n\n case \"double\":\n return \"v.double\";\n\n case \"date\":\n return \"v.date\";\n\n case \"timestamp\":\n return \"v.timestamp\";\n\n case \"geopoint\":\n return \"v.geopoint\";\n\n case \"attachment\": {\n const content = type.value.constraint?.content;\n if (content?.kind !== \"image\") return \"v.attachment\";\n const mediaTypes = content.value.mediaTypes;\n return mediaTypes\n ? `v.attachment<${union(mediaTypes.map((mediaType) => JSON.stringify(mediaType)))}>`\n : `v.attachment<${union(\n ImageMediaTypeOptions.map((option) => JSON.stringify(option.value))\n )}>`;\n }\n\n case \"objectReference\": {\n const objectType = ctx.objectTypes?.get(type.value.objectType);\n if (!objectType) {\n throw new Error(\n `Cannot generate object reference type for unknown object type \"${type.value.objectType}\".`\n );\n }\n const primaryKey = objectType?.properties.find(\n (property) => property.name === objectType.primaryKey\n );\n if (!primaryKey) {\n throw new Error(\n `Cannot generate object reference type for \"${type.value.objectType}\" because primary key \"${objectType.primaryKey}\" is not a property.`\n );\n }\n return generateForTypeDef(primaryKey.type, ctx);\n }\n\n case \"unknown\":\n return \"unknown\";\n\n case \"list\":\n return `Array<${generateForTypeDef(type.value.elementType, ctx)}>`;\n\n case \"map\":\n return `Record<string, ${generateForTypeDef(type.value.valueType, ctx)}>`;\n\n case \"struct\":\n return generateForStructTypeDef(type.value, ctx);\n\n case \"union\":\n return generateForUnionTypeDef(type.value, ctx);\n\n case \"optional\":\n return union([generateForTypeDef(type.value.type, ctx), \"undefined\"]);\n\n case \"result\":\n return `v.Result<${generateForTypeDef(type.value.okType, ctx)}, ${generateForTypeDef(type.value.errType, ctx)}>`;\n\n case \"ref\":\n return type.value.name;\n }\n}\n\nfunction generateForStructTypeDef(type: StructTypeDef, ctx: GenerateTypeContext): string {\n if (type.fields.length === 0) {\n return \"Record<never, never>\";\n }\n\n return withWriter(\n Writers.objectType({\n properties: type.fields.map((field) => {\n const { type: fieldType, isOptional } = unwrapType(field.type);\n return {\n name: renderPropertyName(field.name),\n type: generateForTypeDef(fieldType, ctx),\n hasQuestionToken: isOptional,\n docs: buildJsDocs({ description: field.description, deprecated: field.deprecated }),\n };\n }),\n })\n );\n}\n\nfunction generateForUnionTypeDef(type: UnionTypeDef, ctx: GenerateTypeContext): string {\n const innerType = withWriter(\n Writers.objectType({\n properties: type.variants.map((variant) => ({\n name: renderPropertyName(variant.name),\n type: generateForTypeDef(variant.type, ctx),\n })),\n })\n );\n return `v.Union<${innerType}>`;\n}\n\nfunction collectTypeDefinitions(ir: OntologyIR): Pick<OntologyIR, \"types\"> {\n return {\n types: [\n ...ir.types,\n ...ir.objectTypes.map((objectType) => ({\n name: objectType.name,\n description: objectType.description,\n deprecated: objectType.deprecated,\n type: {\n kind: \"struct\" as const,\n value: {\n fields: objectType.properties,\n },\n },\n })),\n ],\n };\n}\n\nexport function generateTypeDefinitions(\n schema: Pick<OntologyIR, \"types\">,\n opts: GenerateTypeDefinitionsOpts = {}\n): string {\n const project = new Project({ useInMemoryFileSystem: true });\n const sourceFile = project.createSourceFile(\"types.ts\", \"\");\n\n sourceFile.addImportDeclaration({\n moduleSpecifier: opts.valuesImportPath ?? \"@party-stack/ontology/values\",\n namespaceImport: \"v\",\n });\n\n for (const type of schema.types) {\n sourceFile.addTypeAlias({\n name: type.name,\n isExported: true,\n type: generateForTypeDef(type.type, { objectTypes: opts.objectTypes }),\n docs: buildJsDocs({ description: type.description, deprecated: type.deprecated }),\n });\n }\n\n const typeAliases = sourceFile.getTypeAliases();\n for (const alias of typeAliases.slice(0, -1)) {\n alias.appendWhitespace(\"\\n\");\n }\n\n return sourceFile.getFullText().trim();\n}\n\nexport interface GenerateTypesOpts {\n outputTypeName?: string;\n}\n\nfunction addOntologyAggregateType(\n sourceFile: import(\"ts-morph\").SourceFile,\n ir: OntologyIR,\n outputTypeName: string\n): void {\n const properties = [\n {\n name: \"context\",\n type: `${outputTypeName}Context`,\n },\n {\n name: \"objectTypes\",\n type:\n ir.objectTypes.length === 0\n ? \"Record<never, never>\"\n : Writers.objectType({\n properties: ir.objectTypes.map((objectType) => ({\n name: renderPropertyName(objectType.name),\n type: objectType.name,\n })),\n }),\n },\n ];\n\n properties.push({\n name: \"actionTypes\",\n type:\n ir.actionTypes.length === 0\n ? \"Record<never, never>\"\n : Writers.objectType({\n properties: ir.actionTypes.map((action) => ({\n name: renderPropertyName(action.name),\n type: Writers.objectType({\n properties: [\n {\n name: \"parameters\",\n type: `${pascalCase(action.name)}Parameters`,\n },\n ],\n }),\n })),\n }),\n });\n\n properties.push({\n name: \"queryFunctionTypes\",\n type:\n ir.queryFunctionTypes.length === 0\n ? \"Record<never, never>\"\n : Writers.objectType({\n properties: ir.queryFunctionTypes.map((queryFunctionType) => ({\n name: renderPropertyName(queryFunctionType.name),\n type: Writers.objectType({\n properties: [\n {\n name: \"parameters\",\n type: `${pascalCase(queryFunctionType.name)}Parameters`,\n },\n {\n name: \"returnType\",\n type: `${pascalCase(queryFunctionType.name)}Return`,\n },\n ],\n }),\n })),\n }),\n });\n\n sourceFile.addTypeAlias({\n name: outputTypeName,\n isExported: true,\n type: Writers.objectType({ properties }),\n });\n}\n\nfunction addOntologyContextType(\n sourceFile: import(\"ts-morph\").SourceFile,\n ir: OntologyIR,\n outputTypeName: string\n): void {\n const objectTypes = new Map(ir.objectTypes.map((objectType) => [objectType.name, objectType]));\n sourceFile.addTypeAlias({\n name: `${outputTypeName}Context`,\n isExported: true,\n type: ir.contextType\n ? `${generateForTypeDef(ir.contextType, {\n objectTypes,\n })} & Record<string, unknown>`\n : \"Record<string, unknown>\",\n });\n}\n\nfunction addActionParameterTypes(sourceFile: import(\"ts-morph\").SourceFile, ir: OntologyIR): void {\n const objectTypes = new Map(ir.objectTypes.map((objectType) => [objectType.name, objectType]));\n for (const actionType of ir.actionTypes) {\n sourceFile.addTypeAlias({\n name: `${pascalCase(actionType.name)}Parameters`,\n isExported: true,\n type: withWriter(\n Writers.objectType({\n properties: actionType.parameters.map((parameter) => {\n const parameterType = parameter.type;\n const isOptional = parameterType.kind === \"optional\";\n const type = isOptional ? parameterType.value.type : parameterType;\n const renderedType = generateForTypeDef(type, { objectTypes });\n return {\n name: renderPropertyName(parameter.name),\n type: isOptional ? union([renderedType, \"null\"]) : renderedType,\n hasQuestionToken: isOptional || parameter.defaultValue !== undefined,\n };\n }),\n })\n ),\n });\n }\n}\n\nfunction addQueryParameterTypes(sourceFile: import(\"ts-morph\").SourceFile, ir: OntologyIR): void {\n const objectTypes = new Map(ir.objectTypes.map((objectType) => [objectType.name, objectType]));\n for (const queryFunctionType of ir.queryFunctionTypes) {\n sourceFile.addTypeAlias({\n name: `${pascalCase(queryFunctionType.name)}Parameters`,\n isExported: true,\n type: withWriter(\n Writers.objectType({\n properties: queryFunctionType.parameters.map((parameter) => {\n const parameterType = parameter.type;\n const isOptional = parameterType.kind === \"optional\";\n const type = isOptional ? parameterType.value.type : parameterType;\n const renderedType = generateForTypeDef(type, { objectTypes });\n return {\n name: renderPropertyName(parameter.name),\n type: isOptional ? union([renderedType, \"undefined\"]) : renderedType,\n hasQuestionToken: isOptional,\n };\n }),\n })\n ),\n });\n sourceFile.addTypeAlias({\n name: `${pascalCase(queryFunctionType.name)}Return`,\n isExported: true,\n type: generateForTypeDef(queryFunctionType.returnType, { objectTypes }),\n docs: buildJsDocs({\n description: queryFunctionType.description,\n deprecated: queryFunctionType.deprecated,\n }),\n });\n }\n}\n\nexport function generateTypes(ir: OntologyIR, opts: GenerateTypesOpts = {}): string {\n const outputTypeName = opts.outputTypeName ?? \"GeneratedOntology\";\n const objectTypes = new Map(ir.objectTypes.map((objectType) => [objectType.name, objectType]));\n const typeDefinitions = generateTypeDefinitions(collectTypeDefinitions(ir), {\n objectTypes,\n });\n const project = new Project({ useInMemoryFileSystem: true });\n const aggregateFile = project.createSourceFile(\"ontology-aggregate.ts\", \"\");\n addOntologyContextType(aggregateFile, ir, outputTypeName);\n addActionParameterTypes(aggregateFile, ir);\n addQueryParameterTypes(aggregateFile, ir);\n addOntologyAggregateType(aggregateFile, ir, outputTypeName);\n return `${typeDefinitions}\\n\\n${aggregateFile.getFullText().trim()}`.trim();\n}\n"],"mappings":";;;;;;AAaA,SAAS,WAAW,IAA4B;CAC5C,MAAM,SAAS,IAAI,gBAAgB;CACnC,GAAG,MAA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cAAc,IAAgB,OAA0B,CAAC,GAAW;CAChF,MAAM,iBAAiB,KAAK,kBAAkB;CAC9C,MAAM,cAAc,IAAI,IAAI,GAAG,YAAY,KAAK,eAAe,CAAC,WAAW,MAAM,UAAU,CAAC,CAAC;CAC7F,MAAM,kBAAkB,wBAAwB,uBAAuB,EAAE,GAAG,EACxE,YACJ,CAAC;CAED,MAAM,gBAAgB,IADF,QAAQ,EAAE,uBAAuB,KAAK,CAC9B,CAAC,CAAC,iBAAiB,yBAAyB,EAAE;CAC1E,uBAAuB,eAAe,IAAI,cAAc;CACxD,wBAAwB,eAAe,EAAE;CACzC,uBAAuB,eAAe,EAAE;CACxC,yBAAyB,eAAe,IAAI,cAAc;CAC1D,OAAO,GAAG,gBAAgB,MAAM,cAAc,YAAY,CAAC,CAAC,KAAK,IAAI,KAAK;AAC9E"}
@@ -1,7 +1,10 @@
1
- import type { Deprecation } from "../../ir/index.js";
2
- import type { JSDocStructure, OptionalKind } from "ts-morph";
1
+ import { Deprecation } from "../../ir/generated/types.js";
2
+ import "../../ir/index.js";
3
+ import { JSDocStructure, OptionalKind } from "ts-morph";
4
+ //#region src/generate/utils/buildJsDocs.d.ts
3
5
  export declare function buildJsDocs(opts: {
4
- description?: string;
5
- deprecated?: Deprecation;
6
+ description?: string;
7
+ deprecated?: Deprecation;
6
8
  }): OptionalKind<JSDocStructure>[] | undefined;
9
+ //#endregion
7
10
  //# sourceMappingURL=buildJsDocs.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"buildJsDocs.d.ts","sourceRoot":"","sources":["../../../src/generate/utils/buildJsDocs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7D,wBAAgB,WAAW,CAAC,IAAI,EAAE;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,WAAW,CAAC;CAC5B,GAAG,YAAY,CAAC,cAAc,CAAC,EAAE,GAAG,SAAS,CAU7C"}
1
+ {"version":3,"file":"buildJsDocs.d.ts","names":[],"sources":["../../../src/generate/utils/buildJsDocs.ts"],"mappings":";;;;wBAGgB,YAAY;EACxB;EACA,aAAa;IACb,aAAa"}
@@ -1,12 +1,16 @@
1
- export function buildJsDocs(opts) {
2
- const { description, deprecated } = opts;
3
- if (!description && !deprecated)
4
- return undefined;
5
- return [
6
- {
7
- description,
8
- tags: deprecated ? [{ tagName: "deprecated", text: deprecated.message }] : undefined,
9
- },
10
- ];
1
+ //#region src/generate/utils/buildJsDocs.ts
2
+ function buildJsDocs(opts) {
3
+ const { description, deprecated } = opts;
4
+ if (!description && !deprecated) return void 0;
5
+ return [{
6
+ description,
7
+ tags: deprecated ? [{
8
+ tagName: "deprecated",
9
+ text: deprecated.message
10
+ }] : void 0
11
+ }];
11
12
  }
13
+ //#endregion
14
+ export { buildJsDocs };
15
+
12
16
  //# sourceMappingURL=buildJsDocs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"buildJsDocs.js","sourceRoot":"","sources":["../../../src/generate/utils/buildJsDocs.ts"],"names":[],"mappings":"AAGA,MAAM,UAAU,WAAW,CAAC,IAG3B;IACG,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC;IACzC,IAAI,CAAC,WAAW,IAAI,CAAC,UAAU;QAAE,OAAO,SAAS,CAAC;IAElD,OAAO;QACH;YACI,WAAW;YACX,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS;SACvF;KACJ,CAAC;AACN,CAAC"}
1
+ {"version":3,"file":"buildJsDocs.js","names":[],"sources":["../../../src/generate/utils/buildJsDocs.ts"],"sourcesContent":["import type { Deprecation } from \"../../ir/index.js\";\nimport type { JSDocStructure, OptionalKind } from \"ts-morph\";\n\nexport function buildJsDocs(opts: {\n description?: string;\n deprecated?: Deprecation;\n}): OptionalKind<JSDocStructure>[] | undefined {\n const { description, deprecated } = opts;\n if (!description && !deprecated) return undefined;\n\n return [\n {\n description,\n tags: deprecated ? [{ tagName: \"deprecated\", text: deprecated.message }] : undefined,\n },\n ];\n}\n"],"mappings":";AAGA,SAAgB,YAAY,MAGmB;CAC3C,MAAM,EAAE,aAAa,eAAe;CACpC,IAAI,CAAC,eAAe,CAAC,YAAY,OAAO,KAAA;CAExC,OAAO,CACH;EACI;EACA,MAAM,aAAa,CAAC;GAAE,SAAS;GAAc,MAAM,WAAW;EAAQ,CAAC,IAAI,KAAA;CAC/E,CACJ;AACJ"}
package/lib/index.d.ts CHANGED
@@ -1,13 +1,30 @@
1
- export * from "./ir/index.js";
2
- export * from "./infer.js";
3
- export * from "./lenses.js";
4
- export * from "./live/index.js";
5
- export * from "./installation/index.js";
6
- export * from "./OntologyPullConfig.js";
7
- export { certain, uncertain, type Uncertain } from "./utils/uncertain.js";
8
- export type { ValidationIssue } from "./utils/validation.js";
9
- export type { OntologyObject } from "./live/objects/OntologyObject.js";
10
- export * from "./meta/pull.js";
11
- export type { MetaOntology, LinkType as MetaLinkType, ObjectType as MetaObjectType, PropertyDef as MetaObjectProperty, ValueType as MetaValueType, ActionType as MetaActionType, QueryFunctionType as MetaQueryFunctionType, } from "./meta/generated/types.js";
12
- export { createMetaLiveOntology } from "./meta/generated/live.js";
13
- //# sourceMappingURL=index.d.ts.map
1
+ import { ActionLogicStep, ActionParameterDef, ActionTypeDef, AttachmentConstraint, AttachmentContentConstraint, AttachmentTypeDef, BooleanTypeDef, ContextReferenceExpression, CreateObjectActionLogicStep, DateTypeDef, DeleteObjectActionLogicStep, Deprecation, DimensionsConstraint, DoubleTypeDef, Expression, FieldDef, FloatTypeDef, GeopointTypeDef, GetAtExpression, IconDescriptor, IconName, ImageAttachmentConstraint, ImageMediaType, InputReferenceExpression, IntegerTypeDef, Lens, LensOp, LinkCardinality, LinkHopExpression, LinkTypeDef, LinkTypeSideDef, ListTypeDef, LiteralExpression, LocalReferenceExpression, MapExpression, MapTypeDef, MoveLensOp, NamedTypeDef, NowExpression, ObjectLookupExpression, ObjectReferenceTypeDef, ObjectTypeDef, OntologyIR, OptionalTypeDef, PropertyAssignment, PropertyDef as PropertyDef$1, QueryFunctionParameterDef, QueryFunctionTypeDef, ResultTypeDef, SelectLensOp, StringConstraint, StringEnumConstraint, StringRegexConstraint, StringSuggestion, StringTypeDef, StructExpression, StructExpressionField, StructTypeDef, TimestampTypeDef, TypeDef, TypeRef, UnionTypeDef, UnknownTypeDef, UpdateObjectActionLogicStep, UuidExpression, VariantDef } from "./ir/generated/types.js";
2
+ import { o } from "./ir/generated/builders.js";
3
+ import { ValidationIssue } from "./utils/validation.js";
4
+ import { ValidationResult, validate } from "./ir/validate.js";
5
+ import "./ir/index.js";
6
+ import { Uncertain, certain, uncertain } from "./utils/uncertain.js";
7
+ import { AttachmentMetadata, PartialAttachmentMetadata } from "./live/attachments/types.js";
8
+ import { ApplyActionLiveOpts, OntologyApplyActionResult, OntologyAttachmentIdMapping, OntologyAttachmentUpload, OntologyAttachmentsAdapter, OntologyBackendAdapter, OntologyBackendAdapterProvider, OntologyCollectionOptions, RunQueryLiveOpts, ValidateActionDraftLiveOpts, ValidateActionLiveOpts } from "./live/OntologyBackendAdapter.js";
9
+ import { LiveOntologyAttachments } from "./live/attachments/createLiveOntologyAttachments.js";
10
+ import { OntologyObject } from "./live/objects/OntologyObject.js";
11
+ import { OntologyCollection } from "./live/objects/createLiveOntologyObjectCollection.js";
12
+ import { EnqueuedOntologyAction, NonRetryableError, OntologyActionRequest, OntologyOutbox, OntologyOutboxEntry, OntologyOutboxStatus } from "./live/outbox/types.js";
13
+ import { LiveOntologyAction, LiveOntologyActionOptions } from "./live/actions/createLiveOntologyAction.js";
14
+ import { OntologyMutator, OntologyMutatorObjects, OntologyMutatorRegistry, OntologyMutatorTx, OntologyPropertyChange, OntologyQueryFunctionHandler, OntologyQueryFunctionRegistry, OntologyReadTx } from "./live/mutators/types.js";
15
+ import { CreateLiveOntologyOpts, LiveOntology, LiveOntologyActions, LiveOntologyObjects, LiveOntologyOutboxFailureStrategy, LiveOntologyOutboxOptions, LiveOntologyQueryFunction, LiveOntologyQueryFunctions, LiveOntologyWriteMode, LiveOntologyWriteVisibility, LiveOntologyWrites, OntologyDefinition, createLiveOntology, waitForLiveOntologyReady } from "./live/LiveOntology.js";
16
+ import { ActionType, LinkType, MetaOntology, ObjectType, PropertyDef, QueryFunctionType, ValueType } from "./meta/generated/types.js";
17
+ import { ConfigureOntologyOptions, CreateOntologyBackendInstallationOptions, OntologyBackendInstallation, OntologyConfiguration, OntologyRoute } from "./installation/types.js";
18
+ import { OntologyPullConfig, OntologyPullContext, OntologyPullSource } from "./OntologyPullConfig.js";
19
+ import { ConstNamedTypeDef, ConstOntologyIR, ConstTypeDef, Infer, InferNamedType, InferOntology, InferType, MutableDeep, ReadonlyDeep, defineNamedType, defineOntology, defineType } from "./infer.js";
20
+ import { ApplyObjectTypeLensOptions, applyLensToObject, applyLensToObjectType, mapTargetPathToSourceWithLens } from "./lenses.js";
21
+ import { createReadTx } from "./live/mutators/createMutatorTx.js";
22
+ import { resolveActionParameters } from "./live/expression.js";
23
+ import { runOptimisticAction } from "./live/mutators/runOptimisticAction.js";
24
+ import "./live/index.js";
25
+ import { createOntologyBackendInstallation } from "./installation/createOntologyBackendInstallation.js";
26
+ import { MetaOntologyConfigurationOptions, createMetaOntologyConfiguration } from "./installation/createMetaOntologyConfiguration.js";
27
+ import "./installation/index.js";
28
+ import { PullOptions, pull } from "./meta/pull.js";
29
+ import { createMetaLiveOntology } from "./meta/generated/live.js";
30
+ export { ActionLogicStep, ActionParameterDef, ActionTypeDef, ApplyActionLiveOpts, ApplyObjectTypeLensOptions, AttachmentConstraint, AttachmentContentConstraint, type AttachmentMetadata, AttachmentTypeDef, BooleanTypeDef, type ConfigureOntologyOptions, ConstNamedTypeDef, ConstOntologyIR, ConstTypeDef, ContextReferenceExpression, CreateLiveOntologyOpts, CreateObjectActionLogicStep, type CreateOntologyBackendInstallationOptions, DateTypeDef, DeleteObjectActionLogicStep, Deprecation, DimensionsConstraint, DoubleTypeDef, EnqueuedOntologyAction, Expression, FieldDef, FloatTypeDef, GeopointTypeDef, GetAtExpression, IconDescriptor, IconName, ImageAttachmentConstraint, ImageMediaType, Infer, InferNamedType, InferOntology, InferType, InputReferenceExpression, IntegerTypeDef, Lens, LensOp, LinkCardinality, LinkHopExpression, LinkTypeDef, LinkTypeSideDef, ListTypeDef, LiteralExpression, LiveOntology, type LiveOntologyAction, type LiveOntologyActionOptions, LiveOntologyActions, type LiveOntologyAttachments, LiveOntologyObjects, LiveOntologyOutboxFailureStrategy, LiveOntologyOutboxOptions, LiveOntologyQueryFunction, LiveOntologyQueryFunctions, LiveOntologyWriteMode, LiveOntologyWriteVisibility, LiveOntologyWrites, LocalReferenceExpression, MapExpression, MapTypeDef, type ActionType as MetaActionType, type LinkType as MetaLinkType, type PropertyDef as MetaObjectProperty, type ObjectType as MetaObjectType, type MetaOntology, type MetaOntologyConfigurationOptions, type QueryFunctionType as MetaQueryFunctionType, type ValueType as MetaValueType, MoveLensOp, MutableDeep, NamedTypeDef, NonRetryableError, NowExpression, ObjectLookupExpression, ObjectReferenceTypeDef, ObjectTypeDef, OntologyActionRequest, OntologyApplyActionResult, OntologyAttachmentIdMapping, OntologyAttachmentUpload, OntologyAttachmentsAdapter, OntologyBackendAdapter, OntologyBackendAdapterProvider, type OntologyBackendInstallation, type OntologyCollection, OntologyCollectionOptions, type OntologyConfiguration, OntologyDefinition, OntologyIR, OntologyMutator, OntologyMutatorObjects, OntologyMutatorRegistry, OntologyMutatorTx, type OntologyObject, OntologyOutbox, OntologyOutboxEntry, OntologyOutboxStatus, OntologyPropertyChange, OntologyPullConfig, OntologyPullContext, OntologyPullSource, OntologyQueryFunctionHandler, OntologyQueryFunctionRegistry, OntologyReadTx, type OntologyRoute, OptionalTypeDef, type PartialAttachmentMetadata, PropertyAssignment, PropertyDef$1 as PropertyDef, PullOptions, QueryFunctionParameterDef, QueryFunctionTypeDef, ReadonlyDeep, ResultTypeDef, RunQueryLiveOpts, SelectLensOp, StringConstraint, StringEnumConstraint, StringRegexConstraint, StringSuggestion, StringTypeDef, StructExpression, StructExpressionField, StructTypeDef, TimestampTypeDef, TypeDef, TypeRef, type Uncertain, UnionTypeDef, UnknownTypeDef, UpdateObjectActionLogicStep, UuidExpression, ValidateActionDraftLiveOpts, ValidateActionLiveOpts, type ValidationIssue, ValidationResult, VariantDef, applyLensToObject, applyLensToObjectType, certain, createLiveOntology, createMetaLiveOntology, createMetaOntologyConfiguration, createOntologyBackendInstallation, createReadTx, defineNamedType, defineOntology, defineType, mapTargetPathToSourceWithLens, o, pull, resolveActionParameters, runOptimisticAction, uncertain, validate, waitForLiveOntologyReady };
package/lib/index.js CHANGED
@@ -1,10 +1,18 @@
1
- export * from "./ir/index.js";
2
- export * from "./infer.js";
3
- export * from "./lenses.js";
4
- export * from "./live/index.js";
5
- export * from "./installation/index.js";
6
- export * from "./OntologyPullConfig.js";
7
- export { certain, uncertain } from "./utils/uncertain.js";
8
- export * from "./meta/pull.js";
9
- export { createMetaLiveOntology } from "./meta/generated/live.js";
10
- //# sourceMappingURL=index.js.map
1
+ import { o } from "./ir/generated/builders.js";
2
+ import { validate } from "./ir/validate.js";
3
+ import "./ir/index.js";
4
+ import { defineNamedType, defineOntology, defineType } from "./infer.js";
5
+ import { applyLensToObject, applyLensToObjectType, mapTargetPathToSourceWithLens } from "./lenses.js";
6
+ import { resolveActionParameters } from "./live/expression.js";
7
+ import { createReadTx } from "./live/mutators/createMutatorTx.js";
8
+ import { runOptimisticAction } from "./live/mutators/runOptimisticAction.js";
9
+ import { NonRetryableError } from "./live/outbox/types.js";
10
+ import { createLiveOntology, waitForLiveOntologyReady } from "./live/LiveOntology.js";
11
+ import "./live/index.js";
12
+ import { createMetaOntologyConfiguration } from "./installation/createMetaOntologyConfiguration.js";
13
+ import { createOntologyBackendInstallation } from "./installation/createOntologyBackendInstallation.js";
14
+ import "./installation/index.js";
15
+ import { certain, uncertain } from "./utils/uncertain.js";
16
+ import { pull } from "./meta/pull.js";
17
+ import { createMetaLiveOntology } from "./meta/generated/live.js";
18
+ export { NonRetryableError, applyLensToObject, applyLensToObjectType, certain, createLiveOntology, createMetaLiveOntology, createMetaOntologyConfiguration, createOntologyBackendInstallation, createReadTx, defineNamedType, defineOntology, defineType, mapTargetPathToSourceWithLens, o, pull, resolveActionParameters, runOptimisticAction, uncertain, validate, waitForLiveOntologyReady };
package/lib/infer.d.ts CHANGED
@@ -1,238 +1,215 @@
1
- import type { ImageMediaType, NamedTypeDef, OntologyIR, TypeDef } from "./ir/generated/types.js";
2
- import type { OntologyDefinition } from "./live/LiveOntology.js";
3
- import type { ActionTypeName, ActionTypes, ArrayElement, NamedTypes, ObjectTypeName, ObjectTypes, QueryFunctionTypeName, QueryFunctionTypes } from "./utils/typeNames.js";
4
- import type { attachment, date, double, float, geopoint, integer, Result, timestamp } from "./utils/values.js";
5
- export type ReadonlyDeep<T> = T extends (...args: never[]) => unknown ? T : T extends readonly (infer Element)[] ? readonly ReadonlyDeep<Element>[] : T extends object ? {
6
- readonly [K in keyof T]: ReadonlyDeep<T[K]>;
7
- } : T;
8
- export type MutableDeep<T> = T extends (...args: never[]) => unknown ? T : T extends readonly (infer Element)[] ? Array<MutableDeep<Element>> : T extends object ? {
9
- -readonly [K in keyof T]: MutableDeep<T[K]>;
10
- } : T;
11
- type FlattenObject<T> = {
12
- [K in keyof T]: T[K];
13
- } & {};
1
+ import { Result, attachment, date, double, float, geopoint, integer, timestamp } from "./utils/values.js";
2
+ import { ImageMediaType, NamedTypeDef, OntologyIR, TypeDef } from "./ir/generated/types.js";
3
+ import { ActionTypeName, ActionTypes, ArrayElement, NamedTypes, ObjectTypeName, ObjectTypes, QueryFunctionTypeName, QueryFunctionTypes } from "./utils/typeNames.js";
4
+ import { OntologyDefinition } from "./live/LiveOntology.js";
5
+ //#region src/infer.d.ts
6
+ export type ReadonlyDeep<T> = T extends ((...args: never[]) => unknown) ? T : T extends readonly (infer Element)[] ? readonly ReadonlyDeep<Element>[] : T extends object ? { readonly [K in keyof T]: ReadonlyDeep<T[K]>; } : T;
7
+ export type MutableDeep<T> = T extends ((...args: never[]) => unknown) ? T : T extends readonly (infer Element)[] ? Array<MutableDeep<Element>> : T extends object ? { -readonly [K in keyof T]: MutableDeep<T[K]>; } : T;
8
+ type FlattenObject<T> = { [K in keyof T]: T[K]; } & {};
14
9
  type TypeKind<Type> = Type extends {
15
- readonly kind: infer Kind extends string;
10
+ readonly kind: infer Kind extends string;
16
11
  } ? Kind : never;
17
12
  type TypeValue<Type> = Type extends {
18
- readonly value: infer Value;
13
+ readonly value: infer Value;
19
14
  } ? Value : never;
20
15
  type NamedTypeByName<Ontology, Name extends PropertyKey> = Extract<NamedTypes<Ontology>, {
21
- readonly name: Name;
16
+ readonly name: Name;
22
17
  }>;
23
18
  type ObjectTypeByName<Ontology, Name extends PropertyKey> = Extract<ObjectTypes<Ontology>, {
24
- readonly name: Name;
19
+ readonly name: Name;
25
20
  }>;
26
21
  type ActionTypeByName<Ontology, Name extends PropertyKey> = Extract<ActionTypes<Ontology>, {
27
- readonly name: Name;
22
+ readonly name: Name;
28
23
  }>;
29
24
  type QueryFunctionTypeByName<Ontology, Name extends PropertyKey> = Extract<QueryFunctionTypes<Ontology>, {
30
- readonly name: Name;
25
+ readonly name: Name;
31
26
  }>;
32
27
  type ObjectTypeProperties<ObjectType> = ObjectType extends {
33
- readonly properties: infer Properties;
28
+ readonly properties: infer Properties;
34
29
  } ? Properties : never;
35
30
  type InferString<Value> = Value extends {
36
- readonly constraint?: infer Constraint;
31
+ readonly constraint?: infer Constraint;
37
32
  } ? NonNullable<Constraint> extends {
38
- readonly kind: "enum";
39
- readonly value: {
40
- readonly options: infer Options;
41
- };
33
+ readonly kind: "enum";
34
+ readonly value: {
35
+ readonly options: infer Options;
36
+ };
42
37
  } ? ArrayElement<Options> extends {
43
- readonly value: infer OptionValue extends string;
38
+ readonly value: infer OptionValue extends string;
44
39
  } ? OptionValue : never : string : string;
45
40
  type StructField<Fields> = ArrayElement<Fields>;
46
41
  type FieldName<Field> = Field extends {
47
- readonly name: infer Name extends PropertyKey;
42
+ readonly name: infer Name extends PropertyKey;
48
43
  } ? Name : never;
49
44
  type FieldByName<Fields, Name extends PropertyKey> = Extract<StructField<Fields>, {
50
- readonly name: Name;
45
+ readonly name: Name;
51
46
  }>;
52
47
  type FieldType<Fields, Name extends PropertyKey> = FieldByName<Fields, Name> extends {
53
- readonly type: infer Type;
48
+ readonly type: infer Type;
54
49
  } ? Type : never;
55
- type RequiredFieldNames<Fields> = StructField<Fields> extends infer Field ? Field extends {
56
- readonly type: infer Type;
50
+ type RequiredFieldNames<Fields> = StructField<Fields> extends (infer Field) ? Field extends {
51
+ readonly type: infer Type;
57
52
  } ? Type extends {
58
- readonly kind: "optional";
53
+ readonly kind: "optional";
59
54
  } ? never : FieldName<Field> : never : never;
60
- type OptionalFieldNames<Fields> = StructField<Fields> extends infer Field ? Field extends {
61
- readonly type: infer Type;
55
+ type OptionalFieldNames<Fields> = StructField<Fields> extends (infer Field) ? Field extends {
56
+ readonly type: infer Type;
62
57
  } ? Type extends {
63
- readonly kind: "optional";
58
+ readonly kind: "optional";
64
59
  } ? FieldName<Field> : never : never : never;
65
- type InferStructFields<Fields, Ontology> = StructField<Fields> extends never ? Record<never, never> : FlattenObject<{
66
- [Name in RequiredFieldNames<Fields>]: InferType<FieldType<Fields, Name>, Ontology>;
67
- } & {
68
- [Name in OptionalFieldNames<Fields>]?: TypeValue<FieldType<Fields, Name>> extends {
69
- readonly type: infer Inner;
70
- } ? InferType<Inner, Ontology> : never;
71
- }>;
60
+ type InferStructFields<Fields, Ontology> = StructField<Fields> extends never ? Record<never, never> : FlattenObject<{ [Name in RequiredFieldNames<Fields>]: InferType<FieldType<Fields, Name>, Ontology>; } & { [Name in OptionalFieldNames<Fields>]?: TypeValue<FieldType<Fields, Name>> extends {
61
+ readonly type: infer Inner;
62
+ } ? InferType<Inner, Ontology> : never; }>;
72
63
  type InferUnionVariant<Variant, Ontology> = Variant extends {
73
- readonly name: infer Name extends string;
74
- readonly type: infer Type;
64
+ readonly name: infer Name extends string;
65
+ readonly type: infer Type;
75
66
  } ? {
76
- kind: Name;
77
- value: InferType<Type, Ontology>;
67
+ kind: Name;
68
+ value: InferType<Type, Ontology>;
78
69
  } : never;
79
70
  type ObjectPrimaryKey<ObjectType> = ObjectType extends {
80
- readonly primaryKey: infer PrimaryKey extends PropertyKey;
71
+ readonly primaryKey: infer PrimaryKey extends PropertyKey;
81
72
  } ? PrimaryKey : never;
82
73
  type InferObjectReference<Value, Ontology> = Value extends {
83
- readonly objectType: infer Name extends PropertyKey;
74
+ readonly objectType: infer Name extends PropertyKey;
84
75
  } ? InferType<FieldType<ObjectTypeProperties<ObjectTypeByName<Ontology, Name>>, ObjectPrimaryKey<ObjectTypeByName<Ontology, Name>>>, Ontology> : never;
85
76
  type InferImageAttachment<Value> = Value extends {
86
- readonly mediaTypes: infer MediaTypes;
77
+ readonly mediaTypes: infer MediaTypes;
87
78
  } ? attachment<Extract<ArrayElement<MediaTypes>, string>> : attachment<ImageMediaType>;
88
79
  type InferAttachment<Value> = Value extends {
89
- readonly constraint: {
90
- readonly content: infer Content;
91
- };
80
+ readonly constraint: {
81
+ readonly content: infer Content;
82
+ };
92
83
  } ? Content extends {
93
- readonly kind: "image";
94
- readonly value: infer ImageConstraint;
84
+ readonly kind: "image";
85
+ readonly value: infer ImageConstraint;
95
86
  } ? InferImageAttachment<ImageConstraint> : attachment : attachment;
96
87
  type InferByKind<Type, Ontology> = {
97
- string: InferString<TypeValue<Type>>;
98
- boolean: boolean;
99
- integer: integer;
100
- float: float;
101
- double: double;
102
- date: date;
103
- timestamp: timestamp;
104
- geopoint: geopoint;
105
- attachment: InferAttachment<TypeValue<Type>>;
106
- objectReference: InferObjectReference<TypeValue<Type>, Ontology>;
107
- unknown: unknown;
108
- list: TypeValue<Type> extends {
109
- readonly elementType: infer ElementType;
110
- } ? Array<InferType<ElementType, Ontology>> : never;
111
- map: TypeValue<Type> extends {
112
- readonly valueType: infer ValueType;
113
- } ? Record<string, InferType<ValueType, Ontology>> : never;
114
- struct: TypeValue<Type> extends {
115
- readonly fields: infer Fields;
116
- } ? InferStructFields<Fields, Ontology> : never;
117
- union: TypeValue<Type> extends {
118
- readonly variants: infer Variants;
119
- } ? InferUnionVariant<ArrayElement<Variants>, Ontology> : never;
120
- optional: TypeValue<Type> extends {
121
- readonly type: infer Inner;
122
- } ? InferType<Inner, Ontology> | undefined : never;
123
- result: TypeValue<Type> extends {
124
- readonly okType: infer OkType;
125
- readonly errType: infer ErrType;
126
- } ? Result<InferType<OkType, Ontology>, InferType<ErrType, Ontology>> : never;
127
- ref: TypeValue<Type> extends {
128
- readonly name: infer Name extends PropertyKey;
129
- } ? InferNamedTypeByName<Ontology, Name> : never;
88
+ string: InferString<TypeValue<Type>>;
89
+ boolean: boolean;
90
+ integer: integer;
91
+ float: float;
92
+ double: double;
93
+ date: date;
94
+ timestamp: timestamp;
95
+ geopoint: geopoint;
96
+ attachment: InferAttachment<TypeValue<Type>>;
97
+ objectReference: InferObjectReference<TypeValue<Type>, Ontology>;
98
+ unknown: unknown;
99
+ list: TypeValue<Type> extends {
100
+ readonly elementType: infer ElementType;
101
+ } ? Array<InferType<ElementType, Ontology>> : never;
102
+ map: TypeValue<Type> extends {
103
+ readonly valueType: infer ValueType;
104
+ } ? Record<string, InferType<ValueType, Ontology>> : never;
105
+ struct: TypeValue<Type> extends {
106
+ readonly fields: infer Fields;
107
+ } ? InferStructFields<Fields, Ontology> : never;
108
+ union: TypeValue<Type> extends {
109
+ readonly variants: infer Variants;
110
+ } ? InferUnionVariant<ArrayElement<Variants>, Ontology> : never;
111
+ optional: TypeValue<Type> extends {
112
+ readonly type: infer Inner;
113
+ } ? InferType<Inner, Ontology> | undefined : never;
114
+ result: TypeValue<Type> extends {
115
+ readonly okType: infer OkType;
116
+ readonly errType: infer ErrType;
117
+ } ? Result<InferType<OkType, Ontology>, InferType<ErrType, Ontology>> : never;
118
+ ref: TypeValue<Type> extends {
119
+ readonly name: infer Name extends PropertyKey;
120
+ } ? InferNamedTypeByName<Ontology, Name> : never;
130
121
  };
131
122
  export type InferType<Type, Ontology = never> = TypeKind<Type> extends keyof InferByKind<Type, Ontology> ? InferByKind<Type, Ontology>[TypeKind<Type>] : never;
132
123
  type InferNamedTypeByName<Ontology, Name extends PropertyKey> = NamedTypeByName<Ontology, Name> extends {
133
- readonly type: infer Type;
124
+ readonly type: infer Type;
134
125
  } ? InferType<Type, Ontology> : ObjectTypeByName<Ontology, Name> extends {
135
- readonly properties: infer Properties;
126
+ readonly properties: infer Properties;
136
127
  } ? InferStructFields<Properties, Ontology> : never;
137
128
  export type InferNamedType<Type, Ontology = never> = Type extends {
138
- readonly type: infer TypeDef;
129
+ readonly type: infer TypeDef;
139
130
  } ? InferType<TypeDef, Ontology> : never;
140
131
  type InferObjectType<ObjectType, Ontology> = ObjectType extends {
141
- readonly properties: infer Properties;
132
+ readonly properties: infer Properties;
142
133
  } ? InferStructFields<Properties, Ontology> : never;
143
134
  type ActionParameters<ActionType> = ActionType extends {
144
- readonly parameters: infer Parameters;
135
+ readonly parameters: infer Parameters;
145
136
  } ? Parameters : never;
146
137
  type ActionParameter<Parameters> = ArrayElement<Parameters>;
147
138
  type ActionParameterName<Parameter> = Parameter extends {
148
- readonly name: infer Name extends PropertyKey;
139
+ readonly name: infer Name extends PropertyKey;
149
140
  } ? Name : never;
150
141
  type ActionParameterByName<Parameters, Name extends PropertyKey> = Extract<ActionParameter<Parameters>, {
151
- readonly name: Name;
142
+ readonly name: Name;
152
143
  }>;
153
144
  type ActionParameterType<Parameters, Name extends PropertyKey> = ActionParameterByName<Parameters, Name> extends {
154
- readonly type: infer Type;
145
+ readonly type: infer Type;
155
146
  } ? Type : never;
156
- type RequiredActionParameterNames<Parameters> = ActionParameter<Parameters> extends infer Parameter ? Parameter extends {
157
- readonly type: infer Type;
147
+ type RequiredActionParameterNames<Parameters> = ActionParameter<Parameters> extends (infer Parameter) ? Parameter extends {
148
+ readonly type: infer Type;
158
149
  } ? Type extends {
159
- readonly kind: "optional";
150
+ readonly kind: "optional";
160
151
  } ? never : Parameter extends {
161
- readonly defaultValue: unknown;
152
+ readonly defaultValue: unknown;
162
153
  } ? never : ActionParameterName<Parameter> : never : never;
163
- type OptionalActionParameterNames<Parameters> = ActionParameter<Parameters> extends infer Parameter ? Parameter extends {
164
- readonly type: infer Type;
154
+ type OptionalActionParameterNames<Parameters> = ActionParameter<Parameters> extends (infer Parameter) ? Parameter extends {
155
+ readonly type: infer Type;
165
156
  } ? Type extends {
166
- readonly kind: "optional";
157
+ readonly kind: "optional";
167
158
  } ? ActionParameterName<Parameter> : Parameter extends {
168
- readonly defaultValue: unknown;
159
+ readonly defaultValue: unknown;
169
160
  } ? ActionParameterName<Parameter> : never : never : never;
170
- type InferActionParameter<Parameters, Name extends PropertyKey, Ontology> = ActionParameterType<Parameters, Name> extends infer Type ? Type extends {
171
- readonly kind: "optional";
172
- readonly value: {
173
- readonly type: infer Inner;
174
- };
161
+ type InferActionParameter<Parameters, Name extends PropertyKey, Ontology> = ActionParameterType<Parameters, Name> extends (infer Type) ? Type extends {
162
+ readonly kind: "optional";
163
+ readonly value: {
164
+ readonly type: infer Inner;
165
+ };
175
166
  } ? InferType<Inner, Ontology> | null : InferType<Type, Ontology> : never;
176
- type InferActionParameters<Parameters, Ontology> = ActionParameter<Parameters> extends never ? Record<never, never> : FlattenObject<{
177
- [Name in RequiredActionParameterNames<Parameters>]: InferActionParameter<Parameters, Name, Ontology>;
178
- } & {
179
- [Name in OptionalActionParameterNames<Parameters>]?: InferActionParameter<Parameters, Name, Ontology>;
180
- }>;
167
+ type InferActionParameters<Parameters, Ontology> = ActionParameter<Parameters> extends never ? Record<never, never> : FlattenObject<{ [Name in RequiredActionParameterNames<Parameters>]: InferActionParameter<Parameters, Name, Ontology>; } & { [Name in OptionalActionParameterNames<Parameters>]?: InferActionParameter<Parameters, Name, Ontology>; }>;
181
168
  type QueryParameters<QueryFunctionType> = QueryFunctionType extends {
182
- readonly parameters: infer Parameters;
169
+ readonly parameters: infer Parameters;
183
170
  } ? Parameters : never;
184
171
  type QueryReturnType<QueryFunctionType> = QueryFunctionType extends {
185
- readonly returnType: infer ReturnType;
172
+ readonly returnType: infer ReturnType;
186
173
  } ? ReturnType : never;
187
174
  type QueryParameter<Parameters> = ArrayElement<Parameters>;
188
175
  type QueryParameterName<Parameter> = Parameter extends {
189
- readonly name: infer Name extends PropertyKey;
176
+ readonly name: infer Name extends PropertyKey;
190
177
  } ? Name : never;
191
178
  type QueryParameterByName<Parameters, Name extends PropertyKey> = Extract<QueryParameter<Parameters>, {
192
- readonly name: Name;
179
+ readonly name: Name;
193
180
  }>;
194
181
  type QueryParameterType<Parameters, Name extends PropertyKey> = QueryParameterByName<Parameters, Name> extends {
195
- readonly type: infer Type;
182
+ readonly type: infer Type;
196
183
  } ? Type : never;
197
- type RequiredQueryParameterNames<Parameters> = QueryParameter<Parameters> extends infer Parameter ? Parameter extends {
198
- readonly type: infer Type;
184
+ type RequiredQueryParameterNames<Parameters> = QueryParameter<Parameters> extends (infer Parameter) ? Parameter extends {
185
+ readonly type: infer Type;
199
186
  } ? Type extends {
200
- readonly kind: "optional";
187
+ readonly kind: "optional";
201
188
  } ? never : QueryParameterName<Parameter> : never : never;
202
- type OptionalQueryParameterNames<Parameters> = QueryParameter<Parameters> extends infer Parameter ? Parameter extends {
203
- readonly type: infer Type;
189
+ type OptionalQueryParameterNames<Parameters> = QueryParameter<Parameters> extends (infer Parameter) ? Parameter extends {
190
+ readonly type: infer Type;
204
191
  } ? Type extends {
205
- readonly kind: "optional";
192
+ readonly kind: "optional";
206
193
  } ? QueryParameterName<Parameter> : never : never : never;
207
- type InferQueryParameter<Parameters, Name extends PropertyKey, Ontology> = QueryParameterType<Parameters, Name> extends infer Type ? Type extends {
208
- readonly kind: "optional";
209
- readonly value: {
210
- readonly type: infer Inner;
211
- };
194
+ type InferQueryParameter<Parameters, Name extends PropertyKey, Ontology> = QueryParameterType<Parameters, Name> extends (infer Type) ? Type extends {
195
+ readonly kind: "optional";
196
+ readonly value: {
197
+ readonly type: infer Inner;
198
+ };
212
199
  } ? InferType<Inner, Ontology> : InferType<Type, Ontology> : never;
213
- type InferQueryParameters<Parameters, Ontology> = QueryParameter<Parameters> extends never ? Record<never, never> : FlattenObject<{
214
- [Name in RequiredQueryParameterNames<Parameters>]: InferQueryParameter<Parameters, Name, Ontology>;
215
- } & {
216
- [Name in OptionalQueryParameterNames<Parameters>]?: InferQueryParameter<Parameters, Name, Ontology>;
217
- }>;
200
+ type InferQueryParameters<Parameters, Ontology> = QueryParameter<Parameters> extends never ? Record<never, never> : FlattenObject<{ [Name in RequiredQueryParameterNames<Parameters>]: InferQueryParameter<Parameters, Name, Ontology>; } & { [Name in OptionalQueryParameterNames<Parameters>]?: InferQueryParameter<Parameters, Name, Ontology>; }>;
218
201
  export type InferOntology<Ontology> = {
219
- context: Ontology extends {
220
- readonly contextType: infer ContextType;
221
- } ? InferType<ContextType, Ontology> : Record<string, unknown>;
222
- objectTypes: {
223
- [Name in ObjectTypeName<Ontology>]: InferObjectType<ObjectTypeByName<Ontology, Name>, Ontology>;
224
- };
225
- actionTypes: {
226
- [Name in ActionTypeName<Ontology>]: {
227
- parameters: InferActionParameters<ActionParameters<ActionTypeByName<Ontology, Name>>, Ontology>;
228
- };
229
- };
230
- queryFunctionTypes: {
231
- [Name in QueryFunctionTypeName<Ontology>]: {
232
- parameters: InferQueryParameters<QueryParameters<QueryFunctionTypeByName<Ontology, Name>>, Ontology>;
233
- returnType: InferType<QueryReturnType<QueryFunctionTypeByName<Ontology, Name>>, Ontology>;
234
- };
235
- };
202
+ context: Ontology extends {
203
+ readonly contextType: infer ContextType;
204
+ } ? InferType<ContextType, Ontology> : Record<string, unknown>;
205
+ objectTypes: { [Name in ObjectTypeName<Ontology>]: InferObjectType<ObjectTypeByName<Ontology, Name>, Ontology>; };
206
+ actionTypes: { [Name in ActionTypeName<Ontology>]: {
207
+ parameters: InferActionParameters<ActionParameters<ActionTypeByName<Ontology, Name>>, Ontology>;
208
+ }; };
209
+ queryFunctionTypes: { [Name in QueryFunctionTypeName<Ontology>]: {
210
+ parameters: InferQueryParameters<QueryParameters<QueryFunctionTypeByName<Ontology, Name>>, Ontology>;
211
+ returnType: InferType<QueryReturnType<QueryFunctionTypeByName<Ontology, Name>>, Ontology>;
212
+ }; };
236
213
  } & OntologyDefinition;
237
214
  export type ConstOntologyIR = ReadonlyDeep<OntologyIR>;
238
215
  export type ConstTypeDef = ReadonlyDeep<TypeDef>;
@@ -241,5 +218,5 @@ export type Infer<Input extends ConstOntologyIR | ConstNamedTypeDef | ConstTypeD
241
218
  export declare function defineOntology<const Ontology extends ConstOntologyIR>(ontology: Ontology): MutableDeep<Ontology>;
242
219
  export declare function defineType<const Type extends ConstTypeDef>(type: Type): MutableDeep<Type>;
243
220
  export declare function defineNamedType<const Type extends ConstNamedTypeDef>(type: Type): MutableDeep<Type>;
244
- export {};
221
+ //#endregion
245
222
  //# sourceMappingURL=infer.d.ts.map