@jsonjoy.com/json-pack 1.20.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.
Files changed (344) hide show
  1. package/lib/JsonPackExtension.d.ts +8 -0
  2. package/lib/JsonPackExtension.js +8 -0
  3. package/lib/JsonPackExtension.js.map +1 -1
  4. package/lib/JsonPackMpint.d.ts +25 -0
  5. package/lib/JsonPackMpint.js +31 -1
  6. package/lib/JsonPackMpint.js.map +1 -1
  7. package/lib/JsonPackValue.d.ts +10 -0
  8. package/lib/JsonPackValue.js +10 -0
  9. package/lib/JsonPackValue.js.map +1 -1
  10. package/lib/avro/AvroDecoder.d.ts +67 -0
  11. package/lib/avro/AvroDecoder.js +77 -5
  12. package/lib/avro/AvroDecoder.js.map +1 -1
  13. package/lib/avro/AvroEncoder.d.ts +71 -0
  14. package/lib/avro/AvroEncoder.js +90 -12
  15. package/lib/avro/AvroEncoder.js.map +1 -1
  16. package/lib/avro/AvroSchemaDecoder.d.ts +53 -0
  17. package/lib/avro/AvroSchemaDecoder.js +60 -3
  18. package/lib/avro/AvroSchemaDecoder.js.map +1 -1
  19. package/lib/avro/AvroSchemaEncoder.d.ts +65 -0
  20. package/lib/avro/AvroSchemaEncoder.js +84 -5
  21. package/lib/avro/AvroSchemaEncoder.js.map +1 -1
  22. package/lib/avro/AvroSchemaValidator.d.ts +10 -0
  23. package/lib/avro/AvroSchemaValidator.js +18 -1
  24. package/lib/avro/AvroSchemaValidator.js.map +1 -1
  25. package/lib/avro/types.d.ts +31 -0
  26. package/lib/avro/types.js +4 -0
  27. package/lib/avro/types.js.map +1 -1
  28. package/lib/bencode/BencodeDecoder.js +9 -9
  29. package/lib/bencode/BencodeDecoder.js.map +1 -1
  30. package/lib/bencode/BencodeEncoder.d.ts +5 -0
  31. package/lib/bencode/BencodeEncoder.js +25 -20
  32. package/lib/bencode/BencodeEncoder.js.map +1 -1
  33. package/lib/bson/BsonDecoder.js +48 -33
  34. package/lib/bson/BsonDecoder.js.map +1 -1
  35. package/lib/bson/BsonEncoder.js +11 -3
  36. package/lib/bson/BsonEncoder.js.map +1 -1
  37. package/lib/cbor/CborDecoder.d.ts +24 -0
  38. package/lib/cbor/CborDecoder.js +94 -56
  39. package/lib/cbor/CborDecoder.js.map +1 -1
  40. package/lib/cbor/CborDecoderBase.d.ts +1 -0
  41. package/lib/cbor/CborDecoderBase.js +63 -53
  42. package/lib/cbor/CborDecoderBase.js.map +1 -1
  43. package/lib/cbor/CborEncoder.d.ts +5 -0
  44. package/lib/cbor/CborEncoder.js +9 -3
  45. package/lib/cbor/CborEncoder.js.map +1 -1
  46. package/lib/cbor/CborEncoderFast.d.ts +7 -0
  47. package/lib/cbor/CborEncoderFast.js +22 -14
  48. package/lib/cbor/CborEncoderFast.js.map +1 -1
  49. package/lib/cbor/CborEncoderStable.d.ts +1 -0
  50. package/lib/cbor/CborEncoderStable.js +2 -1
  51. package/lib/cbor/CborEncoderStable.js.map +1 -1
  52. package/lib/cbor/shared.d.ts +1 -1
  53. package/lib/codecs/Codecs.d.ts +1 -1
  54. package/lib/codecs/cbor.js +1 -1
  55. package/lib/codecs/cbor.js.map +1 -1
  56. package/lib/codecs/json.js +1 -1
  57. package/lib/codecs/json.js.map +1 -1
  58. package/lib/codecs/msgpack.js +1 -1
  59. package/lib/codecs/msgpack.js.map +1 -1
  60. package/lib/ejson/EjsonDecoder.d.ts +5 -0
  61. package/lib/ejson/EjsonDecoder.js +72 -37
  62. package/lib/ejson/EjsonDecoder.js.map +1 -1
  63. package/lib/ejson/EjsonEncoder.d.ts +5 -0
  64. package/lib/ejson/EjsonEncoder.js +149 -114
  65. package/lib/ejson/EjsonEncoder.js.map +1 -1
  66. package/lib/ejson/index.js +1 -0
  67. package/lib/ejson/index.js.map +1 -1
  68. package/lib/ion/Import.d.ts +1 -1
  69. package/lib/ion/Import.js.map +1 -1
  70. package/lib/ion/IonDecoder.d.ts +0 -1
  71. package/lib/ion/IonDecoder.js +4 -3
  72. package/lib/ion/IonDecoder.js.map +1 -1
  73. package/lib/ion/IonDecoderBase.js +29 -18
  74. package/lib/ion/IonDecoderBase.js.map +1 -1
  75. package/lib/ion/IonEncoderFast.d.ts +1 -1
  76. package/lib/ion/IonEncoderFast.js +30 -30
  77. package/lib/ion/IonEncoderFast.js.map +1 -1
  78. package/lib/ion/ast.d.ts +4 -1
  79. package/lib/ion/symbols.d.ts +1 -1
  80. package/lib/json/JsonDecoder.js +72 -66
  81. package/lib/json/JsonDecoder.js.map +1 -1
  82. package/lib/json/JsonDecoderDag.js +14 -0
  83. package/lib/json/JsonDecoderDag.js.map +1 -1
  84. package/lib/json/JsonDecoderPartial.d.ts +22 -0
  85. package/lib/json/JsonDecoderPartial.js +30 -8
  86. package/lib/json/JsonDecoderPartial.js.map +1 -1
  87. package/lib/json/JsonEncoder.d.ts +5 -0
  88. package/lib/json/JsonEncoder.js +68 -54
  89. package/lib/json/JsonEncoder.js.map +1 -1
  90. package/lib/json/JsonEncoderDag.d.ts +17 -0
  91. package/lib/json/JsonEncoderDag.js +27 -10
  92. package/lib/json/JsonEncoderDag.js.map +1 -1
  93. package/lib/json/JsonEncoderStable.js +5 -5
  94. package/lib/json/JsonEncoderStable.js.map +1 -1
  95. package/lib/json-binary/codec.d.ts +8 -1
  96. package/lib/json-binary/codec.js +7 -0
  97. package/lib/json-binary/codec.js.map +1 -1
  98. package/lib/msgpack/MsgPackDecoder.d.ts +27 -0
  99. package/lib/msgpack/MsgPackDecoder.js +55 -23
  100. package/lib/msgpack/MsgPackDecoder.js.map +1 -1
  101. package/lib/msgpack/MsgPackDecoderFast.d.ts +8 -0
  102. package/lib/msgpack/MsgPackDecoderFast.js +14 -5
  103. package/lib/msgpack/MsgPackDecoderFast.js.map +1 -1
  104. package/lib/msgpack/MsgPackEncoder.d.ts +3 -0
  105. package/lib/msgpack/MsgPackEncoder.js +7 -4
  106. package/lib/msgpack/MsgPackEncoder.js.map +1 -1
  107. package/lib/msgpack/MsgPackEncoderFast.d.ts +26 -4
  108. package/lib/msgpack/MsgPackEncoderFast.js +31 -0
  109. package/lib/msgpack/MsgPackEncoderFast.js.map +1 -1
  110. package/lib/msgpack/MsgPackEncoderStable.d.ts +3 -0
  111. package/lib/msgpack/MsgPackEncoderStable.js +3 -0
  112. package/lib/msgpack/MsgPackEncoderStable.js.map +1 -1
  113. package/lib/msgpack/MsgPackToJsonConverter.d.ts +30 -4
  114. package/lib/msgpack/MsgPackToJsonConverter.js +32 -5
  115. package/lib/msgpack/MsgPackToJsonConverter.js.map +1 -1
  116. package/lib/msgpack/index.d.ts +29 -0
  117. package/lib/msgpack/index.js +30 -0
  118. package/lib/msgpack/index.js.map +1 -1
  119. package/lib/msgpack/shallow-read.js +7 -7
  120. package/lib/msgpack/shallow-read.js.map +1 -1
  121. package/lib/msgpack/types.d.ts +1 -0
  122. package/lib/msgpack/util.d.ts +1 -1
  123. package/lib/nfs/v3/FullNfsv3Encoder.d.ts +3 -3
  124. package/lib/nfs/v3/FullNfsv3Encoder.js +3 -3
  125. package/lib/nfs/v3/FullNfsv3Encoder.js.map +1 -1
  126. package/lib/nfs/v3/Nfsv3Decoder.js +51 -50
  127. package/lib/nfs/v3/Nfsv3Decoder.js.map +1 -1
  128. package/lib/nfs/v3/Nfsv3Encoder.d.ts +2 -2
  129. package/lib/nfs/v3/Nfsv3Encoder.js +52 -52
  130. package/lib/nfs/v3/Nfsv3Encoder.js.map +1 -1
  131. package/lib/nfs/v3/constants.d.ts +34 -0
  132. package/lib/nfs/v3/constants.js +4 -0
  133. package/lib/nfs/v3/constants.js.map +1 -1
  134. package/lib/nfs/v3/locks/NlmDecoder.js +20 -20
  135. package/lib/nfs/v3/locks/NlmDecoder.js.map +1 -1
  136. package/lib/nfs/v3/locks/NlmEncoder.d.ts +2 -2
  137. package/lib/nfs/v3/locks/NlmEncoder.js +20 -20
  138. package/lib/nfs/v3/locks/NlmEncoder.js.map +1 -1
  139. package/lib/nfs/v3/locks/constants.d.ts +9 -0
  140. package/lib/nfs/v3/locks/messages.d.ts +58 -1
  141. package/lib/nfs/v3/locks/messages.js +54 -0
  142. package/lib/nfs/v3/locks/messages.js.map +1 -1
  143. package/lib/nfs/v3/locks/structs.d.ts +15 -0
  144. package/lib/nfs/v3/locks/structs.js +15 -0
  145. package/lib/nfs/v3/locks/structs.js.map +1 -1
  146. package/lib/nfs/v3/messages.d.ts +249 -0
  147. package/lib/nfs/v3/messages.js +249 -0
  148. package/lib/nfs/v3/messages.js.map +1 -1
  149. package/lib/nfs/v3/mount/MountDecoder.js +12 -12
  150. package/lib/nfs/v3/mount/MountEncoder.d.ts +2 -2
  151. package/lib/nfs/v3/mount/MountEncoder.js +13 -13
  152. package/lib/nfs/v3/mount/MountEncoder.js.map +1 -1
  153. package/lib/nfs/v3/mount/constants.d.ts +9 -0
  154. package/lib/nfs/v3/mount/messages.d.ts +31 -1
  155. package/lib/nfs/v3/mount/messages.js +27 -0
  156. package/lib/nfs/v3/mount/messages.js.map +1 -1
  157. package/lib/nfs/v3/mount/structs.d.ts +15 -0
  158. package/lib/nfs/v3/mount/structs.js +15 -0
  159. package/lib/nfs/v3/mount/structs.js.map +1 -1
  160. package/lib/nfs/v3/structs.d.ts +78 -0
  161. package/lib/nfs/v3/structs.js +78 -0
  162. package/lib/nfs/v3/structs.js.map +1 -1
  163. package/lib/nfs/v4/Nfsv4Decoder.d.ts +14 -12
  164. package/lib/nfs/v4/Nfsv4Decoder.js +241 -165
  165. package/lib/nfs/v4/Nfsv4Decoder.js.map +1 -1
  166. package/lib/nfs/v4/Nfsv4Encoder.d.ts +6 -93
  167. package/lib/nfs/v4/Nfsv4Encoder.js +8 -824
  168. package/lib/nfs/v4/Nfsv4Encoder.js.map +1 -1
  169. package/lib/nfs/v4/Nfsv4FullEncoder.d.ts +32 -0
  170. package/lib/nfs/v4/Nfsv4FullEncoder.js +72 -0
  171. package/lib/nfs/v4/Nfsv4FullEncoder.js.map +1 -0
  172. package/lib/nfs/v4/attributes.d.ts +79 -0
  173. package/lib/nfs/v4/attributes.js +265 -0
  174. package/lib/nfs/v4/attributes.js.map +1 -0
  175. package/lib/nfs/v4/builder.d.ts +333 -0
  176. package/lib/nfs/v4/builder.js +460 -0
  177. package/lib/nfs/v4/builder.js.map +1 -0
  178. package/lib/nfs/v4/client/NfsFsDir.d.ts +23 -0
  179. package/lib/nfs/v4/client/NfsFsDir.js +132 -0
  180. package/lib/nfs/v4/client/NfsFsDir.js.map +1 -0
  181. package/lib/nfs/v4/client/NfsFsDirent.d.ts +17 -0
  182. package/lib/nfs/v4/client/NfsFsDirent.js +35 -0
  183. package/lib/nfs/v4/client/NfsFsDirent.js.map +1 -0
  184. package/lib/nfs/v4/client/NfsFsFileHandle.d.ts +35 -0
  185. package/lib/nfs/v4/client/NfsFsFileHandle.js +271 -0
  186. package/lib/nfs/v4/client/NfsFsFileHandle.js.map +1 -0
  187. package/lib/nfs/v4/client/NfsFsStats.d.ts +34 -0
  188. package/lib/nfs/v4/client/NfsFsStats.js +52 -0
  189. package/lib/nfs/v4/client/NfsFsStats.js.map +1 -0
  190. package/lib/nfs/v4/client/Nfsv4FsClient.d.ts +53 -0
  191. package/lib/nfs/v4/client/Nfsv4FsClient.js +812 -0
  192. package/lib/nfs/v4/client/Nfsv4FsClient.js.map +1 -0
  193. package/lib/nfs/v4/client/Nfsv4TcpClient.d.ts +41 -0
  194. package/lib/nfs/v4/client/Nfsv4TcpClient.js +216 -0
  195. package/lib/nfs/v4/client/Nfsv4TcpClient.js.map +1 -0
  196. package/lib/nfs/v4/client/types.d.ts +9 -0
  197. package/lib/nfs/v4/client/types.js +3 -0
  198. package/lib/nfs/v4/client/types.js.map +1 -0
  199. package/lib/nfs/v4/constants.d.ts +80 -0
  200. package/lib/nfs/v4/constants.js +4 -0
  201. package/lib/nfs/v4/constants.js.map +1 -1
  202. package/lib/nfs/v4/format.d.ts +23 -0
  203. package/lib/nfs/v4/format.js +870 -0
  204. package/lib/nfs/v4/format.js.map +1 -0
  205. package/lib/nfs/v4/index.d.ts +3 -1
  206. package/lib/nfs/v4/index.js +3 -1
  207. package/lib/nfs/v4/index.js.map +1 -1
  208. package/lib/nfs/v4/messages.d.ts +208 -90
  209. package/lib/nfs/v4/messages.js +585 -1
  210. package/lib/nfs/v4/messages.js.map +1 -1
  211. package/lib/nfs/v4/server/Nfsv4CompoundProcCtx.d.ts +30 -0
  212. package/lib/nfs/v4/server/Nfsv4CompoundProcCtx.js +176 -0
  213. package/lib/nfs/v4/server/Nfsv4CompoundProcCtx.js.map +1 -0
  214. package/lib/nfs/v4/server/Nfsv4Connection.d.ts +45 -0
  215. package/lib/nfs/v4/server/Nfsv4Connection.js +163 -0
  216. package/lib/nfs/v4/server/Nfsv4Connection.js.map +1 -0
  217. package/lib/nfs/v4/server/Nfsv4TcpServer.d.ts +25 -0
  218. package/lib/nfs/v4/server/Nfsv4TcpServer.js +92 -0
  219. package/lib/nfs/v4/server/Nfsv4TcpServer.js.map +1 -0
  220. package/lib/nfs/v4/server/operations/ByteRangeLock.d.ts +79 -0
  221. package/lib/nfs/v4/server/operations/ByteRangeLock.js +63 -0
  222. package/lib/nfs/v4/server/operations/ByteRangeLock.js.map +1 -0
  223. package/lib/nfs/v4/server/operations/ClientRecord.d.ts +110 -0
  224. package/lib/nfs/v4/server/operations/ClientRecord.js +70 -0
  225. package/lib/nfs/v4/server/operations/ClientRecord.js.map +1 -0
  226. package/lib/nfs/v4/server/operations/FilesystemStats.d.ts +30 -0
  227. package/lib/nfs/v4/server/operations/FilesystemStats.js +30 -0
  228. package/lib/nfs/v4/server/operations/FilesystemStats.js.map +1 -0
  229. package/lib/nfs/v4/server/operations/LockOwnerState.d.ts +82 -0
  230. package/lib/nfs/v4/server/operations/LockOwnerState.js +57 -0
  231. package/lib/nfs/v4/server/operations/LockOwnerState.js.map +1 -0
  232. package/lib/nfs/v4/server/operations/LockStateid.d.ts +64 -0
  233. package/lib/nfs/v4/server/operations/LockStateid.js +58 -0
  234. package/lib/nfs/v4/server/operations/LockStateid.js.map +1 -0
  235. package/lib/nfs/v4/server/operations/Nfsv4Operations.d.ts +45 -0
  236. package/lib/nfs/v4/server/operations/Nfsv4Operations.js +3 -0
  237. package/lib/nfs/v4/server/operations/Nfsv4Operations.js.map +1 -0
  238. package/lib/nfs/v4/server/operations/Nfsv4OperationsNotImpl.d.ts +42 -0
  239. package/lib/nfs/v4/server/operations/Nfsv4OperationsNotImpl.js +159 -0
  240. package/lib/nfs/v4/server/operations/Nfsv4OperationsNotImpl.js.map +1 -0
  241. package/lib/nfs/v4/server/operations/OpenFileState.d.ts +102 -0
  242. package/lib/nfs/v4/server/operations/OpenFileState.js +68 -0
  243. package/lib/nfs/v4/server/operations/OpenFileState.js.map +1 -0
  244. package/lib/nfs/v4/server/operations/OpenOwnerState.d.ts +83 -0
  245. package/lib/nfs/v4/server/operations/OpenOwnerState.js +58 -0
  246. package/lib/nfs/v4/server/operations/OpenOwnerState.js.map +1 -0
  247. package/lib/nfs/v4/server/operations/node/Nfsv4OperationsNode.d.ts +169 -0
  248. package/lib/nfs/v4/server/operations/node/Nfsv4OperationsNode.js +1474 -0
  249. package/lib/nfs/v4/server/operations/node/Nfsv4OperationsNode.js.map +1 -0
  250. package/lib/nfs/v4/server/operations/node/attrs.d.ts +17 -0
  251. package/lib/nfs/v4/server/operations/node/attrs.js +275 -0
  252. package/lib/nfs/v4/server/operations/node/attrs.js.map +1 -0
  253. package/lib/nfs/v4/server/operations/node/fh.d.ts +93 -0
  254. package/lib/nfs/v4/server/operations/node/fh.js +209 -0
  255. package/lib/nfs/v4/server/operations/node/fh.js.map +1 -0
  256. package/lib/nfs/v4/server/operations/node/util.d.ts +4 -0
  257. package/lib/nfs/v4/server/operations/node/util.js +17 -0
  258. package/lib/nfs/v4/server/operations/node/util.js.map +1 -0
  259. package/lib/nfs/v4/server/types.d.ts +4 -0
  260. package/lib/nfs/v4/server/types.js +3 -0
  261. package/lib/nfs/v4/server/types.js.map +1 -0
  262. package/lib/nfs/v4/server/util.d.ts +5 -0
  263. package/lib/nfs/v4/server/util.js +184 -0
  264. package/lib/nfs/v4/server/util.js.map +1 -0
  265. package/lib/nfs/v4/structs.d.ts +243 -56
  266. package/lib/nfs/v4/structs.js +367 -17
  267. package/lib/nfs/v4/structs.js.map +1 -1
  268. package/lib/resp/RespDecoder.d.ts +9 -0
  269. package/lib/resp/RespDecoder.js +93 -76
  270. package/lib/resp/RespDecoder.js.map +1 -1
  271. package/lib/resp/RespEncoder.d.ts +8 -0
  272. package/lib/resp/RespEncoder.js +107 -89
  273. package/lib/resp/RespEncoder.js.map +1 -1
  274. package/lib/resp/RespEncoderLegacy.d.ts +3 -0
  275. package/lib/resp/RespEncoderLegacy.js +7 -4
  276. package/lib/resp/RespEncoderLegacy.js.map +1 -1
  277. package/lib/resp/RespStreamingDecoder.d.ts +48 -0
  278. package/lib/resp/RespStreamingDecoder.js +48 -0
  279. package/lib/resp/RespStreamingDecoder.js.map +1 -1
  280. package/lib/resp/constants.d.ts +19 -19
  281. package/lib/rm/RmRecordDecoder.js.map +1 -1
  282. package/lib/rm/RmRecordEncoder.d.ts +17 -1
  283. package/lib/rm/RmRecordEncoder.js +40 -1
  284. package/lib/rm/RmRecordEncoder.js.map +1 -1
  285. package/lib/rpc/RpcMessageDecoder.d.ts +1 -1
  286. package/lib/rpc/RpcMessageDecoder.js +11 -8
  287. package/lib/rpc/RpcMessageDecoder.js.map +1 -1
  288. package/lib/rpc/RpcMessageEncoder.d.ts +2 -2
  289. package/lib/rpc/RpcMessageEncoder.js +6 -6
  290. package/lib/rpc/RpcMessageEncoder.js.map +1 -1
  291. package/lib/rpc/constants.d.ts +76 -28
  292. package/lib/rpc/constants.js +10 -0
  293. package/lib/rpc/constants.js.map +1 -1
  294. package/lib/ssh/SshDecoder.d.ts +47 -1
  295. package/lib/ssh/SshDecoder.js +52 -2
  296. package/lib/ssh/SshDecoder.js.map +1 -1
  297. package/lib/ssh/SshEncoder.d.ts +70 -1
  298. package/lib/ssh/SshEncoder.js +81 -8
  299. package/lib/ssh/SshEncoder.js.map +1 -1
  300. package/lib/ssh/index.d.ts +6 -0
  301. package/lib/ssh/index.js +6 -0
  302. package/lib/ssh/index.js.map +1 -1
  303. package/lib/ubjson/UbjsonDecoder.js +1 -1
  304. package/lib/ubjson/UbjsonDecoder.js.map +1 -1
  305. package/lib/ubjson/UbjsonEncoder.js +6 -5
  306. package/lib/ubjson/UbjsonEncoder.js.map +1 -1
  307. package/lib/util/CompressionTable.js +4 -4
  308. package/lib/util/CompressionTable.js.map +1 -1
  309. package/lib/util/DecompressionTable.js +3 -2
  310. package/lib/util/DecompressionTable.js.map +1 -1
  311. package/lib/ws/WsFrameDecoder.d.ts +18 -0
  312. package/lib/ws/WsFrameDecoder.js +18 -0
  313. package/lib/ws/WsFrameDecoder.js.map +1 -1
  314. package/lib/ws/WsFrameEncoder.d.ts +1 -1
  315. package/lib/ws/WsFrameEncoder.js +3 -3
  316. package/lib/ws/WsFrameEncoder.js.map +1 -1
  317. package/lib/ws/constants.js +5 -0
  318. package/lib/ws/constants.js.map +1 -1
  319. package/lib/xdr/XdrDecoder.d.ts +62 -0
  320. package/lib/xdr/XdrDecoder.js +73 -6
  321. package/lib/xdr/XdrDecoder.js.map +1 -1
  322. package/lib/xdr/XdrEncoder.d.ts +71 -0
  323. package/lib/xdr/XdrEncoder.js +88 -13
  324. package/lib/xdr/XdrEncoder.js.map +1 -1
  325. package/lib/xdr/XdrSchemaDecoder.d.ts +40 -0
  326. package/lib/xdr/XdrSchemaDecoder.js +52 -0
  327. package/lib/xdr/XdrSchemaDecoder.js.map +1 -1
  328. package/lib/xdr/XdrSchemaEncoder.d.ts +5 -0
  329. package/lib/xdr/XdrSchemaEncoder.js +9 -0
  330. package/lib/xdr/XdrSchemaEncoder.js.map +1 -1
  331. package/lib/xdr/XdrSchemaValidator.d.ts +9 -0
  332. package/lib/xdr/XdrSchemaValidator.js +42 -11
  333. package/lib/xdr/XdrSchemaValidator.js.map +1 -1
  334. package/lib/xdr/XdrUnion.d.ts +5 -0
  335. package/lib/xdr/XdrUnion.js +5 -0
  336. package/lib/xdr/XdrUnion.js.map +1 -1
  337. package/lib/xdr/index.d.ts +14 -0
  338. package/lib/xdr/index.js +14 -0
  339. package/lib/xdr/index.js.map +1 -1
  340. package/lib/xdr/types.d.ts +52 -0
  341. package/package.json +35 -56
  342. package/lib/nfs/v4/FullNfsv4Encoder.d.ts +0 -28
  343. package/lib/nfs/v4/FullNfsv4Encoder.js +0 -73
  344. package/lib/nfs/v4/FullNfsv4Encoder.js.map +0 -1
