@sudobility/types 1.9.50 → 1.9.52
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/CLAUDE.md +244 -260
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/types/consumables/index.cjs +8 -0
- package/dist/types/consumables/index.d.ts +48 -0
- package/dist/types/consumables/index.d.ts.map +1 -0
- package/dist/types/consumables/index.js +8 -0
- package/dist/types/consumables/index.js.map +1 -0
- package/package.json +1 -1
package/CLAUDE.md
CHANGED
|
@@ -1,310 +1,294 @@
|
|
|
1
|
-
#
|
|
1
|
+
# types - AI Development Guide
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Overview
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
`@sudobility/types` is a comprehensive, zero-runtime-dependency TypeScript types and utilities library for Web3 email applications. It provides shared type definitions, interfaces, enums, validators, formatters, and pure utility functions used across multiple packages in the 0xmail platform. The library outputs both ESM and CommonJS builds for maximum compatibility.
|
|
6
6
|
|
|
7
|
-
**Package**: `@sudobility/types`
|
|
8
|
-
**Version**: 1.9.
|
|
9
|
-
**
|
|
10
|
-
**
|
|
11
|
-
|
|
12
|
-
A comprehensive TypeScript types library for Web3 email applications. It provides shared type definitions, interfaces, enums, and utility functions used across multiple Web3 email platform projects.
|
|
13
|
-
|
|
14
|
-
## Key Architecture
|
|
15
|
-
|
|
16
|
-
- **Framework Agnostic**: Pure TypeScript with zero external runtime dependencies
|
|
17
|
-
- **Tree Shakeable**: Optimized for modern bundlers with barrel exports
|
|
18
|
-
- **Dual Module Support**: ESM + CommonJS builds for maximum compatibility
|
|
19
|
-
- **AI-Optimized**: Enhanced documentation and patterns for AI-assisted development
|
|
20
|
-
- **Type-Safe**: Strict TypeScript configuration with comprehensive coverage
|
|
21
|
-
- **Modular Structure**: Domain-organized architecture (business, blockchain, infrastructure, etc.)
|
|
7
|
+
- **Package**: `@sudobility/types`
|
|
8
|
+
- **Version**: 1.9.51
|
|
9
|
+
- **License**: BUSL-1.1
|
|
10
|
+
- **Package Manager**: Bun
|
|
22
11
|
|
|
23
12
|
## Project Structure
|
|
24
13
|
|
|
25
14
|
```
|
|
26
15
|
src/
|
|
27
|
-
├──
|
|
28
|
-
|
|
29
|
-
│
|
|
30
|
-
│
|
|
31
|
-
│ │
|
|
32
|
-
│
|
|
33
|
-
│
|
|
34
|
-
│ │ ├──
|
|
35
|
-
│ │ └── validation.ts
|
|
36
|
-
│ ├──
|
|
37
|
-
│ │ ├──
|
|
38
|
-
│ │
|
|
39
|
-
│
|
|
40
|
-
│ │ └──
|
|
41
|
-
│ ├──
|
|
42
|
-
│ ├──
|
|
43
|
-
│
|
|
44
|
-
│
|
|
45
|
-
│
|
|
46
|
-
│
|
|
47
|
-
│
|
|
48
|
-
├──
|
|
49
|
-
│ ├──
|
|
50
|
-
│ ├──
|
|
51
|
-
│ │ ├──
|
|
52
|
-
│ │
|
|
53
|
-
│
|
|
54
|
-
│
|
|
55
|
-
|
|
56
|
-
│ ├──
|
|
57
|
-
│ ├──
|
|
58
|
-
│ ├──
|
|
59
|
-
│ └──
|
|
60
|
-
│
|
|
61
|
-
│
|
|
62
|
-
|
|
63
|
-
|
|
16
|
+
├── index.ts # Main barrel export file (all public API)
|
|
17
|
+
├── types/
|
|
18
|
+
│ ├── common.ts # Core utility types: Optional<T>, Result<T>, ValidationResult<T>, BaseResponse<T>, PaginatedResponse<T>
|
|
19
|
+
│ ├── business/
|
|
20
|
+
│ │ ├── enums.ts # All business enums: AuthStatus, Chain, ChainType, ConnectionState, Theme, EmailAction, etc.
|
|
21
|
+
│ │ └── wallet-status.ts # WalletStatus interface + type guards (isWalletConnected, isWalletVerified)
|
|
22
|
+
│ ├── blockchain/
|
|
23
|
+
│ │ ├── common.ts # Multi-chain messaging: Message, PreparedMessage, MessageType, TransactionStatus, FeeStructure, PROTOCOL_CONSTANTS, type guards
|
|
24
|
+
│ │ └── validation.ts # Blockchain validators: validateAddress, validateAmount, validateDomain, validateMessage
|
|
25
|
+
│ ├── config/
|
|
26
|
+
│ │ ├── app-config.ts # AppConfig, FirebaseConfig interfaces
|
|
27
|
+
│ │ └── environment.ts # EnvProvider, EnvironmentVariables, StorageType enum
|
|
28
|
+
│ ├── consumables/
|
|
29
|
+
│ │ └── index.ts # Consumable credits: purchase/use request/response types
|
|
30
|
+
│ ├── entity/
|
|
31
|
+
│ │ ├── entity.ts # Entity/organization system: Entity, EntityType, EntityRole, InvitationStatus enums
|
|
32
|
+
│ │ ├── permissions.ts # Role-based access control: EntityPermissions, OWNER/MANAGER/MEMBER_PERMISSIONS, hasPermission()
|
|
33
|
+
│ │ ├── requests.ts # API request types: CreateEntityRequest, InviteMemberRequest, etc.
|
|
34
|
+
│ │ └── responses.ts # API response types: EntityResponse, SlugAvailabilityResponse, etc.
|
|
35
|
+
│ ├── infrastructure/
|
|
36
|
+
│ │ ├── analytics.ts # AnalyticsService interface, AnalyticsEvent enum, AnalyticsEventBuilder class
|
|
37
|
+
│ │ ├── api.ts # Database entities: MailEntity, DelegationEntity, StatisticsEntity, ContractType, ProcessedEventName enums
|
|
38
|
+
│ │ ├── firebase-user.ts # UserInfoResponse interface
|
|
39
|
+
│ │ ├── navigation.ts # Cross-platform navigation: UINavigationService, UINavigationHook, UILocationHook
|
|
40
|
+
│ │ ├── network.ts # HTTP client abstraction: NetworkClient, NetworkError, NetworkResponse
|
|
41
|
+
│ │ └── wallet.ts # WalletType enum (MetaMask, Phantom, Coinbase, WalletConnect, Injected)
|
|
42
|
+
│ └── subscription/
|
|
43
|
+
│ └── rate-limits.ts # Rate limiting: RateLimits, RateLimitTier, RateLimitPeriodType, history types
|
|
44
|
+
├── utils/
|
|
45
|
+
│ ├── async-helpers.ts # safeAsync, withLoadingState, safeParallel, withTimeout, withCache, debounceAsync
|
|
46
|
+
│ ├── auth/
|
|
47
|
+
│ │ ├── auth.ts # generateAuthMessage, isAuthExpired, generateNonce, isValidNonce
|
|
48
|
+
│ │ └── admin-emails.ts # parseAdminEmails, isAdminEmail, createAdminChecker
|
|
49
|
+
│ ├── blockchain/
|
|
50
|
+
│ │ ├── address.ts # Address utilities: AddressType enum, isENSName, isSNSName, formatWalletAddress, parseEmailAddress
|
|
51
|
+
│ │ └── event-helpers.ts # Multi-chain ID generation: createMultiChainId, normalizeAddress, formatBigInt, isTestNet
|
|
52
|
+
│ ├── constants/
|
|
53
|
+
│ │ ├── application.ts # App-wide constants: API_TIMEOUT, STORAGE_KEYS, ERROR_MESSAGES, ROUTES, NETWORK_IDS, Z_INDEX, etc.
|
|
54
|
+
│ │ └── status-values.ts # STATUS_VALUES constant object (success, pending, failed, error)
|
|
55
|
+
│ ├── formatting/
|
|
56
|
+
│ │ ├── currency.ts # formatUSDC, parseUSDC, USDC_DECIMALS, CLAIM_PERIOD_DAYS
|
|
57
|
+
│ │ ├── date.ts # formatEmailDate, formatRelativeTime, parseDate, addDays, addHours
|
|
58
|
+
│ │ └── string.ts # truncate, capitalize, toTitleCase, toKebabCase, toCamelCase, escapeHtml, formatBytes, pluralize, etc.
|
|
59
|
+
│ ├── logging/
|
|
60
|
+
│ │ └── logger.ts # Logger class with contextual loggers: logger, authLogger, apiLogger, contractLogger, ensLogger
|
|
61
|
+
│ ├── url/
|
|
62
|
+
│ │ └── url-params.ts # Cross-platform URLSearchParams: createURLSearchParams, createSearchParams, parseSearchParams
|
|
63
|
+
│ └── validation/
|
|
64
|
+
│ ├── type-validation.ts # Runtime type checkers: isString, isNumber, isObject, isEmail, isUrl, createValidator, createAssertion, parseJson
|
|
65
|
+
│ └── web3-username-validator.ts # Web3UsernameValidator class: validate EVM, Solana, ENS, SNS addresses
|
|
64
66
|
```
|
|
65
67
|
|
|
66
|
-
##
|
|
67
|
-
|
|
68
|
-
|
|
68
|
+
## Key Exports
|
|
69
|
+
|
|
70
|
+
### Core Utility Types (`types/common.ts`)
|
|
71
|
+
|
|
72
|
+
| Type | Description |
|
|
73
|
+
|------|-------------|
|
|
74
|
+
| `Optional<T>` | `T \| undefined \| null` -- use instead of manual nullable unions |
|
|
75
|
+
| `Result<T, E>` | Discriminated union: `{ success: true; data: T } \| { success: false; error: E }` |
|
|
76
|
+
| `ValidationResult<T>` | `{ isValid: true; data: T } \| { isValid: false; error: string }` |
|
|
77
|
+
| `BaseResponse<T>` | `{ success, data?, error?, timestamp }` -- base for all API responses |
|
|
78
|
+
| `PaginatedResponse<T>` | Extends BaseResponse with `pagination: PaginationInfo` |
|
|
79
|
+
| `UnifiedError` | Typed error with `type`, `message`, `details`, `suggestedAction` |
|
|
80
|
+
|
|
81
|
+
### Enums (`types/business/enums.ts` and others)
|
|
82
|
+
|
|
83
|
+
| Enum | Values | Source |
|
|
84
|
+
|------|--------|--------|
|
|
85
|
+
| `AuthStatus` | CONNECTED, DISCONNECTED, VERIFIED | business/enums |
|
|
86
|
+
| `Chain` | ETH_MAINNET, POLYGON_MAINNET, BASE_MAINNET, SOLANA_MAINNET, ... (60+ chains) | business/enums |
|
|
87
|
+
| `ChainType` | EVM, SOLANA | business/enums |
|
|
88
|
+
| `ConnectionState` | UNKNOWN, DISCONNECTED, CONNECTING, CONNECTED, RECONNECTING, VERIFIED, LIMITED, ERROR | business/enums |
|
|
89
|
+
| `Theme` | LIGHT, DARK, SYSTEM | business/enums |
|
|
90
|
+
| `EmailAction` | OPEN, REPLY, FORWARD, DELETE, STAR, UNSTAR, MARK_READ, MARK_UNREAD | business/enums |
|
|
91
|
+
| `RequestStatus` | IDLE, LOADING, SUCCESS, ERROR | business/enums |
|
|
92
|
+
| `MessageType` | STANDARD, PRIORITY, PREPARED_STANDARD, PREPARED_PRIORITY | blockchain/common |
|
|
93
|
+
| `TransactionStatus` | SUCCESS, FAILED, PENDING | blockchain/common |
|
|
94
|
+
| `EntityType` | PERSONAL, ORGANIZATION | entity/entity |
|
|
95
|
+
| `EntityRole` | OWNER, MANAGER, MEMBER | entity/entity |
|
|
96
|
+
| `WalletType` | METAMASK, PHANTOM, COINBASE, WALLETCONNECT, INJECTED | infrastructure/wallet |
|
|
97
|
+
| `ContractType` | Mailer, MailService | infrastructure/api |
|
|
98
|
+
| `ProcessedEventName` | MailSent, PreparedMailSent, DelegationSet, ... (12 events) | infrastructure/api |
|
|
99
|
+
| `AnalyticsEvent` | USER_LOGIN, EMAIL_SENT, PAGE_VIEW, ... (20+ events) | infrastructure/analytics |
|
|
100
|
+
| `AddressType` | EVMAddress, SolanaAddress, ENSName, SNSName | utils/blockchain/address |
|
|
101
|
+
| `StorageType` | LOCAL_STORAGE, SESSION_STORAGE, ASYNC_STORAGE, MEMORY | config/environment |
|
|
102
|
+
| `RateLimitPeriodType` | HOUR, DAY, MONTH | subscription/rate-limits |
|
|
103
|
+
|
|
104
|
+
### Validators
|
|
105
|
+
|
|
106
|
+
| Function | Location | Purpose |
|
|
107
|
+
|----------|----------|---------|
|
|
108
|
+
| `isEvmAddress(addr)` | blockchain/common | Regex check for `0x` + 40 hex chars |
|
|
109
|
+
| `isSolanaAddress(addr)` | blockchain/common | Base58 + length 32-44 check |
|
|
110
|
+
| `isENSName(addr)` | utils/blockchain/address | `.eth` or `.box` name validation |
|
|
111
|
+
| `isSNSName(addr)` | utils/blockchain/address | Solana name service (`.sol`, `.bonk`, etc.) |
|
|
112
|
+
| `isValidWalletAddress(addr, chainType)` | utils/blockchain/address | Chain-aware address validation |
|
|
113
|
+
| `Web3UsernameValidator.validate(addr)` | utils/validation | Comprehensive address detection returning `AddressValidationResult` |
|
|
114
|
+
| `validateAddress(addr, chainType)` | blockchain/validation | Throws on invalid address |
|
|
115
|
+
| `validateAmount(amount)` | blockchain/validation | Validates and converts to bigint |
|
|
116
|
+
| `validateDomain(domain)` | blockchain/validation | Domain format validation |
|
|
117
|
+
| `validateMessage(subject, body)` | blockchain/validation | Subject/body length validation |
|
|
118
|
+
| `isString`, `isNumber`, `isObject`, `isArray`, `isBoolean`, `isNullish` | utils/validation/type-validation | Runtime type guards |
|
|
119
|
+
| `isEmail`, `isUrl`, `isValidDate` | utils/validation/type-validation | Pattern validators |
|
|
120
|
+
| `isApiResponse`, `isSuccessResponse`, `isErrorResponse` | utils/validation/type-validation | API response guards |
|
|
121
|
+
| `createValidator(fn, name)` | utils/validation/type-validation | Factory for creating `ValidationResult`-returning validators |
|
|
122
|
+
| `createAssertion(fn, name)` | utils/validation/type-validation | Factory for creating assertion functions |
|
|
123
|
+
| `parseJson(str, validator?)` | utils/validation/type-validation | Safe JSON parse returning `ValidationResult` |
|
|
124
|
+
|
|
125
|
+
### Formatters
|
|
126
|
+
|
|
127
|
+
| Function | Location | Purpose |
|
|
128
|
+
|----------|----------|---------|
|
|
129
|
+
| `formatWalletAddress(addr)` | utils/blockchain/address | Truncates to `0x1234...5678` |
|
|
130
|
+
| `formatUSDC(amount)` | utils/formatting/currency | Converts smallest units to `"1.00"` display |
|
|
131
|
+
| `parseUSDC(str)` | utils/formatting/currency | Converts `"1.00"` to smallest units |
|
|
132
|
+
| `formatEmailDate(date)` | utils/formatting/date | Smart relative date (Today: time, Yesterday, day name, etc.) |
|
|
133
|
+
| `formatRelativeTime(date)` | utils/formatting/date | `"2 hours ago"`, `"3 days ago"` |
|
|
134
|
+
| `formatTimestamp(ts)` | utils/formatting/date | Timestamp to ISO string |
|
|
135
|
+
| `formatBigInt(value, decimals)` | utils/blockchain/event-helpers | BigInt to decimal string |
|
|
136
|
+
| `formatBytes(bytes)` | utils/formatting/string | `"1.5 MB"` display |
|
|
137
|
+
| `formatNumber(num)` | utils/formatting/string | Thousands separator formatting |
|
|
138
|
+
| `truncate`, `capitalize`, `toTitleCase`, `toKebabCase`, `toCamelCase`, `toSnakeCase` | utils/formatting/string | String transformations |
|
|
139
|
+
| `escapeHtml`, `stripHtml` | utils/formatting/string | HTML sanitization |
|
|
140
|
+
| `pluralize(count, singular, plural?)` | utils/formatting/string | Word pluralization |
|
|
141
|
+
|
|
142
|
+
### Async Helpers (`utils/async-helpers.ts`)
|
|
143
|
+
|
|
144
|
+
| Function | Purpose |
|
|
145
|
+
|----------|---------|
|
|
146
|
+
| `safeAsync(operation, context?)` | Returns `AsyncResult<T>` instead of throwing |
|
|
147
|
+
| `withLoadingState(op, setLoading, setError)` | Manages loading/error state for UI |
|
|
148
|
+
| `safeParallel(operations, context?)` | Parallel execution with error handling |
|
|
149
|
+
| `withTimeout(op, timeoutMs)` | Adds timeout to any async operation |
|
|
150
|
+
| `withCache(key, op, ttlMs?)` | In-memory cache with TTL (default 5 min) |
|
|
151
|
+
| `debounceAsync(fn, delay, key)` | Debounces async function calls |
|
|
152
|
+
|
|
153
|
+
## Development Commands
|
|
69
154
|
|
|
70
155
|
```bash
|
|
71
156
|
# Install dependencies
|
|
72
157
|
bun install
|
|
73
158
|
|
|
74
|
-
#
|
|
75
|
-
bun run <script-name>
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
## Essential Commands
|
|
79
|
-
|
|
80
|
-
### Development Commands
|
|
81
|
-
```bash
|
|
82
|
-
# Build the project (dual ESM/CJS output)
|
|
159
|
+
# Build (dual ESM + CJS output)
|
|
83
160
|
bun run build
|
|
84
161
|
|
|
85
|
-
# Watch mode
|
|
162
|
+
# Watch mode development
|
|
86
163
|
bun run dev
|
|
87
164
|
|
|
88
|
-
# Run
|
|
165
|
+
# Run tests (Vitest)
|
|
89
166
|
bun test
|
|
90
167
|
|
|
91
|
-
# Type checking
|
|
168
|
+
# Type checking only
|
|
92
169
|
bun run typecheck
|
|
93
170
|
|
|
94
|
-
#
|
|
171
|
+
# Lint (ESLint v9 flat config)
|
|
95
172
|
bun run lint
|
|
96
|
-
|
|
97
|
-
# Fix linting issues
|
|
98
173
|
bun run lint:fix
|
|
99
174
|
|
|
100
|
-
# Format
|
|
175
|
+
# Format (Prettier)
|
|
101
176
|
bun run format
|
|
102
|
-
|
|
103
|
-
# Check formatting
|
|
104
177
|
bun run format:check
|
|
105
178
|
|
|
106
179
|
# Clean build artifacts
|
|
107
180
|
bun run clean
|
|
108
181
|
|
|
109
|
-
# Full verification (
|
|
182
|
+
# Full verification pipeline (typecheck + lint + test + build)
|
|
110
183
|
bun run verify
|
|
111
|
-
|
|
112
|
-
# AI development tools
|
|
113
|
-
bun run ai:analyze # Analyze type structure
|
|
114
|
-
bun run ai:validate # Validate exports
|
|
115
|
-
bun run ai:docs # Generate AI documentation
|
|
116
184
|
```
|
|
117
185
|
|
|
118
|
-
##
|
|
119
|
-
|
|
120
|
-
- **Framework**: Vitest for fast unit testing
|
|
121
|
-
- **Coverage**: 107 comprehensive tests covering all utilities and type guards
|
|
122
|
-
- **Structure**: Tests mirror source structure in `test/` directory
|
|
123
|
-
- **Focus**: Type guards, validation functions, utility functions, and API contracts
|
|
124
|
-
|
|
125
|
-
## Code Style and Standards
|
|
126
|
-
|
|
127
|
-
- **TypeScript**: Strict mode with `noUncheckedIndexedAccess` and `exactOptionalPropertyTypes`
|
|
128
|
-
- **ESLint**: Flat config format (ESLint v9+) with TypeScript rules
|
|
129
|
-
- **Prettier**: Code formatting with consistent style
|
|
130
|
-
- **Naming**: PascalCase for types/interfaces, camelCase for functions
|
|
131
|
-
- **Exports**: Barrel exports from index.ts files for tree-shaking
|
|
132
|
-
|
|
133
|
-
## Domain Knowledge
|
|
134
|
-
|
|
135
|
-
### Web3 Email Platform Context
|
|
136
|
-
- **Web3-native email platform**: Blockchain-based messaging system
|
|
137
|
-
- **Multi-chain support**: Ethereum, Polygon, Arbitrum, Optimism, Base, Solana
|
|
138
|
-
- **Wallet-centric**: User management tied to crypto wallet addresses
|
|
139
|
-
- **WildDuck integration**: Email server backend integration
|
|
140
|
-
- **Decentralized identity**: ENS and SNS name support
|
|
141
|
-
|
|
142
|
-
### Key Types to Know
|
|
143
|
-
|
|
144
|
-
#### Core Business Types
|
|
145
|
-
- `Email`: Core email message interface with Web3 extensions
|
|
146
|
-
- `User`/`WalletUserData`: User account types with wallet integration
|
|
147
|
-
- `MailBox`, `Folder`: Email organization structures
|
|
148
|
-
- `AuthStatus`, `ConnectionState`: Authentication and connection states
|
|
149
|
-
|
|
150
|
-
#### Blockchain Types
|
|
151
|
-
- `Message`/`PreparedMessage`: Multi-chain messaging interfaces
|
|
152
|
-
- `MessageRecipient`: Universal address type (EVM/Solana)
|
|
153
|
-
- `TransactionResult`, `TransactionStatus`: Transaction handling
|
|
154
|
-
- `NetworkConfig`, `DeploymentAddresses`: Network configuration
|
|
155
|
-
|
|
156
|
-
#### Utility Types
|
|
157
|
-
- `Optional<T>`: Null/undefined safe typing (`T | undefined | null`)
|
|
158
|
-
- `Result<T, E>`: Error handling pattern for operations
|
|
159
|
-
- `ValidationResult<T>`: Validation result pattern
|
|
160
|
-
- `PaginatedResponse<T>`: API pagination wrapper
|
|
161
|
-
|
|
162
|
-
#### Infrastructure Types
|
|
163
|
-
- `ApiResponse<T>`: Unified API response structure
|
|
164
|
-
- `AnalyticsService`: Analytics abstraction interface
|
|
165
|
-
- `NetworkClient`: HTTP client abstraction
|
|
166
|
-
- `UINavigationService`: Navigation abstraction
|
|
167
|
-
|
|
168
|
-
## Development Guidelines
|
|
169
|
-
|
|
170
|
-
### Adding New Types
|
|
171
|
-
1. Place in appropriate domain directory under `src/types/`
|
|
172
|
-
2. Export from domain's `index.ts`
|
|
173
|
-
3. Add to main `src/index.ts` if commonly used
|
|
174
|
-
4. Write comprehensive JSDoc comments with examples
|
|
175
|
-
5. Add unit tests for type guards/validators
|
|
176
|
-
6. Update TYPE_CHANGES.md documentation
|
|
177
|
-
|
|
178
|
-
### Adding Utilities
|
|
179
|
-
1. Place in appropriate utility directory under `src/utils/`
|
|
180
|
-
2. Keep functions pure (no side effects)
|
|
181
|
-
3. Add comprehensive tests with edge cases
|
|
182
|
-
4. Export from utility's `index.ts`
|
|
183
|
-
5. Document with JSDoc including usage examples
|
|
184
|
-
|
|
185
|
-
### Type Safety Best Practices
|
|
186
|
-
1. Use `Optional<T>` instead of manual `| null | undefined`
|
|
187
|
-
2. Prefer `unknown` over `any` for type safety
|
|
188
|
-
3. Use `Result<T, E>` pattern for error-prone operations
|
|
189
|
-
4. Implement type guards for runtime validation
|
|
190
|
-
5. Leverage utility types for consistent patterns
|
|
191
|
-
|
|
192
|
-
### Testing New Code
|
|
193
|
-
```bash
|
|
194
|
-
# Run tests in watch mode during development
|
|
195
|
-
bun run test:watch
|
|
186
|
+
## Architecture / Patterns
|
|
196
187
|
|
|
197
|
-
|
|
198
|
-
bun test -- path/to/test.file.ts
|
|
188
|
+
### Optional Pattern
|
|
199
189
|
|
|
200
|
-
|
|
201
|
-
bun run test:coverage
|
|
202
|
-
```
|
|
190
|
+
The `Optional<T>` type is used pervasively throughout the codebase instead of manual `T | null | undefined`. All optional interface properties use this type:
|
|
203
191
|
|
|
204
|
-
## AI Assistant Specific Notes
|
|
205
|
-
|
|
206
|
-
### When Working on This Project:
|
|
207
|
-
1. **Always run verification after changes**: `bun run verify`
|
|
208
|
-
2. **Maintain zero dependencies**: Don't add runtime dependencies
|
|
209
|
-
3. **Keep utilities pure**: No side effects in utility functions
|
|
210
|
-
4. **Follow naming conventions**: Established patterns for consistency
|
|
211
|
-
5. **Update documentation**: Keep TYPE_CHANGES.md current
|
|
212
|
-
6. **Test comprehensively**: All new utilities need tests
|
|
213
|
-
|
|
214
|
-
### Common Tasks:
|
|
215
|
-
- **Adding API response types**: Use consistent `ApiResponse<T>` pattern
|
|
216
|
-
- **Creating type guards**: Follow existing validation patterns
|
|
217
|
-
- **Updating blockchain types**: Consider multi-chain compatibility
|
|
218
|
-
- **Adding utility functions**: Ensure pure functions with comprehensive tests
|
|
219
|
-
- **Consolidating duplicates**: Use established utility types like `Optional<T>`
|
|
220
|
-
|
|
221
|
-
### Important Files:
|
|
222
|
-
- `src/index.ts`: Main export file - update for commonly used types
|
|
223
|
-
- `src/types/common.ts`: Core utility types - home of `Optional<T>`, `Result<T>`
|
|
224
|
-
- `src/types/business/enums.ts`: Business logic enums with shared constants
|
|
225
|
-
- `TYPE_CHANGES.md`: Comprehensive change documentation
|
|
226
|
-
- `package.json`: Dependencies and scripts (maintain zero runtime deps)
|
|
227
|
-
|
|
228
|
-
### Build Process:
|
|
229
|
-
1. **Dual output**: TypeScript compilation to both ESM and CJS
|
|
230
|
-
2. **Type definitions**: Generates `.d.ts` files for full TypeScript support
|
|
231
|
-
3. **Tree-shaking**: Optimized exports for modern bundlers
|
|
232
|
-
4. **Verification**: Comprehensive quality pipeline
|
|
233
|
-
|
|
234
|
-
### Quality Standards:
|
|
235
|
-
- **107 tests passing**: Complete test coverage maintained
|
|
236
|
-
- **Zero lint errors**: ESLint v9 with strict TypeScript rules
|
|
237
|
-
- **Perfect formatting**: Prettier integration
|
|
238
|
-
- **Type safety**: Strict TypeScript with comprehensive checking
|
|
239
|
-
- **Documentation**: JSDoc comments on all public APIs
|
|
240
|
-
|
|
241
|
-
## Recent Changes (v1.9.43)
|
|
242
|
-
|
|
243
|
-
### Type System Improvements
|
|
244
|
-
- **Enum Conversion**: Converted 11 string literal types to enums for better type safety
|
|
245
|
-
- KYC types: `KYCVerificationLevel`, `KYCApplicationStatus`, `SumsubReviewStatus`, `SumsubReviewAnswer`, `ApplicantType`, `ReviewRejectType`
|
|
246
|
-
- Mailer types: `ConfirmationStatus`, `ClaimType`, `FeeType`
|
|
247
|
-
- Infrastructure types: `ContractType`, `ProcessedEventName`
|
|
248
|
-
- WildDuck types: `MailboxSpecialUse`
|
|
249
|
-
- **Enhanced Type Safety**: Runtime validation capabilities with enums
|
|
250
|
-
- **Better IDE Support**: Improved autocomplete and IntelliSense
|
|
251
|
-
- **Iterability**: Can now iterate over enum values
|
|
252
|
-
|
|
253
|
-
### Dependency Updates
|
|
254
|
-
- Updated all devDependencies to latest stable versions (no breaking changes)
|
|
255
|
-
- `@eslint/js`: 9.36.0 → 9.38.0
|
|
256
|
-
- `@types/node`: 24.5.2 → 24.9.1
|
|
257
|
-
- `@typescript-eslint/*`: 8.44.0 → 8.46.2
|
|
258
|
-
- `eslint`: 9.36.0 → 9.38.0
|
|
259
|
-
- Fixed vite security vulnerability
|
|
260
|
-
|
|
261
|
-
### Documentation
|
|
262
|
-
- **AI-Optimized README**: Comprehensive examples and usage patterns
|
|
263
|
-
- **Enhanced JSDoc**: Complete documentation coverage with examples
|
|
264
|
-
- **Development Guides**: Improved contributor documentation
|
|
265
|
-
- **Version Consistency**: Updated all documentation to reflect current version
|
|
266
|
-
|
|
267
|
-
## Migration Guidance
|
|
268
|
-
|
|
269
|
-
### For Type Consumers
|
|
270
192
|
```typescript
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
193
|
+
import { Optional } from '@sudobility/types';
|
|
194
|
+
|
|
195
|
+
interface Example {
|
|
196
|
+
required: string;
|
|
197
|
+
optional?: Optional<string>; // consistent nullable pattern
|
|
198
|
+
}
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### Result Pattern
|
|
275
202
|
|
|
276
|
-
|
|
277
|
-
const user: Optional<User> = getUser(); // instead of User | null | undefined
|
|
203
|
+
Operations that can fail use `Result<T, E>` instead of throwing exceptions:
|
|
278
204
|
|
|
279
|
-
|
|
280
|
-
|
|
205
|
+
```typescript
|
|
206
|
+
import { Result, UnifiedError } from '@sudobility/types';
|
|
281
207
|
|
|
282
|
-
|
|
283
|
-
if (
|
|
284
|
-
|
|
208
|
+
function doWork(): Result<Data> {
|
|
209
|
+
if (ok) return { success: true, data: result };
|
|
210
|
+
return { success: false, error: { type: 'ValidationError', message: '...' } };
|
|
285
211
|
}
|
|
286
212
|
```
|
|
287
213
|
|
|
288
|
-
###
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
214
|
+
### Type Organization
|
|
215
|
+
|
|
216
|
+
Types are organized by domain under `src/types/`:
|
|
217
|
+
- **business/** -- Application-level enums and wallet status
|
|
218
|
+
- **blockchain/** -- Multi-chain messaging, transactions, fee structures
|
|
219
|
+
- **config/** -- App configuration and environment abstractions
|
|
220
|
+
- **consumables/** -- Credit/consumable purchase system types
|
|
221
|
+
- **entity/** -- Organization/workspace system with RBAC
|
|
222
|
+
- **infrastructure/** -- Platform-agnostic service interfaces (analytics, network, navigation)
|
|
223
|
+
- **subscription/** -- Rate limiting types
|
|
224
|
+
|
|
225
|
+
Utilities under `src/utils/` are pure functions with no side effects (except logger).
|
|
226
|
+
|
|
227
|
+
### Barrel Exports
|
|
228
|
+
|
|
229
|
+
Everything is re-exported through `src/index.ts`. The package also provides sub-path exports:
|
|
230
|
+
- `@sudobility/types` -- full library
|
|
231
|
+
- `@sudobility/types/api` -- indexer response types only
|
|
232
|
+
- `@sudobility/types/enums` -- business enums only
|
|
233
|
+
|
|
234
|
+
### Dual Module Output
|
|
235
|
+
|
|
236
|
+
The build produces both ESM (`dist/index.js`) and CommonJS (`dist/index.cjs`) via two tsconfig files:
|
|
237
|
+
- `tsconfig.esm.json` -- ESNext module output
|
|
238
|
+
- `tsconfig.cjs.json` -- CommonJS module output (files renamed to `.cjs`)
|
|
239
|
+
|
|
240
|
+
## Common Tasks
|
|
241
|
+
|
|
242
|
+
### Adding a New Type
|
|
243
|
+
|
|
244
|
+
1. Create or edit the appropriate file under `src/types/<domain>/`
|
|
245
|
+
2. Export the type from the domain file
|
|
246
|
+
3. Add the export to `src/index.ts` (use `export type { ... }` for pure types, `export { ... }` for enums/values)
|
|
247
|
+
4. Add JSDoc comments with `@example` blocks
|
|
248
|
+
5. Run `bun run verify` to confirm everything builds and passes
|
|
249
|
+
|
|
250
|
+
### Adding a New Enum
|
|
251
|
+
|
|
252
|
+
1. Add to the appropriate domain file (e.g., `src/types/business/enums.ts` for business enums)
|
|
253
|
+
2. Export with `export { EnumName }` (not `export type`) in `src/index.ts` so runtime values are available
|
|
254
|
+
3. If the enum values overlap with STATUS_VALUES, reference them in comments for consistency
|
|
255
|
+
|
|
256
|
+
### Adding a New Validator
|
|
257
|
+
|
|
258
|
+
1. Place in `src/utils/validation/` or the relevant domain utility directory
|
|
259
|
+
2. Keep functions pure -- accept input, return boolean or `ValidationResult<T>`
|
|
260
|
+
3. Export from `src/index.ts`
|
|
261
|
+
4. Add tests in `test/utils/validation/` mirroring the source path
|
|
262
|
+
5. Use existing patterns: `createValidator()` for wrapping type guards, `createAssertion()` for throwing variants
|
|
263
|
+
|
|
264
|
+
### Adding a New Formatter
|
|
265
|
+
|
|
266
|
+
1. Place in the appropriate `src/utils/formatting/` file (string.ts, date.ts, currency.ts)
|
|
267
|
+
2. Keep functions pure with no side effects
|
|
268
|
+
3. Export from `src/index.ts`
|
|
269
|
+
4. Add tests covering edge cases (empty strings, zero values, invalid dates)
|
|
270
|
+
|
|
271
|
+
### Adding Entity/RBAC Types
|
|
292
272
|
|
|
293
|
-
|
|
273
|
+
The entity system in `src/types/entity/` follows a strict pattern:
|
|
274
|
+
- Enums and core interfaces in `entity.ts`
|
|
275
|
+
- Permission constants and helpers in `permissions.ts`
|
|
276
|
+
- API request shapes in `requests.ts`
|
|
277
|
+
- API response shapes in `responses.ts` (all extend `BaseResponse<T>`)
|
|
294
278
|
|
|
295
|
-
|
|
296
|
-
1. **Enhanced Analytics Types**: More comprehensive event tracking
|
|
297
|
-
2. **Advanced Validation**: Schema-based validation utilities
|
|
298
|
-
3. **Better Error Types**: More specific error categorization
|
|
299
|
-
4. **Performance Optimization**: Further tree-shaking improvements
|
|
300
|
-
5. **Documentation**: Interactive type explorer
|
|
279
|
+
## Peer / Key Dependencies
|
|
301
280
|
|
|
302
|
-
|
|
303
|
-
- Track usage of deprecated patterns
|
|
304
|
-
- Monitor for type safety regressions
|
|
305
|
-
- Evaluate bundle size impact
|
|
306
|
-
- Collect developer feedback
|
|
281
|
+
This package has **zero runtime dependencies**. All dependencies are dev-only:
|
|
307
282
|
|
|
308
|
-
|
|
283
|
+
| Dependency | Purpose |
|
|
284
|
+
|------------|---------|
|
|
285
|
+
| `typescript` ^5.9.3 | TypeScript compiler |
|
|
286
|
+
| `vitest` ^4.0.4 | Test framework |
|
|
287
|
+
| `eslint` ^9.38.0 | Linting (flat config format) |
|
|
288
|
+
| `@typescript-eslint/*` ^8.46.2 | TypeScript ESLint rules |
|
|
289
|
+
| `prettier` ^3.6.2 | Code formatting |
|
|
290
|
+
| `rimraf` ^6.0.1 | Clean build artifacts |
|
|
291
|
+
| `globals` ^16.4.0 | ESLint globals |
|
|
292
|
+
| `@types/node` ^24.9.1 | Node.js type definitions |
|
|
309
293
|
|
|
310
|
-
|
|
294
|
+
Consumers import this package as a dependency. No peer dependencies are required.
|
package/dist/index.d.ts
CHANGED
|
@@ -29,6 +29,7 @@ export { WalletType } from './types/infrastructure/wallet';
|
|
|
29
29
|
export type { UserInfoResponse } from './types/infrastructure/firebase-user';
|
|
30
30
|
export type { RateLimits, RateLimitTier, RateLimitResets, RateLimitsConfigData, RateLimitUsage, RateLimitsConfigResponse, RateLimitHistoryEntry, RateLimitHistoryData, RateLimitHistoryResponse, } from './types/subscription/rate-limits';
|
|
31
31
|
export { RateLimitPeriodType } from './types/subscription/rate-limits';
|
|
32
|
+
export type { ConsumableSource, ConsumablePurchaseRequest, ConsumableUseRequest, ConsumableBalanceResponse, ConsumableUseResponse, ConsumablePurchaseRecord, ConsumableUsageRecord, } from './types/consumables';
|
|
32
33
|
export { EntityType, EntityRole, InvitationStatus, } from './types/entity/entity';
|
|
33
34
|
export type { Entity, EntityWithRole, EntityMember, EntityInvitation, } from './types/entity/entity';
|
|
34
35
|
export type { EntityPermissions } from './types/entity/permissions';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,YAAY,EACV,QAAQ,EACR,UAAU,EACV,UAAU,EACV,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,MAAM,EACN,gBAAgB,GACjB,MAAM,gBAAgB,CAAC;AAOxB,OAAO,EACL,UAAU,EACV,KAAK,EACL,SAAS,EACT,eAAe,EACf,cAAc,EACd,QAAQ,EACR,WAAW,EACX,gBAAgB,E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gB,EAChB,gBAAgB,EAChB,WAAW,EACX,oBAAoB,GACrB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,YAAY,EACZ,kBAAkB,GACnB,MAAM,4BAA4B,CAAC;AAGpC,YAAY,EACV,aAAa,EACb,qBAAqB,EACrB,eAAe,GAChB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAG9D,YAAY,EACV,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,mCAAmC,CAAC;AAG3C,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAG3D,YAAY,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAM7E,YAAY,EACV,UAAU,EACV,aAAa,EACb,eAAe,EACf,oBAAoB,EACpB,cAAc,EACd,wBAAwB,EACxB,qBAAqB,EACrB,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,YAAY,EACV,QAAQ,EACR,UAAU,EACV,UAAU,EACV,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,MAAM,EACN,gBAAgB,GACjB,MAAM,gBAAgB,CAAC;AAOxB,OAAO,EACL,UAAU,EACV,KAAK,EACL,SAAS,EACT,eAAe,EACf,cAAc,EACd,QAAQ,EACR,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,SAAS,EACT,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,SAAS,EACT,kBA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AAO,EACP,QAAQ,EACR,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,aAAa,EACb,SAAS,GACV,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EACL,UAAU,EACV,UAAU,EACV,WAAW,EACX,YAAY,EACZ,WAAW,EACX,OAAO,EACP,UAAU,EACV,mBAAmB,EACnB,SAAS,EACT,YAAY,EACZ,SAAS,EACT,WAAW,EACX,WAAW,EACX,WAAW,EACX,WAAW,EACX,QAAQ,GACT,MAAM,2BAA2B,CAAC;AAMnC,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,eAAe,EACf,WAAW,EACX,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,MAAM,EACN,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,SAAS,EACT,OAAO,GACR,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,YAAY,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAMnE,OAAO,EACL,QAAQ,EACR,KAAK,QAAQ,EACb,MAAM,EACN,UAAU,EACV,SAAS,EACT,cAAc,EACd,SAAS,EACT,aAAa,GACd,MAAM,wBAAwB,CAAC;AAMhC,OAAO,EACL,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,EACjB,KAAK,mBAAmB,GACzB,MAAM,wBAAwB,CAAC;AAMhC,OAAO,EACL,SAAS,EACT,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,SAAS,EACT,iBAAiB,EACjB,aAAa,EACb,KAAK,WAAW,GACjB,MAAM,uBAAuB,CAAC"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;;;;AAoBH,+EAA+E;AAC/E,mBAAmB;AACnB,+EAA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AA;AACrB,gHAAA,kBAAkB,OAAA;AAClB,kHAAA,oBAAoB,OAAA;AACpB,+GAAA,iBAAiB,OAAA;AAInB,+EAA+E;AAC/E,wBAAwB;AACxB,+EAA+E;AAE/E,uDAS+B;AAR7B,0GAAA,SAAS,OAAA;AACT,iHAAA,gBAAgB,OAAA;AAChB,6GAAA,YAAY,OAAA;AACZ,4GAAA,WAAW,OAAA;AACX,0GAAA,SAAS,OAAA;AACT,kHAAA,iBAAiB,OAAA;AACjB,8GAAA,aAAa,OAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview Consumable Credits Type Definitions
|
|
4
|
+
* @description Shared API contract types for consumable credit system.
|
|
5
|
+
* Used by both consumables_service (backend) and consumables_client (frontend).
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Consumable Credits Type Definitions
|
|
3
|
+
* @description Shared API contract types for consumable credit system.
|
|
4
|
+
* Used by both consumables_service (backend) and consumables_client (frontend).
|
|
5
|
+
*/
|
|
6
|
+
/** Purchase source platform */
|
|
7
|
+
export type ConsumableSource = "web" | "apple" | "google" | "free";
|
|
8
|
+
/** POST /consumables/purchase request body */
|
|
9
|
+
export interface ConsumablePurchaseRequest {
|
|
10
|
+
credits: number;
|
|
11
|
+
source: ConsumableSource;
|
|
12
|
+
transaction_ref_id?: string;
|
|
13
|
+
product_id?: string;
|
|
14
|
+
price_cents?: number;
|
|
15
|
+
currency?: string;
|
|
16
|
+
}
|
|
17
|
+
/** POST /consumables/use request body */
|
|
18
|
+
export interface ConsumableUseRequest {
|
|
19
|
+
filename?: string;
|
|
20
|
+
}
|
|
21
|
+
/** GET /consumables/balance response data */
|
|
22
|
+
export interface ConsumableBalanceResponse {
|
|
23
|
+
balance: number;
|
|
24
|
+
initial_credits: number;
|
|
25
|
+
}
|
|
26
|
+
/** POST /consumables/use response data */
|
|
27
|
+
export interface ConsumableUseResponse {
|
|
28
|
+
balance: number;
|
|
29
|
+
success: boolean;
|
|
30
|
+
}
|
|
31
|
+
/** Purchase history record (GET /consumables/purchases array item) */
|
|
32
|
+
export interface ConsumablePurchaseRecord {
|
|
33
|
+
id: number;
|
|
34
|
+
credits: number;
|
|
35
|
+
source: string;
|
|
36
|
+
transaction_ref_id: string | null;
|
|
37
|
+
product_id: string | null;
|
|
38
|
+
price_cents: number | null;
|
|
39
|
+
currency: string | null;
|
|
40
|
+
created_at: string;
|
|
41
|
+
}
|
|
42
|
+
/** Usage history record (GET /consumables/usages array item) */
|
|
43
|
+
export interface ConsumableUsageRecord {
|
|
44
|
+
id: number;
|
|
45
|
+
filename: string | null;
|
|
46
|
+
created_at: string;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/consumables/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,+BAA+B;AAC/B,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;AAMnE,8CAA8C;AAC9C,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,gBAAgB,CAAC;IACzB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,yCAAyC;AACzC,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAMD,6CAA6C;AAC7C,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,0CAA0C;AAC1C,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;CAClB;AAMD,sEAAsE;AACtE,MAAM,WAAW,wBAAwB;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,gEAAgE;AAChE,MAAM,WAAW,qBAAqB;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview Consumable Credits Type Definitions
|
|
4
|
+
* @description Shared API contract types for consumable credit system.
|
|
5
|
+
* Used by both consumables_service (backend) and consumables_client (frontend).
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/consumables/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sudobility/types",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.52",
|
|
4
4
|
"description": "Comprehensive TypeScript types, interfaces, and utilities for Web3 email applications - optimized for AI-assisted development",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.js",
|