@gennext/lb-infra 0.0.6 → 0.0.7
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/base/base.helper.d.ts +1 -1
- package/dist/base/base.helper.js +2 -2
- package/dist/base/base.helper.js.map +1 -1
- package/dist/base/datasources/base.datasource.d.ts +4 -4
- package/dist/base/index.d.ts +3 -3
- package/dist/base/loopback/@lb/auth/index.d.ts +2 -2
- package/dist/base/loopback/@lb/core/index.d.ts +6 -6
- package/dist/base/loopback/@lb/repository/index.d.ts +1 -1
- package/dist/base/loopback/@lb/rest/index.d.ts +2 -2
- package/dist/base/loopback/authentication/index.d.ts +4 -4
- package/dist/base/loopback/authorization/index.d.ts +2 -2
- package/dist/base/loopback/boot/index.d.ts +2 -2
- package/dist/base/loopback/core/index.d.ts +2 -2
- package/dist/base/loopback/health-check/index.d.ts +2 -2
- package/dist/base/loopback/metadata/index.d.ts +2 -2
- package/dist/base/loopback/openapi-v3/index.d.ts +2 -2
- package/dist/base/loopback/repository/index.d.ts +2 -2
- package/dist/base/loopback/rest/index.d.ts +6 -6
- package/dist/base/loopback/security/index.d.ts +2 -2
- package/dist/base/loopback/service-proxy/index.d.ts +2 -2
- package/dist/base/models/base.model.d.ts +1 -1
- package/dist/base/models/base.model.js +3 -3
- package/dist/base/models/index.d.ts +1 -1
- package/dist/common/constants.d.ts.map +1 -1
- package/dist/common/constants.js +19 -19
- package/dist/common/constants.js.map +1 -1
- package/dist/common/index.d.ts +3 -3
- package/dist/common/types.d.ts +20 -20
- package/dist/common/types.d.ts.map +1 -1
- package/dist/datasources/index.d.ts +2 -2
- package/dist/datasources/postgres/datasource.d.ts +2 -2
- package/dist/datasources/postgres/datasource.js +10 -10
- package/dist/datasources/postgres/index.d.ts +2 -2
- package/dist/datasources/postgres/types.d.ts +2 -2
- package/dist/datasources/redis/connector.d.ts +4 -4
- package/dist/datasources/redis/connector.d.ts.map +1 -1
- package/dist/datasources/redis/connector.js +13 -13
- package/dist/datasources/redis/connector.js.map +1 -1
- package/dist/datasources/redis/datasource.d.ts +3 -3
- package/dist/datasources/redis/datasource.js +6 -6
- package/dist/datasources/redis/index.d.ts +3 -3
- package/dist/datasources/redis/types.d.ts +3 -3
- package/dist/datasources/redis/types.d.ts.map +1 -1
- package/dist/helpers/index.d.ts +2 -2
- package/dist/helpers/logger/application-logger.d.ts +2 -2
- package/dist/helpers/logger/application-logger.d.ts.map +1 -1
- package/dist/helpers/logger/application-logger.js +13 -15
- package/dist/helpers/logger/application-logger.js.map +1 -1
- package/dist/helpers/logger/common/index.d.ts +1 -1
- package/dist/helpers/logger/common/types.d.ts +1 -1
- package/dist/helpers/logger/common/types.js +9 -9
- package/dist/helpers/logger/default-logger.d.ts +3 -3
- package/dist/helpers/logger/default-logger.d.ts.map +1 -1
- package/dist/helpers/logger/default-logger.js +23 -23
- package/dist/helpers/logger/default-logger.js.map +1 -1
- package/dist/helpers/logger/enhanced-factory.d.ts +3 -3
- package/dist/helpers/logger/enhanced-factory.d.ts.map +1 -1
- package/dist/helpers/logger/enhanced-factory.js +4 -4
- package/dist/helpers/logger/enhanced-factory.js.map +1 -1
- package/dist/helpers/logger/factory.d.ts +3 -3
- package/dist/helpers/logger/factory.d.ts.map +1 -1
- package/dist/helpers/logger/factory.js +1 -1
- package/dist/helpers/logger/factory.js.map +1 -1
- package/dist/helpers/logger/http/access-logger.d.ts +3 -3
- package/dist/helpers/logger/http/access-logger.d.ts.map +1 -1
- package/dist/helpers/logger/http/access-logger.js +21 -26
- package/dist/helpers/logger/http/access-logger.js.map +1 -1
- package/dist/helpers/logger/http/client-ip.d.ts.map +1 -1
- package/dist/helpers/logger/http/client-ip.js +6 -3
- package/dist/helpers/logger/http/client-ip.js.map +1 -1
- package/dist/helpers/logger/http/data-masking.d.ts +1 -1
- package/dist/helpers/logger/http/data-masking.d.ts.map +1 -1
- package/dist/helpers/logger/http/data-masking.js +14 -21
- package/dist/helpers/logger/http/data-masking.js.map +1 -1
- package/dist/helpers/logger/http/index.d.ts +5 -5
- package/dist/helpers/logger/http/request-context.d.ts +1 -1
- package/dist/helpers/logger/http/request-context.d.ts.map +1 -1
- package/dist/helpers/logger/http/request-context.js +6 -1
- package/dist/helpers/logger/http/request-context.js.map +1 -1
- package/dist/helpers/logger/http/types.d.ts +1 -1
- package/dist/helpers/logger/index.d.ts +6 -6
- package/dist/helpers/logger/transports/index.d.ts +1 -1
- package/dist/helpers/redis/default.helper.d.ts +3 -3
- package/dist/helpers/redis/default.helper.d.ts.map +1 -1
- package/dist/helpers/redis/default.helper.js +44 -44
- package/dist/helpers/redis/default.helper.js.map +1 -1
- package/dist/helpers/redis/index.d.ts +4 -4
- package/dist/helpers/redis/redis-cluster.helper.d.ts +3 -3
- package/dist/helpers/redis/redis-cluster.helper.js +1 -1
- package/dist/helpers/redis/redis-cluster.helper.js.map +1 -1
- package/dist/helpers/redis/redis.helper.d.ts +3 -3
- package/dist/helpers/redis/redis.helper.d.ts.map +1 -1
- package/dist/helpers/redis/redis.helper.js.map +1 -1
- package/dist/helpers/redis/types.d.ts +3 -3
- package/dist/helpers/redis/types.d.ts.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/utilities/crypto.utility.d.ts +1 -1
- package/dist/utilities/crypto.utility.js +2 -2
- package/dist/utilities/date.utility.d.ts +1 -1
- package/dist/utilities/date.utility.js +7 -7
- package/dist/utilities/date.utility.js.map +1 -1
- package/dist/utilities/error.utility.d.ts.map +1 -1
- package/dist/utilities/error.utility.js.map +1 -1
- package/dist/utilities/index.d.ts +11 -11
- package/dist/utilities/model.utility.d.ts +2 -2
- package/dist/utilities/model.utility.d.ts.map +1 -1
- package/dist/utilities/model.utility.js +4 -4
- package/dist/utilities/model.utility.js.map +1 -1
- package/dist/utilities/module.utility.d.ts.map +1 -1
- package/dist/utilities/module.utility.js +2 -2
- package/dist/utilities/module.utility.js.map +1 -1
- package/dist/utilities/parse.utility.d.ts.map +1 -1
- package/dist/utilities/parse.utility.js +20 -20
- package/dist/utilities/parse.utility.js.map +1 -1
- package/dist/utilities/performance.utility.d.ts.map +1 -1
- package/dist/utilities/performance.utility.js.map +1 -1
- package/dist/utilities/promise.utility.d.ts +1 -1
- package/dist/utilities/promise.utility.js +1 -1
- package/dist/utilities/promise.utility.js.map +1 -1
- package/dist/utilities/query.utility.d.ts +2 -2
- package/dist/utilities/query.utility.d.ts.map +1 -1
- package/dist/utilities/query.utility.js +19 -19
- package/dist/utilities/query.utility.js.map +1 -1
- package/dist/utilities/request.utility.d.ts +3 -3
- package/dist/utilities/request.utility.d.ts.map +1 -1
- package/dist/utilities/request.utility.js +3 -3
- package/dist/utilities/request.utility.js.map +1 -1
- package/dist/utilities/url.utility.js +2 -2
- package/package.json +4 -2
package/dist/base/base.helper.js
CHANGED
|
@@ -4,8 +4,8 @@ exports.BaseHelper = void 0;
|
|
|
4
4
|
const helpers_1 = require("../helpers");
|
|
5
5
|
class BaseHelper {
|
|
6
6
|
constructor(opts) {
|
|
7
|
-
this.logger = helpers_1.LoggerFactory.getLogger([opts.scope, opts.identifier ??
|
|
8
|
-
this.identifier = opts.identifier ??
|
|
7
|
+
this.logger = helpers_1.LoggerFactory.getLogger([opts.scope, opts.identifier ?? ''].filter(el => el && el.length > 0));
|
|
8
|
+
this.identifier = opts.identifier ?? '';
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
exports.BaseHelper = BaseHelper;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.helper.js","sourceRoot":"","sources":["../../src/base/base.helper.ts"],"names":[],"mappings":";;;AAAA,uCAA6D;AAE7D,MAAa,UAAU;IAIrB,YAAY,IAA4C;QACtD,IAAI,CAAC,MAAM,GAAG,uBAAa,CAAC,SAAS,CACnC,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"base.helper.js","sourceRoot":"","sources":["../../src/base/base.helper.ts"],"names":[],"mappings":";;;AAAA,uCAA6D;AAE7D,MAAa,UAAU;IAIrB,YAAY,IAA4C;QACtD,IAAI,CAAC,MAAM,GAAG,uBAAa,CAAC,SAAS,CACnC,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CACtE,CAAC;QACF,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,IAAI,EAAE,CAAC;IAC1C,CAAC;CACF;AAVD,gCAUC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ValueOrPromise } from
|
|
2
|
-
import { ApplicationLogger } from
|
|
3
|
-
import { Connector, JugglerDataSource } from
|
|
4
|
-
import { IDataSourceOptions } from
|
|
1
|
+
import { ValueOrPromise } from '../../common';
|
|
2
|
+
import { ApplicationLogger } from '../../helpers';
|
|
3
|
+
import { Connector, JugglerDataSource } from '@loopback/repository';
|
|
4
|
+
import { IDataSourceOptions } from './types';
|
|
5
5
|
export declare class BaseDataSource<S extends IDataSourceOptions = IDataSourceOptions, C extends Connector = Connector> extends JugglerDataSource {
|
|
6
6
|
protected logger: ApplicationLogger;
|
|
7
7
|
constructor(opts: {
|
package/dist/base/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
1
|
+
export * from './datasources';
|
|
2
|
+
export * from './models';
|
|
3
|
+
export * from './base.helper';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
1
|
+
export * from './../../authentication';
|
|
2
|
+
export * from './../../authorization';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
1
|
+
export * from './../../boot';
|
|
2
|
+
export * from './../../core';
|
|
3
|
+
export * from './../../health-check';
|
|
4
|
+
export * from './../../metadata';
|
|
5
|
+
export * from './../../security';
|
|
6
|
+
export * from './../../service-proxy';
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from './../../repository';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
1
|
+
export * from './../../rest';
|
|
2
|
+
export * from './../../openapi-v3';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export type * from
|
|
3
|
-
export * from
|
|
4
|
-
export type * from
|
|
1
|
+
export * from '@loopback/authentication';
|
|
2
|
+
export type * from '@loopback/authentication';
|
|
3
|
+
export * from '@loopback/authentication-jwt';
|
|
4
|
+
export type * from '@loopback/authentication-jwt';
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export type * from
|
|
1
|
+
export * from '@loopback/authorization';
|
|
2
|
+
export type * from '@loopback/authorization';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export type * from
|
|
1
|
+
export * from '@loopback/boot';
|
|
2
|
+
export type * from '@loopback/boot';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export type * from
|
|
1
|
+
export * from '@loopback/core';
|
|
2
|
+
export type * from '@loopback/core';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export type * from
|
|
1
|
+
export * from '@loopback/health';
|
|
2
|
+
export type * from '@loopback/health';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export type * from
|
|
1
|
+
export * from '@loopback/metadata';
|
|
2
|
+
export type * from '@loopback/metadata';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export type * from
|
|
1
|
+
export * from '@loopback/openapi-v3';
|
|
2
|
+
export type * from '@loopback/openapi-v3';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export type * from
|
|
1
|
+
export * from '@loopback/repository';
|
|
2
|
+
export type * from '@loopback/repository';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export type * from
|
|
3
|
-
export * from
|
|
4
|
-
export type * from
|
|
5
|
-
export * from
|
|
6
|
-
export type * from
|
|
1
|
+
export * from '@loopback/rest';
|
|
2
|
+
export type * from '@loopback/rest';
|
|
3
|
+
export * from '@loopback/rest-crud';
|
|
4
|
+
export type * from '@loopback/rest-crud';
|
|
5
|
+
export * from '@loopback/rest-explorer';
|
|
6
|
+
export type * from '@loopback/rest-explorer';
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export type * from
|
|
1
|
+
export * from '@loopback/security';
|
|
2
|
+
export type * from '@loopback/security';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export type * from
|
|
1
|
+
export * from '@loopback/service-proxy';
|
|
2
|
+
export type * from '@loopback/service-proxy';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -20,7 +20,7 @@ class BaseKVEntity extends BaseEntity {
|
|
|
20
20
|
}
|
|
21
21
|
exports.BaseKVEntity = BaseKVEntity;
|
|
22
22
|
__decorate([
|
|
23
|
-
(0, repository_1.property)({ type:
|
|
23
|
+
(0, repository_1.property)({ type: 'object' }),
|
|
24
24
|
__metadata("design:type", Object)
|
|
25
25
|
], BaseKVEntity.prototype, "payload", void 0);
|
|
26
26
|
// ---------------------------------------------------------------------
|
|
@@ -28,14 +28,14 @@ class BaseNumberIdEntity extends BaseEntity {
|
|
|
28
28
|
}
|
|
29
29
|
exports.BaseNumberIdEntity = BaseNumberIdEntity;
|
|
30
30
|
__decorate([
|
|
31
|
-
(0, repository_1.property)({ type:
|
|
31
|
+
(0, repository_1.property)({ type: 'number', id: true, generated: true }),
|
|
32
32
|
__metadata("design:type", Number)
|
|
33
33
|
], BaseNumberIdEntity.prototype, "id", void 0);
|
|
34
34
|
class BaseStringIdEntity extends BaseEntity {
|
|
35
35
|
}
|
|
36
36
|
exports.BaseStringIdEntity = BaseStringIdEntity;
|
|
37
37
|
__decorate([
|
|
38
|
-
(0, repository_1.property)({ type:
|
|
38
|
+
(0, repository_1.property)({ type: 'string', id: true }),
|
|
39
39
|
__metadata("design:type", String)
|
|
40
40
|
], BaseStringIdEntity.prototype, "id", void 0);
|
|
41
41
|
class BaseIdEntity extends BaseNumberIdEntity {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from './base.model';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/common/constants.ts"],"names":[],"mappings":"AAAA,qBAAa,GAAG;IACd,MAAM,CAAC,QAAQ,CAAC,gBAAgB,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/common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
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MimeTypes = exports.EntityRelations = exports.ApplicationRunModes = exports.Sorts = exports.ApplicationRoles = exports.App = void 0;
|
|
4
4
|
class App {
|
|
5
|
-
static { this.APPLICATION_NAME = process.env.APP_ENV_APPLICATION_NAME ??
|
|
6
|
-
static { this.APPLICATION_SECRET = process.env.APP_ENV_APPLICATION_SECRET ??
|
|
7
|
-
static { this.DEFAULT_LOCALE =
|
|
8
|
-
static { this.DEFAULT_EXPLORER_PATH =
|
|
5
|
+
static { this.APPLICATION_NAME = process.env.APP_ENV_APPLICATION_NAME ?? 'APP'; }
|
|
6
|
+
static { this.APPLICATION_SECRET = process.env.APP_ENV_APPLICATION_SECRET ?? 'application.secret'; }
|
|
7
|
+
static { this.DEFAULT_LOCALE = 'en.UTF-8'; }
|
|
8
|
+
static { this.DEFAULT_EXPLORER_PATH = '/explorer'; }
|
|
9
9
|
static { this.DEFAULT_QUERY_LIMIT = 50; }
|
|
10
10
|
}
|
|
11
11
|
exports.App = App;
|
|
12
12
|
class ApplicationRoles {
|
|
13
|
-
static { this.API =
|
|
13
|
+
static { this.API = 'api'; }
|
|
14
14
|
}
|
|
15
15
|
exports.ApplicationRoles = ApplicationRoles;
|
|
16
16
|
class Sorts {
|
|
17
|
-
static { this.DESC =
|
|
18
|
-
static { this.ASC =
|
|
17
|
+
static { this.DESC = 'desc'; }
|
|
18
|
+
static { this.ASC = 'asc'; }
|
|
19
19
|
}
|
|
20
20
|
exports.Sorts = Sorts;
|
|
21
21
|
class ApplicationRunModes {
|
|
22
|
-
static { this.MODE_START_UP =
|
|
23
|
-
static { this.MODE_MIGRATE =
|
|
24
|
-
static { this.MODE_SEED =
|
|
22
|
+
static { this.MODE_START_UP = 'startup'; }
|
|
23
|
+
static { this.MODE_MIGRATE = 'migrate'; }
|
|
24
|
+
static { this.MODE_SEED = 'seed'; }
|
|
25
25
|
}
|
|
26
26
|
exports.ApplicationRunModes = ApplicationRunModes;
|
|
27
27
|
class EntityRelations {
|
|
28
|
-
static { this.BELONGS_TO =
|
|
29
|
-
static { this.HAS_ONE =
|
|
30
|
-
static { this.HAS_MANY =
|
|
31
|
-
static { this.HAS_MANY_THROUGH =
|
|
32
|
-
static { this.HAS_MANY_POLYMORPHIC =
|
|
28
|
+
static { this.BELONGS_TO = 'belongsTo'; }
|
|
29
|
+
static { this.HAS_ONE = 'hasOne'; }
|
|
30
|
+
static { this.HAS_MANY = 'hasMany'; }
|
|
31
|
+
static { this.HAS_MANY_THROUGH = 'hasManyThrough'; }
|
|
32
|
+
static { this.HAS_MANY_POLYMORPHIC = 'hasManyPolymorphic'; }
|
|
33
33
|
static { this.SCHEME_SET = new Set([
|
|
34
34
|
this.BELONGS_TO,
|
|
35
35
|
this.HAS_ONE,
|
|
@@ -43,10 +43,10 @@ class EntityRelations {
|
|
|
43
43
|
}
|
|
44
44
|
exports.EntityRelations = EntityRelations;
|
|
45
45
|
class MimeTypes {
|
|
46
|
-
static { this.UNKNOWN =
|
|
47
|
-
static { this.IMAGE =
|
|
48
|
-
static { this.VIDEO =
|
|
49
|
-
static { this.TEXT =
|
|
46
|
+
static { this.UNKNOWN = 'unknown'; }
|
|
47
|
+
static { this.IMAGE = 'image'; }
|
|
48
|
+
static { this.VIDEO = 'video'; }
|
|
49
|
+
static { this.TEXT = 'text'; }
|
|
50
50
|
}
|
|
51
51
|
exports.MimeTypes = MimeTypes;
|
|
52
52
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/common/constants.ts"],"names":[],"mappings":";;;AAAA,MAAa,GAAG;aACE,qBAAgB,
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/common/constants.ts"],"names":[],"mappings":";;;AAAA,MAAa,GAAG;aACE,qBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,wBAAwB,IAAI,KAAK,CAAC;aACjE,uBAAkB,GAChC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from './types';
|
|
3
|
+
export * from './result-codes';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/common/types.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { BaseEntity, TBaseIdEntity } from
|
|
2
|
-
import { Binding, BindingFromClassOptions, BindingKey, Constructor, ControllerClass } from
|
|
3
|
-
import { Count, DataObject, Entity, Filter, JugglerDataSource, Options, Repository, Transaction, Where } from
|
|
4
|
-
import { RequestContext, SequenceHandler } from
|
|
5
|
-
import { IncomingHttpHeaders } from
|
|
6
|
-
import { ParsedUrlQuery } from
|
|
1
|
+
import { BaseEntity, TBaseIdEntity } from '../base/models';
|
|
2
|
+
import { Binding, BindingFromClassOptions, BindingKey, Constructor, ControllerClass } from '@loopback/core';
|
|
3
|
+
import { Count, DataObject, Entity, Filter, JugglerDataSource, Options, Repository, Transaction, Where } from '@loopback/repository';
|
|
4
|
+
import { RequestContext, SequenceHandler } from '@loopback/rest';
|
|
5
|
+
import { IncomingHttpHeaders } from 'node:http';
|
|
6
|
+
import { ParsedUrlQuery } from 'node:querystring';
|
|
7
7
|
export type NumberIdType = number;
|
|
8
8
|
export type StringIdType = string;
|
|
9
9
|
export type IdType = string | number;
|
|
@@ -21,49 +21,49 @@ export type ClassProps<T> = ValueOf<T>;
|
|
|
21
21
|
export type ClassType<T> = Function & {
|
|
22
22
|
prototype: T;
|
|
23
23
|
};
|
|
24
|
-
export type TStatusFromClass<T extends ClassType<AnyObject>> = ValueOf<Omit<T,
|
|
24
|
+
export type TStatusFromClass<T extends ClassType<AnyObject>> = ValueOf<Omit<T, 'prototype' | 'isValid' | 'SCHEME_SET' | 'TYPE_SET'>>;
|
|
25
25
|
export type TStringConstValue<T extends ClassType<any>> = Extract<ValueOf<T>, string>;
|
|
26
26
|
export type TNumberConstValue<T extends ClassType<any>> = Extract<ValueOf<T>, number>;
|
|
27
27
|
export type TConstValue<T extends ClassType<any>> = Extract<ValueOf<T>, string | number>;
|
|
28
28
|
export type TPrettify<T> = {
|
|
29
29
|
[K in keyof T]: T[K];
|
|
30
30
|
} & {};
|
|
31
|
-
export type TRelationType =
|
|
32
|
-
export type TBullQueueRole =
|
|
33
|
-
export type TPermissionEffect =
|
|
34
|
-
export type TFieldMappingDataType =
|
|
31
|
+
export type TRelationType = 'belongsTo' | 'hasOne' | 'hasMany' | 'hasManyThrough';
|
|
32
|
+
export type TBullQueueRole = 'queue' | 'worker';
|
|
33
|
+
export type TPermissionEffect = 'allow' | 'deny';
|
|
34
|
+
export type TFieldMappingDataType = 'string' | 'number' | 'strings' | 'numbers' | 'boolean';
|
|
35
35
|
export interface IFieldMapping {
|
|
36
36
|
name: string;
|
|
37
37
|
type: TFieldMappingDataType;
|
|
38
38
|
default?: string | number | Array<string> | Array<number> | boolean;
|
|
39
39
|
}
|
|
40
40
|
export type TFieldMappingNames<T extends Array<IFieldMapping>> = Extract<T[number], {
|
|
41
|
-
type: Exclude<T[number][
|
|
42
|
-
}>[
|
|
41
|
+
type: Exclude<T[number]['type'], undefined>;
|
|
42
|
+
}>['name'];
|
|
43
43
|
export type TObjectFromFieldMappings<T extends readonly {
|
|
44
44
|
name: string;
|
|
45
45
|
type: string;
|
|
46
46
|
[extra: string | symbol]: any;
|
|
47
47
|
}[]> = {
|
|
48
|
-
[K in T[number][
|
|
48
|
+
[K in T[number]['name']]: T extends {
|
|
49
49
|
name: K;
|
|
50
|
-
type:
|
|
50
|
+
type: 'string';
|
|
51
51
|
[extra: string | symbol]: any;
|
|
52
52
|
} ? string : T extends {
|
|
53
53
|
name: K;
|
|
54
|
-
type:
|
|
54
|
+
type: 'number';
|
|
55
55
|
[extra: string | symbol]: any;
|
|
56
56
|
} ? number : T extends {
|
|
57
57
|
name: K;
|
|
58
|
-
type:
|
|
58
|
+
type: 'boolean';
|
|
59
59
|
[extra: string | symbol]: any;
|
|
60
60
|
} ? boolean : T extends {
|
|
61
61
|
name: K;
|
|
62
|
-
type:
|
|
62
|
+
type: 'strings';
|
|
63
63
|
[extra: string | symbol]: any;
|
|
64
64
|
} ? string[] : T extends {
|
|
65
65
|
name: K;
|
|
66
|
-
type:
|
|
66
|
+
type: 'numbers';
|
|
67
67
|
[extra: string | symbol]: any;
|
|
68
68
|
} ? number[] : never;
|
|
69
69
|
};
|
|
@@ -106,7 +106,7 @@ export type EntityClassType<T extends Entity> = typeof Entity & {
|
|
|
106
106
|
};
|
|
107
107
|
};
|
|
108
108
|
export type EntityRelationType = {};
|
|
109
|
-
export interface IDangerFilter extends Omit<Filter,
|
|
109
|
+
export interface IDangerFilter extends Omit<Filter, 'order'> {
|
|
110
110
|
order: string | string[];
|
|
111
111
|
}
|
|
112
112
|
export interface IRepository {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/common/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EACL,OAAO,EACP,uBAAuB,EACvB,UAAU,EACV,WAAW,EACX,eAAe,EAChB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,KAAK,EACL,UAAU,EACV,MAAM,EACN,MAAM,EACN,iBAAiB,EACjB,OAAO,EACP,UAAU,EACV,WAAW,EACX,KAAK,EACN,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGlD,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAClC,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAClC,MAAM,MAAM,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AACrC,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,IAAI,GAAG,IAAI,CAAC;AAEnD,MAAM,MAAM,OAAO,GAAG,GAAG,CAAC;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|
|
2
|
+
export * from './redis';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BaseDataSource } from
|
|
2
|
-
import { IPostgresOptions } from
|
|
1
|
+
import { BaseDataSource } from '../../base/datasources';
|
|
2
|
+
import { IPostgresOptions } from './types';
|
|
3
3
|
export declare class PostgresDataSource extends BaseDataSource {
|
|
4
4
|
static dataSourceName: string;
|
|
5
5
|
static readonly defaultConfig: IPostgresOptions;
|
|
@@ -23,13 +23,13 @@ const core_1 = require("@loopback/core");
|
|
|
23
23
|
const get_1 = __importDefault(require("lodash/get"));
|
|
24
24
|
const isEmpty_1 = __importDefault(require("lodash/isEmpty"));
|
|
25
25
|
const databaseConfigs = {
|
|
26
|
-
connector:
|
|
27
|
-
name: process.env.APP_ENV_DATASOURCE_NAME ??
|
|
28
|
-
host: process.env.APP_ENV_POSTGRES_HOST ??
|
|
29
|
-
port: process.env.APP_ENV_POSTGRES_PORT ??
|
|
30
|
-
user: process.env.APP_ENV_POSTGRES_USERNAME ??
|
|
31
|
-
password: process.env.APP_ENV_POSTGRES_PASSWORD ??
|
|
32
|
-
database: process.env.APP_ENV_POSTGRES_DATABASE ??
|
|
26
|
+
connector: 'postgresql',
|
|
27
|
+
name: process.env.APP_ENV_DATASOURCE_NAME ?? 'postgres',
|
|
28
|
+
host: process.env.APP_ENV_POSTGRES_HOST ?? '0.0.0.0',
|
|
29
|
+
port: process.env.APP_ENV_POSTGRES_PORT ?? '5432',
|
|
30
|
+
user: process.env.APP_ENV_POSTGRES_USERNAME ?? 'postgres',
|
|
31
|
+
password: process.env.APP_ENV_POSTGRES_PASSWORD ?? 'password',
|
|
32
|
+
database: process.env.APP_ENV_POSTGRES_DATABASE ?? 'postgres',
|
|
33
33
|
};
|
|
34
34
|
let PostgresDataSource = class PostgresDataSource extends datasources_1.BaseDataSource {
|
|
35
35
|
static { PostgresDataSource_1 = this; }
|
|
@@ -39,7 +39,7 @@ let PostgresDataSource = class PostgresDataSource extends datasources_1.BaseData
|
|
|
39
39
|
for (const key in dsConfig) {
|
|
40
40
|
const value = (0, get_1.default)(dsConfig, key);
|
|
41
41
|
switch (typeof value) {
|
|
42
|
-
case
|
|
42
|
+
case 'number': {
|
|
43
43
|
if (!value || value < 0) {
|
|
44
44
|
throw (0, utilities_1.getError)({
|
|
45
45
|
message: `[DANGER] INVALID POSTGRES DATABASE CONFIGURE | Key: ${key} | Value: ${value}`,
|
|
@@ -47,7 +47,7 @@ let PostgresDataSource = class PostgresDataSource extends datasources_1.BaseData
|
|
|
47
47
|
}
|
|
48
48
|
break;
|
|
49
49
|
}
|
|
50
|
-
case
|
|
50
|
+
case 'string': {
|
|
51
51
|
if (!value || (0, isEmpty_1.default)(value)) {
|
|
52
52
|
throw (0, utilities_1.getError)({
|
|
53
53
|
message: `[DANGER] INVALID POSTGRES DATABASE CONFIGURE | Key: ${key} | Value: ${value}`,
|
|
@@ -61,7 +61,7 @@ let PostgresDataSource = class PostgresDataSource extends datasources_1.BaseData
|
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
super({ settings: dsConfig, scope: PostgresDataSource_1.name });
|
|
64
|
-
this.logger.info(
|
|
64
|
+
this.logger.info('Postgres DataSource Settings: %j', dsConfig);
|
|
65
65
|
}
|
|
66
66
|
};
|
|
67
67
|
exports.PostgresDataSource = PostgresDataSource;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
1
|
+
export * from './datasource';
|
|
2
|
+
export * from './types';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { IDataSourceOptions } from
|
|
1
|
+
import { IDataSourceOptions } from '../../base/datasources/types';
|
|
2
2
|
export interface IPostgresOptions extends IDataSourceOptions {
|
|
3
|
-
connector:
|
|
3
|
+
connector: 'postgresql';
|
|
4
4
|
host: string;
|
|
5
5
|
port: string | number;
|
|
6
6
|
user: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { RedisHelper } from
|
|
2
|
-
import { Class, Entity, EntityData, Filter, Model, Options } from
|
|
3
|
-
import EventEmitter from
|
|
4
|
-
import { IRedisConnector, IRedisOptions } from
|
|
1
|
+
import { RedisHelper } from '../../helpers';
|
|
2
|
+
import { Class, Entity, EntityData, Filter, Model, Options } from '@loopback/repository';
|
|
3
|
+
import EventEmitter from 'node:events';
|
|
4
|
+
import { IRedisConnector, IRedisOptions } from './types';
|
|
5
5
|
export declare class RedisConnector implements IRedisConnector {
|
|
6
6
|
name: string;
|
|
7
7
|
redisHelper: RedisHelper;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connector.d.ts","sourceRoot":"","sources":["../../../src/datasources/redis/connector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC,OAAO,
|
|
1
|
+
{"version":3,"file":"connector.d.ts","sourceRoot":"","sources":["../../../src/datasources/redis/connector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACzF,OAAO,YAAY,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAEzD,qBAAa,cAAe,YAAW,eAAe;IACpD,IAAI,EAAE,MAAM,CAAC;IAEb,WAAW,EAAE,WAAW,CAAC;IACzB,QAAQ,EAAE,aAAa,CAAC;IAExB,WAAW,CAAC,EAAE,KAAK,GAAG,SAAS,CAAC;IAChC,UAAU,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;gBAEtB,IAAI,EAAE;QAAE,QAAQ,EAAE,aAAa,CAAA;KAAE;IAI7C,UAAU,CACR,CAAC,SAAS,YAAY,GAAG;QAC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