@d19n/youfibre-odin-sdk 2.0.167 → 2.0.169

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.
@@ -135,8 +135,6 @@ export declare enum CallLegPropertyKeys {
135
135
  TotalMuteTime = "TotalMuteTime",
136
136
  /** Data field for CallLeg records. Used by Communications team. */
137
137
  Direction = "Direction",
138
- /** Reference identifier for CallLeg relationships. Used for data integrity. */
139
- CallId = "CallId",
140
138
  /** Email of agent (for quick lookup) (Communications - CallLeg) */
141
139
  AgentEmail = "AgentEmail",
142
140
  /** UUID of parent leg if this is a child leg (Communications - CallLeg) */
@@ -150,7 +148,9 @@ export declare enum CallLegPropertyKeys {
150
148
  /** UUID of agent if this is an agent leg (Communications - CallLeg) */
151
149
  AgentId = "AgentId",
152
150
  /** Title of call leg */
153
- Title = "Title"
151
+ Title = "Title",
152
+ /** Reference identifier for CallLeg relationships. Used for data integrity. */
153
+ CallId = "CallId"
154
154
  }
155
155
  /**
156
156
  * Properties for CallLeg records
@@ -291,11 +291,6 @@ export interface CallLegProperties {
291
291
  * @enum {CallLegDirection}
292
292
  */
293
293
  Direction: CallLegDirection;
294
- /** Reference identifier for CallLeg relationships. Used for data integrity.
295
- *
296
- * @type {LOOKUP}
297
- */
298
- CallId: string;
299
294
  /** Email of agent (for quick lookup) (Communications - CallLeg)
300
295
  *
301
296
  * @type {TEXT}
@@ -331,6 +326,11 @@ export interface CallLegProperties {
331
326
  * @type {TEXT}
332
327
  */
333
328
  Title: string;
329
+ /** Reference identifier for CallLeg relationships. Used for data integrity.
330
+ *
331
+ * @type {LOOKUP}
332
+ */
333
+ CallId: string;
334
334
  }
335
335
  /**
336
336
  * CallLeg entity from NotificationModule
@@ -140,8 +140,6 @@ var CallLegPropertyKeys;
140
140
  CallLegPropertyKeys["TotalMuteTime"] = "TotalMuteTime";
141
141
  /** Data field for CallLeg records. Used by Communications team. */
142
142
  CallLegPropertyKeys["Direction"] = "Direction";
143
- /** Reference identifier for CallLeg relationships. Used for data integrity. */
144
- CallLegPropertyKeys["CallId"] = "CallId";
145
143
  /** Email of agent (for quick lookup) (Communications - CallLeg) */
146
144
  CallLegPropertyKeys["AgentEmail"] = "AgentEmail";
147
145
  /** UUID of parent leg if this is a child leg (Communications - CallLeg) */
@@ -156,6 +154,8 @@ var CallLegPropertyKeys;
156
154
  CallLegPropertyKeys["AgentId"] = "AgentId";
157
155
  /** Title of call leg */
158
156
  CallLegPropertyKeys["Title"] = "Title";
157
+ /** Reference identifier for CallLeg relationships. Used for data integrity. */
158
+ CallLegPropertyKeys["CallId"] = "CallId";
159
159
  })(CallLegPropertyKeys = exports.CallLegPropertyKeys || (exports.CallLegPropertyKeys = {}));
