@d19n/youfibre-odin-sdk 1.0.311 → 1.0.313

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/README.md CHANGED
@@ -347,7 +347,7 @@ This SDK includes **159** entities across **12** modules.
347
347
 
348
348
  ## Actions
349
349
 
350
- This SDK includes **499** actions.
350
+ This SDK includes **500** actions.
351
351
 
352
352
  ### Action Types
353
353
 
@@ -1468,6 +1468,7 @@ This SDK includes **499** actions.
1468
1468
  | Action | Type | Event |
1469
1469
  |--------|------|-------|
1470
1470
  | `CreateTransactionalEmail` | CREATE | NotificationModule.Email.Create.CreateTransactionalEmail |
1471
+ | `UpdateEmail` | UPDATE | NotificationModule.Email.Update.UpdateEmail |
1471
1472
  | `UpdateSupportEmail` | UPDATE | NotificationModule.Email.Update.Update Support Email |
1472
1473
 
1473
1474
  #### WayleaveAudit
@@ -23,7 +23,7 @@ export interface CreateTransactionalEmailMessage extends OdinRecordCreatedEvent<
23
23
  * Properties for CreateTransactionalEmail action
24
24
  *
25
25
  * @property Required fields: 1
26
- * @property Optional fields: 16
26
+ * @property Optional fields: 17
27
27
  */
28
28
  export interface CreateTransactionalEmailProperties {
29
29
  /**
@@ -146,6 +146,13 @@ export interface CreateTransactionalEmailProperties {
146
146
  * @type {TEXT}
147
147
  */
148
148
  Subject?: string | null;
149
+ /**
150
+ * Status
151
+ *
152
+ * Status of the email in the process
153
+ * @type {ENUM}
154
+ */
155
+ Status?: string | null;
149
156
  }
