ts-prorm-orm 1.1.0 → 1.2.1
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 +95 -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 +713 -0
- package/dist/index.js +36 -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,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gearman job-server store.
|
|
3
|
+
*
|
|
4
|
+
* Gearman is a generic application framework for farming out work: a *client*
|
|
5
|
+
* submits a job for a named function, the Gearman *job server* routes it to a
|
|
6
|
+
* *worker* that has registered a handler for that function, and the result
|
|
7
|
+
* flows back. It is not a database and does not fit the SQL-shaped `Dialect`
|
|
8
|
+
* interface, so this class implements the minimal `NoSqlStore` marker
|
|
9
|
+
* interface and exposes Gearman's real submit/register operations instead.
|
|
10
|
+
*
|
|
11
|
+
* Uses the `gearman` driver. It is an optional peer loaded lazily (via
|
|
12
|
+
* `require`) inside `connect()`, so importing this module does not require it
|
|
13
|
+
* to be installed unless you actually connect. A pre-built client can be
|
|
14
|
+
* injected via `GearmanStoreOptions.client`, in which case `connect()` adopts
|
|
15
|
+
* it and skips the `require` entirely (used by the unit tests to inject a
|
|
16
|
+
* mock).
|
|
17
|
+
*/
|
|
18
|
+
import type { NoSqlStore } from '../store';
|
|
19
|
+
/** Connection options for `GearmanStore`. */
|
|
20
|
+
export interface GearmanStoreOptions {
|
|
21
|
+
/** Gearman job-server host. Defaults to `'127.0.0.1'`. */
|
|
22
|
+
host?: string;
|
|
23
|
+
/** Gearman job-server port. Defaults to `4730`. */
|
|
24
|
+
port?: number;
|
|
25
|
+
/**
|
|
26
|
+
* A pre-built `gearman` client. When provided, `connect()` adopts it and
|
|
27
|
+
* does not `require('gearman')` — used for injecting a mock in tests.
|
|
28
|
+
*/
|
|
29
|
+
client?: any;
|
|
30
|
+
}
|
|
31
|
+
/** Options for `enqueue()` (submitting a job). */
|
|
32
|
+
export interface GearmanSubmitOptions {
|
|
33
|
+
/** Submit as a background job (fire-and-forget, no result callback). */
|
|
34
|
+
background?: boolean;
|
|
35
|
+
/** Job priority: `'high'`, `'normal'` (default), or `'low'`. */
|
|
36
|
+
priority?: 'high' | 'normal' | 'low';
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* `GearmanStore` wraps a single `gearman` client and exposes the common queue
|
|
40
|
+
* surface over Gearman functions: `enqueue()` submits a job, `process()`
|
|
41
|
+
* registers a worker handler, and job status/removal/stats route to the
|
|
42
|
+
* driver's corresponding calls.
|
|
43
|
+
*/
|
|
44
|
+
export declare class GearmanStore implements NoSqlStore {
|
|
45
|
+
readonly name = "gearman";
|
|
46
|
+
readonly library = "gearman";
|
|
47
|
+
private readonly options;
|
|
48
|
+
private client;
|
|
49
|
+
private connected;
|
|
50
|
+
constructor(options?: GearmanStoreOptions);
|
|
51
|
+
connect(): Promise<void>;
|
|
52
|
+
disconnect(): Promise<void>;
|
|
53
|
+
isConnected(): boolean;
|
|
54
|
+
/** Returns the underlying `gearman` client for operations not wrapped here. */
|
|
55
|
+
getClient(): any;
|
|
56
|
+
private requireClient;
|
|
57
|
+
private exec;
|
|
58
|
+
/**
|
|
59
|
+
* Submit a job for the named function (`queue`). The payload is
|
|
60
|
+
* JSON-serialized (strings pass through). Returns the job handle/id the
|
|
61
|
+
* server assigns (`job.handle` if the driver returns a job object).
|
|
62
|
+
*/
|
|
63
|
+
enqueue(queue: string, jobData: unknown, opts?: GearmanSubmitOptions): Promise<string>;
|
|
64
|
+
/**
|
|
65
|
+
* Register a worker handler for the named function (`queue`). The driver
|
|
66
|
+
* invokes `handler(job)` for each dispatched task. Falls back to
|
|
67
|
+
* `addFunction()` when the driver has no `registerWorker()`.
|
|
68
|
+
*/
|
|
69
|
+
process(queue: string, handler: (job: any) => void | Promise<void>): Promise<void>;
|
|
70
|
+
/** Query the status of a submitted job by its handle/id. */
|
|
71
|
+
getJob(_queue: string, id: string): Promise<any>;
|
|
72
|
+
/** Cancel/forget a submitted job by its handle/id. */
|
|
73
|
+
remove(_queue: string, id: string): Promise<any>;
|
|
74
|
+
/** Return job-server status (registered functions, queued/running counts). */
|
|
75
|
+
stats(_queue?: string): Promise<any>;
|
|
76
|
+
}
|
|
77
|
+
export default GearmanStore;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Apache Geode store implementation.
|
|
3
|
+
*
|
|
4
|
+
* Apache Geode (the engine behind Pivotal/VMware GemFire) is a distributed
|
|
5
|
+
* in-memory data grid. Data lives in named *regions* (its distributed maps).
|
|
6
|
+
* There is no SQL-shaped `query(sql)` surface for key/value access, so this
|
|
7
|
+
* class implements the minimal `NoSqlStore` marker interface and exposes
|
|
8
|
+
* Geode's region operations (getMap/put/get/remove/keys/size) as a typed,
|
|
9
|
+
* promise-based API.
|
|
10
|
+
*
|
|
11
|
+
* ## Transport: the Geode Developer REST API over `fetch`
|
|
12
|
+
*
|
|
13
|
+
* Geode has no canonical Node.js driver; it ships a language-neutral
|
|
14
|
+
* "Developer REST API". This store talks to it with the global `fetch`
|
|
15
|
+
* (exactly like `PrometheusStore`), so `library` is `'fetch'`. For tests
|
|
16
|
+
* (and callers who want their own transport) an alternative client can be
|
|
17
|
+
* injected via `GeodeStoreOptions.client`; when omitted a tiny internal
|
|
18
|
+
* `fetch` client is built at connect time.
|
|
19
|
+
*
|
|
20
|
+
* Endpoints wrapped (all under `/geode/v1`):
|
|
21
|
+
* - `mapPut` -> `PUT /geode/v1/<region>/<key>`
|
|
22
|
+
* - `mapGet` -> `GET /geode/v1/<region>/<key>`
|
|
23
|
+
* - `mapRemove` -> `DELETE /geode/v1/<region>/<key>`
|
|
24
|
+
* - `mapKeys` -> `GET /geode/v1/<region>/keys`
|
|
25
|
+
* - `mapSize` -> derived from `mapKeys` (the Developer REST API exposes no
|
|
26
|
+
* direct size endpoint)
|
|
27
|
+
*/
|
|
28
|
+
import { NoSqlStore } from '../store';
|
|
29
|
+
/** Default Geode Developer REST API base URL. */
|
|
30
|
+
export declare const DEFAULT_GEODE_BASE_URL = "http://localhost:8080";
|
|
31
|
+
/**
|
|
32
|
+
* The subset of an HTTP client this store needs. The internal `fetch`-based
|
|
33
|
+
* client implements this; tests inject a mock with the same shape.
|
|
34
|
+
*/
|
|
35
|
+
export interface GeodeHttpClient {
|
|
36
|
+
/** GET `path`; return the parsed body, or `null` on 404. */
|
|
37
|
+
get(path: string): Promise<any>;
|
|
38
|
+
/** PUT `body` to `path`. */
|
|
39
|
+
put(path: string, body: string, contentType?: string): Promise<any>;
|
|
40
|
+
/** DELETE `path`. */
|
|
41
|
+
delete(path: string): Promise<any>;
|
|
42
|
+
}
|
|
43
|
+
/** A resolved region handle. `getMap(name)` returns one; the `map*` methods consume it. */
|
|
44
|
+
export interface GeodeRegion {
|
|
45
|
+
readonly name: string;
|
|
46
|
+
}
|
|
47
|
+
/** Connection options for `GeodeStore`. */
|
|
48
|
+
export interface GeodeStoreOptions {
|
|
49
|
+
/** Base URL of the Geode REST server. Defaults to `http://localhost:8080`. */
|
|
50
|
+
baseURL?: string;
|
|
51
|
+
/** Pre-built HTTP client; when given it is used verbatim and `baseURL` is ignored. */
|
|
52
|
+
client?: GeodeHttpClient;
|
|
53
|
+
/** Extra HTTP headers sent with every internal-client request. */
|
|
54
|
+
headers?: Record<string, string>;
|
|
55
|
+
}
|
|
56
|
+
/** Build a `fetch`-backed REST client for the given base URL. */
|
|
57
|
+
export declare function createFetchClient(baseURL: string, headers?: Record<string, string>): GeodeHttpClient;
|
|
58
|
+
/**
|
|
59
|
+
* `GeodeStore` wraps Geode's Developer REST API behind the `NoSqlStore`
|
|
60
|
+
* lifecycle and exposes named-region key/value operations.
|
|
61
|
+
*/
|
|
62
|
+
export declare class GeodeStore implements NoSqlStore {
|
|
63
|
+
readonly name = "geode";
|
|
64
|
+
readonly library = "fetch";
|
|
65
|
+
private readonly baseURL;
|
|
66
|
+
private readonly injectedClient?;
|
|
67
|
+
private readonly headers?;
|
|
68
|
+
private client;
|
|
69
|
+
private connected;
|
|
70
|
+
/** Cached region handles, keyed by name so `getMap` is idempotent. */
|
|
71
|
+
private readonly regions;
|
|
72
|
+
constructor(options?: GeodeStoreOptions);
|
|
73
|
+
connect(): Promise<void>;
|
|
74
|
+
disconnect(): Promise<void>;
|
|
75
|
+
isConnected(): boolean;
|
|
76
|
+
/** Returns the underlying (internal or injected) HTTP client. */
|
|
77
|
+
getClient(): GeodeHttpClient;
|
|
78
|
+
private requireClient;
|
|
79
|
+
private wrap;
|
|
80
|
+
/** Resolve (and cache) a named-region handle. */
|
|
81
|
+
getMap(name: string): Promise<GeodeRegion>;
|
|
82
|
+
/** Store `value` under `key` in `map` (`PUT /geode/v1/<region>/<key>`). */
|
|
83
|
+
mapPut(map: GeodeRegion, key: string, value: unknown): Promise<void>;
|
|
84
|
+
/** Read `key` from `map` (`GET /geode/v1/<region>/<key>`); `null` if absent. */
|
|
85
|
+
mapGet(map: GeodeRegion, key: string): Promise<any>;
|
|
86
|
+
/** Remove `key` from `map` (`DELETE /geode/v1/<region>/<key>`). */
|
|
87
|
+
mapRemove(map: GeodeRegion, key: string): Promise<any>;
|
|
88
|
+
/** List all keys in `map` (`GET /geode/v1/<region>/keys`). */
|
|
89
|
+
mapKeys(map: GeodeRegion): Promise<any[]>;
|
|
90
|
+
/** Number of entries in `map` (derived from `mapKeys`). */
|
|
91
|
+
mapSize(map: GeodeRegion): Promise<number>;
|
|
92
|
+
}
|
|
93
|
+
export default GeodeStore;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ontotext GraphDB store implementation.
|
|
3
|
+
*
|
|
4
|
+
* GraphDB is an RDF triplestore that speaks the SPARQL 1.1 Protocol over HTTP.
|
|
5
|
+
* A repository exposes a query endpoint (`/repositories/<repo>`) and an update
|
|
6
|
+
* endpoint (`/repositories/<repo>/statements`). There is no SQL-shaped surface
|
|
7
|
+
* (no rows, no DDL, no identifier escaping), so it implements the minimal
|
|
8
|
+
* `NoSqlStore` marker interface (`src/nosql/store.ts`) rather than the SQL
|
|
9
|
+
* `Dialect` interface.
|
|
10
|
+
*
|
|
11
|
+
* ## No canonical driver - HTTP over `fetch`
|
|
12
|
+
*
|
|
13
|
+
* GraphDB has no dedicated npm client; it is just a SPARQL/HTTP endpoint. This
|
|
14
|
+
* store talks to the server with the global `fetch`. For tests (and for
|
|
15
|
+
* callers who want their own transport) an alternative client can be injected
|
|
16
|
+
* via `GraphdbStoreOptions.client`; when omitted, a tiny internal client over
|
|
17
|
+
* `fetch` + `endpoint` is built at connect time.
|
|
18
|
+
*
|
|
19
|
+
* ## Surface
|
|
20
|
+
*
|
|
21
|
+
* - `query(sparql)` -> POST to `/repositories/<repo>`, returns bindings
|
|
22
|
+
* - `update(sparql)` -> POST to `/repositories/<repo>/statements`
|
|
23
|
+
* - `ask(sparql)` -> POST an ASK query, returns the boolean
|
|
24
|
+
* - `add(triples)` -> `INSERT DATA { ... }` update
|
|
25
|
+
* - `drop(graph?)` -> `DROP GRAPH <g>` / `DROP ALL` update
|
|
26
|
+
*/
|
|
27
|
+
import { NoSqlStore } from '../store';
|
|
28
|
+
/** Default GraphDB base URL. */
|
|
29
|
+
export declare const DEFAULT_GRAPHDB_ENDPOINT = "http://localhost:7200";
|
|
30
|
+
/** Default repository id. */
|
|
31
|
+
export declare const DEFAULT_GRAPHDB_REPOSITORY = "repo";
|
|
32
|
+
/** The subset of a SPARQL HTTP client this store needs. */
|
|
33
|
+
export interface SparqlHttpClient {
|
|
34
|
+
/** POST a SPARQL query to `path`; returns the parsed results envelope. */
|
|
35
|
+
query(path: string, sparql: string): Promise<any>;
|
|
36
|
+
/** POST a SPARQL update to `path`. */
|
|
37
|
+
update(path: string, sparql: string): Promise<any>;
|
|
38
|
+
}
|
|
39
|
+
/** Connection options for `GraphdbStore`. */
|
|
40
|
+
export interface GraphdbStoreOptions {
|
|
41
|
+
/** Base URL of the GraphDB server. Defaults to `http://localhost:7200`. */
|
|
42
|
+
endpoint?: string;
|
|
43
|
+
/** Repository id. Defaults to `repo`. */
|
|
44
|
+
repository?: string;
|
|
45
|
+
/** Optional pre-built SPARQL HTTP client (used verbatim; `endpoint` ignored). */
|
|
46
|
+
client?: SparqlHttpClient;
|
|
47
|
+
/** Extra HTTP headers sent with every internal-client request. */
|
|
48
|
+
headers?: Record<string, string>;
|
|
49
|
+
}
|
|
50
|
+
/** Build a `fetch`-backed SPARQL client for the given endpoint. */
|
|
51
|
+
export declare function createFetchClient(endpoint: string, headers?: Record<string, string>): SparqlHttpClient;
|
|
52
|
+
/**
|
|
53
|
+
* `GraphdbStore` wraps a GraphDB repository's SPARQL query/update endpoints
|
|
54
|
+
* behind the `NoSqlStore` lifecycle.
|
|
55
|
+
*/
|
|
56
|
+
export declare class GraphdbStore implements NoSqlStore {
|
|
57
|
+
readonly name = "graphdb";
|
|
58
|
+
readonly library = "fetch";
|
|
59
|
+
private readonly endpoint;
|
|
60
|
+
private readonly repository;
|
|
61
|
+
private readonly injectedClient?;
|
|
62
|
+
private readonly headers?;
|
|
63
|
+
private client;
|
|
64
|
+
private connected;
|
|
65
|
+
constructor(options?: GraphdbStoreOptions);
|
|
66
|
+
/** SPARQL query endpoint path for the configured repository. */
|
|
67
|
+
get queryPath(): string;
|
|
68
|
+
/** SPARQL update endpoint path for the configured repository. */
|
|
69
|
+
get updatePath(): string;
|
|
70
|
+
connect(): Promise<void>;
|
|
71
|
+
disconnect(): Promise<void>;
|
|
72
|
+
isConnected(): boolean;
|
|
73
|
+
/** Returns the underlying (internal or injected) SPARQL HTTP client. */
|
|
74
|
+
getClient(): SparqlHttpClient;
|
|
75
|
+
private requireClient;
|
|
76
|
+
/** Runs a SPARQL SELECT/CONSTRUCT query; returns the result bindings. */
|
|
77
|
+
query(sparql: string): Promise<any[]>;
|
|
78
|
+
/** Runs a SPARQL ASK query; returns the boolean answer. */
|
|
79
|
+
ask(sparql: string): Promise<boolean>;
|
|
80
|
+
/** Runs a SPARQL UPDATE (INSERT/DELETE/DROP/...). */
|
|
81
|
+
update(sparql: string): Promise<any>;
|
|
82
|
+
/** Inserts triples via `INSERT DATA { ... }`. Accepts a triple string or array. */
|
|
83
|
+
add(triples: string | string[], graph?: string): Promise<any>;
|
|
84
|
+
/** Drops a named graph, or all graphs when no graph is given. */
|
|
85
|
+
drop(graph?: string): Promise<any>;
|
|
86
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Graylog store implementation.
|
|
3
|
+
*
|
|
4
|
+
* Graylog is a centralized log-management platform. Logs are ingested in the
|
|
5
|
+
* GELF (Graylog Extended Log Format) over an HTTP input, and searched via
|
|
6
|
+
* the REST universal search API. There is no SQL-shaped query surface, no
|
|
7
|
+
* row-level UPDATE/DELETE, and no identifier escaping, so Graylog does not
|
|
8
|
+
* fit the SQL `Dialect` interface (`src/dialects/dialect.ts`). This class
|
|
9
|
+
* implements the minimal `NoSqlStore` marker interface
|
|
10
|
+
* (`src/nosql/store.ts`) and exposes Graylog's ingest/search API.
|
|
11
|
+
*
|
|
12
|
+
* ## No canonical driver - HTTP over `fetch`
|
|
13
|
+
*
|
|
14
|
+
* Graylog has no single canonical npm client; it is an HTTP/JSON API. This
|
|
15
|
+
* store talks to it with the global `fetch` (so `library` is `'fetch'`). For
|
|
16
|
+
* tests (and custom transports) an alternative HTTP client can be injected
|
|
17
|
+
* via `GraylogStoreOptions.client`.
|
|
18
|
+
*
|
|
19
|
+
* ## Endpoints wrapped
|
|
20
|
+
*
|
|
21
|
+
* - `push(host, entries)` -> `POST /gelf` (GELF ingest, one message per entry)
|
|
22
|
+
* - `query(q, opts?)` -> `GET /api/search/universal/relative` (search)
|
|
23
|
+
* - `labels()` -> `GET /api/system/fields` (message field names)
|
|
24
|
+
* - `streams()` -> `GET /api/streams` (configured streams)
|
|
25
|
+
*/
|
|
26
|
+
import { NoSqlStore } from '../store';
|
|
27
|
+
/** Default Graylog HTTP base URL (GELF HTTP input on 12201, REST on 9000). */
|
|
28
|
+
export declare const DEFAULT_GRAYLOG_BASE_URL = "http://localhost:9000";
|
|
29
|
+
/** Query-string parameter value(s). `undefined` values are dropped. */
|
|
30
|
+
export type QueryParams = Record<string, string | string[] | undefined>;
|
|
31
|
+
/**
|
|
32
|
+
* The subset of an HTTP client this store needs. The internal `fetch`-based
|
|
33
|
+
* client implements this; tests inject a mock with the same shape.
|
|
34
|
+
*/
|
|
35
|
+
export interface GraylogHttpClient {
|
|
36
|
+
/** Issue a GET and return the parsed JSON response body. */
|
|
37
|
+
get(path: string, params?: QueryParams): Promise<any>;
|
|
38
|
+
/** Issue a POST with a text body and return the parsed JSON/text response. */
|
|
39
|
+
post(path: string, body: string, contentType?: string): Promise<any>;
|
|
40
|
+
}
|
|
41
|
+
/** Connection options for `GraylogStore`. */
|
|
42
|
+
export interface GraylogStoreOptions {
|
|
43
|
+
/** Base URL of the Graylog REST API. Defaults to `http://localhost:9000`. */
|
|
44
|
+
baseURL?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Optional pre-built HTTP client. When provided it is used verbatim and
|
|
47
|
+
* `baseURL` is ignored; otherwise an internal `fetch`-based client is
|
|
48
|
+
* built against `baseURL` on `connect()`.
|
|
49
|
+
*/
|
|
50
|
+
client?: GraylogHttpClient;
|
|
51
|
+
/** Extra HTTP headers (e.g. `Authorization`) sent with every request. */
|
|
52
|
+
headers?: Record<string, string>;
|
|
53
|
+
}
|
|
54
|
+
/** A GELF log message. `short_message` is required by the format. */
|
|
55
|
+
export interface GraylogEntry {
|
|
56
|
+
short_message: string;
|
|
57
|
+
full_message?: string;
|
|
58
|
+
/** Unix seconds (with optional fractional ms). Defaults to now on the server if omitted. */
|
|
59
|
+
timestamp?: number;
|
|
60
|
+
/** Syslog level 0-7. */
|
|
61
|
+
level?: number;
|
|
62
|
+
/** Any additional structured fields (prefixed with `_` in GELF). */
|
|
63
|
+
[field: string]: unknown;
|
|
64
|
+
}
|
|
65
|
+
/** Options for a relative universal search. */
|
|
66
|
+
export interface GraylogQueryOptions {
|
|
67
|
+
/** Relative search range in seconds (how far back from now). Defaults to 300. */
|
|
68
|
+
range?: number;
|
|
69
|
+
/** Max number of messages to return. */
|
|
70
|
+
limit?: number;
|
|
71
|
+
/** Offset into the result set. */
|
|
72
|
+
offset?: number;
|
|
73
|
+
/** Sort spec, e.g. `timestamp:desc`. */
|
|
74
|
+
sort?: string;
|
|
75
|
+
/** Restrict the search to a specific stream ID. */
|
|
76
|
+
filter?: string;
|
|
77
|
+
}
|
|
78
|
+
/** Build a `fetch`-backed client for the given base URL. */
|
|
79
|
+
export declare function createFetchClient(baseURL: string, headers?: Record<string, string>): GraylogHttpClient;
|
|
80
|
+
/**
|
|
81
|
+
* `GraylogStore` wraps Graylog's GELF HTTP ingest input and its REST
|
|
82
|
+
* universal-search / metadata API behind the `NoSqlStore` lifecycle.
|
|
83
|
+
*/
|
|
84
|
+
export declare class GraylogStore implements NoSqlStore {
|
|
85
|
+
readonly name = "graylog";
|
|
86
|
+
readonly library = "fetch";
|
|
87
|
+
private readonly baseURL;
|
|
88
|
+
private readonly injectedClient?;
|
|
89
|
+
private readonly headers?;
|
|
90
|
+
private client;
|
|
91
|
+
private connected;
|
|
92
|
+
constructor(options?: GraylogStoreOptions);
|
|
93
|
+
connect(): Promise<void>;
|
|
94
|
+
disconnect(): Promise<void>;
|
|
95
|
+
isConnected(): boolean;
|
|
96
|
+
/** Returns the underlying (internal or injected) HTTP client. */
|
|
97
|
+
getClient(): GraylogHttpClient;
|
|
98
|
+
private requireClient;
|
|
99
|
+
private doGet;
|
|
100
|
+
/**
|
|
101
|
+
* Ingests one or more log entries as GELF messages via `POST /gelf`. Each
|
|
102
|
+
* entry is completed into a GELF `1.1` message with the shared `host`, and
|
|
103
|
+
* messages are newline-delimited (the GELF HTTP input accepts one JSON
|
|
104
|
+
* message per line).
|
|
105
|
+
*/
|
|
106
|
+
push(host: string, entries: GraylogEntry[]): Promise<any>;
|
|
107
|
+
/**
|
|
108
|
+
* Runs a relative universal search via
|
|
109
|
+
* `GET /api/search/universal/relative`. Returns the parsed response
|
|
110
|
+
* (`{ messages, total_results, fields, ... }`).
|
|
111
|
+
*/
|
|
112
|
+
query(q: string, options?: GraylogQueryOptions): Promise<any>;
|
|
113
|
+
/** Lists the known message field names via `GET /api/system/fields`. */
|
|
114
|
+
labels(): Promise<any>;
|
|
115
|
+
/** Lists the configured streams via `GET /api/streams`. */
|
|
116
|
+
streams(): Promise<any>;
|
|
117
|
+
}
|
|
118
|
+
export default GraylogStore;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GridGain store implementation.
|
|
3
|
+
*
|
|
4
|
+
* GridGain is the commercial in-memory computing platform built on (and
|
|
5
|
+
* wire-compatible with) Apache Ignite: it speaks the same thin-client
|
|
6
|
+
* protocol and exposes the same distributed key/value caches. Consequently
|
|
7
|
+
* this store uses the very same `apache-ignite-client` Node.js thin-client
|
|
8
|
+
* driver as `IgniteStore`, differing only in `name` ('gridgain') and the
|
|
9
|
+
* error/message labels. Like Ignite it targets the distributed-cache
|
|
10
|
+
* (key/value grid) surface rather than SQL, so it implements the minimal
|
|
11
|
+
* `NoSqlStore` marker interface and exposes cache operations
|
|
12
|
+
* (getCache/put/get/removeKey/getKeys/getSize) as a typed, promise-based API.
|
|
13
|
+
*
|
|
14
|
+
* The driver is loaded lazily inside `connect()` (or supplied pre-built via
|
|
15
|
+
* the `client` option) so importing this module never requires
|
|
16
|
+
* `apache-ignite-client` to be installed unless a GridGain store is actually
|
|
17
|
+
* connected. Tests inject a mock client this way.
|
|
18
|
+
*/
|
|
19
|
+
import { NoSqlStore } from '../store';
|
|
20
|
+
/** The subset of an Ignite/GridGain thin-client `CacheClient` this store drives. */
|
|
21
|
+
export interface GridGainCache {
|
|
22
|
+
put(key: unknown, value: unknown): Promise<unknown>;
|
|
23
|
+
get(key: unknown): Promise<unknown>;
|
|
24
|
+
removeKey(key: unknown): Promise<boolean>;
|
|
25
|
+
getKeys(): Promise<unknown[]>;
|
|
26
|
+
getSize(): Promise<number>;
|
|
27
|
+
}
|
|
28
|
+
/** The subset of the `apache-ignite-client` `IgniteClient` surface this store drives. */
|
|
29
|
+
export interface GridGainClientLike {
|
|
30
|
+
connect(config: unknown): Promise<void>;
|
|
31
|
+
disconnect(): void | Promise<void>;
|
|
32
|
+
getCache(name: string): GridGainCache | Promise<GridGainCache>;
|
|
33
|
+
}
|
|
34
|
+
/** Connection options for `GridGainStore`. */
|
|
35
|
+
export interface GridGainStoreOptions {
|
|
36
|
+
/**
|
|
37
|
+
* One or more `host:port` thin-client endpoints (default
|
|
38
|
+
* `['127.0.0.1:10800']`). Passed to `new IgniteClientConfiguration(...)`.
|
|
39
|
+
* Ignored when a pre-built `client` is supplied.
|
|
40
|
+
*/
|
|
41
|
+
endpoints?: string[];
|
|
42
|
+
/** Pre-built GridGain/Ignite client; when given, `connect()` uses it and skips the `require`. */
|
|
43
|
+
client?: GridGainClientLike;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* `GridGainStore` wraps an `apache-ignite-client` client (GridGain is
|
|
47
|
+
* Ignite-based and shares the thin-client protocol) and exposes its
|
|
48
|
+
* distributed-cache operations as a typed, promise-based API.
|
|
49
|
+
*/
|
|
50
|
+
export declare class GridGainStore implements NoSqlStore {
|
|
51
|
+
readonly name = "gridgain";
|
|
52
|
+
readonly library = "apache-ignite-client";
|
|
53
|
+
private readonly options;
|
|
54
|
+
private client;
|
|
55
|
+
private connected;
|
|
56
|
+
/** Resolved `CacheClient` handles, cached by name so `getMap` is idempotent. */
|
|
57
|
+
private readonly caches;
|
|
58
|
+
constructor(options?: GridGainStoreOptions);
|
|
59
|
+
connect(): Promise<void>;
|
|
60
|
+
disconnect(): Promise<void>;
|
|
61
|
+
isConnected(): boolean;
|
|
62
|
+
/** Returns the underlying `apache-ignite-client` client for anything not wrapped here. */
|
|
63
|
+
getClient(): GridGainClientLike;
|
|
64
|
+
private requireClient;
|
|
65
|
+
/** Resolve (and cache) a distributed cache handle by name. */
|
|
66
|
+
getMap(name: string): Promise<GridGainCache>;
|
|
67
|
+
/** Put `value` under `key` in `map` (a GridGain cache handle). */
|
|
68
|
+
mapPut(map: GridGainCache, key: unknown, value: unknown): Promise<unknown>;
|
|
69
|
+
/** Get the value stored under `key` in `map` (or null if absent). */
|
|
70
|
+
mapGet(map: GridGainCache, key: unknown): Promise<unknown>;
|
|
71
|
+
/** Remove `key` from `map`. Returns GridGain's boolean success flag. */
|
|
72
|
+
mapRemove(map: GridGainCache, key: unknown): Promise<boolean>;
|
|
73
|
+
/** Return all keys currently in `map` as an array. */
|
|
74
|
+
mapKeys(map: GridGainCache): Promise<unknown[]>;
|
|
75
|
+
/** Return the number of entries in `map`. */
|
|
76
|
+
mapSize(map: GridGainCache): Promise<number>;
|
|
77
|
+
}
|
|
78
|
+
export default GridGainStore;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hazelcast store implementation.
|
|
3
|
+
*
|
|
4
|
+
* Hazelcast is a distributed in-memory data grid (IMDG). Its central data
|
|
5
|
+
* structure is the distributed `IMap` - a partitioned, replicated key/value
|
|
6
|
+
* map spread across cluster members. It has no SQL-shaped `query(sql)`
|
|
7
|
+
* surface, so this class implements the minimal `NoSqlStore` marker
|
|
8
|
+
* interface and exposes Hazelcast's distributed-map operations
|
|
9
|
+
* (getMap/put/get/remove/keySet/size) as a typed, promise-based API.
|
|
10
|
+
*
|
|
11
|
+
* Uses the `hazelcast-client` driver. The driver is loaded lazily inside
|
|
12
|
+
* `connect()` (or supplied pre-built via the `client` option) so importing
|
|
13
|
+
* this module never requires `hazelcast-client` to be installed unless a
|
|
14
|
+
* Hazelcast store is actually connected. Tests inject a mock client this way.
|
|
15
|
+
*/
|
|
16
|
+
import { NoSqlStore } from '../store';
|
|
17
|
+
/** The subset of a Hazelcast `IMap` handle this store drives. */
|
|
18
|
+
export interface HazelcastMap {
|
|
19
|
+
put(key: unknown, value: unknown): Promise<unknown>;
|
|
20
|
+
get(key: unknown): Promise<unknown>;
|
|
21
|
+
remove(key: unknown): Promise<unknown>;
|
|
22
|
+
keySet(): Promise<unknown[]>;
|
|
23
|
+
size(): Promise<number>;
|
|
24
|
+
}
|
|
25
|
+
/** The subset of the `hazelcast-client` `Client` surface this store drives. */
|
|
26
|
+
export interface HazelcastClientLike {
|
|
27
|
+
getMap(name: string): Promise<HazelcastMap>;
|
|
28
|
+
shutdown(): Promise<void> | void;
|
|
29
|
+
}
|
|
30
|
+
/** Connection options for `HazelcastStore`. */
|
|
31
|
+
export interface HazelcastStoreOptions {
|
|
32
|
+
/**
|
|
33
|
+
* Hazelcast client config passed straight through to
|
|
34
|
+
* `Client.newHazelcastClient(config)` (cluster name, network member
|
|
35
|
+
* addresses, etc). Ignored when a pre-built `client` is supplied.
|
|
36
|
+
*/
|
|
37
|
+
config?: Record<string, unknown>;
|
|
38
|
+
/** Pre-built Hazelcast client; when given, `connect()` uses it and skips `require('hazelcast-client')`. */
|
|
39
|
+
client?: HazelcastClientLike;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* `HazelcastStore` wraps a `hazelcast-client` `Client` and exposes its
|
|
43
|
+
* distributed `IMap` operations as a typed, promise-based API.
|
|
44
|
+
*/
|
|
45
|
+
export declare class HazelcastStore implements NoSqlStore {
|
|
46
|
+
readonly name = "hazelcast";
|
|
47
|
+
readonly library = "hazelcast-client";
|
|
48
|
+
private readonly options;
|
|
49
|
+
private client;
|
|
50
|
+
private connected;
|
|
51
|
+
/** Resolved `IMap` handles, cached by map name so `getMap` is idempotent. */
|
|
52
|
+
private readonly maps;
|
|
53
|
+
constructor(options?: HazelcastStoreOptions);
|
|
54
|
+
connect(): Promise<void>;
|
|
55
|
+
disconnect(): Promise<void>;
|
|
56
|
+
isConnected(): boolean;
|
|
57
|
+
/** Returns the underlying `hazelcast-client` client for anything not wrapped here. */
|
|
58
|
+
getClient(): HazelcastClientLike;
|
|
59
|
+
private requireClient;
|
|
60
|
+
/** Resolve (and cache) a distributed `IMap` handle by name. */
|
|
61
|
+
getMap(name: string): Promise<HazelcastMap>;
|
|
62
|
+
/** Put `value` under `key` in `map`, returning the previous value (or null). */
|
|
63
|
+
mapPut(map: HazelcastMap, key: unknown, value: unknown): Promise<unknown>;
|
|
64
|
+
/** Get the value stored under `key` in `map` (or null if absent). */
|
|
65
|
+
mapGet(map: HazelcastMap, key: unknown): Promise<unknown>;
|
|
66
|
+
/** Remove `key` from `map`, returning the removed value (or null). */
|
|
67
|
+
mapRemove(map: HazelcastMap, key: unknown): Promise<unknown>;
|
|
68
|
+
/** Return all keys currently in `map` as an array. */
|
|
69
|
+
mapKeys(map: HazelcastMap): Promise<unknown[]>;
|
|
70
|
+
/** Return the number of entries in `map`. */
|
|
71
|
+
mapSize(map: HazelcastMap): Promise<number>;
|
|
72
|
+
}
|
|
73
|
+
export default HazelcastStore;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import type { NoSqlStore } from '../store';
|
|
2
|
+
/** A map of `'family:qualifier'` column keys to cell values for a single row. */
|
|
3
|
+
export type HBaseRowData = Record<string, unknown>;
|
|
4
|
+
/**
|
|
5
|
+
* Minimal structural type for the fluent `row(key)` handle the `hbase` driver
|
|
6
|
+
* returns. Each method takes a Node-style `(err, result)` callback; this store
|
|
7
|
+
* promisifies them.
|
|
8
|
+
*/
|
|
9
|
+
export interface HBaseRowLike {
|
|
10
|
+
put(column: string, value: unknown, cb: (err: unknown, result?: unknown) => void): void;
|
|
11
|
+
put(columns: string[], values: unknown[], cb: (err: unknown, result?: unknown) => void): void;
|
|
12
|
+
get(cb: (err: unknown, cells?: unknown) => void): void;
|
|
13
|
+
delete(cb: (err: unknown, result?: unknown) => void): void;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Minimal structural type for the fluent `table(name)` handle the `hbase`
|
|
17
|
+
* driver returns.
|
|
18
|
+
*/
|
|
19
|
+
export interface HBaseTableLike {
|
|
20
|
+
row(key: string): HBaseRowLike;
|
|
21
|
+
create(schema: unknown, cb: (err: unknown, result?: unknown) => void): void;
|
|
22
|
+
scan(options: Record<string, unknown>, cb: (err: unknown, rows?: unknown) => void): void;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Minimal structural type for the pieces of an `hbase` client this store uses.
|
|
26
|
+
* Kept local (rather than importing from `hbase`) so this module type-checks
|
|
27
|
+
* without the optional driver installed.
|
|
28
|
+
*/
|
|
29
|
+
export interface HBaseClientLike {
|
|
30
|
+
table(name: string): HBaseTableLike;
|
|
31
|
+
}
|
|
32
|
+
/** Options accepted by the `scan()` helper; forwarded straight to the driver. */
|
|
33
|
+
export interface HBaseScanOptions {
|
|
34
|
+
/** Inclusive start row key for the range scan. */
|
|
35
|
+
startRow?: string;
|
|
36
|
+
/** Exclusive end row key for the range scan. */
|
|
37
|
+
endRow?: string;
|
|
38
|
+
/** Restrict the scan to these `'family'` or `'family:qualifier'` columns. */
|
|
39
|
+
columns?: string[];
|
|
40
|
+
/** Maximum number of rows to return. */
|
|
41
|
+
maxVersions?: number;
|
|
42
|
+
/** Batch size for the underlying scanner. */
|
|
43
|
+
batch?: number;
|
|
44
|
+
[key: string]: unknown;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Connection options for `HBaseStore`. These map onto the `hbase` client
|
|
48
|
+
* constructor options (a Stargate / REST gateway host + port).
|
|
49
|
+
*/
|
|
50
|
+
export interface HBaseStoreOptions {
|
|
51
|
+
/** REST/Stargate gateway host, e.g. '127.0.0.1'. */
|
|
52
|
+
host?: string;
|
|
53
|
+
/** REST/Stargate gateway port, e.g. 8080. */
|
|
54
|
+
port?: number;
|
|
55
|
+
/**
|
|
56
|
+
* Escape hatch for any other `hbase` client option (protocol, encoding,
|
|
57
|
+
* auth, timeout, ...). Merged into the options passed to the client factory.
|
|
58
|
+
*/
|
|
59
|
+
clientOptions?: Record<string, unknown>;
|
|
60
|
+
/**
|
|
61
|
+
* A pre-built `hbase` client (or a compatible mock). When provided,
|
|
62
|
+
* `connect()` uses it directly and skips `require('hbase')` entirely — this
|
|
63
|
+
* is how tests inject a mock without the real driver installed.
|
|
64
|
+
*/
|
|
65
|
+
client?: HBaseClientLike;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* `HBaseStore` wraps an `hbase` REST-gateway client and exposes HBase's
|
|
69
|
+
* row/cell surface: `put`/`get`/`deleteRow` for single-row operations, `scan`
|
|
70
|
+
* for range reads over the sorted key space, and `createTable` for defining a
|
|
71
|
+
* table's column families. Column cells are addressed as `'family:qualifier'`.
|
|
72
|
+
*/
|
|
73
|
+
export declare class HBaseStore implements NoSqlStore {
|
|
74
|
+
readonly name = "hbase";
|
|
75
|
+
readonly library = "hbase";
|
|
76
|
+
private readonly options;
|
|
77
|
+
private client;
|
|
78
|
+
private connected;
|
|
79
|
+
constructor(options?: HBaseStoreOptions);
|
|
80
|
+
connect(): Promise<void>;
|
|
81
|
+
/**
|
|
82
|
+
* The `hbase` REST client is stateless (each call is an HTTP request), so
|
|
83
|
+
* there is no socket to tear down; `disconnect()` simply drops the reference
|
|
84
|
+
* and flips `connected` to false.
|
|
85
|
+
*/
|
|
86
|
+
disconnect(): Promise<void>;
|
|
87
|
+
isConnected(): boolean;
|
|
88
|
+
/** Returns the underlying `hbase` client for anything not wrapped here. */
|
|
89
|
+
getClient(): HBaseClientLike;
|
|
90
|
+
private requireClient;
|
|
91
|
+
private wrapError;
|
|
92
|
+
/**
|
|
93
|
+
* Writes (puts) one or more cells into a single row. `data` maps
|
|
94
|
+
* `'family:qualifier'` column keys to values, e.g.
|
|
95
|
+
* `{ 'cf:name': 'alice', 'cf:age': 30 }`. Passed to the driver as parallel
|
|
96
|
+
* `columns`/`values` arrays via `table(table).row(row).put(...)`.
|
|
97
|
+
*/
|
|
98
|
+
put(table: string, row: string, data: HBaseRowData): Promise<unknown>;
|
|
99
|
+
/**
|
|
100
|
+
* Reads a single row by key via `table(table).row(row).get(...)`, returning
|
|
101
|
+
* the row's cells as the driver surfaces them (an array of
|
|
102
|
+
* `{ column, timestamp, $ }` cell descriptors for the `hbase` REST client).
|
|
103
|
+
*/
|
|
104
|
+
get(table: string, row: string): Promise<unknown>;
|
|
105
|
+
/** Deletes an entire row (all its cells) via `table(table).row(row).delete(...)`. */
|
|
106
|
+
deleteRow(table: string, row: string): Promise<unknown>;
|
|
107
|
+
/**
|
|
108
|
+
* Range-scans a table via `table(table).scan(options, ...)`, returning the
|
|
109
|
+
* matching rows. Since HBase keeps row keys sorted, `startRow`/`endRow`
|
|
110
|
+
* define an efficient contiguous range; `columns` restricts which families/
|
|
111
|
+
* qualifiers are read. Returns the rows as the driver surfaces them.
|
|
112
|
+
*/
|
|
113
|
+
scan(table: string, opts?: HBaseScanOptions): Promise<unknown>;
|
|
114
|
+
/**
|
|
115
|
+
* Creates a table with the given column families via
|
|
116
|
+
* `table(table).create(...)`. `families` is the list of column family names
|
|
117
|
+
* (e.g. `['cf', 'meta']`); each is sent to the driver as an HBase
|
|
118
|
+
* `ColumnSchema` entry. A table must declare its families up front — unlike
|
|
119
|
+
* qualifiers, families cannot be added implicitly at write time.
|
|
120
|
+
*/
|
|
121
|
+
createTable(table: string, families: string[]): Promise<unknown>;
|
|
122
|
+
}
|
|
123
|
+
export default HBaseStore;
|