@plyaz/types 1.0.1 → 1.0.2
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 +220 -220
- package/dist/index.cjs.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +22 -24
package/README.md
CHANGED
|
@@ -1,221 +1,221 @@
|
|
|
1
|
-
# @plyaz/types
|
|
2
|
-
|
|
3
|
-
Core TypeScript type definitions for the Plyaz Web3 sports platform. This package serves as the foundation for type safety across all frontend and backend services.
|
|
4
|
-
|
|
5
|
-
## Overview
|
|
6
|
-
|
|
7
|
-
`@plyaz/types` provides comprehensive TypeScript interfaces, enums, and type definitions for all entities, API contracts, and data structures used throughout the Plyaz ecosystem. This package ensures type consistency across microservices, frontend applications, and shared packages.
|
|
8
|
-
|
|
9
|
-
## Installation
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
pnpm add @plyaz/types
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Architecture Position
|
|
16
|
-
|
|
17
|
-
```
|
|
18
|
-
@plyaz/types ← Foundation layer (no dependencies)
|
|
19
|
-
↓
|
|
20
|
-
All other packages depend on types
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## Core Exports
|
|
24
|
-
|
|
25
|
-
All types can be imported directly from the main package:
|
|
26
|
-
|
|
27
|
-
```typescript
|
|
28
|
-
import type {
|
|
29
|
-
// User & Authentication
|
|
30
|
-
UserRole,
|
|
31
|
-
} from '@plyaz/types';
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
## Type Categories
|
|
35
|
-
|
|
36
|
-
### Core Entities
|
|
37
|
-
- **User Management**: Authentication, profiles, roles, preferences
|
|
38
|
-
- **Athlete System**: Performance tracking, tokenization, campaigns
|
|
39
|
-
- **Stakeholder Network**: Scouts, agents, clubs, fans relationships
|
|
40
|
-
- **Digital Assets**: NFTs, tokens, collectibles, marketplace items
|
|
41
|
-
|
|
42
|
-
### System Types
|
|
43
|
-
- **API Layer**: Request/response schemas, pagination, filtering
|
|
44
|
-
- **Blockchain**: Transaction types, wallet connections, smart contracts
|
|
45
|
-
- **Events**: Event bus messages, notifications, real-time updates
|
|
46
|
-
- **Configuration**: Environment settings, feature flags, constants
|
|
47
|
-
|
|
48
|
-
### Validation Schemas
|
|
49
|
-
- **Input Validation**: Zod-compatible type definitions
|
|
50
|
-
- **Business Rules**: Constraint types for domain logic
|
|
51
|
-
- **Security**: Permission sets, access control types
|
|
52
|
-
|
|
53
|
-
## Usage Examples
|
|
54
|
-
|
|
55
|
-
### Basic Entity Usage
|
|
56
|
-
```typescript
|
|
57
|
-
import type { Athlete, PerformanceMetrics, SportCategory } from '@plyaz/types';
|
|
58
|
-
|
|
59
|
-
const athlete: Athlete = {
|
|
60
|
-
id: 'athlete_123',
|
|
61
|
-
profile: {
|
|
62
|
-
name: 'John Doe',
|
|
63
|
-
sport: SportCategory.FOOTBALL,
|
|
64
|
-
position: 'Forward'
|
|
65
|
-
},
|
|
66
|
-
tokenAddress: '0x...',
|
|
67
|
-
currentRanking: 45
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
const performance: PerformanceMetrics = {
|
|
71
|
-
athleteId: athlete.id,
|
|
72
|
-
period: '2024-Q1',
|
|
73
|
-
goals: 12,
|
|
74
|
-
assists: 8,
|
|
75
|
-
rating: 8.5
|
|
76
|
-
};
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
### API Response Typing
|
|
80
|
-
```typescript
|
|
81
|
-
import type { ApiResponse, PaginatedResponse, Athlete } from '@plyaz/types';
|
|
82
|
-
|
|
83
|
-
// Single resource response
|
|
84
|
-
type AthleteResponse = ApiResponse<Athlete>;
|
|
85
|
-
|
|
86
|
-
// Paginated collection response
|
|
87
|
-
type AthletesListResponse = PaginatedResponse<Athlete>;
|
|
88
|
-
|
|
89
|
-
const athletesList: AthletesListResponse = {
|
|
90
|
-
data: [athlete1, athlete2],
|
|
91
|
-
pagination: {
|
|
92
|
-
page: 1,
|
|
93
|
-
limit: 20,
|
|
94
|
-
total: 150,
|
|
95
|
-
hasNext: true
|
|
96
|
-
},
|
|
97
|
-
meta: {
|
|
98
|
-
timestamp: new Date().toISOString(),
|
|
99
|
-
requestId: 'req_123'
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
### Event System Typing
|
|
105
|
-
```typescript
|
|
106
|
-
import type { EventPayload } from '@plyaz/types';
|
|
107
|
-
|
|
108
|
-
// Type-safe event handling
|
|
109
|
-
const athleteTokenMinted: EventPayload<'ATHLETE_TOKEN_MINTED'> = {
|
|
110
|
-
type: 'ATHLETE_TOKEN_MINTED',
|
|
111
|
-
payload: {
|
|
112
|
-
athleteId: 'athlete_123',
|
|
113
|
-
tokenAddress: '0x...',
|
|
114
|
-
initialSupply: 1000000,
|
|
115
|
-
timestamp: Date.now()
|
|
116
|
-
},
|
|
117
|
-
metadata: {
|
|
118
|
-
source: 'blockchain-service',
|
|
119
|
-
version: '1.0.0'
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
## Type Safety Guidelines
|
|
125
|
-
|
|
126
|
-
- [Package](https://plyaz.atlassian.net/wiki/spaces/SD/pages/950359/Types+Package)
|
|
127
|
-
- [Documentation](https://plyaz.atlassian.net/wiki/spaces/SD/pages/22544393/Coding+Standards+Style+Guide)
|
|
128
|
-
|
|
129
|
-
## Validation Integration
|
|
130
|
-
|
|
131
|
-
Types are designed to work seamlessly with validation libraries:
|
|
132
|
-
|
|
133
|
-
```typescript
|
|
134
|
-
import { z } from 'zod';
|
|
135
|
-
import type { User } from '@plyaz/types';
|
|
136
|
-
|
|
137
|
-
// Zod schema matching TypeScript type
|
|
138
|
-
const UserSchema = z.object({
|
|
139
|
-
id: z.string().uuid(),
|
|
140
|
-
email: z.string().email(),
|
|
141
|
-
role: z.enum(['ATHLETE', 'SCOUT', 'AGENT', 'CLUB', 'FAN']),
|
|
142
|
-
createdAt: z.string().datetime(),
|
|
143
|
-
updatedAt: z.string().datetime()
|
|
144
|
-
}) satisfies z.ZodType<User>;
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
## Version Management
|
|
148
|
-
|
|
149
|
-
### Semantic Versioning
|
|
150
|
-
- **Major**: Breaking changes to existing types
|
|
151
|
-
- **Minor**: New types or optional properties
|
|
152
|
-
- **Patch**: Documentation updates, fixes
|
|
153
|
-
|
|
154
|
-
### Migration Strategy
|
|
155
|
-
- Deprecation notices for 2 versions before removal
|
|
156
|
-
- Migration guides for breaking changes
|
|
157
|
-
- Backward compatibility helpers when possible
|
|
158
|
-
|
|
159
|
-
## Development
|
|
160
|
-
|
|
161
|
-
### Available Scripts
|
|
162
|
-
|
|
163
|
-
```bash
|
|
164
|
-
# Build the package
|
|
165
|
-
pnpm build
|
|
166
|
-
|
|
167
|
-
# Linting
|
|
168
|
-
pnpm lint # Check for lint errors
|
|
169
|
-
pnpm lint:fix # Fix auto-fixable lint errors
|
|
170
|
-
|
|
171
|
-
# Code formatting
|
|
172
|
-
pnpm format # Format all files
|
|
173
|
-
pnpm format:check # Check formatting without changes
|
|
174
|
-
|
|
175
|
-
# Type checking
|
|
176
|
-
pnpm type:check # Verify TypeScript types
|
|
177
|
-
|
|
178
|
-
# Testing
|
|
179
|
-
pnpm test # Run tests with Vitest
|
|
180
|
-
pnpm coverage # Generate test coverage report
|
|
181
|
-
|
|
182
|
-
# Publishing
|
|
183
|
-
pnpm publish # Publish to npm
|
|
184
|
-
pnpm release:publish # Publish with release process
|
|
185
|
-
pnpm publish:ci # CI-friendly publish (no git checks)
|
|
186
|
-
pnpm release # Create new version with standard-version
|
|
187
|
-
```
|
|
188
|
-
|
|
189
|
-
### Local Development Setup
|
|
190
|
-
```bash
|
|
191
|
-
# Install dependencies
|
|
192
|
-
pnpm install
|
|
193
|
-
|
|
194
|
-
# Run type checking and tests
|
|
195
|
-
pnpm type:check && pnpm test
|
|
196
|
-
|
|
197
|
-
# Build and verify
|
|
198
|
-
pnpm build
|
|
199
|
-
```
|
|
200
|
-
|
|
201
|
-
### Contributing Guidelines
|
|
202
|
-
1. All types must be exported from appropriate index files
|
|
203
|
-
2. Add comprehensive JSDoc documentation
|
|
204
|
-
3. Include unit tests for complex type utilities
|
|
205
|
-
4. Update CHANGELOG.md for all changes
|
|
206
|
-
5. Follow the established naming conventions
|
|
207
|
-
|
|
208
|
-
## Dependencies
|
|
209
|
-
|
|
210
|
-
This package has **zero runtime dependencies** to maintain its position as the foundation layer. Only development dependencies are allowed:
|
|
211
|
-
|
|
212
|
-
- `typescript` - Type definitions and compilation
|
|
213
|
-
- `tsd` - Type testing utilities (dev only)
|
|
214
|
-
|
|
215
|
-
## Support
|
|
216
|
-
|
|
217
|
-
For questions about type definitions or to request new types:
|
|
218
|
-
1. Check existing documentation and examples
|
|
219
|
-
2. Search closed issues for similar requests
|
|
220
|
-
3. Create a new issue with the `types` label
|
|
1
|
+
# @plyaz/types
|
|
2
|
+
|
|
3
|
+
Core TypeScript type definitions for the Plyaz Web3 sports platform. This package serves as the foundation for type safety across all frontend and backend services.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
`@plyaz/types` provides comprehensive TypeScript interfaces, enums, and type definitions for all entities, API contracts, and data structures used throughout the Plyaz ecosystem. This package ensures type consistency across microservices, frontend applications, and shared packages.
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pnpm add @plyaz/types
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Architecture Position
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
@plyaz/types ← Foundation layer (no dependencies)
|
|
19
|
+
↓
|
|
20
|
+
All other packages depend on types
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Core Exports
|
|
24
|
+
|
|
25
|
+
All types can be imported directly from the main package:
|
|
26
|
+
|
|
27
|
+
```typescript
|
|
28
|
+
import type {
|
|
29
|
+
// User & Authentication
|
|
30
|
+
UserRole,
|
|
31
|
+
} from '@plyaz/types';
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Type Categories
|
|
35
|
+
|
|
36
|
+
### Core Entities
|
|
37
|
+
- **User Management**: Authentication, profiles, roles, preferences
|
|
38
|
+
- **Athlete System**: Performance tracking, tokenization, campaigns
|
|
39
|
+
- **Stakeholder Network**: Scouts, agents, clubs, fans relationships
|
|
40
|
+
- **Digital Assets**: NFTs, tokens, collectibles, marketplace items
|
|
41
|
+
|
|
42
|
+
### System Types
|
|
43
|
+
- **API Layer**: Request/response schemas, pagination, filtering
|
|
44
|
+
- **Blockchain**: Transaction types, wallet connections, smart contracts
|
|
45
|
+
- **Events**: Event bus messages, notifications, real-time updates
|
|
46
|
+
- **Configuration**: Environment settings, feature flags, constants
|
|
47
|
+
|
|
48
|
+
### Validation Schemas
|
|
49
|
+
- **Input Validation**: Zod-compatible type definitions
|
|
50
|
+
- **Business Rules**: Constraint types for domain logic
|
|
51
|
+
- **Security**: Permission sets, access control types
|
|
52
|
+
|
|
53
|
+
## Usage Examples
|
|
54
|
+
|
|
55
|
+
### Basic Entity Usage
|
|
56
|
+
```typescript
|
|
57
|
+
import type { Athlete, PerformanceMetrics, SportCategory } from '@plyaz/types';
|
|
58
|
+
|
|
59
|
+
const athlete: Athlete = {
|
|
60
|
+
id: 'athlete_123',
|
|
61
|
+
profile: {
|
|
62
|
+
name: 'John Doe',
|
|
63
|
+
sport: SportCategory.FOOTBALL,
|
|
64
|
+
position: 'Forward'
|
|
65
|
+
},
|
|
66
|
+
tokenAddress: '0x...',
|
|
67
|
+
currentRanking: 45
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const performance: PerformanceMetrics = {
|
|
71
|
+
athleteId: athlete.id,
|
|
72
|
+
period: '2024-Q1',
|
|
73
|
+
goals: 12,
|
|
74
|
+
assists: 8,
|
|
75
|
+
rating: 8.5
|
|
76
|
+
};
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### API Response Typing
|
|
80
|
+
```typescript
|
|
81
|
+
import type { ApiResponse, PaginatedResponse, Athlete } from '@plyaz/types';
|
|
82
|
+
|
|
83
|
+
// Single resource response
|
|
84
|
+
type AthleteResponse = ApiResponse<Athlete>;
|
|
85
|
+
|
|
86
|
+
// Paginated collection response
|
|
87
|
+
type AthletesListResponse = PaginatedResponse<Athlete>;
|
|
88
|
+
|
|
89
|
+
const athletesList: AthletesListResponse = {
|
|
90
|
+
data: [athlete1, athlete2],
|
|
91
|
+
pagination: {
|
|
92
|
+
page: 1,
|
|
93
|
+
limit: 20,
|
|
94
|
+
total: 150,
|
|
95
|
+
hasNext: true
|
|
96
|
+
},
|
|
97
|
+
meta: {
|
|
98
|
+
timestamp: new Date().toISOString(),
|
|
99
|
+
requestId: 'req_123'
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Event System Typing
|
|
105
|
+
```typescript
|
|
106
|
+
import type { EventPayload } from '@plyaz/types';
|
|
107
|
+
|
|
108
|
+
// Type-safe event handling
|
|
109
|
+
const athleteTokenMinted: EventPayload<'ATHLETE_TOKEN_MINTED'> = {
|
|
110
|
+
type: 'ATHLETE_TOKEN_MINTED',
|
|
111
|
+
payload: {
|
|
112
|
+
athleteId: 'athlete_123',
|
|
113
|
+
tokenAddress: '0x...',
|
|
114
|
+
initialSupply: 1000000,
|
|
115
|
+
timestamp: Date.now()
|
|
116
|
+
},
|
|
117
|
+
metadata: {
|
|
118
|
+
source: 'blockchain-service',
|
|
119
|
+
version: '1.0.0'
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## Type Safety Guidelines
|
|
125
|
+
|
|
126
|
+
- [Package](https://plyaz.atlassian.net/wiki/spaces/SD/pages/950359/Types+Package)
|
|
127
|
+
- [Documentation](https://plyaz.atlassian.net/wiki/spaces/SD/pages/22544393/Coding+Standards+Style+Guide)
|
|
128
|
+
|
|
129
|
+
## Validation Integration
|
|
130
|
+
|
|
131
|
+
Types are designed to work seamlessly with validation libraries:
|
|
132
|
+
|
|
133
|
+
```typescript
|
|
134
|
+
import { z } from 'zod';
|
|
135
|
+
import type { User } from '@plyaz/types';
|
|
136
|
+
|
|
137
|
+
// Zod schema matching TypeScript type
|
|
138
|
+
const UserSchema = z.object({
|
|
139
|
+
id: z.string().uuid(),
|
|
140
|
+
email: z.string().email(),
|
|
141
|
+
role: z.enum(['ATHLETE', 'SCOUT', 'AGENT', 'CLUB', 'FAN']),
|
|
142
|
+
createdAt: z.string().datetime(),
|
|
143
|
+
updatedAt: z.string().datetime()
|
|
144
|
+
}) satisfies z.ZodType<User>;
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## Version Management
|
|
148
|
+
|
|
149
|
+
### Semantic Versioning
|
|
150
|
+
- **Major**: Breaking changes to existing types
|
|
151
|
+
- **Minor**: New types or optional properties
|
|
152
|
+
- **Patch**: Documentation updates, fixes
|
|
153
|
+
|
|
154
|
+
### Migration Strategy
|
|
155
|
+
- Deprecation notices for 2 versions before removal
|
|
156
|
+
- Migration guides for breaking changes
|
|
157
|
+
- Backward compatibility helpers when possible
|
|
158
|
+
|
|
159
|
+
## Development
|
|
160
|
+
|
|
161
|
+
### Available Scripts
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
# Build the package
|
|
165
|
+
pnpm build
|
|
166
|
+
|
|
167
|
+
# Linting
|
|
168
|
+
pnpm lint # Check for lint errors
|
|
169
|
+
pnpm lint:fix # Fix auto-fixable lint errors
|
|
170
|
+
|
|
171
|
+
# Code formatting
|
|
172
|
+
pnpm format # Format all files
|
|
173
|
+
pnpm format:check # Check formatting without changes
|
|
174
|
+
|
|
175
|
+
# Type checking
|
|
176
|
+
pnpm type:check # Verify TypeScript types
|
|
177
|
+
|
|
178
|
+
# Testing
|
|
179
|
+
pnpm test # Run tests with Vitest
|
|
180
|
+
pnpm coverage # Generate test coverage report
|
|
181
|
+
|
|
182
|
+
# Publishing
|
|
183
|
+
pnpm publish # Publish to npm
|
|
184
|
+
pnpm release:publish # Publish with release process
|
|
185
|
+
pnpm publish:ci # CI-friendly publish (no git checks)
|
|
186
|
+
pnpm release # Create new version with standard-version
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### Local Development Setup
|
|
190
|
+
```bash
|
|
191
|
+
# Install dependencies
|
|
192
|
+
pnpm install
|
|
193
|
+
|
|
194
|
+
# Run type checking and tests
|
|
195
|
+
pnpm type:check && pnpm test
|
|
196
|
+
|
|
197
|
+
# Build and verify
|
|
198
|
+
pnpm build
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### Contributing Guidelines
|
|
202
|
+
1. All types must be exported from appropriate index files
|
|
203
|
+
2. Add comprehensive JSDoc documentation
|
|
204
|
+
3. Include unit tests for complex type utilities
|
|
205
|
+
4. Update CHANGELOG.md for all changes
|
|
206
|
+
5. Follow the established naming conventions
|
|
207
|
+
|
|
208
|
+
## Dependencies
|
|
209
|
+
|
|
210
|
+
This package has **zero runtime dependencies** to maintain its position as the foundation layer. Only development dependencies are allowed:
|
|
211
|
+
|
|
212
|
+
- `typescript` - Type definitions and compilation
|
|
213
|
+
- `tsd` - Type testing utilities (dev only)
|
|
214
|
+
|
|
215
|
+
## Support
|
|
216
|
+
|
|
217
|
+
For questions about type definitions or to request new types:
|
|
218
|
+
1. Check existing documentation and examples
|
|
219
|
+
2. Search closed issues for similar requests
|
|
220
|
+
3. Create a new issue with the `types` label
|
|
221
221
|
4. Tag the CTO for review
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/auth/enums.ts","../src/errors/enums.ts","../src/events/enums.ts","../src/web3/enums.ts"],"names":[],"mappings":";;;;;AAIO,IAAM,
|
|
1
|
+
{"version":3,"sources":["../src/auth/enums.ts","../src/errors/enums.ts","../src/events/enums.ts","../src/web3/enums.ts"],"names":[],"mappings":";;;;;AAIO,IAAM,SAAA,GAAY;AAAA;AAAA,EAEvB,OAAA,EAAS,SAAA;AAAA;AAAA,EAGT,KAAA,EAAO,OAAA;AAAA;AAAA,EAGP,KAAA,EAAO,OAAA;AAAA;AAAA,EAGP,IAAA,EAAM,MAAA;AAAA;AAAA,EAGN,GAAA,EAAK,KAAA;AAAA;AAAA,EAGL,KAAA,EAAO,OAAA;AAAA;AAAA,EAGP,UAAA,EAAY;AACd;AAMO,IAAM,WAAA,GAAc;AAAA;AAAA,EAEzB,MAAA,EAAQ,QAAA;AAAA;AAAA,EAGR,QAAA,EAAU,UAAA;AAAA;AAAA,EAGV,OAAA,EAAS,SAAA;AAAA;AAAA,EAGT,SAAA,EAAW,WAAA;AAAA;AAAA,EAGX,MAAA,EAAQ;AACV;AAMO,IAAM,aAAA,GAAgB;AAAA;AAAA,EAE3B,KAAA,EAAO,OAAA;AAAA;AAAA,EAGP,MAAA,EAAQ;AACV;;;ACtDO,IAAM,UAAA,GAAa;AAAA;AAAA,EAExB,eAAA,EAAiB,kBAAA;AAAA;AAAA,EAGjB,qBAAA,EAAuB,yBAAA;AAAA;AAAA,EAGvB,aAAA,EAAe,uBAAA;AAAA;AAAA,EAGf,kBAAA,EAAoB,4BAAA;AAAA;AAAA,EAGpB,YAAA,EAAc,gBAAA;AAAA;AAAA,EAGd,iBAAA,EAAmB;AACrB;AAMO,IAAM,cAAA,GAAiB;AAAA;AAAA,EAE5B,GAAA,EAAK,KAAA;AAAA;AAAA,EAGL,MAAA,EAAQ,QAAA;AAAA;AAAA,EAGR,IAAA,EAAM,MAAA;AAAA;AAAA,EAGN,QAAA,EAAU;AACZ;AAMO,IAAM,cAAA,GAAiB;AAAA;AAAA,EAE5B,MAAA,EAAQ,QAAA;AAAA;AAAA,EAGR,MAAA,EAAQ,QAAA;AAAA;AAAA,EAGR,OAAA,EAAS,SAAA;AAAA;AAAA,EAGT,UAAA,EAAY,YAAA;AAAA;AAAA,EAGZ,UAAA,EAAY;AACd;;;AC1DO,IAAM,UAAA,GAAa;AAAA;AAAA,EAExB,OAAA,EAAS;AACX;AAKO,IAAM,cAAA,GAAiB;AAAA;AAAA,EAE5B,GAAA,EAAK,KAAA;AAAA;AAAA,EAEL,MAAA,EAAQ,QAAA;AAAA;AAAA,EAER,IAAA,EAAM,MAAA;AAAA;AAAA,EAEN,QAAA,EAAU;AACZ;AAKO,IAAM,YAAA,GAAe;AAAA;AAAA,EAE1B,OAAA,EAAS,SAAA;AAAA;AAAA,EAET,UAAA,EAAY,YAAA;AAAA;AAAA,EAEZ,SAAA,EAAW,WAAA;AAAA;AAAA,EAEX,MAAA,EAAQ,QAAA;AAAA;AAAA,EAER,QAAA,EAAU;AACZ;;;AC/BO,IAAM,QAAA,GAAW;AAAA;AAAA,EAEtB,eAAA,EAAiB,CAAA;AAAA;AAAA,EAGjB,eAAA,EAAiB,QAAA;AAAA;AAAA,EAGjB,QAAA,EAAU,EAAA;AAAA;AAAA,EAGV,eAAA,EAAiB,QAAA;AAAA;AAAA,EAGjB,QAAA,EAAU,KAAA;AAAA;AAAA,EAGV,eAAA,EAAiB,MAAA;AAAA;AAAA,EAGjB,OAAA,EAAS,GAAA;AAAA;AAAA,EAGT,WAAA,EAAa,KAAA;AAAA;AAAA,EAGb,IAAA,EAAM,IAAA;AAAA;AAAA,EAGN,WAAA,EAAa;AACf","file":"index.cjs","sourcesContent":["/**\n * Enum representing the different roles a user can have within the system.\n * @description Roles are used to determine access levels, permissions, and user-specific experiences.\n */\nexport const USER_ROLE = {\n // A user who is an athlete and participates in sports activities.\n Athlete: 'athlete',\n\n // A user who scouts and discovers talent.\n Scout: 'scout',\n\n // A user who acts as an agent representing athletes or clubs.\n Agent: 'agent',\n\n // A user representing a sports club or organization.\n Club: 'club',\n\n // A fan or supporter of athletes or clubs.\n Fan: 'fan',\n\n // A system administrator with access to management tools.\n Admin: 'admin',\n\n // A super admin with the highest level of access and control.\n SuperAdmin: 'super.admin',\n} as const;\n\n/**\n * Enum representing the current status of a user account.\n * @description Statuses are used to determine login availability, visibility, and user flow.\n */\nexport const USER_STATUS = {\n // Active user with full access.\n Active: 'active',\n\n // Inactive user, typically not currently using the platform.\n Inactive: 'inactive',\n\n // User account is awaiting approval or completion of setup.\n Pending: 'pending',\n\n // User has been temporarily suspended due to policy violations or manual review.\n Suspended: 'suspended',\n\n // User has been permanently banned from the platform.\n Banned: 'banned',\n} as const;\n\n/**\n * Enum representing the supported authentication providers for user login.\n * @description Auth Providers allowed such as Email, Wallet, etc.\n */\nexport const AUTH_PROVIDER = {\n // Authentication via email and password.\n Email: 'email',\n\n // Authentication via connected blockchain wallet.\n Wallet: 'wallet',\n} as const;\n","/**\n * Enum representing standardized error types used across the application.\n * @description These error types help classify different categories of errors such as validation issues and system-level failures.\n */\nexport const ERROR_TYPE = {\n // A general validation error (e.g., form or input errors).\n ValidationError: 'validation.error',\n\n // Error related to schema validation, such as JSON schema or API payload checks.\n SchemaValidationError: 'validation.schema.error',\n\n // Unhandled or unexpected system error.\n InternalError: 'system.internal.error',\n\n // System dependency is currently unavailable (e.g., database or external API).\n ServiceUnavailable: 'system.service.unavailable',\n\n // The request took too long and timed out.\n TimeoutError: 'system.timeout',\n\n // Too many requests made in a short period of time.\n RateLimitExceeded: 'system.rate.limit.exceeded',\n} as const;\n\n/**\n * Enum representing the severity level of an error.\n * @description This allows categorization of errors by their potential impact on the system or user.\n */\nexport const ERROR_SEVERITY = {\n // Low severity - does not impact functionality significantly.\n Low: 'low',\n\n // Medium severity - minor disruption or warning.\n Medium: 'medium',\n\n // High severity - major issue requiring attention.\n High: 'high',\n\n // Critical severity - blocking or crashing issue.\n Critical: 'critical',\n} as const;\n\n/**\n * Enum representing the category or origin of an error.\n * @description Useful for filtering or logging errors based on their source or nature.\n */\nexport const ERROR_CATEGORY = {\n // Client-side error (e.g., invalid request).\n Client: 'client',\n\n // Server-side error (e.g., logic failure or exception).\n Server: 'server',\n\n // Network-related error (e.g., unreachable endpoint).\n Network: 'network',\n\n // Blockchain-related error (e.g., transaction failure, gas limit).\n Blockchain: 'blockchain',\n\n // Validation-specific error (e.g., failed constraints or field errors).\n Validation: 'validation',\n} as const;\n","/**\n * Enum representing the types of events in the application.\n */\nexport const EVENT_TYPE = {\n // Application initialization event.\n AppInit: 'app.init',\n} as const;\n\n/**\n * Const representing the priority levels for events.\n */\nexport const EVENT_PRIORITY = {\n // Low priority event.\n Low: 'low',\n // Normal priority event.\n Normal: 'normal',\n // High priority event.\n High: 'high',\n // Critical priority event.\n Critical: 'critical',\n} as const;\n\n/**\n * Const representing the status of an event.\n */\nexport const EVENT_STATUS = {\n // Event is pending and has not started processing.\n Pending: 'pending',\n // Event is currently being processed.\n Processing: 'processing',\n // Event has been completed successfully.\n Completed: 'completed',\n // Event processing failed.\n Failed: 'failed',\n // Event is being retried after a failure.\n Retrying: 'retrying',\n} as const;\n","/**\n * Enum representing supported EVM-compatible blockchain networks by their numeric chain IDs.\n * @description These IDs are used to identify the specific network when interacting with wallets or smart contracts.\n * @see https://chainlist.org for reference chain IDs\n */\nexport const CHAIN_ID = {\n // Ethereum Mainnet (Chain ID: 1).\n EthereumMainnet: 1,\n\n // Ethereum Sepolia Testnet (Chain ID: 11155111).\n EthereumSepolia: 11_155_111,\n\n // Optimism Mainnet (Chain ID: 10).\n Optimism: 10,\n\n // Optimism Sepolia Testnet (Chain ID: 11155420).\n OptimismSepolia: 11_155_420,\n\n // Arbitrum One Mainnet (Chain ID: 42161).\n Arbitrum: 42_161,\n\n // Arbitrum Sepolia Testnet (Chain ID: 421614).\n ArbitrumSepolia: 421_614,\n\n // Polygon Mainnet (Chain ID: 137).\n Polygon: 137,\n\n // Polygon Amoy Testnet (Chain ID: 80002).\n PolygonAmoy: 80_002,\n\n // Base Mainnet (Chain ID: 8453).\n Base: 8_453,\n\n // Base Sepolia Testnet (Chain ID: 84532).\n BaseSepolia: 84_532,\n} as const;\n"]}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/auth/enums.ts","../src/errors/enums.ts","../src/events/enums.ts","../src/web3/enums.ts"],"names":[],"mappings":";;;AAIO,IAAM,
|
|
1
|
+
{"version":3,"sources":["../src/auth/enums.ts","../src/errors/enums.ts","../src/events/enums.ts","../src/web3/enums.ts"],"names":[],"mappings":";;;AAIO,IAAM,SAAA,GAAY;AAAA;AAAA,EAEvB,OAAA,EAAS,SAAA;AAAA;AAAA,EAGT,KAAA,EAAO,OAAA;AAAA;AAAA,EAGP,KAAA,EAAO,OAAA;AAAA;AAAA,EAGP,IAAA,EAAM,MAAA;AAAA;AAAA,EAGN,GAAA,EAAK,KAAA;AAAA;AAAA,EAGL,KAAA,EAAO,OAAA;AAAA;AAAA,EAGP,UAAA,EAAY;AACd;AAMO,IAAM,WAAA,GAAc;AAAA;AAAA,EAEzB,MAAA,EAAQ,QAAA;AAAA;AAAA,EAGR,QAAA,EAAU,UAAA;AAAA;AAAA,EAGV,OAAA,EAAS,SAAA;AAAA;AAAA,EAGT,SAAA,EAAW,WAAA;AAAA;AAAA,EAGX,MAAA,EAAQ;AACV;AAMO,IAAM,aAAA,GAAgB;AAAA;AAAA,EAE3B,KAAA,EAAO,OAAA;AAAA;AAAA,EAGP,MAAA,EAAQ;AACV;;;ACtDO,IAAM,UAAA,GAAa;AAAA;AAAA,EAExB,eAAA,EAAiB,kBAAA;AAAA;AAAA,EAGjB,qBAAA,EAAuB,yBAAA;AAAA;AAAA,EAGvB,aAAA,EAAe,uBAAA;AAAA;AAAA,EAGf,kBAAA,EAAoB,4BAAA;AAAA;AAAA,EAGpB,YAAA,EAAc,gBAAA;AAAA;AAAA,EAGd,iBAAA,EAAmB;AACrB;AAMO,IAAM,cAAA,GAAiB;AAAA;AAAA,EAE5B,GAAA,EAAK,KAAA;AAAA;AAAA,EAGL,MAAA,EAAQ,QAAA;AAAA;AAAA,EAGR,IAAA,EAAM,MAAA;AAAA;AAAA,EAGN,QAAA,EAAU;AACZ;AAMO,IAAM,cAAA,GAAiB;AAAA;AAAA,EAE5B,MAAA,EAAQ,QAAA;AAAA;AAAA,EAGR,MAAA,EAAQ,QAAA;AAAA;AAAA,EAGR,OAAA,EAAS,SAAA;AAAA;AAAA,EAGT,UAAA,EAAY,YAAA;AAAA;AAAA,EAGZ,UAAA,EAAY;AACd;;;AC1DO,IAAM,UAAA,GAAa;AAAA;AAAA,EAExB,OAAA,EAAS;AACX;AAKO,IAAM,cAAA,GAAiB;AAAA;AAAA,EAE5B,GAAA,EAAK,KAAA;AAAA;AAAA,EAEL,MAAA,EAAQ,QAAA;AAAA;AAAA,EAER,IAAA,EAAM,MAAA;AAAA;AAAA,EAEN,QAAA,EAAU;AACZ;AAKO,IAAM,YAAA,GAAe;AAAA;AAAA,EAE1B,OAAA,EAAS,SAAA;AAAA;AAAA,EAET,UAAA,EAAY,YAAA;AAAA;AAAA,EAEZ,SAAA,EAAW,WAAA;AAAA;AAAA,EAEX,MAAA,EAAQ,QAAA;AAAA;AAAA,EAER,QAAA,EAAU;AACZ;;;AC/BO,IAAM,QAAA,GAAW;AAAA;AAAA,EAEtB,eAAA,EAAiB,CAAA;AAAA;AAAA,EAGjB,eAAA,EAAiB,QAAA;AAAA;AAAA,EAGjB,QAAA,EAAU,EAAA;AAAA;AAAA,EAGV,eAAA,EAAiB,QAAA;AAAA;AAAA,EAGjB,QAAA,EAAU,KAAA;AAAA;AAAA,EAGV,eAAA,EAAiB,MAAA;AAAA;AAAA,EAGjB,OAAA,EAAS,GAAA;AAAA;AAAA,EAGT,WAAA,EAAa,KAAA;AAAA;AAAA,EAGb,IAAA,EAAM,IAAA;AAAA;AAAA,EAGN,WAAA,EAAa;AACf","file":"index.js","sourcesContent":["/**\n * Enum representing the different roles a user can have within the system.\n * @description Roles are used to determine access levels, permissions, and user-specific experiences.\n */\nexport const USER_ROLE = {\n // A user who is an athlete and participates in sports activities.\n Athlete: 'athlete',\n\n // A user who scouts and discovers talent.\n Scout: 'scout',\n\n // A user who acts as an agent representing athletes or clubs.\n Agent: 'agent',\n\n // A user representing a sports club or organization.\n Club: 'club',\n\n // A fan or supporter of athletes or clubs.\n Fan: 'fan',\n\n // A system administrator with access to management tools.\n Admin: 'admin',\n\n // A super admin with the highest level of access and control.\n SuperAdmin: 'super.admin',\n} as const;\n\n/**\n * Enum representing the current status of a user account.\n * @description Statuses are used to determine login availability, visibility, and user flow.\n */\nexport const USER_STATUS = {\n // Active user with full access.\n Active: 'active',\n\n // Inactive user, typically not currently using the platform.\n Inactive: 'inactive',\n\n // User account is awaiting approval or completion of setup.\n Pending: 'pending',\n\n // User has been temporarily suspended due to policy violations or manual review.\n Suspended: 'suspended',\n\n // User has been permanently banned from the platform.\n Banned: 'banned',\n} as const;\n\n/**\n * Enum representing the supported authentication providers for user login.\n * @description Auth Providers allowed such as Email, Wallet, etc.\n */\nexport const AUTH_PROVIDER = {\n // Authentication via email and password.\n Email: 'email',\n\n // Authentication via connected blockchain wallet.\n Wallet: 'wallet',\n} as const;\n","/**\n * Enum representing standardized error types used across the application.\n * @description These error types help classify different categories of errors such as validation issues and system-level failures.\n */\nexport const ERROR_TYPE = {\n // A general validation error (e.g., form or input errors).\n ValidationError: 'validation.error',\n\n // Error related to schema validation, such as JSON schema or API payload checks.\n SchemaValidationError: 'validation.schema.error',\n\n // Unhandled or unexpected system error.\n InternalError: 'system.internal.error',\n\n // System dependency is currently unavailable (e.g., database or external API).\n ServiceUnavailable: 'system.service.unavailable',\n\n // The request took too long and timed out.\n TimeoutError: 'system.timeout',\n\n // Too many requests made in a short period of time.\n RateLimitExceeded: 'system.rate.limit.exceeded',\n} as const;\n\n/**\n * Enum representing the severity level of an error.\n * @description This allows categorization of errors by their potential impact on the system or user.\n */\nexport const ERROR_SEVERITY = {\n // Low severity - does not impact functionality significantly.\n Low: 'low',\n\n // Medium severity - minor disruption or warning.\n Medium: 'medium',\n\n // High severity - major issue requiring attention.\n High: 'high',\n\n // Critical severity - blocking or crashing issue.\n Critical: 'critical',\n} as const;\n\n/**\n * Enum representing the category or origin of an error.\n * @description Useful for filtering or logging errors based on their source or nature.\n */\nexport const ERROR_CATEGORY = {\n // Client-side error (e.g., invalid request).\n Client: 'client',\n\n // Server-side error (e.g., logic failure or exception).\n Server: 'server',\n\n // Network-related error (e.g., unreachable endpoint).\n Network: 'network',\n\n // Blockchain-related error (e.g., transaction failure, gas limit).\n Blockchain: 'blockchain',\n\n // Validation-specific error (e.g., failed constraints or field errors).\n Validation: 'validation',\n} as const;\n","/**\n * Enum representing the types of events in the application.\n */\nexport const EVENT_TYPE = {\n // Application initialization event.\n AppInit: 'app.init',\n} as const;\n\n/**\n * Const representing the priority levels for events.\n */\nexport const EVENT_PRIORITY = {\n // Low priority event.\n Low: 'low',\n // Normal priority event.\n Normal: 'normal',\n // High priority event.\n High: 'high',\n // Critical priority event.\n Critical: 'critical',\n} as const;\n\n/**\n * Const representing the status of an event.\n */\nexport const EVENT_STATUS = {\n // Event is pending and has not started processing.\n Pending: 'pending',\n // Event is currently being processed.\n Processing: 'processing',\n // Event has been completed successfully.\n Completed: 'completed',\n // Event processing failed.\n Failed: 'failed',\n // Event is being retried after a failure.\n Retrying: 'retrying',\n} as const;\n","/**\n * Enum representing supported EVM-compatible blockchain networks by their numeric chain IDs.\n * @description These IDs are used to identify the specific network when interacting with wallets or smart contracts.\n * @see https://chainlist.org for reference chain IDs\n */\nexport const CHAIN_ID = {\n // Ethereum Mainnet (Chain ID: 1).\n EthereumMainnet: 1,\n\n // Ethereum Sepolia Testnet (Chain ID: 11155111).\n EthereumSepolia: 11_155_111,\n\n // Optimism Mainnet (Chain ID: 10).\n Optimism: 10,\n\n // Optimism Sepolia Testnet (Chain ID: 11155420).\n OptimismSepolia: 11_155_420,\n\n // Arbitrum One Mainnet (Chain ID: 42161).\n Arbitrum: 42_161,\n\n // Arbitrum Sepolia Testnet (Chain ID: 421614).\n ArbitrumSepolia: 421_614,\n\n // Polygon Mainnet (Chain ID: 137).\n Polygon: 137,\n\n // Polygon Amoy Testnet (Chain ID: 80002).\n PolygonAmoy: 80_002,\n\n // Base Mainnet (Chain ID: 8453).\n Base: 8_453,\n\n // Base Sepolia Testnet (Chain ID: 84532).\n BaseSepolia: 84_532,\n} as const;\n"]}
|