150
157
  /**
151
158
  * CreateTransactionalEmail
@@ -0,0 +1,192 @@
1
+ /**
2
+ * UpdateEmail Action DTO
3
+ *
4
+ * Update Email entity
5
+ *
6
+ * @module NotificationModule
7
+ * @entity Email
8
+ * @actionKey UpdateEmail
9
+ * @event 8443898e-c0db-4ce4-a0c4-4ae8e39d312f.NotificationModule.Email.Update.UpdateEmail
10
+ *
11
+ * AUTO-GENERATED - DO NOT EDIT DIRECTLY
12
+ */
13
+ import { OdinRecord, OdinRecordUpdateDto, OdinRecordUpdatedEvent } from '@d19n/odin-types/dist/core';
14
+ /**
15
+ * RabbitMQ message payload for UpdateEmail updated events
16
+ *
17
+ * @event NotificationModule.Email.Update.UpdateEmail
18
+ */
19
+ export interface UpdateEmailMessage extends OdinRecordUpdatedEvent<UpdateEmailDto, UpdateEmailProperties> {
20
+ }
21
+ /**
22
+ * Properties for UpdateEmail action
23
+ *
24
+ * @property Required fields: 1
25
+ * @property Optional fields: 17
26
+ */
27
+ export interface UpdateEmailProperties {
28
+ /**
29
+ * Date
30
+ *
31
+ * Date field for Email records. Used by Communications team.
32
+ * @type {DATE_TIME}
33
+ * @required
34
+ */
35
+ Date: string;
36
+ /**
37
+ * Status
38
+ *
39
+ * Status of the email in the process
40
+ * @type {ENUM}
41
+ */
42
+ Status?: string | null;
43
+ /**
44
+ * Case
45
+ *
46
+ * Data field for Email records. Used by Communications team.
47
+ * @type {LOOKUP}
48
+ */
49
+ Case?: string | null;
50
+ /**
51
+ * SenderType
52
+ *
53
+ * Sender Type (Communications - Email)
54
+ * @type {ENUM}
55
+ */
56
+ SenderType?: string | null;
57
+ /**
58
+ * Bcc
59
+ *
60
+ * Blind Carbon Copy (Communications - Email)
61
+ * @type {TEXT}
62
+ */
63
+ Bcc?: string | null;
64
+ /**
65
+ * UpdatedAt
66
+ *
67
+ * When the email was updated (Communications - Email)
68
+ * @type {DATE_TIME}
69
+ */
70
+ UpdatedAt?: string | null;
71
+ /**
72
+ * Files
73
+ *
74
+ * email attachments (Communications - Email)
75
+ * @type {FILE_MULTIPLE}
76
+ */
77
+ Files?: undefined | null;
78
+ /**
79
+ * From
80
+ *
81
+ * Data field for Email records. Used by Communications team.
82
+ * @type {TEXT}
83
+ */
84
+ From?: string | null;
85
+ /**
86
+ * MessageId
87
+ *
88
+ * SMTP Message Id (Communications - Email)
89
+ * @type {TEXT}
90
+ */
91
+ MessageId?: string | null;
92
+ /**
93
+ * Message
94
+ *
95
+ * Data field for Email records. Used by Communications team.
96
+ * @type {TEXT}
97
+ */
98
+ Message?: string | null;
99
+ /**
100
+ * ParentMessageId
101
+ *
102
+ * Parent Message id (Communications - Email)
103
+ * @type {LOOKUP}
104
+ */
105
+ ParentMessageId?: string | null;
106
+ /**
107
+ * CreatedAt
108
+ *
109
+ * When the email was created (Communications - Email)
110
+ * @type {DATE_TIME}
111
+ */
112
+ CreatedAt?: string | null;
113
+ /**
114
+ * Envelope
115
+ *
116
+ * Data field for Email records. Used by Communications team.
117
+ * @type {JSON}
118
+ */
119
+ Envelope?: string | null;
120
+ /**
121
+ * InReplyTo
122
+ *
123
+ * In Reply To (Communications - Email)
124
+ * @type {TEXT}
125
+ */
126
+ InReplyTo?: string | null;
127
+ /**
128
+ * To
129
+ *
130
+ * Data field for Email records. Used by Communications team.
131
+ * @type {TEXT}
132
+ */
133
+ To?: string | null;
134
+ /**
135
+ * Cc
136
+ *
137
+ * Carbon Copy (Communications - Email)
138
+ * @type {TEXT}
139
+ */
140
+ Cc?: string | null;
141
+ /**
142
+ * FormattedMessage
143
+ *
144
+ * Formatted Message (Communications - Email)
145
+ * @type {HTML}
146
+ */
147
+ FormattedMessage?: string | null;
148
+ /**
149
+ * Subject
150
+ *
151
+ * Data field for Email records. Used by Communications team.
152
+ * @type {TEXT}
153
+ */
154
+ Subject?: string | null;
155
+ }
156
+ /**
157
+ * UpdateEmail
158
+ *
159
+ * Update Email entity
160
+ *
161
+ * @actionType UPDATE - Updates an existing Email record
162
+ * @module NotificationModule
163
+ * @entity Email
164
+ * @event NotificationModule.Email.Update.UpdateEmail
165
+ * @permission schema.action.updateemail.trigger
166
+ * @benchmark This action is tracked for performance benchmarks
167
+ */
168
+ export declare class UpdateEmailDto extends OdinRecordUpdateDto<UpdateEmailProperties> {
169
+ /** Used by SDK generators to identify action type */
170
+ static readonly ACTION_TYPE = "UPDATE";
171
+ static readonly ACTION_KEY = "UpdateEmail";
172
+ static readonly MODULE_NAME = "NotificationModule";
173
+ static readonly ENTITIES: string[];
174
+ static readonly EVENT_NAME = "NotificationModule.Email.Update.UpdateEmail";
175
+ static readonly PERMISSION = "schema.action.updateemail.trigger";
176
+ /** Step metadata - entity this action targets */
177
+ static readonly STEP_ENTITY = "NotificationModule:Email";
178
+ static readonly STEP_SCHEMA_ID = "a3b4d6b7-0647-4202-90a6-036e3c87c5ae";
179
+ static readonly STEP_SCHEMA_ACTION_ID = "114cc01f-fa99-4c1d-86d5-a0d7d3bc284e";
180
+ static readonly AUTO_LINK_PARENT = false;
181
+ readonly actionName: string;
182
+ readonly schemaActionId: string;
183
+ readonly entity: string;
184
+ constructor(record: OdinRecord<any> | {
185
+ id: string;
186
+ entity: string;
187
+ type?: string;
188
+ }, properties: UpdateEmailProperties, options?: {
189
+ journeyId?: string;
190
+ stageKey?: string;
191
+ });
192
+ }
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ /**
3
+ * UpdateEmail Action DTO
4
+ *
5
+ * Update Email entity
6
+ *
7
+ * @module NotificationModule
8
+ * @entity Email
9
+ * @actionKey UpdateEmail
10
+ * @event 8443898e-c0db-4ce4-a0c4-4ae8e39d312f.NotificationModule.Email.Update.UpdateEmail
11
+ *
12
+ * AUTO-GENERATED - DO NOT EDIT DIRECTLY
13
+ */
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.UpdateEmailDto = void 0;
16
+ const core_1 = require("@d19n/odin-types/dist/core");
17
+ /**
18
+ * UpdateEmail
19
+ *
20
+ * Update Email entity
21
+ *
22
+ * @actionType UPDATE - Updates an existing Email record
23
+ * @module NotificationModule
24
+ * @entity Email
25
+ * @event NotificationModule.Email.Update.UpdateEmail
26
+ * @permission schema.action.updateemail.trigger
27
+ * @benchmark This action is tracked for performance benchmarks
28
+ */
29
+ class UpdateEmailDto extends core_1.OdinRecordUpdateDto {
30
+ constructor(record, properties, options) {
31
+ super({
32
+ id: record.id,
33
+ entity: record.entity,
34
+ type: record.type,
35
+ properties,
36
+ journeyId: options === null || options === void 0 ? void 0 : options.journeyId,
37
+ stageKey: options === null || options === void 0 ? void 0 : options.stageKey,
38
+ });
39
+ this.actionName = 'UpdateEmail';
40
+ this.schemaActionId = '114cc01f-fa99-4c1d-86d5-a0d7d3bc284e';
41
+ this.entity = 'NotificationModule:Email';
42
+ }
43
+ }
44
+ exports.UpdateEmailDto = UpdateEmailDto;
45
+ /** Used by SDK generators to identify action type */
46
+ UpdateEmailDto.ACTION_TYPE = 'UPDATE';
47
+ UpdateEmailDto.ACTION_KEY = 'UpdateEmail';
48
+ UpdateEmailDto.MODULE_NAME = 'NotificationModule';
49
+ UpdateEmailDto.ENTITIES = ['Email'];
50
+ UpdateEmailDto.EVENT_NAME = 'NotificationModule.Email.Update.UpdateEmail';
51
+ UpdateEmailDto.PERMISSION = 'schema.action.updateemail.trigger';
52
+ /** Step metadata - entity this action targets */
53
+ UpdateEmailDto.STEP_ENTITY = 'NotificationModule:Email';
54
+ UpdateEmailDto.STEP_SCHEMA_ID = 'a3b4d6b7-0647-4202-90a6-036e3c87c5ae';
55
+ UpdateEmailDto.STEP_SCHEMA_ACTION_ID = '114cc01f-fa99-4c1d-86d5-a0d7d3bc284e';
56
+ UpdateEmailDto.AUTO_LINK_PARENT = false;
@@ -23,12 +23,12 @@ export declare enum ConfigEntityTypes {
23
23
  * Use these constants instead of string literals for type safety
24
24
  */
25
25
  export declare enum ConfigPropertyKeys {
26
- /** the name of the app this config relates to (Platform - Config) */
27
- AppName = "AppName",
26
+ /** Data field for Config records. Used by Platform team. */
27
+ Test = "Test",
28
28
  /** object of { key: value } mappings (Platform - Config) */
29
29
  Mappings = "Mappings",
30
- /** Data field for Config records. Used by Platform team. */
31
- Test = "Test"
30
+ /** the name of the app this config relates to (Platform - Config) */
31
+ AppName = "AppName"
32
32
  }
33
33
  /**
34
34
  * Properties for Config records
@@ -36,21 +36,21 @@ export declare enum ConfigPropertyKeys {
36
36
  * @see SchemaModule:Config
37
37
  */
38
38
  export interface ConfigProperties {
39
- /** the name of the app this config relates to (Platform - Config)
39
+ /** Data field for Config records. Used by Platform team.
40
40
  *
41
41
  * @type {TEXT}
42
42
  */
43
- AppName: string;
43
+ Test: string;
44
44
  /** object of { key: value } mappings (Platform - Config)
45
45
  *
46
46
  * @type {JSON}
47
47
  */
48
48
  Mappings: string;
49
- /** Data field for Config records. Used by Platform team.
49
+ /** the name of the app this config relates to (Platform - Config)
50
50
  *
51
51
  * @type {TEXT}
52
52
  */
53
- Test: string;
53
+ AppName: string;
54
54
  }
55
55
  /**
56
56
  * Config entity from SchemaModule
@@ -28,12 +28,12 @@ var ConfigEntityTypes;
28
28
  */
29
29
  var ConfigPropertyKeys;
30
30
  (function (ConfigPropertyKeys) {
31
- /** the name of the app this config relates to (Platform - Config) */
32
- ConfigPropertyKeys["AppName"] = "AppName";
33
- /** object of { key: value } mappings (Platform - Config) */
34
- ConfigPropertyKeys["Mappings"] = "Mappings";
35
31
  /** Data field for Config records. Used by Platform team. */
36
32
  ConfigPropertyKeys["Test"] = "Test";
33
+ /** object of { key: value } mappings (Platform - Config) */
34
+ ConfigPropertyKeys["Mappings"] = "Mappings";
35
+ /** the name of the app this config relates to (Platform - Config) */
36
+ ConfigPropertyKeys["AppName"] = "AppName";
37
37
  })(ConfigPropertyKeys = exports.ConfigPropertyKeys || (exports.ConfigPropertyKeys = {}));
38
38
  /**
39
39
  * Config entity from SchemaModule
@@ -41,6 +41,23 @@ export declare enum EmailSenderType {
41
41
  AUTOMATED = "AUTOMATED",
42
42
  CUSTOMER = "CUSTOMER"
43
43
  }
44
+ /**
45
+ * Valid values for Email.Status
46
+ *
47
+ * Status of the email in the process
48
+ *
49
+ * @remarks Available options:
50
+ * - `CREATED` - Created
51
+ * - `FAILED` - Failed
52
+ * - `SENDING` - Sending
53
+ * - `SUCCESS` - Success
54
+ */
55
+ export declare enum EmailStatus {
56
+ CREATED = "CREATED",
57
+ FAILED = "FAILED",
58
+ SENDING = "SENDING",
59
+ SUCCESS = "SUCCESS"
60
+ }
44
61
  /**
45
62
  * Property keys for Email
46
63
  * Use these constants instead of string literals for type safety
@@ -79,7 +96,9 @@ export declare enum EmailPropertyKeys {
79
96
  /** Sender Type (Communications - Email) */
80
97
  SenderType = "SenderType",
81
98
  /** Data field for Email records. Used by Communications team. */
82
- Case = "Case"
99
+ Case = "Case",
100
+ /** Status of the email in the process */
101
+ Status = "Status"
83
102
  }
