@d19n/youfibre-odin-sdk 2.0.80 → 2.0.82

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.
@@ -141,36 +141,6 @@ class ServiceRecord {
141
141
  get groups() { var _a; return ((_a = this._record) === null || _a === void 0 ? void 0 : _a.groups) || []; }
142
142
  /** Access the underlying OdinRecord (null for new records) */
143
143
  get record() { return this._record; }
144
- /**
145
- * Access linked Product records
146
- * @remarks Available labels: Product__Service
147
- * @throws Error if called on a new (unsaved) record
148
- *
149
- * @example
150
- * ```typescript
151
- * // Get all linked Product records
152
- * const items = await record.products.list();
153
- * const first = await record.products.first();
154
- *
155
- * // Filter by label
156
- * const specific = await record.products.first({ label: 'Product__Service' });
157
- * ```
158
- */
159
- get products() {
160
- var _a;
161
- if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
162
- throw new Error('Cannot access links on a new (unsaved) record');
163
- if (!this._products) {
164
- this._products = new record_link_manager_1.RecordLinkManager(this._provider, this._record, {
165
- sourceEntity: 'ServiceModule:Service',
166
- targetEntity: 'ProductModule:Product',
167
- targetModuleName: 'ProductModule',
168
- targetEntityName: 'Product',
169
- labels: ['Product__Service'],
170
- }, ProductRecord_1.ProductRecord);
171
- }
172
- return this._products;
173
- }
174
144
  /**
175
145
  * Access linked Service records
176
146
  * @remarks Available labels: Service__Service
@@ -201,6 +171,36 @@ class ServiceRecord {
201
171
  }
202
172
  return this._services;
203
173
  }
174
+ /**
175
+ * Access linked Product records
176
+ * @remarks Available labels: Product__Service
177
+ * @throws Error if called on a new (unsaved) record
178
+ *
179
+ * @example
180
+ * ```typescript
181
+ * // Get all linked Product records
182
+ * const items = await record.products.list();
183
+ * const first = await record.products.first();
184
+ *
185
+ * // Filter by label
186
+ * const specific = await record.products.first({ label: 'Product__Service' });
187
+ * ```
188
+ */
189
+ get products() {
190
+ var _a;
191
+ if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
192
+ throw new Error('Cannot access links on a new (unsaved) record');
193
+ if (!this._products) {
194
+ this._products = new record_link_manager_1.RecordLinkManager(this._provider, this._record, {
195
+ sourceEntity: 'ServiceModule:Service',
196
+ targetEntity: 'ProductModule:Product',
197
+ targetModuleName: 'ProductModule',
198
+ targetEntityName: 'Product',
199
+ labels: ['Product__Service'],
200
+ }, ProductRecord_1.ProductRecord);
201
+ }
202
+ return this._products;
203
+ }
204
204
  // ============================================
205
205
  // LINK MANAGEMENT
206
206
  // ============================================
@@ -273,10 +273,10 @@ exports.ServiceRecord = ServiceRecord;
273
273
  // ============================================
274
274
  // TYPED LINK ACCESSORS
275
275
  // ============================================
276
- /** Valid labels for Product associations */
277
- ServiceRecord.productsLabels = ['Product__Service'];
278
276
  /** Valid labels for Service associations */
279
277
  ServiceRecord.servicesLabels = ['Service__Service'];
278
+ /** Valid labels for Product associations */
279
+ ServiceRecord.productsLabels = ['Product__Service'];
280
280
  /** Type guard to check if an object is a ServiceRecord */
281
281
  function isServiceRecord(obj) {
282
282
  return obj instanceof ServiceRecord;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@d19n/youfibre-odin-sdk",
3
- "version": "2.0.80",
3
+ "version": "2.0.82",
4
4
  "description": "",
5
5
  "author": "@d19n",
6
6
  "license": "UNLICENSED",