@liquidcommercedev/rmn-sdk 1.4.0 → 1.4.1-beta.1
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +10 -0
- package/README.md +5 -10
- package/dist/index.d.ts +19 -8
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,13 @@
|
|
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
|
+
|
1
11
|
# [1.4.0](https://github.com/liquidcommerce/rmn-sdk/compare/v1.3.1...v1.4.0) (2024-10-03)
|
2
12
|
|
3
13
|
|
package/README.md
CHANGED
@@ -61,7 +61,7 @@ import { RmnClient } from '@liquidcommercedev/rmn-sdk';
|
|
61
61
|
import { RmnClient } from '@liquidcommercedev/rmn-sdk';
|
62
62
|
// Your Account token provided to you through your account representative
|
63
63
|
const client = await RmnClient('YOUR_API_KEY', {
|
64
|
-
env: '
|
64
|
+
env: 'staging'
|
65
65
|
});
|
66
66
|
```
|
67
67
|
|
@@ -78,17 +78,12 @@ An example use case for LiquidCommerce's `spotSelection({})` method.
|
|
78
78
|
import RmnClient from '@liquidcommercedev/rmn-sdk';
|
79
79
|
// Your Account token provided to you through your account representative
|
80
80
|
const client = await RmnClient('YOUR_API_KEY', {
|
81
|
-
env: '
|
81
|
+
env: 'staging'
|
82
82
|
});
|
83
83
|
|
84
|
-
const
|
84
|
+
const spots = await client.spotSelection({
|
85
85
|
"spots": ['billboard', 'leaderboard']
|
86
86
|
});
|
87
87
|
|
88
|
-
console.log(
|
89
|
-
```
|
90
|
-
|
91
|
-
>
|
92
|
-
> **CURRENTLY IN PRIVATE BETA UNDERGOING FINAL UAT FOR PRODUCTION RELEASE.**
|
93
|
-
>
|
94
|
-
>
|
88
|
+
console.log({ spots });
|
89
|
+
```
|
package/dist/index.d.ts
CHANGED
@@ -48,6 +48,8 @@ declare enum RMN_FILTER_PROPERTIES {
|
|
48
48
|
SECTION = "section"
|
49
49
|
}
|
50
50
|
declare enum RMN_SPOT_EVENT {
|
51
|
+
IMPRESSION = "IMPRESSION",
|
52
|
+
CLICK = "CLICK",
|
51
53
|
PURCHASE = "PURCHASE",
|
52
54
|
ADD_TO_CART = "ADD_TO_CART",
|
53
55
|
ADD_TO_WISHLIST = "ADD_TO_WISHLIST",
|
@@ -97,8 +99,6 @@ interface ISpotEvent {
|
|
97
99
|
url: string;
|
98
100
|
}
|
99
101
|
interface ISpot {
|
100
|
-
clickUrl: string;
|
101
|
-
impressionUrl: string;
|
102
102
|
events: ISpotEvent[];
|
103
103
|
spot: RMN_SPOT_TYPE;
|
104
104
|
variant: SpotVariantType;
|
@@ -119,11 +119,16 @@ interface ISpot {
|
|
119
119
|
productUpcs?: string[];
|
120
120
|
env: RMN_ENV;
|
121
121
|
}
|
122
|
+
interface ICreateSpotElementConfig {
|
123
|
+
fluid?: boolean;
|
124
|
+
customHtmlElement?: HTMLElement;
|
125
|
+
redirectOnClick?: boolean;
|
126
|
+
}
|
122
127
|
type ISpots = Record<SpotIdentifierType, ISpot[]>;
|
123
128
|
|
124
129
|
interface IRmnClient {
|
125
130
|
spotSelection(data: ISpotSelectionParams): Promise<ISpots>;
|
126
|
-
createSpotElement(spot: ISpot,
|
131
|
+
createSpotElement(spot: ISpot, config?: ICreateSpotElementConfig): HTMLElement | null;
|
127
132
|
}
|
128
133
|
interface IRmnConfig {
|
129
134
|
env: RMN_ENV;
|
@@ -149,11 +154,14 @@ declare class LiquidCommerceRmnClient implements IRmnClient {
|
|
149
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.
|
150
155
|
*
|
151
156
|
* @param {ISpot} spot - The spot data.
|
152
|
-
* @param {
|
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.
|
153
161
|
*
|
154
162
|
* @return {HTMLElement | null} - The spot html element or null if the browser environment is not available.
|
155
163
|
*/
|
156
|
-
createSpotElement(spot: ISpot,
|
164
|
+
createSpotElement(spot: ISpot, config?: ICreateSpotElementConfig): HTMLElement | null;
|
157
165
|
}
|
158
166
|
/**
|
159
167
|
* Creates a new instance of the RmnClient.
|
@@ -172,10 +180,13 @@ declare function RmnClient(apiKey: string, config: IRmnConfig): Promise<IRmnClie
|
|
172
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.
|
173
181
|
*
|
174
182
|
* @param {ISpot} spot - The spot data.
|
175
|
-
* @param {
|
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.
|
176
187
|
*
|
177
188
|
* @return {HTMLElement | null} - The spot html element or null if the browser environment is not available.
|
178
189
|
*/
|
179
|
-
declare function RmnCreateSpotElement(spot: ISpot,
|
190
|
+
declare function RmnCreateSpotElement(spot: ISpot, config?: ICreateSpotElementConfig): HTMLElement | null;
|
180
191
|
|
181
|
-
export { 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 };
|
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 };
|