@navios/core 0.2.0 → 0.2.1
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/_tsup-dts-rollup.d.mts +5 -10
- package/dist/_tsup-dts-rollup.d.ts +5 -10
- package/package.json +3 -3
- package/src/config/config.provider.mts +5 -1
- package/src/decorators/endpoint.decorator.mts +17 -10
- package/src/decorators/multipart.decorator.mts +17 -10
- package/src/decorators/stream.decorator.mts +17 -10
|
@@ -74,6 +74,7 @@ import { ServiceLocatorInstanceHolderStatus } from '@navios/di';
|
|
|
74
74
|
import { ServiceLocatorManager } from '@navios/di';
|
|
75
75
|
import { syncInject } from '@navios/di';
|
|
76
76
|
import { UnknownError } from '@navios/di';
|
|
77
|
+
import type { Util_FlatObject } from '@navios/common';
|
|
77
78
|
import { wrapSyncInit } from '@navios/di';
|
|
78
79
|
import { z } from 'zod';
|
|
79
80
|
import { ZodDiscriminatedUnion } from 'zod';
|
|
@@ -478,7 +479,7 @@ export { EndpointMetadataKey as EndpointMetadataKey_alias_2 }
|
|
|
478
479
|
|
|
479
480
|
declare type EndpointParams<EndpointDeclaration extends {
|
|
480
481
|
config: BaseEndpointConfig<any, any, any, any, any>;
|
|
481
|
-
}, Url extends string = EndpointDeclaration['config']['url'], QuerySchema = EndpointDeclaration['config']['querySchema']> = QuerySchema extends AnyZodObject ? EndpointDeclaration['config']['requestSchema'] extends ZodType ? EndpointFunctionArgs<Url, QuerySchema, EndpointDeclaration['config']['requestSchema']
|
|
482
|
+
}, Url extends string = EndpointDeclaration['config']['url'], QuerySchema = EndpointDeclaration['config']['querySchema']> = QuerySchema extends AnyZodObject ? EndpointDeclaration['config']['requestSchema'] extends ZodType ? Util_FlatObject<EndpointFunctionArgs<Url, QuerySchema, EndpointDeclaration['config']['requestSchema'], true>> : Util_FlatObject<EndpointFunctionArgs<Url, QuerySchema, undefined, true>> : EndpointDeclaration['config']['requestSchema'] extends ZodType ? Util_FlatObject<EndpointFunctionArgs<Url, undefined, EndpointDeclaration['config']['requestSchema'], true>> : Util_FlatObject<EndpointFunctionArgs<Url, undefined, undefined, true>>;
|
|
482
483
|
export { EndpointParams }
|
|
483
484
|
export { EndpointParams as EndpointParams_alias_1 }
|
|
484
485
|
export { EndpointParams as EndpointParams_alias_2 }
|
|
@@ -1064,7 +1065,7 @@ export { MultipartAdapterToken as MultipartAdapterToken_alias_2 }
|
|
|
1064
1065
|
|
|
1065
1066
|
declare type MultipartParams<EndpointDeclaration extends {
|
|
1066
1067
|
config: BaseEndpointConfig<any, any, any, any, any>;
|
|
1067
|
-
}, Url extends string = EndpointDeclaration['config']['url'], QuerySchema = EndpointDeclaration['config']['querySchema']> = QuerySchema extends AnyZodObject ? EndpointDeclaration['config']['requestSchema'] extends ZodType ? EndpointFunctionArgs<Url, QuerySchema, EndpointDeclaration['config']['requestSchema']
|
|
1068
|
+
}, Url extends string = EndpointDeclaration['config']['url'], QuerySchema = EndpointDeclaration['config']['querySchema']> = QuerySchema extends AnyZodObject ? EndpointDeclaration['config']['requestSchema'] extends ZodType ? Util_FlatObject<EndpointFunctionArgs<Url, QuerySchema, EndpointDeclaration['config']['requestSchema'], true>> : Util_FlatObject<EndpointFunctionArgs<Url, QuerySchema, undefined, true>> : EndpointDeclaration['config']['requestSchema'] extends ZodType ? Util_FlatObject<EndpointFunctionArgs<Url, undefined, EndpointDeclaration['config']['requestSchema'], true>> : Util_FlatObject<EndpointFunctionArgs<Url, undefined, undefined, true>>;
|
|
1068
1069
|
export { MultipartParams }
|
|
1069
1070
|
export { MultipartParams as MultipartParams_alias_1 }
|
|
1070
1071
|
export { MultipartParams as MultipartParams_alias_2 }
|
|
@@ -1184,13 +1185,7 @@ export { PinoWrapper }
|
|
|
1184
1185
|
export { PinoWrapper as PinoWrapper_alias_1 }
|
|
1185
1186
|
export { PinoWrapper as PinoWrapper_alias_2 }
|
|
1186
1187
|
|
|
1187
|
-
declare function provideConfig<ConfigMap extends Record<string, unknown>>(options: z.input<typeof ConfigProviderOptions>): BoundInjectionToken<
|
|
1188
|
-
load: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
|
|
1189
|
-
}, "strip", z.ZodTypeAny, {
|
|
1190
|
-
load: (...args: unknown[]) => unknown;
|
|
1191
|
-
}, {
|
|
1192
|
-
load: (...args: unknown[]) => unknown;
|
|
1193
|
-
}>>;
|
|
1188
|
+
declare function provideConfig<ConfigMap extends Record<string, unknown>>(options: z.input<typeof ConfigProviderOptions>): BoundInjectionToken<ConfigServiceInstance<ConfigMap>, typeof ConfigProviderOptions>;
|
|
1194
1189
|
export { provideConfig }
|
|
1195
1190
|
export { provideConfig as provideConfig_alias_1 }
|
|
1196
1191
|
export { provideConfig as provideConfig_alias_2 }
|
|
@@ -1259,7 +1254,7 @@ export { StreamAdapterToken as StreamAdapterToken_alias_2 }
|
|
|
1259
1254
|
|
|
1260
1255
|
declare type StreamParams<EndpointDeclaration extends {
|
|
1261
1256
|
config: BaseStreamConfig<any, any, any, any>;
|
|
1262
|
-
}, Url extends string = EndpointDeclaration['config']['url'], QuerySchema = EndpointDeclaration['config']['querySchema']> = QuerySchema extends AnyZodObject ? EndpointDeclaration['config']['requestSchema'] extends ZodType ? EndpointFunctionArgs<Url, QuerySchema, EndpointDeclaration['config']['requestSchema']
|
|
1257
|
+
}, Url extends string = EndpointDeclaration['config']['url'], QuerySchema = EndpointDeclaration['config']['querySchema']> = QuerySchema extends AnyZodObject ? EndpointDeclaration['config']['requestSchema'] extends ZodType ? Util_FlatObject<EndpointFunctionArgs<Url, QuerySchema, EndpointDeclaration['config']['requestSchema'], true>> : Util_FlatObject<EndpointFunctionArgs<Url, QuerySchema, undefined, true>> : EndpointDeclaration['config']['requestSchema'] extends ZodType ? Util_FlatObject<EndpointFunctionArgs<Url, undefined, EndpointDeclaration['config']['requestSchema'], true>> : Util_FlatObject<EndpointFunctionArgs<Url, undefined, undefined, true>>;
|
|
1263
1258
|
export { StreamParams }
|
|
1264
1259
|
export { StreamParams as StreamParams_alias_1 }
|
|
1265
1260
|
export { StreamParams as StreamParams_alias_2 }
|
|
@@ -74,6 +74,7 @@ import { ServiceLocatorInstanceHolderStatus } from '@navios/di';
|
|
|
74
74
|
import { ServiceLocatorManager } from '@navios/di';
|
|
75
75
|
import { syncInject } from '@navios/di';
|
|
76
76
|
import { UnknownError } from '@navios/di';
|
|
77
|
+
import type { Util_FlatObject } from '@navios/common';
|
|
77
78
|
import { wrapSyncInit } from '@navios/di';
|
|
78
79
|
import { z } from 'zod';
|
|
79
80
|
import { ZodDiscriminatedUnion } from 'zod';
|
|
@@ -478,7 +479,7 @@ export { EndpointMetadataKey as EndpointMetadataKey_alias_2 }
|
|
|
478
479
|
|
|
479
480
|
declare type EndpointParams<EndpointDeclaration extends {
|
|
480
481
|
config: BaseEndpointConfig<any, any, any, any, any>;
|
|
481
|
-
}, Url extends string = EndpointDeclaration['config']['url'], QuerySchema = EndpointDeclaration['config']['querySchema']> = QuerySchema extends AnyZodObject ? EndpointDeclaration['config']['requestSchema'] extends ZodType ? EndpointFunctionArgs<Url, QuerySchema, EndpointDeclaration['config']['requestSchema']
|
|
482
|
+
}, Url extends string = EndpointDeclaration['config']['url'], QuerySchema = EndpointDeclaration['config']['querySchema']> = QuerySchema extends AnyZodObject ? EndpointDeclaration['config']['requestSchema'] extends ZodType ? Util_FlatObject<EndpointFunctionArgs<Url, QuerySchema, EndpointDeclaration['config']['requestSchema'], true>> : Util_FlatObject<EndpointFunctionArgs<Url, QuerySchema, undefined, true>> : EndpointDeclaration['config']['requestSchema'] extends ZodType ? Util_FlatObject<EndpointFunctionArgs<Url, undefined, EndpointDeclaration['config']['requestSchema'], true>> : Util_FlatObject<EndpointFunctionArgs<Url, undefined, undefined, true>>;
|
|
482
483
|
export { EndpointParams }
|
|
483
484
|
export { EndpointParams as EndpointParams_alias_1 }
|
|
484
485
|
export { EndpointParams as EndpointParams_alias_2 }
|
|
@@ -1064,7 +1065,7 @@ export { MultipartAdapterToken as MultipartAdapterToken_alias_2 }
|
|
|
1064
1065
|
|
|
1065
1066
|
declare type MultipartParams<EndpointDeclaration extends {
|
|
1066
1067
|
config: BaseEndpointConfig<any, any, any, any, any>;
|
|
1067
|
-
}, Url extends string = EndpointDeclaration['config']['url'], QuerySchema = EndpointDeclaration['config']['querySchema']> = QuerySchema extends AnyZodObject ? EndpointDeclaration['config']['requestSchema'] extends ZodType ? EndpointFunctionArgs<Url, QuerySchema, EndpointDeclaration['config']['requestSchema']
|
|
1068
|
+
}, Url extends string = EndpointDeclaration['config']['url'], QuerySchema = EndpointDeclaration['config']['querySchema']> = QuerySchema extends AnyZodObject ? EndpointDeclaration['config']['requestSchema'] extends ZodType ? Util_FlatObject<EndpointFunctionArgs<Url, QuerySchema, EndpointDeclaration['config']['requestSchema'], true>> : Util_FlatObject<EndpointFunctionArgs<Url, QuerySchema, undefined, true>> : EndpointDeclaration['config']['requestSchema'] extends ZodType ? Util_FlatObject<EndpointFunctionArgs<Url, undefined, EndpointDeclaration['config']['requestSchema'], true>> : Util_FlatObject<EndpointFunctionArgs<Url, undefined, undefined, true>>;
|
|
1068
1069
|
export { MultipartParams }
|
|
1069
1070
|
export { MultipartParams as MultipartParams_alias_1 }
|
|
1070
1071
|
export { MultipartParams as MultipartParams_alias_2 }
|
|
@@ -1184,13 +1185,7 @@ export { PinoWrapper }
|
|
|
1184
1185
|
export { PinoWrapper as PinoWrapper_alias_1 }
|
|
1185
1186
|
export { PinoWrapper as PinoWrapper_alias_2 }
|
|
1186
1187
|
|
|
1187
|
-
declare function provideConfig<ConfigMap extends Record<string, unknown>>(options: z.input<typeof ConfigProviderOptions>): BoundInjectionToken<
|
|
1188
|
-
load: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
|
|
1189
|
-
}, "strip", z.ZodTypeAny, {
|
|
1190
|
-
load: (...args: unknown[]) => unknown;
|
|
1191
|
-
}, {
|
|
1192
|
-
load: (...args: unknown[]) => unknown;
|
|
1193
|
-
}>>;
|
|
1188
|
+
declare function provideConfig<ConfigMap extends Record<string, unknown>>(options: z.input<typeof ConfigProviderOptions>): BoundInjectionToken<ConfigServiceInstance<ConfigMap>, typeof ConfigProviderOptions>;
|
|
1194
1189
|
export { provideConfig }
|
|
1195
1190
|
export { provideConfig as provideConfig_alias_1 }
|
|
1196
1191
|
export { provideConfig as provideConfig_alias_2 }
|
|
@@ -1259,7 +1254,7 @@ export { StreamAdapterToken as StreamAdapterToken_alias_2 }
|
|
|
1259
1254
|
|
|
1260
1255
|
declare type StreamParams<EndpointDeclaration extends {
|
|
1261
1256
|
config: BaseStreamConfig<any, any, any, any>;
|
|
1262
|
-
}, Url extends string = EndpointDeclaration['config']['url'], QuerySchema = EndpointDeclaration['config']['querySchema']> = QuerySchema extends AnyZodObject ? EndpointDeclaration['config']['requestSchema'] extends ZodType ? EndpointFunctionArgs<Url, QuerySchema, EndpointDeclaration['config']['requestSchema']
|
|
1257
|
+
}, Url extends string = EndpointDeclaration['config']['url'], QuerySchema = EndpointDeclaration['config']['querySchema']> = QuerySchema extends AnyZodObject ? EndpointDeclaration['config']['requestSchema'] extends ZodType ? Util_FlatObject<EndpointFunctionArgs<Url, QuerySchema, EndpointDeclaration['config']['requestSchema'], true>> : Util_FlatObject<EndpointFunctionArgs<Url, QuerySchema, undefined, true>> : EndpointDeclaration['config']['requestSchema'] extends ZodType ? Util_FlatObject<EndpointFunctionArgs<Url, undefined, EndpointDeclaration['config']['requestSchema'], true>> : Util_FlatObject<EndpointFunctionArgs<Url, undefined, undefined, true>>;
|
|
1263
1258
|
export { StreamParams }
|
|
1264
1259
|
export { StreamParams as StreamParams_alias_1 }
|
|
1265
1260
|
export { StreamParams as StreamParams_alias_2 }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@navios/core",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "Oleksandr Hanzha",
|
|
6
6
|
"email": "alex@granted.name"
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"main": "./dist/index.js",
|
|
16
16
|
"module": "./dist/index.mjs",
|
|
17
17
|
"peerDependencies": {
|
|
18
|
-
"@navios/common": "^0.1.
|
|
18
|
+
"@navios/common": "^0.1.6",
|
|
19
19
|
"zod": "^3.23.8"
|
|
20
20
|
},
|
|
21
21
|
"exports": {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"./package.json": "./package.json"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@navios/common": "^0.1.
|
|
35
|
+
"@navios/common": "^0.1.6",
|
|
36
36
|
"tsx": "^4.19.4",
|
|
37
37
|
"typescript": "^5.8.3",
|
|
38
38
|
"zod": "^3.24.4"
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
+
BoundInjectionToken,
|
|
2
3
|
Injectable,
|
|
3
4
|
InjectableType,
|
|
4
5
|
InjectionToken,
|
|
@@ -52,6 +53,9 @@ export class ConfigProviderFactory {
|
|
|
52
53
|
|
|
53
54
|
export function provideConfig<ConfigMap extends Record<string, unknown>>(
|
|
54
55
|
options: z.input<typeof ConfigProviderOptions>,
|
|
55
|
-
)
|
|
56
|
+
): BoundInjectionToken<
|
|
57
|
+
ConfigServiceInstance<ConfigMap>,
|
|
58
|
+
typeof ConfigProviderOptions
|
|
59
|
+
> {
|
|
56
60
|
return InjectionToken.bound(ConfigProvider, options)
|
|
57
61
|
}
|
|
@@ -2,6 +2,7 @@ import type {
|
|
|
2
2
|
BaseEndpointConfig,
|
|
3
3
|
EndpointFunctionArgs,
|
|
4
4
|
HttpMethod,
|
|
5
|
+
Util_FlatObject,
|
|
5
6
|
} from '@navios/common'
|
|
6
7
|
import type { AnyZodObject, z, ZodType } from 'zod'
|
|
7
8
|
|
|
@@ -18,19 +19,25 @@ export type EndpointParams<
|
|
|
18
19
|
QuerySchema = EndpointDeclaration['config']['querySchema'],
|
|
19
20
|
> = QuerySchema extends AnyZodObject
|
|
20
21
|
? EndpointDeclaration['config']['requestSchema'] extends ZodType
|
|
21
|
-
?
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
? Util_FlatObject<
|
|
23
|
+
EndpointFunctionArgs<
|
|
24
|
+
Url,
|
|
25
|
+
QuerySchema,
|
|
26
|
+
EndpointDeclaration['config']['requestSchema'],
|
|
27
|
+
true
|
|
28
|
+
>
|
|
25
29
|
>
|
|
26
|
-
: EndpointFunctionArgs<Url, QuerySchema, undefined
|
|
30
|
+
: Util_FlatObject<EndpointFunctionArgs<Url, QuerySchema, undefined, true>>
|
|
27
31
|
: EndpointDeclaration['config']['requestSchema'] extends ZodType
|
|
28
|
-
?
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
+
? Util_FlatObject<
|
|
33
|
+
EndpointFunctionArgs<
|
|
34
|
+
Url,
|
|
35
|
+
undefined,
|
|
36
|
+
EndpointDeclaration['config']['requestSchema'],
|
|
37
|
+
true
|
|
38
|
+
>
|
|
32
39
|
>
|
|
33
|
-
: EndpointFunctionArgs<Url, undefined, undefined
|
|
40
|
+
: Util_FlatObject<EndpointFunctionArgs<Url, undefined, undefined, true>>
|
|
34
41
|
|
|
35
42
|
export type EndpointResult<
|
|
36
43
|
EndpointDeclaration extends {
|
|
@@ -2,6 +2,7 @@ import type {
|
|
|
2
2
|
BaseEndpointConfig,
|
|
3
3
|
EndpointFunctionArgs,
|
|
4
4
|
HttpMethod,
|
|
5
|
+
Util_FlatObject,
|
|
5
6
|
} from '@navios/common'
|
|
6
7
|
import type { AnyZodObject, z, ZodType } from 'zod'
|
|
7
8
|
|
|
@@ -18,19 +19,25 @@ export type MultipartParams<
|
|
|
18
19
|
QuerySchema = EndpointDeclaration['config']['querySchema'],
|
|
19
20
|
> = QuerySchema extends AnyZodObject
|
|
20
21
|
? EndpointDeclaration['config']['requestSchema'] extends ZodType
|
|
21
|
-
?
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
? Util_FlatObject<
|
|
23
|
+
EndpointFunctionArgs<
|
|
24
|
+
Url,
|
|
25
|
+
QuerySchema,
|
|
26
|
+
EndpointDeclaration['config']['requestSchema'],
|
|
27
|
+
true
|
|
28
|
+
>
|
|
25
29
|
>
|
|
26
|
-
: EndpointFunctionArgs<Url, QuerySchema, undefined
|
|
30
|
+
: Util_FlatObject<EndpointFunctionArgs<Url, QuerySchema, undefined, true>>
|
|
27
31
|
: EndpointDeclaration['config']['requestSchema'] extends ZodType
|
|
28
|
-
?
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
+
? Util_FlatObject<
|
|
33
|
+
EndpointFunctionArgs<
|
|
34
|
+
Url,
|
|
35
|
+
undefined,
|
|
36
|
+
EndpointDeclaration['config']['requestSchema'],
|
|
37
|
+
true
|
|
38
|
+
>
|
|
32
39
|
>
|
|
33
|
-
: EndpointFunctionArgs<Url, undefined, undefined
|
|
40
|
+
: Util_FlatObject<EndpointFunctionArgs<Url, undefined, undefined, true>>
|
|
34
41
|
|
|
35
42
|
export type MultipartResult<
|
|
36
43
|
EndpointDeclaration extends {
|
|
@@ -2,6 +2,7 @@ import type {
|
|
|
2
2
|
BaseStreamConfig,
|
|
3
3
|
EndpointFunctionArgs,
|
|
4
4
|
HttpMethod,
|
|
5
|
+
Util_FlatObject,
|
|
5
6
|
} from '@navios/common'
|
|
6
7
|
import type { FastifyReply } from 'fastify'
|
|
7
8
|
import type { AnyZodObject, ZodType } from 'zod'
|
|
@@ -17,19 +18,25 @@ export type StreamParams<
|
|
|
17
18
|
QuerySchema = EndpointDeclaration['config']['querySchema'],
|
|
18
19
|
> = QuerySchema extends AnyZodObject
|
|
19
20
|
? EndpointDeclaration['config']['requestSchema'] extends ZodType
|
|
20
|
-
?
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
? Util_FlatObject<
|
|
22
|
+
EndpointFunctionArgs<
|
|
23
|
+
Url,
|
|
24
|
+
QuerySchema,
|
|
25
|
+
EndpointDeclaration['config']['requestSchema'],
|
|
26
|
+
true
|
|
27
|
+
>
|
|
24
28
|
>
|
|
25
|
-
: EndpointFunctionArgs<Url, QuerySchema, undefined
|
|
29
|
+
: Util_FlatObject<EndpointFunctionArgs<Url, QuerySchema, undefined, true>>
|
|
26
30
|
: EndpointDeclaration['config']['requestSchema'] extends ZodType
|
|
27
|
-
?
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
+
? Util_FlatObject<
|
|
32
|
+
EndpointFunctionArgs<
|
|
33
|
+
Url,
|
|
34
|
+
undefined,
|
|
35
|
+
EndpointDeclaration['config']['requestSchema'],
|
|
36
|
+
true
|
|
37
|
+
>
|
|
31
38
|
>
|
|
32
|
-
: EndpointFunctionArgs<Url, undefined, undefined
|
|
39
|
+
: Util_FlatObject<EndpointFunctionArgs<Url, undefined, undefined, true>>
|
|
33
40
|
|
|
34
41
|
export function Stream<
|
|
35
42
|
Method extends HttpMethod = HttpMethod,
|