@twin.org/messaging-service 0.0.1-next.4 → 0.0.1-next.6
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 +14 -10
- package/dist/esm/index.mjs +6 -2
- package/dist/types/index.d.ts +1 -0
- package/dist/types/messagingService.d.ts +4 -0
- package/docs/changelog.md +1 -1
- package/docs/reference/classes/MessagingService.md +8 -0
- package/docs/reference/classes/TemplateEntry.md +45 -0
- package/docs/reference/index.md +1 -0
- package/package.json +3 -3
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var entity = require('@twin.org/entity');
|
|
3
4
|
var core = require('@twin.org/core');
|
|
4
5
|
var entityStorageModels = require('@twin.org/entity-storage-models');
|
|
5
6
|
var messagingModels = require('@twin.org/messaging-models');
|
|
6
|
-
var entity = require('@twin.org/entity');
|
|
7
7
|
|
|
8
8
|
// Copyright 2024 IOTA Stiftung.
|
|
9
9
|
// SPDX-License-Identifier: Apache-2.0.
|
|
10
10
|
/**
|
|
11
11
|
* Call defining a template message entry.
|
|
12
12
|
*/
|
|
13
|
-
|
|
13
|
+
exports.TemplateEntry = class TemplateEntry {
|
|
14
14
|
/**
|
|
15
15
|
* The id.
|
|
16
16
|
*/
|
|
@@ -31,22 +31,22 @@ let TemplateEntry = class TemplateEntry {
|
|
|
31
31
|
__decorate([
|
|
32
32
|
entity.property({ type: "string", isPrimary: true }),
|
|
33
33
|
__metadata("design:type", String)
|
|
34
|
-
], TemplateEntry.prototype, "id", void 0);
|
|
34
|
+
], exports.TemplateEntry.prototype, "id", void 0);
|
|
35
35
|
__decorate([
|
|
36
36
|
entity.property({ type: "string" }),
|
|
37
37
|
__metadata("design:type", String)
|
|
38
|
-
], TemplateEntry.prototype, "title", void 0);
|
|
38
|
+
], exports.TemplateEntry.prototype, "title", void 0);
|
|
39
39
|
__decorate([
|
|
40
40
|
entity.property({ type: "string" }),
|
|
41
41
|
__metadata("design:type", String)
|
|
42
|
-
], TemplateEntry.prototype, "content", void 0);
|
|
42
|
+
], exports.TemplateEntry.prototype, "content", void 0);
|
|
43
43
|
__decorate([
|
|
44
44
|
entity.property({ type: "integer" }),
|
|
45
45
|
__metadata("design:type", Number)
|
|
46
|
-
], TemplateEntry.prototype, "ts", void 0);
|
|
47
|
-
TemplateEntry = __decorate([
|
|
46
|
+
], exports.TemplateEntry.prototype, "ts", void 0);
|
|
47
|
+
exports.TemplateEntry = __decorate([
|
|
48
48
|
entity.entity()
|
|
49
|
-
], TemplateEntry);
|
|
49
|
+
], exports.TemplateEntry);
|
|
50
50
|
|
|
51
51
|
// Copyright 2024 IOTA Stiftung.
|
|
52
52
|
// SPDX-License-Identifier: Apache-2.0.
|
|
@@ -54,6 +54,10 @@ 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";
|
|
57
61
|
/**
|
|
58
62
|
* Runtime name for the class.
|
|
59
63
|
*/
|
|
@@ -187,7 +191,7 @@ class MessagingService {
|
|
|
187
191
|
core.Guards.stringValue(this.CLASS_NAME, "locale", locale);
|
|
188
192
|
core.Guards.stringValue(this.CLASS_NAME, "title", title);
|
|
189
193
|
core.Guards.stringValue(this.CLASS_NAME, "content", content);
|
|
190
|
-
const templateEntry = new TemplateEntry();
|
|
194
|
+
const templateEntry = new exports.TemplateEntry();
|
|
191
195
|
templateEntry.id = `${templateId}:${locale}`;
|
|
192
196
|
templateEntry.ts = Date.now();
|
|
193
197
|
templateEntry.title = title;
|
|
@@ -241,7 +245,7 @@ class MessagingService {
|
|
|
241
245
|
* Initialize the schema for the messaging service.
|
|
242
246
|
*/
|
|
243
247
|
function initSchema() {
|
|
244
|
-
entity.EntitySchemaFactory.register("TemplateEntry", () => entity.EntitySchemaHelper.getSchema(TemplateEntry));
|
|
248
|
+
entity.EntitySchemaFactory.register("TemplateEntry", () => entity.EntitySchemaHelper.getSchema(exports.TemplateEntry));
|
|
245
249
|
}
|
|
246
250
|
|
|
247
251
|
exports.MessagingService = MessagingService;
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { property, entity, EntitySchemaFactory, EntitySchemaHelper } from '@twin.org/entity';
|
|
1
2
|
import { Is, GeneralError, Guards } from '@twin.org/core';
|
|
2
3
|
import { EntityStorageConnectorFactory } from '@twin.org/entity-storage-models';
|
|
3
4
|
import { MessagingEmailConnectorFactory, MessagingPushNotificationsConnectorFactory, MessagingSmsConnectorFactory } from '@twin.org/messaging-models';
|
|
4
|
-
import { property, entity, EntitySchemaFactory, EntitySchemaHelper } from '@twin.org/entity';
|
|
5
5
|
|
|
6
6
|
// Copyright 2024 IOTA Stiftung.
|
|
7
7
|
// SPDX-License-Identifier: Apache-2.0.
|
|
@@ -52,6 +52,10 @@ 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";
|
|
55
59
|
/**
|
|
56
60
|
* Runtime name for the class.
|
|
57
61
|
*/
|
|
@@ -242,4 +246,4 @@ function initSchema() {
|
|
|
242
246
|
EntitySchemaFactory.register("TemplateEntry", () => EntitySchemaHelper.getSchema(TemplateEntry));
|
|
243
247
|
}
|
|
244
248
|
|
|
245
|
-
export { MessagingService, initSchema };
|
|
249
|
+
export { MessagingService, TemplateEntry, initSchema };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -3,6 +3,10 @@ import { type IMessagingComponent } from "@twin.org/messaging-models";
|
|
|
3
3
|
* Service for performing email messaging operations to a connector.
|
|
4
4
|
*/
|
|
5
5
|
export declare class MessagingService implements IMessagingComponent {
|
|
6
|
+
/**
|
|
7
|
+
* The namespace for the service.
|
|
8
|
+
*/
|
|
9
|
+
static readonly NAMESPACE: string;
|
|
6
10
|
/**
|
|
7
11
|
* Runtime name for the class.
|
|
8
12
|
*/
|
package/docs/changelog.md
CHANGED
|
@@ -42,6 +42,14 @@ The type of the entity connector to use, defaults to "messaging-templates".
|
|
|
42
42
|
|
|
43
43
|
## Properties
|
|
44
44
|
|
|
45
|
+
### NAMESPACE
|
|
46
|
+
|
|
47
|
+
> `readonly` `static` **NAMESPACE**: `string` = `"messaging"`
|
|
48
|
+
|
|
49
|
+
The namespace for the service.
|
|
50
|
+
|
|
51
|
+
***
|
|
52
|
+
|
|
45
53
|
### CLASS\_NAME
|
|
46
54
|
|
|
47
55
|
> `readonly` **CLASS\_NAME**: `string`
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Class: TemplateEntry
|
|
2
|
+
|
|
3
|
+
Call defining a template message entry.
|
|
4
|
+
|
|
5
|
+
## Constructors
|
|
6
|
+
|
|
7
|
+
### new TemplateEntry()
|
|
8
|
+
|
|
9
|
+
> **new TemplateEntry**(): [`TemplateEntry`](TemplateEntry.md)
|
|
10
|
+
|
|
11
|
+
#### Returns
|
|
12
|
+
|
|
13
|
+
[`TemplateEntry`](TemplateEntry.md)
|
|
14
|
+
|
|
15
|
+
## Properties
|
|
16
|
+
|
|
17
|
+
### id
|
|
18
|
+
|
|
19
|
+
> **id**: `string`
|
|
20
|
+
|
|
21
|
+
The id.
|
|
22
|
+
|
|
23
|
+
***
|
|
24
|
+
|
|
25
|
+
### title
|
|
26
|
+
|
|
27
|
+
> **title**: `string`
|
|
28
|
+
|
|
29
|
+
The title.
|
|
30
|
+
|
|
31
|
+
***
|
|
32
|
+
|
|
33
|
+
### content
|
|
34
|
+
|
|
35
|
+
> **content**: `string`
|
|
36
|
+
|
|
37
|
+
The content.
|
|
38
|
+
|
|
39
|
+
***
|
|
40
|
+
|
|
41
|
+
### ts
|
|
42
|
+
|
|
43
|
+
> **ts**: `number`
|
|
44
|
+
|
|
45
|
+
The timestamp of the template entry.
|
package/docs/reference/index.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/messaging-service",
|
|
3
|
-
"version": "0.0.1-next.
|
|
3
|
+
"version": "0.0.1-next.6",
|
|
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": "^0.0.1-next.
|
|
19
|
+
"@twin.org/entity-storage-models": "^0.0.1-next.6",
|
|
20
20
|
"@twin.org/logging-models": "next",
|
|
21
|
-
"@twin.org/messaging-models": "0.0.1-next.
|
|
21
|
+
"@twin.org/messaging-models": "0.0.1-next.6",
|
|
22
22
|
"@twin.org/nameof": "next"
|
|
23
23
|
},
|
|
24
24
|
"main": "./dist/cjs/index.cjs",
|