@alivelabs/expo-orchestrator-schemas 0.1.0 → 0.2.0
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/package.json +1 -1
- package/src/session.ts +13 -0
- package/src/simulator.ts +14 -0
package/package.json
CHANGED
package/src/session.ts
CHANGED
|
@@ -106,12 +106,25 @@ const AppRootSchema = z
|
|
|
106
106
|
"appRoot must be a relative path within the source (no leading '/', no '..')",
|
|
107
107
|
);
|
|
108
108
|
|
|
109
|
+
/**
|
|
110
|
+
* Extra environment variables exposed to the build (e.g. `EXPO_PUBLIC_*` that
|
|
111
|
+
* the app embeds at build time). Names must be valid shell identifiers. These
|
|
112
|
+
* are applied *before* the orchestrator's curated env, so they can never
|
|
113
|
+
* override controlled vars (PATH, HOME, BUILD_DIR, secrets, …). Not secret —
|
|
114
|
+
* use `secrets` for tokens/certs.
|
|
115
|
+
*/
|
|
116
|
+
export const BuildEnvSchema = z
|
|
117
|
+
.record(z.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/), z.string().max(8192))
|
|
118
|
+
.refine((env) => Object.keys(env).length <= 100, "at most 100 environment variables");
|
|
119
|
+
export type BuildEnv = z.infer<typeof BuildEnvSchema>;
|
|
120
|
+
|
|
109
121
|
export const CreateSessionBodySchema = z.strictObject({
|
|
110
122
|
source: SessionSourceSchema,
|
|
111
123
|
platform: PlatformSchema,
|
|
112
124
|
simulatorName: z.string().min(1).max(255).optional(),
|
|
113
125
|
devServerUrl: DevServerUrlSchema.optional(),
|
|
114
126
|
appRoot: AppRootSchema.optional(),
|
|
127
|
+
env: BuildEnvSchema.optional(),
|
|
115
128
|
timeout: z.number().int().min(60).max(3600).default(1800),
|
|
116
129
|
secrets: SessionSecretsSchema.optional(),
|
|
117
130
|
});
|
package/src/simulator.ts
CHANGED
|
@@ -178,3 +178,17 @@ export const ListSimulatorsResponseSchema = z.object({
|
|
|
178
178
|
recommended: z.string().nullable(),
|
|
179
179
|
});
|
|
180
180
|
export type ListSimulatorsResponse = z.infer<typeof ListSimulatorsResponseSchema>;
|
|
181
|
+
|
|
182
|
+
/** Tap the on-screen element whose accessibility identifier (React Native `testID`) matches. */
|
|
183
|
+
export const TapByTestIdBodySchema = z.strictObject({
|
|
184
|
+
testId: z.string().min(1).max(255),
|
|
185
|
+
});
|
|
186
|
+
export type TapByTestIdBody = z.infer<typeof TapByTestIdBodySchema>;
|
|
187
|
+
|
|
188
|
+
export const TapByTestIdResponseSchema = z.object({
|
|
189
|
+
sessionId: z.string(),
|
|
190
|
+
testId: z.string(),
|
|
191
|
+
/** Center of the matched element, in device points. */
|
|
192
|
+
tappedAt: z.object({ x: z.number(), y: z.number() }),
|
|
193
|
+
});
|
|
194
|
+
export type TapByTestIdResponse = z.infer<typeof TapByTestIdResponseSchema>;
|