@fas-core/shared-types 1.0.0

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/ReadMe.md ADDED
@@ -0,0 +1,22 @@
1
+ ## 📦 Publish Instructions
2
+
3
+ To build and publish this package, follow these steps:
4
+
5
+ ### Step 1: Build the Project
6
+
7
+ ```bash
8
+ npm run build
9
+ ```
10
+
11
+ ### Step 2: Publish the Package
12
+
13
+ ```bash
14
+ npm publish --access public
15
+ ```
16
+
17
+ ### Step 3: Bump Version (for updates)
18
+
19
+ ```bash
20
+ npm version patch
21
+ npm publish
22
+ ```
@@ -0,0 +1,115 @@
1
+ interface BaseEntity {
2
+ _id: string;
3
+ createdAt: Date;
4
+ updatedAt: Date;
5
+ deletedAt?: Date;
6
+ isDeleted?: boolean;
7
+ }
8
+
9
+ interface ICountry extends BaseEntity {
10
+ name: string;
11
+ slug: string;
12
+ isoCode: string;
13
+ isoCode3: string;
14
+ callingCode: string;
15
+ capital: string;
16
+ subContinent: string;
17
+ continent: string;
18
+ status: boolean;
19
+ }
20
+
21
+ interface ICustomer extends BaseEntity {
22
+ firstName: string;
23
+ lastName: string;
24
+ profileImage: string;
25
+ address: IAddress;
26
+ email: string;
27
+ phoneNumber?: string;
28
+ password: string;
29
+ }
30
+
31
+ interface IState extends BaseEntity {
32
+ country: ICountry;
33
+ name: string;
34
+ slug: string;
35
+ isoCode: string;
36
+ subdivision: string;
37
+ status: boolean;
38
+ }
39
+
40
+ interface IAddress extends BaseEntity {
41
+ addressLine1: string;
42
+ addressLine2: string;
43
+ city: string;
44
+ zipCode: string;
45
+ firstName: string;
46
+ lastName: string;
47
+ email: string;
48
+ phoneNumber: string;
49
+ defaultAddress: boolean;
50
+ state: IState;
51
+ country: ICountry;
52
+ customer: ICustomer;
53
+ }
54
+
55
+ type IAdminRoleType = 'Admin' | 'Super Admin' | 'Cashier' | 'Manager' | 'CEO' | 'Driver' | 'Security Guard' | 'Accountant';
56
+ declare const ADMIN_ROLES: IAdminRoleType[];
57
+ interface IAdmin extends BaseEntity {
58
+ firstName: string;
59
+ lastName: string;
60
+ email: string;
61
+ phoneNumber: string;
62
+ status: boolean;
63
+ password: string;
64
+ role: IAdminRoleType;
65
+ access_list: string[];
66
+ joiningDate: Date;
67
+ profileImage: string;
68
+ }
69
+ type IAdminCreate = Omit<IAdmin, keyof BaseEntity>;
70
+ type IAdminUpdate = Partial<IAdminCreate>;
71
+ type IAdminSafe = Omit<IAdmin, 'password'>;
72
+
73
+ interface Paginated<T> {
74
+ data: T[];
75
+ total: number;
76
+ page: number;
77
+ limit: number;
78
+ totalPages: number;
79
+ }
80
+ interface ApiResponse<T> {
81
+ success: boolean;
82
+ message: string;
83
+ data?: T;
84
+ error?: string;
85
+ }
86
+ interface SoftDeleteFilter {
87
+ isDeleted?: boolean;
88
+ deletedAt?: Date | null;
89
+ }
90
+
91
+ interface ICurrency extends BaseEntity {
92
+ name: string;
93
+ symbol: string;
94
+ status: boolean;
95
+ iso_code: string;
96
+ exchange_rate: number;
97
+ live_exchange_rates: boolean;
98
+ }
99
+
100
+ interface IStoreSettings {
101
+ logo: string;
102
+ theme: 'light' | 'dark';
103
+ timezone: string;
104
+ }
105
+ interface IStore extends BaseEntity {
106
+ name: string;
107
+ shortName: string;
108
+ slug: string;
109
+ domain: string;
110
+ currencies: ICurrency[];
111
+ settings: IStoreSettings;
112
+ status: boolean;
113
+ }
114
+
115
+ export { ADMIN_ROLES, type ApiResponse, type BaseEntity, type IAddress, type IAdmin, type IAdminCreate, type IAdminRoleType, type IAdminSafe, type IAdminUpdate, type ICountry, type ICurrency, type ICustomer, type IState, type IStore, type IStoreSettings, type Paginated, type SoftDeleteFilter };
@@ -0,0 +1,115 @@
1
+ interface BaseEntity {
2
+ _id: string;
3
+ createdAt: Date;
4
+ updatedAt: Date;
5
+ deletedAt?: Date;
6
+ isDeleted?: boolean;
7
+ }
8
+
9
+ interface ICountry extends BaseEntity {
10
+ name: string;
11
+ slug: string;
12
+ isoCode: string;
13
+ isoCode3: string;
14
+ callingCode: string;
15
+ capital: string;
16
+ subContinent: string;
17
+ continent: string;
18
+ status: boolean;
19
+ }
20
+
21
+ interface ICustomer extends BaseEntity {
22
+ firstName: string;
23
+ lastName: string;
24
+ profileImage: string;
25
+ address: IAddress;
26
+ email: string;
27
+ phoneNumber?: string;
28
+ password: string;
29
+ }
30
+
31
+ interface IState extends BaseEntity {
32
+ country: ICountry;
33
+ name: string;
34
+ slug: string;
35
+ isoCode: string;
36
+ subdivision: string;
37
+ status: boolean;
38
+ }
39
+
40
+ interface IAddress extends BaseEntity {
41
+ addressLine1: string;
42
+ addressLine2: string;
43
+ city: string;
44
+ zipCode: string;
45
+ firstName: string;
46
+ lastName: string;
47
+ email: string;
48
+ phoneNumber: string;
49
+ defaultAddress: boolean;
50
+ state: IState;
51
+ country: ICountry;
52
+ customer: ICustomer;
53
+ }
54
+
55
+ type IAdminRoleType = 'Admin' | 'Super Admin' | 'Cashier' | 'Manager' | 'CEO' | 'Driver' | 'Security Guard' | 'Accountant';
56
+ declare const ADMIN_ROLES: IAdminRoleType[];
57
+ interface IAdmin extends BaseEntity {
58
+ firstName: string;
59
+ lastName: string;
60
+ email: string;
61
+ phoneNumber: string;
62
+ status: boolean;
63
+ password: string;
64
+ role: IAdminRoleType;
65
+ access_list: string[];
66
+ joiningDate: Date;
67
+ profileImage: string;
68
+ }
69
+ type IAdminCreate = Omit<IAdmin, keyof BaseEntity>;
70
+ type IAdminUpdate = Partial<IAdminCreate>;
71
+ type IAdminSafe = Omit<IAdmin, 'password'>;
72
+
73
+ interface Paginated<T> {
74
+ data: T[];
75
+ total: number;
76
+ page: number;
77
+ limit: number;
78
+ totalPages: number;
79
+ }
80
+ interface ApiResponse<T> {
81
+ success: boolean;
82
+ message: string;
83
+ data?: T;
84
+ error?: string;
85
+ }
86
+ interface SoftDeleteFilter {
87
+ isDeleted?: boolean;
88
+ deletedAt?: Date | null;
89
+ }
90
+
91
+ interface ICurrency extends BaseEntity {
92
+ name: string;
93
+ symbol: string;
94
+ status: boolean;
95
+ iso_code: string;
96
+ exchange_rate: number;
97
+ live_exchange_rates: boolean;
98
+ }
99
+
100
+ interface IStoreSettings {
101
+ logo: string;
102
+ theme: 'light' | 'dark';
103
+ timezone: string;
104
+ }
105
+ interface IStore extends BaseEntity {
106
+ name: string;
107
+ shortName: string;
108
+ slug: string;
109
+ domain: string;
110
+ currencies: ICurrency[];
111
+ settings: IStoreSettings;
112
+ status: boolean;
113
+ }
114
+
115
+ export { ADMIN_ROLES, type ApiResponse, type BaseEntity, type IAddress, type IAdmin, type IAdminCreate, type IAdminRoleType, type IAdminSafe, type IAdminUpdate, type ICountry, type ICurrency, type ICustomer, type IState, type IStore, type IStoreSettings, type Paginated, type SoftDeleteFilter };
package/dist/index.js ADDED
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ ADMIN_ROLES: () => ADMIN_ROLES
24
+ });
25
+ module.exports = __toCommonJS(index_exports);
26
+
27
+ // src/admin/interface.ts
28
+ var ADMIN_ROLES = [
29
+ "Admin",
30
+ "Super Admin",
31
+ "Cashier",
32
+ "Manager",
33
+ "CEO",
34
+ "Driver",
35
+ "Security Guard",
36
+ "Accountant"
37
+ ];
38
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts","../src/admin/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';","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}\n\nexport type IAdminCreate = Omit<IAdmin, keyof BaseEntity>;\nexport type IAdminUpdate = Partial<IAdminCreate>;\nexport type IAdminSafe = Omit<IAdmin, 'password'>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;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;","names":[]}
package/dist/index.mjs ADDED
@@ -0,0 +1,15 @@
1
+ // src/admin/interface.ts
2
+ var ADMIN_ROLES = [
3
+ "Admin",
4
+ "Super Admin",
5
+ "Cashier",
6
+ "Manager",
7
+ "CEO",
8
+ "Driver",
9
+ "Security Guard",
10
+ "Accountant"
11
+ ];
12
+ export {
13
+ ADMIN_ROLES
14
+ };
15
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/admin/interface.ts"],"sourcesContent":["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}\n\nexport type IAdminCreate = Omit<IAdmin, keyof BaseEntity>;\nexport type IAdminUpdate = Partial<IAdminCreate>;\nexport type IAdminSafe = Omit<IAdmin, 'password'>;\n"],"mappings":";AAYO,IAAM,cAAgC;AAAA,EACzC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ;","names":[]}
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "@fas-core/shared-types",
3
+ "version": "1.0.0",
4
+ "description": "FAS Core Shared Types - A collection of shared TypeScript types for the FAS Core SDK.",
5
+ "author": "ibreakloops",
6
+ "license": "UNLICENSED",
7
+ "private": false,
8
+ "main": "dist/index.cjs",
9
+ "module": "dist/index.js",
10
+ "types": "dist/index.d.ts",
11
+ "files": [
12
+ "dist"
13
+ ],
14
+ "exports": {
15
+ ".": {
16
+ "types": "./dist/index.d.ts",
17
+ "import": "./dist/index.js",
18
+ "require": "./dist/index.cjs"
19
+ }
20
+ },
21
+ "scripts": {
22
+ "dev": "tsup src/index.ts --watch --format esm,cjs --dts",
23
+ "build": "tsup src/index.ts --format esm,cjs --dts",
24
+ "clean": "rm -rf dist",
25
+ "prepublishOnly": "npm run clean && npm run build"
26
+ },
27
+ "keywords": [
28
+ "fas-core",
29
+ "shared",
30
+ "sdk",
31
+ "typescript"
32
+ ],
33
+ "devDependencies": {
34
+ "tsup": "^8.5.1",
35
+ "typescript": "^5.9.3"
36
+ },
37
+ "engines": {
38
+ "node": ">=18"
39
+ }
40
+ }