160
160
  /**
161
161
  * CallLeg entity from NotificationModule
@@ -397,84 +397,55 @@ export declare class CallRecord<TProps = CallProperties> {
397
397
  stageKey?: string;
398
398
  }): CreateOutboundCallBuilder;
399
399
  /**
400
- * UpdateCallInsights
401
- *
402
- * Creates a new Call record with the specified properties.
403
- * Returns an ActionBuilder - call .execute() to create or .dryRun() for debugging.
404
- *
405
- * @param properties - The properties for the new record
406
- * @param options - Optional settings
407
- * @param options.type - Override the record type
408
- * @param options.journeyId - Associate with a journey
409
- * @param options.stageKey - Set initial pipeline stage
410
- * @returns ActionBuilder - call .execute() to create or .dryRun() for payload
411
- *
412
- * @example
413
- * ```typescript
414
- * // Create with properties
415
- * const record = odinClient.calls.new();
416
- * await record.updateCallInsights({ ... }).execute();
417
- *
418
- * // Dry run (for debugging)
419
- * const payload = record.updateCallInsights({ ... }).dryRun();
420
- * ```
421
- */
422
- updateCallInsights(properties?: UpdateCallInsightsProperties, options?: {
423
- type?: string;
424
- journeyId?: string;
425
- stageKey?: string;
426
- }): ActionBuilder;
427
- /**
428
- * UpdateCallOnTaskCanceled
400
+ * UpdateCallAnalytics
429
401
  *
430
- * Creates a new Call record with the specified properties.
431
- * Returns an ActionBuilder - call .execute() to create or .dryRun() for debugging.
402
+ * Updates this Call record with the specified properties.
403
+ * Returns an ActionBuilder - call .execute() to update or .dryRun() for debugging.
432
404
  *
433
- * @param properties - The properties for the new record
405
+ * @param properties - Required properties for this action
434
406
  * @param options - Optional settings
435
- * @param options.type - Override the record type
436
407
  * @param options.journeyId - Associate with a journey
437
- * @param options.stageKey - Set initial pipeline stage
438
- * @returns ActionBuilder - call .execute() to create or .dryRun() for payload
408
+ * @param options.stageKey - Transition to pipeline stage
409
+ * @returns ActionBuilder - call .execute() to update or .dryRun() for payload
410
+ * @throws Error if called on a new (unsaved) record
439
411
  *
440
412
  * @example
441
413
  * ```typescript
442
- * // Create with properties
443
- * const record = odinClient.calls.new();
444
- * await record.updateCallOnTaskCanceled({ ... }).execute();
414
+ * const record = await odinClient.calls.get(id);
415
+ * await record.updateCallAnalytics({ ... }).execute();
445
416
  *
446
417
  * // Dry run (for debugging)
447
- * const payload = record.updateCallOnTaskCanceled({ ... }).dryRun();
418
+ * const payload = record.updateCallAnalytics({ ... }).dryRun();
448
419
  * ```
449
420
  */
