@d19n/youfibre-odin-sdk 2.0.114 → 2.0.115
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/dist/actions-v2/CreateInboundCallDto.d.ts +103 -1
- package/dist/actions-v2/CreateInboundCallDto.js +120 -1
- package/dist/actions-v2/CreateOutboundCallDto.d.ts +103 -1
- package/dist/actions-v2/CreateOutboundCallDto.js +120 -1
- package/dist/records-v2/CallRecord.d.ts +16 -20
- package/dist/records-v2/CallRecord.js +16 -38
- package/package.json +1 -1
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*
|
|
11
11
|
* AUTO-GENERATED - DO NOT EDIT DIRECTLY
|
|
12
12
|
*/
|
|
13
|
-
import { OdinRecordCreateDto, OdinRecordCreatedEvent } from '@d19n/odin-types/dist/core';
|
|
13
|
+
import { OdinRecord, OdinRecordCreateDto, OdinRecordCreatedEvent, OdinRecordLinkDto } from '@d19n/odin-types/dist/core';
|
|
14
14
|
/**
|
|
15
15
|
* RabbitMQ message payload for CreateInboundCall created events
|
|
16
16
|
*
|
|
@@ -106,6 +106,99 @@ export interface CreateInboundCallProperties {
|
|
|
106
106
|
*/
|
|
107
107
|
Title: string;
|
|
108
108
|
}
|
|
109
|
+
/**
|
|
110
|
+
* Builder for CreateInboundCall action
|
|
111
|
+
*
|
|
112
|
+
* Provides fluent API for adding associations before executing the action.
|
|
113
|
+
* Use .link*() methods to add associations, then call .execute() to run.
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* ```typescript
|
|
117
|
+
* await record.createInboundCall({ ...properties })
|
|
118
|
+
* .linkAssociation_1778588888174({ id: '...', entity: '...' })
|
|
119
|
+
* .execute();
|
|
120
|
+
* ```
|
|
121
|
+
*/
|
|
122
|
+
export declare class CreateInboundCallBuilder {
|
|
123
|
+
private _associations;
|
|
124
|
+
private _properties;
|
|
125
|
+
private _pendingLinks;
|
|
126
|
+
private _options?;
|
|
127
|
+
private _provider?;
|
|
128
|
+
private _moduleName?;
|
|
129
|
+
private _entityName?;
|
|
130
|
+
private _clearPendingLinks?;
|
|
131
|
+
private _externalId?;
|
|
132
|
+
private _externalAppId?;
|
|
133
|
+
private _groups?;
|
|
134
|
+
constructor(properties: CreateInboundCallProperties, pendingLinks: OdinRecordLinkDto[], options?: {
|
|
135
|
+
journeyId?: string;
|
|
136
|
+
stageKey?: string;
|
|
137
|
+
});
|
|
138
|
+
/**
|
|
139
|
+
* Link Call__Contact
|
|
140
|
+
* @schemaAssociationId 1a76c9bb-4359-435c-b61e-7bdfdcda7e13
|
|
141
|
+
* @param target - The record to link
|
|
142
|
+
* @returns this (for method chaining)
|
|
143
|
+
*/
|
|
144
|
+
linkAssociation_1778588888174(target: OdinRecord<any> | {
|
|
145
|
+
id: string;
|
|
146
|
+
entity: string;
|
|
147
|
+
}): this;
|
|
148
|
+
/**
|
|
149
|
+
* Set an external system identifier for this record.
|
|
150
|
+
* Links the record to a corresponding entry in an external application.
|
|
151
|
+
* @param externalId - The ID in the external system
|
|
152
|
+
* @param externalAppId - The external application identifier
|
|
153
|
+
* @returns this (for chaining)
|
|
154
|
+
*/
|
|
155
|
+
withExternalId(externalId: string, externalAppId: string): this;
|
|
156
|
+
/**
|
|
157
|
+
* Set security/access groups for this record.
|
|
158
|
+
* @param groups - Array of group names
|
|
159
|
+
* @returns this (for chaining)
|
|
160
|
+
*/
|
|
161
|
+
withGroups(groups: string[]): this;
|
|
162
|
+
/**
|
|
163
|
+
* Get the action payload without executing
|
|
164
|
+
* @returns The action data that would be sent
|
|
165
|
+
*/
|
|
166
|
+
getData(): {
|
|
167
|
+
entity: string;
|
|
168
|
+
type: string | undefined;
|
|
169
|
+
actionName: string;
|
|
170
|
+
properties: CreateInboundCallProperties;
|
|
171
|
+
associations?: OdinRecordLinkDto[];
|
|
172
|
+
journeyId?: string;
|
|
173
|
+
stageKey?: string;
|
|
174
|
+
externalId?: string;
|
|
175
|
+
externalAppId?: string;
|
|
176
|
+
groups?: string[];
|
|
177
|
+
};
|
|
178
|
+
/**
|
|
179
|
+
* Inject execution context (called by record wrapper)
|
|
180
|
+
* @internal
|
|
181
|
+
*/
|
|
182
|
+
withProvider(provider: {
|
|
183
|
+
_applyAction(moduleName: string, entityName: string, payload: any): Promise<any>;
|
|
184
|
+
}, moduleName: string, entityName: string, clearPendingLinks: () => void): this;
|
|
185
|
+
/**
|
|
186
|
+
* Execute the action
|
|
187
|
+
* @returns The result from the API
|
|
188
|
+
* @throws Error if withProvider() has not been called
|
|
189
|
+
*/
|
|
190
|
+
execute(): Promise<any>;
|
|
191
|
+
/**
|
|
192
|
+
* Returns the request payload without executing (for debugging)
|
|
193
|
+
* @returns The request payload that would be sent to the API
|
|
194
|
+
*/
|
|
195
|
+
dryRun(): Record<string, any>;
|
|
196
|
+
/**
|
|
197
|
+
* Prevents accidental `await builder` without .execute()
|
|
198
|
+
* @throws Error always - use .execute() or .dryRun() instead
|
|
199
|
+
*/
|
|
200
|
+
then(): never;
|
|
201
|
+
}
|
|
109
202
|
/**
|
|
110
203
|
* CreateInboundCall
|
|
111
204
|
*
|
|
@@ -131,6 +224,15 @@ export declare class CreateInboundCallDto extends OdinRecordCreateDto<CreateInbo
|
|
|
131
224
|
static readonly STEP_SCHEMA_ID = "e157f15c-6846-4bfb-bc92-aed4c4084e9f";
|
|
132
225
|
static readonly STEP_SCHEMA_ACTION_ID = "299d1984-3e76-45ce-90ec-088398480578";
|
|
133
226
|
static readonly AUTO_LINK_PARENT = true;
|
|
227
|
+
static readonly HAS_ASSOCIATIONS = true;
|
|
228
|
+
static readonly HAS_REQUIRED_ASSOCIATIONS = false;
|
|
229
|
+
static readonly BUILDER_CLASS = "CreateInboundCallBuilder";
|
|
230
|
+
static readonly ASSOCIATION_FIELDS: readonly [{
|
|
231
|
+
readonly name: "Association_1778588888174";
|
|
232
|
+
readonly methodName: "linkAssociation_1778588888174";
|
|
233
|
+
readonly required: false;
|
|
234
|
+
readonly schemaAssociationId: "1a76c9bb-4359-435c-b61e-7bdfdcda7e13";
|
|
235
|
+
}];
|
|
134
236
|
readonly actionName: string;
|
|
135
237
|
readonly schemaActionId: string;
|
|
136
238
|
readonly entity: string;
|
|
@@ -11,9 +11,124 @@
|
|
|
11
11
|
*
|
|
12
12
|
* AUTO-GENERATED - DO NOT EDIT DIRECTLY
|
|
13
13
|
*/
|
|
14
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
16
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
18
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
19
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
20
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21
|
+
});
|
|
22
|
+
};
|
|
14
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.CreateInboundCallDto = void 0;
|
|
24
|
+
exports.CreateInboundCallDto = exports.CreateInboundCallBuilder = void 0;
|
|
16
25
|
const core_1 = require("@d19n/odin-types/dist/core");
|
|
26
|
+
/**
|
|
27
|
+
* Builder for CreateInboundCall action
|
|
28
|
+
*
|
|
29
|
+
* Provides fluent API for adding associations before executing the action.
|
|
30
|
+
* Use .link*() methods to add associations, then call .execute() to run.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```typescript
|
|
34
|
+
* await record.createInboundCall({ ...properties })
|
|
35
|
+
* .linkAssociation_1778588888174({ id: '...', entity: '...' })
|
|
36
|
+
* .execute();
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
class CreateInboundCallBuilder {
|
|
40
|
+
constructor(properties, pendingLinks, options) {
|
|
41
|
+
this._associations = [];
|
|
42
|
+
this._properties = properties;
|
|
43
|
+
this._pendingLinks = pendingLinks;
|
|
44
|
+
this._options = options;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Link Call__Contact
|
|
48
|
+
* @schemaAssociationId 1a76c9bb-4359-435c-b61e-7bdfdcda7e13
|
|
49
|
+
* @param target - The record to link
|
|
50
|
+
* @returns this (for method chaining)
|
|
51
|
+
*/
|
|
52
|
+
linkAssociation_1778588888174(target) {
|
|
53
|
+
this._associations.push(new core_1.OdinRecordLinkDto({
|
|
54
|
+
id: target.id,
|
|
55
|
+
entity: 'entity' in target ? target.entity : target.entity,
|
|
56
|
+
}));
|
|
57
|
+
return this;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Set an external system identifier for this record.
|
|
61
|
+
* Links the record to a corresponding entry in an external application.
|
|
62
|
+
* @param externalId - The ID in the external system
|
|
63
|
+
* @param externalAppId - The external application identifier
|
|
64
|
+
* @returns this (for chaining)
|
|
65
|
+
*/
|
|
66
|
+
withExternalId(externalId, externalAppId) {
|
|
67
|
+
this._externalId = externalId;
|
|
68
|
+
this._externalAppId = externalAppId;
|
|
69
|
+
return this;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Set security/access groups for this record.
|
|
73
|
+
* @param groups - Array of group names
|
|
74
|
+
* @returns this (for chaining)
|
|
75
|
+
*/
|
|
76
|
+
withGroups(groups) {
|
|
77
|
+
this._groups = groups;
|
|
78
|
+
return this;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Get the action payload without executing
|
|
82
|
+
* @returns The action data that would be sent
|
|
83
|
+
*/
|
|
84
|
+
getData() {
|
|
85
|
+
var _a, _b;
|
|
86
|
+
const allAssociations = [...this._associations, ...this._pendingLinks];
|
|
87
|
+
return Object.assign(Object.assign({ entity: 'NotificationModule:Call', type: undefined, actionName: 'CreateInboundCall', properties: this._properties, associations: allAssociations.length > 0 ? allAssociations : undefined, journeyId: (_a = this._options) === null || _a === void 0 ? void 0 : _a.journeyId, stageKey: (_b = this._options) === null || _b === void 0 ? void 0 : _b.stageKey }, (this._externalId && { externalId: this._externalId, externalAppId: this._externalAppId })), (this._groups && { groups: this._groups }));
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Inject execution context (called by record wrapper)
|
|
91
|
+
* @internal
|
|
92
|
+
*/
|
|
93
|
+
withProvider(provider, moduleName, entityName, clearPendingLinks) {
|
|
94
|
+
this._provider = provider;
|
|
95
|
+
this._moduleName = moduleName;
|
|
96
|
+
this._entityName = entityName;
|
|
97
|
+
this._clearPendingLinks = clearPendingLinks;
|
|
98
|
+
return this;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Execute the action
|
|
102
|
+
* @returns The result from the API
|
|
103
|
+
* @throws Error if withProvider() has not been called
|
|
104
|
+
*/
|
|
105
|
+
execute() {
|
|
106
|
+
var _a;
|
|
107
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
108
|
+
if (!this._provider || !this._moduleName || !this._entityName) {
|
|
109
|
+
throw new Error('Builder not connected to provider. Use the record wrapper API to get an executable builder.');
|
|
110
|
+
}
|
|
111
|
+
const result = yield this._provider._applyAction(this._moduleName, this._entityName, this.getData());
|
|
112
|
+
(_a = this._clearPendingLinks) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
113
|
+
return result;
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Returns the request payload without executing (for debugging)
|
|
118
|
+
* @returns The request payload that would be sent to the API
|
|
119
|
+
*/
|
|
120
|
+
dryRun() {
|
|
121
|
+
return this.getData();
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Prevents accidental `await builder` without .execute()
|
|
125
|
+
* @throws Error always - use .execute() or .dryRun() instead
|
|
126
|
+
*/
|
|
127
|
+
then() {
|
|
128
|
+
throw new Error('Builder cannot be awaited directly. Call .execute() to run the action or .dryRun() to get the payload.');
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
exports.CreateInboundCallBuilder = CreateInboundCallBuilder;
|
|
17
132
|
/**
|
|
18
133
|
* CreateInboundCall
|
|
19
134
|
*
|
|
@@ -52,3 +167,7 @@ CreateInboundCallDto.STEP_ENTITY = 'NotificationModule:Call';
|
|
|
52
167
|
CreateInboundCallDto.STEP_SCHEMA_ID = 'e157f15c-6846-4bfb-bc92-aed4c4084e9f';
|
|
53
168
|
CreateInboundCallDto.STEP_SCHEMA_ACTION_ID = '299d1984-3e76-45ce-90ec-088398480578';
|
|
54
169
|
CreateInboundCallDto.AUTO_LINK_PARENT = true;
|
|
170
|
+
CreateInboundCallDto.HAS_ASSOCIATIONS = true;
|
|
171
|
+
CreateInboundCallDto.HAS_REQUIRED_ASSOCIATIONS = false;
|
|
172
|
+
CreateInboundCallDto.BUILDER_CLASS = 'CreateInboundCallBuilder';
|
|
173
|
+
CreateInboundCallDto.ASSOCIATION_FIELDS = [{ "name": "Association_1778588888174", "methodName": "linkAssociation_1778588888174", "required": false, "schemaAssociationId": "1a76c9bb-4359-435c-b61e-7bdfdcda7e13" }];
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*
|
|
11
11
|
* AUTO-GENERATED - DO NOT EDIT DIRECTLY
|
|
12
12
|
*/
|
|
13
|
-
import { OdinRecordCreateDto, OdinRecordCreatedEvent } from '@d19n/odin-types/dist/core';
|
|
13
|
+
import { OdinRecord, OdinRecordCreateDto, OdinRecordCreatedEvent, OdinRecordLinkDto } from '@d19n/odin-types/dist/core';
|
|
14
14
|
/**
|
|
15
15
|
* RabbitMQ message payload for CreateOutboundCall created events
|
|
16
16
|
*
|
|
@@ -122,6 +122,99 @@ export interface CreateOutboundCallProperties {
|
|
|
122
122
|
*/
|
|
123
123
|
Title: string;
|
|
124
124
|
}
|
|
125
|
+
/**
|
|
126
|
+
* Builder for CreateOutboundCall action
|
|
127
|
+
*
|
|
128
|
+
* Provides fluent API for adding associations before executing the action.
|
|
129
|
+
* Use .link*() methods to add associations, then call .execute() to run.
|
|
130
|
+
*
|
|
131
|
+
* @example
|
|
132
|
+
* ```typescript
|
|
133
|
+
* await record.createOutboundCall({ ...properties })
|
|
134
|
+
* .linkAssociation_1778588918055({ id: '...', entity: '...' })
|
|
135
|
+
* .execute();
|
|
136
|
+
* ```
|
|
137
|
+
*/
|
|
138
|
+
export declare class CreateOutboundCallBuilder {
|
|
139
|
+
private _associations;
|
|
140
|
+
private _properties;
|
|
141
|
+
private _pendingLinks;
|
|
142
|
+
private _options?;
|
|
143
|
+
private _provider?;
|
|
144
|
+
private _moduleName?;
|
|
145
|
+
private _entityName?;
|
|
146
|
+
private _clearPendingLinks?;
|
|
147
|
+
private _externalId?;
|
|
148
|
+
private _externalAppId?;
|
|
149
|
+
private _groups?;
|
|
150
|
+
constructor(properties: CreateOutboundCallProperties, pendingLinks: OdinRecordLinkDto[], options?: {
|
|
151
|
+
journeyId?: string;
|
|
152
|
+
stageKey?: string;
|
|
153
|
+
});
|
|
154
|
+
/**
|
|
155
|
+
* Link Call__Contact
|
|
156
|
+
* @schemaAssociationId 1a76c9bb-4359-435c-b61e-7bdfdcda7e13
|
|
157
|
+
* @param target - The record to link
|
|
158
|
+
* @returns this (for method chaining)
|
|
159
|
+
*/
|
|
160
|
+
linkAssociation_1778588918055(target: OdinRecord<any> | {
|
|
161
|
+
id: string;
|
|
162
|
+
entity: string;
|
|
163
|
+
}): this;
|
|
164
|
+
/**
|
|
165
|
+
* Set an external system identifier for this record.
|
|
166
|
+
* Links the record to a corresponding entry in an external application.
|
|
167
|
+
* @param externalId - The ID in the external system
|
|
168
|
+
* @param externalAppId - The external application identifier
|
|
169
|
+
* @returns this (for chaining)
|
|
170
|
+
*/
|
|
171
|
+
withExternalId(externalId: string, externalAppId: string): this;
|
|
172
|
+
/**
|
|
173
|
+
* Set security/access groups for this record.
|
|
174
|
+
* @param groups - Array of group names
|
|
175
|
+
* @returns this (for chaining)
|
|
176
|
+
*/
|
|
177
|
+
withGroups(groups: string[]): this;
|
|
178
|
+
/**
|
|
179
|
+
* Get the action payload without executing
|
|
180
|
+
* @returns The action data that would be sent
|
|
181
|
+
*/
|
|
182
|
+
getData(): {
|
|
183
|
+
entity: string;
|
|
184
|
+
type: string | undefined;
|
|
185
|
+
actionName: string;
|
|
186
|
+
properties: CreateOutboundCallProperties;
|
|
187
|
+
associations?: OdinRecordLinkDto[];
|
|
188
|
+
journeyId?: string;
|
|
189
|
+
stageKey?: string;
|
|
190
|
+
externalId?: string;
|
|
191
|
+
externalAppId?: string;
|
|
192
|
+
groups?: string[];
|
|
193
|
+
};
|
|
194
|
+
/**
|
|
195
|
+
* Inject execution context (called by record wrapper)
|
|
196
|
+
* @internal
|
|
197
|
+
*/
|
|
198
|
+
withProvider(provider: {
|
|
199
|
+
_applyAction(moduleName: string, entityName: string, payload: any): Promise<any>;
|
|
200
|
+
}, moduleName: string, entityName: string, clearPendingLinks: () => void): this;
|
|
201
|
+
/**
|
|
202
|
+
* Execute the action
|
|
203
|
+
* @returns The result from the API
|
|
204
|
+
* @throws Error if withProvider() has not been called
|
|
205
|
+
*/
|
|
206
|
+
execute(): Promise<any>;
|
|
207
|
+
/**
|
|
208
|
+
* Returns the request payload without executing (for debugging)
|
|
209
|
+
* @returns The request payload that would be sent to the API
|
|
210
|
+
*/
|
|
211
|
+
dryRun(): Record<string, any>;
|
|
212
|
+
/**
|
|
213
|
+
* Prevents accidental `await builder` without .execute()
|
|
214
|
+
* @throws Error always - use .execute() or .dryRun() instead
|
|
215
|
+
*/
|
|
216
|
+
then(): never;
|
|
217
|
+
}
|
|
125
218
|
/**
|
|
126
219
|
* CreateOutboundCall
|
|
127
220
|
*
|
|
@@ -147,6 +240,15 @@ export declare class CreateOutboundCallDto extends OdinRecordCreateDto<CreateOut
|
|
|
147
240
|
static readonly STEP_SCHEMA_ID = "e157f15c-6846-4bfb-bc92-aed4c4084e9f";
|
|
148
241
|
static readonly STEP_SCHEMA_ACTION_ID = "c30cd248-c889-47e3-8e50-44d97bc571fd";
|
|
149
242
|
static readonly AUTO_LINK_PARENT = true;
|
|
243
|
+
static readonly HAS_ASSOCIATIONS = true;
|
|
244
|
+
static readonly HAS_REQUIRED_ASSOCIATIONS = false;
|
|
245
|
+
static readonly BUILDER_CLASS = "CreateOutboundCallBuilder";
|
|
246
|
+
static readonly ASSOCIATION_FIELDS: readonly [{
|
|
247
|
+
readonly name: "Association_1778588918055";
|
|
248
|
+
readonly methodName: "linkAssociation_1778588918055";
|
|
249
|
+
readonly required: false;
|
|
250
|
+
readonly schemaAssociationId: "1a76c9bb-4359-435c-b61e-7bdfdcda7e13";
|
|
251
|
+
}];
|
|
150
252
|
readonly actionName: string;
|
|
151
253
|
readonly schemaActionId: string;
|
|
152
254
|
readonly entity: string;
|
|
@@ -11,9 +11,124 @@
|
|
|
11
11
|
*
|
|
12
12
|
* AUTO-GENERATED - DO NOT EDIT DIRECTLY
|
|
13
13
|
*/
|
|
14
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
16
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
18
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
19
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
20
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21
|
+
});
|
|
22
|
+
};
|
|
14
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.CreateOutboundCallDto = void 0;
|
|
24
|
+
exports.CreateOutboundCallDto = exports.CreateOutboundCallBuilder = void 0;
|
|
16
25
|
const core_1 = require("@d19n/odin-types/dist/core");
|
|
26
|
+
/**
|
|
27
|
+
* Builder for CreateOutboundCall action
|
|
28
|
+
*
|
|
29
|
+
* Provides fluent API for adding associations before executing the action.
|
|
30
|
+
* Use .link*() methods to add associations, then call .execute() to run.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```typescript
|
|
34
|
+
* await record.createOutboundCall({ ...properties })
|
|
35
|
+
* .linkAssociation_1778588918055({ id: '...', entity: '...' })
|
|
36
|
+
* .execute();
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
class CreateOutboundCallBuilder {
|
|
40
|
+
constructor(properties, pendingLinks, options) {
|
|
41
|
+
this._associations = [];
|
|
42
|
+
this._properties = properties;
|
|
43
|
+
this._pendingLinks = pendingLinks;
|
|
44
|
+
this._options = options;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Link Call__Contact
|
|
48
|
+
* @schemaAssociationId 1a76c9bb-4359-435c-b61e-7bdfdcda7e13
|
|
49
|
+
* @param target - The record to link
|
|
50
|
+
* @returns this (for method chaining)
|
|
51
|
+
*/
|
|
52
|
+
linkAssociation_1778588918055(target) {
|
|
53
|
+
this._associations.push(new core_1.OdinRecordLinkDto({
|
|
54
|
+
id: target.id,
|
|
55
|
+
entity: 'entity' in target ? target.entity : target.entity,
|
|
56
|
+
}));
|
|
57
|
+
return this;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Set an external system identifier for this record.
|
|
61
|
+
* Links the record to a corresponding entry in an external application.
|
|
62
|
+
* @param externalId - The ID in the external system
|
|
63
|
+
* @param externalAppId - The external application identifier
|
|
64
|
+
* @returns this (for chaining)
|
|
65
|
+
*/
|
|
66
|
+
withExternalId(externalId, externalAppId) {
|
|
67
|
+
this._externalId = externalId;
|
|
68
|
+
this._externalAppId = externalAppId;
|
|
69
|
+
return this;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Set security/access groups for this record.
|
|
73
|
+
* @param groups - Array of group names
|
|
74
|
+
* @returns this (for chaining)
|
|
75
|
+
*/
|
|
76
|
+
withGroups(groups) {
|
|
77
|
+
this._groups = groups;
|
|
78
|
+
return this;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Get the action payload without executing
|
|
82
|
+
* @returns The action data that would be sent
|
|
83
|
+
*/
|
|
84
|
+
getData() {
|
|
85
|
+
var _a, _b;
|
|
86
|
+
const allAssociations = [...this._associations, ...this._pendingLinks];
|
|
87
|
+
return Object.assign(Object.assign({ entity: 'NotificationModule:Call', type: undefined, actionName: 'CreateOutboundCall', properties: this._properties, associations: allAssociations.length > 0 ? allAssociations : undefined, journeyId: (_a = this._options) === null || _a === void 0 ? void 0 : _a.journeyId, stageKey: (_b = this._options) === null || _b === void 0 ? void 0 : _b.stageKey }, (this._externalId && { externalId: this._externalId, externalAppId: this._externalAppId })), (this._groups && { groups: this._groups }));
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Inject execution context (called by record wrapper)
|
|
91
|
+
* @internal
|
|
92
|
+
*/
|
|
93
|
+
withProvider(provider, moduleName, entityName, clearPendingLinks) {
|
|
94
|
+
this._provider = provider;
|
|
95
|
+
this._moduleName = moduleName;
|
|
96
|
+
this._entityName = entityName;
|
|
97
|
+
this._clearPendingLinks = clearPendingLinks;
|
|
98
|
+
return this;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Execute the action
|
|
102
|
+
* @returns The result from the API
|
|
103
|
+
* @throws Error if withProvider() has not been called
|
|
104
|
+
*/
|
|
105
|
+
execute() {
|
|
106
|
+
var _a;
|
|
107
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
108
|
+
if (!this._provider || !this._moduleName || !this._entityName) {
|
|
109
|
+
throw new Error('Builder not connected to provider. Use the record wrapper API to get an executable builder.');
|
|
110
|
+
}
|
|
111
|
+
const result = yield this._provider._applyAction(this._moduleName, this._entityName, this.getData());
|
|
112
|
+
(_a = this._clearPendingLinks) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
113
|
+
return result;
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Returns the request payload without executing (for debugging)
|
|
118
|
+
* @returns The request payload that would be sent to the API
|
|
119
|
+
*/
|
|
120
|
+
dryRun() {
|
|
121
|
+
return this.getData();
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Prevents accidental `await builder` without .execute()
|
|
125
|
+
* @throws Error always - use .execute() or .dryRun() instead
|
|
126
|
+
*/
|
|
127
|
+
then() {
|
|
128
|
+
throw new Error('Builder cannot be awaited directly. Call .execute() to run the action or .dryRun() to get the payload.');
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
exports.CreateOutboundCallBuilder = CreateOutboundCallBuilder;
|
|
17
132
|
/**
|
|
18
133
|
* CreateOutboundCall
|
|
19
134
|
*
|
|
@@ -52,3 +167,7 @@ CreateOutboundCallDto.STEP_ENTITY = 'NotificationModule:Call';
|
|
|
52
167
|
CreateOutboundCallDto.STEP_SCHEMA_ID = 'e157f15c-6846-4bfb-bc92-aed4c4084e9f';
|
|
53
168
|
CreateOutboundCallDto.STEP_SCHEMA_ACTION_ID = 'c30cd248-c889-47e3-8e50-44d97bc571fd';
|
|
54
169
|
CreateOutboundCallDto.AUTO_LINK_PARENT = true;
|
|
170
|
+
CreateOutboundCallDto.HAS_ASSOCIATIONS = true;
|
|
171
|
+
CreateOutboundCallDto.HAS_REQUIRED_ASSOCIATIONS = false;
|
|
172
|
+
CreateOutboundCallDto.BUILDER_CLASS = 'CreateOutboundCallBuilder';
|
|
173
|
+
CreateOutboundCallDto.ASSOCIATION_FIELDS = [{ "name": "Association_1778588918055", "methodName": "linkAssociation_1778588918055", "required": false, "schemaAssociationId": "1a76c9bb-4359-435c-b61e-7bdfdcda7e13" }];
|
|
@@ -26,7 +26,9 @@ import { CallProperties } from '../entities-v2/Call';
|
|
|
26
26
|
import { CreateCallProperties } from '../actions-v2/CreateCallDto';
|
|
27
27
|
import { CreateCallBuilder } from '../actions-v2/CreateCallDto';
|
|
28
28
|
import { CreateInboundCallProperties } from '../actions-v2/CreateInboundCallDto';
|
|
29
|
+
import { CreateInboundCallBuilder } from '../actions-v2/CreateInboundCallDto';
|
|
29
30
|
import { CreateOutboundCallProperties } from '../actions-v2/CreateOutboundCallDto';
|
|
31
|
+
import { CreateOutboundCallBuilder } from '../actions-v2/CreateOutboundCallDto';
|
|
30
32
|
import { UpdateCallOnInboundCallAnsweredProperties } from '../actions-v2/UpdateCallOnInboundCallAnsweredDto';
|
|
31
33
|
import { UpdateCallOnInboundCallCanceledProperties } from '../actions-v2/UpdateCallOnInboundCallCanceledDto';
|
|
32
34
|
import { UpdateCallOnInboundCallCompletedProperties } from '../actions-v2/UpdateCallOnInboundCallCompletedDto';
|
|
@@ -371,58 +373,52 @@ export declare class CallRecord<TProps = CallProperties> {
|
|
|
371
373
|
* CreateInboundCall
|
|
372
374
|
*
|
|
373
375
|
* Creates a new Call record with the specified properties.
|
|
374
|
-
* Returns
|
|
376
|
+
* Returns a builder with fluent .link*() methods for associations.
|
|
377
|
+
* Call .execute() to create or .dryRun() for debugging.
|
|
375
378
|
*
|
|
376
379
|
* @param properties - The properties for the new record
|
|
377
380
|
* @param options - Optional settings
|
|
378
|
-
* @param options.type - Override the record type
|
|
379
381
|
* @param options.journeyId - Associate with a journey
|
|
380
382
|
* @param options.stageKey - Set initial pipeline stage
|
|
381
|
-
* @returns
|
|
383
|
+
* @returns CreateInboundCallBuilder - chain .link*() then .execute()
|
|
382
384
|
*
|
|
383
385
|
* @example
|
|
384
386
|
* ```typescript
|
|
385
|
-
* // Create with properties
|
|
386
387
|
* const record = odinClient.calls.new();
|
|
387
|
-
* await record.createInboundCall({ ... })
|
|
388
|
-
*
|
|
389
|
-
*
|
|
390
|
-
* const payload = record.createInboundCall({ ... }).dryRun();
|
|
388
|
+
* await record.createInboundCall({ ... })
|
|
389
|
+
* .linkAssociation_xxx(target)
|
|
390
|
+
* .execute();
|
|
391
391
|
* ```
|
|
392
392
|
*/
|
|
393
393
|
createInboundCall(properties: CreateInboundCallProperties, options?: {
|
|
394
|
-
type?: string;
|
|
395
394
|
journeyId?: string;
|
|
396
395
|
stageKey?: string;
|
|
397
|
-
}):
|
|
396
|
+
}): CreateInboundCallBuilder;
|
|
398
397
|
/**
|
|
399
398
|
* CreateOutboundCall
|
|
400
399
|
*
|
|
401
400
|
* Creates a new Call record with the specified properties.
|
|
402
|
-
* Returns
|
|
401
|
+
* Returns a builder with fluent .link*() methods for associations.
|
|
402
|
+
* Call .execute() to create or .dryRun() for debugging.
|
|
403
403
|
*
|
|
404
404
|
* @param properties - The properties for the new record
|
|
405
405
|
* @param options - Optional settings
|
|
406
|
-
* @param options.type - Override the record type
|
|
407
406
|
* @param options.journeyId - Associate with a journey
|
|
408
407
|
* @param options.stageKey - Set initial pipeline stage
|
|
409
|
-
* @returns
|
|
408
|
+
* @returns CreateOutboundCallBuilder - chain .link*() then .execute()
|
|
410
409
|
*
|
|
411
410
|
* @example
|
|
412
411
|
* ```typescript
|
|
413
|
-
* // Create with properties
|
|
414
412
|
* const record = odinClient.calls.new();
|
|
415
|
-
* await record.createOutboundCall({ ... })
|
|
416
|
-
*
|
|
417
|
-
*
|
|
418
|
-
* const payload = record.createOutboundCall({ ... }).dryRun();
|
|
413
|
+
* await record.createOutboundCall({ ... })
|
|
414
|
+
* .linkAssociation_xxx(target)
|
|
415
|
+
* .execute();
|
|
419
416
|
* ```
|
|
420
417
|
*/
|
|
421
418
|
createOutboundCall(properties: CreateOutboundCallProperties, options?: {
|
|
422
|
-
type?: string;
|
|
423
419
|
journeyId?: string;
|
|
424
420
|
stageKey?: string;
|
|
425
|
-
}):
|
|
421
|
+
}): CreateOutboundCallBuilder;
|
|
426
422
|
/**
|
|
427
423
|
* UpdateCallOnInboundCallAnswered
|
|
428
424
|
*
|
|
@@ -33,6 +33,8 @@ 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");
|
|
35
35
|
const CreateCallDto_1 = require("../actions-v2/CreateCallDto");
|
|
36
|
+
const CreateInboundCallDto_1 = require("../actions-v2/CreateInboundCallDto");
|
|
37
|
+
const CreateOutboundCallDto_1 = require("../actions-v2/CreateOutboundCallDto");
|
|
36
38
|
const LeadRecord_1 = require("./LeadRecord");
|
|
37
39
|
const FileRecord_1 = require("./FileRecord");
|
|
38
40
|
const ActivityLogRecord_1 = require("./ActivityLogRecord");
|
|
@@ -507,73 +509,49 @@ class CallRecord {
|
|
|
507
509
|
* CreateInboundCall
|
|
508
510
|
*
|
|
509
511
|
* Creates a new Call record with the specified properties.
|
|
510
|
-
* Returns
|
|
512
|
+
* Returns a builder with fluent .link*() methods for associations.
|
|
513
|
+
* Call .execute() to create or .dryRun() for debugging.
|
|
511
514
|
*
|
|
512
515
|
* @param properties - The properties for the new record
|
|
513
516
|
* @param options - Optional settings
|
|
514
|
-
* @param options.type - Override the record type
|
|
515
517
|
* @param options.journeyId - Associate with a journey
|
|
516
518
|
* @param options.stageKey - Set initial pipeline stage
|
|
517
|
-
* @returns
|
|
519
|
+
* @returns CreateInboundCallBuilder - chain .link*() then .execute()
|
|
518
520
|
*
|
|
519
521
|
* @example
|
|
520
522
|
* ```typescript
|
|
521
|
-
* // Create with properties
|
|
522
523
|
* const record = odinClient.calls.new();
|
|
523
|
-
* await record.createInboundCall({ ... })
|
|
524
|
-
*
|
|
525
|
-
*
|
|
526
|
-
* const payload = record.createInboundCall({ ... }).dryRun();
|
|
524
|
+
* await record.createInboundCall({ ... })
|
|
525
|
+
* .linkAssociation_xxx(target)
|
|
526
|
+
* .execute();
|
|
527
527
|
* ```
|
|
528
528
|
*/
|
|
529
529
|
createInboundCall(properties, options) {
|
|
530
|
-
|
|
531
|
-
const payload = {
|
|
532
|
-
entity: 'NotificationModule:Call',
|
|
533
|
-
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,
|
|
534
|
-
actionName: 'CreateInboundCall',
|
|
535
|
-
properties: properties || {},
|
|
536
|
-
associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined,
|
|
537
|
-
journeyId: options === null || options === void 0 ? void 0 : options.journeyId,
|
|
538
|
-
stageKey: options === null || options === void 0 ? void 0 : options.stageKey,
|
|
539
|
-
};
|
|
540
|
-
return new ActionBuilder(this._provider, 'NotificationModule', 'Call', payload, () => { this._pendingLinks = []; });
|
|
530
|
+
return new CreateInboundCallDto_1.CreateInboundCallBuilder(properties || {}, [...this._pendingLinks], options).withProvider(this._provider, 'NotificationModule', 'Call', () => { this._pendingLinks = []; });
|
|
541
531
|
}
|
|
542
532
|
/**
|
|
543
533
|
* CreateOutboundCall
|
|
544
534
|
*
|
|
545
535
|
* Creates a new Call record with the specified properties.
|
|
546
|
-
* Returns
|
|
536
|
+
* Returns a builder with fluent .link*() methods for associations.
|
|
537
|
+
* Call .execute() to create or .dryRun() for debugging.
|
|
547
538
|
*
|
|
548
539
|
* @param properties - The properties for the new record
|
|
549
540
|
* @param options - Optional settings
|
|
550
|
-
* @param options.type - Override the record type
|
|
551
541
|
* @param options.journeyId - Associate with a journey
|
|
552
542
|
* @param options.stageKey - Set initial pipeline stage
|
|
553
|
-
* @returns
|
|
543
|
+
* @returns CreateOutboundCallBuilder - chain .link*() then .execute()
|
|
554
544
|
*
|
|
555
545
|
* @example
|
|
556
546
|
* ```typescript
|
|
557
|
-
* // Create with properties
|
|
558
547
|
* const record = odinClient.calls.new();
|
|
559
|
-
* await record.createOutboundCall({ ... })
|
|
560
|
-
*
|
|
561
|
-
*
|
|
562
|
-
* const payload = record.createOutboundCall({ ... }).dryRun();
|
|
548
|
+
* await record.createOutboundCall({ ... })
|
|
549
|
+
* .linkAssociation_xxx(target)
|
|
550
|
+
* .execute();
|
|
563
551
|
* ```
|
|
564
552
|
*/
|
|
565
553
|
createOutboundCall(properties, options) {
|
|
566
|
-
|
|
567
|
-
const payload = {
|
|
568
|
-
entity: 'NotificationModule:Call',
|
|
569
|
-
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,
|
|
570
|
-
actionName: 'CreateOutboundCall',
|
|
571
|
-
properties: properties || {},
|
|
572
|
-
associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined,
|
|
573
|
-
journeyId: options === null || options === void 0 ? void 0 : options.journeyId,
|
|
574
|
-
stageKey: options === null || options === void 0 ? void 0 : options.stageKey,
|
|
575
|
-
};
|
|
576
|
-
return new ActionBuilder(this._provider, 'NotificationModule', 'Call', payload, () => { this._pendingLinks = []; });
|
|
554
|
+
return new CreateOutboundCallDto_1.CreateOutboundCallBuilder(properties || {}, [...this._pendingLinks], options).withProvider(this._provider, 'NotificationModule', 'Call', () => { this._pendingLinks = []; });
|
|
577
555
|
}
|
|
578
556
|
// ============================================
|
|
579
557
|
// UPDATE ACTIONS (require existing record)
|