@d19n/youfibre-odin-sdk 2.0.102-beta.0 → 2.0.102-beta.2
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/CreateCallDto.d.ts +112 -2
- package/dist/actions-v2/CreateCallDto.js +120 -1
- package/dist/actions-v2/CreateCustomerCallLegDto.d.ts +104 -1
- package/dist/actions-v2/CreateCustomerCallLegDto.js +121 -1
- package/dist/records-v2/CallLegRecord.d.ts +8 -10
- package/dist/records-v2/CallLegRecord.js +8 -19
- package/dist/records-v2/CallRecord.d.ts +8 -10
- package/dist/records-v2/CallRecord.js +8 -19
- 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 CreateCall created events
|
|
16
16
|
*
|
|
@@ -21,7 +21,7 @@ export interface CreateCallMessage extends OdinRecordCreatedEvent<CreateCallDto,
|
|
|
21
21
|
/**
|
|
22
22
|
* Properties for CreateCall action
|
|
23
23
|
*
|
|
24
|
-
* @property Required fields:
|
|
24
|
+
* @property Required fields: 9
|
|
25
25
|
* @property Optional fields: 0
|
|
26
26
|
*/
|
|
27
27
|
export interface CreateCallProperties {
|
|
@@ -89,6 +89,107 @@ export interface CreateCallProperties {
|
|
|
89
89
|
* @required
|
|
90
90
|
*/
|
|
91
91
|
StartTime: string;
|
|
92
|
+
/**
|
|
93
|
+
* TransferCount
|
|
94
|
+
*
|
|
95
|
+
* Number of times this call was transferred (Communications - Call)
|
|
96
|
+
* @type {NUMBER}
|
|
97
|
+
* @required
|
|
98
|
+
*/
|
|
99
|
+
TransferCount: number;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Builder for CreateCall action
|
|
103
|
+
*
|
|
104
|
+
* Provides fluent API for adding associations before executing the action.
|
|
105
|
+
* Use .link*() methods to add associations, then call .execute() to run.
|
|
106
|
+
*
|
|
107
|
+
* @example
|
|
108
|
+
* ```typescript
|
|
109
|
+
* await record.createCall({ ...properties })
|
|
110
|
+
* .linkAssociation_1778248125243({ id: '...', entity: '...' })
|
|
111
|
+
* .execute();
|
|
112
|
+
* ```
|
|
113
|
+
*/
|
|
114
|
+
export declare class CreateCallBuilder {
|
|
115
|
+
private _associations;
|
|
116
|
+
private _properties;
|
|
117
|
+
private _pendingLinks;
|
|
118
|
+
private _options?;
|
|
119
|
+
private _provider?;
|
|
120
|
+
private _moduleName?;
|
|
121
|
+
private _entityName?;
|
|
122
|
+
private _clearPendingLinks?;
|
|
123
|
+
private _externalId?;
|
|
124
|
+
private _externalAppId?;
|
|
125
|
+
private _groups?;
|
|
126
|
+
constructor(properties: CreateCallProperties, pendingLinks: OdinRecordLinkDto[], options?: {
|
|
127
|
+
journeyId?: string;
|
|
128
|
+
stageKey?: string;
|
|
129
|
+
});
|
|
130
|
+
/**
|
|
131
|
+
* Link Call__Contact
|
|
132
|
+
* @schemaAssociationId 1a76c9bb-4359-435c-b61e-7bdfdcda7e13
|
|
133
|
+
* @param target - The record to link
|
|
134
|
+
* @returns this (for method chaining)
|
|
135
|
+
*/
|
|
136
|
+
linkAssociation_1778248125243(target: OdinRecord<any> | {
|
|
137
|
+
id: string;
|
|
138
|
+
entity: string;
|
|
139
|
+
}): this;
|
|
140
|
+
/**
|
|
141
|
+
* Set an external system identifier for this record.
|
|
142
|
+
* Links the record to a corresponding entry in an external application.
|
|
143
|
+
* @param externalId - The ID in the external system
|
|
144
|
+
* @param externalAppId - The external application identifier
|
|
145
|
+
* @returns this (for chaining)
|
|
146
|
+
*/
|
|
147
|
+
withExternalId(externalId: string, externalAppId: string): this;
|
|
148
|
+
/**
|
|
149
|
+
* Set security/access groups for this record.
|
|
150
|
+
* @param groups - Array of group names
|
|
151
|
+
* @returns this (for chaining)
|
|
152
|
+
*/
|
|
153
|
+
withGroups(groups: string[]): this;
|
|
154
|
+
/**
|
|
155
|
+
* Get the action payload without executing
|
|
156
|
+
* @returns The action data that would be sent
|
|
157
|
+
*/
|
|
158
|
+
getData(): {
|
|
159
|
+
entity: string;
|
|
160
|
+
type: string | undefined;
|
|
161
|
+
actionName: string;
|
|
162
|
+
properties: CreateCallProperties;
|
|
163
|
+
associations?: OdinRecordLinkDto[];
|
|
164
|
+
journeyId?: string;
|
|
165
|
+
stageKey?: string;
|
|
166
|
+
externalId?: string;
|
|
167
|
+
externalAppId?: string;
|
|
168
|
+
groups?: string[];
|
|
169
|
+
};
|
|
170
|
+
/**
|
|
171
|
+
* Inject execution context (called by record wrapper)
|
|
172
|
+
* @internal
|
|
173
|
+
*/
|
|
174
|
+
withProvider(provider: {
|
|
175
|
+
_applyAction(moduleName: string, entityName: string, payload: any): Promise<any>;
|
|
176
|
+
}, moduleName: string, entityName: string, clearPendingLinks: () => void): this;
|
|
177
|
+
/**
|
|
178
|
+
* Execute the action
|
|
179
|
+
* @returns The result from the API
|
|
180
|
+
* @throws Error if withProvider() has not been called
|
|
181
|
+
*/
|
|
182
|
+
execute(): Promise<any>;
|
|
183
|
+
/**
|
|
184
|
+
* Returns the request payload without executing (for debugging)
|
|
185
|
+
* @returns The request payload that would be sent to the API
|
|
186
|
+
*/
|
|
187
|
+
dryRun(): Record<string, any>;
|
|
188
|
+
/**
|
|
189
|
+
* Prevents accidental `await builder` without .execute()
|
|
190
|
+
* @throws Error always - use .execute() or .dryRun() instead
|
|
191
|
+
*/
|
|
192
|
+
then(): never;
|
|
92
193
|
}
|
|
93
194
|
/**
|
|
94
195
|
* CreateCall
|
|
@@ -115,6 +216,15 @@ export declare class CreateCallDto extends OdinRecordCreateDto<CreateCallPropert
|
|
|
115
216
|
static readonly STEP_SCHEMA_ID = "e157f15c-6846-4bfb-bc92-aed4c4084e9f";
|
|
116
217
|
static readonly STEP_SCHEMA_ACTION_ID = "17cc97f0-69ee-4ee0-8c80-2e80f9061c8c";
|
|
117
218
|
static readonly AUTO_LINK_PARENT = true;
|
|
219
|
+
static readonly HAS_ASSOCIATIONS = true;
|
|
220
|
+
static readonly HAS_REQUIRED_ASSOCIATIONS = false;
|
|
221
|
+
static readonly BUILDER_CLASS = "CreateCallBuilder";
|
|
222
|
+
static readonly ASSOCIATION_FIELDS: readonly [{
|
|
223
|
+
readonly name: "Association_1778248125243";
|
|
224
|
+
readonly methodName: "linkAssociation_1778248125243";
|
|
225
|
+
readonly required: false;
|
|
226
|
+
readonly schemaAssociationId: "1a76c9bb-4359-435c-b61e-7bdfdcda7e13";
|
|
227
|
+
}];
|
|
118
228
|
readonly actionName: string;
|
|
119
229
|
readonly schemaActionId: string;
|
|
120
230
|
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.CreateCallDto = void 0;
|
|
24
|
+
exports.CreateCallDto = exports.CreateCallBuilder = void 0;
|
|
16
25
|
const core_1 = require("@d19n/odin-types/dist/core");
|
|
26
|
+
/**
|
|
27
|
+
* Builder for CreateCall 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.createCall({ ...properties })
|
|
35
|
+
* .linkAssociation_1778248125243({ id: '...', entity: '...' })
|
|
36
|
+
* .execute();
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
class CreateCallBuilder {
|
|
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_1778248125243(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: 'CreateCall', 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.CreateCallBuilder = CreateCallBuilder;
|
|
17
132
|
/**
|
|
18
133
|
* CreateCall
|
|
19
134
|
*
|
|
@@ -52,3 +167,7 @@ CreateCallDto.STEP_ENTITY = 'NotificationModule:Call';
|
|
|
52
167
|
CreateCallDto.STEP_SCHEMA_ID = 'e157f15c-6846-4bfb-bc92-aed4c4084e9f';
|
|
53
168
|
CreateCallDto.STEP_SCHEMA_ACTION_ID = '17cc97f0-69ee-4ee0-8c80-2e80f9061c8c';
|
|
54
169
|
CreateCallDto.AUTO_LINK_PARENT = true;
|
|
170
|
+
CreateCallDto.HAS_ASSOCIATIONS = true;
|
|
171
|
+
CreateCallDto.HAS_REQUIRED_ASSOCIATIONS = false;
|
|
172
|
+
CreateCallDto.BUILDER_CLASS = 'CreateCallBuilder';
|
|
173
|
+
CreateCallDto.ASSOCIATION_FIELDS = [{ "name": "Association_1778248125243", "methodName": "linkAssociation_1778248125243", "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 CreateCustomerCallLeg created events
|
|
16
16
|
*
|
|
@@ -90,6 +90,100 @@ export interface CreateCustomerCallLegProperties {
|
|
|
90
90
|
*/
|
|
91
91
|
InitiatedAt: string;
|
|
92
92
|
}
|
|
93
|
+
/**
|
|
94
|
+
* Builder for CreateCustomerCallLeg action
|
|
95
|
+
*
|
|
96
|
+
* Provides fluent API for adding associations before executing the action.
|
|
97
|
+
* Use .link*() methods to add associations, then call .execute() to run.
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* ```typescript
|
|
101
|
+
* await record.createCustomerCallLeg({ ...properties })
|
|
102
|
+
* .linkAssociation_1778250753812({ id: '...', entity: '...' })
|
|
103
|
+
* .execute();
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
106
|
+
export declare class CreateCustomerCallLegBuilder {
|
|
107
|
+
private _associations;
|
|
108
|
+
private _properties;
|
|
109
|
+
private _pendingLinks;
|
|
110
|
+
private _options?;
|
|
111
|
+
private _provider?;
|
|
112
|
+
private _moduleName?;
|
|
113
|
+
private _entityName?;
|
|
114
|
+
private _clearPendingLinks?;
|
|
115
|
+
private _externalId?;
|
|
116
|
+
private _externalAppId?;
|
|
117
|
+
private _groups?;
|
|
118
|
+
constructor(properties: CreateCustomerCallLegProperties, pendingLinks: OdinRecordLinkDto[], options?: {
|
|
119
|
+
journeyId?: string;
|
|
120
|
+
stageKey?: string;
|
|
121
|
+
});
|
|
122
|
+
/**
|
|
123
|
+
* Link CallLeg_Call
|
|
124
|
+
* @schemaAssociationId 40babadf-1cd8-4c6a-adb8-f78f976245ac
|
|
125
|
+
* @required
|
|
126
|
+
* @param target - The record to link
|
|
127
|
+
* @returns this (for method chaining)
|
|
128
|
+
*/
|
|
129
|
+
linkAssociation_1778250753812(target: OdinRecord<any> | {
|
|
130
|
+
id: string;
|
|
131
|
+
entity: string;
|
|
132
|
+
}): this;
|
|
133
|
+
/**
|
|
134
|
+
* Set an external system identifier for this record.
|
|
135
|
+
* Links the record to a corresponding entry in an external application.
|
|
136
|
+
* @param externalId - The ID in the external system
|
|
137
|
+
* @param externalAppId - The external application identifier
|
|
138
|
+
* @returns this (for chaining)
|
|
139
|
+
*/
|
|
140
|
+
withExternalId(externalId: string, externalAppId: string): this;
|
|
141
|
+
/**
|
|
142
|
+
* Set security/access groups for this record.
|
|
143
|
+
* @param groups - Array of group names
|
|
144
|
+
* @returns this (for chaining)
|
|
145
|
+
*/
|
|
146
|
+
withGroups(groups: string[]): this;
|
|
147
|
+
/**
|
|
148
|
+
* Get the action payload without executing
|
|
149
|
+
* @returns The action data that would be sent
|
|
150
|
+
*/
|
|
151
|
+
getData(): {
|
|
152
|
+
entity: string;
|
|
153
|
+
type: string | undefined;
|
|
154
|
+
actionName: string;
|
|
155
|
+
properties: CreateCustomerCallLegProperties;
|
|
156
|
+
associations?: OdinRecordLinkDto[];
|
|
157
|
+
journeyId?: string;
|
|
158
|
+
stageKey?: string;
|
|
159
|
+
externalId?: string;
|
|
160
|
+
externalAppId?: string;
|
|
161
|
+
groups?: string[];
|
|
162
|
+
};
|
|
163
|
+
/**
|
|
164
|
+
* Inject execution context (called by record wrapper)
|
|
165
|
+
* @internal
|
|
166
|
+
*/
|
|
167
|
+
withProvider(provider: {
|
|
168
|
+
_applyAction(moduleName: string, entityName: string, payload: any): Promise<any>;
|
|
169
|
+
}, moduleName: string, entityName: string, clearPendingLinks: () => void): this;
|
|
170
|
+
/**
|
|
171
|
+
* Execute the action
|
|
172
|
+
* @returns The result from the API
|
|
173
|
+
* @throws Error if withProvider() has not been called
|
|
174
|
+
*/
|
|
175
|
+
execute(): Promise<any>;
|
|
176
|
+
/**
|
|
177
|
+
* Returns the request payload without executing (for debugging)
|
|
178
|
+
* @returns The request payload that would be sent to the API
|
|
179
|
+
*/
|
|
180
|
+
dryRun(): Record<string, any>;
|
|
181
|
+
/**
|
|
182
|
+
* Prevents accidental `await builder` without .execute()
|
|
183
|
+
* @throws Error always - use .execute() or .dryRun() instead
|
|
184
|
+
*/
|
|
185
|
+
then(): never;
|
|
186
|
+
}
|
|
93
187
|
/**
|
|
94
188
|
* CreateCustomerCallLeg
|
|
95
189
|
*
|
|
@@ -115,6 +209,15 @@ export declare class CreateCustomerCallLegDto extends OdinRecordCreateDto<Create
|
|
|
115
209
|
static readonly STEP_SCHEMA_ID = "75c59745-35fb-44b9-b3f2-7563101fdcec";
|
|
116
210
|
static readonly STEP_SCHEMA_ACTION_ID = "440c10de-fda8-4697-8b44-277cc7e00d3e";
|
|
117
211
|
static readonly AUTO_LINK_PARENT = true;
|
|
212
|
+
static readonly HAS_ASSOCIATIONS = true;
|
|
213
|
+
static readonly HAS_REQUIRED_ASSOCIATIONS = true;
|
|
214
|
+
static readonly BUILDER_CLASS = "CreateCustomerCallLegBuilder";
|
|
215
|
+
static readonly ASSOCIATION_FIELDS: readonly [{
|
|
216
|
+
readonly name: "Association_1778250753812";
|
|
217
|
+
readonly methodName: "linkAssociation_1778250753812";
|
|
218
|
+
readonly required: true;
|
|
219
|
+
readonly schemaAssociationId: "40babadf-1cd8-4c6a-adb8-f78f976245ac";
|
|
220
|
+
}];
|
|
118
221
|
readonly actionName: string;
|
|
119
222
|
readonly schemaActionId: string;
|
|
120
223
|
readonly entity: string;
|
|
@@ -11,9 +11,125 @@
|
|
|
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.CreateCustomerCallLegDto = void 0;
|
|
24
|
+
exports.CreateCustomerCallLegDto = exports.CreateCustomerCallLegBuilder = void 0;
|
|
16
25
|
const core_1 = require("@d19n/odin-types/dist/core");
|
|
26
|
+
/**
|
|
27
|
+
* Builder for CreateCustomerCallLeg 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.createCustomerCallLeg({ ...properties })
|
|
35
|
+
* .linkAssociation_1778250753812({ id: '...', entity: '...' })
|
|
36
|
+
* .execute();
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
class CreateCustomerCallLegBuilder {
|
|
40
|
+
constructor(properties, pendingLinks, options) {
|
|
41
|
+
this._associations = [];
|
|
42
|
+
this._properties = properties;
|
|
43
|
+
this._pendingLinks = pendingLinks;
|
|
44
|
+
this._options = options;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Link CallLeg_Call
|
|
48
|
+
* @schemaAssociationId 40babadf-1cd8-4c6a-adb8-f78f976245ac
|
|
49
|
+
* @required
|
|
50
|
+
* @param target - The record to link
|
|
51
|
+
* @returns this (for method chaining)
|
|
52
|
+
*/
|
|
53
|
+
linkAssociation_1778250753812(target) {
|
|
54
|
+
this._associations.push(new core_1.OdinRecordLinkDto({
|
|
55
|
+
id: target.id,
|
|
56
|
+
entity: 'entity' in target ? target.entity : target.entity,
|
|
57
|
+
}));
|
|
58
|
+
return this;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Set an external system identifier for this record.
|
|
62
|
+
* Links the record to a corresponding entry in an external application.
|
|
63
|
+
* @param externalId - The ID in the external system
|
|
64
|
+
* @param externalAppId - The external application identifier
|
|
65
|
+
* @returns this (for chaining)
|
|
66
|
+
*/
|
|
67
|
+
withExternalId(externalId, externalAppId) {
|
|
68
|
+
this._externalId = externalId;
|
|
69
|
+
this._externalAppId = externalAppId;
|
|
70
|
+
return this;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Set security/access groups for this record.
|
|
74
|
+
* @param groups - Array of group names
|
|
75
|
+
* @returns this (for chaining)
|
|
76
|
+
*/
|
|
77
|
+
withGroups(groups) {
|
|
78
|
+
this._groups = groups;
|
|
79
|
+
return this;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Get the action payload without executing
|
|
83
|
+
* @returns The action data that would be sent
|
|
84
|
+
*/
|
|
85
|
+
getData() {
|
|
86
|
+
var _a, _b;
|
|
87
|
+
const allAssociations = [...this._associations, ...this._pendingLinks];
|
|
88
|
+
return Object.assign(Object.assign({ entity: 'NotificationModule:CallLeg', type: undefined, actionName: 'CreateCustomerCallLeg', 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 }));
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Inject execution context (called by record wrapper)
|
|
92
|
+
* @internal
|
|
93
|
+
*/
|
|
94
|
+
withProvider(provider, moduleName, entityName, clearPendingLinks) {
|
|
95
|
+
this._provider = provider;
|
|
96
|
+
this._moduleName = moduleName;
|
|
97
|
+
this._entityName = entityName;
|
|
98
|
+
this._clearPendingLinks = clearPendingLinks;
|
|
99
|
+
return this;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Execute the action
|
|
103
|
+
* @returns The result from the API
|
|
104
|
+
* @throws Error if withProvider() has not been called
|
|
105
|
+
*/
|
|
106
|
+
execute() {
|
|
107
|
+
var _a;
|
|
108
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
109
|
+
if (!this._provider || !this._moduleName || !this._entityName) {
|
|
110
|
+
throw new Error('Builder not connected to provider. Use the record wrapper API to get an executable builder.');
|
|
111
|
+
}
|
|
112
|
+
const result = yield this._provider._applyAction(this._moduleName, this._entityName, this.getData());
|
|
113
|
+
(_a = this._clearPendingLinks) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
114
|
+
return result;
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Returns the request payload without executing (for debugging)
|
|
119
|
+
* @returns The request payload that would be sent to the API
|
|
120
|
+
*/
|
|
121
|
+
dryRun() {
|
|
122
|
+
return this.getData();
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Prevents accidental `await builder` without .execute()
|
|
126
|
+
* @throws Error always - use .execute() or .dryRun() instead
|
|
127
|
+
*/
|
|
128
|
+
then() {
|
|
129
|
+
throw new Error('Builder cannot be awaited directly. Call .execute() to run the action or .dryRun() to get the payload.');
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
exports.CreateCustomerCallLegBuilder = CreateCustomerCallLegBuilder;
|
|
17
133
|
/**
|
|
18
134
|
* CreateCustomerCallLeg
|
|
19
135
|
*
|
|
@@ -52,3 +168,7 @@ CreateCustomerCallLegDto.STEP_ENTITY = 'NotificationModule:CallLeg';
|
|
|
52
168
|
CreateCustomerCallLegDto.STEP_SCHEMA_ID = '75c59745-35fb-44b9-b3f2-7563101fdcec';
|
|
53
169
|
CreateCustomerCallLegDto.STEP_SCHEMA_ACTION_ID = '440c10de-fda8-4697-8b44-277cc7e00d3e';
|
|
54
170
|
CreateCustomerCallLegDto.AUTO_LINK_PARENT = true;
|
|
171
|
+
CreateCustomerCallLegDto.HAS_ASSOCIATIONS = true;
|
|
172
|
+
CreateCustomerCallLegDto.HAS_REQUIRED_ASSOCIATIONS = true;
|
|
173
|
+
CreateCustomerCallLegDto.BUILDER_CLASS = 'CreateCustomerCallLegBuilder';
|
|
174
|
+
CreateCustomerCallLegDto.ASSOCIATION_FIELDS = [{ "name": "Association_1778250753812", "methodName": "linkAssociation_1778250753812", "required": true, "schemaAssociationId": "40babadf-1cd8-4c6a-adb8-f78f976245ac" }];
|
|
@@ -25,6 +25,7 @@ import { RecordLinkManager } from '@d19n/odin-sdk-generator/dist/record-link-man
|
|
|
25
25
|
import { CallLegProperties } from '../entities-v2/CallLeg';
|
|
26
26
|
import { CreateAgentCallLegProperties } from '../actions-v2/CreateAgentCallLegDto';
|
|
27
27
|
import { CreateCustomerCallLegProperties } from '../actions-v2/CreateCustomerCallLegDto';
|
|
28
|
+
import { CreateCustomerCallLegBuilder } from '../actions-v2/CreateCustomerCallLegDto';
|
|
28
29
|
import { UpdateCallProperties } from '../actions-v2/UpdateCallDto';
|
|
29
30
|
import { CallRecord } from './CallRecord';
|
|
30
31
|
import { CallEventRecord } from './CallEventRecord';
|
|
@@ -245,30 +246,27 @@ export declare class CallLegRecord<TProps = CallLegProperties> {
|
|
|
245
246
|
* CreateCustomerCallLeg
|
|
246
247
|
*
|
|
247
248
|
* Creates a new CallLeg record with the specified properties.
|
|
248
|
-
* Returns
|
|
249
|
+
* Returns a builder with fluent .link*() methods for associations.
|
|
250
|
+
* Call .execute() to create or .dryRun() for debugging.
|
|
249
251
|
*
|
|
250
252
|
* @param properties - The properties for the new record
|
|
251
253
|
* @param options - Optional settings
|
|
252
|
-
* @param options.type - Override the record type
|
|
253
254
|
* @param options.journeyId - Associate with a journey
|
|
254
255
|
* @param options.stageKey - Set initial pipeline stage
|
|
255
|
-
* @returns
|
|
256
|
+
* @returns CreateCustomerCallLegBuilder - chain .link*() then .execute()
|
|
256
257
|
*
|
|
257
258
|
* @example
|
|
258
259
|
* ```typescript
|
|
259
|
-
* // Create with properties
|
|
260
260
|
* const record = odinClient.callLegs.new();
|
|
261
|
-
* await record.createCustomerCallLeg({ ... })
|
|
262
|
-
*
|
|
263
|
-
*
|
|
264
|
-
* const payload = record.createCustomerCallLeg({ ... }).dryRun();
|
|
261
|
+
* await record.createCustomerCallLeg({ ... })
|
|
262
|
+
* .linkAssociation_xxx(target)
|
|
263
|
+
* .execute();
|
|
265
264
|
* ```
|
|
266
265
|
*/
|
|
267
266
|
createCustomerCallLeg(properties: CreateCustomerCallLegProperties, options?: {
|
|
268
|
-
type?: string;
|
|
269
267
|
journeyId?: string;
|
|
270
268
|
stageKey?: string;
|
|
271
|
-
}):
|
|
269
|
+
}): CreateCustomerCallLegBuilder;
|
|
272
270
|
/**
|
|
273
271
|
* UpdateCall
|
|
274
272
|
*
|
|
@@ -32,6 +32,7 @@ exports.isCallLegRecord = exports.CallLegRecord = 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");
|
|
35
|
+
const CreateCustomerCallLegDto_1 = require("../actions-v2/CreateCustomerCallLegDto");
|
|
35
36
|
const CallRecord_1 = require("./CallRecord");
|
|
36
37
|
const CallEventRecord_1 = require("./CallEventRecord");
|
|
37
38
|
const CallTransferRecord_1 = require("./CallTransferRecord");
|
|
@@ -332,37 +333,25 @@ class CallLegRecord {
|
|
|
332
333
|
* CreateCustomerCallLeg
|
|
333
334
|
*
|
|
334
335
|
* Creates a new CallLeg record with the specified properties.
|
|
335
|
-
* Returns
|
|
336
|
+
* Returns a builder with fluent .link*() methods for associations.
|
|
337
|
+
* Call .execute() to create or .dryRun() for debugging.
|
|
336
338
|
*
|
|
337
339
|
* @param properties - The properties for the new record
|
|
338
340
|
* @param options - Optional settings
|
|
339
|
-
* @param options.type - Override the record type
|
|
340
341
|
* @param options.journeyId - Associate with a journey
|
|
341
342
|
* @param options.stageKey - Set initial pipeline stage
|
|
342
|
-
* @returns
|
|
343
|
+
* @returns CreateCustomerCallLegBuilder - chain .link*() then .execute()
|
|
343
344
|
*
|
|
344
345
|
* @example
|
|
345
346
|
* ```typescript
|
|
346
|
-
* // Create with properties
|
|
347
347
|
* const record = odinClient.callLegs.new();
|
|
348
|
-
* await record.createCustomerCallLeg({ ... })
|
|
349
|
-
*
|
|
350
|
-
*
|
|
351
|
-
* const payload = record.createCustomerCallLeg({ ... }).dryRun();
|
|
348
|
+
* await record.createCustomerCallLeg({ ... })
|
|
349
|
+
* .linkAssociation_xxx(target)
|
|
350
|
+
* .execute();
|
|
352
351
|
* ```
|
|
353
352
|
*/
|
|
354
353
|
createCustomerCallLeg(properties, options) {
|
|
355
|
-
|
|
356
|
-
const payload = {
|
|
357
|
-
entity: 'NotificationModule:CallLeg',
|
|
358
|
-
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,
|
|
359
|
-
actionName: 'CreateCustomerCallLeg',
|
|
360
|
-
properties: properties || {},
|
|
361
|
-
associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined,
|
|
362
|
-
journeyId: options === null || options === void 0 ? void 0 : options.journeyId,
|
|
363
|
-
stageKey: options === null || options === void 0 ? void 0 : options.stageKey,
|
|
364
|
-
};
|
|
365
|
-
return new ActionBuilder(this._provider, 'NotificationModule', 'CallLeg', payload, () => { this._pendingLinks = []; });
|
|
354
|
+
return new CreateCustomerCallLegDto_1.CreateCustomerCallLegBuilder(properties || {}, [...this._pendingLinks], options).withProvider(this._provider, 'NotificationModule', 'CallLeg', () => { this._pendingLinks = []; });
|
|
366
355
|
}
|
|
367
356
|
// ============================================
|
|
368
357
|
// UPDATE ACTIONS (require existing record)
|
|
@@ -24,6 +24,7 @@ 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
25
|
import { CallProperties } from '../entities-v2/Call';
|
|
26
26
|
import { CreateCallProperties } from '../actions-v2/CreateCallDto';
|
|
27
|
+
import { CreateCallBuilder } from '../actions-v2/CreateCallDto';
|
|
27
28
|
import { UpdateCallTranscriptionUrlProperties } from '../actions-v2/UpdateCallTranscriptionUrlDto';
|
|
28
29
|
import { LeadRecord } from './LeadRecord';
|
|
29
30
|
import { FileRecord } from './FileRecord';
|
|
@@ -336,30 +337,27 @@ export declare class CallRecord<TProps = CallProperties> {
|
|
|
336
337
|
* CreateCall
|
|
337
338
|
*
|
|
338
339
|
* Creates a new Call record with the specified properties.
|
|
339
|
-
* Returns
|
|
340
|
+
* Returns a builder with fluent .link*() methods for associations.
|
|
341
|
+
* Call .execute() to create or .dryRun() for debugging.
|
|
340
342
|
*
|
|
341
343
|
* @param properties - The properties for the new record
|
|
342
344
|
* @param options - Optional settings
|
|
343
|
-
* @param options.type - Override the record type
|
|
344
345
|
* @param options.journeyId - Associate with a journey
|
|
345
346
|
* @param options.stageKey - Set initial pipeline stage
|
|
346
|
-
* @returns
|
|
347
|
+
* @returns CreateCallBuilder - chain .link*() then .execute()
|
|
347
348
|
*
|
|
348
349
|
* @example
|
|
349
350
|
* ```typescript
|
|
350
|
-
* // Create with properties
|
|
351
351
|
* const record = odinClient.calls.new();
|
|
352
|
-
* await record.createCall({ ... })
|
|
353
|
-
*
|
|
354
|
-
*
|
|
355
|
-
* const payload = record.createCall({ ... }).dryRun();
|
|
352
|
+
* await record.createCall({ ... })
|
|
353
|
+
* .linkAssociation_xxx(target)
|
|
354
|
+
* .execute();
|
|
356
355
|
* ```
|
|
357
356
|
*/
|
|
358
357
|
createCall(properties: CreateCallProperties, options?: {
|
|
359
|
-
type?: string;
|
|
360
358
|
journeyId?: string;
|
|
361
359
|
stageKey?: string;
|
|
362
|
-
}):
|
|
360
|
+
}): CreateCallBuilder;
|
|
363
361
|
/**
|
|
364
362
|
* UpdateCallTranscriptionUrl
|
|
365
363
|
*
|
|
@@ -32,6 +32,7 @@ exports.isCallRecord = exports.CallRecord = 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");
|
|
35
|
+
const CreateCallDto_1 = require("../actions-v2/CreateCallDto");
|
|
35
36
|
const LeadRecord_1 = require("./LeadRecord");
|
|
36
37
|
const FileRecord_1 = require("./FileRecord");
|
|
37
38
|
const ActivityLogRecord_1 = require("./ActivityLogRecord");
|
|
@@ -482,37 +483,25 @@ class CallRecord {
|
|
|
482
483
|
* CreateCall
|
|
483
484
|
*
|
|
484
485
|
* Creates a new Call record with the specified properties.
|
|
485
|
-
* Returns
|
|
486
|
+
* Returns a builder with fluent .link*() methods for associations.
|
|
487
|
+
* Call .execute() to create or .dryRun() for debugging.
|
|
486
488
|
*
|
|
487
489
|
* @param properties - The properties for the new record
|
|
488
490
|
* @param options - Optional settings
|
|
489
|
-
* @param options.type - Override the record type
|
|
490
491
|
* @param options.journeyId - Associate with a journey
|
|
491
492
|
* @param options.stageKey - Set initial pipeline stage
|
|
492
|
-
* @returns
|
|
493
|
+
* @returns CreateCallBuilder - chain .link*() then .execute()
|
|
493
494
|
*
|
|
494
495
|
* @example
|
|
495
496
|
* ```typescript
|
|
496
|
-
* // Create with properties
|
|
497
497
|
* const record = odinClient.calls.new();
|
|
498
|
-
* await record.createCall({ ... })
|
|
499
|
-
*
|
|
500
|
-
*
|
|
501
|
-
* const payload = record.createCall({ ... }).dryRun();
|
|
498
|
+
* await record.createCall({ ... })
|
|
499
|
+
* .linkAssociation_xxx(target)
|
|
500
|
+
* .execute();
|
|
502
501
|
* ```
|
|
503
502
|
*/
|
|
504
503
|
createCall(properties, options) {
|
|
505
|
-
|
|
506
|
-
const payload = {
|
|
507
|
-
entity: 'NotificationModule:Call',
|
|
508
|
-
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,
|
|
509
|
-
actionName: 'CreateCall',
|
|
510
|
-
properties: properties || {},
|
|
511
|
-
associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined,
|
|
512
|
-
journeyId: options === null || options === void 0 ? void 0 : options.journeyId,
|
|
513
|
-
stageKey: options === null || options === void 0 ? void 0 : options.stageKey,
|
|
514
|
-
};
|
|
515
|
-
return new ActionBuilder(this._provider, 'NotificationModule', 'Call', payload, () => { this._pendingLinks = []; });
|
|
504
|
+
return new CreateCallDto_1.CreateCallBuilder(properties || {}, [...this._pendingLinks], options).withProvider(this._provider, 'NotificationModule', 'Call', () => { this._pendingLinks = []; });
|
|
516
505
|
}
|
|
517
506
|
// ============================================
|
|
518
507
|
// UPDATE ACTIONS (require existing record)
|