@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.
- package/README.md +31 -0
- package/lib/OntologyPullConfig.d.ts +4 -17
- package/lib/OntologyPullConfig.d.ts.map +1 -1
- package/lib/authentication.d.ts +1068 -0
- package/lib/authentication.d.ts.map +1 -0
- package/lib/authentication.js +55 -0
- package/lib/authentication.js.map +1 -0
- package/lib/cli/index.js +19 -45
- package/lib/cli/index.js.map +1 -1
- package/lib/cli/pull.d.ts.map +1 -1
- package/lib/cli/pull.js +16 -29
- package/lib/cli/pull.js.map +1 -1
- package/lib/client.d.ts +11 -0
- package/lib/client.d.ts.map +1 -0
- package/lib/client.js +21 -0
- package/lib/client.js.map +1 -0
- package/lib/examples/blog.d.ts +2 -387
- package/lib/examples/blog.js +1 -353
- package/lib/examples/blog.live-queries.d.ts +1 -1
- package/lib/examples/blog.live-queries.d.ts.map +1 -1
- package/lib/examples/blog.live-queries.js +1 -1
- package/lib/examples/blog.live-queries.js.map +1 -1
- package/lib/examples/generated/collections.d.ts +7 -0
- package/lib/examples/generated/collections.d.ts.map +1 -0
- package/lib/examples/generated/collections.js +12 -0
- package/lib/examples/generated/collections.js.map +1 -0
- package/lib/examples/generated/live.d.ts +2 -2
- package/lib/examples/generated/live.d.ts.map +1 -1
- package/lib/examples/generated/live.js.map +1 -1
- package/lib/http.d.ts +13 -0
- package/lib/http.d.ts.map +1 -0
- package/lib/http.js +29 -0
- package/lib/http.js.map +1 -0
- package/lib/index.d.ts +19 -25
- package/lib/index.js +9 -15
- package/lib/json/index.d.ts +1 -16
- package/lib/json/index.js +2 -132
- package/lib/live/LiveOntology.d.ts +114 -50
- package/lib/live/LiveOntology.d.ts.map +1 -1
- package/lib/live/LiveOntology.js +23 -103
- package/lib/live/LiveOntology.js.map +1 -1
- package/lib/live/actions/createLiveOntologyAction.d.ts +15 -16
- package/lib/live/actions/createLiveOntologyAction.d.ts.map +1 -1
- package/lib/live/actions/createLiveOntologyAction.js +3 -11
- package/lib/live/actions/createLiveOntologyAction.js.map +1 -1
- package/lib/live/actions/types.d.ts +21 -0
- package/lib/live/actions/types.d.ts.map +1 -0
- package/lib/live/attachments/createLiveOntologyAttachments.d.ts +30 -19
- package/lib/live/attachments/createLiveOntologyAttachments.d.ts.map +1 -1
- package/lib/live/attachments/createLiveOntologyAttachments.js +43 -60
- package/lib/live/attachments/createLiveOntologyAttachments.js.map +1 -1
- package/lib/live/attachments/types.d.ts +4 -3
- package/lib/live/index.d.ts +10 -10
- package/lib/live/index.js +5 -6
- package/lib/live/mutators/createReadTx.d.ts +5 -0
- package/lib/live/mutators/createReadTx.d.ts.map +1 -0
- package/lib/live/mutators/createReadTx.js +19 -0
- package/lib/live/mutators/createReadTx.js.map +1 -0
- package/lib/live/mutators/types.d.ts +7 -2
- package/lib/live/mutators/types.d.ts.map +1 -1
- package/lib/live/objects/types.d.ts +6 -0
- package/lib/live/objects/types.d.ts.map +1 -0
- package/lib/live/outbox/types.d.ts +24 -15
- package/lib/live/outbox/types.d.ts.map +1 -1
- package/lib/live/outbox/types.js +1 -11
- package/lib/live/pins.d.ts +51 -0
- package/lib/live/pins.d.ts.map +1 -0
- package/lib/live/pins.js +113 -0
- package/lib/live/pins.js.map +1 -0
- package/lib/live/storageBackend.d.ts +50 -0
- package/lib/live/storageBackend.d.ts.map +1 -0
- package/lib/live/storageBackend.js +42 -0
- package/lib/live/storageBackend.js.map +1 -0
- package/lib/local.d.ts +15 -0
- package/lib/local.d.ts.map +1 -0
- package/lib/local.js +19 -0
- package/lib/local.js.map +1 -0
- package/lib/meta/generated/collections.d.ts +7 -0
- package/lib/meta/generated/collections.d.ts.map +1 -0
- package/lib/meta/generated/collections.js +15 -0
- package/lib/meta/generated/collections.js.map +1 -0
- package/lib/meta/generated/live.d.ts +3 -3
- package/lib/meta/generated/live.d.ts.map +1 -1
- package/lib/meta/generated/live.js +2 -2
- package/lib/meta/generated/live.js.map +1 -1
- package/lib/meta/pull.d.ts +5 -9
- package/lib/meta/pull.d.ts.map +1 -1
- package/lib/meta/pull.js +5 -43
- package/lib/meta/pull.js.map +1 -1
- package/lib/query.d.ts +1 -0
- package/lib/query.js +2 -0
- package/lib/runtime/host.d.ts +35 -0
- package/lib/runtime/host.d.ts.map +1 -0
- package/lib/runtime/host.js +39 -0
- package/lib/runtime/host.js.map +1 -0
- package/lib/runtime/index.d.ts +2 -0
- package/lib/runtime/index.js +1 -0
- package/lib/runtime/live.d.ts +25 -0
- package/lib/runtime/live.d.ts.map +1 -0
- package/lib/runtime/live.js +31 -0
- package/lib/runtime/live.js.map +1 -0
- package/lib/runtime/resource.d.ts +24 -0
- package/lib/runtime/resource.d.ts.map +1 -0
- package/lib/runtime/resource.js +127 -0
- package/lib/runtime/resource.js.map +1 -0
- package/lib/runtime/transactions.d.ts +27 -0
- package/lib/runtime/transactions.d.ts.map +1 -0
- package/lib/runtime/transactions.js +188 -0
- package/lib/runtime/transactions.js.map +1 -0
- package/lib/runtime/view.d.ts +25 -0
- package/lib/runtime/view.d.ts.map +1 -0
- package/lib/runtime/view.js +256 -0
- package/lib/runtime/view.js.map +1 -0
- package/lib/tanstack/collections.d.ts +73 -0
- package/lib/tanstack/collections.d.ts.map +1 -0
- package/lib/tanstack/collections.js +495 -0
- package/lib/tanstack/collections.js.map +1 -0
- package/lib/tanstack/createLocalCollection.d.ts +14 -0
- package/lib/tanstack/createLocalCollection.d.ts.map +1 -0
- package/lib/tanstack/createLocalCollection.js +9 -0
- package/lib/tanstack/createLocalCollection.js.map +1 -0
- package/lib/tanstack/descriptors.d.ts +33 -0
- package/lib/tanstack/descriptors.d.ts.map +1 -0
- package/lib/tanstack/descriptors.js +38 -0
- package/lib/tanstack/descriptors.js.map +1 -0
- package/lib/tanstack/diagnostics.d.ts +23 -0
- package/lib/tanstack/diagnostics.d.ts.map +1 -0
- package/lib/tanstack/diagnostics.js +14 -0
- package/lib/tanstack/diagnostics.js.map +1 -0
- package/lib/tanstack/index.d.ts +6 -0
- package/lib/tanstack/index.js +6 -0
- package/lib/tanstack/localCollection.d.ts +14 -0
- package/lib/tanstack/localCollection.d.ts.map +1 -0
- package/lib/tanstack/localCollection.js +73 -0
- package/lib/tanstack/localCollection.js.map +1 -0
- package/lib/tanstack/subset.d.ts +28 -0
- package/lib/tanstack/subset.d.ts.map +1 -0
- package/lib/tanstack/subset.js +290 -0
- package/lib/tanstack/subset.js.map +1 -0
- package/lib/testing/sqlite.d.ts +40 -0
- package/lib/testing/sqlite.d.ts.map +1 -0
- package/lib/testing/sqlite.js +409 -0
- package/lib/testing/sqlite.js.map +1 -0
- package/lib/testing/sqliteBackend.d.ts +68 -0
- package/lib/testing/sqliteBackend.d.ts.map +1 -0
- package/lib/testing/sqliteBackend.js +34 -0
- package/lib/testing/sqliteBackend.js.map +1 -0
- package/lib/utils/index.d.ts +1 -8
- package/lib/utils/index.js +2 -5
- package/lib/utils/values.d.ts +1 -33
- package/lib/worker.d.ts +19 -0
- package/lib/worker.d.ts.map +1 -0
- package/lib/worker.js +46 -0
- package/lib/worker.js.map +1 -0
- package/package.json +54 -19
- package/lib/_virtual/_rolldown/runtime.js +0 -13
- package/lib/cli/format.d.ts +0 -4
- package/lib/cli/format.d.ts.map +0 -1
- package/lib/cli/format.js +0 -19
- package/lib/cli/format.js.map +0 -1
- package/lib/cli/generate.d.ts +0 -10
- package/lib/cli/generate.d.ts.map +0 -1
- package/lib/cli/generate.js +0 -108
- package/lib/cli/generate.js.map +0 -1
- package/lib/examples/blog.d.ts.map +0 -1
- package/lib/examples/blog.js.map +0 -1
- package/lib/generate/builders.d.ts +0 -12
- package/lib/generate/builders.d.ts.map +0 -1
- package/lib/generate/builders.js +0 -58
- package/lib/generate/builders.js.map +0 -1
- package/lib/generate/constants.d.ts +0 -5
- package/lib/generate/constants.d.ts.map +0 -1
- package/lib/generate/constants.js +0 -28
- package/lib/generate/constants.js.map +0 -1
- package/lib/generate/index.d.ts +0 -6
- package/lib/generate/index.js +0 -6
- package/lib/generate/live.d.ts +0 -12
- package/lib/generate/live.d.ts.map +0 -1
- package/lib/generate/live.js +0 -48
- package/lib/generate/live.js.map +0 -1
- package/lib/generate/ontology.d.ts +0 -8
- package/lib/generate/ontology.d.ts.map +0 -1
- package/lib/generate/ontology.js +0 -501
- package/lib/generate/ontology.js.map +0 -1
- package/lib/generate/types.d.ts +0 -17
- package/lib/generate/types.d.ts.map +0 -1
- package/lib/generate/types.js +0 -216
- package/lib/generate/types.js.map +0 -1
- package/lib/generate/utils/buildJsDocs.d.ts +0 -10
- package/lib/generate/utils/buildJsDocs.d.ts.map +0 -1
- package/lib/generate/utils/buildJsDocs.js +0 -16
- package/lib/generate/utils/buildJsDocs.js.map +0 -1
- package/lib/infer.d.ts +0 -222
- package/lib/infer.d.ts.map +0 -1
- package/lib/infer.js +0 -14
- package/lib/infer.js.map +0 -1
- package/lib/installation/createMetaOntologyConfiguration.d.ts +0 -10
- package/lib/installation/createMetaOntologyConfiguration.d.ts.map +0 -1
- package/lib/installation/createMetaOntologyConfiguration.js +0 -16
- package/lib/installation/createMetaOntologyConfiguration.js.map +0 -1
- package/lib/installation/createOntologyBackendInstallation.d.ts +0 -5
- package/lib/installation/createOntologyBackendInstallation.d.ts.map +0 -1
- package/lib/installation/createOntologyBackendInstallation.js +0 -221
- package/lib/installation/createOntologyBackendInstallation.js.map +0 -1
- package/lib/installation/index.d.ts +0 -4
- package/lib/installation/index.js +0 -3
- package/lib/installation/types.d.ts +0 -94
- package/lib/installation/types.d.ts.map +0 -1
- package/lib/ir/generated/builders.d.ts +0 -380
- package/lib/ir/generated/builders.d.ts.map +0 -1
- package/lib/ir/generated/builders.js +0 -186
- package/lib/ir/generated/builders.js.map +0 -1
- package/lib/ir/generated/constants.d.ts +0 -265
- package/lib/ir/generated/constants.d.ts.map +0 -1
- package/lib/ir/generated/constants.js +0 -165
- package/lib/ir/generated/constants.js.map +0 -1
- package/lib/ir/generated/types.d.ts +0 -416
- package/lib/ir/generated/types.d.ts.map +0 -1
- package/lib/ir/index.d.ts +0 -4
- package/lib/ir/index.js +0 -3
- package/lib/ir/schema.d.ts +0 -2246
- package/lib/ir/schema.d.ts.map +0 -1
- package/lib/ir/schema.js +0 -1187
- package/lib/ir/schema.js.map +0 -1
- package/lib/ir/validate.d.ts +0 -8
- package/lib/ir/validate.d.ts.map +0 -1
- package/lib/ir/validate.js +0 -623
- package/lib/ir/validate.js.map +0 -1
- package/lib/json/index.d.ts.map +0 -1
- package/lib/json/index.js.map +0 -1
- package/lib/lenses.d.ts +0 -21
- package/lib/lenses.d.ts.map +0 -1
- package/lib/lenses.js +0 -110
- package/lib/lenses.js.map +0 -1
- package/lib/live/OntologyBackendAdapter.d.ts +0 -100
- package/lib/live/OntologyBackendAdapter.d.ts.map +0 -1
- package/lib/live/OntologyBackendAdapter.js +0 -1
- package/lib/live/actions/createLiveOntologyActions.d.ts +0 -28
- package/lib/live/actions/createLiveOntologyActions.d.ts.map +0 -1
- package/lib/live/actions/createLiveOntologyActions.js +0 -139
- package/lib/live/actions/createLiveOntologyActions.js.map +0 -1
- package/lib/live/actions/prepareActionParameters.d.ts +0 -19
- package/lib/live/actions/prepareActionParameters.d.ts.map +0 -1
- package/lib/live/actions/prepareActionParameters.js +0 -213
- package/lib/live/actions/prepareActionParameters.js.map +0 -1
- package/lib/live/attachments/attachmentSources.d.ts +0 -10
- package/lib/live/attachments/attachmentSources.d.ts.map +0 -1
- package/lib/live/attachments/attachmentSources.js +0 -64
- package/lib/live/attachments/attachmentSources.js.map +0 -1
- package/lib/live/attachments/unsupportedOntologyAttachmentsAdapter.d.ts +0 -5
- package/lib/live/attachments/unsupportedOntologyAttachmentsAdapter.d.ts.map +0 -1
- package/lib/live/attachments/unsupportedOntologyAttachmentsAdapter.js +0 -6
- package/lib/live/attachments/unsupportedOntologyAttachmentsAdapter.js.map +0 -1
- package/lib/live/expression.d.ts +0 -23
- package/lib/live/expression.d.ts.map +0 -1
- package/lib/live/expression.js +0 -160
- package/lib/live/expression.js.map +0 -1
- package/lib/live/mutators/OntologyEdits.d.ts +0 -15
- package/lib/live/mutators/OntologyEdits.d.ts.map +0 -1
- package/lib/live/mutators/OntologyEdits.js +0 -65
- package/lib/live/mutators/OntologyEdits.js.map +0 -1
- package/lib/live/mutators/createMutatorTx.d.ts +0 -11
- package/lib/live/mutators/createMutatorTx.d.ts.map +0 -1
- package/lib/live/mutators/createMutatorTx.js +0 -61
- package/lib/live/mutators/createMutatorTx.js.map +0 -1
- package/lib/live/mutators/runOptimisticAction.d.ts +0 -19
- package/lib/live/mutators/runOptimisticAction.d.ts.map +0 -1
- package/lib/live/mutators/runOptimisticAction.js +0 -30
- package/lib/live/mutators/runOptimisticAction.js.map +0 -1
- package/lib/live/objects/OntologyObject.d.ts +0 -4
- package/lib/live/objects/OntologyObject.d.ts.map +0 -1
- package/lib/live/objects/OntologyObject.js +0 -1
- package/lib/live/objects/createLiveOntologyObjectCollection.d.ts +0 -17
- package/lib/live/objects/createLiveOntologyObjectCollection.d.ts.map +0 -1
- package/lib/live/objects/createLiveOntologyObjectCollection.js +0 -55
- package/lib/live/objects/createLiveOntologyObjectCollection.js.map +0 -1
- package/lib/live/objects/ontologyObjectCollectionId.d.ts +0 -4
- package/lib/live/objects/ontologyObjectCollectionId.d.ts.map +0 -1
- package/lib/live/objects/ontologyObjectCollectionId.js +0 -8
- package/lib/live/objects/ontologyObjectCollectionId.js.map +0 -1
- package/lib/live/outbox/createOntologyOutbox.d.ts +0 -23
- package/lib/live/outbox/createOntologyOutbox.d.ts.map +0 -1
- package/lib/live/outbox/createOntologyOutbox.js +0 -292
- package/lib/live/outbox/createOntologyOutbox.js.map +0 -1
- package/lib/live/outbox/leaderExecutor.d.ts +0 -20
- package/lib/live/outbox/leaderExecutor.d.ts.map +0 -1
- package/lib/live/outbox/leaderExecutor.js +0 -130
- package/lib/live/outbox/leaderExecutor.js.map +0 -1
- package/lib/live/outbox/outboxService.d.ts +0 -7
- package/lib/live/outbox/outboxService.d.ts.map +0 -1
- package/lib/live/outbox/outboxService.js +0 -68
- package/lib/live/outbox/outboxService.js.map +0 -1
- package/lib/live/outbox/projectionManager.d.ts +0 -31
- package/lib/live/outbox/projectionManager.d.ts.map +0 -1
- package/lib/live/outbox/projectionManager.js +0 -127
- package/lib/live/outbox/projectionManager.js.map +0 -1
- package/lib/live/outbox/repository.d.ts +0 -31
- package/lib/live/outbox/repository.d.ts.map +0 -1
- package/lib/live/outbox/repository.js +0 -196
- package/lib/live/outbox/repository.js.map +0 -1
- package/lib/live/outbox/service.d.ts +0 -61
- package/lib/live/outbox/service.d.ts.map +0 -1
- package/lib/live/outbox/service.js +0 -6
- package/lib/live/outbox/service.js.map +0 -1
- package/lib/live/outbox/types.js.map +0 -1
- package/lib/live/waitForCollectionReady.d.ts +0 -5
- package/lib/live/waitForCollectionReady.d.ts.map +0 -1
- package/lib/live/waitForCollectionReady.js +0 -49
- package/lib/live/waitForCollectionReady.js.map +0 -1
- package/lib/meta/createLocalMetaOntologyBackendAdapter.d.ts +0 -7
- package/lib/meta/createLocalMetaOntologyBackendAdapter.d.ts.map +0 -1
- package/lib/meta/createLocalMetaOntologyBackendAdapter.js +0 -44
- package/lib/meta/createLocalMetaOntologyBackendAdapter.js.map +0 -1
- package/lib/meta/generated/constants.d.ts +0 -265
- package/lib/meta/generated/constants.d.ts.map +0 -1
- package/lib/meta/generated/constants.js +0 -165
- package/lib/meta/generated/constants.js.map +0 -1
- package/lib/meta/generated/types.d.ts +0 -417
- package/lib/meta/generated/types.d.ts.map +0 -1
- package/lib/meta/generated/types.js +0 -1
- package/lib/meta/ontology.d.ts +0 -26
- package/lib/meta/ontology.d.ts.map +0 -1
- package/lib/meta/ontology.js +0 -111
- package/lib/meta/ontology.js.map +0 -1
- package/lib/utils/links.d.ts +0 -49
- package/lib/utils/links.d.ts.map +0 -1
- package/lib/utils/links.js +0 -13
- package/lib/utils/links.js.map +0 -1
- package/lib/utils/paths.d.ts +0 -6
- package/lib/utils/paths.d.ts.map +0 -1
- package/lib/utils/paths.js +0 -42
- package/lib/utils/paths.js.map +0 -1
- package/lib/utils/provide.d.ts +0 -4
- package/lib/utils/provide.d.ts.map +0 -1
- package/lib/utils/provide.js +0 -9
- package/lib/utils/provide.js.map +0 -1
- package/lib/utils/targets.d.ts +0 -37
- package/lib/utils/targets.d.ts.map +0 -1
- package/lib/utils/targets.js +0 -1
- package/lib/utils/typeNames.d.ts +0 -28
- package/lib/utils/typeNames.d.ts.map +0 -1
- package/lib/utils/typeNames.js +0 -1
- package/lib/utils/types.d.ts +0 -12
- package/lib/utils/types.d.ts.map +0 -1
- package/lib/utils/types.js +0 -48
- package/lib/utils/types.js.map +0 -1
- package/lib/utils/uncertain.d.ts +0 -11
- package/lib/utils/uncertain.d.ts.map +0 -1
- package/lib/utils/uncertain.js +0 -14
- package/lib/utils/uncertain.js.map +0 -1
- package/lib/utils/validation.d.ts +0 -7
- package/lib/utils/validation.d.ts.map +0 -1
- package/lib/utils/validation.js +0 -1
- package/lib/utils/values.d.ts.map +0 -1
- /package/lib/{installation → live/actions}/types.js +0 -0
- /package/lib/{ir/generated → live/objects}/types.js +0 -0
package/lib/examples/blog.js
CHANGED
|
@@ -1,353 +1 @@
|
|
|
1
|
-
|
|
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":";;;;
|
|
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
|
|
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 {
|
|
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:
|
|
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,
|
|
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 {
|
|
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
|
package/lib/http.js.map
ADDED
|
@@ -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 {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import "./
|
|
6
|
-
import {
|
|
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 {
|
|
11
|
-
import { OntologyCollection } from "./live/objects/
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
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
|
-
|
|
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 {
|
|
2
|
-
import {
|
|
3
|
-
import "./
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
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
|
-
|
|
10
|
+
import "./runtime/index.js";
|
|
11
|
+
export * from "@party-stack/ontology-spec";
|
|
12
|
+
export { createLiveOntology, createMetaLiveOntology, createOntologyClient, createReadTx, definePin, makeLiveOntology, makeOntologyPins, makeStorageOntologyBackend, ontologyCollections, pull };
|
package/lib/json/index.d.ts
CHANGED
|
@@ -1,16 +1 @@
|
|
|
1
|
-
|
|
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";
|