@merchi/sdk 1.42.1 → 1.42.3
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/dist/entities/cart_item.js +4 -0
- package/dist/entities/inventory.js +2 -1
- package/dist/entities/product.js +1 -1
- package/dist/entities/user.js +2 -1
- package/dist/entities/user.test.js +2 -1
- package/dist/entities/variation_field.js +2 -1
- package/package.json +1 -1
- package/src/entities/cart_item.ts +4 -0
- package/src/entities/inventory.ts +3 -1
- package/src/entities/product.ts +1 -1
- package/src/entities/user.test.ts +3 -1
- package/src/entities/user.ts +3 -1
- package/src/entities/variation_field.ts +3 -1
|
@@ -120,6 +120,10 @@ var CartItem = /** @class */ (function (_super) {
|
|
|
120
120
|
CartItem.property({ arrayType: 'Draft' }),
|
|
121
121
|
__metadata("design:type", Array)
|
|
122
122
|
], CartItem.prototype, "ownDrafts", void 0);
|
|
123
|
+
__decorate([
|
|
124
|
+
CartItem.property({ arrayType: 'MerchiFile' }),
|
|
125
|
+
__metadata("design:type", Array)
|
|
126
|
+
], CartItem.prototype, "clientFiles", void 0);
|
|
123
127
|
return CartItem;
|
|
124
128
|
}(Entity));
|
|
125
129
|
export { CartItem };
|
|
@@ -24,7 +24,8 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
24
24
|
};
|
|
25
25
|
import { Address } from './address.js';
|
|
26
26
|
import { Entity } from '../entity.js';
|
|
27
|
-
import
|
|
27
|
+
import lodash from 'lodash';
|
|
28
|
+
var some = lodash.some;
|
|
28
29
|
var Inventory = /** @class */ (function (_super) {
|
|
29
30
|
__extends(Inventory, _super);
|
|
30
31
|
function Inventory() {
|
package/dist/entities/product.js
CHANGED
|
@@ -33,7 +33,7 @@ var __values = (this && this.__values) || function(o) {
|
|
|
33
33
|
};
|
|
34
34
|
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
35
35
|
};
|
|
36
|
-
import
|
|
36
|
+
import _ from 'lodash';
|
|
37
37
|
import { ProductForm } from './product_form.js';
|
|
38
38
|
import { CountryTax } from './country_tax.js';
|
|
39
39
|
import { Domain } from './domain.js';
|
package/dist/entities/user.js
CHANGED
|
@@ -50,7 +50,8 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
50
50
|
import { Entity } from '../entity.js';
|
|
51
51
|
import { Role, DOMAIN_MANAGERS, MANAGEMENT_TEAM, BUSINESS_ACCOUNTS, ROLES_RANK } from '../constants/roles.js';
|
|
52
52
|
import { UserType } from '../constants/user_types.js';
|
|
53
|
-
import
|
|
53
|
+
import lodash from 'lodash';
|
|
54
|
+
var some = lodash.some;
|
|
54
55
|
var User = /** @class */ (function (_super) {
|
|
55
56
|
__extends(User, _super);
|
|
56
57
|
function User() {
|
|
@@ -3,7 +3,8 @@ import { Role } from '../constants/roles.js';
|
|
|
3
3
|
import { SystemRoles } from '../constants/system_roles.js';
|
|
4
4
|
import { DomainType } from '../constants/domain_types.js';
|
|
5
5
|
import { setup, mockFetch } from '../test_util.js';
|
|
6
|
-
import
|
|
6
|
+
import lodash from 'lodash';
|
|
7
|
+
var every = lodash.every;
|
|
7
8
|
setup();
|
|
8
9
|
test('can make User', function () {
|
|
9
10
|
var merchi = new Merchi();
|
|
@@ -33,11 +33,12 @@ var __values = (this && this.__values) || function(o) {
|
|
|
33
33
|
};
|
|
34
34
|
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
35
35
|
};
|
|
36
|
-
import
|
|
36
|
+
import lodash from 'lodash';
|
|
37
37
|
import { Entity } from '../entity.js';
|
|
38
38
|
import { InventoryGroup } from './inventory_group.js';
|
|
39
39
|
import { Product } from './product.js';
|
|
40
40
|
import { FieldType } from '../constants/field_types.js';
|
|
41
|
+
var cloneDeepWith = lodash.cloneDeepWith;
|
|
41
42
|
var VariationField = /** @class */ (function (_super) {
|
|
42
43
|
__extends(VariationField, _super);
|
|
43
44
|
function VariationField() {
|
package/package.json
CHANGED
|
@@ -7,6 +7,7 @@ import { Variation } from './variation.js';
|
|
|
7
7
|
import { VariationsGroup } from './variations_group.js';
|
|
8
8
|
import { DomainTag } from './domain_tag.js';
|
|
9
9
|
import { Draft } from './draft.js';
|
|
10
|
+
import { MerchiFile } from './file.js';
|
|
10
11
|
|
|
11
12
|
export class CartItem extends Entity {
|
|
12
13
|
protected static resourceName = 'cart_items';
|
|
@@ -61,6 +62,9 @@ export class CartItem extends Entity {
|
|
|
61
62
|
@CartItem.property({arrayType: 'Draft'})
|
|
62
63
|
public ownDrafts?: Draft[];
|
|
63
64
|
|
|
65
|
+
@CartItem.property({arrayType: 'MerchiFile'})
|
|
66
|
+
public clientFiles?: MerchiFile[];
|
|
67
|
+
|
|
64
68
|
public requiresShipment = () => {
|
|
65
69
|
if (this.product === undefined) {
|
|
66
70
|
throw 'product is undefined, did you forget to embed it?';
|
|
@@ -6,7 +6,9 @@ import { Job } from './job.js';
|
|
|
6
6
|
import { Product } from './product.js';
|
|
7
7
|
import { VariationsGroup } from './variations_group.js';
|
|
8
8
|
import { VariationFieldsOption } from './variation_fields_option.js';
|
|
9
|
-
import
|
|
9
|
+
import lodash from 'lodash';
|
|
10
|
+
|
|
11
|
+
const { some } = lodash;
|
|
10
12
|
|
|
11
13
|
export class Inventory extends Entity {
|
|
12
14
|
protected static resourceName = 'inventories';
|
package/src/entities/product.ts
CHANGED
|
@@ -3,7 +3,9 @@ import { Role } from '../constants/roles.js';
|
|
|
3
3
|
import { SystemRoles } from '../constants/system_roles.js';
|
|
4
4
|
import { DomainType } from '../constants/domain_types.js';
|
|
5
5
|
import { setup, mockFetch } from '../test_util.js';
|
|
6
|
-
import
|
|
6
|
+
import lodash from 'lodash';
|
|
7
|
+
|
|
8
|
+
const { every } = lodash;
|
|
7
9
|
|
|
8
10
|
setup();
|
|
9
11
|
|
package/src/entities/user.ts
CHANGED
|
@@ -39,7 +39,9 @@ import { DomainTag } from './domain_tag.js';
|
|
|
39
39
|
import { UserType } from '../constants/user_types.js';
|
|
40
40
|
import { SystemRoles as SR } from '../constants/system_roles.js';
|
|
41
41
|
|
|
42
|
-
import
|
|
42
|
+
import lodash from 'lodash';
|
|
43
|
+
|
|
44
|
+
const { some } = lodash;
|
|
43
45
|
|
|
44
46
|
export class User extends Entity {
|
|
45
47
|
protected static resourceName = 'users';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import lodash from 'lodash';
|
|
2
2
|
import { DiscountGroup } from './discount_group.js';
|
|
3
3
|
import { Entity } from '../entity.js';
|
|
4
4
|
import { InventoryGroup } from './inventory_group.js';
|
|
@@ -7,6 +7,8 @@ import { Variation } from './variation.js';
|
|
|
7
7
|
import { VariationFieldsOption } from './variation_fields_option.js';
|
|
8
8
|
import { FieldType } from '../constants/field_types.js';
|
|
9
9
|
|
|
10
|
+
const { cloneDeepWith } = lodash;
|
|
11
|
+
|
|
10
12
|
export class VariationField extends Entity {
|
|
11
13
|
protected static resourceName = 'variation_fields';
|
|
12
14
|
protected static singularName = 'variationField';
|