@d19n/youfibre-odin-sdk 2.0.144 → 2.0.145

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.
Files changed (29) hide show
  1. package/README.md +8 -2
  2. package/dist/actions-v2/CloseAndMergeCaseActionDto.d.ts +92 -0
  3. package/dist/actions-v2/CloseAndMergeCaseActionDto.js +61 -0
  4. package/dist/actions-v2/CloseAndMergeCaseDto.d.ts +190 -0
  5. package/dist/actions-v2/CloseAndMergeCaseDto.js +126 -0
  6. package/dist/actions-v2/CreateCaseWithDpaDto.d.ts +16 -10
  7. package/dist/actions-v2/CreateInboundCallEventDto.d.ts +121 -0
  8. package/dist/actions-v2/CreateInboundCallEventDto.js +59 -0
  9. package/dist/actions-v2/CreateOutboundCallEventDto.d.ts +116 -0
  10. package/dist/actions-v2/CreateOutboundCallEventDto.js +54 -0
  11. package/dist/actions-v2/MoveAccountCreditToCancelledDto.d.ts +1 -48
  12. package/dist/actions-v2/MoveAccountCreditToCancelledDto.js +1 -21
  13. package/dist/actions-v2/MoveAccountCreditToCompleteDto.d.ts +1 -48
  14. package/dist/actions-v2/MoveAccountCreditToCompleteDto.js +1 -21
  15. package/dist/actions-v2/MoveAccountCreditToInProgressDto.d.ts +1 -48
  16. package/dist/actions-v2/MoveAccountCreditToInProgressDto.js +1 -21
  17. package/dist/actions-v2/MoveAccountCreditToPendingDto.d.ts +1 -48
  18. package/dist/actions-v2/MoveAccountCreditToPendingDto.js +1 -21
  19. package/dist/actions-v2/MoveAccountCreditToVoidDto.d.ts +1 -48
  20. package/dist/actions-v2/MoveAccountCreditToVoidDto.js +1 -21
  21. package/dist/entities-v2/Case.d.ts +12 -0
  22. package/dist/entities-v2/Case.js +2 -0
  23. package/dist/entities-v2/TwilioCallEvents.d.ts +169 -18
  24. package/dist/entities-v2/TwilioCallEvents.js +39 -3
  25. package/dist/records-v2/CaseRecord.d.ts +114 -0
  26. package/dist/records-v2/CaseRecord.js +173 -1
  27. package/dist/records-v2/TwilioCallEventsRecord.d.ts +93 -3
  28. package/dist/records-v2/TwilioCallEventsRecord.js +105 -1
  29. package/package.json +1 -1
@@ -30,6 +30,7 @@ import { CreateNoteForCaseAssignmentProperties } from '../actions-v2/AssignCaseW
30
30
  import { EscalateCaseActionProperties } from '../actions-v2/CaseDefaultStageEscalatedDto';
31
31
  import { MoveCaseToBlockedActionProperties } from '../actions-v2/CaseTransitionEscalatedToBlockedDto';
32
32
  import { ChangeCaseChannelProperties } from '../actions-v2/ChangeCaseChannelDto';
33
+ import { CloseAndMergeCaseActionProperties } from '../actions-v2/CloseAndMergeCaseActionDto';
33
34
  import { CreateCaseProperties } from '../actions-v2/CreateCaseDto';
34
35
  import { CreateCaseFromCasesProperties } from '../actions-v2/CreateCaseFromCasesDto';
35
36
  import { CreateCaseWithDpaProperties } from '../actions-v2/CreateCaseWithDpaDto';
@@ -974,6 +975,68 @@ export declare class CasteTransitionOpenToEscalatedFlowBuilder {
974
975
  private _buildRequestPayload;
975
976
  }
976
977
  /** Options for a flow step */
