{"version":3,"file":"pocketbase.es.mjs","sources":["../src/ClientResponseError.ts","../src/stores/utils/jwt.ts","../src/stores/utils/cookie.ts","../src/models/utils/BaseModel.ts","../src/models/Record.ts","../src/models/Admin.ts","../src/stores/BaseAuthStore.ts","../src/stores/LocalAuthStore.ts","../src/models/utils/ListResult.ts","../src/services/utils/BaseService.ts","../src/services/utils/CrudService.ts","../src/services/utils/BaseCrudService.ts","../src/models/utils/SchemaField.ts","../src/models/View.ts","../src/services/ViewService.ts","../src/services/SettingsService.ts","../src/services/AdminService.ts","../src/models/ExternalAuth.ts","../src/services/RecordService.ts","../src/models/Collection.ts","../src/services/CollectionService.ts","../src/models/LogRequest.ts","../src/services/LogService.ts","../src/services/RealtimeService.ts","../src/services/HealthService.ts","../src/Client.ts","../src/models/ViewRecord.ts"],"sourcesContent":["/**\n * ClientResponseError is a custom Error class that is intended to wrap\n * and normalize any error thrown by `Client.send()`.\n */\nexport default class ClientResponseError extends Error {\n    url: string                = '';\n    status: number             = 0;\n    data: {[key: string]: any} = {};\n    isAbort:  boolean          = false;\n    originalError: any         = null;\n\n    constructor(errData?: any) {\n        super(\"ClientResponseError\");\n\n        // Set the prototype explicitly.\n        // https://github.com/Microsoft/TypeScript-wiki/blob/main/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work\n        Object.setPrototypeOf(this, ClientResponseError.prototype);\n\n        if (!(errData instanceof ClientResponseError)) {\n            this.originalError = errData;\n        }\n\n        if (errData !== null && typeof errData === 'object') {\n            this.url    = typeof errData.url === 'string' ? errData.url : '';\n            this.status = typeof errData.status === 'number' ? errData.status : 0;\n            this.data   = errData.data !== null && typeof errData.data === 'object' ? errData.data : {};\n        }\n\n        if (typeof DOMException !== 'undefined' && errData instanceof DOMException) {\n            this.isAbort = true;\n        }\n\n        this.name = \"ClientResponseError \" + this.status;\n        this.message = this.data?.message;\n        if (!this.message) {\n            if (this.isAbort) {\n                this.message = 'The request was autocancelled. More info you could find in https://github.com/pocketbase/js-sdk#auto-cancellation.';\n            } else if (this.originalError?.cause?.message?.includes(\"ECONNREFUSED ::1\")) {\n                this.message = 'Failed to connect to the PocketBase server. Try replacing the SDK url from localhost to 127.0.0.1 (https://github.com/pocketbase/js-sdk/issues/21).';\n            } else {\n                this.message = 'Something went wrong while processing your request.';\n            }\n        }\n    }\n\n    // Make a POJO's copy of the current error class instance.\n    // @see https://github.com/vuex-orm/vuex-orm/issues/255\n    toJSON () {\n        return { ...this };\n    }\n}\n","let atobPolyfill: Function;\nif (typeof atob === 'function') {\n    atobPolyfill = atob\n} else {\n    /**\n     * The code was extracted from:\n     * https://github.com/davidchambers/Base64.js\n     */\n    atobPolyfill = (input: any) => {\n        const chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\n\n        let str = String(input).replace(/=+$/, \"\");\n        if (str.length % 4 == 1) {\n            throw new Error(\"'atob' failed: The string to be decoded is not correctly encoded.\");\n        }\n\n        for (\n            // initialize result and counters\n            var bc = 0, bs, buffer, idx = 0, output = \"\";\n            // get next character\n            (buffer = str.charAt(idx++));\n            // character found in table? initialize bit storage and add its ascii value;\n            ~buffer &&\n            ((bs = bc % 4 ? (bs as any) * 64 + buffer : buffer),\n                // and if not first of each 4 characters,\n                // convert the first 8 bits to one ascii character\n                bc++ % 4) ?\n            (output += String.fromCharCode(255 & (bs >> ((-2 * bc) & 6)))) :\n            0\n        ) {\n            // try to find character in table (0-63, not found => -1)\n            buffer = chars.indexOf(buffer);\n        }\n\n        return output;\n    };\n}\n\n/**\n * Returns JWT token's payload data.\n */\nexport function getTokenPayload(token: string): { [key: string]: any } {\n    if (token) {\n        try {\n            const encodedPayload = decodeURIComponent(atobPolyfill(token.split('.')[1]).split('').map(function (c: string) {\n                return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);\n            }).join(''));\n\n            return JSON.parse(encodedPayload) || {};\n        } catch (e) {\n        }\n    }\n\n    return {};\n}\n\n/**\n * Checks whether a JWT token is expired or not.\n * Tokens without `exp` payload key are considered valid.\n * Tokens with empty payload (eg. invalid token strings) are considered expired.\n *\n * @param token The token to check.\n * @param [expirationThreshold] Time in seconds that will be subtracted from the token `exp` property.\n */\nexport function isTokenExpired(token: string, expirationThreshold = 0): boolean {\n    let payload = getTokenPayload(token);\n\n    if (\n        Object.keys(payload).length > 0 &&\n        (!payload.exp || (payload.exp - expirationThreshold) > (Date.now() / 1000))\n    ) {\n        return false;\n    }\n\n    return true;\n}\n","/**\n * -------------------------------------------------------------------\n * Simple cookie parse and serialize utilities mostly based on the\n * node module https://github.com/jshttp/cookie.\n * -------------------------------------------------------------------\n */\n\n/**\n * RegExp to match field-content in RFC 7230 sec 3.2\n *\n * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]\n * field-vchar   = VCHAR / obs-text\n * obs-text      = %x80-FF\n */\nconst fieldContentRegExp = /^[\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+$/;\n\nexport interface ParseOptions{\n    decode?: (val: string) => string,\n}\n\n/**\n* Parses the given cookie header string into an object\n* The object has the various cookies as keys(names) => values\n*/\nexport function cookieParse(str: string, options?: ParseOptions): { [key: string]: any }  {\n    const result: { [key: string]: any } = {};\n\n    if (typeof str !== 'string') {\n        return result;\n    }\n\n    const opt    = Object.assign({}, options || {});\n    const decode = opt.decode || defaultDecode;\n\n    let index = 0;\n    while (index < str.length) {\n        const eqIdx = str.indexOf('=', index);\n\n        // no more cookie pairs\n        if (eqIdx === -1) {\n            break;\n        }\n\n        let endIdx = str.indexOf(';', index);\n\n        if (endIdx === -1) {\n            endIdx = str.length;\n        } else if (endIdx < eqIdx) {\n            // backtrack on prior semicolon\n            index = str.lastIndexOf(';', eqIdx - 1) + 1;\n            continue;\n        }\n\n        const key = str.slice(index, eqIdx).trim();\n\n        // only assign once\n        if (undefined === result[key]) {\n            let val = str.slice(eqIdx + 1, endIdx).trim();\n\n            // quoted values\n            if (val.charCodeAt(0) === 0x22) {\n                val = val.slice(1, -1);\n            }\n\n            try {\n                result[key] = decode(val);\n            } catch (_) {\n                result[key] = val; // no decoding\n            }\n        }\n\n        index = endIdx + 1;\n    }\n\n    return result;\n};\n\nexport interface SerializeOptions{\n    encode?:   (val: string | number | boolean) => string,\n    maxAge?:   number,\n    domain?:   string,\n    path?:     string,\n    expires?:  Date,\n    httpOnly?: boolean,\n    secure?:   boolean,\n    priority?: string,\n    sameSite?: boolean|string,\n}\n\n/**\n * Serialize data into a cookie header.\n *\n * Serialize the a name value pair into a cookie string suitable for\n * http headers. An optional options object specified cookie parameters.\n *\n * ```js\n * cookieSerialize('foo', 'bar', { httpOnly: true }) // \"foo=bar; httpOnly\"\n * ```\n */\nexport function cookieSerialize(name: string, val: string, options?: SerializeOptions): string {\n    const opt    = Object.assign({}, options || {});\n    const encode = opt.encode || defaultEncode;\n\n    if (!fieldContentRegExp.test(name)) {\n        throw new TypeError('argument name is invalid');\n    }\n\n    const value = encode(val);\n\n    if (value && !fieldContentRegExp.test(value)) {\n        throw new TypeError('argument val is invalid');\n    }\n\n    let result = name + '=' + value;\n\n    if (opt.maxAge != null) {\n        const maxAge = opt.maxAge - 0;\n\n        if (isNaN(maxAge) || !isFinite(maxAge)) {\n            throw new TypeError('option maxAge is invalid');\n        }\n\n        result += '; Max-Age=' + Math.floor(maxAge);\n    }\n\n    if (opt.domain) {\n        if (!fieldContentRegExp.test(opt.domain)) {\n            throw new TypeError('option domain is invalid');\n        }\n\n        result += '; Domain=' + opt.domain;\n    }\n\n    if (opt.path) {\n        if (!fieldContentRegExp.test(opt.path)) {\n            throw new TypeError('option path is invalid');\n        }\n\n        result += '; Path=' + opt.path;\n    }\n\n    if (opt.expires) {\n        if (!isDate(opt.expires) || isNaN(opt.expires.valueOf())) {\n            throw new TypeError('option expires is invalid');\n        }\n\n        result += '; Expires=' + opt.expires.toUTCString();\n    }\n\n    if (opt.httpOnly) {\n        result += '; HttpOnly';\n    }\n\n    if (opt.secure) {\n        result += '; Secure';\n    }\n\n    if (opt.priority) {\n        const priority = typeof opt.priority === 'string' ? opt.priority.toLowerCase() : opt.priority;\n\n        switch (priority) {\n            case 'low':\n                result += '; Priority=Low';\n                break;\n            case 'medium':\n                result += '; Priority=Medium';\n                break;\n            case 'high':\n                result += '; Priority=High';\n                break;\n            default:\n                throw new TypeError('option priority is invalid');\n        }\n    }\n\n    if (opt.sameSite) {\n        const sameSite = typeof opt.sameSite === 'string' ? opt.sameSite.toLowerCase() : opt.sameSite;\n\n        switch (sameSite) {\n            case true:\n                result += '; SameSite=Strict';\n                break;\n            case 'lax':\n                result += '; SameSite=Lax';\n                break;\n            case 'strict':\n                result += '; SameSite=Strict';\n                break;\n            case 'none':\n                result += '; SameSite=None';\n                break;\n            default:\n                throw new TypeError('option sameSite is invalid');\n        }\n    }\n\n    return result;\n};\n\n/**\n * Default URL-decode string value function.\n * Optimized to skip native call when no `%`.\n */\nfunction defaultDecode(val: string): string {\n    return val.indexOf('%') !== -1\n        ? decodeURIComponent(val)\n        : val;\n}\n\n/**\n * Default URL-encode value function.\n */\nfunction defaultEncode(val: string | number | boolean): string {\n    return encodeURIComponent(val);\n}\n\n/**\n * Determines if value is a Date.\n */\nfunction isDate(val: any): boolean {\n    return (\n        Object.prototype.toString.call(val) === '[object Date]' ||\n        val instanceof Date\n    );\n}\n","export default abstract class BaseModel {\n    [key: string]: any,\n\n    id!:      string;\n    created!: string;\n    updated!: string;\n\n    constructor(data: { [key: string]: any } = {}) {\n        this.load(data || {});\n    }\n\n    /**\n     * Loads `data` into the current model.\n     */\n    load(data: { [key: string]: any }) {\n        for (const [key, value] of Object.entries(data)) {\n            this[key] = value;\n        }\n\n        // normalize known fields\n        this.id      = typeof data.id      !== 'undefined' ? data.id      : '';\n        this.created = typeof data.created !== 'undefined' ? data.created : '';\n        this.updated = typeof data.updated !== 'undefined' ? data.updated : '';\n    }\n\n    /**\n     * Returns whether the current loaded data represent a stored db record.\n     */\n    get isNew(): boolean {\n        return !this.id;\n    }\n\n    /**\n     * Creates a deep clone of the current model.\n     */\n    clone(): BaseModel {\n        const clone = typeof structuredClone === 'function' ?\n            structuredClone(this) : JSON.parse(JSON.stringify(this));\n\n        return new (this.constructor as any)(clone);\n    }\n\n    /**\n     * Exports all model properties as a new plain object.\n     */\n    export(): { [key: string]: any } {\n        return Object.assign({}, this);\n    }\n}\n","import BaseModel from '@/models/utils/BaseModel';\n\nexport default class Record extends BaseModel {\n    collectionId!:   string;\n    collectionName!: string;\n    expand!:         {[key: string]: Record|Array<Record>};\n\n    /**\n     * @inheritdoc\n     */\n    load(data: { [key: string]: any }) {\n        super.load(data);\n\n        // normalize common fields\n        this.collectionId   = typeof data.collectionId   === 'string' ? data.collectionId   : '';\n        this.collectionName = typeof data.collectionName === 'string' ? data.collectionName : '';\n\n        // normalize expand items\n        this.loadExpand(data.expand);\n    }\n\n    /**\n     * Loads the provided expand items and recursively normalizes each\n     * item to a `Record|Array<Record>`.\n     */\n    private loadExpand(expand: { [key: string]: any }) {\n        expand = expand || {};\n        this.expand = {};\n\n        for (const key in expand) {\n            if (Array.isArray(expand[key])) {\n                this.expand[key] = expand[key].map((data: any) => new Record(data || {}));\n            } else {\n                this.expand[key] = new Record(expand[key] || {});\n            }\n        }\n    }\n}\n","import BaseModel from '@/models/utils/BaseModel';\n\nexport default class Admin extends BaseModel {\n    avatar!: number;\n    email!:  string;\n\n    /**\n     * @inheritdoc\n     */\n    load(data: { [key: string]: any }) {\n        super.load(data);\n\n        this.avatar = typeof data.avatar === 'number' ? data.avatar : 0;\n        this.email  = typeof data.email  === 'string' ? data.email  : '';\n    }\n}\n","import { cookieParse, cookieSerialize, SerializeOptions } from '@/stores/utils/cookie';\nimport { isTokenExpired, getTokenPayload } from '@/stores/utils/jwt';\nimport Record  from '@/models/Record';\nimport Admin from '@/models/Admin';\n\nexport type OnStoreChangeFunc = (token: string, model: Record|Admin|null) => void;\n\nconst defaultCookieKey = 'pb_auth';\n\n/**\n * Base AuthStore class that is intended to be extended by all other\n * PocketBase AuthStore implementations.\n */\nexport default abstract class BaseAuthStore {\n    protected baseToken: string = '';\n    protected baseModel: Record|Admin|null = null;\n\n    private _onChangeCallbacks: Array<OnStoreChangeFunc> = [];\n\n    /**\n     * Retrieves the stored token (if any).\n     */\n    get token(): string {\n        return this.baseToken;\n    }\n\n    /**\n     * Retrieves the stored model data (if any).\n     */\n    get model(): Record|Admin|null {\n        return this.baseModel;\n    }\n\n    /**\n     * Loosely checks if the store has valid token (aka. existing and unexpired exp claim).\n     */\n    get isValid(): boolean {\n        return !isTokenExpired(this.token);\n    }\n\n    /**\n     * Saves the provided new token and model data in the auth store.\n     */\n    save(token: string, model: Record|Admin|null): void {\n        this.baseToken = token || '';\n\n        // normalize the model instance\n        if (model !== null && typeof model === 'object') {\n            this.baseModel = typeof (model as any).collectionId !== 'undefined' ?\n                new Record(model) : new Admin(model);\n        } else {\n            this.baseModel = null;\n        }\n\n        this.triggerChange();\n    }\n\n    /**\n     * Removes the stored token and model data form the auth store.\n     */\n    clear(): void {\n        this.baseToken = '';\n        this.baseModel = null;\n        this.triggerChange();\n    }\n\n    /**\n     * Parses the provided cookie string and updates the store state\n     * with the cookie's token and model data.\n     *\n     * NB! This function doesn't validate the token or its data.\n     * Usually this isn't a concern if you are interacting only with the\n     * PocketBase API because it has the proper server-side security checks in place,\n     * but if you are using the store `isValid` state for permission controls\n     * in a node server (eg. SSR), then it is recommended to call `authRefresh()`\n     * after loading the cookie to ensure an up-to-date token and model state.\n     * For example:\n     *\n     * ```js\n     * pb.authStore.loadFromCookie(\"cookie string...\");\n     *\n     * try {\n     *     // get an up-to-date auth store state by veryfing and refreshing the loaded auth model (if any)\n     *     pb.authStore.isValid && await pb.collection('users').authRefresh();\n     * } catch (_) {\n     *     // clear the auth store on failed refresh\n     *     pb.authStore.clear();\n     * }\n     * ```\n     */\n    loadFromCookie(cookie: string, key = defaultCookieKey): void {\n        const rawData = cookieParse(cookie || '')[key] || '';\n\n        let data: { [key: string]: any } = {};\n        try {\n            data = JSON.parse(rawData);\n            // normalize\n            if (typeof data === null || typeof data !== 'object' || Array.isArray(data)) {\n                data = {};\n            }\n        } catch (_) {}\n\n        this.save(data.token || '', data.model || null);\n    }\n\n    /**\n     * Exports the current store state as cookie string.\n     *\n     * By default the following optional attributes are added:\n     * - Secure\n     * - HttpOnly\n     * - SameSite=Strict\n     * - Path=/\n     * - Expires={the token expiration date}\n     *\n     * NB! If the generated cookie exceeds 4096 bytes, this method will\n     * strip the model data to the bare minimum to try to fit within the\n     * recommended size in https://www.rfc-editor.org/rfc/rfc6265#section-6.1.\n     */\n    exportToCookie(options?: SerializeOptions, key = defaultCookieKey): string {\n        const defaultOptions: SerializeOptions = {\n            secure:   true,\n            sameSite: true,\n            httpOnly: true,\n            path:     \"/\",\n        };\n\n        // extract the token expiration date\n        const payload = getTokenPayload(this.token);\n        if (payload?.exp) {\n            defaultOptions.expires = new Date(payload.exp * 1000);\n        } else {\n            defaultOptions.expires = new Date('1970-01-01');\n        }\n\n        // merge with the user defined options\n        options = Object.assign({}, defaultOptions, options);\n\n        const rawData = {\n            token: this.token,\n            model: this.model?.export() || null,\n        };\n\n        let result = cookieSerialize(key, JSON.stringify(rawData), options);\n\n        const resultLength = typeof Blob !== 'undefined' ?\n            (new Blob([result])).size : result.length;\n\n        // strip down the model data to the bare minimum\n        if (rawData.model && resultLength > 4096) {\n            rawData.model = {id: rawData?.model?.id, email: rawData?.model?.email};\n            if (this.model instanceof Record) {\n                rawData.model.username     = this.model.username;\n                rawData.model.verified     = this.model.verified;\n                rawData.model.collectionId = this.model.collectionId;\n            }\n            result = cookieSerialize(key, JSON.stringify(rawData), options);\n        }\n\n        return result;\n    }\n\n    /**\n     * Register a callback function that will be called on store change.\n     *\n     * You can set the `fireImmediately` argument to true in order to invoke\n     * the provided callback right after registration.\n     *\n     * Returns a removal function that you could call to \"unsubscribe\" from the changes.\n     */\n    onChange(callback: OnStoreChangeFunc, fireImmediately = false): () => void {\n        this._onChangeCallbacks.push(callback);\n\n        if (fireImmediately) {\n            callback(this.token, this.model);\n        }\n\n        return () => {\n            for (let i = this._onChangeCallbacks.length - 1; i >= 0; i--) {\n                if (this._onChangeCallbacks[i] == callback) {\n                    delete this._onChangeCallbacks[i];    // removes the function reference\n                    this._onChangeCallbacks.splice(i, 1); // reindex the array\n                    return;\n                }\n            }\n        }\n    }\n\n    protected triggerChange(): void {\n        for (const callback of this._onChangeCallbacks) {\n            callback && callback(this.token, this.model);\n        }\n    }\n}\n","import BaseAuthStore from '@/stores/BaseAuthStore';\nimport Record        from '@/models/Record';\nimport Admin         from '@/models/Admin';\n\n/**\n * The default token store for browsers with auto fallback\n * to runtime/memory if local storage is undefined (eg. in node env).\n */\nexport default class LocalAuthStore extends BaseAuthStore {\n    private storageFallback: { [key: string]: any } = {};\n    private storageKey: string\n\n    constructor(storageKey = \"pocketbase_auth\") {\n        super();\n\n        this.storageKey = storageKey;\n    }\n\n    /**\n     * @inheritdoc\n     */\n    get token(): string {\n        const data = this._storageGet(this.storageKey) || {};\n\n        return data.token || '';\n    }\n\n    /**\n     * @inheritdoc\n     */\n    get model(): Record|Admin|null {\n        const data = this._storageGet(this.storageKey) || {};\n\n        if (\n            data === null ||\n            typeof data !== 'object' ||\n            data.model === null ||\n            typeof data.model !== 'object'\n        ) {\n            return null;\n        }\n\n        // admins don't have `collectionId` prop\n        if (typeof data.model?.collectionId === 'undefined') {\n            return new Admin(data.model);\n        }\n\n        return new Record(data.model);\n    }\n\n    /**\n     * @inheritdoc\n     */\n    save(token: string, model: Record|Admin|null) {\n        this._storageSet(this.storageKey, {\n            'token': token,\n            'model': model,\n        });\n\n        super.save(token, model);\n    }\n\n    /**\n     * @inheritdoc\n     */\n    clear() {\n        this._storageRemove(this.storageKey);\n\n        super.clear();\n    }\n\n    // ---------------------------------------------------------------\n    // Internal helpers:\n    // ---------------------------------------------------------------\n\n    /**\n     * Retrieves `key` from the browser's local storage\n     * (or runtime/memory if local storage is undefined).\n     */\n    private _storageGet(key: string): any {\n        if (typeof window !== 'undefined' && window?.localStorage) {\n            const rawValue = window.localStorage.getItem(key) || '';\n            try {\n                return JSON.parse(rawValue);\n            } catch (e) { // not a json\n                return rawValue;\n            }\n        }\n\n        // fallback\n        return this.storageFallback[key];\n    }\n\n    /**\n     * Stores a new data in the browser's local storage\n     * (or runtime/memory if local storage is undefined).\n     */\n    private _storageSet(key: string, value: any) {\n        if (typeof window !== 'undefined' && window?.localStorage) {\n            // store in local storage\n            let normalizedVal = value;\n            if (typeof value !== 'string') {\n                normalizedVal = JSON.stringify(value);\n            }\n            window.localStorage.setItem(key, normalizedVal);\n        } else {\n            // store in fallback\n            this.storageFallback[key] = value;\n        }\n    }\n\n    /**\n     * Removes `key` from the browser's local storage and the runtime/memory.\n     */\n    private _storageRemove(key: string) {\n        // delete from local storage\n        if (typeof window !== 'undefined' && window?.localStorage) {\n            window.localStorage?.removeItem(key);\n        }\n\n        // delete from fallback\n        delete this.storageFallback[key];\n    }\n}\n","import BaseModel from './BaseModel';\n\nexport default class ListResult<M = BaseModel> {\n    page!:       number;\n    perPage!:    number;\n    totalItems!: number;\n    totalPages!: number;\n    items!:      Array<M>;\n\n    constructor(\n        page: number,\n        perPage: number,\n        totalItems: number,\n        totalPages: number,\n        items: Array<M>,\n    ) {\n        this.page       = page > 0 ? page : 1;\n        this.perPage    = perPage >= 0 ? perPage : 0;\n        this.totalItems = totalItems >= 0 ? totalItems : 0;\n        this.totalPages = totalPages >= 0 ? totalPages : 0;\n        this.items      = items || [];\n    }\n}\n","import Client from '@/Client';\n\n/**\n * BaseService class that should be inherited from all API services.\n */\nexport default abstract class BaseService {\n    readonly client: Client\n\n    constructor(client: Client) {\n        this.client = client;\n    }\n}\n","import ListResult      from '@/models/utils/ListResult';\nimport BaseModel       from '@/models/utils/BaseModel';\nimport BaseCrudService from '@/services/utils/BaseCrudService';\nimport {\n    BaseQueryParams,\n    ListQueryParams\n} from '@/services/utils/QueryParams';\n\nexport default abstract class CrudService<M extends BaseModel> extends BaseCrudService<M> {\n    /**\n     * Base path for the crud actions (without trailing slash, eg. '/admins').\n     */\n    abstract get baseCrudPath(): string\n\n    /**\n     * Returns a promise with all list items batch fetched at once.\n     *\n     * You can use the generic T to supply a wrapper type of the crud model.\n     */\n    getFullList<T = M>(batch = 200, queryParams: ListQueryParams = {}): Promise<Array<T>> {\n        return this._getFullList<T>(this.baseCrudPath, batch, queryParams);\n    }\n\n    /**\n     * Returns paginated items list.\n     *\n     * You can use the generic T to supply a wrapper type of the crud model.\n     */\n    getList<T = M>(page = 1, perPage = 30, queryParams: ListQueryParams = {}): Promise<ListResult<T>> {\n        return this._getList<T>(this.baseCrudPath, page, perPage, queryParams);\n    }\n\n    /**\n     * Returns the first found item by the specified filter.\n     *\n     * Internally it calls `getList(1, 1, { filter })` and returns the\n     * first found item.\n     *\n     * You can use the generic T to supply a wrapper type of the crud model.\n     *\n     * For consistency with `getOne`, this method will throw a 404\n     * ClientResponseError if no item was found.\n     */\n    getFirstListItem<T = M>(filter: string, queryParams: BaseQueryParams = {}): Promise<T> {\n        return this._getFirstListItem<T>(this.baseCrudPath, filter, queryParams);\n    }\n\n    /**\n     * Returns single item by its id.\n     *\n     * You can use the generic T to supply a wrapper type of the crud model.\n     */\n    getOne<T = M>(id: string, queryParams: BaseQueryParams = {}): Promise<T> {\n        return this._getOne<T>(this.baseCrudPath, id, queryParams);\n    }\n\n    /**\n     * Creates a new item.\n     *\n     * You can use the generic T to supply a wrapper type of the crud model.\n     */\n    create<T = M>(bodyParams = {}, queryParams: BaseQueryParams = {}): Promise<T> {\n        return this._create<T>(this.baseCrudPath, bodyParams, queryParams);\n    }\n\n    /**\n     * Updates an existing item by its id.\n     *\n     * You can use the generic T to supply a wrapper type of the crud model.\n     */\n    update<T = M>(id: string, bodyParams = {}, queryParams: BaseQueryParams = {}): Promise<T> {\n        return this._update<T>(this.baseCrudPath, id, bodyParams, queryParams);\n    }\n\n    /**\n     * Deletes an existing item by its id.\n     */\n    delete(id: string, queryParams: BaseQueryParams = {}): Promise<boolean> {\n        return this._delete(this.baseCrudPath, id, queryParams);\n    }\n}\n","import BaseModel           from '@/models/utils/BaseModel';\nimport ListResult          from '@/models/utils/ListResult';\nimport BaseService         from '@/services/utils/BaseService';\nimport ClientResponseError from '@/ClientResponseError';\nimport {\n    BaseQueryParams,\n    ListQueryParams\n} from '@/services/utils/QueryParams';\n\n// @todo since there is no longer need of SubCrudService consider merging with CrudService in v0.9+\nexport default abstract class BaseCrudService<M extends BaseModel> extends BaseService {\n    /**\n     * Response data decoder.\n     */\n    abstract decode(data: { [key: string]: any }): M\n\n    /**\n     * Returns a promise with all list items batch fetched at once.\n     */\n    protected _getFullList<T = M>(basePath: string, batchSize = 100, queryParams: ListQueryParams = {}): Promise<Array<T>> {\n        var result: Array<T> = [];\n\n        let request = async (page: number): Promise<Array<any>> => {\n            return this._getList(basePath, page, batchSize, queryParams).then((list) => {\n                const castedList = (list as any as ListResult<T>);\n                const items = castedList.items;\n                const totalItems = castedList.totalItems;\n\n                result = result.concat(items);\n\n                if (items.length && totalItems > result.length) {\n                    return request(page + 1);\n                }\n\n                return result;\n            });\n        }\n\n        return request(1);\n    }\n\n    /**\n     * Returns paginated items list.\n     */\n    protected _getList<T = M>(basePath: string, page = 1, perPage = 30, queryParams: ListQueryParams = {}): Promise<ListResult<T>> {\n        queryParams = Object.assign({\n            'page': page,\n            'perPage': perPage,\n        }, queryParams);\n\n        return this.client.send(basePath, {\n            'method': 'GET',\n            'params': queryParams,\n        }).then((responseData: any) => {\n            const items: Array<T> = [];\n            if (responseData?.items) {\n                responseData.items = responseData.items || [];\n                for (const item of responseData.items) {\n                    items.push(this.decode(item) as any as T);\n                }\n            }\n\n            return new ListResult<T>(\n                responseData?.page || 1,\n                responseData?.perPage || 0,\n                responseData?.totalItems || 0,\n                responseData?.totalPages || 0,\n                items,\n            );\n        });\n    }\n\n    /**\n     * Returns single item by its id.\n     */\n    protected _getOne<T = M>(basePath: string, id: string, queryParams: BaseQueryParams = {}): Promise<T> {\n        return this.client.send(basePath + '/' + encodeURIComponent(id), {\n            'method': 'GET',\n            'params': queryParams\n        }).then((responseData: any) => this.decode(responseData) as any as T);\n    }\n\n    /**\n     * Returns the first found item by a list filter.\n     *\n     * Internally it calls `_getList(basePath, 1, 1, { filter })` and returns its\n     * first item.\n     *\n     * For consistency with `_getOne`, this method will throw a 404\n     * ClientResponseError if no item was found.\n     */\n    protected _getFirstListItem<T = M>(basePath: string, filter: string, queryParams: BaseQueryParams = {}): Promise<T> {\n        queryParams = Object.assign({\n            'filter': filter,\n            '$cancelKey': 'one_by_filter_' + basePath + \"_\" + filter,\n        }, queryParams);\n\n        return this._getList<T>(basePath, 1, 1, queryParams)\n            .then((result) => {\n                if (!result?.items?.length) {\n                    throw new ClientResponseError({\n                        status: 404,\n                        data: {\n                            code: 404,\n                            message: \"The requested resource wasn't found.\",\n                            data: {},\n                        },\n                    });\n                }\n\n                return result.items[0];\n            });\n    }\n\n    /**\n     * Creates a new item.\n     */\n    protected _create<T = M>(basePath: string, bodyParams = {}, queryParams: BaseQueryParams = {}): Promise<T> {\n        return this.client.send(basePath, {\n            'method': 'POST',\n            'params': queryParams,\n            'body': bodyParams,\n        }).then((responseData: any) => this.decode(responseData) as any as T);\n    }\n\n    /**\n     * Updates an existing item by its id.\n     */\n    protected _update<T = M>(basePath: string, id: string, bodyParams = {}, queryParams: BaseQueryParams = {}): Promise<T> {\n        return this.client.send(basePath + '/' + encodeURIComponent(id), {\n            'method': 'PATCH',\n            'params': queryParams,\n            'body': bodyParams,\n        }).then((responseData: any) => this.decode(responseData) as any as T);\n    }\n\n    /**\n     * Deletes an existing item by its id.\n     */\n    protected _delete(basePath: string, id: string, queryParams: BaseQueryParams = {}): Promise<boolean> {\n        return this.client.send(basePath + '/' + encodeURIComponent(id), {\n            'method': 'DELETE',\n            'params': queryParams,\n        }).then(() => true);\n    }\n}\n","export default class SchemaField {\n    id!:       string;\n    name!:     string;\n    type!:     string;\n    system!:   boolean;\n    required!: boolean;\n    unique!:   boolean;\n    options!:  { [key: string]: any };\n\n    constructor(data: { [key: string]: any } = {}) {\n        this.load(data || {});\n    }\n\n    /**\n     * Loads `data` into the field.\n     */\n    load(data: { [key: string]: any }) {\n        this.id       = typeof data.id !== 'undefined' ? data.id : '';\n        this.name     = typeof data.name !== 'undefined' ? data.name : '';\n        this.type     = typeof data.type !== 'undefined' ? data.type : 'text';\n        this.system   = !!data.system;\n        this.required = !!data.required;\n        this.unique   = !!data.unique;\n        this.options  = typeof data.options === 'object' && data.options !== null ? data.options : {};\n    }\n}\n","import BaseModel   from '@/models/utils/BaseModel';\nimport SchemaField from '@/models/utils/SchemaField';\n\nexport default class View extends BaseModel {\n    name!:       string;\n    schema!:     Array<SchemaField>;\n    listRule!:   null|string;\n    sql!: string\n\n    /**\n     * @inheritdoc\n     */\n    load(data: { [key: string]: any }) {\n        super.load(data);\n\n        this.name  = typeof data.name === 'string' ? data.name : '';\n\n        // rules\n        this.listRule = typeof data.listRule   === 'string' ? data.listRule   : null;\n\n        // sql \n        this.sql = typeof data.sql === 'string' ? data.sql : '';\n\n        // schema\n        data.schema = Array.isArray(data.schema) ? data.schema : [];\n        this.schema = [];\n        for (let field of data.schema) {\n            this.schema.push(new SchemaField(field));\n        }\n    }\n}\n","\nimport CrudService from '@/services/utils/CrudService';\nimport View  from '@/models/View';\nimport { ViewRecord } from '..';\n\nexport default class Views extends CrudService<View> {\n    /**\n     * @inheritdoc\n     */\n    decode(data: { [key: string]: any }): View {\n        return new View(data);\n    }\n\n    /**\n     * @inheritdoc */\n\n    get baseCrudPath(): string {\n        return '/api/views';\n    }\n\n    getRecordsFullList(viewName: string, batchSize = 100, queryParams = {}): Promise<Array<ViewRecord>> {\n        const basePath= `${this.baseCrudPath}/${viewName}/records`\n        var result: Array<ViewRecord> = [];\n\n        let request = async (page: number): Promise<Array<any>> => {\n            return this.getRecordsList(basePath, page, batchSize, queryParams).then((list) => {\n                console.log(list);\n                \n                const castedList = (list as ViewRecordListResult);\n                const items = castedList.items;\n                const totalItems = castedList.totalItems;\n\n                result = result.concat(items);\n\n                if (items.length && totalItems > result.length) {\n                    return request(page + 1);\n                }\n\n                return result;\n            });\n        }\n\n        return request(1);\n    }\n\n    /**\n     * Returns paginated items list.\n     */\n    getRecordsList(viewName: string, page = 1, perPage = 30, queryParams = {}): Promise<ViewRecordListResult> {\n        const basePath= `${this.baseCrudPath}/${viewName}/records`\n        queryParams = Object.assign({\n            'page':    page,\n            'perPage': perPage,\n        }, queryParams);\n\n        return this.client.send(basePath, {\n            'method': 'GET',\n            'params': queryParams,\n        }).then((responseData: any) => {\n            const items: Array<ViewRecord> = [];\n            if (responseData?.items) {\n                responseData.items = responseData.items || [];\n                for (const item of responseData.items) {\n                    items.push(new ViewRecord(item));\n                }\n            }\n\n            return new ViewRecordListResult(\n                responseData?.page || 1,\n                responseData?.perPage || 0,\n                responseData?.totalItems || 0,\n                responseData?.totalPages || 0,\n                items,\n            );\n        });\n    }\n}\n\n class ViewRecordListResult{\n    page!: number;\n    perPage!: number;\n    totalItems!: number;\n    totalPages!: number;\n    items!: Array<ViewRecord>;\n\n    constructor(\n        page: number,\n        perPage: number,\n        totalItems: number,\n        totalPages: number,\n        items: Array<ViewRecord>,\n    ) {\n        this.page = page > 0 ? page : 1;\n        this.perPage = perPage >= 0 ? perPage : 0;\n        this.totalItems = totalItems >= 0 ? totalItems : 0;\n        this.totalPages = totalPages >= 0 ? totalPages : 0;\n        this.items = items || [];\n    }\n}\n","import BaseService         from '@/services/utils/BaseService';\nimport { BaseQueryParams } from '@/services/utils/QueryParams';\n\nexport default class SettingsService extends BaseService {\n    /**\n     * Fetch all available app settings.\n     */\n    getAll(queryParams: BaseQueryParams = {}): Promise<{ [key: string]: any }> {\n        return this.client.send('/api/settings', {\n            'method': 'GET',\n            'params': queryParams,\n        }).then((responseData) => responseData || {});\n    }\n\n    /**\n     * Bulk updates app settings.\n     */\n    update(bodyParams = {}, queryParams: BaseQueryParams = {}): Promise<{ [key: string]: any }> {\n        return this.client.send('/api/settings', {\n            'method': 'PATCH',\n            'params': queryParams,\n            'body':   bodyParams,\n        }).then((responseData) => responseData || {});\n    }\n\n    /**\n     * Performs a S3 storage connection test.\n     */\n    testS3(queryParams: BaseQueryParams = {}): Promise<boolean> {\n        return this.client.send('/api/settings/test/s3', {\n            'method': 'POST',\n            'params': queryParams,\n        }).then(() => true);\n    }\n\n    /**\n     * Sends a test email.\n     *\n     * The possible `emailTemplate` values are:\n     * - verification\n     * - password-reset\n     * - email-change\n     */\n    testEmail(toEmail: string, emailTemplate: string, queryParams: BaseQueryParams = {}): Promise<boolean> {\n        const bodyParams = {\n            'email':    toEmail,\n            'template': emailTemplate,\n        };\n\n        return this.client.send('/api/settings/test/email', {\n            'method': 'POST',\n            'params': queryParams,\n            'body':   bodyParams,\n        }).then(() => true);\n    }\n}\n","import Admin               from '@/models/Admin';\nimport CrudService         from '@/services/utils/CrudService';\nimport { BaseQueryParams } from '@/services/utils/QueryParams';\n\nexport interface AdminAuthResponse {\n    [key: string]: any;\n\n    token: string;\n    admin: Admin;\n}\n\nexport default class AdminService extends CrudService<Admin> {\n    /**\n     * @inheritdoc\n     */\n    decode(data: { [key: string]: any }): Admin {\n        return new Admin(data);\n    }\n\n    /**\n     * @inheritdoc\n     */\n    get baseCrudPath(): string {\n        return '/api/admins';\n    }\n\n    // ---------------------------------------------------------------\n    // Post update/delete AuthStore sync\n    // ---------------------------------------------------------------\n\n    /**\n     * @inheritdoc\n     *\n     * If the current `client.authStore.model` matches with the updated id, then\n     * on success the `client.authStore.model` will be updated with the result.\n     */\n    update<T = Admin>(id: string, bodyParams = {}, queryParams: BaseQueryParams = {}): Promise<T> {\n        return super.update<Admin>(id, bodyParams, queryParams).then((item) => {\n            // update the store state if the updated item id matches with the stored model\n            if (\n                this.client.authStore.model &&\n                typeof this.client.authStore.model?.collectionId === 'undefined' && // is not record auth\n                this.client.authStore.model?.id === item?.id\n            ) {\n                this.client.authStore.save(this.client.authStore.token, item);\n            }\n\n            return item as any as T;\n        });\n    }\n\n    /**\n     * @inheritdoc\n     *\n     * If the current `client.authStore.model` matches with the deleted id,\n     * then on success the `client.authStore` will be cleared.\n     */\n    delete(id: string, queryParams: BaseQueryParams = {}): Promise<boolean> {\n        return super.delete(id, queryParams).then((success) => {\n            // clear the store state if the deleted item id matches with the stored model\n            if (\n                success &&\n                this.client.authStore.model &&\n                typeof this.client.authStore.model?.collectionId === 'undefined' && // is not record auth\n                this.client.authStore.model?.id === id\n            ) {\n                this.client.authStore.clear();\n            }\n            return success;\n        });\n    }\n\n    // ---------------------------------------------------------------\n    // Auth handlers\n    // ---------------------------------------------------------------\n\n    /**\n     * Prepare successful authorize response.\n     */\n    protected authResponse(responseData: any): AdminAuthResponse {\n        const admin = this.decode(responseData?.admin || {});\n\n        if (responseData?.token && responseData?.admin) {\n            this.client.authStore.save(responseData.token, admin);\n        }\n\n        return Object.assign({}, responseData, {\n            // normalize common fields\n            'token': responseData?.token || '',\n            'admin': admin,\n        });\n    }\n\n    /**\n     * Authenticate an admin account with its email and password\n     * and returns a new admin token and data.\n     *\n     * On success this method automatically updates the client's AuthStore data.\n     */\n    authWithPassword(\n        email: string,\n        password: string,\n        bodyParams = {},\n        queryParams: BaseQueryParams = {},\n    ): Promise<AdminAuthResponse> {\n        bodyParams = Object.assign({\n            'identity': email,\n            'password': password,\n        }, bodyParams);\n\n        return this.client.send(this.baseCrudPath + '/auth-with-password', {\n            'method':  'POST',\n            'params':  queryParams,\n            'body':    bodyParams,\n        }).then(this.authResponse.bind(this));\n    }\n\n    /**\n     * Refreshes the current admin authenticated instance and\n     * returns a new token and admin data.\n     *\n     * On success this method automatically updates the client's AuthStore data.\n     */\n    authRefresh(bodyParams = {}, queryParams: BaseQueryParams = {}): Promise<AdminAuthResponse> {\n        return this.client.send(this.baseCrudPath + '/auth-refresh', {\n            'method': 'POST',\n            'params': queryParams,\n            'body':   bodyParams,\n        }).then(this.authResponse.bind(this));\n    }\n\n    /**\n     * Sends admin password reset request.\n     */\n    requestPasswordReset(\n        email: string,\n        bodyParams = {},\n        queryParams: BaseQueryParams = {},\n    ): Promise<boolean> {\n        bodyParams = Object.assign({\n            'email': email,\n        }, bodyParams);\n\n        return this.client.send(this.baseCrudPath + '/request-password-reset', {\n            'method': 'POST',\n            'params': queryParams,\n            'body':   bodyParams,\n        }).then(() => true);\n    }\n\n    /**\n     * Confirms admin password reset request.\n     */\n    confirmPasswordReset(\n        passwordResetToken: string,\n        password: string,\n        passwordConfirm: string,\n        bodyParams = {},\n        queryParams: BaseQueryParams = {},\n    ): Promise<boolean> {\n        bodyParams = Object.assign({\n            'token':           passwordResetToken,\n            'password':        password,\n            'passwordConfirm': passwordConfirm,\n        }, bodyParams);\n\n        return this.client.send(this.baseCrudPath + '/confirm-password-reset', {\n            'method': 'POST',\n            'params': queryParams,\n            'body':   bodyParams,\n        }).then(() => true);\n    }\n}\n","import BaseModel from '@/models/utils/BaseModel';\n\nexport default class ExternalAuth extends BaseModel {\n    recordId!:     string;\n    collectionId!: string;\n    provider!:     string;\n    providerId!:   string;\n\n    /**\n     * @inheritdoc\n     */\n    load(data: { [key: string]: any }) {\n        super.load(data);\n\n        this.recordId     = typeof data.recordId     === 'string' ? data.recordId     : '';\n        this.collectionId = typeof data.collectionId === 'string' ? data.collectionId : '';\n        this.provider     = typeof data.provider     === 'string' ? data.provider     : '';\n        this.providerId   = typeof data.providerId   === 'string' ? data.providerId   : '';\n    }\n}\n","import Client              from '@/Client';\nimport Record              from '@/models/Record';\nimport ExternalAuth        from '@/models/ExternalAuth';\nimport ListResult          from '@/models/utils/ListResult';\nimport CrudService         from '@/services/utils/CrudService';\nimport { UnsubscribeFunc } from '@/services/RealtimeService';\nimport {\n    BaseQueryParams,\n    RecordQueryParams,\n    RecordListQueryParams,\n} from '@/services/utils/QueryParams';\n\nexport interface RecordAuthResponse<T = Record> {\n    record: T;\n    token:  string;\n    meta?:  {[key: string]: any};\n}\n\nexport interface AuthProviderInfo {\n    name:                string;\n    state:               string;\n    codeVerifier:        string;\n    codeChallenge:       string;\n    codeChallengeMethod: string;\n    authUrl:             string;\n}\n\nexport interface AuthMethodsList {\n    usernamePassword: boolean;\n    emailPassword:    boolean;\n    authProviders:    Array<AuthProviderInfo>;\n}\n\nexport interface RecordSubscription<T = Record> {\n    action: string;\n    record: T;\n}\n\nexport default class RecordService extends CrudService<Record> {\n    readonly collectionIdOrName: string;\n\n    constructor(client: Client, collectionIdOrName: string) {\n        super(client);\n\n        this.collectionIdOrName = collectionIdOrName;\n    }\n\n    /**\n     * @inheritdoc\n     */\n    decode<T = Record>(data: { [key: string]: any }): T {\n        return new Record(data) as any as T;\n    }\n\n    /**\n     * @inheritdoc\n     */\n    get baseCrudPath(): string {\n        return this.baseCollectionPath + '/records';\n    }\n\n    /**\n     * Returns the current collection service base path.\n     */\n    get baseCollectionPath(): string {\n        return '/api/collections/' + encodeURIComponent(this.collectionIdOrName);\n    }\n\n    // ---------------------------------------------------------------\n    // Realtime handlers\n    // ---------------------------------------------------------------\n\n    /**\n     * @deprecated Use subscribe(recordId, callback) instead.\n     *\n     * Subscribe to the realtime changes of a single record in the collection.\n     */\n    async subscribeOne<T = Record>(recordId: string, callback: (data: RecordSubscription<T>) => void): Promise<UnsubscribeFunc> {\n        console.warn(\"PocketBase: subscribeOne(recordId, callback) is deprecated. Please replace it with subscribe(recordId, callback).\");\n        return this.client.realtime.subscribe(this.collectionIdOrName + \"/\" + recordId, callback);\n    }\n\n    /**\n     * @deprecated This form of subscribe is deprecated. Please use `subscribe(\"*\", callback)`.\n     */\n    async subscribe<T = Record>(callback: (data: RecordSubscription<T>) => void): Promise<UnsubscribeFunc>\n\n    /**\n     * Subscribe to realtime changes to the specified topic (\"*\" or record id).\n     *\n     * If `topic` is the wildcard \"*\", then this method will subscribe to\n     * any record changes in the collection.\n     *\n     * If `topic` is a record id, then this method will subscribe only\n     * to changes of the specified record id.\n     *\n     * It's OK to subscribe multiple times to the same topic.\n     * You can use the returned `UnsubscribeFunc` to remove only a single subscription.\n     * Or use `unsubscribe(topic)` if you want to remove all subscriptions attached to the topic.\n     */\n    async subscribe<T = Record>(topic: string, callback: (data: RecordSubscription<T>) => void): Promise<UnsubscribeFunc>\n\n    async subscribe<T = Record>(\n        topicOrCallback: string|((data: RecordSubscription<T>) => void),\n        callback?: (data: RecordSubscription<T>) => void\n    ): Promise<UnsubscribeFunc> {\n        if (typeof topicOrCallback === 'function') {\n            console.warn(\"PocketBase: subscribe(callback) is deprecated. Please replace it with subscribe('*', callback).\");\n            return this.client.realtime.subscribe(this.collectionIdOrName, topicOrCallback);\n        }\n\n        if (!callback) {\n            throw new Error(\"Missing subscription callback.\");\n        }\n\n        if (topicOrCallback === \"\") {\n            throw new Error(\"Missing topic.\");\n        }\n\n        let topic = this.collectionIdOrName;\n        if (topicOrCallback !== \"*\") {\n            topic += ('/' + topicOrCallback);\n        }\n\n        return this.client.realtime.subscribe(topic, callback)\n    }\n\n    /**\n     * Unsubscribe from all subscriptions of the specified topic\n     * (\"*\" or record id).\n     *\n     * If `topic` is not set, then this method will unsubscribe from\n     * all subscriptions associated to the current collection.\n     */\n    async unsubscribe(topic?: string): Promise<void> {\n        // unsubscribe wildcard topic\n        if (topic === \"*\") {\n            return this.client.realtime.unsubscribe(this.collectionIdOrName);\n        }\n\n        // unsubscribe recordId topic\n        if (topic) {\n            return this.client.realtime.unsubscribe(this.collectionIdOrName + \"/\" + topic);\n        }\n\n        // unsubscribe from everything related to the collection\n        return this.client.realtime.unsubscribeByPrefix(this.collectionIdOrName);\n    }\n\n    // ---------------------------------------------------------------\n    // Crud handers\n    // ---------------------------------------------------------------\n    /**\n     * @inheritdoc\n     */\n    getFullList<T = Record>(batch = 200, queryParams: RecordListQueryParams = {}): Promise<Array<T>> {\n        return super.getFullList<T>(batch, queryParams);\n    }\n\n    /**\n     * @inheritdoc\n     */\n    getList<T = Record>(page = 1, perPage = 30, queryParams: RecordListQueryParams = {}): Promise<ListResult<T>> {\n        return super.getList<T>(page, perPage, queryParams);\n    }\n\n    /**\n     * @inheritdoc\n     */\n    getFirstListItem<T = Record>(filter: string, queryParams: RecordListQueryParams = {}): Promise<T> {\n        return super.getFirstListItem<T>(filter, queryParams);\n    }\n\n    /**\n     * @inheritdoc\n     */\n    getOne<T = Record>(id: string, queryParams: RecordQueryParams = {}): Promise<T> {\n        return super.getOne<T>(id, queryParams);\n    }\n\n    /**\n     * @inheritdoc\n     */\n    create<T = Record>(bodyParams = {}, queryParams: RecordQueryParams = {}): Promise<T> {\n        return super.create<T>(bodyParams, queryParams);\n    }\n\n    /**\n     * @inheritdoc\n     *\n     * If the current `client.authStore.model` matches with the updated id, then\n     * on success the `client.authStore.model` will be updated with the result.\n     */\n    update<T = Record>(id: string, bodyParams = {}, queryParams: RecordQueryParams = {}): Promise<T> {\n        return super.update<Record>(id, bodyParams, queryParams).then((item) => {\n            if (\n                typeof this.client.authStore.model?.collectionId !== 'undefined' && // is record auth\n                this.client.authStore.model?.id === item?.id\n            ) {\n                this.client.authStore.save(this.client.authStore.token, item);\n            }\n\n            return item as any as T;\n        });\n    }\n\n    /**\n     * @inheritdoc\n     *\n     * If the current `client.authStore.model` matches with the deleted id,\n     * then on success the `client.authStore` will be cleared.\n     */\n    delete(id: string, queryParams: BaseQueryParams = {}): Promise<boolean> {\n        return super.delete(id, queryParams).then((success) => {\n            if (\n                success &&\n                typeof this.client.authStore.model?.collectionId !== 'undefined' && // is record auth\n                this.client.authStore.model?.id === id\n            ) {\n                this.client.authStore.clear();\n            }\n\n            return success;\n        });\n    }\n\n    // ---------------------------------------------------------------\n    // Auth handlers\n    // ---------------------------------------------------------------\n\n    /**\n     * Prepare successful collection authorization response.\n     */\n    protected authResponse<T = Record>(responseData: any): RecordAuthResponse<T> {\n        const record = this.decode(responseData?.record || {});\n\n        this.client.authStore.save(responseData?.token, record);\n\n        return Object.assign({}, responseData, {\n            // normalize common fields\n            'token':  responseData?.token || '',\n            'record': record as any as T,\n        });\n    }\n\n    /**\n     * Returns all available collection auth methods.\n     */\n    listAuthMethods(queryParams: BaseQueryParams = {}): Promise<AuthMethodsList> {\n        return this.client.send(this.baseCollectionPath + '/auth-methods', {\n            'method': 'GET',\n            'params': queryParams,\n        }).then((responseData: any) => {\n            return Object.assign({}, responseData, {\n                // normalize common fields\n                'usernamePassword': !!responseData?.usernamePassword,\n                'emailPassword':    !!responseData?.emailPassword,\n                'authProviders':    Array.isArray(responseData?.authProviders) ? responseData?.authProviders : [],\n            });\n        });\n    }\n\n    /**\n     * Authenticate a single auth collection record via its username/email and password.\n     *\n     * On success, this method also automatically updates\n     * the client's AuthStore data and returns:\n     * - the authentication token\n     * - the authenticated record model\n     */\n    authWithPassword<T = Record>(\n        usernameOrEmail: string,\n        password: string,\n        bodyParams = {},\n        queryParams: RecordQueryParams = {},\n    ): Promise<RecordAuthResponse<T>> {\n        bodyParams = Object.assign({\n            'identity': usernameOrEmail,\n            'password': password,\n        }, bodyParams);\n\n        return this.client.send(this.baseCollectionPath + '/auth-with-password', {\n            'method':  'POST',\n            'params':  queryParams,\n            'body':    bodyParams,\n        }).then((data) => this.authResponse<T>(data));\n    }\n\n    /**\n     * Authenticate a single auth collection record with OAuth2.\n     *\n     * On success, this method also automatically updates\n     * the client's AuthStore data and returns:\n     * - the authentication token\n     * - the authenticated record model\n     * - the OAuth2 account data (eg. name, email, avatar, etc.)\n     */\n    authWithOAuth2<T = Record>(\n        provider: string,\n        code: string,\n        codeVerifier: string,\n        redirectUrl: string,\n        createData = {},\n        bodyParams = {},\n        queryParams: RecordQueryParams = {},\n    ): Promise<RecordAuthResponse<T>> {\n        bodyParams = Object.assign({\n            'provider':     provider,\n            'code':         code,\n            'codeVerifier': codeVerifier,\n            'redirectUrl':  redirectUrl,\n            'createData':  createData,\n        }, bodyParams);\n\n        return this.client.send(this.baseCollectionPath + '/auth-with-oauth2', {\n            'method':  'POST',\n            'params':  queryParams,\n            'body':    bodyParams,\n        }).then((data) => this.authResponse<T>(data));\n    }\n\n    /**\n     * Refreshes the current authenticated record instance and\n     * returns a new token and record data.\n     *\n     * On success this method also automatically updates the client's AuthStore.\n     */\n    authRefresh<T = Record>(bodyParams = {}, queryParams: RecordQueryParams = {}): Promise<RecordAuthResponse<T>> {\n        return this.client.send(this.baseCollectionPath + '/auth-refresh', {\n            'method': 'POST',\n            'params': queryParams,\n            'body':   bodyParams,\n        }).then((data) => this.authResponse<T>(data));\n    }\n\n    /**\n     * Sends auth record password reset request.\n     */\n    requestPasswordReset(\n        email: string,\n        bodyParams  = {},\n        queryParams: BaseQueryParams = {},\n    ): Promise<boolean> {\n        bodyParams = Object.assign({\n            'email': email,\n        }, bodyParams);\n\n        return this.client.send(this.baseCollectionPath + '/request-password-reset', {\n            'method': 'POST',\n            'params': queryParams,\n            'body':   bodyParams,\n        }).then(() => true);\n    }\n\n    /**\n     * Confirms auth record password reset request.\n     */\n    confirmPasswordReset(\n        passwordResetToken: string,\n        password: string,\n        passwordConfirm: string,\n        bodyParams = {},\n        queryParams: BaseQueryParams = {},\n    ): Promise<boolean> {\n        bodyParams = Object.assign({\n            'token':           passwordResetToken,\n            'password':        password,\n            'passwordConfirm': passwordConfirm,\n        }, bodyParams);\n\n        return this.client.send(this.baseCollectionPath + '/confirm-password-reset', {\n            'method': 'POST',\n            'params': queryParams,\n            'body':   bodyParams,\n        }).then(() => true);\n    }\n\n    /**\n     * Sends auth record verification email request.\n     */\n    requestVerification(\n        email: string,\n        bodyParams = {},\n        queryParams: BaseQueryParams = {},\n    ): Promise<boolean> {\n        bodyParams = Object.assign({\n            'email': email,\n        }, bodyParams);\n\n        return this.client.send(this.baseCollectionPath + '/request-verification', {\n            'method': 'POST',\n            'params': queryParams,\n            'body':   bodyParams,\n        }).then(() => true);\n    }\n\n    /**\n     * Confirms auth record email verification request.\n     */\n    confirmVerification(\n        verificationToken: string,\n        bodyParams  = {},\n        queryParams: BaseQueryParams = {},\n    ): Promise<boolean> {\n        bodyParams = Object.assign({\n            'token': verificationToken,\n        }, bodyParams);\n\n        return this.client.send(this.baseCollectionPath + '/confirm-verification', {\n            'method': 'POST',\n            'params': queryParams,\n            'body':   bodyParams,\n        }).then(() => true);\n    }\n\n    /**\n     * Sends an email change request to the authenticated record model.\n     */\n    requestEmailChange(\n        newEmail: string,\n        bodyParams = {},\n        queryParams: BaseQueryParams = {},\n    ): Promise<boolean> {\n        bodyParams = Object.assign({\n            'newEmail': newEmail,\n        }, bodyParams);\n\n        return this.client.send(this.baseCollectionPath + '/request-email-change', {\n            'method': 'POST',\n            'params': queryParams,\n            'body':   bodyParams,\n        }).then(() => true);\n    }\n\n    /**\n     * Confirms auth record's new email address.\n     */\n    confirmEmailChange(\n        emailChangeToken: string,\n        password: string,\n        bodyParams  = {},\n        queryParams: BaseQueryParams = {},\n    ): Promise<boolean> {\n        bodyParams = Object.assign({\n            'token': emailChangeToken,\n            'password': password,\n        }, bodyParams);\n\n        return this.client.send(this.baseCollectionPath + '/confirm-email-change', {\n            'method': 'POST',\n            'params': queryParams,\n            'body':   bodyParams,\n        }).then(() => true);\n    }\n\n    /**\n     * Lists all linked external auth providers for the specified auth record.\n     */\n    listExternalAuths(\n        recordId: string,\n        queryParams: BaseQueryParams = {}\n    ): Promise<Array<ExternalAuth>> {\n        return this.client.send(this.baseCrudPath + '/' + encodeURIComponent(recordId) + '/external-auths', {\n            'method': 'GET',\n            'params': queryParams,\n        }).then((responseData) => {\n            const items: Array<ExternalAuth> = [];\n\n            if (Array.isArray(responseData)) {\n                for (const item of responseData) {\n                    items.push(new ExternalAuth(item));\n                }\n            }\n\n            return items;\n        });\n    }\n\n    /**\n     * Unlink a single external auth provider from the specified auth record.\n     */\n    unlinkExternalAuth(\n        recordId: string,\n        provider: string,\n        queryParams: BaseQueryParams = {}\n    ): Promise<boolean> {\n        return this.client.send(this.baseCrudPath + '/' + encodeURIComponent(recordId) + '/external-auths/' + encodeURIComponent(provider), {\n            'method': 'DELETE',\n            'params': queryParams,\n        }).then(() => true);\n    }\n}\n","import BaseModel   from '@/models/utils/BaseModel';\nimport SchemaField from '@/models/utils/SchemaField';\n\nexport default class Collection extends BaseModel {\n    name!:       string;\n    type!:       string;\n    schema!:     Array<SchemaField>;\n    system!:     boolean;\n    listRule!:   null|string;\n    viewRule!:   null|string;\n    createRule!: null|string;\n    updateRule!: null|string;\n    deleteRule!: null|string;\n    options!:    {[key:string]: any};\n\n    /**\n     * @inheritdoc\n     */\n    load(data: { [key: string]: any }) {\n        super.load(data);\n\n        this.system    = !!data.system;\n        this.name      = typeof data.name    === 'string'    ? data.name    : '';\n        this.type      = typeof data.type    === 'string'    ? data.type    : 'base';\n        this.options   = typeof data.options !== 'undefined' ? data.options : {};\n\n        // rules\n        this.listRule   = typeof data.listRule   === 'string' ? data.listRule   : null;\n        this.viewRule   = typeof data.viewRule   === 'string' ? data.viewRule   : null;\n        this.createRule = typeof data.createRule === 'string' ? data.createRule : null;\n        this.updateRule = typeof data.updateRule === 'string' ? data.updateRule : null;\n        this.deleteRule = typeof data.deleteRule === 'string' ? data.deleteRule : null;\n\n        // schema\n        data.schema = Array.isArray(data.schema) ? data.schema : [];\n        this.schema = [];\n        for (let field of data.schema) {\n            this.schema.push(new SchemaField(field));\n        }\n    }\n\n    /**\n     * Checks if the current model is \"base\" collection.\n     */\n    get isBase(): boolean {\n        return this.type === 'base';\n    }\n\n    /**\n     * Checks if the current model is \"auth\" collection.\n     */\n    get isAuth(): boolean {\n        return this.type === 'auth';\n    }\n\n    /**\n     * Checks if the current model is \"single\" collection.\n     */\n    get isSingle(): boolean {\n        return this.type === 'single';\n    }\n}\n","import Collection          from '@/models/Collection';\nimport CrudService         from '@/services/utils/CrudService';\nimport { BaseQueryParams } from '@/services/utils/QueryParams';\n\nexport default class CollectionService extends CrudService<Collection> {\n    /**\n     * @inheritdoc\n     */\n    decode(data: { [key: string]: any }): Collection {\n        return new Collection(data);\n    }\n\n    /**\n     * @inheritdoc\n     */\n    get baseCrudPath(): string {\n        return '/api/collections';\n    }\n\n    /**\n     * Imports the provided collections.\n     *\n     * If `deleteMissing` is `true`, all local collections and schema fields,\n     * that are not present in the imported configuration, WILL BE DELETED\n     * (including their related records data)!\n     */\n    async import(\n        collections: Array<Collection>,\n        deleteMissing: boolean = false,\n        queryParams: BaseQueryParams = {}\n    ): Promise<true> {\n        return this.client.send(this.baseCrudPath + '/import', {\n            'method': 'PUT',\n            'params': queryParams,\n            'body': {\n                'collections':  collections,\n                'deleteMissing': deleteMissing,\n            }\n        }).then(() => true);\n    }\n}\n","import BaseModel from '@/models/utils/BaseModel';\n\nexport default class LogRequest extends BaseModel {\n    url!:       string;\n    method!:    string;\n    status!:    number;\n    auth!:      string;\n    remoteIp!:  string;\n    userIp!:    string;\n    referer!:   string;\n    userAgent!: string;\n    meta!:      { [key: string]: any };\n\n    /**\n     * @inheritdoc\n     */\n    load(data: { [key: string]: any }) {\n        super.load(data);\n\n        // fallback to the ip field for backward compatibility\n        data.remoteIp = data.remoteIp || data.ip;\n\n        this.url       = typeof data.url       === 'string' ? data.url       : '';\n        this.method    = typeof data.method    === 'string' ? data.method    : 'GET';\n        this.status    = typeof data.status    === 'number' ? data.status    : 200;\n        this.auth      = typeof data.auth      === 'string' ? data.auth      : 'guest';\n        this.remoteIp  = typeof data.remoteIp  === 'string' ? data.remoteIp  : '';\n        this.userIp    = typeof data.userIp    === 'string' ? data.userIp    : '';\n        this.referer   = typeof data.referer   === 'string' ? data.referer   : '';\n        this.userAgent = typeof data.userAgent === 'string' ? data.userAgent : '';\n        this.meta      = typeof data.meta === 'object' && data.meta !== null ? data.meta : {};\n    }\n}\n","import LogRequest  from '@/models/LogRequest';\nimport ListResult  from '@/models/utils/ListResult';\nimport BaseService from '@/services/utils/BaseService';\nimport {\n    BaseQueryParams,\n    ListQueryParams,\n    LogStatsQueryParams,\n} from '@/services/utils/QueryParams';\n\nexport interface HourlyStats {\n    total: number;\n    date:  string;\n}\n\nexport default class LogService extends BaseService {\n    /**\n     * Returns paginated logged requests list.\n     */\n    getRequestsList(page = 1, perPage = 30, queryParams: ListQueryParams = {}): Promise<ListResult<LogRequest>> {\n        queryParams = Object.assign({\n            'page':    page,\n            'perPage': perPage,\n        }, queryParams);\n\n        return this.client.send('/api/logs/requests', {\n            'method': 'GET',\n            'params': queryParams,\n        }).then((responseData: any) => {\n            const items: Array<LogRequest> = [];\n            if (responseData?.items) {\n                responseData.items = responseData?.items || [];\n                for (const item of responseData.items) {\n                    items.push(new LogRequest(item));\n                }\n            }\n\n            return new ListResult<LogRequest>(\n                responseData?.page || 1,\n                responseData?.perPage || 0,\n                responseData?.totalItems || 0,\n                responseData?.totalPages || 0,\n                items,\n            );\n        });\n    }\n\n    /**\n     * Returns a single logged request by its id.\n     */\n    getRequest(id: string, queryParams: BaseQueryParams = {}): Promise<LogRequest> {\n        return this.client.send('/api/logs/requests/' + encodeURIComponent(id), {\n            'method': 'GET',\n            'params': queryParams\n        }).then((responseData: any) => new LogRequest(responseData));\n    }\n\n    /**\n     * Returns request logs statistics.\n     */\n    getRequestsStats(queryParams: LogStatsQueryParams = {}): Promise<Array<HourlyStats>> {\n        return this.client.send('/api/logs/requests/stats', {\n            'method': 'GET',\n            'params': queryParams\n        }).then((responseData: any) => responseData);\n    }\n}\n","import BaseService from '@/services/utils/BaseService';\nimport ClientResponseError from '@/ClientResponseError';\n\ninterface promiseCallbacks {\n    resolve: Function\n    reject: Function\n}\n\nexport type UnsubscribeFunc = () => Promise<void>;\n\nexport default class RealtimeService extends BaseService {\n    private clientId: string = \"\";\n    private eventSource: EventSource | null = null;\n    private subscriptions: { [key: string]: Array<EventListener> } = {};\n    private lastSentTopics: Array<string> = [];\n    private connectTimeoutId: any;\n    private maxConnectTimeout: number = 15000;\n    private reconnectTimeoutId: any;\n    private reconnectAttempts: number = 0;\n    private maxReconnectAttempts: number = Infinity;\n    private predefinedReconnectIntervals: Array<number> = [\n        200, 300, 500, 1000, 1200, 1500, 2000,\n    ];\n    private pendingConnects: Array<promiseCallbacks> = [];\n\n    /**\n     * Returns whether the realtime connection has been established.\n     */\n    get isConnected(): boolean {\n        return !!this.eventSource && !!this.clientId && !this.pendingConnects.length;\n    }\n\n    /**\n     * Register the subscription listener.\n     *\n     * You can subscribe multiple times to the same topic.\n     *\n     * If the SSE connection is not started yet,\n     * this method will also initialize it.\n     */\n    async subscribe(topic: string, callback: (data: any) => void): Promise<UnsubscribeFunc> {\n        if (!topic) {\n            throw new Error('topic must be set.')\n        }\n\n        const listener = function (e: Event) {\n            const msgEvent = (e as MessageEvent);\n\n            let data;\n            try {\n                data = JSON.parse(msgEvent?.data);\n            } catch {}\n\n            callback(data || {});\n        };\n\n        // store the listener\n        if (!this.subscriptions[topic]) {\n            this.subscriptions[topic] = [];\n        }\n        this.subscriptions[topic].push(listener);\n\n        if (!this.isConnected) {\n            // initialize sse connection\n            await this.connect();\n        } else if (this.subscriptions[topic].length === 1) {\n            // send the updated subscriptions (if it is the first for the topic)\n            await this.submitSubscriptions();\n        } else {\n            // only register the listener\n            this.eventSource?.addEventListener(topic, listener);\n        }\n\n        return async (): Promise<void> => {\n            return this.unsubscribeByTopicAndListener(topic, listener);\n        };\n    }\n\n    /**\n     * Unsubscribe from all subscription listeners with the specified topic.\n     *\n     * If `topic` is not provided, then this method will unsubscribe\n     * from all active subscriptions.\n     *\n     * This method is no-op if there are no active subscriptions.\n     *\n     * The related sse connection will be autoclosed if after the\n     * unsubscribe operation there are no active subscriptions left.\n     */\n    async unsubscribe(topic?: string): Promise<void> {\n        if (!this.hasSubscriptionListeners(topic)) {\n            return; // already unsubscribed\n        }\n\n        if (!topic) {\n            // remove all subscriptions\n            this.subscriptions = {};\n        } else {\n            // remove all topic listeners\n            for (let listener of this.subscriptions[topic]) {\n                this.eventSource?.removeEventListener(topic, listener);\n            }\n            delete this.subscriptions[topic];\n        }\n\n        if (!this.hasSubscriptionListeners()) {\n            // no other active subscriptions -> close the sse connection\n            this.disconnect();\n        } else if (!this.hasSubscriptionListeners(topic)) {\n            // submit subscriptions change if there are no other active subscriptions related to the topic\n            await this.submitSubscriptions();\n        }\n    }\n\n    /**\n     * Unsubscribe from all subscription listeners starting with the specified topic prefix.\n     *\n     * This method is no-op if there are no active subscriptions with the specified topic prefix.\n     *\n     * The related sse connection will be autoclosed if after the\n     * unsubscribe operation there are no active subscriptions left.\n     */\n    async unsubscribeByPrefix(topicPrefix: string): Promise<void> {\n        let hasAtleastOneTopic = false;\n        for (let topic in this.subscriptions) {\n            if (!topic.startsWith(topicPrefix)) {\n                continue;\n            }\n\n            hasAtleastOneTopic = true;\n            for (let listener of this.subscriptions[topic]) {\n                this.eventSource?.removeEventListener(topic, listener);\n            }\n            delete this.subscriptions[topic];\n        }\n\n        if (!hasAtleastOneTopic) {\n            return; // nothing to unsubscribe from\n        }\n\n        if (this.hasSubscriptionListeners()) {\n            // submit the deleted subscriptions\n            await this.submitSubscriptions();\n        } else {\n            // no other active subscriptions -> close the sse connection\n            this.disconnect();\n        }\n    }\n\n    /**\n     * Unsubscribe from all subscriptions matching the specified topic and listener function.\n     *\n     * This method is no-op if there are no active subscription with\n     * the specified topic and listener.\n     *\n     * The related sse connection will be autoclosed if after the\n     * unsubscribe operation there are no active subscriptions left.\n     */\n    async unsubscribeByTopicAndListener(topic: string, listener: EventListener): Promise<void> {\n        if (!Array.isArray(this.subscriptions[topic]) || !this.subscriptions[topic].length) {\n            return; // already unsubscribed\n        }\n\n        let exist = false;\n        for (let i = this.subscriptions[topic].length - 1; i >= 0; i--) {\n            if (this.subscriptions[topic][i] !== listener) {\n                continue;\n            }\n\n            exist = true;                           // has at least one matching listener\n            delete this.subscriptions[topic][i];    // removes the function reference\n            this.subscriptions[topic].splice(i, 1); // reindex the array\n            this.eventSource?.removeEventListener(topic, listener);\n        }\n        if (!exist) {\n            return;\n        }\n\n        // remove the topic from the subscriptions list if there are no other listeners\n        if (!this.subscriptions[topic].length) {\n            delete this.subscriptions[topic];\n        }\n\n        if (!this.hasSubscriptionListeners()) {\n            // no other active subscriptions -> close the sse connection\n            this.disconnect();\n        } else if (!this.hasSubscriptionListeners(topic)) {\n            // submit subscriptions change if there are no other active subscriptions related to the topic\n            await this.submitSubscriptions();\n        }\n    }\n\n    private hasSubscriptionListeners(topicToCheck?: string): boolean {\n        this.subscriptions = this.subscriptions || {};\n\n        // check the specified topic\n        if (topicToCheck) {\n            return !!this.subscriptions[topicToCheck]?.length;\n        }\n\n        // check for at least one non-empty topic\n        for (let topic in this.subscriptions) {\n            if (!!this.subscriptions[topic]?.length) {\n                return true\n            }\n        }\n\n        return false;\n    }\n\n    private async submitSubscriptions(): Promise<void> {\n        if (!this.clientId) {\n            return; // no client/subscriber\n        }\n\n        // optimistic update\n        this.addAllSubscriptionListeners();\n\n        this.lastSentTopics = this.getNonEmptySubscriptionTopics();\n\n        return this.client.send('/api/realtime', {\n            'method': 'POST',\n            'body': {\n                'clientId': this.clientId,\n                'subscriptions': this.lastSentTopics,\n            },\n            'params': {\n                '$cancelKey': \"realtime_\" + this.clientId,\n            },\n        }).catch((err) => {\n            if (err?.isAbort) {\n                return; // silently ignore aborted pending requests\n            }\n            throw err;\n        });\n    }\n\n    private getNonEmptySubscriptionTopics(): Array<string> {\n        const result : Array<string> = [];\n\n        for (let topic in this.subscriptions) {\n            if (this.subscriptions[topic].length) {\n                result.push(topic);\n            }\n        }\n\n        return result;\n    }\n\n    private addAllSubscriptionListeners(): void {\n        if (!this.eventSource) {\n            return;\n        }\n\n        this.removeAllSubscriptionListeners();\n\n        for (let topic in this.subscriptions) {\n            for (let listener of this.subscriptions[topic]) {\n                this.eventSource.addEventListener(topic, listener);\n            }\n        }\n    }\n\n    private removeAllSubscriptionListeners(): void {\n        if (!this.eventSource) {\n            return;\n        }\n\n        for (let topic in this.subscriptions) {\n            for (let listener of this.subscriptions[topic]) {\n                this.eventSource.removeEventListener(topic, listener);\n            }\n        }\n    }\n\n    private async connect(): Promise<void> {\n        if (this.reconnectAttempts > 0)  {\n            // immediately resolve the promise to avoid indefinitely\n            // blocking the client during reconnection\n            return;\n        }\n\n        return new Promise((resolve, reject) => {\n            this.pendingConnects.push({ resolve, reject });\n\n            if (this.pendingConnects.length > 1) {\n                // all promises will be resolved once the connection is established\n                return;\n            }\n\n            this.initConnect();\n        })\n    }\n\n    private initConnect() {\n        this.disconnect(true);\n\n        // wait up to 15s for connect\n        clearTimeout(this.connectTimeoutId);\n        this.connectTimeoutId = setTimeout(() => {\n            this.connectErrorHandler(new Error(\"EventSource connect took too long.\"));\n        }, this.maxConnectTimeout);\n\n        this.eventSource = new EventSource(this.client.buildUrl('/api/realtime'))\n\n        this.eventSource.onerror = (_) => {\n            this.connectErrorHandler(new Error(\"Failed to establish realtime connection.\"));\n        };\n\n        this.eventSource.addEventListener('PB_CONNECT', (e) => {\n            const msgEvent = (e as MessageEvent);\n            this.clientId = msgEvent?.lastEventId;\n\n            this.submitSubscriptions()\n            .then(async () => {\n                let retries = 3;\n                while (this.hasUnsentSubscriptions() && retries > 0) {\n                    retries--;\n                    // resubscribe to ensure that the latest topics are submitted\n                    //\n                    // This is needed because missed topics could happen on reconnect\n                    // if after the pending sent `submitSubscriptions()` call another `subscribe()`\n                    // was made before the submit was able to complete.\n                    await this.submitSubscriptions();\n                }\n            }).then(() => {\n                for (let p of this.pendingConnects) {\n                    p.resolve();\n                }\n\n                // reset connect meta\n                this.pendingConnects = [];\n                this.reconnectAttempts = 0;\n                clearTimeout(this.reconnectTimeoutId);\n                clearTimeout(this.connectTimeoutId);\n            }).catch((err) => {\n                this.clientId = \"\";\n                this.connectErrorHandler(err);\n            });\n        });\n    }\n\n    private hasUnsentSubscriptions(): boolean {\n        const latestTopics = this.getNonEmptySubscriptionTopics();\n        if (latestTopics.length != this.lastSentTopics.length) {\n            return true;\n        }\n\n        for (const t of latestTopics) {\n            if (!this.lastSentTopics.includes(t)) {\n                return true;\n            }\n        }\n\n        return false;\n    }\n\n    private connectErrorHandler(err: any) {\n        clearTimeout(this.connectTimeoutId);\n        clearTimeout(this.reconnectTimeoutId);\n\n        if (\n            // wasn't previously connected -> direct reject\n            (!this.clientId && !this.reconnectAttempts) ||\n            // was previously connected but the max reconnection limit has been reached\n            this.reconnectAttempts > this.maxReconnectAttempts\n        ) {\n            for (let p of this.pendingConnects) {\n                p.reject(new ClientResponseError(err));\n            }\n            this.disconnect();\n            return;\n        }\n\n        // otherwise -> reconnect in the background\n        this.disconnect(true);\n        const timeout = this.predefinedReconnectIntervals[this.reconnectAttempts] || this.predefinedReconnectIntervals[this.predefinedReconnectIntervals.length - 1];\n        this.reconnectAttempts++;\n        this.reconnectTimeoutId = setTimeout(() => {\n            this.initConnect();\n        }, timeout);\n    }\n\n    private disconnect(fromReconnect = false): void {\n        clearTimeout(this.connectTimeoutId);\n        clearTimeout(this.reconnectTimeoutId);\n        this.removeAllSubscriptionListeners();\n        this.eventSource?.close();\n        this.eventSource = null;\n        this.clientId = \"\";\n\n        if (!fromReconnect) {\n            this.reconnectAttempts = 0;\n\n            // reject any remaining connect promises\n            const err = new ClientResponseError(new Error(\"Realtime disconnected.\"));\n            for (let p of this.pendingConnects) {\n                p.reject(err);\n            }\n            this.pendingConnects = [];\n        }\n    }\n}\n","import BaseService         from '@/services/utils/BaseService';\nimport { BaseQueryParams } from '@/services/utils/QueryParams';\n\nexport interface healthCheckResponse {\n    code:    number;\n    message: string;\n}\n\nexport default class HealthService extends BaseService {\n    /**\n     * Checks the health status of the api.\n     */\n    check(queryParams: BaseQueryParams = {}): Promise<healthCheckResponse> {\n        return this.client.send('/api/health', {\n            'method': 'GET',\n            'params': queryParams,\n        });\n    }\n}\n","import ClientResponseError from '@/ClientResponseError';\nimport BaseAuthStore       from '@/stores/BaseAuthStore';\nimport LocalAuthStore      from '@/stores/LocalAuthStore';\nimport ViewService               from './services/ViewService';\nimport SettingsService     from '@/services/SettingsService';\nimport AdminService        from '@/services/AdminService';\nimport RecordService       from '@/services/RecordService';\nimport CollectionService   from '@/services/CollectionService';\nimport LogService          from '@/services/LogService';\nimport RealtimeService     from '@/services/RealtimeService';\nimport HealthService       from '@/services/HealthService';\nimport Record              from '@/models/Record';\nimport { FileQueryParams } from '@/services/utils/QueryParams';\n\n/**\n * PocketBase JS Client.\n */\nexport default class Client {\n    /**\n     * The base PocketBase backend url address (eg. 'http://127.0.0.1.8090').\n     */\n    baseUrl: string;\n\n    /**\n     * Hook that get triggered right before sending the fetch request,\n     * allowing you to inspect/modify the request config.\n     *\n     * Returns the new modified config that will be used to send the request.\n     *\n     * For list of the possible options check https://developer.mozilla.org/en-US/docs/Web/API/fetch#options\n     *\n     * Example:\n     * ```js\n     * client.beforeSend = function (url, reqConfig) {\n     *     reqConfig.headers = Object.assign({}, reqConfig.headers, {\n     *         'X-Custom-Header': 'example',\n     *     });\n     *\n     *     return reqConfig;\n     * };\n     * ```\n     */\n    beforeSend?: (url: string, reqConfig: { [key: string]: any }) => { [key: string]: any };\n\n    /**\n     * Hook that get triggered after successfully sending the fetch request,\n     * allowing you to inspect/modify the response object and its parsed data.\n     *\n     * Returns the new Promise resolved `data` that will be returned to the client.\n     *\n     * Example:\n     * ```js\n     * client.afterSend = function (response, data) {\n     *     if (response.status != 200) {\n     *         throw new ClientResponseError({\n     *             url:      response.url,\n     *             status:   response.status,\n     *             data:     data,\n     *         });\n     *     }\n     *\n     *     return data;\n     * };\n     * ```\n     */\n    afterSend?: (response: Response, data: any) => any;\n\n    /**\n     * Optional language code (default to `en-US`) that will be sent\n     * with the requests to the server as `Accept-Language` header.\n     */\n    lang: string;\n\n    /**\n     * A replaceable instance of the local auth store service.\n     */\n    authStore: BaseAuthStore;\n\n    /**\n     * An instance of the service that handles the **Settings APIs**.\n     */\n    readonly settings: SettingsService;\n\n    /**\n     * An instance of the service that handles the **Admin APIs**.\n     */\n    readonly admins: AdminService;\n\n    /**\n     * An instance of the service that handles the **Collection APIs**.\n     */\n    readonly collections: CollectionService;\n\n    readonly views: ViewService;\n\n    /**\n     * An instance of the service that handles the **Record APIs**.\n     */\n\n    /**\n     * An instance of the service that handles the **Log APIs**.\n     */\n    readonly logs: LogService;\n\n    /**\n     * An instance of the service that handles the **Realtime APIs**.\n     */\n    readonly realtime: RealtimeService;\n\n    /**\n     * An instance of the service that handles the **Health APIs**.\n     */\n    readonly health: HealthService;\n\n    private cancelControllers: { [key: string]: AbortController } = {};\n    private recordServices: { [key: string]: RecordService } = {};\n    private enableAutoCancellation: boolean = true;\n\n    constructor(\n        baseUrl = '/',\n        authStore?: BaseAuthStore | null,\n        lang = 'en-US',\n    ) {\n        this.baseUrl   = baseUrl;\n        this.lang      = lang;\n        this.authStore = authStore || new LocalAuthStore();\n\n        // services\n        this.views = new ViewService(this);\n        this.admins      = new AdminService(this);\n        this.collections = new CollectionService(this);\n        this.logs        = new LogService(this);\n        this.settings    = new SettingsService(this);\n        this.realtime    = new RealtimeService(this);\n        this.health      = new HealthService(this);\n    }\n\n    /**\n     * Returns the RecordService associated to the specified collection.\n     *\n     * @param  {string} idOrName\n     * @return {RecordService}\n     */\n    collection(idOrName: string): RecordService {\n        if (!this.recordServices[idOrName]) {\n            this.recordServices[idOrName] = new RecordService(this, idOrName);\n        }\n\n        return this.recordServices[idOrName];\n    }\n\n    /**\n     * Globally enable or disable auto cancellation for pending duplicated requests.\n     */\n    autoCancellation(enable: boolean): Client {\n        this.enableAutoCancellation = !!enable;\n\n        return this;\n    }\n\n    /**\n     * Cancels single request by its cancellation key.\n     */\n    cancelRequest(cancelKey: string): Client {\n        if (this.cancelControllers[cancelKey]) {\n            this.cancelControllers[cancelKey].abort();\n            delete this.cancelControllers[cancelKey];\n        }\n\n        return this;\n    }\n\n    /**\n     * Cancels all pending requests.\n     */\n    cancelAllRequests(): Client {\n        for (let k in this.cancelControllers) {\n            this.cancelControllers[k].abort();\n        }\n\n        this.cancelControllers = {};\n\n        return this;\n    }\n\n    /**\n     * Sends an api http request.\n     */\n    async send(path: string, reqConfig: { [key: string]: any }): Promise<any> {\n        let config = Object.assign({ method: 'GET' } as { [key: string]: any }, reqConfig);\n\n        // serialize the body if needed and set the correct content type\n        // note1: for FormData body the Content-Type header should be skipped\n        // note2: we are checking the constructor name because FormData is not available natively in node\n        if (config.body && config.body.constructor.name !== 'FormData') {\n            if (typeof config.body !== 'string') {\n                config.body = JSON.stringify(config.body);\n            }\n\n            // add the json header (if not already)\n            if (typeof config?.headers?.['Content-Type'] === 'undefined') {\n                config.headers = Object.assign({}, config.headers, {\n                    'Content-Type': 'application/json',\n                });\n            }\n        }\n\n        // add Accept-Language header (if not already)\n        if (typeof config?.headers?.['Accept-Language'] === 'undefined') {\n            config.headers = Object.assign({}, config.headers, {\n                'Accept-Language': this.lang,\n            });\n        }\n\n        // check if Authorization header can be added\n        if (\n            // has stored token\n            this.authStore?.token &&\n            // auth header is not explicitly set\n            (typeof config?.headers?.Authorization === 'undefined')\n        ) {\n            config.headers = Object.assign({}, config.headers, {\n                'Authorization': this.authStore.token,\n            });\n        }\n\n        // handle auto cancelation for duplicated pending request\n        if (this.enableAutoCancellation && config.params?.$autoCancel !== false) {\n            const cancelKey = config.params?.$cancelKey || ((config.method || 'GET') + path);\n\n            // cancel previous pending requests\n            this.cancelRequest(cancelKey);\n\n            const controller = new AbortController();\n            this.cancelControllers[cancelKey] = controller;\n            config.signal = controller.signal;\n        }\n        // remove the special cancellation params from the other valid query params\n        delete config.params?.$autoCancel;\n        delete config.params?.$cancelKey;\n\n        // build url + path\n        let url = this.buildUrl(path);\n\n        // serialize the query parameters\n        if (typeof config.params !== 'undefined') {\n            const query = this.serializeQueryParams(config.params)\n            if (query) {\n                url += (url.includes('?') ? '&' : '?') + query;\n            }\n            delete config.params;\n        }\n\n        if (this.beforeSend) {\n            config = Object.assign({}, this.beforeSend(url, config));\n        }\n\n        // send the request\n        return fetch(url, config)\n            .then(async (response) => {\n                let data : any = {};\n\n                try {\n                    data = await response.json();\n                } catch (_) {\n                    // all api responses are expected to return json\n                    // with the exception of the realtime event and 204\n                }\n\n                if (this.afterSend) {\n                    data = this.afterSend(response, data);\n                }\n\n                if (response.status >= 400) {\n                    throw new ClientResponseError({\n                        url:      response.url,\n                        status:   response.status,\n                        data:     data,\n                    });\n                }\n\n                return data;\n            }).catch((err) => {\n                // wrap to normalize all errors\n                throw new ClientResponseError(err);\n            });\n    }\n\n    /**\n     * Builds and returns an absolute record file url for the provided filename.\n     */\n    getFileUrl(record: Record, filename: string, queryParams: FileQueryParams = {}): string {\n        const parts = [];\n        parts.push(\"api\")\n        parts.push(\"files\")\n        parts.push(encodeURIComponent(record.collectionId || record.collectionName))\n        parts.push(encodeURIComponent(record.id))\n        parts.push(encodeURIComponent(filename))\n\n        let result = this.buildUrl(parts.join('/'));\n\n        if (Object.keys(queryParams).length) {\n            const params = new URLSearchParams(queryParams);\n            result += (result.includes(\"?\") ? \"&\" : \"?\") + params;\n        }\n\n        return result\n    }\n\n    /**\n     * Builds a full client url by safely concatenating the provided path.\n     */\n    buildUrl(path: string): string {\n        let url = this.baseUrl + (this.baseUrl.endsWith('/') ? '' : '/');\n        if (path) {\n            url += (path.startsWith('/') ? path.substring(1) : path);\n        }\n        return url;\n    }\n\n    /**\n     * Serializes the provided query parameters into a query string.\n     */\n    private serializeQueryParams(params: {[key: string]: any}): string {\n        const result: Array<string> = [];\n        for (const key in params) {\n            if (params[key] === null) {\n                // skip null query params\n                continue;\n            }\n\n            const value = params[key];\n            const encodedKey = encodeURIComponent(key);\n\n            if (Array.isArray(value)) {\n                // \"repeat\" array params\n                for (const v of value) {\n                    result.push(encodedKey + \"=\" + encodeURIComponent(v));\n                }\n            } else if (value instanceof Date) {\n                result.push(encodedKey + \"=\" + encodeURIComponent(value.toISOString()));\n            } else if (typeof value !== null && typeof value === 'object') {\n                result.push(encodedKey + \"=\" + encodeURIComponent(JSON.stringify(value)));\n            } else {\n                result.push(encodedKey + \"=\" + encodeURIComponent(value));\n            }\n        }\n\n        return result.join('&');\n    }\n}\n","\nexport default class ViewRecord {\n    constructor(data: { [key: string]: any } = {}) {\n        this.load(data || {});\n    }\n\n    [key: string]: any,\n\n    /**\n     * @inheritdoc\n     */\n    load(data: { [key: string]: any }) {\n        for (const [key, value] of Object.entries(data)) {\n            this[key] = value;\n        }\n    }\n    clone(): ViewRecord {\n        return new (this.constructor as any)(JSON.parse(JSON.stringify(this)));\n    }\n\n    /**\n     * Exports all model properties as a new plain object.\n     */\n    export(): { [key: string]: any } {\n        return Object.assign({}, this);\n    }\n}\n"],"names":["atobPolyfill","ClientResponseError","_super","errData","_this","this","call","url","status","data","isAbort","originalError","Object","setPrototypeOf","prototype","DOMException","name","message","_a","_d","_c","_b","cause","includes","__extends","toJSON","__assign","Error","fieldContentRegExp","cookieSerialize","val","options","opt","assign","encode","defaultEncode","test","TypeError","value","result","maxAge","isNaN","isFinite","Math","floor","domain","path","expires","isDate","toString","Date","valueOf","toUTCString","httpOnly","secure","priority","toLowerCase","sameSite","defaultDecode","indexOf","decodeURIComponent","encodeURIComponent","getTokenPayload","token","encodedPayload","split","map","c","charCodeAt","slice","join","JSON","parse","e","atob","input","str","String","replace","length","bs","buffer","bc","idx","output","charAt","fromCharCode","BaseModel","load","_i","entries","key","id","created","updated","defineProperty","get","clone","structuredClone","stringify","constructor","export","Record","collectionId","collectionName","loadExpand","expand","Array","isArray","Admin","avatar","email","BaseAuthStore","baseToken","baseModel","_onChangeCallbacks","isTokenExpired","expirationThreshold","payload","keys","exp","now","save","model","triggerChange","clear","loadFromCookie","cookie","rawData","cookieParse","decode","index","eqIdx","endIdx","lastIndexOf","trim","undefined","_","exportToCookie","defaultOptions","resultLength","Blob","size","username","verified","onChange","callback","fireImmediately","push","i","splice","LocalAuthStore","storageKey","storageFallback","_storageGet","_storageSet","_storageRemove","window","localStorage","rawValue","getItem","normalizedVal","setItem","removeItem","ListResult","page","perPage","totalItems","totalPages","items","BaseService","client","CrudService","getFullList","batch","queryParams","_getFullList","baseCrudPath","getList","_getList","getFirstListItem","filter","_getFirstListItem","getOne","_getOne","create","bodyParams","_create","update","_update","delete","_delete","BaseCrudService","basePath","batchSize","request","__awaiter","then","list","castedList","concat","send","method","params","responseData","item","$cancelKey","code","body","SchemaField","type","system","required","unique","View","listRule","sql","schema","field","Views","getRecordsFullList","viewName","getRecordsList","console","log","ViewRecord","ViewRecordListResult","SettingsService","getAll","testS3","testEmail","toEmail","emailTemplate","template","AdminService","authStore","success","authResponse","admin","authWithPassword","password","identity","bind","authRefresh","requestPasswordReset","confirmPasswordReset","passwordResetToken","passwordConfirm","ExternalAuth","recordId","provider","providerId","RecordService","collectionIdOrName","baseCollectionPath","subscribeOne","warn","realtime","subscribe","topicOrCallback","topic","unsubscribe","unsubscribeByPrefix","record","listAuthMethods","usernamePassword","emailPassword","authProviders","usernameOrEmail","authWithOAuth2","codeVerifier","redirectUrl","createData","requestVerification","confirmVerification","verificationToken","requestEmailChange","newEmail","confirmEmailChange","emailChangeToken","listExternalAuths","responseData_1","unlinkExternalAuth","Collection","viewRule","createRule","updateRule","deleteRule","CollectionService","import","collections","deleteMissing","LogRequest","remoteIp","ip","auth","userIp","referer","userAgent","meta","LogService","getRequestsList","getRequest","getRequestsStats","RealtimeService","apply","arguments","clientId","eventSource","subscriptions","lastSentTopics","maxConnectTimeout","reconnectAttempts","maxReconnectAttempts","Infinity","predefinedReconnectIntervals","pendingConnects","listener","msgEvent","isConnected","connect","sent","submitSubscriptions","addEventListener","unsubscribeByTopicAndListener","hasSubscriptionListeners","removeEventListener","disconnect","topicPrefix","hasAtleastOneTopic","startsWith","exist","topicToCheck","addAllSubscriptionListeners","getNonEmptySubscriptionTopics","catch","err","removeAllSubscriptionListeners","Promise","resolve","reject","initConnect","clearTimeout","connectTimeoutId","setTimeout","connectErrorHandler","EventSource","buildUrl","onerror","lastEventId","retries","hasUnsentSubscriptions","reconnectTimeoutId","latestTopics","latestTopics_1","t","timeout","fromReconnect","close","HealthService","check","Client","baseUrl","lang","cancelControllers","recordServices","enableAutoCancellation","views","ViewService","admins","logs","settings","health","collection","idOrName","autoCancellation","enable","cancelRequest","cancelKey","abort","cancelAllRequests","k","reqConfig","config","headers","Authorization","_e","$autoCancel","_f","controller","AbortController","signal","_g","_h","query","serializeQueryParams","beforeSend","fetch","response","json","afterSend","getFileUrl","filename","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