@enlitt/protocol 0.0.0-stage → 0.1.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/CHANGELOG.md +21 -0
- package/LICENSE +21 -0
- package/README.md +15 -2
- package/dist/admin.d.cts +353 -0
- package/dist/admin.d.ts +354 -0
- package/dist/admin.d.ts.map +1 -0
- package/dist/authentication.d.cts +8 -0
- package/dist/authentication.d.ts +9 -0
- package/dist/authentication.d.ts.map +1 -0
- package/dist/canonical-integer.d.cts +48 -0
- package/dist/canonical-integer.d.ts +49 -0
- package/dist/canonical-integer.d.ts.map +1 -0
- package/dist/compatibility.d.cts +23 -0
- package/dist/compatibility.d.ts +24 -0
- package/dist/compatibility.d.ts.map +1 -0
- package/dist/contract.d.cts +67 -0
- package/dist/contract.d.ts +68 -0
- package/dist/contract.d.ts.map +1 -0
- package/dist/dashboard.d.cts +1078 -0
- package/dist/dashboard.d.ts +1079 -0
- package/dist/dashboard.d.ts.map +1 -0
- package/dist/errors.d.cts +113 -0
- package/dist/errors.d.ts +114 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/idempotency.d.cts +79 -0
- package/dist/idempotency.d.ts +80 -0
- package/dist/idempotency.d.ts.map +1 -0
- package/dist/index.cjs +5050 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +33 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4857 -0
- package/dist/index.js.map +1 -0
- package/dist/outreach.d.cts +73 -0
- package/dist/outreach.d.ts +74 -0
- package/dist/outreach.d.ts.map +1 -0
- package/dist/premium-operations.d.cts +84 -0
- package/dist/premium-operations.d.ts +85 -0
- package/dist/premium-operations.d.ts.map +1 -0
- package/dist/response-stream.d.cts +246 -0
- package/dist/response-stream.d.ts +247 -0
- package/dist/response-stream.d.ts.map +1 -0
- package/dist/responses.d.cts +233 -0
- package/dist/responses.d.ts +234 -0
- package/dist/responses.d.ts.map +1 -0
- package/dist/usage.d.cts +11 -0
- package/dist/usage.d.ts +12 -0
- package/dist/usage.d.ts.map +1 -0
- package/generated/contract.json +491 -0
- package/package.json +60 -3
|
@@ -0,0 +1,1078 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The dashboard/reporting wire contract: every shape `specs/PROTOCOLS.md`
|
|
3
|
+
* "Dashboard schema ownership" assigns to this package, and its hand-written
|
|
4
|
+
* runtime validators.
|
|
5
|
+
*
|
|
6
|
+
* Read scope for this module: `specs/PROTOCOLS.md` "Frontend" —
|
|
7
|
+
* "Personal dashboard" through "Dashboard schema ownership" (the personal
|
|
8
|
+
* read model and its closed-period usage read, verified contacts,
|
|
9
|
+
* authorization consent, the plan catalog, the business read model shared by
|
|
10
|
+
* `GET /v1/dashboard/business` and `GET /v1/business/info`, and every
|
|
11
|
+
* business mutation) — plus the opening paragraph's "unknown fields are
|
|
12
|
+
* rejected unless explicitly allowed" rule and the canonical-integer rules it
|
|
13
|
+
* states for every credit/NANOUSD field.
|
|
14
|
+
*
|
|
15
|
+
* Every validator here checks **field names**, not structure: a response
|
|
16
|
+
* whose fields were renamed to same-typed values fails even though a
|
|
17
|
+
* presence/type-only check would have passed it. This is what
|
|
18
|
+
* "Dashboard schema ownership" names as the whole point of moving these
|
|
19
|
+
* declarations into this package — a hand-written parser in a client is a
|
|
20
|
+
* second declaration of a shape this package owns, and two declarations
|
|
21
|
+
* drift silently on a rename.
|
|
22
|
+
*
|
|
23
|
+
* Request validators always reject unknown fields. Response validators are
|
|
24
|
+
* strict by default, while `{ mode: "tolerant" }` drops unknown fields and
|
|
25
|
+
* maps future closed-enum members to the reserved `"other"` value.
|
|
26
|
+
*
|
|
27
|
+
* `redirect_uris`/`allowed_origins` are "bounded in count and length" per
|
|
28
|
+
* `specs/PROTOCOLS.md`, but — like `JsonSchema`'s depth/size bounds in
|
|
29
|
+
* `responses.ts` — no numeric bound is stated in this module's read scope.
|
|
30
|
+
* This module enforces every categorical rule the text does state (absolute
|
|
31
|
+
* URL, no fragment/userinfo/wildcard, `https` except on a loopback host, an
|
|
32
|
+
* origin with no path or query, no duplicates) and leaves the numeric bounds
|
|
33
|
+
* as an open item for whichever deployed policy defines them.
|
|
34
|
+
*/
|
|
35
|
+
import { type ParseOptions, type Readable } from "./compatibility.cjs";
|
|
36
|
+
import type { ResponseValidationResult } from "./responses.cjs";
|
|
37
|
+
type Result<T> = ResponseValidationResult<T>;
|
|
38
|
+
/**
|
|
39
|
+
* "the identity subset of a catalog entry, carrying no included amounts and
|
|
40
|
+
* no limits". Used identically by `usage.plan`, `subscription.plan`, and
|
|
41
|
+
* `subscription.pending_plan` — one declaration for all three positions.
|
|
42
|
+
*/
|
|
43
|
+
export interface SubscriptionPlanSummary {
|
|
44
|
+
readonly id: string;
|
|
45
|
+
readonly display_name: string;
|
|
46
|
+
readonly is_free: boolean;
|
|
47
|
+
readonly price_minor_units: string;
|
|
48
|
+
readonly currency: string;
|
|
49
|
+
readonly interval: Readable<"month" | "year">;
|
|
50
|
+
readonly catalog_version: string;
|
|
51
|
+
}
|
|
52
|
+
export declare const PLAN_INTERVALS: readonly ["month", "year"];
|
|
53
|
+
export declare function validateSubscriptionPlanSummary(value: unknown, param?: string, options?: ParseOptions): Result<SubscriptionPlanSummary>;
|
|
54
|
+
export interface PersonalStandardUsage {
|
|
55
|
+
readonly used: string;
|
|
56
|
+
readonly reserved: string;
|
|
57
|
+
readonly limit: string | null;
|
|
58
|
+
readonly service_tier: Readable<"normal" | "reduced" | "minimum"> | null;
|
|
59
|
+
}
|
|
60
|
+
export declare const SERVICE_TIERS: readonly ["normal", "reduced", "minimum"];
|
|
61
|
+
export interface PersonalPremiumUsage {
|
|
62
|
+
readonly used: string;
|
|
63
|
+
readonly reserved: string;
|
|
64
|
+
readonly limit: string;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Shared by `usage` on `GET /v1/dashboard/personal` (nullable) and the
|
|
68
|
+
* closed-period read `GET /v1/dashboard/personal/usage` (never null): one
|
|
69
|
+
* declaration for both.
|
|
70
|
+
*/
|
|
71
|
+
export interface PersonalUsagePeriod {
|
|
72
|
+
readonly period_start: string;
|
|
73
|
+
readonly period_end: string;
|
|
74
|
+
readonly plan: SubscriptionPlanSummary;
|
|
75
|
+
readonly standard: PersonalStandardUsage;
|
|
76
|
+
readonly premium: PersonalPremiumUsage;
|
|
77
|
+
}
|
|
78
|
+
export declare function validatePersonalUsagePeriod(value: unknown, param?: string, options?: ParseOptions): Result<PersonalUsagePeriod>;
|
|
79
|
+
export interface PersonalDashboardAccount {
|
|
80
|
+
readonly id: string;
|
|
81
|
+
readonly type: Readable<"user">;
|
|
82
|
+
readonly email: string;
|
|
83
|
+
readonly display_name?: string;
|
|
84
|
+
}
|
|
85
|
+
export interface PersonalDashboardSettings {
|
|
86
|
+
readonly new_application_premium_per_call_limit: string;
|
|
87
|
+
}
|
|
88
|
+
export declare const SUBSCRIPTION_STATUSES: readonly ["active", "past_due", "canceled", "suspended"];
|
|
89
|
+
export declare const CHANGE_MODES: readonly ["checkout", "change", "locked", "unavailable"];
|
|
90
|
+
/** Which endpoint accepts a downgrade while plan changes are locked (`PATCH` or a scheduled `POST` checkout). */
|
|
91
|
+
export declare const LOCKED_DOWNGRADE_MODES: readonly ["checkout", "change"];
|
|
92
|
+
export interface PersonalDashboardSubscription {
|
|
93
|
+
readonly status: Readable<"active" | "past_due" | "canceled" | "suspended">;
|
|
94
|
+
readonly plan?: SubscriptionPlanSummary;
|
|
95
|
+
readonly pending_plan?: SubscriptionPlanSummary;
|
|
96
|
+
readonly current_period_end?: string;
|
|
97
|
+
readonly change_mode: Readable<"checkout" | "change" | "locked" | "unavailable">;
|
|
98
|
+
/** Present only with `change_mode: "locked"`, when a cheaper paid plan is still accepted. */
|
|
99
|
+
readonly locked_downgrade?: Readable<"checkout" | "change">;
|
|
100
|
+
}
|
|
101
|
+
export declare function validatePersonalDashboardSubscription(value: unknown, options?: ParseOptions): Result<PersonalDashboardSubscription>;
|
|
102
|
+
export interface PersonalPaymentMethod {
|
|
103
|
+
readonly provider: string;
|
|
104
|
+
readonly brand?: string;
|
|
105
|
+
readonly last4?: string;
|
|
106
|
+
readonly expires_month?: number;
|
|
107
|
+
readonly expires_year?: number;
|
|
108
|
+
}
|
|
109
|
+
/** `POST /v1/dashboard/personal/payment-method/setup`'s response. */
|
|
110
|
+
export interface PaymentMethodSetupResponse {
|
|
111
|
+
readonly client_secret: string;
|
|
112
|
+
}
|
|
113
|
+
export declare function validatePaymentMethodSetupResponse(value: unknown, options?: ParseOptions): Result<PaymentMethodSetupResponse>;
|
|
114
|
+
/**
|
|
115
|
+
* `GET /v1/dashboard/personal`'s body, and the confirmed state returned by
|
|
116
|
+
* `PATCH /v1/dashboard/personal/settings`, `PATCH /v1/dashboard/personal/subscription`,
|
|
117
|
+
* and `DELETE /v1/dashboard/personal/payment-method`.
|
|
118
|
+
*/
|
|
119
|
+
export interface PersonalDashboard {
|
|
120
|
+
readonly account: PersonalDashboardAccount;
|
|
121
|
+
readonly usage: PersonalUsagePeriod | null;
|
|
122
|
+
readonly extra_credits: PersonalExtraCredits | null;
|
|
123
|
+
readonly settings: PersonalDashboardSettings;
|
|
124
|
+
readonly subscription: PersonalDashboardSubscription;
|
|
125
|
+
readonly payment_method?: PersonalPaymentMethod;
|
|
126
|
+
}
|
|
127
|
+
export interface PersonalExtraCreditAmount {
|
|
128
|
+
readonly remaining: string;
|
|
129
|
+
readonly reserved: string;
|
|
130
|
+
}
|
|
131
|
+
export interface PersonalExtraCredits {
|
|
132
|
+
readonly standard: PersonalExtraCreditAmount;
|
|
133
|
+
readonly premium: PersonalExtraCreditAmount;
|
|
134
|
+
}
|
|
135
|
+
export declare function validatePersonalDashboard(value: unknown, options?: ParseOptions): Result<PersonalDashboard>;
|
|
136
|
+
/** `PATCH /v1/dashboard/personal/settings`'s request body: exactly one optional field. */
|
|
137
|
+
export declare function validatePatchPersonalSettingsRequest(value: unknown): Result<{
|
|
138
|
+
readonly new_application_premium_per_call_limit?: string;
|
|
139
|
+
}>;
|
|
140
|
+
export declare const APPLICATION_ENVIRONMENTS: readonly ["test", "live"];
|
|
141
|
+
/**
|
|
142
|
+
* One credit type's per-application rate window: captured plus reserved
|
|
143
|
+
* credit units for this user and application per fixed window of
|
|
144
|
+
* `period_minutes` minutes. Read-only to the user in v1.
|
|
145
|
+
*/
|
|
146
|
+
export interface ApplicationRateTuple {
|
|
147
|
+
readonly credits: string;
|
|
148
|
+
readonly period_minutes: number;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* The authorization's extensible `limits` object (`specs/PROTOCOLS.md`
|
|
152
|
+
* "Personal dashboard"). A new rule adds a key; clients tolerate future keys,
|
|
153
|
+
* so a tolerant read drops them and a strict read rejects them. Each credit
|
|
154
|
+
* type has its own per-call limit and its own rate tuple.
|
|
155
|
+
*/
|
|
156
|
+
export interface ApplicationLimits {
|
|
157
|
+
readonly standard_per_call: string;
|
|
158
|
+
readonly premium_per_call: string;
|
|
159
|
+
readonly rate: {
|
|
160
|
+
readonly standard: ApplicationRateTuple;
|
|
161
|
+
readonly premium: ApplicationRateTuple;
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
export declare function validateApplicationLimits(value: unknown, param?: string, options?: ParseOptions): Result<ApplicationLimits>;
|
|
165
|
+
/** `PATCH .../limits` body: either per-call key alone or both, at least one. */
|
|
166
|
+
export interface PersonalApplicationLimitsPatch {
|
|
167
|
+
readonly limits: {
|
|
168
|
+
readonly standard_per_call?: string;
|
|
169
|
+
readonly premium_per_call?: string;
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
export interface PersonalApplicationSummary {
|
|
173
|
+
readonly id: string;
|
|
174
|
+
readonly name: string;
|
|
175
|
+
readonly icon_url?: string;
|
|
176
|
+
readonly description?: string;
|
|
177
|
+
readonly business_display_name: string;
|
|
178
|
+
readonly environment: Readable<"test" | "live">;
|
|
179
|
+
readonly limits: ApplicationLimits;
|
|
180
|
+
readonly authorized_at: string;
|
|
181
|
+
readonly last_authorized_at: string;
|
|
182
|
+
/** Null while the authorization is in force; the instant of the user's revoke while revoked. */
|
|
183
|
+
readonly revoked_at: string | null;
|
|
184
|
+
}
|
|
185
|
+
/** This user's recorded calls to one application over the list wrapper's `range`. */
|
|
186
|
+
export interface PersonalApplicationListTotals {
|
|
187
|
+
readonly standard_requests: number;
|
|
188
|
+
readonly premium_requests: number;
|
|
189
|
+
readonly standard_units_used: string;
|
|
190
|
+
readonly premium_units_used: string;
|
|
191
|
+
}
|
|
192
|
+
/** A list entry: the summary plus `totals`. The detail read does not carry `totals`. */
|
|
193
|
+
export type PersonalApplicationListItem = PersonalApplicationSummary & {
|
|
194
|
+
readonly totals: PersonalApplicationListTotals;
|
|
195
|
+
};
|
|
196
|
+
export interface PersonalApplicationsPage {
|
|
197
|
+
readonly applications: readonly PersonalApplicationListItem[];
|
|
198
|
+
readonly range: DashboardRange;
|
|
199
|
+
readonly next_cursor: string | null;
|
|
200
|
+
}
|
|
201
|
+
export declare function validatePersonalApplicationsPage(value: unknown, options?: ParseOptions): Result<PersonalApplicationsPage>;
|
|
202
|
+
/** Sort orders of the per-application call list (`specs/PROTOCOLS.md`). */
|
|
203
|
+
export declare const PERSONAL_APPLICATION_CALL_SORTS: readonly ["time", "charge"];
|
|
204
|
+
export type PersonalApplicationCallSort = (typeof PERSONAL_APPLICATION_CALL_SORTS)[number];
|
|
205
|
+
/** Page size bounds of the per-application call list. */
|
|
206
|
+
export declare const PERSONAL_APPLICATION_CALLS_DEFAULT_LIMIT = 10;
|
|
207
|
+
export declare const PERSONAL_APPLICATION_CALLS_MAX_LIMIT = 50;
|
|
208
|
+
export declare const PERSONAL_APPLICATION_CALL_CREDIT_TYPES: readonly ["standard", "premium"];
|
|
209
|
+
export declare const PERSONAL_APPLICATION_CALL_STATUSES: readonly ["pending", "running", "completed", "failed", "canceled", "expired"];
|
|
210
|
+
/** One recorded call of the user to an application they authorized. */
|
|
211
|
+
export interface PersonalApplicationCall {
|
|
212
|
+
readonly id: string;
|
|
213
|
+
readonly credit_type: Readable<(typeof PERSONAL_APPLICATION_CALL_CREDIT_TYPES)[number]>;
|
|
214
|
+
readonly status: Readable<(typeof PERSONAL_APPLICATION_CALL_STATUSES)[number]>;
|
|
215
|
+
readonly units_used: string;
|
|
216
|
+
readonly units_reserved: string;
|
|
217
|
+
readonly created_at: string;
|
|
218
|
+
readonly terminal_at: string | null;
|
|
219
|
+
readonly streamed: boolean;
|
|
220
|
+
readonly model_id: string | null;
|
|
221
|
+
readonly input_tokens: number | null;
|
|
222
|
+
readonly output_tokens: number | null;
|
|
223
|
+
readonly finish_reason: string | null;
|
|
224
|
+
readonly error_category: string | null;
|
|
225
|
+
}
|
|
226
|
+
/** The `{ calls, page, page_count, total }` wrapper of the per-application call list. */
|
|
227
|
+
export interface PersonalApplicationCallPage {
|
|
228
|
+
readonly calls: readonly PersonalApplicationCall[];
|
|
229
|
+
readonly page: number;
|
|
230
|
+
readonly page_count: number;
|
|
231
|
+
readonly total: number;
|
|
232
|
+
}
|
|
233
|
+
export declare function validatePersonalApplicationCallPage(value: unknown, options?: ParseOptions): Result<PersonalApplicationCallPage>;
|
|
234
|
+
/**
|
|
235
|
+
* Parses the query of `GET …/applications/{id}/calls`. `sort` defaults to
|
|
236
|
+
* `time`, `page` to 1 (a positive integer), `limit` to 10 (1–50).
|
|
237
|
+
*/
|
|
238
|
+
export declare function validatePersonalApplicationCallsQuery(query: {
|
|
239
|
+
readonly sort?: string | null;
|
|
240
|
+
readonly page?: string | null;
|
|
241
|
+
readonly limit?: string | null;
|
|
242
|
+
}): Result<{
|
|
243
|
+
sort: PersonalApplicationCallSort;
|
|
244
|
+
page: number;
|
|
245
|
+
limit: number;
|
|
246
|
+
}>;
|
|
247
|
+
export interface PersonalApplicationUsageDay {
|
|
248
|
+
readonly day: string;
|
|
249
|
+
readonly standard_requests: number;
|
|
250
|
+
readonly premium_requests: number;
|
|
251
|
+
readonly standard_units_used: string;
|
|
252
|
+
readonly premium_units_used: string;
|
|
253
|
+
}
|
|
254
|
+
export interface DashboardRange {
|
|
255
|
+
readonly from: string;
|
|
256
|
+
readonly to: string;
|
|
257
|
+
readonly timezone: Readable<"UTC">;
|
|
258
|
+
}
|
|
259
|
+
export interface PersonalApplicationUsage {
|
|
260
|
+
readonly range: DashboardRange;
|
|
261
|
+
readonly data_fresh_at: string;
|
|
262
|
+
readonly daily: readonly PersonalApplicationUsageDay[];
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* The number of equal-width bins in a `PremiumUnitsHistogram` whose span is
|
|
266
|
+
* `upperUnits` (owner decision 2026-10-25: at least one bin per whole credit,
|
|
267
|
+
* so the shape is detailed enough to draw): the span in credits clamped to
|
|
268
|
+
* 50–1,000. That is 50 sub-credit bins for 10 and 20 credits, one bin per
|
|
269
|
+
* credit from 50 to 1,000 credits, and 1,000 bins from 2,000 credits up. For
|
|
270
|
+
* every 1-2-5 span the bin width `upperUnits / count` is a whole number of units.
|
|
271
|
+
*/
|
|
272
|
+
export declare function premiumUnitsHistogramBinCount(upperUnits: bigint): number;
|
|
273
|
+
/**
|
|
274
|
+
* The measured charges as per-mille shares: `B` equal bins over
|
|
275
|
+
* `0..upper_units` (`B = premiumUnitsHistogramBinCount(upper_units)`; bin `i`
|
|
276
|
+
* holds charges `c` with `i·w < c <= (i+1)·w`, `w = upper_units / B`) and the
|
|
277
|
+
* share above `upper_units`. `upper_units` is the 1-2-5 credit span (10, 20,
|
|
278
|
+
* 50, 100, ... credits) at or above the p99; the `B + 1` shares sum to exactly
|
|
279
|
+
* 1,000 and carry no count.
|
|
280
|
+
*/
|
|
281
|
+
export interface PremiumUnitsHistogram {
|
|
282
|
+
readonly upper_units: string;
|
|
283
|
+
readonly bin_shares_permille: readonly number[];
|
|
284
|
+
readonly above_share_permille: number;
|
|
285
|
+
}
|
|
286
|
+
export interface ApplicationCostProfile {
|
|
287
|
+
readonly disclosed: boolean;
|
|
288
|
+
/**
|
|
289
|
+
* The application's premium switch (`applications.premium_enabled`), always
|
|
290
|
+
* present and independent of disclosure (owner decision 2026-10-25). A client
|
|
291
|
+
* shows an application with it false as one that does not use premium credit
|
|
292
|
+
* and offers no premium limit control.
|
|
293
|
+
*/
|
|
294
|
+
readonly premium_enabled: boolean;
|
|
295
|
+
readonly uses_premium: boolean;
|
|
296
|
+
/** The three charged-call figures and the histogram are present exactly when `disclosed` is true. */
|
|
297
|
+
readonly median_premium_units_per_charged_call?: string;
|
|
298
|
+
readonly p90_premium_units_per_charged_call?: string;
|
|
299
|
+
readonly max_premium_units_per_charged_call?: string;
|
|
300
|
+
readonly premium_units_histogram?: PremiumUnitsHistogram;
|
|
301
|
+
/**
|
|
302
|
+
* The developer's own estimate converted to premium units (rounded up).
|
|
303
|
+
* Present exactly when `disclosed` is false and the application declared
|
|
304
|
+
* an estimate; a client must label it as the developer's estimate.
|
|
305
|
+
*/
|
|
306
|
+
readonly estimated_premium_units_per_charged_call?: string;
|
|
307
|
+
readonly window_start: string;
|
|
308
|
+
readonly window_end: string;
|
|
309
|
+
readonly computed_at: string;
|
|
310
|
+
}
|
|
311
|
+
export declare function validateApplicationCostProfile(value: unknown, param?: string, options?: ParseOptions): Result<ApplicationCostProfile>;
|
|
312
|
+
/** `GET /v1/dashboard/personal/applications/{application_id}}`'s body. */
|
|
313
|
+
export type PersonalApplicationDetail = PersonalApplicationSummary & {
|
|
314
|
+
readonly usage: PersonalApplicationUsage;
|
|
315
|
+
readonly cost_profile: ApplicationCostProfile;
|
|
316
|
+
};
|
|
317
|
+
export declare function validatePersonalApplicationDetail(value: unknown, options?: ParseOptions): Result<PersonalApplicationDetail>;
|
|
318
|
+
/**
|
|
319
|
+
* `PATCH /v1/dashboard/personal/applications/{application_id}/limits`'s
|
|
320
|
+
* request body: `{ limits: { standard_per_call?, premium_per_call? } }` with at
|
|
321
|
+
* least one key. An empty `limits` object, a `rate` key, or any other key is
|
|
322
|
+
* refused.
|
|
323
|
+
*/
|
|
324
|
+
export declare function validatePatchPersonalApplicationLimitRequest(value: unknown): Result<PersonalApplicationLimitsPatch>;
|
|
325
|
+
export declare const CONTACT_TYPES: readonly ["email", "phone"];
|
|
326
|
+
export type ContactType = (typeof CONTACT_TYPES)[number];
|
|
327
|
+
export interface PersonalContact {
|
|
328
|
+
readonly id: string;
|
|
329
|
+
readonly contact_type: Readable<ContactType>;
|
|
330
|
+
readonly display_value: string;
|
|
331
|
+
readonly verified_at: string;
|
|
332
|
+
}
|
|
333
|
+
export declare function validatePersonalContact(value: unknown, options?: ParseOptions): Result<PersonalContact>;
|
|
334
|
+
export interface PersonalContactsList {
|
|
335
|
+
readonly contacts: readonly PersonalContact[];
|
|
336
|
+
}
|
|
337
|
+
export declare function validatePersonalContactsList(value: unknown, options?: ParseOptions): Result<PersonalContactsList>;
|
|
338
|
+
export declare function validateStartContactVerificationRequest(value: unknown): Result<{
|
|
339
|
+
readonly contact_type: ContactType;
|
|
340
|
+
readonly value: string;
|
|
341
|
+
readonly turnstile_token: unknown;
|
|
342
|
+
}>;
|
|
343
|
+
export interface ContactChallenge {
|
|
344
|
+
readonly challenge_id: string;
|
|
345
|
+
readonly contact_type: Readable<ContactType>;
|
|
346
|
+
readonly expires_at: string;
|
|
347
|
+
}
|
|
348
|
+
export declare function validateContactChallenge(value: unknown, options?: ParseOptions): Result<ContactChallenge>;
|
|
349
|
+
/** `POST /v1/dashboard/personal/contacts/verify`'s request body. */
|
|
350
|
+
export declare function validateVerifyContactRequest(value: unknown): Result<{
|
|
351
|
+
readonly challenge_id: string;
|
|
352
|
+
readonly code: string;
|
|
353
|
+
}>;
|
|
354
|
+
export interface ConsentApplication {
|
|
355
|
+
readonly id: string;
|
|
356
|
+
readonly name: string;
|
|
357
|
+
readonly icon_url?: string;
|
|
358
|
+
readonly description?: string;
|
|
359
|
+
readonly business_display_name: string;
|
|
360
|
+
readonly environment: Readable<"test" | "live">;
|
|
361
|
+
}
|
|
362
|
+
export interface ConsentInfo {
|
|
363
|
+
readonly application: ConsentApplication;
|
|
364
|
+
readonly cost_profile: ApplicationCostProfile;
|
|
365
|
+
readonly prefill_limits: ApplicationLimits;
|
|
366
|
+
readonly existing_limits?: ApplicationLimits;
|
|
367
|
+
readonly is_reauthorization: boolean;
|
|
368
|
+
/**
|
|
369
|
+
* True exactly when the user's covering period does not meter standard
|
|
370
|
+
* credit (an unmetered plan such as Unlimited). The consent screen then shows
|
|
371
|
+
* no standard per-call control and submits a fixed default instead (owner
|
|
372
|
+
* decision 2026-10-25). A display hint for the user's own dashboard only.
|
|
373
|
+
*/
|
|
374
|
+
readonly standard_unmetered: boolean;
|
|
375
|
+
}
|
|
376
|
+
export declare function validateConsentInfo(value: unknown, options?: ParseOptions): Result<ConsentInfo>;
|
|
377
|
+
export interface ConsentCompletionRequest {
|
|
378
|
+
readonly limits: {
|
|
379
|
+
readonly premium_per_call: string;
|
|
380
|
+
readonly standard_per_call?: string;
|
|
381
|
+
};
|
|
382
|
+
}
|
|
383
|
+
/** `POST /v1/dashboard/personal/authorizations/consent`'s request body: `{ limits: { premium_per_call, standard_per_call? } }`. */
|
|
384
|
+
export declare function validateConsentCompletionRequest(value: unknown): Result<ConsentCompletionRequest>;
|
|
385
|
+
export interface ConsentCompletion {
|
|
386
|
+
readonly resume_url: string;
|
|
387
|
+
}
|
|
388
|
+
export declare function validateConsentCompletion(value: unknown, options?: ParseOptions): Result<ConsentCompletion>;
|
|
389
|
+
export interface ConsentDenial {
|
|
390
|
+
readonly redirect_url: string | null;
|
|
391
|
+
}
|
|
392
|
+
export declare function validateConsentDenial(value: unknown, options?: ParseOptions): Result<ConsentDenial>;
|
|
393
|
+
export interface PlanCatalogLimits {
|
|
394
|
+
readonly requests_per_minute: number;
|
|
395
|
+
readonly default_max_output_tokens: number;
|
|
396
|
+
}
|
|
397
|
+
export interface SubscriptionPlanEntry {
|
|
398
|
+
readonly id: string;
|
|
399
|
+
readonly display_name: string;
|
|
400
|
+
readonly included_premium_credit_units: string;
|
|
401
|
+
readonly included_standard_credit_units: string | null;
|
|
402
|
+
readonly price_minor_units: string;
|
|
403
|
+
readonly currency: string;
|
|
404
|
+
readonly interval: Readable<"month" | "year">;
|
|
405
|
+
readonly is_free: boolean;
|
|
406
|
+
readonly limits: PlanCatalogLimits;
|
|
407
|
+
readonly catalog_version: string;
|
|
408
|
+
}
|
|
409
|
+
export interface SubscriptionPlanCatalog {
|
|
410
|
+
readonly catalog_version: string;
|
|
411
|
+
readonly plans: readonly SubscriptionPlanEntry[];
|
|
412
|
+
readonly bundles: readonly CreditBundleEntry[];
|
|
413
|
+
}
|
|
414
|
+
export interface CreditBundleEntry {
|
|
415
|
+
readonly id: string;
|
|
416
|
+
readonly display_name: string;
|
|
417
|
+
readonly premium_credit_units: string;
|
|
418
|
+
readonly standard_credit_units: string;
|
|
419
|
+
readonly price_minor_units: string;
|
|
420
|
+
readonly currency: string;
|
|
421
|
+
readonly catalog_version: string;
|
|
422
|
+
}
|
|
423
|
+
export declare function validateSubscriptionPlanCatalog(value: unknown, options?: ParseOptions): Result<SubscriptionPlanCatalog>;
|
|
424
|
+
/** Shared by `POST /v1/dashboard/personal/subscription` and its `PATCH`. */
|
|
425
|
+
export declare function validateSubscriptionSelectionRequest(value: unknown): Result<{
|
|
426
|
+
readonly plan_id: string;
|
|
427
|
+
readonly catalog_version: string;
|
|
428
|
+
}>;
|
|
429
|
+
/** `POST /v1/dashboard/personal/gift-codes/redeem`'s request body: exactly `{ code }`, 1 to 64 characters. */
|
|
430
|
+
export declare const GIFT_CODE_MAX_LENGTH = 64;
|
|
431
|
+
export declare function validateRedeemGiftCodeRequest(value: unknown): Result<{
|
|
432
|
+
readonly code: string;
|
|
433
|
+
}>;
|
|
434
|
+
/** `POST /v1/dashboard/personal/credits`'s request body. */
|
|
435
|
+
export declare function validateCreditsCheckoutRequest(value: unknown): Result<{
|
|
436
|
+
readonly bundle_id: string;
|
|
437
|
+
readonly catalog_version: string;
|
|
438
|
+
}>;
|
|
439
|
+
/**
|
|
440
|
+
* Returned by `POST /v1/dashboard/personal/subscription`, and extended with
|
|
441
|
+
* `order_id` by `POST /v1/dashboard/personal/credits`
|
|
442
|
+
* (`CreditsCheckoutResponse`).
|
|
443
|
+
*/
|
|
444
|
+
export interface DashboardCheckoutResponse {
|
|
445
|
+
readonly transaction_id: string;
|
|
446
|
+
readonly redirect_url: string;
|
|
447
|
+
}
|
|
448
|
+
export declare function validateDashboardCheckoutResponse(value: unknown, options?: ParseOptions): Result<DashboardCheckoutResponse>;
|
|
449
|
+
/**
|
|
450
|
+
* `POST /v1/dashboard/personal/credits` returns
|
|
451
|
+
* `{ transaction_id: string; order_id: string; redirect_url: string }`: the
|
|
452
|
+
* bundle checkout also names the purchase order it created, so a client can
|
|
453
|
+
* find that order in the order list once settlement activates it.
|
|
454
|
+
*/
|
|
455
|
+
export interface CreditsCheckoutResponse extends DashboardCheckoutResponse {
|
|
456
|
+
readonly order_id: string;
|
|
457
|
+
}
|
|
458
|
+
export declare function validateCreditsCheckoutResponse(value: unknown, options?: ParseOptions): Result<CreditsCheckoutResponse>;
|
|
459
|
+
export declare const ORDER_KINDS: readonly ["subscription", "bundle"];
|
|
460
|
+
export declare const ORDER_STATUSES: readonly ["pending", "active", "refund_pending", "refunded", "failed", "expired"];
|
|
461
|
+
export declare const REFUND_ELIGIBILITY: readonly ["full", "half", "none"];
|
|
462
|
+
export declare const REFUND_REASONS: readonly ["unused", "within_usage_threshold", "usage_threshold_exceeded", "window_expired", "not_active", "gift"];
|
|
463
|
+
export interface DashboardRefundQuote {
|
|
464
|
+
readonly eligibility: Readable<(typeof REFUND_ELIGIBILITY)[number]>;
|
|
465
|
+
readonly refund_minor_units: string;
|
|
466
|
+
readonly currency: string;
|
|
467
|
+
readonly reason: Readable<(typeof REFUND_REASONS)[number]>;
|
|
468
|
+
}
|
|
469
|
+
export interface DashboardPurchaseOrderSummary {
|
|
470
|
+
readonly id: string;
|
|
471
|
+
readonly kind: Readable<(typeof ORDER_KINDS)[number]>;
|
|
472
|
+
readonly product_id: string;
|
|
473
|
+
readonly product_catalog_version: string;
|
|
474
|
+
readonly product_display_name: string;
|
|
475
|
+
readonly status: Readable<(typeof ORDER_STATUSES)[number]>;
|
|
476
|
+
readonly paid_minor_units: string;
|
|
477
|
+
readonly currency: string;
|
|
478
|
+
/**
|
|
479
|
+
* When the order's payment settled (its `refundable_from`; a gift order's
|
|
480
|
+
* redemption), moved forward by a settled upgrade like the refund window.
|
|
481
|
+
* Null only for an order that was never paid.
|
|
482
|
+
*/
|
|
483
|
+
readonly purchased_at: string | null;
|
|
484
|
+
readonly refundable_until: string;
|
|
485
|
+
readonly refund: DashboardRefundQuote;
|
|
486
|
+
}
|
|
487
|
+
export interface DashboardPurchaseOrderPage {
|
|
488
|
+
readonly orders: readonly DashboardPurchaseOrderSummary[];
|
|
489
|
+
readonly next_cursor: string | null;
|
|
490
|
+
}
|
|
491
|
+
export declare function validateDashboardPurchaseOrderSummary(value: unknown, param?: string, options?: ParseOptions): Result<DashboardPurchaseOrderSummary>;
|
|
492
|
+
export declare function validateDashboardPurchaseOrderPage(value: unknown, options?: ParseOptions): Result<DashboardPurchaseOrderPage>;
|
|
493
|
+
/**
|
|
494
|
+
* One closed period on `GET /v1/dashboard/personal/periods`: the boundaries
|
|
495
|
+
* and the plan recorded on it, so the usage selector offers exactly the
|
|
496
|
+
* `period_start` values `GET /v1/dashboard/personal/usage` accepts.
|
|
497
|
+
*/
|
|
498
|
+
export interface PersonalPeriodSummary {
|
|
499
|
+
readonly period_start: string;
|
|
500
|
+
readonly period_end: string;
|
|
501
|
+
readonly plan: SubscriptionPlanSummary;
|
|
502
|
+
}
|
|
503
|
+
export interface PersonalPeriodPage {
|
|
504
|
+
readonly periods: readonly PersonalPeriodSummary[];
|
|
505
|
+
readonly next_cursor: string | null;
|
|
506
|
+
}
|
|
507
|
+
export declare function validatePersonalPeriodPage(value: unknown, options?: ParseOptions): Result<PersonalPeriodPage>;
|
|
508
|
+
export declare const API_KEY_SCOPES: readonly ["model", "reporting"];
|
|
509
|
+
export type ApiKeyScope = (typeof API_KEY_SCOPES)[number];
|
|
510
|
+
/**
|
|
511
|
+
* What a person reads for each key scope (`specs/PROTOCOLS.md`, "Key scope
|
|
512
|
+
* display names"). The wire values stay `model` and `reporting`; only the
|
|
513
|
+
* dashboard, CLI human output, and docs use these names, because "model" read
|
|
514
|
+
* as a choice of AI model rather than as what the key is for. Both the
|
|
515
|
+
* dashboard and the CLI read them from here so the wording cannot drift.
|
|
516
|
+
*/
|
|
517
|
+
export declare const API_KEY_SCOPE_LABELS: Readonly<Record<ApiKeyScope, {
|
|
518
|
+
readonly label: string;
|
|
519
|
+
readonly description: string;
|
|
520
|
+
}>>;
|
|
521
|
+
/** Label for a scope that was read as the unknown-enum `"other"`. */
|
|
522
|
+
export declare const UNKNOWN_API_KEY_SCOPE_LABEL = "Key";
|
|
523
|
+
export declare const API_KEY_STATUSES: readonly ["active", "revoked", "expired"];
|
|
524
|
+
/**
|
|
525
|
+
* Shared by every `api_keys` list on the wire: `BusinessDashboardInfo`'s
|
|
526
|
+
* per-application list, `BusinessApplicationDetail`'s own list, and the bare
|
|
527
|
+
* list/creation/rotation responses under `POST|GET|DELETE /v1/dashboard/business/keys*`.
|
|
528
|
+
*/
|
|
529
|
+
export interface ApiKeyMetadata {
|
|
530
|
+
readonly id: string;
|
|
531
|
+
readonly name: string;
|
|
532
|
+
readonly prefix: string;
|
|
533
|
+
readonly scope: Readable<"model" | "reporting">;
|
|
534
|
+
readonly application_id: string | null;
|
|
535
|
+
readonly environment: Readable<"test" | "live"> | null;
|
|
536
|
+
readonly status: Readable<"active" | "revoked" | "expired">;
|
|
537
|
+
readonly created_at: string;
|
|
538
|
+
readonly expires_at: string | null;
|
|
539
|
+
readonly last_used_at: string | null;
|
|
540
|
+
}
|
|
541
|
+
export declare function validateApiKeyMetadata(value: unknown, param?: string, options?: ParseOptions): Result<ApiKeyMetadata>;
|
|
542
|
+
/** The bare `ApiKeyMetadata[]` returned by `GET|DELETE /v1/dashboard/business/keys*`. */
|
|
543
|
+
export declare function validateApiKeyMetadataList(value: unknown, options?: ParseOptions): Result<readonly ApiKeyMetadata[]>;
|
|
544
|
+
export interface BusinessDailyVisitor {
|
|
545
|
+
readonly date: string;
|
|
546
|
+
readonly count: number;
|
|
547
|
+
}
|
|
548
|
+
/** One UTC day of the business-wide request and premium-earnings series. */
|
|
549
|
+
export interface BusinessDailyUsage {
|
|
550
|
+
readonly date: string;
|
|
551
|
+
readonly standard_requests: number;
|
|
552
|
+
readonly premium_requests: number;
|
|
553
|
+
readonly premium_earnings_nano_usd: string;
|
|
554
|
+
}
|
|
555
|
+
export interface BusinessApplicationUsageBucket {
|
|
556
|
+
readonly requests: number;
|
|
557
|
+
readonly used_nano_usd: string;
|
|
558
|
+
}
|
|
559
|
+
export interface BusinessApplicationPremiumUsageBucket extends BusinessApplicationUsageBucket {
|
|
560
|
+
readonly earnings_nano_usd: string;
|
|
561
|
+
}
|
|
562
|
+
export interface BusinessApplicationUsage {
|
|
563
|
+
readonly standard: BusinessApplicationUsageBucket;
|
|
564
|
+
readonly premium: BusinessApplicationPremiumUsageBucket;
|
|
565
|
+
}
|
|
566
|
+
export declare const APPLICATION_STATUSES: readonly ["active", "suspended", "closed"];
|
|
567
|
+
/**
|
|
568
|
+
* One entry of `BusinessDashboardInfo.applications`, shared by
|
|
569
|
+
* `GET /v1/dashboard/business` and `GET /v1/business/info` because both
|
|
570
|
+
* routes return the one `BusinessDashboardInfo` this module declares once.
|
|
571
|
+
*/
|
|
572
|
+
export interface BusinessApplicationSummary {
|
|
573
|
+
readonly id: string;
|
|
574
|
+
readonly name: string;
|
|
575
|
+
readonly environment: Readable<"test" | "live">;
|
|
576
|
+
readonly status: Readable<"active" | "suspended" | "closed">;
|
|
577
|
+
readonly client_id: string;
|
|
578
|
+
/** The stored presentation icon; omitted when none is set. */
|
|
579
|
+
readonly icon_url?: string;
|
|
580
|
+
readonly created_at: string;
|
|
581
|
+
readonly api_keys: readonly ApiKeyMetadata[];
|
|
582
|
+
readonly daily_visitors: readonly BusinessDailyVisitor[];
|
|
583
|
+
/**
|
|
584
|
+
* Distinct personal principals with at least one call anywhere in the
|
|
585
|
+
* range: one person counts once however many days they called, so this is
|
|
586
|
+
* never the sum of `daily_visitors`.
|
|
587
|
+
*/
|
|
588
|
+
readonly visitors: number;
|
|
589
|
+
readonly usage: BusinessApplicationUsage;
|
|
590
|
+
}
|
|
591
|
+
export interface BusinessDashboardBusiness {
|
|
592
|
+
readonly id: string;
|
|
593
|
+
readonly name: string;
|
|
594
|
+
readonly email?: string;
|
|
595
|
+
}
|
|
596
|
+
export interface BusinessEarnings {
|
|
597
|
+
readonly earnings_nano_usd: string;
|
|
598
|
+
readonly payout_pending_nano_usd: string;
|
|
599
|
+
readonly display_currency: Readable<"USD">;
|
|
600
|
+
}
|
|
601
|
+
export declare const CONNECTED_ACCOUNT_STATUSES: readonly ["none", "onboarding", "restricted", "enabled", "rejected"];
|
|
602
|
+
export declare const PAYOUT_BLOCKED_REASONS: readonly ["payout_blocked", "below_minimum", "outstanding_deficit", "tax_details_required", "payout_account_incomplete", "monthly_payout_taken", "payout_pending"];
|
|
603
|
+
/** The complete business permission vocabulary carried on dashboard reads. */
|
|
604
|
+
export declare const BUSINESS_PERMISSIONS: readonly ["stats.view", "apps.manage", "keys.manage", "payouts.manage", "payout_billing.manage", "members.manage", "premium.manage", "ownership.transfer"];
|
|
605
|
+
export type BusinessPermission = (typeof BUSINESS_PERMISSIONS)[number];
|
|
606
|
+
/** Role names are wire vocabulary; Account alone maps them to permissions. */
|
|
607
|
+
export declare const BUSINESS_ROLE_NAMES: readonly ["owner", "admin", "developer", "viewer"];
|
|
608
|
+
export type BusinessRole = (typeof BUSINESS_ROLE_NAMES)[number];
|
|
609
|
+
export type AssignableBusinessRole = Exclude<BusinessRole, "owner">;
|
|
610
|
+
export declare function validateBusinessPermission(value: unknown, param?: string, options?: ParseOptions): Result<Readable<BusinessPermission>>;
|
|
611
|
+
export declare function validateBusinessRole(value: unknown, param?: string, options?: ParseOptions): Result<Readable<BusinessRole>>;
|
|
612
|
+
export type PayoutBlockedReason = (typeof PAYOUT_BLOCKED_REASONS)[number];
|
|
613
|
+
export interface BusinessPayoutInfo {
|
|
614
|
+
readonly eligible: boolean;
|
|
615
|
+
readonly connected_account_status: Readable<"none" | "onboarding" | "restricted" | "enabled" | "rejected">;
|
|
616
|
+
readonly policy_code_version: string;
|
|
617
|
+
readonly minimum_available_nano_usd: string;
|
|
618
|
+
readonly next_eligible_at: string | null;
|
|
619
|
+
readonly blocked_reason?: Readable<PayoutBlockedReason>;
|
|
620
|
+
}
|
|
621
|
+
/**
|
|
622
|
+
* `GET /v1/dashboard/business` and `GET /v1/business/info` return this same
|
|
623
|
+
* body, "composed once by a single backend read-model builder so the two
|
|
624
|
+
* entry points cannot drift" — this is the one declaration that validates
|
|
625
|
+
* both.
|
|
626
|
+
*/
|
|
627
|
+
/**
|
|
628
|
+
* The business-wide aggregate over the requested range, across every owned
|
|
629
|
+
* application whatever page `applications` is on. `daily_visitors` counts a
|
|
630
|
+
* person once per day across the business, so it is not the sum of the
|
|
631
|
+
* per-application series; `usage` is the exact sum of every application's.
|
|
632
|
+
*/
|
|
633
|
+
export interface BusinessTraffic {
|
|
634
|
+
readonly daily_visitors: readonly BusinessDailyVisitor[];
|
|
635
|
+
/** Per-UTC-day requests and premium earnings; days with no calls are omitted. */
|
|
636
|
+
readonly daily_usage: readonly BusinessDailyUsage[];
|
|
637
|
+
readonly usage: BusinessApplicationUsage;
|
|
638
|
+
}
|
|
639
|
+
/** One past payout of the active business (`GET /v1/dashboard/business/payouts`). */
|
|
640
|
+
export interface BusinessPayoutRecord {
|
|
641
|
+
readonly id: string;
|
|
642
|
+
readonly amount_nano_usd: string;
|
|
643
|
+
readonly status: Readable<"pending" | "completed" | "failed" | "canceled">;
|
|
644
|
+
readonly requested_at: string;
|
|
645
|
+
/** Null exactly while the payout is pending. */
|
|
646
|
+
readonly settled_at: string | null;
|
|
647
|
+
}
|
|
648
|
+
export declare const BUSINESS_PAYOUT_STATUSES: readonly ["pending", "completed", "failed", "canceled"];
|
|
649
|
+
/** `GET /v1/dashboard/business/payouts` response. */
|
|
650
|
+
export interface BusinessPayoutList {
|
|
651
|
+
readonly payouts: readonly BusinessPayoutRecord[];
|
|
652
|
+
readonly next_cursor: string | null;
|
|
653
|
+
}
|
|
654
|
+
export declare function validateBusinessPayoutList(value: unknown, options?: ParseOptions): Result<BusinessPayoutList>;
|
|
655
|
+
export interface BusinessDashboardInfo {
|
|
656
|
+
readonly business: BusinessDashboardBusiness;
|
|
657
|
+
readonly earnings: BusinessEarnings;
|
|
658
|
+
readonly payout: BusinessPayoutInfo;
|
|
659
|
+
readonly traffic: BusinessTraffic;
|
|
660
|
+
readonly applications: readonly BusinessApplicationSummary[];
|
|
661
|
+
readonly next_cursor: string | null;
|
|
662
|
+
readonly range: DashboardRange;
|
|
663
|
+
readonly data_fresh_at: string;
|
|
664
|
+
}
|
|
665
|
+
export declare function validateBusinessDashboardInfo(value: unknown, options?: ParseOptions): Result<BusinessDashboardInfo>;
|
|
666
|
+
export interface CreateBusinessApplicationRequest {
|
|
667
|
+
readonly name: string;
|
|
668
|
+
readonly environment: "test" | "live";
|
|
669
|
+
readonly redirect_uris: readonly string[];
|
|
670
|
+
readonly allowed_origins: readonly string[];
|
|
671
|
+
readonly icon_url?: string;
|
|
672
|
+
readonly description?: string;
|
|
673
|
+
readonly estimated_avg_charge_nano_usd?: string;
|
|
674
|
+
}
|
|
675
|
+
export declare function validateCreateBusinessApplicationRequest(value: unknown): Result<CreateBusinessApplicationRequest>;
|
|
676
|
+
export interface UpdateBusinessApplicationRequest {
|
|
677
|
+
readonly name?: string;
|
|
678
|
+
readonly redirect_uris?: readonly string[];
|
|
679
|
+
readonly allowed_origins?: readonly string[];
|
|
680
|
+
readonly icon_url?: string | null;
|
|
681
|
+
readonly description?: string | null;
|
|
682
|
+
readonly estimated_avg_charge_nano_usd?: string | null;
|
|
683
|
+
}
|
|
684
|
+
export declare function validateUpdateBusinessApplicationRequest(value: unknown): Result<UpdateBusinessApplicationRequest>;
|
|
685
|
+
export interface BusinessApplicationAnalyticsDay {
|
|
686
|
+
readonly day: string;
|
|
687
|
+
readonly daily_visitors: number;
|
|
688
|
+
readonly standard_requests: number;
|
|
689
|
+
readonly premium_requests: number;
|
|
690
|
+
readonly standard_used_nano_usd: string;
|
|
691
|
+
readonly premium_used_nano_usd: string;
|
|
692
|
+
readonly business_earnings_nano_usd: string;
|
|
693
|
+
}
|
|
694
|
+
export interface BusinessApplicationAnalytics {
|
|
695
|
+
readonly range: DashboardRange;
|
|
696
|
+
readonly days: readonly BusinessApplicationAnalyticsDay[];
|
|
697
|
+
readonly next_cursor: string | null;
|
|
698
|
+
}
|
|
699
|
+
/**
|
|
700
|
+
* `info` holds exactly the allowlisted presentation metadata — `icon_url`,
|
|
701
|
+
* `description`, and `estimated_avg_charge_nano_usd` — per `specs/PROTOCOLS.md`'s `BusinessApplicationDetail`
|
|
702
|
+
* bullet: its two keys are named there rather than left to prose, since a
|
|
703
|
+
* shape whose keys are only described in prose is a shape each side spells
|
|
704
|
+
* its own way.
|
|
705
|
+
*/
|
|
706
|
+
export interface BusinessApplicationInfo {
|
|
707
|
+
readonly icon_url?: string;
|
|
708
|
+
readonly description?: string;
|
|
709
|
+
readonly estimated_avg_charge_nano_usd?: string;
|
|
710
|
+
}
|
|
711
|
+
/** Validates the allowlisted presentation object in a business application read. */
|
|
712
|
+
export declare function validateBusinessApplicationInfo(value: unknown, param?: string, options?: ParseOptions): Result<BusinessApplicationInfo | null>;
|
|
713
|
+
/**
|
|
714
|
+
* `POST /v1/dashboard/business/applications`, its `PATCH`, and
|
|
715
|
+
* `GET /v1/dashboard/business/applications/{application_id}` all return
|
|
716
|
+
* this one shape.
|
|
717
|
+
*
|
|
718
|
+
* `redirect_uris` and `allowed_origins` are read back from the Better Auth
|
|
719
|
+
* OAuth client row the business's application actually authorizes against
|
|
720
|
+
* (see `apps/backend/src/frontend/dashboard.ts`'s `buildBusinessApplicationDetail()`),
|
|
721
|
+
* not a second copy that could drift from it.
|
|
722
|
+
*/
|
|
723
|
+
export interface BusinessApplicationDetail {
|
|
724
|
+
readonly id: string;
|
|
725
|
+
readonly client_id: string;
|
|
726
|
+
readonly name: string;
|
|
727
|
+
readonly environment: Readable<"test" | "live">;
|
|
728
|
+
readonly status: Readable<"active" | "suspended" | "closed">;
|
|
729
|
+
/** The application's premium switch (owner decision 2026-10-25). */
|
|
730
|
+
readonly premium_enabled: boolean;
|
|
731
|
+
readonly info: BusinessApplicationInfo | null;
|
|
732
|
+
readonly redirect_uris: readonly string[];
|
|
733
|
+
readonly allowed_origins: readonly string[];
|
|
734
|
+
readonly created_at: string;
|
|
735
|
+
readonly analytics: BusinessApplicationAnalytics;
|
|
736
|
+
readonly api_keys: readonly ApiKeyMetadata[];
|
|
737
|
+
}
|
|
738
|
+
export declare function validateBusinessApplicationDetail(value: unknown, options?: ParseOptions): Result<BusinessApplicationDetail>;
|
|
739
|
+
/**
|
|
740
|
+
* `PUT /v1/dashboard/business/applications/{application_id}/premium`'s request
|
|
741
|
+
* body (owner decision 2026-10-25): exactly `{ enabled: boolean }`. Any other
|
|
742
|
+
* field, or a non-boolean `enabled`, is `invalid_value`.
|
|
743
|
+
*/
|
|
744
|
+
export interface BusinessApplicationPremiumRequest {
|
|
745
|
+
readonly enabled: boolean;
|
|
746
|
+
}
|
|
747
|
+
export declare function validateBusinessApplicationPremiumRequest(value: unknown): Result<BusinessApplicationPremiumRequest>;
|
|
748
|
+
/** `POST /v1/dashboard/business/keys`'s request body. */
|
|
749
|
+
export interface CreateBusinessKeyRequest {
|
|
750
|
+
readonly scope: "model" | "reporting";
|
|
751
|
+
readonly name: string;
|
|
752
|
+
readonly application_id?: string;
|
|
753
|
+
readonly expires_at?: string;
|
|
754
|
+
}
|
|
755
|
+
export declare function validateCreateBusinessKeyRequest(value: unknown): Result<CreateBusinessKeyRequest>;
|
|
756
|
+
/** The shared shape of `POST /v1/dashboard/business/keys` and its `.../rotate` response. */
|
|
757
|
+
export interface CreateBusinessKeyResponse {
|
|
758
|
+
readonly metadata: ApiKeyMetadata;
|
|
759
|
+
readonly secret: string;
|
|
760
|
+
}
|
|
761
|
+
export declare function validateCreateBusinessKeyResponse(value: unknown, options?: ParseOptions): Result<CreateBusinessKeyResponse>;
|
|
762
|
+
/** `POST /v1/dashboard/business/payouts`'s request body. */
|
|
763
|
+
export declare function validateCreateBusinessPayoutRequest(value: unknown): Result<{
|
|
764
|
+
readonly amount_nano_usd: string;
|
|
765
|
+
}>;
|
|
766
|
+
/** `POST /v1/dashboard/business/payout-account/onboarding`'s response. */
|
|
767
|
+
export interface BusinessPayoutAccountOnboardingResponse {
|
|
768
|
+
readonly url: string;
|
|
769
|
+
readonly expires_at: string;
|
|
770
|
+
}
|
|
771
|
+
export declare function validateBusinessPayoutAccountOnboardingResponse(value: unknown, options?: ParseOptions): Result<BusinessPayoutAccountOnboardingResponse>;
|
|
772
|
+
/**
|
|
773
|
+
* `POST /v1/dashboard/personal/payment-method/setup` and
|
|
774
|
+
* `POST /v1/dashboard/business/payout-account/onboarding` both "take no
|
|
775
|
+
* body"; a request carrying one is rejected rather than silently ignored.
|
|
776
|
+
*/
|
|
777
|
+
export declare function validateEmptyRequestBody(value: unknown): Result<Record<string, never>>;
|
|
778
|
+
export interface BusinessAccessActiveBusiness {
|
|
779
|
+
readonly id: string;
|
|
780
|
+
readonly name: string;
|
|
781
|
+
/** RFC3339 creation time; the Overview "All" range starts at its UTC midnight. */
|
|
782
|
+
readonly created_at: string;
|
|
783
|
+
readonly role: Readable<BusinessRole>;
|
|
784
|
+
readonly permissions: readonly Readable<BusinessPermission>[];
|
|
785
|
+
}
|
|
786
|
+
export interface BusinessAccessBusiness {
|
|
787
|
+
readonly id: string;
|
|
788
|
+
readonly name: string;
|
|
789
|
+
readonly role: Readable<BusinessRole>;
|
|
790
|
+
readonly status: Readable<"active" | "suspended" | "closed">;
|
|
791
|
+
}
|
|
792
|
+
export interface PendingBusinessInvitation {
|
|
793
|
+
readonly id: string;
|
|
794
|
+
readonly business_id: string;
|
|
795
|
+
readonly business_name: string;
|
|
796
|
+
readonly role: Readable<AssignableBusinessRole>;
|
|
797
|
+
readonly invited_by_email: string | null;
|
|
798
|
+
readonly expires_at: string;
|
|
799
|
+
}
|
|
800
|
+
export interface BusinessAccess {
|
|
801
|
+
readonly login: {
|
|
802
|
+
readonly email: string;
|
|
803
|
+
};
|
|
804
|
+
readonly owns_business: boolean;
|
|
805
|
+
readonly active_business: BusinessAccessActiveBusiness | null;
|
|
806
|
+
readonly businesses: readonly BusinessAccessBusiness[];
|
|
807
|
+
readonly pending_invitations: readonly PendingBusinessInvitation[];
|
|
808
|
+
}
|
|
809
|
+
export declare function validateBusinessAccess(value: unknown, options?: ParseOptions): Result<BusinessAccess>;
|
|
810
|
+
export interface BusinessMember {
|
|
811
|
+
readonly id: string;
|
|
812
|
+
readonly email: string;
|
|
813
|
+
readonly role: Readable<AssignableBusinessRole>;
|
|
814
|
+
readonly joined_at: string;
|
|
815
|
+
readonly is_you: boolean;
|
|
816
|
+
}
|
|
817
|
+
export interface BusinessMemberInvitation {
|
|
818
|
+
readonly id: string;
|
|
819
|
+
readonly email: string;
|
|
820
|
+
readonly role: Readable<AssignableBusinessRole>;
|
|
821
|
+
readonly invited_by_email: string | null;
|
|
822
|
+
readonly created_at: string;
|
|
823
|
+
readonly expires_at: string;
|
|
824
|
+
}
|
|
825
|
+
export interface BusinessMemberList {
|
|
826
|
+
readonly owner: {
|
|
827
|
+
readonly email: string;
|
|
828
|
+
readonly is_you: boolean;
|
|
829
|
+
};
|
|
830
|
+
readonly members: readonly BusinessMember[];
|
|
831
|
+
readonly invitations: readonly BusinessMemberInvitation[];
|
|
832
|
+
}
|
|
833
|
+
export declare function validateBusinessMemberList(value: unknown, options?: ParseOptions): Result<BusinessMemberList>;
|
|
834
|
+
export interface BusinessInvitationResult {
|
|
835
|
+
readonly invitation: BusinessMemberInvitation;
|
|
836
|
+
readonly email_delivery: Readable<"sent" | "failed">;
|
|
837
|
+
}
|
|
838
|
+
export declare function validateBusinessInvitationResult(value: unknown, options?: ParseOptions): Result<BusinessInvitationResult>;
|
|
839
|
+
/** `POST /v1/dashboard/business/access/businesses` request. */
|
|
840
|
+
export declare function validateCreateBusinessRequest(value: unknown): Result<{
|
|
841
|
+
readonly name: string;
|
|
842
|
+
}>;
|
|
843
|
+
/** `PUT /v1/dashboard/business/access/active` request. */
|
|
844
|
+
export declare function validateSelectActiveBusinessRequest(value: unknown): Result<{
|
|
845
|
+
readonly business_id: string;
|
|
846
|
+
}>;
|
|
847
|
+
export declare function validateBusinessInvitationRequest(value: unknown): Result<{
|
|
848
|
+
readonly email: string;
|
|
849
|
+
readonly role: AssignableBusinessRole;
|
|
850
|
+
}>;
|
|
851
|
+
export declare function validateChangeBusinessMemberRoleRequest(value: unknown): Result<{
|
|
852
|
+
readonly role: AssignableBusinessRole;
|
|
853
|
+
}>;
|
|
854
|
+
export declare function validateTransferBusinessOwnershipRequest(value: unknown): Result<{
|
|
855
|
+
readonly member_id: string;
|
|
856
|
+
}>;
|
|
857
|
+
/** `POST /v1/dashboard/business/access/email`'s request body (sign-in email change start). */
|
|
858
|
+
export declare function validateStartBusinessLoginEmailChangeRequest(value: unknown): Result<{
|
|
859
|
+
readonly email: string;
|
|
860
|
+
readonly turnstile_token: unknown;
|
|
861
|
+
}>;
|
|
862
|
+
/** The `202` body of the sign-in email change start. */
|
|
863
|
+
export interface BusinessLoginEmailChallenge {
|
|
864
|
+
readonly challenge_id: string;
|
|
865
|
+
readonly resend_after_seconds: number;
|
|
866
|
+
}
|
|
867
|
+
export declare function validateBusinessLoginEmailChallenge(value: unknown, options?: ParseOptions): Result<BusinessLoginEmailChallenge>;
|
|
868
|
+
/** `POST /v1/dashboard/business/access/email/verify` takes the personal contact verify body. */
|
|
869
|
+
export declare function validateVerifyBusinessLoginEmailChangeRequest(value: unknown): Result<{
|
|
870
|
+
readonly challenge_id: string;
|
|
871
|
+
readonly code: string;
|
|
872
|
+
}>;
|
|
873
|
+
/** The two account types a visitor may sign in to, chosen on the login page. */
|
|
874
|
+
export declare const EMAIL_SIGN_IN_ACCOUNT_TYPES: readonly ["user", "business"];
|
|
875
|
+
export type EmailSignInAccountType = (typeof EMAIL_SIGN_IN_ACCOUNT_TYPES)[number];
|
|
876
|
+
/** The longest address either route accepts (the SMTP path limit). */
|
|
877
|
+
export declare const EMAIL_SIGN_IN_MAX_EMAIL_LENGTH = 254;
|
|
878
|
+
export interface EmailSignInSendRequest {
|
|
879
|
+
readonly email: string;
|
|
880
|
+
readonly account_type: EmailSignInAccountType;
|
|
881
|
+
readonly turnstile_token: unknown;
|
|
882
|
+
}
|
|
883
|
+
/** `POST /auth/email-code/send`'s request body. */
|
|
884
|
+
export declare function validateEmailSignInSendRequest(value: unknown): Result<EmailSignInSendRequest>;
|
|
885
|
+
/**
|
|
886
|
+
* `POST /auth/email-code/verify`'s request body.
|
|
887
|
+
*
|
|
888
|
+
* It deliberately does **not** extend `EmailSignInSendRequest`, even though it
|
|
889
|
+
* carries the same address and account type: the send request also carries a
|
|
890
|
+
* `turnstile_token`, and a verify route takes none. Turnstile guards the routes
|
|
891
|
+
* that send a code; a verify route sends nothing, and guessing against it is
|
|
892
|
+
* bounded by the per-code attempt limit instead. Inheriting the token field
|
|
893
|
+
* would make a client send one here and a server accept one it never checks.
|
|
894
|
+
*/
|
|
895
|
+
export interface EmailSignInVerifyRequest {
|
|
896
|
+
readonly email: string;
|
|
897
|
+
readonly account_type: EmailSignInAccountType;
|
|
898
|
+
readonly code: string;
|
|
899
|
+
}
|
|
900
|
+
/** `POST /auth/email-code/verify`'s request body. */
|
|
901
|
+
export declare function validateEmailSignInVerifyRequest(value: unknown): Result<EmailSignInVerifyRequest>;
|
|
902
|
+
/**
|
|
903
|
+
* `POST /auth/email-code/send`'s `202` body. It is identical for every address,
|
|
904
|
+
* so it carries nothing about the address or its account.
|
|
905
|
+
*/
|
|
906
|
+
export interface EmailSignInSent {
|
|
907
|
+
readonly status: Readable<"sent">;
|
|
908
|
+
readonly resend_after_seconds: number;
|
|
909
|
+
}
|
|
910
|
+
export declare function validateEmailSignInSent(value: unknown, options?: ParseOptions): Result<EmailSignInSent>;
|
|
911
|
+
/**
|
|
912
|
+
* `POST /auth/email-code/verify`'s `200` body. It carries no principal ID,
|
|
913
|
+
* session token, or email: the session travels only in the cookie.
|
|
914
|
+
*/
|
|
915
|
+
export interface EmailSignInCompleted {
|
|
916
|
+
readonly status: Readable<"signed_in">;
|
|
917
|
+
readonly account_type: Readable<EmailSignInAccountType>;
|
|
918
|
+
readonly registered: boolean;
|
|
919
|
+
readonly phone_verification_required: boolean;
|
|
920
|
+
}
|
|
921
|
+
export declare function validateEmailSignInCompleted(value: unknown, options?: ParseOptions): Result<EmailSignInCompleted>;
|
|
922
|
+
/**
|
|
923
|
+
* The longest `phone_number` either phone route accepts. The bound is a
|
|
924
|
+
* request-size guard, not a formatting rule: whether a number is valid, in an
|
|
925
|
+
* allowed region, and of a type that can receive an SMS is decided server-side
|
|
926
|
+
* against the deployed region list, which the wire contract does not know.
|
|
927
|
+
*/
|
|
928
|
+
export declare const PHONE_NUMBER_MAX_LENGTH = 32;
|
|
929
|
+
export interface PhoneVerificationSendRequest {
|
|
930
|
+
readonly phone_number: string;
|
|
931
|
+
readonly turnstile_token: unknown;
|
|
932
|
+
}
|
|
933
|
+
/** `POST /auth/phone/send`'s request body. */
|
|
934
|
+
export declare function validatePhoneVerificationSendRequest(value: unknown): Result<PhoneVerificationSendRequest>;
|
|
935
|
+
export interface PhoneVerificationVerifyRequest {
|
|
936
|
+
readonly phone_number: string;
|
|
937
|
+
readonly code: string;
|
|
938
|
+
}
|
|
939
|
+
/**
|
|
940
|
+
* `POST /auth/phone/verify`'s request body. It takes no Turnstile token: the
|
|
941
|
+
* route sends nothing, and guessing is bounded by the per-code attempt limit.
|
|
942
|
+
*/
|
|
943
|
+
export declare function validatePhoneVerificationVerifyRequest(value: unknown): Result<PhoneVerificationVerifyRequest>;
|
|
944
|
+
/**
|
|
945
|
+
* `POST /auth/phone/send`'s `202` body. It is identical for every number, so
|
|
946
|
+
* it carries nothing about the number, its holder, or whether one exists.
|
|
947
|
+
*/
|
|
948
|
+
export interface PhoneVerificationSent {
|
|
949
|
+
readonly status: Readable<"sent">;
|
|
950
|
+
readonly resend_after_seconds: number;
|
|
951
|
+
}
|
|
952
|
+
export declare function validatePhoneVerificationSent(value: unknown, options?: ParseOptions): Result<PhoneVerificationSent>;
|
|
953
|
+
/**
|
|
954
|
+
* `POST /auth/phone/verify`'s `200` body. `registered` tells the login page
|
|
955
|
+
* whether this request created the personal account, which is the only moment
|
|
956
|
+
* a personal principal comes into existence.
|
|
957
|
+
*/
|
|
958
|
+
export interface PhoneVerificationCompleted {
|
|
959
|
+
readonly status: Readable<"verified">;
|
|
960
|
+
readonly registered: boolean;
|
|
961
|
+
}
|
|
962
|
+
export declare function validatePhoneVerificationCompleted(value: unknown, options?: ParseOptions): Result<PhoneVerificationCompleted>;
|
|
963
|
+
/** `POST /v1/dashboard/personal/gift-codes/redeem` returns the confirmed personal dashboard body. */
|
|
964
|
+
export declare function validateRedeemGiftCodeResponse(value: unknown, options?: ParseOptions): Result<PersonalDashboard>;
|
|
965
|
+
/** The two kinds of CLI authorization: a fresh sign-in, or a recency renewal for an existing credential. */
|
|
966
|
+
export declare const CLI_AUTHORIZATION_KINDS: readonly ["login", "step_up"];
|
|
967
|
+
export type CliAuthorizationKind = (typeof CLI_AUTHORIZATION_KINDS)[number];
|
|
968
|
+
/** The longest device label, counted in characters after trimming. */
|
|
969
|
+
export declare const CLI_DEVICE_LABEL_MAX_LENGTH = 64;
|
|
970
|
+
/**
|
|
971
|
+
* The user-code alphabet: consonants only, so no code spells a word and no two
|
|
972
|
+
* characters are easily confused (no vowels, no `0/O`, no `1/I/L` pairs).
|
|
973
|
+
*/
|
|
974
|
+
export declare const CLI_USER_CODE_ALPHABET = "BCDFGHJKLMNPQRSTVWXZ";
|
|
975
|
+
/**
|
|
976
|
+
* Normalizes a user code as typed or pasted by a person: case-insensitive,
|
|
977
|
+
* with or without the hyphen, ignoring surrounding and inner spaces. Returns
|
|
978
|
+
* the canonical `XXXX-XXXX` form, or null when the value can never be a code.
|
|
979
|
+
* The backend and the `/cli/authorize` page both use this, so a code that one
|
|
980
|
+
* accepts the other accepts too.
|
|
981
|
+
*/
|
|
982
|
+
export declare function normalizeCliUserCode(value: string): string | null;
|
|
983
|
+
/** `POST /v1/cli/authorizations` request. */
|
|
984
|
+
export interface StartCliAuthorizationRequest {
|
|
985
|
+
readonly kind: CliAuthorizationKind;
|
|
986
|
+
readonly device_label: string;
|
|
987
|
+
}
|
|
988
|
+
/**
|
|
989
|
+
* Validates the start request. `device_label` is trimmed and must be 1 to
|
|
990
|
+
* `CLI_DEVICE_LABEL_MAX_LENGTH` characters with no control character, the same
|
|
991
|
+
* rule Account applies, so the CLI can refuse a bad label before sending it.
|
|
992
|
+
*/
|
|
993
|
+
export declare function validateStartCliAuthorizationRequest(value: unknown): Result<StartCliAuthorizationRequest>;
|
|
994
|
+
/** `POST /v1/cli/authorizations` `201` body. `device_code` is a secret the CLI never prints. */
|
|
995
|
+
export interface StartedCliAuthorization {
|
|
996
|
+
readonly device_code: string;
|
|
997
|
+
readonly user_code: string;
|
|
998
|
+
readonly verification_uri: string;
|
|
999
|
+
readonly verification_uri_complete: string;
|
|
1000
|
+
readonly expires_in: number;
|
|
1001
|
+
readonly interval: number;
|
|
1002
|
+
}
|
|
1003
|
+
export declare function validateStartedCliAuthorization(value: unknown, options?: ParseOptions): Result<StartedCliAuthorization>;
|
|
1004
|
+
/** `POST /v1/cli/token` request. */
|
|
1005
|
+
export declare function validateCliTokenRequest(value: unknown): Result<{
|
|
1006
|
+
readonly device_code: string;
|
|
1007
|
+
}>;
|
|
1008
|
+
/** A `login` grant: the one response that ever carries a CLI token. */
|
|
1009
|
+
export interface CliLoginGrant {
|
|
1010
|
+
readonly kind: "login";
|
|
1011
|
+
readonly token: string;
|
|
1012
|
+
readonly token_expires_at: string;
|
|
1013
|
+
readonly credential_id: string;
|
|
1014
|
+
readonly business: {
|
|
1015
|
+
readonly id: string;
|
|
1016
|
+
readonly name: string;
|
|
1017
|
+
};
|
|
1018
|
+
readonly login: {
|
|
1019
|
+
readonly email: string;
|
|
1020
|
+
};
|
|
1021
|
+
}
|
|
1022
|
+
/** A `step_up` grant: the credential's recency was renewed; no new token. */
|
|
1023
|
+
export interface CliStepUpGrant {
|
|
1024
|
+
readonly kind: "step_up";
|
|
1025
|
+
readonly reauthenticated_at: string;
|
|
1026
|
+
}
|
|
1027
|
+
/** `POST /v1/cli/token` `200` body. */
|
|
1028
|
+
export type CliTokenGrant = CliLoginGrant | CliStepUpGrant;
|
|
1029
|
+
/**
|
|
1030
|
+
* Validates a token grant. `kind` is the discriminant, so an unknown kind is
|
|
1031
|
+
* refused even in tolerant mode: a client cannot act on a grant it cannot
|
|
1032
|
+
* classify, and reading it as `"other"` would lose the token silently.
|
|
1033
|
+
*/
|
|
1034
|
+
export declare function validateCliTokenGrant(value: unknown, options?: ParseOptions): Result<CliTokenGrant>;
|
|
1035
|
+
/** `GET /v1/dashboard/business/access/cli-authorizations/{user_code}` body. */
|
|
1036
|
+
export interface CliAuthorizationView {
|
|
1037
|
+
readonly user_code: string;
|
|
1038
|
+
readonly kind: Readable<CliAuthorizationKind>;
|
|
1039
|
+
readonly device_label: string;
|
|
1040
|
+
readonly expires_at: string;
|
|
1041
|
+
readonly business: {
|
|
1042
|
+
readonly id: string;
|
|
1043
|
+
readonly name: string;
|
|
1044
|
+
} | null;
|
|
1045
|
+
}
|
|
1046
|
+
export declare function validateCliAuthorizationView(value: unknown, options?: ParseOptions): Result<CliAuthorizationView>;
|
|
1047
|
+
/** One entry of `GET /v1/dashboard/business/access/cli-credentials`. Never carries a token. */
|
|
1048
|
+
export interface CliCredentialSummary {
|
|
1049
|
+
readonly id: string;
|
|
1050
|
+
readonly device_label: string;
|
|
1051
|
+
readonly business: {
|
|
1052
|
+
readonly id: string;
|
|
1053
|
+
readonly name: string;
|
|
1054
|
+
};
|
|
1055
|
+
readonly approved_at: string;
|
|
1056
|
+
readonly last_used_at: string | null;
|
|
1057
|
+
readonly expires_at: string;
|
|
1058
|
+
}
|
|
1059
|
+
/** `GET|DELETE /v1/dashboard/business/access/cli-credentials*` body. */
|
|
1060
|
+
export interface CliCredentialList {
|
|
1061
|
+
readonly credentials: readonly CliCredentialSummary[];
|
|
1062
|
+
}
|
|
1063
|
+
export declare function validateCliCredentialList(value: unknown, options?: ParseOptions): Result<CliCredentialList>;
|
|
1064
|
+
/**
|
|
1065
|
+
* `GET /v1/dashboard/business/keys?scope&application_id` query. Both filters
|
|
1066
|
+
* are optional. An unknown scope, or `application_id` together with
|
|
1067
|
+
* `scope=reporting` (a reporting key belongs to no application), is
|
|
1068
|
+
* `invalid_value`. Whether the application belongs to the business is the
|
|
1069
|
+
* backend's check, not this one.
|
|
1070
|
+
*/
|
|
1071
|
+
export declare function validateBusinessKeyListQuery(query: {
|
|
1072
|
+
readonly scope?: string | null;
|
|
1073
|
+
readonly application_id?: string | null;
|
|
1074
|
+
}): Result<{
|
|
1075
|
+
readonly scope?: "model" | "reporting";
|
|
1076
|
+
readonly application_id?: string;
|
|
1077
|
+
}>;
|
|
1078
|
+
export {};
|