@leadmetrics-ai/website-sdk 1.0.2 → 1.0.3

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.
@@ -0,0 +1,12 @@
1
+ import { PostModel } from "./types";
2
+ import { SearchResult } from "../models";
3
+ export declare const blogService: {
4
+ getBlogCategories: () => Promise<string[]>;
5
+ getFeaturedPost: () => Promise<PostModel>;
6
+ getBlogPosts: (count: number) => Promise<SearchResult<PostModel>>;
7
+ getBlogPostsForPage: (count: number, page: number) => Promise<SearchResult<PostModel>>;
8
+ getBlogPostsForCategory: (count: number, category: string) => Promise<SearchResult<PostModel>>;
9
+ getBlogPost: (slug: string | string[] | undefined) => Promise<PostModel>;
10
+ getSimilarPosts: (id: string, count: number) => Promise<PostModel[]>;
11
+ getAllPosts: () => Promise<PostModel[]>;
12
+ };
@@ -0,0 +1,54 @@
1
+ export declare class PostMetric {
2
+ channel: string;
3
+ key: string;
4
+ value: string;
5
+ }
6
+ export declare class PostMetricResult {
7
+ metrics: PostMetric[];
8
+ }
9
+ export declare class ChannelPostStatusInfo {
10
+ id: string;
11
+ channelId: string;
12
+ title: string;
13
+ type: string;
14
+ postId: string;
15
+ status: boolean;
16
+ publishedOn: Date;
17
+ metrics: PostMetric[];
18
+ }
19
+ export declare class MediaInfoModel {
20
+ slug: string;
21
+ type: string;
22
+ name: string;
23
+ }
24
+ export interface PostModel {
25
+ slug: string;
26
+ status: string;
27
+ category: string;
28
+ featuredImage: string;
29
+ title: string;
30
+ previewContent: string;
31
+ content: string;
32
+ impressions: number;
33
+ channelPosts: ChannelPostStatusInfo[];
34
+ media: MediaInfoModel[];
35
+ views: number;
36
+ likes: number;
37
+ publishedOn: Date;
38
+ tags: string[];
39
+ updatedOn: Date;
40
+ updatedByUserId: string;
41
+ createdByUser?: any;
42
+ createdByUserId: string;
43
+ metrics: PostMetric[];
44
+ id: string;
45
+ refId: string;
46
+ readTime: number;
47
+ createdOn: Date;
48
+ isFeatured: boolean;
49
+ image: string;
50
+ author: {
51
+ name: string;
52
+ id: string;
53
+ };
54
+ }
@@ -0,0 +1,8 @@
1
+ import { Cart, CartBody, ShippingAddress } from "./types";
2
+ export declare const cartService: {
3
+ getCart: (id: string) => Promise<Cart>;
4
+ createCart: (body: CartBody) => Promise<Cart>;
5
+ updateCart: (id: string, body: CartBody) => Promise<Cart>;
6
+ deleteCart: (id: string, body?: CartBody) => Promise<Cart>;
7
+ setShippingAddress: (id: string, body?: ShippingAddress) => Promise<Cart>;
8
+ };
@@ -0,0 +1,42 @@
1
+ export interface Cart {
2
+ lineItems: LineItem[];
3
+ total: number;
4
+ currency: string;
5
+ currencySymbol: string;
6
+ updatedOn: string | null;
7
+ updatedByUserId: string | null;
8
+ deletedOn: string | null;
9
+ deletedByUserId: string | null;
10
+ createdByUser: string | null;
11
+ createdByUserId: string | null;
12
+ tenantId: string | null;
13
+ id: string;
14
+ refId: string;
15
+ createdOn: string;
16
+ shippingAddress?: ShippingAddress;
17
+ }
18
+ export interface LineItem {
19
+ id: string;
20
+ productId: string;
21
+ productSlug: string;
22
+ productName: string;
23
+ price: number;
24
+ quantity: number;
25
+ productImage: string;
26
+ currency: string;
27
+ currencySymbol: string;
28
+ }
29
+ export interface CartBody {
30
+ productId?: string;
31
+ quantity?: number;
32
+ id?: string;
33
+ }
34
+ export interface ShippingAddress {
35
+ name?: string;
36
+ email?: string;
37
+ mobile?: string;
38
+ address1?: string;
39
+ city?: string;
40
+ postalCode?: string;
41
+ country?: string;
42
+ }
@@ -0,0 +1,2 @@
1
+ declare const client: import("axios").AxiosInstance;
2
+ export default client;
@@ -0,0 +1,4 @@
1
+ import { ContactUsModel } from "./types";
2
+ export declare const formService: {
3
+ post: (formId: string, formData: ContactUsModel) => Promise<any>;
4
+ };
@@ -0,0 +1,19 @@
1
+ import * as yup from "yup";
2
+ export declare class ContactUsModel {
3
+ name: string;
4
+ email: string;
5
+ mobile: string;
6
+ whatsapp: string;
7
+ message: string;
8
+ }
9
+ export declare const ContactUsSchema: yup.ObjectSchema<{
10
+ name: string;
11
+ email: string;
12
+ mobile: string;
13
+ message: string;
14
+ }, yup.AnyObject, {
15
+ name: undefined;
16
+ email: undefined;
17
+ mobile: undefined;
18
+ message: undefined;
19
+ }, "">;
@@ -0,0 +1,18 @@
1
+ import { blogService } from "./blog";
2
+ import * as PostTypes from "./blog/types";
3
+ import { cartService } from "./cart";
4
+ import * as CartTypes from "./cart/types";
5
+ import { productService } from "./products";
6
+ import * as ProductTypes from "./products/types";
7
+ import { formService } from "./form";
8
+ import * as FormTypes from "./form/types";
9
+ import * as Utils from "./utils";
10
+ import { notificationService } from "./utils/notification";
11
+ export interface PostEventModel {
12
+ title: string;
13
+ start: Date;
14
+ end: Date;
15
+ resource: any;
16
+ }
17
+ /** cart library */
18
+ export { blogService, PostTypes, cartService, CartTypes, productService, ProductTypes, formService, FormTypes, notificationService, Utils };
@@ -0,0 +1,11 @@
1
+ export declare class PagingInfo {
2
+ currentPage: number;
3
+ itemsPerPage: number;
4
+ hasNextPage: boolean;
5
+ totalItems: number;
6
+ constructor(currentPage: number, itemsPerPage: number, hasNextPage: boolean);
7
+ }
8
+ export declare class SearchResult<T> {
9
+ items: Array<T>;
10
+ pagingInfo: PagingInfo;
11
+ }
@@ -0,0 +1,13 @@
1
+ import { SearchResult } from "../models";
2
+ import { ProductCategoryModel, ProductModel } from "./types";
3
+ export declare const productService: {
4
+ getAllProductCategories: () => Promise<ProductCategoryModel[]>;
5
+ getProductCategory: (slug: string | string[] | undefined) => Promise<ProductCategoryModel>;
6
+ getProducts: (count: number) => Promise<SearchResult<ProductModel>>;
7
+ getProductsForPage: (count: number, page: number) => Promise<SearchResult<ProductModel>>;
8
+ searchProducts: (q: string, category: string, count: number, page: number, sort: string) => Promise<SearchResult<ProductModel>>;
9
+ searchProductsByCategorySlug: (categorySlug: string, count: number, page: number, sort: string) => Promise<SearchResult<ProductModel>>;
10
+ getAllProducts: () => Promise<ProductModel[]>;
11
+ getProduct: (slug: string | string[] | undefined) => Promise<ProductModel>;
12
+ getSimilarProducts: (id: string, count: number) => Promise<ProductModel[]>;
13
+ };
@@ -0,0 +1,60 @@
1
+ export interface ProductVariantModel {
2
+ isActive: boolean;
3
+ isFeatured: boolean;
4
+ slug: string;
5
+ images: string[];
6
+ featuredImage: string;
7
+ title: string;
8
+ previewContent: string;
9
+ content: string;
10
+ price: number;
11
+ weight: number;
12
+ impressions: number;
13
+ views: number;
14
+ likes: number;
15
+ tags: string[];
16
+ id: string;
17
+ }
18
+ export interface ProductModel {
19
+ isActive: boolean;
20
+ isFeatured: boolean;
21
+ slug: string;
22
+ type: string;
23
+ category: string;
24
+ images: string[];
25
+ featuredImage: string;
26
+ title: string;
27
+ previewContent: string;
28
+ content: string;
29
+ price: number;
30
+ weight: number;
31
+ impressions: number;
32
+ views: number;
33
+ likes: number;
34
+ publishedOn: Date;
35
+ tags: string[];
36
+ variants: ProductVariantModel[];
37
+ updatedOn: Date;
38
+ updatedByUserId: string;
39
+ createdByUser?: any;
40
+ createdByUserId: string;
41
+ id: string;
42
+ refId: string;
43
+ createdOn: Date;
44
+ }
45
+ export interface ProductCategoryModel {
46
+ isActive: boolean;
47
+ slug: string;
48
+ featuredImage: string;
49
+ name: string;
50
+ description: string;
51
+ products: number;
52
+ publishedOn: Date;
53
+ updatedOn: Date;
54
+ updatedByUserId: string;
55
+ createdByUser?: any;
56
+ createdByUserId: string;
57
+ id: string;
58
+ refId: string;
59
+ createdOn: Date;
60
+ }
@@ -0,0 +1 @@
1
+ export { default as BrowserPersistence } from './persistence';
@@ -0,0 +1,4 @@
1
+ export declare const notificationService: {
2
+ success: (message: string) => void;
3
+ error: (message: string) => void;
4
+ };
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Persistence layer with expiration based on localStorage.
3
+ */
4
+ declare class NamespacedLocalStorage {
5
+ localStorage: any;
6
+ key: string;
7
+ constructor(localStorage: any, key: string);
8
+ _makeKey(key: string): string;
9
+ getItem(name: any): any;
10
+ setItem(name: any, value: any): any;
11
+ removeItem(name: any): any;
12
+ }
13
+ export default class BrowserPersistence {
14
+ static KEY: string;
15
+ storage: NamespacedLocalStorage;
16
+ constructor(localStorage?: {
17
+ length: number;
18
+ getItem(): void;
19
+ setItem(): void;
20
+ removeItem(): void;
21
+ clear(): void;
22
+ } | Storage);
23
+ getRawItem(name: string): any;
24
+ getItem(name: string): any;
25
+ setItem(name: string, value: any, ttl?: any): void;
26
+ removeItem(name: any): void;
27
+ }
28
+ export {};
@@ -0,0 +1,15 @@
1
+ export let entry: string;
2
+ export namespace module {
3
+ let rules: {
4
+ test: RegExp;
5
+ use: string;
6
+ exclude: RegExp;
7
+ }[];
8
+ }
9
+ export namespace resolve {
10
+ let extensions: string[];
11
+ }
12
+ export namespace output {
13
+ let filename: string;
14
+ let path: string;
15
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leadmetrics-ai/website-sdk",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "SDK for creating websites",
5
5
  "main": "index.js",
6
6
  "scripts": {