chayns-api 2.4.28 → 2.4.30

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.
@@ -572,20 +572,32 @@ class AppWrapper {
572
572
  key,
573
573
  accessMode
574
574
  });
575
+ if (['iOS', 'Mac OS'].includes(this.values.device.os) && typeof (result === null || result === void 0 ? void 0 : result.object) === 'string') {
576
+ try {
577
+ return JSON.parse(result.object);
578
+ } catch {
579
+ console.warn('[chayns-api] could not parse result from storageGetItem', result.object);
580
+ }
581
+ }
575
582
  return result === null || result === void 0 ? void 0 : result.object;
576
583
  },
577
584
  storageRemoveItem: async (key, accessMode) => {
578
585
  this.appCall(73, {
579
586
  key,
587
+ object: ['iOS', 'Mac OS'].includes(this.values.device.os) ? JSON.stringify(null) : undefined,
580
588
  accessMode
581
589
  }, {
582
590
  awaitResult: false
583
591
  });
584
592
  },
585
593
  storageSetItem: async (key, value, accessMode, tappIds) => {
594
+ let object = value;
595
+ if (['iOS', 'Mac OS'].includes(this.values.device.os)) {
596
+ object = JSON.stringify(value);
597
+ }
586
598
  this.appCall(73, {
587
599
  key,
588
- object: value,
600
+ object,
589
601
  accessMode,
590
602
  tappIDs: tappIds
591
603
  }, {
@@ -539,20 +539,32 @@ export class AppWrapper {
539
539
  key,
540
540
  accessMode
541
541
  });
542
+ if (['iOS', 'Mac OS'].includes(this.values.device.os) && typeof (result === null || result === void 0 ? void 0 : result.object) === 'string') {
543
+ try {
544
+ return JSON.parse(result.object);
545
+ } catch {
546
+ console.warn('[chayns-api] could not parse result from storageGetItem', result.object);
547
+ }
548
+ }
542
549
  return result === null || result === void 0 ? void 0 : result.object;
543
550
  },
544
551
  storageRemoveItem: async (key, accessMode) => {
545
552
  this.appCall(73, {
546
553
  key,
554
+ object: ['iOS', 'Mac OS'].includes(this.values.device.os) ? JSON.stringify(null) : undefined,
547
555
  accessMode
548
556
  }, {
549
557
  awaitResult: false
550
558
  });
551
559
  },
552
560
  storageSetItem: async (key, value, accessMode, tappIds) => {
561
+ let object = value;
562
+ if (['iOS', 'Mac OS'].includes(this.values.device.os)) {
563
+ object = JSON.stringify(value);
564
+ }
553
565
  this.appCall(73, {
554
566
  key,
555
- object: value,
567
+ object,
556
568
  accessMode,
557
569
  tappIDs: tappIds
558
570
  }, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chayns-api",
3
- "version": "2.4.28",
3
+ "version": "2.4.30",
4
4
  "description": "new chayns api",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",