@@ -1,842 +1,26 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Nfsv4Encoder = void 0;
4
- const tslib_1 = require("tslib");
5
- const Writer_1 = require("@jsonjoy.com/util/lib/buffers/Writer");
4
+ const Writer_1 = require("@jsonjoy.com/buffers/lib/Writer");
6
5
  const XdrEncoder_1 = require("../../xdr/XdrEncoder");
7
- const errors_1 = require("./errors");
8
- const msg = tslib_1.__importStar(require("./messages"));
9
- const structs = tslib_1.__importStar(require("./structs"));
10
6
  class Nfsv4Encoder {
11
7
  constructor(writer = new Writer_1.Writer()) {
12
8
  this.writer = writer;
13
9
  this.xdr = new XdrEncoder_1.XdrEncoder(writer);
14
10
  }
15
11
  encodeCompound(compound, isRequest) {
16
- if (isRequest)
17
- this.writeCompoundRequest(compound);
18
- else
19
- this.writeCompoundResponse(compound);
12
+ compound.encode(this.xdr);
20
13
  return this.writer.flush();
21
14
  }
22
15
  writeCompound(compound, isRequest) {
23
- if (isRequest)
24
- this.writeCompoundRequest(compound);
25
- else
26
- this.writeCompoundResponse(compound);
16
+ compound.encode(this.xdr);
27
17
  }
28
- writeCompoundRequest(request) {
29
- const xdr = this.xdr;
30
- xdr.writeStr(request.tag);
31
- xdr.writeUnsignedInt(request.minorversion);
32
- xdr.writeUnsignedInt(request.argarray.length);
33
- for (const arg of request.argarray) {
34
- this.writeRequest(arg);
35
- }
36
- }
37
- writeCompoundResponse(response) {
38
- const xdr = this.xdr;
39
- xdr.writeUnsignedInt(response.status);
40
- xdr.writeStr(response.tag);
41
- xdr.writeUnsignedInt(response.resarray.length);
42
- for (const res of response.resarray) {
43
- this.writeResponse(res);
44
- }
45
- }
46
- writeRequest(request) {
47
- if (request instanceof msg.Nfsv4AccessRequest) {
48
- this.xdr.writeUnsignedInt(3);
49
- this.writeAccessRequest(request);
50
- }
51
- else if (request instanceof msg.Nfsv4CloseRequest) {
52
- this.xdr.writeUnsignedInt(4);
53
- this.writeCloseRequest(request);
54
- }
55
- else if (request instanceof msg.Nfsv4CommitRequest) {
56
- this.xdr.writeUnsignedInt(5);
57
- this.writeCommitRequest(request);
58
- }
59
- else if (request instanceof msg.Nfsv4CreateRequest) {
60
- this.xdr.writeUnsignedInt(6);
61
- this.writeCreateRequest(request);
62
- }
63
- else if (request instanceof msg.Nfsv4DelegreturnRequest) {
64
- this.xdr.writeUnsignedInt(8);
65
- this.writeDelegreturnRequest(request);
66
- }
67
- else if (request instanceof msg.Nfsv4GetattrRequest) {
68
- this.xdr.writeUnsignedInt(9);
69
- this.writeGetattrRequest(request);
70
- }
71
- else if (request instanceof msg.Nfsv4GetfhRequest) {
72
- this.xdr.writeUnsignedInt(10);
73
- this.writeGetfhRequest(request);
74
- }
75
- else if (request instanceof msg.Nfsv4LinkRequest) {
76
- this.xdr.writeUnsignedInt(11);
77
- this.writeLinkRequest(request);
78
- }
79
- else if (request instanceof msg.Nfsv4LockRequest) {
80
- this.xdr.writeUnsignedInt(12);
81
- this.writeLockRequest(request);
82
- }
83
- else if (request instanceof msg.Nfsv4LocktRequest) {
84
- this.xdr.writeUnsignedInt(13);
85
- this.writeLocktRequest(request);
86
- }
87
- else if (request instanceof msg.Nfsv4LockuRequest) {
88
- this.xdr.writeUnsignedInt(14);
89
- this.writeLockuRequest(request);
90
- }
91
- else if (request instanceof msg.Nfsv4LookupRequest) {
92
- this.xdr.writeUnsignedInt(15);
93
- this.writeLookupRequest(request);
94
- }
95
- else if (request instanceof msg.Nfsv4LookuppRequest) {
96
- this.xdr.writeUnsignedInt(16);
97
- this.writeLookuppRequest(request);
98
- }
99
- else if (request instanceof msg.Nfsv4NverifyRequest) {
100
- this.xdr.writeUnsignedInt(17);
101
- this.writeNverifyRequest(request);
102
- }
103
- else if (request instanceof msg.Nfsv4OpenRequest) {
104
- this.xdr.writeUnsignedInt(18);
105
- this.writeOpenRequest(request);
106
- }
107
- else if (request instanceof msg.Nfsv4OpenConfirmRequest) {
108
- this.xdr.writeUnsignedInt(20);
109
- this.writeOpenConfirmRequest(request);
110
- }
111
- else if (request instanceof msg.Nfsv4OpenDowngradeRequest) {
112
- this.xdr.writeUnsignedInt(21);
113
- this.writeOpenDowngradeRequest(request);
114
- }
115
- else if (request instanceof msg.Nfsv4PutfhRequest) {
116
- this.xdr.writeUnsignedInt(22);
117
- this.writePutfhRequest(request);
118
- }
119
- else if (request instanceof msg.Nfsv4PutpubfhRequest) {
120
- this.xdr.writeUnsignedInt(23);
121
- this.writePutpubfhRequest(request);
122
- }
123
- else if (request instanceof msg.Nfsv4PutrootfhRequest) {
124
- this.xdr.writeUnsignedInt(24);
125
- this.writePutrootfhRequest(request);
126
- }
127
- else if (request instanceof msg.Nfsv4ReadRequest) {
128
- this.xdr.writeUnsignedInt(25);
129
- this.writeReadRequest(request);
130
- }
131
- else if (request instanceof msg.Nfsv4ReaddirRequest) {
132
- this.xdr.writeUnsignedInt(26);
133
- this.writeReaddirRequest(request);
134
- }
135
- else if (request instanceof msg.Nfsv4ReadlinkRequest) {
136
- this.xdr.writeUnsignedInt(27);
137
- this.writeReadlinkRequest(request);
138
- }
139
- else if (request instanceof msg.Nfsv4RemoveRequest) {
140
- this.xdr.writeUnsignedInt(28);
141
- this.writeRemoveRequest(request);
142
- }
143
- else if (request instanceof msg.Nfsv4RenameRequest) {
144
- this.xdr.writeUnsignedInt(29);
145
- this.writeRenameRequest(request);
146
- }
147
- else if (request instanceof msg.Nfsv4RenewRequest) {
148
- this.xdr.writeUnsignedInt(30);
149
- this.writeRenewRequest(request);
150
- }
151
- else if (request instanceof msg.Nfsv4RestorefhRequest) {
152
- this.xdr.writeUnsignedInt(31);
153
- this.writeRestorefhRequest(request);
154
- }
155
- else if (request instanceof msg.Nfsv4SavefhRequest) {
156
- this.xdr.writeUnsignedInt(32);
157
- this.writeSavefhRequest(request);
158
- }
159
- else if (request instanceof msg.Nfsv4SecinfoRequest) {
160
- this.xdr.writeUnsignedInt(33);
161
- this.writeSecinfoRequest(request);
162
- }
163
- else if (request instanceof msg.Nfsv4SetattrRequest) {
164
- this.xdr.writeUnsignedInt(34);
165
- this.writeSetattrRequest(request);
166
- }
167
- else if (request instanceof msg.Nfsv4SetclientidRequest) {
168
- this.xdr.writeUnsignedInt(35);
169
- this.writeSetclientidRequest(request);
170
- }
171
- else if (request instanceof msg.Nfsv4SetclientidConfirmRequest) {
172
- this.xdr.writeUnsignedInt(36);
173
- this.writeSetclientidConfirmRequest(request);
174
- }
175
- else if (request instanceof msg.Nfsv4VerifyRequest) {
176
- this.xdr.writeUnsignedInt(37);
177
- this.writeVerifyRequest(request);
178
- }
179
- else if (request instanceof msg.Nfsv4WriteRequest) {
180
- this.xdr.writeUnsignedInt(38);
181
- this.writeWriteRequest(request);
182
- }
183
- else {
184
- throw new errors_1.Nfsv4EncodingError(`Unknown request type: ${request.constructor.name}`);
185
- }
186
- }
187
- writeResponse(response) {
188
- if (response instanceof msg.Nfsv4AccessResponse) {
189
- this.xdr.writeUnsignedInt(3);
190
- this.writeAccessResponse(response);
191
- }
192
- else if (response instanceof msg.Nfsv4CloseResponse) {
193
- this.xdr.writeUnsignedInt(4);
194
- this.writeCloseResponse(response);
195
- }
196
- else if (response instanceof msg.Nfsv4CommitResponse) {
197
- this.xdr.writeUnsignedInt(5);
198
- this.writeCommitResponse(response);
199
- }
200
- else if (response instanceof msg.Nfsv4CreateResponse) {
201
- this.xdr.writeUnsignedInt(6);
202
- this.writeCreateResponse(response);
203
- }
204
- else if (response instanceof msg.Nfsv4DelegreturnResponse) {
205
- this.xdr.writeUnsignedInt(8);
206
- this.writeDelegreturnResponse(response);
207
- }
208
- else if (response instanceof msg.Nfsv4GetattrResponse) {
209
- this.xdr.writeUnsignedInt(9);
210
- this.writeGetattrResponse(response);
211
- }
212
- else if (response instanceof msg.Nfsv4GetfhResponse) {
213
- this.xdr.writeUnsignedInt(10);
214
- this.writeGetfhResponse(response);
215
- }
216
- else if (response instanceof msg.Nfsv4LinkResponse) {
217
- this.xdr.writeUnsignedInt(11);
218
- this.writeLinkResponse(response);
219
- }
220
- else if (response instanceof msg.Nfsv4LockResponse) {
221
- this.xdr.writeUnsignedInt(12);
222
- this.writeLockResponse(response);
223
- }
224
- else if (response instanceof msg.Nfsv4LocktResponse) {
225
- this.xdr.writeUnsignedInt(13);
226
- this.writeLocktResponse(response);
227
- }
228
- else if (response instanceof msg.Nfsv4LockuResponse) {
229
- this.xdr.writeUnsignedInt(14);
230
- this.writeLockuResponse(response);
231
- }
232
- else if (response instanceof msg.Nfsv4LookupResponse) {
233
- this.xdr.writeUnsignedInt(15);
234
- this.writeLookupResponse(response);
235
- }
236
- else if (response instanceof msg.Nfsv4LookuppResponse) {
237
- this.xdr.writeUnsignedInt(16);
238
- this.writeLookuppResponse(response);
239
- }
240
- else if (response instanceof msg.Nfsv4NverifyResponse) {
241
- this.xdr.writeUnsignedInt(17);
242
- this.writeNverifyResponse(response);
243
- }
244
- else if (response instanceof msg.Nfsv4OpenResponse) {
245
- this.xdr.writeUnsignedInt(18);
246
- this.writeOpenResponse(response);
247
- }
248
- else if (response instanceof msg.Nfsv4OpenConfirmResponse) {
249
- this.xdr.writeUnsignedInt(20);
250
- this.writeOpenConfirmResponse(response);
251
- }
252
- else if (response instanceof msg.Nfsv4OpenDowngradeResponse) {
253
- this.xdr.writeUnsignedInt(21);
254
- this.writeOpenDowngradeResponse(response);
255
- }
256
- else if (response instanceof msg.Nfsv4PutfhResponse) {
257
- this.xdr.writeUnsignedInt(22);
258
- this.writePutfhResponse(response);
259
- }
260
- else if (response instanceof msg.Nfsv4PutpubfhResponse) {
261
- this.xdr.writeUnsignedInt(23);
262
- this.writePutpubfhResponse(response);
263
- }
264
- else if (response instanceof msg.Nfsv4PutrootfhResponse) {
265
- this.xdr.writeUnsignedInt(24);
266
- this.writePutrootfhResponse(response);
267
- }
268
- else if (response instanceof msg.Nfsv4ReadResponse) {
269
- this.xdr.writeUnsignedInt(25);
270
- this.writeReadResponse(response);
271
- }
272
- else if (response instanceof msg.Nfsv4ReaddirResponse) {
273
- this.xdr.writeUnsignedInt(26);
274
- this.writeReaddirResponse(response);
275
- }
276
- else if (response instanceof msg.Nfsv4ReadlinkResponse) {
277
- this.xdr.writeUnsignedInt(27);
278
- this.writeReadlinkResponse(response);
279
- }
280
- else if (response instanceof msg.Nfsv4RemoveResponse) {
281
- this.xdr.writeUnsignedInt(28);
282
- this.writeRemoveResponse(response);
283
- }
284
- else if (response instanceof msg.Nfsv4RenameResponse) {
285
- this.xdr.writeUnsignedInt(29);
286
- this.writeRenameResponse(response);
287
- }
288
- else if (response instanceof msg.Nfsv4RenewResponse) {
289
- this.xdr.writeUnsignedInt(30);
290
- this.writeRenewResponse(response);
291
- }
292
- else if (response instanceof msg.Nfsv4RestorefhResponse) {
293
- this.xdr.writeUnsignedInt(31);
294
- this.writeRestorefhResponse(response);
295
- }
296
- else if (response instanceof msg.Nfsv4SavefhResponse) {
297
- this.xdr.writeUnsignedInt(32);
298
- this.writeSavefhResponse(response);
299
- }
300
- else if (response instanceof msg.Nfsv4SecinfoResponse) {
301
- this.xdr.writeUnsignedInt(33);
302
- this.writeSecinfoResponse(response);
303
- }
304
- else if (response instanceof msg.Nfsv4SetattrResponse) {
305
- this.xdr.writeUnsignedInt(34);
306
- this.writeSetattrResponse(response);
307
- }
308
- else if (response instanceof msg.Nfsv4SetclientidResponse) {
309
- this.xdr.writeUnsignedInt(35);
310
- this.writeSetclientidResponse(response);
311
- }
312
- else if (response instanceof msg.Nfsv4SetclientidConfirmResponse) {
313
- this.xdr.writeUnsignedInt(36);
314
- this.writeSetclientidConfirmResponse(response);
315
- }
316
- else if (response instanceof msg.Nfsv4VerifyResponse) {
317
- this.xdr.writeUnsignedInt(37);
318
- this.writeVerifyResponse(response);
319
- }
320
- else if (response instanceof msg.Nfsv4WriteResponse) {
321
- this.xdr.writeUnsignedInt(38);
322
- this.writeWriteResponse(response);
323
- }
324
- else {
325
- throw new errors_1.Nfsv4EncodingError(`Unknown response type: ${response.constructor.name}`);
326
- }
327
- }
328
- writeFh(fh) {
329
- this.xdr.writeVarlenOpaque(fh.data);
330
- }
331
- writeVerifier(verifier) {
332
- this.xdr.writeOpaque(verifier.data);
333
- }
334
- writeTime(time) {
335
- const xdr = this.xdr;
336
- xdr.writeHyper(time.seconds);
337
- xdr.writeUnsignedInt(time.nseconds);
338
- }
339
- writeStateid(stateid) {
340
- const xdr = this.xdr;
341
- xdr.writeUnsignedInt(stateid.seqid);
342
- xdr.writeOpaque(stateid.other);
343
- }
344
- writeBitmap(bitmap) {
345
- const xdr = this.xdr;
346
- xdr.writeUnsignedInt(bitmap.mask.length);
347
- for (const m of bitmap.mask) {
348
- xdr.writeUnsignedInt(m);
349
- }
350
- }
351
- writeFattr(fattr) {
352
- this.writeBitmap(fattr.attrmask);
353
- this.xdr.writeVarlenOpaque(fattr.attrVals);
354
- }
355
- writeChangeInfo(changeInfo) {
356
- const xdr = this.xdr;
357
- xdr.writeBoolean(changeInfo.atomic);
358
- xdr.writeUnsignedHyper(changeInfo.before);
359
- xdr.writeUnsignedHyper(changeInfo.after);
360
- }
361
- writeClientAddr(clientAddr) {
362
- const xdr = this.xdr;
363
- xdr.writeStr(clientAddr.rNetid);
364
- xdr.writeStr(clientAddr.rAddr);
365
- }
366
- writeCbClient(cbClient) {
367
- const xdr = this.xdr;
368
- xdr.writeUnsignedInt(cbClient.cbProgram);
369
- this.writeClientAddr(cbClient.cbLocation);
370
- }
371
- writeClientId(clientId) {
372
- this.writeVerifier(clientId.verifier);
373
- this.xdr.writeVarlenOpaque(clientId.id);
374
- }
375
- writeOpenOwner(openOwner) {
376
- const xdr = this.xdr;
377
- xdr.writeUnsignedHyper(openOwner.clientid);
378
- xdr.writeVarlenOpaque(openOwner.owner);
379
- }
380
- writeLockOwner(lockOwner) {
381
- const xdr = this.xdr;
382
- xdr.writeUnsignedHyper(lockOwner.clientid);
383
- xdr.writeVarlenOpaque(lockOwner.owner);
384
- }
385
- writeOpenToLockOwner(openToLockOwner) {
386
- const xdr = this.xdr;
387
- xdr.writeUnsignedInt(openToLockOwner.openSeqid);
388
- this.writeStateid(openToLockOwner.openStateid);
389
- xdr.writeUnsignedInt(openToLockOwner.lockSeqid);
390
- this.writeLockOwner(openToLockOwner.lockOwner);
391
- }
392
- writeExistingLockOwner(existingLockOwner) {
393
- this.writeStateid(existingLockOwner.lockStateid);
394
- this.xdr.writeUnsignedInt(existingLockOwner.lockSeqid);
395
- }
396
- writeOpenClaim(openClaim) {
397
- const xdr = this.xdr;
398
- xdr.writeUnsignedInt(openClaim.claimType);
399
- const claim = openClaim.claim;
400
- if (claim instanceof structs.Nfsv4OpenClaimNull) {
401
- xdr.writeStr(claim.file);
402
- }
403
- else if (claim instanceof structs.Nfsv4OpenClaimPrevious) {
404
- xdr.writeUnsignedInt(claim.delegateType);
405
- }
406
- else if (claim instanceof structs.Nfsv4OpenClaimDelegateCur) {
407
- this.writeStateid(claim.delegateStateid);
408
- xdr.writeStr(claim.file);
409
- }
410
- else if (claim instanceof structs.Nfsv4OpenClaimDelegatePrev) {
411
- xdr.writeStr(claim.file);
412
- }
413
- }
414
- writeAccessRequest(req) {
415
- this.xdr.writeUnsignedInt(req.access);
416
- }
417
- writeAccessResponse(res) {
418
- const xdr = this.xdr;
419
- xdr.writeUnsignedInt(res.status);
420
- if (res.status === 0 && res.resok) {
421
- xdr.writeUnsignedInt(res.resok.supported);
422
- xdr.writeUnsignedInt(res.resok.access);
423
- }
424
- }
425
- writeCloseRequest(req) {
426
- const xdr = this.xdr;
427
- xdr.writeUnsignedInt(req.seqid);
428
- this.writeStateid(req.openStateid);
429
- }
430
- writeCloseResponse(res) {
431
- const xdr = this.xdr;
432
- xdr.writeUnsignedInt(res.status);
433
- if (res.status === 0 && res.resok) {
434
- this.writeStateid(res.resok.openStateid);
435
- }
436
- }
437
- writeCommitRequest(req) {
438
- const xdr = this.xdr;
439
- xdr.writeUnsignedHyper(req.offset);
440
- xdr.writeUnsignedInt(req.count);
441
- }
442
- writeCommitResponse(res) {
443
- const xdr = this.xdr;
444
- xdr.writeUnsignedInt(res.status);
445
- if (res.status === 0 && res.resok) {
446
- this.writeVerifier(res.resok.writeverf);
447
- }
448
- }
449
- writeCreateRequest(req) {
450
- const xdr = this.xdr;
451
- const createType = req.objtype;
452
- xdr.writeUnsignedInt(createType.type);
453
- const objtype = createType.objtype;
454
- if (objtype instanceof structs.Nfsv4CreateTypeLink) {
455
- xdr.writeStr(objtype.linkdata);
456
- }
457
- else if (objtype instanceof structs.Nfsv4CreateTypeDevice) {
458
- xdr.writeUnsignedInt(objtype.devdata.specdata1);
459
- xdr.writeUnsignedInt(objtype.devdata.specdata2);
460
- }
461
- xdr.writeStr(req.objname);
462
- if (objtype instanceof structs.Nfsv4CreateTypeLink) {
463
- this.writeFattr(objtype.createattrs);
464
- }
465
- else if (objtype instanceof structs.Nfsv4CreateTypeDevice) {
466
- this.writeFattr(objtype.createattrs);
467
- }
468
- else if (objtype instanceof structs.Nfsv4CreateTypeOther) {
469
- this.writeFattr(objtype.createattrs);
470
- }
471
- }
472
- writeCreateResponse(res) {
473
- const xdr = this.xdr;
474
- xdr.writeUnsignedInt(res.status);
475
- if (res.status === 0 && res.resok) {
476
- this.writeChangeInfo(res.resok.cinfo);
477
- this.writeBitmap(res.resok.attrset);
478
- }
479
- }
480
- writeDelegreturnRequest(req) {
481
- this.writeStateid(req.delegStateid);
482
- }
483
- writeDelegreturnResponse(res) {
484
- this.xdr.writeUnsignedInt(res.status);
485
- }
486
- writeGetattrRequest(req) {
487
- this.writeBitmap(req.attrRequest);
488
- }
489
- writeGetattrResponse(res) {
490
- const xdr = this.xdr;
491
- xdr.writeUnsignedInt(res.status);
492
- if (res.status === 0 && res.resok) {
493
- this.writeFattr(res.resok.objAttributes);
494
- }
495
- }
496
- writeGetfhRequest(req) {
497
- }
498
- writeGetfhResponse(res) {
499
- const xdr = this.xdr;
500
- xdr.writeUnsignedInt(res.status);
501
- if (res.status === 0 && res.resok) {
502
- this.writeFh(res.resok.object);
503
- }
504
- }
505
- writeLinkRequest(req) {
506
- this.xdr.writeStr(req.newname);
507
- }
508
- writeLinkResponse(res) {
509
- const xdr = this.xdr;
510
- xdr.writeUnsignedInt(res.status);
511
- if (res.status === 0 && res.resok) {
512
- this.writeChangeInfo(res.resok.cinfo);
513
- }
514
- }
515
- writeLockRequest(req) {
516
- const xdr = this.xdr;
517
- xdr.writeUnsignedInt(req.locktype);
518
- xdr.writeBoolean(req.reclaim);
519
- xdr.writeUnsignedHyper(req.offset);
520
- xdr.writeUnsignedHyper(req.length);
521
- xdr.writeBoolean(req.locker.newLockOwner);
522
- const owner = req.locker.owner;
523
- if (owner instanceof structs.Nfsv4LockNewOwner) {
524
- this.writeOpenToLockOwner(owner.openToLockOwner);
525
- }
526
- else if (owner instanceof structs.Nfsv4LockExistingOwner) {
527
- this.writeExistingLockOwner(owner);
528
- }
529
- }
530
- writeLockResponse(res) {
531
- const xdr = this.xdr;
532
- xdr.writeUnsignedInt(res.status);
533
- if (res.status === 0 && res.resok) {
534
- this.writeStateid(res.resok.lockStateid);
535
- }
536
- else if (res.denied) {
537
- xdr.writeUnsignedHyper(res.denied.offset);
538
- xdr.writeUnsignedHyper(res.denied.length);
539
- xdr.writeUnsignedInt(res.denied.locktype);
540
- this.writeLockOwner(res.denied.owner);
541
- }
542
- }
543
- writeLocktRequest(req) {
544
- const xdr = this.xdr;
545
- xdr.writeUnsignedInt(req.locktype);
546
- xdr.writeUnsignedHyper(req.offset);
547
- xdr.writeUnsignedHyper(req.length);
548
- this.writeLockOwner(req.owner);
549
- }
550
- writeLocktResponse(res) {
551
- const xdr = this.xdr;
552
- xdr.writeUnsignedInt(res.status);
553
- if (res.denied) {
554
- xdr.writeUnsignedHyper(res.denied.offset);
555
- xdr.writeUnsignedHyper(res.denied.length);
556
- xdr.writeUnsignedInt(res.denied.locktype);
557
- this.writeLockOwner(res.denied.owner);
558
- }
559
- }
560
- writeLockuRequest(req) {
561
- const xdr = this.xdr;
562
- xdr.writeUnsignedInt(req.locktype);
563
- xdr.writeUnsignedInt(req.seqid);
564
- this.writeStateid(req.lockStateid);
565
- xdr.writeUnsignedHyper(req.offset);
566
- xdr.writeUnsignedHyper(req.length);
567
- }
568
- writeLockuResponse(res) {
569
- const xdr = this.xdr;
570
- xdr.writeUnsignedInt(res.status);
571
- if (res.status === 0 && res.resok) {
572
- this.writeStateid(res.resok.lockStateid);
573
- }
574
- }
575
- writeLookupRequest(req) {
576
- this.xdr.writeStr(req.objname);
577
- }
578
- writeLookupResponse(res) {
579
- this.xdr.writeUnsignedInt(res.status);
580
- }
581
- writeLookuppRequest(req) {
582
- }
583
- writeLookuppResponse(res) {
584
- this.xdr.writeUnsignedInt(res.status);
585
- }
586
- writeNverifyRequest(req) {
587
- this.writeFattr(req.objAttributes);
588
- }
589
- writeNverifyResponse(res) {
590
- this.xdr.writeUnsignedInt(res.status);
591
- }
592
- writeOpenRequest(req) {
593
- const xdr = this.xdr;
594
- xdr.writeUnsignedInt(req.seqid);
595
- xdr.writeUnsignedInt(req.shareAccess);
596
- xdr.writeUnsignedInt(req.shareDeny);
597
- this.writeOpenOwner(req.owner);
598
- xdr.writeUnsignedInt(req.openhow);
599
- this.writeOpenClaim(req.claim);
600
- }
601
- writeOpenResponse(res) {
602
- const xdr = this.xdr;
603
- xdr.writeUnsignedInt(res.status);
604
- if (res.status === 0 && res.resok) {
605
- this.writeStateid(res.resok.stateid);
606
- this.writeChangeInfo(res.resok.cinfo);
607
- xdr.writeUnsignedInt(res.resok.rflags);
608
- this.writeBitmap(res.resok.attrset);
609
- this.writeOpenDelegation(res.resok.delegation);
610
- }
611
- }
612
- writeOpenDelegation(delegation) {
613
- const xdr = this.xdr;
614
- xdr.writeUnsignedInt(delegation.delegationType);
615
- if (delegation.delegation) {
616
- const deleg = delegation.delegation;
617
- if (deleg instanceof structs.Nfsv4OpenReadDelegation) {
618
- this.writeStateid(deleg.stateid);
619
- xdr.writeBoolean(deleg.recall);
620
- xdr.writeUnsignedInt(deleg.permissions.length);
621
- for (const ace of deleg.permissions) {
622
- this.writeAce(ace);
623
- }
624
- }
625
- else if (deleg instanceof structs.Nfsv4OpenWriteDelegation) {
626
- this.writeStateid(deleg.stateid);
627
- xdr.writeBoolean(deleg.recall);
628
- xdr.writeUnsignedHyper(deleg.spaceLimit);
629
- xdr.writeUnsignedInt(deleg.permissions.length);
630
- for (const ace of deleg.permissions) {
631
- this.writeAce(ace);
632
- }
633
- }
634
- }
635
- }
636
- writeAce(ace) {
637
- const xdr = this.xdr;
638
- xdr.writeUnsignedInt(ace.type);
639
- xdr.writeUnsignedInt(ace.flag);
640
- xdr.writeUnsignedInt(ace.accessMask);
641
- xdr.writeStr(ace.who);
642
- }
643
- writeOpenConfirmRequest(req) {
644
- this.writeStateid(req.openStateid);
645
- this.xdr.writeUnsignedInt(req.seqid);
646
- }
647
- writeOpenConfirmResponse(res) {
648
- const xdr = this.xdr;
649
- xdr.writeUnsignedInt(res.status);
650
- if (res.status === 0 && res.resok) {
651
- this.writeStateid(res.resok.openStateid);
652
- }
653
- }
654
- writeOpenDowngradeRequest(req) {
655
- const xdr = this.xdr;
656
- this.writeStateid(req.openStateid);
657
- xdr.writeUnsignedInt(req.seqid);
658
- xdr.writeUnsignedInt(req.shareAccess);
659
- xdr.writeUnsignedInt(req.shareDeny);
660
- }
661
- writeOpenDowngradeResponse(res) {
662
- const xdr = this.xdr;
663
- xdr.writeUnsignedInt(res.status);
664
- if (res.status === 0 && res.resok) {
665
- this.writeStateid(res.resok.openStateid);
666
- }
667
- }
668
- writePutfhRequest(req) {
669
- this.writeFh(req.object);
670
- }
671
- writePutfhResponse(res) {
672
- this.xdr.writeUnsignedInt(res.status);
673
- }
674
- writePutpubfhRequest(req) {
675
- }
676
- writePutpubfhResponse(res) {
677
- this.xdr.writeUnsignedInt(res.status);
678
- }
679
- writePutrootfhRequest(req) {
680
- }
681
- writePutrootfhResponse(res) {
682
- this.xdr.writeUnsignedInt(res.status);
683
- }
684
- writeReadRequest(req) {
685
- const xdr = this.xdr;
686
- this.writeStateid(req.stateid);
687
- xdr.writeUnsignedHyper(req.offset);
688
- xdr.writeUnsignedInt(req.count);
689
- }
690
- writeReadResponse(res) {
691
- const xdr = this.xdr;
692
- xdr.writeUnsignedInt(res.status);
693
- if (res.status === 0 && res.resok) {
694
- xdr.writeBoolean(res.resok.eof);
695
- xdr.writeVarlenOpaque(res.resok.data);
696
- }
697
- }
698
- writeReaddirRequest(req) {
699
- const xdr = this.xdr;
700
- xdr.writeUnsignedHyper(req.cookie);
701
- this.writeVerifier(req.cookieverf);
702
- xdr.writeUnsignedInt(req.dircount);
703
- xdr.writeUnsignedInt(req.maxcount);
704
- this.writeBitmap(req.attrRequest);
705
- }
706
- writeReaddirResponse(res) {
707
- const xdr = this.xdr;
708
- xdr.writeUnsignedInt(res.status);
709
- if (res.status === 0 && res.resok) {
710
- this.writeVerifier(res.resok.cookieverf);
711
- for (const entry of res.resok.entries) {
712
- xdr.writeBoolean(true);
713
- xdr.writeUnsignedHyper(entry.cookie);
714
- xdr.writeStr(entry.name);
715
- this.writeFattr(entry.attrs);
716
- }
717
- xdr.writeBoolean(false);
718
- xdr.writeBoolean(res.resok.eof);
719
- }
720
- }
721
- writeReadlinkRequest(req) {
722
- }
723
- writeReadlinkResponse(res) {
724
- const xdr = this.xdr;
725
- xdr.writeUnsignedInt(res.status);
726
- if (res.status === 0 && res.resok) {
727
- xdr.writeStr(res.resok.link);
728
- }
729
- }
730
- writeRemoveRequest(req) {
731
- this.xdr.writeStr(req.target);
732
- }
733
- writeRemoveResponse(res) {
734
- const xdr = this.xdr;
735
- xdr.writeUnsignedInt(res.status);
736
- if (res.status === 0 && res.resok) {
737
- this.writeChangeInfo(res.resok.cinfo);
738
- }
739
- }
740
- writeRenameRequest(req) {
741
- const xdr = this.xdr;
742
- xdr.writeStr(req.oldname);
743
- xdr.writeStr(req.newname);
744
- }
745
- writeRenameResponse(res) {
746
- const xdr = this.xdr;
747
- xdr.writeUnsignedInt(res.status);
748
- if (res.status === 0 && res.resok) {
749
- this.writeChangeInfo(res.resok.sourceCinfo);
750
- this.writeChangeInfo(res.resok.targetCinfo);
751
- }
752
- }
753
- writeRenewRequest(req) {
754
- this.xdr.writeUnsignedHyper(req.clientid);
755
- }
756
- writeRenewResponse(res) {
757
- this.xdr.writeUnsignedInt(res.status);
758
- }
759
- writeRestorefhRequest(req) {
760
- }
761
- writeRestorefhResponse(res) {
762
- this.xdr.writeUnsignedInt(res.status);
763
- }
764
- writeSavefhRequest(req) {
765
- }
766
- writeSavefhResponse(res) {
767
- this.xdr.writeUnsignedInt(res.status);
768
- }
769
- writeSecinfoRequest(req) {
770
- this.xdr.writeStr(req.name);
771
- }
772
- writeSecinfoResponse(res) {
773
- const xdr = this.xdr;
774
- xdr.writeUnsignedInt(res.status);
775
- if (res.status === 0 && res.resok) {
776
- xdr.writeUnsignedInt(res.resok.flavors.length);
777
- for (const flavor of res.resok.flavors) {
778
- xdr.writeUnsignedInt(flavor.flavor);
779
- if (flavor.flavorInfo) {
780
- xdr.writeVarlenOpaque(flavor.flavorInfo.oid);
781
- xdr.writeUnsignedInt(flavor.flavorInfo.qop);
782
- xdr.writeUnsignedInt(flavor.flavorInfo.service);
783
- }
784
- }
785
- }
786
- }
787
- writeSetattrRequest(req) {
788
- this.writeStateid(req.stateid);
789
- this.writeFattr(req.objAttributes);
790
- }
791
- writeSetattrResponse(res) {
792
- const xdr = this.xdr;
793
- xdr.writeUnsignedInt(res.status);
794
- if (res.resok) {
795
- this.writeBitmap(res.resok.attrsset);
796
- }
797
- }
798
- writeSetclientidRequest(req) {
799
- this.writeClientId(req.client);
800
- this.writeCbClient(req.callback);
801
- this.xdr.writeUnsignedInt(req.callbackIdent);
802
- }
803
- writeSetclientidResponse(res) {
804
- const xdr = this.xdr;
805
- xdr.writeUnsignedInt(res.status);
806
- if (res.status === 0 && res.resok) {
807
- xdr.writeUnsignedHyper(res.resok.clientid);
808
- this.writeVerifier(res.resok.setclientidConfirm);
809
- }
810
- }
811
- writeSetclientidConfirmRequest(req) {
812
- const xdr = this.xdr;
813
- xdr.writeUnsignedHyper(req.clientid);
814
- this.writeVerifier(req.setclientidConfirm);
815
- }
816
- writeSetclientidConfirmResponse(res) {
817
- this.xdr.writeUnsignedInt(res.status);
818
- }
819
- writeVerifyRequest(req) {
820
- this.writeFattr(req.objAttributes);
821
- }
822
- writeVerifyResponse(res) {
823
- this.xdr.writeUnsignedInt(res.status);
824
- }
825
- writeWriteRequest(req) {
826
- const xdr = this.xdr;
827
- this.writeStateid(req.stateid);
828
- xdr.writeUnsignedHyper(req.offset);
829
- xdr.writeUnsignedInt(req.stable);
830
- xdr.writeVarlenOpaque(req.data);
18
+ encodeCbCompound(compound, isRequest) {
19
+ compound.encode(this.xdr);
20
+ return this.writer.flush();
831
21
  }
832
- writeWriteResponse(res) {
833
- const xdr = this.xdr;
834
- xdr.writeUnsignedInt(res.status);
835
- if (res.status === 0 && res.resok) {
836
- xdr.writeUnsignedInt(res.resok.count);
837
- xdr.writeUnsignedInt(res.resok.committed);
838
- this.writeVerifier(res.resok.writeverf);
839
- }
22
+ writeCbCompound(compound, isRequest) {
23
+ compound.encode(this.xdr);
840
24
  }
841
25
  }
842
26
  exports.Nfsv4Encoder = Nfsv4Encoder;