@a-cube-io/ereceipts-js-sdk 2.2.2 → 2.2.4
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 +33 -0
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +56 -3
- package/dist/index.esm.js +33 -0
- package/dist/index.esm.js.map +1 -1
- package/dist/index.native.js +33 -0
- package/dist/index.native.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -457,6 +457,30 @@ interface PEMInactivityPeriodInput {
|
|
|
457
457
|
startAt: string;
|
|
458
458
|
endAt: string;
|
|
459
459
|
}
|
|
460
|
+
interface EmergencyReportInput {
|
|
461
|
+
datetime: string;
|
|
462
|
+
documentsCount: number;
|
|
463
|
+
cashPaymentAmount: string;
|
|
464
|
+
electronicPaymentAmount: string;
|
|
465
|
+
discount?: string;
|
|
466
|
+
ticketRestaurantPaymentAmount: string;
|
|
467
|
+
ticketRestaurantQuantity: number;
|
|
468
|
+
entries: DailyReportEntry[];
|
|
469
|
+
}
|
|
470
|
+
interface DailyReportEntry {
|
|
471
|
+
vatRateCode: string;
|
|
472
|
+
vatAmount: string;
|
|
473
|
+
simplifiedVatAllocation: boolean;
|
|
474
|
+
partialAmount: string;
|
|
475
|
+
totalReturnedAmount?: string;
|
|
476
|
+
totalVoidedAmount?: string;
|
|
477
|
+
totalPrepaidOrVoucherAmount?: string;
|
|
478
|
+
totalUncollectedServices?: string;
|
|
479
|
+
totalUncollectedInvoiced?: string;
|
|
480
|
+
totalUncollectedDcrToSsn?: string;
|
|
481
|
+
totalUncollectedComplimentary?: string;
|
|
482
|
+
atecoCode?: string;
|
|
483
|
+
}
|
|
460
484
|
|
|
461
485
|
interface PemData {
|
|
462
486
|
version: string;
|
|
@@ -489,6 +513,7 @@ interface IPointOfSaleRepository {
|
|
|
489
513
|
closeJournal(serialNumber: string): Promise<void>;
|
|
490
514
|
createInactivityPeriod(serialNumber: string, input: PEMInactivityPeriodInput): Promise<void>;
|
|
491
515
|
communicateOffline(serialNumber: string, input: PEMStatusOfflineRequest): Promise<void>;
|
|
516
|
+
uploadEmergencyReport(serialNumber: string, input: EmergencyReportInput): Promise<void>;
|
|
492
517
|
downloadData(serialNumber: string): Promise<ArrayBuffer>;
|
|
493
518
|
}
|
|
494
519
|
|
|
@@ -532,7 +557,8 @@ interface Receipt {
|
|
|
532
557
|
documentDatetime?: string;
|
|
533
558
|
isReturnable: boolean;
|
|
534
559
|
isVoidable: boolean;
|
|
535
|
-
pdfUrl
|
|
560
|
+
pdfUrl: string;
|
|
561
|
+
status: ReceiptStatus;
|
|
536
562
|
parentReceiptUuid?: string;
|
|
537
563
|
}
|
|
538
564
|
interface ReceiptDetails extends Receipt {
|
|
@@ -1306,8 +1332,9 @@ interface ReceiptApiOutput {
|
|
|
1306
1332
|
document_datetime?: string;
|
|
1307
1333
|
is_returnable: boolean;
|
|
1308
1334
|
is_voidable: boolean;
|
|
1309
|
-
pdf_url
|
|
1335
|
+
pdf_url: string;
|
|
1310
1336
|
parent_receipt_uuid?: string;
|
|
1337
|
+
status: 'ready' | 'sent';
|
|
1311
1338
|
}
|
|
1312
1339
|
interface ReceiptDetailsApiOutput extends ReceiptApiOutput {
|
|
1313
1340
|
customer_lottery_code?: string;
|
|
@@ -1499,6 +1526,30 @@ interface PEMInactivityInputApiInput {
|
|
|
1499
1526
|
start_at: string;
|
|
1500
1527
|
end_at: string;
|
|
1501
1528
|
}
|
|
1529
|
+
interface EmergencyReportInputApiInput {
|
|
1530
|
+
datetime: string;
|
|
1531
|
+
documents_count: number;
|
|
1532
|
+
cash_payment_amount: string;
|
|
1533
|
+
electronic_payment_amount: string;
|
|
1534
|
+
ticket_restaurant_payment_amount: string;
|
|
1535
|
+
discount?: string;
|
|
1536
|
+
ticket_restaurant_quantity: number;
|
|
1537
|
+
entries: DailyReportEntryApiInput[];
|
|
1538
|
+
}
|
|
1539
|
+
interface DailyReportEntryApiInput {
|
|
1540
|
+
vat_rate_code: string;
|
|
1541
|
+
vat_amount: string;
|
|
1542
|
+
simplified_vat_allocation: boolean;
|
|
1543
|
+
partial_amount: string;
|
|
1544
|
+
total_returned_amount?: string;
|
|
1545
|
+
total_voided_amount?: string;
|
|
1546
|
+
total_prepaid_or_voucher_amount?: string;
|
|
1547
|
+
total_uncollected_services?: string;
|
|
1548
|
+
total_uncollected_invoiced?: string;
|
|
1549
|
+
total_uncollected_dcr_to_ssn?: string;
|
|
1550
|
+
total_uncollected_complimentary?: string;
|
|
1551
|
+
ateco_code?: string;
|
|
1552
|
+
}
|
|
1502
1553
|
declare class PointOfSaleMapper {
|
|
1503
1554
|
static toActivationApiInput(input: ActivationRequest): ActivationRequestApiInput;
|
|
1504
1555
|
static toOfflineApiInput(input: PEMStatusOfflineRequest): PEMStatusOfflineRequestApiInput;
|
|
@@ -1506,6 +1557,8 @@ declare class PointOfSaleMapper {
|
|
|
1506
1557
|
static fromDetailedApiOutput(output: PointOfSaleDetailedApiOutput): PointOfSaleDetailed;
|
|
1507
1558
|
static pageFromApi(response: Page<PointOfSaleApiOutput>): Page<PointOfSale>;
|
|
1508
1559
|
static toInactivityApiInput(input: PEMInactivityPeriodInput): PEMInactivityInputApiInput;
|
|
1560
|
+
static toEmergencyReportApiInput(input: EmergencyReportInput): EmergencyReportInputApiInput;
|
|
1561
|
+
static toDailyReportEntryApiInput(input: DailyReportEntry): DailyReportEntryApiInput;
|
|
1509
1562
|
}
|
|
1510
1563
|
|
|
1511
1564
|
interface SupplierApiOutput {
|
|
@@ -1819,4 +1872,4 @@ declare function loadPlatformAdapters(options?: PlatformAdapterOptions): Platfor
|
|
|
1819
1872
|
declare function createACubeMTLSConfig(baseUrl: string, timeout?: number, autoInitialize?: boolean, forcePort444?: boolean): MTLSAdapterConfig;
|
|
1820
1873
|
|
|
1821
1874
|
export { ACubeSDK, ACubeSDKError, AddressMapper, AppStateService, AuthenticationService, CashRegisterMapper, CashierMapper, CertificateService, CertificateValidator, ConfigManager, DAILY_REPORT_STATUS_OPTIONS, DailyReportMapper, EXEMPT_VAT_CODES, GOOD_OR_SERVICE_OPTIONS, GoodOrServiceSchema, JournalMapper, MTLSError, MTLSErrorType, MerchantMapper, NOTIFICATION_CODES, NOTIFICATION_LEVELS, NOTIFICATION_SCOPES, NOTIFICATION_SOURCES, NOTIFICATION_TYPES, NotificationMapper, NotificationService, PEM_STATUS_OPTIONS, PEM_TYPE_OPTIONS, PemMapper, PointOfSaleMapper, RECEIPT_PROOF_TYPE_OPTIONS, RECEIPT_READY, RECEIPT_SENT, RECEIPT_SORT_ASCENDING, RECEIPT_SORT_DESCENDING, ReceiptMapper, ReceiptProofTypeSchema, SDKManager, STANDARD_VAT_RATES, SupplierMapper, TelemetryMapper, TelemetryService, VAT_RATE_CODES, VAT_RATE_CODE_OPTIONS, VatRateCodeSchema, createACubeMTLSConfig, createACubeSDK, createPrefixedLogger, createACubeSDK as default, extractRoles, hasAnyRole, hasRole, isTokenExpired, loadPlatformAdapters, logger, parseJwt };
|
|
1822
|
-
export type { ActivationRequest, ActivationRequestApiInput, Address, AddressApiOutput, AppMode, AppState, AuthConfig, AuthCredentials$1 as AuthCredentials, CashRegister, CashRegisterApiOutput, CashRegisterCreateApiInput, CashRegisterCreateInput, CashRegisterDetailed, CashRegisterDetailedApiOutput, CashRegisterListParams, CashRegisterUpdateApiInput, CashRegisterUpdateInput, Cashier, CashierApiOutput, CashierCreateApiInput, CashierCreateInput, CashierListParams, CashierStatus, CertificateData, CertificateInfo, DailyReport, DailyReportApiOutput, DailyReportStatus, DailyReportsParams, Domain, Environment, GoodOrService, GoodOrServiceType, HttpRequestConfig, HttpResponse, IAuthHandler, ICashRegisterRepository, ICashierRepository, ICertificatePort, IDailyReportRepository, IHttpPort, IJournalRepository, IMTLSAdapter, IMTLSAdapterFactory, IMTLSPort, IMerchantRepository, INetworkPort, INotificationRepository, IPemRepository, IPointOfSaleRepository, IReceiptRepository, ISecureStoragePort, IStoragePort, ISupplierRepository, ITelemetryRepository, ITokenStoragePort, JWTPayload, Journal, JournalApiOutput, JournalCloseInput, JournalStatus, JournalsParams, LdJsonPage, LotteryApiOutput, LotterySecretRequestApiOutput, LotterySecretRequestInfo, LotteryTelemetry, MTLSConnectionConfig, MTLSRequestConfig, MTLSResponse, ManagedServices, Merchant, MerchantApiOutput, MerchantCreateApiInput, MerchantCreateInput, MerchantUpdateApiInput, MerchantUpdateInput, MerchantsParams, MessageApiOutput, MessageInfo, Notification, NotificationApiOutput, NotificationCode, NotificationCommunicationRestored, NotificationCommunicationRestoredApiOutput, NotificationEvents, NotificationLevel, NotificationListParams, NotificationMf2Unreachable, NotificationMf2UnreachableApiOutput, NotificationPageApiOutput, NotificationPayloadBlockAt, NotificationScope, NotificationServiceConfig, NotificationSource, NotificationStatusOffline, NotificationStatusOfflineApiOutput, NotificationStatusOnline, NotificationStatusOnlineApiOutput, NotificationSyncState, NotificationType, PEMInactivityInputApiInput, PEMInactivityPeriodInput, PEMStatus, PEMStatusOfflineRequest, PEMStatusOfflineRequestApiInput, Page, PemCertificates, PemCertificatesApiOutput, PemCreateApiInput, PemCreateApiOutput, PemCreateInput, PemCreateOutput, PemData, PendingReceipts, PendingReceiptsApiOutput, PlatformAdapters, PointOfSale, PointOfSaleApiOutput, PointOfSaleDetailed, PointOfSaleDetailedApiOutput, PointOfSaleListParams, PointOfSaleMf2, PointOfSaleMf2ApiOutput, PointOfSaleType, Receipt, ReceiptApiInput, ReceiptApiOutput, ReceiptDetails, ReceiptDetailsApiOutput, ReceiptInput, ReceiptItem, ReceiptItemApiInput, ReceiptListParams, ReceiptProofType, ReceiptProofTypeType, ReceiptReturnApiInput, ReceiptReturnInput, ReceiptReturnItem, ReceiptSortOrder, ReceiptStatus, ReceiptType, ReturnViaDifferentDeviceApiInput, ReturnViaDifferentDeviceInput, ReturnWithProofApiInput, ReturnWithProofInput, ReturnableReceiptItem, ReturnableReceiptItemApiOutput, SDKConfig, SDKEvents, SDKManagerConfig, SDKManagerEvents, SoftwareVersionStatus, StoredCertificate, Supplier, SupplierApiOutput, SupplierCreateApiInput, SupplierCreateInput, SupplierUpdateApiInput, SupplierUpdateInput, SuppliersParams, Telemetry, TelemetryApiOutput, TelemetryMerchant, TelemetryMerchantApiOutput, TelemetryOperations, TelemetryServiceConfig, TelemetrySoftware, TelemetrySoftwareApiOutput, TelemetrySoftwareVersion, TelemetrySoftwareVersionApiOutput, TelemetryState, TelemetrySupplier, TelemetrySupplierApiOutput, TransmissionAttemptApiOutput, TransmissionAttemptInfo, User$1 as User, UserRole, UserRoles, VatRateCode, VatRateCodeType, VoidReceiptApiInput, VoidReceiptInput, VoidViaDifferentDeviceApiInput, VoidViaDifferentDeviceInput, VoidWithProofApiInput, VoidWithProofInput, WarningState };
|
|
1875
|
+
export type { ActivationRequest, ActivationRequestApiInput, Address, AddressApiOutput, AppMode, AppState, AuthConfig, AuthCredentials$1 as AuthCredentials, CashRegister, CashRegisterApiOutput, CashRegisterCreateApiInput, CashRegisterCreateInput, CashRegisterDetailed, CashRegisterDetailedApiOutput, CashRegisterListParams, CashRegisterUpdateApiInput, CashRegisterUpdateInput, Cashier, CashierApiOutput, CashierCreateApiInput, CashierCreateInput, CashierListParams, CashierStatus, CertificateData, CertificateInfo, DailyReport, DailyReportApiOutput, DailyReportEntry, DailyReportEntryApiInput, DailyReportStatus, DailyReportsParams, Domain, EmergencyReportInput, EmergencyReportInputApiInput, Environment, GoodOrService, GoodOrServiceType, HttpRequestConfig, HttpResponse, IAuthHandler, ICashRegisterRepository, ICashierRepository, ICertificatePort, IDailyReportRepository, IHttpPort, IJournalRepository, IMTLSAdapter, IMTLSAdapterFactory, IMTLSPort, IMerchantRepository, INetworkPort, INotificationRepository, IPemRepository, IPointOfSaleRepository, IReceiptRepository, ISecureStoragePort, IStoragePort, ISupplierRepository, ITelemetryRepository, ITokenStoragePort, JWTPayload, Journal, JournalApiOutput, JournalCloseInput, JournalStatus, JournalsParams, LdJsonPage, LotteryApiOutput, LotterySecretRequestApiOutput, LotterySecretRequestInfo, LotteryTelemetry, MTLSConnectionConfig, MTLSRequestConfig, MTLSResponse, ManagedServices, Merchant, MerchantApiOutput, MerchantCreateApiInput, MerchantCreateInput, MerchantUpdateApiInput, MerchantUpdateInput, MerchantsParams, MessageApiOutput, MessageInfo, Notification, NotificationApiOutput, NotificationCode, NotificationCommunicationRestored, NotificationCommunicationRestoredApiOutput, NotificationEvents, NotificationLevel, NotificationListParams, NotificationMf2Unreachable, NotificationMf2UnreachableApiOutput, NotificationPageApiOutput, NotificationPayloadBlockAt, NotificationScope, NotificationServiceConfig, NotificationSource, NotificationStatusOffline, NotificationStatusOfflineApiOutput, NotificationStatusOnline, NotificationStatusOnlineApiOutput, NotificationSyncState, NotificationType, PEMInactivityInputApiInput, PEMInactivityPeriodInput, PEMStatus, PEMStatusOfflineRequest, PEMStatusOfflineRequestApiInput, Page, PemCertificates, PemCertificatesApiOutput, PemCreateApiInput, PemCreateApiOutput, PemCreateInput, PemCreateOutput, PemData, PendingReceipts, PendingReceiptsApiOutput, PlatformAdapters, PointOfSale, PointOfSaleApiOutput, PointOfSaleDetailed, PointOfSaleDetailedApiOutput, PointOfSaleListParams, PointOfSaleMf2, PointOfSaleMf2ApiOutput, PointOfSaleType, Receipt, ReceiptApiInput, ReceiptApiOutput, ReceiptDetails, ReceiptDetailsApiOutput, ReceiptInput, ReceiptItem, ReceiptItemApiInput, ReceiptListParams, ReceiptProofType, ReceiptProofTypeType, ReceiptReturnApiInput, ReceiptReturnInput, ReceiptReturnItem, ReceiptSortOrder, ReceiptStatus, ReceiptType, ReturnViaDifferentDeviceApiInput, ReturnViaDifferentDeviceInput, ReturnWithProofApiInput, ReturnWithProofInput, ReturnableReceiptItem, ReturnableReceiptItemApiOutput, SDKConfig, SDKEvents, SDKManagerConfig, SDKManagerEvents, SoftwareVersionStatus, StoredCertificate, Supplier, SupplierApiOutput, SupplierCreateApiInput, SupplierCreateInput, SupplierUpdateApiInput, SupplierUpdateInput, SuppliersParams, Telemetry, TelemetryApiOutput, TelemetryMerchant, TelemetryMerchantApiOutput, TelemetryOperations, TelemetryServiceConfig, TelemetrySoftware, TelemetrySoftwareApiOutput, TelemetrySoftwareVersion, TelemetrySoftwareVersionApiOutput, TelemetryState, TelemetrySupplier, TelemetrySupplierApiOutput, TransmissionAttemptApiOutput, TransmissionAttemptInfo, User$1 as User, UserRole, UserRoles, VatRateCode, VatRateCodeType, VoidReceiptApiInput, VoidReceiptInput, VoidViaDifferentDeviceApiInput, VoidViaDifferentDeviceInput, VoidWithProofApiInput, VoidWithProofInput, WarningState };
|
package/dist/index.esm.js
CHANGED
|
@@ -4360,6 +4360,7 @@ class ReceiptMapper {
|
|
|
4360
4360
|
isReturnable: output.is_returnable,
|
|
4361
4361
|
isVoidable: output.is_voidable,
|
|
4362
4362
|
pdfUrl: output.pdf_url,
|
|
4363
|
+
status: output.status,
|
|
4363
4364
|
parentReceiptUuid: output.parent_receipt_uuid,
|
|
4364
4365
|
};
|
|
4365
4366
|
}
|
|
@@ -4785,6 +4786,34 @@ class PointOfSaleMapper {
|
|
|
4785
4786
|
end_at: input.endAt,
|
|
4786
4787
|
};
|
|
4787
4788
|
}
|
|
4789
|
+
static toEmergencyReportApiInput(input) {
|
|
4790
|
+
return {
|
|
4791
|
+
datetime: input.datetime,
|
|
4792
|
+
documents_count: input.documentsCount,
|
|
4793
|
+
cash_payment_amount: input.cashPaymentAmount,
|
|
4794
|
+
electronic_payment_amount: input.electronicPaymentAmount,
|
|
4795
|
+
ticket_restaurant_payment_amount: input.ticketRestaurantPaymentAmount,
|
|
4796
|
+
ticket_restaurant_quantity: input.ticketRestaurantQuantity,
|
|
4797
|
+
entries: input.entries.map((entry) => this.toDailyReportEntryApiInput(entry)),
|
|
4798
|
+
discount: input.discount,
|
|
4799
|
+
};
|
|
4800
|
+
}
|
|
4801
|
+
static toDailyReportEntryApiInput(input) {
|
|
4802
|
+
return {
|
|
4803
|
+
vat_rate_code: input.vatRateCode,
|
|
4804
|
+
vat_amount: input.vatAmount,
|
|
4805
|
+
simplified_vat_allocation: input.simplifiedVatAllocation,
|
|
4806
|
+
partial_amount: input.partialAmount,
|
|
4807
|
+
total_returned_amount: input.totalReturnedAmount,
|
|
4808
|
+
total_voided_amount: input.totalVoidedAmount,
|
|
4809
|
+
total_prepaid_or_voucher_amount: input.totalPrepaidOrVoucherAmount,
|
|
4810
|
+
total_uncollected_services: input.totalUncollectedServices,
|
|
4811
|
+
total_uncollected_invoiced: input.totalUncollectedInvoiced,
|
|
4812
|
+
total_uncollected_dcr_to_ssn: input.totalUncollectedDcrToSsn,
|
|
4813
|
+
total_uncollected_complimentary: input.totalUncollectedComplimentary,
|
|
4814
|
+
ateco_code: input.atecoCode,
|
|
4815
|
+
};
|
|
4816
|
+
}
|
|
4788
4817
|
}
|
|
4789
4818
|
|
|
4790
4819
|
// this repository is used for MF1 endpoints
|
|
@@ -4817,6 +4846,10 @@ class PointOfSaleRepositoryImpl {
|
|
|
4817
4846
|
const apiInput = PointOfSaleMapper.toInactivityApiInput(input);
|
|
4818
4847
|
await this.http.post(`/mf1/pems/${serialNumber}/inactivity-period`, apiInput);
|
|
4819
4848
|
}
|
|
4849
|
+
async uploadEmergencyReport(serialNumber, input) {
|
|
4850
|
+
const apiInput = PointOfSaleMapper.toEmergencyReportApiInput(input);
|
|
4851
|
+
await this.http.post(`/mf1/pems/${serialNumber}/emergency-report`, apiInput);
|
|
4852
|
+
}
|
|
4820
4853
|
async communicateOffline(serialNumber, input) {
|
|
4821
4854
|
const apiInput = PointOfSaleMapper.toOfflineApiInput(input);
|
|
4822
4855
|
await this.http.post(`/mf1/pems/${serialNumber}/communicate-offline`, apiInput);
|