@d19n/youfibre-odin-sdk 1.0.243 → 1.0.245

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.
@@ -36,6 +36,18 @@ import { CrmDatasetRecord } from './CrmDatasetRecord';
36
36
  import { CaseRecord } from './CaseRecord';
37
37
  import { LeadRecord } from './LeadRecord';
38
38
  import { AccountRecord } from './AccountRecord';
39
+ /** Options for a flow step */
40
+ interface CreateLeadFromAddressFlowBuilderStepOptions {
41
+ /** Record ID if updating a specific record in this step */
42
+ id?: string;
43
+ /** Associations to create with this step */
44
+ associations?: Array<{
45
+ recordId?: string;
46
+ entity?: string;
47
+ }>;
48
+ /** Groups for this step */
49
+ groups?: string[];
50
+ }
39
51
  /**
40
52
  * FlowBuilder for CreateLeadFromAddress multi-step action
41
53
  *
@@ -46,22 +58,31 @@ declare class CreateLeadFromAddressFlowBuilder {
46
58
  private _provider;
47
59
  private _pendingLinks;
48
60
  private _options?;
61
+ private _groups;
49
62
  private _steps;
50
63
  constructor(record: AddressRecord, provider: IOdinProvider, pendingLinks: OdinRecordLinkDto[], options?: {
51
64
  journeyId?: string;
52
65
  });
66
+ /**
67
+ * Add a group to the main action
68
+ * @param group - Group name to add
69
+ * @returns this (for method chaining)
70
+ */
71
+ addGroup(group: string): this;
53
72
  /**
54
73
  * Add CreateLead step to the flow
55
74
  * @param properties - Properties for this step
75
+ * @param options - Optional step settings (associations, groups)
56
76
  * @returns this (for method chaining)
57
77
  */
58
- createLead(properties: CreateLeadProperties): this;
78
+ createLead(properties: CreateLeadProperties, options?: Omit<CreateLeadFromAddressFlowBuilderStepOptions, "id">): this;
59
79
  /**
60
80
  * Add CreateContact step to the flow
61
81
  * @param properties - Properties for this step
82
+ * @param options - Optional step settings (associations, groups)
62
83
  * @returns this (for method chaining)
63
84
  */
64
- createContact(properties: CreateContactProperties): this;
85
+ createContact(properties: CreateContactProperties, options?: Omit<CreateLeadFromAddressFlowBuilderStepOptions, "id">): this;
65
86
  /**
66
87
  * Execute the flow with all collected steps
67
88
  * @returns The action result
@@ -47,28 +47,50 @@ const AccountRecord_1 = require("./AccountRecord");
47
47
  */
