[]
        
(Showing Draft Content)

common

The following sections describe the module: common.

Interfaces

commonConfig

Properties

baseUrl

baseUrl: string

The Wyn Enterprise server URL. If your integration and Wyn server are not on the same site, you should provide your Wyn server host.


Example

baseUrl: 'https://your-wyn-server.com/',

token

token: string

The access token. The token is generated from the Admin portal.


Example

token: 'your-wyn-token',

tokenKey

Optional tokenKey: string


Set the key name used in query parameters; this name is configured in the Wyn config file.

If tokenKey is not specified, the default value 'token' is used.


Example

tokenKey: 'tkn',

useTokenInHeader

Optional useTokenInHeader: boolean


Set if the token should be sent in the request header instead of the query parameter.

The default value is false.


Example

useTokenInHeader: true,

Type Aliases

CustomThemeInfo

Ƭ CustomThemeInfo: Object

Type declaration

Name

Type

displayName

string

modified

string

name

string

pluginVersion

string

themeVariables

Record<string, string | boolean>

displayName: string


modified: string


name: string


pluginVersion: string


themeVariables: Record<string, string | boolean>


Variables

DEFAULT_TOKEN_KEY

Const DEFAULT_TOKEN_KEY: "token"


themes

Const themes: string[]

Functions

concatUrls

concatUrls(...urls): string

Parameters

Name

Type

...urls

string[]

Returns

string


fetchPluginsInfo

fetchPluginsInfo(baseUrl, token, tokenKey?, useTokenInHeader?): Promise<Response>

Parameters

Name

Type

Default value

baseUrl

string

undefined

token

string

undefined

tokenKey

string

DEFAULT_TOKEN_KEY

useTokenInHeader

boolean

false

Returns

Promise<Response>


getCustomThemes

getCustomThemes(baseUrl, token, tokenKey?, useTokenInHeader?):Promise<CustomThemeInfo[]>

Parameters

Name

Type

Default value

baseUrl

string

undefined

token

string

undefined

tokenKey

string

DEFAULT_TOKEN_KEY

useTokenInHeader

boolean

false

Returns

Promise<CustomThemeInfo[]>


getVersionAndTheme

getVersionAndTheme(baseUrl, token, key, tokenKey?, useTokenInHeader?): Promise<{ theme: any = value.data.me.themeName; version: any }>

Parameters

Name

Type

Default value

baseUrl

string

undefined

token

string

undefined

key

string

undefined

tokenKey?

string

undefined

useTokenInHeader

boolean

false

Returns

Promise<{ theme: any = value.data.me.themeName; version: any }>


loadCss

loadCss(href): Promise<unknown>

Parameters

Name

Type

href

string

Returns

Promise<unknown>


loadJs

loadJs(src): Promise<unknown>

Parameters

Name

Type

src

string

Returns

Promise<unknown>


useTokenInHeader

Optional useTokenInHeader: boolean


Set if the token should be sent in the request header instead of the query parameter.

The default value is false.


Example

useTokenInHeader: true,