@a-cube-io/ereceipts-js-sdk 2.0.9 → 2.1.1
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/README.md +1 -7
- package/dist/index.cjs.js +273 -3459
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +81 -1502
- package/dist/index.esm.js +295 -3403
- package/dist/index.esm.js.map +1 -1
- package/dist/index.native.js +295 -3403
- package/dist/index.native.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
-
import { AxiosInstance, AxiosResponse } from 'axios';
|
|
3
2
|
import * as z from 'zod';
|
|
4
3
|
|
|
5
4
|
interface IStoragePort {
|
|
@@ -16,8 +15,6 @@ interface ISecureStoragePort extends IStoragePort {
|
|
|
16
15
|
isAvailable(): Promise<boolean>;
|
|
17
16
|
getSecurityLevel(): Promise<string>;
|
|
18
17
|
}
|
|
19
|
-
type IStorage = IStoragePort;
|
|
20
|
-
type ISecureStorage = ISecureStoragePort;
|
|
21
18
|
|
|
22
19
|
interface NetworkStatus {
|
|
23
20
|
online: boolean;
|
|
@@ -35,51 +32,6 @@ interface INetworkPort {
|
|
|
35
32
|
getNetworkInfo(): Promise<NetworkInfo | null>;
|
|
36
33
|
destroy(): void;
|
|
37
34
|
}
|
|
38
|
-
type INetworkMonitor = INetworkPort;
|
|
39
|
-
|
|
40
|
-
interface ICachePort {
|
|
41
|
-
get<T>(key: string): Promise<CachedItem<T> | null>;
|
|
42
|
-
set<T>(key: string, data: T): Promise<void>;
|
|
43
|
-
setItem<T>(key: string, item: CachedItem<T>): Promise<void>;
|
|
44
|
-
setBatch<T>(items: Array<[string, CachedItem<T>]>): Promise<void>;
|
|
45
|
-
invalidate(pattern: string): Promise<void>;
|
|
46
|
-
clear(): Promise<void>;
|
|
47
|
-
getSize(): Promise<CacheSize>;
|
|
48
|
-
cleanup(): Promise<number>;
|
|
49
|
-
getKeys(pattern?: string): Promise<string[]>;
|
|
50
|
-
}
|
|
51
|
-
interface CachedItem<T> {
|
|
52
|
-
data: T;
|
|
53
|
-
timestamp: number;
|
|
54
|
-
compressed?: boolean;
|
|
55
|
-
}
|
|
56
|
-
interface CacheSize {
|
|
57
|
-
entries: number;
|
|
58
|
-
bytes: number;
|
|
59
|
-
lastCleanup: number;
|
|
60
|
-
}
|
|
61
|
-
interface CacheOptions {
|
|
62
|
-
maxSize?: number;
|
|
63
|
-
maxEntries?: number;
|
|
64
|
-
compression?: boolean;
|
|
65
|
-
compressionThreshold?: number;
|
|
66
|
-
debugEnabled?: boolean;
|
|
67
|
-
}
|
|
68
|
-
type ICacheAdapter = ICachePort;
|
|
69
|
-
|
|
70
|
-
type CacheResource = 'receipt' | 'merchant' | 'cashier' | 'cash-register' | 'point-of-sale' | 'supplier' | 'daily-report' | 'journal' | 'pem' | 'notification' | 'telemetry';
|
|
71
|
-
interface CacheResourceConfig {
|
|
72
|
-
ttlMs: number;
|
|
73
|
-
cacheList: boolean;
|
|
74
|
-
cacheItem: boolean;
|
|
75
|
-
}
|
|
76
|
-
interface ICacheKeyGenerator {
|
|
77
|
-
generate(url: string, params?: Record<string, unknown>): string;
|
|
78
|
-
parseResource(url: string): CacheResource | undefined;
|
|
79
|
-
getInvalidationPatterns(url: string, method: string): string[];
|
|
80
|
-
getTTL(url: string): number;
|
|
81
|
-
shouldCache(url: string): boolean;
|
|
82
|
-
}
|
|
83
35
|
|
|
84
36
|
interface CertificateData {
|
|
85
37
|
certificate: string;
|
|
@@ -139,37 +91,6 @@ interface IMTLSAdapterFactory {
|
|
|
139
91
|
getPlatform(): string;
|
|
140
92
|
}
|
|
141
93
|
type IMTLSAdapter = IMTLSPort;
|
|
142
|
-
declare class PlatformDetector {
|
|
143
|
-
static detectPlatform(): 'react-native' | 'node' | 'web';
|
|
144
|
-
static isReactNative(): boolean;
|
|
145
|
-
static isNode(): boolean;
|
|
146
|
-
static isWeb(): boolean;
|
|
147
|
-
static getPlatformDetails(): {
|
|
148
|
-
platform: "react-native" | "node" | "web";
|
|
149
|
-
userAgent: string;
|
|
150
|
-
nodeVersion: string | undefined;
|
|
151
|
-
isExpo: boolean;
|
|
152
|
-
hasWindow: boolean;
|
|
153
|
-
hasDocument: boolean;
|
|
154
|
-
hasProcess: boolean;
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
interface CompressionResult {
|
|
159
|
-
data: string;
|
|
160
|
-
compressed: boolean;
|
|
161
|
-
originalSize: number;
|
|
162
|
-
compressedSize: number;
|
|
163
|
-
}
|
|
164
|
-
interface DecompressionResult {
|
|
165
|
-
data: string;
|
|
166
|
-
wasCompressed: boolean;
|
|
167
|
-
}
|
|
168
|
-
interface ICompressionPort {
|
|
169
|
-
compress(data: string, threshold?: number): CompressionResult;
|
|
170
|
-
decompress(data: string, compressed: boolean): DecompressionResult;
|
|
171
|
-
estimateSavings(data: string): number;
|
|
172
|
-
}
|
|
173
94
|
|
|
174
95
|
interface HttpRequestConfig {
|
|
175
96
|
headers?: Record<string, string>;
|
|
@@ -235,7 +156,6 @@ interface PlatformAdapters {
|
|
|
235
156
|
storage: IStoragePort;
|
|
236
157
|
secureStorage: ISecureStoragePort;
|
|
237
158
|
networkMonitor: INetworkPort;
|
|
238
|
-
cache?: ICachePort;
|
|
239
159
|
mtls?: IMTLSPort;
|
|
240
160
|
}
|
|
241
161
|
|
|
@@ -819,155 +739,6 @@ interface ITelemetryRepository {
|
|
|
819
739
|
getTelemetry(pemId: string): Promise<Telemetry>;
|
|
820
740
|
}
|
|
821
741
|
|
|
822
|
-
type OperationType = 'CREATE' | 'UPDATE' | 'DELETE';
|
|
823
|
-
type ResourceType = 'receipt' | 'cashier' | 'point-of-sale' | 'cash-register' | 'merchant' | 'pem';
|
|
824
|
-
type OperationStatus = 'pending' | 'processing' | 'completed' | 'failed';
|
|
825
|
-
type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
826
|
-
interface QueuedOperation {
|
|
827
|
-
id: string;
|
|
828
|
-
type: OperationType;
|
|
829
|
-
resource: ResourceType;
|
|
830
|
-
endpoint: string;
|
|
831
|
-
method: HttpMethod;
|
|
832
|
-
data?: unknown;
|
|
833
|
-
headers?: Record<string, string>;
|
|
834
|
-
status: OperationStatus;
|
|
835
|
-
createdAt: number;
|
|
836
|
-
updatedAt: number;
|
|
837
|
-
retryCount: number;
|
|
838
|
-
maxRetries: number;
|
|
839
|
-
error?: string;
|
|
840
|
-
priority: number;
|
|
841
|
-
}
|
|
842
|
-
interface SyncResult {
|
|
843
|
-
operation: QueuedOperation;
|
|
844
|
-
success: boolean;
|
|
845
|
-
error?: string;
|
|
846
|
-
response?: unknown;
|
|
847
|
-
}
|
|
848
|
-
interface BatchSyncResult {
|
|
849
|
-
totalOperations: number;
|
|
850
|
-
successCount: number;
|
|
851
|
-
failureCount: number;
|
|
852
|
-
results: SyncResult[];
|
|
853
|
-
}
|
|
854
|
-
interface QueueConfig {
|
|
855
|
-
maxRetries: number;
|
|
856
|
-
retryDelay: number;
|
|
857
|
-
maxRetryDelay: number;
|
|
858
|
-
backoffMultiplier: number;
|
|
859
|
-
maxQueueSize: number;
|
|
860
|
-
batchSize: number;
|
|
861
|
-
syncInterval: number;
|
|
862
|
-
}
|
|
863
|
-
interface QueueEvents {
|
|
864
|
-
onOperationAdded?: (operation: QueuedOperation) => void;
|
|
865
|
-
onOperationCompleted?: (result: SyncResult) => void;
|
|
866
|
-
onOperationFailed?: (result: SyncResult) => void;
|
|
867
|
-
onBatchSyncCompleted?: (result: BatchSyncResult) => void;
|
|
868
|
-
onQueueEmpty?: () => void;
|
|
869
|
-
onError?: (error: Error) => void;
|
|
870
|
-
}
|
|
871
|
-
interface QueueStats {
|
|
872
|
-
total: number;
|
|
873
|
-
pending: number;
|
|
874
|
-
processing: number;
|
|
875
|
-
completed: number;
|
|
876
|
-
failed: number;
|
|
877
|
-
}
|
|
878
|
-
interface SyncStatus {
|
|
879
|
-
isOnline: boolean;
|
|
880
|
-
isProcessing: boolean;
|
|
881
|
-
queueStats: QueueStats;
|
|
882
|
-
}
|
|
883
|
-
declare const DEFAULT_QUEUE_CONFIG: QueueConfig;
|
|
884
|
-
|
|
885
|
-
declare class OfflineManager {
|
|
886
|
-
private queue;
|
|
887
|
-
private syncManager;
|
|
888
|
-
private readonly queueSubject;
|
|
889
|
-
private readonly syncStatusSubject;
|
|
890
|
-
private readonly destroy$;
|
|
891
|
-
get queue$(): Observable<QueuedOperation[]>;
|
|
892
|
-
get syncStatus$(): Observable<SyncStatus>;
|
|
893
|
-
constructor(storage: IStoragePort, httpPort: IHttpPort, networkMonitor: INetworkPort, config?: Partial<QueueConfig>, events?: QueueEvents, _cache?: ICachePort);
|
|
894
|
-
private updateQueueState;
|
|
895
|
-
queueOperation(type: OperationType, resource: ResourceType, endpoint: string, method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE', data?: unknown, priority?: number): Promise<string>;
|
|
896
|
-
queueReceiptCreation(receiptData: unknown, priority?: number): Promise<string>;
|
|
897
|
-
queueReceiptVoid(voidData: unknown, priority?: number): Promise<string>;
|
|
898
|
-
queueReceiptReturn(returnData: unknown, priority?: number): Promise<string>;
|
|
899
|
-
queueCashierCreation(cashierData: unknown, priority?: number): Promise<string>;
|
|
900
|
-
isOnline(): boolean;
|
|
901
|
-
getStatus(): SyncStatus;
|
|
902
|
-
getPendingCount(): number;
|
|
903
|
-
isEmpty(): boolean;
|
|
904
|
-
sync(): Promise<BatchSyncResult | null>;
|
|
905
|
-
retryFailed(): Promise<void>;
|
|
906
|
-
clearCompleted(): Promise<void>;
|
|
907
|
-
clearFailed(): Promise<void>;
|
|
908
|
-
clearAll(): Promise<void>;
|
|
909
|
-
getOperation(id: string): QueuedOperation | undefined;
|
|
910
|
-
removeOperation(id: string): Promise<boolean>;
|
|
911
|
-
getQueueStats(): QueueStats;
|
|
912
|
-
startAutoSync(): void;
|
|
913
|
-
stopAutoSync(): void;
|
|
914
|
-
destroy(): void;
|
|
915
|
-
}
|
|
916
|
-
|
|
917
|
-
declare class OperationQueue {
|
|
918
|
-
private storage;
|
|
919
|
-
private config;
|
|
920
|
-
private events;
|
|
921
|
-
private static readonly QUEUE_KEY;
|
|
922
|
-
private queue;
|
|
923
|
-
private processing;
|
|
924
|
-
private syncIntervalId?;
|
|
925
|
-
constructor(storage: IStoragePort, config?: QueueConfig, events?: QueueEvents);
|
|
926
|
-
addOperation(type: OperationType, resource: ResourceType, endpoint: string, method: HttpMethod, data?: unknown, priority?: number): Promise<string>;
|
|
927
|
-
getPendingOperations(): QueuedOperation[];
|
|
928
|
-
getOperation(id: string): QueuedOperation | undefined;
|
|
929
|
-
removeOperation(id: string): Promise<boolean>;
|
|
930
|
-
updateOperation(id: string, updates: Partial<QueuedOperation>): Promise<boolean>;
|
|
931
|
-
getStats(): QueueStats;
|
|
932
|
-
clearQueue(): Promise<void>;
|
|
933
|
-
clearCompleted(): Promise<void>;
|
|
934
|
-
clearFailed(): Promise<void>;
|
|
935
|
-
retryFailed(): Promise<void>;
|
|
936
|
-
getNextBatch(): QueuedOperation[];
|
|
937
|
-
isEmpty(): boolean;
|
|
938
|
-
startAutoSync(): void;
|
|
939
|
-
stopAutoSync(): void;
|
|
940
|
-
setProcessing(value: boolean): void;
|
|
941
|
-
isCurrentlyProcessing(): boolean;
|
|
942
|
-
private loadQueue;
|
|
943
|
-
private saveQueue;
|
|
944
|
-
private generateId;
|
|
945
|
-
destroy(): void;
|
|
946
|
-
}
|
|
947
|
-
|
|
948
|
-
declare class SyncManager {
|
|
949
|
-
private queue;
|
|
950
|
-
private httpPort;
|
|
951
|
-
private networkMonitor;
|
|
952
|
-
private config;
|
|
953
|
-
private events;
|
|
954
|
-
private isOnline;
|
|
955
|
-
private readonly destroy$;
|
|
956
|
-
private networkSubscription?;
|
|
957
|
-
constructor(queue: OperationQueue, httpPort: IHttpPort, networkMonitor: INetworkPort, config: QueueConfig, events?: QueueEvents);
|
|
958
|
-
private setupNetworkMonitoring;
|
|
959
|
-
syncPendingOperations(): Promise<BatchSyncResult>;
|
|
960
|
-
private processOperation;
|
|
961
|
-
private executeOperation;
|
|
962
|
-
private isRetryableError;
|
|
963
|
-
private calculateRetryDelay;
|
|
964
|
-
private delay;
|
|
965
|
-
isCurrentlyOnline(): boolean;
|
|
966
|
-
triggerSync(): Promise<BatchSyncResult | null>;
|
|
967
|
-
getSyncStatus(): SyncStatus;
|
|
968
|
-
destroy(): void;
|
|
969
|
-
}
|
|
970
|
-
|
|
971
742
|
type Domain = 'ereceipts-it.acubeapi.com';
|
|
972
743
|
type UserRole = 'ROLE_SUPPLIER' | 'ROLE_CASHIER' | 'ROLE_MERCHANT';
|
|
973
744
|
type UserRoles = Record<Domain, UserRole[]>;
|
|
@@ -1018,15 +789,12 @@ interface SDKEvents {
|
|
|
1018
789
|
onUserChanged?: (user: User$1 | null) => void;
|
|
1019
790
|
onAuthError?: (error: ACubeSDKError) => void;
|
|
1020
791
|
onNetworkStatusChanged?: (online: boolean) => void;
|
|
1021
|
-
onOfflineOperationAdded?: (operationId: string) => void;
|
|
1022
|
-
onOfflineOperationCompleted?: (operationId: string, success: boolean) => void;
|
|
1023
792
|
}
|
|
1024
793
|
declare class ACubeSDK {
|
|
1025
794
|
private events;
|
|
1026
795
|
private config;
|
|
1027
796
|
private adapters?;
|
|
1028
797
|
private authService?;
|
|
1029
|
-
private offlineManager?;
|
|
1030
798
|
private certificateService?;
|
|
1031
799
|
private container?;
|
|
1032
800
|
private isInitialized;
|
|
@@ -1050,7 +818,6 @@ declare class ACubeSDK {
|
|
|
1050
818
|
logout(): Promise<void>;
|
|
1051
819
|
getCurrentUser(): Promise<User$1 | null>;
|
|
1052
820
|
isAuthenticated(): Promise<boolean>;
|
|
1053
|
-
getOfflineManager(): OfflineManager;
|
|
1054
821
|
isOnline(): boolean;
|
|
1055
822
|
getConfig(): SDKConfig;
|
|
1056
823
|
updateConfig(updates: Partial<SDKConfig>): void;
|
|
@@ -1094,118 +861,6 @@ declare class ACubeSDK {
|
|
|
1094
861
|
}
|
|
1095
862
|
declare function createACubeSDK(config: SDKConfig, customAdapters?: PlatformAdapters, events?: SDKEvents): Promise<ACubeSDK>;
|
|
1096
863
|
|
|
1097
|
-
declare const DI_TOKENS: {
|
|
1098
|
-
readonly HTTP_PORT: symbol;
|
|
1099
|
-
readonly BASE_HTTP_PORT: symbol;
|
|
1100
|
-
readonly STORAGE_PORT: symbol;
|
|
1101
|
-
readonly SECURE_STORAGE_PORT: symbol;
|
|
1102
|
-
readonly NETWORK_PORT: symbol;
|
|
1103
|
-
readonly CACHE_PORT: symbol;
|
|
1104
|
-
readonly CACHE_KEY_GENERATOR: symbol;
|
|
1105
|
-
readonly MTLS_PORT: symbol;
|
|
1106
|
-
readonly TOKEN_STORAGE_PORT: symbol;
|
|
1107
|
-
readonly RECEIPT_REPOSITORY: symbol;
|
|
1108
|
-
readonly MERCHANT_REPOSITORY: symbol;
|
|
1109
|
-
readonly CASHIER_REPOSITORY: symbol;
|
|
1110
|
-
readonly CASH_REGISTER_REPOSITORY: symbol;
|
|
1111
|
-
readonly POINT_OF_SALE_REPOSITORY: symbol;
|
|
1112
|
-
readonly SUPPLIER_REPOSITORY: symbol;
|
|
1113
|
-
readonly PEM_REPOSITORY: symbol;
|
|
1114
|
-
readonly DAILY_REPORT_REPOSITORY: symbol;
|
|
1115
|
-
readonly JOURNAL_REPOSITORY: symbol;
|
|
1116
|
-
readonly NOTIFICATION_REPOSITORY: symbol;
|
|
1117
|
-
readonly TELEMETRY_REPOSITORY: symbol;
|
|
1118
|
-
readonly RECEIPT_SERVICE: symbol;
|
|
1119
|
-
readonly AUTH_SERVICE: symbol;
|
|
1120
|
-
readonly AUTHENTICATION_SERVICE: symbol;
|
|
1121
|
-
readonly CERTIFICATE_SERVICE: symbol;
|
|
1122
|
-
readonly OFFLINE_SERVICE: symbol;
|
|
1123
|
-
readonly NOTIFICATION_SERVICE: symbol;
|
|
1124
|
-
readonly TELEMETRY_SERVICE: symbol;
|
|
1125
|
-
};
|
|
1126
|
-
declare class DIContainer {
|
|
1127
|
-
private services;
|
|
1128
|
-
private factories;
|
|
1129
|
-
register<T>(token: symbol, instance: T): void;
|
|
1130
|
-
registerFactory<T>(token: symbol, factory: () => T): void;
|
|
1131
|
-
get<T>(token: symbol): T;
|
|
1132
|
-
has(token: symbol): boolean;
|
|
1133
|
-
clear(): void;
|
|
1134
|
-
}
|
|
1135
|
-
|
|
1136
|
-
interface User {
|
|
1137
|
-
id: string;
|
|
1138
|
-
email: string;
|
|
1139
|
-
username: string;
|
|
1140
|
-
roles: UserRoles;
|
|
1141
|
-
fid: string;
|
|
1142
|
-
pid: string | null;
|
|
1143
|
-
expiresAt: number;
|
|
1144
|
-
}
|
|
1145
|
-
interface AuthCredentials {
|
|
1146
|
-
email: string;
|
|
1147
|
-
password: string;
|
|
1148
|
-
}
|
|
1149
|
-
interface AuthEvents {
|
|
1150
|
-
onAuthError?: (error: Error) => void;
|
|
1151
|
-
onUserChanged?: (user: User | null) => void;
|
|
1152
|
-
}
|
|
1153
|
-
interface AuthServiceConfig {
|
|
1154
|
-
authUrl: string;
|
|
1155
|
-
timeout?: number;
|
|
1156
|
-
}
|
|
1157
|
-
type AuthState = 'idle' | 'authenticating' | 'authenticated' | 'error';
|
|
1158
|
-
declare class AuthenticationService {
|
|
1159
|
-
private readonly httpPort;
|
|
1160
|
-
private readonly tokenStorage;
|
|
1161
|
-
private readonly config;
|
|
1162
|
-
private readonly events;
|
|
1163
|
-
private readonly userSubject;
|
|
1164
|
-
private readonly authStateSubject;
|
|
1165
|
-
private readonly destroy$;
|
|
1166
|
-
get user$(): Observable<User | null>;
|
|
1167
|
-
get isAuthenticated$(): Observable<boolean>;
|
|
1168
|
-
get authState$(): Observable<AuthState>;
|
|
1169
|
-
constructor(httpPort: IHttpPort, tokenStorage: ITokenStoragePort, config: AuthServiceConfig, events?: AuthEvents);
|
|
1170
|
-
login(credentials: AuthCredentials): Promise<User>;
|
|
1171
|
-
logout(): Promise<void>;
|
|
1172
|
-
getCurrentUser(): Promise<User | null>;
|
|
1173
|
-
isAuthenticated(): Promise<boolean>;
|
|
1174
|
-
getAccessToken(): Promise<string | null>;
|
|
1175
|
-
private createUserFromPayload;
|
|
1176
|
-
destroy(): void;
|
|
1177
|
-
}
|
|
1178
|
-
|
|
1179
|
-
interface SDKFactoryConfig {
|
|
1180
|
-
baseUrl: string;
|
|
1181
|
-
authUrl?: string;
|
|
1182
|
-
timeout?: number;
|
|
1183
|
-
debugEnabled?: boolean;
|
|
1184
|
-
}
|
|
1185
|
-
interface SDKServices {
|
|
1186
|
-
http: IHttpPort;
|
|
1187
|
-
tokenStorage?: ITokenStoragePort;
|
|
1188
|
-
authService?: AuthenticationService;
|
|
1189
|
-
receipts: IReceiptRepository;
|
|
1190
|
-
merchants: IMerchantRepository;
|
|
1191
|
-
cashiers: ICashierRepository;
|
|
1192
|
-
cashRegisters: ICashRegisterRepository;
|
|
1193
|
-
pointOfSales: IPointOfSaleRepository;
|
|
1194
|
-
suppliers: ISupplierRepository;
|
|
1195
|
-
pems: IPemRepository;
|
|
1196
|
-
dailyReports: IDailyReportRepository;
|
|
1197
|
-
journals: IJournalRepository;
|
|
1198
|
-
notifications: INotificationRepository;
|
|
1199
|
-
telemetry: ITelemetryRepository;
|
|
1200
|
-
}
|
|
1201
|
-
declare class SDKFactory {
|
|
1202
|
-
static createContainer(config: SDKFactoryConfig): DIContainer;
|
|
1203
|
-
static registerCacheServices(container: DIContainer, cache: ICachePort, network?: INetworkPort): void;
|
|
1204
|
-
static getCacheKeyGenerator(container: DIContainer): ICacheKeyGenerator | undefined;
|
|
1205
|
-
static registerAuthServices(container: DIContainer, secureStorage: ISecureStoragePort, config: SDKFactoryConfig): void;
|
|
1206
|
-
static getServices(container: DIContainer): SDKServices;
|
|
1207
|
-
}
|
|
1208
|
-
|
|
1209
864
|
type AppMode = 'NORMAL' | 'WARNING' | 'BLOCKED' | 'OFFLINE';
|
|
1210
865
|
interface WarningState {
|
|
1211
866
|
active: boolean;
|
|
@@ -1244,7 +899,6 @@ declare class AppStateService {
|
|
|
1244
899
|
|
|
1245
900
|
interface TelemetryState {
|
|
1246
901
|
data: Telemetry | null;
|
|
1247
|
-
isCached: boolean;
|
|
1248
902
|
isLoading: boolean;
|
|
1249
903
|
lastFetchedAt: number | null;
|
|
1250
904
|
error?: string;
|
|
@@ -1451,7 +1105,7 @@ declare class SDKManager {
|
|
|
1451
1105
|
*/
|
|
1452
1106
|
get certificateMissing$(): Observable<boolean>;
|
|
1453
1107
|
/**
|
|
1454
|
-
* Observable stream of telemetry state (data, isLoading,
|
|
1108
|
+
* Observable stream of telemetry state (data, isLoading, error)
|
|
1455
1109
|
*/
|
|
1456
1110
|
get telemetryState$(): Observable<TelemetryState>;
|
|
1457
1111
|
/**
|
|
@@ -1535,6 +1189,84 @@ declare class NotificationService {
|
|
|
1535
1189
|
destroy(): void;
|
|
1536
1190
|
}
|
|
1537
1191
|
|
|
1192
|
+
interface User {
|
|
1193
|
+
id: string;
|
|
1194
|
+
email: string;
|
|
1195
|
+
username: string;
|
|
1196
|
+
roles: UserRoles;
|
|
1197
|
+
fid: string;
|
|
1198
|
+
pid: string | null;
|
|
1199
|
+
expiresAt: number;
|
|
1200
|
+
}
|
|
1201
|
+
interface AuthCredentials {
|
|
1202
|
+
email: string;
|
|
1203
|
+
password: string;
|
|
1204
|
+
}
|
|
1205
|
+
interface AuthEvents {
|
|
1206
|
+
onAuthError?: (error: Error) => void;
|
|
1207
|
+
onUserChanged?: (user: User | null) => void;
|
|
1208
|
+
}
|
|
1209
|
+
interface AuthServiceConfig {
|
|
1210
|
+
authUrl: string;
|
|
1211
|
+
timeout?: number;
|
|
1212
|
+
}
|
|
1213
|
+
type AuthState = 'idle' | 'authenticating' | 'authenticated' | 'error';
|
|
1214
|
+
declare class AuthenticationService {
|
|
1215
|
+
private readonly httpPort;
|
|
1216
|
+
private readonly tokenStorage;
|
|
1217
|
+
private readonly config;
|
|
1218
|
+
private readonly events;
|
|
1219
|
+
private readonly userSubject;
|
|
1220
|
+
private readonly authStateSubject;
|
|
1221
|
+
private readonly destroy$;
|
|
1222
|
+
get user$(): Observable<User | null>;
|
|
1223
|
+
get isAuthenticated$(): Observable<boolean>;
|
|
1224
|
+
get authState$(): Observable<AuthState>;
|
|
1225
|
+
constructor(httpPort: IHttpPort, tokenStorage: ITokenStoragePort, config: AuthServiceConfig, events?: AuthEvents);
|
|
1226
|
+
login(credentials: AuthCredentials): Promise<User>;
|
|
1227
|
+
logout(): Promise<void>;
|
|
1228
|
+
getCurrentUser(): Promise<User | null>;
|
|
1229
|
+
isAuthenticated(): Promise<boolean>;
|
|
1230
|
+
getAccessToken(): Promise<string | null>;
|
|
1231
|
+
private createUserFromPayload;
|
|
1232
|
+
destroy(): void;
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1235
|
+
declare enum MTLSErrorType {
|
|
1236
|
+
NOT_SUPPORTED = "MTLS_NOT_SUPPORTED",
|
|
1237
|
+
CERTIFICATE_NOT_FOUND = "MTLS_CERTIFICATE_NOT_FOUND",
|
|
1238
|
+
CERTIFICATE_EXPIRED = "MTLS_CERTIFICATE_EXPIRED",
|
|
1239
|
+
CERTIFICATE_INVALID = "MTLS_CERTIFICATE_INVALID",
|
|
1240
|
+
CONNECTION_FAILED = "MTLS_CONNECTION_FAILED",
|
|
1241
|
+
AUTHENTICATION_FAILED = "MTLS_AUTHENTICATION_FAILED",
|
|
1242
|
+
CONFIGURATION_ERROR = "MTLS_CONFIGURATION_ERROR"
|
|
1243
|
+
}
|
|
1244
|
+
declare class MTLSError extends Error {
|
|
1245
|
+
type: MTLSErrorType;
|
|
1246
|
+
originalError?: Error | undefined;
|
|
1247
|
+
statusCode?: number | undefined;
|
|
1248
|
+
constructor(type: MTLSErrorType, message: string, originalError?: Error | undefined, statusCode?: number | undefined);
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1251
|
+
interface JwtPayload {
|
|
1252
|
+
uid: number;
|
|
1253
|
+
username: string;
|
|
1254
|
+
roles: Record<string, string[]>;
|
|
1255
|
+
fid: string;
|
|
1256
|
+
pid: string | null;
|
|
1257
|
+
exp: number;
|
|
1258
|
+
iat: number;
|
|
1259
|
+
}
|
|
1260
|
+
declare function parseJwt(token: string): JwtPayload;
|
|
1261
|
+
declare function isTokenExpired(payload: JwtPayload): boolean;
|
|
1262
|
+
declare function extractRoles(jwtRoles: Record<string, string[]>): UserRole[];
|
|
1263
|
+
|
|
1264
|
+
declare class CertificateValidator {
|
|
1265
|
+
static validatePEMFormat(certificate: string, privateKey: string): boolean;
|
|
1266
|
+
static isCertificateExpired(validTo: Date): boolean;
|
|
1267
|
+
static getDaysUntilExpiry(validTo: Date): number;
|
|
1268
|
+
}
|
|
1269
|
+
|
|
1538
1270
|
interface ReceiptItemApiInput {
|
|
1539
1271
|
type?: GoodOrService;
|
|
1540
1272
|
quantity: string;
|
|
@@ -1982,259 +1714,6 @@ declare class TelemetryMapper {
|
|
|
1982
1714
|
private static lotteryFromApi;
|
|
1983
1715
|
}
|
|
1984
1716
|
|
|
1985
|
-
declare class JwtAuthHandler implements IAuthHandler {
|
|
1986
|
-
private readonly tokenStorage;
|
|
1987
|
-
constructor(tokenStorage: ITokenStoragePort);
|
|
1988
|
-
getAuthConfig(_url: string, _method: string): Promise<AuthConfig>;
|
|
1989
|
-
getAuthHeaders(): Promise<Record<string, string>>;
|
|
1990
|
-
}
|
|
1991
|
-
|
|
1992
|
-
declare class MtlsAuthHandler implements IAuthHandler {
|
|
1993
|
-
private readonly mtlsAdapter;
|
|
1994
|
-
private readonly certificatePort;
|
|
1995
|
-
private pendingRequests;
|
|
1996
|
-
constructor(mtlsAdapter: IMTLSPort | null, certificatePort: ICertificatePort | null);
|
|
1997
|
-
getAuthConfig(_url: string, _method: string): Promise<AuthConfig>;
|
|
1998
|
-
getAuthHeaders(): Promise<Record<string, string>>;
|
|
1999
|
-
isMtlsReady(): Promise<boolean>;
|
|
2000
|
-
getCertificate(): Promise<StoredCertificate | null>;
|
|
2001
|
-
private generateRequestKey;
|
|
2002
|
-
private constructMtlsUrl;
|
|
2003
|
-
makeRequest<T>(url: string, config: {
|
|
2004
|
-
method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
|
|
2005
|
-
data?: unknown;
|
|
2006
|
-
headers?: Record<string, string>;
|
|
2007
|
-
timeout?: number;
|
|
2008
|
-
responseType?: 'json' | 'blob' | 'arraybuffer' | 'text';
|
|
2009
|
-
}, jwtToken?: string): Promise<T>;
|
|
2010
|
-
private executeRequest;
|
|
2011
|
-
private shouldRetryRequest;
|
|
2012
|
-
configureCertificate(certificate: StoredCertificate): Promise<void>;
|
|
2013
|
-
storeCertificate(certificate: string, privateKey: string, options?: {
|
|
2014
|
-
format?: 'pem' | 'p12' | 'pkcs12';
|
|
2015
|
-
}): Promise<void>;
|
|
2016
|
-
clearCertificate(): Promise<void>;
|
|
2017
|
-
testConnection(): Promise<boolean>;
|
|
2018
|
-
getBaseUrl(): string | null;
|
|
2019
|
-
getStatus(): Promise<{
|
|
2020
|
-
adapterAvailable: boolean;
|
|
2021
|
-
certificatePortAvailable: boolean;
|
|
2022
|
-
isReady: boolean;
|
|
2023
|
-
hasCertificate: boolean;
|
|
2024
|
-
certificateInfo: {
|
|
2025
|
-
format: string;
|
|
2026
|
-
} | null;
|
|
2027
|
-
platformInfo: {
|
|
2028
|
-
platform: "react-native" | "node" | "web" | "expo";
|
|
2029
|
-
mtlsSupported: boolean;
|
|
2030
|
-
certificateStorage: "keychain" | "keystore" | "filesystem" | "browser-managed" | "memory";
|
|
2031
|
-
fallbackToJWT: boolean;
|
|
2032
|
-
} | null;
|
|
2033
|
-
pendingRequestsCount: number;
|
|
2034
|
-
}>;
|
|
2035
|
-
clearPendingRequests(): void;
|
|
2036
|
-
}
|
|
2037
|
-
|
|
2038
|
-
interface IUserProvider {
|
|
2039
|
-
getCurrentUser(): Promise<{
|
|
2040
|
-
roles: UserRoles;
|
|
2041
|
-
} | null>;
|
|
2042
|
-
getAccessToken(): Promise<string | null>;
|
|
2043
|
-
}
|
|
2044
|
-
declare class AuthStrategy {
|
|
2045
|
-
private readonly jwtHandler;
|
|
2046
|
-
private readonly mtlsHandler;
|
|
2047
|
-
private readonly userProvider;
|
|
2048
|
-
private readonly mtlsAdapter;
|
|
2049
|
-
constructor(jwtHandler: JwtAuthHandler, mtlsHandler: MtlsAuthHandler, userProvider: IUserProvider | null, mtlsAdapter: IMTLSPort | null);
|
|
2050
|
-
determineAuthConfig(url: string, method: string, explicitMode?: AuthMode): Promise<AuthConfig>;
|
|
2051
|
-
getAuthHeaders(): Promise<Record<string, string>>;
|
|
2052
|
-
getMtlsHandler(): MtlsAuthHandler;
|
|
2053
|
-
getJwtHandler(): JwtAuthHandler;
|
|
2054
|
-
private detectPlatform;
|
|
2055
|
-
private getUserRole;
|
|
2056
|
-
private isReceiptEndpoint;
|
|
2057
|
-
private isReturnableItemsEndpoint;
|
|
2058
|
-
private isDetailedReceiptEndpoint;
|
|
2059
|
-
private isNotificationEndpoint;
|
|
2060
|
-
private isTelemetryEndpoint;
|
|
2061
|
-
}
|
|
2062
|
-
|
|
2063
|
-
interface AxiosHttpAdapterConfig {
|
|
2064
|
-
baseUrl: string;
|
|
2065
|
-
timeout?: number;
|
|
2066
|
-
}
|
|
2067
|
-
declare class AxiosHttpAdapter implements IHttpPort {
|
|
2068
|
-
private client;
|
|
2069
|
-
private authToken;
|
|
2070
|
-
private mtlsAdapter;
|
|
2071
|
-
private authStrategy;
|
|
2072
|
-
private baseUrl;
|
|
2073
|
-
constructor(config: AxiosHttpAdapterConfig);
|
|
2074
|
-
setMTLSAdapter(adapter: IMTLSPort | null): void;
|
|
2075
|
-
setAuthStrategy(strategy: AuthStrategy | null): void;
|
|
2076
|
-
private shouldUseMTLS;
|
|
2077
|
-
private makeMTLSRequest;
|
|
2078
|
-
private constructMtlsUrl;
|
|
2079
|
-
private setupInterceptors;
|
|
2080
|
-
private mapConfig;
|
|
2081
|
-
private mapResponse;
|
|
2082
|
-
get<T>(url: string, config?: HttpRequestConfig): Promise<HttpResponse<T>>;
|
|
2083
|
-
post<T>(url: string, data?: unknown, config?: HttpRequestConfig): Promise<HttpResponse<T>>;
|
|
2084
|
-
put<T>(url: string, data?: unknown, config?: HttpRequestConfig): Promise<HttpResponse<T>>;
|
|
2085
|
-
patch<T>(url: string, data?: unknown, config?: HttpRequestConfig): Promise<HttpResponse<T>>;
|
|
2086
|
-
delete<T>(url: string, config?: HttpRequestConfig): Promise<HttpResponse<T>>;
|
|
2087
|
-
setAuthToken(token: string | null): void;
|
|
2088
|
-
getAuthToken(): string | null;
|
|
2089
|
-
getAxiosInstance(): AxiosInstance;
|
|
2090
|
-
}
|
|
2091
|
-
|
|
2092
|
-
interface CacheConfig {
|
|
2093
|
-
useCache?: boolean;
|
|
2094
|
-
}
|
|
2095
|
-
declare class CacheHandler {
|
|
2096
|
-
private cache?;
|
|
2097
|
-
private networkMonitor?;
|
|
2098
|
-
private currentOnlineState;
|
|
2099
|
-
private networkSubscription?;
|
|
2100
|
-
constructor(cache?: ICachePort | undefined, networkMonitor?: INetworkPort | undefined);
|
|
2101
|
-
private setupNetworkMonitoring;
|
|
2102
|
-
isOnline(): boolean;
|
|
2103
|
-
handleCachedRequest<T>(url: string, requestFn: () => Promise<AxiosResponse<T>>, config?: CacheConfig): Promise<T>;
|
|
2104
|
-
private generateCacheKey;
|
|
2105
|
-
invalidateCache(pattern: string): Promise<void>;
|
|
2106
|
-
getCacheStatus(): {
|
|
2107
|
-
available: boolean;
|
|
2108
|
-
networkMonitorAvailable: boolean;
|
|
2109
|
-
isOnline: boolean;
|
|
2110
|
-
};
|
|
2111
|
-
destroy(): void;
|
|
2112
|
-
}
|
|
2113
|
-
|
|
2114
|
-
declare function transformError(error: unknown): ACubeSDKError;
|
|
2115
|
-
|
|
2116
|
-
declare enum ErrorCategory {
|
|
2117
|
-
SERVER_ERROR = "SERVER_ERROR",
|
|
2118
|
-
CLIENT_ERROR = "CLIENT_ERROR",
|
|
2119
|
-
AUTH_ERROR = "AUTH_ERROR",
|
|
2120
|
-
CERTIFICATE_ERROR = "CERTIFICATE_ERROR",
|
|
2121
|
-
NETWORK_ERROR = "NETWORK_ERROR",
|
|
2122
|
-
UNKNOWN_ERROR = "UNKNOWN_ERROR"
|
|
2123
|
-
}
|
|
2124
|
-
interface ErrorClassification {
|
|
2125
|
-
category: ErrorCategory;
|
|
2126
|
-
statusCode?: number;
|
|
2127
|
-
message: string;
|
|
2128
|
-
shouldRetry: boolean;
|
|
2129
|
-
userMessage: string;
|
|
2130
|
-
}
|
|
2131
|
-
declare function classifyError(error: unknown): ErrorClassification;
|
|
2132
|
-
declare function shouldReconfigureCertificate(error: unknown): boolean;
|
|
2133
|
-
declare function shouldRetryRequest(error: unknown, isRetryAttempt: boolean): boolean;
|
|
2134
|
-
declare function getUserFriendlyMessage(error: unknown): string;
|
|
2135
|
-
|
|
2136
|
-
declare class ReceiptRepositoryImpl implements IReceiptRepository {
|
|
2137
|
-
private readonly http;
|
|
2138
|
-
constructor(http: IHttpPort);
|
|
2139
|
-
create(input: ReceiptInput): Promise<Receipt>;
|
|
2140
|
-
findById(receiptUuid: string): Promise<Receipt>;
|
|
2141
|
-
findAll(params: ReceiptListParams): Promise<Page<Receipt>>;
|
|
2142
|
-
getDetails(receiptUuid: string, format: 'json'): Promise<ReceiptDetails>;
|
|
2143
|
-
getDetails(receiptUuid: string, format: 'pdf'): Promise<string>;
|
|
2144
|
-
getReturnableItems(receiptUuid: string): Promise<ReturnableReceiptItem[]>;
|
|
2145
|
-
voidReceipt(input: VoidReceiptInput): Promise<void>;
|
|
2146
|
-
voidViaDifferentDevice(input: VoidViaDifferentDeviceInput): Promise<void>;
|
|
2147
|
-
voidWithProof(input: VoidWithProofInput): Promise<void>;
|
|
2148
|
-
returnItems(input: ReceiptReturnInput): Promise<Receipt>;
|
|
2149
|
-
returnViaDifferentDevice(input: ReturnViaDifferentDeviceInput): Promise<Receipt>;
|
|
2150
|
-
returnWithProof(input: ReturnWithProofInput): Promise<Receipt>;
|
|
2151
|
-
}
|
|
2152
|
-
|
|
2153
|
-
declare class MerchantRepositoryImpl implements IMerchantRepository {
|
|
2154
|
-
private readonly http;
|
|
2155
|
-
constructor(http: IHttpPort);
|
|
2156
|
-
create(input: MerchantCreateInput): Promise<Merchant>;
|
|
2157
|
-
findById(uuid: string): Promise<Merchant>;
|
|
2158
|
-
findAll(params?: MerchantsParams): Promise<Merchant[]>;
|
|
2159
|
-
update(uuid: string, input: MerchantUpdateInput): Promise<Merchant>;
|
|
2160
|
-
}
|
|
2161
|
-
|
|
2162
|
-
declare class CashierRepositoryImpl implements ICashierRepository {
|
|
2163
|
-
private readonly http;
|
|
2164
|
-
constructor(http: IHttpPort);
|
|
2165
|
-
create(input: CashierCreateInput): Promise<Cashier>;
|
|
2166
|
-
findMe(): Promise<Cashier>;
|
|
2167
|
-
findById(uuid: string): Promise<Cashier>;
|
|
2168
|
-
findAll(params?: CashierListParams): Promise<Page<Cashier>>;
|
|
2169
|
-
delete(uuid: string): Promise<void>;
|
|
2170
|
-
}
|
|
2171
|
-
|
|
2172
|
-
declare class CashRegisterRepositoryImpl implements ICashRegisterRepository {
|
|
2173
|
-
private readonly http;
|
|
2174
|
-
constructor(http: IHttpPort);
|
|
2175
|
-
create(input: CashRegisterCreateInput): Promise<CashRegisterDetailed>;
|
|
2176
|
-
findById(uuid: string): Promise<CashRegister>;
|
|
2177
|
-
findAll(params?: CashRegisterListParams): Promise<Page<CashRegister>>;
|
|
2178
|
-
update(uuid: string, input: CashRegisterUpdateInput): Promise<CashRegister>;
|
|
2179
|
-
}
|
|
2180
|
-
|
|
2181
|
-
declare class PointOfSaleRepositoryImpl implements IPointOfSaleRepository {
|
|
2182
|
-
private readonly http;
|
|
2183
|
-
constructor(http: IHttpPort);
|
|
2184
|
-
findById(serialNumber: string): Promise<PointOfSaleDetailed>;
|
|
2185
|
-
findAll(params?: PointOfSaleListParams): Promise<Page<PointOfSale>>;
|
|
2186
|
-
activate(serialNumber: string, input: ActivationRequest): Promise<void>;
|
|
2187
|
-
closeJournal(serialNumber: string): Promise<void>;
|
|
2188
|
-
createInactivity(serialNumber: string): Promise<void>;
|
|
2189
|
-
communicateOffline(serialNumber: string, input: PEMStatusOfflineRequest): Promise<void>;
|
|
2190
|
-
}
|
|
2191
|
-
|
|
2192
|
-
declare class SupplierRepositoryImpl implements ISupplierRepository {
|
|
2193
|
-
private readonly http;
|
|
2194
|
-
constructor(http: IHttpPort);
|
|
2195
|
-
create(merchantUuid: string, input: SupplierCreateInput): Promise<Supplier>;
|
|
2196
|
-
findById(merchantUuid: string, supplierUuid: string): Promise<Supplier>;
|
|
2197
|
-
findAll(merchantUuid: string, params?: SuppliersParams): Promise<Page<Supplier>>;
|
|
2198
|
-
update(merchantUuid: string, supplierUuid: string, input: SupplierUpdateInput): Promise<Supplier>;
|
|
2199
|
-
delete(merchantUuid: string, supplierUuid: string): Promise<void>;
|
|
2200
|
-
}
|
|
2201
|
-
|
|
2202
|
-
declare class PemRepositoryImpl implements IPemRepository {
|
|
2203
|
-
private readonly http;
|
|
2204
|
-
constructor(http: IHttpPort);
|
|
2205
|
-
create(input: PemCreateInput): Promise<PemCreateOutput>;
|
|
2206
|
-
findBySerialNumber(serialNumber: string): Promise<PointOfSaleMf2>;
|
|
2207
|
-
findAllByMerchant(merchantUuid: string, page?: number): Promise<PointOfSaleMf2[]>;
|
|
2208
|
-
getCertificates(serialNumber: string): Promise<PemCertificates>;
|
|
2209
|
-
}
|
|
2210
|
-
|
|
2211
|
-
declare class DailyReportRepositoryImpl implements IDailyReportRepository {
|
|
2212
|
-
private readonly http;
|
|
2213
|
-
constructor(http: IHttpPort);
|
|
2214
|
-
findById(merchantUuid: string, reportUuid: string): Promise<DailyReport>;
|
|
2215
|
-
findAll(merchantUuid: string, params?: DailyReportsParams): Promise<Page<DailyReport>>;
|
|
2216
|
-
}
|
|
2217
|
-
|
|
2218
|
-
declare class JournalRepositoryImpl implements IJournalRepository {
|
|
2219
|
-
private readonly http;
|
|
2220
|
-
constructor(http: IHttpPort);
|
|
2221
|
-
findById(merchantUuid: string, journalUuid: string): Promise<Journal>;
|
|
2222
|
-
findAll(merchantUuid: string, params?: JournalsParams): Promise<Page<Journal>>;
|
|
2223
|
-
close(merchantUuid: string, input: JournalCloseInput): Promise<Journal>;
|
|
2224
|
-
}
|
|
2225
|
-
|
|
2226
|
-
declare class NotificationRepositoryImpl implements INotificationRepository {
|
|
2227
|
-
private readonly http;
|
|
2228
|
-
constructor(http: IHttpPort);
|
|
2229
|
-
fetchNotifications(_params?: NotificationListParams): Promise<Page<Notification>>;
|
|
2230
|
-
}
|
|
2231
|
-
|
|
2232
|
-
declare class TelemetryRepositoryImpl implements ITelemetryRepository {
|
|
2233
|
-
private readonly http;
|
|
2234
|
-
constructor(http: IHttpPort);
|
|
2235
|
-
getTelemetry(pemId: string): Promise<Telemetry>;
|
|
2236
|
-
}
|
|
2237
|
-
|
|
2238
1717
|
declare class ConfigManager {
|
|
2239
1718
|
private config;
|
|
2240
1719
|
constructor(userConfig: SDKConfig);
|
|
@@ -2252,33 +1731,6 @@ declare class ConfigManager {
|
|
|
2252
1731
|
updateConfig(updates: Partial<SDKConfig>): void;
|
|
2253
1732
|
}
|
|
2254
1733
|
|
|
2255
|
-
type Cleaned<T> = T extends (infer U)[] ? Cleaned<U>[] : T extends object ? {
|
|
2256
|
-
[K in keyof T as T[K] extends null | undefined | '' ? never : K]: Cleaned<T[K]>;
|
|
2257
|
-
} : T;
|
|
2258
|
-
declare function clearObject<T>(input: T): Cleaned<T>;
|
|
2259
|
-
type CleanedShallow<T> = {
|
|
2260
|
-
[K in keyof T as T[K] extends null | undefined | '' ? never : K]: T[K];
|
|
2261
|
-
};
|
|
2262
|
-
declare function clearObjectShallow<T extends Record<string, unknown>>(obj: T): CleanedShallow<T>;
|
|
2263
|
-
declare function isEmpty(value: unknown): boolean;
|
|
2264
|
-
declare function hasNonEmptyValues<T extends Record<string, unknown>>(obj: T): boolean;
|
|
2265
|
-
|
|
2266
|
-
/**
|
|
2267
|
-
* Platform detection utilities
|
|
2268
|
-
*/
|
|
2269
|
-
type Platform = 'web' | 'react-native' | 'node' | 'unknown';
|
|
2270
|
-
interface PlatformInfo {
|
|
2271
|
-
platform: Platform;
|
|
2272
|
-
isReactNative: boolean;
|
|
2273
|
-
isWeb: boolean;
|
|
2274
|
-
isNode: boolean;
|
|
2275
|
-
isExpo: boolean;
|
|
2276
|
-
}
|
|
2277
|
-
/**
|
|
2278
|
-
* Detect the current platform
|
|
2279
|
-
*/
|
|
2280
|
-
declare function detectPlatform(): PlatformInfo;
|
|
2281
|
-
|
|
2282
1734
|
declare class Logger {
|
|
2283
1735
|
private enabled;
|
|
2284
1736
|
setEnabled(enabled: boolean): void;
|
|
@@ -2297,17 +1749,6 @@ declare function createPrefixedLogger(prefix: string): {
|
|
|
2297
1749
|
error: (message: string, data?: unknown) => void;
|
|
2298
1750
|
};
|
|
2299
1751
|
|
|
2300
|
-
/**
|
|
2301
|
-
* Formats a numeric string value to have exactly the specified number of decimal places.
|
|
2302
|
-
* E.g., "1" → "1.00", "10" → "10.00", "1.5" → "1.50"
|
|
2303
|
-
* Returns undefined for undefined input (preserves optional fields).
|
|
2304
|
-
*
|
|
2305
|
-
* @param value - The string value to format
|
|
2306
|
-
* @param decimals - Number of decimal places (default: 2)
|
|
2307
|
-
* @returns Formatted string or undefined if input is undefined
|
|
2308
|
-
*/
|
|
2309
|
-
declare function formatDecimal(value: string | undefined, decimals?: number): string | undefined;
|
|
2310
|
-
|
|
2311
1752
|
declare const VAT_RATE_CODE_OPTIONS: readonly ["4.00", "5.00", "10.00", "22.00", "2.00", "6.40", "7.00", "7.30", "7.50", "7.65", "7.95", "8.30", "8.50", "8.80", "9.50", "12.30", "N1", "N2", "N3", "N4", "N5", "N6"];
|
|
2312
1753
|
declare const GOOD_OR_SERVICE_OPTIONS: readonly ["goods", "service"];
|
|
2313
1754
|
declare const RECEIPT_PROOF_TYPE_OPTIONS: readonly ["POS", "VR", "ND"];
|
|
@@ -2344,842 +1785,15 @@ declare const ReceiptProofTypeSchema: z.ZodEnum<{
|
|
|
2344
1785
|
VR: "VR";
|
|
2345
1786
|
ND: "ND";
|
|
2346
1787
|
}>;
|
|
2347
|
-
declare const ReceiptItemSchema: z.ZodObject<{
|
|
2348
|
-
type: z.ZodOptional<z.ZodEnum<{
|
|
2349
|
-
goods: "goods";
|
|
2350
|
-
service: "service";
|
|
2351
|
-
}>>;
|
|
2352
|
-
quantity: z.ZodString;
|
|
2353
|
-
description: z.ZodString;
|
|
2354
|
-
unit_price: z.ZodString;
|
|
2355
|
-
vat_rate_code: z.ZodOptional<z.ZodEnum<{
|
|
2356
|
-
"4.00": "4.00";
|
|
2357
|
-
"5.00": "5.00";
|
|
2358
|
-
"10.00": "10.00";
|
|
2359
|
-
"22.00": "22.00";
|
|
2360
|
-
"2.00": "2.00";
|
|
2361
|
-
"6.40": "6.40";
|
|
2362
|
-
"7.00": "7.00";
|
|
2363
|
-
"7.30": "7.30";
|
|
2364
|
-
"7.50": "7.50";
|
|
2365
|
-
7.65: "7.65";
|
|
2366
|
-
7.95: "7.95";
|
|
2367
|
-
"8.30": "8.30";
|
|
2368
|
-
"8.50": "8.50";
|
|
2369
|
-
"8.80": "8.80";
|
|
2370
|
-
"9.50": "9.50";
|
|
2371
|
-
"12.30": "12.30";
|
|
2372
|
-
N1: "N1";
|
|
2373
|
-
N2: "N2";
|
|
2374
|
-
N3: "N3";
|
|
2375
|
-
N4: "N4";
|
|
2376
|
-
N5: "N5";
|
|
2377
|
-
N6: "N6";
|
|
2378
|
-
}>>;
|
|
2379
|
-
simplified_vat_allocation: z.ZodOptional<z.ZodBoolean>;
|
|
2380
|
-
discount: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
2381
|
-
is_down_payment_or_voucher_redemption: z.ZodOptional<z.ZodBoolean>;
|
|
2382
|
-
complimentary: z.ZodOptional<z.ZodBoolean>;
|
|
2383
|
-
}, z.core.$strip>;
|
|
2384
|
-
declare const ReceiptInputSchema: z.ZodObject<{
|
|
2385
|
-
items: z.ZodArray<z.ZodObject<{
|
|
2386
|
-
type: z.ZodOptional<z.ZodEnum<{
|
|
2387
|
-
goods: "goods";
|
|
2388
|
-
service: "service";
|
|
2389
|
-
}>>;
|
|
2390
|
-
quantity: z.ZodString;
|
|
2391
|
-
description: z.ZodString;
|
|
2392
|
-
unit_price: z.ZodString;
|
|
2393
|
-
vat_rate_code: z.ZodOptional<z.ZodEnum<{
|
|
2394
|
-
"4.00": "4.00";
|
|
2395
|
-
"5.00": "5.00";
|
|
2396
|
-
"10.00": "10.00";
|
|
2397
|
-
"22.00": "22.00";
|
|
2398
|
-
"2.00": "2.00";
|
|
2399
|
-
"6.40": "6.40";
|
|
2400
|
-
"7.00": "7.00";
|
|
2401
|
-
"7.30": "7.30";
|
|
2402
|
-
"7.50": "7.50";
|
|
2403
|
-
7.65: "7.65";
|
|
2404
|
-
7.95: "7.95";
|
|
2405
|
-
"8.30": "8.30";
|
|
2406
|
-
"8.50": "8.50";
|
|
2407
|
-
"8.80": "8.80";
|
|
2408
|
-
"9.50": "9.50";
|
|
2409
|
-
"12.30": "12.30";
|
|
2410
|
-
N1: "N1";
|
|
2411
|
-
N2: "N2";
|
|
2412
|
-
N3: "N3";
|
|
2413
|
-
N4: "N4";
|
|
2414
|
-
N5: "N5";
|
|
2415
|
-
N6: "N6";
|
|
2416
|
-
}>>;
|
|
2417
|
-
simplified_vat_allocation: z.ZodOptional<z.ZodBoolean>;
|
|
2418
|
-
discount: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
2419
|
-
is_down_payment_or_voucher_redemption: z.ZodOptional<z.ZodBoolean>;
|
|
2420
|
-
complimentary: z.ZodOptional<z.ZodBoolean>;
|
|
2421
|
-
}, z.core.$strip>>;
|
|
2422
|
-
customer_tax_code: z.ZodOptional<z.ZodString>;
|
|
2423
|
-
customer_lottery_code: z.ZodOptional<z.ZodString>;
|
|
2424
|
-
discount: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
2425
|
-
invoice_issuing: z.ZodOptional<z.ZodBoolean>;
|
|
2426
|
-
uncollected_dcr_to_ssn: z.ZodOptional<z.ZodBoolean>;
|
|
2427
|
-
services_uncollected_amount: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
2428
|
-
goods_uncollected_amount: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
2429
|
-
cash_payment_amount: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
2430
|
-
electronic_payment_amount: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
2431
|
-
ticket_restaurant_payment_amount: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
2432
|
-
ticket_restaurant_quantity: z.ZodOptional<z.ZodNumber>;
|
|
2433
|
-
}, z.core.$strip>;
|
|
2434
|
-
declare const ReceiptReturnOrVoidViaPEMInputSchema: z.ZodObject<{
|
|
2435
|
-
device_id: z.ZodOptional<z.ZodString>;
|
|
2436
|
-
items: z.ZodArray<z.ZodObject<{
|
|
2437
|
-
type: z.ZodOptional<z.ZodEnum<{
|
|
2438
|
-
goods: "goods";
|
|
2439
|
-
service: "service";
|
|
2440
|
-
}>>;
|
|
2441
|
-
quantity: z.ZodString;
|
|
2442
|
-
description: z.ZodString;
|
|
2443
|
-
unit_price: z.ZodString;
|
|
2444
|
-
vat_rate_code: z.ZodOptional<z.ZodEnum<{
|
|
2445
|
-
"4.00": "4.00";
|
|
2446
|
-
"5.00": "5.00";
|
|
2447
|
-
"10.00": "10.00";
|
|
2448
|
-
"22.00": "22.00";
|
|
2449
|
-
"2.00": "2.00";
|
|
2450
|
-
"6.40": "6.40";
|
|
2451
|
-
"7.00": "7.00";
|
|
2452
|
-
"7.30": "7.30";
|
|
2453
|
-
"7.50": "7.50";
|
|
2454
|
-
7.65: "7.65";
|
|
2455
|
-
7.95: "7.95";
|
|
2456
|
-
"8.30": "8.30";
|
|
2457
|
-
"8.50": "8.50";
|
|
2458
|
-
"8.80": "8.80";
|
|
2459
|
-
"9.50": "9.50";
|
|
2460
|
-
"12.30": "12.30";
|
|
2461
|
-
N1: "N1";
|
|
2462
|
-
N2: "N2";
|
|
2463
|
-
N3: "N3";
|
|
2464
|
-
N4: "N4";
|
|
2465
|
-
N5: "N5";
|
|
2466
|
-
N6: "N6";
|
|
2467
|
-
}>>;
|
|
2468
|
-
simplified_vat_allocation: z.ZodOptional<z.ZodBoolean>;
|
|
2469
|
-
discount: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
2470
|
-
is_down_payment_or_voucher_redemption: z.ZodOptional<z.ZodBoolean>;
|
|
2471
|
-
complimentary: z.ZodOptional<z.ZodBoolean>;
|
|
2472
|
-
}, z.core.$strip>>;
|
|
2473
|
-
document_number: z.ZodString;
|
|
2474
|
-
document_datetime: z.ZodOptional<z.ZodString>;
|
|
2475
|
-
lottery_code: z.ZodOptional<z.ZodString>;
|
|
2476
|
-
}, z.core.$strip>;
|
|
2477
|
-
declare const ReceiptReturnOrVoidWithProofInputSchema: z.ZodObject<{
|
|
2478
|
-
items: z.ZodArray<z.ZodObject<{
|
|
2479
|
-
type: z.ZodOptional<z.ZodEnum<{
|
|
2480
|
-
goods: "goods";
|
|
2481
|
-
service: "service";
|
|
2482
|
-
}>>;
|
|
2483
|
-
quantity: z.ZodString;
|
|
2484
|
-
description: z.ZodString;
|
|
2485
|
-
unit_price: z.ZodString;
|
|
2486
|
-
vat_rate_code: z.ZodOptional<z.ZodEnum<{
|
|
2487
|
-
"4.00": "4.00";
|
|
2488
|
-
"5.00": "5.00";
|
|
2489
|
-
"10.00": "10.00";
|
|
2490
|
-
"22.00": "22.00";
|
|
2491
|
-
"2.00": "2.00";
|
|
2492
|
-
"6.40": "6.40";
|
|
2493
|
-
"7.00": "7.00";
|
|
2494
|
-
"7.30": "7.30";
|
|
2495
|
-
"7.50": "7.50";
|
|
2496
|
-
7.65: "7.65";
|
|
2497
|
-
7.95: "7.95";
|
|
2498
|
-
"8.30": "8.30";
|
|
2499
|
-
"8.50": "8.50";
|
|
2500
|
-
"8.80": "8.80";
|
|
2501
|
-
"9.50": "9.50";
|
|
2502
|
-
"12.30": "12.30";
|
|
2503
|
-
N1: "N1";
|
|
2504
|
-
N2: "N2";
|
|
2505
|
-
N3: "N3";
|
|
2506
|
-
N4: "N4";
|
|
2507
|
-
N5: "N5";
|
|
2508
|
-
N6: "N6";
|
|
2509
|
-
}>>;
|
|
2510
|
-
simplified_vat_allocation: z.ZodOptional<z.ZodBoolean>;
|
|
2511
|
-
discount: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
2512
|
-
is_down_payment_or_voucher_redemption: z.ZodOptional<z.ZodBoolean>;
|
|
2513
|
-
complimentary: z.ZodOptional<z.ZodBoolean>;
|
|
2514
|
-
}, z.core.$strip>>;
|
|
2515
|
-
proof: z.ZodEnum<{
|
|
2516
|
-
POS: "POS";
|
|
2517
|
-
VR: "VR";
|
|
2518
|
-
ND: "ND";
|
|
2519
|
-
}>;
|
|
2520
|
-
document_datetime: z.ZodString;
|
|
2521
|
-
}, z.core.$strip>;
|
|
2522
|
-
declare const VoidReceiptInputSchema: z.ZodObject<{
|
|
2523
|
-
document_number: z.ZodString;
|
|
2524
|
-
}, z.core.$strip>;
|
|
2525
|
-
declare const ReceiptReturnItemSchema: z.ZodArray<z.ZodObject<{
|
|
2526
|
-
id: z.ZodNumber;
|
|
2527
|
-
quantity: z.ZodString;
|
|
2528
|
-
}, z.core.$strip>>;
|
|
2529
|
-
declare const ReceiptReturnInputSchema: z.ZodObject<{
|
|
2530
|
-
items: z.ZodArray<z.ZodArray<z.ZodObject<{
|
|
2531
|
-
id: z.ZodNumber;
|
|
2532
|
-
quantity: z.ZodString;
|
|
2533
|
-
}, z.core.$strip>>>;
|
|
2534
|
-
document_number: z.ZodString;
|
|
2535
|
-
}, z.core.$strip>;
|
|
2536
|
-
type ReceiptItemType = z.infer<typeof ReceiptItemSchema>;
|
|
2537
|
-
type ReceiptInputType = z.infer<typeof ReceiptInputSchema>;
|
|
2538
|
-
type ReceiptReturnOrVoidViaPEMInputType = z.infer<typeof ReceiptReturnOrVoidViaPEMInputSchema>;
|
|
2539
|
-
type ReceiptReturnOrVoidWithProofInputType = z.infer<typeof ReceiptReturnOrVoidWithProofInputSchema>;
|
|
2540
1788
|
type VatRateCodeType = z.infer<typeof VatRateCodeSchema>;
|
|
2541
1789
|
type GoodOrServiceType = z.infer<typeof GoodOrServiceSchema>;
|
|
2542
1790
|
type ReceiptProofTypeType = z.infer<typeof ReceiptProofTypeSchema>;
|
|
2543
|
-
type ReceiptReturnType = z.infer<typeof ReceiptReturnInputSchema>;
|
|
2544
|
-
type ReceiptReturnItemType = z.infer<typeof ReceiptReturnItemSchema>;
|
|
2545
|
-
type VoidReceiptInputType = z.infer<typeof VoidReceiptInputSchema>;
|
|
2546
|
-
|
|
2547
|
-
declare const CashierCreateInputSchema: z.ZodObject<{
|
|
2548
|
-
email: z.ZodString;
|
|
2549
|
-
password: z.ZodString;
|
|
2550
|
-
name: z.ZodString;
|
|
2551
|
-
display_name: z.ZodString;
|
|
2552
|
-
}, z.core.$strip>;
|
|
2553
|
-
type CashierCreateInputType = z.infer<typeof CashierCreateInputSchema>;
|
|
2554
1791
|
|
|
2555
1792
|
declare const PEM_STATUS_OPTIONS: readonly ["NEW", "REGISTERED", "ACTIVATED", "ONLINE", "OFFLINE", "DISCARDED"];
|
|
2556
|
-
declare const AddressSchema: z.ZodObject<{
|
|
2557
|
-
street_address: z.ZodString;
|
|
2558
|
-
street_number: z.ZodString;
|
|
2559
|
-
zip_code: z.ZodString;
|
|
2560
|
-
city: z.ZodString;
|
|
2561
|
-
province: z.ZodString;
|
|
2562
|
-
}, z.core.$strip>;
|
|
2563
|
-
declare const PEMStatusSchema: z.ZodEnum<{
|
|
2564
|
-
ONLINE: "ONLINE";
|
|
2565
|
-
OFFLINE: "OFFLINE";
|
|
2566
|
-
NEW: "NEW";
|
|
2567
|
-
REGISTERED: "REGISTERED";
|
|
2568
|
-
ACTIVATED: "ACTIVATED";
|
|
2569
|
-
DISCARDED: "DISCARDED";
|
|
2570
|
-
}>;
|
|
2571
|
-
declare const ActivationRequestSchema: z.ZodObject<{
|
|
2572
|
-
registration_key: z.ZodString;
|
|
2573
|
-
}, z.core.$strip>;
|
|
2574
|
-
declare const PEMStatusOfflineRequestSchema: z.ZodObject<{
|
|
2575
|
-
timestamp: z.ZodString;
|
|
2576
|
-
reason: z.ZodString;
|
|
2577
|
-
}, z.core.$strip>;
|
|
2578
|
-
type AddressType = z.infer<typeof AddressSchema>;
|
|
2579
|
-
type PEMStatusType = z.infer<typeof PEMStatusSchema>;
|
|
2580
|
-
type ActivationRequestType = z.infer<typeof ActivationRequestSchema>;
|
|
2581
|
-
type PEMStatusOfflineRequestType = z.infer<typeof PEMStatusOfflineRequestSchema>;
|
|
2582
|
-
|
|
2583
|
-
declare const CashRegisterCreateSchema: z.ZodObject<{
|
|
2584
|
-
pem_serial_number: z.ZodString;
|
|
2585
|
-
name: z.ZodString;
|
|
2586
|
-
}, z.core.$strip>;
|
|
2587
|
-
type CashRegisterCreateType = z.infer<typeof CashRegisterCreateSchema>;
|
|
2588
|
-
|
|
2589
|
-
declare const MerchantCreateInputSchema: z.ZodObject<{
|
|
2590
|
-
vat_number: z.ZodString;
|
|
2591
|
-
fiscal_code: z.ZodOptional<z.ZodString>;
|
|
2592
|
-
business_name: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
2593
|
-
first_name: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
2594
|
-
last_name: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
2595
|
-
email: z.ZodString;
|
|
2596
|
-
password: z.ZodString;
|
|
2597
|
-
address: z.ZodOptional<z.ZodObject<{
|
|
2598
|
-
street_address: z.ZodString;
|
|
2599
|
-
street_number: z.ZodString;
|
|
2600
|
-
zip_code: z.ZodString;
|
|
2601
|
-
city: z.ZodString;
|
|
2602
|
-
province: z.ZodString;
|
|
2603
|
-
}, z.core.$strip>>;
|
|
2604
|
-
}, z.core.$strip>;
|
|
2605
|
-
declare const MerchantUpdateInputSchema: z.ZodObject<{
|
|
2606
|
-
business_name: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
2607
|
-
first_name: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
2608
|
-
last_name: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
2609
|
-
address: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
2610
|
-
street_address: z.ZodString;
|
|
2611
|
-
street_number: z.ZodString;
|
|
2612
|
-
zip_code: z.ZodString;
|
|
2613
|
-
city: z.ZodString;
|
|
2614
|
-
province: z.ZodString;
|
|
2615
|
-
}, z.core.$strip>>>;
|
|
2616
|
-
}, z.core.$strip>;
|
|
2617
|
-
type MerchantCreateInputType = z.infer<typeof MerchantCreateInputSchema>;
|
|
2618
|
-
type MerchantUpdateInputType = z.infer<typeof MerchantUpdateInputSchema>;
|
|
2619
1793
|
|
|
2620
1794
|
declare const PEM_TYPE_OPTIONS: readonly ["AP", "SP", "TM", "PV"];
|
|
2621
|
-
declare const PemDataSchema: z.ZodObject<{
|
|
2622
|
-
version: z.ZodString;
|
|
2623
|
-
type: z.ZodEnum<{
|
|
2624
|
-
AP: "AP";
|
|
2625
|
-
SP: "SP";
|
|
2626
|
-
TM: "TM";
|
|
2627
|
-
PV: "PV";
|
|
2628
|
-
}>;
|
|
2629
|
-
}, z.core.$strip>;
|
|
2630
|
-
declare const PemCreateInputSchema: z.ZodObject<{
|
|
2631
|
-
merchant_uuid: z.ZodString;
|
|
2632
|
-
address: z.ZodOptional<z.ZodObject<{
|
|
2633
|
-
street_address: z.ZodString;
|
|
2634
|
-
street_number: z.ZodString;
|
|
2635
|
-
zip_code: z.ZodString;
|
|
2636
|
-
city: z.ZodString;
|
|
2637
|
-
province: z.ZodString;
|
|
2638
|
-
}, z.core.$strip>>;
|
|
2639
|
-
}, z.core.$strip>;
|
|
2640
|
-
type PemDataType = z.infer<typeof PemDataSchema>;
|
|
2641
|
-
type PemCreateInputType = z.infer<typeof PemCreateInputSchema>;
|
|
2642
|
-
|
|
2643
|
-
declare const SupplierCreateInputSchema: z.ZodObject<{
|
|
2644
|
-
fiscal_id: z.ZodString;
|
|
2645
|
-
name: z.ZodString;
|
|
2646
|
-
address: z.ZodOptional<z.ZodObject<{
|
|
2647
|
-
street_address: z.ZodString;
|
|
2648
|
-
street_number: z.ZodString;
|
|
2649
|
-
zip_code: z.ZodString;
|
|
2650
|
-
city: z.ZodString;
|
|
2651
|
-
province: z.ZodString;
|
|
2652
|
-
}, z.core.$strip>>;
|
|
2653
|
-
}, z.core.$strip>;
|
|
2654
|
-
declare const SupplierUpdateInputSchema: z.ZodObject<{
|
|
2655
|
-
name: z.ZodString;
|
|
2656
|
-
address: z.ZodOptional<z.ZodObject<{
|
|
2657
|
-
street_address: z.ZodString;
|
|
2658
|
-
street_number: z.ZodString;
|
|
2659
|
-
zip_code: z.ZodString;
|
|
2660
|
-
city: z.ZodString;
|
|
2661
|
-
province: z.ZodString;
|
|
2662
|
-
}, z.core.$strip>>;
|
|
2663
|
-
}, z.core.$strip>;
|
|
2664
|
-
type SupplierCreateInputType = z.infer<typeof SupplierCreateInputSchema>;
|
|
2665
|
-
type SupplierUpdateInputType = z.infer<typeof SupplierUpdateInputSchema>;
|
|
2666
|
-
|
|
2667
|
-
declare const JournalCloseInputSchema: z.ZodObject<{
|
|
2668
|
-
closing_timestamp: z.ZodString;
|
|
2669
|
-
reason: z.ZodOptional<z.ZodString>;
|
|
2670
|
-
}, z.core.$strip>;
|
|
2671
|
-
type JournalCloseInputType = z.infer<typeof JournalCloseInputSchema>;
|
|
2672
1795
|
|
|
2673
1796
|
declare const DAILY_REPORT_STATUS_OPTIONS: readonly ["pending", "sent", "error"];
|
|
2674
|
-
declare const DailyReportStatusSchema: z.ZodEnum<{
|
|
2675
|
-
error: "error";
|
|
2676
|
-
sent: "sent";
|
|
2677
|
-
pending: "pending";
|
|
2678
|
-
}>;
|
|
2679
|
-
declare const DailyReportsParamsSchema: z.ZodObject<{
|
|
2680
|
-
pem_serial_number: z.ZodOptional<z.ZodString>;
|
|
2681
|
-
date_from: z.ZodOptional<z.ZodString>;
|
|
2682
|
-
date_to: z.ZodOptional<z.ZodString>;
|
|
2683
|
-
status: z.ZodOptional<z.ZodEnum<{
|
|
2684
|
-
error: "error";
|
|
2685
|
-
sent: "sent";
|
|
2686
|
-
pending: "pending";
|
|
2687
|
-
}>>;
|
|
2688
|
-
page: z.ZodOptional<z.ZodNumber>;
|
|
2689
|
-
}, z.core.$strip>;
|
|
2690
|
-
type DailyReportStatusType = z.infer<typeof DailyReportStatusSchema>;
|
|
2691
|
-
type DailyReportsParamsType = z.infer<typeof DailyReportsParamsSchema>;
|
|
2692
|
-
|
|
2693
|
-
declare const NotificationScopeSchema: z.ZodObject<{
|
|
2694
|
-
type: z.ZodLiteral<"global">;
|
|
2695
|
-
}, z.core.$strip>;
|
|
2696
|
-
declare const PemStatusSchema: z.ZodEnum<{
|
|
2697
|
-
ONLINE: "ONLINE";
|
|
2698
|
-
OFFLINE: "OFFLINE";
|
|
2699
|
-
}>;
|
|
2700
|
-
declare const NotificationDataBlockAtSchema: z.ZodObject<{
|
|
2701
|
-
block_at: z.ZodString;
|
|
2702
|
-
}, z.core.$strip>;
|
|
2703
|
-
declare const NotificationDataPemStatusSchema: z.ZodObject<{
|
|
2704
|
-
from: z.ZodEnum<{
|
|
2705
|
-
ONLINE: "ONLINE";
|
|
2706
|
-
OFFLINE: "OFFLINE";
|
|
2707
|
-
}>;
|
|
2708
|
-
to: z.ZodEnum<{
|
|
2709
|
-
ONLINE: "ONLINE";
|
|
2710
|
-
OFFLINE: "OFFLINE";
|
|
2711
|
-
}>;
|
|
2712
|
-
}, z.core.$strip>;
|
|
2713
|
-
declare const NotificationMf2UnreachableSchema: z.ZodObject<{
|
|
2714
|
-
uuid: z.ZodString;
|
|
2715
|
-
scope: z.ZodObject<{
|
|
2716
|
-
type: z.ZodLiteral<"global">;
|
|
2717
|
-
}, z.core.$strip>;
|
|
2718
|
-
source: z.ZodEnum<{
|
|
2719
|
-
system: "system";
|
|
2720
|
-
"Italian Tax Authority": "Italian Tax Authority";
|
|
2721
|
-
}>;
|
|
2722
|
-
level: z.ZodEnum<{
|
|
2723
|
-
info: "info";
|
|
2724
|
-
warning: "warning";
|
|
2725
|
-
error: "error";
|
|
2726
|
-
critical: "critical";
|
|
2727
|
-
}>;
|
|
2728
|
-
created_at: z.ZodString;
|
|
2729
|
-
type: z.ZodLiteral<"INTERNAL_COMMUNICATION_FAILURE">;
|
|
2730
|
-
code: z.ZodLiteral<"SYS-W-01">;
|
|
2731
|
-
data: z.ZodObject<{
|
|
2732
|
-
block_at: z.ZodString;
|
|
2733
|
-
}, z.core.$strip>;
|
|
2734
|
-
}, z.core.$strip>;
|
|
2735
|
-
declare const NotificationPemsBlockedSchema: z.ZodObject<{
|
|
2736
|
-
uuid: z.ZodString;
|
|
2737
|
-
scope: z.ZodObject<{
|
|
2738
|
-
type: z.ZodLiteral<"global">;
|
|
2739
|
-
}, z.core.$strip>;
|
|
2740
|
-
source: z.ZodEnum<{
|
|
2741
|
-
system: "system";
|
|
2742
|
-
"Italian Tax Authority": "Italian Tax Authority";
|
|
2743
|
-
}>;
|
|
2744
|
-
level: z.ZodEnum<{
|
|
2745
|
-
info: "info";
|
|
2746
|
-
warning: "warning";
|
|
2747
|
-
error: "error";
|
|
2748
|
-
critical: "critical";
|
|
2749
|
-
}>;
|
|
2750
|
-
created_at: z.ZodString;
|
|
2751
|
-
type: z.ZodLiteral<"PEM_STATUS_CHANGED">;
|
|
2752
|
-
code: z.ZodLiteral<"SYS-C-01">;
|
|
2753
|
-
data: z.ZodObject<{
|
|
2754
|
-
from: z.ZodEnum<{
|
|
2755
|
-
ONLINE: "ONLINE";
|
|
2756
|
-
OFFLINE: "OFFLINE";
|
|
2757
|
-
}>;
|
|
2758
|
-
to: z.ZodEnum<{
|
|
2759
|
-
ONLINE: "ONLINE";
|
|
2760
|
-
OFFLINE: "OFFLINE";
|
|
2761
|
-
}>;
|
|
2762
|
-
}, z.core.$strip>;
|
|
2763
|
-
}, z.core.$strip>;
|
|
2764
|
-
declare const NotificationPemBackOnlineSchema: z.ZodObject<{
|
|
2765
|
-
uuid: z.ZodString;
|
|
2766
|
-
scope: z.ZodObject<{
|
|
2767
|
-
type: z.ZodLiteral<"global">;
|
|
2768
|
-
}, z.core.$strip>;
|
|
2769
|
-
source: z.ZodEnum<{
|
|
2770
|
-
system: "system";
|
|
2771
|
-
"Italian Tax Authority": "Italian Tax Authority";
|
|
2772
|
-
}>;
|
|
2773
|
-
level: z.ZodEnum<{
|
|
2774
|
-
info: "info";
|
|
2775
|
-
warning: "warning";
|
|
2776
|
-
error: "error";
|
|
2777
|
-
critical: "critical";
|
|
2778
|
-
}>;
|
|
2779
|
-
created_at: z.ZodString;
|
|
2780
|
-
type: z.ZodLiteral<"PEM_STATUS_CHANGED">;
|
|
2781
|
-
code: z.ZodLiteral<"SYS-I-01">;
|
|
2782
|
-
data: z.ZodObject<{
|
|
2783
|
-
from: z.ZodEnum<{
|
|
2784
|
-
ONLINE: "ONLINE";
|
|
2785
|
-
OFFLINE: "OFFLINE";
|
|
2786
|
-
}>;
|
|
2787
|
-
to: z.ZodEnum<{
|
|
2788
|
-
ONLINE: "ONLINE";
|
|
2789
|
-
OFFLINE: "OFFLINE";
|
|
2790
|
-
}>;
|
|
2791
|
-
}, z.core.$strip>;
|
|
2792
|
-
}, z.core.$strip>;
|
|
2793
|
-
declare const NotificationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
2794
|
-
uuid: z.ZodString;
|
|
2795
|
-
scope: z.ZodObject<{
|
|
2796
|
-
type: z.ZodLiteral<"global">;
|
|
2797
|
-
}, z.core.$strip>;
|
|
2798
|
-
source: z.ZodEnum<{
|
|
2799
|
-
system: "system";
|
|
2800
|
-
"Italian Tax Authority": "Italian Tax Authority";
|
|
2801
|
-
}>;
|
|
2802
|
-
level: z.ZodEnum<{
|
|
2803
|
-
info: "info";
|
|
2804
|
-
warning: "warning";
|
|
2805
|
-
error: "error";
|
|
2806
|
-
critical: "critical";
|
|
2807
|
-
}>;
|
|
2808
|
-
created_at: z.ZodString;
|
|
2809
|
-
type: z.ZodLiteral<"INTERNAL_COMMUNICATION_FAILURE">;
|
|
2810
|
-
code: z.ZodLiteral<"SYS-W-01">;
|
|
2811
|
-
data: z.ZodObject<{
|
|
2812
|
-
block_at: z.ZodString;
|
|
2813
|
-
}, z.core.$strip>;
|
|
2814
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
2815
|
-
uuid: z.ZodString;
|
|
2816
|
-
scope: z.ZodObject<{
|
|
2817
|
-
type: z.ZodLiteral<"global">;
|
|
2818
|
-
}, z.core.$strip>;
|
|
2819
|
-
source: z.ZodEnum<{
|
|
2820
|
-
system: "system";
|
|
2821
|
-
"Italian Tax Authority": "Italian Tax Authority";
|
|
2822
|
-
}>;
|
|
2823
|
-
level: z.ZodEnum<{
|
|
2824
|
-
info: "info";
|
|
2825
|
-
warning: "warning";
|
|
2826
|
-
error: "error";
|
|
2827
|
-
critical: "critical";
|
|
2828
|
-
}>;
|
|
2829
|
-
created_at: z.ZodString;
|
|
2830
|
-
type: z.ZodLiteral<"PEM_STATUS_CHANGED">;
|
|
2831
|
-
code: z.ZodLiteral<"SYS-C-01">;
|
|
2832
|
-
data: z.ZodObject<{
|
|
2833
|
-
from: z.ZodEnum<{
|
|
2834
|
-
ONLINE: "ONLINE";
|
|
2835
|
-
OFFLINE: "OFFLINE";
|
|
2836
|
-
}>;
|
|
2837
|
-
to: z.ZodEnum<{
|
|
2838
|
-
ONLINE: "ONLINE";
|
|
2839
|
-
OFFLINE: "OFFLINE";
|
|
2840
|
-
}>;
|
|
2841
|
-
}, z.core.$strip>;
|
|
2842
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
2843
|
-
uuid: z.ZodString;
|
|
2844
|
-
scope: z.ZodObject<{
|
|
2845
|
-
type: z.ZodLiteral<"global">;
|
|
2846
|
-
}, z.core.$strip>;
|
|
2847
|
-
source: z.ZodEnum<{
|
|
2848
|
-
system: "system";
|
|
2849
|
-
"Italian Tax Authority": "Italian Tax Authority";
|
|
2850
|
-
}>;
|
|
2851
|
-
level: z.ZodEnum<{
|
|
2852
|
-
info: "info";
|
|
2853
|
-
warning: "warning";
|
|
2854
|
-
error: "error";
|
|
2855
|
-
critical: "critical";
|
|
2856
|
-
}>;
|
|
2857
|
-
created_at: z.ZodString;
|
|
2858
|
-
type: z.ZodLiteral<"PEM_STATUS_CHANGED">;
|
|
2859
|
-
code: z.ZodLiteral<"SYS-I-01">;
|
|
2860
|
-
data: z.ZodObject<{
|
|
2861
|
-
from: z.ZodEnum<{
|
|
2862
|
-
ONLINE: "ONLINE";
|
|
2863
|
-
OFFLINE: "OFFLINE";
|
|
2864
|
-
}>;
|
|
2865
|
-
to: z.ZodEnum<{
|
|
2866
|
-
ONLINE: "ONLINE";
|
|
2867
|
-
OFFLINE: "OFFLINE";
|
|
2868
|
-
}>;
|
|
2869
|
-
}, z.core.$strip>;
|
|
2870
|
-
}, z.core.$strip>], "code">;
|
|
2871
|
-
declare const NotificationListResponseSchema: z.ZodObject<{
|
|
2872
|
-
members: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
2873
|
-
uuid: z.ZodString;
|
|
2874
|
-
scope: z.ZodObject<{
|
|
2875
|
-
type: z.ZodLiteral<"global">;
|
|
2876
|
-
}, z.core.$strip>;
|
|
2877
|
-
source: z.ZodEnum<{
|
|
2878
|
-
system: "system";
|
|
2879
|
-
"Italian Tax Authority": "Italian Tax Authority";
|
|
2880
|
-
}>;
|
|
2881
|
-
level: z.ZodEnum<{
|
|
2882
|
-
info: "info";
|
|
2883
|
-
warning: "warning";
|
|
2884
|
-
error: "error";
|
|
2885
|
-
critical: "critical";
|
|
2886
|
-
}>;
|
|
2887
|
-
created_at: z.ZodString;
|
|
2888
|
-
type: z.ZodLiteral<"INTERNAL_COMMUNICATION_FAILURE">;
|
|
2889
|
-
code: z.ZodLiteral<"SYS-W-01">;
|
|
2890
|
-
data: z.ZodObject<{
|
|
2891
|
-
block_at: z.ZodString;
|
|
2892
|
-
}, z.core.$strip>;
|
|
2893
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
2894
|
-
uuid: z.ZodString;
|
|
2895
|
-
scope: z.ZodObject<{
|
|
2896
|
-
type: z.ZodLiteral<"global">;
|
|
2897
|
-
}, z.core.$strip>;
|
|
2898
|
-
source: z.ZodEnum<{
|
|
2899
|
-
system: "system";
|
|
2900
|
-
"Italian Tax Authority": "Italian Tax Authority";
|
|
2901
|
-
}>;
|
|
2902
|
-
level: z.ZodEnum<{
|
|
2903
|
-
info: "info";
|
|
2904
|
-
warning: "warning";
|
|
2905
|
-
error: "error";
|
|
2906
|
-
critical: "critical";
|
|
2907
|
-
}>;
|
|
2908
|
-
created_at: z.ZodString;
|
|
2909
|
-
type: z.ZodLiteral<"PEM_STATUS_CHANGED">;
|
|
2910
|
-
code: z.ZodLiteral<"SYS-C-01">;
|
|
2911
|
-
data: z.ZodObject<{
|
|
2912
|
-
from: z.ZodEnum<{
|
|
2913
|
-
ONLINE: "ONLINE";
|
|
2914
|
-
OFFLINE: "OFFLINE";
|
|
2915
|
-
}>;
|
|
2916
|
-
to: z.ZodEnum<{
|
|
2917
|
-
ONLINE: "ONLINE";
|
|
2918
|
-
OFFLINE: "OFFLINE";
|
|
2919
|
-
}>;
|
|
2920
|
-
}, z.core.$strip>;
|
|
2921
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
2922
|
-
uuid: z.ZodString;
|
|
2923
|
-
scope: z.ZodObject<{
|
|
2924
|
-
type: z.ZodLiteral<"global">;
|
|
2925
|
-
}, z.core.$strip>;
|
|
2926
|
-
source: z.ZodEnum<{
|
|
2927
|
-
system: "system";
|
|
2928
|
-
"Italian Tax Authority": "Italian Tax Authority";
|
|
2929
|
-
}>;
|
|
2930
|
-
level: z.ZodEnum<{
|
|
2931
|
-
info: "info";
|
|
2932
|
-
warning: "warning";
|
|
2933
|
-
error: "error";
|
|
2934
|
-
critical: "critical";
|
|
2935
|
-
}>;
|
|
2936
|
-
created_at: z.ZodString;
|
|
2937
|
-
type: z.ZodLiteral<"PEM_STATUS_CHANGED">;
|
|
2938
|
-
code: z.ZodLiteral<"SYS-I-01">;
|
|
2939
|
-
data: z.ZodObject<{
|
|
2940
|
-
from: z.ZodEnum<{
|
|
2941
|
-
ONLINE: "ONLINE";
|
|
2942
|
-
OFFLINE: "OFFLINE";
|
|
2943
|
-
}>;
|
|
2944
|
-
to: z.ZodEnum<{
|
|
2945
|
-
ONLINE: "ONLINE";
|
|
2946
|
-
OFFLINE: "OFFLINE";
|
|
2947
|
-
}>;
|
|
2948
|
-
}, z.core.$strip>;
|
|
2949
|
-
}, z.core.$strip>], "code">>;
|
|
2950
|
-
}, z.core.$strip>;
|
|
2951
|
-
type NotificationSchemaType = z.infer<typeof NotificationSchema>;
|
|
2952
|
-
type NotificationListResponseSchemaType = z.infer<typeof NotificationListResponseSchema>;
|
|
2953
|
-
|
|
2954
|
-
declare const TelemetryMerchantSchema: z.ZodObject<{
|
|
2955
|
-
vat_number: z.ZodString;
|
|
2956
|
-
fiscal_code: z.ZodNullable<z.ZodString>;
|
|
2957
|
-
business_name: z.ZodString;
|
|
2958
|
-
}, z.core.$strip>;
|
|
2959
|
-
declare const TelemetrySupplierSchema: z.ZodObject<{
|
|
2960
|
-
vat_number: z.ZodString;
|
|
2961
|
-
fiscal_code: z.ZodNullable<z.ZodString>;
|
|
2962
|
-
business_name: z.ZodString;
|
|
2963
|
-
}, z.core.$strip>;
|
|
2964
|
-
declare const TelemetrySoftwareVersionSchema: z.ZodObject<{
|
|
2965
|
-
version: z.ZodString;
|
|
2966
|
-
swid: z.ZodString;
|
|
2967
|
-
installed_at: z.ZodString;
|
|
2968
|
-
status: z.ZodEnum<{
|
|
2969
|
-
active: "active";
|
|
2970
|
-
inactive: "inactive";
|
|
2971
|
-
archived: "archived";
|
|
2972
|
-
}>;
|
|
2973
|
-
}, z.core.$strip>;
|
|
2974
|
-
declare const TelemetrySoftwareSchema: z.ZodObject<{
|
|
2975
|
-
code: z.ZodString;
|
|
2976
|
-
name: z.ZodString;
|
|
2977
|
-
approval_reference: z.ZodString;
|
|
2978
|
-
version_info: z.ZodObject<{
|
|
2979
|
-
version: z.ZodString;
|
|
2980
|
-
swid: z.ZodString;
|
|
2981
|
-
installed_at: z.ZodString;
|
|
2982
|
-
status: z.ZodEnum<{
|
|
2983
|
-
active: "active";
|
|
2984
|
-
inactive: "inactive";
|
|
2985
|
-
archived: "archived";
|
|
2986
|
-
}>;
|
|
2987
|
-
}, z.core.$strip>;
|
|
2988
|
-
}, z.core.$strip>;
|
|
2989
|
-
declare const PendingReceiptsSchema: z.ZodObject<{
|
|
2990
|
-
count: z.ZodNumber;
|
|
2991
|
-
total_amount: z.ZodString;
|
|
2992
|
-
}, z.core.$strip>;
|
|
2993
|
-
declare const TransmissionSchema: z.ZodObject<{
|
|
2994
|
-
attempted_at: z.ZodString;
|
|
2995
|
-
outcome: z.ZodEnum<{
|
|
2996
|
-
success: "success";
|
|
2997
|
-
pending: "pending";
|
|
2998
|
-
failed: "failed";
|
|
2999
|
-
}>;
|
|
3000
|
-
}, z.core.$strip>;
|
|
3001
|
-
declare const MessageSchema: z.ZodObject<{
|
|
3002
|
-
received_at: z.ZodString;
|
|
3003
|
-
content: z.ZodString;
|
|
3004
|
-
}, z.core.$strip>;
|
|
3005
|
-
declare const LotterySecretRequestSchema: z.ZodObject<{
|
|
3006
|
-
requested_at: z.ZodString;
|
|
3007
|
-
outcome: z.ZodEnum<{
|
|
3008
|
-
success: "success";
|
|
3009
|
-
pending: "pending";
|
|
3010
|
-
failed: "failed";
|
|
3011
|
-
}>;
|
|
3012
|
-
}, z.core.$strip>;
|
|
3013
|
-
declare const LotterySchema: z.ZodObject<{
|
|
3014
|
-
last_transmission: z.ZodObject<{
|
|
3015
|
-
attempted_at: z.ZodString;
|
|
3016
|
-
outcome: z.ZodEnum<{
|
|
3017
|
-
success: "success";
|
|
3018
|
-
pending: "pending";
|
|
3019
|
-
failed: "failed";
|
|
3020
|
-
}>;
|
|
3021
|
-
}, z.core.$strip>;
|
|
3022
|
-
secret_request: z.ZodObject<{
|
|
3023
|
-
requested_at: z.ZodString;
|
|
3024
|
-
outcome: z.ZodEnum<{
|
|
3025
|
-
success: "success";
|
|
3026
|
-
pending: "pending";
|
|
3027
|
-
failed: "failed";
|
|
3028
|
-
}>;
|
|
3029
|
-
}, z.core.$strip>;
|
|
3030
|
-
}, z.core.$strip>;
|
|
3031
|
-
declare const TelemetrySchema: z.ZodObject<{
|
|
3032
|
-
pem_id: z.ZodString;
|
|
3033
|
-
pem_status: z.ZodEnum<{
|
|
3034
|
-
ONLINE: "ONLINE";
|
|
3035
|
-
OFFLINE: "OFFLINE";
|
|
3036
|
-
ERROR: "ERROR";
|
|
3037
|
-
}>;
|
|
3038
|
-
pem_status_changed_at: z.ZodString;
|
|
3039
|
-
merchant: z.ZodObject<{
|
|
3040
|
-
vat_number: z.ZodString;
|
|
3041
|
-
fiscal_code: z.ZodNullable<z.ZodString>;
|
|
3042
|
-
business_name: z.ZodString;
|
|
3043
|
-
}, z.core.$strip>;
|
|
3044
|
-
supplier: z.ZodObject<{
|
|
3045
|
-
vat_number: z.ZodString;
|
|
3046
|
-
fiscal_code: z.ZodNullable<z.ZodString>;
|
|
3047
|
-
business_name: z.ZodString;
|
|
3048
|
-
}, z.core.$strip>;
|
|
3049
|
-
software: z.ZodObject<{
|
|
3050
|
-
code: z.ZodString;
|
|
3051
|
-
name: z.ZodString;
|
|
3052
|
-
approval_reference: z.ZodString;
|
|
3053
|
-
version_info: z.ZodObject<{
|
|
3054
|
-
version: z.ZodString;
|
|
3055
|
-
swid: z.ZodString;
|
|
3056
|
-
installed_at: z.ZodString;
|
|
3057
|
-
status: z.ZodEnum<{
|
|
3058
|
-
active: "active";
|
|
3059
|
-
inactive: "inactive";
|
|
3060
|
-
archived: "archived";
|
|
3061
|
-
}>;
|
|
3062
|
-
}, z.core.$strip>;
|
|
3063
|
-
}, z.core.$strip>;
|
|
3064
|
-
last_communication_at: z.ZodString;
|
|
3065
|
-
pending_receipts: z.ZodObject<{
|
|
3066
|
-
count: z.ZodNumber;
|
|
3067
|
-
total_amount: z.ZodString;
|
|
3068
|
-
}, z.core.$strip>;
|
|
3069
|
-
last_receipt_transmission: z.ZodObject<{
|
|
3070
|
-
attempted_at: z.ZodString;
|
|
3071
|
-
outcome: z.ZodEnum<{
|
|
3072
|
-
success: "success";
|
|
3073
|
-
pending: "pending";
|
|
3074
|
-
failed: "failed";
|
|
3075
|
-
}>;
|
|
3076
|
-
}, z.core.$strip>;
|
|
3077
|
-
last_message_from_mf2: z.ZodObject<{
|
|
3078
|
-
received_at: z.ZodString;
|
|
3079
|
-
content: z.ZodString;
|
|
3080
|
-
}, z.core.$strip>;
|
|
3081
|
-
ade_corrispettivi_transmission: z.ZodObject<{
|
|
3082
|
-
attempted_at: z.ZodString;
|
|
3083
|
-
outcome: z.ZodEnum<{
|
|
3084
|
-
success: "success";
|
|
3085
|
-
pending: "pending";
|
|
3086
|
-
failed: "failed";
|
|
3087
|
-
}>;
|
|
3088
|
-
}, z.core.$strip>;
|
|
3089
|
-
last_message_from_ade: z.ZodObject<{
|
|
3090
|
-
received_at: z.ZodString;
|
|
3091
|
-
content: z.ZodString;
|
|
3092
|
-
}, z.core.$strip>;
|
|
3093
|
-
lottery: z.ZodObject<{
|
|
3094
|
-
last_transmission: z.ZodObject<{
|
|
3095
|
-
attempted_at: z.ZodString;
|
|
3096
|
-
outcome: z.ZodEnum<{
|
|
3097
|
-
success: "success";
|
|
3098
|
-
pending: "pending";
|
|
3099
|
-
failed: "failed";
|
|
3100
|
-
}>;
|
|
3101
|
-
}, z.core.$strip>;
|
|
3102
|
-
secret_request: z.ZodObject<{
|
|
3103
|
-
requested_at: z.ZodString;
|
|
3104
|
-
outcome: z.ZodEnum<{
|
|
3105
|
-
success: "success";
|
|
3106
|
-
pending: "pending";
|
|
3107
|
-
failed: "failed";
|
|
3108
|
-
}>;
|
|
3109
|
-
}, z.core.$strip>;
|
|
3110
|
-
}, z.core.$strip>;
|
|
3111
|
-
}, z.core.$strip>;
|
|
3112
|
-
type TelemetrySchemaType = z.infer<typeof TelemetrySchema>;
|
|
3113
|
-
|
|
3114
|
-
/**
|
|
3115
|
-
* Zod validation schemas for ACube E-Receipt API
|
|
3116
|
-
*
|
|
3117
|
-
* This module exports all validation schemas and types for API input DTOs.
|
|
3118
|
-
* Use these schemas to validate user input before sending requests to the API.
|
|
3119
|
-
*
|
|
3120
|
-
* @example
|
|
3121
|
-
* ```typescript
|
|
3122
|
-
* import { ReceiptInputSchema, ReceiptInputType } from '@/validations/api';
|
|
3123
|
-
*
|
|
3124
|
-
* // Validate input data
|
|
3125
|
-
* const result = ReceiptInputSchema.safeParse(userInput);
|
|
3126
|
-
* if (!result.success) {
|
|
3127
|
-
* console.error('Validation errors:', result.error.errors);
|
|
3128
|
-
* } else {
|
|
3129
|
-
* // Use validated data
|
|
3130
|
-
* const validatedData: ReceiptInputType = result.data;
|
|
3131
|
-
* }
|
|
3132
|
-
* ```
|
|
3133
|
-
*/
|
|
3134
|
-
|
|
3135
|
-
declare const ValidationMessages: {
|
|
3136
|
-
readonly fieldIsRequired: "This field is required";
|
|
3137
|
-
readonly arrayMin1: "At least one item is required";
|
|
3138
|
-
readonly paymentMethodRequired: "At least one payment method is required";
|
|
3139
|
-
readonly invalidEmail: "Please enter a valid email address";
|
|
3140
|
-
readonly passwordMinLength: "Password must be at least 8 characters long";
|
|
3141
|
-
readonly passwordComplexity: "Password must contain at least one uppercase letter, one lowercase letter, one number, and one special character";
|
|
3142
|
-
readonly invalidZipCode: "Please enter a valid 5-digit zip code";
|
|
3143
|
-
readonly provinceMinLength: "Province code must be 2 characters";
|
|
3144
|
-
readonly provinceMaxLength: "Province code must be 2 characters";
|
|
3145
|
-
readonly invalidDateFormat: "Please enter a valid date";
|
|
3146
|
-
readonly nameMaxLength: "Name is too long";
|
|
3147
|
-
readonly invalidFiscalId: "Please enter a valid Italian fiscal ID (Codice Fiscale or Partita IVA)";
|
|
3148
|
-
readonly invalidVatNumber: "Please enter a valid VAT number (11 digits)";
|
|
3149
|
-
readonly invalidFiscalCode: "Please enter a valid fiscal code (11 digits)";
|
|
3150
|
-
readonly businessNameMaxLength: "Business name is too long (max 200 characters)";
|
|
3151
|
-
readonly businessNameOrPersonalNamesRequired: "Please provide either a business name or first/last name, but not both";
|
|
3152
|
-
readonly firstNameMaxLength: "First name is too long (max 100 characters)";
|
|
3153
|
-
readonly lastNameMaxLength: "Last name is too long (max 100 characters)";
|
|
3154
|
-
readonly invalidUuid: "Please enter a valid UUID";
|
|
3155
|
-
readonly invalidPemType: "PEM type must be one of: AP, SP, TM, PV";
|
|
3156
|
-
readonly reasonMaxLength: "Reason is too long (max 255 characters)";
|
|
3157
|
-
readonly pageMinValue: "Page number must be at least 1";
|
|
3158
|
-
readonly invalidDailyReportStatus: "Daily report status must be one of: pending, sent, error";
|
|
3159
|
-
readonly displayNameMaxLength: "Display name is too long (max 255 characters)";
|
|
3160
|
-
};
|
|
3161
|
-
declare const validateInput: <T>(schema: z.ZodSchema<T>, data: unknown) => {
|
|
3162
|
-
success: boolean;
|
|
3163
|
-
errors: {
|
|
3164
|
-
field: string;
|
|
3165
|
-
message: string;
|
|
3166
|
-
code: "invalid_type" | "too_big" | "too_small" | "invalid_format" | "not_multiple_of" | "unrecognized_keys" | "invalid_union" | "invalid_key" | "invalid_element" | "invalid_value" | "custom";
|
|
3167
|
-
}[];
|
|
3168
|
-
data: null;
|
|
3169
|
-
} | {
|
|
3170
|
-
success: boolean;
|
|
3171
|
-
errors: never[];
|
|
3172
|
-
data: T;
|
|
3173
|
-
};
|
|
3174
|
-
interface ValidationResult<T> {
|
|
3175
|
-
success: boolean;
|
|
3176
|
-
errors: Array<{
|
|
3177
|
-
field: string;
|
|
3178
|
-
message: string;
|
|
3179
|
-
code: string;
|
|
3180
|
-
}>;
|
|
3181
|
-
data: T | null;
|
|
3182
|
-
}
|
|
3183
1797
|
|
|
3184
1798
|
interface MTLSAdapterConfig {
|
|
3185
1799
|
baseUrl?: string;
|
|
@@ -3194,40 +1808,5 @@ interface PlatformAdapterOptions {
|
|
|
3194
1808
|
declare function loadPlatformAdapters(options?: PlatformAdapterOptions): PlatformAdapters;
|
|
3195
1809
|
declare function createACubeMTLSConfig(baseUrl: string, timeout?: number, autoInitialize?: boolean, forcePort444?: boolean): MTLSAdapterConfig;
|
|
3196
1810
|
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
CERTIFICATE_NOT_FOUND = "MTLS_CERTIFICATE_NOT_FOUND",
|
|
3200
|
-
CERTIFICATE_EXPIRED = "MTLS_CERTIFICATE_EXPIRED",
|
|
3201
|
-
CERTIFICATE_INVALID = "MTLS_CERTIFICATE_INVALID",
|
|
3202
|
-
CONNECTION_FAILED = "MTLS_CONNECTION_FAILED",
|
|
3203
|
-
AUTHENTICATION_FAILED = "MTLS_AUTHENTICATION_FAILED",
|
|
3204
|
-
CONFIGURATION_ERROR = "MTLS_CONFIGURATION_ERROR"
|
|
3205
|
-
}
|
|
3206
|
-
declare class MTLSError extends Error {
|
|
3207
|
-
type: MTLSErrorType;
|
|
3208
|
-
originalError?: Error | undefined;
|
|
3209
|
-
statusCode?: number | undefined;
|
|
3210
|
-
constructor(type: MTLSErrorType, message: string, originalError?: Error | undefined, statusCode?: number | undefined);
|
|
3211
|
-
}
|
|
3212
|
-
|
|
3213
|
-
interface JwtPayload {
|
|
3214
|
-
uid: number;
|
|
3215
|
-
username: string;
|
|
3216
|
-
roles: Record<string, string[]>;
|
|
3217
|
-
fid: string;
|
|
3218
|
-
pid: string | null;
|
|
3219
|
-
exp: number;
|
|
3220
|
-
iat: number;
|
|
3221
|
-
}
|
|
3222
|
-
declare function parseJwt(token: string): JwtPayload;
|
|
3223
|
-
declare function isTokenExpired(payload: JwtPayload): boolean;
|
|
3224
|
-
declare function extractRoles(jwtRoles: Record<string, string[]>): UserRole[];
|
|
3225
|
-
|
|
3226
|
-
declare class CertificateValidator {
|
|
3227
|
-
static validatePEMFormat(certificate: string, privateKey: string): boolean;
|
|
3228
|
-
static isCertificateExpired(validTo: Date): boolean;
|
|
3229
|
-
static getDaysUntilExpiry(validTo: Date): number;
|
|
3230
|
-
}
|
|
3231
|
-
|
|
3232
|
-
export { ACubeSDK, ACubeSDKError, ActivationRequestSchema, AddressMapper, AddressSchema, AppStateService, AuthStrategy, AuthenticationService, AxiosHttpAdapter, CacheHandler, CashRegisterCreateSchema, CashRegisterMapper, CashRegisterRepositoryImpl, CashierCreateInputSchema, CashierMapper, CashierRepositoryImpl, CertificateService, CertificateValidator, ConfigManager, DAILY_REPORT_STATUS_OPTIONS, DEFAULT_QUEUE_CONFIG, DIContainer, DI_TOKENS, DailyReportMapper, DailyReportRepositoryImpl, DailyReportStatusSchema, DailyReportsParamsSchema, EXEMPT_VAT_CODES, ErrorCategory, GOOD_OR_SERVICE_OPTIONS, GoodOrServiceSchema, JournalCloseInputSchema, JournalMapper, JournalRepositoryImpl, JwtAuthHandler, LotterySchema, LotterySecretRequestSchema, MTLSError, MTLSErrorType, MerchantCreateInputSchema, MerchantMapper, MerchantRepositoryImpl, MerchantUpdateInputSchema, MessageSchema, MtlsAuthHandler, NOTIFICATION_CODES, NOTIFICATION_LEVELS, NOTIFICATION_SCOPES, NOTIFICATION_SOURCES, NOTIFICATION_TYPES, NotificationDataBlockAtSchema, NotificationDataPemStatusSchema, NotificationListResponseSchema, NotificationMapper, NotificationMf2UnreachableSchema, NotificationPemBackOnlineSchema, NotificationPemsBlockedSchema, NotificationRepositoryImpl, NotificationSchema, NotificationScopeSchema, NotificationService, OfflineManager, OperationQueue, PEMStatusOfflineRequestSchema, PEMStatusSchema, PEM_STATUS_OPTIONS, PEM_TYPE_OPTIONS, PemCreateInputSchema, PemDataSchema, PemMapper, PemRepositoryImpl, PemStatusSchema, PendingReceiptsSchema, PlatformDetector, PointOfSaleMapper, PointOfSaleRepositoryImpl, RECEIPT_PROOF_TYPE_OPTIONS, RECEIPT_READY, RECEIPT_SENT, RECEIPT_SORT_ASCENDING, RECEIPT_SORT_DESCENDING, ReceiptInputSchema, ReceiptItemSchema, ReceiptMapper, ReceiptProofTypeSchema, ReceiptRepositoryImpl, ReceiptReturnInputSchema, ReceiptReturnItemSchema, ReceiptReturnOrVoidViaPEMInputSchema, ReceiptReturnOrVoidWithProofInputSchema, SDKFactory, SDKManager, STANDARD_VAT_RATES, SupplierCreateInputSchema, SupplierMapper, SupplierRepositoryImpl, SupplierUpdateInputSchema, SyncManager, TelemetryMapper, TelemetryMerchantSchema, TelemetryRepositoryImpl, TelemetrySchema, TelemetryService, TelemetrySoftwareSchema, TelemetrySoftwareVersionSchema, TelemetrySupplierSchema, TransmissionSchema, VAT_RATE_CODES, VAT_RATE_CODE_OPTIONS, ValidationMessages, VatRateCodeSchema, VoidReceiptInputSchema, classifyError, clearObject, clearObjectShallow, createACubeMTLSConfig, createACubeSDK, createPrefixedLogger, createACubeSDK as default, detectPlatform, extractRoles, formatDecimal, getUserFriendlyMessage, hasAnyRole, hasNonEmptyValues, hasRole, isEmpty, isTokenExpired, loadPlatformAdapters, logger, parseJwt, shouldReconfigureCertificate, shouldRetryRequest, transformError, validateInput };
|
|
3233
|
-
export type { ActivationRequest, ActivationRequestApiInput, ActivationRequestType, Address, AddressApiOutput, AddressType, AppMode, AppState, AuthConfig, AuthCredentials$1 as AuthCredentials, AuthMode, AxiosHttpAdapterConfig, BatchSyncResult, CacheConfig, CacheOptions, CacheResource, CacheResourceConfig, CacheSize, CachedItem, CashRegister, CashRegisterApiOutput, CashRegisterCreateApiInput, CashRegisterCreateInput, CashRegisterCreateType, CashRegisterDetailed, CashRegisterDetailedApiOutput, CashRegisterListParams, CashRegisterUpdateApiInput, CashRegisterUpdateInput, Cashier, CashierApiOutput, CashierCreateApiInput, CashierCreateInput, CashierCreateInputType, CashierListParams, CashierStatus, CertificateData, CertificateInfo, Cleaned, CleanedShallow, CompressionResult, DailyReport, DailyReportApiOutput, DailyReportStatus, DailyReportStatusType, DailyReportsParams, DailyReportsParamsType, DecompressionResult, Domain, Environment, ErrorClassification, GoodOrService, GoodOrServiceType, HttpMethod, HttpRequestConfig, HttpResponse, IAuthHandler, ICacheAdapter, ICacheKeyGenerator, ICachePort, ICashRegisterRepository, ICashierRepository, ICertificatePort, ICompressionPort, IDailyReportRepository, IHttpPort, IJournalRepository, IMTLSAdapter, IMTLSAdapterFactory, IMTLSPort, IMerchantRepository, INetworkMonitor, INetworkPort, INotificationRepository, IPemRepository, IPointOfSaleRepository, IReceiptRepository, ISecureStorage, ISecureStoragePort, IStorage, IStoragePort, ISupplierRepository, ITelemetryRepository, ITokenStoragePort, IUserProvider, JWTPayload, Journal, JournalApiOutput, JournalCloseInput, JournalCloseInputType, JournalStatus, JournalsParams, LdJsonPage, LotteryApiOutput, LotterySecretRequestApiOutput, LotterySecretRequestInfo, LotteryTelemetry, MTLSConnectionConfig, MTLSRequestConfig, MTLSResponse, ManagedServices, Merchant, MerchantApiOutput, MerchantCreateApiInput, MerchantCreateInput, MerchantCreateInputType, MerchantUpdateApiInput, MerchantUpdateInput, MerchantUpdateInputType, MerchantsParams, MessageApiOutput, MessageInfo, NetworkInfo, NetworkStatus, Notification, NotificationApiOutput, NotificationCode, NotificationCommunicationRestored, NotificationCommunicationRestoredApiOutput, NotificationEvents, NotificationLevel, NotificationListParams, NotificationListResponseSchemaType, NotificationMf2Unreachable, NotificationMf2UnreachableApiOutput, NotificationPageApiOutput, NotificationPayloadBlockAt, NotificationSchemaType, NotificationScope, NotificationServiceConfig, NotificationSource, NotificationStatusOffline, NotificationStatusOfflineApiOutput, NotificationStatusOnline, NotificationStatusOnlineApiOutput, NotificationSyncState, NotificationType, OperationStatus, OperationType, PEMStatus, PEMStatusOfflineRequest, PEMStatusOfflineRequestApiInput, PEMStatusOfflineRequestType, PEMStatusType, Page, PemCertificates, PemCertificatesApiOutput, PemCreateApiInput, PemCreateApiOutput, PemCreateInput, PemCreateInputType, PemCreateOutput, PemData, PemDataType, PendingReceipts, PendingReceiptsApiOutput, Platform, PlatformAdapters, PlatformInfo, PointOfSale, PointOfSaleApiOutput, PointOfSaleDetailed, PointOfSaleDetailedApiOutput, PointOfSaleListParams, PointOfSaleMf2, PointOfSaleMf2ApiOutput, PointOfSaleType, QueueConfig, QueueEvents, QueueStats, QueuedOperation, Receipt, ReceiptApiInput, ReceiptApiOutput, ReceiptDetails, ReceiptDetailsApiOutput, ReceiptInput, ReceiptInputType, ReceiptItem, ReceiptItemApiInput, ReceiptItemType, ReceiptListParams, ReceiptProofType, ReceiptProofTypeType, ReceiptReturnApiInput, ReceiptReturnInput, ReceiptReturnItem, ReceiptReturnItemType, ReceiptReturnOrVoidViaPEMInputType, ReceiptReturnOrVoidWithProofInputType, ReceiptReturnType, ReceiptSortOrder, ReceiptStatus, ReceiptType, ResourceType, ReturnViaDifferentDeviceApiInput, ReturnViaDifferentDeviceInput, ReturnWithProofApiInput, ReturnWithProofInput, ReturnableReceiptItem, ReturnableReceiptItemApiOutput, SDKConfig, SDKEvents, SDKFactoryConfig, SDKManagerConfig, SDKManagerEvents, SDKServices, SoftwareVersionStatus, StoredCertificate, Supplier, SupplierApiOutput, SupplierCreateApiInput, SupplierCreateInput, SupplierCreateInputType, SupplierUpdateApiInput, SupplierUpdateInput, SupplierUpdateInputType, SuppliersParams, SyncResult, SyncStatus, Telemetry, TelemetryApiOutput, TelemetryMerchant, TelemetryMerchantApiOutput, TelemetryOperations, TelemetrySchemaType, TelemetryServiceConfig, TelemetrySoftware, TelemetrySoftwareApiOutput, TelemetrySoftwareVersion, TelemetrySoftwareVersionApiOutput, TelemetryState, TelemetrySupplier, TelemetrySupplierApiOutput, TransmissionAttemptApiOutput, TransmissionAttemptInfo, User$1 as User, UserRole, UserRoles, ValidationResult, VatRateCode, VatRateCodeType, VoidReceiptApiInput, VoidReceiptInput, VoidReceiptInputType, VoidViaDifferentDeviceApiInput, VoidViaDifferentDeviceInput, VoidWithProofApiInput, VoidWithProofInput, WarningState };
|
|
1811
|
+
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 };
|
|
1812
|
+
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, 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 };
|