978
+ export interface CloseAndMergeCaseFlowBuilderStepOptions {
979
+ /** Associations to create with this step */
980
+ associations?: Array<{
981
+ recordId?: string;
982
+ entity?: string;
983
+ }>;
984
+ /** Groups for this step */
985
+ groups?: string[];
986
+ }
987
+ /**
988
+ * FlowBuilder for CloseAndMergeCase multi-step action
989
+ *
990
+ * Use method chaining to add steps, then call execute() to run the flow.
991
+ * Transitions to stage: CaseDefaultStageClosed
992
+ */
993
+ export declare class CloseAndMergeCaseFlowBuilder {
994
+ private _record;
995
+ private _provider;
996
+ private _pendingLinks;
997
+ private _options?;
998
+ private _groups;
999
+ private _steps;
1000
+ constructor(record: CaseRecord<any>, provider: IOdinProvider, pendingLinks: OdinRecordLinkDto[], options?: {
1001
+ journeyId?: string;
1002
+ });
1003
+ /**
1004
+ * Add a group to the main action
1005
+ * @param group - Group name to add
1006
+ * @returns this (for method chaining)
1007
+ */
1008
+ addGroup(group: string): this;
1009
+ /**
1010
+ * Add CloseAndMergeCaseAction step to the flow
1011
+ * @param id - ID of the record to update
1012
+ * @param properties - Properties for this step
1013
+ * @param options - Optional step settings
1014
+ * @returns this (for method chaining)
1015
+ */
1016
+ closeAndMergeCaseAction(id: string, properties: CloseAndMergeCaseActionProperties, options?: CloseAndMergeCaseFlowBuilderStepOptions): this;
1017
+ /**
1018
+ * Execute the flow
1019
+ * @returns The result from the API
1020
+ */
1021
+ execute(): Promise<IDbRecordCreateUpdateRes[]>;
1022
+ /**
1023
+ * Returns the request payload without executing (for debugging)
1024
+ * @returns The request payload that would be sent to the API
1025
+ */
1026
+ dryRun(): Record<string, any>;
1027
+ /**
1028
+ * Prevents accidental `await flowBuilder` without .execute()
1029
+ * Forces developers to explicitly call .execute()
1030
+ * @throws Error always - use .execute() or .dryRun() instead
1031
+ */
1032
+ then(): never;
1033
+ /**
1034
+ * Build the request payload for the action
1035
+ * @private
1036
+ */
1037
+ private _buildRequestPayload;
1038
+ }
1039
+ /** Options for a flow step */
977
1040
  export interface EscalateCaseTransitionFlowBuilderStepOptions {
978
1041
  /** Associations to create with this step */
979
1042
  associations?: Array<{
@@ -2239,6 +2302,57 @@ export declare class CaseRecord<TProps = CaseProperties> {
2239
2302
  journeyId?: string;
2240
2303
  stageKey?: string;
2241
2304
  }): ActionBuilder;
2305
+ /**
2306
+ * CloseAndMergeCaseAction
2307
+ *
2308
+ * Updates this Case record.
2309
+ * Returns an ActionBuilder - call .execute() to update or .dryRun() for debugging.
2310
+ *
2311
+ * @param propertiesOrOptions - Properties to update, or options object
2312
+ * @param options - Optional settings (journeyId, stageKey)
2313
+ * @returns ActionBuilder - call .execute() to update or .dryRun() for payload
2314
+ * @throws Error if called on a new (unsaved) record
2315
+ *
2316
+ * @example
2317
+ * ```typescript
2318
+ * const record = await odinClient.cases.get(id);
2319
+ * await record.closeAndMergeCaseAction({ ... }).execute();
2320
+ *
2321
+ * // Dry run (for debugging)
2322
+ * const payload = record.closeAndMergeCaseAction({ ... }).dryRun();
2323
+ * ```
2324
+ */
2325
+ closeAndMergeCaseAction(propertiesOrOptions?: CloseAndMergeCaseActionProperties | {
2326
+ journeyId?: string;
2327
+ stageKey?: string;
2328
+ }, options?: {
2329
+ journeyId?: string;
2330
+ stageKey?: string;
2331
+ }): ActionBuilder;
2332
+ /**
2333
+ * CloseAndMergeCase
2334
+ *
2335
+ * Starts a stage transition flow on this Case record.
2336
+ * Chain step methods and call .execute() to run the flow.
2337
+ *
2338
+ * @remarks Transitions to stage: CaseDefaultStageClosed
2339
+ *
2340
+ * @param options - Optional settings
2341
+ * @param options.journeyId - Associate with a journey
2342
+ * @returns FlowBuilder for chaining step methods
2343
+ * @throws Error if called on a new (unsaved) record
2344
+ *
2345
+ * @example
2346
+ * ```typescript
2347
+ * const record = await odinClient.cases.get(id);
2348
+ * await record.closeAndMergeCase()
2349
+ * .closeAndMergeCaseAction(recordId, { ... })
2350
+ * .execute();
2351
+ * ```
2352
+ */
2353
+ closeAndMergeCase(options?: {
2354
+ journeyId?: string;
2355
+ }): CloseAndMergeCaseFlowBuilder;
2242
2356
  /**
2243
2357
  * EditCaseForm
2244
2358
  *
@@ -28,7 +28,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
28
28
  });
29
29
  };
30
30
  Object.defineProperty(exports, "__esModule", { value: true });
31
- exports.isCaseRecord = exports.CaseRecord = exports.MoveDefaultCaseFromOpenToClosedFlowBuilder = exports.MoveCaseToClosedWithAdditionalNoteFlowBuilder = exports.MoveCaseToBlockedTransitionFlowBuilder = exports.EscalateCaseTransitionFlowBuilder = exports.CasteTransitionOpenToEscalatedFlowBuilder = exports.CasedefaultstageblockedFlowBuilder = exports.CaseTransitionSolvedToEscalatedFlowBuilder = exports.CaseTransitionPendingReplyToEscalatedFlowBuilder = exports.CaseTransitionPendingReplyToBlockedFlowBuilder = exports.CaseTransitionPendingAgentToEscalatedFlowBuilder = exports.CaseTransitionPendingAgentToBlockedFlowBuilder = exports.CaseTransitionOpenToBlockedFlowBuilder = exports.CaseTransitionEscalatedToEscalatedFlowBuilder = exports.CaseTransitionEscalatedToBlockedFlowBuilder = exports.CaseTransitionBlockedToEscalatedFlowBuilder = exports.CaseDefaultStageEscalatedFlowBuilder = exports.AssignCaseWithNoteFlowFlowBuilder = void 0;
31
+ exports.isCaseRecord = exports.CaseRecord = exports.MoveDefaultCaseFromOpenToClosedFlowBuilder = exports.MoveCaseToClosedWithAdditionalNoteFlowBuilder = exports.MoveCaseToBlockedTransitionFlowBuilder = exports.EscalateCaseTransitionFlowBuilder = exports.CloseAndMergeCaseFlowBuilder = exports.CasteTransitionOpenToEscalatedFlowBuilder = exports.CasedefaultstageblockedFlowBuilder = exports.CaseTransitionSolvedToEscalatedFlowBuilder = exports.CaseTransitionPendingReplyToEscalatedFlowBuilder = exports.CaseTransitionPendingReplyToBlockedFlowBuilder = exports.CaseTransitionPendingAgentToEscalatedFlowBuilder = exports.CaseTransitionPendingAgentToBlockedFlowBuilder = exports.CaseTransitionOpenToBlockedFlowBuilder = exports.CaseTransitionEscalatedToEscalatedFlowBuilder = exports.CaseTransitionEscalatedToBlockedFlowBuilder = exports.CaseTransitionBlockedToEscalatedFlowBuilder = exports.CaseDefaultStageEscalatedFlowBuilder = exports.AssignCaseWithNoteFlowFlowBuilder = void 0;
32
32
  const uuid_1 = require("uuid");
33
33
  const core_1 = require("@d19n/odin-types/dist/core");
34
34
  const record_link_manager_1 = require("@d19n/odin-sdk-generator/dist/record-link-manager");
@@ -1635,6 +1635,114 @@ class CasteTransitionOpenToEscalatedFlowBuilder {
1635
1635
  }
1636
1636
  }
1637
1637
  exports.CasteTransitionOpenToEscalatedFlowBuilder = CasteTransitionOpenToEscalatedFlowBuilder;
1638
+ /**
1639
+ * FlowBuilder for CloseAndMergeCase multi-step action
1640
+ *
1641
+ * Use method chaining to add steps, then call execute() to run the flow.
1642
+ * Transitions to stage: CaseDefaultStageClosed
1643
+ */
1644
+ class CloseAndMergeCaseFlowBuilder {
1645
+ constructor(record, provider, pendingLinks, options) {
1646
+ this._groups = [];
1647
+ this._steps = [];
1648
+ this._record = record;
1649
+ this._provider = provider;
1650
+ this._pendingLinks = pendingLinks;
1651
+ this._options = options;
1652
+ }
1653
+ /**
1654
+ * Add a group to the main action
1655
+ * @param group - Group name to add
1656
+ * @returns this (for method chaining)
1657
+ */
1658
+ addGroup(group) {
1659
+ this._groups.push(group);
1660
+ return this;
1661
+ }
1662
+ /**
1663
+ * Add CloseAndMergeCaseAction step to the flow
1664
+ * @param id - ID of the record to update
1665
+ * @param properties - Properties for this step
1666
+ * @param options - Optional step settings
1667
+ * @returns this (for method chaining)
1668
+ */
1669
+ closeAndMergeCaseAction(id, properties, options) {
1670
+ var _a;
1671
+ this._steps.push({
1672
+ actionName: 'CloseAndMergeCaseAction',
1673
+ properties,
1674
+ id,
1675
+ entity: 'SupportModule:Case',
1676
+ type: 'DEFAULT',
1677
+ autoLinkParent: false,
1678
+ associations: (_a = options === null || options === void 0 ? void 0 : options.associations) === null || _a === void 0 ? void 0 : _a.map(a => (Object.assign(Object.assign({}, a), { linkType: null, relationType: undefined }))),
1679
+ groups: options === null || options === void 0 ? void 0 : options.groups,
1680
+ });
1681
+ return this;
1682
+ }
1683
+ /**
1684
+ * Execute the flow
1685
+ * @returns The result from the API
1686
+ */
1687
+ execute() {
1688
+ return __awaiter(this, void 0, void 0, function* () {
1689
+ const payload = this._buildRequestPayload();
1690
+ const result = yield this._provider._applyAction('SupportModule', 'Case', payload);
1691
+ // Clear pending links on the record after execution
1692
+ this._record.clearPendingLinks();
1693
+ return result;
1694
+ });
1695
+ }
1696
+ /**
1697
+ * Returns the request payload without executing (for debugging)
1698
+ * @returns The request payload that would be sent to the API
1699
+ */
1700
+ dryRun() {
1701
+ return this._buildRequestPayload();
1702
+ }
1703
+ /**
1704
+ * Prevents accidental `await flowBuilder` without .execute()
1705
+ * Forces developers to explicitly call .execute()
1706
+ * @throws Error always - use .execute() or .dryRun() instead
1707
+ */
1708
+ then() {
1709
+ throw new Error('FlowBuilder cannot be awaited directly. Call .execute() to run the flow or .dryRun() to get the payload.');
1710
+ }
1711
+ /**
1712
+ * Build the request payload for the action
1713
+ * @private
1714
+ */
1715
+ _buildRequestPayload() {
1716
+ const record = this._record.record;
1717
+ if (!(record === null || record === void 0 ? void 0 : record.id))
1718
+ throw new Error('Cannot execute flow on unsaved record');
1719
+ // Build steps with parent associations
1720
+ const stepsWithAssociations = this._steps.map(step => {
1721
+ const stepAssociations = [...(step.associations || [])];
1722
+ // Auto-add parent association if step requires it
1723
+ if (step.autoLinkParent) {
1724
+ stepAssociations.push({
1725
+ entity: record.entity,
1726
+ recordId: record.id,
1727
+ linkType: null,
1728
+ relationType: 'PARENT',
1729
+ });
1730
+ }
1731
+ return {
1732
+ entity: step.entity,
1733
+ type: step.type,
1734
+ actionName: step.actionName,
1735
+ properties: step.properties,
1736
+ title: step.title,
1737
+ id: step.id,
1738
+ associations: stepAssociations.length > 0 ? stepAssociations : undefined,
1739
+ groups: step.groups,
1740
+ };
1741
+ });
1742
+ return Object.assign({ id: record.id, entity: record.entity, type: record.type, actionName: 'CloseAndMergeCase', steps: stepsWithAssociations, associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined, groups: this._groups.length > 0 ? this._groups : undefined, stageKey: 'CaseDefaultStageClosed' }, this._options);
1743
+ }
1744
+ }
1745
+ exports.CloseAndMergeCaseFlowBuilder = CloseAndMergeCaseFlowBuilder;
1638
1746
  /**
1639
1747
  * FlowBuilder for EscalateCaseTransition multi-step action
1640
1748
  *
@@ -3429,6 +3537,70 @@ class CaseRecord {
3429
3537
  const payload = Object.assign({ id: this._record.id, entity: this._record.entity, type: this._record.type, actionName: 'ChangeCaseChannel', properties, associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined }, opts);
3430
3538
  return new ActionBuilder(this._provider, 'SupportModule', 'Case', payload, () => { this._pendingLinks = []; });
3431
3539
  }
3540
+ /**
3541
+ * CloseAndMergeCaseAction
3542
+ *
3543
+ * Updates this Case record.
3544
+ * Returns an ActionBuilder - call .execute() to update or .dryRun() for debugging.
3545
+ *
3546
+ * @param propertiesOrOptions - Properties to update, or options object
3547
+ * @param options - Optional settings (journeyId, stageKey)
3548
+ * @returns ActionBuilder - call .execute() to update or .dryRun() for payload
3549
+ * @throws Error if called on a new (unsaved) record
3550
+ *
3551
+ * @example
3552
+ * ```typescript
3553
+ * const record = await odinClient.cases.get(id);
3554
+ * await record.closeAndMergeCaseAction({ ... }).execute();
3555
+ *
3556
+ * // Dry run (for debugging)
3557
+ * const payload = record.closeAndMergeCaseAction({ ... }).dryRun();
3558
+ * ```
3559
+ */
3560
+ closeAndMergeCaseAction(propertiesOrOptions, options) {
3561
+ var _a;
3562
+ if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
3563
+ throw new Error('closeAndMergeCaseAction requires an existing record. Use accessor.get() first.');
3564
+ let properties = {};
3565
+ let opts = options;
3566
+ if (propertiesOrOptions) {
3567
+ if ('journeyId' in propertiesOrOptions || 'stageKey' in propertiesOrOptions) {
3568
+ opts = propertiesOrOptions;
3569
+ }
3570
+ else {
3571
+ properties = propertiesOrOptions;
3572
+ }
3573
+ }
3574
+ const payload = Object.assign({ id: this._record.id, entity: this._record.entity, type: this._record.type, actionName: 'CloseAndMergeCaseAction', properties, associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined }, opts);
3575
+ return new ActionBuilder(this._provider, 'SupportModule', 'Case', payload, () => { this._pendingLinks = []; });
3576
+ }
3577
+ /**
3578
+ * CloseAndMergeCase
3579
+ *
3580
+ * Starts a stage transition flow on this Case record.
3581
+ * Chain step methods and call .execute() to run the flow.
3582
+ *
3583
+ * @remarks Transitions to stage: CaseDefaultStageClosed
3584
+ *
3585
+ * @param options - Optional settings
3586
+ * @param options.journeyId - Associate with a journey
3587
+ * @returns FlowBuilder for chaining step methods
3588
+ * @throws Error if called on a new (unsaved) record
3589
+ *
3590
+ * @example
3591
+ * ```typescript
3592
+ * const record = await odinClient.cases.get(id);
3593
+ * await record.closeAndMergeCase()
3594
+ * .closeAndMergeCaseAction(recordId, { ... })
3595
+ * .execute();
3596
+ * ```
3597
+ */
3598
+ closeAndMergeCase(options) {
3599
+ var _a;
3600
+ if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
3601
+ throw new Error('closeAndMergeCase requires an existing record. Use accessor.get() first.');
3602
+ return new CloseAndMergeCaseFlowBuilder(this, this._provider, this._pendingLinks, options);
3603
+ }
3432
3604
  /**
3433
3605
  * EditCaseForm
3434
3606
  *
@@ -13,7 +13,7 @@
13
13
  * await record.createTwilioCallEvents({ ... }).execute();
14
14
  * ```
15
15
  *
16
- * Entity Types: INBOUND_CALL_STATUS_UPDATE_EVENT, NUMBER_CALL_STATUS_EVENT, OUTBOUND_CALL_STATUS_UPDATE_EVENT, OUTBOUND_DIAL_ACTION_EVENT
16
+ * Entity Types: INBOUND_CALL_EVENT, INBOUND_CALL_STATUS_UPDATE_EVENT, NUMBER_CALL_STATUS_EVENT, OUTBOUND_CALL_EVENT, OUTBOUND_CALL_STATUS_UPDATE_EVENT, OUTBOUND_DIAL_ACTION_EVENT
17
17
  *
18
18
  * AUTO-GENERATED - DO NOT EDIT DIRECTLY
19
19
  */
@@ -22,14 +22,16 @@ 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 { TwilioCallEventsProperties, InboundCallStatusUpdateEventTwilioCallEventsProperties, NumberCallStatusEventTwilioCallEventsProperties, OutboundCallStatusUpdateEventTwilioCallEventsProperties, OutboundDialActionEventTwilioCallEventsProperties } from '../entities-v2/TwilioCallEvents';
25
+ import { TwilioCallEventsProperties, InboundCallEventTwilioCallEventsProperties, InboundCallStatusUpdateEventTwilioCallEventsProperties, NumberCallStatusEventTwilioCallEventsProperties, OutboundCallEventTwilioCallEventsProperties, OutboundCallStatusUpdateEventTwilioCallEventsProperties, OutboundDialActionEventTwilioCallEventsProperties } from '../entities-v2/TwilioCallEvents';
26
+ import { CreateInboundCallEventProperties } from '../actions-v2/CreateInboundCallEventDto';
26
27
  import { CreateInboundCallStatusUpdateEventProperties } from '../actions-v2/CreateInboundCallStatusUpdateEventDto';
27
28
  import { CreateNumberCallStatusEventProperties } from '../actions-v2/CreateNumberCallStatusEventDto';
29
+ import { CreateOutboundCallEventProperties } from '../actions-v2/CreateOutboundCallEventDto';
28
30
  import { CreateOutboundCallStatusUpdateEventProperties } from '../actions-v2/CreateOutboundCallStatusUpdateEventDto';
29
31
  import { CreateOutboundDialActionEventProperties } from '../actions-v2/CreateOutboundDialActionEventDto';
30
32
  import { CallRecord } from './CallRecord';
31
33
  /** Valid entity types for TwilioCallEvents */
32
- export declare type TwilioCallEventsType = 'INBOUND_CALL_STATUS_UPDATE_EVENT' | 'NUMBER_CALL_STATUS_EVENT' | 'OUTBOUND_CALL_STATUS_UPDATE_EVENT' | 'OUTBOUND_DIAL_ACTION_EVENT';
34
+ export declare type TwilioCallEventsType = 'INBOUND_CALL_EVENT' | 'INBOUND_CALL_STATUS_UPDATE_EVENT' | 'NUMBER_CALL_STATUS_EVENT' | 'OUTBOUND_CALL_EVENT' | 'OUTBOUND_CALL_STATUS_UPDATE_EVENT' | 'OUTBOUND_DIAL_ACTION_EVENT';
33
35
  /**
34
36
  * Builder for action execution with dryRun support
35
37
  *
@@ -119,6 +121,22 @@ export declare class TwilioCallEventsRecord<TProps = TwilioCallEventsProperties>
119
121
  get groups(): string[];
120
122
  /** Access the underlying OdinRecord (null for new records) */
121
123
  get record(): OdinRecord<TProps> | null;
124
+ /**
125
+ * Type guard: check if this record is of type INBOUND_CALL_EVENT
126
+ *
127
+ * When this returns true, TypeScript automatically narrows the type,
128
+ * giving you access to INBOUND_CALL_EVENT-specific properties.
129
+ *
130
+ * @example
131
+ * ```typescript
132
+ * if (record.isInboundCallEvent()) {
133
+ * // TypeScript knows record.properties is InboundCallEventTwilioCallEventsProperties
134
+ * console.log(record.properties.SomeTypeSpecificField);
135
+ * }
136
+ * ```
137
+ * @remarks Inbound call webhook events
138
+ */
139
+ isInboundCallEvent(): this is TwilioCallEventsRecord<InboundCallEventTwilioCallEventsProperties>;
122
140
  /**
123
141
  * Type guard: check if this record is of type INBOUND_CALL_STATUS_UPDATE_EVENT
124
142
  *
@@ -151,6 +169,22 @@ export declare class TwilioCallEventsRecord<TProps = TwilioCallEventsProperties>
151
169
  * @remarks Callback containing incoming call wrap up for customer
152
170
  */
153
171
  isNumberCallStatusEvent(): this is TwilioCallEventsRecord<NumberCallStatusEventTwilioCallEventsProperties>;
172
+ /**
173
+ * Type guard: check if this record is of type OUTBOUND_CALL_EVENT
174
+ *
175
+ * When this returns true, TypeScript automatically narrows the type,
176
+ * giving you access to OUTBOUND_CALL_EVENT-specific properties.
177
+ *
178
+ * @example
179
+ * ```typescript
180
+ * if (record.isOutboundCallEvent()) {
181
+ * // TypeScript knows record.properties is OutboundCallEventTwilioCallEventsProperties
182
+ * console.log(record.properties.SomeTypeSpecificField);
183
+ * }
184
+ * ```
185
+ * @remarks Outbound call webhook events
186
+ */
187
+ isOutboundCallEvent(): this is TwilioCallEventsRecord<OutboundCallEventTwilioCallEventsProperties>;
154
188
  /**
155
189
  * Type guard: check if this record is of type OUTBOUND_CALL_STATUS_UPDATE_EVENT
156
190
  *
@@ -222,6 +256,34 @@ export declare class TwilioCallEventsRecord<TProps = TwilioCallEventsProperties>
222
256
  unlink(target: OdinRecord<any> | {
223
257
  id: string;
224
258
  } | string): Promise<void>;
259
+ /**
260
+ * CreateInboundCallEvent
261
+ *
262
+ * Creates a new TwilioCallEvents record with the specified properties.
263
+ * Returns an ActionBuilder - call .execute() to create or .dryRun() for debugging.
264
+ *
265
+ * @remarks Record type: INBOUND_CALL_EVENT
266
+ *
267
+ * @param properties - The properties for the new record
268
+ * @param options - Optional settings
269
+ * @param options.journeyId - Associate with a journey
270
+ * @param options.stageKey - Set initial pipeline stage
271
+ * @returns ActionBuilder - call .execute() to create or .dryRun() for payload
272
+ *
273
+ * @example
274
+ * ```typescript
275
+ * // Create with properties
276
+ * const record = odinClient.twilioCallEventss.new();
277
+ * await record.createInboundCallEvent({ ... }).execute();
278
+ *
279
+ * // Dry run (for debugging)
280
+ * const payload = record.createInboundCallEvent({ ... }).dryRun();
281
+ * ```
282
+ */
283
+ createInboundCallEvent(properties: CreateInboundCallEventProperties, options?: {
284
+ journeyId?: string;
285
+ stageKey?: string;
286
+ }): ActionBuilder;
225
287
  /**
226
288
  * CreateInboundCallStatusUpdateEvent
227
289
  *
@@ -278,6 +340,34 @@ export declare class TwilioCallEventsRecord<TProps = TwilioCallEventsProperties>
278
340
  journeyId?: string;
279
341
  stageKey?: string;
280
342
  }): ActionBuilder;
343
+ /**
344
+ * CreateOutboundCallEvent
345
+ *
346
+ * Creates a new TwilioCallEvents record with the specified properties.
347
+ * Returns an ActionBuilder - call .execute() to create or .dryRun() for debugging.
348
+ *
349
+ * @param properties - The properties for the new record
350
+ * @param options - Optional settings
351
+ * @param options.type - Override the record type
352
+ * @param options.journeyId - Associate with a journey
353
+ * @param options.stageKey - Set initial pipeline stage
354
+ * @returns ActionBuilder - call .execute() to create or .dryRun() for payload
355
+ *
356
+ * @example
357
+ * ```typescript
358
+ * // Create with properties
359
+ * const record = odinClient.twilioCallEventss.new();
360
+ * await record.createOutboundCallEvent({ ... }).execute();
361
+ *
362
+ * // Dry run (for debugging)
363
+ * const payload = record.createOutboundCallEvent({ ... }).dryRun();
364
+ * ```
365
+ */
366
+ createOutboundCallEvent(properties: CreateOutboundCallEventProperties, options?: {
367
+ type?: string;
368
+ journeyId?: string;
369
+ stageKey?: string;
370
+ }): ActionBuilder;
281
371
  /**
282
372
  * CreateOutboundCallStatusUpdateEvent
283
373
  *
@@ -14,7 +14,7 @@
14
14
  * await record.createTwilioCallEvents({ ... }).execute();
15
15
  * ```
16
16
  *
17
- * Entity Types: INBOUND_CALL_STATUS_UPDATE_EVENT, NUMBER_CALL_STATUS_EVENT, OUTBOUND_CALL_STATUS_UPDATE_EVENT, OUTBOUND_DIAL_ACTION_EVENT
17
+ * Entity Types: INBOUND_CALL_EVENT, INBOUND_CALL_STATUS_UPDATE_EVENT, NUMBER_CALL_STATUS_EVENT, OUTBOUND_CALL_EVENT, OUTBOUND_CALL_STATUS_UPDATE_EVENT, OUTBOUND_DIAL_ACTION_EVENT
18
18
  *
19
19
  * AUTO-GENERATED - DO NOT EDIT DIRECTLY
20
20
  */
@@ -146,6 +146,22 @@ class TwilioCallEventsRecord {
146
146
  // ============================================
147
147
  // TYPE GUARDS (with TypeScript type predicates)
148
148
  // ============================================
149
+ /**
150
+ * Type guard: check if this record is of type INBOUND_CALL_EVENT
151
+ *
152
+ * When this returns true, TypeScript automatically narrows the type,
153
+ * giving you access to INBOUND_CALL_EVENT-specific properties.
154
+ *
155
+ * @example
156
+ * ```typescript
157
+ * if (record.isInboundCallEvent()) {
158
+ * // TypeScript knows record.properties is InboundCallEventTwilioCallEventsProperties
159
+ * console.log(record.properties.SomeTypeSpecificField);
160
+ * }
161
+ * ```
162
+ * @remarks Inbound call webhook events
163
+ */
164
+ isInboundCallEvent() { var _a; return ((_a = this._record) === null || _a === void 0 ? void 0 : _a.type) === 'INBOUND_CALL_EVENT'; }
149
165
  /**
150
166
  * Type guard: check if this record is of type INBOUND_CALL_STATUS_UPDATE_EVENT
151
167
  *
@@ -178,6 +194,22 @@ class TwilioCallEventsRecord {
178
194
  * @remarks Callback containing incoming call wrap up for customer
179
195
  */
180
196
  isNumberCallStatusEvent() { var _a; return ((_a = this._record) === null || _a === void 0 ? void 0 : _a.type) === 'NUMBER_CALL_STATUS_EVENT'; }
197
+ /**
198
+ * Type guard: check if this record is of type OUTBOUND_CALL_EVENT
199
+ *
200
+ * When this returns true, TypeScript automatically narrows the type,
201
+ * giving you access to OUTBOUND_CALL_EVENT-specific properties.
202
+ *
203
+ * @example
204
+ * ```typescript
205
+ * if (record.isOutboundCallEvent()) {
206
+ * // TypeScript knows record.properties is OutboundCallEventTwilioCallEventsProperties
207
+ * console.log(record.properties.SomeTypeSpecificField);
208
+ * }
209
+ * ```
210
+ * @remarks Outbound call webhook events
211
+ */
212
+ isOutboundCallEvent() { var _a; return ((_a = this._record) === null || _a === void 0 ? void 0 : _a.type) === 'OUTBOUND_CALL_EVENT'; }
181
213
  /**
182
214
  * Type guard: check if this record is of type OUTBOUND_CALL_STATUS_UPDATE_EVENT
183
215
  *
@@ -278,6 +310,42 @@ class TwilioCallEventsRecord {
278
310
  // ============================================
279
311
  // CREATE ACTIONS (no existing record required)
280
312
  // ============================================
313
+ /**
314
+ * CreateInboundCallEvent
315
+ *
316
+ * Creates a new TwilioCallEvents record with the specified properties.
317
+ * Returns an ActionBuilder - call .execute() to create or .dryRun() for debugging.
318
+ *
319
+ * @remarks Record type: INBOUND_CALL_EVENT
320
+ *
321
+ * @param properties - The properties for the new record
322
+ * @param options - Optional settings
323
+ * @param options.journeyId - Associate with a journey
324
+ * @param options.stageKey - Set initial pipeline stage
325
+ * @returns ActionBuilder - call .execute() to create or .dryRun() for payload
326
+ *
327
+ * @example
328
+ * ```typescript
329
+ * // Create with properties
330
+ * const record = odinClient.twilioCallEventss.new();
331
+ * await record.createInboundCallEvent({ ... }).execute();
332
+ *
333
+ * // Dry run (for debugging)
334
+ * const payload = record.createInboundCallEvent({ ... }).dryRun();
335
+ * ```
336
+ */
337
+ createInboundCallEvent(properties, options) {
338
+ const payload = {
339
+ entity: 'NotificationModule:TwilioCallEvents',
340
+ type: 'INBOUND_CALL_EVENT',
341
+ actionName: 'CreateInboundCallEvent',
342
+ properties: properties || {},
343
+ associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined,
344
+ journeyId: options === null || options === void 0 ? void 0 : options.journeyId,
345
+ stageKey: options === null || options === void 0 ? void 0 : options.stageKey,
346
+ };
347
+ return new ActionBuilder(this._provider, 'NotificationModule', 'TwilioCallEvents', payload, () => { this._pendingLinks = []; });
348
+ }
281
349
  /**
282
350
  * CreateInboundCallStatusUpdateEvent
283
351
  *
@@ -350,6 +418,42 @@ class TwilioCallEventsRecord {
350
418
  };
351
419
  return new ActionBuilder(this._provider, 'NotificationModule', 'TwilioCallEvents', payload, () => { this._pendingLinks = []; });
352
420
  }
421
+ /**
422
+ * CreateOutboundCallEvent
423
+ *
424
+ * Creates a new TwilioCallEvents record with the specified properties.
425
+ * Returns an ActionBuilder - call .execute() to create or .dryRun() for debugging.
426
+ *
427
+ * @param properties - The properties for the new record
428
+ * @param options - Optional settings
429
+ * @param options.type - Override the record type
430
+ * @param options.journeyId - Associate with a journey
431
+ * @param options.stageKey - Set initial pipeline stage
432
+ * @returns ActionBuilder - call .execute() to create or .dryRun() for payload
433
+ *
434
+ * @example
435
+ * ```typescript
436
+ * // Create with properties
437
+ * const record = odinClient.twilioCallEventss.new();
438
+ * await record.createOutboundCallEvent({ ... }).execute();
439
+ *
440
+ * // Dry run (for debugging)
441
+ * const payload = record.createOutboundCallEvent({ ... }).dryRun();
442
+ * ```
443
+ */
444
+ createOutboundCallEvent(properties, options) {
445
+ var _a, _b;
446
+ const payload = {
447
+ entity: 'NotificationModule:TwilioCallEvents',
448
+ 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,
449
+ actionName: 'CreateOutboundCallEvent',
450
+ properties: properties || {},
451
+ associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined,
452
+ journeyId: options === null || options === void 0 ? void 0 : options.journeyId,
453
+ stageKey: options === null || options === void 0 ? void 0 : options.stageKey,
454
+ };
455
+ return new ActionBuilder(this._provider, 'NotificationModule', 'TwilioCallEvents', payload, () => { this._pendingLinks = []; });
456
+ }
353
457
  /**
354
458
  * CreateOutboundCallStatusUpdateEvent
355
459
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@d19n/youfibre-odin-sdk",
3
- "version": "2.0.144",
3
+ "version": "2.0.145",
4
4
  "description": "",
5
5
  "author": "@d19n",
6
6
  "license": "UNLICENSED",