@d19n/youfibre-odin-sdk 2.0.17 → 2.0.18

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
@@ -294,7 +294,7 @@ This SDK includes **164** entities across **12** modules.
294
294
  | **Email** | Email Entity Definition | REFERRAL, SUPPORT, TRANSACTIONAL |
295
295
  | **EmailSender** | EmailSender Entity Definition | DEFAULT |
296
296
  | **EmailTemplate** | EmailTemplate Entity Definition | DEFAULT |
297
- | **Message** | Message Entity Definition | EVENT |
297
+ | **Message** | Message Entity Definition | CLOSE, EVENT, NUDGE |
298
298
  | **NotificationTemplate** | NotificationTemplate Entity Definition | DEFAULT |
299
299
  | **PushNotification** | PushNotification Entity Definition | DEFAULT |
300
300
  | **SmsMessage** | SmsMessage Entity Definition | INBOUND, OUTBOUND |
@@ -18,10 +18,14 @@ import { PushNotificationProperties } from './PushNotification';
18
18
  * Available types for Message records
19
19
  */
20
20
  export declare enum MessageEntityTypes {
21
+ /** Close type message */
22
+ CLOSE = "CLOSE",
21
23
  /** This is the default record type */
22
24
  DEFAULT = "DEFAULT",
23
25
  /** event */
24
- EVENT = "EVENT"
26
+ EVENT = "EVENT",
27
+ /** Nudge type message */
28
+ NUDGE = "NUDGE"
25
29
  }
26
30
  /**
27
31
  * Valid values for Message.SenderType
@@ -138,6 +142,65 @@ export interface MessageProperties {
138
142
  */
139
143
  MessageType: MessageMessageType;
140
144
  }
145
+ /**
146
+ * Properties for CLOSE Message records
147
+ *
148
+ * @see NotificationModule:Message
149
+ */
150
+ export interface CloseMessageProperties {
151
+ /** External ID of the message (Communications - Message)
152
+ *
153
+ * @type {TEXT}
154
+ */
155
+ ExternalId: string;
156
+ /** Who sent the message (Communications - Message)
157
+ *
158
+ * @type {TEXT}
159
+ */
160
+ From: string;
161
+ /** Message that indicates reason of not sending message (Communications - Message)
162
+ *
163
+ * @type {TEXT}
164
+ */
165
+ ErrorMessage: string;
166
+ /** Status of the message (CREATED,DELETED) (Communications - Message)
167
+ *
168
+ * @type {TEXT}
169
+ */
170
+ Status: string;
171
+ /** Attachments of the message (Communications - Message)
172
+ *
173
+ * @type {FILE_MULTIPLE}
174
+ */
175
+ Files: string;
176
+ /** Content of the message (Communications - Message)
177
+ *
178
+ * @type {TEXT}
179
+ */
180
+ Body: string;
181
+ /** Who receive the message (if needed) (Communications - Message)
182
+ *
183
+ * @type {TEXT}
184
+ */
185
+ To: string;
186
+ /** Title field for the record
187
+ *
188
+ * @type {TEXT}
189
+ */
190
+ Title: string;
191
+ /** sender type (Communications - Message)
192
+ *
193
+ * @type {ENUM}
194
+ * @enum {MessageSenderType}
195
+ */
196
+ SenderType: MessageSenderType;
197
+ /** The type of the message
198
+ *
199
+ * @type {ENUM}
200
+ * @enum {MessageMessageType}
201
+ */
202
+ MessageType: MessageMessageType;
203
+ }
141
204
  /**
142
205
  * Properties for EVENT Message records
143
206
  *
@@ -197,6 +260,65 @@ export interface EventMessageProperties {
197
260
  */
198
261
  MessageType: MessageMessageType;
199
262
  }
