@lystech/core 3.0.140 → 3.0.142
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +301 -1
- package/dist/lystech-core-provider.es.js +14883 -14295
- package/dist/lystech-core-provider.umd.js +191 -191
- package/dist/lystech-core-styles.css +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -197,6 +197,42 @@ declare type AuthUserProfileProps = {
|
|
|
197
197
|
|
|
198
198
|
export declare const axiosInstance: AxiosInstance;
|
|
199
199
|
|
|
200
|
+
export declare function BecomeMember({ title, intro, successUrl, cancelUrl, renderAction, onChoosePlan, onLoginRequired, }: BecomeMemberProps): JSX.Element | null;
|
|
201
|
+
|
|
202
|
+
export declare type BecomeMemberProps = {
|
|
203
|
+
title?: string;
|
|
204
|
+
intro?: string;
|
|
205
|
+
/** Retour après paiement Stripe (défaut : la page courante). */
|
|
206
|
+
successUrl?: string;
|
|
207
|
+
cancelUrl?: string;
|
|
208
|
+
/**
|
|
209
|
+
* Bouton de paiement PROPRE à la boutique pour un plan non relié à un prix
|
|
210
|
+
* Stripe (ex. son propre bouton de paiement). Prime sur `onChoosePlan`.
|
|
211
|
+
*/
|
|
212
|
+
renderAction?: (plan: LoyaltyPlan, ctx: {
|
|
213
|
+
renew: boolean;
|
|
214
|
+
}) => ReactNode;
|
|
215
|
+
/** Paiement hors Stripe (PayPal, page dédiée…) pour un plan non relié à Stripe. */
|
|
216
|
+
onChoosePlan?: (plan: LoyaltyPlan) => void;
|
|
217
|
+
/** Le client n'est pas connecté : mener à la connexion. */
|
|
218
|
+
onLoginRequired?: () => void;
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
export declare type BenefitView = {
|
|
222
|
+
benefitUID: string;
|
|
223
|
+
name: string;
|
|
224
|
+
description: string | null;
|
|
225
|
+
kind: "percent_off" | "amount_off" | "free_shipping" | "perk";
|
|
226
|
+
value: number;
|
|
227
|
+
minSubtotal: number;
|
|
228
|
+
minItems: number;
|
|
229
|
+
effectLabel: string;
|
|
230
|
+
audienceLabel: string;
|
|
231
|
+
audienceMode?: "everyone" | "loggedIn" | "members" | "nonMembers" | "plans";
|
|
232
|
+
planUIDs: string[];
|
|
233
|
+
endsOn: string | null;
|
|
234
|
+
};
|
|
235
|
+
|
|
200
236
|
declare type BillProduct = {
|
|
201
237
|
UID: string;
|
|
202
238
|
billUID?: string;
|
|
@@ -221,6 +257,12 @@ declare type BillProduct = {
|
|
|
221
257
|
lastOrderedOn: string;
|
|
222
258
|
};
|
|
223
259
|
|
|
260
|
+
export declare function BirthdayForm({ title }: BirthdayFormProps): JSX.Element | null;
|
|
261
|
+
|
|
262
|
+
export declare type BirthdayFormProps = {
|
|
263
|
+
title?: string;
|
|
264
|
+
};
|
|
265
|
+
|
|
224
266
|
declare interface CardItem {
|
|
225
267
|
label: default_2.ReactNode;
|
|
226
268
|
labelIcon?: default_2.ReactNode;
|
|
@@ -509,6 +551,16 @@ declare interface GenericCardProps {
|
|
|
509
551
|
|
|
510
552
|
export declare function getFeaturedImages(): Promise<ImageType[]>;
|
|
511
553
|
|
|
554
|
+
export declare function getLoyaltyRewards(): Promise<LoyaltyRewards>;
|
|
555
|
+
|
|
556
|
+
export declare function getMyBenefits(): Promise<MyBenefits>;
|
|
557
|
+
|
|
558
|
+
export declare function getMyBirthday(): Promise<MyBirthday>;
|
|
559
|
+
|
|
560
|
+
export declare function getMyLoyalty(): Promise<MyLoyalty>;
|
|
561
|
+
|
|
562
|
+
export declare function getMyLoyaltyLedger(limit?: number): Promise<LedgerRow[]>;
|
|
563
|
+
|
|
512
564
|
export declare function getSinglePostBySlug(slug: string): Promise<PostType>;
|
|
513
565
|
|
|
514
566
|
export declare function getUserPromoCodes(): Promise<PromoCodeType[]>;
|
|
@@ -529,6 +581,18 @@ export declare type ImageType = {
|
|
|
529
581
|
|
|
530
582
|
export declare function InstallPwaButton({ size, visible, forceVisible, text, knowMoreUrl, knowMoreText, onAction, onPopupClose }: Props_9): JSX.Element | null;
|
|
531
583
|
|
|
584
|
+
export declare type LedgerRow = {
|
|
585
|
+
id: number;
|
|
586
|
+
delta: number;
|
|
587
|
+
kind: "earn" | "reverse" | "redeem" | "expire" | "adjust" | "bonus" | "migration" | string;
|
|
588
|
+
sourceType: string;
|
|
589
|
+
sourceRef: string | null;
|
|
590
|
+
availableOn: string;
|
|
591
|
+
createdOn: string;
|
|
592
|
+
note: string | null;
|
|
593
|
+
createdBy: string | null;
|
|
594
|
+
};
|
|
595
|
+
|
|
532
596
|
declare type Line = {
|
|
533
597
|
UID: string;
|
|
534
598
|
quantity: number;
|
|
@@ -544,6 +608,102 @@ declare type Line = {
|
|
|
544
608
|
*/
|
|
545
609
|
export declare function LoadingCircle(): JSX.Element;
|
|
546
610
|
|
|
611
|
+
export declare function LoyaltyAccount({ hideBirthday, hideBecomeMember, hideCodes, ...buy }: LoyaltyAccountProps): JSX.Element;
|
|
612
|
+
|
|
613
|
+
export declare type LoyaltyAccountProps = Pick<BecomeMemberProps, "successUrl" | "cancelUrl" | "onChoosePlan" | "onLoginRequired" | "renderAction"> & {
|
|
614
|
+
/** Masquer les codes personnels (si la boutique les montre déjà ailleurs). */
|
|
615
|
+
hideCodes?: boolean;
|
|
616
|
+
/** Masquer « Mon anniversaire » (si la boutique le gère ailleurs). */
|
|
617
|
+
hideBirthday?: boolean;
|
|
618
|
+
/** Masquer « Devenir membre ». */
|
|
619
|
+
hideBecomeMember?: boolean;
|
|
620
|
+
};
|
|
621
|
+
|
|
622
|
+
export declare const loyaltyKeys: {
|
|
623
|
+
me: (org: string, user: string) => readonly ["loyalty-me", string, string];
|
|
624
|
+
ledger: (org: string, user: string) => readonly ["loyalty-ledger", string, string];
|
|
625
|
+
rewards: (org: string, user: string) => readonly ["loyalty-rewards", string, string];
|
|
626
|
+
benefits: (org: string, user: string) => readonly ["loyalty-benefits", string, string];
|
|
627
|
+
birthday: (org: string, user: string) => readonly ["loyalty-birthday", string, string];
|
|
628
|
+
};
|
|
629
|
+
|
|
630
|
+
export declare type LoyaltyMembership = {
|
|
631
|
+
planUID: string;
|
|
632
|
+
planName: string | null;
|
|
633
|
+
source: "paypal_legacy" | "manual" | "gift" | "stripe";
|
|
634
|
+
ref: string;
|
|
635
|
+
startsOn: string | null;
|
|
636
|
+
endsOn: string | null;
|
|
637
|
+
status: MembershipStatus_2;
|
|
638
|
+
isActive: boolean;
|
|
639
|
+
};
|
|
640
|
+
|
|
641
|
+
export declare type LoyaltyPlan = {
|
|
642
|
+
UID: string;
|
|
643
|
+
name: string | null;
|
|
644
|
+
description: string | null;
|
|
645
|
+
price: number | null;
|
|
646
|
+
durationDays: number | null;
|
|
647
|
+
rank: number;
|
|
648
|
+
badgeLabel: string | null;
|
|
649
|
+
badgeColor: string | null;
|
|
650
|
+
pointsMultiplier: number;
|
|
651
|
+
/** Proposé sur « Devenir membre ». */
|
|
652
|
+
isPublic: boolean;
|
|
653
|
+
/** Achat en ligne par Stripe possible si non nul. */
|
|
654
|
+
stripePriceId: string | null;
|
|
655
|
+
};
|
|
656
|
+
|
|
657
|
+
export declare function LoyaltyPoints({ title, showRewards, historyPreview }: LoyaltyPointsProps): JSX.Element | null;
|
|
658
|
+
|
|
659
|
+
export declare type LoyaltyPointsProps = {
|
|
660
|
+
title?: string;
|
|
661
|
+
/** Afficher les récompenses échangeables (défaut : oui). */
|
|
662
|
+
showRewards?: boolean;
|
|
663
|
+
/** Lignes d'historique visibles avant « Voir tout » (défaut : 8). */
|
|
664
|
+
historyPreview?: number;
|
|
665
|
+
};
|
|
666
|
+
|
|
667
|
+
export declare type LoyaltyPointsSummary = {
|
|
668
|
+
enabled: boolean;
|
|
669
|
+
label: string;
|
|
670
|
+
balance: number;
|
|
671
|
+
pending: number;
|
|
672
|
+
lastEarnOn: string | null;
|
|
673
|
+
expiresOn: string | null;
|
|
674
|
+
};
|
|
675
|
+
|
|
676
|
+
export declare type LoyaltyRewards = {
|
|
677
|
+
enabled: boolean;
|
|
678
|
+
pointsLabel?: string;
|
|
679
|
+
balance: number | null;
|
|
680
|
+
next: {
|
|
681
|
+
reward: {
|
|
682
|
+
name: string;
|
|
683
|
+
costPoints: number;
|
|
684
|
+
};
|
|
685
|
+
missing: number;
|
|
686
|
+
} | null;
|
|
687
|
+
rewards: LoyaltyRewardView[];
|
|
688
|
+
};
|
|
689
|
+
|
|
690
|
+
export declare type LoyaltyRewardView = {
|
|
691
|
+
rewardUID: string;
|
|
692
|
+
name: string;
|
|
693
|
+
description: string | null;
|
|
694
|
+
costPoints: number;
|
|
695
|
+
effect: "percent_off" | "amount_off" | "free_shipping";
|
|
696
|
+
value: number;
|
|
697
|
+
effectLabel: string;
|
|
698
|
+
minSubtotal: number;
|
|
699
|
+
validityDays: number;
|
|
700
|
+
redeemable: {
|
|
701
|
+
ok: boolean;
|
|
702
|
+
reason?: string;
|
|
703
|
+
message?: string;
|
|
704
|
+
};
|
|
705
|
+
};
|
|
706
|
+
|
|
547
707
|
/** Les adresses que le serveur peut écrire dans un courriel. */
|
|
548
708
|
export declare const LYSTECH_AUTH_ROUTE_PATHS: readonly ["/account/activation/:token", "/account/reset-password/:token", "/suivi/:token"];
|
|
549
709
|
|
|
@@ -559,6 +719,54 @@ export declare function LystechNotFoundPage({ homePath, homeLabel, }?: {
|
|
|
559
719
|
homeLabel?: string;
|
|
560
720
|
}): JSX.Element;
|
|
561
721
|
|
|
722
|
+
export declare function MemberBenefits({ title, onBecomeMember, showCodes }: MemberBenefitsProps): JSX.Element | null;
|
|
723
|
+
|
|
724
|
+
export declare type MemberBenefitsProps = {
|
|
725
|
+
title?: string;
|
|
726
|
+
onBecomeMember?: () => void;
|
|
727
|
+
/** Montrer « Mes codes personnels » (défaut : oui). */
|
|
728
|
+
showCodes?: boolean;
|
|
729
|
+
};
|
|
730
|
+
|
|
731
|
+
export declare function MembershipBadge({ label, color }: {
|
|
732
|
+
label: string;
|
|
733
|
+
color?: string | null;
|
|
734
|
+
}): JSX.Element;
|
|
735
|
+
|
|
736
|
+
export declare type MembershipState = {
|
|
737
|
+
loading: boolean;
|
|
738
|
+
error: unknown;
|
|
739
|
+
isLoggedIn: boolean;
|
|
740
|
+
isMember: boolean;
|
|
741
|
+
/** A eu une adhésion, plus aucune active. */
|
|
742
|
+
wasMember: boolean;
|
|
743
|
+
activePlanUIDs: string[];
|
|
744
|
+
/** Adhésions actives, avec les réglages de leur plan (badge, rang). */
|
|
745
|
+
active: Array<LoyaltyMembership & {
|
|
746
|
+
plan: LoyaltyPlan | null;
|
|
747
|
+
}>;
|
|
748
|
+
/** Une entrée par plan déjà eu (active ou non). */
|
|
749
|
+
memberships: LoyaltyMembership[];
|
|
750
|
+
/** Tous les plans de la boutique (triés par rang). */
|
|
751
|
+
plans: LoyaltyPlan[];
|
|
752
|
+
/** Plans proposés sur « Devenir membre » (isPublic). */
|
|
753
|
+
availablePlans: LoyaltyPlan[];
|
|
754
|
+
hasPlan: (planUID: string) => boolean;
|
|
755
|
+
program: MyLoyalty["program"] | null;
|
|
756
|
+
points: MyLoyalty["points"];
|
|
757
|
+
refetch: () => void;
|
|
758
|
+
};
|
|
759
|
+
|
|
760
|
+
export declare function MembershipStatus({ title, onBecomeMember }: MembershipStatusProps): JSX.Element | null;
|
|
761
|
+
|
|
762
|
+
declare type MembershipStatus_2 = "active" | "grace" | "canceled_pending" | "expired";
|
|
763
|
+
|
|
764
|
+
export declare type MembershipStatusProps = {
|
|
765
|
+
title?: string;
|
|
766
|
+
/** Mène à « Devenir membre » (ou à la page de la boutique qui le montre). */
|
|
767
|
+
onBecomeMember?: () => void;
|
|
768
|
+
};
|
|
769
|
+
|
|
562
770
|
declare type MessageParams = {
|
|
563
771
|
type: "error" | "success" | "warning";
|
|
564
772
|
message: string;
|
|
@@ -593,6 +801,43 @@ declare type ModalPopupProps = {
|
|
|
593
801
|
onFinishOpen?: () => void;
|
|
594
802
|
};
|
|
595
803
|
|
|
804
|
+
export declare type MyBenefits = {
|
|
805
|
+
enabled: boolean;
|
|
806
|
+
mine: BenefitView[];
|
|
807
|
+
others: BenefitView[];
|
|
808
|
+
codes: PersonalCode[];
|
|
809
|
+
};
|
|
810
|
+
|
|
811
|
+
export declare type MyBirthday = {
|
|
812
|
+
birthday: string | null;
|
|
813
|
+
year?: number | null;
|
|
814
|
+
month?: number;
|
|
815
|
+
day?: number;
|
|
816
|
+
source: string | null;
|
|
817
|
+
changeAllowedOn: string | null;
|
|
818
|
+
};
|
|
819
|
+
|
|
820
|
+
export declare type MyLoyalty = {
|
|
821
|
+
isLoggedIn: boolean;
|
|
822
|
+
isMember: boolean;
|
|
823
|
+
wasMember: boolean;
|
|
824
|
+
activePlanUIDs: string[];
|
|
825
|
+
/** Une entrée par plan (l'adhésion qui compte). */
|
|
826
|
+
memberships: LoyaltyMembership[];
|
|
827
|
+
/** Tout l'historique, la plus récente d'abord. */
|
|
828
|
+
history: LoyaltyMembership[];
|
|
829
|
+
plans: LoyaltyPlan[];
|
|
830
|
+
program: {
|
|
831
|
+
enabled: boolean;
|
|
832
|
+
pointsLabel: string;
|
|
833
|
+
earnDescription: string | null;
|
|
834
|
+
featuredPlanUID: string | null;
|
|
835
|
+
/** Le programme offre un cadeau d'anniversaire. */
|
|
836
|
+
birthdayEnabled?: boolean;
|
|
837
|
+
};
|
|
838
|
+
points: LoyaltyPointsSummary | null;
|
|
839
|
+
};
|
|
840
|
+
|
|
596
841
|
declare type OrderBreakdown = {
|
|
597
842
|
products: {
|
|
598
843
|
UID: string;
|
|
@@ -742,7 +987,7 @@ export declare type PackageUpdateEvent = {
|
|
|
742
987
|
|
|
743
988
|
export declare function PastOrdersPage({ billUID, onCollectionInvitationClick }: Props_3): JSX.Element;
|
|
744
989
|
|
|
745
|
-
export declare function PaypalCheckout({ products, promoCodes, shippingOptionId, onOrderCreated, onOrderComplete, onShipppingOptionsChange: onShippingOptionsChangeEvent, onInstrumentDeclined, onError, }: Props_7): JSX.Element;
|
|
990
|
+
export declare function PaypalCheckout({ products, promoCodes, shippingOptionId, intent, useStoreCredit, onOrderCreated, onOrderComplete, onShipppingOptionsChange: onShippingOptionsChangeEvent, onInstrumentDeclined, onError, }: Props_7): JSX.Element;
|
|
746
991
|
|
|
747
992
|
export declare type PaypalInfoType = {
|
|
748
993
|
clientId: string;
|
|
@@ -752,6 +997,16 @@ export declare type PaypalInfoType = {
|
|
|
752
997
|
enabled: boolean;
|
|
753
998
|
};
|
|
754
999
|
|
|
1000
|
+
export declare type PersonalCode = {
|
|
1001
|
+
id: number;
|
|
1002
|
+
code: string;
|
|
1003
|
+
description: string | null;
|
|
1004
|
+
effectLabel: string;
|
|
1005
|
+
minSubtotal: number;
|
|
1006
|
+
expireOn: string;
|
|
1007
|
+
usesLeft: number;
|
|
1008
|
+
};
|
|
1009
|
+
|
|
755
1010
|
export declare function PolitiqueAndConditionPage(): JSX.Element;
|
|
756
1011
|
|
|
757
1012
|
export declare type PolitiqueAndConditionsType = {
|
|
@@ -988,6 +1243,15 @@ declare type Props_7 = {
|
|
|
988
1243
|
promoCodes?: string[];
|
|
989
1244
|
/** Option de livraison choisie dans le panier (devient celle de l'ordre PayPal). */
|
|
990
1245
|
shippingOptionId?: number | string | null;
|
|
1246
|
+
/**
|
|
1247
|
+
* « capture » (défaut) : prélevé au paiement. « authorize » : la boutique
|
|
1248
|
+
* prélève à l'envoi — PayPal RETIENT les fonds, Lystech prélève plus tard.
|
|
1249
|
+
* Vient de GET /shop/payment-methods (paypalIntent) : le SDK et l'ordre
|
|
1250
|
+
* doivent avoir le même intent, sinon PayPal refuse l'approbation.
|
|
1251
|
+
*/
|
|
1252
|
+
intent?: "capture" | "authorize";
|
|
1253
|
+
/** Crédit boutique appliqué au panier : PayPal ne prend que le reste. */
|
|
1254
|
+
useStoreCredit?: boolean;
|
|
991
1255
|
onOrderCreated?: (orderId: string) => void;
|
|
992
1256
|
onOrderComplete?: (orderId: string) => void;
|
|
993
1257
|
onShipppingOptionsChange?: (orderId: string, selectedShippingOption: {
|
|
@@ -1100,6 +1364,18 @@ declare type PushNotificationContextType = {
|
|
|
1100
1364
|
|
|
1101
1365
|
export { QueryClient }
|
|
1102
1366
|
|
|
1367
|
+
export declare function redeemLoyaltyReward(rewardUID: string, requestId: string): Promise<RedeemResult>;
|
|
1368
|
+
|
|
1369
|
+
export declare type RedeemResult = {
|
|
1370
|
+
ok: true;
|
|
1371
|
+
code: string;
|
|
1372
|
+
promoCodeId: number;
|
|
1373
|
+
expireOn: string;
|
|
1374
|
+
costPoints: number;
|
|
1375
|
+
balance: number;
|
|
1376
|
+
replayed: boolean;
|
|
1377
|
+
};
|
|
1378
|
+
|
|
1103
1379
|
export declare function registerNewUser(user: RegisterUserType): Promise<AxiosResponse<any, any>>;
|
|
1104
1380
|
|
|
1105
1381
|
declare type RegisterUserType = {
|
|
@@ -1111,6 +1387,15 @@ declare type RegisterUserType = {
|
|
|
1111
1387
|
birthday?: string;
|
|
1112
1388
|
};
|
|
1113
1389
|
|
|
1390
|
+
export declare function saveMyBirthday(b: {
|
|
1391
|
+
day: number;
|
|
1392
|
+
month: number;
|
|
1393
|
+
year?: number | null;
|
|
1394
|
+
}): Promise<{
|
|
1395
|
+
success: boolean;
|
|
1396
|
+
birthday: string;
|
|
1397
|
+
}>;
|
|
1398
|
+
|
|
1114
1399
|
export declare interface ShopCatalogCollection {
|
|
1115
1400
|
UID: string;
|
|
1116
1401
|
collectionName: string;
|
|
@@ -1506,8 +1791,18 @@ export declare const useInvitedToOrders: (email: string, organization?: string)
|
|
|
1506
1791
|
fetchStatus: FetchStatus;
|
|
1507
1792
|
};
|
|
1508
1793
|
|
|
1794
|
+
export declare function useLoyaltyLedger(enabled?: boolean): UseQueryResult<LedgerRow[], unknown>;
|
|
1795
|
+
|
|
1796
|
+
export declare function useLoyaltyRewards(enabled?: boolean): UseQueryResult<LoyaltyRewards, unknown>;
|
|
1797
|
+
|
|
1509
1798
|
export declare const useLystechPolitiqueAndConditions: () => UseQueryResult<PolitiqueAndConditionsType[], unknown>;
|
|
1510
1799
|
|
|
1800
|
+
export declare function useMembership(): MembershipState;
|
|
1801
|
+
|
|
1802
|
+
export declare function useMyBenefits(enabled?: boolean): UseQueryResult<MyBenefits, unknown>;
|
|
1803
|
+
|
|
1804
|
+
export declare function useMyBirthday(enabled?: boolean): UseQueryResult<MyBirthday, unknown>;
|
|
1805
|
+
|
|
1511
1806
|
export declare const useOptionalLocation: () => Location_2<any>;
|
|
1512
1807
|
|
|
1513
1808
|
export declare const useOptionalNavigate: () => NavigateFunction | ((to: string | number, options?: {
|
|
@@ -1588,6 +1883,11 @@ export declare type UserSubscription = {
|
|
|
1588
1883
|
rewards?: SubscriptionReward[];
|
|
1589
1884
|
};
|
|
1590
1885
|
|
|
1886
|
+
export declare function useSectionsSession(): {
|
|
1887
|
+
cle: string | null;
|
|
1888
|
+
entetes: Record<string, string> | undefined;
|
|
1889
|
+
};
|
|
1890
|
+
|
|
1591
1891
|
export declare const useSinglePost: (slug: string, organization: string) => UseQueryResult<PostType, unknown>;
|
|
1592
1892
|
|
|
1593
1893
|
export declare const useTheme: () => ThemeContextType;
|