@tstdl/base 0.83.0-beta4 → 0.83.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.cjs +4 -7
- package/api/server/gateway.js +3 -4
- package/database/entity-repository.d.ts +1 -2
- package/database/entity-repository.js +3 -1
- package/http/server/node/node-http-server.js +3 -4
- package/key-value-store/mongo/mongo-key-value.repository.js +3 -4
- package/mail/mail.service.js +3 -4
- package/migration/migrator.js +3 -4
- package/migration/mongo/migration-state-repository.js +3 -4
- package/openid-connect/mongo-oidc-state.repository.js +3 -4
- package/package.json +4 -3
- package/tsconfig.json +2 -3
package/.eslintrc.cjs
CHANGED
|
@@ -79,13 +79,6 @@ module.exports = {
|
|
|
79
79
|
'import/no-unassigned-import': ['error'],
|
|
80
80
|
|
|
81
81
|
/** misc */
|
|
82
|
-
|
|
83
|
-
'indent': ['error', 2, {
|
|
84
|
-
SwitchCase: 1
|
|
85
|
-
}],
|
|
86
|
-
'linebreak-style': ['error', 'unix'],
|
|
87
|
-
'quotes': ['error', 'single'],
|
|
88
|
-
'semi': ['error', 'always'],
|
|
89
82
|
'array-bracket-newline': ['error', 'consistent'],
|
|
90
83
|
'array-element-newline': ['error', 'consistent'],
|
|
91
84
|
'camelcase': 'off',
|
|
@@ -99,8 +92,10 @@ module.exports = {
|
|
|
99
92
|
'function-paren-newline': ['warn', 'consistent'],
|
|
100
93
|
'generator-star-spacing': ['off', { before: false, after: true }],
|
|
101
94
|
'id-length': 'off',
|
|
95
|
+
'indent': ['error', 2, { SwitchCase: 1 }],
|
|
102
96
|
'init-declarations': 'off',
|
|
103
97
|
'line-comment-position': 'off',
|
|
98
|
+
'linebreak-style': ['error', 'unix'],
|
|
104
99
|
'lines-around-comment': 'off',
|
|
105
100
|
'lines-between-class-members': 'off',
|
|
106
101
|
'max-classes-per-file': 'off',
|
|
@@ -136,6 +131,8 @@ module.exports = {
|
|
|
136
131
|
'prefer-destructuring': 'off',
|
|
137
132
|
'prefer-named-capture-group': 'off',
|
|
138
133
|
'quote-props': ['error', 'as-needed'],
|
|
134
|
+
'quotes': ['error', 'single'],
|
|
135
|
+
'semi': ['error', 'always'],
|
|
139
136
|
'sort-imports': ['off', { ignoreCase: true }],
|
|
140
137
|
'sort-keys': 'off',
|
|
141
138
|
|
package/api/server/gateway.js
CHANGED
|
@@ -61,9 +61,8 @@ var __param = function(paramIndex, decorator) {
|
|
|
61
61
|
decorator(target, key, paramIndex);
|
|
62
62
|
};
|
|
63
63
|
};
|
|
64
|
-
var ApiGateway_1;
|
|
65
64
|
const defaultMaxBytes = 10 * import_units.mebibyte;
|
|
66
|
-
let ApiGateway =
|
|
65
|
+
let ApiGateway = class ApiGateway2 {
|
|
67
66
|
requestTokenProvider;
|
|
68
67
|
logger;
|
|
69
68
|
prefix;
|
|
@@ -221,11 +220,11 @@ let ApiGateway = ApiGateway_1 = class ApiGateway2 {
|
|
|
221
220
|
return import_schema.Schema.parse(schema, body);
|
|
222
221
|
}
|
|
223
222
|
};
|
|
224
|
-
ApiGateway =
|
|
223
|
+
ApiGateway = __decorate([
|
|
225
224
|
(0, import_container.singleton)({
|
|
226
225
|
defaultArgumentProvider: (context) => context.resolve(import_tokens.API_MODULE_OPTIONS).gatewayOptions
|
|
227
226
|
}),
|
|
228
|
-
__param(1, (0, import_container.resolveArg)(
|
|
227
|
+
__param(1, (0, import_container.resolveArg)("ApiGateway")),
|
|
229
228
|
__param(2, (0, import_container.injectArg)()),
|
|
230
229
|
__metadata("design:paramtypes", [import_api_request_token_provider.ApiRequestTokenProvider, import_logger.Logger, Object])
|
|
231
230
|
], ApiGateway);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Entity, MaybeNewEntity } from './entity.js';
|
|
2
2
|
import type { Query, QueryOptions } from './query.js';
|
|
3
|
-
declare const repositoryType: unique symbol;
|
|
3
|
+
export declare const repositoryType: unique symbol;
|
|
4
4
|
export type UpdateOptions = {
|
|
5
5
|
upsert?: boolean;
|
|
6
6
|
};
|
|
@@ -48,4 +48,3 @@ export declare abstract class EntityRepository<T extends Entity = Entity> {
|
|
|
48
48
|
abstract deleteByFilter<U extends T = T>(query: Query<U>): Promise<boolean>;
|
|
49
49
|
abstract deleteManyByFilter<U extends T = T>(query: Query<U>): Promise<number>;
|
|
50
50
|
}
|
|
51
|
-
export {};
|
|
@@ -18,8 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var entity_repository_exports = {};
|
|
20
20
|
__export(entity_repository_exports, {
|
|
21
|
-
EntityRepository: () => EntityRepository
|
|
21
|
+
EntityRepository: () => EntityRepository,
|
|
22
|
+
repositoryType: () => repositoryType
|
|
22
23
|
});
|
|
23
24
|
module.exports = __toCommonJS(entity_repository_exports);
|
|
25
|
+
const repositoryType = Symbol("repositoryType");
|
|
24
26
|
class EntityRepository {
|
|
25
27
|
}
|
|
@@ -67,8 +67,7 @@ var __param = function(paramIndex, decorator) {
|
|
|
67
67
|
decorator(target, key, paramIndex);
|
|
68
68
|
};
|
|
69
69
|
};
|
|
70
|
-
|
|
71
|
-
let NodeHttpServer = NodeHttpServer_1 = class NodeHttpServer2 extends import_http_server.HttpServer {
|
|
70
|
+
let NodeHttpServer = class NodeHttpServer2 extends import_http_server.HttpServer {
|
|
72
71
|
httpServer;
|
|
73
72
|
sockets;
|
|
74
73
|
requestIterable;
|
|
@@ -170,9 +169,9 @@ let NodeHttpServer = NodeHttpServer_1 = class NodeHttpServer2 extends import_htt
|
|
|
170
169
|
return item;
|
|
171
170
|
}
|
|
172
171
|
};
|
|
173
|
-
NodeHttpServer =
|
|
172
|
+
NodeHttpServer = __decorate([
|
|
174
173
|
(0, import_container.singleton)(),
|
|
175
|
-
__param(0, (0, import_container.resolveArg)(
|
|
174
|
+
__param(0, (0, import_container.resolveArg)("NodeHttpServer")),
|
|
176
175
|
__metadata("design:paramtypes", [import_logger.Logger])
|
|
177
176
|
], NodeHttpServer);
|
|
178
177
|
function getResponder(httpResponse) {
|
|
@@ -44,18 +44,17 @@ var __param = function(paramIndex, decorator) {
|
|
|
44
44
|
decorator(target, key, paramIndex);
|
|
45
45
|
};
|
|
46
46
|
};
|
|
47
|
-
var MongoKeyValueRepository_1;
|
|
48
47
|
const indexes = [
|
|
49
48
|
{ key: { module: 1, key: 1 }, unique: true }
|
|
50
49
|
];
|
|
51
|
-
let MongoKeyValueRepository =
|
|
50
|
+
let MongoKeyValueRepository = class MongoKeyValueRepository2 extends import_mongo.MongoEntityRepository {
|
|
52
51
|
constructor(collection, logger) {
|
|
53
52
|
super(collection, import_mongo.noopTransformer, { logger, indexes });
|
|
54
53
|
}
|
|
55
54
|
};
|
|
56
|
-
MongoKeyValueRepository =
|
|
55
|
+
MongoKeyValueRepository = __decorate([
|
|
57
56
|
(0, import_container.singleton)({ defaultArgumentProvider: (context) => context.resolve(import_tokens.DEFAULT_KEY_VALUE_REPOSITORY_CONFIG) }),
|
|
58
57
|
__param(0, (0, import_container.forwardArg)()),
|
|
59
|
-
__param(1, (0, import_container.resolveArg)(
|
|
58
|
+
__param(1, (0, import_container.resolveArg)("MongoKeyValueRepository")),
|
|
60
59
|
__metadata("design:paramtypes", [import_mongo.Collection, import_logger.Logger])
|
|
61
60
|
], MongoKeyValueRepository);
|
package/mail/mail.service.js
CHANGED
|
@@ -49,8 +49,7 @@ var __param = function(paramIndex, decorator) {
|
|
|
49
49
|
decorator(target, key, paramIndex);
|
|
50
50
|
};
|
|
51
51
|
};
|
|
52
|
-
|
|
53
|
-
let MailService = MailService_1 = class MailService2 {
|
|
52
|
+
let MailService = class MailService2 {
|
|
54
53
|
mailClient;
|
|
55
54
|
templateService;
|
|
56
55
|
mailLogRepository;
|
|
@@ -99,11 +98,11 @@ let MailService = MailService_1 = class MailService2 {
|
|
|
99
98
|
return this.send(fullMailData, name);
|
|
100
99
|
}
|
|
101
100
|
};
|
|
102
|
-
MailService =
|
|
101
|
+
MailService = __decorate([
|
|
103
102
|
(0, import_container.singleton)(),
|
|
104
103
|
__param(2, (0, import_container.inject)(import_mail_log_repository.MailLogRepository)),
|
|
105
104
|
__param(2, (0, import_container.optional)()),
|
|
106
|
-
__param(3, (0, import_container.resolveArg)(
|
|
105
|
+
__param(3, (0, import_container.resolveArg)("MailService")),
|
|
107
106
|
__param(4, (0, import_container.inject)(import_tokens.MAIL_DEFAULT_DATA)),
|
|
108
107
|
__param(4, (0, import_container.optional)()),
|
|
109
108
|
__metadata("design:paramtypes", [
|
package/migration/migrator.js
CHANGED
|
@@ -50,8 +50,7 @@ var __param = function(paramIndex, decorator) {
|
|
|
50
50
|
decorator(target, key, paramIndex);
|
|
51
51
|
};
|
|
52
52
|
};
|
|
53
|
-
|
|
54
|
-
let Migrator = Migrator_1 = class Migrator2 {
|
|
53
|
+
let Migrator = class Migrator2 {
|
|
55
54
|
migrationStateRepository;
|
|
56
55
|
lockProvider;
|
|
57
56
|
logger;
|
|
@@ -109,9 +108,9 @@ let Migrator = Migrator_1 = class Migrator2 {
|
|
|
109
108
|
return result;
|
|
110
109
|
}
|
|
111
110
|
};
|
|
112
|
-
Migrator =
|
|
111
|
+
Migrator = __decorate([
|
|
113
112
|
(0, import_container.singleton)(),
|
|
114
113
|
__param(1, (0, import_container.resolveArg)("migrator:")),
|
|
115
|
-
__param(2, (0, import_container.resolveArg)(
|
|
114
|
+
__param(2, (0, import_container.resolveArg)("Migrator")),
|
|
116
115
|
__metadata("design:paramtypes", [import_migration_state_repository.MigrationStateRepository, import_lock.LockProvider, import_logger.Logger])
|
|
117
116
|
], Migrator);
|
|
@@ -45,18 +45,17 @@ var __param = function(paramIndex, decorator) {
|
|
|
45
45
|
decorator(target, key, paramIndex);
|
|
46
46
|
};
|
|
47
47
|
};
|
|
48
|
-
var MongoMigrationStateRepository_1;
|
|
49
48
|
const indexes = [
|
|
50
49
|
{ key: { name: 1 }, unique: true }
|
|
51
50
|
];
|
|
52
|
-
let MongoMigrationStateRepository =
|
|
51
|
+
let MongoMigrationStateRepository = class MongoMigrationStateRepository2 extends import_mongo_entity_repository.MongoEntityRepository {
|
|
53
52
|
constructor(collection, logger) {
|
|
54
53
|
super(collection, import_mongo_entity_repository.noopTransformer, { logger, indexes });
|
|
55
54
|
}
|
|
56
55
|
};
|
|
57
|
-
MongoMigrationStateRepository =
|
|
56
|
+
MongoMigrationStateRepository = __decorate([
|
|
58
57
|
(0, import_container.singleton)({ defaultArgumentProvider: () => import_module.mongoMigrationStateRepositoryModuleConfig.defaultMigrationStateRepositoryConfig }),
|
|
59
58
|
__param(0, (0, import_container.forwardArg)()),
|
|
60
|
-
__param(1, (0, import_container.resolveArg)(
|
|
59
|
+
__param(1, (0, import_container.resolveArg)("MongoMigrationStateRepository")),
|
|
61
60
|
__metadata("design:paramtypes", [import_classes.Collection, import_logger.Logger])
|
|
62
61
|
], MongoMigrationStateRepository);
|
|
@@ -45,7 +45,6 @@ var __param = function(paramIndex, decorator) {
|
|
|
45
45
|
decorator(target, key, paramIndex);
|
|
46
46
|
};
|
|
47
47
|
};
|
|
48
|
-
var MongoOidcStateRepository_1;
|
|
49
48
|
let repositoryConfig;
|
|
50
49
|
const indexes = [
|
|
51
50
|
{ key: { value: 1 }, unique: true },
|
|
@@ -58,15 +57,15 @@ const transformer = {
|
|
|
58
57
|
expiration: (0, import_mongo.mapTo)("expiration", (timestamp) => new Date(timestamp))
|
|
59
58
|
}
|
|
60
59
|
};
|
|
61
|
-
let MongoOidcStateRepository =
|
|
60
|
+
let MongoOidcStateRepository = class MongoOidcStateRepository2 extends import_mongo.MongoEntityRepository {
|
|
62
61
|
constructor(collection, logger) {
|
|
63
62
|
super(collection, transformer, { logger, indexes });
|
|
64
63
|
}
|
|
65
64
|
};
|
|
66
|
-
MongoOidcStateRepository =
|
|
65
|
+
MongoOidcStateRepository = __decorate([
|
|
67
66
|
(0, import_container.singleton)({ defaultArgumentProvider: () => repositoryConfig }),
|
|
68
67
|
__param(0, (0, import_container.forwardArg)()),
|
|
69
|
-
__param(1, (0, import_container.resolveArg)(
|
|
68
|
+
__param(1, (0, import_container.resolveArg)("MongoOidcStateRepository")),
|
|
70
69
|
__metadata("design:paramtypes", [import_mongo.Collection, import_logger.Logger])
|
|
71
70
|
], MongoOidcStateRepository);
|
|
72
71
|
function configureMongoOidcStateRepository(mongoOidcStateRepositoryConfig, register = true) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tstdl/base",
|
|
3
|
-
"version": "0.83.
|
|
3
|
+
"version": "0.83.1",
|
|
4
4
|
"author": "Patrick Hein",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"type": "commonjs",
|
|
9
9
|
"scripts": {
|
|
10
10
|
"build": "tsc && tsc-alias",
|
|
11
|
-
"build:watch": "tsc --watch
|
|
11
|
+
"build:watch": "tsc && (concurrently --raw 'tsc --watch' 'tsc-alias --watch')",
|
|
12
12
|
"build:production": "rm -rf dist && npm run build && npm run build:production:cjs && npm run build:production:copy-files",
|
|
13
13
|
"build:production:cjs": "esbuild `find dist \\( -name '*.js' -o -name '*.jsx' \\)` --outdir=dist --allow-overwrite --format=cjs",
|
|
14
14
|
"build:production:copy-files": "cp package.json .eslintrc.cjs tsconfig.server.json dist/ && cp tsconfig.base.json dist/tsconfig.json && sed -i 's/\"type\": \"module\",/\"type\": \"commonjs\",/g' dist/package.json",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"@types/nodemailer": "6.4",
|
|
34
34
|
"@typescript-eslint/eslint-plugin": "5.55",
|
|
35
35
|
"@typescript-eslint/parser": "5.55",
|
|
36
|
+
"concurrently": "7.6",
|
|
36
37
|
"eslint": "8.36",
|
|
37
38
|
"eslint-import-resolver-typescript": "3.5",
|
|
38
39
|
"eslint-plugin-import": "2.27",
|
|
@@ -43,7 +44,7 @@
|
|
|
43
44
|
"peerDependencies": {
|
|
44
45
|
"@elastic/elasticsearch": "^8.6",
|
|
45
46
|
"@koa/router": "^12.0",
|
|
46
|
-
"@tstdl/angular": "^0.
|
|
47
|
+
"@tstdl/angular": "^0.83",
|
|
47
48
|
"@zxcvbn-ts/core": "2.2",
|
|
48
49
|
"@zxcvbn-ts/language-common": "2.0",
|
|
49
50
|
"@zxcvbn-ts/language-de": "2.1",
|