addio-ecomm-sdk 1.3.78 → 1.3.79

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.
Files changed (107) hide show
  1. package/.vscode/settings.json +34 -34
  2. package/README.md +79 -79
  3. package/dist/index.d.ts +203 -203
  4. package/dist/index.js +1237 -1237
  5. package/dist/lib/constants/components/CreditCardInput.d.ts +11 -11
  6. package/dist/lib/constants/components/CreditCardInput.js +65 -65
  7. package/dist/lib/constants/components/Snackbar.d.ts +11 -11
  8. package/dist/lib/constants/components/Snackbar.js +29 -29
  9. package/dist/lib/constants/contexts/CartContext/CartContextProvider.d.ts +7 -7
  10. package/dist/lib/constants/contexts/CartContext/CartContextProvider.js +640 -640
  11. package/dist/lib/constants/contexts/CartContext/CartContextProvider.js.map +1 -1
  12. package/dist/lib/constants/contexts/CartContext/index.d.ts +79 -79
  13. package/dist/lib/constants/contexts/CartContext/index.js +47 -47
  14. package/dist/lib/constants/contexts/DataContext/DataContextProvider.d.ts +15 -15
  15. package/dist/lib/constants/contexts/DataContext/DataContextProvider.js +173 -173
  16. package/dist/lib/constants/contexts/DataContext/index.d.ts +47 -47
  17. package/dist/lib/constants/contexts/DataContext/index.js +27 -27
  18. package/dist/lib/constants/contexts/LogContext/LogContextProvider.d.ts +6 -6
  19. package/dist/lib/constants/contexts/LogContext/LogContextProvider.js +40 -40
  20. package/dist/lib/constants/contexts/LogContext/index.d.ts +7 -7
  21. package/dist/lib/constants/contexts/LogContext/index.js +7 -7
  22. package/dist/lib/constants/contexts/ModalContext/ModalContextProvider.d.ts +7 -7
  23. package/dist/lib/constants/contexts/ModalContext/ModalContextProvider.js +61 -61
  24. package/dist/lib/constants/contexts/ModalContext/index.d.ts +14 -14
  25. package/dist/lib/constants/contexts/ModalContext/index.js +16 -16
  26. package/dist/lib/constants/contexts/SDKContext/SDKProvider.d.ts +8 -8
  27. package/dist/lib/constants/contexts/SDKContext/SDKProvider.js +23 -23
  28. package/dist/lib/constants/contexts/SDKContext/index.d.ts +4 -4
  29. package/dist/lib/constants/contexts/SDKContext/index.js +4 -4
  30. package/dist/lib/constants/contexts/SnackbarContext/SnackbarContext.d.ts +4 -4
  31. package/dist/lib/constants/contexts/SnackbarContext/SnackbarContext.js +6 -6
  32. package/dist/lib/constants/contexts/SnackbarContext/SnackbarContextProvider.d.ts +12 -12
  33. package/dist/lib/constants/contexts/SnackbarContext/SnackbarContextProvider.js +38 -38
  34. package/dist/lib/constants/contexts/SnackbarContext/interfaces/ISnackbarContext.d.ts +19 -19
  35. package/dist/lib/constants/contexts/SnackbarContext/interfaces/ISnackbarContext.js +21 -21
  36. package/dist/lib/constants/contexts/StockNotifContext/StockNotifContextProvider.d.ts +7 -7
  37. package/dist/lib/constants/contexts/StockNotifContext/StockNotifContextProvider.js +112 -112
  38. package/dist/lib/constants/contexts/StockNotifContext/index.d.ts +10 -10
  39. package/dist/lib/constants/contexts/StockNotifContext/index.js +10 -10
  40. package/dist/lib/constants/contexts/UserContext/UserContextProvider.d.ts +5 -5
  41. package/dist/lib/constants/contexts/UserContext/UserContextProvider.js +313 -313
  42. package/dist/lib/constants/contexts/UserContext/index.d.ts +54 -54
  43. package/dist/lib/constants/contexts/UserContext/index.js +28 -28
  44. package/dist/lib/constants/contexts/WishlistContext/WishlistContextProvider.d.ts +6 -6
  45. package/dist/lib/constants/contexts/WishlistContext/WishlistContextProvider.js +231 -231
  46. package/dist/lib/constants/contexts/WishlistContext/index.d.ts +12 -12
  47. package/dist/lib/constants/contexts/WishlistContext/index.js +12 -12
  48. package/dist/lib/constants/hooks/useCart.d.ts +2 -2
  49. package/dist/lib/constants/hooks/useCart.js +11 -11
  50. package/dist/lib/constants/hooks/useData.d.ts +2 -2
  51. package/dist/lib/constants/hooks/useData.js +11 -11
  52. package/dist/lib/constants/hooks/useLogs.d.ts +2 -2
  53. package/dist/lib/constants/hooks/useLogs.js +11 -11
  54. package/dist/lib/constants/hooks/useModal.d.ts +2 -2
  55. package/dist/lib/constants/hooks/useModal.js +11 -11
  56. package/dist/lib/constants/hooks/useSDK.d.ts +2 -2
  57. package/dist/lib/constants/hooks/useSDK.js +11 -11
  58. package/dist/lib/constants/hooks/useSnackbar.d.ts +2 -2
  59. package/dist/lib/constants/hooks/useSnackbar.js +11 -11
  60. package/dist/lib/constants/hooks/useStockNotif.d.ts +2 -2
  61. package/dist/lib/constants/hooks/useStockNotif.js +11 -11
  62. package/dist/lib/constants/hooks/useUser.d.ts +2 -2
  63. package/dist/lib/constants/hooks/useUser.js +11 -11
  64. package/dist/lib/constants/hooks/useWishlist.d.ts +2 -2
  65. package/dist/lib/constants/hooks/useWishlist.js +11 -11
  66. package/dist/lib/models/image/index.d.ts +6 -6
  67. package/dist/lib/models/image/index.js +10 -10
  68. package/dist/lib/models/stockNotification/index.d.ts +13 -13
  69. package/dist/lib/models/stockNotification/index.js +70 -70
  70. package/dist/lib/models/wishlist/index.d.ts +14 -14
  71. package/dist/lib/models/wishlist/index.js +86 -86
  72. package/dist/utils/StripeErrors.d.ts +24 -24
  73. package/dist/utils/StripeErrors.js +55 -55
  74. package/dist/utils/algolia.d.ts +3 -3
  75. package/dist/utils/algolia.js +35 -35
  76. package/dist/utils/analytics.d.ts +71 -71
  77. package/dist/utils/analytics.js +246 -246
  78. package/dist/utils/cart.d.ts +3 -3
  79. package/dist/utils/cart.js +65 -65
  80. package/dist/utils/contentful.d.ts +10 -10
  81. package/dist/utils/contentful.js +63 -63
  82. package/dist/utils/functions.d.ts +21 -21
  83. package/dist/utils/functions.js +183 -183
  84. package/dist/utils/getSDK.d.ts +4 -4
  85. package/dist/utils/getSDK.js +19 -19
  86. package/dist/utils/initStoreData.d.ts +3 -3
  87. package/dist/utils/initStoreData.js +17 -17
  88. package/dist/utils/interfaces/IClientCMSData.d.ts +132 -132
  89. package/dist/utils/interfaces/IClientCMSData.js +2 -2
  90. package/dist/utils/interfaces/IEndpointResult.d.ts +10 -10
  91. package/dist/utils/interfaces/IEndpointResult.js +2 -2
  92. package/dist/utils/interfaces/IFacebookUserProfile.d.ts +10 -10
  93. package/dist/utils/interfaces/IFacebookUserProfile.js +2 -2
  94. package/dist/utils/interfaces/IFilter.d.ts +23 -23
  95. package/dist/utils/interfaces/IFilter.js +2 -2
  96. package/dist/utils/interfaces/IGoogleUserProfile.d.ts +7 -7
  97. package/dist/utils/interfaces/IGoogleUserProfile.js +2 -2
  98. package/dist/utils/interfaces/ISDKConfig.d.ts +7 -7
  99. package/dist/utils/interfaces/ISDKConfig.js +2 -2
  100. package/dist/utils/interfaces/ISpaceData.d.ts +18 -18
  101. package/dist/utils/interfaces/ISpaceData.js +2 -2
  102. package/dist/utils/larivieremeunier.d.ts +3 -3
  103. package/dist/utils/larivieremeunier.js +156 -156
  104. package/dist/utils/technosupply.d.ts +3 -3
  105. package/dist/utils/technosupply.js +155 -155
  106. package/package.json +61 -61
  107. package/publish.sh +132 -132
