@madewithremy/admin 0.1.56 → 0.1.58
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 +16 -0
- package/README.md +1 -1
- package/dist/client.d.ts +199 -0
- package/dist/config.d.ts +8 -0
- package/dist/ctx.d.ts +36 -0
- package/dist/errors.d.ts +68 -0
- package/dist/http.d.ts +68 -0
- package/dist/index.d.ts +7 -9434
- package/dist/index.js +6 -6
- package/dist/index.js.map +7 -1
- package/dist/ops/agent.d.ts +44 -0
- package/dist/ops/analytics.d.ts +285 -0
- package/dist/ops/apps.d.ts +33 -0
- package/dist/ops/crashes.d.ts +86 -0
- package/dist/ops/cron.d.ts +40 -0
- package/dist/ops/data.d.ts +68 -0
- package/dist/ops/dataSourceConnectors.d.ts +80 -0
- package/dist/ops/dataSourceEvals.d.ts +208 -0
- package/dist/ops/dataSourceJobs.d.ts +141 -0
- package/dist/ops/dataSourceMappers.d.ts +125 -0
- package/dist/ops/dataSources.d.ts +654 -0
- package/dist/ops/db.d.ts +81 -0
- package/dist/ops/diagnostics.d.ts +42 -0
- package/dist/ops/domains.d.ts +250 -0
- package/dist/ops/email.d.ts +305 -0
- package/dist/ops/events.d.ts +56 -0
- package/dist/ops/feedback.d.ts +24 -0
- package/dist/ops/files.d.ts +166 -0
- package/dist/ops/infra.d.ts +163 -0
- package/dist/ops/issues.d.ts +160 -0
- package/dist/ops/jewels.d.ts +249 -0
- package/dist/ops/methods.d.ts +60 -0
- package/dist/ops/prerender.d.ts +74 -0
- package/dist/ops/previews.d.ts +52 -0
- package/dist/ops/qaRecordings.d.ts +68 -0
- package/dist/ops/releases.d.ts +193 -0
- package/dist/ops/requests.d.ts +73 -0
- package/dist/ops/secrets.d.ts +69 -0
- package/dist/ops/settings.d.ts +45 -0
- package/dist/ops/tasks.d.ts +47 -0
- package/dist/ops/usage.d.ts +40 -0
- package/dist/ops/users.d.ts +59 -0
- package/dist/ops/voice.d.ts +178 -0
- package/dist/output.d.ts +19 -0
- package/dist/parseJsonConfig.d.ts +41 -0
- package/dist/poll.d.ts +38 -0
- package/dist/prod.js +24 -21
- package/dist/runningMethod.d.ts +25 -0
- package/dist/sleep.d.ts +12 -0
- package/dist/types/agent.d.ts +95 -0
- package/dist/types/analytics.d.ts +225 -0
- package/dist/types/apps.d.ts +39 -0
- package/dist/types/crashes.d.ts +81 -0
- package/dist/types/cron.d.ts +68 -0
- package/dist/types/data.d.ts +38 -0
- package/dist/types/dataSourceConnectors.d.ts +59 -0
- package/dist/types/dataSourceEvals.d.ts +225 -0
- package/dist/types/dataSourceJobs.d.ts +283 -0
- package/dist/types/dataSourceMappers.d.ts +204 -0
- package/dist/types/dataSourceReaders.d.ts +102 -0
- package/dist/types/dataSources.d.ts +627 -0
- package/dist/types/db.d.ts +63 -0
- package/dist/types/diagnostics.d.ts +96 -0
- package/dist/types/domains.d.ts +277 -0
- package/dist/types/email.d.ts +400 -0
- package/dist/types/events.d.ts +54 -0
- package/dist/types/feedback.d.ts +11 -0
- package/dist/types/files.d.ts +150 -0
- package/dist/types/index.d.ts +37 -0
- package/dist/types/infra.d.ts +188 -0
- package/dist/types/issues.d.ts +106 -0
- package/dist/types/jewels.d.ts +336 -0
- package/dist/types/methods.d.ts +34 -0
- package/dist/types/prerender.d.ts +59 -0
- package/dist/types/previews.d.ts +39 -0
- package/dist/types/progress.d.ts +31 -0
- package/dist/types/qaRecordings.d.ts +51 -0
- package/dist/types/releases.d.ts +233 -0
- package/dist/types/requests.d.ts +114 -0
- package/dist/types/secrets.d.ts +52 -0
- package/dist/types/settings.d.ts +79 -0
- package/dist/types/tasks.d.ts +99 -0
- package/dist/types/usage.d.ts +29 -0
- package/dist/types/users.d.ts +61 -0
- package/dist/types/voice.d.ts +197 -0
- package/dist/upload.d.ts +11 -0
- package/package.json +7 -10
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent-chat thread log operations.
|
|
3
|
+
*
|
|
4
|
+
* Ops are pure: (ctx, params) → typed result, throwing AdminApiError /
|
|
5
|
+
* AdminTimeoutError. No printing, no process coupling — the CLI skin in
|
|
6
|
+
* commands/agent.ts and the importable client both call these.
|
|
7
|
+
*/
|
|
8
|
+
import type { AdminContext } from '../ctx.js';
|
|
9
|
+
import type { AgentThreadsListResult } from '../types/agent.js';
|
|
10
|
+
export interface ThreadsListParams {
|
|
11
|
+
/** Max threads per page (default 20, server clamps to 100). */
|
|
12
|
+
limit?: number;
|
|
13
|
+
/** Pagination cursor from a prior page's `nextCursor`. */
|
|
14
|
+
cursor?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Every conversation the app's agent has had, newest activity first.
|
|
18
|
+
*
|
|
19
|
+
* Returns cursored pages; pass `nextCursor` from one page as `cursor` for the
|
|
20
|
+
* next. Transcripts are not included — fetch a thread with `threadsGet`.
|
|
21
|
+
*
|
|
22
|
+
* `toolErrorCount` and `hasTurnError` are how you find the conversations worth
|
|
23
|
+
* reading, and `devSession` separates your own test threads from real traffic.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* const { threads } = await admin.agent.threadsList({ limit: 20 });
|
|
27
|
+
* const broken = threads.filter((t) => t.toolErrorCount > 0 || t.hasTurnError);
|
|
28
|
+
*/
|
|
29
|
+
export declare function threadsList(ctx: AdminContext, params?: ThreadsListParams): Promise<AgentThreadsListResult>;
|
|
30
|
+
/**
|
|
31
|
+
* One thread with its full transcript: what the user said, what the agent
|
|
32
|
+
* replied, which tools it called with which arguments, and what came back.
|
|
33
|
+
*
|
|
34
|
+
* This is the primary tool for iterating on an agent's system prompt and tool
|
|
35
|
+
* descriptions — read what actually happened rather than guessing. Each method
|
|
36
|
+
* tool call carries a `requestId`; pass it to `requests.get()` for that call's
|
|
37
|
+
* input, output, stdout and error.
|
|
38
|
+
*
|
|
39
|
+
* @throws AdminApiError `thread_not_found` (404).
|
|
40
|
+
* @example
|
|
41
|
+
* const thread = await admin.agent.threadsGet('4f6c…');
|
|
42
|
+
* console.log(thread.messages);
|
|
43
|
+
*/
|
|
44
|
+
export declare function threadsGet(ctx: AdminContext, threadId: string): Promise<import("../index.js").AgentThreadDetail>;
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Analytics (insights) operations.
|
|
3
|
+
*
|
|
4
|
+
* Ops are pure: (ctx, params) → typed result, throwing AdminApiError /
|
|
5
|
+
* AdminTimeoutError. No printing, no process coupling — the CLI skin in
|
|
6
|
+
* commands/analytics.ts and the importable client both call these.
|
|
7
|
+
*/
|
|
8
|
+
import type { AdminContext } from '../ctx.js';
|
|
9
|
+
import type { AnalyticsAiSourcesResult, AnalyticsBatchResult, AnalyticsCrawlersResult, AnalyticsFunnelResult, AnalyticsLiveResult, AnalyticsMapResult, AnalyticsPathsResult, AnalyticsQueryResult, AnalyticsSourcesResult } from '../types/analytics.js';
|
|
10
|
+
/** Scope + time-window + click-filter params accepted by `sources`. */
|
|
11
|
+
export interface SourcesParams {
|
|
12
|
+
/** Scope to a specific release id. */
|
|
13
|
+
releaseId?: string;
|
|
14
|
+
/** ISO date string for the start of the query window. */
|
|
15
|
+
start?: string;
|
|
16
|
+
/** ISO date string for the end of the query window. */
|
|
17
|
+
end?: string;
|
|
18
|
+
/** Max rows to return (default 25). */
|
|
19
|
+
limit?: number;
|
|
20
|
+
/** Row offset for paging. */
|
|
21
|
+
offset?: number;
|
|
22
|
+
/** Click-filter: equality match on path. Per-event-table backed (90-day retention). */
|
|
23
|
+
path?: string;
|
|
24
|
+
/** Click-filter: equality match on referrer host. Per-event-table backed (90-day retention). */
|
|
25
|
+
referrerHost?: string;
|
|
26
|
+
/** Click-filter: equality match on country. Per-event-table backed (90-day retention). */
|
|
27
|
+
country?: string;
|
|
28
|
+
/** Click-filter: equality match on city. Per-event-table backed (90-day retention). */
|
|
29
|
+
city?: string;
|
|
30
|
+
/** Click-filter: equality match on device type. Per-event-table backed (90-day retention). */
|
|
31
|
+
device?: string;
|
|
32
|
+
/** Click-filter: equality match on browser. Per-event-table backed (90-day retention). */
|
|
33
|
+
browser?: string;
|
|
34
|
+
/** Click-filter: equality match on OS. Per-event-table backed (90-day retention). */
|
|
35
|
+
os?: string;
|
|
36
|
+
/** Click-filter: equality match on language. Per-event-table backed (90-day retention). */
|
|
37
|
+
language?: string;
|
|
38
|
+
/** Click-filter: equality match on UTM source. Per-event-table backed (90-day retention). */
|
|
39
|
+
utmSource?: string;
|
|
40
|
+
/** Click-filter: equality match on UTM medium. Per-event-table backed (90-day retention). */
|
|
41
|
+
utmMedium?: string;
|
|
42
|
+
/** Click-filter: equality match on UTM campaign. Per-event-table backed (90-day retention). */
|
|
43
|
+
utmCampaign?: string;
|
|
44
|
+
}
|
|
45
|
+
/** Same click-filter + scope params as `SourcesParams`; accepted by `map`. */
|
|
46
|
+
export interface MapParams {
|
|
47
|
+
/** Scope to a specific release id. */
|
|
48
|
+
releaseId?: string;
|
|
49
|
+
/** ISO date string for the start of the query window. */
|
|
50
|
+
start?: string;
|
|
51
|
+
/** ISO date string for the end of the query window. */
|
|
52
|
+
end?: string;
|
|
53
|
+
/** Max points to return (default 500). */
|
|
54
|
+
limit?: number;
|
|
55
|
+
/** Row offset for paging. */
|
|
56
|
+
offset?: number;
|
|
57
|
+
/** Click-filter: equality match on path. Per-event-table backed (90-day retention). */
|
|
58
|
+
path?: string;
|
|
59
|
+
/** Click-filter: equality match on referrer host. Per-event-table backed (90-day retention). */
|
|
60
|
+
referrerHost?: string;
|
|
61
|
+
/** Click-filter: equality match on country. Per-event-table backed (90-day retention). */
|
|
62
|
+
country?: string;
|
|
63
|
+
/** Click-filter: equality match on city. Per-event-table backed (90-day retention). */
|
|
64
|
+
city?: string;
|
|
65
|
+
/** Click-filter: equality match on device type. Per-event-table backed (90-day retention). */
|
|
66
|
+
device?: string;
|
|
67
|
+
/** Click-filter: equality match on browser. Per-event-table backed (90-day retention). */
|
|
68
|
+
browser?: string;
|
|
69
|
+
/** Click-filter: equality match on OS. Per-event-table backed (90-day retention). */
|
|
70
|
+
os?: string;
|
|
71
|
+
/** Click-filter: equality match on language. Per-event-table backed (90-day retention). */
|
|
72
|
+
language?: string;
|
|
73
|
+
/** Click-filter: equality match on UTM source. Per-event-table backed (90-day retention). */
|
|
74
|
+
utmSource?: string;
|
|
75
|
+
/** Click-filter: equality match on UTM medium. Per-event-table backed (90-day retention). */
|
|
76
|
+
utmMedium?: string;
|
|
77
|
+
/** Click-filter: equality match on UTM campaign. Per-event-table backed (90-day retention). */
|
|
78
|
+
utmCampaign?: string;
|
|
79
|
+
}
|
|
80
|
+
export interface AiSourcesParams {
|
|
81
|
+
/** Scope to a specific release id. */
|
|
82
|
+
releaseId?: string;
|
|
83
|
+
/** ISO date string for the start of the query window. */
|
|
84
|
+
start?: string;
|
|
85
|
+
/** ISO date string for the end of the query window. */
|
|
86
|
+
end?: string;
|
|
87
|
+
/** Max vendor rows to return (default 50). */
|
|
88
|
+
limit?: number;
|
|
89
|
+
}
|
|
90
|
+
export interface CrawlersParams {
|
|
91
|
+
/**
|
|
92
|
+
* Sub-endpoint to dispatch to:
|
|
93
|
+
* - `overview` — vendor totals + top-crawled pages.
|
|
94
|
+
* - `timeseries` — stacked-per-vendor hit counts bucketed over time.
|
|
95
|
+
* - `recent` — last N raw crawler hit rows (curiosity feed).
|
|
96
|
+
*/
|
|
97
|
+
kind: 'overview' | 'timeseries' | 'recent';
|
|
98
|
+
/** Scope to a specific release id. */
|
|
99
|
+
releaseId?: string;
|
|
100
|
+
/** ISO date string for the start of the query window. */
|
|
101
|
+
start?: string;
|
|
102
|
+
/** ISO date string for the end of the query window. */
|
|
103
|
+
end?: string;
|
|
104
|
+
/** Max rows to return (default varies by sub). */
|
|
105
|
+
limit?: number;
|
|
106
|
+
/** Number of time buckets for `timeseries` (default 24). */
|
|
107
|
+
buckets?: number;
|
|
108
|
+
/** Max top-pages rows for `overview` (default 20, max 100). */
|
|
109
|
+
topPagesLimit?: number;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Run a single analytics query: metrics × dimensions × filters × time.
|
|
113
|
+
*
|
|
114
|
+
* The query body shape (all fields optional except `metrics`):
|
|
115
|
+
* ```
|
|
116
|
+
* metrics counts: "pageviews" | "visitors" | "visits" | "events"
|
|
117
|
+
* averages (null with nothing to average): "timeOnPage" (s)
|
|
118
|
+
* | "scrollDepth" (%) | "visitDuration" (s) | "bounceRate" (%)
|
|
119
|
+
* dimensions at most ONE entity dimension OR "time" (not both):
|
|
120
|
+
* path referrerHost sourceCategory country city deviceType
|
|
121
|
+
* browser os language visitorType utmSource utmMedium
|
|
122
|
+
* utmCampaign utmTerm utmContent eventName
|
|
123
|
+
* the visit's: entryPath exitPath visitReferrerHost
|
|
124
|
+
* visitSourceCategory visitUtmSource … visitUtmContent
|
|
125
|
+
* a custom event's property: prop:<key>
|
|
126
|
+
* granularity required with "time": "5m" | "hour" | "day" | "week" | "month"
|
|
127
|
+
* timezone IANA zone for day/week/month boundaries (default UTC)
|
|
128
|
+
* filters [[op, dimension, [values...]], ...]
|
|
129
|
+
* ops: "is" (any of) | "is_not" (none of) | "contains"
|
|
130
|
+
* plus the filter-only "visitEvent": the visit fired the event
|
|
131
|
+
* dateRange "1h" | "24h" | "7d" | "30d" | "90d" | "all"
|
|
132
|
+
* or ["<startISO>", "<endISO>"] (default "24h")
|
|
133
|
+
* orderBy grouped only: [["pageviews" | "events" | "visits", "asc" | "desc"]]
|
|
134
|
+
* limit grouped only; default 25, max 1000
|
|
135
|
+
* offset paging
|
|
136
|
+
* releaseId optional release scope
|
|
137
|
+
* ```
|
|
138
|
+
*
|
|
139
|
+
* Routing (rollup vs per-event table), window clamping, and metric
|
|
140
|
+
* availability are determined by the query shape; the response `meta`
|
|
141
|
+
* reports `source`, `window.served`, `clamped`, and `metricsOmitted`.
|
|
142
|
+
* Summary KPIs, timeseries, every top-N, and event stats are all query
|
|
143
|
+
* compositions — no dedicated endpoints exist for them.
|
|
144
|
+
*
|
|
145
|
+
* @example
|
|
146
|
+
* const { results, meta } = await admin.analytics.query({
|
|
147
|
+
* metrics: ['pageviews', 'visitors'],
|
|
148
|
+
* dimensions: ['path'],
|
|
149
|
+
* dateRange: '30d',
|
|
150
|
+
* limit: 10,
|
|
151
|
+
* });
|
|
152
|
+
*/
|
|
153
|
+
export declare function query(ctx: AdminContext, body: Record<string, unknown>): Promise<AnalyticsQueryResult>;
|
|
154
|
+
/**
|
|
155
|
+
* Run up to 10 independent query bodies in one round trip.
|
|
156
|
+
*
|
|
157
|
+
* Results are in request order; each entry is a full `AnalyticsQueryResult`
|
|
158
|
+
* (with its own `meta`). Accepts a bare array of query bodies or the wire
|
|
159
|
+
* shape `{ queries: [...] }`.
|
|
160
|
+
*
|
|
161
|
+
* @example
|
|
162
|
+
* const { results } = await admin.analytics.batch([
|
|
163
|
+
* { metrics: ['pageviews', 'visits', 'visitors'] },
|
|
164
|
+
* { metrics: ['pageviews'], dimensions: ['path'], limit: 10 },
|
|
165
|
+
* ]);
|
|
166
|
+
*/
|
|
167
|
+
export declare function batch(ctx: AdminContext, queries: unknown[] | undefined): Promise<AnalyticsBatchResult>;
|
|
168
|
+
/**
|
|
169
|
+
* How many visits went through ordered steps, and where they dropped off.
|
|
170
|
+
*
|
|
171
|
+
* The body (`steps` required):
|
|
172
|
+
* ```
|
|
173
|
+
* steps 2-8 of { "page": "/pricing", "match"?: "is" | "contains" }
|
|
174
|
+
* or { "event": "signup_start", "props"?: { "plan": "pro" } },
|
|
175
|
+
* each reached after the one before it within one visit
|
|
176
|
+
* breakdown optional split: entryPath exitPath visitReferrerHost
|
|
177
|
+
* visitSourceCategory visitUtm* visitorType deviceType country
|
|
178
|
+
* browser os (its 25 largest values)
|
|
179
|
+
* filters pick visits: a visit is in when any of its rows matches them all
|
|
180
|
+
* dateRange as for query (raw events: 90 days at most)
|
|
181
|
+
* releaseId optional release scope
|
|
182
|
+
* ```
|
|
183
|
+
*
|
|
184
|
+
* Follows a visitor across the apps sharing this one's host (the apps it
|
|
185
|
+
* mounts, the app it's mounted under), the ones the caller may open; `meta.apps`
|
|
186
|
+
* lists them. Visit-level reads start when the app's visits were first
|
|
187
|
+
* recorded, which `meta.clamped` and `meta.window.served` say.
|
|
188
|
+
*
|
|
189
|
+
* @throws AdminApiError `invalid_step` (400) for a malformed or missing step,
|
|
190
|
+
* `invalid_dimension` (400) for a breakdown a visit doesn't have once,
|
|
191
|
+
* `invalid_query_field` (400) for an unknown field.
|
|
192
|
+
*
|
|
193
|
+
* @example
|
|
194
|
+
* const { steps } = await admin.analytics.funnel({
|
|
195
|
+
* steps: [{ page: '/blog/', match: 'contains' }, { event: 'signup_start' }],
|
|
196
|
+
* dateRange: '30d',
|
|
197
|
+
* });
|
|
198
|
+
*/
|
|
199
|
+
export declare function funnel(ctx: AdminContext, body: Record<string, unknown>): Promise<AnalyticsFunnelResult>;
|
|
200
|
+
/**
|
|
201
|
+
* The routes visits took: where they went after a page, and the pages they
|
|
202
|
+
* commonly opened with.
|
|
203
|
+
*
|
|
204
|
+
* The body (all optional):
|
|
205
|
+
* ```
|
|
206
|
+
* from a path: the pages opened next after it (null = left there)
|
|
207
|
+
* depth 1-5 opening pages per route (default 3)
|
|
208
|
+
* limit 1-100 rows per list (default 10)
|
|
209
|
+
* filters pick visits, as for funnel
|
|
210
|
+
* dateRange as for query (raw events: 90 days at most)
|
|
211
|
+
* releaseId optional release scope
|
|
212
|
+
* ```
|
|
213
|
+
*
|
|
214
|
+
* A page reloaded or reopened in a row counts once. Follows a visitor across
|
|
215
|
+
* the apps sharing this one's host, as `funnel` does.
|
|
216
|
+
*
|
|
217
|
+
* @throws AdminApiError `invalid_query` (400) for a `depth` or `limit` out of
|
|
218
|
+
* range, `invalid_query_field` (400) for an unknown field.
|
|
219
|
+
*
|
|
220
|
+
* @example
|
|
221
|
+
* const { next, routes } = await admin.analytics.paths({
|
|
222
|
+
* from: '/pricing',
|
|
223
|
+
* dateRange: '7d',
|
|
224
|
+
* });
|
|
225
|
+
*/
|
|
226
|
+
export declare function paths(ctx: AdminContext, body: Record<string, unknown>): Promise<AnalyticsPathsResult>;
|
|
227
|
+
/**
|
|
228
|
+
* Ranked traffic sources: per-session first source (UTM > referrer > direct),
|
|
229
|
+
* with category and vendor classification applied server-side.
|
|
230
|
+
*
|
|
231
|
+
* Per-event-table backed — bounded by 90-day retention. Click-filter params
|
|
232
|
+
* accept equality only; use `query` with `"is_not"` / `"contains"` filters or
|
|
233
|
+
* multi-dimension grouping for richer analysis.
|
|
234
|
+
*
|
|
235
|
+
* @example
|
|
236
|
+
* const { results, total } = await admin.analytics.sources({ limit: 10 });
|
|
237
|
+
*/
|
|
238
|
+
export declare function sources(ctx: AdminContext, params?: SourcesParams): Promise<AnalyticsSourcesResult>;
|
|
239
|
+
/**
|
|
240
|
+
* City lat/lon points for geo rendering.
|
|
241
|
+
*
|
|
242
|
+
* When any click-filter is present the per-event table is queried (90-day
|
|
243
|
+
* retention); without filters the rollup table is used (full history).
|
|
244
|
+
*
|
|
245
|
+
* @example
|
|
246
|
+
* const { points, total } = await admin.analytics.map({ country: 'US' });
|
|
247
|
+
*/
|
|
248
|
+
export declare function map(ctx: AdminContext, params?: MapParams): Promise<AnalyticsMapResult>;
|
|
249
|
+
/**
|
|
250
|
+
* One-shot live visitor snapshot: current unique count, country breakdown,
|
|
251
|
+
* and up to 60 one-minute sparkline samples from the last hour.
|
|
252
|
+
*
|
|
253
|
+
* Backed by Redis presence keys; no analytics-table query.
|
|
254
|
+
*
|
|
255
|
+
* @example
|
|
256
|
+
* const { count, countries, sparkline } = await admin.analytics.live();
|
|
257
|
+
*/
|
|
258
|
+
export declare function live(ctx: AdminContext): Promise<AnalyticsLiveResult>;
|
|
259
|
+
/**
|
|
260
|
+
* Per-vendor AI-referral breakdown.
|
|
261
|
+
*
|
|
262
|
+
* Filters referrer-host rows to known AI-assistant hosts and aggregates up
|
|
263
|
+
* to vendor level at read time. Multiple hosts may map to the same vendor
|
|
264
|
+
* (e.g. `chat.openai.com` + `chatgpt.com` → OpenAI). Returns both the
|
|
265
|
+
* vendor-level aggregates and the raw host-level rows.
|
|
266
|
+
*
|
|
267
|
+
* @example
|
|
268
|
+
* const { results, hosts } = await admin.analytics.aiSources();
|
|
269
|
+
*/
|
|
270
|
+
export declare function aiSources(ctx: AdminContext, params?: AiSourcesParams): Promise<AnalyticsAiSourcesResult>;
|
|
271
|
+
/**
|
|
272
|
+
* AI-crawler / bot ingestion views.
|
|
273
|
+
*
|
|
274
|
+
* Dispatches to one of three sub-endpoints via `kind`:
|
|
275
|
+
* - `overview` — total hits + per-vendor breakdown + top-crawled pages.
|
|
276
|
+
* - `timeseries` — stacked-per-vendor hit counts bucketed over time.
|
|
277
|
+
* - `recent` — last N raw crawler hit rows.
|
|
278
|
+
*
|
|
279
|
+
* Covers all bot traffic (AI assistants, search-engine crawlers, and a
|
|
280
|
+
* generic "Other" bucket), not just AI crawlers.
|
|
281
|
+
*
|
|
282
|
+
* @example
|
|
283
|
+
* const overview = await admin.analytics.crawlers({ kind: 'overview', topPagesLimit: 10 });
|
|
284
|
+
*/
|
|
285
|
+
export declare function crawlers(ctx: AdminContext, params: CrawlersParams): Promise<AnalyticsCrawlersResult>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Apps operations: the other apps in this app's workspace.
|
|
3
|
+
*
|
|
4
|
+
* Ops are pure: (ctx, params) → typed result, throwing AdminApiError /
|
|
5
|
+
* AdminTimeoutError. No printing, no process coupling — the CLI skin in
|
|
6
|
+
* commands/apps.ts and the importable client both call these.
|
|
7
|
+
*/
|
|
8
|
+
import type { AdminContext } from '../ctx.js';
|
|
9
|
+
import type { AppsListResult } from '../types/apps.js';
|
|
10
|
+
export interface AppsListParams {
|
|
11
|
+
/**
|
|
12
|
+
* Words an app's name or subdomain must all contain, in any case: `remy
|
|
13
|
+
* marketing` finds "Remy Marketing site".
|
|
14
|
+
*/
|
|
15
|
+
search?: string;
|
|
16
|
+
/** `published` (has a live release) or `draft`. Default: both. */
|
|
17
|
+
status?: 'draft' | 'published';
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The workspace's apps, last active first: every published app, and the
|
|
21
|
+
* drafts of the person this key belongs to (another member's draft isn't
|
|
22
|
+
* listed). An app's `appId` is what `issues --app` and `forApp` take.
|
|
23
|
+
*
|
|
24
|
+
* The list route doesn't search, so this reads every page and matches here,
|
|
25
|
+
* as the editor's app list does in the browser.
|
|
26
|
+
*
|
|
27
|
+
* @throws AdminApiError `invalid_status` (400) — status is not `draft` or
|
|
28
|
+
* `published`.
|
|
29
|
+
* @example
|
|
30
|
+
* const { apps } = await admin.apps.list({ search: 'marketing' });
|
|
31
|
+
* const marketing = admin.forApp(apps[0].appId);
|
|
32
|
+
*/
|
|
33
|
+
export declare function list(ctx: AdminContext, params?: AppsListParams): Promise<AppsListResult>;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Crash (frontend-error) operations.
|
|
3
|
+
*
|
|
4
|
+
* Ops are pure: (ctx, params) → typed result, throwing AdminApiError /
|
|
5
|
+
* AdminTimeoutError. No printing, no process coupling — the CLI skin in
|
|
6
|
+
* commands/crashes.ts and the importable client both call these.
|
|
7
|
+
*/
|
|
8
|
+
import type { AdminContext } from '../ctx.js';
|
|
9
|
+
import type { CrashesGetResult, CrashesListResult, CrashesOccurrencesResult, CrashesStatsResult } from '../types/crashes.js';
|
|
10
|
+
export interface CrashesListParams {
|
|
11
|
+
/** Filter to a specific release id. */
|
|
12
|
+
releaseId?: string;
|
|
13
|
+
/** Sort order: `'recent'` (default) or `'frequent'`. */
|
|
14
|
+
sort?: string;
|
|
15
|
+
/** Maximum crash groups to return (default 50). */
|
|
16
|
+
limit?: number;
|
|
17
|
+
/** Window start as an ISO 8601 date string. Defaults to 7 days ago. */
|
|
18
|
+
start?: string;
|
|
19
|
+
/** Window end as an ISO 8601 date string. Defaults to now. */
|
|
20
|
+
end?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface CrashesOccurrencesParams {
|
|
23
|
+
/** Filter to a specific release id. */
|
|
24
|
+
releaseId?: string;
|
|
25
|
+
/** Pagination cursor from a prior response's `nextCursor`. */
|
|
26
|
+
cursor?: string;
|
|
27
|
+
/** Maximum events to return (default 50). */
|
|
28
|
+
limit?: number;
|
|
29
|
+
/** Window start as an ISO 8601 date string. */
|
|
30
|
+
start?: string;
|
|
31
|
+
/** Window end as an ISO 8601 date string. */
|
|
32
|
+
end?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface CrashesStatsParams {
|
|
35
|
+
/** Filter to a specific release id. */
|
|
36
|
+
releaseId?: string;
|
|
37
|
+
/** Window start as an ISO 8601 date string. */
|
|
38
|
+
start?: string;
|
|
39
|
+
/** Window end as an ISO 8601 date string. */
|
|
40
|
+
end?: string;
|
|
41
|
+
/** Number of time buckets to return (default 24). */
|
|
42
|
+
buckets?: number;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Crash groups (one row per fingerprint) with occurrence counts and affected users.
|
|
46
|
+
*
|
|
47
|
+
* Groups are Sentry-style fingerprints. Each row carries an `exampleEventId`
|
|
48
|
+
* — pass it to `crashes.get()` for a quick drill-in without iterating
|
|
49
|
+
* occurrences. Time window defaults to the last 7 days when `start`/`end`
|
|
50
|
+
* are omitted.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* const { errors } = await admin.crashes.list({ sort: 'frequent', limit: 10 });
|
|
54
|
+
*/
|
|
55
|
+
export declare function list(ctx: AdminContext, params?: CrashesListParams): Promise<CrashesListResult>;
|
|
56
|
+
/**
|
|
57
|
+
* Individual crash events for one fingerprint, cursor-paginated.
|
|
58
|
+
*
|
|
59
|
+
* Pass `nextCursor` from a prior response as `cursor` to fetch the next page.
|
|
60
|
+
*
|
|
61
|
+
* @param fingerprint The fingerprint string from a `list` row.
|
|
62
|
+
* @example
|
|
63
|
+
* const { errors, nextCursor } = await admin.crashes.occurrences('abc123fingerprint', { limit: 25 });
|
|
64
|
+
*/
|
|
65
|
+
export declare function occurrences(ctx: AdminContext, fingerprint: string, params?: CrashesOccurrencesParams): Promise<CrashesOccurrencesResult>;
|
|
66
|
+
/**
|
|
67
|
+
* Full crash event detail — stack trace, source location, breadcrumbs, and browser context.
|
|
68
|
+
*
|
|
69
|
+
* @param eventId The event id (e.g. `exampleEventId` from a `list` row, or
|
|
70
|
+
* any id from an `occurrences` response).
|
|
71
|
+
* @throws AdminApiError `not_found` (404) — the event id does not exist or
|
|
72
|
+
* belongs to a different app.
|
|
73
|
+
* @example
|
|
74
|
+
* const event = await admin.crashes.get('evt_xyz789');
|
|
75
|
+
*/
|
|
76
|
+
export declare function get(ctx: AdminContext, eventId: string): Promise<CrashesGetResult>;
|
|
77
|
+
/**
|
|
78
|
+
* Bucketed time series of total crash occurrence volume for the app.
|
|
79
|
+
*
|
|
80
|
+
* Returns per-bucket counts and overall totals for the window. When
|
|
81
|
+
* `start`/`end` are omitted the server applies its own default window.
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* const { buckets, totals } = await admin.crashes.stats({ buckets: 24 });
|
|
85
|
+
*/
|
|
86
|
+
export declare function stats(ctx: AdminContext, params?: CrashesStatsParams): Promise<CrashesStatsResult>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cron (scheduled job) operations.
|
|
3
|
+
*
|
|
4
|
+
* Ops are pure: (ctx, params) → typed result, throwing AdminApiError /
|
|
5
|
+
* AdminTimeoutError. No printing, no process coupling — the CLI skin in
|
|
6
|
+
* commands/cron.ts and the importable client both call these.
|
|
7
|
+
*/
|
|
8
|
+
import type { AdminContext } from '../ctx.js';
|
|
9
|
+
import type { CronOverviewResult, CronRunResult } from '../types/cron.js';
|
|
10
|
+
export interface CronListParams {
|
|
11
|
+
/** Recent runs to include per job (default 15, clamped 1–120). */
|
|
12
|
+
runs?: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Every scheduled job with its status and recent runs.
|
|
16
|
+
*
|
|
17
|
+
* Job status is `active | paused | blocked` (`statusReason` says why); a run's
|
|
18
|
+
* id doubles as its request-log id, so a failing job's story continues with
|
|
19
|
+
* `requests.get(runId)`.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* const { jobs } = await admin.cron.list({ runs: 50 });
|
|
23
|
+
* const blocked = jobs.filter((j) => j.status === 'blocked');
|
|
24
|
+
*/
|
|
25
|
+
export declare function list(ctx: AdminContext, params?: CronListParams): Promise<CronOverviewResult>;
|
|
26
|
+
/**
|
|
27
|
+
* Trigger a job now (does not affect its schedule).
|
|
28
|
+
*
|
|
29
|
+
* Returns 202 immediately — the run continues in the background; check the
|
|
30
|
+
* outcome via `requests.get(requestId)`.
|
|
31
|
+
*
|
|
32
|
+
* @param route The job's method id, as shown by `list`.
|
|
33
|
+
* @throws AdminApiError `cron_job_not_found` (404) — the route isn't a
|
|
34
|
+
* scheduled method; `run_already_triggered` (429) — a manual run is in
|
|
35
|
+
* flight, or within the 30s debounce; `creator_unavailable` (400) — the
|
|
36
|
+
* creator account is gone.
|
|
37
|
+
* @example
|
|
38
|
+
* const { requestId } = await admin.cron.run('dailyDigest');
|
|
39
|
+
*/
|
|
40
|
+
export declare function run(ctx: AdminContext, route: string): Promise<CronRunResult>;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Database sync operations: lift dev→live and live→dev.
|
|
3
|
+
*
|
|
4
|
+
* Ops are pure: (ctx, params) → typed result. No printing, no process coupling.
|
|
5
|
+
*/
|
|
6
|
+
import type { AdminContext } from '../ctx.js';
|
|
7
|
+
import type { DataLiftFromDevResult, DataLiftFromLiveResult } from '../types/data.js';
|
|
8
|
+
export interface LiftFromDevParams {
|
|
9
|
+
/**
|
|
10
|
+
* Which of YOUR dev sessions to lift from, by dev release id. An app has a dev session per
|
|
11
|
+
* workspace (one per person's box, one per person's CLI), and a lift only ever touches the
|
|
12
|
+
* caller's own: without this it takes your newest, and a colleague's id is refused
|
|
13
|
+
* (`not_your_dev_session`). Name it when you have more than one open. The ids are on the
|
|
14
|
+
* dashboard's `devSessions`.
|
|
15
|
+
*/
|
|
16
|
+
releaseId?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Destructively copy every dev-release database over the live-release databases.
|
|
20
|
+
*
|
|
21
|
+
* Whole-DB overwrite by name match, including auth tables — wipes whatever
|
|
22
|
+
* live had, including signed-up users. Intended for first-publish / pre-launch
|
|
23
|
+
* data sync only; do not run on a production app with real users. Writes an
|
|
24
|
+
* audit row tagged `lift-dev-to-live`. The CLI skin requires the literal appId
|
|
25
|
+
* AND `--confirm` as a double-gate; the op always sends `{ confirm: true }`.
|
|
26
|
+
*
|
|
27
|
+
* @throws AdminApiError `no_dev_session` (404) — no dev release exists (start a dev session first);
|
|
28
|
+
* `no_live_release` (404) — app has never been published (publish first, then lift);
|
|
29
|
+
* `not_your_dev_session` (403) — `releaseId` names someone else's dev session.
|
|
30
|
+
* @example
|
|
31
|
+
* const result = await admin.data.liftFromDev();
|
|
32
|
+
* console.log(`Lifted ${result.databasesAffected.length} databases to live`);
|
|
33
|
+
* // With more than one of your dev sessions open, name the one you mean:
|
|
34
|
+
* await admin.data.liftFromDev({ releaseId: '8f2c1e04-...' });
|
|
35
|
+
*/
|
|
36
|
+
export declare function liftFromDev(ctx: AdminContext, params?: LiftFromDevParams): Promise<DataLiftFromDevResult>;
|
|
37
|
+
export interface LiftFromLiveParams {
|
|
38
|
+
/**
|
|
39
|
+
* Empty dev databases in place — clears all rows, keeps schema and IDs,
|
|
40
|
+
* no data read from live. Defaults to false (full copy from live).
|
|
41
|
+
*/
|
|
42
|
+
truncate?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Which of your dev sessions to overwrite, by dev release id; your newest when absent. See
|
|
45
|
+
* `LiftFromDevParams.releaseId`.
|
|
46
|
+
*/
|
|
47
|
+
releaseId?: string;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Destructively replace dev-release databases with the live-release databases,
|
|
51
|
+
* or truncate dev databases without reading from live.
|
|
52
|
+
*
|
|
53
|
+
* Only dev is overwritten — live/prod data is never touched. Useful for
|
|
54
|
+
* reproducing a prod bug against real data or re-syncing a stale sandbox.
|
|
55
|
+
* With `truncate: true` it instead empties the dev databases (keeps schema
|
|
56
|
+
* and IDs, no data read from live). Writes an audit row tagged
|
|
57
|
+
* `lift-live-to-dev`.
|
|
58
|
+
*
|
|
59
|
+
* @throws AdminApiError `no_dev_session` (404) — no dev release exists (start a dev session first);
|
|
60
|
+
* `no_live_release` (404) — no live release (copy mode only; not thrown when `truncate` is true);
|
|
61
|
+
* `not_your_dev_session` (403) — `releaseId` names someone else's dev session.
|
|
62
|
+
* @example
|
|
63
|
+
* // Pull live data into dev for debugging:
|
|
64
|
+
* await admin.data.liftFromLive();
|
|
65
|
+
* // Or just empty dev without pulling from live:
|
|
66
|
+
* await admin.data.liftFromLive({ truncate: true });
|
|
67
|
+
*/
|
|
68
|
+
export declare function liftFromLive(ctx: AdminContext, params?: LiftFromLiveParams): Promise<DataLiftFromLiveResult>;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* S3 connectors: make a bucket the customer owns the origin of a data source,
|
|
3
|
+
* and keep the source in sync with it.
|
|
4
|
+
*
|
|
5
|
+
* Ops are pure (ctx, params) → typed result. The CLI skin in
|
|
6
|
+
* commands/dataSourceConnectors.ts owns flags, progress and exit codes.
|
|
7
|
+
*/
|
|
8
|
+
import type { AdminContext } from '../ctx.js';
|
|
9
|
+
import type { DataSourceConnectorDeletions, DataSourceConnectorGetResult, DataSourceConnectorResult, DataSourceSyncResult } from '../types/dataSourceConnectors.js';
|
|
10
|
+
export interface ConnectParams {
|
|
11
|
+
/** Data source slug. Created on first use, like `add`. */
|
|
12
|
+
slug: string;
|
|
13
|
+
bucket: string;
|
|
14
|
+
/** AWS region of the bucket, e.g. `us-east-1`. */
|
|
15
|
+
region: string;
|
|
16
|
+
/** Key prefix to follow; omit for the whole bucket. */
|
|
17
|
+
prefix?: string;
|
|
18
|
+
/** S3-compatible endpoint (https; http for localhost). Omit for AWS. */
|
|
19
|
+
endpoint?: string;
|
|
20
|
+
/** NAME of the app secret holding the access key id. */
|
|
21
|
+
accessKeyIdSecret: string;
|
|
22
|
+
/** NAME of the app secret holding the secret access key. */
|
|
23
|
+
secretAccessKeySecret: string;
|
|
24
|
+
/** Default `mirror`. */
|
|
25
|
+
deletions?: DataSourceConnectorDeletions;
|
|
26
|
+
/** Ceiling a sync auto-approves under. */
|
|
27
|
+
budgetDollarsPerSync?: number;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Connect a source to a bucket. The two secrets must already exist on the app
|
|
31
|
+
* (`secrets set`), and the keys must be able to list the prefix — both are
|
|
32
|
+
* checked before anything is recorded. Calling again with the same bucket,
|
|
33
|
+
* region, prefix and endpoint updates credentials and policy in place; a
|
|
34
|
+
* different origin is refused until the source is disconnected.
|
|
35
|
+
*
|
|
36
|
+
* @throws AdminApiError `invalid_connector` (400), `connector_secret_missing`
|
|
37
|
+
* (422), `connector_probe_failed` (422), `connector_exists` (422).
|
|
38
|
+
* @example
|
|
39
|
+
* await admin.dataSourceConnectors.connect({
|
|
40
|
+
* slug: 'archive', bucket: 'acme-docs', region: 'us-east-1', prefix: 'contracts/',
|
|
41
|
+
* accessKeyIdSecret: 'ARCHIVE_S3_KEY', secretAccessKeySecret: 'ARCHIVE_S3_SECRET',
|
|
42
|
+
* });
|
|
43
|
+
*/
|
|
44
|
+
export declare function connect(ctx: AdminContext, params: ConnectParams): Promise<DataSourceConnectorResult>;
|
|
45
|
+
/** The source's connector with its object counts, or `connector: null`. */
|
|
46
|
+
export declare function get(ctx: AdminContext, params: {
|
|
47
|
+
slug: string;
|
|
48
|
+
}): Promise<DataSourceConnectorGetResult>;
|
|
49
|
+
/**
|
|
50
|
+
* Stop following the bucket. The documents stay; only the connector and its
|
|
51
|
+
* object index go.
|
|
52
|
+
*
|
|
53
|
+
* @throws AdminApiError `connector_not_found` (422), `data_source_busy` (422)
|
|
54
|
+
* while a job is in flight.
|
|
55
|
+
*/
|
|
56
|
+
export declare function disconnect(ctx: AdminContext, params: {
|
|
57
|
+
slug: string;
|
|
58
|
+
}): Promise<DataSourceConnectorResult & {
|
|
59
|
+
removed: true;
|
|
60
|
+
}>;
|
|
61
|
+
export interface SyncParams {
|
|
62
|
+
slug: string;
|
|
63
|
+
/** Override the connector's per-sync budget for this run, in dollars. */
|
|
64
|
+
budgetDollars?: number;
|
|
65
|
+
/** Only the first N objects of the listing — a slice to measure or check. */
|
|
66
|
+
limit?: number;
|
|
67
|
+
/** Batches in flight (default 64, max 128). */
|
|
68
|
+
concurrency?: number;
|
|
69
|
+
/** Embed at the provider's priority tier (1.5x the embedding price). Off by default. */
|
|
70
|
+
priority?: boolean;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Start a sync: list the bucket, diff by ETag, run a job over what changed.
|
|
74
|
+
* Auto-approved under the connector's per-sync budget; a plan over it (or over
|
|
75
|
+
* the placement's capacity) waits in `planned` for `dataSourceJobs.approve`.
|
|
76
|
+
* Block on the result with `dataSourceJobs.waitForJob`.
|
|
77
|
+
*
|
|
78
|
+
* @throws AdminApiError `connector_not_found` (422), `data_source_busy` (422).
|
|
79
|
+
*/
|
|
80
|
+
export declare function sync(ctx: AdminContext, params: SyncParams): Promise<DataSourceSyncResult>;
|