@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.
Files changed (87) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +1 -1
  3. package/dist/client.d.ts +199 -0
  4. package/dist/config.d.ts +8 -0
  5. package/dist/ctx.d.ts +36 -0
  6. package/dist/errors.d.ts +68 -0
  7. package/dist/http.d.ts +68 -0
  8. package/dist/index.d.ts +7 -9442
  9. package/dist/index.js +6 -6
  10. package/dist/index.js.map +7 -1
  11. package/dist/ops/agent.d.ts +44 -0
  12. package/dist/ops/analytics.d.ts +285 -0
  13. package/dist/ops/apps.d.ts +33 -0
  14. package/dist/ops/crashes.d.ts +86 -0
  15. package/dist/ops/cron.d.ts +40 -0
  16. package/dist/ops/data.d.ts +68 -0
  17. package/dist/ops/dataSourceConnectors.d.ts +80 -0
  18. package/dist/ops/dataSourceEvals.d.ts +208 -0
  19. package/dist/ops/dataSourceJobs.d.ts +141 -0
  20. package/dist/ops/dataSourceMappers.d.ts +125 -0
  21. package/dist/ops/dataSources.d.ts +654 -0
  22. package/dist/ops/db.d.ts +81 -0
  23. package/dist/ops/diagnostics.d.ts +42 -0
  24. package/dist/ops/domains.d.ts +250 -0
  25. package/dist/ops/email.d.ts +305 -0
  26. package/dist/ops/events.d.ts +56 -0
  27. package/dist/ops/feedback.d.ts +24 -0
  28. package/dist/ops/files.d.ts +166 -0
  29. package/dist/ops/infra.d.ts +163 -0
  30. package/dist/ops/issues.d.ts +160 -0
  31. package/dist/ops/jewels.d.ts +249 -0
  32. package/dist/ops/methods.d.ts +60 -0
  33. package/dist/ops/prerender.d.ts +74 -0
  34. package/dist/ops/previews.d.ts +52 -0
  35. package/dist/ops/qaRecordings.d.ts +68 -0
  36. package/dist/ops/releases.d.ts +193 -0
  37. package/dist/ops/requests.d.ts +73 -0
  38. package/dist/ops/secrets.d.ts +69 -0
  39. package/dist/ops/settings.d.ts +45 -0
  40. package/dist/ops/tasks.d.ts +47 -0
  41. package/dist/ops/usage.d.ts +40 -0
  42. package/dist/ops/users.d.ts +59 -0
  43. package/dist/ops/voice.d.ts +178 -0
  44. package/dist/output.d.ts +19 -0
  45. package/dist/parseJsonConfig.d.ts +41 -0
  46. package/dist/poll.d.ts +38 -0
  47. package/dist/prod.js +21 -21
  48. package/dist/runningMethod.d.ts +25 -0
  49. package/dist/sleep.d.ts +12 -0
  50. package/dist/types/agent.d.ts +95 -0
  51. package/dist/types/analytics.d.ts +225 -0
  52. package/dist/types/apps.d.ts +39 -0
  53. package/dist/types/crashes.d.ts +81 -0
  54. package/dist/types/cron.d.ts +68 -0
  55. package/dist/types/data.d.ts +38 -0
  56. package/dist/types/dataSourceConnectors.d.ts +59 -0
  57. package/dist/types/dataSourceEvals.d.ts +225 -0
  58. package/dist/types/dataSourceJobs.d.ts +283 -0
  59. package/dist/types/dataSourceMappers.d.ts +204 -0
  60. package/dist/types/dataSourceReaders.d.ts +102 -0
  61. package/dist/types/dataSources.d.ts +627 -0
  62. package/dist/types/db.d.ts +63 -0
  63. package/dist/types/diagnostics.d.ts +96 -0
  64. package/dist/types/domains.d.ts +277 -0
  65. package/dist/types/email.d.ts +400 -0
  66. package/dist/types/events.d.ts +54 -0
  67. package/dist/types/feedback.d.ts +11 -0
  68. package/dist/types/files.d.ts +150 -0
  69. package/dist/types/index.d.ts +37 -0
  70. package/dist/types/infra.d.ts +188 -0
  71. package/dist/types/issues.d.ts +106 -0
  72. package/dist/types/jewels.d.ts +336 -0
  73. package/dist/types/methods.d.ts +34 -0
  74. package/dist/types/prerender.d.ts +59 -0
  75. package/dist/types/previews.d.ts +39 -0
  76. package/dist/types/progress.d.ts +31 -0
  77. package/dist/types/qaRecordings.d.ts +51 -0
  78. package/dist/types/releases.d.ts +233 -0
  79. package/dist/types/requests.d.ts +114 -0
  80. package/dist/types/secrets.d.ts +52 -0
  81. package/dist/types/settings.d.ts +79 -0
  82. package/dist/types/tasks.d.ts +99 -0
  83. package/dist/types/usage.d.ts +29 -0
  84. package/dist/types/users.d.ts +61 -0
  85. package/dist/types/voice.d.ts +197 -0
  86. package/dist/upload.d.ts +11 -0
  87. package/package.json +7 -10
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Response types for the v2 prerender management endpoints.
3
+ *
4
+ * Transcribed from the api:
5
+ * apps/api/src/roles/http/routes/Apps/manage/prerender.ts
6
+ * apps/api/src/customerApps/AppPrerender/invalidateSnapshots.ts
7
+ * apps/api/src/customerApps/AppPrerender/snapshotStore.ts
8
+ */
9
+ /** One stored snapshot entry as returned by the listing endpoint. */
10
+ export interface PrerenderPage {
11
+ /** The host the page was rendered on, since one app can serve several
12
+ * sites. Null for a page stored before snapshots were kept per host. */
13
+ host: string | null;
14
+ path: string;
15
+ /** ISO timestamp of when the snapshot was last written. Optional — absent
16
+ * if the object store did not return a LastModified header. */
17
+ renderedAt?: string;
18
+ /** Snapshot size in bytes. Optional — absent if the object store did not
19
+ * return a size. */
20
+ bytes?: number;
21
+ }
22
+ /** Response shape for GET /prerender/pages.
23
+ * `releaseId` is null when the app has no live release (pages is empty). */
24
+ export interface PrerenderPagesResult {
25
+ releaseId: string | null;
26
+ pages: PrerenderPage[];
27
+ /** Cursor to pass on the next call to page through more snapshots.
28
+ * Absent when this is the last page. */
29
+ nextCursor?: string;
30
+ }
31
+ /** Response shape for GET /prerender/pages/view.
32
+ * Returns JSON (not text/html) so the snapshot HTML cannot execute in the
33
+ * api origin; the dashboard renders it in a sandboxed iframe. */
34
+ export interface PrerenderViewResult {
35
+ /** The host whose copy this is (the app's address when none was asked for). */
36
+ host: string;
37
+ path: string;
38
+ html: string;
39
+ /** The status crawlers are served it with: 200, or the 4xx the page
40
+ * declared with `<meta name="prerender-status-code">`. */
41
+ status: number;
42
+ }
43
+ /** Response shape for POST /prerender/invalidate.
44
+ * `purged` is the number of pages (paths or URLs) explicitly purged, or 'all'
45
+ * when the entire snapshot prefix was wiped (--all flag / no paths body). */
46
+ export interface PrerenderInvalidateResult {
47
+ purged: number | 'all';
48
+ }
49
+ /** Local result type for `prerender get`.
50
+ * The command fetches the app's public URL with a bot User-Agent and
51
+ * returns this shape; it does NOT go through api(). */
52
+ export interface PrerenderGetResult {
53
+ /** The full URL that was fetched. */
54
+ url: string;
55
+ /** HTTP status code returned by the origin. */
56
+ status: number;
57
+ /** Raw response body (HTML or SPA shell if the snapshot is cold). */
58
+ html: string;
59
+ }
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Response shapes for the previews command group — transcribed from the api.
3
+ *
4
+ * Sources (apps/api/src/):
5
+ * roles/http/routes/Apps/manage/preview.ts (the share routes)
6
+ * customerApps/AppReleases/dao/PreviewShareLinksDao.ts (PreviewShareLink ~line 24)
7
+ */
8
+ /** A share link to a branch's preview: branch-scoped, revocable, always expiring. */
9
+ export interface PreviewShareLink {
10
+ id: string;
11
+ appId: string;
12
+ branch: string;
13
+ label: string | null;
14
+ createdBy: string | null;
15
+ createdAt: string;
16
+ expiresAt: string;
17
+ revokedAt: string | null;
18
+ lastAccessedAt: string | null;
19
+ accessCount: number;
20
+ }
21
+ /** A new share link. `url` and `token` are shown once and can't be recovered. */
22
+ export interface PreviewShareResult {
23
+ link: PreviewShareLink;
24
+ /** For a person: opening it sets the preview's cookie, then shows the app. */
25
+ url: string;
26
+ /**
27
+ * For a client with no cookie jar (curl, git, CI): sent as the
28
+ * `X-Remy-Preview` header on requests to `previewUrl`.
29
+ */
30
+ token: string;
31
+ /** The branch's preview host, which follows the branch as it's pushed. */
32
+ previewUrl: string;
33
+ }
34
+ export interface PreviewShareListResult {
35
+ links: PreviewShareLink[];
36
+ }
37
+ export interface PreviewShareRevokeResult {
38
+ link: PreviewShareLink;
39
+ }
@@ -0,0 +1,31 @@
1
+ /**
2
+ * One shape for every long operation's progress: a bulk load, an index
3
+ * reload, a move, an index build, a resource changing phase. Rate and ETA are
4
+ * measured by the platform from the operation's own record, so the CLI, the
5
+ * dashboard and a search's refusal message quote the same numbers.
6
+ *
7
+ * Transcribed from the api: apps/api/src/core/Progress/progress.ts
8
+ */
9
+ export interface OperationProgress {
10
+ /** The operation's own phase word: `running`, `copying`, `building`, `provisioning`… */
11
+ phase: string;
12
+ unit: 'documents' | 'objects' | 'vectors' | 'steps';
13
+ done: number;
14
+ /** Null when the operation has no known end (a planning walk, a phase transition). */
15
+ total: number | null;
16
+ /** Units per minute over the last few minutes; null until measured. */
17
+ ratePerMinute: number | null;
18
+ /** When the rest lands at that rate; null without a rate or a total. */
19
+ etaAt: string | null;
20
+ startedAt: string | null;
21
+ /** When the operation last moved. */
22
+ updatedAt: string | null;
23
+ /** No movement for 30 minutes while under way. */
24
+ stalled: boolean;
25
+ /** The operation's own word on itself: an error, a pause reason, a step. */
26
+ note: string | null;
27
+ history: {
28
+ phase: string;
29
+ at: string;
30
+ }[];
31
+ }
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Response types for browser-QA replay recordings.
3
+ *
4
+ * Chunks are ordinary private files in the app's `qa-recordings` store, keyed
5
+ * `{sessionId}/{runId}/{seq}.json`, so `ls` here is a grouped view over
6
+ * `files.ls` rather than its own endpoint. Transcribed from the api (apps/api/src/):
7
+ * roles/http/routes/Apps/develop/recordings.ts
8
+ * customerApps/AppDevBoxes/recordings/sessions.ts
9
+ *
10
+ * Export is the exception — the dev box packages it (see ../ops/qaRecordings).
11
+ */
12
+ /** One document lifetime within a session: a page load and everything after it
13
+ * until the next one. Its lowest-seq chunk carries the rrweb FullSnapshot. */
14
+ export interface QaRecordingRun {
15
+ runId: string;
16
+ chunks: number;
17
+ bytes: number;
18
+ /** Store-relative keys, in seq order. */
19
+ keys: string[];
20
+ }
21
+ /** One recording session — a single tunnel process's continuous recording. */
22
+ export interface QaRecordingSession {
23
+ sessionId: string;
24
+ chunks: number;
25
+ bytes: number;
26
+ /** ISO-8601, from the chunk objects' last-modified times. */
27
+ startedAt?: string;
28
+ endedAt?: string;
29
+ runs: QaRecordingRun[];
30
+ }
31
+ export interface QaRecordingsLsResult {
32
+ store: string;
33
+ sessions: QaRecordingSession[];
34
+ /** Present when the listing was truncated — pass it back as `cursor`. */
35
+ cursor?: string;
36
+ }
37
+ export interface QaRecordingsExportResult {
38
+ jobId: string;
39
+ status: 'completed' | 'failed' | 'cancelled';
40
+ /** Public target only. A private one gives `store`/`key`; sign it with
41
+ * `files sign` when you want a link. */
42
+ url?: string;
43
+ store?: string;
44
+ key?: string;
45
+ width?: number;
46
+ height?: number;
47
+ /** Length of the rendered clip, dead air already collapsed. */
48
+ durationMs?: number;
49
+ error?: string;
50
+ errorCode?: string;
51
+ }
@@ -0,0 +1,233 @@
1
+ /**
2
+ * Response types for the releases command group.
3
+ *
4
+ * Sources in the api (apps/api/src/):
5
+ * GET /releases → roles/http/routes/Apps/manage/releases.ts
6
+ * GET /releases/:releaseId → roles/http/routes/Apps/manage/dashboard.ts
7
+ * GET /releases/by-commit/:sha → roles/http/routes/Apps/manage/dashboard.ts
8
+ * GET /dashboard → roles/http/routes/Apps/manage/dashboard.ts
9
+ */
10
+ export interface V2CommitInfo {
11
+ authorName: string;
12
+ authorEmail: string;
13
+ date: string;
14
+ message: string;
15
+ }
16
+ export interface V2BuildStats {
17
+ methodCount?: number;
18
+ methodsBundleSizeBytes?: number;
19
+ interfaceCount?: number;
20
+ tableCount?: number;
21
+ }
22
+ export interface V2BuildLogEntry {
23
+ ts: number;
24
+ phase: string;
25
+ message: string;
26
+ metadata?: Record<string, unknown>;
27
+ }
28
+ /** Terminal and in-progress states a release moves through. */
29
+ export type V2ReleaseStatus = 'building' | 'compiled' | 'live' | 'preview' | 'dev' | 'failed' | 'superseded';
30
+ /**
31
+ * Why a failed release failed — derived server-side from the build log
32
+ * (describeReleaseFailure() in the api) and present on every release
33
+ * shape. All three are null unless `status` is 'failed'.
34
+ *
35
+ * `failureKind` is the field to branch on:
36
+ * 'interrupted' — the build's orchestrator died (platform restart); the
37
+ * platform retries once automatically. Transient.
38
+ * 'unbuildable' — the commit couldn't be read as an app (mindstudio.json
39
+ * missing/invalid). Fix the commit; nothing to retry.
40
+ * 'build' — the build itself failed (compile error, deploy step).
41
+ */
42
+ export interface ReleaseFailureFields {
43
+ failureReason: string | null;
44
+ /** Build stage that was running when it failed (`interfaces`, `promote`…). */
45
+ failurePhase: string | null;
46
+ failureKind: 'build' | 'interrupted' | 'unbuildable' | null;
47
+ }
48
+ /**
49
+ * Lightweight release projection returned by the paginated list endpoint.
50
+ * Heavy fields (buildLog, manifest, methods, interfaces) are dropped.
51
+ * Produced by toReleaseFragment() in the api.
52
+ */
53
+ export interface ReleaseFragment extends ReleaseFailureFields {
54
+ id: string;
55
+ commitSha: string;
56
+ commitInfo: V2CommitInfo;
57
+ status: V2ReleaseStatus;
58
+ branch: string | null;
59
+ buildDurationMs: number | null;
60
+ buildStats: V2BuildStats | null;
61
+ createdAt: string;
62
+ createdBy: string | null;
63
+ publishedAt: string | null;
64
+ /** Release-pinned preview URL; null when status is not 'preview'. */
65
+ previewUrl: string | null;
66
+ }
67
+ /**
68
+ * Response from GET /_internal/v2/apps/:appId/releases.
69
+ * Paginated on (created_at DESC, id DESC) using an opaque base64url cursor.
70
+ */
71
+ export interface ReleasesListResult {
72
+ releases: ReleaseFragment[];
73
+ /** Opaque keyset cursor; null when no further pages remain. */
74
+ nextCursor: string | null;
75
+ }
76
+ /**
77
+ * Full release returned by GET /_internal/v2/apps/:appId/releases/:releaseId.
78
+ * Includes build log, databases, signed diff/diagnostics URLs, and the
79
+ * post-deploy async progress signal.
80
+ */
81
+ export interface ReleasesGetResult extends ReleaseFailureFields {
82
+ id: string;
83
+ appId: string;
84
+ commitSha: string;
85
+ commitInfo: V2CommitInfo;
86
+ commitDiffS3Key: string | null;
87
+ branch: string | null;
88
+ status: V2ReleaseStatus;
89
+ /** Immutable environment kind stamped at creation. Null for pre-column rows. */
90
+ kind: 'live' | 'preview' | 'dev' | null;
91
+ buildLog: V2BuildLogEntry[];
92
+ manifest: Record<string, unknown>;
93
+ methods: unknown[];
94
+ interfaces: unknown[];
95
+ deps: unknown | null;
96
+ pendingEffects: Record<string, unknown>;
97
+ stagingVersionId: string | null;
98
+ buildStartedAt: string | null;
99
+ buildFinishedAt: string | null;
100
+ buildDurationMs: number | null;
101
+ buildStats: V2BuildStats | null;
102
+ createdAt: string;
103
+ createdBy: string | null;
104
+ publishedAt: string | null;
105
+ autoRetryOf: string | null;
106
+ databases: unknown[];
107
+ /** Short-lived signed URL for the commit diff object; null if no diff. */
108
+ commitDiffUrl: string | null;
109
+ /** Frontend diagnostics with a signed Lighthouse report URL; null if none. */
110
+ diagnostics: Record<string, unknown> | null;
111
+ /** Canonical public URL the app is currently served on. */
112
+ primaryUrl: string;
113
+ /** Release-pinned preview URL; null when not a preview release. */
114
+ previewUrl: string | null;
115
+ /** Branch-following URL that tracks the latest preview on this branch. */
116
+ branchUrl: string | null;
117
+ }
118
+ /**
119
+ * Response from GET /_internal/v2/apps/:appId/releases/by-commit/:sha.
120
+ * Plain release row — no databases/diff enrichment — plus previewUrl and
121
+ * primaryUrl.
122
+ * Used by 'releases wait', which polls this endpoint in a loop.
123
+ */
124
+ export interface ReleasesByCommitResult extends ReleaseFailureFields {
125
+ id: string;
126
+ appId: string;
127
+ commitSha: string;
128
+ commitInfo: V2CommitInfo;
129
+ commitDiffS3Key: string | null;
130
+ branch: string | null;
131
+ status: V2ReleaseStatus;
132
+ /** Immutable environment kind stamped at creation. Null for pre-column rows. */
133
+ kind: 'live' | 'preview' | 'dev' | null;
134
+ buildLog: V2BuildLogEntry[];
135
+ manifest: Record<string, unknown>;
136
+ methods: unknown[];
137
+ interfaces: unknown[];
138
+ deps: unknown | null;
139
+ pendingEffects: Record<string, unknown>;
140
+ stagingVersionId: string | null;
141
+ buildStartedAt: string | null;
142
+ buildFinishedAt: string | null;
143
+ buildDurationMs: number | null;
144
+ buildStats: V2BuildStats | null;
145
+ createdAt: string;
146
+ createdBy: string | null;
147
+ publishedAt: string | null;
148
+ autoRetryOf: string | null;
149
+ /**
150
+ * Release-pinned preview URL when status is 'preview'; null otherwise.
151
+ * Synthesised synchronously from the release id by buildPreviewUrl().
152
+ */
153
+ previewUrl: string | null;
154
+ /**
155
+ * The address the app is served on when status is 'live' (its live custom
156
+ * domain, else its platform subdomain, else its id's own host; ends in a
157
+ * slash); null otherwise.
158
+ */
159
+ primaryUrl: string | null;
160
+ /**
161
+ * The data sources this release declares app code for. A live release's
162
+ * reader entries carry `readerUnread`: the source's documents its reader
163
+ * hadn't read when the release went live.
164
+ */
165
+ dataSources?: {
166
+ slug: string;
167
+ reader?: unknown;
168
+ readerUnread?: number;
169
+ }[];
170
+ }
171
+ /** A compiled method entry as it appears on a live release. */
172
+ export interface DashboardReleaseMethod {
173
+ id: string;
174
+ name: string;
175
+ description?: string;
176
+ path: string;
177
+ export: string;
178
+ inputSchema?: Record<string, unknown>;
179
+ outputSchema?: Record<string, unknown>;
180
+ }
181
+ /**
182
+ * The liveRelease field on the dashboard response — a full release row
183
+ * enriched with databases, a signed diff URL, and frontend diagnostics.
184
+ */
185
+ export interface DashboardLiveRelease {
186
+ id: string;
187
+ appId: string;
188
+ commitSha: string;
189
+ commitInfo: V2CommitInfo;
190
+ commitDiffS3Key: string | null;
191
+ branch: string | null;
192
+ status: V2ReleaseStatus;
193
+ kind: 'live' | 'preview' | 'dev' | null;
194
+ buildLog: V2BuildLogEntry[];
195
+ manifest: Record<string, unknown>;
196
+ methods: DashboardReleaseMethod[];
197
+ interfaces: unknown[];
198
+ deps: unknown | null;
199
+ pendingEffects: Record<string, unknown>;
200
+ stagingVersionId: string | null;
201
+ buildStartedAt: string | null;
202
+ buildFinishedAt: string | null;
203
+ buildDurationMs: number | null;
204
+ buildStats: V2BuildStats | null;
205
+ createdAt: string;
206
+ createdBy: string | null;
207
+ publishedAt: string | null;
208
+ autoRetryOf: string | null;
209
+ databases: unknown[];
210
+ commitDiffUrl: string | null;
211
+ diagnostics: Record<string, unknown> | null;
212
+ }
213
+ /**
214
+ * Response from GET /_internal/v2/apps/:appId/dashboard.
215
+ * Only the fields used by this CLI are typed; the full shape
216
+ * (interfaces detail, previewReleases, devSessions) is wider.
217
+ */
218
+ export interface DashboardResult {
219
+ appId: string;
220
+ customSubdomain: string | null;
221
+ primaryUrl: string;
222
+ metadata: Record<string, unknown>;
223
+ liveRelease: DashboardLiveRelease | null;
224
+ releases: ReleaseFragment[];
225
+ interfaces: Record<string, unknown>;
226
+ previewReleases: unknown[];
227
+ /**
228
+ * One per workspace with a dev session open — a person's box, a person's CLI — and empty when
229
+ * none is. Each carries the `releaseId` that names it, which is what the destructive data ops
230
+ * take to say which session they mean.
231
+ */
232
+ devSessions: Array<Record<string, unknown>>;
233
+ }
@@ -0,0 +1,114 @@
1
+ /**
2
+ * Response types for src/commands/requests.ts.
3
+ * Transcribed from:
4
+ * - RequestLogDao.list() → RequestsListResult
5
+ * - RequestLogEntry (RequestLogDao.get()) → RequestsGetResult
6
+ * - MethodMetricsDao.getAppSummary() → RequestsStatsSummaryResult
7
+ * - MethodMetricsDao.getMethodTimeSeries() → RequestsStatsMethodResult
8
+ */
9
+ /** One row in the lightweight request list (no input/output/stdout). */
10
+ export interface RequestsListRow {
11
+ id: string;
12
+ releaseId: string;
13
+ methodId: string;
14
+ interface: string;
15
+ success: boolean;
16
+ durationMs: number | null;
17
+ userId: string | null;
18
+ createdAt: string;
19
+ }
20
+ /** GET /_internal/v2/apps/:appId/requests */
21
+ export interface RequestsListResult {
22
+ requests: RequestsListRow[];
23
+ nextCursor: string | null;
24
+ }
25
+ /** Full request log entry (all fields). GET /_internal/v2/apps/:appId/requests/:requestId */
26
+ export interface RequestsGetResult {
27
+ id: string;
28
+ appId: string;
29
+ releaseId: string;
30
+ methodId: string;
31
+ interface: string;
32
+ /** Raw method input payload (jsonb). */
33
+ input: unknown;
34
+ /**
35
+ * Raw method output payload (jsonb). One past 256 KB of JSON is
36
+ * `{ truncated: true, bytes, sha256, preview }`, its first 16 KB.
37
+ */
38
+ output: unknown;
39
+ /** Error object written by the executor (jsonb). */
40
+ error: unknown;
41
+ stdout: string[];
42
+ success: boolean;
43
+ durationMs: number | null;
44
+ userId: string | null;
45
+ /** Interface-specific context (e.g. cron schedule info). */
46
+ interfaceContext: unknown;
47
+ createdAt: string;
48
+ }
49
+ /** One time-series bucket in the app-summary response (no successCount). */
50
+ export interface RequestsStatsSummaryBucket {
51
+ start: string;
52
+ requestCount: number;
53
+ errorCount: number;
54
+ /** null when requestCount === 0 — no latency to average. */
55
+ avgDurationMs: number | null;
56
+ }
57
+ /** GET /_internal/v2/apps/:appId/metrics/summary */
58
+ export interface RequestsStatsSummaryResult {
59
+ buckets: RequestsStatsSummaryBucket[];
60
+ totals: {
61
+ requestCount: number;
62
+ successCount: number;
63
+ errorCount: number;
64
+ avgDurationMs: number;
65
+ /** Avg duration for background interfaces (cron, email, jewel) only. */
66
+ backgroundAvgDurationMs: number;
67
+ /** Total distinct managed users for this app (from appManagedUsersDao). */
68
+ uniqueUsers: number;
69
+ };
70
+ byMethod: Array<{
71
+ methodId: string;
72
+ requestCount: number;
73
+ errorCount: number;
74
+ avgDurationMs: number;
75
+ /** Same time grid as `buckets[]` — positional alignment guaranteed. */
76
+ sparkline: Array<{
77
+ requestCount: number;
78
+ errorCount: number;
79
+ }>;
80
+ }>;
81
+ byErrorType: Array<{
82
+ errorType: string;
83
+ count: number;
84
+ lastSeen: string;
85
+ }>;
86
+ /** Keys are interface names (e.g. 'api', 'agent', 'cron'). */
87
+ byInterface: Record<string, {
88
+ requestCount: number;
89
+ }>;
90
+ }
91
+ /** One time-series bucket in the per-method response (includes successCount). */
92
+ export interface RequestsStatsMethodBucket {
93
+ start: string;
94
+ requestCount: number;
95
+ successCount: number;
96
+ errorCount: number;
97
+ /** null when requestCount === 0 — no latency to average. */
98
+ avgDurationMs: number | null;
99
+ }
100
+ /** GET /_internal/v2/apps/:appId/metrics/methods/:methodId */
101
+ export interface RequestsStatsMethodResult {
102
+ methodId: string;
103
+ buckets: RequestsStatsMethodBucket[];
104
+ totals: {
105
+ requestCount: number;
106
+ successCount: number;
107
+ errorCount: number;
108
+ avgDurationMs: number;
109
+ /** Avg duration for background interfaces (cron, email, jewel) only. */
110
+ backgroundAvgDurationMs: number;
111
+ /** Error counts keyed by error type string (first 50 chars of message). */
112
+ errorsByType: Record<string, number>;
113
+ };
114
+ }
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Response types for the secrets command group.
3
+ *
4
+ * Sources in the api (apps/api/src/):
5
+ * GET /secrets → roles/http/routes/Apps/manage/secrets.ts
6
+ * GET /secrets/:key → roles/http/routes/Apps/manage/secrets.ts
7
+ * PUT /secrets/:key → roles/http/routes/Apps/manage/secrets.ts
8
+ * DELETE /secrets/:key → roles/http/routes/Apps/manage/secrets.ts
9
+ * AppSecretsDao → customerApps/AppSecrets/dao/AppSecretsDao.ts
10
+ */
11
+ /**
12
+ * A secret metadata row (no decrypted values).
13
+ * Returned by the list endpoint; mirrors AppSecret from AppSecretsDao.
14
+ */
15
+ export interface AppSecretRow {
16
+ id: string;
17
+ appId: string;
18
+ key: string;
19
+ /** Whether a dev-environment value is currently stored. */
20
+ hasDevValue: boolean;
21
+ /** Whether a prod-environment value is currently stored. */
22
+ hasProdValue: boolean;
23
+ createdAt: string;
24
+ updatedAt: string;
25
+ }
26
+ /** Response from GET /_internal/v2/apps/:appId/secrets. */
27
+ export interface SecretsListResult {
28
+ secrets: AppSecretRow[];
29
+ }
30
+ /**
31
+ * Response from GET /_internal/v2/apps/:appId/secrets/:key.
32
+ * Returns KMS-decrypted values inline.
33
+ */
34
+ export interface SecretsGetResult {
35
+ key: string;
36
+ devValue: string | null;
37
+ prodValue: string | null;
38
+ }
39
+ /**
40
+ * Response from PUT /_internal/v2/apps/:appId/secrets/:key.
41
+ * Route returns HTTP 200 with { ok: true } (not a 204).
42
+ */
43
+ export interface SecretsSetResult {
44
+ ok: true;
45
+ }
46
+ /**
47
+ * Response from DELETE /_internal/v2/apps/:appId/secrets/:key.
48
+ * Route returns HTTP 200 with { ok: true } (not a 204).
49
+ */
50
+ export interface SecretsDeleteResult {
51
+ ok: true;
52
+ }
@@ -0,0 +1,79 @@
1
+ /**
2
+ * Response types for the settings command group.
3
+ *
4
+ * Sources in the api (apps/api/src/):
5
+ * GET /settings/v2 → roles/http/routes/Apps/manage/settings.ts
6
+ * POST /settings/v2 → roles/http/routes/Apps/manage/settings.ts
7
+ * V2AppSettings → customerApps/AppRecord/settings.ts
8
+ */
9
+ /**
10
+ * Mutable app toggles stored in apps.v2_settings. Faithfully transcribed from
11
+ * V2AppSettings in the api; this is the authoritative type for both the GET
12
+ * and POST /settings/v2 responses.
13
+ */
14
+ export interface V2AppSettings {
15
+ /**
16
+ * When true (default), reject signups via the email-OTP flow from known
17
+ * disposable email domains. Checked at OTP send time, before the code is sent.
18
+ */
19
+ blockDisposableEmails?: boolean;
20
+ /**
21
+ * Master toggle for the signup allowlist. Default false. The list is only
22
+ * enforced when this is true AND the list is non-empty.
23
+ */
24
+ signupAllowlistEnabled?: boolean;
25
+ /**
26
+ * Signup allowlist. When enforced, only emails matching an entry may register
27
+ * via email-code. Entries: '*@domain.com' (whole domain) or 'user@domain.com'.
28
+ * Case-insensitive; domain match is exact (no subdomains).
29
+ */
30
+ signupAllowlist?: string[];
31
+ /**
32
+ * Master toggle for test accounts (fixed-OTP login). Default false. When true,
33
+ * identifiers in testAccounts sign in with their pre-set code instead of a
34
+ * delivered one.
35
+ */
36
+ testAccountsEnabled?: boolean;
37
+ /**
38
+ * Test accounts for fixed-OTP login. Each entry has an email or E.164 phone
39
+ * identifier and a fixed 6-digit numeric code. Capped at 5 entries.
40
+ */
41
+ testAccounts?: Array<{
42
+ identifier: string;
43
+ code: string;
44
+ }>;
45
+ /**
46
+ * Payload logging. When false, the request log keeps each method call's
47
+ * metadata (timing, status, error) but no input, output or console output,
48
+ * task traces keep no transcripts, inbound email runs keep no message, and
49
+ * frontend error reports keep no response bodies. Default true. Its workspace can turn it off for every app
50
+ * (`SettingsResult.workspaceLogging`).
51
+ */
52
+ logPayloads?: boolean;
53
+ /**
54
+ * Extra query-param names to preserve in analytics URLs beyond the platform
55
+ * defaults (UTMs + ad click IDs).
56
+ */
57
+ analyticsExtraQueryParams?: string[];
58
+ /**
59
+ * Extra https origins allowed to iframe the deployed app, additive to the
60
+ * platform baseline ('self' + launcher). Each entry is an exact https origin
61
+ * (e.g. 'https://app.acme.com'). Capped at 25 entries.
62
+ */
63
+ additionalFrameAncestors?: string[];
64
+ }
65
+ /**
66
+ * Response from GET /_internal/v2/apps/:appId/settings/v2 and
67
+ * POST /_internal/v2/apps/:appId/settings/v2.
68
+ * Both endpoints return the full current settings after any update.
69
+ */
70
+ export interface SettingsResult {
71
+ settings: V2AppSettings;
72
+ /**
73
+ * What the app's workspace allows. `payloads` false means logPayloads is off
74
+ * for every app in it, whatever `settings.logPayloads` says.
75
+ */
76
+ workspaceLogging: {
77
+ payloads: boolean;
78
+ };
79
+ }