@@ -1,34 +1,34 @@
1
- {
2
- "workbench.colorCustomizations": {
3
- "statusBar.background": "#600116",
4
- "statusBar.foreground": "#eeeeee",
5
- "statusBarItem.hoverBackground": "#920222",
6
- "sash.hoverBorder": "#920222",
7
- "statusBarItem.remoteBackground": "#600116",
8
- "statusBarItem.remoteForeground": "#eeeeee"
9
- },
10
- "peacock.color": "#600116",
11
- "editor.defaultFormatter": "esbenp.prettier-vscode",
12
- "editor.formatOnSave": true,
13
-
14
- "[typescript]": {
15
- "editor.defaultFormatter": "esbenp.prettier-vscode",
16
- "editor.formatOnSave": true
17
- },
18
- "[typescriptreact]": {
19
- "editor.defaultFormatter": "esbenp.prettier-vscode",
20
- "editor.formatOnSave": true
21
- },
22
- "prettier.tabWidth": 2,
23
- "prettier.semi": false,
24
- "prettier.singleQuote": true,
25
- "prettier.useTabs": true,
26
- "prettier.jsxSingleQuote": true,
27
- "prettier.bracketSameLine": true,
28
- "explorer.confirmDragAndDrop": false,
29
- "prettier.printWidth": 120,
30
- "prettier.trailingComma": "none",
31
- "prettier.arrowParens": "always",
32
- "prettier.bracketSpacing": true,
33
- "prettier.useEditorConfig": false
34
- }
1
+ {
2
+ "workbench.colorCustomizations": {
3
+ "statusBar.background": "#600116",
4
+ "statusBar.foreground": "#eeeeee",
5
+ "statusBarItem.hoverBackground": "#920222",
6
+ "sash.hoverBorder": "#920222",
7
+ "statusBarItem.remoteBackground": "#600116",
8
+ "statusBarItem.remoteForeground": "#eeeeee"
9
+ },
10
+ "peacock.color": "#600116",
11
+ "editor.defaultFormatter": "esbenp.prettier-vscode",
12
+ "editor.formatOnSave": true,
13
+
14
+ "[typescript]": {
15
+ "editor.defaultFormatter": "esbenp.prettier-vscode",
16
+ "editor.formatOnSave": true
17
+ },
18
+ "[typescriptreact]": {
19
+ "editor.defaultFormatter": "esbenp.prettier-vscode",
20
+ "editor.formatOnSave": true
21
+ },
22
+ "prettier.tabWidth": 2,
23
+ "prettier.semi": false,
24
+ "prettier.singleQuote": true,
25
+ "prettier.useTabs": true,
26
+ "prettier.jsxSingleQuote": true,
27
+ "prettier.bracketSameLine": true,
28
+ "explorer.confirmDragAndDrop": false,
29
+ "prettier.printWidth": 120,
30
+ "prettier.trailingComma": "none",
31
+ "prettier.arrowParens": "always",
32
+ "prettier.bracketSpacing": true,
33
+ "prettier.useEditorConfig": false
34
+ }
package/README.md CHANGED
@@ -1,79 +1,79 @@
1
- # gng-ecomm-sdk
2
-
3
- ## Introduction
4
-
5
- Bienvenue dans le sdk front!
6
-
7
- Le sdk front sert de lien entre les différents fronts du E-comm et nos autres projets internes.
8
- Il communique donc majoritairement avec gng-ecomm-admin-sdk et gng-tb-firebase-functions
9
- Il est possible de travailler en linked avec le sdk-admin en faisant **yarn link-sdk**, et ensuite de travailler en linked à partir du front pour faire des modifications dans le sdk admin et les voir localement dans le front.
10
-
11
- Comme tous les autres projets, toujours s'assurer de yarn avant tout pour être sur de ne pas avoir des erreurs à cause d'un manque de dépendances.
12
-
13
- ## Installation
14
-
15
- Pour installer le package pour développer en local, copier ces deux lignes dans le package.json du site "front" (section **scripts**):
16
-
17
- > "link-sdk": "yarn remove gng-ecomm-sdk && cd ../gng-ecomm-sdk && yarn link && cd node_modules/react && yarn link && cd ../react-dom && yarn link && cd ../gng-ecomm-admin-sdk && yarn link && cd ../../../SITE/ && yarn link react && yarn link react-dom && yarn link gng-ecomm-sdk && yarn link gng-ecomm-admin-sdk",
18
-
19
- > "unlink-sdk": "yarn unlink react && yarn unlink react-dom && yarn unlink gng-ecomm-sdk && yarn unlink gng-ecomm-admin-sdk && cd ../gng-ecomm-sdk/node_modules/react && yarn unlink && cd ../react-dom && yarn unlink && cd ../gng-ecomm-admin-sdk && yarn unlink && cd ../../ && yarn unlink && cd ../SITE/ && yarn update-sdk"
20
-
21
- > "update-sdk": "yarn add gng-ecomm-sdk@latest"
22
-
23
- Remplacez les mots **SITE** par le nom du dossier du dossier, par exemple pour Larivière-Meunier, je remplacerais SITE par www.larivieremeunier.com (Puisque c'est le nom du [repo GitHub](https://github.com/gitngin/www.larivieremeunier.com) et le nom du dossier dans mes fichiers.)
24
-
25
- ## Branches :
26
-
27
- Pour le gng-ecomm-sdk, on fonctionne avec des versions publiées sur npm, alors la seule branche utilisée à long terme est master.
28
- On doit donc toujours partir de la branche master à jour pour le développement.
29
-
30
- Dans un contexte ou on doit faire beaucoup de modifications en peu de temps et pour éviter de faire des versions complètes et de prendre la chance que ça tombe en ligne, on peut aussi faire des canarys.
31
-
32
- Pour faire une nouvelle version:
33
-
34
- - Partir une branche de master en faisant
35
-
36
- ```bash
37
-
38
- git checkout master
39
- git pull
40
- yarn
41
- git checkout -b master-[code de la tâche zoho]
42
-
43
- ```
44
-
45
- - Faire les modifications, les tester localement si possible et ensuite pousser tes modifications.
46
- - Créer une pull request vers master et attendre l'approbation d'un autre dev
47
- - Une fois la pull request approuvée, fusionner le tout
48
- - Publier la nouvelle version sur master en faisant
49
-
50
- ```bash
51
-
52
- git checkout master
53
- git pull
54
- yarn
55
- yarn build
56
- yarn pub
57
-
58
- ```
59
-
60
- et répondre aux questions avec le terminal git bash
61
-
62
- - Une fois la nouvelle version publiée, elle devient accessible sur les différents front du E-comm en faisant **yarn update-sdk**
63
-
64
- Pour faire un canary:
65
-
66
- - Partir une branche de master de la même façon que quand on veut faire une nouvelle version
67
- - Lorsque le temps est venu de pousser les modifs, à la place de directement faire une pull request vers main, faire **yarn pub** directement dans la branche
68
- - Dire oui à la question pour créer un canary
69
- - Une fois le nouveau canary publié, il devient accessible sur les différents front du E-comm en faisant **yarn update-canary**
70
-
71
- ATTENTION: Il ne peut exister qu'un canary pour une version à un même moment, il est donc impossible d'avoir une version principale avec deux branches de développement différentes qui ont un canary.
72
-
73
- ## Utilisation :
74
-
75
- Lorsque vous voulez développer en local avec le sdk-front, vous devez premièrement faire un **yarn build** et ensuite un **yarn link** ici.
76
-
77
- Par la suite, dans le front, vous devez utiliser les commandes **yarn link-sdk** et **yarn unlink-sdk**, ces commandes linkeront react, react-dom, et le gng-ecomm-sdk à votre site.
78
-
79
- Chaque fois que vous faites des modifications ici, il faut refaire un **yarn build** pour que celles-ci se reflètent dans le front.
1
+ # gng-ecomm-sdk
2
+
3
+ ## Introduction
4
+
5
+ Bienvenue dans le sdk front!
6
+
7
+ Le sdk front sert de lien entre les différents fronts du E-comm et nos autres projets internes.
8
+ Il communique donc majoritairement avec gng-ecomm-admin-sdk et gng-tb-firebase-functions
9
+ Il est possible de travailler en linked avec le sdk-admin en faisant **yarn link-sdk**, et ensuite de travailler en linked à partir du front pour faire des modifications dans le sdk admin et les voir localement dans le front.
10
+
11
+ Comme tous les autres projets, toujours s'assurer de yarn avant tout pour être sur de ne pas avoir des erreurs à cause d'un manque de dépendances.
12
+
13
+ ## Installation
14
+
15
+ Pour installer le package pour développer en local, copier ces deux lignes dans le package.json du site "front" (section **scripts**):
16
+
17
+ > "link-sdk": "yarn remove gng-ecomm-sdk && cd ../gng-ecomm-sdk && yarn link && cd node_modules/react && yarn link && cd ../react-dom && yarn link && cd ../gng-ecomm-admin-sdk && yarn link && cd ../../../SITE/ && yarn link react && yarn link react-dom && yarn link gng-ecomm-sdk && yarn link gng-ecomm-admin-sdk",
18
+
19
+ > "unlink-sdk": "yarn unlink react && yarn unlink react-dom && yarn unlink gng-ecomm-sdk && yarn unlink gng-ecomm-admin-sdk && cd ../gng-ecomm-sdk/node_modules/react && yarn unlink && cd ../react-dom && yarn unlink && cd ../gng-ecomm-admin-sdk && yarn unlink && cd ../../ && yarn unlink && cd ../SITE/ && yarn update-sdk"
20
+
21
+ > "update-sdk": "yarn add gng-ecomm-sdk@latest"
22
+
23
+ Remplacez les mots **SITE** par le nom du dossier du dossier, par exemple pour Larivière-Meunier, je remplacerais SITE par www.larivieremeunier.com (Puisque c'est le nom du [repo GitHub](https://github.com/gitngin/www.larivieremeunier.com) et le nom du dossier dans mes fichiers.)
24
+
25
+ ## Branches :
26
+
27
+ Pour le gng-ecomm-sdk, on fonctionne avec des versions publiées sur npm, alors la seule branche utilisée à long terme est master.
28
+ On doit donc toujours partir de la branche master à jour pour le développement.
29
+
30
+ Dans un contexte ou on doit faire beaucoup de modifications en peu de temps et pour éviter de faire des versions complètes et de prendre la chance que ça tombe en ligne, on peut aussi faire des canarys.
31
+
32
+ Pour faire une nouvelle version:
33
+
34
+ - Partir une branche de master en faisant
35
+
36
+ ```bash
37
+
38
+ git checkout master
39
+ git pull
40
+ yarn
41
+ git checkout -b master-[code de la tâche zoho]
42
+
43
+ ```
44
+
45
+ - Faire les modifications, les tester localement si possible et ensuite pousser tes modifications.
46
+ - Créer une pull request vers master et attendre l'approbation d'un autre dev
47
+ - Une fois la pull request approuvée, fusionner le tout
48
+ - Publier la nouvelle version sur master en faisant
49
+
50
+ ```bash
51
+
52
+ git checkout master
53
+ git pull
54
+ yarn
55
+ yarn build
56
+ yarn pub
57
+
58
+ ```
59
+
60
+ et répondre aux questions avec le terminal git bash
61
+
62
+ - Une fois la nouvelle version publiée, elle devient accessible sur les différents front du E-comm en faisant **yarn update-sdk**
63
+
64
+ Pour faire un canary:
65
+
66
+ - Partir une branche de master de la même façon que quand on veut faire une nouvelle version
67
+ - Lorsque le temps est venu de pousser les modifs, à la place de directement faire une pull request vers main, faire **yarn pub** directement dans la branche
68
+ - Dire oui à la question pour créer un canary
69
+ - Une fois le nouveau canary publié, il devient accessible sur les différents front du E-comm en faisant **yarn update-canary**
70
+
71
+ ATTENTION: Il ne peut exister qu'un canary pour une version à un même moment, il est donc impossible d'avoir une version principale avec deux branches de développement différentes qui ont un canary.
72
+
73
+ ## Utilisation :
74
+
75
+ Lorsque vous voulez développer en local avec le sdk-front, vous devez premièrement faire un **yarn build** et ensuite un **yarn link** ici.
76
+
77
+ Par la suite, dans le front, vous devez utiliser les commandes **yarn link-sdk** et **yarn unlink-sdk**, ces commandes linkeront react, react-dom, et le gng-ecomm-sdk à votre site.
78
+
79
+ Chaque fois que vous faites des modifications ici, il faut refaire un **yarn build** pour que celles-ci se reflètent dans le front.
package/dist/index.d.ts CHANGED
@@ -1,203 +1,203 @@
1
- import Wishlist from './lib/models/wishlist';
2
- import StockNotification from './lib/models/stockNotification';
3
- import { SearchResponse } from '@algolia/client-search';
4
- import IEndpointResult from './utils/interfaces/IEndpointResult';
5
- import IOrder from 'addio-admin-sdk/dist/Interfaces/Order';
6
- import ICustomer from 'addio-admin-sdk/dist/Interfaces/Customer';
7
- import ISpaceData from './utils/interfaces/ISpaceData';
8
- import IWishlist from 'addio-admin-sdk/dist/Interfaces/Wishlist';
9
- import IStockNotification from 'addio-admin-sdk/dist/Interfaces/StockNotification';
10
- import { IIndexedProductAlgolia } from 'addio-admin-sdk/dist/Interfaces/Algolia';
11
- import IIndexedLastSavedProduct from 'addio-admin-sdk/dist/Interfaces/Indexed/Product/IIndexedLastSavedProduct';
12
- import IIndexedProduct from 'addio-admin-sdk/dist/Interfaces/Indexed/Product';
13
- import ICart, { IProductUpsell } from 'addio-admin-sdk/dist/Interfaces/Cart';
14
- import ISDKConfig from './utils/interfaces/ISDKConfig';
15
- import ICategory from 'addio-admin-sdk/dist/Interfaces/Category';
16
- import IInventoryItem from 'addio-admin-sdk/dist/Interfaces/Product/IInventoryItem';
17
- import IBrand from 'addio-admin-sdk/dist/Interfaces/Brand';
18
- import IPreMeetingFormEmail from 'addio-admin-sdk/dist/Interfaces/Email/CustomGR/IPreMeetingFormEmail';
19
- import IWishlistEmail from 'addio-admin-sdk/dist/Interfaces/Email/CustomGR/IWishlistEmail';
20
- import ISponsorRequestEmail from 'addio-admin-sdk/dist/Interfaces/Email/CustomGR/ISponsorRequestEmail';
21
- import { ICustomPriceItem } from 'addio-admin-sdk/dist/Interfaces/G2';
22
- import { IFixedPromoBanner } from 'addio-admin-sdk/dist/Interfaces/Space';
23
- import IAddress from 'addio-admin-sdk/dist/Interfaces/Address';
24
- import { ICustomerGroup } from 'addio-admin-sdk/dist/Interfaces/Space';
25
- export default class SDK {
26
- private _api;
27
- private _imgPath;
28
- private _token;
29
- private _url;
30
- private _org;
31
- private _userToken;
32
- private _storeData;
33
- private _wishlist;
34
- private _stockNotif;
35
- constructor();
36
- init: (sdk_config: ISDKConfig) => Promise<void>;
37
- getAPIInfos: () => {
38
- api: string;
39
- token: string;
40
- userToken: string;
41
- org: string;
42
- };
43
- getSDKOrgInitials: () => string;
44
- initWishlist: (wishlist: IWishlist) => Promise<Wishlist | undefined>;
45
- initStockNotif: (stockNotif: IStockNotification) => Promise<StockNotification | undefined>;
46
- initStoreData: (defaultData?: ISpaceData) => Promise<ISpaceData | undefined>;
47
- shouldShowFixedPromoBanner: (fixedPromoBannerData: IFixedPromoBanner) => boolean;
48
- private getInventoryItem;
49
- private getFullInventory;
50
- inventory: {
51
- getFullInventory: (locale: string) => Promise<IInventoryItem[] | undefined>;
52
- getInventoryItem: (sku: string, locale: string) => Promise<IInventoryItem | undefined>;
53
- };
54
- setUserToken: (token: string) => void;
55
- private loginUserWithFacebook;
56
- private anonymousResetPassword;
57
- private loginUser;
58
- private loginUserWithID;
59
- private checkG2ForCustomer;
60
- private createProCustomer;
61
- private fetchCustomPriceList;
62
- private validateAccount;
63
- private logout;
64
- private registerUser;
65
- private getUser;
66
- private saveUser;
67
- private deleteUser;
68
- private getOrders;
69
- private killRepCart;
70
- private getOrder;
71
- private changeProfilePicture;
72
- private changePassword;
73
- private sendResetPasswordEmail;
74
- sendApplicationEmail: (locale: string, form: any) => Promise<any>;
75
- sendContactEmail: (locale: string, form: any) => Promise<any>;
76
- sendGenericOtherEmail: (locale: string, form: any, templateId: string, to: string, replyTo?: string) => Promise<any>;
77
- sendServicePageEmail: (locale: string, form: any, type: string, testEmail?: string) => Promise<string | true | import("addio-admin-sdk/dist/utils/string").default | {
78
- status: number;
79
- error: {
80
- fr: string;
81
- en: string;
82
- };
83
- } | undefined>;
84
- sendSponsorRequestEmail: (locale: string, form: ISponsorRequestEmail, template_name: string) => Promise<string | true | import("addio-admin-sdk/dist/utils/string").default | undefined>;
85
- sendPreMeetingFormEmail: (locale: string, form: IPreMeetingFormEmail, proId?: string) => Promise<string | true | import("addio-admin-sdk/dist/utils/string").default | undefined>;
86
- sendWishlistByEmail: (locale: string, contenu: IWishlistEmail, template_name: string) => Promise<string | true | import("addio-admin-sdk/dist/utils/string").default | undefined>;
87
- private resetPassword;
88
- user: {
89
- getUser: (keepTempHash?: boolean) => Promise<ICustomer>;
90
- saveUser: (userData: ICustomer) => Promise<boolean>;
91
- deleteUser: () => Promise<boolean>;
92
- loginUser: (locale: string, email: string, password: string, keepCart?: boolean, isClerk?: boolean) => Promise<{
93
- cart: ICart | null;
94
- userData: ICustomer;
95
- } | string>;
96
- loginUserWithID: (locale: string, id: string, password: string, keepCart?: boolean, isClerk?: boolean) => Promise<{
97
- cart: ICart;
98
- userData: ICustomer;
99
- } | string>;
100
- loginUserWithFacebook: (fb: any) => Promise<{
101
- cart: ICart | null;
102
- userData: ICustomer;
103
- } | string>;
104
- logout: () => void;
105
- registerUser: (locale: string, userData: ICustomer, password: string) => Promise<IEndpointResult>;
106
- killRepCart: (hashed_cart_id: string) => Promise<boolean | "">;
107
- getOrder: (orderID: string, token?: string) => Promise<string | IOrder>;
108
- getOrders: (lastID?: string, iteration?: number) => Promise<ICart[] | string>;
109
- changePassword: (currentPassword: string, newPassword: string) => Promise<any>;
110
- changeProfilePicture: (file?: string) => Promise<any>;
111
- validateAccount: (code: string) => Promise<ICustomer>;
112
- sendResetPasswordEmail: (locale: string, userEmail: string, forPro?: boolean, withEmail?: boolean, isTest?: boolean) => Promise<any>;
113
- resetPassword: (token: string, newPassword: string, withEmail?: boolean) => Promise<any>;
114
- sendApplicationEmail: (locale: string, form: any) => Promise<any>;
115
- sendContactEmail: (locale: string, form: any) => Promise<any>;
116
- sendServiceEmail: (locale: string, form: any, type: string, testEmail?: string) => Promise<string | true | import("addio-admin-sdk/dist/utils/string").default | {
117
- status: number;
118
- error: {
119
- fr: string;
120
- en: string;
121
- };
122
- } | undefined>;
123
- anonymousResetPassword: (locale: string, id: string, oldPassword: string, newPassword: string, confirmPassword: string) => Promise<IEndpointResult>;
124
- checkG2: (id: string, currentCustomer?: ICustomer, customerGroups?: ICustomerGroup[]) => Promise<ICustomer | undefined>;
125
- createPro: (customer: ICustomer) => Promise<any>;
126
- fetchCustomPriceList: (customerID: string, isPA?: boolean) => Promise<any>;
127
- };
128
- getImage: (imgName: string, formatQuery?: string, addImgPath?: boolean) => string;
129
- private getProducts;
130
- private getProduct;
131
- private getUpsellOfProducts;
132
- private getAttributes;
133
- private getCategories;
134
- private getBrands;
135
- private getInventoryItems;
136
- private getOneInventoryItem;
137
- getLatestProducts: () => Promise<IIndexedLastSavedProduct[] | undefined>;
138
- private _getFees;
139
- products: {
140
- getProducts: (page?: number, hpp?: number, query?: string, filters?: string, indice?: string, f?: string, useProspr?: boolean) => Promise<SearchResponse<IIndexedProductAlgolia>>;
141
- getProduct: (parentSlug: string, locale: string, useProdArray?: IIndexedProduct[], noDrafts?: boolean) => Promise<IIndexedProduct | undefined>;
142
- getUpsellOfProducts: (slugs: string[], customPriceList?: ICustomPriceItem[]) => Promise<{
143
- upsell: IProductUpsell;
144
- prod: IIndexedProduct;
145
- }[]>;
146
- getAttributes: () => Promise<{
147
- slug: string;
148
- id?: string | undefined;
149
- name: import("addio-admin-sdk/dist/Interfaces/Translation").default[];
150
- values: import("addio-admin-sdk/dist/Interfaces/Attribute").IAttributeValue[];
151
- description: string;
152
- type?: import("addio-admin-sdk/dist/Interfaces/Attribute").AttributeTypeEnum | undefined;
153
- is_facet: boolean;
154
- is_searchable: boolean;
155
- is_multiple: boolean;
156
- is_service_related?: boolean | undefined;
157
- has_price_rules?: boolean | undefined;
158
- draft?: boolean | undefined;
159
- prefix?: string | undefined;
160
- suffix?: string | undefined;
161
- show_in_cart?: boolean | undefined;
162
- service_related_name?: string | undefined;
163
- service_links_to_attribute?: {
164
- readonly value_slugs: {
165
- readonly slug: string;
166
- readonly percent_variation?: number | undefined;
167
- }[];
168
- readonly service_field: string;
169
- }[] | undefined;
170
- created_from_external_service?: import("addio-admin-sdk/dist/Interfaces/Space/IExternalService").ExternalServiceSlugEnum | undefined;
171
- }[] | undefined>;
172
- getCategories: () => Promise<ICategory[] | undefined>;
173
- getBrands: () => Promise<IBrand[] | undefined>;
174
- getInventoryItems: (parentSlug: string) => Promise<IInventoryItem[] | undefined>;
175
- getOneInventoryItem: (sku: string) => Promise<IInventoryItem | undefined>;
176
- getLatestProducts: () => Promise<IIndexedLastSavedProduct[] | undefined>;
177
- getFees: () => Promise<IIndexedProduct[] | undefined>;
178
- };
179
- getIfAddressIsInsideZones: (address: IAddress | string) => Promise<string[]>;
180
- private _pricingByQuery;
181
- private _buyFromForm;
182
- private _getSearchServices;
183
- services: {
184
- pricingByQuery: (query: string) => Promise<any>;
185
- buy: {
186
- fromForm: (form: any) => Promise<boolean>;
187
- };
188
- searchServices: () => Promise<any>;
189
- };
190
- private _getAllCatalogues;
191
- private _getCatalogueBySlug;
192
- catalogues: {
193
- getAll: (locale: string) => Promise<any>;
194
- getOne: (slug: string, locale: string) => Promise<any>;
195
- };
196
- saveCustomerToMailchimpList: (customerEmail: string, listID: string, mergeFields?: {
197
- [key: string]: any;
198
- } | undefined, tags?: {
199
- name: string;
200
- status: string;
201
- }[]) => Promise<boolean>;
202
- getProductListForSitemap: () => Promise<any>;
203
- }
1
+ import Wishlist from './lib/models/wishlist';
2
+ import StockNotification from './lib/models/stockNotification';
3
+ import { SearchResponse } from '@algolia/client-search';
4
+ import IEndpointResult from './utils/interfaces/IEndpointResult';
5
+ import IOrder from 'addio-admin-sdk/dist/Interfaces/Order';
6
+ import ICustomer from 'addio-admin-sdk/dist/Interfaces/Customer';
7
+ import ISpaceData from './utils/interfaces/ISpaceData';
8
+ import IWishlist from 'addio-admin-sdk/dist/Interfaces/Wishlist';
9
+ import IStockNotification from 'addio-admin-sdk/dist/Interfaces/StockNotification';
10
+ import { IIndexedProductAlgolia } from 'addio-admin-sdk/dist/Interfaces/Algolia';
11
+ import IIndexedLastSavedProduct from 'addio-admin-sdk/dist/Interfaces/Indexed/Product/IIndexedLastSavedProduct';
12
+ import IIndexedProduct from 'addio-admin-sdk/dist/Interfaces/Indexed/Product';
13
+ import ICart, { IProductUpsell } from 'addio-admin-sdk/dist/Interfaces/Cart';
14
+ import ISDKConfig from './utils/interfaces/ISDKConfig';
15
+ import ICategory from 'addio-admin-sdk/dist/Interfaces/Category';
16
+ import IInventoryItem from 'addio-admin-sdk/dist/Interfaces/Product/IInventoryItem';
17
+ import IBrand from 'addio-admin-sdk/dist/Interfaces/Brand';
18
+ import IPreMeetingFormEmail from 'addio-admin-sdk/dist/Interfaces/Email/CustomGR/IPreMeetingFormEmail';
19
+ import IWishlistEmail from 'addio-admin-sdk/dist/Interfaces/Email/CustomGR/IWishlistEmail';
20
+ import ISponsorRequestEmail from 'addio-admin-sdk/dist/Interfaces/Email/CustomGR/ISponsorRequestEmail';
21
+ import { ICustomPriceItem } from 'addio-admin-sdk/dist/Interfaces/G2';
22
+ import { IFixedPromoBanner } from 'addio-admin-sdk/dist/Interfaces/Space';
23
+ import IAddress from 'addio-admin-sdk/dist/Interfaces/Address';
24
+ import { ICustomerGroup } from 'addio-admin-sdk/dist/Interfaces/Space';
25
+ export default class SDK {
26
+ private _api;
27
+ private _imgPath;
28
+ private _token;
29
+ private _url;
30
+ private _org;
31
+ private _userToken;
32
+ private _storeData;
33
+ private _wishlist;
34
+ private _stockNotif;
35
+ constructor();
36
+ init: (sdk_config: ISDKConfig) => Promise<void>;
37
+ getAPIInfos: () => {
38
+ api: string;
39
+ token: string;
40
+ userToken: string;
41
+ org: string;
42
+ };
43
+ getSDKOrgInitials: () => string;
44
+ initWishlist: (wishlist: IWishlist) => Promise<Wishlist | undefined>;
45
+ initStockNotif: (stockNotif: IStockNotification) => Promise<StockNotification | undefined>;
46
+ initStoreData: (defaultData?: ISpaceData) => Promise<ISpaceData | undefined>;
47
+ shouldShowFixedPromoBanner: (fixedPromoBannerData: IFixedPromoBanner) => boolean;
48
+ private getInventoryItem;
49
+ private getFullInventory;
50
+ inventory: {
51
+ getFullInventory: (locale: string) => Promise<IInventoryItem[] | undefined>;
52
+ getInventoryItem: (sku: string, locale: string) => Promise<IInventoryItem | undefined>;
53
+ };
54
+ setUserToken: (token: string) => void;
55
+ private loginUserWithFacebook;
56
+ private anonymousResetPassword;
57
+ private loginUser;
58
+ private loginUserWithID;
59
+ private checkG2ForCustomer;
60
+ private createProCustomer;
61
+ private fetchCustomPriceList;
62
+ private validateAccount;
63
+ private logout;
64
+ private registerUser;
65
+ private getUser;
66
+ private saveUser;
67
+ private deleteUser;
68
+ private getOrders;
69
+ private killRepCart;
70
+ private getOrder;
71
+ private changeProfilePicture;
72
+ private changePassword;
73
+ private sendResetPasswordEmail;
74
+ sendApplicationEmail: (locale: string, form: any) => Promise<any>;
75
+ sendContactEmail: (locale: string, form: any) => Promise<any>;
76
+ sendGenericOtherEmail: (locale: string, form: any, templateId: string, to: string, replyTo?: string) => Promise<any>;
77
+ sendServicePageEmail: (locale: string, form: any, type: string, testEmail?: string) => Promise<string | true | import("addio-admin-sdk/dist/utils/string").default | {
78
+ status: number;
79
+ error: {
80
+ fr: string;
81
+ en: string;
82
+ };
83
+ } | undefined>;
84
+ sendSponsorRequestEmail: (locale: string, form: ISponsorRequestEmail, template_name: string) => Promise<string | true | import("addio-admin-sdk/dist/utils/string").default | undefined>;
85
+ sendPreMeetingFormEmail: (locale: string, form: IPreMeetingFormEmail, proId?: string) => Promise<string | true | import("addio-admin-sdk/dist/utils/string").default | undefined>;
86
+ sendWishlistByEmail: (locale: string, contenu: IWishlistEmail, template_name: string) => Promise<string | true | import("addio-admin-sdk/dist/utils/string").default | undefined>;
87
+ private resetPassword;
88
+ user: {
89
+ getUser: (keepTempHash?: boolean) => Promise<ICustomer>;
90
+ saveUser: (userData: ICustomer) => Promise<boolean>;
91
+ deleteUser: () => Promise<boolean>;
92
+ loginUser: (locale: string, email: string, password: string, keepCart?: boolean, isClerk?: boolean) => Promise<{
93
+ cart: ICart | null;
94
+ userData: ICustomer;
95
+ } | string>;
96
+ loginUserWithID: (locale: string, id: string, password: string, keepCart?: boolean, isClerk?: boolean) => Promise<{
97
+ cart: ICart;
98
+ userData: ICustomer;
99
+ } | string>;
100
+ loginUserWithFacebook: (fb: any) => Promise<{
101
+ cart: ICart | null;
102
+ userData: ICustomer;
103
+ } | string>;
104
+ logout: () => void;
105
+ registerUser: (locale: string, userData: ICustomer, password: string) => Promise<IEndpointResult>;
106
+ killRepCart: (hashed_cart_id: string) => Promise<boolean | "">;
107
+ getOrder: (orderID: string, token?: string) => Promise<string | IOrder>;
108
+ getOrders: (lastID?: string, iteration?: number) => Promise<ICart[] | string>;
109
+ changePassword: (currentPassword: string, newPassword: string) => Promise<any>;
110
+ changeProfilePicture: (file?: string) => Promise<any>;
111
+ validateAccount: (code: string) => Promise<ICustomer>;
112
+ sendResetPasswordEmail: (locale: string, userEmail: string, forPro?: boolean, withEmail?: boolean, isTest?: boolean) => Promise<any>;
113
+ resetPassword: (token: string, newPassword: string, withEmail?: boolean) => Promise<any>;
114
+ sendApplicationEmail: (locale: string, form: any) => Promise<any>;
115
+ sendContactEmail: (locale: string, form: any) => Promise<any>;
116
+ sendServiceEmail: (locale: string, form: any, type: string, testEmail?: string) => Promise<string | true | import("addio-admin-sdk/dist/utils/string").default | {
117
+ status: number;
118
+ error: {
119
+ fr: string;
120
+ en: string;
121
+ };
122
+ } | undefined>;
123
+ anonymousResetPassword: (locale: string, id: string, oldPassword: string, newPassword: string, confirmPassword: string) => Promise<IEndpointResult>;
124
+ checkG2: (id: string, currentCustomer?: ICustomer, customerGroups?: ICustomerGroup[]) => Promise<ICustomer | undefined>;
125
+ createPro: (customer: ICustomer) => Promise<any>;
126
+ fetchCustomPriceList: (customerID: string, isPA?: boolean) => Promise<any>;
127
+ };
128
+ getImage: (imgName: string, formatQuery?: string, addImgPath?: boolean) => string;
129
+ private getProducts;
130
+ private getProduct;
131
+ private getUpsellOfProducts;
132
+ private getAttributes;
133
+ private getCategories;
134
+ private getBrands;
135
+ private getInventoryItems;
136
+ private getOneInventoryItem;
137
+ getLatestProducts: () => Promise<IIndexedLastSavedProduct[] | undefined>;
138
+ private _getFees;
139
+ products: {
140
+ getProducts: (page?: number, hpp?: number, query?: string, filters?: string, indice?: string, f?: string, useProspr?: boolean) => Promise<SearchResponse<IIndexedProductAlgolia>>;
141
+ getProduct: (parentSlug: string, locale: string, useProdArray?: IIndexedProduct[], noDrafts?: boolean) => Promise<IIndexedProduct | undefined>;
142
+ getUpsellOfProducts: (slugs: string[], customPriceList?: ICustomPriceItem[]) => Promise<{
143
+ upsell: IProductUpsell;
144
+ prod: IIndexedProduct;
145
+ }[]>;
146
+ getAttributes: () => Promise<{
147
+ slug: string;
148
+ id?: string | undefined;
149
+ name: import("addio-admin-sdk/dist/Interfaces/Translation").default[];
150
+ values: import("addio-admin-sdk/dist/Interfaces/Attribute").IAttributeValue[];
151
+ description: string | import("addio-admin-sdk/dist/Interfaces/Translation").default[];
152
+ type?: import("addio-admin-sdk/dist/Interfaces/Attribute").AttributeTypeEnum | undefined;
153
+ is_facet: boolean;
154
+ is_searchable: boolean;
155
+ is_multiple: boolean;
156
+ is_service_related?: boolean | undefined;
157
+ has_price_rules?: boolean | undefined;
158
+ draft?: boolean | undefined;
159
+ prefix?: string | undefined;
160
+ suffix?: string | undefined;
161
+ show_in_cart?: boolean | undefined;
162
+ service_related_name?: string | undefined;
163
+ service_links_to_attribute?: {
164
+ readonly value_slugs: {
165
+ readonly slug: string;
166
+ readonly percent_variation?: number | undefined;
167
+ }[];
168
+ readonly service_field: string;
169
+ }[] | undefined;
170
+ created_from_external_service?: import("addio-admin-sdk/dist/Interfaces/Space/IExternalService").ExternalServiceSlugEnum | undefined;
171
+ }[] | undefined>;
172
+ getCategories: () => Promise<ICategory[] | undefined>;
173
+ getBrands: () => Promise<IBrand[] | undefined>;
174
+ getInventoryItems: (parentSlug: string) => Promise<IInventoryItem[] | undefined>;
175
+ getOneInventoryItem: (sku: string) => Promise<IInventoryItem | undefined>;
176
+ getLatestProducts: () => Promise<IIndexedLastSavedProduct[] | undefined>;
177
+ getFees: () => Promise<IIndexedProduct[] | undefined>;
178
+ };
179
+ getIfAddressIsInsideZones: (address: IAddress | string) => Promise<string[]>;
180
+ private _pricingByQuery;
181
+ private _buyFromForm;
182
+ private _getSearchServices;
183
+ services: {
184
+ pricingByQuery: (query: string) => Promise<any>;
185
+ buy: {
186
+ fromForm: (form: any) => Promise<boolean>;
187
+ };
188
+ searchServices: () => Promise<any>;
189
+ };
190
+ private _getAllCatalogues;
191
+ private _getCatalogueBySlug;
192
+ catalogues: {
193
+ getAll: (locale: string) => Promise<any>;
194
+ getOne: (slug: string, locale: string) => Promise<any>;
195
+ };
196
+ saveCustomerToMailchimpList: (customerEmail: string, listID: string, mergeFields?: {
197
+ [key: string]: any;
198
+ } | undefined, tags?: {
199
+ name: string;
200
+ status: string;
201
+ }[]) => Promise<boolean>;
202
+ getProductListForSitemap: () => Promise<any>;
203
+ }