From 0c806588ca46d48cb6916ed503f8bb4ef9f5a92f Mon Sep 17 00:00:00 2001 From: Darshan Date: Wed, 14 Jan 2026 07:28:34 +0000 Subject: [PATCH 1/6] updates: sync as per latest cloud specs --- .github/workflows/publish.yml | 17 +- CHANGELOG.md | 11 - LICENSE | 2 +- README.md | 6 +- docs/examples/account/create-jwt.md | 4 +- docs/examples/avatars/get-screenshot.md | 2 +- docs/examples/backups/create-archive.md | 13 + docs/examples/backups/create-policy.md | 18 + docs/examples/backups/create-restoration.md | 15 + docs/examples/backups/delete-archive.md | 12 + docs/examples/backups/delete-policy.md | 12 + docs/examples/backups/get-archive.md | 12 + docs/examples/backups/get-policy.md | 12 + docs/examples/backups/get-restoration.md | 12 + docs/examples/backups/list-archives.md | 12 + docs/examples/backups/list-policies.md | 12 + docs/examples/backups/list-restorations.md | 12 + docs/examples/backups/update-policy.md | 16 + docs/examples/databases/update-document.md | 8 +- docs/examples/databases/update-documents.md | 8 +- docs/examples/databases/upsert-document.md | 8 +- .../get-queue-billing-project-aggregation.md | 12 + .../get-queue-billing-team-aggregation.md | 12 + .../health/get-queue-priority-builds.md | 12 + .../health/get-queue-region-manager.md | 12 + docs/examples/health/get-queue-threats.md | 12 + docs/examples/organizations/delete.md | 12 + .../estimation-delete-organization.md | 12 + docs/examples/tablesdb/update-row.md | 8 +- docs/examples/tablesdb/update-rows.md | 8 +- docs/examples/tablesdb/upsert-row.md | 8 +- package.json | 6 +- src/client.ts | 16 +- src/enums/build-runtime.ts | 3 - src/enums/name.ts | 1 + src/enums/o-auth-provider.ts | 3 + src/enums/output.ts | 9 - src/enums/runtime.ts | 3 - src/index.ts | 5 +- src/models.ts | 524 +++++++++--- src/query.ts | 25 +- src/services/account.ts | 34 +- src/services/avatars.ts | 242 +++--- src/services/backups.ts | 752 ++++++++++++++++++ src/services/databases.ts | 261 +++--- src/services/functions.ts | 36 +- src/services/health.ts | 467 ++++++++--- src/services/messaging.ts | 108 +-- src/services/organizations.ts | 115 +++ src/services/sites.ts | 36 +- src/services/storage.ts | 114 +-- src/services/tables-db.ts | 248 +++--- src/services/users.ts | 78 +- 53 files changed, 2589 insertions(+), 829 deletions(-) create mode 100644 docs/examples/backups/create-archive.md create mode 100644 docs/examples/backups/create-policy.md create mode 100644 docs/examples/backups/create-restoration.md create mode 100644 docs/examples/backups/delete-archive.md create mode 100644 docs/examples/backups/delete-policy.md create mode 100644 docs/examples/backups/get-archive.md create mode 100644 docs/examples/backups/get-policy.md create mode 100644 docs/examples/backups/get-restoration.md create mode 100644 docs/examples/backups/list-archives.md create mode 100644 docs/examples/backups/list-policies.md create mode 100644 docs/examples/backups/list-restorations.md create mode 100644 docs/examples/backups/update-policy.md create mode 100644 docs/examples/health/get-queue-billing-project-aggregation.md create mode 100644 docs/examples/health/get-queue-billing-team-aggregation.md create mode 100644 docs/examples/health/get-queue-priority-builds.md create mode 100644 docs/examples/health/get-queue-region-manager.md create mode 100644 docs/examples/health/get-queue-threats.md create mode 100644 docs/examples/organizations/delete.md create mode 100644 docs/examples/organizations/estimation-delete-organization.md delete mode 100644 src/enums/output.ts create mode 100644 src/services/backups.ts create mode 100644 src/services/organizations.ts diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 9e8e716..41c7a69 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -5,6 +5,10 @@ on: types: [published] workflow_dispatch: +permissions: + id-token: write + contents: read + jobs: publish: runs-on: ubuntu-latest @@ -12,14 +16,15 @@ jobs: steps: - uses: actions/checkout@v4 - # Setup Node.js environment - name: Use Node.js uses: actions/setup-node@v4 with: - node-version: '20.x' + node-version: '22' registry-url: 'https://registry.npmjs.org' - # Determine release tag based on the tag name + - name: Update npm to latest version for OIDC support + run: npm install -g npm@latest + - name: Determine release tag id: release_tag run: | @@ -29,14 +34,10 @@ jobs: echo "tag=latest" >> "$GITHUB_OUTPUT" fi - # Install dependencies (if any) and build your project (if necessary) - name: Install dependencies and build run: | npm install npm run build - # Publish to NPM with the appropriate tag - name: Publish - run: npm publish --tag ${{ steps.release_tag.outputs.tag }} - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_NO_ORG }} + run: npm publish --provenance --access public --tag ${{ steps.release_tag.outputs.tag }} diff --git a/CHANGELOG.md b/CHANGELOG.md index da425ad..419b052 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,16 +1,5 @@ # Change Log -## 21.1.0 - -* Added ability to create columns and indexes synchronously while creating a table - -## 21.0.0 - -* Rename `VCSDeploymentType` enum to `VCSReferenceType` -* Change `createTemplateDeployment` method signature: replace `version` parameter with `type` (TemplateReferenceType) and `reference` parameters -* Add `getScreenshot` method to `Avatars` service -* Add `Theme`, `Timezone` and `Output` enums - ## 20.3.0 * Add `total` parameter to list queries allowing skipping counting rows in a table for improved performance diff --git a/LICENSE b/LICENSE index c1602fc..6f8702b 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2025 Appwrite (https://appwrite.io) and individual contributors. +Copyright (c) 2026 Appwrite (https://appwrite.io) and individual contributors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/README.md b/README.md index 9cb41a6..764e488 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,17 @@ # Appwrite Node.js SDK ![License](https://img.shields.io/github/license/appwrite/sdk-for-node.svg?style=flat-square) -![Version](https://img.shields.io/badge/api%20version-1.8.0-blue.svg?style=flat-square) +![Version](https://img.shields.io/badge/api%20version-1.8.1-blue.svg?style=flat-square) [![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator) [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord) -**This SDK is compatible with Appwrite server version 1.8.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-node/releases).** +**This SDK is compatible with Appwrite server version latest. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-node/releases).** > This is the Node.js SDK for integrating with Appwrite from your Node.js server-side code. If you're looking to integrate from the browser, you should check [appwrite/sdk-for-web](https://github.com/appwrite/sdk-for-web) -Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Node.js SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs) +Appwrite is an open-source backend as a service server that abstracts and simplifies complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Node.js SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs) ![Appwrite](https://github.com/appwrite/appwrite/raw/main/public/images/github.png) diff --git a/docs/examples/account/create-jwt.md b/docs/examples/account/create-jwt.md index 76d52e1..f5ddd7b 100644 --- a/docs/examples/account/create-jwt.md +++ b/docs/examples/account/create-jwt.md @@ -7,4 +7,6 @@ const client = new sdk.Client() const account = new sdk.Account(client); -const result = await account.createJWT(); +const result = await account.createJWT({ + duration: 0 // optional +}); diff --git a/docs/examples/avatars/get-screenshot.md b/docs/examples/avatars/get-screenshot.md index dc63102..537670c 100644 --- a/docs/examples/avatars/get-screenshot.md +++ b/docs/examples/avatars/get-screenshot.md @@ -30,5 +30,5 @@ const result = await avatars.getScreenshot({ width: 800, // optional height: 600, // optional quality: 85, // optional - output: sdk.Output.Jpg // optional + output: sdk.ImageFormat.Jpg // optional }); diff --git a/docs/examples/backups/create-archive.md b/docs/examples/backups/create-archive.md new file mode 100644 index 0000000..5c7764f --- /dev/null +++ b/docs/examples/backups/create-archive.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const backups = new sdk.Backups(client); + +const result = await backups.createArchive({ + services: [], + resourceId: '' // optional +}); diff --git a/docs/examples/backups/create-policy.md b/docs/examples/backups/create-policy.md new file mode 100644 index 0000000..9314301 --- /dev/null +++ b/docs/examples/backups/create-policy.md @@ -0,0 +1,18 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const backups = new sdk.Backups(client); + +const result = await backups.createPolicy({ + policyId: '', + services: [], + retention: 1, + schedule: '', + name: '', // optional + resourceId: '', // optional + enabled: false // optional +}); diff --git a/docs/examples/backups/create-restoration.md b/docs/examples/backups/create-restoration.md new file mode 100644 index 0000000..6791302 --- /dev/null +++ b/docs/examples/backups/create-restoration.md @@ -0,0 +1,15 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const backups = new sdk.Backups(client); + +const result = await backups.createRestoration({ + archiveId: '', + services: [], + newResourceId: '', // optional + newResourceName: '' // optional +}); diff --git a/docs/examples/backups/delete-archive.md b/docs/examples/backups/delete-archive.md new file mode 100644 index 0000000..5127449 --- /dev/null +++ b/docs/examples/backups/delete-archive.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const backups = new sdk.Backups(client); + +const result = await backups.deleteArchive({ + archiveId: '' +}); diff --git a/docs/examples/backups/delete-policy.md b/docs/examples/backups/delete-policy.md new file mode 100644 index 0000000..c22b1ed --- /dev/null +++ b/docs/examples/backups/delete-policy.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const backups = new sdk.Backups(client); + +const result = await backups.deletePolicy({ + policyId: '' +}); diff --git a/docs/examples/backups/get-archive.md b/docs/examples/backups/get-archive.md new file mode 100644 index 0000000..046bd4b --- /dev/null +++ b/docs/examples/backups/get-archive.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const backups = new sdk.Backups(client); + +const result = await backups.getArchive({ + archiveId: '' +}); diff --git a/docs/examples/backups/get-policy.md b/docs/examples/backups/get-policy.md new file mode 100644 index 0000000..1a3610d --- /dev/null +++ b/docs/examples/backups/get-policy.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const backups = new sdk.Backups(client); + +const result = await backups.getPolicy({ + policyId: '' +}); diff --git a/docs/examples/backups/get-restoration.md b/docs/examples/backups/get-restoration.md new file mode 100644 index 0000000..181d4cd --- /dev/null +++ b/docs/examples/backups/get-restoration.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const backups = new sdk.Backups(client); + +const result = await backups.getRestoration({ + restorationId: '' +}); diff --git a/docs/examples/backups/list-archives.md b/docs/examples/backups/list-archives.md new file mode 100644 index 0000000..31567b7 --- /dev/null +++ b/docs/examples/backups/list-archives.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const backups = new sdk.Backups(client); + +const result = await backups.listArchives({ + queries: [] // optional +}); diff --git a/docs/examples/backups/list-policies.md b/docs/examples/backups/list-policies.md new file mode 100644 index 0000000..ef22e42 --- /dev/null +++ b/docs/examples/backups/list-policies.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const backups = new sdk.Backups(client); + +const result = await backups.listPolicies({ + queries: [] // optional +}); diff --git a/docs/examples/backups/list-restorations.md b/docs/examples/backups/list-restorations.md new file mode 100644 index 0000000..59b8978 --- /dev/null +++ b/docs/examples/backups/list-restorations.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const backups = new sdk.Backups(client); + +const result = await backups.listRestorations({ + queries: [] // optional +}); diff --git a/docs/examples/backups/update-policy.md b/docs/examples/backups/update-policy.md new file mode 100644 index 0000000..7938912 --- /dev/null +++ b/docs/examples/backups/update-policy.md @@ -0,0 +1,16 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const backups = new sdk.Backups(client); + +const result = await backups.updatePolicy({ + policyId: '', + name: '', // optional + retention: 1, // optional + schedule: '', // optional + enabled: false // optional +}); diff --git a/docs/examples/databases/update-document.md b/docs/examples/databases/update-document.md index d33d78d..7e1a8c5 100644 --- a/docs/examples/databases/update-document.md +++ b/docs/examples/databases/update-document.md @@ -11,7 +11,13 @@ const result = await databases.updateDocument({ databaseId: '', collectionId: '', documentId: '', - data: {}, // optional + data: { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 33, + "isAdmin": false + }, // optional permissions: [sdk.Permission.read(sdk.Role.any())], // optional transactionId: '' // optional }); diff --git a/docs/examples/databases/update-documents.md b/docs/examples/databases/update-documents.md index dc79e43..038ed1a 100644 --- a/docs/examples/databases/update-documents.md +++ b/docs/examples/databases/update-documents.md @@ -10,7 +10,13 @@ const databases = new sdk.Databases(client); const result = await databases.updateDocuments({ databaseId: '', collectionId: '', - data: {}, // optional + data: { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 33, + "isAdmin": false + }, // optional queries: [], // optional transactionId: '' // optional }); diff --git a/docs/examples/databases/upsert-document.md b/docs/examples/databases/upsert-document.md index 8fe4b35..55156bd 100644 --- a/docs/examples/databases/upsert-document.md +++ b/docs/examples/databases/upsert-document.md @@ -11,7 +11,13 @@ const result = await databases.upsertDocument({ databaseId: '', collectionId: '', documentId: '', - data: {}, + data: { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + }, // optional permissions: [sdk.Permission.read(sdk.Role.any())], // optional transactionId: '' // optional }); diff --git a/docs/examples/health/get-queue-billing-project-aggregation.md b/docs/examples/health/get-queue-billing-project-aggregation.md new file mode 100644 index 0000000..c1cc1a0 --- /dev/null +++ b/docs/examples/health/get-queue-billing-project-aggregation.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const health = new sdk.Health(client); + +const result = await health.getQueueBillingProjectAggregation({ + threshold: null // optional +}); diff --git a/docs/examples/health/get-queue-billing-team-aggregation.md b/docs/examples/health/get-queue-billing-team-aggregation.md new file mode 100644 index 0000000..9ebea64 --- /dev/null +++ b/docs/examples/health/get-queue-billing-team-aggregation.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const health = new sdk.Health(client); + +const result = await health.getQueueBillingTeamAggregation({ + threshold: null // optional +}); diff --git a/docs/examples/health/get-queue-priority-builds.md b/docs/examples/health/get-queue-priority-builds.md new file mode 100644 index 0000000..79086df --- /dev/null +++ b/docs/examples/health/get-queue-priority-builds.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const health = new sdk.Health(client); + +const result = await health.getQueuePriorityBuilds({ + threshold: null // optional +}); diff --git a/docs/examples/health/get-queue-region-manager.md b/docs/examples/health/get-queue-region-manager.md new file mode 100644 index 0000000..93a968c --- /dev/null +++ b/docs/examples/health/get-queue-region-manager.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const health = new sdk.Health(client); + +const result = await health.getQueueRegionManager({ + threshold: null // optional +}); diff --git a/docs/examples/health/get-queue-threats.md b/docs/examples/health/get-queue-threats.md new file mode 100644 index 0000000..3a2ab75 --- /dev/null +++ b/docs/examples/health/get-queue-threats.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const health = new sdk.Health(client); + +const result = await health.getQueueThreats({ + threshold: null // optional +}); diff --git a/docs/examples/organizations/delete.md b/docs/examples/organizations/delete.md new file mode 100644 index 0000000..891c7fc --- /dev/null +++ b/docs/examples/organizations/delete.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setSession(''); // The user session to authenticate with + +const organizations = new sdk.Organizations(client); + +const result = await organizations.delete({ + organizationId: '' +}); diff --git a/docs/examples/organizations/estimation-delete-organization.md b/docs/examples/organizations/estimation-delete-organization.md new file mode 100644 index 0000000..9a4db46 --- /dev/null +++ b/docs/examples/organizations/estimation-delete-organization.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setSession(''); // The user session to authenticate with + +const organizations = new sdk.Organizations(client); + +const result = await organizations.estimationDeleteOrganization({ + organizationId: '' +}); diff --git a/docs/examples/tablesdb/update-row.md b/docs/examples/tablesdb/update-row.md index d5d2ee3..8c003bf 100644 --- a/docs/examples/tablesdb/update-row.md +++ b/docs/examples/tablesdb/update-row.md @@ -11,7 +11,13 @@ const result = await tablesDB.updateRow({ databaseId: '', tableId: '', rowId: '', - data: {}, // optional + data: { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 33, + "isAdmin": false + }, // optional permissions: [sdk.Permission.read(sdk.Role.any())], // optional transactionId: '' // optional }); diff --git a/docs/examples/tablesdb/update-rows.md b/docs/examples/tablesdb/update-rows.md index d66fc28..b41f0c2 100644 --- a/docs/examples/tablesdb/update-rows.md +++ b/docs/examples/tablesdb/update-rows.md @@ -10,7 +10,13 @@ const tablesDB = new sdk.TablesDB(client); const result = await tablesDB.updateRows({ databaseId: '', tableId: '', - data: {}, // optional + data: { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 33, + "isAdmin": false + }, // optional queries: [], // optional transactionId: '' // optional }); diff --git a/docs/examples/tablesdb/upsert-row.md b/docs/examples/tablesdb/upsert-row.md index f48b0da..2905b31 100644 --- a/docs/examples/tablesdb/upsert-row.md +++ b/docs/examples/tablesdb/upsert-row.md @@ -11,7 +11,13 @@ const result = await tablesDB.upsertRow({ databaseId: '', tableId: '', rowId: '', - data: {}, // optional + data: { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 33, + "isAdmin": false + }, // optional permissions: [sdk.Permission.read(sdk.Role.any())], // optional transactionId: '' // optional }); diff --git a/package.json b/package.json index 560a05f..52dd193 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "node-appwrite", "homepage": "https://appwrite.io/support", - "description": "Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API", - "version": "21.1.0", + "description": "Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API", + "version": "26.0.0", "license": "BSD-3-Clause", "main": "dist/index.js", "type": "commonjs", @@ -41,6 +41,7 @@ "url": "https://github.com/appwrite/sdk-for-node" }, "devDependencies": { + "@types/json-bigint": "1.0.4", "@types/node": "20.11.25", "tsup": "7.2.0", "esbuild-plugin-file-path-extensions": "^2.0.0", @@ -48,6 +49,7 @@ "typescript": "5.4.2" }, "dependencies": { + "json-bigint": "1.0.0", "node-fetch-native-with-agent": "1.7.2" } } diff --git a/src/client.ts b/src/client.ts index 564b24a..e5c82bd 100644 --- a/src/client.ts +++ b/src/client.ts @@ -1,6 +1,8 @@ import { fetch, FormData, File } from 'node-fetch-native-with-agent'; import { createAgent } from 'node-fetch-native-with-agent/agent'; import { Models } from './models'; +import JSONbigModule from 'json-bigint'; +const JSONbig = JSONbigModule({ useNativeBigInt: true }); type Payload = { [key: string]: any; @@ -33,7 +35,7 @@ class AppwriteException extends Error { } function getUserAgent() { - let ua = 'AppwriteNodeJSSDK/21.1.0'; + let ua = 'AppwriteNodeJSSDK/26.0.0'; // `process` is a global in Node.js, but not fully available in all runtimes. const platform: string[] = []; @@ -82,7 +84,7 @@ class Client { 'x-sdk-name': 'Node.js', 'x-sdk-platform': 'server', 'x-sdk-language': 'nodejs', - 'x-sdk-version': '21.1.0', + 'x-sdk-version': '26.0.0', 'user-agent' : getUserAgent(), 'X-Appwrite-Response-Format': '1.8.0', }; @@ -97,6 +99,10 @@ class Client { * @returns {this} */ setEndpoint(endpoint: string): this { + if (!endpoint || typeof endpoint !== 'string') { + throw new AppwriteException('Endpoint must be a valid string'); + } + if (!endpoint.startsWith('http://') && !endpoint.startsWith('https://')) { throw new AppwriteException('Invalid endpoint URL: ' + endpoint); } @@ -238,7 +244,7 @@ class Client { } else { switch (headers['content-type']) { case 'application/json': - options.body = JSON.stringify(params); + options.body = JSONbig.stringify(params); break; case 'multipart/form-data': @@ -345,7 +351,7 @@ class Client { } if (response.headers.get('content-type')?.includes('application/json')) { - data = await response.json(); + data = JSONbig.parse(await response.text()); } else if (responseType === 'arrayBuffer') { data = await response.arrayBuffer(); } else { @@ -357,7 +363,7 @@ class Client { if (400 <= response.status) { let responseText = ''; if (response.headers.get('content-type')?.includes('application/json') || responseType === 'arrayBuffer') { - responseText = JSON.stringify(data); + responseText = JSONbig.stringify(data); } else { responseText = data?.message; } diff --git a/src/enums/build-runtime.ts b/src/enums/build-runtime.ts index 25dca77..e25a893 100644 --- a/src/enums/build-runtime.ts +++ b/src/enums/build-runtime.ts @@ -21,9 +21,6 @@ export enum BuildRuntime { Python312 = 'python-3.12', Pythonml311 = 'python-ml-3.11', Pythonml312 = 'python-ml-3.12', - Deno121 = 'deno-1.21', - Deno124 = 'deno-1.24', - Deno135 = 'deno-1.35', Deno140 = 'deno-1.40', Deno146 = 'deno-1.46', Deno20 = 'deno-2.0', diff --git a/src/enums/name.ts b/src/enums/name.ts index 76e8469..8cd297b 100644 --- a/src/enums/name.ts +++ b/src/enums/name.ts @@ -9,6 +9,7 @@ export enum Name { V1webhooks = 'v1-webhooks', V1certificates = 'v1-certificates', V1builds = 'v1-builds', + V1screenshots = 'v1-screenshots', V1messaging = 'v1-messaging', V1migrations = 'v1-migrations', } \ No newline at end of file diff --git a/src/enums/o-auth-provider.ts b/src/enums/o-auth-provider.ts index 7a3fcb3..b13ceb3 100644 --- a/src/enums/o-auth-provider.ts +++ b/src/enums/o-auth-provider.ts @@ -39,4 +39,7 @@ export enum OAuthProvider { Zoho = 'zoho', Zoom = 'zoom', Mock = 'mock', + Mockunverified = 'mock-unverified', + GithubImagine = 'githubImagine', + GoogleImagine = 'googleImagine', } \ No newline at end of file diff --git a/src/enums/output.ts b/src/enums/output.ts deleted file mode 100644 index c339a51..0000000 --- a/src/enums/output.ts +++ /dev/null @@ -1,9 +0,0 @@ -export enum Output { - Jpg = 'jpg', - Jpeg = 'jpeg', - Png = 'png', - Webp = 'webp', - Heic = 'heic', - Avif = 'avif', - Gif = 'gif', -} \ No newline at end of file diff --git a/src/enums/runtime.ts b/src/enums/runtime.ts index ecdc452..ee7606f 100644 --- a/src/enums/runtime.ts +++ b/src/enums/runtime.ts @@ -21,9 +21,6 @@ export enum Runtime { Python312 = 'python-3.12', Pythonml311 = 'python-ml-3.11', Pythonml312 = 'python-ml-3.12', - Deno121 = 'deno-1.21', - Deno124 = 'deno-1.24', - Deno135 = 'deno-1.35', Deno140 = 'deno-1.40', Deno146 = 'deno-1.46', Deno20 = 'deno-2.0', diff --git a/src/index.ts b/src/index.ts index 7dbc903..653a21e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,12 +1,14 @@ export { Client, Query, AppwriteException } from './client'; export { Account } from './services/account'; export { Avatars } from './services/avatars'; +export { Backups } from './services/backups'; export { Databases } from './services/databases'; export { Functions } from './services/functions'; export { Graphql } from './services/graphql'; export { Health } from './services/health'; export { Locale } from './services/locale'; export { Messaging } from './services/messaging'; +export { Organizations } from './services/organizations'; export { Sites } from './services/sites'; export { Storage } from './services/storage'; export { TablesDB } from './services/tables-db'; @@ -27,7 +29,7 @@ export { CreditCard } from './enums/credit-card'; export { Flag } from './enums/flag'; export { Theme } from './enums/theme'; export { Timezone } from './enums/timezone'; -export { Output } from './enums/output'; +export { ImageFormat } from './enums/image-format'; export { RelationshipType } from './enums/relationship-type'; export { RelationMutate } from './enums/relation-mutate'; export { IndexType } from './enums/index-type'; @@ -44,7 +46,6 @@ export { BuildRuntime } from './enums/build-runtime'; export { Adapter } from './enums/adapter'; export { Compression } from './enums/compression'; export { ImageGravity } from './enums/image-gravity'; -export { ImageFormat } from './enums/image-format'; export { PasswordHash } from './enums/password-hash'; export { MessagingProviderType } from './enums/messaging-provider-type'; export { DatabaseType } from './enums/database-type'; diff --git a/src/models.ts b/src/models.ts index 7c27b05..a28d325 100644 --- a/src/models.ts +++ b/src/models.ts @@ -23,7 +23,7 @@ export namespace Models { /** * Total number of rows that matched your query. */ - total: number; + total: number | bigint; /** * List of rows. */ @@ -37,7 +37,7 @@ export namespace Models { /** * Total number of documents that matched your query. */ - total: number; + total: number | bigint; /** * List of documents. */ @@ -51,7 +51,7 @@ export namespace Models { /** * Total number of tables that matched your query. */ - total: number; + total: number | bigint; /** * List of tables. */ @@ -65,7 +65,7 @@ export namespace Models { /** * Total number of collections that matched your query. */ - total: number; + total: number | bigint; /** * List of collections. */ @@ -79,7 +79,7 @@ export namespace Models { /** * Total number of databases that matched your query. */ - total: number; + total: number | bigint; /** * List of databases. */ @@ -93,7 +93,7 @@ export namespace Models { /** * Total number of indexes that matched your query. */ - total: number; + total: number | bigint; /** * List of indexes. */ @@ -107,7 +107,7 @@ export namespace Models { /** * Total number of indexes that matched your query. */ - total: number; + total: number | bigint; /** * List of indexes. */ @@ -121,7 +121,7 @@ export namespace Models { /** * Total number of users that matched your query. */ - total: number; + total: number | bigint; /** * List of users. */ @@ -135,7 +135,7 @@ export namespace Models { /** * Total number of sessions that matched your query. */ - total: number; + total: number | bigint; /** * List of sessions. */ @@ -149,7 +149,7 @@ export namespace Models { /** * Total number of identities that matched your query. */ - total: number; + total: number | bigint; /** * List of identities. */ @@ -163,7 +163,7 @@ export namespace Models { /** * Total number of logs that matched your query. */ - total: number; + total: number | bigint; /** * List of logs. */ @@ -177,7 +177,7 @@ export namespace Models { /** * Total number of files that matched your query. */ - total: number; + total: number | bigint; /** * List of files. */ @@ -191,7 +191,7 @@ export namespace Models { /** * Total number of buckets that matched your query. */ - total: number; + total: number | bigint; /** * List of buckets. */ @@ -205,7 +205,7 @@ export namespace Models { /** * Total number of tokens that matched your query. */ - total: number; + total: number | bigint; /** * List of tokens. */ @@ -219,7 +219,7 @@ export namespace Models { /** * Total number of teams that matched your query. */ - total: number; + total: number | bigint; /** * List of teams. */ @@ -233,7 +233,7 @@ export namespace Models { /** * Total number of memberships that matched your query. */ - total: number; + total: number | bigint; /** * List of memberships. */ @@ -247,7 +247,7 @@ export namespace Models { /** * Total number of sites that matched your query. */ - total: number; + total: number | bigint; /** * List of sites. */ @@ -261,7 +261,7 @@ export namespace Models { /** * Total number of functions that matched your query. */ - total: number; + total: number | bigint; /** * List of functions. */ @@ -275,7 +275,7 @@ export namespace Models { /** * Total number of frameworks that matched your query. */ - total: number; + total: number | bigint; /** * List of frameworks. */ @@ -289,7 +289,7 @@ export namespace Models { /** * Total number of runtimes that matched your query. */ - total: number; + total: number | bigint; /** * List of runtimes. */ @@ -303,7 +303,7 @@ export namespace Models { /** * Total number of deployments that matched your query. */ - total: number; + total: number | bigint; /** * List of deployments. */ @@ -317,7 +317,7 @@ export namespace Models { /** * Total number of executions that matched your query. */ - total: number; + total: number | bigint; /** * List of executions. */ @@ -331,7 +331,7 @@ export namespace Models { /** * Total number of countries that matched your query. */ - total: number; + total: number | bigint; /** * List of countries. */ @@ -345,7 +345,7 @@ export namespace Models { /** * Total number of continents that matched your query. */ - total: number; + total: number | bigint; /** * List of continents. */ @@ -359,7 +359,7 @@ export namespace Models { /** * Total number of languages that matched your query. */ - total: number; + total: number | bigint; /** * List of languages. */ @@ -373,7 +373,7 @@ export namespace Models { /** * Total number of currencies that matched your query. */ - total: number; + total: number | bigint; /** * List of currencies. */ @@ -387,7 +387,7 @@ export namespace Models { /** * Total number of phones that matched your query. */ - total: number; + total: number | bigint; /** * List of phones. */ @@ -401,7 +401,7 @@ export namespace Models { /** * Total number of variables that matched your query. */ - total: number; + total: number | bigint; /** * List of variables. */ @@ -415,7 +415,7 @@ export namespace Models { /** * Total number of localeCodes that matched your query. */ - total: number; + total: number | bigint; /** * List of localeCodes. */ @@ -429,7 +429,7 @@ export namespace Models { /** * Total number of providers that matched your query. */ - total: number; + total: number | bigint; /** * List of providers. */ @@ -443,7 +443,7 @@ export namespace Models { /** * Total number of messages that matched your query. */ - total: number; + total: number | bigint; /** * List of messages. */ @@ -457,7 +457,7 @@ export namespace Models { /** * Total number of topics that matched your query. */ - total: number; + total: number | bigint; /** * List of topics. */ @@ -471,7 +471,7 @@ export namespace Models { /** * Total number of subscribers that matched your query. */ - total: number; + total: number | bigint; /** * List of subscribers. */ @@ -485,7 +485,7 @@ export namespace Models { /** * Total number of targets that matched your query. */ - total: number; + total: number | bigint; /** * List of targets. */ @@ -499,7 +499,7 @@ export namespace Models { /** * Total number of transactions that matched your query. */ - total: number; + total: number | bigint; /** * List of transactions. */ @@ -513,7 +513,7 @@ export namespace Models { /** * Total number of specifications that matched your query. */ - total: number; + total: number | bigint; /** * List of specifications. */ @@ -548,6 +548,14 @@ export namespace Models { * Database type. */ type: DatabaseType; + /** + * Database backup policies. + */ + policies: Index[]; + /** + * Database backup archives. + */ + archives: Collection[]; } /** @@ -603,7 +611,7 @@ export namespace Models { /** * Total number of attributes in the given collection. */ - total: number; + total: number | bigint; /** * List of attributes. */ @@ -649,7 +657,7 @@ export namespace Models { /** * Attribute size. */ - size: number; + size: number | bigint; /** * Default value for attribute when not provided. Cannot be set when attribute is required. */ @@ -699,15 +707,15 @@ export namespace Models { /** * Minimum value to enforce for new documents. */ - min?: number; + min?: number | bigint; /** * Maximum value to enforce for new documents. */ - max?: number; + max?: number | bigint; /** * Default value for attribute when not provided. Cannot be set when attribute is required. */ - default?: number; + default?: number | bigint; } /** @@ -749,15 +757,15 @@ export namespace Models { /** * Minimum value to enforce for new documents. */ - min?: number; + min?: number | bigint; /** * Maximum value to enforce for new documents. */ - max?: number; + max?: number | bigint; /** * Default value for attribute when not provided. Cannot be set when attribute is required. */ - default?: number; + default?: number | bigint; } /** @@ -1277,7 +1285,7 @@ export namespace Models { /** * Total number of columns in the given table. */ - total: number; + total: number | bigint; /** * List of columns. */ @@ -1323,7 +1331,7 @@ export namespace Models { /** * Column size. */ - size: number; + size: number | bigint; /** * Default value for column when not provided. Cannot be set when column is required. */ @@ -1373,15 +1381,15 @@ export namespace Models { /** * Minimum value to enforce for new documents. */ - min?: number; + min?: number | bigint; /** * Maximum value to enforce for new documents. */ - max?: number; + max?: number | bigint; /** * Default value for column when not provided. Cannot be set when column is required. */ - default?: number; + default?: number | bigint; } /** @@ -1423,15 +1431,15 @@ export namespace Models { /** * Minimum value to enforce for new documents. */ - min?: number; + min?: number | bigint; /** * Maximum value to enforce for new documents. */ - max?: number; + max?: number | bigint; /** * Default value for column when not provided. Cannot be set when column is required. */ - default?: number; + default?: number | bigint; } /** @@ -1937,7 +1945,7 @@ export namespace Models { /** * Index attributes length. */ - lengths: number[]; + lengths: number | bigint[]; /** * Index orders. */ @@ -1983,7 +1991,7 @@ export namespace Models { /** * Index columns length. */ - lengths: number[]; + lengths: number | bigint[]; /** * Index orders. */ @@ -2001,7 +2009,7 @@ export namespace Models { /** * Row automatically incrementing ID. */ - $sequence: number; + $sequence: number | bigint; /** * Table ID. */ @@ -2040,7 +2048,7 @@ export namespace Models { /** * Document automatically incrementing ID. */ - $sequence: number; + $sequence: number | bigint; /** * Collection ID. */ @@ -2291,19 +2299,19 @@ export namespace Models { /** * CPU complexity of computed hash. */ - costCpu: number; + costCpu: number | bigint; /** * Memory complexity of computed hash. */ - costMemory: number; + costMemory: number | bigint; /** * Parallelization of computed hash. */ - costParallel: number; + costParallel: number | bigint; /** * Length used to compute hash. */ - length: number; + length: number | bigint; } /** @@ -2339,15 +2347,15 @@ export namespace Models { /** * Memory used to compute hash. */ - memoryCost: number; + memoryCost: number | bigint; /** * Amount of time consumed to compute hash */ - timeCost: number; + timeCost: number | bigint; /** * Number of threads used to compute hash. */ - threads: number; + threads: number | bigint; } /** @@ -2656,15 +2664,15 @@ export namespace Models { /** * File original size in bytes. */ - sizeOriginal: number; + sizeOriginal: number | bigint; /** * Total number of chunks available */ - chunksTotal: number; + chunksTotal: number | bigint; /** * Total number of chunks uploaded */ - chunksUploaded: number; + chunksUploaded: number | bigint; } /** @@ -2702,13 +2710,13 @@ export namespace Models { /** * Maximum file size supported. */ - maximumFileSize: number; + maximumFileSize: number | bigint; /** * Allowed file extensions. */ allowedFileExtensions: string[]; /** - * Compression algorithm choosen for compression. Will be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd). + * Compression algorithm chosen for compression. Will be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd). */ compression: string; /** @@ -2723,6 +2731,10 @@ export namespace Models { * Image transformations are enabled. */ transformations: boolean; + /** + * Total size of this bucket in bytes. + */ + totalSize: number | bigint; } /** @@ -2782,7 +2794,7 @@ export namespace Models { /** * Total number of team members. */ - total: number; + total: number | bigint; /** * Team preferences as a key-value object */ @@ -2918,7 +2930,7 @@ export namespace Models { /** * Site request timeout in seconds. */ - timeout: number; + timeout: number | bigint; /** * The install command used to install the site dependencies. */ @@ -3048,7 +3060,7 @@ export namespace Models { /** * Function execution timeout in seconds. */ - timeout: number; + timeout: number | bigint; /** * The entrypoint file used to execute the deployment. */ @@ -3212,15 +3224,15 @@ export namespace Models { /** * The code size in bytes. */ - sourceSize: number; + sourceSize: number | bigint; /** * The build output size in bytes. */ - buildSize: number; + buildSize: number | bigint; /** * The total size in bytes (source and build output). */ - totalSize: number; + totalSize: number | bigint; /** * The current build ID. */ @@ -3248,7 +3260,7 @@ export namespace Models { /** * The current build time in seconds. */ - buildDuration: number; + buildDuration: number | bigint; /** * The name of the vcs provider repository */ @@ -3342,7 +3354,7 @@ export namespace Models { /** * HTTP response status code. */ - responseStatusCode: number; + responseStatusCode: number | bigint; /** * HTTP response body. This will return empty unless execution is created as synchronous. */ @@ -3362,7 +3374,7 @@ export namespace Models { /** * Resource(function/site) execution duration in seconds. */ - duration: number; + duration: number | bigint; /** * The scheduled time for execution. If left empty, execution will be queued immediately. */ @@ -3472,11 +3484,11 @@ export namespace Models { /** * Number of decimal digits. */ - decimalDigits: number; + decimalDigits: number | bigint; /** * Currency digit rounding. */ - rounding: number; + rounding: number | bigint; /** * Currency code in [ISO 4217-1](http://en.wikipedia.org/wiki/ISO_4217) three-character format. */ @@ -3526,7 +3538,7 @@ export namespace Models { /** * Amount of actions in the queue. */ - size: number; + size: number | bigint; } /** @@ -3540,7 +3552,7 @@ export namespace Models { /** * Duration in milliseconds how long the health check took. */ - ping: number; + ping: number | bigint; /** * Service status. Possible values are: `pass`, `fail` */ @@ -3584,15 +3596,15 @@ export namespace Models { /** * Current unix timestamp on trustful remote server. */ - remoteTime: number; + remoteTime: number | bigint; /** * Current unix timestamp of local server where Appwrite runs. */ - localTime: number; + localTime: number | bigint; /** * Difference of unix remote and local timestamps in milliseconds. */ - diff: number; + diff: number | bigint; } /** @@ -3616,11 +3628,11 @@ export namespace Models { /** * Memory size in MB. */ - memory: number; + memory: number | bigint; /** * Number of CPUs. */ - cpus: number; + cpus: number | bigint; /** * Is size enabled. */ @@ -3788,7 +3800,7 @@ export namespace Models { /** * Number of recipients the message was delivered to. */ - deliveredTotal: number; + deliveredTotal: number | bigint; /** * Data of the message. */ @@ -3822,15 +3834,15 @@ export namespace Models { /** * Total count of email subscribers subscribed to the topic. */ - emailTotal: number; + emailTotal: number | bigint; /** * Total count of SMS subscribers subscribed to the topic. */ - smsTotal: number; + smsTotal: number | bigint; /** * Total count of push subscribers subscribed to the topic. */ - pushTotal: number; + pushTotal: number | bigint; /** * Subscribe permissions. */ @@ -3860,7 +3872,7 @@ export namespace Models { /** * Number of operations in the transaction. */ - operations: number; + operations: number | bigint; /** * Expiration time in ISO 8601 format. */ @@ -3950,4 +3962,334 @@ export namespace Models { */ expired: boolean; } + + /** + * Archive + */ + export type BackupArchive = { + /** + * Archive ID. + */ + $id: string; + /** + * Archive creation time in ISO 8601 format. + */ + $createdAt: string; + /** + * Archive update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Archive policy ID. + */ + policyId: string; + /** + * Archive size in bytes. + */ + size: number | bigint; + /** + * The status of the archive creation. Possible values: pending, processing, uploading, completed, failed. + */ + status: string; + /** + * The backup start time. + */ + startedAt: string; + /** + * Migration ID. + */ + migrationId: string; + /** + * The services that are backed up by this archive. + */ + services: string[]; + /** + * The resources that are backed up by this archive. + */ + resources: string[]; + /** + * The resource ID to backup. Set only if this archive should backup a single resource. + */ + resourceId?: string; + /** + * The resource type to backup. Set only if this archive should backup a single resource. + */ + resourceType?: string; + } + + /** + * Invoice + */ + export type Invoice = { + /** + * Invoice ID. + */ + $id: string; + /** + * Invoice creation time in ISO 8601 format. + */ + $createdAt: string; + /** + * Invoice update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Invoice permissions. [Learn more about permissions](/docs/permissions). + */ + $permissions: string[]; + /** + * Project ID + */ + teamId: string; + /** + * Aggregation ID + */ + aggregationId: string; + /** + * Billing plan selected. Can be one of `tier-0`, `tier-1` or `tier-2`. + */ + plan: string; + /** + * Usage breakdown per resource + */ + usage: UsageResources[]; + /** + * Invoice Amount + */ + amount: number | bigint; + /** + * Tax percentage + */ + tax: number | bigint; + /** + * Tax amount + */ + taxAmount: number | bigint; + /** + * VAT percentage + */ + vat: number | bigint; + /** + * VAT amount + */ + vatAmount: number | bigint; + /** + * Gross amount after vat, tax, and discounts applied. + */ + grossAmount: number | bigint; + /** + * Credits used. + */ + creditsUsed: number | bigint; + /** + * Currency the invoice is in + */ + currency: string; + /** + * Client secret for processing failed payments in front-end + */ + clientSecret: string; + /** + * Invoice status + */ + status: string; + /** + * Last payment error associated with the invoice + */ + lastError: string; + /** + * Invoice due date. + */ + dueAt: string; + /** + * Beginning date of the invoice + */ + from: string; + /** + * End date of the invoice + */ + to: string; + } + + /** + * backup + */ + export type BackupPolicy = { + /** + * Backup policy ID. + */ + $id: string; + /** + * Backup policy name. + */ + name: string; + /** + * Policy creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Policy update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * The services that are backed up by this policy. + */ + services: string[]; + /** + * The resources that are backed up by this policy. + */ + resources: string[]; + /** + * The resource ID to backup. Set only if this policy should backup a single resource. + */ + resourceId?: string; + /** + * The resource type to backup. Set only if this policy should backup a single resource. + */ + resourceType?: string; + /** + * How many days to keep the backup before it will be automatically deleted. + */ + retention: number | bigint; + /** + * Policy backup schedule in CRON format. + */ + schedule: string; + /** + * Is this policy enabled. + */ + enabled: boolean; + } + + /** + * Restoration + */ + export type BackupRestoration = { + /** + * Restoration ID. + */ + $id: string; + /** + * Restoration creation time in ISO 8601 format. + */ + $createdAt: string; + /** + * Restoration update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Backup archive ID. + */ + archiveId: string; + /** + * Backup policy ID. + */ + policyId: string; + /** + * The status of the restoration. Possible values: pending, downloading, processing, completed, failed. + */ + status: string; + /** + * The backup start time. + */ + startedAt: string; + /** + * Migration ID. + */ + migrationId: string; + /** + * The services that are backed up by this policy. + */ + services: string[]; + /** + * The resources that are backed up by this policy. + */ + resources: string[]; + /** + * Optional data in key-value object. + */ + options: string; + } + + /** + * UsageResource + */ + export type UsageResources = { + /** + * Invoice name + */ + name: string; + /** + * Invoice value + */ + value: number | bigint; + /** + * Invoice amount + */ + amount: number | bigint; + /** + * Invoice rate + */ + rate: number | bigint; + /** + * Invoice description + */ + desc: string; + /** + * Resource ID + */ + resourceId: string; + } + + /** + * EstimationDeleteOrganization + */ + export type EstimationDeleteOrganization = { + /** + * List of unpaid invoices + */ + unpaidInvoices: Invoice[]; + } + + /** + * Backup archive list + */ + export type BackupArchiveList = { + /** + * Total number of archives that matched your query. + */ + total: number | bigint; + /** + * List of archives. + */ + archives: BackupArchive[]; + } + + /** + * Backup policy list + */ + export type BackupPolicyList = { + /** + * Total number of policies that matched your query. + */ + total: number | bigint; + /** + * List of policies. + */ + policies: BackupPolicy[]; + } + + /** + * Backup restoration list + */ + export type BackupRestorationList = { + /** + * Total number of restorations that matched your query. + */ + total: number | bigint; + /** + * List of restorations. + */ + restorations: BackupRestoration[]; + } } diff --git a/src/query.ts b/src/query.ts index 4ebd532..a6fb328 100644 --- a/src/query.ts +++ b/src/query.ts @@ -1,5 +1,8 @@ -type QueryTypesSingle = string | number | boolean; -export type QueryTypesList = string[] | number[] | boolean[] | Query[] | any[]; +import JSONbigModule from 'json-bigint'; +const JSONbig = JSONbigModule({ useNativeBigInt: true }); + +type QueryTypesSingle = string | number | bigint | boolean; +export type QueryTypesList = string[] | number[] | bigint[] | boolean[] | Query[] | any[]; export type QueryTypes = QueryTypesSingle | QueryTypesList; type AttributesTypes = string | string[]; @@ -41,7 +44,7 @@ export class Query { * @returns {string} */ toString(): string { - return JSON.stringify({ + return JSONbig.stringify({ method: this.method, attribute: this.attribute, values: this.values, @@ -130,11 +133,11 @@ export class Query { * Filter resources where attribute is between start and end (inclusive). * * @param {string} attribute - * @param {string | number} start - * @param {string | number} end + * @param {string | number | bigint} start + * @param {string | number | bigint} end * @returns {string} */ - static between = (attribute: string, start: string | number, end: string | number): string => + static between = (attribute: string, start: string | number | bigint, end: string | number | bigint): string => new Query("between", attribute, [start, end] as QueryTypesList).toString(); /** @@ -274,11 +277,11 @@ export class Query { * Filter resources where attribute is not between start and end (exclusive). * * @param {string} attribute - * @param {string | number} start - * @param {string | number} end + * @param {string | number | bigint} start + * @param {string | number | bigint} end * @returns {string} */ - static notBetween = (attribute: string, start: string | number, end: string | number): string => + static notBetween = (attribute: string, start: string | number | bigint, end: string | number | bigint): string => new Query("notBetween", attribute, [start, end] as QueryTypesList).toString(); /** @@ -364,7 +367,7 @@ export class Query { * @returns {string} */ static or = (queries: string[]) => - new Query("or", undefined, queries.map((query) => JSON.parse(query))).toString(); + new Query("or", undefined, queries.map((query) => JSONbig.parse(query))).toString(); /** * Combine multiple queries using logical AND operator. @@ -373,7 +376,7 @@ export class Query { * @returns {string} */ static and = (queries: string[]) => - new Query("and", undefined, queries.map((query) => JSON.parse(query))).toString(); + new Query("and", undefined, queries.map((query) => JSONbig.parse(query))).toString(); /** * Filter resources where attribute is at a specific distance from the given coordinates. diff --git a/src/services/account.ts b/src/services/account.ts index 26bd2bc..a71e263 100644 --- a/src/services/account.ts +++ b/src/services/account.ts @@ -302,13 +302,41 @@ export class Account { /** * Use this endpoint to create a JSON Web Token. You can use the resulting JWT to authenticate on behalf of the current user when working with the Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes from its creation and will be invalid if the user will logout in that time frame. * + * @param {number | bigint} params.duration - Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds. * @throws {AppwriteException} * @returns {Promise} */ - createJWT(): Promise { + createJWT(params?: { duration?: number | bigint }): Promise; + /** + * Use this endpoint to create a JSON Web Token. You can use the resulting JWT to authenticate on behalf of the current user when working with the Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes from its creation and will be invalid if the user will logout in that time frame. + * + * @param {number | bigint} duration - Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createJWT(duration?: number | bigint): Promise; + createJWT( + paramsOrFirst?: { duration?: number | bigint } | number | bigint + ): Promise { + let params: { duration?: number | bigint }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { duration?: number | bigint }; + } else { + params = { + duration: paramsOrFirst as number | bigint + }; + } + + const duration = params.duration; + const apiPath = '/account/jwts'; const payload: Payload = {}; + if (typeof duration !== 'undefined') { + payload['duration'] = duration; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -2310,7 +2338,7 @@ export class Account { * * A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). * - * @param {OAuthProvider} params.provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom. + * @param {OAuthProvider} params.provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom, githubImagine, googleImagine. * @param {string} params.success - URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. * @param {string} params.failure - URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. * @param {string[]} params.scopes - A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long. @@ -2325,7 +2353,7 @@ export class Account { * * A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). * - * @param {OAuthProvider} provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom. + * @param {OAuthProvider} provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom, githubImagine, googleImagine. * @param {string} success - URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. * @param {string} failure - URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. * @param {string[]} scopes - A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long. diff --git a/src/services/avatars.ts b/src/services/avatars.ts index 68e83d1..7e1545b 100644 --- a/src/services/avatars.ts +++ b/src/services/avatars.ts @@ -6,7 +6,7 @@ import { CreditCard } from '../enums/credit-card'; import { Flag } from '../enums/flag'; import { Theme } from '../enums/theme'; import { Timezone } from '../enums/timezone'; -import { Output } from '../enums/output'; +import { ImageFormat } from '../enums/image-format'; export class Avatars { client: Client; @@ -21,41 +21,41 @@ export class Avatars { * 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. * * @param {Browser} params.code - Browser Code. - * @param {number} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100. - * @param {number} params.height - Image height. Pass an integer between 0 to 2000. Defaults to 100. - * @param {number} params.quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. + * @param {number | bigint} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100. + * @param {number | bigint} params.height - Image height. Pass an integer between 0 to 2000. Defaults to 100. + * @param {number | bigint} params.quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. * @throws {AppwriteException} * @returns {Promise} */ - getBrowser(params: { code: Browser, width?: number, height?: number, quality?: number }): Promise; + getBrowser(params: { code: Browser, width?: number | bigint, height?: number | bigint, quality?: number | bigint }): Promise; /** * You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET /account/sessions](https://appwrite.io/docs/references/cloud/client-web/account#getSessions) endpoint. 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. * * @param {Browser} code - Browser Code. - * @param {number} width - Image width. Pass an integer between 0 to 2000. Defaults to 100. - * @param {number} height - Image height. Pass an integer between 0 to 2000. Defaults to 100. - * @param {number} quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. + * @param {number | bigint} width - Image width. Pass an integer between 0 to 2000. Defaults to 100. + * @param {number | bigint} height - Image height. Pass an integer between 0 to 2000. Defaults to 100. + * @param {number | bigint} quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getBrowser(code: Browser, width?: number, height?: number, quality?: number): Promise; + getBrowser(code: Browser, width?: number | bigint, height?: number | bigint, quality?: number | bigint): Promise; getBrowser( - paramsOrFirst: { code: Browser, width?: number, height?: number, quality?: number } | Browser, - ...rest: [(number)?, (number)?, (number)?] + paramsOrFirst: { code: Browser, width?: number | bigint, height?: number | bigint, quality?: number | bigint } | Browser, + ...rest: [(number | bigint)?, (number | bigint)?, (number | bigint)?] ): Promise { - let params: { code: Browser, width?: number, height?: number, quality?: number }; + let params: { code: Browser, width?: number | bigint, height?: number | bigint, quality?: number | bigint }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'code' in paramsOrFirst)) { - params = (paramsOrFirst || {}) as { code: Browser, width?: number, height?: number, quality?: number }; + params = (paramsOrFirst || {}) as { code: Browser, width?: number | bigint, height?: number | bigint, quality?: number | bigint }; } else { params = { code: paramsOrFirst as Browser, - width: rest[0] as number, - height: rest[1] as number, - quality: rest[2] as number + width: rest[0] as number | bigint, + height: rest[1] as number | bigint, + quality: rest[2] as number | bigint }; } @@ -100,13 +100,13 @@ export class Avatars { * * * @param {CreditCard} params.code - Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, unionpay, visa, mir, maestro, rupay. - * @param {number} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100. - * @param {number} params.height - Image height. Pass an integer between 0 to 2000. Defaults to 100. - * @param {number} params.quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. + * @param {number | bigint} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100. + * @param {number | bigint} params.height - Image height. Pass an integer between 0 to 2000. Defaults to 100. + * @param {number | bigint} params.quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. * @throws {AppwriteException} * @returns {Promise} */ - getCreditCard(params: { code: CreditCard, width?: number, height?: number, quality?: number }): Promise; + getCreditCard(params: { code: CreditCard, width?: number | bigint, height?: number | bigint, quality?: number | bigint }): Promise; /** * 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. * @@ -114,28 +114,28 @@ export class Avatars { * * * @param {CreditCard} code - Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, unionpay, visa, mir, maestro, rupay. - * @param {number} width - Image width. Pass an integer between 0 to 2000. Defaults to 100. - * @param {number} height - Image height. Pass an integer between 0 to 2000. Defaults to 100. - * @param {number} quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. + * @param {number | bigint} width - Image width. Pass an integer between 0 to 2000. Defaults to 100. + * @param {number | bigint} height - Image height. Pass an integer between 0 to 2000. Defaults to 100. + * @param {number | bigint} quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getCreditCard(code: CreditCard, width?: number, height?: number, quality?: number): Promise; + getCreditCard(code: CreditCard, width?: number | bigint, height?: number | bigint, quality?: number | bigint): Promise; getCreditCard( - paramsOrFirst: { code: CreditCard, width?: number, height?: number, quality?: number } | CreditCard, - ...rest: [(number)?, (number)?, (number)?] + paramsOrFirst: { code: CreditCard, width?: number | bigint, height?: number | bigint, quality?: number | bigint } | CreditCard, + ...rest: [(number | bigint)?, (number | bigint)?, (number | bigint)?] ): Promise { - let params: { code: CreditCard, width?: number, height?: number, quality?: number }; + let params: { code: CreditCard, width?: number | bigint, height?: number | bigint, quality?: number | bigint }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'code' in paramsOrFirst)) { - params = (paramsOrFirst || {}) as { code: CreditCard, width?: number, height?: number, quality?: number }; + params = (paramsOrFirst || {}) as { code: CreditCard, width?: number | bigint, height?: number | bigint, quality?: number | bigint }; } else { params = { code: paramsOrFirst as CreditCard, - width: rest[0] as number, - height: rest[1] as number, - quality: rest[2] as number + width: rest[0] as number | bigint, + height: rest[1] as number | bigint, + quality: rest[2] as number | bigint }; } @@ -239,13 +239,13 @@ export class Avatars { * * * @param {Flag} params.code - Country Code. ISO Alpha-2 country code format. - * @param {number} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100. - * @param {number} params.height - Image height. Pass an integer between 0 to 2000. Defaults to 100. - * @param {number} params.quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. + * @param {number | bigint} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100. + * @param {number | bigint} params.height - Image height. Pass an integer between 0 to 2000. Defaults to 100. + * @param {number | bigint} params.quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. * @throws {AppwriteException} * @returns {Promise} */ - getFlag(params: { code: Flag, width?: number, height?: number, quality?: number }): Promise; + getFlag(params: { code: Flag, width?: number | bigint, height?: number | bigint, quality?: number | bigint }): Promise; /** * You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard. * @@ -253,28 +253,28 @@ export class Avatars { * * * @param {Flag} code - Country Code. ISO Alpha-2 country code format. - * @param {number} width - Image width. Pass an integer between 0 to 2000. Defaults to 100. - * @param {number} height - Image height. Pass an integer between 0 to 2000. Defaults to 100. - * @param {number} quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. + * @param {number | bigint} width - Image width. Pass an integer between 0 to 2000. Defaults to 100. + * @param {number | bigint} height - Image height. Pass an integer between 0 to 2000. Defaults to 100. + * @param {number | bigint} quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getFlag(code: Flag, width?: number, height?: number, quality?: number): Promise; + getFlag(code: Flag, width?: number | bigint, height?: number | bigint, quality?: number | bigint): Promise; getFlag( - paramsOrFirst: { code: Flag, width?: number, height?: number, quality?: number } | Flag, - ...rest: [(number)?, (number)?, (number)?] + paramsOrFirst: { code: Flag, width?: number | bigint, height?: number | bigint, quality?: number | bigint } | Flag, + ...rest: [(number | bigint)?, (number | bigint)?, (number | bigint)?] ): Promise { - let params: { code: Flag, width?: number, height?: number, quality?: number }; + let params: { code: Flag, width?: number | bigint, height?: number | bigint, quality?: number | bigint }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'code' in paramsOrFirst)) { - params = (paramsOrFirst || {}) as { code: Flag, width?: number, height?: number, quality?: number }; + params = (paramsOrFirst || {}) as { code: Flag, width?: number | bigint, height?: number | bigint, quality?: number | bigint }; } else { params = { code: paramsOrFirst as Flag, - width: rest[0] as number, - height: rest[1] as number, - quality: rest[2] as number + width: rest[0] as number | bigint, + height: rest[1] as number | bigint, + quality: rest[2] as number | bigint }; } @@ -320,12 +320,12 @@ export class Avatars { * This endpoint does not follow HTTP redirects. * * @param {string} params.url - Image URL which you want to crop. - * @param {number} params.width - Resize preview image width, Pass an integer between 0 to 2000. Defaults to 400. - * @param {number} params.height - Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400. + * @param {number | bigint} params.width - Resize preview image width, Pass an integer between 0 to 2000. Defaults to 400. + * @param {number | bigint} params.height - Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400. * @throws {AppwriteException} * @returns {Promise} */ - getImage(params: { url: string, width?: number, height?: number }): Promise; + getImage(params: { url: string, width?: number | bigint, height?: number | bigint }): Promise; /** * Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol. * @@ -334,26 +334,26 @@ export class Avatars { * This endpoint does not follow HTTP redirects. * * @param {string} url - Image URL which you want to crop. - * @param {number} width - Resize preview image width, Pass an integer between 0 to 2000. Defaults to 400. - * @param {number} height - Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400. + * @param {number | bigint} width - Resize preview image width, Pass an integer between 0 to 2000. Defaults to 400. + * @param {number | bigint} height - Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getImage(url: string, width?: number, height?: number): Promise; + getImage(url: string, width?: number | bigint, height?: number | bigint): Promise; getImage( - paramsOrFirst: { url: string, width?: number, height?: number } | string, - ...rest: [(number)?, (number)?] + paramsOrFirst: { url: string, width?: number | bigint, height?: number | bigint } | string, + ...rest: [(number | bigint)?, (number | bigint)?] ): Promise { - let params: { url: string, width?: number, height?: number }; + let params: { url: string, width?: number | bigint, height?: number | bigint }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { url: string, width?: number, height?: number }; + params = (paramsOrFirst || {}) as { url: string, width?: number | bigint, height?: number | bigint }; } else { params = { url: paramsOrFirst as string, - width: rest[0] as number, - height: rest[1] as number + width: rest[0] as number | bigint, + height: rest[1] as number | bigint }; } @@ -399,13 +399,13 @@ export class Avatars { * * * @param {string} params.name - Full Name. When empty, current user name or email will be used. Max length: 128 chars. - * @param {number} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100. - * @param {number} params.height - Image height. Pass an integer between 0 to 2000. Defaults to 100. + * @param {number | bigint} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100. + * @param {number | bigint} params.height - Image height. Pass an integer between 0 to 2000. Defaults to 100. * @param {string} params.background - Changes background color. By default a random color will be picked and stay will persistent to the given name. * @throws {AppwriteException} * @returns {Promise} */ - getInitials(params?: { name?: string, width?: number, height?: number, background?: string }): Promise; + getInitials(params?: { name?: string, width?: number | bigint, height?: number | bigint, background?: string }): Promise; /** * Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned. * @@ -415,27 +415,27 @@ export class Avatars { * * * @param {string} name - Full Name. When empty, current user name or email will be used. Max length: 128 chars. - * @param {number} width - Image width. Pass an integer between 0 to 2000. Defaults to 100. - * @param {number} height - Image height. Pass an integer between 0 to 2000. Defaults to 100. + * @param {number | bigint} width - Image width. Pass an integer between 0 to 2000. Defaults to 100. + * @param {number | bigint} height - Image height. Pass an integer between 0 to 2000. Defaults to 100. * @param {string} background - Changes background color. By default a random color will be picked and stay will persistent to the given name. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getInitials(name?: string, width?: number, height?: number, background?: string): Promise; + getInitials(name?: string, width?: number | bigint, height?: number | bigint, background?: string): Promise; getInitials( - paramsOrFirst?: { name?: string, width?: number, height?: number, background?: string } | string, - ...rest: [(number)?, (number)?, (string)?] + paramsOrFirst?: { name?: string, width?: number | bigint, height?: number | bigint, background?: string } | string, + ...rest: [(number | bigint)?, (number | bigint)?, (string)?] ): Promise { - let params: { name?: string, width?: number, height?: number, background?: string }; + let params: { name?: string, width?: number | bigint, height?: number | bigint, background?: string }; if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { name?: string, width?: number, height?: number, background?: string }; + params = (paramsOrFirst || {}) as { name?: string, width?: number | bigint, height?: number | bigint, background?: string }; } else { params = { name: paramsOrFirst as string, - width: rest[0] as number, - height: rest[1] as number, + width: rest[0] as number | bigint, + height: rest[1] as number | bigint, background: rest[2] as string }; } @@ -479,39 +479,39 @@ export class Avatars { * * * @param {string} params.text - Plain text to be converted to QR code image. - * @param {number} params.size - QR code size. Pass an integer between 1 to 1000. Defaults to 400. - * @param {number} params.margin - Margin from edge. Pass an integer between 0 to 10. Defaults to 1. + * @param {number | bigint} params.size - QR code size. Pass an integer between 1 to 1000. Defaults to 400. + * @param {number | bigint} params.margin - Margin from edge. Pass an integer between 0 to 10. Defaults to 1. * @param {boolean} params.download - Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0. * @throws {AppwriteException} * @returns {Promise} */ - getQR(params: { text: string, size?: number, margin?: number, download?: boolean }): Promise; + getQR(params: { text: string, size?: number | bigint, margin?: number | bigint, download?: boolean }): Promise; /** * Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image. * * * @param {string} text - Plain text to be converted to QR code image. - * @param {number} size - QR code size. Pass an integer between 1 to 1000. Defaults to 400. - * @param {number} margin - Margin from edge. Pass an integer between 0 to 10. Defaults to 1. + * @param {number | bigint} size - QR code size. Pass an integer between 1 to 1000. Defaults to 400. + * @param {number | bigint} margin - Margin from edge. Pass an integer between 0 to 10. Defaults to 1. * @param {boolean} download - Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getQR(text: string, size?: number, margin?: number, download?: boolean): Promise; + getQR(text: string, size?: number | bigint, margin?: number | bigint, download?: boolean): Promise; getQR( - paramsOrFirst: { text: string, size?: number, margin?: number, download?: boolean } | string, - ...rest: [(number)?, (number)?, (boolean)?] + paramsOrFirst: { text: string, size?: number | bigint, margin?: number | bigint, download?: boolean } | string, + ...rest: [(number | bigint)?, (number | bigint)?, (boolean)?] ): Promise { - let params: { text: string, size?: number, margin?: number, download?: boolean }; + let params: { text: string, size?: number | bigint, margin?: number | bigint, download?: boolean }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { text: string, size?: number, margin?: number, download?: boolean }; + params = (paramsOrFirst || {}) as { text: string, size?: number | bigint, margin?: number | bigint, download?: boolean }; } else { params = { text: paramsOrFirst as string, - size: rest[0] as number, - margin: rest[1] as number, + size: rest[0] as number | bigint, + margin: rest[1] as number | bigint, download: rest[2] as boolean }; } @@ -562,28 +562,28 @@ export class Avatars { * * @param {string} params.url - Website URL which you want to capture. * @param {object} params.headers - HTTP headers to send with the browser request. Defaults to empty. - * @param {number} params.viewportWidth - Browser viewport width. Pass an integer between 1 to 1920. Defaults to 1280. - * @param {number} params.viewportHeight - Browser viewport height. Pass an integer between 1 to 1080. Defaults to 720. - * @param {number} params.scale - Browser scale factor. Pass a number between 0.1 to 3. Defaults to 1. + * @param {number | bigint} params.viewportWidth - Browser viewport width. Pass an integer between 1 to 1920. Defaults to 1280. + * @param {number | bigint} params.viewportHeight - Browser viewport height. Pass an integer between 1 to 1080. Defaults to 720. + * @param {number | bigint} params.scale - Browser scale factor. Pass a number between 0.1 to 3. Defaults to 1. * @param {Theme} params.theme - Browser theme. Pass "light" or "dark". Defaults to "light". * @param {string} params.userAgent - Custom user agent string. Defaults to browser default. * @param {boolean} params.fullpage - Capture full page scroll. Pass 0 for viewport only, or 1 for full page. Defaults to 0. * @param {string} params.locale - Browser locale (e.g., "en-US", "fr-FR"). Defaults to browser default. * @param {Timezone} params.timezone - IANA timezone identifier (e.g., "America/New_York", "Europe/London"). Defaults to browser default. - * @param {number} params.latitude - Geolocation latitude. Pass a number between -90 to 90. Defaults to 0. - * @param {number} params.longitude - Geolocation longitude. Pass a number between -180 to 180. Defaults to 0. - * @param {number} params.accuracy - Geolocation accuracy in meters. Pass a number between 0 to 100000. Defaults to 0. + * @param {number | bigint} params.latitude - Geolocation latitude. Pass a number between -90 to 90. Defaults to 0. + * @param {number | bigint} params.longitude - Geolocation longitude. Pass a number between -180 to 180. Defaults to 0. + * @param {number | bigint} params.accuracy - Geolocation accuracy in meters. Pass a number between 0 to 100000. Defaults to 0. * @param {boolean} params.touch - Enable touch support. Pass 0 for no touch, or 1 for touch enabled. Defaults to 0. * @param {string[]} params.permissions - Browser permissions to grant. Pass an array of permission names like ["geolocation", "camera", "microphone"]. Defaults to empty. - * @param {number} params.sleep - Wait time in seconds before taking the screenshot. Pass an integer between 0 to 10. Defaults to 0. - * @param {number} params.width - Output image width. Pass 0 to use original width, or an integer between 1 to 2000. Defaults to 0 (original width). - * @param {number} params.height - Output image height. Pass 0 to use original height, or an integer between 1 to 2000. Defaults to 0 (original height). - * @param {number} params.quality - Screenshot quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. - * @param {Output} params.output - Output format type (jpeg, jpg, png, gif and webp). + * @param {number | bigint} params.sleep - Wait time in seconds before taking the screenshot. Pass an integer between 0 to 10. Defaults to 0. + * @param {number | bigint} params.width - Output image width. Pass 0 to use original width, or an integer between 1 to 2000. Defaults to 0 (original width). + * @param {number | bigint} params.height - Output image height. Pass 0 to use original height, or an integer between 1 to 2000. Defaults to 0 (original height). + * @param {number | bigint} params.quality - Screenshot quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. + * @param {ImageFormat} params.output - Output format type (jpeg, jpg, png, gif and webp). * @throws {AppwriteException} * @returns {Promise} */ - getScreenshot(params: { url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: string[], sleep?: number, width?: number, height?: number, quality?: number, output?: Output }): Promise; + getScreenshot(params: { url: string, headers?: object, viewportWidth?: number | bigint, viewportHeight?: number | bigint, scale?: number | bigint, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number | bigint, longitude?: number | bigint, accuracy?: number | bigint, touch?: boolean, permissions?: string[], sleep?: number | bigint, width?: number | bigint, height?: number | bigint, quality?: number | bigint, output?: ImageFormat }): Promise; /** * Use this endpoint to capture a screenshot of any website URL. This endpoint uses a headless browser to render the webpage and capture it as an image. * @@ -593,59 +593,59 @@ export class Avatars { * * @param {string} url - Website URL which you want to capture. * @param {object} headers - HTTP headers to send with the browser request. Defaults to empty. - * @param {number} viewportWidth - Browser viewport width. Pass an integer between 1 to 1920. Defaults to 1280. - * @param {number} viewportHeight - Browser viewport height. Pass an integer between 1 to 1080. Defaults to 720. - * @param {number} scale - Browser scale factor. Pass a number between 0.1 to 3. Defaults to 1. + * @param {number | bigint} viewportWidth - Browser viewport width. Pass an integer between 1 to 1920. Defaults to 1280. + * @param {number | bigint} viewportHeight - Browser viewport height. Pass an integer between 1 to 1080. Defaults to 720. + * @param {number | bigint} scale - Browser scale factor. Pass a number between 0.1 to 3. Defaults to 1. * @param {Theme} theme - Browser theme. Pass "light" or "dark". Defaults to "light". * @param {string} userAgent - Custom user agent string. Defaults to browser default. * @param {boolean} fullpage - Capture full page scroll. Pass 0 for viewport only, or 1 for full page. Defaults to 0. * @param {string} locale - Browser locale (e.g., "en-US", "fr-FR"). Defaults to browser default. * @param {Timezone} timezone - IANA timezone identifier (e.g., "America/New_York", "Europe/London"). Defaults to browser default. - * @param {number} latitude - Geolocation latitude. Pass a number between -90 to 90. Defaults to 0. - * @param {number} longitude - Geolocation longitude. Pass a number between -180 to 180. Defaults to 0. - * @param {number} accuracy - Geolocation accuracy in meters. Pass a number between 0 to 100000. Defaults to 0. + * @param {number | bigint} latitude - Geolocation latitude. Pass a number between -90 to 90. Defaults to 0. + * @param {number | bigint} longitude - Geolocation longitude. Pass a number between -180 to 180. Defaults to 0. + * @param {number | bigint} accuracy - Geolocation accuracy in meters. Pass a number between 0 to 100000. Defaults to 0. * @param {boolean} touch - Enable touch support. Pass 0 for no touch, or 1 for touch enabled. Defaults to 0. * @param {string[]} permissions - Browser permissions to grant. Pass an array of permission names like ["geolocation", "camera", "microphone"]. Defaults to empty. - * @param {number} sleep - Wait time in seconds before taking the screenshot. Pass an integer between 0 to 10. Defaults to 0. - * @param {number} width - Output image width. Pass 0 to use original width, or an integer between 1 to 2000. Defaults to 0 (original width). - * @param {number} height - Output image height. Pass 0 to use original height, or an integer between 1 to 2000. Defaults to 0 (original height). - * @param {number} quality - Screenshot quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. - * @param {Output} output - Output format type (jpeg, jpg, png, gif and webp). + * @param {number | bigint} sleep - Wait time in seconds before taking the screenshot. Pass an integer between 0 to 10. Defaults to 0. + * @param {number | bigint} width - Output image width. Pass 0 to use original width, or an integer between 1 to 2000. Defaults to 0 (original width). + * @param {number | bigint} height - Output image height. Pass 0 to use original height, or an integer between 1 to 2000. Defaults to 0 (original height). + * @param {number | bigint} quality - Screenshot quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. + * @param {ImageFormat} output - Output format type (jpeg, jpg, png, gif and webp). * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getScreenshot(url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: string[], sleep?: number, width?: number, height?: number, quality?: number, output?: Output): Promise; + getScreenshot(url: string, headers?: object, viewportWidth?: number | bigint, viewportHeight?: number | bigint, scale?: number | bigint, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number | bigint, longitude?: number | bigint, accuracy?: number | bigint, touch?: boolean, permissions?: string[], sleep?: number | bigint, width?: number | bigint, height?: number | bigint, quality?: number | bigint, output?: ImageFormat): Promise; getScreenshot( - paramsOrFirst: { url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: string[], sleep?: number, width?: number, height?: number, quality?: number, output?: Output } | string, - ...rest: [(object)?, (number)?, (number)?, (number)?, (Theme)?, (string)?, (boolean)?, (string)?, (Timezone)?, (number)?, (number)?, (number)?, (boolean)?, (string[])?, (number)?, (number)?, (number)?, (number)?, (Output)?] + paramsOrFirst: { url: string, headers?: object, viewportWidth?: number | bigint, viewportHeight?: number | bigint, scale?: number | bigint, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number | bigint, longitude?: number | bigint, accuracy?: number | bigint, touch?: boolean, permissions?: string[], sleep?: number | bigint, width?: number | bigint, height?: number | bigint, quality?: number | bigint, output?: ImageFormat } | string, + ...rest: [(object)?, (number | bigint)?, (number | bigint)?, (number | bigint)?, (Theme)?, (string)?, (boolean)?, (string)?, (Timezone)?, (number | bigint)?, (number | bigint)?, (number | bigint)?, (boolean)?, (string[])?, (number | bigint)?, (number | bigint)?, (number | bigint)?, (number | bigint)?, (ImageFormat)?] ): Promise { - let params: { url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: string[], sleep?: number, width?: number, height?: number, quality?: number, output?: Output }; + let params: { url: string, headers?: object, viewportWidth?: number | bigint, viewportHeight?: number | bigint, scale?: number | bigint, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number | bigint, longitude?: number | bigint, accuracy?: number | bigint, touch?: boolean, permissions?: string[], sleep?: number | bigint, width?: number | bigint, height?: number | bigint, quality?: number | bigint, output?: ImageFormat }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: string[], sleep?: number, width?: number, height?: number, quality?: number, output?: Output }; + params = (paramsOrFirst || {}) as { url: string, headers?: object, viewportWidth?: number | bigint, viewportHeight?: number | bigint, scale?: number | bigint, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number | bigint, longitude?: number | bigint, accuracy?: number | bigint, touch?: boolean, permissions?: string[], sleep?: number | bigint, width?: number | bigint, height?: number | bigint, quality?: number | bigint, output?: ImageFormat }; } else { params = { url: paramsOrFirst as string, headers: rest[0] as object, - viewportWidth: rest[1] as number, - viewportHeight: rest[2] as number, - scale: rest[3] as number, + viewportWidth: rest[1] as number | bigint, + viewportHeight: rest[2] as number | bigint, + scale: rest[3] as number | bigint, theme: rest[4] as Theme, userAgent: rest[5] as string, fullpage: rest[6] as boolean, locale: rest[7] as string, timezone: rest[8] as Timezone, - latitude: rest[9] as number, - longitude: rest[10] as number, - accuracy: rest[11] as number, + latitude: rest[9] as number | bigint, + longitude: rest[10] as number | bigint, + accuracy: rest[11] as number | bigint, touch: rest[12] as boolean, permissions: rest[13] as string[], - sleep: rest[14] as number, - width: rest[15] as number, - height: rest[16] as number, - quality: rest[17] as number, - output: rest[18] as Output + sleep: rest[14] as number | bigint, + width: rest[15] as number | bigint, + height: rest[16] as number | bigint, + quality: rest[17] as number | bigint, + output: rest[18] as ImageFormat }; } diff --git a/src/services/backups.ts b/src/services/backups.ts new file mode 100644 index 0000000..98d2a39 --- /dev/null +++ b/src/services/backups.ts @@ -0,0 +1,752 @@ +import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; +import type { Models } from '../models'; + + +export class Backups { + client: Client; + + constructor(client: Client) { + this.client = client; + } + + /** + * List all archives for a project. + * + * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @throws {AppwriteException} + * @returns {Promise} + */ + listArchives(params?: { queries?: string[] }): Promise; + /** + * List all archives for a project. + * + * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + listArchives(queries?: string[]): Promise; + listArchives( + paramsOrFirst?: { queries?: string[] } | string[] + ): Promise { + let params: { queries?: string[] }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { queries?: string[] }; + } else { + params = { + queries: paramsOrFirst as string[] + }; + } + + const queries = params.queries; + + + const apiPath = '/backups/archives'; + const payload: Payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + + /** + * Create a new archive asynchronously for a project. + * + * @param {string[]} params.services - Array of services to backup + * @param {string} params.resourceId - Resource ID. When set, only this single resource will be backed up. + * @throws {AppwriteException} + * @returns {Promise} + */ + createArchive(params: { services: string[], resourceId?: string }): Promise; + /** + * Create a new archive asynchronously for a project. + * + * @param {string[]} services - Array of services to backup + * @param {string} resourceId - Resource ID. When set, only this single resource will be backed up. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createArchive(services: string[], resourceId?: string): Promise; + createArchive( + paramsOrFirst: { services: string[], resourceId?: string } | string[], + ...rest: [(string)?] + ): Promise { + let params: { services: string[], resourceId?: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { services: string[], resourceId?: string }; + } else { + params = { + services: paramsOrFirst as string[], + resourceId: rest[0] as string + }; + } + + const services = params.services; + const resourceId = params.resourceId; + + if (typeof services === 'undefined') { + throw new AppwriteException('Missing required parameter: "services"'); + } + + const apiPath = '/backups/archives'; + const payload: Payload = {}; + if (typeof services !== 'undefined') { + payload['services'] = services; + } + if (typeof resourceId !== 'undefined') { + payload['resourceId'] = resourceId; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload, + ); + } + + /** + * Get a backup archive using it's ID. + * + * @param {string} params.archiveId - Archive ID. Choose a custom ID`. 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. + * @throws {AppwriteException} + * @returns {Promise} + */ + getArchive(params: { archiveId: string }): Promise; + /** + * Get a backup archive using it's ID. + * + * @param {string} archiveId - Archive ID. Choose a custom ID`. 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. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getArchive(archiveId: string): Promise; + getArchive( + paramsOrFirst: { archiveId: string } | string + ): Promise { + let params: { archiveId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { archiveId: string }; + } else { + params = { + archiveId: paramsOrFirst as string + }; + } + + const archiveId = params.archiveId; + + if (typeof archiveId === 'undefined') { + throw new AppwriteException('Missing required parameter: "archiveId"'); + } + + const apiPath = '/backups/archives/{archiveId}'.replace('{archiveId}', archiveId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + + /** + * Delete an existing archive for a project. + * + * @param {string} params.archiveId - Policy 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. + * @throws {AppwriteException} + * @returns {Promise<{}>} + */ + deleteArchive(params: { archiveId: string }): Promise<{}>; + /** + * Delete an existing archive for a project. + * + * @param {string} archiveId - Policy 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. + * @throws {AppwriteException} + * @returns {Promise<{}>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + deleteArchive(archiveId: string): Promise<{}>; + deleteArchive( + paramsOrFirst: { archiveId: string } | string + ): Promise<{}> { + let params: { archiveId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { archiveId: string }; + } else { + params = { + archiveId: paramsOrFirst as string + }; + } + + const archiveId = params.archiveId; + + if (typeof archiveId === 'undefined') { + throw new AppwriteException('Missing required parameter: "archiveId"'); + } + + const apiPath = '/backups/archives/{archiveId}'.replace('{archiveId}', archiveId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'delete', + uri, + apiHeaders, + payload, + ); + } + + /** + * List all policies for a project. + * + * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @throws {AppwriteException} + * @returns {Promise} + */ + listPolicies(params?: { queries?: string[] }): Promise; + /** + * List all policies for a project. + * + * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + listPolicies(queries?: string[]): Promise; + listPolicies( + paramsOrFirst?: { queries?: string[] } | string[] + ): Promise { + let params: { queries?: string[] }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { queries?: string[] }; + } else { + params = { + queries: paramsOrFirst as string[] + }; + } + + const queries = params.queries; + + + const apiPath = '/backups/policies'; + const payload: Payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + + /** + * Create a new backup policy. + * + * @param {string} params.policyId - Policy 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. + * @param {string[]} params.services - Array of services to backup + * @param {number | bigint} params.retention - Days to keep backups before deletion + * @param {string} params.schedule - Schedule CRON syntax. + * @param {string} params.name - Policy name. Max length: 128 chars. + * @param {string} params.resourceId - Resource ID. When set, only this single resource will be backed up. + * @param {boolean} params.enabled - Is policy enabled? When set to 'disabled', no backups will be taken + * @throws {AppwriteException} + * @returns {Promise} + */ + createPolicy(params: { policyId: string, services: string[], retention: number | bigint, schedule: string, name?: string, resourceId?: string, enabled?: boolean }): Promise; + /** + * Create a new backup policy. + * + * @param {string} policyId - Policy 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. + * @param {string[]} services - Array of services to backup + * @param {number | bigint} retention - Days to keep backups before deletion + * @param {string} schedule - Schedule CRON syntax. + * @param {string} name - Policy name. Max length: 128 chars. + * @param {string} resourceId - Resource ID. When set, only this single resource will be backed up. + * @param {boolean} enabled - Is policy enabled? When set to 'disabled', no backups will be taken + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createPolicy(policyId: string, services: string[], retention: number | bigint, schedule: string, name?: string, resourceId?: string, enabled?: boolean): Promise; + createPolicy( + paramsOrFirst: { policyId: string, services: string[], retention: number | bigint, schedule: string, name?: string, resourceId?: string, enabled?: boolean } | string, + ...rest: [(string[])?, (number | bigint)?, (string)?, (string)?, (string)?, (boolean)?] + ): Promise { + let params: { policyId: string, services: string[], retention: number | bigint, schedule: string, name?: string, resourceId?: string, enabled?: boolean }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { policyId: string, services: string[], retention: number | bigint, schedule: string, name?: string, resourceId?: string, enabled?: boolean }; + } else { + params = { + policyId: paramsOrFirst as string, + services: rest[0] as string[], + retention: rest[1] as number | bigint, + schedule: rest[2] as string, + name: rest[3] as string, + resourceId: rest[4] as string, + enabled: rest[5] as boolean + }; + } + + const policyId = params.policyId; + const services = params.services; + const retention = params.retention; + const schedule = params.schedule; + const name = params.name; + const resourceId = params.resourceId; + const enabled = params.enabled; + + if (typeof policyId === 'undefined') { + throw new AppwriteException('Missing required parameter: "policyId"'); + } + if (typeof services === 'undefined') { + throw new AppwriteException('Missing required parameter: "services"'); + } + if (typeof retention === 'undefined') { + throw new AppwriteException('Missing required parameter: "retention"'); + } + if (typeof schedule === 'undefined') { + throw new AppwriteException('Missing required parameter: "schedule"'); + } + + const apiPath = '/backups/policies'; + const payload: Payload = {}; + if (typeof policyId !== 'undefined') { + payload['policyId'] = policyId; + } + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof services !== 'undefined') { + payload['services'] = services; + } + if (typeof resourceId !== 'undefined') { + payload['resourceId'] = resourceId; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + if (typeof retention !== 'undefined') { + payload['retention'] = retention; + } + if (typeof schedule !== 'undefined') { + payload['schedule'] = schedule; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload, + ); + } + + /** + * Get a backup policy using it's ID. + * + * @param {string} params.policyId - Policy ID. Choose a custom ID`. 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. + * @throws {AppwriteException} + * @returns {Promise} + */ + getPolicy(params: { policyId: string }): Promise; + /** + * Get a backup policy using it's ID. + * + * @param {string} policyId - Policy ID. Choose a custom ID`. 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. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getPolicy(policyId: string): Promise; + getPolicy( + paramsOrFirst: { policyId: string } | string + ): Promise { + let params: { policyId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { policyId: string }; + } else { + params = { + policyId: paramsOrFirst as string + }; + } + + const policyId = params.policyId; + + if (typeof policyId === 'undefined') { + throw new AppwriteException('Missing required parameter: "policyId"'); + } + + const apiPath = '/backups/policies/{policyId}'.replace('{policyId}', policyId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update an existing policy using it's ID. + * + * @param {string} params.policyId - Policy ID. Choose a custom ID`. 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. + * @param {string} params.name - Policy name. Max length: 128 chars. + * @param {number | bigint} params.retention - Days to keep backups before deletion + * @param {string} params.schedule - Cron expression + * @param {boolean} params.enabled - Is Backup enabled? When set to 'disabled', No backup will be taken + * @throws {AppwriteException} + * @returns {Promise} + */ + updatePolicy(params: { policyId: string, name?: string, retention?: number | bigint, schedule?: string, enabled?: boolean }): Promise; + /** + * Update an existing policy using it's ID. + * + * @param {string} policyId - Policy ID. Choose a custom ID`. 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. + * @param {string} name - Policy name. Max length: 128 chars. + * @param {number | bigint} retention - Days to keep backups before deletion + * @param {string} schedule - Cron expression + * @param {boolean} enabled - Is Backup enabled? When set to 'disabled', No backup will be taken + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updatePolicy(policyId: string, name?: string, retention?: number | bigint, schedule?: string, enabled?: boolean): Promise; + updatePolicy( + paramsOrFirst: { policyId: string, name?: string, retention?: number | bigint, schedule?: string, enabled?: boolean } | string, + ...rest: [(string)?, (number | bigint)?, (string)?, (boolean)?] + ): Promise { + let params: { policyId: string, name?: string, retention?: number | bigint, schedule?: string, enabled?: boolean }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { policyId: string, name?: string, retention?: number | bigint, schedule?: string, enabled?: boolean }; + } else { + params = { + policyId: paramsOrFirst as string, + name: rest[0] as string, + retention: rest[1] as number | bigint, + schedule: rest[2] as string, + enabled: rest[3] as boolean + }; + } + + const policyId = params.policyId; + const name = params.name; + const retention = params.retention; + const schedule = params.schedule; + const enabled = params.enabled; + + if (typeof policyId === 'undefined') { + throw new AppwriteException('Missing required parameter: "policyId"'); + } + + const apiPath = '/backups/policies/{policyId}'.replace('{policyId}', policyId); + const payload: Payload = {}; + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof retention !== 'undefined') { + payload['retention'] = retention; + } + if (typeof schedule !== 'undefined') { + payload['schedule'] = schedule; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Delete a policy using it's ID. + * + * @param {string} params.policyId - Policy 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. + * @throws {AppwriteException} + * @returns {Promise<{}>} + */ + deletePolicy(params: { policyId: string }): Promise<{}>; + /** + * Delete a policy using it's ID. + * + * @param {string} policyId - Policy 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. + * @throws {AppwriteException} + * @returns {Promise<{}>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + deletePolicy(policyId: string): Promise<{}>; + deletePolicy( + paramsOrFirst: { policyId: string } | string + ): Promise<{}> { + let params: { policyId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { policyId: string }; + } else { + params = { + policyId: paramsOrFirst as string + }; + } + + const policyId = params.policyId; + + if (typeof policyId === 'undefined') { + throw new AppwriteException('Missing required parameter: "policyId"'); + } + + const apiPath = '/backups/policies/{policyId}'.replace('{policyId}', policyId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'delete', + uri, + apiHeaders, + payload, + ); + } + + /** + * Create and trigger a new restoration for a backup on a project. + * + * @param {string} params.archiveId - Backup archive ID to restore + * @param {string[]} params.services - Array of services to restore + * @param {string} params.newResourceId - Unique 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. + * @param {string} params.newResourceName - Database name. Max length: 128 chars. + * @throws {AppwriteException} + * @returns {Promise} + */ + createRestoration(params: { archiveId: string, services: string[], newResourceId?: string, newResourceName?: string }): Promise; + /** + * Create and trigger a new restoration for a backup on a project. + * + * @param {string} archiveId - Backup archive ID to restore + * @param {string[]} services - Array of services to restore + * @param {string} newResourceId - Unique 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. + * @param {string} newResourceName - Database name. Max length: 128 chars. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createRestoration(archiveId: string, services: string[], newResourceId?: string, newResourceName?: string): Promise; + createRestoration( + paramsOrFirst: { archiveId: string, services: string[], newResourceId?: string, newResourceName?: string } | string, + ...rest: [(string[])?, (string)?, (string)?] + ): Promise { + let params: { archiveId: string, services: string[], newResourceId?: string, newResourceName?: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { archiveId: string, services: string[], newResourceId?: string, newResourceName?: string }; + } else { + params = { + archiveId: paramsOrFirst as string, + services: rest[0] as string[], + newResourceId: rest[1] as string, + newResourceName: rest[2] as string + }; + } + + const archiveId = params.archiveId; + const services = params.services; + const newResourceId = params.newResourceId; + const newResourceName = params.newResourceName; + + if (typeof archiveId === 'undefined') { + throw new AppwriteException('Missing required parameter: "archiveId"'); + } + if (typeof services === 'undefined') { + throw new AppwriteException('Missing required parameter: "services"'); + } + + const apiPath = '/backups/restoration'; + const payload: Payload = {}; + if (typeof archiveId !== 'undefined') { + payload['archiveId'] = archiveId; + } + if (typeof services !== 'undefined') { + payload['services'] = services; + } + if (typeof newResourceId !== 'undefined') { + payload['newResourceId'] = newResourceId; + } + if (typeof newResourceName !== 'undefined') { + payload['newResourceName'] = newResourceName; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload, + ); + } + + /** + * List all backup restorations for a project. + * + * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @throws {AppwriteException} + * @returns {Promise} + */ + listRestorations(params?: { queries?: string[] }): Promise; + /** + * List all backup restorations for a project. + * + * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + listRestorations(queries?: string[]): Promise; + listRestorations( + paramsOrFirst?: { queries?: string[] } | string[] + ): Promise { + let params: { queries?: string[] }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { queries?: string[] }; + } else { + params = { + queries: paramsOrFirst as string[] + }; + } + + const queries = params.queries; + + + const apiPath = '/backups/restorations'; + const payload: Payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + + /** + * Get the current status of a backup restoration. + * + * @param {string} params.restorationId - Restoration ID. Choose a custom ID`. 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. + * @throws {AppwriteException} + * @returns {Promise} + */ + getRestoration(params: { restorationId: string }): Promise; + /** + * Get the current status of a backup restoration. + * + * @param {string} restorationId - Restoration ID. Choose a custom ID`. 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. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getRestoration(restorationId: string): Promise; + getRestoration( + paramsOrFirst: { restorationId: string } | string + ): Promise { + let params: { restorationId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { restorationId: string }; + } else { + params = { + restorationId: paramsOrFirst as string + }; + } + + const restorationId = params.restorationId; + + if (typeof restorationId === 'undefined') { + throw new AppwriteException('Missing required parameter: "restorationId"'); + } + + const apiPath = '/backups/restorations/{restorationId}'.replace('{restorationId}', restorationId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } +} diff --git a/src/services/databases.ts b/src/services/databases.ts index ad69b3e..f0d78cd 100644 --- a/src/services/databases.ts +++ b/src/services/databases.ts @@ -209,30 +209,30 @@ export class Databases { /** * Create a new transaction. * - * @param {number} params.ttl - Seconds before the transaction expires. + * @param {number | bigint} params.ttl - Seconds before the transaction expires. * @throws {AppwriteException} * @returns {Promise} */ - createTransaction(params?: { ttl?: number }): Promise; + createTransaction(params?: { ttl?: number | bigint }): Promise; /** * Create a new transaction. * - * @param {number} ttl - Seconds before the transaction expires. + * @param {number | bigint} ttl - Seconds before the transaction expires. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createTransaction(ttl?: number): Promise; + createTransaction(ttl?: number | bigint): Promise; createTransaction( - paramsOrFirst?: { ttl?: number } | number + paramsOrFirst?: { ttl?: number | bigint } | number | bigint ): Promise { - let params: { ttl?: number }; + let params: { ttl?: number | bigint }; if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { ttl?: number }; + params = (paramsOrFirst || {}) as { ttl?: number | bigint }; } else { params = { - ttl: paramsOrFirst as number + ttl: paramsOrFirst as number | bigint }; } @@ -1932,15 +1932,15 @@ export class Databases { * @param {string} params.collectionId - Collection ID. * @param {string} params.key - Attribute Key. * @param {boolean} params.required - Is attribute required? - * @param {number} params.min - Minimum value. - * @param {number} params.max - Maximum value. - * @param {number} params.xdefault - Default value. Cannot be set when required. + * @param {number | bigint} params.min - Minimum value. + * @param {number | bigint} params.max - Maximum value. + * @param {number | bigint} params.xdefault - Default value. Cannot be set when required. * @param {boolean} params.array - Is attribute an array? * @throws {AppwriteException} * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createFloatColumn` instead. */ - createFloatAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean }): Promise; + createFloatAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, min?: number | bigint, max?: number | bigint, xdefault?: number | bigint, array?: boolean }): Promise; /** * Create a float attribute. Optionally, minimum and maximum values can be provided. * @@ -1949,32 +1949,32 @@ export class Databases { * @param {string} collectionId - Collection ID. * @param {string} key - Attribute Key. * @param {boolean} required - Is attribute required? - * @param {number} min - Minimum value. - * @param {number} max - Maximum value. - * @param {number} xdefault - Default value. Cannot be set when required. + * @param {number | bigint} min - Minimum value. + * @param {number | bigint} max - Maximum value. + * @param {number | bigint} xdefault - Default value. Cannot be set when required. * @param {boolean} array - Is attribute an array? * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createFloatAttribute(databaseId: string, collectionId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean): Promise; + createFloatAttribute(databaseId: string, collectionId: string, key: string, required: boolean, min?: number | bigint, max?: number | bigint, xdefault?: number | bigint, array?: boolean): Promise; createFloatAttribute( - paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean } | string, - ...rest: [(string)?, (string)?, (boolean)?, (number)?, (number)?, (number)?, (boolean)?] + paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, min?: number | bigint, max?: number | bigint, xdefault?: number | bigint, array?: boolean } | string, + ...rest: [(string)?, (string)?, (boolean)?, (number | bigint)?, (number | bigint)?, (number | bigint)?, (boolean)?] ): Promise { - let params: { databaseId: string, collectionId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean }; + let params: { databaseId: string, collectionId: string, key: string, required: boolean, min?: number | bigint, max?: number | bigint, xdefault?: number | bigint, array?: boolean }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean }; + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, min?: number | bigint, max?: number | bigint, xdefault?: number | bigint, array?: boolean }; } else { params = { databaseId: paramsOrFirst as string, collectionId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - min: rest[3] as number, - max: rest[4] as number, - xdefault: rest[5] as number, + min: rest[3] as number | bigint, + max: rest[4] as number | bigint, + xdefault: rest[5] as number | bigint, array: rest[6] as boolean }; } @@ -2043,15 +2043,15 @@ export class Databases { * @param {string} params.collectionId - Collection ID. * @param {string} params.key - Attribute Key. * @param {boolean} params.required - Is attribute required? - * @param {number} params.xdefault - Default value. Cannot be set when required. - * @param {number} params.min - Minimum value. - * @param {number} params.max - Maximum value. + * @param {number | bigint} params.xdefault - Default value. Cannot be set when required. + * @param {number | bigint} params.min - Minimum value. + * @param {number | bigint} params.max - Maximum value. * @param {string} params.newKey - New Attribute Key. * @throws {AppwriteException} * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateFloatColumn` instead. */ - updateFloatAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string }): Promise; + updateFloatAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number | bigint, min?: number | bigint, max?: number | bigint, newKey?: string }): Promise; /** * Update a float attribute. Changing the `default` value will not update already existing documents. * @@ -2060,32 +2060,32 @@ export class Databases { * @param {string} collectionId - Collection ID. * @param {string} key - Attribute Key. * @param {boolean} required - Is attribute required? - * @param {number} xdefault - Default value. Cannot be set when required. - * @param {number} min - Minimum value. - * @param {number} max - Maximum value. + * @param {number | bigint} xdefault - Default value. Cannot be set when required. + * @param {number | bigint} min - Minimum value. + * @param {number | bigint} max - Maximum value. * @param {string} newKey - New Attribute Key. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateFloatAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string): Promise; + updateFloatAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number | bigint, min?: number | bigint, max?: number | bigint, newKey?: string): Promise; updateFloatAttribute( - paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string } | string, - ...rest: [(string)?, (string)?, (boolean)?, (number)?, (number)?, (number)?, (string)?] + paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number | bigint, min?: number | bigint, max?: number | bigint, newKey?: string } | string, + ...rest: [(string)?, (string)?, (boolean)?, (number | bigint)?, (number | bigint)?, (number | bigint)?, (string)?] ): Promise { - let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string }; + let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number | bigint, min?: number | bigint, max?: number | bigint, newKey?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string }; + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number | bigint, min?: number | bigint, max?: number | bigint, newKey?: string }; } else { params = { databaseId: paramsOrFirst as string, collectionId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as number, - min: rest[4] as number, - max: rest[5] as number, + xdefault: rest[3] as number | bigint, + min: rest[4] as number | bigint, + max: rest[5] as number | bigint, newKey: rest[6] as string }; } @@ -2154,15 +2154,15 @@ export class Databases { * @param {string} params.collectionId - Collection ID. * @param {string} params.key - Attribute Key. * @param {boolean} params.required - Is attribute required? - * @param {number} params.min - Minimum value - * @param {number} params.max - Maximum value - * @param {number} params.xdefault - Default value. Cannot be set when attribute is required. + * @param {number | bigint} params.min - Minimum value + * @param {number | bigint} params.max - Maximum value + * @param {number | bigint} params.xdefault - Default value. Cannot be set when attribute is required. * @param {boolean} params.array - Is attribute an array? * @throws {AppwriteException} * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createIntegerColumn` instead. */ - createIntegerAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean }): Promise; + createIntegerAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, min?: number | bigint, max?: number | bigint, xdefault?: number | bigint, array?: boolean }): Promise; /** * Create an integer attribute. Optionally, minimum and maximum values can be provided. * @@ -2171,32 +2171,32 @@ export class Databases { * @param {string} collectionId - Collection ID. * @param {string} key - Attribute Key. * @param {boolean} required - Is attribute required? - * @param {number} min - Minimum value - * @param {number} max - Maximum value - * @param {number} xdefault - Default value. Cannot be set when attribute is required. + * @param {number | bigint} min - Minimum value + * @param {number | bigint} max - Maximum value + * @param {number | bigint} xdefault - Default value. Cannot be set when attribute is required. * @param {boolean} array - Is attribute an array? * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createIntegerAttribute(databaseId: string, collectionId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean): Promise; + createIntegerAttribute(databaseId: string, collectionId: string, key: string, required: boolean, min?: number | bigint, max?: number | bigint, xdefault?: number | bigint, array?: boolean): Promise; createIntegerAttribute( - paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean } | string, - ...rest: [(string)?, (string)?, (boolean)?, (number)?, (number)?, (number)?, (boolean)?] + paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, min?: number | bigint, max?: number | bigint, xdefault?: number | bigint, array?: boolean } | string, + ...rest: [(string)?, (string)?, (boolean)?, (number | bigint)?, (number | bigint)?, (number | bigint)?, (boolean)?] ): Promise { - let params: { databaseId: string, collectionId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean }; + let params: { databaseId: string, collectionId: string, key: string, required: boolean, min?: number | bigint, max?: number | bigint, xdefault?: number | bigint, array?: boolean }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean }; + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, min?: number | bigint, max?: number | bigint, xdefault?: number | bigint, array?: boolean }; } else { params = { databaseId: paramsOrFirst as string, collectionId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - min: rest[3] as number, - max: rest[4] as number, - xdefault: rest[5] as number, + min: rest[3] as number | bigint, + max: rest[4] as number | bigint, + xdefault: rest[5] as number | bigint, array: rest[6] as boolean }; } @@ -2265,15 +2265,15 @@ export class Databases { * @param {string} params.collectionId - Collection ID. * @param {string} params.key - Attribute Key. * @param {boolean} params.required - Is attribute required? - * @param {number} params.xdefault - Default value. Cannot be set when attribute is required. - * @param {number} params.min - Minimum value - * @param {number} params.max - Maximum value + * @param {number | bigint} params.xdefault - Default value. Cannot be set when attribute is required. + * @param {number | bigint} params.min - Minimum value + * @param {number | bigint} params.max - Maximum value * @param {string} params.newKey - New Attribute Key. * @throws {AppwriteException} * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateIntegerColumn` instead. */ - updateIntegerAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string }): Promise; + updateIntegerAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number | bigint, min?: number | bigint, max?: number | bigint, newKey?: string }): Promise; /** * Update an integer attribute. Changing the `default` value will not update already existing documents. * @@ -2282,32 +2282,32 @@ export class Databases { * @param {string} collectionId - Collection ID. * @param {string} key - Attribute Key. * @param {boolean} required - Is attribute required? - * @param {number} xdefault - Default value. Cannot be set when attribute is required. - * @param {number} min - Minimum value - * @param {number} max - Maximum value + * @param {number | bigint} xdefault - Default value. Cannot be set when attribute is required. + * @param {number | bigint} min - Minimum value + * @param {number | bigint} max - Maximum value * @param {string} newKey - New Attribute Key. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateIntegerAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string): Promise; + updateIntegerAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number | bigint, min?: number | bigint, max?: number | bigint, newKey?: string): Promise; updateIntegerAttribute( - paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string } | string, - ...rest: [(string)?, (string)?, (boolean)?, (number)?, (number)?, (number)?, (string)?] + paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number | bigint, min?: number | bigint, max?: number | bigint, newKey?: string } | string, + ...rest: [(string)?, (string)?, (boolean)?, (number | bigint)?, (number | bigint)?, (number | bigint)?, (string)?] ): Promise { - let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string }; + let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number | bigint, min?: number | bigint, max?: number | bigint, newKey?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string }; + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number | bigint, min?: number | bigint, max?: number | bigint, newKey?: string }; } else { params = { databaseId: paramsOrFirst as string, collectionId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as number, - min: rest[4] as number, - max: rest[5] as number, + xdefault: rest[3] as number | bigint, + min: rest[4] as number | bigint, + max: rest[5] as number | bigint, newKey: rest[6] as string }; } @@ -3220,7 +3220,7 @@ export class Databases { * @param {string} params.databaseId - Database ID. * @param {string} params.collectionId - Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @param {string} params.key - Attribute Key. - * @param {number} params.size - Attribute size for text attributes, in number of characters. + * @param {number | bigint} params.size - Attribute size for text attributes, in number of characters. * @param {boolean} params.required - Is attribute required? * @param {string} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. * @param {boolean} params.array - Is attribute an array? @@ -3229,7 +3229,7 @@ export class Databases { * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createStringColumn` instead. */ - createStringAttribute(params: { databaseId: string, collectionId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean }): Promise; + createStringAttribute(params: { databaseId: string, collectionId: string, key: string, size: number | bigint, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean }): Promise; /** * Create a string attribute. * @@ -3237,7 +3237,7 @@ export class Databases { * @param {string} databaseId - Database ID. * @param {string} collectionId - Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @param {string} key - Attribute Key. - * @param {number} size - Attribute size for text attributes, in number of characters. + * @param {number | bigint} size - Attribute size for text attributes, in number of characters. * @param {boolean} required - Is attribute required? * @param {string} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. * @param {boolean} array - Is attribute an array? @@ -3246,21 +3246,21 @@ export class Databases { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createStringAttribute(databaseId: string, collectionId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean): Promise; + createStringAttribute(databaseId: string, collectionId: string, key: string, size: number | bigint, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean): Promise; createStringAttribute( - paramsOrFirst: { databaseId: string, collectionId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean } | string, - ...rest: [(string)?, (string)?, (number)?, (boolean)?, (string)?, (boolean)?, (boolean)?] + paramsOrFirst: { databaseId: string, collectionId: string, key: string, size: number | bigint, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean } | string, + ...rest: [(string)?, (string)?, (number | bigint)?, (boolean)?, (string)?, (boolean)?, (boolean)?] ): Promise { - let params: { databaseId: string, collectionId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean }; + let params: { databaseId: string, collectionId: string, key: string, size: number | bigint, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean }; + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, size: number | bigint, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean }; } else { params = { databaseId: paramsOrFirst as string, collectionId: rest[0] as string, key: rest[1] as string, - size: rest[2] as number, + size: rest[2] as number | bigint, required: rest[3] as boolean, xdefault: rest[4] as string, array: rest[5] as boolean, @@ -3336,13 +3336,13 @@ export class Databases { * @param {string} params.key - Attribute Key. * @param {boolean} params.required - Is attribute required? * @param {string} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. - * @param {number} params.size - Maximum size of the string attribute. + * @param {number | bigint} params.size - Maximum size of the string attribute. * @param {string} params.newKey - New Attribute Key. * @throws {AppwriteException} * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateStringColumn` instead. */ - updateStringAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, size?: number, newKey?: string }): Promise; + updateStringAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, size?: number | bigint, newKey?: string }): Promise; /** * Update a string attribute. Changing the `default` value will not update already existing documents. * @@ -3352,21 +3352,21 @@ export class Databases { * @param {string} key - Attribute Key. * @param {boolean} required - Is attribute required? * @param {string} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. - * @param {number} size - Maximum size of the string attribute. + * @param {number | bigint} size - Maximum size of the string attribute. * @param {string} newKey - New Attribute Key. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateStringAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, size?: number, newKey?: string): Promise; + updateStringAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, size?: number | bigint, newKey?: string): Promise; updateStringAttribute( - paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, size?: number, newKey?: string } | string, - ...rest: [(string)?, (string)?, (boolean)?, (string)?, (number)?, (string)?] + paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, size?: number | bigint, newKey?: string } | string, + ...rest: [(string)?, (string)?, (boolean)?, (string)?, (number | bigint)?, (string)?] ): Promise { - let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, size?: number, newKey?: string }; + let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, size?: number | bigint, newKey?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, size?: number, newKey?: string }; + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, size?: number | bigint, newKey?: string }; } else { params = { databaseId: paramsOrFirst as string, @@ -3374,7 +3374,7 @@ export class Databases { key: rest[1] as string, required: rest[2] as boolean, xdefault: rest[3] as string, - size: rest[4] as number, + size: rest[4] as number | bigint, newKey: rest[5] as string }; } @@ -3632,10 +3632,10 @@ export class Databases { * @param {string} params.collectionId - Collection ID. * @param {string} params.key - Attribute Key. * @throws {AppwriteException} - * @returns {Promise<{}>} + * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.getColumn` instead. */ - getAttribute(params: { databaseId: string, collectionId: string, key: string }): Promise<{}>; + getAttribute(params: { databaseId: string, collectionId: string, key: string }): Promise; /** * Get attribute by ID. * @@ -3643,14 +3643,14 @@ export class Databases { * @param {string} collectionId - Collection ID. * @param {string} key - Attribute Key. * @throws {AppwriteException} - * @returns {Promise<{}>} + * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getAttribute(databaseId: string, collectionId: string, key: string): Promise<{}>; + getAttribute(databaseId: string, collectionId: string, key: string): Promise; getAttribute( paramsOrFirst: { databaseId: string, collectionId: string, key: string } | string, ...rest: [(string)?, (string)?] - ): Promise<{}> { + ): Promise { let params: { databaseId: string, collectionId: string, key: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { @@ -4429,7 +4429,7 @@ export class Databases { * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.upsertRow` instead. */ - upsertDocument(params: { databaseId: string, collectionId: string, documentId: string, data: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string }): Promise; + upsertDocument(params: { databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string }): Promise; /** * Create or update a 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. * @@ -4443,15 +4443,15 @@ export class Databases { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - upsertDocument(databaseId: string, collectionId: string, documentId: string, data: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string): Promise; + upsertDocument(databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string): Promise; upsertDocument( - paramsOrFirst: { databaseId: string, collectionId: string, documentId: string, data: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string } | string, + paramsOrFirst: { databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string } | string, ...rest: [(string)?, (string)?, (Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>)?, (string[])?, (string)?] ): Promise { - let params: { databaseId: string, collectionId: string, documentId: string, data: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string }; + let params: { databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, documentId: string, data: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string }; + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string }; } else { params = { databaseId: paramsOrFirst as string, @@ -4479,9 +4479,6 @@ export class Databases { if (typeof documentId === 'undefined') { throw new AppwriteException('Missing required parameter: "documentId"'); } - if (typeof data === 'undefined') { - throw new AppwriteException('Missing required parameter: "data"'); - } const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId); const payload: Payload = {}; @@ -4679,14 +4676,14 @@ export class Databases { * @param {string} params.collectionId - Collection ID. * @param {string} params.documentId - Document ID. * @param {string} params.attribute - Attribute key. - * @param {number} params.value - Value to increment the attribute by. The value must be a number. - * @param {number} params.min - Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown. + * @param {number | bigint} params.value - Value to increment the attribute by. The value must be a number. + * @param {number | bigint} params.min - Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown. * @param {string} params.transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.decrementRowColumn` instead. */ - decrementDocumentAttribute(params: { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, min?: number, transactionId?: string }): Promise; + decrementDocumentAttribute(params: { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number | bigint, min?: number | bigint, transactionId?: string }): Promise; /** * Decrement a specific attribute of a document by a given value. * @@ -4694,30 +4691,30 @@ export class Databases { * @param {string} collectionId - Collection ID. * @param {string} documentId - Document ID. * @param {string} attribute - Attribute key. - * @param {number} value - Value to increment the attribute by. The value must be a number. - * @param {number} min - Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown. + * @param {number | bigint} value - Value to increment the attribute by. The value must be a number. + * @param {number | bigint} min - Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown. * @param {string} transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - decrementDocumentAttribute(databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, min?: number, transactionId?: string): Promise; + decrementDocumentAttribute(databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number | bigint, min?: number | bigint, transactionId?: string): Promise; decrementDocumentAttribute( - paramsOrFirst: { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, min?: number, transactionId?: string } | string, - ...rest: [(string)?, (string)?, (string)?, (number)?, (number)?, (string)?] + paramsOrFirst: { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number | bigint, min?: number | bigint, transactionId?: string } | string, + ...rest: [(string)?, (string)?, (string)?, (number | bigint)?, (number | bigint)?, (string)?] ): Promise { - let params: { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, min?: number, transactionId?: string }; + let params: { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number | bigint, min?: number | bigint, transactionId?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, min?: number, transactionId?: string }; + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number | bigint, min?: number | bigint, transactionId?: string }; } else { params = { databaseId: paramsOrFirst as string, collectionId: rest[0] as string, documentId: rest[1] as string, attribute: rest[2] as string, - value: rest[3] as number, - min: rest[4] as number, + value: rest[3] as number | bigint, + min: rest[4] as number | bigint, transactionId: rest[5] as string }; } @@ -4775,14 +4772,14 @@ export class Databases { * @param {string} params.collectionId - Collection ID. * @param {string} params.documentId - Document ID. * @param {string} params.attribute - Attribute key. - * @param {number} params.value - Value to increment the attribute by. The value must be a number. - * @param {number} params.max - Maximum value for the attribute. If the current value is greater than this value, an error will be thrown. + * @param {number | bigint} params.value - Value to increment the attribute by. The value must be a number. + * @param {number | bigint} params.max - Maximum value for the attribute. If the current value is greater than this value, an error will be thrown. * @param {string} params.transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.incrementRowColumn` instead. */ - incrementDocumentAttribute(params: { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, max?: number, transactionId?: string }): Promise; + incrementDocumentAttribute(params: { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number | bigint, max?: number | bigint, transactionId?: string }): Promise; /** * Increment a specific attribute of a document by a given value. * @@ -4790,30 +4787,30 @@ export class Databases { * @param {string} collectionId - Collection ID. * @param {string} documentId - Document ID. * @param {string} attribute - Attribute key. - * @param {number} value - Value to increment the attribute by. The value must be a number. - * @param {number} max - Maximum value for the attribute. If the current value is greater than this value, an error will be thrown. + * @param {number | bigint} value - Value to increment the attribute by. The value must be a number. + * @param {number | bigint} max - Maximum value for the attribute. If the current value is greater than this value, an error will be thrown. * @param {string} transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - incrementDocumentAttribute(databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, max?: number, transactionId?: string): Promise; + incrementDocumentAttribute(databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number | bigint, max?: number | bigint, transactionId?: string): Promise; incrementDocumentAttribute( - paramsOrFirst: { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, max?: number, transactionId?: string } | string, - ...rest: [(string)?, (string)?, (string)?, (number)?, (number)?, (string)?] + paramsOrFirst: { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number | bigint, max?: number | bigint, transactionId?: string } | string, + ...rest: [(string)?, (string)?, (string)?, (number | bigint)?, (number | bigint)?, (string)?] ): Promise { - let params: { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, max?: number, transactionId?: string }; + let params: { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number | bigint, max?: number | bigint, transactionId?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, max?: number, transactionId?: string }; + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number | bigint, max?: number | bigint, transactionId?: string }; } else { params = { databaseId: paramsOrFirst as string, collectionId: rest[0] as string, documentId: rest[1] as string, attribute: rest[2] as string, - value: rest[3] as number, - max: rest[4] as number, + value: rest[3] as number | bigint, + max: rest[4] as number | bigint, transactionId: rest[5] as string }; } @@ -4948,12 +4945,12 @@ export class Databases { * @param {IndexType} params.type - Index type. * @param {string[]} params.attributes - Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long. * @param {string[]} params.orders - Array of index orders. Maximum of 100 orders are allowed. - * @param {number[]} params.lengths - Length of index. Maximum of 100 + * @param {number | bigint[]} params.lengths - Length of index. Maximum of 100 * @throws {AppwriteException} * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createIndex` instead. */ - createIndex(params: { databaseId: string, collectionId: string, key: string, type: IndexType, attributes: string[], orders?: string[], lengths?: number[] }): Promise; + createIndex(params: { databaseId: string, collectionId: string, key: string, type: IndexType, attributes: string[], orders?: string[], lengths?: number | bigint[] }): Promise; /** * Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request. * Attributes can be `key`, `fulltext`, and `unique`. @@ -4964,20 +4961,20 @@ export class Databases { * @param {IndexType} type - Index type. * @param {string[]} attributes - Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long. * @param {string[]} orders - Array of index orders. Maximum of 100 orders are allowed. - * @param {number[]} lengths - Length of index. Maximum of 100 + * @param {number | bigint[]} lengths - Length of index. Maximum of 100 * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createIndex(databaseId: string, collectionId: string, key: string, type: IndexType, attributes: string[], orders?: string[], lengths?: number[]): Promise; + createIndex(databaseId: string, collectionId: string, key: string, type: IndexType, attributes: string[], orders?: string[], lengths?: number | bigint[]): Promise; createIndex( - paramsOrFirst: { databaseId: string, collectionId: string, key: string, type: IndexType, attributes: string[], orders?: string[], lengths?: number[] } | string, - ...rest: [(string)?, (string)?, (IndexType)?, (string[])?, (string[])?, (number[])?] + paramsOrFirst: { databaseId: string, collectionId: string, key: string, type: IndexType, attributes: string[], orders?: string[], lengths?: number | bigint[] } | string, + ...rest: [(string)?, (string)?, (IndexType)?, (string[])?, (string[])?, (number | bigint[])?] ): Promise { - let params: { databaseId: string, collectionId: string, key: string, type: IndexType, attributes: string[], orders?: string[], lengths?: number[] }; + let params: { databaseId: string, collectionId: string, key: string, type: IndexType, attributes: string[], orders?: string[], lengths?: number | bigint[] }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, type: IndexType, attributes: string[], orders?: string[], lengths?: number[] }; + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, type: IndexType, attributes: string[], orders?: string[], lengths?: number | bigint[] }; } else { params = { databaseId: paramsOrFirst as string, @@ -4986,7 +4983,7 @@ export class Databases { type: rest[2] as IndexType, attributes: rest[3] as string[], orders: rest[4] as string[], - lengths: rest[5] as number[] + lengths: rest[5] as number | bigint[] }; } diff --git a/src/services/functions.ts b/src/services/functions.ts index aa14dcd..93c46a5 100644 --- a/src/services/functions.ts +++ b/src/services/functions.ts @@ -89,7 +89,7 @@ export class Functions { * @param {string[]} params.execute - An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long. * @param {string[]} params.events - Events list. Maximum of 100 events are allowed. * @param {string} params.schedule - Schedule CRON syntax. - * @param {number} params.timeout - Function maximum execution time in seconds. + * @param {number | bigint} params.timeout - Function maximum execution time in seconds. * @param {boolean} params.enabled - Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled. * @param {boolean} params.logging - When disabled, executions will exclude logs and errors, and will be slightly faster. * @param {string} params.entrypoint - Entrypoint File. This path is relative to the "providerRootDirectory". @@ -104,7 +104,7 @@ export class Functions { * @throws {AppwriteException} * @returns {Promise} */ - create(params: { functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string }): Promise; + create(params: { functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number | bigint, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string }): Promise; /** * Create a new function. You can pass a list of [permissions](https://appwrite.io/docs/permissions) to allow different project users or team with access to execute the function using the client API. * @@ -114,7 +114,7 @@ export class Functions { * @param {string[]} execute - An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long. * @param {string[]} events - Events list. Maximum of 100 events are allowed. * @param {string} schedule - Schedule CRON syntax. - * @param {number} timeout - Function maximum execution time in seconds. + * @param {number | bigint} timeout - Function maximum execution time in seconds. * @param {boolean} enabled - Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled. * @param {boolean} logging - When disabled, executions will exclude logs and errors, and will be slightly faster. * @param {string} entrypoint - Entrypoint File. This path is relative to the "providerRootDirectory". @@ -130,15 +130,15 @@ export class Functions { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - create(functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string): Promise; + create(functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number | bigint, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string): Promise; create( - paramsOrFirst: { functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string } | string, - ...rest: [(string)?, (Runtime)?, (string[])?, (string[])?, (string)?, (number)?, (boolean)?, (boolean)?, (string)?, (string)?, (string[])?, (string)?, (string)?, (string)?, (boolean)?, (string)?, (string)?] + paramsOrFirst: { functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number | bigint, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string } | string, + ...rest: [(string)?, (Runtime)?, (string[])?, (string[])?, (string)?, (number | bigint)?, (boolean)?, (boolean)?, (string)?, (string)?, (string[])?, (string)?, (string)?, (string)?, (boolean)?, (string)?, (string)?] ): Promise { - let params: { functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string }; + let params: { functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number | bigint, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string }; + params = (paramsOrFirst || {}) as { functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number | bigint, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string }; } else { params = { functionId: paramsOrFirst as string, @@ -147,7 +147,7 @@ export class Functions { execute: rest[2] as string[], events: rest[3] as string[], schedule: rest[4] as string, - timeout: rest[5] as number, + timeout: rest[5] as number | bigint, enabled: rest[6] as boolean, logging: rest[7] as boolean, entrypoint: rest[8] as string, @@ -367,7 +367,7 @@ export class Functions { * @param {string[]} params.execute - An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long. * @param {string[]} params.events - Events list. Maximum of 100 events are allowed. * @param {string} params.schedule - Schedule CRON syntax. - * @param {number} params.timeout - Maximum execution time in seconds. + * @param {number | bigint} params.timeout - Maximum execution time in seconds. * @param {boolean} params.enabled - Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled. * @param {boolean} params.logging - When disabled, executions will exclude logs and errors, and will be slightly faster. * @param {string} params.entrypoint - Entrypoint File. This path is relative to the "providerRootDirectory". @@ -382,7 +382,7 @@ export class Functions { * @throws {AppwriteException} * @returns {Promise} */ - update(params: { functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string }): Promise; + update(params: { functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number | bigint, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string }): Promise; /** * Update function by its unique ID. * @@ -392,7 +392,7 @@ export class Functions { * @param {string[]} execute - An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long. * @param {string[]} events - Events list. Maximum of 100 events are allowed. * @param {string} schedule - Schedule CRON syntax. - * @param {number} timeout - Maximum execution time in seconds. + * @param {number | bigint} timeout - Maximum execution time in seconds. * @param {boolean} enabled - Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled. * @param {boolean} logging - When disabled, executions will exclude logs and errors, and will be slightly faster. * @param {string} entrypoint - Entrypoint File. This path is relative to the "providerRootDirectory". @@ -408,15 +408,15 @@ export class Functions { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - update(functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string): Promise; + update(functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number | bigint, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string): Promise; update( - paramsOrFirst: { functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string } | string, - ...rest: [(string)?, (Runtime)?, (string[])?, (string[])?, (string)?, (number)?, (boolean)?, (boolean)?, (string)?, (string)?, (string[])?, (string)?, (string)?, (string)?, (boolean)?, (string)?, (string)?] + paramsOrFirst: { functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number | bigint, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string } | string, + ...rest: [(string)?, (Runtime)?, (string[])?, (string[])?, (string)?, (number | bigint)?, (boolean)?, (boolean)?, (string)?, (string)?, (string[])?, (string)?, (string)?, (string)?, (boolean)?, (string)?, (string)?] ): Promise { - let params: { functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string }; + let params: { functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number | bigint, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string }; + params = (paramsOrFirst || {}) as { functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number | bigint, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string }; } else { params = { functionId: paramsOrFirst as string, @@ -425,7 +425,7 @@ export class Functions { execute: rest[2] as string[], events: rest[3] as string[], schedule: rest[4] as string, - timeout: rest[5] as number, + timeout: rest[5] as number | bigint, enabled: rest[6] as boolean, logging: rest[7] as boolean, entrypoint: rest[8] as string, diff --git a/src/services/health.ts b/src/services/health.ts index 8049935..44acd21 100644 --- a/src/services/health.ts +++ b/src/services/health.ts @@ -176,33 +176,135 @@ export class Health { ); } + /** + * Get billing project aggregation queue. + * + * @param {number | bigint} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @throws {AppwriteException} + * @returns {Promise} + */ + getQueueBillingProjectAggregation(params?: { threshold?: number | bigint }): Promise; + /** + * Get billing project aggregation queue. + * + * @param {number | bigint} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getQueueBillingProjectAggregation(threshold?: number | bigint): Promise; + getQueueBillingProjectAggregation( + paramsOrFirst?: { threshold?: number | bigint } | number | bigint + ): Promise { + let params: { threshold?: number | bigint }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { threshold?: number | bigint }; + } else { + params = { + threshold: paramsOrFirst as number | bigint + }; + } + + const threshold = params.threshold; + + + const apiPath = '/health/queue/billing-project-aggregation'; + const payload: Payload = {}; + if (typeof threshold !== 'undefined') { + payload['threshold'] = threshold; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + + /** + * Get billing team aggregation queue. + * + * @param {number | bigint} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @throws {AppwriteException} + * @returns {Promise} + */ + getQueueBillingTeamAggregation(params?: { threshold?: number | bigint }): Promise; + /** + * Get billing team aggregation queue. + * + * @param {number | bigint} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getQueueBillingTeamAggregation(threshold?: number | bigint): Promise; + getQueueBillingTeamAggregation( + paramsOrFirst?: { threshold?: number | bigint } | number | bigint + ): Promise { + let params: { threshold?: number | bigint }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { threshold?: number | bigint }; + } else { + params = { + threshold: paramsOrFirst as number | bigint + }; + } + + const threshold = params.threshold; + + + const apiPath = '/health/queue/billing-team-aggregation'; + const payload: Payload = {}; + if (typeof threshold !== 'undefined') { + payload['threshold'] = threshold; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + /** * Get the number of builds that are waiting to be processed in the Appwrite internal queue server. * - * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @param {number | bigint} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} */ - getQueueBuilds(params?: { threshold?: number }): Promise; + getQueueBuilds(params?: { threshold?: number | bigint }): Promise; /** * Get the number of builds that are waiting to be processed in the Appwrite internal queue server. * - * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @param {number | bigint} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getQueueBuilds(threshold?: number): Promise; + getQueueBuilds(threshold?: number | bigint): Promise; getQueueBuilds( - paramsOrFirst?: { threshold?: number } | number + paramsOrFirst?: { threshold?: number | bigint } | number | bigint ): Promise { - let params: { threshold?: number }; + let params: { threshold?: number | bigint }; if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { threshold?: number }; + params = (paramsOrFirst || {}) as { threshold?: number | bigint }; } else { params = { - threshold: paramsOrFirst as number + threshold: paramsOrFirst as number | bigint }; } @@ -227,33 +329,84 @@ export class Health { ); } + /** + * Get the priority builds queue size. + * + * @param {number | bigint} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 500. + * @throws {AppwriteException} + * @returns {Promise} + */ + getQueuePriorityBuilds(params?: { threshold?: number | bigint }): Promise; + /** + * Get the priority builds queue size. + * + * @param {number | bigint} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 500. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getQueuePriorityBuilds(threshold?: number | bigint): Promise; + getQueuePriorityBuilds( + paramsOrFirst?: { threshold?: number | bigint } | number | bigint + ): Promise { + let params: { threshold?: number | bigint }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { threshold?: number | bigint }; + } else { + params = { + threshold: paramsOrFirst as number | bigint + }; + } + + const threshold = params.threshold; + + + const apiPath = '/health/queue/builds-priority'; + const payload: Payload = {}; + if (typeof threshold !== 'undefined') { + payload['threshold'] = threshold; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + /** * Get the number of certificates that are waiting to be issued against [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue server. * - * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @param {number | bigint} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} */ - getQueueCertificates(params?: { threshold?: number }): Promise; + getQueueCertificates(params?: { threshold?: number | bigint }): Promise; /** * Get the number of certificates that are waiting to be issued against [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue server. * - * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @param {number | bigint} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getQueueCertificates(threshold?: number): Promise; + getQueueCertificates(threshold?: number | bigint): Promise; getQueueCertificates( - paramsOrFirst?: { threshold?: number } | number + paramsOrFirst?: { threshold?: number | bigint } | number | bigint ): Promise { - let params: { threshold?: number }; + let params: { threshold?: number | bigint }; if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { threshold?: number }; + params = (paramsOrFirst || {}) as { threshold?: number | bigint }; } else { params = { - threshold: paramsOrFirst as number + threshold: paramsOrFirst as number | bigint }; } @@ -282,33 +435,33 @@ export class Health { * Get the number of database changes that are waiting to be processed in the Appwrite internal queue server. * * @param {string} params.name - Queue name for which to check the queue size - * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @param {number | bigint} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} */ - getQueueDatabases(params?: { name?: string, threshold?: number }): Promise; + getQueueDatabases(params?: { name?: string, threshold?: number | bigint }): Promise; /** * Get the number of database changes that are waiting to be processed in the Appwrite internal queue server. * * @param {string} name - Queue name for which to check the queue size - * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @param {number | bigint} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getQueueDatabases(name?: string, threshold?: number): Promise; + getQueueDatabases(name?: string, threshold?: number | bigint): Promise; getQueueDatabases( - paramsOrFirst?: { name?: string, threshold?: number } | string, - ...rest: [(number)?] + paramsOrFirst?: { name?: string, threshold?: number | bigint } | string, + ...rest: [(number | bigint)?] ): Promise { - let params: { name?: string, threshold?: number }; + let params: { name?: string, threshold?: number | bigint }; if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { name?: string, threshold?: number }; + params = (paramsOrFirst || {}) as { name?: string, threshold?: number | bigint }; } else { params = { name: paramsOrFirst as string, - threshold: rest[0] as number + threshold: rest[0] as number | bigint }; } @@ -340,30 +493,30 @@ export class Health { /** * Get the number of background destructive changes that are waiting to be processed in the Appwrite internal queue server. * - * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @param {number | bigint} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} */ - getQueueDeletes(params?: { threshold?: number }): Promise; + getQueueDeletes(params?: { threshold?: number | bigint }): Promise; /** * Get the number of background destructive changes that are waiting to be processed in the Appwrite internal queue server. * - * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @param {number | bigint} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getQueueDeletes(threshold?: number): Promise; + getQueueDeletes(threshold?: number | bigint): Promise; getQueueDeletes( - paramsOrFirst?: { threshold?: number } | number + paramsOrFirst?: { threshold?: number | bigint } | number | bigint ): Promise { - let params: { threshold?: number }; + let params: { threshold?: number | bigint }; if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { threshold?: number }; + params = (paramsOrFirst || {}) as { threshold?: number | bigint }; } else { params = { - threshold: paramsOrFirst as number + threshold: paramsOrFirst as number | bigint }; } @@ -393,34 +546,34 @@ export class Health { * * * @param {Name} params.name - The name of the queue - * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @param {number | bigint} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} */ - getFailedJobs(params: { name: Name, threshold?: number }): Promise; + getFailedJobs(params: { name: Name, threshold?: number | bigint }): Promise; /** * Returns the amount of failed jobs in a given queue. * * * @param {Name} name - The name of the queue - * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @param {number | bigint} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getFailedJobs(name: Name, threshold?: number): Promise; + getFailedJobs(name: Name, threshold?: number | bigint): Promise; getFailedJobs( - paramsOrFirst: { name: Name, threshold?: number } | Name, - ...rest: [(number)?] + paramsOrFirst: { name: Name, threshold?: number | bigint } | Name, + ...rest: [(number | bigint)?] ): Promise { - let params: { name: Name, threshold?: number }; + let params: { name: Name, threshold?: number | bigint }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'name' in paramsOrFirst)) { - params = (paramsOrFirst || {}) as { name: Name, threshold?: number }; + params = (paramsOrFirst || {}) as { name: Name, threshold?: number | bigint }; } else { params = { name: paramsOrFirst as Name, - threshold: rest[0] as number + threshold: rest[0] as number | bigint }; } @@ -452,30 +605,30 @@ export class Health { /** * Get the number of function executions that are waiting to be processed in the Appwrite internal queue server. * - * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @param {number | bigint} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} */ - getQueueFunctions(params?: { threshold?: number }): Promise; + getQueueFunctions(params?: { threshold?: number | bigint }): Promise; /** * Get the number of function executions that are waiting to be processed in the Appwrite internal queue server. * - * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @param {number | bigint} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getQueueFunctions(threshold?: number): Promise; + getQueueFunctions(threshold?: number | bigint): Promise; getQueueFunctions( - paramsOrFirst?: { threshold?: number } | number + paramsOrFirst?: { threshold?: number | bigint } | number | bigint ): Promise { - let params: { threshold?: number }; + let params: { threshold?: number | bigint }; if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { threshold?: number }; + params = (paramsOrFirst || {}) as { threshold?: number | bigint }; } else { params = { - threshold: paramsOrFirst as number + threshold: paramsOrFirst as number | bigint }; } @@ -503,30 +656,30 @@ export class Health { /** * Get the number of logs that are waiting to be processed in the Appwrite internal queue server. * - * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @param {number | bigint} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} */ - getQueueLogs(params?: { threshold?: number }): Promise; + getQueueLogs(params?: { threshold?: number | bigint }): Promise; /** * Get the number of logs that are waiting to be processed in the Appwrite internal queue server. * - * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @param {number | bigint} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getQueueLogs(threshold?: number): Promise; + getQueueLogs(threshold?: number | bigint): Promise; getQueueLogs( - paramsOrFirst?: { threshold?: number } | number + paramsOrFirst?: { threshold?: number | bigint } | number | bigint ): Promise { - let params: { threshold?: number }; + let params: { threshold?: number | bigint }; if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { threshold?: number }; + params = (paramsOrFirst || {}) as { threshold?: number | bigint }; } else { params = { - threshold: paramsOrFirst as number + threshold: paramsOrFirst as number | bigint }; } @@ -554,30 +707,30 @@ export class Health { /** * Get the number of mails that are waiting to be processed in the Appwrite internal queue server. * - * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @param {number | bigint} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} */ - getQueueMails(params?: { threshold?: number }): Promise; + getQueueMails(params?: { threshold?: number | bigint }): Promise; /** * Get the number of mails that are waiting to be processed in the Appwrite internal queue server. * - * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @param {number | bigint} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getQueueMails(threshold?: number): Promise; + getQueueMails(threshold?: number | bigint): Promise; getQueueMails( - paramsOrFirst?: { threshold?: number } | number + paramsOrFirst?: { threshold?: number | bigint } | number | bigint ): Promise { - let params: { threshold?: number }; + let params: { threshold?: number | bigint }; if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { threshold?: number }; + params = (paramsOrFirst || {}) as { threshold?: number | bigint }; } else { params = { - threshold: paramsOrFirst as number + threshold: paramsOrFirst as number | bigint }; } @@ -605,30 +758,30 @@ export class Health { /** * Get the number of messages that are waiting to be processed in the Appwrite internal queue server. * - * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @param {number | bigint} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} */ - getQueueMessaging(params?: { threshold?: number }): Promise; + getQueueMessaging(params?: { threshold?: number | bigint }): Promise; /** * Get the number of messages that are waiting to be processed in the Appwrite internal queue server. * - * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @param {number | bigint} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getQueueMessaging(threshold?: number): Promise; + getQueueMessaging(threshold?: number | bigint): Promise; getQueueMessaging( - paramsOrFirst?: { threshold?: number } | number + paramsOrFirst?: { threshold?: number | bigint } | number | bigint ): Promise { - let params: { threshold?: number }; + let params: { threshold?: number | bigint }; if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { threshold?: number }; + params = (paramsOrFirst || {}) as { threshold?: number | bigint }; } else { params = { - threshold: paramsOrFirst as number + threshold: paramsOrFirst as number | bigint }; } @@ -656,30 +809,30 @@ export class Health { /** * Get the number of migrations that are waiting to be processed in the Appwrite internal queue server. * - * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @param {number | bigint} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} */ - getQueueMigrations(params?: { threshold?: number }): Promise; + getQueueMigrations(params?: { threshold?: number | bigint }): Promise; /** * Get the number of migrations that are waiting to be processed in the Appwrite internal queue server. * - * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @param {number | bigint} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getQueueMigrations(threshold?: number): Promise; + getQueueMigrations(threshold?: number | bigint): Promise; getQueueMigrations( - paramsOrFirst?: { threshold?: number } | number + paramsOrFirst?: { threshold?: number | bigint } | number | bigint ): Promise { - let params: { threshold?: number }; + let params: { threshold?: number | bigint }; if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { threshold?: number }; + params = (paramsOrFirst || {}) as { threshold?: number | bigint }; } else { params = { - threshold: paramsOrFirst as number + threshold: paramsOrFirst as number | bigint }; } @@ -704,33 +857,84 @@ export class Health { ); } + /** + * Get region manager queue. + * + * @param {number | bigint} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 100. + * @throws {AppwriteException} + * @returns {Promise} + */ + getQueueRegionManager(params?: { threshold?: number | bigint }): Promise; + /** + * Get region manager queue. + * + * @param {number | bigint} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 100. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getQueueRegionManager(threshold?: number | bigint): Promise; + getQueueRegionManager( + paramsOrFirst?: { threshold?: number | bigint } | number | bigint + ): Promise { + let params: { threshold?: number | bigint }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { threshold?: number | bigint }; + } else { + params = { + threshold: paramsOrFirst as number | bigint + }; + } + + const threshold = params.threshold; + + + const apiPath = '/health/queue/region-manager'; + const payload: Payload = {}; + if (typeof threshold !== 'undefined') { + payload['threshold'] = threshold; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + /** * Get the number of metrics that are waiting to be processed in the Appwrite stats resources queue. * - * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @param {number | bigint} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} */ - getQueueStatsResources(params?: { threshold?: number }): Promise; + getQueueStatsResources(params?: { threshold?: number | bigint }): Promise; /** * Get the number of metrics that are waiting to be processed in the Appwrite stats resources queue. * - * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @param {number | bigint} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getQueueStatsResources(threshold?: number): Promise; + getQueueStatsResources(threshold?: number | bigint): Promise; getQueueStatsResources( - paramsOrFirst?: { threshold?: number } | number + paramsOrFirst?: { threshold?: number | bigint } | number | bigint ): Promise { - let params: { threshold?: number }; + let params: { threshold?: number | bigint }; if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { threshold?: number }; + params = (paramsOrFirst || {}) as { threshold?: number | bigint }; } else { params = { - threshold: paramsOrFirst as number + threshold: paramsOrFirst as number | bigint }; } @@ -758,30 +962,30 @@ export class Health { /** * Get the number of metrics that are waiting to be processed in the Appwrite internal queue server. * - * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @param {number | bigint} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} */ - getQueueUsage(params?: { threshold?: number }): Promise; + getQueueUsage(params?: { threshold?: number | bigint }): Promise; /** * Get the number of metrics that are waiting to be processed in the Appwrite internal queue server. * - * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @param {number | bigint} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getQueueUsage(threshold?: number): Promise; + getQueueUsage(threshold?: number | bigint): Promise; getQueueUsage( - paramsOrFirst?: { threshold?: number } | number + paramsOrFirst?: { threshold?: number | bigint } | number | bigint ): Promise { - let params: { threshold?: number }; + let params: { threshold?: number | bigint }; if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { threshold?: number }; + params = (paramsOrFirst || {}) as { threshold?: number | bigint }; } else { params = { - threshold: paramsOrFirst as number + threshold: paramsOrFirst as number | bigint }; } @@ -806,33 +1010,84 @@ export class Health { ); } + /** + * Get threats queue. + * + * @param {number | bigint} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 100. + * @throws {AppwriteException} + * @returns {Promise} + */ + getQueueThreats(params?: { threshold?: number | bigint }): Promise; + /** + * Get threats queue. + * + * @param {number | bigint} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 100. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getQueueThreats(threshold?: number | bigint): Promise; + getQueueThreats( + paramsOrFirst?: { threshold?: number | bigint } | number | bigint + ): Promise { + let params: { threshold?: number | bigint }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { threshold?: number | bigint }; + } else { + params = { + threshold: paramsOrFirst as number | bigint + }; + } + + const threshold = params.threshold; + + + const apiPath = '/health/queue/threats'; + const payload: Payload = {}; + if (typeof threshold !== 'undefined') { + payload['threshold'] = threshold; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + /** * Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server. * - * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @param {number | bigint} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} */ - getQueueWebhooks(params?: { threshold?: number }): Promise; + getQueueWebhooks(params?: { threshold?: number | bigint }): Promise; /** * Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server. * - * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @param {number | bigint} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getQueueWebhooks(threshold?: number): Promise; + getQueueWebhooks(threshold?: number | bigint): Promise; getQueueWebhooks( - paramsOrFirst?: { threshold?: number } | number + paramsOrFirst?: { threshold?: number | bigint } | number | bigint ): Promise { - let params: { threshold?: number }; + let params: { threshold?: number | bigint }; if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { threshold?: number }; + params = (paramsOrFirst || {}) as { threshold?: number | bigint }; } else { params = { - threshold: paramsOrFirst as number + threshold: paramsOrFirst as number | bigint }; } diff --git a/src/services/messaging.ts b/src/services/messaging.ts index c2cd63c..3ba181b 100644 --- a/src/services/messaging.ts +++ b/src/services/messaging.ts @@ -364,7 +364,7 @@ export class Messaging { * @param {string} params.sound - Sound for push notification. Available only for Android and iOS Platform. * @param {string} params.color - Color for push notification. Available only for Android Platform. * @param {string} params.tag - Tag for push notification. Available only for Android Platform. - * @param {number} params.badge - Badge for push notification. Available only for iOS Platform. + * @param {number | bigint} params.badge - Badge for push notification. Available only for iOS Platform. * @param {boolean} params.draft - Is message a draft * @param {string} params.scheduledAt - Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future. * @param {boolean} params.contentAvailable - If set to true, the notification will be delivered in the background. Available only for iOS Platform. @@ -373,7 +373,7 @@ export class Messaging { * @throws {AppwriteException} * @returns {Promise} */ - createPush(params: { messageId: string, title?: string, body?: string, topics?: string[], users?: string[], targets?: string[], data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number, draft?: boolean, scheduledAt?: string, contentAvailable?: boolean, critical?: boolean, priority?: MessagePriority }): Promise; + createPush(params: { messageId: string, title?: string, body?: string, topics?: string[], users?: string[], targets?: string[], data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number | bigint, draft?: boolean, scheduledAt?: string, contentAvailable?: boolean, critical?: boolean, priority?: MessagePriority }): Promise; /** * Create a new push notification. * @@ -390,7 +390,7 @@ export class Messaging { * @param {string} sound - Sound for push notification. Available only for Android and iOS Platform. * @param {string} color - Color for push notification. Available only for Android Platform. * @param {string} tag - Tag for push notification. Available only for Android Platform. - * @param {number} badge - Badge for push notification. Available only for iOS Platform. + * @param {number | bigint} badge - Badge for push notification. Available only for iOS Platform. * @param {boolean} draft - Is message a draft * @param {string} scheduledAt - Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future. * @param {boolean} contentAvailable - If set to true, the notification will be delivered in the background. Available only for iOS Platform. @@ -400,15 +400,15 @@ export class Messaging { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createPush(messageId: string, title?: string, body?: string, topics?: string[], users?: string[], targets?: string[], data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number, draft?: boolean, scheduledAt?: string, contentAvailable?: boolean, critical?: boolean, priority?: MessagePriority): Promise; + createPush(messageId: string, title?: string, body?: string, topics?: string[], users?: string[], targets?: string[], data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number | bigint, draft?: boolean, scheduledAt?: string, contentAvailable?: boolean, critical?: boolean, priority?: MessagePriority): Promise; createPush( - paramsOrFirst: { messageId: string, title?: string, body?: string, topics?: string[], users?: string[], targets?: string[], data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number, draft?: boolean, scheduledAt?: string, contentAvailable?: boolean, critical?: boolean, priority?: MessagePriority } | string, - ...rest: [(string)?, (string)?, (string[])?, (string[])?, (string[])?, (object)?, (string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (number)?, (boolean)?, (string)?, (boolean)?, (boolean)?, (MessagePriority)?] + paramsOrFirst: { messageId: string, title?: string, body?: string, topics?: string[], users?: string[], targets?: string[], data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number | bigint, draft?: boolean, scheduledAt?: string, contentAvailable?: boolean, critical?: boolean, priority?: MessagePriority } | string, + ...rest: [(string)?, (string)?, (string[])?, (string[])?, (string[])?, (object)?, (string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (number | bigint)?, (boolean)?, (string)?, (boolean)?, (boolean)?, (MessagePriority)?] ): Promise { - let params: { messageId: string, title?: string, body?: string, topics?: string[], users?: string[], targets?: string[], data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number, draft?: boolean, scheduledAt?: string, contentAvailable?: boolean, critical?: boolean, priority?: MessagePriority }; + let params: { messageId: string, title?: string, body?: string, topics?: string[], users?: string[], targets?: string[], data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number | bigint, draft?: boolean, scheduledAt?: string, contentAvailable?: boolean, critical?: boolean, priority?: MessagePriority }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { messageId: string, title?: string, body?: string, topics?: string[], users?: string[], targets?: string[], data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number, draft?: boolean, scheduledAt?: string, contentAvailable?: boolean, critical?: boolean, priority?: MessagePriority }; + params = (paramsOrFirst || {}) as { messageId: string, title?: string, body?: string, topics?: string[], users?: string[], targets?: string[], data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number | bigint, draft?: boolean, scheduledAt?: string, contentAvailable?: boolean, critical?: boolean, priority?: MessagePriority }; } else { params = { messageId: paramsOrFirst as string, @@ -424,7 +424,7 @@ export class Messaging { sound: rest[9] as string, color: rest[10] as string, tag: rest[11] as string, - badge: rest[12] as number, + badge: rest[12] as number | bigint, draft: rest[13] as boolean, scheduledAt: rest[14] as string, contentAvailable: rest[15] as boolean, @@ -547,7 +547,7 @@ export class Messaging { * @param {string} params.sound - Sound for push notification. Available only for Android and iOS platforms. * @param {string} params.color - Color for push notification. Available only for Android platforms. * @param {string} params.tag - Tag for push notification. Available only for Android platforms. - * @param {number} params.badge - Badge for push notification. Available only for iOS platforms. + * @param {number | bigint} params.badge - Badge for push notification. Available only for iOS platforms. * @param {boolean} params.draft - Is message a draft * @param {string} params.scheduledAt - Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future. * @param {boolean} params.contentAvailable - If set to true, the notification will be delivered in the background. Available only for iOS Platform. @@ -556,7 +556,7 @@ export class Messaging { * @throws {AppwriteException} * @returns {Promise} */ - updatePush(params: { messageId: string, topics?: string[], users?: string[], targets?: string[], title?: string, body?: string, data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number, draft?: boolean, scheduledAt?: string, contentAvailable?: boolean, critical?: boolean, priority?: MessagePriority }): Promise; + updatePush(params: { messageId: string, topics?: string[], users?: string[], targets?: string[], title?: string, body?: string, data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number | bigint, draft?: boolean, scheduledAt?: string, contentAvailable?: boolean, critical?: boolean, priority?: MessagePriority }): Promise; /** * Update a push notification by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated. * @@ -574,7 +574,7 @@ export class Messaging { * @param {string} sound - Sound for push notification. Available only for Android and iOS platforms. * @param {string} color - Color for push notification. Available only for Android platforms. * @param {string} tag - Tag for push notification. Available only for Android platforms. - * @param {number} badge - Badge for push notification. Available only for iOS platforms. + * @param {number | bigint} badge - Badge for push notification. Available only for iOS platforms. * @param {boolean} draft - Is message a draft * @param {string} scheduledAt - Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future. * @param {boolean} contentAvailable - If set to true, the notification will be delivered in the background. Available only for iOS Platform. @@ -584,15 +584,15 @@ export class Messaging { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updatePush(messageId: string, topics?: string[], users?: string[], targets?: string[], title?: string, body?: string, data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number, draft?: boolean, scheduledAt?: string, contentAvailable?: boolean, critical?: boolean, priority?: MessagePriority): Promise; + updatePush(messageId: string, topics?: string[], users?: string[], targets?: string[], title?: string, body?: string, data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number | bigint, draft?: boolean, scheduledAt?: string, contentAvailable?: boolean, critical?: boolean, priority?: MessagePriority): Promise; updatePush( - paramsOrFirst: { messageId: string, topics?: string[], users?: string[], targets?: string[], title?: string, body?: string, data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number, draft?: boolean, scheduledAt?: string, contentAvailable?: boolean, critical?: boolean, priority?: MessagePriority } | string, - ...rest: [(string[])?, (string[])?, (string[])?, (string)?, (string)?, (object)?, (string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (number)?, (boolean)?, (string)?, (boolean)?, (boolean)?, (MessagePriority)?] + paramsOrFirst: { messageId: string, topics?: string[], users?: string[], targets?: string[], title?: string, body?: string, data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number | bigint, draft?: boolean, scheduledAt?: string, contentAvailable?: boolean, critical?: boolean, priority?: MessagePriority } | string, + ...rest: [(string[])?, (string[])?, (string[])?, (string)?, (string)?, (object)?, (string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (number | bigint)?, (boolean)?, (string)?, (boolean)?, (boolean)?, (MessagePriority)?] ): Promise { - let params: { messageId: string, topics?: string[], users?: string[], targets?: string[], title?: string, body?: string, data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number, draft?: boolean, scheduledAt?: string, contentAvailable?: boolean, critical?: boolean, priority?: MessagePriority }; + let params: { messageId: string, topics?: string[], users?: string[], targets?: string[], title?: string, body?: string, data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number | bigint, draft?: boolean, scheduledAt?: string, contentAvailable?: boolean, critical?: boolean, priority?: MessagePriority }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { messageId: string, topics?: string[], users?: string[], targets?: string[], title?: string, body?: string, data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number, draft?: boolean, scheduledAt?: string, contentAvailable?: boolean, critical?: boolean, priority?: MessagePriority }; + params = (paramsOrFirst || {}) as { messageId: string, topics?: string[], users?: string[], targets?: string[], title?: string, body?: string, data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number | bigint, draft?: boolean, scheduledAt?: string, contentAvailable?: boolean, critical?: boolean, priority?: MessagePriority }; } else { params = { messageId: paramsOrFirst as string, @@ -608,7 +608,7 @@ export class Messaging { sound: rest[9] as string, color: rest[10] as string, tag: rest[11] as string, - badge: rest[12] as number, + badge: rest[12] as number | bigint, draft: rest[13] as boolean, scheduledAt: rest[14] as string, contentAvailable: rest[15] as boolean, @@ -2990,7 +2990,7 @@ export class Messaging { * @param {string} params.providerId - Provider 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. * @param {string} params.name - Provider name. * @param {string} params.host - SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls://smtp1.example.com:587;ssl://smtp2.example.com:465"`. Hosts will be tried in order. - * @param {number} params.port - The default SMTP server port. + * @param {number | bigint} params.port - The default SMTP server port. * @param {string} params.username - Authentication username. * @param {string} params.password - Authentication password. * @param {SmtpEncryption} params.encryption - Encryption type. Can be omitted, 'ssl', or 'tls' @@ -3005,14 +3005,14 @@ export class Messaging { * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `Messaging.createSMTPProvider` instead. */ - createSmtpProvider(params: { providerId: string, name: string, host: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }): Promise; + createSmtpProvider(params: { providerId: string, name: string, host: string, port?: number | bigint, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }): Promise; /** * Create a new SMTP provider. * * @param {string} providerId - Provider 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. * @param {string} name - Provider name. * @param {string} host - SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls://smtp1.example.com:587;ssl://smtp2.example.com:465"`. Hosts will be tried in order. - * @param {number} port - The default SMTP server port. + * @param {number | bigint} port - The default SMTP server port. * @param {string} username - Authentication username. * @param {string} password - Authentication password. * @param {SmtpEncryption} encryption - Encryption type. Can be omitted, 'ssl', or 'tls' @@ -3027,21 +3027,21 @@ export class Messaging { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createSmtpProvider(providerId: string, name: string, host: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean): Promise; + createSmtpProvider(providerId: string, name: string, host: string, port?: number | bigint, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean): Promise; createSmtpProvider( - paramsOrFirst: { providerId: string, name: string, host: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean } | string, - ...rest: [(string)?, (string)?, (number)?, (string)?, (string)?, (SmtpEncryption)?, (boolean)?, (string)?, (string)?, (string)?, (string)?, (string)?, (boolean)?] + paramsOrFirst: { providerId: string, name: string, host: string, port?: number | bigint, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean } | string, + ...rest: [(string)?, (string)?, (number | bigint)?, (string)?, (string)?, (SmtpEncryption)?, (boolean)?, (string)?, (string)?, (string)?, (string)?, (string)?, (boolean)?] ): Promise { - let params: { providerId: string, name: string, host: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }; + let params: { providerId: string, name: string, host: string, port?: number | bigint, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { providerId: string, name: string, host: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }; + params = (paramsOrFirst || {}) as { providerId: string, name: string, host: string, port?: number | bigint, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }; } else { params = { providerId: paramsOrFirst as string, name: rest[0] as string, host: rest[1] as string, - port: rest[2] as number, + port: rest[2] as number | bigint, username: rest[3] as string, password: rest[4] as string, encryption: rest[5] as SmtpEncryption, @@ -3144,7 +3144,7 @@ export class Messaging { * @param {string} params.providerId - Provider 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. * @param {string} params.name - Provider name. * @param {string} params.host - SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls://smtp1.example.com:587;ssl://smtp2.example.com:465"`. Hosts will be tried in order. - * @param {number} params.port - The default SMTP server port. + * @param {number | bigint} params.port - The default SMTP server port. * @param {string} params.username - Authentication username. * @param {string} params.password - Authentication password. * @param {SmtpEncryption} params.encryption - Encryption type. Can be omitted, 'ssl', or 'tls' @@ -3158,14 +3158,14 @@ export class Messaging { * @throws {AppwriteException} * @returns {Promise} */ - createSMTPProvider(params: { providerId: string, name: string, host: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }): Promise; + createSMTPProvider(params: { providerId: string, name: string, host: string, port?: number | bigint, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }): Promise; /** * Create a new SMTP provider. * * @param {string} providerId - Provider 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. * @param {string} name - Provider name. * @param {string} host - SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls://smtp1.example.com:587;ssl://smtp2.example.com:465"`. Hosts will be tried in order. - * @param {number} port - The default SMTP server port. + * @param {number | bigint} port - The default SMTP server port. * @param {string} username - Authentication username. * @param {string} password - Authentication password. * @param {SmtpEncryption} encryption - Encryption type. Can be omitted, 'ssl', or 'tls' @@ -3180,21 +3180,21 @@ export class Messaging { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createSMTPProvider(providerId: string, name: string, host: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean): Promise; + createSMTPProvider(providerId: string, name: string, host: string, port?: number | bigint, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean): Promise; createSMTPProvider( - paramsOrFirst: { providerId: string, name: string, host: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean } | string, - ...rest: [(string)?, (string)?, (number)?, (string)?, (string)?, (SmtpEncryption)?, (boolean)?, (string)?, (string)?, (string)?, (string)?, (string)?, (boolean)?] + paramsOrFirst: { providerId: string, name: string, host: string, port?: number | bigint, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean } | string, + ...rest: [(string)?, (string)?, (number | bigint)?, (string)?, (string)?, (SmtpEncryption)?, (boolean)?, (string)?, (string)?, (string)?, (string)?, (string)?, (boolean)?] ): Promise { - let params: { providerId: string, name: string, host: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }; + let params: { providerId: string, name: string, host: string, port?: number | bigint, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { providerId: string, name: string, host: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }; + params = (paramsOrFirst || {}) as { providerId: string, name: string, host: string, port?: number | bigint, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }; } else { params = { providerId: paramsOrFirst as string, name: rest[0] as string, host: rest[1] as string, - port: rest[2] as number, + port: rest[2] as number | bigint, username: rest[3] as string, password: rest[4] as string, encryption: rest[5] as SmtpEncryption, @@ -3297,7 +3297,7 @@ export class Messaging { * @param {string} params.providerId - Provider ID. * @param {string} params.name - Provider name. * @param {string} params.host - SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls://smtp1.example.com:587;ssl://smtp2.example.com:465"`. Hosts will be tried in order. - * @param {number} params.port - SMTP port. + * @param {number | bigint} params.port - SMTP port. * @param {string} params.username - Authentication username. * @param {string} params.password - Authentication password. * @param {SmtpEncryption} params.encryption - Encryption type. Can be 'ssl' or 'tls' @@ -3312,14 +3312,14 @@ export class Messaging { * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `Messaging.updateSMTPProvider` instead. */ - updateSmtpProvider(params: { providerId: string, name?: string, host?: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }): Promise; + updateSmtpProvider(params: { providerId: string, name?: string, host?: string, port?: number | bigint, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }): Promise; /** * Update a SMTP provider by its unique ID. * * @param {string} providerId - Provider ID. * @param {string} name - Provider name. * @param {string} host - SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls://smtp1.example.com:587;ssl://smtp2.example.com:465"`. Hosts will be tried in order. - * @param {number} port - SMTP port. + * @param {number | bigint} port - SMTP port. * @param {string} username - Authentication username. * @param {string} password - Authentication password. * @param {SmtpEncryption} encryption - Encryption type. Can be 'ssl' or 'tls' @@ -3334,21 +3334,21 @@ export class Messaging { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateSmtpProvider(providerId: string, name?: string, host?: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean): Promise; + updateSmtpProvider(providerId: string, name?: string, host?: string, port?: number | bigint, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean): Promise; updateSmtpProvider( - paramsOrFirst: { providerId: string, name?: string, host?: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean } | string, - ...rest: [(string)?, (string)?, (number)?, (string)?, (string)?, (SmtpEncryption)?, (boolean)?, (string)?, (string)?, (string)?, (string)?, (string)?, (boolean)?] + paramsOrFirst: { providerId: string, name?: string, host?: string, port?: number | bigint, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean } | string, + ...rest: [(string)?, (string)?, (number | bigint)?, (string)?, (string)?, (SmtpEncryption)?, (boolean)?, (string)?, (string)?, (string)?, (string)?, (string)?, (boolean)?] ): Promise { - let params: { providerId: string, name?: string, host?: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }; + let params: { providerId: string, name?: string, host?: string, port?: number | bigint, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { providerId: string, name?: string, host?: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }; + params = (paramsOrFirst || {}) as { providerId: string, name?: string, host?: string, port?: number | bigint, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }; } else { params = { providerId: paramsOrFirst as string, name: rest[0] as string, host: rest[1] as string, - port: rest[2] as number, + port: rest[2] as number | bigint, username: rest[3] as string, password: rest[4] as string, encryption: rest[5] as SmtpEncryption, @@ -3442,7 +3442,7 @@ export class Messaging { * @param {string} params.providerId - Provider ID. * @param {string} params.name - Provider name. * @param {string} params.host - SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls://smtp1.example.com:587;ssl://smtp2.example.com:465"`. Hosts will be tried in order. - * @param {number} params.port - SMTP port. + * @param {number | bigint} params.port - SMTP port. * @param {string} params.username - Authentication username. * @param {string} params.password - Authentication password. * @param {SmtpEncryption} params.encryption - Encryption type. Can be 'ssl' or 'tls' @@ -3456,14 +3456,14 @@ export class Messaging { * @throws {AppwriteException} * @returns {Promise} */ - updateSMTPProvider(params: { providerId: string, name?: string, host?: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }): Promise; + updateSMTPProvider(params: { providerId: string, name?: string, host?: string, port?: number | bigint, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }): Promise; /** * Update a SMTP provider by its unique ID. * * @param {string} providerId - Provider ID. * @param {string} name - Provider name. * @param {string} host - SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls://smtp1.example.com:587;ssl://smtp2.example.com:465"`. Hosts will be tried in order. - * @param {number} port - SMTP port. + * @param {number | bigint} port - SMTP port. * @param {string} username - Authentication username. * @param {string} password - Authentication password. * @param {SmtpEncryption} encryption - Encryption type. Can be 'ssl' or 'tls' @@ -3478,21 +3478,21 @@ export class Messaging { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateSMTPProvider(providerId: string, name?: string, host?: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean): Promise; + updateSMTPProvider(providerId: string, name?: string, host?: string, port?: number | bigint, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean): Promise; updateSMTPProvider( - paramsOrFirst: { providerId: string, name?: string, host?: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean } | string, - ...rest: [(string)?, (string)?, (number)?, (string)?, (string)?, (SmtpEncryption)?, (boolean)?, (string)?, (string)?, (string)?, (string)?, (string)?, (boolean)?] + paramsOrFirst: { providerId: string, name?: string, host?: string, port?: number | bigint, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean } | string, + ...rest: [(string)?, (string)?, (number | bigint)?, (string)?, (string)?, (SmtpEncryption)?, (boolean)?, (string)?, (string)?, (string)?, (string)?, (string)?, (boolean)?] ): Promise { - let params: { providerId: string, name?: string, host?: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }; + let params: { providerId: string, name?: string, host?: string, port?: number | bigint, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { providerId: string, name?: string, host?: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }; + params = (paramsOrFirst || {}) as { providerId: string, name?: string, host?: string, port?: number | bigint, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }; } else { params = { providerId: paramsOrFirst as string, name: rest[0] as string, host: rest[1] as string, - port: rest[2] as number, + port: rest[2] as number | bigint, username: rest[3] as string, password: rest[4] as string, encryption: rest[5] as SmtpEncryption, diff --git a/src/services/organizations.ts b/src/services/organizations.ts new file mode 100644 index 0000000..ab206de --- /dev/null +++ b/src/services/organizations.ts @@ -0,0 +1,115 @@ +import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; +import type { Models } from '../models'; + + +export class Organizations { + client: Client; + + constructor(client: Client) { + this.client = client; + } + + /** + * Delete an organization. + * + * @param {string} params.organizationId - Team ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + */ + delete(params: { organizationId: string }): Promise<{}>; + /** + * Delete an organization. + * + * @param {string} organizationId - Team ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + delete(organizationId: string): Promise<{}>; + delete( + paramsOrFirst: { organizationId: string } | string + ): Promise<{}> { + let params: { organizationId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { organizationId: string }; + } else { + params = { + organizationId: paramsOrFirst as string + }; + } + + const organizationId = params.organizationId; + + if (typeof organizationId === 'undefined') { + throw new AppwriteException('Missing required parameter: "organizationId"'); + } + + const apiPath = '/organizations/{organizationId}'.replace('{organizationId}', organizationId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'delete', + uri, + apiHeaders, + payload, + ); + } + + /** + * Get estimation for deleting an organization. + * + * @param {string} params.organizationId - Team ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + estimationDeleteOrganization(params: { organizationId: string }): Promise; + /** + * Get estimation for deleting an organization. + * + * @param {string} organizationId - Team ID. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + estimationDeleteOrganization(organizationId: string): Promise; + estimationDeleteOrganization( + paramsOrFirst: { organizationId: string } | string + ): Promise { + let params: { organizationId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { organizationId: string }; + } else { + params = { + organizationId: paramsOrFirst as string + }; + } + + const organizationId = params.organizationId; + + if (typeof organizationId === 'undefined') { + throw new AppwriteException('Missing required parameter: "organizationId"'); + } + + const apiPath = '/organizations/{organizationId}/estimations/delete-organization'.replace('{organizationId}', organizationId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } +} diff --git a/src/services/sites.ts b/src/services/sites.ts index 3afc7e3..5e363ac 100644 --- a/src/services/sites.ts +++ b/src/services/sites.ts @@ -90,7 +90,7 @@ export class Sites { * @param {BuildRuntime} params.buildRuntime - Runtime to use during build step. * @param {boolean} params.enabled - Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled. * @param {boolean} params.logging - When disabled, request logs will exclude logs and errors, and site responses will be slightly faster. - * @param {number} params.timeout - Maximum request time in seconds. + * @param {number | bigint} params.timeout - Maximum request time in seconds. * @param {string} params.installCommand - Install Command. * @param {string} params.buildCommand - Build Command. * @param {string} params.outputDirectory - Output Directory for site. @@ -105,7 +105,7 @@ export class Sites { * @throws {AppwriteException} * @returns {Promise} */ - create(params: { siteId: string, name: string, framework: Framework, buildRuntime: BuildRuntime, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, outputDirectory?: string, adapter?: Adapter, installationId?: string, fallbackFile?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string }): Promise; + create(params: { siteId: string, name: string, framework: Framework, buildRuntime: BuildRuntime, enabled?: boolean, logging?: boolean, timeout?: number | bigint, installCommand?: string, buildCommand?: string, outputDirectory?: string, adapter?: Adapter, installationId?: string, fallbackFile?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string }): Promise; /** * Create a new site. * @@ -115,7 +115,7 @@ export class Sites { * @param {BuildRuntime} buildRuntime - Runtime to use during build step. * @param {boolean} enabled - Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled. * @param {boolean} logging - When disabled, request logs will exclude logs and errors, and site responses will be slightly faster. - * @param {number} timeout - Maximum request time in seconds. + * @param {number | bigint} timeout - Maximum request time in seconds. * @param {string} installCommand - Install Command. * @param {string} buildCommand - Build Command. * @param {string} outputDirectory - Output Directory for site. @@ -131,15 +131,15 @@ export class Sites { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - create(siteId: string, name: string, framework: Framework, buildRuntime: BuildRuntime, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, outputDirectory?: string, adapter?: Adapter, installationId?: string, fallbackFile?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string): Promise; + create(siteId: string, name: string, framework: Framework, buildRuntime: BuildRuntime, enabled?: boolean, logging?: boolean, timeout?: number | bigint, installCommand?: string, buildCommand?: string, outputDirectory?: string, adapter?: Adapter, installationId?: string, fallbackFile?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string): Promise; create( - paramsOrFirst: { siteId: string, name: string, framework: Framework, buildRuntime: BuildRuntime, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, outputDirectory?: string, adapter?: Adapter, installationId?: string, fallbackFile?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string } | string, - ...rest: [(string)?, (Framework)?, (BuildRuntime)?, (boolean)?, (boolean)?, (number)?, (string)?, (string)?, (string)?, (Adapter)?, (string)?, (string)?, (string)?, (string)?, (boolean)?, (string)?, (string)?] + paramsOrFirst: { siteId: string, name: string, framework: Framework, buildRuntime: BuildRuntime, enabled?: boolean, logging?: boolean, timeout?: number | bigint, installCommand?: string, buildCommand?: string, outputDirectory?: string, adapter?: Adapter, installationId?: string, fallbackFile?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string } | string, + ...rest: [(string)?, (Framework)?, (BuildRuntime)?, (boolean)?, (boolean)?, (number | bigint)?, (string)?, (string)?, (string)?, (Adapter)?, (string)?, (string)?, (string)?, (string)?, (boolean)?, (string)?, (string)?] ): Promise { - let params: { siteId: string, name: string, framework: Framework, buildRuntime: BuildRuntime, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, outputDirectory?: string, adapter?: Adapter, installationId?: string, fallbackFile?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string }; + let params: { siteId: string, name: string, framework: Framework, buildRuntime: BuildRuntime, enabled?: boolean, logging?: boolean, timeout?: number | bigint, installCommand?: string, buildCommand?: string, outputDirectory?: string, adapter?: Adapter, installationId?: string, fallbackFile?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { siteId: string, name: string, framework: Framework, buildRuntime: BuildRuntime, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, outputDirectory?: string, adapter?: Adapter, installationId?: string, fallbackFile?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string }; + params = (paramsOrFirst || {}) as { siteId: string, name: string, framework: Framework, buildRuntime: BuildRuntime, enabled?: boolean, logging?: boolean, timeout?: number | bigint, installCommand?: string, buildCommand?: string, outputDirectory?: string, adapter?: Adapter, installationId?: string, fallbackFile?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string }; } else { params = { siteId: paramsOrFirst as string, @@ -148,7 +148,7 @@ export class Sites { buildRuntime: rest[2] as BuildRuntime, enabled: rest[3] as boolean, logging: rest[4] as boolean, - timeout: rest[5] as number, + timeout: rest[5] as number | bigint, installCommand: rest[6] as string, buildCommand: rest[7] as string, outputDirectory: rest[8] as string, @@ -370,7 +370,7 @@ export class Sites { * @param {Framework} params.framework - Sites framework. * @param {boolean} params.enabled - Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled. * @param {boolean} params.logging - When disabled, request logs will exclude logs and errors, and site responses will be slightly faster. - * @param {number} params.timeout - Maximum request time in seconds. + * @param {number | bigint} params.timeout - Maximum request time in seconds. * @param {string} params.installCommand - Install Command. * @param {string} params.buildCommand - Build Command. * @param {string} params.outputDirectory - Output Directory for site. @@ -386,7 +386,7 @@ export class Sites { * @throws {AppwriteException} * @returns {Promise} */ - update(params: { siteId: string, name: string, framework: Framework, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, outputDirectory?: string, buildRuntime?: BuildRuntime, adapter?: Adapter, fallbackFile?: string, installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string }): Promise; + update(params: { siteId: string, name: string, framework: Framework, enabled?: boolean, logging?: boolean, timeout?: number | bigint, installCommand?: string, buildCommand?: string, outputDirectory?: string, buildRuntime?: BuildRuntime, adapter?: Adapter, fallbackFile?: string, installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string }): Promise; /** * Update site by its unique ID. * @@ -395,7 +395,7 @@ export class Sites { * @param {Framework} framework - Sites framework. * @param {boolean} enabled - Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled. * @param {boolean} logging - When disabled, request logs will exclude logs and errors, and site responses will be slightly faster. - * @param {number} timeout - Maximum request time in seconds. + * @param {number | bigint} timeout - Maximum request time in seconds. * @param {string} installCommand - Install Command. * @param {string} buildCommand - Build Command. * @param {string} outputDirectory - Output Directory for site. @@ -412,15 +412,15 @@ export class Sites { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - update(siteId: string, name: string, framework: Framework, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, outputDirectory?: string, buildRuntime?: BuildRuntime, adapter?: Adapter, fallbackFile?: string, installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string): Promise; + update(siteId: string, name: string, framework: Framework, enabled?: boolean, logging?: boolean, timeout?: number | bigint, installCommand?: string, buildCommand?: string, outputDirectory?: string, buildRuntime?: BuildRuntime, adapter?: Adapter, fallbackFile?: string, installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string): Promise; update( - paramsOrFirst: { siteId: string, name: string, framework: Framework, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, outputDirectory?: string, buildRuntime?: BuildRuntime, adapter?: Adapter, fallbackFile?: string, installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string } | string, - ...rest: [(string)?, (Framework)?, (boolean)?, (boolean)?, (number)?, (string)?, (string)?, (string)?, (BuildRuntime)?, (Adapter)?, (string)?, (string)?, (string)?, (string)?, (boolean)?, (string)?, (string)?] + paramsOrFirst: { siteId: string, name: string, framework: Framework, enabled?: boolean, logging?: boolean, timeout?: number | bigint, installCommand?: string, buildCommand?: string, outputDirectory?: string, buildRuntime?: BuildRuntime, adapter?: Adapter, fallbackFile?: string, installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string } | string, + ...rest: [(string)?, (Framework)?, (boolean)?, (boolean)?, (number | bigint)?, (string)?, (string)?, (string)?, (BuildRuntime)?, (Adapter)?, (string)?, (string)?, (string)?, (string)?, (boolean)?, (string)?, (string)?] ): Promise { - let params: { siteId: string, name: string, framework: Framework, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, outputDirectory?: string, buildRuntime?: BuildRuntime, adapter?: Adapter, fallbackFile?: string, installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string }; + let params: { siteId: string, name: string, framework: Framework, enabled?: boolean, logging?: boolean, timeout?: number | bigint, installCommand?: string, buildCommand?: string, outputDirectory?: string, buildRuntime?: BuildRuntime, adapter?: Adapter, fallbackFile?: string, installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { siteId: string, name: string, framework: Framework, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, outputDirectory?: string, buildRuntime?: BuildRuntime, adapter?: Adapter, fallbackFile?: string, installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string }; + params = (paramsOrFirst || {}) as { siteId: string, name: string, framework: Framework, enabled?: boolean, logging?: boolean, timeout?: number | bigint, installCommand?: string, buildCommand?: string, outputDirectory?: string, buildRuntime?: BuildRuntime, adapter?: Adapter, fallbackFile?: string, installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string }; } else { params = { siteId: paramsOrFirst as string, @@ -428,7 +428,7 @@ export class Sites { framework: rest[1] as Framework, enabled: rest[2] as boolean, logging: rest[3] as boolean, - timeout: rest[4] as number, + timeout: rest[4] as number | bigint, installCommand: rest[5] as string, buildCommand: rest[6] as string, outputDirectory: rest[7] as string, diff --git a/src/services/storage.ts b/src/services/storage.ts index 3a115aa..496630d 100644 --- a/src/services/storage.ts +++ b/src/services/storage.ts @@ -86,16 +86,16 @@ export class Storage { * @param {string[]} params.permissions - An array of permission strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} params.fileSecurity - Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} params.enabled - Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled. - * @param {number} params.maximumFileSize - Maximum file size allowed in bytes. Maximum allowed value is 30MB. + * @param {number | bigint} params.maximumFileSize - Maximum file size allowed in bytes. Maximum allowed value is 5GB. * @param {string[]} params.allowedFileExtensions - Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long. - * @param {Compression} params.compression - Compression algorithm choosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled + * @param {Compression} params.compression - Compression algorithm chosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled * @param {boolean} params.encryption - Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled * @param {boolean} params.antivirus - Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled * @param {boolean} params.transformations - Are image transformations enabled? * @throws {AppwriteException} * @returns {Promise} */ - createBucket(params: { bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean, transformations?: boolean }): Promise; + createBucket(params: { bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number | bigint, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean, transformations?: boolean }): Promise; /** * Create a new storage bucket. * @@ -104,9 +104,9 @@ export class Storage { * @param {string[]} permissions - An array of permission strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} fileSecurity - Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} enabled - Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled. - * @param {number} maximumFileSize - Maximum file size allowed in bytes. Maximum allowed value is 30MB. + * @param {number | bigint} maximumFileSize - Maximum file size allowed in bytes. Maximum allowed value is 5GB. * @param {string[]} allowedFileExtensions - Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long. - * @param {Compression} compression - Compression algorithm choosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled + * @param {Compression} compression - Compression algorithm chosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled * @param {boolean} encryption - Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled * @param {boolean} antivirus - Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled * @param {boolean} transformations - Are image transformations enabled? @@ -114,15 +114,15 @@ export class Storage { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createBucket(bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean, transformations?: boolean): Promise; + createBucket(bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number | bigint, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean, transformations?: boolean): Promise; createBucket( - paramsOrFirst: { bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean, transformations?: boolean } | string, - ...rest: [(string)?, (string[])?, (boolean)?, (boolean)?, (number)?, (string[])?, (Compression)?, (boolean)?, (boolean)?, (boolean)?] + paramsOrFirst: { bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number | bigint, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean, transformations?: boolean } | string, + ...rest: [(string)?, (string[])?, (boolean)?, (boolean)?, (number | bigint)?, (string[])?, (Compression)?, (boolean)?, (boolean)?, (boolean)?] ): Promise { - let params: { bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean, transformations?: boolean }; + let params: { bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number | bigint, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean, transformations?: boolean }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean, transformations?: boolean }; + params = (paramsOrFirst || {}) as { bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number | bigint, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean, transformations?: boolean }; } else { params = { bucketId: paramsOrFirst as string, @@ -130,7 +130,7 @@ export class Storage { permissions: rest[1] as string[], fileSecurity: rest[2] as boolean, enabled: rest[3] as boolean, - maximumFileSize: rest[4] as number, + maximumFileSize: rest[4] as number | bigint, allowedFileExtensions: rest[5] as string[], compression: rest[6] as Compression, encryption: rest[7] as boolean, @@ -266,16 +266,16 @@ export class Storage { * @param {string[]} params.permissions - An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} params.fileSecurity - Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} params.enabled - Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled. - * @param {number} params.maximumFileSize - Maximum file size allowed in bytes. Maximum allowed value is 30MB. + * @param {number | bigint} params.maximumFileSize - Maximum file size allowed in bytes. Maximum allowed value is 5GB. * @param {string[]} params.allowedFileExtensions - Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long. - * @param {Compression} params.compression - Compression algorithm choosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled + * @param {Compression} params.compression - Compression algorithm chosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled * @param {boolean} params.encryption - Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled * @param {boolean} params.antivirus - Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled * @param {boolean} params.transformations - Are image transformations enabled? * @throws {AppwriteException} * @returns {Promise} */ - updateBucket(params: { bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean, transformations?: boolean }): Promise; + updateBucket(params: { bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number | bigint, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean, transformations?: boolean }): Promise; /** * Update a storage bucket by its unique ID. * @@ -284,9 +284,9 @@ export class Storage { * @param {string[]} permissions - An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} fileSecurity - Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} enabled - Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled. - * @param {number} maximumFileSize - Maximum file size allowed in bytes. Maximum allowed value is 30MB. + * @param {number | bigint} maximumFileSize - Maximum file size allowed in bytes. Maximum allowed value is 5GB. * @param {string[]} allowedFileExtensions - Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long. - * @param {Compression} compression - Compression algorithm choosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled + * @param {Compression} compression - Compression algorithm chosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled * @param {boolean} encryption - Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled * @param {boolean} antivirus - Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled * @param {boolean} transformations - Are image transformations enabled? @@ -294,15 +294,15 @@ export class Storage { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateBucket(bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean, transformations?: boolean): Promise; + updateBucket(bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number | bigint, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean, transformations?: boolean): Promise; updateBucket( - paramsOrFirst: { bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean, transformations?: boolean } | string, - ...rest: [(string)?, (string[])?, (boolean)?, (boolean)?, (number)?, (string[])?, (Compression)?, (boolean)?, (boolean)?, (boolean)?] + paramsOrFirst: { bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number | bigint, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean, transformations?: boolean } | string, + ...rest: [(string)?, (string[])?, (boolean)?, (boolean)?, (number | bigint)?, (string[])?, (Compression)?, (boolean)?, (boolean)?, (boolean)?] ): Promise { - let params: { bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean, transformations?: boolean }; + let params: { bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number | bigint, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean, transformations?: boolean }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean, transformations?: boolean }; + params = (paramsOrFirst || {}) as { bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number | bigint, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean, transformations?: boolean }; } else { params = { bucketId: paramsOrFirst as string, @@ -310,7 +310,7 @@ export class Storage { permissions: rest[1] as string[], fileSecurity: rest[2] as boolean, enabled: rest[3] as boolean, - maximumFileSize: rest[4] as number, + maximumFileSize: rest[4] as number | bigint, allowedFileExtensions: rest[5] as string[], compression: rest[6] as Compression, encryption: rest[7] as boolean, @@ -669,10 +669,10 @@ export class Storage { /** * Update a file by its unique ID. Only users with write permissions have access to update this resource. * - * @param {string} params.bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). - * @param {string} params.fileId - File unique ID. - * @param {string} params.name - Name of the file - * @param {string[]} params.permissions - An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {string} params.bucketId - Bucket unique ID. + * @param {string} params.fileId - File ID. + * @param {string} params.name - File name. + * @param {string[]} params.permissions - An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). * @throws {AppwriteException} * @returns {Promise} */ @@ -680,10 +680,10 @@ export class Storage { /** * Update a file by its unique ID. Only users with write permissions have access to update this resource. * - * @param {string} bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). - * @param {string} fileId - File unique ID. - * @param {string} name - Name of the file - * @param {string[]} permissions - An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {string} bucketId - Bucket unique ID. + * @param {string} fileId - File ID. + * @param {string} name - File name. + * @param {string[]} permissions - An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. @@ -872,36 +872,36 @@ export class Storage { * * @param {string} params.bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). * @param {string} params.fileId - File ID - * @param {number} params.width - Resize preview image width, Pass an integer between 0 to 4000. - * @param {number} params.height - Resize preview image height, Pass an integer between 0 to 4000. + * @param {number | bigint} params.width - Resize preview image width, Pass an integer between 0 to 4000. + * @param {number | bigint} params.height - Resize preview image height, Pass an integer between 0 to 4000. * @param {ImageGravity} params.gravity - Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right - * @param {number} params.quality - Preview image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. - * @param {number} params.borderWidth - Preview image border in pixels. Pass an integer between 0 to 100. Defaults to 0. + * @param {number | bigint} params.quality - Preview image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. + * @param {number | bigint} params.borderWidth - Preview image border in pixels. Pass an integer between 0 to 100. Defaults to 0. * @param {string} params.borderColor - Preview image border color. Use a valid HEX color, no # is needed for prefix. - * @param {number} params.borderRadius - Preview image border radius in pixels. Pass an integer between 0 to 4000. - * @param {number} params.opacity - Preview image opacity. Only works with images having an alpha channel (like png). Pass a number between 0 to 1. - * @param {number} params.rotation - Preview image rotation in degrees. Pass an integer between -360 and 360. + * @param {number | bigint} params.borderRadius - Preview image border radius in pixels. Pass an integer between 0 to 4000. + * @param {number | bigint} params.opacity - Preview image opacity. Only works with images having an alpha channel (like png). Pass a number between 0 to 1. + * @param {number | bigint} params.rotation - Preview image rotation in degrees. Pass an integer between -360 and 360. * @param {string} params.background - Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix. * @param {ImageFormat} params.output - Output format type (jpeg, jpg, png, gif and webp). * @param {string} params.token - File token for accessing this file. * @throws {AppwriteException} * @returns {Promise} */ - getFilePreview(params: { bucketId: string, fileId: string, width?: number, height?: number, gravity?: ImageGravity, quality?: number, borderWidth?: number, borderColor?: string, borderRadius?: number, opacity?: number, rotation?: number, background?: string, output?: ImageFormat, token?: string }): Promise; + getFilePreview(params: { bucketId: string, fileId: string, width?: number | bigint, height?: number | bigint, gravity?: ImageGravity, quality?: number | bigint, borderWidth?: number | bigint, borderColor?: string, borderRadius?: number | bigint, opacity?: number | bigint, rotation?: number | bigint, background?: string, output?: ImageFormat, token?: string }): Promise; /** * Get a file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets, will return the file icon image. You can also pass query string arguments for cutting and resizing your preview image. Preview is supported only for image files smaller than 10MB. * * @param {string} bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). * @param {string} fileId - File ID - * @param {number} width - Resize preview image width, Pass an integer between 0 to 4000. - * @param {number} height - Resize preview image height, Pass an integer between 0 to 4000. + * @param {number | bigint} width - Resize preview image width, Pass an integer between 0 to 4000. + * @param {number | bigint} height - Resize preview image height, Pass an integer between 0 to 4000. * @param {ImageGravity} gravity - Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right - * @param {number} quality - Preview image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. - * @param {number} borderWidth - Preview image border in pixels. Pass an integer between 0 to 100. Defaults to 0. + * @param {number | bigint} quality - Preview image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. + * @param {number | bigint} borderWidth - Preview image border in pixels. Pass an integer between 0 to 100. Defaults to 0. * @param {string} borderColor - Preview image border color. Use a valid HEX color, no # is needed for prefix. - * @param {number} borderRadius - Preview image border radius in pixels. Pass an integer between 0 to 4000. - * @param {number} opacity - Preview image opacity. Only works with images having an alpha channel (like png). Pass a number between 0 to 1. - * @param {number} rotation - Preview image rotation in degrees. Pass an integer between -360 and 360. + * @param {number | bigint} borderRadius - Preview image border radius in pixels. Pass an integer between 0 to 4000. + * @param {number | bigint} opacity - Preview image opacity. Only works with images having an alpha channel (like png). Pass a number between 0 to 1. + * @param {number | bigint} rotation - Preview image rotation in degrees. Pass an integer between -360 and 360. * @param {string} background - Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix. * @param {ImageFormat} output - Output format type (jpeg, jpg, png, gif and webp). * @param {string} token - File token for accessing this file. @@ -909,28 +909,28 @@ export class Storage { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getFilePreview(bucketId: string, fileId: string, width?: number, height?: number, gravity?: ImageGravity, quality?: number, borderWidth?: number, borderColor?: string, borderRadius?: number, opacity?: number, rotation?: number, background?: string, output?: ImageFormat, token?: string): Promise; + getFilePreview(bucketId: string, fileId: string, width?: number | bigint, height?: number | bigint, gravity?: ImageGravity, quality?: number | bigint, borderWidth?: number | bigint, borderColor?: string, borderRadius?: number | bigint, opacity?: number | bigint, rotation?: number | bigint, background?: string, output?: ImageFormat, token?: string): Promise; getFilePreview( - paramsOrFirst: { bucketId: string, fileId: string, width?: number, height?: number, gravity?: ImageGravity, quality?: number, borderWidth?: number, borderColor?: string, borderRadius?: number, opacity?: number, rotation?: number, background?: string, output?: ImageFormat, token?: string } | string, - ...rest: [(string)?, (number)?, (number)?, (ImageGravity)?, (number)?, (number)?, (string)?, (number)?, (number)?, (number)?, (string)?, (ImageFormat)?, (string)?] + paramsOrFirst: { bucketId: string, fileId: string, width?: number | bigint, height?: number | bigint, gravity?: ImageGravity, quality?: number | bigint, borderWidth?: number | bigint, borderColor?: string, borderRadius?: number | bigint, opacity?: number | bigint, rotation?: number | bigint, background?: string, output?: ImageFormat, token?: string } | string, + ...rest: [(string)?, (number | bigint)?, (number | bigint)?, (ImageGravity)?, (number | bigint)?, (number | bigint)?, (string)?, (number | bigint)?, (number | bigint)?, (number | bigint)?, (string)?, (ImageFormat)?, (string)?] ): Promise { - let params: { bucketId: string, fileId: string, width?: number, height?: number, gravity?: ImageGravity, quality?: number, borderWidth?: number, borderColor?: string, borderRadius?: number, opacity?: number, rotation?: number, background?: string, output?: ImageFormat, token?: string }; + let params: { bucketId: string, fileId: string, width?: number | bigint, height?: number | bigint, gravity?: ImageGravity, quality?: number | bigint, borderWidth?: number | bigint, borderColor?: string, borderRadius?: number | bigint, opacity?: number | bigint, rotation?: number | bigint, background?: string, output?: ImageFormat, token?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { bucketId: string, fileId: string, width?: number, height?: number, gravity?: ImageGravity, quality?: number, borderWidth?: number, borderColor?: string, borderRadius?: number, opacity?: number, rotation?: number, background?: string, output?: ImageFormat, token?: string }; + params = (paramsOrFirst || {}) as { bucketId: string, fileId: string, width?: number | bigint, height?: number | bigint, gravity?: ImageGravity, quality?: number | bigint, borderWidth?: number | bigint, borderColor?: string, borderRadius?: number | bigint, opacity?: number | bigint, rotation?: number | bigint, background?: string, output?: ImageFormat, token?: string }; } else { params = { bucketId: paramsOrFirst as string, fileId: rest[0] as string, - width: rest[1] as number, - height: rest[2] as number, + width: rest[1] as number | bigint, + height: rest[2] as number | bigint, gravity: rest[3] as ImageGravity, - quality: rest[4] as number, - borderWidth: rest[5] as number, + quality: rest[4] as number | bigint, + borderWidth: rest[5] as number | bigint, borderColor: rest[6] as string, - borderRadius: rest[7] as number, - opacity: rest[8] as number, - rotation: rest[9] as number, + borderRadius: rest[7] as number | bigint, + opacity: rest[8] as number | bigint, + rotation: rest[9] as number | bigint, background: rest[10] as string, output: rest[11] as ImageFormat, token: rest[12] as string diff --git a/src/services/tables-db.ts b/src/services/tables-db.ts index 846718c..28eb2d2 100644 --- a/src/services/tables-db.ts +++ b/src/services/tables-db.ts @@ -207,30 +207,30 @@ export class TablesDB { /** * Create a new transaction. * - * @param {number} params.ttl - Seconds before the transaction expires. + * @param {number | bigint} params.ttl - Seconds before the transaction expires. * @throws {AppwriteException} * @returns {Promise} */ - createTransaction(params?: { ttl?: number }): Promise; + createTransaction(params?: { ttl?: number | bigint }): Promise; /** * Create a new transaction. * - * @param {number} ttl - Seconds before the transaction expires. + * @param {number | bigint} ttl - Seconds before the transaction expires. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createTransaction(ttl?: number): Promise; + createTransaction(ttl?: number | bigint): Promise; createTransaction( - paramsOrFirst?: { ttl?: number } | number + paramsOrFirst?: { ttl?: number | bigint } | number | bigint ): Promise { - let params: { ttl?: number }; + let params: { ttl?: number | bigint }; if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { ttl?: number }; + params = (paramsOrFirst || {}) as { ttl?: number | bigint }; } else { params = { - ttl: paramsOrFirst as number + ttl: paramsOrFirst as number | bigint }; } @@ -1911,14 +1911,14 @@ export class TablesDB { * @param {string} params.tableId - Table ID. * @param {string} params.key - Column Key. * @param {boolean} params.required - Is column required? - * @param {number} params.min - Minimum value - * @param {number} params.max - Maximum value - * @param {number} params.xdefault - Default value. Cannot be set when required. + * @param {number | bigint} params.min - Minimum value + * @param {number | bigint} params.max - Maximum value + * @param {number | bigint} params.xdefault - Default value. Cannot be set when required. * @param {boolean} params.array - Is column an array? * @throws {AppwriteException} * @returns {Promise} */ - createFloatColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean }): Promise; + createFloatColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, min?: number | bigint, max?: number | bigint, xdefault?: number | bigint, array?: boolean }): Promise; /** * Create a float column. Optionally, minimum and maximum values can be provided. * @@ -1927,32 +1927,32 @@ export class TablesDB { * @param {string} tableId - Table ID. * @param {string} key - Column Key. * @param {boolean} required - Is column required? - * @param {number} min - Minimum value - * @param {number} max - Maximum value - * @param {number} xdefault - Default value. Cannot be set when required. + * @param {number | bigint} min - Minimum value + * @param {number | bigint} max - Maximum value + * @param {number | bigint} xdefault - Default value. Cannot be set when required. * @param {boolean} array - Is column an array? * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createFloatColumn(databaseId: string, tableId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean): Promise; + createFloatColumn(databaseId: string, tableId: string, key: string, required: boolean, min?: number | bigint, max?: number | bigint, xdefault?: number | bigint, array?: boolean): Promise; createFloatColumn( - paramsOrFirst: { databaseId: string, tableId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean } | string, - ...rest: [(string)?, (string)?, (boolean)?, (number)?, (number)?, (number)?, (boolean)?] + paramsOrFirst: { databaseId: string, tableId: string, key: string, required: boolean, min?: number | bigint, max?: number | bigint, xdefault?: number | bigint, array?: boolean } | string, + ...rest: [(string)?, (string)?, (boolean)?, (number | bigint)?, (number | bigint)?, (number | bigint)?, (boolean)?] ): Promise { - let params: { databaseId: string, tableId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean }; + let params: { databaseId: string, tableId: string, key: string, required: boolean, min?: number | bigint, max?: number | bigint, xdefault?: number | bigint, array?: boolean }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean }; + params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, required: boolean, min?: number | bigint, max?: number | bigint, xdefault?: number | bigint, array?: boolean }; } else { params = { databaseId: paramsOrFirst as string, tableId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - min: rest[3] as number, - max: rest[4] as number, - xdefault: rest[5] as number, + min: rest[3] as number | bigint, + max: rest[4] as number | bigint, + xdefault: rest[5] as number | bigint, array: rest[6] as boolean }; } @@ -2021,14 +2021,14 @@ export class TablesDB { * @param {string} params.tableId - Table ID. * @param {string} params.key - Column Key. * @param {boolean} params.required - Is column required? - * @param {number} params.xdefault - Default value. Cannot be set when required. - * @param {number} params.min - Minimum value - * @param {number} params.max - Maximum value + * @param {number | bigint} params.xdefault - Default value. Cannot be set when required. + * @param {number | bigint} params.min - Minimum value + * @param {number | bigint} params.max - Maximum value * @param {string} params.newKey - New Column Key. * @throws {AppwriteException} * @returns {Promise} */ - updateFloatColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string }): Promise; + updateFloatColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number | bigint, min?: number | bigint, max?: number | bigint, newKey?: string }): Promise; /** * Update a float column. Changing the `default` value will not update already existing rows. * @@ -2037,32 +2037,32 @@ export class TablesDB { * @param {string} tableId - Table ID. * @param {string} key - Column Key. * @param {boolean} required - Is column required? - * @param {number} xdefault - Default value. Cannot be set when required. - * @param {number} min - Minimum value - * @param {number} max - Maximum value + * @param {number | bigint} xdefault - Default value. Cannot be set when required. + * @param {number | bigint} min - Minimum value + * @param {number | bigint} max - Maximum value * @param {string} newKey - New Column Key. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateFloatColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string): Promise; + updateFloatColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number | bigint, min?: number | bigint, max?: number | bigint, newKey?: string): Promise; updateFloatColumn( - paramsOrFirst: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string } | string, - ...rest: [(string)?, (string)?, (boolean)?, (number)?, (number)?, (number)?, (string)?] + paramsOrFirst: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number | bigint, min?: number | bigint, max?: number | bigint, newKey?: string } | string, + ...rest: [(string)?, (string)?, (boolean)?, (number | bigint)?, (number | bigint)?, (number | bigint)?, (string)?] ): Promise { - let params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string }; + let params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number | bigint, min?: number | bigint, max?: number | bigint, newKey?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string }; + params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number | bigint, min?: number | bigint, max?: number | bigint, newKey?: string }; } else { params = { databaseId: paramsOrFirst as string, tableId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as number, - min: rest[4] as number, - max: rest[5] as number, + xdefault: rest[3] as number | bigint, + min: rest[4] as number | bigint, + max: rest[5] as number | bigint, newKey: rest[6] as string }; } @@ -2131,14 +2131,14 @@ export class TablesDB { * @param {string} params.tableId - Table ID. * @param {string} params.key - Column Key. * @param {boolean} params.required - Is column required? - * @param {number} params.min - Minimum value - * @param {number} params.max - Maximum value - * @param {number} params.xdefault - Default value. Cannot be set when column is required. + * @param {number | bigint} params.min - Minimum value + * @param {number | bigint} params.max - Maximum value + * @param {number | bigint} params.xdefault - Default value. Cannot be set when column is required. * @param {boolean} params.array - Is column an array? * @throws {AppwriteException} * @returns {Promise} */ - createIntegerColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean }): Promise; + createIntegerColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, min?: number | bigint, max?: number | bigint, xdefault?: number | bigint, array?: boolean }): Promise; /** * Create an integer column. Optionally, minimum and maximum values can be provided. * @@ -2147,32 +2147,32 @@ export class TablesDB { * @param {string} tableId - Table ID. * @param {string} key - Column Key. * @param {boolean} required - Is column required? - * @param {number} min - Minimum value - * @param {number} max - Maximum value - * @param {number} xdefault - Default value. Cannot be set when column is required. + * @param {number | bigint} min - Minimum value + * @param {number | bigint} max - Maximum value + * @param {number | bigint} xdefault - Default value. Cannot be set when column is required. * @param {boolean} array - Is column an array? * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createIntegerColumn(databaseId: string, tableId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean): Promise; + createIntegerColumn(databaseId: string, tableId: string, key: string, required: boolean, min?: number | bigint, max?: number | bigint, xdefault?: number | bigint, array?: boolean): Promise; createIntegerColumn( - paramsOrFirst: { databaseId: string, tableId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean } | string, - ...rest: [(string)?, (string)?, (boolean)?, (number)?, (number)?, (number)?, (boolean)?] + paramsOrFirst: { databaseId: string, tableId: string, key: string, required: boolean, min?: number | bigint, max?: number | bigint, xdefault?: number | bigint, array?: boolean } | string, + ...rest: [(string)?, (string)?, (boolean)?, (number | bigint)?, (number | bigint)?, (number | bigint)?, (boolean)?] ): Promise { - let params: { databaseId: string, tableId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean }; + let params: { databaseId: string, tableId: string, key: string, required: boolean, min?: number | bigint, max?: number | bigint, xdefault?: number | bigint, array?: boolean }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean }; + params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, required: boolean, min?: number | bigint, max?: number | bigint, xdefault?: number | bigint, array?: boolean }; } else { params = { databaseId: paramsOrFirst as string, tableId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - min: rest[3] as number, - max: rest[4] as number, - xdefault: rest[5] as number, + min: rest[3] as number | bigint, + max: rest[4] as number | bigint, + xdefault: rest[5] as number | bigint, array: rest[6] as boolean }; } @@ -2241,14 +2241,14 @@ export class TablesDB { * @param {string} params.tableId - Table ID. * @param {string} params.key - Column Key. * @param {boolean} params.required - Is column required? - * @param {number} params.xdefault - Default value. Cannot be set when column is required. - * @param {number} params.min - Minimum value - * @param {number} params.max - Maximum value + * @param {number | bigint} params.xdefault - Default value. Cannot be set when column is required. + * @param {number | bigint} params.min - Minimum value + * @param {number | bigint} params.max - Maximum value * @param {string} params.newKey - New Column Key. * @throws {AppwriteException} * @returns {Promise} */ - updateIntegerColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string }): Promise; + updateIntegerColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number | bigint, min?: number | bigint, max?: number | bigint, newKey?: string }): Promise; /** * Update an integer column. Changing the `default` value will not update already existing rows. * @@ -2257,32 +2257,32 @@ export class TablesDB { * @param {string} tableId - Table ID. * @param {string} key - Column Key. * @param {boolean} required - Is column required? - * @param {number} xdefault - Default value. Cannot be set when column is required. - * @param {number} min - Minimum value - * @param {number} max - Maximum value + * @param {number | bigint} xdefault - Default value. Cannot be set when column is required. + * @param {number | bigint} min - Minimum value + * @param {number | bigint} max - Maximum value * @param {string} newKey - New Column Key. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateIntegerColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string): Promise; + updateIntegerColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number | bigint, min?: number | bigint, max?: number | bigint, newKey?: string): Promise; updateIntegerColumn( - paramsOrFirst: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string } | string, - ...rest: [(string)?, (string)?, (boolean)?, (number)?, (number)?, (number)?, (string)?] + paramsOrFirst: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number | bigint, min?: number | bigint, max?: number | bigint, newKey?: string } | string, + ...rest: [(string)?, (string)?, (boolean)?, (number | bigint)?, (number | bigint)?, (number | bigint)?, (string)?] ): Promise { - let params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string }; + let params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number | bigint, min?: number | bigint, max?: number | bigint, newKey?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string }; + params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number | bigint, min?: number | bigint, max?: number | bigint, newKey?: string }; } else { params = { databaseId: paramsOrFirst as string, tableId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as number, - min: rest[4] as number, - max: rest[5] as number, + xdefault: rest[3] as number | bigint, + min: rest[4] as number | bigint, + max: rest[5] as number | bigint, newKey: rest[6] as string }; } @@ -3186,7 +3186,7 @@ export class TablesDB { * @param {string} params.databaseId - Database ID. * @param {string} params.tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} params.key - Column Key. - * @param {number} params.size - Column size for text columns, in number of characters. + * @param {number | bigint} params.size - Column size for text columns, in number of characters. * @param {boolean} params.required - Is column required? * @param {string} params.xdefault - Default value for column when not provided. Cannot be set when column is required. * @param {boolean} params.array - Is column an array? @@ -3194,7 +3194,7 @@ export class TablesDB { * @throws {AppwriteException} * @returns {Promise} */ - createStringColumn(params: { databaseId: string, tableId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean }): Promise; + createStringColumn(params: { databaseId: string, tableId: string, key: string, size: number | bigint, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean }): Promise; /** * Create a string column. * @@ -3202,7 +3202,7 @@ export class TablesDB { * @param {string} databaseId - Database ID. * @param {string} tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} key - Column Key. - * @param {number} size - Column size for text columns, in number of characters. + * @param {number | bigint} size - Column size for text columns, in number of characters. * @param {boolean} required - Is column required? * @param {string} xdefault - Default value for column when not provided. Cannot be set when column is required. * @param {boolean} array - Is column an array? @@ -3211,21 +3211,21 @@ export class TablesDB { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createStringColumn(databaseId: string, tableId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean): Promise; + createStringColumn(databaseId: string, tableId: string, key: string, size: number | bigint, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean): Promise; createStringColumn( - paramsOrFirst: { databaseId: string, tableId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean } | string, - ...rest: [(string)?, (string)?, (number)?, (boolean)?, (string)?, (boolean)?, (boolean)?] + paramsOrFirst: { databaseId: string, tableId: string, key: string, size: number | bigint, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean } | string, + ...rest: [(string)?, (string)?, (number | bigint)?, (boolean)?, (string)?, (boolean)?, (boolean)?] ): Promise { - let params: { databaseId: string, tableId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean }; + let params: { databaseId: string, tableId: string, key: string, size: number | bigint, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean }; + params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, size: number | bigint, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean }; } else { params = { databaseId: paramsOrFirst as string, tableId: rest[0] as string, key: rest[1] as string, - size: rest[2] as number, + size: rest[2] as number | bigint, required: rest[3] as boolean, xdefault: rest[4] as string, array: rest[5] as boolean, @@ -3301,12 +3301,12 @@ export class TablesDB { * @param {string} params.key - Column Key. * @param {boolean} params.required - Is column required? * @param {string} params.xdefault - Default value for column when not provided. Cannot be set when column is required. - * @param {number} params.size - Maximum size of the string column. + * @param {number | bigint} params.size - Maximum size of the string column. * @param {string} params.newKey - New Column Key. * @throws {AppwriteException} * @returns {Promise} */ - updateStringColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, size?: number, newKey?: string }): Promise; + updateStringColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, size?: number | bigint, newKey?: string }): Promise; /** * Update a string column. Changing the `default` value will not update already existing rows. * @@ -3316,21 +3316,21 @@ export class TablesDB { * @param {string} key - Column Key. * @param {boolean} required - Is column required? * @param {string} xdefault - Default value for column when not provided. Cannot be set when column is required. - * @param {number} size - Maximum size of the string column. + * @param {number | bigint} size - Maximum size of the string column. * @param {string} newKey - New Column Key. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateStringColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, size?: number, newKey?: string): Promise; + updateStringColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, size?: number | bigint, newKey?: string): Promise; updateStringColumn( - paramsOrFirst: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, size?: number, newKey?: string } | string, - ...rest: [(string)?, (string)?, (boolean)?, (string)?, (number)?, (string)?] + paramsOrFirst: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, size?: number | bigint, newKey?: string } | string, + ...rest: [(string)?, (string)?, (boolean)?, (string)?, (number | bigint)?, (string)?] ): Promise { - let params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, size?: number, newKey?: string }; + let params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, size?: number | bigint, newKey?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, size?: number, newKey?: string }; + params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, size?: number | bigint, newKey?: string }; } else { params = { databaseId: paramsOrFirst as string, @@ -3338,7 +3338,7 @@ export class TablesDB { key: rest[1] as string, required: rest[2] as boolean, xdefault: rest[3] as string, - size: rest[4] as number, + size: rest[4] as number | bigint, newKey: rest[5] as string }; } @@ -3594,9 +3594,9 @@ export class TablesDB { * @param {string} params.tableId - Table ID. * @param {string} params.key - Column Key. * @throws {AppwriteException} - * @returns {Promise<{}>} + * @returns {Promise} */ - getColumn(params: { databaseId: string, tableId: string, key: string }): Promise<{}>; + getColumn(params: { databaseId: string, tableId: string, key: string }): Promise; /** * Get column by ID. * @@ -3604,14 +3604,14 @@ export class TablesDB { * @param {string} tableId - Table ID. * @param {string} key - Column Key. * @throws {AppwriteException} - * @returns {Promise<{}>} + * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getColumn(databaseId: string, tableId: string, key: string): Promise<{}>; + getColumn(databaseId: string, tableId: string, key: string): Promise; getColumn( paramsOrFirst: { databaseId: string, tableId: string, key: string } | string, ...rest: [(string)?, (string)?] - ): Promise<{}> { + ): Promise { let params: { databaseId: string, tableId: string, key: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { @@ -3886,11 +3886,11 @@ export class TablesDB { * @param {IndexType} params.type - Index type. * @param {string[]} params.columns - Array of columns to index. Maximum of 100 columns are allowed, each 32 characters long. * @param {string[]} params.orders - Array of index orders. Maximum of 100 orders are allowed. - * @param {number[]} params.lengths - Length of index. Maximum of 100 + * @param {number | bigint[]} params.lengths - Length of index. Maximum of 100 * @throws {AppwriteException} * @returns {Promise} */ - createIndex(params: { databaseId: string, tableId: string, key: string, type: IndexType, columns: string[], orders?: string[], lengths?: number[] }): Promise; + createIndex(params: { databaseId: string, tableId: string, key: string, type: IndexType, columns: string[], orders?: string[], lengths?: number | bigint[] }): Promise; /** * Creates an index on the columns listed. Your index should include all the columns you will query in a single request. * Type can be `key`, `fulltext`, or `unique`. @@ -3901,20 +3901,20 @@ export class TablesDB { * @param {IndexType} type - Index type. * @param {string[]} columns - Array of columns to index. Maximum of 100 columns are allowed, each 32 characters long. * @param {string[]} orders - Array of index orders. Maximum of 100 orders are allowed. - * @param {number[]} lengths - Length of index. Maximum of 100 + * @param {number | bigint[]} lengths - Length of index. Maximum of 100 * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createIndex(databaseId: string, tableId: string, key: string, type: IndexType, columns: string[], orders?: string[], lengths?: number[]): Promise; + createIndex(databaseId: string, tableId: string, key: string, type: IndexType, columns: string[], orders?: string[], lengths?: number | bigint[]): Promise; createIndex( - paramsOrFirst: { databaseId: string, tableId: string, key: string, type: IndexType, columns: string[], orders?: string[], lengths?: number[] } | string, - ...rest: [(string)?, (string)?, (IndexType)?, (string[])?, (string[])?, (number[])?] + paramsOrFirst: { databaseId: string, tableId: string, key: string, type: IndexType, columns: string[], orders?: string[], lengths?: number | bigint[] } | string, + ...rest: [(string)?, (string)?, (IndexType)?, (string[])?, (string[])?, (number | bigint[])?] ): Promise { - let params: { databaseId: string, tableId: string, key: string, type: IndexType, columns: string[], orders?: string[], lengths?: number[] }; + let params: { databaseId: string, tableId: string, key: string, type: IndexType, columns: string[], orders?: string[], lengths?: number | bigint[] }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, type: IndexType, columns: string[], orders?: string[], lengths?: number[] }; + params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, type: IndexType, columns: string[], orders?: string[], lengths?: number | bigint[] }; } else { params = { databaseId: paramsOrFirst as string, @@ -3923,7 +3923,7 @@ export class TablesDB { type: rest[2] as IndexType, columns: rest[3] as string[], orders: rest[4] as string[], - lengths: rest[5] as number[] + lengths: rest[5] as number | bigint[] }; } @@ -4937,13 +4937,13 @@ export class TablesDB { * @param {string} params.tableId - Table ID. * @param {string} params.rowId - Row ID. * @param {string} params.column - Column key. - * @param {number} params.value - Value to increment the column by. The value must be a number. - * @param {number} params.min - Minimum value for the column. If the current value is lesser than this value, an exception will be thrown. + * @param {number | bigint} params.value - Value to increment the column by. The value must be a number. + * @param {number | bigint} params.min - Minimum value for the column. If the current value is lesser than this value, an exception will be thrown. * @param {string} params.transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise} */ - decrementRowColumn(params: { databaseId: string, tableId: string, rowId: string, column: string, value?: number, min?: number, transactionId?: string }): Promise; + decrementRowColumn(params: { databaseId: string, tableId: string, rowId: string, column: string, value?: number | bigint, min?: number | bigint, transactionId?: string }): Promise; /** * Decrement a specific column of a row by a given value. * @@ -4951,30 +4951,30 @@ export class TablesDB { * @param {string} tableId - Table ID. * @param {string} rowId - Row ID. * @param {string} column - Column key. - * @param {number} value - Value to increment the column by. The value must be a number. - * @param {number} min - Minimum value for the column. If the current value is lesser than this value, an exception will be thrown. + * @param {number | bigint} value - Value to increment the column by. The value must be a number. + * @param {number | bigint} min - Minimum value for the column. If the current value is lesser than this value, an exception will be thrown. * @param {string} transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - decrementRowColumn(databaseId: string, tableId: string, rowId: string, column: string, value?: number, min?: number, transactionId?: string): Promise; + decrementRowColumn(databaseId: string, tableId: string, rowId: string, column: string, value?: number | bigint, min?: number | bigint, transactionId?: string): Promise; decrementRowColumn( - paramsOrFirst: { databaseId: string, tableId: string, rowId: string, column: string, value?: number, min?: number, transactionId?: string } | string, - ...rest: [(string)?, (string)?, (string)?, (number)?, (number)?, (string)?] + paramsOrFirst: { databaseId: string, tableId: string, rowId: string, column: string, value?: number | bigint, min?: number | bigint, transactionId?: string } | string, + ...rest: [(string)?, (string)?, (string)?, (number | bigint)?, (number | bigint)?, (string)?] ): Promise { - let params: { databaseId: string, tableId: string, rowId: string, column: string, value?: number, min?: number, transactionId?: string }; + let params: { databaseId: string, tableId: string, rowId: string, column: string, value?: number | bigint, min?: number | bigint, transactionId?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, rowId: string, column: string, value?: number, min?: number, transactionId?: string }; + params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, rowId: string, column: string, value?: number | bigint, min?: number | bigint, transactionId?: string }; } else { params = { databaseId: paramsOrFirst as string, tableId: rest[0] as string, rowId: rest[1] as string, column: rest[2] as string, - value: rest[3] as number, - min: rest[4] as number, + value: rest[3] as number | bigint, + min: rest[4] as number | bigint, transactionId: rest[5] as string }; } @@ -5032,13 +5032,13 @@ export class TablesDB { * @param {string} params.tableId - Table ID. * @param {string} params.rowId - Row ID. * @param {string} params.column - Column key. - * @param {number} params.value - Value to increment the column by. The value must be a number. - * @param {number} params.max - Maximum value for the column. If the current value is greater than this value, an error will be thrown. + * @param {number | bigint} params.value - Value to increment the column by. The value must be a number. + * @param {number | bigint} params.max - Maximum value for the column. If the current value is greater than this value, an error will be thrown. * @param {string} params.transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise} */ - incrementRowColumn(params: { databaseId: string, tableId: string, rowId: string, column: string, value?: number, max?: number, transactionId?: string }): Promise; + incrementRowColumn(params: { databaseId: string, tableId: string, rowId: string, column: string, value?: number | bigint, max?: number | bigint, transactionId?: string }): Promise; /** * Increment a specific column of a row by a given value. * @@ -5046,30 +5046,30 @@ export class TablesDB { * @param {string} tableId - Table ID. * @param {string} rowId - Row ID. * @param {string} column - Column key. - * @param {number} value - Value to increment the column by. The value must be a number. - * @param {number} max - Maximum value for the column. If the current value is greater than this value, an error will be thrown. + * @param {number | bigint} value - Value to increment the column by. The value must be a number. + * @param {number | bigint} max - Maximum value for the column. If the current value is greater than this value, an error will be thrown. * @param {string} transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - incrementRowColumn(databaseId: string, tableId: string, rowId: string, column: string, value?: number, max?: number, transactionId?: string): Promise; + incrementRowColumn(databaseId: string, tableId: string, rowId: string, column: string, value?: number | bigint, max?: number | bigint, transactionId?: string): Promise; incrementRowColumn( - paramsOrFirst: { databaseId: string, tableId: string, rowId: string, column: string, value?: number, max?: number, transactionId?: string } | string, - ...rest: [(string)?, (string)?, (string)?, (number)?, (number)?, (string)?] + paramsOrFirst: { databaseId: string, tableId: string, rowId: string, column: string, value?: number | bigint, max?: number | bigint, transactionId?: string } | string, + ...rest: [(string)?, (string)?, (string)?, (number | bigint)?, (number | bigint)?, (string)?] ): Promise { - let params: { databaseId: string, tableId: string, rowId: string, column: string, value?: number, max?: number, transactionId?: string }; + let params: { databaseId: string, tableId: string, rowId: string, column: string, value?: number | bigint, max?: number | bigint, transactionId?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, rowId: string, column: string, value?: number, max?: number, transactionId?: string }; + params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, rowId: string, column: string, value?: number | bigint, max?: number | bigint, transactionId?: string }; } else { params = { databaseId: paramsOrFirst as string, tableId: rest[0] as string, rowId: rest[1] as string, column: rest[2] as string, - value: rest[3] as number, - max: rest[4] as number, + value: rest[3] as number | bigint, + max: rest[4] as number | bigint, transactionId: rest[5] as string }; } diff --git a/src/services/users.ts b/src/services/users.ts index 29cb089..c348ccb 100644 --- a/src/services/users.ts +++ b/src/services/users.ts @@ -619,15 +619,15 @@ export class Users { * @param {string} params.email - User email. * @param {string} params.password - User password hashed using Scrypt. * @param {string} params.passwordSalt - Optional salt used to hash password. - * @param {number} params.passwordCpu - Optional CPU cost used to hash password. - * @param {number} params.passwordMemory - Optional memory cost used to hash password. - * @param {number} params.passwordParallel - Optional parallelization cost used to hash password. - * @param {number} params.passwordLength - Optional hash length used to hash password. + * @param {number | bigint} params.passwordCpu - Optional CPU cost used to hash password. + * @param {number | bigint} params.passwordMemory - Optional memory cost used to hash password. + * @param {number | bigint} params.passwordParallel - Optional parallelization cost used to hash password. + * @param {number | bigint} params.passwordLength - Optional hash length used to hash password. * @param {string} params.name - User name. Max length: 128 chars. * @throws {AppwriteException} * @returns {Promise>} */ - createScryptUser(params: { userId: string, email: string, password: string, passwordSalt: string, passwordCpu: number, passwordMemory: number, passwordParallel: number, passwordLength: number, name?: string }): Promise>; + createScryptUser(params: { userId: string, email: string, password: string, passwordSalt: string, passwordCpu: number | bigint, passwordMemory: number | bigint, passwordParallel: number | bigint, passwordLength: number | bigint, name?: string }): Promise>; /** * Create a new user. Password provided must be hashed with the [Scrypt](https://github.com/Tarsnap/scrypt) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. * @@ -635,34 +635,34 @@ export class Users { * @param {string} email - User email. * @param {string} password - User password hashed using Scrypt. * @param {string} passwordSalt - Optional salt used to hash password. - * @param {number} passwordCpu - Optional CPU cost used to hash password. - * @param {number} passwordMemory - Optional memory cost used to hash password. - * @param {number} passwordParallel - Optional parallelization cost used to hash password. - * @param {number} passwordLength - Optional hash length used to hash password. + * @param {number | bigint} passwordCpu - Optional CPU cost used to hash password. + * @param {number | bigint} passwordMemory - Optional memory cost used to hash password. + * @param {number | bigint} passwordParallel - Optional parallelization cost used to hash password. + * @param {number | bigint} passwordLength - Optional hash length used to hash password. * @param {string} name - User name. Max length: 128 chars. * @throws {AppwriteException} * @returns {Promise>} * @deprecated Use the object parameter style method for a better developer experience. */ - createScryptUser(userId: string, email: string, password: string, passwordSalt: string, passwordCpu: number, passwordMemory: number, passwordParallel: number, passwordLength: number, name?: string): Promise>; + createScryptUser(userId: string, email: string, password: string, passwordSalt: string, passwordCpu: number | bigint, passwordMemory: number | bigint, passwordParallel: number | bigint, passwordLength: number | bigint, name?: string): Promise>; createScryptUser( - paramsOrFirst: { userId: string, email: string, password: string, passwordSalt: string, passwordCpu: number, passwordMemory: number, passwordParallel: number, passwordLength: number, name?: string } | string, - ...rest: [(string)?, (string)?, (string)?, (number)?, (number)?, (number)?, (number)?, (string)?] + paramsOrFirst: { userId: string, email: string, password: string, passwordSalt: string, passwordCpu: number | bigint, passwordMemory: number | bigint, passwordParallel: number | bigint, passwordLength: number | bigint, name?: string } | string, + ...rest: [(string)?, (string)?, (string)?, (number | bigint)?, (number | bigint)?, (number | bigint)?, (number | bigint)?, (string)?] ): Promise> { - let params: { userId: string, email: string, password: string, passwordSalt: string, passwordCpu: number, passwordMemory: number, passwordParallel: number, passwordLength: number, name?: string }; + let params: { userId: string, email: string, password: string, passwordSalt: string, passwordCpu: number | bigint, passwordMemory: number | bigint, passwordParallel: number | bigint, passwordLength: number | bigint, name?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { userId: string, email: string, password: string, passwordSalt: string, passwordCpu: number, passwordMemory: number, passwordParallel: number, passwordLength: number, name?: string }; + params = (paramsOrFirst || {}) as { userId: string, email: string, password: string, passwordSalt: string, passwordCpu: number | bigint, passwordMemory: number | bigint, passwordParallel: number | bigint, passwordLength: number | bigint, name?: string }; } else { params = { userId: paramsOrFirst as string, email: rest[0] as string, password: rest[1] as string, passwordSalt: rest[2] as string, - passwordCpu: rest[3] as number, - passwordMemory: rest[4] as number, - passwordParallel: rest[5] as number, - passwordLength: rest[6] as number, + passwordCpu: rest[3] as number | bigint, + passwordMemory: rest[4] as number | bigint, + passwordParallel: rest[5] as number | bigint, + passwordLength: rest[6] as number | bigint, name: rest[7] as string }; } @@ -1119,35 +1119,35 @@ export class Users { * * @param {string} params.userId - User ID. * @param {string} params.sessionId - Session ID. Use the string 'recent' to use the most recent session. Defaults to the most recent session. - * @param {number} params.duration - Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds. + * @param {number | bigint} params.duration - Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds. * @throws {AppwriteException} * @returns {Promise} */ - createJWT(params: { userId: string, sessionId?: string, duration?: number }): Promise; + createJWT(params: { userId: string, sessionId?: string, duration?: number | bigint }): Promise; /** * Use this endpoint to create a JSON Web Token for user by its unique ID. You can use the resulting JWT to authenticate on behalf of the user. The JWT secret will become invalid if the session it uses gets deleted. * * @param {string} userId - User ID. * @param {string} sessionId - Session ID. Use the string 'recent' to use the most recent session. Defaults to the most recent session. - * @param {number} duration - Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds. + * @param {number | bigint} duration - Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createJWT(userId: string, sessionId?: string, duration?: number): Promise; + createJWT(userId: string, sessionId?: string, duration?: number | bigint): Promise; createJWT( - paramsOrFirst: { userId: string, sessionId?: string, duration?: number } | string, - ...rest: [(string)?, (number)?] + paramsOrFirst: { userId: string, sessionId?: string, duration?: number | bigint } | string, + ...rest: [(string)?, (number | bigint)?] ): Promise { - let params: { userId: string, sessionId?: string, duration?: number }; + let params: { userId: string, sessionId?: string, duration?: number | bigint }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { userId: string, sessionId?: string, duration?: number }; + params = (paramsOrFirst || {}) as { userId: string, sessionId?: string, duration?: number | bigint }; } else { params = { userId: paramsOrFirst as string, sessionId: rest[0] as string, - duration: rest[1] as number + duration: rest[1] as number | bigint }; } @@ -3012,37 +3012,37 @@ export class Users { * * * @param {string} params.userId - User ID. - * @param {number} params.length - Token length in characters. The default length is 6 characters - * @param {number} params.expire - Token expiration period in seconds. The default expiration is 15 minutes. + * @param {number | bigint} params.length - Token length in characters. The default length is 6 characters + * @param {number | bigint} params.expire - Token expiration period in seconds. The default expiration is 15 minutes. * @throws {AppwriteException} * @returns {Promise} */ - createToken(params: { userId: string, length?: number, expire?: number }): Promise; + createToken(params: { userId: string, length?: number | bigint, expire?: number | bigint }): Promise; /** * Returns a token with a secret key for creating a session. Use the user ID and secret and submit a request to the [PUT /account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. * * * @param {string} userId - User ID. - * @param {number} length - Token length in characters. The default length is 6 characters - * @param {number} expire - Token expiration period in seconds. The default expiration is 15 minutes. + * @param {number | bigint} length - Token length in characters. The default length is 6 characters + * @param {number | bigint} expire - Token expiration period in seconds. The default expiration is 15 minutes. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createToken(userId: string, length?: number, expire?: number): Promise; + createToken(userId: string, length?: number | bigint, expire?: number | bigint): Promise; createToken( - paramsOrFirst: { userId: string, length?: number, expire?: number } | string, - ...rest: [(number)?, (number)?] + paramsOrFirst: { userId: string, length?: number | bigint, expire?: number | bigint } | string, + ...rest: [(number | bigint)?, (number | bigint)?] ): Promise { - let params: { userId: string, length?: number, expire?: number }; + let params: { userId: string, length?: number | bigint, expire?: number | bigint }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { userId: string, length?: number, expire?: number }; + params = (paramsOrFirst || {}) as { userId: string, length?: number | bigint, expire?: number | bigint }; } else { params = { userId: paramsOrFirst as string, - length: rest[0] as number, - expire: rest[1] as number + length: rest[0] as number | bigint, + expire: rest[1] as number | bigint }; } From 25dccf97a2c9a1f6d330913bdeb2b0b08a4e715a Mon Sep 17 00:00:00 2001 From: Darshan Date: Wed, 14 Jan 2026 07:41:10 +0000 Subject: [PATCH 2/6] latest updates as per server specs. --- CHANGELOG.md | 4 ++++ package.json | 2 +- src/client.ts | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 419b052..6b08aa5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +## 21.1.1 + +* Update SDK as per latest server specs + ## 20.3.0 * Add `total` parameter to list queries allowing skipping counting rows in a table for improved performance diff --git a/package.json b/package.json index 52dd193..a0212a0 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "node-appwrite", "homepage": "https://appwrite.io/support", "description": "Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API", - "version": "26.0.0", + "version": "21.1.1", "license": "BSD-3-Clause", "main": "dist/index.js", "type": "commonjs", diff --git a/src/client.ts b/src/client.ts index e5c82bd..42772dd 100644 --- a/src/client.ts +++ b/src/client.ts @@ -35,7 +35,7 @@ class AppwriteException extends Error { } function getUserAgent() { - let ua = 'AppwriteNodeJSSDK/26.0.0'; + let ua = 'AppwriteNodeJSSDK/21.1.1'; // `process` is a global in Node.js, but not fully available in all runtimes. const platform: string[] = []; @@ -84,7 +84,7 @@ class Client { 'x-sdk-name': 'Node.js', 'x-sdk-platform': 'server', 'x-sdk-language': 'nodejs', - 'x-sdk-version': '26.0.0', + 'x-sdk-version': '21.1.1', 'user-agent' : getUserAgent(), 'X-Appwrite-Response-Format': '1.8.0', }; From 390b2963eab133ccef1505270ca809c7cdc8f653 Mon Sep 17 00:00:00 2001 From: Darshan Date: Wed, 14 Jan 2026 07:52:24 +0000 Subject: [PATCH 3/6] misc-docs-update --- CHANGELOG.md | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b08aa5..611515a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,18 @@ * Update SDK as per latest server specs +## 21.1.0 + +* Added ability to create columns and indexes synchronously while creating a table + +## 21.0.0 + +* Rename `VCSDeploymentType` enum to `VCSReferenceType` +* Change `createTemplateDeployment` method signature: replace `version` parameter with `type` (TemplateReferenceType) + and `reference` parameters +* Add `getScreenshot` method to `Avatars` service +* Add `Theme`, `Timezone` and `Output` enums + ## 20.3.0 * Add `total` parameter to list queries allowing skipping counting rows in a table for improved performance @@ -47,7 +59,8 @@ ## 16.0.0 * Fix: remove content-type from GET requests -* Update (breaking): min and max params are now optional in `updateFloatAttribute` and `updateIntegerAttribute` methods (changes their positioning in method definition) +* Update (breaking): min and max params are now optional in `updateFloatAttribute` and `updateIntegerAttribute` + methods (changes their positioning in method definition) ## 15.0.1 @@ -89,4 +102,5 @@ * Rename `templateBranch` to `templateVersion` in `createFunction()`. * Rename `downloadDeployment()` to `getDeploymentDownload()` -> You can find the new syntax for breaking changes in the [Appwrite API references](https://appwrite.io/docs/references). Select version `1.6.x`. \ No newline at end of file +> You can find the new syntax for breaking changes in +> the [Appwrite API references](https://appwrite.io/docs/references). Select version `1.6.x`. \ No newline at end of file From 20e12cf7755a652a183d178f8191c26603047610 Mon Sep 17 00:00:00 2001 From: Darshan Date: Wed, 14 Jan 2026 13:48:05 +0530 Subject: [PATCH 4/6] Apply suggestion from @ItzNotABug --- CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 611515a..354429f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,11 @@ ## 21.1.1 -* Update SDK as per latest server specs +* Update SDK as per latest server specs, these include - + * Updates to Runtime enums + * `Output` is now renamed to `ImageFormat` - Note that this is a breaking change + * Introduces Backups module for managing Database backups + * Introduces Organization module ## 21.1.0 From 58e8f5536bf5742c4dde602a17736a91690e7011 Mon Sep 17 00:00:00 2001 From: Darshan Date: Thu, 15 Jan 2026 06:57:11 +0000 Subject: [PATCH 5/6] misc-fixes --- src/enums/o-auth-provider.ts | 4 - src/models.ts | 212 +++++++++++++------------ src/services/account.ts | 20 +-- src/services/avatars.ts | 234 ++++++++++++++-------------- src/services/backups.ts | 36 ++--- src/services/databases.ts | 178 ++++++++++----------- src/services/functions.ts | 36 ++--- src/services/health.ts | 292 +++++++++++++++++------------------ src/services/messaging.ts | 108 ++++++------- src/services/sites.ts | 36 ++--- src/services/storage.ts | 90 +++++------ src/services/tables-db.ts | 178 ++++++++++----------- src/services/users.ts | 78 +++++----- 13 files changed, 753 insertions(+), 749 deletions(-) diff --git a/src/enums/o-auth-provider.ts b/src/enums/o-auth-provider.ts index b13ceb3..3382e3b 100644 --- a/src/enums/o-auth-provider.ts +++ b/src/enums/o-auth-provider.ts @@ -38,8 +38,4 @@ export enum OAuthProvider { Yandex = 'yandex', Zoho = 'zoho', Zoom = 'zoom', - Mock = 'mock', - Mockunverified = 'mock-unverified', - GithubImagine = 'githubImagine', - GoogleImagine = 'googleImagine', } \ No newline at end of file diff --git a/src/models.ts b/src/models.ts index a28d325..c09abeb 100644 --- a/src/models.ts +++ b/src/models.ts @@ -23,7 +23,7 @@ export namespace Models { /** * Total number of rows that matched your query. */ - total: number | bigint; + total: number; /** * List of rows. */ @@ -37,7 +37,7 @@ export namespace Models { /** * Total number of documents that matched your query. */ - total: number | bigint; + total: number; /** * List of documents. */ @@ -51,7 +51,7 @@ export namespace Models { /** * Total number of tables that matched your query. */ - total: number | bigint; + total: number; /** * List of tables. */ @@ -65,7 +65,7 @@ export namespace Models { /** * Total number of collections that matched your query. */ - total: number | bigint; + total: number; /** * List of collections. */ @@ -79,7 +79,7 @@ export namespace Models { /** * Total number of databases that matched your query. */ - total: number | bigint; + total: number; /** * List of databases. */ @@ -93,7 +93,7 @@ export namespace Models { /** * Total number of indexes that matched your query. */ - total: number | bigint; + total: number; /** * List of indexes. */ @@ -107,7 +107,7 @@ export namespace Models { /** * Total number of indexes that matched your query. */ - total: number | bigint; + total: number; /** * List of indexes. */ @@ -121,7 +121,7 @@ export namespace Models { /** * Total number of users that matched your query. */ - total: number | bigint; + total: number; /** * List of users. */ @@ -135,7 +135,7 @@ export namespace Models { /** * Total number of sessions that matched your query. */ - total: number | bigint; + total: number; /** * List of sessions. */ @@ -149,7 +149,7 @@ export namespace Models { /** * Total number of identities that matched your query. */ - total: number | bigint; + total: number; /** * List of identities. */ @@ -163,7 +163,7 @@ export namespace Models { /** * Total number of logs that matched your query. */ - total: number | bigint; + total: number; /** * List of logs. */ @@ -177,7 +177,7 @@ export namespace Models { /** * Total number of files that matched your query. */ - total: number | bigint; + total: number; /** * List of files. */ @@ -191,7 +191,7 @@ export namespace Models { /** * Total number of buckets that matched your query. */ - total: number | bigint; + total: number; /** * List of buckets. */ @@ -205,7 +205,7 @@ export namespace Models { /** * Total number of tokens that matched your query. */ - total: number | bigint; + total: number; /** * List of tokens. */ @@ -219,7 +219,7 @@ export namespace Models { /** * Total number of teams that matched your query. */ - total: number | bigint; + total: number; /** * List of teams. */ @@ -233,7 +233,7 @@ export namespace Models { /** * Total number of memberships that matched your query. */ - total: number | bigint; + total: number; /** * List of memberships. */ @@ -247,7 +247,7 @@ export namespace Models { /** * Total number of sites that matched your query. */ - total: number | bigint; + total: number; /** * List of sites. */ @@ -261,7 +261,7 @@ export namespace Models { /** * Total number of functions that matched your query. */ - total: number | bigint; + total: number; /** * List of functions. */ @@ -275,7 +275,7 @@ export namespace Models { /** * Total number of frameworks that matched your query. */ - total: number | bigint; + total: number; /** * List of frameworks. */ @@ -289,7 +289,7 @@ export namespace Models { /** * Total number of runtimes that matched your query. */ - total: number | bigint; + total: number; /** * List of runtimes. */ @@ -303,7 +303,7 @@ export namespace Models { /** * Total number of deployments that matched your query. */ - total: number | bigint; + total: number; /** * List of deployments. */ @@ -317,7 +317,7 @@ export namespace Models { /** * Total number of executions that matched your query. */ - total: number | bigint; + total: number; /** * List of executions. */ @@ -331,7 +331,7 @@ export namespace Models { /** * Total number of countries that matched your query. */ - total: number | bigint; + total: number; /** * List of countries. */ @@ -345,7 +345,7 @@ export namespace Models { /** * Total number of continents that matched your query. */ - total: number | bigint; + total: number; /** * List of continents. */ @@ -359,7 +359,7 @@ export namespace Models { /** * Total number of languages that matched your query. */ - total: number | bigint; + total: number; /** * List of languages. */ @@ -373,7 +373,7 @@ export namespace Models { /** * Total number of currencies that matched your query. */ - total: number | bigint; + total: number; /** * List of currencies. */ @@ -387,7 +387,7 @@ export namespace Models { /** * Total number of phones that matched your query. */ - total: number | bigint; + total: number; /** * List of phones. */ @@ -401,7 +401,7 @@ export namespace Models { /** * Total number of variables that matched your query. */ - total: number | bigint; + total: number; /** * List of variables. */ @@ -415,7 +415,7 @@ export namespace Models { /** * Total number of localeCodes that matched your query. */ - total: number | bigint; + total: number; /** * List of localeCodes. */ @@ -429,7 +429,7 @@ export namespace Models { /** * Total number of providers that matched your query. */ - total: number | bigint; + total: number; /** * List of providers. */ @@ -443,7 +443,7 @@ export namespace Models { /** * Total number of messages that matched your query. */ - total: number | bigint; + total: number; /** * List of messages. */ @@ -457,7 +457,7 @@ export namespace Models { /** * Total number of topics that matched your query. */ - total: number | bigint; + total: number; /** * List of topics. */ @@ -471,7 +471,7 @@ export namespace Models { /** * Total number of subscribers that matched your query. */ - total: number | bigint; + total: number; /** * List of subscribers. */ @@ -485,7 +485,7 @@ export namespace Models { /** * Total number of targets that matched your query. */ - total: number | bigint; + total: number; /** * List of targets. */ @@ -499,7 +499,7 @@ export namespace Models { /** * Total number of transactions that matched your query. */ - total: number | bigint; + total: number; /** * List of transactions. */ @@ -513,7 +513,7 @@ export namespace Models { /** * Total number of specifications that matched your query. */ - total: number | bigint; + total: number; /** * List of specifications. */ @@ -611,7 +611,7 @@ export namespace Models { /** * Total number of attributes in the given collection. */ - total: number | bigint; + total: number; /** * List of attributes. */ @@ -657,7 +657,7 @@ export namespace Models { /** * Attribute size. */ - size: number | bigint; + size: number; /** * Default value for attribute when not provided. Cannot be set when attribute is required. */ @@ -715,7 +715,7 @@ export namespace Models { /** * Default value for attribute when not provided. Cannot be set when attribute is required. */ - default?: number | bigint; + default?: number; } /** @@ -757,15 +757,15 @@ export namespace Models { /** * Minimum value to enforce for new documents. */ - min?: number | bigint; + min?: number; /** * Maximum value to enforce for new documents. */ - max?: number | bigint; + max?: number; /** * Default value for attribute when not provided. Cannot be set when attribute is required. */ - default?: number | bigint; + default?: number; } /** @@ -1285,7 +1285,7 @@ export namespace Models { /** * Total number of columns in the given table. */ - total: number | bigint; + total: number; /** * List of columns. */ @@ -1331,7 +1331,7 @@ export namespace Models { /** * Column size. */ - size: number | bigint; + size: number; /** * Default value for column when not provided. Cannot be set when column is required. */ @@ -1389,7 +1389,7 @@ export namespace Models { /** * Default value for column when not provided. Cannot be set when column is required. */ - default?: number | bigint; + default?: number; } /** @@ -1431,15 +1431,15 @@ export namespace Models { /** * Minimum value to enforce for new documents. */ - min?: number | bigint; + min?: number; /** * Maximum value to enforce for new documents. */ - max?: number | bigint; + max?: number; /** * Default value for column when not provided. Cannot be set when column is required. */ - default?: number | bigint; + default?: number; } /** @@ -1945,7 +1945,7 @@ export namespace Models { /** * Index attributes length. */ - lengths: number | bigint[]; + lengths: number[]; /** * Index orders. */ @@ -1991,7 +1991,7 @@ export namespace Models { /** * Index columns length. */ - lengths: number | bigint[]; + lengths: number[]; /** * Index orders. */ @@ -2009,7 +2009,7 @@ export namespace Models { /** * Row automatically incrementing ID. */ - $sequence: number | bigint; + $sequence: number; /** * Table ID. */ @@ -2048,7 +2048,7 @@ export namespace Models { /** * Document automatically incrementing ID. */ - $sequence: number | bigint; + $sequence: number; /** * Collection ID. */ @@ -2299,19 +2299,19 @@ export namespace Models { /** * CPU complexity of computed hash. */ - costCpu: number | bigint; + costCpu: number; /** * Memory complexity of computed hash. */ - costMemory: number | bigint; + costMemory: number; /** * Parallelization of computed hash. */ - costParallel: number | bigint; + costParallel: number; /** * Length used to compute hash. */ - length: number | bigint; + length: number; } /** @@ -2347,15 +2347,15 @@ export namespace Models { /** * Memory used to compute hash. */ - memoryCost: number | bigint; + memoryCost: number; /** * Amount of time consumed to compute hash */ - timeCost: number | bigint; + timeCost: number; /** * Number of threads used to compute hash. */ - threads: number | bigint; + threads: number; } /** @@ -2664,15 +2664,23 @@ export namespace Models { /** * File original size in bytes. */ - sizeOriginal: number | bigint; + sizeOriginal: number; /** * Total number of chunks available */ - chunksTotal: number | bigint; + chunksTotal: number; /** * Total number of chunks uploaded */ - chunksUploaded: number | bigint; + chunksUploaded: number; + /** + * Whether file contents are encrypted at rest. + */ + encryption: boolean; + /** + * Compression algorithm used for the file. Will be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd). + */ + compression: string; } /** @@ -2710,7 +2718,7 @@ export namespace Models { /** * Maximum file size supported. */ - maximumFileSize: number | bigint; + maximumFileSize: number; /** * Allowed file extensions. */ @@ -2734,7 +2742,7 @@ export namespace Models { /** * Total size of this bucket in bytes. */ - totalSize: number | bigint; + totalSize: number; } /** @@ -2794,7 +2802,7 @@ export namespace Models { /** * Total number of team members. */ - total: number | bigint; + total: number; /** * Team preferences as a key-value object */ @@ -2930,7 +2938,7 @@ export namespace Models { /** * Site request timeout in seconds. */ - timeout: number | bigint; + timeout: number; /** * The install command used to install the site dependencies. */ @@ -3060,7 +3068,7 @@ export namespace Models { /** * Function execution timeout in seconds. */ - timeout: number | bigint; + timeout: number; /** * The entrypoint file used to execute the deployment. */ @@ -3224,15 +3232,15 @@ export namespace Models { /** * The code size in bytes. */ - sourceSize: number | bigint; + sourceSize: number; /** * The build output size in bytes. */ - buildSize: number | bigint; + buildSize: number; /** * The total size in bytes (source and build output). */ - totalSize: number | bigint; + totalSize: number; /** * The current build ID. */ @@ -3260,7 +3268,7 @@ export namespace Models { /** * The current build time in seconds. */ - buildDuration: number | bigint; + buildDuration: number; /** * The name of the vcs provider repository */ @@ -3354,7 +3362,7 @@ export namespace Models { /** * HTTP response status code. */ - responseStatusCode: number | bigint; + responseStatusCode: number; /** * HTTP response body. This will return empty unless execution is created as synchronous. */ @@ -3374,7 +3382,7 @@ export namespace Models { /** * Resource(function/site) execution duration in seconds. */ - duration: number | bigint; + duration: number; /** * The scheduled time for execution. If left empty, execution will be queued immediately. */ @@ -3484,11 +3492,11 @@ export namespace Models { /** * Number of decimal digits. */ - decimalDigits: number | bigint; + decimalDigits: number; /** * Currency digit rounding. */ - rounding: number | bigint; + rounding: number; /** * Currency code in [ISO 4217-1](http://en.wikipedia.org/wiki/ISO_4217) three-character format. */ @@ -3538,7 +3546,7 @@ export namespace Models { /** * Amount of actions in the queue. */ - size: number | bigint; + size: number; } /** @@ -3552,7 +3560,7 @@ export namespace Models { /** * Duration in milliseconds how long the health check took. */ - ping: number | bigint; + ping: number; /** * Service status. Possible values are: `pass`, `fail` */ @@ -3596,15 +3604,15 @@ export namespace Models { /** * Current unix timestamp on trustful remote server. */ - remoteTime: number | bigint; + remoteTime: number; /** * Current unix timestamp of local server where Appwrite runs. */ - localTime: number | bigint; + localTime: number; /** * Difference of unix remote and local timestamps in milliseconds. */ - diff: number | bigint; + diff: number; } /** @@ -3628,11 +3636,11 @@ export namespace Models { /** * Memory size in MB. */ - memory: number | bigint; + memory: number; /** * Number of CPUs. */ - cpus: number | bigint; + cpus: number; /** * Is size enabled. */ @@ -3800,7 +3808,7 @@ export namespace Models { /** * Number of recipients the message was delivered to. */ - deliveredTotal: number | bigint; + deliveredTotal: number; /** * Data of the message. */ @@ -3834,15 +3842,15 @@ export namespace Models { /** * Total count of email subscribers subscribed to the topic. */ - emailTotal: number | bigint; + emailTotal: number; /** * Total count of SMS subscribers subscribed to the topic. */ - smsTotal: number | bigint; + smsTotal: number; /** * Total count of push subscribers subscribed to the topic. */ - pushTotal: number | bigint; + pushTotal: number; /** * Subscribe permissions. */ @@ -3872,7 +3880,7 @@ export namespace Models { /** * Number of operations in the transaction. */ - operations: number | bigint; + operations: number; /** * Expiration time in ISO 8601 format. */ @@ -3986,7 +3994,7 @@ export namespace Models { /** * Archive size in bytes. */ - size: number | bigint; + size: number; /** * The status of the archive creation. Possible values: pending, processing, uploading, completed, failed. */ @@ -4056,31 +4064,31 @@ export namespace Models { /** * Invoice Amount */ - amount: number | bigint; + amount: number; /** * Tax percentage */ - tax: number | bigint; + tax: number; /** * Tax amount */ - taxAmount: number | bigint; + taxAmount: number; /** * VAT percentage */ - vat: number | bigint; + vat: number; /** * VAT amount */ - vatAmount: number | bigint; + vatAmount: number; /** * Gross amount after vat, tax, and discounts applied. */ - grossAmount: number | bigint; + grossAmount: number; /** * Credits used. */ - creditsUsed: number | bigint; + creditsUsed: number; /** * Currency the invoice is in */ @@ -4150,7 +4158,7 @@ export namespace Models { /** * How many days to keep the backup before it will be automatically deleted. */ - retention: number | bigint; + retention: number; /** * Policy backup schedule in CRON format. */ @@ -4222,15 +4230,15 @@ export namespace Models { /** * Invoice value */ - value: number | bigint; + value: number; /** * Invoice amount */ - amount: number | bigint; + amount: number; /** * Invoice rate */ - rate: number | bigint; + rate: number; /** * Invoice description */ @@ -4258,7 +4266,7 @@ export namespace Models { /** * Total number of archives that matched your query. */ - total: number | bigint; + total: number; /** * List of archives. */ @@ -4272,7 +4280,7 @@ export namespace Models { /** * Total number of policies that matched your query. */ - total: number | bigint; + total: number; /** * List of policies. */ @@ -4286,7 +4294,7 @@ export namespace Models { /** * Total number of restorations that matched your query. */ - total: number | bigint; + total: number; /** * List of restorations. */ diff --git a/src/services/account.ts b/src/services/account.ts index a71e263..3464e98 100644 --- a/src/services/account.ts +++ b/src/services/account.ts @@ -302,30 +302,30 @@ export class Account { /** * Use this endpoint to create a JSON Web Token. You can use the resulting JWT to authenticate on behalf of the current user when working with the Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes from its creation and will be invalid if the user will logout in that time frame. * - * @param {number | bigint} params.duration - Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds. + * @param {number} params.duration - Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds. * @throws {AppwriteException} * @returns {Promise} */ - createJWT(params?: { duration?: number | bigint }): Promise; + createJWT(params?: { duration?: number }): Promise; /** * Use this endpoint to create a JSON Web Token. You can use the resulting JWT to authenticate on behalf of the current user when working with the Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes from its creation and will be invalid if the user will logout in that time frame. * - * @param {number | bigint} duration - Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds. + * @param {number} duration - Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createJWT(duration?: number | bigint): Promise; + createJWT(duration?: number): Promise; createJWT( - paramsOrFirst?: { duration?: number | bigint } | number | bigint + paramsOrFirst?: { duration?: number } | number ): Promise { - let params: { duration?: number | bigint }; + let params: { duration?: number }; if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { duration?: number | bigint }; + params = (paramsOrFirst || {}) as { duration?: number }; } else { params = { - duration: paramsOrFirst as number | bigint + duration: paramsOrFirst as number }; } @@ -2338,7 +2338,7 @@ export class Account { * * A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). * - * @param {OAuthProvider} params.provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom, githubImagine, googleImagine. + * @param {OAuthProvider} params.provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom. * @param {string} params.success - URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. * @param {string} params.failure - URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. * @param {string[]} params.scopes - A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long. @@ -2353,7 +2353,7 @@ export class Account { * * A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). * - * @param {OAuthProvider} provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom, githubImagine, googleImagine. + * @param {OAuthProvider} provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom. * @param {string} success - URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. * @param {string} failure - URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. * @param {string[]} scopes - A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long. diff --git a/src/services/avatars.ts b/src/services/avatars.ts index 7e1545b..a27b0e5 100644 --- a/src/services/avatars.ts +++ b/src/services/avatars.ts @@ -21,41 +21,41 @@ export class Avatars { * 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. * * @param {Browser} params.code - Browser Code. - * @param {number | bigint} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100. - * @param {number | bigint} params.height - Image height. Pass an integer between 0 to 2000. Defaults to 100. - * @param {number | bigint} params.quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. + * @param {number} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100. + * @param {number} params.height - Image height. Pass an integer between 0 to 2000. Defaults to 100. + * @param {number} params.quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. * @throws {AppwriteException} * @returns {Promise} */ - getBrowser(params: { code: Browser, width?: number | bigint, height?: number | bigint, quality?: number | bigint }): Promise; + getBrowser(params: { code: Browser, width?: number, height?: number, quality?: number }): Promise; /** * You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET /account/sessions](https://appwrite.io/docs/references/cloud/client-web/account#getSessions) endpoint. 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. * * @param {Browser} code - Browser Code. - * @param {number | bigint} width - Image width. Pass an integer between 0 to 2000. Defaults to 100. - * @param {number | bigint} height - Image height. Pass an integer between 0 to 2000. Defaults to 100. - * @param {number | bigint} quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. + * @param {number} width - Image width. Pass an integer between 0 to 2000. Defaults to 100. + * @param {number} height - Image height. Pass an integer between 0 to 2000. Defaults to 100. + * @param {number} quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getBrowser(code: Browser, width?: number | bigint, height?: number | bigint, quality?: number | bigint): Promise; + getBrowser(code: Browser, width?: number, height?: number, quality?: number): Promise; getBrowser( - paramsOrFirst: { code: Browser, width?: number | bigint, height?: number | bigint, quality?: number | bigint } | Browser, - ...rest: [(number | bigint)?, (number | bigint)?, (number | bigint)?] + paramsOrFirst: { code: Browser, width?: number, height?: number, quality?: number } | Browser, + ...rest: [(number)?, (number)?, (number)?] ): Promise { - let params: { code: Browser, width?: number | bigint, height?: number | bigint, quality?: number | bigint }; + let params: { code: Browser, width?: number, height?: number, quality?: number }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'code' in paramsOrFirst)) { - params = (paramsOrFirst || {}) as { code: Browser, width?: number | bigint, height?: number | bigint, quality?: number | bigint }; + params = (paramsOrFirst || {}) as { code: Browser, width?: number, height?: number, quality?: number }; } else { params = { code: paramsOrFirst as Browser, - width: rest[0] as number | bigint, - height: rest[1] as number | bigint, - quality: rest[2] as number | bigint + width: rest[0] as number, + height: rest[1] as number, + quality: rest[2] as number }; } @@ -100,13 +100,13 @@ export class Avatars { * * * @param {CreditCard} params.code - Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, unionpay, visa, mir, maestro, rupay. - * @param {number | bigint} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100. - * @param {number | bigint} params.height - Image height. Pass an integer between 0 to 2000. Defaults to 100. - * @param {number | bigint} params.quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. + * @param {number} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100. + * @param {number} params.height - Image height. Pass an integer between 0 to 2000. Defaults to 100. + * @param {number} params.quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. * @throws {AppwriteException} * @returns {Promise} */ - getCreditCard(params: { code: CreditCard, width?: number | bigint, height?: number | bigint, quality?: number | bigint }): Promise; + getCreditCard(params: { code: CreditCard, width?: number, height?: number, quality?: number }): Promise; /** * 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. * @@ -114,28 +114,28 @@ export class Avatars { * * * @param {CreditCard} code - Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, unionpay, visa, mir, maestro, rupay. - * @param {number | bigint} width - Image width. Pass an integer between 0 to 2000. Defaults to 100. - * @param {number | bigint} height - Image height. Pass an integer between 0 to 2000. Defaults to 100. - * @param {number | bigint} quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. + * @param {number} width - Image width. Pass an integer between 0 to 2000. Defaults to 100. + * @param {number} height - Image height. Pass an integer between 0 to 2000. Defaults to 100. + * @param {number} quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getCreditCard(code: CreditCard, width?: number | bigint, height?: number | bigint, quality?: number | bigint): Promise; + getCreditCard(code: CreditCard, width?: number, height?: number, quality?: number): Promise; getCreditCard( - paramsOrFirst: { code: CreditCard, width?: number | bigint, height?: number | bigint, quality?: number | bigint } | CreditCard, - ...rest: [(number | bigint)?, (number | bigint)?, (number | bigint)?] + paramsOrFirst: { code: CreditCard, width?: number, height?: number, quality?: number } | CreditCard, + ...rest: [(number)?, (number)?, (number)?] ): Promise { - let params: { code: CreditCard, width?: number | bigint, height?: number | bigint, quality?: number | bigint }; + let params: { code: CreditCard, width?: number, height?: number, quality?: number }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'code' in paramsOrFirst)) { - params = (paramsOrFirst || {}) as { code: CreditCard, width?: number | bigint, height?: number | bigint, quality?: number | bigint }; + params = (paramsOrFirst || {}) as { code: CreditCard, width?: number, height?: number, quality?: number }; } else { params = { code: paramsOrFirst as CreditCard, - width: rest[0] as number | bigint, - height: rest[1] as number | bigint, - quality: rest[2] as number | bigint + width: rest[0] as number, + height: rest[1] as number, + quality: rest[2] as number }; } @@ -239,13 +239,13 @@ export class Avatars { * * * @param {Flag} params.code - Country Code. ISO Alpha-2 country code format. - * @param {number | bigint} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100. - * @param {number | bigint} params.height - Image height. Pass an integer between 0 to 2000. Defaults to 100. - * @param {number | bigint} params.quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. + * @param {number} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100. + * @param {number} params.height - Image height. Pass an integer between 0 to 2000. Defaults to 100. + * @param {number} params.quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. * @throws {AppwriteException} * @returns {Promise} */ - getFlag(params: { code: Flag, width?: number | bigint, height?: number | bigint, quality?: number | bigint }): Promise; + getFlag(params: { code: Flag, width?: number, height?: number, quality?: number }): Promise; /** * You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard. * @@ -253,28 +253,28 @@ export class Avatars { * * * @param {Flag} code - Country Code. ISO Alpha-2 country code format. - * @param {number | bigint} width - Image width. Pass an integer between 0 to 2000. Defaults to 100. - * @param {number | bigint} height - Image height. Pass an integer between 0 to 2000. Defaults to 100. - * @param {number | bigint} quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. + * @param {number} width - Image width. Pass an integer between 0 to 2000. Defaults to 100. + * @param {number} height - Image height. Pass an integer between 0 to 2000. Defaults to 100. + * @param {number} quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getFlag(code: Flag, width?: number | bigint, height?: number | bigint, quality?: number | bigint): Promise; + getFlag(code: Flag, width?: number, height?: number, quality?: number): Promise; getFlag( - paramsOrFirst: { code: Flag, width?: number | bigint, height?: number | bigint, quality?: number | bigint } | Flag, - ...rest: [(number | bigint)?, (number | bigint)?, (number | bigint)?] + paramsOrFirst: { code: Flag, width?: number, height?: number, quality?: number } | Flag, + ...rest: [(number)?, (number)?, (number)?] ): Promise { - let params: { code: Flag, width?: number | bigint, height?: number | bigint, quality?: number | bigint }; + let params: { code: Flag, width?: number, height?: number, quality?: number }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'code' in paramsOrFirst)) { - params = (paramsOrFirst || {}) as { code: Flag, width?: number | bigint, height?: number | bigint, quality?: number | bigint }; + params = (paramsOrFirst || {}) as { code: Flag, width?: number, height?: number, quality?: number }; } else { params = { code: paramsOrFirst as Flag, - width: rest[0] as number | bigint, - height: rest[1] as number | bigint, - quality: rest[2] as number | bigint + width: rest[0] as number, + height: rest[1] as number, + quality: rest[2] as number }; } @@ -320,12 +320,12 @@ export class Avatars { * This endpoint does not follow HTTP redirects. * * @param {string} params.url - Image URL which you want to crop. - * @param {number | bigint} params.width - Resize preview image width, Pass an integer between 0 to 2000. Defaults to 400. - * @param {number | bigint} params.height - Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400. + * @param {number} params.width - Resize preview image width, Pass an integer between 0 to 2000. Defaults to 400. + * @param {number} params.height - Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400. * @throws {AppwriteException} * @returns {Promise} */ - getImage(params: { url: string, width?: number | bigint, height?: number | bigint }): Promise; + getImage(params: { url: string, width?: number, height?: number }): Promise; /** * Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol. * @@ -334,26 +334,26 @@ export class Avatars { * This endpoint does not follow HTTP redirects. * * @param {string} url - Image URL which you want to crop. - * @param {number | bigint} width - Resize preview image width, Pass an integer between 0 to 2000. Defaults to 400. - * @param {number | bigint} height - Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400. + * @param {number} width - Resize preview image width, Pass an integer between 0 to 2000. Defaults to 400. + * @param {number} height - Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getImage(url: string, width?: number | bigint, height?: number | bigint): Promise; + getImage(url: string, width?: number, height?: number): Promise; getImage( - paramsOrFirst: { url: string, width?: number | bigint, height?: number | bigint } | string, - ...rest: [(number | bigint)?, (number | bigint)?] + paramsOrFirst: { url: string, width?: number, height?: number } | string, + ...rest: [(number)?, (number)?] ): Promise { - let params: { url: string, width?: number | bigint, height?: number | bigint }; + let params: { url: string, width?: number, height?: number }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { url: string, width?: number | bigint, height?: number | bigint }; + params = (paramsOrFirst || {}) as { url: string, width?: number, height?: number }; } else { params = { url: paramsOrFirst as string, - width: rest[0] as number | bigint, - height: rest[1] as number | bigint + width: rest[0] as number, + height: rest[1] as number }; } @@ -399,13 +399,13 @@ export class Avatars { * * * @param {string} params.name - Full Name. When empty, current user name or email will be used. Max length: 128 chars. - * @param {number | bigint} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100. - * @param {number | bigint} params.height - Image height. Pass an integer between 0 to 2000. Defaults to 100. + * @param {number} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100. + * @param {number} params.height - Image height. Pass an integer between 0 to 2000. Defaults to 100. * @param {string} params.background - Changes background color. By default a random color will be picked and stay will persistent to the given name. * @throws {AppwriteException} * @returns {Promise} */ - getInitials(params?: { name?: string, width?: number | bigint, height?: number | bigint, background?: string }): Promise; + getInitials(params?: { name?: string, width?: number, height?: number, background?: string }): Promise; /** * Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned. * @@ -415,27 +415,27 @@ export class Avatars { * * * @param {string} name - Full Name. When empty, current user name or email will be used. Max length: 128 chars. - * @param {number | bigint} width - Image width. Pass an integer between 0 to 2000. Defaults to 100. - * @param {number | bigint} height - Image height. Pass an integer between 0 to 2000. Defaults to 100. + * @param {number} width - Image width. Pass an integer between 0 to 2000. Defaults to 100. + * @param {number} height - Image height. Pass an integer between 0 to 2000. Defaults to 100. * @param {string} background - Changes background color. By default a random color will be picked and stay will persistent to the given name. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getInitials(name?: string, width?: number | bigint, height?: number | bigint, background?: string): Promise; + getInitials(name?: string, width?: number, height?: number, background?: string): Promise; getInitials( - paramsOrFirst?: { name?: string, width?: number | bigint, height?: number | bigint, background?: string } | string, - ...rest: [(number | bigint)?, (number | bigint)?, (string)?] + paramsOrFirst?: { name?: string, width?: number, height?: number, background?: string } | string, + ...rest: [(number)?, (number)?, (string)?] ): Promise { - let params: { name?: string, width?: number | bigint, height?: number | bigint, background?: string }; + let params: { name?: string, width?: number, height?: number, background?: string }; if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { name?: string, width?: number | bigint, height?: number | bigint, background?: string }; + params = (paramsOrFirst || {}) as { name?: string, width?: number, height?: number, background?: string }; } else { params = { name: paramsOrFirst as string, - width: rest[0] as number | bigint, - height: rest[1] as number | bigint, + width: rest[0] as number, + height: rest[1] as number, background: rest[2] as string }; } @@ -479,39 +479,39 @@ export class Avatars { * * * @param {string} params.text - Plain text to be converted to QR code image. - * @param {number | bigint} params.size - QR code size. Pass an integer between 1 to 1000. Defaults to 400. - * @param {number | bigint} params.margin - Margin from edge. Pass an integer between 0 to 10. Defaults to 1. + * @param {number} params.size - QR code size. Pass an integer between 1 to 1000. Defaults to 400. + * @param {number} params.margin - Margin from edge. Pass an integer between 0 to 10. Defaults to 1. * @param {boolean} params.download - Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0. * @throws {AppwriteException} * @returns {Promise} */ - getQR(params: { text: string, size?: number | bigint, margin?: number | bigint, download?: boolean }): Promise; + getQR(params: { text: string, size?: number, margin?: number, download?: boolean }): Promise; /** * Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image. * * * @param {string} text - Plain text to be converted to QR code image. - * @param {number | bigint} size - QR code size. Pass an integer between 1 to 1000. Defaults to 400. - * @param {number | bigint} margin - Margin from edge. Pass an integer between 0 to 10. Defaults to 1. + * @param {number} size - QR code size. Pass an integer between 1 to 1000. Defaults to 400. + * @param {number} margin - Margin from edge. Pass an integer between 0 to 10. Defaults to 1. * @param {boolean} download - Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getQR(text: string, size?: number | bigint, margin?: number | bigint, download?: boolean): Promise; + getQR(text: string, size?: number, margin?: number, download?: boolean): Promise; getQR( - paramsOrFirst: { text: string, size?: number | bigint, margin?: number | bigint, download?: boolean } | string, - ...rest: [(number | bigint)?, (number | bigint)?, (boolean)?] + paramsOrFirst: { text: string, size?: number, margin?: number, download?: boolean } | string, + ...rest: [(number)?, (number)?, (boolean)?] ): Promise { - let params: { text: string, size?: number | bigint, margin?: number | bigint, download?: boolean }; + let params: { text: string, size?: number, margin?: number, download?: boolean }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { text: string, size?: number | bigint, margin?: number | bigint, download?: boolean }; + params = (paramsOrFirst || {}) as { text: string, size?: number, margin?: number, download?: boolean }; } else { params = { text: paramsOrFirst as string, - size: rest[0] as number | bigint, - margin: rest[1] as number | bigint, + size: rest[0] as number, + margin: rest[1] as number, download: rest[2] as boolean }; } @@ -562,28 +562,28 @@ export class Avatars { * * @param {string} params.url - Website URL which you want to capture. * @param {object} params.headers - HTTP headers to send with the browser request. Defaults to empty. - * @param {number | bigint} params.viewportWidth - Browser viewport width. Pass an integer between 1 to 1920. Defaults to 1280. - * @param {number | bigint} params.viewportHeight - Browser viewport height. Pass an integer between 1 to 1080. Defaults to 720. - * @param {number | bigint} params.scale - Browser scale factor. Pass a number between 0.1 to 3. Defaults to 1. + * @param {number} params.viewportWidth - Browser viewport width. Pass an integer between 1 to 1920. Defaults to 1280. + * @param {number} params.viewportHeight - Browser viewport height. Pass an integer between 1 to 1080. Defaults to 720. + * @param {number} params.scale - Browser scale factor. Pass a number between 0.1 to 3. Defaults to 1. * @param {Theme} params.theme - Browser theme. Pass "light" or "dark". Defaults to "light". * @param {string} params.userAgent - Custom user agent string. Defaults to browser default. * @param {boolean} params.fullpage - Capture full page scroll. Pass 0 for viewport only, or 1 for full page. Defaults to 0. * @param {string} params.locale - Browser locale (e.g., "en-US", "fr-FR"). Defaults to browser default. * @param {Timezone} params.timezone - IANA timezone identifier (e.g., "America/New_York", "Europe/London"). Defaults to browser default. - * @param {number | bigint} params.latitude - Geolocation latitude. Pass a number between -90 to 90. Defaults to 0. - * @param {number | bigint} params.longitude - Geolocation longitude. Pass a number between -180 to 180. Defaults to 0. - * @param {number | bigint} params.accuracy - Geolocation accuracy in meters. Pass a number between 0 to 100000. Defaults to 0. + * @param {number} params.latitude - Geolocation latitude. Pass a number between -90 to 90. Defaults to 0. + * @param {number} params.longitude - Geolocation longitude. Pass a number between -180 to 180. Defaults to 0. + * @param {number} params.accuracy - Geolocation accuracy in meters. Pass a number between 0 to 100000. Defaults to 0. * @param {boolean} params.touch - Enable touch support. Pass 0 for no touch, or 1 for touch enabled. Defaults to 0. * @param {string[]} params.permissions - Browser permissions to grant. Pass an array of permission names like ["geolocation", "camera", "microphone"]. Defaults to empty. - * @param {number | bigint} params.sleep - Wait time in seconds before taking the screenshot. Pass an integer between 0 to 10. Defaults to 0. - * @param {number | bigint} params.width - Output image width. Pass 0 to use original width, or an integer between 1 to 2000. Defaults to 0 (original width). - * @param {number | bigint} params.height - Output image height. Pass 0 to use original height, or an integer between 1 to 2000. Defaults to 0 (original height). - * @param {number | bigint} params.quality - Screenshot quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. + * @param {number} params.sleep - Wait time in seconds before taking the screenshot. Pass an integer between 0 to 10. Defaults to 0. + * @param {number} params.width - Output image width. Pass 0 to use original width, or an integer between 1 to 2000. Defaults to 0 (original width). + * @param {number} params.height - Output image height. Pass 0 to use original height, or an integer between 1 to 2000. Defaults to 0 (original height). + * @param {number} params.quality - Screenshot quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. * @param {ImageFormat} params.output - Output format type (jpeg, jpg, png, gif and webp). * @throws {AppwriteException} * @returns {Promise} */ - getScreenshot(params: { url: string, headers?: object, viewportWidth?: number | bigint, viewportHeight?: number | bigint, scale?: number | bigint, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number | bigint, longitude?: number | bigint, accuracy?: number | bigint, touch?: boolean, permissions?: string[], sleep?: number | bigint, width?: number | bigint, height?: number | bigint, quality?: number | bigint, output?: ImageFormat }): Promise; + getScreenshot(params: { url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: string[], sleep?: number, width?: number, height?: number, quality?: number, output?: ImageFormat }): Promise; /** * Use this endpoint to capture a screenshot of any website URL. This endpoint uses a headless browser to render the webpage and capture it as an image. * @@ -593,58 +593,58 @@ export class Avatars { * * @param {string} url - Website URL which you want to capture. * @param {object} headers - HTTP headers to send with the browser request. Defaults to empty. - * @param {number | bigint} viewportWidth - Browser viewport width. Pass an integer between 1 to 1920. Defaults to 1280. - * @param {number | bigint} viewportHeight - Browser viewport height. Pass an integer between 1 to 1080. Defaults to 720. - * @param {number | bigint} scale - Browser scale factor. Pass a number between 0.1 to 3. Defaults to 1. + * @param {number} viewportWidth - Browser viewport width. Pass an integer between 1 to 1920. Defaults to 1280. + * @param {number} viewportHeight - Browser viewport height. Pass an integer between 1 to 1080. Defaults to 720. + * @param {number} scale - Browser scale factor. Pass a number between 0.1 to 3. Defaults to 1. * @param {Theme} theme - Browser theme. Pass "light" or "dark". Defaults to "light". * @param {string} userAgent - Custom user agent string. Defaults to browser default. * @param {boolean} fullpage - Capture full page scroll. Pass 0 for viewport only, or 1 for full page. Defaults to 0. * @param {string} locale - Browser locale (e.g., "en-US", "fr-FR"). Defaults to browser default. * @param {Timezone} timezone - IANA timezone identifier (e.g., "America/New_York", "Europe/London"). Defaults to browser default. - * @param {number | bigint} latitude - Geolocation latitude. Pass a number between -90 to 90. Defaults to 0. - * @param {number | bigint} longitude - Geolocation longitude. Pass a number between -180 to 180. Defaults to 0. - * @param {number | bigint} accuracy - Geolocation accuracy in meters. Pass a number between 0 to 100000. Defaults to 0. + * @param {number} latitude - Geolocation latitude. Pass a number between -90 to 90. Defaults to 0. + * @param {number} longitude - Geolocation longitude. Pass a number between -180 to 180. Defaults to 0. + * @param {number} accuracy - Geolocation accuracy in meters. Pass a number between 0 to 100000. Defaults to 0. * @param {boolean} touch - Enable touch support. Pass 0 for no touch, or 1 for touch enabled. Defaults to 0. * @param {string[]} permissions - Browser permissions to grant. Pass an array of permission names like ["geolocation", "camera", "microphone"]. Defaults to empty. - * @param {number | bigint} sleep - Wait time in seconds before taking the screenshot. Pass an integer between 0 to 10. Defaults to 0. - * @param {number | bigint} width - Output image width. Pass 0 to use original width, or an integer between 1 to 2000. Defaults to 0 (original width). - * @param {number | bigint} height - Output image height. Pass 0 to use original height, or an integer between 1 to 2000. Defaults to 0 (original height). - * @param {number | bigint} quality - Screenshot quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. + * @param {number} sleep - Wait time in seconds before taking the screenshot. Pass an integer between 0 to 10. Defaults to 0. + * @param {number} width - Output image width. Pass 0 to use original width, or an integer between 1 to 2000. Defaults to 0 (original width). + * @param {number} height - Output image height. Pass 0 to use original height, or an integer between 1 to 2000. Defaults to 0 (original height). + * @param {number} quality - Screenshot quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. * @param {ImageFormat} output - Output format type (jpeg, jpg, png, gif and webp). * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getScreenshot(url: string, headers?: object, viewportWidth?: number | bigint, viewportHeight?: number | bigint, scale?: number | bigint, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number | bigint, longitude?: number | bigint, accuracy?: number | bigint, touch?: boolean, permissions?: string[], sleep?: number | bigint, width?: number | bigint, height?: number | bigint, quality?: number | bigint, output?: ImageFormat): Promise; + getScreenshot(url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: string[], sleep?: number, width?: number, height?: number, quality?: number, output?: ImageFormat): Promise; getScreenshot( - paramsOrFirst: { url: string, headers?: object, viewportWidth?: number | bigint, viewportHeight?: number | bigint, scale?: number | bigint, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number | bigint, longitude?: number | bigint, accuracy?: number | bigint, touch?: boolean, permissions?: string[], sleep?: number | bigint, width?: number | bigint, height?: number | bigint, quality?: number | bigint, output?: ImageFormat } | string, - ...rest: [(object)?, (number | bigint)?, (number | bigint)?, (number | bigint)?, (Theme)?, (string)?, (boolean)?, (string)?, (Timezone)?, (number | bigint)?, (number | bigint)?, (number | bigint)?, (boolean)?, (string[])?, (number | bigint)?, (number | bigint)?, (number | bigint)?, (number | bigint)?, (ImageFormat)?] + paramsOrFirst: { url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: string[], sleep?: number, width?: number, height?: number, quality?: number, output?: ImageFormat } | string, + ...rest: [(object)?, (number)?, (number)?, (number)?, (Theme)?, (string)?, (boolean)?, (string)?, (Timezone)?, (number)?, (number)?, (number)?, (boolean)?, (string[])?, (number)?, (number)?, (number)?, (number)?, (ImageFormat)?] ): Promise { - let params: { url: string, headers?: object, viewportWidth?: number | bigint, viewportHeight?: number | bigint, scale?: number | bigint, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number | bigint, longitude?: number | bigint, accuracy?: number | bigint, touch?: boolean, permissions?: string[], sleep?: number | bigint, width?: number | bigint, height?: number | bigint, quality?: number | bigint, output?: ImageFormat }; + let params: { url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: string[], sleep?: number, width?: number, height?: number, quality?: number, output?: ImageFormat }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { url: string, headers?: object, viewportWidth?: number | bigint, viewportHeight?: number | bigint, scale?: number | bigint, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number | bigint, longitude?: number | bigint, accuracy?: number | bigint, touch?: boolean, permissions?: string[], sleep?: number | bigint, width?: number | bigint, height?: number | bigint, quality?: number | bigint, output?: ImageFormat }; + params = (paramsOrFirst || {}) as { url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: string[], sleep?: number, width?: number, height?: number, quality?: number, output?: ImageFormat }; } else { params = { url: paramsOrFirst as string, headers: rest[0] as object, - viewportWidth: rest[1] as number | bigint, - viewportHeight: rest[2] as number | bigint, - scale: rest[3] as number | bigint, + viewportWidth: rest[1] as number, + viewportHeight: rest[2] as number, + scale: rest[3] as number, theme: rest[4] as Theme, userAgent: rest[5] as string, fullpage: rest[6] as boolean, locale: rest[7] as string, timezone: rest[8] as Timezone, - latitude: rest[9] as number | bigint, - longitude: rest[10] as number | bigint, - accuracy: rest[11] as number | bigint, + latitude: rest[9] as number, + longitude: rest[10] as number, + accuracy: rest[11] as number, touch: rest[12] as boolean, permissions: rest[13] as string[], - sleep: rest[14] as number | bigint, - width: rest[15] as number | bigint, - height: rest[16] as number | bigint, - quality: rest[17] as number | bigint, + sleep: rest[14] as number, + width: rest[15] as number, + height: rest[16] as number, + quality: rest[17] as number, output: rest[18] as ImageFormat }; } diff --git a/src/services/backups.ts b/src/services/backups.ts index 98d2a39..15f77f4 100644 --- a/src/services/backups.ts +++ b/src/services/backups.ts @@ -282,7 +282,7 @@ export class Backups { * * @param {string} params.policyId - Policy 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. * @param {string[]} params.services - Array of services to backup - * @param {number | bigint} params.retention - Days to keep backups before deletion + * @param {number} params.retention - Days to keep backups before deletion * @param {string} params.schedule - Schedule CRON syntax. * @param {string} params.name - Policy name. Max length: 128 chars. * @param {string} params.resourceId - Resource ID. When set, only this single resource will be backed up. @@ -290,13 +290,13 @@ export class Backups { * @throws {AppwriteException} * @returns {Promise} */ - createPolicy(params: { policyId: string, services: string[], retention: number | bigint, schedule: string, name?: string, resourceId?: string, enabled?: boolean }): Promise; + createPolicy(params: { policyId: string, services: string[], retention: number, schedule: string, name?: string, resourceId?: string, enabled?: boolean }): Promise; /** * Create a new backup policy. * * @param {string} policyId - Policy 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. * @param {string[]} services - Array of services to backup - * @param {number | bigint} retention - Days to keep backups before deletion + * @param {number} retention - Days to keep backups before deletion * @param {string} schedule - Schedule CRON syntax. * @param {string} name - Policy name. Max length: 128 chars. * @param {string} resourceId - Resource ID. When set, only this single resource will be backed up. @@ -305,20 +305,20 @@ export class Backups { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createPolicy(policyId: string, services: string[], retention: number | bigint, schedule: string, name?: string, resourceId?: string, enabled?: boolean): Promise; + createPolicy(policyId: string, services: string[], retention: number, schedule: string, name?: string, resourceId?: string, enabled?: boolean): Promise; createPolicy( - paramsOrFirst: { policyId: string, services: string[], retention: number | bigint, schedule: string, name?: string, resourceId?: string, enabled?: boolean } | string, - ...rest: [(string[])?, (number | bigint)?, (string)?, (string)?, (string)?, (boolean)?] + paramsOrFirst: { policyId: string, services: string[], retention: number, schedule: string, name?: string, resourceId?: string, enabled?: boolean } | string, + ...rest: [(string[])?, (number)?, (string)?, (string)?, (string)?, (boolean)?] ): Promise { - let params: { policyId: string, services: string[], retention: number | bigint, schedule: string, name?: string, resourceId?: string, enabled?: boolean }; + let params: { policyId: string, services: string[], retention: number, schedule: string, name?: string, resourceId?: string, enabled?: boolean }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { policyId: string, services: string[], retention: number | bigint, schedule: string, name?: string, resourceId?: string, enabled?: boolean }; + params = (paramsOrFirst || {}) as { policyId: string, services: string[], retention: number, schedule: string, name?: string, resourceId?: string, enabled?: boolean }; } else { params = { policyId: paramsOrFirst as string, services: rest[0] as string[], - retention: rest[1] as number | bigint, + retention: rest[1] as number, schedule: rest[2] as string, name: rest[3] as string, resourceId: rest[4] as string, @@ -440,39 +440,39 @@ export class Backups { * * @param {string} params.policyId - Policy ID. Choose a custom ID`. 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. * @param {string} params.name - Policy name. Max length: 128 chars. - * @param {number | bigint} params.retention - Days to keep backups before deletion + * @param {number} params.retention - Days to keep backups before deletion * @param {string} params.schedule - Cron expression * @param {boolean} params.enabled - Is Backup enabled? When set to 'disabled', No backup will be taken * @throws {AppwriteException} * @returns {Promise} */ - updatePolicy(params: { policyId: string, name?: string, retention?: number | bigint, schedule?: string, enabled?: boolean }): Promise; + updatePolicy(params: { policyId: string, name?: string, retention?: number, schedule?: string, enabled?: boolean }): Promise; /** * Update an existing policy using it's ID. * * @param {string} policyId - Policy ID. Choose a custom ID`. 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. * @param {string} name - Policy name. Max length: 128 chars. - * @param {number | bigint} retention - Days to keep backups before deletion + * @param {number} retention - Days to keep backups before deletion * @param {string} schedule - Cron expression * @param {boolean} enabled - Is Backup enabled? When set to 'disabled', No backup will be taken * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updatePolicy(policyId: string, name?: string, retention?: number | bigint, schedule?: string, enabled?: boolean): Promise; + updatePolicy(policyId: string, name?: string, retention?: number, schedule?: string, enabled?: boolean): Promise; updatePolicy( - paramsOrFirst: { policyId: string, name?: string, retention?: number | bigint, schedule?: string, enabled?: boolean } | string, - ...rest: [(string)?, (number | bigint)?, (string)?, (boolean)?] + paramsOrFirst: { policyId: string, name?: string, retention?: number, schedule?: string, enabled?: boolean } | string, + ...rest: [(string)?, (number)?, (string)?, (boolean)?] ): Promise { - let params: { policyId: string, name?: string, retention?: number | bigint, schedule?: string, enabled?: boolean }; + let params: { policyId: string, name?: string, retention?: number, schedule?: string, enabled?: boolean }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { policyId: string, name?: string, retention?: number | bigint, schedule?: string, enabled?: boolean }; + params = (paramsOrFirst || {}) as { policyId: string, name?: string, retention?: number, schedule?: string, enabled?: boolean }; } else { params = { policyId: paramsOrFirst as string, name: rest[0] as string, - retention: rest[1] as number | bigint, + retention: rest[1] as number, schedule: rest[2] as string, enabled: rest[3] as boolean }; diff --git a/src/services/databases.ts b/src/services/databases.ts index f0d78cd..4505473 100644 --- a/src/services/databases.ts +++ b/src/services/databases.ts @@ -209,30 +209,30 @@ export class Databases { /** * Create a new transaction. * - * @param {number | bigint} params.ttl - Seconds before the transaction expires. + * @param {number} params.ttl - Seconds before the transaction expires. * @throws {AppwriteException} * @returns {Promise} */ - createTransaction(params?: { ttl?: number | bigint }): Promise; + createTransaction(params?: { ttl?: number }): Promise; /** * Create a new transaction. * - * @param {number | bigint} ttl - Seconds before the transaction expires. + * @param {number} ttl - Seconds before the transaction expires. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createTransaction(ttl?: number | bigint): Promise; + createTransaction(ttl?: number): Promise; createTransaction( - paramsOrFirst?: { ttl?: number | bigint } | number | bigint + paramsOrFirst?: { ttl?: number } | number ): Promise { - let params: { ttl?: number | bigint }; + let params: { ttl?: number }; if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { ttl?: number | bigint }; + params = (paramsOrFirst || {}) as { ttl?: number }; } else { params = { - ttl: paramsOrFirst as number | bigint + ttl: paramsOrFirst as number }; } @@ -1932,15 +1932,15 @@ export class Databases { * @param {string} params.collectionId - Collection ID. * @param {string} params.key - Attribute Key. * @param {boolean} params.required - Is attribute required? - * @param {number | bigint} params.min - Minimum value. - * @param {number | bigint} params.max - Maximum value. - * @param {number | bigint} params.xdefault - Default value. Cannot be set when required. + * @param {number} params.min - Minimum value. + * @param {number} params.max - Maximum value. + * @param {number} params.xdefault - Default value. Cannot be set when required. * @param {boolean} params.array - Is attribute an array? * @throws {AppwriteException} * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createFloatColumn` instead. */ - createFloatAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, min?: number | bigint, max?: number | bigint, xdefault?: number | bigint, array?: boolean }): Promise; + createFloatAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean }): Promise; /** * Create a float attribute. Optionally, minimum and maximum values can be provided. * @@ -1949,32 +1949,32 @@ export class Databases { * @param {string} collectionId - Collection ID. * @param {string} key - Attribute Key. * @param {boolean} required - Is attribute required? - * @param {number | bigint} min - Minimum value. - * @param {number | bigint} max - Maximum value. - * @param {number | bigint} xdefault - Default value. Cannot be set when required. + * @param {number} min - Minimum value. + * @param {number} max - Maximum value. + * @param {number} xdefault - Default value. Cannot be set when required. * @param {boolean} array - Is attribute an array? * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createFloatAttribute(databaseId: string, collectionId: string, key: string, required: boolean, min?: number | bigint, max?: number | bigint, xdefault?: number | bigint, array?: boolean): Promise; + createFloatAttribute(databaseId: string, collectionId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean): Promise; createFloatAttribute( - paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, min?: number | bigint, max?: number | bigint, xdefault?: number | bigint, array?: boolean } | string, - ...rest: [(string)?, (string)?, (boolean)?, (number | bigint)?, (number | bigint)?, (number | bigint)?, (boolean)?] + paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean } | string, + ...rest: [(string)?, (string)?, (boolean)?, (number)?, (number)?, (number)?, (boolean)?] ): Promise { - let params: { databaseId: string, collectionId: string, key: string, required: boolean, min?: number | bigint, max?: number | bigint, xdefault?: number | bigint, array?: boolean }; + let params: { databaseId: string, collectionId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, min?: number | bigint, max?: number | bigint, xdefault?: number | bigint, array?: boolean }; + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean }; } else { params = { databaseId: paramsOrFirst as string, collectionId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - min: rest[3] as number | bigint, - max: rest[4] as number | bigint, - xdefault: rest[5] as number | bigint, + min: rest[3] as number, + max: rest[4] as number, + xdefault: rest[5] as number, array: rest[6] as boolean }; } @@ -2043,15 +2043,15 @@ export class Databases { * @param {string} params.collectionId - Collection ID. * @param {string} params.key - Attribute Key. * @param {boolean} params.required - Is attribute required? - * @param {number | bigint} params.xdefault - Default value. Cannot be set when required. - * @param {number | bigint} params.min - Minimum value. - * @param {number | bigint} params.max - Maximum value. + * @param {number} params.xdefault - Default value. Cannot be set when required. + * @param {number} params.min - Minimum value. + * @param {number} params.max - Maximum value. * @param {string} params.newKey - New Attribute Key. * @throws {AppwriteException} * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateFloatColumn` instead. */ - updateFloatAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number | bigint, min?: number | bigint, max?: number | bigint, newKey?: string }): Promise; + updateFloatAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string }): Promise; /** * Update a float attribute. Changing the `default` value will not update already existing documents. * @@ -2060,32 +2060,32 @@ export class Databases { * @param {string} collectionId - Collection ID. * @param {string} key - Attribute Key. * @param {boolean} required - Is attribute required? - * @param {number | bigint} xdefault - Default value. Cannot be set when required. - * @param {number | bigint} min - Minimum value. - * @param {number | bigint} max - Maximum value. + * @param {number} xdefault - Default value. Cannot be set when required. + * @param {number} min - Minimum value. + * @param {number} max - Maximum value. * @param {string} newKey - New Attribute Key. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateFloatAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number | bigint, min?: number | bigint, max?: number | bigint, newKey?: string): Promise; + updateFloatAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string): Promise; updateFloatAttribute( - paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number | bigint, min?: number | bigint, max?: number | bigint, newKey?: string } | string, - ...rest: [(string)?, (string)?, (boolean)?, (number | bigint)?, (number | bigint)?, (number | bigint)?, (string)?] + paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string } | string, + ...rest: [(string)?, (string)?, (boolean)?, (number)?, (number)?, (number)?, (string)?] ): Promise { - let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number | bigint, min?: number | bigint, max?: number | bigint, newKey?: string }; + let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number | bigint, min?: number | bigint, max?: number | bigint, newKey?: string }; + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string }; } else { params = { databaseId: paramsOrFirst as string, collectionId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as number | bigint, - min: rest[4] as number | bigint, - max: rest[5] as number | bigint, + xdefault: rest[3] as number, + min: rest[4] as number, + max: rest[5] as number, newKey: rest[6] as string }; } @@ -3220,7 +3220,7 @@ export class Databases { * @param {string} params.databaseId - Database ID. * @param {string} params.collectionId - Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @param {string} params.key - Attribute Key. - * @param {number | bigint} params.size - Attribute size for text attributes, in number of characters. + * @param {number} params.size - Attribute size for text attributes, in number of characters. * @param {boolean} params.required - Is attribute required? * @param {string} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. * @param {boolean} params.array - Is attribute an array? @@ -3229,7 +3229,7 @@ export class Databases { * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createStringColumn` instead. */ - createStringAttribute(params: { databaseId: string, collectionId: string, key: string, size: number | bigint, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean }): Promise; + createStringAttribute(params: { databaseId: string, collectionId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean }): Promise; /** * Create a string attribute. * @@ -3237,7 +3237,7 @@ export class Databases { * @param {string} databaseId - Database ID. * @param {string} collectionId - Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @param {string} key - Attribute Key. - * @param {number | bigint} size - Attribute size for text attributes, in number of characters. + * @param {number} size - Attribute size for text attributes, in number of characters. * @param {boolean} required - Is attribute required? * @param {string} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. * @param {boolean} array - Is attribute an array? @@ -3246,21 +3246,21 @@ export class Databases { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createStringAttribute(databaseId: string, collectionId: string, key: string, size: number | bigint, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean): Promise; + createStringAttribute(databaseId: string, collectionId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean): Promise; createStringAttribute( - paramsOrFirst: { databaseId: string, collectionId: string, key: string, size: number | bigint, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean } | string, - ...rest: [(string)?, (string)?, (number | bigint)?, (boolean)?, (string)?, (boolean)?, (boolean)?] + paramsOrFirst: { databaseId: string, collectionId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean } | string, + ...rest: [(string)?, (string)?, (number)?, (boolean)?, (string)?, (boolean)?, (boolean)?] ): Promise { - let params: { databaseId: string, collectionId: string, key: string, size: number | bigint, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean }; + let params: { databaseId: string, collectionId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, size: number | bigint, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean }; + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean }; } else { params = { databaseId: paramsOrFirst as string, collectionId: rest[0] as string, key: rest[1] as string, - size: rest[2] as number | bigint, + size: rest[2] as number, required: rest[3] as boolean, xdefault: rest[4] as string, array: rest[5] as boolean, @@ -3336,13 +3336,13 @@ export class Databases { * @param {string} params.key - Attribute Key. * @param {boolean} params.required - Is attribute required? * @param {string} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. - * @param {number | bigint} params.size - Maximum size of the string attribute. + * @param {number} params.size - Maximum size of the string attribute. * @param {string} params.newKey - New Attribute Key. * @throws {AppwriteException} * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateStringColumn` instead. */ - updateStringAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, size?: number | bigint, newKey?: string }): Promise; + updateStringAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, size?: number, newKey?: string }): Promise; /** * Update a string attribute. Changing the `default` value will not update already existing documents. * @@ -3352,21 +3352,21 @@ export class Databases { * @param {string} key - Attribute Key. * @param {boolean} required - Is attribute required? * @param {string} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. - * @param {number | bigint} size - Maximum size of the string attribute. + * @param {number} size - Maximum size of the string attribute. * @param {string} newKey - New Attribute Key. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateStringAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, size?: number | bigint, newKey?: string): Promise; + updateStringAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, size?: number, newKey?: string): Promise; updateStringAttribute( - paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, size?: number | bigint, newKey?: string } | string, - ...rest: [(string)?, (string)?, (boolean)?, (string)?, (number | bigint)?, (string)?] + paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, size?: number, newKey?: string } | string, + ...rest: [(string)?, (string)?, (boolean)?, (string)?, (number)?, (string)?] ): Promise { - let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, size?: number | bigint, newKey?: string }; + let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, size?: number, newKey?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, size?: number | bigint, newKey?: string }; + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, size?: number, newKey?: string }; } else { params = { databaseId: paramsOrFirst as string, @@ -3374,7 +3374,7 @@ export class Databases { key: rest[1] as string, required: rest[2] as boolean, xdefault: rest[3] as string, - size: rest[4] as number | bigint, + size: rest[4] as number, newKey: rest[5] as string }; } @@ -4676,14 +4676,14 @@ export class Databases { * @param {string} params.collectionId - Collection ID. * @param {string} params.documentId - Document ID. * @param {string} params.attribute - Attribute key. - * @param {number | bigint} params.value - Value to increment the attribute by. The value must be a number. - * @param {number | bigint} params.min - Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown. + * @param {number} params.value - Value to increment the attribute by. The value must be a number. + * @param {number} params.min - Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown. * @param {string} params.transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.decrementRowColumn` instead. */ - decrementDocumentAttribute(params: { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number | bigint, min?: number | bigint, transactionId?: string }): Promise; + decrementDocumentAttribute(params: { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, min?: number, transactionId?: string }): Promise; /** * Decrement a specific attribute of a document by a given value. * @@ -4691,30 +4691,30 @@ export class Databases { * @param {string} collectionId - Collection ID. * @param {string} documentId - Document ID. * @param {string} attribute - Attribute key. - * @param {number | bigint} value - Value to increment the attribute by. The value must be a number. - * @param {number | bigint} min - Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown. + * @param {number} value - Value to increment the attribute by. The value must be a number. + * @param {number} min - Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown. * @param {string} transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - decrementDocumentAttribute(databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number | bigint, min?: number | bigint, transactionId?: string): Promise; + decrementDocumentAttribute(databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, min?: number, transactionId?: string): Promise; decrementDocumentAttribute( - paramsOrFirst: { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number | bigint, min?: number | bigint, transactionId?: string } | string, - ...rest: [(string)?, (string)?, (string)?, (number | bigint)?, (number | bigint)?, (string)?] + paramsOrFirst: { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, min?: number, transactionId?: string } | string, + ...rest: [(string)?, (string)?, (string)?, (number)?, (number)?, (string)?] ): Promise { - let params: { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number | bigint, min?: number | bigint, transactionId?: string }; + let params: { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, min?: number, transactionId?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number | bigint, min?: number | bigint, transactionId?: string }; + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, min?: number, transactionId?: string }; } else { params = { databaseId: paramsOrFirst as string, collectionId: rest[0] as string, documentId: rest[1] as string, attribute: rest[2] as string, - value: rest[3] as number | bigint, - min: rest[4] as number | bigint, + value: rest[3] as number, + min: rest[4] as number, transactionId: rest[5] as string }; } @@ -4772,14 +4772,14 @@ export class Databases { * @param {string} params.collectionId - Collection ID. * @param {string} params.documentId - Document ID. * @param {string} params.attribute - Attribute key. - * @param {number | bigint} params.value - Value to increment the attribute by. The value must be a number. - * @param {number | bigint} params.max - Maximum value for the attribute. If the current value is greater than this value, an error will be thrown. + * @param {number} params.value - Value to increment the attribute by. The value must be a number. + * @param {number} params.max - Maximum value for the attribute. If the current value is greater than this value, an error will be thrown. * @param {string} params.transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.incrementRowColumn` instead. */ - incrementDocumentAttribute(params: { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number | bigint, max?: number | bigint, transactionId?: string }): Promise; + incrementDocumentAttribute(params: { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, max?: number, transactionId?: string }): Promise; /** * Increment a specific attribute of a document by a given value. * @@ -4787,30 +4787,30 @@ export class Databases { * @param {string} collectionId - Collection ID. * @param {string} documentId - Document ID. * @param {string} attribute - Attribute key. - * @param {number | bigint} value - Value to increment the attribute by. The value must be a number. - * @param {number | bigint} max - Maximum value for the attribute. If the current value is greater than this value, an error will be thrown. + * @param {number} value - Value to increment the attribute by. The value must be a number. + * @param {number} max - Maximum value for the attribute. If the current value is greater than this value, an error will be thrown. * @param {string} transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - incrementDocumentAttribute(databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number | bigint, max?: number | bigint, transactionId?: string): Promise; + incrementDocumentAttribute(databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, max?: number, transactionId?: string): Promise; incrementDocumentAttribute( - paramsOrFirst: { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number | bigint, max?: number | bigint, transactionId?: string } | string, - ...rest: [(string)?, (string)?, (string)?, (number | bigint)?, (number | bigint)?, (string)?] + paramsOrFirst: { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, max?: number, transactionId?: string } | string, + ...rest: [(string)?, (string)?, (string)?, (number)?, (number)?, (string)?] ): Promise { - let params: { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number | bigint, max?: number | bigint, transactionId?: string }; + let params: { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, max?: number, transactionId?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number | bigint, max?: number | bigint, transactionId?: string }; + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, max?: number, transactionId?: string }; } else { params = { databaseId: paramsOrFirst as string, collectionId: rest[0] as string, documentId: rest[1] as string, attribute: rest[2] as string, - value: rest[3] as number | bigint, - max: rest[4] as number | bigint, + value: rest[3] as number, + max: rest[4] as number, transactionId: rest[5] as string }; } @@ -4945,12 +4945,12 @@ export class Databases { * @param {IndexType} params.type - Index type. * @param {string[]} params.attributes - Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long. * @param {string[]} params.orders - Array of index orders. Maximum of 100 orders are allowed. - * @param {number | bigint[]} params.lengths - Length of index. Maximum of 100 + * @param {number[]} params.lengths - Length of index. Maximum of 100 * @throws {AppwriteException} * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createIndex` instead. */ - createIndex(params: { databaseId: string, collectionId: string, key: string, type: IndexType, attributes: string[], orders?: string[], lengths?: number | bigint[] }): Promise; + createIndex(params: { databaseId: string, collectionId: string, key: string, type: IndexType, attributes: string[], orders?: string[], lengths?: number[] }): Promise; /** * Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request. * Attributes can be `key`, `fulltext`, and `unique`. @@ -4961,20 +4961,20 @@ export class Databases { * @param {IndexType} type - Index type. * @param {string[]} attributes - Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long. * @param {string[]} orders - Array of index orders. Maximum of 100 orders are allowed. - * @param {number | bigint[]} lengths - Length of index. Maximum of 100 + * @param {number[]} lengths - Length of index. Maximum of 100 * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createIndex(databaseId: string, collectionId: string, key: string, type: IndexType, attributes: string[], orders?: string[], lengths?: number | bigint[]): Promise; + createIndex(databaseId: string, collectionId: string, key: string, type: IndexType, attributes: string[], orders?: string[], lengths?: number[]): Promise; createIndex( - paramsOrFirst: { databaseId: string, collectionId: string, key: string, type: IndexType, attributes: string[], orders?: string[], lengths?: number | bigint[] } | string, - ...rest: [(string)?, (string)?, (IndexType)?, (string[])?, (string[])?, (number | bigint[])?] + paramsOrFirst: { databaseId: string, collectionId: string, key: string, type: IndexType, attributes: string[], orders?: string[], lengths?: number[] } | string, + ...rest: [(string)?, (string)?, (IndexType)?, (string[])?, (string[])?, (number[])?] ): Promise { - let params: { databaseId: string, collectionId: string, key: string, type: IndexType, attributes: string[], orders?: string[], lengths?: number | bigint[] }; + let params: { databaseId: string, collectionId: string, key: string, type: IndexType, attributes: string[], orders?: string[], lengths?: number[] }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, type: IndexType, attributes: string[], orders?: string[], lengths?: number | bigint[] }; + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, type: IndexType, attributes: string[], orders?: string[], lengths?: number[] }; } else { params = { databaseId: paramsOrFirst as string, @@ -4983,7 +4983,7 @@ export class Databases { type: rest[2] as IndexType, attributes: rest[3] as string[], orders: rest[4] as string[], - lengths: rest[5] as number | bigint[] + lengths: rest[5] as number[] }; } diff --git a/src/services/functions.ts b/src/services/functions.ts index 93c46a5..aa14dcd 100644 --- a/src/services/functions.ts +++ b/src/services/functions.ts @@ -89,7 +89,7 @@ export class Functions { * @param {string[]} params.execute - An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long. * @param {string[]} params.events - Events list. Maximum of 100 events are allowed. * @param {string} params.schedule - Schedule CRON syntax. - * @param {number | bigint} params.timeout - Function maximum execution time in seconds. + * @param {number} params.timeout - Function maximum execution time in seconds. * @param {boolean} params.enabled - Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled. * @param {boolean} params.logging - When disabled, executions will exclude logs and errors, and will be slightly faster. * @param {string} params.entrypoint - Entrypoint File. This path is relative to the "providerRootDirectory". @@ -104,7 +104,7 @@ export class Functions { * @throws {AppwriteException} * @returns {Promise} */ - create(params: { functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number | bigint, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string }): Promise; + create(params: { functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string }): Promise; /** * Create a new function. You can pass a list of [permissions](https://appwrite.io/docs/permissions) to allow different project users or team with access to execute the function using the client API. * @@ -114,7 +114,7 @@ export class Functions { * @param {string[]} execute - An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long. * @param {string[]} events - Events list. Maximum of 100 events are allowed. * @param {string} schedule - Schedule CRON syntax. - * @param {number | bigint} timeout - Function maximum execution time in seconds. + * @param {number} timeout - Function maximum execution time in seconds. * @param {boolean} enabled - Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled. * @param {boolean} logging - When disabled, executions will exclude logs and errors, and will be slightly faster. * @param {string} entrypoint - Entrypoint File. This path is relative to the "providerRootDirectory". @@ -130,15 +130,15 @@ export class Functions { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - create(functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number | bigint, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string): Promise; + create(functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string): Promise; create( - paramsOrFirst: { functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number | bigint, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string } | string, - ...rest: [(string)?, (Runtime)?, (string[])?, (string[])?, (string)?, (number | bigint)?, (boolean)?, (boolean)?, (string)?, (string)?, (string[])?, (string)?, (string)?, (string)?, (boolean)?, (string)?, (string)?] + paramsOrFirst: { functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string } | string, + ...rest: [(string)?, (Runtime)?, (string[])?, (string[])?, (string)?, (number)?, (boolean)?, (boolean)?, (string)?, (string)?, (string[])?, (string)?, (string)?, (string)?, (boolean)?, (string)?, (string)?] ): Promise { - let params: { functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number | bigint, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string }; + let params: { functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number | bigint, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string }; + params = (paramsOrFirst || {}) as { functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string }; } else { params = { functionId: paramsOrFirst as string, @@ -147,7 +147,7 @@ export class Functions { execute: rest[2] as string[], events: rest[3] as string[], schedule: rest[4] as string, - timeout: rest[5] as number | bigint, + timeout: rest[5] as number, enabled: rest[6] as boolean, logging: rest[7] as boolean, entrypoint: rest[8] as string, @@ -367,7 +367,7 @@ export class Functions { * @param {string[]} params.execute - An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long. * @param {string[]} params.events - Events list. Maximum of 100 events are allowed. * @param {string} params.schedule - Schedule CRON syntax. - * @param {number | bigint} params.timeout - Maximum execution time in seconds. + * @param {number} params.timeout - Maximum execution time in seconds. * @param {boolean} params.enabled - Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled. * @param {boolean} params.logging - When disabled, executions will exclude logs and errors, and will be slightly faster. * @param {string} params.entrypoint - Entrypoint File. This path is relative to the "providerRootDirectory". @@ -382,7 +382,7 @@ export class Functions { * @throws {AppwriteException} * @returns {Promise} */ - update(params: { functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number | bigint, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string }): Promise; + update(params: { functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string }): Promise; /** * Update function by its unique ID. * @@ -392,7 +392,7 @@ export class Functions { * @param {string[]} execute - An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long. * @param {string[]} events - Events list. Maximum of 100 events are allowed. * @param {string} schedule - Schedule CRON syntax. - * @param {number | bigint} timeout - Maximum execution time in seconds. + * @param {number} timeout - Maximum execution time in seconds. * @param {boolean} enabled - Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled. * @param {boolean} logging - When disabled, executions will exclude logs and errors, and will be slightly faster. * @param {string} entrypoint - Entrypoint File. This path is relative to the "providerRootDirectory". @@ -408,15 +408,15 @@ export class Functions { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - update(functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number | bigint, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string): Promise; + update(functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string): Promise; update( - paramsOrFirst: { functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number | bigint, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string } | string, - ...rest: [(string)?, (Runtime)?, (string[])?, (string[])?, (string)?, (number | bigint)?, (boolean)?, (boolean)?, (string)?, (string)?, (string[])?, (string)?, (string)?, (string)?, (boolean)?, (string)?, (string)?] + paramsOrFirst: { functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string } | string, + ...rest: [(string)?, (Runtime)?, (string[])?, (string[])?, (string)?, (number)?, (boolean)?, (boolean)?, (string)?, (string)?, (string[])?, (string)?, (string)?, (string)?, (boolean)?, (string)?, (string)?] ): Promise { - let params: { functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number | bigint, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string }; + let params: { functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number | bigint, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string }; + params = (paramsOrFirst || {}) as { functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string }; } else { params = { functionId: paramsOrFirst as string, @@ -425,7 +425,7 @@ export class Functions { execute: rest[2] as string[], events: rest[3] as string[], schedule: rest[4] as string, - timeout: rest[5] as number | bigint, + timeout: rest[5] as number, enabled: rest[6] as boolean, logging: rest[7] as boolean, entrypoint: rest[8] as string, diff --git a/src/services/health.ts b/src/services/health.ts index 44acd21..a4d5e19 100644 --- a/src/services/health.ts +++ b/src/services/health.ts @@ -179,30 +179,30 @@ export class Health { /** * Get billing project aggregation queue. * - * @param {number | bigint} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} */ - getQueueBillingProjectAggregation(params?: { threshold?: number | bigint }): Promise; + getQueueBillingProjectAggregation(params?: { threshold?: number }): Promise; /** * Get billing project aggregation queue. * - * @param {number | bigint} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getQueueBillingProjectAggregation(threshold?: number | bigint): Promise; + getQueueBillingProjectAggregation(threshold?: number): Promise; getQueueBillingProjectAggregation( - paramsOrFirst?: { threshold?: number | bigint } | number | bigint + paramsOrFirst?: { threshold?: number } | number ): Promise { - let params: { threshold?: number | bigint }; + let params: { threshold?: number }; if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { threshold?: number | bigint }; + params = (paramsOrFirst || {}) as { threshold?: number }; } else { params = { - threshold: paramsOrFirst as number | bigint + threshold: paramsOrFirst as number }; } @@ -230,30 +230,30 @@ export class Health { /** * Get billing team aggregation queue. * - * @param {number | bigint} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} */ - getQueueBillingTeamAggregation(params?: { threshold?: number | bigint }): Promise; + getQueueBillingTeamAggregation(params?: { threshold?: number }): Promise; /** * Get billing team aggregation queue. * - * @param {number | bigint} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getQueueBillingTeamAggregation(threshold?: number | bigint): Promise; + getQueueBillingTeamAggregation(threshold?: number): Promise; getQueueBillingTeamAggregation( - paramsOrFirst?: { threshold?: number | bigint } | number | bigint + paramsOrFirst?: { threshold?: number } | number ): Promise { - let params: { threshold?: number | bigint }; + let params: { threshold?: number }; if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { threshold?: number | bigint }; + params = (paramsOrFirst || {}) as { threshold?: number }; } else { params = { - threshold: paramsOrFirst as number | bigint + threshold: paramsOrFirst as number }; } @@ -281,30 +281,30 @@ export class Health { /** * Get the number of builds that are waiting to be processed in the Appwrite internal queue server. * - * @param {number | bigint} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} */ - getQueueBuilds(params?: { threshold?: number | bigint }): Promise; + getQueueBuilds(params?: { threshold?: number }): Promise; /** * Get the number of builds that are waiting to be processed in the Appwrite internal queue server. * - * @param {number | bigint} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getQueueBuilds(threshold?: number | bigint): Promise; + getQueueBuilds(threshold?: number): Promise; getQueueBuilds( - paramsOrFirst?: { threshold?: number | bigint } | number | bigint + paramsOrFirst?: { threshold?: number } | number ): Promise { - let params: { threshold?: number | bigint }; + let params: { threshold?: number }; if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { threshold?: number | bigint }; + params = (paramsOrFirst || {}) as { threshold?: number }; } else { params = { - threshold: paramsOrFirst as number | bigint + threshold: paramsOrFirst as number }; } @@ -332,30 +332,30 @@ export class Health { /** * Get the priority builds queue size. * - * @param {number | bigint} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 500. + * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 500. * @throws {AppwriteException} * @returns {Promise} */ - getQueuePriorityBuilds(params?: { threshold?: number | bigint }): Promise; + getQueuePriorityBuilds(params?: { threshold?: number }): Promise; /** * Get the priority builds queue size. * - * @param {number | bigint} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 500. + * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 500. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getQueuePriorityBuilds(threshold?: number | bigint): Promise; + getQueuePriorityBuilds(threshold?: number): Promise; getQueuePriorityBuilds( - paramsOrFirst?: { threshold?: number | bigint } | number | bigint + paramsOrFirst?: { threshold?: number } | number ): Promise { - let params: { threshold?: number | bigint }; + let params: { threshold?: number }; if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { threshold?: number | bigint }; + params = (paramsOrFirst || {}) as { threshold?: number }; } else { params = { - threshold: paramsOrFirst as number | bigint + threshold: paramsOrFirst as number }; } @@ -383,30 +383,30 @@ export class Health { /** * Get the number of certificates that are waiting to be issued against [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue server. * - * @param {number | bigint} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} */ - getQueueCertificates(params?: { threshold?: number | bigint }): Promise; + getQueueCertificates(params?: { threshold?: number }): Promise; /** * Get the number of certificates that are waiting to be issued against [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue server. * - * @param {number | bigint} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getQueueCertificates(threshold?: number | bigint): Promise; + getQueueCertificates(threshold?: number): Promise; getQueueCertificates( - paramsOrFirst?: { threshold?: number | bigint } | number | bigint + paramsOrFirst?: { threshold?: number } | number ): Promise { - let params: { threshold?: number | bigint }; + let params: { threshold?: number }; if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { threshold?: number | bigint }; + params = (paramsOrFirst || {}) as { threshold?: number }; } else { params = { - threshold: paramsOrFirst as number | bigint + threshold: paramsOrFirst as number }; } @@ -435,33 +435,33 @@ export class Health { * Get the number of database changes that are waiting to be processed in the Appwrite internal queue server. * * @param {string} params.name - Queue name for which to check the queue size - * @param {number | bigint} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} */ - getQueueDatabases(params?: { name?: string, threshold?: number | bigint }): Promise; + getQueueDatabases(params?: { name?: string, threshold?: number }): Promise; /** * Get the number of database changes that are waiting to be processed in the Appwrite internal queue server. * * @param {string} name - Queue name for which to check the queue size - * @param {number | bigint} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getQueueDatabases(name?: string, threshold?: number | bigint): Promise; + getQueueDatabases(name?: string, threshold?: number): Promise; getQueueDatabases( - paramsOrFirst?: { name?: string, threshold?: number | bigint } | string, - ...rest: [(number | bigint)?] + paramsOrFirst?: { name?: string, threshold?: number } | string, + ...rest: [(number)?] ): Promise { - let params: { name?: string, threshold?: number | bigint }; + let params: { name?: string, threshold?: number }; if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { name?: string, threshold?: number | bigint }; + params = (paramsOrFirst || {}) as { name?: string, threshold?: number }; } else { params = { name: paramsOrFirst as string, - threshold: rest[0] as number | bigint + threshold: rest[0] as number }; } @@ -493,30 +493,30 @@ export class Health { /** * Get the number of background destructive changes that are waiting to be processed in the Appwrite internal queue server. * - * @param {number | bigint} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} */ - getQueueDeletes(params?: { threshold?: number | bigint }): Promise; + getQueueDeletes(params?: { threshold?: number }): Promise; /** * Get the number of background destructive changes that are waiting to be processed in the Appwrite internal queue server. * - * @param {number | bigint} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getQueueDeletes(threshold?: number | bigint): Promise; + getQueueDeletes(threshold?: number): Promise; getQueueDeletes( - paramsOrFirst?: { threshold?: number | bigint } | number | bigint + paramsOrFirst?: { threshold?: number } | number ): Promise { - let params: { threshold?: number | bigint }; + let params: { threshold?: number }; if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { threshold?: number | bigint }; + params = (paramsOrFirst || {}) as { threshold?: number }; } else { params = { - threshold: paramsOrFirst as number | bigint + threshold: paramsOrFirst as number }; } @@ -546,34 +546,34 @@ export class Health { * * * @param {Name} params.name - The name of the queue - * @param {number | bigint} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} */ - getFailedJobs(params: { name: Name, threshold?: number | bigint }): Promise; + getFailedJobs(params: { name: Name, threshold?: number }): Promise; /** * Returns the amount of failed jobs in a given queue. * * * @param {Name} name - The name of the queue - * @param {number | bigint} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getFailedJobs(name: Name, threshold?: number | bigint): Promise; + getFailedJobs(name: Name, threshold?: number): Promise; getFailedJobs( - paramsOrFirst: { name: Name, threshold?: number | bigint } | Name, - ...rest: [(number | bigint)?] + paramsOrFirst: { name: Name, threshold?: number } | Name, + ...rest: [(number)?] ): Promise { - let params: { name: Name, threshold?: number | bigint }; + let params: { name: Name, threshold?: number }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'name' in paramsOrFirst)) { - params = (paramsOrFirst || {}) as { name: Name, threshold?: number | bigint }; + params = (paramsOrFirst || {}) as { name: Name, threshold?: number }; } else { params = { name: paramsOrFirst as Name, - threshold: rest[0] as number | bigint + threshold: rest[0] as number }; } @@ -605,30 +605,30 @@ export class Health { /** * Get the number of function executions that are waiting to be processed in the Appwrite internal queue server. * - * @param {number | bigint} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} */ - getQueueFunctions(params?: { threshold?: number | bigint }): Promise; + getQueueFunctions(params?: { threshold?: number }): Promise; /** * Get the number of function executions that are waiting to be processed in the Appwrite internal queue server. * - * @param {number | bigint} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getQueueFunctions(threshold?: number | bigint): Promise; + getQueueFunctions(threshold?: number): Promise; getQueueFunctions( - paramsOrFirst?: { threshold?: number | bigint } | number | bigint + paramsOrFirst?: { threshold?: number } | number ): Promise { - let params: { threshold?: number | bigint }; + let params: { threshold?: number }; if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { threshold?: number | bigint }; + params = (paramsOrFirst || {}) as { threshold?: number }; } else { params = { - threshold: paramsOrFirst as number | bigint + threshold: paramsOrFirst as number }; } @@ -656,30 +656,30 @@ export class Health { /** * Get the number of logs that are waiting to be processed in the Appwrite internal queue server. * - * @param {number | bigint} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} */ - getQueueLogs(params?: { threshold?: number | bigint }): Promise; + getQueueLogs(params?: { threshold?: number }): Promise; /** * Get the number of logs that are waiting to be processed in the Appwrite internal queue server. * - * @param {number | bigint} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getQueueLogs(threshold?: number | bigint): Promise; + getQueueLogs(threshold?: number): Promise; getQueueLogs( - paramsOrFirst?: { threshold?: number | bigint } | number | bigint + paramsOrFirst?: { threshold?: number } | number ): Promise { - let params: { threshold?: number | bigint }; + let params: { threshold?: number }; if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { threshold?: number | bigint }; + params = (paramsOrFirst || {}) as { threshold?: number }; } else { params = { - threshold: paramsOrFirst as number | bigint + threshold: paramsOrFirst as number }; } @@ -707,30 +707,30 @@ export class Health { /** * Get the number of mails that are waiting to be processed in the Appwrite internal queue server. * - * @param {number | bigint} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} */ - getQueueMails(params?: { threshold?: number | bigint }): Promise; + getQueueMails(params?: { threshold?: number }): Promise; /** * Get the number of mails that are waiting to be processed in the Appwrite internal queue server. * - * @param {number | bigint} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getQueueMails(threshold?: number | bigint): Promise; + getQueueMails(threshold?: number): Promise; getQueueMails( - paramsOrFirst?: { threshold?: number | bigint } | number | bigint + paramsOrFirst?: { threshold?: number } | number ): Promise { - let params: { threshold?: number | bigint }; + let params: { threshold?: number }; if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { threshold?: number | bigint }; + params = (paramsOrFirst || {}) as { threshold?: number }; } else { params = { - threshold: paramsOrFirst as number | bigint + threshold: paramsOrFirst as number }; } @@ -758,30 +758,30 @@ export class Health { /** * Get the number of messages that are waiting to be processed in the Appwrite internal queue server. * - * @param {number | bigint} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} */ - getQueueMessaging(params?: { threshold?: number | bigint }): Promise; + getQueueMessaging(params?: { threshold?: number }): Promise; /** * Get the number of messages that are waiting to be processed in the Appwrite internal queue server. * - * @param {number | bigint} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getQueueMessaging(threshold?: number | bigint): Promise; + getQueueMessaging(threshold?: number): Promise; getQueueMessaging( - paramsOrFirst?: { threshold?: number | bigint } | number | bigint + paramsOrFirst?: { threshold?: number } | number ): Promise { - let params: { threshold?: number | bigint }; + let params: { threshold?: number }; if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { threshold?: number | bigint }; + params = (paramsOrFirst || {}) as { threshold?: number }; } else { params = { - threshold: paramsOrFirst as number | bigint + threshold: paramsOrFirst as number }; } @@ -809,30 +809,30 @@ export class Health { /** * Get the number of migrations that are waiting to be processed in the Appwrite internal queue server. * - * @param {number | bigint} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} */ - getQueueMigrations(params?: { threshold?: number | bigint }): Promise; + getQueueMigrations(params?: { threshold?: number }): Promise; /** * Get the number of migrations that are waiting to be processed in the Appwrite internal queue server. * - * @param {number | bigint} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getQueueMigrations(threshold?: number | bigint): Promise; + getQueueMigrations(threshold?: number): Promise; getQueueMigrations( - paramsOrFirst?: { threshold?: number | bigint } | number | bigint + paramsOrFirst?: { threshold?: number } | number ): Promise { - let params: { threshold?: number | bigint }; + let params: { threshold?: number }; if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { threshold?: number | bigint }; + params = (paramsOrFirst || {}) as { threshold?: number }; } else { params = { - threshold: paramsOrFirst as number | bigint + threshold: paramsOrFirst as number }; } @@ -860,30 +860,30 @@ export class Health { /** * Get region manager queue. * - * @param {number | bigint} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 100. + * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 100. * @throws {AppwriteException} * @returns {Promise} */ - getQueueRegionManager(params?: { threshold?: number | bigint }): Promise; + getQueueRegionManager(params?: { threshold?: number }): Promise; /** * Get region manager queue. * - * @param {number | bigint} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 100. + * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 100. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getQueueRegionManager(threshold?: number | bigint): Promise; + getQueueRegionManager(threshold?: number): Promise; getQueueRegionManager( - paramsOrFirst?: { threshold?: number | bigint } | number | bigint + paramsOrFirst?: { threshold?: number } | number ): Promise { - let params: { threshold?: number | bigint }; + let params: { threshold?: number }; if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { threshold?: number | bigint }; + params = (paramsOrFirst || {}) as { threshold?: number }; } else { params = { - threshold: paramsOrFirst as number | bigint + threshold: paramsOrFirst as number }; } @@ -911,30 +911,30 @@ export class Health { /** * Get the number of metrics that are waiting to be processed in the Appwrite stats resources queue. * - * @param {number | bigint} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} */ - getQueueStatsResources(params?: { threshold?: number | bigint }): Promise; + getQueueStatsResources(params?: { threshold?: number }): Promise; /** * Get the number of metrics that are waiting to be processed in the Appwrite stats resources queue. * - * @param {number | bigint} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getQueueStatsResources(threshold?: number | bigint): Promise; + getQueueStatsResources(threshold?: number): Promise; getQueueStatsResources( - paramsOrFirst?: { threshold?: number | bigint } | number | bigint + paramsOrFirst?: { threshold?: number } | number ): Promise { - let params: { threshold?: number | bigint }; + let params: { threshold?: number }; if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { threshold?: number | bigint }; + params = (paramsOrFirst || {}) as { threshold?: number }; } else { params = { - threshold: paramsOrFirst as number | bigint + threshold: paramsOrFirst as number }; } @@ -962,30 +962,30 @@ export class Health { /** * Get the number of metrics that are waiting to be processed in the Appwrite internal queue server. * - * @param {number | bigint} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} */ - getQueueUsage(params?: { threshold?: number | bigint }): Promise; + getQueueUsage(params?: { threshold?: number }): Promise; /** * Get the number of metrics that are waiting to be processed in the Appwrite internal queue server. * - * @param {number | bigint} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getQueueUsage(threshold?: number | bigint): Promise; + getQueueUsage(threshold?: number): Promise; getQueueUsage( - paramsOrFirst?: { threshold?: number | bigint } | number | bigint + paramsOrFirst?: { threshold?: number } | number ): Promise { - let params: { threshold?: number | bigint }; + let params: { threshold?: number }; if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { threshold?: number | bigint }; + params = (paramsOrFirst || {}) as { threshold?: number }; } else { params = { - threshold: paramsOrFirst as number | bigint + threshold: paramsOrFirst as number }; } @@ -1013,30 +1013,30 @@ export class Health { /** * Get threats queue. * - * @param {number | bigint} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 100. + * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 100. * @throws {AppwriteException} * @returns {Promise} */ - getQueueThreats(params?: { threshold?: number | bigint }): Promise; + getQueueThreats(params?: { threshold?: number }): Promise; /** * Get threats queue. * - * @param {number | bigint} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 100. + * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 100. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getQueueThreats(threshold?: number | bigint): Promise; + getQueueThreats(threshold?: number): Promise; getQueueThreats( - paramsOrFirst?: { threshold?: number | bigint } | number | bigint + paramsOrFirst?: { threshold?: number } | number ): Promise { - let params: { threshold?: number | bigint }; + let params: { threshold?: number }; if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { threshold?: number | bigint }; + params = (paramsOrFirst || {}) as { threshold?: number }; } else { params = { - threshold: paramsOrFirst as number | bigint + threshold: paramsOrFirst as number }; } @@ -1064,30 +1064,30 @@ export class Health { /** * Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server. * - * @param {number | bigint} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} */ - getQueueWebhooks(params?: { threshold?: number | bigint }): Promise; + getQueueWebhooks(params?: { threshold?: number }): Promise; /** * Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server. * - * @param {number | bigint} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getQueueWebhooks(threshold?: number | bigint): Promise; + getQueueWebhooks(threshold?: number): Promise; getQueueWebhooks( - paramsOrFirst?: { threshold?: number | bigint } | number | bigint + paramsOrFirst?: { threshold?: number } | number ): Promise { - let params: { threshold?: number | bigint }; + let params: { threshold?: number }; if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { threshold?: number | bigint }; + params = (paramsOrFirst || {}) as { threshold?: number }; } else { params = { - threshold: paramsOrFirst as number | bigint + threshold: paramsOrFirst as number }; } diff --git a/src/services/messaging.ts b/src/services/messaging.ts index 3ba181b..c2cd63c 100644 --- a/src/services/messaging.ts +++ b/src/services/messaging.ts @@ -364,7 +364,7 @@ export class Messaging { * @param {string} params.sound - Sound for push notification. Available only for Android and iOS Platform. * @param {string} params.color - Color for push notification. Available only for Android Platform. * @param {string} params.tag - Tag for push notification. Available only for Android Platform. - * @param {number | bigint} params.badge - Badge for push notification. Available only for iOS Platform. + * @param {number} params.badge - Badge for push notification. Available only for iOS Platform. * @param {boolean} params.draft - Is message a draft * @param {string} params.scheduledAt - Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future. * @param {boolean} params.contentAvailable - If set to true, the notification will be delivered in the background. Available only for iOS Platform. @@ -373,7 +373,7 @@ export class Messaging { * @throws {AppwriteException} * @returns {Promise} */ - createPush(params: { messageId: string, title?: string, body?: string, topics?: string[], users?: string[], targets?: string[], data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number | bigint, draft?: boolean, scheduledAt?: string, contentAvailable?: boolean, critical?: boolean, priority?: MessagePriority }): Promise; + createPush(params: { messageId: string, title?: string, body?: string, topics?: string[], users?: string[], targets?: string[], data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number, draft?: boolean, scheduledAt?: string, contentAvailable?: boolean, critical?: boolean, priority?: MessagePriority }): Promise; /** * Create a new push notification. * @@ -390,7 +390,7 @@ export class Messaging { * @param {string} sound - Sound for push notification. Available only for Android and iOS Platform. * @param {string} color - Color for push notification. Available only for Android Platform. * @param {string} tag - Tag for push notification. Available only for Android Platform. - * @param {number | bigint} badge - Badge for push notification. Available only for iOS Platform. + * @param {number} badge - Badge for push notification. Available only for iOS Platform. * @param {boolean} draft - Is message a draft * @param {string} scheduledAt - Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future. * @param {boolean} contentAvailable - If set to true, the notification will be delivered in the background. Available only for iOS Platform. @@ -400,15 +400,15 @@ export class Messaging { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createPush(messageId: string, title?: string, body?: string, topics?: string[], users?: string[], targets?: string[], data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number | bigint, draft?: boolean, scheduledAt?: string, contentAvailable?: boolean, critical?: boolean, priority?: MessagePriority): Promise; + createPush(messageId: string, title?: string, body?: string, topics?: string[], users?: string[], targets?: string[], data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number, draft?: boolean, scheduledAt?: string, contentAvailable?: boolean, critical?: boolean, priority?: MessagePriority): Promise; createPush( - paramsOrFirst: { messageId: string, title?: string, body?: string, topics?: string[], users?: string[], targets?: string[], data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number | bigint, draft?: boolean, scheduledAt?: string, contentAvailable?: boolean, critical?: boolean, priority?: MessagePriority } | string, - ...rest: [(string)?, (string)?, (string[])?, (string[])?, (string[])?, (object)?, (string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (number | bigint)?, (boolean)?, (string)?, (boolean)?, (boolean)?, (MessagePriority)?] + paramsOrFirst: { messageId: string, title?: string, body?: string, topics?: string[], users?: string[], targets?: string[], data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number, draft?: boolean, scheduledAt?: string, contentAvailable?: boolean, critical?: boolean, priority?: MessagePriority } | string, + ...rest: [(string)?, (string)?, (string[])?, (string[])?, (string[])?, (object)?, (string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (number)?, (boolean)?, (string)?, (boolean)?, (boolean)?, (MessagePriority)?] ): Promise { - let params: { messageId: string, title?: string, body?: string, topics?: string[], users?: string[], targets?: string[], data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number | bigint, draft?: boolean, scheduledAt?: string, contentAvailable?: boolean, critical?: boolean, priority?: MessagePriority }; + let params: { messageId: string, title?: string, body?: string, topics?: string[], users?: string[], targets?: string[], data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number, draft?: boolean, scheduledAt?: string, contentAvailable?: boolean, critical?: boolean, priority?: MessagePriority }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { messageId: string, title?: string, body?: string, topics?: string[], users?: string[], targets?: string[], data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number | bigint, draft?: boolean, scheduledAt?: string, contentAvailable?: boolean, critical?: boolean, priority?: MessagePriority }; + params = (paramsOrFirst || {}) as { messageId: string, title?: string, body?: string, topics?: string[], users?: string[], targets?: string[], data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number, draft?: boolean, scheduledAt?: string, contentAvailable?: boolean, critical?: boolean, priority?: MessagePriority }; } else { params = { messageId: paramsOrFirst as string, @@ -424,7 +424,7 @@ export class Messaging { sound: rest[9] as string, color: rest[10] as string, tag: rest[11] as string, - badge: rest[12] as number | bigint, + badge: rest[12] as number, draft: rest[13] as boolean, scheduledAt: rest[14] as string, contentAvailable: rest[15] as boolean, @@ -547,7 +547,7 @@ export class Messaging { * @param {string} params.sound - Sound for push notification. Available only for Android and iOS platforms. * @param {string} params.color - Color for push notification. Available only for Android platforms. * @param {string} params.tag - Tag for push notification. Available only for Android platforms. - * @param {number | bigint} params.badge - Badge for push notification. Available only for iOS platforms. + * @param {number} params.badge - Badge for push notification. Available only for iOS platforms. * @param {boolean} params.draft - Is message a draft * @param {string} params.scheduledAt - Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future. * @param {boolean} params.contentAvailable - If set to true, the notification will be delivered in the background. Available only for iOS Platform. @@ -556,7 +556,7 @@ export class Messaging { * @throws {AppwriteException} * @returns {Promise} */ - updatePush(params: { messageId: string, topics?: string[], users?: string[], targets?: string[], title?: string, body?: string, data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number | bigint, draft?: boolean, scheduledAt?: string, contentAvailable?: boolean, critical?: boolean, priority?: MessagePriority }): Promise; + updatePush(params: { messageId: string, topics?: string[], users?: string[], targets?: string[], title?: string, body?: string, data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number, draft?: boolean, scheduledAt?: string, contentAvailable?: boolean, critical?: boolean, priority?: MessagePriority }): Promise; /** * Update a push notification by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated. * @@ -574,7 +574,7 @@ export class Messaging { * @param {string} sound - Sound for push notification. Available only for Android and iOS platforms. * @param {string} color - Color for push notification. Available only for Android platforms. * @param {string} tag - Tag for push notification. Available only for Android platforms. - * @param {number | bigint} badge - Badge for push notification. Available only for iOS platforms. + * @param {number} badge - Badge for push notification. Available only for iOS platforms. * @param {boolean} draft - Is message a draft * @param {string} scheduledAt - Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future. * @param {boolean} contentAvailable - If set to true, the notification will be delivered in the background. Available only for iOS Platform. @@ -584,15 +584,15 @@ export class Messaging { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updatePush(messageId: string, topics?: string[], users?: string[], targets?: string[], title?: string, body?: string, data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number | bigint, draft?: boolean, scheduledAt?: string, contentAvailable?: boolean, critical?: boolean, priority?: MessagePriority): Promise; + updatePush(messageId: string, topics?: string[], users?: string[], targets?: string[], title?: string, body?: string, data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number, draft?: boolean, scheduledAt?: string, contentAvailable?: boolean, critical?: boolean, priority?: MessagePriority): Promise; updatePush( - paramsOrFirst: { messageId: string, topics?: string[], users?: string[], targets?: string[], title?: string, body?: string, data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number | bigint, draft?: boolean, scheduledAt?: string, contentAvailable?: boolean, critical?: boolean, priority?: MessagePriority } | string, - ...rest: [(string[])?, (string[])?, (string[])?, (string)?, (string)?, (object)?, (string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (number | bigint)?, (boolean)?, (string)?, (boolean)?, (boolean)?, (MessagePriority)?] + paramsOrFirst: { messageId: string, topics?: string[], users?: string[], targets?: string[], title?: string, body?: string, data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number, draft?: boolean, scheduledAt?: string, contentAvailable?: boolean, critical?: boolean, priority?: MessagePriority } | string, + ...rest: [(string[])?, (string[])?, (string[])?, (string)?, (string)?, (object)?, (string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (number)?, (boolean)?, (string)?, (boolean)?, (boolean)?, (MessagePriority)?] ): Promise { - let params: { messageId: string, topics?: string[], users?: string[], targets?: string[], title?: string, body?: string, data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number | bigint, draft?: boolean, scheduledAt?: string, contentAvailable?: boolean, critical?: boolean, priority?: MessagePriority }; + let params: { messageId: string, topics?: string[], users?: string[], targets?: string[], title?: string, body?: string, data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number, draft?: boolean, scheduledAt?: string, contentAvailable?: boolean, critical?: boolean, priority?: MessagePriority }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { messageId: string, topics?: string[], users?: string[], targets?: string[], title?: string, body?: string, data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number | bigint, draft?: boolean, scheduledAt?: string, contentAvailable?: boolean, critical?: boolean, priority?: MessagePriority }; + params = (paramsOrFirst || {}) as { messageId: string, topics?: string[], users?: string[], targets?: string[], title?: string, body?: string, data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number, draft?: boolean, scheduledAt?: string, contentAvailable?: boolean, critical?: boolean, priority?: MessagePriority }; } else { params = { messageId: paramsOrFirst as string, @@ -608,7 +608,7 @@ export class Messaging { sound: rest[9] as string, color: rest[10] as string, tag: rest[11] as string, - badge: rest[12] as number | bigint, + badge: rest[12] as number, draft: rest[13] as boolean, scheduledAt: rest[14] as string, contentAvailable: rest[15] as boolean, @@ -2990,7 +2990,7 @@ export class Messaging { * @param {string} params.providerId - Provider 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. * @param {string} params.name - Provider name. * @param {string} params.host - SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls://smtp1.example.com:587;ssl://smtp2.example.com:465"`. Hosts will be tried in order. - * @param {number | bigint} params.port - The default SMTP server port. + * @param {number} params.port - The default SMTP server port. * @param {string} params.username - Authentication username. * @param {string} params.password - Authentication password. * @param {SmtpEncryption} params.encryption - Encryption type. Can be omitted, 'ssl', or 'tls' @@ -3005,14 +3005,14 @@ export class Messaging { * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `Messaging.createSMTPProvider` instead. */ - createSmtpProvider(params: { providerId: string, name: string, host: string, port?: number | bigint, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }): Promise; + createSmtpProvider(params: { providerId: string, name: string, host: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }): Promise; /** * Create a new SMTP provider. * * @param {string} providerId - Provider 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. * @param {string} name - Provider name. * @param {string} host - SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls://smtp1.example.com:587;ssl://smtp2.example.com:465"`. Hosts will be tried in order. - * @param {number | bigint} port - The default SMTP server port. + * @param {number} port - The default SMTP server port. * @param {string} username - Authentication username. * @param {string} password - Authentication password. * @param {SmtpEncryption} encryption - Encryption type. Can be omitted, 'ssl', or 'tls' @@ -3027,21 +3027,21 @@ export class Messaging { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createSmtpProvider(providerId: string, name: string, host: string, port?: number | bigint, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean): Promise; + createSmtpProvider(providerId: string, name: string, host: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean): Promise; createSmtpProvider( - paramsOrFirst: { providerId: string, name: string, host: string, port?: number | bigint, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean } | string, - ...rest: [(string)?, (string)?, (number | bigint)?, (string)?, (string)?, (SmtpEncryption)?, (boolean)?, (string)?, (string)?, (string)?, (string)?, (string)?, (boolean)?] + paramsOrFirst: { providerId: string, name: string, host: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean } | string, + ...rest: [(string)?, (string)?, (number)?, (string)?, (string)?, (SmtpEncryption)?, (boolean)?, (string)?, (string)?, (string)?, (string)?, (string)?, (boolean)?] ): Promise { - let params: { providerId: string, name: string, host: string, port?: number | bigint, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }; + let params: { providerId: string, name: string, host: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { providerId: string, name: string, host: string, port?: number | bigint, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }; + params = (paramsOrFirst || {}) as { providerId: string, name: string, host: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }; } else { params = { providerId: paramsOrFirst as string, name: rest[0] as string, host: rest[1] as string, - port: rest[2] as number | bigint, + port: rest[2] as number, username: rest[3] as string, password: rest[4] as string, encryption: rest[5] as SmtpEncryption, @@ -3144,7 +3144,7 @@ export class Messaging { * @param {string} params.providerId - Provider 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. * @param {string} params.name - Provider name. * @param {string} params.host - SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls://smtp1.example.com:587;ssl://smtp2.example.com:465"`. Hosts will be tried in order. - * @param {number | bigint} params.port - The default SMTP server port. + * @param {number} params.port - The default SMTP server port. * @param {string} params.username - Authentication username. * @param {string} params.password - Authentication password. * @param {SmtpEncryption} params.encryption - Encryption type. Can be omitted, 'ssl', or 'tls' @@ -3158,14 +3158,14 @@ export class Messaging { * @throws {AppwriteException} * @returns {Promise} */ - createSMTPProvider(params: { providerId: string, name: string, host: string, port?: number | bigint, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }): Promise; + createSMTPProvider(params: { providerId: string, name: string, host: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }): Promise; /** * Create a new SMTP provider. * * @param {string} providerId - Provider 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. * @param {string} name - Provider name. * @param {string} host - SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls://smtp1.example.com:587;ssl://smtp2.example.com:465"`. Hosts will be tried in order. - * @param {number | bigint} port - The default SMTP server port. + * @param {number} port - The default SMTP server port. * @param {string} username - Authentication username. * @param {string} password - Authentication password. * @param {SmtpEncryption} encryption - Encryption type. Can be omitted, 'ssl', or 'tls' @@ -3180,21 +3180,21 @@ export class Messaging { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createSMTPProvider(providerId: string, name: string, host: string, port?: number | bigint, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean): Promise; + createSMTPProvider(providerId: string, name: string, host: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean): Promise; createSMTPProvider( - paramsOrFirst: { providerId: string, name: string, host: string, port?: number | bigint, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean } | string, - ...rest: [(string)?, (string)?, (number | bigint)?, (string)?, (string)?, (SmtpEncryption)?, (boolean)?, (string)?, (string)?, (string)?, (string)?, (string)?, (boolean)?] + paramsOrFirst: { providerId: string, name: string, host: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean } | string, + ...rest: [(string)?, (string)?, (number)?, (string)?, (string)?, (SmtpEncryption)?, (boolean)?, (string)?, (string)?, (string)?, (string)?, (string)?, (boolean)?] ): Promise { - let params: { providerId: string, name: string, host: string, port?: number | bigint, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }; + let params: { providerId: string, name: string, host: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { providerId: string, name: string, host: string, port?: number | bigint, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }; + params = (paramsOrFirst || {}) as { providerId: string, name: string, host: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }; } else { params = { providerId: paramsOrFirst as string, name: rest[0] as string, host: rest[1] as string, - port: rest[2] as number | bigint, + port: rest[2] as number, username: rest[3] as string, password: rest[4] as string, encryption: rest[5] as SmtpEncryption, @@ -3297,7 +3297,7 @@ export class Messaging { * @param {string} params.providerId - Provider ID. * @param {string} params.name - Provider name. * @param {string} params.host - SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls://smtp1.example.com:587;ssl://smtp2.example.com:465"`. Hosts will be tried in order. - * @param {number | bigint} params.port - SMTP port. + * @param {number} params.port - SMTP port. * @param {string} params.username - Authentication username. * @param {string} params.password - Authentication password. * @param {SmtpEncryption} params.encryption - Encryption type. Can be 'ssl' or 'tls' @@ -3312,14 +3312,14 @@ export class Messaging { * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `Messaging.updateSMTPProvider` instead. */ - updateSmtpProvider(params: { providerId: string, name?: string, host?: string, port?: number | bigint, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }): Promise; + updateSmtpProvider(params: { providerId: string, name?: string, host?: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }): Promise; /** * Update a SMTP provider by its unique ID. * * @param {string} providerId - Provider ID. * @param {string} name - Provider name. * @param {string} host - SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls://smtp1.example.com:587;ssl://smtp2.example.com:465"`. Hosts will be tried in order. - * @param {number | bigint} port - SMTP port. + * @param {number} port - SMTP port. * @param {string} username - Authentication username. * @param {string} password - Authentication password. * @param {SmtpEncryption} encryption - Encryption type. Can be 'ssl' or 'tls' @@ -3334,21 +3334,21 @@ export class Messaging { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateSmtpProvider(providerId: string, name?: string, host?: string, port?: number | bigint, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean): Promise; + updateSmtpProvider(providerId: string, name?: string, host?: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean): Promise; updateSmtpProvider( - paramsOrFirst: { providerId: string, name?: string, host?: string, port?: number | bigint, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean } | string, - ...rest: [(string)?, (string)?, (number | bigint)?, (string)?, (string)?, (SmtpEncryption)?, (boolean)?, (string)?, (string)?, (string)?, (string)?, (string)?, (boolean)?] + paramsOrFirst: { providerId: string, name?: string, host?: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean } | string, + ...rest: [(string)?, (string)?, (number)?, (string)?, (string)?, (SmtpEncryption)?, (boolean)?, (string)?, (string)?, (string)?, (string)?, (string)?, (boolean)?] ): Promise { - let params: { providerId: string, name?: string, host?: string, port?: number | bigint, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }; + let params: { providerId: string, name?: string, host?: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { providerId: string, name?: string, host?: string, port?: number | bigint, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }; + params = (paramsOrFirst || {}) as { providerId: string, name?: string, host?: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }; } else { params = { providerId: paramsOrFirst as string, name: rest[0] as string, host: rest[1] as string, - port: rest[2] as number | bigint, + port: rest[2] as number, username: rest[3] as string, password: rest[4] as string, encryption: rest[5] as SmtpEncryption, @@ -3442,7 +3442,7 @@ export class Messaging { * @param {string} params.providerId - Provider ID. * @param {string} params.name - Provider name. * @param {string} params.host - SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls://smtp1.example.com:587;ssl://smtp2.example.com:465"`. Hosts will be tried in order. - * @param {number | bigint} params.port - SMTP port. + * @param {number} params.port - SMTP port. * @param {string} params.username - Authentication username. * @param {string} params.password - Authentication password. * @param {SmtpEncryption} params.encryption - Encryption type. Can be 'ssl' or 'tls' @@ -3456,14 +3456,14 @@ export class Messaging { * @throws {AppwriteException} * @returns {Promise} */ - updateSMTPProvider(params: { providerId: string, name?: string, host?: string, port?: number | bigint, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }): Promise; + updateSMTPProvider(params: { providerId: string, name?: string, host?: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }): Promise; /** * Update a SMTP provider by its unique ID. * * @param {string} providerId - Provider ID. * @param {string} name - Provider name. * @param {string} host - SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls://smtp1.example.com:587;ssl://smtp2.example.com:465"`. Hosts will be tried in order. - * @param {number | bigint} port - SMTP port. + * @param {number} port - SMTP port. * @param {string} username - Authentication username. * @param {string} password - Authentication password. * @param {SmtpEncryption} encryption - Encryption type. Can be 'ssl' or 'tls' @@ -3478,21 +3478,21 @@ export class Messaging { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateSMTPProvider(providerId: string, name?: string, host?: string, port?: number | bigint, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean): Promise; + updateSMTPProvider(providerId: string, name?: string, host?: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean): Promise; updateSMTPProvider( - paramsOrFirst: { providerId: string, name?: string, host?: string, port?: number | bigint, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean } | string, - ...rest: [(string)?, (string)?, (number | bigint)?, (string)?, (string)?, (SmtpEncryption)?, (boolean)?, (string)?, (string)?, (string)?, (string)?, (string)?, (boolean)?] + paramsOrFirst: { providerId: string, name?: string, host?: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean } | string, + ...rest: [(string)?, (string)?, (number)?, (string)?, (string)?, (SmtpEncryption)?, (boolean)?, (string)?, (string)?, (string)?, (string)?, (string)?, (boolean)?] ): Promise { - let params: { providerId: string, name?: string, host?: string, port?: number | bigint, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }; + let params: { providerId: string, name?: string, host?: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { providerId: string, name?: string, host?: string, port?: number | bigint, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }; + params = (paramsOrFirst || {}) as { providerId: string, name?: string, host?: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }; } else { params = { providerId: paramsOrFirst as string, name: rest[0] as string, host: rest[1] as string, - port: rest[2] as number | bigint, + port: rest[2] as number, username: rest[3] as string, password: rest[4] as string, encryption: rest[5] as SmtpEncryption, diff --git a/src/services/sites.ts b/src/services/sites.ts index 5e363ac..3afc7e3 100644 --- a/src/services/sites.ts +++ b/src/services/sites.ts @@ -90,7 +90,7 @@ export class Sites { * @param {BuildRuntime} params.buildRuntime - Runtime to use during build step. * @param {boolean} params.enabled - Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled. * @param {boolean} params.logging - When disabled, request logs will exclude logs and errors, and site responses will be slightly faster. - * @param {number | bigint} params.timeout - Maximum request time in seconds. + * @param {number} params.timeout - Maximum request time in seconds. * @param {string} params.installCommand - Install Command. * @param {string} params.buildCommand - Build Command. * @param {string} params.outputDirectory - Output Directory for site. @@ -105,7 +105,7 @@ export class Sites { * @throws {AppwriteException} * @returns {Promise} */ - create(params: { siteId: string, name: string, framework: Framework, buildRuntime: BuildRuntime, enabled?: boolean, logging?: boolean, timeout?: number | bigint, installCommand?: string, buildCommand?: string, outputDirectory?: string, adapter?: Adapter, installationId?: string, fallbackFile?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string }): Promise; + create(params: { siteId: string, name: string, framework: Framework, buildRuntime: BuildRuntime, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, outputDirectory?: string, adapter?: Adapter, installationId?: string, fallbackFile?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string }): Promise; /** * Create a new site. * @@ -115,7 +115,7 @@ export class Sites { * @param {BuildRuntime} buildRuntime - Runtime to use during build step. * @param {boolean} enabled - Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled. * @param {boolean} logging - When disabled, request logs will exclude logs and errors, and site responses will be slightly faster. - * @param {number | bigint} timeout - Maximum request time in seconds. + * @param {number} timeout - Maximum request time in seconds. * @param {string} installCommand - Install Command. * @param {string} buildCommand - Build Command. * @param {string} outputDirectory - Output Directory for site. @@ -131,15 +131,15 @@ export class Sites { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - create(siteId: string, name: string, framework: Framework, buildRuntime: BuildRuntime, enabled?: boolean, logging?: boolean, timeout?: number | bigint, installCommand?: string, buildCommand?: string, outputDirectory?: string, adapter?: Adapter, installationId?: string, fallbackFile?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string): Promise; + create(siteId: string, name: string, framework: Framework, buildRuntime: BuildRuntime, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, outputDirectory?: string, adapter?: Adapter, installationId?: string, fallbackFile?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string): Promise; create( - paramsOrFirst: { siteId: string, name: string, framework: Framework, buildRuntime: BuildRuntime, enabled?: boolean, logging?: boolean, timeout?: number | bigint, installCommand?: string, buildCommand?: string, outputDirectory?: string, adapter?: Adapter, installationId?: string, fallbackFile?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string } | string, - ...rest: [(string)?, (Framework)?, (BuildRuntime)?, (boolean)?, (boolean)?, (number | bigint)?, (string)?, (string)?, (string)?, (Adapter)?, (string)?, (string)?, (string)?, (string)?, (boolean)?, (string)?, (string)?] + paramsOrFirst: { siteId: string, name: string, framework: Framework, buildRuntime: BuildRuntime, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, outputDirectory?: string, adapter?: Adapter, installationId?: string, fallbackFile?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string } | string, + ...rest: [(string)?, (Framework)?, (BuildRuntime)?, (boolean)?, (boolean)?, (number)?, (string)?, (string)?, (string)?, (Adapter)?, (string)?, (string)?, (string)?, (string)?, (boolean)?, (string)?, (string)?] ): Promise { - let params: { siteId: string, name: string, framework: Framework, buildRuntime: BuildRuntime, enabled?: boolean, logging?: boolean, timeout?: number | bigint, installCommand?: string, buildCommand?: string, outputDirectory?: string, adapter?: Adapter, installationId?: string, fallbackFile?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string }; + let params: { siteId: string, name: string, framework: Framework, buildRuntime: BuildRuntime, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, outputDirectory?: string, adapter?: Adapter, installationId?: string, fallbackFile?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { siteId: string, name: string, framework: Framework, buildRuntime: BuildRuntime, enabled?: boolean, logging?: boolean, timeout?: number | bigint, installCommand?: string, buildCommand?: string, outputDirectory?: string, adapter?: Adapter, installationId?: string, fallbackFile?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string }; + params = (paramsOrFirst || {}) as { siteId: string, name: string, framework: Framework, buildRuntime: BuildRuntime, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, outputDirectory?: string, adapter?: Adapter, installationId?: string, fallbackFile?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string }; } else { params = { siteId: paramsOrFirst as string, @@ -148,7 +148,7 @@ export class Sites { buildRuntime: rest[2] as BuildRuntime, enabled: rest[3] as boolean, logging: rest[4] as boolean, - timeout: rest[5] as number | bigint, + timeout: rest[5] as number, installCommand: rest[6] as string, buildCommand: rest[7] as string, outputDirectory: rest[8] as string, @@ -370,7 +370,7 @@ export class Sites { * @param {Framework} params.framework - Sites framework. * @param {boolean} params.enabled - Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled. * @param {boolean} params.logging - When disabled, request logs will exclude logs and errors, and site responses will be slightly faster. - * @param {number | bigint} params.timeout - Maximum request time in seconds. + * @param {number} params.timeout - Maximum request time in seconds. * @param {string} params.installCommand - Install Command. * @param {string} params.buildCommand - Build Command. * @param {string} params.outputDirectory - Output Directory for site. @@ -386,7 +386,7 @@ export class Sites { * @throws {AppwriteException} * @returns {Promise} */ - update(params: { siteId: string, name: string, framework: Framework, enabled?: boolean, logging?: boolean, timeout?: number | bigint, installCommand?: string, buildCommand?: string, outputDirectory?: string, buildRuntime?: BuildRuntime, adapter?: Adapter, fallbackFile?: string, installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string }): Promise; + update(params: { siteId: string, name: string, framework: Framework, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, outputDirectory?: string, buildRuntime?: BuildRuntime, adapter?: Adapter, fallbackFile?: string, installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string }): Promise; /** * Update site by its unique ID. * @@ -395,7 +395,7 @@ export class Sites { * @param {Framework} framework - Sites framework. * @param {boolean} enabled - Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled. * @param {boolean} logging - When disabled, request logs will exclude logs and errors, and site responses will be slightly faster. - * @param {number | bigint} timeout - Maximum request time in seconds. + * @param {number} timeout - Maximum request time in seconds. * @param {string} installCommand - Install Command. * @param {string} buildCommand - Build Command. * @param {string} outputDirectory - Output Directory for site. @@ -412,15 +412,15 @@ export class Sites { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - update(siteId: string, name: string, framework: Framework, enabled?: boolean, logging?: boolean, timeout?: number | bigint, installCommand?: string, buildCommand?: string, outputDirectory?: string, buildRuntime?: BuildRuntime, adapter?: Adapter, fallbackFile?: string, installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string): Promise; + update(siteId: string, name: string, framework: Framework, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, outputDirectory?: string, buildRuntime?: BuildRuntime, adapter?: Adapter, fallbackFile?: string, installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string): Promise; update( - paramsOrFirst: { siteId: string, name: string, framework: Framework, enabled?: boolean, logging?: boolean, timeout?: number | bigint, installCommand?: string, buildCommand?: string, outputDirectory?: string, buildRuntime?: BuildRuntime, adapter?: Adapter, fallbackFile?: string, installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string } | string, - ...rest: [(string)?, (Framework)?, (boolean)?, (boolean)?, (number | bigint)?, (string)?, (string)?, (string)?, (BuildRuntime)?, (Adapter)?, (string)?, (string)?, (string)?, (string)?, (boolean)?, (string)?, (string)?] + paramsOrFirst: { siteId: string, name: string, framework: Framework, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, outputDirectory?: string, buildRuntime?: BuildRuntime, adapter?: Adapter, fallbackFile?: string, installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string } | string, + ...rest: [(string)?, (Framework)?, (boolean)?, (boolean)?, (number)?, (string)?, (string)?, (string)?, (BuildRuntime)?, (Adapter)?, (string)?, (string)?, (string)?, (string)?, (boolean)?, (string)?, (string)?] ): Promise { - let params: { siteId: string, name: string, framework: Framework, enabled?: boolean, logging?: boolean, timeout?: number | bigint, installCommand?: string, buildCommand?: string, outputDirectory?: string, buildRuntime?: BuildRuntime, adapter?: Adapter, fallbackFile?: string, installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string }; + let params: { siteId: string, name: string, framework: Framework, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, outputDirectory?: string, buildRuntime?: BuildRuntime, adapter?: Adapter, fallbackFile?: string, installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { siteId: string, name: string, framework: Framework, enabled?: boolean, logging?: boolean, timeout?: number | bigint, installCommand?: string, buildCommand?: string, outputDirectory?: string, buildRuntime?: BuildRuntime, adapter?: Adapter, fallbackFile?: string, installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string }; + params = (paramsOrFirst || {}) as { siteId: string, name: string, framework: Framework, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, outputDirectory?: string, buildRuntime?: BuildRuntime, adapter?: Adapter, fallbackFile?: string, installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string }; } else { params = { siteId: paramsOrFirst as string, @@ -428,7 +428,7 @@ export class Sites { framework: rest[1] as Framework, enabled: rest[2] as boolean, logging: rest[3] as boolean, - timeout: rest[4] as number | bigint, + timeout: rest[4] as number, installCommand: rest[5] as string, buildCommand: rest[6] as string, outputDirectory: rest[7] as string, diff --git a/src/services/storage.ts b/src/services/storage.ts index 496630d..1537754 100644 --- a/src/services/storage.ts +++ b/src/services/storage.ts @@ -86,7 +86,7 @@ export class Storage { * @param {string[]} params.permissions - An array of permission strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} params.fileSecurity - Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} params.enabled - Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled. - * @param {number | bigint} params.maximumFileSize - Maximum file size allowed in bytes. Maximum allowed value is 5GB. + * @param {number} params.maximumFileSize - Maximum file size allowed in bytes. Maximum allowed value is 5GB. * @param {string[]} params.allowedFileExtensions - Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long. * @param {Compression} params.compression - Compression algorithm chosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled * @param {boolean} params.encryption - Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled @@ -95,7 +95,7 @@ export class Storage { * @throws {AppwriteException} * @returns {Promise} */ - createBucket(params: { bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number | bigint, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean, transformations?: boolean }): Promise; + createBucket(params: { bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean, transformations?: boolean }): Promise; /** * Create a new storage bucket. * @@ -104,7 +104,7 @@ export class Storage { * @param {string[]} permissions - An array of permission strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} fileSecurity - Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} enabled - Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled. - * @param {number | bigint} maximumFileSize - Maximum file size allowed in bytes. Maximum allowed value is 5GB. + * @param {number} maximumFileSize - Maximum file size allowed in bytes. Maximum allowed value is 5GB. * @param {string[]} allowedFileExtensions - Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long. * @param {Compression} compression - Compression algorithm chosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled * @param {boolean} encryption - Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled @@ -114,15 +114,15 @@ export class Storage { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createBucket(bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number | bigint, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean, transformations?: boolean): Promise; + createBucket(bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean, transformations?: boolean): Promise; createBucket( - paramsOrFirst: { bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number | bigint, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean, transformations?: boolean } | string, - ...rest: [(string)?, (string[])?, (boolean)?, (boolean)?, (number | bigint)?, (string[])?, (Compression)?, (boolean)?, (boolean)?, (boolean)?] + paramsOrFirst: { bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean, transformations?: boolean } | string, + ...rest: [(string)?, (string[])?, (boolean)?, (boolean)?, (number)?, (string[])?, (Compression)?, (boolean)?, (boolean)?, (boolean)?] ): Promise { - let params: { bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number | bigint, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean, transformations?: boolean }; + let params: { bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean, transformations?: boolean }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number | bigint, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean, transformations?: boolean }; + params = (paramsOrFirst || {}) as { bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean, transformations?: boolean }; } else { params = { bucketId: paramsOrFirst as string, @@ -130,7 +130,7 @@ export class Storage { permissions: rest[1] as string[], fileSecurity: rest[2] as boolean, enabled: rest[3] as boolean, - maximumFileSize: rest[4] as number | bigint, + maximumFileSize: rest[4] as number, allowedFileExtensions: rest[5] as string[], compression: rest[6] as Compression, encryption: rest[7] as boolean, @@ -266,7 +266,7 @@ export class Storage { * @param {string[]} params.permissions - An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} params.fileSecurity - Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} params.enabled - Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled. - * @param {number | bigint} params.maximumFileSize - Maximum file size allowed in bytes. Maximum allowed value is 5GB. + * @param {number} params.maximumFileSize - Maximum file size allowed in bytes. Maximum allowed value is 5GB. * @param {string[]} params.allowedFileExtensions - Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long. * @param {Compression} params.compression - Compression algorithm chosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled * @param {boolean} params.encryption - Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled @@ -275,7 +275,7 @@ export class Storage { * @throws {AppwriteException} * @returns {Promise} */ - updateBucket(params: { bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number | bigint, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean, transformations?: boolean }): Promise; + updateBucket(params: { bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean, transformations?: boolean }): Promise; /** * Update a storage bucket by its unique ID. * @@ -284,7 +284,7 @@ export class Storage { * @param {string[]} permissions - An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} fileSecurity - Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} enabled - Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled. - * @param {number | bigint} maximumFileSize - Maximum file size allowed in bytes. Maximum allowed value is 5GB. + * @param {number} maximumFileSize - Maximum file size allowed in bytes. Maximum allowed value is 5GB. * @param {string[]} allowedFileExtensions - Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long. * @param {Compression} compression - Compression algorithm chosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled * @param {boolean} encryption - Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled @@ -294,15 +294,15 @@ export class Storage { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateBucket(bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number | bigint, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean, transformations?: boolean): Promise; + updateBucket(bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean, transformations?: boolean): Promise; updateBucket( - paramsOrFirst: { bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number | bigint, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean, transformations?: boolean } | string, - ...rest: [(string)?, (string[])?, (boolean)?, (boolean)?, (number | bigint)?, (string[])?, (Compression)?, (boolean)?, (boolean)?, (boolean)?] + paramsOrFirst: { bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean, transformations?: boolean } | string, + ...rest: [(string)?, (string[])?, (boolean)?, (boolean)?, (number)?, (string[])?, (Compression)?, (boolean)?, (boolean)?, (boolean)?] ): Promise { - let params: { bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number | bigint, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean, transformations?: boolean }; + let params: { bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean, transformations?: boolean }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number | bigint, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean, transformations?: boolean }; + params = (paramsOrFirst || {}) as { bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean, transformations?: boolean }; } else { params = { bucketId: paramsOrFirst as string, @@ -310,7 +310,7 @@ export class Storage { permissions: rest[1] as string[], fileSecurity: rest[2] as boolean, enabled: rest[3] as boolean, - maximumFileSize: rest[4] as number | bigint, + maximumFileSize: rest[4] as number, allowedFileExtensions: rest[5] as string[], compression: rest[6] as Compression, encryption: rest[7] as boolean, @@ -872,36 +872,36 @@ export class Storage { * * @param {string} params.bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). * @param {string} params.fileId - File ID - * @param {number | bigint} params.width - Resize preview image width, Pass an integer between 0 to 4000. - * @param {number | bigint} params.height - Resize preview image height, Pass an integer between 0 to 4000. + * @param {number} params.width - Resize preview image width, Pass an integer between 0 to 4000. + * @param {number} params.height - Resize preview image height, Pass an integer between 0 to 4000. * @param {ImageGravity} params.gravity - Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right - * @param {number | bigint} params.quality - Preview image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. - * @param {number | bigint} params.borderWidth - Preview image border in pixels. Pass an integer between 0 to 100. Defaults to 0. + * @param {number} params.quality - Preview image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. + * @param {number} params.borderWidth - Preview image border in pixels. Pass an integer between 0 to 100. Defaults to 0. * @param {string} params.borderColor - Preview image border color. Use a valid HEX color, no # is needed for prefix. - * @param {number | bigint} params.borderRadius - Preview image border radius in pixels. Pass an integer between 0 to 4000. - * @param {number | bigint} params.opacity - Preview image opacity. Only works with images having an alpha channel (like png). Pass a number between 0 to 1. - * @param {number | bigint} params.rotation - Preview image rotation in degrees. Pass an integer between -360 and 360. + * @param {number} params.borderRadius - Preview image border radius in pixels. Pass an integer between 0 to 4000. + * @param {number} params.opacity - Preview image opacity. Only works with images having an alpha channel (like png). Pass a number between 0 to 1. + * @param {number} params.rotation - Preview image rotation in degrees. Pass an integer between -360 and 360. * @param {string} params.background - Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix. * @param {ImageFormat} params.output - Output format type (jpeg, jpg, png, gif and webp). * @param {string} params.token - File token for accessing this file. * @throws {AppwriteException} * @returns {Promise} */ - getFilePreview(params: { bucketId: string, fileId: string, width?: number | bigint, height?: number | bigint, gravity?: ImageGravity, quality?: number | bigint, borderWidth?: number | bigint, borderColor?: string, borderRadius?: number | bigint, opacity?: number | bigint, rotation?: number | bigint, background?: string, output?: ImageFormat, token?: string }): Promise; + getFilePreview(params: { bucketId: string, fileId: string, width?: number, height?: number, gravity?: ImageGravity, quality?: number, borderWidth?: number, borderColor?: string, borderRadius?: number, opacity?: number, rotation?: number, background?: string, output?: ImageFormat, token?: string }): Promise; /** * Get a file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets, will return the file icon image. You can also pass query string arguments for cutting and resizing your preview image. Preview is supported only for image files smaller than 10MB. * * @param {string} bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). * @param {string} fileId - File ID - * @param {number | bigint} width - Resize preview image width, Pass an integer between 0 to 4000. - * @param {number | bigint} height - Resize preview image height, Pass an integer between 0 to 4000. + * @param {number} width - Resize preview image width, Pass an integer between 0 to 4000. + * @param {number} height - Resize preview image height, Pass an integer between 0 to 4000. * @param {ImageGravity} gravity - Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right - * @param {number | bigint} quality - Preview image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. - * @param {number | bigint} borderWidth - Preview image border in pixels. Pass an integer between 0 to 100. Defaults to 0. + * @param {number} quality - Preview image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. + * @param {number} borderWidth - Preview image border in pixels. Pass an integer between 0 to 100. Defaults to 0. * @param {string} borderColor - Preview image border color. Use a valid HEX color, no # is needed for prefix. - * @param {number | bigint} borderRadius - Preview image border radius in pixels. Pass an integer between 0 to 4000. - * @param {number | bigint} opacity - Preview image opacity. Only works with images having an alpha channel (like png). Pass a number between 0 to 1. - * @param {number | bigint} rotation - Preview image rotation in degrees. Pass an integer between -360 and 360. + * @param {number} borderRadius - Preview image border radius in pixels. Pass an integer between 0 to 4000. + * @param {number} opacity - Preview image opacity. Only works with images having an alpha channel (like png). Pass a number between 0 to 1. + * @param {number} rotation - Preview image rotation in degrees. Pass an integer between -360 and 360. * @param {string} background - Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix. * @param {ImageFormat} output - Output format type (jpeg, jpg, png, gif and webp). * @param {string} token - File token for accessing this file. @@ -909,28 +909,28 @@ export class Storage { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getFilePreview(bucketId: string, fileId: string, width?: number | bigint, height?: number | bigint, gravity?: ImageGravity, quality?: number | bigint, borderWidth?: number | bigint, borderColor?: string, borderRadius?: number | bigint, opacity?: number | bigint, rotation?: number | bigint, background?: string, output?: ImageFormat, token?: string): Promise; + getFilePreview(bucketId: string, fileId: string, width?: number, height?: number, gravity?: ImageGravity, quality?: number, borderWidth?: number, borderColor?: string, borderRadius?: number, opacity?: number, rotation?: number, background?: string, output?: ImageFormat, token?: string): Promise; getFilePreview( - paramsOrFirst: { bucketId: string, fileId: string, width?: number | bigint, height?: number | bigint, gravity?: ImageGravity, quality?: number | bigint, borderWidth?: number | bigint, borderColor?: string, borderRadius?: number | bigint, opacity?: number | bigint, rotation?: number | bigint, background?: string, output?: ImageFormat, token?: string } | string, - ...rest: [(string)?, (number | bigint)?, (number | bigint)?, (ImageGravity)?, (number | bigint)?, (number | bigint)?, (string)?, (number | bigint)?, (number | bigint)?, (number | bigint)?, (string)?, (ImageFormat)?, (string)?] + paramsOrFirst: { bucketId: string, fileId: string, width?: number, height?: number, gravity?: ImageGravity, quality?: number, borderWidth?: number, borderColor?: string, borderRadius?: number, opacity?: number, rotation?: number, background?: string, output?: ImageFormat, token?: string } | string, + ...rest: [(string)?, (number)?, (number)?, (ImageGravity)?, (number)?, (number)?, (string)?, (number)?, (number)?, (number)?, (string)?, (ImageFormat)?, (string)?] ): Promise { - let params: { bucketId: string, fileId: string, width?: number | bigint, height?: number | bigint, gravity?: ImageGravity, quality?: number | bigint, borderWidth?: number | bigint, borderColor?: string, borderRadius?: number | bigint, opacity?: number | bigint, rotation?: number | bigint, background?: string, output?: ImageFormat, token?: string }; + let params: { bucketId: string, fileId: string, width?: number, height?: number, gravity?: ImageGravity, quality?: number, borderWidth?: number, borderColor?: string, borderRadius?: number, opacity?: number, rotation?: number, background?: string, output?: ImageFormat, token?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { bucketId: string, fileId: string, width?: number | bigint, height?: number | bigint, gravity?: ImageGravity, quality?: number | bigint, borderWidth?: number | bigint, borderColor?: string, borderRadius?: number | bigint, opacity?: number | bigint, rotation?: number | bigint, background?: string, output?: ImageFormat, token?: string }; + params = (paramsOrFirst || {}) as { bucketId: string, fileId: string, width?: number, height?: number, gravity?: ImageGravity, quality?: number, borderWidth?: number, borderColor?: string, borderRadius?: number, opacity?: number, rotation?: number, background?: string, output?: ImageFormat, token?: string }; } else { params = { bucketId: paramsOrFirst as string, fileId: rest[0] as string, - width: rest[1] as number | bigint, - height: rest[2] as number | bigint, + width: rest[1] as number, + height: rest[2] as number, gravity: rest[3] as ImageGravity, - quality: rest[4] as number | bigint, - borderWidth: rest[5] as number | bigint, + quality: rest[4] as number, + borderWidth: rest[5] as number, borderColor: rest[6] as string, - borderRadius: rest[7] as number | bigint, - opacity: rest[8] as number | bigint, - rotation: rest[9] as number | bigint, + borderRadius: rest[7] as number, + opacity: rest[8] as number, + rotation: rest[9] as number, background: rest[10] as string, output: rest[11] as ImageFormat, token: rest[12] as string diff --git a/src/services/tables-db.ts b/src/services/tables-db.ts index 28eb2d2..9fa5afd 100644 --- a/src/services/tables-db.ts +++ b/src/services/tables-db.ts @@ -207,30 +207,30 @@ export class TablesDB { /** * Create a new transaction. * - * @param {number | bigint} params.ttl - Seconds before the transaction expires. + * @param {number} params.ttl - Seconds before the transaction expires. * @throws {AppwriteException} * @returns {Promise} */ - createTransaction(params?: { ttl?: number | bigint }): Promise; + createTransaction(params?: { ttl?: number }): Promise; /** * Create a new transaction. * - * @param {number | bigint} ttl - Seconds before the transaction expires. + * @param {number} ttl - Seconds before the transaction expires. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createTransaction(ttl?: number | bigint): Promise; + createTransaction(ttl?: number): Promise; createTransaction( - paramsOrFirst?: { ttl?: number | bigint } | number | bigint + paramsOrFirst?: { ttl?: number } | number ): Promise { - let params: { ttl?: number | bigint }; + let params: { ttl?: number }; if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { ttl?: number | bigint }; + params = (paramsOrFirst || {}) as { ttl?: number }; } else { params = { - ttl: paramsOrFirst as number | bigint + ttl: paramsOrFirst as number }; } @@ -1911,14 +1911,14 @@ export class TablesDB { * @param {string} params.tableId - Table ID. * @param {string} params.key - Column Key. * @param {boolean} params.required - Is column required? - * @param {number | bigint} params.min - Minimum value - * @param {number | bigint} params.max - Maximum value - * @param {number | bigint} params.xdefault - Default value. Cannot be set when required. + * @param {number} params.min - Minimum value + * @param {number} params.max - Maximum value + * @param {number} params.xdefault - Default value. Cannot be set when required. * @param {boolean} params.array - Is column an array? * @throws {AppwriteException} * @returns {Promise} */ - createFloatColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, min?: number | bigint, max?: number | bigint, xdefault?: number | bigint, array?: boolean }): Promise; + createFloatColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean }): Promise; /** * Create a float column. Optionally, minimum and maximum values can be provided. * @@ -1927,32 +1927,32 @@ export class TablesDB { * @param {string} tableId - Table ID. * @param {string} key - Column Key. * @param {boolean} required - Is column required? - * @param {number | bigint} min - Minimum value - * @param {number | bigint} max - Maximum value - * @param {number | bigint} xdefault - Default value. Cannot be set when required. + * @param {number} min - Minimum value + * @param {number} max - Maximum value + * @param {number} xdefault - Default value. Cannot be set when required. * @param {boolean} array - Is column an array? * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createFloatColumn(databaseId: string, tableId: string, key: string, required: boolean, min?: number | bigint, max?: number | bigint, xdefault?: number | bigint, array?: boolean): Promise; + createFloatColumn(databaseId: string, tableId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean): Promise; createFloatColumn( - paramsOrFirst: { databaseId: string, tableId: string, key: string, required: boolean, min?: number | bigint, max?: number | bigint, xdefault?: number | bigint, array?: boolean } | string, - ...rest: [(string)?, (string)?, (boolean)?, (number | bigint)?, (number | bigint)?, (number | bigint)?, (boolean)?] + paramsOrFirst: { databaseId: string, tableId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean } | string, + ...rest: [(string)?, (string)?, (boolean)?, (number)?, (number)?, (number)?, (boolean)?] ): Promise { - let params: { databaseId: string, tableId: string, key: string, required: boolean, min?: number | bigint, max?: number | bigint, xdefault?: number | bigint, array?: boolean }; + let params: { databaseId: string, tableId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, required: boolean, min?: number | bigint, max?: number | bigint, xdefault?: number | bigint, array?: boolean }; + params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean }; } else { params = { databaseId: paramsOrFirst as string, tableId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - min: rest[3] as number | bigint, - max: rest[4] as number | bigint, - xdefault: rest[5] as number | bigint, + min: rest[3] as number, + max: rest[4] as number, + xdefault: rest[5] as number, array: rest[6] as boolean }; } @@ -2021,14 +2021,14 @@ export class TablesDB { * @param {string} params.tableId - Table ID. * @param {string} params.key - Column Key. * @param {boolean} params.required - Is column required? - * @param {number | bigint} params.xdefault - Default value. Cannot be set when required. - * @param {number | bigint} params.min - Minimum value - * @param {number | bigint} params.max - Maximum value + * @param {number} params.xdefault - Default value. Cannot be set when required. + * @param {number} params.min - Minimum value + * @param {number} params.max - Maximum value * @param {string} params.newKey - New Column Key. * @throws {AppwriteException} * @returns {Promise} */ - updateFloatColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number | bigint, min?: number | bigint, max?: number | bigint, newKey?: string }): Promise; + updateFloatColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string }): Promise; /** * Update a float column. Changing the `default` value will not update already existing rows. * @@ -2037,32 +2037,32 @@ export class TablesDB { * @param {string} tableId - Table ID. * @param {string} key - Column Key. * @param {boolean} required - Is column required? - * @param {number | bigint} xdefault - Default value. Cannot be set when required. - * @param {number | bigint} min - Minimum value - * @param {number | bigint} max - Maximum value + * @param {number} xdefault - Default value. Cannot be set when required. + * @param {number} min - Minimum value + * @param {number} max - Maximum value * @param {string} newKey - New Column Key. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateFloatColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number | bigint, min?: number | bigint, max?: number | bigint, newKey?: string): Promise; + updateFloatColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string): Promise; updateFloatColumn( - paramsOrFirst: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number | bigint, min?: number | bigint, max?: number | bigint, newKey?: string } | string, - ...rest: [(string)?, (string)?, (boolean)?, (number | bigint)?, (number | bigint)?, (number | bigint)?, (string)?] + paramsOrFirst: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string } | string, + ...rest: [(string)?, (string)?, (boolean)?, (number)?, (number)?, (number)?, (string)?] ): Promise { - let params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number | bigint, min?: number | bigint, max?: number | bigint, newKey?: string }; + let params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number | bigint, min?: number | bigint, max?: number | bigint, newKey?: string }; + params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string }; } else { params = { databaseId: paramsOrFirst as string, tableId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as number | bigint, - min: rest[4] as number | bigint, - max: rest[5] as number | bigint, + xdefault: rest[3] as number, + min: rest[4] as number, + max: rest[5] as number, newKey: rest[6] as string }; } @@ -3186,7 +3186,7 @@ export class TablesDB { * @param {string} params.databaseId - Database ID. * @param {string} params.tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} params.key - Column Key. - * @param {number | bigint} params.size - Column size for text columns, in number of characters. + * @param {number} params.size - Column size for text columns, in number of characters. * @param {boolean} params.required - Is column required? * @param {string} params.xdefault - Default value for column when not provided. Cannot be set when column is required. * @param {boolean} params.array - Is column an array? @@ -3194,7 +3194,7 @@ export class TablesDB { * @throws {AppwriteException} * @returns {Promise} */ - createStringColumn(params: { databaseId: string, tableId: string, key: string, size: number | bigint, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean }): Promise; + createStringColumn(params: { databaseId: string, tableId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean }): Promise; /** * Create a string column. * @@ -3202,7 +3202,7 @@ export class TablesDB { * @param {string} databaseId - Database ID. * @param {string} tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} key - Column Key. - * @param {number | bigint} size - Column size for text columns, in number of characters. + * @param {number} size - Column size for text columns, in number of characters. * @param {boolean} required - Is column required? * @param {string} xdefault - Default value for column when not provided. Cannot be set when column is required. * @param {boolean} array - Is column an array? @@ -3211,21 +3211,21 @@ export class TablesDB { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createStringColumn(databaseId: string, tableId: string, key: string, size: number | bigint, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean): Promise; + createStringColumn(databaseId: string, tableId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean): Promise; createStringColumn( - paramsOrFirst: { databaseId: string, tableId: string, key: string, size: number | bigint, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean } | string, - ...rest: [(string)?, (string)?, (number | bigint)?, (boolean)?, (string)?, (boolean)?, (boolean)?] + paramsOrFirst: { databaseId: string, tableId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean } | string, + ...rest: [(string)?, (string)?, (number)?, (boolean)?, (string)?, (boolean)?, (boolean)?] ): Promise { - let params: { databaseId: string, tableId: string, key: string, size: number | bigint, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean }; + let params: { databaseId: string, tableId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, size: number | bigint, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean }; + params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean }; } else { params = { databaseId: paramsOrFirst as string, tableId: rest[0] as string, key: rest[1] as string, - size: rest[2] as number | bigint, + size: rest[2] as number, required: rest[3] as boolean, xdefault: rest[4] as string, array: rest[5] as boolean, @@ -3301,12 +3301,12 @@ export class TablesDB { * @param {string} params.key - Column Key. * @param {boolean} params.required - Is column required? * @param {string} params.xdefault - Default value for column when not provided. Cannot be set when column is required. - * @param {number | bigint} params.size - Maximum size of the string column. + * @param {number} params.size - Maximum size of the string column. * @param {string} params.newKey - New Column Key. * @throws {AppwriteException} * @returns {Promise} */ - updateStringColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, size?: number | bigint, newKey?: string }): Promise; + updateStringColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, size?: number, newKey?: string }): Promise; /** * Update a string column. Changing the `default` value will not update already existing rows. * @@ -3316,21 +3316,21 @@ export class TablesDB { * @param {string} key - Column Key. * @param {boolean} required - Is column required? * @param {string} xdefault - Default value for column when not provided. Cannot be set when column is required. - * @param {number | bigint} size - Maximum size of the string column. + * @param {number} size - Maximum size of the string column. * @param {string} newKey - New Column Key. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateStringColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, size?: number | bigint, newKey?: string): Promise; + updateStringColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, size?: number, newKey?: string): Promise; updateStringColumn( - paramsOrFirst: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, size?: number | bigint, newKey?: string } | string, - ...rest: [(string)?, (string)?, (boolean)?, (string)?, (number | bigint)?, (string)?] + paramsOrFirst: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, size?: number, newKey?: string } | string, + ...rest: [(string)?, (string)?, (boolean)?, (string)?, (number)?, (string)?] ): Promise { - let params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, size?: number | bigint, newKey?: string }; + let params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, size?: number, newKey?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, size?: number | bigint, newKey?: string }; + params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, size?: number, newKey?: string }; } else { params = { databaseId: paramsOrFirst as string, @@ -3338,7 +3338,7 @@ export class TablesDB { key: rest[1] as string, required: rest[2] as boolean, xdefault: rest[3] as string, - size: rest[4] as number | bigint, + size: rest[4] as number, newKey: rest[5] as string }; } @@ -3886,11 +3886,11 @@ export class TablesDB { * @param {IndexType} params.type - Index type. * @param {string[]} params.columns - Array of columns to index. Maximum of 100 columns are allowed, each 32 characters long. * @param {string[]} params.orders - Array of index orders. Maximum of 100 orders are allowed. - * @param {number | bigint[]} params.lengths - Length of index. Maximum of 100 + * @param {number[]} params.lengths - Length of index. Maximum of 100 * @throws {AppwriteException} * @returns {Promise} */ - createIndex(params: { databaseId: string, tableId: string, key: string, type: IndexType, columns: string[], orders?: string[], lengths?: number | bigint[] }): Promise; + createIndex(params: { databaseId: string, tableId: string, key: string, type: IndexType, columns: string[], orders?: string[], lengths?: number[] }): Promise; /** * Creates an index on the columns listed. Your index should include all the columns you will query in a single request. * Type can be `key`, `fulltext`, or `unique`. @@ -3901,20 +3901,20 @@ export class TablesDB { * @param {IndexType} type - Index type. * @param {string[]} columns - Array of columns to index. Maximum of 100 columns are allowed, each 32 characters long. * @param {string[]} orders - Array of index orders. Maximum of 100 orders are allowed. - * @param {number | bigint[]} lengths - Length of index. Maximum of 100 + * @param {number[]} lengths - Length of index. Maximum of 100 * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createIndex(databaseId: string, tableId: string, key: string, type: IndexType, columns: string[], orders?: string[], lengths?: number | bigint[]): Promise; + createIndex(databaseId: string, tableId: string, key: string, type: IndexType, columns: string[], orders?: string[], lengths?: number[]): Promise; createIndex( - paramsOrFirst: { databaseId: string, tableId: string, key: string, type: IndexType, columns: string[], orders?: string[], lengths?: number | bigint[] } | string, - ...rest: [(string)?, (string)?, (IndexType)?, (string[])?, (string[])?, (number | bigint[])?] + paramsOrFirst: { databaseId: string, tableId: string, key: string, type: IndexType, columns: string[], orders?: string[], lengths?: number[] } | string, + ...rest: [(string)?, (string)?, (IndexType)?, (string[])?, (string[])?, (number[])?] ): Promise { - let params: { databaseId: string, tableId: string, key: string, type: IndexType, columns: string[], orders?: string[], lengths?: number | bigint[] }; + let params: { databaseId: string, tableId: string, key: string, type: IndexType, columns: string[], orders?: string[], lengths?: number[] }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, type: IndexType, columns: string[], orders?: string[], lengths?: number | bigint[] }; + params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, type: IndexType, columns: string[], orders?: string[], lengths?: number[] }; } else { params = { databaseId: paramsOrFirst as string, @@ -3923,7 +3923,7 @@ export class TablesDB { type: rest[2] as IndexType, columns: rest[3] as string[], orders: rest[4] as string[], - lengths: rest[5] as number | bigint[] + lengths: rest[5] as number[] }; } @@ -4937,13 +4937,13 @@ export class TablesDB { * @param {string} params.tableId - Table ID. * @param {string} params.rowId - Row ID. * @param {string} params.column - Column key. - * @param {number | bigint} params.value - Value to increment the column by. The value must be a number. - * @param {number | bigint} params.min - Minimum value for the column. If the current value is lesser than this value, an exception will be thrown. + * @param {number} params.value - Value to increment the column by. The value must be a number. + * @param {number} params.min - Minimum value for the column. If the current value is lesser than this value, an exception will be thrown. * @param {string} params.transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise} */ - decrementRowColumn(params: { databaseId: string, tableId: string, rowId: string, column: string, value?: number | bigint, min?: number | bigint, transactionId?: string }): Promise; + decrementRowColumn(params: { databaseId: string, tableId: string, rowId: string, column: string, value?: number, min?: number, transactionId?: string }): Promise; /** * Decrement a specific column of a row by a given value. * @@ -4951,30 +4951,30 @@ export class TablesDB { * @param {string} tableId - Table ID. * @param {string} rowId - Row ID. * @param {string} column - Column key. - * @param {number | bigint} value - Value to increment the column by. The value must be a number. - * @param {number | bigint} min - Minimum value for the column. If the current value is lesser than this value, an exception will be thrown. + * @param {number} value - Value to increment the column by. The value must be a number. + * @param {number} min - Minimum value for the column. If the current value is lesser than this value, an exception will be thrown. * @param {string} transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - decrementRowColumn(databaseId: string, tableId: string, rowId: string, column: string, value?: number | bigint, min?: number | bigint, transactionId?: string): Promise; + decrementRowColumn(databaseId: string, tableId: string, rowId: string, column: string, value?: number, min?: number, transactionId?: string): Promise; decrementRowColumn( - paramsOrFirst: { databaseId: string, tableId: string, rowId: string, column: string, value?: number | bigint, min?: number | bigint, transactionId?: string } | string, - ...rest: [(string)?, (string)?, (string)?, (number | bigint)?, (number | bigint)?, (string)?] + paramsOrFirst: { databaseId: string, tableId: string, rowId: string, column: string, value?: number, min?: number, transactionId?: string } | string, + ...rest: [(string)?, (string)?, (string)?, (number)?, (number)?, (string)?] ): Promise { - let params: { databaseId: string, tableId: string, rowId: string, column: string, value?: number | bigint, min?: number | bigint, transactionId?: string }; + let params: { databaseId: string, tableId: string, rowId: string, column: string, value?: number, min?: number, transactionId?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, rowId: string, column: string, value?: number | bigint, min?: number | bigint, transactionId?: string }; + params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, rowId: string, column: string, value?: number, min?: number, transactionId?: string }; } else { params = { databaseId: paramsOrFirst as string, tableId: rest[0] as string, rowId: rest[1] as string, column: rest[2] as string, - value: rest[3] as number | bigint, - min: rest[4] as number | bigint, + value: rest[3] as number, + min: rest[4] as number, transactionId: rest[5] as string }; } @@ -5032,13 +5032,13 @@ export class TablesDB { * @param {string} params.tableId - Table ID. * @param {string} params.rowId - Row ID. * @param {string} params.column - Column key. - * @param {number | bigint} params.value - Value to increment the column by. The value must be a number. - * @param {number | bigint} params.max - Maximum value for the column. If the current value is greater than this value, an error will be thrown. + * @param {number} params.value - Value to increment the column by. The value must be a number. + * @param {number} params.max - Maximum value for the column. If the current value is greater than this value, an error will be thrown. * @param {string} params.transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise} */ - incrementRowColumn(params: { databaseId: string, tableId: string, rowId: string, column: string, value?: number | bigint, max?: number | bigint, transactionId?: string }): Promise; + incrementRowColumn(params: { databaseId: string, tableId: string, rowId: string, column: string, value?: number, max?: number, transactionId?: string }): Promise; /** * Increment a specific column of a row by a given value. * @@ -5046,30 +5046,30 @@ export class TablesDB { * @param {string} tableId - Table ID. * @param {string} rowId - Row ID. * @param {string} column - Column key. - * @param {number | bigint} value - Value to increment the column by. The value must be a number. - * @param {number | bigint} max - Maximum value for the column. If the current value is greater than this value, an error will be thrown. + * @param {number} value - Value to increment the column by. The value must be a number. + * @param {number} max - Maximum value for the column. If the current value is greater than this value, an error will be thrown. * @param {string} transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - incrementRowColumn(databaseId: string, tableId: string, rowId: string, column: string, value?: number | bigint, max?: number | bigint, transactionId?: string): Promise; + incrementRowColumn(databaseId: string, tableId: string, rowId: string, column: string, value?: number, max?: number, transactionId?: string): Promise; incrementRowColumn( - paramsOrFirst: { databaseId: string, tableId: string, rowId: string, column: string, value?: number | bigint, max?: number | bigint, transactionId?: string } | string, - ...rest: [(string)?, (string)?, (string)?, (number | bigint)?, (number | bigint)?, (string)?] + paramsOrFirst: { databaseId: string, tableId: string, rowId: string, column: string, value?: number, max?: number, transactionId?: string } | string, + ...rest: [(string)?, (string)?, (string)?, (number)?, (number)?, (string)?] ): Promise { - let params: { databaseId: string, tableId: string, rowId: string, column: string, value?: number | bigint, max?: number | bigint, transactionId?: string }; + let params: { databaseId: string, tableId: string, rowId: string, column: string, value?: number, max?: number, transactionId?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, rowId: string, column: string, value?: number | bigint, max?: number | bigint, transactionId?: string }; + params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, rowId: string, column: string, value?: number, max?: number, transactionId?: string }; } else { params = { databaseId: paramsOrFirst as string, tableId: rest[0] as string, rowId: rest[1] as string, column: rest[2] as string, - value: rest[3] as number | bigint, - max: rest[4] as number | bigint, + value: rest[3] as number, + max: rest[4] as number, transactionId: rest[5] as string }; } diff --git a/src/services/users.ts b/src/services/users.ts index c348ccb..29cb089 100644 --- a/src/services/users.ts +++ b/src/services/users.ts @@ -619,15 +619,15 @@ export class Users { * @param {string} params.email - User email. * @param {string} params.password - User password hashed using Scrypt. * @param {string} params.passwordSalt - Optional salt used to hash password. - * @param {number | bigint} params.passwordCpu - Optional CPU cost used to hash password. - * @param {number | bigint} params.passwordMemory - Optional memory cost used to hash password. - * @param {number | bigint} params.passwordParallel - Optional parallelization cost used to hash password. - * @param {number | bigint} params.passwordLength - Optional hash length used to hash password. + * @param {number} params.passwordCpu - Optional CPU cost used to hash password. + * @param {number} params.passwordMemory - Optional memory cost used to hash password. + * @param {number} params.passwordParallel - Optional parallelization cost used to hash password. + * @param {number} params.passwordLength - Optional hash length used to hash password. * @param {string} params.name - User name. Max length: 128 chars. * @throws {AppwriteException} * @returns {Promise>} */ - createScryptUser(params: { userId: string, email: string, password: string, passwordSalt: string, passwordCpu: number | bigint, passwordMemory: number | bigint, passwordParallel: number | bigint, passwordLength: number | bigint, name?: string }): Promise>; + createScryptUser(params: { userId: string, email: string, password: string, passwordSalt: string, passwordCpu: number, passwordMemory: number, passwordParallel: number, passwordLength: number, name?: string }): Promise>; /** * Create a new user. Password provided must be hashed with the [Scrypt](https://github.com/Tarsnap/scrypt) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. * @@ -635,34 +635,34 @@ export class Users { * @param {string} email - User email. * @param {string} password - User password hashed using Scrypt. * @param {string} passwordSalt - Optional salt used to hash password. - * @param {number | bigint} passwordCpu - Optional CPU cost used to hash password. - * @param {number | bigint} passwordMemory - Optional memory cost used to hash password. - * @param {number | bigint} passwordParallel - Optional parallelization cost used to hash password. - * @param {number | bigint} passwordLength - Optional hash length used to hash password. + * @param {number} passwordCpu - Optional CPU cost used to hash password. + * @param {number} passwordMemory - Optional memory cost used to hash password. + * @param {number} passwordParallel - Optional parallelization cost used to hash password. + * @param {number} passwordLength - Optional hash length used to hash password. * @param {string} name - User name. Max length: 128 chars. * @throws {AppwriteException} * @returns {Promise>} * @deprecated Use the object parameter style method for a better developer experience. */ - createScryptUser(userId: string, email: string, password: string, passwordSalt: string, passwordCpu: number | bigint, passwordMemory: number | bigint, passwordParallel: number | bigint, passwordLength: number | bigint, name?: string): Promise>; + createScryptUser(userId: string, email: string, password: string, passwordSalt: string, passwordCpu: number, passwordMemory: number, passwordParallel: number, passwordLength: number, name?: string): Promise>; createScryptUser( - paramsOrFirst: { userId: string, email: string, password: string, passwordSalt: string, passwordCpu: number | bigint, passwordMemory: number | bigint, passwordParallel: number | bigint, passwordLength: number | bigint, name?: string } | string, - ...rest: [(string)?, (string)?, (string)?, (number | bigint)?, (number | bigint)?, (number | bigint)?, (number | bigint)?, (string)?] + paramsOrFirst: { userId: string, email: string, password: string, passwordSalt: string, passwordCpu: number, passwordMemory: number, passwordParallel: number, passwordLength: number, name?: string } | string, + ...rest: [(string)?, (string)?, (string)?, (number)?, (number)?, (number)?, (number)?, (string)?] ): Promise> { - let params: { userId: string, email: string, password: string, passwordSalt: string, passwordCpu: number | bigint, passwordMemory: number | bigint, passwordParallel: number | bigint, passwordLength: number | bigint, name?: string }; + let params: { userId: string, email: string, password: string, passwordSalt: string, passwordCpu: number, passwordMemory: number, passwordParallel: number, passwordLength: number, name?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { userId: string, email: string, password: string, passwordSalt: string, passwordCpu: number | bigint, passwordMemory: number | bigint, passwordParallel: number | bigint, passwordLength: number | bigint, name?: string }; + params = (paramsOrFirst || {}) as { userId: string, email: string, password: string, passwordSalt: string, passwordCpu: number, passwordMemory: number, passwordParallel: number, passwordLength: number, name?: string }; } else { params = { userId: paramsOrFirst as string, email: rest[0] as string, password: rest[1] as string, passwordSalt: rest[2] as string, - passwordCpu: rest[3] as number | bigint, - passwordMemory: rest[4] as number | bigint, - passwordParallel: rest[5] as number | bigint, - passwordLength: rest[6] as number | bigint, + passwordCpu: rest[3] as number, + passwordMemory: rest[4] as number, + passwordParallel: rest[5] as number, + passwordLength: rest[6] as number, name: rest[7] as string }; } @@ -1119,35 +1119,35 @@ export class Users { * * @param {string} params.userId - User ID. * @param {string} params.sessionId - Session ID. Use the string 'recent' to use the most recent session. Defaults to the most recent session. - * @param {number | bigint} params.duration - Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds. + * @param {number} params.duration - Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds. * @throws {AppwriteException} * @returns {Promise} */ - createJWT(params: { userId: string, sessionId?: string, duration?: number | bigint }): Promise; + createJWT(params: { userId: string, sessionId?: string, duration?: number }): Promise; /** * Use this endpoint to create a JSON Web Token for user by its unique ID. You can use the resulting JWT to authenticate on behalf of the user. The JWT secret will become invalid if the session it uses gets deleted. * * @param {string} userId - User ID. * @param {string} sessionId - Session ID. Use the string 'recent' to use the most recent session. Defaults to the most recent session. - * @param {number | bigint} duration - Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds. + * @param {number} duration - Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createJWT(userId: string, sessionId?: string, duration?: number | bigint): Promise; + createJWT(userId: string, sessionId?: string, duration?: number): Promise; createJWT( - paramsOrFirst: { userId: string, sessionId?: string, duration?: number | bigint } | string, - ...rest: [(string)?, (number | bigint)?] + paramsOrFirst: { userId: string, sessionId?: string, duration?: number } | string, + ...rest: [(string)?, (number)?] ): Promise { - let params: { userId: string, sessionId?: string, duration?: number | bigint }; + let params: { userId: string, sessionId?: string, duration?: number }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { userId: string, sessionId?: string, duration?: number | bigint }; + params = (paramsOrFirst || {}) as { userId: string, sessionId?: string, duration?: number }; } else { params = { userId: paramsOrFirst as string, sessionId: rest[0] as string, - duration: rest[1] as number | bigint + duration: rest[1] as number }; } @@ -3012,37 +3012,37 @@ export class Users { * * * @param {string} params.userId - User ID. - * @param {number | bigint} params.length - Token length in characters. The default length is 6 characters - * @param {number | bigint} params.expire - Token expiration period in seconds. The default expiration is 15 minutes. + * @param {number} params.length - Token length in characters. The default length is 6 characters + * @param {number} params.expire - Token expiration period in seconds. The default expiration is 15 minutes. * @throws {AppwriteException} * @returns {Promise} */ - createToken(params: { userId: string, length?: number | bigint, expire?: number | bigint }): Promise; + createToken(params: { userId: string, length?: number, expire?: number }): Promise; /** * Returns a token with a secret key for creating a session. Use the user ID and secret and submit a request to the [PUT /account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. * * * @param {string} userId - User ID. - * @param {number | bigint} length - Token length in characters. The default length is 6 characters - * @param {number | bigint} expire - Token expiration period in seconds. The default expiration is 15 minutes. + * @param {number} length - Token length in characters. The default length is 6 characters + * @param {number} expire - Token expiration period in seconds. The default expiration is 15 minutes. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createToken(userId: string, length?: number | bigint, expire?: number | bigint): Promise; + createToken(userId: string, length?: number, expire?: number): Promise; createToken( - paramsOrFirst: { userId: string, length?: number | bigint, expire?: number | bigint } | string, - ...rest: [(number | bigint)?, (number | bigint)?] + paramsOrFirst: { userId: string, length?: number, expire?: number } | string, + ...rest: [(number)?, (number)?] ): Promise { - let params: { userId: string, length?: number | bigint, expire?: number | bigint }; + let params: { userId: string, length?: number, expire?: number }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { userId: string, length?: number | bigint, expire?: number | bigint }; + params = (paramsOrFirst || {}) as { userId: string, length?: number, expire?: number }; } else { params = { userId: paramsOrFirst as string, - length: rest[0] as number | bigint, - expire: rest[1] as number | bigint + length: rest[0] as number, + expire: rest[1] as number }; } From 8309f0329f6673d870736fe102ec555eadd08e81 Mon Sep 17 00:00:00 2001 From: Darshan Date: Thu, 15 Jan 2026 07:42:05 +0000 Subject: [PATCH 6/6] misc-fixes --- .../get-queue-billing-project-aggregation.md | 12 - .../get-queue-billing-team-aggregation.md | 12 - .../health/get-queue-priority-builds.md | 12 - .../health/get-queue-region-manager.md | 12 - docs/examples/health/get-queue-threats.md | 12 - src/services/health.ts | 255 ------------------ 6 files changed, 315 deletions(-) delete mode 100644 docs/examples/health/get-queue-billing-project-aggregation.md delete mode 100644 docs/examples/health/get-queue-billing-team-aggregation.md delete mode 100644 docs/examples/health/get-queue-priority-builds.md delete mode 100644 docs/examples/health/get-queue-region-manager.md delete mode 100644 docs/examples/health/get-queue-threats.md diff --git a/docs/examples/health/get-queue-billing-project-aggregation.md b/docs/examples/health/get-queue-billing-project-aggregation.md deleted file mode 100644 index c1cc1a0..0000000 --- a/docs/examples/health/get-queue-billing-project-aggregation.md +++ /dev/null @@ -1,12 +0,0 @@ -const sdk = require('node-appwrite'); - -const client = new sdk.Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject('') // Your project ID - .setKey(''); // Your secret API key - -const health = new sdk.Health(client); - -const result = await health.getQueueBillingProjectAggregation({ - threshold: null // optional -}); diff --git a/docs/examples/health/get-queue-billing-team-aggregation.md b/docs/examples/health/get-queue-billing-team-aggregation.md deleted file mode 100644 index 9ebea64..0000000 --- a/docs/examples/health/get-queue-billing-team-aggregation.md +++ /dev/null @@ -1,12 +0,0 @@ -const sdk = require('node-appwrite'); - -const client = new sdk.Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject('') // Your project ID - .setKey(''); // Your secret API key - -const health = new sdk.Health(client); - -const result = await health.getQueueBillingTeamAggregation({ - threshold: null // optional -}); diff --git a/docs/examples/health/get-queue-priority-builds.md b/docs/examples/health/get-queue-priority-builds.md deleted file mode 100644 index 79086df..0000000 --- a/docs/examples/health/get-queue-priority-builds.md +++ /dev/null @@ -1,12 +0,0 @@ -const sdk = require('node-appwrite'); - -const client = new sdk.Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject('') // Your project ID - .setKey(''); // Your secret API key - -const health = new sdk.Health(client); - -const result = await health.getQueuePriorityBuilds({ - threshold: null // optional -}); diff --git a/docs/examples/health/get-queue-region-manager.md b/docs/examples/health/get-queue-region-manager.md deleted file mode 100644 index 93a968c..0000000 --- a/docs/examples/health/get-queue-region-manager.md +++ /dev/null @@ -1,12 +0,0 @@ -const sdk = require('node-appwrite'); - -const client = new sdk.Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject('') // Your project ID - .setKey(''); // Your secret API key - -const health = new sdk.Health(client); - -const result = await health.getQueueRegionManager({ - threshold: null // optional -}); diff --git a/docs/examples/health/get-queue-threats.md b/docs/examples/health/get-queue-threats.md deleted file mode 100644 index 3a2ab75..0000000 --- a/docs/examples/health/get-queue-threats.md +++ /dev/null @@ -1,12 +0,0 @@ -const sdk = require('node-appwrite'); - -const client = new sdk.Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject('') // Your project ID - .setKey(''); // Your secret API key - -const health = new sdk.Health(client); - -const result = await health.getQueueThreats({ - threshold: null // optional -}); diff --git a/src/services/health.ts b/src/services/health.ts index a4d5e19..8049935 100644 --- a/src/services/health.ts +++ b/src/services/health.ts @@ -176,108 +176,6 @@ export class Health { ); } - /** - * Get billing project aggregation queue. - * - * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. - * @throws {AppwriteException} - * @returns {Promise} - */ - getQueueBillingProjectAggregation(params?: { threshold?: number }): Promise; - /** - * Get billing project aggregation queue. - * - * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - getQueueBillingProjectAggregation(threshold?: number): Promise; - getQueueBillingProjectAggregation( - paramsOrFirst?: { threshold?: number } | number - ): Promise { - let params: { threshold?: number }; - - if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { threshold?: number }; - } else { - params = { - threshold: paramsOrFirst as number - }; - } - - const threshold = params.threshold; - - - const apiPath = '/health/queue/billing-project-aggregation'; - const payload: Payload = {}; - if (typeof threshold !== 'undefined') { - payload['threshold'] = threshold; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - } - - return this.client.call( - 'get', - uri, - apiHeaders, - payload, - ); - } - - /** - * Get billing team aggregation queue. - * - * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. - * @throws {AppwriteException} - * @returns {Promise} - */ - getQueueBillingTeamAggregation(params?: { threshold?: number }): Promise; - /** - * Get billing team aggregation queue. - * - * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - getQueueBillingTeamAggregation(threshold?: number): Promise; - getQueueBillingTeamAggregation( - paramsOrFirst?: { threshold?: number } | number - ): Promise { - let params: { threshold?: number }; - - if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { threshold?: number }; - } else { - params = { - threshold: paramsOrFirst as number - }; - } - - const threshold = params.threshold; - - - const apiPath = '/health/queue/billing-team-aggregation'; - const payload: Payload = {}; - if (typeof threshold !== 'undefined') { - payload['threshold'] = threshold; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - } - - return this.client.call( - 'get', - uri, - apiHeaders, - payload, - ); - } - /** * Get the number of builds that are waiting to be processed in the Appwrite internal queue server. * @@ -329,57 +227,6 @@ export class Health { ); } - /** - * Get the priority builds queue size. - * - * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 500. - * @throws {AppwriteException} - * @returns {Promise} - */ - getQueuePriorityBuilds(params?: { threshold?: number }): Promise; - /** - * Get the priority builds queue size. - * - * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 500. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - getQueuePriorityBuilds(threshold?: number): Promise; - getQueuePriorityBuilds( - paramsOrFirst?: { threshold?: number } | number - ): Promise { - let params: { threshold?: number }; - - if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { threshold?: number }; - } else { - params = { - threshold: paramsOrFirst as number - }; - } - - const threshold = params.threshold; - - - const apiPath = '/health/queue/builds-priority'; - const payload: Payload = {}; - if (typeof threshold !== 'undefined') { - payload['threshold'] = threshold; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - } - - return this.client.call( - 'get', - uri, - apiHeaders, - payload, - ); - } - /** * Get the number of certificates that are waiting to be issued against [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue server. * @@ -857,57 +704,6 @@ export class Health { ); } - /** - * Get region manager queue. - * - * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 100. - * @throws {AppwriteException} - * @returns {Promise} - */ - getQueueRegionManager(params?: { threshold?: number }): Promise; - /** - * Get region manager queue. - * - * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 100. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - getQueueRegionManager(threshold?: number): Promise; - getQueueRegionManager( - paramsOrFirst?: { threshold?: number } | number - ): Promise { - let params: { threshold?: number }; - - if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { threshold?: number }; - } else { - params = { - threshold: paramsOrFirst as number - }; - } - - const threshold = params.threshold; - - - const apiPath = '/health/queue/region-manager'; - const payload: Payload = {}; - if (typeof threshold !== 'undefined') { - payload['threshold'] = threshold; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - } - - return this.client.call( - 'get', - uri, - apiHeaders, - payload, - ); - } - /** * Get the number of metrics that are waiting to be processed in the Appwrite stats resources queue. * @@ -1010,57 +806,6 @@ export class Health { ); } - /** - * Get threats queue. - * - * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 100. - * @throws {AppwriteException} - * @returns {Promise} - */ - getQueueThreats(params?: { threshold?: number }): Promise; - /** - * Get threats queue. - * - * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 100. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - getQueueThreats(threshold?: number): Promise; - getQueueThreats( - paramsOrFirst?: { threshold?: number } | number - ): Promise { - let params: { threshold?: number }; - - if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { threshold?: number }; - } else { - params = { - threshold: paramsOrFirst as number - }; - } - - const threshold = params.threshold; - - - const apiPath = '/health/queue/threats'; - const payload: Payload = {}; - if (typeof threshold !== 'undefined') { - payload['threshold'] = threshold; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - } - - return this.client.call( - 'get', - uri, - apiHeaders, - payload, - ); - } - /** * Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server. *