js-redis-server 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +210 -39
- package/dist/cli.d.ts +1 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +191 -0
- package/dist/cli.js.map +1 -0
- package/dist/cluster.d.ts +36 -0
- package/dist/cluster.d.ts.map +1 -0
- package/dist/cluster.js +227 -0
- package/dist/cluster.js.map +1 -0
- package/dist/commands/cluster.d.ts +11 -0
- package/dist/commands/cluster.d.ts.map +1 -0
- package/dist/commands/cluster.js +233 -0
- package/dist/commands/cluster.js.map +1 -0
- package/dist/commands/command.d.ts +6 -0
- package/dist/commands/command.d.ts.map +1 -0
- package/dist/commands/command.js +390 -0
- package/dist/commands/command.js.map +1 -0
- package/dist/commands/config.d.ts +9 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +142 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/connection.d.ts +24 -0
- package/dist/commands/connection.d.ts.map +1 -0
- package/dist/commands/connection.js +470 -0
- package/dist/commands/connection.js.map +1 -0
- package/dist/commands/hashes.d.ts +64 -0
- package/dist/commands/hashes.d.ts.map +1 -0
- package/dist/commands/hashes.js +274 -0
- package/dist/commands/hashes.js.map +1 -0
- package/dist/commands/helpers.d.ts +16 -0
- package/dist/commands/helpers.d.ts.map +1 -0
- package/dist/commands/helpers.js +77 -0
- package/dist/commands/helpers.js.map +1 -0
- package/dist/commands/index.d.ts +24 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +198 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/introspection.d.ts +17 -0
- package/dist/commands/introspection.d.ts.map +1 -0
- package/dist/commands/introspection.js +54 -0
- package/dist/commands/introspection.js.map +1 -0
- package/dist/commands/keys.d.ts +66 -0
- package/dist/commands/keys.d.ts.map +1 -0
- package/dist/commands/keys.js +345 -0
- package/dist/commands/keys.js.map +1 -0
- package/dist/commands/lists.d.ts +73 -0
- package/dist/commands/lists.d.ts.map +1 -0
- package/dist/commands/lists.js +447 -0
- package/dist/commands/lists.js.map +1 -0
- package/dist/commands/scan.d.ts +24 -0
- package/dist/commands/scan.d.ts.map +1 -0
- package/dist/commands/scan.js +316 -0
- package/dist/commands/scan.js.map +1 -0
- package/dist/commands/scripts.d.ts +22 -0
- package/dist/commands/scripts.d.ts.map +1 -0
- package/dist/commands/scripts.js +192 -0
- package/dist/commands/scripts.js.map +1 -0
- package/dist/commands/sets.d.ts +62 -0
- package/dist/commands/sets.d.ts.map +1 -0
- package/dist/commands/sets.js +436 -0
- package/dist/commands/sets.js.map +1 -0
- package/dist/commands/streams.d.ts +63 -0
- package/dist/commands/streams.d.ts.map +1 -0
- package/dist/commands/streams.js +504 -0
- package/dist/commands/streams.js.map +1 -0
- package/dist/commands/strings.d.ts +96 -0
- package/dist/commands/strings.d.ts.map +1 -0
- package/dist/commands/strings.js +555 -0
- package/dist/commands/strings.js.map +1 -0
- package/dist/commands/transactions.d.ts +9 -0
- package/dist/commands/transactions.d.ts.map +1 -0
- package/dist/commands/transactions.js +89 -0
- package/dist/commands/transactions.js.map +1 -0
- package/dist/commands/zsets.d.ts +82 -0
- package/dist/commands/zsets.d.ts.map +1 -0
- package/dist/commands/zsets.js +504 -0
- package/dist/commands/zsets.js.map +1 -0
- package/dist/core/client-session.d.ts +172 -0
- package/dist/core/client-session.d.ts.map +1 -0
- package/dist/core/client-session.js +379 -0
- package/dist/core/client-session.js.map +1 -0
- package/dist/core/command-definition.d.ts +64 -0
- package/dist/core/command-definition.d.ts.map +1 -0
- package/dist/core/command-definition.js +10 -0
- package/dist/core/command-definition.js.map +1 -0
- package/dist/core/command-executor.d.ts +103 -0
- package/dist/core/command-executor.d.ts.map +1 -0
- package/dist/core/command-executor.js +295 -0
- package/dist/core/command-executor.js.map +1 -0
- package/dist/core/command-registry.d.ts +16 -0
- package/dist/core/command-registry.d.ts.map +1 -0
- package/dist/core/command-registry.js +35 -0
- package/dist/core/command-registry.js.map +1 -0
- package/dist/core/command-schema.d.ts +43 -0
- package/dist/core/command-schema.d.ts.map +1 -0
- package/dist/core/command-schema.js +189 -0
- package/dist/core/command-schema.js.map +1 -0
- package/dist/core/execution-policies/auth-policy.d.ts +10 -0
- package/dist/core/execution-policies/auth-policy.d.ts.map +1 -0
- package/dist/core/execution-policies/auth-policy.js +39 -0
- package/dist/core/execution-policies/auth-policy.js.map +1 -0
- package/dist/core/execution-policies/cluster-policy.d.ts +8 -0
- package/dist/core/execution-policies/cluster-policy.d.ts.map +1 -0
- package/dist/core/execution-policies/cluster-policy.js +67 -0
- package/dist/core/execution-policies/cluster-policy.js.map +1 -0
- package/dist/core/execution-policies/index.d.ts +17 -0
- package/dist/core/execution-policies/index.d.ts.map +1 -0
- package/dist/core/execution-policies/index.js +10 -0
- package/dist/core/execution-policies/index.js.map +1 -0
- package/dist/core/execution-policies/transaction-policy.d.ts +3 -0
- package/dist/core/execution-policies/transaction-policy.d.ts.map +1 -0
- package/dist/core/execution-policies/transaction-policy.js +21 -0
- package/dist/core/execution-policies/transaction-policy.js.map +1 -0
- package/dist/core/lua-runtime.d.ts +15 -0
- package/dist/core/lua-runtime.d.ts.map +1 -0
- package/dist/core/lua-runtime.js +165 -0
- package/dist/core/lua-runtime.js.map +1 -0
- package/dist/core/redis-context.d.ts +46 -0
- package/dist/core/redis-context.d.ts.map +1 -0
- package/dist/core/redis-context.js +46 -0
- package/dist/core/redis-context.js.map +1 -0
- package/dist/core/redis-error.d.ts +137 -0
- package/dist/core/redis-error.d.ts.map +1 -0
- package/dist/core/redis-error.js +288 -0
- package/dist/core/redis-error.js.map +1 -0
- package/dist/core/redis-result.d.ts +15 -0
- package/dist/core/redis-result.d.ts.map +1 -0
- package/dist/core/redis-result.js +26 -0
- package/dist/core/redis-result.js.map +1 -0
- package/dist/core/redis-value.d.ts +65 -0
- package/dist/core/redis-value.d.ts.map +1 -0
- package/dist/core/redis-value.js +45 -0
- package/dist/core/redis-value.js.map +1 -0
- package/dist/core/resp-encoder.d.ts +9 -0
- package/dist/core/resp-encoder.d.ts.map +1 -0
- package/dist/core/resp-encoder.js +164 -0
- package/dist/core/resp-encoder.js.map +1 -0
- package/dist/core/response-stream.d.ts +17 -0
- package/dist/core/response-stream.d.ts.map +1 -0
- package/dist/core/response-stream.js +10 -0
- package/dist/core/response-stream.js.map +1 -0
- package/dist/core/transports/connection-transport.d.ts +12 -0
- package/dist/core/transports/connection-transport.d.ts.map +1 -0
- package/dist/core/transports/connection-transport.js +3 -0
- package/dist/core/transports/connection-transport.js.map +1 -0
- package/dist/core/transports/in-memory-connection-transport.d.ts +28 -0
- package/dist/core/transports/in-memory-connection-transport.d.ts.map +1 -0
- package/dist/core/transports/in-memory-connection-transport.js +111 -0
- package/dist/core/transports/in-memory-connection-transport.js.map +1 -0
- package/dist/core/transports/resp2/decoder.d.ts +19 -0
- package/dist/core/transports/resp2/decoder.d.ts.map +1 -0
- package/dist/core/transports/resp2/decoder.js +221 -0
- package/dist/core/transports/resp2/decoder.js.map +1 -0
- package/dist/core/transports/resp2/index.d.ts +2 -12
- package/dist/core/transports/resp2/index.d.ts.map +1 -1
- package/dist/core/transports/resp2/index.js +9 -0
- package/dist/core/transports/resp2/index.js.map +1 -0
- package/dist/core/transports/resp2/server.d.ts +28 -0
- package/dist/core/transports/resp2/server.d.ts.map +1 -0
- package/dist/core/transports/resp2/server.js +86 -0
- package/dist/core/transports/resp2/server.js.map +1 -0
- package/dist/core/transports/resp2/session-adapter.d.ts +24 -0
- package/dist/core/transports/resp2/session-adapter.d.ts.map +1 -0
- package/dist/core/transports/resp2/session-adapter.js +93 -0
- package/dist/core/transports/resp2/session-adapter.js.map +1 -0
- package/dist/core/transports/socket-connection-transport.d.ts +20 -0
- package/dist/core/transports/socket-connection-transport.d.ts.map +1 -0
- package/dist/core/transports/socket-connection-transport.js +64 -0
- package/dist/core/transports/socket-connection-transport.js.map +1 -0
- package/dist/core/turn-queue.d.ts +15 -0
- package/dist/core/turn-queue.d.ts.map +1 -0
- package/dist/core/turn-queue.js +51 -0
- package/dist/core/turn-queue.js.map +1 -0
- package/dist/index.d.ts +35 -347
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +157 -0
- package/dist/index.js.map +1 -0
- package/dist/logger.d.ts +6 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +3 -0
- package/dist/logger.js.map +1 -0
- package/dist/state/cluster-topology.d.ts +36 -0
- package/dist/state/cluster-topology.d.ts.map +1 -0
- package/dist/state/cluster-topology.js +109 -0
- package/dist/state/cluster-topology.js.map +1 -0
- package/dist/state/data-types.d.ts +51 -0
- package/dist/state/data-types.d.ts.map +1 -0
- package/dist/state/data-types.js +78 -0
- package/dist/state/data-types.js.map +1 -0
- package/dist/state/database.d.ts +46 -0
- package/dist/state/database.d.ts.map +1 -0
- package/dist/state/database.js +122 -0
- package/dist/state/database.js.map +1 -0
- package/dist/state/index.d.ts +14 -0
- package/dist/state/index.d.ts.map +1 -0
- package/dist/state/index.js +27 -0
- package/dist/state/index.js.map +1 -0
- package/dist/state/keyspace.d.ts +45 -0
- package/dist/state/keyspace.d.ts.map +1 -0
- package/dist/state/keyspace.js +181 -0
- package/dist/state/keyspace.js.map +1 -0
- package/dist/state/mutation-events.d.ts +38 -0
- package/dist/state/mutation-events.d.ts.map +1 -0
- package/dist/state/mutation-events.js +74 -0
- package/dist/state/mutation-events.js.map +1 -0
- package/dist/state/pubsub-broker.d.ts +4 -0
- package/dist/state/pubsub-broker.d.ts.map +1 -0
- package/dist/state/pubsub-broker.js +10 -0
- package/dist/state/pubsub-broker.js.map +1 -0
- package/dist/state/script-cache.d.ts +10 -0
- package/dist/state/script-cache.d.ts.map +1 -0
- package/dist/state/script-cache.js +33 -0
- package/dist/state/script-cache.js.map +1 -0
- package/dist/state/server-state.d.ts +31 -0
- package/dist/state/server-state.d.ts.map +1 -0
- package/dist/state/server-state.js +44 -0
- package/dist/state/server-state.js.map +1 -0
- package/package.json +22 -26
- package/dist/cli.mjs +0 -5923
- package/dist/cli.mjs.map +0 -1
- package/dist/commanders/custom/base-commander.d.ts +0 -19
- package/dist/commanders/custom/base-commander.d.ts.map +0 -1
- package/dist/commanders/custom/cluster-router.d.ts +0 -57
- package/dist/commanders/custom/cluster-router.d.ts.map +0 -1
- package/dist/commanders/custom/clusterCommander.d.ts +0 -39
- package/dist/commanders/custom/clusterCommander.d.ts.map +0 -1
- package/dist/commanders/custom/commander.d.ts +0 -12
- package/dist/commanders/custom/commander.d.ts.map +0 -1
- package/dist/commanders/custom/commands/metadata.d.ts +0 -101
- package/dist/commanders/custom/commands/metadata.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/client/clientSetName.d.ts +0 -8
- package/dist/commanders/custom/commands/redis/client/clientSetName.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/client/index.d.ts +0 -9
- package/dist/commanders/custom/commands/redis/client/index.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/cluster/clusterInfo.d.ts +0 -7
- package/dist/commanders/custom/commands/redis/cluster/clusterInfo.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/cluster/clusterNodes.d.ts +0 -7
- package/dist/commanders/custom/commands/redis/cluster/clusterNodes.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/cluster/clusterShards.d.ts +0 -7
- package/dist/commanders/custom/commands/redis/cluster/clusterShards.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/cluster/clusterSlots.d.ts +0 -7
- package/dist/commanders/custom/commands/redis/cluster/clusterSlots.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/cluster/index.d.ts +0 -8
- package/dist/commanders/custom/commands/redis/cluster/index.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/command/index.d.ts +0 -6
- package/dist/commanders/custom/commands/redis/command/index.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/hashes/hdel.d.ts +0 -9
- package/dist/commanders/custom/commands/redis/data/hashes/hdel.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/hashes/hexists.d.ts +0 -8
- package/dist/commanders/custom/commands/redis/data/hashes/hexists.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/hashes/hget.d.ts +0 -8
- package/dist/commanders/custom/commands/redis/data/hashes/hget.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/hashes/hgetall.d.ts +0 -5
- package/dist/commanders/custom/commands/redis/data/hashes/hgetall.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/hashes/hincrby.d.ts +0 -9
- package/dist/commanders/custom/commands/redis/data/hashes/hincrby.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/hashes/hincrbyfloat.d.ts +0 -9
- package/dist/commanders/custom/commands/redis/data/hashes/hincrbyfloat.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/hashes/hkeys.d.ts +0 -5
- package/dist/commanders/custom/commands/redis/data/hashes/hkeys.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/hashes/hlen.d.ts +0 -5
- package/dist/commanders/custom/commands/redis/data/hashes/hlen.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/hashes/hmget.d.ts +0 -9
- package/dist/commanders/custom/commands/redis/data/hashes/hmget.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/hashes/hmset.d.ts +0 -10
- package/dist/commanders/custom/commands/redis/data/hashes/hmset.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/hashes/hset.d.ts +0 -10
- package/dist/commanders/custom/commands/redis/data/hashes/hset.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/hashes/hvals.d.ts +0 -5
- package/dist/commanders/custom/commands/redis/data/hashes/hvals.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/hashes/index.d.ts +0 -13
- package/dist/commanders/custom/commands/redis/data/hashes/index.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/index.d.ts +0 -7
- package/dist/commanders/custom/commands/redis/data/index.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/keys/dbsize.d.ts +0 -5
- package/dist/commanders/custom/commands/redis/data/keys/dbsize.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/keys/del.d.ts +0 -8
- package/dist/commanders/custom/commands/redis/data/keys/del.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/keys/exists.d.ts +0 -8
- package/dist/commanders/custom/commands/redis/data/keys/exists.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/keys/expire.d.ts +0 -8
- package/dist/commanders/custom/commands/redis/data/keys/expire.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/keys/expireat.d.ts +0 -8
- package/dist/commanders/custom/commands/redis/data/keys/expireat.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/keys/flushall.d.ts +0 -5
- package/dist/commanders/custom/commands/redis/data/keys/flushall.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/keys/flushdb.d.ts +0 -5
- package/dist/commanders/custom/commands/redis/data/keys/flushdb.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/keys/index.d.ts +0 -11
- package/dist/commanders/custom/commands/redis/data/keys/index.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/keys/pttl.d.ts +0 -5
- package/dist/commanders/custom/commands/redis/data/keys/pttl.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/keys/ttl.d.ts +0 -5
- package/dist/commanders/custom/commands/redis/data/keys/ttl.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/keys/type.d.ts +0 -5
- package/dist/commanders/custom/commands/redis/data/keys/type.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/lists/index.d.ts +0 -11
- package/dist/commanders/custom/commands/redis/data/lists/index.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/lists/lindex.d.ts +0 -8
- package/dist/commanders/custom/commands/redis/data/lists/lindex.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/lists/llen.d.ts +0 -5
- package/dist/commanders/custom/commands/redis/data/lists/llen.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/lists/lpop.d.ts +0 -5
- package/dist/commanders/custom/commands/redis/data/lists/lpop.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/lists/lpush.d.ts +0 -9
- package/dist/commanders/custom/commands/redis/data/lists/lpush.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/lists/lrange.d.ts +0 -9
- package/dist/commanders/custom/commands/redis/data/lists/lrange.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/lists/lrem.d.ts +0 -9
- package/dist/commanders/custom/commands/redis/data/lists/lrem.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/lists/lset.d.ts +0 -9
- package/dist/commanders/custom/commands/redis/data/lists/lset.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/lists/ltrim.d.ts +0 -9
- package/dist/commanders/custom/commands/redis/data/lists/ltrim.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/lists/rpop.d.ts +0 -5
- package/dist/commanders/custom/commands/redis/data/lists/rpop.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/lists/rpush.d.ts +0 -9
- package/dist/commanders/custom/commands/redis/data/lists/rpush.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/sets/index.d.ts +0 -12
- package/dist/commanders/custom/commands/redis/data/sets/index.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/sets/sadd.d.ts +0 -9
- package/dist/commanders/custom/commands/redis/data/sets/sadd.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/sets/scard.d.ts +0 -5
- package/dist/commanders/custom/commands/redis/data/sets/scard.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/sets/sdiff.d.ts +0 -8
- package/dist/commanders/custom/commands/redis/data/sets/sdiff.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/sets/sinter.d.ts +0 -8
- package/dist/commanders/custom/commands/redis/data/sets/sinter.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/sets/sismember.d.ts +0 -8
- package/dist/commanders/custom/commands/redis/data/sets/sismember.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/sets/smembers.d.ts +0 -5
- package/dist/commanders/custom/commands/redis/data/sets/smembers.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/sets/smove.d.ts +0 -9
- package/dist/commanders/custom/commands/redis/data/sets/smove.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/sets/spop.d.ts +0 -5
- package/dist/commanders/custom/commands/redis/data/sets/spop.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/sets/srandmember.d.ts +0 -8
- package/dist/commanders/custom/commands/redis/data/sets/srandmember.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/sets/srem.d.ts +0 -9
- package/dist/commanders/custom/commands/redis/data/sets/srem.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/sets/sunion.d.ts +0 -8
- package/dist/commanders/custom/commands/redis/data/sets/sunion.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/strings/append.d.ts +0 -8
- package/dist/commanders/custom/commands/redis/data/strings/append.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/strings/decr.d.ts +0 -5
- package/dist/commanders/custom/commands/redis/data/strings/decr.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/strings/decrby.d.ts +0 -8
- package/dist/commanders/custom/commands/redis/data/strings/decrby.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/strings/get.d.ts +0 -5
- package/dist/commanders/custom/commands/redis/data/strings/get.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/strings/getset.d.ts +0 -8
- package/dist/commanders/custom/commands/redis/data/strings/getset.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/strings/incr.d.ts +0 -5
- package/dist/commanders/custom/commands/redis/data/strings/incr.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/strings/incrby.d.ts +0 -8
- package/dist/commanders/custom/commands/redis/data/strings/incrby.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/strings/incrbyfloat.d.ts +0 -8
- package/dist/commanders/custom/commands/redis/data/strings/incrbyfloat.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/strings/index.d.ts +0 -14
- package/dist/commanders/custom/commands/redis/data/strings/index.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/strings/mget.d.ts +0 -8
- package/dist/commanders/custom/commands/redis/data/strings/mget.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/strings/mset.d.ts +0 -9
- package/dist/commanders/custom/commands/redis/data/strings/mset.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/strings/msetnx.d.ts +0 -9
- package/dist/commanders/custom/commands/redis/data/strings/msetnx.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/strings/set.d.ts +0 -29
- package/dist/commanders/custom/commands/redis/data/strings/set.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/strings/strlen.d.ts +0 -5
- package/dist/commanders/custom/commands/redis/data/strings/strlen.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/zsets/index.d.ts +0 -12
- package/dist/commanders/custom/commands/redis/data/zsets/index.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/zsets/zadd.d.ts +0 -10
- package/dist/commanders/custom/commands/redis/data/zsets/zadd.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/zsets/zcard.d.ts +0 -5
- package/dist/commanders/custom/commands/redis/data/zsets/zcard.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/zsets/zincrby.d.ts +0 -9
- package/dist/commanders/custom/commands/redis/data/zsets/zincrby.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/zsets/zrange.d.ts +0 -10
- package/dist/commanders/custom/commands/redis/data/zsets/zrange.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/zsets/zrangebyscore.d.ts +0 -9
- package/dist/commanders/custom/commands/redis/data/zsets/zrangebyscore.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/zsets/zrank.d.ts +0 -8
- package/dist/commanders/custom/commands/redis/data/zsets/zrank.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/zsets/zrem.d.ts +0 -9
- package/dist/commanders/custom/commands/redis/data/zsets/zrem.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/zsets/zremrangebyscore.d.ts +0 -9
- package/dist/commanders/custom/commands/redis/data/zsets/zremrangebyscore.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/zsets/zrevrange.d.ts +0 -10
- package/dist/commanders/custom/commands/redis/data/zsets/zrevrange.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/zsets/zrevrank.d.ts +0 -8
- package/dist/commanders/custom/commands/redis/data/zsets/zrevrank.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/data/zsets/zscore.d.ts +0 -8
- package/dist/commanders/custom/commands/redis/data/zsets/zscore.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/index.d.ts +0 -39
- package/dist/commanders/custom/commands/redis/index.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/info.d.ts +0 -7
- package/dist/commanders/custom/commands/redis/info.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/monitor.d.ts +0 -5
- package/dist/commanders/custom/commands/redis/monitor.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/ping.d.ts +0 -7
- package/dist/commanders/custom/commands/redis/ping.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/quit.d.ts +0 -5
- package/dist/commanders/custom/commands/redis/quit.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/script/debug.d.ts +0 -7
- package/dist/commanders/custom/commands/redis/script/debug.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/script/eval.d.ts +0 -7
- package/dist/commanders/custom/commands/redis/script/eval.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/script/evalsha.d.ts +0 -7
- package/dist/commanders/custom/commands/redis/script/evalsha.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/script/exists.d.ts +0 -8
- package/dist/commanders/custom/commands/redis/script/exists.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/script/flush.d.ts +0 -7
- package/dist/commanders/custom/commands/redis/script/flush.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/script/help.d.ts +0 -5
- package/dist/commanders/custom/commands/redis/script/help.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/script/index.d.ts +0 -8
- package/dist/commanders/custom/commands/redis/script/index.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/script/kill.d.ts +0 -5
- package/dist/commanders/custom/commands/redis/script/kill.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/script/load.d.ts +0 -5
- package/dist/commanders/custom/commands/redis/script/load.d.ts.map +0 -1
- package/dist/commanders/custom/commands/redis/script/lua-reply.d.ts +0 -8
- package/dist/commanders/custom/commands/redis/script/lua-reply.d.ts.map +0 -1
- package/dist/commanders/custom/commands/registry.d.ts +0 -84
- package/dist/commanders/custom/commands/registry.d.ts.map +0 -1
- package/dist/commanders/custom/data-structures/hash.d.ts +0 -16
- package/dist/commanders/custom/data-structures/hash.d.ts.map +0 -1
- package/dist/commanders/custom/data-structures/list.d.ts +0 -15
- package/dist/commanders/custom/data-structures/list.d.ts.map +0 -1
- package/dist/commanders/custom/data-structures/set.d.ts +0 -16
- package/dist/commanders/custom/data-structures/set.d.ts.map +0 -1
- package/dist/commanders/custom/data-structures/stream.d.ts +0 -3
- package/dist/commanders/custom/data-structures/stream.d.ts.map +0 -1
- package/dist/commanders/custom/data-structures/string.d.ts +0 -5
- package/dist/commanders/custom/data-structures/string.d.ts.map +0 -1
- package/dist/commanders/custom/data-structures/zset.d.ts +0 -17
- package/dist/commanders/custom/data-structures/zset.d.ts.map +0 -1
- package/dist/commanders/custom/db.d.ts +0 -67
- package/dist/commanders/custom/db.d.ts.map +0 -1
- package/dist/commanders/custom/execution-context.d.ts +0 -12
- package/dist/commanders/custom/execution-context.d.ts.map +0 -1
- package/dist/commanders/custom/lua-runtime.d.ts +0 -16
- package/dist/commanders/custom/lua-runtime.d.ts.map +0 -1
- package/dist/commanders/custom/redis-kernel.d.ts +0 -46
- package/dist/commanders/custom/redis-kernel.d.ts.map +0 -1
- package/dist/commanders/custom/schema/builder.d.ts +0 -24
- package/dist/commanders/custom/schema/builder.d.ts.map +0 -1
- package/dist/commanders/custom/schema/command-adapter.d.ts +0 -25
- package/dist/commanders/custom/schema/command-adapter.d.ts.map +0 -1
- package/dist/commanders/custom/schema/index.d.ts +0 -7
- package/dist/commanders/custom/schema/index.d.ts.map +0 -1
- package/dist/commanders/custom/schema/input-mapper.d.ts +0 -28
- package/dist/commanders/custom/schema/input-mapper.d.ts.map +0 -1
- package/dist/commanders/custom/schema/registry.d.ts +0 -13
- package/dist/commanders/custom/schema/registry.d.ts.map +0 -1
- package/dist/commanders/custom/schema/resp-input-mapper.d.ts +0 -20
- package/dist/commanders/custom/schema/resp-input-mapper.d.ts.map +0 -1
- package/dist/commanders/custom/schema/types.d.ts +0 -43
- package/dist/commanders/custom/schema/types.d.ts.map +0 -1
- package/dist/core/cluster/network.d.ts +0 -24
- package/dist/core/cluster/network.d.ts.map +0 -1
- package/dist/core/errors.d.ts +0 -87
- package/dist/core/errors.d.ts.map +0 -1
- package/dist/core/transports/buffered-transport.d.ts +0 -14
- package/dist/core/transports/buffered-transport.d.ts.map +0 -1
- package/dist/core/transports/capturing-transport.d.ts +0 -19
- package/dist/core/transports/capturing-transport.d.ts.map +0 -1
- package/dist/core/transports/command-validator.d.ts +0 -12
- package/dist/core/transports/command-validator.d.ts.map +0 -1
- package/dist/core/transports/resp2/adapter.d.ts +0 -32
- package/dist/core/transports/resp2/adapter.d.ts.map +0 -1
- package/dist/core/transports/session-state.d.ts +0 -76
- package/dist/core/transports/session-state.d.ts.map +0 -1
- package/dist/core/transports/session.d.ts +0 -36
- package/dist/core/transports/session.d.ts.map +0 -1
- package/dist/index.cjs +0 -5759
- package/dist/index.cjs.map +0 -1
- package/dist/index.mjs +0 -5749
- package/dist/index.mjs.map +0 -1
- package/dist/types.d.ts +0 -54
- package/dist/types.d.ts.map +0 -1
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { CommandSchema } from './command-schema';
|
|
2
|
+
import type { RedisExecutionContext } from './redis-context';
|
|
3
|
+
import type { RedisResult } from './redis-result';
|
|
4
|
+
import type { ResponseStream } from './response-stream';
|
|
5
|
+
export type CommandFlag = 'readonly' | 'write' | 'denyoom' | 'admin' | 'noscript' | 'random' | 'blocking' | 'fast' | 'movablekeys' | 'transaction' | 'pubsub' | 'subscribed';
|
|
6
|
+
export type CommandCapabilities = {
|
|
7
|
+
blocking?: boolean;
|
|
8
|
+
pushOnly?: boolean;
|
|
9
|
+
movableKeys?: boolean;
|
|
10
|
+
scriptKeys?: boolean;
|
|
11
|
+
};
|
|
12
|
+
export type CommandKeySpec = {
|
|
13
|
+
flags: readonly string[];
|
|
14
|
+
beginSearchIndex: number;
|
|
15
|
+
lastKey: number;
|
|
16
|
+
keyStep: number;
|
|
17
|
+
limit?: number;
|
|
18
|
+
notes?: string;
|
|
19
|
+
};
|
|
20
|
+
export type CommandDocumentation = {
|
|
21
|
+
summary: string;
|
|
22
|
+
since?: string;
|
|
23
|
+
group: string;
|
|
24
|
+
complexity?: string;
|
|
25
|
+
arguments?: readonly CommandDocumentationArgument[];
|
|
26
|
+
};
|
|
27
|
+
export type CommandDocumentationArgument = {
|
|
28
|
+
name: string;
|
|
29
|
+
type: string;
|
|
30
|
+
keySpecIndex?: number;
|
|
31
|
+
token?: string;
|
|
32
|
+
flags?: readonly string[];
|
|
33
|
+
};
|
|
34
|
+
export type CommandIntrospection = {
|
|
35
|
+
name?: string;
|
|
36
|
+
arity: number;
|
|
37
|
+
flags?: readonly string[];
|
|
38
|
+
firstKey?: number;
|
|
39
|
+
lastKey?: number;
|
|
40
|
+
keyStep?: number;
|
|
41
|
+
categories?: readonly string[];
|
|
42
|
+
tips?: readonly string[];
|
|
43
|
+
keySpecs?: readonly CommandKeySpec[];
|
|
44
|
+
subcommands?: readonly CommandIntrospection[];
|
|
45
|
+
docs?: CommandDocumentation;
|
|
46
|
+
};
|
|
47
|
+
export type CommandExecutionResult = RedisResult | Promise<RedisResult> | ResponseStream;
|
|
48
|
+
export interface CommandDefinition<TArgs = unknown> {
|
|
49
|
+
readonly name: string;
|
|
50
|
+
readonly schema: CommandSchema<TArgs>;
|
|
51
|
+
readonly flags: readonly CommandFlag[];
|
|
52
|
+
readonly capabilities?: CommandCapabilities;
|
|
53
|
+
readonly introspection?: CommandIntrospection;
|
|
54
|
+
keys(args: TArgs): readonly Buffer[];
|
|
55
|
+
execute(args: TArgs, ctx: RedisExecutionContext): CommandExecutionResult;
|
|
56
|
+
}
|
|
57
|
+
export type CommandPlan<TArgs = unknown> = {
|
|
58
|
+
definition: CommandDefinition<TArgs>;
|
|
59
|
+
args: TArgs;
|
|
60
|
+
keys: readonly Buffer[];
|
|
61
|
+
flags: readonly CommandFlag[];
|
|
62
|
+
};
|
|
63
|
+
export declare function defineCommand<TArgs>(definition: CommandDefinition<TArgs>): CommandDefinition<TArgs>;
|
|
64
|
+
//# sourceMappingURL=command-definition.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-definition.d.ts","sourceRoot":"","sources":["../../src/core/command-definition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AAC5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AACjD,OAAO,KAAK,EAAE,cAA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AAK,CAAC,CAK1B"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.defineCommand = defineCommand;
|
|
4
|
+
function defineCommand(definition) {
|
|
5
|
+
return {
|
|
6
|
+
...definition,
|
|
7
|
+
name: definition.name.toLowerCase(),
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=command-definition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-definition.js","sourceRoot":"","sources":["../../src/core/command-definition.ts"],"names":[],"mappings":";;AAuFA,sCAOC;AAPD,SAAgB,aAAa,CAC3B,UAAoC;IAEpC,OAAO;QACL,GAAG,UAAU;QACb,IAAI,EAAE,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE;KACpC,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { CommandDefinition, CommandPlan } from './command-definition';
|
|
2
|
+
import { CommandRegistry } from './command-registry';
|
|
3
|
+
import type { ExecutionPolicy } from './execution-policies';
|
|
4
|
+
import type { RedisExecutionContext } from './redis-context';
|
|
5
|
+
import { RedisResult } from './redis-result';
|
|
6
|
+
import { ResponseStream } from './response-stream';
|
|
7
|
+
/**
|
|
8
|
+
* The result of running a command: either a finished {@link RedisResult} or a
|
|
9
|
+
* long-lived {@link ResponseStream} (e.g. SUBSCRIBE / MONITOR) whose frames the
|
|
10
|
+
* transport drains over time.
|
|
11
|
+
*/
|
|
12
|
+
export type ExecutorResult = RedisResult | ResponseStream;
|
|
13
|
+
export type CommandExecutorOptions = {
|
|
14
|
+
registry: CommandRegistry;
|
|
15
|
+
policies?: readonly ExecutionPolicy[];
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Central command pipeline shared by every client session.
|
|
19
|
+
*
|
|
20
|
+
* Responsibilities:
|
|
21
|
+
* 1. Resolve a raw command name to a {@link CommandDefinition} (case-insensitive).
|
|
22
|
+
* 2. Parse raw argument buffers into typed args and extract routing keys,
|
|
23
|
+
* producing a {@link CommandPlan}.
|
|
24
|
+
* 3. Run the configured {@link ExecutionPolicy} chain around the command's own
|
|
25
|
+
* `execute`, giving policies (transaction, cluster, ...) a chance to
|
|
26
|
+
* short-circuit, rewrite, or wrap the result.
|
|
27
|
+
*
|
|
28
|
+
* Two execution paths exist on purpose:
|
|
29
|
+
* - {@link executePlan} / {@link executeRaw} — async, used for real network
|
|
30
|
+
* clients; may return a {@link ResponseStream} and may await async commands.
|
|
31
|
+
* - {@link executePlanSync} — synchronous mirror used by the Lua runtime, where
|
|
32
|
+
* `redis.call` must complete in a single tick. Streams and promises are
|
|
33
|
+
* rejected rather than awaited.
|
|
34
|
+
*
|
|
35
|
+
* The executor is stateless per-call: all mutable state lives on the
|
|
36
|
+
* {@link RedisExecutionContext} (and the session it carries).
|
|
37
|
+
*/
|
|
38
|
+
export declare class CommandExecutor {
|
|
39
|
+
private readonly registry;
|
|
40
|
+
private readonly policies;
|
|
41
|
+
constructor(options: CommandExecutorOptions);
|
|
42
|
+
getCommandDefinition(name: string): CommandDefinition<unknown> | undefined;
|
|
43
|
+
getCommandDefinitions(): readonly CommandDefinition<unknown>[];
|
|
44
|
+
/**
|
|
45
|
+
* Resolve a raw command + args into a {@link CommandPlan} without executing it.
|
|
46
|
+
* The command name is matched case-insensitively against the registry.
|
|
47
|
+
*
|
|
48
|
+
* @throws {UnknownRedisCommandError} if no command is registered under the name.
|
|
49
|
+
*/
|
|
50
|
+
plan(rawCommand: Buffer | string, rawArgs: readonly Buffer[]): CommandPlan;
|
|
51
|
+
/**
|
|
52
|
+
* Plan and execute a raw command in one step — the normal entry point for a
|
|
53
|
+
* network client.
|
|
54
|
+
*
|
|
55
|
+
* Errors thrown during *planning* (unknown command, arity/parse failures) are
|
|
56
|
+
* caught here and converted into a RESP error reply. Such a failure also marks
|
|
57
|
+
* any open MULTI transaction dirty so a later EXEC is aborted, matching Redis:
|
|
58
|
+
* a command that cannot even be parsed must not silently vanish from the queue.
|
|
59
|
+
* Execution-time errors are handled inside {@link executePlan}.
|
|
60
|
+
*/
|
|
61
|
+
executeRaw(rawCommand: Buffer | string, rawArgs: readonly Buffer[], ctx: RedisExecutionContext): Promise<ExecutorResult>;
|
|
62
|
+
private static normalizeCommandName;
|
|
63
|
+
/**
|
|
64
|
+
* Run a pre-built plan through the full async pipeline.
|
|
65
|
+
*
|
|
66
|
+
* Order of operations:
|
|
67
|
+
* 1. `beforeExecute` for each policy. The first policy that returns a result
|
|
68
|
+
* short-circuits execution (e.g. the transaction policy queues the command
|
|
69
|
+
* and returns "+QUEUED"; the cluster policy returns a MOVED/CROSSSLOT
|
|
70
|
+
* error). A short-circuit error during MULTI also dirties the transaction.
|
|
71
|
+
* 2. The command's own `execute`.
|
|
72
|
+
* 3. If a {@link ResponseStream} is produced, run it through every policy's
|
|
73
|
+
* `onStream` hook; otherwise await the value and run it through every
|
|
74
|
+
* `afterExecute` hook (each may replace the result).
|
|
75
|
+
*
|
|
76
|
+
* Execution-time {@link RedisCommandError}s become RESP error replies (and
|
|
77
|
+
* dirty an open transaction when appropriate). Non-Redis errors propagate.
|
|
78
|
+
*/
|
|
79
|
+
executePlan(plan: CommandPlan, ctx: RedisExecutionContext): Promise<ExecutorResult>;
|
|
80
|
+
/**
|
|
81
|
+
* Synchronous counterpart to {@link executePlan}, used by the Lua runtime for
|
|
82
|
+
* `redis.call` / `redis.pcall`. Lua expects each nested command to resolve
|
|
83
|
+
* immediately, so anything that would require awaiting — a command that
|
|
84
|
+
* returns a promise, a {@link ResponseStream}, or an async policy hook — is
|
|
85
|
+
* rejected with a {@link RedisCommandError} instead of being awaited. Async
|
|
86
|
+
* command definitions are rejected before invocation so they cannot leave
|
|
87
|
+
* orphaned work running after the script error (see
|
|
88
|
+
* {@link assertSyncCommandDefinition}, {@link assertSyncCommandResult}, and
|
|
89
|
+
* {@link assertSyncPolicyResult}).
|
|
90
|
+
*
|
|
91
|
+
* The policy chain and transaction-dirty handling otherwise mirror the async
|
|
92
|
+
* path exactly.
|
|
93
|
+
*/
|
|
94
|
+
executePlanSync(plan: CommandPlan, ctx: RedisExecutionContext): RedisResult;
|
|
95
|
+
/**
|
|
96
|
+
* Build a {@link CommandPlan} from a resolved definition: parse the raw buffers
|
|
97
|
+
* against the command's schema (may throw arity/type errors) and extract the
|
|
98
|
+
* routing keys used for cluster slot validation. Flags are copied onto the plan
|
|
99
|
+
* so policies can inspect them without re-resolving the definition.
|
|
100
|
+
*/
|
|
101
|
+
private createPlan;
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=command-executor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-executor.d.ts","sourceRoot":"","sources":["../../src/core/command-executor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAEpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAO3D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAoB,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAEpE;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG,cAAc,CAAA;AAEzD,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,EAAE,eAAe,CAAA;IACzB,QAAQ,CAAC,EAAE,SAAS,eAAe,EAAE,CAAA;CACtC,CAAA;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAiB;IAC1C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA4B;gBAEzC,OAAO,EAAE,sBAAsB;IAK3C,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,iBAAiB,CAAC,OAAO,CAAC,GAAG,SAAS;IAI1E,qBAAqB,IAAI,SAAS,iBAAiB,CAAC,OAAO,CAAC,EAAE;IAI9D;;;;;OAKG;IACH,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,WAAW;IAW1E;;;;;;;;;OASG;IACG,UAAU,CACd,UAAU,EAAE,MAAM,GAAG,MAAM,EAC3B,OAAO,EAAE,SAAS,MAAM,EAAE,EAC1B,GAAG,EAAE,qBAAqB,GACzB,OAAO,CAAC,cAAc,CAAC;IA2B1B,OAAO,CAAC,MAAM,CAAC,oBAAoB;IAMnC;;;;;;;;;;;;;;;OAeG;IACG,WAAW,CACf,IAAI,EAAE,WAAW,EACjB,GAAG,EAAE,qBAAqB,GACzB,OAAO,CAAC,cAAc,CAAC;IAgD1B;;;;;;;;;;;;;OAaG;IACH,eAAe,CAAC,IAAI,EAAE,WAAW,EAAE,GAAG,EAAE,qBAAqB,GAAG,WAAW;IA6C3E;;;;;OAKG;IACH,OAAO,CAAC,UAAU;CAcnB"}
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CommandExecutor = void 0;
|
|
4
|
+
const command_schema_1 = require("./command-schema");
|
|
5
|
+
const redis_error_1 = require("./redis-error");
|
|
6
|
+
const redis_result_1 = require("./redis-result");
|
|
7
|
+
const response_stream_1 = require("./response-stream");
|
|
8
|
+
/**
|
|
9
|
+
* Central command pipeline shared by every client session.
|
|
10
|
+
*
|
|
11
|
+
* Responsibilities:
|
|
12
|
+
* 1. Resolve a raw command name to a {@link CommandDefinition} (case-insensitive).
|
|
13
|
+
* 2. Parse raw argument buffers into typed args and extract routing keys,
|
|
14
|
+
* producing a {@link CommandPlan}.
|
|
15
|
+
* 3. Run the configured {@link ExecutionPolicy} chain around the command's own
|
|
16
|
+
* `execute`, giving policies (transaction, cluster, ...) a chance to
|
|
17
|
+
* short-circuit, rewrite, or wrap the result.
|
|
18
|
+
*
|
|
19
|
+
* Two execution paths exist on purpose:
|
|
20
|
+
* - {@link executePlan} / {@link executeRaw} — async, used for real network
|
|
21
|
+
* clients; may return a {@link ResponseStream} and may await async commands.
|
|
22
|
+
* - {@link executePlanSync} — synchronous mirror used by the Lua runtime, where
|
|
23
|
+
* `redis.call` must complete in a single tick. Streams and promises are
|
|
24
|
+
* rejected rather than awaited.
|
|
25
|
+
*
|
|
26
|
+
* The executor is stateless per-call: all mutable state lives on the
|
|
27
|
+
* {@link RedisExecutionContext} (and the session it carries).
|
|
28
|
+
*/
|
|
29
|
+
class CommandExecutor {
|
|
30
|
+
registry;
|
|
31
|
+
policies;
|
|
32
|
+
constructor(options) {
|
|
33
|
+
this.registry = options.registry;
|
|
34
|
+
this.policies = options.policies ?? [];
|
|
35
|
+
}
|
|
36
|
+
getCommandDefinition(name) {
|
|
37
|
+
return this.registry.get(name);
|
|
38
|
+
}
|
|
39
|
+
getCommandDefinitions() {
|
|
40
|
+
return this.registry.getAll();
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Resolve a raw command + args into a {@link CommandPlan} without executing it.
|
|
44
|
+
* The command name is matched case-insensitively against the registry.
|
|
45
|
+
*
|
|
46
|
+
* @throws {UnknownRedisCommandError} if no command is registered under the name.
|
|
47
|
+
*/
|
|
48
|
+
plan(rawCommand, rawArgs) {
|
|
49
|
+
const commandName = CommandExecutor.normalizeCommandName(rawCommand);
|
|
50
|
+
const definition = this.registry.get(commandName);
|
|
51
|
+
if (!definition) {
|
|
52
|
+
throw new redis_error_1.UnknownRedisCommandError(rawCommand, rawArgs);
|
|
53
|
+
}
|
|
54
|
+
return this.createPlan(definition, rawArgs);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Plan and execute a raw command in one step — the normal entry point for a
|
|
58
|
+
* network client.
|
|
59
|
+
*
|
|
60
|
+
* Errors thrown during *planning* (unknown command, arity/parse failures) are
|
|
61
|
+
* caught here and converted into a RESP error reply. Such a failure also marks
|
|
62
|
+
* any open MULTI transaction dirty so a later EXEC is aborted, matching Redis:
|
|
63
|
+
* a command that cannot even be parsed must not silently vanish from the queue.
|
|
64
|
+
* Execution-time errors are handled inside {@link executePlan}.
|
|
65
|
+
*/
|
|
66
|
+
async executeRaw(rawCommand, rawArgs, ctx) {
|
|
67
|
+
try {
|
|
68
|
+
return await this.executePlan(this.plan(rawCommand, rawArgs), ctx);
|
|
69
|
+
}
|
|
70
|
+
catch (err) {
|
|
71
|
+
if (err instanceof redis_error_1.RedisCommandError) {
|
|
72
|
+
// EXEC itself with bad arity (e.g. `EXEC foo`) discards the
|
|
73
|
+
// transaction immediately and replies EXECABORT, matching Redis'
|
|
74
|
+
// execCommandAbort — distinct from a *queued* command's arity error,
|
|
75
|
+
// which only dirties the transaction for a later, well-formed EXEC.
|
|
76
|
+
if (err instanceof redis_error_1.WrongNumberOfArgumentsError &&
|
|
77
|
+
ctx.session.mode === 'transaction' &&
|
|
78
|
+
CommandExecutor.normalizeCommandName(rawCommand) === 'exec') {
|
|
79
|
+
ctx.session.discardTransaction();
|
|
80
|
+
const abortError = new redis_error_1.ExecCommandAbortError(err.message);
|
|
81
|
+
return redis_result_1.RedisResult.error(abortError.message, abortError.code);
|
|
82
|
+
}
|
|
83
|
+
ctx.session.markTransactionDirty();
|
|
84
|
+
return redis_result_1.RedisResult.error(err.message, err.code);
|
|
85
|
+
}
|
|
86
|
+
throw err;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
static normalizeCommandName(rawCommand) {
|
|
90
|
+
return typeof rawCommand === 'string'
|
|
91
|
+
? rawCommand.toLowerCase()
|
|
92
|
+
: rawCommand.toString().toLowerCase();
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Run a pre-built plan through the full async pipeline.
|
|
96
|
+
*
|
|
97
|
+
* Order of operations:
|
|
98
|
+
* 1. `beforeExecute` for each policy. The first policy that returns a result
|
|
99
|
+
* short-circuits execution (e.g. the transaction policy queues the command
|
|
100
|
+
* and returns "+QUEUED"; the cluster policy returns a MOVED/CROSSSLOT
|
|
101
|
+
* error). A short-circuit error during MULTI also dirties the transaction.
|
|
102
|
+
* 2. The command's own `execute`.
|
|
103
|
+
* 3. If a {@link ResponseStream} is produced, run it through every policy's
|
|
104
|
+
* `onStream` hook; otherwise await the value and run it through every
|
|
105
|
+
* `afterExecute` hook (each may replace the result).
|
|
106
|
+
*
|
|
107
|
+
* Execution-time {@link RedisCommandError}s become RESP error replies (and
|
|
108
|
+
* dirty an open transaction when appropriate). Non-Redis errors propagate.
|
|
109
|
+
*/
|
|
110
|
+
async executePlan(plan, ctx) {
|
|
111
|
+
try {
|
|
112
|
+
for (const policy of this.policies) {
|
|
113
|
+
const policyResult = await policy.beforeExecute?.(plan, ctx);
|
|
114
|
+
if (policyResult) {
|
|
115
|
+
if (isTransactionQueueError(plan, ctx, policyResult)) {
|
|
116
|
+
ctx.session.markTransactionDirty();
|
|
117
|
+
}
|
|
118
|
+
return policyResult;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
const rawResult = plan.definition.execute(plan.args, ctx);
|
|
122
|
+
if ((0, response_stream_1.isResponseStream)(rawResult)) {
|
|
123
|
+
let finalStream = ensureNonThenableStream(rawResult);
|
|
124
|
+
for (const policy of this.policies) {
|
|
125
|
+
finalStream =
|
|
126
|
+
(await policy.onStream?.(plan, ctx, finalStream)) ?? finalStream;
|
|
127
|
+
finalStream = ensureNonThenableStream(finalStream);
|
|
128
|
+
}
|
|
129
|
+
return finalStream;
|
|
130
|
+
}
|
|
131
|
+
const result = await rawResult;
|
|
132
|
+
let finalResult = result;
|
|
133
|
+
for (const policy of this.policies) {
|
|
134
|
+
finalResult =
|
|
135
|
+
(await policy.afterExecute?.(plan, ctx, finalResult)) ?? finalResult;
|
|
136
|
+
}
|
|
137
|
+
return finalResult;
|
|
138
|
+
}
|
|
139
|
+
catch (err) {
|
|
140
|
+
if (err instanceof redis_error_1.RedisCommandError) {
|
|
141
|
+
if (shouldDirtyTransaction(plan, ctx)) {
|
|
142
|
+
ctx.session.markTransactionDirty();
|
|
143
|
+
}
|
|
144
|
+
return redis_result_1.RedisResult.error(err.message, err.code);
|
|
145
|
+
}
|
|
146
|
+
throw err;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Synchronous counterpart to {@link executePlan}, used by the Lua runtime for
|
|
151
|
+
* `redis.call` / `redis.pcall`. Lua expects each nested command to resolve
|
|
152
|
+
* immediately, so anything that would require awaiting — a command that
|
|
153
|
+
* returns a promise, a {@link ResponseStream}, or an async policy hook — is
|
|
154
|
+
* rejected with a {@link RedisCommandError} instead of being awaited. Async
|
|
155
|
+
* command definitions are rejected before invocation so they cannot leave
|
|
156
|
+
* orphaned work running after the script error (see
|
|
157
|
+
* {@link assertSyncCommandDefinition}, {@link assertSyncCommandResult}, and
|
|
158
|
+
* {@link assertSyncPolicyResult}).
|
|
159
|
+
*
|
|
160
|
+
* The policy chain and transaction-dirty handling otherwise mirror the async
|
|
161
|
+
* path exactly.
|
|
162
|
+
*/
|
|
163
|
+
executePlanSync(plan, ctx) {
|
|
164
|
+
try {
|
|
165
|
+
for (const policy of this.policies) {
|
|
166
|
+
const policyResult = assertSyncPolicyResult(policy.name, 'beforeExecute', policy.beforeExecute?.(plan, ctx));
|
|
167
|
+
if (policyResult) {
|
|
168
|
+
if (isTransactionQueueError(plan, ctx, policyResult)) {
|
|
169
|
+
ctx.session.markTransactionDirty();
|
|
170
|
+
}
|
|
171
|
+
return policyResult;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
assertSyncCommandDefinition(plan);
|
|
175
|
+
const rawResult = plan.definition.execute(plan.args, ctx);
|
|
176
|
+
const result = assertSyncCommandResult(plan, rawResult);
|
|
177
|
+
let finalResult = result;
|
|
178
|
+
for (const policy of this.policies) {
|
|
179
|
+
finalResult =
|
|
180
|
+
assertSyncPolicyResult(policy.name, 'afterExecute', policy.afterExecute?.(plan, ctx, finalResult)) ?? finalResult;
|
|
181
|
+
}
|
|
182
|
+
return finalResult;
|
|
183
|
+
}
|
|
184
|
+
catch (err) {
|
|
185
|
+
if (err instanceof redis_error_1.RedisCommandError) {
|
|
186
|
+
if (shouldDirtyTransaction(plan, ctx)) {
|
|
187
|
+
ctx.session.markTransactionDirty();
|
|
188
|
+
}
|
|
189
|
+
return redis_result_1.RedisResult.error(err.message, err.code);
|
|
190
|
+
}
|
|
191
|
+
throw err;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Build a {@link CommandPlan} from a resolved definition: parse the raw buffers
|
|
196
|
+
* against the command's schema (may throw arity/type errors) and extract the
|
|
197
|
+
* routing keys used for cluster slot validation. Flags are copied onto the plan
|
|
198
|
+
* so policies can inspect them without re-resolving the definition.
|
|
199
|
+
*/
|
|
200
|
+
createPlan(definition, rawArgs) {
|
|
201
|
+
const args = (0, command_schema_1.parseCommandArgs)(definition.schema, rawArgs, definition.name);
|
|
202
|
+
const keys = definition.keys(args);
|
|
203
|
+
return {
|
|
204
|
+
definition,
|
|
205
|
+
args,
|
|
206
|
+
keys,
|
|
207
|
+
flags: definition.flags,
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
exports.CommandExecutor = CommandExecutor;
|
|
212
|
+
/**
|
|
213
|
+
* A policy's `onStream` hook may return an object that is both a
|
|
214
|
+
* {@link ResponseStream} and thenable (e.g. an async wrapper). Callers `await`
|
|
215
|
+
* the executor result, and awaiting a thenable stream would unwrap it into its
|
|
216
|
+
* resolved value, breaking streaming. This re-wraps such a stream in a plain,
|
|
217
|
+
* non-thenable object so it survives the surrounding `await` untouched.
|
|
218
|
+
*/
|
|
219
|
+
function ensureNonThenableStream(stream) {
|
|
220
|
+
if (!('then' in stream)) {
|
|
221
|
+
return stream;
|
|
222
|
+
}
|
|
223
|
+
return {
|
|
224
|
+
kind: 'response-stream',
|
|
225
|
+
get closed() {
|
|
226
|
+
return stream.closed;
|
|
227
|
+
},
|
|
228
|
+
frames: signal => stream.frames(signal),
|
|
229
|
+
close: reason => stream.close(reason),
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Guard for the synchronous (Lua) path: a command's result must be a ready
|
|
234
|
+
* {@link RedisResult}. Streaming commands and async commands are not callable
|
|
235
|
+
* from scripts, so a stream is closed and both cases are surfaced as a
|
|
236
|
+
* script-facing {@link RedisCommandError}.
|
|
237
|
+
*/
|
|
238
|
+
function assertSyncCommandResult(plan, result) {
|
|
239
|
+
if ((0, response_stream_1.isResponseStream)(result)) {
|
|
240
|
+
result.close('Lua redis.call cannot run streaming commands');
|
|
241
|
+
throw new redis_error_1.RedisCommandError(`${plan.definition.name.toUpperCase()} is not allowed from scripts`);
|
|
242
|
+
}
|
|
243
|
+
if (isThenable(result)) {
|
|
244
|
+
throw new redis_error_1.RedisCommandError(`${plan.definition.name.toUpperCase()} cannot run asynchronously from scripts`);
|
|
245
|
+
}
|
|
246
|
+
return result;
|
|
247
|
+
}
|
|
248
|
+
function assertSyncCommandDefinition(plan) {
|
|
249
|
+
if (!isAsyncFunction(plan.definition.execute)) {
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
throw new redis_error_1.RedisCommandError(`${plan.definition.name.toUpperCase()} cannot run asynchronously from scripts`);
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Same idea as {@link assertSyncCommandResult} but for policy hooks: an async
|
|
256
|
+
* hook result cannot be awaited on the Lua path, so it is rejected with a
|
|
257
|
+
* descriptive {@link RedisCommandError} naming the offending policy and hook.
|
|
258
|
+
*/
|
|
259
|
+
function assertSyncPolicyResult(policyName, hookName, value) {
|
|
260
|
+
if (isThenable(value)) {
|
|
261
|
+
throw new redis_error_1.RedisCommandError(`Execution policy '${policyName}' ${hookName} hook cannot run asynchronously from scripts`);
|
|
262
|
+
}
|
|
263
|
+
return value;
|
|
264
|
+
}
|
|
265
|
+
function isThenable(value) {
|
|
266
|
+
if (value === null || value === undefined) {
|
|
267
|
+
return false;
|
|
268
|
+
}
|
|
269
|
+
if (typeof value !== 'object' && typeof value !== 'function') {
|
|
270
|
+
return false;
|
|
271
|
+
}
|
|
272
|
+
return typeof value.then === 'function';
|
|
273
|
+
}
|
|
274
|
+
function isAsyncFunction(value) {
|
|
275
|
+
return (typeof value === 'function' && value.constructor?.name === 'AsyncFunction');
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* True when a policy short-circuit returned an error while queuing a command in
|
|
279
|
+
* MULTI — i.e. the command was rejected at queue time. Redis aborts the whole
|
|
280
|
+
* transaction on EXEC in that case, so the session must be marked dirty.
|
|
281
|
+
*/
|
|
282
|
+
function isTransactionQueueError(plan, ctx, result) {
|
|
283
|
+
return shouldDirtyTransaction(plan, ctx) && result.value.kind === 'error';
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Whether an error on this plan should dirty the current transaction.
|
|
287
|
+
*
|
|
288
|
+
* Only meaningful while the session is in `transaction` mode. Commands flagged
|
|
289
|
+
* `transaction` are the control commands themselves (MULTI/EXEC/DISCARD/WATCH);
|
|
290
|
+
* their errors must not abort the transaction, so they are excluded.
|
|
291
|
+
*/
|
|
292
|
+
function shouldDirtyTransaction(plan, ctx) {
|
|
293
|
+
return (ctx.session.mode === 'transaction' && !plan.flags.includes('transaction'));
|
|
294
|
+
}
|
|
295
|
+
//# sourceMappingURL=command-executor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-executor.js","sourceRoot":"","sources":["../../src/core/command-executor.ts"],"names":[],"mappings":";;;AAEA,qDAAmD;AAEnD,+CAKsB;AAEtB,iDAA4C;AAC5C,uDAAoE;AAcpE;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAa,eAAe;IACT,QAAQ,CAAiB;IACzB,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AAO,CACL,GAAG,CAAC,OAAO,CAAC,IAAI,KAAK,aAAa,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,CAC1E,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { CommandDefinition } from './command-definition';
|
|
2
|
+
export declare class CommandRegistry {
|
|
3
|
+
private readonly commands;
|
|
4
|
+
register<TArgs>(definition: CommandDefinition<TArgs>, options?: {
|
|
5
|
+
override?: boolean;
|
|
6
|
+
}): void;
|
|
7
|
+
override<TArgs>(definition: CommandDefinition<TArgs>): void;
|
|
8
|
+
registerAll(definitions: readonly CommandDefinition<unknown>[], options?: {
|
|
9
|
+
override?: boolean;
|
|
10
|
+
}): void;
|
|
11
|
+
get(name: string): CommandDefinition<unknown> | undefined;
|
|
12
|
+
has(name: string): boolean;
|
|
13
|
+
getAll(): CommandDefinition<unknown>[];
|
|
14
|
+
getNames(): string[];
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=command-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-registry.d.ts","sourceRoot":"","sources":["../../src/core/command-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAE7D,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAgD;IAEzE,QAAQ,CAAC,KAAK,EACZ,UAAU,EAAE,iBAAiB,CAAC,KAAK,CAAC,EACpC,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,GAC/B,IAAI;IASP,QAAQ,CAAC,KAAK,EAAE,UAAU,EAAE,iBAAiB,CAAC,KAAK,CAAC,GAAG,IAAI;IAI3D,WAAW,CACT,WAAW,EAAE,SAAS,iBAAiB,CAAC,OAAO,CAAC,EAAE,EAClD,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,GAC/B,IAAI;IAMP,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,iBAAiB,CAAC,OAAO,CAAC,GAAG,SAAS;IAIzD,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAI1B,MAAM,IAAI,iBAAiB,CAAC,OAAO,CAAC,EAAE;IAItC,QAAQ,IAAI,MAAM,EAAE;CAGrB"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CommandRegistry = void 0;
|
|
4
|
+
class CommandRegistry {
|
|
5
|
+
commands = new Map();
|
|
6
|
+
register(definition, options) {
|
|
7
|
+
const name = definition.name.toLowerCase();
|
|
8
|
+
if (!options?.override && this.commands.has(name)) {
|
|
9
|
+
throw new Error(`Command '${name}' is already registered`);
|
|
10
|
+
}
|
|
11
|
+
this.commands.set(name, definition);
|
|
12
|
+
}
|
|
13
|
+
override(definition) {
|
|
14
|
+
this.register(definition, { override: true });
|
|
15
|
+
}
|
|
16
|
+
registerAll(definitions, options) {
|
|
17
|
+
for (const definition of definitions) {
|
|
18
|
+
this.register(definition, options);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
get(name) {
|
|
22
|
+
return this.commands.get(name.toLowerCase());
|
|
23
|
+
}
|
|
24
|
+
has(name) {
|
|
25
|
+
return this.commands.has(name.toLowerCase());
|
|
26
|
+
}
|
|
27
|
+
getAll() {
|
|
28
|
+
return Array.from(this.commands.values());
|
|
29
|
+
}
|
|
30
|
+
getNames() {
|
|
31
|
+
return Array.from(this.commands.keys());
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.CommandRegistry = CommandRegistry;
|
|
35
|
+
//# sourceMappingURL=command-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-registry.js","sourceRoot":"","sources":["../../src/core/command-registry.ts"],"names":[],"mappings":";;;AAE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
|
|
|
1
|
+
export type ParseContext = {
|
|
2
|
+
commandName: string;
|
|
3
|
+
};
|
|
4
|
+
export type ParseNodeResult<TValue> = {
|
|
5
|
+
value: TValue;
|
|
6
|
+
nextIndex: number;
|
|
7
|
+
};
|
|
8
|
+
export interface CommandSchema<TValue> {
|
|
9
|
+
parse(input: readonly Buffer[], index: number, ctx: ParseContext): ParseNodeResult<TValue>;
|
|
10
|
+
}
|
|
11
|
+
export type InferSchema<TSchema> = TSchema extends CommandSchema<infer TValue> ? TValue : never;
|
|
12
|
+
type SchemaShape = Record<string, CommandSchema<unknown>>;
|
|
13
|
+
type InferShape<TShape extends SchemaShape> = {
|
|
14
|
+
[K in keyof TShape]: InferSchema<TShape[K]>;
|
|
15
|
+
};
|
|
16
|
+
export declare class SchemaMismatchError extends Error {
|
|
17
|
+
constructor();
|
|
18
|
+
}
|
|
19
|
+
export declare function parseCommandArgs<TArgs>(schema: CommandSchema<TArgs>, input: readonly Buffer[], commandName: string): TArgs;
|
|
20
|
+
export declare const t: {
|
|
21
|
+
custom<TValue>(parse: CommandSchema<TValue>["parse"]): CommandSchema<TValue>;
|
|
22
|
+
key(): CommandSchema<Buffer>;
|
|
23
|
+
bulk(): CommandSchema<Buffer>;
|
|
24
|
+
string(): CommandSchema<string>;
|
|
25
|
+
integer(options?: {
|
|
26
|
+
min?: number;
|
|
27
|
+
max?: number;
|
|
28
|
+
}): CommandSchema<number>;
|
|
29
|
+
bigInteger(options?: {
|
|
30
|
+
min?: bigint;
|
|
31
|
+
max?: bigint;
|
|
32
|
+
}): CommandSchema<bigint>;
|
|
33
|
+
float(): CommandSchema<number>;
|
|
34
|
+
keyword<TKeyword extends string>(expected: TKeyword): CommandSchema<TKeyword>;
|
|
35
|
+
optional<TValue>(schema: CommandSchema<TValue>): CommandSchema<TValue | undefined>;
|
|
36
|
+
variadic<TValue>(schema: CommandSchema<TValue>, options?: {
|
|
37
|
+
min?: number;
|
|
38
|
+
}): CommandSchema<TValue[]>;
|
|
39
|
+
object<TShape extends SchemaShape>(shape: TShape): CommandSchema<InferShape<TShape>>;
|
|
40
|
+
union<TValue>(schemas: readonly CommandSchema<TValue>[]): CommandSchema<TValue>;
|
|
41
|
+
};
|
|
42
|
+
export {};
|
|
43
|
+
//# sourceMappingURL=command-schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-schema.d.ts","sourceRoot":"","sources":["../../src/core/command-schema.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,YAAY,GAAG;IACzB,WAAW,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,MAAM,MAAM,eAAe,CAAC,MAAM,IAAI;IACpC,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,MAAM,WAAW,aAAa,CAAC,MAAM;IACnC,KAAK,CACH,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,YAAY,GAChB,eAAe,CAAC,MAAM,CAAC,CAAA;CAC3B;AAED,MAAM,MAAM,WAAW,CAAC,OAAO,IAC7B,OAAO,SAAS,aAAa,CAAC,MAAM,MAAM,CAAC,GAAG,MAAM,GAAG,KAAK,CAAA;AAE9D,KAAK,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC,CAAA;AAEzD,KAAK,UAAU,CAAC,MAAM,SAAS,WAAW,IAAI;KAC3C,CAAC,IAAI,MAAM,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;CAC5C,CAAA;AAQD,qBAAa,mBAAoB,SAAQ,KAAK;;CAI7C;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EACpC,MAAM,EAAE,aAAa,CAAC,KAAK,CAAC,EAC5B,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,WAAW,EAAE,MAAM,GAClB,KAAK,CAmBP;AAqBD,eAAO,MAAM,CAAC;WACL,MAAM,SAA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