Skip to main content

Module: context

Functions

getLanguage

getLanguage(messageOptions?): Promise<{ systemLanguageId: string ; languageId: string }>

Factory method which creates a sender so that the type doesn't need to be defined and can be hidden. Also this allows to use a send method without a required second argument if the default options are defined.

Parameters

NameType
messageOptions?MessageDataType<"contextLanguage">

Returns

Promise<{ systemLanguageId: string ; languageId: string }>

Defined in

src/channel.ts:452


subscribeLanguage

subscribeLanguage(method, id?): () => void

Parameters

NameType
method(data: { systemLanguageId: string ; languageId: string }) => void | Promise<unknown>
id?string

Returns

fn

▸ (): void

Returns

void

Defined in

src/channel.ts:493


getEnvironment

getEnvironment(messageOptions?): Promise<"development" | "production" | "testing">

Factory method which creates a sender so that the type doesn't need to be defined and can be hidden. Also this allows to use a send method without a required second argument if the default options are defined.

Parameters

NameType
messageOptions?MessageDataType<"contextEnvironment">

Returns

Promise<"development" | "production" | "testing">

Defined in

src/channel.ts:452


getLocale

getLocale(messageOptions?): Promise<{ locale: string ; fallbackLocale: string }>

Factory method which creates a sender so that the type doesn't need to be defined and can be hidden. Also this allows to use a send method without a required second argument if the default options are defined.

Parameters

NameType
messageOptions?MessageDataType<"contextLocale">

Returns

Promise<{ locale: string ; fallbackLocale: string }>

Defined in

src/channel.ts:452


subscribeLocale

subscribeLocale(method, id?): () => void

Parameters

NameType
method(data: { locale: string ; fallbackLocale: string }) => void | Promise<unknown>
id?string

Returns

fn

▸ (): void

Returns

void

Defined in

src/channel.ts:493


getCurrency

getCurrency(messageOptions?): Promise<{ systemCurrencyISOCode: string ; systemCurrencyId: string }>

Factory method which creates a sender so that the type doesn't need to be defined and can be hidden. Also this allows to use a send method without a required second argument if the default options are defined.

Parameters

NameType
messageOptions?MessageDataType<"contextCurrency">

Returns

Promise<{ systemCurrencyISOCode: string ; systemCurrencyId: string }>

Defined in

src/channel.ts:452


getShopwareVersion

getShopwareVersion(messageOptions?): Promise<string>

Factory method which creates a sender so that the type doesn't need to be defined and can be hidden. Also this allows to use a send method without a required second argument if the default options are defined.

Parameters

NameType
messageOptions?MessageDataType<"contextShopwareVersion">

Returns

Promise<string>

Defined in

src/channel.ts:452


getUserInformation

getUserInformation(messageOptions?): Promise<{ aclRoles: { name: string ; type: string ; id: string ; privileges: string[] }[] ; active: boolean ; admin: boolean ; avatarId: string ; email: string ; firstName: string ; id: string ; lastName: string ; localeId: string ; title: string ; type: string ; username: string }>

Factory method which creates a sender so that the type doesn't need to be defined and can be hidden. Also this allows to use a send method without a required second argument if the default options are defined.

Parameters

NameType
messageOptions?MessageDataType<"contextUserInformation">

Returns

Promise<{ aclRoles: { name: string ; type: string ; id: string ; privileges: string[] }[] ; active: boolean ; admin: boolean ; avatarId: string ; email: string ; firstName: string ; id: string ; lastName: string ; localeId: string ; title: string ; type: string ; username: string }>

Defined in

src/channel.ts:452


getAppInformation

getAppInformation(messageOptions?): Promise<{ name: string ; version: string ; type: "app" | "plugin" }>

Factory method which creates a sender so that the type doesn't need to be defined and can be hidden. Also this allows to use a send method without a required second argument if the default options are defined.

Parameters

NameType
messageOptions?MessageDataType<"contextAppInformation">

Returns

Promise<{ name: string ; version: string ; type: "app" | "plugin" }>

Defined in

src/channel.ts:452


getModuleInformation

getModuleInformation(messageOptions?): Promise<{ modules: { displaySearchBar: boolean ; heading: string ; id: string ; locationId: string }[] }>

Factory method which creates a sender so that the type doesn't need to be defined and can be hidden. Also this allows to use a send method without a required second argument if the default options are defined.

Parameters

NameType
messageOptions?MessageDataType<"contextModuleInformation">

Returns

Promise<{ modules: { displaySearchBar: boolean ; heading: string ; id: string ; locationId: string }[] }>

Defined in

src/channel.ts:452

Type Aliases

contextLanguage

Ƭ contextLanguage: Object

Get the current content language

Type declaration

NameType
responseType{ systemLanguageId: string ; languageId: string }
responseType.systemLanguageIdstring
responseType.languageIdstring

Defined in

src/context/index.ts:17


contextEnvironment

Ƭ contextEnvironment: Object

Get the current environment (development or production)

Type declaration

NameType
responseType"development" | "production" | "testing"

Defined in

src/context/index.ts:27


contextLocale

Ƭ contextLocale: Object

Get the current UI locale

Type declaration

NameType
responseType{ locale: string ; fallbackLocale: string }
responseType.localestring
responseType.fallbackLocalestring

Defined in

src/context/index.ts:34


contextCurrency

Ƭ contextCurrency: Object

Get the system currency

Type declaration

NameType
responseType{ systemCurrencyISOCode: string ; systemCurrencyId: string }
responseType.systemCurrencyISOCodestring
responseType.systemCurrencyIdstring

Defined in

src/context/index.ts:44


contextShopwareVersion

Ƭ contextShopwareVersion: Object

Get the current Shopware version

Type declaration

NameType
responseTypestring

Defined in

src/context/index.ts:54


contextAppInformation

Ƭ contextAppInformation: Object

Get the current app information

Type declaration

NameType
responseType{ name: string ; version: string ; type: "app" | "plugin" }
responseType.namestring
responseType.versionstring
responseType.type"app" | "plugin"

Defined in

src/context/index.ts:61


contextUserInformation

Ƭ contextUserInformation: Object

Get the current user information

Type declaration

NameType
responseType{ aclRoles: { name: string ; type: string ; id: string ; privileges: string[] }[] ; active: boolean ; admin: boolean ; avatarId: string ; email: string ; firstName: string ; id: string ; lastName: string ; localeId: string ; title: string ; type: string ; username: string }
responseType.aclRoles{ name: string ; type: string ; id: string ; privileges: string[] }[]
responseType.activeboolean
responseType.adminboolean
responseType.avatarIdstring
responseType.emailstring
responseType.firstNamestring
responseType.idstring
responseType.lastNamestring
responseType.localeIdstring
responseType.titlestring
responseType.typestring
responseType.usernamestring

Defined in

src/context/index.ts:72


contextModuleInformation

Ƭ contextModuleInformation: Object

Get all registered module information for the extension

Type declaration

NameType
responseType{ modules: { displaySearchBar: boolean ; heading: string ; id: string ; locationId: string }[] }
responseType.modules{ displaySearchBar: boolean ; heading: string ; id: string ; locationId: string }[]

Defined in

src/context/index.ts:97