1// Generated by @effect/graphql-generator from ExpoApi.graphql. Do not edit.
2import { GraphQL, GraphQLGroup } from "effect/graphql"
3import * as Schema from "effect/Schema"
4import * as Shared from "../../schema/expo.graphql.ts"
5
6/** Represents an Exponent App (or Experience in legacy terms) */
7export const NodeApp = Schema.Struct({
8 id: Shared.ID,
9 fullName: Schema.String
10})
11export interface NodeApp extends Schema.Struct.Type<typeof NodeApp.fields> {}
12
13export const AccountAppsEdge = Schema.Struct({
14 node: NodeApp
15})
16export interface AccountAppsEdge extends Schema.Struct.Type<typeof AccountAppsEdge.fields> {}
17
18export const AccountAppsConnection = Schema.Struct({
19 edges: Schema.Array(AccountAppsEdge)
20})
21export interface AccountAppsConnection extends Schema.Struct.Type<typeof AccountAppsConnection.fields> {}
22
23/**
24 * An account is a container owning projects, credentials, billing and other organization
25 * data and settings. Actors may own and be members of accounts.
26 */
27export const AccountsAccount = Schema.Struct({
28 name: Schema.String,
29 /** Paginated list of apps associated with this account. By default sorted by name. Use filter to adjust the sorting order. */
30 appsPaginated: AccountAppsConnection
31})
32export interface AccountsAccount extends Schema.Struct.Type<typeof AccountsAccount.fields> {}
33
34/** Represents a human SSO (not robot) actor. */
35export const SSOUser = Schema.Struct({
36 __typename: Schema.Literal("SSOUser"),
37 username: Schema.String,
38 accounts: Schema.Array(AccountsAccount)
39})
40export interface SSOUser extends Schema.Struct.Type<typeof SSOUser.fields> {}
41
42/** Represents a human (not robot) actor. */
43export const User = Schema.Struct({
44 __typename: Schema.Literal("User"),
45 username: Schema.String,
46 accounts: Schema.Array(AccountsAccount)
47})
48export interface User extends Schema.Struct.Type<typeof User.fields> {}
49
50/** Represents a robot (not human) actor. */
51export const Robot = Schema.Struct({
52 __typename: Schema.Literal("Robot"),
53 firstName: Schema.NullOr(Schema.String),
54 /** Associated accounts */
55 accounts: Schema.Array(AccountsAccount)
56})
57export interface Robot extends Schema.Struct.Type<typeof Robot.fields> {}
58
59/** A regular user, SSO user, or robot that can authenticate with Expo services and be a member of accounts. */
60export const ActorOther = Schema.Struct({
61 __typename: GraphQL.otherTypename<Shared.Typename.Actor>()(["SSOUser", "User", "Robot"]),
62 /** Associated accounts */
63 accounts: Schema.Array(AccountsAccount)
64})
65export interface ActorOther extends Schema.Struct.Type<typeof ActorOther.fields> {}
66
67/** `query T3ExpoViewer` */
68export const T3ExpoViewer = GraphQL.query("T3ExpoViewer", {
69 document: {
70 variables: [],
71 selections: [
72 { name: "meActor", body: ["{__typename...on UserActor{username}...on Robot{firstName}accounts{name appsPaginated(first:100){edges{node{id fullName}}}}}"] }
73 ],
74 fragments: []
75 },
76 result: Schema.Struct({
77 /**
78 * If authenticated as any type of Actor, this is the appropriate top-level
79 * query object
80 */
81 meActor: Schema.NullOr(Schema.Union([
82 SSOUser,
83 User,
84 Robot,
85 ActorOther
86 ]))
87 })
88})
89export declare namespace T3ExpoViewer {
90 export type Variables = typeof T3ExpoViewer.variables.Type
91 export type Result = typeof T3ExpoViewer.result.Type
92}
93
94/**
95 * An account is a container owning projects, credentials, billing and other organization
96 * data and settings. Actors may own and be members of accounts.
97 */
98export const OwnerAccountAccount = Schema.Struct({
99 name: Schema.String,
100 /** Server account feature gate values for this account, optionally filtering by desired gates. */
101 accountFeatureGates: Shared.JSONObject
102})
103export interface OwnerAccountAccount extends Schema.Struct.Type<typeof OwnerAccountAccount.fields> {}
104
105/** Represents an Exponent App (or Experience in legacy terms) */
106export const T3EasSimulatorAvailabilityAppByIdApp = Schema.Struct({
107 ownerAccount: OwnerAccountAccount
108})
109export interface T3EasSimulatorAvailabilityAppByIdApp extends Schema.Struct.Type<typeof T3EasSimulatorAvailabilityAppByIdApp.fields> {}
110
111export const T3EasSimulatorAvailabilityAppAppQuery = Schema.Struct({
112 /** Look up app by app id */
113 byId: T3EasSimulatorAvailabilityAppByIdApp
114})
115export interface T3EasSimulatorAvailabilityAppAppQuery extends Schema.Struct.Type<typeof T3EasSimulatorAvailabilityAppAppQuery.fields> {}
116
117/** `query T3EasSimulatorAvailability` */
118export const T3EasSimulatorAvailability = GraphQL.query("T3EasSimulatorAvailability", {
119 document: {
120 variables: [
121 { name: "appId", body: "String!" },
122 { name: "filter", body: "[String!]" }
123 ],
124 selections: [
125 { name: "app", body: ["{byId(appId:$", "appId", "){ownerAccount{name accountFeatureGates(filter:$", "filter", ")}}}"] }
126 ],
127 fragments: []
128 },
129 variables: {
130 appId: Schema.String,
131 filter: Schema.optional(Schema.NullOr(Schema.Array(Schema.String)))
132 },
133 result: Schema.Struct({
134 app: T3EasSimulatorAvailabilityAppAppQuery
135 })
136})
137export declare namespace T3EasSimulatorAvailability {
138 export type Variables = typeof T3EasSimulatorAvailability.variables.Type
139 export type Result = typeof T3EasSimulatorAvailability.result.Type
140}
141
142export const CreateDeviceRunSessionDeviceRunSession = Schema.Struct({
143 id: Shared.ID
144})
145export interface CreateDeviceRunSessionDeviceRunSession extends Schema.Struct.Type<typeof CreateDeviceRunSessionDeviceRunSession.fields> {}
146
147export const T3CreateEasSimulatorSessionDeviceRunSessionDeviceRunSessionMutation = Schema.Struct({
148 /** Create a device run session */
149 createDeviceRunSession: CreateDeviceRunSessionDeviceRunSession
150})
151export interface T3CreateEasSimulatorSessionDeviceRunSessionDeviceRunSessionMutation extends Schema.Struct.Type<typeof T3CreateEasSimulatorSessionDeviceRunSessionDeviceRunSessionMutation.fields> {}
152
153/** `mutation T3CreateEasSimulatorSession` */
154export const T3CreateEasSimulatorSession = GraphQL.mutation("T3CreateEasSimulatorSession", {
155 document: {
156 variables: [
157 { name: "input", body: "CreateDeviceRunSessionInput!" }
158 ],
159 selections: [
160 { name: "deviceRunSession", body: ["{createDeviceRunSession(deviceRunSessionInput:$", "input", "){id}}"] }
161 ],
162 fragments: []
163 },
164 variables: {
165 input: Shared.CreateDeviceRunSessionInput
166 },
167 result: Schema.Struct({
168 /** Mutations that create, stop, update, and delete device run sessions */
169 deviceRunSession: T3CreateEasSimulatorSessionDeviceRunSessionDeviceRunSessionMutation
170 })
171})
172export declare namespace T3CreateEasSimulatorSession {
173 export type Variables = typeof T3CreateEasSimulatorSession.variables.Type
174 export type Result = typeof T3CreateEasSimulatorSession.result.Type
175}
176
177export const AgentDeviceRunSessionRemoteConfig = Schema.Struct({
178 __typename: Schema.Literal("AgentDeviceRunSessionRemoteConfig"),
179 agentDeviceRemoteSessionUrl: Schema.String,
180 agentDeviceRemoteSessionToken: Schema.String,
181 /** Session token gating the web preview. Null when the preview runs ungated. */
182 webPreviewToken: Schema.NullOr(Schema.String),
183 /** URL of the preview server, for reaching its API rather than its page. */
184 previewApiUrl: Schema.NullOr(Schema.String)
185})
186export interface AgentDeviceRunSessionRemoteConfig extends Schema.Struct.Type<typeof AgentDeviceRunSessionRemoteConfig.fields> {}
187
188export const DeviceRunSessionRemoteConfigOther = Schema.Struct({
189 __typename: GraphQL.otherTypename<Shared.Typename.DeviceRunSessionRemoteConfig>()(["AgentDeviceRunSessionRemoteConfig"])
190})
191export interface DeviceRunSessionRemoteConfigOther extends Schema.Struct.Type<typeof DeviceRunSessionRemoteConfigOther.fields> {}
192
193export const ByIdDeviceRunSession = Schema.Struct({
194 id: Shared.ID,
195 status: GraphQL.enumLiterals(Shared.DeviceRunSessionStatus.literals),
196 remoteConfig: Schema.NullOr(Schema.Union([
197 AgentDeviceRunSessionRemoteConfig,
198 DeviceRunSessionRemoteConfigOther
199 ]))
200})
201export interface ByIdDeviceRunSession extends Schema.Struct.Type<typeof ByIdDeviceRunSession.fields> {}
202
203export const DeviceRunSessionQuery = Schema.Struct({
204 byId: ByIdDeviceRunSession
205})
206export interface DeviceRunSessionQuery extends Schema.Struct.Type<typeof DeviceRunSessionQuery.fields> {}
207
208/** `query T3EasSimulatorSession` */
209export const T3EasSimulatorSession = GraphQL.query("T3EasSimulatorSession", {
210 document: {
211 variables: [
212 { name: "id", body: "ID!" }
213 ],
214 selections: [
215 { name: "deviceRunSessions", body: ["{byId(deviceRunSessionId:$", "id", "){id status remoteConfig{__typename...on AgentDeviceRunSessionRemoteConfig{agentDeviceRemoteSessionUrl agentDeviceRemoteSessionToken webPreviewToken previewApiUrl}}}}"] }
216 ],
217 fragments: []
218 },
219 variables: {
220 id: Shared.ID
221 },
222 result: Schema.Struct({
223 deviceRunSessions: DeviceRunSessionQuery
224 })
225})
226export declare namespace T3EasSimulatorSession {
227 export type Variables = typeof T3EasSimulatorSession.variables.Type
228 export type Result = typeof T3EasSimulatorSession.result.Type
229}
230
231export const NodeDeviceRunSession = Schema.Struct({
232 id: Shared.ID,
233 status: GraphQL.enumLiterals(Shared.DeviceRunSessionStatus.literals),
234 /**
235 * Human-readable label set when the session is created or changed later with
236 * updateDeviceRunSession. Null when the session has no name.
237 */
238 name: Schema.NullOr(Schema.String)
239})
240export interface NodeDeviceRunSession extends Schema.Struct.Type<typeof NodeDeviceRunSession.fields> {}
241
242export const AppDeviceRunSessionEdge = Schema.Struct({
243 node: NodeDeviceRunSession
244})
245export interface AppDeviceRunSessionEdge extends Schema.Struct.Type<typeof AppDeviceRunSessionEdge.fields> {}
246
247export const AppDeviceRunSessionsConnection = Schema.Struct({
248 edges: Schema.Array(AppDeviceRunSessionEdge)
249})
250export interface AppDeviceRunSessionsConnection extends Schema.Struct.Type<typeof AppDeviceRunSessionsConnection.fields> {}
251
252/** Represents an Exponent App (or Experience in legacy terms) */
253export const T3ActiveEasSimulatorSessionsAppByIdApp = Schema.Struct({
254 deviceRunSessionsPaginated: AppDeviceRunSessionsConnection
255})
256export interface T3ActiveEasSimulatorSessionsAppByIdApp extends Schema.Struct.Type<typeof T3ActiveEasSimulatorSessionsAppByIdApp.fields> {}
257
258export const T3ActiveEasSimulatorSessionsAppAppQuery = Schema.Struct({
259 /** Look up app by app id */
260 byId: T3ActiveEasSimulatorSessionsAppByIdApp
261})
262export interface T3ActiveEasSimulatorSessionsAppAppQuery extends Schema.Struct.Type<typeof T3ActiveEasSimulatorSessionsAppAppQuery.fields> {}
263
264/** `query T3ActiveEasSimulatorSessions` */
265export const T3ActiveEasSimulatorSessions = GraphQL.query("T3ActiveEasSimulatorSessions", {
266 document: {
267 variables: [
268 { name: "appId", body: "String!" },
269 { name: "filter", body: "DeviceRunSessionFilterInput" }
270 ],
271 selections: [
272 { name: "app", body: ["{byId(appId:$", "appId", "){deviceRunSessionsPaginated(first:50 filter:$", "filter", "){edges{node{id status name}}}}}"] }
273 ],
274 fragments: []
275 },
276 variables: {
277 appId: Schema.String,
278 filter: Schema.optional(Schema.NullOr(Shared.DeviceRunSessionFilterInput))
279 },
280 result: Schema.Struct({
281 app: T3ActiveEasSimulatorSessionsAppAppQuery
282 })
283})
284export declare namespace T3ActiveEasSimulatorSessions {
285 export type Variables = typeof T3ActiveEasSimulatorSessions.variables.Type
286 export type Result = typeof T3ActiveEasSimulatorSessions.result.Type
287}
288
289export const EnsureDeviceRunSessionStoppedDeviceRunSession = Schema.Struct({
290 id: Shared.ID,
291 status: GraphQL.enumLiterals(Shared.DeviceRunSessionStatus.literals)
292})
293export interface EnsureDeviceRunSessionStoppedDeviceRunSession extends Schema.Struct.Type<typeof EnsureDeviceRunSessionStoppedDeviceRunSession.fields> {}
294
295export const T3StopEasSimulatorSessionDeviceRunSessionDeviceRunSessionMutation = Schema.Struct({
296 /**
297 * Ensure a device run session is stopped. Idempotent: if the session has already
298 * finished, the existing session is returned unchanged (an ERRORED session stays
299 * ERRORED).
300 */
301 ensureDeviceRunSessionStopped: EnsureDeviceRunSessionStoppedDeviceRunSession
302})
303export interface T3StopEasSimulatorSessionDeviceRunSessionDeviceRunSessionMutation extends Schema.Struct.Type<typeof T3StopEasSimulatorSessionDeviceRunSessionDeviceRunSessionMutation.fields> {}
304
305/** `mutation T3StopEasSimulatorSession` */
306export const T3StopEasSimulatorSession = GraphQL.mutation("T3StopEasSimulatorSession", {
307 document: {
308 variables: [
309 { name: "id", body: "ID!" }
310 ],
311 selections: [
312 { name: "deviceRunSession", body: ["{ensureDeviceRunSessionStopped(deviceRunSessionId:$", "id", "){id status}}"] }
313 ],
314 fragments: []
315 },
316 variables: {
317 id: Shared.ID
318 },
319 result: Schema.Struct({
320 /** Mutations that create, stop, update, and delete device run sessions */
321 deviceRunSession: T3StopEasSimulatorSessionDeviceRunSessionDeviceRunSessionMutation
322 })
323})
324export declare namespace T3StopEasSimulatorSession {
325 export type Variables = typeof T3StopEasSimulatorSession.variables.Type
326 export type Result = typeof T3StopEasSimulatorSession.result.Type
327}
328
329/** Every operation in ExpoApi.graphql. */
330export const ExpoApiGraphQLGroup = GraphQLGroup.make(T3ExpoViewer, T3EasSimulatorAvailability, T3CreateEasSimulatorSession, T3EasSimulatorSession, T3ActiveEasSimulatorSessions, T3StopEasSimulatorSession)