Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Constructors

constructor

  • Parameters

    Returns ConsentStore

Properties

busyConsent

busyConsent: boolean = false

busyReferer

busyReferer: boolean = false

Optional chunkFolder

chunkFolder: string

Optional chunks

chunks: Record<string, string[]>

count

count: number = 0

deleteAll

deleteAll: () => Promise<void> = flow(function* (this: ConsentStore) {this.busyConsent = true;try {yield request<RequestRouteConsentAllDelete, ParamsRouteConsentAllDelete, ResponseRouteConsentAllDelete>({location: locationRestConsentAllDelete});this.applyPage(0);yield this.fetchAll();} catch (e) {console.log(e);throw e;} finally {this.busyConsent = false;}})

Type declaration

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

fetchAll

fetchAll: () => Promise<void> = flow(function* (this: ConsentStore) {this.busyConsent = true;try {const { page, referer, ip, uuid, context } = this.filters;const dates = this.filters.dates.map((m) => (m ? m.format(DATE_FORMAT) : "")) as [string, string];const { count, truncatedIpsCount, items }: ResponseRouteConsentAllGet = yield request<RequestRouteConsentAllGet,ParamsRouteConsentAllGet,ResponseRouteConsentAllGet>({location: locationRestConsentAllGet,params: {// eslint-disable-next-line @typescript-eslint/naming-conventionper_page: this.perPage,offset: (page - 1) * this.perPage,from: dates[0],to: dates[1],ip,uuid,referer,context}});this.count = count;this.truncatedIpsCount = truncatedIpsCount;this.pageCollection.clear();for (const item of items) {this.pageCollection.set(item.id, new Consent(item, this));}} catch (e) {this.count = 0;this.truncatedIpsCount = 0;this.pageCollection.clear();console.log(e);throw e;} finally {this.busyConsent = false;}})

Type declaration

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

fetchReferer

fetchReferer: (params?: ParamsRouteConsentRefererGet) => Promise<void> = flow(function* (this: ConsentStore,params) {this.busyReferer = true;try {const response: ResponseRouteConsentRefererGet = yield request<RequestRouteConsentRefererGet,ParamsRouteConsentRefererGet,ResponseRouteConsentRefererGet>({location: locationRestConsentRefererGet,params});this.referer = response.items;} catch (e) {console.log(e);throw e;} finally {this.busyReferer = false;}})

Type declaration

fetchRevision

fetchRevision: (params?: ParamsRouteRevisionGet) => Promise<void> = flow(function* (this: ConsentStore,params) {try {const response: ResponseRouteRevisionGet = yield request<RequestRouteRevisionGet,ParamsRouteRevisionGet,ResponseRouteRevisionGet>({location: locationRestRevisionGet,params});this.revisions.set(params.hash, new Revision(response, this));} catch (e) {console.log(e);throw e;}})

Type declaration

fetchRevisionIndependent

fetchRevisionIndependent: (params?: ParamsRouteRevisionIndependentGet) => Promise<void> = flow(function* (this: ConsentStore,params) {try {const response: ResponseRouteRevisionIndependentGet = yield request<RequestRouteRevisionIndependentGet,ParamsRouteRevisionIndependentGet,ResponseRouteRevisionIndependentGet>({location: locationRestRevisionIndependentGet,params});this.revisionsIndependent.set(params.hash, new RevisionIndependent(response, this));} catch (e) {console.log(e);throw e;}})

Type declaration

filters

filters: { context: string; dates: [Moment, Moment]; ip: ParamsRouteConsentAllGet["ip"]; page: number; referer: ParamsRouteConsentAllGet["referer"]; uuid: ParamsRouteConsentAllGet["uuid"] } = observable.object({page: 1,dates: [undefined, undefined],context: undefined,referer: undefined,ip: undefined,uuid: undefined},{},{ deep: false })

Type declaration

  • context: string
  • dates: [Moment, Moment]
  • ip: ParamsRouteConsentAllGet["ip"]
  • page: number
  • referer: ParamsRouteConsentAllGet["referer"]
  • uuid: ParamsRouteConsentAllGet["uuid"]

offset

offset: number = 0

pageCollection

pageCollection: Map<number, Consent> = new Map<number, Consent>()

Current visible page in Consent tab

perPage

perPage: number = 50

Optional publicUrl

publicUrl: string

referer

referer: string[] = []

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

revisions

revisions: Map<string, Revision> = new Map<string, Revision>()

revisionsIndependent

revisionsIndependent: Map<string, RevisionIndependent> = new Map<string, RevisionIndependent>()

Readonly rootStore

rootStore: RootStore

slug

slug: string

textDomain

textDomain: string

truncatedIpsCount

truncatedIpsCount: number = 0

version

version: string

Methods

applyContext

  • applyContext(context: ConsentStore["filters"]["context"]): void
  • This action does not actually refetch the stats, you need to act on your components!

    Parameters

    • context: ConsentStore["filters"]["context"]

    Returns void

applyDates

  • applyDates(dates: ConsentStore["filters"]["dates"]): void
  • This action does not actually refetch the stats, you need to act on your components!

    Parameters

    • dates: ConsentStore["filters"]["dates"]

    Returns void

applyIp

  • applyIp(ip: ConsentStore["filters"]["ip"]): void
  • This action does not actually refetch the list, you need to act on your components!

    Parameters

    • ip: ConsentStore["filters"]["ip"]

    Returns void

applyPage

  • applyPage(page: ConsentStore["filters"]["page"]): void
  • This action does not actually refetch the list, you need to act on your components!

    Parameters

    • page: ConsentStore["filters"]["page"]

    Returns void

applyReferer

  • applyReferer(referer: ConsentStore["filters"]["referer"]): void
  • This action does not actually refetch the list, you need to act on your components!

    Parameters

    • referer: ConsentStore["filters"]["referer"]

    Returns void

applyUuid

  • applyUuid(uuid: ConsentStore["filters"]["uuid"]): void
  • This action does not actually refetch the list, you need to act on your components!

    Parameters

    • uuid: ConsentStore["filters"]["uuid"]

    Returns void

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