@uppy/companion-client
Advanced tools
Comparing version 1.4.1 to 1.4.2
@@ -218,2 +218,2 @@ 'use strict'; | ||
return RequestClient; | ||
}(), _class.VERSION = "1.4.1", _temp); | ||
}(), _class.VERSION = "1.4.2", _temp); |
{ | ||
"name": "@uppy/companion-client", | ||
"description": "Client library for communication with Companion. Intended for use in Uppy plugins.", | ||
"version": "1.4.1", | ||
"version": "1.4.2", | ||
"license": "MIT", | ||
@@ -26,3 +26,3 @@ "main": "lib/index.js", | ||
}, | ||
"gitHead": "b2f158e45ec14a5198e1981747f39cacd4a3276e" | ||
"gitHead": "2c98271103539fbe46b37b9f8c2746bc7188b9c8" | ||
} |
@@ -0,48 +1,70 @@ | ||
/** | ||
* Async storage interface, similar to `localStorage`. This can be used to | ||
* implement custom storages for authentication tokens. | ||
*/ | ||
export interface TokenStorage { | ||
setItem: (key: string, value: string) => Promise<void> | ||
getItem: (key: string) => Promise<string> | ||
removeItem: (key: string) => Promise<void> | ||
} | ||
export interface RequestClientOptions { | ||
companionUrl: string; | ||
companionHeaders?: object; | ||
companionUrl: string | ||
companionHeaders?: object | ||
/** | ||
* Deprecated, use `companionHeaders` instead. | ||
*/ | ||
serverHeaders?: object; | ||
serverHeaders?: object | ||
} | ||
export class RequestClient { | ||
constructor (uppy: any, opts: RequestClientOptions); | ||
get (path: string): Promise<any>; | ||
post (path: string, data: object): Promise<any>; | ||
delete (path: string, data: object): Promise<any>; | ||
constructor (uppy: any, opts: RequestClientOptions) | ||
get (path: string): Promise<any> | ||
post (path: string, data: object): Promise<any> | ||
delete (path: string, data: object): Promise<any> | ||
} | ||
export interface ProviderOptions extends RequestClientOptions { | ||
provider: string; | ||
authProvider?: string; | ||
name?: string; | ||
/** | ||
* Options for Providers that can be passed in by Uppy users through | ||
* Plugin constructors. | ||
*/ | ||
export interface PublicProviderOptions extends RequestClientOptions { | ||
companionAllowedHosts?: string | RegExp | Array<string | RegExp> | ||
} | ||
/** | ||
* Options for Providers, including internal options that Plugins can set. | ||
*/ | ||
export interface ProviderOptions extends PublicProviderOptions { | ||
provider: string | ||
authProvider?: string | ||
name?: string | ||
pluginId: string | ||
} | ||
export class Provider extends RequestClient { | ||
constructor (uppy: any, opts: ProviderOptions); | ||
checkAuth (): Promise<boolean>; | ||
authUrl (): string; | ||
fileUrl (id: string): string; | ||
list (directory: string): Promise<any>; | ||
logout (redirect?: string): Promise<any>; | ||
static initPlugin(plugin: any, opts: object, defaultOpts?: object): void; | ||
constructor (uppy: any, opts: ProviderOptions) | ||
checkAuth (): Promise<boolean> | ||
authUrl (): string | ||
fileUrl (id: string): string | ||
list (directory: string): Promise<any> | ||
logout (redirect?: string): Promise<any> | ||
static initPlugin (plugin: any, opts: object, defaultOpts?: object): void | ||
} | ||
export interface SocketOptions { | ||
target: string; | ||
autoOpen?: boolean; | ||
target: string | ||
autoOpen?: boolean | ||
} | ||
export class Socket { | ||
isOpen: boolean; | ||
isOpen: boolean | ||
constructor (opts: SocketOptions); | ||
open (): void; | ||
close (): void; | ||
send (action: string, payload: any): void; | ||
on (action: string, handler: (param: any) => void): void; | ||
once (action: string, handler: (param: any) => void): void; | ||
emit (action: string, payload: (param: any) => void): void; | ||
constructor (opts: SocketOptions) | ||
open (): void | ||
close (): void | ||
send (action: string, payload: any): void | ||
on (action: string, handler: (param: any) => void): void | ||
once (action: string, handler: (param: any) => void): void | ||
emit (action: string, payload: (param: any) => void): void | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
39978
25
983