@eik/core 1.3.54 → 1.3.56
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/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 +289 -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 +20 -15
- 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
package/lib/main.js
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import FS from
|
|
2
|
-
import MEM from
|
|
1
|
+
import FS from "@eik/sink-file-system";
|
|
2
|
+
import MEM from "@eik/sink-memory";
|
|
3
3
|
|
|
4
|
-
import VersionsGet from
|
|
5
|
-
import AliasPost from
|
|
6
|
-
import AliasPut from
|
|
7
|
-
import AliasGet from
|
|
8
|
-
import AliasDel from
|
|
9
|
-
import AuthPost from
|
|
10
|
-
import PkgLog from
|
|
11
|
-
import PkgGet from
|
|
12
|
-
import PkgPut from
|
|
13
|
-
import MapGet from
|
|
14
|
-
import MapPut from
|
|
4
|
+
import VersionsGet from "./handlers/versions.get.js";
|
|
5
|
+
import AliasPost from "./handlers/alias.post.js";
|
|
6
|
+
import AliasPut from "./handlers/alias.put.js";
|
|
7
|
+
import AliasGet from "./handlers/alias.get.js";
|
|
8
|
+
import AliasDel from "./handlers/alias.delete.js";
|
|
9
|
+
import AuthPost from "./handlers/auth.post.js";
|
|
10
|
+
import PkgLog from "./handlers/pkg.log.js";
|
|
11
|
+
import PkgGet from "./handlers/pkg.get.js";
|
|
12
|
+
import PkgPut from "./handlers/pkg.put.js";
|
|
13
|
+
import MapGet from "./handlers/map.get.js";
|
|
14
|
+
import MapPut from "./handlers/map.put.js";
|
|
15
15
|
|
|
16
|
-
import TEST from
|
|
16
|
+
import TEST from "./sinks/test.js";
|
|
17
17
|
|
|
18
|
-
import HealthCheck from
|
|
19
|
-
import globals from
|
|
18
|
+
import HealthCheck from "./utils/healthcheck.js";
|
|
19
|
+
import globals from "./utils/globals.js";
|
|
20
20
|
|
|
21
21
|
const http = {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
22
|
+
VersionsGet,
|
|
23
|
+
AliasPost,
|
|
24
|
+
AliasPut,
|
|
25
|
+
AliasGet,
|
|
26
|
+
AliasDel,
|
|
27
|
+
AuthPost,
|
|
28
|
+
PkgLog,
|
|
29
|
+
PkgGet,
|
|
30
|
+
PkgPut,
|
|
31
|
+
MapGet,
|
|
32
|
+
MapPut,
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
/**
|
|
@@ -38,30 +38,30 @@ const http = {
|
|
|
38
38
|
* Ex: sink.MEM is replaced by eik/sink-memory. sink.FS is replaced by eik/sink-file-system.
|
|
39
39
|
*/
|
|
40
40
|
const sink = {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
41
|
+
/**
|
|
42
|
+
* @deprecated Import eik/sink-memory or implement your own and pass it to the Service instead.
|
|
43
|
+
*/
|
|
44
|
+
TEST,
|
|
45
|
+
/**
|
|
46
|
+
* @deprecated Import eik/sink-memory and pass it to the Service instead
|
|
47
|
+
*/
|
|
48
|
+
MEM,
|
|
49
|
+
/**
|
|
50
|
+
* @deprecated Import eik/sink-file-system and pass it to the Service instead
|
|
51
|
+
*/
|
|
52
|
+
FS,
|
|
53
53
|
};
|
|
54
54
|
|
|
55
55
|
const prop = {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
base_auth: globals.BASE_AUTHENTICATION,
|
|
57
|
+
base_map: globals.BASE_IMPORT_MAPS,
|
|
58
|
+
base_pkg: globals.BASE_PACKAGES,
|
|
59
|
+
base_npm: globals.BASE_NPM,
|
|
60
60
|
};
|
|
61
61
|
|
|
62
62
|
export default {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
HealthCheck,
|
|
64
|
+
http,
|
|
65
|
+
sink,
|
|
66
|
+
prop,
|
|
67
67
|
};
|
|
@@ -1,29 +1,26 @@
|
|
|
1
1
|
const FormField = class FormField {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
this._value = value;
|
|
7
|
-
this._name = name;
|
|
8
|
-
}
|
|
2
|
+
constructor({ value = "", name = "" } = {}) {
|
|
3
|
+
this._value = value;
|
|
4
|
+
this._name = name;
|
|
5
|
+
}
|
|
9
6
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
get value() {
|
|
8
|
+
return this._value;
|
|
9
|
+
}
|
|
13
10
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
get name() {
|
|
12
|
+
return this._name;
|
|
13
|
+
}
|
|
17
14
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
toJSON() {
|
|
16
|
+
return {
|
|
17
|
+
value: this.value,
|
|
18
|
+
name: this.name,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
24
21
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
22
|
+
get [Symbol.toStringTag]() {
|
|
23
|
+
return "FormField";
|
|
24
|
+
}
|
|
25
|
+
};
|
|
29
26
|
export default FormField;
|
|
@@ -1,30 +1,28 @@
|
|
|
1
1
|
const FormFile = class FormFile {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
this._name = name;
|
|
9
|
-
}
|
|
2
|
+
constructor({ value = [], name = "" } = {}) {
|
|
3
|
+
if (!Array.isArray(value))
|
|
4
|
+
throw new TypeError('The argument "value" must be of type Array');
|
|
5
|
+
this._value = value;
|
|
6
|
+
this._name = name;
|
|
7
|
+
}
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
get value() {
|
|
10
|
+
return this._value;
|
|
11
|
+
}
|
|
14
12
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
get name() {
|
|
14
|
+
return this._name;
|
|
15
|
+
}
|
|
18
16
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
toJSON() {
|
|
18
|
+
return {
|
|
19
|
+
value: this.value,
|
|
20
|
+
name: this.name,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
25
23
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
24
|
+
get [Symbol.toStringTag]() {
|
|
25
|
+
return "FormFile";
|
|
26
|
+
}
|
|
27
|
+
};
|
|
30
28
|
export default FormFile;
|