Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Constructors

constructor

  • Parameters

    Returns TcfStore

Properties

busyDeclarations

busyDeclarations: boolean = false

busyGvl

busyGvl: boolean = false

busyVendors

busyVendors: boolean = false

Optional chunkFolder

chunkFolder: string

Optional chunks

chunks: Record<string, string[]>

features

features: Map<string, TcfFeature> = new Map<string, TcfFeature>()

fetchDeclarations

fetchDeclarations: () => Promise<void> = flow(function* (this: TcfStore) {this.busyDeclarations = true;try {const {gvlSpecificationVersion,tcfPolicyVersion,purposes,specialPurposes,features,specialFeatures}: ResponseRouteTcfDeclarationsGet = yield request<RequestRouteTcfDeclarationsGet,ParamsRouteTcfDeclarationsGet,ResponseRouteTcfDeclarationsGet>({location: locationRestTcfDeclarationsGet});for (const pid of Object.keys(purposes)) {this.purposes.set(pid, new TcfPurpose(purposes[pid], false, this));}for (const pid of Object.keys(specialPurposes)) {this.specialPurposes.set(pid, new TcfPurpose(specialPurposes[pid], true, this));}for (const pid of Object.keys(features)) {this.features.set(pid, new TcfFeature(features[pid], false, this));}for (const pid of Object.keys(specialFeatures)) {this.specialFeatures.set(pid, new TcfFeature(specialFeatures[pid], true, this));}this.gvlSpecificationVersion = gvlSpecificationVersion;this.tcfPolicyVersion = tcfPolicyVersion;} catch (e) {console.log(e);throw e;} finally {this.busyDeclarations = false;}})

Type declaration

    • (): Promise<void>
    • Returns Promise<void>

fetchVendorConfigurations

fetchVendorConfigurations: () => Promise<void> = flow(function* (this: TcfStore) {// In our UI, we do not have pagination, yet, so load allconst perPage = 100;const pages = Math.ceil(this.vendorConfigurationCount / perPage);for (let i = 0; i < pages; i++) {yield this.vendorConfigurations.get({request: {status: ["draft", "publish", "private"]},params: {offset: i * perPage,// eslint-disable-next-line @typescript-eslint/naming-conventionper_page: 100, // Fetch allcontext: "edit"}});}this.fetchedAllVendorConfigurations = true;})

Type declaration

    • (): Promise<void>
    • Returns Promise<void>

fetchVendors

fetchVendors: () => Promise<void> = flow(function* (this: TcfStore) {this.busyVendors = true;try {const { vendorListVersion, vendors }: ResponseRouteTcfVendorsGet = yield request<RequestRouteTcfVendorsGet,ParamsRouteTcfVendorsGet,ResponseRouteTcfVendorsGet>({location: locationRestTcfVendorsGet});for (const vid of Object.keys(vendors)) {this.vendors.set(vid, new TcfVendor(vendors[vid], this));}this.vendorListVersion = vendorListVersion;} catch (e) {console.log(e);throw e;} finally {this.busyVendors = false;}})

Type declaration

    • (): Promise<void>
    • Returns Promise<void>

fetchedAllVendorConfigurations

fetchedAllVendorConfigurations: boolean = false

gvlSpecificationVersion

gvlSpecificationVersion: ResponseRouteTcfDeclarationsGet["gvlSpecificationVersion"]

Optional publicUrl

publicUrl: string

purposes

purposes: Map<string, TcfPurpose> = new Map<string, TcfPurpose>()

Optional restNamespace

restNamespace: string

Optional restNonce

restNonce: string

Optional restQuery

restQuery: {}

Type declaration

Optional restRecreateNonceEndpoint

restRecreateNonceEndpoint: string

Optional restRoot

restRoot: string

Optional restUrl

restUrl: string

Readonly rootStore

rootStore: RootStore

slug

slug: string

specialFeatures

specialFeatures: Map<string, TcfFeature> = new Map<string, TcfFeature>()

specialPurposes

specialPurposes: Map<string, TcfPurpose> = new Map<string, TcfPurpose>()

tcfPolicyVersion

tcfPolicyVersion: ResponseRouteTcfDeclarationsGet["tcfPolicyVersion"]

textDomain

textDomain: string

updateGvl

updateGvl: () => Promise<void> = flow(function* (this: TcfStore) {this.busyGvl = true;try {const { gvlDownloadTime }: ResponseRouteTcfGvlPut = yield request<RequestRouteTcfGvlPut,ParamsRouteTcfGvlPut,ResponseRouteTcfGvlPut>({location: locationRestTcfGvlPut});this.rootStore.optionStore.tcfGvlDownloadTime = gvlDownloadTime;} catch (e) {console.log(e);throw e;} finally {this.busyGvl = false;}})

Type declaration

    • (): Promise<void>
    • Returns Promise<void>

vendorConfigurations

vendorConfigurations: TcfVendorConfigurationCollection

vendorListVersion

vendorListVersion: ResponseRouteTcfVendorsGet["vendorListVersion"]

vendors

vendors: Map<string, TcfVendor> = new Map<string, TcfVendor>()

version

version: string

Accessors

vendorConfigurationCount

  • get vendorConfigurationCount(): number
  • Returns number

Methods

Static getPureSlug

  • getPureSlug(slug: string, camelCase?: boolean): string
  • Get the slug from the current process (webpack) instead of the PHP plugin output. For some cases you need to use that.

    Parameters

    • slug: string
    • Default value camelCase: boolean = false

    Returns string

Static slugCamelCase

  • slugCamelCase(slug: string): string
  • Convert a slug like "my-plugin" to "myPlugin". This can be useful for library naming (window[""] is bad because the hyphens).

    Parameters

    • slug: string

    Returns string

Generated using TypeDoc