jimpex 10.0.2 → 11.0.0
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 +29 -0
- package/README.md +7 -9
- package/dist/app/index.d.ts +1 -1
- package/dist/app/index.js +1 -22
- package/dist/app/index.js.map +1 -1
- package/dist/app/jimpex.d.ts +1 -1
- package/dist/app/jimpex.js +100 -131
- package/dist/app/jimpex.js.map +1 -1
- package/dist/controllers/common/config.d.ts +2 -2
- package/dist/controllers/common/config.js +12 -39
- package/dist/controllers/common/config.js.map +1 -1
- package/dist/controllers/common/health.d.ts +4 -4
- package/dist/controllers/common/health.js +20 -47
- package/dist/controllers/common/health.js.map +1 -1
- package/dist/controllers/common/index.d.ts +1 -1
- package/dist/controllers/common/index.js +3 -26
- package/dist/controllers/common/index.js.map +1 -1
- package/dist/controllers/common/statics.d.ts +3 -3
- package/dist/controllers/common/statics.js +32 -65
- package/dist/controllers/common/statics.js.map +1 -1
- package/dist/controllers/index.d.ts +1 -1
- package/dist/controllers/index.js +2 -24
- package/dist/controllers/index.js.map +1 -1
- package/dist/controllers/utils/gateway.d.ts +5 -5
- package/dist/controllers/utils/gateway.js +70 -91
- package/dist/controllers/utils/gateway.js.map +1 -1
- package/dist/controllers/utils/index.d.ts +1 -1
- package/dist/controllers/utils/index.js +1 -22
- package/dist/controllers/utils/index.js.map +1 -1
- package/dist/{index-C6I3NCC-.d.ts → index-BlSpNHox.d.ts} +13 -13
- package/dist/index.d.ts +3 -3
- package/dist/index.js +6 -32
- package/dist/index.js.map +1 -1
- package/dist/middlewares/common/errorHandler.d.ts +5 -5
- package/dist/middlewares/common/errorHandler.js +31 -56
- package/dist/middlewares/common/errorHandler.js.map +1 -1
- package/dist/middlewares/common/forceHTTPS.d.ts +1 -1
- package/dist/middlewares/common/forceHTTPS.js +8 -35
- package/dist/middlewares/common/forceHTTPS.js.map +1 -1
- package/dist/middlewares/common/hsts.d.ts +1 -1
- package/dist/middlewares/common/hsts.js +12 -39
- package/dist/middlewares/common/hsts.js.map +1 -1
- package/dist/middlewares/common/index.d.ts +3 -3
- package/dist/middlewares/common/index.js +3 -26
- package/dist/middlewares/common/index.js.map +1 -1
- package/dist/middlewares/html/fastHTML.d.ts +4 -4
- package/dist/middlewares/html/fastHTML.js +43 -66
- package/dist/middlewares/html/fastHTML.js.map +1 -1
- package/dist/middlewares/html/index.d.ts +2 -2
- package/dist/middlewares/html/index.js +2 -24
- package/dist/middlewares/html/index.js.map +1 -1
- package/dist/middlewares/html/showHTML.d.ts +3 -3
- package/dist/middlewares/html/showHTML.js +25 -52
- package/dist/middlewares/html/showHTML.js.map +1 -1
- package/dist/middlewares/index.d.ts +4 -4
- package/dist/middlewares/index.js +3 -26
- package/dist/middlewares/index.js.map +1 -1
- package/dist/middlewares/utils/index.d.ts +3 -3
- package/dist/middlewares/utils/index.js +1 -22
- package/dist/middlewares/utils/index.js.map +1 -1
- package/dist/middlewares/utils/versionValidator.d.ts +5 -5
- package/dist/middlewares/utils/versionValidator.js +24 -51
- package/dist/middlewares/utils/versionValidator.js.map +1 -1
- package/dist/services/common/appError.d.ts +2 -2
- package/dist/services/common/appError.js +18 -46
- package/dist/services/common/appError.js.map +1 -1
- package/dist/services/common/httpError.d.ts +2 -2
- package/dist/services/common/httpError.js +7 -33
- package/dist/services/common/httpError.js.map +1 -1
- package/dist/services/common/index.d.ts +1 -1
- package/dist/services/common/index.js +14 -42
- package/dist/services/common/index.js.map +1 -1
- package/dist/services/common/sendFile.d.ts +1 -1
- package/dist/services/common/sendFile.js +4 -29
- package/dist/services/common/sendFile.js.map +1 -1
- package/dist/services/frontend/frontendFs.d.ts +2 -2
- package/dist/services/frontend/frontendFs.js +12 -49
- package/dist/services/frontend/frontendFs.js.map +1 -1
- package/dist/services/frontend/index.d.ts +2 -2
- package/dist/services/frontend/index.js +8 -34
- package/dist/services/frontend/index.js.map +1 -1
- package/dist/services/html/htmlGenerator.d.ts +5 -5
- package/dist/services/html/htmlGenerator.js +46 -75
- package/dist/services/html/htmlGenerator.js.map +1 -1
- package/dist/services/html/index.d.ts +2 -2
- package/dist/services/html/index.js +8 -34
- package/dist/services/html/index.js.map +1 -1
- package/dist/services/http/apiClient.d.ts +1 -1
- package/dist/services/http/apiClient.js +23 -48
- package/dist/services/http/apiClient.js.map +1 -1
- package/dist/services/http/http.d.ts +5 -5
- package/dist/services/http/http.js +23 -60
- package/dist/services/http/http.js.map +1 -1
- package/dist/services/http/index.d.ts +2 -2
- package/dist/services/http/index.js +14 -42
- package/dist/services/http/index.js.map +1 -1
- package/dist/services/http/responsesBuilder.d.ts +4 -4
- package/dist/services/http/responsesBuilder.js +13 -40
- package/dist/services/http/responsesBuilder.js.map +1 -1
- package/dist/services/index.d.ts +3 -3
- package/dist/services/index.js +5 -30
- package/dist/services/index.js.map +1 -1
- package/dist/services/utils/ensureBearerToken.d.ts +2 -2
- package/dist/services/utils/ensureBearerToken.js +15 -42
- package/dist/services/utils/ensureBearerToken.js.map +1 -1
- package/dist/services/utils/index.d.ts +1 -1
- package/dist/services/utils/index.js +8 -34
- package/dist/services/utils/index.js.map +1 -1
- package/dist/types/events.d.ts +1 -1
- package/dist/types/events.js +0 -16
- package/dist/types/events.js.map +1 -1
- package/dist/types/express.js +0 -16
- package/dist/types/express.js.map +1 -1
- package/dist/types/http.js +0 -16
- package/dist/types/http.js.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.js +6 -32
- package/dist/types/index.js.map +1 -1
- package/dist/types/options.d.ts +1 -1
- package/dist/types/options.js +0 -16
- package/dist/types/options.js.map +1 -1
- package/dist/types/utils.js +0 -16
- package/dist/types/utils.js.map +1 -1
- package/dist/types/wootils.js +0 -16
- package/dist/types/wootils.js.map +1 -1
- package/dist/utils/fns/index.js +4 -28
- package/dist/utils/fns/index.js.map +1 -1
- package/dist/utils/fns/others.js +2 -26
- package/dist/utils/fns/others.js.map +1 -1
- package/dist/utils/fns/routes.js +4 -31
- package/dist/utils/fns/routes.js.map +1 -1
- package/dist/utils/fns/statuses.js +3 -37
- package/dist/utils/fns/statuses.js.map +1 -1
- package/dist/utils/fns/text.js +2 -26
- package/dist/utils/fns/text.js.map +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +2 -24
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/wrappers.d.ts +1 -1
- package/dist/utils/wrappers.js +20 -48
- package/dist/utils/wrappers.js.map +1 -1
- package/eslint.config.js +19 -0
- package/examples/basic/app.ts +4 -4
- package/examples/basic/controller.ts +2 -2
- package/examples/basic/index.ts +4 -4
- package/examples/basic/middleware.ts +2 -2
- package/examples/basic/service.ts +1 -1
- package/package.json +61 -49
- package/pnpm-workspace.yaml +4 -0
- package/src/app/index.ts +1 -1
- package/src/app/jimpex.ts +23 -20
- package/src/controllers/common/config.ts +4 -4
- package/src/controllers/common/health.ts +9 -5
- package/src/controllers/common/index.ts +3 -3
- package/src/controllers/common/statics.ts +12 -7
- package/src/controllers/index.ts +2 -2
- package/src/controllers/utils/gateway.ts +8 -8
- package/src/controllers/utils/index.ts +1 -1
- package/src/index.ts +6 -6
- package/src/middlewares/common/errorHandler.ts +9 -5
- package/src/middlewares/common/forceHTTPS.ts +2 -2
- package/src/middlewares/common/hsts.ts +2 -2
- package/src/middlewares/common/index.ts +3 -3
- package/src/middlewares/html/fastHTML.ts +14 -5
- package/src/middlewares/html/index.ts +2 -2
- package/src/middlewares/html/showHTML.ts +8 -4
- package/src/middlewares/index.ts +3 -3
- package/src/middlewares/utils/index.ts +1 -1
- package/src/middlewares/utils/versionValidator.ts +6 -6
- package/src/services/common/appError.ts +1 -1
- package/src/services/common/httpError.ts +2 -2
- package/src/services/common/index.ts +7 -7
- package/src/services/common/sendFile.ts +2 -2
- package/src/services/frontend/frontendFs.ts +3 -3
- package/src/services/frontend/index.ts +3 -3
- package/src/services/html/htmlGenerator.ts +11 -13
- package/src/services/html/index.ts +3 -3
- package/src/services/http/apiClient.ts +3 -3
- package/src/services/http/http.ts +5 -5
- package/src/services/http/index.ts +7 -7
- package/src/services/http/responsesBuilder.ts +5 -5
- package/src/services/index.ts +5 -5
- package/src/services/utils/ensureBearerToken.ts +4 -4
- package/src/services/utils/index.ts +3 -3
- package/src/types/events.ts +8 -8
- package/src/types/http.ts +1 -1
- package/src/types/index.ts +6 -6
- package/src/types/options.ts +2 -2
- package/src/types/utils.ts +4 -4
- package/src/utils/fns/index.ts +4 -4
- package/src/utils/fns/routes.ts +1 -1
- package/src/utils/index.ts +2 -2
- package/src/utils/wrappers.ts +6 -6
- package/tsconfig.json +9 -4
- package/tsup.config.ts +1 -2
- package/vitest.config.ts +24 -0
- package/dist/app/index.d.mts +0 -14
- package/dist/app/jimpex.d.mts +0 -14
- package/dist/controllers/common/config.d.mts +0 -79
- package/dist/controllers/common/health.d.mts +0 -83
- package/dist/controllers/common/index.d.mts +0 -22
- package/dist/controllers/common/statics.d.mts +0 -223
- package/dist/controllers/index.d.mts +0 -25
- package/dist/controllers/utils/gateway.d.mts +0 -725
- package/dist/controllers/utils/index.d.mts +0 -17
- package/dist/esm/app/index.js +0 -2
- package/dist/esm/app/index.js.map +0 -1
- package/dist/esm/app/jimpex.js +0 -640
- package/dist/esm/app/jimpex.js.map +0 -1
- package/dist/esm/chunk-V6TY7KAL.js +0 -8
- package/dist/esm/chunk-V6TY7KAL.js.map +0 -1
- package/dist/esm/controllers/common/config.js +0 -80
- package/dist/esm/controllers/common/config.js.map +0 -1
- package/dist/esm/controllers/common/health.js +0 -88
- package/dist/esm/controllers/common/health.js.map +0 -1
- package/dist/esm/controllers/common/index.js +0 -4
- package/dist/esm/controllers/common/index.js.map +0 -1
- package/dist/esm/controllers/common/statics.js +0 -226
- package/dist/esm/controllers/common/statics.js.map +0 -1
- package/dist/esm/controllers/index.js +0 -3
- package/dist/esm/controllers/index.js.map +0 -1
- package/dist/esm/controllers/utils/gateway.js +0 -559
- package/dist/esm/controllers/utils/gateway.js.map +0 -1
- package/dist/esm/controllers/utils/index.js +0 -2
- package/dist/esm/controllers/utils/index.js.map +0 -1
- package/dist/esm/index.js +0 -7
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/middlewares/common/errorHandler.js +0 -116
- package/dist/esm/middlewares/common/errorHandler.js.map +0 -1
- package/dist/esm/middlewares/common/forceHTTPS.js +0 -52
- package/dist/esm/middlewares/common/forceHTTPS.js.map +0 -1
- package/dist/esm/middlewares/common/hsts.js +0 -74
- package/dist/esm/middlewares/common/hsts.js.map +0 -1
- package/dist/esm/middlewares/common/index.js +0 -4
- package/dist/esm/middlewares/common/index.js.map +0 -1
- package/dist/esm/middlewares/html/fastHTML.js +0 -157
- package/dist/esm/middlewares/html/fastHTML.js.map +0 -1
- package/dist/esm/middlewares/html/index.js +0 -3
- package/dist/esm/middlewares/html/index.js.map +0 -1
- package/dist/esm/middlewares/html/showHTML.js +0 -100
- package/dist/esm/middlewares/html/showHTML.js.map +0 -1
- package/dist/esm/middlewares/index.js +0 -4
- package/dist/esm/middlewares/index.js.map +0 -1
- package/dist/esm/middlewares/utils/index.js +0 -2
- package/dist/esm/middlewares/utils/index.js.map +0 -1
- package/dist/esm/middlewares/utils/versionValidator.js +0 -135
- package/dist/esm/middlewares/utils/versionValidator.js.map +0 -1
- package/dist/esm/services/common/appError.js +0 -98
- package/dist/esm/services/common/appError.js.map +0 -1
- package/dist/esm/services/common/httpError.js +0 -28
- package/dist/esm/services/common/httpError.js.map +0 -1
- package/dist/esm/services/common/index.js +0 -17
- package/dist/esm/services/common/index.js.map +0 -1
- package/dist/esm/services/common/sendFile.js +0 -27
- package/dist/esm/services/common/sendFile.js.map +0 -1
- package/dist/esm/services/frontend/frontendFs.js +0 -66
- package/dist/esm/services/frontend/frontendFs.js.map +0 -1
- package/dist/esm/services/frontend/index.js +0 -11
- package/dist/esm/services/frontend/index.js.map +0 -1
- package/dist/esm/services/html/htmlGenerator.js +0 -192
- package/dist/esm/services/html/htmlGenerator.js.map +0 -1
- package/dist/esm/services/html/index.js +0 -11
- package/dist/esm/services/html/index.js.map +0 -1
- package/dist/esm/services/http/apiClient.js +0 -94
- package/dist/esm/services/http/apiClient.js.map +0 -1
- package/dist/esm/services/http/http.js +0 -180
- package/dist/esm/services/http/http.js.map +0 -1
- package/dist/esm/services/http/index.js +0 -17
- package/dist/esm/services/http/index.js.map +0 -1
- package/dist/esm/services/http/responsesBuilder.js +0 -152
- package/dist/esm/services/http/responsesBuilder.js.map +0 -1
- package/dist/esm/services/index.js +0 -6
- package/dist/esm/services/index.js.map +0 -1
- package/dist/esm/services/utils/ensureBearerToken.js +0 -94
- package/dist/esm/services/utils/ensureBearerToken.js.map +0 -1
- package/dist/esm/services/utils/index.js +0 -11
- package/dist/esm/services/utils/index.js.map +0 -1
- package/dist/esm/types/events.js +0 -1
- package/dist/esm/types/events.js.map +0 -1
- package/dist/esm/types/express.js +0 -1
- package/dist/esm/types/express.js.map +0 -1
- package/dist/esm/types/http.js +0 -1
- package/dist/esm/types/http.js.map +0 -1
- package/dist/esm/types/index.js +0 -7
- package/dist/esm/types/index.js.map +0 -1
- package/dist/esm/types/options.js +0 -1
- package/dist/esm/types/options.js.map +0 -1
- package/dist/esm/types/utils.js +0 -1
- package/dist/esm/types/utils.js.map +0 -1
- package/dist/esm/types/wootils.js +0 -1
- package/dist/esm/types/wootils.js.map +0 -1
- package/dist/esm/utils/fns/index.js +0 -5
- package/dist/esm/utils/fns/index.js.map +0 -1
- package/dist/esm/utils/fns/others.js +0 -6
- package/dist/esm/utils/fns/others.js.map +0 -1
- package/dist/esm/utils/fns/routes.js +0 -25
- package/dist/esm/utils/fns/routes.js.map +0 -1
- package/dist/esm/utils/fns/statuses.js +0 -6
- package/dist/esm/utils/fns/statuses.js.map +0 -1
- package/dist/esm/utils/fns/text.js +0 -6
- package/dist/esm/utils/fns/text.js.map +0 -1
- package/dist/esm/utils/index.js +0 -3
- package/dist/esm/utils/index.js.map +0 -1
- package/dist/esm/utils/wrappers.js +0 -41
- package/dist/esm/utils/wrappers.js.map +0 -1
- package/dist/index-Bwf7JHu9.d.mts +0 -1287
- package/dist/index.d.mts +0 -47
- package/dist/middlewares/common/errorHandler.d.mts +0 -132
- package/dist/middlewares/common/forceHTTPS.d.mts +0 -69
- package/dist/middlewares/common/hsts.d.mts +0 -110
- package/dist/middlewares/common/index.d.mts +0 -22
- package/dist/middlewares/html/fastHTML.d.mts +0 -180
- package/dist/middlewares/html/index.d.mts +0 -21
- package/dist/middlewares/html/showHTML.d.mts +0 -127
- package/dist/middlewares/index.d.mts +0 -30
- package/dist/middlewares/utils/index.d.mts +0 -20
- package/dist/middlewares/utils/versionValidator.d.mts +0 -215
- package/dist/services/common/appError.d.mts +0 -139
- package/dist/services/common/httpError.d.mts +0 -80
- package/dist/services/common/index.d.mts +0 -47
- package/dist/services/common/sendFile.d.mts +0 -102
- package/dist/services/frontend/frontendFs.d.mts +0 -96
- package/dist/services/frontend/index.d.mts +0 -40
- package/dist/services/html/htmlGenerator.d.mts +0 -237
- package/dist/services/html/index.d.mts +0 -43
- package/dist/services/http/apiClient.d.mts +0 -170
- package/dist/services/http/http.d.mts +0 -182
- package/dist/services/http/index.d.mts +0 -51
- package/dist/services/http/responsesBuilder.d.mts +0 -179
- package/dist/services/index.d.mts +0 -33
- package/dist/services/utils/ensureBearerToken.d.mts +0 -158
- package/dist/services/utils/index.d.mts +0 -44
- package/dist/types/events.d.mts +0 -14
- package/dist/types/express.d.mts +0 -10
- package/dist/types/http.d.mts +0 -82
- package/dist/types/index.d.mts +0 -14
- package/dist/types/options.d.mts +0 -14
- package/dist/types/utils.d.mts +0 -48
- package/dist/types/wootils.d.mts +0 -4
- package/dist/utils/fns/index.d.mts +0 -5
- package/dist/utils/fns/others.d.mts +0 -17
- package/dist/utils/fns/routes.d.mts +0 -39
- package/dist/utils/fns/statuses.d.mts +0 -45
- package/dist/utils/fns/text.d.mts +0 -9
- package/dist/utils/index.d.mts +0 -19
- package/dist/utils/wrappers.d.mts +0 -14
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as path from 'path';
|
|
1
|
+
import * as path from 'node:path';
|
|
2
2
|
import type mime from 'mime';
|
|
3
3
|
import { deepAssignWithOverwrite } from '@homer0/deep-assign';
|
|
4
4
|
import {
|
|
@@ -6,10 +6,15 @@ import {
|
|
|
6
6
|
removeSlashes,
|
|
7
7
|
notUndefined,
|
|
8
8
|
type MiddlewareLike,
|
|
9
|
-
} from '../../utils';
|
|
10
|
-
import type { SendFile } from '../../services';
|
|
11
|
-
import type { Jimpex } from '../../app';
|
|
12
|
-
import type {
|
|
9
|
+
} from '../../utils/index.js';
|
|
10
|
+
import type { SendFile } from '../../services/index.js';
|
|
11
|
+
import type { Jimpex } from '../../app/index.js';
|
|
12
|
+
import type {
|
|
13
|
+
DeepPartial,
|
|
14
|
+
ExpressMiddleware,
|
|
15
|
+
Router,
|
|
16
|
+
RouterMethod,
|
|
17
|
+
} from '../../types/index.js';
|
|
13
18
|
|
|
14
19
|
type Mime = typeof mime;
|
|
15
20
|
|
|
@@ -91,7 +96,7 @@ export type StaticsControllerConstructorOptions =
|
|
|
91
96
|
};
|
|
92
97
|
};
|
|
93
98
|
/**
|
|
94
|
-
* A function to generate a list of middlewares that can be executed before the
|
|
99
|
+
* A function to generate a list of middlewares that can be executed before the controller
|
|
95
100
|
* main middleware.
|
|
96
101
|
*
|
|
97
102
|
* @group Controllers/Statics
|
|
@@ -105,7 +110,7 @@ export type StaticsControllerGetMiddlewaresFn = (app: Jimpex) => MiddlewareLike[
|
|
|
105
110
|
export type StaticsControllerCreatorOptions = DeepPartial<StaticsControllerOptions> & {
|
|
106
111
|
/**
|
|
107
112
|
* A function to generate a list of middlewares that can be executed before the
|
|
108
|
-
*
|
|
113
|
+
* controller main middleware.
|
|
109
114
|
*/
|
|
110
115
|
getMiddlewares?: StaticsControllerGetMiddlewaresFn;
|
|
111
116
|
};
|
package/src/controllers/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './common';
|
|
2
|
-
export * from './utils';
|
|
1
|
+
export * from './common/index.js';
|
|
2
|
+
export * from './utils/index.js';
|
|
@@ -8,9 +8,9 @@ import {
|
|
|
8
8
|
removeSlashes,
|
|
9
9
|
notUndefined,
|
|
10
10
|
type MiddlewareLike,
|
|
11
|
-
} from '../../utils';
|
|
12
|
-
import type { HTTP, HTTPFetchOptions } from '../../services';
|
|
13
|
-
import type { Jimpex } from '../../app';
|
|
11
|
+
} from '../../utils/index.js';
|
|
12
|
+
import type { HTTP, HTTPFetchOptions } from '../../services/index.js';
|
|
13
|
+
import type { Jimpex } from '../../app/index.js';
|
|
14
14
|
import {
|
|
15
15
|
RouterMethod,
|
|
16
16
|
DeepPartial,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
Router,
|
|
22
22
|
ExpressMiddleware,
|
|
23
23
|
AsyncExpressMiddleware,
|
|
24
|
-
} from '../../types';
|
|
24
|
+
} from '../../types/index.js';
|
|
25
25
|
/**
|
|
26
26
|
* The extended definition for endpoints.
|
|
27
27
|
*
|
|
@@ -95,7 +95,7 @@ export type GatewayConfig = {
|
|
|
95
95
|
*/
|
|
96
96
|
url: string;
|
|
97
97
|
/**
|
|
98
|
-
* The dictionary of
|
|
98
|
+
* The dictionary of endpoints the gateway will make available.
|
|
99
99
|
*/
|
|
100
100
|
gateway: GatewayConfigEndpoints;
|
|
101
101
|
};
|
|
@@ -227,7 +227,7 @@ export type GatewayHelperServiceBaseFnOptions = {
|
|
|
227
227
|
*/
|
|
228
228
|
endpoint: GatewayControllerEndpointInfo;
|
|
229
229
|
/**
|
|
230
|
-
* The request
|
|
230
|
+
* The request received by the application.
|
|
231
231
|
*/
|
|
232
232
|
req: Request;
|
|
233
233
|
/**
|
|
@@ -1054,7 +1054,7 @@ export class GatewayController {
|
|
|
1054
1054
|
}
|
|
1055
1055
|
}
|
|
1056
1056
|
/**
|
|
1057
|
-
* A function to generate a list of middlewares that can be executed before the
|
|
1057
|
+
* A function to generate a list of middlewares that can be executed before the controller
|
|
1058
1058
|
* main middleware.
|
|
1059
1059
|
*
|
|
1060
1060
|
* @group Controllers/Gateway
|
|
@@ -1075,7 +1075,7 @@ export type GatewayControllerCreatorOptions =
|
|
|
1075
1075
|
* If this is overwritten, the creator will ensure that the name ends with `Gateway`;
|
|
1076
1076
|
* and if overwritten, but it doesn't include `Gateway` at the end, and no
|
|
1077
1077
|
* `gatewaySettingName` was defined, the creator will use the custom name (without
|
|
1078
|
-
* `
|
|
1078
|
+
* `Gateway`) for `gatewaySettingName`.
|
|
1079
1079
|
*
|
|
1080
1080
|
* @default 'apiGateway'
|
|
1081
1081
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './gateway';
|
|
1
|
+
export * from './gateway.js';
|
package/src/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './app';
|
|
2
|
-
export * from './types';
|
|
3
|
-
export * from './controllers';
|
|
4
|
-
export * from './middlewares';
|
|
5
|
-
export * from './services';
|
|
6
|
-
export * from './utils';
|
|
1
|
+
export * from './app/index.js';
|
|
2
|
+
export * from './types/index.js';
|
|
3
|
+
export * from './controllers/index.js';
|
|
4
|
+
export * from './middlewares/index.js';
|
|
5
|
+
export * from './services/index.js';
|
|
6
|
+
export * from './utils/index.js';
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { deepAssignWithOverwrite } from '@homer0/deep-assign';
|
|
2
|
-
import { middlewareCreator, type Statuses } from '../../utils';
|
|
3
|
-
import type { DeepPartial, Logger, ExpressErrorHandler } from '../../types';
|
|
4
|
-
import {
|
|
2
|
+
import { middlewareCreator, type Statuses } from '../../utils/index.js';
|
|
3
|
+
import type { DeepPartial, Logger, ExpressErrorHandler } from '../../types/index.js';
|
|
4
|
+
import {
|
|
5
|
+
AppError,
|
|
6
|
+
type HTTPErrorClass,
|
|
7
|
+
type ResponsesBuilder,
|
|
8
|
+
} from '../../services/index.js';
|
|
5
9
|
/**
|
|
6
10
|
* The options for the responses the middleware will create.
|
|
7
11
|
*
|
|
@@ -33,7 +37,7 @@ export type ErrorHandlerOptions = {
|
|
|
33
37
|
* if `true`, it will not only show all kind of errors but it will also show the error
|
|
34
38
|
* stack.
|
|
35
39
|
*
|
|
36
|
-
* By "
|
|
40
|
+
* By "unknown errors", it means that are not `AppError` nor `HTTPError`.
|
|
37
41
|
*/
|
|
38
42
|
showErrors: boolean;
|
|
39
43
|
/**
|
|
@@ -81,7 +85,7 @@ export class ErrorHandler {
|
|
|
81
85
|
*/
|
|
82
86
|
protected readonly _responsesBuilder: ResponsesBuilder;
|
|
83
87
|
/**
|
|
84
|
-
* The
|
|
88
|
+
* The utility service to get HTTP status codes.
|
|
85
89
|
*/
|
|
86
90
|
protected readonly _statuses: Statuses;
|
|
87
91
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { middlewareCreator } from '../../utils';
|
|
2
|
-
import { ExpressMiddleware } from '../../types';
|
|
1
|
+
import { middlewareCreator } from '../../utils/index.js';
|
|
2
|
+
import { ExpressMiddleware } from '../../types/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* The customization options for the middleware.
|
|
5
5
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { middlewareCreator } from '../../utils';
|
|
2
|
-
import { ExpressMiddleware } from '../../types';
|
|
1
|
+
import { middlewareCreator } from '../../utils/index.js';
|
|
2
|
+
import { ExpressMiddleware } from '../../types/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* The options to customize the HSTS header value.
|
|
5
5
|
*
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './errorHandler';
|
|
2
|
-
export * from './forceHTTPS';
|
|
3
|
-
export * from './hsts';
|
|
1
|
+
export * from './errorHandler.js';
|
|
2
|
+
export * from './forceHTTPS.js';
|
|
3
|
+
export * from './hsts.js';
|
|
@@ -1,6 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import {
|
|
2
|
+
createRouteExpression,
|
|
3
|
+
middlewareCreator,
|
|
4
|
+
removeSlashes,
|
|
5
|
+
} from '../../utils/index.js';
|
|
6
|
+
import type { HTMLGenerator, SendFile } from '../../services/index.js';
|
|
7
|
+
import type {
|
|
8
|
+
AsyncExpressMiddleware,
|
|
9
|
+
Response,
|
|
10
|
+
NextFunction,
|
|
11
|
+
Events,
|
|
12
|
+
} from '../../types/index.js';
|
|
4
13
|
/**
|
|
5
14
|
* The options to customize the behavior of the middleware.
|
|
6
15
|
*
|
|
@@ -9,7 +18,7 @@ import type { AsyncExpressMiddleware, Response, NextFunction, Events } from '../
|
|
|
9
18
|
export type FastHTMLOptions = {
|
|
10
19
|
/**
|
|
11
20
|
* The name of the file the middleware will serve. If the {@link HTMLGenerator} service
|
|
12
|
-
* is available, it will be
|
|
21
|
+
* is available, it will be overridden by the service.
|
|
13
22
|
*
|
|
14
23
|
* @default 'index.html'
|
|
15
24
|
*/
|
|
@@ -89,7 +98,7 @@ export class FastHTML {
|
|
|
89
98
|
*/
|
|
90
99
|
protected readonly _sendFile: SendFile;
|
|
91
100
|
/**
|
|
92
|
-
* The application
|
|
101
|
+
* The application event bus, to listen and get the list of "controlled routes" after
|
|
93
102
|
* the application is started.
|
|
94
103
|
*/
|
|
95
104
|
protected readonly _events: Events;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './fastHTML';
|
|
2
|
-
export * from './showHTML';
|
|
1
|
+
export * from './fastHTML.js';
|
|
2
|
+
export * from './showHTML.js';
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import { middlewareCreator } from '../../utils';
|
|
2
|
-
import type { HTMLGenerator, SendFile } from '../../services';
|
|
3
|
-
import type {
|
|
1
|
+
import { middlewareCreator } from '../../utils/index.js';
|
|
2
|
+
import type { HTMLGenerator, SendFile } from '../../services/index.js';
|
|
3
|
+
import type {
|
|
4
|
+
AsyncExpressMiddleware,
|
|
5
|
+
Response,
|
|
6
|
+
NextFunction,
|
|
7
|
+
} from '../../types/index.js';
|
|
4
8
|
/**
|
|
5
9
|
* The options to customize the behavior of the middleware.
|
|
6
10
|
*
|
|
@@ -9,7 +13,7 @@ import type { AsyncExpressMiddleware, Response, NextFunction } from '../../types
|
|
|
9
13
|
export type ShowHTMLOptions = {
|
|
10
14
|
/**
|
|
11
15
|
* The name of the file the middleware will serve. If the {@link HTMLGenerator} service
|
|
12
|
-
* is available, it will be
|
|
16
|
+
* is available, it will be overridden by the service.
|
|
13
17
|
*
|
|
14
18
|
* @default 'index.html'
|
|
15
19
|
*/
|
package/src/middlewares/index.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './common';
|
|
2
|
-
export * from './html';
|
|
3
|
-
export * from './utils';
|
|
1
|
+
export * from './common/index.js';
|
|
2
|
+
export * from './html/index.js';
|
|
3
|
+
export * from './utils/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './versionValidator';
|
|
1
|
+
export * from './versionValidator.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { deepAssignWithOverwrite } from '@homer0/deep-assign';
|
|
2
|
-
import { middlewareCreator, type Statuses } from '../../utils';
|
|
3
|
-
import { DeepPartial, Request, ExpressMiddleware } from '../../types';
|
|
4
|
-
import type { HTTPErrorClass, ResponsesBuilder } from '../../services';
|
|
2
|
+
import { middlewareCreator, type Statuses } from '../../utils/index.js';
|
|
3
|
+
import { DeepPartial, Request, ExpressMiddleware } from '../../types/index.js';
|
|
4
|
+
import type { HTTPErrorClass, ResponsesBuilder } from '../../services/index.js';
|
|
5
5
|
/**
|
|
6
6
|
* The options for how the middleware should behave if the requested version is `latest`.
|
|
7
7
|
*
|
|
@@ -30,7 +30,7 @@ export type VersionValidatorLatestOptions = {
|
|
|
30
30
|
*/
|
|
31
31
|
export type VersionValidatorPopupOptions = {
|
|
32
32
|
/**
|
|
33
|
-
* The name of the query string variable the middleware will check in order to
|
|
33
|
+
* The name of the query string variable the middleware will check in order to identify
|
|
34
34
|
* whether the request comes from a popup or not. The variable must have `'true'` as its
|
|
35
35
|
* value.
|
|
36
36
|
*
|
|
@@ -146,7 +146,7 @@ export class VersionValidator {
|
|
|
146
146
|
*/
|
|
147
147
|
protected readonly _responsesBuilder: ResponsesBuilder;
|
|
148
148
|
/**
|
|
149
|
-
* The
|
|
149
|
+
* The utility service to get HTTP status codes.
|
|
150
150
|
*/
|
|
151
151
|
protected readonly _statuses: Statuses;
|
|
152
152
|
/**
|
|
@@ -171,7 +171,7 @@ export class VersionValidator {
|
|
|
171
171
|
popup: {
|
|
172
172
|
variable: 'popup',
|
|
173
173
|
title: 'Conflict',
|
|
174
|
-
message: '
|
|
174
|
+
message: 'version:conflict',
|
|
175
175
|
},
|
|
176
176
|
version,
|
|
177
177
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { provider, statuses as statusesFn, type Statuses } from '../../utils';
|
|
2
|
-
import { AppError, type AppErrorContext } from './appError';
|
|
1
|
+
import { provider, statuses as statusesFn, type Statuses } from '../../utils/index.js';
|
|
2
|
+
import { AppError, type AppErrorContext } from './appError.js';
|
|
3
3
|
/**
|
|
4
4
|
* A type of error to be used on HTTP requests. This is the most common type of error used
|
|
5
5
|
* by Jimpex.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { providers } from '../../utils';
|
|
2
|
-
import { appErrorProvider } from './appError';
|
|
3
|
-
import { httpErrorProvider } from './httpError';
|
|
4
|
-
import { sendFileProvider } from './sendFile';
|
|
1
|
+
import { providers } from '../../utils/index.js';
|
|
2
|
+
import { appErrorProvider } from './appError.js';
|
|
3
|
+
import { httpErrorProvider } from './httpError.js';
|
|
4
|
+
import { sendFileProvider } from './sendFile.js';
|
|
5
5
|
/**
|
|
6
6
|
* Registers all the common services on the container.
|
|
7
7
|
*
|
|
@@ -24,6 +24,6 @@ export const commonServicesProvider = providers({
|
|
|
24
24
|
sendFileProvider,
|
|
25
25
|
});
|
|
26
26
|
|
|
27
|
-
export * from './appError';
|
|
28
|
-
export * from './httpError';
|
|
29
|
-
export * from './sendFile';
|
|
27
|
+
export * from './appError.js';
|
|
28
|
+
export * from './httpError.js';
|
|
29
|
+
export * from './sendFile.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { provider } from '../../utils';
|
|
2
|
-
import type { Response, NextFunction, PathUtils } from '../../types';
|
|
1
|
+
import { provider } from '../../utils/index.js';
|
|
2
|
+
import type { Response, NextFunction, PathUtils } from '../../types/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* The options to create a {@link SendFile} function.
|
|
5
5
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import fs from 'fs/promises';
|
|
2
|
-
import { provider } from '../../utils';
|
|
3
|
-
import type { PathUtils } from '../../types';
|
|
1
|
+
import fs from 'node:fs/promises';
|
|
2
|
+
import { provider } from '../../utils/index.js';
|
|
3
|
+
import type { PathUtils } from '../../types/index.js';
|
|
4
4
|
/**
|
|
5
5
|
* The options to construct a {@link FrontendFs}.
|
|
6
6
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { providers } from '../../utils';
|
|
2
|
-
import { frontendFsProvider } from './frontendFs';
|
|
1
|
+
import { providers } from '../../utils/index.js';
|
|
2
|
+
import { frontendFsProvider } from './frontendFs.js';
|
|
3
3
|
/**
|
|
4
4
|
* Registers all the frontend services on the container.
|
|
5
5
|
*
|
|
@@ -18,4 +18,4 @@ export const frontendServicesProvider = providers({
|
|
|
18
18
|
frontendFsProvider,
|
|
19
19
|
});
|
|
20
20
|
|
|
21
|
-
export * from './frontendFs';
|
|
21
|
+
export * from './frontendFs.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { get } from '@homer0/object-utils';
|
|
2
2
|
import { deepAssignWithOverwrite } from '@homer0/deep-assign';
|
|
3
3
|
import { deferred, type DeferredPromise } from '@homer0/deferred';
|
|
4
|
-
import { providerCreator } from '../../utils';
|
|
5
|
-
import type { Config, Logger } from '../../types';
|
|
6
|
-
import type { FrontendFs } from '../frontend';
|
|
4
|
+
import { providerCreator } from '../../utils/index.js';
|
|
5
|
+
import type { Config, Logger } from '../../types/index.js';
|
|
6
|
+
import type { FrontendFs } from '../frontend/index.js';
|
|
7
7
|
/**
|
|
8
8
|
* The options to customize a {@link HTMLGenerator} instance.
|
|
9
9
|
*
|
|
@@ -29,7 +29,7 @@ export type HTMLGeneratorOptions = {
|
|
|
29
29
|
*/
|
|
30
30
|
silent: boolean;
|
|
31
31
|
/**
|
|
32
|
-
* Whether or not to delete the
|
|
32
|
+
* Whether or not to delete the template after generating the file.
|
|
33
33
|
*
|
|
34
34
|
* @default true
|
|
35
35
|
*/
|
|
@@ -37,7 +37,7 @@ export type HTMLGeneratorOptions = {
|
|
|
37
37
|
/**
|
|
38
38
|
* The placeholder string where the information will be written.
|
|
39
39
|
*
|
|
40
|
-
* @default /\{\{
|
|
40
|
+
* @default /\{\{appConfig(?:uration)?\}\}/
|
|
41
41
|
*/
|
|
42
42
|
replacePlaceholder: string | RegExp;
|
|
43
43
|
/**
|
|
@@ -153,7 +153,7 @@ export class HTMLGenerator {
|
|
|
153
153
|
protected _fileReady: boolean = false;
|
|
154
154
|
/**
|
|
155
155
|
* A deferred promise to return when another service asks if the file has been
|
|
156
|
-
* generated. Once this
|
|
156
|
+
* generated. Once this service finishes generating the file, the promise will be
|
|
157
157
|
* resolved for all implementations that hold a reference to this deferred.
|
|
158
158
|
*/
|
|
159
159
|
protected _fileDeferred?: DeferredPromise<void>;
|
|
@@ -279,13 +279,11 @@ export class HTMLGenerator {
|
|
|
279
279
|
const matches: Array<{ string: string; value: string }> = [];
|
|
280
280
|
let match = placeholderExpression.exec(code);
|
|
281
281
|
while (match) {
|
|
282
|
-
const [string, value] = match;
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
});
|
|
288
|
-
}
|
|
282
|
+
const [string, value] = match as RegExpExecArray;
|
|
283
|
+
matches.push({
|
|
284
|
+
string,
|
|
285
|
+
value: value!,
|
|
286
|
+
});
|
|
289
287
|
|
|
290
288
|
match = placeholderExpression.exec(code);
|
|
291
289
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { providers } from '../../utils';
|
|
2
|
-
import { htmlGeneratorProvider } from './htmlGenerator';
|
|
1
|
+
import { providers } from '../../utils/index.js';
|
|
2
|
+
import { htmlGeneratorProvider } from './htmlGenerator.js';
|
|
3
3
|
/**
|
|
4
4
|
* Registers all the HTML services on the container.
|
|
5
5
|
*
|
|
@@ -18,4 +18,4 @@ export const htmlServicesProvider = providers({
|
|
|
18
18
|
htmlGeneratorProvider,
|
|
19
19
|
});
|
|
20
20
|
|
|
21
|
-
export * from './htmlGenerator';
|
|
21
|
+
export * from './htmlGenerator.js';
|
|
@@ -5,9 +5,9 @@ import {
|
|
|
5
5
|
type FetchClient,
|
|
6
6
|
} from '@homer0/api-utils';
|
|
7
7
|
import { deepAssignWithOverwrite } from '@homer0/deep-assign';
|
|
8
|
-
import { providerCreator } from '../../utils';
|
|
9
|
-
import type { HTTP } from './http';
|
|
10
|
-
import type { HTTPErrorClass } from '../common';
|
|
8
|
+
import { providerCreator } from '../../utils/index.js';
|
|
9
|
+
import type { HTTP } from './http.js';
|
|
10
|
+
import type { HTTPErrorClass } from '../common/index.js';
|
|
11
11
|
|
|
12
12
|
export type { ErrorResponse };
|
|
13
13
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import urijs from 'urijs';
|
|
2
2
|
import type { RequestInit, BodyInit } from 'node-fetch';
|
|
3
3
|
import { deepAssignWithOverwrite } from '@homer0/deep-assign';
|
|
4
|
-
import { provider } from '../../utils';
|
|
5
|
-
import { Logger, Request, HTTPResponse, NodeFetch } from '../../types';
|
|
4
|
+
import { provider } from '../../utils/index.js';
|
|
5
|
+
import { Logger, Request, HTTPResponse, NodeFetch } from '../../types/index.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* The options to customize the service.
|
|
@@ -20,7 +20,7 @@ export type HTTPOptions = {
|
|
|
20
20
|
*
|
|
21
21
|
* @group Services/HTTP
|
|
22
22
|
*/
|
|
23
|
-
export type
|
|
23
|
+
export type HTTPConstructorOptions = Partial<HTTPOptions> & {
|
|
24
24
|
/**
|
|
25
25
|
* A dictionary with the dependencies to inject.
|
|
26
26
|
*/
|
|
@@ -103,7 +103,7 @@ export class HTTP {
|
|
|
103
103
|
/**
|
|
104
104
|
* @param options The options to construct the class.
|
|
105
105
|
*/
|
|
106
|
-
constructor({ inject: { logger, nodeFetch }, ...options }:
|
|
106
|
+
constructor({ inject: { logger, nodeFetch }, ...options }: HTTPConstructorOptions) {
|
|
107
107
|
this._logger = logger;
|
|
108
108
|
this._nodeFetch = nodeFetch;
|
|
109
109
|
this._options = deepAssignWithOverwrite(
|
|
@@ -200,7 +200,7 @@ export class HTTP {
|
|
|
200
200
|
* It takes a dictionary of headers and normalize the names so each word will start with
|
|
201
201
|
* an upper case character. This is helpful in case you added custom headers and didn't
|
|
202
202
|
* care about the casing, or when copying headers from a server request, as they all
|
|
203
|
-
* come
|
|
203
|
+
* come transformed into lower case.
|
|
204
204
|
*
|
|
205
205
|
* @param headers The dictionary of headers to normalize.
|
|
206
206
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { providers } from '../../utils';
|
|
2
|
-
import { apiClientProvider } from './apiClient';
|
|
3
|
-
import { httpProvider } from './http';
|
|
4
|
-
import { responsesBuilderProvider } from './responsesBuilder';
|
|
1
|
+
import { providers } from '../../utils/index.js';
|
|
2
|
+
import { apiClientProvider } from './apiClient.js';
|
|
3
|
+
import { httpProvider } from './http.js';
|
|
4
|
+
import { responsesBuilderProvider } from './responsesBuilder.js';
|
|
5
5
|
/**
|
|
6
6
|
* Registers all the HTTP services on the container.
|
|
7
7
|
*
|
|
@@ -24,6 +24,6 @@ export const httpServicesProvider = providers({
|
|
|
24
24
|
responsesBuilderProvider,
|
|
25
25
|
});
|
|
26
26
|
|
|
27
|
-
export * from './apiClient';
|
|
28
|
-
export * from './http';
|
|
29
|
-
export * from './responsesBuilder';
|
|
27
|
+
export * from './apiClient.js';
|
|
28
|
+
export * from './http.js';
|
|
29
|
+
export * from './responsesBuilder.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Config, Response } from '../../types';
|
|
2
|
-
import { provider, type Statuses } from '../../utils';
|
|
1
|
+
import type { Config, Response } from '../../types/index.js';
|
|
2
|
+
import { provider, type Statuses } from '../../utils/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* The options to construct a {@link ResponsesBuilder}.
|
|
5
5
|
*
|
|
@@ -59,7 +59,7 @@ export type HTMLPostMessageResponseOptions = {
|
|
|
59
59
|
closeDelay?: number;
|
|
60
60
|
};
|
|
61
61
|
/**
|
|
62
|
-
* The options to build a
|
|
62
|
+
* The options to build a response for JSON.
|
|
63
63
|
*
|
|
64
64
|
* @group Services/ResponsesBuilder
|
|
65
65
|
*/
|
|
@@ -99,7 +99,7 @@ export class ResponsesBuilder {
|
|
|
99
99
|
*/
|
|
100
100
|
protected readonly _config: Config;
|
|
101
101
|
/**
|
|
102
|
-
* The
|
|
102
|
+
* The utility service to get HTTP status codes.
|
|
103
103
|
*/
|
|
104
104
|
protected readonly _statuses: Statuses;
|
|
105
105
|
/**
|
|
@@ -215,7 +215,7 @@ export class ResponsesBuilder {
|
|
|
215
215
|
`;
|
|
216
216
|
}
|
|
217
217
|
/**
|
|
218
|
-
* Utility method used to make sure a
|
|
218
|
+
* Utility method used to make sure a received status is a valid status code. If the
|
|
219
219
|
* status is a string, the method will try to find the code from the `statuses` package.
|
|
220
220
|
*
|
|
221
221
|
* @param status The status to normalize.
|
package/src/services/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './common';
|
|
2
|
-
export * from './frontend';
|
|
3
|
-
export * from './html';
|
|
4
|
-
export * from './http';
|
|
5
|
-
export * from './utils';
|
|
1
|
+
export * from './common/index.js';
|
|
2
|
+
export * from './frontend/index.js';
|
|
3
|
+
export * from './html/index.js';
|
|
4
|
+
export * from './http/index.js';
|
|
5
|
+
export * from './utils/index.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { deepAssignWithOverwrite } from '@homer0/deep-assign';
|
|
2
|
-
import { providerCreator, type Statuses } from '../../utils';
|
|
3
|
-
import type { HTTPErrorClass } from '../common';
|
|
4
|
-
import type { DeepPartial, ExpressMiddleware } from '../../types';
|
|
2
|
+
import { providerCreator, type Statuses } from '../../utils/index.js';
|
|
3
|
+
import type { HTTPErrorClass } from '../common/index.js';
|
|
4
|
+
import type { DeepPartial, ExpressMiddleware } from '../../types/index.js';
|
|
5
5
|
/**
|
|
6
|
-
* The options for the error the
|
|
6
|
+
* The options for the error the middleware can generate.
|
|
7
7
|
*
|
|
8
8
|
* @group Services/EnsureBearerToken
|
|
9
9
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { providers } from '../../utils';
|
|
2
|
-
import { ensureBearerTokenProvider } from './ensureBearerToken';
|
|
1
|
+
import { providers } from '../../utils/index.js';
|
|
2
|
+
import { ensureBearerTokenProvider } from './ensureBearerToken.js';
|
|
3
3
|
/**
|
|
4
4
|
* Registers all the utility services on the container.
|
|
5
5
|
*
|
|
@@ -18,4 +18,4 @@ export const utilsServicesProvider = providers({
|
|
|
18
18
|
ensureBearerTokenProvider,
|
|
19
19
|
});
|
|
20
20
|
|
|
21
|
-
export * from './ensureBearerToken';
|
|
21
|
+
export * from './ensureBearerToken.js';
|
package/src/types/events.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Router, ExpressMiddlewareLike } from './express';
|
|
2
|
-
import type { Controller, Middleware } from '../utils';
|
|
3
|
-
import type { Jimpex } from '../app/jimpex';
|
|
1
|
+
import type { Router, ExpressMiddlewareLike } from './express.js';
|
|
2
|
+
import type { Controller, Middleware } from '../utils/index.js';
|
|
3
|
+
import type { Jimpex } from '../app/jimpex.js';
|
|
4
4
|
/**
|
|
5
5
|
* The base payload the events emitted by the application send.
|
|
6
6
|
*
|
|
@@ -145,11 +145,11 @@ export type JimpexEventListener<EventName extends JimpexEventNameLike> =
|
|
|
145
145
|
EventName extends JimpexEventName
|
|
146
146
|
? (payload: JimpexEventPayload<EventName>) => void
|
|
147
147
|
: EventName extends JimpexReducerEventName
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
148
|
+
? (
|
|
149
|
+
target: JimpexReducerEventTarget<EventName>,
|
|
150
|
+
payload: JimpexReducerEventPayload<EventName>,
|
|
151
|
+
) => JimpexReducerEventTarget<EventName>
|
|
152
|
+
: never;
|
|
153
153
|
/**
|
|
154
154
|
* The `events` service Jimpex uses.
|
|
155
155
|
* This is an alternative declaration of the `EventsHub` class that uses the interfaces
|
package/src/types/http.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { Server as HTTPSServer } from 'https';
|
|
|
2
2
|
import type { Server as HTTPServer } from 'http';
|
|
3
3
|
import type { ServerOptions as SpdyServerOptions } from 'spdy';
|
|
4
4
|
import type NodeFetchFn from 'node-fetch';
|
|
5
|
-
import type { Express } from './express';
|
|
5
|
+
import type { Express } from './express.js';
|
|
6
6
|
|
|
7
7
|
export type { Response as HTTPResponse } from 'node-fetch';
|
|
8
8
|
|