84
103
  /**
85
104
  * Properties for Email records
@@ -174,6 +193,13 @@ export interface EmailProperties {
174
193
  * @type {LOOKUP}
175
194
  */
176
195
  Case: string;
196
+ /** Status of the email in the process
197
+ *
198
+ * @type {ENUM}
199
+ * @default CREATED
200
+ * @enum {EmailStatus}
201
+ */
202
+ Status: EmailStatus;
177
203
  }
178
204
  /**
179
205
  * Properties for SUPPORT Email records
@@ -268,6 +294,13 @@ export interface SupportEmailProperties {
268
294
  * @type {LOOKUP}
269
295
  */
270
296
  Case: string;
297
+ /** Status of the email in the process
298
+ *
299
+ * @type {ENUM}
300
+ * @default CREATED
301
+ * @enum {EmailStatus}
302
+ */
303
+ Status: EmailStatus;
271
304
  }
272
305
  /**
273
306
  * Properties for TRANSACTIONAL Email records
@@ -362,6 +395,13 @@ export interface TransactionalEmailProperties {
362
395
  * @type {LOOKUP}
363
396
  */
364
397
  Case: string;
398
+ /** Status of the email in the process
399
+ *
400
+ * @type {ENUM}
401
+ * @default CREATED
402
+ * @enum {EmailStatus}
403
+ */
404
+ Status: EmailStatus;
365
405
  }
