@eik/core 1.3.53 → 1.3.55
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 +7 -0
- package/lib/classes/alias.js +48 -48
- package/lib/classes/asset.js +99 -92
- package/lib/classes/author.js +20 -20
- package/lib/classes/http-incoming.js +52 -52
- package/lib/classes/http-outgoing.js +84 -83
- package/lib/classes/meta.js +20 -23
- package/lib/classes/package.js +73 -70
- package/lib/classes/versions.js +62 -60
- package/lib/handlers/alias.delete.js +125 -120
- package/lib/handlers/alias.get.js +92 -87
- package/lib/handlers/alias.post.js +196 -203
- package/lib/handlers/alias.put.js +196 -202
- package/lib/handlers/auth.post.js +95 -93
- package/lib/handlers/map.get.js +110 -111
- package/lib/handlers/map.put.js +256 -231
- package/lib/handlers/pkg.get.js +120 -122
- package/lib/handlers/pkg.log.js +112 -110
- package/lib/handlers/pkg.put.js +223 -213
- package/lib/handlers/versions.get.js +92 -101
- package/lib/main.js +47 -47
- package/lib/multipart/form-field.js +20 -23
- package/lib/multipart/form-file.js +22 -24
- package/lib/multipart/parser.js +231 -217
- package/lib/sinks/mem-entry.js +26 -31
- package/lib/sinks/test.js +287 -273
- package/lib/utils/defaults.js +11 -11
- package/lib/utils/globals.js +5 -5
- package/lib/utils/healthcheck.js +131 -108
- package/lib/utils/path-builders-fs.js +61 -29
- package/lib/utils/path-builders-uri.js +26 -18
- package/lib/utils/utils.js +76 -79
- package/package.json +22 -17
- package/types/classes/alias.d.ts +28 -0
- package/types/classes/asset.d.ts +48 -0
- package/types/classes/author.d.ts +17 -0
- package/types/classes/http-incoming.d.ts +37 -0
- package/types/classes/http-outgoing.d.ts +20 -0
- package/types/classes/meta.d.ts +17 -0
- package/types/classes/package.d.ts +40 -0
- package/types/classes/versions.d.ts +28 -0
- package/types/handlers/alias.delete.d.ts +33 -0
- package/types/handlers/alias.get.d.ts +48 -0
- package/types/handlers/alias.post.d.ts +83 -0
- package/types/handlers/alias.put.d.ts +83 -0
- package/types/handlers/auth.post.d.ts +82 -0
- package/types/handlers/map.get.d.ts +51 -0
- package/types/handlers/map.put.d.ts +78 -0
- package/types/handlers/pkg.get.d.ts +51 -0
- package/types/handlers/pkg.log.d.ts +51 -0
- package/types/handlers/pkg.put.d.ts +107 -0
- package/types/handlers/versions.get.d.ts +48 -0
- package/types/main.d.ts +44 -0
- package/types/multipart/form-field.d.ts +17 -0
- package/types/multipart/form-file.d.ts +17 -0
- package/types/multipart/parser.d.ts +52 -0
- package/types/sinks/mem-entry.d.ts +15 -0
- package/types/sinks/test.d.ts +32 -0
- package/types/utils/defaults.d.ts +9 -0
- package/types/utils/globals.d.ts +8 -0
- package/types/utils/healthcheck.d.ts +24 -0
- package/types/utils/path-builders-fs.d.ts +41 -0
- package/types/utils/path-builders-uri.d.ts +26 -0
- package/types/utils/utils.d.ts +6 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export default MapPut;
|
|
2
|
+
export type MapPutOptions = {
|
|
3
|
+
mapMaxFileSize?: number;
|
|
4
|
+
cacheControl?: string;
|
|
5
|
+
/**
|
|
6
|
+
* List of key-value pairs [hostname, organization]
|
|
7
|
+
*/
|
|
8
|
+
organizations?: Array<[string, string]>;
|
|
9
|
+
sink?: import("@eik/sink").default;
|
|
10
|
+
logger?: import("abslog").AbstractLoggerOptions;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* @typedef {object} MapPutOptions
|
|
14
|
+
* @property {number} [mapMaxFileSize]
|
|
15
|
+
* @property {string} [cacheControl]
|
|
16
|
+
* @property {Array<[string, string]>} [organizations] List of key-value pairs [hostname, organization]
|
|
17
|
+
* @property {import("@eik/sink").default} [sink]
|
|
18
|
+
* @property {import("abslog").AbstractLoggerOptions} [logger]
|
|
19
|
+
*/
|
|
20
|
+
declare const MapPut: {
|
|
21
|
+
new ({ mapMaxFileSize, organizations, cacheControl, logger, sink, }?: MapPutOptions): {
|
|
22
|
+
_mapMaxFileSize: number;
|
|
23
|
+
_organizations: [string, string][];
|
|
24
|
+
_cacheControl: string;
|
|
25
|
+
_sink: import("@eik/sink").default;
|
|
26
|
+
_log: abslog.ValidLogger;
|
|
27
|
+
_metrics: Metrics;
|
|
28
|
+
_histogram: Metrics.MetricsHistogram;
|
|
29
|
+
_orgRegistry: Map<string, string>;
|
|
30
|
+
readonly metrics: Metrics;
|
|
31
|
+
_parser(incoming: any): Promise<any>;
|
|
32
|
+
_handleFile({ fieldname, file, path }: {
|
|
33
|
+
fieldname: any;
|
|
34
|
+
file: any;
|
|
35
|
+
path: any;
|
|
36
|
+
}): Promise<string>;
|
|
37
|
+
_readVersions(incoming: any): Promise<{
|
|
38
|
+
_versions: Map<any, any>;
|
|
39
|
+
_type: string;
|
|
40
|
+
_name: string;
|
|
41
|
+
_org: string;
|
|
42
|
+
readonly versions: [any, any][];
|
|
43
|
+
readonly type: string;
|
|
44
|
+
readonly name: string;
|
|
45
|
+
readonly org: string;
|
|
46
|
+
setVersion(version: any, integrity: any): void;
|
|
47
|
+
getVersion(major: any): any;
|
|
48
|
+
check(version: any): boolean;
|
|
49
|
+
toJSON(): {
|
|
50
|
+
versions: [any, any][];
|
|
51
|
+
type: string;
|
|
52
|
+
name: string;
|
|
53
|
+
org: string;
|
|
54
|
+
};
|
|
55
|
+
readonly [Symbol.toStringTag]: string;
|
|
56
|
+
}>;
|
|
57
|
+
_writeVersions(incoming: any, versions: any): Promise<void>;
|
|
58
|
+
handler(req: any, user: any, name: any, version: any): Promise<{
|
|
59
|
+
_cacheControl: string;
|
|
60
|
+
_statusCode: number;
|
|
61
|
+
_mimeType: string;
|
|
62
|
+
_location: string;
|
|
63
|
+
_stream: any;
|
|
64
|
+
_body: any;
|
|
65
|
+
_etag: string;
|
|
66
|
+
cacheControl: string;
|
|
67
|
+
statusCode: number;
|
|
68
|
+
location: string;
|
|
69
|
+
mimeType: string;
|
|
70
|
+
stream: any;
|
|
71
|
+
body: any;
|
|
72
|
+
etag: string;
|
|
73
|
+
readonly [Symbol.toStringTag]: string;
|
|
74
|
+
}>;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
import abslog from "abslog";
|
|
78
|
+
import Metrics from "@metrics/client";
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export default PkgGet;
|
|
2
|
+
export type PkgGetOptions = {
|
|
3
|
+
etag?: boolean;
|
|
4
|
+
cacheControl?: string;
|
|
5
|
+
/**
|
|
6
|
+
* List of key-value pairs [hostname, organization]
|
|
7
|
+
*/
|
|
8
|
+
organizations?: Array<[string, string]>;
|
|
9
|
+
sink?: import("@eik/sink").default;
|
|
10
|
+
logger?: import("abslog").AbstractLoggerOptions;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* @typedef {object} PkgGetOptions
|
|
14
|
+
* @property {boolean} [etag]
|
|
15
|
+
* @property {string} [cacheControl]
|
|
16
|
+
* @property {Array<[string, string]>} [organizations] List of key-value pairs [hostname, organization]
|
|
17
|
+
* @property {import("@eik/sink").default} [sink]
|
|
18
|
+
* @property {import("abslog").AbstractLoggerOptions} [logger]
|
|
19
|
+
*/
|
|
20
|
+
declare const PkgGet: {
|
|
21
|
+
new ({ organizations, cacheControl, logger, sink, etag }?: PkgGetOptions): {
|
|
22
|
+
_organizations: [string, string][];
|
|
23
|
+
_cacheControl: string;
|
|
24
|
+
_sink: import("@eik/sink").default;
|
|
25
|
+
_etag: boolean;
|
|
26
|
+
_log: abslog.ValidLogger;
|
|
27
|
+
_metrics: Metrics;
|
|
28
|
+
_histogram: Metrics.MetricsHistogram;
|
|
29
|
+
_orgRegistry: Map<string, string>;
|
|
30
|
+
readonly metrics: Metrics;
|
|
31
|
+
handler(req: any, type: any, name: any, version: any, extra: any): Promise<{
|
|
32
|
+
_cacheControl: string;
|
|
33
|
+
_statusCode: number;
|
|
34
|
+
_mimeType: string;
|
|
35
|
+
_location: string;
|
|
36
|
+
_stream: any;
|
|
37
|
+
_body: any;
|
|
38
|
+
_etag: string;
|
|
39
|
+
cacheControl: string;
|
|
40
|
+
statusCode: number;
|
|
41
|
+
location: string;
|
|
42
|
+
mimeType: string;
|
|
43
|
+
stream: any;
|
|
44
|
+
body: any;
|
|
45
|
+
etag: string;
|
|
46
|
+
readonly [Symbol.toStringTag]: string;
|
|
47
|
+
}>;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
import abslog from "abslog";
|
|
51
|
+
import Metrics from "@metrics/client";
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export default PkgLog;
|
|
2
|
+
export type PkgLogOptions = {
|
|
3
|
+
etag?: boolean;
|
|
4
|
+
cacheControl?: string;
|
|
5
|
+
/**
|
|
6
|
+
* List of key-value pairs [hostname, organization]
|
|
7
|
+
*/
|
|
8
|
+
organizations?: Array<[string, string]>;
|
|
9
|
+
sink?: import("@eik/sink").default;
|
|
10
|
+
logger?: import("abslog").AbstractLoggerOptions;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* @typedef {object} PkgLogOptions
|
|
14
|
+
* @property {boolean} [etag]
|
|
15
|
+
* @property {string} [cacheControl]
|
|
16
|
+
* @property {Array<[string, string]>} [organizations] List of key-value pairs [hostname, organization]
|
|
17
|
+
* @property {import("@eik/sink").default} [sink]
|
|
18
|
+
* @property {import("abslog").AbstractLoggerOptions} [logger]
|
|
19
|
+
*/
|
|
20
|
+
declare const PkgLog: {
|
|
21
|
+
new ({ organizations, cacheControl, logger, sink, etag }?: PkgLogOptions): {
|
|
22
|
+
_organizations: [string, string][];
|
|
23
|
+
_cacheControl: string;
|
|
24
|
+
_sink: import("@eik/sink").default;
|
|
25
|
+
_etag: boolean;
|
|
26
|
+
_log: abslog.ValidLogger;
|
|
27
|
+
_metrics: Metrics;
|
|
28
|
+
_histogram: Metrics.MetricsHistogram;
|
|
29
|
+
_orgRegistry: Map<string, string>;
|
|
30
|
+
readonly metrics: Metrics;
|
|
31
|
+
handler(req: any, type: any, name: any, version: any): Promise<{
|
|
32
|
+
_cacheControl: string;
|
|
33
|
+
_statusCode: number;
|
|
34
|
+
_mimeType: string;
|
|
35
|
+
_location: string;
|
|
36
|
+
_stream: any;
|
|
37
|
+
_body: any;
|
|
38
|
+
_etag: string;
|
|
39
|
+
cacheControl: string;
|
|
40
|
+
statusCode: number;
|
|
41
|
+
location: string;
|
|
42
|
+
mimeType: string;
|
|
43
|
+
stream: any;
|
|
44
|
+
body: any;
|
|
45
|
+
etag: string;
|
|
46
|
+
readonly [Symbol.toStringTag]: string;
|
|
47
|
+
}>;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
import abslog from "abslog";
|
|
51
|
+
import Metrics from "@metrics/client";
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
export default PkgPut;
|
|
2
|
+
export type PkgPutOptions = {
|
|
3
|
+
pkgMaxFileSize?: number;
|
|
4
|
+
cacheControl?: string;
|
|
5
|
+
/**
|
|
6
|
+
* List of key-value pairs [hostname, organization]
|
|
7
|
+
*/
|
|
8
|
+
organizations?: Array<[string, string]>;
|
|
9
|
+
sink?: import("@eik/sink").default;
|
|
10
|
+
logger?: import("abslog").AbstractLoggerOptions;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* @typedef {object} PkgPutOptions
|
|
14
|
+
* @property {number} [pkgMaxFileSize=10000000]
|
|
15
|
+
* @property {string} [cacheControl]
|
|
16
|
+
* @property {Array<[string, string]>} [organizations] List of key-value pairs [hostname, organization]
|
|
17
|
+
* @property {import("@eik/sink").default} [sink]
|
|
18
|
+
* @property {import("abslog").AbstractLoggerOptions} [logger]
|
|
19
|
+
*/
|
|
20
|
+
declare const PkgPut: {
|
|
21
|
+
new ({ pkgMaxFileSize, organizations, cacheControl, logger, sink, }?: PkgPutOptions): {
|
|
22
|
+
_pkgMaxFileSize: number;
|
|
23
|
+
_organizations: [string, string][];
|
|
24
|
+
_cacheControl: string;
|
|
25
|
+
_sink: import("@eik/sink").default;
|
|
26
|
+
_log: abslog.ValidLogger;
|
|
27
|
+
_metrics: Metrics;
|
|
28
|
+
_histogram: Metrics.MetricsHistogram;
|
|
29
|
+
_orgRegistry: Map<string, string>;
|
|
30
|
+
_multipart: {
|
|
31
|
+
_pkgMaxFileSize: number;
|
|
32
|
+
_legalFields: string[];
|
|
33
|
+
_legalFiles: string[];
|
|
34
|
+
_sink: import("@eik/sink").default;
|
|
35
|
+
_log: abslog.ValidLogger;
|
|
36
|
+
parse(incoming: any): Promise<any>;
|
|
37
|
+
_handleField({ name, value }: {
|
|
38
|
+
name: any;
|
|
39
|
+
value: any;
|
|
40
|
+
}): {
|
|
41
|
+
_value: string;
|
|
42
|
+
_name: string;
|
|
43
|
+
readonly value: string;
|
|
44
|
+
readonly name: string;
|
|
45
|
+
toJSON(): {
|
|
46
|
+
value: string;
|
|
47
|
+
name: string;
|
|
48
|
+
};
|
|
49
|
+
readonly [Symbol.toStringTag]: string;
|
|
50
|
+
};
|
|
51
|
+
_handleFile({ fieldname, file, filename, incoming }: {
|
|
52
|
+
fieldname: any;
|
|
53
|
+
file: any;
|
|
54
|
+
filename: any;
|
|
55
|
+
incoming: any;
|
|
56
|
+
}): Promise<any>;
|
|
57
|
+
_persistFile({ incoming, entry }: {
|
|
58
|
+
incoming: any;
|
|
59
|
+
entry: any;
|
|
60
|
+
}): Promise<any>;
|
|
61
|
+
readonly [Symbol.toStringTag]: string;
|
|
62
|
+
};
|
|
63
|
+
readonly metrics: Metrics;
|
|
64
|
+
_parser(incoming: any): Promise<any>;
|
|
65
|
+
_readVersions(incoming: any): Promise<{
|
|
66
|
+
_versions: Map<any, any>;
|
|
67
|
+
_type: string;
|
|
68
|
+
_name: string;
|
|
69
|
+
_org: string;
|
|
70
|
+
readonly versions: [any, any][];
|
|
71
|
+
readonly type: string;
|
|
72
|
+
readonly name: string;
|
|
73
|
+
readonly org: string;
|
|
74
|
+
setVersion(version: any, integrity: any): void;
|
|
75
|
+
getVersion(major: any): any;
|
|
76
|
+
check(version: any): boolean;
|
|
77
|
+
toJSON(): {
|
|
78
|
+
versions: [any, any][];
|
|
79
|
+
type: string;
|
|
80
|
+
name: string;
|
|
81
|
+
org: string;
|
|
82
|
+
};
|
|
83
|
+
readonly [Symbol.toStringTag]: string;
|
|
84
|
+
}>;
|
|
85
|
+
_readVersion(incoming: any): Promise<boolean>;
|
|
86
|
+
_writeVersions(incoming: any, versions: any): Promise<void>;
|
|
87
|
+
handler(req: any, user: any, type: any, name: any, version: any): Promise<{
|
|
88
|
+
_cacheControl: string;
|
|
89
|
+
_statusCode: number;
|
|
90
|
+
_mimeType: string;
|
|
91
|
+
_location: string;
|
|
92
|
+
_stream: any;
|
|
93
|
+
_body: any;
|
|
94
|
+
_etag: string;
|
|
95
|
+
cacheControl: string;
|
|
96
|
+
statusCode: number;
|
|
97
|
+
location: string;
|
|
98
|
+
mimeType: string;
|
|
99
|
+
stream: any;
|
|
100
|
+
body: any;
|
|
101
|
+
etag: string;
|
|
102
|
+
readonly [Symbol.toStringTag]: string;
|
|
103
|
+
}>;
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
import abslog from "abslog";
|
|
107
|
+
import Metrics from "@metrics/client";
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export default VersionsGet;
|
|
2
|
+
export type VersionsGetOptions = {
|
|
3
|
+
cacheControl?: string;
|
|
4
|
+
etag?: boolean;
|
|
5
|
+
organizations?: Array<[string, string]>;
|
|
6
|
+
sink?: import("@eik/sink").default;
|
|
7
|
+
logger?: import("abslog").AbstractLoggerOptions;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* @typedef {object} VersionsGetOptions
|
|
11
|
+
* @property {string} [cacheControl="no-cache"]
|
|
12
|
+
* @property {boolean} [etag=true]
|
|
13
|
+
* @property {Array<[string, string]>} [organizations]
|
|
14
|
+
* @property {import("@eik/sink").default} [sink]
|
|
15
|
+
* @property {import("abslog").AbstractLoggerOptions} [logger]
|
|
16
|
+
*/
|
|
17
|
+
declare const VersionsGet: {
|
|
18
|
+
new ({ organizations, cacheControl, logger, sink, etag }?: VersionsGetOptions): {
|
|
19
|
+
_organizations: [string, string][];
|
|
20
|
+
_cacheControl: string;
|
|
21
|
+
_sink: import("@eik/sink").default;
|
|
22
|
+
_etag: boolean;
|
|
23
|
+
_log: abslog.ValidLogger;
|
|
24
|
+
_metrics: Metrics;
|
|
25
|
+
_histogram: Metrics.MetricsHistogram;
|
|
26
|
+
_orgRegistry: Map<string, string>;
|
|
27
|
+
readonly metrics: Metrics;
|
|
28
|
+
handler(req: any, type: any, name: any): Promise<{
|
|
29
|
+
_cacheControl: string;
|
|
30
|
+
_statusCode: number;
|
|
31
|
+
_mimeType: string;
|
|
32
|
+
_location: string;
|
|
33
|
+
_stream: any;
|
|
34
|
+
_body: any;
|
|
35
|
+
_etag: string;
|
|
36
|
+
cacheControl: string;
|
|
37
|
+
statusCode: number;
|
|
38
|
+
location: string;
|
|
39
|
+
mimeType: string;
|
|
40
|
+
stream: any;
|
|
41
|
+
body: any;
|
|
42
|
+
etag: string;
|
|
43
|
+
readonly [Symbol.toStringTag]: string;
|
|
44
|
+
}>;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
import abslog from "abslog";
|
|
48
|
+
import Metrics from "@metrics/client";
|
package/types/main.d.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export { HealthCheck };
|
|
3
|
+
export { http };
|
|
4
|
+
export { sink };
|
|
5
|
+
export { prop };
|
|
6
|
+
}
|
|
7
|
+
export default _default;
|
|
8
|
+
import HealthCheck from "./utils/healthcheck.js";
|
|
9
|
+
declare namespace http {
|
|
10
|
+
export { VersionsGet };
|
|
11
|
+
export { AliasPost };
|
|
12
|
+
export { AliasPut };
|
|
13
|
+
export { AliasGet };
|
|
14
|
+
export { AliasDel };
|
|
15
|
+
export { AuthPost };
|
|
16
|
+
export { PkgLog };
|
|
17
|
+
export { PkgGet };
|
|
18
|
+
export { PkgPut };
|
|
19
|
+
export { MapGet };
|
|
20
|
+
export { MapPut };
|
|
21
|
+
}
|
|
22
|
+
declare namespace sink {
|
|
23
|
+
export { TEST };
|
|
24
|
+
export { MEM };
|
|
25
|
+
export { FS };
|
|
26
|
+
}
|
|
27
|
+
declare namespace prop {
|
|
28
|
+
let base_auth: string;
|
|
29
|
+
let base_map: string;
|
|
30
|
+
let base_pkg: string;
|
|
31
|
+
let base_npm: string;
|
|
32
|
+
}
|
|
33
|
+
import VersionsGet from "./handlers/versions.get.js";
|
|
34
|
+
import AliasPost from "./handlers/alias.post.js";
|
|
35
|
+
import AliasPut from "./handlers/alias.put.js";
|
|
36
|
+
import AliasGet from "./handlers/alias.get.js";
|
|
37
|
+
import AliasDel from "./handlers/alias.delete.js";
|
|
38
|
+
import AuthPost from "./handlers/auth.post.js";
|
|
39
|
+
import PkgLog from "./handlers/pkg.log.js";
|
|
40
|
+
import PkgGet from "./handlers/pkg.get.js";
|
|
41
|
+
import PkgPut from "./handlers/pkg.put.js";
|
|
42
|
+
import MapGet from "./handlers/map.get.js";
|
|
43
|
+
import MapPut from "./handlers/map.put.js";
|
|
44
|
+
import TEST from "./sinks/test.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export default FormField;
|
|
2
|
+
declare const FormField: {
|
|
3
|
+
new ({ value, name }?: {
|
|
4
|
+
value?: string;
|
|
5
|
+
name?: string;
|
|
6
|
+
}): {
|
|
7
|
+
_value: string;
|
|
8
|
+
_name: string;
|
|
9
|
+
readonly value: string;
|
|
10
|
+
readonly name: string;
|
|
11
|
+
toJSON(): {
|
|
12
|
+
value: string;
|
|
13
|
+
name: string;
|
|
14
|
+
};
|
|
15
|
+
readonly [Symbol.toStringTag]: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export default FormFile;
|
|
2
|
+
declare const FormFile: {
|
|
3
|
+
new ({ value, name }?: {
|
|
4
|
+
value?: any[];
|
|
5
|
+
name?: string;
|
|
6
|
+
}): {
|
|
7
|
+
_value: any[];
|
|
8
|
+
_name: string;
|
|
9
|
+
readonly value: any[];
|
|
10
|
+
readonly name: string;
|
|
11
|
+
toJSON(): {
|
|
12
|
+
value: any[];
|
|
13
|
+
name: string;
|
|
14
|
+
};
|
|
15
|
+
readonly [Symbol.toStringTag]: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export default MultipartParser;
|
|
2
|
+
export type MultipartParserOptions = {
|
|
3
|
+
pkgMaxFileSize?: number;
|
|
4
|
+
legalFields?: string[];
|
|
5
|
+
legalFiles?: string[];
|
|
6
|
+
sink?: import("@eik/sink").default;
|
|
7
|
+
logger?: import("abslog").AbstractLoggerOptions;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* @typedef {object} MultipartParserOptions
|
|
11
|
+
* @property {number} [pkgMaxFileSize=10000000]
|
|
12
|
+
* @property {string[]} [legalFields]
|
|
13
|
+
* @property {string[]} [legalFiles]
|
|
14
|
+
* @property {import("@eik/sink").default} [sink]
|
|
15
|
+
* @property {import("abslog").AbstractLoggerOptions} [logger]
|
|
16
|
+
*/
|
|
17
|
+
declare const MultipartParser: {
|
|
18
|
+
new ({ pkgMaxFileSize, legalFields, legalFiles, logger, sink }?: MultipartParserOptions): {
|
|
19
|
+
_pkgMaxFileSize: number;
|
|
20
|
+
_legalFields: string[];
|
|
21
|
+
_legalFiles: string[];
|
|
22
|
+
_sink: import("@eik/sink").default;
|
|
23
|
+
_log: abslog.ValidLogger;
|
|
24
|
+
parse(incoming: any): Promise<any>;
|
|
25
|
+
_handleField({ name, value }: {
|
|
26
|
+
name: any;
|
|
27
|
+
value: any;
|
|
28
|
+
}): {
|
|
29
|
+
_value: string;
|
|
30
|
+
_name: string;
|
|
31
|
+
readonly value: string;
|
|
32
|
+
readonly name: string;
|
|
33
|
+
toJSON(): {
|
|
34
|
+
value: string;
|
|
35
|
+
name: string;
|
|
36
|
+
};
|
|
37
|
+
readonly [Symbol.toStringTag]: string;
|
|
38
|
+
};
|
|
39
|
+
_handleFile({ fieldname, file, filename, incoming }: {
|
|
40
|
+
fieldname: any;
|
|
41
|
+
file: any;
|
|
42
|
+
filename: any;
|
|
43
|
+
incoming: any;
|
|
44
|
+
}): Promise<any>;
|
|
45
|
+
_persistFile({ incoming, entry }: {
|
|
46
|
+
incoming: any;
|
|
47
|
+
entry: any;
|
|
48
|
+
}): Promise<any>;
|
|
49
|
+
readonly [Symbol.toStringTag]: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
import abslog from "abslog";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export default Entry;
|
|
2
|
+
declare const Entry: {
|
|
3
|
+
new ({ mimeType, payload }?: {
|
|
4
|
+
mimeType?: string;
|
|
5
|
+
payload?: any[];
|
|
6
|
+
}): {
|
|
7
|
+
_mimeType: string;
|
|
8
|
+
_payload: any[];
|
|
9
|
+
_hash: string;
|
|
10
|
+
readonly mimeType: string;
|
|
11
|
+
readonly payload: any[];
|
|
12
|
+
readonly hash: string;
|
|
13
|
+
readonly [Symbol.toStringTag]: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated Use eik/sink-memory or implement your own. This class will be removed in a future version of core.
|
|
3
|
+
*/
|
|
4
|
+
export default class SinkTest extends Sink {
|
|
5
|
+
constructor({ rootPath }?: {
|
|
6
|
+
rootPath?: string;
|
|
7
|
+
});
|
|
8
|
+
_rootPath: string;
|
|
9
|
+
_metrics: Metrics;
|
|
10
|
+
_state: Map<any, any>;
|
|
11
|
+
_counter: Metrics.MetricsCounter;
|
|
12
|
+
_writeDelayResolve: (a?: number) => number;
|
|
13
|
+
_writeDelayChunks: (a?: number) => number;
|
|
14
|
+
set(filePath: any, payload: any): void;
|
|
15
|
+
get(filePath: any): any;
|
|
16
|
+
dump(): [any, any][];
|
|
17
|
+
load(items: any): void;
|
|
18
|
+
/**
|
|
19
|
+
* @param {(count: number) => number} fn
|
|
20
|
+
*/
|
|
21
|
+
set writeDelayResolve(fn: (count: number) => number);
|
|
22
|
+
/**
|
|
23
|
+
* @param {(count: number) => number} fn
|
|
24
|
+
*/
|
|
25
|
+
set writeDelayChunks(fn: (count: number) => number);
|
|
26
|
+
write(filePath: any, contentType: any): Promise<any>;
|
|
27
|
+
read(filePath: any): Promise<any>;
|
|
28
|
+
delete(filePath: any): Promise<any>;
|
|
29
|
+
exist(filePath: any): Promise<any>;
|
|
30
|
+
}
|
|
31
|
+
import Sink from "@eik/sink";
|
|
32
|
+
import Metrics from "@metrics/client";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export default HealthCheck;
|
|
2
|
+
export type HealthCheckOptions = {
|
|
3
|
+
sink?: import("@eik/sink").default;
|
|
4
|
+
logger?: import("abslog").AbstractLoggerOptions;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* @typedef {object} HealthCheckOptions
|
|
8
|
+
* @property {import("@eik/sink").default} [sink]
|
|
9
|
+
* @property {import("abslog").AbstractLoggerOptions} [logger]
|
|
10
|
+
*/
|
|
11
|
+
declare const HealthCheck: {
|
|
12
|
+
new ({ sink, logger }?: HealthCheckOptions): {
|
|
13
|
+
_sink: import("@eik/sink").default;
|
|
14
|
+
_name: string;
|
|
15
|
+
_log: abslog.ValidLogger;
|
|
16
|
+
_write(): Promise<any>;
|
|
17
|
+
_read(): Promise<any>;
|
|
18
|
+
_delete(): Promise<void>;
|
|
19
|
+
_exist(): Promise<void>;
|
|
20
|
+
check(): Promise<boolean>;
|
|
21
|
+
readonly [Symbol.toStringTag]: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
import abslog from "abslog";
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export function createFilePathToPackage({ org, type, name, version, }?: {
|
|
2
|
+
org?: string;
|
|
3
|
+
type?: string;
|
|
4
|
+
name?: string;
|
|
5
|
+
version?: string;
|
|
6
|
+
}): string;
|
|
7
|
+
export function createFilePathToAsset({ org, type, name, version, asset, }?: {
|
|
8
|
+
org?: string;
|
|
9
|
+
type?: string;
|
|
10
|
+
name?: string;
|
|
11
|
+
version?: string;
|
|
12
|
+
asset?: string;
|
|
13
|
+
}): string;
|
|
14
|
+
export function createFilePathToImportMap({ org, name, version, }?: {
|
|
15
|
+
org?: string;
|
|
16
|
+
name?: string;
|
|
17
|
+
version?: string;
|
|
18
|
+
}): string;
|
|
19
|
+
export function createFilePathToAlias({ org, type, name, alias, }?: {
|
|
20
|
+
org?: string;
|
|
21
|
+
type?: string;
|
|
22
|
+
name?: string;
|
|
23
|
+
alias?: string;
|
|
24
|
+
}): string;
|
|
25
|
+
export function createFilePathToVersion({ org, type, name }?: {
|
|
26
|
+
org?: string;
|
|
27
|
+
type?: string;
|
|
28
|
+
name?: string;
|
|
29
|
+
}): string;
|
|
30
|
+
export function createFilePathToAliasOrigin({ org, type, name, version, }?: {
|
|
31
|
+
org?: string;
|
|
32
|
+
type?: string;
|
|
33
|
+
name?: string;
|
|
34
|
+
version?: string;
|
|
35
|
+
}): string;
|
|
36
|
+
export function createFilePathToEikJson({ org, type, name, version, }?: {
|
|
37
|
+
org?: string;
|
|
38
|
+
type?: string;
|
|
39
|
+
name?: string;
|
|
40
|
+
version?: string;
|
|
41
|
+
}): string;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export function createURIPathToPkgLog({ type, name, version }?: {
|
|
2
|
+
type?: string;
|
|
3
|
+
name?: string;
|
|
4
|
+
version?: string;
|
|
5
|
+
}): string;
|
|
6
|
+
export function createURIPathToAsset({ type, name, version, asset, }?: {
|
|
7
|
+
type?: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
version?: string;
|
|
10
|
+
asset?: string;
|
|
11
|
+
}): string;
|
|
12
|
+
export function createURIPathToImportMap({ name, version }?: {
|
|
13
|
+
name?: string;
|
|
14
|
+
version?: string;
|
|
15
|
+
}): string;
|
|
16
|
+
export function createURIToAlias({ type, name, alias }?: {
|
|
17
|
+
type?: string;
|
|
18
|
+
name?: string;
|
|
19
|
+
alias?: string;
|
|
20
|
+
}): string;
|
|
21
|
+
export function createURIToTargetOfAlias({ type, name, version, extra, }?: {
|
|
22
|
+
type?: string;
|
|
23
|
+
name?: string;
|
|
24
|
+
version?: string;
|
|
25
|
+
extra?: string;
|
|
26
|
+
}): string;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export function readJSON(sink: any, path: any): Promise<any>;
|
|
2
|
+
export function writeJSON(sink: any, path: any, obj: any, contentType: any): Promise<any>;
|
|
3
|
+
export function streamCollector(from: any): Promise<any>;
|
|
4
|
+
export function etagFromFsStat(stat: any): string;
|
|
5
|
+
export function decodeUriComponent(value: any): any;
|
|
6
|
+
export function readEikJson(sink: any, path: any): any;
|