@twin.org/messaging-service 0.0.1-next.7 → 0.0.1-next.9

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.
@@ -31,19 +31,19 @@ exports.TemplateEntry = class TemplateEntry {
31
31
  __decorate([
32
32
  entity.property({ type: "string", isPrimary: true }),
33
33
  __metadata("design:type", String)
34
- ], exports.TemplateEntry.prototype, "id", void 0);
34
+ ], exports.TemplateEntry.prototype, "id", undefined);
35
35
  __decorate([
36
36
  entity.property({ type: "string" }),
37
37
  __metadata("design:type", String)
38
- ], exports.TemplateEntry.prototype, "title", void 0);
38
+ ], exports.TemplateEntry.prototype, "title", undefined);
39
39
  __decorate([
40
40
  entity.property({ type: "string" }),
41
41
  __metadata("design:type", String)
42
- ], exports.TemplateEntry.prototype, "content", void 0);
42
+ ], exports.TemplateEntry.prototype, "content", undefined);
43
43
  __decorate([
44
44
  entity.property({ type: "integer" }),
45
45
  __metadata("design:type", Number)
46
- ], exports.TemplateEntry.prototype, "ts", void 0);
46
+ ], exports.TemplateEntry.prototype, "ts", undefined);
47
47
  exports.TemplateEntry = __decorate([
48
48
  entity.entity()
49
49
  ], exports.TemplateEntry);
@@ -85,10 +85,6 @@ class MessagingService {
85
85
  /**
86
86
  * Create a new instance of MessagingService.
87
87
  * @param options The options for the connector.
88
- * @param options.messagingEmailConnectorType The type of the email messaging connector to use, defaults to not configured.
89
- * @param options.messagingPushNotificationConnectorType The type of the push notifications messaging connector to use, defaults to not configured.
90
- * @param options.messagingSmsConnectorType The type of the sms messaging connector to use, defaults to not configured.
91
- * @param options.templateEntryStorageConnectorType The type of the entity connector to use, defaults to "messaging-templates".
92
88
  */
93
89
  constructor(options) {
94
90
  if (core.Is.stringValue(options?.messagingEmailConnectorType)) {
@@ -29,19 +29,19 @@ let TemplateEntry = class TemplateEntry {
29
29
  __decorate([
30
30
  property({ type: "string", isPrimary: true }),
31
31
  __metadata("design:type", String)
32
- ], TemplateEntry.prototype, "id", void 0);
32
+ ], TemplateEntry.prototype, "id", undefined);
33
33
  __decorate([
34
34
  property({ type: "string" }),
35
35
  __metadata("design:type", String)
36
- ], TemplateEntry.prototype, "title", void 0);
36
+ ], TemplateEntry.prototype, "title", undefined);
37
37
  __decorate([
38
38
  property({ type: "string" }),
39
39
  __metadata("design:type", String)
40
- ], TemplateEntry.prototype, "content", void 0);
40
+ ], TemplateEntry.prototype, "content", undefined);
41
41
  __decorate([
42
42
  property({ type: "integer" }),
43
43
  __metadata("design:type", Number)
44
- ], TemplateEntry.prototype, "ts", void 0);
44
+ ], TemplateEntry.prototype, "ts", undefined);
45
45
  TemplateEntry = __decorate([
46
46
  entity()
47
47
  ], TemplateEntry);
