@automateinc/fleet-types 1.0.59 → 1.0.60-dev.e967155

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.
@@ -3,7 +3,11 @@ name: Publish Package to npmjs
3
3
  on:
4
4
  push:
5
5
  branches:
6
- - "**" # all branches
6
+ - "**" # all branches
7
+
8
+ permissions:
9
+ id-token: write # Required for OIDC
10
+ contents: read
7
11
 
8
12
  jobs:
9
13
  publish:
@@ -17,8 +21,8 @@ jobs:
17
21
 
18
22
  - uses: actions/setup-node@v4
19
23
  with:
20
- node-version: '20.x'
21
- registry-url: 'https://registry.npmjs.org'
24
+ node-version: "20.x"
25
+ registry-url: "https://registry.npmjs.org"
22
26
 
23
27
  - run: npm install -g semver
24
28
 
@@ -46,9 +50,8 @@ jobs:
46
50
  - run: npm ci
47
51
 
48
52
  - name: Publish to npm
49
- run: npm publish --provenance --access public --tag $( [[ "${{ github.ref_name }}" == "main" ]] && echo "latest" || echo "dev" )
50
- env:
51
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
53
+ run: npm install -g npm@latest
54
+ - run: npm publish --provenance --access public --tag $( [[ "${{ github.ref_name }}" == "main" ]] && echo "latest" || echo "dev" )
52
55
 
53
56
  - name: Output Published Version
54
57
  run: 'echo "📦 Published version: ${{ steps.bump.outputs.version }}"'
package/.husky/pre-commit CHANGED
@@ -1,5 +1,4 @@
1
1
  #!/usr/bin/env sh
2
2
  . "$(dirname -- "$0")/_/husky.sh"
3
3
 
