@milaboratories/pframes-rs-serv 1.0.61 → 1.0.63
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/export.cjs +20 -0
- package/dist/export.cjs.map +1 -0
- package/dist/export.d.ts +3 -0
- package/dist/export.d.ts.map +1 -0
- package/dist/export.js +18 -0
- package/dist/export.js.map +1 -0
- package/dist/fs-store.cjs +81 -0
- package/dist/fs-store.cjs.map +1 -0
- package/dist/fs-store.d.ts +14 -0
- package/dist/fs-store.d.ts.map +1 -0
- package/dist/fs-store.js +79 -0
- package/dist/fs-store.js.map +1 -0
- package/dist/handler.cjs +157 -0
- package/dist/handler.cjs.map +1 -0
- package/dist/handler.d.ts +15 -0
- package/dist/handler.d.ts.map +1 -0
- package/dist/handler.js +154 -0
- package/dist/handler.js.map +1 -0
- package/dist/index.cjs +17 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/parquet-server.cjs +53 -0
- package/dist/parquet-server.cjs.map +1 -0
- package/dist/parquet-server.d.ts +6 -0
- package/dist/parquet-server.d.ts.map +1 -0
- package/dist/parquet-server.js +51 -0
- package/dist/parquet-server.js.map +1 -0
- package/dist/serve.cjs +120 -0
- package/dist/serve.cjs.map +1 -0
- package/dist/serve.d.ts +7 -0
- package/dist/serve.d.ts.map +1 -0
- package/dist/serve.js +118 -0
- package/dist/serve.js.map +1 -0
- package/dist/utils/etag.cjs +10 -0
- package/dist/utils/etag.cjs.map +1 -0
- package/dist/utils/etag.d.ts +15 -0
- package/dist/utils/etag.d.ts.map +1 -0
- package/dist/utils/etag.js +8 -0
- package/dist/utils/etag.js.map +1 -0
- package/dist/utils/filename.cjs +15 -0
- package/dist/utils/filename.cjs.map +1 -0
- package/dist/utils/filename.d.ts +4 -0
- package/dist/utils/filename.d.ts.map +1 -0
- package/dist/utils/filename.js +13 -0
- package/dist/utils/filename.js.map +1 -0
- package/dist/utils/headers.cjs +26 -0
- package/dist/utils/headers.cjs.map +1 -0
- package/dist/utils/headers.d.ts +29 -0
- package/dist/utils/headers.d.ts.map +1 -0
- package/dist/utils/headers.js +23 -0
- package/dist/utils/headers.js.map +1 -0
- package/dist/utils/index.d.ts +8 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/method.cjs +16 -0
- package/dist/utils/method.cjs.map +1 -0
- package/dist/utils/method.d.ts +6 -0
- package/dist/utils/method.d.ts.map +1 -0
- package/dist/utils/method.js +12 -0
- package/dist/utils/method.js.map +1 -0
- package/dist/utils/options.cjs +135 -0
- package/dist/utils/options.cjs.map +1 -0
- package/dist/utils/options.d.ts +64 -0
- package/dist/utils/options.d.ts.map +1 -0
- package/dist/utils/options.js +133 -0
- package/dist/utils/options.js.map +1 -0
- package/dist/utils/range.cjs +34 -0
- package/dist/utils/range.cjs.map +1 -0
- package/dist/utils/range.d.ts +4 -0
- package/dist/utils/range.d.ts.map +1 -0
- package/dist/utils/range.js +32 -0
- package/dist/utils/range.js.map +1 -0
- package/dist/utils/status.cjs +20 -0
- package/dist/utils/status.cjs.map +1 -0
- package/dist/utils/status.d.ts +16 -0
- package/dist/utils/status.d.ts.map +1 -0
- package/dist/utils/status.js +18 -0
- package/dist/utils/status.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"headers.cjs","sources":["../../src/utils/headers.ts"],"sourcesContent":["'use strict';\n\n/** HTTP header names used in the parquet server handler */\nexport const HeaderName = {\n Accept: 'accept',\n AcceptRanges: 'accept-ranges',\n Allow: 'allow',\n Authorization: 'authorization',\n CacheControl: 'cache-control',\n ContentLength: 'content-length',\n ContentRange: 'content-range',\n ContentType: 'content-type',\n Date: 'date',\n ETag: 'etag',\n IfMatch: 'if-match',\n IfModifiedSince: 'if-modified-since',\n IfNoneMatch: 'if-none-match',\n IfUnmodifiedSince: 'if-unmodified-since',\n LastModified: 'last-modified',\n Range: 'range',\n WWWAuthenticate: 'www-authenticate'\n} as const;\n\n/** HTTP header values used in the parquet server handler */\nexport const HeaderValue = {\n AcceptRanges: 'bytes',\n Allow: 'GET, HEAD',\n CacheControl: 'public, immutable, max-age=31536000',\n ContentType: 'application/octet-stream',\n WWWAuthenticate: 'Bearer realm=\"parquet-server\"'\n} as const;\n"],"names":[],"mappings":";;AAEA;AACO,MAAM,UAAU,GAAG;AACxB,IACA,YAAY,EAAE,eAAe;AAC7B,IAAA,KAAK,EAAE,OAAO;AACd,IACA,YAAY,EAAE,eAAe;AAC7B,IAAA,aAAa,EAAE,gBAAgB;AAC/B,IAAA,YAAY,EAAE,eAAe;AAC7B,IAAA,WAAW,EAAE,cAAc;AAC3B,IACA,IAAI,EAAE,MAAM;AACZ,IAIA,YAAY,EAAE,eAAe;AAC7B,IACA,eAAe,EAAE;;AAGnB;AACO,MAAM,WAAW,GAAG;AACzB,IAAA,YAAY,EAAE,OAAO;AACrB,IAAA,KAAK,EAAE,WAAW;AAClB,IAAA,YAAY,EAAE,qCAAqC;AACnD,IAAA,WAAW,EAAE,0BAA0B;AACvC,IAAA,eAAe,EAAE;;;;;;"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** HTTP header names used in the parquet server handler */
|
|
2
|
+
export declare const HeaderName: {
|
|
3
|
+
readonly Accept: "accept";
|
|
4
|
+
readonly AcceptRanges: "accept-ranges";
|
|
5
|
+
readonly Allow: "allow";
|
|
6
|
+
readonly Authorization: "authorization";
|
|
7
|
+
readonly CacheControl: "cache-control";
|
|
8
|
+
readonly ContentLength: "content-length";
|
|
9
|
+
readonly ContentRange: "content-range";
|
|
10
|
+
readonly ContentType: "content-type";
|
|
11
|
+
readonly Date: "date";
|
|
12
|
+
readonly ETag: "etag";
|
|
13
|
+
readonly IfMatch: "if-match";
|
|
14
|
+
readonly IfModifiedSince: "if-modified-since";
|
|
15
|
+
readonly IfNoneMatch: "if-none-match";
|
|
16
|
+
readonly IfUnmodifiedSince: "if-unmodified-since";
|
|
17
|
+
readonly LastModified: "last-modified";
|
|
18
|
+
readonly Range: "range";
|
|
19
|
+
readonly WWWAuthenticate: "www-authenticate";
|
|
20
|
+
};
|
|
21
|
+
/** HTTP header values used in the parquet server handler */
|
|
22
|
+
export declare const HeaderValue: {
|
|
23
|
+
readonly AcceptRanges: "bytes";
|
|
24
|
+
readonly Allow: "GET, HEAD";
|
|
25
|
+
readonly CacheControl: "public, immutable, max-age=31536000";
|
|
26
|
+
readonly ContentType: "application/octet-stream";
|
|
27
|
+
readonly WWWAuthenticate: "Bearer realm=\"parquet-server\"";
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=headers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"headers.d.ts","sourceRoot":"","sources":["../../src/utils/headers.ts"],"names":[],"mappings":"AAEA,2DAA2D;AAC3D,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;CAkBb,CAAC;AAEX,4DAA4D;AAC5D,eAAO,MAAM,WAAW;;;;;;CAMd,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** HTTP header names used in the parquet server handler */
|
|
2
|
+
const HeaderName = {
|
|
3
|
+
AcceptRanges: 'accept-ranges',
|
|
4
|
+
Allow: 'allow',
|
|
5
|
+
CacheControl: 'cache-control',
|
|
6
|
+
ContentLength: 'content-length',
|
|
7
|
+
ContentRange: 'content-range',
|
|
8
|
+
ContentType: 'content-type',
|
|
9
|
+
ETag: 'etag',
|
|
10
|
+
LastModified: 'last-modified',
|
|
11
|
+
WWWAuthenticate: 'www-authenticate'
|
|
12
|
+
};
|
|
13
|
+
/** HTTP header values used in the parquet server handler */
|
|
14
|
+
const HeaderValue = {
|
|
15
|
+
AcceptRanges: 'bytes',
|
|
16
|
+
Allow: 'GET, HEAD',
|
|
17
|
+
CacheControl: 'public, immutable, max-age=31536000',
|
|
18
|
+
ContentType: 'application/octet-stream',
|
|
19
|
+
WWWAuthenticate: 'Bearer realm="parquet-server"'
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export { HeaderName, HeaderValue };
|
|
23
|
+
//# sourceMappingURL=headers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"headers.js","sources":["../../src/utils/headers.ts"],"sourcesContent":["'use strict';\n\n/** HTTP header names used in the parquet server handler */\nexport const HeaderName = {\n Accept: 'accept',\n AcceptRanges: 'accept-ranges',\n Allow: 'allow',\n Authorization: 'authorization',\n CacheControl: 'cache-control',\n ContentLength: 'content-length',\n ContentRange: 'content-range',\n ContentType: 'content-type',\n Date: 'date',\n ETag: 'etag',\n IfMatch: 'if-match',\n IfModifiedSince: 'if-modified-since',\n IfNoneMatch: 'if-none-match',\n IfUnmodifiedSince: 'if-unmodified-since',\n LastModified: 'last-modified',\n Range: 'range',\n WWWAuthenticate: 'www-authenticate'\n} as const;\n\n/** HTTP header values used in the parquet server handler */\nexport const HeaderValue = {\n AcceptRanges: 'bytes',\n Allow: 'GET, HEAD',\n CacheControl: 'public, immutable, max-age=31536000',\n ContentType: 'application/octet-stream',\n WWWAuthenticate: 'Bearer realm=\"parquet-server\"'\n} as const;\n"],"names":[],"mappings":"AAEA;AACO,MAAM,UAAU,GAAG;AACxB,IACA,YAAY,EAAE,eAAe;AAC7B,IAAA,KAAK,EAAE,OAAO;AACd,IACA,YAAY,EAAE,eAAe;AAC7B,IAAA,aAAa,EAAE,gBAAgB;AAC/B,IAAA,YAAY,EAAE,eAAe;AAC7B,IAAA,WAAW,EAAE,cAAc;AAC3B,IACA,IAAI,EAAE,MAAM;AACZ,IAIA,YAAY,EAAE,eAAe;AAC7B,IACA,eAAe,EAAE;;AAGnB;AACO,MAAM,WAAW,GAAG;AACzB,IAAA,YAAY,EAAE,OAAO;AACrB,IAAA,KAAK,EAAE,WAAW;AAClB,IAAA,YAAY,EAAE,qCAAqC;AACnD,IAAA,WAAW,EAAE,0BAA0B;AACvC,IAAA,eAAe,EAAE;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function isGetOrHead(method) {
|
|
4
|
+
return method === 'GET' || method === 'HEAD';
|
|
5
|
+
}
|
|
6
|
+
function isGet(method) {
|
|
7
|
+
return method === 'GET';
|
|
8
|
+
}
|
|
9
|
+
function isHead(method) {
|
|
10
|
+
return method === 'HEAD';
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
exports.isGet = isGet;
|
|
14
|
+
exports.isGetOrHead = isGetOrHead;
|
|
15
|
+
exports.isHead = isHead;
|
|
16
|
+
//# sourceMappingURL=method.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"method.cjs","sources":["../../src/utils/method.ts"],"sourcesContent":["import { PFrameInternal } from '@milaboratories/pl-model-middle-layer';\nimport { IncomingHttpHeaders } from 'node:http';\n\nexport function isGetOrHead(\n method: IncomingHttpHeaders['method']\n): method is PFrameInternal.HttpMethod {\n return method === 'GET' || method === 'HEAD';\n}\n\nexport function isGet(\n method: PFrameInternal.HttpMethod\n): method is Extract<PFrameInternal.HttpMethod, 'GET'> {\n return method === 'GET';\n}\n\nexport function isHead(\n method: PFrameInternal.HttpMethod\n): method is Extract<PFrameInternal.HttpMethod, 'HEAD'> {\n return method === 'HEAD';\n}\n"],"names":[],"mappings":";;AAGM,SAAU,WAAW,CACzB,MAAqC,EAAA;AAErC,IAAA,OAAO,MAAM,KAAK,KAAK,IAAI,MAAM,KAAK,MAAM;AAC9C;AAEM,SAAU,KAAK,CACnB,MAAiC,EAAA;IAEjC,OAAO,MAAM,KAAK,KAAK;AACzB;AAEM,SAAU,MAAM,CACpB,MAAiC,EAAA;IAEjC,OAAO,MAAM,KAAK,MAAM;AAC1B;;;;;;"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PFrameInternal } from '@milaboratories/pl-model-middle-layer';
|
|
2
|
+
import { IncomingHttpHeaders } from 'node:http';
|
|
3
|
+
export declare function isGetOrHead(method: IncomingHttpHeaders['method']): method is PFrameInternal.HttpMethod;
|
|
4
|
+
export declare function isGet(method: PFrameInternal.HttpMethod): method is Extract<PFrameInternal.HttpMethod, 'GET'>;
|
|
5
|
+
export declare function isHead(method: PFrameInternal.HttpMethod): method is Extract<PFrameInternal.HttpMethod, 'HEAD'>;
|
|
6
|
+
//# sourceMappingURL=method.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"method.d.ts","sourceRoot":"","sources":["../../src/utils/method.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAEhD,wBAAgB,WAAW,CACzB,MAAM,EAAE,mBAAmB,CAAC,QAAQ,CAAC,GACpC,MAAM,IAAI,cAAc,CAAC,UAAU,CAErC;AAED,wBAAgB,KAAK,CACnB,MAAM,EAAE,cAAc,CAAC,UAAU,GAChC,MAAM,IAAI,OAAO,CAAC,cAAc,CAAC,UAAU,EAAE,KAAK,CAAC,CAErD;AAED,wBAAgB,MAAM,CACpB,MAAM,EAAE,cAAc,CAAC,UAAU,GAChC,MAAM,IAAI,OAAO,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,CAEtD"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
function isGetOrHead(method) {
|
|
2
|
+
return method === 'GET' || method === 'HEAD';
|
|
3
|
+
}
|
|
4
|
+
function isGet(method) {
|
|
5
|
+
return method === 'GET';
|
|
6
|
+
}
|
|
7
|
+
function isHead(method) {
|
|
8
|
+
return method === 'HEAD';
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { isGet, isGetOrHead, isHead };
|
|
12
|
+
//# sourceMappingURL=method.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"method.js","sources":["../../src/utils/method.ts"],"sourcesContent":["import { PFrameInternal } from '@milaboratories/pl-model-middle-layer';\nimport { IncomingHttpHeaders } from 'node:http';\n\nexport function isGetOrHead(\n method: IncomingHttpHeaders['method']\n): method is PFrameInternal.HttpMethod {\n return method === 'GET' || method === 'HEAD';\n}\n\nexport function isGet(\n method: PFrameInternal.HttpMethod\n): method is Extract<PFrameInternal.HttpMethod, 'GET'> {\n return method === 'GET';\n}\n\nexport function isHead(\n method: PFrameInternal.HttpMethod\n): method is Extract<PFrameInternal.HttpMethod, 'HEAD'> {\n return method === 'HEAD';\n}\n"],"names":[],"mappings":"AAGM,SAAU,WAAW,CACzB,MAAqC,EAAA;AAErC,IAAA,OAAO,MAAM,KAAK,KAAK,IAAI,MAAM,KAAK,MAAM;AAC9C;AAEM,SAAU,KAAK,CACnB,MAAiC,EAAA;IAEjC,OAAO,MAAM,KAAK,KAAK;AACzB;AAEM,SAAU,MAAM,CACpB,MAAiC,EAAA;IAEjC,OAAO,MAAM,KAAK,MAAM;AAC1B;;;;"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
class EtagMatch {
|
|
4
|
+
etagMatch;
|
|
5
|
+
constructor(etagMatch) {
|
|
6
|
+
this.etagMatch = etagMatch;
|
|
7
|
+
}
|
|
8
|
+
static parse(etagMatch) {
|
|
9
|
+
if (etagMatch === undefined)
|
|
10
|
+
return null;
|
|
11
|
+
if (etagMatch === '*') {
|
|
12
|
+
return new EtagMatch({ type: 'wildcard' });
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
return new EtagMatch({
|
|
16
|
+
type: 'match',
|
|
17
|
+
value: etagMatch.split(',').map((etag) => etag.trim())
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
matches(etag) {
|
|
22
|
+
switch (this.etagMatch.type) {
|
|
23
|
+
case 'match':
|
|
24
|
+
return this.etagMatch.value.includes(etag);
|
|
25
|
+
case 'wildcard':
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
class DateMatch {
|
|
31
|
+
mtime;
|
|
32
|
+
constructor(mtime) {
|
|
33
|
+
this.mtime = mtime;
|
|
34
|
+
}
|
|
35
|
+
static parse(dateMatch) {
|
|
36
|
+
if (dateMatch === undefined)
|
|
37
|
+
return null;
|
|
38
|
+
const time = Date.parse(dateMatch);
|
|
39
|
+
if (isNaN(time))
|
|
40
|
+
return null;
|
|
41
|
+
return new DateMatch(new Date(time));
|
|
42
|
+
}
|
|
43
|
+
matches(mtime) {
|
|
44
|
+
return this.mtime.getTime() / 1_000 === mtime.getTime() / 1_000;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
class Options {
|
|
48
|
+
/**
|
|
49
|
+
* See <https://datatracker.ietf.org/doc/html/rfc9110#name-if-match>
|
|
50
|
+
*
|
|
51
|
+
* Examples:
|
|
52
|
+
*
|
|
53
|
+
* ```text
|
|
54
|
+
* If-Match: "xyzzy"
|
|
55
|
+
* If-Match: "xyzzy", "r2d2xxxx", "c3piozzzz"
|
|
56
|
+
* If-Match: *
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
ifMatch;
|
|
60
|
+
/**
|
|
61
|
+
* See <https://datatracker.ietf.org/doc/html/rfc9110#section-13.1.2>
|
|
62
|
+
*
|
|
63
|
+
* Examples:
|
|
64
|
+
*
|
|
65
|
+
* ```text
|
|
66
|
+
* If-None-Match: "xyzzy"
|
|
67
|
+
* If-None-Match: "xyzzy", "r2d2xxxx", "c3piozzzz"
|
|
68
|
+
* If-None-Match: *
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
ifNoneMatch;
|
|
72
|
+
/**
|
|
73
|
+
* See <https://datatracker.ietf.org/doc/html/rfc9110#section-13.1.3>
|
|
74
|
+
*
|
|
75
|
+
* Examples:
|
|
76
|
+
*
|
|
77
|
+
* ```text
|
|
78
|
+
* If-Modified-Since: Mon, 07 Jan 2002 19:43:36 GMT
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
ifModifiedSince;
|
|
82
|
+
/**
|
|
83
|
+
* See <https://datatracker.ietf.org/doc/html/rfc9110#section-13.1.4>
|
|
84
|
+
*
|
|
85
|
+
* Examples:
|
|
86
|
+
*
|
|
87
|
+
* ```text
|
|
88
|
+
* If-Unmodified-Since: Mon, 07 Jan 2002 19:43:36 GMT
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
ifUnmodifiedSince;
|
|
92
|
+
constructor(request) {
|
|
93
|
+
this.ifMatch = EtagMatch.parse(request.headers['if-match']);
|
|
94
|
+
this.ifNoneMatch = EtagMatch.parse(request.headers['if-none-match']);
|
|
95
|
+
this.ifModifiedSince = DateMatch.parse(request.headers['if-modified-since']);
|
|
96
|
+
this.ifUnmodifiedSince = DateMatch.parse(request.headers['if-unmodified-since']);
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* RFC 9110 section 13.1.1: If-Match precondition evaluation
|
|
100
|
+
* RFC 9110 section 13.1.4: If-Unmodified-Since precondition evaluation
|
|
101
|
+
* See <https://datatracker.ietf.org/doc/html/rfc9110#section-13.1.1>
|
|
102
|
+
* See <https://datatracker.ietf.org/doc/html/rfc9110#section-13.1.4>
|
|
103
|
+
*/
|
|
104
|
+
preconditionFailed(etag, mtime) {
|
|
105
|
+
// If-Match precondition takes precedence
|
|
106
|
+
if (this.ifMatch !== null && !this.ifMatch.matches(etag)) {
|
|
107
|
+
return true;
|
|
108
|
+
}
|
|
109
|
+
// If-Unmodified-Since precondition (only if no If-Match header)
|
|
110
|
+
if (this.ifMatch === null && this.ifUnmodifiedSince !== null) {
|
|
111
|
+
return !this.ifUnmodifiedSince.matches(mtime);
|
|
112
|
+
}
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* RFC 9110 section 13.1.2: If-None-Match precondition evaluation
|
|
117
|
+
* RFC 9110 section 13.1.3: If-Modified-Since precondition evaluation
|
|
118
|
+
* See <https://datatracker.ietf.org/doc/html/rfc9110#section-13.1.2>
|
|
119
|
+
* See <https://datatracker.ietf.org/doc/html/rfc9110#section-13.1.3>
|
|
120
|
+
*/
|
|
121
|
+
notModified(etag, mtime) {
|
|
122
|
+
// If-None-Match takes precedence over If-Modified-Since
|
|
123
|
+
if (this.ifNoneMatch !== null) {
|
|
124
|
+
return this.ifNoneMatch.matches(etag);
|
|
125
|
+
}
|
|
126
|
+
// If-Modified-Since (only if no If-None-Match header)
|
|
127
|
+
if (this.ifModifiedSince !== null) {
|
|
128
|
+
return this.ifModifiedSince.matches(mtime);
|
|
129
|
+
}
|
|
130
|
+
return false;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
exports.Options = Options;
|
|
135
|
+
//# sourceMappingURL=options.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.cjs","sources":["../../src/utils/options.ts"],"sourcesContent":["import { IncomingHttpHeaders, IncomingMessage } from 'node:http';\nimport { type Etag } from './etag';\n\ntype EtagMatchType =\n | {\n type: 'match';\n value: Etag[];\n }\n | {\n type: 'wildcard';\n };\n\nclass EtagMatch {\n private constructor(private readonly etagMatch: EtagMatchType) {}\n\n static parse(etagMatch: string | undefined): EtagMatch | null {\n if (etagMatch === undefined) return null;\n if (etagMatch === '*') {\n return new EtagMatch({ type: 'wildcard' });\n } else {\n return new EtagMatch({\n type: 'match',\n value: etagMatch.split(',').map((etag) => etag.trim() as Etag)\n });\n }\n }\n\n matches(etag: Etag): boolean {\n switch (this.etagMatch.type) {\n case 'match':\n return this.etagMatch.value.includes(etag);\n case 'wildcard':\n return true;\n }\n }\n}\n\nclass DateMatch {\n private constructor(private readonly mtime: Date) {}\n\n static parse(dateMatch: string | undefined): DateMatch | null {\n if (dateMatch === undefined) return null;\n const time = Date.parse(dateMatch);\n if (isNaN(time)) return null;\n return new DateMatch(new Date(time));\n }\n\n matches(mtime: Date): boolean {\n return this.mtime.getTime() / 1_000 === mtime.getTime() / 1_000;\n }\n}\n\nexport class Options {\n /**\n * See <https://datatracker.ietf.org/doc/html/rfc9110#name-if-match>\n *\n * Examples:\n *\n * ```text\n * If-Match: \"xyzzy\"\n * If-Match: \"xyzzy\", \"r2d2xxxx\", \"c3piozzzz\"\n * If-Match: *\n * ```\n */\n private ifMatch: EtagMatch | null;\n\n /**\n * See <https://datatracker.ietf.org/doc/html/rfc9110#section-13.1.2>\n *\n * Examples:\n *\n * ```text\n * If-None-Match: \"xyzzy\"\n * If-None-Match: \"xyzzy\", \"r2d2xxxx\", \"c3piozzzz\"\n * If-None-Match: *\n * ```\n */\n private ifNoneMatch: EtagMatch | null;\n\n /**\n * See <https://datatracker.ietf.org/doc/html/rfc9110#section-13.1.3>\n *\n * Examples:\n *\n * ```text\n * If-Modified-Since: Mon, 07 Jan 2002 19:43:36 GMT\n * ```\n */\n private ifModifiedSince: DateMatch | null;\n\n /**\n * See <https://datatracker.ietf.org/doc/html/rfc9110#section-13.1.4>\n *\n * Examples:\n *\n * ```text\n * If-Unmodified-Since: Mon, 07 Jan 2002 19:43:36 GMT\n * ```\n */\n private ifUnmodifiedSince: DateMatch | null;\n\n constructor(request: IncomingMessage) {\n this.ifMatch = EtagMatch.parse(request.headers['if-match']);\n this.ifNoneMatch = EtagMatch.parse(request.headers['if-none-match']);\n this.ifModifiedSince = DateMatch.parse(\n request.headers['if-modified-since']\n );\n this.ifUnmodifiedSince = DateMatch.parse(\n request.headers['if-unmodified-since']\n );\n }\n\n /**\n * RFC 9110 section 13.1.1: If-Match precondition evaluation\n * RFC 9110 section 13.1.4: If-Unmodified-Since precondition evaluation\n * See <https://datatracker.ietf.org/doc/html/rfc9110#section-13.1.1>\n * See <https://datatracker.ietf.org/doc/html/rfc9110#section-13.1.4>\n */\n preconditionFailed(etag: Etag, mtime: Date): boolean {\n // If-Match precondition takes precedence\n if (this.ifMatch !== null && !this.ifMatch.matches(etag)) {\n return true;\n }\n\n // If-Unmodified-Since precondition (only if no If-Match header)\n if (this.ifMatch === null && this.ifUnmodifiedSince !== null) {\n return !this.ifUnmodifiedSince.matches(mtime);\n }\n\n return false;\n }\n\n /**\n * RFC 9110 section 13.1.2: If-None-Match precondition evaluation\n * RFC 9110 section 13.1.3: If-Modified-Since precondition evaluation\n * See <https://datatracker.ietf.org/doc/html/rfc9110#section-13.1.2>\n * See <https://datatracker.ietf.org/doc/html/rfc9110#section-13.1.3>\n */\n notModified(etag: Etag, mtime: Date): boolean {\n // If-None-Match takes precedence over If-Modified-Since\n if (this.ifNoneMatch !== null) {\n return this.ifNoneMatch.matches(etag);\n }\n\n // If-Modified-Since (only if no If-None-Match header)\n if (this.ifModifiedSince !== null) {\n return this.ifModifiedSince.matches(mtime);\n }\n\n return false;\n }\n}\n"],"names":[],"mappings":";;AAYA,MAAM,SAAS,CAAA;AACwB,IAAA,SAAA;AAArC,IAAA,WAAA,CAAqC,SAAwB,EAAA;QAAxB,IAAA,CAAA,SAAS,GAAT,SAAS;IAAkB;IAEhE,OAAO,KAAK,CAAC,SAA6B,EAAA;QACxC,IAAI,SAAS,KAAK,SAAS;AAAE,YAAA,OAAO,IAAI;AACxC,QAAA,IAAI,SAAS,KAAK,GAAG,EAAE;YACrB,OAAO,IAAI,SAAS,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;QAC5C;aAAO;YACL,OAAO,IAAI,SAAS,CAAC;AACnB,gBAAA,IAAI,EAAE,OAAO;AACb,gBAAA,KAAK,EAAE,SAAS,CAAC,KAAK,CAAC,GAA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AAA,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;AACpE,QAAA,IAAI,CAAC,eAAe,GAAG,SAAS,CAAC,KAAK,CACpC,OAAO,CAAC,OAAO,CAAC,mBAAmB,CAAC,CACrC;AACD,QAAA,IAAI,CAAC,iBAAiB,GAAG,SAAS,CAAC,KAAK,CACtC,OAAO,CAAC,OAAO,CAAC,qBAAqB,CAAC,CACvC;IACH;AAEA;;;;;AAKG;IACH,kBAAkB,CAAC,IAAU,EAAE,KAAW,EAAA;;AAExC,QAAA,IAAI,IAAI,CAAC,OAAO,KAAK,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;AACxD,YAAA,OAAO,IAAI;QACb;;AAGA,QAAA,IAAI,IAAI,CAAC,OAAO,KAAK,IAAI,IAAI,IAAI,CAAC,iBAAiB,KAAK,IAAI,EAAE;YAC5D,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,KAAK,CAAC;QAC/C;AAEA,QAAA,OAAO,KAAK;IACd;AAEA;;;;;AAKG;IACH,WAAW,CAAC,IAAU,EAAE,KAAW,EAAA;;AAEjC,QAAA,IAAI,IAAI,CAAC,WAAW,KAAK,IAAI,EAAE;YAC7B,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC;QACvC;;AAGA,QAAA,IAAI,IAAI,CAAC,eAAe,KAAK,IAAI,EAAE;YACjC,OAAO,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,KAAK,CAAC;QAC5C;AAEA,QAAA,OAAO,KAAK;IACd;AACD;;;;"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { IncomingMessage } from 'node:http';
|
|
2
|
+
import { type Etag } from './etag';
|
|
3
|
+
export declare class Options {
|
|
4
|
+
/**
|
|
5
|
+
* See <https://datatracker.ietf.org/doc/html/rfc9110#name-if-match>
|
|
6
|
+
*
|
|
7
|
+
* Examples:
|
|
8
|
+
*
|
|
9
|
+
* ```text
|
|
10
|
+
* If-Match: "xyzzy"
|
|
11
|
+
* If-Match: "xyzzy", "r2d2xxxx", "c3piozzzz"
|
|
12
|
+
* If-Match: *
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
private ifMatch;
|
|
16
|
+
/**
|
|
17
|
+
* See <https://datatracker.ietf.org/doc/html/rfc9110#section-13.1.2>
|
|
18
|
+
*
|
|
19
|
+
* Examples:
|
|
20
|
+
*
|
|
21
|
+
* ```text
|
|
22
|
+
* If-None-Match: "xyzzy"
|
|
23
|
+
* If-None-Match: "xyzzy", "r2d2xxxx", "c3piozzzz"
|
|
24
|
+
* If-None-Match: *
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
private ifNoneMatch;
|
|
28
|
+
/**
|
|
29
|
+
* See <https://datatracker.ietf.org/doc/html/rfc9110#section-13.1.3>
|
|
30
|
+
*
|
|
31
|
+
* Examples:
|
|
32
|
+
*
|
|
33
|
+
* ```text
|
|
34
|
+
* If-Modified-Since: Mon, 07 Jan 2002 19:43:36 GMT
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
private ifModifiedSince;
|
|
38
|
+
/**
|
|
39
|
+
* See <https://datatracker.ietf.org/doc/html/rfc9110#section-13.1.4>
|
|
40
|
+
*
|
|
41
|
+
* Examples:
|
|
42
|
+
*
|
|
43
|
+
* ```text
|
|
44
|
+
* If-Unmodified-Since: Mon, 07 Jan 2002 19:43:36 GMT
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
private ifUnmodifiedSince;
|
|
48
|
+
constructor(request: IncomingMessage);
|
|
49
|
+
/**
|
|
50
|
+
* RFC 9110 section 13.1.1: If-Match precondition evaluation
|
|
51
|
+
* RFC 9110 section 13.1.4: If-Unmodified-Since precondition evaluation
|
|
52
|
+
* See <https://datatracker.ietf.org/doc/html/rfc9110#section-13.1.1>
|
|
53
|
+
* See <https://datatracker.ietf.org/doc/html/rfc9110#section-13.1.4>
|
|
54
|
+
*/
|
|
55
|
+
preconditionFailed(etag: Etag, mtime: Date): boolean;
|
|
56
|
+
/**
|
|
57
|
+
* RFC 9110 section 13.1.2: If-None-Match precondition evaluation
|
|
58
|
+
* RFC 9110 section 13.1.3: If-Modified-Since precondition evaluation
|
|
59
|
+
* See <https://datatracker.ietf.org/doc/html/rfc9110#section-13.1.2>
|
|
60
|
+
* See <https://datatracker.ietf.org/doc/html/rfc9110#section-13.1.3>
|
|
61
|
+
*/
|
|
62
|
+
notModified(etag: Etag, mtime: Date): boolean;
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/utils/options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,eAAe,EAAE,MAAM,WAAW,CAAC;AACjE,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,QAAQ,CAAC;AAmDnC,qBAAa,OAAO;IAClB;;;;;;;;;;OAUG;IACH,OAAO,CAAC,OAAO,CAAmB;IAElC;;;;;;;;;;OAUG;IACH,OAAO,CAAC,WAAW,CAAmB;IAEtC;;;;;;;;OAQG;IACH,OAAO,CAAC,eAAe,CAAmB;IAE1C;;;;;;;;OAQG;IACH,OAAO,CAAC,iBAAiB,CAAmB;gBAEhC,OAAO,EAAE,eAAe;IAWpC;;;;;OAKG;IACH,kBAAkB,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,GAAG,OAAO;IAcpD;;;;;OAKG;IACH,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,GAAG,OAAO;CAa9C"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
class EtagMatch {
|
|
2
|
+
etagMatch;
|
|
3
|
+
constructor(etagMatch) {
|
|
4
|
+
this.etagMatch = etagMatch;
|
|
5
|
+
}
|
|
6
|
+
static parse(etagMatch) {
|
|
7
|
+
if (etagMatch === undefined)
|
|
8
|
+
return null;
|
|
9
|
+
if (etagMatch === '*') {
|
|
10
|
+
return new EtagMatch({ type: 'wildcard' });
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
return new EtagMatch({
|
|
14
|
+
type: 'match',
|
|
15
|
+
value: etagMatch.split(',').map((etag) => etag.trim())
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
matches(etag) {
|
|
20
|
+
switch (this.etagMatch.type) {
|
|
21
|
+
case 'match':
|
|
22
|
+
return this.etagMatch.value.includes(etag);
|
|
23
|
+
case 'wildcard':
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
class DateMatch {
|
|
29
|
+
mtime;
|
|
30
|
+
constructor(mtime) {
|
|
31
|
+
this.mtime = mtime;
|
|
32
|
+
}
|
|
33
|
+
static parse(dateMatch) {
|
|
34
|
+
if (dateMatch === undefined)
|
|
35
|
+
return null;
|
|
36
|
+
const time = Date.parse(dateMatch);
|
|
37
|
+
if (isNaN(time))
|
|
38
|
+
return null;
|
|
39
|
+
return new DateMatch(new Date(time));
|
|
40
|
+
}
|
|
41
|
+
matches(mtime) {
|
|
42
|
+
return this.mtime.getTime() / 1_000 === mtime.getTime() / 1_000;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
class Options {
|
|
46
|
+
/**
|
|
47
|
+
* See <https://datatracker.ietf.org/doc/html/rfc9110#name-if-match>
|
|
48
|
+
*
|
|
49
|
+
* Examples:
|
|
50
|
+
*
|
|
51
|
+
* ```text
|
|
52
|
+
* If-Match: "xyzzy"
|
|
53
|
+
* If-Match: "xyzzy", "r2d2xxxx", "c3piozzzz"
|
|
54
|
+
* If-Match: *
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
ifMatch;
|
|
58
|
+
/**
|
|
59
|
+
* See <https://datatracker.ietf.org/doc/html/rfc9110#section-13.1.2>
|
|
60
|
+
*
|
|
61
|
+
* Examples:
|
|
62
|
+
*
|
|
63
|
+
* ```text
|
|
64
|
+
* If-None-Match: "xyzzy"
|
|
65
|
+
* If-None-Match: "xyzzy", "r2d2xxxx", "c3piozzzz"
|
|
66
|
+
* If-None-Match: *
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
ifNoneMatch;
|
|
70
|
+
/**
|
|
71
|
+
* See <https://datatracker.ietf.org/doc/html/rfc9110#section-13.1.3>
|
|
72
|
+
*
|
|
73
|
+
* Examples:
|
|
74
|
+
*
|
|
75
|
+
* ```text
|
|
76
|
+
* If-Modified-Since: Mon, 07 Jan 2002 19:43:36 GMT
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
ifModifiedSince;
|
|
80
|
+
/**
|
|
81
|
+
* See <https://datatracker.ietf.org/doc/html/rfc9110#section-13.1.4>
|
|
82
|
+
*
|
|
83
|
+
* Examples:
|
|
84
|
+
*
|
|
85
|
+
* ```text
|
|
86
|
+
* If-Unmodified-Since: Mon, 07 Jan 2002 19:43:36 GMT
|
|
87
|
+
* ```
|
|
88
|
+
*/
|
|
89
|
+
ifUnmodifiedSince;
|
|
90
|
+
constructor(request) {
|
|
91
|
+
this.ifMatch = EtagMatch.parse(request.headers['if-match']);
|
|
92
|
+
this.ifNoneMatch = EtagMatch.parse(request.headers['if-none-match']);
|
|
93
|
+
this.ifModifiedSince = DateMatch.parse(request.headers['if-modified-since']);
|
|
94
|
+
this.ifUnmodifiedSince = DateMatch.parse(request.headers['if-unmodified-since']);
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* RFC 9110 section 13.1.1: If-Match precondition evaluation
|
|
98
|
+
* RFC 9110 section 13.1.4: If-Unmodified-Since precondition evaluation
|
|
99
|
+
* See <https://datatracker.ietf.org/doc/html/rfc9110#section-13.1.1>
|
|
100
|
+
* See <https://datatracker.ietf.org/doc/html/rfc9110#section-13.1.4>
|
|
101
|
+
*/
|
|
102
|
+
preconditionFailed(etag, mtime) {
|
|
103
|
+
// If-Match precondition takes precedence
|
|
104
|
+
if (this.ifMatch !== null && !this.ifMatch.matches(etag)) {
|
|
105
|
+
return true;
|
|
106
|
+
}
|
|
107
|
+
// If-Unmodified-Since precondition (only if no If-Match header)
|
|
108
|
+
if (this.ifMatch === null && this.ifUnmodifiedSince !== null) {
|
|
109
|
+
return !this.ifUnmodifiedSince.matches(mtime);
|
|
110
|
+
}
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* RFC 9110 section 13.1.2: If-None-Match precondition evaluation
|
|
115
|
+
* RFC 9110 section 13.1.3: If-Modified-Since precondition evaluation
|
|
116
|
+
* See <https://datatracker.ietf.org/doc/html/rfc9110#section-13.1.2>
|
|
117
|
+
* See <https://datatracker.ietf.org/doc/html/rfc9110#section-13.1.3>
|
|
118
|
+
*/
|
|
119
|
+
notModified(etag, mtime) {
|
|
120
|
+
// If-None-Match takes precedence over If-Modified-Since
|
|
121
|
+
if (this.ifNoneMatch !== null) {
|
|
122
|
+
return this.ifNoneMatch.matches(etag);
|
|
123
|
+
}
|
|
124
|
+
// If-Modified-Since (only if no If-None-Match header)
|
|
125
|
+
if (this.ifModifiedSince !== null) {
|
|
126
|
+
return this.ifModifiedSince.matches(mtime);
|
|
127
|
+
}
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export { Options };
|
|
133
|
+
//# sourceMappingURL=options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.js","sources":["../../src/utils/options.ts"],"sourcesContent":["import { IncomingHttpHeaders, IncomingMessage } from 'node:http';\nimport { type Etag } from './etag';\n\ntype EtagMatchType =\n | {\n type: 'match';\n value: Etag[];\n }\n | {\n type: 'wildcard';\n };\n\nclass EtagMatch {\n private constructor(private readonly etagMatch: EtagMatchType) {}\n\n static parse(etagMatch: string | undefined): EtagMatch | null {\n if (etagMatch === undefined) return null;\n if (etagMatch === '*') {\n return new EtagMatch({ type: 'wildcard' });\n } else {\n return new EtagMatch({\n type: 'match',\n value: etagMatch.split(',').map((etag) => etag.trim() as Etag)\n });\n }\n }\n\n matches(etag: Etag): boolean {\n switch (this.etagMatch.type) {\n case 'match':\n return this.etagMatch.value.includes(etag);\n case 'wildcard':\n return true;\n }\n }\n}\n\nclass DateMatch {\n private constructor(private readonly mtime: Date) {}\n\n static parse(dateMatch: string | undefined): DateMatch | null {\n if (dateMatch === undefined) return null;\n const time = Date.parse(dateMatch);\n if (isNaN(time)) return null;\n return new DateMatch(new Date(time));\n }\n\n matches(mtime: Date): boolean {\n return this.mtime.getTime() / 1_000 === mtime.getTime() / 1_000;\n }\n}\n\nexport class Options {\n /**\n * See <https://datatracker.ietf.org/doc/html/rfc9110#name-if-match>\n *\n * Examples:\n *\n * ```text\n * If-Match: \"xyzzy\"\n * If-Match: \"xyzzy\", \"r2d2xxxx\", \"c3piozzzz\"\n * If-Match: *\n * ```\n */\n private ifMatch: EtagMatch | null;\n\n /**\n * See <https://datatracker.ietf.org/doc/html/rfc9110#section-13.1.2>\n *\n * Examples:\n *\n * ```text\n * If-None-Match: \"xyzzy\"\n * If-None-Match: \"xyzzy\", \"r2d2xxxx\", \"c3piozzzz\"\n * If-None-Match: *\n * ```\n */\n private ifNoneMatch: EtagMatch | null;\n\n /**\n * See <https://datatracker.ietf.org/doc/html/rfc9110#section-13.1.3>\n *\n * Examples:\n *\n * ```text\n * If-Modified-Since: Mon, 07 Jan 2002 19:43:36 GMT\n * ```\n */\n private ifModifiedSince: DateMatch | null;\n\n /**\n * See <https://datatracker.ietf.org/doc/html/rfc9110#section-13.1.4>\n *\n * Examples:\n *\n * ```text\n * If-Unmodified-Since: Mon, 07 Jan 2002 19:43:36 GMT\n * ```\n */\n private ifUnmodifiedSince: DateMatch | null;\n\n constructor(request: IncomingMessage) {\n this.ifMatch = EtagMatch.parse(request.headers['if-match']);\n this.ifNoneMatch = EtagMatch.parse(request.headers['if-none-match']);\n this.ifModifiedSince = DateMatch.parse(\n request.headers['if-modified-since']\n );\n this.ifUnmodifiedSince = DateMatch.parse(\n request.headers['if-unmodified-since']\n );\n }\n\n /**\n * RFC 9110 section 13.1.1: If-Match precondition evaluation\n * RFC 9110 section 13.1.4: If-Unmodified-Since precondition evaluation\n * See <https://datatracker.ietf.org/doc/html/rfc9110#section-13.1.1>\n * See <https://datatracker.ietf.org/doc/html/rfc9110#section-13.1.4>\n */\n preconditionFailed(etag: Etag, mtime: Date): boolean {\n // If-Match precondition takes precedence\n if (this.ifMatch !== null && !this.ifMatch.matches(etag)) {\n return true;\n }\n\n // If-Unmodified-Since precondition (only if no If-Match header)\n if (this.ifMatch === null && this.ifUnmodifiedSince !== null) {\n return !this.ifUnmodifiedSince.matches(mtime);\n }\n\n return false;\n }\n\n /**\n * RFC 9110 section 13.1.2: If-None-Match precondition evaluation\n * RFC 9110 section 13.1.3: If-Modified-Since precondition evaluation\n * See <https://datatracker.ietf.org/doc/html/rfc9110#section-13.1.2>\n * See <https://datatracker.ietf.org/doc/html/rfc9110#section-13.1.3>\n */\n notModified(etag: Etag, mtime: Date): boolean {\n // If-None-Match takes precedence over If-Modified-Since\n if (this.ifNoneMatch !== null) {\n return this.ifNoneMatch.matches(etag);\n }\n\n // If-Modified-Since (only if no If-None-Match header)\n if (this.ifModifiedSince !== null) {\n return this.ifModifiedSince.matches(mtime);\n }\n\n return false;\n }\n}\n"],"names":[],"mappings":"AAYA,MAAM,SAAS,CAAA;AACwB,IAAA,SAAA;AAArC,IAAA,WAAA,CAAqC,SAAwB,EAAA;QAAxB,IAAA,CAAA,SAAS,GAAT,SAAS;IAAkB;IAEhE,OAAO,KAAK,CAAC,SAA6B,EAAA;QACxC,IAAI,SAAS,KAAK,SAAS;AAAE,YAAA,OAAO,IAAI;AACxC,QAAA,IAAI,SAAS,KAAK,GAAG,EAAE;YACrB,OAAO,IAAI,SA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
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function parseRange(request) {
|
|
4
|
+
const range = request.headers['range'];
|
|
5
|
+
if (range === undefined)
|
|
6
|
+
return undefined;
|
|
7
|
+
const match = range.match(/^bytes=(\d*)-(\d*)$/);
|
|
8
|
+
if (!match)
|
|
9
|
+
return null;
|
|
10
|
+
const [, startStr, endStr] = match;
|
|
11
|
+
const start = startStr ? parseInt(startStr, 10) : null;
|
|
12
|
+
const end = endStr ? parseInt(endStr, 10) : null;
|
|
13
|
+
if ((start !== null && (isNaN(start) || start < 0)) ||
|
|
14
|
+
(end !== null && (isNaN(end) || end < 0)) ||
|
|
15
|
+
(start !== null && end !== null && start > end))
|
|
16
|
+
return null;
|
|
17
|
+
// Both start and end are specified - bounded range
|
|
18
|
+
if (start !== null && end !== null) {
|
|
19
|
+
return { type: 'bounded', start, end };
|
|
20
|
+
}
|
|
21
|
+
// Only start is specified - offset range (e.g., bytes=500-)
|
|
22
|
+
if (start !== null && end === null) {
|
|
23
|
+
return { type: 'offset', offset: start };
|
|
24
|
+
}
|
|
25
|
+
// Only end is specified - suffix range (e.g., bytes=-500)
|
|
26
|
+
if (start === null && end !== null) {
|
|
27
|
+
return { type: 'suffix', suffix: end };
|
|
28
|
+
}
|
|
29
|
+
// Neither start nor end specified (bytes=-) - invalid
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
exports.parseRange = parseRange;
|
|
34
|
+
//# sourceMappingURL=range.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"range.cjs","sources":["../../src/utils/range.ts"],"sourcesContent":["import { PFrameInternal } from '@milaboratories/pl-model-middle-layer';\nimport { IncomingMessage } from 'node:http';\n\nexport function parseRange(\n request: IncomingMessage\n): PFrameInternal.HttpRange | null | undefined {\n const range = request.headers['range'];\n if (range === undefined) return undefined;\n\n const match = range.match(/^bytes=(\\d*)-(\\d*)$/);\n if (!match) return null;\n\n const [, startStr, endStr] = match;\n const start = startStr ? parseInt(startStr, 10) : null;\n const end = endStr ? parseInt(endStr, 10) : null;\n if (\n (start !== null && (isNaN(start) || start < 0)) ||\n (end !== null && (isNaN(end) || end < 0)) ||\n (start !== null && end !== null && start > end)\n )\n return null;\n\n // Both start and end are specified - bounded range\n if (start !== null && end !== null) {\n return { type: 'bounded', start, end };\n }\n\n // Only start is specified - offset range (e.g., bytes=500-)\n if (start !== null && end === null) {\n return { type: 'offset', offset: start };\n }\n\n // Only end is specified - suffix range (e.g., bytes=-500)\n if (start === null && end !== null) {\n return { type: 'suffix', suffix: end };\n }\n\n // Neither start nor end specified (bytes=-) - invalid\n return null;\n}\n"],"names":[],"mappings":";;AAGM,SAAU,UAAU,CACxB,OAAwB,EAAA;IAExB,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC;IACtC,IAAI,KAAK,KAAK,SAAS;AAAE,QAAA,OAAO,SAAS;IAEzC,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,qBAAqB,CAAC;AAChD,IAAA,IAAI,CAAC,KAAK;AAAE,QAAA,OAAO,IAAI;IAEvB,MAAM,GAAG,QAAQ,EAAE,MAAM,CAAC,GAAG,KAAK;AAClC,IAAA,MAAM,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAC,QAAQ,EAAE,EAAE,CAAC,GAAG,IAAI;AACtD,IAAA,MAAM,GAAG,GAAG,MAAM,GAAG,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC,GAAG,IAAI;AAChD,IAAA,IACE,CAAC,KAAK,KAAK,IAAI,KAAK,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC;AAC9C,SAAC,GAAG,KAAK,IAAI,KAAK,KAAK,CAAC,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,CAAC,CAAC;SACxC,KAAK,KAAK,IAAI,IAAI,GAAG,KAAK,IAAI,IAAI,KAAK,GAAG,GAAG,CAAC;AAE/C,QAAA,OAAO,IAAI;;IAGb,IAAI,KAAK,KAAK,IAAI,IAAI,GAAG,KAAK,IAAI,EAAE;QAClC,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE;IACxC;;IAGA,IAAI,KAAK,KAAK,IAAI,IAAI,GAAG,KAAK,IAAI,EAAE;QAClC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE;IAC1C;;IAGA,IAAI,KAAK,KAAK,IAAI,IAAI,GAAG,KAAK,IAAI,EAAE;QAClC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE;IACxC;;AAGA,IAAA,OAAO,IAAI;AACb;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"range.d.ts","sourceRoot":"","sources":["../../src/utils/range.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,wBAAgB,UAAU,CACxB,OAAO,EAAE,eAAe,GACvB,cAAc,CAAC,SAAS,GAAG,IAAI,GAAG,SAAS,CAkC7C"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
function parseRange(request) {
|
|
2
|
+
const range = request.headers['range'];
|
|
3
|
+
if (range === undefined)
|
|
4
|
+
return undefined;
|
|
5
|
+
const match = range.match(/^bytes=(\d*)-(\d*)$/);
|
|
6
|
+
if (!match)
|
|
7
|
+
return null;
|
|
8
|
+
const [, startStr, endStr] = match;
|
|
9
|
+
const start = startStr ? parseInt(startStr, 10) : null;
|
|
10
|
+
const end = endStr ? parseInt(endStr, 10) : null;
|
|
11
|
+
if ((start !== null && (isNaN(start) || start < 0)) ||
|
|
12
|
+
(end !== null && (isNaN(end) || end < 0)) ||
|
|
13
|
+
(start !== null && end !== null && start > end))
|
|
14
|
+
return null;
|
|
15
|
+
// Both start and end are specified - bounded range
|
|
16
|
+
if (start !== null && end !== null) {
|
|
17
|
+
return { type: 'bounded', start, end };
|
|
18
|
+
}
|
|
19
|
+
// Only start is specified - offset range (e.g., bytes=500-)
|
|
20
|
+
if (start !== null && end === null) {
|
|
21
|
+
return { type: 'offset', offset: start };
|
|
22
|
+
}
|
|
23
|
+
// Only end is specified - suffix range (e.g., bytes=-500)
|
|
24
|
+
if (start === null && end !== null) {
|
|
25
|
+
return { type: 'suffix', suffix: end };
|
|
26
|
+
}
|
|
27
|
+
// Neither start nor end specified (bytes=-) - invalid
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export { parseRange };
|
|
32
|
+
//# sourceMappingURL=range.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"range.js","sources":["../../src/utils/range.ts"],"sourcesContent":["import { PFrameInternal } from '@milaboratories/pl-model-middle-layer';\nimport { IncomingMessage } from 'node:http';\n\nexport function parseRange(\n request: IncomingMessage\n): PFrameInternal.HttpRange | null | undefined {\n const range = request.headers['range'];\n if (range === undefined) return undefined;\n\n const match = range.match(/^bytes=(\\d*)-(\\d*)$/);\n if (!match) return null;\n\n const [, startStr, endStr] = match;\n const start = startStr ? parseInt(startStr, 10) : null;\n const end = endStr ? parseInt(endStr, 10) : null;\n if (\n (start !== null && (isNaN(start) || start < 0)) ||\n (end !== null && (isNaN(end) || end < 0)) ||\n (start !== null && end !== null && start > end)\n )\n return null;\n\n // Both start and end are specified - bounded range\n if (start !== null && end !== null) {\n return { type: 'bounded', start, end };\n }\n\n // Only start is specified - offset range (e.g., bytes=500-)\n if (start !== null && end === null) {\n return { type: 'offset', offset: start };\n }\n\n // Only end is specified - suffix range (e.g., bytes=-500)\n if (start === null && end !== null) {\n return { type: 'suffix', suffix: end };\n }\n\n // Neither start nor end specified (bytes=-) - invalid\n return null;\n}\n"],"names":[],"mappings":"AAGM,SAAU,UAAU,CACxB,OAAwB,EAAA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 +1,20 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/** HTTP status codes used in the parquet server handler */
|
|
4
|
+
const StatusCode = {
|
|
5
|
+
Ok: 200, // <https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/200>
|
|
6
|
+
PartialContent: 206, // <https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/206>
|
|
7
|
+
NotModified: 304, // <https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/304>
|
|
8
|
+
BadRequest: 400, // <https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400>
|
|
9
|
+
Unauthorized: 401, // <https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/401>
|
|
10
|
+
NotFound: 404, // <https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/404>
|
|
11
|
+
MethodNotAllowed: 405, // <https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/405>
|
|
12
|
+
Gone: 410, // <https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/410>
|
|
13
|
+
PreconditionFailed: 412, // <https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/412>
|
|
14
|
+
RangeNotSatisfiable: 416, // <https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/416>
|
|
15
|
+
InternalServerError: 500, // <https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500>
|
|
16
|
+
GatewayTimeout: 504 // <https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/504>
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
exports.StatusCode = StatusCode;
|
|
20
|
+
//# sourceMappingURL=status.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.cjs","sources":["../../src/utils/status.ts"],"sourcesContent":["/** HTTP status codes used in the parquet server handler */\nexport const StatusCode = {\n Ok: 200, // <https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/200>\n PartialContent: 206, // <https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/206>\n NotModified: 304, // <https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/304>\n BadRequest: 400, // <https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400>\n Unauthorized: 401, // <https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/401>\n NotFound: 404, // <https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/404>\n MethodNotAllowed: 405, // <https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/405>\n Gone: 410, // <https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/410>\n PreconditionFailed: 412, // <https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/412>\n RangeNotSatisfiable: 416, // <https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/416>\n InternalServerError: 500, // <https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500>\n GatewayTimeout: 504 // <https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/504>\n} as const;\n"],"names":[],"mappings":";;AAAA;AACO,MAAM,UAAU,GAAG;IACxB,EAAE,EAAE,GAAG;IACP,cAAc,EAAE,GAAG;IACnB,WAAW,EAAE,GAAG;IAChB,UAAU,EAAE,GAAG;IACf,YAAY,EAAE,GAAG;IACjB,QAAQ,EAAE,GAAG;IACb,gBAAgB,EAAE,GAAG;IACrB,IAAI,EAAE,GAAG;IACT,kBAAkB,EAAE,GAAG;IACvB,mBAAmB,EAAE,GAAG;IACxB,mBAAmB,EAAE,GAAG;IACxB,cAAc,EAAE,GAAG;;;;;"}
|