@@ -83,10 +83,6 @@ class MessagingService {
83
83
  /**
84
84
  * Create a new instance of MessagingService.
85
85
  * @param options The options for the connector.
86
- * @param options.messagingEmailConnectorType The type of the email messaging connector to use, defaults to not configured.
87
- * @param options.messagingPushNotificationConnectorType The type of the push notifications messaging connector to use, defaults to not configured.
88
- * @param options.messagingSmsConnectorType The type of the sms messaging connector to use, defaults to not configured.
89
- * @param options.templateEntryStorageConnectorType The type of the entity connector to use, defaults to "messaging-templates".
90
86
  */
91
87
  constructor(options) {
92
88
  if (Is.stringValue(options?.messagingEmailConnectorType)) {
@@ -1,3 +1,4 @@
1
1
  export * from "./entities/templateEntry";
2
2
  export * from "./messagingService";
3
+ export * from "./models/IMessagingServiceConstructorOptions";
3
4
  export * from "./schema";
@@ -1,4 +1,5 @@
1
1
  import { type IMessagingComponent } from "@twin.org/messaging-models";
2
+ import type { IMessagingServiceConstructorOptions } from "./models/IMessagingServiceConstructorOptions";
2
3
  /**
3
4
  * Service for performing email messaging operations to a connector.
4
5
  */
@@ -14,17 +15,8 @@ export declare class MessagingService implements IMessagingComponent {
14
15
  /**
15
16
  * Create a new instance of MessagingService.
16
17
  * @param options The options for the connector.
17
- * @param options.messagingEmailConnectorType The type of the email messaging connector to use, defaults to not configured.
18
- * @param options.messagingPushNotificationConnectorType The type of the push notifications messaging connector to use, defaults to not configured.
19
- * @param options.messagingSmsConnectorType The type of the sms messaging connector to use, defaults to not configured.
20
- * @param options.templateEntryStorageConnectorType The type of the entity connector to use, defaults to "messaging-templates".
21
18
  */
22
- constructor(options?: {
23
- messagingEmailConnectorType?: string;
24
- messagingPushNotificationConnectorType?: string;
25
- messagingSmsConnectorType?: string;
26
- templateEntryStorageConnectorType?: string;
27
- });
19
+ constructor(options?: IMessagingServiceConstructorOptions);
28
20
  /**
29
21
  * Send a custom email.
30
22
  * @param sender The sender email address.
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Options for the messaging service.
3
+ */
4
+ export interface IMessagingServiceConstructorOptions {
5
+ /**
6
+ * The type of the email messaging connector to use, defaults to not configured.
7
+ */
8
+ messagingEmailConnectorType?: string;
9
+ /**
10
+ * The type of the push notifications messaging connector to use, defaults to not configured.
11
+ */
12
+ messagingPushNotificationConnectorType?: string;
13
+ /**
14
+ * The type of the sms messaging connector to use, defaults to not configured.
15
+ */
16
+ messagingSmsConnectorType?: string;
17
+ /**
18
+ * The type of the entity connector to use.
19
+ * @default template-entry
20
+ */
21
+ templateEntryStorageConnectorType?: string;
22
+ }
package/docs/changelog.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # @twin.org/messaging-service - Changelog
2
2
 
3
- ## v0.0.1-next.7
3
+ ## v0.0.1-next.9
4
4
 
5
5
  - Initial Release
@@ -16,25 +16,11 @@ Create a new instance of MessagingService.
16
16
 
17
17
  #### Parameters
18
18
 
19
- **options?**
19
+ ##### options?
20
20
 
21
- The options for the connector.
22
-
23
- • **options.messagingEmailConnectorType?**: `string`
24
-
25
- The type of the email messaging connector to use, defaults to not configured.
26
-
27
- • **options.messagingPushNotificationConnectorType?**: `string`
28
-
29
- The type of the push notifications messaging connector to use, defaults to not configured.
30
-
31
- • **options.messagingSmsConnectorType?**: `string`
32
-
33
- The type of the sms messaging connector to use, defaults to not configured.
21
+ [`IMessagingServiceConstructorOptions`](../interfaces/IMessagingServiceConstructorOptions.md)
34
22
 
35
- **options.templateEntryStorageConnectorType?**: `string`
36
-
37
- The type of the entity connector to use, defaults to "messaging-templates".
23
+ The options for the connector.
38
24
 
39
25
  #### Returns
40
26
 
@@ -70,23 +56,31 @@ Send a custom email.
70
56
 
71
57
  #### Parameters
72
58
 
73
- **sender**: `string`
59
+ ##### sender
60
+
61
+ `string`
74
62
 
75
63
  The sender email address.
76
64
 
77
- **recipients**: `string`[]
65
+ ##### recipients
66
+
67
+ `string`[]
78
68
 
79
69
  An array of recipients email addresses.
80
70
 
81
- **templateId**: `string`
71
+ ##### templateId
72
+
73
+ `string`
82
74
 
83
75
  The id of the email template.
84
76
 
85
- **data**
77
+ ##### data
86
78
 
87
79
  The data to populate the email template.
88
80
 
89
- **locale**: `string`
81
+ ##### locale
82
+
83
+ `string`
90
84
 
91
85
  The locale of the email template.
92
86
 
@@ -110,11 +104,15 @@ Registers a device to an specific app in order to send notifications to it.
110
104
 
111
105
  #### Parameters
112
106
 
113
- **applicationId**: `string`
107
+ ##### applicationId
108
+
109
+ `string`
114
110
 
115
111
  The application address.
116
112
 
117
- **deviceToken**: `string`
113
+ ##### deviceToken
114
+
115
+ `string`
118
116
 
119
117
  The device token.
120
118
 
@@ -138,19 +136,25 @@ Send a push notification to a device.
138
136
 
139
137
  #### Parameters
140
138
 
141
- **deviceAddress**: `string`
139
+ ##### deviceAddress
140
+
141
+ `string`
142
142
 
143
143
  The address of the device.
144
144
 
145
- **templateId**: `string`
145
+ ##### templateId
146
+
147
+ `string`
146
148
 
147
149
  The id of the push notification template.
148
150
 
149
- **data**
151
+ ##### data
150
152
 
151
153
  The data to populate the push notification template.
152
154
 
153
- **locale**: `string`
155
+ ##### locale
156
+
157
+ `string`
154
158
 
155
159
  The locale of the push notification template.
156
160
 
@@ -174,19 +178,25 @@ Send a SMS message to a phone number.
174
178
 
175
179
  #### Parameters
176
180
 
177
- **phoneNumber**: `string`
181
+ ##### phoneNumber
182
+
183
+ `string`
178
184
 
179
185
  The recipient phone number.
180
186
 
181
- **templateId**: `string`
187
+ ##### templateId
188
+
189
+ `string`
182
190
 
183
191
  The id of the SMS template.
184
192
 
185
- **data**
193
+ ##### data
186
194
 
187
195
  The data to populate the SMS template.
188
196
 
189
- **locale**: `string`
197
+ ##### locale
198
+
199
+ `string`
190
200
 
191
201
  The locale of the SMS template.
192
202
 
@@ -210,19 +220,27 @@ Create or update a template.
210
220
 
211
221
  #### Parameters
212
222
 
213
- **templateId**: `string`
223
+ ##### templateId
224
+
225
+ `string`
214
226
 
215
227
  The id of the template.
216
228
 
217
- **locale**: `string`
229
+ ##### locale
230
+
231
+ `string`
218
232
 
219
233
  The locale of the template.
220
234
 
221
- **title**: `string`
235
+ ##### title
236
+
237
+ `string`
222
238
 
223
239
  The title of the template.
224
240
 
225
- **content**: `string`
241
+ ##### content
242
+
243
+ `string`
226
244
 
227
245
  The content of the template.
228
246
 
@@ -5,6 +5,10 @@
5
5
  - [TemplateEntry](classes/TemplateEntry.md)
6
6
  - [MessagingService](classes/MessagingService.md)
7
7
 
8
+ ## Interfaces
9
+
10
+ - [IMessagingServiceConstructorOptions](interfaces/IMessagingServiceConstructorOptions.md)
11
+
8
12
  ## Functions
9
13
 
10
14
  - [initSchema](functions/initSchema.md)
@@ -0,0 +1,41 @@
1
+ # Interface: IMessagingServiceConstructorOptions
2
+
3
+ Options for the messaging service.
4
+
5
+ ## Properties
6
+
7
+ ### messagingEmailConnectorType?
8
+
9
+ > `optional` **messagingEmailConnectorType**: `string`
10
+
11
+ The type of the email messaging connector to use, defaults to not configured.
12
+
13
+ ***
14
+
15
+ ### messagingPushNotificationConnectorType?
16
+
17
+ > `optional` **messagingPushNotificationConnectorType**: `string`
18
+
19
+ The type of the push notifications messaging connector to use, defaults to not configured.
20
+
21
+ ***
22
+
23
+ ### messagingSmsConnectorType?
24
+
25
+ > `optional` **messagingSmsConnectorType**: `string`
26
+
27
+ The type of the sms messaging connector to use, defaults to not configured.
28
+
29
+ ***
30
+
31
+ ### templateEntryStorageConnectorType?
32
+
33
+ > `optional` **templateEntryStorageConnectorType**: `string`
34
+
35
+ The type of the entity connector to use.
36
+
37
+ #### Default
38
+
39
+ ```ts
40
+ template-entry
41
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/messaging-service",
3
- "version": "0.0.1-next.7",
3
+ "version": "0.0.1-next.9",
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.7",
19
+ "@twin.org/entity-storage-models": "^0.0.1-next.9",
20
20
  "@twin.org/logging-models": "next",
21
- "@twin.org/messaging-models": "0.0.1-next.7",
21
+ "@twin.org/messaging-models": "0.0.1-next.9",
22
22
  "@twin.org/nameof": "next"
23
23
  },
24
24
  "main": "./dist/cjs/index.cjs",
@@ -26,9 +26,9 @@
26
26
  "types": "./dist/types/index.d.ts",
27
27
  "exports": {
28
28
  ".": {
29
+ "types": "./dist/types/index.d.ts",
29
30
  "require": "./dist/cjs/index.cjs",
30
- "import": "./dist/esm/index.mjs",
31
- "types": "./dist/types/index.d.ts"
31
+ "import": "./dist/esm/index.mjs"
32
32
  },
33
33
  "./locales": "./locales"
34
34
  },