@d19n/youfibre-odin-sdk 2.0.18 → 2.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -1
- package/dist/EntityRegistry.d.ts +2 -0
- package/dist/EntityRegistry.js +2 -0
- package/dist/OdinApiClient.d.ts +4 -0
- package/dist/OdinApiClient.js +8 -0
- package/dist/OdinDbClient.d.ts +4 -0
- package/dist/OdinDbClient.js +8 -0
- package/dist/accessors-v2/BngProvisionAccessor.d.ts +111 -0
- package/dist/accessors-v2/BngProvisionAccessor.js +190 -0
- package/dist/accessors-v2/index.d.ts +1 -0
- package/dist/accessors-v2/index.js +5 -3
- package/dist/actions-v2/CreateBngProvisionDto.d.ts +116 -0
- package/dist/actions-v2/CreateBngProvisionDto.js +54 -0
- package/dist/actions-v2/MoveInstallWorkOrderFromInProgressToPendingDto.d.ts +115 -0
- package/dist/actions-v2/MoveInstallWorkOrderFromInProgressToPendingDto.js +80 -0
- package/dist/actions-v2/MoveInstallWorkOrderFromPendingToInProgressDto.d.ts +115 -0
- package/dist/actions-v2/MoveInstallWorkOrderFromPendingToInProgressDto.js +80 -0
- package/dist/actions-v2/MoveInstallWorkOrderFromRemediationToInProgressDto.d.ts +115 -0
- package/dist/actions-v2/MoveInstallWorkOrderFromRemediationToInProgressDto.js +80 -0
- package/dist/actions-v2/MoveInstallWorkOrderToCancelledDto.d.ts +115 -0
- package/dist/actions-v2/MoveInstallWorkOrderToCancelledDto.js +80 -0
- package/dist/actions-v2/UpdateCaseCsatDto.d.ts +135 -0
- package/dist/actions-v2/UpdateCaseCsatDto.js +56 -0
- package/dist/db-accessors-v2/BngProvisionDbAccessor.d.ts +149 -0
- package/dist/db-accessors-v2/BngProvisionDbAccessor.js +227 -0
- package/dist/db-accessors-v2/index.d.ts +1 -0
- package/dist/db-accessors-v2/index.js +5 -3
- package/dist/entities-v2/Config.d.ts +8 -8
- package/dist/entities-v2/Config.js +4 -4
- package/dist/entities-v2/Contact.d.ts +7 -0
- package/dist/entities-v2/Contact.js +2 -0
- package/dist/entities-v2/CustomerDeviceOnt.d.ts +2 -0
- package/dist/entities-v2/CustomerDeviceOnt.js +2 -0
- package/dist/records-v2/BngProvisionRecord.d.ts +205 -0
- package/dist/records-v2/BngProvisionRecord.js +280 -0
- package/dist/records-v2/CaseRecord.d.ts +28 -0
- package/dist/records-v2/CaseRecord.js +37 -0
- package/dist/records-v2/OrderItemRecord.d.ts +20 -0
- package/dist/records-v2/OrderItemRecord.js +33 -0
- package/dist/records-v2/WorkOrderRecord.d.ts +100 -0
- package/dist/records-v2/WorkOrderRecord.js +116 -0
- package/dist/records-v2/index.d.ts +1 -0
- package/dist/records-v2/index.js +7 -4
- package/package.json +1 -1
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* BngProvision Record Wrapper
|
|
4
|
+
*
|
|
5
|
+
* Provides typed action methods and link management.
|
|
6
|
+
* Works with both ApiProvider and DbProvider.
|
|
7
|
+
*
|
|
8
|
+
* All action methods return an ActionBuilder or FlowBuilder.
|
|
9
|
+
* Call .execute() to run or .dryRun() to get the payload for debugging.
|
|
10
|
+
*
|
|
11
|
+
* Can be instantiated with null record for create operations:
|
|
12
|
+
* ```typescript
|
|
13
|
+
* const record = odinClient.bngProvisions.new();
|
|
14
|
+
* await record.createBngProvision({ ... }).execute();
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* Entity Types: DEFAULT
|
|
18
|
+
*
|
|
19
|
+
* AUTO-GENERATED - DO NOT EDIT DIRECTLY
|
|
20
|
+
*/
|
|
21
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
22
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
23
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
24
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
25
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
26
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
27
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
+
exports.isBngProvisionRecord = exports.BngProvisionRecord = void 0;
|
|
32
|
+
const uuid_1 = require("uuid");
|
|
33
|
+
const core_1 = require("@d19n/odin-types/dist/core");
|
|
34
|
+
const record_link_manager_1 = require("@d19n/odin-sdk-generator/dist/record-link-manager");
|
|
35
|
+
const OrderItemRecord_1 = require("./OrderItemRecord");
|
|
36
|
+
/**
|
|
37
|
+
* Builder for action execution with dryRun support
|
|
38
|
+
*
|
|
39
|
+
* Provides a consistent API across all action types:
|
|
40
|
+
* - `.execute()` - Execute the action and return results
|
|
41
|
+
* - `.dryRun()` - Return the payload without executing (for debugging)
|
|
42
|
+
*/
|
|
43
|
+
class ActionBuilder {
|
|
44
|
+
constructor(provider, moduleName, entityName, payload, clearPendingLinks) {
|
|
45
|
+
this._provider = provider;
|
|
46
|
+
this._moduleName = moduleName;
|
|
47
|
+
this._entityName = entityName;
|
|
48
|
+
this._payload = payload;
|
|
49
|
+
this._clearPendingLinks = clearPendingLinks;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Set an external system identifier for this record.
|
|
53
|
+
* Links the record to a corresponding entry in an external application.
|
|
54
|
+
*
|
|
55
|
+
* @param externalId - The ID in the external system
|
|
56
|
+
* @param externalAppId - The external application identifier
|
|
57
|
+
* @returns this (for chaining)
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```typescript
|
|
61
|
+
* await record.createOrder({ ... }).withExternalId('SF-123', 'salesforce').execute();
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
withExternalId(externalId, externalAppId) {
|
|
65
|
+
this._payload.externalId = externalId;
|
|
66
|
+
this._payload.externalAppId = externalAppId;
|
|
67
|
+
return this;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Set security/access groups for this record.
|
|
71
|
+
* Controls which user groups can access the record.
|
|
72
|
+
*
|
|
73
|
+
* @param groups - Array of group names
|
|
74
|
+
* @returns this (for chaining)
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```typescript
|
|
78
|
+
* await record.createOrder({ ... }).withGroups(['TenantA', 'BillingTeam']).execute();
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
withGroups(groups) {
|
|
82
|
+
this._payload.groups = groups;
|
|
83
|
+
return this;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Execute the action
|
|
87
|
+
* @returns The result from the API
|
|
88
|
+
*/
|
|
89
|
+
execute() {
|
|
90
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
91
|
+
const result = yield this._provider._applyAction(this._moduleName, this._entityName, this._payload);
|
|
92
|
+
this._clearPendingLinks();
|
|
93
|
+
return result;
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Returns the request payload without executing (for debugging)
|
|
98
|
+
* @returns The request payload that would be sent to the API
|
|
99
|
+
*/
|
|
100
|
+
dryRun() {
|
|
101
|
+
return this._payload;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Prevents accidental `await actionBuilder` without .execute()
|
|
105
|
+
* Forces developers to explicitly call .execute()
|
|
106
|
+
* @throws Error always - use .execute() or .dryRun() instead
|
|
107
|
+
*/
|
|
108
|
+
then() {
|
|
109
|
+
throw new Error('ActionBuilder cannot be awaited directly. Call .execute() to run the action or .dryRun() to get the payload.');
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
class BngProvisionRecord {
|
|
113
|
+
/**
|
|
114
|
+
* Create a record wrapper.
|
|
115
|
+
* @param record - The underlying record, or null for create operations
|
|
116
|
+
* @param provider - The API or DB provider
|
|
117
|
+
* @param preGeneratedId - Optional pre-generated ID for new records (auto-generated if not provided)
|
|
118
|
+
*/
|
|
119
|
+
constructor(record, provider, preGeneratedId) {
|
|
120
|
+
this._pendingLinks = [];
|
|
121
|
+
this._record = record;
|
|
122
|
+
this._provider = provider;
|
|
123
|
+
this._preGeneratedId = preGeneratedId !== null && preGeneratedId !== void 0 ? preGeneratedId : (0, uuid_1.v4)();
|
|
124
|
+
}
|
|
125
|
+
// ============================================
|
|
126
|
+
// CORE PROPERTIES
|
|
127
|
+
// ============================================
|
|
128
|
+
/** Returns true if this is a new (unsaved) record */
|
|
129
|
+
get isNew() { var _a; return !((_a = this._record) === null || _a === void 0 ? void 0 : _a.id); }
|
|
130
|
+
/** Record ID - always available (pre-generated for new records) */
|
|
131
|
+
get id() { var _a, _b; return (_b = (_a = this._record) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : this._preGeneratedId; }
|
|
132
|
+
get entity() { var _a, _b; return (_b = (_a = this._record) === null || _a === void 0 ? void 0 : _a.entity) !== null && _b !== void 0 ? _b : 'ServiceModule:BngProvision'; }
|
|
133
|
+
get type() { var _a; return (_a = this._record) === null || _a === void 0 ? void 0 : _a.type; }
|
|
134
|
+
/** Record properties - empty object for new (unsaved) records */
|
|
135
|
+
get properties() { var _a; return ((_a = this._record) === null || _a === void 0 ? void 0 : _a.properties) || {}; }
|
|
136
|
+
get title() { var _a; return (_a = this._record) === null || _a === void 0 ? void 0 : _a.title; }
|
|
137
|
+
get recordNumber() { var _a; return (_a = this._record) === null || _a === void 0 ? void 0 : _a.recordNumber; }
|
|
138
|
+
get stage() { var _a; return (_a = this._record) === null || _a === void 0 ? void 0 : _a.stage; }
|
|
139
|
+
get createdAt() { var _a; return (_a = this._record) === null || _a === void 0 ? void 0 : _a.createdAt; }
|
|
140
|
+
get updatedAt() { var _a; return (_a = this._record) === null || _a === void 0 ? void 0 : _a.updatedAt; }
|
|
141
|
+
get externalId() { var _a; return (_a = this._record) === null || _a === void 0 ? void 0 : _a.externalId; }
|
|
142
|
+
get externalAppId() { var _a; return (_a = this._record) === null || _a === void 0 ? void 0 : _a.externalAppId; }
|
|
143
|
+
get groups() { var _a; return ((_a = this._record) === null || _a === void 0 ? void 0 : _a.groups) || []; }
|
|
144
|
+
/** Access the underlying OdinRecord (null for new records) */
|
|
145
|
+
get record() { return this._record; }
|
|
146
|
+
// ============================================
|
|
147
|
+
// TYPE GUARDS (with TypeScript type predicates)
|
|
148
|
+
// ============================================
|
|
149
|
+
/**
|
|
150
|
+
* Type guard: check if this record is of type DEFAULT
|
|
151
|
+
*
|
|
152
|
+
* When this returns true, TypeScript automatically narrows the type,
|
|
153
|
+
* giving you access to DEFAULT-specific properties.
|
|
154
|
+
*
|
|
155
|
+
* @example
|
|
156
|
+
* ```typescript
|
|
157
|
+
* if (record.isDefault()) {
|
|
158
|
+
* // TypeScript knows record.properties is BngProvisionProperties
|
|
159
|
+
* console.log(record.properties.SomeTypeSpecificField);
|
|
160
|
+
* }
|
|
161
|
+
* ```
|
|
162
|
+
* @remarks This is the default record type
|
|
163
|
+
*/
|
|
164
|
+
isDefault() { var _a; return ((_a = this._record) === null || _a === void 0 ? void 0 : _a.type) === 'DEFAULT'; }
|
|
165
|
+
/**
|
|
166
|
+
* Access linked OrderItem records
|
|
167
|
+
* @remarks Available labels: OrderItem__BngProvision
|
|
168
|
+
* @throws Error if called on a new (unsaved) record
|
|
169
|
+
*
|
|
170
|
+
* @example
|
|
171
|
+
* ```typescript
|
|
172
|
+
* // Get all linked OrderItem records
|
|
173
|
+
* const items = await record.orderItems.list();
|
|
174
|
+
* const first = await record.orderItems.first();
|
|
175
|
+
*
|
|
176
|
+
* // Filter by label
|
|
177
|
+
* const specific = await record.orderItems.first({ label: 'OrderItem__BngProvision' });
|
|
178
|
+
* ```
|
|
179
|
+
*/
|
|
180
|
+
get orderItems() {
|
|
181
|
+
var _a;
|
|
182
|
+
if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
|
|
183
|
+
throw new Error('Cannot access links on a new (unsaved) record');
|
|
184
|
+
if (!this._orderItems) {
|
|
185
|
+
this._orderItems = new record_link_manager_1.RecordLinkManager(this._provider, this._record, {
|
|
186
|
+
sourceEntity: 'ServiceModule:BngProvision',
|
|
187
|
+
targetEntity: 'OrderModule:OrderItem',
|
|
188
|
+
targetModuleName: 'OrderModule',
|
|
189
|
+
targetEntityName: 'OrderItem',
|
|
190
|
+
labels: ['OrderItem__BngProvision'],
|
|
191
|
+
}, OrderItemRecord_1.OrderItemRecord);
|
|
192
|
+
}
|
|
193
|
+
return this._orderItems;
|
|
194
|
+
}
|
|
195
|
+
// ============================================
|
|
196
|
+
// LINK MANAGEMENT
|
|
197
|
+
// ============================================
|
|
198
|
+
/**
|
|
199
|
+
* Queue a link to be created with the next action.
|
|
200
|
+
* Works for both create and update actions.
|
|
201
|
+
* @returns this (for chaining)
|
|
202
|
+
*/
|
|
203
|
+
link(target) {
|
|
204
|
+
this._pendingLinks.push(new core_1.OdinRecordLinkDto({ id: target.id, entity: target.entity }));
|
|
205
|
+
return this;
|
|
206
|
+
}
|
|
207
|
+
/** Get the currently queued links */
|
|
208
|
+
get pendingLinks() {
|
|
209
|
+
return [...this._pendingLinks];
|
|
210
|
+
}
|
|
211
|
+
/** Clear pending links without executing an action */
|
|
212
|
+
clearPendingLinks() {
|
|
213
|
+
this._pendingLinks = [];
|
|
214
|
+
return this;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Immediately unlink a record (API call).
|
|
218
|
+
* Unlike link(), this executes immediately.
|
|
219
|
+
* @throws Error if called on a new (unsaved) record
|
|
220
|
+
*/
|
|
221
|
+
unlink(target) {
|
|
222
|
+
var _a;
|
|
223
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
224
|
+
if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
|
|
225
|
+
throw new Error('Cannot unlink from a new (unsaved) record');
|
|
226
|
+
const targetId = typeof target === 'string' ? target : target.id;
|
|
227
|
+
yield this._provider._deleteLinks('ServiceModule', 'BngProvision', this._record.id, targetId);
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
// ============================================
|
|
231
|
+
// CREATE ACTIONS (no existing record required)
|
|
232
|
+
// ============================================
|
|
233
|
+
/**
|
|
234
|
+
* CreateBngProvision
|
|
235
|
+
*
|
|
236
|
+
* Creates a new BngProvision record with the specified properties.
|
|
237
|
+
* Returns an ActionBuilder - call .execute() to create or .dryRun() for debugging.
|
|
238
|
+
*
|
|
239
|
+
* @param properties - The properties for the new record
|
|
240
|
+
* @param options - Optional settings
|
|
241
|
+
* @param options.type - Override the record type
|
|
242
|
+
* @param options.journeyId - Associate with a journey
|
|
243
|
+
* @param options.stageKey - Set initial pipeline stage
|
|
244
|
+
* @returns ActionBuilder - call .execute() to create or .dryRun() for payload
|
|
245
|
+
*
|
|
246
|
+
* @example
|
|
247
|
+
* ```typescript
|
|
248
|
+
* // Create with properties
|
|
249
|
+
* const record = odinClient.bngProvisions.new();
|
|
250
|
+
* await record.createBngProvision({ ... }).execute();
|
|
251
|
+
*
|
|
252
|
+
* // Dry run (for debugging)
|
|
253
|
+
* const payload = record.createBngProvision({ ... }).dryRun();
|
|
254
|
+
* ```
|
|
255
|
+
*/
|
|
256
|
+
createBngProvision(properties, options) {
|
|
257
|
+
var _a, _b;
|
|
258
|
+
const payload = {
|
|
259
|
+
entity: 'ServiceModule:BngProvision',
|
|
260
|
+
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,
|
|
261
|
+
actionName: 'CreateBngProvision',
|
|
262
|
+
properties: properties || {},
|
|
263
|
+
associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined,
|
|
264
|
+
journeyId: options === null || options === void 0 ? void 0 : options.journeyId,
|
|
265
|
+
stageKey: options === null || options === void 0 ? void 0 : options.stageKey,
|
|
266
|
+
};
|
|
267
|
+
return new ActionBuilder(this._provider, 'ServiceModule', 'BngProvision', payload, () => { this._pendingLinks = []; });
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
exports.BngProvisionRecord = BngProvisionRecord;
|
|
271
|
+
// ============================================
|
|
272
|
+
// TYPED LINK ACCESSORS
|
|
273
|
+
// ============================================
|
|
274
|
+
/** Valid labels for OrderItem associations */
|
|
275
|
+
BngProvisionRecord.orderItemsLabels = ['OrderItem__BngProvision'];
|
|
276
|
+
/** Type guard to check if an object is a BngProvisionRecord */
|
|
277
|
+
function isBngProvisionRecord(obj) {
|
|
278
|
+
return obj instanceof BngProvisionRecord;
|
|
279
|
+
}
|
|
280
|
+
exports.isBngProvisionRecord = isBngProvisionRecord;
|
|
@@ -42,6 +42,7 @@ import { MoveCaseOutageToSolvedActionProperties } from '../actions-v2/MoveCaseOu
|
|
|
42
42
|
import { MoveCaseToPendingReviewActionProperties } from '../actions-v2/MoveCaseToPendingReviewActionDto';
|
|
43
43
|
import { MoveCaseToSolvedActionProperties } from '../actions-v2/MoveCaseToSolvedActionDto';
|
|
44
44
|
import { RemoveAssignmentFromCaseProperties } from '../actions-v2/RemoveAssignmentFromCaseDto';
|
|
45
|
+
import { UpdateCaseCsatProperties } from '../actions-v2/UpdateCaseCsatDto';
|
|
45
46
|
import { UpdateFormalComplaintProperties } from '../actions-v2/UpdateFormalComplaintDto';
|
|
46
47
|
import { UpdateSentimentProperties } from '../actions-v2/UpdateSentimentDto';
|
|
47
48
|
import { UpdateTagsProperties } from '../actions-v2/UpdateTagsDto';
|
|
@@ -1888,6 +1889,33 @@ export declare class CaseRecord<TProps = CaseProperties> {
|
|
|
1888
1889
|
journeyId?: string;
|
|
1889
1890
|
stageKey?: string;
|
|
1890
1891
|
}): ActionBuilder;
|
|
1892
|
+
/**
|
|
1893
|
+
* UpdateCaseCsat
|
|
1894
|
+
*
|
|
1895
|
+
* Updates this Case record.
|
|
1896
|
+
* Returns an ActionBuilder - call .execute() to update or .dryRun() for debugging.
|
|
1897
|
+
*
|
|
1898
|
+
* @param propertiesOrOptions - Properties to update, or options object
|
|
1899
|
+
* @param options - Optional settings (journeyId, stageKey)
|
|
1900
|
+
* @returns ActionBuilder - call .execute() to update or .dryRun() for payload
|
|
1901
|
+
* @throws Error if called on a new (unsaved) record
|
|
1902
|
+
*
|
|
1903
|
+
* @example
|
|
1904
|
+
* ```typescript
|
|
1905
|
+
* const record = await odinClient.cases.get(id);
|
|
1906
|
+
* await record.updateCaseCsat({ ... }).execute();
|
|
1907
|
+
*
|
|
1908
|
+
* // Dry run (for debugging)
|
|
1909
|
+
* const payload = record.updateCaseCsat({ ... }).dryRun();
|
|
1910
|
+
* ```
|
|
1911
|
+
*/
|
|
1912
|
+
updateCaseCsat(propertiesOrOptions?: UpdateCaseCsatProperties | {
|
|
1913
|
+
journeyId?: string;
|
|
1914
|
+
stageKey?: string;
|
|
1915
|
+
}, options?: {
|
|
1916
|
+
journeyId?: string;
|
|
1917
|
+
stageKey?: string;
|
|
1918
|
+
}): ActionBuilder;
|
|
1891
1919
|
/**
|
|
1892
1920
|
* UpdateFormalComplaint
|
|
1893
1921
|
*
|
|
@@ -2734,6 +2734,43 @@ class CaseRecord {
|
|
|
2734
2734
|
const payload = Object.assign({ id: this._record.id, entity: this._record.entity, type: this._record.type, actionName: 'RemoveAssignmentFromCase', properties, associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined }, opts);
|
|
2735
2735
|
return new ActionBuilder(this._provider, 'SupportModule', 'Case', payload, () => { this._pendingLinks = []; });
|
|
2736
2736
|
}
|
|
2737
|
+
/**
|
|
2738
|
+
* UpdateCaseCsat
|
|
2739
|
+
*
|
|
2740
|
+
* Updates this Case record.
|
|
2741
|
+
* Returns an ActionBuilder - call .execute() to update or .dryRun() for debugging.
|
|
2742
|
+
*
|
|
2743
|
+
* @param propertiesOrOptions - Properties to update, or options object
|
|
2744
|
+
* @param options - Optional settings (journeyId, stageKey)
|
|
2745
|
+
* @returns ActionBuilder - call .execute() to update or .dryRun() for payload
|
|
2746
|
+
* @throws Error if called on a new (unsaved) record
|
|
2747
|
+
*
|
|
2748
|
+
* @example
|
|
2749
|
+
* ```typescript
|
|
2750
|
+
* const record = await odinClient.cases.get(id);
|
|
2751
|
+
* await record.updateCaseCsat({ ... }).execute();
|
|
2752
|
+
*
|
|
2753
|
+
* // Dry run (for debugging)
|
|
2754
|
+
* const payload = record.updateCaseCsat({ ... }).dryRun();
|
|
2755
|
+
* ```
|
|
2756
|
+
*/
|
|
2757
|
+
updateCaseCsat(propertiesOrOptions, options) {
|
|
2758
|
+
var _a;
|
|
2759
|
+
if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
|
|
2760
|
+
throw new Error('updateCaseCsat requires an existing record. Use accessor.get() first.');
|
|
2761
|
+
let properties = {};
|
|
2762
|
+
let opts = options;
|
|
2763
|
+
if (propertiesOrOptions) {
|
|
2764
|
+
if ('journeyId' in propertiesOrOptions || 'stageKey' in propertiesOrOptions) {
|
|
2765
|
+
opts = propertiesOrOptions;
|
|
2766
|
+
}
|
|
2767
|
+
else {
|
|
2768
|
+
properties = propertiesOrOptions;
|
|
2769
|
+
}
|
|
2770
|
+
}
|
|
2771
|
+
const payload = Object.assign({ id: this._record.id, entity: this._record.entity, type: this._record.type, actionName: 'UpdateCaseCsat', properties, associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined }, opts);
|
|
2772
|
+
return new ActionBuilder(this._provider, 'SupportModule', 'Case', payload, () => { this._pendingLinks = []; });
|
|
2773
|
+
}
|
|
2737
2774
|
/**
|
|
2738
2775
|
* UpdateFormalComplaint
|
|
2739
2776
|
*
|
|
@@ -26,6 +26,7 @@ import { CreateRecontractOrderItemProperties } from '../actions-v2/CreateRecontr
|
|
|
26
26
|
import { OrderItemUpdateProperties } from '../actions-v2/OrderItemUpdateDto';
|
|
27
27
|
import { PriceMatchProperties } from '../actions-v2/PriceMatchDto';
|
|
28
28
|
import { ReassociateOrderItemDevicesProperties } from '../actions-v2/ReassociateOrderItemDevicesDto';
|
|
29
|
+
import { BngProvisionRecord } from './BngProvisionRecord';
|
|
29
30
|
import { CustomerDeviceRouterRecord } from './CustomerDeviceRouterRecord';
|
|
30
31
|
import { CustomerDeviceAtaRecord } from './CustomerDeviceAtaRecord';
|
|
31
32
|
import { OrderRecord } from './OrderRecord';
|
|
@@ -102,6 +103,7 @@ export declare class OrderItemRecord<TProps = OrderItemProperties> {
|
|
|
102
103
|
private _provider;
|
|
103
104
|
private _pendingLinks;
|
|
104
105
|
private _preGeneratedId;
|
|
106
|
+
private _bngProvisions?;
|
|
105
107
|
private _customerDeviceRouters?;
|
|
106
108
|
private _customerDeviceAtas?;
|
|
107
109
|
private _orders?;
|
|
@@ -141,6 +143,24 @@ export declare class OrderItemRecord<TProps = OrderItemProperties> {
|
|
|
141
143
|
get groups(): string[];
|
|
142
144
|
/** Access the underlying OdinRecord (null for new records) */
|
|
143
145
|
get record(): OdinRecord<TProps> | null;
|
|
146
|
+
/** Valid labels for BngProvision associations */
|
|
147
|
+
static readonly bngProvisionsLabels: readonly ["OrderItem__BngProvision"];
|
|
148
|
+
/**
|
|
149
|
+
* Access linked BngProvision records
|
|
150
|
+
* @remarks Available labels: OrderItem__BngProvision
|
|
151
|
+
* @throws Error if called on a new (unsaved) record
|
|
152
|
+
*
|
|
153
|
+
* @example
|
|
154
|
+
* ```typescript
|
|
155
|
+
* // Get all linked BngProvision records
|
|
156
|
+
* const items = await record.bngProvisions.list();
|
|
157
|
+
* const first = await record.bngProvisions.first();
|
|
158
|
+
*
|
|
159
|
+
* // Filter by label
|
|
160
|
+
* const specific = await record.bngProvisions.first({ label: 'OrderItem__BngProvision' });
|
|
161
|
+
* ```
|
|
162
|
+
*/
|
|
163
|
+
get bngProvisions(): RecordLinkManager<BngProvisionRecord, typeof OrderItemRecord['bngProvisionsLabels'][number]>;
|
|
144
164
|
/** Valid labels for CustomerDeviceRouter associations */
|
|
145
165
|
static readonly customerDeviceRoutersLabels: readonly ["OrderItem__CustomerDeviceRouter"];
|
|
146
166
|
/**
|
|
@@ -30,6 +30,7 @@ exports.isOrderItemRecord = exports.OrderItemRecord = void 0;
|
|
|
30
30
|
const uuid_1 = require("uuid");
|
|
31
31
|
const core_1 = require("@d19n/odin-types/dist/core");
|
|
32
32
|
const record_link_manager_1 = require("@d19n/odin-sdk-generator/dist/record-link-manager");
|
|
33
|
+
const BngProvisionRecord_1 = require("./BngProvisionRecord");
|
|
33
34
|
const CustomerDeviceRouterRecord_1 = require("./CustomerDeviceRouterRecord");
|
|
34
35
|
const CustomerDeviceAtaRecord_1 = require("./CustomerDeviceAtaRecord");
|
|
35
36
|
const OrderRecord_1 = require("./OrderRecord");
|
|
@@ -153,6 +154,36 @@ class OrderItemRecord {
|
|
|
153
154
|
get groups() { var _a; return ((_a = this._record) === null || _a === void 0 ? void 0 : _a.groups) || []; }
|
|
154
155
|
/** Access the underlying OdinRecord (null for new records) */
|
|
155
156
|
get record() { return this._record; }
|
|
157
|
+
/**
|
|
158
|
+
* Access linked BngProvision records
|
|
159
|
+
* @remarks Available labels: OrderItem__BngProvision
|
|
160
|
+
* @throws Error if called on a new (unsaved) record
|
|
161
|
+
*
|
|
162
|
+
* @example
|
|
163
|
+
* ```typescript
|
|
164
|
+
* // Get all linked BngProvision records
|
|
165
|
+
* const items = await record.bngProvisions.list();
|
|
166
|
+
* const first = await record.bngProvisions.first();
|
|
167
|
+
*
|
|
168
|
+
* // Filter by label
|
|
169
|
+
* const specific = await record.bngProvisions.first({ label: 'OrderItem__BngProvision' });
|
|
170
|
+
* ```
|
|
171
|
+
*/
|
|
172
|
+
get bngProvisions() {
|
|
173
|
+
var _a;
|
|
174
|
+
if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
|
|
175
|
+
throw new Error('Cannot access links on a new (unsaved) record');
|
|
176
|
+
if (!this._bngProvisions) {
|
|
177
|
+
this._bngProvisions = new record_link_manager_1.RecordLinkManager(this._provider, this._record, {
|
|
178
|
+
sourceEntity: 'OrderModule:OrderItem',
|
|
179
|
+
targetEntity: 'ServiceModule:BngProvision',
|
|
180
|
+
targetModuleName: 'ServiceModule',
|
|
181
|
+
targetEntityName: 'BngProvision',
|
|
182
|
+
labels: ['OrderItem__BngProvision'],
|
|
183
|
+
}, BngProvisionRecord_1.BngProvisionRecord);
|
|
184
|
+
}
|
|
185
|
+
return this._bngProvisions;
|
|
186
|
+
}
|
|
156
187
|
/**
|
|
157
188
|
* Access linked CustomerDeviceRouter records
|
|
158
189
|
* @remarks Available labels: OrderItem__CustomerDeviceRouter
|
|
@@ -794,6 +825,8 @@ exports.OrderItemRecord = OrderItemRecord;
|
|
|
794
825
|
// ============================================
|
|
795
826
|
// TYPED LINK ACCESSORS
|
|
796
827
|
// ============================================
|
|
828
|
+
/** Valid labels for BngProvision associations */
|
|
829
|
+
OrderItemRecord.bngProvisionsLabels = ['OrderItem__BngProvision'];
|
|
797
830
|
/** Valid labels for CustomerDeviceRouter associations */
|
|
798
831
|
OrderItemRecord.customerDeviceRoutersLabels = ['OrderItem__CustomerDeviceRouter'];
|
|
799
832
|
/** Valid labels for CustomerDeviceAta associations */
|
|
@@ -6451,6 +6451,106 @@ export declare class WorkOrderRecord<TProps = WorkOrderProperties> {
|
|
|
6451
6451
|
moveInstallWorkOrderFromInProgressToComplete(options?: {
|
|
6452
6452
|
journeyId?: string;
|
|
6453
6453
|
}): ActionBuilder;
|
|
6454
|
+
/**
|
|
6455
|
+
* MoveInstallWorkOrderFromInProgressToPending
|
|
6456
|
+
*
|
|
6457
|
+
* Transitions this WorkOrder record to a new pipeline stage.
|
|
6458
|
+
* Returns an ActionBuilder - call .execute() to transition or .dryRun() for debugging.
|
|
6459
|
+
*
|
|
6460
|
+
* @remarks Transitions to stage: CustomerWorkOrdersStagePending
|
|
6461
|
+
*
|
|
6462
|
+
* @param options - Optional settings
|
|
6463
|
+
* @param options.journeyId - Associate with a journey
|
|
6464
|
+
* @returns ActionBuilder - call .execute() to transition or .dryRun() for payload
|
|
6465
|
+
* @throws Error if called on a new (unsaved) record
|
|
6466
|
+
*
|
|
6467
|
+
* @example
|
|
6468
|
+
* ```typescript
|
|
6469
|
+
* const record = await odinClient.workOrders.get(id);
|
|
6470
|
+
* await record.moveInstallWorkOrderFromInProgressToPending().execute();
|
|
6471
|
+
*
|
|
6472
|
+
* // Dry run (for debugging)
|
|
6473
|
+
* const payload = record.moveInstallWorkOrderFromInProgressToPending().dryRun();
|
|
6474
|
+
* ```
|
|
6475
|
+
*/
|
|
6476
|
+
moveInstallWorkOrderFromInProgressToPending(options?: {
|
|
6477
|
+
journeyId?: string;
|
|
6478
|
+
}): ActionBuilder;
|
|
6479
|
+
/**
|
|
6480
|
+
* MoveInstallWorkOrderFromPendingToInProgress
|
|
6481
|
+
*
|
|
6482
|
+
* Transitions this WorkOrder record to a new pipeline stage.
|
|
6483
|
+
* Returns an ActionBuilder - call .execute() to transition or .dryRun() for debugging.
|
|
6484
|
+
*
|
|
6485
|
+
* @remarks Transitions to stage: WorkOrderStageInProgress
|
|
6486
|
+
*
|
|
6487
|
+
* @param options - Optional settings
|
|
6488
|
+
* @param options.journeyId - Associate with a journey
|
|
6489
|
+
* @returns ActionBuilder - call .execute() to transition or .dryRun() for payload
|
|
6490
|
+
* @throws Error if called on a new (unsaved) record
|
|
6491
|
+
*
|
|
6492
|
+
* @example
|
|
6493
|
+
* ```typescript
|
|
6494
|
+
* const record = await odinClient.workOrders.get(id);
|
|
6495
|
+
* await record.moveInstallWorkOrderFromPendingToInProgress().execute();
|
|
6496
|
+
*
|
|
6497
|
+
* // Dry run (for debugging)
|
|
6498
|
+
* const payload = record.moveInstallWorkOrderFromPendingToInProgress().dryRun();
|
|
6499
|
+
* ```
|
|
6500
|
+
*/
|
|
6501
|
+
moveInstallWorkOrderFromPendingToInProgress(options?: {
|
|
6502
|
+
journeyId?: string;
|
|
6503
|
+
}): ActionBuilder;
|
|
6504
|
+
/**
|
|
6505
|
+
* MoveInstallWorkOrderFromRemediationToInProgress
|
|
6506
|
+
*
|
|
6507
|
+
* Transitions this WorkOrder record to a new pipeline stage.
|
|
6508
|
+
* Returns an ActionBuilder - call .execute() to transition or .dryRun() for debugging.
|
|
6509
|
+
*
|
|
6510
|
+
* @remarks Transitions to stage: WorkOrderStageInProgress
|
|
6511
|
+
*
|
|
6512
|
+
* @param options - Optional settings
|
|
6513
|
+
* @param options.journeyId - Associate with a journey
|
|
6514
|
+
* @returns ActionBuilder - call .execute() to transition or .dryRun() for payload
|
|
6515
|
+
* @throws Error if called on a new (unsaved) record
|
|
6516
|
+
*
|
|
6517
|
+
* @example
|
|
6518
|
+
* ```typescript
|
|
6519
|
+
* const record = await odinClient.workOrders.get(id);
|
|
6520
|
+
* await record.moveInstallWorkOrderFromRemediationToInProgress().execute();
|
|
6521
|
+
*
|
|
6522
|
+
* // Dry run (for debugging)
|
|
6523
|
+
* const payload = record.moveInstallWorkOrderFromRemediationToInProgress().dryRun();
|
|
6524
|
+
* ```
|
|
6525
|
+
*/
|
|
6526
|
+
moveInstallWorkOrderFromRemediationToInProgress(options?: {
|
|
6527
|
+
journeyId?: string;
|
|
6528
|
+
}): ActionBuilder;
|
|
6529
|
+
/**
|
|
6530
|
+
* MoveInstallWorkOrderToCancelled
|
|
6531
|
+
*
|
|
6532
|
+
* Transitions this WorkOrder record to a new pipeline stage.
|
|
6533
|
+
* Returns an ActionBuilder - call .execute() to transition or .dryRun() for debugging.
|
|
6534
|
+
*
|
|
6535
|
+
* @remarks Transitions to stage: WorkOrderStageCancelled
|
|
6536
|
+
*
|
|
6537
|
+
* @param options - Optional settings
|
|
6538
|
+
* @param options.journeyId - Associate with a journey
|
|
6539
|
+
* @returns ActionBuilder - call .execute() to transition or .dryRun() for payload
|
|
6540
|
+
* @throws Error if called on a new (unsaved) record
|
|
6541
|
+
*
|
|
6542
|
+
* @example
|
|
6543
|
+
* ```typescript
|
|
6544
|
+
* const record = await odinClient.workOrders.get(id);
|
|
6545
|
+
* await record.moveInstallWorkOrderToCancelled().execute();
|
|
6546
|
+
*
|
|
6547
|
+
* // Dry run (for debugging)
|
|
6548
|
+
* const payload = record.moveInstallWorkOrderToCancelled().dryRun();
|
|
6549
|
+
* ```
|
|
6550
|
+
*/
|
|
6551
|
+
moveInstallWorkOrderToCancelled(options?: {
|
|
6552
|
+
journeyId?: string;
|
|
6553
|
+
}): ActionBuilder;
|
|
6454
6554
|
/**
|
|
6455
6555
|
* MoveInstallWorkOrderToEnRoute
|
|
6456
6556
|
*
|