Module: AppBridge

Defined in:
lib/app_bridge.rb,
lib/app_bridge/app.rb,
lib/app_bridge/version.rb,
lib/app_bridge/file_processor.rb,
lib/app_bridge/connection_config_validator.rb,
sig/app_bridge.rbs

Overview

When updating the version, please also update the version in the ext/app_bridge/Cargo.toml file to keep them in sync.

Defined Under Namespace

Classes: ActionContext, ActionResponse, ActionResponseTooLargeError, App, Connection, ConnectionConfigError, ConnectionConfigValidator, Error, FileProcessor, InternalError, StoreTooLargeError, TimeoutError, TooManyEventsError, TriggerContext, TriggerEvent, TriggerResponse

Constant Summary collapse

VERSION =

Returns:

  • (String)
"5.0.0"

Class Attribute Summary collapse

Class Attribute Details

.file_uploaderObject

Configurable file uploader callback. The platform should set this to handle file uploads and return an ID.

Examples:

Configure with ActiveStorage

AppBridge.file_uploader = ->(file_data) {
  content = Base64.decode64(file_data['base64'])
  blob = ActiveStorage::Blob.create_and_upload!(
    io: StringIO.new(content),
    filename: file_data['filename'],
    content_type: file_data['content_type'] || 'application/octet-stream'
  )
  blob.signed_id  # Returns just the ID
}


32
33
34
# File 'lib/app_bridge.rb', line 32

def file_uploader
  @file_uploader
end