node-appwrite
Version:
Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API
1 lines • 23.5 kB
Source Map (JSON)
{"version":3,"sources":["../../src/services/health.ts"],"names":[],"mappings":";AAAA,SAAS,yBAA+D;AAIjE,IAAM,SAAN,MAAa;AAAA,EAGhB,YAAY,QAAgB;AACxB,SAAK,SAAS;AAAA,EAClB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAoC;AAChC,UAAM,UAAU;AAChB,UAAM,UAAmB,CAAC;AAC1B,UAAM,MAAM,IAAI,IAAI,KAAK,OAAO,OAAO,WAAW,OAAO;AAEzD,UAAM,aAA2C,CACjD;AAEA,WAAO,KAAK,OAAO;AAAA,MACf;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACJ;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,eAAgD;AAC5C,UAAM,UAAU;AAChB,UAAM,UAAmB,CAAC;AAC1B,UAAM,MAAM,IAAI,IAAI,KAAK,OAAO,OAAO,WAAW,OAAO;AAEzD,UAAM,aAA2C,CACjD;AAEA,WAAO,KAAK,OAAO;AAAA,MACf;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACJ;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,WAAyC;AACrC,UAAM,UAAU;AAChB,UAAM,UAAmB,CAAC;AAC1B,UAAM,MAAM,IAAI,IAAI,KAAK,OAAO,OAAO,WAAW,OAAO;AAEzD,UAAM,aAA2C,CACjD;AAEA,WAAO,KAAK,OAAO;AAAA,MACf;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACJ;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,eAAe,QAAoD;AAC/D,UAAM,UAAU;AAChB,UAAM,UAAmB,CAAC;AAC1B,QAAI,OAAO,WAAW,aAAa;AAC/B,cAAQ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AAA,MACA;AAAA,IACJ;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,UAAsC;AAClC,UAAM,UAAU;AAChB,UAAM,UAAmB,CAAC;AAC1B,UAAM,MAAM,IAAI,IAAI,KAAK,OAAO,OAAO,WAAW,OAAO;AAEzD,UAAM,aAA2C,CACjD;AAEA,WAAO,KAAK,OAAO;AAAA,MACf;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACJ;AAAA,EACJ;AACJ","sourcesContent":["import { AppwriteException, Client, type Payload, UploadProgress } from '../client';\nimport type { Models } from '../models';\nimport { Name } from '../enums/name';\n\nexport class Health {\n client: Client;\n\n constructor(client: Client) {\n this.client = client;\n }\n\n /**\n * Check the Appwrite HTTP server is up and responsive.\n *\n * @throws {AppwriteException}\n * @returns {Promise<Models.HealthStatus>}\n */\n get(): Promise<Models.HealthStatus> {\n const apiPath = '/health';\n const payload: Payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Check the Appwrite Antivirus server is up and connection is successful.\n *\n * @throws {AppwriteException}\n * @returns {Promise<Models.HealthAntivirus>}\n */\n getAntivirus(): Promise<Models.HealthAntivirus> {\n const apiPath = '/health/anti-virus';\n const payload: Payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Check the Appwrite in-memory cache servers are up and connection is successful.\n *\n * @throws {AppwriteException}\n * @returns {Promise<Models.HealthStatus>}\n */\n getCache(): Promise<Models.HealthStatus> {\n const apiPath = '/health/cache';\n const payload: Payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Get the SSL certificate for a domain\n *\n * @param {string} domain\n * @throws {AppwriteException}\n * @returns {Promise<Models.HealthCertificate>}\n */\n getCertificate(domain?: string): Promise<Models.HealthCertificate> {\n const apiPath = '/health/certificate';\n const payload: Payload = {};\n if (typeof domain !== 'undefined') {\n payload['domain'] = domain;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Check the Appwrite database servers are up and connection is successful.\n *\n * @throws {AppwriteException}\n * @returns {Promise<Models.HealthStatus>}\n */\n getDB(): Promise<Models.HealthStatus> {\n const apiPath = '/health/db';\n const payload: Payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Check the Appwrite pub-sub servers are up and connection is successful.\n *\n * @throws {AppwriteException}\n * @returns {Promise<Models.HealthStatus>}\n */\n getPubSub(): Promise<Models.HealthStatus> {\n const apiPath = '/health/pubsub';\n const payload: Payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Get the number of builds that are waiting to be processed in the Appwrite internal queue server.\n *\n * @param {number} threshold\n * @throws {AppwriteException}\n * @returns {Promise<Models.HealthQueue>}\n */\n getQueueBuilds(threshold?: number): Promise<Models.HealthQueue> {\n const apiPath = '/health/queue/builds';\n const payload: Payload = {};\n if (typeof threshold !== 'undefined') {\n payload['threshold'] = threshold;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Get the number of certificates that are waiting to be issued against [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue server.\n *\n * @param {number} threshold\n * @throws {AppwriteException}\n * @returns {Promise<Models.HealthQueue>}\n */\n getQueueCertificates(threshold?: number): Promise<Models.HealthQueue> {\n const apiPath = '/health/queue/certificates';\n const payload: Payload = {};\n if (typeof threshold !== 'undefined') {\n payload['threshold'] = threshold;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Get the number of database changes that are waiting to be processed in the Appwrite internal queue server.\n *\n * @param {string} name\n * @param {number} threshold\n * @throws {AppwriteException}\n * @returns {Promise<Models.HealthQueue>}\n */\n getQueueDatabases(name?: string, threshold?: number): Promise<Models.HealthQueue> {\n const apiPath = '/health/queue/databases';\n const payload: Payload = {};\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n if (typeof threshold !== 'undefined') {\n payload['threshold'] = threshold;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Get the number of background destructive changes that are waiting to be processed in the Appwrite internal queue server.\n *\n * @param {number} threshold\n * @throws {AppwriteException}\n * @returns {Promise<Models.HealthQueue>}\n */\n getQueueDeletes(threshold?: number): Promise<Models.HealthQueue> {\n const apiPath = '/health/queue/deletes';\n const payload: Payload = {};\n if (typeof threshold !== 'undefined') {\n payload['threshold'] = threshold;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Returns the amount of failed jobs in a given queue.\n\n *\n * @param {Name} name\n * @param {number} threshold\n * @throws {AppwriteException}\n * @returns {Promise<Models.HealthQueue>}\n */\n getFailedJobs(name: Name, threshold?: number): Promise<Models.HealthQueue> {\n if (typeof name === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"name\"');\n }\n const apiPath = '/health/queue/failed/{name}'.replace('{name}', name);\n const payload: Payload = {};\n if (typeof threshold !== 'undefined') {\n payload['threshold'] = threshold;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Get the number of function executions that are waiting to be processed in the Appwrite internal queue server.\n *\n * @param {number} threshold\n * @throws {AppwriteException}\n * @returns {Promise<Models.HealthQueue>}\n */\n getQueueFunctions(threshold?: number): Promise<Models.HealthQueue> {\n const apiPath = '/health/queue/functions';\n const payload: Payload = {};\n if (typeof threshold !== 'undefined') {\n payload['threshold'] = threshold;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Get the number of logs that are waiting to be processed in the Appwrite internal queue server.\n *\n * @param {number} threshold\n * @throws {AppwriteException}\n * @returns {Promise<Models.HealthQueue>}\n */\n getQueueLogs(threshold?: number): Promise<Models.HealthQueue> {\n const apiPath = '/health/queue/logs';\n const payload: Payload = {};\n if (typeof threshold !== 'undefined') {\n payload['threshold'] = threshold;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Get the number of mails that are waiting to be processed in the Appwrite internal queue server.\n *\n * @param {number} threshold\n * @throws {AppwriteException}\n * @returns {Promise<Models.HealthQueue>}\n */\n getQueueMails(threshold?: number): Promise<Models.HealthQueue> {\n const apiPath = '/health/queue/mails';\n const payload: Payload = {};\n if (typeof threshold !== 'undefined') {\n payload['threshold'] = threshold;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Get the number of messages that are waiting to be processed in the Appwrite internal queue server.\n *\n * @param {number} threshold\n * @throws {AppwriteException}\n * @returns {Promise<Models.HealthQueue>}\n */\n getQueueMessaging(threshold?: number): Promise<Models.HealthQueue> {\n const apiPath = '/health/queue/messaging';\n const payload: Payload = {};\n if (typeof threshold !== 'undefined') {\n payload['threshold'] = threshold;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Get the number of migrations that are waiting to be processed in the Appwrite internal queue server.\n *\n * @param {number} threshold\n * @throws {AppwriteException}\n * @returns {Promise<Models.HealthQueue>}\n */\n getQueueMigrations(threshold?: number): Promise<Models.HealthQueue> {\n const apiPath = '/health/queue/migrations';\n const payload: Payload = {};\n if (typeof threshold !== 'undefined') {\n payload['threshold'] = threshold;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Get the number of metrics that are waiting to be processed in the Appwrite stats resources queue.\n *\n * @param {number} threshold\n * @throws {AppwriteException}\n * @returns {Promise<Models.HealthQueue>}\n */\n getQueueStatsResources(threshold?: number): Promise<Models.HealthQueue> {\n const apiPath = '/health/queue/stats-resources';\n const payload: Payload = {};\n if (typeof threshold !== 'undefined') {\n payload['threshold'] = threshold;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Get the number of metrics that are waiting to be processed in the Appwrite internal queue server.\n *\n * @param {number} threshold\n * @throws {AppwriteException}\n * @returns {Promise<Models.HealthQueue>}\n */\n getQueueUsage(threshold?: number): Promise<Models.HealthQueue> {\n const apiPath = '/health/queue/stats-usage';\n const payload: Payload = {};\n if (typeof threshold !== 'undefined') {\n payload['threshold'] = threshold;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.\n *\n * @param {number} threshold\n * @throws {AppwriteException}\n * @returns {Promise<Models.HealthQueue>}\n */\n getQueueWebhooks(threshold?: number): Promise<Models.HealthQueue> {\n const apiPath = '/health/queue/webhooks';\n const payload: Payload = {};\n if (typeof threshold !== 'undefined') {\n payload['threshold'] = threshold;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Check the Appwrite storage device is up and connection is successful.\n *\n * @throws {AppwriteException}\n * @returns {Promise<Models.HealthStatus>}\n */\n getStorage(): Promise<Models.HealthStatus> {\n const apiPath = '/health/storage';\n const payload: Payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Check the Appwrite local storage device is up and connection is successful.\n *\n * @throws {AppwriteException}\n * @returns {Promise<Models.HealthStatus>}\n */\n getStorageLocal(): Promise<Models.HealthStatus> {\n const apiPath = '/health/storage/local';\n const payload: Payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n /**\n * Check the Appwrite server time is synced with Google remote NTP server. We use this technology to smoothly handle leap seconds with no disruptive events. The [Network Time Protocol](https://en.wikipedia.org/wiki/Network_Time_Protocol) (NTP) is used by hundreds of millions of computers and devices to synchronize their clocks over the Internet. If your computer sets its own clock, it likely uses NTP.\n *\n * @throws {AppwriteException}\n * @returns {Promise<Models.HealthTime>}\n */\n getTime(): Promise<Models.HealthTime> {\n const apiPath = '/health/time';\n const payload: Payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n}\n"]}