@tstdl/base 0.93.14 → 0.93.15
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/mail/drizzle/0001_flimsy_bloodscream.sql +5 -0
- package/mail/drizzle/meta/0001_snapshot.json +69 -0
- package/mail/drizzle/meta/_journal.json +7 -0
- package/mail/mail.service.js +3 -3
- package/mail/models/mail-log.model.d.ts +2 -2
- package/mail/models/mail-log.model.js +2 -2
- package/message-bus/local/local-message-bus-provider.d.ts +2 -1
- package/message-bus/local/local-message-bus-provider.js +5 -4
- package/message-bus/local/local-message-bus.js +1 -3
- package/message-bus/message-bus-base.js +2 -2
- package/package.json +2 -2
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
ALTER TABLE "mail"."log" DROP COLUMN "revision";--> statement-breakpoint
|
|
2
|
+
ALTER TABLE "mail"."log" DROP COLUMN "revision_timestamp";--> statement-breakpoint
|
|
3
|
+
ALTER TABLE "mail"."log" DROP COLUMN "create_timestamp";--> statement-breakpoint
|
|
4
|
+
ALTER TABLE "mail"."log" DROP COLUMN "delete_timestamp";--> statement-breakpoint
|
|
5
|
+
ALTER TABLE "mail"."log" DROP COLUMN "attributes";
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "28ddafef-64f4-437d-9406-82a02c76570e",
|
|
3
|
+
"prevId": "f8cdba37-11b9-477a-9f5a-5ef4b5026011",
|
|
4
|
+
"version": "7",
|
|
5
|
+
"dialect": "postgresql",
|
|
6
|
+
"tables": {
|
|
7
|
+
"mail.log": {
|
|
8
|
+
"name": "log",
|
|
9
|
+
"schema": "mail",
|
|
10
|
+
"columns": {
|
|
11
|
+
"id": {
|
|
12
|
+
"name": "id",
|
|
13
|
+
"type": "uuid",
|
|
14
|
+
"primaryKey": true,
|
|
15
|
+
"notNull": true,
|
|
16
|
+
"default": "gen_random_uuid()"
|
|
17
|
+
},
|
|
18
|
+
"timestamp": {
|
|
19
|
+
"name": "timestamp",
|
|
20
|
+
"type": "timestamp with time zone",
|
|
21
|
+
"primaryKey": false,
|
|
22
|
+
"notNull": true
|
|
23
|
+
},
|
|
24
|
+
"template": {
|
|
25
|
+
"name": "template",
|
|
26
|
+
"type": "text",
|
|
27
|
+
"primaryKey": false,
|
|
28
|
+
"notNull": false
|
|
29
|
+
},
|
|
30
|
+
"data": {
|
|
31
|
+
"name": "data",
|
|
32
|
+
"type": "jsonb",
|
|
33
|
+
"primaryKey": false,
|
|
34
|
+
"notNull": true
|
|
35
|
+
},
|
|
36
|
+
"send_result": {
|
|
37
|
+
"name": "send_result",
|
|
38
|
+
"type": "jsonb",
|
|
39
|
+
"primaryKey": false,
|
|
40
|
+
"notNull": false
|
|
41
|
+
},
|
|
42
|
+
"errors": {
|
|
43
|
+
"name": "errors",
|
|
44
|
+
"type": "text[]",
|
|
45
|
+
"primaryKey": false,
|
|
46
|
+
"notNull": false
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"indexes": {},
|
|
50
|
+
"foreignKeys": {},
|
|
51
|
+
"compositePrimaryKeys": {},
|
|
52
|
+
"uniqueConstraints": {},
|
|
53
|
+
"policies": {},
|
|
54
|
+
"checkConstraints": {},
|
|
55
|
+
"isRLSEnabled": false
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"enums": {},
|
|
59
|
+
"schemas": {},
|
|
60
|
+
"sequences": {},
|
|
61
|
+
"roles": {},
|
|
62
|
+
"policies": {},
|
|
63
|
+
"views": {},
|
|
64
|
+
"_meta": {
|
|
65
|
+
"columns": {},
|
|
66
|
+
"schemas": {},
|
|
67
|
+
"tables": {}
|
|
68
|
+
}
|
|
69
|
+
}
|
package/mail/mail.service.js
CHANGED
|
@@ -33,7 +33,7 @@ let MailService = class MailService {
|
|
|
33
33
|
template: templateName ?? null,
|
|
34
34
|
data,
|
|
35
35
|
sendResult: null,
|
|
36
|
-
errors: null
|
|
36
|
+
errors: null,
|
|
37
37
|
});
|
|
38
38
|
try {
|
|
39
39
|
const result = await this.#mailClient.send(data, clientConfig);
|
|
@@ -53,14 +53,14 @@ let MailService = class MailService {
|
|
|
53
53
|
async sendTemplate(keyOrTemplate, mailData, templateContext, clientConfig) {
|
|
54
54
|
const { name, fields: { subject, html, text } } = await this.#templateService.render(keyOrTemplate, templateContext);
|
|
55
55
|
const fullMailData = { ...mailData, subject, content: { html, text } };
|
|
56
|
-
return this.send(fullMailData, clientConfig, name);
|
|
56
|
+
return await this.send(fullMailData, clientConfig, name);
|
|
57
57
|
}
|
|
58
58
|
};
|
|
59
59
|
MailService = __decorate([
|
|
60
60
|
Singleton({
|
|
61
61
|
providers: [
|
|
62
62
|
provide(EntityRepositoryConfig, { useValue: { schema: 'mail' } }),
|
|
63
|
-
provide(DatabaseConfig, { useFactory: (_, context) => context.resolve(MailModuleConfig).database ?? context.resolve(DatabaseConfig, undefined, { skipSelf: true }) })
|
|
63
|
+
provide(DatabaseConfig, { useFactory: (_, context) => context.resolve(MailModuleConfig).database ?? context.resolve(DatabaseConfig, undefined, { skipSelf: true }) }),
|
|
64
64
|
]
|
|
65
65
|
})
|
|
66
66
|
], MailService);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EntityWithoutMetadata, type Json, type Timestamp } from '../../orm/index.js';
|
|
2
2
|
import type { MailData } from './mail-data.model.js';
|
|
3
3
|
import type { MailSendResult } from './mail-send-result.model.js';
|
|
4
|
-
export declare class MailLog extends
|
|
4
|
+
export declare class MailLog extends EntityWithoutMetadata {
|
|
5
5
|
timestamp: Timestamp;
|
|
6
6
|
template: string | null;
|
|
7
7
|
data: Json<MailData>;
|
|
@@ -7,9 +7,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
-
import {
|
|
10
|
+
import { EntityWithoutMetadata, JsonProperty, Table, TimestampProperty } from '../../orm/index.js';
|
|
11
11
|
import { StringProperty } from '../../schema/index.js';
|
|
12
|
-
let MailLog = class MailLog extends
|
|
12
|
+
let MailLog = class MailLog extends EntityWithoutMetadata {
|
|
13
13
|
timestamp;
|
|
14
14
|
template;
|
|
15
15
|
data;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { MessageBusProvider } from '../message-bus-provider.js';
|
|
2
2
|
import { LocalMessageBus } from './local-message-bus.js';
|
|
3
|
-
export declare class LocalMessageBusProvider extends MessageBusProvider {
|
|
3
|
+
export declare class LocalMessageBusProvider extends MessageBusProvider implements Disposable {
|
|
4
4
|
private readonly logger;
|
|
5
5
|
private readonly channelSubjectsMap;
|
|
6
6
|
get<T>(channel: string): LocalMessageBus<T>;
|
|
7
|
+
[Symbol.dispose](): void;
|
|
7
8
|
}
|
|
@@ -10,7 +10,6 @@ import { WeakRefMap } from '../../data-structures/weak-ref-map.js';
|
|
|
10
10
|
import { inject, Singleton } from '../../injector/index.js';
|
|
11
11
|
import { Logger } from '../../logger/index.js';
|
|
12
12
|
import { FactoryMap } from '../../utils/factory-map.js';
|
|
13
|
-
import { isUndefined } from '../../utils/type-guards.js';
|
|
14
13
|
import { MessageBusProvider } from '../message-bus-provider.js';
|
|
15
14
|
import { LocalMessageBus } from './local-message-bus.js';
|
|
16
15
|
let LocalMessageBusProvider = LocalMessageBusProvider_1 = class LocalMessageBusProvider extends MessageBusProvider {
|
|
@@ -18,11 +17,13 @@ let LocalMessageBusProvider = LocalMessageBusProvider_1 = class LocalMessageBusP
|
|
|
18
17
|
channelSubjectsMap = new FactoryMap(() => new Subject(), WeakRefMap.supported ? new WeakRefMap() : undefined);
|
|
19
18
|
get(channel) {
|
|
20
19
|
const subject = this.channelSubjectsMap.get(channel);
|
|
21
|
-
|
|
20
|
+
return new LocalMessageBus(subject, this.logger);
|
|
21
|
+
}
|
|
22
|
+
[Symbol.dispose]() {
|
|
23
|
+
for (const [channel, subject] of this.channelSubjectsMap.entries()) {
|
|
22
24
|
this.channelSubjectsMap.delete(channel);
|
|
23
|
-
|
|
25
|
+
subject.complete();
|
|
24
26
|
}
|
|
25
|
-
return new LocalMessageBus(subject, this.logger);
|
|
26
27
|
}
|
|
27
28
|
};
|
|
28
29
|
LocalMessageBusProvider = LocalMessageBusProvider_1 = __decorate([
|
|
@@ -26,9 +26,7 @@ let LocalMessageBus = class LocalMessageBus extends MessageBusBase {
|
|
|
26
26
|
_publish(message) {
|
|
27
27
|
this.subject.next({ source: this.source, message });
|
|
28
28
|
}
|
|
29
|
-
_dispose() {
|
|
30
|
-
this.subject.complete();
|
|
31
|
-
}
|
|
29
|
+
_dispose() { }
|
|
32
30
|
};
|
|
33
31
|
LocalMessageBus = __decorate([
|
|
34
32
|
Injectable({
|
|
@@ -21,14 +21,14 @@ export class MessageBusBase extends MessageBus {
|
|
|
21
21
|
}
|
|
22
22
|
async publish(message) {
|
|
23
23
|
if (this.disposeToken.isSet) {
|
|
24
|
-
throw new Error('
|
|
24
|
+
throw new Error('MessageBus is disposed.');
|
|
25
25
|
}
|
|
26
26
|
this.publishSubject.next(message);
|
|
27
27
|
await this._publish(message);
|
|
28
28
|
}
|
|
29
29
|
async [Symbol.asyncDispose]() {
|
|
30
30
|
if (this.disposeToken.isSet) {
|
|
31
|
-
throw new Error('
|
|
31
|
+
throw new Error('MessageBus is disposed.');
|
|
32
32
|
}
|
|
33
33
|
this.disposeToken.set();
|
|
34
34
|
this.publishSubject.complete();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tstdl/base",
|
|
3
|
-
"version": "0.93.
|
|
3
|
+
"version": "0.93.15",
|
|
4
4
|
"author": "Patrick Hein",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -136,7 +136,7 @@
|
|
|
136
136
|
},
|
|
137
137
|
"peerDependencies": {
|
|
138
138
|
"@google-cloud/storage": "^7.17",
|
|
139
|
-
"@google/genai": "^1.
|
|
139
|
+
"@google/genai": "^1.26",
|
|
140
140
|
"@tstdl/angular": "^0.93",
|
|
141
141
|
"@zxcvbn-ts/core": "^3.0",
|
|
142
142
|
"@zxcvbn-ts/language-common": "^3.0",
|