merchi_sdk_ts 1.0.49 → 1.0.51
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.
|
@@ -76,6 +76,10 @@ var Category = /** @class */ (function (_super) {
|
|
|
76
76
|
Category.property({ type: 'Category' }),
|
|
77
77
|
__metadata("design:type", Category)
|
|
78
78
|
], Category.prototype, "parent", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
Category.property({ type: 'MerchiFile' }),
|
|
81
|
+
__metadata("design:type", Object)
|
|
82
|
+
], Category.prototype, "image", void 0);
|
|
79
83
|
return Category;
|
|
80
84
|
}(Entity));
|
|
81
85
|
export { Category };
|
|
@@ -257,6 +257,7 @@ test('can list products with options set', function () {
|
|
|
257
257
|
isOrder: true,
|
|
258
258
|
isPrivate: false,
|
|
259
259
|
jobNotifiable: 1,
|
|
260
|
+
descendants: 2,
|
|
260
261
|
limit: 20,
|
|
261
262
|
managedDomainsOnly: true,
|
|
262
263
|
managedOnly: false,
|
|
@@ -342,6 +343,7 @@ test('can list products with options set', function () {
|
|
|
342
343
|
['is_order', 'true'],
|
|
343
344
|
['is_private', 'false'],
|
|
344
345
|
['job_notifiable', '1'],
|
|
346
|
+
['descendants', '2'],
|
|
345
347
|
['limit', '20'],
|
|
346
348
|
['managed_domains_only', 'true'],
|
|
347
349
|
['managed_only', 'false'],
|
package/dist/entity.js
CHANGED
|
@@ -608,6 +608,9 @@ var Entity = /** @class */ (function () {
|
|
|
608
608
|
if (options.offset !== undefined) {
|
|
609
609
|
fetchOptions.query.push(['offset', options.offset.toString()]);
|
|
610
610
|
}
|
|
611
|
+
if (options.descendants !== undefined) {
|
|
612
|
+
fetchOptions.query.push(['descendants', options.descendants.toString()]);
|
|
613
|
+
}
|
|
611
614
|
if (options.limit !== undefined) {
|
|
612
615
|
fetchOptions.query.push(['limit', options.limit.toString()]);
|
|
613
616
|
}
|
package/package.json
CHANGED
package/src/entities/category.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Domain } from './domain.js';
|
|
2
2
|
import { Entity } from '../entity.js';
|
|
3
|
+
import { MerchiFile } from './file.js';
|
|
3
4
|
import { Product } from './product.js';
|
|
4
5
|
import { User } from './user.js';
|
|
5
6
|
|
|
@@ -40,4 +41,7 @@ export class Category extends Entity {
|
|
|
40
41
|
|
|
41
42
|
@Category.property({type: 'Category'})
|
|
42
43
|
public parent?: Category;
|
|
44
|
+
|
|
45
|
+
@Category.property({type: 'MerchiFile'})
|
|
46
|
+
public image?: MerchiFile | null;
|
|
43
47
|
}
|
|
@@ -281,6 +281,7 @@ test('can list products with options set', () => {
|
|
|
281
281
|
isOrder: true,
|
|
282
282
|
isPrivate: false,
|
|
283
283
|
jobNotifiable: 1,
|
|
284
|
+
descendants: 2,
|
|
284
285
|
limit: 20,
|
|
285
286
|
managedDomainsOnly: true,
|
|
286
287
|
managedOnly: false,
|
|
@@ -370,6 +371,7 @@ test('can list products with options set', () => {
|
|
|
370
371
|
['is_order', 'true'],
|
|
371
372
|
['is_private', 'false'],
|
|
372
373
|
['job_notifiable', '1'],
|
|
374
|
+
['descendants', '2'],
|
|
373
375
|
['limit', '20'],
|
|
374
376
|
['managed_domains_only', 'true'],
|
|
375
377
|
['managed_only', 'false'],
|
package/src/entity.ts
CHANGED
|
@@ -107,6 +107,7 @@ interface ListOptions {
|
|
|
107
107
|
isOrder?: boolean;
|
|
108
108
|
isPrivate?: boolean;
|
|
109
109
|
jobNotifiable?: number;
|
|
110
|
+
descendants?: number;
|
|
110
111
|
limit?: number;
|
|
111
112
|
managedDomainsOnly?: boolean;
|
|
112
113
|
managedOnly?: boolean;
|
|
@@ -400,6 +401,9 @@ export class Entity {
|
|
|
400
401
|
if (options.offset !== undefined) {
|
|
401
402
|
fetchOptions.query.push(['offset', options.offset.toString()]);
|
|
402
403
|
}
|
|
404
|
+
if (options.descendants !== undefined) {
|
|
405
|
+
fetchOptions.query.push(['descendants', options.descendants.toString()]);
|
|
406
|
+
}
|
|
403
407
|
if (options.limit !== undefined) {
|
|
404
408
|
fetchOptions.query.push(['limit', options.limit.toString()]);
|
|
405
409
|
}
|