Skip to content

fix: hot swapping error in python ml function #163

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Once the installation is complete, you can verify the install using

```sh
$ appwrite -v
6.2.2
6.2.3
```

### Install using prebuilt binaries
Expand Down Expand Up @@ -60,7 +60,7 @@ $ scoop install https://raw.githubusercontent.com/appwrite/sdk-for-cli/master/sc
Once the installation completes, you can verify your install using
```
$ appwrite -v
6.2.2
6.2.3
```

## Getting Started
Expand Down Expand Up @@ -124,7 +124,7 @@ My Awesome Function
You can now deploy this function using

```sh
$ appwrite deploy function
$ appwrite push function

? Which functions would you like to deploy? My Awesome Function (61d1a4c81dfcd95bc834)
ℹ Info Deploying function My Awesome Function ( 61d1a4c81dfcd95bc834 )
Expand All @@ -138,7 +138,7 @@ Your function has now been deployed on your Appwrite server! As soon as the buil
Similarly, you can deploy all your collections to your Appwrite server using

```sh
appwrite deploy collections
appwrite push collections
```

> ### Note
Expand All @@ -163,7 +163,7 @@ $ appwrite users list

To create a document you can use the following command
```sh
$ appwrite database createDocument --collectionId <ID> --documentId 'unique()' --data '{ "Name": "Iron Man" }' --permissions 'read("any")' 'read("team:abc")'
$ appwrite databases create-document --database-id <DATABASE_ID> --collection-id <COLLECTION_ID> --document-id "unique()" --data '{"name": "Walter O Brein"}' --permissions 'read("any")' 'read("team:abc")'
```

### Some Gotchas
Expand Down Expand Up @@ -207,6 +207,7 @@ The Appwrite CLI can also work in a CI environment. The initialisation of the CL
appwrite client --endpoint http://localhost/v1 --projectId <PROJECT_ID> --key <API KEY>
```


## Contribution

