zmp-sdk 2.18.0-rc.0 → 2.18.2

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.
@@ -19689,7 +19689,7 @@
19689
19689
  })(PostFeedType || (PostFeedType = {}));
19690
19690
  var ShareSheetType;
19691
19691
  (function (ShareSheetType) {
19692
- ShareSheetType[ShareSheetType["image"] = 21] = "image";
19692
+ ShareSheetType[ShareSheetType["image"] = 1] = "image";
19693
19693
  ShareSheetType[ShareSheetType["gif"] = 11] = "gif";
19694
19694
  ShareSheetType[ShareSheetType["video"] = 12] = "video";
19695
19695
  ShareSheetType[ShareSheetType["link"] = 4] = "link";
@@ -21616,7 +21616,7 @@
21616
21616
  }
21617
21617
  _ZJSBridgeProvider_bridge = new WeakMap();
21618
21618
 
21619
- var version = "2.18.0-rc.0";
21619
+ var version = "2.18.2";
21620
21620
 
21621
21621
  class Basics {
21622
21622
  /**
@@ -23405,8 +23405,16 @@
23405
23405
  let reqData = {};
23406
23406
  switch (object.type) {
23407
23407
  case 'image':
23408
+ let photoUrls = [];
23409
+ if (Array.isArray(object.data.imageUrls) && object.data.imageUrls.length > 0) {
23410
+ photoUrls = object.data.imageUrls;
23411
+ }
23412
+ else {
23413
+ photoUrls.push(object.data.imageUrl);
23414
+ }
23408
23415
  reqData = {
23409
- photoUrls: object.data.imageUrls,
23416
+ photoUrls: photoUrls,
23417
+ photoUrl: object.data.imageUrl,
23410
23418
  caption: object.data.caption
23411
23419
  };
23412
23420
  break;
@@ -24358,13 +24366,22 @@
24358
24366
  isMeetCondition = Object.keys(condition).every((key) => lodash.get(argument, key) === condition[key]);
24359
24367
  }
24360
24368
  if (isMeetCondition) {
24361
- fields.forEach((field) => {
24362
- if (lodash.isEmpty(lodash.get(argument, field))) {
24363
- if (!lodash.isUndefined(lodash.get(defaultValue, field))) {
24364
- lodash.set(arguments[parameterIndex], field, lodash.get(defaultValue, field));
24369
+ fields.forEach((item) => {
24370
+ const isInValidField = (field) => {
24371
+ let isInValid = false;
24372
+ if (lodash.isEmpty(lodash.get(argument, field))) {
24373
+ if (!lodash.isUndefined(lodash.get(defaultValue, field))) {
24374
+ lodash.set(arguments[parameterIndex], field, lodash.get(defaultValue, field));
24375
+ }
24376
+ isInValid = true;
24365
24377
  }
24366
- else
24367
- throw apiResponse.error.missingParam(field);
24378
+ return isInValid;
24379
+ };
24380
+ if (Array.isArray(item) && item.length > 0 && item.every(isInValidField)) {
24381
+ throw apiResponse.error.missingParam(item.join(' or '));
24382
+ }
24383
+ else if (lodash.isString(item) && isInValidField(item)) {
24384
+ throw apiResponse.error.missingParam(item);
24368
24385
  }
24369
24386
  });
24370
24387
  }
@@ -24619,6 +24636,9 @@
24619
24636
  const searchParams = object.params
24620
24637
  ? new URLSearchParams(object.params)
24621
24638
  : new URLSearchParams();
24639
+ searchParams.append('utm_source', 'zalo-shortcut');
24640
+ searchParams.append('utm_medium', 'default');
24641
+ searchParams.append('utm_campaign', 'default');
24622
24642
  if (isIOS) {
24623
24643
  searchParams.append('appId', APP_ID);
24624
24644
  searchParams.append('appName', title);
@@ -25015,7 +25035,7 @@
25015
25035
  __decorate([
25016
25036
  handleError,
25017
25037
  validate,
25018
- __param(0, required(['data.imageUrls'], { if: { type: 'image' } })),
25038
+ __param(0, required([['data.imageUrl', 'data.imageUrls']], { if: { type: 'image' } })),
25019
25039
  __param(0, required(['data.link'], { if: { type: 'link' } })),
25020
25040
  __param(0, required(['data.id'], { if: { type: 'oa' } })),
25021
25041
  __param(0, required(['data.gifUrl'], { if: { type: 'gif' } })),
package/dist/index.es.js CHANGED
@@ -19686,7 +19686,7 @@ var PostFeedType;
19686
19686
  })(PostFeedType || (PostFeedType = {}));
19687
19687
  var ShareSheetType;
19688
19688
  (function (ShareSheetType) {
19689
- ShareSheetType[ShareSheetType["image"] = 21] = "image";
19689
+ ShareSheetType[ShareSheetType["image"] = 1] = "image";
19690
19690
  ShareSheetType[ShareSheetType["gif"] = 11] = "gif";
19691
19691
  ShareSheetType[ShareSheetType["video"] = 12] = "video";
19692
19692
  ShareSheetType[ShareSheetType["link"] = 4] = "link";
@@ -21613,7 +21613,7 @@ class ZJSBridgeProvider {
21613
21613
  }
21614
21614
  _ZJSBridgeProvider_bridge = new WeakMap();
21615
21615
 
21616
- var version = "2.18.0-rc.0";
21616
+ var version = "2.18.2";
21617
21617
 
21618
21618
  class Basics {
21619
21619
  /**
@@ -23402,8 +23402,16 @@ class Zalo {
23402
23402
  let reqData = {};
23403
23403
  switch (object.type) {
23404
23404
  case 'image':
23405
+ let photoUrls = [];
23406
+ if (Array.isArray(object.data.imageUrls) && object.data.imageUrls.length > 0) {
23407
+ photoUrls = object.data.imageUrls;
23408
+ }
23409
+ else {
23410
+ photoUrls.push(object.data.imageUrl);
23411
+ }
23405
23412
  reqData = {
23406
- photoUrls: object.data.imageUrls,
23413
+ photoUrls: photoUrls,
23414
+ photoUrl: object.data.imageUrl,
23407
23415
  caption: object.data.caption
23408
23416
  };
23409
23417
  break;
@@ -25487,13 +25495,22 @@ const validate = (target, propertyName, descriptor) => {
25487
25495
  isMeetCondition = Object.keys(condition).every((key) => lodash.get(argument, key) === condition[key]);
25488
25496
  }
25489
25497
  if (isMeetCondition) {
25490
- fields.forEach((field) => {
25491
- if (lodash.isEmpty(lodash.get(argument, field))) {
25492
- if (!lodash.isUndefined(lodash.get(defaultValue, field))) {
25493
- lodash.set(arguments[parameterIndex], field, lodash.get(defaultValue, field));
25498
+ fields.forEach((item) => {
25499
+ const isInValidField = (field) => {
25500
+ let isInValid = false;
25501
+ if (lodash.isEmpty(lodash.get(argument, field))) {
25502
+ if (!lodash.isUndefined(lodash.get(defaultValue, field))) {
25503
+ lodash.set(arguments[parameterIndex], field, lodash.get(defaultValue, field));
25504
+ }
25505
+ isInValid = true;
25494
25506
  }
25495
- else
25496
- throw apiResponse.error.missingParam(field);
25507
+ return isInValid;
25508
+ };
25509
+ if (Array.isArray(item) && item.length > 0 && item.every(isInValidField)) {
25510
+ throw apiResponse.error.missingParam(item.join(' or '));
25511
+ }
25512
+ else if (lodash.isString(item) && isInValidField(item)) {
25513
+ throw apiResponse.error.missingParam(item);
25497
25514
  }
25498
25515
  });
25499
25516
  }
@@ -25748,6 +25765,9 @@ class SDKCreator {
25748
25765
  const searchParams = object.params
25749
25766
  ? new URLSearchParams(object.params)
25750
25767
  : new URLSearchParams();
25768
+ searchParams.append('utm_source', 'zalo-shortcut');
25769
+ searchParams.append('utm_medium', 'default');
25770
+ searchParams.append('utm_campaign', 'default');
25751
25771
  if (isIOS) {
25752
25772
  searchParams.append('appId', APP_ID);
25753
25773
  searchParams.append('appName', title);
@@ -26144,7 +26164,7 @@ __decorate([
26144
26164
  __decorate([
26145
26165
  handleError,
26146
26166
  validate,
26147
- __param(0, required(['data.imageUrls'], { if: { type: 'image' } })),
26167
+ __param(0, required([['data.imageUrl', 'data.imageUrls']], { if: { type: 'image' } })),
26148
26168
  __param(0, required(['data.link'], { if: { type: 'link' } })),
26149
26169
  __param(0, required(['data.id'], { if: { type: 'oa' } })),
26150
26170
  __param(0, required(['data.gifUrl'], { if: { type: 'gif' } })),