@party-stack/ontology 0.19.1 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (356) hide show
  1. package/README.md +31 -0
  2. package/lib/OntologyPullConfig.d.ts +4 -17
  3. package/lib/OntologyPullConfig.d.ts.map +1 -1
  4. package/lib/authentication.d.ts +1068 -0
  5. package/lib/authentication.d.ts.map +1 -0
  6. package/lib/authentication.js +55 -0
  7. package/lib/authentication.js.map +1 -0
  8. package/lib/cli/index.js +19 -45
  9. package/lib/cli/index.js.map +1 -1
  10. package/lib/cli/pull.d.ts.map +1 -1
  11. package/lib/cli/pull.js +16 -29
  12. package/lib/cli/pull.js.map +1 -1
  13. package/lib/client.d.ts +11 -0
  14. package/lib/client.d.ts.map +1 -0
  15. package/lib/client.js +21 -0
  16. package/lib/client.js.map +1 -0
  17. package/lib/examples/blog.d.ts +2 -387
  18. package/lib/examples/blog.js +1 -353
  19. package/lib/examples/blog.live-queries.d.ts +1 -1
  20. package/lib/examples/blog.live-queries.d.ts.map +1 -1
  21. package/lib/examples/blog.live-queries.js +1 -1
  22. package/lib/examples/blog.live-queries.js.map +1 -1
  23. package/lib/examples/generated/collections.d.ts +7 -0
  24. package/lib/examples/generated/collections.d.ts.map +1 -0
  25. package/lib/examples/generated/collections.js +12 -0
  26. package/lib/examples/generated/collections.js.map +1 -0
  27. package/lib/examples/generated/live.d.ts +2 -2
  28. package/lib/examples/generated/live.d.ts.map +1 -1
  29. package/lib/examples/generated/live.js.map +1 -1
  30. package/lib/http.d.ts +13 -0
  31. package/lib/http.d.ts.map +1 -0
  32. package/lib/http.js +29 -0
  33. package/lib/http.js.map +1 -0
  34. package/lib/index.d.ts +19 -25
  35. package/lib/index.js +9 -15
  36. package/lib/json/index.d.ts +1 -16
  37. package/lib/json/index.js +2 -132
  38. package/lib/live/LiveOntology.d.ts +114 -50
  39. package/lib/live/LiveOntology.d.ts.map +1 -1
  40. package/lib/live/LiveOntology.js +23 -103
  41. package/lib/live/LiveOntology.js.map +1 -1
  42. package/lib/live/actions/createLiveOntologyAction.d.ts +15 -16
  43. package/lib/live/actions/createLiveOntologyAction.d.ts.map +1 -1
  44. package/lib/live/actions/createLiveOntologyAction.js +3 -11
  45. package/lib/live/actions/createLiveOntologyAction.js.map +1 -1
  46. package/lib/live/actions/types.d.ts +21 -0
  47. package/lib/live/actions/types.d.ts.map +1 -0
  48. package/lib/live/attachments/createLiveOntologyAttachments.d.ts +30 -19
  49. package/lib/live/attachments/createLiveOntologyAttachments.d.ts.map +1 -1
  50. package/lib/live/attachments/createLiveOntologyAttachments.js +43 -60
  51. package/lib/live/attachments/createLiveOntologyAttachments.js.map +1 -1
  52. package/lib/live/attachments/types.d.ts +4 -3
  53. package/lib/live/index.d.ts +10 -10
  54. package/lib/live/index.js +5 -6
  55. package/lib/live/mutators/createReadTx.d.ts +5 -0
  56. package/lib/live/mutators/createReadTx.d.ts.map +1 -0
  57. package/lib/live/mutators/createReadTx.js +19 -0
  58. package/lib/live/mutators/createReadTx.js.map +1 -0
  59. package/lib/live/mutators/types.d.ts +7 -2
  60. package/lib/live/mutators/types.d.ts.map +1 -1
  61. package/lib/live/objects/types.d.ts +6 -0
  62. package/lib/live/objects/types.d.ts.map +1 -0
  63. package/lib/live/outbox/types.d.ts +24 -15
  64. package/lib/live/outbox/types.d.ts.map +1 -1
  65. package/lib/live/outbox/types.js +1 -11
  66. package/lib/live/pins.d.ts +51 -0
  67. package/lib/live/pins.d.ts.map +1 -0
  68. package/lib/live/pins.js +113 -0
  69. package/lib/live/pins.js.map +1 -0
  70. package/lib/live/storageBackend.d.ts +50 -0
  71. package/lib/live/storageBackend.d.ts.map +1 -0
  72. package/lib/live/storageBackend.js +42 -0
  73. package/lib/live/storageBackend.js.map +1 -0
  74. package/lib/local.d.ts +15 -0
  75. package/lib/local.d.ts.map +1 -0
  76. package/lib/local.js +19 -0
  77. package/lib/local.js.map +1 -0
  78. package/lib/meta/generated/collections.d.ts +7 -0
  79. package/lib/meta/generated/collections.d.ts.map +1 -0
  80. package/lib/meta/generated/collections.js +15 -0
  81. package/lib/meta/generated/collections.js.map +1 -0
  82. package/lib/meta/generated/live.d.ts +3 -3
  83. package/lib/meta/generated/live.d.ts.map +1 -1
  84. package/lib/meta/generated/live.js +2 -2
  85. package/lib/meta/generated/live.js.map +1 -1
  86. package/lib/meta/pull.d.ts +5 -9
  87. package/lib/meta/pull.d.ts.map +1 -1
  88. package/lib/meta/pull.js +5 -43
  89. package/lib/meta/pull.js.map +1 -1
  90. package/lib/query.d.ts +1 -0
  91. package/lib/query.js +2 -0
  92. package/lib/runtime/host.d.ts +35 -0
  93. package/lib/runtime/host.d.ts.map +1 -0
  94. package/lib/runtime/host.js +39 -0
  95. package/lib/runtime/host.js.map +1 -0
  96. package/lib/runtime/index.d.ts +2 -0
  97. package/lib/runtime/index.js +1 -0
  98. package/lib/runtime/live.d.ts +25 -0
  99. package/lib/runtime/live.d.ts.map +1 -0
  100. package/lib/runtime/live.js +31 -0
  101. package/lib/runtime/live.js.map +1 -0
  102. package/lib/runtime/resource.d.ts +24 -0
  103. package/lib/runtime/resource.d.ts.map +1 -0
  104. package/lib/runtime/resource.js +127 -0
  105. package/lib/runtime/resource.js.map +1 -0
  106. package/lib/runtime/transactions.d.ts +27 -0
  107. package/lib/runtime/transactions.d.ts.map +1 -0
  108. package/lib/runtime/transactions.js +188 -0
  109. package/lib/runtime/transactions.js.map +1 -0
  110. package/lib/runtime/view.d.ts +25 -0
  111. package/lib/runtime/view.d.ts.map +1 -0
  112. package/lib/runtime/view.js +256 -0
  113. package/lib/runtime/view.js.map +1 -0
  114. package/lib/tanstack/collections.d.ts +73 -0
  115. package/lib/tanstack/collections.d.ts.map +1 -0
  116. package/lib/tanstack/collections.js +495 -0
  117. package/lib/tanstack/collections.js.map +1 -0
  118. package/lib/tanstack/createLocalCollection.d.ts +14 -0
  119. package/lib/tanstack/createLocalCollection.d.ts.map +1 -0
  120. package/lib/tanstack/createLocalCollection.js +9 -0
  121. package/lib/tanstack/createLocalCollection.js.map +1 -0
  122. package/lib/tanstack/descriptors.d.ts +33 -0
  123. package/lib/tanstack/descriptors.d.ts.map +1 -0
  124. package/lib/tanstack/descriptors.js +38 -0
  125. package/lib/tanstack/descriptors.js.map +1 -0
  126. package/lib/tanstack/diagnostics.d.ts +23 -0
  127. package/lib/tanstack/diagnostics.d.ts.map +1 -0
  128. package/lib/tanstack/diagnostics.js +14 -0
  129. package/lib/tanstack/diagnostics.js.map +1 -0
  130. package/lib/tanstack/index.d.ts +6 -0
  131. package/lib/tanstack/index.js +6 -0
  132. package/lib/tanstack/localCollection.d.ts +14 -0
  133. package/lib/tanstack/localCollection.d.ts.map +1 -0
  134. package/lib/tanstack/localCollection.js +73 -0
  135. package/lib/tanstack/localCollection.js.map +1 -0
  136. package/lib/tanstack/subset.d.ts +28 -0
  137. package/lib/tanstack/subset.d.ts.map +1 -0
  138. package/lib/tanstack/subset.js +290 -0
  139. package/lib/tanstack/subset.js.map +1 -0
  140. package/lib/testing/sqlite.d.ts +40 -0
  141. package/lib/testing/sqlite.d.ts.map +1 -0
  142. package/lib/testing/sqlite.js +409 -0
  143. package/lib/testing/sqlite.js.map +1 -0
  144. package/lib/testing/sqliteBackend.d.ts +68 -0
  145. package/lib/testing/sqliteBackend.d.ts.map +1 -0
  146. package/lib/testing/sqliteBackend.js +34 -0
  147. package/lib/testing/sqliteBackend.js.map +1 -0
  148. package/lib/utils/index.d.ts +1 -8
  149. package/lib/utils/index.js +2 -5
  150. package/lib/utils/values.d.ts +1 -33
  151. package/lib/worker.d.ts +19 -0
  152. package/lib/worker.d.ts.map +1 -0
  153. package/lib/worker.js +46 -0
  154. package/lib/worker.js.map +1 -0
  155. package/package.json +54 -19
  156. package/lib/_virtual/_rolldown/runtime.js +0 -13
  157. package/lib/cli/format.d.ts +0 -4
  158. package/lib/cli/format.d.ts.map +0 -1
  159. package/lib/cli/format.js +0 -19
  160. package/lib/cli/format.js.map +0 -1
  161. package/lib/cli/generate.d.ts +0 -10
  162. package/lib/cli/generate.d.ts.map +0 -1
  163. package/lib/cli/generate.js +0 -108
  164. package/lib/cli/generate.js.map +0 -1
  165. package/lib/examples/blog.d.ts.map +0 -1
  166. package/lib/examples/blog.js.map +0 -1
  167. package/lib/generate/builders.d.ts +0 -12
  168. package/lib/generate/builders.d.ts.map +0 -1
  169. package/lib/generate/builders.js +0 -58
  170. package/lib/generate/builders.js.map +0 -1
  171. package/lib/generate/constants.d.ts +0 -5
  172. package/lib/generate/constants.d.ts.map +0 -1
  173. package/lib/generate/constants.js +0 -28
  174. package/lib/generate/constants.js.map +0 -1
  175. package/lib/generate/index.d.ts +0 -6
  176. package/lib/generate/index.js +0 -6
  177. package/lib/generate/live.d.ts +0 -12
  178. package/lib/generate/live.d.ts.map +0 -1
  179. package/lib/generate/live.js +0 -48
  180. package/lib/generate/live.js.map +0 -1
  181. package/lib/generate/ontology.d.ts +0 -8
  182. package/lib/generate/ontology.d.ts.map +0 -1
  183. package/lib/generate/ontology.js +0 -501
  184. package/lib/generate/ontology.js.map +0 -1
  185. package/lib/generate/types.d.ts +0 -17
  186. package/lib/generate/types.d.ts.map +0 -1
  187. package/lib/generate/types.js +0 -216
  188. package/lib/generate/types.js.map +0 -1
  189. package/lib/generate/utils/buildJsDocs.d.ts +0 -10
  190. package/lib/generate/utils/buildJsDocs.d.ts.map +0 -1
  191. package/lib/generate/utils/buildJsDocs.js +0 -16
  192. package/lib/generate/utils/buildJsDocs.js.map +0 -1
  193. package/lib/infer.d.ts +0 -222
  194. package/lib/infer.d.ts.map +0 -1
  195. package/lib/infer.js +0 -14
  196. package/lib/infer.js.map +0 -1
  197. package/lib/installation/createMetaOntologyConfiguration.d.ts +0 -10
  198. package/lib/installation/createMetaOntologyConfiguration.d.ts.map +0 -1
  199. package/lib/installation/createMetaOntologyConfiguration.js +0 -16
  200. package/lib/installation/createMetaOntologyConfiguration.js.map +0 -1
  201. package/lib/installation/createOntologyBackendInstallation.d.ts +0 -5
  202. package/lib/installation/createOntologyBackendInstallation.d.ts.map +0 -1
  203. package/lib/installation/createOntologyBackendInstallation.js +0 -221
  204. package/lib/installation/createOntologyBackendInstallation.js.map +0 -1
  205. package/lib/installation/index.d.ts +0 -4
  206. package/lib/installation/index.js +0 -3
  207. package/lib/installation/types.d.ts +0 -94
  208. package/lib/installation/types.d.ts.map +0 -1
  209. package/lib/ir/generated/builders.d.ts +0 -380
  210. package/lib/ir/generated/builders.d.ts.map +0 -1
  211. package/lib/ir/generated/builders.js +0 -186
  212. package/lib/ir/generated/builders.js.map +0 -1
  213. package/lib/ir/generated/constants.d.ts +0 -265
  214. package/lib/ir/generated/constants.d.ts.map +0 -1
  215. package/lib/ir/generated/constants.js +0 -165
  216. package/lib/ir/generated/constants.js.map +0 -1
  217. package/lib/ir/generated/types.d.ts +0 -416
  218. package/lib/ir/generated/types.d.ts.map +0 -1
  219. package/lib/ir/index.d.ts +0 -4
  220. package/lib/ir/index.js +0 -3
  221. package/lib/ir/schema.d.ts +0 -2246
  222. package/lib/ir/schema.d.ts.map +0 -1
  223. package/lib/ir/schema.js +0 -1187
  224. package/lib/ir/schema.js.map +0 -1
  225. package/lib/ir/validate.d.ts +0 -8
  226. package/lib/ir/validate.d.ts.map +0 -1
  227. package/lib/ir/validate.js +0 -623
  228. package/lib/ir/validate.js.map +0 -1
  229. package/lib/json/index.d.ts.map +0 -1
  230. package/lib/json/index.js.map +0 -1
  231. package/lib/lenses.d.ts +0 -21
  232. package/lib/lenses.d.ts.map +0 -1
  233. package/lib/lenses.js +0 -110
  234. package/lib/lenses.js.map +0 -1
  235. package/lib/live/OntologyBackendAdapter.d.ts +0 -100
  236. package/lib/live/OntologyBackendAdapter.d.ts.map +0 -1
  237. package/lib/live/OntologyBackendAdapter.js +0 -1
  238. package/lib/live/actions/createLiveOntologyActions.d.ts +0 -28
  239. package/lib/live/actions/createLiveOntologyActions.d.ts.map +0 -1
  240. package/lib/live/actions/createLiveOntologyActions.js +0 -139
  241. package/lib/live/actions/createLiveOntologyActions.js.map +0 -1
  242. package/lib/live/actions/prepareActionParameters.d.ts +0 -19
  243. package/lib/live/actions/prepareActionParameters.d.ts.map +0 -1
  244. package/lib/live/actions/prepareActionParameters.js +0 -213
  245. package/lib/live/actions/prepareActionParameters.js.map +0 -1
  246. package/lib/live/attachments/attachmentSources.d.ts +0 -10
  247. package/lib/live/attachments/attachmentSources.d.ts.map +0 -1
  248. package/lib/live/attachments/attachmentSources.js +0 -64
  249. package/lib/live/attachments/attachmentSources.js.map +0 -1
  250. package/lib/live/attachments/unsupportedOntologyAttachmentsAdapter.d.ts +0 -5
  251. package/lib/live/attachments/unsupportedOntologyAttachmentsAdapter.d.ts.map +0 -1
  252. package/lib/live/attachments/unsupportedOntologyAttachmentsAdapter.js +0 -6
  253. package/lib/live/attachments/unsupportedOntologyAttachmentsAdapter.js.map +0 -1
  254. package/lib/live/expression.d.ts +0 -23
  255. package/lib/live/expression.d.ts.map +0 -1
  256. package/lib/live/expression.js +0 -160
  257. package/lib/live/expression.js.map +0 -1
  258. package/lib/live/mutators/OntologyEdits.d.ts +0 -15
  259. package/lib/live/mutators/OntologyEdits.d.ts.map +0 -1
  260. package/lib/live/mutators/OntologyEdits.js +0 -65
  261. package/lib/live/mutators/OntologyEdits.js.map +0 -1
  262. package/lib/live/mutators/createMutatorTx.d.ts +0 -11
  263. package/lib/live/mutators/createMutatorTx.d.ts.map +0 -1
  264. package/lib/live/mutators/createMutatorTx.js +0 -61
  265. package/lib/live/mutators/createMutatorTx.js.map +0 -1
  266. package/lib/live/mutators/runOptimisticAction.d.ts +0 -19
  267. package/lib/live/mutators/runOptimisticAction.d.ts.map +0 -1
  268. package/lib/live/mutators/runOptimisticAction.js +0 -30
  269. package/lib/live/mutators/runOptimisticAction.js.map +0 -1
  270. package/lib/live/objects/OntologyObject.d.ts +0 -4
  271. package/lib/live/objects/OntologyObject.d.ts.map +0 -1
  272. package/lib/live/objects/OntologyObject.js +0 -1
  273. package/lib/live/objects/createLiveOntologyObjectCollection.d.ts +0 -17
  274. package/lib/live/objects/createLiveOntologyObjectCollection.d.ts.map +0 -1
  275. package/lib/live/objects/createLiveOntologyObjectCollection.js +0 -55
  276. package/lib/live/objects/createLiveOntologyObjectCollection.js.map +0 -1
  277. package/lib/live/objects/ontologyObjectCollectionId.d.ts +0 -4
  278. package/lib/live/objects/ontologyObjectCollectionId.d.ts.map +0 -1
  279. package/lib/live/objects/ontologyObjectCollectionId.js +0 -8
  280. package/lib/live/objects/ontologyObjectCollectionId.js.map +0 -1
  281. package/lib/live/outbox/createOntologyOutbox.d.ts +0 -23
  282. package/lib/live/outbox/createOntologyOutbox.d.ts.map +0 -1
  283. package/lib/live/outbox/createOntologyOutbox.js +0 -292
  284. package/lib/live/outbox/createOntologyOutbox.js.map +0 -1
  285. package/lib/live/outbox/leaderExecutor.d.ts +0 -20
  286. package/lib/live/outbox/leaderExecutor.d.ts.map +0 -1
  287. package/lib/live/outbox/leaderExecutor.js +0 -130
  288. package/lib/live/outbox/leaderExecutor.js.map +0 -1
  289. package/lib/live/outbox/outboxService.d.ts +0 -7
  290. package/lib/live/outbox/outboxService.d.ts.map +0 -1
  291. package/lib/live/outbox/outboxService.js +0 -68
  292. package/lib/live/outbox/outboxService.js.map +0 -1
  293. package/lib/live/outbox/projectionManager.d.ts +0 -31
  294. package/lib/live/outbox/projectionManager.d.ts.map +0 -1
  295. package/lib/live/outbox/projectionManager.js +0 -127
  296. package/lib/live/outbox/projectionManager.js.map +0 -1
  297. package/lib/live/outbox/repository.d.ts +0 -31
  298. package/lib/live/outbox/repository.d.ts.map +0 -1
  299. package/lib/live/outbox/repository.js +0 -196
  300. package/lib/live/outbox/repository.js.map +0 -1
  301. package/lib/live/outbox/service.d.ts +0 -61
  302. package/lib/live/outbox/service.d.ts.map +0 -1
  303. package/lib/live/outbox/service.js +0 -6
  304. package/lib/live/outbox/service.js.map +0 -1
  305. package/lib/live/outbox/types.js.map +0 -1
  306. package/lib/live/waitForCollectionReady.d.ts +0 -5
  307. package/lib/live/waitForCollectionReady.d.ts.map +0 -1
  308. package/lib/live/waitForCollectionReady.js +0 -49
  309. package/lib/live/waitForCollectionReady.js.map +0 -1
  310. package/lib/meta/createLocalMetaOntologyBackendAdapter.d.ts +0 -7
  311. package/lib/meta/createLocalMetaOntologyBackendAdapter.d.ts.map +0 -1
  312. package/lib/meta/createLocalMetaOntologyBackendAdapter.js +0 -44
  313. package/lib/meta/createLocalMetaOntologyBackendAdapter.js.map +0 -1
  314. package/lib/meta/generated/constants.d.ts +0 -265
  315. package/lib/meta/generated/constants.d.ts.map +0 -1
  316. package/lib/meta/generated/constants.js +0 -165
  317. package/lib/meta/generated/constants.js.map +0 -1
  318. package/lib/meta/generated/types.d.ts +0 -417
  319. package/lib/meta/generated/types.d.ts.map +0 -1
  320. package/lib/meta/generated/types.js +0 -1
  321. package/lib/meta/ontology.d.ts +0 -26
  322. package/lib/meta/ontology.d.ts.map +0 -1
  323. package/lib/meta/ontology.js +0 -111
  324. package/lib/meta/ontology.js.map +0 -1
  325. package/lib/utils/links.d.ts +0 -49
  326. package/lib/utils/links.d.ts.map +0 -1
  327. package/lib/utils/links.js +0 -13
  328. package/lib/utils/links.js.map +0 -1
  329. package/lib/utils/paths.d.ts +0 -6
  330. package/lib/utils/paths.d.ts.map +0 -1
  331. package/lib/utils/paths.js +0 -42
  332. package/lib/utils/paths.js.map +0 -1
  333. package/lib/utils/provide.d.ts +0 -4
  334. package/lib/utils/provide.d.ts.map +0 -1
  335. package/lib/utils/provide.js +0 -9
  336. package/lib/utils/provide.js.map +0 -1
  337. package/lib/utils/targets.d.ts +0 -37
  338. package/lib/utils/targets.d.ts.map +0 -1
  339. package/lib/utils/targets.js +0 -1
  340. package/lib/utils/typeNames.d.ts +0 -28
  341. package/lib/utils/typeNames.d.ts.map +0 -1
  342. package/lib/utils/typeNames.js +0 -1
  343. package/lib/utils/types.d.ts +0 -12
  344. package/lib/utils/types.d.ts.map +0 -1
  345. package/lib/utils/types.js +0 -48
  346. package/lib/utils/types.js.map +0 -1
  347. package/lib/utils/uncertain.d.ts +0 -11
  348. package/lib/utils/uncertain.d.ts.map +0 -1
  349. package/lib/utils/uncertain.js +0 -14
  350. package/lib/utils/uncertain.js.map +0 -1
  351. package/lib/utils/validation.d.ts +0 -7
  352. package/lib/utils/validation.d.ts.map +0 -1
  353. package/lib/utils/validation.js +0 -1
  354. package/lib/utils/values.d.ts.map +0 -1
  355. /package/lib/{installation → live/actions}/types.js +0 -0
  356. /package/lib/{ir/generated → live/objects}/types.js +0 -0
