@madewithremy/admin 0.1.57 → 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 +6 -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 -9442
- 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 +21 -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,225 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Response types for the v2 analytics (insights) endpoints.
|
|
3
|
+
*
|
|
4
|
+
* Transcribed from the api (apps/api/src/):
|
|
5
|
+
* customerApps/AppAnalytics/types.ts — query/batch shapes
|
|
6
|
+
* roles/http/routes/Apps/manage/analytics.ts — per-endpoint responses
|
|
7
|
+
* customerApps/AppAnalytics/dao/AnalyticsEventsDao.ts — sources/map/ai-sources DAO
|
|
8
|
+
* customerApps/AppAnalytics/live/PresenceStore.ts — live DAO
|
|
9
|
+
* customerApps/AppAnalytics/dao/CrawlerHitsDao.ts — crawlers DAO
|
|
10
|
+
*/
|
|
11
|
+
/** The counts the query engine can return per row. */
|
|
12
|
+
export type AnalyticsCountMetric = 'pageviews' | 'visitors' | 'visits' | 'events';
|
|
13
|
+
/**
|
|
14
|
+
* The averages: seconds a page was actively read, % of the page scrolled,
|
|
15
|
+
* seconds a visit was actively read, % of visits that bounced. `null` in a
|
|
16
|
+
* row when there's nothing to average.
|
|
17
|
+
*/
|
|
18
|
+
export type AnalyticsAverageMetric = 'timeOnPage' | 'scrollDepth' | 'visitDuration' | 'bounceRate';
|
|
19
|
+
export type AnalyticsMetric = AnalyticsCountMetric | AnalyticsAverageMetric;
|
|
20
|
+
/** One row in a query result. `dimensions` contains the group-by key(s);
|
|
21
|
+
* `metrics` contains only the requested-and-available metrics. */
|
|
22
|
+
export interface AnalyticsQueryResultRow {
|
|
23
|
+
dimensions: Record<string, string>;
|
|
24
|
+
metrics: Partial<Record<AnalyticsCountMetric, number>> & Partial<Record<AnalyticsAverageMetric, number | null>>;
|
|
25
|
+
}
|
|
26
|
+
/** Response shape for POST /insights/query. */
|
|
27
|
+
export interface AnalyticsQueryResult {
|
|
28
|
+
results: AnalyticsQueryResultRow[];
|
|
29
|
+
meta: {
|
|
30
|
+
/** Whether the rollup table or the per-event table answered the query. */
|
|
31
|
+
source: 'rollup' | 'events';
|
|
32
|
+
/** ISO timestamps: what the client requested vs. what was actually served
|
|
33
|
+
* (events path clamps to the 90-day retention horizon). */
|
|
34
|
+
window: {
|
|
35
|
+
requested: [string, string];
|
|
36
|
+
served: [string, string];
|
|
37
|
+
};
|
|
38
|
+
/** True when the requested start was earlier than the retention horizon. */
|
|
39
|
+
clamped: boolean;
|
|
40
|
+
/** Metrics the client requested that this query shape cannot carry
|
|
41
|
+
* (e.g. `visits` on a grouped read). Omitted when empty. */
|
|
42
|
+
metricsOmitted?: AnalyticsMetric[];
|
|
43
|
+
/** Grouped queries only: unpaginated distinct-group count. */
|
|
44
|
+
total?: number;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
/** Response shape for POST /insights/query-batch. One AnalyticsQueryResult
|
|
48
|
+
* per query, in request order. */
|
|
49
|
+
export interface AnalyticsBatchResult {
|
|
50
|
+
results: AnalyticsQueryResult[];
|
|
51
|
+
}
|
|
52
|
+
/** A funnel step: a page opened, or a custom event fired. */
|
|
53
|
+
export type AnalyticsFunnelStep = {
|
|
54
|
+
page: string;
|
|
55
|
+
match: 'is' | 'contains';
|
|
56
|
+
} | {
|
|
57
|
+
event: string;
|
|
58
|
+
props: Record<string, string>;
|
|
59
|
+
};
|
|
60
|
+
/** What a funnel or paths read reports about its window and the apps it read. */
|
|
61
|
+
export interface AnalyticsVisitReadMeta {
|
|
62
|
+
window: {
|
|
63
|
+
requested: [string, string];
|
|
64
|
+
served: [string, string];
|
|
65
|
+
};
|
|
66
|
+
/** True when the window was cut: to retention, or to when visits were first recorded. */
|
|
67
|
+
clamped: boolean;
|
|
68
|
+
/** The apps whose visits answered: this one, and those sharing its host. */
|
|
69
|
+
apps: string[];
|
|
70
|
+
}
|
|
71
|
+
/** Response shape for POST /insights/funnel. */
|
|
72
|
+
export interface AnalyticsFunnelResult {
|
|
73
|
+
steps: {
|
|
74
|
+
step: AnalyticsFunnelStep;
|
|
75
|
+
visits: number;
|
|
76
|
+
dropOff: number;
|
|
77
|
+
}[];
|
|
78
|
+
breakdown?: {
|
|
79
|
+
dimension: string;
|
|
80
|
+
groups: {
|
|
81
|
+
value: string | null;
|
|
82
|
+
visits: number[];
|
|
83
|
+
}[];
|
|
84
|
+
};
|
|
85
|
+
meta: AnalyticsVisitReadMeta;
|
|
86
|
+
}
|
|
87
|
+
/** Response shape for POST /insights/paths. */
|
|
88
|
+
export interface AnalyticsPathsResult {
|
|
89
|
+
visits: number;
|
|
90
|
+
/** With `from`: the page opened next, or null where the visit ended. */
|
|
91
|
+
next?: {
|
|
92
|
+
path: string | null;
|
|
93
|
+
visits: number;
|
|
94
|
+
}[];
|
|
95
|
+
routes: {
|
|
96
|
+
paths: string[];
|
|
97
|
+
visits: number;
|
|
98
|
+
}[];
|
|
99
|
+
meta: AnalyticsVisitReadMeta;
|
|
100
|
+
}
|
|
101
|
+
/** One ranked traffic source row, with category + vendor classification
|
|
102
|
+
* applied server-side (UTM source values are classified the same way as
|
|
103
|
+
* referrer hosts — ChatGPT/Perplexity often arrive tagged
|
|
104
|
+
* ?utm_source=chatgpt.com). */
|
|
105
|
+
export interface AnalyticsSourceRow {
|
|
106
|
+
sourceType: 'utm' | 'referrer' | 'direct';
|
|
107
|
+
/** The utm_source value, referrer host, or the literal string "Direct". */
|
|
108
|
+
sourceLabel: string;
|
|
109
|
+
/** Session-start count (first pageview per 30-min gap). */
|
|
110
|
+
visits: number;
|
|
111
|
+
uniqueVisitors: number;
|
|
112
|
+
/** High-level channel. 'direct' for direct traffic; one of the classifier
|
|
113
|
+
* categories for known hosts; 'other' for unrecognized referrers. */
|
|
114
|
+
category: 'direct' | 'ai_assistant' | 'search' | 'social' | 'email' | 'other';
|
|
115
|
+
/** Vendor label from the classifier (e.g. "Google", "OpenAI"), or null. */
|
|
116
|
+
vendor: string | null;
|
|
117
|
+
}
|
|
118
|
+
/** Response shape for GET /insights/sources. */
|
|
119
|
+
export interface AnalyticsSourcesResult {
|
|
120
|
+
results: AnalyticsSourceRow[];
|
|
121
|
+
/** Unpaginated distinct-(sourceType, sourceLabel) count. */
|
|
122
|
+
total: number;
|
|
123
|
+
}
|
|
124
|
+
/** One geo point for the city map view. Both the rollup and the per-event
|
|
125
|
+
* table return the same field set; the route dispatches to one or the other
|
|
126
|
+
* based on whether any click-filters are present. */
|
|
127
|
+
export interface AnalyticsMapPoint {
|
|
128
|
+
city: string;
|
|
129
|
+
country: string;
|
|
130
|
+
latitude: number;
|
|
131
|
+
longitude: number;
|
|
132
|
+
pageviews: number;
|
|
133
|
+
uniqueVisitors: number;
|
|
134
|
+
}
|
|
135
|
+
/** Response shape for GET /insights/map. */
|
|
136
|
+
export interface AnalyticsMapResult {
|
|
137
|
+
points: AnalyticsMapPoint[];
|
|
138
|
+
/** Unpaginated distinct-(city, country) count. */
|
|
139
|
+
total: number;
|
|
140
|
+
}
|
|
141
|
+
/** Response shape for GET /insights/live (one-shot snapshot). */
|
|
142
|
+
export interface AnalyticsLiveResult {
|
|
143
|
+
/** Current unique visitor count (Redis SET cardinality). */
|
|
144
|
+
count: number;
|
|
145
|
+
/** Country breakdown of currently-online visitors, descending by count.
|
|
146
|
+
* Only visitors whose geo meta has not expired are included. */
|
|
147
|
+
countries: Array<{
|
|
148
|
+
country: string;
|
|
149
|
+
count: number;
|
|
150
|
+
}>;
|
|
151
|
+
/** Up to 60 one-minute samples, chronological (oldest → newest),
|
|
152
|
+
* covering the last hour of activity. */
|
|
153
|
+
sparkline: Array<{
|
|
154
|
+
ts: string;
|
|
155
|
+
count: number;
|
|
156
|
+
}>;
|
|
157
|
+
}
|
|
158
|
+
/** Per-host row from the raw AI-referral breakdown. */
|
|
159
|
+
export interface AnalyticsAiHostRow {
|
|
160
|
+
host: string;
|
|
161
|
+
pageviews: number;
|
|
162
|
+
uniqueVisitors: number;
|
|
163
|
+
}
|
|
164
|
+
/** Per-vendor aggregate derived by summing the host-level rows. */
|
|
165
|
+
export interface AnalyticsAiVendorRow {
|
|
166
|
+
vendor: string;
|
|
167
|
+
pageviews: number;
|
|
168
|
+
uniqueVisitors: number;
|
|
169
|
+
/** All AI-assistant hosts that map to this vendor (e.g. both
|
|
170
|
+
* "chat.openai.com" and "chatgpt.com" roll up to "OpenAI"). */
|
|
171
|
+
hosts: string[];
|
|
172
|
+
}
|
|
173
|
+
/** Response shape for GET /insights/ai-sources. */
|
|
174
|
+
export interface AnalyticsAiSourcesResult {
|
|
175
|
+
/** Vendor-level totals, sorted descending by pageviews. */
|
|
176
|
+
results: AnalyticsAiVendorRow[];
|
|
177
|
+
/** Raw host-level rows before vendor aggregation. */
|
|
178
|
+
hosts: AnalyticsAiHostRow[];
|
|
179
|
+
}
|
|
180
|
+
/** Response shape for GET /insights/crawlers/overview. */
|
|
181
|
+
export interface AnalyticsCrawlersOverviewResult {
|
|
182
|
+
/** Total crawler hits in the window across all vendors. */
|
|
183
|
+
totalHits: number;
|
|
184
|
+
/** Hit count per bot vendor, sorted descending. */
|
|
185
|
+
byVendor: Array<{
|
|
186
|
+
vendor: string;
|
|
187
|
+
count: number;
|
|
188
|
+
}>;
|
|
189
|
+
/** Most-crawled paths by total hits, descending. */
|
|
190
|
+
topPages: Array<{
|
|
191
|
+
path: string;
|
|
192
|
+
count: number;
|
|
193
|
+
}>;
|
|
194
|
+
}
|
|
195
|
+
/** One time bucket in the crawlers timeseries. */
|
|
196
|
+
export interface AnalyticsCrawlersTimeseriesBucket {
|
|
197
|
+
/** ISO timestamp of the bucket's start. */
|
|
198
|
+
start: string;
|
|
199
|
+
/** Total hits across all vendors for this bucket. */
|
|
200
|
+
total: number;
|
|
201
|
+
/** Per-vendor hit counts keyed by vendor name. */
|
|
202
|
+
byVendor: Record<string, number>;
|
|
203
|
+
}
|
|
204
|
+
/** Response shape for GET /insights/crawlers/timeseries. */
|
|
205
|
+
export interface AnalyticsCrawlersTimeseriesResult {
|
|
206
|
+
buckets: AnalyticsCrawlersTimeseriesBucket[];
|
|
207
|
+
}
|
|
208
|
+
/** One raw crawler hit row. */
|
|
209
|
+
export interface AnalyticsCrawlersRecentRow {
|
|
210
|
+
id: string;
|
|
211
|
+
releaseId: string;
|
|
212
|
+
path: string;
|
|
213
|
+
host: string | null;
|
|
214
|
+
botVendor: string;
|
|
215
|
+
botName: string;
|
|
216
|
+
country: string | null;
|
|
217
|
+
createdAt: string;
|
|
218
|
+
}
|
|
219
|
+
/** Response shape for GET /insights/crawlers/recent. */
|
|
220
|
+
export interface AnalyticsCrawlersRecentResult {
|
|
221
|
+
results: AnalyticsCrawlersRecentRow[];
|
|
222
|
+
}
|
|
223
|
+
/** Union of the three crawlers sub-responses. The sub is chosen at runtime
|
|
224
|
+
* (`analytics crawlers <overview|timeseries|recent>`). */
|
|
225
|
+
export type AnalyticsCrawlersResult = AnalyticsCrawlersOverviewResult | AnalyticsCrawlersTimeseriesResult | AnalyticsCrawlersRecentResult;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Response shapes for the apps command group — transcribed from the api.
|
|
3
|
+
*
|
|
4
|
+
* Sources (apps/api/src/):
|
|
5
|
+
* roles/http/routes/Apps/create.ts (GET /_internal/v2/apps)
|
|
6
|
+
* customerApps/AppRecord/dao/AppRecordDao.ts (AppListItem)
|
|
7
|
+
*/
|
|
8
|
+
/** One page of GET /_internal/v2/apps: the workspace's apps, last active first. */
|
|
9
|
+
export interface AppsListPage {
|
|
10
|
+
apps: Array<{
|
|
11
|
+
appId: string;
|
|
12
|
+
name: string;
|
|
13
|
+
isPublished: boolean;
|
|
14
|
+
lastDeployedAt: string | null;
|
|
15
|
+
/** Public (hyphenated) platform subdomain, or null if unset. */
|
|
16
|
+
customSubdomain: string | null;
|
|
17
|
+
createdBy: {
|
|
18
|
+
userId: string;
|
|
19
|
+
name: string;
|
|
20
|
+
};
|
|
21
|
+
}>;
|
|
22
|
+
nextCursor: string | null;
|
|
23
|
+
}
|
|
24
|
+
/** An app in the workspace, as `apps list` shows it. */
|
|
25
|
+
export interface WorkspaceApp {
|
|
26
|
+
appId: string;
|
|
27
|
+
name: string;
|
|
28
|
+
/** Its platform subdomain (`<subdomain>.<apex>`), or null if it has none. */
|
|
29
|
+
subdomain: string | null;
|
|
30
|
+
/** Whether it has a live release; a draft is listed only to its creator. */
|
|
31
|
+
isPublished: boolean;
|
|
32
|
+
lastDeployedAt: string | null;
|
|
33
|
+
/** Who made it. */
|
|
34
|
+
createdBy: string;
|
|
35
|
+
}
|
|
36
|
+
/** apps list */
|
|
37
|
+
export interface AppsListResult {
|
|
38
|
+
apps: WorkspaceApp[];
|
|
39
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Response types for src/commands/crashes.ts.
|
|
3
|
+
* Transcribed from:
|
|
4
|
+
* - FrontendErrorMetricsDao.listFingerprintAggregates() +
|
|
5
|
+
* FrontendErrorsDao.listExamplesByFingerprints() → CrashesListResult
|
|
6
|
+
* - FrontendErrorsDao.list() → CrashesOccurrencesResult
|
|
7
|
+
* - FrontendErrorEntry (FrontendErrorsDao.get()) → CrashesGetResult
|
|
8
|
+
* - FrontendErrorMetricsDao.getTimeSeries() → CrashesStatsResult
|
|
9
|
+
*/
|
|
10
|
+
/** Error event type: thrown Error or unhandled Promise rejection. */
|
|
11
|
+
export type FrontendErrorType = 'error' | 'unhandledrejection';
|
|
12
|
+
/** One row in the grouped crash list (one row per fingerprint). */
|
|
13
|
+
export interface CrashGroup {
|
|
14
|
+
fingerprint: string;
|
|
15
|
+
occurrenceCount: number;
|
|
16
|
+
/** Distinct visitor IDs affected (capped at 100 in the metrics table). */
|
|
17
|
+
affectedUsers: number;
|
|
18
|
+
firstSeen: string;
|
|
19
|
+
lastSeen: string;
|
|
20
|
+
type: FrontendErrorType;
|
|
21
|
+
message: string;
|
|
22
|
+
stack: string;
|
|
23
|
+
url: string;
|
|
24
|
+
/** ID of a representative event — pass to `crashes get` for full detail. */
|
|
25
|
+
exampleEventId: string | null;
|
|
26
|
+
}
|
|
27
|
+
/** GET /_internal/v2/apps/:appId/frontend-errors */
|
|
28
|
+
export interface CrashesListResult {
|
|
29
|
+
errors: CrashGroup[];
|
|
30
|
+
}
|
|
31
|
+
/** Lightweight occurrence row in the per-fingerprint event list. */
|
|
32
|
+
export interface CrashOccurrenceRow {
|
|
33
|
+
id: string;
|
|
34
|
+
releaseId: string;
|
|
35
|
+
fingerprint: string;
|
|
36
|
+
type: FrontendErrorType;
|
|
37
|
+
message: string;
|
|
38
|
+
url: string;
|
|
39
|
+
userId: string | null;
|
|
40
|
+
visitorId: string;
|
|
41
|
+
createdAt: string;
|
|
42
|
+
}
|
|
43
|
+
/** GET /_internal/v2/apps/:appId/frontend-errors/:fingerprint/events */
|
|
44
|
+
export interface CrashesOccurrencesResult {
|
|
45
|
+
errors: CrashOccurrenceRow[];
|
|
46
|
+
nextCursor: string | null;
|
|
47
|
+
}
|
|
48
|
+
/** Full event detail with stack trace and breadcrumbs. GET /_internal/v2/apps/:appId/frontend-errors/events/:errorId */
|
|
49
|
+
export interface CrashesGetResult {
|
|
50
|
+
id: string;
|
|
51
|
+
appId: string;
|
|
52
|
+
releaseId: string;
|
|
53
|
+
fingerprint: string;
|
|
54
|
+
type: FrontendErrorType;
|
|
55
|
+
message: string;
|
|
56
|
+
stack: string;
|
|
57
|
+
source: string | null;
|
|
58
|
+
line: number | null;
|
|
59
|
+
column: number | null;
|
|
60
|
+
url: string;
|
|
61
|
+
userAgent: string;
|
|
62
|
+
userId: string | null;
|
|
63
|
+
visitorId: string;
|
|
64
|
+
breadcrumbs: unknown[];
|
|
65
|
+
occurredAt: string;
|
|
66
|
+
createdAt: string;
|
|
67
|
+
}
|
|
68
|
+
/** One bucket in the crash occurrence time series. */
|
|
69
|
+
export interface CrashesStatsBucket {
|
|
70
|
+
start: string;
|
|
71
|
+
occurrenceCount: number;
|
|
72
|
+
}
|
|
73
|
+
/** GET /_internal/v2/apps/:appId/frontend-errors/metrics/summary */
|
|
74
|
+
export interface CrashesStatsResult {
|
|
75
|
+
buckets: CrashesStatsBucket[];
|
|
76
|
+
totals: {
|
|
77
|
+
occurrenceCount: number;
|
|
78
|
+
/** Distinct visitor IDs across all buckets in the time window. */
|
|
79
|
+
affectedUsers: number;
|
|
80
|
+
};
|
|
81
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Response shapes for the cron command group — transcribed from the api.
|
|
3
|
+
*
|
|
4
|
+
* Sources (apps/api/src/):
|
|
5
|
+
* roles/http/routes/Apps/manage/cron.ts
|
|
6
|
+
* customerApps/AppCrons/dao/AppCronJobsDao.ts (AppCronJobSummary ~line 61, decorateJob ~line 383)
|
|
7
|
+
* customerApps/AppCrons/dao/AppCronRunsDao.ts (CronRunSummary ~line 50)
|
|
8
|
+
*/
|
|
9
|
+
/** Lifecycle state of a single cron run row. */
|
|
10
|
+
export type AppCronRunState = 'queued' | 'running' | 'succeeded' | 'failed' | 'interrupted';
|
|
11
|
+
/** Explicit status machine for a scheduled job. */
|
|
12
|
+
export type AppCronJobStatus = 'active' | 'paused' | 'blocked';
|
|
13
|
+
/** Why a job is paused or blocked. */
|
|
14
|
+
export type AppCronJobStatusReason = 'auto_failures' | 'manual' | 'creator_unavailable' | 'app_deleted' | 'invalid_expression';
|
|
15
|
+
/**
|
|
16
|
+
* One lane entry per cron run (AppCronRunsDao.CronRunSummary).
|
|
17
|
+
* Structurally compatible with the retired request-log MethodRunSummary so the
|
|
18
|
+
* frontend lane component renders both endpoints without branching.
|
|
19
|
+
*/
|
|
20
|
+
export interface CronRunSummary {
|
|
21
|
+
id: string;
|
|
22
|
+
startedAt: string;
|
|
23
|
+
durationMs: number | null;
|
|
24
|
+
/** null while the run is still in flight. */
|
|
25
|
+
success: boolean | null;
|
|
26
|
+
manual: boolean;
|
|
27
|
+
/** Ledger state — lets the UI distinguish queued from running. */
|
|
28
|
+
state: AppCronRunState;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Per-app cron job summary (AppCronJobsDao.AppCronJobSummary) decorated with
|
|
32
|
+
* the three derived fields `decorateJob` attaches before the response is sent.
|
|
33
|
+
*
|
|
34
|
+
* `executionCount` is LIFETIME — survives deploys.
|
|
35
|
+
* `blocked` is non-null when the job is blocked; value is the reason string.
|
|
36
|
+
* A run's `id` is also its request-log id; follow a failure with
|
|
37
|
+
* `requests get <runId>`.
|
|
38
|
+
*/
|
|
39
|
+
export interface CronJobDecorated {
|
|
40
|
+
id: string;
|
|
41
|
+
route: string;
|
|
42
|
+
schedule: string;
|
|
43
|
+
scheduleDescription: string;
|
|
44
|
+
timezone: string;
|
|
45
|
+
description: string;
|
|
46
|
+
nextRunAt: string | null;
|
|
47
|
+
executionCount: number;
|
|
48
|
+
paused: boolean;
|
|
49
|
+
consecutiveFailures: number;
|
|
50
|
+
/** Non-null when the job is blocked; value is the status reason string. */
|
|
51
|
+
blocked: string | null;
|
|
52
|
+
status: AppCronJobStatus;
|
|
53
|
+
statusReason: AppCronJobStatusReason | null;
|
|
54
|
+
/** Derived server-side (tz-aware cron parse). Null when expression is invalid. */
|
|
55
|
+
periodMs: number | null;
|
|
56
|
+
/** ISO timestamp of the most recent failure; may predate the run window. */
|
|
57
|
+
lastFailureAt: string | null;
|
|
58
|
+
runs: CronRunSummary[];
|
|
59
|
+
}
|
|
60
|
+
/** cron list → GET /cron/overview */
|
|
61
|
+
export interface CronOverviewResult {
|
|
62
|
+
jobs: CronJobDecorated[];
|
|
63
|
+
}
|
|
64
|
+
/** cron run → POST /cron/:route/run (202) */
|
|
65
|
+
export interface CronRunResult {
|
|
66
|
+
requestId: string;
|
|
67
|
+
methodId: string;
|
|
68
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Response types for the data command group.
|
|
3
|
+
*
|
|
4
|
+
* Sources in the api (apps/api/src/):
|
|
5
|
+
* POST /manage/lift-dev-to-live → roles/http/routes/Apps/manage/liftDevToLive.ts
|
|
6
|
+
* POST /manage/lift-live-to-dev → roles/http/routes/Apps/manage/liftLiveToDev.ts
|
|
7
|
+
*/
|
|
8
|
+
/** Minimal database descriptor returned inside lift results. */
|
|
9
|
+
export interface LiftedDatabase {
|
|
10
|
+
id: string;
|
|
11
|
+
name: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Response from POST /_internal/v2/apps/:appId/manage/lift-dev-to-live.
|
|
15
|
+
* Destructively replaces the live release's databases with the dev release's.
|
|
16
|
+
*/
|
|
17
|
+
export interface DataLiftFromDevResult {
|
|
18
|
+
/** Unix timestamp (ms) of when the lift completed. */
|
|
19
|
+
liftedAt: number;
|
|
20
|
+
sourceDevReleaseId: string;
|
|
21
|
+
targetLiveReleaseId: string;
|
|
22
|
+
databasesAffected: LiftedDatabase[];
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Response from POST /_internal/v2/apps/:appId/manage/lift-live-to-dev.
|
|
26
|
+
* Replaces the dev release's databases with the live release's, or truncates
|
|
27
|
+
* dev databases when mode is 'truncate'.
|
|
28
|
+
*/
|
|
29
|
+
export interface DataLiftFromLiveResult {
|
|
30
|
+
/** Unix timestamp (ms) of when the lift completed. */
|
|
31
|
+
liftedAt: number;
|
|
32
|
+
/** 'copy' = live data copied over dev; 'truncate' = dev rows cleared, no live data read. */
|
|
33
|
+
mode: 'copy' | 'truncate';
|
|
34
|
+
/** null when mode is 'truncate' (live release not involved). */
|
|
35
|
+
sourceLiveReleaseId: string | null;
|
|
36
|
+
targetDevReleaseId: string;
|
|
37
|
+
databasesAffected: LiftedDatabase[];
|
|
38
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Response types for S3 connectors on data sources.
|
|
3
|
+
*
|
|
4
|
+
* Transcribed from the api (apps/api/src/):
|
|
5
|
+
* roles/http/routes/Apps/manage/dataSources/connectors.ts (connectorView)
|
|
6
|
+
* customerApps/AppDataSources/jobs/connectors/dao/ConnectorsDao.ts
|
|
7
|
+
*/
|
|
8
|
+
import type { DataSourceJob } from './dataSourceJobs.js';
|
|
9
|
+
/**
|
|
10
|
+
* What to do when a key disappears from the bucket. `mirror`: its document is
|
|
11
|
+
* removed at the end of the next full sync. `keep`: the document stays.
|
|
12
|
+
*/
|
|
13
|
+
export type DataSourceConnectorDeletions = 'mirror' | 'keep';
|
|
14
|
+
export interface DataSourceConnectorPolicy {
|
|
15
|
+
deletions: DataSourceConnectorDeletions;
|
|
16
|
+
/** Ceiling a sync auto-approves under; null = the plan's own 1.5× headroom. */
|
|
17
|
+
budgetDollarsPerSync: number | null;
|
|
18
|
+
}
|
|
19
|
+
/** App-secret NAMES that hold the keys. Values never leave the platform. */
|
|
20
|
+
export interface DataSourceConnectorCredentials {
|
|
21
|
+
accessKeyIdSecret: string;
|
|
22
|
+
secretAccessKeySecret: string;
|
|
23
|
+
}
|
|
24
|
+
export interface DataSourceConnector {
|
|
25
|
+
id: string;
|
|
26
|
+
type: 's3';
|
|
27
|
+
bucket: string;
|
|
28
|
+
region: string;
|
|
29
|
+
/** Key prefix listed under; '' for the whole bucket. */
|
|
30
|
+
prefix: string;
|
|
31
|
+
/** S3-compatible endpoint, or null for AWS. */
|
|
32
|
+
endpoint: string | null;
|
|
33
|
+
credentials: DataSourceConnectorCredentials;
|
|
34
|
+
policy: DataSourceConnectorPolicy;
|
|
35
|
+
lastSyncJobId: string | null;
|
|
36
|
+
lastSyncedAt: string | null;
|
|
37
|
+
/** Keys the last sync's walk listed: the bucket's size as of then. */
|
|
38
|
+
lastSyncObjectsListed: number | null;
|
|
39
|
+
lastError: string | null;
|
|
40
|
+
/** Only on GET: how many customer keys the index tracks. */
|
|
41
|
+
objects?: {
|
|
42
|
+
live: number;
|
|
43
|
+
deleted: number;
|
|
44
|
+
};
|
|
45
|
+
createdAt: string;
|
|
46
|
+
updatedAt: string;
|
|
47
|
+
}
|
|
48
|
+
/** POST /datasources/connector, POST /datasources/connector/remove */
|
|
49
|
+
export interface DataSourceConnectorResult {
|
|
50
|
+
connector: DataSourceConnector;
|
|
51
|
+
}
|
|
52
|
+
/** GET /datasources/connector?slug= */
|
|
53
|
+
export interface DataSourceConnectorGetResult {
|
|
54
|
+
connector: DataSourceConnector | null;
|
|
55
|
+
}
|
|
56
|
+
/** POST /datasources/sync */
|
|
57
|
+
export interface DataSourceSyncResult {
|
|
58
|
+
job: DataSourceJob;
|
|
59
|
+
}
|