@eik/core 2.1.46 → 2.1.48
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/CHANGELOG.md +14 -0
- package/lib/classes/http-incoming.js +4 -0
- package/lib/classes/http-outgoing.js +4 -0
- package/lib/classes/package.js +8 -0
- package/lib/classes/versions.js +16 -2
- package/lib/handlers/alias.delete.js +13 -4
- package/lib/handlers/alias.get-v2.js +22 -10
- package/lib/handlers/alias.get.js +10 -1
- package/lib/handlers/alias.post.js +19 -4
- package/lib/handlers/alias.put.js +19 -4
- package/lib/handlers/auth.post.js +7 -1
- package/lib/handlers/map.get.js +20 -10
- package/lib/handlers/map.put.js +38 -13
- package/lib/handlers/pkg.get.js +22 -10
- package/lib/handlers/pkg.log.js +21 -10
- package/lib/handlers/pkg.put.js +26 -4
- package/lib/handlers/versions.get.js +20 -10
- package/lib/multipart/form-file.js +3 -0
- package/lib/multipart/parser.js +65 -37
- package/lib/sinks/mem-entry.js +3 -0
- package/lib/sinks/test.js +40 -10
- package/lib/utils/healthcheck.js +16 -2
- package/lib/utils/utils.js +25 -0
- package/package.json +17 -22
- package/types/classes/alias.d.ts +4 -4
- package/types/classes/asset.d.ts +5 -5
- package/types/classes/author.d.ts +2 -2
- package/types/classes/http-incoming.d.ts +4 -4
- package/types/classes/http-outgoing.d.ts +7 -3
- package/types/classes/meta.d.ts +2 -2
- package/types/classes/package.d.ts +136 -11
- package/types/classes/versions.d.ts +14 -4
- package/types/handlers/alias.delete.d.ts +13 -6
- package/types/handlers/alias.get-v2.d.ts +16 -9
- package/types/handlers/alias.get.d.ts +15 -8
- package/types/handlers/alias.post.d.ts +24 -11
- package/types/handlers/alias.put.d.ts +24 -11
- package/types/handlers/auth.post.d.ts +15 -9
- package/types/handlers/map.get.d.ts +14 -9
- package/types/handlers/map.put.d.ts +32 -13
- package/types/handlers/pkg.get.d.ts +16 -9
- package/types/handlers/pkg.log.d.ts +15 -9
- package/types/handlers/pkg.put.d.ts +35 -15
- package/types/handlers/versions.get.d.ts +14 -9
- package/types/main.d.ts +2 -0
- package/types/multipart/form-field.d.ts +2 -2
- package/types/multipart/parser.d.ts +18 -6
- package/types/sinks/test.d.ts +26 -13
- package/types/utils/healthcheck.d.ts +6 -4
- package/types/utils/path-builders-fs.d.ts +27 -27
- package/types/utils/path-builders-uri.d.ts +16 -16
- package/types/utils/utils.d.ts +26 -3
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export default AliasPut;
|
|
2
2
|
export type AliasPutOptions = {
|
|
3
|
-
cacheControl?: string;
|
|
3
|
+
cacheControl?: string | undefined;
|
|
4
4
|
/**
|
|
5
5
|
* List of key-value pairs [hostname, organization]
|
|
6
6
|
*/
|
|
7
|
-
organizations?:
|
|
8
|
-
sink?: import("@eik/sink").default;
|
|
7
|
+
organizations?: [string, string][] | undefined;
|
|
8
|
+
sink?: import("@eik/sink").default | undefined;
|
|
9
9
|
logger?: import("abslog").AbstractLoggerOptions;
|
|
10
10
|
};
|
|
11
11
|
/**
|
|
@@ -18,17 +18,17 @@ export type AliasPutOptions = {
|
|
|
18
18
|
declare const AliasPut: {
|
|
19
19
|
new ({ organizations, cacheControl, logger, sink }?: AliasPutOptions): {
|
|
20
20
|
_organizations: [string, string][];
|
|
21
|
-
_cacheControl: string;
|
|
22
|
-
_sink: import("@eik/sink").default;
|
|
21
|
+
_cacheControl: string | undefined;
|
|
22
|
+
_sink: import("@eik/sink").default | undefined;
|
|
23
23
|
_log: abslog.ValidLogger;
|
|
24
24
|
_metrics: Metrics;
|
|
25
25
|
_histogram: Metrics.MetricsHistogram;
|
|
26
26
|
_orgRegistry: Map<string, string>;
|
|
27
27
|
_multipart: {
|
|
28
|
-
_pkgMaxFileSize: number;
|
|
28
|
+
_pkgMaxFileSize: number | undefined;
|
|
29
29
|
_legalFields: string[];
|
|
30
30
|
_legalFiles: string[];
|
|
31
|
-
_sink: import("@eik/sink").default;
|
|
31
|
+
_sink: import("@eik/sink").default | undefined;
|
|
32
32
|
_log: abslog.ValidLogger;
|
|
33
33
|
parse(incoming: any): Promise<any>;
|
|
34
34
|
_handleField({ name, value }: {
|
|
@@ -58,14 +58,27 @@ declare const AliasPut: {
|
|
|
58
58
|
get [Symbol.toStringTag](): string;
|
|
59
59
|
};
|
|
60
60
|
get metrics(): Metrics;
|
|
61
|
+
/**
|
|
62
|
+
* @param {any} incoming
|
|
63
|
+
*/
|
|
61
64
|
_parser(incoming: any): Promise<any>;
|
|
65
|
+
/**
|
|
66
|
+
* @param {any} incoming
|
|
67
|
+
*/
|
|
62
68
|
_exist(incoming: any): Promise<boolean>;
|
|
63
|
-
|
|
69
|
+
/**
|
|
70
|
+
* @param {any} req
|
|
71
|
+
* @param {any} user
|
|
72
|
+
* @param {string} type
|
|
73
|
+
* @param {string} name
|
|
74
|
+
* @param {string} alias
|
|
75
|
+
*/
|
|
76
|
+
handler(req: any, user: any, type: string, name: string, alias: string): Promise<{
|
|
64
77
|
_cacheControl: string;
|
|
65
78
|
_statusCode: number;
|
|
66
79
|
_mimeType: string;
|
|
67
80
|
_location: string;
|
|
68
|
-
_stream:
|
|
81
|
+
_stream: import("node:stream").Readable | undefined;
|
|
69
82
|
_body: any;
|
|
70
83
|
_etag: string;
|
|
71
84
|
get cacheControl(): string;
|
|
@@ -76,8 +89,8 @@ declare const AliasPut: {
|
|
|
76
89
|
set location(value: string);
|
|
77
90
|
get mimeType(): string;
|
|
78
91
|
set mimeType(value: string);
|
|
79
|
-
get stream():
|
|
80
|
-
set stream(value:
|
|
92
|
+
get stream(): import("node:stream").Readable | undefined;
|
|
93
|
+
set stream(value: import("node:stream").Readable | undefined);
|
|
81
94
|
get body(): any;
|
|
82
95
|
set body(value: any);
|
|
83
96
|
get etag(): string;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export default AuthPost;
|
|
2
2
|
export type AuthPostOptions = {
|
|
3
|
-
authKey?: string;
|
|
4
|
-
cacheControl?: string;
|
|
3
|
+
authKey?: string | undefined;
|
|
4
|
+
cacheControl?: string | undefined;
|
|
5
5
|
/**
|
|
6
6
|
* List of key-value pairs [hostname, organization]
|
|
7
7
|
*/
|
|
8
|
-
organizations?:
|
|
8
|
+
organizations?: [string, string][] | undefined;
|
|
9
9
|
logger?: import("abslog").AbstractLoggerOptions;
|
|
10
10
|
};
|
|
11
11
|
/**
|
|
@@ -18,17 +18,17 @@ export type AuthPostOptions = {
|
|
|
18
18
|
declare const AuthPost: {
|
|
19
19
|
new ({ organizations, cacheControl, authKey, logger }?: AuthPostOptions): {
|
|
20
20
|
_organizations: [string, string][];
|
|
21
|
-
_cacheControl: string;
|
|
21
|
+
_cacheControl: string | undefined;
|
|
22
22
|
_authKey: string;
|
|
23
23
|
_log: abslog.ValidLogger;
|
|
24
24
|
_metrics: Metrics;
|
|
25
25
|
_histogram: Metrics.MetricsHistogram;
|
|
26
26
|
_orgRegistry: Map<string, string>;
|
|
27
27
|
_multipart: {
|
|
28
|
-
_pkgMaxFileSize: number;
|
|
28
|
+
_pkgMaxFileSize: number | undefined;
|
|
29
29
|
_legalFields: string[];
|
|
30
30
|
_legalFiles: string[];
|
|
31
|
-
_sink: import("@eik/sink").default;
|
|
31
|
+
_sink: import("@eik/sink").default | undefined;
|
|
32
32
|
_log: abslog.ValidLogger;
|
|
33
33
|
parse(incoming: any): Promise<any>;
|
|
34
34
|
_handleField({ name, value }: {
|
|
@@ -58,13 +58,19 @@ declare const AuthPost: {
|
|
|
58
58
|
get [Symbol.toStringTag](): string;
|
|
59
59
|
};
|
|
60
60
|
get metrics(): Metrics;
|
|
61
|
+
/**
|
|
62
|
+
* @param {any} incoming
|
|
63
|
+
*/
|
|
61
64
|
_parser(incoming: any): Promise<any>;
|
|
65
|
+
/**
|
|
66
|
+
* @param {any} req
|
|
67
|
+
*/
|
|
62
68
|
handler(req: any): Promise<{
|
|
63
69
|
_cacheControl: string;
|
|
64
70
|
_statusCode: number;
|
|
65
71
|
_mimeType: string;
|
|
66
72
|
_location: string;
|
|
67
|
-
_stream:
|
|
73
|
+
_stream: import("node:stream").Readable | undefined;
|
|
68
74
|
_body: any;
|
|
69
75
|
_etag: string;
|
|
70
76
|
get cacheControl(): string;
|
|
@@ -75,8 +81,8 @@ declare const AuthPost: {
|
|
|
75
81
|
set location(value: string);
|
|
76
82
|
get mimeType(): string;
|
|
77
83
|
set mimeType(value: string);
|
|
78
|
-
get stream():
|
|
79
|
-
set stream(value:
|
|
84
|
+
get stream(): import("node:stream").Readable | undefined;
|
|
85
|
+
set stream(value: import("node:stream").Readable | undefined);
|
|
80
86
|
get body(): any;
|
|
81
87
|
set body(value: any);
|
|
82
88
|
get etag(): string;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export default MapGet;
|
|
2
2
|
export type MapGetOptions = {
|
|
3
|
-
etag?: boolean;
|
|
4
|
-
cacheControl?: string;
|
|
3
|
+
etag?: boolean | undefined;
|
|
4
|
+
cacheControl?: string | undefined;
|
|
5
5
|
/**
|
|
6
6
|
* List of key-value pairs [hostname, organization]
|
|
7
7
|
*/
|
|
8
|
-
organizations?:
|
|
9
|
-
sink?: import("@eik/sink").default;
|
|
8
|
+
organizations?: [string, string][] | undefined;
|
|
9
|
+
sink?: import("@eik/sink").default | undefined;
|
|
10
10
|
logger?: import("abslog").AbstractLoggerOptions;
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
@@ -21,19 +21,24 @@ declare const MapGet: {
|
|
|
21
21
|
new ({ organizations, cacheControl, logger, sink, etag }?: MapGetOptions): {
|
|
22
22
|
_organizations: [string, string][];
|
|
23
23
|
_cacheControl: string;
|
|
24
|
-
_sink: import("@eik/sink").default;
|
|
24
|
+
_sink: import("@eik/sink").default | undefined;
|
|
25
25
|
_etag: boolean;
|
|
26
26
|
_log: abslog.ValidLogger;
|
|
27
27
|
_metrics: Metrics;
|
|
28
28
|
_histogram: Metrics.MetricsHistogram;
|
|
29
29
|
_orgRegistry: Map<string, string>;
|
|
30
30
|
get metrics(): Metrics;
|
|
31
|
-
|
|
31
|
+
/**
|
|
32
|
+
* @param {any} req
|
|
33
|
+
* @param {string} name
|
|
34
|
+
* @param {string} version
|
|
35
|
+
*/
|
|
36
|
+
handler(req: any, name: string, version: string): Promise<{
|
|
32
37
|
_cacheControl: string;
|
|
33
38
|
_statusCode: number;
|
|
34
39
|
_mimeType: string;
|
|
35
40
|
_location: string;
|
|
36
|
-
_stream:
|
|
41
|
+
_stream: import("node:stream").Readable | undefined;
|
|
37
42
|
_body: any;
|
|
38
43
|
_etag: string;
|
|
39
44
|
get cacheControl(): string;
|
|
@@ -44,8 +49,8 @@ declare const MapGet: {
|
|
|
44
49
|
set location(value: string);
|
|
45
50
|
get mimeType(): string;
|
|
46
51
|
set mimeType(value: string);
|
|
47
|
-
get stream():
|
|
48
|
-
set stream(value:
|
|
52
|
+
get stream(): import("node:stream").Readable | undefined;
|
|
53
|
+
set stream(value: import("node:stream").Readable | undefined);
|
|
49
54
|
get body(): any;
|
|
50
55
|
set body(value: any);
|
|
51
56
|
get etag(): string;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export default MapPut;
|
|
2
2
|
export type MapPutOptions = {
|
|
3
|
-
mapMaxFileSize?: number;
|
|
4
|
-
cacheControl?: string;
|
|
3
|
+
mapMaxFileSize?: number | undefined;
|
|
4
|
+
cacheControl?: string | undefined;
|
|
5
5
|
/**
|
|
6
6
|
* List of key-value pairs [hostname, organization]
|
|
7
7
|
*/
|
|
8
|
-
organizations?:
|
|
9
|
-
sink?: import("@eik/sink").default;
|
|
8
|
+
organizations?: [string, string][] | undefined;
|
|
9
|
+
sink?: import("@eik/sink").default | undefined;
|
|
10
10
|
logger?: import("abslog").AbstractLoggerOptions;
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
@@ -21,19 +21,28 @@ declare const MapPut: {
|
|
|
21
21
|
new ({ mapMaxFileSize, organizations, cacheControl, logger, sink, }?: MapPutOptions): {
|
|
22
22
|
_mapMaxFileSize: number;
|
|
23
23
|
_organizations: [string, string][];
|
|
24
|
-
_cacheControl: string;
|
|
25
|
-
_sink: import("@eik/sink").default;
|
|
24
|
+
_cacheControl: string | undefined;
|
|
25
|
+
_sink: import("@eik/sink").default | undefined;
|
|
26
26
|
_log: abslog.ValidLogger;
|
|
27
27
|
_metrics: Metrics;
|
|
28
28
|
_histogram: Metrics.MetricsHistogram;
|
|
29
29
|
_orgRegistry: Map<string, string>;
|
|
30
30
|
get metrics(): Metrics;
|
|
31
|
+
/**
|
|
32
|
+
* @param {any} incoming
|
|
33
|
+
*/
|
|
31
34
|
_parser(incoming: any): Promise<any>;
|
|
35
|
+
/**
|
|
36
|
+
* @param {{ fieldname: any, file: any, path: any }} options
|
|
37
|
+
*/
|
|
32
38
|
_handleFile({ fieldname, file, path }: {
|
|
33
39
|
fieldname: any;
|
|
34
40
|
file: any;
|
|
35
41
|
path: any;
|
|
36
42
|
}): Promise<string>;
|
|
43
|
+
/**
|
|
44
|
+
* @param {any} incoming
|
|
45
|
+
*/
|
|
37
46
|
_readVersions(incoming: any): Promise<{
|
|
38
47
|
_versions: Map<any, any>;
|
|
39
48
|
_type: string;
|
|
@@ -43,9 +52,9 @@ declare const MapPut: {
|
|
|
43
52
|
get type(): string;
|
|
44
53
|
get name(): string;
|
|
45
54
|
get org(): string;
|
|
46
|
-
setVersion(version:
|
|
47
|
-
getVersion(major:
|
|
48
|
-
check(version:
|
|
55
|
+
setVersion(version: string, integrity: string): void;
|
|
56
|
+
getVersion(major: number): any;
|
|
57
|
+
check(version: string): boolean;
|
|
49
58
|
toJSON(): {
|
|
50
59
|
versions: [any, any][];
|
|
51
60
|
type: string;
|
|
@@ -54,13 +63,23 @@ declare const MapPut: {
|
|
|
54
63
|
};
|
|
55
64
|
get [Symbol.toStringTag](): string;
|
|
56
65
|
}>;
|
|
66
|
+
/**
|
|
67
|
+
* @param {any} incoming
|
|
68
|
+
* @param {any} versions
|
|
69
|
+
*/
|
|
57
70
|
_writeVersions(incoming: any, versions: any): Promise<void>;
|
|
58
|
-
|
|
71
|
+
/**
|
|
72
|
+
* @param {any} req
|
|
73
|
+
* @param {any} user
|
|
74
|
+
* @param {string} name
|
|
75
|
+
* @param {string} version
|
|
76
|
+
*/
|
|
77
|
+
handler(req: any, user: any, name: string, version: string): Promise<{
|
|
59
78
|
_cacheControl: string;
|
|
60
79
|
_statusCode: number;
|
|
61
80
|
_mimeType: string;
|
|
62
81
|
_location: string;
|
|
63
|
-
_stream:
|
|
82
|
+
_stream: import("node:stream").Readable | undefined;
|
|
64
83
|
_body: any;
|
|
65
84
|
_etag: string;
|
|
66
85
|
get cacheControl(): string;
|
|
@@ -71,8 +90,8 @@ declare const MapPut: {
|
|
|
71
90
|
set location(value: string);
|
|
72
91
|
get mimeType(): string;
|
|
73
92
|
set mimeType(value: string);
|
|
74
|
-
get stream():
|
|
75
|
-
set stream(value:
|
|
93
|
+
get stream(): import("node:stream").Readable | undefined;
|
|
94
|
+
set stream(value: import("node:stream").Readable | undefined);
|
|
76
95
|
get body(): any;
|
|
77
96
|
set body(value: any);
|
|
78
97
|
get etag(): string;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export default PkgGet;
|
|
2
2
|
export type PkgGetOptions = {
|
|
3
|
-
etag?: boolean;
|
|
4
|
-
cacheControl?: string;
|
|
3
|
+
etag?: boolean | undefined;
|
|
4
|
+
cacheControl?: string | undefined;
|
|
5
5
|
/**
|
|
6
6
|
* List of key-value pairs [hostname, organization]
|
|
7
7
|
*/
|
|
8
|
-
organizations?:
|
|
9
|
-
sink?: import("@eik/sink").default;
|
|
8
|
+
organizations?: [string, string][] | undefined;
|
|
9
|
+
sink?: import("@eik/sink").default | undefined;
|
|
10
10
|
logger?: import("abslog").AbstractLoggerOptions;
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
@@ -21,19 +21,26 @@ declare const PkgGet: {
|
|
|
21
21
|
new ({ organizations, cacheControl, logger, sink, etag }?: PkgGetOptions): {
|
|
22
22
|
_organizations: [string, string][];
|
|
23
23
|
_cacheControl: string;
|
|
24
|
-
_sink: import("@eik/sink").default;
|
|
24
|
+
_sink: import("@eik/sink").default | undefined;
|
|
25
25
|
_etag: boolean;
|
|
26
26
|
_log: abslog.ValidLogger;
|
|
27
27
|
_metrics: Metrics;
|
|
28
28
|
_histogram: Metrics.MetricsHistogram;
|
|
29
29
|
_orgRegistry: Map<string, string>;
|
|
30
30
|
get metrics(): Metrics;
|
|
31
|
-
|
|
31
|
+
/**
|
|
32
|
+
* @param {any} req
|
|
33
|
+
* @param {string} type
|
|
34
|
+
* @param {string} name
|
|
35
|
+
* @param {string} version
|
|
36
|
+
* @param {string} extra
|
|
37
|
+
*/
|
|
38
|
+
handler(req: any, type: string, name: string, version: string, extra: string): Promise<{
|
|
32
39
|
_cacheControl: string;
|
|
33
40
|
_statusCode: number;
|
|
34
41
|
_mimeType: string;
|
|
35
42
|
_location: string;
|
|
36
|
-
_stream:
|
|
43
|
+
_stream: import("node:stream").Readable | undefined;
|
|
37
44
|
_body: any;
|
|
38
45
|
_etag: string;
|
|
39
46
|
get cacheControl(): string;
|
|
@@ -44,8 +51,8 @@ declare const PkgGet: {
|
|
|
44
51
|
set location(value: string);
|
|
45
52
|
get mimeType(): string;
|
|
46
53
|
set mimeType(value: string);
|
|
47
|
-
get stream():
|
|
48
|
-
set stream(value:
|
|
54
|
+
get stream(): import("node:stream").Readable | undefined;
|
|
55
|
+
set stream(value: import("node:stream").Readable | undefined);
|
|
49
56
|
get body(): any;
|
|
50
57
|
set body(value: any);
|
|
51
58
|
get etag(): string;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export default PkgLog;
|
|
2
2
|
export type PkgLogOptions = {
|
|
3
|
-
etag?: boolean;
|
|
4
|
-
cacheControl?: string;
|
|
3
|
+
etag?: boolean | undefined;
|
|
4
|
+
cacheControl?: string | undefined;
|
|
5
5
|
/**
|
|
6
6
|
* List of key-value pairs [hostname, organization]
|
|
7
7
|
*/
|
|
8
|
-
organizations?:
|
|
9
|
-
sink?: import("@eik/sink").default;
|
|
8
|
+
organizations?: [string, string][] | undefined;
|
|
9
|
+
sink?: import("@eik/sink").default | undefined;
|
|
10
10
|
logger?: import("abslog").AbstractLoggerOptions;
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
@@ -21,19 +21,25 @@ declare const PkgLog: {
|
|
|
21
21
|
new ({ organizations, cacheControl, logger, sink, etag }?: PkgLogOptions): {
|
|
22
22
|
_organizations: [string, string][];
|
|
23
23
|
_cacheControl: string;
|
|
24
|
-
_sink: import("@eik/sink").default;
|
|
24
|
+
_sink: import("@eik/sink").default | undefined;
|
|
25
25
|
_etag: boolean;
|
|
26
26
|
_log: abslog.ValidLogger;
|
|
27
27
|
_metrics: Metrics;
|
|
28
28
|
_histogram: Metrics.MetricsHistogram;
|
|
29
29
|
_orgRegistry: Map<string, string>;
|
|
30
30
|
get metrics(): Metrics;
|
|
31
|
-
|
|
31
|
+
/**
|
|
32
|
+
* @param {any} req
|
|
33
|
+
* @param {string} type
|
|
34
|
+
* @param {string} name
|
|
35
|
+
* @param {string} version
|
|
36
|
+
*/
|
|
37
|
+
handler(req: any, type: string, name: string, version: string): Promise<{
|
|
32
38
|
_cacheControl: string;
|
|
33
39
|
_statusCode: number;
|
|
34
40
|
_mimeType: string;
|
|
35
41
|
_location: string;
|
|
36
|
-
_stream:
|
|
42
|
+
_stream: import("node:stream").Readable | undefined;
|
|
37
43
|
_body: any;
|
|
38
44
|
_etag: string;
|
|
39
45
|
get cacheControl(): string;
|
|
@@ -44,8 +50,8 @@ declare const PkgLog: {
|
|
|
44
50
|
set location(value: string);
|
|
45
51
|
get mimeType(): string;
|
|
46
52
|
set mimeType(value: string);
|
|
47
|
-
get stream():
|
|
48
|
-
set stream(value:
|
|
53
|
+
get stream(): import("node:stream").Readable | undefined;
|
|
54
|
+
set stream(value: import("node:stream").Readable | undefined);
|
|
49
55
|
get body(): any;
|
|
50
56
|
set body(value: any);
|
|
51
57
|
get etag(): string;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export default PkgPut;
|
|
2
2
|
export type PkgPutOptions = {
|
|
3
|
-
pkgMaxFileSize?: number;
|
|
4
|
-
cacheControl?: string;
|
|
3
|
+
pkgMaxFileSize?: number | undefined;
|
|
4
|
+
cacheControl?: string | undefined;
|
|
5
5
|
/**
|
|
6
6
|
* List of key-value pairs [hostname, organization]
|
|
7
7
|
*/
|
|
8
|
-
organizations?:
|
|
9
|
-
sink?: import("@eik/sink").default;
|
|
8
|
+
organizations?: [string, string][] | undefined;
|
|
9
|
+
sink?: import("@eik/sink").default | undefined;
|
|
10
10
|
logger?: import("abslog").AbstractLoggerOptions;
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
@@ -21,17 +21,17 @@ declare const PkgPut: {
|
|
|
21
21
|
new ({ pkgMaxFileSize, organizations, cacheControl, logger, sink, }?: PkgPutOptions): {
|
|
22
22
|
_pkgMaxFileSize: number;
|
|
23
23
|
_organizations: [string, string][];
|
|
24
|
-
_cacheControl: string;
|
|
25
|
-
_sink: import("@eik/sink").default;
|
|
24
|
+
_cacheControl: string | undefined;
|
|
25
|
+
_sink: import("@eik/sink").default | undefined;
|
|
26
26
|
_log: abslog.ValidLogger;
|
|
27
27
|
_metrics: Metrics;
|
|
28
28
|
_histogram: Metrics.MetricsHistogram;
|
|
29
29
|
_orgRegistry: Map<string, string>;
|
|
30
30
|
_multipart: {
|
|
31
|
-
_pkgMaxFileSize: number;
|
|
31
|
+
_pkgMaxFileSize: number | undefined;
|
|
32
32
|
_legalFields: string[];
|
|
33
33
|
_legalFiles: string[];
|
|
34
|
-
_sink: import("@eik/sink").default;
|
|
34
|
+
_sink: import("@eik/sink").default | undefined;
|
|
35
35
|
_log: abslog.ValidLogger;
|
|
36
36
|
parse(incoming: any): Promise<any>;
|
|
37
37
|
_handleField({ name, value }: {
|
|
@@ -61,7 +61,13 @@ declare const PkgPut: {
|
|
|
61
61
|
get [Symbol.toStringTag](): string;
|
|
62
62
|
};
|
|
63
63
|
get metrics(): Metrics;
|
|
64
|
+
/**
|
|
65
|
+
* @param {any} incoming
|
|
66
|
+
*/
|
|
64
67
|
_parser(incoming: any): Promise<any>;
|
|
68
|
+
/**
|
|
69
|
+
* @param {any} incoming
|
|
70
|
+
*/
|
|
65
71
|
_readVersions(incoming: any): Promise<{
|
|
66
72
|
_versions: Map<any, any>;
|
|
67
73
|
_type: string;
|
|
@@ -71,9 +77,9 @@ declare const PkgPut: {
|
|
|
71
77
|
get type(): string;
|
|
72
78
|
get name(): string;
|
|
73
79
|
get org(): string;
|
|
74
|
-
setVersion(version:
|
|
75
|
-
getVersion(major:
|
|
76
|
-
check(version:
|
|
80
|
+
setVersion(version: string, integrity: string): void;
|
|
81
|
+
getVersion(major: number): any;
|
|
82
|
+
check(version: string): boolean;
|
|
77
83
|
toJSON(): {
|
|
78
84
|
versions: [any, any][];
|
|
79
85
|
type: string;
|
|
@@ -82,14 +88,28 @@ declare const PkgPut: {
|
|
|
82
88
|
};
|
|
83
89
|
get [Symbol.toStringTag](): string;
|
|
84
90
|
}>;
|
|
91
|
+
/**
|
|
92
|
+
* @param {any} incoming
|
|
93
|
+
*/
|
|
85
94
|
_readVersion(incoming: any): Promise<boolean>;
|
|
95
|
+
/**
|
|
96
|
+
* @param {any} incoming
|
|
97
|
+
* @param {any} versions
|
|
98
|
+
*/
|
|
86
99
|
_writeVersions(incoming: any, versions: any): Promise<void>;
|
|
87
|
-
|
|
100
|
+
/**
|
|
101
|
+
* @param {any} req
|
|
102
|
+
* @param {any} user
|
|
103
|
+
* @param {string} type
|
|
104
|
+
* @param {string} name
|
|
105
|
+
* @param {string} version
|
|
106
|
+
*/
|
|
107
|
+
handler(req: any, user: any, type: string, name: string, version: string): Promise<{
|
|
88
108
|
_cacheControl: string;
|
|
89
109
|
_statusCode: number;
|
|
90
110
|
_mimeType: string;
|
|
91
111
|
_location: string;
|
|
92
|
-
_stream:
|
|
112
|
+
_stream: import("node:stream").Readable | undefined;
|
|
93
113
|
_body: any;
|
|
94
114
|
_etag: string;
|
|
95
115
|
get cacheControl(): string;
|
|
@@ -100,8 +120,8 @@ declare const PkgPut: {
|
|
|
100
120
|
set location(value: string);
|
|
101
121
|
get mimeType(): string;
|
|
102
122
|
set mimeType(value: string);
|
|
103
|
-
get stream():
|
|
104
|
-
set stream(value:
|
|
123
|
+
get stream(): import("node:stream").Readable | undefined;
|
|
124
|
+
set stream(value: import("node:stream").Readable | undefined);
|
|
105
125
|
get body(): any;
|
|
106
126
|
set body(value: any);
|
|
107
127
|
get etag(): string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export default VersionsGet;
|
|
2
2
|
export type VersionsGetOptions = {
|
|
3
|
-
cacheControl?: string;
|
|
4
|
-
etag?: boolean;
|
|
5
|
-
organizations?:
|
|
6
|
-
sink?: import("@eik/sink").default;
|
|
3
|
+
cacheControl?: string | undefined;
|
|
4
|
+
etag?: boolean | undefined;
|
|
5
|
+
organizations?: [string, string][] | undefined;
|
|
6
|
+
sink?: import("@eik/sink").default | undefined;
|
|
7
7
|
logger?: import("abslog").AbstractLoggerOptions;
|
|
8
8
|
};
|
|
9
9
|
/**
|
|
@@ -18,19 +18,24 @@ declare const VersionsGet: {
|
|
|
18
18
|
new ({ organizations, cacheControl, logger, sink, etag }?: VersionsGetOptions): {
|
|
19
19
|
_organizations: [string, string][];
|
|
20
20
|
_cacheControl: string;
|
|
21
|
-
_sink: import("@eik/sink").default;
|
|
21
|
+
_sink: import("@eik/sink").default | undefined;
|
|
22
22
|
_etag: boolean;
|
|
23
23
|
_log: abslog.ValidLogger;
|
|
24
24
|
_metrics: Metrics;
|
|
25
25
|
_histogram: Metrics.MetricsHistogram;
|
|
26
26
|
_orgRegistry: Map<string, string>;
|
|
27
27
|
get metrics(): Metrics;
|
|
28
|
-
|
|
28
|
+
/**
|
|
29
|
+
* @param {any} req
|
|
30
|
+
* @param {string} type
|
|
31
|
+
* @param {string} name
|
|
32
|
+
*/
|
|
33
|
+
handler(req: any, type: string, name: string): Promise<{
|
|
29
34
|
_cacheControl: string;
|
|
30
35
|
_statusCode: number;
|
|
31
36
|
_mimeType: string;
|
|
32
37
|
_location: string;
|
|
33
|
-
_stream:
|
|
38
|
+
_stream: import("node:stream").Readable | undefined;
|
|
34
39
|
_body: any;
|
|
35
40
|
_etag: string;
|
|
36
41
|
get cacheControl(): string;
|
|
@@ -41,8 +46,8 @@ declare const VersionsGet: {
|
|
|
41
46
|
set location(value: string);
|
|
42
47
|
get mimeType(): string;
|
|
43
48
|
set mimeType(value: string);
|
|
44
|
-
get stream():
|
|
45
|
-
set stream(value:
|
|
49
|
+
get stream(): import("node:stream").Readable | undefined;
|
|
50
|
+
set stream(value: import("node:stream").Readable | undefined);
|
|
46
51
|
get body(): any;
|
|
47
52
|
set body(value: any);
|
|
48
53
|
get etag(): string;
|
package/types/main.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export default MultipartParser;
|
|
2
2
|
export type MultipartParserOptions = {
|
|
3
|
-
pkgMaxFileSize?: number;
|
|
4
|
-
legalFields?: string[];
|
|
5
|
-
legalFiles?: string[];
|
|
6
|
-
sink?: import("@eik/sink").default;
|
|
3
|
+
pkgMaxFileSize?: number | undefined;
|
|
4
|
+
legalFields?: string[] | undefined;
|
|
5
|
+
legalFiles?: string[] | undefined;
|
|
6
|
+
sink?: import("@eik/sink").default | undefined;
|
|
7
7
|
logger?: import("abslog").AbstractLoggerOptions;
|
|
8
8
|
};
|
|
9
9
|
/**
|
|
@@ -16,12 +16,18 @@ export type MultipartParserOptions = {
|
|
|
16
16
|
*/
|
|
17
17
|
declare const MultipartParser: {
|
|
18
18
|
new ({ pkgMaxFileSize, legalFields, legalFiles, logger, sink }?: MultipartParserOptions): {
|
|
19
|
-
_pkgMaxFileSize: number;
|
|
19
|
+
_pkgMaxFileSize: number | undefined;
|
|
20
20
|
_legalFields: string[];
|
|
21
21
|
_legalFiles: string[];
|
|
22
|
-
_sink: import("@eik/sink").default;
|
|
22
|
+
_sink: import("@eik/sink").default | undefined;
|
|
23
23
|
_log: abslog.ValidLogger;
|
|
24
|
+
/**
|
|
25
|
+
* @param {any} incoming
|
|
26
|
+
*/
|
|
24
27
|
parse(incoming: any): Promise<any>;
|
|
28
|
+
/**
|
|
29
|
+
* @param {{ name: any, value: any }} options
|
|
30
|
+
*/
|
|
25
31
|
_handleField({ name, value }: {
|
|
26
32
|
name: any;
|
|
27
33
|
value: any;
|
|
@@ -36,12 +42,18 @@ declare const MultipartParser: {
|
|
|
36
42
|
};
|
|
37
43
|
get [Symbol.toStringTag](): string;
|
|
38
44
|
};
|
|
45
|
+
/**
|
|
46
|
+
* @param {{ fieldname: any, file: any, filename: any, incoming: any }} options
|
|
47
|
+
*/
|
|
39
48
|
_handleFile({ fieldname, file, filename, incoming }: {
|
|
40
49
|
fieldname: any;
|
|
41
50
|
file: any;
|
|
42
51
|
filename: any;
|
|
43
52
|
incoming: any;
|
|
44
53
|
}): Promise<any>;
|
|
54
|
+
/**
|
|
55
|
+
* @param {{ incoming: any, entry: any }} options
|
|
56
|
+
*/
|
|
45
57
|
_persistFile({ incoming, entry }: {
|
|
46
58
|
incoming: any;
|
|
47
59
|
entry: any;
|