@effect-vfs/core 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/BytePath.d.ts +33 -2
- package/dist/BytePath.d.ts.map +1 -1
- package/dist/BytePath.js +1 -1
- package/dist/Snapshot.d.ts +58 -2
- package/dist/Snapshot.d.ts.map +1 -1
- package/dist/Snapshot.js +57 -1
- package/dist/SnapshotDelta.d.ts +113 -3
- package/dist/SnapshotDelta.d.ts.map +1 -1
- package/dist/SnapshotDelta.js +112 -2
- package/dist/VirtualFileSystem.d.ts +919 -10
- package/dist/VirtualFileSystem.d.ts.map +1 -1
- package/dist/VirtualFileSystem.js +575 -7
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/internal/bytePath.d.ts.map +1 -1
- package/dist/internal/bytePath.js +5 -10
- package/dist/internal/bytes.d.ts +6 -0
- package/dist/internal/bytes.d.ts.map +1 -0
- package/dist/internal/bytes.js +17 -0
- package/dist/internal/canonicalBase64.d.ts +13 -5
- package/dist/internal/canonicalBase64.d.ts.map +1 -1
- package/dist/internal/canonicalBase64.js +28 -6
- package/dist/internal/image.d.ts +76 -90
- package/dist/internal/image.d.ts.map +1 -1
- package/dist/internal/image.js +98 -89
- package/dist/internal/metadata.d.ts +28 -0
- package/dist/internal/metadata.d.ts.map +1 -0
- package/dist/internal/metadata.js +29 -0
- package/dist/internal/snapshotDelta.d.ts.map +1 -1
- package/dist/internal/snapshotDelta.js +346 -300
- package/dist/internal/snapshotDeltaModel.d.ts +2 -2
- package/dist/internal/snapshotDeltaModel.d.ts.map +1 -1
- package/dist/internal/snapshotDeltaModel.js +3 -1
- package/dist/internal/virtualFileSystem/errors.d.ts +5 -0
- package/dist/internal/virtualFileSystem/errors.d.ts.map +1 -1
- package/dist/internal/virtualFileSystem/errors.js +19 -0
- package/dist/internal/virtualFileSystem/fixture.d.ts.map +1 -1
- package/dist/internal/virtualFileSystem/fixture.js +74 -74
- package/dist/internal/virtualFileSystem/overlayContent.d.ts.map +1 -1
- package/dist/internal/virtualFileSystem/overlayContent.js +9 -2
- package/dist/internal/virtualFileSystem/overlayDiff.d.ts +2 -11
- package/dist/internal/virtualFileSystem/overlayDiff.d.ts.map +1 -1
- package/dist/internal/virtualFileSystem/overlayDiff.js +45 -71
- package/dist/internal/virtualFileSystem/path.d.ts +15 -14
- package/dist/internal/virtualFileSystem/path.d.ts.map +1 -1
- package/dist/internal/virtualFileSystem/path.js +57 -54
- package/dist/internal/virtualFileSystem/testHooks.d.ts.map +1 -1
- package/dist/internal/virtualFileSystem/watchHub.d.ts.map +1 -1
- package/dist/internal/virtualFileSystem/watchHub.js +13 -13
- package/dist/internal/virtualFileSystem.d.ts +91 -15
- package/dist/internal/virtualFileSystem.d.ts.map +1 -1
- package/dist/internal/virtualFileSystem.js +470 -392
- package/package.json +15 -5
package/dist/internal/image.js
CHANGED
|
@@ -1,37 +1,28 @@
|
|
|
1
1
|
// Snapshot validation and serialization used by VirtualFileSystem.
|
|
2
2
|
import * as ByteSize from "effect/ByteSize";
|
|
3
3
|
import * as Effect from "effect/Effect";
|
|
4
|
-
import * as
|
|
4
|
+
import * as Match from "effect/Match";
|
|
5
5
|
import * as Result from "effect/Result";
|
|
6
6
|
import * as Schema from "effect/Schema";
|
|
7
7
|
import { DecodeLimits, ImageError, SnapshotTypeId } from "../Snapshot.js";
|
|
8
|
-
import
|
|
8
|
+
import { CanonicalBase64 } from "./canonicalBase64.js";
|
|
9
|
+
import { StoredMetadata, WireStoredMetadata } from "./metadata.js";
|
|
9
10
|
class SnapshotImpl {
|
|
10
11
|
[SnapshotTypeId] = SnapshotTypeId;
|
|
11
12
|
}
|
|
12
|
-
const integer = Schema.String.check(Schema.isPattern(/^(?:0|-?[1-9][0-9]{0,127})(?![\s\S])/));
|
|
13
13
|
/** @internal */
|
|
14
|
-
export
|
|
15
|
-
uid: Schema.Natural,
|
|
16
|
-
gid: Schema.Natural,
|
|
17
|
-
mode: Schema.Natural.check(Schema.isLessThanOrEqualTo(0o7777)),
|
|
18
|
-
atimeNs: integer,
|
|
19
|
-
mtimeNs: integer,
|
|
20
|
-
ctimeNs: integer,
|
|
21
|
-
birthtimeNs: integer
|
|
22
|
-
});
|
|
14
|
+
export { StoredMetadata };
|
|
23
15
|
const id = Schema.String.check(Schema.isMinLength(1), Schema.isMaxLength(128));
|
|
24
16
|
/** @internal */
|
|
25
|
-
export const Record = Schema.
|
|
26
|
-
|
|
17
|
+
export const Record = Schema.TaggedUnion({
|
|
18
|
+
directory: {
|
|
27
19
|
id,
|
|
28
|
-
kind: Schema.Literal("directory"),
|
|
29
20
|
metadata: StoredMetadata,
|
|
30
|
-
entries: Schema.Array(Schema.Struct({ name:
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
21
|
+
entries: Schema.Array(Schema.Struct({ name: CanonicalBase64.Encoded, target: id }))
|
|
22
|
+
},
|
|
23
|
+
file: { id, metadata: StoredMetadata, data: CanonicalBase64.Encoded },
|
|
24
|
+
symlink: { id, metadata: StoredMetadata, target: CanonicalBase64.Encoded }
|
|
25
|
+
});
|
|
35
26
|
/** @internal */
|
|
36
27
|
export const Document = Schema.Struct({
|
|
37
28
|
format: Schema.Literal("effect-vfs"),
|
|
@@ -39,97 +30,111 @@ export const Document = Schema.Struct({
|
|
|
39
30
|
root: id,
|
|
40
31
|
records: Schema.Array(Record)
|
|
41
32
|
});
|
|
33
|
+
const WireRecord = Schema.TaggedUnion({
|
|
34
|
+
directory: {
|
|
35
|
+
id,
|
|
36
|
+
metadata: WireStoredMetadata,
|
|
37
|
+
entries: Schema.Array(Schema.Struct({ name: Schema.String, target: id }))
|
|
38
|
+
},
|
|
39
|
+
file: { id, metadata: WireStoredMetadata, data: Schema.String },
|
|
40
|
+
symlink: { id, metadata: WireStoredMetadata, target: Schema.String }
|
|
41
|
+
});
|
|
42
|
+
const WireDocument = Schema.Struct({
|
|
43
|
+
format: Schema.Literal("effect-vfs"),
|
|
44
|
+
version: Schema.Literal(1),
|
|
45
|
+
root: id,
|
|
46
|
+
records: Schema.Array(WireRecord)
|
|
47
|
+
});
|
|
48
|
+
const VersionProbe = Schema.Struct({
|
|
49
|
+
format: Schema.Literal("effect-vfs"),
|
|
50
|
+
version: Schema.Unknown
|
|
51
|
+
});
|
|
42
52
|
const snapshots = new WeakMap();
|
|
43
53
|
/** @internal */
|
|
44
|
-
export const decodedLength = CanonicalBase64.decodedLength;
|
|
45
|
-
/** @internal */
|
|
46
|
-
export const base64 = (input) => {
|
|
47
|
-
// Effect's encoder concatenates individual characters. Join bounded chunks so snapshots
|
|
48
|
-
// retain flat strings instead of those intermediate string chains. A multiple of three
|
|
49
|
-
// keeps padding in the final chunk only, preserving canonical base64.
|
|
50
|
-
const chunkBytes = 12_288;
|
|
51
|
-
const chunks = [];
|
|
52
|
-
for (let offset = 0; offset < input.length; offset += chunkBytes) {
|
|
53
|
-
chunks.push(Encoding.encodeBase64(input.subarray(offset, offset + chunkBytes)));
|
|
54
|
-
}
|
|
55
|
-
return chunks.join("");
|
|
56
|
-
};
|
|
57
|
-
const error = (code, field) => new ImageError({ code, ...(field === undefined ? {} : { field }) });
|
|
58
|
-
/** @internal */
|
|
59
|
-
export const bytes = (value) => {
|
|
60
|
-
return CanonicalBase64.decodeTrusted(value);
|
|
61
|
-
};
|
|
62
|
-
/** @internal */
|
|
63
54
|
export const inspect = (snapshot) => Effect.suspend(() => {
|
|
64
55
|
const document = snapshots.get(snapshot);
|
|
65
|
-
return document === undefined
|
|
56
|
+
return document === undefined
|
|
57
|
+
? new ImageError({ code: "InvalidStructure", field: "snapshot" })
|
|
58
|
+
: Effect.succeed(document);
|
|
66
59
|
});
|
|
67
60
|
/** @internal */
|
|
68
|
-
export const capture = Effect.fnUntraced(function* (input, limits) {
|
|
69
|
-
const
|
|
70
|
-
if (Result.isFailure(
|
|
71
|
-
return yield*
|
|
72
|
-
|
|
61
|
+
export const capture = Effect.fnUntraced(function* (input, limits, trusted = false) {
|
|
62
|
+
const wire = trusted ? undefined : Schema.decodeUnknownResult(WireDocument, { onExcessProperty: "error" })(input);
|
|
63
|
+
if (wire !== undefined && Result.isFailure(wire)) {
|
|
64
|
+
return yield* new ImageError({ code: "InvalidStructure", field: "document" });
|
|
65
|
+
}
|
|
66
|
+
const decoded = trusted ? undefined : Schema.decodeUnknownResult(Document, { onExcessProperty: "error" })(input);
|
|
67
|
+
if (decoded !== undefined && Result.isFailure(decoded)) {
|
|
68
|
+
return yield* new ImageError({ code: "InvalidEncoding", field: "document" });
|
|
69
|
+
}
|
|
70
|
+
// SAFETY: a trusted caller passes a Document it built; an untrusted one has just been decoded.
|
|
71
|
+
const document = decoded === undefined ? input : decoded.success;
|
|
73
72
|
const records = new Map();
|
|
74
73
|
let entries = 0;
|
|
75
74
|
let payload = ByteSize.zero;
|
|
76
75
|
if (limits !== undefined && document.records.length > limits.maxRecords) {
|
|
77
|
-
return yield*
|
|
76
|
+
return yield* new ImageError({ code: "LimitExceeded", field: "records" });
|
|
78
77
|
}
|
|
79
78
|
for (const record of document.records) {
|
|
80
79
|
if (records.has(record.id))
|
|
81
|
-
return yield*
|
|
80
|
+
return yield* new ImageError({ code: "InvalidStructure", field: "id" });
|
|
82
81
|
records.set(record.id, record);
|
|
83
|
-
|
|
82
|
+
Match.value(record).pipe(Match.tag("directory", (record) => {
|
|
84
83
|
entries += record.entries.length;
|
|
84
|
+
}), Match.undefined);
|
|
85
85
|
}
|
|
86
|
-
if (limits !== undefined && entries > limits.maxEntries)
|
|
87
|
-
return yield*
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
86
|
+
if (limits !== undefined && entries > limits.maxEntries) {
|
|
87
|
+
return yield* new ImageError({ code: "LimitExceeded", field: "entries" });
|
|
88
|
+
}
|
|
89
|
+
// Count every payload before allocating any decoded payload buffer. Trusted records carry
|
|
90
|
+
// base64 this module produced, so the scan only runs when a limit depends on the tally.
|
|
91
|
+
if (!trusted || limits !== undefined) {
|
|
92
|
+
for (const record of document.records) {
|
|
93
|
+
const values = Match.value(record).pipe(Match.tag("directory", (record) => record.entries.map((entry) => entry.name)), Match.tag("file", (record) => [record.data]), Match.tag("symlink", (record) => [record.target]), Match.exhaustive);
|
|
94
|
+
for (const value of values) {
|
|
95
|
+
if (!CanonicalBase64.is(value)) {
|
|
96
|
+
return yield* new ImageError({ code: "InvalidEncoding", field: record.id });
|
|
97
|
+
}
|
|
98
|
+
payload = ByteSize.sum(payload, ByteSize.bytes(CanonicalBase64.decodedLength(value)));
|
|
99
|
+
if (limits !== undefined && ByteSize.isGreaterThan(payload, limits.maxDecodedBytes)) {
|
|
100
|
+
return yield* new ImageError({ code: "LimitExceeded", field: "bytes" });
|
|
101
|
+
}
|
|
99
102
|
}
|
|
100
103
|
}
|
|
101
104
|
}
|
|
102
105
|
const root = records.get(document.root);
|
|
103
|
-
if (root
|
|
104
|
-
return yield*
|
|
106
|
+
if (root === undefined || !Record.guards.directory(root)) {
|
|
107
|
+
return yield* new ImageError({ code: "InvalidStructure", field: "root" });
|
|
108
|
+
}
|
|
105
109
|
const parents = new Map();
|
|
106
110
|
for (const record of document.records) {
|
|
107
|
-
if (
|
|
111
|
+
if (Record.guards.directory(record)) {
|
|
108
112
|
const names = new Set();
|
|
109
113
|
for (const entry of record.entries) {
|
|
110
|
-
if (names.has(entry.name) || decodedLength(entry.name) < 1 ||
|
|
111
|
-
|
|
112
|
-
|
|
114
|
+
if (names.has(entry.name) || CanonicalBase64.decodedLength(entry.name) < 1 ||
|
|
115
|
+
CanonicalBase64.decodedLength(entry.name) > 255)
|
|
116
|
+
return yield* new ImageError({ code: "InvalidStructure", field: "name" });
|
|
113
117
|
names.add(entry.name);
|
|
114
|
-
const name =
|
|
118
|
+
const name = yield* CanonicalBase64.decode(entry.name);
|
|
115
119
|
if (name.includes(0) || name.includes(47) || (name.length === 1 && name[0] === 46) ||
|
|
116
120
|
(name.length === 2 && name[0] === 46 && name[1] === 46))
|
|
117
|
-
return yield*
|
|
121
|
+
return yield* new ImageError({ code: "InvalidStructure", field: "name" });
|
|
118
122
|
const target = records.get(entry.target);
|
|
119
123
|
if (target === undefined)
|
|
120
|
-
return yield*
|
|
124
|
+
return yield* new ImageError({ code: "InvalidStructure", field: "target" });
|
|
121
125
|
parents.set(target.id, (parents.get(target.id) ?? 0) + 1);
|
|
122
126
|
}
|
|
123
127
|
}
|
|
124
|
-
else if (
|
|
125
|
-
return yield*
|
|
128
|
+
else if (Record.guards.symlink(record) && (yield* CanonicalBase64.decode(record.target)).includes(0)) {
|
|
129
|
+
return yield* new ImageError({ code: "InvalidStructure", field: "symlink" });
|
|
126
130
|
}
|
|
127
131
|
}
|
|
128
132
|
if (parents.has(root.id))
|
|
129
|
-
return yield*
|
|
133
|
+
return yield* new ImageError({ code: "InvalidStructure", field: "root" });
|
|
130
134
|
for (const record of document.records) {
|
|
131
|
-
|
|
132
|
-
|
|
135
|
+
const invalidParent = Match.value(record).pipe(Match.tag("directory", (record) => parents.get(record.id) !== 1), Match.tag("file", (record) => !parents.has(record.id)), Match.tag("symlink", (record) => !parents.has(record.id)), Match.exhaustive);
|
|
136
|
+
if (record !== root && invalidParent) {
|
|
137
|
+
return yield* new ImageError({ code: "InvalidStructure", field: "parent" });
|
|
133
138
|
}
|
|
134
139
|
}
|
|
135
140
|
const visited = new Set();
|
|
@@ -140,39 +145,43 @@ export const capture = Effect.fnUntraced(function* (input, limits) {
|
|
|
140
145
|
continue;
|
|
141
146
|
visited.add(next);
|
|
142
147
|
const record = records.get(next);
|
|
143
|
-
if (record
|
|
144
|
-
|
|
145
|
-
|
|
148
|
+
if (record !== undefined) {
|
|
149
|
+
Match.value(record).pipe(Match.tag("directory", (record) => {
|
|
150
|
+
for (const entry of record.entries)
|
|
151
|
+
pending.push(entry.target);
|
|
152
|
+
}), Match.tag("file", () => undefined), Match.tag("symlink", () => undefined), Match.exhaustive);
|
|
146
153
|
}
|
|
147
154
|
}
|
|
148
155
|
if (visited.size !== records.size)
|
|
149
|
-
return yield*
|
|
156
|
+
return yield* new ImageError({ code: "InvalidStructure", field: "reachability" });
|
|
150
157
|
const snapshot = Object.freeze(new SnapshotImpl());
|
|
151
158
|
snapshots.set(snapshot, document);
|
|
152
159
|
return snapshot;
|
|
153
160
|
});
|
|
154
161
|
/** @internal */
|
|
155
162
|
export const encodeSnapshot = Effect.fn("VirtualFileSystem.encodeSnapshot")(function* (snapshot) {
|
|
156
|
-
const text = yield* Schema.encodeEffect(Schema.fromJsonString(
|
|
163
|
+
const text = yield* Schema.encodeEffect(Schema.fromJsonString(Document))(yield* inspect(snapshot)).pipe(Effect.mapError(() => new ImageError({ code: "InvalidStructure", field: "text" })));
|
|
157
164
|
return new TextEncoder().encode(text);
|
|
158
165
|
});
|
|
159
166
|
/** @internal */
|
|
160
167
|
export const decodeSnapshot = Effect.fn("VirtualFileSystem.decodeSnapshot")(function* (input, limits) {
|
|
161
168
|
const checked = Schema.decodeResult(DecodeLimits, { onExcessProperty: "error" })(limits);
|
|
162
169
|
if (Result.isFailure(checked))
|
|
163
|
-
return yield*
|
|
164
|
-
if (!(input instanceof Uint8Array) || !(input.buffer instanceof ArrayBuffer))
|
|
165
|
-
return yield*
|
|
170
|
+
return yield* new ImageError({ code: "InvalidStructure", field: "limits" });
|
|
171
|
+
if (!(input instanceof Uint8Array) || !(input.buffer instanceof ArrayBuffer)) {
|
|
172
|
+
return yield* new ImageError({ code: "InvalidEncoding", field: "input" });
|
|
173
|
+
}
|
|
166
174
|
if (ByteSize.isGreaterThan(ByteSize.bytes(input.byteLength), checked.success.maxEncodedBytes)) {
|
|
167
|
-
return yield*
|
|
175
|
+
return yield* new ImageError({ code: "LimitExceeded", field: "encodedBytes" });
|
|
168
176
|
}
|
|
169
177
|
const text = yield* Effect.try({
|
|
170
178
|
try: () => new TextDecoder("utf-8", { fatal: true }).decode(new Uint8Array(input)),
|
|
171
|
-
catch: () =>
|
|
179
|
+
catch: () => new ImageError({ code: "InvalidEncoding", field: "text" })
|
|
172
180
|
});
|
|
173
|
-
const value = yield* Schema.decodeEffect(Schema.fromJsonString(Schema.Unknown))(text).pipe(Effect.mapError(() =>
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
return yield*
|
|
181
|
+
const value = yield* Schema.decodeEffect(Schema.fromJsonString(Schema.Unknown))(text).pipe(Effect.mapError(() => new ImageError({ code: "InvalidEncoding", field: "text" })));
|
|
182
|
+
const version = Schema.decodeUnknownResult(VersionProbe)(value);
|
|
183
|
+
if (Result.isSuccess(version) && version.success.version !== 1) {
|
|
184
|
+
return yield* new ImageError({ code: "UnsupportedVersion", field: "version" });
|
|
185
|
+
}
|
|
177
186
|
return yield* capture(value, checked.success);
|
|
178
187
|
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as Schema from "effect/Schema";
|
|
2
|
+
/** @internal */
|
|
3
|
+
export declare const Timestamp: Schema.BigInt;
|
|
4
|
+
/** @internal */
|
|
5
|
+
export declare const TimestampFromString: Schema.decodeTo<Schema.BigInt, Schema.String, never, never>;
|
|
6
|
+
/** @internal */
|
|
7
|
+
export declare const WireStoredMetadata: Schema.Struct<{
|
|
8
|
+
readonly uid: Schema.Natural;
|
|
9
|
+
readonly gid: Schema.Natural;
|
|
10
|
+
readonly mode: Schema.Natural;
|
|
11
|
+
readonly atimeNs: Schema.String;
|
|
12
|
+
readonly mtimeNs: Schema.String;
|
|
13
|
+
readonly ctimeNs: Schema.String;
|
|
14
|
+
readonly birthtimeNs: Schema.String;
|
|
15
|
+
}>;
|
|
16
|
+
/** @internal */
|
|
17
|
+
export declare const StoredMetadata: Schema.Struct<{
|
|
18
|
+
readonly uid: Schema.Natural;
|
|
19
|
+
readonly gid: Schema.Natural;
|
|
20
|
+
readonly mode: Schema.Natural;
|
|
21
|
+
readonly atimeNs: Schema.decodeTo<Schema.BigInt, Schema.String, never, never>;
|
|
22
|
+
readonly mtimeNs: Schema.decodeTo<Schema.BigInt, Schema.String, never, never>;
|
|
23
|
+
readonly ctimeNs: Schema.decodeTo<Schema.BigInt, Schema.String, never, never>;
|
|
24
|
+
readonly birthtimeNs: Schema.decodeTo<Schema.BigInt, Schema.String, never, never>;
|
|
25
|
+
}>;
|
|
26
|
+
/** @internal */
|
|
27
|
+
export type StoredMetadata = typeof StoredMetadata.Type;
|
|
28
|
+
//# sourceMappingURL=metadata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../src/internal/metadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAKvC,gBAAgB;AAChB,eAAO,MAAM,SAAS,eAGrB,CAAA;AAED,gBAAgB;AAChB,eAAO,MAAM,mBAAmB,6DAE0C,CAAA;AAE1E,gBAAgB;AAChB,eAAO,MAAM,kBAAkB;;;;;;;;EAQ7B,CAAA;AAEF,gBAAgB;AAChB,eAAO,MAAM,cAAc;;;;;;;;EAQzB,CAAA;AAEF,gBAAgB;AAChB,MAAM,MAAM,cAAc,GAAG,OAAO,cAAc,CAAC,IAAI,CAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as Schema from "effect/Schema";
|
|
2
|
+
import * as SchemaTransformation from "effect/SchemaTransformation";
|
|
3
|
+
const MAX_TIMESTAMP = 10n ** 128n - 1n;
|
|
4
|
+
/** @internal */
|
|
5
|
+
export const Timestamp = Schema.BigInt.check(Schema.isGreaterThanOrEqualToBigInt(-MAX_TIMESTAMP), Schema.isLessThanOrEqualToBigInt(MAX_TIMESTAMP));
|
|
6
|
+
/** @internal */
|
|
7
|
+
export const TimestampFromString = Schema.String
|
|
8
|
+
.check(Schema.isPattern(/^-?[0-9]{1,128}$/))
|
|
9
|
+
.pipe(Schema.decodeTo(Timestamp, SchemaTransformation.bigintFromString));
|
|
10
|
+
/** @internal */
|
|
11
|
+
export const WireStoredMetadata = Schema.Struct({
|
|
12
|
+
uid: Schema.Natural,
|
|
13
|
+
gid: Schema.Natural,
|
|
14
|
+
mode: Schema.Natural.check(Schema.isLessThanOrEqualTo(0o7777)),
|
|
15
|
+
atimeNs: Schema.String,
|
|
16
|
+
mtimeNs: Schema.String,
|
|
17
|
+
ctimeNs: Schema.String,
|
|
18
|
+
birthtimeNs: Schema.String
|
|
19
|
+
});
|
|
20
|
+
/** @internal */
|
|
21
|
+
export const StoredMetadata = Schema.Struct({
|
|
22
|
+
uid: Schema.Natural,
|
|
23
|
+
gid: Schema.Natural,
|
|
24
|
+
mode: Schema.Natural.check(Schema.isLessThanOrEqualTo(0o7777)),
|
|
25
|
+
atimeNs: TimestampFromString,
|
|
26
|
+
mtimeNs: TimestampFromString,
|
|
27
|
+
ctimeNs: TimestampFromString,
|
|
28
|
+
birthtimeNs: TimestampFromString
|
|
29
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snapshotDelta.d.ts","sourceRoot":"","sources":["../../src/internal/snapshotDelta.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAA;AAC3C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"snapshotDelta.d.ts","sourceRoot":"","sources":["../../src/internal/snapshotDelta.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAA;AAC3C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAOvC,OAAO,EAAE,UAAU,EAAE,KAAK,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAC1D,OAAO,EAGL,KAAK,aAAa,EAClB,kBAAkB,EAInB,MAAM,qBAAqB,CAAA;AAmuB5B,gBAAgB;AAChB,eAAO,MAAM,aAAa;;;;;;;;;;;4GAgDzB,CAAA;AAyBD,gBAAgB;AAChB,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;oGAoBhC,CAAA;AAED,gBAAgB;AAChB,eAAO,MAAM,mBAAmB;;;;;;;;;;;+DAe9B,CAAA;AAEF,gBAAgB;AAChB,eAAO,MAAM,mBAAmB;;;;;;;;;;;qDAkC9B,CAAA;AAEF,gBAAgB;AAChB,eAAO,MAAM,kBAAkB;;;;;;;;;;;4HAI9B,CAAA"}
|