366
406
  /**
367
407
  * Email entity from NotificationModule
@@ -12,7 +12,7 @@
12
12
  * Generated from Odin schema definition
13
13
  */
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.ROUTING_KEY_LINK_EMAIL_CONTACT_DELETED = exports.ROUTING_KEY_LINK_EMAIL_CONTACT_CREATED = exports.ROUTING_KEY_LINK_ATTACHMENTS_DELETED = exports.ROUTING_KEY_LINK_ATTACHMENTS_CREATED = exports.ROUTING_KEY_LINK_EMAIL_EMAIL_DELETED = exports.ROUTING_KEY_LINK_EMAIL_EMAIL_CREATED = exports.ROUTING_KEY_LINK_EMAIL_USER_DELETED = exports.ROUTING_KEY_LINK_EMAIL_USER_CREATED = exports.ROUTING_KEY_EMAIL_DELETED = exports.ROUTING_KEY_EMAIL_UPDATED = exports.ROUTING_KEY_EMAIL_CREATED = exports.Email = exports.EmailPropertyKeys = exports.EmailSenderType = exports.EmailEntityTypes = void 0;
15
+ exports.ROUTING_KEY_LINK_EMAIL_CONTACT_DELETED = exports.ROUTING_KEY_LINK_EMAIL_CONTACT_CREATED = exports.ROUTING_KEY_LINK_ATTACHMENTS_DELETED = exports.ROUTING_KEY_LINK_ATTACHMENTS_CREATED = exports.ROUTING_KEY_LINK_EMAIL_EMAIL_DELETED = exports.ROUTING_KEY_LINK_EMAIL_EMAIL_CREATED = exports.ROUTING_KEY_LINK_EMAIL_USER_DELETED = exports.ROUTING_KEY_LINK_EMAIL_USER_CREATED = exports.ROUTING_KEY_EMAIL_DELETED = exports.ROUTING_KEY_EMAIL_UPDATED = exports.ROUTING_KEY_EMAIL_CREATED = exports.Email = exports.EmailPropertyKeys = exports.EmailStatus = exports.EmailSenderType = exports.EmailEntityTypes = void 0;
16
16
  const core_1 = require("@d19n/odin-types/dist/core");
