@jsonjoy.com/json-pack 1.15.0 → 1.17.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/nfs/v3/FullNfsv3Encoder.d.ts +28 -0
- package/lib/nfs/v3/FullNfsv3Encoder.js +73 -0
- package/lib/nfs/v3/FullNfsv3Encoder.js.map +1 -0
- package/lib/nfs/v3/Nfsv3Decoder.d.ts +78 -0
- package/lib/nfs/v3/Nfsv3Decoder.js +757 -0
- package/lib/nfs/v3/Nfsv3Decoder.js.map +1 -0
- package/lib/nfs/v3/Nfsv3Encoder.d.ts +80 -0
- package/lib/nfs/v3/Nfsv3Encoder.js +669 -0
- package/lib/nfs/v3/Nfsv3Encoder.js.map +1 -0
- package/lib/nfs/v3/constants.d.ts +115 -0
- package/lib/nfs/v3/constants.js +3 -0
- package/lib/nfs/v3/constants.js.map +1 -0
- package/lib/nfs/v3/errors.d.ts +6 -0
- package/lib/nfs/v3/errors.js +16 -0
- package/lib/nfs/v3/errors.js.map +1 -0
- package/lib/nfs/v3/index.d.ts +6 -0
- package/lib/nfs/v3/index.js +10 -0
- package/lib/nfs/v3/index.js.map +1 -0
- package/lib/nfs/v3/messages.d.ts +460 -0
- package/lib/nfs/v3/messages.js +619 -0
- package/lib/nfs/v3/messages.js.map +1 -0
- package/lib/nfs/v3/structs.d.ts +156 -0
- package/lib/nfs/v3/structs.js +210 -0
- package/lib/nfs/v3/structs.js.map +1 -0
- package/lib/rm/RmRecordDecoder.d.ts +8 -0
- package/lib/rm/RmRecordDecoder.js +57 -0
- package/lib/rm/RmRecordDecoder.js.map +1 -0
- package/lib/rm/RmRecordEncoder.d.ts +10 -0
- package/lib/rm/RmRecordEncoder.js +43 -0
- package/lib/rm/RmRecordEncoder.js.map +1 -0
- package/lib/rm/index.d.ts +2 -0
- package/lib/rm/index.js +6 -0
- package/lib/rm/index.js.map +1 -0
- package/lib/rpc/RpcMessageDecoder.d.ts +6 -0
- package/lib/rpc/RpcMessageDecoder.js +107 -0
- package/lib/rpc/RpcMessageDecoder.js.map +1 -0
- package/lib/rpc/RpcMessageEncoder.d.ts +28 -0
- package/lib/rpc/RpcMessageEncoder.js +152 -0
- package/lib/rpc/RpcMessageEncoder.js.map +1 -0
- package/lib/rpc/constants.d.ts +50 -0
- package/lib/rpc/constants.js +5 -0
- package/lib/rpc/constants.js.map +1 -0
- package/lib/rpc/errors.d.ts +6 -0
- package/lib/rpc/errors.js +16 -0
- package/lib/rpc/errors.js.map +1 -0
- package/lib/rpc/index.d.ts +5 -0
- package/lib/rpc/index.js +9 -0
- package/lib/rpc/index.js.map +1 -0
- package/lib/rpc/messages.d.ts +40 -0
- package/lib/rpc/messages.js +50 -0
- package/lib/rpc/messages.js.map +1 -0
- package/lib/ws/WsFrameDecoder.d.ts +1 -1
- package/lib/ws/WsFrameDecoder.js +1 -1
- package/lib/ws/WsFrameDecoder.js.map +1 -1
- package/lib/ws/index.d.ts +1 -0
- package/lib/ws/index.js +1 -0
- package/lib/ws/index.js.map +1 -1
- package/lib/xdr/XdrDecoder.js +9 -18
- package/lib/xdr/XdrDecoder.js.map +1 -1
- package/lib/xdr/XdrEncoder.js +5 -10
- package/lib/xdr/XdrEncoder.js.map +1 -1
- package/lib/xdr/XdrSchemaDecoder.d.ts +1 -0
- package/lib/xdr/XdrSchemaDecoder.js +10 -0
- package/lib/xdr/XdrSchemaDecoder.js.map +1 -1
- package/lib/xdr/XdrSchemaEncoder.d.ts +2 -1
- package/lib/xdr/XdrSchemaEncoder.js +23 -2
- package/lib/xdr/XdrSchemaEncoder.js.map +1 -1
- package/lib/xdr/XdrSchemaValidator.d.ts +2 -0
- package/lib/xdr/XdrSchemaValidator.js +21 -0
- package/lib/xdr/XdrSchemaValidator.js.map +1 -1
- package/lib/xdr/index.js.map +1 -1
- package/lib/xdr/types.d.ts +8 -2
- package/package.json +3 -3
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import type { Reader } from '@jsonjoy.com/buffers/lib/Reader';
|
|
2
|
+
import type { Nfsv3FType, Nfsv3TimeHow, Nfsv3StableHow, Nfsv3CreateMode } from './constants';
|
|
3
|
+
export declare class Nfsv3Time {
|
|
4
|
+
readonly seconds: number;
|
|
5
|
+
readonly nseconds: number;
|
|
6
|
+
constructor(seconds: number, nseconds: number);
|
|
7
|
+
}
|
|
8
|
+
export declare class Nfsv3SpecData {
|
|
9
|
+
readonly specdata1: number;
|
|
10
|
+
readonly specdata2: number;
|
|
11
|
+
constructor(specdata1: number, specdata2: number);
|
|
12
|
+
}
|
|
13
|
+
export declare class Nfsv3Fh {
|
|
14
|
+
readonly data: Reader;
|
|
15
|
+
constructor(data: Reader);
|
|
16
|
+
}
|
|
17
|
+
export declare class Nfsv3SetMode {
|
|
18
|
+
readonly set: boolean;
|
|
19
|
+
readonly mode?: number | undefined;
|
|
20
|
+
constructor(set: boolean, mode?: number | undefined);
|
|
21
|
+
}
|
|
22
|
+
export declare class Nfsv3SetUid {
|
|
23
|
+
readonly set: boolean;
|
|
24
|
+
readonly uid?: number | undefined;
|
|
25
|
+
constructor(set: boolean, uid?: number | undefined);
|
|
26
|
+
}
|
|
27
|
+
export declare class Nfsv3SetGid {
|
|
28
|
+
readonly set: boolean;
|
|
29
|
+
readonly gid?: number | undefined;
|
|
30
|
+
constructor(set: boolean, gid?: number | undefined);
|
|
31
|
+
}
|
|
32
|
+
export declare class Nfsv3SetSize {
|
|
33
|
+
readonly set: boolean;
|
|
34
|
+
readonly size?: bigint | undefined;
|
|
35
|
+
constructor(set: boolean, size?: bigint | undefined);
|
|
36
|
+
}
|
|
37
|
+
export declare class Nfsv3SetAtime {
|
|
38
|
+
readonly how: Nfsv3TimeHow;
|
|
39
|
+
readonly atime?: Nfsv3Time | undefined;
|
|
40
|
+
constructor(how: Nfsv3TimeHow, atime?: Nfsv3Time | undefined);
|
|
41
|
+
}
|
|
42
|
+
export declare class Nfsv3SetMtime {
|
|
43
|
+
readonly how: Nfsv3TimeHow;
|
|
44
|
+
readonly mtime?: Nfsv3Time | undefined;
|
|
45
|
+
constructor(how: Nfsv3TimeHow, mtime?: Nfsv3Time | undefined);
|
|
46
|
+
}
|
|
47
|
+
export declare class Nfsv3Sattr {
|
|
48
|
+
readonly mode: Nfsv3SetMode;
|
|
49
|
+
readonly uid: Nfsv3SetUid;
|
|
50
|
+
readonly gid: Nfsv3SetGid;
|
|
51
|
+
readonly size: Nfsv3SetSize;
|
|
52
|
+
readonly atime: Nfsv3SetAtime;
|
|
53
|
+
readonly mtime: Nfsv3SetMtime;
|
|
54
|
+
constructor(mode: Nfsv3SetMode, uid: Nfsv3SetUid, gid: Nfsv3SetGid, size: Nfsv3SetSize, atime: Nfsv3SetAtime, mtime: Nfsv3SetMtime);
|
|
55
|
+
}
|
|
56
|
+
export declare class Nfsv3SattrGuard {
|
|
57
|
+
readonly check: boolean;
|
|
58
|
+
readonly objCtime?: Nfsv3Time | undefined;
|
|
59
|
+
constructor(check: boolean, objCtime?: Nfsv3Time | undefined);
|
|
60
|
+
}
|
|
61
|
+
export declare class Nfsv3DirOpArgs {
|
|
62
|
+
readonly dir: Nfsv3Fh;
|
|
63
|
+
readonly name: string;
|
|
64
|
+
constructor(dir: Nfsv3Fh, name: string);
|
|
65
|
+
}
|
|
66
|
+
export declare class Nfsv3WccAttr {
|
|
67
|
+
readonly size: bigint;
|
|
68
|
+
readonly mtime: Nfsv3Time;
|
|
69
|
+
readonly ctime: Nfsv3Time;
|
|
70
|
+
constructor(size: bigint, mtime: Nfsv3Time, ctime: Nfsv3Time);
|
|
71
|
+
}
|
|
72
|
+
export declare class Nfsv3PreOpAttr {
|
|
73
|
+
readonly attributesFollow: boolean;
|
|
74
|
+
readonly attributes?: Nfsv3WccAttr | undefined;
|
|
75
|
+
constructor(attributesFollow: boolean, attributes?: Nfsv3WccAttr | undefined);
|
|
76
|
+
}
|
|
77
|
+
export declare class Nfsv3PostOpAttr {
|
|
78
|
+
readonly attributesFollow: boolean;
|
|
79
|
+
readonly attributes?: Nfsv3Fattr | undefined;
|
|
80
|
+
constructor(attributesFollow: boolean, attributes?: Nfsv3Fattr | undefined);
|
|
81
|
+
}
|
|
82
|
+
export declare class Nfsv3PostOpFh {
|
|
83
|
+
readonly handleFollows: boolean;
|
|
84
|
+
readonly handle?: Nfsv3Fh | undefined;
|
|
85
|
+
constructor(handleFollows: boolean, handle?: Nfsv3Fh | undefined);
|
|
86
|
+
}
|
|
87
|
+
export declare class Nfsv3WccData {
|
|
88
|
+
readonly before: Nfsv3PreOpAttr;
|
|
89
|
+
readonly after: Nfsv3PostOpAttr;
|
|
90
|
+
constructor(before: Nfsv3PreOpAttr, after: Nfsv3PostOpAttr);
|
|
91
|
+
}
|
|
92
|
+
export declare class Nfsv3Fattr {
|
|
93
|
+
readonly type: Nfsv3FType;
|
|
94
|
+
readonly mode: number;
|
|
95
|
+
readonly nlink: number;
|
|
96
|
+
readonly uid: number;
|
|
97
|
+
readonly gid: number;
|
|
98
|
+
readonly size: bigint;
|
|
99
|
+
readonly used: bigint;
|
|
100
|
+
readonly rdev: Nfsv3SpecData;
|
|
101
|
+
readonly fsid: bigint;
|
|
102
|
+
readonly fileid: bigint;
|
|
103
|
+
readonly atime: Nfsv3Time;
|
|
104
|
+
readonly mtime: Nfsv3Time;
|
|
105
|
+
readonly ctime: Nfsv3Time;
|
|
106
|
+
constructor(type: Nfsv3FType, mode: number, nlink: number, uid: number, gid: number, size: bigint, used: bigint, rdev: Nfsv3SpecData, fsid: bigint, fileid: bigint, atime: Nfsv3Time, mtime: Nfsv3Time, ctime: Nfsv3Time);
|
|
107
|
+
}
|
|
108
|
+
export declare class Nfsv3DeviceData {
|
|
109
|
+
readonly devAttributes: Nfsv3Sattr;
|
|
110
|
+
readonly spec: Nfsv3SpecData;
|
|
111
|
+
constructor(devAttributes: Nfsv3Sattr, spec: Nfsv3SpecData);
|
|
112
|
+
}
|
|
113
|
+
export declare class Nfsv3MknodData {
|
|
114
|
+
readonly type: Nfsv3FType;
|
|
115
|
+
readonly chr?: Nfsv3DeviceData | undefined;
|
|
116
|
+
readonly blk?: Nfsv3DeviceData | undefined;
|
|
117
|
+
readonly sock?: Nfsv3Sattr | undefined;
|
|
118
|
+
readonly pipe?: Nfsv3Sattr | undefined;
|
|
119
|
+
constructor(type: Nfsv3FType, chr?: Nfsv3DeviceData | undefined, blk?: Nfsv3DeviceData | undefined, sock?: Nfsv3Sattr | undefined, pipe?: Nfsv3Sattr | undefined);
|
|
120
|
+
}
|
|
121
|
+
export declare class Nfsv3CreateHow {
|
|
122
|
+
readonly mode: Nfsv3CreateMode;
|
|
123
|
+
readonly objAttributes?: Nfsv3Sattr | undefined;
|
|
124
|
+
readonly verf?: Reader | undefined;
|
|
125
|
+
constructor(mode: Nfsv3CreateMode, objAttributes?: Nfsv3Sattr | undefined, verf?: Reader | undefined);
|
|
126
|
+
}
|
|
127
|
+
export declare class Nfsv3WriteHow {
|
|
128
|
+
readonly stable: Nfsv3StableHow;
|
|
129
|
+
constructor(stable: Nfsv3StableHow);
|
|
130
|
+
}
|
|
131
|
+
export declare class Nfsv3Entry {
|
|
132
|
+
readonly fileid: bigint;
|
|
133
|
+
readonly name: string;
|
|
134
|
+
readonly cookie: bigint;
|
|
135
|
+
readonly nextentry?: Nfsv3Entry | undefined;
|
|
136
|
+
constructor(fileid: bigint, name: string, cookie: bigint, nextentry?: Nfsv3Entry | undefined);
|
|
137
|
+
}
|
|
138
|
+
export declare class Nfsv3EntryPlus {
|
|
139
|
+
readonly fileid: bigint;
|
|
140
|
+
readonly name: string;
|
|
141
|
+
readonly cookie: bigint;
|
|
142
|
+
readonly nameAttributes: Nfsv3PostOpAttr;
|
|
143
|
+
readonly nameHandle: Nfsv3PostOpFh;
|
|
144
|
+
readonly nextentry?: Nfsv3EntryPlus | undefined;
|
|
145
|
+
constructor(fileid: bigint, name: string, cookie: bigint, nameAttributes: Nfsv3PostOpAttr, nameHandle: Nfsv3PostOpFh, nextentry?: Nfsv3EntryPlus | undefined);
|
|
146
|
+
}
|
|
147
|
+
export declare class Nfsv3DirList {
|
|
148
|
+
readonly eof: boolean;
|
|
149
|
+
readonly entries?: Nfsv3Entry | undefined;
|
|
150
|
+
constructor(eof: boolean, entries?: Nfsv3Entry | undefined);
|
|
151
|
+
}
|
|
152
|
+
export declare class Nfsv3DirListPlus {
|
|
153
|
+
readonly eof: boolean;
|
|
154
|
+
readonly entries?: Nfsv3EntryPlus | undefined;
|
|
155
|
+
constructor(eof: boolean, entries?: Nfsv3EntryPlus | undefined);
|
|
156
|
+
}
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Nfsv3DirListPlus = exports.Nfsv3DirList = exports.Nfsv3EntryPlus = exports.Nfsv3Entry = exports.Nfsv3WriteHow = exports.Nfsv3CreateHow = exports.Nfsv3MknodData = exports.Nfsv3DeviceData = exports.Nfsv3Fattr = exports.Nfsv3WccData = exports.Nfsv3PostOpFh = exports.Nfsv3PostOpAttr = exports.Nfsv3PreOpAttr = exports.Nfsv3WccAttr = exports.Nfsv3DirOpArgs = exports.Nfsv3SattrGuard = exports.Nfsv3Sattr = exports.Nfsv3SetMtime = exports.Nfsv3SetAtime = exports.Nfsv3SetSize = exports.Nfsv3SetGid = exports.Nfsv3SetUid = exports.Nfsv3SetMode = exports.Nfsv3Fh = exports.Nfsv3SpecData = exports.Nfsv3Time = void 0;
|
|
4
|
+
class Nfsv3Time {
|
|
5
|
+
constructor(seconds, nseconds) {
|
|
6
|
+
this.seconds = seconds;
|
|
7
|
+
this.nseconds = nseconds;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.Nfsv3Time = Nfsv3Time;
|
|
11
|
+
class Nfsv3SpecData {
|
|
12
|
+
constructor(specdata1, specdata2) {
|
|
13
|
+
this.specdata1 = specdata1;
|
|
14
|
+
this.specdata2 = specdata2;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.Nfsv3SpecData = Nfsv3SpecData;
|
|
18
|
+
class Nfsv3Fh {
|
|
19
|
+
constructor(data) {
|
|
20
|
+
this.data = data;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.Nfsv3Fh = Nfsv3Fh;
|
|
24
|
+
class Nfsv3SetMode {
|
|
25
|
+
constructor(set, mode) {
|
|
26
|
+
this.set = set;
|
|
27
|
+
this.mode = mode;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.Nfsv3SetMode = Nfsv3SetMode;
|
|
31
|
+
class Nfsv3SetUid {
|
|
32
|
+
constructor(set, uid) {
|
|
33
|
+
this.set = set;
|
|
34
|
+
this.uid = uid;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.Nfsv3SetUid = Nfsv3SetUid;
|
|
38
|
+
class Nfsv3SetGid {
|
|
39
|
+
constructor(set, gid) {
|
|
40
|
+
this.set = set;
|
|
41
|
+
this.gid = gid;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.Nfsv3SetGid = Nfsv3SetGid;
|
|
45
|
+
class Nfsv3SetSize {
|
|
46
|
+
constructor(set, size) {
|
|
47
|
+
this.set = set;
|
|
48
|
+
this.size = size;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.Nfsv3SetSize = Nfsv3SetSize;
|
|
52
|
+
class Nfsv3SetAtime {
|
|
53
|
+
constructor(how, atime) {
|
|
54
|
+
this.how = how;
|
|
55
|
+
this.atime = atime;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.Nfsv3SetAtime = Nfsv3SetAtime;
|
|
59
|
+
class Nfsv3SetMtime {
|
|
60
|
+
constructor(how, mtime) {
|
|
61
|
+
this.how = how;
|
|
62
|
+
this.mtime = mtime;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
exports.Nfsv3SetMtime = Nfsv3SetMtime;
|
|
66
|
+
class Nfsv3Sattr {
|
|
67
|
+
constructor(mode, uid, gid, size, atime, mtime) {
|
|
68
|
+
this.mode = mode;
|
|
69
|
+
this.uid = uid;
|
|
70
|
+
this.gid = gid;
|
|
71
|
+
this.size = size;
|
|
72
|
+
this.atime = atime;
|
|
73
|
+
this.mtime = mtime;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
exports.Nfsv3Sattr = Nfsv3Sattr;
|
|
77
|
+
class Nfsv3SattrGuard {
|
|
78
|
+
constructor(check, objCtime) {
|
|
79
|
+
this.check = check;
|
|
80
|
+
this.objCtime = objCtime;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
exports.Nfsv3SattrGuard = Nfsv3SattrGuard;
|
|
84
|
+
class Nfsv3DirOpArgs {
|
|
85
|
+
constructor(dir, name) {
|
|
86
|
+
this.dir = dir;
|
|
87
|
+
this.name = name;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
exports.Nfsv3DirOpArgs = Nfsv3DirOpArgs;
|
|
91
|
+
class Nfsv3WccAttr {
|
|
92
|
+
constructor(size, mtime, ctime) {
|
|
93
|
+
this.size = size;
|
|
94
|
+
this.mtime = mtime;
|
|
95
|
+
this.ctime = ctime;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
exports.Nfsv3WccAttr = Nfsv3WccAttr;
|
|
99
|
+
class Nfsv3PreOpAttr {
|
|
100
|
+
constructor(attributesFollow, attributes) {
|
|
101
|
+
this.attributesFollow = attributesFollow;
|
|
102
|
+
this.attributes = attributes;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
exports.Nfsv3PreOpAttr = Nfsv3PreOpAttr;
|
|
106
|
+
class Nfsv3PostOpAttr {
|
|
107
|
+
constructor(attributesFollow, attributes) {
|
|
108
|
+
this.attributesFollow = attributesFollow;
|
|
109
|
+
this.attributes = attributes;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
exports.Nfsv3PostOpAttr = Nfsv3PostOpAttr;
|
|
113
|
+
class Nfsv3PostOpFh {
|
|
114
|
+
constructor(handleFollows, handle) {
|
|
115
|
+
this.handleFollows = handleFollows;
|
|
116
|
+
this.handle = handle;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
exports.Nfsv3PostOpFh = Nfsv3PostOpFh;
|
|
120
|
+
class Nfsv3WccData {
|
|
121
|
+
constructor(before, after) {
|
|
122
|
+
this.before = before;
|
|
123
|
+
this.after = after;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
exports.Nfsv3WccData = Nfsv3WccData;
|
|
127
|
+
class Nfsv3Fattr {
|
|
128
|
+
constructor(type, mode, nlink, uid, gid, size, used, rdev, fsid, fileid, atime, mtime, ctime) {
|
|
129
|
+
this.type = type;
|
|
130
|
+
this.mode = mode;
|
|
131
|
+
this.nlink = nlink;
|
|
132
|
+
this.uid = uid;
|
|
133
|
+
this.gid = gid;
|
|
134
|
+
this.size = size;
|
|
135
|
+
this.used = used;
|
|
136
|
+
this.rdev = rdev;
|
|
137
|
+
this.fsid = fsid;
|
|
138
|
+
this.fileid = fileid;
|
|
139
|
+
this.atime = atime;
|
|
140
|
+
this.mtime = mtime;
|
|
141
|
+
this.ctime = ctime;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
exports.Nfsv3Fattr = Nfsv3Fattr;
|
|
145
|
+
class Nfsv3DeviceData {
|
|
146
|
+
constructor(devAttributes, spec) {
|
|
147
|
+
this.devAttributes = devAttributes;
|
|
148
|
+
this.spec = spec;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
exports.Nfsv3DeviceData = Nfsv3DeviceData;
|
|
152
|
+
class Nfsv3MknodData {
|
|
153
|
+
constructor(type, chr, blk, sock, pipe) {
|
|
154
|
+
this.type = type;
|
|
155
|
+
this.chr = chr;
|
|
156
|
+
this.blk = blk;
|
|
157
|
+
this.sock = sock;
|
|
158
|
+
this.pipe = pipe;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
exports.Nfsv3MknodData = Nfsv3MknodData;
|
|
162
|
+
class Nfsv3CreateHow {
|
|
163
|
+
constructor(mode, objAttributes, verf) {
|
|
164
|
+
this.mode = mode;
|
|
165
|
+
this.objAttributes = objAttributes;
|
|
166
|
+
this.verf = verf;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
exports.Nfsv3CreateHow = Nfsv3CreateHow;
|
|
170
|
+
class Nfsv3WriteHow {
|
|
171
|
+
constructor(stable) {
|
|
172
|
+
this.stable = stable;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
exports.Nfsv3WriteHow = Nfsv3WriteHow;
|
|
176
|
+
class Nfsv3Entry {
|
|
177
|
+
constructor(fileid, name, cookie, nextentry) {
|
|
178
|
+
this.fileid = fileid;
|
|
179
|
+
this.name = name;
|
|
180
|
+
this.cookie = cookie;
|
|
181
|
+
this.nextentry = nextentry;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
exports.Nfsv3Entry = Nfsv3Entry;
|
|
185
|
+
class Nfsv3EntryPlus {
|
|
186
|
+
constructor(fileid, name, cookie, nameAttributes, nameHandle, nextentry) {
|
|
187
|
+
this.fileid = fileid;
|
|
188
|
+
this.name = name;
|
|
189
|
+
this.cookie = cookie;
|
|
190
|
+
this.nameAttributes = nameAttributes;
|
|
191
|
+
this.nameHandle = nameHandle;
|
|
192
|
+
this.nextentry = nextentry;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
exports.Nfsv3EntryPlus = Nfsv3EntryPlus;
|
|
196
|
+
class Nfsv3DirList {
|
|
197
|
+
constructor(eof, entries) {
|
|
198
|
+
this.eof = eof;
|
|
199
|
+
this.entries = entries;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
exports.Nfsv3DirList = Nfsv3DirList;
|
|
203
|
+
class Nfsv3DirListPlus {
|
|
204
|
+
constructor(eof, entries) {
|
|
205
|
+
this.eof = eof;
|
|
206
|
+
this.entries = entries;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
exports.Nfsv3DirListPlus = Nfsv3DirListPlus;
|
|
210
|
+
//# sourceMappingURL=structs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../src/nfs/v3/structs.ts"],"names":[],"mappings":";;;AAMA,MAAa,SAAS;IACpB,YACkB,OAAe,EACf,QAAgB;QADhB,YAAO,GAAP,OAAO,CAAQ;QACf,aAAQ,GAAR,QAAQ,CAAQ;IAC/B,CAAC;CACL;AALD,8BAKC;AAKD,MAAa,aAAa;IACxB,YACkB,SAAiB,EACjB,SAAiB;QADjB,cAAS,GAAT,SAAS,CAAQ;QACjB,cAAS,GAAT,SAAS,CAAQ;IAChC,CAAC;CACL;AALD,sCAKC;AAKD,MAAa,OAAO;IAClB,YAA4B,IAAY;QAAZ,SAAI,GAAJ,IAAI,CAAQ;IAAG,CAAC;CAC7C;AAFD,0BAEC;AAKD,MAAa,YAAY;IACvB,YACkB,GAAY,EACZ,IAAa;QADb,QAAG,GAAH,GAAG,CAAS;QACZ,SAAI,GAAJ,IAAI,CAAS;IAC5B,CAAC;CACL;AALD,oCAKC;AAKD,MAAa,WAAW;IACtB,YACkB,GAAY,EACZ,GAAY;QADZ,QAAG,GAAH,GAAG,CAAS;QACZ,QAAG,GAAH,GAAG,CAAS;IAC3B,CAAC;CACL;AALD,kCAKC;AAKD,MAAa,WAAW;IACtB,YACkB,GAAY,EACZ,GAAY;QADZ,QAAG,GAAH,GAAG,CAAS;QACZ,QAAG,GAAH,GAAG,CAAS;IAC3B,CAAC;CACL;AALD,kCAKC;AAKD,MAAa,YAAY;IACvB,YACkB,GAAY,EACZ,IAAa;QADb,QAAG,GAAH,GAAG,CAAS;QACZ,SAAI,GAAJ,IAAI,CAAS;IAC5B,CAAC;CACL;AALD,oCAKC;AAKD,MAAa,aAAa;IACxB,YACkB,GAAiB,EACjB,KAAiB;QADjB,QAAG,GAAH,GAAG,CAAc;QACjB,UAAK,GAAL,KAAK,CAAY;IAChC,CAAC;CACL;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|
1
|
+
import { StreamingReader } from '@jsonjoy.com/buffers/lib/StreamingReader';
|
|
2
|
+
import { Reader } from '@jsonjoy.com/buffers/lib/Reader';
|
|
3
|
+
export declare class RmRecordDecoder {
|
|
4
|
+
readonly reader: StreamingReader;
|
|
5
|
+
protected fragments: Uint8Array[];
|
|
6
|
+
push(uint8: Uint8Array): void;
|
|
7
|
+
readRecord(): Reader | undefined;
|
|
8
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RmRecordDecoder = void 0;
|
|
4
|
+
const StreamingReader_1 = require("@jsonjoy.com/buffers/lib/StreamingReader");
|
|
5
|
+
const Reader_1 = require("@jsonjoy.com/buffers/lib/Reader");
|
|
6
|
+
const concat_1 = require("@jsonjoy.com/buffers/lib/concat");
|
|
7
|
+
class RmRecordDecoder {
|
|
8
|
+
constructor() {
|
|
9
|
+
this.reader = new StreamingReader_1.StreamingReader();
|
|
10
|
+
this.fragments = [];
|
|
11
|
+
}
|
|
12
|
+
push(uint8) {
|
|
13
|
+
this.reader.push(uint8);
|
|
14
|
+
}
|
|
15
|
+
readRecord() {
|
|
16
|
+
const reader = this.reader;
|
|
17
|
+
let size = reader.size();
|
|
18
|
+
if (size < 4)
|
|
19
|
+
return undefined;
|
|
20
|
+
const x = reader.x;
|
|
21
|
+
READ_FRAGMENT: {
|
|
22
|
+
try {
|
|
23
|
+
const header = reader.u32();
|
|
24
|
+
size -= 4;
|
|
25
|
+
const fin = !!(header & 2147483648);
|
|
26
|
+
const len = header & 2147483647;
|
|
27
|
+
if (size < len)
|
|
28
|
+
break READ_FRAGMENT;
|
|
29
|
+
reader.consume();
|
|
30
|
+
const fragments = this.fragments;
|
|
31
|
+
if (fin) {
|
|
32
|
+
if (!fragments.length)
|
|
33
|
+
return reader.cut(len);
|
|
34
|
+
fragments.push(reader.buf(len));
|
|
35
|
+
const record = (0, concat_1.concatList)(fragments);
|
|
36
|
+
this.fragments = [];
|
|
37
|
+
return record.length ? new Reader_1.Reader(record) : undefined;
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
fragments.push(reader.buf(len));
|
|
41
|
+
return undefined;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
catch (err) {
|
|
45
|
+
reader.x = x;
|
|
46
|
+
if (err instanceof RangeError)
|
|
47
|
+
return undefined;
|
|
48
|
+
else
|
|
49
|
+
throw err;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
reader.x = x;
|
|
53
|
+
return undefined;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.RmRecordDecoder = RmRecordDecoder;
|
|
57
|
+
//# sourceMappingURL=RmRecordDecoder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RmRecordDecoder.js","sourceRoot":"","sources":["../../src/rm/RmRecordDecoder.ts"],"names":[],"mappings":";;;AAAA,8EAAyE;AACzE,4DAAuD;AACvD,4DAA2D;AAE3D,MAAa,eAAe;IAA5B;QACkB,WAAM,GAAG,IAAI,iCAAe,EAAE,CAAC;QACrC,cAAS,GAAiB,EAAE,CAAC;IA0CzC,CAAC;IAxCQ,IAAI,CAAC,KAAiB;QAC3B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC;IAKM,UAAU;QACf,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC3B,IAAI,IAAI,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC;QACzB,IAAI,IAAI,GAAG,CAAC;YAAE,OAAO,SAAS,CAAC;QAC/B,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC;QACnB,aAAa,EAAE,CAAC;YACd,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,EAAE,CAAC;gBAC5B,IAAI,IAAI,CAAC,CAAC;gBACV,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,MAAM,GAAG,UAAqC,CAAC,CAAC;gBAC/D,MAAM,GAAG,GAAG,MAAM,GAAG,UAAqC,CAAC;gBAC3D,IAAI,IAAI,GAAG,GAAG;oBAAE,MAAM,aAAa,CAAC;gBACpC,MAAM,CAAC,OAAO,EAAE,CAAC;gBACjB,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;gBACjC,IAAI,GAAG,EAAE,CAAC;oBACR,IAAI,CAAC,SAAS,CAAC,MAAM;wBAAE,OAAO,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;oBAC9C,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;oBAChC,MAAM,MAAM,GAAG,IAAA,mBAAU,EAAC,SAAS,CAAC,CAAC;oBACrC,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;oBACpB,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,eAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;gBACxD,CAAC;qBAAM,CAAC;oBACN,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;oBAChC,OAAO,SAAS,CAAC;gBACnB,CAAC;YACH,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC;gBACb,IAAI,GAAG,YAAY,UAAU;oBAAE,OAAO,SAAS,CAAC;;oBAC3C,MAAM,GAAG,CAAC;YACjB,CAAC;QACH,CAAC;QACD,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC;QACb,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AA5CD,0CA4CC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IWriter, IWriterGrowable } from '@jsonjoy.com/util/lib/buffers';
|
|
2
|
+
export declare class RmRecordEncoder<W extends IWriter & IWriterGrowable = IWriter & IWriterGrowable> {
|
|
3
|
+
readonly writer: W;
|
|
4
|
+
constructor(writer?: W);
|
|
5
|
+
encodeHdr(fin: 0 | 1, length: number): Uint8Array;
|
|
6
|
+
encodeRecord(record: Uint8Array): Uint8Array;
|
|
7
|
+
writeHdr(fin: 0 | 1, length: number): void;
|
|
8
|
+
writeRecord(record: Uint8Array): void;
|
|
9
|
+
writeFragment(record: Uint8Array, offset: number, length: number, fin: 0 | 1): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RmRecordEncoder = void 0;
|
|
4
|
+
const Writer_1 = require("@jsonjoy.com/util/lib/buffers/Writer");
|
|
5
|
+
class RmRecordEncoder {
|
|
6
|
+
constructor(writer = new Writer_1.Writer()) {
|
|
7
|
+
this.writer = writer;
|
|
8
|
+
}
|
|
9
|
+
encodeHdr(fin, length) {
|
|
10
|
+
this.writeHdr(fin, length);
|
|
11
|
+
return this.writer.flush();
|
|
12
|
+
}
|
|
13
|
+
encodeRecord(record) {
|
|
14
|
+
this.writeRecord(record);
|
|
15
|
+
return this.writer.flush();
|
|
16
|
+
}
|
|
17
|
+
writeHdr(fin, length) {
|
|
18
|
+
this.writer.u32((fin ? 2147483648 : 0) + length);
|
|
19
|
+
}
|
|
20
|
+
writeRecord(record) {
|
|
21
|
+
const length = record.length;
|
|
22
|
+
if (length <= 2147483647) {
|
|
23
|
+
const writer = this.writer;
|
|
24
|
+
writer.u32(2147483648 + length);
|
|
25
|
+
writer.buf(record, length);
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
let offset = 0;
|
|
29
|
+
while (offset < length) {
|
|
30
|
+
const fragmentLength = Math.min(length - offset, 0x7fffffff);
|
|
31
|
+
const fin = fragmentLength + offset >= length ? 1 : 0;
|
|
32
|
+
this.writeFragment(record, offset, fragmentLength, fin);
|
|
33
|
+
offset += fragmentLength;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
writeFragment(record, offset, length, fin) {
|
|
37
|
+
this.writeHdr(fin, length);
|
|
38
|
+
const fragment = record.subarray(offset, offset + length);
|
|
39
|
+
this.writer.buf(fragment, length);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.RmRecordEncoder = RmRecordEncoder;
|
|
43
|
+
//# sourceMappingURL=RmRecordEncoder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RmRecordEncoder.js","sourceRoot":"","sources":["../../src/rm/RmRecordEncoder.ts"],"names":[],"mappings":";;;AAAA,iEAA4D;AAG5D,MAAa,eAAe;IAC1B,YAA4B,SAAY,IAAI,eAAM,EAAS;QAA/B,WAAM,GAAN,MAAM,CAAyB;IAAG,CAAC;IAExD,SAAS,CAAC,GAAU,EAAE,MAAc;QACzC,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;QAC3B,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;IAC7B,CAAC;IAEM,YAAY,CAAC,MAAkB;QACpC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QACzB,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;IAC7B,CAAC;IAEM,QAAQ,CAAC,GAAU,EAAE,MAAc;QACxC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,UAAqC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC;IAC9E,CAAC;IAEM,WAAW,CAAC,MAAkB;QACnC,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC7B,IAAI,MAAM,IAAI,UAAU,EAAE,CAAC;YACzB,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;YAC3B,MAAM,CAAC,GAAG,CAAC,UAAqC,GAAG,MAAM,CAAC,CAAC;YAC3D,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;YAC3B,OAAO;QACT,CAAC;QACD,IAAI,MAAM,GAAG,CAAC,CAAC;QACf,OAAO,MAAM,GAAG,MAAM,EAAE,CAAC;YACvB,MAAM,cAAc,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,MAAM,EAAE,UAAU,CAAC,CAAC;YAC7D,MAAM,GAAG,GAAG,cAAc,GAAG,MAAM,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACtD,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,GAAG,CAAC,CAAC;YACxD,MAAM,IAAI,cAAc,CAAC;QAC3B,CAAC;IACH,CAAC;IAEM,aAAa,CAAC,MAAkB,EAAE,MAAc,EAAE,MAAc,EAAE,GAAU;QACjF,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;QAC3B,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;QAC1D,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACpC,CAAC;CACF;AAvCD,0CAuCC"}
|
package/lib/rm/index.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./RmRecordDecoder"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./RmRecordEncoder"), exports);
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/rm/index.ts"],"names":[],"mappings":";;;AAAA,4DAAkC;AAClC,4DAAkC"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RpcMessageDecoder = void 0;
|
|
4
|
+
const Reader_1 = require("@jsonjoy.com/buffers/lib/Reader");
|
|
5
|
+
const errors_1 = require("./errors");
|
|
6
|
+
const messages_1 = require("./messages");
|
|
7
|
+
class RpcMessageDecoder {
|
|
8
|
+
decodeMessage(reader) {
|
|
9
|
+
const startPos = reader.x;
|
|
10
|
+
try {
|
|
11
|
+
if (reader.size() < 8)
|
|
12
|
+
return undefined;
|
|
13
|
+
const xid = reader.u32();
|
|
14
|
+
const msgType = reader.u32();
|
|
15
|
+
if (msgType === 0) {
|
|
16
|
+
if (reader.size() < 20)
|
|
17
|
+
return (reader.x = startPos), undefined;
|
|
18
|
+
const rpcvers = reader.u32();
|
|
19
|
+
const prog = reader.u32();
|
|
20
|
+
const vers = reader.u32();
|
|
21
|
+
const proc = reader.u32();
|
|
22
|
+
const cred = this.readOpaqueAuth(reader);
|
|
23
|
+
if (!cred)
|
|
24
|
+
return (reader.x = startPos), undefined;
|
|
25
|
+
const verf = this.readOpaqueAuth(reader);
|
|
26
|
+
if (!verf)
|
|
27
|
+
return (reader.x = startPos), undefined;
|
|
28
|
+
const params = reader.size() > 0 ? reader.cut(reader.size()) : undefined;
|
|
29
|
+
return new messages_1.RpcCallMessage(xid, rpcvers, prog, vers, proc, cred, verf, params);
|
|
30
|
+
}
|
|
31
|
+
else if (msgType === 1) {
|
|
32
|
+
if (reader.size() < 4)
|
|
33
|
+
return (reader.x = startPos), undefined;
|
|
34
|
+
const replyStat = reader.u32();
|
|
35
|
+
if (replyStat === 0) {
|
|
36
|
+
const verf = this.readOpaqueAuth(reader);
|
|
37
|
+
if (!verf || reader.size() < 4)
|
|
38
|
+
return (reader.x = startPos), undefined;
|
|
39
|
+
const acceptStat = reader.u32();
|
|
40
|
+
let mismatchInfo;
|
|
41
|
+
if (acceptStat === 2) {
|
|
42
|
+
if (reader.size() < 8)
|
|
43
|
+
return (reader.x = startPos), undefined;
|
|
44
|
+
const low = reader.u32();
|
|
45
|
+
const high = reader.u32();
|
|
46
|
+
mismatchInfo = new messages_1.RpcMismatchInfo(low, high);
|
|
47
|
+
}
|
|
48
|
+
const results = reader.size() > 0 ? reader.cut(reader.size()) : undefined;
|
|
49
|
+
return new messages_1.RpcAcceptedReplyMessage(xid, verf, acceptStat, mismatchInfo, results);
|
|
50
|
+
}
|
|
51
|
+
else if (replyStat === 1) {
|
|
52
|
+
if (reader.size() < 4)
|
|
53
|
+
return (reader.x = startPos), undefined;
|
|
54
|
+
const rejectStat = reader.u32();
|
|
55
|
+
let mismatchInfo;
|
|
56
|
+
let authStat;
|
|
57
|
+
if (rejectStat === 0) {
|
|
58
|
+
if (reader.size() < 8)
|
|
59
|
+
return (reader.x = startPos), undefined;
|
|
60
|
+
const low = reader.u32();
|
|
61
|
+
const high = reader.u32();
|
|
62
|
+
mismatchInfo = new messages_1.RpcMismatchInfo(low, high);
|
|
63
|
+
if (!mismatchInfo)
|
|
64
|
+
return (reader.x = startPos), undefined;
|
|
65
|
+
}
|
|
66
|
+
else if (rejectStat === 1) {
|
|
67
|
+
if (reader.size() < 4)
|
|
68
|
+
return (reader.x = startPos), undefined;
|
|
69
|
+
authStat = reader.u32();
|
|
70
|
+
}
|
|
71
|
+
return new messages_1.RpcRejectedReplyMessage(xid, rejectStat, mismatchInfo, authStat);
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
throw new errors_1.RpcDecodingError('Invalid reply_stat');
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
throw new errors_1.RpcDecodingError('Invalid msg_type');
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
catch (err) {
|
|
82
|
+
if (err instanceof RangeError) {
|
|
83
|
+
reader.x = startPos;
|
|
84
|
+
return undefined;
|
|
85
|
+
}
|
|
86
|
+
throw err;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
readOpaqueAuth(reader) {
|
|
90
|
+
if (reader.size() < 8)
|
|
91
|
+
return undefined;
|
|
92
|
+
const flavor = reader.u32();
|
|
93
|
+
const length = reader.u32();
|
|
94
|
+
if (length > 400)
|
|
95
|
+
throw new errors_1.RpcDecodingError('Auth body too large');
|
|
96
|
+
const paddedLength = (length + 3) & ~3;
|
|
97
|
+
if (reader.size() < paddedLength)
|
|
98
|
+
return undefined;
|
|
99
|
+
const body = length > 0 ? reader.cut(length) : new Reader_1.Reader(new Uint8Array(0));
|
|
100
|
+
const padding = paddedLength - length;
|
|
101
|
+
if (padding > 0)
|
|
102
|
+
reader.skip(padding);
|
|
103
|
+
return new messages_1.RpcOpaqueAuth(flavor, body);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
exports.RpcMessageDecoder = RpcMessageDecoder;
|
|
107
|
+
//# sourceMappingURL=RpcMessageDecoder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RpcMessageDecoder.js","sourceRoot":"","sources":["../../src/rpc/RpcMessageDecoder.ts"],"names":[],"mappings":";;;AAAA,4DAAuD;AAEvD,qCAA0C;AAC1C,yCAOoB;AAEpB,MAAa,iBAAiB;IACrB,aAAa,CAAC,MAAc;QACjC,MAAM,QAAQ,GAAG,MAAM,CAAC,CAAC,CAAC;QAC1B,IAAI,CAAC;YACH,IAAI,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC;gBAAE,OAAO,SAAS,CAAC;YACxC,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,EAAE,CAAC;YACzB,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,EAAE,CAAC;YAC7B,IAAI,OAAO,MAAoB,EAAE,CAAC;gBAChC,IAAI,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE;oBAAE,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,QAAQ,CAAC,EAAE,SAAS,CAAC;gBAChE,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,EAAE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