@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
|
@@ -1,417 +0,0 @@
|
|
|
1
|
-
import * as v from "@party-stack/ontology/values";
|
|
2
|
-
//#region src/meta/generated/types.d.ts
|
|
3
|
-
/** A renderer-independent icon name from @party-stack/icons. */
|
|
4
|
-
export type IconName = "activity" | "add" | "airplane" | "alarm" | "alert" | "archive" | "arrow-down" | "arrow-left" | "arrow-right" | "arrow-up" | "attachment" | "award" | "bank" | "barcode" | "bell" | "book" | "bookmark" | "briefcase" | "bug" | "building" | "calculator" | "calendar" | "camera" | "chart-bar" | "chart-line" | "chart-pie" | "chat" | "check" | "check-circle" | "chevron-down" | "chevron-left" | "chevron-right" | "chevron-up" | "circle" | "clipboard" | "clock" | "cloud" | "code" | "compass" | "copy" | "credit-card" | "cube" | "database" | "delete" | "document" | "download" | "edit" | "email" | "error" | "eye" | "eye-off" | "filter" | "flag" | "folder" | "globe" | "grid" | "heart" | "help" | "history" | "home" | "image" | "info" | "key" | "layers" | "lightbulb" | "link" | "list" | "location" | "lock" | "lock-open" | "map" | "menu" | "microphone" | "minus" | "minus-circle" | "moon" | "more-horizontal" | "more-vertical" | "notification" | "package" | "pause" | "people" | "person" | "phone" | "pin" | "play" | "play-circle" | "plus-circle" | "printer" | "project" | "refresh" | "rocket" | "save" | "search" | "send" | "settings" | "share" | "shield" | "shopping-bag" | "shopping-cart" | "star" | "stop" | "sun" | "tag" | "ticket" | "tools" | "upload" | "video" | "warning" | "window" | "wrench" | "x" | "x-circle";
|
|
5
|
-
/** A portable icon descriptor with optional provider meta for lossless round trips. */
|
|
6
|
-
export type IconDescriptor = {
|
|
7
|
-
/** Renderer-independent icon name. */
|
|
8
|
-
name: IconName;
|
|
9
|
-
/** Namespaced source-provider meta. */
|
|
10
|
-
meta?: Record<string, unknown>;
|
|
11
|
-
};
|
|
12
|
-
export type Deprecation = {
|
|
13
|
-
message: string;
|
|
14
|
-
};
|
|
15
|
-
/** A suggested value for a string. */
|
|
16
|
-
export type StringSuggestion = {
|
|
17
|
-
value: string;
|
|
18
|
-
label?: string;
|
|
19
|
-
};
|
|
20
|
-
/** Constrains a string to a set of allowed values. */
|
|
21
|
-
export type StringEnumConstraint = {
|
|
22
|
-
options: Array<StringSuggestion>;
|
|
23
|
-
};
|
|
24
|
-
/** Constrains a string to a regex. */
|
|
25
|
-
export type StringRegexConstraint = {
|
|
26
|
-
regex: string;
|
|
27
|
-
};
|
|
28
|
-
/** A constraint that can be applied to a string type. */
|
|
29
|
-
export type StringConstraint = v.Union<{
|
|
30
|
-
enum: StringEnumConstraint;
|
|
31
|
-
regex: StringRegexConstraint;
|
|
32
|
-
}>;
|
|
33
|
-
/** A string type with optional constraints. */
|
|
34
|
-
export type StringTypeDef = {
|
|
35
|
-
constraint?: StringConstraint;
|
|
36
|
-
suggestions?: Array<StringSuggestion>;
|
|
37
|
-
};
|
|
38
|
-
/** A boolean type. */
|
|
39
|
-
export type BooleanTypeDef = Record<never, never>;
|
|
40
|
-
/** A 32-bit integer type. */
|
|
41
|
-
export type IntegerTypeDef = Record<never, never>;
|
|
42
|
-
/** A 32-bit floating point type. */
|
|
43
|
-
export type FloatTypeDef = Record<never, never>;
|
|
44
|
-
/** A 64-bit floating point type. */
|
|
45
|
-
export type DoubleTypeDef = Record<never, never>;
|
|
46
|
-
/** A date type (no time component). */
|
|
47
|
-
export type DateTypeDef = Record<never, never>;
|
|
48
|
-
/** A timestamp type (instant in time). */
|
|
49
|
-
export type TimestampTypeDef = Record<never, never>;
|
|
50
|
-
/** A geographic point (lat/lon). */
|
|
51
|
-
export type GeopointTypeDef = Record<never, never>;
|
|
52
|
-
/** An opaque type whose shape is not known at schema time. */
|
|
53
|
-
export type UnknownTypeDef = Record<never, never>;
|
|
54
|
-
/** A list/array type. */
|
|
55
|
-
export type ListTypeDef = {
|
|
56
|
-
/** The type of elements in the list. */
|
|
57
|
-
elementType: TypeDef;
|
|
58
|
-
};
|
|
59
|
-
/** A map/record type. */
|
|
60
|
-
export type MapTypeDef = {
|
|
61
|
-
/** The type of keys (must be string right now). */
|
|
62
|
-
keyType: TypeDef;
|
|
63
|
-
/** The type of values. */
|
|
64
|
-
valueType: TypeDef;
|
|
65
|
-
};
|
|
66
|
-
/** Definition of a field in a struct. */
|
|
67
|
-
export type FieldDef = {
|
|
68
|
-
/** The field name in code. */
|
|
69
|
-
name: string;
|
|
70
|
-
/** Human-readable name. */
|
|
71
|
-
displayName: string;
|
|
72
|
-
/** The field's type. */
|
|
73
|
-
type: TypeDef;
|
|
74
|
-
/** Optional description. */
|
|
75
|
-
description?: string;
|
|
76
|
-
deprecated?: Deprecation;
|
|
77
|
-
};
|
|
78
|
-
/** A struct type with named fields. */
|
|
79
|
-
export type StructTypeDef = {
|
|
80
|
-
fields: Array<FieldDef>;
|
|
81
|
-
};
|
|
82
|
-
/** Definition of a variant in a discriminated union. */
|
|
83
|
-
export type VariantDef = {
|
|
84
|
-
/** The variant's discriminator value. */
|
|
85
|
-
name: string;
|
|
86
|
-
/** The variant's payload type. */
|
|
87
|
-
type: TypeDef;
|
|
88
|
-
};
|
|
89
|
-
/** A discriminated union type. */
|
|
90
|
-
export type UnionTypeDef = {
|
|
91
|
-
variants: Array<VariantDef>;
|
|
92
|
-
};
|
|
93
|
-
/** Wraps a type to make it optional. */
|
|
94
|
-
export type OptionalTypeDef = {
|
|
95
|
-
/** The wrapped type. */
|
|
96
|
-
type: TypeDef;
|
|
97
|
-
};
|
|
98
|
-
/** A result type (ok or error). */
|
|
99
|
-
export type ResultTypeDef = {
|
|
100
|
-
/** The type of the success value. */
|
|
101
|
-
okType: TypeDef;
|
|
102
|
-
/** The type of the error value. */
|
|
103
|
-
errType: TypeDef;
|
|
104
|
-
};
|
|
105
|
-
/** A reference to a named type. */
|
|
106
|
-
export type TypeRef = {
|
|
107
|
-
/** The name of the referenced type. */
|
|
108
|
-
name: string;
|
|
109
|
-
};
|
|
110
|
-
/** A type definition. Can be a primitive, collection, struct, union, optional, result, or reference. */
|
|
111
|
-
export type TypeDef = v.Union<{
|
|
112
|
-
string: StringTypeDef;
|
|
113
|
-
boolean: BooleanTypeDef;
|
|
114
|
-
integer: IntegerTypeDef;
|
|
115
|
-
float: FloatTypeDef;
|
|
116
|
-
double: DoubleTypeDef;
|
|
117
|
-
date: DateTypeDef;
|
|
118
|
-
timestamp: TimestampTypeDef;
|
|
119
|
-
geopoint: GeopointTypeDef;
|
|
120
|
-
list: ListTypeDef;
|
|
121
|
-
map: MapTypeDef;
|
|
122
|
-
struct: StructTypeDef;
|
|
123
|
-
union: UnionTypeDef;
|
|
124
|
-
optional: OptionalTypeDef;
|
|
125
|
-
result: ResultTypeDef;
|
|
126
|
-
ref: TypeRef;
|
|
127
|
-
attachment: AttachmentTypeDef;
|
|
128
|
-
objectReference: ObjectReferenceTypeDef;
|
|
129
|
-
unknown: UnknownTypeDef;
|
|
130
|
-
}>;
|
|
131
|
-
/** A supported image media type. */
|
|
132
|
-
export type ImageMediaType = "image/bmp" | "image/tiff" | "image/nitf" | "image/jp2" | "image/jpeg" | "image/png" | "image/gif" | "image/svg+xml" | "image/webp";
|
|
133
|
-
/** Constrains intrinsic pixel dimensions. */
|
|
134
|
-
export type DimensionsConstraint = {
|
|
135
|
-
width?: {
|
|
136
|
-
min?: v.integer;
|
|
137
|
-
max?: v.integer;
|
|
138
|
-
};
|
|
139
|
-
height?: {
|
|
140
|
-
min?: v.integer;
|
|
141
|
-
max?: v.integer;
|
|
142
|
-
};
|
|
143
|
-
};
|
|
144
|
-
/** Constraints specific to image attachments. */
|
|
145
|
-
export type ImageAttachmentConstraint = {
|
|
146
|
-
mediaTypes?: Array<ImageMediaType>;
|
|
147
|
-
dimensions?: DimensionsConstraint;
|
|
148
|
-
};
|
|
149
|
-
/** Content-specific attachment constraints. */
|
|
150
|
-
export type AttachmentContentConstraint = v.Union<{
|
|
151
|
-
image: ImageAttachmentConstraint;
|
|
152
|
-
}>;
|
|
153
|
-
/** Constraints applied to an attachment. */
|
|
154
|
-
export type AttachmentConstraint = {
|
|
155
|
-
size?: {
|
|
156
|
-
min?: v.double;
|
|
157
|
-
max?: v.double;
|
|
158
|
-
};
|
|
159
|
-
content?: AttachmentContentConstraint;
|
|
160
|
-
};
|
|
161
|
-
/** A file handle with optional constraints. */
|
|
162
|
-
export type AttachmentTypeDef = {
|
|
163
|
-
constraint?: AttachmentConstraint;
|
|
164
|
-
meta?: Record<string, unknown>;
|
|
165
|
-
};
|
|
166
|
-
/** A reference to an ontology object type. */
|
|
167
|
-
export type ObjectReferenceTypeDef = {
|
|
168
|
-
/** The referenced object type name. */
|
|
169
|
-
objectType: string;
|
|
170
|
-
};
|
|
171
|
-
/** A property on an Object type. */
|
|
172
|
-
export type PropertyDef = {
|
|
173
|
-
/** The provider-assigned stable identifier for this property. */
|
|
174
|
-
id: string;
|
|
175
|
-
/** The property's name. */
|
|
176
|
-
name: string;
|
|
177
|
-
/** Human-readable name. */
|
|
178
|
-
displayName: string;
|
|
179
|
-
/** The property's type. */
|
|
180
|
-
type: TypeDef;
|
|
181
|
-
/** Optional description. */
|
|
182
|
-
description?: string;
|
|
183
|
-
deprecated?: Deprecation;
|
|
184
|
-
};
|
|
185
|
-
export type LinkTypeSideDef = {
|
|
186
|
-
objectType: string;
|
|
187
|
-
name: string;
|
|
188
|
-
displayName: string;
|
|
189
|
-
};
|
|
190
|
-
/** The cardinality of a link from the source's perspective. */
|
|
191
|
-
export type LinkCardinality = "one" | "many";
|
|
192
|
-
/** A parameter of an Action type. */
|
|
193
|
-
export type ActionParameterDef = {
|
|
194
|
-
/** The parameter's name. */
|
|
195
|
-
name: string;
|
|
196
|
-
/** Human-readable name. */
|
|
197
|
-
displayName: string;
|
|
198
|
-
/** The parameter's type. */
|
|
199
|
-
type: TypeDef;
|
|
200
|
-
/** Optional description. */
|
|
201
|
-
description?: string;
|
|
202
|
-
deprecated?: Deprecation;
|
|
203
|
-
/** The expression used when the caller does not provide a value. */
|
|
204
|
-
defaultValue?: Expression;
|
|
205
|
-
};
|
|
206
|
-
/** Reads a named input from the root expression scope. */
|
|
207
|
-
export type InputReferenceExpression = {
|
|
208
|
-
name: string;
|
|
209
|
-
};
|
|
210
|
-
/** Reads a named lexically scoped expression binding. */
|
|
211
|
-
export type LocalReferenceExpression = {
|
|
212
|
-
name: string;
|
|
213
|
-
};
|
|
214
|
-
/** Reads a named value from the expression context. */
|
|
215
|
-
export type ContextReferenceExpression = {
|
|
216
|
-
name: string;
|
|
217
|
-
};
|
|
218
|
-
/** Reads a structural path from a source expression. */
|
|
219
|
-
export type GetAtExpression = {
|
|
220
|
-
source: Expression;
|
|
221
|
-
path: Array<string>;
|
|
222
|
-
};
|
|
223
|
-
/** Resolves an object reference to its ontology object. */
|
|
224
|
-
export type ObjectLookupExpression = {
|
|
225
|
-
reference: Expression;
|
|
226
|
-
};
|
|
227
|
-
/** Follows one named to-one ontology link from a source object. */
|
|
228
|
-
export type LinkHopExpression = {
|
|
229
|
-
source: Expression;
|
|
230
|
-
link: string;
|
|
231
|
-
};
|
|
232
|
-
/** A named field constructed by a struct expression. */
|
|
233
|
-
export type StructExpressionField = {
|
|
234
|
-
name: string;
|
|
235
|
-
value: Expression;
|
|
236
|
-
};
|
|
237
|
-
/** Constructs a struct value from field expressions. */
|
|
238
|
-
export type StructExpression = {
|
|
239
|
-
fields: Array<StructExpressionField>;
|
|
240
|
-
};
|
|
241
|
-
/** Maps each element of a list to a new value. */
|
|
242
|
-
export type MapExpression = {
|
|
243
|
-
source: Expression;
|
|
244
|
-
binding: string;
|
|
245
|
-
body: Expression;
|
|
246
|
-
};
|
|
247
|
-
/** Generates a UUID value. */
|
|
248
|
-
export type UuidExpression = Record<never, never>;
|
|
249
|
-
/** Returns the current timestamp. */
|
|
250
|
-
export type NowExpression = Record<never, never>;
|
|
251
|
-
/** A static literal value. */
|
|
252
|
-
export type LiteralExpression = {
|
|
253
|
-
/** The literal value. */
|
|
254
|
-
value: unknown;
|
|
255
|
-
};
|
|
256
|
-
/** An expression that resolves to a value. */
|
|
257
|
-
export type Expression = v.Union<{
|
|
258
|
-
inputReference: InputReferenceExpression;
|
|
259
|
-
contextReference: ContextReferenceExpression;
|
|
260
|
-
localReference: LocalReferenceExpression;
|
|
261
|
-
getAt: GetAtExpression;
|
|
262
|
-
objectLookup: ObjectLookupExpression;
|
|
263
|
-
linkHop: LinkHopExpression;
|
|
264
|
-
struct: StructExpression;
|
|
265
|
-
map: MapExpression;
|
|
266
|
-
uuid: UuidExpression;
|
|
267
|
-
now: NowExpression;
|
|
268
|
-
literal: LiteralExpression;
|
|
269
|
-
}>;
|
|
270
|
-
/** Assigns an expression to a property path on an object written by an action. */
|
|
271
|
-
export type PropertyAssignment = {
|
|
272
|
-
property: Array<string>;
|
|
273
|
-
value: Expression;
|
|
274
|
-
};
|
|
275
|
-
/** Creates an object and assigns property values. */
|
|
276
|
-
export type CreateObjectActionLogicStep = {
|
|
277
|
-
objectType: string;
|
|
278
|
-
values: Array<PropertyAssignment>;
|
|
279
|
-
};
|
|
280
|
-
/** Updates a referenced object and assigns property values. */
|
|
281
|
-
export type UpdateObjectActionLogicStep = {
|
|
282
|
-
object: InputReferenceExpression;
|
|
283
|
-
values: Array<PropertyAssignment>;
|
|
284
|
-
};
|
|
285
|
-
/** Deletes a referenced object. */
|
|
286
|
-
export type DeleteObjectActionLogicStep = {
|
|
287
|
-
object: InputReferenceExpression;
|
|
288
|
-
};
|
|
289
|
-
/** A logic step performed by an action. */
|
|
290
|
-
export type ActionLogicStep = v.Union<{
|
|
291
|
-
createObject: CreateObjectActionLogicStep;
|
|
292
|
-
updateObject: UpdateObjectActionLogicStep;
|
|
293
|
-
deleteObject: DeleteObjectActionLogicStep;
|
|
294
|
-
}>;
|
|
295
|
-
/** A parameter accepted by a query function type. */
|
|
296
|
-
export type QueryFunctionParameterDef = {
|
|
297
|
-
/** The query function parameter's programmatic name. */
|
|
298
|
-
name: string;
|
|
299
|
-
/** Human-readable name. */
|
|
300
|
-
displayName: string;
|
|
301
|
-
type: TypeDef;
|
|
302
|
-
/** Optional description. */
|
|
303
|
-
description?: string;
|
|
304
|
-
deprecated?: Deprecation;
|
|
305
|
-
};
|
|
306
|
-
/** Moves a property from one path to another. */
|
|
307
|
-
export type MoveLensOp = {
|
|
308
|
-
from: Array<string>;
|
|
309
|
-
to: Array<string>;
|
|
310
|
-
};
|
|
311
|
-
/** Retains only the selected top-level properties. */
|
|
312
|
-
export type SelectLensOp = {
|
|
313
|
-
properties: Array<string>;
|
|
314
|
-
};
|
|
315
|
-
/** One schema and value transformation operation. */
|
|
316
|
-
export type LensOp = v.Union<{
|
|
317
|
-
move: MoveLensOp;
|
|
318
|
-
select: SelectLensOp;
|
|
319
|
-
}>;
|
|
320
|
-
/** An ordered sequence of source-to-target transformation operations. */
|
|
321
|
-
export type Lens = {
|
|
322
|
-
operations: Array<LensOp>;
|
|
323
|
-
};
|
|
324
|
-
/** A named type definition that can be referenced by other types. */
|
|
325
|
-
export type ValueType = {
|
|
326
|
-
/** The type's name for use in code. */
|
|
327
|
-
name: string;
|
|
328
|
-
/** Optional documentation for the type. */
|
|
329
|
-
description?: string;
|
|
330
|
-
deprecated?: Deprecation;
|
|
331
|
-
/** The type definition. */
|
|
332
|
-
type: TypeDef;
|
|
333
|
-
};
|
|
334
|
-
/** An object type in the ontology. */
|
|
335
|
-
export type ObjectType = {
|
|
336
|
-
/** The provider-assigned stable identifier for this object type. */
|
|
337
|
-
id: string;
|
|
338
|
-
/** The object type's programmatic name. */
|
|
339
|
-
name: string;
|
|
340
|
-
/** Human-readable name. */
|
|
341
|
-
displayName: string;
|
|
342
|
-
pluralDisplayName: string;
|
|
343
|
-
/** The name of the property that serves as primary key. */
|
|
344
|
-
primaryKey: string;
|
|
345
|
-
/** The optional property name used as the human-readable title for an object. */
|
|
346
|
-
title?: string;
|
|
347
|
-
/** Optional portable icon descriptor. */
|
|
348
|
-
icon?: IconDescriptor;
|
|
349
|
-
/** Optional display color independent of the icon. */
|
|
350
|
-
color?: string;
|
|
351
|
-
/** The object type's propertieo. */
|
|
352
|
-
properties: Array<PropertyDef>;
|
|
353
|
-
/** Optional description. */
|
|
354
|
-
description?: string;
|
|
355
|
-
deprecated?: Deprecation;
|
|
356
|
-
};
|
|
357
|
-
/** A relationship between two object types. */
|
|
358
|
-
export type LinkType = {
|
|
359
|
-
id: string;
|
|
360
|
-
source: LinkTypeSideDef;
|
|
361
|
-
target: LinkTypeSideDef;
|
|
362
|
-
/** The foreign key on the source. */
|
|
363
|
-
foreignKey: string;
|
|
364
|
-
/** How many sources are linked to the target. */
|
|
365
|
-
cardinality: "one" | "many";
|
|
366
|
-
};
|
|
367
|
-
/** An action type in the ontology. */
|
|
368
|
-
export type ActionType = {
|
|
369
|
-
/** The provider-assigned stable identifier for this action type. */
|
|
370
|
-
id: string;
|
|
371
|
-
/** Provider-specific metadata used to execute this action. */
|
|
372
|
-
meta?: Record<string, unknown>;
|
|
373
|
-
/** The object type's programmatic name. */
|
|
374
|
-
name: string;
|
|
375
|
-
/** Human-readable name. */
|
|
376
|
-
displayName: string;
|
|
377
|
-
/** Optional portable icon descriptor. */
|
|
378
|
-
icon?: IconDescriptor;
|
|
379
|
-
/** Optional display color independent of the icon. */
|
|
380
|
-
color?: string;
|
|
381
|
-
/** The action type's parametero. */
|
|
382
|
-
parameters: Array<ActionParameterDef>;
|
|
383
|
-
/** The action type's local logic stepo. */
|
|
384
|
-
logic: Array<ActionLogicStep>;
|
|
385
|
-
/** Optional description. */
|
|
386
|
-
description?: string;
|
|
387
|
-
deprecated?: Deprecation;
|
|
388
|
-
};
|
|
389
|
-
/** A runnable query function type in the ontology. */
|
|
390
|
-
export type QueryFunctionType = {
|
|
391
|
-
/** The query function type's programmatic name. */
|
|
392
|
-
name: string;
|
|
393
|
-
/** Human-readable name. */
|
|
394
|
-
displayName: string;
|
|
395
|
-
/** The query function type's parameters. */
|
|
396
|
-
parameters: Array<QueryFunctionParameterDef>;
|
|
397
|
-
/** The query function type's return type. */
|
|
398
|
-
returnType: TypeDef;
|
|
399
|
-
/** Optional description. */
|
|
400
|
-
description?: string;
|
|
401
|
-
deprecated?: Deprecation;
|
|
402
|
-
};
|
|
403
|
-
export type MetaOntologyContext = Record<string, unknown>;
|
|
404
|
-
export type MetaOntology = {
|
|
405
|
-
context: MetaOntologyContext;
|
|
406
|
-
objectTypes: {
|
|
407
|
-
ValueType: ValueType;
|
|
408
|
-
ObjectType: ObjectType;
|
|
409
|
-
LinkType: LinkType;
|
|
410
|
-
ActionType: ActionType;
|
|
411
|
-
QueryFunctionType: QueryFunctionType;
|
|
412
|
-
};
|
|
413
|
-
actionTypes: Record<never, never>;
|
|
414
|
-
queryFunctionTypes: Record<never, never>;
|
|
415
|
-
};
|
|
416
|
-
//#endregion
|
|
417
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","names":[],"sources":["../../../src/meta/generated/types.ts"],"mappings":";;;YAKY;;YAoHA;;EAER,MAAM;;EAEN,OAAO;;YAGC;EACR;;;YAIQ;EACR;EACA;;;YAIQ;EACR,SAAS,MAAM;;;YAIP;EACR;;;YAIQ,mBAAmB,EAAE;EAC7B,MAAM;EACN,OAAO;;;YAIC;EACR,aAAa;EACb,cAAc,MAAM;;;YAIZ,iBAAiB;;YAGjB,iBAAiB;;YAGjB,eAAe;;YAGf,gBAAgB;;YAGhB,cAAc;;YAGd,mBAAmB;;YAGnB,kBAAkB;;YAGlB,iBAAiB;;YAGjB;;EAER,aAAa;;;YAIL;;EAER,SAAS;;EAET,WAAW;;;YAIH;;EAER;;EAEA;;EAEA,MAAM;;EAEN;EACA,aAAa;;;YAIL;EACR,QAAQ,MAAM;;;YAIN;;EAER;;EAEA,MAAM;;;YAIE;EACR,UAAU,MAAM;;;YAIR;;EAER,MAAM;;;YAIE;;EAER,QAAQ;;EAER,SAAS;;;YAID;;EAER;;;YAIQ,UAAU,EAAE;EACpB,QAAQ;EACR,SAAS;EACT,SAAS;EACT,OAAO;EACP,QAAQ;EACR,MAAM;EACN,WAAW;EACX,UAAU;EACV,MAAM;EACN,KAAK;EACL,QAAQ;EACR,OAAO;EACP,UAAU;EACV,QAAQ;EACR,KAAK;EACL,YAAY;EACZ,iBAAiB;EACjB,SAAS;;;YAID;;YAYA;EACR;IACI,MAAM,EAAE;IACR,MAAM,EAAE;;EAEZ;IACI,MAAM,EAAE;IACR,MAAM,EAAE;;;;YAKJ;EACR,aAAa,MAAM;EACnB,aAAa;;;YAIL,8BAA8B,EAAE;EACxC,OAAO;;;YAIC;EACR;IACI,MAAM,EAAE;IACR,MAAM,EAAE;;EAEZ,UAAU;;;YAIF;EACR,aAAa;EACb,OAAO;;;YAIC;;EAER;;;YAIQ;;EAER;;EAEA;;EAEA;;EAEA,MAAM;;EAEN;EACA,aAAa;;YAGL;EACR;EACA;EACA;;;YAIQ;;YAGA;;EAER;;EAEA;;EAEA,MAAM;;EAEN;EACA,aAAa;;EAEb,eAAe;;;YAIP;EACR;;;YAIQ;EACR;;;YAIQ;EACR;;;YAIQ;EACR,QAAQ;EACR,MAAM;;;YAIE;EACR,WAAW;;;YAIH;EACR,QAAQ;EACR;;;YAIQ;EACR;EACA,OAAO;;;YAIC;EACR,QAAQ,MAAM;;;YAIN;EACR,QAAQ;EACR;EACA,MAAM;;;YAIE,iBAAiB;;YAGjB,gBAAgB;;YAGhB;;EAER;;;YAIQ,aAAa,EAAE;EACvB,gBAAgB;EAChB,kBAAkB;EAClB,gBAAgB;EAChB,OAAO;EACP,cAAc;EACd,SAAS;EACT,QAAQ;EACR,KAAK;EACL,MAAM;EACN,KAAK;EACL,SAAS;;;YAID;EACR,UAAU;EACV,OAAO;;;YAIC;EACR;EACA,QAAQ,MAAM;;;YAIN;EACR,QAAQ;EACR,QAAQ,MAAM;;;YAIN;EACR,QAAQ;;;YAIA,kBAAkB,EAAE;EAC5B,cAAc;EACd,cAAc;EACd,cAAc;;;YAIN;;EAER;;EAEA;EACA,MAAM;;EAEN;EACA,aAAa;;;YAIL;EACR,MAAM;EACN,IAAI;;;YAII;EACR,YAAY;;;YAIJ,SAAS,EAAE;EACnB,MAAM;EACN,QAAQ;;;YAIA;EACR,YAAY,MAAM;;;YAIV;;EAER;;EAEA;EACA,aAAa;;EAEb,MAAM;;;YAIE;;EAER;;EAEA;;EAEA;EACA;;EAEA;;EAEA;;EAEA,OAAO;;EAEP;;EAEA,YAAY,MAAM;;EAElB;EACA,aAAa;;;YAIL;EACR;EACA,QAAQ;EACR,QAAQ;;EAER;;EAEA;;;YAIQ;;EAER;;EAEA,OAAO;;EAEP;;EAEA;;EAEA,OAAO;;EAEP;;EAEA,YAAY,MAAM;;EAElB,OAAO,MAAM;;EAEb;EACA,aAAa;;;YAIL;;EAER;;EAEA;;EAEA,YAAY,MAAM;;EAElB,YAAY;;EAEZ;EACA,aAAa;;YAGL,sBAAsB;YACtB;EACR,SAAS;EACT;IACI,WAAW;IACX,YAAY;IACZ,UAAU;IACV,YAAY;IACZ,mBAAmB;;EAEvB,aAAa;EACb,oBAAoB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/lib/meta/ontology.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { NamedTypeDef, ObjectTypeDef } from "../ir/generated/types.js";
|
|
2
|
-
//#region src/meta/ontology.d.ts
|
|
3
|
-
declare const _default: {
|
|
4
|
-
types: Array<NamedTypeDef>;
|
|
5
|
-
objectTypes: Array<ObjectTypeDef>;
|
|
6
|
-
linkTypes: {
|
|
7
|
-
id: string;
|
|
8
|
-
source: {
|
|
9
|
-
objectType: string;
|
|
10
|
-
name: string;
|
|
11
|
-
displayName: string;
|
|
12
|
-
};
|
|
13
|
-
target: {
|
|
14
|
-
objectType: string;
|
|
15
|
-
name: string;
|
|
16
|
-
displayName: string;
|
|
17
|
-
};
|
|
18
|
-
foreignKey: string;
|
|
19
|
-
cardinality: "many";
|
|
20
|
-
}[];
|
|
21
|
-
actionTypes: never[];
|
|
22
|
-
queryFunctionTypes: never[];
|
|
23
|
-
};
|
|
24
|
-
//#endregion
|
|
25
|
-
export { _default as default };
|
|
26
|
-
//# sourceMappingURL=ontology.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ontology.d.ts","names":["_$___ir_generated_types_js0.ObjectTypeDef"],"sources":["../../src/meta/ontology.ts"],"mappings":";;;;;;;;MAwGsB;MAAwB;MAA2B;;;MAEzD;MACA;MACA"}
|
package/lib/meta/ontology.js
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import { o } from "../ir/generated/builders.js";
|
|
2
|
-
import schema_default from "../ir/schema.js";
|
|
3
|
-
import { invariant } from "@bobbyfidz/panic";
|
|
4
|
-
//#region src/meta/ontology.ts
|
|
5
|
-
const idField = (description) => ({
|
|
6
|
-
name: "id",
|
|
7
|
-
displayName: "ID",
|
|
8
|
-
type: o.string({}),
|
|
9
|
-
description
|
|
10
|
-
});
|
|
11
|
-
function addRuntimeId(type, description) {
|
|
12
|
-
invariant(type.type.kind === "struct", `${type.name} must be a struct.`);
|
|
13
|
-
return {
|
|
14
|
-
...type,
|
|
15
|
-
type: o.struct({ fields: [idField(description), ...type.type.value.fields] })
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
function addRuntimeMetaFields(type) {
|
|
19
|
-
if (type.name === "ObjectTypeDef") return addRuntimeId(type, "The provider-assigned stable identifier for this object type.");
|
|
20
|
-
else if (type.name === "PropertyDef") return addRuntimeId(type, "The provider-assigned stable identifier for this property.");
|
|
21
|
-
else if (type.name === "ActionTypeDef") return addRuntimeId(type, "The provider-assigned stable identifier for this action type.");
|
|
22
|
-
else return type;
|
|
23
|
-
}
|
|
24
|
-
const metaTypes = schema_default.types.filter((type) => type.name !== "OntologyIR").map(addRuntimeMetaFields);
|
|
25
|
-
function lift(schema, objectTypes) {
|
|
26
|
-
return {
|
|
27
|
-
types: schema.types.filter((type) => !(type.name in objectTypes)),
|
|
28
|
-
objectTypes: schema.types.filter((type) => type.name in objectTypes).map((type) => {
|
|
29
|
-
invariant(type.type.kind === "struct", "Can only lift struct type into object type.");
|
|
30
|
-
const { name, primaryKey, displayName, pluralDisplayName } = objectTypes[type.name];
|
|
31
|
-
return {
|
|
32
|
-
name: name ?? type.name,
|
|
33
|
-
displayName,
|
|
34
|
-
pluralDisplayName,
|
|
35
|
-
primaryKey,
|
|
36
|
-
deprecated: type.deprecated,
|
|
37
|
-
description: type.description,
|
|
38
|
-
properties: type.type.value.fields
|
|
39
|
-
};
|
|
40
|
-
})
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
var ontology_default = {
|
|
44
|
-
...lift({ types: metaTypes }, {
|
|
45
|
-
ObjectTypeDef: {
|
|
46
|
-
name: "ObjectType",
|
|
47
|
-
primaryKey: "name",
|
|
48
|
-
displayName: "Object type",
|
|
49
|
-
pluralDisplayName: "Object types"
|
|
50
|
-
},
|
|
51
|
-
LinkTypeDef: {
|
|
52
|
-
name: "LinkType",
|
|
53
|
-
primaryKey: "id",
|
|
54
|
-
displayName: "Link type",
|
|
55
|
-
pluralDisplayName: "Link types"
|
|
56
|
-
},
|
|
57
|
-
ActionTypeDef: {
|
|
58
|
-
name: "ActionType",
|
|
59
|
-
primaryKey: "name",
|
|
60
|
-
displayName: "Action type",
|
|
61
|
-
pluralDisplayName: "Action types"
|
|
62
|
-
},
|
|
63
|
-
QueryFunctionTypeDef: {
|
|
64
|
-
name: "QueryFunctionType",
|
|
65
|
-
primaryKey: "name",
|
|
66
|
-
displayName: "Query function type",
|
|
67
|
-
pluralDisplayName: "Query function types"
|
|
68
|
-
},
|
|
69
|
-
NamedTypeDef: {
|
|
70
|
-
name: "ValueType",
|
|
71
|
-
primaryKey: "name",
|
|
72
|
-
displayName: "Value type",
|
|
73
|
-
pluralDisplayName: "Value types"
|
|
74
|
-
}
|
|
75
|
-
}),
|
|
76
|
-
linkTypes: [{
|
|
77
|
-
id: "LinkType:source",
|
|
78
|
-
source: {
|
|
79
|
-
objectType: "LinkType",
|
|
80
|
-
name: "outgoingLinkTypes",
|
|
81
|
-
displayName: "Outgoing link types"
|
|
82
|
-
},
|
|
83
|
-
target: {
|
|
84
|
-
objectType: "ObjectType",
|
|
85
|
-
name: "source",
|
|
86
|
-
displayName: "Source"
|
|
87
|
-
},
|
|
88
|
-
foreignKey: "source.objectType",
|
|
89
|
-
cardinality: "many"
|
|
90
|
-
}, {
|
|
91
|
-
id: "LinkType:target",
|
|
92
|
-
source: {
|
|
93
|
-
objectType: "LinkType",
|
|
94
|
-
name: "incomingLinkTypes",
|
|
95
|
-
displayName: "Incoming link types"
|
|
96
|
-
},
|
|
97
|
-
target: {
|
|
98
|
-
objectType: "ObjectType",
|
|
99
|
-
name: "target",
|
|
100
|
-
displayName: "Target"
|
|
101
|
-
},
|
|
102
|
-
foreignKey: "target.objectType",
|
|
103
|
-
cardinality: "many"
|
|
104
|
-
}],
|
|
105
|
-
actionTypes: [],
|
|
106
|
-
queryFunctionTypes: []
|
|
107
|
-
};
|
|
108
|
-
//#endregion
|
|
109
|
-
export { ontology_default as default };
|
|
110
|
-
|
|
111
|
-
//# sourceMappingURL=ontology.js.map
|
package/lib/meta/ontology.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ontology.js","names":["OntologyIRSchema"],"sources":["../../src/meta/ontology.ts"],"sourcesContent":["import { invariant } from \"@bobbyfidz/panic\";\nimport { o } from \"../ir/generated/builders.js\";\nimport OntologyIRSchema from \"../ir/schema.js\";\nimport type { FieldDef, NamedTypeDef, OntologyIR } from \"../ir/generated/types.js\";\n\nconst idField = (description: string): FieldDef => ({\n name: \"id\",\n displayName: \"ID\",\n type: o.string({}),\n description,\n});\n\nfunction addRuntimeId(type: NamedTypeDef, description: string): NamedTypeDef {\n invariant(type.type.kind === \"struct\", `${type.name} must be a struct.`);\n return {\n ...type,\n type: o.struct({\n fields: [idField(description), ...type.type.value.fields],\n }),\n };\n}\n\nfunction addRuntimeMetaFields(type: NamedTypeDef): NamedTypeDef {\n if (type.name === \"ObjectTypeDef\") {\n return addRuntimeId(type, \"The provider-assigned stable identifier for this object type.\");\n } else if (type.name === \"PropertyDef\") {\n return addRuntimeId(type, \"The provider-assigned stable identifier for this property.\");\n } else if (type.name === \"ActionTypeDef\") {\n return addRuntimeId(type, \"The provider-assigned stable identifier for this action type.\");\n } else {\n return type;\n }\n}\n\nconst metaTypes = OntologyIRSchema.types\n .filter((type) => type.name !== \"OntologyIR\")\n .map(addRuntimeMetaFields);\n\nfunction lift(\n schema: Pick<OntologyIR, \"types\">,\n objectTypes: Record<\n string,\n { name?: string; primaryKey: string; displayName: string; pluralDisplayName: string }\n >\n): Pick<OntologyIR, \"types\" | \"objectTypes\"> {\n return {\n types: schema.types.filter((type) => !(type.name in objectTypes)),\n objectTypes: schema.types\n .filter((type) => type.name in objectTypes)\n .map((type) => {\n invariant(type.type.kind === \"struct\", \"Can only lift struct type into object type.\");\n const { name, primaryKey, displayName, pluralDisplayName } = objectTypes[type.name]!;\n return {\n name: name ?? type.name,\n displayName: displayName,\n pluralDisplayName,\n primaryKey,\n deprecated: type.deprecated,\n description: type.description,\n properties: type.type.value.fields,\n };\n }),\n };\n}\n\nexport default {\n ...lift(\n { types: metaTypes },\n {\n ObjectTypeDef: {\n name: \"ObjectType\",\n primaryKey: \"name\",\n displayName: \"Object type\",\n pluralDisplayName: \"Object types\",\n },\n LinkTypeDef: {\n name: \"LinkType\",\n primaryKey: \"id\",\n displayName: \"Link type\",\n pluralDisplayName: \"Link types\",\n },\n ActionTypeDef: {\n name: \"ActionType\",\n primaryKey: \"name\",\n displayName: \"Action type\",\n pluralDisplayName: \"Action types\",\n },\n QueryFunctionTypeDef: {\n name: \"QueryFunctionType\",\n primaryKey: \"name\",\n displayName: \"Query function type\",\n pluralDisplayName: \"Query function types\",\n },\n NamedTypeDef: {\n name: \"ValueType\",\n primaryKey: \"name\",\n displayName: \"Value type\",\n pluralDisplayName: \"Value types\",\n },\n }\n ),\n linkTypes: [\n {\n id: \"LinkType:source\",\n source: { objectType: \"LinkType\", name: \"outgoingLinkTypes\", displayName: \"Outgoing link types\" },\n target: {\n objectType: \"ObjectType\",\n name: \"source\",\n displayName: \"Source\",\n },\n foreignKey: \"source.objectType\",\n cardinality: \"many\",\n },\n {\n id: \"LinkType:target\",\n source: { objectType: \"LinkType\", name: \"incomingLinkTypes\", displayName: \"Incoming link types\" },\n target: { objectType: \"ObjectType\", name: \"target\", displayName: \"Target\" },\n foreignKey: \"target.objectType\",\n cardinality: \"many\",\n },\n ],\n actionTypes: [],\n queryFunctionTypes: [],\n} satisfies OntologyIR;\n"],"mappings":";;;;AAKA,MAAM,WAAW,iBAAmC;CAChD,MAAM;CACN,aAAa;CACb,MAAM,EAAE,OAAO,CAAC,CAAC;CACjB;AACJ;AAEA,SAAS,aAAa,MAAoB,aAAmC;CACzE,UAAU,KAAK,KAAK,SAAS,UAAU,GAAG,KAAK,KAAK,mBAAmB;CACvE,OAAO;EACH,GAAG;EACH,MAAM,EAAE,OAAO,EACX,QAAQ,CAAC,QAAQ,WAAW,GAAG,GAAG,KAAK,KAAK,MAAM,MAAM,EAC5D,CAAC;CACL;AACJ;AAEA,SAAS,qBAAqB,MAAkC;CAC5D,IAAI,KAAK,SAAS,iBACd,OAAO,aAAa,MAAM,+DAA+D;MACtF,IAAI,KAAK,SAAS,eACrB,OAAO,aAAa,MAAM,4DAA4D;MACnF,IAAI,KAAK,SAAS,iBACrB,OAAO,aAAa,MAAM,+DAA+D;MAEzF,OAAO;AAEf;AAEA,MAAM,YAAYA,eAAiB,MAC9B,QAAQ,SAAS,KAAK,SAAS,YAAY,CAAC,CAC5C,IAAI,oBAAoB;AAE7B,SAAS,KACL,QACA,aAIyC;CACzC,OAAO;EACH,OAAO,OAAO,MAAM,QAAQ,SAAS,EAAE,KAAK,QAAQ,YAAY;EAChE,aAAa,OAAO,MACf,QAAQ,SAAS,KAAK,QAAQ,WAAW,CAAC,CAC1C,KAAK,SAAS;GACX,UAAU,KAAK,KAAK,SAAS,UAAU,6CAA6C;GACpF,MAAM,EAAE,MAAM,YAAY,aAAa,sBAAsB,YAAY,KAAK;GAC9E,OAAO;IACH,MAAM,QAAQ,KAAK;IACN;IACb;IACA;IACA,YAAY,KAAK;IACjB,aAAa,KAAK;IAClB,YAAY,KAAK,KAAK,MAAM;GAChC;EACJ,CAAC;CACT;AACJ;AAEA,IAAA,mBAAe;CACX,GAAG,KACC,EAAE,OAAO,UAAU,GACnB;EACI,eAAe;GACX,MAAM;GACN,YAAY;GACZ,aAAa;GACb,mBAAmB;EACvB;EACA,aAAa;GACT,MAAM;GACN,YAAY;GACZ,aAAa;GACb,mBAAmB;EACvB;EACA,eAAe;GACX,MAAM;GACN,YAAY;GACZ,aAAa;GACb,mBAAmB;EACvB;EACA,sBAAsB;GAClB,MAAM;GACN,YAAY;GACZ,aAAa;GACb,mBAAmB;EACvB;EACA,cAAc;GACV,MAAM;GACN,YAAY;GACZ,aAAa;GACb,mBAAmB;EACvB;CACJ,CACJ;CACA,WAAW,CACP;EACI,IAAI;EACJ,QAAQ;GAAE,YAAY;GAAY,MAAM;GAAqB,aAAa;EAAsB;EAChG,QAAQ;GACJ,YAAY;GACZ,MAAM;GACN,aAAa;EACjB;EACA,YAAY;EACZ,aAAa;CACjB,GACA;EACI,IAAI;EACJ,QAAQ;GAAE,YAAY;GAAY,MAAM;GAAqB,aAAa;EAAsB;EAChG,QAAQ;GAAE,YAAY;GAAc,MAAM;GAAU,aAAa;EAAS;EAC1E,YAAY;EACZ,aAAa;CACjB,CACJ;CACA,aAAa,CAAC;CACd,oBAAoB,CAAC;AACzB"}
|
package/lib/utils/links.d.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { LinkTypeDef, OntologyIR } from "../ir/generated/types.js";
|
|
2
|
-
import "../ir/index.js";
|
|
3
|
-
import { ArrayElement, ObjectTypeName } from "./typeNames.js";
|
|
4
|
-
//#region src/utils/links.d.ts
|
|
5
|
-
type LinkTypes<IR extends Pick<OntologyIR, "linkTypes">> = ArrayElement<IR["linkTypes"]>;
|
|
6
|
-
type LinkHopNameForLink<Link, SourceObjectType extends string> = Link extends {
|
|
7
|
-
source: {
|
|
8
|
-
objectType: infer LinkSourceObjectType extends string;
|
|
9
|
-
};
|
|
10
|
-
target: {
|
|
11
|
-
objectType: infer LinkTargetObjectType extends string;
|
|
12
|
-
name: infer TargetName extends string;
|
|
13
|
-
};
|
|
14
|
-
} ? SourceObjectType extends LinkSourceObjectType ? TargetName : SourceObjectType extends LinkTargetObjectType ? Link extends {
|
|
15
|
-
source: {
|
|
16
|
-
name: infer SourceName extends string;
|
|
17
|
-
};
|
|
18
|
-
} ? SourceName : never : never : never;
|
|
19
|
-
export type LinkHopName<IR extends Pick<OntologyIR, "linkTypes">, SourceObjectType extends string> = LinkHopNameForLink<LinkTypes<IR>, SourceObjectType>;
|
|
20
|
-
type LinkHopTargetForLink<Link, SourceObjectType extends string, Name extends string> = Link extends {
|
|
21
|
-
source: {
|
|
22
|
-
objectType: infer LinkSourceObjectType extends string;
|
|
23
|
-
name: infer SourceName extends string;
|
|
24
|
-
};
|
|
25
|
-
target: {
|
|
26
|
-
objectType: infer TargetObjectType extends string;
|
|
27
|
-
name: infer TargetName extends string;
|
|
28
|
-
};
|
|
29
|
-
} ? SourceObjectType extends LinkSourceObjectType ? Name extends TargetName ? TargetObjectType : never : Link extends {
|
|
30
|
-
target: {
|
|
31
|
-
objectType: infer LinkTargetObjectType extends string;
|
|
32
|
-
};
|
|
33
|
-
} ? SourceObjectType extends LinkTargetObjectType ? Name extends SourceName ? LinkSourceObjectType : never : never : never : never;
|
|
34
|
-
export type LinkHopTargetObjectType<IR extends Pick<OntologyIR, "linkTypes">, SourceObjectType extends string, Name extends string> = LinkHopTargetForLink<LinkTypes<IR>, SourceObjectType, Name>;
|
|
35
|
-
type LinkHopLinkForLink<Link, SourceObjectType extends string, Name extends string> = Link extends {
|
|
36
|
-
source: {
|
|
37
|
-
objectType: infer LinkSourceObjectType extends string;
|
|
38
|
-
name: infer SourceName extends string;
|
|
39
|
-
};
|
|
40
|
-
target: {
|
|
41
|
-
objectType: infer LinkTargetObjectType extends string;
|
|
42
|
-
name: infer TargetName extends string;
|
|
43
|
-
};
|
|
44
|
-
} ? SourceObjectType extends LinkSourceObjectType ? Name extends TargetName ? Link : never : SourceObjectType extends LinkTargetObjectType ? Name extends SourceName ? Link : never : never : never;
|
|
45
|
-
export type LinkHopLink<IR extends Pick<OntologyIR, "linkTypes">, SourceObjectType extends string, Name extends string> = LinkHopLinkForLink<LinkTypes<IR>, SourceObjectType, Name>;
|
|
46
|
-
export declare function isLinkHopFromForeignKeySource(link: LinkTypeDef, sourceObjectType: string, linkName: string): boolean;
|
|
47
|
-
export declare function resolveLinkHop<const IR extends Pick<OntologyIR, "linkTypes" | "objectTypes">, const SourceObjectType extends ObjectTypeName<IR>, const Name extends LinkHopName<IR, SourceObjectType>>(ir: IR, sourceObjectType: SourceObjectType, linkName: Name): LinkHopLink<IR, SourceObjectType, Name> | undefined;
|
|
48
|
-
//#endregion
|
|
49
|
-
//# sourceMappingURL=links.d.ts.map
|
package/lib/utils/links.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"links.d.ts","names":[],"sources":["../../src/utils/links.ts"],"mappings":";;;;KAGK,UAAU,WAAW,KAAK,4BAA4B,aAAa;KAEnE,mBAAmB,MAAM,mCAAmC;EAC7D;IACI,kBAAkB;;EAEtB;IACI,kBAAkB;IAClB,YAAY;;IAGd,yBAAyB,uBACrB,aACA,yBAAyB,uBACvB;EACI;IACI,YAAY;;IAGhB;YAKJ,YACR,WAAW,KAAK,0BAChB,mCACA,mBAAmB,UAAU,KAAK;KAEjC,qBAAqB,MAAM,iCAAiC,uBAAuB;EACpF;IACI,kBAAkB;IAClB,YAAY;;EAEhB;IACI,kBAAkB;IAClB,YAAY;;IAGd,yBAAyB,uBACrB,aAAa,aACT,2BAEJ;EACM;IACI,kBAAkB;;IAG1B,yBAAyB,uBACrB,aAAa,aACT;YAMR,wBACR,WAAW,KAAK,0BAChB,iCACA,uBACA,qBAAqB,UAAU,KAAK,kBAAkB;KAErD,mBAAmB,MAAM,iCAAiC,uBAAuB;EAClF;IACI,kBAAkB;IAClB,YAAY;;EAEhB;IACI,kBAAkB;IAClB,YAAY;;IAGd,yBAAyB,uBACrB,aAAa,aACT,eAEJ,yBAAyB,uBACvB,aAAa,aACT;YAKJ,YACR,WAAW,KAAK,0BAChB,iCACA,uBACA,mBAAmB,UAAU,KAAK,kBAAkB;wBAExC,8BACZ,MAAM,aACN,0BACA;wBAKY,qBACN,WAAW,KAAK,gDAChB,yBAAyB,eAAe,WACxC,aAAa,YAAY,IAAI,mBAEnC,IAAI,IACJ,kBAAkB,kBAClB,UAAU,OACX,YAAY,IAAI,kBAAkB"}
|
package/lib/utils/links.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
//#region src/utils/links.ts
|
|
2
|
-
function isLinkHopFromForeignKeySource(link, sourceObjectType, linkName) {
|
|
3
|
-
return link.source.objectType === sourceObjectType && link.target.name === linkName;
|
|
4
|
-
}
|
|
5
|
-
function resolveLinkHop(ir, sourceObjectType, linkName) {
|
|
6
|
-
const matches = ir.linkTypes.flatMap((link) => [...isLinkHopFromForeignKeySource(link, sourceObjectType, linkName) ? [link] : [], ...link.target.objectType === sourceObjectType && link.source.name === linkName ? [link] : []]);
|
|
7
|
-
if (matches.length !== 1) return void 0;
|
|
8
|
-
return matches[0];
|
|
9
|
-
}
|
|
10
|
-
//#endregion
|
|
11
|
-
export { isLinkHopFromForeignKeySource, resolveLinkHop };
|
|
12
|
-
|
|
13
|
-
//# sourceMappingURL=links.js.map
|
package/lib/utils/links.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"links.js","names":[],"sources":["../../src/utils/links.ts"],"sourcesContent":["import type { LinkTypeDef, OntologyIR } from \"../ir/index.js\";\nimport type { ArrayElement, ObjectTypeName } from \"./typeNames.js\";\n\ntype LinkTypes<IR extends Pick<OntologyIR, \"linkTypes\">> = ArrayElement<IR[\"linkTypes\"]>;\n\ntype LinkHopNameForLink<Link, SourceObjectType extends string> = Link extends {\n source: {\n objectType: infer LinkSourceObjectType extends string;\n };\n target: {\n objectType: infer LinkTargetObjectType extends string;\n name: infer TargetName extends string;\n };\n}\n ? SourceObjectType extends LinkSourceObjectType\n ? TargetName\n : SourceObjectType extends LinkTargetObjectType\n ? Link extends {\n source: {\n name: infer SourceName extends string;\n };\n }\n ? SourceName\n : never\n : never\n : never;\n\nexport type LinkHopName<\n IR extends Pick<OntologyIR, \"linkTypes\">,\n SourceObjectType extends string,\n> = LinkHopNameForLink<LinkTypes<IR>, SourceObjectType>;\n\ntype LinkHopTargetForLink<Link, SourceObjectType extends string, Name extends string> = Link extends {\n source: {\n objectType: infer LinkSourceObjectType extends string;\n name: infer SourceName extends string;\n };\n target: {\n objectType: infer TargetObjectType extends string;\n name: infer TargetName extends string;\n };\n}\n ? SourceObjectType extends LinkSourceObjectType\n ? Name extends TargetName\n ? TargetObjectType\n : never\n : Link extends {\n target: {\n objectType: infer LinkTargetObjectType extends string;\n };\n }\n ? SourceObjectType extends LinkTargetObjectType\n ? Name extends SourceName\n ? LinkSourceObjectType\n : never\n : never\n : never\n : never;\n\nexport type LinkHopTargetObjectType<\n IR extends Pick<OntologyIR, \"linkTypes\">,\n SourceObjectType extends string,\n Name extends string,\n> = LinkHopTargetForLink<LinkTypes<IR>, SourceObjectType, Name>;\n\ntype LinkHopLinkForLink<Link, SourceObjectType extends string, Name extends string> = Link extends {\n source: {\n objectType: infer LinkSourceObjectType extends string;\n name: infer SourceName extends string;\n };\n target: {\n objectType: infer LinkTargetObjectType extends string;\n name: infer TargetName extends string;\n };\n}\n ? SourceObjectType extends LinkSourceObjectType\n ? Name extends TargetName\n ? Link\n : never\n : SourceObjectType extends LinkTargetObjectType\n ? Name extends SourceName\n ? Link\n : never\n : never\n : never;\n\nexport type LinkHopLink<\n IR extends Pick<OntologyIR, \"linkTypes\">,\n SourceObjectType extends string,\n Name extends string,\n> = LinkHopLinkForLink<LinkTypes<IR>, SourceObjectType, Name>;\n\nexport function isLinkHopFromForeignKeySource(\n link: LinkTypeDef,\n sourceObjectType: string,\n linkName: string\n): boolean {\n return link.source.objectType === sourceObjectType && link.target.name === linkName;\n}\n\nexport function resolveLinkHop<\n const IR extends Pick<OntologyIR, \"linkTypes\" | \"objectTypes\">,\n const SourceObjectType extends ObjectTypeName<IR>,\n const Name extends LinkHopName<IR, SourceObjectType>,\n>(\n ir: IR,\n sourceObjectType: SourceObjectType,\n linkName: Name\n): LinkHopLink<IR, SourceObjectType, Name> | undefined {\n const matches = ir.linkTypes.flatMap((link) => [\n ...(isLinkHopFromForeignKeySource(link, sourceObjectType, linkName) ? [link] : []),\n ...(link.target.objectType === sourceObjectType && link.source.name === linkName ? [link] : []),\n ]);\n if (matches.length !== 1) return undefined;\n return matches[0] as LinkHopLink<IR, SourceObjectType, Name>;\n}\n"],"mappings":";AA4FA,SAAgB,8BACZ,MACA,kBACA,UACO;CACP,OAAO,KAAK,OAAO,eAAe,oBAAoB,KAAK,OAAO,SAAS;AAC/E;AAEA,SAAgB,eAKZ,IACA,kBACA,UACmD;CACnD,MAAM,UAAU,GAAG,UAAU,SAAS,SAAS,CAC3C,GAAI,8BAA8B,MAAM,kBAAkB,QAAQ,IAAI,CAAC,IAAI,IAAI,CAAC,GAChF,GAAI,KAAK,OAAO,eAAe,oBAAoB,KAAK,OAAO,SAAS,WAAW,CAAC,IAAI,IAAI,CAAC,CACjG,CAAC;CACD,IAAI,QAAQ,WAAW,GAAG,OAAO,KAAA;CACjC,OAAO,QAAQ;AACnB"}
|
package/lib/utils/paths.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
//#region src/utils/paths.d.ts
|
|
2
|
-
export declare function getAtPath(value: unknown, path: readonly string[]): unknown;
|
|
3
|
-
export declare function setAtPath<T>(value: T, path: readonly string[], replacement: unknown): T;
|
|
4
|
-
export declare function unsetAtPath<T>(value: T, path: readonly string[]): T;
|
|
5
|
-
//#endregion
|
|
6
|
-
//# sourceMappingURL=paths.d.ts.map
|