@a-cube-io/ereceipts-js-sdk 2.1.1 → 2.2.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.
package/dist/index.cjs.js CHANGED
@@ -2533,6 +2533,14 @@ class AuthStrategy {
2533
2533
  if (userRole === 'SUPPLIER') {
2534
2534
  return { mode: 'jwt', usePort444: false };
2535
2535
  }
2536
+ if (url.includes('/download-data')) {
2537
+ if (platform === 'mobile') {
2538
+ return { mode: 'mtls', usePort444: true };
2539
+ }
2540
+ else {
2541
+ return { mode: 'jwt', usePort444: true };
2542
+ }
2543
+ }
2536
2544
  if (userRole === 'CASHIER') {
2537
2545
  if (!isReceiptEndpoint) {
2538
2546
  return { mode: 'jwt', usePort444: false };
@@ -4962,6 +4970,12 @@ class PemRepositoryImpl {
4962
4970
  const response = await this.http.get(`/mf2/pems/${serialNumber}/certificates`);
4963
4971
  return PemMapper.fromCertificatesApiOutput(response.data);
4964
4972
  }
4973
+ async downloadData(serialNumber) {
4974
+ const response = await this.http.get(`/mf1/pems/${serialNumber}/download-data`, {
4975
+ responseType: 'arraybuffer',
4976
+ });
4977
+ return response.data;
4978
+ }
4965
4979
  }
4966
4980
 
4967
4981
  class DailyReportMapper {