48
48
  class CreateLeadFromAddressFlowBuilder {
49
49
  constructor(record, provider, pendingLinks, options) {
50
+ this._groups = [];
50
51
  this._steps = [];
51
52
  this._record = record;
52
53
  this._provider = provider;
53
54
  this._pendingLinks = pendingLinks;
54
55
  this._options = options;
55
56
  }
57
+ /**
58
+ * Add a group to the main action
59
+ * @param group - Group name to add
60
+ * @returns this (for method chaining)
61
+ */
62
+ addGroup(group) {
63
+ this._groups.push(group);
64
+ return this;
65
+ }
56
66
  /**
57
67
  * Add CreateLead step to the flow
58
68
  * @param properties - Properties for this step
69
+ * @param options - Optional step settings (associations, groups)
59
70
  * @returns this (for method chaining)
60
71
  */
61
- createLead(properties) {
62
- this._steps.push({ actionKey: 'CreateLead', properties });
72
+ createLead(properties, options) {
73
+ this._steps.push({
74
+ actionName: 'CreateLead',
75
+ properties,
76
+ associations: options === null || options === void 0 ? void 0 : options.associations,
77
+ groups: options === null || options === void 0 ? void 0 : options.groups,
78
+ });
63
79
  return this;
64
80
  }
65
81
  /**
66
82
  * Add CreateContact step to the flow
67
83
  * @param properties - Properties for this step
84
+ * @param options - Optional step settings (associations, groups)
68
85
  * @returns this (for method chaining)
69
86
  */
70
- createContact(properties) {
71
- this._steps.push({ actionKey: 'CreateContact', properties });
87
+ createContact(properties, options) {
88
+ this._steps.push({
89
+ actionName: 'CreateContact',
90
+ properties,
91
+ associations: options === null || options === void 0 ? void 0 : options.associations,
92
+ groups: options === null || options === void 0 ? void 0 : options.groups,
93
+ });
72
94
  return this;
73
95
  }
74
96
  /**
@@ -80,7 +102,7 @@ class CreateLeadFromAddressFlowBuilder {
80
102
  const rawRecord = this._record.raw;
81
103
  if (!(rawRecord === null || rawRecord === void 0 ? void 0 : rawRecord.id))
82
104
  throw new Error('Cannot execute flow on unsaved record');
83
- const result = yield this._provider._applyAction('CrmModule', 'Address', Object.assign({ id: rawRecord.id, entity: rawRecord.entity, type: rawRecord.type, actionName: 'CreateLeadFromAddress', steps: this._steps, associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined }, this._options));
105
+ const result = yield this._provider._applyAction('CrmModule', 'Address', Object.assign({ id: rawRecord.id, entity: rawRecord.entity, type: rawRecord.type, actionName: 'CreateLeadFromAddress', steps: this._steps, associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined, groups: this._groups.length > 0 ? this._groups : undefined }, this._options));
84
106
  // Clear pending links on the record after execution
85
107
  this._record.clearPendingLinks();
86
108
  return result;
@@ -55,6 +55,18 @@ import { AccountRecord } from './AccountRecord';
55
55
  import { ActivityLogRecord } from './ActivityLogRecord';
56
56
  /** Valid entity types for Case */
57
57
  export declare type CaseType = 'DEFAULT' | 'OUTAGE';
58
+ /** Options for a flow step */
59
+ interface AssignCaseWithNoteFlowFlowBuilderStepOptions {
60
+ /** Record ID if updating a specific record in this step */
61
+ id?: string;
62
+ /** Associations to create with this step */
63
+ associations?: Array<{
64
+ recordId?: string;
65
+ entity?: string;
66
+ }>;
67
+ /** Groups for this step */
68
+ groups?: string[];
69
+ }
58
70
  /**
59
71
  * FlowBuilder for AssignCaseWithNoteFlow multi-step action
60
72
  *
@@ -65,28 +77,50 @@ declare class AssignCaseWithNoteFlowFlowBuilder {
65
77
  private _provider;
66
78
  private _pendingLinks;
67
79
  private _options?;
80
+ private _groups;
68
81
  private _steps;
69
82
  constructor(record: CaseRecord, provider: IOdinProvider, pendingLinks: OdinRecordLinkDto[], options?: {
70
83
  journeyId?: string;
71
84
  });
85
+ /**
86
+ * Add a group to the main action
87
+ * @param group - Group name to add
88
+ * @returns this (for method chaining)
89
+ */
90
+ addGroup(group: string): this;
72
91
  /**
73
92
  * Add AssignCase step to the flow
93
+ * @param id - ID of the record to update
74
94
  * @param properties - Properties for this step
95
+ * @param options - Optional step settings (associations, groups)
75
96
  * @returns this (for method chaining)
76
97
  */
77
- assignCase(properties: AssignCaseProperties): this;
98
+ assignCase(id: string, properties: AssignCaseProperties, options?: Omit<AssignCaseWithNoteFlowFlowBuilderStepOptions, "id">): this;
78
99
  /**
79
100
  * Add CreateNoteForCaseAssignment step to the flow
80
101
  * @param properties - Properties for this step
102
+ * @param options - Optional step settings (associations, groups)
81
103
  * @returns this (for method chaining)
82
104
  */
83
- createNoteForCaseAssignment(properties: CreateNoteForCaseAssignmentProperties): this;
105
+ createNoteForCaseAssignment(properties: CreateNoteForCaseAssignmentProperties, options?: Omit<AssignCaseWithNoteFlowFlowBuilderStepOptions, "id">): this;
84
106
  /**
85
107
  * Execute the flow with all collected steps
86
108
  * @returns The action result
87
109
  */
88
110
  execute(): Promise<IDbRecordCreateUpdateRes[]>;
89
111
  }
112
+ /** Options for a flow step */
113
+ interface CaseDefaultStageEscalatedFlowBuilderStepOptions {
114
+ /** Record ID if updating a specific record in this step */
115
+ id?: string;
116
+ /** Associations to create with this step */
117
+ associations?: Array<{
118
+ recordId?: string;
119
+ entity?: string;
120
+ }>;
121
+ /** Groups for this step */
122
+ groups?: string[];
123
+ }
90
124
  /**
91
125
  * FlowBuilder for CaseDefaultStageEscalated multi-step action
92
126
  *
@@ -98,28 +132,50 @@ declare class CaseDefaultStageEscalatedFlowBuilder {
98
132
  private _provider;
99
133
  private _pendingLinks;
100
134
  private _options?;
135
+ private _groups;
101
136
  private _steps;
102
137
  constructor(record: CaseRecord, provider: IOdinProvider, pendingLinks: OdinRecordLinkDto[], options?: {
103
138
  journeyId?: string;
104
139
  });
140
+ /**
141
+ * Add a group to the main action
142
+ * @param group - Group name to add
143
+ * @returns this (for method chaining)
144
+ */
145
+ addGroup(group: string): this;
105
146
  /**
106
147
  * Add EscalateCaseAction step to the flow
148
+ * @param id - ID of the record to update
107
149
  * @param properties - Properties for this step
150
+ * @param options - Optional step settings (associations, groups)
108
151
  * @returns this (for method chaining)
109
152
  */
110
- escalateCaseAction(properties: EscalateCaseActionProperties): this;
153
+ escalateCaseAction(id: string, properties: EscalateCaseActionProperties, options?: Omit<CaseDefaultStageEscalatedFlowBuilderStepOptions, "id">): this;
111
154
  /**
112
155
  * Add CreateNoteForCaseAssignment step to the flow
113
156
  * @param properties - Properties for this step
157
+ * @param options - Optional step settings (associations, groups)
114
158
  * @returns this (for method chaining)
115
159
  */
116
- createNoteForCaseAssignment(properties: CreateNoteForCaseAssignmentProperties): this;
160
+ createNoteForCaseAssignment(properties: CreateNoteForCaseAssignmentProperties, options?: Omit<CaseDefaultStageEscalatedFlowBuilderStepOptions, "id">): this;
117
161
  /**
118
162
  * Execute the flow with all collected steps
119
163
  * @returns The action result
120
164
  */
121
165
  execute(): Promise<IDbRecordCreateUpdateRes[]>;
122
166
  }
167
+ /** Options for a flow step */
168
+ interface CasedefaultstageblockedFlowBuilderStepOptions {
169
+ /** Record ID if updating a specific record in this step */
170
+ id?: string;
171
+ /** Associations to create with this step */
172
+ associations?: Array<{
173
+ recordId?: string;
174
+ entity?: string;
175
+ }>;
176
+ /** Groups for this step */
177
+ groups?: string[];
178
+ }
123
179
  /**
124
180
  * FlowBuilder for Casedefaultstageblocked multi-step action
125
181
  *
@@ -131,22 +187,43 @@ declare class CasedefaultstageblockedFlowBuilder {
131
187
  private _provider;
132
188
  private _pendingLinks;
133
189
  private _options?;
190
+ private _groups;
134
191
  private _steps;
135
192
  constructor(record: CaseRecord, provider: IOdinProvider, pendingLinks: OdinRecordLinkDto[], options?: {
136
193
  journeyId?: string;
137
194
  });
195
+ /**
196
+ * Add a group to the main action
197
+ * @param group - Group name to add
198
+ * @returns this (for method chaining)
199
+ */
200
+ addGroup(group: string): this;
138
201
  /**
139
202
  * Add MoveCaseToBlockedAction step to the flow
203
+ * @param id - ID of the record to update
140
204
  * @param properties - Properties for this step
205
+ * @param options - Optional step settings (associations, groups)
141
206
  * @returns this (for method chaining)
142
207
  */
143
- moveCaseToBlockedAction(properties: MoveCaseToBlockedActionProperties): this;
208
+ moveCaseToBlockedAction(id: string, properties: MoveCaseToBlockedActionProperties, options?: Omit<CasedefaultstageblockedFlowBuilderStepOptions, "id">): this;
144
209
  /**
145
210
  * Execute the flow with all collected steps
146
211
  * @returns The action result
147
212
  */
148
213
  execute(): Promise<IDbRecordCreateUpdateRes[]>;
149
214
  }