@@ -1,353 +1 @@
1
- import { o } from "../ir/generated/builders.js";
2
- //#region src/examples/blog.ts
3
- /**
4
- * Example: Blog ontology with Authors, Posts, and Comments.
5
- *
6
- * Demonstrates:
7
- * - Object types with primary keys and typed properties
8
- * - Value types (reusable structured types)
9
- * - Link types with cardinality
10
- * - Attachment properties (e.g. author avatar)
11
- * - String enum constraints (e.g. post status)
12
- * - Optional properties and timestamps
13
- */
14
- var blog_default = {
15
- types: [{
16
- name: "Address",
17
- description: "A mailing address.",
18
- type: o.struct({ fields: [
19
- {
20
- name: "line1",
21
- displayName: "Line 1",
22
- type: o.string({})
23
- },
24
- {
25
- name: "line2",
26
- displayName: "Line 2",
27
- type: o.optional({ type: o.string({}) })
28
- },
29
- {
30
- name: "city",
31
- displayName: "City",
32
- type: o.string({})
33
- },
34
- {
35
- name: "state",
36
- displayName: "State",
37
- type: o.string({})
38
- },
39
- {
40
- name: "zip",
41
- displayName: "ZIP",
42
- type: o.string({})
43
- }
44
- ] })
45
- }],
46
- objectTypes: [
47
- {
48
- name: "Author",
49
- displayName: "Author",
50
- pluralDisplayName: "Authors",
51
- description: "A blog author.",
52
- primaryKey: "authorId",
53
- properties: [
54
- {
55
- name: "authorId",
56
- displayName: "Author ID",
57
- type: o.string({})
58
- },
59
- {
60
- name: "name",
61
- displayName: "Name",
62
- type: o.string({})
63
- },
64
- {
65
- name: "email",
66
- displayName: "Email",
67
- type: o.string({})
68
- },
69
- {
70
- name: "bio",
71
- displayName: "Bio",
72
- type: o.optional({ type: o.string({}) })
73
- },
74
- {
75
- name: "avatar",
76
- displayName: "Avatar",
77
- description: "The author's profile picture.",
78
- type: o.optional({ type: o.attachment({}) })
79
- },
80
- {
81
- name: "address",
82
- displayName: "Address",
83
- type: o.optional({ type: o.ref({ name: "Address" }) })
84
- },
85
- {
86
- name: "createdAt",
87
- displayName: "Created At",
88
- type: o.timestamp({})
89
- }
90
- ]
91
- },
92
- {
93
- name: "Post",
94
- displayName: "Blog Post",
95
- pluralDisplayName: "Posts",
96
- description: "A blog post.",
97
- primaryKey: "postId",
98
- properties: [
99
- {
100
- name: "postId",
101
- displayName: "Post ID",
102
- type: o.string({})
103
- },
104
- {
105
- name: "title",
106
- displayName: "Title",
107
- type: o.string({})
108
- },
109
- {
110
- name: "body",
111
- displayName: "Body",
112
- type: o.string({})
113
- },
114
- {
115
- name: "authorId",
116
- displayName: "Author ID",
117
- type: o.string({})
118
- },
119
- {
120
- name: "status",
121
- displayName: "Status",
122
- type: o.string({ constraint: o.StringConstraint.enum({ options: [
123
- {
124
- value: "draft",
125
- label: "Draft"
126
- },
127
- {
128
- value: "published",
129
- label: "Published"
130
- },
131
- {
132
- value: "archived",
133
- label: "Archived"
134
- }
135
- ] }) })
136
- },
137
- {
138
- name: "coverImage",
139
- displayName: "Cover Image",
140
- type: o.optional({ type: o.attachment({}) })
141
- },
142
- {
143
- name: "tags",
144
- displayName: "Tags",
145
- type: o.list({ elementType: o.string({}) })
146
- },
147
- {
148
- name: "createdAt",
149
- displayName: "Created At",
150
- type: o.timestamp({})
151
- },
152
- {
153
- name: "publishedAt",
154
- displayName: "Published At",
155
- type: o.optional({ type: o.timestamp({}) })
156
- }
157
- ]
158
- },
159
- {
160
- name: "Comment",
161
- displayName: "Comment",
162
- pluralDisplayName: "Comments",
163
- description: "A comment on a blog post.",
164
- primaryKey: "commentId",
165
- properties: [
166
- {
167
- name: "commentId",
168
- displayName: "Comment ID",
169
- type: o.string({})
170
- },
171
- {
172
- name: "body",
173
- displayName: "Body",
174
- type: o.string({})
175
- },
176
- {
177
- name: "postId",
178
- displayName: "Post ID",
179
- type: o.string({})
180
- },
181
- {
182
- name: "authorId",
183
- displayName: "Author ID",
184
- type: o.string({})
185
- },
186
- {
187
- name: "createdAt",
188
- displayName: "Created At",
189
- type: o.timestamp({})
190
- }
191
- ]
192
- }
193
- ],
194
- linkTypes: [
195
- {
196
- id: "Post:author",
197
- source: {
198
- objectType: "Post",
199
- name: "posts",
200
- displayName: "Posts"
201
- },
202
- target: {
203
- objectType: "Author",
204
- name: "author",
205
- displayName: "Author"
206
- },
207
- foreignKey: "authorId",
208
- cardinality: "many"
209
- },
210
- {
211
- id: "Comment:post",
212
- source: {
213
- objectType: "Comment",
214
- name: "comments",
215
- displayName: "Comments"
216
- },
217
- target: {
218
- objectType: "Post",
219
- name: "post",
220
- displayName: "Post"
221
- },
222
- foreignKey: "postId",
223
- cardinality: "many"
224
- },
225
- {
226
- id: "Comment:author",
227
- source: {
228
- objectType: "Comment",
229
- name: "comment",
230
- displayName: "Comment"
231
- },
232
- target: {
233
- objectType: "Author",
234
- name: "author",
235
- displayName: "Author"
236
- },
237
- foreignKey: "authorId",
238
- cardinality: "one"
239
- }
240
- ],
241
- actionTypes: [{
242
- name: "createPost",
243
- displayName: "Create Post",
244
- description: "Create a new blog post.",
245
- parameters: [
246
- {
247
- name: "postId",
248
- displayName: "Post ID",
249
- type: o.string({}),
250
- defaultValue: o.Expression.uuid({})
251
- },
252
- {
253
- name: "author",
254
- displayName: "Author",
255
- type: o.objectReference({ objectType: "Author" })
256
- },
257
- {
258
- name: "title",
259
- displayName: "Title",
260
- type: o.string({})
261
- },
262
- {
263
- name: "body",
264
- displayName: "Body",
265
- type: o.string({})
266
- },
267
- {
268
- name: "status",
269
- displayName: "Status",
270
- type: o.string({ constraint: o.StringConstraint.enum({ options: [
271
- {
272
- value: "draft",
273
- label: "Draft"
274
- },
275
- {
276
- value: "published",
277
- label: "Published"
278
- },
279
- {
280
- value: "archived",
281
- label: "Archived"
282
- }
283
- ] }) })
284
- },
285
- {
286
- name: "tags",
287
- displayName: "Tags",
288
- type: o.list({ elementType: o.string({}) })
289
- },
290
- {
291
- name: "createdAt",
292
- displayName: "Created At",
293
- type: o.timestamp({}),
294
- defaultValue: o.Expression.now({})
295
- }
296
- ],
297
- logic: [o.ActionLogicStep.createObject({
298
- objectType: "Post",
299
- values: [
300
- {
301
- property: ["postId"],
302
- value: o.Expression.inputReference({ name: "postId" })
303
- },
304
- {
305
- property: ["title"],
306
- value: o.Expression.inputReference({ name: "title" })
307
- },
308
- {
309
- property: ["body"],
310
- value: o.Expression.inputReference({ name: "body" })
311
- },
312
- {
313
- property: ["authorId"],
314
- value: o.Expression.getAt({
315
- source: o.Expression.objectLookup({ reference: o.Expression.inputReference({ name: "author" }) }),
316
- path: ["authorId"]
317
- })
318
- },
319
- {
320
- property: ["status"],
321
- value: o.Expression.inputReference({ name: "status" })
322
- },
323
- {
324
- property: ["tags"],
325
- value: o.Expression.inputReference({ name: "tags" })
326
- },
327
- {
328
- property: ["createdAt"],
329
- value: o.Expression.inputReference({ name: "createdAt" })
330
- }
331
- ]
332
- })]
333
- }],
334
- queryFunctionTypes: [{
335
- name: "searchPosts",
336
- displayName: "Search Posts",
337
- description: "Search blog posts by query text.",
338
- parameters: [{
339
- name: "query",
340
- displayName: "Query",
341
- type: o.string({})
342
- }, {
343
- name: "limit",
344
- displayName: "Limit",
345
- type: o.optional({ type: o.integer({}) })
346
- }],
347
- returnType: o.list({ elementType: o.objectReference({ objectType: "Post" }) })
348
- }]
349
- };
350
- //#endregion
351
- export { blog_default as default };
352
-
353
- //# sourceMappingURL=blog.js.map
1
+ export { default } from "@party-stack/ontology-spec/examples/blog";
@@ -1,5 +1,5 @@
1
- import { OntologyCollection } from "../live/objects/createLiveOntologyObjectCollection.js";
2
1
  import { Author, Comment, Post } from "./generated/types.js";
