@a-cube-io/ereceipts-js-sdk 2.2.0 → 2.2.1

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.d.ts CHANGED
@@ -430,7 +430,7 @@ interface PointOfSale {
430
430
  serialNumber: string;
431
431
  status: PEMStatus;
432
432
  address: Address;
433
- operationalStatus: string;
433
+ journalStatus: string;
434
434
  }
435
435
  interface PointOfSaleDetailed extends PointOfSale {
436
436
  registrationKey?: string;
@@ -476,7 +476,6 @@ interface IPemRepository {
476
476
  findBySerialNumber(serialNumber: string): Promise<PointOfSaleMf2>;
477
477
  findAllByMerchant(merchantUuid: string, page?: number): Promise<PointOfSaleMf2[]>;
478
478
  getCertificates(serialNumber: string): Promise<PemCertificates>;
479
- downloadData(serialNumber: string): Promise<ArrayBuffer>;
480
479
  }
481
480
 
482
481
  interface IPointOfSaleRepository {
@@ -486,6 +485,7 @@ interface IPointOfSaleRepository {
486
485
  closeJournal(serialNumber: string): Promise<void>;
487
486
  createInactivity(serialNumber: string): Promise<void>;
488
487
  communicateOffline(serialNumber: string, input: PEMStatusOfflineRequest): Promise<void>;
488
+ downloadData(serialNumber: string): Promise<ArrayBuffer>;
489
489
  }
490
490
 
491
491
  type GoodOrService = 'goods' | 'service';
@@ -1479,7 +1479,7 @@ interface PointOfSaleApiOutput {
1479
1479
  serial_number: string;
1480
1480
  status: PEMStatus;
1481
1481
  address: AddressApiOutput;
1482
- operational_status: string;
1482
+ journal_status: string;
1483
1483
  }
1484
1484
  interface PointOfSaleDetailedApiOutput extends PointOfSaleApiOutput {
1485
1485
  registration_key?: string;
package/dist/index.esm.js CHANGED
@@ -2510,14 +2510,6 @@ class AuthStrategy {
2510
2510
  if (userRole === 'SUPPLIER') {
2511
2511
  return { mode: 'jwt', usePort444: false };
2512
2512
  }
2513
- if (url.includes('/download-data')) {
2514
- if (platform === 'mobile') {
2515
- return { mode: 'mtls', usePort444: true };
2516
- }
2517
- else {
2518
- return { mode: 'jwt', usePort444: true };
2519
- }
2520
- }
2521
2513
  if (userRole === 'CASHIER') {
2522
2514
  if (!isReceiptEndpoint) {
2523
2515
  return { mode: 'jwt', usePort444: false };
@@ -4763,7 +4755,7 @@ class PointOfSaleMapper {
4763
4755
  serialNumber: output.serial_number,
4764
4756
  status: output.status,
4765
4757
  address: AddressMapper.fromApi(output.address),
4766
- operationalStatus: output.operational_status,
4758
+ journalStatus: output.journal_status,
4767
4759
  };
4768
4760
  }
4769
4761
  static fromDetailedApiOutput(output) {
@@ -4783,6 +4775,7 @@ class PointOfSaleMapper {
4783
4775
  }
4784
4776
  }
4785
4777
 
4778
+ // this repository is used for MF1 endpoints
4786
4779
  class PointOfSaleRepositoryImpl {
4787
4780
  constructor(http) {
4788
4781
  this.http = http;
@@ -4815,6 +4808,12 @@ class PointOfSaleRepositoryImpl {
4815
4808
  const apiInput = PointOfSaleMapper.toOfflineApiInput(input);
4816
4809
  await this.http.post(`/mf1/pems/${serialNumber}/communicate-offline`, apiInput);
4817
4810
  }
4811
+ async downloadData(serialNumber) {
4812
+ const response = await this.http.get(`/mf1/pems/${serialNumber}/download-data`, {
4813
+ responseType: 'arraybuffer',
4814
+ });
4815
+ return response.data;
4816
+ }
4818
4817
  }
4819
4818
 
4820
4819
  class SupplierMapper {
@@ -4926,6 +4925,7 @@ class PemMapper {
4926
4925
  }
4927
4926
  }
4928
4927
 
4928
+ // this repository is used for MF2 endpoints
4929
4929
  class PemRepositoryImpl {
4930
4930
  constructor(http) {
4931
4931
  this.http = http;
@@ -4947,12 +4947,6 @@ class PemRepositoryImpl {
4947
4947
  const response = await this.http.get(`/mf2/pems/${serialNumber}/certificates`);
4948
4948
  return PemMapper.fromCertificatesApiOutput(response.data);
4949
4949
  }
4950
- async downloadData(serialNumber) {
4951
- const response = await this.http.get(`/mf1/pems/${serialNumber}/download-data`, {
4952
- responseType: 'arraybuffer',
4953
- });
4954
- return response.data;
4955
- }
4956
4950
  }
4957
4951
 
4958
4952
  class DailyReportMapper {