@lystech/core 3.0.136 → 3.0.138

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.
@@ -55,6 +55,12 @@ const ATTENDU = [
55
55
  ],
56
56
  pourquoi: "un client qui a oublié son mot de passe demande un lien",
57
57
  },
58
+ {
59
+ nom: "Suivi de commande",
60
+ motifs: [/suivi\/:token/, /lystechAuthRoutes/, /OrderTrackingPage/],
61
+ pourquoi:
62
+ "un client clique « Suivre ma commande » dans le courriel d'expédition",
63
+ },
58
64
  ];
59
65
 
60
66
  const REPLI = {
@@ -38,7 +38,7 @@ jobs:
38
38
  run: npm ci
39
39
 
40
40
  - name: Install Firebase CLI
41
- run: npm install -g firebase-tools
41
+ run: npm install -g firebase-tools@15.34.0 # épinglé : 15.34.1 refuse le déploiement (403 serviceusage)
42
42
 
43
43
  - name: Check current version
44
44
  id: check-version
package/dist/index.d.ts CHANGED
@@ -30,7 +30,7 @@ export declare type AppliedPromoCodeType = {
30
30
  error: string;
31
31
  };
32
32
 
33
- export declare function AskPermissionsFloatingButtons({ enableInstallAppButton, enablePushNotificationButton }: Props_10): JSX.Element;
33
+ export declare function AskPermissionsFloatingButtons({ enableInstallAppButton, enablePushNotificationButton }: Props_11): JSX.Element;
34
34
 
35
35
  export declare function AuthActivationPage(): JSX.Element;
36
36
 
@@ -234,6 +234,23 @@ export declare type CartProduct = ShopProduct & {
234
234
  quantity: number;
235
235
  };
236
236
 
237
+ export declare function CheckoutPanel({ products, promoCodes, onPaid, returnUrl, customerEmail, className }: CheckoutPanelProps): JSX.Element | null;
238
+
239
+ export declare type CheckoutPanelProps = {
240
+ products: Line[];
241
+ promoCodes?: string[];
242
+ /** Paiement confirmé (PayPal tout de suite ; carte au retour, voir useCheckoutReturn). */
243
+ onPaid?: (info: {
244
+ provider: "paypal" | "stripe";
245
+ orderId?: string;
246
+ }) => void;
247
+ /** Adresse de retour après un paiement par carte (défaut : la page actuelle). */
248
+ returnUrl?: string;
249
+ /** Courriel connu du client, pré-rempli chez Stripe. */
250
+ customerEmail?: string;
251
+ className?: string;
252
+ };
253
+
237
254
  export declare function ClientOrderBill({ bill, hideInvoiceLink }: {
238
255
  bill: CustomerBill;
239
256
  hideInvoiceLink?: boolean;
@@ -244,7 +261,7 @@ export declare function ClosingCountdown({ closing, onElapsed }: {
244
261
  onElapsed?: () => void;
245
262
  }): JSX.Element | null;
246
263
 
247
- export declare function CollectionInvitationSelector({ onCollectionSelected, currentCollectionUID, collectionsSelectorTitle, showOptions, allowAutoSelect }: Props_5): JSX.Element | null;
264
+ export declare function CollectionInvitationSelector({ onCollectionSelected, currentCollectionUID, collectionsSelectorTitle, showOptions, allowAutoSelect }: Props_6): JSX.Element | null;
248
265
 
249
266
  export declare type CollectionInvitationType = {
250
267
  collectionName: string;
@@ -306,7 +323,7 @@ declare interface ContextMenuState {
306
323
  title?: string;
307
324
  }
308
325
 
309
- export declare function Countdown({ countdown, useLabels, lang, showControls, loading, showYears, onClick, onDelete, onTriggerUpdate, onToggleFeatured, }: Props_11): JSX.Element;
326
+ export declare function Countdown({ countdown, useLabels, lang, showControls, loading, showYears, onClick, onDelete, onTriggerUpdate, onToggleFeatured, }: Props_12): JSX.Element;
310
327
 
311
328
  export declare type CountdownType = {
312
329
  id?: number;
@@ -340,7 +357,7 @@ export declare function createStripeCheckout(input: StripeCheckoutInput): Promis
340
357
  url: string;
341
358
  }>;
342
359
 
343
- export declare function CurrentlyInvitedToOrdersSection({ onCollectionInvitationClick }: Props_4): JSX.Element;
360
+ export declare function CurrentlyInvitedToOrdersSection({ onCollectionInvitationClick }: Props_5): JSX.Element;
344
361
 
345
362
  export declare type CustomerBill = {
346
363
  billUID: string;
@@ -456,6 +473,8 @@ declare interface DataGridRow {
456
473
 
457
474
  export declare function fetchAvailableCollections(): Promise<any>;
458
475
 
476
+ export declare function fetchOrderTracking(token: string): Promise<PublicOrderTracking | null>;
477
+
459
478
  /** « 2 j 03 h 15 min 09 s » ; les unités nulles de tête disparaissent. */
460
479
  export declare function formatCountdown(ms: number): string;
461
480
 
@@ -508,7 +527,12 @@ export declare type ImageType = {
508
527
  src: string;
509
528
  };
510
529
 
511
- export declare function InstallPwaButton({ size, visible, forceVisible, text, knowMoreUrl, knowMoreText, onAction, onPopupClose }: Props_8): JSX.Element | null;
530
+ export declare function InstallPwaButton({ size, visible, forceVisible, text, knowMoreUrl, knowMoreText, onAction, onPopupClose }: Props_9): JSX.Element | null;
531
+
532
+ declare type Line = {
533
+ UID: string;
534
+ quantity: number;
535
+ };
512
536
 
513
537
  /**
514
538
  * Loader partagé de toutes les apps Lystech — animation « Mirage » (ldrs),
@@ -521,7 +545,7 @@ export declare function InstallPwaButton({ size, visible, forceVisible, text, kn
521
545
  export declare function LoadingCircle(): JSX.Element;
522
546
 
523
547
  /** Les adresses que le serveur peut écrire dans un courriel. */
524
- export declare const LYSTECH_AUTH_ROUTE_PATHS: readonly ["/account/activation/:token", "/account/reset-password/:token"];
548
+ export declare const LYSTECH_AUTH_ROUTE_PATHS: readonly ["/account/activation/:token", "/account/reset-password/:token", "/suivi/:token"];
525
549
 
526
550
  export declare const LYSTECH_CORE_VERSION: any;
527
551
 
@@ -585,6 +609,15 @@ declare type OrderBreakdown = {
585
609
  finalShippingPrice?: number;
586
610
  handlingFee?: number;
587
611
  discount?: number;
612
+ /** Taxes déclarées par la boutique (vides si aucune). */
613
+ taxes?: {
614
+ name: string;
615
+ rate: number;
616
+ amount: number;
617
+ }[];
618
+ taxTotal?: number;
619
+ /** true : les prix affichés contiennent déjà la taxe. */
620
+ taxesIncluded?: boolean;
588
621
  appliedPromoCodes?: {
589
622
  code: string;
590
623
  promo: string;
@@ -600,6 +633,16 @@ declare type OrderBreakdown = {
600
633
  }[];
601
634
  };
602
635
 
636
+ export declare function OrderTrackingPage({ token: tokenProp, shopHref }: Props_4): JSX.Element;
637
+
638
+ export declare type OrderTrackingStep = {
639
+ key: string;
640
+ label: string;
641
+ done: boolean;
642
+ current: boolean;
643
+ date: string | null;
644
+ };
645
+
603
646
  declare type OrganizationContext = {
604
647
  organization: string;
605
648
  organizationImage: string;
@@ -695,7 +738,7 @@ export declare type PackageUpdateEvent = {
695
738
 
696
739
  export declare function PastOrdersPage({ billUID, onCollectionInvitationClick }: Props_3): JSX.Element;
697
740
 
698
- export declare function PaypalCheckout({ products, promoCodes, onOrderCreated, onOrderComplete, onShipppingOptionsChange: onShippingOptionsChangeEvent, onInstrumentDeclined, onError, }: Props_6): JSX.Element;
741
+ export declare function PaypalCheckout({ products, promoCodes, shippingOptionId, onOrderCreated, onOrderComplete, onShipppingOptionsChange: onShippingOptionsChangeEvent, onInstrumentDeclined, onError, }: Props_7): JSX.Element;
699
742
 
700
743
  export declare type PaypalInfoType = {
701
744
  clientId: string;
@@ -779,7 +822,7 @@ declare type ProductProp = {
779
822
  fk_organization: string;
780
823
  };
781
824
 
782
- export declare function Progress({ percentage, color, showPercentage, text, }: Props_12): JSX.Element;
825
+ export declare function Progress({ percentage, color, showPercentage, text, }: Props_13): JSX.Element;
783
826
 
784
827
  declare type ProgressiveWebAppContextType = {
785
828
  useProgressiveWebAppFeatures?: boolean | 'mobile';
@@ -796,7 +839,7 @@ declare type ProgressiveWebAppContextType = {
796
839
  installProgressiveWebApp: () => Promise<void>;
797
840
  };
798
841
 
799
- export declare function PromoCodeTag({ promoCode, showExpireInfo, onClick, isApplied, onRemove, }: Props_13): JSX.Element;
842
+ export declare function PromoCodeTag({ promoCode, showExpireInfo, onClick, isApplied, onRemove, }: Props_14): JSX.Element;
800
843
 
801
844
  export declare type PromoCodeType = {
802
845
  id: number;
@@ -843,13 +886,24 @@ declare type Props = {
843
886
  };
844
887
 
845
888
  declare type Props_10 = {
889
+ forceVisible?: boolean;
890
+ size?: number;
891
+ visible?: boolean;
892
+ text?: string;
893
+ knowMoreUrl?: string;
894
+ knowMoreText?: string;
895
+ onAction?: () => void;
896
+ onPopupClose?: () => void;
897
+ };
898
+
899
+ declare type Props_11 = {
846
900
  enableInstallAppButton?: boolean;
847
901
  enablePushNotificationButton?: boolean;
848
902
  knowMoreUrl?: string;
849
903
  knowMoreText?: string;
850
904
  };
851
905
 
852
- declare type Props_11 = {
906
+ declare type Props_12 = {
853
907
  countdown: CountdownType_2;
854
908
  useLabels?: boolean;
855
909
  lang?: "fr" | "en";
@@ -862,14 +916,14 @@ declare type Props_11 = {
862
916
  onToggleFeatured?: () => void;
863
917
  };
864
918
 
865
- declare type Props_12 = {
919
+ declare type Props_13 = {
866
920
  percentage?: number;
867
921
  color?: string;
868
922
  showPercentage?: boolean;
869
923
  text?: string;
870
924
  };
871
925
 
872
- declare type Props_13 = {
926
+ declare type Props_14 = {
873
927
  promoCode: PromoCodeType;
874
928
  showExpireInfo?: boolean;
875
929
  onClick?: () => void;
@@ -900,10 +954,17 @@ declare type Props_3 = {
900
954
  };
901
955
 
902
956
  declare type Props_4 = {
903
- onCollectionInvitationClick?: (invitation: CollectionInvitationType) => void;
957
+ /** Jeton à lire ; par défaut le paramètre `:token` de la route. */
958
+ token?: string;
959
+ /** Lien « retour à la boutique » ; par défaut l'adresse renvoyée par le serveur, sinon « / ». */
960
+ shopHref?: string;
904
961
  };
905
962
 
906
963
  declare type Props_5 = {
964
+ onCollectionInvitationClick?: (invitation: CollectionInvitationType) => void;
965
+ };
966
+
967
+ declare type Props_6 = {
907
968
  /** `auto` : choisie par la page (une seule commande ouverte), pas par un clic — à remplacer dans l'historique du navigateur, pas à empiler. */
908
969
  onCollectionSelected?: (collectionUID: string, info?: {
909
970
  auto: boolean;
@@ -915,12 +976,14 @@ declare type Props_5 = {
915
976
  allowAutoSelect?: boolean;
916
977
  };
917
978
 
918
- declare type Props_6 = {
979
+ declare type Props_7 = {
919
980
  products?: {
920
981
  UID: string;
921
982
  quantity: number;
922
983
  }[];
923
984
  promoCodes?: string[];
985
+ /** Option de livraison choisie dans le panier (devient celle de l'ordre PayPal). */
986
+ shippingOptionId?: number | string | null;
924
987
  onOrderCreated?: (orderId: string) => void;
925
988
  onOrderComplete?: (orderId: string) => void;
926
989
  onShipppingOptionsChange?: (orderId: string, selectedShippingOption: {
@@ -937,7 +1000,7 @@ declare type Props_6 = {
937
1000
  onError?: (error: string) => void;
938
1001
  };
939
1002
 
940
- declare type Props_7 = {
1003
+ declare type Props_8 = {
941
1004
  /** Panier de produits Lystech (UID) — alternative à priceId. */
942
1005
  products?: {
943
1006
  UID: string;
@@ -949,6 +1012,8 @@ declare type Props_7 = {
949
1012
  successUrl?: string;
950
1013
  cancelUrl?: string;
951
1014
  customerEmail?: string;
1015
+ promoCodes?: string[];
1016
+ shippingOptionId?: number | string | null;
952
1017
  label?: string;
953
1018
  block?: boolean;
954
1019
  disabled?: boolean;
@@ -957,7 +1022,7 @@ declare type Props_7 = {
957
1022
  onRedirect?: (url: string) => void;
958
1023
  };
959
1024
 
960
- declare interface Props_8 {
1025
+ declare interface Props_9 {
961
1026
  forceVisible?: boolean;
962
1027
  size?: number;
963
1028
  visible?: boolean;
@@ -968,17 +1033,6 @@ declare interface Props_8 {
968
1033
  onPopupClose?: () => void;
969
1034
  }
970
1035
 
971
- declare type Props_9 = {
972
- forceVisible?: boolean;
973
- size?: number;
974
- visible?: boolean;
975
- text?: string;
976
- knowMoreUrl?: string;
977
- knowMoreText?: string;
978
- onAction?: () => void;
979
- onPopupClose?: () => void;
980
- };
981
-
982
1036
  declare type ProviderType = {
983
1037
  popupElement: default_2.ReactNode;
984
1038
  confirmPopupElement: default_2.ReactNode;
@@ -996,6 +1050,36 @@ declare type ProviderType_2 = {
996
1050
  children: default_2.ReactNode;
997
1051
  };
998
1052
 
1053
+ export declare type PublicOrderTracking = {
1054
+ shop: {
1055
+ name: string;
1056
+ url: string;
1057
+ primaryColor: string | null;
1058
+ };
1059
+ orderNumber: string;
1060
+ orderedOn: string | null;
1061
+ status: string;
1062
+ statusLabel: string;
1063
+ mode: "delivery" | "pickup" | null;
1064
+ steps: OrderTrackingStep[];
1065
+ carrier: {
1066
+ name: string;
1067
+ trackingNumber: string | null;
1068
+ url: string | null;
1069
+ } | null;
1070
+ pickupLocation: string | null;
1071
+ customerNote: string | null;
1072
+ items: Array<{
1073
+ name: string;
1074
+ format: string | null;
1075
+ quantity: number;
1076
+ unitPrice: number;
1077
+ }>;
1078
+ total: number;
1079
+ currency: string;
1080
+ updatedOn: string | null;
1081
+ };
1082
+
999
1083
  declare type PushNotificationContextType = {
1000
1084
  usePushNotifications?: boolean;
1001
1085
  isPushSupported: boolean;
@@ -1148,7 +1232,7 @@ declare interface SquareImageProps {
1148
1232
  * crée la session côté backend (POST /stripe/checkout) puis redirige vers la
1149
1233
  * page de paiement Stripe. Aucun formulaire de carte côté client.
1150
1234
  */
1151
- export declare function StripeCheckout({ products, priceId, quantity, successUrl, cancelUrl, customerEmail, label, block, disabled, onError, onRedirect, }: Props_7): JSX.Element;
1235
+ export declare function StripeCheckout({ products, priceId, quantity, successUrl, cancelUrl, customerEmail, promoCodes, shippingOptionId, label, block, disabled, onError, onRedirect, }: Props_8): JSX.Element;
1152
1236
 
1153
1237
  export declare interface StripeCheckoutInput {
1154
1238
  /** Un seul prix Stripe (ex. depuis le catalogue). */
@@ -1162,9 +1246,13 @@ export declare interface StripeCheckoutInput {
1162
1246
  successUrl: string;
1163
1247
  cancelUrl: string;
1164
1248
  customerEmail?: string;
1249
+ /** Codes promo du panier (appliqués par le serveur). */
1250
+ promoCodes?: string[];
1251
+ /** Option de livraison choisie dans le panier. */
1252
+ shippingOptionId?: number | string | null;
1165
1253
  }
1166
1254
 
1167
- export declare function SubscribeToPushNotification({ size, visible, forceVisible, text, knowMoreUrl, knowMoreText, onAction, onPopupClose }: Props_9): JSX.Element;
1255
+ export declare function SubscribeToPushNotification({ size, visible, forceVisible, text, knowMoreUrl, knowMoreText, onAction, onPopupClose }: Props_10): JSX.Element;
1168
1256
 
1169
1257
  export declare type Subscription = {
1170
1258
  UID?: string;
@@ -1291,6 +1379,12 @@ export declare const useAuthPromoCodes: (userEmail: string) => UseQueryResult<Pr
1291
1379
 
1292
1380
  export declare const useAxiosMiddleware: () => ProviderType_2;
1293
1381
 
1382
+ /**
1383
+ * Au retour d'un paiement par carte : « reussi », « annule » ou null.
1384
+ * Retire le paramètre de l'adresse pour qu'un rechargement ne rejoue rien.
1385
+ */
1386
+ export declare function useCheckoutReturn(): "reussi" | "annule" | null;
1387
+
1294
1388
  export declare const useContextMenu: () => ContextMenuContextType;
1295
1389
 
1296
1390
  export declare const useContextMenuHandler: () => {
@@ -1416,7 +1510,9 @@ export declare const useOptionalNavigate: () => NavigateFunction | ((to: string
1416
1510
  export declare const useOrderDetailsBreakdown: (organizationUID: string, products: {
1417
1511
  UID: string;
1418
1512
  quantity: number;
1419
- }[], promoCodes: string[]) => UseQueryResult<OrderBreakdown, unknown>;
1513
+ }[], promoCodes: string[],
1514
+ /** Option de livraison choisie : le récapitulatif compte son prix (lu en base). */
1515
+ shippingOptionId?: number | string | null) => UseQueryResult<OrderBreakdown, unknown>;
1420
1516
 
1421
1517
  export declare function useOrganization(): OrganizationContext;
1422
1518