UNPKG

@empirica/tajriba

Version:
1,441 lines (1,439 loc) 165 kB
import { z } from 'zod'; import { TypedDocumentNode } from '@graphql-typed-document-node/core'; import { Client } from '@urql/core'; import { Observable } from 'rxjs'; import TypedEmitter from 'typed-emitter'; declare type Maybe<T> = T | null; declare type InputMaybe<T> = Maybe<T>; declare type Exact<T extends { [key: string]: unknown; }> = { [K in keyof T]: T[K]; }; declare type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]>; }; declare type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]>; }; /** All built-in and custom scalars, mapped to their actual values */ declare type Scalars = { ID: string; String: string; Boolean: boolean; Int: number; Float: number; Cursor: any; /** DateTime is an int64 Date + Time value given in Epoch with ns precision. */ DateTime: any; }; declare type Actor = Participant | Service | User; /** AddGroupInput creates a new Group. */ declare type AddGroupInput = { /** participantIDs are the IDs of the Participants to link with the Group. */ participantIDs: Array<Scalars["ID"]>; }; /** AddGroupPayload is the return payload for the addGroup mutation. */ declare type AddGroupPayload = { __typename: "AddGroupPayload"; /** group that the participant is added to. */ group: Group; }; /** AddParticipantInput finds or creates a Participant by Unique Identifier. */ declare type AddParticipantInput = { /** * identifier is the unique identifier for the Pariticipant. The identifier * is how a participant "logs into" the system. */ identifier: Scalars["ID"]; }; /** AddParticipantPayload is the return payload for the addParticipant mutation. */ declare type AddParticipantPayload = { __typename: "AddParticipantPayload"; /** participant is the created Participants. */ participant: Participant; /** sessionToken is the session token to be used for authenticated requets. */ sessionToken: Scalars["String"]; }; /** AddScopeInput creates a new Scope. */ declare type AddScopeInput = { /** attributes to be attached to the Scope at creation. */ attributes?: InputMaybe<Array<SetAttributeInput>>; /** kind is an optional type name. */ kind?: InputMaybe<Scalars["String"]>; /** * name is the *unique* name of the Scope. If a scope with the same name already * exists, it will return an "already exists" error. */ name?: InputMaybe<Scalars["String"]>; }; /** AddScopePayload is the return payload for the addScope mutation. */ declare type AddScopePayload = { __typename: "AddScopePayload"; /** scope that the participant is added to. */ scope: Scope; }; /** AddStepInput creates a new Step. */ declare type AddStepInput = { /** duration is the duration in seconds of the Step should last before ending. */ duration: Scalars["Int"]; }; /** AddStepPayload is the return payload for the addStep mutation. */ declare type AddStepPayload = { __typename: "AddStepPayload"; /** step that the participant is added to. */ step: Step; }; declare type Admin = Service | User; /** * Attribute is a single piece of custom data set on a Node. Attributes * with the same key can be grouped into an array through the use of a unique * index field within that key's scope. */ declare type Attribute = Node & { __typename: "Attribute"; /** createdAt is the time of creation of the record. */ createdAt: Scalars["DateTime"]; /** createdBy is the Actor that created the record. */ createdBy: Actor; /** current is true if the Attribute is the current version of the value for key. */ current: Scalars["Boolean"]; /** * deletedAt is the time when the Attribute was deleted. If null, the Attribute * was not deleted. */ deletedAt?: Maybe<Scalars["DateTime"]>; /** * ephemeral indicates the Attribute should not be persisted. Ephemeral * Attributes are not stored in the database and are only synced to the * connected clients. An ephemeral Attribute cannot become non-ephemeral and vice * versa. */ ephemeral: Scalars["Boolean"]; /** id is the unique globally identifier for the record. */ id: Scalars["ID"]; /** * immutable indicates the Attribute can never be changed by any Actor. * immutable must be set on the Attribute at creation. */ immutable: Scalars["Boolean"]; /** index of the Attribute if the value is a vector. */ index?: Maybe<Scalars["Int"]>; /** key identifies the unique key of the Attribute. */ key: Scalars["String"]; /** Object associated with Attribute. */ node: Node; /** * private indicates whether the Attribute shouldn't be visible to Participants * in the scope. * private must be set on the Attribute at creation. */ private: Scalars["Boolean"]; /** * protected indicates the Attribute cannot be modified by other Participants. A * Participant can only set protected Records on their Participant record. * Users and Services can update protected Attributes. * protected must be set on the Attribute at creation. */ protected: Scalars["Boolean"]; /** * val is the value of the Attribute. If val is not returned, it is considered to * be explicitely `null`. */ val?: Maybe<Scalars["String"]>; /** vector returns true if the value is a vector. */ vector: Scalars["Boolean"]; /** version is the version number of this Attribute, starting at 1. */ version: Scalars["Int"]; /** versions returns previous versions for the Attribute. */ versions?: Maybe<AttributeConnection>; }; /** * Attribute is a single piece of custom data set on a Node. Attributes * with the same key can be grouped into an array through the use of a unique * index field within that key's scope. */ declare type AttributeVersionsArgs = { after?: InputMaybe<Scalars["Cursor"]>; before?: InputMaybe<Scalars["Cursor"]>; first?: InputMaybe<Scalars["Int"]>; last?: InputMaybe<Scalars["Int"]>; }; declare type AttributeChange = { __typename: "AttributeChange"; /** createdAt is the time the Attribute was created. */ createdAt: Scalars["DateTime"]; /** deleted is true with the attribute was deleted. */ deleted: Scalars["Boolean"]; /** id is the identifier for the Attribute. */ id: Scalars["ID"]; /** index is the index of the attribute if the value is a vector. */ index?: Maybe<Scalars["Int"]>; /** isNew is true if the Attribute was just created. */ isNew: Scalars["Boolean"]; /** key is the attribute key being updated. */ key: Scalars["String"]; /** nodeID is the identifier for the Attribute's Node. */ nodeID: Scalars["ID"]; /** value is the value of the updated attribute. */ val?: Maybe<Scalars["String"]>; /** vector indicates whether the value is a vector. */ vector: Scalars["Boolean"]; /** version is the version number of this Attribute, starting at 1. */ version: Scalars["Int"]; }; declare type AttributeConnection = { __typename: "AttributeConnection"; edges: Array<AttributeEdge>; pageInfo: PageInfo; totalCount: Scalars["Int"]; }; declare type AttributeEdge = { __typename: "AttributeEdge"; cursor: Scalars["Cursor"]; node: Attribute; }; declare type Change = AttributeChange | ParticipantChange | ScopeChange | StepChange; declare type ChangePayload = { __typename: "ChangePayload"; /** change is the Change. */ change?: Maybe<Change>; /** done indicates that the state has finished synchorizing. */ done: Scalars["Boolean"]; /** removed indicates whether the record was removed. */ removed?: Maybe<Scalars["Boolean"]>; }; /** EventType holds types of event that can trigger hooks. */ declare enum EventType { /** An attribute was added or updated. */ AttributeUpdate = "ATTRIBUTE_UPDATE", /** A group was added. */ GroupAdd = "GROUP_ADD", /** A link was added. */ LinkAdd = "LINK_ADD", /** A participant was added. */ ParticipantAdd = "PARTICIPANT_ADD", /** A participant connected. */ ParticipantConnect = "PARTICIPANT_CONNECT", /** * Participant was already connected when this subscription started. This is a * special event that allows the listener to catch up on the currently connected * players at the beginning of the subscription. */ ParticipantConnected = "PARTICIPANT_CONNECTED", /** A participant disconnected. */ ParticipantDisconnect = "PARTICIPANT_DISCONNECT", /** A scope was added. */ ScopeAdd = "SCOPE_ADD", /** A step was added. */ StepAdd = "STEP_ADD", /** A transition was added. */ TransitionAdd = "TRANSITION_ADD" } declare type Group = Node & { __typename: "Group"; /** createdAt is the time of creation of the record. */ createdAt: Scalars["DateTime"]; /** createdBy returns the Actor that created the record. */ createdBy: Actor; /** id is the unique globally identifier for the record. */ id: Scalars["ID"]; /** links returns Participant linking and unlinking with this Node. */ links?: Maybe<LinkConnection>; }; declare type GroupLinksArgs = { after?: InputMaybe<Scalars["Cursor"]>; before?: InputMaybe<Scalars["Cursor"]>; first?: InputMaybe<Scalars["Int"]>; last?: InputMaybe<Scalars["Int"]>; }; declare type GroupConnection = { __typename: "GroupConnection"; edges: Array<GroupEdge>; pageInfo: PageInfo; totalCount: Scalars["Int"]; }; declare type GroupEdge = { __typename: "GroupEdge"; cursor: Scalars["Cursor"]; node: Group; }; declare type Kv = { key: Scalars["String"]; val: Scalars["String"]; }; /** Link records a Participant linking or unlinking with a Node. */ declare type Link = Node & { __typename: "Link"; /** createdAt is the time of creation of the record. */ createdAt: Scalars["DateTime"]; /** createdBy is the Actor that created the record. */ createdBy: Actor; /** id is the unique globally identifier for the record. */ id: Scalars["ID"]; /** link indicates whether the Participant was linked or unlinked with the Node. */ link: Scalars["Boolean"]; /** node the Participant is assigned to. */ node: Node; /** participant that is assigned to */ participant: Participant; }; declare type LinkConnection = { __typename: "LinkConnection"; edges: Array<LinkEdge>; pageInfo: PageInfo; totalCount: Scalars["Int"]; }; declare type LinkEdge = { __typename: "LinkEdge"; cursor: Scalars["Cursor"]; node: Link; }; /** LinkInput links or unlinks Participants with a Node. */ declare type LinkInput = { /** * link indicates whether the Participant was linked or unlinked with the Node. * WARNING: UNLINKING NOT CURRENTLY SUPPORTED, link must be true. */ link: Scalars["Boolean"]; /** nodeIDs are the IDs of the Nodes that the Participants should be added to. */ nodeIDs: Array<Scalars["ID"]>; /** * participantIDs are the IDs of the Participants that should be added to the * Nodes. */ participantIDs: Array<Scalars["ID"]>; }; /** * LinkPayload is the return payload for the assignParticipants * mutation. */ declare type LinkPayload = { __typename: "LinkPayload"; /** nodes the participants are added to. */ nodes: Array<Node>; /** participants that are added to the Node. */ participants: Array<Participant>; }; /** LoginInput is the input for login() */ declare type LoginInput = { /** password of the user. */ password: Scalars["String"]; /** username is the user identifier string. */ username: Scalars["String"]; }; /** LoginPayload is returned by login() */ declare type LoginPayload = { __typename: "LoginPayload"; /** sessionToken is the session token to be used for authenticated requets. */ sessionToken: Scalars["String"]; /** user is the logged in User. */ user: User; }; declare type Mutation = { __typename: "Mutation"; /** addGroups creates new Groups. */ addGroups: Array<AddGroupPayload>; /** addParticipant finds or creates a Participant by Unique Identifier. */ addParticipant: AddParticipantPayload; /** addScopes creates a new Scope. */ addScopes: Array<AddScopePayload>; /** addSteps creates new Steps. */ addSteps: Array<AddStepPayload>; /** link links or unlinks Participants to Nodes. */ link: LinkPayload; /** login signs in a user. */ login: LoginPayload; /** registerService registers a new Service. */ registerService: RegisterServicePayload; /** * Create or update an Attribute on a Node. If the Attribute exists and the value * is the same, the Attribute is not updated and the attribute will not be * returned in the response. */ setAttributes: Array<SetAttributePayload>; /** * login signs in a user with a PASETO Token. This can create a * new user if the user ID does not exist. */ tokenLogin: LoginPayload; /** transition transition a Node from a state to another state. */ transition: TransitionPayload; }; declare type MutationAddGroupsArgs = { input: Array<AddGroupInput>; }; declare type MutationAddParticipantArgs = { input: AddParticipantInput; }; declare type MutationAddScopesArgs = { input: Array<AddScopeInput>; }; declare type MutationAddStepsArgs = { input: Array<AddStepInput>; }; declare type MutationLinkArgs = { input: LinkInput; }; declare type MutationLoginArgs = { input: LoginInput; }; declare type MutationRegisterServiceArgs = { input: RegisterServiceInput; }; declare type MutationSetAttributesArgs = { input: Array<SetAttributeInput>; }; declare type MutationTokenLoginArgs = { input: TokenLoginInput; }; declare type MutationTransitionArgs = { input: TransitionInput; }; /** Node is an interface allowing simple querying of any node */ declare type Node = { /** id is the unique globally identifier for the record. */ id: Scalars["ID"]; }; /** OnAnyEventInput is the input for the onAnyEvent subscription. */ declare type OnAnyEventInput = { /** nodeID is an optional node ID of the node to listen to. */ nodeID?: InputMaybe<Scalars["ID"]>; }; /** OnEventInput is the input for the onEvent subscription. */ declare type OnEventInput = { /** eventsTypes speficies which events to listen to. */ eventTypes: Array<EventType>; /** nodeID is an optional node ID of the node to listen to. */ nodeID?: InputMaybe<Scalars["ID"]>; }; /** OnEventPayload is the payload for the on[Any]Event subscriptions. */ declare type OnEventPayload = { __typename: "OnEventPayload"; /** * done indicates that the state has finished synchorizing. This is only valid * for events that synchronize state on start of subscription (e.g. * PARTICIPANT_CONNECTED). */ done: Scalars["Boolean"]; /** * eventID is a unique identifier for the current event. Each OnEventPayload for * a single client will have a different eventID. eventID will be the same for * different clients on the same event. */ eventID: Scalars["ID"]; /** eventType is the type of the current event. */ eventType: EventType; /** node is the node that triggered the event */ node?: Maybe<Node>; }; declare enum OrderDirection { Asc = "ASC", Desc = "DESC" } declare type PageInfo = { __typename: "PageInfo"; endCursor?: Maybe<Scalars["Cursor"]>; hasNextPage: Scalars["Boolean"]; hasPreviousPage: Scalars["Boolean"]; startCursor?: Maybe<Scalars["Cursor"]>; }; /** Participant is an entity participating in Steps. */ declare type Participant = Node & { __typename: "Participant"; /** createdAt is the time of creation of the record. */ createdAt: Scalars["DateTime"]; /** id is the unique globally identifier for the record. */ id: Scalars["ID"]; /** * identifier is the unique identifier for the Pariticipant. This is different * from the id field, which is the database internal identifier. The identifier * is how a participant "logs into" the system. */ identifier: Scalars["ID"]; /** * links returns Participant linking and unlinking with Nodes. A single * Particpant might be linked and unlinked multiple times, and * so a Participant might have multiple Links on a single Node. */ links?: Maybe<LinkConnection>; }; /** Participant is an entity participating in Steps. */ declare type ParticipantLinksArgs = { after?: InputMaybe<Scalars["Cursor"]>; before?: InputMaybe<Scalars["Cursor"]>; first?: InputMaybe<Scalars["Int"]>; last?: InputMaybe<Scalars["Int"]>; }; declare type ParticipantChange = { __typename: "ParticipantChange"; /** id is the identifier for the Participant. */ id: Scalars["ID"]; }; declare type ParticipantConnection = { __typename: "ParticipantConnection"; edges: Array<ParticipantEdge>; pageInfo: PageInfo; totalCount: Scalars["Int"]; }; declare type ParticipantEdge = { __typename: "ParticipantEdge"; cursor: Scalars["Cursor"]; node: Participant; }; declare type Query = { __typename: "Query"; /** attributes returns all attributes for a scope. */ attributes?: Maybe<AttributeConnection>; /** groups returns all groups */ groups?: Maybe<GroupConnection>; /** participants returns all Participants in the system. */ participants?: Maybe<ParticipantConnection>; /** * scopes returns all scopes * If filter is provided it will return scopes matching any * ScopedAttributesInput. */ scopes?: Maybe<ScopeConnection>; /** steps returns all steps */ steps?: Maybe<StepConnection>; }; declare type QueryAttributesArgs = { after?: InputMaybe<Scalars["Cursor"]>; before?: InputMaybe<Scalars["Cursor"]>; first?: InputMaybe<Scalars["Int"]>; last?: InputMaybe<Scalars["Int"]>; scopeID: Scalars["ID"]; }; declare type QueryGroupsArgs = { after?: InputMaybe<Scalars["Cursor"]>; before?: InputMaybe<Scalars["Cursor"]>; first?: InputMaybe<Scalars["Int"]>; last?: InputMaybe<Scalars["Int"]>; }; declare type QueryParticipantsArgs = { after?: InputMaybe<Scalars["Cursor"]>; before?: InputMaybe<Scalars["Cursor"]>; first?: InputMaybe<Scalars["Int"]>; last?: InputMaybe<Scalars["Int"]>; }; declare type QueryScopesArgs = { after?: InputMaybe<Scalars["Cursor"]>; before?: InputMaybe<Scalars["Cursor"]>; filter?: InputMaybe<Array<ScopedAttributesInput>>; first?: InputMaybe<Scalars["Int"]>; last?: InputMaybe<Scalars["Int"]>; }; declare type QueryStepsArgs = { after?: InputMaybe<Scalars["Cursor"]>; before?: InputMaybe<Scalars["Cursor"]>; first?: InputMaybe<Scalars["Int"]>; last?: InputMaybe<Scalars["Int"]>; }; /** RegisterServiceInput is the input for registerService() */ declare type RegisterServiceInput = { /** name is the name of the service to register. */ name: Scalars["String"]; /** token is the Service Registration token. */ token: Scalars["String"]; }; /** RegisterServicePayload is returned by registerService() */ declare type RegisterServicePayload = { __typename: "RegisterServicePayload"; /** service is newly created Service. */ service: Service; /** sessionToken is the session token to be used for authenticated requets. */ sessionToken: Scalars["String"]; }; declare enum Role { /** ADMIN is priviledged access for Users and Services. */ Admin = "ADMIN", /** PARTICIPANT is access tailored for Participants' needs. */ Participant = "PARTICIPANT" } declare type Scope = Node & { __typename: "Scope"; /** attributes returns all custom data that has been set. */ attributes: AttributeConnection; /** createdAt is the time of creation of the record. */ createdAt: Scalars["DateTime"]; /** createdBy returns the Actor that created the record. */ createdBy: Actor; /** id is the unique globally identifier for the record. */ id: Scalars["ID"]; /** kind is an optional type name. */ kind?: Maybe<Scalars["String"]>; /** * links returns Participant linking and unlinking with this Node. A single * Particpant might be linked and unlinked multiple times, and * so a Participant might have multiple Links on a Node. */ links?: Maybe<LinkConnection>; /** name is an optional *unique* name. */ name?: Maybe<Scalars["String"]>; }; declare type ScopeAttributesArgs = { after?: InputMaybe<Scalars["Cursor"]>; before?: InputMaybe<Scalars["Cursor"]>; deleted?: InputMaybe<Scalars["Boolean"]>; first?: InputMaybe<Scalars["Int"]>; last?: InputMaybe<Scalars["Int"]>; }; declare type ScopeLinksArgs = { after?: InputMaybe<Scalars["Cursor"]>; before?: InputMaybe<Scalars["Cursor"]>; first?: InputMaybe<Scalars["Int"]>; last?: InputMaybe<Scalars["Int"]>; }; declare type ScopeChange = { __typename: "ScopeChange"; /** id is the identifier for the Scope. */ id: Scalars["ID"]; /** kind is the kind of the Scope. */ kind?: Maybe<Scalars["String"]>; /** name is the name of the Scope. */ name?: Maybe<Scalars["String"]>; }; declare type ScopeConnection = { __typename: "ScopeConnection"; edges: Array<ScopeEdge>; pageInfo: PageInfo; totalCount: Scalars["Int"]; }; declare type ScopeEdge = { __typename: "ScopeEdge"; cursor: Scalars["Cursor"]; node: Scope; }; /** * ScopedAttributesInput subscribes to attributes in matching scopes. Either name, * kind, keys or kvs exclusively can be provided. */ declare type ScopedAttributesInput = { /** ids of the matching Scopes. */ ids?: InputMaybe<Array<Scalars["ID"]>>; /** keys to Attributes in matching Scope. */ keys?: InputMaybe<Array<Scalars["String"]>>; /** kinds of the matching Scopes. */ kinds?: InputMaybe<Array<Scalars["String"]>>; /** kvs to Attributes in matching Scope. */ kvs?: InputMaybe<Array<Kv>>; /** names of the matching Scopes. */ names?: InputMaybe<Array<Scalars["String"]>>; }; declare type Service = { __typename: "Service"; /** createdAt is the time of creation of the record. */ createdAt: Scalars["DateTime"]; /** id is the unique globally identifier for the record. */ id: Scalars["ID"]; /** name is the name of the service gave itself. */ name: Scalars["String"]; }; /** SetAttributeInput sets an Attribute on a Node. */ declare type SetAttributeInput = { /** * append allows appending to a vector without specifying the index. Setting the * index will make this Attribute a vector if it does not yet exist. An Attribute * cannot mutate between vector and non-vector formats. */ append?: InputMaybe<Scalars["Boolean"]>; /** * ephemeral indicates the Attribute should not be persisted. Ephemeral * Attributes are not stored in the database and are only synced to the * connected clients. * Defaults to false and does need to be sent on subsequent updates. An ephemeral * Attribute cannot become non-ephemeral and vice versa. */ ephemeral?: InputMaybe<Scalars["Boolean"]>; /** * immutable indicates the Attribute can never be changed by any Actor. * immutable must be set on the Attribute at creation. * Defaults to false and does need to be sent on subsequent updates. */ immutable?: InputMaybe<Scalars["Boolean"]>; /** * index of value if Attribute is a vector. Setting the index will make this * Attribute a vector if it does not yet exist. An Attribute cannot mutate * between vector and non-vector formats. */ index?: InputMaybe<Scalars["Int"]>; /** key identifies the unique key of the Attribute. */ key: Scalars["String"]; /** * ID of object on which to update the value. NodeID is required if attribute is * not created with addScope(). */ nodeID?: InputMaybe<Scalars["ID"]>; /** * private indicates whether the Attribute shouldn't be visible to Participants * in the scope. * private must be set on the Attribute at creation. * Defaults to false and does need to be sent on subsequent updates. */ private?: InputMaybe<Scalars["Boolean"]>; /** * protected indicates the Attribute cannot be modified by other Participants. A * Participant can only set protected Records on their Participant record. * Users and Services can update protected Attributes. * protected must be set on the Attribute at creation. * Defaults to false and does need to be sent on subsequent updates. */ protected?: InputMaybe<Scalars["Boolean"]>; /** * val is the value of the Attribute. It can be any JSON encodable value. If * value is not defined, value is assumed to be `null`. */ val?: InputMaybe<Scalars["String"]>; }; /** SetAttributePayload is the return payload for the setAttribute mutation. */ declare type SetAttributePayload = { __typename: "SetAttributePayload"; /** attribute is the Attribute updated. */ attribute: Attribute; }; /** State of Step */ declare enum State { /** CREATED is when the Step has been created but hasn't started yet. */ Created = "CREATED", /** ENDED is when the Step has finished without issues. */ Ended = "ENDED", /** ERROR is when the Step has failed (due to an unrecoverable error). */ Failed = "FAILED", /** PAUSED is when the Step has started but its timer was stopped. */ Paused = "PAUSED", /** RUNNING is when the Step is currently in progress. */ Running = "RUNNING", /** * TERMINATED is when the Step has been manually terminated. This could happen * before or during execution. */ Terminated = "TERMINATED" } /** Step is a span of time. */ declare type Step = Node & { __typename: "Step"; /** createdAt is the time of creation of the record. */ createdAt: Scalars["DateTime"]; /** createdBy returns the Actor that created the record. */ createdBy: Actor; /** duration is the duration in seconds of the Step should last before ending. */ duration: Scalars["Int"]; /** endedAt is the time at which the Step ended. */ endedAt?: Maybe<Scalars["DateTime"]>; /** id is the unique globally identifier for the record. */ id: Scalars["ID"]; /** links returns Participant linking and unlinking with this Node. */ links: LinkConnection; /** startedAt is the time at which the Step started. */ startedAt?: Maybe<Scalars["DateTime"]>; /** state is the stage the Step currently is in */ state: State; /** transitions lists of States changes of the Step. */ transitions: TransitionConnection; }; /** Step is a span of time. */ declare type StepLinksArgs = { after?: InputMaybe<Scalars["Cursor"]>; before?: InputMaybe<Scalars["Cursor"]>; first?: InputMaybe<Scalars["Int"]>; last?: InputMaybe<Scalars["Int"]>; }; /** Step is a span of time. */ declare type StepTransitionsArgs = { after?: InputMaybe<Scalars["Cursor"]>; before?: InputMaybe<Scalars["Cursor"]>; first?: InputMaybe<Scalars["Int"]>; last?: InputMaybe<Scalars["Int"]>; }; declare type StepChange = { __typename: "StepChange"; /** elapsed indicates the time in seconds elapsed since the start of the Step. */ elapsed?: Maybe<Scalars["Int"]>; /** id is the identifier for the Step. */ id: Scalars["ID"]; /** * remaining is the duration left in seconds of the Step should last before * ending, from `since`. */ remaining?: Maybe<Scalars["Int"]>; /** running indicates whether the Step is running. */ running: Scalars["Boolean"]; /** since is the time from which the counter should count. */ since?: Maybe<Scalars["DateTime"]>; /** state is the stage the Step currently is in */ state: State; }; declare type StepConnection = { __typename: "StepConnection"; edges: Array<StepEdge>; pageInfo: PageInfo; totalCount: Scalars["Int"]; }; declare type StepEdge = { __typename: "StepEdge"; cursor: Scalars["Cursor"]; node: Step; }; declare type StepOrder = { direction: OrderDirection; field?: InputMaybe<StepOrderField>; }; declare enum StepOrderField { CreatedAt = "CREATED_AT", Duration = "DURATION", StartedAt = "STARTED_AT" } /** SubAttributesPayload is the return payload for the scope attributes subs. */ declare type SubAttributesPayload = { __typename: "SubAttributesPayload"; /** * scope that the participant is added to. Attribute may be null only if the * subscription did not match any Scopes and done must be published. */ attribute?: Maybe<Attribute>; /** done indicates that the state has finished synchorizing. */ done: Scalars["Boolean"]; /** isNew returns true if the Attribute for key and nodeID was just created. */ isNew: Scalars["Boolean"]; /** * scopesUpdated is the list of the scope IDs matching the subscription that have * been sent and are done *synced). This can only sent along with done == true. * If done == true and the list is empty, then no scopes matched the * subscription. The list must be sent if done == true. Done can be true and * scopesUpdated can contain IDs even if no attributes were sent. In this case, * the scopes matched were empty. */ scopesUpdated?: Maybe<Array<Scalars["String"]>>; }; declare type Subscription = { __typename: "Subscription"; /** * changes returns the changes relevant to the Participant, including changes to * the Step they are Participating in, Atrributes they have access that are * added, updated, or going in and out of scope, etc. */ changes: ChangePayload; /** * globalAttributes returns Attributes for the global Scope, which is a singleton * permission-less Scope that any client can access, even if not logged in. The * name of the global Scope is "global" and can only be updated by Users. All * Attributes in this Scope will be returned initially, then any update to * Attributes from this Scopes. */ globalAttributes: SubAttributesPayload; /** onAnyEvent works like onEvent, except all events are subscribed to. */ onAnyEvent?: Maybe<OnEventPayload>; /** * onEvent attaches hooks to specified events. Optionally, a nodeType and nodeID * can be specified to only look at events for a particular record. */ onEvent?: Maybe<OnEventPayload>; /** * scopedAttributes returns Attributes for Scopes matching the keys or KVs input. * keys or KVs (only one) must be provided. All Attributes in Scopes matching * will be returned initially, then any update to Attributes within the matching * Scopes. */ scopedAttributes: SubAttributesPayload; }; declare type SubscriptionOnAnyEventArgs = { input?: InputMaybe<OnAnyEventInput>; }; declare type SubscriptionOnEventArgs = { input?: InputMaybe<OnEventInput>; }; declare type SubscriptionScopedAttributesArgs = { input: Array<ScopedAttributesInput>; }; /** TokenLoginInput is the input for tokenLogin() */ declare type TokenLoginInput = { /** token is the PASETO token. */ token: Scalars["String"]; }; /** A Transition records a State change. */ declare type Transition = Node & { __typename: "Transition"; /** createdAt is the time of creation of the record. */ createdAt: Scalars["DateTime"]; /** createdBy is the Actor that created the record. */ createdBy: Actor; /** from is the State in which the Node was before the State change. */ from: State; /** id is the unique globally identifier for the record. */ id: Scalars["ID"]; /** node is the Node that experienced this Transition. */ node: Node; /** to is the State in which the Node was after the State change. */ to: State; }; declare type TransitionConnection = { __typename: "TransitionConnection"; edges: Array<TransitionEdge>; pageInfo: PageInfo; totalCount: Scalars["Int"]; }; declare type TransitionEdge = { __typename: "TransitionEdge"; cursor: Scalars["Cursor"]; node: Transition; }; /** TransitionInput transitions a Node. */ declare type TransitionInput = { /** cause is an optional open string explaining the reason for the transition. */ cause?: InputMaybe<Scalars["String"]>; /** * from is the current State of the Node. To avoid concurrency or repeat errors, * from is required, and the transition will not happen if the from State does * not correspond to the Node's current State. */ from: State; /** nodeID is the ID of the Node to transition. */ nodeID: Scalars["ID"]; /** to is the desired State of the Step. */ to: State; }; /** TransitionPayload is the return payload for the transition() mutation. */ declare type TransitionPayload = { __typename: "TransitionPayload"; /** transition is the created Transition. */ transition: Transition; }; /** User is a user that has priviledged access to the data. */ declare type User = Node & { __typename: "User"; /** createdAt is the time of creation of the record. */ createdAt: Scalars["DateTime"]; /** id is the unique globally identifier for the record. */ id: Scalars["ID"]; /** name is the display name of the user. */ name: Scalars["String"]; /** username is the login name of the user. */ username: Scalars["String"]; }; declare type AttributesQueryVariables = Exact<{ scopeID: Scalars["ID"]; after?: InputMaybe<Scalars["Cursor"]>; first?: InputMaybe<Scalars["Int"]>; before?: InputMaybe<Scalars["Cursor"]>; last?: InputMaybe<Scalars["Int"]>; }>; declare type AttributesQuery = { __typename: "Query"; attributes?: { __typename: "AttributeConnection"; totalCount: number; pageInfo: { __typename: "PageInfo"; hasNextPage: boolean; hasPreviousPage: boolean; startCursor?: any | null; endCursor?: any | null; }; edges: Array<{ __typename: "AttributeEdge"; cursor: any; node: { __typename: "Attribute"; id: string; createdAt: any; private: boolean; protected: boolean; immutable: boolean; ephemeral: boolean; deletedAt?: any | null; key: string; val?: string | null; index?: number | null; current: boolean; version: number; vector: boolean; createdBy: { __typename: "Participant"; id: string; identifier: string; createdAt: any; } | { __typename: "Service"; id: string; name: string; createdAt: any; } | { __typename: "User"; id: string; username: string; name: string; createdAt: any; }; node: { __typename: "Attribute"; id: string; } | { __typename: "Group"; id: string; } | { __typename: "Link"; id: string; } | { __typename: "Participant"; id: string; } | { __typename: "Scope"; kind?: string | null; name?: string | null; id: string; } | { __typename: "Step"; id: string; } | { __typename: "Transition"; id: string; } | { __typename: "User"; id: string; }; }; }>; } | null; }; declare type SetAttributesMutationVariables = Exact<{ input: Array<SetAttributeInput> | SetAttributeInput; }>; declare type SetAttributesMutation = { __typename: "Mutation"; setAttributes: Array<{ __typename: "SetAttributePayload"; attribute: { __typename: "Attribute"; id: string; createdAt: any; private: boolean; protected: boolean; immutable: boolean; ephemeral: boolean; deletedAt?: any | null; key: string; val?: string | null; index?: number | null; current: boolean; version: number; vector: boolean; createdBy: { __typename: "Participant"; id: string; identifier: string; createdAt: any; } | { __typename: "Service"; id: string; name: string; createdAt: any; } | { __typename: "User"; id: string; username: string; name: string; createdAt: any; }; node: { __typename: "Attribute"; id: string; } | { __typename: "Group"; id: string; } | { __typename: "Link"; id: string; } | { __typename: "Participant"; id: string; } | { __typename: "Scope"; kind?: string | null; name?: string | null; id: string; } | { __typename: "Step"; id: string; } | { __typename: "Transition"; id: string; } | { __typename: "User"; id: string; }; }; }>; }; declare type ChangesSubscriptionVariables = Exact<{ [key: string]: never; }>; declare type ChangesSubscription = { __typename: "Subscription"; changes: { __typename: "ChangePayload"; done: boolean; removed?: boolean | null; change?: { __typename: "AttributeChange"; id: string; nodeID: string; deleted: boolean; createdAt: any; isNew: boolean; index?: number | null; vector: boolean; version: number; key: string; val?: string | null; } | { __typename: "ParticipantChange"; id: string; } | { __typename: "ScopeChange"; id: string; name?: string | null; kind?: string | null; } | { __typename: "StepChange"; id: string; state: State; since?: any | null; remaining?: number | null; elapsed?: number | null; running: boolean; } | null; }; }; declare type AddGroupsMutationVariables = Exact<{ input: Array<AddGroupInput> | AddGroupInput; }>; declare type AddGroupsMutation = { __typename: "Mutation"; addGroups: Array<{ __typename: "AddGroupPayload"; group: { __typename: "Group"; id: string; }; }>; }; declare type GroupsQueryVariables = Exact<{ after?: InputMaybe<Scalars["Cursor"]>; first?: InputMaybe<Scalars["Int"]>; before?: InputMaybe<Scalars["Cursor"]>; last?: InputMaybe<Scalars["Int"]>; }>; declare type GroupsQuery = { __typename: "Query"; groups?: { __typename: "GroupConnection"; totalCount: number; edges: Array<{ __typename: "GroupEdge"; node: { __typename: "Group"; id: string; createdAt: any; createdBy: { __typename: "Participant"; id: string; identifier: string; createdAt: any; } | { __typename: "Service"; id: string; name: string; createdAt: any; } | { __typename: "User"; id: string; username: string; name: string; createdAt: any; }; }; }>; pageInfo: { __typename: "PageInfo"; hasNextPage: boolean; hasPreviousPage: boolean; startCursor?: any | null; endCursor?: any | null; }; } | null; }; declare type OnEventSubscriptionVariables = Exact<{ input?: InputMaybe<OnEventInput>; }>; declare type OnEventSubscription = { __typename: "Subscription"; onEvent?: { __typename: "OnEventPayload"; eventID: string; eventType: EventType; done: boolean; node?: { __typename: "Attribute"; createdAt: any; private: boolean; protected: boolean; immutable: boolean; ephemeral: boolean; deletedAt?: any | null; key: string; val?: string | null; index?: number | null; current: boolean; version: number; vector: boolean; id: string; createdBy: { __typename: "Participant"; id: string; identifier: string; createdAt: any; } | { __typename: "Service"; id: string; name: string; createdAt: any; } | { __typename: "User"; id: string; username: string; name: string; createdAt: any; }; node: { __typename: "Attribute"; id: string; } | { __typename: "Group"; id: string; } | { __typename: "Link"; id: string; } | { __typename: "Participant"; id: string; } | { __typename: "Scope"; kind?: string | null; name?: string | null; id: string; } | { __typename: "Step"; id: string; } | { __typename: "Transition"; id: string; } | { __typename: "User"; id: string; }; } | { __typename: "Group"; createdAt: any; id: string; createdBy: { __typename: "Participant"; id: string; identifier: string; createdAt: any; } | { __typename: "Service"; id: string; name: string; createdAt: any; } | { __typename: "User"; id: string; username: string; name: string; createdAt: any; }; } | { __typename: "Link"; createdAt: any; link: boolean; id: string; createdBy: { __typename: "Participant"; id: string; identifier: string; createdAt: any; } | { __typename: "Service"; id: string; name: string; createdAt: any; } | { __typename: "User"; id: string; username: string; name: string; createdAt: any; }; participant: { __typename: "Participant"; id: string; }; node: { __typename: "Attribute"; id: string; } | { __typename: "Group"; id: string; } | { __typename: "Link"; id: string; } | { __typename: "Participant"; id: string; } | { __typename: "Scope"; id: string; } | { __typename: "Step"; id: string; } | { __typename: "Transition"; id: string; } | { __typename: "User"; id: string; }; } | { __typename: "Participant"; createdAt: any; identifier: string; id: string; } | { __typename: "Scope"; name?: string | null; kind?: string | null; createdAt: any; id: string; createdBy: { __typename: "Participant"; id: string; identifier: string; createdAt: any; } | { __typename: "Service"; id: string; name: string; createdAt: any; } | { __typename: "User"; id: string; username: string; name: string; createdAt: any; }; attributes: { __typename: "AttributeConnection"; totalCount: number; pageInfo: { __typename: "PageInfo"; hasNextPage: boolean; hasPreviousPage: boolean; startCursor?: any | null; endCursor?: any | null; }; edges: Array<{ __typename: "AttributeEdge"; cursor: any; node: { __typename: "Attribute"; id: string; createdAt: any; private: boolean; protected: boolean; immutable: boolean; ephemeral: boolean; deletedAt?: any | null; key: string; val?: string | null; index?: number | null; current: boolean; version: number; vector: boolean; createdBy: { __typename: "Participant"; id: string; identifier: string; createdAt: any; } | { __typename: "Service"; id: string; name: string; createdAt: any; } | { __typename: "User"; id: string; username: string; name: string; createdAt: any; }; node: { __typename: "Attribute"; id: string; } | { __typename: "Group"; id: string; } | { __typename: "Link"; id: string; } | { __typename: "Participant"; id: string; } | { __typename: "Scope"; kind?: string | null; name?: string | null; id: string; } | { __typename: "Step"; id: string; } | { __typename: "Transition"; id: string; } | { __typename: "User"; id: string; }; }; }>; }; } | { __typename: "Step"; createdAt: any; duration: number; startedAt?: any | null; endedAt?: any | null; state: State; id: string; createdBy: { __typename: "Participant"; id: string; identifier: string; createdAt: any; } | { __typename: "Service"; id: string; name: string; createdAt: any; } | { __typename: "User"; id: string; username: string; name: string; createdAt: any; }; transitions: { __typename: "TransitionConnection"; totalCount: number; pageInfo: { __typename: "PageInfo";