215
+ /** Options for a flow step */
216
+ interface EscalateCaseTransitionFlowBuilderStepOptions {
217
+ /** Record ID if updating a specific record in this step */
218
+ id?: string;
219
+ /** Associations to create with this step */
220
+ associations?: Array<{
221
+ recordId?: string;
222
+ entity?: string;
223
+ }>;
224
+ /** Groups for this step */
225
+ groups?: string[];
226
+ }
150
227
  /**
151
228
  * FlowBuilder for EscalateCaseTransition multi-step action
152
229
  *
@@ -158,28 +235,50 @@ declare class EscalateCaseTransitionFlowBuilder {
158
235
  private _provider;
159
236
  private _pendingLinks;
160
237
  private _options?;
238
+ private _groups;
161
239
  private _steps;
162
240
  constructor(record: CaseRecord, provider: IOdinProvider, pendingLinks: OdinRecordLinkDto[], options?: {
163
241
  journeyId?: string;
164
242
  });
243
+ /**
244
+ * Add a group to the main action
245
+ * @param group - Group name to add
246
+ * @returns this (for method chaining)
247
+ */
248
+ addGroup(group: string): this;
165
249
  /**
166
250
  * Add EscalateCaseAction step to the flow
251
+ * @param id - ID of the record to update
167
252
  * @param properties - Properties for this step
253
+ * @param options - Optional step settings (associations, groups)
168
254
  * @returns this (for method chaining)
169
255
  */
