@a-cube-io/ereceipts-js-sdk 2.2.2 → 2.2.3
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 +32 -0
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +52 -1
- package/dist/index.esm.js +32 -0
- package/dist/index.esm.js.map +1 -1
- package/dist/index.native.js +32 -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
|
|
|
@@ -1499,6 +1524,30 @@ interface PEMInactivityInputApiInput {
|
|
|
1499
1524
|
start_at: string;
|
|
1500
1525
|
end_at: string;
|
|
1501
1526
|
}
|
|
1527
|
+
interface EmergencyReportInputApiInput {
|
|
1528
|
+
datetime: string;
|
|
1529
|
+
documents_count: number;
|
|
1530
|
+
cash_payment_amount: string;
|
|
1531
|
+
electronic_payment_amount: string;
|
|
1532
|
+
ticket_restaurant_payment_amount: string;
|
|
1533
|
+
discount?: string;
|
|
1534
|
+
ticket_restaurant_quantity: number;
|
|
1535
|
+
entries: DailyReportEntryApiInput[];
|
|
1536
|
+
}
|
|
1537
|
+
interface DailyReportEntryApiInput {
|
|
1538
|
+
vat_rate_code: string;
|
|
1539
|
+
vat_amount: string;
|
|
1540
|
+
simplified_vat_allocation: boolean;
|
|
1541
|
+
partial_amount: string;
|
|
1542
|
+
total_returned_amount?: string;
|
|
1543
|
+
total_voided_amount?: string;
|
|
1544
|
+
total_prepaid_or_voucher_amount?: string;
|
|
1545
|
+
total_uncollected_services?: string;
|
|
1546
|
+
total_uncollected_invoiced?: string;
|
|
1547
|
+
total_uncollected_dcr_to_ssn?: string;
|
|
1548
|
+
total_uncollected_complimentary?: string;
|
|
1549
|
+
ateco_code?: string;
|
|
1550
|
+
}
|
|
1502
1551
|
declare class PointOfSaleMapper {
|
|
1503
1552
|
static toActivationApiInput(input: ActivationRequest): ActivationRequestApiInput;
|
|
1504
1553
|
static toOfflineApiInput(input: PEMStatusOfflineRequest): PEMStatusOfflineRequestApiInput;
|
|
@@ -1506,6 +1555,8 @@ declare class PointOfSaleMapper {
|
|
|
1506
1555
|
static fromDetailedApiOutput(output: PointOfSaleDetailedApiOutput): PointOfSaleDetailed;
|
|
1507
1556
|
static pageFromApi(response: Page<PointOfSaleApiOutput>): Page<PointOfSale>;
|
|
1508
1557
|
static toInactivityApiInput(input: PEMInactivityPeriodInput): PEMInactivityInputApiInput;
|
|
1558
|
+
static toEmergencyReportApiInput(input: EmergencyReportInput): EmergencyReportInputApiInput;
|
|
1559
|
+
static toDailyReportEntryApiInput(input: DailyReportEntry): DailyReportEntryApiInput;
|
|
1509
1560
|
}
|
|
1510
1561
|
|
|
1511
1562
|
interface SupplierApiOutput {
|
|
@@ -1819,4 +1870,4 @@ declare function loadPlatformAdapters(options?: PlatformAdapterOptions): Platfor
|
|
|
1819
1870
|
declare function createACubeMTLSConfig(baseUrl: string, timeout?: number, autoInitialize?: boolean, forcePort444?: boolean): MTLSAdapterConfig;
|
|
1820
1871
|
|
|
1821
1872
|
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 };
|
|
1873
|
+
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
|
@@ -4785,6 +4785,34 @@ class PointOfSaleMapper {
|
|
|
4785
4785
|
end_at: input.endAt,
|
|
4786
4786
|
};
|
|
4787
4787
|
}
|
|
4788
|
+
static toEmergencyReportApiInput(input) {
|
|
4789
|
+
return {
|
|
4790
|
+
datetime: input.datetime,
|
|
4791
|
+
documents_count: input.documentsCount,
|
|
4792
|
+
cash_payment_amount: input.cashPaymentAmount,
|
|
4793
|
+
electronic_payment_amount: input.electronicPaymentAmount,
|
|
4794
|
+
ticket_restaurant_payment_amount: input.ticketRestaurantPaymentAmount,
|
|
4795
|
+
ticket_restaurant_quantity: input.ticketRestaurantQuantity,
|
|
4796
|
+
entries: input.entries.map((entry) => this.toDailyReportEntryApiInput(entry)),
|
|
4797
|
+
discount: input.discount,
|
|
4798
|
+
};
|
|
4799
|
+
}
|
|
4800
|
+
static toDailyReportEntryApiInput(input) {
|
|
4801
|
+
return {
|
|
4802
|
+
vat_rate_code: input.vatRateCode,
|
|
4803
|
+
vat_amount: input.vatAmount,
|
|
4804
|
+
simplified_vat_allocation: input.simplifiedVatAllocation,
|
|
4805
|
+
partial_amount: input.partialAmount,
|
|
4806
|
+
total_returned_amount: input.totalReturnedAmount,
|
|
4807
|
+
total_voided_amount: input.totalVoidedAmount,
|
|
4808
|
+
total_prepaid_or_voucher_amount: input.totalPrepaidOrVoucherAmount,
|
|
4809
|
+
total_uncollected_services: input.totalUncollectedServices,
|
|
4810
|
+
total_uncollected_invoiced: input.totalUncollectedInvoiced,
|
|
4811
|
+
total_uncollected_dcr_to_ssn: input.totalUncollectedDcrToSsn,
|
|
4812
|
+
total_uncollected_complimentary: input.totalUncollectedComplimentary,
|
|
4813
|
+
ateco_code: input.atecoCode,
|
|
4814
|
+
};
|
|
4815
|
+
}
|
|
4788
4816
|
}
|
|
4789
4817
|
|
|
4790
4818
|
// this repository is used for MF1 endpoints
|
|
@@ -4817,6 +4845,10 @@ class PointOfSaleRepositoryImpl {
|
|
|
4817
4845
|
const apiInput = PointOfSaleMapper.toInactivityApiInput(input);
|
|
4818
4846
|
await this.http.post(`/mf1/pems/${serialNumber}/inactivity-period`, apiInput);
|
|
4819
4847
|
}
|
|
4848
|
+
async uploadEmergencyReport(serialNumber, input) {
|
|
4849
|
+
const apiInput = PointOfSaleMapper.toEmergencyReportApiInput(input);
|
|
4850
|
+
await this.http.post(`/mf1/pems/${serialNumber}/emergency-report`, apiInput);
|
|
4851
|
+
}
|
|
4820
4852
|
async communicateOffline(serialNumber, input) {
|
|
4821
4853
|
const apiInput = PointOfSaleMapper.toOfflineApiInput(input);
|
|
4822
4854
|
await this.http.post(`/mf1/pems/${serialNumber}/communicate-offline`, apiInput);
|