@livetronics/pipesurf-types 1.1.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 +106 -0
- package/dist/generated/api.d.ts +4218 -0
- package/dist/generated/api.d.ts.map +1 -0
- package/dist/generated/api.js +6 -0
- package/dist/generated/api.js.map +1 -0
- package/dist/index.d.ts +414 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/package.json +33 -0
package/README.md
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# @pipesurf/types
|
|
2
|
+
|
|
3
|
+
Shared TypeScript types for PipeSurf applications.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# From npm (when published)
|
|
9
|
+
npm install @pipesurf/types
|
|
10
|
+
|
|
11
|
+
# From local path (for development)
|
|
12
|
+
npm install ../packages/types
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import type {
|
|
19
|
+
User,
|
|
20
|
+
Project,
|
|
21
|
+
ApiResponse,
|
|
22
|
+
CreateProjectRequest
|
|
23
|
+
} from '@pipesurf/types'
|
|
24
|
+
|
|
25
|
+
// Use in API calls
|
|
26
|
+
const response: ApiResponse<Project[]> = await fetch('/api/projects').then(
|
|
27
|
+
(res) => res.json()
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
// Use in forms
|
|
31
|
+
const newProject: CreateProjectRequest = {
|
|
32
|
+
code: 'PRJ-001',
|
|
33
|
+
name: 'New Pipeline Project',
|
|
34
|
+
clientName: 'Client Corp',
|
|
35
|
+
startDate: '2024-01-01',
|
|
36
|
+
endDate: '2024-12-31',
|
|
37
|
+
location: 'Houston, TX',
|
|
38
|
+
phases: ['FIT_UP', 'WELDING', 'NDT']
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Use in components
|
|
42
|
+
interface ProjectCardProps {
|
|
43
|
+
project: Project
|
|
44
|
+
onEdit?: (id: number) => void
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Available Types
|
|
49
|
+
|
|
50
|
+
### Entities
|
|
51
|
+
|
|
52
|
+
- `User`, `Company`, `Project`, `ProjectPhase`
|
|
53
|
+
- `Welder`, `WPS`, `WPSEntry`
|
|
54
|
+
- `Draft`, `DraftJoint`, `DraftSheet`, `DraftSpool`
|
|
55
|
+
- `Joint`, `Sheet`, `Spool`
|
|
56
|
+
- `MaterialGrade`, `WeldingProcess`, `WeldingCode`, `Schedule`
|
|
57
|
+
|
|
58
|
+
### Request/Response Types
|
|
59
|
+
|
|
60
|
+
- `ApiResponse<T>`, `PaginatedResponse<T>`
|
|
61
|
+
- `CreateUserRequest`, `UpdateUserRequest`
|
|
62
|
+
- `CreateProjectRequest`, `UpdateProjectRequest`
|
|
63
|
+
- `CreateWelderRequest`, `UpdateWelderRequest`
|
|
64
|
+
- `CreateWPSRequest`, `AddWPSEntriesRequest`
|
|
65
|
+
- `CreateEditDraftRequest`, `CreateDeleteDraftRequest`
|
|
66
|
+
- `SendOTPRequest`, `LoginViaOTPRequest`, `LoginResponse`
|
|
67
|
+
|
|
68
|
+
### Query Parameter Types
|
|
69
|
+
|
|
70
|
+
- `UsersQueryParams`, `ProjectsQueryParams`
|
|
71
|
+
- `DraftsQueryParams`, `WeldersQueryParams`, `WPSQueryParams`
|
|
72
|
+
|
|
73
|
+
### Enums/Unions
|
|
74
|
+
|
|
75
|
+
- `UserRole`, `UserStatus`, `UserGender`
|
|
76
|
+
- `ProjectStatus`, `ProjectPhaseType`, `ProjectRole`
|
|
77
|
+
- `DraftType`, `DraftStatus`
|
|
78
|
+
- `JointStatus`, `WelderStatus`, `CompanyStatus`
|
|
79
|
+
- `MaterialGradeType`, `MaterialCategory`
|
|
80
|
+
|
|
81
|
+
## Development
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
# Build the package
|
|
85
|
+
npm run build
|
|
86
|
+
|
|
87
|
+
# Watch mode
|
|
88
|
+
npm run dev
|
|
89
|
+
|
|
90
|
+
# Clean build artifacts
|
|
91
|
+
npm run clean
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Integration with React/React Native
|
|
95
|
+
|
|
96
|
+
This package is designed to be used with:
|
|
97
|
+
|
|
98
|
+
- **pipesurf-web** (React)
|
|
99
|
+
- **pipesurf-mobile** (React Native)
|
|
100
|
+
|
|
101
|
+
Types are compatible with:
|
|
102
|
+
|
|
103
|
+
- React Query / TanStack Query
|
|
104
|
+
- Axios / Fetch
|
|
105
|
+
- React Hook Form
|
|
106
|
+
- Zod (for runtime validation)
|