@leadmetrics-ai/website-sdk 1.0.6 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +2 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +241 -0
- package/dist/index.esm.js +2 -0
- package/dist/index.esm.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Utils=exports.notificationService=exports.ContactUsModel=exports.formService=exports.ProductCategoryModel=exports.ProductVariantModel=exports.ProductModel=exports.productService=exports.cartService=exports.PostModel=exports.blogService=exports.PostEventModel=void 0;const e=require("tslib"),r=require("./blog");Object.defineProperty(exports,"blogService",{enumerable:!0,get:function(){return r.blogService}});const t=require("./blog/types");Object.defineProperty(exports,"PostModel",{enumerable:!0,get:function(){return t.PostModel}});const o=require("./cart");Object.defineProperty(exports,"cartService",{enumerable:!0,get:function(){return o.cartService}});const n=require("./products");Object.defineProperty(exports,"productService",{enumerable:!0,get:function(){return n.productService}});const c=require("./products/types");Object.defineProperty(exports,"ProductModel",{enumerable:!0,get:function(){return c.ProductModel}}),Object.defineProperty(exports,"ProductVariantModel",{enumerable:!0,get:function(){return c.ProductVariantModel}}),Object.defineProperty(exports,"ProductCategoryModel",{enumerable:!0,get:function(){return c.ProductCategoryModel}});const i=require("./form");Object.defineProperty(exports,"formService",{enumerable:!0,get:function(){return i.formService}});const u=require("./form/types");Object.defineProperty(exports,"ContactUsModel",{enumerable:!0,get:function(){return u.ContactUsModel}});const s=e.__importStar(require("./utils"));exports.Utils=s;const p=require("./utils/notification");Object.defineProperty(exports,"notificationService",{enumerable:!0,get:function(){return p.notificationService}});exports.PostEventModel=class{};
|
|
2
|
+
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../src/index.ts"],"sourcesContent":["\r\nimport { blogService } from \"./blog\";\r\nimport { PostModel } from \"./blog/types\";\r\nimport { cartService } from \"./cart\";\r\nimport { Cart, CartBody, ShippingAddress } from \"./cart/types\";\r\nimport { productService } from \"./products\";\r\nimport { ProductModel, ProductVariantModel, ProductCategoryModel } from \"./products/types\";\r\nimport { formService } from \"./form\";\r\nimport {ContactUsModel} from \"./form/types\";\r\nimport * as Utils from \"./utils\";\r\nimport { notificationService } from \"./utils/notification\";\r\n\r\nexport class PostEventModel {\r\n title?: string;\r\n start?: Date;\r\n end?: Date;\r\n resource?: any;\r\n}\r\n\r\n/** cart library */\r\nexport { blogService, PostModel, cartService, Cart, CartBody, ShippingAddress, productService, ProductModel, ProductVariantModel, ProductCategoryModel, formService, ContactUsModel, notificationService, Utils };\r\n"],"names":["blog_1","require","Object","defineProperty","exports","enumerable","get","types_1","cart_1","products_1","types_2","form_1","types_3","Utils","tslib_1","__importStar","notification_1","PostEventModel"],"mappings":"+WACqCA,EAAAC,QAAA,UAmB5BC,OAAAC,eAAAC,QAAA,cAAA,CAAAC,YAAA,EAAAC,IAAA,WAAA,OAnBAN,aAmBW,IAlBpB,MAAyCO,EAAAN,QAAA,gBAkBnBC,OAAAC,eAAAC,QAAA,YAAA,CAAAC,YAAA,EAAAC,IAAA,WAAA,OAlBbC,WAkBsB,IAjB/B,MAAqCC,EAAAP,QAAA,UAiBJC,OAAAC,eAAAC,QAAA,cAAA,CAAAC,YAAA,EAAAC,IAAA,WAAA,OAjBxBE,aAiBmC,IAf5C,MAA4CC,EAAAR,QAAA,cAemCC,OAAAC,eAAAC,QAAA,iBAAA,CAAAC,YAAA,EAAAC,IAAA,WAAA,OAftEG,gBAeoF,IAd7F,MAA2FC,EAAAT,QAAA,oBAcIC,OAAAC,eAAAC,QAAA,eAAA,CAAAC,YAAA,EAAAC,IAAA,WAAA,OAdtFI,cAckG,IAAER,OAAAC,eAAAC,QAAA,sBAAA,CAAAC,YAAA,EAAAC,IAAA,WAAA,OAdtFI,qBAcyG,IAAER,OAAAC,eAAAC,QAAA,uBAAA,CAAAC,YAAA,EAAAC,IAAA,WAAA,OAdtFI,sBAc0G,IAbtJ,MAAqCC,EAAAV,QAAA,UAamHC,OAAAC,eAAAC,QAAA,cAAA,CAAAC,YAAA,EAAAC,IAAA,WAAA,OAb/IK,aAa0J,IAZnK,MAA4CC,EAAAX,QAAA,gBAYyHC,OAAAC,eAAAC,QAAA,iBAAA,CAAAC,YAAA,EAAAC,IAAA,WAAA,OAZ7JM,gBAY2K,IAXnL,MAAiCC,EAAAC,EAAAC,aAAAd,QAAA,YAWyKG,QAAKS,MAAAA,EAV/M,MAA2DG,EAAAf,QAAA,wBAU0HC,OAAAC,eAAAC,QAAA,sBAAA,CAAAC,YAAA,EAAAC,IAAA,WAAA,OAV5KU,qBAU+L,IARxMZ,QAKCa,eALD"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
declare class PostMetric {
|
|
2
|
+
channel?: string;
|
|
3
|
+
key?: string;
|
|
4
|
+
value?: string;
|
|
5
|
+
}
|
|
6
|
+
declare class MediaInfoModel {
|
|
7
|
+
slug?: string;
|
|
8
|
+
type?: string;
|
|
9
|
+
name?: string;
|
|
10
|
+
}
|
|
11
|
+
declare class PostModel {
|
|
12
|
+
slug?: string;
|
|
13
|
+
status?: string;
|
|
14
|
+
category?: string;
|
|
15
|
+
featuredImage?: string;
|
|
16
|
+
title?: string;
|
|
17
|
+
previewContent?: string;
|
|
18
|
+
content?: string;
|
|
19
|
+
impressions?: number;
|
|
20
|
+
media?: MediaInfoModel[];
|
|
21
|
+
views?: number;
|
|
22
|
+
likes?: number;
|
|
23
|
+
publishedOn?: Date;
|
|
24
|
+
tags?: string[];
|
|
25
|
+
updatedOn?: Date;
|
|
26
|
+
updatedByUserId?: string;
|
|
27
|
+
createdByUser?: string;
|
|
28
|
+
createdByUserId?: string;
|
|
29
|
+
metrics?: PostMetric[];
|
|
30
|
+
id?: string;
|
|
31
|
+
refId?: string;
|
|
32
|
+
readTime?: number;
|
|
33
|
+
createdOn?: Date;
|
|
34
|
+
isFeatured?: boolean;
|
|
35
|
+
image?: string;
|
|
36
|
+
author?: {
|
|
37
|
+
name?: string;
|
|
38
|
+
id?: string;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
declare class PagingInfo {
|
|
43
|
+
currentPage: number;
|
|
44
|
+
itemsPerPage: number;
|
|
45
|
+
hasNextPage: boolean;
|
|
46
|
+
totalItems: number;
|
|
47
|
+
constructor(currentPage: number, itemsPerPage: number, hasNextPage: boolean);
|
|
48
|
+
}
|
|
49
|
+
declare class SearchResult<T> {
|
|
50
|
+
items: Array<T>;
|
|
51
|
+
pagingInfo: PagingInfo;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
declare const blogService: {
|
|
55
|
+
getBlogCategories: () => Promise<string[]>;
|
|
56
|
+
getFeaturedPost: () => Promise<PostModel>;
|
|
57
|
+
getBlogPosts: (count: number) => Promise<SearchResult<PostModel>>;
|
|
58
|
+
getBlogPostsForPage: (count: number, page: number) => Promise<SearchResult<PostModel>>;
|
|
59
|
+
getBlogPostsForCategory: (count: number, category: string) => Promise<SearchResult<PostModel>>;
|
|
60
|
+
getBlogPost: (slug: string | string[] | undefined) => Promise<PostModel>;
|
|
61
|
+
getSimilarPosts: (id: string, count: number) => Promise<PostModel[]>;
|
|
62
|
+
getAllPosts: () => Promise<PostModel[]>;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
interface Cart {
|
|
66
|
+
lineItems?: LineItem[];
|
|
67
|
+
total?: number;
|
|
68
|
+
currency?: string;
|
|
69
|
+
currencySymbol?: string;
|
|
70
|
+
updatedOn?: string | null;
|
|
71
|
+
updatedByUserId?: string | null;
|
|
72
|
+
deletedOn?: string | null;
|
|
73
|
+
deletedByUserId?: string | null;
|
|
74
|
+
createdByUser?: string | null;
|
|
75
|
+
createdByUserId?: string | null;
|
|
76
|
+
tenantId?: string | null;
|
|
77
|
+
id?: string;
|
|
78
|
+
refId?: string;
|
|
79
|
+
createdOn?: string;
|
|
80
|
+
shippingAddress?: ShippingAddress;
|
|
81
|
+
}
|
|
82
|
+
interface LineItem {
|
|
83
|
+
id?: string;
|
|
84
|
+
productId?: string;
|
|
85
|
+
productSlug?: string;
|
|
86
|
+
productName?: string;
|
|
87
|
+
price?: number;
|
|
88
|
+
quantity?: number;
|
|
89
|
+
productImage?: string;
|
|
90
|
+
currency?: string;
|
|
91
|
+
currencySymbol?: string;
|
|
92
|
+
}
|
|
93
|
+
interface CartBody {
|
|
94
|
+
productId?: string;
|
|
95
|
+
quantity?: number;
|
|
96
|
+
id?: string;
|
|
97
|
+
}
|
|
98
|
+
interface ShippingAddress {
|
|
99
|
+
name?: string;
|
|
100
|
+
email?: string;
|
|
101
|
+
mobile?: string;
|
|
102
|
+
address1?: string;
|
|
103
|
+
city?: string;
|
|
104
|
+
postalCode?: string;
|
|
105
|
+
country?: string;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
declare const cartService: {
|
|
109
|
+
getCart: (id: string) => Promise<Cart>;
|
|
110
|
+
createCart: (body: CartBody) => Promise<Cart>;
|
|
111
|
+
updateCart: (id: string, body: CartBody) => Promise<Cart>;
|
|
112
|
+
deleteCart: (id: string, body?: CartBody) => Promise<Cart>;
|
|
113
|
+
setShippingAddress: (id: string, body?: ShippingAddress) => Promise<Cart>;
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
declare class ProductVariantModel {
|
|
117
|
+
isActive: boolean;
|
|
118
|
+
isFeatured: boolean;
|
|
119
|
+
slug: string;
|
|
120
|
+
images: string[];
|
|
121
|
+
featuredImage: string;
|
|
122
|
+
title: string;
|
|
123
|
+
previewContent: string;
|
|
124
|
+
content: string;
|
|
125
|
+
price: number;
|
|
126
|
+
weight: number;
|
|
127
|
+
impressions: number;
|
|
128
|
+
views: number;
|
|
129
|
+
likes: number;
|
|
130
|
+
tags: string[];
|
|
131
|
+
id: string;
|
|
132
|
+
}
|
|
133
|
+
declare class ProductModel {
|
|
134
|
+
isActive: boolean;
|
|
135
|
+
isFeatured: boolean;
|
|
136
|
+
slug: string;
|
|
137
|
+
type: string;
|
|
138
|
+
category: string;
|
|
139
|
+
images: string[];
|
|
140
|
+
featuredImage: string;
|
|
141
|
+
title: string;
|
|
142
|
+
previewContent: string;
|
|
143
|
+
content: string;
|
|
144
|
+
price: number;
|
|
145
|
+
weight: number;
|
|
146
|
+
impressions: number;
|
|
147
|
+
views: number;
|
|
148
|
+
likes: number;
|
|
149
|
+
publishedOn: Date;
|
|
150
|
+
tags: string[];
|
|
151
|
+
variants: ProductVariantModel[];
|
|
152
|
+
updatedOn: Date;
|
|
153
|
+
updatedByUserId: string;
|
|
154
|
+
createdByUser: string;
|
|
155
|
+
createdByUserId: string;
|
|
156
|
+
id: string;
|
|
157
|
+
refId: string;
|
|
158
|
+
createdOn: Date;
|
|
159
|
+
}
|
|
160
|
+
declare class ProductCategoryModel {
|
|
161
|
+
isActive: boolean;
|
|
162
|
+
slug: string;
|
|
163
|
+
featuredImage: string;
|
|
164
|
+
name: string;
|
|
165
|
+
description: string;
|
|
166
|
+
products: number;
|
|
167
|
+
publishedOn: Date;
|
|
168
|
+
updatedOn: Date;
|
|
169
|
+
updatedByUserId: string;
|
|
170
|
+
createdByUser: string;
|
|
171
|
+
createdByUserId: string;
|
|
172
|
+
id: string;
|
|
173
|
+
refId: string;
|
|
174
|
+
createdOn: Date;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
declare const productService: {
|
|
178
|
+
getAllProductCategories: () => Promise<ProductCategoryModel[]>;
|
|
179
|
+
getProductCategory: (slug: string | string[] | undefined) => Promise<ProductCategoryModel>;
|
|
180
|
+
getProducts: (count: number) => Promise<SearchResult<ProductModel>>;
|
|
181
|
+
getProductsForPage: (count: number, page: number) => Promise<SearchResult<ProductModel>>;
|
|
182
|
+
searchProducts: (q: string, category: string, count: number, page: number, sort: string) => Promise<SearchResult<ProductModel>>;
|
|
183
|
+
searchProductsByCategorySlug: (categorySlug: string, count: number, page: number, sort: string) => Promise<SearchResult<ProductModel>>;
|
|
184
|
+
getAllProducts: () => Promise<ProductModel[]>;
|
|
185
|
+
getProduct: (slug: string | string[] | undefined) => Promise<ProductModel>;
|
|
186
|
+
getSimilarProducts: (id: string, count: number) => Promise<ProductModel[]>;
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
declare class ContactUsModel {
|
|
190
|
+
name: string;
|
|
191
|
+
email: string;
|
|
192
|
+
mobile: string;
|
|
193
|
+
whatsapp: string;
|
|
194
|
+
message: string;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
declare const formService: {
|
|
198
|
+
post: (formId: string, formData: ContactUsModel) => Promise<any>;
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Persistence layer with expiration based on localStorage.
|
|
203
|
+
*/
|
|
204
|
+
declare class NamespacedLocalStorage {
|
|
205
|
+
localStorage: any;
|
|
206
|
+
key: string;
|
|
207
|
+
constructor(localStorage: any, key: string);
|
|
208
|
+
_makeKey(key: string): string;
|
|
209
|
+
getItem(name: any): any;
|
|
210
|
+
setItem(name: any, value: any): any;
|
|
211
|
+
removeItem(name: any): any;
|
|
212
|
+
}
|
|
213
|
+
declare class BrowserPersistence {
|
|
214
|
+
static KEY: string;
|
|
215
|
+
storage: NamespacedLocalStorage;
|
|
216
|
+
constructor(localStorage?: Storage);
|
|
217
|
+
getRawItem(name: string): any;
|
|
218
|
+
getItem(name: string): any;
|
|
219
|
+
setItem(name: string, value: any, ttl?: any): void;
|
|
220
|
+
removeItem(name: any): void;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
type index_BrowserPersistence = BrowserPersistence;
|
|
224
|
+
declare const index_BrowserPersistence: typeof BrowserPersistence;
|
|
225
|
+
declare namespace index {
|
|
226
|
+
export { index_BrowserPersistence as BrowserPersistence };
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
declare const notificationService: {
|
|
230
|
+
success: (message: string) => void;
|
|
231
|
+
error: (message: string) => void;
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
declare class PostEventModel {
|
|
235
|
+
title?: string;
|
|
236
|
+
start?: Date;
|
|
237
|
+
end?: Date;
|
|
238
|
+
resource?: any;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
export { type Cart, type CartBody, ContactUsModel, PostEventModel, PostModel, ProductCategoryModel, ProductModel, ProductVariantModel, type ShippingAddress, index as Utils, blogService, cartService, formService, notificationService, productService };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.Utils=exports.notificationService=exports.ContactUsModel=exports.formService=exports.ProductCategoryModel=exports.ProductVariantModel=exports.ProductModel=exports.productService=exports.cartService=exports.PostModel=exports.blogService=exports.PostEventModel=void 0;const e=require("tslib"),r=require("./blog");Object.defineProperty(exports,"blogService",{enumerable:!0,get:function(){return r.blogService}});const t=require("./blog/types");Object.defineProperty(exports,"PostModel",{enumerable:!0,get:function(){return t.PostModel}});const o=require("./cart");Object.defineProperty(exports,"cartService",{enumerable:!0,get:function(){return o.cartService}});const n=require("./products");Object.defineProperty(exports,"productService",{enumerable:!0,get:function(){return n.productService}});const c=require("./products/types");Object.defineProperty(exports,"ProductModel",{enumerable:!0,get:function(){return c.ProductModel}}),Object.defineProperty(exports,"ProductVariantModel",{enumerable:!0,get:function(){return c.ProductVariantModel}}),Object.defineProperty(exports,"ProductCategoryModel",{enumerable:!0,get:function(){return c.ProductCategoryModel}});const i=require("./form");Object.defineProperty(exports,"formService",{enumerable:!0,get:function(){return i.formService}});const u=require("./form/types");Object.defineProperty(exports,"ContactUsModel",{enumerable:!0,get:function(){return u.ContactUsModel}});const s=e.__importStar(require("./utils"));exports.Utils=s;const p=require("./utils/notification");Object.defineProperty(exports,"notificationService",{enumerable:!0,get:function(){return p.notificationService}});exports.PostEventModel=class{};
|
|
2
|
+
//# sourceMappingURL=index.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../src/index.ts"],"sourcesContent":["\r\nimport { blogService } from \"./blog\";\r\nimport { PostModel } from \"./blog/types\";\r\nimport { cartService } from \"./cart\";\r\nimport { Cart, CartBody, ShippingAddress } from \"./cart/types\";\r\nimport { productService } from \"./products\";\r\nimport { ProductModel, ProductVariantModel, ProductCategoryModel } from \"./products/types\";\r\nimport { formService } from \"./form\";\r\nimport {ContactUsModel} from \"./form/types\";\r\nimport * as Utils from \"./utils\";\r\nimport { notificationService } from \"./utils/notification\";\r\n\r\nexport class PostEventModel {\r\n title?: string;\r\n start?: Date;\r\n end?: Date;\r\n resource?: any;\r\n}\r\n\r\n/** cart library */\r\nexport { blogService, PostModel, cartService, Cart, CartBody, ShippingAddress, productService, ProductModel, ProductVariantModel, ProductCategoryModel, formService, ContactUsModel, notificationService, Utils };\r\n"],"names":["blog_1","require","Object","defineProperty","exports","enumerable","get","types_1","cart_1","products_1","types_2","form_1","types_3","Utils","tslib_1","__importStar","notification_1","PostEventModel"],"mappings":"kWACqCA,EAAAC,QAAA,UAmB5BC,OAAAC,eAAAC,QAAA,cAAA,CAAAC,YAAA,EAAAC,IAAA,WAAA,OAnBAN,aAmBW,IAlBpB,MAAyCO,EAAAN,QAAA,gBAkBnBC,OAAAC,eAAAC,QAAA,YAAA,CAAAC,YAAA,EAAAC,IAAA,WAAA,OAlBbC,WAkBsB,IAjB/B,MAAqCC,EAAAP,QAAA,UAiBJC,OAAAC,eAAAC,QAAA,cAAA,CAAAC,YAAA,EAAAC,IAAA,WAAA,OAjBxBE,aAiBmC,IAf5C,MAA4CC,EAAAR,QAAA,cAemCC,OAAAC,eAAAC,QAAA,iBAAA,CAAAC,YAAA,EAAAC,IAAA,WAAA,OAftEG,gBAeoF,IAd7F,MAA2FC,EAAAT,QAAA,oBAcIC,OAAAC,eAAAC,QAAA,eAAA,CAAAC,YAAA,EAAAC,IAAA,WAAA,OAdtFI,cAckG,IAAER,OAAAC,eAAAC,QAAA,sBAAA,CAAAC,YAAA,EAAAC,IAAA,WAAA,OAdtFI,qBAcyG,IAAER,OAAAC,eAAAC,QAAA,uBAAA,CAAAC,YAAA,EAAAC,IAAA,WAAA,OAdtFI,sBAc0G,IAbtJ,MAAqCC,EAAAV,QAAA,UAamHC,OAAAC,eAAAC,QAAA,cAAA,CAAAC,YAAA,EAAAC,IAAA,WAAA,OAb/IK,aAa0J,IAZnK,MAA4CC,EAAAX,QAAA,gBAYyHC,OAAAC,eAAAC,QAAA,iBAAA,CAAAC,YAAA,EAAAC,IAAA,WAAA,OAZ7JM,gBAY2K,IAXnL,MAAiCC,EAAAC,EAAAC,aAAAd,QAAA,YAWyKG,QAAKS,MAAAA,EAV/M,MAA2DG,EAAAf,QAAA,wBAU0HC,OAAAC,eAAAC,QAAA,sBAAA,CAAAC,YAAA,EAAAC,IAAA,WAAA,OAV5KU,qBAU+L,IARxMZ,QAKCa,eALD"}
|