263
+ /**
264
+ * Properties for NUDGE Message records
265
+ *
266
+ * @see NotificationModule:Message
267
+ */
268
+ export interface NudgeMessageProperties {
269
+ /** External ID of the message (Communications - Message)
270
+ *
271
+ * @type {TEXT}
272
+ */
273
+ ExternalId: string;
274
+ /** Who sent the message (Communications - Message)
275
+ *
276
+ * @type {TEXT}
277
+ */
278
+ From: string;
279
+ /** Message that indicates reason of not sending message (Communications - Message)
280
+ *
281
+ * @type {TEXT}
282
+ */
283
+ ErrorMessage: string;
284
+ /** Status of the message (CREATED,DELETED) (Communications - Message)
285
+ *
286
+ * @type {TEXT}
287
+ */
288
+ Status: string;
289
+ /** Attachments of the message (Communications - Message)
290
+ *
291
+ * @type {FILE_MULTIPLE}
292
+ */
293
+ Files: string;
294
+ /** Content of the message (Communications - Message)
295
+ *
296
+ * @type {TEXT}
297
+ */
298
+ Body: string;
299
+ /** Who receive the message (if needed) (Communications - Message)
300
+ *
301
+ * @type {TEXT}
302
+ */
303
+ To: string;
304
+ /** Title field for the record
305
+ *
306
+ * @type {TEXT}
307
+ */
308
+ Title: string;
309
+ /** sender type (Communications - Message)
310
+ *
311
+ * @type {ENUM}
312
+ * @enum {MessageSenderType}
313
+ */
314
+ SenderType: MessageSenderType;
315
+ /** The type of the message
316
+ *
317
+ * @type {ENUM}
318
+ * @enum {MessageMessageType}
319
+ */
320
+ MessageType: MessageMessageType;
321
+ }
200
322
  /**
201
323
  * Message entity from NotificationModule
202
324
  *
@@ -229,6 +351,12 @@ export declare const ROUTING_KEY_MESSAGE_DELETED = "NotificationModule.Message.S
229
351
  * Type-specific routing keys for Message events
230
352
  * Subscribe to these for events on specific entity types only
231
353
  */
354
+ /** Close type message created */
355
+ export declare const ROUTING_KEY_MESSAGE_CLOSE_CREATED = "NotificationModule.Message.CLOSE.SubDbRecordCreated";
356
+ /** Close type message updated */
357
+ export declare const ROUTING_KEY_MESSAGE_CLOSE_UPDATED = "NotificationModule.Message.CLOSE.SubDbRecordUpdated";
358
+ /** Close type message deleted */
359
+ export declare const ROUTING_KEY_MESSAGE_CLOSE_DELETED = "NotificationModule.Message.CLOSE.SubDbRecordDeleted";
232
360
  /** This is the default record type created */
233
361
  export declare const ROUTING_KEY_MESSAGE_DEFAULT_CREATED = "NotificationModule.Message.DEFAULT.SubDbRecordCreated";
234
362
  /** This is the default record type updated */
@@ -241,6 +369,12 @@ export declare const ROUTING_KEY_MESSAGE_EVENT_CREATED = "NotificationModule.Mes
241
369
  export declare const ROUTING_KEY_MESSAGE_EVENT_UPDATED = "NotificationModule.Message.EVENT.SubDbRecordUpdated";
242
370
  /** event deleted */
243
371
  export declare const ROUTING_KEY_MESSAGE_EVENT_DELETED = "NotificationModule.Message.EVENT.SubDbRecordDeleted";
372
+ /** Nudge type message created */
373
+ export declare const ROUTING_KEY_MESSAGE_NUDGE_CREATED = "NotificationModule.Message.NUDGE.SubDbRecordCreated";
374
+ /** Nudge type message updated */
375
+ export declare const ROUTING_KEY_MESSAGE_NUDGE_UPDATED = "NotificationModule.Message.NUDGE.SubDbRecordUpdated";
376
+ /** Nudge type message deleted */
377
+ export declare const ROUTING_KEY_MESSAGE_NUDGE_DELETED = "NotificationModule.Message.NUDGE.SubDbRecordDeleted";
244
378
  /** Event: Message_File link created */
245
379
  export declare const ROUTING_KEY_LINK_MESSAGE_FILE_CREATED = "NotificationModule.Message.File.SubDbRecordAssociationCreated";
246
380
  /** Event: Message_File link deleted */
@@ -12,17 +12,21 @@
12
12
  * Generated from Odin schema definition
