@iteradian-rpc/sdk 1.1.1 → 1.2.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 +194 -104
- package/dist/index.d.mts +780 -337
- package/dist/index.d.ts +780 -337
- package/dist/index.js +121 -38
- package/dist/index.mjs +121 -38
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/** A number the API may send as a JSON number or as a numeric string. */
|
|
2
|
+
type Numeric = number | string;
|
|
3
|
+
/** An open string union: known values autocomplete, unknown ones still type-check. */
|
|
4
|
+
type OpenString<T extends string> = T | (string & {});
|
|
5
|
+
/** Plain `{ message }` acknowledgement. */
|
|
6
|
+
interface MessageResponse {
|
|
7
|
+
message: string;
|
|
8
|
+
}
|
|
1
9
|
interface RegisterRequest {
|
|
2
10
|
email: string;
|
|
3
11
|
password: string;
|
|
@@ -13,7 +21,9 @@ interface RegisterRequest {
|
|
|
13
21
|
interface LoginRequest {
|
|
14
22
|
email: string;
|
|
15
23
|
password: string;
|
|
24
|
+
/** Current 6-digit authenticator code, when two-factor auth is on. */
|
|
16
25
|
twoFactorCode?: string;
|
|
26
|
+
/** One-time backup code, used instead of `twoFactorCode`. */
|
|
17
27
|
backupCode?: string;
|
|
18
28
|
}
|
|
19
29
|
/**
|
|
@@ -25,78 +35,155 @@ interface RegisterResponse {
|
|
|
25
35
|
message: string;
|
|
26
36
|
email: string;
|
|
27
37
|
}
|
|
38
|
+
/** The signed-in user as returned with tokens. */
|
|
39
|
+
interface AuthUser {
|
|
40
|
+
id: string;
|
|
41
|
+
email?: string;
|
|
42
|
+
personalOrgId?: string | null;
|
|
43
|
+
emailVerified?: boolean;
|
|
44
|
+
twoFactorEnabled?: boolean;
|
|
45
|
+
systemRole?: OpenString<"user" | "admin" | "super_admin">;
|
|
46
|
+
isIteradianMember?: boolean;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* What login answers. With two-factor auth on and no code sent, the API
|
|
50
|
+
* answers `{ requires2FA: true }` and no tokens: check `requires2FA`, then
|
|
51
|
+
* log in again with `twoFactorCode` or `backupCode`.
|
|
52
|
+
*/
|
|
53
|
+
interface LoginResult {
|
|
54
|
+
accessToken?: string;
|
|
55
|
+
refreshToken?: string;
|
|
56
|
+
user?: AuthUser;
|
|
57
|
+
requires2FA?: boolean;
|
|
58
|
+
}
|
|
59
|
+
/** What refresh answers: both tokens are always present. */
|
|
28
60
|
interface AuthTokens {
|
|
29
61
|
accessToken: string;
|
|
30
62
|
refreshToken: string;
|
|
31
|
-
user
|
|
63
|
+
user?: AuthUser;
|
|
32
64
|
}
|
|
33
65
|
interface TwoFASetup {
|
|
34
66
|
secret: string;
|
|
35
67
|
qrCode: string;
|
|
36
68
|
}
|
|
37
|
-
interface
|
|
38
|
-
|
|
39
|
-
email: string;
|
|
40
|
-
emailVerified: boolean;
|
|
41
|
-
systemRole: "user" | "admin" | "super_admin";
|
|
42
|
-
twoFactorEnabled: boolean;
|
|
43
|
-
createdAt: string;
|
|
44
|
-
updatedAt: string;
|
|
69
|
+
interface BackupCodes {
|
|
70
|
+
backupCodes: string[];
|
|
45
71
|
}
|
|
72
|
+
type User = AuthUser;
|
|
46
73
|
interface Membership {
|
|
47
74
|
id: string;
|
|
48
|
-
userId
|
|
49
|
-
organizationId
|
|
50
|
-
role
|
|
51
|
-
joinedAt
|
|
75
|
+
userId?: string;
|
|
76
|
+
organizationId?: string;
|
|
77
|
+
role?: OrgRole;
|
|
78
|
+
joinedAt?: string;
|
|
52
79
|
}
|
|
53
80
|
type OrgRole = "owner" | "admin" | "developer" | "viewer";
|
|
81
|
+
type BillingInterval = "month" | "year";
|
|
82
|
+
/** Request body of `organizations.create`. */
|
|
83
|
+
interface CreateOrganizationRequest {
|
|
84
|
+
name: string;
|
|
85
|
+
/** Plan to start on, e.g. `"plan_free"`. */
|
|
86
|
+
planId: string;
|
|
87
|
+
/**
|
|
88
|
+
* The caller confirms the user ticked "I agree to the Terms of Service,
|
|
89
|
+
* Privacy Policy and DPA". The server requires the field.
|
|
90
|
+
*/
|
|
91
|
+
acceptedTerms: boolean;
|
|
92
|
+
/** Lowercase letters, digits and hyphens, 2-50 characters. */
|
|
93
|
+
slug?: string;
|
|
94
|
+
billingInterval?: BillingInterval;
|
|
95
|
+
}
|
|
96
|
+
interface UpdateOrganizationRequest {
|
|
97
|
+
name?: string;
|
|
98
|
+
slug?: string;
|
|
99
|
+
}
|
|
100
|
+
interface OrgPlanSummary {
|
|
101
|
+
id: string;
|
|
102
|
+
name?: string;
|
|
103
|
+
tier?: string;
|
|
104
|
+
displayName?: string;
|
|
105
|
+
description?: string;
|
|
106
|
+
priceMonthly?: Numeric;
|
|
107
|
+
priceAnnual?: Numeric | null;
|
|
108
|
+
limits?: PlanLimits;
|
|
109
|
+
features?: string[];
|
|
110
|
+
isActive?: boolean;
|
|
111
|
+
}
|
|
112
|
+
interface OrgSubscriptionSummary {
|
|
113
|
+
id?: string;
|
|
114
|
+
organizationId?: string;
|
|
115
|
+
planId?: string;
|
|
116
|
+
plan?: OrgPlanSummary;
|
|
117
|
+
billingInterval?: string;
|
|
118
|
+
status?: string;
|
|
119
|
+
currentPeriodStart?: string;
|
|
120
|
+
currentPeriodEnd?: string;
|
|
121
|
+
cancelAtPeriodEnd?: boolean;
|
|
122
|
+
trialStart?: string | null;
|
|
123
|
+
trialEnd?: string | null;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* An organization. Which fields are filled depends on the call: `list` adds
|
|
127
|
+
* `subscription` (summary), `get` adds `subscription` (full) and `members`,
|
|
128
|
+
* `create` adds `onboardingComplete`, `billingProvider`, `checkoutUrl` and
|
|
129
|
+
* `paddleCheckout`.
|
|
130
|
+
*/
|
|
54
131
|
interface Organization {
|
|
55
132
|
id: string;
|
|
56
|
-
name
|
|
57
|
-
slug
|
|
58
|
-
|
|
59
|
-
|
|
133
|
+
name?: string;
|
|
134
|
+
slug?: string;
|
|
135
|
+
avatarUrl?: string | null;
|
|
136
|
+
avatarUrlDark?: string | null;
|
|
137
|
+
role?: OrgRole;
|
|
138
|
+
onboardingCompletedAt?: string | null;
|
|
139
|
+
onboardingComplete?: boolean;
|
|
140
|
+
billingProvider?: string | null;
|
|
141
|
+
checkoutUrl?: string | null;
|
|
142
|
+
paddleCheckout?: unknown;
|
|
143
|
+
subscription?: OrgSubscriptionSummary;
|
|
144
|
+
members?: OrgMember[];
|
|
60
145
|
}
|
|
61
146
|
interface OrgMember {
|
|
62
147
|
id: string;
|
|
63
|
-
userId
|
|
64
|
-
email
|
|
65
|
-
|
|
66
|
-
|
|
148
|
+
userId?: string;
|
|
149
|
+
email?: string;
|
|
150
|
+
avatarUrl?: string | null;
|
|
151
|
+
avatarUrlDark?: string | null;
|
|
152
|
+
role?: OrgRole;
|
|
153
|
+
joinedAt?: string;
|
|
154
|
+
userCreatedAt?: string;
|
|
67
155
|
}
|
|
68
156
|
/** An invitation to join an organization, as its owners/admins see it. */
|
|
69
157
|
interface OrgInvite {
|
|
70
158
|
id: string;
|
|
71
|
-
email
|
|
72
|
-
role
|
|
159
|
+
email?: string;
|
|
160
|
+
role?: OrgRole;
|
|
73
161
|
/** "expired" invitations stay listed until revoked or re-sent. */
|
|
74
|
-
status
|
|
75
|
-
expiresAt
|
|
76
|
-
createdAt
|
|
162
|
+
status?: OpenString<"pending" | "expired">;
|
|
163
|
+
expiresAt?: string;
|
|
164
|
+
createdAt?: string;
|
|
77
165
|
/** Email of the member who sent it. */
|
|
78
166
|
invitedBy?: string | null;
|
|
79
167
|
}
|
|
80
168
|
/** An invitation addressed to the signed-in user. */
|
|
81
169
|
interface MyInvite {
|
|
82
170
|
id: string;
|
|
83
|
-
role
|
|
84
|
-
expiresAt
|
|
85
|
-
createdAt
|
|
86
|
-
invitedBy
|
|
87
|
-
organization
|
|
171
|
+
role?: OrgRole;
|
|
172
|
+
expiresAt?: string;
|
|
173
|
+
createdAt?: string;
|
|
174
|
+
invitedBy?: string | null;
|
|
175
|
+
organization?: {
|
|
88
176
|
id: string;
|
|
89
|
-
name
|
|
177
|
+
name?: string;
|
|
90
178
|
avatarUrl?: string | null;
|
|
91
179
|
avatarUrlDark?: string | null;
|
|
92
180
|
};
|
|
93
181
|
}
|
|
94
182
|
interface MyInvites {
|
|
95
183
|
/** Invitations can only be accepted once the user's email is verified. */
|
|
96
|
-
emailVerified
|
|
184
|
+
emailVerified?: boolean;
|
|
97
185
|
invites: MyInvite[];
|
|
98
186
|
}
|
|
99
|
-
/** The membership created by accepting an invitation. */
|
|
100
187
|
/** Options for `organizations.acceptInvite`. */
|
|
101
188
|
interface AcceptInviteOptions {
|
|
102
189
|
/**
|
|
@@ -107,30 +194,32 @@ interface AcceptInviteOptions {
|
|
|
107
194
|
*/
|
|
108
195
|
acceptedTerms?: boolean;
|
|
109
196
|
}
|
|
197
|
+
/** The membership created by accepting an invitation. */
|
|
110
198
|
interface InviteAcceptance {
|
|
111
|
-
organizationId
|
|
112
|
-
membershipId
|
|
113
|
-
role
|
|
199
|
+
organizationId?: string;
|
|
200
|
+
membershipId?: string;
|
|
201
|
+
role?: OrgRole;
|
|
114
202
|
}
|
|
115
203
|
interface UserPermissions {
|
|
116
|
-
role
|
|
117
|
-
roleLabel
|
|
118
|
-
roleDescription
|
|
119
|
-
permissions
|
|
204
|
+
role?: OrgRole;
|
|
205
|
+
roleLabel?: string;
|
|
206
|
+
roleDescription?: string;
|
|
207
|
+
permissions?: string[];
|
|
120
208
|
}
|
|
121
209
|
interface ApiKey {
|
|
122
210
|
id: string;
|
|
123
|
-
name
|
|
124
|
-
prefix
|
|
125
|
-
environment
|
|
126
|
-
status
|
|
127
|
-
ipAllowlist
|
|
128
|
-
allowedNetworks
|
|
129
|
-
rateLimit
|
|
130
|
-
dailyLimit
|
|
131
|
-
expiresAt
|
|
132
|
-
|
|
133
|
-
|
|
211
|
+
name?: string;
|
|
212
|
+
prefix?: string;
|
|
213
|
+
environment?: OpenString<"live" | "test">;
|
|
214
|
+
status?: OpenString<"active" | "revoked">;
|
|
215
|
+
ipAllowlist?: string[];
|
|
216
|
+
allowedNetworks?: string[];
|
|
217
|
+
rateLimit?: number | null;
|
|
218
|
+
dailyLimit?: number | null;
|
|
219
|
+
expiresAt?: string | null;
|
|
220
|
+
walletUrlAuth?: boolean;
|
|
221
|
+
lastUsedAt?: string | null;
|
|
222
|
+
createdAt?: string;
|
|
134
223
|
revokedAt?: string | null;
|
|
135
224
|
}
|
|
136
225
|
interface CreateApiKeyRequest {
|
|
@@ -141,6 +230,8 @@ interface CreateApiKeyRequest {
|
|
|
141
230
|
rateLimit?: number;
|
|
142
231
|
dailyLimit?: number;
|
|
143
232
|
expiresAt?: string;
|
|
233
|
+
/** Allow the key as `?key=` in the RPC URL (wallets). Needs exactly one EVM network. */
|
|
234
|
+
walletUrlAuth?: boolean;
|
|
144
235
|
}
|
|
145
236
|
interface UpdateApiKeyRequest {
|
|
146
237
|
name?: string;
|
|
@@ -150,72 +241,90 @@ interface UpdateApiKeyRequest {
|
|
|
150
241
|
dailyLimit?: number | null;
|
|
151
242
|
expiresAt?: string | null;
|
|
152
243
|
}
|
|
244
|
+
/** An API key as returned by create and rotate: the only time the secret is shown. */
|
|
153
245
|
interface ApiKeyWithSecret extends ApiKey {
|
|
246
|
+
/** The full API key. Shown only once. */
|
|
247
|
+
secret: string;
|
|
248
|
+
/** @deprecated Same value as `secret`. Use `secret`. */
|
|
154
249
|
key: string;
|
|
155
250
|
}
|
|
156
251
|
interface ApiKeyAnalytics {
|
|
157
|
-
keyId
|
|
158
|
-
keyName
|
|
159
|
-
keyPrefix
|
|
160
|
-
period
|
|
161
|
-
from
|
|
162
|
-
to
|
|
163
|
-
days
|
|
252
|
+
keyId?: string;
|
|
253
|
+
keyName?: string;
|
|
254
|
+
keyPrefix?: string;
|
|
255
|
+
period?: {
|
|
256
|
+
from?: string;
|
|
257
|
+
to?: string;
|
|
258
|
+
days?: number;
|
|
164
259
|
};
|
|
165
|
-
totals
|
|
166
|
-
requests
|
|
167
|
-
errors
|
|
168
|
-
throttled
|
|
169
|
-
avgLatencyMs
|
|
170
|
-
errorRate
|
|
171
|
-
successRate
|
|
260
|
+
totals?: {
|
|
261
|
+
requests?: Numeric;
|
|
262
|
+
errors?: Numeric;
|
|
263
|
+
throttled?: Numeric;
|
|
264
|
+
avgLatencyMs?: Numeric;
|
|
265
|
+
errorRate?: Numeric;
|
|
266
|
+
successRate?: Numeric;
|
|
172
267
|
};
|
|
173
|
-
dailyData
|
|
174
|
-
date
|
|
175
|
-
requests
|
|
176
|
-
errors
|
|
177
|
-
throttled
|
|
178
|
-
avgLatencyMs
|
|
268
|
+
dailyData?: {
|
|
269
|
+
date?: string;
|
|
270
|
+
requests?: Numeric;
|
|
271
|
+
errors?: Numeric;
|
|
272
|
+
throttled?: Numeric;
|
|
273
|
+
avgLatencyMs?: Numeric;
|
|
179
274
|
}[];
|
|
275
|
+
peakDay?: {
|
|
276
|
+
date?: string;
|
|
277
|
+
requests?: Numeric;
|
|
278
|
+
} | null;
|
|
279
|
+
trends?: {
|
|
280
|
+
requests?: string;
|
|
281
|
+
errors?: string;
|
|
282
|
+
requestsPercent?: Numeric;
|
|
283
|
+
errorsPercent?: Numeric;
|
|
284
|
+
};
|
|
180
285
|
}
|
|
181
|
-
type EndpointRegion = "us_east" | "us_west" | "
|
|
286
|
+
type EndpointRegion = "eu_central" | "us_east" | "us_central" | "us_west" | "uk" | "asia_southeast" | "asia_east" | "australia" | "india" | "eu_west" | "asia_south";
|
|
182
287
|
type EndpointStatus = "active" | "degraded" | "down" | "maintenance";
|
|
183
288
|
type NetworkType = "mainnet" | "testnet";
|
|
184
289
|
interface Network {
|
|
185
290
|
id: string;
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
iconUrl?: string;
|
|
195
|
-
isActive
|
|
291
|
+
type?: OpenString<NetworkType>;
|
|
292
|
+
environment?: string;
|
|
293
|
+
name?: string;
|
|
294
|
+
chainId?: number;
|
|
295
|
+
nativeCurrency?: string;
|
|
296
|
+
nativeCurrencyName?: string;
|
|
297
|
+
nativeCurrencyDecimals?: number;
|
|
298
|
+
blockExplorerUrl?: string | null;
|
|
299
|
+
iconUrl?: string | null;
|
|
300
|
+
isActive?: boolean;
|
|
301
|
+
createdAt?: string;
|
|
302
|
+
updatedAt?: string;
|
|
303
|
+
/** Only on the list call. */
|
|
304
|
+
availableNodes?: number;
|
|
196
305
|
}
|
|
197
306
|
interface Endpoint {
|
|
198
307
|
id: string;
|
|
199
|
-
organizationId
|
|
200
|
-
networkId
|
|
308
|
+
organizationId?: string;
|
|
309
|
+
networkId?: string;
|
|
201
310
|
network?: Network;
|
|
202
|
-
region
|
|
203
|
-
name
|
|
204
|
-
priority
|
|
205
|
-
status
|
|
206
|
-
isEnabled
|
|
207
|
-
rateLimitOverride?: number;
|
|
208
|
-
timeoutMs
|
|
209
|
-
retryCount
|
|
210
|
-
lastHealthCheck?: string;
|
|
211
|
-
healthCheckStatus?:
|
|
212
|
-
avgLatencyMs?:
|
|
213
|
-
successRate?:
|
|
214
|
-
totalRequests?:
|
|
215
|
-
totalErrors?:
|
|
216
|
-
uptime?:
|
|
217
|
-
createdAt
|
|
218
|
-
updatedAt
|
|
311
|
+
region?: OpenString<EndpointRegion>;
|
|
312
|
+
name?: string;
|
|
313
|
+
priority?: number;
|
|
314
|
+
status?: OpenString<EndpointStatus>;
|
|
315
|
+
isEnabled?: boolean;
|
|
316
|
+
rateLimitOverride?: number | null;
|
|
317
|
+
timeoutMs?: number;
|
|
318
|
+
retryCount?: number;
|
|
319
|
+
lastHealthCheck?: string | null;
|
|
320
|
+
healthCheckStatus?: string | null;
|
|
321
|
+
avgLatencyMs?: Numeric | null;
|
|
322
|
+
successRate?: Numeric | null;
|
|
323
|
+
totalRequests?: Numeric;
|
|
324
|
+
totalErrors?: Numeric;
|
|
325
|
+
uptime?: Numeric | null;
|
|
326
|
+
createdAt?: string;
|
|
327
|
+
updatedAt?: string;
|
|
219
328
|
}
|
|
220
329
|
interface CreateEndpointRequest {
|
|
221
330
|
networkId: string;
|
|
@@ -230,185 +339,420 @@ interface UpdateEndpointRequest {
|
|
|
230
339
|
name?: string;
|
|
231
340
|
region?: EndpointRegion;
|
|
232
341
|
priority?: number;
|
|
342
|
+
isEnabled?: boolean;
|
|
233
343
|
timeoutMs?: number;
|
|
234
344
|
retryCount?: number;
|
|
235
345
|
rateLimitOverride?: number;
|
|
236
346
|
}
|
|
347
|
+
/** Answer of `POST .../health-check`. */
|
|
348
|
+
interface EndpointHealthCheck {
|
|
349
|
+
status?: string;
|
|
350
|
+
latencyMs?: Numeric | null;
|
|
351
|
+
checkedAt?: string | null;
|
|
352
|
+
}
|
|
353
|
+
/** Answer of `GET .../health`. */
|
|
354
|
+
interface EndpointHealth {
|
|
355
|
+
endpointId?: string;
|
|
356
|
+
name?: string;
|
|
357
|
+
network?: string;
|
|
358
|
+
region?: string;
|
|
359
|
+
status?: OpenString<"healthy" | "degraded" | "down" | "unknown">;
|
|
360
|
+
nodeCount?: number;
|
|
361
|
+
healthyNodeCount?: number;
|
|
362
|
+
latencyMs?: Numeric | null;
|
|
363
|
+
lastCheck?: string | null;
|
|
364
|
+
successRate?: Numeric | null;
|
|
365
|
+
uptime?: Numeric | null;
|
|
366
|
+
totalRequests?: Numeric;
|
|
367
|
+
totalErrors?: Numeric;
|
|
368
|
+
}
|
|
369
|
+
/** Answer of `GET .../endpoints/summary`. */
|
|
370
|
+
interface EndpointSummary {
|
|
371
|
+
total?: number;
|
|
372
|
+
active?: number;
|
|
373
|
+
degraded?: number;
|
|
374
|
+
down?: number;
|
|
375
|
+
/** Endpoint count keyed by network name. */
|
|
376
|
+
byNetwork?: Record<string, number>;
|
|
377
|
+
/** Endpoint count keyed by region. */
|
|
378
|
+
byRegion?: Record<string, number>;
|
|
379
|
+
totalRequests?: Numeric;
|
|
380
|
+
avgLatencyMs?: Numeric;
|
|
381
|
+
avgSuccessRate?: Numeric;
|
|
382
|
+
}
|
|
237
383
|
interface EndpointMetric {
|
|
238
|
-
id
|
|
239
|
-
endpointId
|
|
240
|
-
timestamp
|
|
241
|
-
requests
|
|
242
|
-
errors
|
|
243
|
-
avgLatencyMs
|
|
244
|
-
p50LatencyMs?:
|
|
245
|
-
p95LatencyMs?:
|
|
246
|
-
p99LatencyMs?:
|
|
247
|
-
throttled
|
|
384
|
+
id?: string;
|
|
385
|
+
endpointId?: string;
|
|
386
|
+
timestamp?: string;
|
|
387
|
+
requests?: Numeric;
|
|
388
|
+
errors?: Numeric;
|
|
389
|
+
avgLatencyMs?: Numeric;
|
|
390
|
+
p50LatencyMs?: Numeric;
|
|
391
|
+
p95LatencyMs?: Numeric;
|
|
392
|
+
p99LatencyMs?: Numeric;
|
|
393
|
+
throttled?: Numeric;
|
|
394
|
+
}
|
|
395
|
+
/** One row of `usage.get`: usage of one key on one day. */
|
|
396
|
+
interface UsageRow {
|
|
397
|
+
date?: string;
|
|
398
|
+
requests?: Numeric;
|
|
399
|
+
errors?: Numeric;
|
|
400
|
+
avgLatencyMs?: Numeric;
|
|
401
|
+
throttled?: Numeric;
|
|
402
|
+
keyName?: string;
|
|
403
|
+
keyPrefix?: string;
|
|
248
404
|
}
|
|
249
405
|
interface UsageSummary {
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
406
|
+
period?: {
|
|
407
|
+
from?: string;
|
|
408
|
+
to?: string;
|
|
409
|
+
};
|
|
410
|
+
totals?: {
|
|
411
|
+
requests?: Numeric;
|
|
412
|
+
errors?: Numeric;
|
|
413
|
+
throttled?: Numeric;
|
|
414
|
+
avgLatencyMs?: Numeric;
|
|
415
|
+
errorRate?: Numeric;
|
|
416
|
+
};
|
|
417
|
+
last7Days?: {
|
|
418
|
+
requests?: Numeric;
|
|
419
|
+
errors?: Numeric;
|
|
420
|
+
};
|
|
421
|
+
dailyAvgRequests?: Numeric;
|
|
422
|
+
byKey?: UsageByKey[];
|
|
423
|
+
dailyData?: DailyUsage[];
|
|
424
|
+
byNetwork?: UsageByNetwork[];
|
|
425
|
+
byRegion?: UsageByRegion[];
|
|
426
|
+
byMethod?: UsageByMethod[];
|
|
427
|
+
quotaForecast?: QuotaForecast;
|
|
428
|
+
}
|
|
429
|
+
interface UsageByKey {
|
|
430
|
+
keyId?: string;
|
|
431
|
+
keyName?: string;
|
|
432
|
+
keyPrefix?: string;
|
|
433
|
+
requests?: Numeric;
|
|
434
|
+
errors?: Numeric;
|
|
435
|
+
throttled?: Numeric;
|
|
257
436
|
}
|
|
258
437
|
interface UsageByNetwork {
|
|
259
|
-
networkId
|
|
260
|
-
networkName
|
|
261
|
-
networkType
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
438
|
+
networkId?: string;
|
|
439
|
+
networkName?: string;
|
|
440
|
+
networkType?: string;
|
|
441
|
+
chainId?: number;
|
|
442
|
+
iconUrl?: string | null;
|
|
443
|
+
requests?: Numeric;
|
|
444
|
+
errors?: Numeric;
|
|
445
|
+
avgLatencyMs?: Numeric;
|
|
446
|
+
latencySum?: Numeric;
|
|
447
|
+
requestCount?: Numeric;
|
|
265
448
|
}
|
|
266
449
|
interface UsageByRegion {
|
|
267
|
-
region
|
|
268
|
-
requests
|
|
269
|
-
errors
|
|
270
|
-
avgLatencyMs
|
|
450
|
+
region?: string;
|
|
451
|
+
requests?: Numeric;
|
|
452
|
+
errors?: Numeric;
|
|
453
|
+
avgLatencyMs?: Numeric;
|
|
454
|
+
latencySum?: Numeric;
|
|
455
|
+
requestCount?: Numeric;
|
|
271
456
|
}
|
|
272
457
|
interface UsageByMethod {
|
|
273
|
-
method
|
|
274
|
-
requests
|
|
275
|
-
errors
|
|
276
|
-
avgLatencyMs
|
|
458
|
+
method?: string;
|
|
459
|
+
requests?: Numeric;
|
|
460
|
+
errors?: Numeric;
|
|
461
|
+
avgLatencyMs?: Numeric;
|
|
462
|
+
latencySum?: Numeric;
|
|
463
|
+
requestCount?: Numeric;
|
|
277
464
|
}
|
|
278
465
|
interface DailyUsage {
|
|
279
|
-
date
|
|
280
|
-
requests
|
|
281
|
-
errors
|
|
282
|
-
|
|
466
|
+
date?: string;
|
|
467
|
+
requests?: Numeric;
|
|
468
|
+
errors?: Numeric;
|
|
469
|
+
throttled?: Numeric;
|
|
470
|
+
avgLatencyMs?: Numeric;
|
|
471
|
+
}
|
|
472
|
+
interface QuotaForecast {
|
|
473
|
+
hasQuota?: boolean;
|
|
474
|
+
unlimited?: boolean;
|
|
475
|
+
monthlyQuota?: Numeric;
|
|
476
|
+
usedThisMonth?: Numeric;
|
|
477
|
+
remainingQuota?: Numeric;
|
|
478
|
+
usagePercentage?: Numeric;
|
|
479
|
+
dailyAverage?: Numeric;
|
|
480
|
+
daysRemainingInMonth?: Numeric;
|
|
481
|
+
daysUntilExhaustion?: Numeric | null;
|
|
482
|
+
projectedUsage?: Numeric;
|
|
483
|
+
projectedPercentage?: Numeric;
|
|
484
|
+
status?: string;
|
|
283
485
|
}
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
activeEndpoints: number;
|
|
486
|
+
/**
|
|
487
|
+
* Dashboard time range. The API values are `last_hour`, `last_24_hours`
|
|
488
|
+
* (default), `last_7_days`, `last_30_days` and `custom` (needs `from` and
|
|
489
|
+
* `to`). The short forms `1h`, `24h`, `7d` and `30d` are translated.
|
|
490
|
+
*/
|
|
491
|
+
type DashboardTimeRange = "last_hour" | "last_24_hours" | "last_7_days" | "last_30_days" | "custom" | "1h" | "24h" | "7d" | "30d";
|
|
492
|
+
/** ISO 8601 dates for `timeRange: "custom"`. */
|
|
493
|
+
interface CustomRange {
|
|
494
|
+
from?: string;
|
|
495
|
+
to?: string;
|
|
295
496
|
}
|
|
296
497
|
interface DataPoint {
|
|
297
|
-
timestamp
|
|
298
|
-
value
|
|
498
|
+
timestamp?: string;
|
|
499
|
+
value?: Numeric;
|
|
500
|
+
}
|
|
501
|
+
interface ServiceStatus {
|
|
502
|
+
status?: string;
|
|
503
|
+
latency?: Numeric;
|
|
299
504
|
}
|
|
505
|
+
interface EndpointHealthEntry {
|
|
506
|
+
endpoint?: string;
|
|
507
|
+
status?: string;
|
|
508
|
+
latency?: Numeric;
|
|
509
|
+
uptime?: Numeric;
|
|
510
|
+
lastCheck?: string | null;
|
|
511
|
+
}
|
|
512
|
+
/** Answer of `dashboard.getHealth` (also `DashboardData.health`). */
|
|
300
513
|
interface HealthStatus {
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
514
|
+
overallStatus?: string;
|
|
515
|
+
database?: ServiceStatus;
|
|
516
|
+
redis?: ServiceStatus;
|
|
517
|
+
endpoints?: EndpointHealthEntry[];
|
|
518
|
+
timestamp?: string;
|
|
519
|
+
}
|
|
520
|
+
interface QuickStats {
|
|
521
|
+
totalRequests?: Numeric;
|
|
522
|
+
totalErrors?: Numeric;
|
|
523
|
+
avgLatency?: Numeric;
|
|
524
|
+
activeKeys?: Numeric;
|
|
525
|
+
quotaUsed?: Numeric;
|
|
526
|
+
quotaLimit?: Numeric;
|
|
527
|
+
quotaPercentage?: Numeric;
|
|
528
|
+
quotaPeriodStart?: string;
|
|
529
|
+
quotaPeriodEnd?: string;
|
|
530
|
+
quotaUnmetered?: boolean;
|
|
531
|
+
quotaMode?: string;
|
|
532
|
+
quotaLabel?: string | null;
|
|
533
|
+
overageEnabled?: boolean;
|
|
534
|
+
overageRatePer1k?: Numeric;
|
|
535
|
+
overageRequests?: Numeric;
|
|
536
|
+
overageCapUsd?: Numeric;
|
|
537
|
+
hardLimitRequests?: Numeric;
|
|
538
|
+
}
|
|
539
|
+
interface RequestRate {
|
|
540
|
+
currentRate?: Numeric;
|
|
541
|
+
avgRate?: Numeric;
|
|
542
|
+
peakRate?: Numeric;
|
|
543
|
+
totalRequests?: Numeric;
|
|
544
|
+
trend?: string;
|
|
545
|
+
trendPercent?: Numeric;
|
|
546
|
+
timeSeries?: DataPoint[];
|
|
547
|
+
}
|
|
548
|
+
interface ErrorRate {
|
|
549
|
+
currentErrorRate?: Numeric;
|
|
550
|
+
avgErrorRate?: Numeric;
|
|
551
|
+
totalErrors?: Numeric;
|
|
552
|
+
trend?: string;
|
|
553
|
+
trendPercent?: Numeric;
|
|
554
|
+
timeSeries?: DataPoint[];
|
|
555
|
+
topErrors?: {
|
|
556
|
+
code?: string;
|
|
557
|
+
count?: Numeric;
|
|
558
|
+
percentage?: Numeric;
|
|
306
559
|
}[];
|
|
307
560
|
}
|
|
308
|
-
|
|
561
|
+
interface LatencyStats {
|
|
562
|
+
currentLatency?: Numeric;
|
|
563
|
+
avgLatency?: Numeric;
|
|
564
|
+
p50?: Numeric;
|
|
565
|
+
p95?: Numeric;
|
|
566
|
+
p99?: Numeric;
|
|
567
|
+
trend?: string;
|
|
568
|
+
trendPercent?: Numeric;
|
|
569
|
+
timeSeries?: DataPoint[];
|
|
570
|
+
}
|
|
571
|
+
/** Answer of `dashboard.getPerformance`. Sub-objects vary, so they are loosely typed. */
|
|
572
|
+
interface PerformanceStats {
|
|
573
|
+
latency?: LatencyStats;
|
|
574
|
+
cache?: Record<string, unknown>;
|
|
575
|
+
saturation?: Record<string, unknown>;
|
|
576
|
+
failover?: Record<string, unknown>;
|
|
577
|
+
timestamp?: string;
|
|
578
|
+
}
|
|
579
|
+
interface DashboardData {
|
|
580
|
+
health?: HealthStatus;
|
|
581
|
+
quickStats?: QuickStats;
|
|
582
|
+
requestRate?: RequestRate;
|
|
583
|
+
errorRate?: ErrorRate;
|
|
584
|
+
latency?: LatencyStats;
|
|
585
|
+
alerts?: {
|
|
586
|
+
alerts?: Alert[];
|
|
587
|
+
unacknowledgedCount?: Numeric;
|
|
588
|
+
criticalCount?: Numeric;
|
|
589
|
+
};
|
|
590
|
+
}
|
|
591
|
+
type AlertSeverity = "info" | "warning" | "error" | "critical";
|
|
309
592
|
type AlertStatus = "active" | "acknowledged" | "resolved";
|
|
310
|
-
type
|
|
311
|
-
type
|
|
593
|
+
type AlertRuleType = "high_error_rate" | "high_latency" | "rate_limit_exceeded" | "quota_warning" | "service_down" | "key_expiring" | "unusual_traffic";
|
|
594
|
+
type AlertChannelType = "email" | "webhook" | "slack";
|
|
312
595
|
interface Alert {
|
|
313
596
|
id: string;
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
597
|
+
ruleId?: string;
|
|
598
|
+
ruleName?: string;
|
|
599
|
+
type?: OpenString<AlertRuleType>;
|
|
600
|
+
severity?: OpenString<AlertSeverity>;
|
|
601
|
+
status?: OpenString<AlertStatus>;
|
|
602
|
+
title?: string;
|
|
603
|
+
message?: string;
|
|
604
|
+
metadata?: Record<string, unknown> | null;
|
|
605
|
+
firedAt?: string;
|
|
606
|
+
acknowledgedAt?: string | null;
|
|
607
|
+
resolvedAt?: string | null;
|
|
608
|
+
}
|
|
609
|
+
/**
|
|
610
|
+
* What `GET .../alerts` answers. `alerts.list` returns only the `alerts`
|
|
611
|
+
* array of it; the counters are available through `alerts.overview`.
|
|
612
|
+
*/
|
|
613
|
+
interface AlertsOverview {
|
|
614
|
+
alerts: Alert[];
|
|
615
|
+
total?: number;
|
|
616
|
+
activeCount?: number;
|
|
617
|
+
acknowledgedCount?: number;
|
|
618
|
+
criticalCount?: number;
|
|
619
|
+
rules?: AlertRule[];
|
|
620
|
+
channels?: AlertChannel[];
|
|
324
621
|
}
|
|
325
622
|
interface AlertRule {
|
|
326
623
|
id: string;
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
createdAt: string;
|
|
337
|
-
updatedAt: string;
|
|
624
|
+
name?: string;
|
|
625
|
+
type?: OpenString<AlertRuleType>;
|
|
626
|
+
severity?: OpenString<AlertSeverity>;
|
|
627
|
+
isEnabled?: boolean;
|
|
628
|
+
/** Rule settings; the keys depend on `type`, e.g. `{ threshold: 5 }`. */
|
|
629
|
+
config?: Record<string, unknown>;
|
|
630
|
+
cooldownSeconds?: number;
|
|
631
|
+
createdAt?: string;
|
|
632
|
+
updatedAt?: string;
|
|
338
633
|
}
|
|
339
634
|
interface CreateAlertRuleRequest {
|
|
340
635
|
name: string;
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
636
|
+
type: AlertRuleType;
|
|
637
|
+
config: Record<string, unknown>;
|
|
638
|
+
severity?: AlertSeverity;
|
|
639
|
+
/** At least 60. */
|
|
640
|
+
cooldownSeconds?: number;
|
|
641
|
+
isEnabled?: boolean;
|
|
642
|
+
}
|
|
643
|
+
/** Update body: `type` cannot be changed. */
|
|
644
|
+
interface UpdateAlertRuleRequest {
|
|
645
|
+
name?: string;
|
|
646
|
+
config?: Record<string, unknown>;
|
|
647
|
+
severity?: AlertSeverity;
|
|
648
|
+
cooldownSeconds?: number;
|
|
649
|
+
isEnabled?: boolean;
|
|
347
650
|
}
|
|
348
651
|
interface AlertChannel {
|
|
349
652
|
id: string;
|
|
350
|
-
|
|
351
|
-
type
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
createdAt
|
|
653
|
+
name?: string;
|
|
654
|
+
type?: OpenString<AlertChannelType>;
|
|
655
|
+
isEnabled?: boolean;
|
|
656
|
+
/** email: `{ recipients }`, webhook: `{ url, secret? }`, slack: `{ webhookUrl }`. */
|
|
657
|
+
config?: Record<string, unknown>;
|
|
658
|
+
createdAt?: string;
|
|
659
|
+
updatedAt?: string;
|
|
356
660
|
}
|
|
357
661
|
interface CreateAlertChannelRequest {
|
|
358
|
-
type: "email" | "webhook" | "slack";
|
|
359
662
|
name: string;
|
|
663
|
+
type: AlertChannelType;
|
|
360
664
|
config: Record<string, unknown>;
|
|
665
|
+
isEnabled?: boolean;
|
|
666
|
+
}
|
|
667
|
+
/** Update body: `type` cannot be changed. */
|
|
668
|
+
interface UpdateAlertChannelRequest {
|
|
669
|
+
name?: string;
|
|
670
|
+
config?: Record<string, unknown>;
|
|
671
|
+
isEnabled?: boolean;
|
|
672
|
+
}
|
|
673
|
+
interface TestChannelResult {
|
|
674
|
+
success?: boolean;
|
|
675
|
+
message?: string;
|
|
361
676
|
}
|
|
362
677
|
type LogStatus = "success" | "error" | "timeout" | "throttled";
|
|
363
678
|
interface RequestLog {
|
|
364
679
|
id: string;
|
|
365
|
-
|
|
366
|
-
apiKeyId?: string;
|
|
367
|
-
apiKeyPrefix?: string;
|
|
368
|
-
method: string;
|
|
680
|
+
method?: string;
|
|
369
681
|
path?: string;
|
|
370
682
|
network?: string;
|
|
371
|
-
region?: string;
|
|
372
|
-
status
|
|
373
|
-
statusCode?: number;
|
|
374
|
-
latencyMs?:
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
errorMessage?: string;
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
683
|
+
region?: string | null;
|
|
684
|
+
status?: OpenString<LogStatus>;
|
|
685
|
+
statusCode?: number | null;
|
|
686
|
+
latencyMs?: Numeric;
|
|
687
|
+
responseSize?: Numeric | null;
|
|
688
|
+
errorCode?: string | null;
|
|
689
|
+
errorMessage?: string | null;
|
|
690
|
+
apiKeyId?: string | null;
|
|
691
|
+
apiKeyPrefix?: string | null;
|
|
692
|
+
ipAddress?: string | null;
|
|
693
|
+
userAgent?: string | null;
|
|
694
|
+
requestBody?: unknown;
|
|
695
|
+
responseBody?: unknown;
|
|
696
|
+
timestamp?: string;
|
|
697
|
+
}
|
|
698
|
+
interface LogStats {
|
|
699
|
+
totalRequests?: Numeric;
|
|
700
|
+
successCount?: Numeric;
|
|
701
|
+
errorCount?: Numeric;
|
|
702
|
+
timeoutCount?: Numeric;
|
|
703
|
+
throttledCount?: Numeric;
|
|
704
|
+
avgLatencyMs?: Numeric;
|
|
705
|
+
p50LatencyMs?: Numeric;
|
|
706
|
+
p95LatencyMs?: Numeric;
|
|
707
|
+
p99LatencyMs?: Numeric;
|
|
708
|
+
/** Percentage, 0-100. */
|
|
709
|
+
errorRate?: Numeric;
|
|
710
|
+
topMethods?: {
|
|
711
|
+
method?: string;
|
|
712
|
+
count?: Numeric;
|
|
713
|
+
}[];
|
|
714
|
+
topErrors?: {
|
|
715
|
+
errorCode?: string;
|
|
716
|
+
count?: Numeric;
|
|
717
|
+
message?: string;
|
|
718
|
+
}[];
|
|
719
|
+
statusBreakdown?: {
|
|
720
|
+
status?: string;
|
|
721
|
+
count?: Numeric;
|
|
722
|
+
}[];
|
|
381
723
|
}
|
|
382
724
|
interface LogsResponse {
|
|
383
725
|
logs: RequestLog[];
|
|
384
|
-
total
|
|
385
|
-
|
|
386
|
-
pageSize: number;
|
|
387
|
-
totalPages: number;
|
|
726
|
+
total?: number;
|
|
727
|
+
stats?: LogStats;
|
|
388
728
|
}
|
|
389
729
|
interface LogFilterOptions {
|
|
390
|
-
methods
|
|
391
|
-
networks
|
|
392
|
-
regions
|
|
393
|
-
apiKeys
|
|
730
|
+
methods?: string[];
|
|
731
|
+
networks?: string[];
|
|
732
|
+
regions?: string[];
|
|
733
|
+
apiKeys?: {
|
|
394
734
|
id: string;
|
|
395
|
-
name
|
|
396
|
-
prefix
|
|
735
|
+
name?: string;
|
|
736
|
+
prefix?: string;
|
|
397
737
|
}[];
|
|
398
738
|
}
|
|
399
739
|
interface LogQueryParams {
|
|
400
|
-
|
|
401
|
-
|
|
740
|
+
/** 1-200. */
|
|
741
|
+
limit?: number;
|
|
742
|
+
offset?: number;
|
|
402
743
|
status?: LogStatus;
|
|
403
744
|
method?: string;
|
|
745
|
+
apiKeyId?: string;
|
|
404
746
|
network?: string;
|
|
405
747
|
region?: string;
|
|
406
|
-
apiKeyId?: string;
|
|
407
748
|
search?: string;
|
|
749
|
+
statusCode?: number;
|
|
750
|
+
minLatencyMs?: number;
|
|
751
|
+
maxLatencyMs?: number;
|
|
752
|
+
/** ISO 8601 date. */
|
|
408
753
|
from?: string;
|
|
754
|
+
/** ISO 8601 date. */
|
|
409
755
|
to?: string;
|
|
410
|
-
minLatency?: number;
|
|
411
|
-
maxLatency?: number;
|
|
412
756
|
sortBy?: "timestamp" | "latencyMs" | "statusCode";
|
|
413
757
|
sortOrder?: "asc" | "desc";
|
|
414
758
|
}
|
|
@@ -420,34 +764,85 @@ interface ChangePlanOptions {
|
|
|
420
764
|
*/
|
|
421
765
|
acceptedTerms: boolean;
|
|
422
766
|
}
|
|
767
|
+
interface SubscriptionPlan {
|
|
768
|
+
id: string;
|
|
769
|
+
name?: string;
|
|
770
|
+
displayName?: string;
|
|
771
|
+
price?: Numeric;
|
|
772
|
+
priceMonthly?: Numeric;
|
|
773
|
+
priceAnnual?: Numeric | null;
|
|
774
|
+
limits?: PlanLimits;
|
|
775
|
+
features?: string[];
|
|
776
|
+
}
|
|
423
777
|
interface Subscription {
|
|
424
778
|
id: string;
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
currentPeriodStart
|
|
429
|
-
currentPeriodEnd
|
|
430
|
-
|
|
431
|
-
|
|
779
|
+
plan?: SubscriptionPlan;
|
|
780
|
+
status?: OpenString<"active" | "cancelled" | "past_due" | "trialing">;
|
|
781
|
+
billingInterval?: string;
|
|
782
|
+
currentPeriodStart?: string;
|
|
783
|
+
currentPeriodEnd?: string;
|
|
784
|
+
usagePeriod?: {
|
|
785
|
+
start?: string;
|
|
786
|
+
end?: string;
|
|
787
|
+
};
|
|
788
|
+
cancelAtPeriodEnd?: boolean;
|
|
789
|
+
trialStart?: string | null;
|
|
790
|
+
trialEnd?: string | null;
|
|
791
|
+
recentInvoices?: Invoice[];
|
|
792
|
+
}
|
|
793
|
+
/** Answer of `subscriptions.changePlan`. */
|
|
794
|
+
interface ChangePlanResult {
|
|
795
|
+
message?: string;
|
|
796
|
+
subscription?: {
|
|
797
|
+
id: string;
|
|
798
|
+
plan?: {
|
|
799
|
+
id: string;
|
|
800
|
+
name?: string;
|
|
801
|
+
displayName?: string;
|
|
802
|
+
price?: Numeric;
|
|
803
|
+
};
|
|
804
|
+
billingInterval?: string;
|
|
805
|
+
status?: string;
|
|
806
|
+
};
|
|
807
|
+
}
|
|
808
|
+
/** Answer of `subscriptions.cancel`. */
|
|
809
|
+
interface CancelSubscriptionResult {
|
|
810
|
+
message?: string;
|
|
811
|
+
cancelAt?: string;
|
|
812
|
+
accessEndsAt?: string;
|
|
813
|
+
pendingOverageEstimate?: Numeric;
|
|
814
|
+
currency?: string;
|
|
432
815
|
}
|
|
433
816
|
interface Plan {
|
|
434
817
|
id: string;
|
|
435
|
-
name
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
818
|
+
name?: string;
|
|
819
|
+
tier?: string;
|
|
820
|
+
displayName?: string;
|
|
821
|
+
description?: string;
|
|
822
|
+
priceMonthly?: Numeric;
|
|
823
|
+
priceAnnual?: Numeric | null;
|
|
824
|
+
stripePriceId?: string | null;
|
|
825
|
+
stripePriceIdAnnual?: string | null;
|
|
826
|
+
paddlePriceId?: string | null;
|
|
827
|
+
paddlePriceIdAnnual?: string | null;
|
|
828
|
+
contactSalesOnly?: boolean;
|
|
829
|
+
limits?: PlanLimits;
|
|
830
|
+
features?: string[];
|
|
831
|
+
isActive?: boolean;
|
|
832
|
+
annualAvailable?: boolean;
|
|
833
|
+
createdAt?: string;
|
|
834
|
+
updatedAt?: string;
|
|
443
835
|
}
|
|
444
836
|
interface PlanLimits {
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
837
|
+
rps?: Numeric;
|
|
838
|
+
burst?: Numeric;
|
|
839
|
+
concurrency?: Numeric;
|
|
840
|
+
monthlyRequests?: Numeric;
|
|
841
|
+
overageEnabled?: boolean;
|
|
842
|
+
overageRatePer1k?: Numeric;
|
|
843
|
+
overageCapUsd?: Numeric;
|
|
844
|
+
overageRequestsAllowed?: Numeric;
|
|
845
|
+
dedicated?: boolean;
|
|
451
846
|
/**
|
|
452
847
|
* Limits sold as something other than a plain number, keyed by the API's
|
|
453
848
|
* limit name (`rps`, `concurrency`, `maxApiKeys`, `monthlyRequests`,
|
|
@@ -465,39 +860,70 @@ type PlanLimitMode = "unlimited" | "custom";
|
|
|
465
860
|
type PlanLimitKey = "rps" | "concurrency" | "maxApiKeys" | "monthlyRequests" | "overageRatePer1k" | "overageCapUsd";
|
|
466
861
|
interface Invoice {
|
|
467
862
|
id: string;
|
|
468
|
-
amount
|
|
469
|
-
currency
|
|
470
|
-
status
|
|
471
|
-
periodStart
|
|
472
|
-
periodEnd
|
|
473
|
-
paidAt?: string;
|
|
474
|
-
createdAt
|
|
863
|
+
amount?: Numeric;
|
|
864
|
+
currency?: string;
|
|
865
|
+
status?: string;
|
|
866
|
+
periodStart?: string;
|
|
867
|
+
periodEnd?: string;
|
|
868
|
+
paidAt?: string | null;
|
|
869
|
+
createdAt?: string;
|
|
475
870
|
}
|
|
476
871
|
type TicketPriority = "low" | "medium" | "high" | "urgent";
|
|
477
|
-
type TicketStatus = "open" | "in_progress" | "
|
|
478
|
-
type TicketCategory = "billing" | "technical" | "
|
|
872
|
+
type TicketStatus = "open" | "in_progress" | "waiting_on_customer" | "resolved" | "closed";
|
|
873
|
+
type TicketCategory = "general" | "billing" | "technical" | "api_keys" | "endpoints" | "performance" | "security" | "feature_request" | "bug_report";
|
|
874
|
+
interface TicketAuthor {
|
|
875
|
+
id: string;
|
|
876
|
+
email?: string;
|
|
877
|
+
}
|
|
878
|
+
interface TicketMessage {
|
|
879
|
+
id: string;
|
|
880
|
+
ticketId?: string;
|
|
881
|
+
authorId?: string;
|
|
882
|
+
body?: string;
|
|
883
|
+
isStaff?: boolean;
|
|
884
|
+
createdAt?: string;
|
|
885
|
+
author?: TicketAuthor;
|
|
886
|
+
}
|
|
479
887
|
interface SupportTicket {
|
|
480
888
|
id: string;
|
|
481
|
-
organizationId
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
889
|
+
organizationId?: string;
|
|
890
|
+
createdById?: string;
|
|
891
|
+
assignedToId?: string | null;
|
|
892
|
+
subject?: string;
|
|
893
|
+
category?: OpenString<TicketCategory>;
|
|
894
|
+
priority?: OpenString<TicketPriority>;
|
|
895
|
+
status?: OpenString<TicketStatus>;
|
|
896
|
+
closedAt?: string | null;
|
|
897
|
+
createdAt?: string;
|
|
898
|
+
updatedAt?: string;
|
|
899
|
+
createdBy?: TicketAuthor;
|
|
900
|
+
/** On create and get only. */
|
|
901
|
+
messages?: TicketMessage[];
|
|
902
|
+
/** On list and status update only. */
|
|
903
|
+
_count?: {
|
|
904
|
+
messages?: number;
|
|
905
|
+
};
|
|
488
906
|
}
|
|
489
907
|
interface CreateTicketRequest {
|
|
908
|
+
/** 5-200 characters. */
|
|
490
909
|
subject: string;
|
|
491
|
-
message
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
910
|
+
/** The first message, 10-5000 characters. */
|
|
911
|
+
body: string;
|
|
912
|
+
category?: TicketCategory;
|
|
913
|
+
priority?: TicketPriority;
|
|
914
|
+
}
|
|
915
|
+
interface TicketStats {
|
|
916
|
+
open?: number;
|
|
917
|
+
inProgress?: number;
|
|
918
|
+
waitingOnCustomer?: number;
|
|
919
|
+
resolved?: number;
|
|
920
|
+
closed?: number;
|
|
921
|
+
total?: number;
|
|
922
|
+
}
|
|
923
|
+
/** What `GET .../support/tickets` answers; `support.listTickets` returns only `tickets`. */
|
|
924
|
+
interface TicketList {
|
|
925
|
+
tickets: SupportTicket[];
|
|
926
|
+
total?: number;
|
|
501
927
|
}
|
|
502
928
|
interface IteradianConfig {
|
|
503
929
|
/** Base URL of the Iteradian control-plane API (default: https://api.iteradian.com/api/v1) */
|
|
@@ -639,36 +1065,40 @@ declare class AuthResource {
|
|
|
639
1065
|
* has ticked the agreement.
|
|
640
1066
|
*/
|
|
641
1067
|
register(data: RegisterRequest): Promise<RegisterResponse>;
|
|
642
|
-
/**
|
|
643
|
-
|
|
1068
|
+
/**
|
|
1069
|
+
* Login with email/password (optionally with a 2FA code or a backup code).
|
|
1070
|
+
*
|
|
1071
|
+
* When two-factor auth is on and no code was sent, the API answers
|
|
1072
|
+
* `{ requires2FA: true }` with no tokens. Check `requires2FA` and call
|
|
1073
|
+
* again with `twoFactorCode` or `backupCode`. The stored access token is
|
|
1074
|
+
* only replaced when the answer carries one.
|
|
1075
|
+
*/
|
|
1076
|
+
login(data: LoginRequest): Promise<LoginResult>;
|
|
1077
|
+
private storeToken;
|
|
644
1078
|
/** Logout current session */
|
|
645
1079
|
logout(): Promise<void>;
|
|
646
1080
|
/** Refresh the access token */
|
|
647
1081
|
refresh(refreshToken: string): Promise<AuthTokens>;
|
|
648
1082
|
/** Verify email with token */
|
|
649
|
-
verifyEmail(token: string): Promise<
|
|
1083
|
+
verifyEmail(token: string): Promise<MessageResponse>;
|
|
650
1084
|
/** Resend email verification */
|
|
651
|
-
resendVerification(email: string): Promise<
|
|
1085
|
+
resendVerification(email: string): Promise<MessageResponse>;
|
|
652
1086
|
/** Request password reset email */
|
|
653
|
-
forgotPassword(email: string): Promise<
|
|
1087
|
+
forgotPassword(email: string): Promise<MessageResponse>;
|
|
654
1088
|
/** Reset password with token */
|
|
655
|
-
resetPassword(token: string, newPassword: string): Promise<
|
|
1089
|
+
resetPassword(token: string, newPassword: string): Promise<MessageResponse>;
|
|
656
1090
|
/** Request a magic login link */
|
|
657
|
-
requestMagicLink(email: string): Promise<
|
|
1091
|
+
requestMagicLink(email: string): Promise<MessageResponse>;
|
|
658
1092
|
/** Login via magic link token */
|
|
659
|
-
loginWithMagicLink(token: string): Promise<
|
|
1093
|
+
loginWithMagicLink(token: string): Promise<LoginResult>;
|
|
660
1094
|
/** Enable 2FA – returns QR code image and secret */
|
|
661
1095
|
enable2FA(password: string): Promise<TwoFASetup>;
|
|
662
1096
|
/** Verify 2FA setup with code from authenticator app */
|
|
663
|
-
verify2FA(code: string): Promise<
|
|
664
|
-
backupCodes: string[];
|
|
665
|
-
}>;
|
|
1097
|
+
verify2FA(code: string): Promise<BackupCodes>;
|
|
666
1098
|
/** Disable 2FA */
|
|
667
|
-
disable2FA(password: string, code: string): Promise<
|
|
1099
|
+
disable2FA(password: string, code: string): Promise<MessageResponse>;
|
|
668
1100
|
/** Regenerate backup codes */
|
|
669
|
-
regenerateBackupCodes(password: string): Promise<
|
|
670
|
-
backupCodes: string[];
|
|
671
|
-
}>;
|
|
1101
|
+
regenerateBackupCodes(password: string): Promise<BackupCodes>;
|
|
672
1102
|
}
|
|
673
1103
|
|
|
674
1104
|
declare class OrganizationsResource {
|
|
@@ -676,22 +1106,20 @@ declare class OrganizationsResource {
|
|
|
676
1106
|
constructor(http: HttpClient);
|
|
677
1107
|
/** List organizations the current user belongs to */
|
|
678
1108
|
list(): Promise<Organization[]>;
|
|
679
|
-
/**
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
1109
|
+
/**
|
|
1110
|
+
* Create a new organization. `name`, `planId` and `acceptedTerms` are
|
|
1111
|
+
* required by the API; pass `acceptedTerms: true` only after the user
|
|
1112
|
+
* agreed to the terms.
|
|
1113
|
+
*/
|
|
1114
|
+
create(data: CreateOrganizationRequest): Promise<Organization>;
|
|
684
1115
|
/** Get organization details */
|
|
685
1116
|
get(orgId: string): Promise<Organization>;
|
|
686
1117
|
/** Update an organization */
|
|
687
|
-
update(orgId: string, data:
|
|
688
|
-
name?: string;
|
|
689
|
-
slug?: string;
|
|
690
|
-
}): Promise<Organization>;
|
|
1118
|
+
update(orgId: string, data: UpdateOrganizationRequest): Promise<Organization>;
|
|
691
1119
|
/** Delete an organization */
|
|
692
|
-
delete(orgId: string): Promise<void>;
|
|
1120
|
+
delete(orgId: string): Promise<MessageResponse | void>;
|
|
693
1121
|
/** Leave an organization */
|
|
694
|
-
leave(orgId: string): Promise<void>;
|
|
1122
|
+
leave(orgId: string): Promise<MessageResponse | void>;
|
|
695
1123
|
/** List organization members */
|
|
696
1124
|
listMembers(orgId: string): Promise<OrgMember[]>;
|
|
697
1125
|
/**
|
|
@@ -701,14 +1129,12 @@ declare class OrganizationsResource {
|
|
|
701
1129
|
*/
|
|
702
1130
|
inviteMember(orgId: string, data: {
|
|
703
1131
|
email: string;
|
|
704
|
-
role:
|
|
1132
|
+
role: OrgRole;
|
|
705
1133
|
}): Promise<OrgInvite>;
|
|
706
1134
|
/** Open invitations of the organization (owner/admin) */
|
|
707
1135
|
listInvites(orgId: string): Promise<OrgInvite[]>;
|
|
708
1136
|
/** Revoke an open invitation (owner/admin) */
|
|
709
|
-
revokeInvite(orgId: string, inviteId: string): Promise<
|
|
710
|
-
message: string;
|
|
711
|
-
}>;
|
|
1137
|
+
revokeInvite(orgId: string, inviteId: string): Promise<MessageResponse>;
|
|
712
1138
|
/** Invitations addressed to the signed-in user */
|
|
713
1139
|
listMyInvites(): Promise<MyInvites>;
|
|
714
1140
|
/**
|
|
@@ -722,13 +1148,11 @@ declare class OrganizationsResource {
|
|
|
722
1148
|
*/
|
|
723
1149
|
acceptInvite(inviteId: string, options?: AcceptInviteOptions): Promise<InviteAcceptance>;
|
|
724
1150
|
/** Decline an invitation addressed to the signed-in user */
|
|
725
|
-
declineInvite(inviteId: string): Promise<
|
|
726
|
-
message: string;
|
|
727
|
-
}>;
|
|
1151
|
+
declineInvite(inviteId: string): Promise<MessageResponse>;
|
|
728
1152
|
/** Update a member's role */
|
|
729
|
-
updateMemberRole(orgId: string, memberId: string, role:
|
|
1153
|
+
updateMemberRole(orgId: string, memberId: string, role: OrgRole): Promise<OrgMember>;
|
|
730
1154
|
/** Remove a member from the organization */
|
|
731
|
-
removeMember(orgId: string, memberId: string): Promise<void>;
|
|
1155
|
+
removeMember(orgId: string, memberId: string): Promise<MessageResponse | void>;
|
|
732
1156
|
/** Get current user's permissions in the organization */
|
|
733
1157
|
getMyPermissions(orgId: string): Promise<UserPermissions>;
|
|
734
1158
|
}
|
|
@@ -740,13 +1164,19 @@ declare class ApiKeysResource {
|
|
|
740
1164
|
list(orgId: string): Promise<ApiKey[]>;
|
|
741
1165
|
/** Get a specific API key */
|
|
742
1166
|
get(orgId: string, keyId: string): Promise<ApiKey>;
|
|
743
|
-
/**
|
|
1167
|
+
/**
|
|
1168
|
+
* Create a new API key. The full key comes back once, in `secret`
|
|
1169
|
+
* (`key` is a deprecated alias with the same value).
|
|
1170
|
+
*/
|
|
744
1171
|
create(orgId: string, data: CreateApiKeyRequest): Promise<ApiKeyWithSecret>;
|
|
745
1172
|
/** Update an API key */
|
|
746
1173
|
update(orgId: string, keyId: string, data: UpdateApiKeyRequest): Promise<ApiKey>;
|
|
747
1174
|
/** Revoke (delete) an API key */
|
|
748
|
-
revoke(orgId: string, keyId: string): Promise<
|
|
749
|
-
/**
|
|
1175
|
+
revoke(orgId: string, keyId: string): Promise<MessageResponse>;
|
|
1176
|
+
/**
|
|
1177
|
+
* Rotate an API key (revoke old, create new). The new full key is in
|
|
1178
|
+
* `secret`; `key` is a deprecated alias.
|
|
1179
|
+
*/
|
|
750
1180
|
rotate(orgId: string, keyId: string): Promise<ApiKeyWithSecret>;
|
|
751
1181
|
/** Get analytics for an API key */
|
|
752
1182
|
getAnalytics(orgId: string, keyId: string, timeRange?: "1d" | "7d" | "30d" | "90d"): Promise<ApiKeyAnalytics>;
|
|
@@ -768,32 +1198,34 @@ declare class EndpointsResource {
|
|
|
768
1198
|
/** Update an endpoint */
|
|
769
1199
|
update(orgId: string, endpointId: string, data: UpdateEndpointRequest): Promise<Endpoint>;
|
|
770
1200
|
/** Delete an endpoint */
|
|
771
|
-
delete(orgId: string, endpointId: string): Promise<
|
|
1201
|
+
delete(orgId: string, endpointId: string): Promise<MessageResponse>;
|
|
772
1202
|
/** Pause an endpoint */
|
|
773
1203
|
pause(orgId: string, endpointId: string): Promise<Endpoint>;
|
|
774
1204
|
/** Resume an endpoint */
|
|
775
1205
|
resume(orgId: string, endpointId: string): Promise<Endpoint>;
|
|
776
|
-
/** Trigger a health check */
|
|
777
|
-
checkHealth(orgId: string, endpointId: string): Promise<
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
}>;
|
|
1206
|
+
/** Trigger a health check (POST .../health-check) */
|
|
1207
|
+
checkHealth(orgId: string, endpointId: string): Promise<EndpointHealthCheck>;
|
|
1208
|
+
/** Get the current health of an endpoint (GET .../health) */
|
|
1209
|
+
getHealth(orgId: string, endpointId: string): Promise<EndpointHealth>;
|
|
781
1210
|
/** Get endpoint health summary */
|
|
782
|
-
getHealthOverview(orgId: string): Promise<
|
|
1211
|
+
getHealthOverview(orgId: string): Promise<EndpointSummary>;
|
|
783
1212
|
/** Get endpoint metrics */
|
|
784
1213
|
getMetrics(orgId: string, endpointId: string, from?: string, to?: string): Promise<EndpointMetric[]>;
|
|
785
1214
|
/** Update endpoint priorities */
|
|
786
1215
|
updatePriorities(orgId: string, priorities: {
|
|
787
1216
|
id: string;
|
|
788
1217
|
priority: number;
|
|
789
|
-
}[]): Promise<
|
|
1218
|
+
}[]): Promise<MessageResponse>;
|
|
790
1219
|
}
|
|
791
1220
|
|
|
792
1221
|
declare class UsageResource {
|
|
793
1222
|
private http;
|
|
794
1223
|
constructor(http: HttpClient);
|
|
795
|
-
/**
|
|
796
|
-
|
|
1224
|
+
/**
|
|
1225
|
+
* Get usage rows (one per key per day) for a date range. `from` and `to`
|
|
1226
|
+
* are ISO dates, e.g. `2026-01-31`.
|
|
1227
|
+
*/
|
|
1228
|
+
get(orgId: string, from: string, to: string): Promise<UsageRow[]>;
|
|
797
1229
|
/** Get usage summary */
|
|
798
1230
|
getSummary(orgId: string): Promise<UsageSummary>;
|
|
799
1231
|
}
|
|
@@ -802,32 +1234,38 @@ declare class DashboardResource {
|
|
|
802
1234
|
private http;
|
|
803
1235
|
constructor(http: HttpClient);
|
|
804
1236
|
/** Get full dashboard data */
|
|
805
|
-
get(orgId: string,
|
|
1237
|
+
get(orgId: string, timeRange?: DashboardTimeRange, custom?: CustomRange): Promise<DashboardData>;
|
|
806
1238
|
/** Get system health overview */
|
|
807
1239
|
getHealth(orgId: string): Promise<HealthStatus>;
|
|
808
1240
|
/** Get quick stats */
|
|
809
|
-
getQuickStats(orgId: string,
|
|
1241
|
+
getQuickStats(orgId: string, timeRange?: DashboardTimeRange, custom?: CustomRange): Promise<QuickStats>;
|
|
810
1242
|
/** Get request rate time series */
|
|
811
|
-
getRequestRate(orgId: string,
|
|
1243
|
+
getRequestRate(orgId: string, timeRange?: DashboardTimeRange, custom?: CustomRange): Promise<RequestRate>;
|
|
812
1244
|
/** Get error rate time series */
|
|
813
|
-
getErrorRate(orgId: string,
|
|
1245
|
+
getErrorRate(orgId: string, timeRange?: DashboardTimeRange, custom?: CustomRange): Promise<ErrorRate>;
|
|
814
1246
|
/** Get latency metrics */
|
|
815
|
-
getLatency(orgId: string,
|
|
1247
|
+
getLatency(orgId: string, timeRange?: DashboardTimeRange, custom?: CustomRange): Promise<LatencyStats>;
|
|
816
1248
|
/** Get performance metrics */
|
|
817
|
-
getPerformance(orgId: string): Promise<
|
|
1249
|
+
getPerformance(orgId: string): Promise<PerformanceStats>;
|
|
818
1250
|
}
|
|
819
1251
|
|
|
820
1252
|
declare class AlertsResource {
|
|
821
1253
|
private http;
|
|
822
1254
|
constructor(http: HttpClient);
|
|
823
|
-
/**
|
|
1255
|
+
/**
|
|
1256
|
+
* List alerts for an organization. The API answers an overview object
|
|
1257
|
+
* (`alerts`, counters, rules, channels); this returns just the alerts.
|
|
1258
|
+
* Use `overview()` for the rest.
|
|
1259
|
+
*/
|
|
824
1260
|
list(orgId: string): Promise<Alert[]>;
|
|
1261
|
+
/** The full alerts overview: alerts, counters, rules and channels. */
|
|
1262
|
+
overview(orgId: string): Promise<AlertsOverview>;
|
|
825
1263
|
/** Acknowledge an alert */
|
|
826
1264
|
acknowledge(orgId: string, alertId: string): Promise<Alert>;
|
|
827
1265
|
/** Resolve an alert */
|
|
828
1266
|
resolve(orgId: string, alertId: string): Promise<Alert>;
|
|
829
1267
|
/** Evaluate all alert rules now */
|
|
830
|
-
evaluate(orgId: string): Promise<
|
|
1268
|
+
evaluate(orgId: string): Promise<MessageResponse>;
|
|
831
1269
|
/** List alert rules */
|
|
832
1270
|
listRules(orgId: string): Promise<AlertRule[]>;
|
|
833
1271
|
/** Create a new alert rule */
|
|
@@ -835,13 +1273,13 @@ declare class AlertsResource {
|
|
|
835
1273
|
/** Get a specific alert rule */
|
|
836
1274
|
getRule(orgId: string, ruleId: string): Promise<AlertRule>;
|
|
837
1275
|
/** Update an alert rule */
|
|
838
|
-
updateRule(orgId: string, ruleId: string, data:
|
|
1276
|
+
updateRule(orgId: string, ruleId: string, data: UpdateAlertRuleRequest): Promise<AlertRule>;
|
|
839
1277
|
/** Delete an alert rule */
|
|
840
1278
|
deleteRule(orgId: string, ruleId: string): Promise<void>;
|
|
841
1279
|
/** Toggle an alert rule on/off */
|
|
842
1280
|
toggleRule(orgId: string, ruleId: string): Promise<AlertRule>;
|
|
843
1281
|
/** Seed default alert rules */
|
|
844
|
-
seedDefaults(orgId: string): Promise<
|
|
1282
|
+
seedDefaults(orgId: string): Promise<MessageResponse>;
|
|
845
1283
|
/** List notification channels */
|
|
846
1284
|
listChannels(orgId: string): Promise<AlertChannel[]>;
|
|
847
1285
|
/** Create a notification channel */
|
|
@@ -849,22 +1287,22 @@ declare class AlertsResource {
|
|
|
849
1287
|
/** Get a specific channel */
|
|
850
1288
|
getChannel(orgId: string, channelId: string): Promise<AlertChannel>;
|
|
851
1289
|
/** Update a notification channel */
|
|
852
|
-
updateChannel(orgId: string, channelId: string, data:
|
|
1290
|
+
updateChannel(orgId: string, channelId: string, data: UpdateAlertChannelRequest): Promise<AlertChannel>;
|
|
853
1291
|
/** Delete a notification channel */
|
|
854
1292
|
deleteChannel(orgId: string, channelId: string): Promise<void>;
|
|
855
1293
|
/** Test a notification channel */
|
|
856
|
-
testChannel(orgId: string, channelId: string): Promise<
|
|
1294
|
+
testChannel(orgId: string, channelId: string): Promise<TestChannelResult>;
|
|
857
1295
|
}
|
|
858
1296
|
|
|
859
1297
|
declare class LogsResource {
|
|
860
1298
|
private http;
|
|
861
1299
|
constructor(http: HttpClient);
|
|
862
|
-
/** Query request logs with filters
|
|
1300
|
+
/** Query request logs with filters (`limit` / `offset` paginate) */
|
|
863
1301
|
query(orgId: string, params?: LogQueryParams): Promise<LogsResponse>;
|
|
864
1302
|
/** Get a single log entry */
|
|
865
1303
|
get(orgId: string, logId: string): Promise<RequestLog>;
|
|
866
1304
|
/** Get log statistics */
|
|
867
|
-
getStats(orgId: string): Promise<
|
|
1305
|
+
getStats(orgId: string): Promise<LogStats>;
|
|
868
1306
|
/** Get available filter options */
|
|
869
1307
|
getFilterOptions(orgId: string): Promise<LogFilterOptions>;
|
|
870
1308
|
}
|
|
@@ -882,11 +1320,11 @@ declare class SubscriptionsResource {
|
|
|
882
1320
|
* always sent. Pass `{ acceptedTerms: true }` only after the user has
|
|
883
1321
|
* accepted the terms.
|
|
884
1322
|
*/
|
|
885
|
-
changePlan(orgId: string, planId: string, options: ChangePlanOptions): Promise<
|
|
1323
|
+
changePlan(orgId: string, planId: string, options: ChangePlanOptions): Promise<ChangePlanResult>;
|
|
886
1324
|
/** Cancel subscription */
|
|
887
|
-
cancel(orgId: string): Promise<
|
|
1325
|
+
cancel(orgId: string): Promise<CancelSubscriptionResult>;
|
|
888
1326
|
/** Reactivate a cancelled subscription */
|
|
889
|
-
reactivate(orgId: string): Promise<
|
|
1327
|
+
reactivate(orgId: string): Promise<MessageResponse>;
|
|
890
1328
|
/** Get invoices */
|
|
891
1329
|
getInvoices(orgId: string, limit?: number): Promise<Invoice[]>;
|
|
892
1330
|
}
|
|
@@ -905,16 +1343,21 @@ declare class SupportResource {
|
|
|
905
1343
|
constructor(http: HttpClient);
|
|
906
1344
|
/** Create a support ticket */
|
|
907
1345
|
createTicket(orgId: string, data: CreateTicketRequest): Promise<SupportTicket>;
|
|
908
|
-
/**
|
|
1346
|
+
/**
|
|
1347
|
+
* List support tickets. The API answers `{ tickets, total }`; this
|
|
1348
|
+
* returns the tickets. Use `listTicketsWithTotal()` for the total.
|
|
1349
|
+
*/
|
|
909
1350
|
listTickets(orgId: string): Promise<SupportTicket[]>;
|
|
1351
|
+
/** List support tickets with the total count. */
|
|
1352
|
+
listTicketsWithTotal(orgId: string): Promise<TicketList>;
|
|
910
1353
|
/** Get ticket statistics */
|
|
911
|
-
getStats(orgId: string): Promise<
|
|
1354
|
+
getStats(orgId: string): Promise<TicketStats>;
|
|
912
1355
|
/** Get a specific ticket */
|
|
913
1356
|
getTicket(orgId: string, ticketId: string): Promise<SupportTicket>;
|
|
914
1357
|
/** Add a message to a ticket */
|
|
915
1358
|
addMessage(orgId: string, ticketId: string, content: string): Promise<TicketMessage>;
|
|
916
1359
|
/** Update ticket status */
|
|
917
|
-
updateStatus(orgId: string, ticketId: string, status:
|
|
1360
|
+
updateStatus(orgId: string, ticketId: string, status: TicketStatus): Promise<SupportTicket>;
|
|
918
1361
|
}
|
|
919
1362
|
|
|
920
1363
|
declare class RpcResource {
|
|
@@ -1031,4 +1474,4 @@ declare class IteradianClient {
|
|
|
1031
1474
|
}
|
|
1032
1475
|
|
|
1033
1476
|
export { AlertsResource, ApiKeysResource, AuthResource, DashboardResource, EndpointsResource, IteradianClient, IteradianError, LogsResource, OrganizationsResource, PlansResource, RpcResource, SubscriptionsResource, SupportResource, UsageResource };
|
|
1034
|
-
export type { AcceptInviteOptions, Alert, AlertChannel,
|
|
1477
|
+
export type { AcceptInviteOptions, Alert, AlertChannel, AlertChannelType, AlertRule, AlertRuleType, AlertSeverity, AlertStatus, AlertsOverview, ApiError, ApiKey, ApiKeyAnalytics, ApiKeyWithSecret, ApiResponse, AuthTokens, AuthUser, BackupCodes, BillingInterval, CancelSubscriptionResult, ChangePlanOptions, ChangePlanResult, CreateAlertChannelRequest, CreateAlertRuleRequest, CreateApiKeyRequest, CreateEndpointRequest, CreateOrganizationRequest, CreateTicketRequest, CustomRange, DailyUsage, DashboardData, DashboardTimeRange, DataPoint, Endpoint, EndpointHealth, EndpointHealthCheck, EndpointHealthEntry, EndpointMetric, EndpointRegion, EndpointStatus, EndpointSummary, ErrorRate, HealthStatus, InviteAcceptance, Invoice, IteradianConfig, JsonRpcError, JsonRpcRequest, JsonRpcResponse, LatencyStats, LogFilterOptions, LogQueryParams, LogStats, LogStatus, LoginRequest, LoginResult, LogsResponse, Membership, MessageResponse, MyInvite, MyInvites, Network, NetworkType, Numeric, OpenString, OrgInvite, OrgMember, OrgPlanSummary, OrgRole, OrgSubscriptionSummary, Organization, PaginatedResponse, PerformanceStats, Plan, PlanLimitKey, PlanLimitMode, PlanLimits, QuickStats, QuotaForecast, RegisterRequest, RegisterResponse, RequestLog, RequestRate, ServiceStatus, Subscription, SubscriptionPlan, SupportTicket, TestChannelResult, TicketAuthor, TicketCategory, TicketList, TicketMessage, TicketPriority, TicketStats, TicketStatus, TwoFASetup, UpdateAlertChannelRequest, UpdateAlertRuleRequest, UpdateApiKeyRequest, UpdateEndpointRequest, UpdateOrganizationRequest, UsageByKey, UsageByMethod, UsageByNetwork, UsageByRegion, UsageRow, UsageSummary, User, UserPermissions };
|