@signskart/shared 1.3.7 → 1.3.9

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 (52) hide show
  1. package/ReadMe.md +3 -0
  2. package/dist/index.d.mts +514 -0
  3. package/dist/index.d.ts +514 -1
  4. package/dist/index.js +33 -1
  5. package/dist/index.js.map +1 -0
  6. package/dist/index.mjs +6 -0
  7. package/dist/index.mjs.map +1 -0
  8. package/package.json +36 -9
  9. package/dist/interfaces/banner.d.ts +0 -47
  10. package/dist/interfaces/banner.js +0 -1
  11. package/dist/interfaces/category.d.ts +0 -57
  12. package/dist/interfaces/category.js +0 -1
  13. package/dist/interfaces/common.d.ts +0 -3
  14. package/dist/interfaces/common.js +0 -1
  15. package/dist/interfaces/coupon.d.ts +0 -21
  16. package/dist/interfaces/coupon.js +0 -1
  17. package/dist/interfaces/currency.d.ts +0 -9
  18. package/dist/interfaces/currency.js +0 -1
  19. package/dist/interfaces/customerPhotos.d.ts +0 -23
  20. package/dist/interfaces/customerPhotos.js +0 -1
  21. package/dist/interfaces/globalSetting.d.ts +0 -25
  22. package/dist/interfaces/globalSetting.js +0 -1
  23. package/dist/interfaces/index.d.ts +0 -13
  24. package/dist/interfaces/index.js +0 -13
  25. package/dist/interfaces/language.d.ts +0 -9
  26. package/dist/interfaces/language.js +0 -1
  27. package/dist/interfaces/product.d.ts +0 -71
  28. package/dist/interfaces/product.js +0 -1
  29. package/dist/interfaces/productType.d.ts +0 -80
  30. package/dist/interfaces/productType.js +0 -1
  31. package/dist/interfaces/store.d.ts +0 -27
  32. package/dist/interfaces/store.js +0 -1
  33. package/dist/interfaces/subscriber.d.ts +0 -104
  34. package/dist/interfaces/subscriber.js +0 -1
  35. package/dist/interfaces/variant.d.ts +0 -37
  36. package/dist/interfaces/variant.js +0 -1
  37. package/src/index.ts +0 -1
  38. package/src/interfaces/banner.ts +0 -60
  39. package/src/interfaces/category.ts +0 -66
  40. package/src/interfaces/common.ts +0 -3
  41. package/src/interfaces/coupon.ts +0 -24
  42. package/src/interfaces/currency.ts +0 -11
  43. package/src/interfaces/customerPhotos.ts +0 -26
  44. package/src/interfaces/globalSetting.ts +0 -25
  45. package/src/interfaces/index.ts +0 -13
  46. package/src/interfaces/language.ts +0 -9
  47. package/src/interfaces/product.ts +0 -79
  48. package/src/interfaces/productType.ts +0 -100
  49. package/src/interfaces/store.ts +0 -30
  50. package/src/interfaces/subscriber.ts +0 -129
  51. package/src/interfaces/variant.ts +0 -40
  52. package/tsconfig.json +0 -20