2
+ import { OntologyCollection } from "../live/objects/types.js";
3
3
  import "../index.js";
4
4
  //#region src/examples/blog.live-queries.d.ts
5
5
  export declare const postCollection: OntologyCollection<Post>;
@@ -1 +1 @@
1
- {"version":3,"file":"blog.live-queries.d.ts","names":["_$__generated_types_js0.Post","_$___index_js0.OntologyCollection","_$__generated_types_js0.Author","_$__generated_types_js0.Comment"],"sources":["../../src/examples/blog.live-queries.ts"],"mappings":";;;;qBAqDa,gBAAcC,mBAAdD;qBACA,kBAAgBC,mBAAhBC;qBACA,mBAAiBD,mBAAjBE"}
1
+ {"version":3,"file":"blog.live-queries.d.ts","names":["_$__generated_types_js0.Post","_$___index_js0.OntologyCollection","_$__generated_types_js0.Author","_$__generated_types_js0.Comment"],"sources":["../../src/examples/blog.live-queries.ts"],"mappings":";;;;qBAoDa,gBAAcC,mBAAdD;qBACA,kBAAgBC,mBAAhBC;qBACA,mBAAiBD,mBAAjBE"}
@@ -4,7 +4,7 @@ import { Query, concat, createCollection, eq, liveQueryCollectionOptions } from
4
4
  /**
5
5
  * Example live query functions using generated ontology object sources.
6
6
  */
