@d19n/youfibre-odin-sdk 2.0.13-beta.1 → 2.0.13
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 +11 -10
- package/dist/actions-v2/CreateOrderFromBrskDto.d.ts +75 -0
- package/dist/actions-v2/CreateOrderItemFromBrskDto.d.ts +191 -0
- package/dist/actions-v2/CreateOrderItemFromBrskDto.js +52 -0
- package/dist/entities-v2/Order.d.ts +7 -0
- package/dist/entities-v2/Order.js +2 -0
- package/dist/entities-v2/OrderItem.d.ts +7 -0
- package/dist/entities-v2/OrderItem.js +2 -0
- package/dist/entities-v2/Product.d.ts +0 -42
- package/dist/entities-v2/Product.js +0 -2
- package/dist/records-v2/AccountCreditRecord.d.ts +62 -1
- package/dist/records-v2/AccountCreditRecord.js +91 -0
- package/dist/records-v2/AccountRecord.d.ts +306 -2
- package/dist/records-v2/AccountRecord.js +451 -0
- package/dist/records-v2/ActivityLogRecord.d.ts +122 -1
- package/dist/records-v2/ActivityLogRecord.js +190 -0
- package/dist/records-v2/ActivityRecord.d.ts +255 -2
- package/dist/records-v2/ActivityRecord.js +387 -0
- package/dist/records-v2/AddressRecord.d.ts +321 -0
- package/dist/records-v2/AddressRecord.js +532 -0
- package/dist/records-v2/AffiliateCodeRecord.d.ts +102 -1
- package/dist/records-v2/AffiliateCodeRecord.js +157 -0
- package/dist/records-v2/AppointmentRecord.d.ts +141 -0
- package/dist/records-v2/AppointmentRecord.js +235 -0
- package/dist/records-v2/BillingAdjustmentRecord.d.ts +81 -0
- package/dist/records-v2/BillingAdjustmentRecord.js +136 -0
- package/dist/records-v2/BillingRequestRecord.d.ts +178 -2
- package/dist/records-v2/BillingRequestRecord.js +271 -0
- package/dist/records-v2/BlockageA55Record.d.ts +103 -2
- package/dist/records-v2/BlockageA55Record.js +157 -0
- package/dist/records-v2/BrskEntityMigrationErrorRecord.d.ts +21 -1
- package/dist/records-v2/BrskEntityMigrationErrorRecord.js +21 -0
- package/dist/records-v2/CallEventRecord.d.ts +82 -1
- package/dist/records-v2/CallEventRecord.js +124 -0
- package/dist/records-v2/CallLegRecord.d.ts +82 -1
- package/dist/records-v2/CallLegRecord.js +124 -0
- package/dist/records-v2/CallRecord.d.ts +202 -1
- package/dist/records-v2/CallRecord.js +322 -0
- package/dist/records-v2/CallTransferRecord.d.ts +102 -1
- package/dist/records-v2/CallTransferRecord.js +157 -0
- package/dist/records-v2/CampaignRecord.d.ts +83 -2
- package/dist/records-v2/CampaignRecord.js +124 -0
- package/dist/records-v2/CaseRecord.d.ts +418 -2
- package/dist/records-v2/CaseRecord.js +667 -0
- package/dist/records-v2/ChangeReasonRecord.d.ts +171 -2
- package/dist/records-v2/ChangeReasonRecord.js +238 -0
- package/dist/records-v2/ChurnRequestRecord.d.ts +62 -1
- package/dist/records-v2/ChurnRequestRecord.js +91 -0
- package/dist/records-v2/ContactRecord.d.ts +560 -0
- package/dist/records-v2/ContactRecord.js +927 -0
- package/dist/records-v2/ContractBuyOutRecord.d.ts +162 -1
- package/dist/records-v2/ContractBuyOutRecord.js +256 -0
- package/dist/records-v2/ConversationFeedbackRecord.d.ts +102 -1
- package/dist/records-v2/ConversationFeedbackRecord.js +157 -0
- package/dist/records-v2/ConversationRecord.d.ts +102 -1
- package/dist/records-v2/ConversationRecord.js +157 -0
- package/dist/records-v2/CreditNoteRecord.d.ts +81 -0
- package/dist/records-v2/CreditNoteRecord.js +136 -0
- package/dist/records-v2/CrmDatasetRecord.d.ts +191 -2
- package/dist/records-v2/CrmDatasetRecord.js +271 -0
- package/dist/records-v2/CustomerDeviceAtaRecord.d.ts +21 -0
- package/dist/records-v2/CustomerDeviceAtaRecord.js +37 -0
- package/dist/records-v2/CustomerDeviceConfigurationRecord.d.ts +62 -1
- package/dist/records-v2/CustomerDeviceConfigurationRecord.js +91 -0
- package/dist/records-v2/CustomerDeviceOntRecord.d.ts +181 -0
- package/dist/records-v2/CustomerDeviceOntRecord.js +301 -0
- package/dist/records-v2/CustomerDeviceRouterRecord.d.ts +141 -0
- package/dist/records-v2/CustomerDeviceRouterRecord.js +235 -0
- package/dist/records-v2/CustomerPhonePortingRecord.d.ts +21 -0
- package/dist/records-v2/CustomerPhonePortingRecord.js +37 -0
- package/dist/records-v2/DiscountRecord.d.ts +121 -0
- package/dist/records-v2/DiscountRecord.js +202 -0
- package/dist/records-v2/EmailRecord.d.ts +230 -2
- package/dist/records-v2/EmailRecord.js +336 -0
- package/dist/records-v2/EmailSenderRecord.d.ts +42 -1
- package/dist/records-v2/EmailSenderRecord.js +58 -0
- package/dist/records-v2/EmailTemplateRecord.d.ts +21 -1
- package/dist/records-v2/EmailTemplateRecord.js +21 -0
- package/dist/records-v2/FieldServiceDispatchedProductRecord.d.ts +135 -2
- package/dist/records-v2/FieldServiceDispatchedProductRecord.js +189 -0
- package/dist/records-v2/FieldServiceProductRecord.d.ts +115 -2
- package/dist/records-v2/FieldServiceProductRecord.js +156 -0
- package/dist/records-v2/FileRecord.d.ts +1211 -2
- package/dist/records-v2/FileRecord.js +1902 -0
- package/dist/records-v2/ImpersonationTrackerRecord.d.ts +62 -1
- package/dist/records-v2/ImpersonationTrackerRecord.js +91 -0
- package/dist/records-v2/InternalInstallAuditRecord.d.ts +83 -2
- package/dist/records-v2/InternalInstallAuditRecord.js +124 -0
- package/dist/records-v2/InvoiceItemRecord.d.ts +40 -0
- package/dist/records-v2/InvoiceItemRecord.js +69 -0
- package/dist/records-v2/InvoiceRecord.d.ts +399 -2
- package/dist/records-v2/InvoiceRecord.js +635 -0
- package/dist/records-v2/KnowledgeArticleRecord.d.ts +98 -2
- package/dist/records-v2/KnowledgeArticleRecord.js +139 -0
- package/dist/records-v2/LeadRecord.d.ts +261 -0
- package/dist/records-v2/LeadRecord.js +433 -0
- package/dist/records-v2/MessageRecord.d.ts +99 -2
- package/dist/records-v2/MessageRecord.js +140 -0
- package/dist/records-v2/NetworkDeviceRecord.d.ts +43 -2
- package/dist/records-v2/NetworkDeviceRecord.js +58 -0
- package/dist/records-v2/NoteRecord.d.ts +1121 -1
- package/dist/records-v2/NoteRecord.js +1839 -0
- package/dist/records-v2/OfferRecord.d.ts +154 -2
- package/dist/records-v2/OfferRecord.js +221 -0
- package/dist/records-v2/OhAuditOfInstallationRecord.d.ts +83 -2
- package/dist/records-v2/OhAuditOfInstallationRecord.js +124 -0
- package/dist/records-v2/OhExternalAuditRecord.d.ts +83 -2
- package/dist/records-v2/OhExternalAuditRecord.js +124 -0
- package/dist/records-v2/OhInProgressAuditRecord.d.ts +83 -2
- package/dist/records-v2/OhInProgressAuditRecord.js +124 -0
- package/dist/records-v2/OhInstallationAuditRecord.d.ts +83 -2
- package/dist/records-v2/OhInstallationAuditRecord.js +124 -0
- package/dist/records-v2/OhRetroAuditRecord.d.ts +83 -2
- package/dist/records-v2/OhRetroAuditRecord.js +124 -0
- package/dist/records-v2/OneTouchSwitchRecord.d.ts +255 -2
- package/dist/records-v2/OneTouchSwitchRecord.js +387 -0
- package/dist/records-v2/OntReplacementApprovalRecord.d.ts +62 -1
- package/dist/records-v2/OntReplacementApprovalRecord.js +91 -0
- package/dist/records-v2/OrderCheckRecord.d.ts +21 -0
- package/dist/records-v2/OrderCheckRecord.js +37 -0
- package/dist/records-v2/OrderItemRecord.d.ts +309 -0
- package/dist/records-v2/OrderItemRecord.js +501 -0
- package/dist/records-v2/OrderKciRecord.d.ts +42 -1
- package/dist/records-v2/OrderKciRecord.js +58 -0
- package/dist/records-v2/OrderRecord.d.ts +620 -0
- package/dist/records-v2/OrderRecord.js +1026 -0
- package/dist/records-v2/OutageRecord.d.ts +42 -1
- package/dist/records-v2/OutageRecord.js +58 -0
- package/dist/records-v2/OverlayRealA55Record.d.ts +83 -2
- package/dist/records-v2/OverlayRealA55Record.js +124 -0
- package/dist/records-v2/PICRequestRecord.d.ts +62 -1
- package/dist/records-v2/PICRequestRecord.js +91 -0
- package/dist/records-v2/PaymentMethodRecord.d.ts +121 -0
- package/dist/records-v2/PaymentMethodRecord.js +202 -0
- package/dist/records-v2/PaymentMethodRefundRecord.d.ts +181 -0
- package/dist/records-v2/PaymentMethodRefundRecord.js +301 -0
- package/dist/records-v2/PaymentRecord.d.ts +82 -1
- package/dist/records-v2/PaymentRecord.js +124 -0
- package/dist/records-v2/PermissionToFailRecord.d.ts +61 -0
- package/dist/records-v2/PermissionToFailRecord.js +103 -0
- package/dist/records-v2/PgAccountValidationRecord.d.ts +21 -1
- package/dist/records-v2/PgAccountValidationRecord.js +21 -0
- package/dist/records-v2/PgContactRecord.d.ts +62 -1
- package/dist/records-v2/PgContactRecord.js +91 -0
- package/dist/records-v2/PgDirectDebitFileRecord.d.ts +95 -2
- package/dist/records-v2/PgDirectDebitFileRecord.js +123 -0
- package/dist/records-v2/PgDisputeRecord.d.ts +62 -1
- package/dist/records-v2/PgDisputeRecord.js +91 -0
- package/dist/records-v2/PgFileAllocationRecord.d.ts +115 -2
- package/dist/records-v2/PgFileAllocationRecord.js +156 -0
- package/dist/records-v2/PgLogRecord.d.ts +21 -1
- package/dist/records-v2/PgLogRecord.js +21 -0
- package/dist/records-v2/PgPaymentMethodRecord.d.ts +102 -1
- package/dist/records-v2/PgPaymentMethodRecord.js +157 -0
- package/dist/records-v2/PgSortCodeSubstitutionRecord.d.ts +21 -1
- package/dist/records-v2/PgSortCodeSubstitutionRecord.js +21 -0
- package/dist/records-v2/PgTransactionRecord.d.ts +135 -2
- package/dist/records-v2/PgTransactionRecord.js +189 -0
- package/dist/records-v2/PgVocalinkRecord.d.ts +21 -1
- package/dist/records-v2/PgVocalinkRecord.js +21 -0
- package/dist/records-v2/PgWebhookAttemptRecord.d.ts +42 -1
- package/dist/records-v2/PgWebhookAttemptRecord.js +58 -0
- package/dist/records-v2/PgWebhookRecord.d.ts +122 -1
- package/dist/records-v2/PgWebhookRecord.js +190 -0
- package/dist/records-v2/PhoneNumberRecord.d.ts +41 -0
- package/dist/records-v2/PhoneNumberRecord.js +70 -0
- package/dist/records-v2/PriceBookRecord.d.ts +21 -0
- package/dist/records-v2/PriceBookRecord.js +37 -0
- package/dist/records-v2/ProductRecord.d.ts +258 -2
- package/dist/records-v2/ProductRecord.js +351 -0
- package/dist/records-v2/PushNotificationRecord.d.ts +162 -1
- package/dist/records-v2/PushNotificationRecord.js +256 -0
- package/dist/records-v2/ReferralRecord.d.ts +143 -2
- package/dist/records-v2/ReferralRecord.js +223 -0
- package/dist/records-v2/RemediationOutcomeFormRecord.d.ts +83 -2
- package/dist/records-v2/RemediationOutcomeFormRecord.js +124 -0
- package/dist/records-v2/RemediationRequiredReasonRecord.d.ts +103 -2
- package/dist/records-v2/RemediationRequiredReasonRecord.js +157 -0
- package/dist/records-v2/ReturnsRecord.d.ts +62 -1
- package/dist/records-v2/ReturnsRecord.js +91 -0
- package/dist/records-v2/RewardRecord.d.ts +123 -2
- package/dist/records-v2/RewardRecord.js +190 -0
- package/dist/records-v2/SalesTerritoryRecord.d.ts +79 -2
- package/dist/records-v2/SalesTerritoryRecord.js +107 -0
- package/dist/records-v2/ScheduleSlotRecord.d.ts +42 -1
- package/dist/records-v2/ScheduleSlotRecord.js +58 -0
- package/dist/records-v2/ServiceAppointmentConfigRecord.d.ts +287 -2
- package/dist/records-v2/ServiceAppointmentConfigRecord.js +367 -0
- package/dist/records-v2/ServiceAppointmentRecord.d.ts +81 -0
- package/dist/records-v2/ServiceAppointmentRecord.js +136 -0
- package/dist/records-v2/ServiceRecord.d.ts +40 -0
- package/dist/records-v2/ServiceRecord.js +69 -0
- package/dist/records-v2/ServiceVisitAuditRecord.d.ts +83 -2
- package/dist/records-v2/ServiceVisitAuditRecord.js +124 -0
- package/dist/records-v2/SiteSpecificRiskAssessmentOutcomeFormRecord.d.ts +83 -2
- package/dist/records-v2/SiteSpecificRiskAssessmentOutcomeFormRecord.js +124 -0
- package/dist/records-v2/SmsMessageRecord.d.ts +175 -2
- package/dist/records-v2/SmsMessageRecord.js +255 -0
- package/dist/records-v2/SweeperMaintenanceAuditRecord.d.ts +83 -2
- package/dist/records-v2/SweeperMaintenanceAuditRecord.js +124 -0
- package/dist/records-v2/TeamRecord.d.ts +101 -0
- package/dist/records-v2/TeamRecord.js +169 -0
- package/dist/records-v2/TestEntityForVisualBuilderRecord.d.ts +115 -2
- package/dist/records-v2/TestEntityForVisualBuilderRecord.js +156 -0
- package/dist/records-v2/TimeSlotRecord.d.ts +21 -0
- package/dist/records-v2/TimeSlotRecord.js +37 -0
- package/dist/records-v2/TransactionRecord.d.ts +181 -1
- package/dist/records-v2/TransactionRecord.js +288 -0
- package/dist/records-v2/TwilioUserUpdateRecord.d.ts +42 -1
- package/dist/records-v2/TwilioUserUpdateRecord.js +58 -0
- package/dist/records-v2/UgAuditOfInstallationRecord.d.ts +83 -2
- package/dist/records-v2/UgAuditOfInstallationRecord.js +124 -0
- package/dist/records-v2/UgExternalAuditRecord.d.ts +83 -2
- package/dist/records-v2/UgExternalAuditRecord.js +124 -0
- package/dist/records-v2/UgInProgressAuditRecord.d.ts +83 -2
- package/dist/records-v2/UgInProgressAuditRecord.js +124 -0
- package/dist/records-v2/UgInstallationAuditRecord.d.ts +83 -2
- package/dist/records-v2/UgInstallationAuditRecord.js +124 -0
- package/dist/records-v2/UgRetroAuditRecord.d.ts +83 -2
- package/dist/records-v2/UgRetroAuditRecord.js +124 -0
- package/dist/records-v2/UserRecord.d.ts +400 -0
- package/dist/records-v2/UserRecord.js +663 -0
- package/dist/records-v2/VisitRecord.d.ts +121 -0
- package/dist/records-v2/VisitRecord.js +202 -0
- package/dist/records-v2/VoiceConfigurationRecord.d.ts +21 -0
- package/dist/records-v2/VoiceConfigurationRecord.js +37 -0
- package/dist/records-v2/WayleaveAuditRecord.d.ts +83 -2
- package/dist/records-v2/WayleaveAuditRecord.js +124 -0
- package/dist/records-v2/WorkOrderRecord.d.ts +1226 -2
- package/dist/records-v2/WorkOrderRecord.js +1865 -0
- package/dist/records-v2/WorkOrderStatusUpdateRecord.d.ts +75 -2
- package/dist/records-v2/WorkOrderStatusUpdateRecord.js +90 -0
- package/dist/records-v2/YfFieldServiceVisitRecord.d.ts +83 -2
- package/dist/records-v2/YfFieldServiceVisitRecord.js +124 -0
- package/dist/records-v2/YfStockAuditRecord.d.ts +103 -2
- package/dist/records-v2/YfStockAuditRecord.js +157 -0
- package/dist/records-v2/index.d.ts +1 -1
- package/dist/records-v2/index.js +5 -5
- package/package.json +1 -1
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
* await record.createMessage({ ... }).execute();
|
|
15
15
|
* ```
|
|
16
16
|
*
|
|
17
|
+
* Entity Types: DEFAULT, EVENT
|
|
18
|
+
*
|
|
17
19
|
* AUTO-GENERATED - DO NOT EDIT DIRECTLY
|
|
18
20
|
*/
|
|
19
21
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
@@ -29,6 +31,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
29
31
|
exports.isMessageRecord = exports.MessageRecord = void 0;
|
|
30
32
|
const uuid_1 = require("uuid");
|
|
31
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 ConversationRecord_1 = require("./ConversationRecord");
|
|
36
|
+
const FileRecord_1 = require("./FileRecord");
|
|
37
|
+
const PushNotificationRecord_1 = require("./PushNotificationRecord");
|
|
32
38
|
/**
|
|
33
39
|
* Builder for action execution with dryRun support
|
|
34
40
|
*
|
|
@@ -140,6 +146,131 @@ class MessageRecord {
|
|
|
140
146
|
/** Access the underlying OdinRecord (null for new records) */
|
|
141
147
|
get record() { return this._record; }
|
|
142
148
|
// ============================================
|
|
149
|
+
// TYPE GUARDS (with TypeScript type predicates)
|
|
150
|
+
// ============================================
|
|
151
|
+
/**
|
|
152
|
+
* Type guard: check if this record is of type DEFAULT
|
|
153
|
+
*
|
|
154
|
+
* When this returns true, TypeScript automatically narrows the type,
|
|
155
|
+
* giving you access to DEFAULT-specific properties.
|
|
156
|
+
*
|
|
157
|
+
* @example
|
|
158
|
+
* ```typescript
|
|
159
|
+
* if (record.isDefault()) {
|
|
160
|
+
* // TypeScript knows record.properties is MessageProperties
|
|
161
|
+
* console.log(record.properties.SomeTypeSpecificField);
|
|
162
|
+
* }
|
|
163
|
+
* ```
|
|
164
|
+
* @remarks This is the default record type
|
|
165
|
+
*/
|
|
166
|
+
isDefault() { var _a; return ((_a = this._record) === null || _a === void 0 ? void 0 : _a.type) === 'DEFAULT'; }
|
|
167
|
+
/**
|
|
168
|
+
* Type guard: check if this record is of type EVENT
|
|
169
|
+
*
|
|
170
|
+
* When this returns true, TypeScript automatically narrows the type,
|
|
171
|
+
* giving you access to EVENT-specific properties.
|
|
172
|
+
*
|
|
173
|
+
* @example
|
|
174
|
+
* ```typescript
|
|
175
|
+
* if (record.isEvent()) {
|
|
176
|
+
* // TypeScript knows record.properties is EventMessageProperties
|
|
177
|
+
* console.log(record.properties.SomeTypeSpecificField);
|
|
178
|
+
* }
|
|
179
|
+
* ```
|
|
180
|
+
* @remarks event
|
|
181
|
+
*/
|
|
182
|
+
isEvent() { var _a; return ((_a = this._record) === null || _a === void 0 ? void 0 : _a.type) === 'EVENT'; }
|
|
183
|
+
/**
|
|
184
|
+
* Access linked Conversation records
|
|
185
|
+
* @remarks Available labels: Conversation_Message
|
|
186
|
+
* @throws Error if called on a new (unsaved) record
|
|
187
|
+
*
|
|
188
|
+
* @example
|
|
189
|
+
* ```typescript
|
|
190
|
+
* // Get all linked Conversation records
|
|
191
|
+
* const items = await record.conversations.list();
|
|
192
|
+
* const first = await record.conversations.first();
|
|
193
|
+
*
|
|
194
|
+
* // Filter by label
|
|
195
|
+
* const specific = await record.conversations.first({ label: 'Conversation_Message' });
|
|
196
|
+
* ```
|
|
197
|
+
*/
|
|
198
|
+
get conversations() {
|
|
199
|
+
var _a;
|
|
200
|
+
if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
|
|
201
|
+
throw new Error('Cannot access links on a new (unsaved) record');
|
|
202
|
+
if (!this._conversations) {
|
|
203
|
+
this._conversations = new record_link_manager_1.RecordLinkManager(this._provider, this._record, {
|
|
204
|
+
sourceEntity: 'NotificationModule:Message',
|
|
205
|
+
targetEntity: 'NotificationModule:Conversation',
|
|
206
|
+
targetModuleName: 'NotificationModule',
|
|
207
|
+
targetEntityName: 'Conversation',
|
|
208
|
+
labels: ['Conversation_Message'],
|
|
209
|
+
}, ConversationRecord_1.ConversationRecord);
|
|
210
|
+
}
|
|
211
|
+
return this._conversations;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Access linked File records
|
|
215
|
+
* @remarks Available labels: Message_File
|
|
216
|
+
* @throws Error if called on a new (unsaved) record
|
|
217
|
+
*
|
|
218
|
+
* @example
|
|
219
|
+
* ```typescript
|
|
220
|
+
* // Get all linked File records
|
|
221
|
+
* const items = await record.files.list();
|
|
222
|
+
* const first = await record.files.first();
|
|
223
|
+
*
|
|
224
|
+
* // Filter by label
|
|
225
|
+
* const specific = await record.files.first({ label: 'Message_File' });
|
|
226
|
+
* ```
|
|
227
|
+
*/
|
|
228
|
+
get files() {
|
|
229
|
+
var _a;
|
|
230
|
+
if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
|
|
231
|
+
throw new Error('Cannot access links on a new (unsaved) record');
|
|
232
|
+
if (!this._files) {
|
|
233
|
+
this._files = new record_link_manager_1.RecordLinkManager(this._provider, this._record, {
|
|
234
|
+
sourceEntity: 'NotificationModule:Message',
|
|
235
|
+
targetEntity: 'SchemaModule:File',
|
|
236
|
+
targetModuleName: 'SchemaModule',
|
|
237
|
+
targetEntityName: 'File',
|
|
238
|
+
labels: ['Message_File'],
|
|
239
|
+
}, FileRecord_1.FileRecord);
|
|
240
|
+
}
|
|
241
|
+
return this._files;
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Access linked PushNotification records
|
|
245
|
+
* @remarks Available labels: Message__PushNotification
|
|
246
|
+
* @throws Error if called on a new (unsaved) record
|
|
247
|
+
*
|
|
248
|
+
* @example
|
|
249
|
+
* ```typescript
|
|
250
|
+
* // Get all linked PushNotification records
|
|
251
|
+
* const items = await record.pushNotifications.list();
|
|
252
|
+
* const first = await record.pushNotifications.first();
|
|
253
|
+
*
|
|
254
|
+
* // Filter by label
|
|
255
|
+
* const specific = await record.pushNotifications.first({ label: 'Message__PushNotification' });
|
|
256
|
+
* ```
|
|
257
|
+
*/
|
|
258
|
+
get pushNotifications() {
|
|
259
|
+
var _a;
|
|
260
|
+
if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
|
|
261
|
+
throw new Error('Cannot access links on a new (unsaved) record');
|
|
262
|
+
if (!this._pushNotifications) {
|
|
263
|
+
this._pushNotifications = new record_link_manager_1.RecordLinkManager(this._provider, this._record, {
|
|
264
|
+
sourceEntity: 'NotificationModule:Message',
|
|
265
|
+
targetEntity: 'NotificationModule:PushNotification',
|
|
266
|
+
targetModuleName: 'NotificationModule',
|
|
267
|
+
targetEntityName: 'PushNotification',
|
|
268
|
+
labels: ['Message__PushNotification'],
|
|
269
|
+
}, PushNotificationRecord_1.PushNotificationRecord);
|
|
270
|
+
}
|
|
271
|
+
return this._pushNotifications;
|
|
272
|
+
}
|
|
273
|
+
// ============================================
|
|
143
274
|
// LINK MANAGEMENT
|
|
144
275
|
// ============================================
|
|
145
276
|
/**
|
|
@@ -215,6 +346,15 @@ class MessageRecord {
|
|
|
215
346
|
}
|
|
216
347
|
}
|
|
217
348
|
exports.MessageRecord = MessageRecord;
|
|
349
|
+
// ============================================
|
|
350
|
+
// TYPED LINK ACCESSORS
|
|
351
|
+
// ============================================
|
|
352
|
+
/** Valid labels for Conversation associations */
|
|
353
|
+
MessageRecord.conversationsLabels = ['Conversation_Message'];
|
|
354
|
+
/** Valid labels for File associations */
|
|
355
|
+
MessageRecord.filesLabels = ['Message_File'];
|
|
356
|
+
/** Valid labels for PushNotification associations */
|
|
357
|
+
MessageRecord.pushNotificationsLabels = ['Message__PushNotification'];
|
|
218
358
|
/** Type guard to check if an object is a MessageRecord */
|
|
219
359
|
function isMessageRecord(obj) {
|
|
220
360
|
return obj instanceof MessageRecord;
|
|
@@ -13,15 +13,21 @@
|
|
|
13
13
|
* await record.createNetworkDevice({ ... }).execute();
|
|
14
14
|
* ```
|
|
15
15
|
*
|
|
16
|
+
* Entity Types: OLT
|
|
17
|
+
*
|
|
16
18
|
* AUTO-GENERATED - DO NOT EDIT DIRECTLY
|
|
17
19
|
*/
|
|
18
20
|
import { OdinRecord, OdinRecordLinkDto } from '@d19n/odin-types/dist/core';
|
|
19
21
|
import { PipelineStageEntity } from '@d19n/odin-types/dist/core';
|
|
20
22
|
import { IDbRecordCreateUpdateRes } from '@d19n/odin-types/dist/core/interfaces/v1.db.interfaces';
|
|
21
23
|
import { IOdinProvider } from '@d19n/odin-sdk-generator/dist/odin-sdk-types';
|
|
22
|
-
import {
|
|
24
|
+
import { RecordLinkManager } from '@d19n/odin-sdk-generator/dist/record-link-manager';
|
|
25
|
+
import { NetworkDeviceProperties, OltNetworkDeviceProperties } from '../entities-v2/NetworkDevice';
|
|
23
26
|
import { CreateNetworkDeviceProperties } from '../actions-v2/CreateNetworkDeviceDto';
|
|
24
27
|
import { EditNetworkDeviceProperties } from '../actions-v2/EditNetworkDeviceDto';
|
|
28
|
+
import { CustomerDeviceOntRecord } from './CustomerDeviceOntRecord';
|
|
29
|
+
/** Valid entity types for NetworkDevice */
|
|
30
|
+
export declare type NetworkDeviceType = 'OLT';
|
|
25
31
|
/**
|
|
26
32
|
* Builder for action execution with dryRun support
|
|
27
33
|
*
|
|
@@ -85,6 +91,7 @@ export declare class NetworkDeviceRecord<TProps = NetworkDeviceProperties> {
|
|
|
85
91
|
private _provider;
|
|
86
92
|
private _pendingLinks;
|
|
87
93
|
private _preGeneratedId;
|
|
94
|
+
private _customerDeviceOnts?;
|
|
88
95
|
/**
|
|
89
96
|
* Create a record wrapper.
|
|
90
97
|
* @param record - The underlying record, or null for create operations
|
|
@@ -97,7 +104,7 @@ export declare class NetworkDeviceRecord<TProps = NetworkDeviceProperties> {
|
|
|
97
104
|
/** Record ID - always available (pre-generated for new records) */
|
|
98
105
|
get id(): string;
|
|
99
106
|
get entity(): string;
|
|
100
|
-
get type():
|
|
107
|
+
get type(): NetworkDeviceType | undefined;
|
|
101
108
|
/** Record properties - empty object for new (unsaved) records */
|
|
102
109
|
get properties(): TProps;
|
|
103
110
|
get title(): string | undefined;
|
|
@@ -110,6 +117,40 @@ export declare class NetworkDeviceRecord<TProps = NetworkDeviceProperties> {
|
|
|
110
117
|
get groups(): string[];
|
|
111
118
|
/** Access the underlying OdinRecord (null for new records) */
|
|
112
119
|
get record(): OdinRecord<TProps> | null;
|
|
120
|
+
/**
|
|
121
|
+
* Type guard: check if this record is of type OLT
|
|
122
|
+
*
|
|
123
|
+
* When this returns true, TypeScript automatically narrows the type,
|
|
124
|
+
* giving you access to OLT-specific properties.
|
|
125
|
+
*
|
|
126
|
+
* @example
|
|
127
|
+
* ```typescript
|
|
128
|
+
* if (record.isOlt()) {
|
|
129
|
+
* // TypeScript knows record.properties is OltNetworkDeviceProperties
|
|
130
|
+
* console.log(record.properties.SomeTypeSpecificField);
|
|
131
|
+
* }
|
|
132
|
+
* ```
|
|
133
|
+
* @remarks network olt
|
|
134
|
+
*/
|
|
135
|
+
isOlt(): this is NetworkDeviceRecord<OltNetworkDeviceProperties>;
|
|
136
|
+
/** Valid labels for CustomerDeviceOnt associations */
|
|
137
|
+
static readonly customerDeviceOntsLabels: readonly ["NetworkDevice__CustomerDeviceOnt"];
|
|
138
|
+
/**
|
|
139
|
+
* Access linked CustomerDeviceOnt records
|
|
140
|
+
* @remarks Available labels: NetworkDevice__CustomerDeviceOnt
|
|
141
|
+
* @throws Error if called on a new (unsaved) record
|
|
142
|
+
*
|
|
143
|
+
* @example
|
|
144
|
+
* ```typescript
|
|
145
|
+
* // Get all linked CustomerDeviceOnt records
|
|
146
|
+
* const items = await record.customerDeviceOnts.list();
|
|
147
|
+
* const first = await record.customerDeviceOnts.first();
|
|
148
|
+
*
|
|
149
|
+
* // Filter by label
|
|
150
|
+
* const specific = await record.customerDeviceOnts.first({ label: 'NetworkDevice__CustomerDeviceOnt' });
|
|
151
|
+
* ```
|
|
152
|
+
*/
|
|
153
|
+
get customerDeviceOnts(): RecordLinkManager<CustomerDeviceOntRecord, typeof NetworkDeviceRecord['customerDeviceOntsLabels'][number]>;
|
|
113
154
|
/**
|
|
114
155
|
* Queue a link to be created with the next action.
|
|
115
156
|
* Works for both create and update actions.
|
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
* await record.createNetworkDevice({ ... }).execute();
|
|
15
15
|
* ```
|
|
16
16
|
*
|
|
17
|
+
* Entity Types: OLT
|
|
18
|
+
*
|
|
17
19
|
* AUTO-GENERATED - DO NOT EDIT DIRECTLY
|
|
18
20
|
*/
|
|
19
21
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
@@ -29,6 +31,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
29
31
|
exports.isNetworkDeviceRecord = exports.NetworkDeviceRecord = void 0;
|
|
30
32
|
const uuid_1 = require("uuid");
|
|
31
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 CustomerDeviceOntRecord_1 = require("./CustomerDeviceOntRecord");
|
|
32
36
|
/**
|
|
33
37
|
* Builder for action execution with dryRun support
|
|
34
38
|
*
|
|
@@ -140,6 +144,55 @@ class NetworkDeviceRecord {
|
|
|
140
144
|
/** Access the underlying OdinRecord (null for new records) */
|
|
141
145
|
get record() { return this._record; }
|
|
142
146
|
// ============================================
|
|
147
|
+
// TYPE GUARDS (with TypeScript type predicates)
|
|
148
|
+
// ============================================
|
|
149
|
+
/**
|
|
150
|
+
* Type guard: check if this record is of type OLT
|
|
151
|
+
*
|
|
152
|
+
* When this returns true, TypeScript automatically narrows the type,
|
|
153
|
+
* giving you access to OLT-specific properties.
|
|
154
|
+
*
|
|
155
|
+
* @example
|
|
156
|
+
* ```typescript
|
|
157
|
+
* if (record.isOlt()) {
|
|
158
|
+
* // TypeScript knows record.properties is OltNetworkDeviceProperties
|
|
159
|
+
* console.log(record.properties.SomeTypeSpecificField);
|
|
160
|
+
* }
|
|
161
|
+
* ```
|
|
162
|
+
* @remarks network olt
|
|
163
|
+
*/
|
|
164
|
+
isOlt() { var _a; return ((_a = this._record) === null || _a === void 0 ? void 0 : _a.type) === 'OLT'; }
|
|
165
|
+
/**
|
|
166
|
+
* Access linked CustomerDeviceOnt records
|
|
167
|
+
* @remarks Available labels: NetworkDevice__CustomerDeviceOnt
|
|
168
|
+
* @throws Error if called on a new (unsaved) record
|
|
169
|
+
*
|
|
170
|
+
* @example
|
|
171
|
+
* ```typescript
|
|
172
|
+
* // Get all linked CustomerDeviceOnt records
|
|
173
|
+
* const items = await record.customerDeviceOnts.list();
|
|
174
|
+
* const first = await record.customerDeviceOnts.first();
|
|
175
|
+
*
|
|
176
|
+
* // Filter by label
|
|
177
|
+
* const specific = await record.customerDeviceOnts.first({ label: 'NetworkDevice__CustomerDeviceOnt' });
|
|
178
|
+
* ```
|
|
179
|
+
*/
|
|
180
|
+
get customerDeviceOnts() {
|
|
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._customerDeviceOnts) {
|
|
185
|
+
this._customerDeviceOnts = new record_link_manager_1.RecordLinkManager(this._provider, this._record, {
|
|
186
|
+
sourceEntity: 'ServiceModule:NetworkDevice',
|
|
187
|
+
targetEntity: 'ServiceModule:CustomerDeviceOnt',
|
|
188
|
+
targetModuleName: 'ServiceModule',
|
|
189
|
+
targetEntityName: 'CustomerDeviceOnt',
|
|
190
|
+
labels: ['NetworkDevice__CustomerDeviceOnt'],
|
|
191
|
+
}, CustomerDeviceOntRecord_1.CustomerDeviceOntRecord);
|
|
192
|
+
}
|
|
193
|
+
return this._customerDeviceOnts;
|
|
194
|
+
}
|
|
195
|
+
// ============================================
|
|
143
196
|
// LINK MANAGEMENT
|
|
144
197
|
// ============================================
|
|
145
198
|
/**
|
|
@@ -247,6 +300,11 @@ class NetworkDeviceRecord {
|
|
|
247
300
|
}
|
|
248
301
|
}
|
|
249
302
|
exports.NetworkDeviceRecord = NetworkDeviceRecord;
|
|
303
|
+
// ============================================
|
|
304
|
+
// TYPED LINK ACCESSORS
|
|
305
|
+
// ============================================
|
|
306
|
+
/** Valid labels for CustomerDeviceOnt associations */
|
|
307
|
+
NetworkDeviceRecord.customerDeviceOntsLabels = ['NetworkDevice__CustomerDeviceOnt'];
|
|
250
308
|
/** Type guard to check if an object is a NetworkDeviceRecord */
|
|
251
309
|
function isNetworkDeviceRecord(obj) {
|
|
252
310
|
return obj instanceof NetworkDeviceRecord;
|