@d19n/youfibre-odin-sdk 2.0.270 → 2.0.272
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 +8 -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/YfWifiSurveyAccessor.d.ts +111 -0
- package/dist/accessors-v2/YfWifiSurveyAccessor.js +190 -0
- package/dist/accessors-v2/index.d.ts +1 -0
- package/dist/accessors-v2/index.js +3 -1
- package/dist/actions-v2/CreateAppointmentDto.d.ts +8 -1
- package/dist/actions-v2/CreateConversationDto.d.ts +23 -1
- package/dist/actions-v2/CreateCustomerDeviceBatteryDto.d.ts +103 -1
- package/dist/actions-v2/CreateCustomerDeviceBatteryDto.js +120 -1
- package/dist/actions-v2/CreateMessageDto.d.ts +17 -11
- package/dist/actions-v2/CreateYfWifiSurveyDto.d.ts +118 -0
- package/dist/actions-v2/CreateYfWifiSurveyDto.js +54 -0
- package/dist/actions-v2/UpdateCustomerDeviceBatteryDto.d.ts +183 -0
- package/dist/actions-v2/UpdateCustomerDeviceBatteryDto.js +179 -0
- package/dist/db-accessors-v2/YfWifiSurveyDbAccessor.d.ts +149 -0
- package/dist/db-accessors-v2/YfWifiSurveyDbAccessor.js +227 -0
- package/dist/db-accessors-v2/index.d.ts +1 -0
- package/dist/db-accessors-v2/index.js +3 -1
- package/dist/entities-v2/Order.d.ts +8 -0
- package/dist/entities-v2/Order.js +2 -0
- package/dist/records-v2/ConversationRecord.d.ts +1 -1
- package/dist/records-v2/CustomerDeviceRecord.d.ts +34 -68
- package/dist/records-v2/CustomerDeviceRecord.js +38 -17
- package/dist/records-v2/FileRecord.d.ts +20 -0
- package/dist/records-v2/FileRecord.js +33 -0
- package/dist/records-v2/WorkOrderRecord.d.ts +20 -0
- package/dist/records-v2/WorkOrderRecord.js +33 -0
- package/dist/records-v2/YfWifiSurveyRecord.d.ts +225 -0
- package/dist/records-v2/YfWifiSurveyRecord.js +313 -0
- package/dist/records-v2/index.d.ts +1 -0
- package/dist/records-v2/index.js +5 -2
- package/package.json +1 -1
|
@@ -19,73 +19,17 @@
|
|
|
19
19
|
*/
|
|
20
20
|
import { OdinRecord, OdinRecordLinkDto } from '@d19n/odin-types/dist/core';
|
|
21
21
|
import { PipelineStageEntity } from '@d19n/odin-types/dist/core';
|
|
22
|
-
import { IDbRecordCreateUpdateRes } from '@d19n/odin-types/dist/core/interfaces/v1.db.interfaces';
|
|
23
22
|
import { IOdinProvider } from '@d19n/odin-sdk-generator/dist/odin-sdk-types';
|
|
24
23
|
import { RecordLinkManager } from '@d19n/odin-sdk-generator/dist/record-link-manager';
|
|
25
24
|
import { CustomerDeviceProperties, BatteryCustomerDeviceProperties, TvDeviceCustomerDeviceProperties } from '../entities-v2/CustomerDevice';
|
|
26
25
|
import { CreateCustomerDeviceBatteryProperties } from '../actions-v2/CreateCustomerDeviceBatteryDto';
|
|
26
|
+
import { CreateCustomerDeviceBatteryBuilder } from '../actions-v2/CreateCustomerDeviceBatteryDto';
|
|
27
|
+
import { UpdateCustomerDeviceBatteryProperties } from '../actions-v2/UpdateCustomerDeviceBatteryDto';
|
|
28
|
+
import { UpdateCustomerDeviceBatteryBuilder } from '../actions-v2/UpdateCustomerDeviceBatteryDto';
|
|
27
29
|
import { FieldServiceDispatchedProductRecord } from './FieldServiceDispatchedProductRecord';
|
|
28
30
|
import { OrderItemRecord } from './OrderItemRecord';
|
|
29
31
|
/** Valid entity types for CustomerDevice */
|
|
30
32
|
export declare type CustomerDeviceType = 'BATTERY' | 'DEFAULT' | 'TV_DEVICE';
|
|
31
|
-
/**
|
|
32
|
-
* Builder for action execution with dryRun support
|
|
33
|
-
*
|
|
34
|
-
* Provides a consistent API across all action types:
|
|
35
|
-
* - `.execute()` - Execute the action and return results
|
|
36
|
-
* - `.dryRun()` - Return the payload without executing (for debugging)
|
|
37
|
-
*/
|
|
38
|
-
declare class ActionBuilder<T = IDbRecordCreateUpdateRes[]> {
|
|
39
|
-
private _provider;
|
|
40
|
-
private _moduleName;
|
|
41
|
-
private _entityName;
|
|
42
|
-
private _payload;
|
|
43
|
-
private _clearPendingLinks;
|
|
44
|
-
constructor(provider: IOdinProvider, moduleName: string, entityName: string, payload: Record<string, any>, clearPendingLinks: () => void);
|
|
45
|
-
/**
|
|
46
|
-
* Set an external system identifier for this record.
|
|
47
|
-
* Links the record to a corresponding entry in an external application.
|
|
48
|
-
*
|
|
49
|
-
* @param externalId - The ID in the external system
|
|
50
|
-
* @param externalAppId - The external application identifier
|
|
51
|
-
* @returns this (for chaining)
|
|
52
|
-
*
|
|
53
|
-
* @example
|
|
54
|
-
* ```typescript
|
|
55
|
-
* await record.createOrder({ ... }).withExternalId('SF-123', 'salesforce').execute();
|
|
56
|
-
* ```
|
|
57
|
-
*/
|
|
58
|
-
withExternalId(externalId: string, externalAppId: string): this;
|
|
59
|
-
/**
|
|
60
|
-
* Set security/access groups for this record.
|
|
61
|
-
* Controls which user groups can access the record.
|
|
62
|
-
*
|
|
63
|
-
* @param groups - Array of group names
|
|
64
|
-
* @returns this (for chaining)
|
|
65
|
-
*
|
|
66
|
-
* @example
|
|
67
|
-
* ```typescript
|
|
68
|
-
* await record.createOrder({ ... }).withGroups(['TenantA', 'BillingTeam']).execute();
|
|
69
|
-
* ```
|
|
70
|
-
*/
|
|
71
|
-
withGroups(groups: string[]): this;
|
|
72
|
-
/**
|
|
73
|
-
* Execute the action
|
|
74
|
-
* @returns The result from the API
|
|
75
|
-
*/
|
|
76
|
-
execute(): Promise<T>;
|
|
77
|
-
/**
|
|
78
|
-
* Returns the request payload without executing (for debugging)
|
|
79
|
-
* @returns The request payload that would be sent to the API
|
|
80
|
-
*/
|
|
81
|
-
dryRun(): Record<string, any>;
|
|
82
|
-
/**
|
|
83
|
-
* Prevents accidental `await actionBuilder` without .execute()
|
|
84
|
-
* Forces developers to explicitly call .execute()
|
|
85
|
-
* @throws Error always - use .execute() or .dryRun() instead
|
|
86
|
-
*/
|
|
87
|
-
then(): never;
|
|
88
|
-
}
|
|
89
33
|
export declare class CustomerDeviceRecord<TProps = CustomerDeviceProperties> {
|
|
90
34
|
private _record;
|
|
91
35
|
private _provider;
|
|
@@ -227,7 +171,8 @@ export declare class CustomerDeviceRecord<TProps = CustomerDeviceProperties> {
|
|
|
227
171
|
* CreateCustomerDeviceBattery
|
|
228
172
|
*
|
|
229
173
|
* Creates a new CustomerDevice record with the specified properties.
|
|
230
|
-
* Returns
|
|
174
|
+
* Returns a builder with fluent .link*() methods for associations.
|
|
175
|
+
* Call .execute() to create or .dryRun() for debugging.
|
|
231
176
|
*
|
|
232
177
|
* @remarks Record type: BATTERY
|
|
233
178
|
*
|
|
@@ -235,23 +180,44 @@ export declare class CustomerDeviceRecord<TProps = CustomerDeviceProperties> {
|
|
|
235
180
|
* @param options - Optional settings
|
|
236
181
|
* @param options.journeyId - Associate with a journey
|
|
237
182
|
* @param options.stageKey - Set initial pipeline stage
|
|
238
|
-
* @returns
|
|
183
|
+
* @returns CreateCustomerDeviceBatteryBuilder - chain .link*() then .execute()
|
|
239
184
|
*
|
|
240
185
|
* @example
|
|
241
186
|
* ```typescript
|
|
242
|
-
* // Create with properties
|
|
243
187
|
* const record = odinClient.customerDevices.new();
|
|
244
|
-
* await record.createCustomerDeviceBattery({ ... })
|
|
245
|
-
*
|
|
246
|
-
*
|
|
247
|
-
* const payload = record.createCustomerDeviceBattery({ ... }).dryRun();
|
|
188
|
+
* await record.createCustomerDeviceBattery({ ... })
|
|
189
|
+
* .linkAssociation_xxx(target)
|
|
190
|
+
* .execute();
|
|
248
191
|
* ```
|
|
249
192
|
*/
|
|
250
193
|
createCustomerDeviceBattery(properties?: CreateCustomerDeviceBatteryProperties, options?: {
|
|
251
194
|
journeyId?: string;
|
|
252
195
|
stageKey?: string;
|
|
253
|
-
}):
|
|
196
|
+
}): CreateCustomerDeviceBatteryBuilder;
|
|
197
|
+
/**
|
|
198
|
+
* UpdateCustomerDeviceBattery
|
|
199
|
+
*
|
|
200
|
+
* Updates this CustomerDevice record.
|
|
201
|
+
* Returns a builder with fluent .link*() methods for associations.
|
|
202
|
+
* Call .execute() to update or .dryRun() for debugging.
|
|
203
|
+
*
|
|
204
|
+
* @param properties - Properties to update
|
|
205
|
+
* @param options - Optional settings
|
|
206
|
+
* @returns UpdateCustomerDeviceBatteryBuilder - chain .link*() then .execute()
|
|
207
|
+
* @throws Error if called on a new (unsaved) record
|
|
208
|
+
*
|
|
209
|
+
* @example
|
|
210
|
+
* ```typescript
|
|
211
|
+
* const record = await odinClient.customerDevices.get(id);
|
|
212
|
+
* await record.updateCustomerDeviceBattery({ ... })
|
|
213
|
+
* .linkAssociation_xxx(target)
|
|
214
|
+
* .execute();
|
|
215
|
+
* ```
|
|
216
|
+
*/
|
|
217
|
+
updateCustomerDeviceBattery(properties?: UpdateCustomerDeviceBatteryProperties, options?: {
|
|
218
|
+
journeyId?: string;
|
|
219
|
+
stageKey?: string;
|
|
220
|
+
}): UpdateCustomerDeviceBatteryBuilder;
|
|
254
221
|
}
|
|
255
222
|
/** Type guard to check if an object is a CustomerDeviceRecord */
|
|
256
223
|
export declare function isCustomerDeviceRecord(obj: any): obj is CustomerDeviceRecord;
|
|
257
|
-
export {};
|
|
@@ -32,6 +32,8 @@ exports.isCustomerDeviceRecord = exports.CustomerDeviceRecord = 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 CreateCustomerDeviceBatteryDto_1 = require("../actions-v2/CreateCustomerDeviceBatteryDto");
|
|
36
|
+
const UpdateCustomerDeviceBatteryDto_1 = require("../actions-v2/UpdateCustomerDeviceBatteryDto");
|
|
35
37
|
const FieldServiceDispatchedProductRecord_1 = require("./FieldServiceDispatchedProductRecord");
|
|
36
38
|
const OrderItemRecord_1 = require("./OrderItemRecord");
|
|
37
39
|
/**
|
|
@@ -297,7 +299,8 @@ class CustomerDeviceRecord {
|
|
|
297
299
|
* CreateCustomerDeviceBattery
|
|
298
300
|
*
|
|
299
301
|
* Creates a new CustomerDevice record with the specified properties.
|
|
300
|
-
* Returns
|
|
302
|
+
* Returns a builder with fluent .link*() methods for associations.
|
|
303
|
+
* Call .execute() to create or .dryRun() for debugging.
|
|
301
304
|
*
|
|
302
305
|
* @remarks Record type: BATTERY
|
|
303
306
|
*
|
|
@@ -305,29 +308,47 @@ class CustomerDeviceRecord {
|
|
|
305
308
|
* @param options - Optional settings
|
|
306
309
|
* @param options.journeyId - Associate with a journey
|
|
307
310
|
* @param options.stageKey - Set initial pipeline stage
|
|
308
|
-
* @returns
|
|
311
|
+
* @returns CreateCustomerDeviceBatteryBuilder - chain .link*() then .execute()
|
|
309
312
|
*
|
|
310
313
|
* @example
|
|
311
314
|
* ```typescript
|
|
312
|
-
* // Create with properties
|
|
313
315
|
* const record = odinClient.customerDevices.new();
|
|
314
|
-
* await record.createCustomerDeviceBattery({ ... })
|
|
315
|
-
*
|
|
316
|
-
*
|
|
317
|
-
* const payload = record.createCustomerDeviceBattery({ ... }).dryRun();
|
|
316
|
+
* await record.createCustomerDeviceBattery({ ... })
|
|
317
|
+
* .linkAssociation_xxx(target)
|
|
318
|
+
* .execute();
|
|
318
319
|
* ```
|
|
319
320
|
*/
|
|
320
321
|
createCustomerDeviceBattery(properties, options) {
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
322
|
+
return new CreateCustomerDeviceBatteryDto_1.CreateCustomerDeviceBatteryBuilder(properties || {}, [...this._pendingLinks], options).withProvider(this._provider, 'ServiceModule', 'CustomerDevice', () => { this._pendingLinks = []; });
|
|
323
|
+
}
|
|
324
|
+
// ============================================
|
|
325
|
+
// UPDATE ACTIONS (require existing record)
|
|
326
|
+
// ============================================
|
|
327
|
+
/**
|
|
328
|
+
* UpdateCustomerDeviceBattery
|
|
329
|
+
*
|
|
330
|
+
* Updates this CustomerDevice record.
|
|
331
|
+
* Returns a builder with fluent .link*() methods for associations.
|
|
332
|
+
* Call .execute() to update or .dryRun() for debugging.
|
|
333
|
+
*
|
|
334
|
+
* @param properties - Properties to update
|
|
335
|
+
* @param options - Optional settings
|
|
336
|
+
* @returns UpdateCustomerDeviceBatteryBuilder - chain .link*() then .execute()
|
|
337
|
+
* @throws Error if called on a new (unsaved) record
|
|
338
|
+
*
|
|
339
|
+
* @example
|
|
340
|
+
* ```typescript
|
|
341
|
+
* const record = await odinClient.customerDevices.get(id);
|
|
342
|
+
* await record.updateCustomerDeviceBattery({ ... })
|
|
343
|
+
* .linkAssociation_xxx(target)
|
|
344
|
+
* .execute();
|
|
345
|
+
* ```
|
|
346
|
+
*/
|
|
347
|
+
updateCustomerDeviceBattery(properties, options) {
|
|
348
|
+
var _a;
|
|
349
|
+
if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
|
|
350
|
+
throw new Error('updateCustomerDeviceBattery requires an existing record. Use accessor.get() first.');
|
|
351
|
+
return new UpdateCustomerDeviceBatteryDto_1.UpdateCustomerDeviceBatteryBuilder({ id: this._record.id, entity: this._record.entity, type: this._record.type }, properties || {}, [...this._pendingLinks], options).withProvider(this._provider, 'ServiceModule', 'CustomerDevice', () => { this._pendingLinks = []; });
|
|
331
352
|
}
|
|
332
353
|
}
|
|
333
354
|
exports.CustomerDeviceRecord = CustomerDeviceRecord;
|
|
@@ -63,6 +63,7 @@ import { ContactRecord } from './ContactRecord';
|
|
|
63
63
|
import { MessageRecord } from './MessageRecord';
|
|
64
64
|
import { EmailRecord } from './EmailRecord';
|
|
65
65
|
import { PgDirectDebitFileRecord } from './PgDirectDebitFileRecord';
|
|
66
|
+
import { YfWifiSurveyRecord } from './YfWifiSurveyRecord';
|
|
66
67
|
/** Valid entity types for File */
|
|
67
68
|
export declare type FileType = 'AFP_INVOICE' | 'CBO_FINAL_BILL' | 'CSV' | 'DEFAULT' | 'EMAIL' | 'INVOICE' | 'NA_PROBLEM_EVIDENCE' | 'NA_SOLUTION_EVIDENCE' | 'OPENREACH_A55' | 'OTDR';
|
|
68
69
|
/**
|
|
@@ -167,6 +168,7 @@ export declare class FileRecord<TProps = FileProperties> {
|
|
|
167
168
|
private _messages?;
|
|
168
169
|
private _emails?;
|
|
169
170
|
private _pgDirectDebitFiles?;
|
|
171
|
+
private _yfWifiSurveys?;
|
|
170
172
|
/**
|
|
171
173
|
* Create a record wrapper.
|
|
172
174
|
* @param record - The underlying record, or null for create operations
|
|
@@ -1054,6 +1056,24 @@ export declare class FileRecord<TProps = FileProperties> {
|
|
|
1054
1056
|
* ```
|
|
1055
1057
|
*/
|
|
1056
1058
|
get pgDirectDebitFiles(): RecordLinkManager<PgDirectDebitFileRecord, typeof FileRecord['pgDirectDebitFilesLabels'][number]>;
|
|
1059
|
+
/** Valid labels for YfWifiSurvey associations */
|
|
1060
|
+
static readonly yfWifiSurveysLabels: readonly ["YfWifiSurvey__File"];
|
|
1061
|
+
/**
|
|
1062
|
+
* Access linked YfWifiSurvey records
|
|
1063
|
+
* @remarks Available labels: YfWifiSurvey__File
|
|
1064
|
+
* @throws Error if called on a new (unsaved) record
|
|
1065
|
+
*
|
|
1066
|
+
* @example
|
|
1067
|
+
* ```typescript
|
|
1068
|
+
* // Get all linked YfWifiSurvey records
|
|
1069
|
+
* const items = await record.yfWifiSurveys.list();
|
|
1070
|
+
* const first = await record.yfWifiSurveys.first();
|
|
1071
|
+
*
|
|
1072
|
+
* // Filter by label
|
|
1073
|
+
* const specific = await record.yfWifiSurveys.first({ label: 'YfWifiSurvey__File' });
|
|
1074
|
+
* ```
|
|
1075
|
+
*/
|
|
1076
|
+
get yfWifiSurveys(): RecordLinkManager<YfWifiSurveyRecord, typeof FileRecord['yfWifiSurveysLabels'][number]>;
|
|
1057
1077
|
/**
|
|
1058
1078
|
* Queue a link to be created with the next action.
|
|
1059
1079
|
* Works for both create and update actions.
|
|
@@ -71,6 +71,7 @@ const ContactRecord_1 = require("./ContactRecord");
|
|
|
71
71
|
const MessageRecord_1 = require("./MessageRecord");
|
|
72
72
|
const EmailRecord_1 = require("./EmailRecord");
|
|
73
73
|
const PgDirectDebitFileRecord_1 = require("./PgDirectDebitFileRecord");
|
|
74
|
+
const YfWifiSurveyRecord_1 = require("./YfWifiSurveyRecord");
|
|
74
75
|
/**
|
|
75
76
|
* Builder for action execution with dryRun support
|
|
76
77
|
*
|
|
@@ -1514,6 +1515,36 @@ class FileRecord {
|
|
|
1514
1515
|
}
|
|
1515
1516
|
return this._pgDirectDebitFiles;
|
|
1516
1517
|
}
|
|
1518
|
+
/**
|
|
1519
|
+
* Access linked YfWifiSurvey records
|
|
1520
|
+
* @remarks Available labels: YfWifiSurvey__File
|
|
1521
|
+
* @throws Error if called on a new (unsaved) record
|
|
1522
|
+
*
|
|
1523
|
+
* @example
|
|
1524
|
+
* ```typescript
|
|
1525
|
+
* // Get all linked YfWifiSurvey records
|
|
1526
|
+
* const items = await record.yfWifiSurveys.list();
|
|
1527
|
+
* const first = await record.yfWifiSurveys.first();
|
|
1528
|
+
*
|
|
1529
|
+
* // Filter by label
|
|
1530
|
+
* const specific = await record.yfWifiSurveys.first({ label: 'YfWifiSurvey__File' });
|
|
1531
|
+
* ```
|
|
1532
|
+
*/
|
|
1533
|
+
get yfWifiSurveys() {
|
|
1534
|
+
var _a;
|
|
1535
|
+
if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
|
|
1536
|
+
throw new Error('Cannot access links on a new (unsaved) record');
|
|
1537
|
+
if (!this._yfWifiSurveys) {
|
|
1538
|
+
this._yfWifiSurveys = new record_link_manager_1.RecordLinkManager(this._provider, this._record, {
|
|
1539
|
+
sourceEntity: 'SchemaModule:File',
|
|
1540
|
+
targetEntity: 'FieldServiceModule:YfWifiSurvey',
|
|
1541
|
+
targetModuleName: 'FieldServiceModule',
|
|
1542
|
+
targetEntityName: 'YfWifiSurvey',
|
|
1543
|
+
labels: ['YfWifiSurvey__File'],
|
|
1544
|
+
}, YfWifiSurveyRecord_1.YfWifiSurveyRecord);
|
|
1545
|
+
}
|
|
1546
|
+
return this._yfWifiSurveys;
|
|
1547
|
+
}
|
|
1517
1548
|
// ============================================
|
|
1518
1549
|
// LINK MANAGEMENT
|
|
1519
1550
|
// ============================================
|
|
@@ -1671,6 +1702,8 @@ FileRecord.messagesLabels = ['Message_File'];
|
|
|
1671
1702
|
FileRecord.emailsLabels = ['Attachments'];
|
|
1672
1703
|
/** Valid labels for PgDirectDebitFile associations */
|
|
1673
1704
|
FileRecord.pgDirectDebitFilesLabels = ['PgDirectDebitFile__File'];
|
|
1705
|
+
/** Valid labels for YfWifiSurvey associations */
|
|
1706
|
+
FileRecord.yfWifiSurveysLabels = ['YfWifiSurvey__File'];
|
|
1674
1707
|
/** Type guard to check if an object is a FileRecord */
|
|
1675
1708
|
function isFileRecord(obj) {
|
|
1676
1709
|
return obj instanceof FileRecord;
|
|
@@ -129,6 +129,7 @@ import { WayleaveAuditRecord } from './WayleaveAuditRecord';
|
|
|
129
129
|
import { SiteSpecificRiskAssessmentOutcomeFormRecord } from './SiteSpecificRiskAssessmentOutcomeFormRecord';
|
|
130
130
|
import { DataIssueRecord } from './DataIssueRecord';
|
|
131
131
|
import { OrderRecord } from './OrderRecord';
|
|
132
|
+
import { YfWifiSurveyRecord } from './YfWifiSurveyRecord';
|
|
132
133
|
/** Valid entity types for WorkOrder */
|
|
133
134
|
export declare type WorkOrderType = 'COLLECTION' | 'COLLECTION_AMCO' | 'DISPATCH_AMCO' | 'FINANCE' | 'INSPECTION' | 'INSTALL' | 'INSTALL_BUSINESS' | 'INSTALL_SERVICE' | 'NETWORK_ADJUSTMENT' | 'PLANNING' | 'PRE_PULL' | 'REMEDIATION' | 'REPLACEMENT_AMCO' | 'SERVICE' | 'WAYLEAVE';
|
|
134
135
|
/**
|
|
@@ -2565,6 +2566,7 @@ export declare class WorkOrderRecord<TProps = WorkOrderProperties> {
|
|
|
2565
2566
|
private _siteSpecificRiskAssessmentOutcomeForms?;
|
|
2566
2567
|
private _dataIssues?;
|
|
2567
2568
|
private _orders?;
|
|
2569
|
+
private _yfWifiSurveys?;
|
|
2568
2570
|
/**
|
|
2569
2571
|
* Create a record wrapper.
|
|
2570
2572
|
* @param record - The underlying record, or null for create operations
|
|
@@ -3496,6 +3498,24 @@ export declare class WorkOrderRecord<TProps = WorkOrderProperties> {
|
|
|
3496
3498
|
* ```
|
|
3497
3499
|
*/
|
|
3498
3500
|
get orders(): RecordLinkManager<OrderRecord, typeof WorkOrderRecord['ordersLabels'][number]>;
|
|
3501
|
+
/** Valid labels for YfWifiSurvey associations */
|
|
3502
|
+
static readonly yfWifiSurveysLabels: readonly ["WorkOrder__YfWifiSurvey"];
|
|
3503
|
+
/**
|
|
3504
|
+
* Access linked YfWifiSurvey records
|
|
3505
|
+
* @remarks Available labels: WorkOrder__YfWifiSurvey
|
|
3506
|
+
* @throws Error if called on a new (unsaved) record
|
|
3507
|
+
*
|
|
3508
|
+
* @example
|
|
3509
|
+
* ```typescript
|
|
3510
|
+
* // Get all linked YfWifiSurvey records
|
|
3511
|
+
* const items = await record.yfWifiSurveys.list();
|
|
3512
|
+
* const first = await record.yfWifiSurveys.first();
|
|
3513
|
+
*
|
|
3514
|
+
* // Filter by label
|
|
3515
|
+
* const specific = await record.yfWifiSurveys.first({ label: 'WorkOrder__YfWifiSurvey' });
|
|
3516
|
+
* ```
|
|
3517
|
+
*/
|
|
3518
|
+
get yfWifiSurveys(): RecordLinkManager<YfWifiSurveyRecord, typeof WorkOrderRecord['yfWifiSurveysLabels'][number]>;
|
|
3499
3519
|
/**
|
|
3500
3520
|
* Queue a link to be created with the next action.
|
|
3501
3521
|
* Works for both create and update actions.
|
|
@@ -69,6 +69,7 @@ const WayleaveAuditRecord_1 = require("./WayleaveAuditRecord");
|
|
|
69
69
|
const SiteSpecificRiskAssessmentOutcomeFormRecord_1 = require("./SiteSpecificRiskAssessmentOutcomeFormRecord");
|
|
70
70
|
const DataIssueRecord_1 = require("./DataIssueRecord");
|
|
71
71
|
const OrderRecord_1 = require("./OrderRecord");
|
|
72
|
+
const YfWifiSurveyRecord_1 = require("./YfWifiSurveyRecord");
|
|
72
73
|
/**
|
|
73
74
|
* Builder for action execution with dryRun support
|
|
74
75
|
*
|
|
@@ -5619,6 +5620,36 @@ class WorkOrderRecord {
|
|
|
5619
5620
|
}
|
|
5620
5621
|
return this._orders;
|
|
5621
5622
|
}
|
|
5623
|
+
/**
|
|
5624
|
+
* Access linked YfWifiSurvey records
|
|
5625
|
+
* @remarks Available labels: WorkOrder__YfWifiSurvey
|
|
5626
|
+
* @throws Error if called on a new (unsaved) record
|
|
5627
|
+
*
|
|
5628
|
+
* @example
|
|
5629
|
+
* ```typescript
|
|
5630
|
+
* // Get all linked YfWifiSurvey records
|
|
5631
|
+
* const items = await record.yfWifiSurveys.list();
|
|
5632
|
+
* const first = await record.yfWifiSurveys.first();
|
|
5633
|
+
*
|
|
5634
|
+
* // Filter by label
|
|
5635
|
+
* const specific = await record.yfWifiSurveys.first({ label: 'WorkOrder__YfWifiSurvey' });
|
|
5636
|
+
* ```
|
|
5637
|
+
*/
|
|
5638
|
+
get yfWifiSurveys() {
|
|
5639
|
+
var _a;
|
|
5640
|
+
if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
|
|
5641
|
+
throw new Error('Cannot access links on a new (unsaved) record');
|
|
5642
|
+
if (!this._yfWifiSurveys) {
|
|
5643
|
+
this._yfWifiSurveys = new record_link_manager_1.RecordLinkManager(this._provider, this._record, {
|
|
5644
|
+
sourceEntity: 'FieldServiceModule:WorkOrder',
|
|
5645
|
+
targetEntity: 'FieldServiceModule:YfWifiSurvey',
|
|
5646
|
+
targetModuleName: 'FieldServiceModule',
|
|
5647
|
+
targetEntityName: 'YfWifiSurvey',
|
|
5648
|
+
labels: ['WorkOrder__YfWifiSurvey'],
|
|
5649
|
+
}, YfWifiSurveyRecord_1.YfWifiSurveyRecord);
|
|
5650
|
+
}
|
|
5651
|
+
return this._yfWifiSurveys;
|
|
5652
|
+
}
|
|
5622
5653
|
// ============================================
|
|
5623
5654
|
// LINK MANAGEMENT
|
|
5624
5655
|
// ============================================
|
|
@@ -10944,6 +10975,8 @@ WorkOrderRecord.siteSpecificRiskAssessmentOutcomeFormsLabels = ['WorkOrder__Site
|
|
|
10944
10975
|
WorkOrderRecord.dataIssuesLabels = ['DataIssue__WorkOrder'];
|
|
10945
10976
|
/** Valid labels for Order associations */
|
|
10946
10977
|
WorkOrderRecord.ordersLabels = ['Order__WorkOrder'];
|
|
10978
|
+
/** Valid labels for YfWifiSurvey associations */
|
|
10979
|
+
WorkOrderRecord.yfWifiSurveysLabels = ['WorkOrder__YfWifiSurvey'];
|
|
10947
10980
|
/** Type guard to check if an object is a WorkOrderRecord */
|
|
10948
10981
|
function isWorkOrderRecord(obj) {
|
|
10949
10982
|
return obj instanceof WorkOrderRecord;
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* YfWifiSurvey Record Wrapper
|
|
3
|
+
*
|
|
4
|
+
* Provides typed action methods and link management.
|
|
5
|
+
* Works with both ApiProvider and DbProvider.
|
|
6
|
+
*
|
|
7
|
+
* All action methods return an ActionBuilder or FlowBuilder.
|
|
8
|
+
* Call .execute() to run or .dryRun() to get the payload for debugging.
|
|
9
|
+
*
|
|
10
|
+
* Can be instantiated with null record for create operations:
|
|
11
|
+
* ```typescript
|
|
12
|
+
* const record = odinClient.yfWifiSurveys.new();
|
|
13
|
+
* await record.createYfWifiSurvey({ ... }).execute();
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* Entity Types: DEFAULT
|
|
17
|
+
*
|
|
18
|
+
* AUTO-GENERATED - DO NOT EDIT DIRECTLY
|
|
19
|
+
*/
|
|
20
|
+
import { OdinRecord, OdinRecordLinkDto } from '@d19n/odin-types/dist/core';
|
|
21
|
+
import { PipelineStageEntity } from '@d19n/odin-types/dist/core';
|
|
22
|
+
import { IDbRecordCreateUpdateRes } from '@d19n/odin-types/dist/core/interfaces/v1.db.interfaces';
|
|
23
|
+
import { IOdinProvider } from '@d19n/odin-sdk-generator/dist/odin-sdk-types';
|
|
24
|
+
import { RecordLinkManager } from '@d19n/odin-sdk-generator/dist/record-link-manager';
|
|
25
|
+
import { YfWifiSurveyProperties } from '../entities-v2/YfWifiSurvey';
|
|
26
|
+
import { CreateYfWifiSurveyProperties } from '../actions-v2/CreateYfWifiSurveyDto';
|
|
27
|
+
import { WorkOrderRecord } from './WorkOrderRecord';
|
|
28
|
+
import { FileRecord } from './FileRecord';
|
|
29
|
+
/** Valid entity types for YfWifiSurvey */
|
|
30
|
+
export declare type YfWifiSurveyType = 'DEFAULT';
|
|
31
|
+
/**
|
|
32
|
+
* Builder for action execution with dryRun support
|
|
33
|
+
*
|
|
34
|
+
* Provides a consistent API across all action types:
|
|
35
|
+
* - `.execute()` - Execute the action and return results
|
|
36
|
+
* - `.dryRun()` - Return the payload without executing (for debugging)
|
|
37
|
+
*/
|
|
38
|
+
declare class ActionBuilder<T = IDbRecordCreateUpdateRes[]> {
|
|
39
|
+
private _provider;
|
|
40
|
+
private _moduleName;
|
|
41
|
+
private _entityName;
|
|
42
|
+
private _payload;
|
|
43
|
+
private _clearPendingLinks;
|
|
44
|
+
constructor(provider: IOdinProvider, moduleName: string, entityName: string, payload: Record<string, any>, clearPendingLinks: () => void);
|
|
45
|
+
/**
|
|
46
|
+
* Set an external system identifier for this record.
|
|
47
|
+
* Links the record to a corresponding entry in an external application.
|
|
48
|
+
*
|
|
49
|
+
* @param externalId - The ID in the external system
|
|
50
|
+
* @param externalAppId - The external application identifier
|
|
51
|
+
* @returns this (for chaining)
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```typescript
|
|
55
|
+
* await record.createOrder({ ... }).withExternalId('SF-123', 'salesforce').execute();
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
withExternalId(externalId: string, externalAppId: string): this;
|
|
59
|
+
/**
|
|
60
|
+
* Set security/access groups for this record.
|
|
61
|
+
* Controls which user groups can access the record.
|
|
62
|
+
*
|
|
63
|
+
* @param groups - Array of group names
|
|
64
|
+
* @returns this (for chaining)
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```typescript
|
|
68
|
+
* await record.createOrder({ ... }).withGroups(['TenantA', 'BillingTeam']).execute();
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
withGroups(groups: string[]): this;
|
|
72
|
+
/**
|
|
73
|
+
* Execute the action
|
|
74
|
+
* @returns The result from the API
|
|
75
|
+
*/
|
|
76
|
+
execute(): Promise<T>;
|
|
77
|
+
/**
|
|
78
|
+
* Returns the request payload without executing (for debugging)
|
|
79
|
+
* @returns The request payload that would be sent to the API
|
|
80
|
+
*/
|
|
81
|
+
dryRun(): Record<string, any>;
|
|
82
|
+
/**
|
|
83
|
+
* Prevents accidental `await actionBuilder` without .execute()
|
|
84
|
+
* Forces developers to explicitly call .execute()
|
|
85
|
+
* @throws Error always - use .execute() or .dryRun() instead
|
|
86
|
+
*/
|
|
87
|
+
then(): never;
|
|
88
|
+
}
|
|
89
|
+
export declare class YfWifiSurveyRecord<TProps = YfWifiSurveyProperties> {
|
|
90
|
+
private _record;
|
|
91
|
+
private _provider;
|
|
92
|
+
private _pendingLinks;
|
|
93
|
+
private _preGeneratedId;
|
|
94
|
+
private _workOrders?;
|
|
95
|
+
private _files?;
|
|
96
|
+
/**
|
|
97
|
+
* Create a record wrapper.
|
|
98
|
+
* @param record - The underlying record, or null for create operations
|
|
99
|
+
* @param provider - The API or DB provider
|
|
100
|
+
* @param preGeneratedId - Optional pre-generated ID for new records (auto-generated if not provided)
|
|
101
|
+
*/
|
|
102
|
+
constructor(record: OdinRecord<TProps> | null, provider: IOdinProvider, preGeneratedId?: string);
|
|
103
|
+
/** Returns true if this is a new (unsaved) record */
|
|
104
|
+
get isNew(): boolean;
|
|
105
|
+
/** Record ID - always available (pre-generated for new records) */
|
|
106
|
+
get id(): string;
|
|
107
|
+
get entity(): string;
|
|
108
|
+
get type(): YfWifiSurveyType | undefined;
|
|
109
|
+
/** Record properties - empty object for new (unsaved) records */
|
|
110
|
+
get properties(): TProps;
|
|
111
|
+
get title(): string | undefined;
|
|
112
|
+
get recordNumber(): string | undefined;
|
|
113
|
+
get stage(): PipelineStageEntity | undefined;
|
|
114
|
+
get createdAt(): string | undefined;
|
|
115
|
+
get updatedAt(): string | undefined;
|
|
116
|
+
get externalId(): string | undefined;
|
|
117
|
+
get externalAppId(): string | undefined;
|
|
118
|
+
get groups(): string[];
|
|
119
|
+
/** Access the underlying OdinRecord (null for new records) */
|
|
120
|
+
get record(): OdinRecord<TProps> | null;
|
|
121
|
+
/**
|
|
122
|
+
* Type guard: check if this record is of type DEFAULT
|
|
123
|
+
*
|
|
124
|
+
* When this returns true, TypeScript automatically narrows the type,
|
|
125
|
+
* giving you access to DEFAULT-specific properties.
|
|
126
|
+
*
|
|
127
|
+
* @example
|
|
128
|
+
* ```typescript
|
|
129
|
+
* if (record.isDefault()) {
|
|
130
|
+
* // TypeScript knows record.properties is YfWifiSurveyProperties
|
|
131
|
+
* console.log(record.properties.SomeTypeSpecificField);
|
|
132
|
+
* }
|
|
133
|
+
* ```
|
|
134
|
+
* @remarks This is the default record type
|
|
135
|
+
*/
|
|
136
|
+
isDefault(): this is YfWifiSurveyRecord<YfWifiSurveyProperties>;
|
|
137
|
+
/** Valid labels for WorkOrder associations */
|
|
138
|
+
static readonly workOrdersLabels: readonly ["WorkOrder__YfWifiSurvey"];
|
|
139
|
+
/**
|
|
140
|
+
* Access linked WorkOrder records
|
|
141
|
+
* @remarks Available labels: WorkOrder__YfWifiSurvey
|
|
142
|
+
* @throws Error if called on a new (unsaved) record
|
|
143
|
+
*
|
|
144
|
+
* @example
|
|
145
|
+
* ```typescript
|
|
146
|
+
* // Get all linked WorkOrder records
|
|
147
|
+
* const items = await record.workOrders.list();
|
|
148
|
+
* const first = await record.workOrders.first();
|
|
149
|
+
*
|
|
150
|
+
* // Filter by label
|
|
151
|
+
* const specific = await record.workOrders.first({ label: 'WorkOrder__YfWifiSurvey' });
|
|
152
|
+
* ```
|
|
153
|
+
*/
|
|
154
|
+
get workOrders(): RecordLinkManager<WorkOrderRecord, typeof YfWifiSurveyRecord['workOrdersLabels'][number]>;
|
|
155
|
+
/** Valid labels for File associations */
|
|
156
|
+
static readonly filesLabels: readonly ["YfWifiSurvey__File"];
|
|
157
|
+
/**
|
|
158
|
+
* Access linked File records
|
|
159
|
+
* @remarks Available labels: YfWifiSurvey__File
|
|
160
|
+
* @throws Error if called on a new (unsaved) record
|
|
161
|
+
*
|
|
162
|
+
* @example
|
|
163
|
+
* ```typescript
|
|
164
|
+
* // Get all linked File records
|
|
165
|
+
* const items = await record.files.list();
|
|
166
|
+
* const first = await record.files.first();
|
|
167
|
+
*
|
|
168
|
+
* // Filter by label
|
|
169
|
+
* const specific = await record.files.first({ label: 'YfWifiSurvey__File' });
|
|
170
|
+
* ```
|
|
171
|
+
*/
|
|
172
|
+
get files(): RecordLinkManager<FileRecord, typeof YfWifiSurveyRecord['filesLabels'][number]>;
|
|
173
|
+
/**
|
|
174
|
+
* Queue a link to be created with the next action.
|
|
175
|
+
* Works for both create and update actions.
|
|
176
|
+
* @returns this (for chaining)
|
|
177
|
+
*/
|
|
178
|
+
link(target: OdinRecord<any> | {
|
|
179
|
+
id: string;
|
|
180
|
+
entity: string;
|
|
181
|
+
}): this;
|
|
182
|
+
/** Get the currently queued links */
|
|
183
|
+
get pendingLinks(): OdinRecordLinkDto[];
|
|
184
|
+
/** Clear pending links without executing an action */
|
|
185
|
+
clearPendingLinks(): this;
|
|
186
|
+
/**
|
|
187
|
+
* Immediately unlink a record (API call).
|
|
188
|
+
* Unlike link(), this executes immediately.
|
|
189
|
+
* @throws Error if called on a new (unsaved) record
|
|
190
|
+
*/
|
|
191
|
+
unlink(target: OdinRecord<any> | {
|
|
192
|
+
id: string;
|
|
193
|
+
} | string): Promise<void>;
|
|
194
|
+
/**
|
|
195
|
+
* CreateYfWifiSurvey
|
|
196
|
+
*
|
|
197
|
+
* Creates a new YfWifiSurvey record with the specified properties.
|
|
198
|
+
* Returns an ActionBuilder - call .execute() to create or .dryRun() for debugging.
|
|
199
|
+
*
|
|
200
|
+
* @param properties - The properties for the new record
|
|
201
|
+
* @param options - Optional settings
|
|
202
|
+
* @param options.type - Override the record type
|
|
203
|
+
* @param options.journeyId - Associate with a journey
|
|
204
|
+
* @param options.stageKey - Set initial pipeline stage
|
|
205
|
+
* @returns ActionBuilder - call .execute() to create or .dryRun() for payload
|
|
206
|
+
*
|
|
207
|
+
* @example
|
|
208
|
+
* ```typescript
|
|
209
|
+
* // Create with properties
|
|
210
|
+
* const record = odinClient.yfWifiSurveys.new();
|
|
211
|
+
* await record.createYfWifiSurvey({ ... }).execute();
|
|
212
|
+
*
|
|
213
|
+
* // Dry run (for debugging)
|
|
214
|
+
* const payload = record.createYfWifiSurvey({ ... }).dryRun();
|
|
215
|
+
* ```
|
|
216
|
+
*/
|
|
217
|
+
createYfWifiSurvey(properties: CreateYfWifiSurveyProperties, options?: {
|
|
218
|
+
type?: string;
|
|
219
|
+
journeyId?: string;
|
|
220
|
+
stageKey?: string;
|
|
221
|
+
}): ActionBuilder;
|
|
222
|
+
}
|
|
223
|
+
/** Type guard to check if an object is a YfWifiSurveyRecord */
|
|
224
|
+
export declare function isYfWifiSurveyRecord(obj: any): obj is YfWifiSurveyRecord;
|
|
225
|
+
export {};
|