@twin.org/messaging-service 0.0.1-next.9 → 0.0.2-next.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/dist/cjs/index.cjs +8 -12
- package/dist/esm/index.mjs +9 -13
- package/dist/types/entities/templateEntry.d.ts +1 -1
- package/dist/types/messagingService.d.ts +0 -4
- package/docs/changelog.md +99 -1
- package/docs/reference/classes/MessagingService.md +3 -11
- package/docs/reference/classes/TemplateEntry.md +5 -5
- package/package.json +3 -3
package/dist/cjs/index.cjs
CHANGED
|
@@ -26,24 +26,24 @@ exports.TemplateEntry = class TemplateEntry {
|
|
|
26
26
|
/**
|
|
27
27
|
* The timestamp of the template entry.
|
|
28
28
|
*/
|
|
29
|
-
|
|
29
|
+
dateCreated;
|
|
30
30
|
};
|
|
31
31
|
__decorate([
|
|
32
32
|
entity.property({ type: "string", isPrimary: true }),
|
|
33
33
|
__metadata("design:type", String)
|
|
34
|
-
], exports.TemplateEntry.prototype, "id",
|
|
34
|
+
], exports.TemplateEntry.prototype, "id", void 0);
|
|
35
35
|
__decorate([
|
|
36
36
|
entity.property({ type: "string" }),
|
|
37
37
|
__metadata("design:type", String)
|
|
38
|
-
], exports.TemplateEntry.prototype, "title",
|
|
38
|
+
], exports.TemplateEntry.prototype, "title", void 0);
|
|
39
39
|
__decorate([
|
|
40
40
|
entity.property({ type: "string" }),
|
|
41
41
|
__metadata("design:type", String)
|
|
42
|
-
], exports.TemplateEntry.prototype, "content",
|
|
42
|
+
], exports.TemplateEntry.prototype, "content", void 0);
|
|
43
43
|
__decorate([
|
|
44
|
-
entity.property({ type: "
|
|
45
|
-
__metadata("design:type",
|
|
46
|
-
], exports.TemplateEntry.prototype, "
|
|
44
|
+
entity.property({ type: "string", format: "date-time", sortDirection: entity.SortDirection.Descending }),
|
|
45
|
+
__metadata("design:type", String)
|
|
46
|
+
], exports.TemplateEntry.prototype, "dateCreated", void 0);
|
|
47
47
|
exports.TemplateEntry = __decorate([
|
|
48
48
|
entity.entity()
|
|
49
49
|
], exports.TemplateEntry);
|
|
@@ -54,10 +54,6 @@ exports.TemplateEntry = __decorate([
|
|
|
54
54
|
* Service for performing email messaging operations to a connector.
|
|
55
55
|
*/
|
|
56
56
|
class MessagingService {
|
|
57
|
-
/**
|
|
58
|
-
* The namespace for the service.
|
|
59
|
-
*/
|
|
60
|
-
static NAMESPACE = "messaging";
|
|
61
57
|
/**
|
|
62
58
|
* Runtime name for the class.
|
|
63
59
|
*/
|
|
@@ -189,7 +185,7 @@ class MessagingService {
|
|
|
189
185
|
core.Guards.stringValue(this.CLASS_NAME, "content", content);
|
|
190
186
|
const templateEntry = new exports.TemplateEntry();
|
|
191
187
|
templateEntry.id = `${templateId}:${locale}`;
|
|
192
|
-
templateEntry.
|
|
188
|
+
templateEntry.dateCreated = new Date(Date.now()).toISOString();
|
|
193
189
|
templateEntry.title = title;
|
|
194
190
|
templateEntry.content = content;
|
|
195
191
|
await this._entityStorageConnector.set(templateEntry);
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { property, entity, EntitySchemaFactory, EntitySchemaHelper } from '@twin.org/entity';
|
|
1
|
+
import { property, SortDirection, entity, EntitySchemaFactory, EntitySchemaHelper } from '@twin.org/entity';
|
|
2
2
|
import { Is, GeneralError, Guards } from '@twin.org/core';
|
|
3
3
|
import { EntityStorageConnectorFactory } from '@twin.org/entity-storage-models';
|
|
4
4
|
import { MessagingEmailConnectorFactory, MessagingPushNotificationsConnectorFactory, MessagingSmsConnectorFactory } from '@twin.org/messaging-models';
|
|
@@ -24,24 +24,24 @@ let TemplateEntry = class TemplateEntry {
|
|
|
24
24
|
/**
|
|
25
25
|
* The timestamp of the template entry.
|
|
26
26
|
*/
|
|
27
|
-
|
|
27
|
+
dateCreated;
|
|
28
28
|
};
|
|
29
29
|
__decorate([
|
|
30
30
|
property({ type: "string", isPrimary: true }),
|
|
31
31
|
__metadata("design:type", String)
|
|
32
|
-
], TemplateEntry.prototype, "id",
|
|
32
|
+
], TemplateEntry.prototype, "id", void 0);
|
|
33
33
|
__decorate([
|
|
34
34
|
property({ type: "string" }),
|
|
35
35
|
__metadata("design:type", String)
|
|
36
|
-
], TemplateEntry.prototype, "title",
|
|
36
|
+
], TemplateEntry.prototype, "title", void 0);
|
|
37
37
|
__decorate([
|
|
38
38
|
property({ type: "string" }),
|
|
39
39
|
__metadata("design:type", String)
|
|
40
|
-
], TemplateEntry.prototype, "content",
|
|
40
|
+
], TemplateEntry.prototype, "content", void 0);
|
|
41
41
|
__decorate([
|
|
42
|
-
property({ type: "
|
|
43
|
-
__metadata("design:type",
|
|
44
|
-
], TemplateEntry.prototype, "
|
|
42
|
+
property({ type: "string", format: "date-time", sortDirection: SortDirection.Descending }),
|
|
43
|
+
__metadata("design:type", String)
|
|
44
|
+
], TemplateEntry.prototype, "dateCreated", void 0);
|
|
45
45
|
TemplateEntry = __decorate([
|
|
46
46
|
entity()
|
|
47
47
|
], TemplateEntry);
|
|
@@ -52,10 +52,6 @@ TemplateEntry = __decorate([
|
|
|
52
52
|
* Service for performing email messaging operations to a connector.
|
|
53
53
|
*/
|
|
54
54
|
class MessagingService {
|
|
55
|
-
/**
|
|
56
|
-
* The namespace for the service.
|
|
57
|
-
*/
|
|
58
|
-
static NAMESPACE = "messaging";
|
|
59
55
|
/**
|
|
60
56
|
* Runtime name for the class.
|
|
61
57
|
*/
|
|
@@ -187,7 +183,7 @@ class MessagingService {
|
|
|
187
183
|
Guards.stringValue(this.CLASS_NAME, "content", content);
|
|
188
184
|
const templateEntry = new TemplateEntry();
|
|
189
185
|
templateEntry.id = `${templateId}:${locale}`;
|
|
190
|
-
templateEntry.
|
|
186
|
+
templateEntry.dateCreated = new Date(Date.now()).toISOString();
|
|
191
187
|
templateEntry.title = title;
|
|
192
188
|
templateEntry.content = content;
|
|
193
189
|
await this._entityStorageConnector.set(templateEntry);
|
|
@@ -4,10 +4,6 @@ import type { IMessagingServiceConstructorOptions } from "./models/IMessagingSer
|
|
|
4
4
|
* Service for performing email messaging operations to a connector.
|
|
5
5
|
*/
|
|
6
6
|
export declare class MessagingService implements IMessagingComponent {
|
|
7
|
-
/**
|
|
8
|
-
* The namespace for the service.
|
|
9
|
-
*/
|
|
10
|
-
static readonly NAMESPACE: string;
|
|
11
7
|
/**
|
|
12
8
|
* Runtime name for the class.
|
|
13
9
|
*/
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,103 @@
|
|
|
1
1
|
# @twin.org/messaging-service - Changelog
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## [0.0.2-next.1](https://github.com/twinfoundation/messaging/compare/messaging-service-v0.0.2-next.0...messaging-service-v0.0.2-next.1) (2025-08-20)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* Messaging services ([#3](https://github.com/twinfoundation/messaging/issues/3)) ([32571b5](https://github.com/twinfoundation/messaging/commit/32571b5abf5d3fc3b168074c23507e926c5d00b0))
|
|
9
|
+
* remove unused namespace ([2201898](https://github.com/twinfoundation/messaging/commit/22018988b84e4b3e76da1a1e16f29bfde7e6f0e6))
|
|
10
|
+
* update dependencies ([53dcde6](https://github.com/twinfoundation/messaging/commit/53dcde60d6efaee5957296f6d097cb97c0fb2f9d))
|
|
11
|
+
* update framework core ([fc476b4](https://github.com/twinfoundation/messaging/commit/fc476b48e6075de0ae871e3cec1fa179aa04b5eb))
|
|
12
|
+
* use shared store mechanism ([#8](https://github.com/twinfoundation/messaging/issues/8)) ([9ad65c2](https://github.com/twinfoundation/messaging/commit/9ad65c239ba77bb75604a1f6e51b975357f3228d))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* Adding format to the MessagingEntries ts number ([8b99d4f](https://github.com/twinfoundation/messaging/commit/8b99d4f01c4f2b08da8d2affc1b9554fcb0d3690))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Dependencies
|
|
21
|
+
|
|
22
|
+
* The following workspace dependencies were updated
|
|
23
|
+
* dependencies
|
|
24
|
+
* @twin.org/messaging-models bumped from 0.0.2-next.0 to 0.0.2-next.1
|
|
25
|
+
|
|
26
|
+
## 0.0.1 (2025-07-08)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
### Features
|
|
30
|
+
|
|
31
|
+
* release to production ([cc714a7](https://github.com/twinfoundation/messaging/commit/cc714a7e1db251ab8e1a158f7753387a56d60271))
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### Dependencies
|
|
35
|
+
|
|
36
|
+
* The following workspace dependencies were updated
|
|
37
|
+
* dependencies
|
|
38
|
+
* @twin.org/messaging-models bumped from ^0.0.0 to ^0.0.1
|
|
39
|
+
|
|
40
|
+
## [0.0.1-next.16](https://github.com/twinfoundation/messaging/compare/messaging-service-v0.0.1-next.15...messaging-service-v0.0.1-next.16) (2025-06-30)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
### Miscellaneous Chores
|
|
44
|
+
|
|
45
|
+
* **messaging-service:** Synchronize repo versions
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
### Dependencies
|
|
49
|
+
|
|
50
|
+
* The following workspace dependencies were updated
|
|
51
|
+
* dependencies
|
|
52
|
+
* @twin.org/messaging-models bumped from 0.0.1-next.15 to 0.0.1-next.16
|
|
53
|
+
|
|
54
|
+
## [0.0.1-next.15](https://github.com/twinfoundation/messaging/compare/messaging-service-v0.0.1-next.14...messaging-service-v0.0.1-next.15) (2025-06-12)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
### Features
|
|
58
|
+
|
|
59
|
+
* update dependencies ([53dcde6](https://github.com/twinfoundation/messaging/commit/53dcde60d6efaee5957296f6d097cb97c0fb2f9d))
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
### Dependencies
|
|
63
|
+
|
|
64
|
+
* The following workspace dependencies were updated
|
|
65
|
+
* dependencies
|
|
66
|
+
* @twin.org/messaging-models bumped from 0.0.1-next.14 to 0.0.1-next.15
|
|
67
|
+
|
|
68
|
+
## [0.0.1-next.14](https://github.com/twinfoundation/messaging/compare/messaging-service-v0.0.1-next.13...messaging-service-v0.0.1-next.14) (2025-04-17)
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
### Features
|
|
72
|
+
|
|
73
|
+
* use shared store mechanism ([#8](https://github.com/twinfoundation/messaging/issues/8)) ([9ad65c2](https://github.com/twinfoundation/messaging/commit/9ad65c239ba77bb75604a1f6e51b975357f3228d))
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
### Dependencies
|
|
77
|
+
|
|
78
|
+
* The following workspace dependencies were updated
|
|
79
|
+
* dependencies
|
|
80
|
+
* @twin.org/messaging-models bumped from 0.0.1-next.13 to 0.0.1-next.14
|
|
81
|
+
|
|
82
|
+
## [0.0.1-next.13](https://github.com/twinfoundation/messaging/compare/messaging-service-v0.0.1-next.12...messaging-service-v0.0.1-next.13) (2025-03-28)
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
### Features
|
|
86
|
+
|
|
87
|
+
* Messaging services ([#3](https://github.com/twinfoundation/messaging/issues/3)) ([32571b5](https://github.com/twinfoundation/messaging/commit/32571b5abf5d3fc3b168074c23507e926c5d00b0))
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
### Bug Fixes
|
|
91
|
+
|
|
92
|
+
* Adding format to the MessagingEntries ts number ([8b99d4f](https://github.com/twinfoundation/messaging/commit/8b99d4f01c4f2b08da8d2affc1b9554fcb0d3690))
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
### Dependencies
|
|
96
|
+
|
|
97
|
+
* The following workspace dependencies were updated
|
|
98
|
+
* dependencies
|
|
99
|
+
* @twin.org/messaging-models bumped from 0.0.1-next.12 to 0.0.1-next.13
|
|
100
|
+
|
|
101
|
+
## v0.0.1-next.12
|
|
4
102
|
|
|
5
103
|
- Initial Release
|
|
@@ -8,9 +8,9 @@ Service for performing email messaging operations to a connector.
|
|
|
8
8
|
|
|
9
9
|
## Constructors
|
|
10
10
|
|
|
11
|
-
###
|
|
11
|
+
### Constructor
|
|
12
12
|
|
|
13
|
-
> **new MessagingService**(`options
|
|
13
|
+
> **new MessagingService**(`options?`): `MessagingService`
|
|
14
14
|
|
|
15
15
|
Create a new instance of MessagingService.
|
|
16
16
|
|
|
@@ -24,18 +24,10 @@ The options for the connector.
|
|
|
24
24
|
|
|
25
25
|
#### Returns
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
`MessagingService`
|
|
28
28
|
|
|
29
29
|
## Properties
|
|
30
30
|
|
|
31
|
-
### NAMESPACE
|
|
32
|
-
|
|
33
|
-
> `readonly` `static` **NAMESPACE**: `string` = `"messaging"`
|
|
34
|
-
|
|
35
|
-
The namespace for the service.
|
|
36
|
-
|
|
37
|
-
***
|
|
38
|
-
|
|
39
31
|
### CLASS\_NAME
|
|
40
32
|
|
|
41
33
|
> `readonly` **CLASS\_NAME**: `string`
|
|
@@ -4,13 +4,13 @@ Call defining a template message entry.
|
|
|
4
4
|
|
|
5
5
|
## Constructors
|
|
6
6
|
|
|
7
|
-
###
|
|
7
|
+
### Constructor
|
|
8
8
|
|
|
9
|
-
> **new TemplateEntry**():
|
|
9
|
+
> **new TemplateEntry**(): `TemplateEntry`
|
|
10
10
|
|
|
11
11
|
#### Returns
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
`TemplateEntry`
|
|
14
14
|
|
|
15
15
|
## Properties
|
|
16
16
|
|
|
@@ -38,8 +38,8 @@ The content.
|
|
|
38
38
|
|
|
39
39
|
***
|
|
40
40
|
|
|
41
|
-
###
|
|
41
|
+
### dateCreated
|
|
42
42
|
|
|
43
|
-
> **
|
|
43
|
+
> **dateCreated**: `string`
|
|
44
44
|
|
|
45
45
|
The timestamp of the template entry.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/messaging-service",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2-next.1",
|
|
4
4
|
"description": "Messaging service implementation",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@twin.org/core": "next",
|
|
18
18
|
"@twin.org/entity": "next",
|
|
19
|
-
"@twin.org/entity-storage-models": "
|
|
19
|
+
"@twin.org/entity-storage-models": "next",
|
|
20
20
|
"@twin.org/logging-models": "next",
|
|
21
|
-
"@twin.org/messaging-models": "0.0.
|
|
21
|
+
"@twin.org/messaging-models": "0.0.2-next.1",
|
|
22
22
|
"@twin.org/nameof": "next"
|
|
23
23
|
},
|
|
24
24
|
"main": "./dist/cjs/index.cjs",
|