7
- const { Post, Author, Comment } = (await createBlogLiveOntology({ backend: () => backendAdapter })).objects;
7
+ const { Post, Author, Comment } = (await createBlogLiveOntology({ backend })).objects;
8
8
  createCollection(liveQueryCollectionOptions({ query: new Query().from({ Post }).select(({ Post }) => ({
9
9
  postId: Post.postId,
10
10
  title: Post.title,
@@ -1 +1 @@
1
- {"version":3,"file":"blog.live-queries.js","names":[],"sources":["../../src/examples/blog.live-queries.ts"],"sourcesContent":["/**\n * Example live query functions using generated ontology object sources.\n */\nimport { Query, concat, createCollection, eq, liveQueryCollectionOptions } from \"@tanstack/db\";\nimport { createBlogLiveOntology } from \"./generated/live.js\";\nimport type { OntologyBackendAdapter } from \"../live/OntologyBackendAdapter.js\";\n\ndeclare const backendAdapter: OntologyBackendAdapter;\n\nconst blog = await createBlogLiveOntology({\n backend: () => backendAdapter,\n});\nconst { Post, Author, Comment } = blog.objects;\n\nconst postList = createCollection(\n liveQueryCollectionOptions({\n query: new Query().from({ Post }).select(({ Post }) => ({\n postId: Post.postId,\n title: Post.title,\n status: Post.status,\n })),\n })\n);\n\nconst postListWithAuthor = createCollection(\n liveQueryCollectionOptions({\n query: new Query()\n .from({ Post })\n .leftJoin({ Author }, ({ Post, Author }) => eq(Post.authorId, Author.authorId))\n .select(({ Post, Author }) => ({\n postId: Post.postId,\n title: Post.title,\n authorName: Author?.name,\n })),\n })\n);\n\nconst commentFeed = createCollection(\n liveQueryCollectionOptions({\n query: new Query()\n .from({ Comment })\n .leftJoin({ Post }, ({ Comment, Post }) => eq(Comment.postId, Post.postId))\n .leftJoin({ Author }, ({ Comment, Author }) => eq(Comment.authorId, Author.authorId))\n .where(({ Post }) => eq(Post?.status, \"published\"))\n .select(({ Comment, Post, Author }) => ({\n commentId: Comment.commentId,\n body: Comment.body,\n postTitle: Post?.title,\n authorDisplay: concat(Author?.name, \" <\", Author?.email, \">\"),\n })),\n })\n);\n\nexport const postCollection = Post;\nexport const authorCollection = Author;\nexport const commentCollection = Comment;\n\nvoid postList;\nvoid postListWithAuthor;\nvoid commentFeed;\n"],"mappings":";;;;;;AAYA,MAAM,EAAE,MAAM,QAAQ,aAAY,MAHf,uBAAuB,EACtC,eAAe,eACnB,CAAC,EAAA,CACsC;AAEtB,iBACb,2BAA2B,EACvB,OAAO,IAAI,MAAM,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,QAAQ,EAAE,YAAY;CACpD,QAAQ,KAAK;CACb,OAAO,KAAK;CACZ,QAAQ,KAAK;AACjB,EAAE,EACN,CAAC,CACL;AAE2B,iBACvB,2BAA2B,EACvB,OAAO,IAAI,MAAM,CAAC,CACb,KAAK,EAAE,KAAK,CAAC,CAAC,CACd,SAAS,EAAE,OAAO,IAAI,EAAE,MAAM,aAAa,GAAG,KAAK,UAAU,OAAO,QAAQ,CAAC,CAAC,CAC9E,QAAQ,EAAE,MAAM,cAAc;CAC3B,QAAQ,KAAK;CACb,OAAO,KAAK;CACZ,YAAY,QAAQ;AACxB,EAAE,EACV,CAAC,CACL;AAEoB,iBAChB,2BAA2B,EACvB,OAAO,IAAI,MAAM,CAAC,CACb,KAAK,EAAE,QAAQ,CAAC,CAAC,CACjB,SAAS,EAAE,KAAK,IAAI,EAAE,SAAS,WAAW,GAAG,QAAQ,QAAQ,KAAK,MAAM,CAAC,CAAC,CAC1E,SAAS,EAAE,OAAO,IAAI,EAAE,SAAS,aAAa,GAAG,QAAQ,UAAU,OAAO,QAAQ,CAAC,CAAC,CACpF,OAAO,EAAE,WAAW,GAAG,MAAM,QAAQ,WAAW,CAAC,CAAC,CAClD,QAAQ,EAAE,SAAS,MAAM,cAAc;CACpC,WAAW,QAAQ;CACnB,MAAM,QAAQ;CACd,WAAW,MAAM;CACjB,eAAe,OAAO,QAAQ,MAAM,MAAM,QAAQ,OAAO,GAAG;AAChE,EAAE,EACV,CAAC,CACL;AAEA,MAAa,iBAAiB;AAC9B,MAAa,mBAAmB;AAChC,MAAa,oBAAoB"}
1
+ {"version":3,"file":"blog.live-queries.js","names":[],"sources":["../../src/examples/blog.live-queries.ts"],"sourcesContent":["/**\n * Example live query functions using generated ontology object sources.\n */\nimport { Query, concat, createCollection, eq, liveQueryCollectionOptions } from \"@tanstack/db\";\nimport { createBlogLiveOntology } from \"./generated/live.js\";\nimport type { OntologyBackendService } from \"@party-stack/ontology-backend\";\ndeclare const backend: OntologyBackendService;\n\nconst blog = await createBlogLiveOntology({\n backend,\n});\nconst { Post, Author, Comment } = blog.objects;\n\nconst postList = createCollection(\n liveQueryCollectionOptions({\n query: new Query().from({ Post }).select(({ Post }) => ({\n postId: Post.postId,\n title: Post.title,\n status: Post.status,\n })),\n })\n);\n\nconst postListWithAuthor = createCollection(\n liveQueryCollectionOptions({\n query: new Query()\n .from({ Post })\n .leftJoin({ Author }, ({ Post, Author }) => eq(Post.authorId, Author.authorId))\n .select(({ Post, Author }) => ({\n postId: Post.postId,\n title: Post.title,\n authorName: Author?.name,\n })),\n })\n);\n\nconst commentFeed = createCollection(\n liveQueryCollectionOptions({\n query: new Query()\n .from({ Comment })\n .leftJoin({ Post }, ({ Comment, Post }) => eq(Comment.postId, Post.postId))\n .leftJoin({ Author }, ({ Comment, Author }) => eq(Comment.authorId, Author.authorId))\n .where(({ Post }) => eq(Post?.status, \"published\"))\n .select(({ Comment, Post, Author }) => ({\n commentId: Comment.commentId,\n body: Comment.body,\n postTitle: Post?.title,\n authorDisplay: concat(Author?.name, \" <\", Author?.email, \">\"),\n })),\n })\n);\n\nexport const postCollection = Post;\nexport const authorCollection = Author;\nexport const commentCollection = Comment;\n\nvoid postList;\nvoid postListWithAuthor;\nvoid commentFeed;\n"],"mappings":";;;;;;AAWA,MAAM,EAAE,MAAM,QAAQ,aAAY,MAHf,uBAAuB,EACtC,QACJ,CAAC,EAAA,CACsC;AAEtB,iBACb,2BAA2B,EACvB,OAAO,IAAI,MAAM,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,QAAQ,EAAE,YAAY;CACpD,QAAQ,KAAK;CACb,OAAO,KAAK;CACZ,QAAQ,KAAK;AACjB,EAAE,EACN,CAAC,CACL;AAE2B,iBACvB,2BAA2B,EACvB,OAAO,IAAI,MAAM,CAAC,CACb,KAAK,EAAE,KAAK,CAAC,CAAC,CACd,SAAS,EAAE,OAAO,IAAI,EAAE,MAAM,aAAa,GAAG,KAAK,UAAU,OAAO,QAAQ,CAAC,CAAC,CAC9E,QAAQ,EAAE,MAAM,cAAc;CAC3B,QAAQ,KAAK;CACb,OAAO,KAAK;CACZ,YAAY,QAAQ;AACxB,EAAE,EACV,CAAC,CACL;AAEoB,iBAChB,2BAA2B,EACvB,OAAO,IAAI,MAAM,CAAC,CACb,KAAK,EAAE,QAAQ,CAAC,CAAC,CACjB,SAAS,EAAE,KAAK,IAAI,EAAE,SAAS,WAAW,GAAG,QAAQ,QAAQ,KAAK,MAAM,CAAC,CAAC,CAC1E,SAAS,EAAE,OAAO,IAAI,EAAE,SAAS,aAAa,GAAG,QAAQ,UAAU,OAAO,QAAQ,CAAC,CAAC,CACpF,OAAO,EAAE,WAAW,GAAG,MAAM,QAAQ,WAAW,CAAC,CAAC,CAClD,QAAQ,EAAE,SAAS,MAAM,cAAc;CACpC,WAAW,QAAQ;CACnB,MAAM,QAAQ;CACd,WAAW,MAAM;CACjB,eAAe,OAAO,QAAQ,MAAM,MAAM,QAAQ,OAAO,GAAG;AAChE,EAAE,EACV,CAAC,CACL;AAEA,MAAa,iBAAiB;AAC9B,MAAa,mBAAmB;AAChC,MAAa,oBAAoB"}
@@ -0,0 +1,7 @@
1
+ import { OntologyCollectionDescriptors } from "../../tanstack/descriptors.js";
2
+ import { BlogOntology } from "./types.js";
3
+ import "../../index.js";
4
+ //#region src/examples/generated/collections.d.ts
5
+ export declare const objects: OntologyCollectionDescriptors<BlogOntology, Record<never, never>>, cachedObjects: OntologyCollectionDescriptors<BlogOntology, Record<never, never>>;
6
+ //#endregion
7
+ //# sourceMappingURL=collections.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collections.d.ts","names":["_$______index_js0.OntologyCollectionDescriptors"],"sources":["../../../src/examples/generated/collections.ts"],"mappings":";;;;qBAKe,SAAOA,8BAAA,cAAA,uBAAE,eAAaA,8BAAA,cAAA"}
@@ -0,0 +1,12 @@
1
+ import { ontologyCollections } from "../../tanstack/descriptors.js";
2
+ import "../../index.js";
3
+ //#region src/examples/generated/collections.ts
4
+ const { objects, cachedObjects } = ontologyCollections({
5
+ Author: "authorId",
6
+ Post: "postId",
7
+ Comment: "commentId"
8
+ });
9
+ //#endregion
10
+ export { cachedObjects, objects };
11
+
12
+ //# sourceMappingURL=collections.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collections.js","names":[],"sources":["../../../src/examples/generated/collections.ts"],"sourcesContent":["// Auto-generated file - do not edit manually\n\nimport { ontologyCollections } from \"../../index.js\";\nimport type { BlogOntology } from \"./types.js\";\n\nexport const { objects, cachedObjects } = ontologyCollections<BlogOntology>({\n Author: \"authorId\",\n Post: \"postId\",\n Comment: \"commentId\",\n});\n"],"mappings":";;;AAKA,MAAa,EAAE,SAAS,kBAAkB,oBAAkC;CACxE,QAAQ;CACR,MAAM;CACN,SAAS;AACb,CAAC"}
@@ -1,7 +1,7 @@
1
- import { CreateLiveOntologyOpts, LiveOntology } from "../../live/LiveOntology.js";
2
1
  import { BlogOntology } from "./types.js";
2
+ import { LiveOntology, LiveOntologyFactoryOptions } from "../../live/LiveOntology.js";
3
3
  import "../../index.js";
4
4
  //#region src/examples/generated/live.d.ts
5
- export declare function createBlogLiveOntology<Context extends Record<string, unknown> = Record<string, unknown>>(opts: Omit<CreateLiveOntologyOpts<Context>, "ir">): Promise<LiveOntology<BlogOntology>>;
5
+ export declare function createBlogLiveOntology<Context extends Record<string, unknown> = Record<string, unknown>>(opts: LiveOntologyFactoryOptions<Context>): Promise<LiveOntology<BlogOntology>>;
6
6
  //#endregion
7
7
  //# sourceMappingURL=live.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"live.d.ts","names":[],"sources":["../../../src/examples/generated/live.ts"],"mappings":";;;;wBAOsB,uBAClB,gBAAgB,0BAA0B,yBAC5C,MAAM,KAAK,uBAAuB,kBAAkB,QAAQ,aAAa"}
1
+ {"version":3,"file":"live.d.ts","names":[],"sources":["../../../src/examples/generated/live.ts"],"mappings":";;;;wBAOsB,uBAClB,gBAAgB,0BAA0B,yBAC5C,MAAM,2BAA2B,WAAW,QAAQ,aAAa"}
@@ -1 +1 @@
1
- {"version":3,"file":"live.js","names":["ontology"],"sources":["../../../src/examples/generated/live.ts"],"sourcesContent":["// Auto-generated file - do not edit manually\n\nimport { createLiveOntology, type LiveOntology } from \"../../index.js\";\nimport ontology from \"../blog.js\";\nimport type { CreateLiveOntologyOpts } from \"../../index.js\";\nimport type { BlogOntology } from \"./types.js\";\n\nexport async function createBlogLiveOntology<\n Context extends Record<string, unknown> = Record<string, unknown>,\n>(opts: Omit<CreateLiveOntologyOpts<Context>, \"ir\">): Promise<LiveOntology<BlogOntology>> {\n return createLiveOntology<BlogOntology, Context>({\n ...opts,\n ir: ontology,\n });\n}\n"],"mappings":";;;;AAOA,eAAsB,uBAEpB,MAAwF;CACtF,OAAO,mBAA0C;EAC7C,GAAG;EACH,IAAIA;CACR,CAAC;AACL"}
1
+ {"version":3,"file":"live.js","names":["ontology"],"sources":["../../../src/examples/generated/live.ts"],"sourcesContent":["// Auto-generated file - do not edit manually\n\nimport { createLiveOntology, type LiveOntology } from \"../../index.js\";\nimport ontology from \"../blog.js\";\nimport type { LiveOntologyFactoryOptions } from \"../../index.js\";\nimport type { BlogOntology } from \"./types.js\";\n\nexport async function createBlogLiveOntology<\n Context extends Record<string, unknown> = Record<string, unknown>,\n>(opts: LiveOntologyFactoryOptions<Context>): Promise<LiveOntology<BlogOntology>> {\n return createLiveOntology<BlogOntology, Context>({\n ...opts,\n ir: ontology,\n });\n}\n"],"mappings":";;;;AAOA,eAAsB,uBAEpB,MAAgF;CAC9E,OAAO,mBAA0C;EAC7C,GAAG;EACH,IAAIA;CACR,CAAC;AACL"}
package/lib/http.d.ts ADDED
@@ -0,0 +1,13 @@
1
+ import { BackendError } from "@party-stack/ontology-backend";
2
+ import { Effect } from "effect";
3
+ //#region src/http.d.ts
4
+ export interface HttpClientOptions {
5
+ readonly ontology?: string;
6
+ readonly headers?: HeadersInit;
7
+ readonly credentials?: RequestCredentials;
8
+ readonly fetch?: typeof globalThis.fetch;
9
+ }
10
+ /** Lazy browser/Fetch binding. createLiveOntology or OntologyProvider owns its Scope. */
11
+ export declare const httpClient: (url: string | URL, options?: HttpClientOptions | undefined) => Effect.Effect<import("@party-stack/ontology-server/rpc").OntologyServerClient, BackendError<"Conflict" | "Forbidden" | "HistoryExpired" | "Internal" | "InvalidConfiguration" | "InvalidRequest" | "InvalidResponse" | "NotFound" | "NotImplemented" | "RateLimited" | "ResultExpired" | "SchemaMismatch" | "SessionExpired" | "SessionReplaced" | "SourceMismatch" | "Unauthenticated" | "Unavailable" | "ValidationFailed" | "ViewReplaced">, import("effect/Scope").Scope>;
12
+ //#endregion
13
+ //# sourceMappingURL=http.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http.d.ts","names":[],"sources":["../src/http.ts"],"mappings":";;;iBAKiB;WACJ;WACA,UAAU;WACV,cAAc;WACd,eAAe,WAAW;;;qBAI1B,aAAU,cAAA,KAAA,UAAA,kCAAA,OAAA,kDAAA,sBAAA,wXAAA"}
package/lib/http.js ADDED
@@ -0,0 +1,29 @@
1
+ import { BackendError } from "@party-stack/ontology-backend";
2
+ import { Effect } from "effect";
3
+ import { makeOntologyHttpClient } from "@party-stack/ontology-server/rpc/http";
4
+ import { FetchHttpClient } from "effect/http";
5
+ //#region src/http.ts
6
+ /** Lazy browser/Fetch binding. createLiveOntology or OntologyProvider owns its Scope. */
7
+ const httpClient = Effect.fnUntraced(function* (url, options = {}) {
8
+ const endpoint = yield* Effect.try({
9
+ try: () => new URL(url, globalThis.location?.href).href,
10
+ catch: (cause) => new BackendError({
11
+ operation: "ontology.http",
12
+ kind: "InvalidConfiguration",
13
+ retryable: false,
14
+ message: "Supply an absolute endpoint URL outside the browser.",
15
+ cause
16
+ })
17
+ });
18
+ return yield* makeOntologyHttpClient({
19
+ url: endpoint,
20
+ ontology: options.ontology
21
+ }).pipe(Effect.provide(FetchHttpClient.layer), Effect.provideService(FetchHttpClient.RequestInit, {
22
+ headers: options.headers,
23
+ credentials: options.credentials
24
+ }), Effect.provideService(FetchHttpClient.Fetch, options.fetch ?? globalThis.fetch));
25
+ });
26
+ //#endregion
27
+ export { httpClient };
28
+
29
+ //# sourceMappingURL=http.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http.js","names":[],"sources":["../src/http.ts"],"sourcesContent":["import { BackendError } from \"@party-stack/ontology-backend\";\nimport { makeOntologyHttpClient } from \"@party-stack/ontology-server/rpc/http\";\nimport { Effect } from \"effect\";\nimport { FetchHttpClient } from \"effect/http\";\n\nexport interface HttpClientOptions {\n readonly ontology?: string;\n readonly headers?: HeadersInit;\n readonly credentials?: RequestCredentials;\n readonly fetch?: typeof globalThis.fetch;\n}\n\n/** Lazy browser/Fetch binding. createLiveOntology or OntologyProvider owns its Scope. */\nexport const httpClient = Effect.fnUntraced(function* (url: string | URL, options: HttpClientOptions = {}) {\n const endpoint = yield* Effect.try({\n try: () => new URL(url, globalThis.location?.href).href,\n catch: (cause) =>\n new BackendError({\n operation: \"ontology.http\",\n kind: \"InvalidConfiguration\",\n retryable: false,\n message: \"Supply an absolute endpoint URL outside the browser.\",\n cause,\n }),\n });\n return yield* makeOntologyHttpClient({ url: endpoint, ontology: options.ontology }).pipe(\n Effect.provide(FetchHttpClient.layer),\n Effect.provideService(FetchHttpClient.RequestInit, {\n headers: options.headers,\n credentials: options.credentials,\n }),\n Effect.provideService(FetchHttpClient.Fetch, options.fetch ?? globalThis.fetch)\n );\n});\n"],"mappings":";;;;;;AAaA,MAAa,aAAa,OAAO,WAAW,WAAW,KAAmB,UAA6B,CAAC,GAAG;CACvG,MAAM,WAAW,OAAO,OAAO,IAAI;EAC/B,WAAW,IAAI,IAAI,KAAK,WAAW,UAAU,IAAI,CAAC,CAAC;EACnD,QAAQ,UACJ,IAAI,aAAa;GACb,WAAW;GACX,MAAM;GACN,WAAW;GACX,SAAS;GACT;EACJ,CAAC;CACT,CAAC;CACD,OAAO,OAAO,uBAAuB;EAAE,KAAK;EAAU,UAAU,QAAQ;CAAS,CAAC,CAAC,CAAC,KAChF,OAAO,QAAQ,gBAAgB,KAAK,GACpC,OAAO,eAAe,gBAAgB,aAAa;EAC/C,SAAS,QAAQ;EACjB,aAAa,QAAQ;CACzB,CAAC,GACD,OAAO,eAAe,gBAAgB,OAAO,QAAQ,SAAS,WAAW,KAAK,CAClF;AACJ,CAAC"}
package/lib/index.d.ts CHANGED
@@ -1,30 +1,24 @@
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";
1
+ import { OntologyPullConfig, OntologyPullContext } from "./OntologyPullConfig.js";
2
+ import { OntologyCollectionDescriptors, OntologyLinkDefinitions, ontologyCollections } from "./tanstack/descriptors.js";
3
+ import { createOntologyClient } from "./client.js";
4
+ import { OntologyApplyActionResult, OntologyAttachmentIdMapping } from "./live/actions/types.js";
5
+ import { EnqueuedOntologyAction, OntologyActionRequest, OntologyOutbox, OntologyOutboxEntry, OntologyOutboxStatus } from "./live/outbox/types.js";
6
+ import { LiveOntologyAction, LiveOntologyActionOptions } from "./live/actions/createLiveOntologyAction.js";
7
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
8
  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";
9
+ import { OntologyMutator, OntologyMutatorObjects, OntologyMutatorRegistry, OntologyMutatorTx, OntologyPropertyChange, OntologyQueryFunctionHandler, OntologyQueryFunctionRegistry, OntologyReadTx, PrepareTransactionSources } from "./live/mutators/types.js";
10
+ import { OntologyCollection } from "./live/objects/types.js";
11
+ import { BoundPins, NoPinInputs, OntologyPins, PinDescriptor, PinInputArgs, PinInputs, PinRecord, definePin, makeOntologyPins } from "./live/pins.js";
12
+ import { CreateLiveOntologyOpts, DecryptOptions, LiveOntology, LiveOntologyActions, LiveOntologyDecrypt, LiveOntologyFactoryOptions, LiveOntologyObjects, LiveOntologyOptions, LiveOntologyOutboxFailureStrategy, LiveOntologyOutboxOptions, LiveOntologyPins, LiveOntologyQueryFunction, LiveOntologyQueryFunctions, LiveOntologyWriteVisibility, LiveOntologyWrites, OntologyDefinition, OntologyDiagnostics, PinGraph, PinOptions, PinStatus, createLiveOntology, makeLiveOntology } from "./live/LiveOntology.js";
13
+ import { createReadTx } from "./live/mutators/createReadTx.js";
14
+ import { StorageOntologyBackendOptions, makeStorageOntologyBackend } from "./live/storageBackend.js";
24
15
  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
16
  import { PullOptions, pull } from "./meta/pull.js";
29
17
  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 };
18
+ import "./runtime/index.js";
19
+ import { BackendError } from "@party-stack/ontology-backend";
20
+ import { OntologyObject } from "@party-stack/ontology-spec";
21
+ import { ActionType as MetaActionType, LinkType as MetaLinkType, MetaOntology, ObjectType as MetaObjectType, PropertyDef as MetaObjectProperty, QueryFunctionType as MetaQueryFunctionType, ValueType as MetaValueType } from "@party-stack/ontology-spec/meta";
22
+ import { OntologyClient, OntologyClientDefinition, OntologyClientDefinitionStatus, OntologyClientOptions, OntologyDescription, OntologyServerClient } from "@party-stack/ontology-server/rpc";
23
+ export * from "@party-stack/ontology-spec";
24
+ export { type AttachmentMetadata, type BackendError, BoundPins, CreateLiveOntologyOpts, DecryptOptions, EnqueuedOntologyAction, LiveOntology, type LiveOntologyAction, type LiveOntologyActionOptions, LiveOntologyActions, type LiveOntologyAttachments, LiveOntologyDecrypt, LiveOntologyFactoryOptions, LiveOntologyObjects, LiveOntologyOptions, LiveOntologyOutboxFailureStrategy, LiveOntologyOutboxOptions, LiveOntologyPins, LiveOntologyQueryFunction, LiveOntologyQueryFunctions, LiveOntologyWriteVisibility, LiveOntologyWrites, type MetaActionType, type MetaLinkType, type MetaObjectProperty, type MetaObjectType, type MetaOntology, type MetaQueryFunctionType, type MetaValueType, NoPinInputs, OntologyActionRequest, type OntologyApplyActionResult, type OntologyAttachmentIdMapping, type OntologyClient, type OntologyClientDefinition, type OntologyClientDefinitionStatus, type OntologyClientOptions, type OntologyCollection, type OntologyCollectionDescriptors, type OntologyDefinition, type OntologyDescription, OntologyDiagnostics, type OntologyLinkDefinitions, OntologyMutator, OntologyMutatorObjects, OntologyMutatorRegistry, OntologyMutatorTx, type OntologyObject, OntologyOutbox, OntologyOutboxEntry, OntologyOutboxStatus, OntologyPins, OntologyPropertyChange, OntologyPullConfig, OntologyPullContext, OntologyQueryFunctionHandler, OntologyQueryFunctionRegistry, OntologyReadTx, type OntologyServerClient, type PartialAttachmentMetadata, PinDescriptor, type PinGraph, PinInputArgs, PinInputs, type PinOptions, type PinRecord, type PinStatus, PrepareTransactionSources, type PullOptions, StorageOntologyBackendOptions, createLiveOntology, createMetaLiveOntology, createOntologyClient, createReadTx, definePin, makeLiveOntology, makeOntologyPins, makeStorageOntologyBackend, ontologyCollections, pull };
package/lib/index.js CHANGED
@@ -1,18 +1,12 @@
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";
1
+ import { ontologyCollections } from "./tanstack/descriptors.js";
2
+ import { createOntologyClient } from "./client.js";
3
+ import { createReadTx } from "./live/mutators/createReadTx.js";
4
+ import { definePin, makeOntologyPins } from "./live/pins.js";
5
+ import { createLiveOntology, makeLiveOntology } from "./live/LiveOntology.js";
6
+ import { makeStorageOntologyBackend } from "./live/storageBackend.js";
11
7
  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
8
  import { pull } from "./meta/pull.js";
17
9
  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 };
10
+ import "./runtime/index.js";
11
+ export * from "@party-stack/ontology-spec";
12
+ export { createLiveOntology, createMetaLiveOntology, createOntologyClient, createReadTx, definePin, makeLiveOntology, makeOntologyPins, makeStorageOntologyBackend, ontologyCollections, pull };
@@ -1,16 +1 @@
1
- import { OntologyIR } from "../ir/generated/types.js";
2
- import { OntologyActionParametersTarget, OntologyObjectTarget, OntologyQueryFunctionParametersTarget, OntologyQueryFunctionReturnTarget, OntologyTypeTarget } from "../utils/targets.js";
3
- //#region src/json/index.d.ts
4
- export type JsonTarget<IR extends OntologyIR> = OntologyTypeTarget<IR> | OntologyObjectTarget<IR> | OntologyActionParametersTarget<IR> | OntologyQueryFunctionParametersTarget<IR> | OntologyQueryFunctionReturnTarget<IR>;
5
- export declare function decode<IR extends OntologyIR>(opts: {
6
- ir: IR;
7
- target: JsonTarget<IR>;
8
- value: unknown;
9
- }): unknown;
10
- export declare function encode<IR extends OntologyIR>(opts: {
11
- ir: IR;
12
- target: JsonTarget<IR>;
13
- value: unknown;
14
- }): unknown;
15
- //#endregion
16
- //# sourceMappingURL=index.d.ts.map
1
+ export * from "@party-stack/ontology-spec/json";