@twin.org/messaging-service 0.0.1-next.5 → 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 +10 -10
- package/dist/esm/index.mjs +2 -2
- package/dist/types/index.d.ts +1 -0
- package/docs/changelog.md +1 -1
- 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.
|
|
@@ -191,7 +191,7 @@ class MessagingService {
|
|
|
191
191
|
core.Guards.stringValue(this.CLASS_NAME, "locale", locale);
|
|
192
192
|
core.Guards.stringValue(this.CLASS_NAME, "title", title);
|
|
193
193
|
core.Guards.stringValue(this.CLASS_NAME, "content", content);
|
|
194
|
-
const templateEntry = new TemplateEntry();
|
|
194
|
+
const templateEntry = new exports.TemplateEntry();
|
|
195
195
|
templateEntry.id = `${templateId}:${locale}`;
|
|
196
196
|
templateEntry.ts = Date.now();
|
|
197
197
|
templateEntry.title = title;
|
|
@@ -245,7 +245,7 @@ class MessagingService {
|
|
|
245
245
|
* Initialize the schema for the messaging service.
|
|
246
246
|
*/
|
|
247
247
|
function initSchema() {
|
|
248
|
-
entity.EntitySchemaFactory.register("TemplateEntry", () => entity.EntitySchemaHelper.getSchema(TemplateEntry));
|
|
248
|
+
entity.EntitySchemaFactory.register("TemplateEntry", () => entity.EntitySchemaHelper.getSchema(exports.TemplateEntry));
|
|
249
249
|
}
|
|
250
250
|
|
|
251
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.
|
|
@@ -246,4 +246,4 @@ function initSchema() {
|
|
|
246
246
|
EntitySchemaFactory.register("TemplateEntry", () => EntitySchemaHelper.getSchema(TemplateEntry));
|
|
247
247
|
}
|
|
248
248
|
|
|
249
|
-
export { MessagingService, initSchema };
|
|
249
|
+
export { MessagingService, TemplateEntry, initSchema };
|
package/dist/types/index.d.ts
CHANGED
package/docs/changelog.md
CHANGED
|
@@ -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",
|