@ac-kit/format-wacz 0.0.0-stage → 0.1.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.
Files changed (48) hide show
  1. package/CHANGELOG.md +79 -0
  2. package/LICENSE +28 -0
  3. package/README.md +173 -2
  4. package/dist/_datapackage-json.d.ts +36 -0
  5. package/dist/_datapackage-json.d.ts.map +1 -0
  6. package/dist/_datapackage-json.js +247 -0
  7. package/dist/_datapackage-json.js.map +1 -0
  8. package/dist/_hashing.d.ts +23 -0
  9. package/dist/_hashing.d.ts.map +1 -0
  10. package/dist/_hashing.js +39 -0
  11. package/dist/_hashing.js.map +1 -0
  12. package/dist/_lines.d.ts +11 -0
  13. package/dist/_lines.d.ts.map +1 -0
  14. package/dist/_lines.js +74 -0
  15. package/dist/_lines.js.map +1 -0
  16. package/dist/_pages.d.ts +27 -0
  17. package/dist/_pages.d.ts.map +1 -0
  18. package/dist/_pages.js +155 -0
  19. package/dist/_pages.js.map +1 -0
  20. package/dist/_paths.d.ts +8 -0
  21. package/dist/_paths.d.ts.map +1 -0
  22. package/dist/_paths.js +20 -0
  23. package/dist/_paths.js.map +1 -0
  24. package/dist/index.d.ts +6 -0
  25. package/dist/index.d.ts.map +1 -0
  26. package/dist/index.js +6 -0
  27. package/dist/index.js.map +1 -0
  28. package/dist/open-wacz.d.ts +207 -0
  29. package/dist/open-wacz.d.ts.map +1 -0
  30. package/dist/open-wacz.js +339 -0
  31. package/dist/open-wacz.js.map +1 -0
  32. package/dist/wacz-datapackage.d.ts +84 -0
  33. package/dist/wacz-datapackage.d.ts.map +1 -0
  34. package/dist/wacz-datapackage.js +3 -0
  35. package/dist/wacz-datapackage.js.map +1 -0
  36. package/dist/wacz-error.d.ts +13 -0
  37. package/dist/wacz-error.d.ts.map +1 -0
  38. package/dist/wacz-error.js +19 -0
  39. package/dist/wacz-error.js.map +1 -0
  40. package/dist/wacz-page.d.ts +27 -0
  41. package/dist/wacz-page.d.ts.map +1 -0
  42. package/dist/wacz-page.js +2 -0
  43. package/dist/wacz-page.js.map +1 -0
  44. package/dist/write-wacz.d.ts +193 -0
  45. package/dist/write-wacz.d.ts.map +1 -0
  46. package/dist/write-wacz.js +431 -0
  47. package/dist/write-wacz.js.map +1 -0
  48. package/package.json +72 -3
