Skip to content

Commit

Permalink
Appwrite 1.5 support
Browse files Browse the repository at this point in the history
  • Loading branch information
abnegate committed Mar 8, 2024
1 parent e2e86f6 commit 34e3b5c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
2 changes: 2 additions & 0 deletions docs/examples/health/get-queue-usage-dump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
appwrite health getQueueUsageDump \

Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
appwrite projects updateAPIStatusAll \
appwrite projects updateApiStatusAll \
--projectId <PROJECT_ID> \
--status false
12 changes: 6 additions & 6 deletions lib/commands/health.js
Original file line number Diff line number Diff line change
Expand Up @@ -597,16 +597,16 @@ const healthGetQueueUsage = async ({ threshold, parseOutput = true, sdk = undefi
}

/**
* @typedef {Object} HealthGetQueueUsageRequestParams
* @typedef {Object} HealthGetQueueUsageDumpRequestParams
* @property {number} threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
* @property {boolean} parseOutput
* @property {libClient | undefined} sdk
*/

/**
* @param {HealthGetQueueUsageRequestParams} params
* @param {HealthGetQueueUsageDumpRequestParams} params
*/
const healthGetQueueUsage = async ({ threshold, parseOutput = true, sdk = undefined}) => {
const healthGetQueueUsageDump = async ({ threshold, parseOutput = true, sdk = undefined}) => {
let client = !sdk ? await sdkForProject() : sdk;
let apiPath = '/health/queue/usage-dump';
let payload = {};
Expand Down Expand Up @@ -849,10 +849,10 @@ health
.action(actionRunner(healthGetQueueUsage))

health
.command(`getQueueUsage`)
.command(`getQueueUsageDump`)
.description(`Get the number of projects containing metrics that are waiting to be processed in the Appwrite internal queue server.`)
.option(`--threshold <threshold>`, `Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.`, parseInteger)
.action(actionRunner(healthGetQueueUsage))
.action(actionRunner(healthGetQueueUsageDump))

health
.command(`getQueueWebhooks`)
Expand Down Expand Up @@ -895,7 +895,7 @@ module.exports = {
healthGetQueueMessaging,
healthGetQueueMigrations,
healthGetQueueUsage,
healthGetQueueUsage,
healthGetQueueUsageDump,
healthGetQueueWebhooks,
healthGetStorage,
healthGetStorageLocal,
Expand Down
12 changes: 6 additions & 6 deletions lib/commands/projects.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,17 +320,17 @@ const projectsUpdateApiStatus = async ({ projectId, api, status, parseOutput = t
}

/**
* @typedef {Object} ProjectsUpdateAPIStatusAllRequestParams
* @typedef {Object} ProjectsUpdateApiStatusAllRequestParams
* @property {string} projectId Project unique ID.
* @property {boolean} status API status.
* @property {boolean} parseOutput
* @property {libClient | undefined} sdk
*/

/**
* @param {ProjectsUpdateAPIStatusAllRequestParams} params
* @param {ProjectsUpdateApiStatusAllRequestParams} params
*/
const projectsUpdateAPIStatusAll = async ({ projectId, status, parseOutput = true, sdk = undefined}) => {
const projectsUpdateApiStatusAll = async ({ projectId, status, parseOutput = true, sdk = undefined}) => {
let client = !sdk ? await sdkForConsole() : sdk;
let apiPath = '/projects/{projectId}/api/all'.replace('{projectId}', projectId);
let payload = {};
Expand Down Expand Up @@ -1729,11 +1729,11 @@ projects
.action(actionRunner(projectsUpdateApiStatus))

projects
.command(`updateAPIStatusAll`)
.command(`updateApiStatusAll`)
.description(``)
.requiredOption(`--projectId <projectId>`, `Project unique ID.`)
.requiredOption(`--status <status>`, `API status.`, parseBool)
.action(actionRunner(projectsUpdateAPIStatusAll))
.action(actionRunner(projectsUpdateApiStatusAll))

projects
.command(`updateAuthDuration`)
Expand Down Expand Up @@ -2044,7 +2044,7 @@ module.exports = {
projectsUpdate,
projectsDelete,
projectsUpdateApiStatus,
projectsUpdateAPIStatusAll,
projectsUpdateApiStatusAll,
projectsUpdateAuthDuration,
projectsUpdateAuthLimit,
projectsUpdateAuthSessionsLimit,
Expand Down

0 comments on commit 34e3b5c

Please sign in to comment.