@d19n/youfibre-odin-sdk 1.0.312 → 1.0.314

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;
@@ -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.312",
3
+ "version": "1.0.314",
4
4
  "description": "",
5
5
  "author": "@d19n",
6
6
  "license": "UNLICENSED",
@@ -11,7 +11,7 @@
11
11
  "typescript": "4.8.4"
12
12
  },
13
13
  "dependencies": {
14
- "@d19n/odin-sdk-generator": "^3.0.206",
14
+ "@d19n/odin-sdk-generator": "^3.0.207",
15
15
  "@d19n/odin-types": "^3.0.23",
16
16
  "@d19n/youfibre-odin-sdk": "^1.0.219"
17
17
  },