@@ -0,0 +1,11 @@
1
+ /**
2
+ * The UTF-8 lines of a byte stream, as `@ac-kit/format-core`'s `LineDecoder`
3
+ * frames them (LF or CRLF, a last line without one included), at most
4
+ * `maxLineLength` bytes each: the decoder rescans nothing, and the buffer holds
5
+ * at most one line and one slice of input. Aborting `signal` stops before the
6
+ * next line. Returning or throwing early cancels the stream.
7
+ *
8
+ * @param tooLong Builds the error thrown when a line passes `maxLineLength`.
9
+ */
10
+ export declare function readLines_(stream: ReadableStream<Uint8Array>, maxLineLength: number, tooLong: () => Error, signal?: AbortSignal): AsyncGenerator<string, void, undefined>;
11
+ //# sourceMappingURL=_lines.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_lines.d.ts","sourceRoot":"","sources":["../src/_lines.ts"],"names":[],"mappings":"AAUA;;;;;;;;GAQG;AACH,wBAAuB,UAAU,CAChC,MAAM,EAAE,cAAc,CAAC,UAAU,CAAC,EAClC,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,MAAM,KAAK,EACpB,MAAM,CAAC,EAAE,WAAW,GAClB,cAAc,CAAC,MAAM,EAAE,IAAI,EAAE,SAAS,CAAC,CA+DzC"}
package/dist/_lines.js ADDED
@@ -0,0 +1,74 @@
1
+ import { ByteAccumulator } from "@ac-kit/core";
2
+ import { DecodeDriver, LineDecoder, } from "@ac-kit/format-core";
3
+ /** Bytes fed to the line decoder at a time, so its buffer stays bounded. */
4
+ const SLICE_SIZE = 64 * 1024;
5
+ /**
6
+ * The UTF-8 lines of a byte stream, as `@ac-kit/format-core`'s `LineDecoder`
7
+ * frames them (LF or CRLF, a last line without one included), at most
8
+ * `maxLineLength` bytes each: the decoder rescans nothing, and the buffer holds
9
+ * at most one line and one slice of input. Aborting `signal` stops before the
10
+ * next line. Returning or throwing early cancels the stream.
11
+ *
12
+ * @param tooLong Builds the error thrown when a line passes `maxLineLength`.
13
+ */
14
+ export async function* readLines_(stream, maxLineLength, tooLong, signal) {
15
+ const lines = [];
16
+ let failure;
17
+ const sink = {
18
+ onDecoded: (line) => {
19
+ lines.push(line);
20
+ },
21
+ onError: () => {
22
+ failure = { error: tooLong() };
23
+ },
24
+ onFatal: () => {
25
+ failure = { error: tooLong() };
26
+ },
27
+ onIncomplete: () => undefined,
28
+ onPending: () => undefined,
29
+ onTruncated: () => undefined,
30
+ };
31
+ const driver = new DecodeDriver(new LineDecoder("utf-8", {
32
+ maxLineLength,
33
+ fatalOnOverflow: true,
34
+ finalLine: true,
35
+ }), new ByteAccumulator(maxLineLength + SLICE_SIZE + 1), sink, { kind: "exhausted" });
36
+ const reader = stream.getReader();
37
+ let completed = false;
38
+ const drain = function* () {
39
+ const ready = lines.splice(0);
40
+ for (const line of ready) {
41
+ signal?.throwIfAborted();
42
+ yield line;
43
+ }
44
+ if (failure !== undefined) {
45
+ throw failure.error;
46
+ }
47
+ };
48
+ try {
49
+ signal?.throwIfAborted();
50
+ for (;;) {
51
+ const result = await reader.read();
52
+ if (result.done) {
53
+ driver.close();
54
+ yield* drain();
55
+ break;
56
+ }
57
+ const chunk = result.value;
58
+ for (let start = 0; start < chunk.length; start += SLICE_SIZE) {
59
+ driver.write(chunk.subarray(start, start + SLICE_SIZE));
60
+ yield* drain();
61
+ }
62
+ }
63
+ signal?.throwIfAborted();
64
+ completed = true;
65
+ }
66
+ finally {
67
+ if (!completed) {
68
+ // The stream may be the one that failed; its error is the one to keep.
69
+ await reader.cancel().catch(() => undefined);
70
+ }
71
+ reader.releaseLock();
72
+ }
73
+ }
74
+ //# sourceMappingURL=_lines.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_lines.js","sourceRoot":"","sources":["../src/_lines.ts"],"names":[],"mappings":"AAAA,OA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declare const PAGES_PATH_ = "pages/pages.jsonl";
3
+ /** The first line of a page list, as WACZ 1.1.1 shows it. */
4
+ export declare const PAGES_HEADER_: string;
5
+ /**
6
+ * Whether `text` is an RFC 3339 date-time (`2026-11-24T12:00:00Z`, with
7
+ * optional fractions and an offset): the grammar, then the calendar and clock
8
+ * through `Temporal`.
9
+ */
10
+ export declare function isRfc3339_(text: string): boolean;
11
+ /**
12
+ * One page line, members in the specification's example order (`id`, `url`,
13
+ * `ts`, `title`, `text`, `size`), then `extra`.
14
+ *
15
+ * @throws {TypeError} When `url` is empty, `ts` is not an instant, `size` is
16
+ * not a non-negative safe integer, or `extra` repeats a member above.
17
+ */
18
+ export declare function printPageLine_(page: WaczPage, createId: () => string): string;
19
+ /**
20
+ * A page from one line of a page list, or `null` for the list's header line (an
21
+ * object with `format` and no `url`) and blank lines.
22
+ *
23
+ * @throws {WaczFormatError} When the line is not JSON, or not an object with
24
+ * string `url` and `ts`.
25
+ */
26
+ export declare function parsePageLine_(line: string, path: string, lineNumber: number): WaczPage | null;
27
+ //# sourceMappingURL=_pages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_pages.d.ts","sourceRoot":"","sources":["../src/_pages.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C,eAAO,MAAM,WAAW,sBAAsB,CAAC;AAE/C,6DAA6D;AAC7D,eAAO,MAAM,aAAa,QAIxB,CAAC;AAoCH;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAUhD;AAcD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,MAAM,GAAG,MAAM,CA+B7E;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC7B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,GAChB,QAAQ,GAAG,IAAI,CAsDjB"}
package/dist/_pages.js ADDED
@@ -0,0 +1,155 @@
1
+ import { printNdjsonLine } from "@ac-kit/format-ndjson";
2
+ import * as z from "zod/mini";
3
+ import { WaczFormatError } from "./wacz-error.js";
4
+ export const PAGES_PATH_ = "pages/pages.jsonl";
5
+ /** The first line of a page list, as WACZ 1.1.1 shows it. */
6
+ export const PAGES_HEADER_ = printNdjsonLine({
7
+ format: "json-pages-1.0",
8
+ id: "pages",
9
+ title: "All Pages",
10
+ });
11
+ const PAGE_MEMBERS = new Set([
12
+ "id",
13
+ "url",
14
+ "ts",
15
+ "title",
16
+ "text",
17
+ "size",
18
+ ]);
19
+ const pageSchema = z.looseObject({
20
+ url: z.string(),
21
+ ts: z.string(),
22
+ id: z.optional(z.string()),
23
+ title: z.optional(z.string()),
24
+ text: z.optional(z.string()),
25
+ size: z.optional(z.number()),
26
+ });
27
+ function defineMember(target, name, value) {
28
+ Object.defineProperty(target, name, {
29
+ value,
30
+ enumerable: true,
31
+ writable: true,
32
+ configurable: true,
33
+ });
34
+ }
35
+ const RFC_3339 = /^\d{4}-\d{2}-\d{2}[Tt]\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:[Zz]|[+-]\d{2}:\d{2})$/;
36
+ /**
37
+ * Whether `text` is an RFC 3339 date-time (`2026-11-24T12:00:00Z`, with
38
+ * optional fractions and an offset): the grammar, then the calendar and clock
39
+ * through `Temporal`.
40
+ */
41
+ export function isRfc3339_(text) {
42
+ if (!RFC_3339.test(text)) {
43
+ return false;
44
+ }
45
+ try {
46
+ Temporal.Instant.from(text);
47
+ return true;
48
+ }
49
+ catch {
50
+ return false;
51
+ }
52
+ }
53
+ /**
54
+ * The text written for `ts`, checked whatever its type: an instant before year
55
+ * 0 or after 9999 prints with an expanded year RFC 3339 has no room for.
56
+ */
57
+ function printTimestamp(ts) {
58
+ const text = typeof ts === "string" ? ts : ts.toString();
59
+ if (!isRfc3339_(text)) {
60
+ throw new TypeError(`addPage: ts "${text}" is not an RFC 3339 date-time`);
61
+ }
62
+ return text;
63
+ }
64
+ /**
65
+ * One page line, members in the specification's example order (`id`, `url`,
66
+ * `ts`, `title`, `text`, `size`), then `extra`.
67
+ *
68
+ * @throws {TypeError} When `url` is empty, `ts` is not an instant, `size` is
69
+ * not a non-negative safe integer, or `extra` repeats a member above.
70
+ */
71
+ export function printPageLine_(page, createId) {
72
+ if (typeof page.url !== "string" || page.url.length === 0) {
73
+ throw new TypeError("addPage: url must be a non-empty string");
74
+ }
75
+ if (page.size !== undefined &&
76
+ (!Number.isSafeInteger(page.size) || page.size < 0)) {
77
+ throw new TypeError("addPage: size must be a non-negative safe integer");
78
+ }
79
+ const members = {
80
+ id: page.id ?? createId(),
81
+ url: page.url,
82
+ ts: printTimestamp(page.ts),
83
+ };
84
+ if (page.title !== undefined) {
85
+ members["title"] = page.title;
86
+ }
87
+ if (page.text !== undefined) {
88
+ members["text"] = page.text;
89
+ }
90
+ if (page.size !== undefined) {
91
+ members["size"] = page.size;
92
+ }
93
+ for (const [name, value] of Object.entries(page.extra ?? {})) {
94
+ if (PAGE_MEMBERS.has(name)) {
95
+ throw new TypeError(`addPage: extra repeats "${name}"`);
96
+ }
97
+ defineMember(members, name, value);
98
+ }
99
+ return printNdjsonLine(members);
100
+ }
101
+ /**
102
+ * A page from one line of a page list, or `null` for the list's header line (an
103
+ * object with `format` and no `url`) and blank lines.
104
+ *
105
+ * @throws {WaczFormatError} When the line is not JSON, or not an object with
106
+ * string `url` and `ts`.
107
+ */
108
+ export function parsePageLine_(line, path, lineNumber) {
109
+ const text = line.trim();
110
+ if (text.length === 0) {
111
+ return null;
112
+ }
113
+ let value;
114
+ try {
115
+ value = JSON.parse(text);
116
+ }
117
+ catch (error) {
118
+ throw new WaczFormatError(`Invalid JSON on line ${lineNumber}`, path, {
119
+ cause: error,
120
+ });
121
+ }
122
+ if (lineNumber === 1 &&
123
+ typeof value === "object" &&
124
+ value !== null &&
125
+ "format" in value &&
126
+ !("url" in value)) {
127
+ return null;
128
+ }
129
+ const result = pageSchema.safeParse(value);
130
+ if (!result.success) {
131
+ throw new WaczFormatError(`Line ${lineNumber} is not a page: ${z.prettifyError(result.error)}`, path, { cause: result.error });
132
+ }
133
+ const { url, ts, id, title, text: pageText, size } = result.data;
134
+ if (!isRfc3339_(ts)) {
135
+ throw new WaczFormatError(`Line ${lineNumber}: ts "${ts}" is not an RFC 3339 date-time`, path);
136
+ }
137
+ const extra = {};
138
+ for (const [name, member] of Object.entries(value)) {
139
+ if (!PAGE_MEMBERS.has(name)) {
140
+ defineMember(extra, name, member);
141
+ }
142
+ }
143
+ return {
144
+ url,
145
+ ts,
146
+ ...(id === undefined ? {} : { id }),
147
+ ...(title === undefined ? {} : { title }),
148
+ ...(pageText === undefined ? {} : { text: pageText }),
149
+ ...(size === undefined ? {} : { size }),
150
+ ...(Object.keys(extra).length > 0
151
+ ? { extra: extra }
152
+ : {}),
153
+ };
154
+ }
155
+ //# sourceMappingURL=_pages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_pages.js","sourceRoot":"","sources":["../src/_pages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAE9B,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGlD,MAAM,CAAC,MAAM,WAAW,GAAG,mBAAmB,CAAC;AAE/C,6DAA6D;AAC7D,MAAM,CAAC,MAAM,aAAa,GAAG,eAAe,CAAC;IAC5C,MAAM,EAAE,gBAAgB;IACxB,EAAE,EAAE,OAAO;IACX,KAAK,EAAE,WAAW;CAClB,CAAC,CAAC;AAEH,MAAM,YAAY,GAAwB,IAAI,GAAG,CAAC;IACjD,IAAI;IACJ,KAAK;IACL,IAAI;IACJ,OAAO;IACP,MAAM;IACN,MAAM;CACN,CAAC,CAAC;AAEH,MAAM,UAAU,GAAG,CAAC,CAAC,WAAW,CAAC;IAChC,GA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}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * The one path rule for every name this package writes or judges inside an
3
+ * archive: not empty, relative, `/`-separated, without `\`, control characters,
4
+ * a `:` in its first segment (a drive or scheme), or empty, `.` or `..`
5
+ * segments. A directory's trailing `/` is allowed when `directory`.
6
+ */
7
+ export declare function isSafeArchivePath_(path: string, directory?: boolean): boolean;
8
+ //# sourceMappingURL=_paths.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_paths.d.ts","sourceRoot":"","sources":["../src/_paths.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,UAAQ,GAAG,OAAO,CAc3E"}
package/dist/_paths.js ADDED
@@ -0,0 +1,20 @@
1
+ // oxlint-disable-next-line no-control-regex -- control characters are refused
2
+ const CONTROL = /[\u0000-\u001f\u007f]/;
3
+ /**
4
+ * The one path rule for every name this package writes or judges inside an
5
+ * archive: not empty, relative, `/`-separated, without `\`, control characters,
6
+ * a `:` in its first segment (a drive or scheme), or empty, `.` or `..`
7
+ * segments. A directory's trailing `/` is allowed when `directory`.
8
+ */
9
+ export function isSafeArchivePath_(path, directory = false) {
10
+ const segments = path.split("/");
11
+ if (directory && path.endsWith("/")) {
12
+ segments.pop();
13
+ }
14
+ return (path.length > 0 &&
15
+ !path.includes("\\") &&
16
+ !CONTROL.test(path) &&
17
+ !segments[0].includes(":") &&
18
+ segments.every((segment) => segment.length > 0 && segment !== "." && segment !== ".."));
19
+ }
20
+ //# sourceMappingURL=_paths.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_paths.js","sourceRoot":"","sources":["../src/_paths.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,MAAM,OAAO,GAAG,uBAAuB,CAAC;AAExC;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAY,EAAE,SAAS,GAAG,KAAK;IACjE,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACjC,IAAI,SAAS,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACrC,QAAQ,CAAC,GAAG,EAAE,CAAC;IAChB,CAAC;IACD,OAAO,CACN,IAAI,CAAC,MAAM,GAAG,CAAC;QACf,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;QACpB,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;QACnB,CAAC,QAAQ,CAAC,CAAC,CAAE,CAAC,QAAQ,CAAC,GAAG,CAAC;QAC3B,QAAQ,CAAC,KAAK,CACb,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,OAAO,KAAK,GAAG,IAAI,OAAO,KAAK,IAAI,CACtE,CACD,CAAC;AACH,CAAC"}
@@ -0,0 +1,6 @@
1
+ export * from "./open-wacz.js";
2
+ export * from "./wacz-datapackage.js";
3
+ export * from "./wacz-error.js";
4
+ export * from "./wacz-page.js";
5
+ export * from "./write-wacz.js";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,6 @@
1
+ export * from "./open-wacz.js";
2
+ export * from "./wacz-datapackage.js";
3
+ export * from "./wacz-error.js";
4
+ export * from "./wacz-page.js";
5
+ export * from "./write-wacz.js";
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,207 @@
1
+ import { type WarcReadAtOptions, type WarcRecord } from "@ac-kit/format-warc";
2
+ import { type CdxjEntry } from "@ac-kit/format-warc/cdxj";
3
+ import { type ZipArchive, type ZipSource, type ZipSourceLimits } from "@ac-kit/format-zip";
4
+ import type { WaczDatapackage, WaczDatapackageDigest } from "./wacz-datapackage.js";
5
+ import type { WaczPage } from "./wacz-page.js";
6
+ /**
7
+ * The limits {@link openWacz} holds an archive to, each required, since an
8
+ * archive decides its own sizes: the ZIP's, and the WACZ documents' and
9
+ * records'. Each is a safe non-negative integer (`maxCompressionRatio` a
10
+ * positive number).
11
+ */
12
+ export type WaczLimits = ZipSourceLimits & {
13
+ /** Largest `datapackage.json` (and `datapackage-digest.json`), in bytes. */
14
+ readonly maxDatapackageSize: number;
15
+ /** Largest index file, in bytes (uncompressed). */
16
+ readonly maxIndexSize: number;
17
+ /** Longest line of a page list, in bytes: a page's `text` can be long. */
18
+ readonly maxPageLineLength: number;
19
+ /**
20
+ * Most bytes one record read by {@link WaczArchive.readRecord} may decompress
21
+ * to, header and block included: a small gzip member can expand a
22
+ * thousandfold, and the ZIP limits bound only stored bytes.
23
+ */
24
+ readonly maxRecordSize: number;
25
+ };
26
+ /** How one listed file compares with its datapackage entry. */
27
+ export type WaczResourceCheck = {
28
+ readonly path: string;
29
+ /**
30
+ * `match`: read to its end without error (sizes and CRC-32 checked by the ZIP
31
+ * reader), hash and size equal. `mismatch`: its bytes, all read, hash or
32
+ * weigh otherwise. `missing`: no such entry. `unsupported-hash`: no hash, or
33
+ * one other than `sha256`. `unreadable`: the entry could not be read cleanly
34
+ * (encrypted, unknown compression, corrupt data, a broken local header, a
35
+ * CRC-32 that fails while the hash matches).
36
+ */
37
+ readonly status: "match" | "mismatch" | "missing" | "unsupported-hash" | "unreadable";
38
+ /** The size listed, `null` when none is. */
39
+ readonly expectedBytes: number | null;
40
+ /** The size read, `null` when the entry was not read to its end. */
41
+ readonly actualBytes: number | null;
42
+ };
43
+ /**
44
+ * A way the archive departs from WACZ 1.1.1 that opening tolerates. `path` is
45
+ * the resource or entry concerned, when there is one.
46
+ */
47
+ export type WaczConformanceIssue = {
48
+ readonly code:
49
+ /** `profile` is not `data-package`. */
50
+ "unexpected-profile"
51
+ /** `wacz_version` is missing. */
52
+ | "missing-wacz-version"
53
+ /** `wacz_version` is not 1.0.0, 1.1.0 or 1.1.1. */
54
+ | "unsupported-wacz-version"
55
+ /** A resource lacks `name`, `hash` or `bytes`. */
56
+ | "incomplete-resource"
57
+ /** Two resources list the same path. */
58
+ | "duplicate-resource-path"
59
+ /** Two entries have the same name, or names equal but for ASCII case. */
60
+ | "duplicate-entry-name"
61
+ /**
62
+ * A resource path or entry name is empty or absolute, has empty, `.` or
63
+ * `..` segments, a `\`, a control character, or a `:` in its first segment
64
+ * — the rule the writer applies to its own paths.
65
+ */
66
+ | "unsafe-path"
67
+ /** No `pages/pages.jsonl`. */
68
+ | "missing-pages"
69
+ /** No `archive/*.warc` or `archive/*.warc.gz`. */
70
+ | "missing-archive"
71
+ /** No file under `indexes/`. */
72
+ | "missing-index"
73
+ /** `datapackage-digest.json` names another file than `datapackage.json`. */
74
+ | "unexpected-digest-path";
75
+ readonly message: string;
76
+ readonly path?: string;
77
+ };
78
+ /**
79
+ * What {@link WaczArchive.verify} found about `signedData`, in three separate
80
+ * judgements: its structure, its consistency with the archive, and its
81
+ * signature, which this package does not check.
82
+ */
83
+ export type WaczSignedDataCheck = {
84
+ readonly status: "absent";
85
+ } | {
86
+ readonly status: "present";
87
+ /**
88
+ * The wacz-auth 0.1.0 form it completes, `invalid` when none (a missing
89
+ * or non-string member, an unlisted member, both forms' members).
90
+ */
91
+ readonly form: "anonymous" | "domain" | "invalid";
92
+ /** Its `hash` equals the digest file's. */
93
+ readonly hashMatches: boolean;
94
+ /** Its `created` equals the datapackage's. */
95
+ readonly createdMatches: boolean;
96
+ /** The signature itself is not verified here. */
97
+ readonly signature: "unchecked";
98
+ };
99
+ /** What {@link WaczArchive.verify} found. */
100
+ export type WaczVerification = {
101
+ /** One check per datapackage resource, in its order. */
102
+ readonly resources: readonly WaczResourceCheck[];
103
+ /**
104
+ * Files of the archive the datapackage does not list (besides
105
+ * `datapackage.json` and `datapackage-digest.json`).
106
+ */
107
+ readonly unlisted: readonly string[];
108
+ /**
109
+ * Whether `datapackage-digest.json` holds the hash of the stored
110
+ * `datapackage.json` bytes.
111
+ */
112
+ readonly datapackageDigest: "match" | "mismatch" | "absent";
113
+ readonly signedData: WaczSignedDataCheck;
114
+ /** Departures from the specification, empty for a conforming archive. */
115
+ readonly conformance: readonly WaczConformanceIssue[];
116
+ };
117
+ /** A WACZ opened by {@link openWacz}. */
118
+ export type WaczArchive = {
119
+ /** The ZIP underneath, for entries this API does not cover. */
120
+ readonly zip: ZipArchive;
121
+ readonly datapackage: WaczDatapackage;
122
+ /** `datapackage-digest.json`, when present. */
123
+ readonly datapackageDigest: WaczDatapackageDigest | undefined;
124
+ /**
125
+ * The pages of a page list, streamed: a header on line 1 is skipped. Memory:
126
+ * one line, bounded by `maxPageLineLength`.
127
+ *
128
+ * @param path Default `pages/pages.jsonl`.
129
+ * @throws {WaczFormatError} When there is no such entry, or a line is not a
130
+ * page object with a string `url` and an RFC 3339 `ts`.
131
+ * @throws {WaczLimitError} When a line is longer than `maxPageLineLength`.
132
+ * @throws When `signal` aborts, its reason, before the next page; what
133
+ * `ZipArchive.stream` throws.
134
+ */
135
+ pages(path?: string, signal?: AbortSignal): AsyncGenerator<WaczPage>;
136
+ /**
137
+ * The entries of every `indexes/*.cdx` and `indexes/*.cdxj`, file by file,
138
+ * each in its stored order; blank lines and `!` header lines are skipped.
139
+ * Memory: one line.
140
+ *
141
+ * @throws {UnsupportedError} Before any entry, when the archive has a ZipNum
142
+ * (`.idx`) or gzip-compressed (`.cdx.gz`) index.
143
+ * @throws {WaczLimitError} When an index is larger than `maxIndexSize`.
144
+ * @throws {WaczFormatError} When a line is not CDXJ (its `CdxjFormatError` as
145
+ * `cause`).
146
+ * @throws When `signal` aborts, its reason, before the next entry; what
147
+ * `ZipArchive.stream` throws.
148
+ */
149
+ index(signal?: AbortSignal): AsyncGenerator<CdxjEntry>;
150
+ /**
151
+ * The record an index entry points to: its range of `archive/<filename>`,
152
+ * read from the source as the block is read, through `readWarcRecordAt`,
153
+ * which may decompress at most `maxRecordSize` bytes; an
154
+ * `options.maxDecompressedSize` can only lower that bound.
155
+ *
156
+ * @throws {WaczFormatError} When there is no such WARC.
157
+ * @throws {UnsupportedError} When the WARC is compressed in the ZIP.
158
+ * @throws {TypeError} When `options.maxDecompressedSize` is not a safe
159
+ * non-negative integer.
160
+ * @throws {RangeError} When the range is not within the WARC.
161
+ * @throws What `readWarcRecordAt` throws, `WarcLimitError` past the bound
162
+ * among them.
163
+ */
164
+ readRecord(entry: CdxjEntry, options?: Omit<WarcReadAtOptions, "offset">): Promise<WarcRecord>;
165
+ /**
166
+ * Hashes every listed file (SHA-256, streamed: memory is one chunk) and
167
+ * compares it and its size with the datapackage, lists unlisted files, checks
168
+ * `datapackage-digest.json` against the stored `datapackage.json`, judges
169
+ * `signedData`, and lists departures from the specification. A path listed
170
+ * twice is read and hashed once, each row reporting the result. Time: linear
171
+ * in the archive.
172
+ *
173
+ * @throws When `signal` aborts (before, during or after the hashing), its
174
+ * reason; the source's own read error.
175
+ */
176
+ verify(signal?: AbortSignal): Promise<WaczVerification>;
177
+ };
178
+ /**
179
+ * Opens a WACZ archive (1.0.0 to 1.1.1) by ranges, without holding it whole:
180
+ * the ZIP's directory, then `datapackage.json` and `datapackage-digest.json`.
181
+ * Opening is permissive, so archives tools wrote slightly off the specification
182
+ * still replay; {@link WaczArchive.verify} reports conformance. Pages, index
183
+ * entries and records are read on demand, each streamed; a record is read from
184
+ * its index range of the stored WARC, as ReplayWeb.page reads it.
185
+ *
186
+ * A `Blob` (a `File`, or Node's `fs.openAsBlob`) is read with `slice`; a
187
+ * `ZipSource` reads ranges from anywhere, an HTTP server with `Range` among
188
+ * them.
189
+ *
190
+ * @example
191
+ * const wacz = await openWacz(await fs.openAsBlob(path), limits);
192
+ * for await (const entry of wacz.index()) {
193
+ * if (entry.url === wanted) {
194
+ * const record = await wacz.readRecord(entry);
195
+ * }
196
+ * }
197
+ *
198
+ * @throws {TypeError} Before any read, when a limit is not a safe non-negative
199
+ * integer (`maxCompressionRatio`: a finite positive number).
200
+ * @throws {WaczFormatError} When `datapackage.json` is missing, or either
201
+ * datapackage file is not UTF-8 JSON of the expected shape.
202
+ * @throws {WaczLimitError} When either is larger than `maxDatapackageSize`.
203
+ * @throws {UnsupportedError} When the datapackage is a `multi-wacz-package`.
204
+ * @throws What `openZipSource` throws.
205
+ */
206
+ export declare function openWacz(source: ZipSource | Blob | Uint8Array<ArrayBuffer>, limits: WaczLimits, signal?: AbortSignal): Promise<WaczArchive>;
207
+ //# sourceMappingURL=open-wacz.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"open-wacz.d.ts","sourceRoot":"","sources":["../src/open-wacz.ts"],"names":[],"mappings":"AAEA,OAAO,EAEN,KAAK,iBAAiB,EACtB,KAAK,UAAU,EACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACN,KAAK,SAAS,EAGd,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAEN,KAAK,UAAU,EAGf,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,MAAM,oBAAoB,CAAC;AAY5B,OAAO,KAAK,EACX,eAAe,EACf,qBAAqB,EACrB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG,eAAe,GAAG;IAC1C,4EAA4E;IAC5E,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;IACpC,mDAAmD;IACnD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,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