@liquidcommercedev/rmn-sdk 1.4.1-beta.1 → 1.4.1-beta.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. package/dist/index.cjs +17131 -0
  2. package/dist/index.esm.js +17127 -0
  3. package/dist/types/common/helpers/helpers.interface.d.ts +14 -0
  4. package/dist/types/common/helpers/index.d.ts +2 -0
  5. package/dist/types/common/helpers/object.helper.d.ts +95 -0
  6. package/dist/types/common/helpers/string.helper.d.ts +39 -0
  7. package/dist/types/common/http/api.constant.d.ts +6 -0
  8. package/dist/types/common/http/api.interface.d.ts +39 -0
  9. package/dist/types/common/http/base.api.d.ts +79 -0
  10. package/dist/types/common/http/encrypted.api.d.ts +66 -0
  11. package/dist/types/common/http/error.api.d.ts +5 -0
  12. package/dist/types/common/http/index.d.ts +5 -0
  13. package/dist/types/common/singleton-manager/index.d.ts +1 -0
  14. package/dist/types/common/singleton-manager/singleton-manager.d.ts +12 -0
  15. package/dist/types/enums.d.ts +7 -0
  16. package/dist/types/index.d.ts +3 -0
  17. package/dist/types/index.umd.d.ts +2 -0
  18. package/dist/types/modules/auth/auth.constant.d.ts +1 -0
  19. package/dist/types/modules/auth/auth.interface.d.ts +27 -0
  20. package/dist/types/modules/auth/auth.service.d.ts +22 -0
  21. package/dist/types/modules/auth/index.d.ts +3 -0
  22. package/dist/types/modules/spot/html/index.d.ts +1 -0
  23. package/dist/types/modules/spot/html/spot.element.service.d.ts +7 -0
  24. package/dist/types/modules/spot/html/spot.element.shadow-root.d.ts +4 -0
  25. package/dist/types/modules/spot/html/templates/iab/billboard/billboard-v1.template.d.ts +2 -0
  26. package/dist/types/modules/spot/html/templates/iab/billboard/billboard-v2.template.d.ts +2 -0
  27. package/dist/types/modules/spot/html/templates/iab/billboard/billboard-v3.template.d.ts +2 -0
  28. package/dist/types/modules/spot/html/templates/iab/billboard/index.d.ts +3 -0
  29. package/dist/types/modules/spot/html/templates/iab/constants/fonts.constant.d.ts +3 -0
  30. package/dist/types/modules/spot/html/templates/iab/in-text/in-text-v1.template.d.ts +2 -0
  31. package/dist/types/modules/spot/html/templates/iab/in-text/index.d.ts +1 -0
  32. package/dist/types/modules/spot/html/templates/iab/index.d.ts +7 -0
  33. package/dist/types/modules/spot/html/templates/iab/large-leaderboard/index.d.ts +2 -0
  34. package/dist/types/modules/spot/html/templates/iab/large-leaderboard/large-leaderboard-v1.template.d.ts +2 -0
  35. package/dist/types/modules/spot/html/templates/iab/large-leaderboard/large-leaderboard-v2.template.d.ts +2 -0
  36. package/dist/types/modules/spot/html/templates/iab/large-rectangle/index.d.ts +1 -0
  37. package/dist/types/modules/spot/html/templates/iab/large-rectangle/large-rectangle-v1.template.d.ts +2 -0
  38. package/dist/types/modules/spot/html/templates/iab/square/index.d.ts +2 -0
  39. package/dist/types/modules/spot/html/templates/iab/square/square-v1.template.d.ts +2 -0
  40. package/dist/types/modules/spot/html/templates/iab/square/square-v2.template.d.ts +2 -0
  41. package/dist/types/modules/spot/html/templates/iab/vertical-rectangle/index.d.ts +1 -0
  42. package/dist/types/modules/spot/html/templates/iab/vertical-rectangle/vertical-rectangle-v1.template.d.ts +2 -0
  43. package/dist/types/modules/spot/html/templates/iab/wide-skyscraper/index.d.ts +1 -0
  44. package/dist/types/modules/spot/html/templates/iab/wide-skyscraper/wide-skyscraper-v1.template.d.ts +2 -0
  45. package/dist/types/modules/spot/html/templates/index.d.ts +1 -0
  46. package/dist/types/modules/spot/html/templates/reservebar/collection-banner-without-text-block.template.d.ts +2 -0
  47. package/dist/types/modules/spot/html/templates/reservebar/homepage-hero-full-image.template.d.ts +2 -0
  48. package/dist/types/modules/spot/html/templates/reservebar/homepage-hero-three-tile.template.d.ts +2 -0
  49. package/dist/types/modules/spot/html/templates/reservebar/homepage-hero-two-tile.template.d.ts +2 -0
  50. package/dist/types/modules/spot/html/templates/reservebar/index.d.ts +8 -0
  51. package/dist/types/modules/spot/html/templates/reservebar/large-category-image-tout.template.d.ts +2 -0
  52. package/dist/types/modules/spot/html/templates/reservebar/navigation-banner.template.d.ts +2 -0
  53. package/dist/types/modules/spot/html/templates/reservebar/small-category-image-tout.template.d.ts +2 -0
  54. package/dist/types/modules/spot/html/templates/reservebar/small-discover-tout.template.d.ts +2 -0
  55. package/dist/types/modules/spot/html/templates/spot.template.d.ts +21 -0
  56. package/dist/types/modules/spot/index.d.ts +6 -0
  57. package/dist/types/modules/spot/spot.constant.d.ts +3 -0
  58. package/dist/types/modules/spot/spot.enum.d.ts +57 -0
  59. package/dist/types/modules/spot/spot.html.service.d.ts +22 -0
  60. package/dist/types/modules/spot/spot.interface.d.ts +44 -0
  61. package/dist/types/modules/spot/spot.selection.service.d.ts +16 -0
  62. package/dist/types/modules/spot/spot.type.d.ts +27 -0
  63. package/dist/types/rmn-client.d.ts +58 -0
  64. package/dist/types/types.d.ts +11 -0
  65. package/package.json +34 -14
  66. package/umd/liquidcommerce-rmn-sdk.min.js +1 -0
  67. package/CHANGELOG.md +0 -65
  68. package/dist/index.d.ts +0 -192
  69. package/dist/index.js +0 -19
  70. package/dist/index.js.map +0 -1
  71. package/dist/index.mjs +0 -19
  72. package/dist/index.mjs.map +0 -1
