addio-ecomm-sdk 1.3.77 → 1.3.78
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/.vscode/settings.json +34 -34
- package/README.md +79 -79
- package/dist/index.d.ts +203 -203
- package/dist/index.js +1237 -1237
- package/dist/lib/constants/components/CreditCardInput.d.ts +11 -11
- package/dist/lib/constants/components/CreditCardInput.js +65 -65
- package/dist/lib/constants/components/Snackbar.d.ts +11 -11
- package/dist/lib/constants/components/Snackbar.js +29 -29
- package/dist/lib/constants/contexts/CartContext/CartContextProvider.d.ts +7 -7
- package/dist/lib/constants/contexts/CartContext/CartContextProvider.js +640 -640
- package/dist/lib/constants/contexts/CartContext/index.d.ts +79 -79
- package/dist/lib/constants/contexts/CartContext/index.js +47 -47
- package/dist/lib/constants/contexts/DataContext/DataContextProvider.d.ts +15 -15
- package/dist/lib/constants/contexts/DataContext/DataContextProvider.js +173 -173
- package/dist/lib/constants/contexts/DataContext/index.d.ts +47 -47
- package/dist/lib/constants/contexts/DataContext/index.js +27 -27
- package/dist/lib/constants/contexts/LogContext/LogContextProvider.d.ts +6 -6
- package/dist/lib/constants/contexts/LogContext/LogContextProvider.js +40 -40
- package/dist/lib/constants/contexts/LogContext/index.d.ts +7 -7
- package/dist/lib/constants/contexts/LogContext/index.js +7 -7
- package/dist/lib/constants/contexts/ModalContext/ModalContextProvider.d.ts +7 -7
- package/dist/lib/constants/contexts/ModalContext/ModalContextProvider.js +61 -61
- package/dist/lib/constants/contexts/ModalContext/index.d.ts +14 -14
- package/dist/lib/constants/contexts/ModalContext/index.js +16 -16
- package/dist/lib/constants/contexts/SDKContext/SDKProvider.d.ts +8 -8
- package/dist/lib/constants/contexts/SDKContext/SDKProvider.js +23 -23
- package/dist/lib/constants/contexts/SDKContext/index.d.ts +4 -4
- package/dist/lib/constants/contexts/SDKContext/index.js +4 -4
- package/dist/lib/constants/contexts/SnackbarContext/SnackbarContext.d.ts +4 -4
- package/dist/lib/constants/contexts/SnackbarContext/SnackbarContext.js +6 -6
- package/dist/lib/constants/contexts/SnackbarContext/SnackbarContextProvider.d.ts +12 -12
- package/dist/lib/constants/contexts/SnackbarContext/SnackbarContextProvider.js +38 -38
- package/dist/lib/constants/contexts/SnackbarContext/interfaces/ISnackbarContext.d.ts +19 -19
- package/dist/lib/constants/contexts/SnackbarContext/interfaces/ISnackbarContext.js +21 -21
- package/dist/lib/constants/contexts/StockNotifContext/StockNotifContextProvider.d.ts +7 -7
- package/dist/lib/constants/contexts/StockNotifContext/StockNotifContextProvider.js +112 -112
- package/dist/lib/constants/contexts/StockNotifContext/index.d.ts +10 -10
- package/dist/lib/constants/contexts/StockNotifContext/index.js +10 -10
- package/dist/lib/constants/contexts/UserContext/UserContextProvider.d.ts +5 -5
- package/dist/lib/constants/contexts/UserContext/UserContextProvider.js +313 -313
- package/dist/lib/constants/contexts/UserContext/index.d.ts +54 -54
- package/dist/lib/constants/contexts/UserContext/index.js +28 -28
- package/dist/lib/constants/contexts/WishlistContext/WishlistContextProvider.d.ts +6 -6
- package/dist/lib/constants/contexts/WishlistContext/WishlistContextProvider.js +231 -231
- package/dist/lib/constants/contexts/WishlistContext/index.d.ts +12 -12
- package/dist/lib/constants/contexts/WishlistContext/index.js +12 -12
- package/dist/lib/constants/hooks/useCart.d.ts +2 -2
- package/dist/lib/constants/hooks/useCart.js +11 -11
- package/dist/lib/constants/hooks/useData.d.ts +2 -2
- package/dist/lib/constants/hooks/useData.js +11 -11
- package/dist/lib/constants/hooks/useLogs.d.ts +2 -2
- package/dist/lib/constants/hooks/useLogs.js +11 -11
- package/dist/lib/constants/hooks/useModal.d.ts +2 -2
- package/dist/lib/constants/hooks/useModal.js +11 -11
- package/dist/lib/constants/hooks/useSDK.d.ts +2 -2
- package/dist/lib/constants/hooks/useSDK.js +11 -11
- package/dist/lib/constants/hooks/useSnackbar.d.ts +2 -2
- package/dist/lib/constants/hooks/useSnackbar.js +11 -11
- package/dist/lib/constants/hooks/useStockNotif.d.ts +2 -2
- package/dist/lib/constants/hooks/useStockNotif.js +11 -11
- package/dist/lib/constants/hooks/useUser.d.ts +2 -2
- package/dist/lib/constants/hooks/useUser.js +11 -11
- package/dist/lib/constants/hooks/useWishlist.d.ts +2 -2
- package/dist/lib/constants/hooks/useWishlist.js +11 -11
- package/dist/lib/models/image/index.d.ts +6 -6
- package/dist/lib/models/image/index.js +10 -10
- package/dist/lib/models/stockNotification/index.d.ts +13 -13
- package/dist/lib/models/stockNotification/index.js +70 -70
- package/dist/lib/models/wishlist/index.d.ts +14 -14
- package/dist/lib/models/wishlist/index.js +86 -86
- package/dist/utils/StripeErrors.d.ts +24 -24
- package/dist/utils/StripeErrors.js +55 -55
- package/dist/utils/algolia.d.ts +3 -3
- package/dist/utils/algolia.js +35 -35
- package/dist/utils/analytics.d.ts +71 -71
- package/dist/utils/analytics.js +246 -246
- package/dist/utils/cart.d.ts +3 -3
- package/dist/utils/cart.js +65 -65
- package/dist/utils/contentful.d.ts +10 -10
- package/dist/utils/contentful.js +63 -63
- package/dist/utils/functions.d.ts +21 -21
- package/dist/utils/functions.js +183 -183
- package/dist/utils/getSDK.d.ts +4 -4
- package/dist/utils/getSDK.js +19 -19
- package/dist/utils/initStoreData.d.ts +3 -3
- package/dist/utils/initStoreData.js +17 -17
- package/dist/utils/interfaces/IClientCMSData.d.ts +132 -132
- package/dist/utils/interfaces/IClientCMSData.js +2 -2
- package/dist/utils/interfaces/IEndpointResult.d.ts +10 -10
- package/dist/utils/interfaces/IEndpointResult.js +2 -2
- package/dist/utils/interfaces/IFacebookUserProfile.d.ts +10 -10
- package/dist/utils/interfaces/IFacebookUserProfile.js +2 -2
- package/dist/utils/interfaces/IFilter.d.ts +23 -23
- package/dist/utils/interfaces/IFilter.js +2 -2
- package/dist/utils/interfaces/IGoogleUserProfile.d.ts +7 -7
- package/dist/utils/interfaces/IGoogleUserProfile.js +2 -2
- package/dist/utils/interfaces/ISDKConfig.d.ts +7 -7
- package/dist/utils/interfaces/ISDKConfig.js +2 -2
- package/dist/utils/interfaces/ISpaceData.d.ts +18 -18
- package/dist/utils/interfaces/ISpaceData.js +2 -2
- package/dist/utils/larivieremeunier.d.ts +3 -3
- package/dist/utils/larivieremeunier.js +156 -156
- package/dist/utils/technosupply.d.ts +3 -3
- package/dist/utils/technosupply.js +155 -155
- package/package.json +61 -61
- package/publish.sh +132 -132
|
@@ -1,87 +1,87 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
class Wishlist {
|
|
4
|
-
constructor(wishlist, apiUrl, token, userToken, setUserToken) {
|
|
5
|
-
this.setUserToken = (token) => {
|
|
6
|
-
this._userToken = token;
|
|
7
|
-
};
|
|
8
|
-
this.data = () => this._wishlist;
|
|
9
|
-
this.getFromDatabase = async (wishlist) => {
|
|
10
|
-
let request;
|
|
11
|
-
request = await fetch(`${this._apiUrl}/wishlist`, {
|
|
12
|
-
method: 'POST',
|
|
13
|
-
headers: {
|
|
14
|
-
Authorization: `Bearer ${this._token}`,
|
|
15
|
-
'Content-Type': 'application/json',
|
|
16
|
-
'x-gng-ecomm-token': this._userToken
|
|
17
|
-
},
|
|
18
|
-
body: JSON.stringify(wishlist)
|
|
19
|
-
});
|
|
20
|
-
if (!!!request)
|
|
21
|
-
return;
|
|
22
|
-
const responseData = await request.json();
|
|
23
|
-
if (responseData.status != 200) {
|
|
24
|
-
throw new Error('Impossible de fetch la wishlist: ' + responseData.error);
|
|
25
|
-
}
|
|
26
|
-
if (responseData.token) {
|
|
27
|
-
this._setUserToken(responseData.token);
|
|
28
|
-
}
|
|
29
|
-
const dbWishlist = responseData.data;
|
|
30
|
-
this._wishlist = dbWishlist;
|
|
31
|
-
return this;
|
|
32
|
-
};
|
|
33
|
-
this.saveToDatabase = async (newWishlist) => {
|
|
34
|
-
const wishlistData = this.data();
|
|
35
|
-
if (!!!wishlistData)
|
|
36
|
-
return;
|
|
37
|
-
if (!!!wishlistData.id)
|
|
38
|
-
return;
|
|
39
|
-
try {
|
|
40
|
-
const request = await fetch(`${this._apiUrl}/wishlists/${wishlistData.id}/save`, {
|
|
41
|
-
method: 'POST',
|
|
42
|
-
headers: {
|
|
43
|
-
Authorization: `Bearer ${this._token}`,
|
|
44
|
-
'Content-Type': 'application/json',
|
|
45
|
-
'x-gng-ecomm-token': this._userToken
|
|
46
|
-
},
|
|
47
|
-
body: JSON.stringify(newWishlist)
|
|
48
|
-
});
|
|
49
|
-
if (!!!request)
|
|
50
|
-
return;
|
|
51
|
-
const responseData = await request.json();
|
|
52
|
-
if (responseData.status != 200) {
|
|
53
|
-
throw new Error('Impossible de fetch la wishlist: ' + responseData.error);
|
|
54
|
-
}
|
|
55
|
-
if (responseData.token) {
|
|
56
|
-
this._setUserToken(responseData.token);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
catch (err) {
|
|
60
|
-
console.log(err);
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
this.clear = async () => {
|
|
64
|
-
try {
|
|
65
|
-
const res = await fetch(`${this._apiUrl}/wishlists`, {
|
|
66
|
-
method: 'DELETE',
|
|
67
|
-
headers: {
|
|
68
|
-
authorization: `Bearer ${this._token}`,
|
|
69
|
-
'Content-Type': 'application/json',
|
|
70
|
-
'x-gng-ecomm-token': this._userToken || localStorage.getItem('userToken') || ''
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
return await res.json();
|
|
74
|
-
}
|
|
75
|
-
catch (error) {
|
|
76
|
-
throw error;
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
this._wishlist = wishlist;
|
|
80
|
-
this._apiUrl = apiUrl;
|
|
81
|
-
this._token = token;
|
|
82
|
-
this._userToken = userToken;
|
|
83
|
-
this._setUserToken = setUserToken;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
exports.default = Wishlist;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
class Wishlist {
|
|
4
|
+
constructor(wishlist, apiUrl, token, userToken, setUserToken) {
|
|
5
|
+
this.setUserToken = (token) => {
|
|
6
|
+
this._userToken = token;
|
|
7
|
+
};
|
|
8
|
+
this.data = () => this._wishlist;
|
|
9
|
+
this.getFromDatabase = async (wishlist) => {
|
|
10
|
+
let request;
|
|
11
|
+
request = await fetch(`${this._apiUrl}/wishlist`, {
|
|
12
|
+
method: 'POST',
|
|
13
|
+
headers: {
|
|
14
|
+
Authorization: `Bearer ${this._token}`,
|
|
15
|
+
'Content-Type': 'application/json',
|
|
16
|
+
'x-gng-ecomm-token': this._userToken
|
|
17
|
+
},
|
|
18
|
+
body: JSON.stringify(wishlist)
|
|
19
|
+
});
|
|
20
|
+
if (!!!request)
|
|
21
|
+
return;
|
|
22
|
+
const responseData = await request.json();
|
|
23
|
+
if (responseData.status != 200) {
|
|
24
|
+
throw new Error('Impossible de fetch la wishlist: ' + responseData.error);
|
|
25
|
+
}
|
|
26
|
+
if (responseData.token) {
|
|
27
|
+
this._setUserToken(responseData.token);
|
|
28
|
+
}
|
|
29
|
+
const dbWishlist = responseData.data;
|
|
30
|
+
this._wishlist = dbWishlist;
|
|
31
|
+
return this;
|
|
32
|
+
};
|
|
33
|
+
this.saveToDatabase = async (newWishlist) => {
|
|
34
|
+
const wishlistData = this.data();
|
|
35
|
+
if (!!!wishlistData)
|
|
36
|
+
return;
|
|
37
|
+
if (!!!wishlistData.id)
|
|
38
|
+
return;
|
|
39
|
+
try {
|
|
40
|
+
const request = await fetch(`${this._apiUrl}/wishlists/${wishlistData.id}/save`, {
|
|
41
|
+
method: 'POST',
|
|
42
|
+
headers: {
|
|
43
|
+
Authorization: `Bearer ${this._token}`,
|
|
44
|
+
'Content-Type': 'application/json',
|
|
45
|
+
'x-gng-ecomm-token': this._userToken
|
|
46
|
+
},
|
|
47
|
+
body: JSON.stringify(newWishlist)
|
|
48
|
+
});
|
|
49
|
+
if (!!!request)
|
|
50
|
+
return;
|
|
51
|
+
const responseData = await request.json();
|
|
52
|
+
if (responseData.status != 200) {
|
|
53
|
+
throw new Error('Impossible de fetch la wishlist: ' + responseData.error);
|
|
54
|
+
}
|
|
55
|
+
if (responseData.token) {
|
|
56
|
+
this._setUserToken(responseData.token);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
catch (err) {
|
|
60
|
+
console.log(err);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
this.clear = async () => {
|
|
64
|
+
try {
|
|
65
|
+
const res = await fetch(`${this._apiUrl}/wishlists`, {
|
|
66
|
+
method: 'DELETE',
|
|
67
|
+
headers: {
|
|
68
|
+
authorization: `Bearer ${this._token}`,
|
|
69
|
+
'Content-Type': 'application/json',
|
|
70
|
+
'x-gng-ecomm-token': this._userToken || localStorage.getItem('userToken') || ''
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
return await res.json();
|
|
74
|
+
}
|
|
75
|
+
catch (error) {
|
|
76
|
+
throw error;
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
this._wishlist = wishlist;
|
|
80
|
+
this._apiUrl = apiUrl;
|
|
81
|
+
this._token = token;
|
|
82
|
+
this._userToken = userToken;
|
|
83
|
+
this._setUserToken = setUserToken;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
exports.default = Wishlist;
|
|
87
87
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import ILang from 'addio-admin-sdk/dist/utils/string';
|
|
2
|
-
export interface IStripErrors {
|
|
3
|
-
readonly [key: string]: ILang | ICardDeclined;
|
|
4
|
-
readonly incorrect_zip: ILang;
|
|
5
|
-
readonly incomplete_cvc: ILang;
|
|
6
|
-
readonly incorrect_cvc: ILang;
|
|
7
|
-
readonly incomplete_expiry: ILang;
|
|
8
|
-
readonly incomplete_number: ILang;
|
|
9
|
-
readonly expired_card: ILang;
|
|
10
|
-
readonly processing_error: ILang;
|
|
11
|
-
readonly incorrect_number: ILang;
|
|
12
|
-
readonly invalid_number: ILang;
|
|
13
|
-
readonly card_declined: ICardDeclined;
|
|
14
|
-
}
|
|
15
|
-
export interface ICardDeclined {
|
|
16
|
-
readonly [key: string]: ILang;
|
|
17
|
-
readonly generic_decline: ILang;
|
|
18
|
-
readonly insufficient_funds: ILang;
|
|
19
|
-
readonly lost_card: ILang;
|
|
20
|
-
readonly stolen_card: ILang;
|
|
21
|
-
}
|
|
22
|
-
export declare const CardDeclined: ICardDeclined;
|
|
23
|
-
declare const _default: IStripErrors;
|
|
24
|
-
export default _default;
|
|
1
|
+
import ILang from 'addio-admin-sdk/dist/utils/string';
|
|
2
|
+
export interface IStripErrors {
|
|
3
|
+
readonly [key: string]: ILang | ICardDeclined;
|
|
4
|
+
readonly incorrect_zip: ILang;
|
|
5
|
+
readonly incomplete_cvc: ILang;
|
|
6
|
+
readonly incorrect_cvc: ILang;
|
|
7
|
+
readonly incomplete_expiry: ILang;
|
|
8
|
+
readonly incomplete_number: ILang;
|
|
9
|
+
readonly expired_card: ILang;
|
|
10
|
+
readonly processing_error: ILang;
|
|
11
|
+
readonly incorrect_number: ILang;
|
|
12
|
+
readonly invalid_number: ILang;
|
|
13
|
+
readonly card_declined: ICardDeclined;
|
|
14
|
+
}
|
|
15
|
+
export interface ICardDeclined {
|
|
16
|
+
readonly [key: string]: ILang;
|
|
17
|
+
readonly generic_decline: ILang;
|
|
18
|
+
readonly insufficient_funds: ILang;
|
|
19
|
+
readonly lost_card: ILang;
|
|
20
|
+
readonly stolen_card: ILang;
|
|
21
|
+
}
|
|
22
|
+
export declare const CardDeclined: ICardDeclined;
|
|
23
|
+
declare const _default: IStripErrors;
|
|
24
|
+
export default _default;
|
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CardDeclined = void 0;
|
|
4
|
-
exports.CardDeclined = {
|
|
5
|
-
generic_decline: {
|
|
6
|
-
fr: 'Votre carte a été refusée.',
|
|
7
|
-
en: 'Your card was declined.'
|
|
8
|
-
},
|
|
9
|
-
insufficient_funds: {
|
|
10
|
-
fr: 'Votre carte ne dispose pas de fonds suffisants.',
|
|
11
|
-
en: 'Your card has insufficient funds.'
|
|
12
|
-
},
|
|
13
|
-
lost_card: {
|
|
14
|
-
fr: 'Votre carte a été déclarée perdue. Veuillez contacter votre service de carte de crédit.',
|
|
15
|
-
en: 'Your card has been declared lost. Please contact your credit card department.'
|
|
16
|
-
},
|
|
17
|
-
stolen_card: {
|
|
18
|
-
fr: 'Votre carte a été déclarée volée. Veuillez contacter votre service de carte de crédit.',
|
|
19
|
-
en: 'Your card has been declared stolen. Please contact your credit card department'
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
exports.default = {
|
|
23
|
-
incomplete_cvc: { fr: 'Le code de sécurité de votre carte est incomplet.', en: 'The security code is incomplete.' },
|
|
24
|
-
incorrect_cvc: { fr: 'Le code de sécurité de votre carte est incorrect.', en: 'The security code is incorrect.' },
|
|
25
|
-
incomplete_zip: { fr: 'Votre code postal est incomplet.', en: 'Your postal code is incomplete.' },
|
|
26
|
-
incorrect_zip: {
|
|
27
|
-
fr: 'Votre numéro de carte et votre code postal ne correspondent pas.',
|
|
28
|
-
en: 'Your card number and your postal code do not match.'
|
|
29
|
-
},
|
|
30
|
-
incomplete_expiry: {
|
|
31
|
-
fr: "La date d'expiration de votre carte est incomplète.",
|
|
32
|
-
en: "Your card's expiration date is incomplete."
|
|
33
|
-
},
|
|
34
|
-
incomplete_number: {
|
|
35
|
-
fr: 'Votre numéro de carte est incomplet.',
|
|
36
|
-
en: "Your card's number is incomplete"
|
|
37
|
-
},
|
|
38
|
-
invalid_number: {
|
|
39
|
-
fr: "Votre numéro de carte n'est pas valide.",
|
|
40
|
-
en: "Your card's number is invalid."
|
|
41
|
-
},
|
|
42
|
-
expired_card: {
|
|
43
|
-
fr: 'Votre carte a expiré.',
|
|
44
|
-
en: 'Your card has expired.'
|
|
45
|
-
},
|
|
46
|
-
processing_error: {
|
|
47
|
-
fr: 'Une erreur est survenue lors du traitement de votre carte. Merci de réessayer ultérieurement.',
|
|
48
|
-
en: 'An error occurred while processing your card. Please try again later.'
|
|
49
|
-
},
|
|
50
|
-
incorrect_number: {
|
|
51
|
-
fr: 'Votre numéro de carte est incorrecte.',
|
|
52
|
-
en: "Your card's number is incorrect"
|
|
53
|
-
},
|
|
54
|
-
card_declined: exports.CardDeclined
|
|
55
|
-
};
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CardDeclined = void 0;
|
|
4
|
+
exports.CardDeclined = {
|
|
5
|
+
generic_decline: {
|
|
6
|
+
fr: 'Votre carte a été refusée.',
|
|
7
|
+
en: 'Your card was declined.'
|
|
8
|
+
},
|
|
9
|
+
insufficient_funds: {
|
|
10
|
+
fr: 'Votre carte ne dispose pas de fonds suffisants.',
|
|
11
|
+
en: 'Your card has insufficient funds.'
|
|
12
|
+
},
|
|
13
|
+
lost_card: {
|
|
14
|
+
fr: 'Votre carte a été déclarée perdue. Veuillez contacter votre service de carte de crédit.',
|
|
15
|
+
en: 'Your card has been declared lost. Please contact your credit card department.'
|
|
16
|
+
},
|
|
17
|
+
stolen_card: {
|
|
18
|
+
fr: 'Votre carte a été déclarée volée. Veuillez contacter votre service de carte de crédit.',
|
|
19
|
+
en: 'Your card has been declared stolen. Please contact your credit card department'
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
exports.default = {
|
|
23
|
+
incomplete_cvc: { fr: 'Le code de sécurité de votre carte est incomplet.', en: 'The security code is incomplete.' },
|
|
24
|
+
incorrect_cvc: { fr: 'Le code de sécurité de votre carte est incorrect.', en: 'The security code is incorrect.' },
|
|
25
|
+
incomplete_zip: { fr: 'Votre code postal est incomplet.', en: 'Your postal code is incomplete.' },
|
|
26
|
+
incorrect_zip: {
|
|
27
|
+
fr: 'Votre numéro de carte et votre code postal ne correspondent pas.',
|
|
28
|
+
en: 'Your card number and your postal code do not match.'
|
|
29
|
+
},
|
|
30
|
+
incomplete_expiry: {
|
|
31
|
+
fr: "La date d'expiration de votre carte est incomplète.",
|
|
32
|
+
en: "Your card's expiration date is incomplete."
|
|
33
|
+
},
|
|
34
|
+
incomplete_number: {
|
|
35
|
+
fr: 'Votre numéro de carte est incomplet.',
|
|
36
|
+
en: "Your card's number is incomplete"
|
|
37
|
+
},
|
|
38
|
+
invalid_number: {
|
|
39
|
+
fr: "Votre numéro de carte n'est pas valide.",
|
|
40
|
+
en: "Your card's number is invalid."
|
|
41
|
+
},
|
|
42
|
+
expired_card: {
|
|
43
|
+
fr: 'Votre carte a expiré.',
|
|
44
|
+
en: 'Your card has expired.'
|
|
45
|
+
},
|
|
46
|
+
processing_error: {
|
|
47
|
+
fr: 'Une erreur est survenue lors du traitement de votre carte. Merci de réessayer ultérieurement.',
|
|
48
|
+
en: 'An error occurred while processing your card. Please try again later.'
|
|
49
|
+
},
|
|
50
|
+
incorrect_number: {
|
|
51
|
+
fr: 'Votre numéro de carte est incorrecte.',
|
|
52
|
+
en: "Your card's number is incorrect"
|
|
53
|
+
},
|
|
54
|
+
card_declined: exports.CardDeclined
|
|
55
|
+
};
|
|
56
56
|
//# sourceMappingURL=StripeErrors.js.map
|
package/dist/utils/algolia.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Hit } from '@algolia/client-search';
|
|
2
|
-
import { IIndexedProductAlgolia } from 'addio-admin-sdk/dist/Interfaces/Algolia';
|
|
3
|
-
export declare const fetchProducts: (api: string, app: string, slugs: string[], useProspr?: boolean) => Promise<Hit<IIndexedProductAlgolia>[]>;
|
|
1
|
+
import { Hit } from '@algolia/client-search';
|
|
2
|
+
import { IIndexedProductAlgolia } from 'addio-admin-sdk/dist/Interfaces/Algolia';
|
|
3
|
+
export declare const fetchProducts: (api: string, app: string, slugs: string[], useProspr?: boolean) => Promise<Hit<IIndexedProductAlgolia>[]>;
|
package/dist/utils/algolia.js
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.fetchProducts = void 0;
|
|
7
|
-
const Product_1 = __importDefault(require("addio-admin-sdk/dist/lib/Product"));
|
|
8
|
-
const fetchProducts = async (api, app, slugs, useProspr) => {
|
|
9
|
-
const filterConditions = slugs.map((slug) => {
|
|
10
|
-
return `(product_parent_slug:${slug})`;
|
|
11
|
-
});
|
|
12
|
-
const filtering = {
|
|
13
|
-
api: api,
|
|
14
|
-
app: app,
|
|
15
|
-
filters: '',
|
|
16
|
-
hpp: slugs.length,
|
|
17
|
-
page: 0,
|
|
18
|
-
query: '',
|
|
19
|
-
indice: 'products',
|
|
20
|
-
f: filterConditions.join(' OR '),
|
|
21
|
-
useProspr: !!useProspr,
|
|
22
|
-
space: undefined
|
|
23
|
-
};
|
|
24
|
-
try {
|
|
25
|
-
const products = await Product_1.default.fetch(filtering);
|
|
26
|
-
if (!!!products || !!!products.hits || !!!products.hits.length)
|
|
27
|
-
return [];
|
|
28
|
-
return products.hits;
|
|
29
|
-
}
|
|
30
|
-
catch (error) {
|
|
31
|
-
console.log('error when fetching products', error);
|
|
32
|
-
}
|
|
33
|
-
return [];
|
|
34
|
-
};
|
|
35
|
-
exports.fetchProducts = fetchProducts;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.fetchProducts = void 0;
|
|
7
|
+
const Product_1 = __importDefault(require("addio-admin-sdk/dist/lib/Product"));
|
|
8
|
+
const fetchProducts = async (api, app, slugs, useProspr) => {
|
|
9
|
+
const filterConditions = slugs.map((slug) => {
|
|
10
|
+
return `(product_parent_slug:${slug})`;
|
|
11
|
+
});
|
|
12
|
+
const filtering = {
|
|
13
|
+
api: api,
|
|
14
|
+
app: app,
|
|
15
|
+
filters: '',
|
|
16
|
+
hpp: slugs.length,
|
|
17
|
+
page: 0,
|
|
18
|
+
query: '',
|
|
19
|
+
indice: 'products',
|
|
20
|
+
f: filterConditions.join(' OR '),
|
|
21
|
+
useProspr: !!useProspr,
|
|
22
|
+
space: undefined
|
|
23
|
+
};
|
|
24
|
+
try {
|
|
25
|
+
const products = await Product_1.default.fetch(filtering);
|
|
26
|
+
if (!!!products || !!!products.hits || !!!products.hits.length)
|
|
27
|
+
return [];
|
|
28
|
+
return products.hits;
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
console.log('error when fetching products', error);
|
|
32
|
+
}
|
|
33
|
+
return [];
|
|
34
|
+
};
|
|
35
|
+
exports.fetchProducts = fetchProducts;
|
|
36
36
|
//# sourceMappingURL=algolia.js.map
|
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
import { DataLayerArgs, TagManagerArgs } from 'react-gtm-module';
|
|
2
|
-
import ICart, { ICartItem } from 'addio-admin-sdk/dist/Interfaces/Cart';
|
|
3
|
-
import IIndexedProduct from 'addio-admin-sdk/dist/Interfaces/Indexed/Product';
|
|
4
|
-
export interface ITagManager {
|
|
5
|
-
readonly dataLayer: (dataLayerArgs: DataLayerArgs) => void;
|
|
6
|
-
readonly initialize: (tagManagerArgs: TagManagerArgs) => void;
|
|
7
|
-
}
|
|
8
|
-
export declare const sendFormSubmitEventToAnalytics: (form_id: string) => void;
|
|
9
|
-
export declare const addPurchaseToAnalytics: (cart: ICart, TagManager: ITagManager) => void;
|
|
10
|
-
export declare const addCheckoutStepsToAnalytics: (cart: ICart, TagManager: ITagManager, step: number, option?: string) => void;
|
|
11
|
-
export declare const addPurchaseToAnalytics_GA4: (cart: ICart, TagManager: ITagManager) => void;
|
|
12
|
-
export declare const addLoggedCustomerToAnalytics_GA4: (userType: 'pro' | 'connected', TagManager: ITagManager, userID: string, clerkID?: string | undefined) => void;
|
|
13
|
-
export declare const addCheckoutStepsToAnalytics_GA4: (cart: ICart, TagManager: ITagManager, event: string) => void;
|
|
14
|
-
export declare const getCheckoutData: (event: string, cart: ICart) => {
|
|
15
|
-
items: {
|
|
16
|
-
item_variant: string;
|
|
17
|
-
price: number;
|
|
18
|
-
quantity: number;
|
|
19
|
-
item_category2?: string | undefined;
|
|
20
|
-
index: number;
|
|
21
|
-
item_brand: string;
|
|
22
|
-
item_category: string;
|
|
23
|
-
discount?: number | undefined;
|
|
24
|
-
item_id: string;
|
|
25
|
-
item_name: string;
|
|
26
|
-
currency: string;
|
|
27
|
-
}[];
|
|
28
|
-
coupon?: import("addio-admin-sdk/dist/Interfaces/Cart").ICartPromoApplied | undefined;
|
|
29
|
-
currency: string;
|
|
30
|
-
value: number;
|
|
31
|
-
} | {
|
|
32
|
-
shipping_tier: string;
|
|
33
|
-
items: {
|
|
34
|
-
item_variant: string;
|
|
35
|
-
price: number;
|
|
36
|
-
quantity: number;
|
|
37
|
-
item_category2?: string | undefined;
|
|
38
|
-
index: number;
|
|
39
|
-
item_brand: string;
|
|
40
|
-
item_category: string;
|
|
41
|
-
discount?: number | undefined;
|
|
42
|
-
item_id: string;
|
|
43
|
-
item_name: string;
|
|
44
|
-
currency: string;
|
|
45
|
-
}[];
|
|
46
|
-
coupon?: import("addio-admin-sdk/dist/Interfaces/Cart").ICartPromoApplied | undefined;
|
|
47
|
-
currency: string;
|
|
48
|
-
value: number;
|
|
49
|
-
} | {
|
|
50
|
-
payment_type: string;
|
|
51
|
-
items: {
|
|
52
|
-
item_variant: string;
|
|
53
|
-
price: number;
|
|
54
|
-
quantity: number;
|
|
55
|
-
item_category2?: string | undefined;
|
|
56
|
-
index: number;
|
|
57
|
-
item_brand: string;
|
|
58
|
-
item_category: string;
|
|
59
|
-
discount?: number | undefined;
|
|
60
|
-
item_id: string;
|
|
61
|
-
item_name: string;
|
|
62
|
-
currency: string;
|
|
63
|
-
}[];
|
|
64
|
-
coupon?: import("addio-admin-sdk/dist/Interfaces/Cart").ICartPromoApplied | undefined;
|
|
65
|
-
currency: string;
|
|
66
|
-
value: number;
|
|
67
|
-
} | undefined;
|
|
68
|
-
export declare const addPurchaseToAnalytics_GT4: (cart: ICart) => void;
|
|
69
|
-
export declare const addAddToBasketToAnalytics_GT4: (item: ICartItem | ICartItem[], locale: string) => void;
|
|
70
|
-
export declare const addProductPageToAnalytics_GT4: (product: IIndexedProduct, locale: string) => void;
|
|
71
|
-
export declare const addToDataLayer_GT4: (data: any) => void;
|
|
1
|
+
import { DataLayerArgs, TagManagerArgs } from 'react-gtm-module';
|
|
2
|
+
import ICart, { ICartItem } from 'addio-admin-sdk/dist/Interfaces/Cart';
|
|
3
|
+
import IIndexedProduct from 'addio-admin-sdk/dist/Interfaces/Indexed/Product';
|
|
4
|
+
export interface ITagManager {
|
|
5
|
+
readonly dataLayer: (dataLayerArgs: DataLayerArgs) => void;
|
|
6
|
+
readonly initialize: (tagManagerArgs: TagManagerArgs) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const sendFormSubmitEventToAnalytics: (form_id: string) => void;
|
|
9
|
+
export declare const addPurchaseToAnalytics: (cart: ICart, TagManager: ITagManager) => void;
|
|
10
|
+
export declare const addCheckoutStepsToAnalytics: (cart: ICart, TagManager: ITagManager, step: number, option?: string) => void;
|
|
11
|
+
export declare const addPurchaseToAnalytics_GA4: (cart: ICart, TagManager: ITagManager) => void;
|
|
12
|
+
export declare const addLoggedCustomerToAnalytics_GA4: (userType: 'pro' | 'connected', TagManager: ITagManager, userID: string, clerkID?: string | undefined) => void;
|
|
13
|
+
export declare const addCheckoutStepsToAnalytics_GA4: (cart: ICart, TagManager: ITagManager, event: string) => void;
|
|
14
|
+
export declare const getCheckoutData: (event: string, cart: ICart) => {
|
|
15
|
+
items: {
|
|
16
|
+
item_variant: string;
|
|
17
|
+
price: number;
|
|
18
|
+
quantity: number;
|
|
19
|
+
item_category2?: string | undefined;
|
|
20
|
+
index: number;
|
|
21
|
+
item_brand: string;
|
|
22
|
+
item_category: string;
|
|
23
|
+
discount?: number | undefined;
|
|
24
|
+
item_id: string;
|
|
25
|
+
item_name: string;
|
|
26
|
+
currency: string;
|
|
27
|
+
}[];
|
|
28
|
+
coupon?: import("addio-admin-sdk/dist/Interfaces/Cart").ICartPromoApplied | undefined;
|
|
29
|
+
currency: string;
|
|
30
|
+
value: number;
|
|
31
|
+
} | {
|
|
32
|
+
shipping_tier: string;
|
|
33
|
+
items: {
|
|
34
|
+
item_variant: string;
|
|
35
|
+
price: number;
|
|
36
|
+
quantity: number;
|
|
37
|
+
item_category2?: string | undefined;
|
|
38
|
+
index: number;
|
|
39
|
+
item_brand: string;
|
|
40
|
+
item_category: string;
|
|
41
|
+
discount?: number | undefined;
|
|
42
|
+
item_id: string;
|
|
43
|
+
item_name: string;
|
|
44
|
+
currency: string;
|
|
45
|
+
}[];
|
|
46
|
+
coupon?: import("addio-admin-sdk/dist/Interfaces/Cart").ICartPromoApplied | undefined;
|
|
47
|
+
currency: string;
|
|
48
|
+
value: number;
|
|
49
|
+
} | {
|
|
50
|
+
payment_type: string;
|
|
51
|
+
items: {
|
|
52
|
+
item_variant: string;
|
|
53
|
+
price: number;
|
|
54
|
+
quantity: number;
|
|
55
|
+
item_category2?: string | undefined;
|
|
56
|
+
index: number;
|
|
57
|
+
item_brand: string;
|
|
58
|
+
item_category: string;
|
|
59
|
+
discount?: number | undefined;
|
|
60
|
+
item_id: string;
|
|
61
|
+
item_name: string;
|
|
62
|
+
currency: string;
|
|
63
|
+
}[];
|
|
64
|
+
coupon?: import("addio-admin-sdk/dist/Interfaces/Cart").ICartPromoApplied | undefined;
|
|
65
|
+
currency: string;
|
|
66
|
+
value: number;
|
|
67
|
+
} | undefined;
|
|
68
|
+
export declare const addPurchaseToAnalytics_GT4: (cart: ICart) => void;
|
|
69
|
+
export declare const addAddToBasketToAnalytics_GT4: (item: ICartItem | ICartItem[], locale: string) => void;
|
|
70
|
+
export declare const addProductPageToAnalytics_GT4: (product: IIndexedProduct, locale: string) => void;
|
|
71
|
+
export declare const addToDataLayer_GT4: (data: any) => void;
|