@jsonjoy.com/json-pack 1.21.0 → 17.59.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/JsonPackExtension.d.ts +8 -0
- package/lib/JsonPackExtension.js +8 -0
- package/lib/JsonPackExtension.js.map +1 -1
- package/lib/JsonPackMpint.d.ts +25 -0
- package/lib/JsonPackMpint.js +31 -1
- package/lib/JsonPackMpint.js.map +1 -1
- package/lib/JsonPackValue.d.ts +10 -0
- package/lib/JsonPackValue.js +10 -0
- package/lib/JsonPackValue.js.map +1 -1
- package/lib/avro/AvroDecoder.d.ts +67 -0
- package/lib/avro/AvroDecoder.js +77 -5
- package/lib/avro/AvroDecoder.js.map +1 -1
- package/lib/avro/AvroEncoder.d.ts +71 -0
- package/lib/avro/AvroEncoder.js +90 -12
- package/lib/avro/AvroEncoder.js.map +1 -1
- package/lib/avro/AvroSchemaDecoder.d.ts +53 -0
- package/lib/avro/AvroSchemaDecoder.js +60 -3
- package/lib/avro/AvroSchemaDecoder.js.map +1 -1
- package/lib/avro/AvroSchemaEncoder.d.ts +65 -0
- package/lib/avro/AvroSchemaEncoder.js +84 -5
- package/lib/avro/AvroSchemaEncoder.js.map +1 -1
- package/lib/avro/AvroSchemaValidator.d.ts +10 -0
- package/lib/avro/AvroSchemaValidator.js +18 -1
- package/lib/avro/AvroSchemaValidator.js.map +1 -1
- package/lib/avro/types.d.ts +31 -0
- package/lib/avro/types.js +4 -0
- package/lib/avro/types.js.map +1 -1
- package/lib/bencode/BencodeDecoder.js +9 -9
- package/lib/bencode/BencodeDecoder.js.map +1 -1
- package/lib/bencode/BencodeEncoder.d.ts +5 -0
- package/lib/bencode/BencodeEncoder.js +25 -20
- package/lib/bencode/BencodeEncoder.js.map +1 -1
- package/lib/bson/BsonDecoder.js +48 -33
- package/lib/bson/BsonDecoder.js.map +1 -1
- package/lib/bson/BsonEncoder.js +11 -3
- package/lib/bson/BsonEncoder.js.map +1 -1
- package/lib/cbor/CborDecoder.d.ts +24 -0
- package/lib/cbor/CborDecoder.js +94 -56
- package/lib/cbor/CborDecoder.js.map +1 -1
- package/lib/cbor/CborDecoderBase.d.ts +1 -0
- package/lib/cbor/CborDecoderBase.js +63 -53
- package/lib/cbor/CborDecoderBase.js.map +1 -1
- package/lib/cbor/CborEncoder.d.ts +5 -0
- package/lib/cbor/CborEncoder.js +9 -3
- package/lib/cbor/CborEncoder.js.map +1 -1
- package/lib/cbor/CborEncoderFast.d.ts +7 -0
- package/lib/cbor/CborEncoderFast.js +22 -14
- package/lib/cbor/CborEncoderFast.js.map +1 -1
- package/lib/cbor/CborEncoderStable.d.ts +1 -0
- package/lib/cbor/CborEncoderStable.js +2 -1
- package/lib/cbor/CborEncoderStable.js.map +1 -1
- package/lib/cbor/shared.d.ts +1 -1
- package/lib/codecs/Codecs.d.ts +1 -1
- package/lib/codecs/cbor.js +1 -1
- package/lib/codecs/cbor.js.map +1 -1
- package/lib/codecs/json.js +1 -1
- package/lib/codecs/json.js.map +1 -1
- package/lib/codecs/msgpack.js +1 -1
- package/lib/codecs/msgpack.js.map +1 -1
- package/lib/ejson/EjsonDecoder.d.ts +5 -0
- package/lib/ejson/EjsonDecoder.js +72 -37
- package/lib/ejson/EjsonDecoder.js.map +1 -1
- package/lib/ejson/EjsonEncoder.d.ts +5 -0
- package/lib/ejson/EjsonEncoder.js +149 -114
- package/lib/ejson/EjsonEncoder.js.map +1 -1
- package/lib/ejson/index.js +1 -0
- package/lib/ejson/index.js.map +1 -1
- package/lib/ion/Import.d.ts +1 -1
- package/lib/ion/Import.js.map +1 -1
- package/lib/ion/IonDecoder.d.ts +0 -1
- package/lib/ion/IonDecoder.js +4 -3
- package/lib/ion/IonDecoder.js.map +1 -1
- package/lib/ion/IonDecoderBase.js +29 -18
- package/lib/ion/IonDecoderBase.js.map +1 -1
- package/lib/ion/IonEncoderFast.d.ts +1 -1
- package/lib/ion/IonEncoderFast.js +30 -30
- package/lib/ion/IonEncoderFast.js.map +1 -1
- package/lib/ion/ast.d.ts +4 -1
- package/lib/ion/symbols.d.ts +1 -1
- package/lib/json/JsonDecoder.js +72 -66
- package/lib/json/JsonDecoder.js.map +1 -1
- package/lib/json/JsonDecoderDag.js +14 -0
- package/lib/json/JsonDecoderDag.js.map +1 -1
- package/lib/json/JsonDecoderPartial.d.ts +22 -0
- package/lib/json/JsonDecoderPartial.js +30 -8
- package/lib/json/JsonDecoderPartial.js.map +1 -1
- package/lib/json/JsonEncoder.d.ts +5 -0
- package/lib/json/JsonEncoder.js +59 -51
- package/lib/json/JsonEncoder.js.map +1 -1
- package/lib/json/JsonEncoderDag.d.ts +17 -0
- package/lib/json/JsonEncoderDag.js +27 -10
- package/lib/json/JsonEncoderDag.js.map +1 -1
- package/lib/json/JsonEncoderStable.js +5 -5
- package/lib/json/JsonEncoderStable.js.map +1 -1
- package/lib/json-binary/codec.d.ts +8 -1
- package/lib/json-binary/codec.js +7 -0
- package/lib/json-binary/codec.js.map +1 -1
- package/lib/msgpack/MsgPackDecoder.d.ts +27 -0
- package/lib/msgpack/MsgPackDecoder.js +55 -23
- package/lib/msgpack/MsgPackDecoder.js.map +1 -1
- package/lib/msgpack/MsgPackDecoderFast.d.ts +8 -0
- package/lib/msgpack/MsgPackDecoderFast.js +14 -5
- package/lib/msgpack/MsgPackDecoderFast.js.map +1 -1
- package/lib/msgpack/MsgPackEncoder.d.ts +3 -0
- package/lib/msgpack/MsgPackEncoder.js +7 -4
- package/lib/msgpack/MsgPackEncoder.js.map +1 -1
- package/lib/msgpack/MsgPackEncoderFast.d.ts +26 -4
- package/lib/msgpack/MsgPackEncoderFast.js +31 -0
- package/lib/msgpack/MsgPackEncoderFast.js.map +1 -1
- package/lib/msgpack/MsgPackEncoderStable.d.ts +3 -0
- package/lib/msgpack/MsgPackEncoderStable.js +3 -0
- package/lib/msgpack/MsgPackEncoderStable.js.map +1 -1
- package/lib/msgpack/MsgPackToJsonConverter.d.ts +30 -4
- package/lib/msgpack/MsgPackToJsonConverter.js +32 -5
- package/lib/msgpack/MsgPackToJsonConverter.js.map +1 -1
- package/lib/msgpack/index.d.ts +29 -0
- package/lib/msgpack/index.js +30 -0
- package/lib/msgpack/index.js.map +1 -1
- package/lib/msgpack/shallow-read.js +7 -7
- package/lib/msgpack/shallow-read.js.map +1 -1
- package/lib/msgpack/types.d.ts +1 -0
- package/lib/msgpack/util.d.ts +1 -1
- package/lib/nfs/v3/FullNfsv3Encoder.d.ts +3 -3
- package/lib/nfs/v3/FullNfsv3Encoder.js +3 -3
- package/lib/nfs/v3/FullNfsv3Encoder.js.map +1 -1
- package/lib/nfs/v3/Nfsv3Decoder.js +51 -50
- package/lib/nfs/v3/Nfsv3Decoder.js.map +1 -1
- package/lib/nfs/v3/Nfsv3Encoder.d.ts +2 -2
- package/lib/nfs/v3/Nfsv3Encoder.js +52 -52
- package/lib/nfs/v3/Nfsv3Encoder.js.map +1 -1
- package/lib/nfs/v3/constants.d.ts +34 -0
- package/lib/nfs/v3/constants.js +4 -0
- package/lib/nfs/v3/constants.js.map +1 -1
- package/lib/nfs/v3/locks/NlmDecoder.js +20 -20
- package/lib/nfs/v3/locks/NlmDecoder.js.map +1 -1
- package/lib/nfs/v3/locks/NlmEncoder.d.ts +2 -2
- package/lib/nfs/v3/locks/NlmEncoder.js +20 -20
- package/lib/nfs/v3/locks/NlmEncoder.js.map +1 -1
- package/lib/nfs/v3/locks/constants.d.ts +9 -0
- package/lib/nfs/v3/locks/messages.d.ts +58 -1
- package/lib/nfs/v3/locks/messages.js +54 -0
- package/lib/nfs/v3/locks/messages.js.map +1 -1
- package/lib/nfs/v3/locks/structs.d.ts +15 -0
- package/lib/nfs/v3/locks/structs.js +15 -0
- package/lib/nfs/v3/locks/structs.js.map +1 -1
- package/lib/nfs/v3/messages.d.ts +249 -0
- package/lib/nfs/v3/messages.js +249 -0
- package/lib/nfs/v3/messages.js.map +1 -1
- package/lib/nfs/v3/mount/MountDecoder.js +12 -12
- package/lib/nfs/v3/mount/MountEncoder.d.ts +2 -2
- package/lib/nfs/v3/mount/MountEncoder.js +13 -13
- package/lib/nfs/v3/mount/MountEncoder.js.map +1 -1
- package/lib/nfs/v3/mount/constants.d.ts +9 -0
- package/lib/nfs/v3/mount/messages.d.ts +31 -1
- package/lib/nfs/v3/mount/messages.js +27 -0
- package/lib/nfs/v3/mount/messages.js.map +1 -1
- package/lib/nfs/v3/mount/structs.d.ts +15 -0
- package/lib/nfs/v3/mount/structs.js +15 -0
- package/lib/nfs/v3/mount/structs.js.map +1 -1
- package/lib/nfs/v3/structs.d.ts +78 -0
- package/lib/nfs/v3/structs.js +78 -0
- package/lib/nfs/v3/structs.js.map +1 -1
- package/lib/nfs/v4/Nfsv4Decoder.d.ts +0 -2
- package/lib/nfs/v4/Nfsv4Decoder.js +96 -102
- package/lib/nfs/v4/Nfsv4Decoder.js.map +1 -1
- package/lib/nfs/v4/Nfsv4Encoder.d.ts +2 -2
- package/lib/nfs/v4/Nfsv4Encoder.js +1 -1
- package/lib/nfs/v4/Nfsv4Encoder.js.map +1 -1
- package/lib/nfs/v4/Nfsv4FullEncoder.d.ts +4 -4
- package/lib/nfs/v4/Nfsv4FullEncoder.js +4 -4
- package/lib/nfs/v4/Nfsv4FullEncoder.js.map +1 -1
- package/lib/nfs/v4/attributes.d.ts +62 -0
- package/lib/nfs/v4/attributes.js +209 -147
- package/lib/nfs/v4/attributes.js.map +1 -1
- package/lib/nfs/v4/builder.d.ts +274 -1
- package/lib/nfs/v4/builder.js +283 -10
- package/lib/nfs/v4/builder.js.map +1 -1
- package/lib/nfs/v4/client/NfsFsDir.d.ts +4 -1
- package/lib/nfs/v4/client/NfsFsDir.js +8 -5
- package/lib/nfs/v4/client/NfsFsDir.js.map +1 -1
- package/lib/nfs/v4/client/NfsFsDirent.d.ts +3 -0
- package/lib/nfs/v4/client/NfsFsDirent.js +10 -7
- package/lib/nfs/v4/client/NfsFsDirent.js.map +1 -1
- package/lib/nfs/v4/client/NfsFsFileHandle.d.ts +4 -3
- package/lib/nfs/v4/client/NfsFsFileHandle.js +13 -10
- package/lib/nfs/v4/client/NfsFsFileHandle.js.map +1 -1
- package/lib/nfs/v4/client/NfsFsStats.d.ts +3 -0
- package/lib/nfs/v4/client/NfsFsStats.js +10 -7
- package/lib/nfs/v4/client/NfsFsStats.js.map +1 -1
- package/lib/nfs/v4/client/Nfsv4FsClient.d.ts +2 -3
- package/lib/nfs/v4/client/Nfsv4FsClient.js +92 -92
- package/lib/nfs/v4/client/Nfsv4FsClient.js.map +1 -1
- package/lib/nfs/v4/client/Nfsv4TcpClient.d.ts +6 -6
- package/lib/nfs/v4/client/Nfsv4TcpClient.js +3 -3
- package/lib/nfs/v4/client/Nfsv4TcpClient.js.map +1 -1
- package/lib/nfs/v4/client/types.d.ts +1 -1
- package/lib/nfs/v4/constants.d.ts +78 -1
- package/lib/nfs/v4/format.d.ts +1 -1
- package/lib/nfs/v4/format.js +229 -229
- package/lib/nfs/v4/format.js.map +1 -1
- package/lib/nfs/v4/messages.js +101 -101
- package/lib/nfs/v4/messages.js.map +1 -1
- package/lib/nfs/v4/server/Nfsv4CompoundProcCtx.d.ts +20 -1
- package/lib/nfs/v4/server/Nfsv4CompoundProcCtx.js +29 -8
- package/lib/nfs/v4/server/Nfsv4CompoundProcCtx.js.map +1 -1
- package/lib/nfs/v4/server/Nfsv4Connection.d.ts +6 -3
- package/lib/nfs/v4/server/Nfsv4Connection.js +11 -8
- package/lib/nfs/v4/server/Nfsv4Connection.js.map +1 -1
- package/lib/nfs/v4/server/Nfsv4TcpServer.d.ts +2 -3
- package/lib/nfs/v4/server/Nfsv4TcpServer.js +1 -0
- package/lib/nfs/v4/server/Nfsv4TcpServer.js.map +1 -1
- package/lib/nfs/v4/server/operations/ByteRangeLock.d.ts +69 -1
- package/lib/nfs/v4/server/operations/ByteRangeLock.js +43 -1
- package/lib/nfs/v4/server/operations/ByteRangeLock.js.map +1 -1
- package/lib/nfs/v4/server/operations/ClientRecord.d.ts +98 -1
- package/lib/nfs/v4/server/operations/ClientRecord.js +54 -1
- package/lib/nfs/v4/server/operations/ClientRecord.js.map +1 -1
- package/lib/nfs/v4/server/operations/FilesystemStats.d.ts +22 -1
- package/lib/nfs/v4/server/operations/FilesystemStats.js +16 -1
- package/lib/nfs/v4/server/operations/FilesystemStats.js.map +1 -1
- package/lib/nfs/v4/server/operations/LockOwnerState.d.ts +75 -2
- package/lib/nfs/v4/server/operations/LockOwnerState.js +43 -1
- package/lib/nfs/v4/server/operations/LockOwnerState.js.map +1 -1
- package/lib/nfs/v4/server/operations/LockStateid.d.ts +55 -1
- package/lib/nfs/v4/server/operations/LockStateid.js +37 -1
- package/lib/nfs/v4/server/operations/LockStateid.js.map +1 -1
- package/lib/nfs/v4/server/operations/Nfsv4Operations.d.ts +2 -1
- package/lib/nfs/v4/server/operations/Nfsv4OperationsNotImpl.d.ts +2 -2
- package/lib/nfs/v4/server/operations/OpenFileState.d.ts +90 -2
- package/lib/nfs/v4/server/operations/OpenFileState.js +52 -1
- package/lib/nfs/v4/server/operations/OpenFileState.js.map +1 -1
- package/lib/nfs/v4/server/operations/OpenOwnerState.d.ts +76 -2
- package/lib/nfs/v4/server/operations/OpenOwnerState.js +44 -1
- package/lib/nfs/v4/server/operations/OpenOwnerState.js.map +1 -1
- package/lib/nfs/v4/server/operations/node/Nfsv4OperationsNode.d.ts +73 -3
- package/lib/nfs/v4/server/operations/node/Nfsv4OperationsNode.js +261 -187
- package/lib/nfs/v4/server/operations/node/Nfsv4OperationsNode.js.map +1 -1
- package/lib/nfs/v4/server/operations/node/attrs.d.ts +13 -1
- package/lib/nfs/v4/server/operations/node/attrs.js +75 -62
- package/lib/nfs/v4/server/operations/node/attrs.js.map +1 -1
- package/lib/nfs/v4/server/operations/node/fh.d.ts +67 -2
- package/lib/nfs/v4/server/operations/node/fh.js +83 -21
- package/lib/nfs/v4/server/operations/node/fh.js.map +1 -1
- package/lib/nfs/v4/server/operations/node/util.js +4 -4
- package/lib/nfs/v4/server/operations/node/util.js.map +1 -1
- package/lib/nfs/v4/server/util.d.ts +0 -1
- package/lib/nfs/v4/server/util.js +40 -40
- package/lib/nfs/v4/structs.d.ts +136 -4
- package/lib/nfs/v4/structs.js +129 -0
- package/lib/nfs/v4/structs.js.map +1 -1
- package/lib/resp/RespDecoder.d.ts +9 -0
- package/lib/resp/RespDecoder.js +93 -76
- package/lib/resp/RespDecoder.js.map +1 -1
- package/lib/resp/RespEncoder.d.ts +8 -0
- package/lib/resp/RespEncoder.js +107 -89
- package/lib/resp/RespEncoder.js.map +1 -1
- package/lib/resp/RespEncoderLegacy.d.ts +3 -0
- package/lib/resp/RespEncoderLegacy.js +7 -4
- package/lib/resp/RespEncoderLegacy.js.map +1 -1
- package/lib/resp/RespStreamingDecoder.d.ts +48 -0
- package/lib/resp/RespStreamingDecoder.js +48 -0
- package/lib/resp/RespStreamingDecoder.js.map +1 -1
- package/lib/resp/constants.d.ts +19 -19
- package/lib/rm/RmRecordEncoder.d.ts +15 -1
- package/lib/rm/RmRecordEncoder.js +15 -1
- package/lib/rm/RmRecordEncoder.js.map +1 -1
- package/lib/rpc/RpcMessageDecoder.d.ts +1 -1
- package/lib/rpc/RpcMessageDecoder.js +8 -7
- package/lib/rpc/RpcMessageDecoder.js.map +1 -1
- package/lib/rpc/RpcMessageEncoder.d.ts +2 -2
- package/lib/rpc/RpcMessageEncoder.js +6 -6
- package/lib/rpc/RpcMessageEncoder.js.map +1 -1
- package/lib/rpc/constants.d.ts +76 -28
- package/lib/rpc/constants.js +10 -0
- package/lib/rpc/constants.js.map +1 -1
- package/lib/ssh/SshDecoder.d.ts +46 -0
- package/lib/ssh/SshDecoder.js +52 -2
- package/lib/ssh/SshDecoder.js.map +1 -1
- package/lib/ssh/SshEncoder.d.ts +69 -0
- package/lib/ssh/SshEncoder.js +81 -8
- package/lib/ssh/SshEncoder.js.map +1 -1
- package/lib/ssh/index.d.ts +6 -0
- package/lib/ssh/index.js +6 -0
- package/lib/ssh/index.js.map +1 -1
- package/lib/ubjson/UbjsonDecoder.js +1 -1
- package/lib/ubjson/UbjsonDecoder.js.map +1 -1
- package/lib/ubjson/UbjsonEncoder.js +6 -5
- package/lib/ubjson/UbjsonEncoder.js.map +1 -1
- package/lib/util/CompressionTable.js +4 -4
- package/lib/util/CompressionTable.js.map +1 -1
- package/lib/util/DecompressionTable.js +3 -2
- package/lib/util/DecompressionTable.js.map +1 -1
- package/lib/ws/WsFrameDecoder.d.ts +18 -0
- package/lib/ws/WsFrameDecoder.js +18 -0
- package/lib/ws/WsFrameDecoder.js.map +1 -1
- package/lib/ws/WsFrameEncoder.d.ts +1 -1
- package/lib/ws/WsFrameEncoder.js +3 -3
- package/lib/ws/WsFrameEncoder.js.map +1 -1
- package/lib/ws/constants.js +5 -0
- package/lib/ws/constants.js.map +1 -1
- package/lib/xdr/XdrDecoder.d.ts +62 -0
- package/lib/xdr/XdrDecoder.js +73 -6
- package/lib/xdr/XdrDecoder.js.map +1 -1
- package/lib/xdr/XdrEncoder.d.ts +71 -0
- package/lib/xdr/XdrEncoder.js +88 -13
- package/lib/xdr/XdrEncoder.js.map +1 -1
- package/lib/xdr/XdrSchemaDecoder.d.ts +40 -0
- package/lib/xdr/XdrSchemaDecoder.js +52 -0
- package/lib/xdr/XdrSchemaDecoder.js.map +1 -1
- package/lib/xdr/XdrSchemaEncoder.d.ts +5 -0
- package/lib/xdr/XdrSchemaEncoder.js +9 -0
- package/lib/xdr/XdrSchemaEncoder.js.map +1 -1
- package/lib/xdr/XdrSchemaValidator.d.ts +9 -0
- package/lib/xdr/XdrSchemaValidator.js +42 -11
- package/lib/xdr/XdrSchemaValidator.js.map +1 -1
- package/lib/xdr/XdrUnion.d.ts +5 -0
- package/lib/xdr/XdrUnion.js +5 -0
- package/lib/xdr/XdrUnion.js.map +1 -1
- package/lib/xdr/index.d.ts +14 -0
- package/lib/xdr/index.js +14 -0
- package/lib/xdr/index.js.map +1 -1
- package/lib/xdr/types.d.ts +46 -0
- package/package.json +32 -55
|
@@ -1,8 +1,59 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.OpenFileState = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Open file state record for NFSv4 OPEN operations.
|
|
6
|
+
* Tracks state for an individual file that has been opened by a client,
|
|
7
|
+
* including the stateid, file descriptor, share reservations, and confirmation status.
|
|
8
|
+
*/
|
|
4
9
|
class OpenFileState {
|
|
5
|
-
constructor(
|
|
10
|
+
constructor(
|
|
11
|
+
/**
|
|
12
|
+
* Stateid assigned to this open file.
|
|
13
|
+
* Used by client to identify this particular open in subsequent operations
|
|
14
|
+
* (CLOSE, OPEN_DOWNGRADE, READ, WRITE, etc.).
|
|
15
|
+
*/
|
|
16
|
+
stateid,
|
|
17
|
+
/**
|
|
18
|
+
* Absolute file system path of the opened file.
|
|
19
|
+
* Used to identify the file and check for share reservation conflicts.
|
|
20
|
+
*/
|
|
21
|
+
path,
|
|
22
|
+
/**
|
|
23
|
+
* Node.js file descriptor/handle for the opened file.
|
|
24
|
+
* Used to perform I/O operations and must be closed when the file is closed.
|
|
25
|
+
*/
|
|
26
|
+
fd,
|
|
27
|
+
/**
|
|
28
|
+
* Share access mode - which operations this open allows.
|
|
29
|
+
* Bitwise OR of OPEN4_SHARE_ACCESS_READ, OPEN4_SHARE_ACCESS_WRITE.
|
|
30
|
+
* Controls what the opener can do with the file.
|
|
31
|
+
*/
|
|
32
|
+
shareAccess,
|
|
33
|
+
/**
|
|
34
|
+
* Share deny mode - which operations this open denies to others.
|
|
35
|
+
* Bitwise OR of OPEN4_SHARE_DENY_READ, OPEN4_SHARE_DENY_WRITE, or OPEN4_SHARE_DENY_NONE.
|
|
36
|
+
* Controls what conflicting operations are blocked for other opens.
|
|
37
|
+
*/
|
|
38
|
+
shareDeny,
|
|
39
|
+
/**
|
|
40
|
+
* Key identifying the open-owner that opened this file.
|
|
41
|
+
* Format: `${clientid}:${base64(owner)}`.
|
|
42
|
+
* Links this open back to the owner for sequence number management.
|
|
43
|
+
*/
|
|
44
|
+
openOwnerKey,
|
|
45
|
+
/**
|
|
46
|
+
* Sequence number for this open.
|
|
47
|
+
* Used to detect replayed or out-of-order operations.
|
|
48
|
+
* Incremented on OPEN_CONFIRM and OPEN_DOWNGRADE.
|
|
49
|
+
*/
|
|
50
|
+
seqid,
|
|
51
|
+
/**
|
|
52
|
+
* Whether this open has been confirmed via OPEN_CONFIRM.
|
|
53
|
+
* NFSv4.0 requires new opens from new open-owners to be confirmed.
|
|
54
|
+
* Once confirmed, the open can be used for READ/WRITE operations.
|
|
55
|
+
*/
|
|
56
|
+
confirmed) {
|
|
6
57
|
this.stateid = stateid;
|
|
7
58
|
this.path = path;
|
|
8
59
|
this.fd = fd;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpenFileState.js","sourceRoot":"","sources":["../../../../../src/nfs/v4/server/operations/OpenFileState.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"OpenFileState.js","sourceRoot":"","sources":["../../../../../src/nfs/v4/server/operations/OpenFileState.ts"],"names":[],"mappings":";;;AAGA;;;;GAIG;AACH,MAAa,aAAa;IACxB;IACE;;;;OAIG;IACa,OAA4B;IAE5C;;;OAGG;IACa,IAAY;IAE5B;;;OAGG;IACa,EAAc;IAE9B;;;;OAIG;IACI,WAAmB;IAE1B;;;;OAIG;IACI,SAAiB;IAExB;;;;OAIG;IACa,YAAoB;IAEpC;;;;OAIG;IACI,KAAa;IAEpB;;;;OAIG;IACI,SAAkB;QA/CT,YAAO,GAAP,OAAO,CAAqB;QAM5B,SAAI,GAAJ,IAAI,CAAQ;QAMZ,OAAE,GAAF,EAAE,CAAY;QAOvB,gBAAW,GAAX,WAAW,CAAQ;QAOnB,cAAS,GAAT,SAAS,CAAQ;QAOR,iBAAY,GAAZ,YAAY,CAAQ;QAO7B,UAAK,GAAL,KAAK,CAAQ;QAOb,cAAS,GAAT,SAAS,CAAS;IACxB,CAAC;CACL;AAxDD,sCAwDC"}
|
|
@@ -1,9 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Open-owner state record for NFSv4 OPEN operations.
|
|
3
|
+
* An open-owner represents a single entity (process, thread) on a client
|
|
4
|
+
* that can open files. Tracks all opens made by this owner and manages
|
|
5
|
+
* sequence numbers for serialization.
|
|
6
|
+
*/
|
|
1
7
|
export declare class OpenOwnerState {
|
|
8
|
+
/**
|
|
9
|
+
* Client ID that owns this open-owner.
|
|
10
|
+
* Links the owner back to the specific NFS client that created it.
|
|
11
|
+
*/
|
|
2
12
|
readonly clientid: bigint;
|
|
13
|
+
/**
|
|
14
|
+
* Opaque owner identifier provided by the client.
|
|
15
|
+
* Typically represents a process or thread ID on the client.
|
|
16
|
+
* Combined with clientid, uniquely identifies this open-owner.
|
|
17
|
+
*/
|
|
3
18
|
readonly owner: Uint8Array;
|
|
19
|
+
/**
|
|
20
|
+
* Sequence number for operations from this open-owner.
|
|
21
|
+
* Used to serialize OPEN/CLOSE/OPEN_CONFIRM/OPEN_DOWNGRADE operations.
|
|
22
|
+
* Incremented after each successful stateful operation.
|
|
23
|
+
* Server rejects operations with incorrect sequence numbers to prevent replays.
|
|
24
|
+
*/
|
|
4
25
|
seqid: number;
|
|
26
|
+
/**
|
|
27
|
+
* Set of stateid keys for all files currently opened by this owner.
|
|
28
|
+
* Format: stateid keys are `${seqid}:${base64(other)}`.
|
|
29
|
+
* Used to track all active opens and clean them up if the owner goes away.
|
|
30
|
+
*/
|
|
5
31
|
readonly opens: Set<string>;
|
|
6
|
-
|
|
32
|
+
/**
|
|
33
|
+
* Cached response from the last successful operation.
|
|
34
|
+
* Per RFC 7530 §9.1.7, when a client retries with the same seqid (replay),
|
|
35
|
+
* the server must return the cached response instead of re-executing the operation.
|
|
36
|
+
* This ensures idempotency for operations like OPEN, OPEN_CONFIRM, OPEN_DOWNGRADE, CLOSE.
|
|
37
|
+
*/
|
|
38
|
+
lastResponse?: any | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* Signature of the last OPEN request. Used to distinguish true replays
|
|
41
|
+
* (identical requests) from clients that reuse seqids with different
|
|
42
|
+
* parameters, which must be rejected with BAD_SEQID.
|
|
43
|
+
*/
|
|
7
44
|
lastRequestKey?: string | undefined;
|
|
8
|
-
constructor(
|
|
45
|
+
constructor(
|
|
46
|
+
/**
|
|
47
|
+
* Client ID that owns this open-owner.
|
|
48
|
+
* Links the owner back to the specific NFS client that created it.
|
|
49
|
+
*/
|
|
50
|
+
clientid: bigint,
|
|
51
|
+
/**
|
|
52
|
+
* Opaque owner identifier provided by the client.
|
|
53
|
+
* Typically represents a process or thread ID on the client.
|
|
54
|
+
* Combined with clientid, uniquely identifies this open-owner.
|
|
55
|
+
*/
|
|
56
|
+
owner: Uint8Array,
|
|
57
|
+
/**
|
|
58
|
+
* Sequence number for operations from this open-owner.
|
|
59
|
+
* Used to serialize OPEN/CLOSE/OPEN_CONFIRM/OPEN_DOWNGRADE operations.
|
|
60
|
+
* Incremented after each successful stateful operation.
|
|
61
|
+
* Server rejects operations with incorrect sequence numbers to prevent replays.
|
|
62
|
+
*/
|
|
63
|
+
seqid: number,
|
|
64
|
+
/**
|
|
65
|
+
* Set of stateid keys for all files currently opened by this owner.
|
|
66
|
+
* Format: stateid keys are `${seqid}:${base64(other)}`.
|
|
67
|
+
* Used to track all active opens and clean them up if the owner goes away.
|
|
68
|
+
*/
|
|
69
|
+
opens?: Set<string>,
|
|
70
|
+
/**
|
|
71
|
+
* Cached response from the last successful operation.
|
|
72
|
+
* Per RFC 7530 §9.1.7, when a client retries with the same seqid (replay),
|
|
73
|
+
* the server must return the cached response instead of re-executing the operation.
|
|
74
|
+
* This ensures idempotency for operations like OPEN, OPEN_CONFIRM, OPEN_DOWNGRADE, CLOSE.
|
|
75
|
+
*/
|
|
76
|
+
lastResponse?: any | undefined,
|
|
77
|
+
/**
|
|
78
|
+
* Signature of the last OPEN request. Used to distinguish true replays
|
|
79
|
+
* (identical requests) from clients that reuse seqids with different
|
|
80
|
+
* parameters, which must be rejected with BAD_SEQID.
|
|
81
|
+
*/
|
|
82
|
+
lastRequestKey?: string | undefined);
|
|
9
83
|
}
|
|
@@ -1,8 +1,51 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.OpenOwnerState = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Open-owner state record for NFSv4 OPEN operations.
|
|
6
|
+
* An open-owner represents a single entity (process, thread) on a client
|
|
7
|
+
* that can open files. Tracks all opens made by this owner and manages
|
|
8
|
+
* sequence numbers for serialization.
|
|
9
|
+
*/
|
|
4
10
|
class OpenOwnerState {
|
|
5
|
-
constructor(
|
|
11
|
+
constructor(
|
|
12
|
+
/**
|
|
13
|
+
* Client ID that owns this open-owner.
|
|
14
|
+
* Links the owner back to the specific NFS client that created it.
|
|
15
|
+
*/
|
|
16
|
+
clientid,
|
|
17
|
+
/**
|
|
18
|
+
* Opaque owner identifier provided by the client.
|
|
19
|
+
* Typically represents a process or thread ID on the client.
|
|
20
|
+
* Combined with clientid, uniquely identifies this open-owner.
|
|
21
|
+
*/
|
|
22
|
+
owner,
|
|
23
|
+
/**
|
|
24
|
+
* Sequence number for operations from this open-owner.
|
|
25
|
+
* Used to serialize OPEN/CLOSE/OPEN_CONFIRM/OPEN_DOWNGRADE operations.
|
|
26
|
+
* Incremented after each successful stateful operation.
|
|
27
|
+
* Server rejects operations with incorrect sequence numbers to prevent replays.
|
|
28
|
+
*/
|
|
29
|
+
seqid,
|
|
30
|
+
/**
|
|
31
|
+
* Set of stateid keys for all files currently opened by this owner.
|
|
32
|
+
* Format: stateid keys are `${seqid}:${base64(other)}`.
|
|
33
|
+
* Used to track all active opens and clean them up if the owner goes away.
|
|
34
|
+
*/
|
|
35
|
+
opens = new Set(),
|
|
36
|
+
/**
|
|
37
|
+
* Cached response from the last successful operation.
|
|
38
|
+
* Per RFC 7530 §9.1.7, when a client retries with the same seqid (replay),
|
|
39
|
+
* the server must return the cached response instead of re-executing the operation.
|
|
40
|
+
* This ensures idempotency for operations like OPEN, OPEN_CONFIRM, OPEN_DOWNGRADE, CLOSE.
|
|
41
|
+
*/
|
|
42
|
+
lastResponse,
|
|
43
|
+
/**
|
|
44
|
+
* Signature of the last OPEN request. Used to distinguish true replays
|
|
45
|
+
* (identical requests) from clients that reuse seqids with different
|
|
46
|
+
* parameters, which must be rejected with BAD_SEQID.
|
|
47
|
+
*/
|
|
48
|
+
lastRequestKey) {
|
|
6
49
|
this.clientid = clientid;
|
|
7
50
|
this.owner = owner;
|
|
8
51
|
this.seqid = seqid;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpenOwnerState.js","sourceRoot":"","sources":["../../../../../src/nfs/v4/server/operations/OpenOwnerState.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"OpenOwnerState.js","sourceRoot":"","sources":["../../../../../src/nfs/v4/server/operations/OpenOwnerState.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,MAAa,cAAc;IACzB;IACE;;;OAGG;IACa,QAAgB;IAEhC;;;;OAIG;IACa,KAAiB;IAEjC;;;;;OAKG;IACI,KAAa;IAEpB;;;;OAIG;IACa,QAAqB,IAAI,GAAG,EAAE;IAE9C;;;;;OAKG;IACI,YAAkB;IAEzB;;;;OAIG;IACI,cAAuB;QArCd,aAAQ,GAAR,QAAQ,CAAQ;QAOhB,UAAK,GAAL,KAAK,CAAY;QAQ1B,UAAK,GAAL,KAAK,CAAQ;QAOJ,UAAK,GAAL,KAAK,CAAyB;QAQvC,iBAAY,GAAZ,YAAY,CAAM;QAOlB,mBAAc,GAAd,cAAc,CAAS;IAC7B,CAAC;CACL;AA7CD,wCA6CC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { Nfsv4OperationCtx, Nfsv4Operations } from '../Nfsv4Operations';
|
|
1
|
+
import type { Nfsv4OperationCtx, Nfsv4Operations } from '../Nfsv4Operations';
|
|
3
2
|
import * as msg from '../../../messages';
|
|
4
3
|
import * as struct from '../../../structs';
|
|
5
4
|
import { ClientRecord } from '../ClientRecord';
|
|
@@ -11,39 +10,102 @@ import { LockStateid } from '../LockStateid';
|
|
|
11
10
|
import { FilesystemStats } from '../FilesystemStats';
|
|
12
11
|
import { FileHandleMapper } from './fh';
|
|
13
12
|
export interface Nfsv4OperationsNodeOpts {
|
|
13
|
+
/** Node.js `fs` module. */
|
|
14
14
|
fs: typeof import('node:fs');
|
|
15
|
+
/**
|
|
16
|
+
* Absolute path to the root directory to serve. This is some directory on the
|
|
17
|
+
* host filesystem that the NFS server will use as its root.
|
|
18
|
+
*/
|
|
15
19
|
dir: string;
|
|
20
|
+
/**
|
|
21
|
+
* Maximum number of confirmed clients to allow.
|
|
22
|
+
* @default 1000
|
|
23
|
+
*/
|
|
16
24
|
maxClients?: number;
|
|
25
|
+
/**
|
|
26
|
+
* Maximum number of pending clients to allow.
|
|
27
|
+
* @default 1000
|
|
28
|
+
*/
|
|
17
29
|
maxPendingClients?: number;
|
|
30
|
+
/**
|
|
31
|
+
* Optional function to provide filesystem statistics.
|
|
32
|
+
* If not provided, defaults to 2TB available space and 2M available inodes.
|
|
33
|
+
*/
|
|
18
34
|
fsStats?: () => Promise<FilesystemStats>;
|
|
19
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* NFS v4 Operations implementation for Node.js `fs` filesystem.
|
|
38
|
+
*/
|
|
20
39
|
export declare class Nfsv4OperationsNode implements Nfsv4Operations {
|
|
21
40
|
protected readonly fs: typeof import('node:fs');
|
|
22
|
-
protected readonly promises:
|
|
41
|
+
protected readonly promises: typeof import('node:fs')['promises'];
|
|
23
42
|
protected dir: string;
|
|
43
|
+
/**
|
|
44
|
+
* Lease time in seconds.
|
|
45
|
+
* Per RFC 7530 §9.5, this is the time a client has to renew its lease
|
|
46
|
+
* before the server may reclaim its state. Default is 90 seconds.
|
|
47
|
+
*/
|
|
24
48
|
protected readonly leaseTime: number;
|
|
49
|
+
/** Confirmed clients. */
|
|
25
50
|
protected clients: Map<bigint, ClientRecord>;
|
|
51
|
+
/** Clients pending SETCLIENTID_CONFIRM confirmation. */
|
|
26
52
|
protected pendingClients: Map<bigint, ClientRecord>;
|
|
53
|
+
/** Maximum number of client records to keep. */
|
|
27
54
|
protected maxClients: number;
|
|
55
|
+
/** Maximum number of pending client records to keep. */
|
|
28
56
|
protected maxPendingClients: number;
|
|
57
|
+
/** Next client ID to assign. */
|
|
29
58
|
protected nextClientId: bigint;
|
|
59
|
+
/** Boot stamp, identifies server instance, 16 bits. */
|
|
30
60
|
protected bootStamp: number;
|
|
31
61
|
protected readonly fh: FileHandleMapper;
|
|
62
|
+
/** Next stateid sequence number. */
|
|
32
63
|
protected nextStateidSeqid: number;
|
|
64
|
+
/** Map from stateid (as string key) to open file state. */
|
|
33
65
|
protected openFiles: Map<string, OpenFileState>;
|
|
66
|
+
/** Map from open-owner key to owner state. */
|
|
34
67
|
protected openOwners: Map<string, OpenOwnerState>;
|
|
68
|
+
/** Map from lock key to byte-range lock. */
|
|
35
69
|
protected locks: Map<string, ByteRangeLock>;
|
|
70
|
+
/** Map from lock-owner key to lock-owner state. */
|
|
36
71
|
protected lockOwners: Map<string, LockOwnerState>;
|
|
72
|
+
/** Map from lock stateid 'other' field to lock stateid state. Per RFC 7530, one stateid per lock-owner per file. */
|
|
37
73
|
protected lockStateids: Map<string, LockStateid>;
|
|
74
|
+
/**
|
|
75
|
+
* Server-wide monotonic change counter for directory change_info.
|
|
76
|
+
* Incremented on every mutating operation (RENAME, REMOVE, CREATE, etc.).
|
|
77
|
+
* Used to populate change_info4 before/after values for client cache validation.
|
|
78
|
+
*/
|
|
38
79
|
protected changeCounter: bigint;
|
|
80
|
+
/**
|
|
81
|
+
* Function to retrieve filesystem statistics.
|
|
82
|
+
*/
|
|
39
83
|
protected fsStats: () => Promise<FilesystemStats>;
|
|
40
84
|
constructor(opts: Nfsv4OperationsNodeOpts);
|
|
85
|
+
/**
|
|
86
|
+
* Default filesystem statistics: 2TB available space, 2M available inodes.
|
|
87
|
+
*/
|
|
41
88
|
protected defaultFsStats: () => Promise<FilesystemStats>;
|
|
42
89
|
protected findClientByIdString(map: Map<bigint, ClientRecord>, clientIdString: Uint8Array): [bigint, ClientRecord] | undefined;
|
|
43
90
|
protected enforceClientLimit(): void;
|
|
44
91
|
protected enforcePendingClientLimit(): void;
|
|
45
92
|
protected makeOpenOwnerKey(clientid: bigint, owner: Uint8Array): string;
|
|
93
|
+
/**
|
|
94
|
+
* Validates a seqid from a client request against the owner's current seqid.
|
|
95
|
+
* Per RFC 7530 §9.1.7, the server expects seqid = last_seqid + 1 for new operations,
|
|
96
|
+
* or seqid = last_seqid for replayed requests (idempotent retry).
|
|
97
|
+
*
|
|
98
|
+
* @param requestSeqid - seqid from the client request
|
|
99
|
+
* @param ownerSeqid - current seqid stored for the owner
|
|
100
|
+
* @returns 'valid' if seqid matches expected next value, 'replay' if it matches last value, 'invalid' otherwise
|
|
101
|
+
*/
|
|
46
102
|
protected validateSeqid(requestSeqid: number, ownerSeqid: number): 'valid' | 'replay' | 'invalid';
|
|
103
|
+
/**
|
|
104
|
+
* Renews the lease for a client.
|
|
105
|
+
* Per RFC 7530 §9.5, any stateful operation renews the client's lease.
|
|
106
|
+
*
|
|
107
|
+
* @param clientid - The client ID whose lease should be renewed
|
|
108
|
+
*/
|
|
47
109
|
protected renewClientLease(clientid: bigint): void;
|
|
48
110
|
protected makeStateidKey(stateid: struct.Nfsv4Stateid): string;
|
|
49
111
|
protected createStateid(): struct.Nfsv4Stateid;
|
|
@@ -57,7 +119,15 @@ export declare class Nfsv4OperationsNode implements Nfsv4Operations {
|
|
|
57
119
|
protected getOrCreateLockStateid(lockOwnerKey: string, path: string): LockStateid;
|
|
58
120
|
protected findLockStateidByOther(other: Uint8Array): LockStateid | undefined;
|
|
59
121
|
protected hasConflictingLock(path: string, locktype: number, offset: bigint, length: bigint, ownerKey: string): boolean;
|
|
122
|
+
/**
|
|
123
|
+
* Establishes client ID or updates callback information.
|
|
124
|
+
* Returns a client ID and confirmation verifier for SETCLIENTID_CONFIRM.
|
|
125
|
+
*/
|
|
60
126
|
SETCLIENTID(request: msg.Nfsv4SetclientidRequest, ctx: Nfsv4OperationCtx): Promise<msg.Nfsv4SetclientidResponse>;
|
|
127
|
+
/**
|
|
128
|
+
* Confirms a client ID established by SETCLIENTID.
|
|
129
|
+
* Transitions unconfirmed client record to confirmed state.
|
|
130
|
+
*/
|
|
61
131
|
SETCLIENTID_CONFIRM(request: msg.Nfsv4SetclientidConfirmRequest, ctx: Nfsv4OperationCtx): Promise<msg.Nfsv4SetclientidConfirmResponse>;
|
|
62
132
|
ILLEGAL(request: msg.Nfsv4IllegalRequest, ctx: Nfsv4OperationCtx): Promise<msg.Nfsv4IllegalResponse>;
|
|
63
133
|
PUTROOTFH(request: msg.Nfsv4PutrootfhRequest, ctx: Nfsv4OperationCtx): Promise<msg.Nfsv4PutrootfhResponse>;
|