@a-cube-io/ereceipts-js-sdk 2.0.5 → 2.0.7

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.
@@ -2174,7 +2174,7 @@ class AuthStrategy {
2174
2174
  return url.includes('/mf1/notifications');
2175
2175
  }
2176
2176
  isTelemetryEndpoint(url) {
2177
- return !!url.match(/\/mf1\/point-of-sales\/[^/]+\/telemetry/);
2177
+ return !!url.match(/\/mf1\/pems\/[^/]+\/telemetry/);
2178
2178
  }
2179
2179
  }
2180
2180
 
@@ -6305,7 +6305,7 @@ class ReceiptRepositoryImpl {
6305
6305
  }
6306
6306
  async findAll(params) {
6307
6307
  const queryParams = ReceiptMapper.toListParams(params);
6308
- const response = await this.http.get(`/mf1/point-of-sales/${params.serialNumber}/receipts`, { params: queryParams });
6308
+ const response = await this.http.get(`/mf1/pems/${params.serialNumber}/receipts`, { params: queryParams });
6309
6309
  return ReceiptMapper.pageFromApi(response.data);
6310
6310
  }
6311
6311
  async getDetails(receiptUuid, format) {
@@ -6603,11 +6603,11 @@ class PointOfSaleRepositoryImpl {
6603
6603
  this.http = http;
6604
6604
  }
6605
6605
  async findById(serialNumber) {
6606
- const response = await this.http.get(`/mf1/point-of-sales/${serialNumber}`);
6606
+ const response = await this.http.get(`/mf1/pems/${serialNumber}`);
6607
6607
  return PointOfSaleMapper.fromDetailedApiOutput(response.data);
6608
6608
  }
6609
6609
  async findAll(params) {
6610
- const response = await this.http.get('/mf1/point-of-sales', {
6610
+ const response = await this.http.get('/mf1/pems', {
6611
6611
  params: {
6612
6612
  status: params?.status,
6613
6613
  page: params?.page,
@@ -6618,17 +6618,17 @@ class PointOfSaleRepositoryImpl {
6618
6618
  }
6619
6619
  async activate(serialNumber, input) {
6620
6620
  const apiInput = PointOfSaleMapper.toActivationApiInput(input);
6621
- await this.http.post(`/mf1/point-of-sales/${serialNumber}/activation`, apiInput);
6621
+ await this.http.post(`/mf1/pems/${serialNumber}/activation`, apiInput);
6622
6622
  }
6623
6623
  async closeJournal(serialNumber) {
6624
- await this.http.post(`/mf1/point-of-sales/${serialNumber}/close`);
6624
+ await this.http.post(`/mf1/pems/${serialNumber}/close`);
6625
6625
  }
6626
6626
  async createInactivity(serialNumber) {
6627
- await this.http.post(`/mf1/point-of-sales/${serialNumber}/inactivity`);
6627
+ await this.http.post(`/mf1/pems/${serialNumber}/inactivity`);
6628
6628
  }
6629
6629
  async communicateOffline(serialNumber, input) {
6630
6630
  const apiInput = PointOfSaleMapper.toOfflineApiInput(input);
6631
- await this.http.post(`/mf1/point-of-sales/${serialNumber}/communicate-offline`, apiInput);
6631
+ await this.http.post(`/mf1/pems/${serialNumber}/communicate-offline`, apiInput);
6632
6632
  }
6633
6633
  }
6634
6634
 
@@ -6747,19 +6747,19 @@ class PemRepositoryImpl {
6747
6747
  }
6748
6748
  async create(input) {
6749
6749
  const apiInput = PemMapper.toCreateApiInput(input);
6750
- const response = await this.http.post('/mf2/point-of-sales', apiInput);
6750
+ const response = await this.http.post('/mf2/pems', apiInput);
6751
6751
  return PemMapper.fromCreateApiOutput(response.data);
6752
6752
  }
6753
6753
  async findBySerialNumber(serialNumber) {
6754
- const response = await this.http.get(`/mf2/point-of-sales/${serialNumber}`);
6754
+ const response = await this.http.get(`/mf2/pems/${serialNumber}`);
6755
6755
  return PemMapper.fromPointOfSaleMf2ApiOutput(response.data);
6756
6756
  }
6757
6757
  async findAllByMerchant(merchantUuid, page) {
6758
- const response = await this.http.get(`/mf2/merchants/${merchantUuid}/point-of-sales`, { params: { page } });
6758
+ const response = await this.http.get(`/mf2/merchants/${merchantUuid}/pems`, { params: { page } });
6759
6759
  return PemMapper.pageFromApi(response.data);
6760
6760
  }
6761
6761
  async getCertificates(serialNumber) {
6762
- const response = await this.http.get(`/mf2/point-of-sales/${serialNumber}/certificates`);
6762
+ const response = await this.http.get(`/mf2/pems/${serialNumber}/certificates`);
6763
6763
  return PemMapper.fromCertificatesApiOutput(response.data);
6764
6764
  }
6765
6765
  }
@@ -7070,7 +7070,7 @@ class TelemetryRepositoryImpl {
7070
7070
  this.http = http;
7071
7071
  }
7072
7072
  async getTelemetry(pemId) {
7073
- const response = await this.http.get(`/mf1/point-of-sales/${pemId}/telemetry`);
7073
+ const response = await this.http.get(`/mf1/pems/${pemId}/telemetry`);
7074
7074
  return TelemetryMapper.fromApiOutput(response.data);
7075
7075
  }
7076
7076
  }
@@ -7090,7 +7090,7 @@ const URL_PATTERNS = [
7090
7090
  },
7091
7091
  { pattern: /^\/mf1\/receipts\/([^/]+)$/, resource: 'receipt' },
7092
7092
  {
7093
- pattern: /^\/mf1\/point-of-sales\/([^/]+)\/receipts$/,
7093
+ pattern: /^\/mf1\/pems\/([^/]+)\/receipts$/,
7094
7094
  resource: 'receipt',
7095
7095
  parent: 'point-of-sale',
7096
7096
  isList: true,
@@ -7107,8 +7107,8 @@ const URL_PATTERNS = [
7107
7107
  { pattern: /^\/mf1\/cash-registers\/([^/]+)$/, resource: 'cash-register' },
7108
7108
  { pattern: /^\/mf1\/cash-registers$/, resource: 'cash-register', isList: true },
7109
7109
  // Point of Sale (mf1)
7110
- { pattern: /^\/mf1\/point-of-sales\/([^/]+)$/, resource: 'point-of-sale' },
7111
- { pattern: /^\/mf1\/point-of-sales$/, resource: 'point-of-sale', isList: true },
7110
+ { pattern: /^\/mf1\/pems\/([^/]+)$/, resource: 'point-of-sale' },
7111
+ { pattern: /^\/mf1\/pems$/, resource: 'point-of-sale', isList: true },
7112
7112
  // Nested resources under merchant (mf2)
7113
7113
  {
7114
7114
  pattern: /^\/mf2\/merchants\/([^/]+)\/suppliers\/([^/]+)$/,
@@ -7135,15 +7135,15 @@ const URL_PATTERNS = [
7135
7135
  },
7136
7136
  // PEM (mf2)
7137
7137
  {
7138
- pattern: /^\/mf2\/point-of-sales\/([^/]+)\/certificates$/,
7138
+ pattern: /^\/mf2\/pems\/([^/]+)\/certificates$/,
7139
7139
  resource: 'pem',
7140
7140
  action: 'certificates',
7141
7141
  },
7142
- { pattern: /^\/mf2\/point-of-sales\/([^/]+)$/, resource: 'pem' },
7142
+ { pattern: /^\/mf2\/pems\/([^/]+)$/, resource: 'pem' },
7143
7143
  // Others
7144
7144
  { pattern: /^\/mf1\/notifications/, resource: 'notification', isList: true },
7145
7145
  {
7146
- pattern: /^\/mf1\/point-of-sales\/([^/]+)\/telemetry$/,
7146
+ pattern: /^\/mf1\/pems\/([^/]+)\/telemetry$/,
7147
7147
  resource: 'telemetry',
7148
7148
  },
7149
7149
  ];