@d19n/youfibre-odin-sdk 2.0.214 → 2.0.216
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/ImportTwilioWorkerDto.d.ts +1 -104
- package/dist/actions-v2/ImportTwilioWorkerDto.js +1 -121
- package/dist/actions-v2/SyncTwilioTaskQueueDto.d.ts +15 -1
- package/dist/actions-v2/SyncTwilioWorkerDto.d.ts +117 -2
- package/dist/actions-v2/SyncTwilioWorkerDto.js +121 -1
- package/dist/records-v2/TwilioWorkerRecord.d.ts +21 -21
- package/dist/records-v2/TwilioWorkerRecord.js +30 -29
- package/package.json +1 -1
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*
|
|
11
11
|
* AUTO-GENERATED - DO NOT EDIT DIRECTLY
|
|
12
12
|
*/
|
|
13
|
-
import {
|
|
13
|
+
import { OdinRecordCreateDto, OdinRecordCreatedEvent } from '@d19n/odin-types/dist/core';
|
|
14
14
|
/**
|
|
15
15
|
* RabbitMQ message payload for ImportTwilioWorker created events
|
|
16
16
|
*
|
|
@@ -58,100 +58,6 @@ export interface ImportTwilioWorkerProperties {
|
|
|
58
58
|
*/
|
|
59
59
|
Activity: string;
|
|
60
60
|
}
|
|
61
|
-
/**
|
|
62
|
-
* Builder for ImportTwilioWorker action
|
|
63
|
-
*
|
|
64
|
-
* Provides fluent API for adding associations before executing the action.
|
|
65
|
-
* Use .link*() methods to add associations, then call .execute() to run.
|
|
66
|
-
*
|
|
67
|
-
* @example
|
|
68
|
-
* ```typescript
|
|
69
|
-
* await record.importTwilioWorker({ ...properties })
|
|
70
|
-
* .linkAssociation_1782232776541({ id: '...', entity: '...' })
|
|
71
|
-
* .execute();
|
|
72
|
-
* ```
|
|
73
|
-
*/
|
|
74
|
-
export declare class ImportTwilioWorkerBuilder {
|
|
75
|
-
private _associations;
|
|
76
|
-
private _properties;
|
|
77
|
-
private _pendingLinks;
|
|
78
|
-
private _options?;
|
|
79
|
-
private _provider?;
|
|
80
|
-
private _moduleName?;
|
|
81
|
-
private _entityName?;
|
|
82
|
-
private _clearPendingLinks?;
|
|
83
|
-
private _externalId?;
|
|
84
|
-
private _externalAppId?;
|
|
85
|
-
private _groups?;
|
|
86
|
-
constructor(properties: ImportTwilioWorkerProperties, pendingLinks: OdinRecordLinkDto[], options?: {
|
|
87
|
-
journeyId?: string;
|
|
88
|
-
stageKey?: string;
|
|
89
|
-
});
|
|
90
|
-
/**
|
|
91
|
-
* Link TwilioTaskQueue__TwilioWorker
|
|
92
|
-
* @schemaAssociationId 9de524e5-a0e3-4580-a5eb-e19faf5711c3
|
|
93
|
-
* @required
|
|
94
|
-
* @param target - The record to link
|
|
95
|
-
* @returns this (for method chaining)
|
|
96
|
-
*/
|
|
97
|
-
linkAssociation_1782232776541(target: OdinRecord<any> | {
|
|
98
|
-
id: string;
|
|
99
|
-
entity: string;
|
|
100
|
-
}): this;
|
|
101
|
-
/**
|
|
102
|
-
* Set an external system identifier for this record.
|
|
103
|
-
* Links the record to a corresponding entry in an external application.
|
|
104
|
-
* @param externalId - The ID in the external system
|
|
105
|
-
* @param externalAppId - The external application identifier
|
|
106
|
-
* @returns this (for chaining)
|
|
107
|
-
*/
|
|
108
|
-
withExternalId(externalId: string, externalAppId: string): this;
|
|
109
|
-
/**
|
|
110
|
-
* Set security/access groups for this record.
|
|
111
|
-
* @param groups - Array of group names
|
|
112
|
-
* @returns this (for chaining)
|
|
113
|
-
*/
|
|
114
|
-
withGroups(groups: string[]): this;
|
|
115
|
-
/**
|
|
116
|
-
* Get the action payload without executing
|
|
117
|
-
* @returns The action data that would be sent
|
|
118
|
-
*/
|
|
119
|
-
getData(): {
|
|
120
|
-
entity: string;
|
|
121
|
-
type: string | undefined;
|
|
122
|
-
actionName: string;
|
|
123
|
-
properties: ImportTwilioWorkerProperties;
|
|
124
|
-
associations?: OdinRecordLinkDto[];
|
|
125
|
-
journeyId?: string;
|
|
126
|
-
stageKey?: string;
|
|
127
|
-
externalId?: string;
|
|
128
|
-
externalAppId?: string;
|
|
129
|
-
groups?: string[];
|
|
130
|
-
};
|
|
131
|
-
/**
|
|
132
|
-
* Inject execution context (called by record wrapper)
|
|
133
|
-
* @internal
|
|
134
|
-
*/
|
|
135
|
-
withProvider(provider: {
|
|
136
|
-
_applyAction(moduleName: string, entityName: string, payload: any): Promise<any>;
|
|
137
|
-
}, moduleName: string, entityName: string, clearPendingLinks: () => void): this;
|
|
138
|
-
/**
|
|
139
|
-
* Execute the action
|
|
140
|
-
* @returns The result from the API
|
|
141
|
-
* @throws Error if withProvider() has not been called
|
|
142
|
-
*/
|
|
143
|
-
execute(): Promise<any>;
|
|
144
|
-
/**
|
|
145
|
-
* Returns the request payload without executing (for debugging)
|
|
146
|
-
* @returns The request payload that would be sent to the API
|
|
147
|
-
*/
|
|
148
|
-
dryRun(): Record<string, any>;
|
|
149
|
-
/**
|
|
150
|
-
* Prevents accidental `await builder` without .execute()
|
|
151
|
-
* @throws Error always - use .execute() or .dryRun() instead
|
|
152
|
-
*/
|
|
153
|
-
then(): never;
|
|
154
|
-
}
|
|
155
61
|
/**
|
|
156
62
|
* ImportTwilioWorker
|
|
157
63
|
*
|
|
@@ -177,15 +83,6 @@ export declare class ImportTwilioWorkerDto extends OdinRecordCreateDto<ImportTwi
|
|
|
177
83
|
static readonly STEP_SCHEMA_ID = "79448527-2fc1-4d0d-a9a8-67fbd58b3df4";
|
|
178
84
|
static readonly STEP_SCHEMA_ACTION_ID = "2148e096-75e0-440a-ae51-fc8890eda66b";
|
|
179
85
|
static readonly AUTO_LINK_PARENT = true;
|
|
180
|
-
static readonly HAS_ASSOCIATIONS = true;
|
|
181
|
-
static readonly HAS_REQUIRED_ASSOCIATIONS = true;
|
|
182
|
-
static readonly BUILDER_CLASS = "ImportTwilioWorkerBuilder";
|
|
183
|
-
static readonly ASSOCIATION_FIELDS: readonly [{
|
|
184
|
-
readonly name: "Association_1782232776541";
|
|
185
|
-
readonly methodName: "linkAssociation_1782232776541";
|
|
186
|
-
readonly required: true;
|
|
187
|
-
readonly schemaAssociationId: "9de524e5-a0e3-4580-a5eb-e19faf5711c3";
|
|
188
|
-
}];
|
|
189
86
|
readonly actionName: string;
|
|
190
87
|
readonly schemaActionId: string;
|
|
191
88
|
readonly entity: string;
|
|
@@ -11,125 +11,9 @@
|
|
|
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
|
-
};
|
|
23
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
-
exports.ImportTwilioWorkerDto =
|
|
15
|
+
exports.ImportTwilioWorkerDto = void 0;
|
|
25
16
|
const core_1 = require("@d19n/odin-types/dist/core");
|
|
26
|
-
/**
|
|
27
|
-
* Builder for ImportTwilioWorker 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.importTwilioWorker({ ...properties })
|
|
35
|
-
* .linkAssociation_1782232776541({ id: '...', entity: '...' })
|
|
36
|
-
* .execute();
|
|
37
|
-
* ```
|
|
38
|
-
*/
|
|
39
|
-
class ImportTwilioWorkerBuilder {
|
|
40
|
-
constructor(properties, pendingLinks, options) {
|
|
41
|
-
this._associations = [];
|
|
42
|
-
this._properties = properties;
|
|
43
|
-
this._pendingLinks = pendingLinks;
|
|
44
|
-
this._options = options;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Link TwilioTaskQueue__TwilioWorker
|
|
48
|
-
* @schemaAssociationId 9de524e5-a0e3-4580-a5eb-e19faf5711c3
|
|
49
|
-
* @required
|
|
50
|
-
* @param target - The record to link
|
|
51
|
-
* @returns this (for method chaining)
|
|
52
|
-
*/
|
|
53
|
-
linkAssociation_1782232776541(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: 'SupportModule:TwilioWorker', type: undefined, actionName: 'ImportTwilioWorker', 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.ImportTwilioWorkerBuilder = ImportTwilioWorkerBuilder;
|
|
133
17
|
/**
|
|
134
18
|
* ImportTwilioWorker
|
|
135
19
|
*
|
|
@@ -168,7 +52,3 @@ ImportTwilioWorkerDto.STEP_ENTITY = 'SupportModule:TwilioWorker';
|
|
|
168
52
|
ImportTwilioWorkerDto.STEP_SCHEMA_ID = '79448527-2fc1-4d0d-a9a8-67fbd58b3df4';
|
|
169
53
|
ImportTwilioWorkerDto.STEP_SCHEMA_ACTION_ID = '2148e096-75e0-440a-ae51-fc8890eda66b';
|
|
170
54
|
ImportTwilioWorkerDto.AUTO_LINK_PARENT = true;
|
|
171
|
-
ImportTwilioWorkerDto.HAS_ASSOCIATIONS = true;
|
|
172
|
-
ImportTwilioWorkerDto.HAS_REQUIRED_ASSOCIATIONS = true;
|
|
173
|
-
ImportTwilioWorkerDto.BUILDER_CLASS = 'ImportTwilioWorkerBuilder';
|
|
174
|
-
ImportTwilioWorkerDto.ASSOCIATION_FIELDS = [{ "name": "Association_1782232776541", "methodName": "linkAssociation_1782232776541", "required": true, "schemaAssociationId": "9de524e5-a0e3-4580-a5eb-e19faf5711c3" }];
|
|
@@ -22,7 +22,7 @@ export interface SyncTwilioTaskQueueMessage extends OdinRecordUpdatedEvent<SyncT
|
|
|
22
22
|
* Properties for SyncTwilioTaskQueue action
|
|
23
23
|
*
|
|
24
24
|
* @property Required fields: 0
|
|
25
|
-
* @property Optional fields:
|
|
25
|
+
* @property Optional fields: 6
|
|
26
26
|
*/
|
|
27
27
|
export interface SyncTwilioTaskQueueProperties {
|
|
28
28
|
/**
|
|
@@ -53,6 +53,20 @@ export interface SyncTwilioTaskQueueProperties {
|
|
|
53
53
|
* @type {TEXT}
|
|
54
54
|
*/
|
|
55
55
|
Name?: string | null;
|
|
56
|
+
/**
|
|
57
|
+
* AssignmentActivity
|
|
58
|
+
*
|
|
59
|
+
* Activity a worker is moved to when they accept the task
|
|
60
|
+
* @type {LOOKUP}
|
|
61
|
+
*/
|
|
62
|
+
AssignmentActivity?: string | null;
|
|
63
|
+
/**
|
|
64
|
+
* ReservationActivity
|
|
65
|
+
*
|
|
66
|
+
* Activity a worker is moved to when a task is offered to them
|
|
67
|
+
* @type {LOOKUP}
|
|
68
|
+
*/
|
|
69
|
+
ReservationActivity?: string | null;
|
|
56
70
|
}
|
|
57
71
|
/**
|
|
58
72
|
* SyncTwilioTaskQueue
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*
|
|
11
11
|
* AUTO-GENERATED - DO NOT EDIT DIRECTLY
|
|
12
12
|
*/
|
|
13
|
-
import { OdinRecord, OdinRecordUpdateDto, OdinRecordUpdatedEvent } from '@d19n/odin-types/dist/core';
|
|
13
|
+
import { OdinRecord, OdinRecordUpdateDto, OdinRecordUpdatedEvent, OdinRecordLinkDto } from '@d19n/odin-types/dist/core';
|
|
14
14
|
/**
|
|
15
15
|
* RabbitMQ message payload for SyncTwilioWorker updated events
|
|
16
16
|
*
|
|
@@ -22,7 +22,7 @@ export interface SyncTwilioWorkerMessage extends OdinRecordUpdatedEvent<SyncTwil
|
|
|
22
22
|
* Properties for SyncTwilioWorker action
|
|
23
23
|
*
|
|
24
24
|
* @property Required fields: 0
|
|
25
|
-
* @property Optional fields:
|
|
25
|
+
* @property Optional fields: 4
|
|
26
26
|
*/
|
|
27
27
|
export interface SyncTwilioWorkerProperties {
|
|
28
28
|
/**
|
|
@@ -46,6 +46,112 @@ export interface SyncTwilioWorkerProperties {
|
|
|
46
46
|
* @type {TEXT}
|
|
47
47
|
*/
|
|
48
48
|
Name?: string | null;
|
|
49
|
+
/**
|
|
50
|
+
* UserId
|
|
51
|
+
*
|
|
52
|
+
* User reference
|
|
53
|
+
* @type {LOOKUP}
|
|
54
|
+
*/
|
|
55
|
+
UserId?: string | null;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Builder for SyncTwilioWorker action
|
|
59
|
+
*
|
|
60
|
+
* Provides fluent API for adding associations before executing the action.
|
|
61
|
+
* Use .link*() methods to add associations, then call .execute() to run.
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```typescript
|
|
65
|
+
* await record.syncTwilioWorker({ ...properties })
|
|
66
|
+
* .linkAssociation_1782237050168({ id: '...', entity: '...' })
|
|
67
|
+
* .execute();
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
export declare class SyncTwilioWorkerBuilder {
|
|
71
|
+
private _associations;
|
|
72
|
+
private _properties;
|
|
73
|
+
private _pendingLinks;
|
|
74
|
+
private _options?;
|
|
75
|
+
private _record;
|
|
76
|
+
private _provider?;
|
|
77
|
+
private _moduleName?;
|
|
78
|
+
private _entityName?;
|
|
79
|
+
private _clearPendingLinks?;
|
|
80
|
+
private _externalId?;
|
|
81
|
+
private _externalAppId?;
|
|
82
|
+
private _groups?;
|
|
83
|
+
constructor(record: {
|
|
84
|
+
id: string;
|
|
85
|
+
entity: string;
|
|
86
|
+
type?: string;
|
|
87
|
+
}, properties: SyncTwilioWorkerProperties, pendingLinks: OdinRecordLinkDto[], options?: {
|
|
88
|
+
journeyId?: string;
|
|
89
|
+
stageKey?: string;
|
|
90
|
+
});
|
|
91
|
+
/**
|
|
92
|
+
* Link TwilioTaskQueue__TwilioWorker
|
|
93
|
+
* @schemaAssociationId 9de524e5-a0e3-4580-a5eb-e19faf5711c3
|
|
94
|
+
* @param target - The record to link
|
|
95
|
+
* @returns this (for method chaining)
|
|
96
|
+
*/
|
|
97
|
+
linkAssociation_1782237050168(target: OdinRecord<any> | {
|
|
98
|
+
id: string;
|
|
99
|
+
entity: string;
|
|
100
|
+
}): this;
|
|
101
|
+
/**
|
|
102
|
+
* Set an external system identifier for this record.
|
|
103
|
+
* Links the record to a corresponding entry in an external application.
|
|
104
|
+
* @param externalId - The ID in the external system
|
|
105
|
+
* @param externalAppId - The external application identifier
|
|
106
|
+
* @returns this (for chaining)
|
|
107
|
+
*/
|
|
108
|
+
withExternalId(externalId: string, externalAppId: string): this;
|
|
109
|
+
/**
|
|
110
|
+
* Set security/access groups for this record.
|
|
111
|
+
* @param groups - Array of group names
|
|
112
|
+
* @returns this (for chaining)
|
|
113
|
+
*/
|
|
114
|
+
withGroups(groups: string[]): this;
|
|
115
|
+
/**
|
|
116
|
+
* Get the action payload without executing
|
|
117
|
+
* @returns The action data that would be sent
|
|
118
|
+
*/
|
|
119
|
+
getData(): {
|
|
120
|
+
id: string;
|
|
121
|
+
entity: string;
|
|
122
|
+
type?: string;
|
|
123
|
+
actionName: string;
|
|
124
|
+
properties: SyncTwilioWorkerProperties;
|
|
125
|
+
associations?: OdinRecordLinkDto[];
|
|
126
|
+
journeyId?: string;
|
|
127
|
+
stageKey?: string;
|
|
128
|
+
externalId?: string;
|
|
129
|
+
externalAppId?: string;
|
|
130
|
+
groups?: string[];
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
* Inject execution context (called by record wrapper)
|
|
134
|
+
* @internal
|
|
135
|
+
*/
|
|
136
|
+
withProvider(provider: {
|
|
137
|
+
_applyAction(moduleName: string, entityName: string, payload: any): Promise<any>;
|
|
138
|
+
}, moduleName: string, entityName: string, clearPendingLinks: () => void): this;
|
|
139
|
+
/**
|
|
140
|
+
* Execute the action
|
|
141
|
+
* @returns The result from the API
|
|
142
|
+
* @throws Error if withProvider() has not been called
|
|
143
|
+
*/
|
|
144
|
+
execute(): Promise<any>;
|
|
145
|
+
/**
|
|
146
|
+
* Returns the request payload without executing (for debugging)
|
|
147
|
+
* @returns The request payload that would be sent to the API
|
|
148
|
+
*/
|
|
149
|
+
dryRun(): Record<string, any>;
|
|
150
|
+
/**
|
|
151
|
+
* Prevents accidental `await builder` without .execute()
|
|
152
|
+
* @throws Error always - use .execute() or .dryRun() instead
|
|
153
|
+
*/
|
|
154
|
+
then(): never;
|
|
49
155
|
}
|
|
50
156
|
/**
|
|
51
157
|
* SyncTwilioWorker
|
|
@@ -72,6 +178,15 @@ export declare class SyncTwilioWorkerDto extends OdinRecordUpdateDto<SyncTwilioW
|
|
|
72
178
|
static readonly STEP_SCHEMA_ID = "79448527-2fc1-4d0d-a9a8-67fbd58b3df4";
|
|
73
179
|
static readonly STEP_SCHEMA_ACTION_ID = "ec693bcc-8710-43a4-b278-9e1ef6210f7a";
|
|
74
180
|
static readonly AUTO_LINK_PARENT = false;
|
|
181
|
+
static readonly HAS_ASSOCIATIONS = true;
|
|
182
|
+
static readonly HAS_REQUIRED_ASSOCIATIONS = false;
|
|
183
|
+
static readonly BUILDER_CLASS = "SyncTwilioWorkerBuilder";
|
|
184
|
+
static readonly ASSOCIATION_FIELDS: readonly [{
|
|
185
|
+
readonly name: "Association_1782237050168";
|
|
186
|
+
readonly methodName: "linkAssociation_1782237050168";
|
|
187
|
+
readonly required: false;
|
|
188
|
+
readonly schemaAssociationId: "9de524e5-a0e3-4580-a5eb-e19faf5711c3";
|
|
189
|
+
}];
|
|
75
190
|
readonly actionName: string;
|
|
76
191
|
readonly schemaActionId: string;
|
|
77
192
|
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.SyncTwilioWorkerDto = void 0;
|
|
24
|
+
exports.SyncTwilioWorkerDto = exports.SyncTwilioWorkerBuilder = void 0;
|
|
16
25
|
const core_1 = require("@d19n/odin-types/dist/core");
|
|
26
|
+
/**
|
|
27
|
+
* Builder for SyncTwilioWorker 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.syncTwilioWorker({ ...properties })
|
|
35
|
+
* .linkAssociation_1782237050168({ id: '...', entity: '...' })
|
|
36
|
+
* .execute();
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
class SyncTwilioWorkerBuilder {
|
|
40
|
+
constructor(record, properties, pendingLinks, options) {
|
|
41
|
+
this._associations = [];
|
|
42
|
+
this._record = record;
|
|
43
|
+
this._properties = properties;
|
|
44
|
+
this._pendingLinks = pendingLinks;
|
|
45
|
+
this._options = options;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Link TwilioTaskQueue__TwilioWorker
|
|
49
|
+
* @schemaAssociationId 9de524e5-a0e3-4580-a5eb-e19faf5711c3
|
|
50
|
+
* @param target - The record to link
|
|
51
|
+
* @returns this (for method chaining)
|
|
52
|
+
*/
|
|
53
|
+
linkAssociation_1782237050168(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({ id: this._record.id, entity: this._record.entity, type: this._record.type, actionName: 'SyncTwilioWorker', 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.SyncTwilioWorkerBuilder = SyncTwilioWorkerBuilder;
|
|
17
133
|
/**
|
|
18
134
|
* SyncTwilioWorker
|
|
19
135
|
*
|
|
@@ -54,3 +170,7 @@ SyncTwilioWorkerDto.STEP_ENTITY = 'SupportModule:TwilioWorker';
|
|
|
54
170
|
SyncTwilioWorkerDto.STEP_SCHEMA_ID = '79448527-2fc1-4d0d-a9a8-67fbd58b3df4';
|
|
55
171
|
SyncTwilioWorkerDto.STEP_SCHEMA_ACTION_ID = 'ec693bcc-8710-43a4-b278-9e1ef6210f7a';
|
|
56
172
|
SyncTwilioWorkerDto.AUTO_LINK_PARENT = false;
|
|
173
|
+
SyncTwilioWorkerDto.HAS_ASSOCIATIONS = true;
|
|
174
|
+
SyncTwilioWorkerDto.HAS_REQUIRED_ASSOCIATIONS = false;
|
|
175
|
+
SyncTwilioWorkerDto.BUILDER_CLASS = 'SyncTwilioWorkerBuilder';
|
|
176
|
+
SyncTwilioWorkerDto.ASSOCIATION_FIELDS = [{ "name": "Association_1782237050168", "methodName": "linkAssociation_1782237050168", "required": false, "schemaAssociationId": "9de524e5-a0e3-4580-a5eb-e19faf5711c3" }];
|
|
@@ -26,8 +26,8 @@ import { TwilioWorkerProperties } from '../entities-v2/TwilioWorker';
|
|
|
26
26
|
import { CreateTwilioWorkerProperties } from '../actions-v2/CreateTwilioWorkerDto';
|
|
27
27
|
import { CreateTwilioWorkerBuilder } from '../actions-v2/CreateTwilioWorkerDto';
|
|
28
28
|
import { ImportTwilioWorkerProperties } from '../actions-v2/ImportTwilioWorkerDto';
|
|
29
|
-
import { ImportTwilioWorkerBuilder } from '../actions-v2/ImportTwilioWorkerDto';
|
|
30
29
|
import { SyncTwilioWorkerProperties } from '../actions-v2/SyncTwilioWorkerDto';
|
|
30
|
+
import { SyncTwilioWorkerBuilder } from '../actions-v2/SyncTwilioWorkerDto';
|
|
31
31
|
import { UpdateTwilioWorkerProperties } from '../actions-v2/UpdateTwilioWorkerDto';
|
|
32
32
|
import { UpdateTwilioWorkerBuilder } from '../actions-v2/UpdateTwilioWorkerDto';
|
|
33
33
|
import { UserRecord } from './UserRecord';
|
|
@@ -226,54 +226,54 @@ export declare class TwilioWorkerRecord<TProps = TwilioWorkerProperties> {
|
|
|
226
226
|
* ImportTwilioWorker
|
|
227
227
|
*
|
|
228
228
|
* Creates a new TwilioWorker record with the specified properties.
|
|
229
|
-
* Returns
|
|
230
|
-
* Call .execute() to create or .dryRun() for debugging.
|
|
229
|
+
* Returns an ActionBuilder - call .execute() to create or .dryRun() for debugging.
|
|
231
230
|
*
|
|
232
231
|
* @param properties - The properties for the new record
|
|
233
232
|
* @param options - Optional settings
|
|
233
|
+
* @param options.type - Override the record type
|
|
234
234
|
* @param options.journeyId - Associate with a journey
|
|
235
235
|
* @param options.stageKey - Set initial pipeline stage
|
|
236
|
-
* @returns
|
|
236
|
+
* @returns ActionBuilder - call .execute() to create or .dryRun() for payload
|
|
237
237
|
*
|
|
238
238
|
* @example
|
|
239
239
|
* ```typescript
|
|
240
|
+
* // Create with properties
|
|
240
241
|
* const record = odinClient.twilioWorkers.new();
|
|
241
|
-
* await record.importTwilioWorker({ ... })
|
|
242
|
-
*
|
|
243
|
-
*
|
|
242
|
+
* await record.importTwilioWorker({ ... }).execute();
|
|
243
|
+
*
|
|
244
|
+
* // Dry run (for debugging)
|
|
245
|
+
* const payload = record.importTwilioWorker({ ... }).dryRun();
|
|
244
246
|
* ```
|
|
245
247
|
*/
|
|
246
248
|
importTwilioWorker(properties: ImportTwilioWorkerProperties, options?: {
|
|
249
|
+
type?: string;
|
|
247
250
|
journeyId?: string;
|
|
248
251
|
stageKey?: string;
|
|
249
|
-
}):
|
|
252
|
+
}): ActionBuilder;
|
|
250
253
|
/**
|
|
251
254
|
* SyncTwilioWorker
|
|
252
255
|
*
|
|
253
256
|
* Updates this TwilioWorker record.
|
|
254
|
-
* Returns
|
|
257
|
+
* Returns a builder with fluent .link*() methods for associations.
|
|
258
|
+
* Call .execute() to update or .dryRun() for debugging.
|
|
255
259
|
*
|
|
256
|
-
* @param
|
|
257
|
-
* @param options - Optional settings
|
|
258
|
-
* @returns
|
|
260
|
+
* @param properties - Properties to update
|
|
261
|
+
* @param options - Optional settings
|
|
262
|
+
* @returns SyncTwilioWorkerBuilder - chain .link*() then .execute()
|
|
259
263
|
* @throws Error if called on a new (unsaved) record
|
|
260
264
|
*
|
|
261
265
|
* @example
|
|
262
266
|
* ```typescript
|
|
263
267
|
* const record = await odinClient.twilioWorkers.get(id);
|
|
264
|
-
* await record.syncTwilioWorker({ ... })
|
|
265
|
-
*
|
|
266
|
-
*
|
|
267
|
-
* const payload = record.syncTwilioWorker({ ... }).dryRun();
|
|
268
|
+
* await record.syncTwilioWorker({ ... })
|
|
269
|
+
* .linkAssociation_xxx(target)
|
|
270
|
+
* .execute();
|
|
268
271
|
* ```
|
|
269
272
|
*/
|
|
270
|
-
syncTwilioWorker(
|
|
271
|
-
journeyId?: string;
|
|
272
|
-
stageKey?: string;
|
|
273
|
-
}, options?: {
|
|
273
|
+
syncTwilioWorker(properties?: SyncTwilioWorkerProperties, options?: {
|
|
274
274
|
journeyId?: string;
|
|
275
275
|
stageKey?: string;
|
|
276
|
-
}):
|
|
276
|
+
}): SyncTwilioWorkerBuilder;
|
|
277
277
|
/**
|
|
278
278
|
* UpdateTwilioWorker
|
|
279
279
|
*
|
|
@@ -33,7 +33,7 @@ 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 CreateTwilioWorkerDto_1 = require("../actions-v2/CreateTwilioWorkerDto");
|
|
36
|
-
const
|
|
36
|
+
const SyncTwilioWorkerDto_1 = require("../actions-v2/SyncTwilioWorkerDto");
|
|
37
37
|
const UpdateTwilioWorkerDto_1 = require("../actions-v2/UpdateTwilioWorkerDto");
|
|
38
38
|
const UserRecord_1 = require("./UserRecord");
|
|
39
39
|
const TwilioTaskQueueRecord_1 = require("./TwilioTaskQueueRecord");
|
|
@@ -292,25 +292,37 @@ class TwilioWorkerRecord {
|
|
|
292
292
|
* ImportTwilioWorker
|
|
293
293
|
*
|
|
294
294
|
* Creates a new TwilioWorker record with the specified properties.
|
|
295
|
-
* Returns
|
|
296
|
-
* Call .execute() to create or .dryRun() for debugging.
|
|
295
|
+
* Returns an ActionBuilder - call .execute() to create or .dryRun() for debugging.
|
|
297
296
|
*
|
|
298
297
|
* @param properties - The properties for the new record
|
|
299
298
|
* @param options - Optional settings
|
|
299
|
+
* @param options.type - Override the record type
|
|
300
300
|
* @param options.journeyId - Associate with a journey
|
|
301
301
|
* @param options.stageKey - Set initial pipeline stage
|
|
302
|
-
* @returns
|
|
302
|
+
* @returns ActionBuilder - call .execute() to create or .dryRun() for payload
|
|
303
303
|
*
|
|
304
304
|
* @example
|
|
305
305
|
* ```typescript
|
|
306
|
+
* // Create with properties
|
|
306
307
|
* const record = odinClient.twilioWorkers.new();
|
|
307
|
-
* await record.importTwilioWorker({ ... })
|
|
308
|
-
*
|
|
309
|
-
*
|
|
308
|
+
* await record.importTwilioWorker({ ... }).execute();
|
|
309
|
+
*
|
|
310
|
+
* // Dry run (for debugging)
|
|
311
|
+
* const payload = record.importTwilioWorker({ ... }).dryRun();
|
|
310
312
|
* ```
|
|
311
313
|
*/
|
|
312
314
|
importTwilioWorker(properties, options) {
|
|
313
|
-
|
|
315
|
+
var _a, _b;
|
|
316
|
+
const payload = {
|
|
317
|
+
entity: 'SupportModule:TwilioWorker',
|
|
318
|
+
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,
|
|
319
|
+
actionName: 'ImportTwilioWorker',
|
|
320
|
+
properties: properties || {},
|
|
321
|
+
associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined,
|
|
322
|
+
journeyId: options === null || options === void 0 ? void 0 : options.journeyId,
|
|
323
|
+
stageKey: options === null || options === void 0 ? void 0 : options.stageKey,
|
|
324
|
+
};
|
|
325
|
+
return new ActionBuilder(this._provider, 'SupportModule', 'TwilioWorker', payload, () => { this._pendingLinks = []; });
|
|
314
326
|
}
|
|
315
327
|
// ============================================
|
|
316
328
|
// UPDATE ACTIONS (require existing record)
|
|
@@ -319,38 +331,27 @@ class TwilioWorkerRecord {
|
|
|
319
331
|
* SyncTwilioWorker
|
|
320
332
|
*
|
|
321
333
|
* Updates this TwilioWorker record.
|
|
322
|
-
* Returns
|
|
334
|
+
* Returns a builder with fluent .link*() methods for associations.
|
|
335
|
+
* Call .execute() to update or .dryRun() for debugging.
|
|
323
336
|
*
|
|
324
|
-
* @param
|
|
325
|
-
* @param options - Optional settings
|
|
326
|
-
* @returns
|
|
337
|
+
* @param properties - Properties to update
|
|
338
|
+
* @param options - Optional settings
|
|
339
|
+
* @returns SyncTwilioWorkerBuilder - chain .link*() then .execute()
|
|
327
340
|
* @throws Error if called on a new (unsaved) record
|
|
328
341
|
*
|
|
329
342
|
* @example
|
|
330
343
|
* ```typescript
|
|
331
344
|
* const record = await odinClient.twilioWorkers.get(id);
|
|
332
|
-
* await record.syncTwilioWorker({ ... })
|
|
333
|
-
*
|
|
334
|
-
*
|
|
335
|
-
* const payload = record.syncTwilioWorker({ ... }).dryRun();
|
|
345
|
+
* await record.syncTwilioWorker({ ... })
|
|
346
|
+
* .linkAssociation_xxx(target)
|
|
347
|
+
* .execute();
|
|
336
348
|
* ```
|
|
337
349
|
*/
|
|
338
|
-
syncTwilioWorker(
|
|
350
|
+
syncTwilioWorker(properties, options) {
|
|
339
351
|
var _a;
|
|
340
352
|
if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
|
|
341
353
|
throw new Error('syncTwilioWorker requires an existing record. Use accessor.get() first.');
|
|
342
|
-
|
|
343
|
-
let opts = options;
|
|
344
|
-
if (propertiesOrOptions) {
|
|
345
|
-
if ('journeyId' in propertiesOrOptions || 'stageKey' in propertiesOrOptions) {
|
|
346
|
-
opts = propertiesOrOptions;
|
|
347
|
-
}
|
|
348
|
-
else {
|
|
349
|
-
properties = propertiesOrOptions;
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
const payload = Object.assign({ id: this._record.id, entity: this._record.entity, type: this._record.type, actionName: 'SyncTwilioWorker', properties, associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined }, opts);
|
|
353
|
-
return new ActionBuilder(this._provider, 'SupportModule', 'TwilioWorker', payload, () => { this._pendingLinks = []; });
|
|
354
|
+
return new SyncTwilioWorkerDto_1.SyncTwilioWorkerBuilder({ id: this._record.id, entity: this._record.entity, type: this._record.type }, properties || {}, [...this._pendingLinks], options).withProvider(this._provider, 'SupportModule', 'TwilioWorker', () => { this._pendingLinks = []; });
|
|
354
355
|
}
|
|
355
356
|
/**
|
|
356
357
|
* UpdateTwilioWorker
|