450
- updateCallOnTaskCanceled(properties: UpdateCallOnTaskCanceledProperties, options?: {
451
- type?: string;
421
+ updateCallAnalytics(properties: UpdateCallAnalyticsProperties, options?: {
452
422
  journeyId?: string;
453
423
  stageKey?: string;
454
424
  }): ActionBuilder;
455
425
  /**
456
- * UpdateCallAnalytics
426
+ * UpdateCallInsights
457
427
  *
458
- * Updates this Call record with the specified properties.
428
+ * Updates this Call record.
459
429
  * Returns an ActionBuilder - call .execute() to update or .dryRun() for debugging.
460
430
  *
461
- * @param properties - Required properties for this action
462
- * @param options - Optional settings
463
- * @param options.journeyId - Associate with a journey
464
- * @param options.stageKey - Transition to pipeline stage
431
+ * @param propertiesOrOptions - Properties to update, or options object
432
+ * @param options - Optional settings (journeyId, stageKey)
465
433
  * @returns ActionBuilder - call .execute() to update or .dryRun() for payload
466
434
  * @throws Error if called on a new (unsaved) record
467
435
  *
468
436
  * @example
469
437
  * ```typescript
470
438
  * const record = await odinClient.calls.get(id);
471
- * await record.updateCallAnalytics({ ... }).execute();
439
+ * await record.updateCallInsights({ ... }).execute();
472
440
  *
473
441
  * // Dry run (for debugging)
474
- * const payload = record.updateCallAnalytics({ ... }).dryRun();
442
+ * const payload = record.updateCallInsights({ ... }).dryRun();
475
443
  * ```
476
444
  */
477
- updateCallAnalytics(properties: UpdateCallAnalyticsProperties, options?: {
445
+ updateCallInsights(propertiesOrOptions?: UpdateCallInsightsProperties | {
446
+ journeyId?: string;
447
+ stageKey?: string;
448
+ }, options?: {
478
449
  journeyId?: string;
479
450
  stageKey?: string;
480
451
  }): ActionBuilder;
@@ -661,6 +632,32 @@ export declare class CallRecord<TProps = CallProperties> {
661
632
  journeyId?: string;
662
633
  stageKey?: string;
663
634
  }): ActionBuilder;
635
+ /**
636
+ * UpdateCallOnTaskCanceled
637
+ *
638
+ * Updates this Call record with the specified properties.
639
+ * Returns an ActionBuilder - call .execute() to update or .dryRun() for debugging.
640
+ *
641
+ * @param properties - Required properties for this action
642
+ * @param options - Optional settings
643
+ * @param options.journeyId - Associate with a journey
644
+ * @param options.stageKey - Transition to pipeline stage
645
+ * @returns ActionBuilder - call .execute() to update or .dryRun() for payload
646
+ * @throws Error if called on a new (unsaved) record
647
+ *
648
+ * @example
649
+ * ```typescript
650
+ * const record = await odinClient.calls.get(id);
651
+ * await record.updateCallOnTaskCanceled({ ... }).execute();
652
+ *
653
+ * // Dry run (for debugging)
654
+ * const payload = record.updateCallOnTaskCanceled({ ... }).dryRun();
655
+ * ```
656
+ */
657
+ updateCallOnTaskCanceled(properties: UpdateCallOnTaskCanceledProperties, options?: {
658
+ journeyId?: string;
659
+ stageKey?: string;
660
+ }): ActionBuilder;
664
661
  /**
665
662
  * UpdateCallOnTaskRouterAssign
666
663
  *
@@ -528,78 +528,6 @@ class CallRecord {
528
528
  createOutboundCall(properties, options) {
529
529
  return new CreateOutboundCallDto_1.CreateOutboundCallBuilder(properties || {}, [...this._pendingLinks], options).withProvider(this._provider, 'NotificationModule', 'Call', () => { this._pendingLinks = []; });
530
530
  }
531
- /**
532
- * UpdateCallInsights
533
- *
534
- * Creates a new Call record with the specified properties.
535
- * Returns an ActionBuilder - call .execute() to create or .dryRun() for debugging.
536
- *
537
- * @param properties - The properties for the new record
538
- * @param options - Optional settings
539
- * @param options.type - Override the record type
540
- * @param options.journeyId - Associate with a journey
541
- * @param options.stageKey - Set initial pipeline stage
542
- * @returns ActionBuilder - call .execute() to create or .dryRun() for payload
543
- *
544
- * @example
545
- * ```typescript
546
- * // Create with properties
547
- * const record = odinClient.calls.new();
548
- * await record.updateCallInsights({ ... }).execute();
549
- *
550
- * // Dry run (for debugging)
551
- * const payload = record.updateCallInsights({ ... }).dryRun();
552
- * ```
553
- */
554
- updateCallInsights(properties, options) {
555
- var _a, _b;
556
- const payload = {
557
- entity: 'NotificationModule:Call',
558
- type: (_a = options === null || options === void 0 ? void 0 : options.type) !== null && _a !== void 0 ? _a : (_b = this._record) === null || _b === void 0 ? void 0 : _b.type,
559
- actionName: 'UpdateCallInsights',
560
- properties: properties || {},
561
- associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined,
562
- journeyId: options === null || options === void 0 ? void 0 : options.journeyId,
563
- stageKey: options === null || options === void 0 ? void 0 : options.stageKey,
564
- };
565
- return new ActionBuilder(this._provider, 'NotificationModule', 'Call', payload, () => { this._pendingLinks = []; });
566
- }
567
- /**
568
- * UpdateCallOnTaskCanceled
569
- *
570
- * Creates a new Call record with the specified properties.
571
- * Returns an ActionBuilder - call .execute() to create or .dryRun() for debugging.
572
- *
573
- * @param properties - The properties for the new record
574
- * @param options - Optional settings
575
- * @param options.type - Override the record type
576
- * @param options.journeyId - Associate with a journey
577
- * @param options.stageKey - Set initial pipeline stage
578
- * @returns ActionBuilder - call .execute() to create or .dryRun() for payload
579
- *
580
- * @example
581
- * ```typescript
582
- * // Create with properties
583
- * const record = odinClient.calls.new();
584
- * await record.updateCallOnTaskCanceled({ ... }).execute();
585
- *
586
- * // Dry run (for debugging)
587
- * const payload = record.updateCallOnTaskCanceled({ ... }).dryRun();
588
- * ```
589
- */
590
- updateCallOnTaskCanceled(properties, options) {
591
- var _a, _b;
592
- const payload = {
593
- entity: 'NotificationModule:Call',
594
- type: (_a = options === null || options === void 0 ? void 0 : options.type) !== null && _a !== void 0 ? _a : (_b = this._record) === null || _b === void 0 ? void 0 : _b.type,
595
- actionName: 'UpdateCallOnTaskCanceled',
596
- properties: properties || {},
597
- associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined,
598
- journeyId: options === null || options === void 0 ? void 0 : options.journeyId,
599
- stageKey: options === null || options === void 0 ? void 0 : options.stageKey,
600
- };
601
- return new ActionBuilder(this._provider, 'NotificationModule', 'Call', payload, () => { this._pendingLinks = []; });
602
- }
603
531
  // ============================================
604
532
  // UPDATE ACTIONS (require existing record)
605
533
  // ============================================
@@ -632,6 +560,43 @@ class CallRecord {
632
560
  const payload = Object.assign({ id: this._record.id, entity: this._record.entity, type: this._record.type, actionName: 'UpdateCallAnalytics', properties, associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined }, options);
633
561
  return new ActionBuilder(this._provider, 'NotificationModule', 'Call', payload, () => { this._pendingLinks = []; });
634
562
  }
563
+ /**
564
+ * UpdateCallInsights
565
+ *
566
+ * Updates this Call record.
567
+ * Returns an ActionBuilder - call .execute() to update or .dryRun() for debugging.
568
+ *
569
+ * @param propertiesOrOptions - Properties to update, or options object
570
+ * @param options - Optional settings (journeyId, stageKey)
571
+ * @returns ActionBuilder - call .execute() to update or .dryRun() for payload
572
+ * @throws Error if called on a new (unsaved) record
573
+ *
574
+ * @example
575
+ * ```typescript
576
+ * const record = await odinClient.calls.get(id);
577
+ * await record.updateCallInsights({ ... }).execute();
578
+ *
579
+ * // Dry run (for debugging)
580
+ * const payload = record.updateCallInsights({ ... }).dryRun();
581
+ * ```
582
+ */
583
+ updateCallInsights(propertiesOrOptions, options) {
584
+ var _a;
585
+ if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
586
+ throw new Error('updateCallInsights requires an existing record. Use accessor.get() first.');
587
+ let properties = {};
588
+ let opts = options;
589
+ if (propertiesOrOptions) {
590
+ if ('journeyId' in propertiesOrOptions || 'stageKey' in propertiesOrOptions) {
591
+ opts = propertiesOrOptions;
592
+ }
593
+ else {
594
+ properties = propertiesOrOptions;
595
+ }
596
+ }
597
+ const payload = Object.assign({ id: this._record.id, entity: this._record.entity, type: this._record.type, actionName: 'UpdateCallInsights', properties, associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined }, opts);
598
+ return new ActionBuilder(this._provider, 'NotificationModule', 'Call', payload, () => { this._pendingLinks = []; });
599
+ }
635
600
  /**
636
601
  * UpdateCallOnInboundCallAnswered
637
602
  *
@@ -843,6 +808,35 @@ class CallRecord {
843
808
  const payload = Object.assign({ id: this._record.id, entity: this._record.entity, type: this._record.type, actionName: 'UpdateCallOnOutboundDialAction', properties, associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined }, options);
844
809
  return new ActionBuilder(this._provider, 'NotificationModule', 'Call', payload, () => { this._pendingLinks = []; });
845
810
  }
811
+ /**
812
+ * UpdateCallOnTaskCanceled
813
+ *
814
+ * Updates this Call record with the specified properties.
815
+ * Returns an ActionBuilder - call .execute() to update or .dryRun() for debugging.
816
+ *
817
+ * @param properties - Required properties for this action
818
+ * @param options - Optional settings
819
+ * @param options.journeyId - Associate with a journey
820
+ * @param options.stageKey - Transition to pipeline stage
821
+ * @returns ActionBuilder - call .execute() to update or .dryRun() for payload
822
+ * @throws Error if called on a new (unsaved) record
823
+ *
824
+ * @example
825
+ * ```typescript
826
+ * const record = await odinClient.calls.get(id);
827
+ * await record.updateCallOnTaskCanceled({ ... }).execute();
828
+ *
829
+ * // Dry run (for debugging)
830
+ * const payload = record.updateCallOnTaskCanceled({ ... }).dryRun();
831
+ * ```
832
+ */
833
+ updateCallOnTaskCanceled(properties, options) {
834
+ var _a;
835
+ if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
836
+ throw new Error('updateCallOnTaskCanceled requires an existing record. Use accessor.get() first.');
837
+ const payload = Object.assign({ id: this._record.id, entity: this._record.entity, type: this._record.type, actionName: 'UpdateCallOnTaskCanceled', properties, associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined }, options);
838
+ return new ActionBuilder(this._provider, 'NotificationModule', 'Call', payload, () => { this._pendingLinks = []; });
839
+ }
846
840
  /**
847
841
  * UpdateCallOnTaskRouterAssign
848
842
  *