@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,24 +0,0 @@
1
- import { ILocalizedString } from './common';
2
- import { IStore } from './store';
3
-
4
-
5
- export interface IDiscountType {
6
- type: string;
7
- value: number;
8
- }
9
-
10
- export interface ICoupon {
11
- _id: string;
12
- title: ILocalizedString;
13
- logo: string;
14
- couponCode: string;
15
- startTime: string;
16
- endTime: string;
17
- discountType: IDiscountType;
18
- minimumAmount: number;
19
- isPromotional: boolean;
20
- status: boolean;
21
- store: IStore;
22
- createdAt: string;
23
- updatedAt: string;
24
- }
@@ -1,11 +0,0 @@
1
- export interface ICurrency {
2
- _id?: string;
3
- name: string;
4
- symbol: string;
5
- status: boolean;
6
- // iso_code: string;
7
- // exchange_rate?: string;
8
- live_exchange_rates?: 'show' | 'hide';
9
- createdAt?: string;
10
- updatedAt?: string;
11
- }
@@ -1,26 +0,0 @@
1
- import { IStore } from './store';
2
-
3
- export type CustomerPhotoStatus = 'pending' | 'approved' | 'rejected';
4
-
5
- export interface ICustomerPhotos {
6
- _id?: string;
7
- store: IStore;
8
- customer: {
9
- name?: string;
10
- email?: string;
11
- comment?: string
12
- };
13
- photos: string[];
14
- status: CustomerPhotoStatus; // use the reusable type
15
- createdAt: Date;
16
- updatedAt: Date;
17
- }
18
-
19
- export interface CustomerPhotosQueryParams {
20
- page?: number;
21
- limit?: number;
22
- name?: string;
23
- email?: string;
24
- status?: CustomerPhotoStatus;
25
- store?: string;
26
- }
@@ -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,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,79 +0,0 @@
1
- import { ICategory, ILocalizedString, IProductType, IStore, IVariant } from "./";
2
-
3
- export interface IPrices {
4
- originalPrice: number;
5
- price: number
6
- discount?: number;
7
- }
8
-
9
- export interface IMetaDataProduct {
10
- title?: string;
11
- header?: string;
12
- description?: string;
13
- keywords?: string[];
14
- canonicalUrl?: string;
15
- }
16
-
17
- export interface IImages {
18
- productImage?: string;
19
- seoImage?: string;
20
- displayImage?: string;
21
- }
22
-
23
- export interface IProduct {
24
- _id: string;
25
- sku?: string;
26
- barcode?: string;
27
- title: ILocalizedString;
28
- description?: ILocalizedString;
29
- slug: string;
30
- categories: ICategory[];
31
- category: ICategory;
32
- productType: IProductType;
33
- image: string[];
34
- stock: number;
35
- sales: number;
36
- tag: string[];
37
- variants: IVariant[]; // direct ref array
38
- hasVariant: boolean;
39
- prices: IPrices;
40
- status: boolean;
41
- store: IStore;
42
- images?: IImages;
43
- metaData?: {
44
- product?: IMetaDataProduct;
45
- };
46
- createdAt?: Date;
47
- updatedAt?: Date;
48
-
49
- // Optional: virtual populate
50
- variantList?: IVariant[];
51
-
52
- [key: string]: any;
53
- }
54
-
55
- export interface IProductQuery {
56
- page?: number;
57
- limit?: number;
58
- category?: string;
59
- categories?: string[];
60
- title?: string;
61
- price?: string;
62
- stockStatus?: string;
63
- published?: string;
64
- status?: boolean;
65
- minPrice?: string;
66
- maxPrice?: string;
67
- }
68
-
69
- export interface IProductResponse {
70
- products: IProduct[];
71
- totalDoc: number;
72
- limits: number;
73
- pages: number;
74
- }
75
-
76
- export interface IProductUpdate {
77
- ids: string[];
78
- [key: string]: any;
79
- }
@@ -1,100 +0,0 @@
1
- import { IStore } from "./store";
2
-
3
- export interface IProductType {
4
- _id: string;
5
- name: string;
6
- slug: string;
7
- status: boolean;
8
- pricingChart: IPricingChartDocument;
9
- shippingChart: IShippingChartDocument;
10
- variantChart: IVariantChart;
11
- frameChart: IFrameChartDocument;
12
- store: IStore;
13
- }
14
-
15
- // pricing
16
- export interface IPricingTier {
17
- from: number;
18
- to: number;
19
- price: number;
20
- }
21
-
22
- export interface IPricingData {
23
- label: string;
24
- tiers: IPricingTier[];
25
- }
26
-
27
- export interface IPricingChartDocument {
28
- _id: string;
29
- name: string;
30
- pricing: IPricingData[];
31
- status: boolean;
32
- }
33
-
34
-
35
- export interface IPricingChartFormProps {
36
- onClose: () => void;
37
- pricingChartId?: string | null;
38
- initialData?: IPricingChartDocument | null;
39
- }
40
-
41
- // Frame
42
- export interface IFrameChartDocument {
43
- _id: string;
44
- name: string;
45
- pricing: IPricingData[];
46
- status: boolean;
47
- }
48
-
49
- export interface IFrameChartFormProps {
50
- onClose: () => void;
51
- frameChartId?: string | null;
52
- initialData?: IFrameChartDocument | null;
53
- }
54
-
55
-
56
- // Shipping
57
- export interface IShippingTier {
58
- from: number;
59
- to: number;
60
- price: number;
61
- }
62
-
63
- export interface IShippingData {
64
- label: string;
65
- day: number;
66
- tiers: IShippingTier[];
67
- }
68
-
69
- export interface IShippingChartDocument {
70
- _id: string;
71
- name: string;
72
- shipping: IShippingData[];
73
- status: boolean;
74
- }
75
-
76
- export interface IShippingChartFormProps {
77
- onClose: () => void;
78
- shippingChartId?: string | null;
79
- initialData?: IShippingChartDocument | null;
80
- }
81
-
82
- // variant
83
- export interface IVariantOption {
84
- label: string;
85
- }
86
-
87
- export interface IVariantChart {
88
- _id: string;
89
- name: string;
90
- status: boolean;
91
- variants: IVariantOption[];
92
- createdAt?: string;
93
- updatedAt?: string;
94
- }
95
-
96
- export interface IVariantChartFormProps {
97
- onClose: () => void;
98
- variantChartId?: string | null;
99
- initialData?: IVariantChart | null;
100
- }
@@ -1,30 +0,0 @@
1
- import { ICurrency } from "./currency";
2
-
3
- export interface IStoreSettings {
4
- logo: string;
5
- theme: 'light' | 'dark';
6
- timezone: string;
7
- }
8
-
9
- export interface IStore {
10
- _id?: string;
11
- name: string;
12
- shortName: string;
13
- slug: string;
14
- domain: string;
15
- currency: ICurrency;
16
- settings: IStoreSettings;
17
- status: boolean;
18
- createdAt?: string;
19
- updatedAt?: string;
20
- }
21
-
22
- export interface ICreateStoreDTO {
23
- name: string;
24
- shortName: string;
25
- slug: string;
26
- domain: string;
27
- currency: string;
28
- settings: Partial<IStoreSettings>;
29
- status: boolean;
30
- }
@@ -1,129 +0,0 @@
1
- import { IStore } from "./store";
2
-
3
- export interface ISubscriberSegmentRules {
4
- status?: 'active' | 'unsubscribed' | 'bounced' | 'blocked';
5
- channels?: 'email' | 'sms' | 'push' | Array<'email' | 'sms' | 'push'>;
6
- // Add more filtering fields as needed
7
- }
8
-
9
-
10
- export interface ISubscriber {
11
- _id?: string;
12
- email?: string;
13
- phone?: string;
14
- userId?: string;
15
- channels: Array<'email' | 'sms' | 'push'>;
16
- status?: 'active' | 'unsubscribed' | 'bounced' | 'blocked';
17
- locale?: string;
18
- store?: IStore | string;
19
- schemaVersion?: number;
20
- isDeleted?: boolean;
21
- createdAt?: Date;
22
- updatedAt?: Date;
23
- }
24
-
25
- export interface ISubscriberCampaignContent {
26
- html?: string;
27
- text?: string;
28
- }
29
-
30
- export interface ISubscriberCampaign {
31
- _id?: string;
32
- store?: IStore;
33
- name: string;
34
- type: 'email' | 'sms' | 'push';
35
- segmentId?: string;
36
- subject?: string;
37
- content?: ISubscriberCampaignContent;
38
- status?: 'draft' | 'scheduled' | 'sent' | 'failed';
39
- scheduledAt?: Date;
40
- sentAt?: Date;
41
- createdAt?: Date;
42
- }
43
-
44
- export interface ISubscriberCampaignLogMetaLocation {
45
- country?: string;
46
- city?: string;
47
- }
48
-
49
- export interface ISubscriberCampaignLogMeta {
50
- ip?: string;
51
- userAgent?: string;
52
- location?: ISubscriberCampaignLogMetaLocation;
53
- }
54
-
55
- export interface ISubscriberCampaignLog {
56
- _id?: string;
57
- campaignId: string;
58
- subscriberId: string;
59
- event: 'delivered' | 'opened' | 'clicked' | 'bounced' | 'unsubscribed';
60
- timestamp?: Date;
61
- meta?: ISubscriberCampaignLogMeta;
62
- }
63
-
64
- // export interface ISubscriberEvent {
65
- // _id?: string;
66
- // subscriberId: string;
67
- // eventType: 'subscribed' | 'unsubscribed' | 'preference_updated' | 'bounced';
68
- // details?: Record<string, any>;
69
- // createdAt?: Date;
70
- // }
71
-
72
- export interface ISubscriberEventBase {
73
- _id?: string;
74
- subscriberId: string;
75
- createdAt?: Date;
76
- }
77
-
78
- export interface ISubscriberEventSubscribed extends ISubscriberEventBase {
79
- eventType: 'subscribed' | 'unsubscribed' | 'preference_updated' | 'bounced' | 'created' | 'deleted';
80
- details?: Record<string, any>;
81
- }
82
-
83
- export interface ISubscriberEventUpdated extends ISubscriberEventBase {
84
- eventType: 'updated';
85
- details: {
86
- updatedFields: Record<string, any>;
87
- };
88
- }
89
-
90
- export type ISubscriberEvent = ISubscriberEventSubscribed | ISubscriberEventUpdated;
91
-
92
- export interface ISubscriberList {
93
- _id?: string;
94
- store?: IStore;
95
- name: string;
96
- description?: string;
97
- channel: 'email' | 'sms' | 'push';
98
- defaultOptIn?: boolean;
99
- createdAt?: Date;
100
- }
101
-
102
- export interface ISubscriberPreference {
103
- _id?: string;
104
- subscriberId: string;
105
- channel: 'email' | 'sms' | 'push';
106
- topics: string[];
107
- unsubscribed: boolean;
108
- updatedAt?: Date;
109
- }
110
-
111
- export interface ISubscriberSegment {
112
- _id?: string;
113
- store?: IStore;
114
- name: string;
115
- type: 'static' | 'dynamic';
116
- rules?: ISubscriberSegmentRules; // Replace with a specific type if you have a schema for rules
117
- subscriberIds?: Array<string>;
118
- createdAt?: Date;
119
- }
120
-
121
- export interface ISubscriberSubscription {
122
- _id?: string;
123
- subscriberId: string;
124
- listId: string;
125
- status?: 'subscribed' | 'unsubscribed' | 'pending';
126
- subscribedAt?: Date;
127
- unsubscribedAt?: Date;
128
- isDeleted?: boolean;
129
- }
@@ -1,40 +0,0 @@
1
- import { ILocalizedString } from "./";
2
-
3
- export interface IVariantPrices {
4
- originalPrice: number;
5
- price: number;
6
- discount?: number;
7
- }
8
-
9
- export interface IVariant {
10
- _id: string; // MongoDB ObjectId string (optional on creation)
11
- productId?: string; // Reference to parent product's _id
12
- sku: string;
13
- barcode?: string;
14
- title: ILocalizedString; // Multilingual title
15
- description?: ILocalizedString;
16
- slug: string;
17
- stock: number;
18
- sales?: number; // Default 0
19
- tag?: string[];
20
- prices: IVariantPrices;
21
- image?: string;
22
- templateJson?: string;
23
- size: {
24
- width: number;
25
- height: number;
26
- }
27
- status: boolean; // Active status, default true
28
- createdAt?: Date;
29
- updatedAt?: Date;
30
- }
31
-
32
- export interface IProductVariantQuery {
33
- page?: number;
34
- limit?: number;
35
- title?: string;
36
- price?: string;
37
- stockStatus?: string;
38
- minPrice?: string;
39
- maxPrice?: string;
40
- }
package/tsconfig.json DELETED
@@ -1,20 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ESNext",
4
- "module": "ESNext",
5
- "moduleResolution": "node",
6
- "declaration": true,
7
- "outDir": "dist",
8
- "rootDir": "src",
9
- "strict": true,
10
- "esModuleInterop": true,
11
- "forceConsistentCasingInFileNames": true,
12
- "skipLibCheck": true
13
- },
14
- "include": [
15
- "src/interfaces",
16
- "src/constants",
17
- "src/types",
18
- "src"
19
- ]
20
- }