@appforge-ci/core 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/agent-readiness.d.ts +163 -0
- package/dist/agent-readiness.d.ts.map +1 -0
- package/dist/agent-readiness.js +179 -0
- package/dist/agent-readiness.js.map +1 -0
- package/dist/agent-readiness.test.d.ts +2 -0
- package/dist/agent-readiness.test.d.ts.map +1 -0
- package/dist/agent-readiness.test.js +177 -0
- package/dist/agent-readiness.test.js.map +1 -0
- package/dist/api-client.d.ts +529 -0
- package/dist/api-client.d.ts.map +1 -0
- package/dist/api-client.js +551 -0
- package/dist/api-client.js.map +1 -0
- package/dist/api-client.test.d.ts +2 -0
- package/dist/api-client.test.d.ts.map +1 -0
- package/dist/api-client.test.js +305 -0
- package/dist/api-client.test.js.map +1 -0
- package/dist/build-cost.test.d.ts +2 -0
- package/dist/build-cost.test.d.ts.map +1 -0
- package/dist/build-cost.test.js +21 -0
- package/dist/build-cost.test.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/ota-artifact.d.ts +41 -0
- package/dist/ota-artifact.d.ts.map +1 -0
- package/dist/ota-artifact.js +43 -0
- package/dist/ota-artifact.js.map +1 -0
- package/dist/ota-artifact.test.d.ts +2 -0
- package/dist/ota-artifact.test.d.ts.map +1 -0
- package/dist/ota-artifact.test.js +44 -0
- package/dist/ota-artifact.test.js.map +1 -0
- package/dist/ota-bundle-hash.d.ts +38 -0
- package/dist/ota-bundle-hash.d.ts.map +1 -0
- package/dist/ota-bundle-hash.js +40 -0
- package/dist/ota-bundle-hash.js.map +1 -0
- package/dist/ota-bundle-hash.test.d.ts +2 -0
- package/dist/ota-bundle-hash.test.d.ts.map +1 -0
- package/dist/ota-bundle-hash.test.js +28 -0
- package/dist/ota-bundle-hash.test.js.map +1 -0
- package/dist/ota-rollout.d.ts +38 -0
- package/dist/ota-rollout.d.ts.map +1 -0
- package/dist/ota-rollout.js +53 -0
- package/dist/ota-rollout.js.map +1 -0
- package/dist/ota-rollout.test.d.ts +2 -0
- package/dist/ota-rollout.test.d.ts.map +1 -0
- package/dist/ota-rollout.test.js +48 -0
- package/dist/ota-rollout.test.js.map +1 -0
- package/dist/schemas.d.ts +776 -0
- package/dist/schemas.d.ts.map +1 -0
- package/dist/schemas.js +538 -0
- package/dist/schemas.js.map +1 -0
- package/dist/token-packs.test.d.ts +2 -0
- package/dist/token-packs.test.d.ts.map +1 -0
- package/dist/token-packs.test.js +34 -0
- package/dist/token-packs.test.js.map +1 -0
- package/dist/types.d.ts +445 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +80 -0
- package/dist/types.js.map +1 -0
- package/package.json +35 -0
|
@@ -0,0 +1,776 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const platformSchema: z.ZodEnum<["ios", "android", "flutter", "react-native"]>;
|
|
3
|
+
export declare const appforgeWorkflowSchema: z.ZodObject<{
|
|
4
|
+
name: z.ZodOptional<z.ZodString>;
|
|
5
|
+
environment: z.ZodOptional<z.ZodObject<{
|
|
6
|
+
node: z.ZodOptional<z.ZodString>;
|
|
7
|
+
flutter: z.ZodOptional<z.ZodString>;
|
|
8
|
+
xcode: z.ZodOptional<z.ZodString>;
|
|
9
|
+
vars: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
|
11
|
+
flutter?: string | undefined;
|
|
12
|
+
node?: string | undefined;
|
|
13
|
+
xcode?: string | undefined;
|
|
14
|
+
vars?: Record<string, string> | undefined;
|
|
15
|
+
}, {
|
|
16
|
+
flutter?: string | undefined;
|
|
17
|
+
node?: string | undefined;
|
|
18
|
+
xcode?: string | undefined;
|
|
19
|
+
vars?: Record<string, string> | undefined;
|
|
20
|
+
}>>;
|
|
21
|
+
triggers: z.ZodOptional<z.ZodObject<{
|
|
22
|
+
push: z.ZodOptional<z.ZodObject<{
|
|
23
|
+
branch: z.ZodArray<z.ZodString, "many">;
|
|
24
|
+
}, "strip", z.ZodTypeAny, {
|
|
25
|
+
branch: string[];
|
|
26
|
+
}, {
|
|
27
|
+
branch: string[];
|
|
28
|
+
}>>;
|
|
29
|
+
}, "strip", z.ZodTypeAny, {
|
|
30
|
+
push?: {
|
|
31
|
+
branch: string[];
|
|
32
|
+
} | undefined;
|
|
33
|
+
}, {
|
|
34
|
+
push?: {
|
|
35
|
+
branch: string[];
|
|
36
|
+
} | undefined;
|
|
37
|
+
}>>;
|
|
38
|
+
scripts: z.ZodArray<z.ZodObject<{
|
|
39
|
+
name: z.ZodOptional<z.ZodString>;
|
|
40
|
+
script: z.ZodString;
|
|
41
|
+
}, "strip", z.ZodTypeAny, {
|
|
42
|
+
script: string;
|
|
43
|
+
name?: string | undefined;
|
|
44
|
+
}, {
|
|
45
|
+
script: string;
|
|
46
|
+
name?: string | undefined;
|
|
47
|
+
}>, "many">;
|
|
48
|
+
artifacts: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
49
|
+
/** Opt-in post-build smoke test (#9 v1 — installs the built .apk or
|
|
50
|
+
* zipped Simulator .app, launches it, screenshots it) — see
|
|
51
|
+
* packages/agent/src/lib/android-smoke-test.ts and ios-smoke-test.ts.
|
|
52
|
+
* Off by default; never changes existing workflows' behavior. */
|
|
53
|
+
smokeTest: z.ZodOptional<z.ZodBoolean>;
|
|
54
|
+
/** Opt-in OTA (over-the-air) code-push update publishing. Off by default. */
|
|
55
|
+
ota: z.ZodOptional<z.ZodObject<{
|
|
56
|
+
channel: z.ZodDefault<z.ZodString>;
|
|
57
|
+
mandatory: z.ZodDefault<z.ZodBoolean>;
|
|
58
|
+
}, "strip", z.ZodTypeAny, {
|
|
59
|
+
channel: string;
|
|
60
|
+
mandatory: boolean;
|
|
61
|
+
}, {
|
|
62
|
+
channel?: string | undefined;
|
|
63
|
+
mandatory?: boolean | undefined;
|
|
64
|
+
}>>;
|
|
65
|
+
}, "strip", z.ZodTypeAny, {
|
|
66
|
+
scripts: {
|
|
67
|
+
script: string;
|
|
68
|
+
name?: string | undefined;
|
|
69
|
+
}[];
|
|
70
|
+
name?: string | undefined;
|
|
71
|
+
environment?: {
|
|
72
|
+
flutter?: string | undefined;
|
|
73
|
+
node?: string | undefined;
|
|
74
|
+
xcode?: string | undefined;
|
|
75
|
+
vars?: Record<string, string> | undefined;
|
|
76
|
+
} | undefined;
|
|
77
|
+
triggers?: {
|
|
78
|
+
push?: {
|
|
79
|
+
branch: string[];
|
|
80
|
+
} | undefined;
|
|
81
|
+
} | undefined;
|
|
82
|
+
artifacts?: string[] | undefined;
|
|
83
|
+
smokeTest?: boolean | undefined;
|
|
84
|
+
ota?: {
|
|
85
|
+
channel: string;
|
|
86
|
+
mandatory: boolean;
|
|
87
|
+
} | undefined;
|
|
88
|
+
}, {
|
|
89
|
+
scripts: {
|
|
90
|
+
script: string;
|
|
91
|
+
name?: string | undefined;
|
|
92
|
+
}[];
|
|
93
|
+
name?: string | undefined;
|
|
94
|
+
environment?: {
|
|
95
|
+
flutter?: string | undefined;
|
|
96
|
+
node?: string | undefined;
|
|
97
|
+
xcode?: string | undefined;
|
|
98
|
+
vars?: Record<string, string> | undefined;
|
|
99
|
+
} | undefined;
|
|
100
|
+
triggers?: {
|
|
101
|
+
push?: {
|
|
102
|
+
branch: string[];
|
|
103
|
+
} | undefined;
|
|
104
|
+
} | undefined;
|
|
105
|
+
artifacts?: string[] | undefined;
|
|
106
|
+
smokeTest?: boolean | undefined;
|
|
107
|
+
ota?: {
|
|
108
|
+
channel?: string | undefined;
|
|
109
|
+
mandatory?: boolean | undefined;
|
|
110
|
+
} | undefined;
|
|
111
|
+
}>;
|
|
112
|
+
/** Validates a parsed appforge.yaml document. */
|
|
113
|
+
export declare const appforgeConfigSchema: z.ZodObject<{
|
|
114
|
+
platform: z.ZodEnum<["ios", "android", "flutter", "react-native"]>;
|
|
115
|
+
workflows: z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
116
|
+
name: z.ZodOptional<z.ZodString>;
|
|
117
|
+
environment: z.ZodOptional<z.ZodObject<{
|
|
118
|
+
node: z.ZodOptional<z.ZodString>;
|
|
119
|
+
flutter: z.ZodOptional<z.ZodString>;
|
|
120
|
+
xcode: z.ZodOptional<z.ZodString>;
|
|
121
|
+
vars: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
122
|
+
}, "strip", z.ZodTypeAny, {
|
|
123
|
+
flutter?: string | undefined;
|
|
124
|
+
node?: string | undefined;
|
|
125
|
+
xcode?: string | undefined;
|
|
126
|
+
vars?: Record<string, string> | undefined;
|
|
127
|
+
}, {
|
|
128
|
+
flutter?: string | undefined;
|
|
129
|
+
node?: string | undefined;
|
|
130
|
+
xcode?: string | undefined;
|
|
131
|
+
vars?: Record<string, string> | undefined;
|
|
132
|
+
}>>;
|
|
133
|
+
triggers: z.ZodOptional<z.ZodObject<{
|
|
134
|
+
push: z.ZodOptional<z.ZodObject<{
|
|
135
|
+
branch: z.ZodArray<z.ZodString, "many">;
|
|
136
|
+
}, "strip", z.ZodTypeAny, {
|
|
137
|
+
branch: string[];
|
|
138
|
+
}, {
|
|
139
|
+
branch: string[];
|
|
140
|
+
}>>;
|
|
141
|
+
}, "strip", z.ZodTypeAny, {
|
|
142
|
+
push?: {
|
|
143
|
+
branch: string[];
|
|
144
|
+
} | undefined;
|
|
145
|
+
}, {
|
|
146
|
+
push?: {
|
|
147
|
+
branch: string[];
|
|
148
|
+
} | undefined;
|
|
149
|
+
}>>;
|
|
150
|
+
scripts: z.ZodArray<z.ZodObject<{
|
|
151
|
+
name: z.ZodOptional<z.ZodString>;
|
|
152
|
+
script: z.ZodString;
|
|
153
|
+
}, "strip", z.ZodTypeAny, {
|
|
154
|
+
script: string;
|
|
155
|
+
name?: string | undefined;
|
|
156
|
+
}, {
|
|
157
|
+
script: string;
|
|
158
|
+
name?: string | undefined;
|
|
159
|
+
}>, "many">;
|
|
160
|
+
artifacts: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
161
|
+
/** Opt-in post-build smoke test (#9 v1 — installs the built .apk or
|
|
162
|
+
* zipped Simulator .app, launches it, screenshots it) — see
|
|
163
|
+
* packages/agent/src/lib/android-smoke-test.ts and ios-smoke-test.ts.
|
|
164
|
+
* Off by default; never changes existing workflows' behavior. */
|
|
165
|
+
smokeTest: z.ZodOptional<z.ZodBoolean>;
|
|
166
|
+
/** Opt-in OTA (over-the-air) code-push update publishing. Off by default. */
|
|
167
|
+
ota: z.ZodOptional<z.ZodObject<{
|
|
168
|
+
channel: z.ZodDefault<z.ZodString>;
|
|
169
|
+
mandatory: z.ZodDefault<z.ZodBoolean>;
|
|
170
|
+
}, "strip", z.ZodTypeAny, {
|
|
171
|
+
channel: string;
|
|
172
|
+
mandatory: boolean;
|
|
173
|
+
}, {
|
|
174
|
+
channel?: string | undefined;
|
|
175
|
+
mandatory?: boolean | undefined;
|
|
176
|
+
}>>;
|
|
177
|
+
}, "strip", z.ZodTypeAny, {
|
|
178
|
+
scripts: {
|
|
179
|
+
script: string;
|
|
180
|
+
name?: string | undefined;
|
|
181
|
+
}[];
|
|
182
|
+
name?: string | undefined;
|
|
183
|
+
environment?: {
|
|
184
|
+
flutter?: string | undefined;
|
|
185
|
+
node?: string | undefined;
|
|
186
|
+
xcode?: string | undefined;
|
|
187
|
+
vars?: Record<string, string> | undefined;
|
|
188
|
+
} | undefined;
|
|
189
|
+
triggers?: {
|
|
190
|
+
push?: {
|
|
191
|
+
branch: string[];
|
|
192
|
+
} | undefined;
|
|
193
|
+
} | undefined;
|
|
194
|
+
artifacts?: string[] | undefined;
|
|
195
|
+
smokeTest?: boolean | undefined;
|
|
196
|
+
ota?: {
|
|
197
|
+
channel: string;
|
|
198
|
+
mandatory: boolean;
|
|
199
|
+
} | undefined;
|
|
200
|
+
}, {
|
|
201
|
+
scripts: {
|
|
202
|
+
script: string;
|
|
203
|
+
name?: string | undefined;
|
|
204
|
+
}[];
|
|
205
|
+
name?: string | undefined;
|
|
206
|
+
environment?: {
|
|
207
|
+
flutter?: string | undefined;
|
|
208
|
+
node?: string | undefined;
|
|
209
|
+
xcode?: string | undefined;
|
|
210
|
+
vars?: Record<string, string> | undefined;
|
|
211
|
+
} | undefined;
|
|
212
|
+
triggers?: {
|
|
213
|
+
push?: {
|
|
214
|
+
branch: string[];
|
|
215
|
+
} | undefined;
|
|
216
|
+
} | undefined;
|
|
217
|
+
artifacts?: string[] | undefined;
|
|
218
|
+
smokeTest?: boolean | undefined;
|
|
219
|
+
ota?: {
|
|
220
|
+
channel?: string | undefined;
|
|
221
|
+
mandatory?: boolean | undefined;
|
|
222
|
+
} | undefined;
|
|
223
|
+
}>>, Record<string, {
|
|
224
|
+
scripts: {
|
|
225
|
+
script: string;
|
|
226
|
+
name?: string | undefined;
|
|
227
|
+
}[];
|
|
228
|
+
name?: string | undefined;
|
|
229
|
+
environment?: {
|
|
230
|
+
flutter?: string | undefined;
|
|
231
|
+
node?: string | undefined;
|
|
232
|
+
xcode?: string | undefined;
|
|
233
|
+
vars?: Record<string, string> | undefined;
|
|
234
|
+
} | undefined;
|
|
235
|
+
triggers?: {
|
|
236
|
+
push?: {
|
|
237
|
+
branch: string[];
|
|
238
|
+
} | undefined;
|
|
239
|
+
} | undefined;
|
|
240
|
+
artifacts?: string[] | undefined;
|
|
241
|
+
smokeTest?: boolean | undefined;
|
|
242
|
+
ota?: {
|
|
243
|
+
channel: string;
|
|
244
|
+
mandatory: boolean;
|
|
245
|
+
} | undefined;
|
|
246
|
+
}>, Record<string, {
|
|
247
|
+
scripts: {
|
|
248
|
+
script: string;
|
|
249
|
+
name?: string | undefined;
|
|
250
|
+
}[];
|
|
251
|
+
name?: string | undefined;
|
|
252
|
+
environment?: {
|
|
253
|
+
flutter?: string | undefined;
|
|
254
|
+
node?: string | undefined;
|
|
255
|
+
xcode?: string | undefined;
|
|
256
|
+
vars?: Record<string, string> | undefined;
|
|
257
|
+
} | undefined;
|
|
258
|
+
triggers?: {
|
|
259
|
+
push?: {
|
|
260
|
+
branch: string[];
|
|
261
|
+
} | undefined;
|
|
262
|
+
} | undefined;
|
|
263
|
+
artifacts?: string[] | undefined;
|
|
264
|
+
smokeTest?: boolean | undefined;
|
|
265
|
+
ota?: {
|
|
266
|
+
channel?: string | undefined;
|
|
267
|
+
mandatory?: boolean | undefined;
|
|
268
|
+
} | undefined;
|
|
269
|
+
}>>;
|
|
270
|
+
}, "strip", z.ZodTypeAny, {
|
|
271
|
+
platform: "ios" | "android" | "flutter" | "react-native";
|
|
272
|
+
workflows: Record<string, {
|
|
273
|
+
scripts: {
|
|
274
|
+
script: string;
|
|
275
|
+
name?: string | undefined;
|
|
276
|
+
}[];
|
|
277
|
+
name?: string | undefined;
|
|
278
|
+
environment?: {
|
|
279
|
+
flutter?: string | undefined;
|
|
280
|
+
node?: string | undefined;
|
|
281
|
+
xcode?: string | undefined;
|
|
282
|
+
vars?: Record<string, string> | undefined;
|
|
283
|
+
} | undefined;
|
|
284
|
+
triggers?: {
|
|
285
|
+
push?: {
|
|
286
|
+
branch: string[];
|
|
287
|
+
} | undefined;
|
|
288
|
+
} | undefined;
|
|
289
|
+
artifacts?: string[] | undefined;
|
|
290
|
+
smokeTest?: boolean | undefined;
|
|
291
|
+
ota?: {
|
|
292
|
+
channel: string;
|
|
293
|
+
mandatory: boolean;
|
|
294
|
+
} | undefined;
|
|
295
|
+
}>;
|
|
296
|
+
}, {
|
|
297
|
+
platform: "ios" | "android" | "flutter" | "react-native";
|
|
298
|
+
workflows: Record<string, {
|
|
299
|
+
scripts: {
|
|
300
|
+
script: string;
|
|
301
|
+
name?: string | undefined;
|
|
302
|
+
}[];
|
|
303
|
+
name?: string | undefined;
|
|
304
|
+
environment?: {
|
|
305
|
+
flutter?: string | undefined;
|
|
306
|
+
node?: string | undefined;
|
|
307
|
+
xcode?: string | undefined;
|
|
308
|
+
vars?: Record<string, string> | undefined;
|
|
309
|
+
} | undefined;
|
|
310
|
+
triggers?: {
|
|
311
|
+
push?: {
|
|
312
|
+
branch: string[];
|
|
313
|
+
} | undefined;
|
|
314
|
+
} | undefined;
|
|
315
|
+
artifacts?: string[] | undefined;
|
|
316
|
+
smokeTest?: boolean | undefined;
|
|
317
|
+
ota?: {
|
|
318
|
+
channel?: string | undefined;
|
|
319
|
+
mandatory?: boolean | undefined;
|
|
320
|
+
} | undefined;
|
|
321
|
+
}>;
|
|
322
|
+
}>;
|
|
323
|
+
export declare const signupSchema: z.ZodObject<{
|
|
324
|
+
email: z.ZodString;
|
|
325
|
+
password: z.ZodString;
|
|
326
|
+
name: z.ZodOptional<z.ZodString>;
|
|
327
|
+
orgName: z.ZodString;
|
|
328
|
+
}, "strip", z.ZodTypeAny, {
|
|
329
|
+
email: string;
|
|
330
|
+
password: string;
|
|
331
|
+
orgName: string;
|
|
332
|
+
name?: string | undefined;
|
|
333
|
+
}, {
|
|
334
|
+
email: string;
|
|
335
|
+
password: string;
|
|
336
|
+
orgName: string;
|
|
337
|
+
name?: string | undefined;
|
|
338
|
+
}>;
|
|
339
|
+
export declare const loginSchema: z.ZodObject<{
|
|
340
|
+
email: z.ZodString;
|
|
341
|
+
password: z.ZodString;
|
|
342
|
+
/** Only required when the account has TOTP 2FA enabled — see
|
|
343
|
+
* routes/auth.ts's login handler. Mutually exclusive with
|
|
344
|
+
* `recoveryCode` in practice (the handler tries `recoveryCode` first
|
|
345
|
+
* when both are somehow present), never both required at once. */
|
|
346
|
+
totpCode: z.ZodOptional<z.ZodString>;
|
|
347
|
+
/** Alternate to `totpCode` for a lost authenticator — one of
|
|
348
|
+
* `TotpRecoveryCode`'s single-use codes (migrations/
|
|
349
|
+
* 0008_totp_recovery_codes.sql). */
|
|
350
|
+
recoveryCode: z.ZodOptional<z.ZodString>;
|
|
351
|
+
}, "strip", z.ZodTypeAny, {
|
|
352
|
+
email: string;
|
|
353
|
+
password: string;
|
|
354
|
+
totpCode?: string | undefined;
|
|
355
|
+
recoveryCode?: string | undefined;
|
|
356
|
+
}, {
|
|
357
|
+
email: string;
|
|
358
|
+
password: string;
|
|
359
|
+
totpCode?: string | undefined;
|
|
360
|
+
recoveryCode?: string | undefined;
|
|
361
|
+
}>;
|
|
362
|
+
export declare const verifyEmailSchema: z.ZodObject<{
|
|
363
|
+
token: z.ZodString;
|
|
364
|
+
}, "strip", z.ZodTypeAny, {
|
|
365
|
+
token: string;
|
|
366
|
+
}, {
|
|
367
|
+
token: string;
|
|
368
|
+
}>;
|
|
369
|
+
/** `POST /auth/2fa/confirm` requires re-proving the account password —
|
|
370
|
+
* the same "a stolen session token alone isn't enough to mutate this"
|
|
371
|
+
* reasoning as `disableTotpSchema` below, applied to the opposite
|
|
372
|
+
* (enable) side. Without this, a stolen/leaked session token (JWT or
|
|
373
|
+
* API token — either satisfies `requireUser`) alone was enough to
|
|
374
|
+
* enroll and confirm 2FA with an attacker-controlled secret: `confirm`
|
|
375
|
+
* is the call that actually flips `User.totpEnabledAt` and hands back
|
|
376
|
+
* the only copy of the recovery codes, and once it's flipped,
|
|
377
|
+
* `POST /auth/login` refuses the real account owner (who has neither
|
|
378
|
+
* the attacker's authenticator nor their recovery codes) — a
|
|
379
|
+
* self-inflicted, unrecoverable lockout worse than the already-guarded
|
|
380
|
+
* "stolen token disables 2FA" case, since this codebase has no
|
|
381
|
+
* account-recovery flow. See docs/security.md's "2FA (TOTP)" note. */
|
|
382
|
+
export declare const confirmTotpSchema: z.ZodObject<{
|
|
383
|
+
code: z.ZodString;
|
|
384
|
+
password: z.ZodString;
|
|
385
|
+
}, "strip", z.ZodTypeAny, {
|
|
386
|
+
code: string;
|
|
387
|
+
password: string;
|
|
388
|
+
}, {
|
|
389
|
+
code: string;
|
|
390
|
+
password: string;
|
|
391
|
+
}>;
|
|
392
|
+
/** `POST /auth/2fa/disable` requires re-proving the account password —
|
|
393
|
+
* without this, a stolen/leaked session token (JWT or API token) alone
|
|
394
|
+
* was enough to turn off 2FA, defeating the point of having it. See
|
|
395
|
+
* docs/security.md's "2FA (TOTP)" note. */
|
|
396
|
+
export declare const disableTotpSchema: z.ZodObject<{
|
|
397
|
+
password: z.ZodString;
|
|
398
|
+
}, "strip", z.ZodTypeAny, {
|
|
399
|
+
password: string;
|
|
400
|
+
}, {
|
|
401
|
+
password: string;
|
|
402
|
+
}>;
|
|
403
|
+
/** `POST /auth/2fa/recovery-codes/regenerate` requires re-proving the
|
|
404
|
+
* account password — the one mutating 2FA route in `two-factor.ts`
|
|
405
|
+
* that didn't get this treatment when `confirmTotpSchema`/
|
|
406
|
+
* `disableTotpSchema` above did. Without it, a stolen/leaked session
|
|
407
|
+
* token alone (JWT or API token — either satisfies `requireUser`, and
|
|
408
|
+
* an API token "never expires on its own") was enough to silently
|
|
409
|
+
* invalidate every one of the real owner's existing recovery codes and
|
|
410
|
+
* have the fresh set handed back to the attacker instead — two
|
|
411
|
+
* independent harms in one call: it silently destroys the owner's own
|
|
412
|
+
* recovery path (this codebase has no account-recovery flow, so a
|
|
413
|
+
* lost authenticator plus a now-invalid saved code is an unrecoverable
|
|
414
|
+
* lockout, with zero signal anywhere that this happened), and it hands
|
|
415
|
+
* the attacker 10 valid recovery codes that let them satisfy the 2FA
|
|
416
|
+
* challenge at `POST /auth/login` later, using nothing but the
|
|
417
|
+
* password itself — defeating the entire point of 2FA. See
|
|
418
|
+
* docs/security.md's "2FA (TOTP)" note. */
|
|
419
|
+
export declare const regenerateRecoveryCodesSchema: z.ZodObject<{
|
|
420
|
+
password: z.ZodString;
|
|
421
|
+
}, "strip", z.ZodTypeAny, {
|
|
422
|
+
password: string;
|
|
423
|
+
}, {
|
|
424
|
+
password: string;
|
|
425
|
+
}>;
|
|
426
|
+
/** `POST /auth/change-password` — same "re-prove the account password
|
|
427
|
+
* before mutating it" reasoning as `disableTotpSchema` above: a stolen
|
|
428
|
+
* session token alone must not be enough to rotate the one credential
|
|
429
|
+
* every other recovery path (2FA disable, this route itself) treats as
|
|
430
|
+
* the account's ultimate fallback. `newPassword` uses the same
|
|
431
|
+
* `min(10)` rule `signupSchema` enforces at signup. */
|
|
432
|
+
export declare const changePasswordSchema: z.ZodObject<{
|
|
433
|
+
currentPassword: z.ZodString;
|
|
434
|
+
newPassword: z.ZodString;
|
|
435
|
+
}, "strip", z.ZodTypeAny, {
|
|
436
|
+
currentPassword: string;
|
|
437
|
+
newPassword: string;
|
|
438
|
+
}, {
|
|
439
|
+
currentPassword: string;
|
|
440
|
+
newPassword: string;
|
|
441
|
+
}>;
|
|
442
|
+
/** `POST /auth/forgot-password` — deliberately just an email, no
|
|
443
|
+
* password: this is the unauthenticated "I forgot it" entry point
|
|
444
|
+
* (issue-and-email-a-token side of the pair below), same shape as
|
|
445
|
+
* `verifyEmailSchema`'s issuing sibling `resend-verification` (which
|
|
446
|
+
* takes no body at all, since it's already `requireUser`-gated; this
|
|
447
|
+
* route isn't, so it needs the email to know who to email). */
|
|
448
|
+
export declare const forgotPasswordSchema: z.ZodObject<{
|
|
449
|
+
email: z.ZodString;
|
|
450
|
+
}, "strip", z.ZodTypeAny, {
|
|
451
|
+
email: string;
|
|
452
|
+
}, {
|
|
453
|
+
email: string;
|
|
454
|
+
}>;
|
|
455
|
+
/** `POST /auth/reset-password` — redeems the token minted by
|
|
456
|
+
* `forgot-password` above. `newPassword` uses the same `min(10)` rule
|
|
457
|
+
* `changePasswordSchema`/`signupSchema` enforce everywhere else a
|
|
458
|
+
* password is ever set. */
|
|
459
|
+
export declare const resetPasswordSchema: z.ZodObject<{
|
|
460
|
+
token: z.ZodString;
|
|
461
|
+
newPassword: z.ZodString;
|
|
462
|
+
}, "strip", z.ZodTypeAny, {
|
|
463
|
+
token: string;
|
|
464
|
+
newPassword: string;
|
|
465
|
+
}, {
|
|
466
|
+
token: string;
|
|
467
|
+
newPassword: string;
|
|
468
|
+
}>;
|
|
469
|
+
export declare const createAppSchema: z.ZodObject<{
|
|
470
|
+
name: z.ZodString;
|
|
471
|
+
platform: z.ZodEnum<["ios", "android", "flutter", "react-native"]>;
|
|
472
|
+
repoUrl: z.ZodEffects<z.ZodString, string, string>;
|
|
473
|
+
defaultBranch: z.ZodDefault<z.ZodString>;
|
|
474
|
+
}, "strip", z.ZodTypeAny, {
|
|
475
|
+
name: string;
|
|
476
|
+
platform: "ios" | "android" | "flutter" | "react-native";
|
|
477
|
+
repoUrl: string;
|
|
478
|
+
defaultBranch: string;
|
|
479
|
+
}, {
|
|
480
|
+
name: string;
|
|
481
|
+
platform: "ios" | "android" | "flutter" | "react-native";
|
|
482
|
+
repoUrl: string;
|
|
483
|
+
defaultBranch?: string | undefined;
|
|
484
|
+
}>;
|
|
485
|
+
export declare const updateAppSchema: z.ZodObject<{
|
|
486
|
+
name: z.ZodOptional<z.ZodString>;
|
|
487
|
+
repoUrl: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
488
|
+
defaultBranch: z.ZodOptional<z.ZodString>;
|
|
489
|
+
}, "strip", z.ZodTypeAny, {
|
|
490
|
+
name?: string | undefined;
|
|
491
|
+
repoUrl?: string | undefined;
|
|
492
|
+
defaultBranch?: string | undefined;
|
|
493
|
+
}, {
|
|
494
|
+
name?: string | undefined;
|
|
495
|
+
repoUrl?: string | undefined;
|
|
496
|
+
defaultBranch?: string | undefined;
|
|
497
|
+
}>;
|
|
498
|
+
export declare const updateOrgSchema: z.ZodObject<{
|
|
499
|
+
name: z.ZodOptional<z.ZodString>;
|
|
500
|
+
buildWebhookUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
501
|
+
}, "strip", z.ZodTypeAny, {
|
|
502
|
+
name?: string | undefined;
|
|
503
|
+
buildWebhookUrl?: string | null | undefined;
|
|
504
|
+
}, {
|
|
505
|
+
name?: string | undefined;
|
|
506
|
+
buildWebhookUrl?: string | null | undefined;
|
|
507
|
+
}>;
|
|
508
|
+
export declare const setAppSecretSchema: z.ZodObject<{
|
|
509
|
+
name: z.ZodString;
|
|
510
|
+
value: z.ZodEffects<z.ZodString, string, string>;
|
|
511
|
+
}, "strip", z.ZodTypeAny, {
|
|
512
|
+
name: string;
|
|
513
|
+
value: string;
|
|
514
|
+
}, {
|
|
515
|
+
name: string;
|
|
516
|
+
value: string;
|
|
517
|
+
}>;
|
|
518
|
+
export declare const FLEET_SECRET_NAMES: readonly ["JWT_SECRET", "JWT_SECRET_PREVIOUS", "INTERNAL_SERVICE_TOKEN"];
|
|
519
|
+
export type FleetSecretName = (typeof FLEET_SECRET_NAMES)[number];
|
|
520
|
+
export declare const setFleetSecretSchema: z.ZodObject<{
|
|
521
|
+
name: z.ZodEnum<["JWT_SECRET", "JWT_SECRET_PREVIOUS", "INTERNAL_SERVICE_TOKEN"]>;
|
|
522
|
+
value: z.ZodEffects<z.ZodString, string, string>;
|
|
523
|
+
}, "strip", z.ZodTypeAny, {
|
|
524
|
+
name: "JWT_SECRET" | "JWT_SECRET_PREVIOUS" | "INTERNAL_SERVICE_TOKEN";
|
|
525
|
+
value: string;
|
|
526
|
+
}, {
|
|
527
|
+
name: "JWT_SECRET" | "JWT_SECRET_PREVIOUS" | "INTERNAL_SERVICE_TOKEN";
|
|
528
|
+
value: string;
|
|
529
|
+
}>;
|
|
530
|
+
export declare const triggerBuildSchema: z.ZodObject<{
|
|
531
|
+
appId: z.ZodString;
|
|
532
|
+
workflow: z.ZodEffects<z.ZodString, string, string>;
|
|
533
|
+
branch: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
534
|
+
}, "strip", z.ZodTypeAny, {
|
|
535
|
+
appId: string;
|
|
536
|
+
workflow: string;
|
|
537
|
+
branch?: string | undefined;
|
|
538
|
+
}, {
|
|
539
|
+
appId: string;
|
|
540
|
+
workflow: string;
|
|
541
|
+
branch?: string | undefined;
|
|
542
|
+
}>;
|
|
543
|
+
export declare const topUpSchema: z.ZodObject<{
|
|
544
|
+
packId: z.ZodString;
|
|
545
|
+
}, "strip", z.ZodTypeAny, {
|
|
546
|
+
packId: string;
|
|
547
|
+
}, {
|
|
548
|
+
packId: string;
|
|
549
|
+
}>;
|
|
550
|
+
export declare const setBillingModeSchema: z.ZodObject<{
|
|
551
|
+
mode: z.ZodEnum<["prepaid", "postpaid_monthly"]>;
|
|
552
|
+
}, "strip", z.ZodTypeAny, {
|
|
553
|
+
mode: "prepaid" | "postpaid_monthly";
|
|
554
|
+
}, {
|
|
555
|
+
mode: "prepaid" | "postpaid_monthly";
|
|
556
|
+
}>;
|
|
557
|
+
export declare const agentEnrollSchema: z.ZodObject<{
|
|
558
|
+
enrollmentToken: z.ZodString;
|
|
559
|
+
name: z.ZodString;
|
|
560
|
+
machineId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
561
|
+
hostname: z.ZodString;
|
|
562
|
+
macOsVersion: z.ZodString;
|
|
563
|
+
xcodeVersion: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
564
|
+
flutterVersion: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
565
|
+
javaVersion: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
566
|
+
androidSdkVersion: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
567
|
+
cocoapodsVersion: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
568
|
+
cpuModel: z.ZodString;
|
|
569
|
+
agentVersion: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
570
|
+
screenSharingEnabled: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
571
|
+
}, "strip", z.ZodTypeAny, {
|
|
572
|
+
name: string;
|
|
573
|
+
hostname: string;
|
|
574
|
+
macOsVersion: string;
|
|
575
|
+
cpuModel: string;
|
|
576
|
+
enrollmentToken: string;
|
|
577
|
+
machineId?: string | null | undefined;
|
|
578
|
+
xcodeVersion?: string | null | undefined;
|
|
579
|
+
flutterVersion?: string | null | undefined;
|
|
580
|
+
javaVersion?: string | null | undefined;
|
|
581
|
+
androidSdkVersion?: string | null | undefined;
|
|
582
|
+
cocoapodsVersion?: string | null | undefined;
|
|
583
|
+
agentVersion?: string | null | undefined;
|
|
584
|
+
screenSharingEnabled?: boolean | null | undefined;
|
|
585
|
+
}, {
|
|
586
|
+
name: string;
|
|
587
|
+
hostname: string;
|
|
588
|
+
macOsVersion: string;
|
|
589
|
+
cpuModel: string;
|
|
590
|
+
enrollmentToken: string;
|
|
591
|
+
machineId?: string | null | undefined;
|
|
592
|
+
xcodeVersion?: string | null | undefined;
|
|
593
|
+
flutterVersion?: string | null | undefined;
|
|
594
|
+
javaVersion?: string | null | undefined;
|
|
595
|
+
androidSdkVersion?: string | null | undefined;
|
|
596
|
+
cocoapodsVersion?: string | null | undefined;
|
|
597
|
+
agentVersion?: string | null | undefined;
|
|
598
|
+
screenSharingEnabled?: boolean | null | undefined;
|
|
599
|
+
}>;
|
|
600
|
+
export declare const agentHeartbeatSchema: z.ZodObject<{
|
|
601
|
+
status: z.ZodEnum<["online", "draining", "building"]>;
|
|
602
|
+
cpuUsagePercent: z.ZodNumber;
|
|
603
|
+
memUsagePercent: z.ZodNumber;
|
|
604
|
+
diskFreeGb: z.ZodNumber;
|
|
605
|
+
currentBuildId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
606
|
+
tailscaleHostname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
607
|
+
xcodeVersion: z.ZodNullable<z.ZodString>;
|
|
608
|
+
flutterVersion: z.ZodNullable<z.ZodString>;
|
|
609
|
+
javaVersion: z.ZodNullable<z.ZodString>;
|
|
610
|
+
androidSdkVersion: z.ZodNullable<z.ZodString>;
|
|
611
|
+
cocoapodsVersion: z.ZodNullable<z.ZodString>;
|
|
612
|
+
agentVersion: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
613
|
+
screenSharingEnabled: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
614
|
+
/** How many builds this Mac will run at once. */
|
|
615
|
+
capacity: z.ZodOptional<z.ZodNumber>;
|
|
616
|
+
/** Build ids this agent is running right now — its length is always
|
|
617
|
+
* <= capacity. Empty array means idle, distinct from omitting the
|
|
618
|
+
* field entirely (an old agent binary that's never heard of this). */
|
|
619
|
+
activeBuildIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
620
|
+
}, "strip", z.ZodTypeAny, {
|
|
621
|
+
status: "online" | "draining" | "building";
|
|
622
|
+
xcodeVersion: string | null;
|
|
623
|
+
flutterVersion: string | null;
|
|
624
|
+
javaVersion: string | null;
|
|
625
|
+
androidSdkVersion: string | null;
|
|
626
|
+
cocoapodsVersion: string | null;
|
|
627
|
+
cpuUsagePercent: number;
|
|
628
|
+
memUsagePercent: number;
|
|
629
|
+
diskFreeGb: number;
|
|
630
|
+
agentVersion?: string | null | undefined;
|
|
631
|
+
screenSharingEnabled?: boolean | null | undefined;
|
|
632
|
+
tailscaleHostname?: string | null | undefined;
|
|
633
|
+
currentBuildId?: string | null | undefined;
|
|
634
|
+
activeBuildIds?: string[] | undefined;
|
|
635
|
+
capacity?: number | undefined;
|
|
636
|
+
}, {
|
|
637
|
+
status: "online" | "draining" | "building";
|
|
638
|
+
xcodeVersion: string | null;
|
|
639
|
+
flutterVersion: string | null;
|
|
640
|
+
javaVersion: string | null;
|
|
641
|
+
androidSdkVersion: string | null;
|
|
642
|
+
cocoapodsVersion: string | null;
|
|
643
|
+
cpuUsagePercent: number;
|
|
644
|
+
memUsagePercent: number;
|
|
645
|
+
diskFreeGb: number;
|
|
646
|
+
agentVersion?: string | null | undefined;
|
|
647
|
+
screenSharingEnabled?: boolean | null | undefined;
|
|
648
|
+
tailscaleHostname?: string | null | undefined;
|
|
649
|
+
currentBuildId?: string | null | undefined;
|
|
650
|
+
activeBuildIds?: string[] | undefined;
|
|
651
|
+
capacity?: number | undefined;
|
|
652
|
+
}>;
|
|
653
|
+
export declare const appendLogSchema: z.ZodObject<{
|
|
654
|
+
chunk: z.ZodString;
|
|
655
|
+
seq: z.ZodNumber;
|
|
656
|
+
}, "strip", z.ZodTypeAny, {
|
|
657
|
+
chunk: string;
|
|
658
|
+
seq: number;
|
|
659
|
+
}, {
|
|
660
|
+
chunk: string;
|
|
661
|
+
seq: number;
|
|
662
|
+
}>;
|
|
663
|
+
export declare const completeBuildSchema: z.ZodObject<{
|
|
664
|
+
status: z.ZodEnum<["succeeded", "failed"]>;
|
|
665
|
+
artifacts: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
666
|
+
fileName: z.ZodString;
|
|
667
|
+
sizeBytes: z.ZodNumber;
|
|
668
|
+
storageKey: z.ZodString;
|
|
669
|
+
}, "strip", z.ZodTypeAny, {
|
|
670
|
+
fileName: string;
|
|
671
|
+
sizeBytes: number;
|
|
672
|
+
storageKey: string;
|
|
673
|
+
}, {
|
|
674
|
+
fileName: string;
|
|
675
|
+
sizeBytes: number;
|
|
676
|
+
storageKey: string;
|
|
677
|
+
}>, "many">>;
|
|
678
|
+
ota: z.ZodOptional<z.ZodObject<{
|
|
679
|
+
channel: z.ZodOptional<z.ZodString>;
|
|
680
|
+
mandatory: z.ZodOptional<z.ZodBoolean>;
|
|
681
|
+
bundleHash: z.ZodOptional<z.ZodString>;
|
|
682
|
+
}, "strip", z.ZodTypeAny, {
|
|
683
|
+
channel?: string | undefined;
|
|
684
|
+
mandatory?: boolean | undefined;
|
|
685
|
+
bundleHash?: string | undefined;
|
|
686
|
+
}, {
|
|
687
|
+
channel?: string | undefined;
|
|
688
|
+
mandatory?: boolean | undefined;
|
|
689
|
+
bundleHash?: string | undefined;
|
|
690
|
+
}>>;
|
|
691
|
+
failureKind: z.ZodOptional<z.ZodEnum<["user", "infra"]>>;
|
|
692
|
+
}, "strip", z.ZodTypeAny, {
|
|
693
|
+
status: "succeeded" | "failed";
|
|
694
|
+
artifacts: {
|
|
695
|
+
fileName: string;
|
|
696
|
+
sizeBytes: number;
|
|
697
|
+
storageKey: string;
|
|
698
|
+
}[];
|
|
699
|
+
ota?: {
|
|
700
|
+
channel?: string | undefined;
|
|
701
|
+
mandatory?: boolean | undefined;
|
|
702
|
+
bundleHash?: string | undefined;
|
|
703
|
+
} | undefined;
|
|
704
|
+
failureKind?: "user" | "infra" | undefined;
|
|
705
|
+
}, {
|
|
706
|
+
status: "succeeded" | "failed";
|
|
707
|
+
artifacts?: {
|
|
708
|
+
fileName: string;
|
|
709
|
+
sizeBytes: number;
|
|
710
|
+
storageKey: string;
|
|
711
|
+
}[] | undefined;
|
|
712
|
+
ota?: {
|
|
713
|
+
channel?: string | undefined;
|
|
714
|
+
mandatory?: boolean | undefined;
|
|
715
|
+
bundleHash?: string | undefined;
|
|
716
|
+
} | undefined;
|
|
717
|
+
failureKind?: "user" | "infra" | undefined;
|
|
718
|
+
}>;
|
|
719
|
+
export declare const promoteOtaReleaseSchema: z.ZodObject<{
|
|
720
|
+
buildId: z.ZodString;
|
|
721
|
+
channel: z.ZodDefault<z.ZodString>;
|
|
722
|
+
mandatory: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
723
|
+
rollout: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
724
|
+
}, "strip", z.ZodTypeAny, {
|
|
725
|
+
channel: string;
|
|
726
|
+
mandatory: boolean;
|
|
727
|
+
buildId: string;
|
|
728
|
+
rollout: number;
|
|
729
|
+
}, {
|
|
730
|
+
buildId: string;
|
|
731
|
+
channel?: string | undefined;
|
|
732
|
+
mandatory?: boolean | undefined;
|
|
733
|
+
rollout?: number | undefined;
|
|
734
|
+
}>;
|
|
735
|
+
export declare const setActiveOtaReleaseSchema: z.ZodObject<{
|
|
736
|
+
releaseId: z.ZodNullable<z.ZodString>;
|
|
737
|
+
}, "strip", z.ZodTypeAny, {
|
|
738
|
+
releaseId: string | null;
|
|
739
|
+
}, {
|
|
740
|
+
releaseId: string | null;
|
|
741
|
+
}>;
|
|
742
|
+
export declare const updateOtaReleaseRolloutSchema: z.ZodObject<{
|
|
743
|
+
rollout: z.ZodNumber;
|
|
744
|
+
}, "strip", z.ZodTypeAny, {
|
|
745
|
+
rollout: number;
|
|
746
|
+
}, {
|
|
747
|
+
rollout: number;
|
|
748
|
+
}>;
|
|
749
|
+
/** `PATCH /orgs/:orgId/agents/:agentId/remote-control` (apps/admin-api) —
|
|
750
|
+
* the only way `Agent.remoteControlEnabled` ever changes (see
|
|
751
|
+
* @appforge/db's migrations/0024_agent_remote_control.sql). Deliberately
|
|
752
|
+
* not threaded through agentEnrollSchema/agentHeartbeatSchema above:
|
|
753
|
+
* this is an operator policy decision, not something the agent
|
|
754
|
+
* self-reports. */
|
|
755
|
+
export declare const setAgentRemoteControlSchema: z.ZodObject<{
|
|
756
|
+
enabled: z.ZodBoolean;
|
|
757
|
+
}, "strip", z.ZodTypeAny, {
|
|
758
|
+
enabled: boolean;
|
|
759
|
+
}, {
|
|
760
|
+
enabled: boolean;
|
|
761
|
+
}>;
|
|
762
|
+
/** `POST /orgs/:orgId/agents/:agentId/vnc-session` (apps/admin-api)'s
|
|
763
|
+
* request body — optional and defaults to "view" (via `.optional()`,
|
|
764
|
+
* left for the route to interpret as the no-body case), matching every
|
|
765
|
+
* existing caller that sends no body at all today. `mode: "control"` is
|
|
766
|
+
* a *request*, not a grant: the route decides the actually-issued mode
|
|
767
|
+
* server-side from `Agent.remoteControlEnabled` and echoes it back in
|
|
768
|
+
* the response — see that route's own docblock. */
|
|
769
|
+
export declare const startVncSessionSchema: z.ZodObject<{
|
|
770
|
+
mode: z.ZodOptional<z.ZodEnum<["view", "control"]>>;
|
|
771
|
+
}, "strip", z.ZodTypeAny, {
|
|
772
|
+
mode?: "view" | "control" | undefined;
|
|
773
|
+
}, {
|
|
774
|
+
mode?: "view" | "control" | undefined;
|
|
775
|
+
}>;
|
|
776
|
+
//# sourceMappingURL=schemas.d.ts.map
|