@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.d.ts
CHANGED
|
@@ -814,7 +814,7 @@ interface Telemetry {
|
|
|
814
814
|
interface ITelemetryRepository {
|
|
815
815
|
/**
|
|
816
816
|
* Get telemetry snapshot for a PEM
|
|
817
|
-
* Endpoint: GET /mf1/
|
|
817
|
+
* Endpoint: GET /mf1/pems/{pem_id}/telemetry (mTLS, port 444)
|
|
818
818
|
*/
|
|
819
819
|
getTelemetry(pemId: string): Promise<Telemetry>;
|
|
820
820
|
}
|
|
@@ -2544,11 +2544,11 @@ declare const AddressSchema: z.ZodObject<{
|
|
|
2544
2544
|
province: z.ZodString;
|
|
2545
2545
|
}, z.core.$strip>;
|
|
2546
2546
|
declare const PEMStatusSchema: z.ZodEnum<{
|
|
2547
|
-
ONLINE: "ONLINE";
|
|
2548
|
-
OFFLINE: "OFFLINE";
|
|
2549
2547
|
NEW: "NEW";
|
|
2550
2548
|
REGISTERED: "REGISTERED";
|
|
2551
2549
|
ACTIVATED: "ACTIVATED";
|
|
2550
|
+
ONLINE: "ONLINE";
|
|
2551
|
+
OFFLINE: "OFFLINE";
|
|
2552
2552
|
DISCARDED: "DISCARDED";
|
|
2553
2553
|
}>;
|
|
2554
2554
|
declare const ActivationRequestSchema: z.ZodObject<{
|
package/dist/index.esm.js
CHANGED
|
@@ -2174,7 +2174,7 @@ class AuthStrategy {
|
|
|
2174
2174
|
return url.includes('/mf1/notifications');
|
|
2175
2175
|
}
|
|
2176
2176
|
isTelemetryEndpoint(url) {
|
|
2177
|
-
return !!url.match(/\/mf1\/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
6621
|
+
await this.http.post(`/mf1/pems/${serialNumber}/activation`, apiInput);
|
|
6622
6622
|
}
|
|
6623
6623
|
async closeJournal(serialNumber) {
|
|
6624
|
-
await this.http.post(`/mf1/
|
|
6624
|
+
await this.http.post(`/mf1/pems/${serialNumber}/close`);
|
|
6625
6625
|
}
|
|
6626
6626
|
async createInactivity(serialNumber) {
|
|
6627
|
-
await this.http.post(`/mf1/
|
|
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/
|
|
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/
|
|
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/
|
|
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}/
|
|
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/
|
|
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/
|
|
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\/
|
|
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\/
|
|
7111
|
-
{ pattern: /^\/mf1\/
|
|
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\/
|
|
7138
|
+
pattern: /^\/mf2\/pems\/([^/]+)\/certificates$/,
|
|
7139
7139
|
resource: 'pem',
|
|
7140
7140
|
action: 'certificates',
|
|
7141
7141
|
},
|
|
7142
|
-
{ pattern: /^\/mf2\/
|
|
7142
|
+
{ pattern: /^\/mf2\/pems\/([^/]+)$/, resource: 'pem' },
|
|
7143
7143
|
// Others
|
|
7144
7144
|
{ pattern: /^\/mf1\/notifications/, resource: 'notification', isList: true },
|
|
7145
7145
|
{
|
|
7146
|
-
pattern: /^\/mf1\/
|
|
7146
|
+
pattern: /^\/mf1\/pems\/([^/]+)\/telemetry$/,
|
|
7147
7147
|
resource: 'telemetry',
|
|
7148
7148
|
},
|
|
7149
7149
|
];
|