@fas-core/shared-types 1.0.18 → 1.0.20

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.d.mts CHANGED
@@ -98,7 +98,59 @@ interface SoftDeleteFilter {
98
98
  isDeleted?: boolean;
99
99
  deletedAt?: Date | null;
100
100
  }
101
+
101
102
  type Metadata = Record<string, unknown>;
103
+ interface ISEOMetaData {
104
+ title: string;
105
+ description: string;
106
+ keywords: string[];
107
+ headerTag: string;
108
+ canonicalUrl: string;
109
+ }
110
+ interface IPrice {
111
+ price: number;
112
+ originalPrice: number;
113
+ discount: number;
114
+ }
115
+ interface ITechSpec {
116
+ key: string;
117
+ label: string;
118
+ value: string | number;
119
+ }
120
+ interface IShipping {
121
+ weightLb: number;
122
+ weightKg: number;
123
+ lengthIn: number;
124
+ lengthMm: number;
125
+ widthIn: number;
126
+ widthMm: number;
127
+ heightIn: number;
128
+ heightMm: number;
129
+ }
130
+ interface ICompliance {
131
+ eccn: string;
132
+ hts: number;
133
+ unspsc: number;
134
+ taa: string;
135
+ stratCode: string;
136
+ }
137
+ interface IDocumentation {
138
+ warranty: string[];
139
+ infographics: string[];
140
+ environment: string[];
141
+ }
142
+ interface IContent {
143
+ overview: string;
144
+ expertNote: string;
145
+ keyFeatures: string[];
146
+ applications: string;
147
+ }
148
+ interface IRelationships {
149
+ similarProducts: string[];
150
+ parts: string[];
151
+ accessories: string[];
152
+ toolKits: string[];
153
+ }
102
154
 