170
- escalateCaseAction(properties: EscalateCaseActionProperties): this;
256
+ escalateCaseAction(id: string, properties: EscalateCaseActionProperties, options?: Omit<EscalateCaseTransitionFlowBuilderStepOptions, "id">): this;
171
257
  /**
172
258
  * Add CreateNoteForCaseAssignment step to the flow
173
259
  * @param properties - Properties for this step
260
+ * @param options - Optional step settings (associations, groups)
174
261
  * @returns this (for method chaining)
175
262
  */
176
- createNoteForCaseAssignment(properties: CreateNoteForCaseAssignmentProperties): this;
263
+ createNoteForCaseAssignment(properties: CreateNoteForCaseAssignmentProperties, options?: Omit<EscalateCaseTransitionFlowBuilderStepOptions, "id">): this;
177
264
  /**
178
265
  * Execute the flow with all collected steps
179
266
  * @returns The action result
180
267
  */
181
268
  execute(): Promise<IDbRecordCreateUpdateRes[]>;
182
269
  }
270
+ /** Options for a flow step */
271
+ interface MoveCaseToBlockedTransitionFlowBuilderStepOptions {
272
+ /** Record ID if updating a specific record in this step */
273
+ id?: string;
274
+ /** Associations to create with this step */
275
+ associations?: Array<{
276
+ recordId?: string;
277
+ entity?: string;
278
+ }>;
279
+ /** Groups for this step */
280
+ groups?: string[];
281
+ }
183
282
  /**
184
283
  * FlowBuilder for MoveCaseToBlockedTransition multi-step action
185
284
  *
@@ -191,22 +290,43 @@ declare class MoveCaseToBlockedTransitionFlowBuilder {
191
290
  private _provider;
192
291
  private _pendingLinks;
193
292
  private _options?;
293
+ private _groups;
194
294
  private _steps;
195
295
  constructor(record: CaseRecord, provider: IOdinProvider, pendingLinks: OdinRecordLinkDto[], options?: {
196
296
  journeyId?: string;
197
297
  });
298
+ /**
299
+ * Add a group to the main action
300
+ * @param group - Group name to add
301
+ * @returns this (for method chaining)
302
+ */
303
+ addGroup(group: string): this;
198
304
  /**
199
305
  * Add MoveCaseToBlockedAction step to the flow
306
+ * @param id - ID of the record to update
200
307
  * @param properties - Properties for this step
308
+ * @param options - Optional step settings (associations, groups)
201
309
  * @returns this (for method chaining)
202
310
  */
