@party-stack/ontology 0.19.0 → 0.20.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/lib/OntologyPullConfig.d.ts +15 -13
- package/lib/OntologyPullConfig.d.ts.map +1 -1
- package/lib/OntologyPullConfig.js +0 -1
- package/lib/cli/format.d.ts +4 -0
- package/lib/cli/format.d.ts.map +1 -0
- package/lib/cli/format.js +19 -0
- package/lib/cli/format.js.map +1 -0
- package/lib/cli/generate.d.ts +6 -5
- package/lib/cli/generate.d.ts.map +1 -1
- package/lib/cli/generate.js +86 -110
- package/lib/cli/generate.js.map +1 -1
- package/lib/cli/index.d.ts +1 -3
- package/lib/cli/index.js +42 -59
- package/lib/cli/index.js.map +1 -1
- package/lib/cli/pull.d.ts +3 -1
- package/lib/cli/pull.d.ts.map +1 -1
- package/lib/cli/pull.js +42 -60
- package/lib/cli/pull.js.map +1 -1
- package/lib/examples/blog.d.ts +347 -345
- package/lib/examples/blog.d.ts.map +1 -1
- package/lib/examples/blog.js +350 -337
- package/lib/examples/blog.js.map +1 -1
- package/lib/examples/blog.live-queries.d.ts +8 -3
- package/lib/examples/blog.live-queries.d.ts.map +1 -1
- package/lib/examples/blog.live-queries.js +28 -44
- package/lib/examples/blog.live-queries.js.map +1 -1
- package/lib/examples/generated/constants.d.ts +1 -2
- package/lib/examples/generated/constants.js +0 -2
- package/lib/examples/generated/live.d.ts +5 -3
- package/lib/examples/generated/live.d.ts.map +1 -1
- package/lib/examples/generated/live.js +12 -8
- package/lib/examples/generated/live.js.map +1 -1
- package/lib/examples/generated/types.d.ts +52 -50
- package/lib/examples/generated/types.d.ts.map +1 -1
- package/lib/examples/generated/types.js +0 -2
- package/lib/generate/builders.d.ts +8 -5
- package/lib/generate/builders.d.ts.map +1 -1
- package/lib/generate/builders.js +53 -55
- package/lib/generate/builders.js.map +1 -1
- package/lib/generate/constants.d.ts +3 -1
- package/lib/generate/constants.d.ts.map +1 -1
- package/lib/generate/constants.js +23 -26
- package/lib/generate/constants.js.map +1 -1
- package/lib/generate/index.d.ts +6 -6
- package/lib/generate/index.js +6 -6
- package/lib/generate/live.d.ts +8 -6
- package/lib/generate/live.d.ts.map +1 -1
- package/lib/generate/live.js +43 -42
- package/lib/generate/live.js.map +1 -1
- package/lib/generate/ontology.d.ts +4 -2
- package/lib/generate/ontology.d.ts.map +1 -1
- package/lib/generate/ontology.js +453 -354
- package/lib/generate/ontology.js.map +1 -1
- package/lib/generate/types.d.ts +7 -5
- package/lib/generate/types.d.ts.map +1 -1
- package/lib/generate/types.js +190 -262
- package/lib/generate/types.js.map +1 -1
- package/lib/generate/utils/buildJsDocs.d.ts +7 -4
- package/lib/generate/utils/buildJsDocs.d.ts.map +1 -1
- package/lib/generate/utils/buildJsDocs.js +14 -10
- package/lib/generate/utils/buildJsDocs.js.map +1 -1
- package/lib/index.d.ts +30 -13
- package/lib/index.js +18 -10
- package/lib/infer.d.ts +129 -151
- package/lib/infer.d.ts.map +1 -1
- package/lib/infer.js +10 -6
- package/lib/infer.js.map +1 -1
- package/lib/installation/createMetaOntologyConfiguration.d.ts +6 -3
- package/lib/installation/createMetaOntologyConfiguration.d.ts.map +1 -1
- package/lib/installation/createMetaOntologyConfiguration.js +13 -11
- package/lib/installation/createMetaOntologyConfiguration.js.map +1 -1
- package/lib/installation/createOntologyBackendInstallation.d.ts +3 -1
- package/lib/installation/createOntologyBackendInstallation.d.ts.map +1 -1
- package/lib/installation/createOntologyBackendInstallation.js +205 -268
- package/lib/installation/createOntologyBackendInstallation.js.map +1 -1
- package/lib/installation/index.d.ts +4 -4
- package/lib/installation/index.js +3 -3
- package/lib/installation/types.d.ts +83 -80
- package/lib/installation/types.d.ts.map +1 -1
- package/lib/installation/types.js +0 -1
- package/lib/ir/generated/builders.d.ts +294 -382
- package/lib/ir/generated/builders.d.ts.map +1 -1
- package/lib/ir/generated/builders.js +180 -119
- package/lib/ir/generated/builders.js.map +1 -1
- package/lib/ir/generated/constants.d.ts +137 -135
- package/lib/ir/generated/constants.d.ts.map +1 -1
- package/lib/ir/generated/constants.js +162 -129
- package/lib/ir/generated/constants.js.map +1 -1
- package/lib/ir/generated/types.d.ts +236 -234
- package/lib/ir/generated/types.d.ts.map +1 -1
- package/lib/ir/generated/types.js +0 -2
- package/lib/ir/index.d.ts +4 -4
- package/lib/ir/index.js +3 -4
- package/lib/ir/schema.d.ts +2174 -2172
- package/lib/ir/schema.d.ts.map +1 -1
- package/lib/ir/schema.js +1184 -1343
- package/lib/ir/schema.js.map +1 -1
- package/lib/ir/validate.d.ts +5 -3
- package/lib/ir/validate.d.ts.map +1 -1
- package/lib/ir/validate.js +589 -707
- package/lib/ir/validate.js.map +1 -1
- package/lib/json/index.d.ts +10 -8
- package/lib/json/index.d.ts.map +1 -1
- package/lib/json/index.js +101 -135
- package/lib/json/index.js.map +1 -1
- package/lib/lenses.d.ts +7 -4
- package/lib/lenses.d.ts.map +1 -1
- package/lib/lenses.js +96 -132
- package/lib/lenses.js.map +1 -1
- package/lib/live/LiveOntology.d.ts +55 -60
- package/lib/live/LiveOntology.d.ts.map +1 -1
- package/lib/live/LiveOntology.js +98 -124
- package/lib/live/LiveOntology.js.map +1 -1
- package/lib/live/OntologyBackendAdapter.d.ts +84 -77
- package/lib/live/OntologyBackendAdapter.d.ts.map +1 -1
- package/lib/live/OntologyBackendAdapter.js +0 -1
- package/lib/live/actions/createLiveOntologyAction.d.ts +27 -24
- package/lib/live/actions/createLiveOntologyAction.d.ts.map +1 -1
- package/lib/live/actions/createLiveOntologyAction.js +24 -21
- package/lib/live/actions/createLiveOntologyAction.js.map +1 -1
- package/lib/live/actions/createLiveOntologyActions.d.ts +23 -20
- package/lib/live/actions/createLiveOntologyActions.d.ts.map +1 -1
- package/lib/live/actions/createLiveOntologyActions.js +131 -161
- package/lib/live/actions/createLiveOntologyActions.js.map +1 -1
- package/lib/live/actions/prepareActionParameters.d.ts +14 -11
- package/lib/live/actions/prepareActionParameters.d.ts.map +1 -1
- package/lib/live/actions/prepareActionParameters.js +190 -228
- package/lib/live/actions/prepareActionParameters.js.map +1 -1
- package/lib/live/attachments/attachmentSources.d.ts +7 -4
- package/lib/live/attachments/attachmentSources.d.ts.map +1 -1
- package/lib/live/attachments/attachmentSources.js +55 -71
- package/lib/live/attachments/attachmentSources.js.map +1 -1
- package/lib/live/attachments/createLiveOntologyAttachments.d.ts +47 -44
- package/lib/live/attachments/createLiveOntologyAttachments.d.ts.map +1 -1
- package/lib/live/attachments/createLiveOntologyAttachments.js +65 -83
- package/lib/live/attachments/createLiveOntologyAttachments.js.map +1 -1
- package/lib/live/attachments/types.d.ts +10 -8
- package/lib/live/attachments/types.d.ts.map +1 -1
- package/lib/live/attachments/types.js +0 -1
- package/lib/live/attachments/unsupportedOntologyAttachmentsAdapter.d.ts +3 -1
- package/lib/live/attachments/unsupportedOntologyAttachmentsAdapter.d.ts.map +1 -1
- package/lib/live/attachments/unsupportedOntologyAttachmentsAdapter.js +5 -3
- package/lib/live/attachments/unsupportedOntologyAttachmentsAdapter.js.map +1 -1
- package/lib/live/expression.d.ts +16 -13
- package/lib/live/expression.d.ts.map +1 -1
- package/lib/live/expression.js +142 -223
- package/lib/live/expression.js.map +1 -1
- package/lib/live/index.d.ts +12 -9
- package/lib/live/index.js +6 -8
- package/lib/live/mutators/OntologyEdits.d.ts +12 -9
- package/lib/live/mutators/OntologyEdits.d.ts.map +1 -1
- package/lib/live/mutators/OntologyEdits.js +57 -74
- package/lib/live/mutators/OntologyEdits.js.map +1 -1
- package/lib/live/mutators/createMutatorTx.d.ts +7 -5
- package/lib/live/mutators/createMutatorTx.d.ts.map +1 -1
- package/lib/live/mutators/createMutatorTx.js +53 -69
- package/lib/live/mutators/createMutatorTx.js.map +1 -1
- package/lib/live/mutators/runOptimisticAction.d.ts +16 -13
- package/lib/live/mutators/runOptimisticAction.d.ts.map +1 -1
- package/lib/live/mutators/runOptimisticAction.js +26 -26
- package/lib/live/mutators/runOptimisticAction.js.map +1 -1
- package/lib/live/mutators/types.d.ts +18 -16
- package/lib/live/mutators/types.d.ts.map +1 -1
- package/lib/live/mutators/types.js +0 -1
- package/lib/live/objects/OntologyObject.d.ts +2 -0
- package/lib/live/objects/OntologyObject.d.ts.map +1 -1
- package/lib/live/objects/OntologyObject.js +0 -1
- package/lib/live/objects/createLiveOntologyObjectCollection.d.ts +14 -11
- package/lib/live/objects/createLiveOntologyObjectCollection.d.ts.map +1 -1
- package/lib/live/objects/createLiveOntologyObjectCollection.js +62 -49
- package/lib/live/objects/createLiveOntologyObjectCollection.js.map +1 -1
- package/lib/live/objects/ontologyObjectCollectionId.d.ts +2 -0
- package/lib/live/objects/ontologyObjectCollectionId.d.ts.map +1 -1
- package/lib/live/objects/ontologyObjectCollectionId.js +6 -2
- package/lib/live/objects/ontologyObjectCollectionId.js.map +1 -1
- package/lib/live/outbox/createOntologyOutbox.d.ts +16 -14
- package/lib/live/outbox/createOntologyOutbox.d.ts.map +1 -1
- package/lib/live/outbox/createOntologyOutbox.js +275 -326
- package/lib/live/outbox/createOntologyOutbox.js.map +1 -1
- package/lib/live/outbox/leaderExecutor.d.ts +15 -13
- package/lib/live/outbox/leaderExecutor.d.ts.map +1 -1
- package/lib/live/outbox/leaderExecutor.js +114 -153
- package/lib/live/outbox/leaderExecutor.js.map +1 -1
- package/lib/live/outbox/outboxService.d.ts +4 -2
- package/lib/live/outbox/outboxService.d.ts.map +1 -1
- package/lib/live/outbox/outboxService.js +66 -71
- package/lib/live/outbox/outboxService.js.map +1 -1
- package/lib/live/outbox/projectionManager.d.ts +26 -24
- package/lib/live/outbox/projectionManager.d.ts.map +1 -1
- package/lib/live/outbox/projectionManager.js +121 -147
- package/lib/live/outbox/projectionManager.js.map +1 -1
- package/lib/live/outbox/repository.d.ts +27 -25
- package/lib/live/outbox/repository.d.ts.map +1 -1
- package/lib/live/outbox/repository.js +192 -241
- package/lib/live/outbox/repository.js.map +1 -1
- package/lib/live/outbox/service.d.ts +52 -50
- package/lib/live/outbox/service.d.ts.map +1 -1
- package/lib/live/outbox/service.js +5 -1
- package/lib/live/outbox/service.js.map +1 -1
- package/lib/live/outbox/types.d.ts +35 -33
- package/lib/live/outbox/types.d.ts.map +1 -1
- package/lib/live/outbox/types.js +10 -6
- package/lib/live/outbox/types.js.map +1 -1
- package/lib/live/waitForCollectionReady.d.ts +3 -1
- package/lib/live/waitForCollectionReady.d.ts.map +1 -1
- package/lib/live/waitForCollectionReady.js +44 -65
- package/lib/live/waitForCollectionReady.js.map +1 -1
- package/lib/meta/createLocalMetaOntologyBackendAdapter.d.ts +5 -2
- package/lib/meta/createLocalMetaOntologyBackendAdapter.d.ts.map +1 -1
- package/lib/meta/createLocalMetaOntologyBackendAdapter.js +37 -39
- package/lib/meta/createLocalMetaOntologyBackendAdapter.js.map +1 -1
- package/lib/meta/generated/constants.d.ts +137 -135
- package/lib/meta/generated/constants.d.ts.map +1 -1
- package/lib/meta/generated/constants.js +162 -129
- package/lib/meta/generated/constants.js.map +1 -1
- package/lib/meta/generated/live.d.ts +5 -2
- package/lib/meta/generated/live.d.ts.map +1 -1
- package/lib/meta/generated/live.js +12 -8
- package/lib/meta/generated/live.js.map +1 -1
- package/lib/meta/generated/types.d.ts +233 -231
- package/lib/meta/generated/types.d.ts.map +1 -1
- package/lib/meta/generated/types.js +0 -2
- package/lib/meta/ontology.d.ts +23 -21
- package/lib/meta/ontology.d.ts.map +1 -1
- package/lib/meta/ontology.js +100 -104
- package/lib/meta/ontology.js.map +1 -1
- package/lib/meta/pull.d.ts +8 -6
- package/lib/meta/pull.d.ts.map +1 -1
- package/lib/meta/pull.js +39 -52
- package/lib/meta/pull.js.map +1 -1
- package/lib/utils/index.d.ts +8 -8
- package/lib/utils/index.js +5 -6
- package/lib/utils/links.d.ts +34 -31
- package/lib/utils/links.d.ts.map +1 -1
- package/lib/utils/links.js +10 -17
- package/lib/utils/links.js.map +1 -1
- package/lib/utils/paths.d.ts +2 -0
- package/lib/utils/paths.d.ts.map +1 -1
- package/lib/utils/paths.js +32 -44
- package/lib/utils/paths.js.map +1 -1
- package/lib/utils/provide.d.ts +2 -0
- package/lib/utils/provide.d.ts.map +1 -1
- package/lib/utils/provide.js +7 -9
- package/lib/utils/provide.js.map +1 -1
- package/lib/utils/targets.d.ts +20 -18
- package/lib/utils/targets.d.ts.map +1 -1
- package/lib/utils/targets.js +0 -1
- package/lib/utils/typeNames.d.ts +10 -8
- package/lib/utils/typeNames.d.ts.map +1 -1
- package/lib/utils/typeNames.js +0 -1
- package/lib/utils/types.d.ts +6 -4
- package/lib/utils/types.d.ts.map +1 -1
- package/lib/utils/types.js +38 -38
- package/lib/utils/types.js.map +1 -1
- package/lib/utils/uncertain.d.ts +5 -3
- package/lib/utils/uncertain.d.ts.map +1 -1
- package/lib/utils/uncertain.js +11 -9
- package/lib/utils/uncertain.js.map +1 -1
- package/lib/utils/validation.d.ts +4 -2
- package/lib/utils/validation.d.ts.map +1 -1
- package/lib/utils/validation.js +0 -1
- package/lib/utils/values.d.ts +18 -18
- package/lib/utils/values.d.ts.map +1 -1
- package/lib/utils/values.js +0 -1
- package/package.json +22 -26
- package/lib/OntologyPullConfig.js.map +0 -1
- package/lib/cli/index.d.ts.map +0 -1
- package/lib/cli/index.test.d.ts +0 -2
- package/lib/cli/index.test.d.ts.map +0 -1
- package/lib/cli/index.test.js +0 -34
- package/lib/cli/index.test.js.map +0 -1
- package/lib/cli/pull.test.d.ts +0 -2
- package/lib/cli/pull.test.d.ts.map +0 -1
- package/lib/cli/pull.test.js +0 -125
- package/lib/cli/pull.test.js.map +0 -1
- package/lib/examples/generated/constants.d.ts.map +0 -1
- package/lib/examples/generated/constants.js.map +0 -1
- package/lib/examples/generated/types.js.map +0 -1
- package/lib/generate/builders.test.d.ts +0 -2
- package/lib/generate/builders.test.d.ts.map +0 -1
- package/lib/generate/builders.test.js +0 -49
- package/lib/generate/builders.test.js.map +0 -1
- package/lib/generate/index.d.ts.map +0 -1
- package/lib/generate/index.js.map +0 -1
- package/lib/generate/live.test.d.ts +0 -2
- package/lib/generate/live.test.d.ts.map +0 -1
- package/lib/generate/live.test.js +0 -22
- package/lib/generate/live.test.js.map +0 -1
- package/lib/generate/ontology.test.d.ts +0 -2
- package/lib/generate/ontology.test.d.ts.map +0 -1
- package/lib/generate/ontology.test.js +0 -157
- package/lib/generate/ontology.test.js.map +0 -1
- package/lib/generate/types.test.d.ts +0 -2
- package/lib/generate/types.test.d.ts.map +0 -1
- package/lib/generate/types.test.js +0 -304
- package/lib/generate/types.test.js.map +0 -1
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/infer.test.d.ts +0 -2
- package/lib/infer.test.d.ts.map +0 -1
- package/lib/infer.test.js +0 -125
- package/lib/infer.test.js.map +0 -1
- package/lib/installation/createMetaOntologyConfiguration.test.d.ts +0 -2
- package/lib/installation/createMetaOntologyConfiguration.test.d.ts.map +0 -1
- package/lib/installation/createMetaOntologyConfiguration.test.js +0 -20
- package/lib/installation/createMetaOntologyConfiguration.test.js.map +0 -1
- package/lib/installation/createOntologyBackendInstallation.test.d.ts +0 -2
- package/lib/installation/createOntologyBackendInstallation.test.d.ts.map +0 -1
- package/lib/installation/createOntologyBackendInstallation.test.js +0 -320
- package/lib/installation/createOntologyBackendInstallation.test.js.map +0 -1
- package/lib/installation/index.d.ts.map +0 -1
- package/lib/installation/index.js.map +0 -1
- package/lib/installation/types.js.map +0 -1
- package/lib/ir/generated/types.js.map +0 -1
- package/lib/ir/index.d.ts.map +0 -1
- package/lib/ir/index.js.map +0 -1
- package/lib/ir/validate.test.d.ts +0 -2
- package/lib/ir/validate.test.d.ts.map +0 -1
- package/lib/ir/validate.test.js +0 -1061
- package/lib/ir/validate.test.js.map +0 -1
- package/lib/json/index.test.d.ts +0 -2
- package/lib/json/index.test.d.ts.map +0 -1
- package/lib/json/index.test.js +0 -142
- package/lib/json/index.test.js.map +0 -1
- package/lib/lenses.test.d.ts +0 -2
- package/lib/lenses.test.d.ts.map +0 -1
- package/lib/lenses.test.js +0 -80
- package/lib/lenses.test.js.map +0 -1
- package/lib/live/LiveOntology.test.d.ts +0 -2
- package/lib/live/LiveOntology.test.d.ts.map +0 -1
- package/lib/live/LiveOntology.test.js +0 -507
- package/lib/live/LiveOntology.test.js.map +0 -1
- package/lib/live/OntologyBackendAdapter.js.map +0 -1
- package/lib/live/actions/createLiveOntologyAction.test.d.ts +0 -2
- package/lib/live/actions/createLiveOntologyAction.test.d.ts.map +0 -1
- package/lib/live/actions/createLiveOntologyAction.test.js +0 -232
- package/lib/live/actions/createLiveOntologyAction.test.js.map +0 -1
- package/lib/live/actions/prepareActionParameters.test.d.ts +0 -2
- package/lib/live/actions/prepareActionParameters.test.d.ts.map +0 -1
- package/lib/live/actions/prepareActionParameters.test.js +0 -165
- package/lib/live/actions/prepareActionParameters.test.js.map +0 -1
- package/lib/live/attachments/attachmentMetadata.test.d.ts +0 -2
- package/lib/live/attachments/attachmentMetadata.test.d.ts.map +0 -1
- package/lib/live/attachments/attachmentMetadata.test.js +0 -73
- package/lib/live/attachments/attachmentMetadata.test.js.map +0 -1
- package/lib/live/attachments/createLiveOntologyAttachments.test.d.ts +0 -2
- package/lib/live/attachments/createLiveOntologyAttachments.test.d.ts.map +0 -1
- package/lib/live/attachments/createLiveOntologyAttachments.test.js +0 -363
- package/lib/live/attachments/createLiveOntologyAttachments.test.js.map +0 -1
- package/lib/live/attachments/types.js.map +0 -1
- package/lib/live/expression.test.d.ts +0 -2
- package/lib/live/expression.test.d.ts.map +0 -1
- package/lib/live/expression.test.js +0 -311
- package/lib/live/expression.test.js.map +0 -1
- package/lib/live/index.d.ts.map +0 -1
- package/lib/live/index.js.map +0 -1
- package/lib/live/mutators/OntologyEdits.test.d.ts +0 -2
- package/lib/live/mutators/OntologyEdits.test.d.ts.map +0 -1
- package/lib/live/mutators/OntologyEdits.test.js +0 -85
- package/lib/live/mutators/OntologyEdits.test.js.map +0 -1
- package/lib/live/mutators/createMutatorTx.test.d.ts +0 -2
- package/lib/live/mutators/createMutatorTx.test.d.ts.map +0 -1
- package/lib/live/mutators/createMutatorTx.test.js +0 -180
- package/lib/live/mutators/createMutatorTx.test.js.map +0 -1
- package/lib/live/mutators/types.js.map +0 -1
- package/lib/live/objects/OntologyObject.js.map +0 -1
- package/lib/live/objects/createLiveOntologyObjectCollection.test.d.ts +0 -2
- package/lib/live/objects/createLiveOntologyObjectCollection.test.d.ts.map +0 -1
- package/lib/live/objects/createLiveOntologyObjectCollection.test.js +0 -310
- package/lib/live/objects/createLiveOntologyObjectCollection.test.js.map +0 -1
- package/lib/live/outbox/createOntologyOutbox.test.d.ts +0 -2
- package/lib/live/outbox/createOntologyOutbox.test.d.ts.map +0 -1
- package/lib/live/outbox/createOntologyOutbox.test.js +0 -1030
- package/lib/live/outbox/createOntologyOutbox.test.js.map +0 -1
- package/lib/meta/generated/types.js.map +0 -1
- package/lib/meta/ontology.test.d.ts +0 -2
- package/lib/meta/ontology.test.d.ts.map +0 -1
- package/lib/meta/ontology.test.js +0 -84
- package/lib/meta/ontology.test.js.map +0 -1
- package/lib/utils/index.d.ts.map +0 -1
- package/lib/utils/index.js.map +0 -1
- package/lib/utils/links.test.d.ts +0 -2
- package/lib/utils/links.test.d.ts.map +0 -1
- package/lib/utils/links.test.js +0 -109
- package/lib/utils/links.test.js.map +0 -1
- package/lib/utils/paths.test.d.ts +0 -2
- package/lib/utils/paths.test.d.ts.map +0 -1
- package/lib/utils/paths.test.js +0 -33
- package/lib/utils/paths.test.js.map +0 -1
- package/lib/utils/targets.js.map +0 -1
- package/lib/utils/typeNames.js.map +0 -1
- package/lib/utils/types.test.d.ts +0 -2
- package/lib/utils/types.test.d.ts.map +0 -1
- package/lib/utils/types.test.js +0 -157
- package/lib/utils/types.test.js.map +0 -1
- package/lib/utils/uncertain.test.d.ts +0 -2
- package/lib/utils/uncertain.test.d.ts.map +0 -1
- package/lib/utils/uncertain.test.js +0 -14
- package/lib/utils/uncertain.test.js.map +0 -1
- package/lib/utils/validation.js.map +0 -1
-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CAAC,aAAa,EAAE,EAAE,EAAE,cAAc,CAAC,CAAC;IAC1D,uBAAuB,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC;IAC3C,sBAAsB,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC;IAC1C,wBAAwB,CAAC,aAAa,EAAE,EAAE,EAAE,cAAc,CAAC,CAAC;IAC5D,OAAO,GAAG,eAAe,OAAO,aAAa,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC;AAChF,CAAC"}
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../src/generate/types.ts"],"sourcesContent":["import { pascalCase } from \"change-case\";\nimport { CodeBlockWriter, Project, Writers, type WriterFunction } from \"ts-morph\";\nimport { ImageMediaTypeOptions } from \"../ir/generated/constants.js\";\nimport { unwrapType } from \"../utils/types.js\";\nimport { buildJsDocs } from \"./utils/buildJsDocs.js\";\nimport type {\n OntologyIR,\n ObjectTypeDef,\n StructTypeDef,\n TypeDef,\n UnionTypeDef,\n} from \"../ir/generated/types.js\";\n\nfunction withWriter(fn: WriterFunction): string {\n const writer = new CodeBlockWriter();\n fn(writer);\n return writer.toString();\n}\n\nfunction union(options: string[]): string {\n if (options.length === 0) {\n return \"never\";\n }\n if (options.length === 1) {\n return options[0]!;\n }\n return withWriter(Writers.unionType(options[0]!, options[1]!, ...options.slice(2)));\n}\n\nfunction renderPropertyName(name: string): string {\n return /^[$A-Z_][0-9A-Z_$]*$/i.test(name) ? name : JSON.stringify(name);\n}\n\nexport interface GenerateTypeDefinitionsOpts {\n valuesImportPath?: string;\n objectTypes?: ReadonlyMap<string, ObjectTypeDef>;\n}\n\ninterface GenerateTypeContext {\n objectTypes?: ReadonlyMap<string, ObjectTypeDef>;\n}\n\nexport function generateForTypeDef(type: TypeDef, ctx: GenerateTypeContext = {}): string {\n switch (type.kind) {\n case \"string\": {\n if (type.value.constraint?.kind === \"enum\") {\n const options = type.value.constraint.value.options;\n return union(options.map((option) => `\"${option.value}\"`));\n }\n return \"string\";\n }\n\n case \"boolean\":\n return \"boolean\";\n\n case \"integer\":\n return \"v.integer\";\n\n case \"float\":\n return \"v.float\";\n\n case \"double\":\n return \"v.double\";\n\n case \"date\":\n return \"v.date\";\n\n case \"timestamp\":\n return \"v.timestamp\";\n\n case \"geopoint\":\n return \"v.geopoint\";\n\n case \"attachment\": {\n const content = type.value.constraint?.content;\n if (content?.kind !== \"image\") return \"v.attachment\";\n const mediaTypes = content.value.mediaTypes;\n return mediaTypes\n ? `v.attachment<${union(mediaTypes.map((mediaType) => JSON.stringify(mediaType)))}>`\n : `v.attachment<${union(\n ImageMediaTypeOptions.map((option) => JSON.stringify(option.value))\n )}>`;\n }\n\n case \"objectReference\": {\n const objectType = ctx.objectTypes?.get(type.value.objectType);\n if (!objectType) {\n throw new Error(\n `Cannot generate object reference type for unknown object type \"${type.value.objectType}\".`\n );\n }\n const primaryKey = objectType?.properties.find(\n (property) => property.name === objectType.primaryKey\n );\n if (!primaryKey) {\n throw new Error(\n `Cannot generate object reference type for \"${type.value.objectType}\" because primary key \"${objectType.primaryKey}\" is not a property.`\n );\n }\n return generateForTypeDef(primaryKey.type, ctx);\n }\n\n case \"unknown\":\n return \"unknown\";\n\n case \"list\":\n return `Array<${generateForTypeDef(type.value.elementType, ctx)}>`;\n\n case \"map\":\n return `Record<string, ${generateForTypeDef(type.value.valueType, ctx)}>`;\n\n case \"struct\":\n return generateForStructTypeDef(type.value, ctx);\n\n case \"union\":\n return generateForUnionTypeDef(type.value, ctx);\n\n case \"optional\":\n return union([generateForTypeDef(type.value.type, ctx), \"undefined\"]);\n\n case \"result\":\n return `v.Result<${generateForTypeDef(type.value.okType, ctx)}, ${generateForTypeDef(type.value.errType, ctx)}>`;\n\n case \"ref\":\n return type.value.name;\n }\n}\n\nfunction generateForStructTypeDef(type: StructTypeDef, ctx: GenerateTypeContext): string {\n if (type.fields.length === 0) {\n return \"Record<never, never>\";\n }\n\n return withWriter(\n Writers.objectType({\n properties: type.fields.map((field) => {\n const { type: fieldType, isOptional } = unwrapType(field.type);\n return {\n name: renderPropertyName(field.name),\n type: generateForTypeDef(fieldType, ctx),\n hasQuestionToken: isOptional,\n docs: buildJsDocs({ description: field.description, deprecated: field.deprecated }),\n };\n }),\n })\n );\n}\n\nfunction generateForUnionTypeDef(type: UnionTypeDef, ctx: GenerateTypeContext): string {\n const innerType = withWriter(\n Writers.objectType({\n properties: type.variants.map((variant) => ({\n name: renderPropertyName(variant.name),\n type: generateForTypeDef(variant.type, ctx),\n })),\n })\n );\n return `v.Union<${innerType}>`;\n}\n\nfunction collectTypeDefinitions(ir: OntologyIR): Pick<OntologyIR, \"types\"> {\n return {\n types: [\n ...ir.types,\n ...ir.objectTypes.map((objectType) => ({\n name: objectType.name,\n description: objectType.description,\n deprecated: objectType.deprecated,\n type: {\n kind: \"struct\" as const,\n value: {\n fields: objectType.properties,\n },\n },\n })),\n ],\n };\n}\n\nexport function generateTypeDefinitions(\n schema: Pick<OntologyIR, \"types\">,\n opts: GenerateTypeDefinitionsOpts = {}\n): string {\n const project = new Project({ useInMemoryFileSystem: true });\n const sourceFile = project.createSourceFile(\"types.ts\", \"\");\n\n sourceFile.addImportDeclaration({\n moduleSpecifier: opts.valuesImportPath ?? \"@party-stack/ontology/values\",\n namespaceImport: \"v\",\n });\n\n for (const type of schema.types) {\n sourceFile.addTypeAlias({\n name: type.name,\n isExported: true,\n type: generateForTypeDef(type.type, { objectTypes: opts.objectTypes }),\n docs: buildJsDocs({ description: type.description, deprecated: type.deprecated }),\n });\n }\n\n const typeAliases = sourceFile.getTypeAliases();\n for (const alias of typeAliases.slice(0, -1)) {\n alias.appendWhitespace(\"\\n\");\n }\n\n return sourceFile.getFullText().trim();\n}\n\nexport interface GenerateTypesOpts {\n outputTypeName?: string;\n}\n\nfunction addOntologyAggregateType(\n sourceFile: import(\"ts-morph\").SourceFile,\n ir: OntologyIR,\n outputTypeName: string\n): void {\n const properties = [\n {\n name: \"context\",\n type: `${outputTypeName}Context`,\n },\n {\n name: \"objectTypes\",\n type:\n ir.objectTypes.length === 0\n ? \"Record<never, never>\"\n : Writers.objectType({\n properties: ir.objectTypes.map((objectType) => ({\n name: renderPropertyName(objectType.name),\n type: objectType.name,\n })),\n }),\n },\n ];\n\n properties.push({\n name: \"actionTypes\",\n type:\n ir.actionTypes.length === 0\n ? \"Record<never, never>\"\n : Writers.objectType({\n properties: ir.actionTypes.map((action) => ({\n name: renderPropertyName(action.name),\n type: Writers.objectType({\n properties: [\n {\n name: \"parameters\",\n type: `${pascalCase(action.name)}Parameters`,\n },\n ],\n }),\n })),\n }),\n });\n\n properties.push({\n name: \"queryFunctionTypes\",\n type:\n ir.queryFunctionTypes.length === 0\n ? \"Record<never, never>\"\n : Writers.objectType({\n properties: ir.queryFunctionTypes.map((queryFunctionType) => ({\n name: renderPropertyName(queryFunctionType.name),\n type: Writers.objectType({\n properties: [\n {\n name: \"parameters\",\n type: `${pascalCase(queryFunctionType.name)}Parameters`,\n },\n {\n name: \"returnType\",\n type: `${pascalCase(queryFunctionType.name)}Return`,\n },\n ],\n }),\n })),\n }),\n });\n\n sourceFile.addTypeAlias({\n name: outputTypeName,\n isExported: true,\n type: Writers.objectType({ properties }),\n });\n}\n\nfunction addOntologyContextType(\n sourceFile: import(\"ts-morph\").SourceFile,\n ir: OntologyIR,\n outputTypeName: string\n): void {\n const objectTypes = new Map(ir.objectTypes.map((objectType) => [objectType.name, objectType]));\n sourceFile.addTypeAlias({\n name: `${outputTypeName}Context`,\n isExported: true,\n type: ir.contextType\n ? `${generateForTypeDef(ir.contextType, {\n objectTypes,\n })} & Record<string, unknown>`\n : \"Record<string, unknown>\",\n });\n}\n\nfunction addActionParameterTypes(sourceFile: import(\"ts-morph\").SourceFile, ir: OntologyIR): void {\n const objectTypes = new Map(ir.objectTypes.map((objectType) => [objectType.name, objectType]));\n for (const actionType of ir.actionTypes) {\n sourceFile.addTypeAlias({\n name: `${pascalCase(actionType.name)}Parameters`,\n isExported: true,\n type: withWriter(\n Writers.objectType({\n properties: actionType.parameters.map((parameter) => {\n const parameterType = parameter.type;\n const isOptional = parameterType.kind === \"optional\";\n const type = isOptional ? parameterType.value.type : parameterType;\n const renderedType = generateForTypeDef(type, { objectTypes });\n return {\n name: renderPropertyName(parameter.name),\n type: isOptional ? union([renderedType, \"null\"]) : renderedType,\n hasQuestionToken: isOptional || parameter.defaultValue !== undefined,\n };\n }),\n })\n ),\n });\n }\n}\n\nfunction addQueryParameterTypes(sourceFile: import(\"ts-morph\").SourceFile, ir: OntologyIR): void {\n const objectTypes = new Map(ir.objectTypes.map((objectType) => [objectType.name, objectType]));\n for (const queryFunctionType of ir.queryFunctionTypes) {\n sourceFile.addTypeAlias({\n name: `${pascalCase(queryFunctionType.name)}Parameters`,\n isExported: true,\n type: withWriter(\n Writers.objectType({\n properties: queryFunctionType.parameters.map((parameter) => {\n const parameterType = parameter.type;\n const isOptional = parameterType.kind === \"optional\";\n const type = isOptional ? parameterType.value.type : parameterType;\n const renderedType = generateForTypeDef(type, { objectTypes });\n return {\n name: renderPropertyName(parameter.name),\n type: isOptional ? union([renderedType, \"undefined\"]) : renderedType,\n hasQuestionToken: isOptional,\n };\n }),\n })\n ),\n });\n sourceFile.addTypeAlias({\n name: `${pascalCase(queryFunctionType.name)}Return`,\n isExported: true,\n type: generateForTypeDef(queryFunctionType.returnType, { objectTypes }),\n docs: buildJsDocs({\n description: queryFunctionType.description,\n deprecated: queryFunctionType.deprecated,\n }),\n });\n }\n}\n\nexport function generateTypes(ir: OntologyIR, opts: GenerateTypesOpts = {}): string {\n const outputTypeName = opts.outputTypeName ?? \"GeneratedOntology\";\n const objectTypes = new Map(ir.objectTypes.map((objectType) => [objectType.name, objectType]));\n const typeDefinitions = generateTypeDefinitions(collectTypeDefinitions(ir), {\n objectTypes,\n });\n const project = new Project({ useInMemoryFileSystem: true });\n const aggregateFile = project.createSourceFile(\"ontology-aggregate.ts\", \"\");\n addOntologyContextType(aggregateFile, ir, outputTypeName);\n addActionParameterTypes(aggregateFile, ir);\n addQueryParameterTypes(aggregateFile, ir);\n addOntologyAggregateType(aggregateFile, ir, outputTypeName);\n return `${typeDefinitions}\\n\\n${aggregateFile.getFullText().trim()}`.trim();\n}\n"],"mappings":";;;;;;AAaA,SAAS,WAAW,IAA4B;CAC5C,MAAM,SAAS,IAAI,gBAAgB;CACnC,GAAG,MAAM;CACT,OAAO,OAAO,SAAS;AAC3B;AAEA,SAAS,MAAM,SAA2B;CACtC,IAAI,QAAQ,WAAW,GACnB,OAAO;CAEX,IAAI,QAAQ,WAAW,GACnB,OAAO,QAAQ;CAEnB,OAAO,WAAW,QAAQ,UAAU,QAAQ,IAAK,QAAQ,IAAK,GAAG,QAAQ,MAAM,CAAC,CAAC,CAAC;AACtF;AAEA,SAAS,mBAAmB,MAAsB;CAC9C,OAAO,wBAAwB,KAAK,IAAI,IAAI,OAAO,KAAK,UAAU,IAAI;AAC1E;AAWA,SAAgB,mBAAmB,MAAe,MAA2B,CAAC,GAAW;CACrF,QAAQ,KAAK,MAAb;EACI,KAAK;GACD,IAAI,KAAK,MAAM,YAAY,SAAS,QAAQ;IACxC,MAAM,UAAU,KAAK,MAAM,WAAW,MAAM;IAC5C,OAAO,MAAM,QAAQ,KAAK,WAAW,IAAI,OAAO,MAAM,EAAE,CAAC;GAC7D;GACA,OAAO;EAGX,KAAK,WACD,OAAO;EAEX,KAAK,WACD,OAAO;EAEX,KAAK,SACD,OAAO;EAEX,KAAK,UACD,OAAO;EAEX,KAAK,QACD,OAAO;EAEX,KAAK,aACD,OAAO;EAEX,KAAK,YACD,OAAO;EAEX,KAAK,cAAc;GACf,MAAM,UAAU,KAAK,MAAM,YAAY;GACvC,IAAI,SAAS,SAAS,SAAS,OAAO;GACtC,MAAM,aAAa,QAAQ,MAAM;GACjC,OAAO,aACD,gBAAgB,MAAM,WAAW,KAAK,cAAc,KAAK,UAAU,SAAS,CAAC,CAAC,EAAE,KAChF,gBAAgB,MACZ,sBAAsB,KAAK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AAC;EACD,WAAW,aAAa;GACpB,MAAM,GAAG,WAAW,kBAAkB,IAAI,EAAE;GAC5C,YAAY;GACZ,MAAM,mBAAmB,kBAAkB,YAAY,EAAE,YAAY,CAAC;GACtE,MAAM,YAAY;IACd,aAAa,kBAAkB;IAC/B,YAAY,kBAAkB;GAClC,CAAC;EACL,CAAC;CACL;AACJ;AAEA,SAAgB,cAAc,IAAgB,OAA0B,CAAC,GAAW;CAChF,MAAM,iBAAiB,KAAK,kBAAkB;CAC9C,MAAM,cAAc,IAAI,IAAI,GAAG,YAAY,KAAK,eAAe,CAAC,WAAW,MAAM,UAAU,CAAC,CAAC;CAC7F,MAAM,kBAAkB,wBAAwB,uBAAuB,EAAE,GAAG,EACxE,YACJ,CAAC;CAED,MAAM,gBAAgB,IADF,QAAQ,EAAE,uBAAuB,KAAK,CAC9B,CAAC,CAAC,iBAAiB,yBAAyB,EAAE;CAC1E,uBAAuB,eAAe,IAAI,cAAc;CACxD,wBAAwB,eAAe,EAAE;CACzC,uBAAuB,eAAe,EAAE;CACxC,yBAAyB,eAAe,IAAI,cAAc;CAC1D,OAAO,GAAG,gBAAgB,MAAM,cAAc,YAAY,CAAC,CAAC,KAAK,IAAI,KAAK;AAC9E"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { Deprecation } from "../../ir/generated/types.js";
|
|
2
|
+
import "../../ir/index.js";
|
|
3
|
+
import { JSDocStructure, OptionalKind } from "ts-morph";
|
|
4
|
+
//#region src/generate/utils/buildJsDocs.d.ts
|
|
3
5
|
export declare function buildJsDocs(opts: {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
+
description?: string;
|
|
7
|
+
deprecated?: Deprecation;
|
|
6
8
|
}): OptionalKind<JSDocStructure>[] | undefined;
|
|
9
|
+
//#endregion
|
|
7
10
|
//# sourceMappingURL=buildJsDocs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildJsDocs.d.ts","
|
|
1
|
+
{"version":3,"file":"buildJsDocs.d.ts","names":[],"sources":["../../../src/generate/utils/buildJsDocs.ts"],"mappings":";;;;wBAGgB,YAAY;EACxB;EACA,aAAa;IACb,aAAa"}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
//#region src/generate/utils/buildJsDocs.ts
|
|
2
|
+
function buildJsDocs(opts) {
|
|
3
|
+
const { description, deprecated } = opts;
|
|
4
|
+
if (!description && !deprecated) return void 0;
|
|
5
|
+
return [{
|
|
6
|
+
description,
|
|
7
|
+
tags: deprecated ? [{
|
|
8
|
+
tagName: "deprecated",
|
|
9
|
+
text: deprecated.message
|
|
10
|
+
}] : void 0
|
|
11
|
+
}];
|
|
11
12
|
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { buildJsDocs };
|
|
15
|
+
|
|
12
16
|
//# sourceMappingURL=buildJsDocs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildJsDocs.js","
|
|
1
|
+
{"version":3,"file":"buildJsDocs.js","names":[],"sources":["../../../src/generate/utils/buildJsDocs.ts"],"sourcesContent":["import type { Deprecation } from \"../../ir/index.js\";\nimport type { JSDocStructure, OptionalKind } from \"ts-morph\";\n\nexport function buildJsDocs(opts: {\n description?: string;\n deprecated?: Deprecation;\n}): OptionalKind<JSDocStructure>[] | undefined {\n const { description, deprecated } = opts;\n if (!description && !deprecated) return undefined;\n\n return [\n {\n description,\n tags: deprecated ? [{ tagName: \"deprecated\", text: deprecated.message }] : undefined,\n },\n ];\n}\n"],"mappings":";AAGA,SAAgB,YAAY,MAGmB;CAC3C,MAAM,EAAE,aAAa,eAAe;CACpC,IAAI,CAAC,eAAe,CAAC,YAAY,OAAO,KAAA;CAExC,OAAO,CACH;EACI;EACA,MAAM,aAAa,CAAC;GAAE,SAAS;GAAc,MAAM,WAAW;EAAQ,CAAC,IAAI,KAAA;CAC/E,CACJ;AACJ"}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,13 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { ActionLogicStep, ActionParameterDef, ActionTypeDef, AttachmentConstraint, AttachmentContentConstraint, AttachmentTypeDef, BooleanTypeDef, ContextReferenceExpression, CreateObjectActionLogicStep, DateTypeDef, DeleteObjectActionLogicStep, Deprecation, DimensionsConstraint, DoubleTypeDef, Expression, FieldDef, FloatTypeDef, GeopointTypeDef, GetAtExpression, IconDescriptor, IconName, ImageAttachmentConstraint, ImageMediaType, InputReferenceExpression, IntegerTypeDef, Lens, LensOp, LinkCardinality, LinkHopExpression, LinkTypeDef, LinkTypeSideDef, ListTypeDef, LiteralExpression, LocalReferenceExpression, MapExpression, MapTypeDef, MoveLensOp, NamedTypeDef, NowExpression, ObjectLookupExpression, ObjectReferenceTypeDef, ObjectTypeDef, OntologyIR, OptionalTypeDef, PropertyAssignment, PropertyDef as PropertyDef$1, QueryFunctionParameterDef, QueryFunctionTypeDef, ResultTypeDef, SelectLensOp, StringConstraint, StringEnumConstraint, StringRegexConstraint, StringSuggestion, StringTypeDef, StructExpression, StructExpressionField, StructTypeDef, TimestampTypeDef, TypeDef, TypeRef, UnionTypeDef, UnknownTypeDef, UpdateObjectActionLogicStep, UuidExpression, VariantDef } from "./ir/generated/types.js";
|
|
2
|
+
import { o } from "./ir/generated/builders.js";
|
|
3
|
+
import { ValidationIssue } from "./utils/validation.js";
|
|
4
|
+
import { ValidationResult, validate } from "./ir/validate.js";
|
|
5
|
+
import "./ir/index.js";
|
|
6
|
+
import { Uncertain, certain, uncertain } from "./utils/uncertain.js";
|
|
7
|
+
import { AttachmentMetadata, PartialAttachmentMetadata } from "./live/attachments/types.js";
|
|
8
|
+
import { ApplyActionLiveOpts, OntologyApplyActionResult, OntologyAttachmentIdMapping, OntologyAttachmentUpload, OntologyAttachmentsAdapter, OntologyBackendAdapter, OntologyBackendAdapterProvider, OntologyCollectionOptions, OntologyCollectionUtils, RunQueryLiveOpts, ValidateActionDraftLiveOpts, ValidateActionLiveOpts } from "./live/OntologyBackendAdapter.js";
|
|
9
|
+
import { LiveOntologyAttachments } from "./live/attachments/createLiveOntologyAttachments.js";
|
|
10
|
+
import { OntologyObject } from "./live/objects/OntologyObject.js";
|
|
11
|
+
import { OntologyCollection } from "./live/objects/createLiveOntologyObjectCollection.js";
|
|
12
|
+
import { EnqueuedOntologyAction, NonRetryableError, OntologyActionRequest, OntologyOutbox, OntologyOutboxEntry, OntologyOutboxStatus } from "./live/outbox/types.js";
|
|
13
|
+
import { LiveOntologyAction, LiveOntologyActionOptions } from "./live/actions/createLiveOntologyAction.js";
|
|
14
|
+
import { OntologyMutator, OntologyMutatorObjects, OntologyMutatorRegistry, OntologyMutatorTx, OntologyPropertyChange, OntologyQueryFunctionHandler, OntologyQueryFunctionRegistry, OntologyReadTx } from "./live/mutators/types.js";
|
|
15
|
+
import { CreateLiveOntologyOpts, LiveOntology, LiveOntologyActions, LiveOntologyObjects, LiveOntologyOutboxFailureStrategy, LiveOntologyOutboxOptions, LiveOntologyQueryFunction, LiveOntologyQueryFunctions, LiveOntologyWriteMode, LiveOntologyWriteVisibility, LiveOntologyWrites, OntologyDefinition, createLiveOntology, waitForLiveOntologyReady } from "./live/LiveOntology.js";
|
|
16
|
+
import { ActionType, LinkType, MetaOntology, ObjectType, PropertyDef, QueryFunctionType, ValueType } from "./meta/generated/types.js";
|
|
17
|
+
import { ConfigureOntologyOptions, CreateOntologyBackendInstallationOptions, OntologyBackendInstallation, OntologyConfiguration, OntologyRoute } from "./installation/types.js";
|
|
18
|
+
import { OntologyPullConfig, OntologyPullContext, OntologyPullSource } from "./OntologyPullConfig.js";
|
|
19
|
+
import { ConstNamedTypeDef, ConstOntologyIR, ConstTypeDef, Infer, InferNamedType, InferOntology, InferType, MutableDeep, ReadonlyDeep, defineNamedType, defineOntology, defineType } from "./infer.js";
|
|
20
|
+
import { ApplyObjectTypeLensOptions, applyLensToObject, applyLensToObjectType, mapTargetPathToSourceWithLens } from "./lenses.js";
|
|
21
|
+
import { createReadTx } from "./live/mutators/createMutatorTx.js";
|
|
22
|
+
import { resolveActionParameters } from "./live/expression.js";
|
|
23
|
+
import { runOptimisticAction } from "./live/mutators/runOptimisticAction.js";
|
|
24
|
+
import "./live/index.js";
|
|
25
|
+
import { createOntologyBackendInstallation } from "./installation/createOntologyBackendInstallation.js";
|
|
26
|
+
import { MetaOntologyConfigurationOptions, createMetaOntologyConfiguration } from "./installation/createMetaOntologyConfiguration.js";
|
|
27
|
+
import "./installation/index.js";
|
|
28
|
+
import { PullOptions, pull } from "./meta/pull.js";
|
|
29
|
+
import { createMetaLiveOntology } from "./meta/generated/live.js";
|
|
30
|
+
export { ActionLogicStep, ActionParameterDef, ActionTypeDef, ApplyActionLiveOpts, ApplyObjectTypeLensOptions, AttachmentConstraint, AttachmentContentConstraint, type AttachmentMetadata, AttachmentTypeDef, BooleanTypeDef, type ConfigureOntologyOptions, ConstNamedTypeDef, ConstOntologyIR, ConstTypeDef, ContextReferenceExpression, CreateLiveOntologyOpts, CreateObjectActionLogicStep, type CreateOntologyBackendInstallationOptions, DateTypeDef, DeleteObjectActionLogicStep, Deprecation, DimensionsConstraint, DoubleTypeDef, EnqueuedOntologyAction, Expression, FieldDef, FloatTypeDef, GeopointTypeDef, GetAtExpression, IconDescriptor, IconName, ImageAttachmentConstraint, ImageMediaType, Infer, InferNamedType, InferOntology, InferType, InputReferenceExpression, IntegerTypeDef, Lens, LensOp, LinkCardinality, LinkHopExpression, LinkTypeDef, LinkTypeSideDef, ListTypeDef, LiteralExpression, LiveOntology, type LiveOntologyAction, type LiveOntologyActionOptions, LiveOntologyActions, type LiveOntologyAttachments, LiveOntologyObjects, LiveOntologyOutboxFailureStrategy, LiveOntologyOutboxOptions, LiveOntologyQueryFunction, LiveOntologyQueryFunctions, LiveOntologyWriteMode, LiveOntologyWriteVisibility, LiveOntologyWrites, LocalReferenceExpression, MapExpression, MapTypeDef, type ActionType as MetaActionType, type LinkType as MetaLinkType, type PropertyDef as MetaObjectProperty, type ObjectType as MetaObjectType, type MetaOntology, type MetaOntologyConfigurationOptions, type QueryFunctionType as MetaQueryFunctionType, type ValueType as MetaValueType, MoveLensOp, MutableDeep, NamedTypeDef, NonRetryableError, NowExpression, ObjectLookupExpression, ObjectReferenceTypeDef, ObjectTypeDef, OntologyActionRequest, OntologyApplyActionResult, OntologyAttachmentIdMapping, OntologyAttachmentUpload, OntologyAttachmentsAdapter, OntologyBackendAdapter, OntologyBackendAdapterProvider, type OntologyBackendInstallation, type OntologyCollection, OntologyCollectionOptions, OntologyCollectionUtils, type OntologyConfiguration, OntologyDefinition, OntologyIR, OntologyMutator, OntologyMutatorObjects, OntologyMutatorRegistry, OntologyMutatorTx, type OntologyObject, OntologyOutbox, OntologyOutboxEntry, OntologyOutboxStatus, OntologyPropertyChange, OntologyPullConfig, OntologyPullContext, OntologyPullSource, OntologyQueryFunctionHandler, OntologyQueryFunctionRegistry, OntologyReadTx, type OntologyRoute, OptionalTypeDef, type PartialAttachmentMetadata, PropertyAssignment, PropertyDef$1 as PropertyDef, PullOptions, QueryFunctionParameterDef, QueryFunctionTypeDef, ReadonlyDeep, ResultTypeDef, RunQueryLiveOpts, SelectLensOp, StringConstraint, StringEnumConstraint, StringRegexConstraint, StringSuggestion, StringTypeDef, StructExpression, StructExpressionField, StructTypeDef, TimestampTypeDef, TypeDef, TypeRef, type Uncertain, UnionTypeDef, UnknownTypeDef, UpdateObjectActionLogicStep, UuidExpression, ValidateActionDraftLiveOpts, ValidateActionLiveOpts, type ValidationIssue, ValidationResult, VariantDef, applyLensToObject, applyLensToObjectType, certain, createLiveOntology, createMetaLiveOntology, createMetaOntologyConfiguration, createOntologyBackendInstallation, createReadTx, defineNamedType, defineOntology, defineType, mapTargetPathToSourceWithLens, o, pull, resolveActionParameters, runOptimisticAction, uncertain, validate, waitForLiveOntologyReady };
|
package/lib/index.js
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { o } from "./ir/generated/builders.js";
|
|
2
|
+
import { validate } from "./ir/validate.js";
|
|
3
|
+
import "./ir/index.js";
|
|
4
|
+
import { defineNamedType, defineOntology, defineType } from "./infer.js";
|
|
5
|
+
import { applyLensToObject, applyLensToObjectType, mapTargetPathToSourceWithLens } from "./lenses.js";
|
|
6
|
+
import { resolveActionParameters } from "./live/expression.js";
|
|
7
|
+
import { createReadTx } from "./live/mutators/createMutatorTx.js";
|
|
8
|
+
import { runOptimisticAction } from "./live/mutators/runOptimisticAction.js";
|
|
9
|
+
import { NonRetryableError } from "./live/outbox/types.js";
|
|
10
|
+
import { createLiveOntology, waitForLiveOntologyReady } from "./live/LiveOntology.js";
|
|
11
|
+
import "./live/index.js";
|
|
12
|
+
import { createMetaOntologyConfiguration } from "./installation/createMetaOntologyConfiguration.js";
|
|
13
|
+
import { createOntologyBackendInstallation } from "./installation/createOntologyBackendInstallation.js";
|
|
14
|
+
import "./installation/index.js";
|
|
15
|
+
import { certain, uncertain } from "./utils/uncertain.js";
|
|
16
|
+
import { pull } from "./meta/pull.js";
|
|
17
|
+
import { createMetaLiveOntology } from "./meta/generated/live.js";
|
|
18
|
+
export { NonRetryableError, applyLensToObject, applyLensToObjectType, certain, createLiveOntology, createMetaLiveOntology, createMetaOntologyConfiguration, createOntologyBackendInstallation, createReadTx, defineNamedType, defineOntology, defineType, mapTargetPathToSourceWithLens, o, pull, resolveActionParameters, runOptimisticAction, uncertain, validate, waitForLiveOntologyReady };
|
package/lib/infer.d.ts
CHANGED
|
@@ -1,238 +1,215 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
} : T;
|
|
8
|
-
|
|
9
|
-
-readonly [K in keyof T]: MutableDeep<T[K]>;
|
|
10
|
-
} : T;
|
|
11
|
-
type FlattenObject<T> = {
|
|
12
|
-
[K in keyof T]: T[K];
|
|
13
|
-
} & {};
|
|
1
|
+
import { Result, attachment, date, double, float, geopoint, integer, timestamp } from "./utils/values.js";
|
|
2
|
+
import { ImageMediaType, NamedTypeDef, OntologyIR, TypeDef } from "./ir/generated/types.js";
|
|
3
|
+
import { ActionTypeName, ActionTypes, ArrayElement, NamedTypes, ObjectTypeName, ObjectTypes, QueryFunctionTypeName, QueryFunctionTypes } from "./utils/typeNames.js";
|
|
4
|
+
import { OntologyDefinition } from "./live/LiveOntology.js";
|
|
5
|
+
//#region src/infer.d.ts
|
|
6
|
+
export type ReadonlyDeep<T> = T extends ((...args: never[]) => unknown) ? T : T extends readonly (infer Element)[] ? readonly ReadonlyDeep<Element>[] : T extends object ? { readonly [K in keyof T]: ReadonlyDeep<T[K]>; } : T;
|
|
7
|
+
export type MutableDeep<T> = T extends ((...args: never[]) => unknown) ? T : T extends readonly (infer Element)[] ? Array<MutableDeep<Element>> : T extends object ? { -readonly [K in keyof T]: MutableDeep<T[K]>; } : T;
|
|
8
|
+
type FlattenObject<T> = { [K in keyof T]: T[K]; } & {};
|
|
14
9
|
type TypeKind<Type> = Type extends {
|
|
15
|
-
|
|
10
|
+
readonly kind: infer Kind extends string;
|
|
16
11
|
} ? Kind : never;
|
|
17
12
|
type TypeValue<Type> = Type extends {
|
|
18
|
-
|
|
13
|
+
readonly value: infer Value;
|
|
19
14
|
} ? Value : never;
|
|
20
15
|
type NamedTypeByName<Ontology, Name extends PropertyKey> = Extract<NamedTypes<Ontology>, {
|
|
21
|
-
|
|
16
|
+
readonly name: Name;
|
|
22
17
|
}>;
|
|
23
18
|
type ObjectTypeByName<Ontology, Name extends PropertyKey> = Extract<ObjectTypes<Ontology>, {
|
|
24
|
-
|
|
19
|
+
readonly name: Name;
|
|
25
20
|
}>;
|
|
26
21
|
type ActionTypeByName<Ontology, Name extends PropertyKey> = Extract<ActionTypes<Ontology>, {
|
|
27
|
-
|
|
22
|
+
readonly name: Name;
|
|
28
23
|
}>;
|
|
29
24
|
type QueryFunctionTypeByName<Ontology, Name extends PropertyKey> = Extract<QueryFunctionTypes<Ontology>, {
|
|
30
|
-
|
|
25
|
+
readonly name: Name;
|
|
31
26
|
}>;
|
|
32
27
|
type ObjectTypeProperties<ObjectType> = ObjectType extends {
|
|
33
|
-
|
|
28
|
+
readonly properties: infer Properties;
|
|
34
29
|
} ? Properties : never;
|
|
35
30
|
type InferString<Value> = Value extends {
|
|
36
|
-
|
|
31
|
+
readonly constraint?: infer Constraint;
|
|
37
32
|
} ? NonNullable<Constraint> extends {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
33
|
+
readonly kind: "enum";
|
|
34
|
+
readonly value: {
|
|
35
|
+
readonly options: infer Options;
|
|
36
|
+
};
|
|
42
37
|
} ? ArrayElement<Options> extends {
|
|
43
|
-
|
|
38
|
+
readonly value: infer OptionValue extends string;
|
|
44
39
|
} ? OptionValue : never : string : string;
|
|
45
40
|
type StructField<Fields> = ArrayElement<Fields>;
|
|
46
41
|
type FieldName<Field> = Field extends {
|
|
47
|
-
|
|
42
|
+
readonly name: infer Name extends PropertyKey;
|
|
48
43
|
} ? Name : never;
|
|
49
44
|
type FieldByName<Fields, Name extends PropertyKey> = Extract<StructField<Fields>, {
|
|
50
|
-
|
|
45
|
+
readonly name: Name;
|
|
51
46
|
}>;
|
|
52
47
|
type FieldType<Fields, Name extends PropertyKey> = FieldByName<Fields, Name> extends {
|
|
53
|
-
|
|
48
|
+
readonly type: infer Type;
|
|
54
49
|
} ? Type : never;
|
|
55
|
-
type RequiredFieldNames<Fields> = StructField<Fields> extends infer Field ? Field extends {
|
|
56
|
-
|
|
50
|
+
type RequiredFieldNames<Fields> = StructField<Fields> extends (infer Field) ? Field extends {
|
|
51
|
+
readonly type: infer Type;
|
|
57
52
|
} ? Type extends {
|
|
58
|
-
|
|
53
|
+
readonly kind: "optional";
|
|
59
54
|
} ? never : FieldName<Field> : never : never;
|
|
60
|
-
type OptionalFieldNames<Fields> = StructField<Fields> extends infer Field ? Field extends {
|
|
61
|
-
|
|
55
|
+
type OptionalFieldNames<Fields> = StructField<Fields> extends (infer Field) ? Field extends {
|
|
56
|
+
readonly type: infer Type;
|
|
62
57
|
} ? Type extends {
|
|
63
|
-
|
|
58
|
+
readonly kind: "optional";
|
|
64
59
|
} ? FieldName<Field> : never : never : never;
|
|
65
|
-
type InferStructFields<Fields, Ontology> = StructField<Fields> extends never ? Record<never, never> : FlattenObject<{
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
[Name in OptionalFieldNames<Fields>]?: TypeValue<FieldType<Fields, Name>> extends {
|
|
69
|
-
readonly type: infer Inner;
|
|
70
|
-
} ? InferType<Inner, Ontology> : never;
|
|
71
|
-
}>;
|
|
60
|
+
type InferStructFields<Fields, Ontology> = StructField<Fields> extends never ? Record<never, never> : FlattenObject<{ [Name in RequiredFieldNames<Fields>]: InferType<FieldType<Fields, Name>, Ontology>; } & { [Name in OptionalFieldNames<Fields>]?: TypeValue<FieldType<Fields, Name>> extends {
|
|
61
|
+
readonly type: infer Inner;
|
|
62
|
+
} ? InferType<Inner, Ontology> : never; }>;
|
|
72
63
|
type InferUnionVariant<Variant, Ontology> = Variant extends {
|
|
73
|
-
|
|
74
|
-
|
|
64
|
+
readonly name: infer Name extends string;
|
|
65
|
+
readonly type: infer Type;
|
|
75
66
|
} ? {
|
|
76
|
-
|
|
77
|
-
|
|
67
|
+
kind: Name;
|
|
68
|
+
value: InferType<Type, Ontology>;
|
|
78
69
|
} : never;
|
|
79
70
|
type ObjectPrimaryKey<ObjectType> = ObjectType extends {
|
|
80
|
-
|
|
71
|
+
readonly primaryKey: infer PrimaryKey extends PropertyKey;
|
|
81
72
|
} ? PrimaryKey : never;
|
|
82
73
|
type InferObjectReference<Value, Ontology> = Value extends {
|
|
83
|
-
|
|
74
|
+
readonly objectType: infer Name extends PropertyKey;
|
|
84
75
|
} ? InferType<FieldType<ObjectTypeProperties<ObjectTypeByName<Ontology, Name>>, ObjectPrimaryKey<ObjectTypeByName<Ontology, Name>>>, Ontology> : never;
|
|
85
76
|
type InferImageAttachment<Value> = Value extends {
|
|
86
|
-
|
|
77
|
+
readonly mediaTypes: infer MediaTypes;
|
|
87
78
|
} ? attachment<Extract<ArrayElement<MediaTypes>, string>> : attachment<ImageMediaType>;
|
|
88
79
|
type InferAttachment<Value> = Value extends {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
80
|
+
readonly constraint: {
|
|
81
|
+
readonly content: infer Content;
|
|
82
|
+
};
|
|
92
83
|
} ? Content extends {
|
|
93
|
-
|
|
94
|
-
|
|
84
|
+
readonly kind: "image";
|
|
85
|
+
readonly value: infer ImageConstraint;
|
|
95
86
|
} ? InferImageAttachment<ImageConstraint> : attachment : attachment;
|
|
96
87
|
type InferByKind<Type, Ontology> = {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
88
|
+
string: InferString<TypeValue<Type>>;
|
|
89
|
+
boolean: boolean;
|
|
90
|
+
integer: integer;
|
|
91
|
+
float: float;
|
|
92
|
+
double: double;
|
|
93
|
+
date: date;
|
|
94
|
+
timestamp: timestamp;
|
|
95
|
+
geopoint: geopoint;
|
|
96
|
+
attachment: InferAttachment<TypeValue<Type>>;
|
|
97
|
+
objectReference: InferObjectReference<TypeValue<Type>, Ontology>;
|
|
98
|
+
unknown: unknown;
|
|
99
|
+
list: TypeValue<Type> extends {
|
|
100
|
+
readonly elementType: infer ElementType;
|
|
101
|
+
} ? Array<InferType<ElementType, Ontology>> : never;
|
|
102
|
+
map: TypeValue<Type> extends {
|
|
103
|
+
readonly valueType: infer ValueType;
|
|
104
|
+
} ? Record<string, InferType<ValueType, Ontology>> : never;
|
|
105
|
+
struct: TypeValue<Type> extends {
|
|
106
|
+
readonly fields: infer Fields;
|
|
107
|
+
} ? InferStructFields<Fields, Ontology> : never;
|
|
108
|
+
union: TypeValue<Type> extends {
|
|
109
|
+
readonly variants: infer Variants;
|
|
110
|
+
} ? InferUnionVariant<ArrayElement<Variants>, Ontology> : never;
|
|
111
|
+
optional: TypeValue<Type> extends {
|
|
112
|
+
readonly type: infer Inner;
|
|
113
|
+
} ? InferType<Inner, Ontology> | undefined : never;
|
|
114
|
+
result: TypeValue<Type> extends {
|
|
115
|
+
readonly okType: infer OkType;
|
|
116
|
+
readonly errType: infer ErrType;
|
|
117
|
+
} ? Result<InferType<OkType, Ontology>, InferType<ErrType, Ontology>> : never;
|
|
118
|
+
ref: TypeValue<Type> extends {
|
|
119
|
+
readonly name: infer Name extends PropertyKey;
|
|
120
|
+
} ? InferNamedTypeByName<Ontology, Name> : never;
|
|
130
121
|
};
|
|
131
122
|
export type InferType<Type, Ontology = never> = TypeKind<Type> extends keyof InferByKind<Type, Ontology> ? InferByKind<Type, Ontology>[TypeKind<Type>] : never;
|
|
132
123
|
type InferNamedTypeByName<Ontology, Name extends PropertyKey> = NamedTypeByName<Ontology, Name> extends {
|
|
133
|
-
|
|
124
|
+
readonly type: infer Type;
|
|
134
125
|
} ? InferType<Type, Ontology> : ObjectTypeByName<Ontology, Name> extends {
|
|
135
|
-
|
|
126
|
+
readonly properties: infer Properties;
|
|
136
127
|
} ? InferStructFields<Properties, Ontology> : never;
|
|
137
128
|
export type InferNamedType<Type, Ontology = never> = Type extends {
|
|
138
|
-
|
|
129
|
+
readonly type: infer TypeDef;
|
|
139
130
|
} ? InferType<TypeDef, Ontology> : never;
|
|
140
131
|
type InferObjectType<ObjectType, Ontology> = ObjectType extends {
|
|
141
|
-
|
|
132
|
+
readonly properties: infer Properties;
|
|
142
133
|
} ? InferStructFields<Properties, Ontology> : never;
|
|
143
134
|
type ActionParameters<ActionType> = ActionType extends {
|
|
144
|
-
|
|
135
|
+
readonly parameters: infer Parameters;
|
|
145
136
|
} ? Parameters : never;
|
|
146
137
|
type ActionParameter<Parameters> = ArrayElement<Parameters>;
|
|
147
138
|
type ActionParameterName<Parameter> = Parameter extends {
|
|
148
|
-
|
|
139
|
+
readonly name: infer Name extends PropertyKey;
|
|
149
140
|
} ? Name : never;
|
|
150
141
|
type ActionParameterByName<Parameters, Name extends PropertyKey> = Extract<ActionParameter<Parameters>, {
|
|
151
|
-
|
|
142
|
+
readonly name: Name;
|
|
152
143
|
}>;
|
|
153
144
|
type ActionParameterType<Parameters, Name extends PropertyKey> = ActionParameterByName<Parameters, Name> extends {
|
|
154
|
-
|
|
145
|
+
readonly type: infer Type;
|
|
155
146
|
} ? Type : never;
|
|
156
|
-
type RequiredActionParameterNames<Parameters> = ActionParameter<Parameters> extends infer Parameter ? Parameter extends {
|
|
157
|
-
|
|
147
|
+
type RequiredActionParameterNames<Parameters> = ActionParameter<Parameters> extends (infer Parameter) ? Parameter extends {
|
|
148
|
+
readonly type: infer Type;
|
|
158
149
|
} ? Type extends {
|
|
159
|
-
|
|
150
|
+
readonly kind: "optional";
|
|
160
151
|
} ? never : Parameter extends {
|
|
161
|
-
|
|
152
|
+
readonly defaultValue: unknown;
|
|
162
153
|
} ? never : ActionParameterName<Parameter> : never : never;
|
|
163
|
-
type OptionalActionParameterNames<Parameters> = ActionParameter<Parameters> extends infer Parameter ? Parameter extends {
|
|
164
|
-
|
|
154
|
+
type OptionalActionParameterNames<Parameters> = ActionParameter<Parameters> extends (infer Parameter) ? Parameter extends {
|
|
155
|
+
readonly type: infer Type;
|
|
165
156
|
} ? Type extends {
|
|
166
|
-
|
|
157
|
+
readonly kind: "optional";
|
|
167
158
|
} ? ActionParameterName<Parameter> : Parameter extends {
|
|
168
|
-
|
|
159
|
+
readonly defaultValue: unknown;
|
|
169
160
|
} ? ActionParameterName<Parameter> : never : never : never;
|
|
170
|
-
type InferActionParameter<Parameters, Name extends PropertyKey, Ontology> = ActionParameterType<Parameters, Name> extends infer Type ? Type extends {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
161
|
+
type InferActionParameter<Parameters, Name extends PropertyKey, Ontology> = ActionParameterType<Parameters, Name> extends (infer Type) ? Type extends {
|
|
162
|
+
readonly kind: "optional";
|
|
163
|
+
readonly value: {
|
|
164
|
+
readonly type: infer Inner;
|
|
165
|
+
};
|
|
175
166
|
} ? InferType<Inner, Ontology> | null : InferType<Type, Ontology> : never;
|
|
176
|
-
type InferActionParameters<Parameters, Ontology> = ActionParameter<Parameters> extends never ? Record<never, never> : FlattenObject<{
|
|
177
|
-
[Name in RequiredActionParameterNames<Parameters>]: InferActionParameter<Parameters, Name, Ontology>;
|
|
178
|
-
} & {
|
|
179
|
-
[Name in OptionalActionParameterNames<Parameters>]?: InferActionParameter<Parameters, Name, Ontology>;
|
|
180
|
-
}>;
|
|
167
|
+
type InferActionParameters<Parameters, Ontology> = ActionParameter<Parameters> extends never ? Record<never, never> : FlattenObject<{ [Name in RequiredActionParameterNames<Parameters>]: InferActionParameter<Parameters, Name, Ontology>; } & { [Name in OptionalActionParameterNames<Parameters>]?: InferActionParameter<Parameters, Name, Ontology>; }>;
|
|
181
168
|
type QueryParameters<QueryFunctionType> = QueryFunctionType extends {
|
|
182
|
-
|
|
169
|
+
readonly parameters: infer Parameters;
|
|
183
170
|
} ? Parameters : never;
|
|
184
171
|
type QueryReturnType<QueryFunctionType> = QueryFunctionType extends {
|
|
185
|
-
|
|
172
|
+
readonly returnType: infer ReturnType;
|
|
186
173
|
} ? ReturnType : never;
|
|
187
174
|
type QueryParameter<Parameters> = ArrayElement<Parameters>;
|
|
188
175
|
type QueryParameterName<Parameter> = Parameter extends {
|
|
189
|
-
|
|
176
|
+
readonly name: infer Name extends PropertyKey;
|
|
190
177
|
} ? Name : never;
|
|
191
178
|
type QueryParameterByName<Parameters, Name extends PropertyKey> = Extract<QueryParameter<Parameters>, {
|
|
192
|
-
|
|
179
|
+
readonly name: Name;
|
|
193
180
|
}>;
|
|
194
181
|
type QueryParameterType<Parameters, Name extends PropertyKey> = QueryParameterByName<Parameters, Name> extends {
|
|
195
|
-
|
|
182
|
+
readonly type: infer Type;
|
|
196
183
|
} ? Type : never;
|
|
197
|
-
type RequiredQueryParameterNames<Parameters> = QueryParameter<Parameters> extends infer Parameter ? Parameter extends {
|
|
198
|
-
|
|
184
|
+
type RequiredQueryParameterNames<Parameters> = QueryParameter<Parameters> extends (infer Parameter) ? Parameter extends {
|
|
185
|
+
readonly type: infer Type;
|
|
199
186
|
} ? Type extends {
|
|
200
|
-
|
|
187
|
+
readonly kind: "optional";
|
|
201
188
|
} ? never : QueryParameterName<Parameter> : never : never;
|
|
202
|
-
type OptionalQueryParameterNames<Parameters> = QueryParameter<Parameters> extends infer Parameter ? Parameter extends {
|
|
203
|
-
|
|
189
|
+
type OptionalQueryParameterNames<Parameters> = QueryParameter<Parameters> extends (infer Parameter) ? Parameter extends {
|
|
190
|
+
readonly type: infer Type;
|
|
204
191
|
} ? Type extends {
|
|
205
|
-
|
|
192
|
+
readonly kind: "optional";
|
|
206
193
|
} ? QueryParameterName<Parameter> : never : never : never;
|
|
207
|
-
type InferQueryParameter<Parameters, Name extends PropertyKey, Ontology> = QueryParameterType<Parameters, Name> extends infer Type ? Type extends {
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
194
|
+
type InferQueryParameter<Parameters, Name extends PropertyKey, Ontology> = QueryParameterType<Parameters, Name> extends (infer Type) ? Type extends {
|
|
195
|
+
readonly kind: "optional";
|
|
196
|
+
readonly value: {
|
|
197
|
+
readonly type: infer Inner;
|
|
198
|
+
};
|
|
212
199
|
} ? InferType<Inner, Ontology> : InferType<Type, Ontology> : never;
|
|
213
|
-
type InferQueryParameters<Parameters, Ontology> = QueryParameter<Parameters> extends never ? Record<never, never> : FlattenObject<{
|
|
214
|
-
[Name in RequiredQueryParameterNames<Parameters>]: InferQueryParameter<Parameters, Name, Ontology>;
|
|
215
|
-
} & {
|
|
216
|
-
[Name in OptionalQueryParameterNames<Parameters>]?: InferQueryParameter<Parameters, Name, Ontology>;
|
|
217
|
-
}>;
|
|
200
|
+
type InferQueryParameters<Parameters, Ontology> = QueryParameter<Parameters> extends never ? Record<never, never> : FlattenObject<{ [Name in RequiredQueryParameterNames<Parameters>]: InferQueryParameter<Parameters, Name, Ontology>; } & { [Name in OptionalQueryParameterNames<Parameters>]?: InferQueryParameter<Parameters, Name, Ontology>; }>;
|
|
218
201
|
export type InferOntology<Ontology> = {
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
queryFunctionTypes: {
|
|
231
|
-
[Name in QueryFunctionTypeName<Ontology>]: {
|
|
232
|
-
parameters: InferQueryParameters<QueryParameters<QueryFunctionTypeByName<Ontology, Name>>, Ontology>;
|
|
233
|
-
returnType: InferType<QueryReturnType<QueryFunctionTypeByName<Ontology, Name>>, Ontology>;
|
|
234
|
-
};
|
|
235
|
-
};
|
|
202
|
+
context: Ontology extends {
|
|
203
|
+
readonly contextType: infer ContextType;
|
|
204
|
+
} ? InferType<ContextType, Ontology> : Record<string, unknown>;
|
|
205
|
+
objectTypes: { [Name in ObjectTypeName<Ontology>]: InferObjectType<ObjectTypeByName<Ontology, Name>, Ontology>; };
|
|
206
|
+
actionTypes: { [Name in ActionTypeName<Ontology>]: {
|
|
207
|
+
parameters: InferActionParameters<ActionParameters<ActionTypeByName<Ontology, Name>>, Ontology>;
|
|
208
|
+
}; };
|
|
209
|
+
queryFunctionTypes: { [Name in QueryFunctionTypeName<Ontology>]: {
|
|
210
|
+
parameters: InferQueryParameters<QueryParameters<QueryFunctionTypeByName<Ontology, Name>>, Ontology>;
|
|
211
|
+
returnType: InferType<QueryReturnType<QueryFunctionTypeByName<Ontology, Name>>, Ontology>;
|
|
212
|
+
}; };
|
|
236
213
|
} & OntologyDefinition;
|
|
237
214
|
export type ConstOntologyIR = ReadonlyDeep<OntologyIR>;
|
|
238
215
|
export type ConstTypeDef = ReadonlyDeep<TypeDef>;
|
|
@@ -241,5 +218,6 @@ export type Infer<Input extends ConstOntologyIR | ConstNamedTypeDef | ConstTypeD
|
|
|
241
218
|
export declare function defineOntology<const Ontology extends ConstOntologyIR>(ontology: Ontology): MutableDeep<Ontology>;
|
|
242
219
|
export declare function defineType<const Type extends ConstTypeDef>(type: Type): MutableDeep<Type>;
|
|
243
220
|
export declare function defineNamedType<const Type extends ConstNamedTypeDef>(type: Type): MutableDeep<Type>;
|
|
221
|
+
//#endregion
|
|
244
222
|
export {};
|
|
245
223
|
//# sourceMappingURL=infer.d.ts.map
|