13
13
  */
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.ROUTING_KEY_LINK_MESSAGE_PUSH_NOTIFICATION_DELETED = exports.ROUTING_KEY_LINK_MESSAGE_PUSH_NOTIFICATION_CREATED = exports.ROUTING_KEY_LINK_MESSAGE_FILE_DELETED = exports.ROUTING_KEY_LINK_MESSAGE_FILE_CREATED = exports.ROUTING_KEY_MESSAGE_EVENT_DELETED = exports.ROUTING_KEY_MESSAGE_EVENT_UPDATED = exports.ROUTING_KEY_MESSAGE_EVENT_CREATED = exports.ROUTING_KEY_MESSAGE_DEFAULT_DELETED = exports.ROUTING_KEY_MESSAGE_DEFAULT_UPDATED = exports.ROUTING_KEY_MESSAGE_DEFAULT_CREATED = exports.ROUTING_KEY_MESSAGE_DELETED = exports.ROUTING_KEY_MESSAGE_UPDATED = exports.ROUTING_KEY_MESSAGE_CREATED = exports.Message = exports.MessagePropertyKeys = exports.MessageMessageType = exports.MessageSenderType = exports.MessageEntityTypes = void 0;
15
+ exports.ROUTING_KEY_LINK_MESSAGE_PUSH_NOTIFICATION_DELETED = exports.ROUTING_KEY_LINK_MESSAGE_PUSH_NOTIFICATION_CREATED = exports.ROUTING_KEY_LINK_MESSAGE_FILE_DELETED = exports.ROUTING_KEY_LINK_MESSAGE_FILE_CREATED = exports.ROUTING_KEY_MESSAGE_NUDGE_DELETED = exports.ROUTING_KEY_MESSAGE_NUDGE_UPDATED = exports.ROUTING_KEY_MESSAGE_NUDGE_CREATED = exports.ROUTING_KEY_MESSAGE_EVENT_DELETED = exports.ROUTING_KEY_MESSAGE_EVENT_UPDATED = exports.ROUTING_KEY_MESSAGE_EVENT_CREATED = exports.ROUTING_KEY_MESSAGE_DEFAULT_DELETED = exports.ROUTING_KEY_MESSAGE_DEFAULT_UPDATED = exports.ROUTING_KEY_MESSAGE_DEFAULT_CREATED = exports.ROUTING_KEY_MESSAGE_CLOSE_DELETED = exports.ROUTING_KEY_MESSAGE_CLOSE_UPDATED = exports.ROUTING_KEY_MESSAGE_CLOSE_CREATED = exports.ROUTING_KEY_MESSAGE_DELETED = exports.ROUTING_KEY_MESSAGE_UPDATED = exports.ROUTING_KEY_MESSAGE_CREATED = exports.Message = exports.MessagePropertyKeys = exports.MessageMessageType = exports.MessageSenderType = exports.MessageEntityTypes = void 0;
16
16
  const core_1 = require("@d19n/odin-types/dist/core");
17
17
  /**
18
18
  * Available types for Message records
19
19
  */
20
20
  var MessageEntityTypes;
21
21
  (function (MessageEntityTypes) {
22
+ /** Close type message */
23
+ MessageEntityTypes["CLOSE"] = "CLOSE";
22
24
  /** This is the default record type */
23
25
  MessageEntityTypes["DEFAULT"] = "DEFAULT";
24
26
  /** event */
25
27
  MessageEntityTypes["EVENT"] = "EVENT";
28
+ /** Nudge type message */
29
+ MessageEntityTypes["NUDGE"] = "NUDGE";
26
30
  })(MessageEntityTypes = exports.MessageEntityTypes || (exports.MessageEntityTypes = {}));
27
31
  /**
28
32
  * Valid values for Message.SenderType
@@ -109,6 +113,12 @@ exports.ROUTING_KEY_MESSAGE_DELETED = 'NotificationModule.Message.SubDbRecordDel
109
113
  * Type-specific routing keys for Message events
110
114
  * Subscribe to these for events on specific entity types only
111
115
  */
