UNPKG

@casual-simulation/aux-runtime

Version:
984 lines 28.7 kB
/** * Creates a new AIChatAction. * * @param messages The messages to include in the chat. * @param options The options for the chat. * @param taskId The ID of the async task. */ export function aiChat(messages, options, taskId) { return { type: 'ai_chat', messages, options: options !== null && options !== void 0 ? options : {}, taskId, }; } /** * Creates a new AIChatStreamAction. * * @param messages The messages to include in the chat. * @param options The options for the chat. * @param taskId The ID of the async task. */ export function aiChatStream(messages, options, taskId) { return { type: 'ai_chat_stream', messages, options: options !== null && options !== void 0 ? options : {}, taskId, }; } /** * Creates a new AIGenerateSkyboxAction. * @param prompt The prompt that describes what the generated skybox should look like. * @param negativePrompt The negative prompt that describes what the generated skybox should not look like. * @param options The options for the skybox. * @param taskId The ID of the async task. */ export function aiGenerateSkybox(prompt, negativePrompt, options, taskId) { return { type: 'ai_generate_skybox', prompt, negativePrompt, options: options !== null && options !== void 0 ? options : {}, taskId, }; } /** * Creates a new AIGenerateImageAction. * @param options The options. * @param taskId The ID of the async task. */ export function aiGenerateImage(parameters, options, taskId) { return { type: 'ai_generate_image', ...parameters, options: options !== null && options !== void 0 ? options : {}, taskId, }; } /** * Creates a new AIHumeGetAccessTokenAction. * @param options The options for the action. * @param taskId The ID of the async task. */ export function aiHumeGetAccessToken(recordName, options, taskId) { return { type: 'ai_hume_get_access_token', recordName, options: options !== null && options !== void 0 ? options : {}, taskId, }; } /** * Creates a new AISloydGenerateModelAction. * @param parameters The parameters for the action. * @param options The options for the action. * @param taskId The ID of the async task. */ export function aiSloydGenerateModel(parameters, options, taskId) { return { type: 'ai_sloyd_generate_model', ...parameters, options, taskId, }; } /** * Creates a new action that is able to request that a realtime session be created. * @param recordName The name of the record that the realtime session is being created for. * @param request The request that should be used to create the realtime session. * @param options The options for the action. * @param taskId The ID of the async task. */ export function aiOpenAICreateRealtimeSession(recordName, request, options, taskId) { return { type: 'records_call_procedure', procedure: { createOpenAIRealtimeSession: { input: { recordName, request, }, }, }, options, taskId, }; } /** * Creates a GetPublicRecordKeyAction. * @param recordName The name of the record. * @param policy The policy that the requested record key should have. * @param taskId The ID of the task. */ export function getPublicRecordKey(recordName, policy, taskId) { return { type: 'get_public_record_key', recordName, policy, taskId, }; } /** * Creates a GrantRecordPermissionAction. * @param recordName The name of the record. * @param permission The permission that should be granted. * @param options The options for the action. * @param taskId The ID of the task. */ export function grantRecordPermission(recordName, permission, options, taskId) { return { type: 'grant_record_permission', recordName, permission, options, taskId, }; } /** * Creates a RevokeRecordPermissionAction. * @param recordName The name of the record. * @param marker The marker. * @param permissionId The ID of the permission that should be revoked. * @param options The options for the action. * @param taskId The ID of the task. */ export function revokeRecordPermission(recordName, permissionId, options, taskId) { return { type: 'revoke_record_permission', recordName, permissionId, options, taskId, }; } /** * Creates a GrantRoleAction for a user. * @param recordName The name of the record. * @param role The role that should be granted. * @param userId The ID of the user. * @param expireTimeMs The Unix time (in miliseconds) that the role grant expires. * @param options The options for the action. * @param taskId The ID of the task. */ export function grantUserRole(recordName, role, userId, expireTimeMs, options, taskId) { return { type: 'grant_role', recordName, role, userId, expireTimeMs, options, taskId, }; } /** * Creates a GrantRoleAction for an inst. * @param recordName The name of the record. * @param role The role that should be granted. * @param inst The ID of the inst. * @param expireTimeMs The Unix time (in miliseconds) that the role grant expires. * @param options The options for the action. * @param taskId The ID of the task. */ export function grantInstRole(recordName, role, inst, expireTimeMs, options, taskId) { return { type: 'grant_role', recordName, role, inst, expireTimeMs, options, taskId, }; } /** * Creates a GrantRoleAction for a user. * @param recordName The name of the record. * @param role The role that should be granted. * @param userId The ID of the user. * @param options The options for the action. * @param taskId The ID of the task. */ export function revokeUserRole(recordName, role, userId, options, taskId) { return { type: 'revoke_role', recordName, role, userId, options, taskId, }; } /** * Creates a revokeRoleAction for an inst. * @param recordName The name of the record. * @param role The role that should be revokeed. * @param inst The ID of the inst. * @param options The options for the action. * @param taskId The ID of the task. */ export function revokeInstRole(recordName, role, inst, options, taskId) { return { type: 'revoke_role', recordName, role, inst, options, taskId, }; } /** * Creates a GrantInstAdminPermissionAction. * @param recordName The name of the record. * @param options The options for the action. * @param taskId The ID of the task. */ export function grantInstAdminPermission(recordName, options, taskId) { return { type: 'grant_inst_admin_permission', recordName, options, taskId, }; } /** * Creates a RecordDataAction. * @param recordKey The key that should be used to access the record. * @param address The address that the data should be stored at in the record. * @param data The data to store. * @param requiresApproval Whether to try to record data that requires approval. * @param options The options that should be used for the action. * @param taskId The ID of the task. */ export function recordData(recordKey, address, data, requiresApproval, options, taskId) { return { type: 'record_data', recordKey, address, data, requiresApproval, options, taskId, }; } /** * Creates a GetRecordDataAction. * @param recordName The name of the record to retrieve. * @param address The address of the data to retrieve. * @param requiresApproval Whether to try to get a record that requires manual approval. * @param options The options that should be used for the action. * @param taskId The ID of the task. */ export function getRecordData(recordName, address, requiresApproval, options, taskId) { return { type: 'get_record_data', recordName, address, requiresApproval, options, taskId, }; } /** * Creates a ListRecordDataAction. * @param recordName The name of the record. * @param startingAddress The address that the list should start with. * @param options The options that should be used for the action. * @param taskId The ID of the task. */ export function listDataRecord(recordName, startingAddress, options, taskId) { return { type: 'list_record_data', recordName, startingAddress, requiresApproval: false, options, taskId, }; } /** * Creates a ListRecordDataAction. * @param recordName The name of the record. * @param marker The marker. * @param startingAddress The address that the list should start with. * @param options The options that should be used for the action. * @param taskId The ID of the task. */ export function listDataRecordByMarker(recordName, marker, startingAddress, options, taskId) { return { type: 'list_record_data_by_marker', recordName, marker, startingAddress, requiresApproval: false, options, taskId, }; } /** * Creates a EraseRecordDataAction. * @param recordKey The key that should be used to access the record. * @param address The address of the data to erase. * @param requiresApproval Whether to try to erase a record that requires manual approval. * @param options The options that should be used for the action. * @param taskId The ID of the task. */ export function eraseRecordData(recordKey, address, requiresApproval, options, taskId) { return { type: 'erase_record_data', recordKey, address, requiresApproval, options, taskId, }; } /** * Creates a RecordsCallProcedureAction. * @param procedure The procedure to call. * @param options The options. * @param taskId The ID of the async task. */ export function recordsCallProcedure(procedure, options, taskId) { return { type: 'records_call_procedure', procedure, options, taskId, }; } /** * Creates a RecordWebhookAction. * @param recordName The name of the record. * @param item The item to record. * @param options The options that should be used for the action. * @param taskId The ID of the task. */ export function recordWebhook(recordName, item, options, taskId) { return recordsCallProcedure({ recordWebhook: { input: { recordName, item: { address: item.address, targetResourceKind: item.targetResourceKind, targetRecordName: item.targetRecordName, targetAddress: item.targetAddress, markers: item.markers, }, }, }, }, options, taskId); } /** * Creates a RunWebhookAction. * @param recordName The name of the record. * @param address The address of the webhook to run. * @param input The input for the webhook. * @param options The options that should be used for the action. * @param taskId The ID of the task. */ export function runWebhook(recordName, address, input, options, taskId) { return recordsCallProcedure({ runWebhook: { query: { recordName, address, }, input: input, }, }, options, taskId); } /** * Creates a GetWebhookAction. * @param recordName The name of the record to retrieve. * @param address The address of the data to retrieve. * @param options The options that should be used for the action. * @param taskId The ID of the task. */ export function getWebhook(recordName, address, options, taskId) { return recordsCallProcedure({ getWebhook: { input: { recordName, address, }, }, }, options, taskId); } /** * Creates a ListWebhooksAction. * @param recordName The name of the record. * @param startingAddress The address that the list should start with. * @param options The options that should be used for the action. * @param taskId The ID of the task. */ export function listWebhooks(recordName, startingAddress, options, taskId) { return recordsCallProcedure({ listWebhooks: { input: { recordName, address: startingAddress, sort: options === null || options === void 0 ? void 0 : options.sort, }, }, }, options, taskId); } /** * Creates a ListWebhooksByMarkerAction. * @param recordName The name of the record. * @param marker The marker. * @param startingAddress The address that the list should start with. * @param options The options that should be used for the action. * @param taskId The ID of the task. */ export function listWebhooksByMarker(recordName, marker, startingAddress, options, taskId) { return recordsCallProcedure({ listWebhooks: { input: { recordName, address: startingAddress, sort: options === null || options === void 0 ? void 0 : options.sort, marker: marker, }, }, }, options, taskId); } /** * Creates a EraseWebhookAction. * @param recordKey The name of the record. * @param address The address of the data to erase. * @param options The options that should be used for the action. * @param taskId The ID of the task. */ export function eraseWebhook(recordName, address, options, taskId) { return recordsCallProcedure({ eraseWebhook: { input: { recordName, address, }, }, }, options, taskId); } /** * Creates a SubscribeToNotificationAction. * @param recordName The name of the record. * @param address The address of the notification to subscribe to. * @param options The options that should be used for the action. * @param taskId The ID of the async task. */ export function subscribeToNotification(recordName, address, options, taskId) { return { type: 'subscribe_to_notification', recordName, address, options, taskId, }; } /** * Creates an action that is able to unsubscribe from a notification. * @param subscriptionId The ID of the subscription. * @param options The options that should be used for the action. * @param taskId The ID of the async task. */ export function unsubscribeFromNotification(subscriptionId, options, taskId) { return recordsCallProcedure({ unsubscribeFromNotification: { input: { subscriptionId, }, }, }, options, taskId); } /** * Creates an action that is able to record a notification. * @param recordName The name of the record. * @param item The item to record. * @param options The options. * @param taskId The ID of the async task. */ export function recordNotification(recordName, item, options, taskId) { return recordsCallProcedure({ recordNotification: { input: { recordName, item: { address: item.address, description: item.description, markers: item.markers, }, }, }, }, options, taskId); } /** * Creates an action that is able to get information about a notification. * @param recordName The name of the record. * @param address The address of the notification. * @param options The options. * @param taskId The ID of the async task. */ export function getNotification(recordName, address, options, taskId) { return recordsCallProcedure({ getNotification: { input: { recordName, address, }, }, }, options, taskId); } /** * Creates an action that is able to list the notifications in a record. * @param recordName The name of the record. * @param startingAddress The address that the list should start with. * @param options The options. * @param taskId The ID of the async task. */ export function listNotifications(recordName, startingAddress, options, taskId) { return recordsCallProcedure({ listNotifications: { input: { recordName, address: startingAddress, }, }, }, options, taskId); } /** * Creates an action that is able to list the notifications in a record. * @param recordName The name of the record. * @param marker The marker. * @param startingAddress The address that the list should start with. * @param options The options. * @param taskId The ID of the async task. */ export function listNotificationsByMarker(recordName, marker, startingAddress, options, taskId) { return recordsCallProcedure({ listNotifications: { input: { recordName, marker, address: startingAddress, sort: options === null || options === void 0 ? void 0 : options.sort, }, }, }, options, taskId); } /** * Creates an action that is able to erase a notification. * @param recordName The name of the record. * @param address The address of the notification. * @param options The options. * @param taskId The ID of the async task. */ export function eraseNotification(recordName, address, options, taskId) { return recordsCallProcedure({ eraseNotification: { input: { recordName, address, }, }, }, options, taskId); } /** * Creates an action that can be used to send a notification. * @param recordName The name of the record. * @param address The address of the notification. * @param payload The payload to send. * @param options The options. * @param taskId The ID of the task. */ export function sendNotification(recordName, address, payload, options, taskId) { return recordsCallProcedure({ sendNotification: { input: { recordName, address, payload, topic: options === null || options === void 0 ? void 0 : options.topic, }, }, }, options, taskId); } /** * Creates an action that can be used to list the notification subscriptions for a record. * @param recordName The name of the record. * @param address The address of the notification. * @param options The options. * @param taskId The ID of the task. */ export function listNotificationSubscriptions(recordName, address, options, taskId) { return recordsCallProcedure({ listNotificationSubscriptions: { input: { recordName, address, }, }, }, options, taskId); } /** * Creates an action that can be used to list the notification subscriptions a user. * @param userId The ID of the user. * @param options The options. * @param taskId The ID of the task. */ export function listUserNotificationSubscriptions(options, taskId) { return recordsCallProcedure({ listUserNotificationSubscriptions: { input: {}, }, }, options, taskId); } /** * Creates a RecordFileAction. * @param recordKey The key that should be used to access the record. * @param data The data to store. * @param description The description of the file. * @param mimeType The MIME type of the file. * @param markers The markers to associate with the file. * @param options The options that should be used for the action. */ export function recordFile(recordKey, data, description, mimeType, options, taskId) { return { type: 'record_file', recordKey, data, description, mimeType, options, taskId, }; } /** * Creates a GetFileAction. * @param recordKey The key that should be used to access the record. * @param fileUrl The URL that the file was stored at. * @param options The options that should be used for the action. * @param taskId The ID of the task. */ export function getFile(fileUrl, options, taskId) { return { type: 'get_file', fileUrl, options, taskId, }; } /** * Creates a EraseFileAction. * @param recordKey The key that should be used to access the record. * @param fileUrl The URL that the file was stored at. * @param options The options that should be used for the action. * @param taskId The ID of the task. */ export function eraseFile(recordKey, fileUrl, options, taskId) { return { type: 'erase_file', recordKey, fileUrl, options, taskId, }; } /** * Creates a RecordEventAction. * @param recordKey The key that should be used to access the record. * @param eventName The name of the event. * @param count The number of times that the event occurred. * @param options The options that should be used for the action. * @param taskId The Id of the task. */ export function recordEvent(recordKey, eventName, count, options, taskId) { return { type: 'record_event', recordKey, eventName, count, options, taskId, }; } /** * Creates a GetEventCountAction. * @param recordName The name of the record. * @param eventName The name of the events. * @param options The options that should be used for the action. * @param taskId The ID. */ export function getEventCount(recordName, eventName, options, taskId) { return { type: 'get_event_count', recordName, eventName, options, taskId, }; } /** * Creates a GrantRecordEntitlementsAction. * @param request The request that should be used to grant the entitlements. * @param options The options that should be used for the action. * @param taskId The ID of the task. */ export function grantEntitlements(request, options, taskId) { return { type: 'grant_record_entitlements', request, options, taskId, }; } /** * Creates a RevokeEntitlementGrantAction. * @param request The request that should be used to revoke the entitlement. * @param options The options that should be used for the action. * @param taskId The ID of the task. */ export function revokeEntitlement(request, options, taskId) { return { type: 'revoke_record_entitlements', request, options, taskId, }; } export function recordPackageVersion(request, options, taskId) { return { type: 'record_package_version', request, options, taskId, }; } export function listPackageVersions(recordName, address, options, taskId) { return recordsCallProcedure({ listPackageVersions: { input: { recordName, address, }, }, }, options, taskId); } export function getPackageVersion(recordName, address, key, options, taskId) { let input = { recordName, address, }; if (typeof key === 'string') { input.key = key; } else if (key) { input = { ...input, ...key, }; } return recordsCallProcedure({ getPackageVersion: { input, }, }, options, taskId); } export function erasePackageVersion(recordName, address, key, options, taskId) { return recordsCallProcedure({ erasePackageVersion: { input: { recordName, address, key, }, }, }, options, taskId); } export function recordPackageContainer(recordName, address, markers, options, taskId) { return recordsCallProcedure({ recordPackage: { input: { recordName, item: { address, markers: markers, }, }, }, }, options, taskId); } export function erasePackageContaienr(recordName, address, options, taskId) { return recordsCallProcedure({ erasePackage: { input: { recordName, address, }, }, }, options, taskId); } export function listPackageContainers(recordName, address, options, taskId) { return recordsCallProcedure({ listPackages: { input: { recordName, address, sort: options === null || options === void 0 ? void 0 : options.sort, }, }, }, options, taskId); } export function listPackageContainersByMarker(recordName, marker, address, options, taskId) { return recordsCallProcedure({ listPackages: { input: { recordName, address, sort: options === null || options === void 0 ? void 0 : options.sort, marker, }, }, }, options, taskId); } export function getPackageContainer(recordName, address, options, taskId) { return recordsCallProcedure({ getPackage: { input: { recordName, address, }, }, }, options, taskId); } export function installPackage(recordName, address, key, options, taskId) { return { type: 'install_package', recordName, address, key, options, taskId, }; } export function listInstalledPackages(options, taskId) { return { type: 'list_installed_packages', options, taskId, }; } /** * Creates a ListUserStudiosAction. * @param options The options that should be used for the action. * @param taskId The ID of the task. */ export function listUserStudios(options, taskId) { return { type: 'list_user_studios', options, taskId, }; } /** * Creates a new JoinRoomAction. * @param roomName The name of the room. * @param options The options to use for the event. * @param taskId The ID of the async task. */ export function joinRoom(roomName, options, taskId) { return { type: 'join_room', roomName, options, taskId, }; } /** * Creates a new LeaveRoomAction. * @param roomName The name of the room. * @param options The options to use for the event. * @param taskId The ID of the async task. */ export function leaveRoom(roomName, options, taskId) { return { type: 'leave_room', roomName, options, taskId, }; } /** * Creates a new SetRoomOptionsAction. * @param roomName The name of the room. * @param options The options to use for the event. * @param taskId The ID of the async task. */ export function setRoomOptions(roomName, options, taskId) { return { type: 'set_room_options', roomName, options, taskId, }; } /** * Creates a new GetRoomOptionsAction. * @param roomName The name of the room. * @param taskId The ID of the async task. */ export function getRoomOptions(roomName, taskId) { return { type: 'get_room_options', roomName, taskId, }; } /** * Creates a new GetRoomTrackOptionsAction. * @param roomName The name of the room. * @param address The address of the track. * @param taskId The ID of the task. */ export function getRoomTrackOptions(roomName, address, taskId) { return { type: 'get_room_track_options', roomName, address, taskId, }; } /** * Creates a new SetRoomTrackOptionsAction. * @param roomName The name of the room. * @param address The address of the track. * @param options The options that should be set. * @param taskId The ID of the task. */ export function setRoomTrackOptions(roomName, address, options, taskId) { return { type: 'set_room_track_options', roomName, address, options, taskId, }; } /** * Creates a new GetRoomRemoteOptionsAction. * @param roomName The name of the room. * @param remoteId The ID of the remote user. * @param taskId The ID of the task. */ export function getRoomRemoteOptions(roomName, remoteId, taskId) { return { type: 'get_room_remote_options', roomName, remoteId, taskId, }; } //# sourceMappingURL=RecordsEvents.js.map