4
- npx lint-staged
5
-
4
+ npx biome ci
@@ -0,0 +1,47 @@
1
+ {
2
+ "[javascript]": {
3
+ "editor.codeActionsOnSave": {
4
+ "source.fixAll.biome": "explicit",
5
+ "source.organizeImports.biome": "explicit"
6
+ },
7
+ "editor.defaultFormatter": "biomejs.biome"
8
+ },
9
+ "[javascriptreact]": {
10
+ "editor.codeActionsOnSave": {
11
+ "source.fixAll.biome": "explicit",
12
+ "source.organizeImports.biome": "explicit"
13
+ },
14
+ "editor.defaultFormatter": "biomejs.biome"
15
+ },
16
+ "[json]": {
17
+ "editor.defaultFormatter": "vscode.json-language-features"
18
+ },
19
+ "[jsonc]": {
20
+ "editor.defaultFormatter": "biomejs.biome"
21
+ },
22
+ "[sql]": {
23
+ "editor.formatOnSave": false
24
+ },
25
+ "[typescript]": {
26
+ "editor.codeActionsOnSave": {
27
+ "source.fixAll.biome": "explicit",
28
+ "source.organizeImports.biome": "explicit"
29
+ },
30
+ "editor.defaultFormatter": "biomejs.biome"
31
+ },
32
+ "[typescriptreact]": {
33
+ "editor.codeActionsOnSave": {
34
+ "source.fixAll.biome": "explicit",
35
+ "source.organizeImports.biome": "explicit"
36
+ },
37
+ "editor.defaultFormatter": "biomejs.biome"
38
+ },
39
+ "biome.enabled": true,
40
+ "biome.lsp.bin": "./node_modules/.bin/biome",
41
+ "editor.codeActionsOnSave": {
42
+ "source.fixAll.biome": "explicit",
43
+ "source.organizeImports.biome": "explicit"
44
+ },
45
+ "editor.defaultFormatter": "biomejs.biome",
46
+ "editor.formatOnSave": true
47
+ }
package/biome.json ADDED
@@ -0,0 +1,3 @@
1
+ {
2
+ "extends": ["@automateinc/biomejs/config"]
3
+ }
@@ -3,7 +3,7 @@ export interface IAttendancePatrol {
3
3
  createdAt: string;
4
4
  updatedAt?: string;
5
5
 
6
- status?: 'PENDING' | 'COMPLETED' | 'ON_HOLD';
6
+ status?: "PENDING" | "COMPLETED" | "ON_HOLD";
7
7
 
8
8
  patrolId: string;
9
9
  attendanceId: string;
@@ -3,7 +3,7 @@ export interface IClusterPatrol {
3
3
  createdAt: string;
4
4
  updatedAt?: string;
5
5
 
6
- status?: 'PENDING' | 'COMPLETED' | 'ON_HOLD';
6
+ status?: "PENDING" | "COMPLETED" | "ON_HOLD";
7
7
 
8
8
  patrolId: string;
9
9
  date: string;
@@ -0,0 +1,11 @@
1
+ export interface IEmployeeGroup {
2
+ id: string;
3
+ createdAt: string;
4
+ updatedAt?: string;
5
+
6
+ title: string;
7
+ nationalities: string[];
8
+
9
+ regionId: string;
10
+ metadata?: any;
11
+ }
@@ -1,62 +1,28 @@
1
- interface Value<T = number> {
2
- format?: string;
3
- value: T;
4
- postfix?: string;
5
- defaultHidden?: boolean;
6
- }
7
-
8
1
  export interface IEmployeeMonthlyPayroll {
9
- status: Value<string>;
10
- company: Value<string>;
11
- role: Value<string>;
12
- salaryHold: Value<boolean>;
13
- contractStartDate: Value<string>;
14
- contractType: Value<string>;
15
- totalAllowances: Value;
16
- otherPay: Value;
17
- fixedAllowances: Value;
18
- foodAllowances: Value;
19
- daysOffOvertime: Value;
20
- daysOffOvertimeAllowance: Value;
21
- siteAllowances: Value;
22
- monthlyDays: Value;
23
- maxNormalHours: Value;
24
- increments: Value;
25
- dailyTransportAndRiskAllowances: Value;
26
- dailyTeamLeaderAllowance: Value;
27
- dailySiteAllowances: Value;
28
- dailyShiftAllowances: Value;
29
- dailyOtherPay: Value;
30
- dailyFixedAllowances: Value;
31
- performanceIncrement: Value;
32
- otherIncrements: Value;
33
- dailyOtherAllowances: Value;
34
- basicSalary: Value;
35
- totalGrossSalary: Value;
36
- totalNetPay: Value;
37
- contractualDailyHours: Value;
38
- totalAbsentDays: Value;
39
- totalWorkedDays: Value;
40
- sickLeaveDays: Value;
41
- totalHours: Value;
42
- normalHours: Value;
43
- overtimeHours: Value;
44
- dailyRate: Value;
45
- hourlyRate: Value;
46
- normalPay: Value;
47
- overtimePay: Value;
48
- normalRatio: Value;
49
- overtimeRatio: Value;
50
- SIODeductions: Value;
51
- adjustmentsPlus: Value;
52
- adjustmentsMinus: Value;
53
- otherDeductions: Value;
54
- totalDeductions: Value;
55
- contractTotalSalary: Value;
56
- iban: Value<string>;
57
- retired: Value<boolean>;
58
- bankTransfer: Value;
59
- bankUpload1: Value;
60
- bankUpload2: Value;
61
- cashPayment: Value;
2
+ id: string;
3
+ updatedAt: string;
4
+ createdAt: string;
5
+
6
+ status: "PENDING" | "APPROVED" | "PROCESSED";
7
+
8
+ metadata?: any;
9
+ payroll: {
10
+ outputs: {
11
+ [key: string]: any;
12
+ };
13
+ metrics: {
14
+ [key: string]: any;
15
+ };
16
+ warnings: {
17
+ [key: string]: boolean;
18
+ };
19
+ };
20
+ formatted: Record<
21
+ string,
22
+ {
23
+ id: string;
24
+ title: string;
25
+ value: any;
26
+ }
27
+ >;
62
28
  }
@@ -1,13 +1,13 @@
1
- import { AxiosError } from "axios";
2
1
  import { UseInfiniteQueryOptions, UseMutationOptions, UseQueryOptions } from "@tanstack/react-query";
2
+ import { AxiosError } from "axios";
3
3
 
4
4
  type APIError = {
5
5
  error:
6
- | string
7
- | Array<{
8
- message: string;
9
- field: string;
10
- }>;
6
+ | string
7
+ | Array<{
8
+ message: string;
9
+ field: string;
10
+ }>;
11
11
  };
12
12
 
13
13
  export type MutationOptions<Response, Args = void> = UseMutationOptions<Response, AxiosError<APIError>, Args, any>;
@@ -34,141 +34,169 @@ export type PaginatedResponse<T> = {
34
34
  };
35
35
 
36
36
  export * from "./api-key";
37
+ export * from "./asset";
38
+ export * from "./asset-category";
39
+ export * from "./asset-category-field";
40
+ export * from "./asset-type";
41
+ export * from "./asset-value";
37
42
  export * from "./attendance";
38
43
  export * from "./attendance-action";
39
- export * from "./attendance-presence-check";
40
44
  export * from "./attendance-count";
45
+ export * from "./attendance-draft";
46
+ export * from "./attendance-draft";
47
+ export * from "./attendance-leave-reason";
48
+ export * from "./attendance-patrol";
49
+ export * from "./attendance-patrol";
50
+ export * from "./attendance-patrol-point";
51
+ export * from "./attendance-patrol-point";
52
+ export * from "./attendance-presence-check";
53
+ export * from "./building";
54
+ export * from "./building-contact";
55
+ export * from "./building-lease";
56
+ export * from "./building-lease-payment";
57
+ export * from "./bunk";
58
+ export * from "./call-log";
59
+ export * from "./call-log";
60
+ export * from "./ceiling";
61
+ export * from "./client";
62
+ export * from "./client";
63
+ export * from "./client-class";
64
+ export * from "./client-class";
65
+ export * from "./client-contact";
66
+ export * from "./client-contact";
67
+ export * from "./client-contract";
68
+ export * from "./client-contract";
69
+ export * from "./client-site";
70
+ export * from "./client-site";
71
+ export * from "./cluster-patrol";
72
+ export * from "./cluster-patrol";
73
+ export * from "./cluster-patrol-point";
74
+ export * from "./cluster-patrol-point";
41
75
  export * from "./company";
76
+ export * from "./company-file";
77
+ export * from "./company-file";
78
+ export * from "./config";
79
+ export * from "./contact";
42
80
  export * from "./contract";
81
+ export * from "./contract-allowance";
82
+ export * from "./contract-benefit";
83
+ export * from "./contract-deduction";
84
+ export * from "./coords";
85
+ export * from "./day-of-week";
86
+ export * from "./day-of-week";
43
87
  export * from "./dispatch";
44
88
  export * from "./dispatch-attendance";
45
89
  export * from "./dispatch-count";
46
90
  export * from "./employee";
91
+ export * from "./employee-comment";
92
+ export * from "./employee-comment-reaction";
93
+ export * from "./employee-event";
94
+ export * from "./employee-event";
47
95
  export * from "./employee-field";
48
- export * from "./nfc-tag";
49
- export * from "./employee-status";
96
+ export * from "./employee-group";
97
+ export * from "./employee-group";
98
+ export * from "./employee-label";
99
+ export * from "./employee-label";
100
+ export * from "./employee-label-assignment";
101
+ export * from "./employee-label-assignment";
50
102
  export * from "./employee-monthly-payroll";
51
- export * from "./region";
52
- export * from "./request";
53
- export * from "./request-verification";
54
- export * from "./restriction";
55
- export * from "./request-category";
56
- export * from "./contact";
57
- export * from "./request-category-field";
58
- export * from "./request-type";
103
+ export * from "./employee-status";
104
+ export * from "./file";
105
+ export * from "./gender";
106
+ export * from "./leave";
107
+ export * from "./leave";
108
+ export * from "./leave-event";
109
+ export * from "./leave-event";
110
+ export * from "./leave-type";
111
+ export * from "./leave-type";
112
+ export * from "./loan";
113
+ export * from "./loan-installment";
114
+ export * from "./metadata";
115
+ export * from "./metadata-documents";
116
+ export * from "./metadata-expiring-documents";
117
+ export * from "./metadata-missing-documents";
118
+ export * from "./metadata-status-check";
59
119
  export * from "./models";
60
- export * from "./role";
61
- export * from "./schedule";
62
- export * from "./schedule-draft";
63
- export * from "./ceiling";
64
- export * from "./request-value";
65
- export * from "./team";
66
- export * from "./user";
120
+ export * from "./nfc-tag";
121
+ export * from "./notification";
122
+ export * from "./notification";
123
+ export * from "./notification-token";
124
+ export * from "./notification-token";
125
+ export * from "./one-time-password";
126
+ export * from "./patrol";
127
+ export * from "./patrol";
128
+ export * from "./patrol-point";
129
+ export * from "./patrol-point";
130
+ export * from "./payment-cycle";
131
+ export * from "./payment-cycle-config";
132
+ export * from "./payment-cycle-config";
133
+ export * from "./payroll-config";
134
+ export * from "./payroll-config";
135
+ export * from "./permission";
136
+ export * from "./permission-group";
137
+ export * from "./phone-line";
138
+ export * from "./phone-line-commitment";
139
+ export * from "./phone-line-contract";
140
+ export * from "./phone-line-package";
141
+ export * from "./position";
142
+ export * from "./position-template";
143
+ export * from "./position-template";
144
+ export * from "./position-template-item";
145
+ export * from "./position-template-item";
146
+ export * from "./position-version";
67
147
  export * from "./recruitment";
68
- export * from "./recruitment-employment-information-history";
69
148
  export * from "./recruitment-employment-information";
149
+ export * from "./recruitment-employment-information-history";
70
150
  export * from "./recruitment-medical-information";
151
+ export * from "./recruitment-national-card-information";
71
152
  export * from "./recruitment-other-information";
153
+ export * from "./recruitment-other-information-additional-information";
72
154
  export * from "./recruitment-passport-information";
73
- export * from "./recruitment-visa-information";
74
155
  export * from "./recruitment-personal-information";
75
- export * from "./file";
76
- export * from "./gender";
156
+ export * from "./recruitment-visa-information";
157
+ export * from "./region";
158
+ export * from "./report";
159
+ export * from "./report-category";
160
+ export * from "./report-category-field";
161
+ export * from "./report-comment";
162
+ export * from "./report-comment-reaction";
163
+ export * from "./report-type";
164
+ export * from "./report-value";
165
+ export * from "./request";
77
166
  export * from "./request-action";
78
167
  export * from "./request-action-execution";
79
- export * from "./signing-mode";
80
- export * from "./recruitment-other-information-additional-information";
81
- export * from "./recruitment-national-card-information";
82
- export * from "./client-class";
83
- export * from "./client";
84
- export * from "./client-contact";
85
- export * from "./client-site";
86
- export * from "./tag";
87
- export * from "./client-class";
88
- export * from "./client";
89
- export * from "./client-contact";
90
- export * from "./client-site";
91
- export * from "./zone";
168
+ export * from "./request-category";
169
+ export * from "./request-category-field";
170
+ export * from "./request-type";
171
+ export * from "./request-value";
172
+ export * from "./request-verification";
173
+ export * from "./restriction";
174
+ export * from "./role";
175
+ export * from "./schedule";
176
+ export * from "./schedule-attendance";
177
+ export * from "./schedule-day-off";
178
+ export * from "./schedule-draft";
92
179
  export * from "./schedule-site";
93
- export * from "./position";
94
- export * from "./one-time-password";
95
- export * from "./position-version";
96
180
  export * from "./shift";
97
181
  export * from "./shift-type";
182
+ export * from "./signing-mode";
98
183
  export * from "./standard-operating-procedure";
99
- export * from "./schedule-attendance";
100
- export * from "./coords";
101
- export * from "./attendance-leave-reason";
102
- export * from "./employee-comment";
103
- export * from "./employee-comment-reaction";
104
- export * from "./metadata";
105
- export * from "./metadata-expiring-documents";
106
- export * from "./metadata-status-check";
107
- export * from "./metadata-missing-documents";
108
- export * from "./metadata-documents";
109
- export * from "./config";
110
- export * from "./contract-allowance";
111
- export * from "./contract-deduction";
112
- export * from "./contract-benefit";
113
- export * from "./payment-cycle";
114
- export * from "./building";
115
- export * from "./building-lease";
116
- export * from "./building-lease-payment";
117
- export * from "./building-contact";
184
+ export * from "./tag";
185
+ export * from "./tag-color";
186
+ export * from "./tag-color";
187
+ export * from "./team";
118
188
  export * from "./unit";
119
189
  export * from "./unit-room";
120
- export * from "./bunk";
121
- export * from "./permission";
122
- export * from "./permission-group";
123
- export * from "./vendor";
124
- export * from "./vendor-contact";
190
+ export * from "./user";
125
191
  export * from "./vehicle";
126
- export * from "./asset";
127
- export * from "./asset-type";
128
- export * from "./asset-category";
129
- export * from "./asset-category-field";
130
- export * from "./asset-value";
131
- export * from "./phone-line";
132
- export * from "./phone-line-commitment";
133
- export * from "./phone-line-contract";
134
- export * from "./phone-line-package";
135
- export * from "./vendor";
192
+ export * from "./vehicle-contract";
193
+ export * from "./vehicle-contract-payment";
194
+ export * from "./vehicle-insurance";
136
195
  export * from "./vehicle-make";
137
196
  export * from "./vehicle-model";
138
197
  export * from "./vehicle-registration";
139
- export * from "./vehicle-insurance";
140
- export * from "./vehicle-contract";
141
- export * from "./vehicle-contract-payment";
142
198
  export * from "./vehicle-status";
143
- export * from "./loan";
144
- export * from "./loan-installment";
145
- export * from "./report";
146
- export * from "./report-category";
147
- export * from "./report-category-field";
148
- export * from "./report-type";
149
- export * from "./report-value";
150
- export * from "./report-comment";
151
- export * from "./report-comment-reaction";
152
- export * from "./call-log";
153
- export * from "./notification";
154
- export * from "./notification-token";
155
- export * from "./employee-label";
156
- export * from "./tag-color";
157
- export * from "./employee-event";
158
- export * from "./leave-type";
159
- export * from "./leave-event";
160
- export * from "./leave";
161
- export * from "./company-file";
162
- export * from "./employee-label-assignment";
163
- export * from "./patrol";
164
- export * from "./patrol-point";
165
- export * from "./attendance-patrol";
166
- export * from "./attendance-patrol-point";
167
- export * from "./position-template";
168
- export * from "./position-template-item";
169
- export * from "./day-of-week";
170
- export * from "./client-contract";
171
- export * from "./cluster-patrol";
172
- export * from "./cluster-patrol-point";
173
- export * from "./attendance-draft";
174
- export * from "./schedule-day-off";
199
+ export * from "./vendor";
200
+ export * from "./vendor";
201
+ export * from "./vendor-contact";
202
+ export * from "./zone";
@@ -0,0 +1,8 @@
1
+ export interface IPaymentCycleConfig {
2
+ id: string;
3
+ createdAt: Date;
4
+ from: number;
5
+ to: number;
6
+ companyId: string;
7
+ metadata?: any;
8
+ }
@@ -0,0 +1,13 @@
1
+ export type IPayrollConfig = {
2
+ id: string;
3
+ createdAt: string;
4
+ updatedAt?: string;
5
+
6
+ value: any;
7
+
8
+ type: "DRAFT" | "PUBLISHED";
9
+
10
+ employeeGroupId: string;
11
+
12
+ metadata?: any;
13
+ };
@@ -5,7 +5,7 @@ export type IScheduleDayOff = {
5
5
  createdAt: string;
6
6
  updatedAt?: string;
7
7
 
8
- dayOfWeek: IDayOfWeek
8
+ dayOfWeek: IDayOfWeek;
9
9
  employeeId: string;
10
10
 
11
11
  metadata?: any;
package/package.json CHANGED
@@ -1,43 +1,7 @@
1
1
  {
2
- "name": "@automateinc/fleet-types",
3
- "private": false,
4
- "version": "1.0.59",
5
- "description": "Reusable TypeScript types and interfaces for Fleet API.",
6
- "main": "dist/index.js",
7
- "types": "dist/types/index.d.ts",
8
- "scripts": {
9
- "prepare": "husky install",
10
- "build": "tsc && cp -R src/types dist/",
11
- "test": "echo \"Error: no test specified\" && exit 1"
12
- },
13
- "eslintConfig": {
14
- "extends": "@404-software/eslint-config"
15
- },
16
- "keywords": [
17
- "typescript",
18
- "types",
19
- "interfaces",
20
- "api"
21
- ],
22
- "repository": {
23
- "type": "git",
24
- "url": "git+https://github.com/automateinc/fleet-types.git"
25
- },
26
2
  "author": "Automate Inc. <hello@automate.bh> (https://automate.bh)",
27
- "license": "MIT",
28
- "devDependencies": {
29
- "@404-software/eslint-config": "^1.0.20",
30
- "@tanstack/react-query": "^4.36.1",
31
- "axios": "^1.7.9",
32
- "eslint": "^8.18.0",
33
- "husky": "^9.1.7",
34
- "prettier": "^2.7.1",
35
- "typescript": "5.1.6"
36
- },
37
- "lint-staged": {
38
- "src/**/*.ts": [
39
- "eslint --fix"
40
- ]
3
+ "bugs": {
4
+ "url": "https://github.com/automateinc/fleet-types/issues"
41
5
  },
42
6
  "dependencies": {
43
7
  "asynckit": "^0.4.0",
@@ -53,8 +17,40 @@
53
17
  "react": "^18.3.1",
54
18
  "use-sync-external-store": "^1.4.0"
55
19
  },
56
- "bugs": {
57
- "url": "https://github.com/automateinc/fleet-types/issues"
20
+ "description": "Reusable TypeScript types and interfaces for Fleet API.",
21
+ "devDependencies": {
22
+ "@automateinc/biomejs": "^0.4.3",
23
+ "@biomejs/biome": "^2.3.8",
24
+ "@tanstack/react-query": "^4.36.1",
25
+ "axios": "^1.7.9",
26
+ "husky": "^9.1.7",
27
+ "typescript": "5.1.6"
28
+ },
29
+ "homepage": "https://github.com/automateinc/fleet-types#readme",
30
+ "keywords": [
31
+ "typescript",
32
+ "types",
33
+ "interfaces",
34
+ "api"
35
+ ],
36
+ "license": "MIT",
37
+ "lint-staged": {
38
+ "src/**/*.ts": [
39
+ "biome ci"
40
+ ]
41
+ },
42
+ "main": "dist/index.js",
43
+ "name": "@automateinc/fleet-types",
44
+ "private": false,
45
+ "repository": {
46
+ "type": "git",
47
+ "url": "git+https://github.com/automateinc/fleet-types.git"
48
+ },
49
+ "scripts": {
50
+ "build": "tsc && cp -R src/types dist/",
51
+ "prepare": "husky install",
52
+ "test": "echo \"Error: no test specified\" && exit 1"
58
53
  },
59
- "homepage": "https://github.com/automateinc/fleet-types#readme"
54
+ "types": "dist/types/index.d.ts",
55
+ "version": "1.0.60-dev.e967155"
60
56
  }
package/tsconfig.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
- "compilerOptions": {
3
- "outDir": "./dist",
4
- "declaration": true,
5
- "emitDeclarationOnly": true,
6
- "strict": true,
7
- "esModuleInterop": true,
8
- "skipLibCheck": true
9
- },
10
- "include": ["./**/*.ts"],
2
+ "compilerOptions": {
3
+ "declaration": true,
4
+ "emitDeclarationOnly": true,
5
+ "esModuleInterop": true,
6
+ "outDir": "./dist",
7
+ "skipLibCheck": true,
8
+ "strict": true
9
+ },
10
+ "include": ["./**/*.ts"]
11
11
  }
package/.eslintrc.json DELETED
@@ -1,25 +0,0 @@
1
- {
2
- "extends": "@404-software/eslint-config",
3
- "rules": {
4
- "prettier/prettier": [
5
- "error",
6
- {
7
- "bracketSameLine": false,
8
- "arrowParens": "avoid",
9
- "quoteProps": "as-needed",
10
- "singleQuote": false,
11
- "trailingComma": "all",
12
- "useTabs": true,
13
- "bracketSpacing": true,
14
- "tabWidth": 2,
15
- "semi": true,
16
- "jsxSingleQuote": false,
17
- "printWidth": 120,
18
- "endOfLine": "auto"
19
- }
20
- ],
21
- "no-console": "off",
22
- "@typescript-eslint/no-explicit-any": "off",
23
- "@typescript-eslint/no-empty-function": "off"
24
- }
25
- }