203
- moveCaseToBlockedAction(properties: MoveCaseToBlockedActionProperties): this;
311
+ moveCaseToBlockedAction(id: string, properties: MoveCaseToBlockedActionProperties, options?: Omit<MoveCaseToBlockedTransitionFlowBuilderStepOptions, "id">): this;
204
312
  /**
205
313
  * Execute the flow with all collected steps
206
314
  * @returns The action result
207
315
  */
208
316
  execute(): Promise<IDbRecordCreateUpdateRes[]>;
209
317
  }
318
+ /** Options for a flow step */
319
+ interface MoveCaseToPendingReviewTransitionFlowBuilderStepOptions {
320
+ /** Record ID if updating a specific record in this step */
321
+ id?: string;
322
+ /** Associations to create with this step */
323
+ associations?: Array<{
324
+ recordId?: string;
325
+ entity?: string;
326
+ }>;
327
+ /** Groups for this step */
328
+ groups?: string[];
329
+ }
210
330
  /**
211
331
  * FlowBuilder for MoveCaseToPendingReviewTransition multi-step action
212
332
  *
@@ -218,22 +338,43 @@ declare class MoveCaseToPendingReviewTransitionFlowBuilder {
218
338
  private _provider;
219
339
  private _pendingLinks;
220
340
  private _options?;
341
+ private _groups;
221
342
  private _steps;
222
343
  constructor(record: CaseRecord, provider: IOdinProvider, pendingLinks: OdinRecordLinkDto[], options?: {
223
344
  journeyId?: string;
224
345
  });
346
+ /**
347
+ * Add a group to the main action
348
+ * @param group - Group name to add
349
+ * @returns this (for method chaining)
350
+ */
351
+ addGroup(group: string): this;
225
352
  /**
226
353
  * Add MoveCaseToPendingReviewAction step to the flow
354
+ * @param id - ID of the record to update
227
355
  * @param properties - Properties for this step
356
+ * @param options - Optional step settings (associations, groups)
228
357
  * @returns this (for method chaining)
229
358
  */
230
- moveCaseToPendingReviewAction(properties: MoveCaseToPendingReviewActionProperties): this;
359
+ moveCaseToPendingReviewAction(id: string, properties: MoveCaseToPendingReviewActionProperties, options?: Omit<MoveCaseToPendingReviewTransitionFlowBuilderStepOptions, "id">): this;
231
360
  /**
232
361
  * Execute the flow with all collected steps
233
362
  * @returns The action result
234
363
  */
235
364
  execute(): Promise<IDbRecordCreateUpdateRes[]>;
236
365
  }
366
+ /** Options for a flow step */
367
+ interface MoveDefaultCaseFromOpenToClosedFlowBuilderStepOptions {
368
+ /** Record ID if updating a specific record in this step */
369
+ id?: string;
370
+ /** Associations to create with this step */
371
+ associations?: Array<{
372
+ recordId?: string;
373
+ entity?: string;
374
+ }>;
375
+ /** Groups for this step */
376
+ groups?: string[];
377
+ }
237
378
  /**
238
379
  * FlowBuilder for MoveDefaultCaseFromOpenToClosed multi-step action
239
380
  *
@@ -245,16 +386,25 @@ declare class MoveDefaultCaseFromOpenToClosedFlowBuilder {
245
386
  private _provider;
246
387
  private _pendingLinks;
247
388
  private _options?;
389
+ private _groups;
248
390
  private _steps;
249
391
  constructor(record: CaseRecord, provider: IOdinProvider, pendingLinks: OdinRecordLinkDto[], options?: {
250
392
  journeyId?: string;
251
393
  });
394
+ /**
395
+ * Add a group to the main action
396
+ * @param group - Group name to add
397
+ * @returns this (for method chaining)
398
+ */
399
+ addGroup(group: string): this;
252
400
  /**
253
401
  * Add MarkCaseClosed step to the flow
402
+ * @param id - ID of the record to update
254
403
  * @param properties - Properties for this step
404
+ * @param options - Optional step settings (associations, groups)
255
405
  * @returns this (for method chaining)
256
406
  */
257
- markCaseClosed(properties: MarkCaseClosedProperties): this;
407
+ markCaseClosed(id: string, properties: MarkCaseClosedProperties, options?: Omit<MoveDefaultCaseFromOpenToClosedFlowBuilderStepOptions, "id">): this;
258
408
  /**
259
409
  * Execute the flow with all collected steps
260
410
  * @returns The action result