116
+ /** Close type message created */
117
+ exports.ROUTING_KEY_MESSAGE_CLOSE_CREATED = 'NotificationModule.Message.CLOSE.SubDbRecordCreated';
118
+ /** Close type message updated */
119
+ exports.ROUTING_KEY_MESSAGE_CLOSE_UPDATED = 'NotificationModule.Message.CLOSE.SubDbRecordUpdated';
120
+ /** Close type message deleted */
121
+ exports.ROUTING_KEY_MESSAGE_CLOSE_DELETED = 'NotificationModule.Message.CLOSE.SubDbRecordDeleted';
112
122
  /** This is the default record type created */
113
123
  exports.ROUTING_KEY_MESSAGE_DEFAULT_CREATED = 'NotificationModule.Message.DEFAULT.SubDbRecordCreated';
114
124
  /** This is the default record type updated */
@@ -121,6 +131,12 @@ exports.ROUTING_KEY_MESSAGE_EVENT_CREATED = 'NotificationModule.Message.EVENT.Su
121
131
  exports.ROUTING_KEY_MESSAGE_EVENT_UPDATED = 'NotificationModule.Message.EVENT.SubDbRecordUpdated';
122
132
  /** event deleted */
123
133
  exports.ROUTING_KEY_MESSAGE_EVENT_DELETED = 'NotificationModule.Message.EVENT.SubDbRecordDeleted';
134
+ /** Nudge type message created */
135
+ exports.ROUTING_KEY_MESSAGE_NUDGE_CREATED = 'NotificationModule.Message.NUDGE.SubDbRecordCreated';
136
+ /** Nudge type message updated */
137
+ exports.ROUTING_KEY_MESSAGE_NUDGE_UPDATED = 'NotificationModule.Message.NUDGE.SubDbRecordUpdated';
138
+ /** Nudge type message deleted */
139
+ exports.ROUTING_KEY_MESSAGE_NUDGE_DELETED = 'NotificationModule.Message.NUDGE.SubDbRecordDeleted';
124
140
  /** Event: Message_File link created */
125
141
  exports.ROUTING_KEY_LINK_MESSAGE_FILE_CREATED = 'NotificationModule.Message.File.SubDbRecordAssociationCreated';
126
142
  /** Event: Message_File link deleted */
@@ -13,7 +13,7 @@
13
13
  * await record.createMessage({ ... }).execute();
14
14
  * ```
15
15
  *
16
- * Entity Types: DEFAULT, EVENT
16
+ * Entity Types: CLOSE, DEFAULT, EVENT, NUDGE
17
17
  *
18
18
  * AUTO-GENERATED - DO NOT EDIT DIRECTLY
19
19
  */
@@ -22,13 +22,13 @@ import { PipelineStageEntity } from '@d19n/odin-types/dist/core';
22
22
  import { IDbRecordCreateUpdateRes } from '@d19n/odin-types/dist/core/interfaces/v1.db.interfaces';
23
23
  import { IOdinProvider } from '@d19n/odin-sdk-generator/dist/odin-sdk-types';
24
24
  import { RecordLinkManager } from '@d19n/odin-sdk-generator/dist/record-link-manager';
25
- import { MessageProperties, EventMessageProperties } from '../entities-v2/Message';
25
+ import { MessageProperties, CloseMessageProperties, EventMessageProperties, NudgeMessageProperties } from '../entities-v2/Message';
26
26
  import { CreateMessageProperties } from '../actions-v2/CreateMessageDto';
27
27
  import { ConversationRecord } from './ConversationRecord';
28
28
  import { FileRecord } from './FileRecord';
29
29
  import { PushNotificationRecord } from './PushNotificationRecord';
30
30
  /** Valid entity types for Message */
31
- export declare type MessageType = 'DEFAULT' | 'EVENT';
31
+ export declare type MessageType = 'CLOSE' | 'DEFAULT' | 'EVENT' | 'NUDGE';
32
32
  /**
33
33
  * Builder for action execution with dryRun support
34
34
  *
@@ -120,6 +120,22 @@ export declare class MessageRecord<TProps = MessageProperties> {
120
120
  get groups(): string[];
121
121
  /** Access the underlying OdinRecord (null for new records) */
122
122
  get record(): OdinRecord<TProps> | null;
123
+ /**
124
+ * Type guard: check if this record is of type CLOSE
125
+ *
126
+ * When this returns true, TypeScript automatically narrows the type,
127
+ * giving you access to CLOSE-specific properties.
128
+ *
129
+ * @example
130
+ * ```typescript
131
+ * if (record.isClose()) {
132
+ * // TypeScript knows record.properties is CloseMessageProperties
133
+ * console.log(record.properties.SomeTypeSpecificField);
134
+ * }
135
+ * ```
136
+ * @remarks Close type message
137
+ */
138
+ isClose(): this is MessageRecord<CloseMessageProperties>;
123
139
  /**
124
140
  * Type guard: check if this record is of type DEFAULT
125
141
  *
@@ -152,6 +168,22 @@ export declare class MessageRecord<TProps = MessageProperties> {
152
168
  * @remarks event
153
169
  */
154
170
  isEvent(): this is MessageRecord<EventMessageProperties>;
171
+ /**
172
+ * Type guard: check if this record is of type NUDGE
173
+ *
174
+ * When this returns true, TypeScript automatically narrows the type,
175
+ * giving you access to NUDGE-specific properties.
176
+ *
177
+ * @example
178
+ * ```typescript
179
+ * if (record.isNudge()) {
180
+ * // TypeScript knows record.properties is NudgeMessageProperties
181
+ * console.log(record.properties.SomeTypeSpecificField);
182
+ * }
183
+ * ```
184
+ * @remarks Nudge type message
185
+ */
186
+ isNudge(): this is MessageRecord<NudgeMessageProperties>;
155
187
  /** Valid labels for Conversation associations */
156
188
  static readonly conversationsLabels: readonly ["Conversation_Message"];
157
189
  /**
@@ -14,7 +14,7 @@
14
14
  * await record.createMessage({ ... }).execute();
15
15
  * ```
