@altazion/commerce-sdk-core 1.0.0
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/assets/cache.worker-BX4nA-m-.js +131 -0
- package/dist/assets/cache.worker-BX4nA-m-.js.map +1 -0
- package/dist/index.cjs +861 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +998 -0
- package/dist/index.iife.js +864 -0
- package/dist/index.iife.js.map +1 -0
- package/dist/index.js +860 -0
- package/dist/index.js.map +1 -0
- package/package.json +31 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,998 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Erreur générée par l'API Altazion Commerce (HTTP 4xx / 5xx).
|
|
3
|
+
*/
|
|
4
|
+
export declare class AltazionApiError extends Error {
|
|
5
|
+
readonly status: number;
|
|
6
|
+
readonly problem: ProblemDetails;
|
|
7
|
+
constructor(status: number, problem: ProblemDetails);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/** Produit associé avec ses détails — même structure que WebProduct */
|
|
11
|
+
export declare type AssociatedProductWithDetails = WebProduct;
|
|
12
|
+
|
|
13
|
+
/** Niveau de disponibilité : 0=Disponible, 1=Limité, 2=Indisponible */
|
|
14
|
+
export declare type AvailabilityLevel = 0 | 1 | 2;
|
|
15
|
+
|
|
16
|
+
/** Source de la disponibilité */
|
|
17
|
+
export declare type AvailabilitySource = 'DB' | 'DO' | 'US';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Erreur liée à une opération sur le cache (IndexedDB, SharedWorker).
|
|
21
|
+
*/
|
|
22
|
+
export declare class CacheError extends Error {
|
|
23
|
+
readonly cause: unknown;
|
|
24
|
+
constructor(message: string, cause?: unknown);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
declare class CacheStrategy {
|
|
28
|
+
private readonly bridge;
|
|
29
|
+
private readonly http;
|
|
30
|
+
constructor(bridge: WorkerBridge, http: CommerceHttpAdapter);
|
|
31
|
+
/**
|
|
32
|
+
* Exécute la requête selon la stratégie choisie.
|
|
33
|
+
*
|
|
34
|
+
* @param key Clé de cache (généralement le path + params)
|
|
35
|
+
* @param fetcher Fonction qui effectue la requête HTTP
|
|
36
|
+
* @param strategy Stratégie à appliquer
|
|
37
|
+
* @param ttlMs TTL du cache (override la valeur par défaut)
|
|
38
|
+
*/
|
|
39
|
+
execute<T>(key: string, fetcher: () => Promise<T>, strategy: CacheStrategyName, ttlMs?: number): Promise<T>;
|
|
40
|
+
private networkFirst;
|
|
41
|
+
private cacheFirst;
|
|
42
|
+
private staleWhileRevalidate;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Stratégies de cache disponibles pour les requêtes HTTP.
|
|
47
|
+
*/
|
|
48
|
+
export declare type CacheStrategyName = 'network-only' | 'network-first' | 'cache-first' | 'stale-while-revalidate';
|
|
49
|
+
|
|
50
|
+
export declare interface Cart {
|
|
51
|
+
guid: string;
|
|
52
|
+
orderNumber?: string | null;
|
|
53
|
+
expectedDestinationPostalCode?: string | null;
|
|
54
|
+
expectedDestinationCountryCode?: string | null;
|
|
55
|
+
state: CartStatus;
|
|
56
|
+
customerGuid?: string | null;
|
|
57
|
+
billingAddress: CustomerAddress;
|
|
58
|
+
shippingAddresses?: CustomerAddress[] | null;
|
|
59
|
+
pickupPointAddresses?: PickupPointAddressDetails[] | null;
|
|
60
|
+
customerName?: string | null;
|
|
61
|
+
isCustomerLoggedIn: boolean;
|
|
62
|
+
content?: CartContent[] | null;
|
|
63
|
+
activeBenefitCode?: string | null;
|
|
64
|
+
totalAmountWithTax: number;
|
|
65
|
+
totalAmountWithoutTax: number;
|
|
66
|
+
totalQuantity: number;
|
|
67
|
+
createdDate: string;
|
|
68
|
+
lastModifiedDate: string;
|
|
69
|
+
associatedDeviceGuid?: string | null;
|
|
70
|
+
tags?: string[] | null;
|
|
71
|
+
payments?: CartPayment[] | null;
|
|
72
|
+
pickupPersonName?: string | null;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export declare interface CartBenefit {
|
|
76
|
+
offerGuid?: string | null;
|
|
77
|
+
couponGuid?: string | null;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export declare interface CartBundleComposition {
|
|
81
|
+
label?: string | null;
|
|
82
|
+
price: number;
|
|
83
|
+
image?: string | null;
|
|
84
|
+
parentGuid: string;
|
|
85
|
+
productGuids?: string[] | null;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** Groupe de lignes du panier (par mode de livraison / prestataire) */
|
|
89
|
+
export declare interface CartContent {
|
|
90
|
+
lines?: CartLine[] | null;
|
|
91
|
+
contentType: CartContentType;
|
|
92
|
+
/** Ligne de frais de livraison associée */
|
|
93
|
+
shippingFees: CartLine;
|
|
94
|
+
benefitsLines?: CartLine[] | null;
|
|
95
|
+
associatedBenefits?: CartBenefit[] | null;
|
|
96
|
+
isValidatable: boolean;
|
|
97
|
+
requiresShippingFees: boolean;
|
|
98
|
+
cartErrors?: CartError[] | null;
|
|
99
|
+
incentiveMessage?: string | null;
|
|
100
|
+
deliveryModeGuid?: string | null;
|
|
101
|
+
deliveryModeIsPickupPoint?: boolean | null;
|
|
102
|
+
shippingAddressGuid: string;
|
|
103
|
+
pickupPointAddressGuid?: string | null;
|
|
104
|
+
totalAmountWithTax: number;
|
|
105
|
+
totalAmountWithTaxFormatted?: string | null;
|
|
106
|
+
preferredProcess?: string | null;
|
|
107
|
+
groupInfo: CartGroup;
|
|
108
|
+
totalPromotionDiscount: number;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/** Type de contenu d'un groupe de lignes du panier */
|
|
112
|
+
export declare type CartContentType = 'MainLines' | 'ShipFromStoreLines' | 'StorePickupLines' | 'VendorLines' | 'DropShipLines';
|
|
113
|
+
|
|
114
|
+
export declare interface CartError {
|
|
115
|
+
errorCode: number;
|
|
116
|
+
severity: CartErrorSeverity;
|
|
117
|
+
message?: string | null;
|
|
118
|
+
isBlocking: boolean;
|
|
119
|
+
correctionMessage?: string | null;
|
|
120
|
+
correctionUrl?: string | null;
|
|
121
|
+
isAutomaticRedirection: boolean;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/** Sévérité d'erreur : 0=Info, 1=Erreur */
|
|
125
|
+
export declare type CartErrorSeverity = 0 | 1;
|
|
126
|
+
|
|
127
|
+
export declare interface CartGroup {
|
|
128
|
+
code?: string | null;
|
|
129
|
+
label?: string | null;
|
|
130
|
+
details?: string | null;
|
|
131
|
+
associatedProcessType?: string | null;
|
|
132
|
+
isExternal: boolean;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export declare interface CartLine {
|
|
136
|
+
itemType: ProductMetaType;
|
|
137
|
+
id: string;
|
|
138
|
+
parentLineId?: string | null;
|
|
139
|
+
label?: string | null;
|
|
140
|
+
reference?: string | null;
|
|
141
|
+
productGuid: string;
|
|
142
|
+
quantity: number;
|
|
143
|
+
originalNonDiscountedUnitPriceExclTax: number;
|
|
144
|
+
originalNonDiscountedUnitPriceInclTax: number;
|
|
145
|
+
originalUnitPriceExclTax: number;
|
|
146
|
+
originalUnitPriceInclTax: number;
|
|
147
|
+
finalUnitPriceInclTax: number;
|
|
148
|
+
finalUnitPriceExclTax: number;
|
|
149
|
+
unitDiscountExclTax: number;
|
|
150
|
+
unitDiscountInclTax: number;
|
|
151
|
+
imageUrl?: string | null;
|
|
152
|
+
intermediateImageUrl?: string | null;
|
|
153
|
+
isUpdated: boolean;
|
|
154
|
+
brand?: string | null;
|
|
155
|
+
storeGuid?: string | null;
|
|
156
|
+
isNotEditable: boolean;
|
|
157
|
+
distinguishingAttributes?: string[] | null;
|
|
158
|
+
customData?: string[] | null;
|
|
159
|
+
ancillaryFeesDetails?: string[] | null;
|
|
160
|
+
isAvailableInStore?: boolean | null;
|
|
161
|
+
quantityAvailableInStore?: number | null;
|
|
162
|
+
isAvailableInCentral?: boolean | null;
|
|
163
|
+
quantityAvailableInCentral?: number | null;
|
|
164
|
+
associatedItemBundles?: CartBundleComposition[] | null;
|
|
165
|
+
fullfilmentInfo: FullfilmentCartInfo;
|
|
166
|
+
appliedDiscounts?: CartLineDiscount[] | null;
|
|
167
|
+
dimensions: ProductDimensionsBase;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export declare interface CartLineDiscount {
|
|
171
|
+
offerGuid?: string | null;
|
|
172
|
+
offerCode?: string | null;
|
|
173
|
+
quantityOffered?: number | null;
|
|
174
|
+
unitDiscountExclTax: number;
|
|
175
|
+
unitDiscountInclTax: number;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
declare class CartModule {
|
|
179
|
+
private readonly http;
|
|
180
|
+
private readonly cache;
|
|
181
|
+
private readonly queue;
|
|
182
|
+
private readonly connectivity;
|
|
183
|
+
constructor(http: CommerceHttpAdapter, cache: CacheStrategy, queue: OfflineQueue, connectivity: ConnectivityManager);
|
|
184
|
+
/** Récupère le panier en cours */
|
|
185
|
+
getCart(): Promise<Cart>;
|
|
186
|
+
/** Récupère le statut de validation du panier */
|
|
187
|
+
getValidationStatus(): Promise<CartValidationStatus>;
|
|
188
|
+
/** Ajoute un article au panier */
|
|
189
|
+
addItem(reference: string, quantity: number, options?: Record<string, unknown>): Promise<Cart>;
|
|
190
|
+
/** Met à jour la quantité d'une ligne */
|
|
191
|
+
updateItem(lineId: string, quantity: number): Promise<Cart>;
|
|
192
|
+
/** Supprime une ligne du panier */
|
|
193
|
+
removeItem(lineId: string): Promise<Cart>;
|
|
194
|
+
/** Applique un coupon */
|
|
195
|
+
applyCoupon(code: string): Promise<Cart>;
|
|
196
|
+
/** Retire un coupon */
|
|
197
|
+
removeCoupon(code: string): Promise<Cart>;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export declare interface CartPayment {
|
|
201
|
+
paymentGuid: string;
|
|
202
|
+
amount: number;
|
|
203
|
+
paymentMethodGuid: string;
|
|
204
|
+
isCompleted: boolean;
|
|
205
|
+
pspReference?: string | null;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/** État du panier : 0=Actif, 1=Complété, 2=En préparation, 127=Verrouillé */
|
|
209
|
+
export declare type CartStatus = 0 | 1 | 2 | 127;
|
|
210
|
+
|
|
211
|
+
export declare interface CartValidationStatus {
|
|
212
|
+
canBeOrdered: boolean;
|
|
213
|
+
canBeCompleted: boolean;
|
|
214
|
+
unavailableProducts?: InvalidProduct[] | null;
|
|
215
|
+
validationErrors?: CartError[] | null;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
declare class CatalogModule {
|
|
219
|
+
private readonly http;
|
|
220
|
+
private readonly cache;
|
|
221
|
+
constructor(http: CommerceHttpAdapter, cache: CacheStrategy);
|
|
222
|
+
/** Récupère le détail d'un produit par sa référence */
|
|
223
|
+
getProduct(reference: string): Promise<ProductDetails>;
|
|
224
|
+
/** Récupère une liste de produits par leurs références */
|
|
225
|
+
getProducts(references: string[]): Promise<WebProduct[]>;
|
|
226
|
+
/** Récupère les produits d'une catégorie */
|
|
227
|
+
getCategory(categoryCode: string, pageIndex?: number, pageSize?: number): Promise<SearchResult>;
|
|
228
|
+
/** Effectue une recherche full-text */
|
|
229
|
+
search(request: SearchRequest): Promise<SearchResult>;
|
|
230
|
+
/** Récupère les suggestions de recherche (autocomplete) */
|
|
231
|
+
suggest(query: string): Promise<string[]>;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Point d'entrée principal du SDK Altazion Commerce.
|
|
236
|
+
*
|
|
237
|
+
* Usage :
|
|
238
|
+
* ```ts
|
|
239
|
+
* const client = new CommerceClient({ baseUrl: 'https://api.monsite.com', siteUrl: window.location.href })
|
|
240
|
+
* await client.initialize()
|
|
241
|
+
*
|
|
242
|
+
* const cart = await client.cart.getCart()
|
|
243
|
+
* ```
|
|
244
|
+
*/
|
|
245
|
+
export declare class CommerceClient {
|
|
246
|
+
readonly context: CommerceContext;
|
|
247
|
+
readonly connectivity: ConnectivityManager;
|
|
248
|
+
readonly session: SessionModule;
|
|
249
|
+
readonly cart: CartModule;
|
|
250
|
+
readonly catalog: CatalogModule;
|
|
251
|
+
readonly shipping: ShippingModule;
|
|
252
|
+
readonly marketing: MarketingModule;
|
|
253
|
+
readonly stores: StoresModule;
|
|
254
|
+
private readonly http;
|
|
255
|
+
private readonly workerBridge;
|
|
256
|
+
private readonly cacheStrategy;
|
|
257
|
+
private readonly offlineQueue;
|
|
258
|
+
private readonly sessionManager;
|
|
259
|
+
private unsubscribeOnline;
|
|
260
|
+
constructor(options: CommerceContextOptions);
|
|
261
|
+
/**
|
|
262
|
+
* Initialise le SDK :
|
|
263
|
+
* - Crée la session si nécessaire (mode browser uniquement)
|
|
264
|
+
* - Abonne le flush automatique de la file hors-ligne au retour en ligne
|
|
265
|
+
*/
|
|
266
|
+
initialize(): Promise<SessionInfo | null>;
|
|
267
|
+
/**
|
|
268
|
+
* Retourne vrai si le SDK est hors-ligne.
|
|
269
|
+
*/
|
|
270
|
+
get isOffline(): boolean;
|
|
271
|
+
/**
|
|
272
|
+
* Retourne le nombre d'opérations en attente dans la file hors-ligne.
|
|
273
|
+
*/
|
|
274
|
+
get pendingOperationsCount(): Promise<number>;
|
|
275
|
+
/**
|
|
276
|
+
* Abonne un listener aux événements de la file hors-ligne.
|
|
277
|
+
* Retourne une fonction de désabonnement.
|
|
278
|
+
*/
|
|
279
|
+
onQueueEvent(listener: Parameters<OfflineQueue['subscribe']>[0]): () => void;
|
|
280
|
+
/**
|
|
281
|
+
* Force le vidage du cache.
|
|
282
|
+
*/
|
|
283
|
+
clearCache(): Promise<void>;
|
|
284
|
+
/**
|
|
285
|
+
* Libère les ressources (listeners, worker).
|
|
286
|
+
*/
|
|
287
|
+
dispose(): void;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* Contexte partagé du SDK, instancié une seule fois et transmis
|
|
292
|
+
* à tous les sous-systèmes (HttpAdapter, SessionManager, modules…).
|
|
293
|
+
*/
|
|
294
|
+
export declare class CommerceContext {
|
|
295
|
+
readonly baseUrl: string;
|
|
296
|
+
readonly siteUrl: string | undefined;
|
|
297
|
+
readonly sitePk: number | undefined;
|
|
298
|
+
readonly rjsId: number | undefined;
|
|
299
|
+
readonly locale: string;
|
|
300
|
+
readonly currency: string;
|
|
301
|
+
readonly mode: CommerceMode;
|
|
302
|
+
constructor(options: CommerceContextOptions);
|
|
303
|
+
private static detectMode;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
export declare interface CommerceContextOptions {
|
|
307
|
+
/** URL de base de l'API (ex. : "https://api.monsite.com") */
|
|
308
|
+
baseUrl: string;
|
|
309
|
+
/** Identifiant ou URL du site web pour la création de session (mode browser) */
|
|
310
|
+
siteUrl?: string;
|
|
311
|
+
/**
|
|
312
|
+
* Clé primaire du site (alternative à siteUrl).
|
|
313
|
+
* Requiert aussi rjsId.
|
|
314
|
+
*/
|
|
315
|
+
sitePk?: number;
|
|
316
|
+
/** Identifiant du tenant RJS (nécessaire avec sitePk) */
|
|
317
|
+
rjsId?: number;
|
|
318
|
+
/** Locale par défaut (ex. : "fr-FR") */
|
|
319
|
+
locale?: string;
|
|
320
|
+
/** Devise par défaut (ex. : "EUR") */
|
|
321
|
+
currency?: string;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* Adaptateur HTTP basé sur fetch natif.
|
|
326
|
+
*
|
|
327
|
+
* Responsabilités :
|
|
328
|
+
* - Construction des URLs à partir du baseUrl du contexte
|
|
329
|
+
* - Ajout des headers standard (Content-Type, Accept, locale)
|
|
330
|
+
* - credentials: 'include' pour la transmission automatique des cookies (modes browser et kiosk)
|
|
331
|
+
* - Parse des réponses ProblemDetails en AltazionApiError
|
|
332
|
+
* - Retry limité sur les erreurs réseau (TypeError), jamais sur les 4xx/5xx
|
|
333
|
+
*/
|
|
334
|
+
declare class CommerceHttpAdapter {
|
|
335
|
+
private readonly context;
|
|
336
|
+
constructor(context: CommerceContext);
|
|
337
|
+
request<T>(path: string, options?: RequestOptions): Promise<T>;
|
|
338
|
+
private handleResponse;
|
|
339
|
+
/** Effectue un GET et retourne T */
|
|
340
|
+
get<T>(path: string, headers?: Record<string, string>): Promise<T>;
|
|
341
|
+
/** Effectue un POST avec un body JSON et retourne T */
|
|
342
|
+
post<T>(path: string, body?: unknown, headers?: Record<string, string>): Promise<T>;
|
|
343
|
+
/** Effectue un PUT avec un body JSON et retourne T */
|
|
344
|
+
put<T>(path: string, body?: unknown, headers?: Record<string, string>): Promise<T>;
|
|
345
|
+
/** Effectue un PATCH avec un body JSON et retourne T */
|
|
346
|
+
patch<T>(path: string, body?: unknown, headers?: Record<string, string>): Promise<T>;
|
|
347
|
+
/** Effectue un DELETE et retourne T */
|
|
348
|
+
delete<T>(path: string, headers?: Record<string, string>): Promise<T>;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
/**
|
|
352
|
+
* Mode d'exécution du SDK.
|
|
353
|
+
* - `browser` : navigateur classique — le SDK gère la création de session et le cookie.
|
|
354
|
+
* - `kiosk` : borne avec "Altazion Device Shell" — le browser embarqué gère les cookies.
|
|
355
|
+
*/
|
|
356
|
+
export declare type CommerceMode = 'browser' | 'kiosk';
|
|
357
|
+
|
|
358
|
+
export declare type ConnectivityListener = (status: ConnectivityStatus) => void;
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* Surveille l'état de la connexion réseau.
|
|
362
|
+
*
|
|
363
|
+
* - Utilise navigator.onLine comme valeur initiale
|
|
364
|
+
* - Écoute les événements window 'online' / 'offline'
|
|
365
|
+
* - Permet d'abonner des listeners (pattern observable léger)
|
|
366
|
+
*/
|
|
367
|
+
export declare class ConnectivityManager {
|
|
368
|
+
private status;
|
|
369
|
+
private readonly listeners;
|
|
370
|
+
constructor();
|
|
371
|
+
get isOnline(): boolean;
|
|
372
|
+
get isOffline(): boolean;
|
|
373
|
+
/**
|
|
374
|
+
* Abonne un listener aux changements de connectivité.
|
|
375
|
+
* Retourne une fonction de désabonnement.
|
|
376
|
+
*/
|
|
377
|
+
subscribe(listener: ConnectivityListener): () => void;
|
|
378
|
+
/** Libère les event listeners sur window. */
|
|
379
|
+
dispose(): void;
|
|
380
|
+
private readOnlineStatus;
|
|
381
|
+
private readonly handleOnline;
|
|
382
|
+
private readonly handleOffline;
|
|
383
|
+
private emit;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
export declare type ConnectivityStatus = 'online' | 'offline';
|
|
387
|
+
|
|
388
|
+
/** Adresse client stockée (table gestcom_clients_adresses) */
|
|
389
|
+
export declare interface CustomerAddress {
|
|
390
|
+
addressGuid: string;
|
|
391
|
+
customerGuid: string;
|
|
392
|
+
isActive: boolean;
|
|
393
|
+
title?: string | null;
|
|
394
|
+
company?: string | null;
|
|
395
|
+
fullName?: string | null;
|
|
396
|
+
streetAddress?: string | null;
|
|
397
|
+
postalCode?: string | null;
|
|
398
|
+
city?: string | null;
|
|
399
|
+
countryCode?: string | null;
|
|
400
|
+
phone?: string | null;
|
|
401
|
+
email?: string | null;
|
|
402
|
+
isBillingAddress: boolean;
|
|
403
|
+
siteId: number;
|
|
404
|
+
isDefault: boolean;
|
|
405
|
+
region?: string | null;
|
|
406
|
+
isTemporary: boolean;
|
|
407
|
+
mobile?: string | null;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
/** Jour de la semaine (convention .NET) : 0=Dimanche … 6=Samedi */
|
|
411
|
+
export declare type DayOfWeek = 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
412
|
+
|
|
413
|
+
/** Type de service de livraison : 0=Standard, 1=Express, 2=SameDayDelivery */
|
|
414
|
+
export declare type DeliveryServiceType = 0 | 1 | 2;
|
|
415
|
+
|
|
416
|
+
export declare interface FullfilmentCartInfo {
|
|
417
|
+
fullfilmentKind?: string | null;
|
|
418
|
+
fullfilmentCode?: string | null;
|
|
419
|
+
fullfilmentPartnerId?: string | null;
|
|
420
|
+
fullfilmentPartnerName?: string | null;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
/** Produit indisponible dans le panier */
|
|
424
|
+
export declare interface InvalidProduct extends WebProduct {
|
|
425
|
+
availableSubstitutions?: WebProduct[] | null;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
export declare interface MarketingItem {
|
|
429
|
+
linkItem?: MarketingLinkItem;
|
|
430
|
+
xmlData?: unknown;
|
|
431
|
+
htmlData?: unknown;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
export declare interface MarketingLinkItem {
|
|
435
|
+
guid: string;
|
|
436
|
+
stepGuid: string;
|
|
437
|
+
mimeType?: string | null;
|
|
438
|
+
imageUrl?: string | null;
|
|
439
|
+
targetSelectionGuid?: string | null;
|
|
440
|
+
targetUrl?: string | null;
|
|
441
|
+
keyword?: string | null;
|
|
442
|
+
width?: number | null;
|
|
443
|
+
height?: number | null;
|
|
444
|
+
altData?: string | null;
|
|
445
|
+
htmlContent?: string | null;
|
|
446
|
+
kind?: string | null;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
declare class MarketingModule {
|
|
450
|
+
private readonly http;
|
|
451
|
+
private readonly cache;
|
|
452
|
+
constructor(http: CommerceHttpAdapter, cache: CacheStrategy);
|
|
453
|
+
/** Récupère un item marketing par son code */
|
|
454
|
+
getItem(code: string): Promise<MarketingItem>;
|
|
455
|
+
/** Récupère plusieurs items marketing par leurs codes */
|
|
456
|
+
getItems(codes: string[]): Promise<MarketingItem[]>;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
/**
|
|
460
|
+
* Erreur levée lorsque le SDK est hors-ligne et ne peut pas
|
|
461
|
+
* satisfaire la requête depuis le cache.
|
|
462
|
+
*/
|
|
463
|
+
export declare class OfflineError extends Error {
|
|
464
|
+
constructor(message?: string);
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
/**
|
|
468
|
+
* File d'attente persistante (IndexedDB) pour les mutations effectuées hors-ligne.
|
|
469
|
+
*
|
|
470
|
+
* Flux :
|
|
471
|
+
* 1. `enqueue(operation)` — stocke l'opération en IndexedDB
|
|
472
|
+
* 2. Au retour en ligne, `flush()` rejoue les opérations dans l'ordre d'enfilage
|
|
473
|
+
* 3. En cas d'erreur 4xx (conflit) : émet un événement `conflict` et ne retire PAS l'opération
|
|
474
|
+
* 4. En cas de succès : retire l'opération de la file
|
|
475
|
+
*/
|
|
476
|
+
declare class OfflineQueue {
|
|
477
|
+
private db;
|
|
478
|
+
private readonly listeners;
|
|
479
|
+
private counter;
|
|
480
|
+
/** Abonne un listener aux événements de file. Retourne une fonction de désabonnement. */
|
|
481
|
+
subscribe(listener: QueueEventListener): () => void;
|
|
482
|
+
get pendingCount(): Promise<number>;
|
|
483
|
+
enqueue(method: QueuedOperation['method'], path: string, body?: unknown, headers?: Record<string, string>): Promise<QueuedOperation>;
|
|
484
|
+
/**
|
|
485
|
+
* Rejoue toutes les opérations en attente dans l'ordre d'enfilage.
|
|
486
|
+
* S'arrête sur un conflit (4xx) et émet un événement `conflict`.
|
|
487
|
+
*/
|
|
488
|
+
flush(http: CommerceHttpAdapter): Promise<void>;
|
|
489
|
+
private emit;
|
|
490
|
+
private openDb;
|
|
491
|
+
private put;
|
|
492
|
+
private remove;
|
|
493
|
+
private getAll;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
/** Point de livraison (point relais, locker, consigne) */
|
|
497
|
+
export declare interface PickupPoint {
|
|
498
|
+
id: string;
|
|
499
|
+
carrierId: number;
|
|
500
|
+
name?: string | null;
|
|
501
|
+
address?: string | null;
|
|
502
|
+
postalCode?: string | null;
|
|
503
|
+
city?: string | null;
|
|
504
|
+
countryCode?: string | null;
|
|
505
|
+
platformLevel1?: string | null;
|
|
506
|
+
platformLevel2?: string | null;
|
|
507
|
+
platformLevel3?: string | null;
|
|
508
|
+
platformLevel4?: string | null;
|
|
509
|
+
platformLevel5?: string | null;
|
|
510
|
+
isPrimary: boolean;
|
|
511
|
+
externalCode?: string | null;
|
|
512
|
+
startDate: string;
|
|
513
|
+
endDate: string;
|
|
514
|
+
accessIndications?: string | null;
|
|
515
|
+
availableServices?: string | null;
|
|
516
|
+
longitude?: number | null;
|
|
517
|
+
latitude?: number | null;
|
|
518
|
+
phoneNumber?: string | null;
|
|
519
|
+
isActive: boolean;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
/** Point de livraison avec ses horaires d'ouverture */
|
|
523
|
+
export declare interface PickupPointAddressDetails extends PickupPoint {
|
|
524
|
+
horaires?: unknown[] | null;
|
|
525
|
+
moreInfo?: string | null;
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
/**
|
|
529
|
+
* Représentation d'une réponse d'erreur ProblemDetails (RFC 9457)
|
|
530
|
+
* telle que renvoyée par GlobalExceptionFilter.cs
|
|
531
|
+
*/
|
|
532
|
+
export declare interface ProblemDetails {
|
|
533
|
+
type?: string;
|
|
534
|
+
title?: string;
|
|
535
|
+
status?: number;
|
|
536
|
+
detail?: string;
|
|
537
|
+
instance?: string;
|
|
538
|
+
[key: string]: unknown;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
export declare interface ProductAvailabilitySummary {
|
|
542
|
+
notAvailableUntil?: string | null;
|
|
543
|
+
notAvailableAfter?: string | null;
|
|
544
|
+
statusCode?: string | null;
|
|
545
|
+
status: AvailabilityLevel;
|
|
546
|
+
web: ProductWebAvailability;
|
|
547
|
+
local: ProductStoreAvailability;
|
|
548
|
+
stores?: Record<string, ProductStoreAvailability> | null;
|
|
549
|
+
source: AvailabilitySource;
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
export declare interface ProductCustomAttributeWithDefinition {
|
|
553
|
+
enumeratedValue?: number | null;
|
|
554
|
+
attributeGuid: string;
|
|
555
|
+
decimalValue?: number | null;
|
|
556
|
+
booleanValue?: boolean | null;
|
|
557
|
+
textValue?: string | null;
|
|
558
|
+
dateValue?: string | null;
|
|
559
|
+
attributeLabel?: string | null;
|
|
560
|
+
isPublic: boolean;
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
export declare interface ProductDetails extends WebProduct {
|
|
564
|
+
dimensions: ProductDimensionsBase;
|
|
565
|
+
taxes: ProductTaxBase[];
|
|
566
|
+
parent: WebProduct;
|
|
567
|
+
availability: ProductAvailabilitySummary;
|
|
568
|
+
instances: ProductInstance[];
|
|
569
|
+
documents: string[];
|
|
570
|
+
videos: string[];
|
|
571
|
+
moreImages: ProductImage[];
|
|
572
|
+
labels: string[];
|
|
573
|
+
customAttributes: ProductCustomAttributeWithDefinition[];
|
|
574
|
+
logosUrls: string[];
|
|
575
|
+
associatedProducts: Record<string, AssociatedProductWithDetails[]>;
|
|
576
|
+
suggestionsAuto: WebProduct[];
|
|
577
|
+
reviews: ProductReview[];
|
|
578
|
+
url: string;
|
|
579
|
+
fulfillmentConditions: ProductLogisticsInfoBase;
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
export declare interface ProductDimensionsBase {
|
|
583
|
+
netHeight?: number | null;
|
|
584
|
+
netWidth?: number | null;
|
|
585
|
+
netLength?: number | null;
|
|
586
|
+
netWeight?: number | null;
|
|
587
|
+
netVolume?: number | null;
|
|
588
|
+
grossHeight: number;
|
|
589
|
+
grossWidth: number;
|
|
590
|
+
grossLength: number;
|
|
591
|
+
grossWeight: number;
|
|
592
|
+
grossVolume: number;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
export declare interface ProductImage {
|
|
596
|
+
urlSmall?: string | null;
|
|
597
|
+
urlBig?: string | null;
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
/** Instance de produit (variation) — même structure que WebProduct */
|
|
601
|
+
export declare type ProductInstance = WebProduct;
|
|
602
|
+
|
|
603
|
+
declare interface ProductLogisticsInfoBase {
|
|
604
|
+
fulfillmentTypeCode?: string | null;
|
|
605
|
+
fulFillmentMandatoryZoneGuid?: string | null;
|
|
606
|
+
isHighDemand: boolean;
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
/** Type de méta-produit (0-8) */
|
|
610
|
+
export declare type ProductMetaType = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8;
|
|
611
|
+
|
|
612
|
+
export declare interface ProductReview {
|
|
613
|
+
guid: string;
|
|
614
|
+
productGuid: string;
|
|
615
|
+
reviewerName?: string | null;
|
|
616
|
+
message?: string | null;
|
|
617
|
+
customerGuid?: string | null;
|
|
618
|
+
email?: string | null;
|
|
619
|
+
hasBeenValidated: boolean;
|
|
620
|
+
date: string;
|
|
621
|
+
note: number;
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
export declare interface ProductStoreAvailability {
|
|
625
|
+
isAvailable: boolean;
|
|
626
|
+
quantity?: number | null;
|
|
627
|
+
distance?: number | null;
|
|
628
|
+
source: AvailabilitySource;
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
declare interface ProductTaxBase {
|
|
632
|
+
guid: string;
|
|
633
|
+
taxeDefinitionGuid: string;
|
|
634
|
+
amount: number;
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
export declare interface ProductWebAvailability {
|
|
638
|
+
isAvailable: boolean;
|
|
639
|
+
isAvailableFromWarehouse: boolean;
|
|
640
|
+
isAvailableFromOther: boolean;
|
|
641
|
+
warehouseQuantity?: number | null;
|
|
642
|
+
otherQuantity?: number | null;
|
|
643
|
+
source: AvailabilitySource;
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
/**
|
|
647
|
+
* Représente une opération en attente dans la file hors-ligne.
|
|
648
|
+
*/
|
|
649
|
+
export declare interface QueuedOperation {
|
|
650
|
+
/** Identifiant unique de l'opération */
|
|
651
|
+
id: string;
|
|
652
|
+
/** Timestamp d'enfilage */
|
|
653
|
+
enqueuedAt: number;
|
|
654
|
+
/** Méthode HTTP */
|
|
655
|
+
method: 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
656
|
+
/** Path de la requête (sans baseUrl) */
|
|
657
|
+
path: string;
|
|
658
|
+
/** Corps de la requête sérialisé */
|
|
659
|
+
body: unknown;
|
|
660
|
+
/** Headers supplémentaires */
|
|
661
|
+
headers?: Record<string, string>;
|
|
662
|
+
/** Nombre de tentatives déjà effectuées */
|
|
663
|
+
attempts: number;
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
export declare interface QueueEvent {
|
|
667
|
+
type: QueueEventType;
|
|
668
|
+
operation?: QueuedOperation;
|
|
669
|
+
error?: QueueFlushError;
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
export declare type QueueEventListener = (event: QueueEvent) => void;
|
|
673
|
+
|
|
674
|
+
export declare type QueueEventType = 'enqueued' | 'flushed' | 'conflict' | 'emptied';
|
|
675
|
+
|
|
676
|
+
/**
|
|
677
|
+
* Erreur levée lors du rejeu de l'OfflineQueue (conflit serveur).
|
|
678
|
+
*/
|
|
679
|
+
export declare class QueueFlushError extends Error {
|
|
680
|
+
readonly failedOperationId: string;
|
|
681
|
+
readonly apiError: AltazionApiError;
|
|
682
|
+
constructor(operationId: string, apiError: AltazionApiError);
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
declare interface RequestOptions {
|
|
686
|
+
method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
687
|
+
body?: unknown;
|
|
688
|
+
headers?: Record<string, string>;
|
|
689
|
+
/** Nombre maximum de tentatives réseau (uniquement sur erreurs réseau, jamais sur 4xx) */
|
|
690
|
+
maxRetries?: number;
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
export declare interface SearchFacet {
|
|
694
|
+
/** Nom de la facette */
|
|
695
|
+
n?: string | null;
|
|
696
|
+
/** Valeurs de la facette */
|
|
697
|
+
i?: SearchFacetValue[] | null;
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
export declare interface SearchFacetValue {
|
|
701
|
+
/** Valeur */
|
|
702
|
+
v?: string | null;
|
|
703
|
+
/** Libellé */
|
|
704
|
+
n?: string | null;
|
|
705
|
+
/** Nombre de résultats */
|
|
706
|
+
c: number;
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
export declare interface SearchRequest {
|
|
710
|
+
/** Terme de recherche */
|
|
711
|
+
q?: string | null;
|
|
712
|
+
/** Index de départ (pagination) */
|
|
713
|
+
offset: number;
|
|
714
|
+
/** Nombre de résultats demandés */
|
|
715
|
+
length: number;
|
|
716
|
+
/** Filtres sous forme de chaîne (format interne) */
|
|
717
|
+
filters?: string | null;
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
export declare interface SearchResult {
|
|
721
|
+
totalCount: number;
|
|
722
|
+
offset: number;
|
|
723
|
+
length: number;
|
|
724
|
+
elements?: SearchResultElement[] | null;
|
|
725
|
+
facets?: SearchFacet[] | null;
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
export declare interface SearchResultElement {
|
|
729
|
+
/** Produit */
|
|
730
|
+
p: WebProduct;
|
|
731
|
+
/** Score de pertinence */
|
|
732
|
+
s?: number | null;
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
export declare interface SessionInfo {
|
|
736
|
+
id: string;
|
|
737
|
+
expiresOn?: string | null;
|
|
738
|
+
loggedUserGuid?: string | null;
|
|
739
|
+
loggedUserEmail?: string | null;
|
|
740
|
+
associatedStoreGuid?: string | null;
|
|
741
|
+
associatedDeviceGuid?: string | null;
|
|
742
|
+
hasCart: boolean;
|
|
743
|
+
cartId?: string | null;
|
|
744
|
+
rjsId: number;
|
|
745
|
+
sitePk: number;
|
|
746
|
+
marketingTestDate?: string | null;
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
/**
|
|
750
|
+
* Interface commune pour la gestion de session.
|
|
751
|
+
* Deux implémentations : BrowserSessionManager (mode browser) et KioskSessionManager (mode borne).
|
|
752
|
+
*/
|
|
753
|
+
export declare interface SessionManager {
|
|
754
|
+
/**
|
|
755
|
+
* Initialise la session.
|
|
756
|
+
* En mode browser : crée une session si elle n'existe pas encore.
|
|
757
|
+
* En mode kiosk : no-op.
|
|
758
|
+
*/
|
|
759
|
+
initialize(): Promise<SessionInfo | null>;
|
|
760
|
+
/**
|
|
761
|
+
* Signale que la session a expiré.
|
|
762
|
+
* En mode browser : peut tenter de recréer une session.
|
|
763
|
+
* En mode kiosk : no-op.
|
|
764
|
+
*/
|
|
765
|
+
onSessionExpired(): Promise<void>;
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
declare class SessionModule {
|
|
769
|
+
private readonly http;
|
|
770
|
+
private readonly cache;
|
|
771
|
+
constructor(http: CommerceHttpAdapter, cache: CacheStrategy);
|
|
772
|
+
/** Récupère les informations de la session en cours */
|
|
773
|
+
getSession(): Promise<SessionInfo>;
|
|
774
|
+
/** Associe un magasin à la session */
|
|
775
|
+
associateStore(storeGuid: string): Promise<SessionInfo>;
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
/** Adresse de livraison pour le checkout */
|
|
779
|
+
export declare interface ShippingAddress {
|
|
780
|
+
guid: string;
|
|
781
|
+
title?: string | null;
|
|
782
|
+
name?: string | null;
|
|
783
|
+
streetAddress?: string | null;
|
|
784
|
+
city?: string | null;
|
|
785
|
+
phone?: string | null;
|
|
786
|
+
mobile?: string | null;
|
|
787
|
+
postalCode?: string | null;
|
|
788
|
+
email?: string | null;
|
|
789
|
+
isForInvoice: boolean;
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
export declare interface ShippingChoice {
|
|
793
|
+
id?: string | null;
|
|
794
|
+
isPickupPoint: boolean;
|
|
795
|
+
carrierLabel?: string | null;
|
|
796
|
+
reference?: string | null;
|
|
797
|
+
priceExclTax: number;
|
|
798
|
+
priceInclTax: number;
|
|
799
|
+
originalPriceExclTax: number;
|
|
800
|
+
originalPriceInclTax: number;
|
|
801
|
+
discountExclTax: number;
|
|
802
|
+
discountInclTax: number;
|
|
803
|
+
formattedPrice?: string | null;
|
|
804
|
+
formattedOriginalPrice?: string | null;
|
|
805
|
+
formattedDiscount?: string | null;
|
|
806
|
+
estimatedDeliveryDate: string;
|
|
807
|
+
formattedEstimatedDeliveryDate?: string | null;
|
|
808
|
+
destinationType: ShippingDestinationKind;
|
|
809
|
+
serviceType: DeliveryServiceType;
|
|
810
|
+
isActive: boolean;
|
|
811
|
+
shippingProviderId: number;
|
|
812
|
+
priority: number;
|
|
813
|
+
publicLabel?: string | null;
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
export declare interface ShippingChoiceGroup {
|
|
817
|
+
groupName?: string | null;
|
|
818
|
+
minPrice?: number | null;
|
|
819
|
+
maxPrice?: number | null;
|
|
820
|
+
earliestDeliveryDate?: string | null;
|
|
821
|
+
choices?: ShippingChoice[] | null;
|
|
822
|
+
groupDestination: ShippingDestinationKind;
|
|
823
|
+
groupServiceType: DeliveryServiceType;
|
|
824
|
+
applicableCartContentTypes?: string[] | null;
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
/** Type de destination de livraison : 0=Adresse, 1=Magasin, 2=PointRelais */
|
|
828
|
+
export declare type ShippingDestinationKind = 0 | 1 | 2;
|
|
829
|
+
|
|
830
|
+
declare class ShippingModule {
|
|
831
|
+
private readonly http;
|
|
832
|
+
private readonly cache;
|
|
833
|
+
constructor(http: CommerceHttpAdapter, cache: CacheStrategy);
|
|
834
|
+
/** Récupère les groupes de modes de livraison disponibles pour le panier en cours */
|
|
835
|
+
getAvailableModes(): Promise<ShippingChoiceGroup[]>;
|
|
836
|
+
/** Sélectionne un mode de livraison */
|
|
837
|
+
selectMode(shippingModeGuid: string): Promise<void>;
|
|
838
|
+
/** Met à jour l'adresse de livraison */
|
|
839
|
+
setAddress(address: ShippingAddress): Promise<void>;
|
|
840
|
+
/** Recherche des points relais à proximité */
|
|
841
|
+
getRelayPoints(postalCode: string, countryCode?: string, shippingModeGuid?: string): Promise<PickupPoint[]>;
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
/** Mode de gestion du stock : 0=Aucun, 1=Géré, 2=Infini */
|
|
845
|
+
export declare type StockManagementMode = 0 | 1 | 2;
|
|
846
|
+
|
|
847
|
+
export declare interface StoreEvent {
|
|
848
|
+
id: string;
|
|
849
|
+
storeId: string;
|
|
850
|
+
/** Date au format 'YYYY-MM-DD' */
|
|
851
|
+
eventDate: string;
|
|
852
|
+
category?: string | null;
|
|
853
|
+
title?: string | null;
|
|
854
|
+
htmlDescription?: string | null;
|
|
855
|
+
isArchived: boolean;
|
|
856
|
+
crossChannelEventId?: string | null;
|
|
857
|
+
exceptionalOpeningHours?: string | null;
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
export declare interface StoreOpeningHours {
|
|
861
|
+
storeGuid: string;
|
|
862
|
+
day: DayOfWeek;
|
|
863
|
+
openingHoursPeriod1?: string | null;
|
|
864
|
+
openingHoursPeriod2?: string | null;
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
declare class StoresModule {
|
|
868
|
+
private readonly http;
|
|
869
|
+
private readonly cache;
|
|
870
|
+
constructor(http: CommerceHttpAdapter, cache: CacheStrategy);
|
|
871
|
+
/** Recherche des magasins par coordonnées géographiques */
|
|
872
|
+
findByLocation(latitude: number, longitude: number, radiusKm?: number): Promise<StoreWithOpeningHours[]>;
|
|
873
|
+
/** Recherche des magasins par code postal */
|
|
874
|
+
findByPostalCode(postalCode: string, countryCode?: string): Promise<StoreWithOpeningHours[]>;
|
|
875
|
+
/** Récupère le détail d'un magasin par son GUID */
|
|
876
|
+
getStore(storeGuid: string): Promise<StoreWithOpeningHours>;
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
export declare interface StoreWithOpeningHours {
|
|
880
|
+
guid: string;
|
|
881
|
+
code?: string | null;
|
|
882
|
+
label?: string | null;
|
|
883
|
+
streetAddress?: string | null;
|
|
884
|
+
postalCode?: string | null;
|
|
885
|
+
city?: string | null;
|
|
886
|
+
countryIso3LettersCode?: string | null;
|
|
887
|
+
latitude?: number | null;
|
|
888
|
+
longitude?: number | null;
|
|
889
|
+
geoZone?: string | null;
|
|
890
|
+
phone?: string | null;
|
|
891
|
+
email?: string | null;
|
|
892
|
+
messageForClients?: string | null;
|
|
893
|
+
isClickNMortarEnable: boolean;
|
|
894
|
+
isShippingDestination: boolean;
|
|
895
|
+
acceptsPickup: boolean;
|
|
896
|
+
acceptsShipFromStore: boolean;
|
|
897
|
+
storeType?: string | null;
|
|
898
|
+
openingDate?: string | null;
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
/** Produit web (utilisé dans les listings et résultats de recherche) */
|
|
902
|
+
export declare interface WebProduct {
|
|
903
|
+
id: number;
|
|
904
|
+
guid: string;
|
|
905
|
+
priceWOTax: number;
|
|
906
|
+
/** Prix TTC */
|
|
907
|
+
price: number;
|
|
908
|
+
vat: number;
|
|
909
|
+
discountedPriceWOTax?: number | null;
|
|
910
|
+
discountedPrice?: number | null;
|
|
911
|
+
discountStartDate?: string | null;
|
|
912
|
+
discountEndDate?: string | null;
|
|
913
|
+
creationDate: string;
|
|
914
|
+
label?: string | null;
|
|
915
|
+
sku?: string | null;
|
|
916
|
+
familyId: number;
|
|
917
|
+
description?: string | null;
|
|
918
|
+
subFamilyId?: number | null;
|
|
919
|
+
brandId: number;
|
|
920
|
+
vatId: number;
|
|
921
|
+
productTypeId: number;
|
|
922
|
+
usableOnDigitalTools: boolean;
|
|
923
|
+
isForInvoicableElements: boolean;
|
|
924
|
+
isMultiVariations: boolean;
|
|
925
|
+
isMainVariation: boolean;
|
|
926
|
+
isAssembly: boolean;
|
|
927
|
+
isExternalVendorEnabled: boolean;
|
|
928
|
+
isProductComplete: boolean;
|
|
929
|
+
currentCreationStep: number;
|
|
930
|
+
recommendedPriceWOTax?: number | null;
|
|
931
|
+
recommendedPrice?: number | null;
|
|
932
|
+
metaType: ProductMetaType;
|
|
933
|
+
riskScore: number;
|
|
934
|
+
parentProductId?: number | null;
|
|
935
|
+
isHighDemand: boolean;
|
|
936
|
+
isShippable: boolean;
|
|
937
|
+
isSubscription: boolean;
|
|
938
|
+
isPackage: boolean;
|
|
939
|
+
isImported: boolean;
|
|
940
|
+
allowsDecimalQuantity: boolean;
|
|
941
|
+
externalCode?: string | null;
|
|
942
|
+
compositionType?: string | null;
|
|
943
|
+
isSimplified: boolean;
|
|
944
|
+
lockedByUserId?: string | null;
|
|
945
|
+
unitId?: number | null;
|
|
946
|
+
quantityPerUnit?: number | null;
|
|
947
|
+
stockManagementMode: StockManagementMode;
|
|
948
|
+
priceIndexId?: string | null;
|
|
949
|
+
priceIndexMultiplier?: number | null;
|
|
950
|
+
priceIndexFeesRate?: number | null;
|
|
951
|
+
externalDppUrl?: string | null;
|
|
952
|
+
mainImage?: string | null;
|
|
953
|
+
smallImage?: string | null;
|
|
954
|
+
intermediateImage?: string | null;
|
|
955
|
+
availableForOrder: boolean;
|
|
956
|
+
availableForShipping: boolean;
|
|
957
|
+
availableForPickup: boolean;
|
|
958
|
+
allTags?: string[] | null;
|
|
959
|
+
externalUrl?: string | null;
|
|
960
|
+
mainCategoryId?: number | null;
|
|
961
|
+
availabilityThreshold?: number | null;
|
|
962
|
+
limitedAvailabilityThreshold?: number | null;
|
|
963
|
+
reviewsNote?: number | null;
|
|
964
|
+
qtyByParentUnit: number;
|
|
965
|
+
reasonCode?: string | null;
|
|
966
|
+
relevance: number;
|
|
967
|
+
attributs?: Record<string, string | null> | null;
|
|
968
|
+
attributsPrives?: Record<string, string | null> | null;
|
|
969
|
+
importance: number;
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
/**
|
|
973
|
+
* Abstraction du canal de communication avec le SharedWorker de cache.
|
|
974
|
+
*
|
|
975
|
+
* - Utilise un SharedWorker si le navigateur le supporte
|
|
976
|
+
* - Fallback : Map in-memory (données non persistantes, perdues au reload)
|
|
977
|
+
*
|
|
978
|
+
* Chaque appel retourne une Promise, résolue/rejetée via la réponse du worker.
|
|
979
|
+
*/
|
|
980
|
+
declare class WorkerBridge {
|
|
981
|
+
private port;
|
|
982
|
+
private readonly pending;
|
|
983
|
+
private requestCounter;
|
|
984
|
+
private readonly fallback;
|
|
985
|
+
private readonly usingFallback;
|
|
986
|
+
constructor();
|
|
987
|
+
private tryStartWorker;
|
|
988
|
+
private readonly handleMessage;
|
|
989
|
+
private nextId;
|
|
990
|
+
private send;
|
|
991
|
+
get<T>(key: string): Promise<T | null>;
|
|
992
|
+
set(key: string, data: unknown, ttlMs: number): Promise<void>;
|
|
993
|
+
invalidate(pattern: string): Promise<void>;
|
|
994
|
+
clearAll(): Promise<void>;
|
|
995
|
+
dispose(): void;
|
|
996
|
+
}
|
|
997
|
+
|
|
998
|
+
export { }
|