merchi_sdk_ts 1.32.0 → 1.33.0

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.
@@ -128,6 +128,10 @@ var Cart = /** @class */ (function (_super) {
128
128
  Cart.property(),
129
129
  __metadata("design:type", Number)
130
130
  ], Cart.prototype, "totalCost", void 0);
131
+ __decorate([
132
+ Cart.property(),
133
+ __metadata("design:type", Boolean)
134
+ ], Cart.prototype, "sendWhatsapp", void 0);
131
135
  __decorate([
132
136
  Cart.property({ type: 'User' }),
133
137
  __metadata("design:type", Object)
@@ -71,6 +71,10 @@ var Discount = /** @class */ (function (_super) {
71
71
  Discount.property(),
72
72
  __metadata("design:type", String)
73
73
  ], Discount.prototype, "code", void 0);
74
+ __decorate([
75
+ Discount.property({ arrayType: 'User' }),
76
+ __metadata("design:type", Array)
77
+ ], Discount.prototype, "assignedUsers", void 0);
74
78
  __decorate([
75
79
  Discount.property({ type: DiscountGroup }),
76
80
  __metadata("design:type", Object)
@@ -4,6 +4,15 @@ test('can make Discount', function () {
4
4
  var discount = new merchi.Discount();
5
5
  expect(discount).toBeTruthy();
6
6
  });
7
+ test('can set assignedUsers', function () {
8
+ var _a;
9
+ var merchi = new Merchi();
10
+ var discount = new merchi.Discount();
11
+ var user = new merchi.User();
12
+ user.id = 11;
13
+ discount.assignedUsers = [user];
14
+ expect((_a = discount.assignedUsers) === null || _a === void 0 ? void 0 : _a.map(function (assigned) { return assigned.id; })).toEqual([11]);
15
+ });
7
16
  test('discountedUnitCost', function () {
8
17
  var merchi = new Merchi();
9
18
  var discount = new merchi.Discount();
@@ -299,6 +299,10 @@ var Domain = /** @class */ (function (_super) {
299
299
  Domain.property(),
300
300
  __metadata("design:type", String)
301
301
  ], Domain.prototype, "smsName", void 0);
302
+ __decorate([
303
+ Domain.property(),
304
+ __metadata("design:type", String)
305
+ ], Domain.prototype, "whatsappPhoneNumberId", void 0);
302
306
  __decorate([
303
307
  Domain.property(),
304
308
  __metadata("design:type", Boolean)
@@ -319,6 +323,10 @@ var Domain = /** @class */ (function (_super) {
319
323
  Domain.property(),
320
324
  __metadata("design:type", Boolean)
321
325
  ], Domain.prototype, "enableSmsNotifications", void 0);
326
+ __decorate([
327
+ Domain.property(),
328
+ __metadata("design:type", Boolean)
329
+ ], Domain.prototype, "enableWhatsappNotifications", void 0);
322
330
  __decorate([
323
331
  Domain.property(),
324
332
  __metadata("design:type", Array)
@@ -73,6 +73,10 @@ var Draft = /** @class */ (function (_super) {
73
73
  Draft.property(),
74
74
  __metadata("design:type", Boolean)
75
75
  ], Draft.prototype, "sendSms", void 0);
76
+ __decorate([
77
+ Draft.property(),
78
+ __metadata("design:type", Boolean)
79
+ ], Draft.prototype, "sendWhatsapp", void 0);
76
80
  __decorate([
77
81
  Draft.property(),
78
82
  __metadata("design:type", Boolean)
@@ -70,6 +70,10 @@ var DraftComment = /** @class */ (function (_super) {
70
70
  DraftComment.property(),
71
71
  __metadata("design:type", Boolean)
72
72
  ], DraftComment.prototype, "sendEmail", void 0);
73
+ __decorate([
74
+ DraftComment.property(),
75
+ __metadata("design:type", Boolean)
76
+ ], DraftComment.prototype, "sendWhatsapp", void 0);
73
77
  __decorate([
74
78
  DraftComment.property(),
75
79
  __metadata("design:type", User)
@@ -107,6 +107,10 @@ var Invoice = /** @class */ (function (_super) {
107
107
  Invoice.property({ type: Boolean }),
108
108
  __metadata("design:type", Object)
109
109
  ], Invoice.prototype, "sendEmail", void 0);
110
+ __decorate([
111
+ Invoice.property({ type: Boolean }),
112
+ __metadata("design:type", Object)
113
+ ], Invoice.prototype, "sendWhatsapp", void 0);
110
114
  __decorate([
111
115
  Invoice.property({ type: Boolean }),
112
116
  __metadata("design:type", Object)
@@ -166,6 +166,10 @@ var Job = /** @class */ (function (_super) {
166
166
  Job.property(),
167
167
  __metadata("design:type", Boolean)
168
168
  ], Job.prototype, "needsShipping", void 0);
169
+ __decorate([
170
+ Job.property(),
171
+ __metadata("design:type", Boolean)
172
+ ], Job.prototype, "sendWhatsapp", void 0);
169
173
  __decorate([
170
174
  Job.property(),
171
175
  __metadata("design:type", Boolean)
@@ -57,6 +57,10 @@ var JobComment = /** @class */ (function (_super) {
57
57
  JobComment.property(),
58
58
  __metadata("design:type", Boolean)
59
59
  ], JobComment.prototype, "sendEmail", void 0);
60
+ __decorate([
61
+ JobComment.property(),
62
+ __metadata("design:type", Boolean)
63
+ ], JobComment.prototype, "sendWhatsapp", void 0);
60
64
  __decorate([
61
65
  JobComment.property(),
62
66
  __metadata("design:type", Boolean)
@@ -65,6 +65,10 @@ var ProductionComment = /** @class */ (function (_super) {
65
65
  ProductionComment.property(),
66
66
  __metadata("design:type", Boolean)
67
67
  ], ProductionComment.prototype, "sendEmail", void 0);
68
+ __decorate([
69
+ ProductionComment.property(),
70
+ __metadata("design:type", Boolean)
71
+ ], ProductionComment.prototype, "sendWhatsapp", void 0);
68
72
  __decorate([
69
73
  ProductionComment.property({ arrayType: "MerchiFile" }),
70
74
  __metadata("design:type", Array)
@@ -167,6 +167,10 @@ var Shipment = /** @class */ (function (_super) {
167
167
  Shipment.property(),
168
168
  __metadata("design:type", Boolean)
169
169
  ], Shipment.prototype, "sendEmail", void 0);
170
+ __decorate([
171
+ Shipment.property(),
172
+ __metadata("design:type", Boolean)
173
+ ], Shipment.prototype, "sendWhatsapp", void 0);
170
174
  __decorate([
171
175
  Shipment.property({ type: CountryTax }),
172
176
  __metadata("design:type", Object)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "merchi_sdk_ts",
3
- "version": "1.32.0",
3
+ "version": "1.33.0",
4
4
  "main": "dist/index.js",
5
5
  "type": "module",
6
6
  "repository": "git@github.com:merchisdk/merchi_sdk_ts.git",
@@ -58,6 +58,9 @@ export class Cart extends Entity {
58
58
  @Cart.property()
59
59
  public totalCost?: number;
60
60
 
61
+ @Cart.property()
62
+ public sendWhatsapp?: boolean;
63
+
61
64
  @Cart.property({type: 'User'})
62
65
  public client?: User | null;
63
66
 
@@ -6,6 +6,15 @@ test('can make Discount', () => {
6
6
  expect(discount).toBeTruthy();
7
7
  });
8
8
 
9
+ test('can set assignedUsers', () => {
10
+ const merchi = new Merchi();
11
+ const discount = new merchi.Discount();
12
+ const user = new merchi.User();
13
+ user.id = 11;
14
+ discount.assignedUsers = [user];
15
+ expect(discount.assignedUsers?.map((assigned) => assigned.id)).toEqual([11]);
16
+ });
17
+
9
18
  test('discountedUnitCost', () => {
10
19
  const merchi = new Merchi();
11
20
  const discount = new merchi.Discount();
@@ -1,5 +1,6 @@
1
1
  import { Entity } from '../entity.js';
2
2
  import { DiscountGroup } from './discount_group.js';
3
+ import { User } from './user.js';
3
4
 
4
5
  export class Discount extends Entity {
5
6
  protected static resourceName = 'discounts';
@@ -27,6 +28,9 @@ export class Discount extends Entity {
27
28
  @Discount.property()
28
29
  public code?: string;
29
30
 
31
+ @Discount.property({arrayType: 'User'})
32
+ public assignedUsers?: User[];
33
+
30
34
  @Discount.property({type: DiscountGroup})
31
35
  public discountGroup?: DiscountGroup | null;
32
36
 
@@ -486,6 +486,9 @@ export class Domain extends Entity {
486
486
  @Domain.property()
487
487
  public smsName?: string;
488
488
 
489
+ @Domain.property()
490
+ public whatsappPhoneNumberId?: string;
491
+
489
492
  @Domain.property()
490
493
  public showDomainPublicly?: boolean;
491
494
 
@@ -501,6 +504,9 @@ export class Domain extends Entity {
501
504
  @Domain.property()
502
505
  public enableSmsNotifications?: boolean;
503
506
 
507
+ @Domain.property()
508
+ public enableWhatsappNotifications?: boolean;
509
+
504
510
  @Domain.property()
505
511
  public mailgunRecords?: any[];
506
512
 
@@ -32,6 +32,9 @@ export class Draft extends Entity {
32
32
  @Draft.property()
33
33
  public sendSms?: boolean;
34
34
 
35
+ @Draft.property()
36
+ public sendWhatsapp?: boolean;
37
+
35
38
  @Draft.property()
36
39
  public sendEmail?: boolean;
37
40
 
@@ -37,6 +37,9 @@ export class DraftComment extends Entity {
37
37
  @DraftComment.property()
38
38
  public sendEmail?: boolean;
39
39
 
40
+ @DraftComment.property()
41
+ public sendWhatsapp?: boolean;
42
+
40
43
  @DraftComment.property()
41
44
  public user?: User;
42
45
 
@@ -73,6 +73,9 @@ export class Invoice extends Entity {
73
73
  @Invoice.property({type: Boolean})
74
74
  public sendEmail?: boolean | null;
75
75
 
76
+ @Invoice.property({type: Boolean})
77
+ public sendWhatsapp?: boolean | null;
78
+
76
79
  @Invoice.property({type: Boolean})
77
80
  public unpaid?: boolean | null;
78
81
 
@@ -93,6 +93,9 @@ export class Job extends Entity {
93
93
  @Job.property()
94
94
  public needsShipping?: boolean;
95
95
 
96
+ @Job.property()
97
+ public sendWhatsapp?: boolean;
98
+
96
99
  @Job.property()
97
100
  public needsInvoicing?: boolean;
98
101
 
@@ -27,6 +27,9 @@ export class JobComment extends Entity {
27
27
  @JobComment.property()
28
28
  public sendEmail?: boolean;
29
29
 
30
+ @JobComment.property()
31
+ public sendWhatsapp?: boolean;
32
+
30
33
  @JobComment.property()
31
34
  public openToClient?: boolean;
32
35
 
@@ -33,6 +33,9 @@ export class ProductionComment extends Entity {
33
33
  @ProductionComment.property()
34
34
  public sendEmail?: boolean;
35
35
 
36
+ @ProductionComment.property()
37
+ public sendWhatsapp?: boolean;
38
+
36
39
  @ProductionComment.property({arrayType: "MerchiFile"})
37
40
  public files?: MerchiFile[];
38
41
 
@@ -105,6 +105,9 @@ export class Shipment extends Entity {
105
105
  @Shipment.property()
106
106
  public sendEmail?: boolean;
107
107
 
108
+ @Shipment.property()
109
+ public sendWhatsapp?: boolean;
110
+
108
111
  @Shipment.property({type: CountryTax})
109
112
  public taxType?: CountryTax | null;
110
113