This library is auto-generated by Appwrite custom [SDK Generator](https://github.com/appwrite/sdk-generator). To learn more about how you can help us improve this SDK, please check the [contribution guide](https://github.com/appwrite/sdk-generator/blob/master/CONTRIBUTING.md) before sending a pull-request.
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/databases/update-float-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ appwrite databases updateFloatAttribute \
--collectionId <COLLECTION_ID> \
--key '' \
--required false \
--min null \
--max null \
--default null \



4 changes: 2 additions & 2 deletions docs/examples/databases/update-integer-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ appwrite databases updateIntegerAttribute \
--collectionId <COLLECTION_ID> \
--key '' \
--required false \
--min null \
--max null \
--default null \



2 changes: 2 additions & 0 deletions docs/examples/health/get-queue-stats-resources.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
appwrite health getQueueStatsResources \

2 changes: 2 additions & 0 deletions docs/examples/health/get-queue-stats-usage-dump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
appwrite health getQueueStatsUsageDump \

2 changes: 0 additions & 2 deletions docs/examples/health/get-queue-usage-dump.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/examples/health/get-queue.md

This file was deleted.

4 changes: 2 additions & 2 deletions install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
# You can use "View source" of this page to see the full script.

# REPO
$GITHUB_x64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/6.2.2/appwrite-cli-win-x64.exe"
$GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/6.2.2/appwrite-cli-win-arm64.exe"
$GITHUB_x64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/6.2.3/appwrite-cli-win-x64.exe"
$GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/6.2.3/appwrite-cli-win-arm64.exe"

$APPWRITE_BINARY_NAME = "appwrite.exe"

Expand Down
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ printSuccess() {
downloadBinary() {
echo "[2/4] Downloading executable for $OS ($ARCH) ..."

GITHUB_LATEST_VERSION="6.2.2"
GITHUB_LATEST_VERSION="6.2.3"
GITHUB_FILE="appwrite-cli-${OS}-${ARCH}"
GITHUB_URL="https://github.com/$GITHUB_REPOSITORY_NAME/releases/download/$GITHUB_LATEST_VERSION/$GITHUB_FILE"

Expand Down
9 changes: 6 additions & 3 deletions lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ class Client {
'x-sdk-name': 'Command Line',
'x-sdk-platform': 'console',
'x-sdk-language': 'cli',
'x-sdk-version': '6.2.2',
'user-agent' : `AppwriteCLI/6.2.2 (${os.type()} ${os.version()}; ${os.arch()})`,
'x-sdk-version': '6.2.3',
'user-agent' : `AppwriteCLI/6.2.3 (${os.type()} ${os.version()}; ${os.arch()})`,
'X-Appwrite-Response-Format' : '1.6.0',
};
}
Expand Down Expand Up @@ -129,8 +129,11 @@ class Client {
* @return this
*/
setEndpoint(endpoint) {
this.endpoint = endpoint;
if (!endpoint.startsWith('http://') && !endpoint.startsWith('https://')) {
throw new AppwriteException('Invalid endpoint URL: ' + endpoint);
}

this.endpoint = endpoint;
return this;
}

Expand Down
4 changes: 2 additions & 2 deletions lib/commands/avatars.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const avatarsGetBrowser = async ({code,width,height,quality,parseOutput = true,

/**
* @typedef {Object} AvatarsGetCreditCardRequestParams
* @property {CreditCard} code Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro.
* @property {CreditCard} code Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro, rupay.
* @property {number} width Image width. Pass an integer between 0 to 2000. Defaults to 100.
* @property {number} height Image height. Pass an integer between 0 to 2000. Defaults to 100.
* @property {number} quality Image quality. Pass an integer between 0 to 100. Defaults to 100.
Expand Down Expand Up @@ -433,7 +433,7 @@ avatars
avatars
.command(`get-credit-card`)
.description(`The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings. When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px. `)
.requiredOption(`--code <code>`, `Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro.`)
.requiredOption(`--code <code>`, `Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro, rupay.`)
.option(`--width <width>`, `Image width. Pass an integer between 0 to 2000. Defaults to 100.`, parseInteger)
.option(`--height <height>`, `Image height. Pass an integer between 0 to 2000. Defaults to 100.`, parseInteger)
.option(`--quality <quality>`, `Image quality. Pass an integer between 0 to 100. Defaults to 100.`, parseInteger)
Expand Down
18 changes: 9 additions & 9 deletions lib/commands/databases.js
Original file line number Diff line number Diff line change
Expand Up @@ -958,9 +958,9 @@ const databasesCreateFloatAttribute = async ({databaseId,collectionId,key,requir
* @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
* @property {string} key Attribute Key.
* @property {boolean} required Is attribute required?
* @property {number} xdefault Default value for attribute when not provided. Cannot be set when attribute is required.
* @property {number} min Minimum value to enforce on new documents
* @property {number} max Maximum value to enforce on new documents
* @property {number} xdefault Default value for attribute when not provided. Cannot be set when attribute is required.
* @property {string} newKey New attribute key.
* @property {boolean} overrideForCli
* @property {boolean} parseOutput
Expand All @@ -970,7 +970,7 @@ const databasesCreateFloatAttribute = async ({databaseId,collectionId,key,requir
/**
* @param {DatabasesUpdateFloatAttributeRequestParams} params
*/
const databasesUpdateFloatAttribute = async ({databaseId,collectionId,key,required,min,max,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
const databasesUpdateFloatAttribute = async ({databaseId,collectionId,key,required,xdefault,min,max,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
let client = !sdk ? await sdkForProject() :
sdk;
let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/float/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
Expand Down Expand Up @@ -1067,9 +1067,9 @@ const databasesCreateIntegerAttribute = async ({databaseId,collectionId,key,requ
* @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
* @property {string} key Attribute Key.
* @property {boolean} required Is attribute required?
* @property {number} xdefault Default value for attribute when not provided. Cannot be set when attribute is required.
* @property {number} min Minimum value to enforce on new documents
* @property {number} max Maximum value to enforce on new documents
* @property {number} xdefault Default value for attribute when not provided. Cannot be set when attribute is required.
* @property {string} newKey New attribute key.
* @property {boolean} overrideForCli
* @property {boolean} parseOutput
Expand All @@ -1079,7 +1079,7 @@ const databasesCreateIntegerAttribute = async ({databaseId,collectionId,key,requ
/**
* @param {DatabasesUpdateIntegerAttributeRequestParams} params
*/
const databasesUpdateIntegerAttribute = async ({databaseId,collectionId,key,required,min,max,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
const databasesUpdateIntegerAttribute = async ({databaseId,collectionId,key,required,xdefault,min,max,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
let client = !sdk ? await sdkForProject() :
sdk;
let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/integer/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
Expand Down Expand Up @@ -2316,9 +2316,9 @@ databases
.requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
.requiredOption(`--key <key>`, `Attribute Key.`)
.requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
.requiredOption(`--min <min>`, `Minimum value to enforce on new documents`, parseInteger)
.requiredOption(`--max <max>`, `Maximum value to enforce on new documents`, parseInteger)
.option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`, parseInteger)
.option(`--min <min>`, `Minimum value to enforce on new documents`, parseInteger)
.option(`--max <max>`, `Maximum value to enforce on new documents`, parseInteger)
.option(`--new-key <new-key>`, `New attribute key.`)
.action(actionRunner(databasesUpdateFloatAttribute))

Expand All @@ -2342,9 +2342,9 @@ databases
.requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
.requiredOption(`--key <key>`, `Attribute Key.`)
.requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
.requiredOption(`--min <min>`, `Minimum value to enforce on new documents`, parseInteger)
.requiredOption(`--max <max>`, `Maximum value to enforce on new documents`, parseInteger)
.option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`, parseInteger)
.option(`--min <min>`, `Minimum value to enforce on new documents`, parseInteger)
.option(`--max <max>`, `Maximum value to enforce on new documents`, parseInteger)
.option(`--new-key <new-key>`, `New attribute key.`)
.action(actionRunner(databasesUpdateIntegerAttribute))

Expand Down Expand Up @@ -2467,7 +2467,7 @@ databases

databases
.command(`create-document`)
.description(`Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console.`)
.description(`Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. `)
.requiredOption(`--database-id <database-id>`, `Database ID.`)
.requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents.`)
.requiredOption(`--document-id <document-id>`, `Document ID. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
Expand Down
93 changes: 49 additions & 44 deletions lib/commands/health.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,36 +223,6 @@ const healthGetPubSub = async ({parseOutput = true, overrideForCli = false, sdk

}

/**
* @typedef {Object} HealthGetQueueRequestParams
* @property {boolean} overrideForCli
* @property {boolean} parseOutput
* @property {libClient | undefined} sdk
*/

/**
* @param {HealthGetQueueRequestParams} params
*/
const healthGetQueue = async ({parseOutput = true, overrideForCli = false, sdk = undefined}) => {
let client = !sdk ? await sdkForProject() :
sdk;
let apiPath = '/health/queue';
let payload = {};

let response = undefined;

response = await client.call('get', apiPath, {
'content-type': 'application/json',
}, payload);

if (parseOutput) {
parse(response)
}

return response;

}

/**
* @typedef {Object} HealthGetQueueBuildsRequestParams
* @property {number} threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
Expand Down Expand Up @@ -598,6 +568,40 @@ const healthGetQueueMigrations = async ({threshold,parseOutput = true, overrideF

}

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

/**
* @param {HealthGetQueueStatsResourcesRequestParams} params
*/
const healthGetQueueStatsResources = async ({threshold,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
let client = !sdk ? await sdkForProject() :
sdk;
let apiPath = '/health/queue/stats-resources';
let payload = {};
if (typeof threshold !== 'undefined') {
payload['threshold'] = threshold;
}

let response = undefined;

response = await client.call('get', apiPath, {
'content-type': 'application/json',
}, payload);

if (parseOutput) {
parse(response)
}

return response;

}

/**
* @typedef {Object} HealthGetQueueUsageRequestParams
* @property {number} threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
Expand All @@ -612,7 +616,7 @@ const healthGetQueueMigrations = async ({threshold,parseOutput = true, overrideF
const healthGetQueueUsage = async ({threshold,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
let client = !sdk ? await sdkForProject() :
sdk;
let apiPath = '/health/queue/usage';
let apiPath = '/health/queue/stats-usage';
let payload = {};
if (typeof threshold !== 'undefined') {
payload['threshold'] = threshold;
Expand All @@ -633,20 +637,20 @@ const healthGetQueueUsage = async ({threshold,parseOutput = true, overrideForCli
}

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

/**
* @param {HealthGetQueueUsageDumpRequestParams} params
* @param {HealthGetQueueStatsUsageDumpRequestParams} params
*/
const healthGetQueueUsageDump = async ({threshold,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
const healthGetQueueStatsUsageDump = async ({threshold,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
let client = !sdk ? await sdkForProject() :
sdk;
let apiPath = '/health/queue/usage-dump';
let apiPath = '/health/queue/stats-usage-dump';
let payload = {};
if (typeof threshold !== 'undefined') {
payload['threshold'] = threshold;
Expand Down Expand Up @@ -821,11 +825,6 @@ health
.description(`Check the Appwrite pub-sub servers are up and connection is successful.`)
.action(actionRunner(healthGetPubSub))

health
.command(`get-queue`)
.description(`Check the Appwrite queue messaging servers are up and connection is successful.`)
.action(actionRunner(healthGetQueue))

health
.command(`get-queue-builds`)
.description(`Get the number of builds that are waiting to be processed in the Appwrite internal queue server.`)
Expand Down Expand Up @@ -888,17 +887,23 @@ health
.option(`--threshold <threshold>`, `Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.`, parseInteger)
.action(actionRunner(healthGetQueueMigrations))

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

health
.command(`get-queue-usage`)
.description(`Get the number of 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))

health
.command(`get-queue-usage-dump`)
.command(`get-queue-stats-usage-dump`)
.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(healthGetQueueUsageDump))
.action(actionRunner(healthGetQueueStatsUsageDump))

health
.command(`get-queue-webhooks`)
Expand Down Expand Up @@ -929,7 +934,6 @@ module.exports = {
healthGetCertificate,
healthGetDB,
healthGetPubSub,
healthGetQueue,
healthGetQueueBuilds,
healthGetQueueCertificates,
healthGetQueueDatabases,
Expand All @@ -940,8 +944,9 @@ module.exports = {
healthGetQueueMails,
healthGetQueueMessaging,
healthGetQueueMigrations,
healthGetQueueStatsResources,
healthGetQueueUsage,
healthGetQueueUsageDump,
healthGetQueueStatsUsageDump,
healthGetQueueWebhooks,
healthGetStorage,
healthGetStorageLocal,
Expand Down
Loading