@kaapi/kaapi 0.0.2
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/LICENSE +21 -0
- package/README.md +1 -0
- package/lib/app.d.ts +50 -0
- package/lib/app.js +244 -0
- package/lib/app.js.map +1 -0
- package/lib/baseApp.d.ts +23 -0
- package/lib/baseApp.js +23 -0
- package/lib/baseApp.js.map +1 -0
- package/lib/index.d.ts +8 -0
- package/lib/index.js +17 -0
- package/lib/index.js.map +1 -0
- package/lib/services/docs/SwaggerUiGenerator.d.ts +19 -0
- package/lib/services/docs/SwaggerUiGenerator.js +245 -0
- package/lib/services/docs/SwaggerUiGenerator.js.map +1 -0
- package/lib/services/docs/docs.d.ts +41 -0
- package/lib/services/docs/docs.js +77 -0
- package/lib/services/docs/docs.js.map +1 -0
- package/lib/services/docs/generators.d.ts +16 -0
- package/lib/services/docs/generators.js +173 -0
- package/lib/services/docs/generators.js.map +1 -0
- package/lib/services/docs/ui/swagger-ui.d.ts +21 -0
- package/lib/services/docs/ui/swagger-ui.js +321 -0
- package/lib/services/docs/ui/swagger-ui.js.map +1 -0
- package/lib/services/log.d.ts +13 -0
- package/lib/services/log.js +41 -0
- package/lib/services/log.js.map +1 -0
- package/lib/services/messaging.d.ts +17 -0
- package/lib/services/messaging.js +3 -0
- package/lib/services/messaging.js.map +1 -0
- package/package.json +48 -0
- package/types/overrides.d.ts +11 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 demingongo
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# @kaapi/kaapi
|
package/lib/app.d.ts
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { KaapiServer, KaapiServerOptions, KaapiServerRoute } from '@kaapi/server';
|
|
2
|
+
import { IKaapiApp, KaapiBaseApp } from './baseApp';
|
|
3
|
+
import { ILogger } from './services/log';
|
|
4
|
+
import { IMessaging, IMessagingSender, IMessagingSubscribeConfig } from './services/messaging';
|
|
5
|
+
import winston from 'winston';
|
|
6
|
+
import { DocsConfig } from './services/docs/docs';
|
|
7
|
+
import { KaapiOpenAPI, KaapiPostman } from './services/docs/generators';
|
|
8
|
+
import { HandlerDecorations, Lifecycle, ReqRef, ReqRefDefaults } from '@hapi/hapi';
|
|
9
|
+
export interface KaapiAppOptions extends KaapiServerOptions {
|
|
10
|
+
logger?: ILogger;
|
|
11
|
+
loggerOptions?: winston.LoggerOptions;
|
|
12
|
+
messaging?: IMessaging;
|
|
13
|
+
docs?: DocsConfig;
|
|
14
|
+
}
|
|
15
|
+
export declare class Kaapi extends KaapiBaseApp implements IKaapiApp {
|
|
16
|
+
#private;
|
|
17
|
+
readonly log: ILogger;
|
|
18
|
+
protected messaging?: IMessaging;
|
|
19
|
+
protected docs: {
|
|
20
|
+
openapi: KaapiOpenAPI;
|
|
21
|
+
postman: KaapiPostman;
|
|
22
|
+
};
|
|
23
|
+
get openapi(): KaapiOpenAPI;
|
|
24
|
+
get postman(): KaapiPostman;
|
|
25
|
+
constructor(opts?: KaapiAppOptions);
|
|
26
|
+
private _createServer;
|
|
27
|
+
private _startServer;
|
|
28
|
+
/**
|
|
29
|
+
* Initializes and starts the server if needed and returns it
|
|
30
|
+
*/
|
|
31
|
+
server(opts?: KaapiServerOptions): KaapiServer;
|
|
32
|
+
/**
|
|
33
|
+
* Initializes and starts the server if needed and returns it
|
|
34
|
+
*/
|
|
35
|
+
serverAsync(opts?: KaapiServerOptions): Promise<KaapiServer>;
|
|
36
|
+
/**
|
|
37
|
+
* Initializes the server and returns it without starting it
|
|
38
|
+
*/
|
|
39
|
+
idle(opts?: KaapiServerOptions): KaapiServer;
|
|
40
|
+
/**
|
|
41
|
+
* Initializes and starts the server if needed and returns it
|
|
42
|
+
*/
|
|
43
|
+
listen(port?: string | number, host?: string): Promise<KaapiServer>;
|
|
44
|
+
route<Refs extends ReqRef = ReqRefDefaults>(serverRoute: KaapiServerRoute<Refs>, handler: HandlerDecorations | Lifecycle.Method<Refs, Lifecycle.ReturnValue<Refs>>): this;
|
|
45
|
+
refreshDocs(): void;
|
|
46
|
+
emit<T = unknown>(topic: string, message: T): Promise<void>;
|
|
47
|
+
on<T = unknown>(topic: string, handler: (message: T, sender: IMessagingSender) => Promise<void> | void, conf?: IMessagingSubscribeConfig): Promise<void>;
|
|
48
|
+
publish<T = unknown>(topic: string, message: T): Promise<void>;
|
|
49
|
+
subscribe<T = unknown>(topic: string, handler: (message: T, sender: IMessagingSender) => Promise<void> | void, conf?: IMessagingSubscribeConfig): Promise<void>;
|
|
50
|
+
}
|
package/lib/app.js
ADDED
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _Kaapi_defaultServerOpts, _Kaapi_docsDisabled, _Kaapi_docsPath, _Kaapi_docsOptions, _Kaapi_serverStarted;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Kaapi = void 0;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
6
|
+
const server_1 = require("@kaapi/server");
|
|
7
|
+
const baseApp_1 = require("./baseApp");
|
|
8
|
+
const log_1 = require("./services/log");
|
|
9
|
+
const qs_1 = tslib_1.__importDefault(require("qs"));
|
|
10
|
+
const winston_1 = tslib_1.__importDefault(require("winston"));
|
|
11
|
+
const docs_1 = require("./services/docs/docs");
|
|
12
|
+
const generators_1 = require("./services/docs/generators");
|
|
13
|
+
class Kaapi extends baseApp_1.KaapiBaseApp {
|
|
14
|
+
get openapi() {
|
|
15
|
+
return this.docs.openapi;
|
|
16
|
+
}
|
|
17
|
+
get postman() {
|
|
18
|
+
return this.docs.postman;
|
|
19
|
+
}
|
|
20
|
+
constructor(opts) {
|
|
21
|
+
var _a;
|
|
22
|
+
super();
|
|
23
|
+
_Kaapi_defaultServerOpts.set(this, void 0);
|
|
24
|
+
_Kaapi_docsDisabled.set(this, false);
|
|
25
|
+
_Kaapi_docsPath.set(this, '/docs/api');
|
|
26
|
+
_Kaapi_docsOptions.set(this, {});
|
|
27
|
+
_Kaapi_serverStarted.set(this, false);
|
|
28
|
+
const _b = opts || {}, { logger, loggerOptions, messaging, docs } = _b, serverOpts = tslib_1.__rest(_b, ["logger", "loggerOptions", "messaging", "docs"]);
|
|
29
|
+
tslib_1.__classPrivateFieldSet(this, _Kaapi_defaultServerOpts, serverOpts, "f");
|
|
30
|
+
this.log = logger || (0, log_1.createLogger)(Object.assign({ transports: [
|
|
31
|
+
new winston_1.default.transports.Console({
|
|
32
|
+
format: winston_1.default.format.combine(winston_1.default.format.colorize(), winston_1.default.format.splat(), winston_1.default.format.simple()),
|
|
33
|
+
}),
|
|
34
|
+
] }, (loggerOptions || {})));
|
|
35
|
+
this.messaging = messaging;
|
|
36
|
+
if (!this.messaging) {
|
|
37
|
+
this.log.verbose('🙉 No messaging service!');
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
this.log.verbose('💬 Messaging service activated!');
|
|
41
|
+
}
|
|
42
|
+
this.docs = {
|
|
43
|
+
openapi: new generators_1.KaapiOpenAPI(docs === null || docs === void 0 ? void 0 : docs.openAPIOptions),
|
|
44
|
+
postman: new generators_1.KaapiPostman(docs === null || docs === void 0 ? void 0 : docs.postmanOptions)
|
|
45
|
+
};
|
|
46
|
+
if (docs === null || docs === void 0 ? void 0 : docs.disabled) {
|
|
47
|
+
tslib_1.__classPrivateFieldSet(this, _Kaapi_docsDisabled, !!(docs.disabled), "f");
|
|
48
|
+
}
|
|
49
|
+
if (docs === null || docs === void 0 ? void 0 : docs.path) {
|
|
50
|
+
tslib_1.__classPrivateFieldSet(this, _Kaapi_docsPath, docs.path, "f");
|
|
51
|
+
}
|
|
52
|
+
if (docs === null || docs === void 0 ? void 0 : docs.title) {
|
|
53
|
+
this.docs.openapi.setTitle(docs === null || docs === void 0 ? void 0 : docs.title);
|
|
54
|
+
this.docs.postman.setName(docs === null || docs === void 0 ? void 0 : docs.title);
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
this.docs.openapi.setTitle('API documentation');
|
|
58
|
+
this.docs.postman.setName('API documentation');
|
|
59
|
+
}
|
|
60
|
+
if (docs === null || docs === void 0 ? void 0 : docs.consumes) {
|
|
61
|
+
this.docs.openapi.setConsumes(docs === null || docs === void 0 ? void 0 : docs.consumes);
|
|
62
|
+
this.docs.postman.setConsumes(docs === null || docs === void 0 ? void 0 : docs.consumes);
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
this.docs.openapi.setConsumes(['application/json']);
|
|
66
|
+
this.docs.postman.setConsumes(['application/json']);
|
|
67
|
+
}
|
|
68
|
+
if (docs === null || docs === void 0 ? void 0 : docs.license) {
|
|
69
|
+
if (typeof (docs === null || docs === void 0 ? void 0 : docs.license) === 'string')
|
|
70
|
+
this.docs.openapi.setLicense(docs === null || docs === void 0 ? void 0 : docs.license);
|
|
71
|
+
else
|
|
72
|
+
this.docs.openapi.setLicense(docs === null || docs === void 0 ? void 0 : docs.license);
|
|
73
|
+
}
|
|
74
|
+
if (docs === null || docs === void 0 ? void 0 : docs.version) {
|
|
75
|
+
this.docs.openapi.setVersion(docs.version);
|
|
76
|
+
this.docs.postman.setVersion(docs.version);
|
|
77
|
+
}
|
|
78
|
+
if ((_a = docs === null || docs === void 0 ? void 0 : docs.host) === null || _a === void 0 ? void 0 : _a.url) {
|
|
79
|
+
const hostUrl = docs.host.url;
|
|
80
|
+
const regex = /(?<=(?<!\{)\{)[^{}]*(?=\}(?!\}))/g;
|
|
81
|
+
const variables = docs.host.variables;
|
|
82
|
+
this.docs.openapi.setServers(docs.host);
|
|
83
|
+
this.docs.postman.setHost(hostUrl.replace(regex, match => {
|
|
84
|
+
return `{${match}}`;
|
|
85
|
+
}));
|
|
86
|
+
if (variables && Object.keys(variables).length) {
|
|
87
|
+
Object.keys(variables).forEach(varName => {
|
|
88
|
+
this.docs.postman.addVariable({
|
|
89
|
+
description: variables[varName].description,
|
|
90
|
+
key: varName,
|
|
91
|
+
name: varName,
|
|
92
|
+
value: variables[varName].default
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
if (docs === null || docs === void 0 ? void 0 : docs.security) {
|
|
98
|
+
this.docs.openapi.addSecurityScheme(docs === null || docs === void 0 ? void 0 : docs.security)
|
|
99
|
+
.setDefaultSecurity(docs === null || docs === void 0 ? void 0 : docs.security);
|
|
100
|
+
this.docs.postman.setDefaultSecurity(docs === null || docs === void 0 ? void 0 : docs.security);
|
|
101
|
+
}
|
|
102
|
+
if (docs === null || docs === void 0 ? void 0 : docs.examples) {
|
|
103
|
+
this.docs.openapi.setExamples(docs.examples);
|
|
104
|
+
}
|
|
105
|
+
if (docs === null || docs === void 0 ? void 0 : docs.schemas) {
|
|
106
|
+
this.docs.openapi.setSchemas(docs.schemas);
|
|
107
|
+
}
|
|
108
|
+
if (docs === null || docs === void 0 ? void 0 : docs.responses) {
|
|
109
|
+
this.docs.openapi.setResponses(docs === null || docs === void 0 ? void 0 : docs.responses);
|
|
110
|
+
}
|
|
111
|
+
if (docs === null || docs === void 0 ? void 0 : docs.tags) {
|
|
112
|
+
for (const tag of docs.tags) {
|
|
113
|
+
this.docs.openapi.addTag({
|
|
114
|
+
name: tag.name,
|
|
115
|
+
description: tag.description,
|
|
116
|
+
externalDocs: tag.externalDocs
|
|
117
|
+
});
|
|
118
|
+
this.docs.postman.addFolder({
|
|
119
|
+
item: [],
|
|
120
|
+
auth: tag.auth,
|
|
121
|
+
description: tag.description,
|
|
122
|
+
event: tag.event,
|
|
123
|
+
name: tag.name,
|
|
124
|
+
protocolProfileBehavior: tag.protocolProfileBehavior,
|
|
125
|
+
variable: tag.variable
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
if (docs === null || docs === void 0 ? void 0 : docs.options) {
|
|
130
|
+
tslib_1.__classPrivateFieldSet(this, _Kaapi_docsOptions, docs.options, "f");
|
|
131
|
+
}
|
|
132
|
+
if (!tslib_1.__classPrivateFieldGet(this, _Kaapi_docsDisabled, "f")) {
|
|
133
|
+
const [route, handler] = (0, docs_1.createDocsRouter)(tslib_1.__classPrivateFieldGet(this, _Kaapi_docsPath, "f"), this.docs, tslib_1.__classPrivateFieldGet(this, _Kaapi_docsOptions, "f"));
|
|
134
|
+
this.server().route(route, handler);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
_createServer(opts = {}) {
|
|
138
|
+
return new server_1.KaapiServer(Object.assign(Object.assign(Object.assign({}, (tslib_1.__classPrivateFieldGet(this, _Kaapi_defaultServerOpts, "f") || {})), { query: {
|
|
139
|
+
parser: (query) => qs_1.default.parse(query)
|
|
140
|
+
} }), opts));
|
|
141
|
+
}
|
|
142
|
+
_startServer() {
|
|
143
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
144
|
+
var _a, _b, _c, _d, _e;
|
|
145
|
+
tslib_1.__classPrivateFieldSet(this, _Kaapi_serverStarted, true, "f");
|
|
146
|
+
yield ((_a = this.kaapiServer) === null || _a === void 0 ? void 0 : _a.server.start());
|
|
147
|
+
this.log.verbose('📢 Server listening on %s', (_b = this.kaapiServer) === null || _b === void 0 ? void 0 : _b.server.info.uri);
|
|
148
|
+
this.log.verbose(`${(_c = this.kaapiServer) === null || _c === void 0 ? void 0 : _c.server.info.id} ${((_d = this.kaapiServer) === null || _d === void 0 ? void 0 : _d.server.info.started) ? new Date(this.kaapiServer.server.info.started) : (_e = this.kaapiServer) === null || _e === void 0 ? void 0 : _e.server.info.started}`);
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Initializes and starts the server if needed and returns it
|
|
153
|
+
*/
|
|
154
|
+
server(opts) {
|
|
155
|
+
if (!this.kaapiServer) {
|
|
156
|
+
this.kaapiServer = this._createServer(opts);
|
|
157
|
+
}
|
|
158
|
+
if (!tslib_1.__classPrivateFieldGet(this, _Kaapi_serverStarted, "f")) {
|
|
159
|
+
this._startServer();
|
|
160
|
+
}
|
|
161
|
+
return this.kaapiServer;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Initializes and starts the server if needed and returns it
|
|
165
|
+
*/
|
|
166
|
+
serverAsync(opts) {
|
|
167
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
168
|
+
if (!this.kaapiServer) {
|
|
169
|
+
this.kaapiServer = this._createServer(opts);
|
|
170
|
+
}
|
|
171
|
+
if (!tslib_1.__classPrivateFieldGet(this, _Kaapi_serverStarted, "f")) {
|
|
172
|
+
yield this._startServer();
|
|
173
|
+
}
|
|
174
|
+
return this.kaapiServer;
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Initializes the server and returns it without starting it
|
|
179
|
+
*/
|
|
180
|
+
idle(opts) {
|
|
181
|
+
if (!this.kaapiServer) {
|
|
182
|
+
this.kaapiServer = this._createServer(opts);
|
|
183
|
+
}
|
|
184
|
+
return this.kaapiServer;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Initializes and starts the server if needed and returns it
|
|
188
|
+
*/
|
|
189
|
+
listen(port, host) {
|
|
190
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
191
|
+
let r = this.kaapiServer;
|
|
192
|
+
if (!r) {
|
|
193
|
+
const opts = {
|
|
194
|
+
port,
|
|
195
|
+
host
|
|
196
|
+
};
|
|
197
|
+
r = yield this.serverAsync(opts);
|
|
198
|
+
}
|
|
199
|
+
return r;
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
route(serverRoute, handler) {
|
|
203
|
+
this.docs.openapi.addRoutes(serverRoute);
|
|
204
|
+
this.docs.postman.addRoutes(serverRoute);
|
|
205
|
+
return super.route(serverRoute, handler);
|
|
206
|
+
}
|
|
207
|
+
refreshDocs() {
|
|
208
|
+
if (!this.kaapiServer)
|
|
209
|
+
return;
|
|
210
|
+
this.docs.openapi.removeAll();
|
|
211
|
+
this.docs.postman.removeAll();
|
|
212
|
+
this.kaapiServer.server.table().forEach(v => {
|
|
213
|
+
this.docs.openapi.addRequestRoute(v);
|
|
214
|
+
this.docs.postman.addRequestRoute(v);
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
emit(topic, message) {
|
|
218
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
219
|
+
var _a;
|
|
220
|
+
return yield ((_a = this.messaging) === null || _a === void 0 ? void 0 : _a.publish(topic, message));
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
on(topic, handler, conf) {
|
|
224
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
225
|
+
var _a;
|
|
226
|
+
return yield ((_a = this.messaging) === null || _a === void 0 ? void 0 : _a.subscribe(topic, handler, conf));
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
publish(topic, message) {
|
|
230
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
231
|
+
var _a;
|
|
232
|
+
return yield ((_a = this.messaging) === null || _a === void 0 ? void 0 : _a.publish(topic, message));
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
subscribe(topic, handler, conf) {
|
|
236
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
237
|
+
var _a;
|
|
238
|
+
return yield ((_a = this.messaging) === null || _a === void 0 ? void 0 : _a.subscribe(topic, handler, conf));
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
exports.Kaapi = Kaapi;
|
|
243
|
+
_Kaapi_defaultServerOpts = new WeakMap(), _Kaapi_docsDisabled = new WeakMap(), _Kaapi_docsPath = new WeakMap(), _Kaapi_docsOptions = new WeakMap(), _Kaapi_serverStarted = new WeakMap();
|
|
244
|
+
//# sourceMappingURL=app.js.map
|
package/lib/app.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.js","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":";;;;;AAAA,0CAAkF;AAClF,uCAAoD;AACpD,wCAAuD;AAEvD,oDAAmB;AACnB,8DAA8B;AAC9B,+CAAiF;AACjF,2DAAwE;AAUxE,MAAa,KAAM,SAAQ,sBAAY;IAOnC,IAAI,OAAO;QACP,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAA;IAC5B,CAAC;IAED,IAAI,OAAO;QACP,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAA;IAC5B,CAAC;IAYD,YAAY,IAAsB;;QAC9B,KAAK,EAAE,CAAA;QAXX,2CAAuC;QAEvC,8BAAyB,KAAK,EAAA;QAE9B,0BAAoB,WAAW,EAAA;QAE/B,6BA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C,CAAC,EAAE;YACA,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;YACrC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;QACzC,CAAC,CACJ,CAAA;IACL,CAAC;IAEK,IAAI,CAAc,KAAa,EAAE,OAAU;;;YAC7C,OAAO,MAAM,CAAA,MAAA,IAAI,CAAC,SAAS,0CAAE,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA,CAAA;QACxD,CAAC;KAAA;IACK,EAAE,CAAc,KAAa,EAAE,OAAuE,EAAE,IAAgC;;;YAC1I,OAAO,MAAM,CAAA,MAAA,IAAI,CAAC,SAAS,0CAAE,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,CAAA,CAAA;QAChE,CAAC;KAAA;IACK,OAAO,CAAc,KAAa,EAAE,OAAU;;;YAChD,OAAO,MAAM,CAAA,MAAA,IAAI,CAAC,SAAS,0CAAE,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA,CAAA;QACxD,CAAC;KAAA;IACK,SAAS,CAAc,KAAa,EAAE,OAAuE,EAAE,IAAgC;;;YACjJ,OAAO,MAAM,CAAA,MAAA,IAAI,CAAC,SAAS,0CAAE,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,CAAA,CAAA;QAChE,CAAC;KAAA;CACJ;AA/QD,sBA+QC"}
|
package/lib/baseApp.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { HandlerDecorations, Lifecycle, ReqRef, ReqRefDefaults } from '@hapi/hapi';
|
|
2
|
+
import { KaapiServerRoute, KaapiServer, KaapiServerOptions } from '@kaapi/server';
|
|
3
|
+
import { ILogger } from './services/log';
|
|
4
|
+
import { IMessaging, IMessagingSender, IMessagingSubscribeConfig, IPublishMethod, ISubscribeMethod } from './services/messaging';
|
|
5
|
+
export interface IKaapiApp extends IMessaging {
|
|
6
|
+
log: ILogger;
|
|
7
|
+
emit: IPublishMethod;
|
|
8
|
+
on: ISubscribeMethod;
|
|
9
|
+
server(): KaapiServer;
|
|
10
|
+
route<Refs extends ReqRef = ReqRefDefaults>(serverRoute: KaapiServerRoute<Refs>, handler: HandlerDecorations | Lifecycle.Method<Refs, Lifecycle.ReturnValue<Refs>>): this;
|
|
11
|
+
}
|
|
12
|
+
export declare abstract class KaapiBaseApp implements IKaapiApp {
|
|
13
|
+
abstract log: ILogger;
|
|
14
|
+
abstract emit<T = unknown>(topic: string, message: T): Promise<void>;
|
|
15
|
+
abstract on<T = unknown>(topic: string, handler: (message: T, sender: IMessagingSender) => void | Promise<void>, conf?: IMessagingSubscribeConfig | undefined): Promise<void>;
|
|
16
|
+
abstract publish<T = unknown>(topic: string, message: T): Promise<void>;
|
|
17
|
+
abstract subscribe<T = unknown>(topic: string, handler: (message: T, sender: IMessagingSender) => void | Promise<void>, conf?: IMessagingSubscribeConfig | undefined): Promise<void>;
|
|
18
|
+
abstract server(opts?: KaapiServerOptions): KaapiServer;
|
|
19
|
+
protected version?: string;
|
|
20
|
+
protected kaapiServer?: KaapiServer;
|
|
21
|
+
route<Refs extends ReqRef = ReqRefDefaults>(serverRoute: KaapiServerRoute<Refs>, handler: HandlerDecorations | Lifecycle.Method<Refs, Lifecycle.ReturnValue<Refs>>): this;
|
|
22
|
+
toString(): string;
|
|
23
|
+
}
|
package/lib/baseApp.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.KaapiBaseApp = void 0;
|
|
4
|
+
class KaapiBaseApp {
|
|
5
|
+
route(serverRoute, handler) {
|
|
6
|
+
this.server().route(serverRoute, handler);
|
|
7
|
+
return this;
|
|
8
|
+
}
|
|
9
|
+
toString() {
|
|
10
|
+
var _a, _b, _c;
|
|
11
|
+
let result = `${this.version} || 0.0.0`;
|
|
12
|
+
if (this.kaapiServer) {
|
|
13
|
+
result += `, server: ${(_a = this.kaapiServer) === null || _a === void 0 ? void 0 : _a.server.info.uri}, `;
|
|
14
|
+
result += `state: ${((_b = this.kaapiServer) === null || _b === void 0 ? void 0 : _b.server.info.started) ? new Date((_c = this.kaapiServer) === null || _c === void 0 ? void 0 : _c.server.info.started) : 'STOPPED'}`;
|
|
15
|
+
}
|
|
16
|
+
return result;
|
|
17
|
+
}
|
|
18
|
+
[Symbol.for('nodejs.util.inspect.custom')]() {
|
|
19
|
+
return `${this.constructor.name} <${this.toString()}>`;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.KaapiBaseApp = KaapiBaseApp;
|
|
23
|
+
//# sourceMappingURL=baseApp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"baseApp.js","sourceRoot":"","sources":["../src/baseApp.ts"],"names":[],"mappings":";;;AAoBA,MAAsB,YAAY;IAY9B,KAAK,CACD,WAAmC,EACnC,OAAiF;QACjF,IAAI,CAAC,MAAM,EAAE,CAAC,KAAK,CAAO,WAAW,EAAE,OAAO,CAAC,CAAA;QAC/C,OAAO,IAAI,CAAA;IACf,CAAC;IAED,QAAQ;;QACJ,IAAI,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,WAAW,CAAA;QACvC,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YACnB,MAAM,IAAI,aAAa,MAAA,IAAI,CAAC,WAAW,0CAAE,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;YAC5D,MAAM,IAAI,UAAU,CAAA,MAAA,IAAI,CAAC,WAAW,0CAAE,MAAM,CAAC,IAAI,CAAC,OAAO,EAAC,CAAC,CAAC,IAAI,IAAI,CAAC,MAAA,IAAI,CAAC,WAAW,0CAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,CAAA;QAC7H,CAAC;QACD,OAAO,MAAM,CAAA;IACjB,CAAC;IAED,CAAC,MAAM,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;QACtC,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,KAAK,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC;IAC3D,CAAC;CACJ;AA/BD,oCA+BC"}
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import '../types/overrides.d.ts'
|
|
2
|
+
export { LoggerOptions, Logger, Container, ExceptionHandler, Profiler, RejectionHandler, LeveledLogMethod, LogEntry, LogMethod, QueryOptions } from 'winston';
|
|
3
|
+
export * from '@hapi/hapi';
|
|
4
|
+
export * from '@kaapi/server';
|
|
5
|
+
export * from './services/log';
|
|
6
|
+
export * from './services/messaging';
|
|
7
|
+
export * from './baseApp';
|
|
8
|
+
export * from './app';
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RejectionHandler = exports.Profiler = exports.ExceptionHandler = exports.Container = exports.Logger = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
var winston_1 = require("winston");
|
|
6
|
+
Object.defineProperty(exports, "Logger", { enumerable: true, get: function () { return winston_1.Logger; } });
|
|
7
|
+
Object.defineProperty(exports, "Container", { enumerable: true, get: function () { return winston_1.Container; } });
|
|
8
|
+
Object.defineProperty(exports, "ExceptionHandler", { enumerable: true, get: function () { return winston_1.ExceptionHandler; } });
|
|
9
|
+
Object.defineProperty(exports, "Profiler", { enumerable: true, get: function () { return winston_1.Profiler; } });
|
|
10
|
+
Object.defineProperty(exports, "RejectionHandler", { enumerable: true, get: function () { return winston_1.RejectionHandler; } });
|
|
11
|
+
tslib_1.__exportStar(require("@hapi/hapi"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("@kaapi/server"), exports);
|
|
13
|
+
tslib_1.__exportStar(require("./services/log"), exports);
|
|
14
|
+
tslib_1.__exportStar(require("./services/messaging"), exports);
|
|
15
|
+
tslib_1.__exportStar(require("./baseApp"), exports);
|
|
16
|
+
tslib_1.__exportStar(require("./app"), exports);
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,mCAWgB;AATZ,iGAAA,MAAM,OAAA;AACN,oGAAA,SAAS,OAAA;AACT,2GAAA,gBAAgB,OAAA;AAChB,mGAAA,QAAQ,OAAA;AACR,2GAAA,gBAAgB,OAAA;AAMpB,qDAA0B;AAC1B,wDAA6B;AAC7B,yDAA8B;AAC9B,+DAAoC;AACpC,oDAAyB;AACzB,gDAAqB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface SwaggerUiOptions {
|
|
2
|
+
swaggerOptions?: any;
|
|
3
|
+
customCss?: string | string[];
|
|
4
|
+
customJs?: string | string[];
|
|
5
|
+
customJsStr?: string | string[];
|
|
6
|
+
customfavIcon?: string;
|
|
7
|
+
customRobots?: string;
|
|
8
|
+
swaggerUrl?: any;
|
|
9
|
+
swaggerUrls?: any;
|
|
10
|
+
explorer?: boolean;
|
|
11
|
+
customSiteTitle?: string;
|
|
12
|
+
customCssUrl?: string | string[];
|
|
13
|
+
}
|
|
14
|
+
export declare class SwaggerUiGenerator {
|
|
15
|
+
#private;
|
|
16
|
+
get swaggerInit(): string;
|
|
17
|
+
getAbsoluteSwaggerFsPath(): string;
|
|
18
|
+
generateHTML(swaggerDoc: any, opts: any, options?: any, customCss?: any, customfavIcon?: any, swaggerUrl?: any, customSiteTitle?: any, _htmlTplString?: any, _jsTplString?: any): any;
|
|
19
|
+
}
|