AWSClientPlugin Provides fetch function that performs a fetch request with AWS v4 signing. This is useful for connecting to AWS services like S3 directly from the client. It also interfaces with the FileTransferPlugin to directly upload file when exported with the viewer or the plugin. Note: Make sure to use keys with limited privileges and correct CORS settings. All the keys will be stored in plain text if serializeSettings is set to true

{@todo Make an example for AWSClient Plugin}

Hierarchy

  • AViewerPluginSync<"fileUpload">
    • AWSClientPlugin

Constructors

Properties

_client: undefined | AwsClient
_connected: boolean = false
_dirty: boolean = false
_savedExportFile?: ((blob, name, _onProgress?) => Promise<void>)

Type declaration

    • (blob, name, _onProgress?): Promise<void>
    • Parameters

      • blob: Blob
      • name: string
      • Optional _onProgress: ((d) => void)
          • (d): void
          • Parameters

            • d: {
                  progress?: number;
                  state?: string;
              }
              • Optional progress?: number
              • Optional state?: string

            Returns void

      Returns Promise<void>

_viewer?: ThreeViewer
_viewerListeners: PartialRecord<"dispose" | "*" | "update" | "preRender" | "postRender" | "preFrame" | "postFrame" | "addPlugin" | "removePlugin" | "renderEnabled" | "renderDisabled", ((e) => void)> = {}

Type declaration

    • (e): void
    • Parameters

      • e: IViewerEvent

      Returns void

accessKeyId: string = ''
accessKeySecret: string = ''
constructor: typeof AViewerPluginSync & typeof AViewerPlugin
dependencies: typeof FileTransferPlugin[] = ...
enabled: boolean = true
endpointURL: string = ''
exportFile: ((blob, name, _onProgress?) => Promise<void>) = ...

Type declaration

    • (blob, name, _onProgress?): Promise<void>
    • Parameters

      • blob: Blob
      • name: string
      • Optional _onProgress: ((d) => void)
          • (d): void
          • Parameters

            • d: {
                  progress?: number;
                  state?: string;
              }
              • Optional progress?: number
              • Optional state?: string

            Returns void

      Returns Promise<void>

fetchFunction: {
    (input, init?): Promise<Response>;
    (input, init?): Promise<Response>;
} = fetch

Type declaration

    • (input, init?): Promise<Response>
    • Parameters

      • input: RequestInfo | URL
      • Optional init: RequestInit

      Returns Promise<Response>

    • (input, init?): Promise<Response>
    • Parameters

      • input: string | Request | URL
      • Optional init: RequestInit

      Returns Promise<Response>

pathPrefix: string = 'webgi'
serializeSettings: boolean = false
serializeWithViewer: false = false
uiConfig?: UiObjectConfig<any, string, any>
OldPluginType?: string
PROXY_URL: string = 'https://r2-s3-api.repalash.com/{path}'
PluginType: "AWSClientPlugin1" = 'AWSClientPlugin1'
USE_PROXY: boolean = false

Set to true to use a proxy for all requests. This can be used to move the access credentials to the server side or set custom headers. This is required for some services like cloudflare R2 that do not support CORS. usage: AWSClientPlugin.USE_PROXY = true, optionally set AWSClientPlugin.PROXY_URL to a custom proxy.

Accessors

Methods

  • Parameters

    • e: IViewerEvent

    Returns IViewerEvent

  • Parameters

    • Optional prefix: string

    Returns string

  • Returns ISerializedConfig | Record<string, never>

  • Parameters

    • input: RequestInfo
    • init: RequestInit
    • Optional _onProgress: ((d) => void)
        • (d): void
        • Parameters

          • d: {
                progress?: number;
                state?: string;
            }
            • Optional progress?: number
            • Optional state?: string

          Returns void

    Returns Promise<Response>

  • Parameters

    • state: any

    Returns Promise<void>

Generated using TypeDoc