Skip to main content
Version: Current

Extra Types

  • AIChatAction

    An event that is used to chat with an AI.

    Members

    • messages AIChatMessage[]

      The list of messages comprising the conversation so far.

    • options AIChatOptions

      The options for the action.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • taskId (string | number)

      The ID of the async task.

    • type "ai_chat"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • AIChatInterfaceRequest

    Defines an interface that represents an AI chat request.

    Members

    • frequencyPenalty? number

      The frequency penalty.

      Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.

    • maxTokens? number

      The maximum number of tokens that should be generated by the model.

    • messages AIChatMessage[]

      The messages that should be sent to the AI.

    • model string

      The model that should be used.

    • presencePenalty? number

      The presence penalty.

      Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.

    • stopWords? string[]

      The list of stop words that should be used.

      If the AI generates a sequence of tokens that match one of the given words, then it will stop generating tokens.

    • temperature number

      The temperature of the request.

    • topP? number

      The nucleus sampling probability.

    • userId string

      The ID of the user that is making the request.

  • AIChatInterfaceResponse

    Defines an interface that represents an AI chat response.

    Members

    • choices AIChatMessage[]

      The messages that the AI responded with.

    • inputTokens? number

      The number of input tokens that were used.

    • outputTokens? number

      The number of output tokens that were used.

    • totalTokens number

      The total number of tokens that were used.

  • AIChatInterfaceStreamResponse

    Members

    • choices AIChatStreamMessage[]

      The messages that the AI responded with.

    • inputTokens? number

      The number of input tokens that were used.

    • outputTokens? number

      The number of output tokens that were used.

    • totalTokens number

      The total number of tokens that were used.

  • AIChatMetrics

    Members

    • createdAtMs number

      The unix time in miliseconds of when the metrics were created.

    • studioId? string

      The ID of the studio that the metrics are for.

    • tokens number

      The number of tokens that have been used.

    • userId? string

      The ID of the user that the metrics are for.

  • AIChatStreamAction

    An event that is used to chat with an AI.

    Members

    • messages AIChatMessage[]

      The list of messages comprising the conversation so far.

    • options AIChatOptions

      The options for the action.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • taskId (string | number)

      The ID of the async task.

    • type "ai_chat_stream"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • AIChatSubscriptionMetrics

    Members

    • currentPeriodEndMs number

      The unix time in miliseconds of the end of the current subscription period.

    • currentPeriodStartMs number

      The unix time in miliseconds of the start of the current subscription period.

    • ownerId string

    • recordName? string

    • stripeAccountId string

      The ID of the stripe account that the record is associated with. Null if a stripe account is not associated with the record.

    • stripeAccountStatus StripeAccountStatus

      The status of the stripe account that the record is associated with. Null if a stripe account is not associated with the record.

    • studioId string

    • subscriptionId string

      The ID of the subscription.

    • subscriptionStatus string

      The status of the subscription.

    • subscriptionType ("user" | "studio")

      The type of the subscription.

    • totalTokensInCurrentPeriod number

      The total number of tokens that have been used for the current period.

    • userId? string

  • AIController

    Defines a class that is able to handle AI requests.

    Members

  • AIGenerateImageAction

    An event that is used to generate an image using AI.

    Members

    • cfgScale? number

      How strictly the diffusion process adheres to the prompt text. Higher values keep the image closer to the prompt.

    • clipGuidancePreset? string

      The clip guidance preset.

    • height? number

      The desired height of the image(s) in pixels.

    • model? string

      The model that should be used to generate the image(s).

    • negativePrompt? string

      The description of what the generated image(s) should not look like.

    • numberOfImages? number

      The number of images that should be generated.

    • options RecordActionOptions

      The options for the action.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • prompt string

      The description of what the generated image(s) should look like.

    • sampler? string

      The sampler to use for the diffusion process.

    • seed? number

      The random noise seed that should be used.

    • steps? number

      The number of diffusion steps to run.

    • stylePreset? string

      The style preset that should be used to guide the image model torwards a specific style.

    • taskId (string | number)

      The ID of the async task.

    • type "ai_generate_image"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

    • width? number

      The desired width of the image(s) in pixels.

  • AIGenerateImageInterfaceRequest

    Members

    • cfgScale? number

      How strictly the diffusion process adheres to the prompt text. Higher values keep the image closer to the prompt.

    • clipGuidancePreset? string

      The clip guidance preset.

    • height? number

      The height of the output image(s) in pixels.

    • model string

      The model that should be used to generate the image(s).

    • negativePrompt? string

      The description of what the image should not be.

    • numberOfImages? number

      The number of images that should be generated.

    • prompt string

      The description of the desired image.

    • sampler? string

      The sampler to use for the diffusion process.

    • seed? number

      The random noise seed that should be used.

    • steps? number

      The number of diffusion steps to run.

    • stylePreset? string

      The style preset that should be used to guide the image model torwards a specific style.

    • userId? string

      The ID of the user that is making the request.

    • width? number

      The width of the output image(s) in pixels.

  • AIGenerateSkyboxInterface

    Defines an interface that is able to send and receive AI chat messages.

    Members

  • AIGenerateSkyboxInterfaceRequest

    Members

  • AIHumeFeaturesConfiguration

    Members

    • allowed boolean

      Whether Hume AI features are allowed.

    • creditFeePerAccessToken? bigint

      The number of credits that are charged for each token processed by Hume AI.

  • AIHumeGetAccessTokenAction

    An event that is used to generate an image using AI.

    Members

    • options RecordActionOptions

      The options that the action should use.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • recordName? string

      The name of the record that the access token should be retrieved for.

    • taskId (string | number)

      The ID of the async task.

    • type "ai_hume_get_access_token"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • AIImageMetrics

    Members

    • createdAtMs number

      The unix time in miliseconds of when the metrics were created.

    • squarePixels number

      The number of square pixels that have been used. This is the number of pixels squared.

    • studioId? string

      The ID of the studio that the metrics are for.

    • userId? string

      The ID of the user that the metrics are for.

  • AIImageSubscriptionMetrics

    Members

    • currentPeriodEndMs number

      The unix time in miliseconds of the end of the current subscription period.

    • currentPeriodStartMs number

      The unix time in miliseconds of the start of the current subscription period.

    • ownerId string

    • recordName? string

    • stripeAccountId string

      The ID of the stripe account that the record is associated with. Null if a stripe account is not associated with the record.

    • stripeAccountStatus StripeAccountStatus

      The status of the stripe account that the record is associated with. Null if a stripe account is not associated with the record.

    • studioId string

    • subscriptionId string

      The ID of the subscription.

    • subscriptionStatus string

      The status of the subscription.

    • subscriptionType ("user" | "studio")

      The type of the subscription.

    • totalSquarePixelsInCurrentPeriod number

      The total number of pixels that have been generated for the current period.

    • userId? string

  • AIOpenAIRealtimeInterface

    Members

  • AIOpenAIRealtimeMetrics

    Members

    • createdAtMs number

      The unix time in miliseconds of when the metrics were created.

    • request RealtimeSessionRequest

      The request that was used to create the session.

    • sessionId string

      The ID of the session that was created.

    • studioId? string

      The ID of the studio that the metrics are for.

    • userId? string

      The ID of the user that the metrics are for.

  • AIOpenAIRealtimeSubscriptionMetrics

    Members

    • currentPeriodEndMs number

      The unix time in miliseconds of the end of the current subscription period.

    • currentPeriodStartMs number

      The unix time in miliseconds of the start of the current subscription period.

    • ownerId string

    • recordName? string

    • stripeAccountId string

      The ID of the stripe account that the record is associated with. Null if a stripe account is not associated with the record.

    • stripeAccountStatus StripeAccountStatus

      The status of the stripe account that the record is associated with. Null if a stripe account is not associated with the record.

    • studioId string

    • subscriptionId string

      The ID of the subscription.

    • subscriptionStatus string

      The status of the subscription.

    • subscriptionType ("user" | "studio")

      The type of the subscription.

    • totalSessionsInCurrentPeriod number

      The total number of realtime sessions that have been created in the period.

    • userId? string

  • AISkyboxMetrics

    Members

    • createdAtMs number

      The unix time in miliseconds of when the metrics were created.

    • skyboxes number

      The number of skyboxes that have been used.

    • studioId? string

      The ID of the studio that the metrics are for.

    • userId? string

      The ID of the user that the metrics are for.

  • AISkyboxSubscriptionMetrics

    Members

    • currentPeriodEndMs number

      The unix time in miliseconds of the end of the current subscription period.

    • currentPeriodStartMs number

      The unix time in miliseconds of the start of the current subscription period.

    • ownerId string

    • recordName? string

    • stripeAccountId string

      The ID of the stripe account that the record is associated with. Null if a stripe account is not associated with the record.

    • stripeAccountStatus StripeAccountStatus

      The status of the stripe account that the record is associated with. Null if a stripe account is not associated with the record.

    • studioId string

    • subscriptionId string

      The ID of the subscription.

    • subscriptionStatus string

      The status of the subscription.

    • subscriptionType ("user" | "studio")

      The type of the subscription.

    • totalSkyboxesInCurrentPeriod number

      The total number of skyboxes that have been generated for the current period.

    • userId? string

  • AISloydFeaturesConfiguration

    Members

    • allowed boolean

      The Sloyd AI features are allowed.

    • maxModelsPerPeriod? number

      The maximum number of models that can be generated per subscription period. If not specified, then there is no limit.

  • AISloydGenerateModelAction

    An event that is used to generate a model using Sloyd AI.

    Members

    • baseModelId? string

      The ID of the model that the new model should be based on.

    • levelOfDetail? number

      The level of detail that should be used. Higher values will result in more detailed models. Should be between 0.01 and 1. Defaults to 0.5.

    • options RecordActionOptions

      The options that the action should use.

    • outputMimeType? ("model/gltf+json" | "model/gltf-binary")

      The MIME type that should be used for the model. If omitted, then "model/gltf+json" will be used.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • prompt string

      The prompt to use for the model.

    • recordName? string

      The name of the record that should be used. If omitted, then the ID of the user will be used.

    • taskId (string | number)

      The ID of the async task.

    • thumbnail? object

      The options for the thumbnail for the model. If omitted, then no thumbnail will be generated.

    • type "ai_sloyd_generate_model"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • AISloydMetrics

    Members

    • baseModelId? string

      The ID of the model that the created model is based on.

    • confidence? number

      The confidence of the AI in the created model.

    • createdAtMs number

      The unix time in miliseconds of when the metrics were created.

    • mimeType string

      The MIME type of the model.

    • modelData string

      The data for the model. If the mimeType is "model/gltf+json", then this will be a JSON string. If the mimeType is "model/gltf-binary", then this will be a base64 encoded string.

    • modelId string

      The ID of the model that was created. ("interactionId" in the sloyd interface)

    • modelsCreated number

      The number of models that were created in this metric.

    • name? string

      The name of the model that was created.

    • studioId? string

      The ID of the studio that the metrics are for.

    • thumbnailBase64? string

      The base64 encoded thumbnail of the model.

    • userId? string

      The ID of the user that the metrics are for.

  • AISloydSubscriptionMetrics

    Members

    • currentPeriodEndMs number

      The unix time in miliseconds of the end of the current subscription period.

    • currentPeriodStartMs number

      The unix time in miliseconds of the start of the current subscription period.

    • ownerId string

    • recordName? string

    • stripeAccountId string

      The ID of the stripe account that the record is associated with. Null if a stripe account is not associated with the record.

    • stripeAccountStatus StripeAccountStatus

      The status of the stripe account that the record is associated with. Null if a stripe account is not associated with the record.

    • studioId string

    • subscriptionId string

      The ID of the subscription.

    • subscriptionStatus string

      The status of the subscription.

    • subscriptionType ("user" | "studio")

      The type of the subscription.

    • totalModelsInCurrentPeriod number

      The total number of sloyd.ai items that have been created for the current period.

    • userId? string

  • APIInvoiceContractRequest

    Members

  • APIPayoutRequest

    Members

  • APIPurchaseContractRequest

    Members

    • address string

    • currency "usd"

    • expectedCost number

    • recordName string

    • returnUrl string

    • successUrl string

  • APISubscription

    Members

    • creditGrant? (number | "match-invoice")

      The number of credits that should be granted to the user/studio upon purchasing (and renewal) of this subscription. Defaults to 0.

    • defaultSubscription? boolean

      Whether this subscription should be the default.

    • description? string

      The description of the subscription. Ignored if a Stripe product is specified.

    • eligibleProducts? string[]

      The list of products that are eligible for this subscription tier.

    • featureList string[]

      The list of features that should be shown for this subscription tier.

    • id string

      The ID of the subscription. Only used for the API.

    • name? string

      The name of the subscription. Ignored if a Stripe product is specified.

    • product? string

      The ID of the product that needs to be purchased for the subscription. If omitted, then this subscription will be shown but not able to be purchased.

    • purchasable? boolean

      Whether the subscription should be offered for purchase. Defaults to true.

    • studioOnly? boolean

      Whether the subscription is only purchasable by studios.

    • tier? string

      The tier that the subscription represents. Defaults to "beta".

    • userOnly? boolean

      Whether the subscription is only purchasable by users.

  • AccountBalances

    Represents the balances of a user/studio/contract's financial accounts.

    Members

    • credits AccountBalance

      The credits account balance.

      This will be undefined if the user does not have a credits account.

    • usd AccountBalance

      The USD account balance.

      This will be undefined if the user does not have a USD account.

  • ActivationKey

    Defines an interface for a key that can be used to activate a purchased item.

    Members

    • id string

      The ID of the activation key.

    • secretHash string

      The hash of the secret for the key.

  • AddBotAction

    Defines a bot event that indicates a bot was added to the state.

    Members

    • bot Bot

    • id string

    • type "add_bot"

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • AddBotMapLayerAction

    Defines an interface for actions that represent asynchronous tasks.

    Members

    • botId string

      The ID of the bot that should be drawn on.

    • overlay object

      Layer configuration

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • taskId (string | number)

      The ID of the async task.

    • type "add_bot_map_layer"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • AddCustomDomainRequest

    Members

    • domain string

      The domain name.

    • studioId string

      The ID of the studio that the domain should be added to.

    • userId string

      The ID of the currently logged in user.

    • userRole? UserRole

      The role of the currently logged in user.

  • AddDropGridTargetsAction

    An event that is used to add grids as possible drop locations for a drag operation.

    Members

    • botId? string

      The ID of the bot that, when it is a drop target, the snap points should be enabled. If null, then the targets apply globally during the drag operation.

    • targets SnapGrid[]

      The list of grids that bots should be snapped to.

    • type "add_drop_grid_targets"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • AddStudioMemberRequest

    Members

    • addedDisplayName? string

      The display name of the user that should be added to the studio.

    • addedEmail? string

      The email address of the user that should be added to the studio.

    • addedPhoneNumber? string

      The phone number of the user that should be added to the studio.

    • addedUserId? string

      The ID of the user that should be added to the studio.

    • role StudioAssignmentRole

      The role that the added user should have in the studio.

    • studioId string

      The ID of the studio.

    • userId string

      The ID of the user that is currently logged in.

  • AddUpdatesRequest

    Members

    • branch string

      The branch that the updates are for.

    • initial? boolean

      Whether this message should be treated as the first message after a watch_branch event. This flag MUST be included on the first message as large apiary messages may appear out of order.

    • inst string

      The name of the inst.

    • recordName string

      The name of the record that the branch is for. Null if the branch should be public and non-permanent.

    • timestamps? number[]

      The list of timestamps that the updates occurred at.

    • updates string[]

      The updates that should be added.

    • userId string

      The ID of the currently logged in user.

    • userRole? UserRole

      The role of the currently logged in user.

  • AnimateTagAction

    Defines an event that animates a tag on a bot over some time.

    Members

    • botId string

      The ID of the bot to animate.

    • options AnimateTagOptions

      The options to use for the animation.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • tag string

      The tag to animate.

    • taskId (string | number)

      The ID of the async task.

    • type "animate_tag"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • AnimateTagOptions

    Defines the options that can be used to animate a tag.

    Members

    • duration number

      The number of seconds that the animation executes over.

    • easing Easing

      The easing that should be used.

    • fromValue any

      The value to animate from.

    • tagMaskSpace (false | Space)

      The space that the tag should be animated in. If set to false, then the tag on the bot will be modified.

    • toValue any

      The value to animate to.

  • AnthropicAIChatOptions

    Members

    • apiKey string

      The API key to use.

  • ApplyStateAction

    An eventBotsStatesome generic BotsState to the current state. This is useful when you have some generic bot state and want to just apply it to the current state. An example of doing this is from the automatic merge system.

    Members

    • type "apply_state"

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • ApplyUpdatesToInstAction

    Defines an event that applies the given updates to the inst.

    Members

    • type "apply_updates_to_inst"

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

    • updates InstUpdate[]

      The updates that should be applied.

  • AssignedRole

    Members

    • expireTimeMs number

      The Unix time in miliseconds that the role assignment expires. If null, then the role assignment never expires.

    • role string

      The name of the role.

  • AsyncAction

    Defines an interface for actions that represent asynchronous tasks.

    Members

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • taskId (string | number)

      The ID of the async task.

    • type string

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • AsyncErrorAction

    Defines an action that supplies an error for an AsyncRequestAction.

    Members

    • error any

      The error.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • taskId (string | number)

      The ID of the async task.

    • type "async_error"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • AsyncResultAction

    Defines an action that supplies a result for an AsyncRequestAction.

    Members

    • mapBotsInResult? boolean

      Whether to map any bots found in the result to their actual bot counterparts. Defaults to false.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • result any

      The result value.

    • taskId (string | number)

      The ID of the async task.

    • type "async_result"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • AuthCheckoutSession

    Defines an interface that represents a checkout session for a purchasable item.

    Members

    • fulfilledAtMs number

      The unix time in miliseconds that the checkout session has been fulfilled at by granting the user access to their items.

      For contracts, this means opening the contract.

    • id string

      The ID of the session.

    • invoiceId string

      The ID of the invoice that the session has. Null if no invoice was created for the checkout session.

    • items AuthCheckoutSessionItem[]

      The items that are in the checkout session.

    • paid boolean

      Whether the checkout session has been paid for or not.

    • shouldBeAutomaticallyFulfilled? boolean

      Whether the checkout session should be automatically fulfilled once payment completes.

    • stripeCheckoutSessionId string

      The ID of the stripe checkout session that is associated with this session. If null, then the session is not associated with a stripe checkout session.

    • stripePaymentStatus CheckoutSessionPaymentStatus

      The payment status of the checkout session.

    • stripeStatus CheckoutSessionStatus

      The status of the checkout session.

    • transactionId? string

      The transaction ID that should be associated with the checkout session.

    • transferIds? string[]

      The transfers that have been posted for the checkout session.

    • transfersPending? boolean

      Wether the transfers are currently pending.

    • userId string

      The ID of the user that the checkout session is for.

  • AuthController

    Defines a class that is able to authenticate users.

    Members

  • AuthInvoice

    Members

    • checkoutSessionId string

      The ID of the checkout session that this invoice is for. Null if no checkout session is associated with this invoice.

    • currency string

      The three-letter ISO code for the currency that the invoice is in.

    • description string

      The description of the invoice.

    • id string

    • paid boolean

      Whether the invoice is paid.

    • periodId string

      The ID of the subscription period that this invoice is for. Null if no subscription period is associated with this invoice.

    • status string

      The status of the invoice.

    • stripeHostedInvoiceUrl string

      The URL of the stripe hosted invoice. Users can use this to pay and see the invoice.

    • stripeInvoiceId string

      The ID of the stripe invoice that is associated with this invoice.

    • stripeInvoicePdfUrl string

      The URL of the stripe hosted invoice PDF.

    • subscriptionId string

      The ID of the subscription that this invoice is for. Null if no subscription is associated with this invoice.

    • subtotal number

      The subtotal of the invoice.

    • tax number

      The amount of tax collected.

    • total number

      The amount of the invoice in the smallest unit of the currency.

  • AuthLoginRequest

    Defines an interface that represents the data a login request contains.

    Members

    • address string

      The address that the request is for.

    • addressType AddressType

      The type of address that the request is for.

    • attemptCount number

      The number of attempts made to complete the request.

    • completedTimeMs number

      The unix timestamp in miliseconds that the request was completed at. If null, then the request has not been completed.

    • expireTimeMs number

      The unix timestamp in miliseconds that the request will expire at.

    • ipAddress string

      The IP Address that the request came from.

    • requestId string

      The ID of the request.

    • requestTimeMs number

      The unix timestamp in miliseconds that the request was made at.

    • secretHash string

      The hash that the request should match.

    • userId string

      The ID of the user that the login request is for.

  • AuthOpenIDLoginRequest

    Defines an interface that represents a login request for an Open ID login.

    Members

    • authorizationCode? string

      The authorization code that was recieved for the request.

    • authorizationTimeMs? number

      The unix timestamp that the authorization code was registered for the login request. Null/undefined if the request has not been authorized yet.

    • authorizationUrl string

      The URL that was used as the authorization URL in the Open ID authorization code flow.

    • codeMethod string

      The code challenge method that the Open ID authorization response should match.

    • codeVerifier string

      The code that the Open ID authorization response should match.

    • completedTimeMs number

      The unix timestamp in miliseconds that the request was completed at. If null, then the request has not been completed.

    • expireTimeMs number

      The unix timestamp in miliseconds that the request will expire at.

    • ipAddress string

      The IP Address that the request came from.

    • provider string

      The name of the provider that was used for the Open ID login.

    • redirectUrl string

      The URL that was used as the redirect URL in the Open ID authorization code flow.

    • requestId string

      The ID of the request.

    • requestTimeMs number

      The unix timestamp in miliseconds that the request was made at.

    • scope string

      The scope that was requested.

    • state string

      The state generated for the request.

  • AuthSession

    Defines an interface that represents a login session for the user.

    Members

    • connectionSecret string

      The secret of the token that provides connection access to this session.

    • expireTimeMs number

      The unix timestamp in miliseconds that the session will expire at. If null, then the session does not expire.

    • grantedTimeMs number

      The unix timestamp in miliseconds that the session was granted at.

    • ipAddress string

      The IP Address that the session was granted to.

    • nextSessionId string

      The ID of the next session that replaced this session.

    • oidAccessToken? string

      The access token that was granted to the session by the Open ID provider. If null, then Open ID was not used for the session.

    • oidExpiresAtMs? number

      The unix timestamp in seconds that the oidAccessToken expires at. If null, then Open ID was not used for the session.

    • oidIdToken? string

      The ID token that was granted to the session by the Open ID provider. If null, then Open ID was not used for the session.

    • oidProvider? string

      The name of the Open ID provider that was used to obtain this session. If null, then Open ID was not used for the session.

    • oidRefreshToken? string

      The refresh token that was granted to the session by the Open ID provider. If null, then Open ID was not used for the session.

    • oidRequestId? string

      The ID of the OpenID login request that aws used to obtain this session.

    • oidScope? string

      The Open ID scope that was granted to the session. If null, then Open ID was not used for the session.

    • oidTokenType? string

      The type of the access token that was granted to the session by the Open ID provider. If null, then Open ID was not used for the session.

    • previousSessionId string

      The ID of the previous session that was used to obtain this session.

    • requestId string

      The ID of the login request that was used to obtain this session.

    • revocable? boolean

      Whether the session is able to be revoked by the user. Setting this to false will prevent the user from revoking the session. Additionally, users will not be able to replace the session either. If false, then the session cannot be revoked by the user. If true, then the session can be revoked by the user. Default is true.

    • revokeTimeMs number

      The unix timestamp in miliseconds that the session was revoked at. If null, then the session has not been revoked.

    • secretHash string

      The hash of the token that provides access to this session.

    • sessionId string

      The ID of the session.

    • userId string

      The ID of the user that the session is for.

    • webauthnRequestId? string

      The ID of the WebAuthn login request that was used to obtain this session.

  • AuthSessionInfo

    Members

    • connectionKey string

      The connection key that provides websocket access for the session.

    • expireTimeMs number

      The unix timestamp in miliseconds that the session will expire at. If null, then the session will not expire.

    • metadata UserLoginMetadata

      Extra metadata for the user.

    • sessionKey string

      The secret key that provides access for the session.

    • userId string

      The ID of the user that the session is for.

  • AuthStore

    Defines an interface that represents an auth store.

    Members

    • createActivationKey(key: ActivationKey): Promise<void>

      Creates the given activation key.

      The first parameter is a ActivationKey and is the key.

    • deleteUserAuthenticator(userId: string, authenticatorId: string): Promise<number>

      Deletes the authenticator with the given ID. Returns the number of items that were deleted.

      The first parameter is a string and is the ID of the user whose authenticator should be deleted.

      The second parameter is a string and is the ID of the authenticator that should be deleted.

    • findLoginRequest(userId: string, requestId: string): Promise<AuthLoginRequest>

      Finds a login request for the given user and request ID.

      The first parameter is a string and is the ID of the user.

      The second parameter is a string and is the ID of the request.

    • findOpenIDLoginRequest(requestId: string): Promise<AuthOpenIDLoginRequest>

      Finds the login request for the given request ID.

      The first parameter is a string and is the ID of the Open ID login request.

    • findOpenIDLoginRequestByState(state: string): Promise<AuthOpenIDLoginRequest>

      Finds the login request for the given state.

      The first parameter is a string and is the state that the request contains.

    • findSession(userId: string, sessionId: string): Promise<AuthSession>

      Finds a login session for the given user and session ID.

      The first parameter is a string and is the ID of the user.

      The second parameter is a string and is the ID of the session.

    • findUser(userId: string): Promise<AuthUser>

      Finds the user with the given ID.

      The first parameter is a string and is the ID of the user.

    • findUserAuthenticatorByCredentialId(credentialId: string): Promise<AuthUserAuthenticatorWithUser>

      Finds the authenticator with the given credentialId. Includes the user that the authenticator is for. Returns an object with null properties if the authenticator could not be found.

      The first parameter is a string and is the ID of the credential that the authenticator should represent.

    • findUserByAddress(address: string, addressType: AddressType, loginStudioId?: string): Promise<AuthUser>

      Finds the user that represents the given address.

      The first parameter is a string and is the address.

      The second parameter is a AddressType and is the type of the address.

      The third parameter is optional and is a string and is the ID of the studio that the user is logging into.

    • findUserByPrivoServiceId(serviceId: string): Promise<AuthUser>

      Finds the user that is associated with the given Privo Service ID.

      The first parameter is a string and

    • findUserByStripeAccountId(accountId: string): Promise<AuthUser>

      Finds the user that is associated with the given Stripe Account ID.

      The first parameter is a string and is the ID of the account.

    • findUserByStripeCustomerId(customerId: string): Promise<AuthUser>

      Finds the user that is associated with the given Stripe Customer ID.

      The first parameter is a string and is the ID of the customer.

    • findUserLoginMetadata(userId: string): Promise<UserLoginMetadata>

      Finds the metadata for the given user ID. If the user does not exist, then null is returned.

      The first parameter is a string and is the ID of the user.

    • findWebAuthnLoginRequest(requestId: string): Promise<AuthWebAuthnLoginRequest>

      Finds the WebAuthn login request with the given request ID.

      The first parameter is a string and is the ID of the request.

    • getActivationKeyById(keyId: string): Promise<ActivationKey>

      Gets the activation key with the given ID. Returns null if the key could not be found.

      The first parameter is a string and is the ID of the key.

    • getCheckoutSessionById(id: string): Promise<AuthCheckoutSession>

      Gets the checkout session with the given ID. Returns null if the session could not be found.

      The first parameter is a string and is the ID of the checkout session.

    • getInvoiceById(id: string): Promise<AuthInvoice>

      Gets the invoice with the given ID.

      The first parameter is a string and is the ID of the invoice.

    • getInvoiceByStripeId(id: string): Promise<AuthInvoice>

      Gets the invoice with the given stripe ID.

      The first parameter is a string and is the ID of the invoice.

    • getSubscriptionById(id: string): Promise<AuthSubscription>

      Gets the subscription with the given ID.

      The first parameter is a string and is the ID of the subscription.

    • getSubscriptionByStripeSubscriptionId(id: string): Promise<AuthSubscription>

      Gets the subscription with the given stripe subscription ID.

      The first parameter is a string and is the ID of the stripe subscription.

    • getSubscriptionPeriodById(id: string): Promise<AuthSubscriptionPeriod>

      Gets the subscription period with the given ID.

      The first parameter is a string and is the ID of the subscription period.

    • incrementLoginRequestAttemptCount(userId: string, requestId: string): Promise<void>

      Increments the attempt count for the given login request.

      The first parameter is a string and is the ID of the user.

      The second parameter is a string and is the ID of the login request.

    • listEmailRules(): Promise<RegexRule[]>

      Gets the list of email rules.

    • listPurchasedItemsByActivationKeyId(keyId: string): Promise<PurchasedItem[]>

      Gets the list of purchased items that are associated with the given activation key.

      The first parameter is a string and is the ID of the key.

    • listSessions(userId: string, expireTimeMs: number): Promise<ListSessionsDataResult>

      Lists the sessions that belong to the given user.

      The first parameter is a string and is the ID of the user.

      The second parameter is a number and is the expiration time that the list should start after.

    • listSmsRules(): Promise<RegexRule[]>

      Gets the list of SMS rules.

    • listSubscriptionPeriodsBySubscriptionId(subscriptionId: string): Promise<AuthSubscriptionPeriod[]>

      Gets the subscription periods that belong to the given subscription.

      The first parameter is a string and is the ID of the subscription.

    • listUserAuthenticators(userId: string): Promise<AuthListedUserAuthenticator[]>

      Gets the list of authenticators for the given user.

      The first parameter is a string and is the ID of the user.

    • markCheckoutSessionFulfilled(sessionId: string, fulfilledAtMs: number): Promise<void>

      Marks the checkout session with the given ID as fulfilled.

      The first parameter is a string and is the ID of the checkout session.

      The second parameter is a number and is the unix time in miliseconds that the session was fulfilled at.

    • markLoginRequestComplete(userId: string, requestId: string, completedTimeMs: number): Promise<void>

      Marks the login request as completed.

      The first parameter is a string and is the ID oof the user.

      The second parameter is a string and is the ID of the request.

      The third parameter is a number and is the time that the request was completed.

    • markOpenIDLoginRequestComplete(requestId: string, completedTimeMs: number): Promise<void>

      Marks the login request as completed.

      The first parameter is a string and is the ID of the request.

      The second parameter is a number and is the time that the request was completed.

    • markWebAuthnLoginRequestComplete(requestId: string, userId: string, completedTimeMs: number): Promise<void>

      Marks the login request as completed.

      The first parameter is a string and is the ID of the request.

      The second parameter is a string and is the ID of the user that completed the request.

      The third parameter is a number and is the time that the request was completed.

    • replaceSession(session: AuthSession, newSession: AuthSession, revokeTimeMs: number): Promise<void>

      Marks the given session as replaced by the new session and saves the new session.

      The first parameter is a AuthSession and is the session that was replaced.

      The second parameter is a AuthSession and is the new session.

      The third parameter is a number and is the time that the old session is to be revoked at. (Usually now)

    • saveInvoice(invoice: AuthInvoice): Promise<void>

      Creates or updates the given invoice.

      The first parameter is a AuthInvoice and is the invoice that should be saved.

    • saveLoginRequest(request: AuthLoginRequest): Promise<AuthLoginRequest>

      Saves the given login request.

      The first parameter is a AuthLoginRequest and is the request that should be saved.

    • saveNewUser(user: AuthUser): Promise<SaveNewUserResult>

      Attempts to save the given user as a new user.

      The first parameter is a AuthUser and is the user that should be saved.

    • saveOpenIDLoginRequest(request: AuthOpenIDLoginRequest): Promise<AuthOpenIDLoginRequest>

      Saves the given login request.

      The first parameter is a AuthOpenIDLoginRequest and is the request that should be saved.

    • saveOpenIDLoginRequestAuthorizationCode(requestId: string, authorizationCode: string, authorizationTimeMs: number): Promise<void>

      Saves the given authorization code for the given login request.

      The first parameter is a string and is the ID of the request.

      The second parameter is a string and is the authorization code that should be saved.

      The third parameter is a number and is the time of the authorization.

    • savePurchasedItem(item: PurchasedItem): Promise<void>

      Creates or updates the given purchased item.

      The first parameter is a PurchasedItem and is the item.

    • saveSession(session: AuthSession): Promise<void>

      Saves the given login session.

      The first parameter is a AuthSession and is the session that should be saved.

    • saveSubscription(subscription: AuthSubscription): Promise<void>

      Creates or updates the given subscription.

      The first parameter is a AuthSubscription and is the subscription to save.

    • saveSubscriptionPeriod(period: AuthSubscriptionPeriod): Promise<void>

      Creates or updates the given subscription period.

      The first parameter is a AuthSubscriptionPeriod and is the subscription period.

    • saveUser(user: AuthUser): Promise<void>

      Adds or updates the given user.

      The first parameter is a AuthUser and is the user that should be saved.

    • saveUserAuthenticator(authenticator: AuthUserAuthenticator): Promise<void>

      Saves the given authenticator.

      The first parameter is a AuthUserAuthenticator and is the authenticator that should be saved.

    • saveUserAuthenticatorCounter(id: string, newCounter: number): Promise<void>

      Saves the counter for the given authenticator.

      The first parameter is a string and is the ID of the authenticator.

      The second parameter is a number and is the counter that should be saved.

    • saveWebAuthnLoginRequest(request: AuthWebAuthnLoginRequest): Promise<AuthWebAuthnLoginRequest>

      Saves the given WebAuthn login request.

      The first parameter is a AuthWebAuthnLoginRequest and is the request that should be saved.

    • setCurrentLoginRequest(userId: string, requestId: string): Promise<void>

      Sets the ID of the login request that is allowed to be completed for the given user. At any particular moment, only one login request is allowed to be completed by a user. This is used to help mitigate distributed brute force attacks. (i.e. attacks that try generating a lot of login requests and guessing the codes)

      The first parameter is a string and is the ID of the user.

      The second parameter is a string and is the ID of the login request.

    • setCurrentWebAuthnChallenge(userId: string, challenge: string): Promise<void>

      Sets the current WebAuthn challenge that the user is trying to complete. At any particular moment, only one WebAuthn challenge is allowed to be completed by a user.

      The first parameter is a string and is the ID of the user.

      The second parameter is a string and is the challenge.

    • setRevokeAllSessionsTimeForUser(userId: string, allSessionRevokeTimeMs: number): Promise<void>

      Sets the time that all sessions are revoked on the specified user.

      The first parameter is a string and is the ID of the user that all sessions should be revoked for.

      The second parameter is a number and is the unix time that should be recorded.

    • updateCheckoutSessionInfo(request: UpdateCheckoutSessionRequest): Promise<void>

      Updates the info for a checkout session.

      The first parameter is a UpdateCheckoutSessionRequest and is the

    • updateSubscriptionInfo(request: UpdateSubscriptionInfoRequest): Promise<void>

      Updates the subscription info for a user/studio.

      This will create/update a subscription object, update the info on the user/studio and subscription, and optionally update the period of the subscription.

      The first parameter is a UpdateSubscriptionInfoRequest and is the request.

    • updateSubscriptionPeriod(request: UpdateSubscriptionPeriodRequest): Promise<void>

      Updates the subscription period for a user/studio.

      This will update the period of the subscription, and optionally create subscription objects for the user/studio if neccesary.

      The first parameter is a UpdateSubscriptionPeriodRequest and is the request.

  • AuthSubscription

    Members

    • currentPeriodEndMs number

      The unix time in miliseconds that the current subscription period ends at.

    • currentPeriodStartMs number

      The unix time in miliseconds that the current subscription period started at.

    • id string

    • stripeCustomerId string

      The ID of the stripe customer that is associated with this subscription.

    • stripeSubscriptionId string

    • studioId string

    • subscriptionId string

      The ID of the purchasable subscription that the user has. Note that this is the ID of the subscription in the config, not the ID of the stripe subscription.

    • subscriptionStatus string

      The current status of the subscription.

    • userId string

  • AuthSubscriptionPeriod

    Members

    • id string

    • invoiceId string

      The ID of the invoice for this period.

    • periodEndMs number

      The unix time in miliseconds that the subscription period ends at.

    • periodStartMs number

      The unix time in miliseconds that the subscription period started at.

    • subscriptionId string

      The ID of the subscription that this period is for.

  • AuthUser

    Members

    • allSessionRevokeTimeMs number

      The last Unix time that all the sessions were revoked at.

    • avatarPortraitUrl? string

    • avatarUrl? string

    • banReason? "terms_of_service_violation"

      The reason for the ban.

    • banTimeMs? number

      The Unix time in miliseconds that the user was banned. If set to any positive number, then the user should be considered banned and unable to perform any operations. Null/undefined if the user is not banned and allowed access into the system.

    • currentLoginRequestId string

      The ID of the current login request. At any particular moment, only one login request is allowed to be completed by a user. This is used to help mitigate distributed brute force attacks. (i.e. attacks that try generating a lot of login requests and guessing the codes)

    • currentWebAuthnChallenge? string

      The current WebAuthn challenge that the user is trying to complete.

    • email string

      The email address of the user. Possible to use for login.

    • id string

      The ID of the user.

    • loginStudioId? string

      The Studio that this user logs into. Used to differentiate between users who belong to the primary instance and users who belong to a comId. Note that this does not grant any permissions to the studio. It only separates users via comId.

      If null, then the user does not log into a studio, but instead logs into CasualOS proper.

    • name? string

      The name of the user.

    • phoneNumber string

      The SMS phone number of the user. Possible to use for login.

    • privacyFeatures? PrivacyFeatures

      The privacy-related features that the user has access to. If null or omitted, then the user has access to all features.

    • privoConsentUrl? string

      The URL that the user or user's parent can visit to grant consent for the user to use the system.

    • privoParentServiceId? string

      The Privo Service ID of the parent of this user.

    • privoServiceId? string

      The Privo Service ID that this user is associated with.

    • requestedRate? number

      The rate at which the user is requesting payment (null if not yet specified)

    • role? UserRole

      The role that the user has been assigned in the system.

    • stripeAccountId? string

      The user's connected stripe account ID.

    • stripeAccountRequirementsStatus? StripeRequirementsStatus

      The user's connected stripe account requirements status.

    • stripeAccountStatus? StripeAccountStatus

      The user's connected stripe account status.

    • stripeCustomerId? string

      The ID of the stripe customer that is associated with this user.

    • subscriptionId? string

      The ID of the purchasable subscription that the user has. Note that this is the ID of the subscription in the config, not the ID of the stripe subscription.

    • subscriptionInfoId? string

      The ID of the subscription that this user record references.

    • subscriptionPeriodEndMs? number

      The unix time in miliseconds that the user's current subscription period ends at.

    • subscriptionPeriodStartMs? number

      The unix time in miliseconds that the user's current subscription period started at.

    • subscriptionStatus? string

      The current status of the user's subscription.

  • AuthUserAuthenticator

    Members

    • aaguid string

      The AAGUID of the authenticator that the credential uses.

    • counter number

      The counter for the credential.

    • createdAtMs number

      The unix time in miliseconds that the authenticator was created at.

    • credentialBackedUp boolean

      Whether the credential is backed up.

    • credentialDeviceType CredentialDeviceType

      The device type of the credential.

    • credentialId string

      The ID of the credential that this authenticator is for.

    • credentialPublicKey Uint8Array

      The public key of the credential.

    • id string

      The ID of the authenticator.

    • registeringUserAgent string

      The user agent of the browser that registered the authenticator. Null if the authenticator was not registered by a user agent.

    • userId string

      The ID of the user that this authenticator is for.

  • AuthUserAuthenticatorWithUser

    Members

  • AuthWebAuthnLoginRequest

    Members

    • challenge string

      The challenge that the request should match.

    • completedTimeMs number

      The unix timestamp in miliseconds that the request was completed at. If null, then the request has not been completed.

    • expireTimeMs number

      The unix timestamp in miliseconds that the request will expire at.

    • ipAddress string

      The IP Address that the request came from.

    • requestId string

      The ID of the request.

    • requestTimeMs number

      The unix timestamp in miliseconds that the request was made at.

    • userId string

      The ID of the user that the request was completed for. Null if the request has not been completed.

  • AuthorizationContext

    Members

    • recordKeyCreatorId string

      The ID of the user who created the record key.

    • recordKeyProvided boolean

      Whether a record key was provided.

    • recordKeyResult ValidatePublicRecordKeyResult

      The result of validating the record key if one was provided. Null if a record key was not provided.

    • recordName string

      The name of the record.

    • recordOwnerId string

      The ID of the user that owns the record. Null if the record is owned by a studio.

    • recordOwnerPrivacyFeatures PrivacyFeatures

      The privacy features of the user that owns the record.

    • recordStudioId string

      The ID of the studio that owns the record. Null if the record is owned by a user.

    • recordStudioMembers? ListedStudioAssignment[]

      The list of members that are assigned to the studio. Null if the record is owned by a user.

    • sendNotLoggedIn boolean

      Whether to send not_logged_in results when the user has not provided any authentication mechanism, but needs to.

    • subjectPolicy PublicRecordKeyPolicy

      The subject policy that is used for the record key.

    • userId string

      The ID of the user that is currently logged in. Null if the user is not logged in.

    • userPrivacyFeatures PrivacyFeatures

      The privacy features of the user that is currently logged in.

    • userRole UserRole

      The role of the user that is currently logged in.

  • AuthorizeSubjectRequest

    Members

    • action ActionKinds

      The kind of the action.

    • markers string[]

      The markers that are applied to the resource.

    • resourceId? string

      The ID of the resource. Should be omitted if the action is "list".

    • resourceKind ResourceKinds

      The kind of resource that the action is being performed on.

    • subjectId string

      The ID of the subject that should be authorized. If null, then the currently logged in user will be used if available.

    • subjectType SubjectType

      The type of the subject that should be authorized.

  • AuthorizeSubjectsRequest

    Members

    • action ActionKinds

      The kind of the action.

    • markers string[]

      The markers that are applied to the resource.

    • resourceId? string

      The ID of the resource. Should be omitted if the action is "list".

    • resourceKind ResourceKinds

      The kind of resource that the action is being performed on.

    • subjects AuthorizeSubject[]

      The list of subjects that should be authorized.

  • AuthorizeUserAndInstancesForResources

    Members

    • instances string[]

      The instances that should be authorized.

    • resources ResourceInfo[]

      The resources that should be authorized.

    • userId string

      The ID of the user that should be authorized.

  • AuthorizeUserAndInstancesRequest

    Members

    • action ActionKinds

      The kind of the action.

    • instances string[]

      The instances that should be authorized.

    • markers string[]

      The markers that are applied to the resource.

    • resourceId? string

      The ID of the resource. Should be omitted if the action is "list".

    • resourceKind ResourceKinds

      The kind of resource that the action is being performed on.

    • userId string

      The ID of the user that should be authorized.

  • AuthorizeUserAndInstancesSuccess

    Members

  • AuxDevice

    Members

    • ab1BootstrapAux? StoredAux

      The stored aux that AB-1 should be bootstraped from.

    • ab1BootstrapUrl string

      The URL that AB-1 should be bootstraped from.

    • allowCollaborationUpgrade boolean

      Whether this device can enable collaboration features after the simulation has started.

    • comID string

      The comID that this inst was loaded from.

      Null if it was not loaded from a comID.

    • isCollaborative boolean

      Whether this device has enabled collaboration features.

      When creating a simulation, this property may be used to enable or disable features that facilitate users interacting with each other. For example, setting isCollaborative to false would make the shared partition act like a tempLocal partition.

    • supportsAR boolean

      Whether the device supports augmented reality features.

    • supportsDOM boolean

      Whether the device supports full Document Object Model features. See https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model for more info.

    • supportsVR boolean

      Whether the device supports virtual reality features.

  • AuxFileOptions

    Members

    • version? (1 | 2)

      The version that should be used for the output file.

      Version 1 stores bots as pure JSON and is the original version of the file format. Version 2 stores bots as updates and is the new version of the file format.

      If not specifed, then version 2 will be used.

  • AuxVersion

    Members

    • alpha (number | boolean)

      Whether this version is an alpha (i.e. test) version.

    • hash string

      The commit of the hash that AUX was built from.

    • major number

      The major portion of the version.

    • minor number

      The minor portion of the version.

    • patch number

      The patch portion of the version.

    • playerMode ("builder" | "player")

      Gets the player mode of this CasualOS version.

      • "player" indicates that the instance has been configured for experiencing AUXes.
      • "builder" indicates that the instance has been configured for building AUXes.
    • version string

      The full version number.

  • BeginAudioRecordingAction

    An event that is used to start audio recording.

    Members

    • bufferRateMilliseconds? number

      The buffer rate in milliseconds that audio recordings should use. When set, the audio will be buffered and sent in chunks at the specified rate. Defaults to 500ms.

    • mimeType? string

      The MIME type that should be produced. Defaults to a containerized format (audio/mp3, audio/webm, etc.) if not specified.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • sampleRate? number

      The number of samples per second (Hz) that audio/x-raw recordings should use. Defaults to 44100 if not specified.

    • stream? boolean

      Whether to stream the audio recording. If streaming is enabled, then

    • taskId (string | number)

      The ID of the async task.

    • type "begin_audio_recording"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • BillingCycleHistory

    Represents a billing cycle. That is, a period of time where users are charged for their usage.

    Members

    • id string

      The ID of the history record.

    • timeMs number

      The time the billing cycle was run at in milliseconds since epoch.

  • BillingStep

    Members

    • billingCode? BillingCodes

      The billing code that should be set on the transfer for this step, if different from the default billing code specified in UsageBillingOptions.

    • cost? (number | bigint)

      If set, completes the pending transfer (if any) and attempts to bill for the remaining amount.

    • initialCost? (number | bigint)

      The initial cost that should be pre-authorized. If specified, then a pending transfer for this amount will be created.

    • transferCode? TransferCodes

      The transfer code that should be used for the billing transfer for this step, if different from the default transfer code specified in UsageBillingOptions.

  • BlockadeLabsGenerateSkyboxInterfaceOptions

    Members

    • apiKey string

  • Bot

    Defines an interface for a bot.

    Members

    • id string

      The ID of the bot.

    • masks? TagMasks

      The set of tag masks that have been applied to the bot.

    • signatures? BotSignatures

      The set of signatures that the bot contains.

    • space? Space

      The space the bot lives in.

    • tags Tags

      The set of tags that the bot contains.

  • BotDropDestination

    Members

  • BotDropToDestination

    Members

  • BranchName

    Members

    • branch string

      The name of the branch.

    • inst string

      The name of the inst that the branch is stored in.

    • recordName string

      The name of the record that the branch is stored in.

  • BranchRecord

    Members

    • branch string

      The name of the branch.

    • inst string

      The name of the inst.

    • recordName string

      The name of the record.

    • temporary boolean

      Whether the branch is temporary.

  • BranchRecordWithInst

    Members

    • branch string

      The name of the branch.

    • inst string

      The name of the inst.

    • linkedInst InstWithSubscriptionInfo

      The inst that this branch belongs to. Null if the branch does not have a reocrd name.

    • recordName string

      The name of the record.

    • temporary boolean

      Whether the branch is temporary.

  • BranchUpdates

    Members

    • branchSizeInBytes number

    • instSizeInBytes number

    • timestamps number[]

    • updates string[]

  • Cache

    Members

    • remove(key: string): Promise<void>

      Removes the data stored under the given key.

      The first parameter is a string and is the key to remove the data for.

    • retrieve(key: string): Promise<T>

      Retrieves the data stored under the given key.

      The first parameter is a string and is the key to retrieve the data for.

    • store(key: string, data: T, expireSeconds: number): Promise<void>

      Stores the given data in the cache.

      The first parameter is a string and is the key to store the data under.

      The second parameter is a T and is the data to store.

      The third parameter is a number and is the number of seconds after which the data should expire.

  • CancelAnimationAction

    An event that is used to cancel the current camera animation.

    Members

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • taskId (string | number)

      The ID of the async task.

    • type "cancel_animation"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • CancelContractRequest

    Members

    • address string

      The address of the contract that is being canceled.

    • instances string[]

      The instances that the request is being made from.

    • recordName string

      The name of the record that the contract is stored in.

    • refundAccountId? string

      The ID of the account that the refund should be sent to. If not provided, then the refund will be sent to the account that owns the contract.

    • userId string

      The ID of the user that is currently logged in. Null if the user is not logged in.

  • CancelInvoiceRequest

    Members

    • invoiceId string

      The ID of the invoice to cancel.

    • userId string

      The ID of the user that is currently logged in.

    • userRole UserRole

      The role of the user that is currently logged in.

  • CanonicalRequest

    Members

    • headers object

    • method ("GET" | "POST" | "PUT" | "DELETE")

    • path string

    • payloadSha256Hex string

    • queryString object

  • CapturePortalScreenshotAction

    Defines an event that captures a screenshot from the given portal.

    Members

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • portal CameraPortal

      The portal that should be captured.

    • taskId (string | number)

      The ID of the async task.

    • type "capture_portal_screenshot"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • CheckRateLimitRequest

    Members

    • ipAddress string

  • ClaimActivationKeyRequest

    Members

    • activationKey string

      The key that should be claimed.

    • ipAddress string

      The IP Address that the request is coming from.

    • target ("self" | "guest")

      The target of the activation key.

      • guest indicates that the key should be claimed for a guest user.
      • self indicates that the key should be claimed for the user that is currently logged in.
    • userId string

      The ID of the user that is currently logged in.

  • ClassifyImagesAction

    Defines an interface for actions that represent asynchronous tasks.

    Members

    • images Image[]

      The images that should be classified.

    • modelJsonUrl? string

      The URL that the teachable machine model JSON is available at. Not required if modelUrl is provided.

    • modelMetadataUrl? string

      The URL that the teachable machine model metadata is available at. Not required if modelUrl is provided.

    • modelUrl? string

      The URL the the teachable machine model is available at.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • taskId (string | number)

      The ID of the async task.

    • type "classify_images"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • ClassifyImagesOptions

    Members

    • images Image[]

      The images that should be classified.

    • modelJsonUrl? string

      The URL that the teachable machine model JSON is available at. Not required if modelUrl is provided.

    • modelMetadataUrl? string

      The URL that the teachable machine model metadata is available at. Not required if modelUrl is provided.

    • modelUrl? string

      The URL the the teachable machine model is available at.

  • ClassifyImagesResult

    Members

  • ClearSpaceAction

    Defines an event that clears all bots from a space.

    Only supported for the following spaces:

    • error

    Members

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • space string

      The space to clear.

    • taskId (string | number)

      The ID of the async task.

    • type "clear_space"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • ComIdRequest

    Members

    • ipAddress string

      The IP Address that the request is coming from.

    • requestedComId string

      The comID that is being requested.

    • studioId string

      The ID of the studio that the request is for.

    • userId string

      The user that is currently logged in.

  • CompleteLoginRequest

    Members

    • code string

      The code that was sent to the address.

    • ipAddress string

      The IP address that the request is coming from.

    • requestId string

      The ID of the login request.

    • userId string

      The ID of the user that the login request is for.

  • CompleteOpenIDLoginRequest

    Members

    • ipAddress string

      The IP address that the request is from.

    • requestId string

      The ID of the login request.

  • CompleteWebAuthnLoginRequest

    Members

    • ipAddress string

      The IP Address that the login request is from.

    • originOrHost string

      The HTTP origin or host that the request is coming from. Null if the origin is from the same origin as the server.

    • requestId string

      The ID of the login request.

    • response AuthenticationResponseJSON

      The response to the login request.

  • CompleteWebAuthnRegistrationRequest

    Members

    • originOrHost string

      The HTTP origin or host that the request was made from.

    • response RegistrationResponseJSON

      The registration response.

    • userAgent string

      The user agent that the request was made from.

    • userId string

      The ID of the user that is logged in.

  • ConfigurationStore

    Defines an interface that is used for storing configuration data.

    Members

    • getConfiguration(key: TKey, defaultValue?: input): Promise<output>

      Gets the stored configuration value for the given key.

      The first parameter is a TKey and is the key to get.

      The second parameter is optional and is a input and is the default value to use if no value is found.

    • getModerationConfig(): Promise<object>

      Retrieves the moderation configuration from the store. Resolves with null if no configuration is found.

    • getPlayerWebManifest(): Promise<object>

      Retrieves the PWA web manifest that should be served for the player. Resolves with null if no manifest is found.

    • getPrivoConfiguration(): Promise<object>

      Retrieves the privo configuration from the store.

    • getSubscriptionConfiguration(): Promise<SubscriptionConfiguration>

      Retrieves the subscription configuration from the store.

    • getWebConfig(): Promise<WebConfig>

      Retrieves the web configuration from the store. Resolves with null if no configuration is found.

    • setConfiguration(key: TKey, value: input): Promise<void>

      Updates the stored configuration value for the given key.

      The first parameter is a TKey and is the key to set.

      The second parameter is a input and is the value to set.

  • ConstructAuthorizationContextRequest

    Members

    • recordKeyOrRecordName string

      The record key that should be used or the name of the record that the request is being authorized for.

    • sendNotLoggedIn? boolean

      Whether to return not_logged_in results when the user has not provided any authentication mechanism, but needs to.

    • userId? string

      The ID of the user that is currently logged in. Null or undefined if the user is not logged in.

    • userRole? UserRole

      The role of the user. Null if the user is not logged in. Null or undefined if the user is not logged in.

  • ContractPricing

    Members

    • contract ContractRecord

      The information for the contract.

    • currency string

      The currency that the cost is in.

    • lineItems ContractPricingLineItem[]

      The line items that make up the total cost.

    • total number

      The total cost to purchase the contract.

  • ConvertedCurrency

    Defines the structure of a converted currency value.

    Members

    • rate bigint

      The rate that was used for the conversion.

      value = from / rate;

    • remainder bigint

      The remainder of the conversion. This is the amount that could not be converted due to the conversion rate.

    • value bigint

      The value in the target currency.

  • CountRecordsFilter

    Members

    • ownerId? string

      The ID of user that owns the record.

    • studioId? string

      The ID of the studio that owns the record.

  • CreateAccountRequest

    Members

    • createSession? boolean

      Whether or not to create a session for the user. Defaults to true.

    • ipAddress string

      The IP Address that the request is being made from. Can be set to null if not creating a session.

    • userRole UserRole

      The role of the logged in user.

  • CreateInitializationUpdateAction

    Defines an event that is used to create an initialization update for a given list of bots.

    Members

    • bots Bot[]

      The bots that should be encoded into the state update.

    • type "create_initialization_update"

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • CreateManageStoreAccountLinkRequest

    Members

    • studioId string

      The ID of the studio that the link should be created for.

    • userId string

      The ID of the user that is currently logged in.

  • CreateManageSubscriptionRequest

    Defines a request for managing a user's subscription.

    Members

    • expectedPrice? object

      The price that the user expects to pay.

    • sessionKey string

      The session key that should be used to validate the request.

    • studioId? string

      The ID of the studio that the management session should be created for.

    • subscriptionId? string

      The subscription that was selected for purcahse by the user.

    • userId? string

      The User ID that the management session should be created for.

  • CreateManageXpAccountLinkRequest

    Members

    • userId string

      The ID of the user that is currently logged in.

  • CreatePurchaseItemLinkRequest

    Members

    • instances string[]

      The instances that the request is being made from.

    • item object

      The item that is being purchased.

    • returnUrl string

      The URL that the user should be redirected to if the purchase is canceled.

    • successUrl string

      The URL that the user should be redirected to if the purchase is unsuccessful.

    • userId string

      The ID of the user that is currently logged in. Null if the user is not logged in.

  • CreateRecordRequest

    Defines an interface that represents a request to create a record.

    Members

    • ownerId? string

      The ID of the user that should be the owner of the record.

    • recordName string

      The name of the record that should be created.

    • studioId? string

      The ID of the studio that should own the record.

    • userId string

      The ID of the user that is currently logged in.

  • CreateStaticHtmlAction

    Defines an event that captures a screenshot from the given viewport coordinates.

    Members

    • bots BotState

      The bots that should be injected.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • taskId (string | number)

      The ID of the async task.

    • templateUrl? string

      The URL of the HTML that the static HTML should be created from.

    • type "create_static_html"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • CreateStripeLoginLinkRequest

    Members

    • studioId? string

      The ID of the studio that the link should be created for. If not provided, the link will be created for the user's personal account.

    • userId string

      The ID of the user that is currently logged in.

  • CurrentUpdates

    Members

    • instSizeInBytes number

    • timestamps number[]

    • updates string[]

  • CustomAppContainerAvailableAction

    Defines an event that registers a custom app container.

    Members

    • type "custom_app_container_available"

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • CustomDomain

    Represents a custom domain that is associated with a studio.

    These domains may or may not be verified.

    Members

    • domainName string

      The domain name.

    • id string

      The ID of the custom domain.

    • studioId string

      The ID of the studio that the custom domain is associated with.

    • verificationKey string

      The HMAC-SHA-256 verification key.

    • verified true

      Whether the custom domain has been verified. Null if not verified.

  • CustomDomainWithStudio

    Represents a custom domain that is associated with a studio.

    These domains may or may not be verified.

    Members

    • domainName string

      The domain name.

    • id string

      The ID of the custom domain.

    • studio Studio

    • studioId string

      The ID of the studio that the custom domain is associated with.

    • verificationKey string

      The HMAC-SHA-256 verification key.

    • verified true

      Whether the custom domain has been verified. Null if not verified.

  • DataRecordsController

    Defines a class that is able to manage data (key/value) records.

    Members

    • constructor(config: DataRecordsConfiguration): DataRecordsController

      Creates a DataRecordsController.

      The first parameter is a DataRecordsConfiguration and is the configuration that should be used for the data records controller.

    • eraseData(recordKeyOrName: string, address: string, subjectId: string, instances?: string[]): Promise<EraseDataResult>

      Erases the data in the given record and address. Uses the given record key to access the record and the given subject ID to determine if the user is allowed to access the record.

      The first parameter is a string and

      The second parameter is a string and is the address that the record should be deleted from.

      The third parameter is a string and is the ID of the user that this request came from.

      The fourth parameter is optional and is a string[] and is the instances that are loaded.

    • getData(recordName: string, address: string, userId?: string, instances?: string[]): Promise<GetDataResult>

      Gets the data that is stored in the given record at the given address.

      The first parameter is a string and is the name (or record key) of the record that the data is stored in.

      The second parameter is a string and is the address that the data is stored in.

      The third parameter is optional and is a string and is the ID of the user who is retrieving the data. If null, then it is assumed that the user is not logged in.

      The fourth parameter is optional and is a string[] and is the list of instances that are loaded.

    • listData(recordName: string, address: string, userId?: string, instances?: string[]): Promise<ListDataResult>

      Lists some data from the given record, starting after the given address.

      The first parameter is a string and is the name (or record key) of the record.

      The second parameter is a string and is the address that the listing should start at. If null, then the listing will start with the first item.

      The third parameter is optional and is a string and is the ID of the user who is retrieving the data. If null, then it is assumed that the user is not logged in.

      The fourth parameter is optional and is a string[] and is the instances that are loaded.

    • listDataByMarker(request: ListDataByMarkerRequest): Promise<ListDataResult>

      Lists some data from the given record, filtered by the given marker and starting at the given address.

      The first parameter is a ListDataByMarkerRequest and is the request that should be used to list the data.

    • recordData(recordKeyOrRecordName: string, address: string, data: (string | number | boolean | object), subjectId: string, updatePolicy: UserPolicy, deletePolicy: UserPolicy, markers: string[], instances: string[]): Promise<RecordDataResult>

      Records the given data in the given record and address. Uses the given record key to access the record and the given subject ID to store which user the data came from.

      The first parameter is a string and

      The second parameter is a string and is the address that the record should be stored at inside the record.

      The third parameter is a (string | number | boolean | object) and is the data that should be saved.

      The fourth parameter is a string and is the ID of the user that the data came from.

      The fifth parameter is a UserPolicy and is the update policy that the new data should use.

      The parameter is a UserPolicy and is the delete policy that the new data should use.

      The parameter is a string[] and is the list of markers that should be applied to the new record. If null, then the publicRead marker will be applied.

      The parameter is a string[] and is the list of instances that are currently loaded.

  • DataRecordsStore

    Defines an interface for objects that can store data records.

    Members

    • eraseData(recordName: string, address: string): Promise<EraseDataStoreResult>

      Deletes the data stored in the given record and address.

      The first parameter is a string and is the name of the record that the data is in.

      The second parameter is a string and is the address that the data is stored at.

    • getData(recordName: string, address: string): Promise<GetDataStoreResult>

      Gets the data stored in the given record and address.

      The first parameter is a string and is the name of the record that the data is in.

      The second parameter is a string and is the address that the data is stored at.

    • listData(recordName: string, address: string): Promise<ListDataStoreResult>

      Lists data stored in the given record starting with the given address.

      The first parameter is a string and is the name of the record.

      The second parameter is a string and is the address to start listing items at.

    • listDataByMarker(request: ListDataStoreByMarkerRequest): Promise<ListDataStoreResult>

      Lists data stored in the given record that has the given marker, starting with the given address.

      The first parameter is a ListDataStoreByMarkerRequest and

    • setData(recordName: string, address: string, data: any, publisherId: string, subjectId: string, updatePolicy: UserPolicy, deletePolicy: UserPolicy, markers: string[]): Promise<SetDataResult>

      Sets the given data in the given record and address.

      The first parameter is a string and is the name of the record that the data should be set in.

      The second parameter is a string and is the address that the data should be set for.

      The third parameter is a any and is the data that should be saved.

      The fourth parameter is a string and is the ID of the user that owns the record this data is being published to.

      The fifth parameter is a string and is the ID of the user that was logged in when the data was published.

      The parameter is a UserPolicy and is the update policy that should be stored.

      The parameter is a UserPolicy and is the delete policy that should be stored.

      The parameter is a string[] and is the list of resource markers that should be applied to the data.

  • DataSubscriptionMetrics

    Members

    • currentPeriodEndMs number

      The unix time in miliseconds of the end of the current subscription period.

    • currentPeriodStartMs number

      The unix time in miliseconds of the start of the current subscription period.

    • ownerId string

    • recordName? string

    • stripeAccountId string

      The ID of the stripe account that the record is associated with. Null if a stripe account is not associated with the record.

    • stripeAccountStatus StripeAccountStatus

      The status of the stripe account that the record is associated with. Null if a stripe account is not associated with the record.

    • studioId string

    • subscriptionId string

      The ID of the subscription.

    • subscriptionStatus string

      The status of the subscription.

    • subscriptionType ("user" | "studio")

      The type of the subscription.

    • totalItems number

      The total number of data items stored in the subscription.

    • userId? string

  • DebuggerInterface

    Defines an interface for objects that represent a debugger and can retrieve their internal runtime.

    Members

  • DeleteCustomDomainRequest

    Members

    • customDomainId string

      The ID of the custom domain to remove.

    • userId string

      The ID of the currently logged in user.

    • userRole? UserRole

      The role of the currently logged in user.

  • DeviceAction

    An event that is used to indicate an event that was sent from a remote device.

    Members

    • connection ConnectionInfo

      The connection which sent the event.

    • event Action

      The event.

    • taskId? (string | number)

      The ID of the task that this action was sent with.

    • type "device"

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • DeviceActionError

    An event that is used to respond to remote actions with an error.

    Members

    • connection ConnectionInfo

      The connection which sent the event.

    • error any

      The error that is included in the result.

    • taskId (string | number)

      The ID of the task that this is a result for.

    • type "device_error"

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • DeviceActionResult

    An event that is used to respond to remote actions with some arbitrary data.

    Members

    • connection ConnectionInfo

      The connection which sent the event.

    • result any

      The data that is included in the result.

    • taskId (string | number)

      The ID of the task that this is a result for.

    • type "device_result"

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • DeviceBranchConnection

    Defines an interface that represents the connection of a device to a branch.

    Members

    • branch string

      The name of the branch that the device is connected to.

    • clientConnectionId string

      The client-created ID of the connection.

    • inst string

      The name of the inst that the device is connected to.

    • mode BranchConnectionMode

      The mode of the connection.

    • recordName string

      The name of the record that the device is connected to.

    • serverConnectionId string

      The server-created ID of the connection.

    • sessionId string

      The ID of the session that the user used to connect.

    • temporary boolean

      Whether the data stored by the connection is supposed to be temporary.

    • token string

      The token that the device is using.

    • userId string

      The ID of the user that the connection is associated with.

  • DeviceConnection

    Defines an interface that represents the connection of a device to the apiary.

    Members

    • clientConnectionId string

      The client-created ID of the connection.

    • serverConnectionId string

      The server-created ID of the connection.

    • sessionId string

      The ID of the session that the user used to connect.

    • token string

      The token that the device is using.

    • userId string

      The ID of the user that the connection is associated with.

  • DeviceSelector

    An interface that is used to determine which device to send a remote event to.

    Members

    • broadcast? boolean

      Whether the event should be broadcast to all users.

    • connectionId? string

      The ID of the connection that the event should be sent to.

    • sessionId? string

      The ID of the session that the event should be sent to.

    • userId? string

      The ID of the user that the event should be sent to.

  • DomainNameValidator

    Defines an interface that helps validate domain names via DNS.

    Members

    • getVerificationDNSRecord(domainName: string, verificationKey: string): Promise<Result>

      Gets the DNS record that should be set for verifying the given domain name.

      The first parameter is a string and is the domain name to get the verification record for.

      The second parameter is a string and is the verification key to use for generating the record.

    • validateDomainName(domainName: string, verificationKey: string): Promise<Result>

      Validates the given domain name using the provided verification key.

      The first parameter is a string and is the domain name to validate.

      The second parameter is a string and is the verification key to use for validation.

  • DomainNameVerificationDNSRecord

    Defines a DNS record that should be set for domain name verification.

    Members

    • recordType "TXT"

      The type of DNS record that should be set for the verification.

    • ttlSeconds number

      The TTL (time to live) in seconds for the verification record.

    • value string

      The value that should be set for the verification record.

  • EndAudioRecordingAction

    An event that is used to finish audio recording.

    Members

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • taskId (string | number)

      The ID of the async task.

    • type "end_audio_recording"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • EraseDataStoreResult

    Defines an interface that represents the result of a "erase data" operation.

    Members

    • errorCode? ("data_not_found" | "server_error")

    • errorMessage? string

    • success boolean

  • EraseDocumentRequest

    Members

    • address string

      The address of the search record that the document should be erased from.

    • documentId string

      The ID of the document to erase.

    • instances string[]

      The instance(s) that are making the request.

    • recordName string

      The name of the record that the document should be erased from.

    • userId string

      The ID of the user that is currently logged in.

  • EraseFileAction

    Defines an event that erases a file from a record.

    Members

    • fileUrl string

      The URL that the file is stored at.

    • options RecordActionOptions

      The options that the action should use.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • recordKey string

      The record key that should be used to erase the file.

    • taskId (string | number)

      The ID of the async task.

    • type "erase_file"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • EraseFileStoreResult

    Members

    • errorCode? ("file_not_found" | "server_error")

    • errorMessage? string

    • success boolean

  • EraseRecordDataAction

    Defines an event that erases some data in a record.

    Members

    • [APPROVED_SYMBOL]? boolean

      Whether this action has been manually approved.

      Uses a symbol to ensure that it cannot be copied across security boundaries. As a result, it should be impossible to generate actions that are pre-approved.

    • address string

      The address that the data from.

    • options RecordActionOptions

      The options that the action should use.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • recordKey string

      The record key that should be used to erase the data.

    • requiresApproval boolean

      Whether this action is trying to publish data that requires manual approval.

    • taskId (string | number)

      The ID of the async task.

    • type "erase_record_data"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • EraseStoreItemAction

    Defines an interface that represents the base for actions that deal with records.

    Members

    • address string

      The address of the item.

    • options RecordActionOptions

      The options that the action should use.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • recordName string

      The name of the record.

    • taskId (string | number)

      The ID of the async task.

    • type "erase_store_item"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • EventRecordUpdate

    Members

    • count? number

    • markers? string[]

  • EventRecordsController

    Defines a class that is able to manage event (count) records.

    Members

    • constructor(config: EventRecordsConfiguration): EventRecordsController

      Creates a DataRecordsController.

      The first parameter is a EventRecordsConfiguration and is the configuration to use.

    • addCount(recordKeyOrRecordName: string, eventName: string, count: number, subjectId: string, instances?: string[]): Promise<AddCountResult>

      Adds the given count of events to the total count of events with the given name.

      The first parameter is a string and is the record key or the name of the record that should be used to add the events.

      The second parameter is a string and is the name of the events to record.

      The third parameter is a number and is the number of events to add/subtract.

      The fourth parameter is a string and is the ID of the user that is adding the count.

      The fifth parameter is optional and is a string[] and is the list of instances that are currently loaded by the client.

    • getCount(recordKeyOrRecordName: string, eventName: string, userId: string, instances?: string[]): Promise<GetCountResult>

      Gets the current count of events with the given name from the given record.

      The first parameter is a string and is the name of the record.

      The second parameter is a string and is the name of the events

      The third parameter is a string and is the ID of the user that is getting the count.

      The fourth parameter is optional and is a string[] and is the list of instances that are currently loaded by the client.

    • listEvents(recordKeyOrRecordName: string, eventName: string, userId: string, instances?: string[]): Promise<ListEventsResult>

      The first parameter is a string and

      The second parameter is a string and

      The third parameter is a string and

      The fourth parameter is optional and is a string[] and

    • updateEvent(request: UpdateEventRecordRequest): Promise<UpdateEventRecordResult>

      Attempts to update the event using the given request.

      The first parameter is a UpdateEventRecordRequest and is the request

  • EventRecordsStore

    Defines an interface for objects that can store event records.

    Members

    • addEventCount(recordName: string, eventName: string, count: number): Promise<AddEventCountStoreResult>

      Adds the given count to the given event and record.

      The first parameter is a string and is the name of the record.

      The second parameter is a string and is the name of the event.

      The third parameter is a number and is the amount to add or subtract.

    • getEventCount(recordName: string, eventName: string): Promise<GetEventCountStoreResult>

      Gets the count stored on the given event and record. Returns a count of 0 if none is stored.

      The first parameter is a string and is the name of the record.

      The second parameter is a string and is the name of the event.

    • listEvents(recordName: string, eventName: string): Promise<ListEventsStoreResult>

      Lists the events that are in the given record.

      The first parameter is a string and is the name of the record.

      The second parameter is a string and is the name of the event that the list should start after.

    • updateEvent(recordName: string, eventName: string, updates: EventRecordUpdate): Promise<UpdateEventResult>

      Updates the given event with the given information.

      The first parameter is a string and is the name of the record that the event is in.

      The second parameter is a string and is the name of the event that should be updated.

      The third parameter is a EventRecordUpdate and is the updates to apply to the event.

  • EventSubscriptionMetrics

    Members

    • currentPeriodEndMs number

      The unix time in miliseconds of the end of the current subscription period.

    • currentPeriodStartMs number

      The unix time in miliseconds of the start of the current subscription period.

    • ownerId string

    • recordName? string

    • stripeAccountId string

      The ID of the stripe account that the record is associated with. Null if a stripe account is not associated with the record.

    • stripeAccountStatus StripeAccountStatus

      The status of the stripe account that the record is associated with. Null if a stripe account is not associated with the record.

    • studioId string

    • subscriptionId string

      The ID of the subscription.

    • subscriptionStatus string

      The status of the subscription.

    • subscriptionType ("user" | "studio")

      The type of the subscription.

    • totalEventNames number

      The total number of events names stored in the subscription.

    • userId? string

  • ExternalPayout

    Members

    • amount number

      The amount of the payout.

    • destinationStripeAccountId? string

      The ID of the Stripe account that the payout is sent to.

    • externalDestination PayoutDestination

      The destination that the payout is sent to.

    • id string

      The ID of the payout.

    • initatedAtMs number

      The time that the payout was initiated at in milliseconds since epoch.

    • invoiceId? string

      The ID of the invoice that the payout is for.

    • postedAtMs? number

      The time that the payout was posted at in milliseconds since epoch.

    • postedTransferId? string

      The ID of the transfer that posts the payout.

    • stripeTransferId? string

      The ID of the stripe transfer that is associated with this payout.

    • studioId? string

      The ID of the studio that the payout is for.

    • transactionId string

      The ID of the transaction that this payout is part of.

    • transferId string

      The ID of the transfer that makes the payout.

    • userId? string

      The ID of the user that the payout is for.

    • voidedAtMs? number

      The time that the payout was voided at in milliseconds since epoch.

    • voidedTransferId? string

      The ID of the transfer that voids the payout.

  • FeaturesConfiguration

    Defines an interface that contains the configuration for features.

    Members

  • FileRecord

    Defines the structure of a file record.

    Members

    • bucket string

      The bucket that the file is stored in. If null, then the file is stored in the default bucket.

    • description string

      The description of the file.

    • fileName string

      The name of the file.

    • markers string[]

      The resource markers for the file. Null if the file was created without markers.

    • publisherId string

      The ID of the publisher that published the record.

    • recordName string

      The name of the record that the file was recorded in.

    • sizeInBytes number

      The size of the record in bytes.

    • subjectId string

      The ID of the subject that was logged in when the record was published.

    • uploaded boolean

      Whether the record was uploaded to the server.

  • FileRecordsController

    Defines a class that can manage file records.

    Members

    • constructor(config: FileRecordsConfiguration): FileRecordsController

      The first parameter is a FileRecordsConfiguration and

    • eraseFile(recordKeyOrRecordName: string, fileName: string, subjectId: string, instances?: string[]): Promise<EraseFileResult>

      Attempts to erase the given file using the given record key and subject.

      The first parameter is a string and

      The second parameter is a string and is the name of the file.

      The third parameter is a string and is the ID of the user that is making this request. Null if the user is not logged in.

      The fourth parameter is optional and is a string[] and is the instances that are loaded.

    • getAllowedUploadHeaders(): string[]

    • getFileNameFromUrl(fileUrl: string): Promise<GetFileNameFromUrlResult>

      The first parameter is a string and

    • listFiles(recordKeyOrRecordName: string, fileName: string, userId?: string, instances?: string[]): Promise<ListFilesResult>

      Attempts to list the files that are available in the given record.

      The first parameter is a string and is the name of the record or the record key of the record.

      The second parameter is a string and is the file name that the listing should start at. If null, then the listing will start with the first file in the record.

      The third parameter is optional and is a string and is the ID of the user who is retrieving the data. If null, then it is assumed that the user is not logged in.

      The fourth parameter is optional and is a string[] and is the instances that are loaded.

    • markFileAsUploaded(recordName: string, fileName: string): Promise<FileUploadedResult>

      The first parameter is a string and

      The second parameter is a string and

    • readFile(recordKeyOrRecordName: string, fileName: string, subjectId: string, instances?: string[], userRole?: UserRole): Promise<ReadFileResult>

      Attempts to retrieve a URL that allows the client to read the given file.

      The first parameter is a string and is the name of the record or the record key of the record.

      The second parameter is a string and is the name of the file.

      The third parameter is a string and is the ID of the user that is making this request. Null if the user is not logged in.

      The fourth parameter is optional and is a string[] and is the instances that are loaded.

      The fifth parameter is optional and is a UserRole and is the role of the user that is making the request.

    • recordFile(recordKeyOrRecordName: string, userId: string, request: RecordFileRequest): Promise<RecordFileResult>

      Attempts to record a file.

      The first parameter is a string and

      The second parameter is a string and is the ID of the user that is logged in. Should be null if the user is not logged in.

      The third parameter is a RecordFileRequest and is the request.

    • updateFile(recordKeyOrRecordName: string, fileName: string, subjectId: string, markers: string[], instances?: string[]): Promise<UpdateFileRecordResult>

      The first parameter is a string and

      The second parameter is a string and

      The third parameter is a string and

      The fourth parameter is a string[] and

      The fifth parameter is optional and is a string[] and

  • FileRecordsStore

    Defines an interface that provides a way to store file records.

    Members

    • addFileRecord(recordName: string, fileName: string, publisherId: string, subjectId: string, sizeInBytes: number, description: string, markers: string[]): Promise<AddFileResult>

      Attempts to add a record for a file to the store.

      The first parameter is a string and is the name of the record that the file was recorded in.

      The second parameter is a string and is the name of the file that should be recorded.

      The third parameter is a string and is the ID of the publisher that published the record.

      The fourth parameter is a string and is the ID of the subject that was logged in when the record was published.

      The fifth parameter is a number and is the size of the file in bytes.

      The parameter is a string and is the description of the file.

      The parameter is a string[] and is the resource markers for the file.

    • eraseFileRecord(recordName: string, fileName: string): Promise<EraseFileStoreResult>

      Attempts to delete the given file from the given record.

      The first parameter is a string and is the name of the record that the file was recorded in.

      The second parameter is a string and is the name of the file that should be deleted.

    • getAllowedUploadHeaders(): string[]

      Gets the list of headers that should be allowed via CORS.

    • getFileNameFromUrl(fileUrl: string): Promise<GetFileNameFromUrlResult>

      Attempts to get the record name and file name from the given URL.

      The first parameter is a string and is the URL.

    • getFileRecord(recordName: string, fileName: string): Promise<GetFileRecordResult>

      Gets the file record for the file with the given name.

      The first parameter is a string and is the name of the record that the file is stored in.

      The second parameter is a string and is the name of the file.

    • init(): Promise<void>

      Initializes the store.

    • listUploadedFiles(recordName: string, fileName: string): Promise<ListFilesStoreResult>

      Attempts to list the files in the given record.

      The first parameter is a string and is the name of the record.

      The second parameter is a string and is the name of the file that the listing should start after.

    • presignFileRead(request: PresignFileReadRequest): Promise<PresignFileReadResult>

      Presigns a request to read a file. Returns the URL that can be used to read the file.

      The first parameter is a PresignFileReadRequest and is the request to create a signed request for.

    • presignFileUpload(request: PresignFileUploadRequest): Promise<PresignFileUploadResult>

      Presigns a request to record a file. Returns the URL that should be used to upload the file and the headers that should be included in the upload request.

      The first parameter is a PresignFileUploadRequest and is the request to create a signed request for.

    • setFileRecordAsUploaded(recordName: string, fileName: string): Promise<MarkFileRecordAsUploadedResult>

      Marks the given file record as having been uploaded.

      The first parameter is a string and is the reocrd that the file was uploaded to.

      The second parameter is a string and is the name of the file that was uploaded.

    • updateFileRecord(recordName: string, fileName: string, markers: string[]): Promise<UpdateFileResult>

      Attempts to update the given file record.

      The first parameter is a string and is the name of the record that the file was recorded in.

      The second parameter is a string and is the name of the file.

      The third parameter is a string[] and is the markers that should be set on the file.

  • FileSubscriptionMetrics

    Members

    • currentPeriodEndMs number

      The unix time in miliseconds of the end of the current subscription period.

    • currentPeriodStartMs number

      The unix time in miliseconds of the start of the current subscription period.

    • ownerId string

    • recordName? string

    • stripeAccountId string

      The ID of the stripe account that the record is associated with. Null if a stripe account is not associated with the record.

    • stripeAccountStatus StripeAccountStatus

      The status of the stripe account that the record is associated with. Null if a stripe account is not associated with the record.

    • studioId string

    • subscriptionId string

      The ID of the subscription.

    • subscriptionStatus string

      The status of the subscription.

    • subscriptionType ("user" | "studio")

      The type of the subscription.

    • totalFileBytesReserved number

      The total number of file bytes that have been reserved in the subscription.

    • totalFiles number

      The total number of file items stored in the subscription.

    • userId? string

  • FinancialAccount

    Represents a financial account in the system.

    Members

    • contractId? string

      The ID of the contract that this account is held by. If null, then this account is not held by a contract.

    • currency string

      The currency that this account is tracked in. Always matches the currency of the ledger.

    • id string

      The ID of the account.

    • ledger number

      The ledger that this account is for.

    • studioId? string

      The ID of the studio that this account is held by. If null, then this account is not held by a studio.

    • userId? string

      The ID of the user that this account is held by. If null, then this account is not held by a user.

  • FinancialAccountFilter

    Members

    • contractId? string

      The contract ID to filter by.

    • ledger? number

      The ledger to filter by.

    • studioId? string

      The studio ID to filter by.

    • userId? string

      The user ID to filter by.

  • FinancialController

    Members

  • FinancialInterface

    Interface follows Client practices in "tigerbeetle-node" as a base for account and transfer operations. Revise as needed if more operations are needed.

    Members

  • FinancialStore

    Members

    • createAccount(account: FinancialAccount): Promise<void>

      Saves the given financial account in the store.

      The first parameter is a FinancialAccount and is the account to save.

    • createExternalPayout(payout: ExternalPayout): Promise<void>

      Creates a new external payout.

      The first parameter is a ExternalPayout and is the payout to create.

    • getAccountByFilter(filter: UniqueFinancialAccountFilter): Promise<FinancialAccount>

      Gets the financial account with the given filter.

      The first parameter is a UniqueFinancialAccountFilter and is the filter to use. Must specify one of userId, studioId, or contractId and also specify the ledger.

    • getAccountById(id: string): Promise<FinancialAccount>

      Gets the financial account with the given ID.

      The first parameter is a string and is the ID of the account to get.

    • getLastBillingCycleHistory(): Promise<BillingCycleHistory>

      Gets the last billing cycle history according to the time. Returns null if there is no billing cycle history.

    • listAccounts(filter: FinancialAccountFilter): Promise<FinancialAccount[]>

      Gets a list of financial accounts by the given filter.

      The first parameter is a FinancialAccountFilter and is the filter to use.

    • markPayoutAsPosted(payoutId: string, postedTransferId: string, postedAtMs: number): Promise<void>

      Marks a payout as posted.

      The first parameter is a string and is the ID of the payout to mark as posted.

      The second parameter is a string and is the ID of the transfer that posted the payout.

      The third parameter is a number and is the time that the payout was posted at in milliseconds since epoch.

    • markPayoutAsVoided(payoutId: string, voidedTransferId: string, voidedAtMs: number): Promise<void>

      Marks a payout as voided.

      The first parameter is a string and is the ID of the payout to mark as voided.

      The second parameter is a string and is the ID of the transfer that voided the payout.

      The third parameter is a number and is the time that the payout was voided at in milliseconds since epoch.

    • saveBillingCycleHistory(history: BillingCycleHistory): Promise<void>

      Creates or updates the given billing cycle history.

      The first parameter is a BillingCycleHistory and is the billing cycle history to save.

    • updateExternalPayout(payout: PartialExcept): Promise<void>

      Updates the given external payout.

      The first parameter is a PartialExcept and is the payout to update.

  • FocusOnBotAction

    An event that is used to focus on a given bot.

    Members

    • botId string

      The ID of the bot to focus on.

    • columnNumber? number

      The column number that should be selected in the editor. Only supported in the system portal, sheet portal, and tag portals.

    • duration? number

      The duration in seconds that the animation should take. Defaults to 1.

    • easing? (Easing | EaseType)

      The options for easing. Can be an "easing type" or an object that specifies the type and mode. If an easing type is specified, then "inout" mode is used. If omitted, then "quadratic" "inout" is used.

    • endIndex? number

      The index of the last character that should be selected. Only supported in the system portal, sheet portal, and tag portals.

    • lineNumber? number

      The line number that should be selected in the editor. Only supported in the system portal, sheet portal, and tag portals.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • portal? string

      The portal that the bot should be focused in. If not specified, then the bot will be focused in all the portals it is in. (bot, mini and menu) Useful if a bot is in two portals but you only want to focus it in one portal.

    • space? string

      The tag space that should be focused. Only supported in the system portal, sheet portal, and tag portals.

    • startIndex? number

      The index of the first character that should be selected. Only supported in the system portal, sheet portal, and tag portals.

    • tag? string

      The tag that should be focused. Only supported in the system portal.

    • taskId (string | number)

      The ID of the async task.

    • type "focus_on"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

    • zoom? number

  • FocusOnPositionAction

    An event that is used to focus on a given position.

    Members

    • columnNumber? number

      The column number that should be selected in the editor. Only supported in the system portal, sheet portal, and tag portals.

    • duration? number

      The duration in seconds that the animation should take. Defaults to 1.

    • easing? (Easing | EaseType)

      The options for easing. Can be an "easing type" or an object that specifies the type and mode. If an easing type is specified, then "inout" mode is used. If omitted, then "quadratic" "inout" is used.

    • endIndex? number

      The index of the last character that should be selected. Only supported in the system portal, sheet portal, and tag portals.

    • lineNumber? number

      The line number that should be selected in the editor. Only supported in the system portal, sheet portal, and tag portals.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • portal? string

      The portal that the bot should be focused in. If not specified, then the bot will be focused in all the portals it is in. (bot, mini and menu) Useful if a bot is in two portals but you only want to focus it in one portal.

    • position object

      The position to animate to.

    • space? string

      The tag space that should be focused. Only supported in the system portal, sheet portal, and tag portals.

    • startIndex? number

      The index of the first character that should be selected. Only supported in the system portal, sheet portal, and tag portals.

    • tag? string

      The tag that should be focused. Only supported in the system portal.

    • taskId (string | number)

      The ID of the async task.

    • type "focus_on_position"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

    • zoom? number

  • FulfillCheckoutSessionRequest

    Members

    • activation ("now" | "later")

      How the session should be fulfilled.

      • now indicates that the items should be granted to the user and activated imediately. Only valid if the user is logged in.
      • later indicates that an access key should be granted for the user to activate later.
    • sessionId string

      The ID of the session that should be fulfilled.

    • userId string

      The ID of the user that is currently logged in.

  • GetBalancesRequest

    Members

    • filter FinancialAccountFilter

      The filter that should be used to find the accounts.

    • userId string

      The ID of the user that is currently logged in.

    • userRole? UserRole

      The role of the user that is currently logged in.

  • GetConfigurationValueRequest

    Members

    • key ("subscriptions" | "privo" | "moderation" | "web" | "playerWebManifest" | "ab1Bootstrap")

    • userRole UserRole

  • GetContractPricingRequest

    Members

    • contract object

      The contract that is being purchased.

    • instances string[]

      The instances that the request is being made from.

    • userId string

      The ID of the user that is currently logged in. Null if the user is not logged in.

  • GetCurrentInstUpdateAction

    Defines an event that is used to get the current inst update.

    Members

    • type "get_current_inst_update"

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • GetDataStoreResult

    Defines an interface that represents the result of a "get data" operation.

    Members

  • GetEventCountAction

    Defines an action that retrieves the number of times an event has happened.

    Members

    • eventName string

      The name of the event.

    • options RecordActionOptions

      The options that the action should use.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • recordName string

      The name of the record.

    • taskId (string | number)

      The ID of the async task.

    • type "get_event_count"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • GetFileAction

    Defines an event that requests a file from a record.

    Members

    • fileUrl string

      The URL that the file is stored at.

    • options RecordActionOptions

      The options that the action should use.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • taskId (string | number)

      The ID of the async task.

    • type "get_file"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • GetInstStateFromUpdatesAction

    Defines an event that is used to get the state of the inst with a particular set of updates.

    Members

    • type "get_inst_state_from_updates"

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

    • updates InstUpdate[]

      The list of updates to use.

  • GetPublicRecordKeyAction

    Defines an interface that represents an action that requests a key to a public record.

    Members

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • policy? PublicRecordKeyPolicy

      The policy that the record key should have.

    • recordName string

      The name of the record.

    • taskId (string | number)

      The ID of the async task.

    • type "get_public_record_key"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • GetRecordDataAction

    Defines an event that requests some data in a record.

    Members

    • [APPROVED_SYMBOL]? boolean

      Whether this action has been manually approved.

      Uses a symbol to ensure that it cannot be copied across security boundaries. As a result, it should be impossible to generate actions that are pre-approved.

    • address string

      The address of the data that should be retrieved.

    • options RecordActionOptions

      The options that the action should use.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • recordName string

      The name of the record.

    • requiresApproval boolean

      Whether this action is trying to publish data that requires manual approval.

    • taskId (string | number)

      The ID of the async task.

    • type "get_record_data"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • GetRecordsEndpointAction

    An action that is used to retrieve the default records endpoint.

    Members

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • taskId (string | number)

      The ID of the async task.

    • type "get_records_endpoint"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • GetRemoteCountAction

    Defines an event that is used to get the player count.

    Members

    • branch? string

      The name of the branch.

    • inst? string

      The instance that the device count should be retrieved for. If omitted, then the total device count will be returned.

    • recordName? string

      The name of the record.

    • type "get_remote_count"

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • GetRemotesAction

    Defines an event that is used to get the list of remote devices on the instance.

    Members

    • type "get_remotes"

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • GetRoomOptionsAction

    Defines an event that retrieves the set of options that the local user has for a room.

    Members

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • roomName string

      The name of the room.

    • taskId (string | number)

      The ID of the async task.

    • type "get_room_options"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • GetRoomRemoteOptionsAction

    Defines an event that retrieves the options for a remote multimedia chat room user.

    Members

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • remoteId string

      The ID of the remote user.

    • roomName string

      The name of the room.

    • taskId (string | number)

      The ID of the async task.

    • type "get_room_remote_options"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • GetRoomTrackOptionsAction

    Defines an event that retrieves the set of options that the local user has for a track.

    Members

    • address string

      The address of the track.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • roomName string

      The name of the room.

    • taskId (string | number)

      The ID of the async task.

    • type "get_room_track_options"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • GetScriptIssuesAction

    Defines an interface for actions that represent asynchronous tasks.

    Members

    • botId string

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • tag string

    • taskId (string | number)

      The ID of the async task.

    • type "get_script_issues"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • GetStoreItemAction

    Defines an interface that represents the base for actions that deal with records.

    Members

    • address string

      The address of the item.

    • options RecordActionOptions

      The options that the action should use.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • recordName string

      The name of the record.

    • taskId (string | number)

      The ID of the async task.

    • type "get_store_item"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • GetSubscriptionStatusRequest

    Members

    • sessionKey string

      The session key that should be used to validate the request.

    • studioId? string

      The ID of the studio whose subscrition status should be retrieved.

    • userId? string

      The ID of the user whose subscription status should be retrieved.

  • GetUserInfoRequest

    Defines an interface for requests to get a user's info.

    Members

    • requestedUserId? string

      The ID of the user that should be retrieved. If omitted, then the logged in user info will be retrieved.

    • userId string

      The ID of the currently logged in user.

    • userRole? UserRole

      The role of the currently logged in user.

  • GetUserInfoSuccess

    Members

    • avatarPortraitUrl string

      The URL of the avatar portrait for the user.

    • avatarUrl string

      The URL of the avatar for the user.

    • contractFeatures? object

      The contracting features that the user has access to.

    • displayName string

      The public display name of the user.

    • email string

      The email address of the user.

    • hasActiveSubscription boolean

      Whether the user has an active subscription.

    • name string

      The name of the user.

    • phoneNumber string

      The phone number of the user.

    • privacyFeatures PrivacyFeatures

      The privacy-related features that the user has enabled.

    • requestedRate number

      The rate at which the user is requesting payment (null if not yet specified)

    • role UserRole

      The role that the user has in the system.

    • stripeAccountId string

      The user's connected stripe account ID.

    • stripeAccountRequirementsStatus StripeRequirementsStatus

      The user's connected stripe account requirements status.

    • stripeAccountStatus StripeAccountStatus

      The user's connected stripe account status.

    • subscriptionTier string

      The subscription tier that the user is subscribed to.

    • success true

    • userId string

      The ID of the user that was retrieved.

  • GetWebhookRunRequest

    Members

    • instances string[]

      The instances that the request is coming from.

    • runId string

      The ID of the webhook run that is being requested.

    • userId string

      The ID of the user that is currently logged in.

  • GoToDimensionAction

    Defines an event that is used to send the player to a dimension.

    Members

    • dimension string

      The dimension that should be loaded.

    • type "go_to_dimension"

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • GoToURLAction

    Defines an event that is used to redirect the user to the given URL. This should be equivalent to clicking a link with rel="noreferrer".

    Members

    • type "go_to_url"

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

    • url string

      The URL to open.

  • GoogleAIChatOptions

    Members

    • apiKey string

      The API key to use.

  • GrantEntitlementRequest

    Members

    • expireTimeMs number

      The unix time in miliseconds that the entitlement grant will expire.

    • feature EntitlementFeature

      The feature that is being granted.

    • grantingUserId string

      The ID of the user that is granting the entitlement.

    • packageId string

      The ID of the package that the entitlement grant is for.

    • recordName string

      The record that the entitlement grant covers.

    • scope "designated"

      The scope that is being granted.

    • userId string

      The ID of the currently logged in user.

    • userRole? UserRole

      The role of the currently logged in user. If omitted, then the user will be treated as a normal user.

  • GrantEntitlementsAction

    Defines an action that grants a package entitlements to access a record.

    Members

    • options RecordActionOptions

      The options that the action should use.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • taskId (string | number)

      The ID of the async task.

    • type "grant_record_entitlements"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • GrantInstAdminPermissionAction

    Defines an action that represents an action that grants admin permissions to the inst for the day.

    Members

    • [APPROVED_SYMBOL]? boolean

      Whether this action has been manually approved.

      Uses a symbol to ensure that it cannot be copied across security boundaries. As a result, it should be impossible to generate actions that are pre-approved.

    • options RecordActionOptions

      The options that the action should use.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • recordName string

      The name of the record.

    • taskId (string | number)

      The ID of the async task.

    • type "grant_inst_admin_permission"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • GrantMarkerPermissionRequest

    Members

  • GrantRecordPermissionAction

    Defines an interface that represents an action that grants a permission to a record marker.

    Members

    • options RecordActionOptions

      The options that the action should use.

    • permission AvailablePermissions

      The permission that should be granted.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • recordName string

      The name of the record.

    • taskId (string | number)

      The ID of the async task.

    • type "grant_record_permission"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • GrantResourcePermissionRequest

    Members

  • GrantRoleAction

    Defines an action that grants a role to a user or inst.

    Members

    • expireTimeMs number

      The Unix time (in miliseconds) that the role grant expires.

    • inst? string

      The ID of the inst that should be granted the role.

    • options RecordActionOptions

      The options that the action should use.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • recordName string

      The name of the record.

    • role string

      The role that should be granted.

    • taskId (string | number)

      The ID of the async task.

    • type "grant_role"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

    • userId? string

      The ID of the user that should be granted the role.

  • GrantRoleRequest

    Members

    • expireTimeMs? number

    • instance? string

    • role string

    • userId? string

  • GrantedPackageEntitlement

    Defines an interface that represents an entitlement that has been granted to a package.

    Members

    • createdAtMs number

      The unix time that the grant was created at in miliseconds.

    • expireTimeMs number

      The unix time that the entitlement expires in miliseconds.

    • feature EntitlementFeature

      The feature that was granted.

    • id string

      The ID of the entitlement.

    • packageId string

      The ID of the package that the entitlement is granted for.

    • recordName string

      The record that the entitlement was granted for.

    • revokeTimeMs number

      The unix time that the entitlement was revoked at in miliseconds. If null, then the entitlement has not been revoked.

    • scope "designated"

      The scope of the granted entitlement.

    • userId string

      The ID of the user that granted the entitlement.

  • HandleStripeWebhookRequest

    Members

    • requestBody string

      The raw request body.

    • signature string

      The signature that was included with the request.

  • HandleWebhookRequest

    Members

    • address string

      The address of the webhook.

    • instances string[]

      The instances that the request is coming from.

    • recordName string

      The name of the record that the webhook is for.

    • request GenericHttpRequest

      The request that should be made to the webhook.

    • userId string

      The ID of the user that is currently logged in. Null if the user is not logged in.

  • HtmlFunction

    Defines an interface for a function that provides HTML VDOM capabilities to bots.

    Members

    • f any

    • h (name: (string | Function),props: any,children: any[]) => any

  • ImportAUXAction

    An event that is used to load an AUX from a remote location.

    Members

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • taskId (string | number)

      The ID of the async task.

    • type "import_aux"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

    • url string

      The URL to load.

  • InstRecordsStore

    Defines an interface for services which are able to store inst update data.

    An "update" is a simplified interface where updates are encoded as strings and can be applied in any order and multiple times.

    Members

    • addUpdates(recordName: string, inst: string, branch: string, updates: string[], sizeInBytes: number): Promise<AddUpdatesResult>

      Adds the given updates to the given branch. If the branch does not exist, then it will be created.

      The first parameter is a string and is the name of the record that the updates should be added to. If null, then the updates will be added to a tempPublic inst.

      The second parameter is a string and is the name of the inst.

      The third parameter is a string and is the branch that the updates should be added to.

      The fourth parameter is a string[] and is the updates that should be added.

      The fifth parameter is a number and is the size of the updates in bytes.

    • deleteBranch(recordName: string, inst: string, branch: string): Promise<void>

      Deletes the given branch.

      The first parameter is a string and is the name of the record. If null, then the updates will be added to a tempPublic inst.

      The second parameter is a string and is the name of the inst.

      The third parameter is a string and is the branch in the inst.

    • deleteInst(recordName: string, inst: string): Promise<void>

      Deletes the given inst.

      The first parameter is a string and is the name of the record.

      The second parameter is a string and is the name of the inst.

    • getAllUpdates(recordName: string, inst: string, branch: string): Promise<StoredUpdates>

      Gets the entire list of updates for the given branch in the given inst and record. This should include historical updates. Returns null if the branch does not exist.

      The first parameter is a string and is the name of the record. If null, then the updates for a tempPublic inst will be returned.

      The second parameter is a string and is the name of the inst.

      The third parameter is a string and is the branch in the inst.

    • getBranchByName(recordName: string, inst: string, branch: string): Promise<BranchRecordWithInst>

      Gets the info for the given branch. Returns null if the branch does not exist.

      The first parameter is a string and is the name of the record.

      The second parameter is a string and is the name of the inst.

      The third parameter is a string and is the name of the branch.

    • getCurrentUpdates(recordName: string, inst: string, branch: string): Promise<CurrentUpdates>

      Gets the list of updates for the given branch in the given inst and record. Returns null if the branch does not exist. This will only include updates that are currently being worked on.

      The first parameter is a string and is the name of the record. If null, then the updates for a tempPublic inst will be returned.

      The second parameter is a string and is the name of the inst.

      The third parameter is a string and is the branch in the inst.

    • getInstByName(recordName: string, inst: string): Promise<InstWithSubscriptionInfo>

      Gets the info for the given inst.

      The first parameter is a string and is the name of the record that the inst is in.

      The second parameter is a string and is the name of the inst.

    • getInstSize(recordName: string, inst: string): Promise<number>

      Gets the size of the inst. Returns null if the inst does not exist.

      The first parameter is a string and is the name of the record. If null, then the updates for a tempPublic inst will be returned.

      The second parameter is a string and is the name of the inst.

    • isPackageLoaded(recordName: string, inst: string, packageId: string): Promise<LoadedPackage>

      Determines whether the package with the given ID is loaded into the given inst. Returns the package that was loaded if it is loaded, or null if it is not.

      The first parameter is a string and is the name of the record that the inst is in.

      The second parameter is a string and is the inst.

      The third parameter is a string and is the ID of the package.

    • listInstsByRecord(recordName: string, startingInst?: string): Promise<ListInstsStoreResult>

      Gets the list of insts that are in the given record.

      The first parameter is a string and is the name of the record. If null, then an empty list will be returned.

      The second parameter is optional and is a string and is the name of the inst to start listing at.

    • listInstsByRecordAndMarker(recordName: string, marker: string, startingInst?: string): Promise<ListInstsStoreResult>

      Gets the list of insts that are in the given record and have the given marker.

      The first parameter is a string and is the name of the record. If null, then an empty list will be returned.

      The second parameter is a string and is the marker that the insts must have.

      The third parameter is optional and is a string and is the name of the inst to start listing at.

    • listLoadedPackages(recordName: string, inst: string): Promise<LoadedPackage[]>

      Gets the list of loaded packages for the given record and inst.

      The first parameter is a string and is the name of the record.

      The second parameter is a string and is the inst.

    • replaceCurrentUpdates(recordName: string, inst: string, branch: string, updateToAdd: string, sizeInBytes: number): Promise<ReplaceUpdatesResult>

      Replaces the current set of updates with a new update. Useful for when updates have been merged and the old ones should be replaced by the new one.

      Depending on the implementation, this function may or may not be concurrent safe. That is, if two clients call this function at the same time for the same branch, then it is possible that the branch will be put into an invalid state.

      The first parameter is a string and is the name of the record. If null, then the updates will be added to a tempPublic inst.

      The second parameter is a string and is the name of the inst.

      The third parameter is a string and is the branch in the inst.

      The fourth parameter is a string and is the update that should be added.

      The fifth parameter is a number and is the size of the new update in bytes.

    • saveBranch(branch: BranchRecord): Promise<SaveBranchResult>

      Creates or updates the given branch record.

      The first parameter is a BranchRecord and is the branch that should be saved.

    • saveInst(inst: InstWithBranches): Promise<SaveInstResult>

      Creates or updates the given inst. If branches are included, then they will be added/updated to the inst as well.

      The first parameter is a InstWithBranches and is the inst that should be saved.

    • saveLoadedPackage(loadedPackage: LoadedPackage): Promise<void>

      Saves the given loaded package.

      The first parameter is a LoadedPackage and is the package that should be saved.

  • InstSubscriptionMetrics

    Members

    • currentPeriodEndMs number

      The unix time in miliseconds of the end of the current subscription period.

    • currentPeriodStartMs number

      The unix time in miliseconds of the start of the current subscription period.

    • ownerId string

    • recordName? string

    • stripeAccountId string

      The ID of the stripe account that the record is associated with. Null if a stripe account is not associated with the record.

    • stripeAccountStatus StripeAccountStatus

      The status of the stripe account that the record is associated with. Null if a stripe account is not associated with the record.

    • studioId string

    • subscriptionId string

      The ID of the subscription.

    • subscriptionStatus string

      The status of the subscription.

    • subscriptionType ("user" | "studio")

      The type of the subscription.

    • totalInstBytes number

      The total number of bytes stored by insts in the subscription.

    • totalInsts number

      The total number of insts stored in the subscription.

    • userId? string

  • InstWithBranches

    Members

    • branches? BranchRecord[]

      The list of branches that are in the inst.

    • inst string

      The name of the inst.

    • markers string[]

      The list of resource markers that are applied to this inst.

    • recordName string

      The name of the record.

  • InstWithSubscriptionInfo

    Members

    • inst string

      The name of the inst.

    • markers string[]

      The list of resource markers that are applied to this inst.

    • recordName string

      The name of the record.

    • subscriptionId string

      The ID of the subscription that is associated with the inst.

    • subscriptionStatus string

      The status of the subscription that is associated with the inst.

    • subscriptionType ("user" | "studio")

      The type of the subscription.

  • InstWithUpdates

    Members

    • inst string

      The name of the inst.

    • instSizeInBytes number

    • markers string[]

      The list of resource markers that are applied to this inst.

    • recordName string

      The name of the record.

  • InstallAuxAction

    Members

    • aux StoredAux

      The aux file that should be installed.

    • downgrade? boolean

      Whether to allow downgrading to older versions.

    • mode InstallAuxFileMode

      The mode that should be used to install the aux file.

      • "default" indicates that the aux file will be installed as-is. If the file was already installed, then it will either overwrite bots or do nothing depending on the version of the aux. Version 1 auxes will overwrite existing bots, while version 2 auxes will do nothing.
      • "copy" indicates that all the bots in the aux file should be given new IDs. This is useful if you want to be able to install an AUX multiple times in the same inst.
    • source? string

      The source of the aux file (e.g. package ID).

      Used to track bots installed from aux files so that updates can be seamless.

      If omitted, then the aux file will be treated as a one-off install. If specified and the mode is "default", then the aux file will be installed as an update if an aux from the same source was previously installed. If specified and the mode is "copy", then the aux file will always be installed as a new install.

    • type "install_aux_file"

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

    • version? SimpleVersionNumber

      The version of the aux file being installed.

      Used to determine if the update is an upgrade or a downgrade.

  • InstallPackageAction

    Defines an interface that represents the base for actions that deal with records.

    Members

    • address string

      The address of the package that should be loaded.

    • key (string | PackageRecordVersionKeySpecifier)

      The key for the package version that should be loaded. If null, then the latest version will be loaded.

    • options InstallPackageOptions

      The options for the request.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • recordName string

      The name of the record that the package should be loaded from.

    • taskId (string | number)

      The ID of the async task.

    • type "install_package"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • InterfaceTransferError

    Members

    • errorCode ("server_error" | "code_must_not_be_zero" | "exists" | "flags_are_mutually_exclusive" | "timestamp_must_be_zero" | "accounts_must_be_different" | "amount_must_not_be_zero" | "accounts_must_have_the_same_ledger" | "closing_transfer_must_be_pending" | "credit_account_already_closed" | "debit_account_already_closed" | "already_posted" | "already_voided" | "credit_account_not_found" | "debit_account_not_found" | "exceeds_credits" | "exceeds_debits" | "exceeds_pending_transfer_amount" | "id_already_failed" | "overflows_credits" | "overflows_debits" | "overflows_credits_pending" | "overflows_debits_pending" | "overflows_credits_posted" | "overflows_debits_posted" | "overflows_timeout")

    • errorMessage string

    • transfer Transfer

  • InternalTransferRequest

    Members

    • transactionId? (string | bigint)

      The ID of the transaction that should be created. If null, then a new transaction will be created.

    • transfers InternalTransfer[]

      The transfers that should be performed in a transcation.

  • InvoiceContractRequest

    Members

    • amount number

      The amount charged in the invoice.

    • contractId string

      The ID of the contract that should be invoiced.

    • note string

      The note that should be included with the invoice.

    • payoutDestination InvoicePayoutDestination

      Where the invoice payment should end up.

    • userId string

      The ID of the user that is currently logged in.

    • userRole UserRole

      The role of the user that is currently logged in.

  • IssueSessionOptions

    Members

    • ipAddress string

      The IP Address that the session was granted to.

    • lifetimeMs number

      The lifetime of the session in milliseconds. If null, then the session will not expire.

    • oidAccessToken? string

      The access token that was granted to the session by the Open ID provider. If null, then Open ID was not used for the session.

    • oidExpiresAtMs? number

      The unix timestamp in seconds that the oidAccessToken expires at. If null, then Open ID was not used for the session.

    • oidIdToken? string

      The ID token that was granted to the session by the Open ID provider. If null, then Open ID was not used for the session.

    • oidProvider? string

      The name of the Open ID provider that was used to obtain this session. If null, then Open ID was not used for the session.

    • oidRefreshToken? string

      The refresh token that was granted to the session by the Open ID provider. If null, then Open ID was not used for the session.

    • oidRequestId? string

      The ID of the OpenID login request that aws used to obtain this session.

    • oidScope? string

      The Open ID scope that was granted to the session. If null, then Open ID was not used for the session.

    • oidTokenType? string

      The type of the access token that was granted to the session by the Open ID provider. If null, then Open ID was not used for the session.

    • previousSession? AuthSession

      The previous session that is being used to issue this session. If null, then the session is not being issued from another session.

    • requestId? string

      The ID of the login request that this session is being issued from.

    • revocable? boolean

      Whether the session is able to be revoked by the user. Setting this to false will prevent the user from revoking the session. Additionally, users will not be able to replace the session either. If false, then the session cannot be revoked by the user. If true, then the session can be revoked by the user. Default is true.

    • userId string

      The ID of the user that the session is for.

    • webauthnRequestId? string

      The ID of the WebAuthn login request that was used to obtain this session.

  • IssueSessionRequest

    Members

    • ipAddress string

      The IP address that the session is being issued from.

    • lifetimeMs? number

      The number of miliseconds that the session should last. If null, then the session will not expire. If undefined, then the default session lifetime will be used.

    • requestingUserId string

      The ID of the user that is requesting the session. Null if the session is not being requested by another user.

    • requestingUserRole UserRole

      The role of the user that is requesting the session.

    • userId string

      The ID of the user to issue the session for.

  • IterableCompleteAction

    Defines an action that completes an iterable.

    Members

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • taskId (string | number)

      The ID of the async task.

    • type "iterable_complete"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • IterableNextAction

    Defines an action that supplies a next iterable value for an AsyncAction.

    Members

    • mapBotsInValue? boolean

      Whether to map any bots found in the result to their actual bot counterparts. Defaults to false.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • taskId (string | number)

      The ID of the async task.

    • type "iterable_next"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

    • value any

      The value.

  • IterableThrowAction

    Defines an action that supplies an error for an iterable.

    Members

    • error any

      The error.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • taskId (string | number)

      The ID of the async task.

    • type "iterable_throw"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • JoinRoomAction

    Defines an event that attempts to join a meeting room.

    Members

    • options RoomJoinOptions

      The options that should be used to join the room.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • roomName string

      The name of the room that should be joined.

    • taskId (string | number)

      The ID of the async task.

    • type "join_room"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • LDrawCountBuildStepsAction

    Defines an event that retrieves the build steps for a given LDraw model.

    Members

    • address? string

      The address that the build steps should be retrieved from.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • taskId (string | number)

      The ID of the async task.

    • text? string

      The text that contains the LDraw model.

    • type "ldraw_count_build_steps"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • LeaveRoomAction

    Defines an event that attempts to leave a meeting room.

    Members

    • options RecordActionOptions

      The options that the action should use.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • roomName string

      The name of the room that should be exited.

    • taskId (string | number)

      The ID of the async task.

    • type "leave_room"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • ListAccountTransfersRequest

    Members

    • accountId (string | bigint)

      The ID of the account to list transfers for.

    • userId string

      The ID of the user that is currently logged in.

    • userRole? UserRole

      The role of the user that is currently logged in.

  • ListAllFilesFilter

    Members

    • fileExtensions? string[]

      The file extensions that the files should have.

    • uploadedAfterMs? number

      The unix time in milliseconds that the files should have been uploaded after.

  • ListContractInvoicesRequest

    Members

    • contractId string

      The ID of the contract to list invoices for.

    • userId string

      The ID of the user that is currently logged in.

    • userRole UserRole

      The role of the user that is currently logged in.

  • ListCustomDomainsRequest

    Members

    • studioId string

      The ID of the studio to list custom domains for.

    • userId string

      The ID of the currently logged in user.

    • userRole? UserRole

      The role of the currently logged in user.

  • ListDataByMarkerRequest

    Defines an interface that represents the possible options in a list data request.

    Members

    • instances? string[]

      The list of instances that are currently loaded.

    • marker string

      The marker that the data should be filtered by.

    • recordKeyOrName string

      The record key or name that should be used to list the data.

    • sort? ("ascending" | "descending")

      The order that the data should be sorted in. Defaults to "ascending".

    • startingAddress string

      The address that the listing should start after.

    • userId string

      The ID of the user that is currently logged in.

  • ListDataStoreByMarkerRequest

    Members

    • count? number

      The maximum number of items that should be returned. If not provided, a default value will be used.

    • marker string

      The marker that each item should have.

    • recordName string

      The name of the record that the data is in.

    • sort? ("ascending" | "descending")

      How the items should be sorted by address. "ascending": The items should be sorted in ascending order. "descending": The items should be sorted in descending order.

      Defaults to "ascending".

    • startingAddress string

      The address to start listing items at. If null, then the first item in the record should be returned.

  • ListGrantedEntitlementsRequest

    Members

    • packageId? string

      The ID of the package that the entitlements should be listed for. If omitted, then all granted entitlements will be listed for the user.

    • userId string

      The ID of the user that is currently logged in.

  • ListInstUpdatesAction

    Defines an event that is used to get the list of bot updates on the instance.

    Members

    • type "list_inst_updates"

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • ListInstalledPackagesAction

    Defines an interface that represents the base for actions that deal with records.

    Members

    • options RecordActionOptions

      The options that the action should use.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • taskId (string | number)

      The ID of the async task.

    • type "list_installed_packages"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • ListInstalledPackagesRequest

    Members

    • inst string

      The inst that the installed packages should be listed from.

    • instances? string[]

      The instances that are trying to list the packages.

    • recordName string

      The name of the record that the installed packages should be listed from. If null, then the inst is a public inst.

    • userId string

      The ID of the currently logged in user.

    • userRole? UserRole

      The role of the currently logged in user.

  • ListRecordDataAction

    Defines an interface that represents the base for actions that deal with data records.

    Members

    • [APPROVED_SYMBOL]? boolean

      Whether this action has been manually approved.

      Uses a symbol to ensure that it cannot be copied across security boundaries. As a result, it should be impossible to generate actions that are pre-approved.

    • options ListDataOptions

      The options for the action.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • recordName string

      The name of the record.

    • requiresApproval boolean

      Whether this action is trying to publish data that requires manual approval.

    • startingAddress? string

      The address that the list should start with.

    • taskId (string | number)

      The ID of the async task.

    • type "list_record_data"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • ListRecordDataByMarkerAction

    Members

    • [APPROVED_SYMBOL]? boolean

      Whether this action has been manually approved.

      Uses a symbol to ensure that it cannot be copied across security boundaries. As a result, it should be impossible to generate actions that are pre-approved.

    • marker string

      The marker that should be used to filter the list.

    • options ListDataOptions

      The options for the action.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • recordName string

      The name of the record.

    • requiresApproval boolean

      Whether this action is trying to publish data that requires manual approval.

    • startingAddress? string

      The address that the list should start with.

    • taskId (string | number)

      The ID of the async task.

    • type "list_record_data_by_marker"

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • ListSessionsRequest

    Members

    • expireTimeMs? number

      The expiration time that the listing should start after.

    • sessionKey string

      The key that should be used to authorize the request.

    • userId string

      The ID of the user whose sessions should be listed.

  • ListStoreItemsAction

    Defines an interface that represents the base for actions that deal with records.

    Members

    • address string

      The address to start listing items after.

    • options RecordActionOptions

      The options that the action should use.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • recordName string

      The name of the record.

    • taskId (string | number)

      The ID of the async task.

    • type "list_store_items"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • ListStoreItemsByMarkerAction

    Members

    • address string

      The address to start listing items after.

    • marker string

      The marker that should be used to filter the list.

    • options RecordActionOptions

      The options that the action should use.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • recordName string

      The name of the record.

    • taskId (string | number)

      The ID of the async task.

    • type "list_store_items_by_marker"

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • ListStudioAssignmentFilters

    Members

    • isPrimaryContact? boolean

      Whether to filter by primary contact.

    • role? string

      The role to filter by.

    • userId? string

      The ID of the user to filter by.

  • ListSubscriptionsForUserRequest

    Members

    • instances string[]

      The instances that are currently loaded.

    • userId string

      The ID of the user that is currently logged in.

  • ListSubscriptionsRequest

    Members

    • address string

      The address of the notification.

    • instances string[]

      The instances that are currently loaded.

    • recordName string

      The name of the record that the notification is in.

    • userId string

      The ID of the user that is currently logged in.

  • ListUserStudiosAction

    Defines an action that retrieves the list of studios that the user has access to.

    Members

    • options RecordActionOptions

      The options that the action should use.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • taskId (string | number)

      The ID of the async task.

    • type "list_user_studios"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • ListWebhookRunsRequest

    Members

    • address string

      The address of the webhook.

    • instances string[]

      The instances that the request is coming from.

    • recordName string

      The name of the record that the webhook is stored in.

    • requestTimeMs? number

      The time that listed requests should appear before. If null, then the most recent runs will be returned.

      Formatted as the unix time in milliseconds.

    • userId string

      The ID of the user that is currently logged in.

  • ListedAccountTransfers

    Members

  • ListedRoleAssignments

    Members

  • LoadPackageRequest

    Members

    • branch? string

      The branch that the package should be loaded into. If omitted, then the default branch will be used.

    • downgrade? boolean

      Whether to allow downgrading the package if a newer version is already installed.

    • inst string

      The inst that the package should be loaded into.

    • instances? string[]

      The list of instances that are currently loaded.

    • package PackageVersionSpecifier

      The package that should be loaded.

    • recordName string

      The name of the record that the package should be loaded into. Null if the inst is a public inst.

    • userId string

      The ID of the currently logged in user.

    • userRole? UserRole

      The role of the currently logged in user.

  • LoadSharedDocumentAction

    Defines an event that is used to load a shared document.

    Members

    • branch string

      The branch that should be loaded. If null, then the document will not be stored in indexeddb.

    • inst string

      The inst that should be loaded. If null, then the document will be loaded from indexeddb.

    • markers? string[]

      The markers that should be set on the inst if it is new. If the inst already exists, this field is ignored. If not provided, the default markers will be used.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • recordName string

      The name of the record that the document should be loaded from. If null, then the document will be loaded either from a public inst or indexeddb.

    • taskId (string | number)

      The ID of the async task.

    • type "load_shared_document"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • LoadedPackage

    Members

    • branch string

      The branch that the package was installed into.

    • id string

      The ID of the loaded package.

    • inst string

      The name of the inst that the package was loaded into.

    • packageId string

      The ID of the pacakge that was loaded.

    • packageVersionId string

      The ID of the package version that was loaded.

    • recordName string

      The name of the record that the inst is stored in. If null, then the inst is a public inst.

    • userId string

      The ID of the user that loaded the package.

  • LoginRequest

    Members

    • address string

      The address that the login is for.

    • addressType AddressType

      The type of the address.

    • comId? string

      The ID of the comID that the login is for.

    • customDomain? string

      The custom domain (i.e. hostname) that the login is for.

      If specified, then the hostname will be used to determine the studio/comID that the login is for.

    • ipAddress string

      The IP address that the login is from.

    • loginStudioId? string

      The ID of the studio that the login is for.

      If null, then the user is logging into CasualOS proper.

  • LoomController

    Defines a class that is able to handle loom-related operations and tasks.

    Members

  • LoomGetTokenRequest

    Members

    • nowMs? number

      The current unix time in miliseconds. If omitted, then Date.now() will be used.

    • recordName string

      The name of the record that the user wants to access.

    • userId string

      The ID of the user that is logged in.

  • MarkerPermissionAssignment

    Defines an interface that represents a marker permission assignment.

    Members

    • action ActionKinds

      The kind of the actions that the subject is allowed to perform. Null if the subject is allowed to perform any action.

    • expireTimeMs number

      The time that the permission expires. Null if the permission never expires.

    • id string

      The ID of the permission assignment.

    • marker string

      The marker that the permission applies to.

    • options PermissionOptions

      The options for the permission assignment.

    • recordName string

      The name of the record.

    • resourceKind ResourceKinds

      The kind of the resource. Null if the permission applies to all resources.

    • subjectId string

      The ID of the subject.

    • subjectType SubjectType

      The type of the subject.

    • userId string

      The ID of the user that the assignment grants permission to. Null if the subject type is not "user".

  • MemoryStore

    Defines an interface that represents an auth store.

    Members

    • maxAllowedInstSize number

    • policies any

    • roleAssignments object

    • roles object

    • ab1Bootstrap StoredAux

    • activationKeys ActivationKey[]

    • aiOpenAIRealtimeMetrics AIOpenAIRealtimeMetrics[]

    • aiSloydMetrics AISloydMetrics[]

    • billingCycleHistory BillingCycleHistory[]

    • checkoutSessions AuthCheckoutSession[]

    • comIdRequests StudioComIdRequest[]

    • customDomains CustomDomain[]

    • dataBuckets Map<string, Map<string, RecordData>>

    • emailRules RegexRule[]

    • eventBuckets Map<string, Map<string, EventData>>

    • externalPayouts ExternalPayout[]

    • files Map<string, StoredFile>

    • financialAccounts FinancialAccount[]

    • grantedPackageEntitlements GrantedPackageEntitlement[]

    • loginRequests AuthLoginRequest[]

    • moderationConfiguration object

    • moderationFileResults ModerationFileScanResult[]

    • moderationJobs ModerationJob[]

    • openIdLoginRequests AuthOpenIDLoginRequest[]

    • playerWebManifest object

    • privoConfiguration object

    • purchasedItems PurchasedItem[]

    • recordKeys RecordKey[]

    • records Record[]

    • recordsNotifications RecordsNotification[]

    • sessions AuthSession[]

    • smsRules RegexRule[]

    • studios Studio[]

    • subscriptionConfiguration SubscriptionConfiguration

    • userAuthenticators AuthUserAuthenticator[]

    • userInstReports UserInstReport[]

    • users AuthUser[]

    • webConfig WebConfig

    • webauthnLoginRequests AuthWebAuthnLoginRequest[]

    • constructor(config: MemoryConfiguration): MemoryStore

      The first parameter is a MemoryConfiguration and

    • addEventCount(recordName: string, eventName: string, count: number): Promise<AddEventCountStoreResult>

      Adds the given count to the given event and record.

      The first parameter is a string and is the name of the record.

      The second parameter is a string and is the name of the event.

      The third parameter is a number and is the amount to add or subtract.

    • addFileModerationResult(result: ModerationFileScanResult): Promise<void>

      Inserts the result of a file moderation scan.

      The first parameter is a ModerationFileScanResult and is the result to save.

    • addFileRecord(recordName: string, fileName: string, publisherId: string, subjectId: string, sizeInBytes: number, description: string, markers: string[]): Promise<AddFileResult>

      Attempts to add a record for a file to the store.

      The first parameter is a string and is the name of the record that the file was recorded in.

      The second parameter is a string and is the name of the file that should be recorded.

      The third parameter is a string and is the ID of the publisher that published the record.

      The fourth parameter is a string and is the ID of the subject that was logged in when the record was published.

      The fifth parameter is a number and is the size of the file in bytes.

      The parameter is a string and is the description of the file.

      The parameter is a string[] and is the resource markers for the file.

    • addModerationJob(job: ModerationJob): Promise<void>

      Inserts the given moderation job.

      The first parameter is a ModerationJob and is the job that should be saved.

    • addRecord(record: Record): Promise<void>

      Adds the given record to the store.

      The first parameter is a Record and is the record to add.

    • addRecordKey(key: RecordKey): Promise<void>

      Adds the given record key to the store.

      The first parameter is a RecordKey and is the key to add.

    • addStudio(studio: Studio): Promise<void>

      Adds the given studio to the store.

      The first parameter is a Studio and is the studio to add.

    • addStudioAssignment(assignment: StudioAssignment): Promise<void>

      Adds the given studio assignment to the store.

      The first parameter is a StudioAssignment and is the assignment to add.

    • addUpdates(recordName: string, inst: string, branch: string, updates: string[], sizeInBytes: number): Promise<AddUpdatesResult>

      Adds the given updates to the given branch. If the branch does not exist, then it will be created.

      The first parameter is a string and is the name of the record that the updates should be added to. If null, then the updates will be added to a tempPublic inst.

      The second parameter is a string and is the name of the inst.

      The third parameter is a string and is the branch that the updates should be added to.

      The fourth parameter is a string[] and is the updates that should be added.

      The fifth parameter is a number and is the size of the updates in bytes.

    • assignPermissionToSubjectAndMarker(recordName: string, subjectType: SubjectType, subjectId: string, resourceKind: ResourceKinds, marker: string, action: ActionKinds, options: PermissionOptions, expireTimeMs: number): Promise<AssignPermissionToSubjectAndMarkerResult>

      Assigns the given permission to the given subject for the given resource.

      The first parameter is a string and is the name of the record that the resource exists in.

      The second parameter is a SubjectType and is the type of the subject. This can be either a user, inst, or role.

      The third parameter is a string and is the ID of the subject.

      The fourth parameter is a ResourceKinds and is the kind of the resource.

      The fifth parameter is a string and is the ID of the marker.

      The parameter is a ActionKinds and is the action that the subject is allowed to perform on the resource. If null, then all actions are allowed.

      The parameter is a PermissionOptions and is the options for the permission.

      The parameter is a number and is the time that the permission expires. If null, then the permission never expires.

    • assignPermissionToSubjectAndResource(recordName: string, subjectType: SubjectType, subjectId: string, resourceKind: ResourceKinds, resourceId: string, action: ActionKinds, options: PermissionOptions, expireTimeMs: number): Promise<AssignPermissionToSubjectAndResourceResult>

      Assigns the given permission to the given subject for the given resource.

      The first parameter is a string and is the name of the record that the resource exists in.

      The second parameter is a SubjectType and is the type of the subject. This can be either a user, inst, or role.

      The third parameter is a string and is the ID of the subject.

      The fourth parameter is a ResourceKinds and is the kind of the resource.

      The fifth parameter is a string and is the ID of the resource.

      The parameter is a ActionKinds and is the action that the subject is allowed to perform on the resource. If null, then all actions are allowed.

      The parameter is a PermissionOptions and is the options for the permission.

      The parameter is a number and is the time that the permission expires. If null, then the permission never expires.

    • assignSubjectRole(recordName: string, subjectId: string, type: ("user" | "inst"), role: AssignedRole): Promise<UpdateUserRolesResult>

      Assigns the given role to the given subject. If the role already is assigned, then it will be overwritten.

      The first parameter is a string and is the name of the record.

      The second parameter is a string and is the ID of the subject.

      The third parameter is a ("user" | "inst") and is the type of subject.

      The fourth parameter is a AssignedRole and is the role that should be assigned.

    • clone(): MemoryStore

      Constructs a deep clone of this memory store. Effectively copies all the data in the store into a new one.

    • countRecords(filter: CountRecordsFilter): Promise<number>

      Counts the number of records that match the given filter.

      The first parameter is a CountRecordsFilter and is the filter.

    • countStudiosInComId(comId: string): Promise<number>

      Gets the number of studios that are owned by the given comId.

      The first parameter is a string and is the comId.

    • countUpdates(recordName: string, inst: string, branch: string): Promise<number>

      The first parameter is a string and

      The second parameter is a string and

      The third parameter is a string and

    • createAccount(account: FinancialAccount): Promise<void>

      Saves the given financial account in the store.

      The first parameter is a FinancialAccount and is the account to save.

    • createActivationKey(key: ActivationKey): Promise<void>

      Creates the given activation key.

      The first parameter is a ActivationKey and is the key.

    • createExternalPayout(payout: ExternalPayout): Promise<void>

      Creates a new external payout.

      The first parameter is a ExternalPayout and is the payout to create.

    • createStudioForUser(studio: Studio, adminId: string): Promise<object>

      Creates a new studio and adds the given user as an admin.

      The first parameter is a Studio and is the studio to create.

      The second parameter is a string and is the ID of the admin user.

    • deleteBranch(recordName: string, inst: string, branch: string): Promise<void>

      Deletes the given branch.

      The first parameter is a string and is the name of the record. If null, then the updates will be added to a tempPublic inst.

      The second parameter is a string and is the name of the inst.

      The third parameter is a string and is the branch in the inst.

    • deleteCustomDomain(domainId: string): Promise<void>

      Removes the custom domain with the given ID from the store.

      The first parameter is a string and is the ID of the custom domain to remove.

    • deleteInst(recordName: string, inst: string): Promise<void>

      Deletes the given inst.

      The first parameter is a string and is the name of the record.

      The second parameter is a string and is the name of the inst.

    • deleteMarkerPermissionAssignment(assigment: MarkerPermissionAssignment): Promise<DeletePermissionAssignmentResult>

      The first parameter is a MarkerPermissionAssignment and

    • deleteMarkerPermissionAssignmentById(id: string): Promise<DeletePermissionAssignmentResult>

      Deletes the given marker permission assignment from the store.

      The first parameter is a string and is the ID of the permission assignment.

    • deleteResourcePermissionAssignment(assigment: ResourcePermissionAssignment): Promise<DeletePermissionAssignmentResult>

      The first parameter is a ResourcePermissionAssignment and

    • deleteResourcePermissionAssignmentById(id: string): Promise<DeletePermissionAssignmentResult>

      Deletes the given resource permission assignment from the store.

      The first parameter is a string and is the ID of the resource permission assignment.

    • deleteUserAuthenticator(userId: string, authenticatorId: string): Promise<number>

      Deletes the authenticator with the given ID. Returns the number of items that were deleted.

      The first parameter is a string and is the ID of the user whose authenticator should be deleted.

      The second parameter is a string and is the ID of the authenticator that should be deleted.

    • eraseData(recordName: string, address: string): Promise<EraseDataStoreResult>

      Deletes the data stored in the given record and address.

      The first parameter is a string and is the name of the record that the data is in.

      The second parameter is a string and is the address that the data is stored at.

    • eraseFileRecord(recordName: string, fileName: string): Promise<EraseFileStoreResult>

      Attempts to delete the given file from the given record.

      The first parameter is a string and is the name of the record that the file was recorded in.

      The second parameter is a string and is the name of the file that should be deleted.

    • findGrantedPackageEntitlementById(id: string): Promise<GrantedPackageEntitlement>

      Attempts to find the granted entitlement for the given ID.

      The first parameter is a string and is the ID of the entitlement.

    • findGrantedPackageEntitlementByUserIdPackageIdFeatureAndScope(userId: string, packageId: string, feature: EntitlementFeature, scope: "designated", recordName: string): Promise<GrantedPackageEntitlement>

      Attempts to find the non-revoked granted entitlement for the given user, package, feature, and scope.

      The first parameter is a string and is the ID of the user that granted the entitlement.

      The second parameter is a string and is the ID of the package that the entitlement is granted for.

      The third parameter is a EntitlementFeature and is the feature that was granted.

      The fourth parameter is a "designated" and is the scope that was granted.

      The fifth parameter is a string and is the name of the record that the entitlement was granted for.

    • findLoginRequest(userId: string, requestId: string): Promise<AuthLoginRequest>

      Finds a login request for the given user and request ID.

      The first parameter is a string and is the ID of the user.

      The second parameter is a string and is the ID of the request.

    • findMostRecentJobOfType(type: "files"): Promise<ModerationJob>

      Attempts to find the most recent job of the given type. If no job is found, returns null.

      The first parameter is a "files" and is the type of the job.

    • findOpenIDLoginRequest(requestId: string): Promise<AuthOpenIDLoginRequest>

      Finds the login request for the given request ID.

      The first parameter is a string and is the ID of the Open ID login request.

    • findOpenIDLoginRequestByState(state: string): Promise<AuthOpenIDLoginRequest>

      Finds the login request for the given state.

      The first parameter is a string and is the state that the request contains.

    • findSession(userId: string, sessionId: string): Promise<AuthSession>

      Finds a login session for the given user and session ID.

      The first parameter is a string and is the ID of the user.

      The second parameter is a string and is the ID of the session.

    • findUser(userId: string): Promise<AuthUser>

      Finds the user with the given ID.

      The first parameter is a string and is the ID of the user.

    • findUserAuthenticatorByCredentialId(credentialId: string): Promise<AuthUserAuthenticatorWithUser>

      Finds the authenticator with the given credentialId. Includes the user that the authenticator is for. Returns an object with null properties if the authenticator could not be found.

      The first parameter is a string and is the ID of the credential that the authenticator should represent.

    • findUserByAddress(address: string, addressType: AddressType, loginStudioId: string): Promise<AuthUser>

      Finds the user that represents the given address.

      The first parameter is a string and is the address.

      The second parameter is a AddressType and is the type of the address.

      The third parameter is a string and is the ID of the studio that the user is logging into.

    • findUserByPrivoServiceId(serviceId: string): Promise<AuthUser>

      Finds the user that is associated with the given Privo Service ID.

      The first parameter is a string and

    • findUserByStripeAccountId(accountId: string): Promise<AuthUser>

      Finds the user that is associated with the given Stripe Account ID.

      The first parameter is a string and is the ID of the account.

    • findUserByStripeCustomerId(customerId: string): Promise<AuthUser>

      Finds the user that is associated with the given Stripe Customer ID.

      The first parameter is a string and is the ID of the customer.

    • findUserLoginMetadata(userId: string): Promise<UserLoginMetadata>

      Finds the metadata for the given user ID. If the user does not exist, then null is returned.

      The first parameter is a string and is the ID of the user.

    • findWebAuthnLoginRequest(requestId: string): Promise<AuthWebAuthnLoginRequest>

      Finds the WebAuthn login request with the given request ID.

      The first parameter is a string and is the ID of the request.

    • getAccountByFilter(filter: UniqueFinancialAccountFilter): Promise<FinancialAccount>

      Gets the financial account with the given filter.

      The first parameter is a UniqueFinancialAccountFilter and is the filter to use. Must specify one of userId, studioId, or contractId and also specify the ledger.

    • getAccountById(id: string): Promise<FinancialAccount>

      Gets the financial account with the given ID.

      The first parameter is a string and is the ID of the account to get.

    • getActivationKeyById(id: string): Promise<ActivationKey>

      Gets the activation key with the given ID. Returns null if the key could not be found.

      The first parameter is a string and is the ID of the key.

    • getAllFileSubscriptionMetrics(): Promise<FileSubscriptionMetrics[]>

      Gets the file metrics for all the subscriptions in the system. This is used for periodic billing purposes.

    • getAllSubscriptionInstMetrics(): Promise<InstSubscriptionMetrics[]>

      Gets all the inst metrics for all the subscriptions in the system. This is used for periodic billing purposes.

    • getAllUpdates(recordName: string, inst: string, branch: string): Promise<CurrentUpdates>

      Gets the entire list of updates for the given branch in the given inst and record. This should include historical updates. Returns null if the branch does not exist.

      The first parameter is a string and is the name of the record. If null, then the updates for a tempPublic inst will be returned.

      The second parameter is a string and is the name of the inst.

      The third parameter is a string and is the branch in the inst.

    • getAllowedUploadHeaders(): string[]

      Gets the list of headers that should be allowed via CORS.

    • getBranchByName(recordName: string, inst: string, branch: string): Promise<BranchRecordWithInst>

      Gets the info for the given branch. Returns null if the branch does not exist.

      The first parameter is a string and is the name of the record.

      The second parameter is a string and is the name of the inst.

      The third parameter is a string and is the name of the branch.

    • getCheckoutSessionById(id: string): Promise<AuthCheckoutSession>

      Gets the checkout session with the given ID. Returns null if the session could not be found.

      The first parameter is a string and is the ID of the checkout session.

    • getConfiguration(key: TKey, defaultValue?: ConfigurationInput): Promise<ConfigurationOutput>

      Gets the stored configuration value for the given key.

      The first parameter is a TKey and is the key to get.

      The second parameter is optional and is a ConfigurationInput and is the default value to use if no value is found.

    • getCurrentUpdates(recordName: string, inst: string, branch: string): Promise<CurrentUpdates>

      Gets the list of updates for the given branch in the given inst and record. Returns null if the branch does not exist. This will only include updates that are currently being worked on.

      The first parameter is a string and is the name of the record. If null, then the updates for a tempPublic inst will be returned.

      The second parameter is a string and is the name of the inst.

      The third parameter is a string and is the branch in the inst.

    • getCustomDomainById(domainId: string): Promise<CustomDomainWithStudio>

      Gets the custom domain with the given ID.

      The first parameter is a string and is the ID of the custom domain.

    • getData(recordName: string, address: string): Promise<GetDataStoreResult>

      Gets the data stored in the given record and address.

      The first parameter is a string and is the name of the record that the data is in.

      The second parameter is a string and is the address that the data is stored at.

    • getEventCount(recordName: string, eventName: string): Promise<GetEventCountStoreResult>

      Gets the count stored on the given event and record. Returns a count of 0 if none is stored.

      The first parameter is a string and is the name of the record.

      The second parameter is a string and is the name of the event.

    • getFileNameFromUrl(fileUrl: string): Promise<GetFileNameFromUrlResult>

      Attempts to get the record name and file name from the given URL.

      The first parameter is a string and is the URL.

    • getFileRecord(recordName: string, fileName: string): Promise<GetFileRecordResult>

      Gets the file record for the file with the given name.

      The first parameter is a string and is the name of the record that the file is stored in.

      The second parameter is a string and is the name of the file.

    • getInstByName(recordName: string, inst: string): Promise<InstWithSubscriptionInfo>

      Gets the info for the given inst.

      The first parameter is a string and is the name of the record that the inst is in.

      The second parameter is a string and is the name of the inst.

    • getInstSize(recordName: string, inst: string): Promise<number>

      Gets the size of the inst. Returns null if the inst does not exist.

      The first parameter is a string and is the name of the record. If null, then the updates for a tempPublic inst will be returned.

      The second parameter is a string and is the name of the inst.

    • getInvoiceById(id: string): Promise<AuthInvoice>

      Gets the invoice with the given ID.

      The first parameter is a string and is the ID of the invoice.

    • getInvoiceByStripeId(id: string): Promise<AuthInvoice>

      Gets the invoice with the given stripe ID.

      The first parameter is a string and is the ID of the invoice.

    • getLastBillingCycleHistory(): Promise<BillingCycleHistory>

      Gets the last billing cycle history according to the time. Returns null if there is no billing cycle history.

    • getMarkerPermissionAssignmentById(id: string): Promise<MarkerPermissionAssignment>

      Gets the marker permission assignment with the given ID. Returns null if no assignment was found.

      The first parameter is a string and is the ID of the assignment.

    • getModerationConfig(): Promise<object>

      Retrieves the moderation configuration from the store. Resolves with null if no configuration is found.

    • getPermissionForSubjectAndMarkers(subjectType: SubjectType, subjectId: string, recordName: string, resourceKind: ResourceKinds, markers: string[], action: ActionKinds, currentTimeMs: number): Promise<GetMarkerPermissionResult>

      Gets the permission for the given subject, markers, and action.

      The first parameter is a SubjectType and is the type of the subject. Must be either a user, inst, or role.

      The second parameter is a string and is the ID of the subject.

      The third parameter is a string and is the name of the record that the resource belongs to.

      The fourth parameter is a ResourceKinds and is the kind of the resource.

      The fifth parameter is a string[] and is the markers that are applied to the resource.

      The parameter is a ActionKinds and is the action that the subject is attempting to perform on the resource.

      The parameter is a number and is the current unix time in milliseconds.

    • getPermissionForSubjectAndResource(subjectType: SubjectType, subjectId: string, recordName: string, resourceKind: ResourceKinds, resourceId: string, action: ActionKinds, currentTimeMs: number): Promise<GetResourcePermissionResult>

      Gets the permission for the given subject, resource, and action.

      The first parameter is a SubjectType and is the type of the subject. Must be either a user, inst, or role.

      The second parameter is a string and is the ID of the subject.

      The third parameter is a string and is the name of the record that the resource belongs to.

      The fourth parameter is a ResourceKinds and is the kind of the resource.

      The fifth parameter is a string and is the ID of the resource.

      The parameter is a ActionKinds and is the action that the subject is attempting to perform on the resource.

      The parameter is a number and is the current unix time in milliseconds.

    • getPlayerWebManifest(): Promise<object>

      Retrieves the PWA web manifest that should be served for the player. Resolves with null if no manifest is found.

    • getPrivoConfiguration(): Promise<object>

      Retrieves the privo configuration from the store.

    • getRecordByName(name: string): Promise<Record>

      Gets the record with the given name.

      The first parameter is a string and is the name of the record.

    • getRecordKeyByRecordAndHash(recordName: string, hash: string): Promise<RecordKey>

      Gets the record key for the given record name that has the given hash.

      The first parameter is a string and is the name of the record.

      The second parameter is a string and is the scrypt hash of the key that should be retrieved.

    • getRecordOwnerPrivacyFeatures(recordName: string): Promise<PrivacyFeatures>

      Gets the privacy features for the owner of the given record. Returns null if the record does not exist or if the record does not have an owner.

      The first parameter is a string and is the name of the record.

    • getResourcePermissionAssignmentById(id: string): Promise<ResourcePermissionAssignment>

      Gets the resource permission assignment with the given ID. Returns null if no assignment was found.

      The first parameter is a string and is the ID of the assignment.

    • getStudioByComId(comId: string): Promise<Studio>

      Gets the studio that has the given comId.

      The first parameter is a string and is the comId of the studio.

    • getStudioById(id: string): Promise<Studio>

      Gets the studio with the given ID.

      The first parameter is a string and is the ID of the studio.

    • getStudioByStripeAccountId(accountId: string): Promise<Studio>

      Gets the studio with the given stripe account ID. Returns null if no studio has that stripe account ID.

      The first parameter is a string and is the ID of the stripe account.

    • getStudioByStripeCustomerId(customerId: string): Promise<Studio>

      Gets the studio that has the given stripe customer ID.

      The first parameter is a string and is the stripe customer ID for the studio.

    • getStudioHumeConfig(studioId: string): Promise<object>

      Gets the hume config for the studio with the given ID. Returns null if the studio does not have a hume config.

      The first parameter is a string and is the ID of the studio.

    • getStudioLoomConfig(studioId: string): Promise<object>

      Gets the loom config for the studio with the given ID. Returns null if the studio does not have a loom config.

      The first parameter is a string and is the ID of the studio.

    • getSubscriptionAiChatMetrics(filter: SubscriptionFilter): Promise<AIChatSubscriptionMetrics>

      Gets the AI Chat metrics for the given user/studio.

      The first parameter is a SubscriptionFilter and is the filter.

    • getSubscriptionAiImageMetrics(filter: SubscriptionFilter): Promise<AIImageSubscriptionMetrics>

      Gets the AI Image metrics for the given user/studio.

      The first parameter is a SubscriptionFilter and is the filter.

    • getSubscriptionAiOpenAIRealtimeMetrics(filter: SubscriptionFilter): Promise<AIOpenAIRealtimeSubscriptionMetrics>

      Gets the AI OpenAI Realtime metrics for the given user/studio.

      The first parameter is a SubscriptionFilter and is the filter to use.

    • getSubscriptionAiSkyboxMetrics(filter: SubscriptionFilter): Promise<AISkyboxSubscriptionMetrics>

      Gets the AI Image metrics for the given user/studio.

      The first parameter is a SubscriptionFilter and is the filter.

    • getSubscriptionAiSloydMetrics(filter: SubscriptionFilter): Promise<AISloydSubscriptionMetrics>

      Gets the subscription metrics for sloyd.ai for the given user/studio.

      The first parameter is a SubscriptionFilter and is the filter.

    • getSubscriptionAiSloydMetricsByRecordName(recordName: string): Promise<AISloydSubscriptionMetrics>

      The first parameter is a string and

    • getSubscriptionById(id: string): Promise<AuthSubscription>

      Gets the subscription with the given ID.

      The first parameter is a string and is the ID of the subscription.

    • getSubscriptionByStripeSubscriptionId(id: string): Promise<AuthSubscription>

      Gets the subscription with the given stripe subscription ID.

      The first parameter is a string and is the ID of the stripe subscription.

    • getSubscriptionConfiguration(): Promise<SubscriptionConfiguration>

      Retrieves the subscription configuration from the store.

    • getSubscriptionDataMetricsByRecordName(recordName: string): Promise<DataSubscriptionMetrics>

      Gets the data metrics for the subscription of the given record.

      The first parameter is a string and is the name of the record.

    • getSubscriptionEventMetricsByRecordName(recordName: string): Promise<EventSubscriptionMetrics>

      Gets the event metrics for the subscription of the given record.

      The first parameter is a string and is the name of the record.

    • getSubscriptionFileMetricsByRecordName(recordName: string): Promise<FileSubscriptionMetrics>

      Gets the file metrics for the subscription of the given record.

      The first parameter is a string and is the name of the record.

    • getSubscriptionInfoForRecord(recordName: string): Promise<SubscriptionMetrics>

      The first parameter is a string and

    • getSubscriptionInstMetrics(filter: SubscriptionFilter): Promise<InstSubscriptionMetrics>

      Gets the inst metrics for the given user/studio.

      The first parameter is a SubscriptionFilter and is the filter.

    • getSubscriptionInstMetricsByRecordName(recordName: string): Promise<InstSubscriptionMetrics>

      Gets the inst metrics for the given record.

      The first parameter is a string and is the name of the record.

    • getSubscriptionPeriodById(id: string): Promise<AuthSubscriptionPeriod>

      Gets the subscription period with the given ID.

      The first parameter is a string and is the ID of the subscription period.

    • getSubscriptionRecordMetrics(filter: SubscriptionFilter): Promise<RecordSubscriptionMetrics>

      Gets the record metrics for the given user/studio.

      The first parameter is a SubscriptionFilter and is the filter.

    • getUserPrivacyFeatures(userId: string): Promise<UserPrivacyFeatures>

      Gets the privacy features that are enabled for the given user. Returns null if the given user does not exist.

      The first parameter is a string and is the ID of the user.

    • getVerifiedCustomDomainByName(domainName: string): Promise<CustomDomainWithStudio>

      Gets the verified custom domain with the given domain name. Returns null if no verified custom domain with the given name exists.

      The first parameter is a string and is the domain name.

    • getWebConfig(): Promise<WebConfig>

      Retrieves the web configuration from the store. Resolves with null if no configuration is found.

    • incrementLoginRequestAttemptCount(userId: string, requestId: string): Promise<void>

      Increments the attempt count for the given login request.

      The first parameter is a string and is the ID of the user.

      The second parameter is a string and is the ID of the login request.

    • init(): Promise<void>

      Initializes the store.

    • isPackageLoaded(recordName: string, inst: string, packageId: string): Promise<LoadedPackage>

      Determines whether the package with the given ID is loaded into the given inst. Returns the package that was loaded if it is loaded, or null if it is not.

      The first parameter is a string and is the name of the record that the inst is in.

      The second parameter is a string and is the inst.

      The third parameter is a string and is the ID of the package.

    • listAccounts(filter: FinancialAccountFilter): Promise<FinancialAccount[]>

      Gets a list of financial accounts by the given filter.

      The first parameter is a FinancialAccountFilter and is the filter to use.

    • listAssignments(recordName: string, startingRole: string): Promise<ListedRoleAssignments>

      Lists the role assignments in the given record.

      The first parameter is a string and is the name of the record.

      The second parameter is a string and

    • listAssignmentsForRole(recordName: string, role: string): Promise<ListedRoleAssignments>

      Lists the assignments for the given role.

      The first parameter is a string and is the name of the record.

      The second parameter is a string and is the name of the role.

    • listCustomDomainsByStudioId(studioId: string): Promise<CustomDomain[]>

      Gets the list of custom domains for the given studio ID.

      The first parameter is a string and is the ID of the studio.

    • listData(recordName: string, address: string): Promise<ListDataStoreResult>

      Lists data stored in the given record starting with the given address.

      The first parameter is a string and is the name of the record.

      The second parameter is a string and is the address to start listing items at.

    • listDataByMarker(request: ListDataStoreByMarkerRequest): Promise<ListDataStoreResult>

      Lists data stored in the given record that has the given marker, starting with the given address.

      The first parameter is a ListDataStoreByMarkerRequest and

    • listEmailRules(): Promise<RegexRule[]>

      Gets the list of email rules.

    • listEvents(recordName: string, eventName: string): Promise<ListEventsStoreResult>

      Lists the events that are in the given record.

      The first parameter is a string and is the name of the record.

      The second parameter is a string and is the name of the event that the list should start after.

    • listGrantedEntitlementsByFeatureAndUserId(packageIds: string[], feature: EntitlementFeature, userId: string, recordName: string, nowMs: number): Promise<GrantedPackageEntitlement[]>

      Gets the list of non-revoked granted entitlements for the given package IDs, feature, and userId.

      The first parameter is a string[] and is the IDs of the packages to list the entitlements for.

      The second parameter is a EntitlementFeature and is the feature that the entitlements are granted for.

      The third parameter is a string and is the ID of the user that the entitlements are granted to.

      The fourth parameter is a string and is the name of the record that the entitlements are granted for.

      The fifth parameter is a number and is the current unix time in milliseconds.

    • listGrantedEntitlementsForUser(userId: string, nowMs: number): Promise<GrantedPackageEntitlement[]>

      Lists all the active entitlements that the user has granted.

      The first parameter is a string and is the ID of the user.

      The second parameter is a number and is the current unix time in milliseconds.

    • listGrantedEntitlementsForUserAndPackage(userId: string, packageId: string, nowMs: number): Promise<GrantedPackageEntitlement[]>

      Lists all the active entitlements that the user has granted for the given package.

      The first parameter is a string and is the ID of the user.

      The second parameter is a string and is the ID of the package.

      The third parameter is a number and is the current unix time in milliseconds.

    • listInstsByRecord(recordName: string, startingInst?: string): Promise<ListInstsStoreResult>

      Gets the list of insts that are in the given record.

      The first parameter is a string and is the name of the record. If null, then an empty list will be returned.

      The second parameter is optional and is a string and is the name of the inst to start listing at.

    • listInstsByRecordAndMarker(recordName: string, marker: string, startingInst?: string): Promise<ListInstsStoreResult>

      Gets the list of insts that are in the given record and have the given marker.

      The first parameter is a string and is the name of the record. If null, then an empty list will be returned.

      The second parameter is a string and is the marker that the insts must have.

      The third parameter is optional and is a string and is the name of the inst to start listing at.

    • listLoadedPackages(recordName: string, inst: string): Promise<LoadedPackage[]>

      Gets the list of loaded packages for the given record and inst.

      The first parameter is a string and is the name of the record.

      The second parameter is a string and is the inst.

    • listPermissionsForMarker(recordName: string, marker: string): Promise<MarkerPermissionAssignment[]>

      Lists the marker permission assignments for the given record and marker.

      The first parameter is a string and is the record that the permission assignments should be listed for.

      The second parameter is a string and is the marker that the permission assignments should be listed for.

    • listPermissionsForResource(recordName: string, resourceKind: ResourceKinds, resourceId: string): Promise<ResourcePermissionAssignment[]>

      Lists the resource permission assignments for the given record and resource.

      The first parameter is a string and is the name of the record.

      The second parameter is a ResourceKinds and is the kind of the resource.

      The third parameter is a string and is the ID of the resource.

    • listPermissionsForSubject(recordName: string, subjectType: SubjectType, subjectId: string): Promise<ListPermissionsInRecordResult>

      Lists the resource permission assignments for the given subject in the given record.

      The first parameter is a string and is the name of the record.

      The second parameter is a SubjectType and is the type of the subject.

      The third parameter is a string and is the ID of the subject.

    • listPermissionsInRecord(recordName: string): Promise<ListPermissionsInRecordResult>

      Lists the resource permission assignments for the given record.

      The first parameter is a string and is the name of the record.

    • listPurchasedItemsByActivationKeyId(keyId: string): Promise<PurchasedItem[]>

      Gets the list of purchased items that are associated with the given activation key.

      The first parameter is a string and is the ID of the key.

    • listRecordsByOwnerId(ownerId: string): Promise<ListedRecord[]>

      Gets the list of records that the user with the given ID owns.

      If null or undefined, then this store does not support this method.

      The first parameter is a string and is the ID of the user that owns the records.

    • listRecordsByStudioId(studioId: string): Promise<ListedRecord[]>

      Gets the list of records that the studio with the given ID owns.

      If null or undefined, then this store does not support this method.

      The first parameter is a string and is the ID of the studio that owns the records.

    • listRecordsByStudioIdAndUserId(studioId: string, userId: string): Promise<ListedRecord[]>

      Gets the list of records that the studio with the given ID owns and that the user with the given ID has access to.

      The first parameter is a string and is the ID of the studio.

      The second parameter is a string and is the ID of the user.

    • listRecordsForSubscriptionByRecordName(recordName: string): Promise<ListedRecord[]>

      The first parameter is a string and

    • listRolesForInst(recordName: string, inst: string): Promise<AssignedRole[]>

      Lists the roles that are assigned to the given inst.

      The first parameter is a string and is the name of the record.

      The second parameter is a string and is the name of the inst.

    • listRolesForUser(recordName: string, userId: string): Promise<AssignedRole[]>

      Lists the roles that are assigned to the user.

      The first parameter is a string and is the name of the record that the role assignments belong to.

      The second parameter is a string and is the ID of the user.

    • listSessions(userId: string, expireTimeMs: number): Promise<ListSessionsDataResult>

      Lists the sessions that belong to the given user.

      The first parameter is a string and is the ID of the user.

      The second parameter is a number and is the expiration time that the list should start after.

    • listSmsRules(): Promise<RegexRule[]>

      Gets the list of SMS rules.

    • listStudioAssignments(studioId: string, filters?: ListStudioAssignmentFilters): Promise<ListedStudioAssignment[]>

      Gets the list of users that have been assigned to the given studio.

      The first parameter is a string and is the ID of the studio.

      The second parameter is optional and is a ListStudioAssignmentFilters and is the additional filters that should be used.

    • listStudiosForUser(userId: string): Promise<StoreListedStudio[]>

      Gets the list of studios that the user with the given ID has access to. Returns only studios that are not owned by any comId.

      The first parameter is a string and is the ID of the user.

    • listStudiosForUserAndComId(userId: string, comId: string): Promise<StoreListedStudio[]>

      Gets the list of studios that are owned by the given comId and that the user with the given ID has access to.

      The first parameter is a string and is the ID of the user.

      The second parameter is a string and is the comId of the studio that owns the studios.

    • listSubscriptionPeriodsBySubscriptionId(subscriptionId: string): Promise<AuthSubscriptionPeriod[]>

      Gets the subscription periods that belong to the given subscription.

      The first parameter is a string and is the ID of the subscription.

    • listUploadedFiles(recordName: string, fileName: string): Promise<ListFilesStoreResult>

      Attempts to list the files in the given record.

      The first parameter is a string and is the name of the record.

      The second parameter is a string and is the name of the file that the listing should start after.

    • listUserAssignments(userId: string): Promise<ListedUserAssignment[]>

      Gets the list of studio assignments that the user with the given ID has access to.

      The first parameter is a string and is the ID of the user.

    • listUserAuthenticators(userId: string): Promise<AuthUserAuthenticator[]>

      Gets the list of authenticators for the given user.

      The first parameter is a string and is the ID of the user.

    • markCheckoutSessionFulfilled(sessionId: string, fulfilledAtMs: number): Promise<void>

      Marks the checkout session with the given ID as fulfilled.

      The first parameter is a string and is the ID of the checkout session.

      The second parameter is a number and is the unix time in miliseconds that the session was fulfilled at.

    • markCustomDomainAsVerified(domainId: string): Promise<void>

      Marks the custom domain with the given ID as verified.

      The first parameter is a string and is the ID of the custom domain to mark as verified.

    • markLoginRequestComplete(userId: string, requestId: string, completedTimeMs: number): Promise<void>

      Marks the login request as completed.

      The first parameter is a string and is the ID oof the user.

      The second parameter is a string and is the ID of the request.

      The third parameter is a number and is the time that the request was completed.

    • markOpenIDLoginRequestComplete(requestId: string, completedTimeMs: number): Promise<void>

      Marks the login request as completed.

      The first parameter is a string and is the ID of the request.

      The second parameter is a number and is the time that the request was completed.

    • markPayoutAsPosted(payoutId: string, postedTransferId: string, postedAtMs: number): Promise<void>

      Marks a payout as posted.

      The first parameter is a string and is the ID of the payout to mark as posted.

      The second parameter is a string and is the ID of the transfer that posted the payout.

      The third parameter is a number and is the time that the payout was posted at in milliseconds since epoch.

    • markPayoutAsVoided(payoutId: string, voidedTransferId: string, voidedAtMs: number): Promise<void>

      Marks a payout as voided.

      The first parameter is a string and is the ID of the payout to mark as voided.

      The second parameter is a string and is the ID of the transfer that voided the payout.

      The third parameter is a number and is the time that the payout was voided at in milliseconds since epoch.

    • markWebAuthnLoginRequestComplete(requestId: string, userId: string, completedTimeMs: number): Promise<void>

      Marks the login request as completed.

      The first parameter is a string and is the ID of the request.

      The second parameter is a string and is the ID of the user that completed the request.

      The third parameter is a number and is the time that the request was completed.

    • presignFileRead(request: PresignFileReadRequest): Promise<PresignFileReadResult>

      Presigns a request to read a file. Returns the URL that can be used to read the file.

      The first parameter is a PresignFileReadRequest and is the request to create a signed request for.

    • presignFileUpload(request: PresignFileUploadRequest): Promise<PresignFileUploadResult>

      Presigns a request to record a file. Returns the URL that should be used to upload the file and the headers that should be included in the upload request.

      The first parameter is a PresignFileUploadRequest and is the request to create a signed request for.

    • recordChatMetrics(metrics: AIChatMetrics): Promise<void>

      Saves the given AI Chat metrics.

      The first parameter is a AIChatMetrics and

    • recordImageMetrics(metrics: AIImageMetrics): Promise<void>

      Saves the given AI Image metrics.

      The first parameter is a AIImageMetrics and

    • recordOpenAIRealtimeMetrics(metrics: AIOpenAIRealtimeMetrics): Promise<void>

      Records the given ai.openai.realtime metrics.

      The first parameter is a AIOpenAIRealtimeMetrics and is the metrics to record.

    • recordSkyboxMetrics(metrics: AISkyboxMetrics): Promise<void>

      Saves the given AI Skybox metrics.

      The first parameter is a AISkyboxMetrics and

    • recordSloydMetrics(metrics: AISloydMetrics): Promise<void>

      Records the given sloyd.ai metrics.

      The first parameter is a AISloydMetrics and is the metrics to record.

    • removeStudioAssignment(studioId: string, userId: string): Promise<void>

      Removes the given user from the given studio.

      The first parameter is a string and is the ID of the studio.

      The second parameter is a string and is the ID of the user.

    • replaceCurrentUpdates(recordName: string, inst: string, branch: string, updateToAdd: string, sizeInBytes: number): Promise<ReplaceUpdatesResult>

      Replaces the current set of updates with a new update. Useful for when updates have been merged and the old ones should be replaced by the new one.

      Depending on the implementation, this function may or may not be concurrent safe. That is, if two clients call this function at the same time for the same branch, then it is possible that the branch will be put into an invalid state.

      The first parameter is a string and is the name of the record. If null, then the updates will be added to a tempPublic inst.

      The second parameter is a string and is the name of the inst.

      The third parameter is a string and is the branch in the inst.

      The fourth parameter is a string and is the update that should be added.

      The fifth parameter is a number and is the size of the new update in bytes.

    • replaceSession(session: AuthSession, newSession: AuthSession, revokeTimeMs: number): Promise<void>

      Marks the given session as replaced by the new session and saves the new session.

      The first parameter is a AuthSession and is the session that was replaced.

      The second parameter is a AuthSession and is the new session.

      The third parameter is a number and is the time that the old session is to be revoked at. (Usually now)

    • revokeSubjectRole(recordName: string, subjectId: string, type: ("user" | "inst"), role: string): Promise<UpdateUserRolesResult>

      Revokes the given role from the subject. If the role is not assigned, then this function does nothing.

      The first parameter is a string and is the name of the record.

      The second parameter is a string and is the ID of the subject.

      The third parameter is a ("user" | "inst") and is the type of subject.

      The fourth parameter is a string and is the ID of the role that should be revoked.

    • saveBillingCycleHistory(history: BillingCycleHistory): Promise<void>

      Creates or updates the given billing cycle history.

      The first parameter is a BillingCycleHistory and is the billing cycle history to save.

    • saveBranch(branch: BranchRecord): Promise<SaveBranchResult>

      Creates or updates the given branch record.

      The first parameter is a BranchRecord and is the branch that should be saved.

    • saveComIdRequest(request: StudioComIdRequest): Promise<void>

      Saves the given comId request.

      The first parameter is a StudioComIdRequest and is the request.

    • saveCustomDomain(domain: CustomDomain): Promise<void>

      Saves the given custom domain to the store.

      The first parameter is a CustomDomain and is the custom domain to save.

    • saveGrantedPackageEntitlement(grantedEntitlement: GrantedPackageEntitlement): Promise<void>

      Saves the given granted entitlement.

      The first parameter is a GrantedPackageEntitlement and is the entitlement that should be saved.

    • saveInst(inst: InstWithBranches): Promise<SaveInstResult>

      Creates or updates the given inst. If branches are included, then they will be added/updated to the inst as well.

      The first parameter is a InstWithBranches and is the inst that should be saved.

    • saveInvoice(invoice: AuthInvoice): Promise<void>

      Creates or updates the given invoice.

      The first parameter is a AuthInvoice and is the invoice that should be saved.

    • saveLoadedPackage(loadedPackage: LoadedPackage): Promise<void>

      Saves the given loaded package.

      The first parameter is a LoadedPackage and is the package that should be saved.

    • saveLoginRequest(request: AuthLoginRequest): Promise<AuthLoginRequest>

      Saves the given login request.

      The first parameter is a AuthLoginRequest and is the request that should be saved.

    • saveNewUser(user: AuthUser): Promise<SaveNewUserResult>

      Attempts to save the given user as a new user.

      The first parameter is a AuthUser and is the user that should be saved.

    • saveOpenIDLoginRequest(request: AuthOpenIDLoginRequest): Promise<AuthOpenIDLoginRequest>

      Saves the given login request.

      The first parameter is a AuthOpenIDLoginRequest and is the request that should be saved.

    • saveOpenIDLoginRequestAuthorizationCode(requestId: string, authorizationCode: string, authorizationTimeMs: number): Promise<void>

      Saves the given authorization code for the given login request.

      The first parameter is a string and is the ID of the request.

      The second parameter is a string and is the authorization code that should be saved.

      The third parameter is a number and is the time of the authorization.

    • savePurchasedItem(item: PurchasedItem): Promise<void>

      Creates or updates the given purchased item.

      The first parameter is a PurchasedItem and is the item.

    • saveSession(session: AuthSession): Promise<void>

      Saves the given login session.

      The first parameter is a AuthSession and is the session that should be saved.

    • saveSubscription(subscription: AuthSubscription): Promise<void>

      Creates or updates the given subscription.

      The first parameter is a AuthSubscription and is the subscription to save.

    • saveSubscriptionPeriod(period: AuthSubscriptionPeriod): Promise<void>

      Creates or updates the given subscription period.

      The first parameter is a AuthSubscriptionPeriod and is the subscription period.

    • saveUser(user: AuthUser): Promise<void>

      Adds or updates the given user.

      The first parameter is a AuthUser and is the user that should be saved.

    • saveUserAuthenticator(authenticator: AuthUserAuthenticator): Promise<void>

      Saves the given authenticator.

      The first parameter is a AuthUserAuthenticator and is the authenticator that should be saved.

    • saveUserAuthenticatorCounter(id: string, newCounter: number): Promise<void>

      Saves the counter for the given authenticator.

      The first parameter is a string and is the ID of the authenticator.

      The second parameter is a number and is the counter that should be saved.

    • saveUserInstReport(report: UserInstReport): Promise<void>

      Saves the given inst report.

      The first parameter is a UserInstReport and is the report to save.

    • saveWebAuthnLoginRequest(request: AuthWebAuthnLoginRequest): Promise<AuthWebAuthnLoginRequest>

      Saves the given WebAuthn login request.

      The first parameter is a AuthWebAuthnLoginRequest and is the request that should be saved.

    • sendRecordNotification(notification: RecordsNotification): Promise<void>

      Sends a notification to the user.

      The first parameter is a RecordsNotification and is the notification to send.

    • setConfiguration(key: TKey, value: ConfigurationInput): Promise<void>

      Updates the stored configuration value for the given key.

      The first parameter is a TKey and is the key to set.

      The second parameter is a ConfigurationInput and is the value to set.

    • setCurrentLoginRequest(userId: string, requestId: string): Promise<void>

      Sets the ID of the login request that is allowed to be completed for the given user. At any particular moment, only one login request is allowed to be completed by a user. This is used to help mitigate distributed brute force attacks. (i.e. attacks that try generating a lot of login requests and guessing the codes)

      The first parameter is a string and is the ID of the user.

      The second parameter is a string and is the ID of the login request.

    • setCurrentWebAuthnChallenge(userId: string, challenge: string): Promise<void>

      Sets the current WebAuthn challenge that the user is trying to complete. At any particular moment, only one WebAuthn challenge is allowed to be completed by a user.

      The first parameter is a string and is the ID of the user.

      The second parameter is a string and is the challenge.

    • setData(recordName: string, address: string, data: any, publisherId: string, subjectId: string, updatePolicy: UserPolicy, deletePolicy: UserPolicy, markers: string[]): Promise<SetDataResult>

      Sets the given data in the given record and address.

      The first parameter is a string and is the name of the record that the data should be set in.

      The second parameter is a string and is the address that the data should be set for.

      The third parameter is a any and is the data that should be saved.

      The fourth parameter is a string and is the ID of the user that owns the record this data is being published to.

      The fifth parameter is a string and is the ID of the user that was logged in when the data was published.

      The parameter is a UserPolicy and is the update policy that should be stored.

      The parameter is a UserPolicy and is the delete policy that should be stored.

      The parameter is a string[] and is the list of resource markers that should be applied to the data.

    • setFileRecordAsUploaded(recordName: string, fileName: string): Promise<MarkFileRecordAsUploadedResult>

      Marks the given file record as having been uploaded.

      The first parameter is a string and is the reocrd that the file was uploaded to.

      The second parameter is a string and is the name of the file that was uploaded.

    • setRevokeAllSessionsTimeForUser(userId: string, allSessionRevokeTimeMs: number): Promise<void>

      Sets the time that all sessions are revoked on the specified user.

      The first parameter is a string and is the ID of the user that all sessions should be revoked for.

      The second parameter is a number and is the unix time that should be recorded.

    • updateCheckoutSessionInfo(request: UpdateCheckoutSessionRequest): Promise<void>

      Updates the info for a checkout session.

      The first parameter is a UpdateCheckoutSessionRequest and is the

    • updateEvent(recordName: string, eventName: string, updates: EventRecordUpdate): Promise<UpdateEventResult>

      Updates the given event with the given information.

      The first parameter is a string and is the name of the record that the event is in.

      The second parameter is a string and is the name of the event that should be updated.

      The third parameter is a EventRecordUpdate and is the updates to apply to the event.

    • updateExternalPayout(payout: PartialExcept): Promise<void>

      Updates the given external payout.

      The first parameter is a PartialExcept and is the payout to update.

    • updateFileRecord(recordName: string, fileName: string, markers: string[]): Promise<UpdateFileResult>

      Attempts to update the given file record.

      The first parameter is a string and is the name of the record that the file was recorded in.

      The second parameter is a string and is the name of the file.

      The third parameter is a string[] and is the markers that should be set on the file.

    • updateRecord(record: Record): Promise<void>

      Updates the given record.

      The first parameter is a Record and is the record that should be updated.

    • updateStudio(studio: Studio): Promise<void>

      Updates the given studio.

      The first parameter is a Studio and is the studio record that should be updated.

    • updateStudioAssignment(assignment: StudioAssignment): Promise<void>

      Updates the given studio assignment.

      The first parameter is a StudioAssignment and is the assignment that should be updated.

    • updateStudioHumeConfig(studioId: string, config: object): Promise<void>

      Updates the hume config for the studio with the given ID.

      The first parameter is a string and is the ID of the studio that should be updated.

      The second parameter is a object and is the config that should be updated for the studio.

    • updateStudioLoomConfig(studioId: string, config: object): Promise<void>

      Updates the loom config for the studio with the given ID.

      The first parameter is a string and is the ID of the studio that should be updated.

      The second parameter is a object and is the config that should be updated for the studio.

    • updateSubscriptionInfo(request: UpdateSubscriptionInfoRequest): Promise<void>

      Updates the subscription info for a user/studio.

      This will create/update a subscription object, update the info on the user/studio and subscription, and optionally update the period of the subscription.

      The first parameter is a UpdateSubscriptionInfoRequest and is the request.

    • updateSubscriptionPeriod(request: UpdateSubscriptionPeriodRequest): Promise<void>

      Updates the subscription period for a user/studio.

      This will update the period of the subscription, and optionally create subscription objects for the user/studio if neccesary.

      The first parameter is a UpdateSubscriptionPeriodRequest and is the request.

  • MetricsStore

    Members

  • ModerationController

    Defines a class that implements various moderation tasks.

    Members

  • ModerationFileScanResult

    Members

    • appearsToMatchBannedContent boolean

      Whether the file has detected labels that are banned.

    • createdAtMs number

      The unix time in milliseconds that the scan was created.

    • fileName string

      The name of the file.

    • id string

      The ID of the scan.

    • jobId string

      The ID of the job that the scan is associated with.

    • labels ModerationFileScanResultLabel[]

      The labels that were detected in the file.

    • modelVersion string

      The version of the model that was used to scan the file.

    • recordName string

      The name of the record that the file was stored inside.

    • updatedAtMs number

      The unix time in milliseconds that the scan was last updated.

  • ModerationJob

    Members

    • createdAtMs number

      The unix time in milliseconds that the job was created.

    • id string

      The ID of the moderation job.

    • s3Id? string

      The ID of the s3 batch job that is being used to scan the files.

    • type "files"

      The type of the moderation job.

    • updatedAtMs number

      The unix time in milliseconds that the job was last updated.

  • ModerationJobProvider

    Defines a class that is able to start moderation jobs. This can include scanning files, messages, etc.

    Members

  • ModerationResourceScanNotification

    Defines a notification that is for a user inst report.

    Members

    • action NotificationResourceActions

      The action that was taken on the resource.

    • bannedLabel? ModerationFileScanLabel

      The label that caused the resource to be banned.

    • labels ModerationFileScanLabel[]

      The labels that were detected in the file.

    • markers? string[]

      The markers that are present on the resource.

    • message string

      The message that should be sent with the notification.

    • recordName string

      The name of the record that the resource was scanned in.

    • resource "moderation_scan"

    • resourceId string

      The ID of the resource that was scanned.

    • resourceKind ResourceKinds

      The kind of the resource that was scanned.

    • resultId string

      The ID of the moderation result that was created for the resource.

    • timeMs number

      The time of the scan in unix time in milliseconds.

  • ModerationStore

    Members

  • NotificationPushSubscription

    Defines a push subscription that is stored in the store.

    Members

    • active boolean

      Whether the push subscription is active.

    • endpoint string

      The endpoint that should be used to send push notifications.

    • id string

      The ID of the push subscription.

    • keys Record

      The keys that should be used to send push notifications.

  • NotificationRecordsController

    Defines a controller that can be used to interact with NotificationRecords.

    Members

  • NotificationRecordsStore

    Defines a store that contains notification records.

    Members

    • countSubscriptionsForNotification(recordName: string, address: string): Promise<number>

      Gets the total number of subscriptions that are currently active for the given notification.

      The first parameter is a string and is the name of the record that the notification is in.

      The second parameter is a string and is the address of the notification.

    • createItem(recordName: string, item: NotificationRecord): Promise<void>

      Creates a new record.

      The first parameter is a string and is the name of the record.

      The second parameter is a NotificationRecord and is the item to create.

    • createSentPushNotifications(notifications: SentPushNotification[]): Promise<void>

      Saves the given list of notifications that were sent.

      The first parameter is a SentPushNotification[] and is the list notifications that were sent.

    • deleteItem(recordName: string, address: string): Promise<void>

      Deletes the item with the given ID.

      The first parameter is a string and is the name of the record that the item lives in.

      The second parameter is a string and is the address of the item to delete.

    • deleteSubscription(id: string): Promise<void>

      Deletes the given subscription.

      The first parameter is a string and is the ID of the subscription.

    • getAllSubscriptionMetrics(): Promise<NotificationSubscriptionMetrics[]>

      Gets the subscription metrics for all users and studios.

    • getItemByAddress(recordName: string, address: string): Promise<NotificationRecord>

      Reads the item with the given address. Returns null if the item does not exist.

      The first parameter is a string and is the name of the record that the item lives in.

      The second parameter is a string and is the address of the item to read.

    • getSubscriptionById(id: string): Promise<NotificationSubscription>

      Finds the subscription with the given ID. Returns null if no subscription was found.

      The first parameter is a string and is the ID of the subscription.

    • getSubscriptionByRecordAddressAndPushSubscriptionId(recordName: string, notificationAddress: string, pushSubscriptionId: string): Promise<NotificationSubscription>

      Finds the subscription with the given record, address and push subscription ID. Returns null if no subscription was found.

      The first parameter is a string and is the name of the record.

      The second parameter is a string and is the address of the notification.

      The third parameter is a string and is the ID of the push subscription.

    • getSubscriptionByRecordAddressAndUserId(recordName: string, notificationAddress: string, userId: string): Promise<NotificationSubscription>

      Finds the subscription with the given record, address and user ID. Returns null if no subscription was found.

      The first parameter is a string and is the name of the record.

      The second parameter is a string and is the address of the notification.

      The third parameter is a string and is the ID of the user.

    • getSubscriptionMetrics(filter: SubscriptionFilter): Promise<NotificationSubscriptionMetrics>

      Gets the item metrics for the subscription of the given user or studio.

      The first parameter is a SubscriptionFilter and is the filter to use.

    • listActivePushSubscriptionsForNotification(recordName: string, notificationAddress: string): Promise<UserPushSubscription[]>

      Gets the list of active push subscriptions for the given notification.

      The first parameter is a string and is the name of the record.

      The second parameter is a string and is the address of the notification.

    • listItems(recordName: string, address: string): Promise<ListCrudStoreSuccess>

      Gets a list of the items in the record starting after the given address.

      The first parameter is a string and is the name of the record.

      The second parameter is a string and is the address to start listing items after.

    • listItemsByMarker(request: ListCrudStoreByMarkerRequest): Promise<ListCrudStoreSuccess>

      Gets a list of the items in the record that have the given marker starting after the given address.

      The first parameter is a ListCrudStoreByMarkerRequest and is the request to list items by marker.

    • listSubscriptionsForNotification(recordName: string, notificationAddress: string): Promise<NotificationSubscription[]>

      Gets the list of active subscriptions for the given notification.

      The first parameter is a string and is the record that the notification is in.

      The second parameter is a string and is the address that the notification is at.

    • listSubscriptionsForUser(userId: string): Promise<NotificationSubscription[]>

      Gets the list of subscriptions for the given user.

      The first parameter is a string and is the ID of the user.

    • markPushSubscriptionsInactiveAndDeleteUserRelations(ids: string[]): Promise<void>

      Marks the given list of push subscriptions as inactive and deletes the related PushSubscriptionUser relations.

      The first parameter is a string[] and is the IDs of the subscriptions to inactivate.

    • putItem(recordName: string, item: PartialExcept): Promise<void>

      Creates or updates the record with the given ID. If updating a record, keys that are not present in the record will not be updated.

      The first parameter is a string and is the name of the record that the item lives in.

      The second parameter is a PartialExcept and is the item to create or update.

    • savePushSubscription(pushSubscription: NotificationPushSubscription): Promise<void>

      Saves the given push subscription.

      The first parameter is a NotificationPushSubscription and is the push subscription to save.

    • savePushSubscriptionUser(pushSubscription: PushSubscriptionUser): Promise<void>

      Saves the given push subscription for the given user.

      The first parameter is a PushSubscriptionUser and is the push subscription to save.

    • saveSentNotification(notification: SentNotification): Promise<void>

      Saves the given sent notification.

      The first parameter is a SentNotification and is the notification to save as sent.

    • saveSentPushNotification(push: SentPushNotification): Promise<void>

      Saves the given sent push notification.

      The first parameter is a SentPushNotification and is the notification that was sent.

    • saveSubscription(subscription: NotificationSubscription): Promise<SaveSubscriptionResult>

      Saves the given subscription.

      The first parameter is a NotificationSubscription and is the subscription to save.

    • updateItem(recordName: string, item: PartialExcept): Promise<void>

      Updates the record with the given ID. Keys that are not present in the record will not be updated.

      The first parameter is a string and is the name of the record that the item lives in.

      The second parameter is a PartialExcept and

  • NotificationSubscription

    Defines an active subscription to a notification.

    Members

    • id string

      The ID of the subscription.

    • notificationAddress string

      The address of the notification in the record.

    • pushSubscriptionId string

      The push subscription that the notification should be sent to. If null, then notifications should be sent to all push subscriptions for the user.

    • recordName string

      The name of the record that the subscription is for.

    • userId string

      The ID of the user that is subscribed. If null, then notifications should only be sent to the specified push subscription.

  • NotificationSubscriptionMetrics

    Members

    • currentPeriodEndMs number

      The unix time in miliseconds of the end of the current subscription period.

    • currentPeriodStartMs number

      The unix time in miliseconds of the start of the current subscription period.

    • ownerId string

    • recordName? string

    • stripeAccountId string

      The ID of the stripe account that the record is associated with. Null if a stripe account is not associated with the record.

    • stripeAccountStatus StripeAccountStatus

      The status of the stripe account that the record is associated with. Null if a stripe account is not associated with the record.

    • studioId string

    • subscriptionId string

      The ID of the subscription.

    • subscriptionStatus string

      The status of the subscription.

    • subscriptionType ("user" | "studio")

      The type of the subscription.

    • totalItems number

      The total number of notification items that are stored in the subscription.

    • totalSentNotificationsInPeriod number

      The number of sent notifications that have been recorded for the last subscription period.

    • totalSentPushNotificationsInPeriod number

      The number of sent push notifications that have been recorded for the last subscription period.

    • totalSubscribers number

      The total number of subscribers that are currently active for the subscription.

    • userId? string

  • OpenAIChatOptions

    Members

    • additionalProperties? Record

      The additional properties that should be included in requests.

    • apiKey string

      The API key to use.

    • baseUrl? string

      The HTTP base URL to use for the OpenAI API. Defaults to "https://api.openai.com/v1/"

    • name? string

      The name of this interface to use for logging;

  • OpenAIImageOptions

    Members

    • apiKey string

      The API key to use.

    • defaultHeight? number

      The height that should be used for images that don't specify a height.

    • defaultWidth? number

      The width that should be used for images that don't specify a width.

  • OpenAIRealtimeOptions

    Members

    • apiKey string

      The API key to use.

  • OpenBarcodeScannerAction

    An event that is used to show or hide the barcode scanner.

    Members

    • cameraType CameraType

      The camera that should be used.

    • disallowSwitchingCameras boolean

      Whether to not allow switching the camera.

    • open boolean

      Whether the barcode scanner should be visible.

    • type "show_barcode_scanner"

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • OpenIDLoginRequest

    Members

    • ipAddress string

      The IP address that the request is from.

    • provider string

      The Open ID provider that the login request is for.

  • OpenImageClassifierAction

    An event that is used to show or hide an image classifier on screen.

    Members

    • cameraType? CameraType

      The camera that should be used for the image classifier.

    • modelJsonUrl? string

      The URL that the model JSON should be loaded from. Not required. Can be used if you are storing the model JSON in a custom location.

    • modelMetadataUrl? string

      The URL that the model metadata should be loaded from. Not required. Can be used if you are storing the model metadata in a custom location.

    • modelUrl? string

      The URL that the model should be loaded from.

    • open boolean

      Whether the image classifier should be visible.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • taskId (string | number)

      The ID of the async task.

    • type "show_image_classifier"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • OpenPhotoCameraAction

    An event that is used to show or hide the photo camera.

    Members

    • open boolean

      Whether the photo camera should be visible.

    • options PhotoCameraOptions

      The options for the action.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • singlePhoto boolean

      Whether only a single photo should be taken.

    • taskId (string | number)

      The ID of the async task.

    • type "open_photo_camera"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • OpenQRCodeScannerAction

    An event that is used to show or hide the QR Code Scanner.

    Members

    • cameraType CameraType

      The camera that should be used.

    • disallowSwitchingCameras boolean

      Whether to not allow switching the camera.

    • open boolean

      Whether the QR Code scanner should be visible.

    • type "show_qr_code_scanner"

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • PackageRecordVersion

    Members

    • address string

      The address that the item is stored under.

    • auxFileName string

      The name of the aux file that is stored for this version.

    • auxSha256 string

      The SHA-256 hash of the aux.

    • createdAtMs number

      The unix time in miliseconds that this package version was created at.

    • createdFile boolean

      Whether the aux file was created for this version.

    • description string

      The description of the package.

    • entitlements Entitlement[]

      The list of entitlements that the package requires.

    • id string

      The ID of the package version.

    • key PackageRecordVersionKey

      The key of the item.

    • markers string[]

      The markers for the package version.

    • requiresReview boolean

      Whether the package version requires review. Packages that do not require review are automatically approved and cannot have entitlements that require review.

    • sha256 string

      The SHA-256 hash of the package version.

    • sizeInBytes number

      The size of the package version in bytes.

  • PackageRecordVersionKey

    Members

    • major number

      The major version of the package.

    • minor number

      The minor version of the package.

    • patch number

      The patch version of the package.

    • tag string

      The pre-release version of the package. If empty or null, then this is a stable release.

  • PackageRecordVersionKeySpecifier

    Defines an interface that represents a package version key specifier. That is, a way to identify a package version by its key.

    Members

    • major? number

      The major number of the version to load. If omitted, then the latest major version will be loaded.

    • minor? number

      The minor number of the version to load. If not specifed, then the latest minor version will be loaded.

    • patch? number

      The patch number of the version to load. If not specified, then the latest patch version will be loaded.

    • sha256? string

      The SHA-256 hash of the version to load. If not specified, then the SHA-256 will not be checked. If specified, then the SHA-256 will be checked against the version that is loaded.

    • tag? string

      The tag of the version to load. If not specified, then the untagged version will be loaded.

  • PackageRecordsController

    Defines a controller that can be used to interact with NotificationRecords.

    Members

  • PackageSubscriptionMetrics

    Members

    • currentPeriodEndMs number

      The unix time in miliseconds of the end of the current subscription period.

    • currentPeriodStartMs number

      The unix time in miliseconds of the start of the current subscription period.

    • ownerId string

    • recordName? string

    • stripeAccountId string

      The ID of the stripe account that the record is associated with. Null if a stripe account is not associated with the record.

    • stripeAccountStatus StripeAccountStatus

      The status of the stripe account that the record is associated with. Null if a stripe account is not associated with the record.

    • studioId string

    • subscriptionId string

      The ID of the subscription.

    • subscriptionStatus string

      The status of the subscription.

    • subscriptionType ("user" | "studio")

      The type of the subscription.

    • totalItems number

      The total number of packages stored in the subscription.

    • userId? string

  • PackageVersion

    Members

    • major number

      The major version of the package.

    • minor number

      The minor version of the package.

    • patch number

      The patch version of the package.

    • tag string

      The pre-release version of the package. If empty or null, then this is a stable release.

  • PackageVersionPublishNotification

    Defines a notification that is for a user inst report.

    Members

    • action NotificationResourceActions

      The action that was taken on the resource.

    • markers? string[]

      The markers that are present on the resource.

    • package PackageRecordVersion

      The package version that was created.

    • recordName? string

      The name of the record that the notification is for. Null or undefined if the notification is not for a specific record.

    • resource "package_version_publish"

    • resourceId string

      The ID of the resource.

    • timeMs number

      The unix time in milliseconds that the notification was sent.

  • PackageVersionRecordsStore

    Defines a store that contains notification records.

    Members

    • createItem(recordName: string, item: PackageRecordVersion): Promise<CrudResult>

      Creates a new item in the record.

      The first parameter is a string and is the name of the record.

      The second parameter is a PackageRecordVersion and is the item to create.

    • deleteItem(recordName: string, address: string, key: PackageRecordVersionKey): Promise<CrudResult>

      Deletes the item with the given key.

      The first parameter is a string and is the name of the record that the item lives in.

      The second parameter is a string and is the address of the record item that the item resides in.

      The third parameter is a PackageRecordVersionKey and is the key of the item to delete.

    • getItemById(id: string): Promise<GetPackageVersionByKeyResult>

      Reads the item with the given ID.

      The first parameter is a string and is the ID of the item.

    • getItemByKey(recordName: string, address: string, key: PackageRecordVersionKey): Promise<GetPackageVersionByKeyResult>

      Reads the item with the given address and key. Always returns an object with the item and any markers that are related to the item.

      The first parameter is a string and is the name of the record that the item lives in.

      The second parameter is a string and is the address of the record item.

      The third parameter is a PackageRecordVersionKey and is the key of the item to read.

    • getItemBySpecifier(recordName: string, address: string, specifier: PackageRecordVersionKeySpecifier): Promise<GetPackageVersionByKeyResult>

      Gets the package version that most closely matches the given specifier. Always returns an object with the item and any markers that are related to the item.

      The first parameter is a string and is the name of the record.

      The second parameter is a string and is the address of the item.

      The third parameter is a PackageRecordVersionKeySpecifier and is the specifier to use to find the item.

    • getMostRecentPackageVersionReview(packageVersionId: string): Promise<PackageVersionReview>

      Gets the most recent review for the given package version. Returns null if there are no reviews for the package version.

      The first parameter is a string and is the ID of the package version.

    • getPackageVersionReviewById(id: string): Promise<PackageVersionReview>

      Gets a review for a package version by its ID. Returns null if the review does not exist.

      The first parameter is a string and is the ID of the review.

    • getSubscriptionMetrics(filter: SubscriptionFilter): Promise<PackageVersionSubscriptionMetrics>

      Gets the item metrics for the subscription of the given user or studio.

      The first parameter is a SubscriptionFilter and is the filter to use.

    • listItems(recordName: string, address: string): Promise<ListSubCrudStoreSuccess>

      Gets a list of the items for the given record and address.

      The first parameter is a string and is the name of the record.

      The second parameter is a string and is the address of the item to list.

    • putItem(recordName: string, item: Partial<PackageRecordVersion>): Promise<CrudResult>

      Creates or updates the record with the given ID. If updating a record, keys that are not present in the record will not be updated.

      The first parameter is a string and is the name of the record that the item lives in.

      The second parameter is a Partial<PackageRecordVersion> and is the item to create or update.

    • putReviewForVersion(review: PackageVersionReview): Promise<CrudResult>

      Creates or updates a review for a package version.

      The first parameter is a PackageVersionReview and is the review to create or update.

    • updateItem(recordName: string, item: Partial<PackageRecordVersion>): Promise<CrudResult>

      Updates the record with the given ID. Keys that are not present in the record will not be updated.

      The first parameter is a string and is the name of the record that the item lives in.

      The second parameter is a Partial<PackageRecordVersion> and

    • updatePackageVersionReviewStatus(id: string, reviewStatus: ("approved" | "pending" | "rejected"), comments: string): Promise<CrudResult>

      Updates the given package version review with the given review status and comments.

      The first parameter is a string and is the ID of the review.

      The second parameter is a ("approved" | "pending" | "rejected") and is the new review status.

      The third parameter is a string and is the new comments.

  • PasteStateAction

    An event to paste the given bots state as a new worksurface at a position.

    Members

    • options PasteStateOptions

      The options for the event.

    • type "paste_state"

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • PasteStateOptions

    The options for pasting bots state into a channel.

    Members

    • dimension? string

      The dimension that the state should be pasted into.

    • x number

      The X position that the state should be pasted at. If a dimension is provided then this is the X position inside the dimension. If a dimension is not provided then this is the X position that the new dimension should be created at.

    • y number

      The Y position that the state should be pasted at. If a dimension is provided then this is the Y position inside the dimension. If a dimension is not provided then this is the Y position that the new dimension should be created at.

    • z number

      The Z position that the state should be pasted at. If a dimension is provided then this is the Z position inside the dimension. If a dimension is not provided then this is the Z position that the new dimension should be created at.

  • PayContractInvoiceRequest

    Members

    • invoiceId string

      The ID of the invoice that should be paid.

    • userId string

      The ID of the user that is currently logged in.

    • userRole UserRole

      The role of the user that is currently logged in.

  • PerformanceStats

    Defines an interface that contains performance statistics about a inst.

    Members

    • loadTimes object

    • numberOfActiveTimers number

      The total number of active setTimeout() and setInterval() timers that are active.

    • numberOfBots number

      The number of bots in the inst.

    • shoutTimes object[]

      A list of listen tags and the amount of time spent executing them (in miliseconds). Useful to guage if a listen tag is causing the inst to slow down.

  • PolicyController

    Defines a class that is able to calculate the policies and permissions that are allowed for specific actions.

    Members

  • PolicyStore

    Defines an interface for objects that are able to store and retrieve policy documents.

    Members

    • assignPermissionToSubjectAndMarker(recordName: string, subjectType: SubjectType, subjectId: string, resourceKind: ResourceKinds, marker: string, action: ActionKinds, options: PermissionOptions, expireTimeMs: number): Promise<AssignPermissionToSubjectAndMarkerResult>

      Assigns the given permission to the given subject for the given resource.

      The first parameter is a string and is the name of the record that the resource exists in.

      The second parameter is a SubjectType and is the type of the subject. This can be either a user, inst, or role.

      The third parameter is a string and is the ID of the subject.

      The fourth parameter is a ResourceKinds and is the kind of the resource.

      The fifth parameter is a string and is the ID of the marker.

      The parameter is a ActionKinds and is the action that the subject is allowed to perform on the resource. If null, then all actions are allowed.

      The parameter is a PermissionOptions and is the options for the permission.

      The parameter is a number and is the time that the permission expires. If null, then the permission never expires.

    • assignPermissionToSubjectAndResource(recordName: string, subjectType: SubjectType, subjectId: string, resourceKind: ResourceKinds, resourceId: string, action: ActionKinds, options: PermissionOptions, expireTimeMs: number): Promise<AssignPermissionToSubjectAndResourceResult>

      Assigns the given permission to the given subject for the given resource.

      The first parameter is a string and is the name of the record that the resource exists in.

      The second parameter is a SubjectType and is the type of the subject. This can be either a user, inst, or role.

      The third parameter is a string and is the ID of the subject.

      The fourth parameter is a ResourceKinds and is the kind of the resource.

      The fifth parameter is a string and is the ID of the resource.

      The parameter is a ActionKinds and is the action that the subject is allowed to perform on the resource. If null, then all actions are allowed.

      The parameter is a PermissionOptions and is the options for the permission.

      The parameter is a number and is the time that the permission expires. If null, then the permission never expires.

    • assignSubjectRole(recordName: string, subjectId: string, type: ("user" | "inst"), role: AssignedRole): Promise<UpdateUserRolesResult>

      Assigns the given role to the given subject. If the role already is assigned, then it will be overwritten.

      The first parameter is a string and is the name of the record.

      The second parameter is a string and is the ID of the subject.

      The third parameter is a ("user" | "inst") and is the type of subject.

      The fourth parameter is a AssignedRole and is the role that should be assigned.

    • deleteMarkerPermissionAssignmentById(id: string): Promise<DeletePermissionAssignmentResult>

      Deletes the given marker permission assignment from the store.

      The first parameter is a string and is the ID of the permission assignment.

    • deleteResourcePermissionAssignmentById(id: string): Promise<DeletePermissionAssignmentResult>

      Deletes the given resource permission assignment from the store.

      The first parameter is a string and is the ID of the resource permission assignment.

    • findGrantedPackageEntitlementById(id: string): Promise<GrantedPackageEntitlement>

      Attempts to find the granted entitlement for the given ID.

      The first parameter is a string and is the ID of the entitlement.

    • findGrantedPackageEntitlementByUserIdPackageIdFeatureAndScope(userId: string, packageId: string, feature: EntitlementFeature, scope: "designated", recordName: string): Promise<GrantedPackageEntitlement>

      Attempts to find the non-revoked granted entitlement for the given user, package, feature, and scope.

      The first parameter is a string and is the ID of the user that granted the entitlement.

      The second parameter is a string and is the ID of the package that the entitlement is granted for.

      The third parameter is a EntitlementFeature and is the feature that was granted.

      The fourth parameter is a "designated" and is the scope that was granted.

      The fifth parameter is a string and is the name of the record that the entitlement was granted for.

    • getMarkerPermissionAssignmentById(id: string): Promise<MarkerPermissionAssignment>

      Gets the marker permission assignment with the given ID. Returns null if no assignment was found.

      The first parameter is a string and is the ID of the assignment.

    • getPermissionForSubjectAndMarkers(subjectType: SubjectType, subjectId: string, recordName: string, resourceKind: ResourceKinds, markers: string[], action: ActionKinds, currentTimeMs: number): Promise<GetMarkerPermissionResult>

      Gets the permission for the given subject, markers, and action.

      The first parameter is a SubjectType and is the type of the subject. Must be either a user, inst, or role.

      The second parameter is a string and is the ID of the subject.

      The third parameter is a string and is the name of the record that the resource belongs to.

      The fourth parameter is a ResourceKinds and is the kind of the resource.

      The fifth parameter is a string[] and is the markers that are applied to the resource.

      The parameter is a ActionKinds and is the action that the subject is attempting to perform on the resource.

      The parameter is a number and is the current unix time in milliseconds.

    • getPermissionForSubjectAndResource(subjectType: SubjectType, subjectId: string, recordName: string, resourceKind: ResourceKinds, resourceId: string, action: ActionKinds, currentTimeMs: number): Promise<GetResourcePermissionResult>

      Gets the permission for the given subject, resource, and action.

      The first parameter is a SubjectType and is the type of the subject. Must be either a user, inst, or role.

      The second parameter is a string and is the ID of the subject.

      The third parameter is a string and is the name of the record that the resource belongs to.

      The fourth parameter is a ResourceKinds and is the kind of the resource.

      The fifth parameter is a string and is the ID of the resource.

      The parameter is a ActionKinds and is the action that the subject is attempting to perform on the resource.

      The parameter is a number and is the current unix time in milliseconds.

    • getRecordOwnerPrivacyFeatures(recordName: string): Promise<PrivacyFeatures>

      Gets the privacy features for the owner of the given record. Returns null if the record does not exist or if the record does not have an owner.

      The first parameter is a string and is the name of the record.

    • getResourcePermissionAssignmentById(id: string): Promise<ResourcePermissionAssignment>

      Gets the resource permission assignment with the given ID. Returns null if no assignment was found.

      The first parameter is a string and is the ID of the assignment.

    • getUserPrivacyFeatures(userId: string): Promise<UserPrivacyFeatures>

      Gets the privacy features that are enabled for the given user. Returns null if the given user does not exist.

      The first parameter is a string and is the ID of the user.

    • listAssignments(recordName: string, startingRole: string): Promise<ListedRoleAssignments>

      Lists the role assignments in the given record.

      The first parameter is a string and is the name of the record.

      The second parameter is a string and

    • listAssignmentsForRole(recordName: string, role: string): Promise<ListedRoleAssignments>

      Lists the assignments for the given role.

      The first parameter is a string and is the name of the record.

      The second parameter is a string and is the name of the role.

    • listGrantedEntitlementsByFeatureAndUserId(packageIds: string[], feature: EntitlementFeature, userId: string, recordName: string, nowMs: number): Promise<GrantedPackageEntitlement[]>

      Gets the list of non-revoked granted entitlements for the given package IDs, feature, and userId.

      The first parameter is a string[] and is the IDs of the packages to list the entitlements for.

      The second parameter is a EntitlementFeature and is the feature that the entitlements are granted for.

      The third parameter is a string and is the ID of the user that the entitlements are granted to.

      The fourth parameter is a string and is the name of the record that the entitlements are granted for.

      The fifth parameter is a number and is the current unix time in milliseconds.

    • listGrantedEntitlementsForUser(userId: string, nowMs: number): Promise<GrantedPackageEntitlement[]>

      Lists all the active entitlements that the user has granted.

      The first parameter is a string and is the ID of the user.

      The second parameter is a number and is the current unix time in milliseconds.

    • listGrantedEntitlementsForUserAndPackage(userId: string, packageId: string, nowMs: number): Promise<GrantedPackageEntitlement[]>

      Lists all the active entitlements that the user has granted for the given package.

      The first parameter is a string and is the ID of the user.

      The second parameter is a string and is the ID of the package.

      The third parameter is a number and is the current unix time in milliseconds.

    • listPermissionsForMarker(recordName: string, marker: string): Promise<MarkerPermissionAssignment[]>

      Lists the marker permission assignments for the given record and marker.

      The first parameter is a string and is the record that the permission assignments should be listed for.

      The second parameter is a string and is the marker that the permission assignments should be listed for.

    • listPermissionsForResource(recordName: string, resourceKind: ResourceKinds, resourceId: string): Promise<ResourcePermissionAssignment[]>

      Lists the resource permission assignments for the given record and resource.

      The first parameter is a string and is the name of the record.

      The second parameter is a ResourceKinds and is the kind of the resource.

      The third parameter is a string and is the ID of the resource.

    • listPermissionsForSubject(recordName: string, subjectType: SubjectType, subjectId: string): Promise<ListPermissionsInRecordResult>

      Lists the resource permission assignments for the given subject in the given record.

      The first parameter is a string and is the name of the record.

      The second parameter is a SubjectType and is the type of the subject.

      The third parameter is a string and is the ID of the subject.

    • listPermissionsInRecord(recordName: string): Promise<ListPermissionsInRecordResult>

      Lists the resource permission assignments for the given record.

      The first parameter is a string and is the name of the record.

    • listRolesForInst(recordName: string, inst: string): Promise<AssignedRole[]>

      Lists the roles that are assigned to the given inst.

      The first parameter is a string and is the name of the record.

      The second parameter is a string and is the name of the inst.

    • listRolesForUser(recordName: string, userId: string): Promise<AssignedRole[]>

      Lists the roles that are assigned to the user.

      The first parameter is a string and is the name of the record that the role assignments belong to.

      The second parameter is a string and is the ID of the user.

    • revokeSubjectRole(recordName: string, subjectId: string, type: ("user" | "inst"), role: string): Promise<UpdateUserRolesResult>

      Revokes the given role from the subject. If the role is not assigned, then this function does nothing.

      The first parameter is a string and is the name of the record.

      The second parameter is a string and is the ID of the subject.

      The third parameter is a ("user" | "inst") and is the type of subject.

      The fourth parameter is a string and is the ID of the role that should be revoked.

    • saveGrantedPackageEntitlement(grantedEntitlement: GrantedPackageEntitlement): Promise<void>

      Saves the given granted entitlement.

      The first parameter is a GrantedPackageEntitlement and is the entitlement that should be saved.

  • PostTransfersRequest

    Members

    • amount? (number | bigint)

      The amount to post/void for each transfer.

    • flags? TransferFlags

      The flags to set on the transfers. If not specified, then post_pending_transfer will be set.

    • transactionId? (string | bigint)

      The ID of the transaction that should be created.

    • transfers (string | bigint)[]

      The transfers that should be performed in a transcation.

  • PresignFileReadRequest

    Members

    • date? Date

      The current date.

    • fileName string

      The name of the file.

    • headers object

      The headers that were included in the request.

    • recordName string

      The name of the record that the file will be stored in.

  • PresignFileUploadRequest

    Members

    • date? Date

      The current date.

    • fileByteLength number

      The number of bytes in the file.

    • fileMimeType string

      The MIME type of the file that will be uploaded.

    • fileName string

      The name of the file.

    • fileSha256Hex string

      The Hex encoded SHA-256 hash of the file that will be uploaded.

    • headers object

      The headers that were included in the request.

    • markers string[]

      The root markers that should be associated with the file.

    • recordName string

      The name of the record that the file will be stored in.

  • PrivoSignUpRequest

    Members

    • dateOfBirth Date

      The date of birth of the user.

    • displayName string

      The display name of the user.

    • email string

      The email address of the user.

    • ipAddress string

      The IP address that the sign up is from.

    • name string

      The name of the user.

    • parentEmail string

      The email address of the user's parent. Null if none was provided in the request.

  • ProcessOpenIDAuthorizationCodeRequest

    Members

    • authorizationCode string

      The authorization code that was included in the callback.

    • ipAddress string

      The IP address that the request is from.

    • state string

      The state that was included in the callback.

  • PurchasableItem

    Defines a purchasable item. That is, an item that can be purchased by a user to grant them a role.

    Members

    • address string

      The address of the record.

    • cost number

      The cost of the item in the currency's smallest unit. (e.g. cents, pence, etc.)

    • currency string

      The 3-letter ISO currency code that the item is priced in.

      See https://www.iso.org/iso-4217-currency-codes.html

    • description string

      The description of the item.

    • imageUrls string[]

      The list of image URLs that represent the item.

    • markers string[]

      The markers that are associated with the record.

    • name string

      The name of the item.

    • roleGrantTimeMs number

      The amount of time in miliseconds that the role is granted for after purchase. If null, then the role is granted forever.

    • roleName string

      The name of the role that the item grants.

    • taxCode? string

      The tax code for the item. Currently only stripe tax codes are supported.

      See https://docs.stripe.com/tax/tax-codes

  • PurchasableItemMetrics

    Defines the subscription metrics for a purchasable item.

    Members

    • currentPeriodEndMs number

      The unix time in miliseconds of the end of the current subscription period.

    • currentPeriodStartMs number

      The unix time in miliseconds of the start of the current subscription period.

    • ownerId string

    • recordName? string

    • stripeAccountId string

      The ID of the stripe account that the record is associated with. Null if a stripe account is not associated with the record.

    • stripeAccountStatus StripeAccountStatus

      The status of the stripe account that the record is associated with. Null if a stripe account is not associated with the record.

    • studioId string

    • subscriptionId string

      The ID of the subscription.

    • subscriptionStatus string

      The status of the subscription.

    • subscriptionType ("user" | "studio")

      The type of the subscription.

    • totalPurchasableItems number

      The total number of purchasable items that have been recorded.

    • userId? string

  • PurchasableItemRecordsController

    Members

  • PurchasableItemRecordsStore

    Defines a controller that is able to interact with and manage purchasable items.

    Members

    • createItem(recordName: string, item: PurchasableItem): Promise<void>

      Creates a new record.

      The first parameter is a string and is the name of the record.

      The second parameter is a PurchasableItem and is the item to create.

    • deleteItem(recordName: string, address: string): Promise<void>

      Deletes the item with the given ID.

      The first parameter is a string and is the name of the record that the item lives in.

      The second parameter is a string and is the address of the item to delete.

    • getItemByAddress(recordName: string, address: string): Promise<PurchasableItem>

      Reads the item with the given address. Returns null if the item does not exist.

      The first parameter is a string and is the name of the record that the item lives in.

      The second parameter is a string and is the address of the item to read.

    • getSubscriptionMetrics(filter: SubscriptionFilter): Promise<PurchasableItemMetrics>

      Gets the item metrics for the subscription of the given record.

      The first parameter is a SubscriptionFilter and

    • listItems(recordName: string, address: string): Promise<ListCrudStoreSuccess>

      Gets a list of the items in the record starting after the given address.

      The first parameter is a string and is the name of the record.

      The second parameter is a string and is the address to start listing items after.

    • listItemsByMarker(request: ListCrudStoreByMarkerRequest): Promise<ListCrudStoreSuccess>

      Gets a list of the items in the record that have the given marker starting after the given address.

      The first parameter is a ListCrudStoreByMarkerRequest and is the request to list items by marker.

    • putItem(recordName: string, item: PartialExcept): Promise<void>

      Creates or updates the record with the given ID. If updating a record, keys that are not present in the record will not be updated.

      The first parameter is a string and is the name of the record that the item lives in.

      The second parameter is a PartialExcept and is the item to create or update.

    • updateItem(recordName: string, item: PartialExcept): Promise<void>

      Updates the record with the given ID. Keys that are not present in the record will not be updated.

      The first parameter is a string and is the name of the record that the item lives in.

      The second parameter is a PartialExcept and

  • PurchaseContractRequest

    Members

    • contract object

      The contract that is being purchased.

    • instances string[]

      The instances that the request is being made from.

    • returnUrl string

      The URL that the user should be redirected to if the purchase is canceled.

    • successUrl string

      The URL that the user should be redirected to if the purchase is unsuccessful.

    • userId string

      The ID of the user that is currently logged in. Null if the user is not logged in.

  • PurchaseStoreItemAction

    Defines an interface that represents the base for actions that deal with records.

    Members

    • item PurchasableItemReference

      The item that should be purchased.

    • options RecordActionOptions

      The options that the action should use.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • recordName string

      The name of the record.

    • taskId (string | number)

      The ID of the async task.

    • type "purchase_store_item"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • PurchasedItem

    Defines an interface that represents an item that has been purchased.

    Members

    • activatedTimeMs number

      The unix timestamp in miliseconds when the item was activated. Null if the item has not been activated.

    • activationKeyId string

      The ID of the activation key that was used to activate the item. Null if the item is associated with a user.

    • checkoutSessionId string

      The ID of the checkout session that the item was purchased through. Null if the purchase wasn't associated with a checkout session.

    • id string

      The ID of the item.

    • purchasableItemAddress string

      The address of the purchasable item.

    • recordName string

      The name of the record that the item was purchased from.

    • roleGrantTimeMs number

      The number of miliseconds that the role is granted for. If null, then the role is granted indefinitely.

    • roleName string

      The name of the role that is granted by the purchasable item.

    • userId string

      The ID of the user that purchased the item. Null if the purchase wasn't associated with a user (purchased by a guest or purchased as an access key).

  • PushSubscriptionUser

    Defines a relation between a push subscription and a user.

    Members

    • pushSubscriptionId string

      The ID of the push subscription.

    • userId string

      The ID of the user that the push subscription is for.

  • Quaternion

    Members

    • w number

      The W value of the quaternion.

    • x number

      The X value of the quaternion.

    • y number

      The Y value of the quaternion.

    • z number

      The Z value of the quaternion.

    • constructor(x: number, y: number, z: number, w: number): Quaternion

      Creates a new Quaternion with the given values.

      The first parameter is a number and is the X value.

      The second parameter is a number and is the Y value.

      The third parameter is a number and is the Z value.

      The fourth parameter is a number and is the W value.

    • equals(other: Quaternion): boolean

      Determines if this quaternion equals the other quaternion.

      The first parameter is a Quaternion and is the other quaternion to apply.

    • invert(): Quaternion

      Calculates the conjugate of this quaternion and returns the result. The conjugate (or inverse) of a quaternion is similar to negating a number. When you multiply a quaternion by its conjugate, the result is the identity quaternion.

    • length(): number

      Gets the length of this vector. That is, the pathagorean theorem applied to X, Y, Z, and W.

    • multiply(other: Quaternion): Quaternion

      Multiplies this quaternion by the other quaternion and returns the result. In quaternion math, multiplication can be used to combine quaternions together, however unlike regular multiplication quaternion multiplication is order dependent.

      Which frame of reference you want to use depends on which order you use. For example, q2.multiply(q1) starts with the identity, applies q1 to it, and then applies q2 to that. Whereas, q1.multiply(q2) starts with the identity, applies q2 to it, and then applies q1 to that.

      The first parameter is a Quaternion and is the other quaternion.

    • normalize(): Quaternion

      Calculates the normalized version of this quaternion and returns it. A normalized quaternion is a quaternion whose length equals 1.

      Normalizing a quaternion preserves its rotation/reflection while making the length (i.e. scale) of it 1.

    • squareLength(): number

      Calculates the square length of this quaternion and returns the result. This is equivalent to length^2, but it is faster to calculate than length because it doesn't require calculating a square root.

    • toString(): string

  • RateLimitController

    Defines a controller that is able to handle rate limiting.

    Members

  • Record

    Defines an interface for record objects.

    Members

    • name string

      The name of the record.

    • ownerId string

      The ID of the user that owns the record. Null if the record is owned by a studio.

    • secretHashes string[]

      The scrypt hashes of the secrets that allow access to the record.

    • secretSalt string

      The salt that is used to hash the secrets.

      Normally it is bad to share a salt between multiple secrets but in this case it is fine because there are very few secrets per salt (i.e. not 1 salt per million users but 1 salt per couple record keys) and the secrets are randomly generated.

    • studioId string

      The ID of the studio that owns the record. Null if the record is owned by a user.

  • RecordDataAction

    Defines an event that publishes data to a record.

    Members

    • [APPROVED_SYMBOL]? boolean

      Whether this action has been manually approved.

      Uses a symbol to ensure that it cannot be copied across security boundaries. As a result, it should be impossible to generate actions that are pre-approved.

    • address string

      The address that the data should be recorded to.

    • data any

      The data that should be recorded.

    • options DataRecordOptions

      The options that the action should use.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • recordKey string

      The record key that should be used to publish the data.

    • requiresApproval boolean

      Whether this action is trying to publish data that requires manual approval.

    • taskId (string | number)

      The ID of the async task.

    • type "record_data"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • RecordEventAction

    Defines an action that records that an event happened.

    Members

    • count number

      The number of events to record.

    • eventName string

      The name of the event.

    • options RecordActionOptions

      The options that the action should use.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • recordKey string

      The key that should be used to access the record.

    • taskId (string | number)

      The ID of the async task.

    • type "record_event"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • RecordFileAction

    Defines an event that publishes a file to a record.

    Members

    • data any

      The data that should be recorded.

    • description string

      The description of the file.

    • mimeType? string

      The MIME type of the uploaded file.

    • options RecordActionOptions

      The options for the action.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • recordKey string

      The record key that should be used to publish the file.

    • taskId (string | number)

      The ID of the async task.

    • type "record_file"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • RecordActionOptions

    Defines an interface that represents the base for options for a records action.

    Members

    • endpoint? string

      The HTTP endpoint that the request should interface with.

    • markers? string[]

      The markers that should be applied to the record.

  • RecordFileOptions

    Defines an interface that represents the set of additional options that can be provided when recording a file.

    Members

    • description? string

      The description of the file.

    • marker? string

      The marker that should be applied to the file.

    • markers? string[]

      The markers that should be applied to the file.

    • mimeType? string

      The MIME type of the file. See https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types for more information.

  • RecordKey

    Defines an interface for record key objects.

    Members

    • creatorId string

      The ID of the user that created this key.

    • policy PublicRecordKeyPolicy

      The policy that the key uses.

    • recordName string

      The name of the record that the key is for.

    • secretHash string

      The scrypt hash of the secret that this key is for.

  • RecordPackageVersionAction

    Defines an interface that represents the base for actions that deal with records.

    Members

    • options RecordActionOptions

      The options that the action should use.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • taskId (string | number)

      The ID of the async task.

    • type "record_package_version"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • RecordPackageVersionApiRequest

    Members

    • address string

      The address that the package version should be recorded to.

    • bots Bot[]

      The bots that should be saved to the package.

    • description string

      The description that should be included in the package version.

    • entitlements? Entitlement[]

      The list of entitlements for the package version. If omitted, then the package version will be recorded without any entitlements.

    • key PackageRecordVersionKey

      The version of the package that should be recorded.

    • markers? string[]

      The markers that should be applied to the package version.

    • recordName string

      The name of the record that the package version should be recorded to.

  • RecordPackageVersionRequest

    Members

    • address string

      The address that the package version should be stored in.

    • description string

      The description for the package version.

    • entitlements Entitlement[]

      The list of entitlements that the package version can request.

    • key PackageRecordVersionKey

      The key for the package version.

    • markers? string[]

      The markers that should be set on the package version.

    • recordName string

      The record that the package version should be stored in.

    • state StoredAux

      The state that should be saved in the package.

  • RecordStoreItemAction

    Defines an interface that represents the base for actions that deal with records.

    Members

    • address string

      The address of the item.

    • item Omit<StoreItem, "address">

      The item that should be recorded.

    • options RecordActionOptions

      The options that the action should use.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • recordName string

      The name of the record.

    • taskId (string | number)

      The ID of the async task.

    • type "record_store_item"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • RecordSubscriptionMetrics

    Members

    • currentPeriodEndMs number

      The unix time in miliseconds of the end of the current subscription period.

    • currentPeriodStartMs number

      The unix time in miliseconds of the start of the current subscription period.

    • ownerId string

    • recordName? string

    • stripeAccountId string

      The ID of the stripe account that the record is associated with. Null if a stripe account is not associated with the record.

    • stripeAccountStatus StripeAccountStatus

      The status of the stripe account that the record is associated with. Null if a stripe account is not associated with the record.

    • studioId string

    • subscriptionId string

      The ID of the subscription.

    • subscriptionStatus string

      The status of the subscription.

    • subscriptionType ("user" | "studio")

      The type of the subscription.

    • totalRecords number

      The total number of records stored in the subscription.

    • userId? string

  • RecordsCallProcedureAction

    Defines an event that is able to call a procedure on the records server.

    Members

    • options RecordActionOptions

      The options that the action should use.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • procedure Partial<ProcedureActions>

      The procedure to call.

    • taskId (string | number)

      The ID of the async task.

    • type "records_call_procedure"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • RecordsController

    Defines a class that manages records and their keys.

    Members

  • RecordsStore

    Defines an interface for objects that can store records.

    Members

    • addRecord(record: Record): Promise<void>

      Adds the given record to the store.

      The first parameter is a Record and is the record to add.

    • addRecordKey(key: RecordKey): Promise<void>

      Adds the given record key to the store.

      The first parameter is a RecordKey and is the key to add.

    • addStudio(studio: Studio): Promise<void>

      Adds the given studio to the store.

      The first parameter is a Studio and is the studio to add.

    • addStudioAssignment(assignment: StudioAssignment): Promise<void>

      Adds the given studio assignment to the store.

      The first parameter is a StudioAssignment and is the assignment to add.

    • countRecords(filter: CountRecordsFilter): Promise<number>

      Counts the number of records that match the given filter.

      The first parameter is a CountRecordsFilter and is the filter.

    • countStudiosInComId(comId: string): Promise<number>

      Gets the number of studios that are owned by the given comId.

      The first parameter is a string and is the comId.

    • createStudioForUser(studio: Studio, adminId: string): Promise<object>

      Creates a new studio and adds the given user as an admin.

      The first parameter is a Studio and is the studio to create.

      The second parameter is a string and is the ID of the admin user.

    • deleteCustomDomain(domainId: string): Promise<void>

      Removes the custom domain with the given ID from the store.

      The first parameter is a string and is the ID of the custom domain to remove.

    • getCustomDomainById(domainId: string): Promise<CustomDomainWithStudio>

      Gets the custom domain with the given ID.

      The first parameter is a string and is the ID of the custom domain.

    • getRecordByName(name: string): Promise<Record>

      Gets the record with the given name.

      The first parameter is a string and is the name of the record.

    • getRecordKeyByRecordAndHash(recordName: string, hash: string): Promise<RecordKey>

      Gets the record key for the given record name that has the given hash.

      The first parameter is a string and is the name of the record.

      The second parameter is a string and is the scrypt hash of the key that should be retrieved.

    • getStudioByComId(comId: string): Promise<Studio>

      Gets the studio that has the given comId.

      The first parameter is a string and is the comId of the studio.

    • getStudioById(id: string): Promise<Studio>

      Gets the studio with the given ID.

      The first parameter is a string and is the ID of the studio.

    • getStudioByStripeAccountId(accountId: string): Promise<Studio>

      Gets the studio with the given stripe account ID. Returns null if no studio has that stripe account ID.

      The first parameter is a string and is the ID of the stripe account.

    • getStudioByStripeCustomerId(customerId: string): Promise<Studio>

      Gets the studio that has the given stripe customer ID.

      The first parameter is a string and is the stripe customer ID for the studio.

    • getStudioHumeConfig(studioId: string): Promise<object>

      Gets the hume config for the studio with the given ID. Returns null if the studio does not have a hume config.

      The first parameter is a string and is the ID of the studio.

    • getStudioLoomConfig(studioId: string): Promise<object>

      Gets the loom config for the studio with the given ID. Returns null if the studio does not have a loom config.

      The first parameter is a string and is the ID of the studio.

    • getVerifiedCustomDomainByName(domainName: string): Promise<CustomDomainWithStudio>

      Gets the verified custom domain with the given domain name. Returns null if no verified custom domain with the given name exists.

      The first parameter is a string and is the domain name.

    • listCustomDomainsByStudioId(studioId: string): Promise<CustomDomain[]>

      Gets the list of custom domains for the given studio ID.

      The first parameter is a string and is the ID of the studio.

    • listRecordsByOwnerId(ownerId: string): Promise<ListedRecord[]>

      Gets the list of records that the user with the given ID owns.

      If null or undefined, then this store does not support this method.

      The first parameter is a string and is the ID of the user that owns the records.

    • listRecordsByStudioId(studioId: string): Promise<ListedRecord[]>

      Gets the list of records that the studio with the given ID owns.

      If null or undefined, then this store does not support this method.

      The first parameter is a string and is the ID of the studio that owns the records.

    • listRecordsByStudioIdAndUserId(studioId: string, userId: string): Promise<ListedRecord[]>

      Gets the list of records that the studio with the given ID owns and that the user with the given ID has access to.

      The first parameter is a string and is the ID of the studio.

      The second parameter is a string and is the ID of the user.

    • listStudioAssignments(studioId: string, filters?: ListStudioAssignmentFilters): Promise<ListedStudioAssignment[]>

      Gets the list of users that have been assigned to the given studio.

      The first parameter is a string and is the ID of the studio.

      The second parameter is optional and is a ListStudioAssignmentFilters and is the additional filters that should be used.

    • listStudiosForUser(userId: string): Promise<StoreListedStudio[]>

      Gets the list of studios that the user with the given ID has access to. Returns only studios that are not owned by any comId.

      The first parameter is a string and is the ID of the user.

    • listStudiosForUserAndComId(userId: string, comId: string): Promise<StoreListedStudio[]>

      Gets the list of studios that are owned by the given comId and that the user with the given ID has access to.

      The first parameter is a string and is the ID of the user.

      The second parameter is a string and is the comId of the studio that owns the studios.

    • listUserAssignments(userId: string): Promise<ListedUserAssignment[]>

      Gets the list of studio assignments that the user with the given ID has access to.

      The first parameter is a string and is the ID of the user.

    • markCustomDomainAsVerified(domainId: string): Promise<void>

      Marks the custom domain with the given ID as verified.

      The first parameter is a string and is the ID of the custom domain to mark as verified.

    • removeStudioAssignment(studioId: string, userId: string): Promise<void>

      Removes the given user from the given studio.

      The first parameter is a string and is the ID of the studio.

      The second parameter is a string and is the ID of the user.

    • saveComIdRequest(request: StudioComIdRequest): Promise<void>

      Saves the given comId request.

      The first parameter is a StudioComIdRequest and is the request.

    • saveCustomDomain(domain: CustomDomain): Promise<void>

      Saves the given custom domain to the store.

      The first parameter is a CustomDomain and is the custom domain to save.

    • updateRecord(record: Record): Promise<void>

      Updates the given record.

      The first parameter is a Record and is the record that should be updated.

    • updateStudio(studio: Studio): Promise<void>

      Updates the given studio.

      The first parameter is a Studio and is the studio record that should be updated.

    • updateStudioAssignment(assignment: StudioAssignment): Promise<void>

      Updates the given studio assignment.

      The first parameter is a StudioAssignment and is the assignment that should be updated.

    • updateStudioHumeConfig(studioId: string, config: object): Promise<void>

      Updates the hume config for the studio with the given ID.

      The first parameter is a string and is the ID of the studio that should be updated.

      The second parameter is a object and is the config that should be updated for the studio.

    • updateStudioLoomConfig(studioId: string, config: object): Promise<void>

      Updates the loom config for the studio with the given ID.

      The first parameter is a string and is the ID of the studio that should be updated.

      The second parameter is a object and is the config that should be updated for the studio.

  • RegisterPrefixAction

    Defines an event that adds an entry point to a custom portal.

    Members

    • options RegisterPrefixOptions

      The options that should be used for the prefix.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • prefix string

      The prefix that should be registered.

    • taskId (string | number)

      The ID of the async task.

    • type "register_prefix"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • RegisterPushSubscriptionRequest

    Members

    • instances string[]

      The instances that are currently loaded.

    • pushSubscription object

      The push subscription that should be registered.

    • userId string

      The ID of the user that is logged in.

  • RelyingParty

    Members

    • id string

      The domain of the relying party.

    • name string

      The human readable name of the relying party.

    • origin string

      The HTTP origin that the relying party is hosted on.

  • RemoteActionError

    An event that is used to response to remote actions with an error.

    Members

    • broadcast? boolean

      Whether the event should be broadcast to all users.

    • connectionId? string

      The ID of the connection that the event should be sent to.

    • error any

      The error that occurred.

    • sessionId? string

      The ID of the session that the event should be sent to.

    • taskId (string | number)

      The ID of the task that this is a result for.

    • type "remote_error"

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

    • userId? string

      The ID of the user that the event should be sent to.

  • RemoteActionResult

    An event that is used to respond to remote actions with some arbitrary data.

    Members

    • broadcast? boolean

      Whether the event should be broadcast to all users.

    • connectionId? string

      The ID of the connection that the event should be sent to.

    • result? any

      The data that is included in the result.

    • sessionId? string

      The ID of the session that the event should be sent to.

    • taskId (string | number)

      The ID of the task that this is a result for.

    • type "remote_result"

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

    • userId? string

      The ID of the user that the event should be sent to.

  • RemoveBotAction

    Defines a bot event that indicates a bot was removed from the state.

    Members

    • id string

    • type "remove_bot"

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • RemoveBotMapLayerAction

    Defines an interface for actions that represent asynchronous tasks.

    Members

    • botId string

      The ID of the bot that the overlay is on.

    • overlayId string

      The ID of the overlay that should be removed.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • taskId (string | number)

      The ID of the async task.

    • type "remove_bot_map_layer"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • RemoveStudioMemberRequest

    Members

    • removedUserId string

      The ID of the user that should be removed from the studio.

    • studioId string

      The ID of the studio.

    • userId string

      The ID of the user that is currently logged in.

  • ReplaceDragBotAction

    An event that is used to override dragging a bot.

    Members

    • bot (Bot | Tags)

      The bot that should be used to drag.

    • type "replace_drag_bot"

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • ReplaceSessionRequest

    Members

    • ipAddress string

      The IP Address that is making this request.

    • sessionKey string

      The session key that should be replaced.

  • ReportInstRequest

    Members

    • automaticReport boolean

      Whether the report was automatically generated.

    • inst string

      The name of the inst.

    • recordName string

      The name of the record that the inst exists in. Null if the inst is public.

    • reportReason ReportReason

      The user-provided reason category that the inst was reported for.

    • reportReasonText string

      The user-provided explaination that the inst was reported for.

    • The permalink of the inst that was reported.

    • reportedUrl string

      The URL that was reported.

    • reportingIpAddress string

      The IP address that the report came from. Null if the IP address could not be determined (i.e. in the case that the report was automatically generated).

    • reportingUserId string

      The ID of the user that reported the inst. Null if the user was not logged in when reporting the inst.

  • RequestPrivacyFeaturesChangeRequest

    Members

    • sessionKey string

      The session key that should authorize the request.

    • userId string

      The ID of the user that the request is for.

  • RequestWebAuthnLogin

    Members

    • ipAddress string

      The IP Address that the login request is from.

    • originOrHost string

      The HTTP origin or host that the request is coming from. Null if the request is coming from the same origin as the server.

  • RequestWebAuthnRegistration

    Members

    • originOrHost string

    • userId string

      The ID of the user that is currently logged in.

  • ResourcePermissionAssignment

    Defines an interface that represents a resource permission assignment.

    Members

    • action ActionKinds

      The kind of the actions that the subject is allowed to perform. Null if the subject is allowed to perform any action.

    • expireTimeMs number

      The time that the permission expires. Null if the permission never expires.

    • id string

      The ID of the permission assignment.

    • options PermissionOptions

      The options for the permission assignment.

    • recordName string

      The name of the record.

    • resourceId string

      The ID of the resource.

    • resourceKind ResourceKinds

      The kind of the resource.

    • subjectId string

      The ID of the subject.

    • subjectType SubjectType

      The type of the subject.

    • userId string

      The ID of the user that the assignment grants permission to. Null if the subject type is not "user".

  • RevokeAllSessionsRequest

    Members

    • sessionKey string

      The session key that should authenticate the request.

    • userId string

      The ID of the user whose sessions should be revoked.

  • RevokeEntitlementGrantAction

    Defines an interface that represents the base for actions that deal with records.

    Members

    • options RecordActionOptions

      The options that the action should use.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • taskId (string | number)

      The ID of the async task.

    • type "revoke_record_entitlements"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • RevokeEntitlementRequest

    Members

    • grantId string

      The ID of the entitlement grant that should be revoked.

    • userId string

      The ID of the user that is currently logged in.

    • userRole? UserRole

      The role of the currently logged in user.

  • RevokeMarkerPermissionRequest

    Members

    • instances? string[]

    • permissionId string

    • userId string

  • RevokePermissionRequest

    Members

    • instances? string[]

    • permissionId string

    • userId string

  • RevokeRecordPermissionAction

    Defines an interface that represents an action that revokes a permission from a record marker.

    Members

    • options RecordActionOptions

      The options that the action should use.

    • permissionId string

      The ID of the permission that should be revoked.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • recordName string

      The name of the record.

    • taskId (string | number)

      The ID of the async task.

    • type "revoke_record_permission"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • RevokeResourcePermissionRequest

    Members

    • instances? string[]

    • permissionId string

    • userId string

  • RevokeRoleAction

    Defines an action that revokes a role from a user or inst.

    Members

    • inst? string

      The ID of the inst that should be revoked the role.

    • options RecordActionOptions

      The options that the action should use.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • recordName string

      The name of the record.

    • role string

      The role that should be revoked.

    • taskId (string | number)

      The ID of the async task.

    • type "revoke_role"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

    • userId? string

      The ID of the user that should be revoked the role.

  • RevokeRoleRequest

    Members

    • instance? string

    • role string

    • userId? string

  • RevokeSessionRequest

    Members

    • sessionId string

      The ID of the session that should be revoked.

    • sessionKey string

      The session key that should authenticate the request.

    • userId string

      The ID of the user whose session should be revoked.

  • Route

    Defines a basic interface for an HTTP route.

    Members

    • allowedOrigins? (true | Set<string> | "account" | "api" | "self")

      The set of origins that are allowed for the route. If true, then all origins are allowed. If 'account', then only the configured account origins are allowed. If 'api', then only the configured API origins are allowed. If 'self', then either the API or account origins are allowed. If omitted, then it is up to the handler to determine if the origin is allowed.

    • handler (request: GenericHttpRequest,data: output,query: output) => Promise<GenericHttpResponse>

    • method ("GET" | "POST" | "PUT" | "DELETE" | "HEAD" | "OPTIONS")

      The method for the route.

    • name? string

      The name for the route. If omitted, then the route will not be named.

    • path (string | true)

      The path that the route must match.

      If true, then the route will match all paths as a default route.

    • querySchema? TQuery

      The schema that should be used for the query parameters. If omitted, then the query parameters will not be validated using this schema.

      Additionally, this only works if a schema is provided.

    • schema? TSchema

      The schema that should be used for the route. If the method can contain a request body, then the schema applies to the body. Otherwise, it will apply to the query parameters.

    • scope? ("player" | "auth")

      The scope for the route. Used to filter requests based on their context.

  • ScanFileRequest

    Members

    • fileName string

      The file that should be scanned.

    • jobId? string

      The ID of the job that the scan is associated with.

    • recordName string

      The name of the record that the file is in.

  • SearchApiKey

    Members

    • actions string[]

    • collections string[]

    • description string

    • expiresAt number

    • id number

    • value string

  • SearchApiKeyData

    Members

    • actions string[]

    • collections string[]

    • description string

    • expiresAt? number

  • SearchCollection

    Members

  • SearchCollectionInfo

    Members

  • SearchDocument

    Defines a document that can be stored in a search collection.

    Members

    • id string

      The ID of the document. If not provided, a new ID will be generated.

  • SearchInterface

    Defines a basic interface that is able to interact with a search engine.

    Members

    • nodes SearchNode[]

      The nodes that should be used by clients to connect to the search engine.

    • createApiKey(apiKey: SearchApiKeyData): Promise<SearchApiKey>

      Creates a new API key for use with the search engine.

      The first parameter is a SearchApiKeyData and is the API key.

    • createCollection(collection: SearchCollection): Promise<SearchCollectionInfo>

      Creates a new collection in the search engine.

      The first parameter is a SearchCollection and is the collection to create.

    • createDocument(collectionName: string, document: SearchDocument, action?: ("create" | "update" | "upsert" | "emplace")): Promise<SearchDocument>

      Creates a new document in the specified collection.

      The first parameter is a string and is the name of the collection to create the document in.

      The second parameter is a SearchDocument and is the document to create.

      The third parameter is optional and is a ("create" | "update" | "upsert" | "emplace") and is the action to perform (create, upsert, update, emplace).

    • deleteDocument(collectionName: string, documentId: string): Promise<Result>

      Deletes a document from the specified collection.

      The first parameter is a string and is the name of the collection to delete the document from.

      The second parameter is a string and is the ID of the document to delete.

    • dropCollection(collectionName: string): Promise<SearchCollectionInfo>

      Drops a collection from the search engine.

      The first parameter is a string and is the name of the collection to drop.

    • getCollection(collectionName: string): Promise<SearchCollectionInfo>

      Retrieves a collection from the search engine.

      The first parameter is a string and is the name of the collection to retrieve.

    • searchCollection(collectionName: string, query: SearchQuery): Promise<SearchResult>

      Searches for documents in the specified collection.

      The first parameter is a string and is the name of the collection to search.

      The second parameter is a SearchQuery and is the search query.

    • updateCollection(collection: UpdatedSearchCollection): Promise<SearchCollectionInfo>

      Updates an existing collection in the search engine.

      The first parameter is a UpdatedSearchCollection and is the updated collection.

  • SearchRecord

    Defines a record that represents a collection of documents that can be searched.

    Members

    • address string

      The address of the record.

    • collectionName string

      The name of the collection that this search record is attached to.

    • markers string[]

      The markers that are associated with the record.

    • searchApiKey string

      The API key that is used to query the collection.

  • SearchRecordInput

    Members

    • address string

      The address of the record.

    • markers string[]

      The markers that are associated with the record.

    • schema object

      The schema that should be used for the documents into the search record collection.

      This is also used to validate the documents that are added to the collection.

  • SearchRecordSync

    Defines a record that represents syncing data to a search collection. This is used to sync data from data records to a search collection.

    Members

    • id string

      The ID of the search record sync.

    • searchRecordAddress string

      The address of the search record.

    • searchRecordName string

      The name of the record that the search record is in.

    • targetMapping [string, string][]

      The mapping of the target properties to the search document properties.

      Each entry in the array is a tuple where the first element is the source property and the second element is the target property in the search document.

    • targetMarker string

      The marker that the data should be synced from.

    • targetRecordName string

      The name of the record that the data should be synced from.

    • targetResourceKind ResourceKinds

      The kind of resource that should be synced.

  • SearchRecordSyncHistory

    Defines an interface that represents the history of a search record sync.

    Members

    • errorMessage string

      The error message if the sync failed.

    • id string

      The ID of the search record sync history.

    • numErrored number

      The number of documents that errored during the sync.

    • numSynced number

      The number of documents that were successfully synced.

    • numTotal number

      The total number of documents that were processed during the sync.

    • runId string

      The ID of the sync run that this history is for. Syncs may trigger multiple history entries, so this ID is used to group runs together.

    • searchRecordAddress string

      The address of the search record.

    • searchRecordName string

      The name of the record that the search collection is in.

    • status ("success" | "failure")

      The status of the sync.

    • success boolean

      Whether the sync was successful.

    • syncId string

      The ID of the sync that this history is for.

    • timeMs number

      The time of the sync.

      Miliseconds since the unix epoch in UTC.

  • SearchRecordsController

    Defines a controller that can be used to interact with SearchRecords.

    Members

  • SearchRecordsStore

    Defines a store that contains search records.

    Members

    • createItem(recordName: string, item: SearchRecord): Promise<void>

      Creates a new record.

      The first parameter is a string and is the name of the record.

      The second parameter is a SearchRecord and is the item to create.

    • createSyncHistory(history: SearchRecordSyncHistory): Promise<void>

      Creates a new sync history entry.

      The first parameter is a SearchRecordSyncHistory and is the sync history entry to create.

    • deleteItem(recordName: string, address: string): Promise<void>

      Deletes the item with the given ID.

      The first parameter is a string and is the name of the record that the item lives in.

      The second parameter is a string and is the address of the item to delete.

    • deleteSync(syncId: string): Promise<void>

      Deletes the search record sync with the given ID.

      The first parameter is a string and is the ID of the sync to delete.

    • getItemByAddress(recordName: string, address: string): Promise<SearchRecord>

      Reads the item with the given address. Returns null if the item does not exist.

      The first parameter is a string and is the name of the record that the item lives in.

      The second parameter is a string and is the address of the item to read.

    • getSubscriptionMetrics(filter: SubscriptionFilter): Promise<SearchSubscriptionMetrics>

      Gets the item metrics for the subscription of the given user or studio.

      The first parameter is a SubscriptionFilter and is the filter to use.

    • getSync(syncId: string): Promise<SearchRecordSync>

      Gets the search record sync with the given ID.

      The first parameter is a string and is the ID of the sync to get.

    • getSyncsByTarget(targetRecordName: string, targetResourceKind: ResourceKinds, markers: string[]): Promise<GetSearchRecordSyncByTargetResult[]>

      Finds the sync that matches the given target record name, resource kind, and markers.

      Always returns an object, but the sync and search record may be null if no sync was found.

      The first parameter is a string and is the name of the target record.

      The second parameter is a ResourceKinds and is the kind of resource that the sync is for.

      The third parameter is a string[] and is the markers to use for the sync.

    • listItems(recordName: string, address: string): Promise<ListCrudStoreSuccess>

      Gets a list of the items in the record starting after the given address.

      The first parameter is a string and is the name of the record.

      The second parameter is a string and is the address to start listing items after.

    • listItemsByMarker(request: ListCrudStoreByMarkerRequest): Promise<ListCrudStoreSuccess>

      Gets a list of the items in the record that have the given marker starting after the given address.

      The first parameter is a ListCrudStoreByMarkerRequest and is the request to list items by marker.

    • listSyncsBySearchRecord(recordName: string, address: string): Promise<SearchRecordSync[]>

      Gets the list of search record syncs for the given search record.

      The first parameter is a string and is the name of the record.

      The second parameter is a string and is the address of the search record.

    • putItem(recordName: string, item: PartialExcept): Promise<void>

      Creates or updates the record with the given ID. If updating a record, keys that are not present in the record will not be updated.

      The first parameter is a string and is the name of the record that the item lives in.

      The second parameter is a PartialExcept and is the item to create or update.

    • saveSync(sync: SearchRecordSync): Promise<void>

      Creates or saves a search record sync.

      The first parameter is a SearchRecordSync and is the search record sync to create or save.

    • updateItem(recordName: string, item: PartialExcept): Promise<void>

      Updates the record with the given ID. Keys that are not present in the record will not be updated.

      The first parameter is a string and is the name of the record that the item lives in.

      The second parameter is a PartialExcept and

  • SearchRequest

    Members

    • address string

      The address of the search record that the search should be performed on.

    • instances string[]

      The instance(s) that are making the request.

    • query SearchQuery

      The search query.

    • recordName string

      The name of the record that the search should be performed on.

    • userId string

      The ID of the user that is currently logged in.

  • SearchSubscriptionMetrics

    Members

    • currentPeriodEndMs number

      The unix time in miliseconds of the end of the current subscription period.

    • currentPeriodStartMs number

      The unix time in miliseconds of the start of the current subscription period.

    • ownerId string

    • recordName? string

    • stripeAccountId string

      The ID of the stripe account that the record is associated with. Null if a stripe account is not associated with the record.

    • stripeAccountStatus StripeAccountStatus

      The status of the stripe account that the record is associated with. Null if a stripe account is not associated with the record.

    • studioId string

    • subscriptionId string

      The ID of the subscription.

    • subscriptionStatus string

      The status of the subscription.

    • subscriptionType ("user" | "studio")

      The type of the subscription.

    • totalItems number

      The total number of search records that are stored in the subscription.

    • userId? string

  • SendNotificationRequest

    Members

    • address string

      The address of the notification.

    • instances string[]

      The instances that are currently loaded.

    • payload object

      The payload that should be sent.

    • recordName string

      The name of the record that the notification is in.

    • topic? string

      The topic that the notification should be sent to. A message with a topic will replace any other message with the same topic. If omitted, then no topic will be used.

    • userId string

      The ID of the user that is logged in.

  • SendWebhookAction

    Defines an event that sends a web request to a instance.

    Members

    • options WebhookActionOptions

      The options for the webhook.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • taskId (string | number)

      The ID of the async task.

    • type "send_webhook"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • SentNotification

    Defines a notification that was sent.

    Members

    • actions NotificationActionUI[]

      The actions that should be displayed on the notification.

    • badge string

      The badge URL of the sent notification.

    • body string

      The body of the sent notification.

    • defaultAction? NotificationAction

      The action that should be taken when the notification is clicked.

    • icon string

      The icon URL of the sent notification.

    • id string

      The ID of the sent notification.

    • notificationAddress string

      The address of the notification in the record.

    • recordName string

      The name of the record that the subscription is for.

    • sentTimeMs number

      The time that the notification was sent.

    • silent? boolean

      Whether the notification was silent.

    • tag? string

      The tag of the sent notification. Used to group similar notifications together.

    • timestamp? number

      The timestamp of the sent notification.

    • title string

      The title of the notification that was sent.

    • topic? string

      The topic that the notification should be sent to. A message with a topic will replace any other message with the same topic. Null if no topic was specified.

  • SentPushNotification

    Defines a model that represents a push notification that was sent.

    Members

    • errorCode string

      The error that occurred when sending the notification. Null if no error occurred.

    • id string

      The ID of the sent notification.

    • pushSubscriptionId string

      The ID of the push subscription that the notification was sent to.

    • sentNotificationId string

      The ID of the notification that was sent.

    • subscriptionId string

      The subscription that the notification was sent under.

    • success boolean

      Whether the notification was successfully sent to the user.

    • userId string

      The ID of the user that the notification was sent to.

  • SetConfigurationValueRequest

    Members

  • SetDataResult

    Defines an interface that represents the result of a "set data" operation.

    Members

    • errorCode? ("data_too_large" | "server_error")

    • errorMessage? string

    • success boolean

  • SetForcedOfflineAction

    Defines an event that is used to set whether the connection is forced to be offline.

    Members

    • offline boolean

      Whether the connection should be offline.

    • type "set_offline_state"

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • SetRoomOptionsAction

    Defines an event that attempts to set some options on a meeting room.

    Members

    • options Partial<RoomOptions>

      The options that should be set.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • roomName string

      The name of the room whose options should be changed.

    • taskId (string | number)

      The ID of the async task.

    • type "set_room_options"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • SetRoomTrackOptionsAction

    Defines an interface for actions that represent asynchronous tasks.

    Members

    • address string

      The address of the track.

    • options SetRoomTrackOptions

      The options that should be set for the track.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • roomName string

      The name of the room.

    • taskId (string | number)

      The ID of the async task.

    • type "set_room_track_options"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • ShellAction

    An event that is used to run a shell script.

    Members

    • script string

      The script that should be run.

    • type "shell"

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • ShoutAction

    Defines an event for actions. Actions are basically user-defined events.

    Members

    • argument? any

      The argument to pass as the "that" variable to scripts.

    • botIds string[]

      The IDs of the bots that the event is being sent to. If null, then the action is sent to every bot.

    • eventName string

      The name of the event.

    • sortBotIds? boolean

      Whether the Bot IDs should be sorted before processing.

    • type "action"

    • userId string

      The Bot ID of the user.

  • ShowAccountInfoAction

    An event that is used to show the account info dialog.

    Members

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • taskId (string | number)

      The ID of the async task.

    • type "show_account_info"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • ShowBarcodeAction

    An event that is used to show or hide a barcode on screen.

    Members

    • code string

      The code to display.

    • format BarcodeFormat

      The format that the code should be displayed in.

    • open boolean

      Whether the barcode should be visible.

    • type "show_barcode"

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • ShowInputAction

    Defines an event that is used to show an input box.

    Members

    • currentValue? any

      The value that should be in the input box.

    • options Partial<ShowInputOptions>

      The options for the input box.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • taskId (string | number)

      The ID of the async task.

    • type "show_input"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • ShowInputForTagAction

    Defines an event that is used to show an input box to edit a tag on a bot.

    Members

    • botId string

      The ID of the bot to edit.

    • options Partial<ShowInputOptions>

      The options for the input box.

    • tag string

      The tag that should be edited on the bot.

    • type "show_input_for_tag"

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • SpeakTextOptions

    Members

    • pitch? number

      The pitch that the text should be spoken at.

    • rate? number

      The rate that the text should be spoken at.

    • voice? string

      The name of the voice that the text should be spoken with.

  • SplitInstRecordsStore

    Defines a class that implements the InstRecordsStore interface by first storing updates in a temporary store and then sending them to a permanent store.

    Members

    • constructor(temporary: TemporaryInstRecordsStore, permanent: InstRecordsStore): SplitInstRecordsStore

      The first parameter is a TemporaryInstRecordsStore and

      The second parameter is a InstRecordsStore and

    • addUpdates(recordName: string, inst: string, branch: string, updates: string[], sizeInBytes: number): Promise<AddUpdatesResult>

      Adds the given updates to the given branch. If the branch does not exist, then it will be created.

      The first parameter is a string and is the name of the record that the updates should be added to. If null, then the updates will be added to a tempPublic inst.

      The second parameter is a string and is the name of the inst.

      The third parameter is a string and is the branch that the updates should be added to.

      The fourth parameter is a string[] and is the updates that should be added.

      The fifth parameter is a number and is the size of the updates in bytes.

    • deleteBranch(recordName: string, inst: string, branch: string): Promise<void>

      Deletes the given branch.

      The first parameter is a string and is the name of the record. If null, then the updates will be added to a tempPublic inst.

      The second parameter is a string and is the name of the inst.

      The third parameter is a string and is the branch in the inst.

    • deleteInst(recordName: string, inst: string): Promise<void>

      Deletes the given inst.

      The first parameter is a string and is the name of the record.

      The second parameter is a string and is the name of the inst.

    • getAllUpdates(recordName: string, inst: string, branch: string): Promise<StoredUpdates>

      Gets the entire list of updates for the given branch in the given inst and record. This should include historical updates. Returns null if the branch does not exist.

      The first parameter is a string and is the name of the record. If null, then the updates for a tempPublic inst will be returned.

      The second parameter is a string and is the name of the inst.

      The third parameter is a string and is the branch in the inst.

    • getBranchByName(recordName: string, inst: string, branch: string): Promise<BranchRecordWithInst>

      Gets the info for the given branch. Returns null if the branch does not exist.

      The first parameter is a string and is the name of the record.

      The second parameter is a string and is the name of the inst.

      The third parameter is a string and is the name of the branch.

    • getCurrentUpdates(recordName: string, inst: string, branch: string): Promise<CurrentUpdates>

      Gets the list of updates for the given branch in the given inst and record. Returns null if the branch does not exist. This will only include updates that are currently being worked on.

      The first parameter is a string and is the name of the record. If null, then the updates for a tempPublic inst will be returned.

      The second parameter is a string and is the name of the inst.

      The third parameter is a string and is the branch in the inst.

    • getInstByName(recordName: string, inst: string): Promise<InstWithSubscriptionInfo>

      Gets the info for the given inst.

      The first parameter is a string and is the name of the record that the inst is in.

      The second parameter is a string and is the name of the inst.

    • getInstSize(recordName: string, inst: string): Promise<number>

      Gets the size of the inst. Returns null if the inst does not exist.

      The first parameter is a string and is the name of the record. If null, then the updates for a tempPublic inst will be returned.

      The second parameter is a string and is the name of the inst.

    • isPackageLoaded(recordName: string, inst: string, packageId: string): Promise<LoadedPackage>

      Determines whether the package with the given ID is loaded into the given inst. Returns the package that was loaded if it is loaded, or null if it is not.

      The first parameter is a string and is the name of the record that the inst is in.

      The second parameter is a string and is the inst.

      The third parameter is a string and is the ID of the package.

    • listInstsByRecord(recordName: string, startingInst?: string): Promise<ListInstsStoreResult>

      Gets the list of insts that are in the given record.

      The first parameter is a string and is the name of the record. If null, then an empty list will be returned.

      The second parameter is optional and is a string and is the name of the inst to start listing at.

    • listInstsByRecordAndMarker(recordName: string, marker: string, startingInst?: string): Promise<ListInstsStoreResult>

      Gets the list of insts that are in the given record and have the given marker.

      The first parameter is a string and is the name of the record. If null, then an empty list will be returned.

      The second parameter is a string and is the marker that the insts must have.

      The third parameter is optional and is a string and is the name of the inst to start listing at.

    • listLoadedPackages(recordName: string, inst: string): Promise<LoadedPackage[]>

      Gets the list of loaded packages for the given record and inst.

      The first parameter is a string and is the name of the record.

      The second parameter is a string and is the inst.

    • replaceCurrentUpdates(recordName: string, inst: string, branch: string, updateToAdd: string, sizeInBytes: number): Promise<ReplaceUpdatesResult>

      Replaces the current set of updates with a new update. Useful for when updates have been merged and the old ones should be replaced by the new one.

      Depending on the implementation, this function may or may not be concurrent safe. That is, if two clients call this function at the same time for the same branch, then it is possible that the branch will be put into an invalid state.

      The first parameter is a string and is the name of the record. If null, then the updates will be added to a tempPublic inst.

      The second parameter is a string and is the name of the inst.

      The third parameter is a string and is the branch in the inst.

      The fourth parameter is a string and is the update that should be added.

      The fifth parameter is a number and is the size of the new update in bytes.

    • saveBranch(branch: BranchRecord): Promise<SaveBranchResult>

      Creates or updates the given branch record.

      The first parameter is a BranchRecord and is the branch that should be saved.

    • saveInst(inst: InstWithBranches): Promise<SaveInstResult>

      Creates or updates the given inst. If branches are included, then they will be added/updated to the inst as well.

      The first parameter is a InstWithBranches and is the inst that should be saved.

    • saveLoadedPackage(loadedPackage: LoadedPackage): Promise<void>

      Saves the given loaded package.

      The first parameter is a LoadedPackage and is the package that should be saved.

  • StabilityAIImageOptions

    Members

    • apiKey string

      The API key to use.

    • defaultHeight? number

      The height that should be used for images that don't specify a height.

    • defaultWidth? number

      The width that should be used for images that don't specify a width.

  • StoreDocumentRequest

    Members

    • address string

      The address of the search record that the document should be stored in.

    • document SearchDocument

      The document to store in the search record.

    • instances string[]

      The instance(s) that are making the request.

    • recordName string

      The name of the record that the document should be stored in.

    • userId string

      The ID of the user that is currently logged in.

  • StoredUpdates

    Members

    • timestamps number[]

    • updates string[]

  • StripeAccount

    Members

    • charges_enabled boolean

      Whether the account can create live charges.

    • id string

      The ID of the account.

    • metadata? object

      Metadata about the account.

    • requirements StripeAccountRequirements

      The requirements that stripe needs for the account.

  • StripeEvent

    Events are our way of letting you know when something interesting happens in your account. When an interesting event occurs, we create a new Event object. For example, when a charge succeeds, we create a charge.succeeded event; and when an invoice payment attempt fails, we create an invoice.payment_failed event. Note that many API requests may cause multiple events to be created. For example, if you create a new subscription for a customer, you will receive both a customer.subscription.created event and a charge.succeeded event.

    Events occur when the state of another API resource changes. The state of that resource at the time of the change is embedded in the event's data field. For example, a charge.succeeded event will contain a charge, and an invoice.payment_failed event will contain an invoice.

    As with other API resources, you can use endpoints to retrieve an individual event or a list of events from the API. We also have a separate webhooks system for sending the Event objects directly to an endpoint on your server. Webhooks are managed in your account settings, and our Using Webhooks guide will help you get set up.

    When using Connect, you can also receive notifications of events that occur in connected accounts. For these events, there will be an additional account attribute in the received Event object.

    NOTE: Right now, access to events through the Retrieve Event API is guaranteed only for 30 days.

    Members

    • account? string

      The connected account that originated the event.

    • api_version string

      The Stripe API version used to render data. Note: This property is populated only for events on or after October 31, 2014.

    • created number

      Time at which the object was created. Measured in seconds since the Unix epoch.

    • data StripeEventData

      The data contained in the event.

    • id string

      Unique identifier for the object.

    • livemode boolean

      Has the value true if the object exists in live mode or the value false if the object exists in test mode.

    • object "event"

      String representing the object's type. Objects of the same type share the same value.

    • pending_webhooks number

      Number of webhooks that have yet to be successfully delivered (i.e., to return a 20x response) to the URLs you've specified.

    • request StripeEventRequest

      Information on the API request that instigated the event.

    • type string

      Description of the event (e.g., invoice.created or charge.refunded).

  • StripeInterface

    Defines an interface that represents the high-level Stripe-like functions that the SubscriptionController uses.

    Members

  • Studio

    Defines an interface for studio objects.

    Members

    • comId? string

      The comId that this studio owns.

    • comIdConfig? object

      The config for comId features.

    • displayName string

      The name of the studio.

    • id string

      The ID of the studio.

    • logoUrl? string

      The URL of the logo for the studio.

    • ownerStudioComId? string

      The comId of the studio that owns this studio.

    • playerConfig? object

      The player web config for the studio.

    • playerWebManifest? object

      The PWA web manifest that should be served for the player.

    • stripeAccountId? string

      The ID of the stripe account for this studio.

    • stripeAccountRequirementsStatus? StripeRequirementsStatus

      The status of the stripe account requirements for this studio.

      If null, then the studio does not have a stripe account. If 'incomplete', then the studio has a stripe account but it is not fully set up. If 'complete', then the studio has a stripe account that is fully set up.

    • stripeAccountStatus? StripeAccountStatus

      The status of the stripe account that is associated with this studio.

      If null, then the studio does not have a stripe account. If 'active', then the stripe account has been approved and is active. If 'pending', then the stripe account is waiting approval. If 'rejected', then the stripe account was rejected. If 'disabled', then the stripe account was disabled but not because it was rejected.

    • stripeCustomerId? string

      The ID of the stripe customer for this studio.

    • subscriptionId? string

      The ID of the purchasable subscription that the user has. Note that this is the ID of the subscription in the config, not the ID of the stripe subscription.

    • subscriptionInfoId? string

      The ID of the subscription that this studio record references.

    • subscriptionPeriodEndMs? number

      The unix time in miliseconds that the studio's current subscription period ends at.

    • subscriptionPeriodStartMs? number

      The unix time in miliseconds that the studio's current subscription period started at.

    • subscriptionStatus? string

      The current subscription status for this studio.

  • StudioAssignment

    Defines an interface for studio assignment objects.

    Members

    • isPrimaryContact boolean

      Whether the user is the primary contact for this studio.

    • role StudioAssignmentRole

      The role that this user has in the studio.

    • studioId string

      The ID of the studio that this assignment applies to.

    • userId string

      The ID of the user that this assignment applies to.

  • StudioComIdFeaturesConfiguration

    Members

    • allowed boolean

      Whether comId features are granted to the studio.

    • maxDomains? number

      The maximum number of domains that can be used with this comId.

    • maxStudios? number

      The maximum number of studios that are allowed to be created in this comId. If not specified, then there is no limit.

  • StudioComIdRequest

    Defines an interface that represents a request for a comId to be applied to a studio.

    Members

    • createdAtMs number

      The unix timestamp in miliseconds when the request was created.

    • id string

      The ID of the request.

    • requestedComId string

      The comId that is being requested.

    • requestingIpAddress string

      The IP Address that the request came from.

    • studioId string

      The ID of the studio.

    • updatedAtMs number

      The unix timestamp in miliseconds when the request was last updated.

    • userId string

      The ID of the user that is making the request. Null if the user has been deleted.

  • StudioComIdRequestNotification

    Defines a base interface for a notification that is related to a record.

    Members

    • action NotificationResourceActions

      The action that was taken on the resource.

    • markers? string[]

      The markers that are present on the resource.

    • recordName? string

      The name of the record that the notification is for. Null or undefined if the notification is not for a specific record.

    • request StudioComIdRequest

      The request that this notification is for.

    • resource "studio_com_id_request"

    • resourceId string

      The ID of the resource.

    • timeMs number

      The unix time in milliseconds that the notification was sent.

  • SubscribeToNotificationAction

    Defines an event that attempts to subscribe to a notification.

    Members

    • address string

      The address of the notification.

    • options RecordActionOptions

      The options that the action should use.

    • playerId? string

      The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.

    • recordName string

      The name of the record.

    • taskId (string | number)

      The ID of the async task.

    • type "subscribe_to_notification"

      The type of the event. This helps determine how the event should be applied to the state.

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • SubscribeToNotificationRequest

    Members

    • address string

      The address of the notification.

    • instances string[]

      The instances that are currently loaded.

    • pushSubscription object

      The push subscription to include with the subscription.

    • recordName string

      The name of the record that the notification is in.

    • userId string

      The ID of the user that is logged in.

  • SubscriptionConfiguration

    Members

    • cancelUrl string

      The URL that the user should be sent to upon cancelling a subscription purchase.

    • checkoutConfig? any

      The configuration that should be passed to https://stripe.com/docs/api/checkout/sessions when creating a checkout session.

    • defaultFeatures DefaultFeaturesConfiguration

      The features that should be used when a tier does not have a features configuration.

    • portalConfig? any

      The configuration that should be passed to https://stripe.com/docs/api/customer_portal when creating a portal session.

    • returnUrl string

      The URL that the user should be returned to after managing their subscriptions.

    • subscriptions APISubscription[]

      The information that should be used for subscriptions.

    • successUrl string

      The URL that the user should be sent to upon successfully purchasing a subscription.

    • tiers TiersConfiguration

      The object that contains configurations for each subscription tier.

    • webhookSecret string

      The webhook secret that should be used for validating webhooks.

  • SubscriptionController

    Defines a class that is able to handle subscriptions.

    Members

  • SubscriptionFilter

    Members

    • ownerId? string

      The ID of the user that owns the subscription.

    • studioId? string

      The ID of the studio that owns the subscription.

  • SubscriptionMetrics

    Members

    • currentPeriodEndMs number

      The unix time in miliseconds of the end of the current subscription period.

    • currentPeriodStartMs number

      The unix time in miliseconds of the start of the current subscription period.

    • ownerId string

    • recordName? string

    • stripeAccountId string

      The ID of the stripe account that the record is associated with. Null if a stripe account is not associated with the record.

    • stripeAccountStatus StripeAccountStatus

      The status of the stripe account that the record is associated with. Null if a stripe account is not associated with the record.

    • studioId string

    • subscriptionId string

      The ID of the subscription.

    • subscriptionStatus string

      The status of the subscription.

    • subscriptionType ("user" | "studio")

      The type of the subscription.

    • userId? string

  • SuperShoutAction

    Defines an event for actions that are shouted to every current loaded simulation.

    Members

    • argument? any

      The argument to pass as the "that" variable to scripts.

    • eventName string

      The name of the event.

    • type "super_shout"

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • SyncItemEvent

    Members

    • action ("create" | "update" | "delete")

      The action that was performed on the item.

    • itemAddress string

      The address of the item.

    • itemMarkers string[]

      The markers of the item.

    • itemRecordName string

      The name of the record that the item is in.

    • itemResourceKind string

      The kind of resource that the item is.

    • type "sync_item"

  • SyncSearchRecordEvent

    Members

  • SyncSearchRecordRequest

    Members

    • address string

      The address of the search record that should be synced.

    • instances string[]

      The instance(s) that are making the request.

    • recordName string

      The name of the record that should be synced.

    • targetMapping [string, string][]

      The mapping of the target properties to the search document properties.

    • targetMarker string

      The marker of the resources that should be synced.

    • targetRecordName string

      The name of the record that the data should be synced from.

    • targetResourceKind ResourceKinds

      The kind of resources that should be synced.

    • userId string

      The ID of the user that is currently logged in.

  • SystemNotificationMessenger

    Defines an interface for a class that is able to send records notifications.

    Members

  • TagSpecificApiOptions

    Options needed for the Bot-specific API.

    Members

    • bot Bot

      The Bot that the API is for.

    • config? Bot

      The bot that is set as the config of the current bot.

    • creator Bot

      The bot that is set as the creator of the current bot.

    • tag string

      The tag that the API is for.

  • TempBranchInfo

    Members

    • branch string

      The name of the branch.

    • inst string

      The name of the inst.

    • linkedInst InstWithSubscriptionInfo

      The inst that this branch belongs to. Null if the branch does not have a reocrd name.

    • recordName string

      The name of the record.

    • temporary boolean

      Whether the branch is temporary.

  • TemporaryInstRecordsStore

    Defines an interface for a store that keeps track of temporary inst records.

    A key feature of temporary records stores is that they act like a cache. As a result, it may evict data based on configuration or other factors (like memory pressure).

    Members

    • acquireLock(id: string, timeout: number): Promise<() => Promise<boolean>>

      Acquire a lock for/with the given id

      The first parameter is a string and is the id to acquire the lock for

      The second parameter is a number and is the amount of time to wait before the lock is released

    • addBranchSize(recordName: string, inst: string, branch: string, sizeInBytes: number): Promise<void>

      Adds the given amount to the size of the branch.

      The first parameter is a string and is the name of the record.

      The second parameter is a string and is the name of the inst.

      The third parameter is a string and is the name of the branch.

      The fourth parameter is a number and is the size.

    • addInstSize(recordName: string, inst: string, sizeInBytes: number): Promise<void>

      Adds the given amount to the size of the inst.

      The first parameter is a string and is the name of the record.

      The second parameter is a string and is the name of the inst.

      The third parameter is a number and is the size.

    • addUpdates(recordName: string, inst: string, branch: string, updates: string[], sizeInBytes: number): Promise<void>

      Adds the given updates to this temporary store.

      The first parameter is a string and is the name of the record.

      The second parameter is a string and is the name of the inst.

      The third parameter is a string and is the name of the branch.

      The fourth parameter is a string[] and is the updates that should be added.

      The fifth parameter is a number and is the size of the updates in bytes.

    • clearDirtyBranches(generation: string): Promise<void>

      Removes given generation of dirty branches.

      The first parameter is a string and

    • countBranchUpdates(recordName: string, inst: string, branch: string): Promise<number>

      Gets the number of updates that are currently stored in the given branch.

      The first parameter is a string and is the name of the record.

      The second parameter is a string and is the name of the inst.

      The third parameter is a string and is the name of the branch.

    • deleteAllInstBranchInfo(recordName: string, inst: string): Promise<void>

      Deletes all the branches that are associated with the given inst.

      The first parameter is a string and is the name of the record.

      The second parameter is a string and is the name of the inst.

    • deleteBranch(recordName: string, inst: string, branch: string): Promise<void>

      Deletes all the info that the branch has stored.

      The first parameter is a string and is the name of the record.

      The second parameter is a string and is the name of the inst.

      The third parameter is a string and is the name of the branch.

    • deleteBranchSize(recordName: string, inst: string, branch: string): Promise<void>

      Deletes the branch size.

      The first parameter is a string and is the name of the record.

      The second parameter is a string and is the name of the inst.

      The third parameter is a string and is the name of the branch.

    • deleteInstSize(recordName: string, inst: string): Promise<void>

      Deletes the inst size.

      The first parameter is a string and is the name of the record.

      The second parameter is a string and is the name of the inst.

    • getBranchByName(recordName: string, inst: string, branch: string): Promise<TempBranchInfo & object>

      Gets info for the given branch.

      The first parameter is a string and

      The second parameter is a string and

      The third parameter is a string and

    • getBranchSize(recordName: string, inst: string, branch: string): Promise<number>

      Gets the size of the branch in bytes. Returns null if no size is stored.

      The first parameter is a string and is the name of the record.

      The second parameter is a string and is the name of the inst.

      The third parameter is a string and is the name of the branch.

    • getDirtyBranchGeneration(): Promise<string>

      Gets the current generation that dirty branches should be recorded in.

    • getInstSize(recordName: string, inst: string): Promise<number>

      Gets the size of the inst in bytes. Returns null if no size is stored.

      The first parameter is a string and is the name of the record.

      The second parameter is a string and is the name of the inst.

    • getUpdates(recordName: string, inst: string, branch: string): Promise<BranchUpdates>

      Gets the updates that are stored in this temporary store. Returns null if no updates are stored.

      The first parameter is a string and

      The second parameter is a string and

      The third parameter is a string and

    • isPackageLoaded(recordName: string, inst: string, packageId: string): Promise<LoadedPackage>

      Determines whether the package with the given ID is loaded into the given inst.

      The first parameter is a string and is the name of the record that the inst is in.

      The second parameter is a string and is the inst.

      The third parameter is a string and is the ID of the package.

    • listDirtyBranches(generation?: string): Promise<BranchName[]>

      Gets the list of branches that are dirty.

      The first parameter is optional and is a string and is the generation that the branches should be in.

    • listLoadedPackages(recordName: string, inst: string): Promise<LoadedPackage[]>

      Gets the list of loaded packages for the given record and inst.

      The first parameter is a string and is the name of the record.

      The second parameter is a string and is the inst.

    • markBranchAsDirty(branch: BranchName): Promise<void>

      Marks the given branch as dirty in the current generation.

      The first parameter is a BranchName and is the branch that should be marked.

    • saveBranchInfo(branch: TempBranchInfo): Promise<void>

      Saves the branch info to the temporary store.

      The first parameter is a TempBranchInfo and

    • saveLoadedPackage(loadedPackage: LoadedPackage): Promise<void>

      Saves the given loaded package.

      The first parameter is a LoadedPackage and is the package that should be saved.

    • setBranchSize(recordName: string, inst: string, branch: string, sizeInBytes: number): Promise<void>

      Sets the size of the branch in bytes.

      The first parameter is a string and is the name of the record.

      The second parameter is a string and is the name of the inst.

      The third parameter is a string and is the name of the branch.

      The fourth parameter is a number and is the size of the inst in bytes.

    • setDirtyBranchGeneration(generation: string): Promise<void>

      Sets the current generation that dirty branches should be recorded in.

      The first parameter is a string and is the generation of dirty branches.

    • setInstSize(recordName: string, inst: string, sizeInBytes: number): Promise<void>

      Sets the size of the inst in bytes.

      The first parameter is a string and is the name of the record.

      The second parameter is a string and is the name of the inst.

      The third parameter is a number and is the size of the inst in bytes.

    • trimUpdates(recordName: string, inst: string, branch: string, numToDelete: number): Promise<void>

      Deletes the given number of updates from the beginning of the updates list. May also set the branch to expire.

      The first parameter is a string and is the name of the record.

      The second parameter is a string and is the name of the inst.

      The third parameter is a string and is the name of the branch.

      The fourth parameter is a number and is the number of updates that should be deleted from the beginning of the list.

  • TransactionAction

    A set of bot events in one.

    Members

    • events BotAction[]

    • type "transaction"

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

  • TransfersQuery

    Members

    • code? TransferCodes

      The code to fitler transfers by.

    • transactionId? (string | bigint)

      The ID of the transaction to query transfers for.

  • UniqueFinancialAccountFilter

    Members

    • contractId? string

      The contract ID to filter by.

    • ledger number

      The ledger to filter by.

    • studioId? string

      The studio ID to filter by.

    • userId? string

      The user ID to filter by.

  • UnsubscribeToNotificationRequest

    Members

    • instances string[]

      The instances that are currently loaded.

    • subscriptionId string

      The ID of the subscription.

    • userId string

      The ID of the user that is logged in.

  • UnsyncSearchRecordRequest

    Members

    • instances string[]

      The instance(s) that are making the request.

    • syncId string

      The ID of the sync that should be deleted.

    • userId string

      The ID of the user that is currently logged in.

  • UpdateBotAction

    Defines a bot event that indicates a bot was updated.

    Members

    • id string

    • type "update_bot"

    • uncopiable? boolean

      Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.

    • update Partial<Bot>

  • UpdateCheckoutSessionRequest

    Members

    • fulfilledAtMs number

      The unix time in miliseconds that the checkout session was fulfilled at.

    • id string

      The ID of the session.

    • invoice Omit<AuthInvoice, ("id" | "subscriptionId" | "periodId" | "checkoutSessionId")>

      The invoice that should be created/updated. If null, then the invoice will not be created/updated.

    • items AuthCheckoutSessionItem[]

      The items in the session.

    • paid boolean

      Whether the checkout session has been paid for or not.

    • paymentStatus CheckoutSessionPaymentStatus

      The payment status of the checkout session.

    • shouldBeAutomaticallyFulfilled? boolean

      Whether the checkout session should be automatically fulfilled once payment completes.

    • status CheckoutSessionStatus

      The status of the checkout session.

    • stripeCheckoutSessionId string

      The ID of the stripe checkout session that is associated with this session. If null, then the session is not associated with a stripe checkout session.

    • transactionId? string

      The transaction ID that should be associated with the checkout session.

    • transferIds? string[]

      The transfers that have been posted for the checkout session.

    • transfersPending? boolean

      Wether the transfers are currently pending. Defaults to false.

    • userId string

      The ID of the user that the checkout session is for.

  • UpdateStudioRequest

    Members

    • studio object

      The studio that should be updated.

    • userId string

      The ID of the user that is logged in.

  • UpdateSubscriptionInfoRequest

    Members

    • currentPeriodEndMs number

      The unix time in miliseconds that the current subscription period ends at.

    • currentPeriodStartMs number

      The unix time in miliseconds that the current subscription period started at.

    • stripeCustomerId string

      The ID of the stripe customer. If null, then the subscription is not associated with a stripe customer. Note that if the user already has a customer ID, and null is provided, then the customer ID will not be updated.

    • stripeSubscriptionId string

      The ID of the subscription in Stripe's database. If null, then the subscription is not associated with a stripe subscription.

    • studioId? string

      The ID of the studio that the subscription info should be updated for.

    • subscriptionId string

      The ID of the purchasable subscription that the user has.

    • subscriptionStatus string

      The current status of the subscription.

    • userId? string

      The ID of the user that the subscription info should be updated for.

  • UpdateSubscriptionPeriodRequest

    Members

    • currentPeriodEndMs number

      The unix time in miliseconds that the current subscription period ends at.

    • currentPeriodStartMs number

      The unix time in miliseconds that the current subscription period started at.

    • invoice Omit<AuthInvoice, ("id" | "subscriptionId" | "periodId" | "checkoutSessionId")>

      The invoice that should be created.

    • stripeCustomerId string

      The ID of the stripe customer.

    • stripeSubscriptionId string

      The ID of the subscription in Stripe's database.

    • studioId? string

      The ID of the studio that the subscription info should be updated for.

    • subscriptionId string

      The ID of the purchasable subscription that the user has.

    • subscriptionStatus string

      The current status of the subscription.

    • userId? string

      The ID of the user that the subscription info should be updated for.

  • UpdateSubscriptionRequest

    Members

    • currentUserId string

      The ID of the user that is currently logged in.

    • currentUserRole UserRole

      The role of the user that is currently logged in.

    • studioId? string

      The ID of the studio whose subscription should be updated.

    • subscriptionId string

      The ID of the subscription that the user should have. If null, then the subscription will be removed from the user.

    • subscriptionPeriodEndMs number

      The unix time in miliseconds that the subscription period ends. If null, then the subscription does not have an end date. This means that the subscription will never end.

    • subscriptionPeriodStartMs number

      The unix time in miliseconds that the subscription period starts. If null, then the subscription does not have a start date. This means that the subscription has already started.

    • subscriptionStatus ("ended" | "active" | "trialing" | "unpaid" | "canceled" | "past_due" | "incomplete" | "incomplete_expired" | "paused")

      The status of the subscription.

    • userId? string

      The ID of the user whose subscription should be updated.

  • UpdateUserInfoRequest

    Defines an interface for a request to update user info.

    Members

    • sessionKey string

      The session key that should be used to authenticate the request.

    • update Partial<Pick>

      The new info for the user.

    • userId string

      The ID of the user whose info should be updated.

  • UpdatedSearchCollection

    Members

  • UsageBillingOptions

    Members

    • billingCode BillingCodes

      The billing code that should be set on transfers.

    • maxSteps? number

      The maximum number of billing steps that can be performed.

      Defaults to 100.

    • studioId? string

      The ID of the studio to bill. Cannot be specified with userId.

    • transferCode TransferCodes

      The transfer code that should be used for the billing transfer.

    • userId? string

      The ID of the user to bill. Cannot be specified with studioId.

  • UserInstReport

    Members

    • automaticReport boolean

      Whether the report was automatically generated.

    • createdAtMs number

      The unix timestamp in milliseconds when the report was created.

    • id string

      The ID of the report.

    • inst string

      The name of the inst.

    • recordName string

      The name of the record that the inst exists in. Null if the inst is public.

    • reportReason ReportReason

      The user-provided reason category that the inst was reported for.

    • reportReasonText string

      The user-provided explaination that the inst was reported for.

    • The permalink that was reported.

    • reportedUrl string

      The URL that was reported.

    • reportingIpAddress string

      The IP address that the report came from. Null if the IP address could not be determined (i.e. in the case that the report was automatically generated).

    • reportingUserId string

      The ID of the user that reported the inst. Null if the user was not logged in when reporting the inst.

    • updatedAtMs number

      The unix timestamp in milliseconds when the report was last updated.

  • UserInstReportNotification

    Defines a notification that is for a user inst report.

    Members

    • action NotificationResourceActions

      The action that was taken on the resource.

    • markers? string[]

      The markers that are present on the resource.

    • recordName? string

      The name of the record that the notification is for. Null or undefined if the notification is not for a specific record.

    • report UserInstReport

      The report that was created.

    • resource "user_inst_report"

    • resourceId string

      The ID of the resource.

    • timeMs number

      The unix time in milliseconds that the notification was sent.

  • UserLoginMetadata

    Defines metadata that is included after a user successfully logs in.

    Members

    • hasPushSubscription boolean

      Whether the user has a registered push subscription. Should be used as a hint to the client to prompt the user to register a push subscription for their device. If null or undefined, then the user does not have a push subscription.

    • hasUserAuthenticator boolean

      Whether the user has a registered user authenticator (passkey). Should be used as a hint to the client to prompt the user to register a passkey. If null or undefined, then the user does not have a passkey.

    • pushSubscriptionIds string[]

      The list of active push subscription IDs that the user has registered. Can be used by the client to determine if this device has already registered a push subscription. Each ID is a UUIDv5 of the endpoint of the push subscription and the subscription ID namespace. If the user has a push subscription, but the list doesn't contain the current push subscription, then the device should re-register the push subscription. If empty, then the user does not have any push subscriptions.

    • userAuthenticatorCredentialIds string[]

      The list of active user authenticator credential IDs that the user has registered. Can be used by the client to determine if this device has already registered a user authenticator. If empty, then the user does not have any user authenticators.

  • UserPrivacyFeatures

    Members

    • allowAI boolean

      Whether the user is allowed to access AI features.

    • allowPublicData boolean

      Whether the user is allowed to publish or access public data.

    • allowPublicInsts boolean

      Whether the user is allowed to access public insts.

    • publishData boolean

      Whether the user is allowed to publish data.

    • userRole? UserRole

      The role of the user. Null or undefined if the user doesn't have a role.

  • VerifyCustomDomainRequest

    Members

    • customDomainId string

      The ID of the custom domain to verify.

    • userId string

      The ID of the currently logged in user.

    • userRole? UserRole

      The role of the currently logged in user.

  • WebPushInterface

    Defines a basic interface that is able to send notifications using web push.

    Members

    • getServerApplicationKey(): string

      Gets the VAPID public key that the server is using.

    • sendNotification(pushSubscription: object, payload: object, topic?: string): Promise<SendPushNotificationResult>

      Sends a notification to the given push subscription.

      The first parameter is a object and is the push subscription to send the notification to.

      The second parameter is a object and is the payload to send.

      The third parameter is optional and is a string and is the topic that the notification is for. Topics can be used to replace existing notifications with a new notification.

  • WebhookActionOptions

    Defines a set of options for a webhook.

    Members

    • data? any

      The data to send with the request.

    • headers? object

      The headers to include in the request.

    • method string

      The HTTP Method that the request should use.

    • responseShout string

      The shout that should be made when the request finishes.

    • url string

      The URL that the request should be made to.

  • WebhookEnvironment

    Defines an interface for objects that represent a webhook environment. That is, they provide a way to call into the environment that the webhook is running in and shut it down.

    In addition to providing a way to manage the environment, it also should provide mechanisms for securely isolating the environment from the rest of the system.

    Members

  • WebhookInterface

    Members

  • WebhookRecordsController

    Defines a controller that is able to handle and execute webhooks.

    Members

  • WebhookRunInfo

    Defines information about a time that a webhook was run.

    Members

    • errorResult object

      The error result of the webhook run.

    • infoFileName string

      The name of the file record that contains the request and response data. Null if the data file could not be recorded.

    • infoRecordName string

      The name of the record that the request data was stored in. Null if the data could not be recorded.

    • options? HandleWebhookOptions

      The options that were included in the webhook run.

    • recordName string

      The name of the record that the webhook is in.

    • requestTimeMs number

      The unix time in miliseconds when the webhook request was recieved.

    • responseTimeMs number

      The unix time in miliseconds when the webhook response was sent.

    • runId string

      The ID of the webhook run.

    • stateSha256 string

      The SHA-256 hash of the state that was passed to the webhook.

    • statusCode number

      The status code of the response. If null, then the response was not recieved.

    • webhookAddress string

      The address of the webhook.

  • WebhookRunInfoWithWebhook

  • WebhookSubscriptionMetrics

    Members

    • currentPeriodEndMs number

      The unix time in miliseconds of the end of the current subscription period.

    • currentPeriodStartMs number

      The unix time in miliseconds of the start of the current subscription period.

    • ownerId string

    • recordName? string

    • stripeAccountId string

      The ID of the stripe account that the record is associated with. Null if a stripe account is not associated with the record.

    • stripeAccountStatus StripeAccountStatus

      The status of the stripe account that the record is associated with. Null if a stripe account is not associated with the record.

    • studioId string

    • subscriptionId string

      The ID of the subscription.

    • subscriptionStatus string

      The status of the subscription.

    • subscriptionType ("user" | "studio")

      The type of the subscription.

    • totalItems number

      The total number of webhook items that are stored in the subscription.

    • totalRunsInLastHour number

      The number of webhook runs that have been recorded in the last hour.

    • totalRunsInPeriod number

      The number of webhook runs that have been recorded for the last subscription period.

    • userId? string

  • WebsocketConnectionStore

    Members

    • clearConnection(connectionId: string): Promise<void>

      Deletes all the connections with the given connection ID.

      The first parameter is a string and is the ID of the connection.

    • countConnections(): Promise<number>

      Counts the number of active connections.

    • countConnectionsByBranch(mode: BranchConnectionMode, recordName: string, inst: string, branch: string): Promise<number>

      Counts the number of active connections for the given branch.

      The first parameter is a BranchConnectionMode and

      The second parameter is a string and

      The third parameter is a string and

      The fourth parameter is a string and

    • deleteBranchConnection(connectionId: string, mode: BranchConnectionMode, recordName: string, inst: string, branch: string): Promise<void>

      Deletes the given connection from the store.

      The first parameter is a string and is the ID of the connection.

      The second parameter is a BranchConnectionMode and is the mode of the connection.

      The third parameter is a string and is the name of the record that the branch exists in.

      The fourth parameter is a string and is the name of the inst that the branch exists in.

      The fifth parameter is a string and is the name of the branch.

    • expireConnection(connectionId: string): Promise<void>

      Marks all the connections associated with the given connection ID as expired so that they can be deleted in the future. Works similarly to clearConnection(), but instead of deleting the connection, it marks them as expired.

      After calling this, the given connection ID will not be present in getConnectionsByNamespace() or countConnections(), but the connection will still be present in getConnection() (until the connection expires).

      The first parameter is a string and is the ID of the connection.

    • getBranchConnection(connectionId: string, mode: BranchConnectionMode, recordName: string, inst: string, branch: string): Promise<DeviceBranchConnection>

      Gets the connection for the given connection ID and branch.

      The first parameter is a string and is the ID of the connection to get.

      The second parameter is a BranchConnectionMode and

      The third parameter is a string and is the name of the record that the branch exists in.

      The fourth parameter is a string and is the name of the inst that the branch exists in.

      The fifth parameter is a string and is the name of the branch.

    • getConnection(connectionId: string): Promise<DeviceConnection>

      Gets the given connection with the connection server ID.

      The first parameter is a string and is the server ID of the connection to get.

    • getConnectionRateLimitExceededTime(connectionId: string): Promise<number>

      Gets the last time that the connection rate limit was exceeded for the given connection ID.

      The first parameter is a string and is the ID of the connection.

    • getConnections(connectionId: string): Promise<DeviceBranchConnection[]>

      Gets the list of connections that are present for the given connection ID.

      The first parameter is a string and is the ID of the connection.

    • getConnectionsByBranch(mode: BranchConnectionMode, recordName: string, inst: string, branch: string): Promise<DeviceBranchConnection[]>

      Gets all the connections for the given branch.

      The first parameter is a BranchConnectionMode and is the mode of the connections.

      The second parameter is a string and is the name of the record that the branch exists in.

      The third parameter is a string and is the name of the inst that the branch exists in.

      The fourth parameter is a string and is the name of the branch.

    • isAuthorizedInst(connectionId: string, recordName: string, inst: string, scope: ("updateData" | "token")): Promise<boolean>

      Gets whether the given record name and inst have been authorized by the given connection.

      The first parameter is a string and is the ID of the connection.

      The second parameter is a string and is the name of the record.

      The third parameter is a string and is the name of the inst.

      The fourth parameter is a ("updateData" | "token") and is the scope of the authorization. "token" means that the connection has logged in with a valid token for the given record name and inst. "updateData" means that the connection has correct permissions to update the data in the inst.

    • saveAuthorizedInst(connectionId: string, recordName: string, inst: string, scope: ("updateData" | "token")): Promise<void>

      Saves that the given record name and inst have been authorized by the given connection.

      The first parameter is a string and is the ID of the connection.

      The second parameter is a string and is the name of the record.

      The third parameter is a string and is the name of the inst.

      The fourth parameter is a ("updateData" | "token") and is the scope of the authorization. "token" means that the connection has logged in with a valid token for the given record name and inst. "updateData" means that the connection has correct permissions to update the data in the inst.

    • saveBranchConnection(connection: DeviceBranchConnection): Promise<void>

      Saves the given namespace connection to the store.

      The first parameter is a DeviceBranchConnection and is the connection to save.

    • saveConnection(connection: DeviceConnection): Promise<void>

      Saves the given connection to the store.

      The first parameter is a DeviceConnection and is the connection to save.

    • setConnectionRateLimitExceededTime(connectionId: string, timeMs: number): Promise<void>

      Sets the last time that the connection rate limit was exceeded for the given connection ID.

      The first parameter is a string and is the ID of the connection.

      The second parameter is a number and is the unix time in miliseconds.

  • WebsocketController

    Defines a class that is able to serve causal repos in realtime.

    Members

    • defaultDeviceSelector DeviceSelector

      Gets or sets the default device selector that should be used for events that are sent without a selector.

    • mergeUpdatesOnMaxSizeExceeded boolean

    • constructor(connectionStore: WebsocketConnectionStore, messenger: WebsocketMessenger, instStore: InstRecordsStore, temporaryInstStore: TemporaryInstRecordsStore, auth: AuthController, policies: PolicyController, config: ConfigurationStore, metrics: MetricsStore, authStore: AuthStore, packageVersions: PackageVersionRecordsController): WebsocketController

      The first parameter is a WebsocketConnectionStore and

      The second parameter is a WebsocketMessenger and

      The third parameter is a InstRecordsStore and

      The fourth parameter is a TemporaryInstRecordsStore and

      The fifth parameter is a AuthController and

      The parameter is a PolicyController and

      The parameter is a ConfigurationStore and

      The parameter is a MetricsStore and

      The parameter is a AuthStore and

      The parameter is a PackageVersionRecordsController and

    • addUpdates(connectionId: string, event: AddUpdatesMessage): Promise<void>

      The first parameter is a string and

      The second parameter is a AddUpdatesMessage and

    • addUserUpdates(request: AddUpdatesRequest): Promise<AddInstUpdatesResult>

      The first parameter is a AddUpdatesRequest and

    • deviceCount(connectionId: string, recordName: string, inst: string, branch: string): Promise<void>

      The first parameter is a string and

      The second parameter is a string and

      The third parameter is a string and

      The fourth parameter is a string and

    • disconnect(connectionId: string): Promise<void>

      The first parameter is a string and

    • downloadRequest(connectionId: string, requestId: number, url: string, method: string, headers: UploadHttpHeaders): Promise<DownloadRequestResult>

      The first parameter is a string and

      The second parameter is a number and

      The third parameter is a string and

      The fourth parameter is a string and

      The fifth parameter is a UploadHttpHeaders and

    • eraseInst(recordKeyOrName: string, inst: string, userId: string): Promise<EraseInstResult>

      The first parameter is a string and

      The second parameter is a string and

      The third parameter is a string and

    • getBranchData(userId: string, recordName: string, inst: string, branch: string, auxVersion: (1 | 2)): Promise<GetBranchDataResult>

      Gets the data from the given branch in the given inst.

      The first parameter is a string and is the ID of the user that is currently logged in.

      The second parameter is a string and is the name of the record that the inst is in. Null if accessing a public inst.

      The third parameter is a string and is the name of the inst.

      The fourth parameter is a string and is the name of the branch in the inst.

      The fifth parameter is a (1 | 2) and is the AUX version to return.

    • getUpdates(connectionId: string, recordName: string, inst: string, branch: string): Promise<void>

      The first parameter is a string and

      The second parameter is a string and

      The third parameter is a string and

      The fourth parameter is a string and

    • installPackage(request: LoadPackageRequest): Promise<LoadPackageResult>

      Attempts to install a package into an inst.

      The first parameter is a LoadPackageRequest and is the request to load the package.

    • listInstalledPackages(request: ListInstalledPackagesRequest): Promise<ListInstalledPackagesResult>

      The first parameter is a ListInstalledPackagesRequest and

    • listInsts(recordName: string, userId: string, startingInst: string, marker?: string): Promise<ListInstsResult>

      The first parameter is a string and

      The second parameter is a string and

      The third parameter is a string and

      The fourth parameter is optional and is a string and

    • login(connectionId: string, requestId: number, message: LoginMessage): Promise<void>

      Attempts to log the given connection in.

      The first parameter is a string and is the ID of the connection.

      The second parameter is a number and is the ID of the request.

      The third parameter is a LoginMessage and is the login message.

    • rateLimitExceeded(connectionId: string, retryAfter: number, totalHits: number, timeMs: number): Promise<void>

      Handles when the rate limit has been exceeded by the given connection.

      The first parameter is a string and is the ID of the connection.

      The second parameter is a number and is the Retry-After header value.

      The third parameter is a number and is the total number of hits by the connection.

      The fourth parameter is a number and is the current time in unix time in miliseconds.

    • requestMissingPermission(connectionId: string, event: RequestMissingPermissionMessage): Promise<void>

      Requests that the user be given permission to access the given resource.

      The first parameter is a string and is the ID of the connection that is making the request.

      The second parameter is a RequestMissingPermissionMessage and is the request missing permission event.

    • respondToPermissionRequest(connectionId: string, event: RequestMissingPermissionResponseMessage): Promise<void>

      Responds to a missing permission request.

      The first parameter is a string and is the ID of the connection that is responding to the request.

      The second parameter is a RequestMissingPermissionResponseMessage and is the response to the missing permission request.

    • savePermanentBranches(timeout: number): Promise<void>

      Saves all of the permanent branches that are currently in memory.

      The first parameter is a number and is the timeout for the operation. Defaults to 30 seconds.

    • sendAction(connectionId: string, event: SendActionMessage): Promise<void>

      The first parameter is a string and

      The second parameter is a SendActionMessage and

    • sendError(connectionId: string, requestId: number, info: WebsocketErrorInfo): Promise<void>

      The first parameter is a string and

      The second parameter is a number and

      The third parameter is a WebsocketErrorInfo and

    • sendEvent(connectionId: string, event: WebsocketEvent): Promise<void>

      The first parameter is a string and

      The second parameter is a WebsocketEvent and

    • syncTime(connectionId: string, event: TimeSyncRequestMessage, requestTime: number): Promise<void>

      The first parameter is a string and

      The second parameter is a TimeSyncRequestMessage and

      The third parameter is a number and

    • unwatchBranch(connectionId: string, recordName: string, inst: string, branch: string): Promise<void>

      The first parameter is a string and

      The second parameter is a string and

      The third parameter is a string and

      The fourth parameter is a string and

    • unwatchBranchDevices(connectionId: string, recordName: string, inst: string, branch: string): Promise<void>

      The first parameter is a string and

      The second parameter is a string and

      The third parameter is a string and

      The fourth parameter is a string and

    • uploadRequest(connectionId: string, requestId: number): Promise<void>

      Processes the given upload request.

      The first parameter is a string and is the ID of the connection that is requesting the upload.

      The second parameter is a number and is the ID of the request.

    • watchBranch(connectionId: string, event: WatchBranchMessage): Promise<void>

      The first parameter is a string and

      The second parameter is a WatchBranchMessage and

    • watchBranchDevices(connectionId: string, recordName: string, inst: string, branch: string): Promise<void>

      The first parameter is a string and

      The second parameter is a string and

      The third parameter is a string and

      The fourth parameter is a string and

    • webhook(recordName: string, inst: string, branch: string, method: string, url: string, headers: object, data: object): Promise<number>

      Processes a webhook and returns the status code that should be returned.

      The first parameter is a string and

      The second parameter is a string and

      The third parameter is a string and is the branch that the webhook is for.

      The fourth parameter is a string and is the HTTP method that was used for the webhook.

      The fifth parameter is a string and is the URL that was requested.

      The parameter is a object and is the headers that were included in the request.

      The parameter is a object and is the data included in the request.

  • WebsocketMessenger

    Defines an interface that is capable of sending messages to connections.

    Members

    • disconnect(connectionId: string): Promise<void>

      Disconnects the given connection.

      The first parameter is a string and is the ID of the connection.

    • downloadMessage(url: string, method: string, headers: UploadHttpHeaders): Promise<string>

      Tries to download the message that was uploaded to the given URL. Returns null if the message could not be found. Returns undefined if message downloads is not supported.

      The first parameter is a string and is the URl that the message was uploaded to.

      The second parameter is a string and is the HTTP method that should be used to download the message. Might be ignored if the messenger recognizes the URL.

      The third parameter is a UploadHttpHeaders and is the headers that should be used to download the message. Might be ignored if the messenger recognizes the URL.

    • presignMessageUpload(): Promise<PresignFileUploadResult>

      Gets a URL that messages can be uploaded to. Returns null/undefined if message uploads are not supported.

    • sendEvent(connectionId: string, event: WebsocketEvent): Promise<void>

      Sends the given event to the given connection ID.

      The first parameter is a string and is the ID of the connection.

      The second parameter is a WebsocketEvent and is the event that should be sent.

    • sendMessage(connectionIds: string[], data: WebsocketMessage, excludeConnection?: string): Promise<void>

      Sends the given data to the given connection IDs.

      The first parameter is a string[] and is the IDs of the connections.

      The second parameter is a WebsocketMessage and is the data that should be sent.

      The third parameter is optional and is a string and is the connection ID that should be skipped.

    • sendRaw(connectionId: string, data: string): Promise<void>

      Sends the given raw data to the given connection ID.

      The first parameter is a string and is the ID of the connection.

      The second parameter is a string and is the data that should be sent.