@d19n/youfibre-odin-sdk 2.0.142 → 2.0.144
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 +14 -3
- package/dist/EntityRegistry.d.ts +2 -0
- package/dist/EntityRegistry.js +2 -0
- package/dist/OdinApiClient.d.ts +4 -0
- package/dist/OdinApiClient.js +8 -0
- package/dist/OdinDbClient.d.ts +4 -0
- package/dist/OdinDbClient.js +8 -0
- package/dist/accessors-v2/TwilioCallEventsAccessor.d.ts +111 -0
- package/dist/accessors-v2/TwilioCallEventsAccessor.js +190 -0
- package/dist/accessors-v2/index.d.ts +1 -0
- package/dist/accessors-v2/index.js +4 -2
- package/dist/actions-v2/CreateInboundCallStatusUpdateEventDto.d.ts +113 -0
- package/dist/actions-v2/CreateInboundCallStatusUpdateEventDto.js +59 -0
- package/dist/actions-v2/CreateNumberCallStatusEventDto.d.ts +105 -0
- package/dist/actions-v2/CreateNumberCallStatusEventDto.js +59 -0
- package/dist/actions-v2/CreateOutboundCallStatusUpdateEventDto.d.ts +113 -0
- package/dist/actions-v2/CreateOutboundCallStatusUpdateEventDto.js +59 -0
- package/dist/actions-v2/CreateOutboundDialActionEventDto.d.ts +113 -0
- package/dist/actions-v2/CreateOutboundDialActionEventDto.js +59 -0
- package/dist/actions-v2/UpdateCallOnTaskCanceledDto.d.ts +66 -0
- package/dist/actions-v2/UpdateCallOnTaskCanceledDto.js +52 -0
- package/dist/api-sdk-v2/CallApi.d.ts +2 -0
- package/dist/api-sdk-v2/CallApi.js +6 -0
- package/dist/api-sdk-v2/TwilioCallEventsApi.d.ts +48 -0
- package/dist/api-sdk-v2/TwilioCallEventsApi.js +155 -0
- package/dist/db-accessors-v2/TwilioCallEventsDbAccessor.d.ts +149 -0
- package/dist/db-accessors-v2/TwilioCallEventsDbAccessor.js +227 -0
- package/dist/db-accessors-v2/index.d.ts +1 -0
- package/dist/db-accessors-v2/index.js +4 -2
- package/dist/db-sdk-v2/CallDb.d.ts +2 -0
- package/dist/db-sdk-v2/CallDb.js +6 -0
- package/dist/db-sdk-v2/TwilioCallEventsDb.d.ts +120 -0
- package/dist/db-sdk-v2/TwilioCallEventsDb.js +204 -0
- package/dist/entities-v2/Call.d.ts +7 -0
- package/dist/entities-v2/Call.js +5 -1
- package/dist/entities-v2/CallEvent.d.ts +67 -1
- package/dist/entities-v2/CallEvent.js +9 -1
- package/dist/entities-v2/TwilioCallEvents.d.ts +282 -0
- package/dist/entities-v2/TwilioCallEvents.js +99 -0
- package/dist/records-v2/CallEventRecord.d.ts +19 -3
- package/dist/records-v2/CallEventRecord.js +17 -1
- package/dist/records-v2/CallRecord.d.ts +49 -0
- package/dist/records-v2/CallRecord.js +69 -0
- package/dist/records-v2/TwilioCallEventsRecord.d.ts +340 -0
- package/dist/records-v2/TwilioCallEventsRecord.js +436 -0
- package/dist/records-v2/index.d.ts +1 -0
- package/dist/records-v2/index.js +6 -3
- package/package.json +1 -1
|
@@ -0,0 +1,436 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* TwilioCallEvents Record Wrapper
|
|
4
|
+
*
|
|
5
|
+
* Provides typed action methods and link management.
|
|
6
|
+
* Works with both ApiProvider and DbProvider.
|
|
7
|
+
*
|
|
8
|
+
* All action methods return an ActionBuilder or FlowBuilder.
|
|
9
|
+
* Call .execute() to run or .dryRun() to get the payload for debugging.
|
|
10
|
+
*
|
|
11
|
+
* Can be instantiated with null record for create operations:
|
|
12
|
+
* ```typescript
|
|
13
|
+
* const record = odinClient.twilioCallEventss.new();
|
|
14
|
+
* await record.createTwilioCallEvents({ ... }).execute();
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* Entity Types: INBOUND_CALL_STATUS_UPDATE_EVENT, NUMBER_CALL_STATUS_EVENT, OUTBOUND_CALL_STATUS_UPDATE_EVENT, OUTBOUND_DIAL_ACTION_EVENT
|
|
18
|
+
*
|
|
19
|
+
* AUTO-GENERATED - DO NOT EDIT DIRECTLY
|
|
20
|
+
*/
|
|
21
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
22
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
23
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
24
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
25
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
26
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
27
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
+
exports.isTwilioCallEventsRecord = exports.TwilioCallEventsRecord = void 0;
|
|
32
|
+
const uuid_1 = require("uuid");
|
|
33
|
+
const core_1 = require("@d19n/odin-types/dist/core");
|
|
34
|
+
const record_link_manager_1 = require("@d19n/odin-sdk-generator/dist/record-link-manager");
|
|
35
|
+
const CallRecord_1 = require("./CallRecord");
|
|
36
|
+
/**
|
|
37
|
+
* Builder for action execution with dryRun support
|
|
38
|
+
*
|
|
39
|
+
* Provides a consistent API across all action types:
|
|
40
|
+
* - `.execute()` - Execute the action and return results
|
|
41
|
+
* - `.dryRun()` - Return the payload without executing (for debugging)
|
|
42
|
+
*/
|
|
43
|
+
class ActionBuilder {
|
|
44
|
+
constructor(provider, moduleName, entityName, payload, clearPendingLinks) {
|
|
45
|
+
this._provider = provider;
|
|
46
|
+
this._moduleName = moduleName;
|
|
47
|
+
this._entityName = entityName;
|
|
48
|
+
this._payload = payload;
|
|
49
|
+
this._clearPendingLinks = clearPendingLinks;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Set an external system identifier for this record.
|
|
53
|
+
* Links the record to a corresponding entry in an external application.
|
|
54
|
+
*
|
|
55
|
+
* @param externalId - The ID in the external system
|
|
56
|
+
* @param externalAppId - The external application identifier
|
|
57
|
+
* @returns this (for chaining)
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```typescript
|
|
61
|
+
* await record.createOrder({ ... }).withExternalId('SF-123', 'salesforce').execute();
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
withExternalId(externalId, externalAppId) {
|
|
65
|
+
this._payload.externalId = externalId;
|
|
66
|
+
this._payload.externalAppId = externalAppId;
|
|
67
|
+
return this;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Set security/access groups for this record.
|
|
71
|
+
* Controls which user groups can access the record.
|
|
72
|
+
*
|
|
73
|
+
* @param groups - Array of group names
|
|
74
|
+
* @returns this (for chaining)
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```typescript
|
|
78
|
+
* await record.createOrder({ ... }).withGroups(['TenantA', 'BillingTeam']).execute();
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
withGroups(groups) {
|
|
82
|
+
this._payload.groups = groups;
|
|
83
|
+
return this;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Execute the action
|
|
87
|
+
* @returns The result from the API
|
|
88
|
+
*/
|
|
89
|
+
execute() {
|
|
90
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
91
|
+
const result = yield this._provider._applyAction(this._moduleName, this._entityName, this._payload);
|
|
92
|
+
this._clearPendingLinks();
|
|
93
|
+
return result;
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Returns the request payload without executing (for debugging)
|
|
98
|
+
* @returns The request payload that would be sent to the API
|
|
99
|
+
*/
|
|
100
|
+
dryRun() {
|
|
101
|
+
return this._payload;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Prevents accidental `await actionBuilder` without .execute()
|
|
105
|
+
* Forces developers to explicitly call .execute()
|
|
106
|
+
* @throws Error always - use .execute() or .dryRun() instead
|
|
107
|
+
*/
|
|
108
|
+
then() {
|
|
109
|
+
throw new Error('ActionBuilder cannot be awaited directly. Call .execute() to run the action or .dryRun() to get the payload.');
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
class TwilioCallEventsRecord {
|
|
113
|
+
/**
|
|
114
|
+
* Create a record wrapper.
|
|
115
|
+
* @param record - The underlying record, or null for create operations
|
|
116
|
+
* @param provider - The API or DB provider
|
|
117
|
+
* @param preGeneratedId - Optional pre-generated ID for new records (auto-generated if not provided)
|
|
118
|
+
*/
|
|
119
|
+
constructor(record, provider, preGeneratedId) {
|
|
120
|
+
this._pendingLinks = [];
|
|
121
|
+
this._record = record;
|
|
122
|
+
this._provider = provider;
|
|
123
|
+
this._preGeneratedId = preGeneratedId !== null && preGeneratedId !== void 0 ? preGeneratedId : (0, uuid_1.v4)();
|
|
124
|
+
}
|
|
125
|
+
// ============================================
|
|
126
|
+
// CORE PROPERTIES
|
|
127
|
+
// ============================================
|
|
128
|
+
/** Returns true if this is a new (unsaved) record */
|
|
129
|
+
get isNew() { var _a; return !((_a = this._record) === null || _a === void 0 ? void 0 : _a.id); }
|
|
130
|
+
/** Record ID - always available (pre-generated for new records) */
|
|
131
|
+
get id() { var _a, _b; return (_b = (_a = this._record) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : this._preGeneratedId; }
|
|
132
|
+
get entity() { var _a, _b; return (_b = (_a = this._record) === null || _a === void 0 ? void 0 : _a.entity) !== null && _b !== void 0 ? _b : 'NotificationModule:TwilioCallEvents'; }
|
|
133
|
+
get type() { var _a; return (_a = this._record) === null || _a === void 0 ? void 0 : _a.type; }
|
|
134
|
+
/** Record properties - empty object for new (unsaved) records */
|
|
135
|
+
get properties() { var _a; return ((_a = this._record) === null || _a === void 0 ? void 0 : _a.properties) || {}; }
|
|
136
|
+
get title() { var _a; return (_a = this._record) === null || _a === void 0 ? void 0 : _a.title; }
|
|
137
|
+
get recordNumber() { var _a; return (_a = this._record) === null || _a === void 0 ? void 0 : _a.recordNumber; }
|
|
138
|
+
get stage() { var _a; return (_a = this._record) === null || _a === void 0 ? void 0 : _a.stage; }
|
|
139
|
+
get createdAt() { var _a; return (_a = this._record) === null || _a === void 0 ? void 0 : _a.createdAt; }
|
|
140
|
+
get updatedAt() { var _a; return (_a = this._record) === null || _a === void 0 ? void 0 : _a.updatedAt; }
|
|
141
|
+
get externalId() { var _a; return (_a = this._record) === null || _a === void 0 ? void 0 : _a.externalId; }
|
|
142
|
+
get externalAppId() { var _a; return (_a = this._record) === null || _a === void 0 ? void 0 : _a.externalAppId; }
|
|
143
|
+
get groups() { var _a; return ((_a = this._record) === null || _a === void 0 ? void 0 : _a.groups) || []; }
|
|
144
|
+
/** Access the underlying OdinRecord (null for new records) */
|
|
145
|
+
get record() { return this._record; }
|
|
146
|
+
// ============================================
|
|
147
|
+
// TYPE GUARDS (with TypeScript type predicates)
|
|
148
|
+
// ============================================
|
|
149
|
+
/**
|
|
150
|
+
* Type guard: check if this record is of type INBOUND_CALL_STATUS_UPDATE_EVENT
|
|
151
|
+
*
|
|
152
|
+
* When this returns true, TypeScript automatically narrows the type,
|
|
153
|
+
* giving you access to INBOUND_CALL_STATUS_UPDATE_EVENT-specific properties.
|
|
154
|
+
*
|
|
155
|
+
* @example
|
|
156
|
+
* ```typescript
|
|
157
|
+
* if (record.isInboundCallStatusUpdateEvent()) {
|
|
158
|
+
* // TypeScript knows record.properties is InboundCallStatusUpdateEventTwilioCallEventsProperties
|
|
159
|
+
* console.log(record.properties.SomeTypeSpecificField);
|
|
160
|
+
* }
|
|
161
|
+
* ```
|
|
162
|
+
* @remarks Callback containing incoming call status updates for agent
|
|
163
|
+
*/
|
|
164
|
+
isInboundCallStatusUpdateEvent() { var _a; return ((_a = this._record) === null || _a === void 0 ? void 0 : _a.type) === 'INBOUND_CALL_STATUS_UPDATE_EVENT'; }
|
|
165
|
+
/**
|
|
166
|
+
* Type guard: check if this record is of type NUMBER_CALL_STATUS_EVENT
|
|
167
|
+
*
|
|
168
|
+
* When this returns true, TypeScript automatically narrows the type,
|
|
169
|
+
* giving you access to NUMBER_CALL_STATUS_EVENT-specific properties.
|
|
170
|
+
*
|
|
171
|
+
* @example
|
|
172
|
+
* ```typescript
|
|
173
|
+
* if (record.isNumberCallStatusEvent()) {
|
|
174
|
+
* // TypeScript knows record.properties is NumberCallStatusEventTwilioCallEventsProperties
|
|
175
|
+
* console.log(record.properties.SomeTypeSpecificField);
|
|
176
|
+
* }
|
|
177
|
+
* ```
|
|
178
|
+
* @remarks Callback containing incoming call wrap up for customer
|
|
179
|
+
*/
|
|
180
|
+
isNumberCallStatusEvent() { var _a; return ((_a = this._record) === null || _a === void 0 ? void 0 : _a.type) === 'NUMBER_CALL_STATUS_EVENT'; }
|
|
181
|
+
/**
|
|
182
|
+
* Type guard: check if this record is of type OUTBOUND_CALL_STATUS_UPDATE_EVENT
|
|
183
|
+
*
|
|
184
|
+
* When this returns true, TypeScript automatically narrows the type,
|
|
185
|
+
* giving you access to OUTBOUND_CALL_STATUS_UPDATE_EVENT-specific properties.
|
|
186
|
+
*
|
|
187
|
+
* @example
|
|
188
|
+
* ```typescript
|
|
189
|
+
* if (record.isOutboundCallStatusUpdateEvent()) {
|
|
190
|
+
* // TypeScript knows record.properties is OutboundCallStatusUpdateEventTwilioCallEventsProperties
|
|
191
|
+
* console.log(record.properties.SomeTypeSpecificField);
|
|
192
|
+
* }
|
|
193
|
+
* ```
|
|
194
|
+
* @remarks Callback containing outbound call status updates for customer
|
|
195
|
+
*/
|
|
196
|
+
isOutboundCallStatusUpdateEvent() { var _a; return ((_a = this._record) === null || _a === void 0 ? void 0 : _a.type) === 'OUTBOUND_CALL_STATUS_UPDATE_EVENT'; }
|
|
197
|
+
/**
|
|
198
|
+
* Type guard: check if this record is of type OUTBOUND_DIAL_ACTION_EVENT
|
|
199
|
+
*
|
|
200
|
+
* When this returns true, TypeScript automatically narrows the type,
|
|
201
|
+
* giving you access to OUTBOUND_DIAL_ACTION_EVENT-specific properties.
|
|
202
|
+
*
|
|
203
|
+
* @example
|
|
204
|
+
* ```typescript
|
|
205
|
+
* if (record.isOutboundDialActionEvent()) {
|
|
206
|
+
* // TypeScript knows record.properties is OutboundDialActionEventTwilioCallEventsProperties
|
|
207
|
+
* console.log(record.properties.SomeTypeSpecificField);
|
|
208
|
+
* }
|
|
209
|
+
* ```
|
|
210
|
+
* @remarks Callback containing outbound call wrap up for agent
|
|
211
|
+
*/
|
|
212
|
+
isOutboundDialActionEvent() { var _a; return ((_a = this._record) === null || _a === void 0 ? void 0 : _a.type) === 'OUTBOUND_DIAL_ACTION_EVENT'; }
|
|
213
|
+
/**
|
|
214
|
+
* Access linked Call records
|
|
215
|
+
* @remarks Available labels: Call__TwilioCallEvents
|
|
216
|
+
* @throws Error if called on a new (unsaved) record
|
|
217
|
+
*
|
|
218
|
+
* @example
|
|
219
|
+
* ```typescript
|
|
220
|
+
* // Get all linked Call records
|
|
221
|
+
* const items = await record.calls.list();
|
|
222
|
+
* const first = await record.calls.first();
|
|
223
|
+
*
|
|
224
|
+
* // Filter by label
|
|
225
|
+
* const specific = await record.calls.first({ label: 'Call__TwilioCallEvents' });
|
|
226
|
+
* ```
|
|
227
|
+
*/
|
|
228
|
+
get calls() {
|
|
229
|
+
var _a;
|
|
230
|
+
if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
|
|
231
|
+
throw new Error('Cannot access links on a new (unsaved) record');
|
|
232
|
+
if (!this._calls) {
|
|
233
|
+
this._calls = new record_link_manager_1.RecordLinkManager(this._provider, this._record, {
|
|
234
|
+
sourceEntity: 'NotificationModule:TwilioCallEvents',
|
|
235
|
+
targetEntity: 'NotificationModule:Call',
|
|
236
|
+
targetModuleName: 'NotificationModule',
|
|
237
|
+
targetEntityName: 'Call',
|
|
238
|
+
labels: ['Call__TwilioCallEvents'],
|
|
239
|
+
}, CallRecord_1.CallRecord);
|
|
240
|
+
}
|
|
241
|
+
return this._calls;
|
|
242
|
+
}
|
|
243
|
+
// ============================================
|
|
244
|
+
// LINK MANAGEMENT
|
|
245
|
+
// ============================================
|
|
246
|
+
/**
|
|
247
|
+
* Queue a link to be created with the next action.
|
|
248
|
+
* Works for both create and update actions.
|
|
249
|
+
* @returns this (for chaining)
|
|
250
|
+
*/
|
|
251
|
+
link(target) {
|
|
252
|
+
this._pendingLinks.push(new core_1.OdinRecordLinkDto({ id: target.id, entity: target.entity }));
|
|
253
|
+
return this;
|
|
254
|
+
}
|
|
255
|
+
/** Get the currently queued links */
|
|
256
|
+
get pendingLinks() {
|
|
257
|
+
return [...this._pendingLinks];
|
|
258
|
+
}
|
|
259
|
+
/** Clear pending links without executing an action */
|
|
260
|
+
clearPendingLinks() {
|
|
261
|
+
this._pendingLinks = [];
|
|
262
|
+
return this;
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Immediately unlink a record (API call).
|
|
266
|
+
* Unlike link(), this executes immediately.
|
|
267
|
+
* @throws Error if called on a new (unsaved) record
|
|
268
|
+
*/
|
|
269
|
+
unlink(target) {
|
|
270
|
+
var _a;
|
|
271
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
272
|
+
if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
|
|
273
|
+
throw new Error('Cannot unlink from a new (unsaved) record');
|
|
274
|
+
const targetId = typeof target === 'string' ? target : target.id;
|
|
275
|
+
yield this._provider._deleteLinks('NotificationModule', 'TwilioCallEvents', this._record.id, targetId);
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
// ============================================
|
|
279
|
+
// CREATE ACTIONS (no existing record required)
|
|
280
|
+
// ============================================
|
|
281
|
+
/**
|
|
282
|
+
* CreateInboundCallStatusUpdateEvent
|
|
283
|
+
*
|
|
284
|
+
* Creates a new TwilioCallEvents record with the specified properties.
|
|
285
|
+
* Returns an ActionBuilder - call .execute() to create or .dryRun() for debugging.
|
|
286
|
+
*
|
|
287
|
+
* @remarks Record type: INBOUND_CALL_STATUS_UPDATE_EVENT
|
|
288
|
+
*
|
|
289
|
+
* @param properties - The properties for the new record
|
|
290
|
+
* @param options - Optional settings
|
|
291
|
+
* @param options.journeyId - Associate with a journey
|
|
292
|
+
* @param options.stageKey - Set initial pipeline stage
|
|
293
|
+
* @returns ActionBuilder - call .execute() to create or .dryRun() for payload
|
|
294
|
+
*
|
|
295
|
+
* @example
|
|
296
|
+
* ```typescript
|
|
297
|
+
* // Create with properties
|
|
298
|
+
* const record = odinClient.twilioCallEventss.new();
|
|
299
|
+
* await record.createInboundCallStatusUpdateEvent({ ... }).execute();
|
|
300
|
+
*
|
|
301
|
+
* // Dry run (for debugging)
|
|
302
|
+
* const payload = record.createInboundCallStatusUpdateEvent({ ... }).dryRun();
|
|
303
|
+
* ```
|
|
304
|
+
*/
|
|
305
|
+
createInboundCallStatusUpdateEvent(properties, options) {
|
|
306
|
+
const payload = {
|
|
307
|
+
entity: 'NotificationModule:TwilioCallEvents',
|
|
308
|
+
type: 'INBOUND_CALL_STATUS_UPDATE_EVENT',
|
|
309
|
+
actionName: 'CreateInboundCallStatusUpdateEvent',
|
|
310
|
+
properties: properties || {},
|
|
311
|
+
associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined,
|
|
312
|
+
journeyId: options === null || options === void 0 ? void 0 : options.journeyId,
|
|
313
|
+
stageKey: options === null || options === void 0 ? void 0 : options.stageKey,
|
|
314
|
+
};
|
|
315
|
+
return new ActionBuilder(this._provider, 'NotificationModule', 'TwilioCallEvents', payload, () => { this._pendingLinks = []; });
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* CreateNumberCallStatusEvent
|
|
319
|
+
*
|
|
320
|
+
* Creates a new TwilioCallEvents record with the specified properties.
|
|
321
|
+
* Returns an ActionBuilder - call .execute() to create or .dryRun() for debugging.
|
|
322
|
+
*
|
|
323
|
+
* @remarks Record type: NUMBER_CALL_STATUS_EVENT
|
|
324
|
+
*
|
|
325
|
+
* @param properties - The properties for the new record
|
|
326
|
+
* @param options - Optional settings
|
|
327
|
+
* @param options.journeyId - Associate with a journey
|
|
328
|
+
* @param options.stageKey - Set initial pipeline stage
|
|
329
|
+
* @returns ActionBuilder - call .execute() to create or .dryRun() for payload
|
|
330
|
+
*
|
|
331
|
+
* @example
|
|
332
|
+
* ```typescript
|
|
333
|
+
* // Create with properties
|
|
334
|
+
* const record = odinClient.twilioCallEventss.new();
|
|
335
|
+
* await record.createNumberCallStatusEvent({ ... }).execute();
|
|
336
|
+
*
|
|
337
|
+
* // Dry run (for debugging)
|
|
338
|
+
* const payload = record.createNumberCallStatusEvent({ ... }).dryRun();
|
|
339
|
+
* ```
|
|
340
|
+
*/
|
|
341
|
+
createNumberCallStatusEvent(properties, options) {
|
|
342
|
+
const payload = {
|
|
343
|
+
entity: 'NotificationModule:TwilioCallEvents',
|
|
344
|
+
type: 'NUMBER_CALL_STATUS_EVENT',
|
|
345
|
+
actionName: 'CreateNumberCallStatusEvent',
|
|
346
|
+
properties: properties || {},
|
|
347
|
+
associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined,
|
|
348
|
+
journeyId: options === null || options === void 0 ? void 0 : options.journeyId,
|
|
349
|
+
stageKey: options === null || options === void 0 ? void 0 : options.stageKey,
|
|
350
|
+
};
|
|
351
|
+
return new ActionBuilder(this._provider, 'NotificationModule', 'TwilioCallEvents', payload, () => { this._pendingLinks = []; });
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* CreateOutboundCallStatusUpdateEvent
|
|
355
|
+
*
|
|
356
|
+
* Creates a new TwilioCallEvents record with the specified properties.
|
|
357
|
+
* Returns an ActionBuilder - call .execute() to create or .dryRun() for debugging.
|
|
358
|
+
*
|
|
359
|
+
* @remarks Record type: OUTBOUND_CALL_STATUS_UPDATE_EVENT
|
|
360
|
+
*
|
|
361
|
+
* @param properties - The properties for the new record
|
|
362
|
+
* @param options - Optional settings
|
|
363
|
+
* @param options.journeyId - Associate with a journey
|
|
364
|
+
* @param options.stageKey - Set initial pipeline stage
|
|
365
|
+
* @returns ActionBuilder - call .execute() to create or .dryRun() for payload
|
|
366
|
+
*
|
|
367
|
+
* @example
|
|
368
|
+
* ```typescript
|
|
369
|
+
* // Create with properties
|
|
370
|
+
* const record = odinClient.twilioCallEventss.new();
|
|
371
|
+
* await record.createOutboundCallStatusUpdateEvent({ ... }).execute();
|
|
372
|
+
*
|
|
373
|
+
* // Dry run (for debugging)
|
|
374
|
+
* const payload = record.createOutboundCallStatusUpdateEvent({ ... }).dryRun();
|
|
375
|
+
* ```
|
|
376
|
+
*/
|
|
377
|
+
createOutboundCallStatusUpdateEvent(properties, options) {
|
|
378
|
+
const payload = {
|
|
379
|
+
entity: 'NotificationModule:TwilioCallEvents',
|
|
380
|
+
type: 'OUTBOUND_CALL_STATUS_UPDATE_EVENT',
|
|
381
|
+
actionName: 'CreateOutboundCallStatusUpdateEvent',
|
|
382
|
+
properties: properties || {},
|
|
383
|
+
associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined,
|
|
384
|
+
journeyId: options === null || options === void 0 ? void 0 : options.journeyId,
|
|
385
|
+
stageKey: options === null || options === void 0 ? void 0 : options.stageKey,
|
|
386
|
+
};
|
|
387
|
+
return new ActionBuilder(this._provider, 'NotificationModule', 'TwilioCallEvents', payload, () => { this._pendingLinks = []; });
|
|
388
|
+
}
|
|
389
|
+
/**
|
|
390
|
+
* CreateOutboundDialActionEvent
|
|
391
|
+
*
|
|
392
|
+
* Creates a new TwilioCallEvents record with the specified properties.
|
|
393
|
+
* Returns an ActionBuilder - call .execute() to create or .dryRun() for debugging.
|
|
394
|
+
*
|
|
395
|
+
* @remarks Record type: OUTBOUND_DIAL_ACTION_EVENT
|
|
396
|
+
*
|
|
397
|
+
* @param properties - The properties for the new record
|
|
398
|
+
* @param options - Optional settings
|
|
399
|
+
* @param options.journeyId - Associate with a journey
|
|
400
|
+
* @param options.stageKey - Set initial pipeline stage
|
|
401
|
+
* @returns ActionBuilder - call .execute() to create or .dryRun() for payload
|
|
402
|
+
*
|
|
403
|
+
* @example
|
|
404
|
+
* ```typescript
|
|
405
|
+
* // Create with properties
|
|
406
|
+
* const record = odinClient.twilioCallEventss.new();
|
|
407
|
+
* await record.createOutboundDialActionEvent({ ... }).execute();
|
|
408
|
+
*
|
|
409
|
+
* // Dry run (for debugging)
|
|
410
|
+
* const payload = record.createOutboundDialActionEvent({ ... }).dryRun();
|
|
411
|
+
* ```
|
|
412
|
+
*/
|
|
413
|
+
createOutboundDialActionEvent(properties, options) {
|
|
414
|
+
const payload = {
|
|
415
|
+
entity: 'NotificationModule:TwilioCallEvents',
|
|
416
|
+
type: 'OUTBOUND_DIAL_ACTION_EVENT',
|
|
417
|
+
actionName: 'CreateOutboundDialActionEvent',
|
|
418
|
+
properties: properties || {},
|
|
419
|
+
associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined,
|
|
420
|
+
journeyId: options === null || options === void 0 ? void 0 : options.journeyId,
|
|
421
|
+
stageKey: options === null || options === void 0 ? void 0 : options.stageKey,
|
|
422
|
+
};
|
|
423
|
+
return new ActionBuilder(this._provider, 'NotificationModule', 'TwilioCallEvents', payload, () => { this._pendingLinks = []; });
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
exports.TwilioCallEventsRecord = TwilioCallEventsRecord;
|
|
427
|
+
// ============================================
|
|
428
|
+
// TYPED LINK ACCESSORS
|
|
429
|
+
// ============================================
|
|
430
|
+
/** Valid labels for Call associations */
|
|
431
|
+
TwilioCallEventsRecord.callsLabels = ['Call__TwilioCallEvents'];
|
|
432
|
+
/** Type guard to check if an object is a TwilioCallEventsRecord */
|
|
433
|
+
function isTwilioCallEventsRecord(obj) {
|
|
434
|
+
return obj instanceof TwilioCallEventsRecord;
|
|
435
|
+
}
|
|
436
|
+
exports.isTwilioCallEventsRecord = isTwilioCallEventsRecord;
|
|
@@ -61,6 +61,7 @@ export { FieldServiceProductRecord, isFieldServiceProductRecord } from './FieldS
|
|
|
61
61
|
export { FileRecord, isFileRecord } from './FileRecord';
|
|
62
62
|
export { ActivityRecord, isActivityRecord } from './ActivityRecord';
|
|
63
63
|
export { ImpersonationTrackerRecord, isImpersonationTrackerRecord } from './ImpersonationTrackerRecord';
|
|
64
|
+
export { TwilioCallEventsRecord, isTwilioCallEventsRecord } from './TwilioCallEventsRecord';
|
|
64
65
|
export { InvoiceItemRecord, isInvoiceItemRecord } from './InvoiceItemRecord';
|
|
65
66
|
export { LeadRecord, isLeadRecord } from './LeadRecord';
|
|
66
67
|
export { MessageRecord, isMessageRecord } from './MessageRecord';
|
package/dist/records-v2/index.js
CHANGED
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
exports.isYfFieldServiceVisitRecord = exports.YfFieldServiceVisitRecord = exports.isRemediationOutcomeFormRecord = exports.RemediationOutcomeFormRecord = exports.isOhExternalAuditRecord = exports.OhExternalAuditRecord = exports.isUgExternalAuditRecord = exports.UgExternalAuditRecord = exports.isPaymentMethodRefundRecord = exports.PaymentMethodRefundRecord = exports.isConversationRecord = exports.ConversationRecord = exports.isOntReplacementApprovalRecord = exports.OntReplacementApprovalRecord = exports.isAccountRecord = exports.AccountRecord = exports.isPermissionToFailRecord = exports.PermissionToFailRecord = exports.isTransactionRecord = exports.TransactionRecord = exports.isPaymentRecord = exports.PaymentRecord = exports.isPICRequestRecord = exports.PICRequestRecord = exports.isChangeReasonRecord = exports.ChangeReasonRecord = exports.isChurnRequestRecord = exports.ChurnRequestRecord = exports.isBillingRequestRecord = exports.BillingRequestRecord = exports.isBillingAdjustmentRecord = exports.BillingAdjustmentRecord = exports.isServiceAppointmentConfigRecord = exports.ServiceAppointmentConfigRecord = exports.isCrmDatasetRecord = exports.CrmDatasetRecord = exports.isNoteRecord = exports.NoteRecord = exports.isContractBuyOutRecord = exports.ContractBuyOutRecord = exports.isCaseRecord = exports.CaseRecord = exports.isAddressInteractionRecord = exports.AddressInteractionRecord = exports.isAddressRecord = exports.AddressRecord = exports.isWorkOrderRecord = exports.WorkOrderRecord = exports.isOrderRecord = exports.OrderRecord = void 0;
|
|
15
15
|
exports.isFileRecord = exports.FileRecord = exports.isFieldServiceProductRecord = exports.FieldServiceProductRecord = exports.isFieldServiceDispatchedProductRecord = exports.FieldServiceDispatchedProductRecord = exports.isExchangeRecord = exports.ExchangeRecord = exports.isEmailTemplateRecord = exports.EmailTemplateRecord = exports.isEmailSenderRecord = exports.EmailSenderRecord = exports.isCustomerDeviceOntRecord = exports.CustomerDeviceOntRecord = exports.isCustomerDeviceConfigurationRecord = exports.CustomerDeviceConfigurationRecord = exports.isContactIdentityRecord = exports.ContactIdentityRecord = exports.isConfigRecord = exports.ConfigRecord = exports.isEmailRecord = exports.EmailRecord = exports.isRewardRecord = exports.RewardRecord = exports.isContactRecord = exports.ContactRecord = exports.isCallTransferRecord = exports.CallTransferRecord = exports.isCallEventRecord = exports.CallEventRecord = exports.isCallRecord = exports.CallRecord = exports.isProductRecord = exports.ProductRecord = exports.isBrskEntityMigrationErrorRecord = exports.BrskEntityMigrationErrorRecord = exports.isBngProvisionRecord = exports.BngProvisionRecord = exports.isPgFileAllocationRecord = exports.PgFileAllocationRecord = exports.isAppointmentRecord = exports.AppointmentRecord = exports.isCallLegRecord = exports.CallLegRecord = exports.isAffiliateCodeRecord = exports.AffiliateCodeRecord = exports.isActivityLogRecord = exports.ActivityLogRecord = exports.isAccountCreditRecord = exports.AccountCreditRecord = void 0;
|
|
16
|
-
exports.
|
|
17
|
-
exports.
|
|
18
|
-
exports.isCustomerPhonePortingRecord = exports.CustomerPhonePortingRecord = exports.isVisitRecord = exports.VisitRecord = exports.isServiceRecord = exports.ServiceRecord = exports.isScheduleSlotRecord = exports.ScheduleSlotRecord = exports.isPriceBookRecord = exports.PriceBookRecord = void 0;
|
|
16
|
+
exports.isPgAccountValidationRecord = exports.PgAccountValidationRecord = exports.isPgTransactionRecord = exports.PgTransactionRecord = exports.isPgSortCodeSubstitutionRecord = exports.PgSortCodeSubstitutionRecord = exports.isPgVocalinkRecord = exports.PgVocalinkRecord = exports.isPgDirectDebitFileRecord = exports.PgDirectDebitFileRecord = exports.isPgPaymentMethodRecord = exports.PgPaymentMethodRecord = exports.isPgLogRecord = exports.PgLogRecord = exports.isPgDisputeRecord = exports.PgDisputeRecord = exports.isPgContactRecord = exports.PgContactRecord = exports.isPaymentMethodRecord = exports.PaymentMethodRecord = exports.isSmsMessageRecord = exports.SmsMessageRecord = exports.isReferralRecord = exports.ReferralRecord = exports.isOrderKciRecord = exports.OrderKciRecord = exports.isOrderCheckRecord = exports.OrderCheckRecord = exports.isCampaignRecord = exports.CampaignRecord = exports.isOneTouchSwitchRecord = exports.OneTouchSwitchRecord = exports.isOfferTemplateRecord = exports.OfferTemplateRecord = exports.isReturnsRecord = exports.ReturnsRecord = exports.isNetworkDeviceRecord = exports.NetworkDeviceRecord = exports.isMessageRecord = exports.MessageRecord = exports.isLeadRecord = exports.LeadRecord = exports.isInvoiceItemRecord = exports.InvoiceItemRecord = exports.isTwilioCallEventsRecord = exports.TwilioCallEventsRecord = exports.isImpersonationTrackerRecord = exports.ImpersonationTrackerRecord = exports.isActivityRecord = exports.ActivityRecord = void 0;
|
|
17
|
+
exports.isOfferRecord = exports.OfferRecord = exports.isServiceAppointmentRecord = exports.ServiceAppointmentRecord = exports.isOutageRecord = exports.OutageRecord = exports.isSiteSpecificRiskAssessmentOutcomeFormRecord = exports.SiteSpecificRiskAssessmentOutcomeFormRecord = exports.isRemediationRequiredReasonRecord = exports.RemediationRequiredReasonRecord = exports.isKnowledgeArticleRecord = exports.KnowledgeArticleRecord = exports.isInvoiceRecord = exports.InvoiceRecord = exports.isDiscountRecord = exports.DiscountRecord = exports.isCustomerDeviceRouterRecord = exports.CustomerDeviceRouterRecord = exports.isCustomerDeviceAtaRecord = exports.CustomerDeviceAtaRecord = exports.isCreditNoteRecord = exports.CreditNoteRecord = exports.isWorkOrderStatusUpdateRecord = exports.WorkOrderStatusUpdateRecord = exports.isWayleaveAuditRecord = exports.WayleaveAuditRecord = exports.isUserRecord = exports.UserRecord = exports.isTwilioUserUpdateRecord = exports.TwilioUserUpdateRecord = exports.isTwilioTaskQueueRecord = exports.TwilioTaskQueueRecord = exports.isTimeSlotRecord = exports.TimeSlotRecord = exports.isTeamRecord = exports.TeamRecord = exports.isSalesTerritoryRecord = exports.SalesTerritoryRecord = exports.isRegionRecord = exports.RegionRecord = exports.isVoiceConfigurationRecord = exports.VoiceConfigurationRecord = exports.isOrderItemRecord = exports.OrderItemRecord = exports.isPushNotificationRecord = exports.PushNotificationRecord = exports.isPgWebhookRecord = exports.PgWebhookRecord = exports.isPgWebhookAttemptRecord = exports.PgWebhookAttemptRecord = void 0;
|
|
18
|
+
exports.isCustomerPhonePortingRecord = exports.CustomerPhonePortingRecord = exports.isVisitRecord = exports.VisitRecord = exports.isServiceRecord = exports.ServiceRecord = exports.isScheduleSlotRecord = exports.ScheduleSlotRecord = exports.isPriceBookRecord = exports.PriceBookRecord = exports.isOverlayRealA55Record = exports.OverlayRealA55Record = void 0;
|
|
19
19
|
var OrderRecord_1 = require("./OrderRecord");
|
|
20
20
|
Object.defineProperty(exports, "OrderRecord", { enumerable: true, get: function () { return OrderRecord_1.OrderRecord; } });
|
|
21
21
|
Object.defineProperty(exports, "isOrderRecord", { enumerable: true, get: function () { return OrderRecord_1.isOrderRecord; } });
|
|
@@ -172,6 +172,9 @@ Object.defineProperty(exports, "isActivityRecord", { enumerable: true, get: func
|
|
|
172
172
|
var ImpersonationTrackerRecord_1 = require("./ImpersonationTrackerRecord");
|
|
173
173
|
Object.defineProperty(exports, "ImpersonationTrackerRecord", { enumerable: true, get: function () { return ImpersonationTrackerRecord_1.ImpersonationTrackerRecord; } });
|
|
174
174
|
Object.defineProperty(exports, "isImpersonationTrackerRecord", { enumerable: true, get: function () { return ImpersonationTrackerRecord_1.isImpersonationTrackerRecord; } });
|
|
175
|
+
var TwilioCallEventsRecord_1 = require("./TwilioCallEventsRecord");
|
|
176
|
+
Object.defineProperty(exports, "TwilioCallEventsRecord", { enumerable: true, get: function () { return TwilioCallEventsRecord_1.TwilioCallEventsRecord; } });
|
|
177
|
+
Object.defineProperty(exports, "isTwilioCallEventsRecord", { enumerable: true, get: function () { return TwilioCallEventsRecord_1.isTwilioCallEventsRecord; } });
|
|
175
178
|
var InvoiceItemRecord_1 = require("./InvoiceItemRecord");
|
|
176
179
|
Object.defineProperty(exports, "InvoiceItemRecord", { enumerable: true, get: function () { return InvoiceItemRecord_1.InvoiceItemRecord; } });
|
|
177
180
|
Object.defineProperty(exports, "isInvoiceItemRecord", { enumerable: true, get: function () { return InvoiceItemRecord_1.isInvoiceItemRecord; } });
|