Skip to main content

Class: AWSClientPlugin

Extra-Helpers.AWSClientPlugin

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 in the vjson/glb when saved if serializeSettings is set to true

Hierarchy

Properties

PluginType

Static Readonly PluginType: "AWSClientPlugin1"

Defined in

webgi/src/extras/network/AWSClientPlugin.ts:20


USE_PROXY

Static 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. 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.

Defined in

webgi/src/extras/network/AWSClientPlugin.ts:81


PROXY_URL

Static PROXY_URL: string = 'https://r2-s3-api.repalash.com/{path}'

Defined in

webgi/src/extras/network/AWSClientPlugin.ts:82


uiConfig

Optional uiConfig: UiObjectConfig<any, string>

Defined in

webgi/src/extras/network/AWSClientPlugin.ts:21


enabled

enabled: boolean = true

Overrides

AViewerPlugin.enabled

Defined in

webgi/src/extras/network/AWSClientPlugin.ts:23


dependencies

dependencies: typeof FileTransferPlugin[]

Defined in

webgi/src/extras/network/AWSClientPlugin.ts:28


accessKeyId

accessKeyId: string = ''

Defined in

webgi/src/extras/network/AWSClientPlugin.ts:38


accessKeySecret

accessKeySecret: string = ''

Defined in

webgi/src/extras/network/AWSClientPlugin.ts:44


endpointURL

endpointURL: string = ''

Defined in

webgi/src/extras/network/AWSClientPlugin.ts:50


pathPrefix

pathPrefix: string = 'webgi'

Defined in

webgi/src/extras/network/AWSClientPlugin.ts:56


serializeSettings

serializeSettings: boolean = false

Defined in

webgi/src/extras/network/AWSClientPlugin.ts:62


serializeWithViewer

Readonly serializeWithViewer: false

Defined in

webgi/src/extras/network/AWSClientPlugin.ts:117


fetchFunction

fetchFunction: (input: RequestInfo, init?: RequestInit) => Promise<Response> = fetch

Type declaration

▸ (input, init?): Promise<Response>

Parameters
NameType
inputRequestInfo
init?RequestInit
Returns

Promise<Response>

Defined in

webgi/src/extras/network/AWSClientPlugin.ts:148


_dirty

Protected _dirty: boolean = false

Inherited from

AViewerPlugin._dirty

Defined in

webgi/src/core/AViewerPlugin.ts:23


_viewer

Protected Optional _viewer: ViewerApp

Inherited from

AViewerPlugin._viewer

Defined in

webgi/src/core/AViewerPlugin.ts:27

Accessors

dirty

get dirty(): boolean

Returns

boolean

Inherited from

AViewerPlugin.dirty

Defined in

webgi/src/core/AViewerPlugin.ts:16

set dirty(value): void

Parameters

NameType
valueboolean

Returns

void

Inherited from

AViewerPlugin.dirty

Defined in

webgi/src/core/AViewerPlugin.ts:20


viewer

get viewer(): undefined | TViewer

Returns

undefined | TViewer

Inherited from

AViewerPlugin.viewer

Defined in

webgi/src/core/AViewerPlugin.ts:29


connected

get connected(): boolean

Returns

boolean

Defined in

webgi/src/extras/network/AWSClientPlugin.ts:109


client

get client(): undefined | AwsClient

Returns

undefined | AwsClient

Defined in

webgi/src/extras/network/AWSClientPlugin.ts:112

Methods

onDispose

onDispose(viewer): Promise<void>

Parameters

NameType
viewerViewerApp

Returns

Promise<void>

Inherited from

AViewerPlugin.onDispose

Defined in

webgi/src/core/AViewerPlugin.ts:40


onRemove

onRemove(viewer): Promise<void>

Parameters

NameType
viewerViewerApp

Returns

Promise<void>

Inherited from

AViewerPlugin.onRemove

Defined in

webgi/src/core/AViewerPlugin.ts:44


fromJSON

fromJSON(data, meta?): null | AWSClientPlugin | Promise<null | AWSClientPlugin>

Parameters

NameType
dataany
meta?any

Returns

null | AWSClientPlugin | Promise<null | AWSClientPlugin>

Inherited from

AViewerPlugin.fromJSON

Defined in

webgi/src/core/AViewerPlugin.ts:56


exportState

exportState(): any

Returns

any

Inherited from

AViewerPlugin.exportState

Defined in

webgi/src/core/AViewerPlugin.ts:68


importState

importState(state): Promise<void>

Parameters

NameType
stateany

Returns

Promise<void>

Inherited from

AViewerPlugin.importState

Defined in

webgi/src/core/AViewerPlugin.ts:71


storeState

storeState(prefix?, storage?, data?): void

Parameters

NameType
prefix?string
storage?Storage
data?any

Returns

void

Inherited from

AViewerPlugin.storeState

Defined in

webgi/src/core/AViewerPlugin.ts:78


loadState

loadState(prefix?, storage?): Promise<void>

Parameters

NameType
prefix?string
storage?Storage

Returns

Promise<void>

Inherited from

AViewerPlugin.loadState

Defined in

webgi/src/core/AViewerPlugin.ts:88


toggleConnection

toggleConnection(): void

Returns

void

Defined in

webgi/src/extras/network/AWSClientPlugin.ts:67


connect

connect(): void

Returns

void

Defined in

webgi/src/extras/network/AWSClientPlugin.ts:84


refreshUi

refreshUi(): void

Returns

void

Defined in

webgi/src/extras/network/AWSClientPlugin.ts:97


disconnect

disconnect(): void

Returns

void

Defined in

webgi/src/extras/network/AWSClientPlugin.ts:101


toJSON

toJSON(meta?): any

Parameters

NameType
meta?any

Returns

any

Overrides

AViewerPlugin.toJSON

Defined in

webgi/src/extras/network/AWSClientPlugin.ts:119


onAdded

onAdded(viewer): Promise<void>

Parameters

NameType
viewerViewerApp

Returns

Promise<void>

Overrides

AViewerPlugin.onAdded

Defined in

webgi/src/extras/network/AWSClientPlugin.ts:124


fetch

fetch(input, init, onProgress?): Promise<Response>

Parameters

NameType
inputRequestInfo
initRequestInit
onProgress?(d: { state?: string ; progress?: number }) => void

Returns

Promise<Response>

Defined in

webgi/src/extras/network/AWSClientPlugin.ts:149


_storeKey

Protected _storeKey(prefix?): string

Parameters

NameType
prefix?string

Returns

string

Inherited from

AViewerPlugin._storeKey

Defined in

webgi/src/core/AViewerPlugin.ts:64

Constructors

constructor

new AWSClientPlugin()

Overrides

AViewerPlugin.constructor

Defined in

webgi/src/extras/network/AWSClientPlugin.ts:30