@d19n/youfibre-odin-sdk 2.0.307 → 2.0.309

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.
@@ -63,6 +63,7 @@ const ContactRecord_1 = require("./ContactRecord");
63
63
  const RecontractRecord_1 = require("./RecontractRecord");
64
64
  const DataIssueRecord_1 = require("./DataIssueRecord");
65
65
  const WorkOrderRecord_1 = require("./WorkOrderRecord");
66
+ const EmailRecord_1 = require("./EmailRecord");
66
67
  /**
67
68
  * Builder for action execution with dryRun support
68
69
  *
@@ -2153,6 +2154,36 @@ class OrderRecord {
2153
2154
  }
2154
2155
  return this._workOrders;
2155
2156
  }
2157
+ /**
2158
+ * Access linked Email records
2159
+ * @remarks Available labels: Order__Email
2160
+ * @throws Error if called on a new (unsaved) record
2161
+ *
2162
+ * @example
2163
+ * ```typescript
2164
+ * // Get all linked Email records
2165
+ * const items = await record.emails.list();
2166
+ * const first = await record.emails.first();
2167
+ *
2168
+ * // Filter by label
2169
+ * const specific = await record.emails.first({ label: 'Order__Email' });
2170
+ * ```
2171
+ */
2172
+ get emails() {
2173
+ var _a;
2174
+ if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
2175
+ throw new Error('Cannot access links on a new (unsaved) record');
2176
+ if (!this._emails) {
2177
+ this._emails = new record_link_manager_1.RecordLinkManager(this._provider, this._record, {
2178
+ sourceEntity: 'OrderModule:Order',
2179
+ targetEntity: 'NotificationModule:Email',
2180
+ targetModuleName: 'NotificationModule',
2181
+ targetEntityName: 'Email',
2182
+ labels: ['Order__Email'],
2183
+ }, EmailRecord_1.EmailRecord);
2184
+ }
2185
+ return this._emails;
2186
+ }
2156
2187
  // ============================================
2157
2188
  // LINK MANAGEMENT
2158
2189
  // ============================================
@@ -3407,6 +3438,8 @@ OrderRecord.recontractsLabels = ['Recontract__Order'];
3407
3438
  OrderRecord.dataIssuesLabels = ['DataIssue__Order'];
3408
3439
  /** Valid labels for WorkOrder associations */
3409
3440
  OrderRecord.workOrdersLabels = ['Order__WorkOrder'];
3441
+ /** Valid labels for Email associations */
3442
+ OrderRecord.emailsLabels = ['Order__Email'];
3410
3443
  /** Type guard to check if an object is a OrderRecord */
3411
3444
  function isOrderRecord(obj) {
3412
3445
  return obj instanceof OrderRecord;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@d19n/youfibre-odin-sdk",
3
- "version": "2.0.307",
3
+ "version": "2.0.309",
4
4
  "description": "",
5
5
  "author": "@d19n",
6
6
  "license": "UNLICENSED",