16
16
  *
17
- * Entity Types: DEFAULT, EVENT
17
+ * Entity Types: CLOSE, DEFAULT, EVENT, NUDGE
18
18
  *
19
19
  * AUTO-GENERATED - DO NOT EDIT DIRECTLY
20
20
  */
@@ -148,6 +148,22 @@ class MessageRecord {
148
148
  // ============================================
149
149
  // TYPE GUARDS (with TypeScript type predicates)
150
150
  // ============================================
151
+ /**
152
+ * Type guard: check if this record is of type CLOSE
153
+ *
154
+ * When this returns true, TypeScript automatically narrows the type,
155
+ * giving you access to CLOSE-specific properties.
156
+ *
157
+ * @example
158
+ * ```typescript
159
+ * if (record.isClose()) {
160
+ * // TypeScript knows record.properties is CloseMessageProperties
161
+ * console.log(record.properties.SomeTypeSpecificField);
162
+ * }
163
+ * ```
164
+ * @remarks Close type message
165
+ */
166
+ isClose() { var _a; return ((_a = this._record) === null || _a === void 0 ? void 0 : _a.type) === 'CLOSE'; }
151
167
  /**
152
168
  * Type guard: check if this record is of type DEFAULT
153
169
  *
@@ -180,6 +196,22 @@ class MessageRecord {
180
196
  * @remarks event
181
197
  */
182
198
  isEvent() { var _a; return ((_a = this._record) === null || _a === void 0 ? void 0 : _a.type) === 'EVENT'; }
199
+ /**
200
+ * Type guard: check if this record is of type NUDGE
201
+ *
202
+ * When this returns true, TypeScript automatically narrows the type,
203
+ * giving you access to NUDGE-specific properties.
204
+ *
205
+ * @example
206
+ * ```typescript
207
+ * if (record.isNudge()) {
208
+ * // TypeScript knows record.properties is NudgeMessageProperties
209
+ * console.log(record.properties.SomeTypeSpecificField);
210
+ * }
211
+ * ```
212
+ * @remarks Nudge type message
213
+ */
214
+ isNudge() { var _a; return ((_a = this._record) === null || _a === void 0 ? void 0 : _a.type) === 'NUDGE'; }
183
215
  /**
184
216
  * Access linked Conversation records
185
217
  * @remarks Available labels: Conversation_Message
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@d19n/youfibre-odin-sdk",
3
- "version": "2.0.17",
3
+ "version": "2.0.18",
4
4
  "description": "",
5
5
  "author": "@d19n",
6
6
  "license": "UNLICENSED",