merchi_sdk_ts 1.41.0 → 1.42.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.
@@ -136,6 +136,10 @@ var Cart = /** @class */ (function (_super) {
136
136
  Cart.property(),
137
137
  __metadata("design:type", Boolean)
138
138
  ], Cart.prototype, "sendWhatsapp", void 0);
139
+ __decorate([
140
+ Cart.property(),
141
+ __metadata("design:type", Boolean)
142
+ ], Cart.prototype, "isTest", void 0);
139
143
  __decorate([
140
144
  Cart.property({ type: 'User' }),
141
145
  __metadata("design:type", Object)
@@ -49,3 +49,9 @@ test('preserves server payment engine hint', function () {
49
49
  entity.fromJson({ id: 1, stripePaymentEngine: 'wallet' });
50
50
  expect(entity.toJson()).toMatchObject({ stripePaymentEngine: 'wallet' });
51
51
  });
52
+ test('preserves isTest', function () {
53
+ var merchi = new Merchi();
54
+ var entity = new merchi.Cart();
55
+ entity.fromJson({ id: 1, isTest: true });
56
+ expect(entity.toJson()).toMatchObject({ isTest: true });
57
+ });
@@ -119,6 +119,10 @@ var Invoice = /** @class */ (function (_super) {
119
119
  Invoice.property({ type: Boolean }),
120
120
  __metadata("design:type", Object)
121
121
  ], Invoice.prototype, "unpaid", void 0);
122
+ __decorate([
123
+ Invoice.property({ type: Boolean }),
124
+ __metadata("design:type", Object)
125
+ ], Invoice.prototype, "isTest", void 0);
122
126
  __decorate([
123
127
  Invoice.property(),
124
128
  __metadata("design:type", String)
@@ -514,6 +514,10 @@ var Job = /** @class */ (function (_super) {
514
514
  Job.property(),
515
515
  __metadata("design:type", Boolean)
516
516
  ], Job.prototype, "isNewClient", void 0);
517
+ __decorate([
518
+ Job.property(),
519
+ __metadata("design:type", Boolean)
520
+ ], Job.prototype, "isTest", void 0);
517
521
  return Job;
518
522
  }(Entity));
519
523
  export { Job };
@@ -7,6 +7,12 @@ test('can make Job', function () {
7
7
  var job = new merchi.Job();
8
8
  expect(job).toBeTruthy();
9
9
  });
10
+ test('preserves isTest', function () {
11
+ var merchi = new Merchi();
12
+ var job = new merchi.Job();
13
+ job.fromJson({ id: 1, isTest: true });
14
+ expect(job.toJson()).toMatchObject({ isTest: true });
15
+ });
10
16
  test('Job deadline serialised to milliseconds in form data', function () {
11
17
  var merchi = new Merchi();
12
18
  var job = new merchi.Job();
package/dist/entity.js CHANGED
@@ -688,6 +688,9 @@ var Entity = /** @class */ (function () {
688
688
  if (options.isDraft !== undefined) {
689
689
  fetchOptions.query.push(['is_draft', options.isDraft.toString()]);
690
690
  }
691
+ if (options.isTest !== undefined) {
692
+ fetchOptions.query.push(['is_test', options.isTest.toString()]);
693
+ }
691
694
  if (options.managedOnly !== undefined) {
692
695
  fetchOptions.query.push(['managed_only',
693
696
  options.managedOnly.toString()]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "merchi_sdk_ts",
3
- "version": "1.41.0",
3
+ "version": "1.42.0",
4
4
  "main": "dist/index.js",
5
5
  "type": "module",
6
6
  "repository": "git@github.com:merchisdk/merchi_sdk_ts.git",
@@ -55,3 +55,10 @@ test('preserves server payment engine hint', () => {
55
55
  entity.fromJson({ id: 1, stripePaymentEngine: 'wallet' });
56
56
  expect(entity.toJson()).toMatchObject({ stripePaymentEngine: 'wallet' });
57
57
  });
58
+
59
+ test('preserves isTest', () => {
60
+ const merchi = new Merchi();
61
+ const entity = new merchi.Cart();
62
+ entity.fromJson({ id: 1, isTest: true });
63
+ expect(entity.toJson()).toMatchObject({ isTest: true });
64
+ });
@@ -64,6 +64,9 @@ export class Cart extends Entity {
64
64
  @Cart.property()
65
65
  public sendWhatsapp?: boolean;
66
66
 
67
+ @Cart.property()
68
+ public isTest?: boolean;
69
+
67
70
  @Cart.property({type: 'User'})
68
71
  public client?: User | null;
69
72
 
@@ -82,6 +82,9 @@ export class Invoice extends Entity {
82
82
  @Invoice.property({type: Boolean})
83
83
  public unpaid?: boolean | null;
84
84
 
85
+ @Invoice.property({type: Boolean})
86
+ public isTest?: boolean | null;
87
+
85
88
  @Invoice.property()
86
89
  public currency?: string;
87
90
 
@@ -10,6 +10,13 @@ test('can make Job', () => {
10
10
  expect(job).toBeTruthy();
11
11
  });
12
12
 
13
+ test('preserves isTest', () => {
14
+ const merchi = new Merchi();
15
+ const job = new merchi.Job();
16
+ job.fromJson({ id: 1, isTest: true });
17
+ expect(job.toJson()).toMatchObject({ isTest: true });
18
+ });
19
+
13
20
  test('Job deadline serialised to milliseconds in form data', () => {
14
21
  const merchi = new Merchi();
15
22
  const job = new merchi.Job();
@@ -354,6 +354,9 @@ export class Job extends Entity {
354
354
  @Job.property()
355
355
  public isNewClient?: boolean;
356
356
 
357
+ @Job.property()
358
+ public isTest?: boolean;
359
+
357
360
  public getQuote = () => {
358
361
  const resource = '/specialised-order-estimate/';
359
362
  const data = this.toFormData({excludeOld: false});
package/src/entity.ts CHANGED
@@ -130,6 +130,7 @@ interface ListOptions {
130
130
  productTypes?: ProductType[];
131
131
  publicOnly?: boolean;
132
132
  isDraft?: boolean;
133
+ isTest?: boolean;
133
134
  q?: string;
134
135
  receiverId?: number;
135
136
  userAsReceiver?: number;
@@ -498,6 +499,9 @@ export class Entity {
498
499
  if (options.isDraft !== undefined) {
499
500
  fetchOptions.query.push(['is_draft', options.isDraft.toString()]);
500
501
  }
502
+ if (options.isTest !== undefined) {
503
+ fetchOptions.query.push(['is_test', options.isTest.toString()]);
504
+ }
501
505
  if (options.managedOnly !== undefined) {
502
506
  fetchOptions.query.push(['managed_only',
503
507
  options.managedOnly.toString()]);