@@ -1,57 +0,0 @@
1
- import { ILocalizedString } from "./common";
2
- import { IStore } from "./store";
3
- export declare const TAGS: readonly ["new", "hot", "sale", "featured", "exclusive"];
4
- export type Tag = typeof TAGS[number];
5
- export interface ICategory {
6
- _id?: string;
7
- name: ILocalizedString;
8
- description?: ILocalizedString;
9
- slug: string;
10
- parent?: string | null;
11
- parentName?: string;
12
- children?: string[];
13
- level?: number;
14
- status: boolean;
15
- store: IStore;
16
- skuInitial?: string;
17
- sortPosition?: number;
18
- tags: Tag[];
19
- images: {
20
- desktopBanner?: string;
21
- mobileBanner?: string;
22
- shopPageThumbnail?: string;
23
- categoryThumbnail?: string;
24
- };
25
- metaData?: {
26
- category?: {
27
- titleTag?: string;
28
- headerTag?: string;
29
- metaDescription?: string;
30
- csrKeywords?: string;
31
- };
32
- product?: {
33
- titleTag?: string;
34
- headerTag?: string;
35
- metaDescription?: string;
36
- csrKeywords?: string;
37
- };
38
- };
39
- createdAt?: string;
40
- updatedAt?: string;
41
- productCount?: number;
42
- [key: string]: any;
43
- }
44
- export interface CategoryQueryParams {
45
- page?: number;
46
- limit?: number;
47
- name?: string;
48
- status?: string;
49
- minLevel?: string;
50
- maxLevel?: string;
51
- }
52
- export interface CategoryResponse {
53
- categories: ICategory[];
54
- totalCategories: number;
55
- totalPages: number;
56
- currentPage: number;
57
- }
@@ -1 +0,0 @@
1
- export const TAGS = ['new', 'hot', 'sale', 'featured', 'exclusive'];
@@ -1,3 +0,0 @@
1
- export interface ILocalizedString {
2
- [languageCode: string]: string;
3
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,21 +0,0 @@
1
- import { ILocalizedString } from './common';
2
- import { IStore } from './store';
3
- export interface IDiscountType {
4
- type: string;
5
- value: number;
6
- }
7
- export interface ICoupon {
8
- _id: string;
9
- title: ILocalizedString;
10
- logo: string;
11
- couponCode: string;
12
- startTime: string;
13
- endTime: string;
14
- discountType: IDiscountType;
15
- minimumAmount: number;
16
- isPromotional: boolean;
17
- status: boolean;
18
- store: IStore;
19
- createdAt: string;
20
- updatedAt: string;
21
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,9 +0,0 @@
1
- export interface ICurrency {
2
- _id?: string;
3
- name: string;
4
- symbol: string;
5
- status: boolean;
6
- live_exchange_rates?: 'show' | 'hide';
7
- createdAt?: string;
8
- updatedAt?: string;
9
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,23 +0,0 @@
1
- import { IStore } from './store';
2
- export type CustomerPhotoStatus = 'pending' | 'approved' | 'rejected';
3
- export interface ICustomerPhotos {
4
- _id?: string;
5
- store: IStore;
6
- customer: {
7
- name?: string;
8
- email?: string;
9
- comment?: string;
10
- };
11
- photos: string[];
12
- status: CustomerPhotoStatus;
13
- createdAt: Date;
14
- updatedAt: Date;
15
- }
16
- export interface CustomerPhotosQueryParams {
17
- page?: number;
18
- limit?: number;
19
- name?: string;
20
- email?: string;
21
- status?: CustomerPhotoStatus;
22
- store?: string;
23
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,25 +0,0 @@
1
- export interface IGlobalSetting {
2
- _id: string;
3
- name: string;
4
- number_of_image_per_product: number;
5
- shop_name: string;
6
- address: string;
7
- company_name: string;
8
- vat_number: string;
9
- post_code: string;
10
- contact: string;
11
- email: string;
12
- website: string;
13
- default_currency: string;
14
- default_time_zone: string;
15
- default_date_format: string;
16
- receipt_size: string;
17
- from_email: string;
18
- email_to_customer: boolean;
19
- allow_auto_trans: boolean;
20
- translation_key: string;
21
- default_language: string;
22
- floating_number: number;
23
- createdAt: string;
24
- updatedAt: string;
25
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,13 +0,0 @@
1
- export * from './category';
2
- export * from './product';
3
- export * from './productType';
4
- export * from './globalSetting';
5
- export * from './store';
6
- export * from './currency';
7
- export * from './coupon';
8
- export * from './variant';
9
- export * from './subscriber';
10
- export * from './language';
11
- export * from './banner';
12
- export * from './common';
13
- export * from './customerPhotos';
@@ -1,13 +0,0 @@
1
- export * from './category';
2
- export * from './product';
3
- export * from './productType';
4
- export * from './globalSetting';
5
- export * from './store';
6
- export * from './currency';
7
- export * from './coupon';
8
- export * from './variant';
9
- export * from './subscriber';
10
- export * from './language';
11
- export * from './banner';
12
- export * from './common';
13
- export * from './customerPhotos';
@@ -1,9 +0,0 @@
1
- export interface ILanguage {
2
- _id: string;
3
- name: string;
4
- iso_code: string;
5
- flag: string;
6
- status: boolean;
7
- createdAt: string;
8
- updatedAt: string;
9
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,71 +0,0 @@
1
- import { ICategory, ILocalizedString, IProductType, IStore, IVariant } from "./";
2
- export interface IPrices {
3
- originalPrice: number;
4
- price: number;
5
- discount?: number;
6
- }
7
- export interface IMetaDataProduct {
8
- title?: string;
9
- header?: string;
10
- description?: string;
11
- keywords?: string[];
12
- canonicalUrl?: string;
13
- }
14
- export interface IImages {
15
- productImage?: string;
16
- seoImage?: string;
17
- displayImage?: string;
18
- }
19
- export interface IProduct {
20
- _id: string;
21
- sku?: string;
22
- barcode?: string;
23
- title: ILocalizedString;
24
- description?: ILocalizedString;
25
- slug: string;
26
- categories: ICategory[];
27
- category: ICategory;
28
- productType: IProductType;
29
- image: string[];
30
- stock: number;
31
- sales: number;
32
- tag: string[];
33
- variants: IVariant[];
34
- hasVariant: boolean;
35
- hasSize: boolean;
36
- isCombination: boolean;
37
- prices: IPrices;
38
- status: boolean;
39
- store: IStore;
40
- images?: IImages;
41
- metaData?: {
42
- product?: IMetaDataProduct;
43
- };
44
- createdAt?: Date;
45
- updatedAt?: Date;
46
- variantList?: IVariant[];
47
- [key: string]: any;
48
- }
49
- export interface IProductQuery {
50
- page?: number;
51
- limit?: number;
52
- category?: string;
53
- categories?: string[];
54
- title?: string;
55
- price?: string;
56
- stockStatus?: string;
57
- published?: string;
58
- status?: boolean;
59
- minPrice?: string;
60
- maxPrice?: string;
61
- }
62
- export interface IProductResponse {
63
- products: IProduct[];
64
- totalDoc: number;
65
- limits: number;
66
- pages: number;
67
- }
68
- export interface IProductUpdate {
69
- ids: string[];
70
- [key: string]: any;
71
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,80 +0,0 @@
1
- import { IStore } from "./store";
2
- export interface IProductType {
3
- _id: string;
4
- name: string;
5
- slug: string;
6
- status: boolean;
7
- pricingChart: IPricingChartDocument;
8
- shippingChart: IShippingChartDocument;
9
- variantChart: IVariantChart;
10
- frameChart: IFrameChartDocument;
11
- store: IStore;
12
- }
13
- export interface IPricingTier {
14
- from: number;
15
- to: number;
16
- price: number;
17
- }
18
- export interface IPricingData {
19
- label: string;
20
- tiers: IPricingTier[];
21
- }
22
- export interface IPricingChartDocument {
23
- _id: string;
24
- name: string;
25
- pricing: IPricingData[];
26
- status: boolean;
27
- }
28
- export interface IPricingChartFormProps {
29
- onClose: () => void;
30
- pricingChartId?: string | null;
31
- initialData?: IPricingChartDocument | null;
32
- }
33
- export interface IFrameChartDocument {
34
- _id: string;
35
- name: string;
36
- pricing: IPricingData[];
37
- status: boolean;
38
- }
39
- export interface IFrameChartFormProps {
40
- onClose: () => void;
41
- frameChartId?: string | null;
42
- initialData?: IFrameChartDocument | null;
43
- }
44
- export interface IShippingTier {
45
- from: number;
46
- to: number;
47
- price: number;
48
- }
49
- export interface IShippingData {
50
- label: string;
51
- day: number;
52
- tiers: IShippingTier[];
53
- }
54
- export interface IShippingChartDocument {
55
- _id: string;
56
- name: string;
57
- shipping: IShippingData[];
58
- status: boolean;
59
- }
60
- export interface IShippingChartFormProps {
61
- onClose: () => void;
62
- shippingChartId?: string | null;
63
- initialData?: IShippingChartDocument | null;
64
- }
65
- export interface IVariantOption {
66
- label: string;
67
- }
68
- export interface IVariantChart {
69
- _id: string;
70
- name: string;
71
- status: boolean;
72
- variants: IVariantOption[];
73
- createdAt?: string;
74
- updatedAt?: string;
75
- }
76
- export interface IVariantChartFormProps {
77
- onClose: () => void;
78
- variantChartId?: string | null;
79
- initialData?: IVariantChart | null;
80
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,27 +0,0 @@
1
- import { ICurrency } from "./currency";
2
- export interface IStoreSettings {
3
- logo: string;
4
- theme: 'light' | 'dark';
5
- timezone: string;
6
- }
7
- export interface IStore {
8
- _id?: string;
9
- name: string;
10
- shortName: string;
11
- slug: string;
12
- domain: string;
13
- currency: ICurrency;
14
- settings: IStoreSettings;
15
- status: boolean;
16
- createdAt?: string;
17
- updatedAt?: string;
18
- }
19
- export interface ICreateStoreDTO {
20
- name: string;
21
- shortName: string;
22
- slug: string;
23
- domain: string;
24
- currency: string;
25
- settings: Partial<IStoreSettings>;
26
- status: boolean;
27
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,104 +0,0 @@
1
- import { IStore } from "./store";
2
- export interface ISubscriberSegmentRules {
3
- status?: 'active' | 'unsubscribed' | 'bounced' | 'blocked';
4
- channels?: 'email' | 'sms' | 'push' | Array<'email' | 'sms' | 'push'>;
5
- }
6
- export interface ISubscriber {
7
- _id?: string;
8
- email?: string;
9
- phone?: string;
10
- userId?: string;
11
- channels: Array<'email' | 'sms' | 'push'>;
12
- status?: 'active' | 'unsubscribed' | 'bounced' | 'blocked';
13
- locale?: string;
14
- store?: IStore | string;
15
- schemaVersion?: number;
16
- isDeleted?: boolean;
17
- createdAt?: Date;
18
- updatedAt?: Date;
19
- }
20
- export interface ISubscriberCampaignContent {
21
- html?: string;
22
- text?: string;
23
- }
24
- export interface ISubscriberCampaign {
25
- _id?: string;
26
- store?: IStore;
27
- name: string;
28
- type: 'email' | 'sms' | 'push';
29
- segmentId?: string;
30
- subject?: string;
31
- content?: ISubscriberCampaignContent;
32
- status?: 'draft' | 'scheduled' | 'sent' | 'failed';
33
- scheduledAt?: Date;
34
- sentAt?: Date;
35
- createdAt?: Date;
36
- }
37
- export interface ISubscriberCampaignLogMetaLocation {
38
- country?: string;
39
- city?: string;
40
- }
41
- export interface ISubscriberCampaignLogMeta {
42
- ip?: string;
43
- userAgent?: string;
44
- location?: ISubscriberCampaignLogMetaLocation;
45
- }
46
- export interface ISubscriberCampaignLog {
47
- _id?: string;
48
- campaignId: string;
49
- subscriberId: string;
50
- event: 'delivered' | 'opened' | 'clicked' | 'bounced' | 'unsubscribed';
51
- timestamp?: Date;
52
- meta?: ISubscriberCampaignLogMeta;
53
- }
54
- export interface ISubscriberEventBase {
55
- _id?: string;
56
- subscriberId: string;
57
- createdAt?: Date;
58
- }
59
- export interface ISubscriberEventSubscribed extends ISubscriberEventBase {
60
- eventType: 'subscribed' | 'unsubscribed' | 'preference_updated' | 'bounced' | 'created' | 'deleted';
61
- details?: Record<string, any>;
62
- }
63
- export interface ISubscriberEventUpdated extends ISubscriberEventBase {
64
- eventType: 'updated';
65
- details: {
66
- updatedFields: Record<string, any>;
67
- };
68
- }
69
- export type ISubscriberEvent = ISubscriberEventSubscribed | ISubscriberEventUpdated;
70
- export interface ISubscriberList {
71
- _id?: string;
72
- store?: IStore;
73
- name: string;
74
- description?: string;
75
- channel: 'email' | 'sms' | 'push';
76
- defaultOptIn?: boolean;
77
- createdAt?: Date;
78
- }
79
- export interface ISubscriberPreference {
80
- _id?: string;
81
- subscriberId: string;
82
- channel: 'email' | 'sms' | 'push';
83
- topics: string[];
84
- unsubscribed: boolean;
85
- updatedAt?: Date;
86
- }
87
- export interface ISubscriberSegment {
88
- _id?: string;
89
- store?: IStore;
90
- name: string;
91
- type: 'static' | 'dynamic';
92
- rules?: ISubscriberSegmentRules;
93
- subscriberIds?: Array<string>;
94
- createdAt?: Date;
95
- }
96
- export interface ISubscriberSubscription {
97
- _id?: string;
98
- subscriberId: string;
99
- listId: string;
100
- status?: 'subscribed' | 'unsubscribed' | 'pending';
101
- subscribedAt?: Date;
102
- unsubscribedAt?: Date;
103
- isDeleted?: boolean;
104
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,37 +0,0 @@
1
- import { ILocalizedString } from "./";
2
- export interface IVariantPrices {
3
- originalPrice: number;
4
- price: number;
5
- discount?: number;
6
- }
7
- export interface IVariant {
8
- _id: string;
9
- productId?: string;
10
- sku: string;
11
- barcode?: string;
12
- title: ILocalizedString;
13
- description?: ILocalizedString;
14
- slug: string;
15
- stock: number;
16
- sales?: number;
17
- tag?: string[];
18
- prices: IVariantPrices;
19
- image?: string;
20
- templateJson?: string;
21
- size: {
22
- width: number;
23
- height: number;
24
- };
25
- status: boolean;
26
- createdAt?: Date;
27
- updatedAt?: Date;
28
- }
29
- export interface IProductVariantQuery {
30
- page?: number;
31
- limit?: number;
32
- title?: string;
33
- price?: string;
34
- stockStatus?: string;
35
- minPrice?: string;
36
- maxPrice?: string;
37
- }
@@ -1 +0,0 @@
1
- export {};
package/src/index.ts DELETED
@@ -1 +0,0 @@
1
- export * from './interfaces';
@@ -1,60 +0,0 @@
1
- import { ILocalizedString } from './common';
2
- import { IStore } from './store';
3
-
4
- // media types
5
- export type BannerMediaType = 'image' | 'video';
6
-
7
- export interface BannerMedia {
8
- type: BannerMediaType;
9
- sources: {
10
- desktop: string;
11
- mobile?: string;
12
- tablet?: string;
13
- };
14
- altText?: ILocalizedString; // i18n-friendly alt text for accessibility
15
-
16
- // Video-specific fields
17
- poster?: string;
18
- autoplay?: boolean;
19
- loop?: boolean;
20
- muted?: boolean;
21
- }
22
-
23
- // link types
24
- export type LinkType = 'internal' | 'external';
25
-
26
- export interface BannerLink {
27
- type: LinkType;
28
- url: string;
29
- openInNewTab: boolean;
30
- }
31
-
32
- export interface IBannerFormValues extends Omit<IBanner, 'visibility'> {
33
- visibility: BannerVisibility & {
34
- scheduledRange?: [Date, Date]; // used only in the form
35
- };
36
- }
37
-
38
- // visibility controls (with optional scheduling)
39
- export interface BannerVisibility {
40
- status: boolean;
41
- scheduled: {
42
- from: Date | null;
43
- to: Date | null;
44
- };
45
- }
46
-
47
- // main banner interface
48
- export interface IBanner {
49
- _id?: string; // MongoDB document ID
50
- store: IStore; // Store ID (multi-tenant support)
51
- title: ILocalizedString; // i18n title
52
- description?: ILocalizedString; // optional i18n description
53
- media: BannerMedia; // image or video media block
54
- link?: BannerLink; // optional CTA link
55
- visibility: BannerVisibility; // active + scheduled
56
- position: string; // UI position, e.g. 'homepage-top'
57
- sortOrder: number; // for ordering banners
58
- createdAt: Date;
59
- updatedAt: Date;
60
- }
@@ -1,66 +0,0 @@
1
- import { ILocalizedString } from "./common";
2
- import { IStore } from "./store";
3
-
4
- export const TAGS = ['new', 'hot', 'sale', 'featured', 'exclusive'] as const;
5
-
6
- export type Tag = typeof TAGS[number];
7
-
8
- export interface ICategory {
9
- _id?: string;
10
- name: ILocalizedString;
11
- description?: ILocalizedString;
12
- slug: string;
13
- parent?: string | null;
14
- parentName?: string;
15
- children?: string[];
16
- level?: number;
17
- status: boolean;
18
- store: IStore;
19
- skuInitial?: string;
20
- sortPosition?: number;
21
- tags: Tag[];
22
-
23
- images: {
24
- desktopBanner?: string;
25
- mobileBanner?: string;
26
- shopPageThumbnail?: string;
27
- categoryThumbnail?: string;
28
- };
29
-
30
- metaData?: {
31
- category?: {
32
- titleTag?: string;
33
- headerTag?: string;
34
- metaDescription?: string;
35
- csrKeywords?: string;
36
- };
37
- product?: {
38
- titleTag?: string;
39
- headerTag?: string;
40
- metaDescription?: string;
41
- csrKeywords?: string;
42
- };
43
- };
44
-
45
- createdAt?: string;
46
- updatedAt?: string;
47
- productCount?: number;
48
-
49
- [key: string]: any; // Optional catch-all for dynamic properties
50
- }
51
-
52
- export interface CategoryQueryParams {
53
- page?: number;
54
- limit?: number;
55
- name?: string;
56
- status?: string;
57
- minLevel?: string;
58
- maxLevel?: string;
59
- }
60
-
61
- export interface CategoryResponse {
62
- categories: ICategory[];
63
- totalCategories: number;
64
- totalPages: number;
65
- currentPage: number;
66
- }
@@ -1,3 +0,0 @@
1
- export interface ILocalizedString {
2
- [languageCode: string]: string;
3
- }