17
17
  /**
18
18
  * Available types for Email records
@@ -42,6 +42,24 @@ var EmailSenderType;
42
42
  EmailSenderType["AUTOMATED"] = "AUTOMATED";
43
43
  EmailSenderType["CUSTOMER"] = "CUSTOMER";
44
44
  })(EmailSenderType = exports.EmailSenderType || (exports.EmailSenderType = {}));
45
+ /**
46
+ * Valid values for Email.Status
47
+ *
48
+ * Status of the email in the process
49
+ *
50
+ * @remarks Available options:
51
+ * - `CREATED` - Created
52
+ * - `FAILED` - Failed
53
+ * - `SENDING` - Sending
54
+ * - `SUCCESS` - Success
55
+ */
56
+ var EmailStatus;
57
+ (function (EmailStatus) {
58
+ EmailStatus["CREATED"] = "CREATED";
59
+ EmailStatus["FAILED"] = "FAILED";
60
+ EmailStatus["SENDING"] = "SENDING";
61
+ EmailStatus["SUCCESS"] = "SUCCESS";
62
+ })(EmailStatus = exports.EmailStatus || (exports.EmailStatus = {}));
45
63
  /**
46
64
  * Property keys for Email
47
65
  * Use these constants instead of string literals for type safety
@@ -82,6 +100,8 @@ var EmailPropertyKeys;
82
100
  EmailPropertyKeys["SenderType"] = "SenderType";
83
101
  /** Data field for Email records. Used by Communications team. */
