@varity-labs/types 2.0.0-alpha.1
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/LICENSE +31 -0
- package/README.md +328 -0
- package/dist/api.d.ts +219 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/api.js +6 -0
- package/dist/auth.d.ts +457 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +222 -0
- package/dist/common.d.ts +130 -0
- package/dist/common.d.ts.map +1 -0
- package/dist/common.js +47 -0
- package/dist/gcs-compatible.d.ts +500 -0
- package/dist/gcs-compatible.d.ts.map +1 -0
- package/dist/gcs-compatible.js +51 -0
- package/dist/index.d.ts +41 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +67 -0
- package/dist/migration.d.ts +532 -0
- package/dist/migration.d.ts.map +1 -0
- package/dist/migration.js +90 -0
- package/dist/s3-compatible.d.ts +473 -0
- package/dist/s3-compatible.d.ts.map +1 -0
- package/dist/s3-compatible.js +63 -0
- package/dist/storage.d.ts +600 -0
- package/dist/storage.d.ts.map +1 -0
- package/dist/storage.js +75 -0
- package/dist/thirdweb.d.ts +1182 -0
- package/dist/thirdweb.d.ts.map +1 -0
- package/dist/thirdweb.js +91 -0
- package/package.json +43 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Varity Labs
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
Varity SDK - Web3 Operating System
|
|
26
|
+
|
|
27
|
+
Build and deploy apps on Varity L3 with 70-85% cost savings vs traditional cloud.
|
|
28
|
+
|
|
29
|
+
For more information, visit https://varity.so
|
|
30
|
+
|
|
31
|
+
"Powered by Varity" attribution is required when using this SDK.
|
package/README.md
ADDED
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
# @varity/types
|
|
2
|
+
|
|
3
|
+
**TypeScript Type Definitions for Varity SDK** - Comprehensive types for multi-chain Web3 development, thirdweb integration, and enterprise features.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @varity/types@alpha
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import type {
|
|
15
|
+
ChainSelection,
|
|
16
|
+
ChainMetadata,
|
|
17
|
+
EngineTransactionParams,
|
|
18
|
+
SmartWalletConfig,
|
|
19
|
+
Purchase,
|
|
20
|
+
} from '@varity/types';
|
|
21
|
+
|
|
22
|
+
// Type-safe chain selection
|
|
23
|
+
const chainConfig: ChainSelection = {
|
|
24
|
+
optimize: 'cost',
|
|
25
|
+
requirements: {
|
|
26
|
+
testnet: true,
|
|
27
|
+
maxGasPrice: BigInt(1000000000)
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
// Type-safe transaction parameters
|
|
32
|
+
const txParams: EngineTransactionParams = {
|
|
33
|
+
chainId: 33529,
|
|
34
|
+
to: '0x...',
|
|
35
|
+
data: '0x...',
|
|
36
|
+
value: 0n,
|
|
37
|
+
gasLimit: 100000n
|
|
38
|
+
};
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Features
|
|
42
|
+
|
|
43
|
+
### 🔗 Multi-Chain Types
|
|
44
|
+
- **ChainSelection** - Configuration for intelligent chain selection
|
|
45
|
+
- **ChainMetadata** - Chain information with cost/speed/security ratings
|
|
46
|
+
- Chain-specific types for Varity L3, Arbitrum, Base
|
|
47
|
+
|
|
48
|
+
### ⚡ thirdweb Integration Types
|
|
49
|
+
- **Engine** - Transaction management types (EngineConfig, EngineTransactionParams, EngineWebhookPayload)
|
|
50
|
+
- **Nebula AI** - AI-powered blockchain types (GenerateContractOptions, QueryChainOptions)
|
|
51
|
+
- **Storage** - IPFS/Arweave types (ThirdwebUploadResult, ThirdwebDownloadOptions)
|
|
52
|
+
- **Bridge** - Cross-chain types (BridgeRoute, BridgeQuote, BridgeTransactionResult)
|
|
53
|
+
- **Gateway** - RPC types (RPCRequestOptions, GatewayStats, WebSocketOptions)
|
|
54
|
+
- **x402** - Payment protocol types (PaymentEndpointConfig, PaymentStats, Subscription)
|
|
55
|
+
|
|
56
|
+
### 🔐 Smart Wallet Types
|
|
57
|
+
- **SmartWalletConfig** - ERC-4337 configuration
|
|
58
|
+
- **GaslessConfig** - Paymaster and gas sponsorship
|
|
59
|
+
- **WalletMetadata** - Server wallet management
|
|
60
|
+
|
|
61
|
+
### 💳 On-Ramp Types
|
|
62
|
+
- **Purchase** - Payment transaction types
|
|
63
|
+
- **OnrampWidgetProps** - Widget configuration
|
|
64
|
+
|
|
65
|
+
### 🎯 SDK Core Types
|
|
66
|
+
- **VaritySDKConfig** - Main SDK configuration
|
|
67
|
+
- **NetworkConfig** - Network settings
|
|
68
|
+
- **TemplateConfig** - Template system types
|
|
69
|
+
- **StorageOptions** - Multi-provider storage
|
|
70
|
+
|
|
71
|
+
## Key Type Exports
|
|
72
|
+
|
|
73
|
+
### Multi-Chain
|
|
74
|
+
```typescript
|
|
75
|
+
export interface ChainSelection {
|
|
76
|
+
optimize: 'cost' | 'speed' | 'security';
|
|
77
|
+
requirements?: {
|
|
78
|
+
maxGasPrice?: bigint;
|
|
79
|
+
minTPS?: number;
|
|
80
|
+
privacy?: 'none' | 'lit' | 'fhe' | 'tee';
|
|
81
|
+
testnet?: boolean;
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export interface ChainMetadata {
|
|
86
|
+
chain: Chain;
|
|
87
|
+
averageGasPrice: bigint;
|
|
88
|
+
estimatedTPS: number;
|
|
89
|
+
privacyLevel: 'none' | 'lit' | 'fhe' | 'tee';
|
|
90
|
+
costRating: number; // 1-10 (1 = cheapest)
|
|
91
|
+
speedRating: number; // 1-10 (10 = fastest)
|
|
92
|
+
securityRating: number; // 1-10 (10 = most secure)
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### thirdweb Engine
|
|
97
|
+
```typescript
|
|
98
|
+
export interface EngineConfig {
|
|
99
|
+
engineUrl: string;
|
|
100
|
+
accessToken: string;
|
|
101
|
+
backendWallet: string;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export interface EngineTransactionParams {
|
|
105
|
+
chainId: number;
|
|
106
|
+
to: string;
|
|
107
|
+
data: string;
|
|
108
|
+
value: bigint;
|
|
109
|
+
gasLimit?: bigint;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export type EngineTransactionStatus =
|
|
113
|
+
| 'queued'
|
|
114
|
+
| 'processing'
|
|
115
|
+
| 'mined'
|
|
116
|
+
| 'errored'
|
|
117
|
+
| 'cancelled';
|
|
118
|
+
|
|
119
|
+
export interface EngineTransactionResult {
|
|
120
|
+
queueId: string;
|
|
121
|
+
status: EngineTransactionStatus;
|
|
122
|
+
transactionHash?: string;
|
|
123
|
+
errorMessage?: string;
|
|
124
|
+
}
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Nebula AI
|
|
128
|
+
```typescript
|
|
129
|
+
export interface GenerateContractOptions {
|
|
130
|
+
prompt: string;
|
|
131
|
+
language: 'solidity' | 'vyper';
|
|
132
|
+
framework?: 'hardhat' | 'foundry' | 'truffle';
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export interface QueryChainOptions {
|
|
136
|
+
prompt: string;
|
|
137
|
+
chainId: number;
|
|
138
|
+
includeTransactions?: boolean;
|
|
139
|
+
}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Storage
|
|
143
|
+
```typescript
|
|
144
|
+
export interface ThirdwebUploadResult {
|
|
145
|
+
uri: string; // ipfs://... or ar://...
|
|
146
|
+
cid: string; // IPFS CID or Arweave transaction ID
|
|
147
|
+
size: number; // File size in bytes
|
|
148
|
+
gateway: string; // Public gateway URL
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export interface ThirdwebDownloadOptions {
|
|
152
|
+
uri: string;
|
|
153
|
+
timeout?: number;
|
|
154
|
+
progressCallback?: (progress: number) => void;
|
|
155
|
+
}
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### Bridge
|
|
159
|
+
```typescript
|
|
160
|
+
export interface BridgeRoute {
|
|
161
|
+
fromChain: Chain;
|
|
162
|
+
toChain: Chain;
|
|
163
|
+
token: string;
|
|
164
|
+
estimatedTime: number; // seconds
|
|
165
|
+
estimatedFee: bigint;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export interface BridgeQuote {
|
|
169
|
+
route: BridgeRoute;
|
|
170
|
+
amountIn: bigint;
|
|
171
|
+
amountOut: bigint;
|
|
172
|
+
priceImpact: number; // percentage
|
|
173
|
+
validUntil: Date;
|
|
174
|
+
}
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### x402 Payment Protocol
|
|
178
|
+
```typescript
|
|
179
|
+
export interface PaymentEndpointConfig {
|
|
180
|
+
apiUrl: string;
|
|
181
|
+
pricePerCall: bigint;
|
|
182
|
+
paymentToken: 'USDC' | 'ETH' | 'MATIC';
|
|
183
|
+
chain: Chain;
|
|
184
|
+
revenueSplit?: {
|
|
185
|
+
developer: number; // 70% default
|
|
186
|
+
platform: number; // 30% default
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export interface PaymentStats {
|
|
191
|
+
totalCalls: number;
|
|
192
|
+
totalRevenue: bigint;
|
|
193
|
+
developerEarnings: bigint;
|
|
194
|
+
platformFee: bigint;
|
|
195
|
+
}
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### Smart Wallets
|
|
199
|
+
```typescript
|
|
200
|
+
export interface SmartWalletConfig {
|
|
201
|
+
chain: Chain;
|
|
202
|
+
factoryAddress?: string;
|
|
203
|
+
gasless?: {
|
|
204
|
+
enabled: boolean;
|
|
205
|
+
paymaster?: string | 'auto';
|
|
206
|
+
maxGasLimit?: bigint;
|
|
207
|
+
};
|
|
208
|
+
sessionKeys?: boolean;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export interface WalletMetadata {
|
|
212
|
+
address: string;
|
|
213
|
+
label: string;
|
|
214
|
+
encryptedKey: string;
|
|
215
|
+
createdAt: Date;
|
|
216
|
+
}
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### On-Ramp
|
|
220
|
+
```typescript
|
|
221
|
+
export interface Purchase {
|
|
222
|
+
id: string;
|
|
223
|
+
amount: number;
|
|
224
|
+
currency: string;
|
|
225
|
+
status: 'pending' | 'processing' | 'completed' | 'failed';
|
|
226
|
+
timestamp: Date;
|
|
227
|
+
txHash?: string;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export interface OnrampWidgetProps {
|
|
231
|
+
walletAddress: string;
|
|
232
|
+
clientId: string;
|
|
233
|
+
defaultAmount?: number;
|
|
234
|
+
minAmount?: number;
|
|
235
|
+
maxAmount?: number;
|
|
236
|
+
onComplete?: (purchase: Purchase) => void;
|
|
237
|
+
onError?: (error: Error) => void;
|
|
238
|
+
showHistory?: boolean;
|
|
239
|
+
theme?: 'light' | 'dark';
|
|
240
|
+
}
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
## USDC Decimal Handling
|
|
244
|
+
|
|
245
|
+
**CRITICAL**: Varity L3 uses USDC with **6 decimals** (not 18 like ETH):
|
|
246
|
+
|
|
247
|
+
```typescript
|
|
248
|
+
// USDC Constants
|
|
249
|
+
export const USDC_DECIMALS = 6;
|
|
250
|
+
export const VARITY_USDC_ADDRESS = '0x...'; // Actual USDC contract on Varity L3
|
|
251
|
+
|
|
252
|
+
// Correct USDC formatting
|
|
253
|
+
const amount = 1000000n; // 1 USDC = 1,000,000 units (6 decimals)
|
|
254
|
+
|
|
255
|
+
// Helper functions
|
|
256
|
+
export function formatUSDC(amount: bigint): string;
|
|
257
|
+
export function parseUSDC(amount: string): bigint;
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
## Usage Examples
|
|
261
|
+
|
|
262
|
+
### Type-Safe Chain Selection
|
|
263
|
+
```typescript
|
|
264
|
+
import type { ChainSelection, ChainMetadata } from '@varity/types';
|
|
265
|
+
|
|
266
|
+
const config: ChainSelection = {
|
|
267
|
+
optimize: 'speed',
|
|
268
|
+
requirements: {
|
|
269
|
+
minTPS: 1000,
|
|
270
|
+
testnet: false
|
|
271
|
+
}
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
function selectChain(config: ChainSelection): ChainMetadata {
|
|
275
|
+
// Implementation with full type safety
|
|
276
|
+
}
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
### Type-Safe thirdweb Engine
|
|
280
|
+
```typescript
|
|
281
|
+
import type { EngineTransactionParams, EngineTransactionResult } from '@varity/types';
|
|
282
|
+
|
|
283
|
+
const params: EngineTransactionParams = {
|
|
284
|
+
chainId: 33529,
|
|
285
|
+
to: contractAddress,
|
|
286
|
+
data: encodedData,
|
|
287
|
+
value: 0n
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
const result: EngineTransactionResult = await engine.sendTransaction(params);
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
### Type-Safe Smart Wallet
|
|
294
|
+
```typescript
|
|
295
|
+
import type { SmartWalletConfig } from '@varity/types';
|
|
296
|
+
|
|
297
|
+
const walletConfig: SmartWalletConfig = {
|
|
298
|
+
chain: varityL3,
|
|
299
|
+
gasless: {
|
|
300
|
+
enabled: true,
|
|
301
|
+
paymaster: 'auto',
|
|
302
|
+
maxGasLimit: 500000n
|
|
303
|
+
}
|
|
304
|
+
};
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
## Version
|
|
308
|
+
|
|
309
|
+
Current version: **2.0.0-alpha.1**
|
|
310
|
+
|
|
311
|
+
## License
|
|
312
|
+
|
|
313
|
+
MIT - See [LICENSE](../../LICENSE) file
|
|
314
|
+
|
|
315
|
+
## Documentation
|
|
316
|
+
|
|
317
|
+
See [docs.varity.ai/packages/types](https://docs.varity.ai) for full documentation.
|
|
318
|
+
|
|
319
|
+
## Support
|
|
320
|
+
|
|
321
|
+
- Documentation: https://docs.varity.ai
|
|
322
|
+
- Discord: https://discord.gg/varity
|
|
323
|
+
- GitHub Issues: https://github.com/varity-labs/varity-sdk/issues
|
|
324
|
+
- Email: support@varity.ai
|
|
325
|
+
|
|
326
|
+
---
|
|
327
|
+
|
|
328
|
+
**Powered by Varity** | [Website](https://varity.ai) | [Twitter](https://twitter.com/VarityLabs) | [Discord](https://discord.gg/varity)
|
package/dist/api.d.ts
ADDED
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API Types for Varity SDK
|
|
3
|
+
*
|
|
4
|
+
* Type-safe definitions for API requests and responses
|
|
5
|
+
*/
|
|
6
|
+
import { JSONValue, JSONObject, Metadata } from './common';
|
|
7
|
+
/**
|
|
8
|
+
* Standard API response wrapper
|
|
9
|
+
*/
|
|
10
|
+
export interface APIResponse<T = unknown> {
|
|
11
|
+
data: T;
|
|
12
|
+
status: number;
|
|
13
|
+
statusText: string;
|
|
14
|
+
headers?: Record<string, string>;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* API error response
|
|
18
|
+
*/
|
|
19
|
+
export interface APIError {
|
|
20
|
+
message: string;
|
|
21
|
+
code?: string;
|
|
22
|
+
status: number;
|
|
23
|
+
details?: JSONObject;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Paginated API response
|
|
27
|
+
*/
|
|
28
|
+
export interface PaginatedResponse<T> {
|
|
29
|
+
data: T[];
|
|
30
|
+
pagination: {
|
|
31
|
+
page: number;
|
|
32
|
+
pageSize: number;
|
|
33
|
+
totalPages: number;
|
|
34
|
+
totalItems: number;
|
|
35
|
+
hasNextPage: boolean;
|
|
36
|
+
hasPreviousPage: boolean;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* API request configuration
|
|
41
|
+
*/
|
|
42
|
+
export interface APIRequestConfig {
|
|
43
|
+
headers?: Record<string, string>;
|
|
44
|
+
params?: Record<string, string | number | boolean>;
|
|
45
|
+
timeout?: number;
|
|
46
|
+
signal?: AbortSignal;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* HTTP method types
|
|
50
|
+
*/
|
|
51
|
+
export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
52
|
+
/**
|
|
53
|
+
* User profile data from API
|
|
54
|
+
*/
|
|
55
|
+
export interface UserProfile {
|
|
56
|
+
address: string;
|
|
57
|
+
name?: string;
|
|
58
|
+
email?: string;
|
|
59
|
+
avatarUrl?: string;
|
|
60
|
+
metadata?: Metadata;
|
|
61
|
+
createdAt?: string;
|
|
62
|
+
updatedAt?: string;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Login response from API
|
|
66
|
+
*/
|
|
67
|
+
export interface LoginResponse {
|
|
68
|
+
token: string;
|
|
69
|
+
refreshToken?: string;
|
|
70
|
+
expiresAt?: string;
|
|
71
|
+
user: UserProfile;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Authentication token data
|
|
75
|
+
*/
|
|
76
|
+
export interface AuthToken {
|
|
77
|
+
accessToken: string;
|
|
78
|
+
refreshToken?: string;
|
|
79
|
+
tokenType: 'Bearer' | string;
|
|
80
|
+
expiresIn?: number;
|
|
81
|
+
expiresAt?: string;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Webhook payload
|
|
85
|
+
*/
|
|
86
|
+
export interface WebhookPayload {
|
|
87
|
+
event: string;
|
|
88
|
+
timestamp: string;
|
|
89
|
+
data: JSONObject;
|
|
90
|
+
metadata?: Metadata;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Oracle data response
|
|
94
|
+
*/
|
|
95
|
+
export interface OracleData {
|
|
96
|
+
value: JSONValue;
|
|
97
|
+
timestamp: number;
|
|
98
|
+
source: string;
|
|
99
|
+
confidence: number;
|
|
100
|
+
metadata?: Metadata;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Price data from oracle
|
|
104
|
+
*/
|
|
105
|
+
export interface PriceData {
|
|
106
|
+
asset: string;
|
|
107
|
+
price: number;
|
|
108
|
+
currency: string;
|
|
109
|
+
timestamp: number;
|
|
110
|
+
sources: string[];
|
|
111
|
+
confidence?: number;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Analytics KPI
|
|
115
|
+
*/
|
|
116
|
+
export interface KPI {
|
|
117
|
+
id: string;
|
|
118
|
+
label: string;
|
|
119
|
+
value: number | string;
|
|
120
|
+
unit?: string;
|
|
121
|
+
trend?: 'up' | 'down' | 'neutral';
|
|
122
|
+
trendValue?: number;
|
|
123
|
+
metadata?: Metadata;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Analytics KPI result
|
|
127
|
+
*/
|
|
128
|
+
export interface KPIResult {
|
|
129
|
+
kpis: KPI[];
|
|
130
|
+
metrics?: Record<string, number | string>;
|
|
131
|
+
timestamp?: string;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Time series data point
|
|
135
|
+
*/
|
|
136
|
+
export interface TimeSeriesDataPoint {
|
|
137
|
+
timestamp: string;
|
|
138
|
+
value: number;
|
|
139
|
+
metadata?: Metadata;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Trend data response
|
|
143
|
+
*/
|
|
144
|
+
export interface TrendResponse {
|
|
145
|
+
data: TimeSeriesDataPoint[];
|
|
146
|
+
aggregation?: 'hour' | 'day' | 'week' | 'month';
|
|
147
|
+
startDate: string;
|
|
148
|
+
endDate: string;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Dashboard configuration
|
|
152
|
+
*/
|
|
153
|
+
export interface DashboardConfig {
|
|
154
|
+
id: string;
|
|
155
|
+
title: string;
|
|
156
|
+
description?: string;
|
|
157
|
+
widgets: DashboardWidget[];
|
|
158
|
+
layout?: DashboardLayout;
|
|
159
|
+
theme?: DashboardTheme;
|
|
160
|
+
metadata?: Metadata;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Dashboard widget
|
|
164
|
+
*/
|
|
165
|
+
export interface DashboardWidget {
|
|
166
|
+
id: string;
|
|
167
|
+
type: string;
|
|
168
|
+
title?: string;
|
|
169
|
+
config: JSONObject;
|
|
170
|
+
position?: {
|
|
171
|
+
x: number;
|
|
172
|
+
y: number;
|
|
173
|
+
width: number;
|
|
174
|
+
height: number;
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Dashboard layout
|
|
179
|
+
*/
|
|
180
|
+
export type DashboardLayout = 'grid' | 'flex' | 'masonry' | string;
|
|
181
|
+
/**
|
|
182
|
+
* Dashboard theme
|
|
183
|
+
*/
|
|
184
|
+
export type DashboardTheme = 'light' | 'dark' | 'auto' | string;
|
|
185
|
+
/**
|
|
186
|
+
* Analytics period
|
|
187
|
+
*/
|
|
188
|
+
export type AnalyticsPeriod = 'current_day' | 'current_week' | 'current_month' | 'current_year' | 'custom';
|
|
189
|
+
/**
|
|
190
|
+
* Event tracking data
|
|
191
|
+
*/
|
|
192
|
+
export interface EventData {
|
|
193
|
+
event: string;
|
|
194
|
+
properties: Record<string, JSONValue>;
|
|
195
|
+
timestamp: string;
|
|
196
|
+
userId?: string;
|
|
197
|
+
sessionId?: string;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* File upload data
|
|
201
|
+
*/
|
|
202
|
+
export interface UploadData {
|
|
203
|
+
file: File | Blob;
|
|
204
|
+
fileName?: string;
|
|
205
|
+
contentType?: string;
|
|
206
|
+
metadata?: Metadata;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* File upload response
|
|
210
|
+
*/
|
|
211
|
+
export interface UploadResponse {
|
|
212
|
+
url: string;
|
|
213
|
+
fileName: string;
|
|
214
|
+
fileSize: number;
|
|
215
|
+
contentType: string;
|
|
216
|
+
uploadedAt: string;
|
|
217
|
+
metadata?: Metadata;
|
|
218
|
+
}
|
|
219
|
+
//# sourceMappingURL=api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,WAAW,CAAC,CAAC,GAAG,OAAO;IACtC,IAAI,EAAE,CAAC,CAAC;IACR,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM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