package/CHANGELOG.md DELETED
@@ -1,65 +0,0 @@
1
- ## [1.4.1-beta.1](https://github.com/liquidcommerce/rmn-sdk/compare/v1.4.0...v1.4.1-beta.1) (2024-10-08)
2
-
3
-
4
- ### Bug Fixes
5
-
6
- * fixes ([116ba93](https://github.com/liquidcommerce/rmn-sdk/commit/116ba930a9d38e231e1248ad73a38d344992498b))
7
- * fixes ([169dab1](https://github.com/liquidcommerce/rmn-sdk/commit/169dab1b780a7594eaff5610b32299a64d849a8a))
8
- * readme fix ([8af0252](https://github.com/liquidcommerce/rmn-sdk/commit/8af0252e7108b88f7438c39780024a9757f63e4d))
9
- * spot config - redirect on click ([55517f7](https://github.com/liquidcommerce/rmn-sdk/commit/55517f754bd0c1c2a91967fc79b54699a13771de))
10
-
11
- # [1.4.0](https://github.com/liquidcommerce/rmn-sdk/compare/v1.3.1...v1.4.0) (2024-10-03)
12
-
13
-
14
- ### Features
15
-
16
- * added events type ([278cf44](https://github.com/liquidcommerce/rmn-sdk/commit/278cf449619218b6826a1f0ca141fc988007987a))
17
- * button on hover color ([70b1839](https://github.com/liquidcommerce/rmn-sdk/commit/70b1839100709b5a41a3d1ba14eae56d4f05889c))
18
- * design changes ([2142ee5](https://github.com/liquidcommerce/rmn-sdk/commit/2142ee5685250636a2ab728f424d67dcb101e097))
19
- * export event interface ([0ca5a76](https://github.com/liquidcommerce/rmn-sdk/commit/0ca5a762d5906de82073627a4e1f016462f2a6c9))
20
- * fix fonts ([2d65e44](https://github.com/liquidcommerce/rmn-sdk/commit/2d65e44e8b24d446c78ad97005db2bb8c1004c92))
21
- * new spot content and design fixes and new rb variant ([2efd32d](https://github.com/liquidcommerce/rmn-sdk/commit/2efd32db2264920f9653c1436b670043ad9f5723))
22
- * new variant design ([11623b9](https://github.com/liquidcommerce/rmn-sdk/commit/11623b99ba3a74d3c92d87b32da139bd97f1a339))
23
- * remove filter blur ([355a302](https://github.com/liquidcommerce/rmn-sdk/commit/355a30270d8a8388fbef8bcccab2491518015006))
24
- * support cta color ([a2df5eb](https://github.com/liquidcommerce/rmn-sdk/commit/a2df5eb3a9d15a0719c408936aa4781f09190673))
25
- * support cta color ([26a637e](https://github.com/liquidcommerce/rmn-sdk/commit/26a637e90ad54dee5acb36b35177c45a8c6b72f2))
26
-
27
- # [1.4.0-beta.1](https://github.com/liquidcommerce/rmn-sdk/compare/v1.3.1...v1.4.0-beta.1) (2024-10-03)
28
-
29
-
30
- ### Features
31
-
32
- * added events type ([278cf44](https://github.com/liquidcommerce/rmn-sdk/commit/278cf449619218b6826a1f0ca141fc988007987a))
33
- * button on hover color ([70b1839](https://github.com/liquidcommerce/rmn-sdk/commit/70b1839100709b5a41a3d1ba14eae56d4f05889c))
34
- * design changes ([2142ee5](https://github.com/liquidcommerce/rmn-sdk/commit/2142ee5685250636a2ab728f424d67dcb101e097))
35
- * export event interface ([0ca5a76](https://github.com/liquidcommerce/rmn-sdk/commit/0ca5a762d5906de82073627a4e1f016462f2a6c9))
36
- * fix fonts ([2d65e44](https://github.com/liquidcommerce/rmn-sdk/commit/2d65e44e8b24d446c78ad97005db2bb8c1004c92))
37
- * new spot content and design fixes and new rb variant ([2efd32d](https://github.com/liquidcommerce/rmn-sdk/commit/2efd32db2264920f9653c1436b670043ad9f5723))
38
- * new variant design ([11623b9](https://github.com/liquidcommerce/rmn-sdk/commit/11623b99ba3a74d3c92d87b32da139bd97f1a339))
39
- * remove filter blur ([355a302](https://github.com/liquidcommerce/rmn-sdk/commit/355a30270d8a8388fbef8bcccab2491518015006))
40
- * support cta color ([a2df5eb](https://github.com/liquidcommerce/rmn-sdk/commit/a2df5eb3a9d15a0719c408936aa4781f09190673))
41
- * support cta color ([26a637e](https://github.com/liquidcommerce/rmn-sdk/commit/26a637e90ad54dee5acb36b35177c45a8c6b72f2))
42
-
43
- ## [1.3.1](https://github.com/liquidcommerce/rmn-sdk/compare/v1.3.0...v1.3.1) (2024-10-01)
44
-
45
-
46
- ### Bug Fixes
47
-
48
- * build ([5b022a2](https://github.com/liquidcommerce/rmn-sdk/commit/5b022a28d803a746e4fa9eedfc3d4275d91639df))
49
- * relase fix ([ba74044](https://github.com/liquidcommerce/rmn-sdk/commit/ba74044787c47d446ce8b6688c547a5d968583a0))
50
- * release ([1cd4844](https://github.com/liquidcommerce/rmn-sdk/commit/1cd4844a126786f4336f16517dde6219a25632e1))
51
- * release ([fd7d22f](https://github.com/liquidcommerce/rmn-sdk/commit/fd7d22f9226ceeb2bdec7185400751129e5a7b6a))
52
- * revert back release ([97340e6](https://github.com/liquidcommerce/rmn-sdk/commit/97340e6feca451487ab99f74c1d5bde45111c8ef))
53
- * template border radius ([985f94d](https://github.com/liquidcommerce/rmn-sdk/commit/985f94dc98f637be09bb5c746375cf6dcfe9a799))
54
-
55
- ## [1.3.1-beta.1](https://github.com/liquidcommerce/rmn-sdk/compare/v1.3.0...v1.3.1-beta.1) (2024-10-01)
56
-
57
-
58
- ### Bug Fixes
59
-
60
- * build ([5b022a2](https://github.com/liquidcommerce/rmn-sdk/commit/5b022a28d803a746e4fa9eedfc3d4275d91639df))
61
- * relase fix ([ba74044](https://github.com/liquidcommerce/rmn-sdk/commit/ba74044787c47d446ce8b6688c547a5d968583a0))
62
- * release ([1cd4844](https://github.com/liquidcommerce/rmn-sdk/commit/1cd4844a126786f4336f16517dde6219a25632e1))
63
- * release ([fd7d22f](https://github.com/liquidcommerce/rmn-sdk/commit/fd7d22f9226ceeb2bdec7185400751129e5a7b6a))
64
- * revert back release ([97340e6](https://github.com/liquidcommerce/rmn-sdk/commit/97340e6feca451487ab99f74c1d5bde45111c8ef))
65
- * template border radius ([985f94d](https://github.com/liquidcommerce/rmn-sdk/commit/985f94dc98f637be09bb5c746375cf6dcfe9a799))
package/dist/index.d.ts DELETED
@@ -1,192 +0,0 @@
1
- declare enum RMN_SPOT_TYPE {
2
- RB_HOMEPAGE_HERO_THREE_TILE = "rbHomepageHeroThreeTile",
3
- RB_HOMEPAGE_HERO_TWO_TILE = "rbHomepageHeroTwoTile",
4
- RB_HOMEPAGE_HERO_FULL_IMAGE = "rbHomepageHeroFullImage",
5
- RB_LARGE_CATEGORY_IMAGE_TOUT = "rbLargeCategoryImageTout",
6
- RB_SMALL_DISCOVER_TOUT = "rbSmallDiscoverTout",
7
- RB_SMALL_CATEGORY_IMAGE_TOUT = "rbSmallCategoryImageTout",
8
- RB_COLLECTION_BANNER_WITHOUT_TEXT_BLOCK = "rbCollectionBannerWithoutTextBlock",
9
- RB_PRODUCT_UPCS = "rbProductUpcs",
10
- RB_NAVIGATION_BANNER = "rbNavigationBanner",
11
- BILLBOARD = "billboard",
12
- LARGE_RECTANGLE = "largeRectangle",
13
- VERTICAL_RECTANGLE = "verticalRectangle",
14
- SQUARE = "square",
15
- LARGE_LEADERBOARD = "largeLeaderboard",
16
- WIDE_SKYSCRAPER = "wideSkyscraper",
17
- IN_TEXT = "inText",
18
- SMALL_RECTANGLE = "smallRectangle",
19
- MEDIUM_RECTANGLE = "mediumRectangle",
20
- BANNER = "banner",
21
- LEADERBOARD = "leaderboard",
22
- SKYSCRAPER = "skyscraper",
23
- HALF_PAGE = "halfPage",
24
- SMALL_SQUARE = "smallSquare",
25
- VERTICAL_BANNER = "verticalBanner",
26
- BUTTON_2 = "button2",
27
- MICRO_BAR = "microBar",
28
- POP_UP = "popUp",
29
- PORTRAIT = "portrait",
30
- SMARTPHONE_BANNER_1 = "smartphoneBanner1",
31
- SMARTPHONE_BANNER_2 = "smartphoneBanner2",
32
- MOBILE_PHONE_INTERSTITIAL_1 = "mobilePhoneInterstitial1",
33
- MOBILE_PHONE_INTERSTITIAL_2 = "mobilePhoneInterstitial2",
34
- MOBILE_PHONE_INTERSTITIAL_3 = "mobilePhoneInterstitial3",
35
- FEATURE_PHONE_SMALL_BANNER = "featurePhoneSmallBanner",
36
- FEATURE_PHONE_MEDIUM_BANNER = "featurePhoneMediumBanner",
37
- FEATURE_PHONE_LARGE_BANNER = "featurePhoneLargeBanner"
38
- }
39
- declare enum RMN_FILTER_PROPERTIES {
40
- KEYWORDS = "keywords",
41
- PARENTCO = "parentCo",
42
- BRAND = "brand",
43
- CATEGORY = "category",
44
- TYPE = "type",
45
- CLASSIFICATION = "classification",
46
- HOLIDAY = "holiday",
47
- PUBLISHERS = "publishers",
48
- SECTION = "section"
49
- }
50
- declare enum RMN_SPOT_EVENT {
51
- IMPRESSION = "IMPRESSION",
52
- CLICK = "CLICK",
53
- PURCHASE = "PURCHASE",
54
- ADD_TO_CART = "ADD_TO_CART",
55
- ADD_TO_WISHLIST = "ADD_TO_WISHLIST",
56
- BUY_NOW = "BUY_NOW"
57
- }
58
-
59
- declare enum RMN_ENV {
60
- LOCAL = "local",
61
- DEVELOPMENT = "development",
62
- STAGING = "staging",
63
- PRODUCTION = "production"
64
- }
65
-
66
- interface IAuthCredentials {
67
- authenticated: boolean;
68
- token: string;
69
- apiKey: string;
70
- env: RMN_ENV;
71
- }
72
-
73
- type RmnFilterType = {
74
- [key in RMN_FILTER_PROPERTIES]?: string[];
75
- };
76
- type SpotFilterType = {
77
- spot: RMN_SPOT_TYPE | string;
78
- count: number;
79
- exactMatch?: string;
80
- } & Omit<RmnFilterType, RMN_FILTER_PROPERTIES.KEYWORDS>;
81
- type SpotIdentifierType = RMN_SPOT_TYPE | `${RMN_SPOT_TYPE}${number}`;
82
- type RmnSpotType = RMN_SPOT_TYPE | string | SpotFilterType;
83
- type RBSpotTypeKeys = keyof {
84
- [K in keyof typeof RMN_SPOT_TYPE as K extends `RB_${string}` ? K : never]: (typeof RMN_SPOT_TYPE)[K];
85
- };
86
- type IABSpotTypeKeys = keyof {
87
- [K in keyof typeof RMN_SPOT_TYPE as K extends `RB_${string}` ? never : K]: (typeof RMN_SPOT_TYPE)[K];
88
- };
89
- type RBSpotTypeValues = (typeof RMN_SPOT_TYPE)[RBSpotTypeKeys];
90
- type IABSpotTypeValues = (typeof RMN_SPOT_TYPE)[IABSpotTypeKeys];
91
- type SpotVariantType = RBSpotTypeValues | `${IABSpotTypeValues}V${number}`;
92
-
93
- interface ISpotSelectionParams {
94
- spots: RmnSpotType[];
95
- filter?: Partial<RmnFilterType>;
96
- }
97
- interface ISpotEvent {
98
- event: RMN_SPOT_EVENT;
99
- url: string;
100
- }
101
- interface ISpot {
102
- events: ISpotEvent[];
103
- spot: RMN_SPOT_TYPE;
104
- variant: SpotVariantType;
105
- width: number;
106
- height: number;
107
- preHeader?: string;
108
- header?: string;
109
- description?: string;
110
- ctaText?: string;
111
- textColor?: string;
112
- backgroundColor?: string;
113
- ctaTextColor?: string;
114
- ctaBorderColor?: string;
115
- primaryImage?: string;
116
- secondaryImage?: string;
117
- mobilePrimaryImage?: string;
118
- mobileSecondaryImage?: string;
119
- productUpcs?: string[];
120
- env: RMN_ENV;
121
- }
122
- interface ICreateSpotElementConfig {
123
- fluid?: boolean;
124
- customHtmlElement?: HTMLElement;
125
- redirectOnClick?: boolean;
126
- }
127
- type ISpots = Record<SpotIdentifierType, ISpot[]>;
128
-
129
- interface IRmnClient {
130
- spotSelection(data: ISpotSelectionParams): Promise<ISpots>;
131
- createSpotElement(spot: ISpot, config?: ICreateSpotElementConfig): HTMLElement | null;
132
- }
133
- interface IRmnConfig {
134
- env: RMN_ENV;
135
- }
136
-
137
- declare class LiquidCommerceRmnClient implements IRmnClient {
138
- private readonly spotSelectionService;
139
- private readonly spotHtmlService;
140
- constructor(auth: IAuthCredentials);
141
- /**
142
- * Makes a selection request on our server based on the provided data.
143
- *
144
- * To create a spot html element, use the RmnCreateSpotElement function.
145
- *
146
- * @param {ISpotSelectionParams} data - Spots selection parameters.
147
- *
148
- * @return {Promise<ISpots>} - The spots response object.
149
- */
150
- spotSelection(data: ISpotSelectionParams): Promise<ISpots>;
151
- /**
152
- * Creates the spot html element based on the provided data using shadow dom.
153
- *
154
- * This method is useful when you are initializing the client in a browser environment, so you can create the spot html element directly from the RmnClient instance.
155
- *
156
- * @param {ISpot} spot - The spot data.
157
- * @param {ICreateSpotElementConfig} config - The configuration object.
158
- * @param {ICreateSpotElementConfig.fluid} config.fluid - If the spot should be fluid or not.
159
- * @param {ICreateSpotElementConfig.customHtmlElement} config.customHtmlElement - Use a custom html element.
160
- * @param {ICreateSpotElementConfig.redirectOnClick} config.redirectOnClick - If the spot should redirect on click.
161
- *
162
- * @return {HTMLElement | null} - The spot html element or null if the browser environment is not available.
163
- */
164
- createSpotElement(spot: ISpot, config?: ICreateSpotElementConfig): HTMLElement | null;
165
- }
166
- /**
167
- * Creates a new instance of the RmnClient.
168
- *
169
- * @param {string} apiKey - The api key.
170
- * @param {IRmnConfig} config - The configuration object.
171
- *
172
- * @return {Promise<IRmnClient>} - The RmnClient instance.
173
- */
174
- declare function RmnClient(apiKey: string, config: IRmnConfig): Promise<IRmnClient>;
175
- /**
176
- * Creates the spot html element based on the provided data using shadow dom.
177
- *
178
- * This method is useful when you are initializing the client in a non-browser environment.
179
- * When you request a spot selection, you will receive the spot data in server-side and return them back to the client.
180
- * Then you can use this function to create the spot html element based on the provided data without the need of the RmnClient instance.
181
- *
182
- * @param {ISpot} spot - The spot data.
183
- * @param {ICreateSpotElementConfig} config - The configuration object.
184
- * @param {ICreateSpotElementConfig.fluid} config.fluid - If the spot should be fluid or not.
185
- * @param {ICreateSpotElementConfig.customHtmlElement} config.customHtmlElement - Use a custom html element.
186
- * @param {ICreateSpotElementConfig.redirectOnClick} config.redirectOnClick - If the spot should redirect on click.
187
- *
188
- * @return {HTMLElement | null} - The spot html element or null if the browser environment is not available.
189
- */
190
- declare function RmnCreateSpotElement(spot: ISpot, config?: ICreateSpotElementConfig): HTMLElement | null;
191
-
192
- export { type ICreateSpotElementConfig, type IRmnClient, type IRmnConfig, type ISpot, type ISpotEvent, type ISpotSelectionParams, type ISpots, LiquidCommerceRmnClient, RMN_ENV, RMN_FILTER_PROPERTIES, RMN_SPOT_EVENT, RMN_SPOT_TYPE, RmnClient, RmnCreateSpotElement, type RmnFilterType, type RmnSpotType };