ts-prorm-orm 1.1.0 → 1.2.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/CHANGELOG.md +83 -0
- package/README.md +194 -72
- package/dist/audit/history-query.d.ts +35 -0
- package/dist/audit/index.d.ts +16 -0
- package/dist/audit/logger.d.ts +126 -0
- package/dist/cache/cache-manager.d.ts +341 -0
- package/dist/cache/index.d.ts +8 -0
- package/dist/cache/redis-cluster-cache.d.ts +164 -0
- package/dist/cache/redis-cluster-cache.js +19 -36
- package/dist/cli/cloud.d.ts +55 -0
- package/dist/cli/cloud.js +318 -0
- package/dist/cli/commands/auth.d.ts +2 -0
- package/dist/cli/commands/auth.js +345 -0
- package/dist/cli/commands/billing.d.ts +2 -0
- package/dist/cli/commands/billing.js +135 -0
- package/dist/cli/commands/code.d.ts +2 -0
- package/dist/cli/commands/code.js +168 -0
- package/dist/cli/commands/config.d.ts +2 -0
- package/dist/cli/commands/config.js +154 -0
- package/dist/cli/commands/db.d.ts +2 -0
- package/dist/cli/commands/db.js +189 -0
- package/dist/cli/commands/index.d.ts +1 -0
- package/dist/cli/commands/index.js +22 -0
- package/dist/cli/commands/keys.d.ts +2 -0
- package/dist/cli/commands/keys.js +100 -0
- package/dist/cli/commands/misc.d.ts +2 -0
- package/dist/cli/commands/misc.js +282 -0
- package/dist/cli/commands/pull.d.ts +2 -0
- package/dist/cli/commands/pull.js +306 -0
- package/dist/cli/commands/runners.d.ts +2 -0
- package/dist/cli/commands/runners.js +218 -0
- package/dist/cli/commands/scaffold.d.ts +2 -0
- package/dist/cli/commands/scaffold.js +383 -0
- package/dist/cli/commands/secrets.d.ts +2 -0
- package/dist/cli/commands/secrets.js +162 -0
- package/dist/cli/commands/store.d.ts +2 -0
- package/dist/cli/commands/store.js +274 -0
- package/dist/cli/commands/system.d.ts +10 -0
- package/dist/cli/commands/system.js +169 -0
- package/dist/cli/commands/teams.d.ts +2 -0
- package/dist/cli/commands/teams.js +189 -0
- package/dist/cli/commands/user.d.ts +2 -0
- package/dist/cli/commands/user.js +171 -0
- package/dist/cli/framework.d.ts +103 -0
- package/dist/cli/framework.js +436 -0
- package/dist/cli/io.d.ts +26 -0
- package/dist/cli/io.js +181 -0
- package/dist/cli/keychain.d.ts +10 -0
- package/dist/cli/keychain.js +101 -0
- package/dist/cli/prompt.d.ts +20 -0
- package/dist/cli/prompt.js +111 -0
- package/dist/cli.d.ts +214 -0
- package/dist/cli.js +72 -5
- package/dist/compliance/audit-trail.d.ts +66 -0
- package/dist/compliance/backup-verification.d.ts +279 -0
- package/dist/compliance/breach-detector.d.ts +197 -0
- package/dist/compliance/consent-record.d.ts +107 -0
- package/dist/compliance/consent-versioning.d.ts +169 -0
- package/dist/compliance/cross-border-log.d.ts +254 -0
- package/dist/compliance/data-classifier.d.ts +127 -0
- package/dist/compliance/data-lineage.d.ts +268 -0
- package/dist/compliance/data-masker.d.ts +110 -0
- package/dist/compliance/data-portability.d.ts +98 -0
- package/dist/compliance/data-retention.d.ts +108 -0
- package/dist/compliance/dsar-workflow.d.ts +175 -0
- package/dist/compliance/field-encryption.d.ts +84 -0
- package/dist/compliance/immutable-record.d.ts +84 -0
- package/dist/compliance/index.d.ts +93 -0
- package/dist/compliance/privacy-impact-assessment.d.ts +196 -0
- package/dist/compliance/pseudonymization.d.ts +96 -0
- package/dist/compliance/query-firewall.d.ts +661 -0
- package/dist/compliance/rate-limiter.d.ts +203 -0
- package/dist/compliance/right-to-erasure.d.ts +96 -0
- package/dist/compliance/row-level-security.d.ts +152 -0
- package/dist/compliance/security-decorator.d.ts +388 -0
- package/dist/compliance/security-monitor.d.ts +170 -0
- package/dist/compliance/sensitive-data-discovery.d.ts +151 -0
- package/dist/compliance/session-isolation.d.ts +286 -0
- package/dist/compliance/tls-enforcer.d.ts +51 -0
- package/dist/compliance/worm-storage.d.ts +225 -0
- package/dist/connection-manager.d.ts +130 -0
- package/dist/connection-pool.d.ts +311 -0
- package/dist/decorators/audit.d.ts +49 -0
- package/dist/decorators/check.d.ts +218 -0
- package/dist/decorators/collate.d.ts +346 -0
- package/dist/decorators/comment.d.ts +51 -0
- package/dist/decorators/database-settings.d.ts +193 -0
- package/dist/decorators/default.d.ts +148 -0
- package/dist/decorators/encryption.d.ts +175 -0
- package/dist/decorators/engine.d.ts +97 -0
- package/dist/decorators/fk-constraints.d.ts +387 -0
- package/dist/decorators/foreign-table.d.ts +57 -0
- package/dist/decorators/generated.d.ts +232 -0
- package/dist/decorators/hstore.d.ts +96 -0
- package/dist/decorators/index.d.ts +57 -0
- package/dist/decorators/index.js +14 -30
- package/dist/decorators/json-column.d.ts +47 -0
- package/dist/decorators/jsonb.d.ts +83 -0
- package/dist/decorators/orm-decorators.d.ts +274 -0
- package/dist/decorators/permissions.d.ts +192 -0
- package/dist/decorators/procedure.d.ts +168 -0
- package/dist/decorators/procedure.js +31 -7
- package/dist/decorators/query-options.d.ts +527 -0
- package/dist/decorators/range.d.ts +122 -0
- package/dist/decorators/set-column.d.ts +43 -0
- package/dist/decorators/spatial.d.ts +60 -0
- package/dist/decorators/storage.d.ts +561 -0
- package/dist/decorators/timezone.d.ts +319 -0
- package/dist/decorators/trigger.d.ts +50 -0
- package/dist/decorators/uuid.d.ts +102 -0
- package/dist/decorators/view.d.ts +213 -0
- package/dist/diagrams/chen-diagram.d.ts +70 -0
- package/dist/diagrams/chen-diagram.js +33 -31
- package/dist/diagrams/class-diagram.d.ts +78 -0
- package/dist/diagrams/class-diagram.js +23 -27
- package/dist/diagrams/dependency-diagram.d.ts +82 -0
- package/dist/diagrams/dependency-diagram.js +18 -9
- package/dist/diagrams/er-diagram.d.ts +82 -0
- package/dist/diagrams/er-diagram.js +174 -231
- package/dist/diagrams/flow-diagram.d.ts +70 -0
- package/dist/diagrams/flow-diagram.js +23 -18
- package/dist/diagrams/gantt-diagram.d.ts +67 -0
- package/dist/diagrams/gantt-diagram.js +20 -18
- package/dist/diagrams/index-diagram.d.ts +61 -0
- package/dist/diagrams/index-diagram.js +36 -31
- package/dist/diagrams/index.d.ts +155 -0
- package/dist/diagrams/index.js +7 -1
- package/dist/diagrams/migration-diagram.d.ts +67 -0
- package/dist/diagrams/migration-diagram.js +45 -57
- package/dist/diagrams/model-diagram.d.ts +85 -0
- package/dist/diagrams/model-diagram.js +225 -287
- package/dist/diagrams/package-diagram.d.ts +69 -0
- package/dist/diagrams/package-diagram.js +30 -32
- package/dist/diagrams/palette.d.ts +138 -0
- package/dist/diagrams/palette.js +134 -25
- package/dist/diagrams/relational-diagram.d.ts +82 -0
- package/dist/diagrams/relational-diagram.js +51 -59
- package/dist/diagrams/schemadoc-diagram.d.ts +57 -0
- package/dist/diagrams/schemadoc-diagram.js +36 -28
- package/dist/diagrams/sequence-diagram.d.ts +61 -0
- package/dist/diagrams/sequence-diagram.js +20 -11
- package/dist/diagrams/state-diagram.d.ts +85 -0
- package/dist/diagrams/state-diagram.js +21 -17
- package/dist/diagrams/svg-dom.d.ts +62 -0
- package/dist/diagrams/svg-dom.js +11 -0
- package/dist/diagrams/tree-diagram.d.ts +47 -0
- package/dist/diagrams/tree-diagram.js +19 -10
- package/dist/dialects/clickhouse/index.d.ts +660 -0
- package/dist/dialects/clickhouse/index.js +107 -2
- package/dist/dialects/cockroachdb/index.d.ts +1708 -0
- package/dist/dialects/cockroachdb/index.js +139 -10
- package/dist/dialects/cratedb/index.d.ts +262 -0
- package/dist/dialects/cratedb/index.js +148 -0
- package/dist/dialects/databricks/index.d.ts +397 -0
- package/dist/dialects/databricks/index.js +233 -11
- package/dist/dialects/db2/index.d.ts +729 -0
- package/dist/dialects/db2/index.js +152 -2
- package/dist/dialects/dialect.d.ts +1653 -0
- package/dist/dialects/duckdb/index.d.ts +440 -0
- package/dist/dialects/duckdb/index.js +21 -37
- package/dist/dialects/exasol/index.d.ts +197 -0
- package/dist/dialects/exasol/index.js +14 -0
- package/dist/dialects/firebird/index.d.ts +286 -0
- package/dist/dialects/firebird/index.js +135 -0
- package/dist/dialects/greenplum/index.d.ts +336 -0
- package/dist/dialects/greenplum/index.js +168 -0
- package/dist/dialects/hana/index.d.ts +512 -0
- package/dist/dialects/hana/index.js +17 -35
- package/dist/dialects/mariadb/index.d.ts +1241 -0
- package/dist/dialects/mariadb/index.js +181 -43
- package/dist/dialects/mssql/index.d.ts +729 -0
- package/dist/dialects/mssql/index.js +76 -7
- package/dist/dialects/mysql/index.d.ts +1233 -0
- package/dist/dialects/mysql/index.js +87 -19
- package/dist/dialects/oracle/index.d.ts +1222 -0
- package/dist/dialects/oracle/index.js +210 -9
- package/dist/dialects/postgres/index.d.ts +1598 -0
- package/dist/dialects/postgres/index.js +34 -13
- package/dist/dialects/query-stream-helper.d.ts +58 -0
- package/dist/dialects/questdb/index.d.ts +430 -0
- package/dist/dialects/questdb/index.js +292 -0
- package/dist/dialects/redshift/index.d.ts +933 -0
- package/dist/dialects/redshift/index.js +17 -5
- package/dist/dialects/singlestore/index.d.ts +233 -0
- package/dist/dialects/singlestore/index.js +53 -0
- package/dist/dialects/snowflake/index.d.ts +727 -0
- package/dist/dialects/snowflake/index.js +154 -5
- package/dist/dialects/spanner/index.d.ts +660 -0
- package/dist/dialects/spanner/index.js +43 -21
- package/dist/dialects/sqlite/index.d.ts +1133 -0
- package/dist/dialects/sqlite/index.js +168 -30
- package/dist/dialects/tidb/index.d.ts +226 -0
- package/dist/dialects/tidb/index.js +10 -0
- package/dist/dialects/timescaledb/index.d.ts +286 -0
- package/dist/dialects/timescaledb/index.js +179 -0
- package/dist/dialects/trino/index.d.ts +230 -0
- package/dist/dialects/trino/index.js +85 -10
- package/dist/dialects/turso/index.d.ts +98 -0
- package/dist/dialects/turso/index.js +10 -0
- package/dist/dialects/vertica/index.d.ts +321 -0
- package/dist/dialects/vertica/index.js +161 -0
- package/dist/dialects/yugabytedb/index.d.ts +276 -0
- package/dist/dialects/yugabytedb/index.js +121 -0
- package/dist/errors/index.d.ts +378 -0
- package/dist/errors/index.js +29 -1
- package/dist/errors/utils.d.ts +53 -0
- package/dist/errors.d.ts +5 -0
- package/dist/extensions/catalog/cloud-warehouse-features.d.ts +27 -0
- package/dist/extensions/catalog/mssql-features.d.ts +20 -0
- package/dist/extensions/catalog/mysql-mariadb-plugins.d.ts +18 -0
- package/dist/extensions/catalog/oracle-db2-features.d.ts +17 -0
- package/dist/extensions/catalog/postgres-extensions.d.ts +15 -0
- package/dist/extensions/index.d.ts +34 -0
- package/dist/extensions/types.d.ts +43 -0
- package/dist/external-fields/adapters.d.ts +50 -0
- package/dist/external-fields/adapters.js +227 -0
- package/dist/external-fields/decorator.d.ts +77 -0
- package/dist/external-fields/decorator.js +80 -0
- package/dist/external-fields/index.d.ts +10 -0
- package/dist/external-fields/index.js +19 -0
- package/dist/external-fields/runtime.d.ts +39 -0
- package/dist/external-fields/runtime.js +221 -0
- package/dist/foreign-data.d.ts +168 -0
- package/dist/graph/base-graph-dialect.d.ts +250 -0
- package/dist/graph/base-graph-dialect.js +539 -0
- package/dist/graph/dgraph/index.d.ts +65 -0
- package/dist/graph/dgraph/index.js +559 -0
- package/dist/graph/gremlin/index.d.ts +59 -0
- package/dist/graph/gremlin/index.js +378 -0
- package/dist/graph/index.d.ts +60 -0
- package/dist/graph/index.js +67 -0
- package/dist/graph/neo4j/index.d.ts +50 -0
- package/dist/graph/neo4j/index.js +462 -0
- package/dist/graph/types.d.ts +213 -0
- package/dist/graph/types.js +234 -0
- package/dist/hooks/hooks-manager.d.ts +189 -0
- package/dist/hooks/index.d.ts +8 -0
- package/dist/index.d.ts +711 -0
- package/dist/index.js +19 -4
- package/dist/logging.d.ts +183 -0
- package/dist/migrations/index.d.ts +9 -0
- package/dist/migrations/migration.d.ts +143 -0
- package/dist/migrations/migrator.d.ts +199 -0
- package/dist/migrations/prormmigration.d.ts +131 -0
- package/dist/migrations/query-interface.d.ts +335 -0
- package/dist/migrations/seeder.d.ts +167 -0
- package/dist/models/associations.d.ts +131 -0
- package/dist/models/associations.js +7 -2
- package/dist/models/constraints.d.ts +175 -0
- package/dist/models/data-types.d.ts +1656 -0
- package/dist/models/decorators.d.ts +328 -0
- package/dist/models/decorators.js +61 -82
- package/dist/models/eager-load.d.ts +86 -0
- package/dist/models/eager-load.js +369 -0
- package/dist/models/index.d.ts +13 -0
- package/dist/models/indexes.d.ts +325 -0
- package/dist/models/methods.d.ts +419 -0
- package/dist/models/model-manager.d.ts +76 -0
- package/dist/models/model.d.ts +820 -0
- package/dist/models/model.js +15 -101
- package/dist/models/operators.d.ts +29 -0
- package/dist/models/scopes.d.ts +71 -0
- package/dist/models/typescript-types.d.ts +177 -0
- package/dist/nosql/aerospike/index.d.ts +126 -0
- package/dist/nosql/allegrograph/index.d.ts +86 -0
- package/dist/nosql/arangodb/index.d.ts +285 -0
- package/dist/nosql/arangodb/index.js +274 -2
- package/dist/nosql/arangodb/where.d.ts +38 -0
- package/dist/nosql/arangodb/where.js +94 -0
- package/dist/nosql/azure-blob/index.d.ts +104 -0
- package/dist/nosql/beanstalkd/index.d.ts +88 -0
- package/dist/nosql/beequeue/index.d.ts +99 -0
- package/dist/nosql/bigchaindb/index.d.ts +113 -0
- package/dist/nosql/bigtable/index.d.ts +144 -0
- package/dist/nosql/blazegraph/index.d.ts +88 -0
- package/dist/nosql/bullmq/index.d.ts +83 -0
- package/dist/nosql/cassandra/index.d.ts +119 -0
- package/dist/nosql/chroma/index.d.ts +151 -0
- package/dist/nosql/cloudflare-kv/index.d.ts +120 -0
- package/dist/nosql/coherence/index.d.ts +91 -0
- package/dist/nosql/cosmosdb/index.d.ts +78 -0
- package/dist/nosql/couchbase/index.d.ts +103 -0
- package/dist/nosql/dax/index.d.ts +118 -0
- package/dist/nosql/deno-kv/index.d.ts +109 -0
- package/dist/nosql/dgraph/index.d.ts +80 -0
- package/dist/nosql/doris/index.d.ts +88 -0
- package/dist/nosql/druid/index.d.ts +95 -0
- package/dist/nosql/dynamodb/index.d.ts +643 -0
- package/dist/nosql/dynamodb/index.js +423 -0
- package/dist/nosql/elasticsearch/index.d.ts +239 -0
- package/dist/nosql/etcd/index.d.ts +243 -0
- package/dist/nosql/eventhubs/index.d.ts +89 -0
- package/dist/nosql/eventstore/index.d.ts +102 -0
- package/dist/nosql/faunadb/index.d.ts +141 -0
- package/dist/nosql/faunadb/index.js +329 -0
- package/dist/nosql/firestore/index.d.ts +67 -0
- package/dist/nosql/fluree/index.d.ts +88 -0
- package/dist/nosql/fuseki/index.d.ts +94 -0
- package/dist/nosql/gcs/index.d.ts +62 -0
- package/dist/nosql/gearman/index.d.ts +77 -0
- package/dist/nosql/geode/index.d.ts +93 -0
- package/dist/nosql/graphdb/index.d.ts +86 -0
- package/dist/nosql/graylog/index.d.ts +118 -0
- package/dist/nosql/gridgain/index.d.ts +78 -0
- package/dist/nosql/hazelcast/index.d.ts +73 -0
- package/dist/nosql/hbase/index.d.ts +123 -0
- package/dist/nosql/ignite/index.d.ts +80 -0
- package/dist/nosql/immudb/index.d.ts +131 -0
- package/dist/nosql/index.d.ts +215 -0
- package/dist/nosql/infinispan/index.d.ts +95 -0
- package/dist/nosql/influxdb/flux-compiler.d.ts +23 -0
- package/dist/nosql/influxdb/flux-compiler.js +170 -0
- package/dist/nosql/influxdb/index.d.ts +300 -0
- package/dist/nosql/influxdb/index.js +0 -0
- package/dist/nosql/kafka/index.d.ts +113 -0
- package/dist/nosql/keyspaces/index.d.ts +122 -0
- package/dist/nosql/kinesis/index.d.ts +121 -0
- package/dist/nosql/leveldb/index.d.ts +112 -0
- package/dist/nosql/leveldb/index.js +103 -1
- package/dist/nosql/lmdb/index.d.ts +76 -0
- package/dist/nosql/loki/index.d.ts +126 -0
- package/dist/nosql/marklogic/index.d.ts +76 -0
- package/dist/nosql/materialize/index.d.ts +91 -0
- package/dist/nosql/meilisearch/index.d.ts +76 -0
- package/dist/nosql/memcached/index.d.ts +138 -0
- package/dist/nosql/milvus/index.d.ts +167 -0
- package/dist/nosql/minio/index.d.ts +122 -0
- package/dist/nosql/momento/index.d.ts +99 -0
- package/dist/nosql/mongodb/index.d.ts +265 -0
- package/dist/nosql/mongodb/index.js +139 -0
- package/dist/nosql/mongodb/where.d.ts +8 -0
- package/dist/nosql/mongodb/where.js +181 -0
- package/dist/nosql/nats/index.d.ts +139 -0
- package/dist/nosql/nedb/index.d.ts +79 -0
- package/dist/nosql/neo4j/index.d.ts +217 -0
- package/dist/nosql/neo4j/index.js +26 -14
- package/dist/nosql/neptune/index.d.ts +234 -0
- package/dist/nosql/neptune/index.js +23 -9
- package/dist/nosql/nsq/index.d.ts +93 -0
- package/dist/nosql/opensearch/index.d.ts +97 -0
- package/dist/nosql/orientdb/index.d.ts +72 -0
- package/dist/nosql/papertrail/index.d.ts +120 -0
- package/dist/nosql/pinecone/index.d.ts +148 -0
- package/dist/nosql/pinot/index.d.ts +90 -0
- package/dist/nosql/pouchdb/index.d.ts +95 -0
- package/dist/nosql/prometheus/index.d.ts +112 -0
- package/dist/nosql/provendb/index.d.ts +143 -0
- package/dist/nosql/provendb/index.js +262 -0
- package/dist/nosql/pubsub/index.d.ts +83 -0
- package/dist/nosql/pulsar/index.d.ts +105 -0
- package/dist/nosql/qdrant/index.d.ts +231 -0
- package/dist/nosql/qldb/index.d.ts +182 -0
- package/dist/nosql/qldb/index.js +302 -1
- package/dist/nosql/r2/index.d.ts +160 -0
- package/dist/nosql/rabbitmq/index.d.ts +131 -0
- package/dist/nosql/ravendb/index.d.ts +138 -0
- package/dist/nosql/ravendb/index.js +323 -9
- package/dist/nosql/ravendb/where.d.ts +38 -0
- package/dist/nosql/ravendb/where.js +94 -0
- package/dist/nosql/redis/index.d.ts +267 -0
- package/dist/nosql/redis/index.js +19 -5
- package/dist/nosql/redpanda/index.d.ts +117 -0
- package/dist/nosql/resque/index.d.ts +91 -0
- package/dist/nosql/rethinkdb/index.d.ts +194 -0
- package/dist/nosql/rethinkdb/index.js +290 -0
- package/dist/nosql/rethinkdb/where.d.ts +38 -0
- package/dist/nosql/rethinkdb/where.js +94 -0
- package/dist/nosql/rocksdb/document-layer.d.ts +162 -0
- package/dist/nosql/rocksdb/document-layer.js +338 -0
- package/dist/nosql/rocksdb/index.d.ts +112 -0
- package/dist/nosql/rocksdb/index.js +103 -1
- package/dist/nosql/rocksdb/where-match.d.ts +21 -0
- package/dist/nosql/rocksdb/where-match.js +238 -0
- package/dist/nosql/rockset/index.d.ts +84 -0
- package/dist/nosql/s3/index.d.ts +170 -0
- package/dist/nosql/scylladb/index.d.ts +117 -0
- package/dist/nosql/signoz/index.d.ts +116 -0
- package/dist/nosql/sns/index.d.ts +99 -0
- package/dist/nosql/solr/index.d.ts +129 -0
- package/dist/nosql/splunk/index.d.ts +125 -0
- package/dist/nosql/sqs/index.d.ts +116 -0
- package/dist/nosql/stardog/index.d.ts +86 -0
- package/dist/nosql/starrocks/index.d.ts +89 -0
- package/dist/nosql/store.d.ts +23 -0
- package/dist/nosql/sumologic/index.d.ts +119 -0
- package/dist/nosql/surrealdb/index.d.ts +156 -0
- package/dist/nosql/surrealdb/index.js +174 -1
- package/dist/nosql/surrealdb/query-compiler.d.ts +26 -0
- package/dist/nosql/surrealdb/query-compiler.js +193 -0
- package/dist/nosql/terminusdb/index.d.ts +95 -0
- package/dist/nosql/tigergraph/index.d.ts +314 -0
- package/dist/nosql/typesense/index.d.ts +82 -0
- package/dist/nosql/unqlite/index.d.ts +68 -0
- package/dist/nosql/upstash/index.d.ts +80 -0
- package/dist/nosql/vercel-kv/index.d.ts +82 -0
- package/dist/nosql/victoriametrics/index.d.ts +129 -0
- package/dist/nosql/virtuoso/index.d.ts +87 -0
- package/dist/nosql/weaviate/index.d.ts +196 -0
- package/dist/operators/index.d.ts +7 -0
- package/dist/operators.d.ts +2947 -0
- package/dist/operators.js +46 -1
- package/dist/prisma-migrate/index.d.ts +28 -0
- package/dist/prisma-migrate/migration-generator.d.ts +21 -0
- package/dist/prisma-migrate/model-generator.d.ts +12 -0
- package/dist/prisma-migrate/relations.d.ts +28 -0
- package/dist/prisma-migrate/schema-parser.d.ts +42 -0
- package/dist/prisma-migrate/type-mapper.d.ts +20 -0
- package/dist/prorm.d.ts +2093 -0
- package/dist/prorm.js +721 -302
- package/dist/query-builders/cte-builder.d.ts +104 -0
- package/dist/query-builders/functions/aggregate.d.ts +199 -0
- package/dist/query-builders/functions/conditional.d.ts +195 -0
- package/dist/query-builders/functions/datetime.d.ts +202 -0
- package/dist/query-builders/functions/fulltext.d.ts +220 -0
- package/dist/query-builders/functions/index.d.ts +17 -0
- package/dist/query-builders/functions/json.d.ts +157 -0
- package/dist/query-builders/functions/math.d.ts +215 -0
- package/dist/query-builders/functions/string.d.ts +233 -0
- package/dist/query-builders/functions/window.d.ts +209 -0
- package/dist/query-builders/include-builder.d.ts +85 -0
- package/dist/query-builders/index-expression-builder.d.ts +153 -0
- package/dist/query-builders/index.d.ts +121 -0
- package/dist/query-builders/index.js +10 -0
- package/dist/query-builders/insert-builder.d.ts +62 -0
- package/dist/query-builders/model-helpers.d.ts +28 -0
- package/dist/query-builders/order-limit-builder.d.ts +84 -0
- package/dist/query-builders/sql-compiler.d.ts +562 -0
- package/dist/query-builders/subquery-builder.d.ts +133 -0
- package/dist/query-builders/update-builder.d.ts +71 -0
- package/dist/query-builders/view-builder.d.ts +189 -0
- package/dist/query-builders/where-builder.d.ts +124 -0
- package/dist/query-interface.d.ts +407 -0
- package/dist/query-interface.js +84 -0
- package/dist/query-optimizers/batch-optimizer.d.ts +175 -0
- package/dist/query-optimizers/explain-plans.d.ts +187 -0
- package/dist/query-optimizers/index.d.ts +27 -0
- package/dist/query-optimizers/prepared-statement-cache.d.ts +252 -0
- package/dist/query-optimizers/query-hints.d.ts +201 -0
- package/dist/query-optimizers/query-optimizer.d.ts +162 -0
- package/dist/query-optimizers/slow-query-logger.d.ts +186 -0
- package/dist/replica-manager.d.ts +235 -0
- package/dist/schema/index.d.ts +7 -0
- package/dist/schema/migration-generator.d.ts +74 -0
- package/dist/schema/schema-differ.d.ts +114 -0
- package/dist/schema/types.d.ts +246 -0
- package/dist/schema-objects.d.ts +78 -0
- package/dist/schema-objects.js +203 -0
- package/dist/sql-constants.d.ts +240 -0
- package/dist/sqlite-advanced.d.ts +572 -0
- package/dist/streams/index.d.ts +5 -0
- package/dist/streams/transforms.d.ts +120 -0
- package/dist/transaction.d.ts +221 -0
- package/dist/types/index.d.ts +3123 -0
- package/dist/user-management.d.ts +141 -0
- package/dist/utils/date.d.ts +149 -0
- package/dist/utils/index.d.ts +359 -0
- package/dist/utils/string.d.ts +88 -0
- package/dist/validators/index.d.ts +7 -0
- package/dist/validators/validator.d.ts +306 -0
- package/package.json +20 -5
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TigerGraph store implementation.
|
|
3
|
+
*
|
|
4
|
+
* TigerGraph is a native graph database (vertices/edges/GSQL), not a SQL
|
|
5
|
+
* engine, so this class does not implement the SQL-shaped `Dialect`
|
|
6
|
+
* interface (see `src/dialects/dialect.ts`). It implements the minimal
|
|
7
|
+
* `NoSqlStore` marker interface (`src/nosql/store.ts`) and exposes
|
|
8
|
+
* TigerGraph's real capabilities directly: installed-query execution,
|
|
9
|
+
* vertex/edge upsert and retrieval, ad-hoc "interpreted" GSQL queries, and
|
|
10
|
+
* schema introspection.
|
|
11
|
+
*
|
|
12
|
+
* ## Why `fetch`, not a driver
|
|
13
|
+
*
|
|
14
|
+
* Unlike every sibling in `src/nosql/` (MongoDB -> `mongodb`, Redis ->
|
|
15
|
+
* `ioredis`, DynamoDB -> `@aws-sdk/*`), there is no official,
|
|
16
|
+
* actively-maintained Node.js/JavaScript SDK for TigerGraph on npm as of
|
|
17
|
+
* this writing. The only packages found (`tigergraph.js`, `tiger-graph`)
|
|
18
|
+
* are small, unmaintained community wrappers last published in 2022, not
|
|
19
|
+
* published or endorsed by TigerGraph Inc, and TigerGraph's own GitHub org
|
|
20
|
+
* ships `pyTigerGraph` (Python) but nothing for Node. TigerGraph *is*
|
|
21
|
+
* fully usable from Node, though: it's a plain HTTP/JSON REST API
|
|
22
|
+
* ("REST++", plus the GSQL server's own HTTP endpoints), so this store
|
|
23
|
+
* talks to it with Node's built-in global `fetch` (Node >=18, this repo's
|
|
24
|
+
* minimum engine) instead of adding a new npm dependency for a thin HTTP
|
|
25
|
+
* wrapper. This is a deliberate choice, not an oversight - see the
|
|
26
|
+
* package's README for the endpoint shapes this was verified against.
|
|
27
|
+
*
|
|
28
|
+
* `library` is reported as `'fetch'` (there is no driver name to report).
|
|
29
|
+
*/
|
|
30
|
+
/**
|
|
31
|
+
* Connection options for `TigerGraphStore`.
|
|
32
|
+
*
|
|
33
|
+
* TigerGraph traditionally splits traffic across two ports: the REST++
|
|
34
|
+
* data-plane API (vertex/edge CRUD, installed queries - historically port
|
|
35
|
+
* 9000) and the GSQL server (schema/DDL, ad-hoc "interpreted" queries -
|
|
36
|
+
* historically port 14240). TigerGraph 4.1+ unifies external traffic
|
|
37
|
+
* behind port 14240 with `/restpp/...` and `/gsql/...` path prefixes and
|
|
38
|
+
* makes 9000 internal-only; this store defaults to the classic two-port
|
|
39
|
+
* layout (confirmed against documented pre-4.1 REST++ endpoint shapes -
|
|
40
|
+
* see README) but every port/prefix is configurable so it can be pointed
|
|
41
|
+
* at a 4.1+ unified deployment too.
|
|
42
|
+
*/
|
|
43
|
+
export interface TigerGraphStoreOptions {
|
|
44
|
+
/** Protocol + hostname, e.g. `'http://localhost'` or `'https://my-cluster.i.tgcloud.io'`. No trailing slash, no port. */
|
|
45
|
+
host: string;
|
|
46
|
+
/** REST++ port (vertex/edge/query endpoints). Default `9000`. */
|
|
47
|
+
restPort?: number;
|
|
48
|
+
/** GSQL server port (interpreted queries, schema introspection). Default `14240`. */
|
|
49
|
+
gsqlPort?: number;
|
|
50
|
+
/** Path prefix in front of REST++ routes, e.g. `'/restpp'` on a 4.1+ unified deployment. Default `''`. */
|
|
51
|
+
restPathPrefix?: string;
|
|
52
|
+
/** Default graph name used when a call doesn't override it. */
|
|
53
|
+
graph: string;
|
|
54
|
+
/**
|
|
55
|
+
* GSQL secret used to mint a token via `POST /requesttoken`
|
|
56
|
+
* (see README - confirmed pre-4.1 shape). Provide this, or a pre-minted
|
|
57
|
+
* `token`, to authenticate REST++ (vertex/edge/query) calls.
|
|
58
|
+
*/
|
|
59
|
+
secret?: string;
|
|
60
|
+
/** A pre-minted REST++ auth token. Skips the `/requesttoken` round trip in `connect()`. */
|
|
61
|
+
token?: string;
|
|
62
|
+
/** Requested token lifetime in seconds, passed to `/requesttoken`. */
|
|
63
|
+
tokenLifetime?: number;
|
|
64
|
+
/**
|
|
65
|
+
* Username/password used for HTTP Basic auth against GSQL-server
|
|
66
|
+
* endpoints (interpreted queries, schema introspection). TigerGraph's
|
|
67
|
+
* documented example for the interpreted-query endpoint uses Basic
|
|
68
|
+
* auth rather than the REST++ bearer token; the same credentials are
|
|
69
|
+
* reused here for schema introspection since both are GSQL-server
|
|
70
|
+
* routes.
|
|
71
|
+
*/
|
|
72
|
+
username?: string;
|
|
73
|
+
password?: string;
|
|
74
|
+
/** Injectable fetch implementation, primarily for tests. Defaults to `globalThis.fetch`. */
|
|
75
|
+
fetch?: typeof fetch;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* TigerGraph's documented upsert wire format wraps every attribute value
|
|
79
|
+
* as `{"value": <actual value>}`, with an optional `op` accumulator code
|
|
80
|
+
* (e.g. `'+'`/`'max'`) for attributes backed by an accumulator. Confirmed
|
|
81
|
+
* against TigerGraph's REST++ upsert documentation (see README).
|
|
82
|
+
*/
|
|
83
|
+
export interface AttributeValue<T = unknown> {
|
|
84
|
+
value: T;
|
|
85
|
+
op?: string;
|
|
86
|
+
}
|
|
87
|
+
/** Plain (unwrapped) attribute values, as accepted by the convenience `upsertVertex`/`upsertEdge` helpers. */
|
|
88
|
+
export type PlainAttributes = Record<string, unknown>;
|
|
89
|
+
/** Already-wrapped attributes, as sent on the wire and returned by read endpoints. */
|
|
90
|
+
export type WireAttributes = Record<string, AttributeValue>;
|
|
91
|
+
/** Raw upsert payload matching TigerGraph's `POST /graph/{graph}` body shape exactly. */
|
|
92
|
+
export interface UpsertPayload {
|
|
93
|
+
vertices?: Record<string, Record<string, WireAttributes>>;
|
|
94
|
+
edges?: Record<string, Record<string, Record<string, Record<string, Record<string, WireAttributes>>>>>;
|
|
95
|
+
}
|
|
96
|
+
/** A single edge to upsert via `upsertEdges()`. */
|
|
97
|
+
export interface EdgeUpsert {
|
|
98
|
+
fromType: string;
|
|
99
|
+
fromId: string;
|
|
100
|
+
edgeType: string;
|
|
101
|
+
toType: string;
|
|
102
|
+
toId: string;
|
|
103
|
+
attributes?: PlainAttributes;
|
|
104
|
+
}
|
|
105
|
+
/** A vertex as returned by `GET /graph/{graph}/vertices/{type}/{id}` (confirmed shape). */
|
|
106
|
+
export interface TigerGraphVertex<T = Record<string, unknown>> {
|
|
107
|
+
v_id: string;
|
|
108
|
+
v_type: string;
|
|
109
|
+
attributes: T;
|
|
110
|
+
}
|
|
111
|
+
/** An edge as returned by `GET /graph/{graph}/edges/...` (confirmed shape). */
|
|
112
|
+
export interface TigerGraphEdge<T = Record<string, unknown>> {
|
|
113
|
+
e_type: string;
|
|
114
|
+
directed: boolean;
|
|
115
|
+
from_id: string;
|
|
116
|
+
from_type: string;
|
|
117
|
+
to_id: string;
|
|
118
|
+
to_type: string;
|
|
119
|
+
attributes: T;
|
|
120
|
+
}
|
|
121
|
+
/** One vertex type as returned by GSQL schema introspection. */
|
|
122
|
+
export interface VertexTypeSchema {
|
|
123
|
+
Name: string;
|
|
124
|
+
PrimaryId?: Record<string, unknown>;
|
|
125
|
+
Attributes?: {
|
|
126
|
+
AttributeName: string;
|
|
127
|
+
AttributeType?: Record<string, unknown>;
|
|
128
|
+
}[];
|
|
129
|
+
}
|
|
130
|
+
/** One edge type as returned by GSQL schema introspection. */
|
|
131
|
+
export interface EdgeTypeSchema {
|
|
132
|
+
Name: string;
|
|
133
|
+
FromVertexTypeName?: string;
|
|
134
|
+
ToVertexTypeName?: string;
|
|
135
|
+
IsDirected?: boolean;
|
|
136
|
+
Attributes?: {
|
|
137
|
+
AttributeName: string;
|
|
138
|
+
AttributeType?: Record<string, unknown>;
|
|
139
|
+
}[];
|
|
140
|
+
}
|
|
141
|
+
/** Options for `runInstalledQuery()`. */
|
|
142
|
+
export interface RunQueryOptions {
|
|
143
|
+
graph?: string;
|
|
144
|
+
/** `GET` (query-string params) or `POST` (JSON body). Default `'GET'`. */
|
|
145
|
+
method?: 'GET' | 'POST';
|
|
146
|
+
}
|
|
147
|
+
/** Options for `runInterpretedQuery()`. */
|
|
148
|
+
export interface InterpretedQueryOptions {
|
|
149
|
+
graph?: string;
|
|
150
|
+
/** GSQL query parameters, sent as URL query-string parameters per TigerGraph's documented example. */
|
|
151
|
+
params?: Record<string, string | number | boolean>;
|
|
152
|
+
}
|
|
153
|
+
/** Options for `listVerticesByType()`. */
|
|
154
|
+
export interface ListVerticesOptions {
|
|
155
|
+
graph?: string;
|
|
156
|
+
limit?: number;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* TigerGraph's standard REST++/GSQL response envelope. Confirmed
|
|
160
|
+
* consistent shape across the endpoints this store wraps: `error`/
|
|
161
|
+
* `message` (and `code` on failures) alongside the payload in `results`.
|
|
162
|
+
*/
|
|
163
|
+
interface TigerGraphEnvelope<T = unknown> {
|
|
164
|
+
version?: unknown;
|
|
165
|
+
error: boolean;
|
|
166
|
+
message?: string;
|
|
167
|
+
code?: string;
|
|
168
|
+
token?: string;
|
|
169
|
+
results?: T;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* `TigerGraphStore` wraps TigerGraph's REST++ and GSQL-server HTTP APIs
|
|
173
|
+
* behind a typed, promise-based interface: token-based auth, installed
|
|
174
|
+
* (pre-compiled GSQL) query execution, vertex/edge upsert and retrieval,
|
|
175
|
+
* ad-hoc interpreted queries, and vertex/edge-type schema introspection.
|
|
176
|
+
*/
|
|
177
|
+
export declare class TigerGraphStore {
|
|
178
|
+
readonly name = "tigergraph";
|
|
179
|
+
readonly library = "fetch";
|
|
180
|
+
private readonly options;
|
|
181
|
+
private readonly restBaseUrl;
|
|
182
|
+
private readonly gsqlBaseUrl;
|
|
183
|
+
private readonly restPathPrefix;
|
|
184
|
+
private token;
|
|
185
|
+
private connected;
|
|
186
|
+
constructor(options: TigerGraphStoreOptions);
|
|
187
|
+
connect(): Promise<void>;
|
|
188
|
+
disconnect(): Promise<void>;
|
|
189
|
+
isConnected(): boolean;
|
|
190
|
+
/**
|
|
191
|
+
* Returns a small facade over the underlying HTTP transport for
|
|
192
|
+
* operations not wrapped here - there is no native driver client to
|
|
193
|
+
* expose, since this store talks to TigerGraph over plain `fetch`.
|
|
194
|
+
*/
|
|
195
|
+
getClient(): {
|
|
196
|
+
token: string | null;
|
|
197
|
+
restBaseUrl: string;
|
|
198
|
+
gsqlBaseUrl: string;
|
|
199
|
+
restRequest: (path: string, init?: RequestInit) => Promise<TigerGraphEnvelope>;
|
|
200
|
+
gsqlRequest: (path: string, init?: RequestInit) => Promise<TigerGraphEnvelope>;
|
|
201
|
+
};
|
|
202
|
+
private requireConnected;
|
|
203
|
+
private getFetch;
|
|
204
|
+
/**
|
|
205
|
+
* `POST /requesttoken` - exchange a GSQL secret for a REST++ bearer
|
|
206
|
+
* token. Confirmed request/response shape (pre-4.1 REST++; TigerGraph
|
|
207
|
+
* 4.1+ additionally offers `POST /gsql/v1/tokens` on the unified GSQL
|
|
208
|
+
* port, whose exact request/response shape was not independently
|
|
209
|
+
* confirmed while building this store - see README "Known
|
|
210
|
+
* limitations").
|
|
211
|
+
*/
|
|
212
|
+
private requestToken;
|
|
213
|
+
private parseEnvelope;
|
|
214
|
+
private authHeaders;
|
|
215
|
+
private basicAuthHeaders;
|
|
216
|
+
/** Issue a request against the REST++ API (vertex/edge/query endpoints), with bearer-token auth. */
|
|
217
|
+
private restRequest;
|
|
218
|
+
/** Issue a request against the GSQL server (interpreted queries, schema), with Basic auth. */
|
|
219
|
+
private gsqlRequest;
|
|
220
|
+
/**
|
|
221
|
+
* Run an installed GSQL query: `GET /query/{graph}/{queryName}?param=value`
|
|
222
|
+
* (simple/scalar params) or `POST /query/{graph}/{queryName}` with a JSON
|
|
223
|
+
* body (complex params, e.g. sets/vertex lists). Confirmed endpoint
|
|
224
|
+
* shape and response envelope (`{version, error, message, results}`).
|
|
225
|
+
*/
|
|
226
|
+
runInstalledQuery<T = unknown>(queryName: string, params?: Record<string, string | number | boolean>, options?: RunQueryOptions): Promise<T>;
|
|
227
|
+
/**
|
|
228
|
+
* `POST /graph/{graph}` - raw upsert matching TigerGraph's documented
|
|
229
|
+
* wire format exactly (attribute values pre-wrapped as `{value: x}`).
|
|
230
|
+
* Prefer `upsertVertex`/`upsertVertices`/`upsertEdge`/`upsertEdges` for
|
|
231
|
+
* the common case of plain attribute values.
|
|
232
|
+
*/
|
|
233
|
+
upsert(payload: UpsertPayload, graph?: string): Promise<{
|
|
234
|
+
accepted_vertices: number;
|
|
235
|
+
accepted_edges: number;
|
|
236
|
+
}>;
|
|
237
|
+
/** Upsert a single vertex with plain (unwrapped) attribute values. */
|
|
238
|
+
upsertVertex(vertexType: string, id: string, attributes?: PlainAttributes, graph?: string): Promise<{
|
|
239
|
+
accepted_vertices: number;
|
|
240
|
+
accepted_edges: number;
|
|
241
|
+
}>;
|
|
242
|
+
/** Upsert multiple vertices of the same type in one round trip. */
|
|
243
|
+
upsertVertices(vertexType: string, vertices: Record<string, PlainAttributes>, graph?: string): Promise<{
|
|
244
|
+
accepted_vertices: number;
|
|
245
|
+
accepted_edges: number;
|
|
246
|
+
}>;
|
|
247
|
+
/** Upsert a single edge with plain (unwrapped) attribute values. */
|
|
248
|
+
upsertEdge(fromType: string, fromId: string, edgeType: string, toType: string, toId: string, attributes?: PlainAttributes, graph?: string): Promise<{
|
|
249
|
+
accepted_vertices: number;
|
|
250
|
+
accepted_edges: number;
|
|
251
|
+
}>;
|
|
252
|
+
/** Upsert multiple edges (possibly spanning different types/vertices) in one round trip. */
|
|
253
|
+
upsertEdges(edges: EdgeUpsert[], graph?: string): Promise<{
|
|
254
|
+
accepted_vertices: number;
|
|
255
|
+
accepted_edges: number;
|
|
256
|
+
}>;
|
|
257
|
+
/**
|
|
258
|
+
* `GET /graph/{graph}/vertices/{type}/{id}` - fetch a single vertex by
|
|
259
|
+
* ID. Confirmed endpoint/response shape. Returns `null` if the vertex
|
|
260
|
+
* does not exist (TigerGraph reports this as `error: true` with a
|
|
261
|
+
* "does not exist" message rather than an empty result set).
|
|
262
|
+
*/
|
|
263
|
+
getVertex<T = Record<string, unknown>>(vertexType: string, id: string, graph?: string): Promise<TigerGraphVertex<T> | null>;
|
|
264
|
+
/**
|
|
265
|
+
* `GET /graph/{graph}/vertices/{type}` - list vertices of a type
|
|
266
|
+
* (omitting the ID segment of the single-vertex endpoint above).
|
|
267
|
+
* TigerGraph's built-in-endpoints documentation confirms the
|
|
268
|
+
* single-vertex form; the list form (same resource without an ID, plus
|
|
269
|
+
* an optional `limit` query parameter) follows the standard REST++
|
|
270
|
+
* collection-resource pattern but its full parameter set (`filter`,
|
|
271
|
+
* `select`, `sort`, etc.) was not independently re-verified while
|
|
272
|
+
* building this store - only `limit` is wired up here (see README).
|
|
273
|
+
*/
|
|
274
|
+
listVerticesByType<T = Record<string, unknown>>(vertexType: string, options?: ListVerticesOptions): Promise<TigerGraphVertex<T>[]>;
|
|
275
|
+
/** `DELETE /graph/{graph}/vertices/{type}/{id}` - delete a single vertex (and its incident edges). Returns the number of vertices deleted (`0` or `1`). */
|
|
276
|
+
deleteVertex(vertexType: string, id: string, graph?: string): Promise<number>;
|
|
277
|
+
/**
|
|
278
|
+
* `GET /graph/{graph}/edges/{fromType}/{fromId}/{edgeType}/{toType}/{toId}`
|
|
279
|
+
* - fetch the edge(s) between two specific vertices. Confirmed
|
|
280
|
+
* endpoint/response shape. Returns an empty array if no such edge
|
|
281
|
+
* exists.
|
|
282
|
+
*/
|
|
283
|
+
getEdge<T = Record<string, unknown>>(fromType: string, fromId: string, edgeType: string, toType: string, toId: string, graph?: string): Promise<TigerGraphEdge<T>[]>;
|
|
284
|
+
/**
|
|
285
|
+
* `GET /graph/{graph}/edges/{fromType}/{fromId}[/{edgeType}]` - list all
|
|
286
|
+
* edges (of the given type, if provided) originating from a vertex.
|
|
287
|
+
* Same confidence note as `getEdge()`'s partial-path collection form.
|
|
288
|
+
*/
|
|
289
|
+
listEdgesFrom<T = Record<string, unknown>>(fromType: string, fromId: string, edgeType?: string, graph?: string): Promise<TigerGraphEdge<T>[]>;
|
|
290
|
+
/** `DELETE /graph/{graph}/edges/{fromType}/{fromId}/{edgeType}/{toType}/{toId}` - delete a single edge. Returns the number of edges deleted. */
|
|
291
|
+
deleteEdge(fromType: string, fromId: string, edgeType: string, toType: string, toId: string, graph?: string): Promise<number>;
|
|
292
|
+
/**
|
|
293
|
+
* `POST /gsql/v1/queries/interpret` - compile and run a GSQL query
|
|
294
|
+
* string on the fly, without installing it first. Confirmed endpoint,
|
|
295
|
+
* auth (HTTP Basic, not the REST++ bearer token), and request shape:
|
|
296
|
+
* the request body is the raw GSQL text (`Content-Type: text/plain`),
|
|
297
|
+
* and GSQL query parameters are passed as URL query-string parameters.
|
|
298
|
+
*
|
|
299
|
+
* The older path `/gsqlserver/interpreted_query` (used by some
|
|
300
|
+
* pre-4.x deployments) is documented only in community sources, not in
|
|
301
|
+
* TigerGraph's current official docs, and its exact request shape was
|
|
302
|
+
* not independently confirmed - this store intentionally does not
|
|
303
|
+
* implement that alias rather than guess at its shape. If you're on a
|
|
304
|
+
* version that needs it, issue the request yourself via
|
|
305
|
+
* `getClient().restRequest()`/`gsqlRequest()` (or plain `fetch`) once
|
|
306
|
+
* you've confirmed the shape against your deployment.
|
|
307
|
+
*/
|
|
308
|
+
runInterpretedQuery<T = unknown>(gsql: string, options?: InterpretedQueryOptions): Promise<T>;
|
|
309
|
+
/** `GET /gsql/v1/schema/vertices?graph={graph}` - list the graph's vertex types. Confirmed endpoint/response shape. */
|
|
310
|
+
listVertexTypes(graph?: string): Promise<VertexTypeSchema[]>;
|
|
311
|
+
/** `GET /gsql/v1/schema/edges?graph={graph}` - list the graph's edge types. Confirmed endpoint/response shape. */
|
|
312
|
+
listEdgeTypes(graph?: string): Promise<EdgeTypeSchema[]>;
|
|
313
|
+
}
|
|
314
|
+
export default TigerGraphStore;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typesense store implementation.
|
|
3
|
+
*
|
|
4
|
+
* Typesense is a typo-tolerant search engine built around an inverted index
|
|
5
|
+
* with faceting, filtering and ranking rather than SQL: no `JOIN`, no
|
|
6
|
+
* transaction log, documents grouped into strongly-typed collections (each
|
|
7
|
+
* described by a schema of fields). It therefore does not fit the SQL-shaped
|
|
8
|
+
* `Dialect` interface used by the SQL dialects in this repo. Instead it
|
|
9
|
+
* implements the minimal `NoSqlStore` marker interface (`src/nosql/store.ts`)
|
|
10
|
+
* and exposes Typesense's real capabilities grouped by concern: connection
|
|
11
|
+
* lifecycle, collection management and document CRUD/search.
|
|
12
|
+
*
|
|
13
|
+
* Uses the official `typesense` JS driver. The driver is loaded lazily via
|
|
14
|
+
* `require` so importing this module does not force the dependency to be
|
|
15
|
+
* resolved unless a Typesense store is actually constructed. For unit-testing
|
|
16
|
+
* without a live server, the constructor also accepts an already-built
|
|
17
|
+
* `client`, which `connect()` will use as-is instead of instantiating a new
|
|
18
|
+
* one.
|
|
19
|
+
*
|
|
20
|
+
* Operations are reached through the driver's fluent, resource-scoped API:
|
|
21
|
+
* `client.collections()` / `client.collections(name)` for collections and
|
|
22
|
+
* `client.collections(name).documents()` / `.documents(id)` for documents.
|
|
23
|
+
*/
|
|
24
|
+
import { NoSqlStore } from '../store';
|
|
25
|
+
/** A single Typesense node's connection details. */
|
|
26
|
+
export interface TypesenseNode {
|
|
27
|
+
host: string;
|
|
28
|
+
port: number;
|
|
29
|
+
protocol: string;
|
|
30
|
+
[key: string]: unknown;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Connection options for `TypesenseStore`.
|
|
34
|
+
*
|
|
35
|
+
* `nodes` and `apiKey` are passed straight through to the driver's
|
|
36
|
+
* `new Typesense.Client(...)`. Pass `client` to inject an already-built client
|
|
37
|
+
* instance (used in tests and when the caller wants full control over driver
|
|
38
|
+
* configuration); when present, `nodes`/`apiKey` are ignored.
|
|
39
|
+
*/
|
|
40
|
+
export interface TypesenseStoreOptions {
|
|
41
|
+
/** One or more Typesense nodes to connect to. */
|
|
42
|
+
nodes?: TypesenseNode[];
|
|
43
|
+
/** API key used to authenticate against the server. */
|
|
44
|
+
apiKey?: string;
|
|
45
|
+
/** An already-constructed Typesense client to use instead of building one. */
|
|
46
|
+
client?: any;
|
|
47
|
+
/** Any additional options passed through to the driver's client. */
|
|
48
|
+
[key: string]: unknown;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* `TypesenseStore` wraps the official `typesense` client and exposes
|
|
52
|
+
* collection management, document CRUD, and search as a typed, promise-based
|
|
53
|
+
* API.
|
|
54
|
+
*/
|
|
55
|
+
export declare class TypesenseStore implements NoSqlStore {
|
|
56
|
+
readonly name = "typesense";
|
|
57
|
+
readonly library = "typesense";
|
|
58
|
+
private readonly options;
|
|
59
|
+
private client;
|
|
60
|
+
private connected;
|
|
61
|
+
constructor(options: TypesenseStoreOptions);
|
|
62
|
+
connect(): Promise<void>;
|
|
63
|
+
disconnect(): Promise<void>;
|
|
64
|
+
isConnected(): boolean;
|
|
65
|
+
/** Returns the underlying `typesense` client for anything not wrapped here. */
|
|
66
|
+
getClient(): any;
|
|
67
|
+
private requireClient;
|
|
68
|
+
private exec;
|
|
69
|
+
/** Create a collection from a schema (`{ name, fields, default_sorting_field? }`). */
|
|
70
|
+
createCollection(schema: Record<string, unknown>): Promise<any>;
|
|
71
|
+
/** Delete a collection by name. */
|
|
72
|
+
deleteCollection(name: string): Promise<any>;
|
|
73
|
+
/** Index (create) a single document in a collection. */
|
|
74
|
+
indexDocument(collection: string, document: Record<string, unknown>): Promise<any>;
|
|
75
|
+
/** Run a search against a collection's documents. */
|
|
76
|
+
search<T = Record<string, unknown>>(collection: string, params: Record<string, unknown>): Promise<T>;
|
|
77
|
+
/** Retrieve a single document by its `id`. */
|
|
78
|
+
getDocument<T = Record<string, unknown>>(collection: string, id: string): Promise<T>;
|
|
79
|
+
/** Delete a single document by its `id`. */
|
|
80
|
+
deleteDocument(collection: string, id: string): Promise<any>;
|
|
81
|
+
}
|
|
82
|
+
export default TypesenseStore;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { NoSqlStore } from '../store';
|
|
2
|
+
/** A single entry in a `batch()` write: a `put` (with value) or a `del`. */
|
|
3
|
+
export type UnqliteBatchOp = {
|
|
4
|
+
type: 'put';
|
|
5
|
+
key: string;
|
|
6
|
+
value: unknown;
|
|
7
|
+
} | {
|
|
8
|
+
type: 'del';
|
|
9
|
+
key: string;
|
|
10
|
+
};
|
|
11
|
+
type NodeCallback<T> = (err: unknown, result?: T) => void;
|
|
12
|
+
/**
|
|
13
|
+
* Minimal structural type for the pieces of an `unqlite` client this store
|
|
14
|
+
* uses. Kept local (rather than importing from `unqlite`) so this module
|
|
15
|
+
* type-checks without the optional driver installed.
|
|
16
|
+
*/
|
|
17
|
+
export interface UnqliteClientLike {
|
|
18
|
+
store(key: string, value: unknown, cb: NodeCallback<void>): void;
|
|
19
|
+
fetch(key: string, cb: NodeCallback<unknown>): void;
|
|
20
|
+
delete(key: string, cb: NodeCallback<void>): void;
|
|
21
|
+
each(iterator: (key: unknown, value: unknown) => void, done: NodeCallback<void>): void;
|
|
22
|
+
close?(cb: NodeCallback<void>): void;
|
|
23
|
+
}
|
|
24
|
+
/** Connection options for `UnqliteStore`. */
|
|
25
|
+
export interface UnqliteStoreOptions {
|
|
26
|
+
/** Filesystem path for the UnQLite database file. Defaults to `'./data/unqlite.db'`. */
|
|
27
|
+
path?: string;
|
|
28
|
+
/**
|
|
29
|
+
* A pre-built `unqlite` client (or a compatible mock). When provided,
|
|
30
|
+
* `connect()` uses it directly and skips `require('unqlite')` entirely —
|
|
31
|
+
* this is how tests inject a mock without the real driver installed.
|
|
32
|
+
*/
|
|
33
|
+
client?: UnqliteClientLike;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* `UnqliteStore` wraps an `unqlite` client and exposes its embedded KV
|
|
37
|
+
* surface: `put`/`get`/`del` (mapped to `store`/`fetch`/`delete`), `batch` for
|
|
38
|
+
* multi-key writes, and `list` for key iteration.
|
|
39
|
+
*/
|
|
40
|
+
export declare class UnqliteStore implements NoSqlStore {
|
|
41
|
+
readonly name = "unqlite";
|
|
42
|
+
readonly library = "unqlite";
|
|
43
|
+
private readonly options;
|
|
44
|
+
private readonly path;
|
|
45
|
+
private client;
|
|
46
|
+
private connected;
|
|
47
|
+
constructor(options?: UnqliteStoreOptions);
|
|
48
|
+
connect(): Promise<void>;
|
|
49
|
+
disconnect(): Promise<void>;
|
|
50
|
+
isConnected(): boolean;
|
|
51
|
+
/** Returns the underlying `unqlite` client for anything not wrapped here. */
|
|
52
|
+
getClient(): UnqliteClientLike;
|
|
53
|
+
private requireClient;
|
|
54
|
+
private wrapError;
|
|
55
|
+
/** Wrap a callback-style UnQLite call into a Promise. */
|
|
56
|
+
private promisify;
|
|
57
|
+
/** Writes (or overwrites) the value at `key` (UnQLite `store`). */
|
|
58
|
+
put(key: string, value: unknown): Promise<void>;
|
|
59
|
+
/** Reads the value at `key` (UnQLite `fetch`). */
|
|
60
|
+
get(key: string): Promise<unknown>;
|
|
61
|
+
/** Deletes the value at `key` (UnQLite `delete`). */
|
|
62
|
+
del(key: string): Promise<void>;
|
|
63
|
+
/** Applies a list of `put`/`del` operations sequentially. */
|
|
64
|
+
batch(ops: UnqliteBatchOp[]): Promise<void>;
|
|
65
|
+
/** Lists all keys by iterating records with UnQLite's `each` cursor. */
|
|
66
|
+
list(): Promise<string[]>;
|
|
67
|
+
}
|
|
68
|
+
export default UnqliteStore;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Upstash Redis store implementation.
|
|
3
|
+
*
|
|
4
|
+
* Upstash Redis is a serverless, globally-replicated Redis served over an
|
|
5
|
+
* HTTP/REST connection via the `@upstash/redis` client. It has no SQL query
|
|
6
|
+
* surface, so this class implements the minimal `NoSqlStore` marker
|
|
7
|
+
* interface and exposes an edge-KV `get`/`set`/`del`/`list`/`incr` surface
|
|
8
|
+
* mapped onto the `@upstash/redis` client.
|
|
9
|
+
*
|
|
10
|
+
* ## Driver
|
|
11
|
+
*
|
|
12
|
+
* Uses `@upstash/redis` (`new Redis({ url, token })`). The driver is loaded
|
|
13
|
+
* lazily inside `connect()` (or supplied pre-built via the `client` option)
|
|
14
|
+
* so importing this module never requires `@upstash/redis` to be installed
|
|
15
|
+
* unless a store is actually connected. Tests inject a mock `client`.
|
|
16
|
+
*
|
|
17
|
+
* ## Serialization
|
|
18
|
+
*
|
|
19
|
+
* String values are passed through verbatim; every other value is
|
|
20
|
+
* `JSON.stringify`'d before being written.
|
|
21
|
+
*/
|
|
22
|
+
import { NoSqlStore } from '../store';
|
|
23
|
+
/** Options for `set()`. */
|
|
24
|
+
export interface UpstashSetOptions {
|
|
25
|
+
/** Expire after this many seconds (Redis `EX`). */
|
|
26
|
+
ttl?: number;
|
|
27
|
+
/** Absolute expiration as a Unix timestamp in seconds (Redis `EXAT`). */
|
|
28
|
+
expiration?: number;
|
|
29
|
+
}
|
|
30
|
+
/** The subset of the `@upstash/redis` client surface this store drives. */
|
|
31
|
+
export interface UpstashRedisClient {
|
|
32
|
+
get(key: string): Promise<any>;
|
|
33
|
+
set(key: string, value: unknown, options?: Record<string, unknown>): Promise<any>;
|
|
34
|
+
del(...keys: string[]): Promise<number>;
|
|
35
|
+
keys(pattern: string): Promise<string[]>;
|
|
36
|
+
incr(key: string): Promise<number>;
|
|
37
|
+
incrby(key: string, amount: number): Promise<number>;
|
|
38
|
+
}
|
|
39
|
+
/** Connection options for `UpstashStore`. */
|
|
40
|
+
export interface UpstashStoreOptions {
|
|
41
|
+
/** REST URL of the Upstash Redis database. */
|
|
42
|
+
url?: string;
|
|
43
|
+
/** REST API token. */
|
|
44
|
+
token?: string;
|
|
45
|
+
/** Pre-built `@upstash/redis` client; when given `connect()` uses it and skips `require('@upstash/redis')`. */
|
|
46
|
+
client?: UpstashRedisClient;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* `UpstashStore` wraps an `@upstash/redis` client behind the `NoSqlStore`
|
|
50
|
+
* lifecycle and an edge-KV `get`/`set`/`del`/`list`/`incr` surface.
|
|
51
|
+
*/
|
|
52
|
+
export declare class UpstashStore implements NoSqlStore {
|
|
53
|
+
readonly name = "upstash";
|
|
54
|
+
readonly library = "@upstash/redis";
|
|
55
|
+
private readonly options;
|
|
56
|
+
private client;
|
|
57
|
+
private connected;
|
|
58
|
+
constructor(options?: UpstashStoreOptions);
|
|
59
|
+
connect(): Promise<void>;
|
|
60
|
+
disconnect(): Promise<void>;
|
|
61
|
+
isConnected(): boolean;
|
|
62
|
+
/** Returns the underlying `@upstash/redis` client for anything not wrapped here. */
|
|
63
|
+
getClient(): UpstashRedisClient;
|
|
64
|
+
private requireClient;
|
|
65
|
+
/** Read a key. Returns whatever the client returns (`null` if missing). */
|
|
66
|
+
get(key: string): Promise<any>;
|
|
67
|
+
/**
|
|
68
|
+
* Write `value` under `key`. Strings are stored verbatim; other values are
|
|
69
|
+
* JSON-serialized. `options.ttl` maps to Redis `EX` (seconds),
|
|
70
|
+
* `options.expiration` to `EXAT` (absolute Unix seconds).
|
|
71
|
+
*/
|
|
72
|
+
set(key: string, value: unknown, options?: UpstashSetOptions): Promise<any>;
|
|
73
|
+
/** Delete a key. Returns the number of keys removed. */
|
|
74
|
+
del(key: string): Promise<number>;
|
|
75
|
+
/** List key names, optionally filtered by `prefix` (matched as `<prefix>*`). */
|
|
76
|
+
list(prefix?: string): Promise<string[]>;
|
|
77
|
+
/** Atomically increment the numeric value at `key` by `by` (default `1`). */
|
|
78
|
+
incr(key: string, by?: number): Promise<number>;
|
|
79
|
+
}
|
|
80
|
+
export default UpstashStore;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vercel KV store implementation.
|
|
3
|
+
*
|
|
4
|
+
* Vercel KV is a serverless, globally-replicated Redis-compatible key-value
|
|
5
|
+
* store fronted by the `@vercel/kv` client (a durable-HTTP Redis client). It
|
|
6
|
+
* has no SQL query surface, so this class implements the minimal
|
|
7
|
+
* `NoSqlStore` marker interface and exposes an edge-KV
|
|
8
|
+
* `get`/`set`/`del`/`list`/`incr` surface mapped onto the `@vercel/kv`
|
|
9
|
+
* client.
|
|
10
|
+
*
|
|
11
|
+
* ## Driver
|
|
12
|
+
*
|
|
13
|
+
* Uses `@vercel/kv` (`createClient({ url, token })`). The driver is loaded
|
|
14
|
+
* lazily inside `connect()` (or supplied pre-built via the `client` option)
|
|
15
|
+
* so importing this module never requires `@vercel/kv` to be installed
|
|
16
|
+
* unless a store is actually connected. Tests inject a mock `client`.
|
|
17
|
+
*
|
|
18
|
+
* ## Serialization
|
|
19
|
+
*
|
|
20
|
+
* String values are passed through verbatim; every other value is
|
|
21
|
+
* `JSON.stringify`'d before being written, so reads via `get()` return the
|
|
22
|
+
* serialized string.
|
|
23
|
+
*/
|
|
24
|
+
import { NoSqlStore } from '../store';
|
|
25
|
+
/** Options for `set()`. */
|
|
26
|
+
export interface VercelKvSetOptions {
|
|
27
|
+
/** Expire after this many seconds (Redis `EX`). */
|
|
28
|
+
ttl?: number;
|
|
29
|
+
/** Absolute expiration as a Unix timestamp in seconds (Redis `EXAT`). */
|
|
30
|
+
expiration?: number;
|
|
31
|
+
}
|
|
32
|
+
/** The subset of the `@vercel/kv` client surface this store drives. */
|
|
33
|
+
export interface VercelKvClient {
|
|
34
|
+
get(key: string): Promise<any>;
|
|
35
|
+
set(key: string, value: unknown, options?: Record<string, unknown>): Promise<any>;
|
|
36
|
+
del(...keys: string[]): Promise<number>;
|
|
37
|
+
keys(pattern: string): Promise<string[]>;
|
|
38
|
+
incr(key: string): Promise<number>;
|
|
39
|
+
incrby(key: string, amount: number): Promise<number>;
|
|
40
|
+
}
|
|
41
|
+
/** Connection options for `VercelKvStore`. */
|
|
42
|
+
export interface VercelKvStoreOptions {
|
|
43
|
+
/** REST URL of the KV database (`KV_REST_API_URL`). */
|
|
44
|
+
url?: string;
|
|
45
|
+
/** REST API token (`KV_REST_API_TOKEN`). */
|
|
46
|
+
token?: string;
|
|
47
|
+
/** Pre-built `@vercel/kv` client; when given `connect()` uses it and skips `require('@vercel/kv')`. */
|
|
48
|
+
client?: VercelKvClient;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* `VercelKvStore` wraps a `@vercel/kv` client behind the `NoSqlStore`
|
|
52
|
+
* lifecycle and an edge-KV `get`/`set`/`del`/`list`/`incr` surface.
|
|
53
|
+
*/
|
|
54
|
+
export declare class VercelKvStore implements NoSqlStore {
|
|
55
|
+
readonly name = "vercel-kv";
|
|
56
|
+
readonly library = "@vercel/kv";
|
|
57
|
+
private readonly options;
|
|
58
|
+
private client;
|
|
59
|
+
private connected;
|
|
60
|
+
constructor(options?: VercelKvStoreOptions);
|
|
61
|
+
connect(): Promise<void>;
|
|
62
|
+
disconnect(): Promise<void>;
|
|
63
|
+
isConnected(): boolean;
|
|
64
|
+
/** Returns the underlying `@vercel/kv` client for anything not wrapped here. */
|
|
65
|
+
getClient(): VercelKvClient;
|
|
66
|
+
private requireClient;
|
|
67
|
+
/** Read a key. Returns whatever the client returns (`null` if missing). */
|
|
68
|
+
get(key: string): Promise<any>;
|
|
69
|
+
/**
|
|
70
|
+
* Write `value` under `key`. Strings are stored verbatim; other values are
|
|
71
|
+
* JSON-serialized. `options.ttl` maps to Redis `EX` (seconds),
|
|
72
|
+
* `options.expiration` to `EXAT` (absolute Unix seconds).
|
|
73
|
+
*/
|
|
74
|
+
set(key: string, value: unknown, options?: VercelKvSetOptions): Promise<any>;
|
|
75
|
+
/** Delete a key. Returns the number of keys removed. */
|
|
76
|
+
del(key: string): Promise<number>;
|
|
77
|
+
/** List key names, optionally filtered by `prefix` (matched as `<prefix>*`). */
|
|
78
|
+
list(prefix?: string): Promise<string[]>;
|
|
79
|
+
/** Atomically increment the numeric value at `key` by `by` (default `1`). */
|
|
80
|
+
incr(key: string, by?: number): Promise<number>;
|
|
81
|
+
}
|
|
82
|
+
export default VercelKvStore;
|