84
102
  EmailPropertyKeys["Case"] = "Case";
103
+ /** Status of the email in the process */
104
+ EmailPropertyKeys["Status"] = "Status";
85
105
  })(EmailPropertyKeys = exports.EmailPropertyKeys || (exports.EmailPropertyKeys = {}));
86
106
  /**
87
107
  * Email entity from NotificationModule
@@ -21,6 +21,7 @@ import { IOdinProvider } from '@d19n/odin-sdk-generator/dist/odin-sdk-types';
21
21
  import { RecordLinkManager } from '@d19n/odin-sdk-generator/dist/record-link-manager';
22
22
  import { EmailProperties, SupportEmailProperties, TransactionalEmailProperties } from '../entities-v2/Email';
23
23
  import { CreateTransactionalEmailProperties } from '../actions-v2/CreateTransactionalEmailDto';
24
+ import { UpdateEmailProperties } from '../actions-v2/UpdateEmailDto';
24
25
  import { UpdateSupportEmailProperties } from '../actions-v2/UpdateSupportEmailDto';
25
26
  import { UserRecord } from './UserRecord';
26
27
  import { CaseRecord } from './CaseRecord';
@@ -229,6 +230,28 @@ export declare class EmailRecord<TProps = EmailProperties> {
229
230
  journeyId?: string;
230
231
  stageKey?: string;
231
232
  }): Promise<IDbRecordCreateUpdateRes[]>;
233
+ /**
234
+ * UpdateEmail
235
+ *
236
+ * Updates this Email record with the specified properties.
237
+ *
238
+ * @param properties - Required properties for this action
239
+ * @param options - Optional settings
240
+ * @param options.journeyId - Associate with a journey
241
+ * @param options.stageKey - Transition to pipeline stage
242
+ * @returns The updated record(s)
243
+ * @throws Error if called on a new (unsaved) record
244
+ *
245
+ * @example
246
+ * ```typescript
247
+ * const record = await odinClient.emails.get(id);
248
+ * await record.updateEmail({ ... });
249
+ * ```
250
+ */
251
+ updateEmail(properties: UpdateEmailProperties, options?: {
252
+ journeyId?: string;
253
+ stageKey?: string;
254
+ }): Promise<IDbRecordCreateUpdateRes[]>;
232
255
  /**
233
256
  * Update Support Email
234
257
  *
@@ -316,6 +316,34 @@ class EmailRecord {
316
316
  // ============================================
317
317
  // UPDATE ACTIONS (require existing record)
318
318
  // ============================================
319
+ /**
320
+ * UpdateEmail
321
+ *
322
+ * Updates this Email record with the specified properties.
323
+ *
324
+ * @param properties - Required properties for this action
325
+ * @param options - Optional settings
326
+ * @param options.journeyId - Associate with a journey
327
+ * @param options.stageKey - Transition to pipeline stage
328
+ * @returns The updated record(s)
329
+ * @throws Error if called on a new (unsaved) record
330
+ *
331
+ * @example
332
+ * ```typescript
333
+ * const record = await odinClient.emails.get(id);
334
+ * await record.updateEmail({ ... });
335
+ * ```
336
+ */
337
+ updateEmail(properties, options) {
338
+ var _a;
339
+ return __awaiter(this, void 0, void 0, function* () {
340
+ if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
341
+ throw new Error('updateEmail requires an existing record. Use accessor.get() first.');
342
+ const result = yield this._provider._applyAction('NotificationModule', 'Email', Object.assign({ id: this._record.id, entity: this._record.entity, type: this._record.type, actionName: 'UpdateEmail', properties, associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined }, options));
343
+ this._pendingLinks = [];
344
+ return result;
345
+ });
346
+ }
319
347
  /**
320
348
  * Update Support Email
321
349
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@d19n/youfibre-odin-sdk",
3
- "version": "1.0.311",
3
+ "version": "1.0.313",
4
4
  "description": "",
5
5
  "author": "@d19n",
6
6
  "license": "UNLICENSED",