conductor-oss 0.15.0 → 0.15.2
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/package.json +5 -5
- package/web/.next/standalone/node_modules/yauzl/README.md +244 -28
- package/web/.next/standalone/node_modules/{fd-slicer/index.js → yauzl/fd-slicer.js} +24 -6
- package/web/.next/standalone/node_modules/yauzl/index.js +327 -180
- package/web/.next/standalone/node_modules/yauzl/package.json +10 -10
- package/web/.next/standalone/packages/web/.next/BUILD_ID +1 -1
- package/web/.next/standalone/packages/web/.next/build-manifest.json +2 -2
- package/web/.next/standalone/packages/web/.next/prerender-manifest.json +3 -3
- package/web/.next/standalone/packages/web/.next/server/app/_global-error.html +2 -2
- package/web/.next/standalone/packages/web/.next/server/app/_global-error.rsc +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_not-found/page/server-reference-manifest.json +7 -7
- package/web/.next/standalone/packages/web/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_not-found.html +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_not-found.rsc +3 -3
- package/web/.next/standalone/packages/web/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
- package/web/.next/standalone/packages/web/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
- package/web/.next/standalone/packages/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/preview/dom/route.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/preview/route.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/preview/screenshot/route.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/page/react-loadable-manifest.json +2 -2
- package/web/.next/standalone/packages/web/.next/server/app/page/server-reference-manifest.json +7 -7
- package/web/.next/standalone/packages/web/.next/server/app/page.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/sessions/[id]/page/react-loadable-manifest.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/sessions/[id]/page/server-reference-manifest.json +7 -7
- package/web/.next/standalone/packages/web/.next/server/app/sessions/[id]/page.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/sessions/[id]/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/sign-in/[[...sign-in]]/page/server-reference-manifest.json +7 -7
- package/web/.next/standalone/packages/web/.next/server/app/sign-in/[[...sign-in]]/page.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/sign-in/[[...sign-in]]/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/unlock/page/server-reference-manifest.json +7 -7
- package/web/.next/standalone/packages/web/.next/server/app/unlock/page.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/unlock/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/chunks/ssr/[root-of-the-server]__000b8c99._.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/chunks/ssr/[root-of-the-server]__29d8d063._.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/chunks/ssr/{[root-of-the-server]__2a3b754e._.js → [root-of-the-server]__bed65076._.js} +2 -2
- package/web/.next/standalone/packages/web/.next/server/chunks/ssr/{_48e9f593._.js → _081fd389._.js} +2 -2
- package/web/.next/standalone/packages/web/.next/server/chunks/ssr/_0e1412de._.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/chunks/ssr/{_65f1d21e._.js → _2c6d3f73._.js} +2 -2
- package/web/.next/standalone/packages/web/.next/server/chunks/ssr/{_d796dc5e._.js → _4c9fbc04._.js} +1 -1
- package/web/.next/standalone/packages/web/.next/server/chunks/ssr/_532f707d._.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/chunks/ssr/_69e05fca._.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/chunks/ssr/_80efe193._.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/chunks/ssr/{_fbdfe409._.js → _b5f67038._.js} +2 -2
- package/web/.next/standalone/packages/web/.next/server/chunks/ssr/_c0f0e227._.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/chunks/ssr/_f36ddaa9._.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/chunks/ssr/node_modules_@clerk_nextjs_dist_esm_app-router_99e39bf4._.js +3 -0
- package/web/.next/standalone/packages/web/.next/server/chunks/ssr/{node_modules_@clerk_nextjs_dist_esm_app-router_d8141393._.js → node_modules_@clerk_nextjs_dist_esm_app-router_fe9c319c._.js} +2 -2
- package/web/.next/standalone/packages/web/.next/server/chunks/ssr/{node_modules_fdc95529._.js → node_modules_ee2dfeca._.js} +1 -1
- package/web/.next/standalone/packages/web/.next/server/chunks/ssr/packages_web_src_components_sessions_SessionDetail_tsx_5fcad270._.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/chunks/ssr/packages_web_src_components_sessions_SessionTerminal_tsx_eaf9458b._.js +2 -2
- package/web/.next/standalone/packages/web/.next/server/pages/404.html +1 -1
- package/web/.next/standalone/packages/web/.next/server/pages/500.html +2 -2
- package/web/.next/standalone/packages/web/.next/server/server-reference-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/server-reference-manifest.json +8 -8
- package/web/.next/{static/chunks/8bafc753330913df.js → standalone/packages/web/.next/static/chunks/3a3d5cd50ca70511.js} +3 -3
- package/web/.next/{static/chunks/f21dbe98e11cf2d8.js → standalone/packages/web/.next/static/chunks/4e89204efb05c296.js} +1 -1
- package/web/.next/standalone/packages/web/.next/static/chunks/{20f703551797c37a.js → 717d87d36259875d.js} +1 -1
- package/web/.next/standalone/packages/web/.next/static/chunks/{3ee40b535c5681b7.js → 84c32e3390355454.js} +1 -1
- package/web/.next/{static/chunks/bc31468c22a8cce6.js → standalone/packages/web/.next/static/chunks/8a5aade13401e141.js} +1 -1
- package/web/.next/standalone/packages/web/.next/static/chunks/920b9dd66e9a872f.js +1 -0
- package/web/.next/standalone/packages/web/.next/static/chunks/{056ec6d2a1478226.js → 95c3084de3634fb7.js} +1 -1
- package/web/.next/standalone/packages/web/.next/static/chunks/{531502506286ac43.js → 99b4789a8dbc4acd.js} +1 -1
- package/web/.next/{static/chunks/e5d0ced722b728bf.js → standalone/packages/web/.next/static/chunks/d3660a1f166e8fa6.js} +1 -1
- package/web/.next/standalone/packages/web/src/components/sessions/SessionDetail.tsx +6 -8
- package/web/.next/standalone/packages/web/src/components/sessions/SessionTerminal.tsx +129 -6
- package/web/.next/{standalone/packages/web/.next/static/chunks/8bafc753330913df.js → static/chunks/3a3d5cd50ca70511.js} +3 -3
- package/web/.next/{standalone/packages/web/.next/static/chunks/f21dbe98e11cf2d8.js → static/chunks/4e89204efb05c296.js} +1 -1
- package/web/.next/static/chunks/{20f703551797c37a.js → 717d87d36259875d.js} +1 -1
- package/web/.next/static/chunks/{3ee40b535c5681b7.js → 84c32e3390355454.js} +1 -1
- package/web/.next/{standalone/packages/web/.next/static/chunks/bc31468c22a8cce6.js → static/chunks/8a5aade13401e141.js} +1 -1
- package/web/.next/static/chunks/920b9dd66e9a872f.js +1 -0
- package/web/.next/static/chunks/{056ec6d2a1478226.js → 95c3084de3634fb7.js} +1 -1
- package/web/.next/static/chunks/{531502506286ac43.js → 99b4789a8dbc4acd.js} +1 -1
- package/web/.next/{standalone/packages/web/.next/static/chunks/e5d0ced722b728bf.js → static/chunks/d3660a1f166e8fa6.js} +1 -1
- package/web/.next/standalone/node_modules/fd-slicer/package.json +0 -36
- package/web/.next/standalone/packages/web/.next/server/chunks/ssr/node_modules_@clerk_nextjs_dist_esm_app-router_a2717805._.js +0 -3
- package/web/.next/standalone/packages/web/.next/static/chunks/18bfaa24ef03add3.js +0 -1
- package/web/.next/static/chunks/18bfaa24ef03add3.js +0 -1
- /package/web/.next/standalone/packages/web/.next/static/{mIYVIb0Y5qpcD6eQkGsfZ → BnuXjTiaPEA9hn4qFFTYy}/_buildManifest.js +0 -0
- /package/web/.next/standalone/packages/web/.next/static/{mIYVIb0Y5qpcD6eQkGsfZ → BnuXjTiaPEA9hn4qFFTYy}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/standalone/packages/web/.next/static/{mIYVIb0Y5qpcD6eQkGsfZ → BnuXjTiaPEA9hn4qFFTYy}/_ssgManifest.js +0 -0
- /package/web/.next/static/{mIYVIb0Y5qpcD6eQkGsfZ → BnuXjTiaPEA9hn4qFFTYy}/_buildManifest.js +0 -0
- /package/web/.next/static/{mIYVIb0Y5qpcD6eQkGsfZ → BnuXjTiaPEA9hn4qFFTYy}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{mIYVIb0Y5qpcD6eQkGsfZ → BnuXjTiaPEA9hn4qFFTYy}/_ssgManifest.js +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "conductor-oss",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/launcher.js",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"directory": "packages/cli"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@conductor-oss/core": "0.15.
|
|
36
|
+
"@conductor-oss/core": "0.15.2",
|
|
37
37
|
"chalk": "^5.6.2",
|
|
38
38
|
"commander": "^14.0.3",
|
|
39
39
|
"ora": "^9.3.0",
|
|
@@ -67,9 +67,9 @@
|
|
|
67
67
|
"tailwind-merge": "^3.5.0"
|
|
68
68
|
},
|
|
69
69
|
"optionalDependencies": {
|
|
70
|
-
"conductor-oss-native-darwin-universal": "0.15.
|
|
71
|
-
"conductor-oss-native-linux-x64": "0.15.
|
|
72
|
-
"conductor-oss-native-win32-x64": "0.15.
|
|
70
|
+
"conductor-oss-native-darwin-universal": "0.15.2",
|
|
71
|
+
"conductor-oss-native-linux-x64": "0.15.2",
|
|
72
|
+
"conductor-oss-native-win32-x64": "0.15.2"
|
|
73
73
|
},
|
|
74
74
|
"files": [
|
|
75
75
|
"dist/",
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
# yauzl
|
|
2
2
|
|
|
3
|
-
[](https://travis-ci.org/thejoshwolfe/yauzl)
|
|
4
|
-
[](https://coveralls.io/r/thejoshwolfe/yauzl)
|
|
5
|
-
|
|
6
3
|
yet another unzip library for node. For zipping, see
|
|
7
4
|
[yazl](https://github.com/thejoshwolfe/yazl).
|
|
8
5
|
|
|
@@ -32,7 +29,7 @@ yauzl.open("path/to/file.zip", {lazyEntries: true}, function(err, zipfile) {
|
|
|
32
29
|
zipfile.on("entry", function(entry) {
|
|
33
30
|
if (/\/$/.test(entry.fileName)) {
|
|
34
31
|
// Directory file names end with '/'.
|
|
35
|
-
// Note that
|
|
32
|
+
// Note that entries for directories themselves are optional.
|
|
36
33
|
// An entry's fileName implicitly requires its parent directories to exist.
|
|
37
34
|
zipfile.readEntry();
|
|
38
35
|
} else {
|
|
@@ -150,10 +147,36 @@ See `open()` for the meaning of the options and callback.
|
|
|
150
147
|
|
|
151
148
|
### dosDateTimeToDate(date, time)
|
|
152
149
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
150
|
+
*Deprecated*. Since yauzl 3.2.0, it is highly recommended to call [`entry.getLastModDate()`](#getlastmoddateoptions)
|
|
151
|
+
instead of this function due to enhanced support for reading third-party extra fields.
|
|
152
|
+
If you ever have a use case for calling this function directly please
|
|
153
|
+
[open an issue against yauzl](https://github.com/thejoshwolfe/yauzl/issues/new)
|
|
154
|
+
requesting that this function be properly supported again.
|
|
155
|
+
|
|
156
|
+
This function only remains exported in order to maintain compatibility with older versions of yauzl.
|
|
157
|
+
It will be removed in yauzl 4.0.0 unless someone asks for it to remain supported.
|
|
158
|
+
|
|
159
|
+
### getFileNameLowLevel(generalPurposeBitFlag, fileNameBuffer, extraFields, strictFileNames)
|
|
160
|
+
|
|
161
|
+
If you are setting `decodeStrings` to `false`, then this function can be used to decode the file name yourself.
|
|
162
|
+
This function is effectively used internally by yauzl to populate the `entry.fileName` field when `decodeStrings` is `true`.
|
|
163
|
+
|
|
164
|
+
WARNING: This method of getting the file name bypasses the security checks in [`validateFileName()`](#validatefilename-filename).
|
|
165
|
+
You should call that function yourself to be sure to guard against malicious file paths.
|
|
166
|
+
|
|
167
|
+
`generalPurposeBitFlag` can be found on an [`Entry`](#class-entry) or [`LocalFileHeader`](#class-localfileheader).
|
|
168
|
+
Only General Purpose Bit 11 is used, and only when an Info-ZIP Unicode Path Extra Field cannot be found in `extraFields`.
|
|
169
|
+
|
|
170
|
+
`fileNameBuffer` is a `Buffer` representing the file name field of the entry.
|
|
171
|
+
This is `entry.fileNameRaw` or `localFileHeader.fileName`.
|
|
172
|
+
|
|
173
|
+
`extraFields` is the parsed extra fields array from `entry.extraFields` or `parseExtraFields()`.
|
|
174
|
+
|
|
175
|
+
`strictFileNames` is a boolean, the same as the option of the same name in `open()`.
|
|
176
|
+
When `false`, backslash characters (`\`) will be replaced with forward slash characters (`/`).
|
|
177
|
+
|
|
178
|
+
This function always returns a string, although it may not be a valid file name.
|
|
179
|
+
See `validateFileName()`.
|
|
157
180
|
|
|
158
181
|
### validateFileName(fileName)
|
|
159
182
|
|
|
@@ -169,6 +192,18 @@ if (errorMessage != null) throw new Error(errorMessage);
|
|
|
169
192
|
This function is automatically run for each entry, as long as `decodeStrings` is `true`.
|
|
170
193
|
See `open()`, `strictFileNames`, and `Event: "entry"` for more information.
|
|
171
194
|
|
|
195
|
+
### parseExtraFields(extraFieldBuffer)
|
|
196
|
+
|
|
197
|
+
This function is used internally by yauzl to compute [`entry.extraFields`](#extrafields).
|
|
198
|
+
It is exported in case you want to call it on [`localFileHeader.extraField`](#class-localfileheader).
|
|
199
|
+
|
|
200
|
+
`extraFieldBuffer` is a `Buffer`, such as `localFileHeader.extraField`.
|
|
201
|
+
Returns an `Array` with each item in the form `{id: id, data: data}`,
|
|
202
|
+
where `id` is a `Number` and `data` is a `Buffer`.
|
|
203
|
+
Throws an `Error` if the data encodes an item with a size that exceeds the bounds of the buffer.
|
|
204
|
+
|
|
205
|
+
You may want to surround calls to this function with `try { ... } catch (err) { ... }` to handle the error.
|
|
206
|
+
|
|
172
207
|
### Class: ZipFile
|
|
173
208
|
|
|
174
209
|
The constructor for the class is not part of the public API.
|
|
@@ -265,7 +300,7 @@ The `start` (inclusive) and `end` (exclusive) options are byte offsets into this
|
|
|
265
300
|
and can be used to obtain part of an entry's file data rather than the whole thing.
|
|
266
301
|
If either of these options are specified and non-`null`,
|
|
267
302
|
then the above options must be used to obain the file's raw data.
|
|
268
|
-
|
|
303
|
+
Specifying `{start: 0, end: entry.compressedSize}` will result in the complete file,
|
|
269
304
|
which is effectively the default values for these options,
|
|
270
305
|
but note that unlike omitting the options, when you specify `start` or `end` as any non-`null` value,
|
|
271
306
|
the above requirement is still enforced that you must also pass the appropriate options to get the file's raw data.
|
|
@@ -287,9 +322,59 @@ It is possible to destroy the `readStream` before it has piped all of its data.
|
|
|
287
322
|
To do this, call `readStream.destroy()`.
|
|
288
323
|
You must `unpipe()` the `readStream` from any destination before calling `readStream.destroy()`.
|
|
289
324
|
If this zipfile was created using `fromRandomAccessReader()`, the `RandomAccessReader` implementation
|
|
290
|
-
must provide readable streams that implement a `.
|
|
325
|
+
must provide readable streams that implement a `._destroy()` method according to
|
|
326
|
+
https://nodejs.org/api/stream.html#writable_destroyerr-callback (see `randomAccessReader._readStreamForRange()`)
|
|
291
327
|
in order for calls to `readStream.destroy()` to work in this context.
|
|
292
328
|
|
|
329
|
+
#### readLocalFileHeader(entry, [options], callback)
|
|
330
|
+
|
|
331
|
+
This is a low-level function you probably don't need to call.
|
|
332
|
+
The intended use case is either preparing to call `openReadStreamLowLevel()`
|
|
333
|
+
or simply examining the content of the local file header out of curiosity or for debugging zip file structure issues.
|
|
334
|
+
|
|
335
|
+
`entry` is an entry obtained from `Event: "entry"`.
|
|
336
|
+
An `entry` in this library is a file's metadata from a Central Directory Header,
|
|
337
|
+
and this function gives the corresponding redundant data in a Local File Header.
|
|
338
|
+
|
|
339
|
+
`options` may be omitted or `null`, and has the following defaults:
|
|
340
|
+
|
|
341
|
+
```js
|
|
342
|
+
{
|
|
343
|
+
minimal: false,
|
|
344
|
+
}
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
If `minimal` is `false` (or omitted or `null`), the callback receives a full [`LocalFileHeader`](#class-localfileheader).
|
|
348
|
+
If `minimal` is `true`, the callback receives an object with a single property and no prototype `{fileDataStart: fileDataStart}`.
|
|
349
|
+
For typical zipfile reading usecases, this field is the only one you need,
|
|
350
|
+
and yauzl internally effectively uses the `{minimal: true}` option as part of `openReadStream()`.
|
|
351
|
+
|
|
352
|
+
The `callback` receives `(err, localFileHeaderOrAnObjectWithJustOneFieldDependingOnTheMinimalOption)`,
|
|
353
|
+
where the type of the second parameter is described in the above discussion of the `minimal` option.
|
|
354
|
+
|
|
355
|
+
#### openReadStreamLowLevel(fileDataStart, compressedSize, relativeStart, relativeEnd, decompress, uncompressedSize, callback)
|
|
356
|
+
|
|
357
|
+
This is a low-level function available for advanced use cases. You probably want `openReadStream()` instead.
|
|
358
|
+
|
|
359
|
+
The intended use case for this function is calling `readEntry()` and `readLocalFileHeader()` with `{minimal: true}` first,
|
|
360
|
+
and then opening the read stream at a later time, possibly after closing and reopening the entire zipfile,
|
|
361
|
+
possibly even in a different process.
|
|
362
|
+
The parameters are all integers and booleans, which are friendly to serialization.
|
|
363
|
+
|
|
364
|
+
* `fileDataStart` - from `localFileHeader.fileDataStart`
|
|
365
|
+
* `compressedSize` - from `entry.compressedSize`
|
|
366
|
+
* `relativeStart` - the resolved value of `options.start` from `openReadStream()`. Must be a non-negative integer, not `null`. Typically `0` to start at the beginning of the data.
|
|
367
|
+
* `relativeEnd` - the resolved value of `options.end` from `openReadStream()`. Must be a non-negative integer, not `null`. Typically `entry.compressedSize` to include all the data.
|
|
368
|
+
* `decompress` - boolean indicating whether the data should be piped through a zlib inflate stream.
|
|
369
|
+
* `uncompressedSize` - from `entry.uncompressedSize`. Only used when `validateEntrySizes` is `true`. If `validateEntrySizes` is `false`, this value is ignored, but must still be present, not omitted, in the arguments; you have to give it some value, even if it's `null`.
|
|
370
|
+
* `callback` - receives `(err, readStream)`, the same as for `openReadStream()`
|
|
371
|
+
|
|
372
|
+
This low-level function does not read any metadata from the underlying storage before opening the read stream.
|
|
373
|
+
This is both a performance feature and a safety hazard.
|
|
374
|
+
None of the integer parameters are bounds checked.
|
|
375
|
+
None of the validation from `openReadStream()` with respect to compression and encryption is done here either.
|
|
376
|
+
Only the bounds checks from `validateEntrySizes` are done, because that is part of processing the stream data.
|
|
377
|
+
|
|
293
378
|
#### close()
|
|
294
379
|
|
|
295
380
|
Causes all future calls to `openReadStream()` to fail,
|
|
@@ -340,18 +425,31 @@ These fields are of type `Number`:
|
|
|
340
425
|
* `versionNeededToExtract`
|
|
341
426
|
* `generalPurposeBitFlag`
|
|
342
427
|
* `compressionMethod`
|
|
343
|
-
* `lastModFileTime` (MS-DOS format, see `
|
|
344
|
-
* `lastModFileDate` (MS-DOS format, see `
|
|
428
|
+
* `lastModFileTime` (MS-DOS format, see [`getLastModDate()`](#getlastmoddateoptions))
|
|
429
|
+
* `lastModFileDate` (MS-DOS format, see [`getLastModDate()`](#getlastmoddateoptions))
|
|
345
430
|
* `crc32`
|
|
346
431
|
* `compressedSize`
|
|
347
432
|
* `uncompressedSize`
|
|
348
|
-
* `fileNameLength` (bytes)
|
|
349
|
-
* `extraFieldLength` (bytes)
|
|
350
|
-
* `fileCommentLength` (bytes)
|
|
433
|
+
* `fileNameLength` (in bytes)
|
|
434
|
+
* `extraFieldLength` (in bytes)
|
|
435
|
+
* `fileCommentLength` (in bytes)
|
|
351
436
|
* `internalFileAttributes`
|
|
352
437
|
* `externalFileAttributes`
|
|
353
438
|
* `relativeOffsetOfLocalHeader`
|
|
354
439
|
|
|
440
|
+
These fields are of type `Buffer`, and represent variable-length bytes before being processed:
|
|
441
|
+
* `fileNameRaw`
|
|
442
|
+
* `extraFieldRaw`
|
|
443
|
+
* `fileCommentRaw`
|
|
444
|
+
|
|
445
|
+
There are additional fields described below: `fileName`, `extraFields`, `fileComment`.
|
|
446
|
+
These are the processed versions of the `*Raw` fields listed above. See their own sections below.
|
|
447
|
+
(Note the inconsistency in pluralization of "field" vs "fields" in `extraField`, `extraFields`, and `extraFieldRaw`.
|
|
448
|
+
Sorry about that.)
|
|
449
|
+
|
|
450
|
+
The `new Entry()` constructor is available for clients to call, but it's usually not useful.
|
|
451
|
+
The constructor takes no parameters and does nothing; no fields will exist.
|
|
452
|
+
|
|
355
453
|
#### fileName
|
|
356
454
|
|
|
357
455
|
`String`.
|
|
@@ -369,7 +467,7 @@ Furthermore, no automatic file name validation is performed for this file name.
|
|
|
369
467
|
|
|
370
468
|
#### extraFields
|
|
371
469
|
|
|
372
|
-
`Array` with each
|
|
470
|
+
`Array` with each item in the form `{id: id, data: data}`,
|
|
373
471
|
where `id` is a `Number` and `data` is a `Buffer`.
|
|
374
472
|
|
|
375
473
|
This library looks for and reads the ZIP64 Extended Information Extra Field (0x0001)
|
|
@@ -379,12 +477,11 @@ This library also looks for and reads the Info-ZIP Unicode Path Extra Field (0x7
|
|
|
379
477
|
in order to support some zipfiles that use it instead of General Purpose Bit 11
|
|
380
478
|
to convey `UTF-8` file names.
|
|
381
479
|
When the field is identified and verified to be reliable (see the zipfile spec),
|
|
382
|
-
the
|
|
480
|
+
the file name in this field is stored in the `fileName` property,
|
|
383
481
|
and the file name in the central directory record for this entry is ignored.
|
|
384
482
|
Note that when `decodeStrings` is false, all Info-ZIP Unicode Path Extra Fields are ignored.
|
|
385
483
|
|
|
386
|
-
|
|
387
|
-
Fields that this library reads are left unalterned in the `extraFields` array.
|
|
484
|
+
See also [`getLastModDate()`](#getlastmoddateoptions) for additional extra fields that are recognized by this library.
|
|
388
485
|
|
|
389
486
|
#### fileComment
|
|
390
487
|
|
|
@@ -397,14 +494,46 @@ Prior to yauzl version 2.7.0, this field was erroneously documented as `comment`
|
|
|
397
494
|
For compatibility with any code that uses the field name `comment`,
|
|
398
495
|
yauzl creates an alias field named `comment` which is identical to `fileComment`.
|
|
399
496
|
|
|
400
|
-
#### getLastModDate()
|
|
497
|
+
#### getLastModDate([options])
|
|
401
498
|
|
|
402
|
-
|
|
499
|
+
Returns the modification time of the file as a JavaScript `Date` object.
|
|
500
|
+
The timezone situation is a mess; read on to learn more.
|
|
501
|
+
|
|
502
|
+
Due to the zip file specification having lackluster support for specifying timestamps natively,
|
|
503
|
+
there are several third-party extensions that add better support.
|
|
504
|
+
yauzl supports these encodings:
|
|
505
|
+
|
|
506
|
+
1. Info-ZIP "universal timestamp" extended field (`0x5455` aka `"UT"`): signed 32-bit seconds since `1970-01-01 00:00:00Z`, which supports the years 1901-2038 (partially inclusive) with 1-second precision. The value is timezone agnostic, i.e. always UTC.
|
|
507
|
+
2. NTFS extended field (`0x000a`): 64-bit signed 100-nanoseconds since `1601-01-01 00:00:00Z`, which supports the approximate years 20,000BCE-20,000CE with precision rounded to 1-millisecond (due to the JavaScript `Date` type). The value is timezone agnostic, i.e. always UTC.
|
|
508
|
+
3. DOS `lastModFileDate` and `lastModFileTime`: supports the years 1980-2108 (inclusive) with 2-second precision. Timezone is interpreted either as the local timezone or UTC depending on the `timezone` option documented below.
|
|
509
|
+
|
|
510
|
+
If both the Info-ZIP "universal timestamp" and NTFS extended fields are found, yauzl uses one of them, but which one is unspecified.
|
|
511
|
+
If neither are found, yauzl falls back to the built-in DOS `lastModFileDate` and `lastModFileTime`.
|
|
512
|
+
Every possible bit pattern of every encoding can be represented by a JavaScript `Date` object,
|
|
513
|
+
meaning this function cannot fail (barring parameter validation), and will never return an `Invalid Date` object.
|
|
514
|
+
|
|
515
|
+
`options` may be omitted or `null`, and has the following defaults:
|
|
403
516
|
|
|
404
517
|
```js
|
|
405
|
-
|
|
518
|
+
{
|
|
519
|
+
timezone: "local", // or "UTC"
|
|
520
|
+
forceDosFormat: false,
|
|
521
|
+
}
|
|
406
522
|
```
|
|
407
523
|
|
|
524
|
+
Set `forceDosFormat` to `true` (and do not set `timezone`) to enable pre-yauzl 3.2.0 behavior
|
|
525
|
+
where the Info-ZIP "universal timestamp" and NTFS extended fields are ignored.
|
|
526
|
+
|
|
527
|
+
The `timezone` option is only used in the DOS fallback.
|
|
528
|
+
If `timezone` is omitted, `null` or `"local"`, the `lastModFileDate` and `lastModFileTime` are interpreted in the system's current timezone (using `new Date(year, ...)`).
|
|
529
|
+
If `timezone` is `"UTC"`, the interpretation is in UTC+00:00 (using `new Date(Date.UTC(year, ...))`).
|
|
530
|
+
|
|
531
|
+
The JavaScript `Date` object, has several inherent limitations surrounding timezones.
|
|
532
|
+
There is an ECMAScript proposal to add better timezone support to JavaScript called the `Temporal` API.
|
|
533
|
+
Last I checked, it was at stage 3. https://github.com/tc39/proposal-temporal
|
|
534
|
+
Once that new API is available and stable, better timezone handling should be possible here somehow.
|
|
535
|
+
If you notice that the new API has become widely available, please open a feature request against this library to add support for it.
|
|
536
|
+
|
|
408
537
|
#### isEncrypted()
|
|
409
538
|
|
|
410
539
|
Returns is this entry encrypted with "Traditional Encryption".
|
|
@@ -428,6 +557,35 @@ return this.compressionMethod === 8;
|
|
|
428
557
|
|
|
429
558
|
See `openReadStream()` for the implications of this value.
|
|
430
559
|
|
|
560
|
+
### Class: LocalFileHeader
|
|
561
|
+
|
|
562
|
+
This is a trivial class that has no methods and only the following properties.
|
|
563
|
+
The constructor is available to call, but it doesn't do anything.
|
|
564
|
+
See `readLocalFileHeader()`.
|
|
565
|
+
|
|
566
|
+
See the zipfile spec for what these fields mean.
|
|
567
|
+
|
|
568
|
+
* `fileDataStart` - `Number`: inferred from `fileNameLength`, `extraFieldLength`, and this struct's position in the zipfile.
|
|
569
|
+
* `versionNeededToExtract` - `Number`
|
|
570
|
+
* `generalPurposeBitFlag` - `Number`
|
|
571
|
+
* `compressionMethod` - `Number`
|
|
572
|
+
* `lastModFileTime` - `Number`
|
|
573
|
+
* `lastModFileDate` - `Number`
|
|
574
|
+
* `crc32` - `Number`
|
|
575
|
+
* `compressedSize` - `Number`
|
|
576
|
+
* `uncompressedSize` - `Number`
|
|
577
|
+
* `fileNameLength` - `Number`
|
|
578
|
+
* `extraFieldLength` - `Number`
|
|
579
|
+
* `fileName` - `Buffer`
|
|
580
|
+
* `extraField` - `Buffer`
|
|
581
|
+
|
|
582
|
+
Note that unlike `Class: Entry`, the `fileName` and `extraField` are completely unprocessed.
|
|
583
|
+
This notably lacks Unicode and ZIP64 handling as well as any kind of safety validation on the file name.
|
|
584
|
+
See also [`parseExtraFields()`](#parseextrafields-extrafieldbuffer).
|
|
585
|
+
|
|
586
|
+
Also note that if your object is missing some of these fields,
|
|
587
|
+
make sure to read the docs on the `minimal` option in `readLocalFileHeader()`.
|
|
588
|
+
|
|
431
589
|
### Class: RandomAccessReader
|
|
432
590
|
|
|
433
591
|
This class is meant to be subclassed by clients and instantiated for the `fromRandomAccessReader()` function.
|
|
@@ -451,11 +609,11 @@ Any errors emitted on the readable stream will be handled and re-emitted on the
|
|
|
451
609
|
(returned from `zipfile.openReadStream()`) or provided as the `err` argument to the appropriate callback
|
|
452
610
|
(for example, for `fromRandomAccessReader()`).
|
|
453
611
|
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
If you never call `readStream.destroy()`, then streams returned from this method do not need to implement a method `.
|
|
457
|
-
`.
|
|
458
|
-
`.
|
|
612
|
+
If you call `readStream.destroy()` on streams you get from `openReadStream()`,
|
|
613
|
+
the returned stream *must* implement a method `._destroy()` according to https://nodejs.org/api/stream.html#writable_destroyerr-callback .
|
|
614
|
+
If you never call `readStream.destroy()`, then streams returned from this method do not need to implement a method `._destroy()`.
|
|
615
|
+
`._destroy()` should abort any streaming that is in progress and clean up any associated resources.
|
|
616
|
+
`._destroy()` will only be called after the stream has been `unpipe()`d from its destination.
|
|
459
617
|
|
|
460
618
|
Note that the stream returned from this method might not be the same object that is provided by `openReadStream()`.
|
|
461
619
|
The stream returned from this method might be `pipe()`d through one or more filter streams (for example, a zlib inflate stream).
|
|
@@ -491,6 +649,18 @@ Minor version updates to yauzl will not add any additional requirements to this
|
|
|
491
649
|
|
|
492
650
|
## Limitations
|
|
493
651
|
|
|
652
|
+
The automated tests for this project run on node versions 12 and up. Older versions of node are not supported.
|
|
653
|
+
|
|
654
|
+
### Files corrupted by the Mac Archive Utility are not my problem
|
|
655
|
+
|
|
656
|
+
For a lengthy discussion, see [issue #69](https://github.com/thejoshwolfe/yauzl/issues/69).
|
|
657
|
+
In summary, the Mac Archive Utility is buggy when creating large zip files,
|
|
658
|
+
and this library does not make any effort to work around the bugs.
|
|
659
|
+
This library will attempt to interpret the zip file data at face value,
|
|
660
|
+
which may result in errors, or even silently incomplete data.
|
|
661
|
+
If this bothers you, that's good! Please complain to Apple. :)
|
|
662
|
+
I have accepted that this library will simply not support that nonsense.
|
|
663
|
+
|
|
494
664
|
### No Streaming Unzip API
|
|
495
665
|
|
|
496
666
|
Due to the design of the .zip file format, it's impossible to interpret a .zip file from start to finish
|
|
@@ -526,7 +696,7 @@ By using General Purpose Bit 3 (and compression method 0),
|
|
|
526
696
|
it's possible to create arbitrarily ambiguous .zip files that
|
|
527
697
|
distract parsers with file contents that contain apparently valid .zip file metadata.
|
|
528
698
|
|
|
529
|
-
###
|
|
699
|
+
### Limited ZIP64 Support
|
|
530
700
|
|
|
531
701
|
For ZIP64, only zip files smaller than `8PiB` are supported,
|
|
532
702
|
not the full `16EiB` range that a 64-bit integer should be able to index.
|
|
@@ -603,8 +773,46 @@ Zip files officially support charset encodings other than CP437 and UTF-8,
|
|
|
603
773
|
but the zip file spec does not specify how it works.
|
|
604
774
|
This library makes no attempt to interpret the Language Encoding Flag.
|
|
605
775
|
|
|
776
|
+
### How Ambiguities Are Handled
|
|
777
|
+
|
|
778
|
+
The zip file specification has several ambiguities inherent in its design. Yikes!
|
|
779
|
+
|
|
780
|
+
* The `.ZIP file comment` must not contain the `end of central dir signature` bytes `50 4b 05 06`. This corresponds to the text `"PK☺☻"` in CP437. While this is allowed by the specification, yauzl will hopefully reject this situation with an "Invalid comment length" error. However, in some situations unpredictable incorrect behavior will ensue, which will probably manifest in either an invalid signature error or some kind of bounds check error, such as "Unexpected EOF".
|
|
781
|
+
* In non-ZIP64 files, the last central directory header must not have the bytes `50 4b 06 07` (`"PK♠•"` in CP437) exactly 20 bytes from its end, which might be in the `file name`, the `extra field`, or the `file comment`. The presence of these bytes indicates that this is a ZIP64 file.
|
|
782
|
+
|
|
606
783
|
## Change History
|
|
607
784
|
|
|
785
|
+
* 3.2.1
|
|
786
|
+
* Fix crash when reading certain corrupted NTFS timestamp extra fields. Thanks to CodeAnt AI Code Reviewer ( https://www.codeant.ai/ai-code-review ) for finding the bug.
|
|
787
|
+
* 3.2.0
|
|
788
|
+
* Added support for reading third-party extensions for timestamps: Info-ZIP "universal timestamp" extra field and NTFS extra field. [pull #160](https://github.com/thejoshwolfe/yauzl/pull/160)
|
|
789
|
+
* `entry.getLastModDate()` takes options `forceDosFormat` to revert the above change, and `timezone` to allow UTC interpretation of DOS timestamps.
|
|
790
|
+
* Documented `dosDateTimeToDate()` as now deprecated.
|
|
791
|
+
* 3.1.3
|
|
792
|
+
* Fixed a crash when using `fromBuffer()` to read corrupt zip files that specify out of bounds file offsets. [issue #156](https://github.com/thejoshwolfe/yauzl/pull/156)
|
|
793
|
+
* Enahnced the test suite to run the error tests through `fromBuffer()` and `fromRandomAccessReader()` in addition to `open()`, which would have caught the above.
|
|
794
|
+
* 3.1.2
|
|
795
|
+
* Fixed handling non-64 bit entries (similar to the version 3.1.1 fix) that actually have exactly 0xffffffff values in the fields. This fixes erroneous "expected zip64 extended information extra field" errors. [issue #109](https://github.com/thejoshwolfe/yauzl/pull/109)
|
|
796
|
+
* 3.1.1
|
|
797
|
+
* Fixed handling non-64 bit files that actually have exactly 0xffff or 0xffffffff values in End of Central Directory Record. This fixes erroneous "invalid zip64 end of central directory locator signature" errors. [issue #108](https://github.com/thejoshwolfe/yauzl/pull/108)
|
|
798
|
+
* Fixed handling of 64-bit zip files that put 0xffff or 0xffffffff in every field overridden in the Zip64 end of central directory record even if the value would have fit without overflow. In particular, this fixes an incorrect "multi-disk zip files are not supported" error. [pull #118](https://github.com/thejoshwolfe/yauzl/pull/118)
|
|
799
|
+
* 3.1.0
|
|
800
|
+
* Added `readLocalFileHeader()` and `Class: LocalFileHeader`.
|
|
801
|
+
* Added `openReadStreamLowLevel()`.
|
|
802
|
+
* Added `getFileNameLowLevel()` and `parseExtraFields()`.
|
|
803
|
+
Added fields to `Class: Entry`: `fileNameRaw`, `extraFieldRaw`, `fileCommentRaw`.
|
|
804
|
+
* Added `examples/compareCentralAndLocalHeaders.js` that demonstrate many of these low level APIs.
|
|
805
|
+
* Noted dropped support of node versions before 12 in the `"engines"` field of `package.json`.
|
|
806
|
+
* Fixed a crash when calling `openReadStream()` with an explicitly `null` options parameter (as opposed to omitted).
|
|
807
|
+
* 3.0.0
|
|
808
|
+
* BREAKING CHANGE: implementations of [RandomAccessReader](#class-randomaccessreader) that implement a `destroy` method must instead implement `_destroy` in accordance with the node standard https://nodejs.org/api/stream.html#writable_destroyerr-callback (note the error and callback parameters). If you continue to override `destory` instead, some error handling may be subtly broken. Additionally, this is required for async iterators to work correctly in some versions of node. [issue #110](https://github.com/thejoshwolfe/yauzl/issues/110)
|
|
809
|
+
* BREAKING CHANGE: Drop support for node versions older than 12.
|
|
810
|
+
* Maintenance: Fix buffer deprecation warning by bundling `fd-slicer` with a 1-line change, rather than depending on it. [issue #114](https://github.com/thejoshwolfe/yauzl/issues/114)
|
|
811
|
+
* Maintenance: Upgrade `bl` dependency; add `package-lock.json`; drop deprecated istanbul dependency. This resolves all security warnings for this project. [pull #125](https://github.com/thejoshwolfe/yauzl/pull/125)
|
|
812
|
+
* Maintenance: Replace broken Travis CI with GitHub Actions. [pull #148](https://github.com/thejoshwolfe/yauzl/pull/148)
|
|
813
|
+
* Maintenance: Fixed a long-standing issue in the test suite where a premature exit would incorrectly signal success.
|
|
814
|
+
* Officially gave up on supporting Mac Archive Utility corruption in order to rescue my motivation for this project. [issue #69](https://github.com/thejoshwolfe/yauzl/issues/69)
|
|
815
|
+
|
|
608
816
|
* 2.10.0
|
|
609
817
|
* Added support for non-conformant zipfiles created by Microsoft, and added option `strictFileNames` to disable the workaround. [issue #66](https://github.com/thejoshwolfe/yauzl/issues/66), [issue #88](https://github.com/thejoshwolfe/yauzl/issues/88)
|
|
610
818
|
* 2.9.2
|
|
@@ -656,3 +864,11 @@ This library makes no attempt to interpret the Language Encoding Flag.
|
|
|
656
864
|
* Fix bug with using `iconv`.
|
|
657
865
|
* 2.0.0
|
|
658
866
|
* Initial release.
|
|
867
|
+
|
|
868
|
+
## Development
|
|
869
|
+
|
|
870
|
+
One of the trickiest things in development is crafting test cases located in `test/{success,failure}/`.
|
|
871
|
+
These are zip files that have been specifically generated or design to test certain conditions in this library.
|
|
872
|
+
I recommend using [hexdump-zip](https://github.com/thejoshwolfe/hexdump-zip) to examine the structure of a zipfile.
|
|
873
|
+
|
|
874
|
+
For making new error cases, I typically start by copying `test/success/linux-info-zip.zip`, and then editing a few bytes with a hex editor.
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// This was adapted from https://github.com/andrewrk/node-fd-slicer by Andrew Kelley under the MIT License.
|
|
1
2
|
var fs = require('fs');
|
|
2
3
|
var util = require('util');
|
|
3
4
|
var stream = require('stream');
|
|
@@ -106,7 +107,7 @@ ReadStream.prototype._read = function(n) {
|
|
|
106
107
|
}
|
|
107
108
|
self.context.pend.go(function(cb) {
|
|
108
109
|
if (self.destroyed) return cb();
|
|
109
|
-
var buffer =
|
|
110
|
+
var buffer = Buffer.allocUnsafe(toRead);
|
|
110
111
|
fs.read(self.context.fd, buffer, 0, toRead, self.pos, function(err, bytesRead) {
|
|
111
112
|
if (err) {
|
|
112
113
|
self.destroy(err);
|
|
@@ -194,12 +195,29 @@ function BufferSlicer(buffer, options) {
|
|
|
194
195
|
}
|
|
195
196
|
|
|
196
197
|
BufferSlicer.prototype.read = function(buffer, offset, length, position, callback) {
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
198
|
+
if (!(0 <= offset && offset <= buffer.length)) throw new RangeError("offset outside buffer: 0 <= " + offset + " <= " + buffer.length);
|
|
199
|
+
if (position < 0) throw new RangeError("position is negative: " + position);
|
|
200
|
+
if (offset + length > buffer.length) {
|
|
201
|
+
// The caller's buffer can't hold all the bytes they're trying to read.
|
|
202
|
+
// Clamp the length instead of giving an error.
|
|
203
|
+
// The callback will be informed of fewer than expected bytes written.
|
|
204
|
+
length = buffer.length - offset;
|
|
205
|
+
}
|
|
206
|
+
if (position + length > this.buffer.length) {
|
|
207
|
+
// Clamp any attempt to read past the end of the source buffer.
|
|
208
|
+
length = this.buffer.length - position;
|
|
209
|
+
}
|
|
210
|
+
if (length <= 0) {
|
|
211
|
+
// After any clamping, we're fully out of bounds or otherwise have nothing to do.
|
|
212
|
+
// This isn't an error; it's just zero bytes written.
|
|
213
|
+
setImmediate(function() {
|
|
214
|
+
callback(null, 0);
|
|
215
|
+
});
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
this.buffer.copy(buffer, offset, position, position + length);
|
|
201
219
|
setImmediate(function() {
|
|
202
|
-
callback(null,
|
|
220
|
+
callback(null, length);
|
|
203
221
|
});
|
|
204
222
|
};
|
|
205
223
|
|