@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.
- package/dist/index.cjs.js +19 -19
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.esm.js +19 -19
- package/dist/index.esm.js.map +1 -1
- package/dist/index.native.js +19 -19
- package/dist/index.native.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -2197,7 +2197,7 @@ class AuthStrategy {
|
|
|
2197
2197
|
return url.includes('/mf1/notifications');
|
|
2198
2198
|
}
|
|
2199
2199
|
isTelemetryEndpoint(url) {
|
|
2200
|
-
return !!url.match(/\/mf1\/
|
|
2200
|
+
return !!url.match(/\/mf1\/pems\/[^/]+\/telemetry/);
|
|
2201
2201
|
}
|
|
2202
2202
|
}
|
|
2203
2203
|
|
|
@@ -6328,7 +6328,7 @@ class ReceiptRepositoryImpl {
|
|
|
6328
6328
|
}
|
|
6329
6329
|
async findAll(params) {
|
|
6330
6330
|
const queryParams = ReceiptMapper.toListParams(params);
|
|
6331
|
-
const response = await this.http.get(`/mf1/
|
|
6331
|
+
const response = await this.http.get(`/mf1/pems/${params.serialNumber}/receipts`, { params: queryParams });
|
|
6332
6332
|
return ReceiptMapper.pageFromApi(response.data);
|
|
6333
6333
|
}
|
|
6334
6334
|
async getDetails(receiptUuid, format) {
|
|
@@ -6626,11 +6626,11 @@ class PointOfSaleRepositoryImpl {
|
|
|
6626
6626
|
this.http = http;
|
|
6627
6627
|
}
|
|
6628
6628
|
async findById(serialNumber) {
|
|
6629
|
-
const response = await this.http.get(`/mf1/
|
|
6629
|
+
const response = await this.http.get(`/mf1/pems/${serialNumber}`);
|
|
6630
6630
|
return PointOfSaleMapper.fromDetailedApiOutput(response.data);
|
|
6631
6631
|
}
|
|
6632
6632
|
async findAll(params) {
|
|
6633
|
-
const response = await this.http.get('/mf1/
|
|
6633
|
+
const response = await this.http.get('/mf1/pems', {
|
|
6634
6634
|
params: {
|
|
6635
6635
|
status: params?.status,
|
|
6636
6636
|
page: params?.page,
|
|
@@ -6641,17 +6641,17 @@ class PointOfSaleRepositoryImpl {
|
|
|
6641
6641
|
}
|
|
6642
6642
|
async activate(serialNumber, input) {
|
|
6643
6643
|
const apiInput = PointOfSaleMapper.toActivationApiInput(input);
|
|
6644
|
-
await this.http.post(`/mf1/
|
|
6644
|
+
await this.http.post(`/mf1/pems/${serialNumber}/activation`, apiInput);
|
|
6645
6645
|
}
|
|
6646
6646
|
async closeJournal(serialNumber) {
|
|
6647
|
-
await this.http.post(`/mf1/
|
|
6647
|
+
await this.http.post(`/mf1/pems/${serialNumber}/close`);
|
|
6648
6648
|
}
|
|
6649
6649
|
async createInactivity(serialNumber) {
|
|
6650
|
-
await this.http.post(`/mf1/
|
|
6650
|
+
await this.http.post(`/mf1/pems/${serialNumber}/inactivity`);
|
|
6651
6651
|
}
|
|
6652
6652
|
async communicateOffline(serialNumber, input) {
|
|
6653
6653
|
const apiInput = PointOfSaleMapper.toOfflineApiInput(input);
|
|
6654
|
-
await this.http.post(`/mf1/
|
|
6654
|
+
await this.http.post(`/mf1/pems/${serialNumber}/communicate-offline`, apiInput);
|
|
6655
6655
|
}
|
|
6656
6656
|
}
|
|
6657
6657
|
|
|
@@ -6770,19 +6770,19 @@ class PemRepositoryImpl {
|
|
|
6770
6770
|
}
|
|
6771
6771
|
async create(input) {
|
|
6772
6772
|
const apiInput = PemMapper.toCreateApiInput(input);
|
|
6773
|
-
const response = await this.http.post('/mf2/
|
|
6773
|
+
const response = await this.http.post('/mf2/pems', apiInput);
|
|
6774
6774
|
return PemMapper.fromCreateApiOutput(response.data);
|
|
6775
6775
|
}
|
|
6776
6776
|
async findBySerialNumber(serialNumber) {
|
|
6777
|
-
const response = await this.http.get(`/mf2/
|
|
6777
|
+
const response = await this.http.get(`/mf2/pems/${serialNumber}`);
|
|
6778
6778
|
return PemMapper.fromPointOfSaleMf2ApiOutput(response.data);
|
|
6779
6779
|
}
|
|
6780
6780
|
async findAllByMerchant(merchantUuid, page) {
|
|
6781
|
-
const response = await this.http.get(`/mf2/merchants/${merchantUuid}/
|
|
6781
|
+
const response = await this.http.get(`/mf2/merchants/${merchantUuid}/pems`, { params: { page } });
|
|
6782
6782
|
return PemMapper.pageFromApi(response.data);
|
|
6783
6783
|
}
|
|
6784
6784
|
async getCertificates(serialNumber) {
|
|
6785
|
-
const response = await this.http.get(`/mf2/
|
|
6785
|
+
const response = await this.http.get(`/mf2/pems/${serialNumber}/certificates`);
|
|
6786
6786
|
return PemMapper.fromCertificatesApiOutput(response.data);
|
|
6787
6787
|
}
|
|
6788
6788
|
}
|
|
@@ -7093,7 +7093,7 @@ class TelemetryRepositoryImpl {
|
|
|
7093
7093
|
this.http = http;
|
|
7094
7094
|
}
|
|
7095
7095
|
async getTelemetry(pemId) {
|
|
7096
|
-
const response = await this.http.get(`/mf1/
|
|
7096
|
+
const response = await this.http.get(`/mf1/pems/${pemId}/telemetry`);
|
|
7097
7097
|
return TelemetryMapper.fromApiOutput(response.data);
|
|
7098
7098
|
}
|
|
7099
7099
|
}
|
|
@@ -7113,7 +7113,7 @@ const URL_PATTERNS = [
|
|
|
7113
7113
|
},
|
|
7114
7114
|
{ pattern: /^\/mf1\/receipts\/([^/]+)$/, resource: 'receipt' },
|
|
7115
7115
|
{
|
|
7116
|
-
pattern: /^\/mf1\/
|
|
7116
|
+
pattern: /^\/mf1\/pems\/([^/]+)\/receipts$/,
|
|
7117
7117
|
resource: 'receipt',
|
|
7118
7118
|
parent: 'point-of-sale',
|
|
7119
7119
|
isList: true,
|
|
@@ -7130,8 +7130,8 @@ const URL_PATTERNS = [
|
|
|
7130
7130
|
{ pattern: /^\/mf1\/cash-registers\/([^/]+)$/, resource: 'cash-register' },
|
|
7131
7131
|
{ pattern: /^\/mf1\/cash-registers$/, resource: 'cash-register', isList: true },
|
|
7132
7132
|
// Point of Sale (mf1)
|
|
7133
|
-
{ pattern: /^\/mf1\/
|
|
7134
|
-
{ pattern: /^\/mf1\/
|
|
7133
|
+
{ pattern: /^\/mf1\/pems\/([^/]+)$/, resource: 'point-of-sale' },
|
|
7134
|
+
{ pattern: /^\/mf1\/pems$/, resource: 'point-of-sale', isList: true },
|
|
7135
7135
|
// Nested resources under merchant (mf2)
|
|
7136
7136
|
{
|
|
7137
7137
|
pattern: /^\/mf2\/merchants\/([^/]+)\/suppliers\/([^/]+)$/,
|
|
@@ -7158,15 +7158,15 @@ const URL_PATTERNS = [
|
|
|
7158
7158
|
},
|
|
7159
7159
|
// PEM (mf2)
|
|
7160
7160
|
{
|
|
7161
|
-
pattern: /^\/mf2\/
|
|
7161
|
+
pattern: /^\/mf2\/pems\/([^/]+)\/certificates$/,
|
|
7162
7162
|
resource: 'pem',
|
|
7163
7163
|
action: 'certificates',
|
|
7164
7164
|
},
|
|
7165
|
-
{ pattern: /^\/mf2\/
|
|
7165
|
+
{ pattern: /^\/mf2\/pems\/([^/]+)$/, resource: 'pem' },
|
|
7166
7166
|
// Others
|
|
7167
7167
|
{ pattern: /^\/mf1\/notifications/, resource: 'notification', isList: true },
|
|
7168
7168
|
{
|
|
7169
|
-
pattern: /^\/mf1\/
|
|
7169
|
+
pattern: /^\/mf1\/pems\/([^/]+)\/telemetry$/,
|
|
7170
7170
|
resource: 'telemetry',
|
|
7171
7171
|
},
|
|
7172
7172
|
];
|