103
155
  interface ICurrency extends BaseEntity {
104
156
  name: string;
@@ -112,8 +164,10 @@ interface ICurrency extends BaseEntity {
112
164
  interface IStoreSettings {
113
165
  logo: string;
114
166
  theme: 'light' | 'dark';
167
+ favicon: string;
115
168
  timezone: string;
116
169
  requireCustomerLogin: boolean;
170
+ seoMetaData: ISEOMetaData;
117
171
  }
118
172
  interface IStore extends BaseEntity {
119
173
  name: string;
@@ -168,12 +222,48 @@ interface ICoupon extends BaseEntity {
168
222
  interface IVariant extends BaseEntity {
169
223
  name: string;
170
224
  sku: string;
171
- attributes: Record<string, string>;
172
- price: number;
173
- stock: number;
225
+ slug: string;
174
226
  product: IProduct;
175
227
  status: boolean;
176
228
  metaData: Metadata;
229
+ seoMetaData: ISEOMetaData;
230
+ }
231
+
232
+ interface ICategory extends BaseEntity {
233
+ name: string;
234
+ slug: string;
235
+ description: string;
236
+ parent: ICategory;
237
+ store: IStore;
238
+ image: string;
239
+ status: boolean;
240
+ metaData: Metadata;
241
+ seoMetaData: ISEOMetaData;
242
+ subCategories?: ICategory[];
243
+ }
244
+
245
+ interface IBrand extends BaseEntity {
246
+ name: string;
247
+ slug: string;
248
+ description: string;
249
+ logo: string;
250
+ store: IStore;
251
+ status: boolean;
252
+ metaData: Metadata;
253
+ seoMetaData: ISEOMetaData;
254
+ }
255
+
256
+ type StockStatus = "IN_STOCK" | "LOW_STOCK" | "OUT_OF_STOCK";
257
+ interface IStock extends BaseEntity {
258
+ sku: string;
259
+ product: IProduct;
260
+ variant: IVariant | null;
261
+ store: IStore;
262
+ quantity: number;
263
+ reserved: number;
264
+ available: number;
265
+ status: StockStatus;
266
+ lowStockThreshold: number;
177
267
  }
178
268
 
179
269
  interface IProduct extends BaseEntity {
@@ -181,10 +271,28 @@ interface IProduct extends BaseEntity {
181
271
  slug: string;
182
272
  sku: string;
183
273
  description: string;
184
- price: number;
185
- variants: IVariant[];
274
+ price: IPrice;
275
+ quantity: number;
276
+ brand: IBrand;
186
277
  store: IStore;
278
+ stock: IStock;
279
+ variants: IVariant[];
280
+ category: ICategory;
281
+ categories: ICategory[];
282
+ images: string[];
283
+ videos: string[];
284
+ documentation: IDocumentation;
285
+ techSpecs: ITechSpec[];
286
+ physical: ITechSpec[];
287
+ shipping: IShipping;
288
+ compliance: ICompliance;
289
+ features: string[];
290
+ content: IContent;
291
+ origin: string;
292
+ returnable: boolean;
293
+ relationships: IRelationships;
187
294
  metaData: Metadata;
295
+ seoMetaData: ISEOMetaData;
188
296
  status: boolean;
189
297
  }
190
298
 
@@ -252,4 +360,4 @@ interface ICart extends BaseEntity {
252
360
  totalAmount: number;
253
361
  }
254
362
 
255
- export { ADMIN_ROLES, type ApiResponse, type BaseEntity, DiscountTypeEnum, type IAddress, type IAdmin, type IAdminCreate, type IAdminRoleType, type IAdminSafe, type IAdminUpdate, type ICart, type ICartItem, type IContact, type ICountry, type ICoupon, type ICurrency, type ICustomer, type IDiscountType, type IOrder, type IOrderItem, type IProduct, type IState, type IStore, type IStoreSettings, type IVariant, type Metadata, OrderStatusEnum, type Paginated, type SoftDeleteFilter };
363
+ export { ADMIN_ROLES, type ApiResponse, type BaseEntity, DiscountTypeEnum, type IAddress, type IAdmin, type IAdminCreate, type IAdminRoleType, type IAdminSafe, type IAdminUpdate, type IBrand, type ICart, type ICartItem, type ICategory, type ICompliance, type IContact, type IContent, type ICountry, type ICoupon, type ICurrency, type ICustomer, type IDiscountType, type IDocumentation, type IOrder, type IOrderItem, type IPrice, type IProduct, type IRelationships, type ISEOMetaData, type IShipping, type IState, type IStock, type IStore, type IStoreSettings, type ITechSpec, type IVariant, type Metadata, OrderStatusEnum, type Paginated, type SoftDeleteFilter, type StockStatus };
package/dist/index.d.ts CHANGED
@@ -98,7 +98,59 @@ interface SoftDeleteFilter {
98
98
  isDeleted?: boolean;
99
99
  deletedAt?: Date | null;
100
100
  }
101
+
101
102
  type Metadata = Record<string, unknown>;
103
+ interface ISEOMetaData {
104
+ title: string;
105
+ description: string;
106
+ keywords: string[];
107
+ headerTag: string;
108
+ canonicalUrl: string;
109
+ }
110
+ interface IPrice {
111
+ price: number;
112
+ originalPrice: number;
113
+ discount: number;
114
+ }
115
+ interface ITechSpec {
116
+ key: string;
117
+ label: string;
118
+ value: string | number;
119
+ }
120
+ interface IShipping {
121
+ weightLb: number;
122
+ weightKg: number;
123
+ lengthIn: number;
124
+ lengthMm: number;
125
+ widthIn: number;
126
+ widthMm: number;
127
+ heightIn: number;
128
+ heightMm: number;
129
+ }
130
+ interface ICompliance {
131
+ eccn: string;
132
+ hts: number;
133
+ unspsc: number;
134
+ taa: string;
135
+ stratCode: string;
136
+ }
137
+ interface IDocumentation {
138
+ warranty: string[];
139
+ infographics: string[];
140
+ environment: string[];
141
+ }
142
+ interface IContent {
143
+ overview: string;
144
+ expertNote: string;
145
+ keyFeatures: string[];
146
+ applications: string;
147
+ }
148
+ interface IRelationships {
149
+ similarProducts: string[];
150
+ parts: string[];
151
+ accessories: string[];
152
+ toolKits: string[];
153
+ }
102
154
 
103
155
  interface ICurrency extends BaseEntity {
104
156
  name: string;
@@ -112,8 +164,10 @@ interface ICurrency extends BaseEntity {
112
164
  interface IStoreSettings {
113
165
  logo: string;
114
166
  theme: 'light' | 'dark';
167
+ favicon: string;
115
168
  timezone: string;
116
169
  requireCustomerLogin: boolean;
170
+ seoMetaData: ISEOMetaData;
117
171
  }
118
172
  interface IStore extends BaseEntity {
119
173
  name: string;
@@ -168,12 +222,48 @@ interface ICoupon extends BaseEntity {
168
222
  interface IVariant extends BaseEntity {
169
223
  name: string;
170
224
  sku: string;
171
- attributes: Record<string, string>;
172
- price: number;
173
- stock: number;
225
+ slug: string;
174
226
  product: IProduct;
175
227
  status: boolean;
176
228
  metaData: Metadata;
229
+ seoMetaData: ISEOMetaData;
230
+ }
231
+
232
+ interface ICategory extends BaseEntity {
233
+ name: string;
234
+ slug: string;
235
+ description: string;
236
+ parent: ICategory;
237
+ store: IStore;
238
+ image: string;
239
+ status: boolean;
240
+ metaData: Metadata;
241
+ seoMetaData: ISEOMetaData;
242
+ subCategories?: ICategory[];
243
+ }
244
+
245
+ interface IBrand extends BaseEntity {
246
+ name: string;
247
+ slug: string;
248
+ description: string;
249
+ logo: string;
250
+ store: IStore;
251
+ status: boolean;
252
+ metaData: Metadata;
253
+ seoMetaData: ISEOMetaData;
254
+ }
255
+
256
+ type StockStatus = "IN_STOCK" | "LOW_STOCK" | "OUT_OF_STOCK";
257
+ interface IStock extends BaseEntity {
258
+ sku: string;
259
+ product: IProduct;
260
+ variant: IVariant | null;
261
+ store: IStore;
262
+ quantity: number;
263
+ reserved: number;
264
+ available: number;
265
+ status: StockStatus;
266
+ lowStockThreshold: number;
177
267
  }
178
268
 
179
269
  interface IProduct extends BaseEntity {
@@ -181,10 +271,28 @@ interface IProduct extends BaseEntity {
181
271
  slug: string;
182
272
  sku: string;
183
273
  description: string;
184
- price: number;
185
- variants: IVariant[];
274
+ price: IPrice;
275
+ quantity: number;
276
+ brand: IBrand;
186
277
  store: IStore;
278
+ stock: IStock;
279
+ variants: IVariant[];
280
+ category: ICategory;
281
+ categories: ICategory[];
282
+ images: string[];
283
+ videos: string[];
284
+ documentation: IDocumentation;
285
+ techSpecs: ITechSpec[];
286
+ physical: ITechSpec[];
287
+ shipping: IShipping;
288
+ compliance: ICompliance;
289
+ features: string[];
290
+ content: IContent;
291
+ origin: string;
292
+ returnable: boolean;
293
+ relationships: IRelationships;
187
294
  metaData: Metadata;
295
+ seoMetaData: ISEOMetaData;
188
296
  status: boolean;
189
297
  }
190
298
 
@@ -252,4 +360,4 @@ interface ICart extends BaseEntity {
252
360
  totalAmount: number;
253
361
  }
254
362
 
255
- export { ADMIN_ROLES, type ApiResponse, type BaseEntity, DiscountTypeEnum, type IAddress, type IAdmin, type IAdminCreate, type IAdminRoleType, type IAdminSafe, type IAdminUpdate, type ICart, type ICartItem, type IContact, type ICountry, type ICoupon, type ICurrency, type ICustomer, type IDiscountType, type IOrder, type IOrderItem, type IProduct, type IState, type IStore, type IStoreSettings, type IVariant, type Metadata, OrderStatusEnum, type Paginated, type SoftDeleteFilter };
363
+ export { ADMIN_ROLES, type ApiResponse, type BaseEntity, DiscountTypeEnum, type IAddress, type IAdmin, type IAdminCreate, type IAdminRoleType, type IAdminSafe, type IAdminUpdate, type IBrand, type ICart, type ICartItem, type ICategory, type ICompliance, type IContact, type IContent, type ICountry, type ICoupon, type ICurrency, type ICustomer, type IDiscountType, type IDocumentation, type IOrder, type IOrderItem, type IPrice, type IProduct, type IRelationships, type ISEOMetaData, type IShipping, type IState, type IStock, type IStore, type IStoreSettings, type ITechSpec, type IVariant, type Metadata, OrderStatusEnum, type Paginated, type SoftDeleteFilter, type StockStatus };
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/admin/interface.ts","../src/coupon/interface.ts","../src/order/interface.ts"],"sourcesContent":["export * from './address';\nexport * from './admin';\nexport * from './base';\nexport * from './common';\nexport * from './country';\nexport * from './customer';\nexport * from './state';\nexport * from './store';\nexport * from './currency';\nexport * from './contact';\nexport * from './coupon';\nexport * from './product';\nexport * from './variant';\nexport * from './order';\nexport * from './orderItem';\nexport * from './cart';\nexport * from './cartItem';","import type { BaseEntity } from '../base/interface';\n\nexport type IAdminRoleType =\n | 'Admin'\n | 'Super Admin'\n | 'Cashier'\n | 'Manager'\n | 'CEO'\n | 'Driver'\n | 'Security Guard'\n | 'Accountant';\n\nexport const ADMIN_ROLES: IAdminRoleType[] = [\n 'Admin',\n 'Super Admin',\n 'Cashier',\n 'Manager',\n 'CEO',\n 'Driver',\n 'Security Guard',\n 'Accountant',\n];\n\nexport interface IAdmin extends BaseEntity {\n firstName: string;\n lastName: string;\n email: string;\n phoneNumber: string;\n status: boolean;\n password: string;\n role: IAdminRoleType;\n access_list: string[];\n joiningDate: Date;\n profileImage: string;\n lastLogin: Date;\n}\n\nexport type IAdminCreate = Omit<IAdmin, keyof BaseEntity>;\nexport type IAdminUpdate = Partial<IAdminCreate>;\nexport type IAdminSafe = Omit<IAdmin, 'password'>;\n","import type { BaseEntity } from \"../base\";\nimport type { IStore } from \"../store\";\n\nexport const DiscountTypeEnum = {\n PERCENTAGE: \"PERCENTAGE\",\n FIXED: \"FIXED\",\n} as const;\n\nexport type DiscountTypeEnum = (typeof DiscountTypeEnum)[keyof typeof DiscountTypeEnum];\n\nexport interface IDiscountType {\n type: DiscountTypeEnum;\n value: number;\n}\n\nexport interface ICoupon extends BaseEntity {\n title: string;\n couponCode: string;\n startTime: Date;\n endTime: Date;\n discountType: IDiscountType;\n minimumAmount: number;\n isPromotional: boolean;\n status: boolean;\n store: IStore | string;\n}","import type { BaseEntity } from \"../base\";\nimport type { Metadata } from \"../common\";\nimport type { ICoupon } from \"../coupon\";\nimport type { ICustomer } from \"../customer\";\nimport type { IOrderItem } from \"../orderItem\";\nimport type { IStore } from \"../store\";\n\nexport const OrderStatusEnum = {\n PENDING: \"PENDING\",\n CONFIRMED: \"CONFIRMED\",\n PROCESSING: \"PROCESSING\",\n SHIPPED: \"SHIPPED\",\n DELIVERED: \"DELIVERED\",\n CANCELED: \"CANCELED\",\n FAILED: \"FAILED\",\n REFUNDED: \"REFUNDED\",\n PARTIALLY_REFUNDED: \"PARTIALLY_REFUNDED\",\n} as const;\n\nexport type OrderStatusEnum = (typeof OrderStatusEnum)[keyof typeof OrderStatusEnum];\n\nexport interface IOrder extends BaseEntity {\n orderId: string;\n orderItems: IOrderItem[];\n user?: ICustomer;\n coupon?: ICoupon;\n store: IStore;\n status: OrderStatusEnum;\n subTotalAmount: number;\n discountAmount: number;\n totalAmount: number;\n metaData: Metadata;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACYO,IAAM,cAAgC;AAAA,EACzC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ;;;AClBO,IAAM,mBAAmB;AAAA,EAC5B,YAAY;AAAA,EACZ,OAAO;AACX;;;ACCO,IAAM,kBAAkB;AAAA,EAC3B,SAAS;AAAA,EACT,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,SAAS;AAAA,EACT,WAAW;AAAA,EACX,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,oBAAoB;AACxB;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts","../src/admin/interface.ts","../src/coupon/interface.ts","../src/order/interface.ts"],"sourcesContent":["export * from './address';\nexport * from './admin';\nexport * from './base';\nexport * from './common';\nexport * from './country';\nexport * from './customer';\nexport * from './state';\nexport * from './store';\nexport * from './currency';\nexport * from './contact';\nexport * from './coupon';\nexport * from './product';\nexport * from './variant';\nexport * from './order';\nexport * from './orderItem';\nexport * from './cart';\nexport * from './cartItem';\nexport * from './category';\nexport * from './brand';\nexport * from './stock';","import type { BaseEntity } from '../base/interface';\n\nexport type IAdminRoleType =\n | 'Admin'\n | 'Super Admin'\n | 'Cashier'\n | 'Manager'\n | 'CEO'\n | 'Driver'\n | 'Security Guard'\n | 'Accountant';\n\nexport const ADMIN_ROLES: IAdminRoleType[] = [\n 'Admin',\n 'Super Admin',\n 'Cashier',\n 'Manager',\n 'CEO',\n 'Driver',\n 'Security Guard',\n 'Accountant',\n];\n\nexport interface IAdmin extends BaseEntity {\n firstName: string;\n lastName: string;\n email: string;\n phoneNumber: string;\n status: boolean;\n password: string;\n role: IAdminRoleType;\n access_list: string[];\n joiningDate: Date;\n profileImage: string;\n lastLogin: Date;\n}\n\nexport type IAdminCreate = Omit<IAdmin, keyof BaseEntity>;\nexport type IAdminUpdate = Partial<IAdminCreate>;\nexport type IAdminSafe = Omit<IAdmin, 'password'>;\n","import type { BaseEntity } from \"../base\";\nimport type { IStore } from \"../store\";\n\nexport const DiscountTypeEnum = {\n PERCENTAGE: \"PERCENTAGE\",\n FIXED: \"FIXED\",\n} as const;\n\nexport type DiscountTypeEnum = (typeof DiscountTypeEnum)[keyof typeof DiscountTypeEnum];\n\nexport interface IDiscountType {\n type: DiscountTypeEnum;\n value: number;\n}\n\nexport interface ICoupon extends BaseEntity {\n title: string;\n couponCode: string;\n startTime: Date;\n endTime: Date;\n discountType: IDiscountType;\n minimumAmount: number;\n isPromotional: boolean;\n status: boolean;\n store: IStore | string;\n}","import type { BaseEntity } from \"../base\";\nimport type { Metadata } from \"../common\";\nimport type { ICoupon } from \"../coupon\";\nimport type { ICustomer } from \"../customer\";\nimport type { IOrderItem } from \"../orderItem\";\nimport type { IStore } from \"../store\";\n\nexport const OrderStatusEnum = {\n PENDING: \"PENDING\",\n CONFIRMED: \"CONFIRMED\",\n PROCESSING: \"PROCESSING\",\n SHIPPED: \"SHIPPED\",\n DELIVERED: \"DELIVERED\",\n CANCELED: \"CANCELED\",\n FAILED: \"FAILED\",\n REFUNDED: \"REFUNDED\",\n PARTIALLY_REFUNDED: \"PARTIALLY_REFUNDED\",\n} as const;\n\nexport type OrderStatusEnum = (typeof OrderStatusEnum)[keyof typeof OrderStatusEnum];\n\nexport interface IOrder extends BaseEntity {\n orderId: string;\n orderItems: IOrderItem[];\n user?: ICustomer;\n coupon?: ICoupon;\n store: IStore;\n status: OrderStatusEnum;\n subTotalAmount: number;\n discountAmount: number;\n totalAmount: number;\n metaData: Metadata;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACYO,IAAM,cAAgC;AAAA,EACzC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ;;;AClBO,IAAM,mBAAmB;AAAA,EAC5B,YAAY;AAAA,EACZ,OAAO;AACX;;;ACCO,IAAM,kBAAkB;AAAA,EAC3B,SAAS;AAAA,EACT,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,SAAS;AAAA,EACT,WAAW;AAAA,EACX,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,oBAAoB;AACxB;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fas-core/shared-types",
3
- "version": "1.0.18",
3
+ "version": "1.0.20",
4
4
  "description": "FAS Core Shared Types - A collection of shared TypeScript types for the FAS Core SDK.",
5
5
  "author": "ibreakloops",
6
6
  "license": "UNLICENSED",