diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 9f7045da..64808e44 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -10,7 +10,74 @@ permissions: contents: read jobs: + cdn: + if: github.event_name == 'release' || github.ref_type == 'tag' + runs-on: ubuntu-latest + timeout-minutes: 15 + environment: cdn + permissions: + contents: read + env: + VERSION: ${{ github.event.release.tag_name || github.ref_name }} + + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + + - name: Use Node.js + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 + with: + node-version: '24.14.1' + + - name: Validate version + run: | + if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?$ ]]; then + echo "::error::$VERSION is not a semantic version" + exit 1 + fi + PACKAGE_VERSION=$(node -p "require('./package.json').version") + if [[ "$VERSION" != "$PACKAGE_VERSION" ]]; then + echo "::error::$VERSION does not match package.json version $PACKAGE_VERSION" + exit 1 + fi + + - name: Install dependencies, audit, and build + run: | + npm ci + npm audit --audit-level=high --omit=dev + npm run build:cdn + + - name: Write integrity hashes + run: | + node --input-type=module <<'EOF' + import { createHash } from 'node:crypto'; + import { readdirSync, readFileSync, writeFileSync } from 'node:fs'; + + const root = 'dist/cdn'; + const integrity = Object.fromEntries( + readdirSync(root, { recursive: true }) + .filter((path) => path.endsWith('.js')) + .sort() + .map((path) => [path, 'sha384-' + createHash('sha384').update(readFileSync(`${root}/${path}`)).digest('base64')]), + ); + writeFileSync(`${root}/integrity.json`, JSON.stringify(integrity, null, 2) + '\n'); + EOF + + - name: Upload to the CDN + uses: docker://rclone/rclone@sha256:45401ad7410db1d67ffdb58e19059ad20b0d8e0285a60e38bbec55cc1019c7a5 # 1.75.1 + with: + args: 'copy dist/cdn r2:appwrite-sdk/console/${{ env.VERSION }} --immutable --checksum --header-upload "Cache-Control: public, max-age=31536000, immutable"' + env: + RCLONE_CONFIG_R2_TYPE: s3 + RCLONE_CONFIG_R2_PROVIDER: Cloudflare + RCLONE_CONFIG_R2_ENDPOINT: ${{ vars.R2_ENDPOINT }} + RCLONE_CONFIG_R2_REGION: auto + RCLONE_CONFIG_R2_NO_CHECK_BUCKET: 'true' + RCLONE_CONFIG_R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }} + RCLONE_CONFIG_R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }} + publish: + needs: cdn + if: ${{ !failure() && !cancelled() }} runs-on: ubuntu-latest steps: @@ -27,8 +94,10 @@ jobs: - name: Determine release tag id: release_tag + env: + REF: ${{ github.ref }} run: | - if [[ "${{ github.ref }}" == *"-rc"* ]] || [[ "${{ github.ref }}" == *"-RC"* ]]; then + if [[ "$REF" == *"-rc"* ]] || [[ "$REF" == *"-RC"* ]]; then echo "tag=next" >> "$GITHUB_OUTPUT" else echo "tag=latest" >> "$GITHUB_OUTPUT" diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d0e60e4..899920c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # Change Log +## 20.0.0 + +* Breaking: requests send `X-Appwrite-Response-Format: 2.5.0`; responses follow the 2.5 shapes +* Breaking: nullable model fields are typed `T | null`, such as `Account.emailCanonical` and `Execution.scheduledAt` +* Breaking: removed `Topic.any()`, `Topic.all()` and `ResolvedTopic`; topic levels reject `+` and `#` +* Breaking: requires Node.js 20 or later to build +* Added: `proxy.createSMTPRule` and the `ProxyRuleProtocol` enum, with `ProxyRule.protocol` +* Added: `promoteRestoration` on `mysql`, `postgresql` and `mongo` +* Added: optional `description` on databases, collections, tables, columns, indexes, buckets, functions, sites, keys, topics, variables and webhooks +* Added: `Query` aggregates, `groupBy`, `having`, `distinct`, joins, `relationship`, `covers`, `spatialEquals` and `page` +* Added: `Query.builder()` to chain queries; `build()` returns the `string[]` list methods take, and realtime subscriptions accept a builder directly +* Added: `ExecutionTrigger.Email`, `Function.emailEnabled` and `ConsoleVariables._APP_DOMAIN_EMAIL` +* Added: per-service ES modules and a minified script on `sdk.appwrite.io/console//` +* Updated: nullable request params accept `null` +* Fixed: list and object defaults filled into a response are copied per model + ## 19.0.0 * Breaking: removed the `Assistant` service (`assistant.chat`) and `_APP_ASSISTANT_ENABLED` from `ConsoleVariables` diff --git a/README.md b/README.md index 1b17c402..ba6175e7 100644 --- a/README.md +++ b/README.md @@ -27,15 +27,43 @@ import { Client, Account } from '@appwrite.io/console'; ### CDN +Every release is published to `https://sdk.appwrite.io/console/20.0.0/`. + +#### ES modules + +Each service, helper and enum is its own module, so the browser downloads only what you import. A service is served under its name in kebab case, such as `TablesDB` from `tables-db.js`, and enums under `enums/`, such as `OAuthProvider` from `enums/o-auth-provider.js`. `index.js` re-exports everything, so importing it loads every service: + +```html + +``` + +#### Script tag + Add the script before any code that uses the SDK. It exposes every export on the global `Appwrite` object: ```html - + ``` +#### Subresource integrity + +`integrity.json` in the same directory maps each `.js` file to its `sha384-` hash. An `integrity` attribute checks only the file it is set on. `sdk.min.js` is a single file, so its hash as the `integrity` attribute, together with `crossorigin="anonymous"`, covers the whole SDK. ES modules import other modules and shared chunks, so supply their hashes through the `integrity` field of an import map to cover those too. + +#### jsDelivr + +The script tag build is also available from jsDelivr: + +```html + +``` + ## Getting started ### Add a Web platform diff --git a/docs/examples/account/create-push-target.md b/docs/examples/account/create-push-target.md index 1e26cc91..ff709e79 100644 --- a/docs/examples/account/create-push-target.md +++ b/docs/examples/account/create-push-target.md @@ -11,6 +11,8 @@ const result = await account.createPushTarget({ targetId: '', identifier: '', providerId: '', // optional + bundleId: '', // optional + environment: 'sandbox', // optional }); console.log(result); diff --git a/docs/examples/account/list-billing-addresses.md b/docs/examples/account/list-billing-addresses.md index 6bf1a7d7..2b077822 100644 --- a/docs/examples/account/list-billing-addresses.md +++ b/docs/examples/account/list-billing-addresses.md @@ -9,6 +9,7 @@ const account = new Account(client); const result = await account.listBillingAddresses({ queries: [], // optional + total: false, // optional }); console.log(result); diff --git a/docs/examples/account/list-invoices.md b/docs/examples/account/list-invoices.md index 99b676ee..c0b24372 100644 --- a/docs/examples/account/list-invoices.md +++ b/docs/examples/account/list-invoices.md @@ -9,6 +9,7 @@ const account = new Account(client); const result = await account.listInvoices({ queries: [], // optional + total: false, // optional }); console.log(result); diff --git a/docs/examples/account/list-payment-methods.md b/docs/examples/account/list-payment-methods.md index 5818a6bb..1f523b1d 100644 --- a/docs/examples/account/list-payment-methods.md +++ b/docs/examples/account/list-payment-methods.md @@ -9,6 +9,7 @@ const account = new Account(client); const result = await account.listPaymentMethods({ queries: [], // optional + total: false, // optional }); console.log(result); diff --git a/docs/examples/account/update-push-target.md b/docs/examples/account/update-push-target.md index cd8db7d4..81ee4e81 100644 --- a/docs/examples/account/update-push-target.md +++ b/docs/examples/account/update-push-target.md @@ -10,6 +10,8 @@ const account = new Account(client); const result = await account.updatePushTarget({ targetId: '', identifier: '', + bundleId: '', // optional + environment: 'sandbox', // optional }); console.log(result); diff --git a/docs/examples/activities/list-events.md b/docs/examples/activities/list-events.md index 385132eb..51c01e59 100644 --- a/docs/examples/activities/list-events.md +++ b/docs/examples/activities/list-events.md @@ -9,6 +9,7 @@ const activities = new Activities(client); const result = await activities.listEvents({ queries: [], // optional + total: false, // optional }); console.log(result); diff --git a/docs/examples/admin/update-user-admin.md b/docs/examples/admin/update-user-admin.md new file mode 100644 index 00000000..73819254 --- /dev/null +++ b/docs/examples/admin/update-user-admin.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Admin } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const admin = new Admin(client); + +const result = await admin.updateUserAdmin({ + userId: '', + admin: false, +}); + +console.log(result); +``` diff --git a/docs/examples/affiliates/list-links.md b/docs/examples/affiliates/list-links.md index 3a422f78..b4c9ffb0 100644 --- a/docs/examples/affiliates/list-links.md +++ b/docs/examples/affiliates/list-links.md @@ -9,6 +9,7 @@ const affiliates = new Affiliates(client); const result = await affiliates.listLinks({ queries: [], // optional + total: false, // optional }); console.log(result); diff --git a/docs/examples/affiliates/list-referrals.md b/docs/examples/affiliates/list-referrals.md index 6598ac16..89b6360d 100644 --- a/docs/examples/affiliates/list-referrals.md +++ b/docs/examples/affiliates/list-referrals.md @@ -9,6 +9,7 @@ const affiliates = new Affiliates(client); const result = await affiliates.listReferrals({ queries: [], // optional + total: false, // optional }); console.log(result); diff --git a/docs/examples/affiliates/list-rewards.md b/docs/examples/affiliates/list-rewards.md index ee7d193a..3fee8148 100644 --- a/docs/examples/affiliates/list-rewards.md +++ b/docs/examples/affiliates/list-rewards.md @@ -9,6 +9,7 @@ const affiliates = new Affiliates(client); const result = await affiliates.listRewards({ queries: [], // optional + total: false, // optional }); console.log(result); diff --git a/docs/examples/analytics/create-event.md b/docs/examples/analytics/create-event.md index b5201362..b4c9a083 100644 --- a/docs/examples/analytics/create-event.md +++ b/docs/examples/analytics/create-event.md @@ -13,7 +13,7 @@ const result = await analytics.createEvent({ url: 'https://example.com', domain: '', // optional referrer: '', // optional - screenWidth: null, // optional + screenWidth: 0, // optional sessionHash: '', // optional scrollDepth: 0, // optional engagementTime: 0, // optional diff --git a/docs/examples/analytics/list-metrics.md b/docs/examples/analytics/list-metrics.md index 675da6f1..4afc42fc 100644 --- a/docs/examples/analytics/list-metrics.md +++ b/docs/examples/analytics/list-metrics.md @@ -21,6 +21,7 @@ const result = await analytics.listMetrics({ startAt: '2020-10-15T06:38:00.000+00:00', // optional endAt: '2020-10-15T06:38:00.000+00:00', // optional limit: 1, // optional + total: false, // optional }); console.log(result); diff --git a/docs/examples/backups/list-archives.md b/docs/examples/backups/list-archives.md index 1cfba0fe..3aa50849 100644 --- a/docs/examples/backups/list-archives.md +++ b/docs/examples/backups/list-archives.md @@ -9,6 +9,7 @@ const backups = new Backups(client); const result = await backups.listArchives({ queries: [], // optional + total: false, // optional }); console.log(result); diff --git a/docs/examples/backups/list-policies.md b/docs/examples/backups/list-policies.md index c67145c4..96a19649 100644 --- a/docs/examples/backups/list-policies.md +++ b/docs/examples/backups/list-policies.md @@ -9,6 +9,7 @@ const backups = new Backups(client); const result = await backups.listPolicies({ queries: [], // optional + total: false, // optional }); console.log(result); diff --git a/docs/examples/backups/list-restorations.md b/docs/examples/backups/list-restorations.md index 1654b2e7..9c50cd37 100644 --- a/docs/examples/backups/list-restorations.md +++ b/docs/examples/backups/list-restorations.md @@ -9,6 +9,7 @@ const backups = new Backups(client); const result = await backups.listRestorations({ queries: [], // optional + total: false, // optional }); console.log(result); diff --git a/docs/examples/databases/create-big-int-attribute.md b/docs/examples/databases/create-big-int-attribute.md index 53071380..dddf8d62 100644 --- a/docs/examples/databases/create-big-int-attribute.md +++ b/docs/examples/databases/create-big-int-attribute.md @@ -16,6 +16,7 @@ const result = await databases.createBigIntAttribute({ max: 1000000, // optional xdefault: 0, // optional array: false, // optional + description: '', // optional }); console.log(result); diff --git a/docs/examples/databases/create-boolean-attribute.md b/docs/examples/databases/create-boolean-attribute.md index d2ccb080..85d04422 100644 --- a/docs/examples/databases/create-boolean-attribute.md +++ b/docs/examples/databases/create-boolean-attribute.md @@ -14,6 +14,7 @@ const result = await databases.createBooleanAttribute({ required: false, xdefault: false, // optional array: false, // optional + description: '', // optional }); console.log(result); diff --git a/docs/examples/databases/create-collection.md b/docs/examples/databases/create-collection.md index 65a37a47..ddbc4310 100644 --- a/docs/examples/databases/create-collection.md +++ b/docs/examples/databases/create-collection.md @@ -16,6 +16,7 @@ const result = await databases.createCollection({ enabled: false, // optional attributes: [], // optional indexes: [], // optional + description: '', // optional }); console.log(result); diff --git a/docs/examples/databases/create-datetime-attribute.md b/docs/examples/databases/create-datetime-attribute.md index 7d32531e..e0f1096f 100644 --- a/docs/examples/databases/create-datetime-attribute.md +++ b/docs/examples/databases/create-datetime-attribute.md @@ -14,6 +14,7 @@ const result = await databases.createDatetimeAttribute({ required: false, xdefault: '2020-10-15T06:38:00.000+00:00', // optional array: false, // optional + description: '', // optional }); console.log(result); diff --git a/docs/examples/databases/create-email-attribute.md b/docs/examples/databases/create-email-attribute.md index 20441c04..74a5a326 100644 --- a/docs/examples/databases/create-email-attribute.md +++ b/docs/examples/databases/create-email-attribute.md @@ -14,6 +14,7 @@ const result = await databases.createEmailAttribute({ required: false, xdefault: 'email@example.com', // optional array: false, // optional + description: '', // optional }); console.log(result); diff --git a/docs/examples/databases/create-enum-attribute.md b/docs/examples/databases/create-enum-attribute.md index 821034f6..663e807e 100644 --- a/docs/examples/databases/create-enum-attribute.md +++ b/docs/examples/databases/create-enum-attribute.md @@ -15,6 +15,7 @@ const result = await databases.createEnumAttribute({ required: false, xdefault: 'active', // optional array: false, // optional + description: '', // optional }); console.log(result); diff --git a/docs/examples/databases/create-float-attribute.md b/docs/examples/databases/create-float-attribute.md index 25e65418..4eb131df 100644 --- a/docs/examples/databases/create-float-attribute.md +++ b/docs/examples/databases/create-float-attribute.md @@ -16,6 +16,7 @@ const result = await databases.createFloatAttribute({ max: 100, // optional xdefault: 10.5, // optional array: false, // optional + description: '', // optional }); console.log(result); diff --git a/docs/examples/databases/create-index.md b/docs/examples/databases/create-index.md index 788f5d2e..cd7f9144 100644 --- a/docs/examples/databases/create-index.md +++ b/docs/examples/databases/create-index.md @@ -20,6 +20,7 @@ const result = await databases.createIndex({ attributes: ['username'], orders: [OrderBy.Asc], // optional lengths: [], // optional + description: '', // optional }); console.log(result); diff --git a/docs/examples/databases/create-integer-attribute.md b/docs/examples/databases/create-integer-attribute.md index 18138ec2..eaa32a6b 100644 --- a/docs/examples/databases/create-integer-attribute.md +++ b/docs/examples/databases/create-integer-attribute.md @@ -16,6 +16,7 @@ const result = await databases.createIntegerAttribute({ max: 100, // optional xdefault: 10, // optional array: false, // optional + description: '', // optional }); console.log(result); diff --git a/docs/examples/databases/create-ip-attribute.md b/docs/examples/databases/create-ip-attribute.md index 83b9e5bf..0c414b0b 100644 --- a/docs/examples/databases/create-ip-attribute.md +++ b/docs/examples/databases/create-ip-attribute.md @@ -14,6 +14,7 @@ const result = await databases.createIpAttribute({ required: false, xdefault: '192.0.2.0', // optional array: false, // optional + description: '', // optional }); console.log(result); diff --git a/docs/examples/databases/create-line-attribute.md b/docs/examples/databases/create-line-attribute.md index e4b532ae..9641fb97 100644 --- a/docs/examples/databases/create-line-attribute.md +++ b/docs/examples/databases/create-line-attribute.md @@ -17,6 +17,7 @@ const result = await databases.createLineAttribute({ [3, 4], [5, 6], ], // optional + description: '', // optional }); console.log(result); diff --git a/docs/examples/databases/create-longtext-attribute.md b/docs/examples/databases/create-longtext-attribute.md index 2fc6a4ad..85f4760d 100644 --- a/docs/examples/databases/create-longtext-attribute.md +++ b/docs/examples/databases/create-longtext-attribute.md @@ -15,6 +15,7 @@ const result = await databases.createLongtextAttribute({ xdefault: 'Hello World', // optional array: false, // optional encrypt: false, // optional + description: '', // optional }); console.log(result); diff --git a/docs/examples/databases/create-mediumtext-attribute.md b/docs/examples/databases/create-mediumtext-attribute.md index d32095bf..e204fb61 100644 --- a/docs/examples/databases/create-mediumtext-attribute.md +++ b/docs/examples/databases/create-mediumtext-attribute.md @@ -15,6 +15,7 @@ const result = await databases.createMediumtextAttribute({ xdefault: 'Hello World', // optional array: false, // optional encrypt: false, // optional + description: '', // optional }); console.log(result); diff --git a/docs/examples/databases/create-point-attribute.md b/docs/examples/databases/create-point-attribute.md index 9a40ca1f..706534ff 100644 --- a/docs/examples/databases/create-point-attribute.md +++ b/docs/examples/databases/create-point-attribute.md @@ -13,6 +13,7 @@ const result = await databases.createPointAttribute({ key: '', required: false, xdefault: [1, 2], // optional + description: '', // optional }); console.log(result); diff --git a/docs/examples/databases/create-polygon-attribute.md b/docs/examples/databases/create-polygon-attribute.md index c1e0165f..e959847a 100644 --- a/docs/examples/databases/create-polygon-attribute.md +++ b/docs/examples/databases/create-polygon-attribute.md @@ -20,6 +20,7 @@ const result = await databases.createPolygonAttribute({ [1, 2], ], ], // optional + description: '', // optional }); console.log(result); diff --git a/docs/examples/databases/create-query.md b/docs/examples/databases/create-query.md new file mode 100644 index 00000000..03627c8e --- /dev/null +++ b/docs/examples/databases/create-query.md @@ -0,0 +1,20 @@ +```javascript +import { Client, Databases } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const databases = new Databases(client); + +const result = await databases.createQuery({ + databaseId: '', + collectionId: '', + queries: [], // optional + transactionId: '', // optional + total: false, // optional + ttl: 0, // optional +}); + +console.log(result); +``` diff --git a/docs/examples/databases/create-relationship-attribute.md b/docs/examples/databases/create-relationship-attribute.md index b5bc81da..fb84a1d7 100644 --- a/docs/examples/databases/create-relationship-attribute.md +++ b/docs/examples/databases/create-relationship-attribute.md @@ -21,6 +21,7 @@ const result = await databases.createRelationshipAttribute({ key: '', // optional twoWayKey: '', // optional onDelete: RelationMutate.Cascade, // optional + description: '', // optional }); console.log(result); diff --git a/docs/examples/databases/create-string-attribute.md b/docs/examples/databases/create-string-attribute.md index 62a5c5e2..8a283828 100644 --- a/docs/examples/databases/create-string-attribute.md +++ b/docs/examples/databases/create-string-attribute.md @@ -16,6 +16,7 @@ const result = await databases.createStringAttribute({ xdefault: 'Hello World', // optional array: false, // optional encrypt: false, // optional + description: '', // optional }); console.log(result); diff --git a/docs/examples/databases/create-text-attribute.md b/docs/examples/databases/create-text-attribute.md index c79b9cf6..d626419b 100644 --- a/docs/examples/databases/create-text-attribute.md +++ b/docs/examples/databases/create-text-attribute.md @@ -15,6 +15,7 @@ const result = await databases.createTextAttribute({ xdefault: 'Hello World', // optional array: false, // optional encrypt: false, // optional + description: '', // optional }); console.log(result); diff --git a/docs/examples/databases/create-url-attribute.md b/docs/examples/databases/create-url-attribute.md index 1c44cb9e..060cf922 100644 --- a/docs/examples/databases/create-url-attribute.md +++ b/docs/examples/databases/create-url-attribute.md @@ -14,6 +14,7 @@ const result = await databases.createUrlAttribute({ required: false, xdefault: 'https://example.com', // optional array: false, // optional + description: '', // optional }); console.log(result); diff --git a/docs/examples/databases/create-varchar-attribute.md b/docs/examples/databases/create-varchar-attribute.md index ed35bd74..602332aa 100644 --- a/docs/examples/databases/create-varchar-attribute.md +++ b/docs/examples/databases/create-varchar-attribute.md @@ -16,6 +16,7 @@ const result = await databases.createVarcharAttribute({ xdefault: 'Hello World', // optional array: false, // optional encrypt: false, // optional + description: '', // optional }); console.log(result); diff --git a/docs/examples/databases/create.md b/docs/examples/databases/create.md index bac0e977..67284de2 100644 --- a/docs/examples/databases/create.md +++ b/docs/examples/databases/create.md @@ -11,6 +11,7 @@ const result = await databases.create({ databaseId: '', name: '', enabled: false, // optional + description: '', // optional }); console.log(result); diff --git a/docs/examples/databases/update-big-int-attribute.md b/docs/examples/databases/update-big-int-attribute.md index aa19ca5b..4186891a 100644 --- a/docs/examples/databases/update-big-int-attribute.md +++ b/docs/examples/databases/update-big-int-attribute.md @@ -16,6 +16,7 @@ const result = await databases.updateBigIntAttribute({ min: 0, // optional max: 1000000, // optional newKey: '', // optional + description: '', // optional }); console.log(result); diff --git a/docs/examples/databases/update-boolean-attribute.md b/docs/examples/databases/update-boolean-attribute.md index c3fb9172..10e186c6 100644 --- a/docs/examples/databases/update-boolean-attribute.md +++ b/docs/examples/databases/update-boolean-attribute.md @@ -14,6 +14,7 @@ const result = await databases.updateBooleanAttribute({ required: false, xdefault: false, newKey: '', // optional + description: '', // optional }); console.log(result); diff --git a/docs/examples/databases/update-collection.md b/docs/examples/databases/update-collection.md index c54a45f8..c98f10c5 100644 --- a/docs/examples/databases/update-collection.md +++ b/docs/examples/databases/update-collection.md @@ -15,6 +15,7 @@ const result = await databases.updateCollection({ documentSecurity: false, // optional enabled: false, // optional purge: false, // optional + description: '', // optional }); console.log(result); diff --git a/docs/examples/databases/update-datetime-attribute.md b/docs/examples/databases/update-datetime-attribute.md index 38b6a4ad..da7c23e2 100644 --- a/docs/examples/databases/update-datetime-attribute.md +++ b/docs/examples/databases/update-datetime-attribute.md @@ -14,6 +14,7 @@ const result = await databases.updateDatetimeAttribute({ required: false, xdefault: '2020-10-15T06:38:00.000+00:00', newKey: '', // optional + description: '', // optional }); console.log(result); diff --git a/docs/examples/databases/update-email-attribute.md b/docs/examples/databases/update-email-attribute.md index 4a9cfc5c..d0dc9893 100644 --- a/docs/examples/databases/update-email-attribute.md +++ b/docs/examples/databases/update-email-attribute.md @@ -14,6 +14,7 @@ const result = await databases.updateEmailAttribute({ required: false, xdefault: 'email@example.com', newKey: '', // optional + description: '', // optional }); console.log(result); diff --git a/docs/examples/databases/update-enum-attribute.md b/docs/examples/databases/update-enum-attribute.md index ffe1b42f..9238bf53 100644 --- a/docs/examples/databases/update-enum-attribute.md +++ b/docs/examples/databases/update-enum-attribute.md @@ -15,6 +15,7 @@ const result = await databases.updateEnumAttribute({ required: false, xdefault: 'active', newKey: '', // optional + description: '', // optional }); console.log(result); diff --git a/docs/examples/databases/update-float-attribute.md b/docs/examples/databases/update-float-attribute.md index 07b91e97..642d55ac 100644 --- a/docs/examples/databases/update-float-attribute.md +++ b/docs/examples/databases/update-float-attribute.md @@ -16,6 +16,7 @@ const result = await databases.updateFloatAttribute({ min: 0, // optional max: 100, // optional newKey: '', // optional + description: '', // optional }); console.log(result); diff --git a/docs/examples/databases/update-integer-attribute.md b/docs/examples/databases/update-integer-attribute.md index 1dad2fd7..3d7d25ed 100644 --- a/docs/examples/databases/update-integer-attribute.md +++ b/docs/examples/databases/update-integer-attribute.md @@ -16,6 +16,7 @@ const result = await databases.updateIntegerAttribute({ min: 0, // optional max: 100, // optional newKey: '', // optional + description: '', // optional }); console.log(result); diff --git a/docs/examples/databases/update-ip-attribute.md b/docs/examples/databases/update-ip-attribute.md index 91e86d48..05c2b6ab 100644 --- a/docs/examples/databases/update-ip-attribute.md +++ b/docs/examples/databases/update-ip-attribute.md @@ -14,6 +14,7 @@ const result = await databases.updateIpAttribute({ required: false, xdefault: '192.0.2.0', newKey: '', // optional + description: '', // optional }); console.log(result); diff --git a/docs/examples/databases/update-line-attribute.md b/docs/examples/databases/update-line-attribute.md index 1e43c8e5..55b5b5c9 100644 --- a/docs/examples/databases/update-line-attribute.md +++ b/docs/examples/databases/update-line-attribute.md @@ -18,6 +18,7 @@ const result = await databases.updateLineAttribute({ [5, 6], ], // optional newKey: '', // optional + description: '', // optional }); console.log(result); diff --git a/docs/examples/databases/update-longtext-attribute.md b/docs/examples/databases/update-longtext-attribute.md index 6b30dc5f..00c9a7d1 100644 --- a/docs/examples/databases/update-longtext-attribute.md +++ b/docs/examples/databases/update-longtext-attribute.md @@ -14,6 +14,7 @@ const result = await databases.updateLongtextAttribute({ required: false, xdefault: 'Hello World', newKey: '', // optional + description: '', // optional }); console.log(result); diff --git a/docs/examples/databases/update-mediumtext-attribute.md b/docs/examples/databases/update-mediumtext-attribute.md index 1e8ec3e3..a219598a 100644 --- a/docs/examples/databases/update-mediumtext-attribute.md +++ b/docs/examples/databases/update-mediumtext-attribute.md @@ -14,6 +14,7 @@ const result = await databases.updateMediumtextAttribute({ required: false, xdefault: 'Hello World', newKey: '', // optional + description: '', // optional }); console.log(result); diff --git a/docs/examples/databases/update-point-attribute.md b/docs/examples/databases/update-point-attribute.md index faa33bef..2d58ce3e 100644 --- a/docs/examples/databases/update-point-attribute.md +++ b/docs/examples/databases/update-point-attribute.md @@ -14,6 +14,7 @@ const result = await databases.updatePointAttribute({ required: false, xdefault: [1, 2], // optional newKey: '', // optional + description: '', // optional }); console.log(result); diff --git a/docs/examples/databases/update-polygon-attribute.md b/docs/examples/databases/update-polygon-attribute.md index c9d40a4d..980a93d7 100644 --- a/docs/examples/databases/update-polygon-attribute.md +++ b/docs/examples/databases/update-polygon-attribute.md @@ -21,6 +21,7 @@ const result = await databases.updatePolygonAttribute({ ], ], // optional newKey: '', // optional + description: '', // optional }); console.log(result); diff --git a/docs/examples/databases/update-relationship-attribute.md b/docs/examples/databases/update-relationship-attribute.md index 40c7c526..fc452954 100644 --- a/docs/examples/databases/update-relationship-attribute.md +++ b/docs/examples/databases/update-relationship-attribute.md @@ -13,6 +13,7 @@ const result = await databases.updateRelationshipAttribute({ key: '', onDelete: RelationMutate.Cascade, // optional newKey: '', // optional + description: '', // optional }); console.log(result); diff --git a/docs/examples/databases/update-string-attribute.md b/docs/examples/databases/update-string-attribute.md index 3fbbd666..f28ece62 100644 --- a/docs/examples/databases/update-string-attribute.md +++ b/docs/examples/databases/update-string-attribute.md @@ -15,6 +15,7 @@ const result = await databases.updateStringAttribute({ xdefault: 'Hello World', size: 1, // optional newKey: '', // optional + description: '', // optional }); console.log(result); diff --git a/docs/examples/databases/update-text-attribute.md b/docs/examples/databases/update-text-attribute.md index 8441402a..64c60431 100644 --- a/docs/examples/databases/update-text-attribute.md +++ b/docs/examples/databases/update-text-attribute.md @@ -14,6 +14,7 @@ const result = await databases.updateTextAttribute({ required: false, xdefault: 'Hello World', newKey: '', // optional + description: '', // optional }); console.log(result); diff --git a/docs/examples/databases/update-url-attribute.md b/docs/examples/databases/update-url-attribute.md index be0192fd..9b971e30 100644 --- a/docs/examples/databases/update-url-attribute.md +++ b/docs/examples/databases/update-url-attribute.md @@ -14,6 +14,7 @@ const result = await databases.updateUrlAttribute({ required: false, xdefault: 'https://example.com', newKey: '', // optional + description: '', // optional }); console.log(result); diff --git a/docs/examples/databases/update-varchar-attribute.md b/docs/examples/databases/update-varchar-attribute.md index aaa7d392..64f02849 100644 --- a/docs/examples/databases/update-varchar-attribute.md +++ b/docs/examples/databases/update-varchar-attribute.md @@ -15,6 +15,7 @@ const result = await databases.updateVarcharAttribute({ xdefault: 'Hello World', size: 1, // optional newKey: '', // optional + description: '', // optional }); console.log(result); diff --git a/docs/examples/databases/update.md b/docs/examples/databases/update.md index dcf5ad0c..86671e61 100644 --- a/docs/examples/databases/update.md +++ b/docs/examples/databases/update.md @@ -11,6 +11,7 @@ const result = await databases.update({ databaseId: '', name: '', // optional enabled: false, // optional + description: '', // optional }); console.log(result); diff --git a/docs/examples/documentsdb/create-collection.md b/docs/examples/documentsdb/create-collection.md index 36938f25..c2490776 100644 --- a/docs/examples/documentsdb/create-collection.md +++ b/docs/examples/documentsdb/create-collection.md @@ -16,6 +16,7 @@ const result = await documentsDB.createCollection({ enabled: false, // optional attributes: [], // optional indexes: [], // optional + description: '', // optional }); console.log(result); diff --git a/docs/examples/documentsdb/create-index.md b/docs/examples/documentsdb/create-index.md index ce61944a..46f05451 100644 --- a/docs/examples/documentsdb/create-index.md +++ b/docs/examples/documentsdb/create-index.md @@ -20,6 +20,7 @@ const result = await documentsDB.createIndex({ attributes: ['username'], orders: [OrderBy.Asc], // optional lengths: [], // optional + description: '', // optional }); console.log(result); diff --git a/docs/examples/documentsdb/create-query.md b/docs/examples/documentsdb/create-query.md new file mode 100644 index 00000000..62784af8 --- /dev/null +++ b/docs/examples/documentsdb/create-query.md @@ -0,0 +1,20 @@ +```javascript +import { Client, DocumentsDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.createQuery({ + databaseId: '', + collectionId: '', + queries: [], // optional + transactionId: '', // optional + total: false, // optional + ttl: 0, // optional +}); + +console.log(result); +``` diff --git a/docs/examples/documentsdb/create.md b/docs/examples/documentsdb/create.md index e6ea3409..51a41916 100644 --- a/docs/examples/documentsdb/create.md +++ b/docs/examples/documentsdb/create.md @@ -11,6 +11,7 @@ const result = await documentsDB.create({ databaseId: '', name: '', enabled: false, // optional + description: '', // optional specification: 'serverless', // optional replicas: 0, // optional syncMode: 'async', // optional diff --git a/docs/examples/documentsdb/update-collection.md b/docs/examples/documentsdb/update-collection.md index 7bbdafc1..d8525519 100644 --- a/docs/examples/documentsdb/update-collection.md +++ b/docs/examples/documentsdb/update-collection.md @@ -15,6 +15,7 @@ const result = await documentsDB.updateCollection({ documentSecurity: false, // optional enabled: false, // optional purge: false, // optional + description: '', // optional }); console.log(result); diff --git a/docs/examples/documentsdb/update.md b/docs/examples/documentsdb/update.md index bda62362..19d68d52 100644 --- a/docs/examples/documentsdb/update.md +++ b/docs/examples/documentsdb/update.md @@ -11,6 +11,7 @@ const result = await documentsDB.update({ databaseId: '', name: '', enabled: false, // optional + description: '', // optional specification: 'serverless', // optional replicas: 0, // optional syncMode: 'async', // optional diff --git a/docs/examples/domains/get-price.md b/docs/examples/domains/get-price.md index 4202f3ea..9bb63ab1 100644 --- a/docs/examples/domains/get-price.md +++ b/docs/examples/domains/get-price.md @@ -9,7 +9,7 @@ const domains = new Domains(client); const result = await domains.getPrice({ domain: 'example.com', - periodYears: null, // optional + periodYears: 1, // optional registrationType: DomainRegistrationType.New, // optional }); diff --git a/docs/examples/domains/list-prices.md b/docs/examples/domains/list-prices.md index 247cfebb..ccceb45f 100644 --- a/docs/examples/domains/list-prices.md +++ b/docs/examples/domains/list-prices.md @@ -9,7 +9,7 @@ const domains = new Domains(client); const result = await domains.listPrices({ domains: [], - periodYears: null, // optional + periodYears: 1, // optional registrationType: DomainRegistrationType.New, // optional }); diff --git a/docs/examples/domains/list-records.md b/docs/examples/domains/list-records.md index eb9657a3..a827cabe 100644 --- a/docs/examples/domains/list-records.md +++ b/docs/examples/domains/list-records.md @@ -10,6 +10,7 @@ const domains = new Domains(client); const result = await domains.listRecords({ domainId: '', queries: [], // optional + total: false, // optional }); console.log(result); diff --git a/docs/examples/domains/list-suggestions.md b/docs/examples/domains/list-suggestions.md index 313c5bd2..111c4f72 100644 --- a/docs/examples/domains/list-suggestions.md +++ b/docs/examples/domains/list-suggestions.md @@ -10,10 +10,10 @@ const domains = new Domains(client); const result = await domains.listSuggestions({ query: '', tlds: [], // optional - limit: null, // optional + limit: 0, // optional filterType: DomainSuggestionType.Premium, // optional - priceMax: null, // optional - priceMin: null, // optional + priceMax: 0, // optional + priceMin: 0, // optional }); console.log(result); diff --git a/docs/examples/domains/list.md b/docs/examples/domains/list.md index c77ab41b..c09671db 100644 --- a/docs/examples/domains/list.md +++ b/docs/examples/domains/list.md @@ -10,6 +10,7 @@ const domains = new Domains(client); const result = await domains.list({ queries: [], // optional search: '', // optional + total: false, // optional }); console.log(result); diff --git a/docs/examples/functions/create-variable.md b/docs/examples/functions/create-variable.md index c70f0376..20f3c5e5 100644 --- a/docs/examples/functions/create-variable.md +++ b/docs/examples/functions/create-variable.md @@ -13,6 +13,7 @@ const result = await functions.createVariable({ key: '', value: '', secret: false, // optional + description: '', // optional }); console.log(result); diff --git a/docs/examples/functions/create.md b/docs/examples/functions/create.md index 38dcc663..9e2b8214 100644 --- a/docs/examples/functions/create.md +++ b/docs/examples/functions/create.md @@ -36,6 +36,7 @@ const result = await functions.create({ runtimeSpecification: 's-1vcpu-512mb', // optional deploymentRetention: 0, // optional interval: 0, // optional + description: '', // optional }); console.log(result); diff --git a/docs/examples/functions/update-variable.md b/docs/examples/functions/update-variable.md index d319ba4a..fabe7f59 100644 --- a/docs/examples/functions/update-variable.md +++ b/docs/examples/functions/update-variable.md @@ -13,6 +13,7 @@ const result = await functions.updateVariable({ key: '', // optional value: '', // optional secret: false, // optional + description: '', // optional }); console.log(result); diff --git a/docs/examples/functions/update.md b/docs/examples/functions/update.md index 504ba736..97256789 100644 --- a/docs/examples/functions/update.md +++ b/docs/examples/functions/update.md @@ -36,6 +36,8 @@ const result = await functions.update({ runtimeSpecification: 's-1vcpu-512mb', // optional deploymentRetention: 0, // optional interval: 0, // optional + description: '', // optional + emailEnabled: false, // optional }); console.log(result); diff --git a/docs/examples/growth/create-installation.md b/docs/examples/growth/create-installation.md index a4fb466c..7254142c 100644 --- a/docs/examples/growth/create-installation.md +++ b/docs/examples/growth/create-installation.md @@ -17,8 +17,8 @@ const result = await growth.createInstallation({ userAgent: '', // optional os: '', // optional arch: '', // optional - cpus: null, // optional - ram: null, // optional + cpus: 0, // optional + ram: 0, // optional }); console.log(result); diff --git a/docs/examples/messaging/create-email.md b/docs/examples/messaging/create-email.md index bed1afc9..5501072b 100644 --- a/docs/examples/messaging/create-email.md +++ b/docs/examples/messaging/create-email.md @@ -17,11 +17,12 @@ const result = await messaging.createEmail({ cc: [], // optional bcc: [], // optional attachments: [], // optional - replyToEmail: 'email@example.com', // optional - replyToName: '', // optional draft: false, // optional html: false, // optional scheduledAt: '2020-10-15T06:38:00.000+00:00', // optional + replyToEmail: 'email@example.com', // optional + replyToName: '', // optional + emails: [], // optional }); console.log(result); diff --git a/docs/examples/messaging/create-topic.md b/docs/examples/messaging/create-topic.md index 1e1247f7..f056c923 100644 --- a/docs/examples/messaging/create-topic.md +++ b/docs/examples/messaging/create-topic.md @@ -13,6 +13,7 @@ const result = await messaging.createTopic({ subscribe: ['any'], // optional qos: 0, // optional expiry: 0, // optional + description: '', // optional }); console.log(result); diff --git a/docs/examples/messaging/update-email.md b/docs/examples/messaging/update-email.md index 81cda404..5d9a881c 100644 --- a/docs/examples/messaging/update-email.md +++ b/docs/examples/messaging/update-email.md @@ -9,19 +9,20 @@ const messaging = new Messaging(client); const result = await messaging.updateEmail({ messageId: '', - subject: '', // optional - content: '', // optional topics: [], // optional users: [], // optional targets: [], // optional + subject: '', // optional + content: '', // optional + draft: false, // optional + html: false, // optional cc: [], // optional bcc: [], // optional + scheduledAt: '2020-10-15T06:38:00.000+00:00', // optional attachments: [], // optional replyToEmail: 'email@example.com', // optional replyToName: '', // optional - draft: false, // optional - html: false, // optional - scheduledAt: '2020-10-15T06:38:00.000+00:00', // optional + emails: [], // optional }); console.log(result); diff --git a/docs/examples/messaging/update-push.md b/docs/examples/messaging/update-push.md index fd95175f..b811c7b4 100644 --- a/docs/examples/messaging/update-push.md +++ b/docs/examples/messaging/update-push.md @@ -9,11 +9,11 @@ const messaging = new Messaging(client); const result = await messaging.updatePush({ messageId: '', - title: '', // optional - body: '<BODY>', // optional topics: [], // optional users: [], // optional targets: [], // optional + title: '<TITLE>', // optional + body: '<BODY>', // optional data: {}, // optional action: '<ACTION>', // optional image: '<ID1:ID2>', // optional diff --git a/docs/examples/messaging/update-sms.md b/docs/examples/messaging/update-sms.md index 68ec42c7..a41f3226 100644 --- a/docs/examples/messaging/update-sms.md +++ b/docs/examples/messaging/update-sms.md @@ -9,10 +9,10 @@ const messaging = new Messaging(client); const result = await messaging.updateSMS({ messageId: '<MESSAGE_ID>', - content: '<CONTENT>', // optional topics: [], // optional users: [], // optional targets: [], // optional + content: '<CONTENT>', // optional draft: false, // optional scheduledAt: '2020-10-15T06:38:00.000+00:00', // optional }); diff --git a/docs/examples/messaging/update-topic.md b/docs/examples/messaging/update-topic.md index ef9c7645..f9e20b2c 100644 --- a/docs/examples/messaging/update-topic.md +++ b/docs/examples/messaging/update-topic.md @@ -13,6 +13,7 @@ const result = await messaging.updateTopic({ subscribe: ['any'], // optional qos: 0, // optional expiry: 0, // optional + description: '<DESCRIPTION>', // optional }); console.log(result); diff --git a/docs/examples/mongo/create-restoration.md b/docs/examples/mongo/create-restoration.md index e84ed883..aad42cc9 100644 --- a/docs/examples/mongo/create-restoration.md +++ b/docs/examples/mongo/create-restoration.md @@ -13,6 +13,9 @@ const result = await mongo.createRestoration({ backupId: '<BACKUP_ID>', // optional targetDatabaseId: '<TARGET_DATABASE_ID>', // optional targetTime: '2020-10-15T06:38:00.000+00:00', // optional + restoreMode: 'in_place', // optional + targetName: '<TARGET_NAME>', // optional + autoPromote: false, // optional }); console.log(result); diff --git a/docs/examples/mongo/list-backup-policies.md b/docs/examples/mongo/list-backup-policies.md index 049af2ad..df411e55 100644 --- a/docs/examples/mongo/list-backup-policies.md +++ b/docs/examples/mongo/list-backup-policies.md @@ -10,6 +10,7 @@ const mongo = new Mongo(client); const result = await mongo.listBackupPolicies({ databaseId: '<DATABASE_ID>', queries: [], // optional + total: false, // optional }); console.log(result); diff --git a/docs/examples/mongo/list-backups.md b/docs/examples/mongo/list-backups.md index d2fd432f..3bf670cb 100644 --- a/docs/examples/mongo/list-backups.md +++ b/docs/examples/mongo/list-backups.md @@ -10,6 +10,7 @@ const mongo = new Mongo(client); const result = await mongo.listBackups({ databaseId: '<DATABASE_ID>', queries: [], // optional + total: false, // optional }); console.log(result); diff --git a/docs/examples/mongo/list.md b/docs/examples/mongo/list.md index a0579d43..a1d2eda2 100644 --- a/docs/examples/mongo/list.md +++ b/docs/examples/mongo/list.md @@ -9,6 +9,7 @@ const mongo = new Mongo(client); const result = await mongo.list({ queries: [], // optional + total: false, // optional }); console.log(result); diff --git a/docs/examples/mongo/promote-restoration.md b/docs/examples/mongo/promote-restoration.md new file mode 100644 index 00000000..b95c4234 --- /dev/null +++ b/docs/examples/mongo/promote-restoration.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Mongo } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const mongo = new Mongo(client); + +const result = await mongo.promoteRestoration({ + databaseId: '<DATABASE_ID>', + restorationId: '<RESTORATION_ID>', +}); + +console.log(result); +``` diff --git a/docs/examples/mysql/create-restoration.md b/docs/examples/mysql/create-restoration.md index 34bd9363..edf23c43 100644 --- a/docs/examples/mysql/create-restoration.md +++ b/docs/examples/mysql/create-restoration.md @@ -13,6 +13,9 @@ const result = await mysql.createRestoration({ backupId: '<BACKUP_ID>', // optional targetDatabaseId: '<TARGET_DATABASE_ID>', // optional targetTime: '2020-10-15T06:38:00.000+00:00', // optional + restoreMode: 'in_place', // optional + targetName: '<TARGET_NAME>', // optional + autoPromote: false, // optional }); console.log(result); diff --git a/docs/examples/mysql/list-backup-policies.md b/docs/examples/mysql/list-backup-policies.md index 8c7ce7c3..8424ea30 100644 --- a/docs/examples/mysql/list-backup-policies.md +++ b/docs/examples/mysql/list-backup-policies.md @@ -10,6 +10,7 @@ const mysql = new Mysql(client); const result = await mysql.listBackupPolicies({ databaseId: '<DATABASE_ID>', queries: [], // optional + total: false, // optional }); console.log(result); diff --git a/docs/examples/mysql/list-backups.md b/docs/examples/mysql/list-backups.md index 8527d0fa..325217d3 100644 --- a/docs/examples/mysql/list-backups.md +++ b/docs/examples/mysql/list-backups.md @@ -10,6 +10,7 @@ const mysql = new Mysql(client); const result = await mysql.listBackups({ databaseId: '<DATABASE_ID>', queries: [], // optional + total: false, // optional }); console.log(result); diff --git a/docs/examples/mysql/list.md b/docs/examples/mysql/list.md index 6df74d0e..5b3e43b3 100644 --- a/docs/examples/mysql/list.md +++ b/docs/examples/mysql/list.md @@ -9,6 +9,7 @@ const mysql = new Mysql(client); const result = await mysql.list({ queries: [], // optional + total: false, // optional }); console.log(result); diff --git a/docs/examples/mysql/promote-restoration.md b/docs/examples/mysql/promote-restoration.md new file mode 100644 index 00000000..af802e9b --- /dev/null +++ b/docs/examples/mysql/promote-restoration.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Mysql } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const mysql = new Mysql(client); + +const result = await mysql.promoteRestoration({ + databaseId: '<DATABASE_ID>', + restorationId: '<RESTORATION_ID>', +}); + +console.log(result); +``` diff --git a/docs/examples/organization/create-project-key.md b/docs/examples/organization/create-project-key.md index 7e9786a8..f9a157cd 100644 --- a/docs/examples/organization/create-project-key.md +++ b/docs/examples/organization/create-project-key.md @@ -13,6 +13,7 @@ const result = await organization.createProjectKey({ name: '<NAME>', scopes: [ProjectKeyScopes.UsersRead], expire: '2020-10-15T06:38:00.000+00:00', // optional + description: '<DESCRIPTION>', // optional }); console.log(result); diff --git a/docs/examples/organization/update-project-key.md b/docs/examples/organization/update-project-key.md index dbb0c7ed..a6b4f41a 100644 --- a/docs/examples/organization/update-project-key.md +++ b/docs/examples/organization/update-project-key.md @@ -13,6 +13,7 @@ const result = await organization.updateProjectKey({ name: '<NAME>', scopes: [ProjectKeyScopes.UsersRead], expire: '2020-10-15T06:38:00.000+00:00', // optional + description: '<DESCRIPTION>', // optional }); console.log(result); diff --git a/docs/examples/organizations/get-aggregation.md b/docs/examples/organizations/get-aggregation.md index aa06495d..cd60e215 100644 --- a/docs/examples/organizations/get-aggregation.md +++ b/docs/examples/organizations/get-aggregation.md @@ -11,7 +11,7 @@ const result = await organizations.getAggregation({ organizationId: '<ORGANIZATION_ID>', aggregationId: '<AGGREGATION_ID>', limit: 0, // optional - offset: null, // optional + offset: 0, // optional }); console.log(result); diff --git a/docs/examples/organizations/list-aggregations.md b/docs/examples/organizations/list-aggregations.md index db0a274b..4c6c1edf 100644 --- a/docs/examples/organizations/list-aggregations.md +++ b/docs/examples/organizations/list-aggregations.md @@ -10,6 +10,7 @@ const organizations = new Organizations(client); const result = await organizations.listAggregations({ organizationId: '<ORGANIZATION_ID>', queries: [], // optional + total: false, // optional }); console.log(result); diff --git a/docs/examples/organizations/list-credits.md b/docs/examples/organizations/list-credits.md index 9475df72..7c158644 100644 --- a/docs/examples/organizations/list-credits.md +++ b/docs/examples/organizations/list-credits.md @@ -10,6 +10,7 @@ const organizations = new Organizations(client); const result = await organizations.listCredits({ organizationId: '<ORGANIZATION_ID>', queries: [], // optional + total: false, // optional }); console.log(result); diff --git a/docs/examples/organizations/list-invoices.md b/docs/examples/organizations/list-invoices.md index 878795f9..c05a6f94 100644 --- a/docs/examples/organizations/list-invoices.md +++ b/docs/examples/organizations/list-invoices.md @@ -10,6 +10,7 @@ const organizations = new Organizations(client); const result = await organizations.listInvoices({ organizationId: '<ORGANIZATION_ID>', queries: [], // optional + total: false, // optional }); console.log(result); diff --git a/docs/examples/organizations/list.md b/docs/examples/organizations/list.md index 974dcf0b..1eaf15af 100644 --- a/docs/examples/organizations/list.md +++ b/docs/examples/organizations/list.md @@ -10,6 +10,7 @@ const organizations = new Organizations(client); const result = await organizations.list({ queries: [], // optional search: '<SEARCH>', // optional + total: false, // optional }); console.log(result); diff --git a/docs/examples/postgresql/create-restoration.md b/docs/examples/postgresql/create-restoration.md index c0695106..819c1593 100644 --- a/docs/examples/postgresql/create-restoration.md +++ b/docs/examples/postgresql/create-restoration.md @@ -13,6 +13,9 @@ const result = await postgresql.createRestoration({ backupId: '<BACKUP_ID>', // optional targetDatabaseId: '<TARGET_DATABASE_ID>', // optional targetTime: '2020-10-15T06:38:00.000+00:00', // optional + restoreMode: 'in_place', // optional + targetName: '<TARGET_NAME>', // optional + autoPromote: false, // optional }); console.log(result); diff --git a/docs/examples/postgresql/list-backup-policies.md b/docs/examples/postgresql/list-backup-policies.md index 10558558..62c402d0 100644 --- a/docs/examples/postgresql/list-backup-policies.md +++ b/docs/examples/postgresql/list-backup-policies.md @@ -10,6 +10,7 @@ const postgresql = new Postgresql(client); const result = await postgresql.listBackupPolicies({ databaseId: '<DATABASE_ID>', queries: [], // optional + total: false, // optional }); console.log(result); diff --git a/docs/examples/postgresql/list-backups.md b/docs/examples/postgresql/list-backups.md index 9911422b..af14263c 100644 --- a/docs/examples/postgresql/list-backups.md +++ b/docs/examples/postgresql/list-backups.md @@ -10,6 +10,7 @@ const postgresql = new Postgresql(client); const result = await postgresql.listBackups({ databaseId: '<DATABASE_ID>', queries: [], // optional + total: false, // optional }); console.log(result); diff --git a/docs/examples/postgresql/list.md b/docs/examples/postgresql/list.md index 9bcdd747..b6651cdb 100644 --- a/docs/examples/postgresql/list.md +++ b/docs/examples/postgresql/list.md @@ -9,6 +9,7 @@ const postgresql = new Postgresql(client); const result = await postgresql.list({ queries: [], // optional + total: false, // optional }); console.log(result); diff --git a/docs/examples/postgresql/promote-restoration.md b/docs/examples/postgresql/promote-restoration.md new file mode 100644 index 00000000..9f04e8b4 --- /dev/null +++ b/docs/examples/postgresql/promote-restoration.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Postgresql } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const postgresql = new Postgresql(client); + +const result = await postgresql.promoteRestoration({ + databaseId: '<DATABASE_ID>', + restorationId: '<RESTORATION_ID>', +}); + +console.log(result); +``` diff --git a/docs/examples/project/create-key.md b/docs/examples/project/create-key.md index d6341200..d9c1df65 100644 --- a/docs/examples/project/create-key.md +++ b/docs/examples/project/create-key.md @@ -12,6 +12,7 @@ const result = await project.createKey({ name: '<NAME>', scopes: [ProjectKeyScopes.UsersRead], expire: '2020-10-15T06:38:00.000+00:00', // optional + description: '<DESCRIPTION>', // optional }); console.log(result); diff --git a/docs/examples/project/create-variable.md b/docs/examples/project/create-variable.md index 2ad86e66..da03d097 100644 --- a/docs/examples/project/create-variable.md +++ b/docs/examples/project/create-variable.md @@ -12,6 +12,7 @@ const result = await project.createVariable({ key: '<KEY>', value: '<VALUE>', secret: false, // optional + description: '<DESCRIPTION>', // optional }); console.log(result); diff --git a/docs/examples/project/update-key.md b/docs/examples/project/update-key.md index 0be53efe..2f8f7054 100644 --- a/docs/examples/project/update-key.md +++ b/docs/examples/project/update-key.md @@ -12,6 +12,7 @@ const result = await project.updateKey({ name: '<NAME>', scopes: [ProjectKeyScopes.UsersRead], expire: '2020-10-15T06:38:00.000+00:00', // optional + description: '<DESCRIPTION>', // optional }); console.log(result); diff --git a/docs/examples/project/update-o-auth-2-apple.md b/docs/examples/project/update-o-auth-2-apple.md index 0c4a52b0..539d4284 100644 --- a/docs/examples/project/update-o-auth-2-apple.md +++ b/docs/examples/project/update-o-auth-2-apple.md @@ -12,8 +12,8 @@ const result = await project.updateOAuth2Apple({ keyId: '<KEY_ID>', // optional teamId: '<TEAM_ID>', // optional p8File: '<P8_FILE>', // optional - nativeClientIds: [], // optional enabled: false, // optional + nativeClientIds: [], // optional nativeEnabled: false, // optional }); diff --git a/docs/examples/project/update-o-auth-2-auth-0.md b/docs/examples/project/update-o-auth-2-auth-0.md index 01abc6ba..ee7a0d2c 100644 --- a/docs/examples/project/update-o-auth-2-auth-0.md +++ b/docs/examples/project/update-o-auth-2-auth-0.md @@ -15,8 +15,8 @@ const result = await project.updateOAuth2Auth0({ clientId: '<CLIENT_ID>', // optional clientSecret: '<CLIENT_SECRET>', // optional endpoint: '<ENDPOINT>', // optional - prompt: [ProjectOAuth2Auth0Prompt.None], // optional enabled: false, // optional + prompt: [ProjectOAuth2Auth0Prompt.None], // optional }); console.log(result); diff --git a/docs/examples/project/update-o-auth-2-discord.md b/docs/examples/project/update-o-auth-2-discord.md index fc7aaa09..1e8f7f12 100644 --- a/docs/examples/project/update-o-auth-2-discord.md +++ b/docs/examples/project/update-o-auth-2-discord.md @@ -14,8 +14,8 @@ const project = new Project(client); const result = await project.updateOAuth2Discord({ clientId: '<CLIENT_ID>', // optional clientSecret: '<CLIENT_SECRET>', // optional - prompt: [ProjectOAuth2DiscordPrompt.None], // optional enabled: false, // optional + prompt: [ProjectOAuth2DiscordPrompt.None], // optional }); console.log(result); diff --git a/docs/examples/project/update-o-auth-2-git-hub.md b/docs/examples/project/update-o-auth-2-git-hub.md index 0c4e2045..be4c2f2c 100644 --- a/docs/examples/project/update-o-auth-2-git-hub.md +++ b/docs/examples/project/update-o-auth-2-git-hub.md @@ -14,8 +14,8 @@ const project = new Project(client); const result = await project.updateOAuth2GitHub({ clientId: '<CLIENT_ID>', // optional clientSecret: '<CLIENT_SECRET>', // optional - prompt: [ProjectOAuth2GitHubPrompt.SelectAccount], // optional enabled: false, // optional + prompt: [ProjectOAuth2GitHubPrompt.SelectAccount], // optional }); console.log(result); diff --git a/docs/examples/project/update-o-auth-2-google.md b/docs/examples/project/update-o-auth-2-google.md index c0bbe651..b743a9e2 100644 --- a/docs/examples/project/update-o-auth-2-google.md +++ b/docs/examples/project/update-o-auth-2-google.md @@ -15,8 +15,8 @@ const result = await project.updateOAuth2Google({ clientId: '<CLIENT_ID>', // optional clientSecret: '<CLIENT_SECRET>', // optional prompt: [ProjectOAuth2GooglePrompt.None], // optional - nativeClientIds: [], // optional enabled: false, // optional + nativeClientIds: [], // optional nativeEnabled: false, // optional }); diff --git a/docs/examples/project/update-o-auth-2-kakao.md b/docs/examples/project/update-o-auth-2-kakao.md index cf304988..dbc59b93 100644 --- a/docs/examples/project/update-o-auth-2-kakao.md +++ b/docs/examples/project/update-o-auth-2-kakao.md @@ -14,8 +14,8 @@ const project = new Project(client); const result = await project.updateOAuth2Kakao({ clientId: '<CLIENT_ID>', // optional clientSecret: '<CLIENT_SECRET>', // optional - prompt: [ProjectOAuth2KakaoPrompt.None], // optional enabled: false, // optional + prompt: [ProjectOAuth2KakaoPrompt.None], // optional }); console.log(result); diff --git a/docs/examples/project/update-o-auth-2-microsoft.md b/docs/examples/project/update-o-auth-2-microsoft.md index 9bbbfa13..715cb247 100644 --- a/docs/examples/project/update-o-auth-2-microsoft.md +++ b/docs/examples/project/update-o-auth-2-microsoft.md @@ -15,8 +15,8 @@ const result = await project.updateOAuth2Microsoft({ applicationId: '<APPLICATION_ID>', // optional applicationSecret: '<APPLICATION_SECRET>', // optional tenant: '<TENANT>', // optional - prompt: [ProjectOAuth2MicrosoftPrompt.None], // optional enabled: false, // optional + prompt: [ProjectOAuth2MicrosoftPrompt.None], // optional }); console.log(result); diff --git a/docs/examples/project/update-o-auth-2-okta.md b/docs/examples/project/update-o-auth-2-okta.md index da983aca..095239ae 100644 --- a/docs/examples/project/update-o-auth-2-okta.md +++ b/docs/examples/project/update-o-auth-2-okta.md @@ -12,8 +12,8 @@ const result = await project.updateOAuth2Okta({ clientSecret: '<CLIENT_SECRET>', // optional domain: 'example.com', // optional authorizationServerId: '<AUTHORIZATION_SERVER_ID>', // optional - prompt: [ProjectOAuth2OktaPrompt.None], // optional enabled: false, // optional + prompt: [ProjectOAuth2OktaPrompt.None], // optional }); console.log(result); diff --git a/docs/examples/project/update-o-auth-2-salesforce.md b/docs/examples/project/update-o-auth-2-salesforce.md index 8b19d764..4dcd22df 100644 --- a/docs/examples/project/update-o-auth-2-salesforce.md +++ b/docs/examples/project/update-o-auth-2-salesforce.md @@ -14,8 +14,8 @@ const project = new Project(client); const result = await project.updateOAuth2Salesforce({ customerKey: '<CUSTOMER_KEY>', // optional customerSecret: '<CUSTOMER_SECRET>', // optional - prompt: [ProjectOAuth2SalesforcePrompt.Login], // optional enabled: false, // optional + prompt: [ProjectOAuth2SalesforcePrompt.Login], // optional }); console.log(result); diff --git a/docs/examples/project/update-o-auth-2-zoho.md b/docs/examples/project/update-o-auth-2-zoho.md index 524d1185..d042ca57 100644 --- a/docs/examples/project/update-o-auth-2-zoho.md +++ b/docs/examples/project/update-o-auth-2-zoho.md @@ -10,8 +10,8 @@ const project = new Project(client); const result = await project.updateOAuth2Zoho({ clientId: '<CLIENT_ID>', // optional clientSecret: '<CLIENT_SECRET>', // optional - prompt: [ProjectOAuth2ZohoPrompt.Consent], // optional enabled: false, // optional + prompt: [ProjectOAuth2ZohoPrompt.Consent], // optional }); console.log(result); diff --git a/docs/examples/project/update-password-dictionary-policy.md b/docs/examples/project/update-password-dictionary-policy.md index b89a5885..bb95fb01 100644 --- a/docs/examples/project/update-password-dictionary-policy.md +++ b/docs/examples/project/update-password-dictionary-policy.md @@ -9,6 +9,7 @@ const project = new Project(client); const result = await project.updatePasswordDictionaryPolicy({ enabled: false, + denyList: [], // optional }); console.log(result); diff --git a/docs/examples/project/update-password-personal-data-policy.md b/docs/examples/project/update-password-personal-data-policy.md index ac5aad7c..aaf758f5 100644 --- a/docs/examples/project/update-password-personal-data-policy.md +++ b/docs/examples/project/update-password-personal-data-policy.md @@ -9,6 +9,7 @@ const project = new Project(client); const result = await project.updatePasswordPersonalDataPolicy({ enabled: false, + denyList: [], // optional }); console.log(result); diff --git a/docs/examples/project/update-variable.md b/docs/examples/project/update-variable.md index 32668c6b..6d03afc0 100644 --- a/docs/examples/project/update-variable.md +++ b/docs/examples/project/update-variable.md @@ -12,6 +12,7 @@ const result = await project.updateVariable({ key: '<KEY>', // optional value: '<VALUE>', // optional secret: false, // optional + description: '<DESCRIPTION>', // optional }); console.log(result); diff --git a/docs/examples/proxy/create-smtp-rule.md b/docs/examples/proxy/create-smtp-rule.md new file mode 100644 index 00000000..38ce726b --- /dev/null +++ b/docs/examples/proxy/create-smtp-rule.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Proxy } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const proxy = new Proxy(client); + +const result = await proxy.createSMTPRule({ + domain: 'example.com', + functionId: '<FUNCTION_ID>', + branch: '<BRANCH>', // optional +}); + +console.log(result); +``` diff --git a/docs/examples/sites/create-variable.md b/docs/examples/sites/create-variable.md index 05afb1ff..2c5bfdd8 100644 --- a/docs/examples/sites/create-variable.md +++ b/docs/examples/sites/create-variable.md @@ -13,6 +13,7 @@ const result = await sites.createVariable({ key: '<KEY>', value: '<VALUE>', secret: false, // optional + description: '<DESCRIPTION>', // optional }); console.log(result); diff --git a/docs/examples/sites/create.md b/docs/examples/sites/create.md index 724ea523..4dd2c242 100644 --- a/docs/examples/sites/create.md +++ b/docs/examples/sites/create.md @@ -39,6 +39,7 @@ const result = await sites.create({ runtimeSpecification: 's-1vcpu-512mb', // optional deploymentRetention: 0, // optional scopes: [ProjectKeyScopes.ProjectRead], // optional + description: '<DESCRIPTION>', // optional }); console.log(result); diff --git a/docs/examples/sites/update-variable.md b/docs/examples/sites/update-variable.md index acf0bcf0..bac4739b 100644 --- a/docs/examples/sites/update-variable.md +++ b/docs/examples/sites/update-variable.md @@ -13,6 +13,7 @@ const result = await sites.updateVariable({ key: '<KEY>', // optional value: '<VALUE>', // optional secret: false, // optional + description: '<DESCRIPTION>', // optional }); console.log(result); diff --git a/docs/examples/sites/update.md b/docs/examples/sites/update.md index 36e66d82..8c5c509c 100644 --- a/docs/examples/sites/update.md +++ b/docs/examples/sites/update.md @@ -39,6 +39,7 @@ const result = await sites.update({ runtimeSpecification: 's-1vcpu-512mb', // optional deploymentRetention: 0, // optional scopes: [ProjectKeyScopes.ProjectRead], // optional + description: '<DESCRIPTION>', // optional }); console.log(result); diff --git a/docs/examples/storage/create-bucket.md b/docs/examples/storage/create-bucket.md index e55136f3..cbe7944b 100644 --- a/docs/examples/storage/create-bucket.md +++ b/docs/examples/storage/create-bucket.md @@ -25,6 +25,7 @@ const result = await storage.createBucket({ encryption: false, // optional antivirus: false, // optional transformations: false, // optional + description: '<DESCRIPTION>', // optional }); console.log(result); diff --git a/docs/examples/storage/update-bucket.md b/docs/examples/storage/update-bucket.md index 6816d592..21db7758 100644 --- a/docs/examples/storage/update-bucket.md +++ b/docs/examples/storage/update-bucket.md @@ -25,6 +25,7 @@ const result = await storage.updateBucket({ encryption: false, // optional antivirus: false, // optional transformations: false, // optional + description: '<DESCRIPTION>', // optional }); console.log(result); diff --git a/docs/examples/tablesdb/create-big-int-column.md b/docs/examples/tablesdb/create-big-int-column.md index ff6fa989..4939c015 100644 --- a/docs/examples/tablesdb/create-big-int-column.md +++ b/docs/examples/tablesdb/create-big-int-column.md @@ -16,6 +16,7 @@ const result = await tablesDB.createBigIntColumn({ max: 1000000, // optional xdefault: 0, // optional array: false, // optional + description: '<DESCRIPTION>', // optional }); console.log(result); diff --git a/docs/examples/tablesdb/create-boolean-column.md b/docs/examples/tablesdb/create-boolean-column.md index bff59103..0c4627f8 100644 --- a/docs/examples/tablesdb/create-boolean-column.md +++ b/docs/examples/tablesdb/create-boolean-column.md @@ -14,6 +14,7 @@ const result = await tablesDB.createBooleanColumn({ required: false, xdefault: false, // optional array: false, // optional + description: '<DESCRIPTION>', // optional }); console.log(result); diff --git a/docs/examples/tablesdb/create-datetime-column.md b/docs/examples/tablesdb/create-datetime-column.md index cc9e87f3..d50924cf 100644 --- a/docs/examples/tablesdb/create-datetime-column.md +++ b/docs/examples/tablesdb/create-datetime-column.md @@ -14,6 +14,7 @@ const result = await tablesDB.createDatetimeColumn({ required: false, xdefault: '2020-10-15T06:38:00.000+00:00', // optional array: false, // optional + description: '<DESCRIPTION>', // optional }); console.log(result); diff --git a/docs/examples/tablesdb/create-email-column.md b/docs/examples/tablesdb/create-email-column.md index 53c7430b..4a1dd73b 100644 --- a/docs/examples/tablesdb/create-email-column.md +++ b/docs/examples/tablesdb/create-email-column.md @@ -14,6 +14,7 @@ const result = await tablesDB.createEmailColumn({ required: false, xdefault: 'email@example.com', // optional array: false, // optional + description: '<DESCRIPTION>', // optional }); console.log(result); diff --git a/docs/examples/tablesdb/create-enum-column.md b/docs/examples/tablesdb/create-enum-column.md index 520a828e..e5b5940d 100644 --- a/docs/examples/tablesdb/create-enum-column.md +++ b/docs/examples/tablesdb/create-enum-column.md @@ -15,6 +15,7 @@ const result = await tablesDB.createEnumColumn({ required: false, xdefault: 'active', // optional array: false, // optional + description: '<DESCRIPTION>', // optional }); console.log(result); diff --git a/docs/examples/tablesdb/create-float-column.md b/docs/examples/tablesdb/create-float-column.md index 3852dfbe..6903a046 100644 --- a/docs/examples/tablesdb/create-float-column.md +++ b/docs/examples/tablesdb/create-float-column.md @@ -16,6 +16,7 @@ const result = await tablesDB.createFloatColumn({ max: 100, // optional xdefault: 10.5, // optional array: false, // optional + description: '<DESCRIPTION>', // optional }); console.log(result); diff --git a/docs/examples/tablesdb/create-index.md b/docs/examples/tablesdb/create-index.md index 629a8ef1..379cdf55 100644 --- a/docs/examples/tablesdb/create-index.md +++ b/docs/examples/tablesdb/create-index.md @@ -20,6 +20,7 @@ const result = await tablesDB.createIndex({ columns: ['username'], orders: [OrderBy.Asc], // optional lengths: [], // optional + description: '<DESCRIPTION>', // optional }); console.log(result); diff --git a/docs/examples/tablesdb/create-integer-column.md b/docs/examples/tablesdb/create-integer-column.md index c2c1c243..c6f99c47 100644 --- a/docs/examples/tablesdb/create-integer-column.md +++ b/docs/examples/tablesdb/create-integer-column.md @@ -16,6 +16,7 @@ const result = await tablesDB.createIntegerColumn({ max: 100, // optional xdefault: 10, // optional array: false, // optional + description: '<DESCRIPTION>', // optional }); console.log(result); diff --git a/docs/examples/tablesdb/create-ip-column.md b/docs/examples/tablesdb/create-ip-column.md index bc09d737..7147fc92 100644 --- a/docs/examples/tablesdb/create-ip-column.md +++ b/docs/examples/tablesdb/create-ip-column.md @@ -14,6 +14,7 @@ const result = await tablesDB.createIpColumn({ required: false, xdefault: '192.0.2.0', // optional array: false, // optional + description: '<DESCRIPTION>', // optional }); console.log(result); diff --git a/docs/examples/tablesdb/create-line-column.md b/docs/examples/tablesdb/create-line-column.md index f82ce197..80e1ad82 100644 --- a/docs/examples/tablesdb/create-line-column.md +++ b/docs/examples/tablesdb/create-line-column.md @@ -17,6 +17,7 @@ const result = await tablesDB.createLineColumn({ [3, 4], [5, 6], ], // optional + description: '<DESCRIPTION>', // optional }); console.log(result); diff --git a/docs/examples/tablesdb/create-longtext-column.md b/docs/examples/tablesdb/create-longtext-column.md index 5bc3c7bf..df199669 100644 --- a/docs/examples/tablesdb/create-longtext-column.md +++ b/docs/examples/tablesdb/create-longtext-column.md @@ -15,6 +15,7 @@ const result = await tablesDB.createLongtextColumn({ xdefault: 'Hello World', // optional array: false, // optional encrypt: false, // optional + description: '<DESCRIPTION>', // optional }); console.log(result); diff --git a/docs/examples/tablesdb/create-mediumtext-column.md b/docs/examples/tablesdb/create-mediumtext-column.md index 474fd9b2..6260be13 100644 --- a/docs/examples/tablesdb/create-mediumtext-column.md +++ b/docs/examples/tablesdb/create-mediumtext-column.md @@ -15,6 +15,7 @@ const result = await tablesDB.createMediumtextColumn({ xdefault: 'Hello World', // optional array: false, // optional encrypt: false, // optional + description: '<DESCRIPTION>', // optional }); console.log(result); diff --git a/docs/examples/tablesdb/create-point-column.md b/docs/examples/tablesdb/create-point-column.md index 1e159139..b60cbfce 100644 --- a/docs/examples/tablesdb/create-point-column.md +++ b/docs/examples/tablesdb/create-point-column.md @@ -13,6 +13,7 @@ const result = await tablesDB.createPointColumn({ key: '<KEY>', required: false, xdefault: [1, 2], // optional + description: '<DESCRIPTION>', // optional }); console.log(result); diff --git a/docs/examples/tablesdb/create-polygon-column.md b/docs/examples/tablesdb/create-polygon-column.md index ad5a21ba..76195afe 100644 --- a/docs/examples/tablesdb/create-polygon-column.md +++ b/docs/examples/tablesdb/create-polygon-column.md @@ -20,6 +20,7 @@ const result = await tablesDB.createPolygonColumn({ [1, 2], ], ], // optional + description: '<DESCRIPTION>', // optional }); console.log(result); diff --git a/docs/examples/tablesdb/create-query.md b/docs/examples/tablesdb/create-query.md new file mode 100644 index 00000000..6436fda8 --- /dev/null +++ b/docs/examples/tablesdb/create-query.md @@ -0,0 +1,20 @@ +```javascript +import { Client, TablesDB } from '@appwrite.io/console'; + +const client = new Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const tablesDB = new TablesDB(client); + +const result = await tablesDB.createQuery({ + databaseId: '<DATABASE_ID>', + tableId: '<TABLE_ID>', + queries: [], // optional + transactionId: '<TRANSACTION_ID>', // optional + total: false, // optional + ttl: 0, // optional +}); + +console.log(result); +``` diff --git a/docs/examples/tablesdb/create-relationship-column.md b/docs/examples/tablesdb/create-relationship-column.md index 92d4fcda..43a41163 100644 --- a/docs/examples/tablesdb/create-relationship-column.md +++ b/docs/examples/tablesdb/create-relationship-column.md @@ -21,6 +21,7 @@ const result = await tablesDB.createRelationshipColumn({ key: '<KEY>', // optional twoWayKey: '<TWO_WAY_KEY>', // optional onDelete: RelationMutate.Cascade, // optional + description: '<DESCRIPTION>', // optional }); console.log(result); diff --git a/docs/examples/tablesdb/create-string-column.md b/docs/examples/tablesdb/create-string-column.md index be030ae1..ad877d1d 100644 --- a/docs/examples/tablesdb/create-string-column.md +++ b/docs/examples/tablesdb/create-string-column.md @@ -16,6 +16,7 @@ const result = await tablesDB.createStringColumn({ xdefault: 'Hello World', // optional array: false, // optional encrypt: false, // optional + description: '<DESCRIPTION>', // optional }); console.log(result); diff --git a/docs/examples/tablesdb/create-table.md b/docs/examples/tablesdb/create-table.md index 9d213ce4..5505943f 100644 --- a/docs/examples/tablesdb/create-table.md +++ b/docs/examples/tablesdb/create-table.md @@ -16,6 +16,7 @@ const result = await tablesDB.createTable({ enabled: false, // optional columns: [], // optional indexes: [], // optional + description: '<DESCRIPTION>', // optional }); console.log(result); diff --git a/docs/examples/tablesdb/create-text-column.md b/docs/examples/tablesdb/create-text-column.md index 71febf91..24361d60 100644 --- a/docs/examples/tablesdb/create-text-column.md +++ b/docs/examples/tablesdb/create-text-column.md @@ -15,6 +15,7 @@ const result = await tablesDB.createTextColumn({ xdefault: 'Hello World', // optional array: false, // optional encrypt: false, // optional + description: '<DESCRIPTION>', // optional }); console.log(result); diff --git a/docs/examples/tablesdb/create-url-column.md b/docs/examples/tablesdb/create-url-column.md index 93b4ef88..d9ffc36a 100644 --- a/docs/examples/tablesdb/create-url-column.md +++ b/docs/examples/tablesdb/create-url-column.md @@ -14,6 +14,7 @@ const result = await tablesDB.createUrlColumn({ required: false, xdefault: 'https://example.com', // optional array: false, // optional + description: '<DESCRIPTION>', // optional }); console.log(result); diff --git a/docs/examples/tablesdb/create-varchar-column.md b/docs/examples/tablesdb/create-varchar-column.md index 039cc055..5d468b38 100644 --- a/docs/examples/tablesdb/create-varchar-column.md +++ b/docs/examples/tablesdb/create-varchar-column.md @@ -16,6 +16,7 @@ const result = await tablesDB.createVarcharColumn({ xdefault: 'Hello World', // optional array: false, // optional encrypt: false, // optional + description: '<DESCRIPTION>', // optional }); console.log(result); diff --git a/docs/examples/tablesdb/create.md b/docs/examples/tablesdb/create.md index 5ed38dcd..d8c23292 100644 --- a/docs/examples/tablesdb/create.md +++ b/docs/examples/tablesdb/create.md @@ -11,6 +11,7 @@ const result = await tablesDB.create({ databaseId: '<DATABASE_ID>', name: '<NAME>', enabled: false, // optional + description: '<DESCRIPTION>', // optional specification: 'serverless', // optional replicas: 0, // optional syncMode: 'async', // optional diff --git a/docs/examples/tablesdb/update-big-int-column.md b/docs/examples/tablesdb/update-big-int-column.md index a8dcfb24..57029a4b 100644 --- a/docs/examples/tablesdb/update-big-int-column.md +++ b/docs/examples/tablesdb/update-big-int-column.md @@ -16,6 +16,7 @@ const result = await tablesDB.updateBigIntColumn({ min: 0, // optional max: 1000000, // optional newKey: '<NEW_KEY>', // optional + description: '<DESCRIPTION>', // optional }); console.log(result); diff --git a/docs/examples/tablesdb/update-boolean-column.md b/docs/examples/tablesdb/update-boolean-column.md index 3f1f2904..a2ebce86 100644 --- a/docs/examples/tablesdb/update-boolean-column.md +++ b/docs/examples/tablesdb/update-boolean-column.md @@ -14,6 +14,7 @@ const result = await tablesDB.updateBooleanColumn({ required: false, xdefault: false, newKey: '<NEW_KEY>', // optional + description: '<DESCRIPTION>', // optional }); console.log(result); diff --git a/docs/examples/tablesdb/update-datetime-column.md b/docs/examples/tablesdb/update-datetime-column.md index 218744e0..fb03e6ad 100644 --- a/docs/examples/tablesdb/update-datetime-column.md +++ b/docs/examples/tablesdb/update-datetime-column.md @@ -14,6 +14,7 @@ const result = await tablesDB.updateDatetimeColumn({ required: false, xdefault: '2020-10-15T06:38:00.000+00:00', newKey: '<NEW_KEY>', // optional + description: '<DESCRIPTION>', // optional }); console.log(result); diff --git a/docs/examples/tablesdb/update-email-column.md b/docs/examples/tablesdb/update-email-column.md index c5529460..c102fba8 100644 --- a/docs/examples/tablesdb/update-email-column.md +++ b/docs/examples/tablesdb/update-email-column.md @@ -14,6 +14,7 @@ const result = await tablesDB.updateEmailColumn({ required: false, xdefault: 'email@example.com', newKey: '<NEW_KEY>', // optional + description: '<DESCRIPTION>', // optional }); console.log(result); diff --git a/docs/examples/tablesdb/update-enum-column.md b/docs/examples/tablesdb/update-enum-column.md index c85d5002..dd76ba96 100644 --- a/docs/examples/tablesdb/update-enum-column.md +++ b/docs/examples/tablesdb/update-enum-column.md @@ -15,6 +15,7 @@ const result = await tablesDB.updateEnumColumn({ required: false, xdefault: 'active', newKey: '<NEW_KEY>', // optional + description: '<DESCRIPTION>', // optional }); console.log(result); diff --git a/docs/examples/tablesdb/update-float-column.md b/docs/examples/tablesdb/update-float-column.md index ec3da21c..daebd445 100644 --- a/docs/examples/tablesdb/update-float-column.md +++ b/docs/examples/tablesdb/update-float-column.md @@ -16,6 +16,7 @@ const result = await tablesDB.updateFloatColumn({ min: 0, // optional max: 100, // optional newKey: '<NEW_KEY>', // optional + description: '<DESCRIPTION>', // optional }); console.log(result); diff --git a/docs/examples/tablesdb/update-integer-column.md b/docs/examples/tablesdb/update-integer-column.md index a24c4e32..f56392cc 100644 --- a/docs/examples/tablesdb/update-integer-column.md +++ b/docs/examples/tablesdb/update-integer-column.md @@ -16,6 +16,7 @@ const result = await tablesDB.updateIntegerColumn({ min: 0, // optional max: 100, // optional newKey: '<NEW_KEY>', // optional + description: '<DESCRIPTION>', // optional }); console.log(result); diff --git a/docs/examples/tablesdb/update-ip-column.md b/docs/examples/tablesdb/update-ip-column.md index 74aa61f4..40efe021 100644 --- a/docs/examples/tablesdb/update-ip-column.md +++ b/docs/examples/tablesdb/update-ip-column.md @@ -14,6 +14,7 @@ const result = await tablesDB.updateIpColumn({ required: false, xdefault: '192.0.2.0', newKey: '<NEW_KEY>', // optional + description: '<DESCRIPTION>', // optional }); console.log(result); diff --git a/docs/examples/tablesdb/update-line-column.md b/docs/examples/tablesdb/update-line-column.md index 79385a3a..3a024ba9 100644 --- a/docs/examples/tablesdb/update-line-column.md +++ b/docs/examples/tablesdb/update-line-column.md @@ -18,6 +18,7 @@ const result = await tablesDB.updateLineColumn({ [5, 6], ], // optional newKey: '<NEW_KEY>', // optional + description: '<DESCRIPTION>', // optional }); console.log(result); diff --git a/docs/examples/tablesdb/update-longtext-column.md b/docs/examples/tablesdb/update-longtext-column.md index 4d862abf..25ccefe1 100644 --- a/docs/examples/tablesdb/update-longtext-column.md +++ b/docs/examples/tablesdb/update-longtext-column.md @@ -14,6 +14,7 @@ const result = await tablesDB.updateLongtextColumn({ required: false, xdefault: 'Hello World', newKey: '<NEW_KEY>', // optional + description: '<DESCRIPTION>', // optional }); console.log(result); diff --git a/docs/examples/tablesdb/update-mediumtext-column.md b/docs/examples/tablesdb/update-mediumtext-column.md index 040d78c2..7b13bf13 100644 --- a/docs/examples/tablesdb/update-mediumtext-column.md +++ b/docs/examples/tablesdb/update-mediumtext-column.md @@ -14,6 +14,7 @@ const result = await tablesDB.updateMediumtextColumn({ required: false, xdefault: 'Hello World', newKey: '<NEW_KEY>', // optional + description: '<DESCRIPTION>', // optional }); console.log(result); diff --git a/docs/examples/tablesdb/update-point-column.md b/docs/examples/tablesdb/update-point-column.md index 636e5667..f105db3b 100644 --- a/docs/examples/tablesdb/update-point-column.md +++ b/docs/examples/tablesdb/update-point-column.md @@ -14,6 +14,7 @@ const result = await tablesDB.updatePointColumn({ required: false, xdefault: [1, 2], // optional newKey: '<NEW_KEY>', // optional + description: '<DESCRIPTION>', // optional }); console.log(result); diff --git a/docs/examples/tablesdb/update-polygon-column.md b/docs/examples/tablesdb/update-polygon-column.md index 8ed64623..f2a78bb8 100644 --- a/docs/examples/tablesdb/update-polygon-column.md +++ b/docs/examples/tablesdb/update-polygon-column.md @@ -21,6 +21,7 @@ const result = await tablesDB.updatePolygonColumn({ ], ], // optional newKey: '<NEW_KEY>', // optional + description: '<DESCRIPTION>', // optional }); console.log(result); diff --git a/docs/examples/tablesdb/update-relationship-column.md b/docs/examples/tablesdb/update-relationship-column.md index 77d2035d..07e490f9 100644 --- a/docs/examples/tablesdb/update-relationship-column.md +++ b/docs/examples/tablesdb/update-relationship-column.md @@ -13,6 +13,7 @@ const result = await tablesDB.updateRelationshipColumn({ key: '<KEY>', onDelete: RelationMutate.Cascade, // optional newKey: '<NEW_KEY>', // optional + description: '<DESCRIPTION>', // optional }); console.log(result); diff --git a/docs/examples/tablesdb/update-string-column.md b/docs/examples/tablesdb/update-string-column.md index 817ca449..499ba4de 100644 --- a/docs/examples/tablesdb/update-string-column.md +++ b/docs/examples/tablesdb/update-string-column.md @@ -15,6 +15,7 @@ const result = await tablesDB.updateStringColumn({ xdefault: 'Hello World', size: 1, // optional newKey: '<NEW_KEY>', // optional + description: '<DESCRIPTION>', // optional }); console.log(result); diff --git a/docs/examples/tablesdb/update-table.md b/docs/examples/tablesdb/update-table.md index 7d382d43..d0ca897d 100644 --- a/docs/examples/tablesdb/update-table.md +++ b/docs/examples/tablesdb/update-table.md @@ -15,6 +15,7 @@ const result = await tablesDB.updateTable({ rowSecurity: false, // optional enabled: false, // optional purge: false, // optional + description: '<DESCRIPTION>', // optional }); console.log(result); diff --git a/docs/examples/tablesdb/update-text-column.md b/docs/examples/tablesdb/update-text-column.md index ac46a962..943c3e9a 100644 --- a/docs/examples/tablesdb/update-text-column.md +++ b/docs/examples/tablesdb/update-text-column.md @@ -14,6 +14,7 @@ const result = await tablesDB.updateTextColumn({ required: false, xdefault: 'Hello World', newKey: '<NEW_KEY>', // optional + description: '<DESCRIPTION>', // optional }); console.log(result); diff --git a/docs/examples/tablesdb/update-url-column.md b/docs/examples/tablesdb/update-url-column.md index 14fbf3df..b357465c 100644 --- a/docs/examples/tablesdb/update-url-column.md +++ b/docs/examples/tablesdb/update-url-column.md @@ -14,6 +14,7 @@ const result = await tablesDB.updateUrlColumn({ required: false, xdefault: 'https://example.com', newKey: '<NEW_KEY>', // optional + description: '<DESCRIPTION>', // optional }); console.log(result); diff --git a/docs/examples/tablesdb/update-varchar-column.md b/docs/examples/tablesdb/update-varchar-column.md index ec04fb45..53069884 100644 --- a/docs/examples/tablesdb/update-varchar-column.md +++ b/docs/examples/tablesdb/update-varchar-column.md @@ -15,6 +15,7 @@ const result = await tablesDB.updateVarcharColumn({ xdefault: 'Hello World', size: 1, // optional newKey: '<NEW_KEY>', // optional + description: '<DESCRIPTION>', // optional }); console.log(result); diff --git a/docs/examples/tablesdb/update.md b/docs/examples/tablesdb/update.md index 55a7959e..e96c6a3f 100644 --- a/docs/examples/tablesdb/update.md +++ b/docs/examples/tablesdb/update.md @@ -11,6 +11,7 @@ const result = await tablesDB.update({ databaseId: '<DATABASE_ID>', name: '<NAME>', // optional enabled: false, // optional + description: '<DESCRIPTION>', // optional specification: 'serverless', // optional replicas: 0, // optional syncMode: 'async', // optional diff --git a/docs/examples/vectorsdb/create-collection.md b/docs/examples/vectorsdb/create-collection.md index 12996a2c..7d51eba5 100644 --- a/docs/examples/vectorsdb/create-collection.md +++ b/docs/examples/vectorsdb/create-collection.md @@ -15,6 +15,7 @@ const result = await vectorsDB.createCollection({ permissions: [Permission.read(Role.any())], // optional documentSecurity: false, // optional enabled: false, // optional + description: '<DESCRIPTION>', // optional }); console.log(result); diff --git a/docs/examples/vectorsdb/create-index.md b/docs/examples/vectorsdb/create-index.md index d02efaeb..293b1281 100644 --- a/docs/examples/vectorsdb/create-index.md +++ b/docs/examples/vectorsdb/create-index.md @@ -20,6 +20,7 @@ const result = await vectorsDB.createIndex({ attributes: ['embeddings'], orders: [OrderBy.Asc], // optional lengths: [], // optional + description: '<DESCRIPTION>', // optional }); console.log(result); diff --git a/docs/examples/vectorsdb/create.md b/docs/examples/vectorsdb/create.md index 1bc26e0c..99909784 100644 --- a/docs/examples/vectorsdb/create.md +++ b/docs/examples/vectorsdb/create.md @@ -11,6 +11,7 @@ const result = await vectorsDB.create({ databaseId: '<DATABASE_ID>', name: '<NAME>', enabled: false, // optional + description: '<DESCRIPTION>', // optional specification: 'serverless', // optional replicas: 0, // optional syncMode: 'async', // optional diff --git a/docs/examples/vectorsdb/update-collection.md b/docs/examples/vectorsdb/update-collection.md index afa2d357..bc52aeaa 100644 --- a/docs/examples/vectorsdb/update-collection.md +++ b/docs/examples/vectorsdb/update-collection.md @@ -15,6 +15,7 @@ const result = await vectorsDB.updateCollection({ permissions: [Permission.read(Role.any())], // optional documentSecurity: false, // optional enabled: false, // optional + description: '<DESCRIPTION>', // optional }); console.log(result); diff --git a/docs/examples/vectorsdb/update.md b/docs/examples/vectorsdb/update.md index ee930ec7..7faa3e57 100644 --- a/docs/examples/vectorsdb/update.md +++ b/docs/examples/vectorsdb/update.md @@ -11,6 +11,7 @@ const result = await vectorsDB.update({ databaseId: '<DATABASE_ID>', name: '<NAME>', enabled: false, // optional + description: '<DESCRIPTION>', // optional specification: 'serverless', // optional replicas: 0, // optional syncMode: 'async', // optional diff --git a/docs/examples/webhooks/create.md b/docs/examples/webhooks/create.md index 39301365..ecc0ed12 100644 --- a/docs/examples/webhooks/create.md +++ b/docs/examples/webhooks/create.md @@ -17,6 +17,7 @@ const result = await webhooks.create({ authUsername: '<AUTH_USERNAME>', // optional authPassword: 'password', // optional secret: '<SECRET>', // optional + description: '<DESCRIPTION>', // optional }); console.log(result); diff --git a/docs/examples/webhooks/update.md b/docs/examples/webhooks/update.md index 058f73e1..73809803 100644 --- a/docs/examples/webhooks/update.md +++ b/docs/examples/webhooks/update.md @@ -16,6 +16,7 @@ const result = await webhooks.update({ tls: false, // optional authUsername: '<AUTH_USERNAME>', // optional authPassword: 'password', // optional + description: '<DESCRIPTION>', // optional }); console.log(result); diff --git a/package-lock.json b/package-lock.json index db4c0ce0..120e3c2c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@appwrite.io/console", - "version": "19.0.0", + "version": "20.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@appwrite.io/console", - "version": "19.0.0", + "version": "20.0.0", "license": "BSD-3-Clause", "dependencies": { "buffer": "6.0.3", @@ -17,6 +17,7 @@ "@eslint/js": "10.0.1", "@rollup/plugin-commonjs": "29.0.3", "@rollup/plugin-node-resolve": "16.0.3", + "@rollup/plugin-terser": "1.0.0", "@rollup/plugin-typescript": "12.3.0", "@types/json-bigint": "1.0.4", "eslint": "10.10.0", @@ -30,16 +31,16 @@ "typescript-eslint": "8.70.0" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" }, "overrides": { "brace-expansion": "5.0.12" } }, "node_modules/@babel/runtime": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.29.7.tgz", - "integrity": "sha512-Nq8OhGWiZIZGV6hLHoyAKLLcJihP/xFeBMGJoUrxTX2psI8dCifzLhZISFb+VWS3wFMRDmCGw5R+dOySCqPLhw==", + "version": "7.29.10", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.29.10.tgz", + "integrity": "sha512-NpugTzbKgGrNe45Ui32cN8vCFFMxVtP/9rtfwv0nP5FRDAjvYBxJcLVpYA9mr1jxP6cnIT7x9LUzuDTbWYYNRA==", "license": "MIT", "engines": { "node": ">=6.9.0" @@ -263,6 +264,38 @@ "url": "https://github.com/sponsors/nzakas" } }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/source-map": { + "version": "0.3.11", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.11.tgz", + "integrity": "sha512-ZMp1V8ZFcPG5dIWnQLr3NSI1MiCU7UETdS/A0G8V/XWHvJv3ZsFqutJn1Y5RPmAPX6F3BiE397OqveU/9NCuIA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25" + } + }, "node_modules/@jridgewell/sourcemap-codec": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz", @@ -270,6 +303,17 @@ "dev": true, "license": "MIT" }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, "node_modules/@keyv/bigmap": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/@keyv/bigmap/-/bigmap-1.3.1.tgz", @@ -389,6 +433,29 @@ } } }, + "node_modules/@rollup/plugin-terser": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-terser/-/plugin-terser-1.0.0.tgz", + "integrity": "sha512-FnCxhTBx6bMOYQrar6C8h3scPt8/JwIzw3+AJ2K++6guogH5fYaIFia+zZuhqv0eo1RN7W1Pz630SyvLbDjhtQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "serialize-javascript": "^7.0.3", + "smob": "^1.0.0", + "terser": "^5.17.4" + }, + "engines": { + "node": ">=20.0.0" + }, + "peerDependencies": { + "rollup": "^2.0.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, "node_modules/@rollup/plugin-typescript": { "version": "12.3.0", "resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-12.3.0.tgz", @@ -857,9 +924,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-26.6.3.tgz", - "integrity": "sha512-dsqMQQoeTLqu9wynDD00q573mNzso3IdQOAfHRJqLCcmCFPoGo9A1bDpUcv/9tnKpErQWv9uKeGfl37EIS02Yg==", + "version": "26.6.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-26.6.5.tgz", + "integrity": "sha512-uMzsv9stDdofIZBx4UGh4Z9ZgXnGC9seRDscilBcTHAeOFk67MZg/k9bWVfO+bk4qZmG+l52hRnLwUiH2LnJTg==", "license": "MIT", "dependencies": { "undici-types": "~8.9.0" @@ -920,9 +987,9 @@ } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { - "version": "7.0.10", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.10.tgz", - "integrity": "sha512-HpbUakT7xp5miBUywCHf36ZEuAJNklBJDDsGpUIjMzOSmM8ELSfA9Sa/QDPeNeqeoN31u+UTCkL4klCOVvRm4Q==", + "version": "7.0.12", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.12.tgz", + "integrity": "sha512-/8UvqAPU9DGTI9k4mxtf49U37Isfwr8Uts96+SBHIkFxPJnHS0Ew4f00sM4Scd8V8EjM0jUNtVDdv1kPdt35lg==", "dev": true, "license": "MIT", "engines": { @@ -1133,9 +1200,9 @@ } }, "node_modules/acorn": { - "version": "8.18.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.18.0.tgz", - "integrity": "sha512-lGq+9yr1/GuAWaVYIHRjvvySG5/4VfKIvC8EWxStPdcDh/Ka7FG3twP6v4d5BkravUilhIAsG4Qj83t02LWUPQ==", + "version": "8.19.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.19.0.tgz", + "integrity": "sha512-oJlA3XiRm7Cyk6qFD2Jn8ak9B7jSy0qy00ADO3+8dpT0LSjFihQYv4C02LFCSYJV3Q37xYwwRy5m+IpIiUzqWw==", "dev": true, "license": "MIT", "bin": { @@ -1302,6 +1369,13 @@ "qified": "^0.10.1" } }, + "node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true, + "license": "MIT" + }, "node_modules/commist": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/commist/-/commist-3.2.0.tgz", @@ -1828,9 +1902,9 @@ "license": "ISC" }, "node_modules/ip-address": { - "version": "10.7.2", - "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.7.2.tgz", - "integrity": "sha512-7H/2gFSIitxc0hG3nOI1glS8QLo/EHBFFLk8vEUjXY/xu0AdL8jZ9U1IzO2PUm0d2D/ofQcAifb0g6OBkt8U7w==", + "version": "10.7.4", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.7.4.tgz", + "integrity": "sha512-DWBMKyeM25D70nrIiTkgQth59/G+naKOTep6huF9j+GmeK3DMD60Zvxg5d5qQnz+38AHgou6ean2LECX+lrKDg==", "license": "MIT", "engines": { "node": ">= 12" @@ -2320,9 +2394,9 @@ } }, "node_modules/readable-stream": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.7.0.tgz", - "integrity": "sha512-oIGGmcpTLwPga8Bn6/Z75SVaH1z5dUut2ibSyAMVhmUggWpmDn2dapB0n7f8nwaSiRtepAsfJyfXIO5DCVAODg==", + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.8.0.tgz", + "integrity": "sha512-2jhTTU3Eilp/2DMT71gbcoqC35eQHasMJH0RHkYxwlxIv3+FR6Y5xAFZIwEGLxKkjZYEFlsiMNIdwUqjK2lLHQ==", "license": "MIT", "dependencies": { "abort-controller": "^3.0.0", @@ -2336,14 +2410,14 @@ } }, "node_modules/resolve": { - "version": "1.22.12", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.12.tgz", - "integrity": "sha512-TyeJ1zif53BPfHootBGwPRYT1RUt6oGWsaQr8UyZW/eAm9bKoijtvruSDEmZHm92CwS9nj7/fWttqPCgzep8CA==", + "version": "1.22.13", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.13.tgz", + "integrity": "sha512-Dj/cW9zBV2aRj6XzCxuGIs3ESZKv02jixne3q6jFZYZ3/Tg09gHHviSMDL4kObh9pqSahdRHEnDoaP2gn8YLhA==", "dev": true, "license": "MIT", "dependencies": { "es-errors": "^1.3.0", - "is-core-module": "^2.16.1", + "is-core-module": "^2.17.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, @@ -2455,6 +2529,16 @@ "node": ">=10" } }, + "node_modules/serialize-javascript": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-7.1.2.tgz", + "integrity": "sha512-GL2BWwVa6JydKO6l/ljVgjAZF4QJ3S7dWDWi53s5GZT8PJzD2fNxi67HANQGKAqPrwEpL5ba7gUBGi0Ls/sEoQ==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=20.0.0" + } + }, "node_modules/serve-handler": { "version": "6.1.7", "resolved": "https://registry.npmjs.org/serve-handler/-/serve-handler-6.1.7.tgz", @@ -2517,6 +2601,16 @@ "npm": ">= 3.0.0" } }, + "node_modules/smob": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/smob/-/smob-1.6.2.tgz", + "integrity": "sha512-RQsvleCbF8cVHEv+xuDGaA4pOizFqJ0GgjtMSRo6oP8pnN7WsigHgVGey6aILRBKv4W2YOMHLqbKdnB6hpB9fw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20.0.0" + } + }, "node_modules/socks": { "version": "2.8.10", "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.10.tgz", @@ -2531,6 +2625,27 @@ "npm": ">= 3.0.0" } }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, "node_modules/split2": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", @@ -2562,6 +2677,25 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/terser": { + "version": "5.51.2", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.51.2.tgz", + "integrity": "sha512-bWnjSNscmuI+GJze6ZupnHP8G/cTcsJF+bXCeQknk2SHQsgbNJnLrqiH9jZ2W4STPVXH2mDKKRX3iwPhc9Cn/Q==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "@jridgewell/source-map": "^0.3.3", + "acorn": "^8.15.0", + "commander": "^2.20.0", + "source-map-support": "~0.5.20" + }, + "bin": { + "terser": "bin/terser" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/tinyglobby": { "version": "0.2.17", "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", diff --git a/package.json b/package.json index aff28c17..643daadf 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@appwrite.io/console", "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": "19.0.0", + "version": "20.0.0", "license": "BSD-3-Clause", "main": "dist/cjs/sdk.js", "exports": { @@ -18,6 +18,7 @@ "types": "types/index.d.ts", "files": [ "dist", + "!dist/cdn", "types", "spec.json" ], @@ -29,6 +30,7 @@ "build": "npm run build:types && npm run build:libs", "build:types": "tsc --declaration --emitDeclarationOnly --outDir types", "build:libs": "rollup -c", + "build:cdn": "rollup -c --environment CDN", "format": "prettier --write .", "format:check": "prettier --check .", "lint": "eslint .", @@ -36,7 +38,7 @@ "analyse": "tsc --noEmit" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" }, "dependencies": { "buffer": "6.0.3", @@ -47,6 +49,7 @@ "@eslint/js": "10.0.1", "@rollup/plugin-commonjs": "29.0.3", "@rollup/plugin-node-resolve": "16.0.3", + "@rollup/plugin-terser": "1.0.0", "@rollup/plugin-typescript": "12.3.0", "@types/json-bigint": "1.0.4", "eslint": "10.10.0", diff --git a/rollup.config.mjs b/rollup.config.mjs index d75817e7..13073a9b 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -1,13 +1,48 @@ -import { readFileSync } from 'fs'; +import { existsSync, readdirSync, readFileSync } from 'fs'; const pkg = JSON.parse(readFileSync('./package.json', 'utf8')); import typescript from '@rollup/plugin-typescript'; import resolve from '@rollup/plugin-node-resolve'; import commonjs from '@rollup/plugin-commonjs'; import nodePolyfills from 'rollup-plugin-polyfill-node'; +import terser from '@rollup/plugin-terser'; const external = Object.keys(pkg.dependencies ?? {}); -export default [ +// The Push service uses mqtt.js, which references Node built-ins +// (buffer/process/stream/…); polyfill them for the browser bundles. +const browser = (options) => [ + nodePolyfills(), + resolve({ browser: true, preferBuiltins: false }), + commonjs(), + typescript(options), +]; + +const minify = (ecma, options = {}) => + terser({ + ecma, + format: { comments: false }, + compress: { passes: 3 }, + ...options, + }); + +const iife = (file, options, ecma) => ({ + input: 'src/index.ts', + plugins: browser(options), + output: [ + { + format: 'iife', + file, + name: 'Appwrite', + extend: true, + // A script tag has no module loader, so the lazy mqtt.js import is inlined here. + inlineDynamicImports: true, + sourcemap: true, + plugins: [minify(ecma)], + }, + ], +}); + +const libs = [ { input: 'src/index.ts', external, @@ -26,25 +61,44 @@ export default [ }, ], }, + iife(pkg.jsdelivr, { outDir: 'dist' }, 2015), +]; + +const entries = (dir, prefix = '') => + existsSync(dir) + ? readdirSync(dir) + .filter((file) => file.endsWith('.ts')) + .map((file) => [prefix + file.slice(0, -3), `${dir}/${file}`]) + : []; + +const input = {}; +for (const [name, file] of [ + ...entries('src').filter(([name]) => name !== 'models'), + ...entries('src/services'), + ...entries('src/enums', 'enums/'), +]) { + if (name in input) { + throw new Error(`${file} and ${input[name]} both build ${name}.js`); + } + input[name] = file; +} + +const modern = { outDir: 'dist/cdn', target: 'ES2020' }; + +const cdn = [ { - input: 'src/index.ts', - plugins: [ - // The Push service uses mqtt.js, which references Node built-ins - // (buffer/process/stream/…); polyfill them for the browser bundle. - nodePolyfills(), - resolve({ browser: true, preferBuiltins: false }), - commonjs(), - typescript({ outDir: 'dist' }), - ], - output: [ - { - format: 'iife', - file: pkg.jsdelivr, - name: 'Appwrite', - extend: true, - // A script tag has no module loader, so the lazy mqtt.js import is inlined here. - inlineDynamicImports: true, - }, - ], + input, + plugins: browser(modern), + output: { + format: 'es', + dir: 'dist/cdn', + entryFileNames: '[name].js', + chunkFileNames: 'chunks/[name]-[hash].js', + sourcemap: true, + plugins: [minify(2020, { module: true })], + }, }, + iife('dist/cdn/sdk.min.js', modern, 2020), ]; + +export default process.env.CDN ? cdn : libs; diff --git a/spec.json b/spec.json index 1a761d5b..52c112ac 100644 --- a/spec.json +++ b/spec.json @@ -1,7 +1,7 @@ { "openapi": "3.0.0", "info": { - "version": "2.4.0", + "version": "2.5.0", "title": "Appwrite", "description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)", "termsOfService": "https:\/\/appwrite.io\/policy\/terms", @@ -255,6 +255,17 @@ "default": [] }, "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" } ] }, @@ -1275,6 +1286,17 @@ "default": [] }, "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" } ] } @@ -3540,6 +3562,17 @@ "default": [] }, "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" } ] }, @@ -4194,7 +4227,7 @@ "tags": [ "account" ], - "description": "Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createRecovery) endpoint.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.", + "description": "Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createRecovery) endpoint.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.\n\nThe new password must satisfy the project's enabled password policies, including custom deny lists. Dictionary entries match the entire password case-sensitively; personal-data terms match substrings case-insensitively. Personal-data validation runs after token verification against the recovered user's ID, name, email, and phone, closing the previous recovery gap for profile-based checks. A rejected password leaves the existing credentials unchanged and the recovery token usable.\n", "responses": { "200": { "description": "Token", @@ -4349,7 +4382,7 @@ "tags": [ "account" ], - "description": "Use this endpoint to complete the user password recovery process using the 6-digit code that was emailed by [createRecoveryOTP](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createRecoveryOTP). Pass the **userId** of the user along with the **secret** code from the email and the new **password** to set. If confirmed, this route will return a 200 status code, the code is consumed and the user's password is updated.\n", + "description": "Use this endpoint to complete the user password recovery process using the 6-digit code that was emailed by [createRecoveryOTP](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createRecoveryOTP). Pass the **userId** of the user along with the **secret** code from the email and the new **password** to set. If confirmed, this route will return a 200 status code, the code is consumed and the user's password is updated.\n\nThe new password must satisfy the project's enabled password policies, including custom deny lists. Dictionary entries match the entire password case-sensitively; personal-data terms match substrings case-insensitively. Personal-data validation runs after token verification against the recovered user's ID, name, email, and phone, closing the previous recovery gap for profile-based checks. A rejected password leaves the existing credentials unchanged and the recovery token usable.\n", "responses": { "200": { "description": "Token", @@ -5753,6 +5786,18 @@ "type": "string", "default": "", "example": "<PROVIDER_ID>" + }, + "bundleId": { + "description": "App bundle ID of the device registering an APNs token. Without `providerId`, routes the target to the enabled APNs provider for this bundle ID and `environment`.", + "type": "string", + "default": "", + "example": "<BUNDLE_ID>" + }, + "environment": { + "description": "APNs environment the token belongs to, `sandbox` or `production`. Used with `bundleId`.", + "type": "string", + "default": "", + "example": "sandbox" } }, "required": [ @@ -5831,6 +5876,18 @@ "description": "The target identifier (token, email, phone etc.)", "type": "string", "example": "<IDENTIFIER>" + }, + "bundleId": { + "description": "App bundle ID of the device registering an APNs token. Routes an APNs target to the enabled APNs provider for this bundle ID and `environment`.", + "type": "string", + "default": "", + "example": "<BUNDLE_ID>" + }, + "environment": { + "description": "APNs environment the token belongs to, `sandbox` or `production`. Used with `bundleId`.", + "type": "string", + "default": "", + "example": "sandbox" } }, "required": [ @@ -7305,6 +7362,17 @@ "default": [] }, "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" } ] } @@ -7374,7 +7442,7 @@ "tags": [ "admin" ], - "description": "Delete everything cached from the platform database in the region serving the request.", + "description": "Delete everything cached from the platform database, in every region.", "responses": { "204": { "description": "No content" @@ -7411,7 +7479,7 @@ "tags": [ "admin" ], - "description": "Delete the cache of one platform resource, or of every resource of a type, in the region serving the request.", + "description": "Delete the cache of one platform resource, or of every resource of a type, in every region.", "responses": { "204": { "description": "No content" @@ -7537,7 +7605,7 @@ "tags": [ "admin" ], - "description": "Delete everything cached for a project. Send the request to the project's region.", + "description": "Delete everything cached for a project, in the project's region.", "responses": { "204": { "description": "No content" @@ -7586,7 +7654,7 @@ "tags": [ "admin" ], - "description": "Delete the cache of one project resource, or of every resource of a type. Send the request to the project's region.", + "description": "Delete the cache of one project resource, or of every resource of a type, in the project's region.", "responses": { "204": { "description": "No content" @@ -8183,6 +8251,81 @@ } } }, + "\/admin\/users\/{userId}\/admin": { + "patch": { + "summary": "Update user admin capability", + "operationId": "adminUpdateUserAdmin", + "tags": [ + "admin" + ], + "description": "Mark a console user as a platform admin, giving them access to the admin API, or unmark them to remove it.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "users", + "demo": "admin\/update-user-admin.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "console", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "Console user ID.", + "required": true, + "schema": { + "type": "string", + "example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "admin": { + "description": "Whether the user is a platform admin. When true, the user can call the admin API.", + "type": "boolean", + "example": false + } + }, + "required": [ + "admin" + ] + } + } + } + } + } + }, "\/affiliates\/links": { "get": { "summary": "List affiliate links", @@ -8238,6 +8381,17 @@ "default": [] }, "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" } ] }, @@ -8467,6 +8621,17 @@ "default": [] }, "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" } ] } @@ -8526,6 +8691,17 @@ "default": [] }, "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" } ] } @@ -9464,6 +9640,17 @@ "default": 100 }, "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" } ] } @@ -17256,6 +17443,17 @@ "default": [] }, "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" } ] }, @@ -17550,6 +17748,17 @@ "default": [] }, "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" } ] }, @@ -18110,6 +18319,17 @@ "default": [] }, "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" } ] } @@ -21246,7 +21466,8 @@ "parameters": [ "databaseId", "name", - "enabled" + "enabled", + "description" ], "required": [ "databaseId", @@ -21298,6 +21519,12 @@ "type": "boolean", "default": true, "example": false + }, + "description": { + "description": "Optional description for the database.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" } }, "required": [ @@ -21938,7 +22165,8 @@ "parameters": [ "databaseId", "name", - "enabled" + "enabled", + "description" ], "required": [ "databaseId" @@ -21996,6 +22224,12 @@ "type": "boolean", "default": true, "example": false + }, + "description": { + "description": "Optional description for the database.", + "type": "string", + "example": "<DESCRIPTION>", + "nullable": true } } } @@ -22298,6 +22532,12 @@ "items": { "type": "object" } + }, + "description": { + "description": "Optional description for the collection.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" } }, "required": [ @@ -22489,6 +22729,12 @@ "type": "boolean", "default": false, "example": false + }, + "description": { + "description": "Optional description for the collection.", + "type": "string", + "example": "<DESCRIPTION>", + "nullable": true } } } @@ -22768,6 +23014,12 @@ "type": "boolean", "default": false, "example": false + }, + "description": { + "description": "Optional description for the attribute.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" } }, "required": [ @@ -22897,6 +23149,12 @@ "type": "string", "example": "<NEW_KEY>", "nullable": true + }, + "description": { + "description": "Optional description for the attribute.", + "type": "string", + "example": "<DESCRIPTION>", + "nullable": true } }, "required": [ @@ -23006,6 +23264,12 @@ "type": "boolean", "default": false, "example": false + }, + "description": { + "description": "Optional description for the attribute.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" } }, "required": [ @@ -23120,6 +23384,12 @@ "type": "string", "example": "<NEW_KEY>", "nullable": true + }, + "description": { + "description": "Optional description for the attribute.", + "type": "string", + "example": "<DESCRIPTION>", + "nullable": true } }, "required": [ @@ -23230,6 +23500,12 @@ "type": "boolean", "default": false, "example": false + }, + "description": { + "description": "Optional description for the attribute.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" } }, "required": [ @@ -23345,6 +23621,12 @@ "type": "string", "example": "<NEW_KEY>", "nullable": true + }, + "description": { + "description": "Optional description for the attribute.", + "type": "string", + "example": "<DESCRIPTION>", + "nullable": true } }, "required": [ @@ -23455,6 +23737,12 @@ "type": "boolean", "default": false, "example": false + }, + "description": { + "description": "Optional description for the attribute.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" } }, "required": [ @@ -23570,6 +23858,12 @@ "type": "string", "example": "<NEW_KEY>", "nullable": true + }, + "description": { + "description": "Optional description for the attribute.", + "type": "string", + "example": "<DESCRIPTION>", + "nullable": true } }, "required": [ @@ -23690,6 +23984,12 @@ "type": "boolean", "default": false, "example": false + }, + "description": { + "description": "Optional description for the attribute.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" } }, "required": [ @@ -23816,6 +24116,12 @@ "type": "string", "example": "<NEW_KEY>", "nullable": true + }, + "description": { + "description": "Optional description for the attribute.", + "type": "string", + "example": "<DESCRIPTION>", + "nullable": true } }, "required": [ @@ -23941,6 +24247,12 @@ "type": "boolean", "default": false, "example": false + }, + "description": { + "description": "Optional description for the attribute.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" } }, "required": [ @@ -24070,6 +24382,12 @@ "type": "string", "example": "<NEW_KEY>", "nullable": true + }, + "description": { + "description": "Optional description for the attribute.", + "type": "string", + "example": "<DESCRIPTION>", + "nullable": true } }, "required": [ @@ -24194,6 +24512,12 @@ "type": "boolean", "default": false, "example": false + }, + "description": { + "description": "Optional description for the attribute.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" } }, "required": [ @@ -24323,6 +24647,12 @@ "type": "string", "example": "<NEW_KEY>", "nullable": true + }, + "description": { + "description": "Optional description for the attribute.", + "type": "string", + "example": "<DESCRIPTION>", + "nullable": true } }, "required": [ @@ -24432,6 +24762,12 @@ "type": "boolean", "default": false, "example": false + }, + "description": { + "description": "Optional description for the attribute.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" } }, "required": [ @@ -24546,6 +24882,12 @@ "type": "string", "example": "<NEW_KEY>", "nullable": true + }, + "description": { + "description": "Optional description for the attribute.", + "type": "string", + "example": "<DESCRIPTION>", + "nullable": true } }, "required": [ @@ -24669,6 +25011,12 @@ } }, "nullable": true + }, + "description": { + "description": "Optional description for the attribute.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" } }, "required": [ @@ -24803,6 +25151,12 @@ "type": "string", "example": "<NEW_KEY>", "nullable": true + }, + "description": { + "description": "Optional description for the attribute.", + "type": "string", + "example": "<DESCRIPTION>", + "nullable": true } }, "required": [ @@ -24917,6 +25271,12 @@ "type": "boolean", "default": false, "example": false + }, + "description": { + "description": "Optional description for the attribute.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" } }, "required": [ @@ -25031,6 +25391,12 @@ "type": "string", "example": "<NEW_KEY>", "nullable": true + }, + "description": { + "description": "Optional description for the attribute.", + "type": "string", + "example": "<DESCRIPTION>", + "nullable": true } }, "required": [ @@ -25146,6 +25512,12 @@ "type": "boolean", "default": false, "example": false + }, + "description": { + "description": "Optional description for the attribute.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" } }, "required": [ @@ -25260,6 +25632,12 @@ "type": "string", "example": "<NEW_KEY>", "nullable": true + }, + "description": { + "description": "Optional description for the attribute.", + "type": "string", + "example": "<DESCRIPTION>", + "nullable": true } }, "required": [ @@ -25370,6 +25748,12 @@ "format": "double" }, "nullable": true + }, + "description": { + "description": "Optional description for the attribute.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" } }, "required": [ @@ -25491,6 +25875,12 @@ "type": "string", "example": "<NEW_KEY>", "nullable": true + }, + "description": { + "description": "Optional description for the attribute.", + "type": "string", + "example": "<DESCRIPTION>", + "nullable": true } }, "required": [ @@ -25622,6 +26012,12 @@ } }, "nullable": true + }, + "description": { + "description": "Optional description for the attribute.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" } }, "required": [ @@ -25765,6 +26161,12 @@ "type": "string", "example": "<NEW_KEY>", "nullable": true + }, + "description": { + "description": "Optional description for the attribute.", + "type": "string", + "example": "<DESCRIPTION>", + "nullable": true } }, "required": [ @@ -25940,6 +26342,12 @@ "title": "setNull" } ] + }, + "description": { + "description": "Optional description for the attribute.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" } }, "required": [ @@ -26072,6 +26480,12 @@ "type": "string", "example": "<NEW_KEY>", "nullable": true + }, + "description": { + "description": "Optional description for the attribute.", + "type": "string", + "example": "<DESCRIPTION>", + "nullable": true } } } @@ -26189,6 +26603,12 @@ "type": "boolean", "default": false, "example": false + }, + "description": { + "description": "Optional description for the attribute.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" } }, "required": [ @@ -26311,6 +26731,12 @@ "type": "string", "example": "<NEW_KEY>", "nullable": true + }, + "description": { + "description": "Optional description for the attribute.", + "type": "string", + "example": "<DESCRIPTION>", + "nullable": true } }, "required": [ @@ -26426,6 +26852,12 @@ "type": "boolean", "default": false, "example": false + }, + "description": { + "description": "Optional description for the attribute.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" } }, "required": [ @@ -26540,6 +26972,12 @@ "type": "string", "example": "<NEW_KEY>", "nullable": true + }, + "description": { + "description": "Optional description for the attribute.", + "type": "string", + "example": "<DESCRIPTION>", + "nullable": true } }, "required": [ @@ -26650,6 +27088,12 @@ "type": "boolean", "default": false, "example": false + }, + "description": { + "description": "Optional description for the attribute.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" } }, "required": [ @@ -26765,6 +27209,12 @@ "type": "string", "example": "<NEW_KEY>", "nullable": true + }, + "description": { + "description": "Optional description for the attribute.", + "type": "string", + "example": "<DESCRIPTION>", + "nullable": true } }, "required": [ @@ -26886,6 +27336,12 @@ "type": "boolean", "default": false, "example": false + }, + "description": { + "description": "Optional description for the attribute.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" } }, "required": [ @@ -27008,6 +27464,12 @@ "type": "string", "example": "<NEW_KEY>", "nullable": true + }, + "description": { + "description": "Optional description for the attribute.", + "type": "string", + "example": "<DESCRIPTION>", + "nullable": true } }, "required": [ @@ -27567,7 +28029,7 @@ "tags": [ "databases" ], - "description": "Get a list of all the user's documents in a given collection. You can use the query params to filter your results.", + "description": "Get a list of all the user's documents in a given collection. You can use the query params to filter your results.\n\nDocuments returned by aggregate, groupBy or distinct queries hold only the attributes they select, group or aggregate, typed as a document types them, with a joined attribute named by its join alias (`alias.attribute`). They have no `$id`, `$sequence`, `$createdAt`, `$updatedAt`, `$permissions`, `$databaseId` or `$collectionId` unless they select or group it, and neither does a right or full join document that no document of this collection matched.", "responses": { "200": { "description": "Documents List", @@ -27668,7 +28130,7 @@ }, { "name": "ttl", - "description": "TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, collection, schema version (attributes and indexes), caller authorization roles, and the exact query \u2014 so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; document writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Must be between 0 and 86400 (24 hours).", + "description": "TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, collection, schema version (attributes and indexes), caller authorization roles, and the exact query \u2014 so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; document writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Lists with join queries are not cached. Must be between 0 and 86400 (24 hours).", "required": false, "schema": { "type": "integer", @@ -28260,6 +28722,119 @@ ] } }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/query": { + "post": { + "summary": "Create query", + "operationId": "databasesCreateQuery", + "tags": [ + "databases" + ], + "description": "Get a list of all the user's documents in a given collection using a POST request. This behaves identically to the list documents endpoint but accepts the queries in the request body, allowing much larger `queries` arrays than can fit in a URL query string.\n", + "responses": { + "200": { + "description": "Documents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/documentList" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "group": "documents", + "demo": "databases\/create-query.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createQuery" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "queries": { + "description": "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.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "transactionId": { + "description": "Transaction ID to read uncommitted changes within the transaction.", + "type": "string", + "example": "<TRANSACTION_ID>", + "nullable": true + }, + "total": { + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "type": "boolean", + "default": true, + "example": false + }, + "ttl": { + "description": "TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, collection, schema version (attributes and indexes), caller authorization roles, and the exact query \u2014 so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; document writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Lists with join queries are not cached. Must be between 0 and 86400 (24 hours).", + "type": "integer", + "default": 0, + "example": 0, + "format": "int32" + } + } + } + } + } + } + } + }, "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}": { "get": { "summary": "Get document", @@ -29277,6 +29852,12 @@ "items": { "type": "integer" } + }, + "description": { + "description": "Optional description for the index.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" } }, "required": [ @@ -29581,6 +30162,12 @@ "default": true, "example": false }, + "description": { + "description": "Optional description for the database.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" + }, "specification": { "description": "Database specification. Defaults to `serverless`, which creates the database on the shared pool. Any other value provisions a dedicated database on that specification.", "type": "string", @@ -30135,6 +30722,12 @@ "default": true, "example": false }, + "description": { + "description": "Optional description for the database.", + "type": "string", + "example": "<DESCRIPTION>", + "nullable": true + }, "specification": { "description": "Database specification. Resizing between dedicated specifications changes cpu, memory, storage and the connection ceiling via a rolling cutover with zero downtime. Moving a `serverless` database onto a dedicated specification is a data migration, not a resize.", "type": "string", @@ -30414,6 +31007,12 @@ "items": { "type": "object" } + }, + "description": { + "description": "Optional description for the collection.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" } }, "required": [ @@ -30596,6 +31195,12 @@ "type": "boolean", "default": false, "example": false + }, + "description": { + "description": "Optional description for the collection.", + "type": "string", + "example": "<DESCRIPTION>", + "nullable": true } }, "required": [ @@ -31325,6 +31930,114 @@ ] } }, + "\/documentsdb\/{databaseId}\/collections\/{collectionId}\/documents\/query": { + "post": { + "summary": "Create query", + "operationId": "documentsDBCreateQuery", + "tags": [ + "documentsDB" + ], + "description": "Get a list of all the user's documents in a given collection using a POST request. This behaves identically to the list documents endpoint but accepts the queries in the request body, allowing much larger `queries` arrays than can fit in a URL query string.\n", + "responses": { + "200": { + "description": "Documents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/documentList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "documents", + "demo": "documentsdb\/create-query.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documentsdb.documents.read", + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "queries": { + "description": "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.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "transactionId": { + "description": "Transaction ID to read uncommitted changes within the transaction.", + "type": "string", + "example": "<TRANSACTION_ID>" + }, + "total": { + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "type": "boolean", + "default": true, + "example": false + }, + "ttl": { + "description": "TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours).", + "type": "integer", + "default": 0, + "example": 0, + "format": "int32" + } + } + } + } + } + } + } + }, "\/documentsdb\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}": { "get": { "summary": "Get document", @@ -32268,6 +32981,12 @@ "items": { "type": "integer" } + }, + "description": { + "description": "Optional description for the index.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" } }, "required": [ @@ -32780,6 +33499,17 @@ "default": "" }, "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" } ] }, @@ -34733,6 +35463,17 @@ "example": "<DOMAIN_ID>" }, "in": "path" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" } ] } @@ -39160,6 +39901,12 @@ "default": 0, "example": 0, "format": "int32" + }, + "description": { + "description": "Optional description for the function.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" } }, "required": [ @@ -41994,6 +42741,18 @@ "example": 0, "format": "int32", "nullable": true + }, + "description": { + "description": "Optional description for the function.", + "type": "string", + "example": "<DESCRIPTION>", + "nullable": true + }, + "emailEnabled": { + "description": "Enable inbound email triggering for this function. When false or omitted on create, SMTP recipients are rejected. Opt-in; default is off.", + "type": "boolean", + "example": false, + "nullable": true } }, "required": [ @@ -43498,6 +44257,12 @@ "type": "boolean", "default": true, "example": false + }, + "description": { + "description": "Optional description for the variable.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" } }, "required": [ @@ -43666,6 +44431,12 @@ "type": "boolean", "example": false, "nullable": true + }, + "description": { + "description": "Optional description for the variable.", + "type": "string", + "example": "<DESCRIPTION>", + "nullable": true } } } @@ -45643,19 +46414,6 @@ }, "nullable": true }, - "replyToEmail": { - "description": "Email address to reply to. If not set, defaults to the sender email address.", - "type": "string", - "default": "", - "example": "email@example.com", - "format": "email" - }, - "replyToName": { - "description": "Name of the reply to recipient. If not set, defaults to the sender name.", - "type": "string", - "default": "", - "example": "<REPLY_TO_NAME>" - }, "draft": { "description": "Is message a draft", "type": "boolean", @@ -45674,6 +46432,27 @@ "example": "2020-10-15T06:38:00.000+00:00", "format": "datetime", "nullable": true + }, + "replyToEmail": { + "description": "Email address to reply to. If not set, defaults to the sender email address.", + "type": "string", + "default": "", + "example": "email@example.com", + "format": "email" + }, + "replyToName": { + "description": "Name of the reply to recipient. If not set, defaults to the sender name.", + "type": "string", + "default": "", + "example": "<REPLY_TO_NAME>" + }, + "emails": { + "description": "List of email addresses to send the message to. Use this to deliver to recipients that are not backed by an Appwrite user, target, or topic.", + "type": "array", + "default": [], + "items": { + "type": "string" + } } }, "required": [ @@ -45760,18 +46539,6 @@ "schema": { "type": "object", "properties": { - "subject": { - "description": "Email Subject.", - "type": "string", - "example": "<SUBJECT>", - "nullable": true - }, - "content": { - "description": "Email Content.", - "type": "string", - "example": "<CONTENT>", - "nullable": true - }, "topics": { "description": "List of Topic IDs.", "type": "array", @@ -45796,6 +46563,30 @@ }, "nullable": true }, + "subject": { + "description": "Email Subject.", + "type": "string", + "example": "<SUBJECT>", + "nullable": true + }, + "content": { + "description": "Email Content.", + "type": "string", + "example": "<CONTENT>", + "nullable": true + }, + "draft": { + "description": "Is message a draft", + "type": "boolean", + "example": false, + "nullable": true + }, + "html": { + "description": "Is content of type HTML", + "type": "boolean", + "example": false, + "nullable": true + }, "cc": { "description": "Array of target IDs to be added as CC.", "type": "array", @@ -45812,6 +46603,13 @@ }, "nullable": true }, + "scheduledAt": { + "description": "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.", + "type": "string", + "example": "2020-10-15T06:38:00.000+00:00", + "format": "datetime", + "nullable": true + }, "attachments": { "description": "Array of compound ID strings of bucket IDs and file IDs to be attached to the email. They should be formatted as <BUCKET_ID>:<FILE_ID>.", "type": "array", @@ -45833,23 +46631,12 @@ "example": "<REPLY_TO_NAME>", "nullable": true }, - "draft": { - "description": "Is message a draft", - "type": "boolean", - "example": false, - "nullable": true - }, - "html": { - "description": "Is content of type HTML", - "type": "boolean", - "example": false, - "nullable": true - }, - "scheduledAt": { - "description": "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.", - "type": "string", - "example": "2020-10-15T06:38:00.000+00:00", - "format": "datetime", + "emails": { + "description": "List of email addresses to send the message to. Use this to deliver to recipients that are not backed by an Appwrite user, target, or topic.", + "type": "array", + "items": { + "type": "string" + }, "nullable": true } } @@ -46137,18 +46924,6 @@ "schema": { "type": "object", "properties": { - "title": { - "description": "Title for push notification.", - "type": "string", - "example": "<TITLE>", - "nullable": true - }, - "body": { - "description": "Body for push notification.", - "type": "string", - "example": "<BODY>", - "nullable": true - }, "topics": { "description": "List of Topic IDs.", "type": "array", @@ -46173,6 +46948,18 @@ }, "nullable": true }, + "title": { + "description": "Title for push notification.", + "type": "string", + "example": "<TITLE>", + "nullable": true + }, + "body": { + "description": "Body for push notification.", + "type": "string", + "example": "<BODY>", + "nullable": true + }, "data": { "description": "Additional Data for push notification.", "type": "object", @@ -46532,10 +47319,10 @@ }, "parameters": [ "messageId", - "content", "topics", "users", "targets", + "content", "draft", "scheduledAt" ], @@ -46569,10 +47356,10 @@ }, "parameters": [ "messageId", - "content", "topics", "users", "targets", + "content", "draft", "scheduledAt" ], @@ -46618,12 +47405,6 @@ "schema": { "type": "object", "properties": { - "content": { - "description": "Email Content.", - "type": "string", - "example": "<CONTENT>", - "nullable": true - }, "topics": { "description": "List of Topic IDs.", "type": "array", @@ -46648,6 +47429,12 @@ }, "nullable": true }, + "content": { + "description": "Email Content.", + "type": "string", + "example": "<CONTENT>", + "nullable": true + }, "draft": { "description": "Is message a draft", "type": "boolean", @@ -47390,7 +48177,7 @@ "nullable": true }, "expiry": { - "description": "Default message retention in seconds for offline delivery. Max 7 days (604800).", + "description": "Default message retention in seconds for offline delivery. Max 7 days (604800). Applies to topics with a null expiry; the lowest across enabled Appwrite providers wins.", "type": "integer", "example": 0, "format": "int32", @@ -47489,7 +48276,7 @@ "nullable": true }, "expiry": { - "description": "Default message retention in seconds for offline delivery. Max 7 days (604800).", + "description": "Default message retention in seconds for offline delivery. Max 7 days (604800). Applies to topics with a null expiry; the lowest across enabled Appwrite providers wins.", "type": "integer", "example": 0, "format": "int32", @@ -50517,11 +51304,17 @@ "nullable": true }, "expiry": { - "description": "Message retention in seconds for offline delivery. Max 7 days (604800).", + "description": "Message retention in seconds for offline delivery. Max 7 days (604800). Null inherits the lowest expiry of the project's enabled Appwrite providers, or the 7-day ledger window if none sets one.", "type": "integer", "example": 0, "format": "int32", "nullable": true + }, + "description": { + "description": "Optional description for the topic.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" } }, "required": [ @@ -50677,11 +51470,17 @@ "nullable": true }, "expiry": { - "description": "Message retention in seconds for offline delivery. Max 7 days (604800).", + "description": "Message retention in seconds for offline delivery. Max 7 days (604800). Null inherits the lowest expiry of the project's enabled Appwrite providers, or the 7-day ledger window if none sets one.", "type": "integer", "example": 0, "format": "int32", "nullable": true + }, + "description": { + "description": "Optional description for the topic.", + "type": "string", + "example": "<DESCRIPTION>", + "nullable": true } } } @@ -51451,6 +52250,13 @@ ], "title": "project-email-template" }, + { + "type": "string", + "enum": [ + "project-environment" + ], + "title": "project-environment" + }, { "type": "string", "enum": [ @@ -51839,6 +52645,13 @@ ], "title": "project-email-template" }, + { + "type": "string", + "enum": [ + "project-environment" + ], + "title": "project-environment" + }, { "type": "string", "enum": [ @@ -53640,6 +54453,17 @@ "default": [] }, "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" } ] }, @@ -54214,6 +55038,17 @@ "default": [] }, "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" } ] }, @@ -54358,6 +55193,17 @@ "default": [] }, "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" } ] }, @@ -55755,7 +56601,7 @@ "tags": [ "mongo" ], - "description": "Restore a database from a backup or to a specific point in time (PITR). For backup restoration, provide a backupId. For PITR, provide a targetTime as an ISO 8601 datetime. PITR requires the database to have PITR enabled and is only available for enterprise databases.", + "description": "Restore a database from a backup or to a specific point in time (PITR). For backup restoration, provide a backupId. For PITR, provide a targetTime as an ISO 8601 datetime. PITR requires the database to have PITR enabled and is only available for enterprise databases.\n\nBy default the backup is replayed over the database it was taken from. Pass `restoreMode` as `clone` to recover it onto a second workload beside this database instead: this database keeps serving its own data while the clone is filled, and the switch happens as soon as the clone is ready, on the endpoint and credentials it already had. Pass `autoPromote` as false to hold the clone until you promote it yourself. Pass `restoreMode` as `copy` to recover onto a separate database with its own endpoint, either one you name with `targetDatabaseId` or one provisioned as a copy of this database's engine, version, specification and replicas. Neither mode is available for a point-in-time recovery or an incremental backup.", "responses": { "202": { "description": "Restoration", @@ -55823,7 +56669,7 @@ "nullable": true }, "targetDatabaseId": { - "description": "Existing database ID to restore into. The target must be distinct, ready, and use the same engine and version.", + "description": "Existing database ID to restore into. The target must be distinct, ready, and use the same engine and version. Omit it on a copy restoration to have one provisioned. Not accepted for a clone, which is recovered inside this database.", "type": "string", "example": "<TARGET_DATABASE_ID>", "nullable": true @@ -55834,6 +56680,24 @@ "example": "2020-10-15T06:38:00.000+00:00", "format": "datetime", "nullable": true + }, + "restoreMode": { + "description": "Where the backup is restored. Allowed values: in_place, clone, copy. Use \"clone\" to recover onto a second workload beside this database and leave it serving until you promote \u2014 the endpoint and credentials do not change. Use \"copy\" to recover onto a separate database with its own endpoint, either one you name with targetDatabaseId or one Cloud provisions. Use \"in_place\" to replay the backup over this database. Defaults to \"copy\" when a targetDatabaseId is given, \"in_place\" otherwise.", + "type": "string", + "example": "in_place", + "nullable": true + }, + "targetName": { + "description": "Display name for the database a copy restoration provisions. Defaults to this database's name followed by \"(restored)\". Max length: 128 chars.", + "type": "string", + "example": "<TARGET_NAME>", + "nullable": true + }, + "autoPromote": { + "description": "Whether a clone restoration switches the database over as soon as the recovery is ready. Default true: the restore finishes with the database serving the recovery point on the endpoint it already had, and the side it replaced kept briefly so the switch can be reversed. Pass false to hold the recovery until you call the promotion endpoint yourself.", + "type": "boolean", + "default": true, + "example": false } } }, @@ -55926,6 +56790,74 @@ ] } }, + "\/mongo\/{databaseId}\/restorations\/{restorationId}\/promotions": { + "post": { + "summary": "Promote restoration", + "operationId": "mongoPromoteRestoration", + "tags": [ + "mongo" + ], + "description": "Switch the database over to the clone a restoration recovered. The database keeps\nits endpoint and credentials; clients reconnect once. Writes made after the\nrecovery point are discarded, and the side being replaced is retained briefly so\nthe switch can be reversed.", + "responses": { + "202": { + "description": "Restoration", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/dedicatedDatabaseRestoration" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "restorations", + "demo": "mongo\/promote-restoration.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "restorationId", + "description": "Restoration ID.", + "required": true, + "schema": { + "type": "string", + "example": "<RESTORATION_ID>" + }, + "in": "path" + } + ] + } + }, "\/mongo\/{databaseId}\/status": { "get": { "summary": "Get status", @@ -56118,6 +57050,17 @@ "default": [] }, "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" } ] }, @@ -56692,6 +57635,17 @@ "default": [] }, "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" } ] }, @@ -56836,6 +57790,17 @@ "default": [] }, "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" } ] }, @@ -57683,7 +58648,7 @@ "tags": [ "mysql" ], - "description": "Execute SQL through the console-facing Cloud endpoint. Cloud proxies through the edge platform to the per-database SQL API sidecar. Application traffic should bypass cloud entirely and POST directly to the per-database hostname: `https:\/\/db-{project}-{db}.{region}.appwrite.center\/v1\/sql\/executions` with an `X-Appwrite-Key` header \u2014 that path scales to the whole DB fleet without a per-query cloud round-trip. The statement type must be on the database's configured allow-list. Use bound parameters for any user-supplied values \u2014 the API does not interpolate raw strings.", + "description": "Execute SQL through the console-facing Cloud endpoint. Cloud proxies through the edge platform to the per-database SQL API sidecar. Application traffic should bypass cloud entirely and POST directly to the per-database hostname: `https:\/\/db-{project}-{db}.{region}.appwrite.center\/v1\/sql\/executions` with an `X-Appwrite-Key` header \u2014 that path scales to the whole DB fleet without a per-query cloud round-trip. The statement type must be on the database's configured allow-list. Use bound parameters for any user-supplied values \u2014 the API does not interpolate raw strings. Long-running statements (for example CREATE INDEX) can outlive the HTTP request: if the request ends before a result is returned, check the database before retrying, and prefer a direct connection for work that may take minutes.", "responses": { "200": { "description": "Execution", @@ -57751,7 +58716,7 @@ "nullable": true }, "timeoutSeconds": { - "description": "Per-call execution timeout override. Must be less than or equal to the database's configured sqlApiTimeoutSeconds.", + "description": "Per-call execution timeout override. Must be less than or equal to the database's configured sqlApiTimeoutSeconds. Statements that may exceed this \u2014 or the HTTP request timeout in front of Cloud \u2014 should use a direct connection instead.", "type": "integer", "example": 1, "format": "int32", @@ -58298,7 +59263,7 @@ "nullable": true }, "readWriteSplitting": { - "description": "Route SELECTs to HA replicas, writes and locked reads to the primary. Defaults to true when HA is enabled.", + "description": "Route SELECTs to HA replicas, writes and locked reads to the primary. Off by default, and only takes effect while HA is enabled. Replication is asynchronous, so a read issued immediately after a write may not observe it.", "type": "boolean", "example": false, "nullable": true @@ -58499,7 +59464,7 @@ "tags": [ "mysql" ], - "description": "Restore a database from a backup or to a specific point in time (PITR). For backup restoration, provide a backupId. For PITR, provide a targetTime as an ISO 8601 datetime. PITR requires the database to have PITR enabled and is only available for enterprise databases.", + "description": "Restore a database from a backup or to a specific point in time (PITR). For backup restoration, provide a backupId. For PITR, provide a targetTime as an ISO 8601 datetime. PITR requires the database to have PITR enabled and is only available for enterprise databases.\n\nBy default the backup is replayed over the database it was taken from. Pass `restoreMode` as `clone` to recover it onto a second workload beside this database instead: this database keeps serving its own data while the clone is filled, and the switch happens as soon as the clone is ready, on the endpoint and credentials it already had. Pass `autoPromote` as false to hold the clone until you promote it yourself. Pass `restoreMode` as `copy` to recover onto a separate database with its own endpoint, either one you name with `targetDatabaseId` or one provisioned as a copy of this database's engine, version, specification and replicas. Neither mode is available for a point-in-time recovery or an incremental backup.", "responses": { "202": { "description": "Restoration", @@ -58567,7 +59532,7 @@ "nullable": true }, "targetDatabaseId": { - "description": "Existing database ID to restore into. The target must be distinct, ready, and use the same engine and version.", + "description": "Existing database ID to restore into. The target must be distinct, ready, and use the same engine and version. Omit it on a copy restoration to have one provisioned. Not accepted for a clone, which is recovered inside this database.", "type": "string", "example": "<TARGET_DATABASE_ID>", "nullable": true @@ -58578,6 +59543,24 @@ "example": "2020-10-15T06:38:00.000+00:00", "format": "datetime", "nullable": true + }, + "restoreMode": { + "description": "Where the backup is restored. Allowed values: in_place, clone, copy. Use \"clone\" to recover onto a second workload beside this database and leave it serving until you promote \u2014 the endpoint and credentials do not change. Use \"copy\" to recover onto a separate database with its own endpoint, either one you name with targetDatabaseId or one Cloud provisions. Use \"in_place\" to replay the backup over this database. Defaults to \"copy\" when a targetDatabaseId is given, \"in_place\" otherwise.", + "type": "string", + "example": "in_place", + "nullable": true + }, + "targetName": { + "description": "Display name for the database a copy restoration provisions. Defaults to this database's name followed by \"(restored)\". Max length: 128 chars.", + "type": "string", + "example": "<TARGET_NAME>", + "nullable": true + }, + "autoPromote": { + "description": "Whether a clone restoration switches the database over as soon as the recovery is ready. Default true: the restore finishes with the database serving the recovery point on the endpoint it already had, and the side it replaced kept briefly so the switch can be reversed. Pass false to hold the recovery until you call the promotion endpoint yourself.", + "type": "boolean", + "default": true, + "example": false } } }, @@ -58670,6 +59653,74 @@ ] } }, + "\/mysql\/{databaseId}\/restorations\/{restorationId}\/promotions": { + "post": { + "summary": "Promote restoration", + "operationId": "mysqlPromoteRestoration", + "tags": [ + "mysql" + ], + "description": "Switch the database over to the clone a restoration recovered. The database keeps\nits endpoint and credentials; clients reconnect once. Writes made after the\nrecovery point are discarded, and the side being replaced is retained briefly so\nthe switch can be reversed.", + "responses": { + "202": { + "description": "Restoration", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/dedicatedDatabaseRestoration" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "restorations", + "demo": "mysql\/promote-restoration.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "restorationId", + "description": "Restoration ID.", + "required": true, + "schema": { + "type": "string", + "example": "<RESTORATION_ID>" + }, + "in": "path" + } + ] + } + }, "\/mysql\/{databaseId}\/status": { "get": { "summary": "Get status", @@ -63454,6 +64505,12 @@ "example": "2020-10-15T06:38:00.000+00:00", "format": "datetime", "nullable": true + }, + "description": { + "description": "Optional description for the key.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" } }, "required": [ @@ -65483,6 +66540,12 @@ "example": "2020-10-15T06:38:00.000+00:00", "format": "datetime", "nullable": true + }, + "description": { + "description": "Optional description for the key.", + "type": "string", + "example": "<DESCRIPTION>", + "nullable": true } }, "required": [ @@ -65624,6 +66687,17 @@ "default": "" }, "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" } ] }, @@ -66445,6 +67519,17 @@ "default": [] }, "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" } ] } @@ -66954,6 +68039,17 @@ "default": [] }, "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" } ] }, @@ -67456,6 +68552,17 @@ "default": [] }, "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" } ] } @@ -68860,6 +69967,17 @@ "default": [] }, "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" } ] }, @@ -69434,6 +70552,17 @@ "default": [] }, "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" } ] }, @@ -69578,6 +70707,17 @@ "default": [] }, "in": "query" + }, + { + "name": "total", + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "required": false, + "schema": { + "type": "boolean", + "example": false, + "default": true + }, + "in": "query" } ] }, @@ -70425,7 +71565,7 @@ "tags": [ "postgresql" ], - "description": "Execute SQL through the console-facing Cloud endpoint. Cloud proxies through the edge platform to the per-database SQL API sidecar. Application traffic should bypass cloud entirely and POST directly to the per-database hostname: `https:\/\/db-{project}-{db}.{region}.appwrite.center\/v1\/sql\/executions` with an `X-Appwrite-Key` header \u2014 that path scales to the whole DB fleet without a per-query cloud round-trip. The statement type must be on the database's configured allow-list. Use bound parameters for any user-supplied values \u2014 the API does not interpolate raw strings.", + "description": "Execute SQL through the console-facing Cloud endpoint. Cloud proxies through the edge platform to the per-database SQL API sidecar. Application traffic should bypass cloud entirely and POST directly to the per-database hostname: `https:\/\/db-{project}-{db}.{region}.appwrite.center\/v1\/sql\/executions` with an `X-Appwrite-Key` header \u2014 that path scales to the whole DB fleet without a per-query cloud round-trip. The statement type must be on the database's configured allow-list. Use bound parameters for any user-supplied values \u2014 the API does not interpolate raw strings. Long-running statements (for example CREATE INDEX) can outlive the HTTP request: if the request ends before a result is returned, check the database before retrying, and prefer a direct connection for work that may take minutes.", "responses": { "200": { "description": "Execution", @@ -70493,7 +71633,7 @@ "nullable": true }, "timeoutSeconds": { - "description": "Per-call execution timeout override. Must be less than or equal to the database's configured sqlApiTimeoutSeconds.", + "description": "Per-call execution timeout override. Must be less than or equal to the database's configured sqlApiTimeoutSeconds. Statements that may exceed this \u2014 or the HTTP request timeout in front of Cloud \u2014 should use a direct connection instead.", "type": "integer", "example": 1, "format": "int32", @@ -71241,7 +72381,7 @@ "nullable": true }, "readWriteSplitting": { - "description": "Route SELECTs to HA replicas, writes and locked reads to the primary. Defaults to true when HA is enabled.", + "description": "Route SELECTs to HA replicas, writes and locked reads to the primary. Off by default, and only takes effect while HA is enabled. Replication is asynchronous, so a read issued immediately after a write may not observe it.", "type": "boolean", "example": false, "nullable": true @@ -71442,7 +72582,7 @@ "tags": [ "postgresql" ], - "description": "Restore a database from a backup or to a specific point in time (PITR). For backup restoration, provide a backupId. For PITR, provide a targetTime as an ISO 8601 datetime. PITR requires the database to have PITR enabled and is only available for enterprise databases.", + "description": "Restore a database from a backup or to a specific point in time (PITR). For backup restoration, provide a backupId. For PITR, provide a targetTime as an ISO 8601 datetime. PITR requires the database to have PITR enabled and is only available for enterprise databases.\n\nBy default the backup is replayed over the database it was taken from. Pass `restoreMode` as `clone` to recover it onto a second workload beside this database instead: this database keeps serving its own data while the clone is filled, and the switch happens as soon as the clone is ready, on the endpoint and credentials it already had. Pass `autoPromote` as false to hold the clone until you promote it yourself. Pass `restoreMode` as `copy` to recover onto a separate database with its own endpoint, either one you name with `targetDatabaseId` or one provisioned as a copy of this database's engine, version, specification and replicas. Neither mode is available for a point-in-time recovery or an incremental backup.", "responses": { "202": { "description": "Restoration", @@ -71510,7 +72650,7 @@ "nullable": true }, "targetDatabaseId": { - "description": "Existing database ID to restore into. The target must be distinct, ready, and use the same engine and version.", + "description": "Existing database ID to restore into. The target must be distinct, ready, and use the same engine and version. Omit it on a copy restoration to have one provisioned. Not accepted for a clone, which is recovered inside this database.", "type": "string", "example": "<TARGET_DATABASE_ID>", "nullable": true @@ -71521,6 +72661,24 @@ "example": "2020-10-15T06:38:00.000+00:00", "format": "datetime", "nullable": true + }, + "restoreMode": { + "description": "Where the backup is restored. Allowed values: in_place, clone, copy. Use \"clone\" to recover onto a second workload beside this database and leave it serving until you promote \u2014 the endpoint and credentials do not change. Use \"copy\" to recover onto a separate database with its own endpoint, either one you name with targetDatabaseId or one Cloud provisions. Use \"in_place\" to replay the backup over this database. Defaults to \"copy\" when a targetDatabaseId is given, \"in_place\" otherwise.", + "type": "string", + "example": "in_place", + "nullable": true + }, + "targetName": { + "description": "Display name for the database a copy restoration provisions. Defaults to this database's name followed by \"(restored)\". Max length: 128 chars.", + "type": "string", + "example": "<TARGET_NAME>", + "nullable": true + }, + "autoPromote": { + "description": "Whether a clone restoration switches the database over as soon as the recovery is ready. Default true: the restore finishes with the database serving the recovery point on the endpoint it already had, and the side it replaced kept briefly so the switch can be reversed. Pass false to hold the recovery until you call the promotion endpoint yourself.", + "type": "boolean", + "default": true, + "example": false } } }, @@ -71613,6 +72771,74 @@ ] } }, + "\/postgresql\/{databaseId}\/restorations\/{restorationId}\/promotions": { + "post": { + "summary": "Promote restoration", + "operationId": "postgresqlPromoteRestoration", + "tags": [ + "postgresql" + ], + "description": "Switch the database over to the clone a restoration recovered. The database keeps\nits endpoint and credentials; clients reconnect once. Writes made after the\nrecovery point are discarded, and the side being replaced is retained briefly so\nthe switch can be reversed.", + "responses": { + "202": { + "description": "Restoration", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/dedicatedDatabaseRestoration" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "restorations", + "demo": "postgresql\/promote-restoration.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "restorationId", + "description": "Restoration ID.", + "required": true, + "schema": { + "type": "string", + "example": "<RESTORATION_ID>" + }, + "in": "path" + } + ] + } + }, "\/postgresql\/{databaseId}\/status": { "get": { "summary": "Get status", @@ -73870,6 +75096,12 @@ "example": "2020-10-15T06:38:00.000+00:00", "format": "datetime", "nullable": true + }, + "description": { + "description": "Optional description for the key.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" } }, "required": [ @@ -75855,6 +77087,12 @@ "example": "2020-10-15T06:38:00.000+00:00", "format": "datetime", "nullable": true + }, + "description": { + "description": "Optional description for the key.", + "type": "string", + "example": "<DESCRIPTION>", + "nullable": true } }, "required": [ @@ -76706,6 +77944,12 @@ "example": "<P8_FILE>", "nullable": true }, + "enabled": { + "description": "Browser-based OAuth2 sign-in status. Set to true to enable new session creation through the redirect flow. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. Has no effect on native sign-in, which is controlled by nativeEnabled only.", + "type": "boolean", + "example": false, + "nullable": true + }, "nativeClientIds": { "description": "App bundle IDs accepted as ID token audiences for native Sign in with Apple. For example: com.example.app. Together with the Services ID, these are the only client IDs whose tokens are trusted. Pass an empty array to clear the list.", "type": "array", @@ -76714,12 +77958,6 @@ }, "nullable": true }, - "enabled": { - "description": "Browser-based OAuth2 sign-in status. Set to true to enable new session creation through the redirect flow. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. Has no effect on native sign-in, which is controlled by nativeEnabled only.", - "type": "boolean", - "example": false, - "nullable": true - }, "nativeEnabled": { "description": "Native Sign in with Apple status. This is the only switch for creating sessions from ID tokens obtained on device and is independent of enabled. Needs a Services ID or at least one native client ID to match tokens against, but no key or team ID: this method verifies a signature rather than redeeming an authorization code.", "type": "boolean", @@ -76876,6 +78114,12 @@ "example": "<ENDPOINT>", "nullable": true }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + }, "prompt": { "description": "Array of Auth0 OAuth2 prompt values. If \"none\" is included, it must be the only element. \"none\" means: don't display any authentication or consent screens. \"login\" means: prompt the user to re-authenticate. \"consent\" means: prompt the user for consent. Pass an empty array to use the Auth0 default.", "type": "array", @@ -76907,12 +78151,6 @@ ] }, "nullable": true - }, - "enabled": { - "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", - "type": "boolean", - "example": false, - "nullable": true } } } @@ -77514,6 +78752,12 @@ "example": "<CLIENT_SECRET>", "nullable": true }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + }, "prompt": { "description": "Array with at most one Discord OAuth2 prompt value. \"none\" means: skip the authorization screen for users who already authorized the app with the requested scopes. \"consent\" means: ask users who already authorized the app to approve it again. Pass an empty array to use the Discord default.", "type": "array", @@ -77538,12 +78782,6 @@ ] }, "nullable": true - }, - "enabled": { - "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", - "type": "boolean", - "example": false, - "nullable": true } } } @@ -78070,6 +79308,12 @@ "example": "<CLIENT_SECRET>", "nullable": true }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + }, "prompt": { "description": "Array of GitHub OAuth2 prompt values. \"select_account\" means: prompt the user to select an account. Pass an empty array to use the GitHub default.", "type": "array", @@ -78087,12 +79331,6 @@ ] }, "nullable": true - }, - "enabled": { - "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", - "type": "boolean", - "example": false, - "nullable": true } } } @@ -78277,6 +79515,12 @@ }, "nullable": true }, + "enabled": { + "description": "Browser-based OAuth2 sign-in status. Set to true to enable new session creation through the redirect flow. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. Has no effect on native sign-in, which is controlled by nativeEnabled only.", + "type": "boolean", + "example": false, + "nullable": true + }, "nativeClientIds": { "description": "Additional OAuth2 client IDs accepted as ID token audiences for native sign-in (Android and iOS client IDs). Together with the client ID, which is always accepted, these are the only client IDs whose tokens are trusted. Pass an empty array to clear the list.", "type": "array", @@ -78285,12 +79529,6 @@ }, "nullable": true }, - "enabled": { - "description": "Browser-based OAuth2 sign-in status. Set to true to enable new session creation through the redirect flow. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. Has no effect on native sign-in, which is controlled by nativeEnabled only.", - "type": "boolean", - "example": false, - "nullable": true - }, "nativeEnabled": { "description": "Native Google sign-in status. This is the only switch for creating sessions from ID tokens obtained on device and is independent of enabled. Needs a client ID or at least one native client ID to match tokens against, but no client secret: this method verifies a signature rather than redeeming an authorization code.", "type": "boolean", @@ -78441,6 +79679,12 @@ "example": "<CLIENT_SECRET>", "nullable": true }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + }, "prompt": { "description": "Array of Kakao OAuth2 prompt values. If \"none\" is included, it must be the only element. \"none\" means: don't display any authentication or consent screens. \"login\" means: prompt the user to re-authenticate. \"create\" means: prompt the user to sign up. \"select_account\" means: prompt the user to select an account. Pass an empty array to use the Kakao default.", "type": "array", @@ -78479,12 +79723,6 @@ ] }, "nullable": true - }, - "enabled": { - "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", - "type": "boolean", - "example": false, - "nullable": true } } } @@ -78798,6 +80036,12 @@ "example": "<TENANT>", "nullable": true }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + }, "prompt": { "description": "Array of Microsoft OAuth2 prompt values. \"none\" means: don't display any authentication or consent screens. \"login\" means: prompt the user to re-authenticate. \"consent\" means: prompt the user for consent. \"select_account\" means: prompt the user to select an account. Pass an empty array to use the Microsoft default.", "type": "array", @@ -78836,12 +80080,6 @@ ] }, "nullable": true - }, - "enabled": { - "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", - "type": "boolean", - "example": false, - "nullable": true } } } @@ -79148,6 +80386,12 @@ "example": "<AUTHORIZATION_SERVER_ID>", "nullable": true }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + }, "prompt": { "description": "Array of Okta OAuth2 prompt values. If \"none\" is included, it must be the only element. \"none\" means: don't display any authentication or consent screens. \"login\" means: prompt the user to re-authenticate. \"consent\" means: prompt the user for consent. Pass an empty array to use the Okta default.", "type": "array", @@ -79179,12 +80423,6 @@ ] }, "nullable": true - }, - "enabled": { - "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", - "type": "boolean", - "example": false, - "nullable": true } } } @@ -79555,6 +80793,12 @@ "example": "<CUSTOMER_SECRET>", "nullable": true }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + }, "prompt": { "description": "Array of Salesforce OAuth2 prompt values. \"login\" means: prompt the user to re-authenticate. \"consent\" means: prompt the user for consent. Pass an empty array to use the Salesforce default.", "type": "array", @@ -79579,12 +80823,6 @@ ] }, "nullable": true - }, - "enabled": { - "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", - "type": "boolean", - "example": false, - "nullable": true } } } @@ -80555,6 +81793,12 @@ "example": "<CLIENT_SECRET>", "nullable": true }, + "enabled": { + "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", + "type": "boolean", + "example": false, + "nullable": true + }, "prompt": { "description": "Array of Zoho OAuth2 prompt values. \"consent\" means: prompt the user for consent. Pass an empty array to use the Zoho default.", "type": "array", @@ -80572,12 +81816,6 @@ ] }, "nullable": true - }, - "enabled": { - "description": "OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.", - "type": "boolean", - "example": false, - "nullable": true } } } @@ -82877,7 +84115,7 @@ "tags": [ "project" ], - "description": "Updating this policy allows you to control if new passwords are checked against most common passwords dictionary. When enabled, and user changes their password, password must not be contained in the dictionary.", + "description": "Updating this policy allows you to control if new passwords are checked against most common passwords dictionary. When enabled, and user changes their password, password must not be contained in the dictionary.\n\nCustom denyList entries use case-sensitive equality and apply only while this policy is enabled. Omit denyList or pass null to preserve it, pass an array to replace it, or pass [] to clear it. Entries are stored without trimming or deduplication. Existing passwords remain valid for sign-in and password confirmation. The combined serialized project authentication configuration must fit within 16,384 characters, even when each list meets its entry limits.", "responses": { "200": { "description": "Project", @@ -82927,6 +84165,14 @@ "description": "Toggle password dictionary policy. Set to true if you want password change to block passwords in the dictionary, or false to allow them. When changing this policy, existing passwords remain valid.", "type": "boolean", "example": false + }, + "denyList": { + "description": "Custom blocked values using case-sensitive equality. Up to 100 entries of 1 to 256 characters. Omit or pass null to preserve, an array to replace, or [] to clear. Combined authentication settings must fit within 16,384 characters.", + "type": "array", + "items": { + "type": "string" + }, + "nullable": true } }, "required": [ @@ -83015,7 +84261,7 @@ "tags": [ "project" ], - "description": "Updating this policy allows you to control if password strength is checked against personal data. When enabled, and user sets or changes their password, the password must not contain user ID, name, email or phone number.", + "description": "Updating this policy allows you to control if password strength is checked against personal data. When enabled, and user sets or changes their password, the password must not contain user ID, name, email or phone number.\n\nCustom denyList entries use case-insensitive substring matching and apply only while this policy is enabled. Omit denyList or pass null to preserve it, pass an array to replace it, or pass [] to clear it. Entries are stored without trimming or deduplication. Existing passwords remain valid for sign-in and password confirmation. The combined serialized project authentication configuration must fit within 16,384 characters, even when each list meets its entry limits.\nPassword recovery also checks the recovered user profile, closing the previous gap in profile-based personal-data validation.", "responses": { "200": { "description": "Project", @@ -83065,6 +84311,14 @@ "description": "Toggle password personal data policy. Set to true if you want to block passwords including user's personal data, or false to allow it. When changing this policy, existing passwords remain valid.", "type": "boolean", "example": false + }, + "denyList": { + "description": "Custom blocked values using case-insensitive substring matching. Up to 100 entries of 1 to 256 characters. Omit or pass null to preserve, an array to replace, or [] to clear. Combined authentication settings must fit within 16,384 characters.", + "type": "array", + "items": { + "type": "string" + }, + "nullable": true } }, "required": [ @@ -86793,6 +88047,12 @@ "type": "boolean", "default": true, "example": false + }, + "description": { + "description": "Optional description for the variable.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" } }, "required": [ @@ -86941,6 +88201,12 @@ "type": "boolean", "example": false, "nullable": true + }, + "description": { + "description": "Optional description for the variable.", + "type": "string", + "example": "<DESCRIPTION>", + "nullable": true } } } @@ -88153,7 +89419,7 @@ "parameters": [ { "name": "queries", - "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: domain, type, trigger, deploymentResourceType, deploymentResourceId, deploymentId, deploymentVcsProviderBranch", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: domain, type, trigger, deploymentResourceType, deploymentResourceId, deploymentId, deploymentVcsProviderBranch, protocol", "required": false, "schema": { "type": "array", @@ -88535,6 +89801,83 @@ } } }, + "\/proxy\/rules\/smtp": { + "post": { + "summary": "Create SMTP function rule", + "operationId": "proxyCreateSMTPRule", + "tags": [ + "proxy" + ], + "description": "Create an SMTP ingress rule that asynchronously executes an Appwrite Function for incoming email.", + "responses": { + "201": { + "description": "Rule", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/proxyRule" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "rules", + "demo": "proxy\/create-smtp-rule.md", + "rate-limit": 10, + "rate-time": 60, + "rate-key": "userId:{userId}, url:{url}", + "scope": "rules.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "domain": { + "description": "Domain that receives email.", + "type": "string", + "example": "example.com" + }, + "functionId": { + "description": "ID of function to execute.", + "type": "string", + "example": "<FUNCTION_ID>" + }, + "branch": { + "description": "Name of VCS branch to deploy changes automatically.", + "type": "string", + "default": "", + "example": "<BRANCH>" + } + }, + "required": [ + "domain", + "functionId" + ] + } + } + } + } + } + }, "\/proxy\/rules\/{ruleId}": { "get": { "summary": "Get rule", @@ -90984,6 +92327,12 @@ } ] } + }, + "description": { + "description": "Optional description for the site.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" } }, "required": [ @@ -93409,6 +94758,12 @@ ] }, "nullable": true + }, + "description": { + "description": "Optional description for the site.", + "type": "string", + "example": "<DESCRIPTION>", + "nullable": true } }, "required": [ @@ -94745,6 +96100,12 @@ "type": "boolean", "default": true, "example": false + }, + "description": { + "description": "Optional description for the variable.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" } }, "required": [ @@ -94913,6 +96274,12 @@ "type": "boolean", "example": false, "nullable": true + }, + "description": { + "description": "Optional description for the variable.", + "type": "string", + "example": "<DESCRIPTION>", + "nullable": true } } } @@ -95206,6 +96573,12 @@ "type": "boolean", "default": true, "example": false + }, + "description": { + "description": "Optional description for the bucket.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" } }, "required": [ @@ -95429,6 +96802,12 @@ "type": "boolean", "default": true, "example": false + }, + "description": { + "description": "Optional description for the bucket.", + "type": "string", + "example": "<DESCRIPTION>", + "nullable": true } }, "required": [ @@ -96587,6 +97966,12 @@ "default": true, "example": false }, + "description": { + "description": "Optional description for the database.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" + }, "specification": { "description": "Database specification. Defaults to `serverless`, which creates the database on the shared pool. Any other value provisions a dedicated database on that specification.", "type": "string", @@ -97268,6 +98653,12 @@ "default": true, "example": false }, + "description": { + "description": "Optional description for the database.", + "type": "string", + "example": "<DESCRIPTION>", + "nullable": true + }, "specification": { "description": "Database specification. Resizing between dedicated specifications changes cpu, memory, storage and the connection ceiling via a rolling cutover with zero downtime. Moving a `serverless` database onto a dedicated specification is a data migration, not a resize.", "type": "string", @@ -97481,7 +98872,7 @@ "tags": [ "tablesDB" ], - "description": "Start migrating a serverless TablesDB database onto a dedicated MySQL compute. Data is copied to the target while the source stays live, with a brief read-only window during cutover.", + "description": "Start migrating a serverless TablesDB database onto a dedicated MySQL compute. Data is copied to the target while the source stays live. Reads continue throughout. Row writes are held for up to a few seconds while routing switches to the dedicated compute; a write the switch has not absorbed within that hold is refused with `database_migration_cutover` and can be retried. Schema changes (tables, columns, indexes) are refused from creation until the cutover completes, and resume once the migration is `soaking`.", "responses": { "201": { "description": "Database Migration", @@ -97691,7 +99082,7 @@ "tags": [ "tablesDB" ], - "description": "Cut a verified TablesDB migration over to its dedicated compute. Only applies to a migration created with `autoCutover` disabled, which waits at `ready_to_cutover` until this is called. The routing flip happens shortly after this returns, with a brief read-only window. One call buys one attempt: a cutover that fails a check returns the migration to `verifying` and parks it again, so call this once more to retry.", + "description": "Cut a verified TablesDB migration over to its dedicated compute. Only applies to a migration created with `autoCutover` disabled, which waits at `ready_to_cutover` until this is called. The routing flip happens shortly after this returns. Reads are unaffected; row writes are held for up to a few seconds while it lands, and a write the flip has not absorbed within that hold is refused with `database_migration_cutover` and can be retried. One call buys one attempt: a cutover that fails a check returns the migration to `verifying` and parks it again, so call this once more to retry.", "responses": { "200": { "description": "Database Migration", @@ -98167,6 +99558,12 @@ "items": { "type": "object" } + }, + "description": { + "description": "Optional description for the table.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" } }, "required": [ @@ -98356,6 +99753,12 @@ "type": "boolean", "default": false, "example": false + }, + "description": { + "description": "Optional description for the table.", + "type": "string", + "example": "<DESCRIPTION>", + "nullable": true } } } @@ -98636,6 +100039,12 @@ "type": "boolean", "default": false, "example": false + }, + "description": { + "description": "Optional description for the column.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" } }, "required": [ @@ -98766,6 +100175,12 @@ "type": "string", "example": "<NEW_KEY>", "nullable": true + }, + "description": { + "description": "Optional description for the column.", + "type": "string", + "example": "<DESCRIPTION>", + "nullable": true } }, "required": [ @@ -98876,6 +100291,12 @@ "type": "boolean", "default": false, "example": false + }, + "description": { + "description": "Optional description for the column.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" } }, "required": [ @@ -98991,6 +100412,12 @@ "type": "string", "example": "<NEW_KEY>", "nullable": true + }, + "description": { + "description": "Optional description for the column.", + "type": "string", + "example": "<DESCRIPTION>", + "nullable": true } }, "required": [ @@ -99102,6 +100529,12 @@ "type": "boolean", "default": false, "example": false + }, + "description": { + "description": "Optional description for the column.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" } }, "required": [ @@ -99218,6 +100651,12 @@ "type": "string", "example": "<NEW_KEY>", "nullable": true + }, + "description": { + "description": "Optional description for the column.", + "type": "string", + "example": "<DESCRIPTION>", + "nullable": true } }, "required": [ @@ -99329,6 +100768,12 @@ "type": "boolean", "default": false, "example": false + }, + "description": { + "description": "Optional description for the column.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" } }, "required": [ @@ -99445,6 +100890,12 @@ "type": "string", "example": "<NEW_KEY>", "nullable": true + }, + "description": { + "description": "Optional description for the column.", + "type": "string", + "example": "<DESCRIPTION>", + "nullable": true } }, "required": [ @@ -99566,6 +101017,12 @@ "type": "boolean", "default": false, "example": false + }, + "description": { + "description": "Optional description for the column.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" } }, "required": [ @@ -99693,6 +101150,12 @@ "type": "string", "example": "<NEW_KEY>", "nullable": true + }, + "description": { + "description": "Optional description for the column.", + "type": "string", + "example": "<DESCRIPTION>", + "nullable": true } }, "required": [ @@ -99819,6 +101282,12 @@ "type": "boolean", "default": false, "example": false + }, + "description": { + "description": "Optional description for the column.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" } }, "required": [ @@ -99949,6 +101418,12 @@ "type": "string", "example": "<NEW_KEY>", "nullable": true + }, + "description": { + "description": "Optional description for the column.", + "type": "string", + "example": "<DESCRIPTION>", + "nullable": true } }, "required": [ @@ -100074,6 +101549,12 @@ "type": "boolean", "default": false, "example": false + }, + "description": { + "description": "Optional description for the column.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" } }, "required": [ @@ -100204,6 +101685,12 @@ "type": "string", "example": "<NEW_KEY>", "nullable": true + }, + "description": { + "description": "Optional description for the column.", + "type": "string", + "example": "<DESCRIPTION>", + "nullable": true } }, "required": [ @@ -100314,6 +101801,12 @@ "type": "boolean", "default": false, "example": false + }, + "description": { + "description": "Optional description for the column.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" } }, "required": [ @@ -100429,6 +101922,12 @@ "type": "string", "example": "<NEW_KEY>", "nullable": true + }, + "description": { + "description": "Optional description for the column.", + "type": "string", + "example": "<DESCRIPTION>", + "nullable": true } }, "required": [ @@ -100553,6 +102052,12 @@ } }, "nullable": true + }, + "description": { + "description": "Optional description for the column.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" } }, "required": [ @@ -100688,6 +102193,12 @@ "type": "string", "example": "<NEW_KEY>", "nullable": true + }, + "description": { + "description": "Optional description for the column.", + "type": "string", + "example": "<DESCRIPTION>", + "nullable": true } }, "required": [ @@ -100803,6 +102314,12 @@ "type": "boolean", "default": false, "example": false + }, + "description": { + "description": "Optional description for the column.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" } }, "required": [ @@ -100918,6 +102435,12 @@ "type": "string", "example": "<NEW_KEY>", "nullable": true + }, + "description": { + "description": "Optional description for the column.", + "type": "string", + "example": "<DESCRIPTION>", + "nullable": true } }, "required": [ @@ -101034,6 +102557,12 @@ "type": "boolean", "default": false, "example": false + }, + "description": { + "description": "Optional description for the column.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" } }, "required": [ @@ -101149,6 +102678,12 @@ "type": "string", "example": "<NEW_KEY>", "nullable": true + }, + "description": { + "description": "Optional description for the column.", + "type": "string", + "example": "<DESCRIPTION>", + "nullable": true } }, "required": [ @@ -101260,6 +102795,12 @@ "format": "double" }, "nullable": true + }, + "description": { + "description": "Optional description for the column.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" } }, "required": [ @@ -101382,6 +102923,12 @@ "type": "string", "example": "<NEW_KEY>", "nullable": true + }, + "description": { + "description": "Optional description for the column.", + "type": "string", + "example": "<DESCRIPTION>", + "nullable": true } }, "required": [ @@ -101514,6 +103061,12 @@ } }, "nullable": true + }, + "description": { + "description": "Optional description for the column.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" } }, "required": [ @@ -101658,6 +103211,12 @@ "type": "string", "example": "<NEW_KEY>", "nullable": true + }, + "description": { + "description": "Optional description for the column.", + "type": "string", + "example": "<DESCRIPTION>", + "nullable": true } }, "required": [ @@ -101834,6 +103393,12 @@ "title": "setNull" } ] + }, + "description": { + "description": "Optional description for the column.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" } }, "required": [ @@ -101968,6 +103533,12 @@ "type": "string", "example": "<NEW_KEY>", "nullable": true + }, + "description": { + "description": "Optional description for the column.", + "type": "string", + "example": "<DESCRIPTION>", + "nullable": true } } } @@ -102090,6 +103661,12 @@ "type": "boolean", "default": false, "example": false + }, + "description": { + "description": "Optional description for the column.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" } }, "required": [ @@ -102217,6 +103794,12 @@ "type": "string", "example": "<NEW_KEY>", "nullable": true + }, + "description": { + "description": "Optional description for the column.", + "type": "string", + "example": "<DESCRIPTION>", + "nullable": true } }, "required": [ @@ -102333,6 +103916,12 @@ "type": "boolean", "default": false, "example": false + }, + "description": { + "description": "Optional description for the column.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" } }, "required": [ @@ -102448,6 +104037,12 @@ "type": "string", "example": "<NEW_KEY>", "nullable": true + }, + "description": { + "description": "Optional description for the column.", + "type": "string", + "example": "<DESCRIPTION>", + "nullable": true } }, "required": [ @@ -102559,6 +104154,12 @@ "type": "boolean", "default": false, "example": false + }, + "description": { + "description": "Optional description for the column.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" } }, "required": [ @@ -102675,6 +104276,12 @@ "type": "string", "example": "<NEW_KEY>", "nullable": true + }, + "description": { + "description": "Optional description for the column.", + "type": "string", + "example": "<DESCRIPTION>", + "nullable": true } }, "required": [ @@ -102797,6 +104404,12 @@ "type": "boolean", "default": false, "example": false + }, + "description": { + "description": "Optional description for the column.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" } }, "required": [ @@ -102920,6 +104533,12 @@ "type": "string", "example": "<NEW_KEY>", "nullable": true + }, + "description": { + "description": "Optional description for the column.", + "type": "string", + "example": "<DESCRIPTION>", + "nullable": true } }, "required": [ @@ -103734,6 +105353,12 @@ "items": { "type": "integer" } + }, + "description": { + "description": "Optional description for the index.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" } }, "required": [ @@ -103909,7 +105534,7 @@ "tags": [ "tablesDB" ], - "description": "Get a list of all the user's rows in a given table. You can use the query params to filter your results.", + "description": "Get a list of all the user's rows in a given table. You can use the query params to filter your results.\n\nRows returned by aggregate, groupBy or distinct queries hold only the columns they select, group or aggregate, typed as a row types them, with a joined column named by its join alias (`alias.column`). They have no `$id`, `$sequence`, `$createdAt`, `$updatedAt`, `$permissions`, `$databaseId` or `$tableId` unless they select or group it, and neither does a right or full join row that no row of this table matched.", "responses": { "200": { "description": "Rows List", @@ -104009,7 +105634,7 @@ }, { "name": "ttl", - "description": "TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, table, schema version (columns and indexes), caller authorization roles, and the exact query \u2014 so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; row writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Must be between 0 and 86400 (24 hours).", + "description": "TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, table, schema version (columns and indexes), caller authorization roles, and the exact query \u2014 so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; row writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Lists with join queries are not cached. Must be between 0 and 86400 (24 hours).", "required": false, "schema": { "type": "integer", @@ -104585,6 +106210,118 @@ ] } }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows\/query": { + "post": { + "summary": "Create query", + "operationId": "tablesDBCreateQuery", + "tags": [ + "tablesDB" + ], + "description": "Get a list of all the user's rows in a given table using a POST request. This behaves identically to the list rows endpoint but accepts the queries in the request body, allowing much larger `queries` arrays than can fit in a URL query string.\n", + "responses": { + "200": { + "description": "Rows List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/rowList" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "group": "rows", + "demo": "tablesdb\/create-query.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": [ + "rows.read", + "documents.read" + ], + "platforms": [ + "console", + "client", + "server" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/products\/databases\/tables#create-table).", + "required": true, + "schema": { + "type": "string", + "example": "<TABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "queries": { + "description": "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.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + }, + "transactionId": { + "description": "Transaction ID to read uncommitted changes within the transaction.", + "type": "string", + "example": "<TRANSACTION_ID>", + "nullable": true + }, + "total": { + "description": "When set to false, the total count returned will be 0 and will not be calculated.", + "type": "boolean", + "default": true, + "example": false + }, + "ttl": { + "description": "TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, table, schema version (columns and indexes), caller authorization roles, and the exact query \u2014 so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; row writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Lists with join queries are not cached. Must be between 0 and 86400 (24 hours).", + "type": "integer", + "default": 0, + "example": 0, + "format": "int32" + } + } + } + } + } + } + } + }, "\/tablesdb\/{databaseId}\/tables\/{tableId}\/rows\/{rowId}": { "get": { "summary": "Get row", @@ -113877,6 +115614,12 @@ "default": true, "example": false }, + "description": { + "description": "Optional description for the database.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" + }, "specification": { "description": "Database specification. Defaults to `serverless`, which creates the database on the shared pool. Any other value provisions a dedicated database on that specification.", "type": "string", @@ -114556,6 +116299,12 @@ "default": true, "example": false }, + "description": { + "description": "Optional description for the database.", + "type": "string", + "example": "<DESCRIPTION>", + "nullable": true + }, "specification": { "description": "Database specification. Resizing between dedicated specifications changes cpu, memory, storage and the connection ceiling via a rolling cutover with zero downtime. Moving a `serverless` database onto a dedicated specification is a data migration, not a resize.", "type": "string", @@ -114824,6 +116573,12 @@ "type": "boolean", "default": true, "example": false + }, + "description": { + "description": "Optional description for the collection.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" } }, "required": [ @@ -115008,6 +116763,12 @@ "default": true, "example": false, "nullable": true + }, + "description": { + "description": "Optional description for the collection.", + "type": "string", + "example": "<DESCRIPTION>", + "nullable": true } }, "required": [ @@ -116592,6 +118353,12 @@ "items": { "type": "integer" } + }, + "description": { + "description": "Optional description for the index.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" } }, "required": [ @@ -118741,6 +120508,12 @@ "type": "string", "example": "<SECRET>", "nullable": true + }, + "description": { + "description": "Optional description for the webhook.", + "type": "string", + "default": "", + "example": "<DESCRIPTION>" } }, "required": [ @@ -118917,6 +120690,12 @@ "example": "password", "format": "password", "nullable": true + }, + "description": { + "description": "Optional description for the webhook.", + "type": "string", + "example": "<DESCRIPTION>", + "nullable": true } }, "required": [ @@ -121103,6 +122882,12 @@ "example": "My Database", "default": "" }, + "description": { + "type": "string", + "description": "Optional description for the database.", + "example": "Customer orders and invoices.", + "default": "" + }, "$createdAt": { "type": "string", "description": "Database creation date in ISO 8601 format.", @@ -121352,6 +123137,7 @@ "required": [ "$id", "name", + "description", "$createdAt", "$updatedAt", "enabled", @@ -121360,6 +123146,7 @@ "example": { "$id": "5e5ea5c16897e", "name": "My Database", + "description": "Customer orders and invoices.", "$createdAt": "2020-10-15T06:38:00.000+00:00", "$updatedAt": "2020-10-15T06:38:00.000+00:00", "enabled": false, @@ -121474,6 +123261,12 @@ "example": "My Collection", "default": "" }, + "description": { + "type": "string", + "description": "Optional description for the collection.", + "example": "Movies available in the catalog.", + "default": "" + }, "enabled": { "type": "boolean", "description": "Collection enabled. Can be 'enabled' or 'disabled'. When disabled, the collection is inaccessible to users, but remains accessible to Server SDKs using API keys.", @@ -121909,6 +123702,7 @@ "$permissions", "databaseId", "name", + "description", "enabled", "documentSecurity", "attributes", @@ -121925,6 +123719,7 @@ ], "databaseId": "5e5ea5c16897e", "name": "My Collection", + "description": "Movies available in the catalog.", "enabled": false, "documentSecurity": true, "attributes": {}, @@ -122357,6 +124152,12 @@ "example": "fullName", "default": "" }, + "description": { + "type": "string", + "description": "Optional description for the attribute.", + "example": "Name shown on the public profile.", + "default": "" + }, "type": { "type": "string", "description": "Attribute type.", @@ -122460,6 +124261,7 @@ }, "required": [ "key", + "description", "type", "status", "error", @@ -122470,6 +124272,7 @@ ], "example": { "key": "fullName", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -122492,6 +124295,12 @@ "example": "count", "default": "" }, + "description": { + "type": "string", + "description": "Optional description for the attribute.", + "example": "Name shown on the public profile.", + "default": "" + }, "type": { "type": "string", "description": "Attribute type.", @@ -122596,6 +124405,7 @@ }, "required": [ "key", + "description", "type", "status", "error", @@ -122605,6 +124415,7 @@ ], "example": { "key": "count", + "description": "Name shown on the public profile.", "type": "integer", "status": "available", "error": "string", @@ -122627,6 +124438,12 @@ "example": "count", "default": "" }, + "description": { + "type": "string", + "description": "Optional description for the attribute.", + "example": "Name shown on the public profile.", + "default": "" + }, "type": { "type": "string", "description": "Attribute type.", @@ -122731,6 +124548,7 @@ }, "required": [ "key", + "description", "type", "status", "error", @@ -122740,6 +124558,7 @@ ], "example": { "key": "count", + "description": "Name shown on the public profile.", "type": "bigint", "status": "available", "error": "string", @@ -122762,6 +124581,12 @@ "example": "percentageCompleted", "default": "" }, + "description": { + "type": "string", + "description": "Optional description for the attribute.", + "example": "Name shown on the public profile.", + "default": "" + }, "type": { "type": "string", "description": "Attribute type.", @@ -122866,6 +124691,7 @@ }, "required": [ "key", + "description", "type", "status", "error", @@ -122875,6 +124701,7 @@ ], "example": { "key": "percentageCompleted", + "description": "Name shown on the public profile.", "type": "double", "status": "available", "error": "string", @@ -122897,6 +124724,12 @@ "example": "isEnabled", "default": "" }, + "description": { + "type": "string", + "description": "Optional description for the attribute.", + "example": "Name shown on the public profile.", + "default": "" + }, "type": { "type": "string", "description": "Attribute type.", @@ -122986,6 +124819,7 @@ }, "required": [ "key", + "description", "type", "status", "error", @@ -122995,6 +124829,7 @@ ], "example": { "key": "isEnabled", + "description": "Name shown on the public profile.", "type": "boolean", "status": "available", "error": "string", @@ -123015,6 +124850,12 @@ "example": "userEmail", "default": "" }, + "description": { + "type": "string", + "description": "Optional description for the attribute.", + "example": "Name shown on the public profile.", + "default": "" + }, "type": { "type": "string", "description": "Attribute type.", @@ -123110,6 +124951,7 @@ }, "required": [ "key", + "description", "type", "status", "error", @@ -123120,6 +124962,7 @@ ], "example": { "key": "userEmail", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -123141,6 +124984,12 @@ "example": "status", "default": "" }, + "description": { + "type": "string", + "description": "Optional description for the attribute.", + "example": "Name shown on the public profile.", + "default": "" + }, "type": { "type": "string", "description": "Attribute type.", @@ -123246,6 +125095,7 @@ }, "required": [ "key", + "description", "type", "status", "error", @@ -123257,6 +125107,7 @@ ], "example": { "key": "status", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -123279,6 +125130,12 @@ "example": "ipAddress", "default": "" }, + "description": { + "type": "string", + "description": "Optional description for the attribute.", + "example": "Name shown on the public profile.", + "default": "" + }, "type": { "type": "string", "description": "Attribute type.", @@ -123374,6 +125231,7 @@ }, "required": [ "key", + "description", "type", "status", "error", @@ -123384,6 +125242,7 @@ ], "example": { "key": "ipAddress", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -123405,6 +125264,12 @@ "example": "githubUrl", "default": "" }, + "description": { + "type": "string", + "description": "Optional description for the attribute.", + "example": "Name shown on the public profile.", + "default": "" + }, "type": { "type": "string", "description": "Attribute type.", @@ -123500,6 +125365,7 @@ }, "required": [ "key", + "description", "type", "status", "error", @@ -123510,6 +125376,7 @@ ], "example": { "key": "githubUrl", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -123531,6 +125398,12 @@ "example": "birthDay", "default": "" }, + "description": { + "type": "string", + "description": "Optional description for the attribute.", + "example": "Name shown on the public profile.", + "default": "" + }, "type": { "type": "string", "description": "Attribute type.", @@ -123625,6 +125498,7 @@ }, "required": [ "key", + "description", "type", "status", "error", @@ -123635,6 +125509,7 @@ ], "example": { "key": "birthDay", + "description": "Name shown on the public profile.", "type": "datetime", "status": "available", "error": "string", @@ -123656,6 +125531,12 @@ "example": "fullName", "default": "" }, + "description": { + "type": "string", + "description": "Optional description for the attribute.", + "example": "Name shown on the public profile.", + "default": "" + }, "type": { "type": "string", "description": "Attribute type.", @@ -123774,6 +125655,7 @@ }, "required": [ "key", + "description", "type", "status", "error", @@ -123789,6 +125671,7 @@ ], "example": { "key": "fullName", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -123814,6 +125697,12 @@ "example": "fullName", "default": "" }, + "description": { + "type": "string", + "description": "Optional description for the attribute.", + "example": "Name shown on the public profile.", + "default": "" + }, "type": { "type": "string", "description": "Attribute type.", @@ -123910,6 +125799,7 @@ }, "required": [ "key", + "description", "type", "status", "error", @@ -123919,6 +125809,7 @@ ], "example": { "key": "fullName", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -123942,6 +125833,12 @@ "example": "fullName", "default": "" }, + "description": { + "type": "string", + "description": "Optional description for the attribute.", + "example": "Name shown on the public profile.", + "default": "" + }, "type": { "type": "string", "description": "Attribute type.", @@ -124047,6 +125944,7 @@ }, "required": [ "key", + "description", "type", "status", "error", @@ -124056,6 +125954,7 @@ ], "example": { "key": "fullName", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -124085,6 +125984,12 @@ "example": "fullName", "default": "" }, + "description": { + "type": "string", + "description": "Optional description for the attribute.", + "example": "Name shown on the public profile.", + "default": "" + }, "type": { "type": "string", "description": "Attribute type.", @@ -124205,6 +126110,7 @@ }, "required": [ "key", + "description", "type", "status", "error", @@ -124214,6 +126120,7 @@ ], "example": { "key": "fullName", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -124255,6 +126162,12 @@ "example": "fullName", "default": "" }, + "description": { + "type": "string", + "description": "Optional description for the attribute.", + "example": "Name shown on the public profile.", + "default": "" + }, "type": { "type": "string", "description": "Attribute type.", @@ -124358,6 +126271,7 @@ }, "required": [ "key", + "description", "type", "status", "error", @@ -124368,6 +126282,7 @@ ], "example": { "key": "fullName", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -124390,6 +126305,12 @@ "example": "fullName", "default": "" }, + "description": { + "type": "string", + "description": "Optional description for the attribute.", + "example": "Name shown on the public profile.", + "default": "" + }, "type": { "type": "string", "description": "Attribute type.", @@ -124486,6 +126407,7 @@ }, "required": [ "key", + "description", "type", "status", "error", @@ -124495,6 +126417,7 @@ ], "example": { "key": "fullName", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -124516,6 +126439,12 @@ "example": "fullName", "default": "" }, + "description": { + "type": "string", + "description": "Optional description for the attribute.", + "example": "Name shown on the public profile.", + "default": "" + }, "type": { "type": "string", "description": "Attribute type.", @@ -124612,6 +126541,7 @@ }, "required": [ "key", + "description", "type", "status", "error", @@ -124621,6 +126551,7 @@ ], "example": { "key": "fullName", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -124642,6 +126573,12 @@ "example": "fullName", "default": "" }, + "description": { + "type": "string", + "description": "Optional description for the attribute.", + "example": "Name shown on the public profile.", + "default": "" + }, "type": { "type": "string", "description": "Attribute type.", @@ -124738,6 +126675,7 @@ }, "required": [ "key", + "description", "type", "status", "error", @@ -124747,6 +126685,7 @@ ], "example": { "key": "fullName", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -124802,6 +126741,12 @@ "example": "My Collection", "default": "" }, + "description": { + "type": "string", + "description": "Optional description for the collection.", + "example": "Movies available in the catalog.", + "default": "" + }, "enabled": { "type": "boolean", "description": "Collection enabled. Can be 'enabled' or 'disabled'. When disabled, the collection is inaccessible to users, but remains accessible to Server SDKs using API keys.", @@ -124873,6 +126818,7 @@ "$permissions", "databaseId", "name", + "description", "enabled", "documentSecurity", "attributes", @@ -124890,6 +126836,7 @@ ], "databaseId": "5e5ea5c16897e", "name": "My Collection", + "description": "Movies available in the catalog.", "enabled": false, "documentSecurity": true, "attributes": {}, @@ -124909,6 +126856,12 @@ "example": "fullName", "default": "" }, + "description": { + "type": "string", + "description": "Optional description for the attribute.", + "example": "Name shown on the public profile.", + "default": "" + }, "type": { "type": "string", "description": "Attribute type.", @@ -124992,6 +126945,7 @@ }, "required": [ "key", + "description", "type", "status", "error", @@ -125001,6 +126955,7 @@ ], "example": { "key": "fullName", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -125020,6 +126975,12 @@ "example": "fullName", "default": "" }, + "description": { + "type": "string", + "description": "Optional description for the attribute.", + "example": "Name shown on the public profile.", + "default": "" + }, "type": { "type": "string", "description": "Attribute type.", @@ -125110,6 +127071,7 @@ }, "required": [ "key", + "description", "type", "status", "error", @@ -125120,6 +127082,7 @@ ], "example": { "key": "fullName", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -125174,6 +127137,12 @@ "example": "My Table", "default": "" }, + "description": { + "type": "string", + "description": "Optional description for the table.", + "example": "Movies available in the catalog.", + "default": "" + }, "enabled": { "type": "boolean", "description": "Table enabled. Can be 'enabled' or 'disabled'. When disabled, the table is inaccessible to users, but remains accessible to Server SDKs using API keys.", @@ -125609,6 +127578,7 @@ "$permissions", "databaseId", "name", + "description", "enabled", "rowSecurity", "columns", @@ -125625,6 +127595,7 @@ ], "databaseId": "5e5ea5c16897e", "name": "My Table", + "description": "Movies available in the catalog.", "enabled": false, "rowSecurity": true, "columns": {}, @@ -126057,6 +128028,12 @@ "example": "fullName", "default": "" }, + "description": { + "type": "string", + "description": "Optional description for the column.", + "example": "Name shown on the public profile.", + "default": "" + }, "type": { "type": "string", "description": "Column type.", @@ -126160,6 +128137,7 @@ }, "required": [ "key", + "description", "type", "status", "error", @@ -126170,6 +128148,7 @@ ], "example": { "key": "fullName", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -126192,6 +128171,12 @@ "example": "count", "default": "" }, + "description": { + "type": "string", + "description": "Optional description for the column.", + "example": "Name shown on the public profile.", + "default": "" + }, "type": { "type": "string", "description": "Column type.", @@ -126296,6 +128281,7 @@ }, "required": [ "key", + "description", "type", "status", "error", @@ -126305,6 +128291,7 @@ ], "example": { "key": "count", + "description": "Name shown on the public profile.", "type": "integer", "status": "available", "error": "string", @@ -126327,6 +128314,12 @@ "example": "count", "default": "" }, + "description": { + "type": "string", + "description": "Optional description for the column.", + "example": "Name shown on the public profile.", + "default": "" + }, "type": { "type": "string", "description": "Column type.", @@ -126431,6 +128424,7 @@ }, "required": [ "key", + "description", "type", "status", "error", @@ -126440,6 +128434,7 @@ ], "example": { "key": "count", + "description": "Name shown on the public profile.", "type": "bigint", "status": "available", "error": "string", @@ -126462,6 +128457,12 @@ "example": "percentageCompleted", "default": "" }, + "description": { + "type": "string", + "description": "Optional description for the column.", + "example": "Name shown on the public profile.", + "default": "" + }, "type": { "type": "string", "description": "Column type.", @@ -126566,6 +128567,7 @@ }, "required": [ "key", + "description", "type", "status", "error", @@ -126575,6 +128577,7 @@ ], "example": { "key": "percentageCompleted", + "description": "Name shown on the public profile.", "type": "double", "status": "available", "error": "string", @@ -126597,6 +128600,12 @@ "example": "isEnabled", "default": "" }, + "description": { + "type": "string", + "description": "Optional description for the column.", + "example": "Name shown on the public profile.", + "default": "" + }, "type": { "type": "string", "description": "Column type.", @@ -126686,6 +128695,7 @@ }, "required": [ "key", + "description", "type", "status", "error", @@ -126695,6 +128705,7 @@ ], "example": { "key": "isEnabled", + "description": "Name shown on the public profile.", "type": "boolean", "status": "available", "error": "string", @@ -126715,6 +128726,12 @@ "example": "userEmail", "default": "" }, + "description": { + "type": "string", + "description": "Optional description for the column.", + "example": "Name shown on the public profile.", + "default": "" + }, "type": { "type": "string", "description": "Column type.", @@ -126810,6 +128827,7 @@ }, "required": [ "key", + "description", "type", "status", "error", @@ -126820,6 +128838,7 @@ ], "example": { "key": "userEmail", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -126841,6 +128860,12 @@ "example": "status", "default": "" }, + "description": { + "type": "string", + "description": "Optional description for the column.", + "example": "Name shown on the public profile.", + "default": "" + }, "type": { "type": "string", "description": "Column type.", @@ -126946,6 +128971,7 @@ }, "required": [ "key", + "description", "type", "status", "error", @@ -126957,6 +128983,7 @@ ], "example": { "key": "status", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -126979,6 +129006,12 @@ "example": "ipAddress", "default": "" }, + "description": { + "type": "string", + "description": "Optional description for the column.", + "example": "Name shown on the public profile.", + "default": "" + }, "type": { "type": "string", "description": "Column type.", @@ -127074,6 +129107,7 @@ }, "required": [ "key", + "description", "type", "status", "error", @@ -127084,6 +129118,7 @@ ], "example": { "key": "ipAddress", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -127105,6 +129140,12 @@ "example": "githubUrl", "default": "" }, + "description": { + "type": "string", + "description": "Optional description for the column.", + "example": "Name shown on the public profile.", + "default": "" + }, "type": { "type": "string", "description": "Column type.", @@ -127200,6 +129241,7 @@ }, "required": [ "key", + "description", "type", "status", "error", @@ -127210,6 +129252,7 @@ ], "example": { "key": "githubUrl", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -127231,6 +129274,12 @@ "example": "birthDay", "default": "" }, + "description": { + "type": "string", + "description": "Optional description for the column.", + "example": "Name shown on the public profile.", + "default": "" + }, "type": { "type": "string", "description": "Column type.", @@ -127325,6 +129374,7 @@ }, "required": [ "key", + "description", "type", "status", "error", @@ -127335,6 +129385,7 @@ ], "example": { "key": "birthDay", + "description": "Name shown on the public profile.", "type": "datetime", "status": "available", "error": "string", @@ -127356,6 +129407,12 @@ "example": "fullName", "default": "" }, + "description": { + "type": "string", + "description": "Optional description for the column.", + "example": "Name shown on the public profile.", + "default": "" + }, "type": { "type": "string", "description": "Column type.", @@ -127474,6 +129531,7 @@ }, "required": [ "key", + "description", "type", "status", "error", @@ -127489,6 +129547,7 @@ ], "example": { "key": "fullName", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -127514,6 +129573,12 @@ "example": "fullName", "default": "" }, + "description": { + "type": "string", + "description": "Optional description for the column.", + "example": "Name shown on the public profile.", + "default": "" + }, "type": { "type": "string", "description": "Column type.", @@ -127610,6 +129675,7 @@ }, "required": [ "key", + "description", "type", "status", "error", @@ -127619,6 +129685,7 @@ ], "example": { "key": "fullName", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -127642,6 +129709,12 @@ "example": "fullName", "default": "" }, + "description": { + "type": "string", + "description": "Optional description for the column.", + "example": "Name shown on the public profile.", + "default": "" + }, "type": { "type": "string", "description": "Column type.", @@ -127747,6 +129820,7 @@ }, "required": [ "key", + "description", "type", "status", "error", @@ -127756,6 +129830,7 @@ ], "example": { "key": "fullName", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -127785,6 +129860,12 @@ "example": "fullName", "default": "" }, + "description": { + "type": "string", + "description": "Optional description for the column.", + "example": "Name shown on the public profile.", + "default": "" + }, "type": { "type": "string", "description": "Column type.", @@ -127905,6 +129986,7 @@ }, "required": [ "key", + "description", "type", "status", "error", @@ -127914,6 +129996,7 @@ ], "example": { "key": "fullName", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -127955,6 +130038,12 @@ "example": "fullName", "default": "" }, + "description": { + "type": "string", + "description": "Optional description for the column.", + "example": "Name shown on the public profile.", + "default": "" + }, "type": { "type": "string", "description": "Column type.", @@ -128058,6 +130147,7 @@ }, "required": [ "key", + "description", "type", "status", "error", @@ -128068,6 +130158,7 @@ ], "example": { "key": "fullName", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -128090,6 +130181,12 @@ "example": "fullName", "default": "" }, + "description": { + "type": "string", + "description": "Optional description for the column.", + "example": "Name shown on the public profile.", + "default": "" + }, "type": { "type": "string", "description": "Column type.", @@ -128186,6 +130283,7 @@ }, "required": [ "key", + "description", "type", "status", "error", @@ -128195,6 +130293,7 @@ ], "example": { "key": "fullName", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -128216,6 +130315,12 @@ "example": "fullName", "default": "" }, + "description": { + "type": "string", + "description": "Optional description for the column.", + "example": "Name shown on the public profile.", + "default": "" + }, "type": { "type": "string", "description": "Column type.", @@ -128312,6 +130417,7 @@ }, "required": [ "key", + "description", "type", "status", "error", @@ -128321,6 +130427,7 @@ ], "example": { "key": "fullName", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -128342,6 +130449,12 @@ "example": "fullName", "default": "" }, + "description": { + "type": "string", + "description": "Optional description for the column.", + "example": "Name shown on the public profile.", + "default": "" + }, "type": { "type": "string", "description": "Column type.", @@ -128438,6 +130551,7 @@ }, "required": [ "key", + "description", "type", "status", "error", @@ -128447,6 +130561,7 @@ ], "example": { "key": "fullName", + "description": "Name shown on the public profile.", "type": "string", "status": "available", "error": "string", @@ -128486,6 +130601,12 @@ "example": "index1", "default": "" }, + "description": { + "type": "string", + "description": "Optional description for the index.", + "example": "Speeds up lookups by email.", + "default": "" + }, "type": { "type": "string", "description": "Index type.", @@ -128575,6 +130696,7 @@ "$createdAt", "$updatedAt", "key", + "description", "type", "status", "error", @@ -128586,6 +130708,7 @@ "$createdAt": "2020-10-15T06:38:00.000+00:00", "$updatedAt": "2020-10-15T06:38:00.000+00:00", "key": "index1", + "description": "Speeds up lookups by email.", "type": "primary", "status": "available", "error": "string", @@ -128622,6 +130745,12 @@ "example": "index1", "default": "" }, + "description": { + "type": "string", + "description": "Optional description for the index.", + "example": "Speeds up lookups by email.", + "default": "" + }, "type": { "type": "string", "description": "Index type.", @@ -128675,6 +130804,7 @@ "$createdAt", "$updatedAt", "key", + "description", "type", "status", "error", @@ -128686,6 +130816,7 @@ "$createdAt": "2020-10-15T06:38:00.000+00:00", "$updatedAt": "2020-10-15T06:38:00.000+00:00", "key": "index1", + "description": "Speeds up lookups by email.", "type": "primary", "status": "available", "error": "string", @@ -130579,6 +132710,12 @@ "example": "Documents", "default": "" }, + "description": { + "type": "string", + "description": "Optional description for the bucket.", + "example": "Invoices and receipts uploaded by customers.", + "default": "" + }, "enabled": { "type": "boolean", "description": "Bucket enabled.", @@ -130643,6 +132780,7 @@ "$permissions", "fileSecurity", "name", + "description", "enabled", "maximumFileSize", "allowedFileExtensions", @@ -130661,6 +132799,7 @@ ], "fileSecurity": true, "name": "Documents", + "description": "Invoices and receipts uploaded by customers.", "enabled": false, "maximumFileSize": 100, "allowedFileExtensions": [ @@ -130974,6 +133113,12 @@ "example": "My Site", "default": "" }, + "description": { + "type": "string", + "description": "Optional description for the site.", + "example": "Marketing site for the spring launch.", + "default": "" + }, "enabled": { "type": "boolean", "description": "Site enabled.", @@ -131185,6 +133330,7 @@ "$createdAt", "$updatedAt", "name", + "description", "enabled", "live", "logging", @@ -131222,6 +133368,7 @@ "$createdAt": "2020-10-15T06:38:00.000+00:00", "$updatedAt": "2020-10-15T06:38:00.000+00:00", "name": "My Site", + "description": "Marketing site for the spring launch.", "enabled": false, "live": false, "logging": false, @@ -131504,6 +133651,12 @@ "example": "My Function", "default": "" }, + "description": { + "type": "string", + "description": "Optional description for the function.", + "example": "Sends a welcome email to newly registered users.", + "default": "" + }, "enabled": { "type": "boolean", "description": "Function enabled.", @@ -131699,6 +133852,12 @@ "description": "Machine specification for executions.", "example": "s-1vcpu-512mb", "default": "s-1vcpu-512mb" + }, + "emailEnabled": { + "type": "boolean", + "description": "Whether inbound email (SMTP) may trigger this function. Opt-in; default is false. When disabled, recipients for this function are rejected.", + "example": false, + "default": false } }, "required": [ @@ -131707,6 +133866,7 @@ "$updatedAt", "execute", "name", + "description", "enabled", "live", "logging", @@ -131733,7 +133893,8 @@ "providerBranches", "providerPaths", "buildSpecification", - "runtimeSpecification" + "runtimeSpecification", + "emailEnabled" ], "example": { "$id": "5e5ea5c16897e", @@ -131741,6 +133902,7 @@ "$updatedAt": "2020-10-15T06:38:00.000+00:00", "execute": "users", "name": "My Function", + "description": "Sends a welcome email to newly registered users.", "enabled": false, "live": false, "logging": false, @@ -131774,7 +133936,8 @@ "!docs\/**" ], "buildSpecification": "s-1vcpu-512mb", - "runtimeSpecification": "s-1vcpu-512mb" + "runtimeSpecification": "s-1vcpu-512mb", + "emailEnabled": false } }, "templateFunction": { @@ -133179,7 +135342,7 @@ "default": "" }, "trigger": { - "description": "The trigger that caused the resource to execute. Possible values can be: `http`, `schedule`, or `event`.", + "description": "The trigger that caused the resource to execute. Possible values can be: `http`, `schedule`, `event`, or `email`.", "example": "http", "type": "string", "oneOf": [ @@ -133203,6 +135366,13 @@ "event" ], "title": "event" + }, + { + "type": "string", + "enum": [ + "email" + ], + "title": "email" } ] }, @@ -134147,6 +136317,12 @@ "example": "My Webhook", "default": "" }, + "description": { + "type": "string", + "description": "Optional description for the webhook.", + "example": "Notifies the billing service about new users.", + "default": "" + }, "url": { "type": "string", "description": "Webhook URL endpoint.", @@ -134215,6 +136391,7 @@ "$createdAt", "$updatedAt", "name", + "description", "url", "events", "tls", @@ -134230,6 +136407,7 @@ "$createdAt": "2020-10-15T06:38:00.000+00:00", "$updatedAt": "2020-10-15T06:38:00.000+00:00", "name": "My Webhook", + "description": "Notifies the billing service about new users.", "url": "https:\/\/example.com\/webhook", "events": [ "databases.tables.update", @@ -134272,6 +136450,12 @@ "example": "My API Key", "default": "" }, + "description": { + "type": "string", + "description": "Optional description for the key.", + "example": "Used by the nightly backup job.", + "default": "" + }, "expire": { "type": "string", "description": "Key expiration date in ISO 8601 format.", @@ -134317,6 +136501,7 @@ "$createdAt", "$updatedAt", "name", + "description", "expire", "scopes", "secret", @@ -134328,6 +136513,7 @@ "$createdAt": "2020-10-15T06:38:00.000+00:00", "$updatedAt": "2020-10-15T06:38:00.000+00:00", "name": "My API Key", + "description": "Used by the nightly backup job.", "expire": "2020-10-15T06:38:00.000+00:00", "scopes": "users.read", "secret": "919c2d18fb5d4...a2ae413da83346ad2", @@ -134363,6 +136549,12 @@ "example": "My API Key", "default": "" }, + "description": { + "type": "string", + "description": "Optional description for the key.", + "example": "Used by the nightly backup job.", + "default": "" + }, "expire": { "type": "string", "description": "Key expiration date in ISO 8601 format.", @@ -134408,6 +136600,7 @@ "$createdAt", "$updatedAt", "name", + "description", "expire", "scopes", "secret", @@ -134419,6 +136612,7 @@ "$createdAt": "2020-10-15T06:38:00.000+00:00", "$updatedAt": "2020-10-15T06:38:00.000+00:00", "name": "My API Key", + "description": "Used by the nightly backup job.", "expire": "2020-10-15T06:38:00.000+00:00", "scopes": "users.read", "secret": "919c2d18fb5d4...a2ae413da83346ad2", @@ -137217,15 +139411,30 @@ "description": "Whether password dictionary policy is enabled.", "example": true, "default": false + }, + "denyList": { + "type": "array", + "description": "Custom passwords blocked by case-sensitive equality when enabled.", + "items": { + "type": "string" + }, + "example": [ + "AcmeDefault123!" + ], + "default": [] } }, "required": [ "$id", - "enabled" + "enabled", + "denyList" ], "example": { "$id": "password-dictionary", - "enabled": true + "enabled": true, + "denyList": [ + "AcmeDefault123!" + ] } }, "policyPasswordHistory": { @@ -137329,15 +139538,30 @@ "description": "Whether password personal data policy is enabled.", "example": true, "default": false + }, + "denyList": { + "type": "array", + "description": "Custom terms blocked by case-insensitive substring matching when enabled.", + "items": { + "type": "string" + }, + "example": [ + "appwrite" + ], + "default": [] } }, "required": [ "$id", - "enabled" + "enabled", + "denyList" ], "example": { "$id": "password-dictionary", - "enabled": true + "enabled": true, + "denyList": [ + "appwrite" + ] } }, "policyPasswordPwned": { @@ -138384,6 +140608,12 @@ "example": "API_KEY", "default": "" }, + "description": { + "type": "string", + "description": "Optional description for the variable.", + "example": "Stripe secret key used at checkout.", + "default": "" + }, "value": { "type": "string", "description": "Variable value.", @@ -138414,6 +140644,7 @@ "$createdAt", "$updatedAt", "key", + "description", "value", "secret", "resourceType", @@ -138424,6 +140655,7 @@ "$createdAt": "2020-10-15T06:38:00.000+00:00", "$updatedAt": "2020-10-15T06:38:00.000+00:00", "key": "API_KEY", + "description": "Stripe secret key used at checkout.", "value": "myPa$$word1", "secret": false, "resourceType": "function", @@ -139309,6 +141541,28 @@ "type": "string", "description": "Certificate auto-renewal date in ISO 8601 format.", "example": "datetime" + }, + "protocol": { + "description": "Ingress protocol for the rule.", + "example": "http", + "type": "string", + "oneOf": [ + { + "type": "string", + "enum": [ + "http" + ], + "title": "http" + }, + { + "type": "string", + "enum": [ + "smtp" + ], + "title": "smtp" + } + ], + "default": "http" } }, "required": [ @@ -139325,7 +141579,8 @@ "deploymentVcsProviderBranch", "status", "logs", - "renewAt" + "renewAt", + "protocol" ], "example": { "$id": "5e5ea5c16897e", @@ -139342,7 +141597,8 @@ "deploymentVcsProviderBranch": "main", "status": "verified", "logs": "Verification of DNS records failed with DNS resolver 8.8.8.8. Domain stage.myapp.com does not have DNS record.", - "renewAt": "datetime" + "renewAt": "datetime", + "protocol": "http" } }, "schedule": { @@ -139704,6 +141960,12 @@ "example": "mysql", "default": "mariadb" }, + "supportForAttributes": { + "type": "boolean", + "description": "Whether the database adapter enforces defined attributes.", + "example": true, + "default": true + }, "supportForRelationships": { "type": "boolean", "description": "Whether the database adapter supports relationships.", @@ -139722,6 +141984,18 @@ "example": true, "default": true }, + "supportForAggregations": { + "type": "boolean", + "description": "Whether the database adapter supports aggregation queries.", + "example": true, + "default": true + }, + "supportForJoins": { + "type": "boolean", + "description": "Whether the database adapter supports join queries.", + "example": true, + "default": true + }, "supportForSpatialIndexNull": { "type": "boolean", "description": "Whether the database adapter supports spatial indexes on nullable columns.", @@ -139776,6 +142050,12 @@ "description": "Whether email verification for console users is required. Can be \"true\" or \"false\".", "example": "true", "default": "" + }, + "_APP_DOMAIN_EMAIL": { + "type": "string", + "description": "Appwrite-owned zone for function testing email addresses, delivered to {functionId}@{projectId}.{zone}. Empty when inbound email is not configured.", + "example": "appwrite.email", + "default": "" } }, "required": [ @@ -139797,9 +142077,12 @@ "_APP_OPTIONS_FORCE_HTTPS", "_APP_DOMAINS_NAMESERVERS", "_APP_DB_ADAPTER", + "supportForAttributes", "supportForRelationships", "supportForOperators", "supportForSpatials", + "supportForAggregations", + "supportForJoins", "supportForSpatialIndexNull", "supportForFulltextWildcard", "supportForMultipleFulltextIndexes", @@ -139808,7 +142091,8 @@ "supportForSchemas", "maxIndexLength", "supportForIntegerIds", - "_APP_CONSOLE_EMAIL_VERIFICATION" + "_APP_CONSOLE_EMAIL_VERIFICATION", + "_APP_DOMAIN_EMAIL" ], "example": { "_APP_DOMAIN_TARGET_CNAME": "appwrite.io", @@ -139835,9 +142119,12 @@ "_APP_OPTIONS_FORCE_HTTPS": "enabled", "_APP_DOMAINS_NAMESERVERS": "ns1.example.com,ns2.example.com", "_APP_DB_ADAPTER": "mysql", + "supportForAttributes": true, "supportForRelationships": true, "supportForOperators": true, "supportForSpatials": true, + "supportForAggregations": true, + "supportForJoins": true, "supportForSpatialIndexNull": false, "supportForFulltextWildcard": true, "supportForMultipleFulltextIndexes": true, @@ -139846,7 +142133,8 @@ "supportForSchemas": true, "maxIndexLength": 768, "supportForIntegerIds": true, - "_APP_CONSOLE_EMAIL_VERIFICATION": "true" + "_APP_CONSOLE_EMAIL_VERIFICATION": "true", + "_APP_DOMAIN_EMAIL": "appwrite.email" } }, "consoleOAuth2ProviderParameter": { @@ -140711,6 +142999,12 @@ "example": "events", "default": "" }, + "description": { + "type": "string", + "description": "Optional description for the topic.", + "example": "Order status updates sent to customers.", + "default": "" + }, "emailTotal": { "type": "integer", "description": "Total count of email subscribers subscribed to the topic.", @@ -140754,7 +143048,7 @@ }, "expiry": { "type": "integer", - "description": "Message retention in seconds for offline delivery.", + "description": "Message retention in seconds for offline delivery. Null inherits the lowest expiry of the project's enabled Appwrite providers, or the 7-day ledger window if none sets one.", "format": "int32", "example": 604800, "nullable": true @@ -140765,6 +143059,7 @@ "$createdAt", "$updatedAt", "name", + "description", "emailTotal", "smsTotal", "pushTotal", @@ -140775,6 +143070,7 @@ "$createdAt": "2020-10-15T06:38:00.000+00:00", "$updatedAt": "2020-10-15T06:38:00.000+00:00", "name": "events", + "description": "Order status updates sent to customers.", "emailTotal": 100, "smsTotal": 100, "pushTotal": 100, @@ -141377,6 +143673,13 @@ "example": 7, "default": 0 }, + "project-environment": { + "type": "integer", + "description": "Number of project environments to be migrated. Each is recreated under a new ID, empty: its own resources belong to a separate project.", + "format": "int32", + "example": 2, + "default": 0 + }, "site": { "type": "integer", "description": "Number of sites to be migrated.", @@ -141460,6 +143763,7 @@ "smtp", "rule", "project-email-template", + "project-environment", "site", "provider", "topic", @@ -141490,6 +143794,7 @@ "smtp": 1, "rule": 5, "project-email-template": 7, + "project-environment": 2, "site": 5, "provider": 5, "topic": 10, @@ -144178,6 +146483,12 @@ "example": 60, "default": 0 }, + "functionsAllowCron": { + "type": "boolean", + "description": "Does the plan allow cron function schedules or only intervals.", + "example": true, + "default": true + }, "databasesAllowEncrypt": { "type": "boolean", "description": "Does the plan support encrypted string attributes or not.", @@ -144319,6 +146630,7 @@ "deploymentSize", "buildSize", "functionsIntervalMinimum", + "functionsAllowCron", "databasesAllowEncrypt", "group", "databaseComputeCredit" @@ -144404,6 +146716,7 @@ "deploymentSize": 30, "buildSize": 2000, "functionsIntervalMinimum": 60, + "functionsAllowCron": true, "databasesAllowEncrypt": false, "limits": null, "group": "pro", @@ -146073,6 +148386,12 @@ "example": "backup", "default": "backup" }, + "restoreMode": { + "type": "string", + "description": "Where the backup was restored. Possible values: in_place (replayed over the database that took the backup), clone (recovered onto a second workload beside the database, which keeps serving until the clone is promoted onto its endpoint), copy (recovered onto a separate database with its own endpoint).", + "example": "clone", + "default": "in_place" + }, "status": { "type": "string", "description": "Restoration status. Possible values: pending (queued for processing), running (currently in progress), completed (successfully finished), failed (encountered an error).", @@ -146110,6 +148429,7 @@ "databaseId", "projectId", "type", + "restoreMode", "status", "error" ], @@ -146121,6 +148441,7 @@ "projectId": "5e5ea5c16897e", "backupId": "5e5ea5c16897e", "type": "backup", + "restoreMode": "clone", "status": "completed", "targetTime": "2020-10-15T06:38:00.000+00:00", "startedAt": "2020-10-15T06:38:00.000+00:00", diff --git a/src/client.ts b/src/client.ts index 08200d43..81233432 100644 --- a/src/client.ts +++ b/src/client.ts @@ -1,6 +1,6 @@ import { Models } from './models'; import { Channel, ActionableChannel, ResolvedChannel } from './channel'; -import { Query } from './query'; +import { flattenParam, normalizeQueries, type QueryInput } from './query'; import { ID } from './id'; import JSONbigModule from 'json-bigint'; const JSONbigParser = JSONbigModule({ storeAsString: false }); @@ -61,6 +61,20 @@ export function applyDefaults<T>(value: T, tree: Defaults): T { return fillDefaults(value, tree.root, tree.models) as T; } +function cloneDefault(value: unknown): unknown { + if (Array.isArray(value)) { + return value.map(cloneDefault); + } + if (typeof value === 'object' && value !== null) { + const copy: Record<string, unknown> = {}; + for (const [key, member] of Object.entries(value)) { + copy[key] = cloneDefault(member); + } + return copy; + } + return value; +} + function fillDefaults( value: unknown, shape: DefaultsShape, @@ -81,6 +95,12 @@ function fillDefaults( return value; } const result: Record<string, unknown> = { ...model.defaults, ...value }; + // Each item gets its own copy of a filled-in list or object, so mutating one doesn't change the rest + for (const key of Object.keys(model.defaults ?? {})) { + if (!Object.prototype.hasOwnProperty.call(value, key)) { + result[key] = cloneDefault(result[key]); + } + } for (const [key, child] of Object.entries(model.properties ?? {})) { if (key in result) { result[key] = fillDefaults(result[key], child, models); @@ -466,8 +486,8 @@ class Client { 'x-sdk-name': 'Console', 'x-sdk-platform': 'console', 'x-sdk-language': 'web', - 'x-sdk-version': '19.0.0', - 'X-Appwrite-Response-Format': '2.4.0', + 'x-sdk-version': '20.0.0', + 'X-Appwrite-Response-Format': '2.5.0', }; /** @@ -1113,7 +1133,7 @@ class Client { | ResolvedChannel | (Channel<any> | ActionableChannel | ResolvedChannel)[], callback: (payload: RealtimeResponseEvent<T>) => void, - queries: (string | Query)[] = [], + queries: QueryInput = [], ): () => void { const channelArray = Array.isArray(channels) ? channels : [channels]; // Convert Channel instances to strings @@ -1132,9 +1152,7 @@ class Client { this.realtime.channels.add(channel), ); - const queryStrings = (queries ?? []).map((q) => - typeof q === 'string' ? q : q.toString(), - ); + const queryStrings = normalizeQueries(queries); let subscriptionId = ''; const attempts = this.realtime.subscriptions.size + 1; @@ -1187,6 +1205,10 @@ class Client { ): { uri: string; options: RequestInit } { method = method.toUpperCase(); + for (const key of Object.keys(params)) { + params[key] = flattenParam(params[key]); + } + headers = Object.assign({}, this.headers, headers); if ( @@ -1483,7 +1505,7 @@ class Client { } if (400 <= response.status) { - let responseText: string; + let responseText; if ( response.headers .get('content-type') @@ -1545,7 +1567,7 @@ class Client { } export { Client, AppwriteException }; -export { Query } from './query'; +export { Query, QueryBuilder, flattenParam } from './query'; export type { Models, Payload, UploadProgress }; export type { RealtimeResponseEvent }; -export type { QueryTypes, QueryTypesList } from './query'; +export type { QueryTypes, QueryTypesList, QueryInput } from './query'; diff --git a/src/enums/appwrite-migration-resource.ts b/src/enums/appwrite-migration-resource.ts index 2f7829ba..88d3fa26 100644 --- a/src/enums/appwrite-migration-resource.ts +++ b/src/enums/appwrite-migration-resource.ts @@ -37,5 +37,6 @@ export enum AppwriteMigrationResource { Projectlabels = 'project-labels', Projectservices = 'project-services', Projectemailtemplate = 'project-email-template', + Projectenvironment = 'project-environment', Rule = 'rule', } diff --git a/src/enums/execution-trigger.ts b/src/enums/execution-trigger.ts index 84fa8f60..b16a8781 100644 --- a/src/enums/execution-trigger.ts +++ b/src/enums/execution-trigger.ts @@ -2,4 +2,5 @@ export enum ExecutionTrigger { Http = 'http', Schedule = 'schedule', Event = 'event', + Email = 'email', } diff --git a/src/enums/proxy-rule-protocol.ts b/src/enums/proxy-rule-protocol.ts new file mode 100644 index 00000000..1ed23de1 --- /dev/null +++ b/src/enums/proxy-rule-protocol.ts @@ -0,0 +1,4 @@ +export enum ProxyRuleProtocol { + Http = 'http', + Smtp = 'smtp', +} diff --git a/src/index.ts b/src/index.ts index 145126ec..2092b425 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,13 +1,19 @@ /** * Appwrite Console SDK * - * This SDK targets Appwrite server version 2.4.x as shipped on Appwrite Cloud. + * This SDK targets Appwrite server version 2.5.x as shipped on Appwrite Cloud. * Self-hosted releases can lag behind Cloud — if you run an older self-hosted * build, use a matching older SDK from * [previous releases](https://github.com/appwrite/sdk-for-console/releases) * when APIs differ. */ -export { Client, Query, AppwriteException } from './client'; +export { + Client, + Query, + QueryBuilder, + flattenParam, + AppwriteException, +} from './client'; export { Account } from './services/account'; export { Activities } from './services/activities'; export { Admin } from './services/admin'; @@ -74,11 +80,11 @@ export type { TrackingEventOptions, TrackingOptions, } from './services/analytics-tracking'; -export type { QueryTypes, QueryTypesList } from './query'; +export type { QueryTypes, QueryTypesList, QueryInput } from './query'; export { Permission } from './permission'; export { Role } from './role'; export { ID } from './id'; -export { Topic, ResolvedTopic } from './topic'; +export { Topic } from './topic'; export { Channel } from './channel'; export { Operator, Condition } from './operator'; export { AccountKeyScopes } from './enums/account-key-scopes'; @@ -199,6 +205,7 @@ export { OAuth2KakaoPrompt } from './enums/o-auth-2-kakao-prompt'; export { PlatformType } from './enums/platform-type'; export { ProxyRuleDeploymentResourceType } from './enums/proxy-rule-deployment-resource-type'; export { ProxyRuleStatus } from './enums/proxy-rule-status'; +export { ProxyRuleProtocol } from './enums/proxy-rule-protocol'; export { MessageStatus } from './enums/message-status'; export { BillingPlanGroup } from './enums/billing-plan-group'; export { DomainTransferStatusEnum } from './enums/domain-transfer-status-enum'; diff --git a/src/models.ts b/src/models.ts index 9e33af8f..c82af753 100644 --- a/src/models.ts +++ b/src/models.ts @@ -24,6 +24,7 @@ import { OAuth2KakaoPrompt } from './enums/o-auth-2-kakao-prompt'; import { PlatformType } from './enums/platform-type'; import { ProxyRuleDeploymentResourceType } from './enums/proxy-rule-deployment-resource-type'; import { ProxyRuleStatus } from './enums/proxy-rule-status'; +import { ProxyRuleProtocol } from './enums/proxy-rule-protocol'; import { MessageStatus } from './enums/message-status'; import { BillingPlanGroup } from './enums/billing-plan-group'; import { DomainTransferStatusEnum } from './enums/domain-transfer-status-enum'; @@ -929,6 +930,10 @@ export namespace Models { * Database name. */ name: string; + /** + * Optional description for the database. + */ + description: string; /** * Database creation date in ISO 8601 format. */ @@ -948,39 +953,39 @@ export namespace Models { /** * Dedicated database lifecycle status. Null when the database has no valid dedicated backing. */ - status?: DatabaseStatus; + status?: DatabaseStatus | null; /** * Underlying engine of the dedicated backing: postgresql, mysql, or mongodb. A managed product (tablesdb, documentsdb, vectorsdb) reports the engine it runs on, so its type and engine can differ. Null when the database has no dedicated backing. */ - engine?: string; + engine?: string | null; /** * Compute specification identifier of the dedicated backing, e.g. s-2vcpu-2gb. Null when the database has no dedicated backing. */ - specification?: string; + specification?: string | null; /** * Number of secondary high availability replicas, excluding the primary. Null when backing configuration is unavailable. */ - replicas?: number; + replicas?: number | null; /** * Error message when the dedicated backing failed. Null when the database has no dedicated backing or has not failed. */ - error?: string; + error?: string | null; /** * Container status of the dedicated backing: active, inactive, or failed (a wake was declined because the backing namespace is gone). Null when the database has no dedicated backing or the runtime has not reported one. */ - containerStatus?: string; + containerStatus?: string | null; /** * Idle-lifecycle state of the dedicated backing: active, warm, cold, or hibernated. Null when the database has no dedicated backing or the runtime has not reported one. */ - lifecycleState?: string; + lifecycleState?: string | null; /** * Database backup policies. */ - policies?: BackupPolicy[]; + policies?: BackupPolicy[] | null; /** * Database backup archives. */ - archives?: BackupArchive[]; + archives?: BackupArchive[] | null; }; /** @@ -1033,6 +1038,10 @@ export namespace Models { * Collection name. */ name: string; + /** + * Optional description for the collection. + */ + description: string; /** * Collection enabled. Can be 'enabled' or 'disabled'. When disabled, the collection is inaccessible to users, but remains accessible to Server SDKs using API keys. */ @@ -1119,6 +1128,10 @@ export namespace Models { * Attribute Key. */ key: string; + /** + * Optional description for the attribute. + */ + description: string; /** * Attribute type. */ @@ -1138,7 +1151,7 @@ export namespace Models { /** * Is attribute an array? */ - array?: boolean; + array?: boolean | null; /** * Attribute creation date in ISO 8601 format. */ @@ -1154,11 +1167,11 @@ export namespace Models { /** * Default value for attribute when not provided. Cannot be set when attribute is required. */ - default?: string; + default?: string | null; /** * Defines whether this attribute is encrypted or not. */ - encrypt?: boolean; + encrypt?: boolean | null; }; /** @@ -1169,6 +1182,10 @@ export namespace Models { * Attribute Key. */ key: string; + /** + * Optional description for the attribute. + */ + description: string; /** * Attribute type. */ @@ -1188,7 +1205,7 @@ export namespace Models { /** * Is attribute an array? */ - array?: boolean; + array?: boolean | null; /** * Attribute creation date in ISO 8601 format. */ @@ -1200,15 +1217,15 @@ export namespace Models { /** * Minimum value to enforce for new documents. */ - min?: number | bigint; + min?: number | bigint | null; /** * Maximum value to enforce for new documents. */ - max?: number | bigint; + max?: number | bigint | null; /** * Default value for attribute when not provided. Cannot be set when attribute is required. */ - default?: number; + default?: number | null; }; /** @@ -1219,6 +1236,10 @@ export namespace Models { * Attribute Key. */ key: string; + /** + * Optional description for the attribute. + */ + description: string; /** * Attribute type. */ @@ -1238,7 +1259,7 @@ export namespace Models { /** * Is attribute an array? */ - array?: boolean; + array?: boolean | null; /** * Attribute creation date in ISO 8601 format. */ @@ -1250,15 +1271,15 @@ export namespace Models { /** * Minimum value to enforce for new documents. */ - min?: number | bigint; + min?: number | bigint | null; /** * Maximum value to enforce for new documents. */ - max?: number | bigint; + max?: number | bigint | null; /** * Default value for attribute when not provided. Cannot be set when attribute is required. */ - default?: number | bigint; + default?: number | bigint | null; }; /** @@ -1269,6 +1290,10 @@ export namespace Models { * Attribute Key. */ key: string; + /** + * Optional description for the attribute. + */ + description: string; /** * Attribute type. */ @@ -1288,7 +1313,7 @@ export namespace Models { /** * Is attribute an array? */ - array?: boolean; + array?: boolean | null; /** * Attribute creation date in ISO 8601 format. */ @@ -1300,15 +1325,15 @@ export namespace Models { /** * Minimum value to enforce for new documents. */ - min?: number; + min?: number | null; /** * Maximum value to enforce for new documents. */ - max?: number; + max?: number | null; /** * Default value for attribute when not provided. Cannot be set when attribute is required. */ - default?: number; + default?: number | null; }; /** @@ -1319,6 +1344,10 @@ export namespace Models { * Attribute Key. */ key: string; + /** + * Optional description for the attribute. + */ + description: string; /** * Attribute type. */ @@ -1338,7 +1367,7 @@ export namespace Models { /** * Is attribute an array? */ - array?: boolean; + array?: boolean | null; /** * Attribute creation date in ISO 8601 format. */ @@ -1350,7 +1379,7 @@ export namespace Models { /** * Default value for attribute when not provided. Cannot be set when attribute is required. */ - default?: boolean; + default?: boolean | null; }; /** @@ -1361,6 +1390,10 @@ export namespace Models { * Attribute Key. */ key: string; + /** + * Optional description for the attribute. + */ + description: string; /** * Attribute type. */ @@ -1380,7 +1413,7 @@ export namespace Models { /** * Is attribute an array? */ - array?: boolean; + array?: boolean | null; /** * Attribute creation date in ISO 8601 format. */ @@ -1396,7 +1429,7 @@ export namespace Models { /** * Default value for attribute when not provided. Cannot be set when attribute is required. */ - default?: string; + default?: string | null; }; /** @@ -1407,6 +1440,10 @@ export namespace Models { * Attribute Key. */ key: string; + /** + * Optional description for the attribute. + */ + description: string; /** * Attribute type. */ @@ -1426,7 +1463,7 @@ export namespace Models { /** * Is attribute an array? */ - array?: boolean; + array?: boolean | null; /** * Attribute creation date in ISO 8601 format. */ @@ -1446,7 +1483,7 @@ export namespace Models { /** * Default value for attribute when not provided. Cannot be set when attribute is required. */ - default?: string; + default?: string | null; }; /** @@ -1457,6 +1494,10 @@ export namespace Models { * Attribute Key. */ key: string; + /** + * Optional description for the attribute. + */ + description: string; /** * Attribute type. */ @@ -1476,7 +1517,7 @@ export namespace Models { /** * Is attribute an array? */ - array?: boolean; + array?: boolean | null; /** * Attribute creation date in ISO 8601 format. */ @@ -1492,7 +1533,7 @@ export namespace Models { /** * Default value for attribute when not provided. Cannot be set when attribute is required. */ - default?: string; + default?: string | null; }; /** @@ -1503,6 +1544,10 @@ export namespace Models { * Attribute Key. */ key: string; + /** + * Optional description for the attribute. + */ + description: string; /** * Attribute type. */ @@ -1522,7 +1567,7 @@ export namespace Models { /** * Is attribute an array? */ - array?: boolean; + array?: boolean | null; /** * Attribute creation date in ISO 8601 format. */ @@ -1538,7 +1583,7 @@ export namespace Models { /** * Default value for attribute when not provided. Cannot be set when attribute is required. */ - default?: string; + default?: string | null; }; /** @@ -1549,6 +1594,10 @@ export namespace Models { * Attribute Key. */ key: string; + /** + * Optional description for the attribute. + */ + description: string; /** * Attribute type. */ @@ -1568,7 +1617,7 @@ export namespace Models { /** * Is attribute an array? */ - array?: boolean; + array?: boolean | null; /** * Attribute creation date in ISO 8601 format. */ @@ -1584,7 +1633,7 @@ export namespace Models { /** * Default value for attribute when not provided. Only null is optional */ - default?: string; + default?: string | null; }; /** @@ -1595,6 +1644,10 @@ export namespace Models { * Attribute Key. */ key: string; + /** + * Optional description for the attribute. + */ + description: string; /** * Attribute type. */ @@ -1614,7 +1667,7 @@ export namespace Models { /** * Is attribute an array? */ - array?: boolean; + array?: boolean | null; /** * Attribute creation date in ISO 8601 format. */ @@ -1657,6 +1710,10 @@ export namespace Models { * Attribute Key. */ key: string; + /** + * Optional description for the attribute. + */ + description: string; /** * Attribute type. */ @@ -1676,7 +1733,7 @@ export namespace Models { /** * Is attribute an array? */ - array?: boolean; + array?: boolean | null; /** * Attribute creation date in ISO 8601 format. */ @@ -1688,7 +1745,7 @@ export namespace Models { /** * Default value for attribute when not provided. Cannot be set when attribute is required. */ - default?: number[]; + default?: number[] | null; }; /** @@ -1699,6 +1756,10 @@ export namespace Models { * Attribute Key. */ key: string; + /** + * Optional description for the attribute. + */ + description: string; /** * Attribute type. */ @@ -1718,7 +1779,7 @@ export namespace Models { /** * Is attribute an array? */ - array?: boolean; + array?: boolean | null; /** * Attribute creation date in ISO 8601 format. */ @@ -1730,7 +1791,7 @@ export namespace Models { /** * Default value for attribute when not provided. Cannot be set when attribute is required. */ - default?: number[][]; + default?: number[][] | null; }; /** @@ -1741,6 +1802,10 @@ export namespace Models { * Attribute Key. */ key: string; + /** + * Optional description for the attribute. + */ + description: string; /** * Attribute type. */ @@ -1760,7 +1825,7 @@ export namespace Models { /** * Is attribute an array? */ - array?: boolean; + array?: boolean | null; /** * Attribute creation date in ISO 8601 format. */ @@ -1772,7 +1837,7 @@ export namespace Models { /** * Default value for attribute when not provided. Cannot be set when attribute is required. */ - default?: number[][][]; + default?: number[][][] | null; }; /** @@ -1783,6 +1848,10 @@ export namespace Models { * Attribute Key. */ key: string; + /** + * Optional description for the attribute. + */ + description: string; /** * Attribute type. */ @@ -1802,7 +1871,7 @@ export namespace Models { /** * Is attribute an array? */ - array?: boolean; + array?: boolean | null; /** * Attribute creation date in ISO 8601 format. */ @@ -1818,11 +1887,11 @@ export namespace Models { /** * Default value for attribute when not provided. Cannot be set when attribute is required. */ - default?: string; + default?: string | null; /** * Defines whether this attribute is encrypted or not. */ - encrypt?: boolean; + encrypt?: boolean | null; }; /** @@ -1833,6 +1902,10 @@ export namespace Models { * Attribute Key. */ key: string; + /** + * Optional description for the attribute. + */ + description: string; /** * Attribute type. */ @@ -1852,7 +1925,7 @@ export namespace Models { /** * Is attribute an array? */ - array?: boolean; + array?: boolean | null; /** * Attribute creation date in ISO 8601 format. */ @@ -1864,11 +1937,11 @@ export namespace Models { /** * Default value for attribute when not provided. Cannot be set when attribute is required. */ - default?: string; + default?: string | null; /** * Defines whether this attribute is encrypted or not. */ - encrypt?: boolean; + encrypt?: boolean | null; }; /** @@ -1879,6 +1952,10 @@ export namespace Models { * Attribute Key. */ key: string; + /** + * Optional description for the attribute. + */ + description: string; /** * Attribute type. */ @@ -1898,7 +1975,7 @@ export namespace Models { /** * Is attribute an array? */ - array?: boolean; + array?: boolean | null; /** * Attribute creation date in ISO 8601 format. */ @@ -1910,11 +1987,11 @@ export namespace Models { /** * Default value for attribute when not provided. Cannot be set when attribute is required. */ - default?: string; + default?: string | null; /** * Defines whether this attribute is encrypted or not. */ - encrypt?: boolean; + encrypt?: boolean | null; }; /** @@ -1925,6 +2002,10 @@ export namespace Models { * Attribute Key. */ key: string; + /** + * Optional description for the attribute. + */ + description: string; /** * Attribute type. */ @@ -1944,7 +2025,7 @@ export namespace Models { /** * Is attribute an array? */ - array?: boolean; + array?: boolean | null; /** * Attribute creation date in ISO 8601 format. */ @@ -1956,11 +2037,11 @@ export namespace Models { /** * Default value for attribute when not provided. Cannot be set when attribute is required. */ - default?: string; + default?: string | null; /** * Defines whether this attribute is encrypted or not. */ - encrypt?: boolean; + encrypt?: boolean | null; }; /** @@ -1991,6 +2072,10 @@ export namespace Models { * Collection name. */ name: string; + /** + * Optional description for the collection. + */ + description: string; /** * Collection enabled. Can be 'enabled' or 'disabled'. When disabled, the collection is inaccessible to users, but remains accessible to Server SDKs using API keys. */ @@ -2029,6 +2114,10 @@ export namespace Models { * Attribute Key. */ key: string; + /** + * Optional description for the attribute. + */ + description: string; /** * Attribute type. */ @@ -2048,7 +2137,7 @@ export namespace Models { /** * Is attribute an array? */ - array?: boolean; + array?: boolean | null; /** * Attribute creation date in ISO 8601 format. */ @@ -2067,6 +2156,10 @@ export namespace Models { * Attribute Key. */ key: string; + /** + * Optional description for the attribute. + */ + description: string; /** * Attribute type. */ @@ -2086,7 +2179,7 @@ export namespace Models { /** * Is attribute an array? */ - array?: boolean; + array?: boolean | null; /** * Attribute creation date in ISO 8601 format. */ @@ -2129,6 +2222,10 @@ export namespace Models { * Table name. */ name: string; + /** + * Optional description for the table. + */ + description: string; /** * Table enabled. Can be 'enabled' or 'disabled'. When disabled, the table is inaccessible to users, but remains accessible to Server SDKs using API keys. */ @@ -2215,6 +2312,10 @@ export namespace Models { * Column Key. */ key: string; + /** + * Optional description for the column. + */ + description: string; /** * Column type. */ @@ -2234,7 +2335,7 @@ export namespace Models { /** * Is column an array? */ - array?: boolean; + array?: boolean | null; /** * Column creation date in ISO 8601 format. */ @@ -2250,11 +2351,11 @@ export namespace Models { /** * Default value for column when not provided. Cannot be set when column is required. */ - default?: string; + default?: string | null; /** * Defines whether this column is encrypted or not. */ - encrypt?: boolean; + encrypt?: boolean | null; }; /** @@ -2265,6 +2366,10 @@ export namespace Models { * Column Key. */ key: string; + /** + * Optional description for the column. + */ + description: string; /** * Column type. */ @@ -2284,7 +2389,7 @@ export namespace Models { /** * Is column an array? */ - array?: boolean; + array?: boolean | null; /** * Column creation date in ISO 8601 format. */ @@ -2296,15 +2401,15 @@ export namespace Models { /** * Minimum value to enforce for new documents. */ - min?: number | bigint; + min?: number | bigint | null; /** * Maximum value to enforce for new documents. */ - max?: number | bigint; + max?: number | bigint | null; /** * Default value for column when not provided. Cannot be set when column is required. */ - default?: number; + default?: number | null; }; /** @@ -2315,6 +2420,10 @@ export namespace Models { * Column Key. */ key: string; + /** + * Optional description for the column. + */ + description: string; /** * Column type. */ @@ -2334,7 +2443,7 @@ export namespace Models { /** * Is column an array? */ - array?: boolean; + array?: boolean | null; /** * Column creation date in ISO 8601 format. */ @@ -2346,15 +2455,15 @@ export namespace Models { /** * Minimum value to enforce for new documents. */ - min?: number | bigint; + min?: number | bigint | null; /** * Maximum value to enforce for new documents. */ - max?: number | bigint; + max?: number | bigint | null; /** * Default value for column when not provided. Cannot be set when column is required. */ - default?: number | bigint; + default?: number | bigint | null; }; /** @@ -2365,6 +2474,10 @@ export namespace Models { * Column Key. */ key: string; + /** + * Optional description for the column. + */ + description: string; /** * Column type. */ @@ -2384,7 +2497,7 @@ export namespace Models { /** * Is column an array? */ - array?: boolean; + array?: boolean | null; /** * Column creation date in ISO 8601 format. */ @@ -2396,15 +2509,15 @@ export namespace Models { /** * Minimum value to enforce for new documents. */ - min?: number; + min?: number | null; /** * Maximum value to enforce for new documents. */ - max?: number; + max?: number | null; /** * Default value for column when not provided. Cannot be set when column is required. */ - default?: number; + default?: number | null; }; /** @@ -2415,6 +2528,10 @@ export namespace Models { * Column Key. */ key: string; + /** + * Optional description for the column. + */ + description: string; /** * Column type. */ @@ -2434,7 +2551,7 @@ export namespace Models { /** * Is column an array? */ - array?: boolean; + array?: boolean | null; /** * Column creation date in ISO 8601 format. */ @@ -2446,7 +2563,7 @@ export namespace Models { /** * Default value for column when not provided. Cannot be set when column is required. */ - default?: boolean; + default?: boolean | null; }; /** @@ -2457,6 +2574,10 @@ export namespace Models { * Column Key. */ key: string; + /** + * Optional description for the column. + */ + description: string; /** * Column type. */ @@ -2476,7 +2597,7 @@ export namespace Models { /** * Is column an array? */ - array?: boolean; + array?: boolean | null; /** * Column creation date in ISO 8601 format. */ @@ -2492,7 +2613,7 @@ export namespace Models { /** * Default value for column when not provided. Cannot be set when column is required. */ - default?: string; + default?: string | null; }; /** @@ -2503,6 +2624,10 @@ export namespace Models { * Column Key. */ key: string; + /** + * Optional description for the column. + */ + description: string; /** * Column type. */ @@ -2522,7 +2647,7 @@ export namespace Models { /** * Is column an array? */ - array?: boolean; + array?: boolean | null; /** * Column creation date in ISO 8601 format. */ @@ -2542,7 +2667,7 @@ export namespace Models { /** * Default value for column when not provided. Cannot be set when column is required. */ - default?: string; + default?: string | null; }; /** @@ -2553,6 +2678,10 @@ export namespace Models { * Column Key. */ key: string; + /** + * Optional description for the column. + */ + description: string; /** * Column type. */ @@ -2572,7 +2701,7 @@ export namespace Models { /** * Is column an array? */ - array?: boolean; + array?: boolean | null; /** * Column creation date in ISO 8601 format. */ @@ -2588,7 +2717,7 @@ export namespace Models { /** * Default value for column when not provided. Cannot be set when column is required. */ - default?: string; + default?: string | null; }; /** @@ -2599,6 +2728,10 @@ export namespace Models { * Column Key. */ key: string; + /** + * Optional description for the column. + */ + description: string; /** * Column type. */ @@ -2618,7 +2751,7 @@ export namespace Models { /** * Is column an array? */ - array?: boolean; + array?: boolean | null; /** * Column creation date in ISO 8601 format. */ @@ -2634,7 +2767,7 @@ export namespace Models { /** * Default value for column when not provided. Cannot be set when column is required. */ - default?: string; + default?: string | null; }; /** @@ -2645,6 +2778,10 @@ export namespace Models { * Column Key. */ key: string; + /** + * Optional description for the column. + */ + description: string; /** * Column type. */ @@ -2664,7 +2801,7 @@ export namespace Models { /** * Is column an array? */ - array?: boolean; + array?: boolean | null; /** * Column creation date in ISO 8601 format. */ @@ -2680,7 +2817,7 @@ export namespace Models { /** * Default value for column when not provided. Only null is optional */ - default?: string; + default?: string | null; }; /** @@ -2691,6 +2828,10 @@ export namespace Models { * Column Key. */ key: string; + /** + * Optional description for the column. + */ + description: string; /** * Column type. */ @@ -2710,7 +2851,7 @@ export namespace Models { /** * Is column an array? */ - array?: boolean; + array?: boolean | null; /** * Column creation date in ISO 8601 format. */ @@ -2753,6 +2894,10 @@ export namespace Models { * Column Key. */ key: string; + /** + * Optional description for the column. + */ + description: string; /** * Column type. */ @@ -2772,7 +2917,7 @@ export namespace Models { /** * Is column an array? */ - array?: boolean; + array?: boolean | null; /** * Column creation date in ISO 8601 format. */ @@ -2784,7 +2929,7 @@ export namespace Models { /** * Default value for column when not provided. Cannot be set when column is required. */ - default?: number[]; + default?: number[] | null; }; /** @@ -2795,6 +2940,10 @@ export namespace Models { * Column Key. */ key: string; + /** + * Optional description for the column. + */ + description: string; /** * Column type. */ @@ -2814,7 +2963,7 @@ export namespace Models { /** * Is column an array? */ - array?: boolean; + array?: boolean | null; /** * Column creation date in ISO 8601 format. */ @@ -2826,7 +2975,7 @@ export namespace Models { /** * Default value for column when not provided. Cannot be set when column is required. */ - default?: number[][]; + default?: number[][] | null; }; /** @@ -2837,6 +2986,10 @@ export namespace Models { * Column Key. */ key: string; + /** + * Optional description for the column. + */ + description: string; /** * Column type. */ @@ -2856,7 +3009,7 @@ export namespace Models { /** * Is column an array? */ - array?: boolean; + array?: boolean | null; /** * Column creation date in ISO 8601 format. */ @@ -2868,7 +3021,7 @@ export namespace Models { /** * Default value for column when not provided. Cannot be set when column is required. */ - default?: number[][][]; + default?: number[][][] | null; }; /** @@ -2879,6 +3032,10 @@ export namespace Models { * Column Key. */ key: string; + /** + * Optional description for the column. + */ + description: string; /** * Column type. */ @@ -2898,7 +3055,7 @@ export namespace Models { /** * Is column an array? */ - array?: boolean; + array?: boolean | null; /** * Column creation date in ISO 8601 format. */ @@ -2914,11 +3071,11 @@ export namespace Models { /** * Default value for column when not provided. Cannot be set when column is required. */ - default?: string; + default?: string | null; /** * Defines whether this column is encrypted or not. */ - encrypt?: boolean; + encrypt?: boolean | null; }; /** @@ -2929,6 +3086,10 @@ export namespace Models { * Column Key. */ key: string; + /** + * Optional description for the column. + */ + description: string; /** * Column type. */ @@ -2948,7 +3109,7 @@ export namespace Models { /** * Is column an array? */ - array?: boolean; + array?: boolean | null; /** * Column creation date in ISO 8601 format. */ @@ -2960,11 +3121,11 @@ export namespace Models { /** * Default value for column when not provided. Cannot be set when column is required. */ - default?: string; + default?: string | null; /** * Defines whether this column is encrypted or not. */ - encrypt?: boolean; + encrypt?: boolean | null; }; /** @@ -2975,6 +3136,10 @@ export namespace Models { * Column Key. */ key: string; + /** + * Optional description for the column. + */ + description: string; /** * Column type. */ @@ -2994,7 +3159,7 @@ export namespace Models { /** * Is column an array? */ - array?: boolean; + array?: boolean | null; /** * Column creation date in ISO 8601 format. */ @@ -3006,11 +3171,11 @@ export namespace Models { /** * Default value for column when not provided. Cannot be set when column is required. */ - default?: string; + default?: string | null; /** * Defines whether this column is encrypted or not. */ - encrypt?: boolean; + encrypt?: boolean | null; }; /** @@ -3021,6 +3186,10 @@ export namespace Models { * Column Key. */ key: string; + /** + * Optional description for the column. + */ + description: string; /** * Column type. */ @@ -3040,7 +3209,7 @@ export namespace Models { /** * Is column an array? */ - array?: boolean; + array?: boolean | null; /** * Column creation date in ISO 8601 format. */ @@ -3052,11 +3221,11 @@ export namespace Models { /** * Default value for column when not provided. Cannot be set when column is required. */ - default?: string; + default?: string | null; /** * Defines whether this column is encrypted or not. */ - encrypt?: boolean; + encrypt?: boolean | null; }; /** @@ -3079,6 +3248,10 @@ export namespace Models { * Index key. */ key: string; + /** + * Optional description for the index. + */ + description: string; /** * Index type. */ @@ -3102,7 +3275,7 @@ export namespace Models { /** * Index orders. */ - orders?: string[]; + orders?: string[] | null; }; /** @@ -3125,6 +3298,10 @@ export namespace Models { * Index Key. */ key: string; + /** + * Optional description for the index. + */ + description: string; /** * Index type. */ @@ -3148,7 +3325,7 @@ export namespace Models { /** * Index orders. */ - orders?: string[]; + orders?: string[] | null; }; /** @@ -3256,7 +3433,7 @@ export namespace Models { /** * Presence status. */ - status?: string; + status?: string | null; /** * Presence source. */ @@ -3264,7 +3441,7 @@ export namespace Models { /** * Presence expiry date in ISO 8601 format. */ - expiresAt?: string; + expiresAt?: string | null; /** * Presence metadata. */ @@ -3296,15 +3473,15 @@ export namespace Models { /** * Hashed user password. */ - password?: string; + password?: string | null; /** * Password hashing algorithm. */ - hash?: string; + hash?: string | null; /** * Password hashing algorithm configuration. */ - hashOptions?: object; + hashOptions?: object | null; /** * User registration date in ISO 8601 format. */ @@ -3336,27 +3513,27 @@ export namespace Models { /** * Canonical form of the user email address. */ - emailCanonical?: string; + emailCanonical?: string | null; /** * Whether the user email is from a free email provider. */ - emailIsFree?: boolean; + emailIsFree?: boolean | null; /** * Whether the user email is from a disposable email provider. */ - emailIsDisposable?: boolean; + emailIsDisposable?: boolean | null; /** * Whether the user email is from a corporate domain. */ - emailIsCorporate?: boolean; + emailIsCorporate?: boolean | null; /** * Whether the user email is in its canonical form. */ - emailIsCanonical?: boolean; + emailIsCanonical?: boolean | null; /** * Whether the password was found in a known data breach the last time it was checked. Null when the password has never been checked. */ - passwordPwned?: boolean; + passwordPwned?: boolean | null; /** * Phone verification status. */ @@ -3380,11 +3557,11 @@ export namespace Models { /** * Whether the user can impersonate other users. */ - impersonator?: boolean; + impersonator?: boolean | null; /** * ID of the original actor performing the impersonation. Present only when the current request is impersonating another user. Internal audit logs attribute the action to this user, while the impersonated target is recorded only in internal audit payload data. */ - impersonatorUserId?: string; + impersonatorUserId?: string | null; }; /** @@ -3550,27 +3727,27 @@ export namespace Models { /** * Canonical form of the user email address. */ - emailCanonical?: string; + emailCanonical?: string | null; /** * Whether the user email is from a free email provider. */ - emailIsFree?: boolean; + emailIsFree?: boolean | null; /** * Whether the user email is from a disposable email provider. */ - emailIsDisposable?: boolean; + emailIsDisposable?: boolean | null; /** * Whether the user email is from a corporate domain. */ - emailIsCorporate?: boolean; + emailIsCorporate?: boolean | null; /** * Whether the user email is in its canonical form. */ - emailIsCanonical?: boolean; + emailIsCanonical?: boolean | null; /** * Whether the password was found in a known data breach the last time it was checked. Null when the password has never been checked. */ - passwordPwned?: boolean; + passwordPwned?: boolean | null; /** * Phone verification status. */ @@ -3594,11 +3771,11 @@ export namespace Models { /** * Whether the user can impersonate other users. */ - impersonator?: boolean; + impersonator?: boolean | null; /** * ID of the original actor performing the impersonation. Present only when the current request is impersonating another user. Internal audit logs attribute the action to this user, while the impersonated target is recorded only in internal audit payload data. */ - impersonatorUserId?: string; + impersonatorUserId?: string | null; }; /** @@ -3802,7 +3979,7 @@ export namespace Models { /** * Stable message ID used for dedup. */ - messageId?: string; + messageId?: string | null; /** * Notification type: info, warning, error. */ @@ -3830,7 +4007,7 @@ export namespace Models { /** * Project the notification pertains to. */ - projectId?: string; + projectId?: string | null; /** * Notification title. */ @@ -3842,15 +4019,15 @@ export namespace Models { /** * Whether the notification has been read. */ - read?: boolean; + read?: boolean | null; /** * First time the notification was viewed from a notification logo. */ - firstSeen?: string; + firstSeen?: string | null; /** * Most recent time the notification was viewed from a notification logo. */ - lastSeen?: string; + lastSeen?: string | null; }; /** @@ -3928,47 +4105,47 @@ export namespace Models { /** * City */ - city?: string; + city?: string | null; /** * Name of timezone */ - timeZone?: string; + timeZone?: string | null; /** * Postal code */ - postalCode?: string; + postalCode?: string | null; /** * Latitude */ - latitude?: number; + latitude?: number | null; /** * Longitude */ - longitude?: number; + longitude?: number | null; /** * Autonomous System Number (ASN) of the IP */ - autonomousSystemNumber?: string; + autonomousSystemNumber?: string | null; /** * Organization that owns the ASN */ - autonomousSystemOrganization?: string; + autonomousSystemOrganization?: string | null; /** * Internet service provider of the IP */ - isp?: string; + isp?: string | null; /** * Connection type of the IP (e.g. cable, cellular, corporate) */ - connectionType?: string; + connectionType?: string | null; /** * User type classification of the IP (e.g. residential, business, hosting) */ - connectionUsageType?: string; + connectionUsageType?: string | null; /** * Registered organization of the IP */ - connectionOrganization?: string; + connectionOrganization?: string | null; }; /** @@ -4083,6 +4260,10 @@ export namespace Models { * Bucket name. */ name: string; + /** + * Optional description for the bucket. + */ + description: string; /** * Bucket enabled. */ @@ -4269,6 +4450,10 @@ export namespace Models { * Site name. */ name: string; + /** + * Optional description for the site. + */ + description: string; /** * Site enabled. */ @@ -4414,7 +4599,7 @@ export namespace Models { /** * URL hosting a template demo. */ - demoUrl?: string; + demoUrl?: string | null; /** * File URL with preview screenshot in dark theme preference. */ @@ -4492,7 +4677,7 @@ export namespace Models { /** * Fallback file for SPA. Only relevant for static serve runtime. */ - fallbackFile?: string; + fallbackFile?: string | null; }; /** @@ -4519,6 +4704,10 @@ export namespace Models { * Function name. */ name: string; + /** + * Optional description for the function. + */ + description: string; /** * Function enabled. */ @@ -4578,7 +4767,7 @@ export namespace Models { /** * Minutes between scheduled executions. 0 when the function has no interval. */ - interval?: number; + interval?: number | null; /** * Function execution timeout in seconds. */ @@ -4631,6 +4820,10 @@ export namespace Models { * Machine specification for executions. */ runtimeSpecification: string; + /** + * Whether inbound email (SMTP) may trigger this function. Opt-in; default is false. When disabled, recipients for this function are rejected. + */ + emailEnabled: boolean; }; /** @@ -4954,7 +5147,7 @@ export namespace Models { /** * Environment variables found in .env files */ - variables?: DetectionVariable[]; + variables?: DetectionVariable[] | null; /** * Framework */ @@ -4984,7 +5177,7 @@ export namespace Models { /** * Environment variables found in .env files */ - variables?: DetectionVariable[]; + variables?: DetectionVariable[] | null; /** * Runtime */ @@ -5020,11 +5213,11 @@ export namespace Models { /** * Content size in bytes. Only files have size, and for directories, 0 is returned. */ - size?: number; + size?: number | null; /** * If a content is a directory. Directories can be used to check nested contents. */ - isDirectory?: boolean; + isDirectory?: boolean | null; /** * Name of directory or file. */ @@ -5128,7 +5321,7 @@ export namespace Models { /** * Name of fallback file to use instead of 404 page. If null, Appwrite 404 page will be displayed. */ - fallbackFile?: string; + fallbackFile?: string | null; }; /** @@ -5278,7 +5471,7 @@ export namespace Models { */ deploymentId: string; /** - * The trigger that caused the resource to execute. Possible values can be: `http`, `schedule`, or `event`. + * The trigger that caused the resource to execute. Possible values can be: `http`, `schedule`, `event`, or `email`. */ trigger: ExecutionTrigger; /** @@ -5324,7 +5517,7 @@ export namespace Models { /** * The scheduled time for execution. If left empty, execution will be queued immediately. */ - scheduledAt?: string; + scheduledAt?: string | null; }; /** @@ -5438,91 +5631,91 @@ export namespace Models { /** * Whether WAF enforcement is enabled for the project. */ - wafEnabled?: boolean; + wafEnabled?: boolean | null; /** * ID of the project this environment belongs to. Null when the project is not an environment. */ - parentId?: string; + parentId?: string | null; /** * Billing limits reached */ - billingLimits?: BillingLimits; + billingLimits?: BillingLimits | null; /** * First time the project received a non-console API request. Empty until the project is used. */ - firstAccessedAt?: string; + firstAccessedAt?: string | null; /** * Last time the project was accessed through the MCP server. Empty if it was never accessed via MCP. */ - mcpAccessedAt?: string; + mcpAccessedAt?: string | null; /** * OAuth2 server status */ - oAuth2ServerEnabled?: boolean; + oAuth2ServerEnabled?: boolean | null; /** * OAuth2 server authorization URL */ - oAuth2ServerAuthorizationUrl?: string; + oAuth2ServerAuthorizationUrl?: string | null; /** * OAuth2 server allowed scopes */ - oAuth2ServerScopes?: string[]; + oAuth2ServerScopes?: string[] | null; /** * OAuth2 server scopes used when an authorization request omits the scope parameter */ - oAuth2ServerDefaultScopes?: string[]; + oAuth2ServerDefaultScopes?: string[] | null; /** * Scopes an application may request when installed on a team */ - oAuth2ServerInstallationScopes?: string[]; + oAuth2ServerInstallationScopes?: string[] | null; /** * OAuth2 server accepted RFC 9396 authorization_details types */ - oAuth2ServerAuthorizationDetailsTypes?: string[]; + oAuth2ServerAuthorizationDetailsTypes?: string[] | null; /** * OAuth2 server access token duration in seconds for confidential clients */ - oAuth2ServerAccessTokenDuration?: number; + oAuth2ServerAccessTokenDuration?: number | null; /** * OAuth2 server refresh token duration in seconds for confidential clients */ - oAuth2ServerRefreshTokenDuration?: number; + oAuth2ServerRefreshTokenDuration?: number | null; /** * OAuth2 server access token duration in seconds for public clients (SPAs, mobile, native) */ - oAuth2ServerPublicAccessTokenDuration?: number; + oAuth2ServerPublicAccessTokenDuration?: number | null; /** * OAuth2 server refresh token duration in seconds for public clients (SPAs, mobile, native) */ - oAuth2ServerPublicRefreshTokenDuration?: number; + oAuth2ServerPublicRefreshTokenDuration?: number | null; /** * OAuth2 server access token duration in seconds for app installation access tokens */ - oAuth2ServerInstallationAccessTokenDuration?: number; + oAuth2ServerInstallationAccessTokenDuration?: number | null; /** * When enabled, PKCE is required for confidential clients (server-side flows using client_secret). PKCE is always required for public clients regardless of this setting. */ - oAuth2ServerConfidentialPkce?: boolean; + oAuth2ServerConfidentialPkce?: boolean | null; /** * URL to your application page where users enter the device flow user code. Empty when the Device Authorization Grant is not configured. */ - oAuth2ServerVerificationUrl?: string; + oAuth2ServerVerificationUrl?: string | null; /** * Number of characters in the device flow user code, excluding the formatting separator. */ - oAuth2ServerUserCodeLength?: number; + oAuth2ServerUserCodeLength?: number | null; /** * Character set for device flow user codes: `numeric`, `alphabetic`, or `alphanumeric`. */ - oAuth2ServerUserCodeFormat?: string; + oAuth2ServerUserCodeFormat?: string | null; /** * Lifetime in seconds of device flow device codes and user codes. */ - oAuth2ServerDeviceCodeDuration?: number; + oAuth2ServerDeviceCodeDuration?: number | null; /** * OAuth2 server discovery URL */ - oAuth2ServerDiscoveryUrl?: string; + oAuth2ServerDiscoveryUrl?: string | null; }; /** @@ -5587,6 +5780,10 @@ export namespace Models { * Webhook name. */ name: string; + /** + * Optional description for the webhook. + */ + description: string; /** * Webhook URL endpoint. */ @@ -5645,6 +5842,10 @@ export namespace Models { * Key name. */ name: string; + /** + * Optional description for the key. + */ + description: string; /** * Key expiration date in ISO 8601 format. */ @@ -5687,6 +5888,10 @@ export namespace Models { * Key name. */ name: string; + /** + * Optional description for the key. + */ + description: string; /** * Key expiration date in ISO 8601 format. */ @@ -6688,7 +6893,7 @@ export namespace Models { /** * Maximum authentication age in seconds. When set, the user must have authenticated within this many seconds. */ - maxAge?: number; + maxAge?: number | null; }; /** @@ -6959,6 +7164,10 @@ export namespace Models { * Whether password dictionary policy is enabled. */ enabled: boolean; + /** + * Custom passwords blocked by case-sensitive equality when enabled. + */ + denyList: string[]; }; /** @@ -7017,6 +7226,10 @@ export namespace Models { * Whether password personal data policy is enabled. */ enabled: boolean; + /** + * Custom terms blocked by case-insensitive substring matching when enabled. + */ + denyList: string[]; }; /** @@ -7457,6 +7670,10 @@ export namespace Models { * Variable key. */ key: string; + /** + * Optional description for the variable. + */ + description: string; /** * Variable value. */ @@ -7638,7 +7855,7 @@ export namespace Models { /** * Bucket start timestamp in ISO 8601. Omitted for flat dimension aggregates. */ - time?: string; + time?: string | null; /** * Aggregated value for the point. */ @@ -7646,147 +7863,147 @@ export namespace Models { /** * Value when broken down by `path`. */ - path?: string; + path?: string | null; /** * Value when broken down by `method`. */ - method?: string; + method?: string | null; /** * Value when broken down by `status`. */ - status?: string; + status?: string | null; /** * Value when broken down by `service`. */ - service?: string; + service?: string | null; /** * Value when broken down by `country`. */ - country?: string; + country?: string | null; /** * Value when broken down by `region`. */ - region?: string; + region?: string | null; /** * Value when broken down by `hostname`. */ - hostname?: string; + hostname?: string | null; /** * Value when broken down by `ip`. */ - ip?: string; + ip?: string | null; /** * Value when broken down by `protocol`. */ - protocol?: string; + protocol?: string | null; /** * Value when broken down by `accept`. */ - accept?: string; + accept?: string | null; /** * Value when broken down by `acceptLanguage`. */ - acceptLanguage?: string; + acceptLanguage?: string | null; /** * Value when broken down by `queryKeys`. */ - queryKeys?: string; + queryKeys?: string | null; /** * Value when broken down by `osName`. */ - osName?: string; + osName?: string | null; /** * Value when broken down by `clientType`. */ - clientType?: string; + clientType?: string | null; /** * Value when broken down by `clientName`. */ - clientName?: string; + clientName?: string | null; /** * Value when broken down by `sdk`. */ - sdk?: string; + sdk?: string | null; /** * Value when broken down by `sdkVersion`. */ - sdkVersion?: string; + sdkVersion?: string | null; /** * Value when broken down by `deviceName`. */ - deviceName?: string; + deviceName?: string | null; /** * Value when broken down by `resourceId`. */ - resourceId?: string; + resourceId?: string | null; /** * Value when broken down by `resourceType`. */ - resourceType?: string; + resourceType?: string | null; /** * Value when broken down by `ordinal`. */ - ordinal?: string; + ordinal?: string | null; /** * Continent code when broken down by `continentCode`. */ - continentCode?: string; + continentCode?: string | null; /** * City name when broken down by `city`. */ - city?: string; + city?: string | null; /** * Region/state chain when broken down by `subdivisions`. */ - subdivisions?: string; + subdivisions?: string | null; /** * Postal code when broken down by `postalCode`. */ - postalCode?: string; + postalCode?: string | null; /** * Latitude when broken down by `latitude`. */ - latitude?: string; + latitude?: string | null; /** * Longitude when broken down by `longitude`. */ - longitude?: string; + longitude?: string | null; /** * Time zone when broken down by `timeZone`. */ - timeZone?: string; + timeZone?: string | null; /** * Weather station code when broken down by `weatherCode`. */ - weatherCode?: string; + weatherCode?: string | null; /** * Internet service provider when broken down by `isp`. */ - isp?: string; + isp?: string | null; /** * Autonomous System Number (ASN) when broken down by `autonomousSystemNumber`. */ - autonomousSystemNumber?: string; + autonomousSystemNumber?: string | null; /** * Organization owning the ASN when broken down by `autonomousSystemOrganization`. */ - autonomousSystemOrganization?: string; + autonomousSystemOrganization?: string | null; /** * Connection type when broken down by `connectionType`. */ - connectionType?: string; + connectionType?: string | null; /** * Connection usage type when broken down by `connectionUsageType`. */ - connectionUsageType?: string; + connectionUsageType?: string | null; /** * Registered organization of the IP when broken down by `connectionOrganization`. */ - connectionOrganization?: string; + connectionOrganization?: string | null; /** * Owning team ID when broken down by `teamId`. */ - teamId?: string; + teamId?: string | null; }; /** @@ -7910,7 +8127,7 @@ export namespace Models { /** * Type of deployment resource: function, site, or dedicatedDatabase. */ - deploymentResourceType?: ProxyRuleDeploymentResourceType; + deploymentResourceType?: ProxyRuleDeploymentResourceType | null; /** * ID of deployment's resource (site or function ID). Used if type is "deployment" */ @@ -7931,6 +8148,10 @@ export namespace Models { * Certificate auto-renewal date in ISO 8601 format. */ renewAt: string; + /** + * Ingress protocol for the rule. + */ + protocol: ProxyRuleProtocol; }; /** @@ -7972,7 +8193,7 @@ export namespace Models { /** * Minutes between runs. 0 when the schedule has no interval. */ - interval?: number; + interval?: number | null; /** * Schedule data used to store resource-specific context needed for execution. */ @@ -8127,6 +8348,10 @@ export namespace Models { * Database adapter in use. */ _APP_DB_ADAPTER: string; + /** + * Whether the database adapter enforces defined attributes. + */ + supportForAttributes: boolean; /** * Whether the database adapter supports relationships. */ @@ -8139,6 +8364,14 @@ export namespace Models { * Whether the database adapter supports spatial attributes. */ supportForSpatials: boolean; + /** + * Whether the database adapter supports aggregation queries. + */ + supportForAggregations: boolean; + /** + * Whether the database adapter supports join queries. + */ + supportForJoins: boolean; /** * Whether the database adapter supports spatial indexes on nullable columns. */ @@ -8175,6 +8408,10 @@ export namespace Models { * Whether email verification for console users is required. Can be "true" or "false". */ _APP_CONSOLE_EMAIL_VERIFICATION: string; + /** + * Appwrite-owned zone for function testing email addresses, delivered to {functionId}@{projectId}.{zone}. Empty when inbound email is not configured. + */ + _APP_DOMAIN_EMAIL: string; }; /** @@ -8534,15 +8771,15 @@ export namespace Models { /** * The scheduled time for message. */ - scheduledAt?: string; + scheduledAt?: string | null; /** * The time when the message was delivered. */ - deliveredAt?: string; + deliveredAt?: string | null; /** * Delivery errors if any. */ - deliveryErrors?: string[]; + deliveryErrors?: string[] | null; /** * Number of recipients the message was delivered to. */ @@ -8577,6 +8814,10 @@ export namespace Models { * The name of the topic. */ name: string; + /** + * Optional description for the topic. + */ + description: string; /** * Total count of email subscribers subscribed to the topic. */ @@ -8596,11 +8837,11 @@ export namespace Models { /** * MQTT QoS for delivery on this topic. Null lets the subscriber choose their level. */ - qos?: number; + qos?: number | null; /** - * Message retention in seconds for offline delivery. + * Message retention in seconds for offline delivery. Null inherits the lowest expiry of the project's enabled Appwrite providers, or the 7-day ledger window if none sets one. */ - expiry?: number; + expiry?: number | null; }; /** @@ -8702,7 +8943,7 @@ export namespace Models { /** * Provider ID. */ - providerId?: string; + providerId?: string | null; /** * The target provider type. Can be one of the following: `email`, `sms` or `push`. */ @@ -8887,6 +9128,10 @@ export namespace Models { * Number of custom email templates to be migrated (one per templateId × locale pair). */ projectemailtemplate: number; + /** + * Number of project environments to be migrated. Each is recreated under a new ID, empty: its own resources belong to a separate project. + */ + projectenvironment: number; /** * Number of sites to be migrated. */ @@ -8988,15 +9233,15 @@ export namespace Models { /** * Time the insight was analyzed in ISO 8601 format. */ - analyzedAt?: string; + analyzedAt?: string | null; /** * Time the insight was dismissed in ISO 8601 format. Empty when not dismissed. */ - dismissedAt?: string; + dismissedAt?: string | null; /** * User ID that dismissed the insight. Empty when not dismissed. */ - dismissedBy?: string; + dismissedBy?: string | null; }; /** @@ -9072,7 +9317,7 @@ export namespace Models { /** * Time the report was analyzed in ISO 8601 format. */ - analyzedAt?: string; + analyzedAt?: string | null; }; /** @@ -9270,7 +9515,7 @@ export namespace Models { /** * Value to apply at the start of the next billing cycle. Null means no change is scheduled. For toggle addons, 0 means the addon will be removed at the next cycle. */ - nextValue?: number; + nextValue?: number | null; }; /** @@ -9398,7 +9643,7 @@ export namespace Models { /** * Conversion time in ISO 8601 format. */ - convertedAt?: string; + convertedAt?: string | null; }; /** @@ -9454,11 +9699,11 @@ export namespace Models { /** * Organization ID the reward was claimed on. */ - teamId?: string; + teamId?: string | null; /** * Credit document ID created when the reward was claimed. */ - creditId?: string; + creditId?: string | null; }; /** @@ -9508,11 +9753,11 @@ export namespace Models { /** * Dimension value this row covers. Null when no dimension was requested, empty when the dimension could not be derived for those events. */ - value?: string; + value?: string | null; /** * Start of the time bucket this row covers, in ISO 8601. Null when no interval was requested. */ - date?: string; + date?: string | null; /** * Unique visitors in the requested range. */ @@ -9524,7 +9769,7 @@ export namespace Models { /** * Total pageview events (events with name="pageview") in the requested range. Only the flat aggregate computes it; null on breakdown and time-series rows. */ - pageviews?: number; + pageviews?: number | null; /** * Total events in the requested range. */ @@ -9532,27 +9777,27 @@ export namespace Models { /** * Total sessions with activity in the requested range. Only the flat aggregate computes it; null on breakdown and time-series rows. */ - visits?: number; + visits?: number | null; /** * Share of single-event sessions, as a percentage. Only the flat aggregate computes it; null on breakdown and time-series rows. */ - bounceRate?: number; + bounceRate?: number | null; /** * Average session length in seconds, measured first event to last event. Single-event sessions count as 0. Only the flat aggregate computes it; null on breakdown and time-series rows. */ - visitDuration?: number; + visitDuration?: number | null; /** * Average pageviews per session (pageviews divided by visits). Only the flat aggregate computes it; null on breakdown and time-series rows. */ - viewsPerVisit?: number; + viewsPerVisit?: number | null; /** * Average scroll depth across events, as a percentage. Only the flat aggregate computes it; null on breakdown and time-series rows. */ - scrollDepth?: number; + scrollDepth?: number | null; /** * Average engaged time per session in seconds, counting only foreground time. Sessions that reported no engagement are excluded. Only the flat aggregate computes it; null on breakdown and time-series rows. */ - engagementTime?: number; + engagementTime?: number | null; }; /** @@ -9764,7 +10009,7 @@ export namespace Models { /** * Archive size in bytes. Null until the size is known. */ - size?: number; + size?: number | null; /** * The status of the archive creation. Possible values: pending, processing, uploading, completed, failed, skipped. */ @@ -9772,7 +10017,7 @@ export namespace Models { /** * The backup start time. Null until the backup starts. */ - startedAt?: string; + startedAt?: string | null; /** * Migration ID. */ @@ -9788,11 +10033,11 @@ export namespace Models { /** * The resource ID to backup. Set only if this archive should backup a single resource. */ - resourceId?: string; + resourceId?: string | null; /** * The resource type to backup. Set only if this archive should backup a single resource. */ - resourceType?: string; + resourceType?: string | null; }; /** @@ -9846,23 +10091,23 @@ export namespace Models { /** * Backup start time in ISO 8601 format. */ - startedAt?: string; + startedAt?: string | null; /** * Backup completion time in ISO 8601 format. */ - completedAt?: string; + completedAt?: string | null; /** * Backup verification time in ISO 8601 format. */ - verifiedAt?: string; + verifiedAt?: string | null; /** * Backup expiration time in ISO 8601 format. */ - expiresAt?: string; + expiresAt?: string | null; /** * Transaction-log position the backup anchors at, in the engine's own notation: PostgreSQL `{walSegment}|{lsn}`, MySQL and MariaDB `{binlogFile}|{offset}`, MongoDB `{seconds}|{increment}`. Empty when the backup recorded no position, which is the case for backup types that carry none. */ - logPosition?: string; + logPosition?: string | null; /** * Error message if backup failed. */ @@ -9928,7 +10173,7 @@ export namespace Models { /** * Address line 2 */ - addressLine2?: string; + addressLine2?: string | null; /** * Address country */ @@ -9940,11 +10185,11 @@ export namespace Models { /** * state */ - state?: string; + state?: string | null; /** * postal code */ - postalCode?: string; + postalCode?: string | null; }; /** @@ -9954,35 +10199,35 @@ export namespace Models { /** * Bandwidth limit */ - bandwidth?: number; + bandwidth?: number | null; /** * Storage limit */ - storage?: number; + storage?: number | null; /** * Users limit */ - users?: number; + users?: number | null; /** * Executions limit */ - executions?: number; + executions?: number | null; /** * GBHours limit */ - GBHours?: number; + GBHours?: number | null; /** * Image transformations limit */ - imageTransformations?: number; + imageTransformations?: number | null; /** * Auth phone limit */ - authPhone?: number; + authPhone?: number | null; /** * Budget limit percentage */ - budgetLimit?: number; + budgetLimit?: number | null; }; /** @@ -10032,7 +10277,7 @@ export namespace Models { /** * Members */ - members?: number; + members?: number | null; /** * Webhooks */ @@ -10132,7 +10377,7 @@ export namespace Models { /** * Activity log days */ - activityLogs?: number; + activityLogs?: number | null; /** * Usage history days */ @@ -10140,11 +10385,11 @@ export namespace Models { /** * Usage log time intervals allowed for this plan (e.g. 15m, 1h, 1d). */ - usageLogsIntervals?: string[]; + usageLogsIntervals?: string[] | null; /** * Metrics this plan only records as a total. They cannot be broken down by dimension or filtered, because the stored events cover a fraction of the real traffic. */ - usageAggregateOnlyMetrics?: string[]; + usageAggregateOnlyMetrics?: string[] | null; /** * Number of days of console inactivity before a project is paused. 0 means pausing is disabled. */ @@ -10156,7 +10401,7 @@ export namespace Models { /** * Additional resources. Null when the plan does not support usage billing. */ - usage?: UsageBillingPlan; + usage?: UsageBillingPlan | null; /** * Addons */ @@ -10184,7 +10429,7 @@ export namespace Models { /** * ISO country codes eligible for this regional plan. Empty means no restriction. */ - eligibleCountries?: string[]; + eligibleCountries?: string[] | null; /** * Is the billing plan available */ @@ -10240,7 +10485,7 @@ export namespace Models { /** * Does plan support backup policies. */ - backupsEnabled?: boolean; + backupsEnabled?: boolean | null; /** * Whether usage addons are calculated per project. */ @@ -10252,7 +10497,7 @@ export namespace Models { /** * How many policies does plan support */ - backupPolicies?: number; + backupPolicies?: number | null; /** * Maximum function and site deployment size in MB */ @@ -10265,6 +10510,10 @@ export namespace Models { * Shortest function schedule interval allowed, in minutes. 0 allows every interval. */ functionsIntervalMinimum: number; + /** + * Does the plan allow cron function schedules or only intervals. + */ + functionsAllowCron: boolean; /** * Does the plan support encrypted string attributes or not. */ @@ -10272,7 +10521,7 @@ export namespace Models { /** * Plan specific limits */ - limits?: BillingPlanLimits; + limits?: BillingPlanLimits | null; /** * Group of this billing plan for variants */ @@ -10280,7 +10529,7 @@ export namespace Models { /** * Details of the program this plan is a part of. */ - program?: Program; + program?: Program | null; /** * Included monthly dedicated-database compute credit in USD. Resets each billing cycle with no roll-over. */ @@ -10288,7 +10537,7 @@ export namespace Models { /** * Dedicated database limits available to this plan. */ - dedicatedDatabases?: BillingPlanDedicatedDatabaseLimits; + dedicatedDatabases?: BillingPlanDedicatedDatabaseLimits | null; }; /** @@ -10298,11 +10547,11 @@ export namespace Models { /** * Addon seats */ - seats?: BillingPlanAddonDetails; + seats?: BillingPlanAddonDetails | null; /** * Addon projects */ - projects?: BillingPlanAddonDetails; + projects?: BillingPlanAddonDetails | null; }; /** @@ -10328,7 +10577,7 @@ export namespace Models { /** * Price currency */ - currency?: string; + currency?: string | null; /** * Price */ @@ -10350,11 +10599,11 @@ export namespace Models { /** * Credits limit per billing cycle */ - credits?: number; + credits?: number | null; /** * Daily credits limit (if applicable) */ - dailyCredits?: number; + dailyCredits?: number | null; }; /** @@ -10364,79 +10613,79 @@ export namespace Models { /** * Minimum CPU allocation in millicores. */ - minCpu?: number; + minCpu?: number | null; /** * Maximum CPU allocation in millicores. */ - maxCpu?: number; + maxCpu?: number | null; /** * Minimum memory allocation in megabytes. */ - minMemoryMb?: number; + minMemoryMb?: number | null; /** * Maximum memory allocation in megabytes. */ - maxMemoryMb?: number; + maxMemoryMb?: number | null; /** * Minimum storage allocation in gigabytes. */ - minStorageGb?: number; + minStorageGb?: number | null; /** * Maximum storage allocation in gigabytes. */ - maxStorageGb?: number; + maxStorageGb?: number | null; /** * Maximum number of high-availability replicas per dedicated database. */ - maxReplicas?: number; + maxReplicas?: number | null; /** * Maximum number of client connections. */ - maxConnections?: number; + maxConnections?: number | null; /** * Maximum number of entries allowed in the IP allowlist. */ - maxIpAllowlistSize?: number; + maxIpAllowlistSize?: number | null; /** * Maximum number of database extensions that can be enabled. */ - maxExtensions?: number; + maxExtensions?: number | null; /** * Maximum number of days a backup can be retained. */ - maxBackupRetentionDays?: number; + maxBackupRetentionDays?: number | null; /** * Maximum number of days of point-in-time recovery data that can be retained. */ - maxPitrRetentionDays?: number; + maxPitrRetentionDays?: number | null; /** * Maximum number of rows a single SQL API query can return. */ - maxSqlApiMaxRows?: number; + maxSqlApiMaxRows?: number | null; /** * Maximum response size in bytes for a single SQL API query. */ - maxSqlApiMaxBytes?: number; + maxSqlApiMaxBytes?: number | null; /** * Maximum execution time in seconds for a single SQL API query. */ - maxSqlApiTimeoutSeconds?: number; + maxSqlApiTimeoutSeconds?: number | null; /** * Maximum number of SQL statement types that can be permitted through the SQL API. */ - maxSqlApiAllowedStatements?: number; + maxSqlApiAllowedStatements?: number | null; /** * SQL statement types permitted through the SQL API. */ - allowedSqlStatements?: string[]; + allowedSqlStatements?: string[] | null; /** * Storage classes available for dedicated databases. */ - allowedStorageClasses?: string[]; + allowedStorageClasses?: string[] | null; /** * Replica synchronization modes available for dedicated databases. */ - allowedSyncModes?: string[]; + allowedSyncModes?: string[] | null; }; /** @@ -10480,7 +10729,7 @@ export namespace Models { /** * Block expiration date in ISO 8601 format. Can be null if the block does not expire. */ - expiredAt?: string; + expiredAt?: string | null; }; /** @@ -10510,7 +10759,7 @@ export namespace Models { /** * Branch port. Null until the backing reports one. */ - port?: number; + port?: number | null; /** * Advertised catalog the client connects to. MySQL/MariaDB use default; Postgres uses the routing label. */ @@ -10574,19 +10823,19 @@ export namespace Models { /** * Billing plan campaign is associated with */ - plan?: string; + plan?: string | null; /** * Campaign CTA */ - cta?: string; + cta?: string | null; /** * Campaign info when claimed */ - claimed?: string; + claimed?: string | null; /** * Campaign infor when unclaimed */ - unclaimed?: string; + unclaimed?: string | null; /** * Campaign images */ @@ -10594,15 +10843,15 @@ export namespace Models { /** * Campaign reviews */ - reviews?: Review[]; + reviews?: Review[] | null; /** * Campaign valid only for new orgs. */ - onlyNewOrgs?: boolean; + onlyNewOrgs?: boolean | null; /** * Is footer */ - footer?: boolean; + footer?: boolean | null; }; /** @@ -10822,11 +11071,11 @@ export namespace Models { /** * Product API that owns this database: tablesdb, documentsdb, vectorsdb, mysql, postgresql, or mongodb. */ - api?: string; + api?: string | null; /** * Database engine: postgresql, mysql, or mongodb. Null until the backing reports one. */ - engine?: string; + engine?: string | null; /** * Database engine version. */ @@ -10846,7 +11095,7 @@ export namespace Models { /** * Database port for connections. Derived from the engine when the backing has not reported one yet. */ - connectionPort?: number; + connectionPort?: number | null; /** * Database username for connections. */ @@ -10858,7 +11107,7 @@ export namespace Models { /** * Committed generation of the primary connection credentials. Null until the rotation contract has been initialized. */ - credentialGeneration?: number; + credentialGeneration?: number | null; /** * Full database connection string (URI format). */ @@ -10878,11 +11127,11 @@ export namespace Models { /** * Last activity timestamp in ISO 8601 format. */ - lastAccessedAt?: string; + lastAccessedAt?: string | null; /** * Display-only timestamp when the database is expected to be considered idle (ISO 8601 format). Derived from last activity; lifecycle transitions are driven by lifecycleState. */ - idleUntil?: string; + idleUntil?: string | null; /** * Idle-lifecycle state of the database. Possible values: active, warm, cold, hibernated. */ @@ -10914,7 +11163,7 @@ export namespace Models { /** * Time the in-flight storage resize started, in ISO 8601 format. */ - storageResizeStartedAt?: string; + storageResizeStartedAt?: string | null; /** * Storage class. Currently always 'ssd'; DigitalOcean exposes a single block-storage class. */ @@ -11072,7 +11321,7 @@ export namespace Models { /** * Source database ID when restoring a backup into another database. */ - sourceDatabaseId?: string; + sourceDatabaseId?: string | null; /** * Project ID. */ @@ -11080,11 +11329,15 @@ export namespace Models { /** * Backup ID used for restoration (null for PITR). */ - backupId?: string; + backupId?: string | null; /** * Restoration type. Possible values: backup (restore from a specific backup snapshot), pitr (point-in-time recovery to a specific timestamp). */ type: string; + /** + * Where the backup was restored. Possible values: in_place (replayed over the database that took the backup), clone (recovered onto a second workload beside the database, which keeps serving until the clone is promoted onto its endpoint), copy (recovered onto a separate database with its own endpoint). + */ + restoreMode: string; /** * Restoration status. Possible values: pending (queued for processing), running (currently in progress), completed (successfully finished), failed (encountered an error). */ @@ -11092,15 +11345,15 @@ export namespace Models { /** * Target time for PITR restoration in ISO 8601 format. */ - targetTime?: string; + targetTime?: string | null; /** * Restoration start time in ISO 8601 format. */ - startedAt?: string; + startedAt?: string | null; /** * Restoration completion time in ISO 8601 format. */ - completedAt?: string; + completedAt?: string | null; /** * Error message if restoration failed. */ @@ -11134,7 +11387,7 @@ export namespace Models { /** * Connection statistics. Null when the database has not been probed. */ - connections?: DatabaseStatusConnections; + connections?: DatabaseStatusConnections | null; /** * Requested replication sync mode. Possible values: async, sync, quorum. Compare with effectiveSyncMode for what the primary is enforcing. */ @@ -11142,7 +11395,7 @@ export namespace Models { /** * Replication sync mode the primary is actually enforcing. Null when high availability is disabled or the state could not be read. */ - effectiveSyncMode?: string; + effectiveSyncMode?: string | null; /** * Whether the enforced replication is weaker than the requested syncMode. */ @@ -11158,7 +11411,7 @@ export namespace Models { /** * Whether the other sync fields are an engine reading rather than a recorded estimate. True when the primary answered what it is enforcing, including when that answer contradicted the record, in which case the contradicted values are replaced by the ones the engine reports. False when the reading could not be taken: the probe did not answer, there was no engine to ask, or the values describe a configuration change just applied rather than anything measured. Absent when no engine was asked at all, so an unprobed database is distinguishable from an unconfirmed one. False never means a standby was found lagging, because it is the absence of a reading rather than a negative one, so draw no conclusion about replication health from it or from a response that omits it. */ - syncStateConfirmed?: boolean; + syncStateConfirmed?: boolean | null; /** * List of database replicas and their status. Every configured member appears, including one the backend has not brought up, which is reported as not healthy. */ @@ -11270,7 +11523,7 @@ export namespace Models { /** * Transfer status for domains being transferred in. Null when the domain is not being transferred. */ - transferStatus?: DomainTransferStatusEnum; + transferStatus?: DomainTransferStatusEnum | null; /** * Team ID. */ @@ -11300,7 +11553,7 @@ export namespace Models { /** * Domain registration price. Null when the price could not be resolved, for example for an unsupported TLD. */ - price?: number; + price?: number | null; /** * Price period in years. */ @@ -11312,7 +11565,7 @@ export namespace Models { /** * Domain renewal price for the same period. Null when the domain was not priced or the registrar has no renewal price for it. */ - renewalPrice?: number; + renewalPrice?: number | null; /** * Renewal price period in years. */ @@ -11380,7 +11633,7 @@ export namespace Models { /** * Domain price. */ - price?: number; + price?: number | null; /** * Is the domain available? */ @@ -11476,7 +11729,7 @@ export namespace Models { /** * Discount amount */ - discount?: number; + discount?: number | null; /** * Credits amount */ @@ -11496,7 +11749,7 @@ export namespace Models { /** * Trial end date */ - trialEndDate?: string; + trialEndDate?: string | null; }; /** @@ -11564,7 +11817,7 @@ export namespace Models { /** * Discount amount */ - discount?: number; + discount?: number | null; /** * Credits amount */ @@ -11584,7 +11837,7 @@ export namespace Models { /** * Trial end date */ - trialEndDate?: string; + trialEndDate?: string | null; /** * Organization's existing credits */ @@ -11646,11 +11899,11 @@ export namespace Models { /** * Whether the engine reports this member's replication stream as up. Null when no reading was taken: a primary has no stream to report, and a member that is not active, or whose probe did not answer, has none yet. False is a reading and null is the absence of one, so the two are not interchangeable. Read it beside lagSeconds before expecting a failover that names no target to find a promotable standby: a member streaming at a known lag is one, and a member reporting null is not evidence either way. */ - replicating?: boolean; + replicating?: boolean | null; /** * Replication lag in seconds. Null when the lag is not known: a primary has none to report, and a member the backend has not probed has none yet. Also null against `replicating: true`, for a member that is streaming but whose engine printed no numeric lag. */ - lagSeconds?: number; + lagSeconds?: number | null; }; /** @@ -11684,15 +11937,15 @@ export namespace Models { /** * Time the operation was requested, in ISO 8601 format. */ - requestedAt?: string; + requestedAt?: string | null; /** * Time the operation started, in ISO 8601 format. */ - startedAt?: string; + startedAt?: string | null; /** * Time the operation reached a terminal state, in ISO 8601 format. */ - completedAt?: string; + completedAt?: string | null; /** * Machine-readable failure code. `Interrupted` marks an attempt that ended before its outcome could be confirmed. */ @@ -11732,7 +11985,7 @@ export namespace Models { /** * Replication sync mode the primary is actually enforcing. Null when high availability is disabled or the state could not be read. A value below the requested syncMode means writes are being acknowledged with weaker durability than configured. */ - effectiveSyncMode?: string; + effectiveSyncMode?: string | null; /** * Whether the enforced replication is weaker than the requested syncMode. */ @@ -11748,7 +12001,7 @@ export namespace Models { /** * Whether the other sync fields are an engine reading rather than a recorded estimate. True when the primary answered what it is enforcing, including when that answer contradicted the record, in which case the contradicted values are replaced by the ones the engine reports. False when the reading could not be taken: the probe did not answer, there was no engine to ask, or the values describe a configuration change just applied rather than anything measured. Absent when no engine was asked at all, so an unprobed database is distinguishable from an unconfirmed one. False never means a standby was found lagging, because it is the absence of a reading rather than a negative one, so draw no conclusion about replication health from it or from a response that omits it. */ - syncStateConfirmed?: boolean; + syncStateConfirmed?: boolean | null; /** * Per-pod statuses for the primary and every replica. */ @@ -11848,7 +12101,7 @@ export namespace Models { /** * Client secret for processing failed payments in front-end */ - clientSecret?: string; + clientSecret?: string | null; /** * Invoice status */ @@ -11860,7 +12113,7 @@ export namespace Models { /** * Last payment error associated with the invoice */ - lastError?: string; + lastError?: string | null; /** * Invoice due date. */ @@ -11898,11 +12151,11 @@ export namespace Models { /** * Block expiration date in ISO 8601 format. Can be null if the block does not expire. */ - expiredAt?: string; + expiredAt?: string | null; /** * Reason for the block. Can be null if no reason was provided. */ - reason?: string; + reason?: string | null; /** * Name of the project this block applies to. */ @@ -12062,7 +12315,7 @@ export namespace Models { /** * Project budget limit. Null when no budget is set. */ - billingBudget?: number; + billingBudget?: number | null; /** * Project budget limit */ @@ -12086,43 +12339,43 @@ export namespace Models { /** * Billing cycle start date. */ - billingStartDate?: string; + billingStartDate?: string | null; /** * Current invoice cycle start date. */ - billingCurrentInvoiceDate?: string; + billingCurrentInvoiceDate?: string | null; /** * Next invoice cycle start date. */ - billingNextInvoiceDate?: string; + billingNextInvoiceDate?: string | null; /** * Start date of trial. */ - billingTrialStartDate?: string; + billingTrialStartDate?: string | null; /** * Number of trial days. */ - billingTrialDays?: number; + billingTrialDays?: number | null; /** * Current active aggregation id. */ - billingAggregationId?: string; + billingAggregationId?: string | null; /** * Current active aggregation id. */ - billingInvoiceId?: string; + billingInvoiceId?: string | null; /** * Default payment method. */ - paymentMethodId?: string; + paymentMethodId?: string | null; /** * Default payment method. */ - billingAddressId?: string; + billingAddressId?: string | null; /** * Backup payment method. */ - backupPaymentMethodId?: string; + backupPaymentMethodId?: string | null; /** * Team status. */ @@ -12130,39 +12383,39 @@ export namespace Models { /** * Remarks on team status. */ - remarks?: string; + remarks?: string | null; /** * Organization agreements */ - agreementBAA?: string; + agreementBAA?: string | null; /** * Program manager's name. */ - programManagerName?: string; + programManagerName?: string | null; /** * Program manager's calendar link. */ - programManagerCalendar?: string; + programManagerCalendar?: string | null; /** * Program's discord channel name. */ - programDiscordChannelName?: string; + programDiscordChannelName?: string | null; /** * Program's discord channel URL. */ - programDiscordChannelUrl?: string; + programDiscordChannelUrl?: string | null; /** * Billing limits reached */ - billingLimits?: BillingLimits; + billingLimits?: BillingLimits | null; /** * Billing plan selected for downgrade. */ - billingPlanDowngrade?: string; + billingPlanDowngrade?: string | null; /** * Tax Id */ - billingTaxId?: string; + billingTaxId?: string | null; /** * Marked for deletion */ @@ -12246,39 +12499,39 @@ export namespace Models { /** * Expiry month of the payment method. */ - expiryMonth?: number; + expiryMonth?: number | null; /** * Expiry year of the payment method. */ - expiryYear?: number; + expiryYear?: number | null; /** * Last 4 digit of the payment method */ - last4?: string; + last4?: string | null; /** * Payment method brand */ - brand?: string; + brand?: string | null; /** * Name of the owner */ - name?: string; + name?: string | null; /** * Mandate ID of the payment method */ - mandateId?: string; + mandateId?: string | null; /** * Country of the payment method */ - country?: string; + country?: string | null; /** * State of the payment method */ - state?: string; + state?: string | null; /** * Last payment error associated with the payment method. */ - lastError?: string; + lastError?: string | null; /** * True when it's the default payment method. */ @@ -12406,7 +12659,7 @@ export namespace Models { /** * Failure reason when compliance could not be evaluated. Present only when the project DB or Regions API was unreachable; in that case `isCompliant` is false (fail closed) and `resources` is empty. */ - error?: string; + error?: string | null; }; /** @@ -12470,11 +12723,11 @@ export namespace Models { /** * The resource ID to backup. Set only if this policy should backup a single resource. */ - resourceId?: string; + resourceId?: string | null; /** * The resource type to backup. Set only if this policy should backup a single resource. */ - resourceType?: string; + resourceType?: string | null; /** * How many days to keep the backup before it will be automatically deleted. */ @@ -12618,7 +12871,7 @@ export namespace Models { /** * Does the organization have access to this region. Null when access has not been resolved. */ - available?: boolean; + available?: boolean | null; /** * Does the backend support this region. */ @@ -12664,7 +12917,7 @@ export namespace Models { /** * The restoration start time. Null until the restoration starts. */ - startedAt?: string; + startedAt?: string | null; /** * Migration ID. */ @@ -12838,11 +13091,11 @@ export namespace Models { /** * Whether the engine reports this member's replication stream as up. Null when no reading was taken: a primary has no stream to report, and a member that is not healthy, or whose probe did not answer, has none yet. `healthy` is a reachability probe of the member itself and says nothing about replication, so a healthy member may still not be replicating. */ - replicating?: boolean; + replicating?: boolean | null; /** * Replication lag in seconds (null for primary). Also null against `replicating: true`, for a member that is streaming but whose engine printed no numeric lag. */ - lagSeconds?: number; + lagSeconds?: number | null; }; /** @@ -12874,47 +13127,47 @@ export namespace Models { /** * Bandwidth additional resources */ - bandwidth?: AdditionalResource; + bandwidth?: AdditionalResource | null; /** * Executions additional resources */ - executions?: AdditionalResource; + executions?: AdditionalResource | null; /** * Member additional resources */ - member?: AdditionalResource; + member?: AdditionalResource | null; /** * Realtime additional resources */ - realtime?: AdditionalResource; + realtime?: AdditionalResource | null; /** * Realtime messages additional resources */ - realtimeMessages?: AdditionalResource; + realtimeMessages?: AdditionalResource | null; /** * Realtime bandwidth additional resources */ - realtimeBandwidth?: AdditionalResource; + realtimeBandwidth?: AdditionalResource | null; /** * Storage additional resources */ - storage?: AdditionalResource; + storage?: AdditionalResource | null; /** * User additional resources */ - users?: AdditionalResource; + users?: AdditionalResource | null; /** * GBHour additional resources */ - GBHours?: AdditionalResource; + GBHours?: AdditionalResource | null; /** * Image transformation additional resources */ - imageTransformations?: AdditionalResource; + imageTransformations?: AdditionalResource | null; /** * Credits additional resources */ - credits?: AdditionalResource; + credits?: AdditionalResource | null; }; /** @@ -13320,7 +13573,7 @@ export namespace Models { /** * Time the secret was last used for authentication in ISO 8601 format. Null if never used. */ - lastAccessedAt?: string; + lastAccessedAt?: string | null; }; /** @@ -13362,7 +13615,7 @@ export namespace Models { /** * Time the secret was last used for authentication in ISO 8601 format. Null if never used. */ - lastAccessedAt?: string; + lastAccessedAt?: string | null; }; /** @@ -13434,7 +13687,7 @@ export namespace Models { /** * Time an access token was last issued for the installation in ISO 8601 format. Null if never used. */ - lastAccessedAt?: string; + lastAccessedAt?: string | null; }; /** @@ -13476,7 +13729,7 @@ export namespace Models { /** * Time the app key was last used for authentication in ISO 8601 format. Null if never used. */ - lastAccessedAt?: string; + lastAccessedAt?: string | null; }; /** @@ -13638,11 +13891,11 @@ export namespace Models { /** * Granted RFC 9396 authorization details as a JSON string. */ - authorization_details?: string; + authorization_details?: string | null; /** * OpenID Connect ID token. Returned when the `openid` scope is granted. */ - id_token?: string; + id_token?: string | null; }; /** diff --git a/src/query.ts b/src/query.ts index 7a7da885..f25c4915 100644 --- a/src/query.ts +++ b/src/query.ts @@ -468,6 +468,20 @@ export class Query { queries.map((query) => JSONbig.parse(query)), ).toString(); + /** + * Constrain populated related documents on a relationship attribute. + * + * @param {string} attribute The relationship attribute to query. + * @param {string[]} queries Filter, order, select, and pagination queries applied to related documents. + * @returns {string} + */ + static relationship = (attribute: string, queries: string[]): string => + new Query( + 'relationship', + attribute, + queries.map((query) => JSONbig.parse(query)), + ).toString(); + /** * Filter resources where attribute is at a specific distance from the given coordinates. * @@ -659,4 +673,799 @@ export class Query { */ static notTouches = (attribute: string, values: any[]): string => new Query('notTouches', attribute, [values]).toString(); + + /** + * Count documents, optionally aliased. + */ + static count = (attribute: string = '*', alias: string = ''): string => + new Query( + 'count', + attribute, + alias !== '' ? alias : undefined, + ).toString(); + + /** + * Count distinct values of attribute, optionally aliased. + */ + static countDistinct = (attribute: string, alias: string = ''): string => + new Query( + 'countDistinct', + attribute, + alias !== '' ? alias : undefined, + ).toString(); + + /** Sum values of `attribute`, optionally aliased. */ + static sum = (attribute: string, alias: string = ''): string => + new Query( + 'sum', + attribute, + alias !== '' ? alias : undefined, + ).toString(); + + /** Average values of `attribute`, optionally aliased. */ + static avg = (attribute: string, alias: string = ''): string => + new Query( + 'avg', + attribute, + alias !== '' ? alias : undefined, + ).toString(); + + /** Minimum value of `attribute`, optionally aliased. */ + static min = (attribute: string, alias: string = ''): string => + new Query( + 'min', + attribute, + alias !== '' ? alias : undefined, + ).toString(); + + /** Maximum value of `attribute`, optionally aliased. */ + static max = (attribute: string, alias: string = ''): string => + new Query( + 'max', + attribute, + alias !== '' ? alias : undefined, + ).toString(); + + /** Population standard deviation of `attribute` (the same as stddevPop), optionally aliased. */ + static stddev = (attribute: string, alias: string = ''): string => + new Query( + 'stddev', + attribute, + alias !== '' ? alias : undefined, + ).toString(); + + /** Population standard deviation of `attribute`, optionally aliased. */ + static stddevPop = (attribute: string, alias: string = ''): string => + new Query( + 'stddevPop', + attribute, + alias !== '' ? alias : undefined, + ).toString(); + + /** Sample standard deviation of `attribute`, optionally aliased. */ + static stddevSamp = (attribute: string, alias: string = ''): string => + new Query( + 'stddevSamp', + attribute, + alias !== '' ? alias : undefined, + ).toString(); + + /** Population variance of `attribute` (the same as varPop), optionally aliased. */ + static variance = (attribute: string, alias: string = ''): string => + new Query( + 'variance', + attribute, + alias !== '' ? alias : undefined, + ).toString(); + + /** Population variance of `attribute`, optionally aliased. */ + static varPop = (attribute: string, alias: string = ''): string => + new Query( + 'varPop', + attribute, + alias !== '' ? alias : undefined, + ).toString(); + + /** Sample variance of `attribute`, optionally aliased. */ + static varSamp = (attribute: string, alias: string = ''): string => + new Query( + 'varSamp', + attribute, + alias !== '' ? alias : undefined, + ).toString(); + + /** Bitwise AND of `attribute`, optionally aliased. */ + static bitAnd = (attribute: string, alias: string = ''): string => + new Query( + 'bitAnd', + attribute, + alias !== '' ? alias : undefined, + ).toString(); + + /** Bitwise OR of `attribute`, optionally aliased. */ + static bitOr = (attribute: string, alias: string = ''): string => + new Query( + 'bitOr', + attribute, + alias !== '' ? alias : undefined, + ).toString(); + + /** Bitwise XOR of `attribute`, optionally aliased. */ + static bitXor = (attribute: string, alias: string = ''): string => + new Query( + 'bitXor', + attribute, + alias !== '' ? alias : undefined, + ).toString(); + + /** + * Group results by attributes. + */ + static groupBy = (attributes: string[]): string => + new Query('groupBy', undefined, attributes).toString(); + + /** + * Filter grouped results. `queries` are nested like `and`/`or`. + */ + static having = (queries: string[]): string => + new Query( + 'having', + undefined, + queries.map((query) => JSONbig.parse(query)), + ).toString(); + + /** Select distinct rows. */ + static distinct = (): string => new Query('distinct').toString(); + + /** + * Column-to-column join ON condition. + */ + static on = (left: string, right: string, operator: string = '='): string => + new Query('on', undefined, [left, operator, right]).toString(); + + /** + * Inner join. `table` is the joined collection/table ID; without an alias the server names the join after it, if the ID is a valid alias, and otherwise rejects the query. + */ + static join = ( + table: string, + leftOrAliasOrOn: string | string[], + rightOrOn: string | string[] = '', + operator: string = '=', + alias: string = '', + ): string => + Query.createJoin( + 'join', + table, + leftOrAliasOrOn, + rightOrOn, + operator, + alias, + ); + + /** Left join. `table` is the joined collection/table ID; without an alias the server names the join after it, if the ID is a valid alias, and otherwise rejects the query. */ + static leftJoin = ( + table: string, + leftOrAliasOrOn: string | string[], + rightOrOn: string | string[] = '', + operator: string = '=', + alias: string = '', + ): string => + Query.createJoin( + 'leftJoin', + table, + leftOrAliasOrOn, + rightOrOn, + operator, + alias, + ); + + /** Right join. `table` is the joined collection/table ID; without an alias the server names the join after it, if the ID is a valid alias, and otherwise rejects the query. */ + static rightJoin = ( + table: string, + leftOrAliasOrOn: string | string[], + rightOrOn: string | string[] = '', + operator: string = '=', + alias: string = '', + ): string => + Query.createJoin( + 'rightJoin', + table, + leftOrAliasOrOn, + rightOrOn, + operator, + alias, + ); + + /** Full outer join. `table` is the joined collection/table ID; without an alias the server names the join after it, if the ID is a valid alias, and otherwise rejects the query. */ + static fullOuterJoin = ( + table: string, + leftOrAliasOrOn: string | string[], + rightOrOn: string | string[] = '', + operator: string = '=', + alias: string = '', + ): string => + Query.createJoin( + 'fullOuterJoin', + table, + leftOrAliasOrOn, + rightOrOn, + operator, + alias, + ); + + /** Cross join. `table` is the joined collection/table ID; without an alias the server names the join after it, if the ID is a valid alias, and otherwise rejects the query. */ + static crossJoin = (table: string, alias: string = ''): string => + new Query( + 'crossJoin', + table, + alias !== '' ? alias : undefined, + ).toString(); + + /** Filter resources where `attribute` covers the given geometry. */ + static covers = (attribute: string, values: any[]): string => + new Query('covers', attribute, [values]).toString(); + + /** Filter resources where `attribute` does not cover the given geometry. */ + static notCovers = (attribute: string, values: any[]): string => + new Query('notCovers', attribute, [values]).toString(); + + /** Filter resources where `attribute` is spatially equal to the given geometry. */ + static spatialEquals = (attribute: string, values: any[]): string => + new Query('spatialEquals', attribute, [values]).toString(); + + /** Filter resources where `attribute` is not spatially equal to the given geometry. */ + static notSpatialEquals = (attribute: string, values: any[]): string => + new Query('notSpatialEquals', attribute, [values]).toString(); + + /** + * Return limit and offset queries for 1-based page pagination. + */ + static page = (page: number, perPage: number = 25): string[] => { + if (page < 1) { + throw new Error('Page must be >= 1, got ' + page); + } + if (perPage < 1) { + throw new Error('Per page must be >= 1, got ' + perPage); + } + return [Query.limit(perPage), Query.offset((page - 1) * perPage)]; + }; + + /** Start a fluent query builder. */ + static builder = (): Query.Builder => new Query.Builder(); + + private static createJoin( + method: string, + table: string, + leftOrAliasOrOn: string | string[], + rightOrOn: string | string[] = '', + operator: string = '=', + alias: string = '', + ): string { + if (Array.isArray(leftOrAliasOrOn)) { + return Query.nestedJoin(method, table, '', leftOrAliasOrOn); + } + if (Array.isArray(rightOrOn)) { + return Query.nestedJoin(method, table, leftOrAliasOrOn, rightOrOn); + } + return new Query( + method, + table, + alias !== '' + ? [leftOrAliasOrOn, operator, rightOrOn, alias] + : [leftOrAliasOrOn, operator, rightOrOn], + ).toString(); + } + + private static nestedJoin( + method: string, + table: string, + alias: string, + on: string[], + ): string { + const values: any[] = []; + if (alias !== '') { + values.push(alias); + } + for (const query of on) { + values.push(JSONbig.parse(query)); + } + return new Query(method, table, values).toString(); + } +} + +export type QueryInput = string | Query | Query.Builder | QueryInput[]; + +/** + * Fluent collector of Query fragments. Call {@link Query.Builder.build} to + * produce the `string[]` expected by list/createQuery methods. + */ +export namespace Query { + export class Builder { + private readonly queries: string[] = []; + + build(): string[] { + return [...this.queries]; + } + + equal(attribute: string, value: QueryTypes): this { + return this.push(Query.equal(attribute, value)); + } + + notEqual(attribute: string, value: QueryTypes): this { + return this.push(Query.notEqual(attribute, value)); + } + + lessThan(attribute: string, value: QueryTypes): this { + return this.push(Query.lessThan(attribute, value)); + } + + lessThanEqual(attribute: string, value: QueryTypes): this { + return this.push(Query.lessThanEqual(attribute, value)); + } + + greaterThan(attribute: string, value: QueryTypes): this { + return this.push(Query.greaterThan(attribute, value)); + } + + greaterThanEqual(attribute: string, value: QueryTypes): this { + return this.push(Query.greaterThanEqual(attribute, value)); + } + + search(attribute: string, value: string): this { + return this.push(Query.search(attribute, value)); + } + + isNull(attribute: string): this { + return this.push(Query.isNull(attribute)); + } + + isNotNull(attribute: string): this { + return this.push(Query.isNotNull(attribute)); + } + + between( + attribute: string, + start: string | number | bigint, + end: string | number | bigint, + ): this { + return this.push(Query.between(attribute, start, end)); + } + + startsWith(attribute: string, value: string): this { + return this.push(Query.startsWith(attribute, value)); + } + + endsWith(attribute: string, value: string): this { + return this.push(Query.endsWith(attribute, value)); + } + + select(attributes: string[]): this { + return this.push(Query.select(attributes)); + } + + cursorAfter(documentId: string): this { + return this.push(Query.cursorAfter(documentId)); + } + + cursorBefore(documentId: string): this { + return this.push(Query.cursorBefore(documentId)); + } + + orderAsc(attribute: string): this { + return this.push(Query.orderAsc(attribute)); + } + + orderDesc(attribute: string): this { + return this.push(Query.orderDesc(attribute)); + } + + orderRandom(): this { + return this.push(Query.orderRandom()); + } + + limit(limit: number): this { + return this.push(Query.limit(limit)); + } + + offset(offset: number): this { + return this.push(Query.offset(offset)); + } + + contains(attribute: string, value: string | any[]): this { + return this.push(Query.contains(attribute, value)); + } + + containsAny(attribute: string, value: any[]): this { + return this.push(Query.containsAny(attribute, value)); + } + + containsAll(attribute: string, value: any[]): this { + return this.push(Query.containsAll(attribute, value)); + } + + notContains(attribute: string, value: string | any[]): this { + return this.push(Query.notContains(attribute, value)); + } + + notSearch(attribute: string, value: string): this { + return this.push(Query.notSearch(attribute, value)); + } + + notBetween( + attribute: string, + start: string | number | bigint, + end: string | number | bigint, + ): this { + return this.push(Query.notBetween(attribute, start, end)); + } + + notStartsWith(attribute: string, value: string): this { + return this.push(Query.notStartsWith(attribute, value)); + } + + notEndsWith(attribute: string, value: string): this { + return this.push(Query.notEndsWith(attribute, value)); + } + + regex(attribute: string, pattern: string): this { + return this.push(Query.regex(attribute, pattern)); + } + + exists(attributes: string[]): this { + return this.push(Query.exists(attributes)); + } + + notExists(attributes: string[]): this { + return this.push(Query.notExists(attributes)); + } + + createdBefore(value: string): this { + return this.push(Query.createdBefore(value)); + } + + createdAfter(value: string): this { + return this.push(Query.createdAfter(value)); + } + + createdBetween(start: string, end: string): this { + return this.push(Query.createdBetween(start, end)); + } + + updatedBefore(value: string): this { + return this.push(Query.updatedBefore(value)); + } + + updatedAfter(value: string): this { + return this.push(Query.updatedAfter(value)); + } + + updatedBetween(start: string, end: string): this { + return this.push(Query.updatedBetween(start, end)); + } + + or(queries: string[]): this { + return this.push(Query.or(queries)); + } + + and(queries: string[]): this { + return this.push(Query.and(queries)); + } + + elemMatch(attribute: string, queries: string[]): this { + return this.push(Query.elemMatch(attribute, queries)); + } + + relationship(attribute: string, queries: string[]): this { + return this.push(Query.relationship(attribute, queries)); + } + + distanceEqual( + attribute: string, + values: any[], + distance: number, + meters: boolean = true, + ): this { + return this.push( + Query.distanceEqual(attribute, values, distance, meters), + ); + } + + distanceNotEqual( + attribute: string, + values: any[], + distance: number, + meters: boolean = true, + ): this { + return this.push( + Query.distanceNotEqual(attribute, values, distance, meters), + ); + } + + distanceGreaterThan( + attribute: string, + values: any[], + distance: number, + meters: boolean = true, + ): this { + return this.push( + Query.distanceGreaterThan(attribute, values, distance, meters), + ); + } + + distanceLessThan( + attribute: string, + values: any[], + distance: number, + meters: boolean = true, + ): this { + return this.push( + Query.distanceLessThan(attribute, values, distance, meters), + ); + } + + intersects(attribute: string, values: any[]): this { + return this.push(Query.intersects(attribute, values)); + } + + notIntersects(attribute: string, values: any[]): this { + return this.push(Query.notIntersects(attribute, values)); + } + + crosses(attribute: string, values: any[]): this { + return this.push(Query.crosses(attribute, values)); + } + + notCrosses(attribute: string, values: any[]): this { + return this.push(Query.notCrosses(attribute, values)); + } + + overlaps(attribute: string, values: any[]): this { + return this.push(Query.overlaps(attribute, values)); + } + + notOverlaps(attribute: string, values: any[]): this { + return this.push(Query.notOverlaps(attribute, values)); + } + + touches(attribute: string, values: any[]): this { + return this.push(Query.touches(attribute, values)); + } + + notTouches(attribute: string, values: any[]): this { + return this.push(Query.notTouches(attribute, values)); + } + + count(attribute: string = '*', alias: string = ''): this { + return this.push(Query.count(attribute, alias)); + } + + countDistinct(attribute: string, alias: string = ''): this { + return this.push(Query.countDistinct(attribute, alias)); + } + + sum(attribute: string, alias: string = ''): this { + return this.push(Query.sum(attribute, alias)); + } + + avg(attribute: string, alias: string = ''): this { + return this.push(Query.avg(attribute, alias)); + } + + min(attribute: string, alias: string = ''): this { + return this.push(Query.min(attribute, alias)); + } + + max(attribute: string, alias: string = ''): this { + return this.push(Query.max(attribute, alias)); + } + + stddev(attribute: string, alias: string = ''): this { + return this.push(Query.stddev(attribute, alias)); + } + + stddevPop(attribute: string, alias: string = ''): this { + return this.push(Query.stddevPop(attribute, alias)); + } + + stddevSamp(attribute: string, alias: string = ''): this { + return this.push(Query.stddevSamp(attribute, alias)); + } + + variance(attribute: string, alias: string = ''): this { + return this.push(Query.variance(attribute, alias)); + } + + varPop(attribute: string, alias: string = ''): this { + return this.push(Query.varPop(attribute, alias)); + } + + varSamp(attribute: string, alias: string = ''): this { + return this.push(Query.varSamp(attribute, alias)); + } + + bitAnd(attribute: string, alias: string = ''): this { + return this.push(Query.bitAnd(attribute, alias)); + } + + bitOr(attribute: string, alias: string = ''): this { + return this.push(Query.bitOr(attribute, alias)); + } + + bitXor(attribute: string, alias: string = ''): this { + return this.push(Query.bitXor(attribute, alias)); + } + + groupBy(attributes: string[]): this { + return this.push(Query.groupBy(attributes)); + } + + having(queries: string[]): this { + return this.push(Query.having(queries)); + } + + distinct(): this { + return this.push(Query.distinct()); + } + + join( + table: string, + leftOrAliasOrOn: string | string[], + rightOrOn: string | string[] = '', + operator: string = '=', + alias: string = '', + ): this { + return this.push( + Query.join(table, leftOrAliasOrOn, rightOrOn, operator, alias), + ); + } + + leftJoin( + table: string, + leftOrAliasOrOn: string | string[], + rightOrOn: string | string[] = '', + operator: string = '=', + alias: string = '', + ): this { + return this.push( + Query.leftJoin( + table, + leftOrAliasOrOn, + rightOrOn, + operator, + alias, + ), + ); + } + + rightJoin( + table: string, + leftOrAliasOrOn: string | string[], + rightOrOn: string | string[] = '', + operator: string = '=', + alias: string = '', + ): this { + return this.push( + Query.rightJoin( + table, + leftOrAliasOrOn, + rightOrOn, + operator, + alias, + ), + ); + } + + fullOuterJoin( + table: string, + leftOrAliasOrOn: string | string[], + rightOrOn: string | string[] = '', + operator: string = '=', + alias: string = '', + ): this { + return this.push( + Query.fullOuterJoin( + table, + leftOrAliasOrOn, + rightOrOn, + operator, + alias, + ), + ); + } + + crossJoin(table: string, alias: string = ''): this { + return this.push(Query.crossJoin(table, alias)); + } + + vectorDot(attribute: string, vector: number[]): this { + return this.push(Query.vectorDot(attribute, vector)); + } + + vectorCosine(attribute: string, vector: number[]): this { + return this.push(Query.vectorCosine(attribute, vector)); + } + + vectorEuclidean(attribute: string, vector: number[]): this { + return this.push(Query.vectorEuclidean(attribute, vector)); + } + + covers(attribute: string, values: any[]): this { + return this.push(Query.covers(attribute, values)); + } + + notCovers(attribute: string, values: any[]): this { + return this.push(Query.notCovers(attribute, values)); + } + + spatialEquals(attribute: string, values: any[]): this { + return this.push(Query.spatialEquals(attribute, values)); + } + + notSpatialEquals(attribute: string, values: any[]): this { + return this.push(Query.notSpatialEquals(attribute, values)); + } + + page(page: number, perPage: number = 25): this { + return this.push(Query.page(page, perPage)); + } + + private push(query: string | string[]): this { + if (Array.isArray(query)) { + this.queries.push(...query); + } else { + this.queries.push(query); + } + return this; + } + } +} + +export function normalizeQueries(queries?: QueryInput | null): string[] { + if (queries == null) { + return []; + } + if (queries instanceof Query.Builder) { + return queries.build(); + } + if (!Array.isArray(queries)) { + if (queries instanceof Query) { + return [queries.toString()]; + } + if (typeof queries === 'string') { + return [queries]; + } + return []; + } + + const out: string[] = []; + for (const item of queries) { + out.push(...normalizeQueries(item)); + } + return out; } + +function isQueryValue(value: unknown): value is Query | Query.Builder { + return value instanceof Query.Builder || value instanceof Query; +} + +export function flattenParam(value: unknown): unknown { + if (isQueryValue(value)) { + return normalizeQueries(value); + } + if (!Array.isArray(value)) { + return value; + } + + const out: unknown[] = []; + for (const item of value) { + if (isQueryValue(item)) { + out.push(...normalizeQueries(item)); + } else { + out.push(flattenParam(item)); + } + } + return out; +} + +export const QueryBuilder = Query.Builder; +export type QueryBuilder = Query.Builder; diff --git a/src/services/account.ts b/src/services/account.ts index 871a1b4c..75418988 100644 --- a/src/services/account.ts +++ b/src/services/account.ts @@ -258,48 +258,61 @@ export class Account { * List all billing addresses for a user. * * @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/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, expired, failed + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise<Models.BillingAddressList>} */ listBillingAddresses(params?: { queries?: string[]; + total?: boolean; }): Promise<Models.BillingAddressList>; /** * List all billing addresses for a user. * * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, expired, failed + * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise<Models.BillingAddressList>} * @deprecated Use the object parameter style method for a better developer experience. */ listBillingAddresses( queries?: string[], + total?: boolean, ): Promise<Models.BillingAddressList>; listBillingAddresses( - paramsOrFirst?: { queries?: string[] } | string[], + paramsOrFirst?: { queries?: string[]; total?: boolean } | string[], + ...rest: [boolean?] ): Promise<Models.BillingAddressList> { - let params: { queries?: string[] }; + let params: { queries?: string[]; total?: boolean }; if ( - typeof paramsOrFirst === 'undefined' || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) ) { - params = (paramsOrFirst || {}) as { queries?: string[] }; + params = (paramsOrFirst || {}) as { + queries?: string[]; + total?: boolean; + }; } else { params = { queries: paramsOrFirst as string[], + total: rest[0] as boolean, }; } const queries = params.queries; + const total = params.total; const apiPath = '/account/billing-addresses'; const apiPayload: Payload = {}; if (typeof queries !== 'undefined') { apiPayload['queries'] = queries; } + if (typeof total !== 'undefined') { + apiPayload['total'] = total; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -343,9 +356,9 @@ export class Account { * @param {string} params.country - Country * @param {string} params.city - City * @param {string} params.streetAddress - Street address - * @param {string} params.addressLine2 - Address line 2 - * @param {string} params.state - State or province - * @param {string} params.postalCode - Postal code + * @param {string | null} params.addressLine2 - Address line 2 + * @param {string | null} params.state - State or province + * @param {string | null} params.postalCode - Postal code * @throws {AppwriteException} * @returns {Promise<Models.BillingAddress>} */ @@ -353,9 +366,9 @@ export class Account { country: string; city: string; streetAddress: string; - addressLine2?: string; - state?: string; - postalCode?: string; + addressLine2?: string | null; + state?: string | null; + postalCode?: string | null; }): Promise<Models.BillingAddress>; /** * Add a new billing address to a user's account. @@ -363,9 +376,9 @@ export class Account { * @param {string} country - Country * @param {string} city - City * @param {string} streetAddress - Street address - * @param {string} addressLine2 - Address line 2 - * @param {string} state - State or province - * @param {string} postalCode - Postal code + * @param {string | null} addressLine2 - Address line 2 + * @param {string | null} state - State or province + * @param {string | null} postalCode - Postal code * @throws {AppwriteException} * @returns {Promise<Models.BillingAddress>} * @deprecated Use the object parameter style method for a better developer experience. @@ -374,9 +387,9 @@ export class Account { country: string, city: string, streetAddress: string, - addressLine2?: string, - state?: string, - postalCode?: string, + addressLine2?: string | null, + state?: string | null, + postalCode?: string | null, ): Promise<Models.BillingAddress>; createBillingAddress( paramsOrFirst: @@ -384,20 +397,26 @@ export class Account { country: string; city: string; streetAddress: string; - addressLine2?: string; - state?: string; - postalCode?: string; + addressLine2?: string | null; + state?: string | null; + postalCode?: string | null; } | string, - ...rest: [string?, string?, string?, string?, string?] + ...rest: [ + string?, + string?, + (string | null)?, + (string | null)?, + (string | null)?, + ] ): Promise<Models.BillingAddress> { let params: { country: string; city: string; streetAddress: string; - addressLine2?: string; - state?: string; - postalCode?: string; + addressLine2?: string | null; + state?: string | null; + postalCode?: string | null; }; if ( @@ -409,18 +428,18 @@ export class Account { country: string; city: string; streetAddress: string; - addressLine2?: string; - state?: string; - postalCode?: string; + addressLine2?: string | null; + state?: string | null; + postalCode?: string | null; }; } else { params = { country: paramsOrFirst as string, city: rest[0] as string, streetAddress: rest[1] as string, - addressLine2: rest[2] as string, - state: rest[3] as string, - postalCode: rest[4] as string, + addressLine2: rest[2] as string | null, + state: rest[3] as string | null, + postalCode: rest[4] as string | null, }; } @@ -575,9 +594,9 @@ export class Account { * @param {string} params.country - Country * @param {string} params.city - City * @param {string} params.streetAddress - Street address - * @param {string} params.addressLine2 - Address line 2 - * @param {string} params.state - State or province - * @param {string} params.postalCode - Postal code + * @param {string | null} params.addressLine2 - Address line 2 + * @param {string | null} params.state - State or province + * @param {string | null} params.postalCode - Postal code * @throws {AppwriteException} * @returns {Promise<Models.BillingAddress>} */ @@ -586,9 +605,9 @@ export class Account { country: string; city: string; streetAddress: string; - addressLine2?: string; - state?: string; - postalCode?: string; + addressLine2?: string | null; + state?: string | null; + postalCode?: string | null; }): Promise<Models.BillingAddress>; /** * Update a specific billing address using it's ID. @@ -597,9 +616,9 @@ export class Account { * @param {string} country - Country * @param {string} city - City * @param {string} streetAddress - Street address - * @param {string} addressLine2 - Address line 2 - * @param {string} state - State or province - * @param {string} postalCode - Postal code + * @param {string | null} addressLine2 - Address line 2 + * @param {string | null} state - State or province + * @param {string | null} postalCode - Postal code * @throws {AppwriteException} * @returns {Promise<Models.BillingAddress>} * @deprecated Use the object parameter style method for a better developer experience. @@ -609,9 +628,9 @@ export class Account { country: string, city: string, streetAddress: string, - addressLine2?: string, - state?: string, - postalCode?: string, + addressLine2?: string | null, + state?: string | null, + postalCode?: string | null, ): Promise<Models.BillingAddress>; updateBillingAddress( paramsOrFirst: @@ -620,21 +639,28 @@ export class Account { country: string; city: string; streetAddress: string; - addressLine2?: string; - state?: string; - postalCode?: string; + addressLine2?: string | null; + state?: string | null; + postalCode?: string | null; } | string, - ...rest: [string?, string?, string?, string?, string?, string?] + ...rest: [ + string?, + string?, + string?, + (string | null)?, + (string | null)?, + (string | null)?, + ] ): Promise<Models.BillingAddress> { let params: { billingAddressId: string; country: string; city: string; streetAddress: string; - addressLine2?: string; - state?: string; - postalCode?: string; + addressLine2?: string | null; + state?: string | null; + postalCode?: string | null; }; if ( @@ -647,9 +673,9 @@ export class Account { country: string; city: string; streetAddress: string; - addressLine2?: string; - state?: string; - postalCode?: string; + addressLine2?: string | null; + state?: string | null; + postalCode?: string | null; }; } else { params = { @@ -657,9 +683,9 @@ export class Account { country: rest[0] as string, city: rest[1] as string, streetAddress: rest[2] as string, - addressLine2: rest[3] as string, - state: rest[4] as string, - postalCode: rest[5] as string, + addressLine2: rest[3] as string | null, + state: rest[4] as string | null, + postalCode: rest[5] as string | null, }; } @@ -1684,44 +1710,61 @@ export class Account { * List all invoices tied to an account. * * @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/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: teamId, aggregationId, type, amount, currency, from, to, dueAt, attempts, status, grossAmount + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise<Models.InvoiceList>} */ - listInvoices(params?: { queries?: string[] }): Promise<Models.InvoiceList>; + listInvoices(params?: { + queries?: string[]; + total?: boolean; + }): Promise<Models.InvoiceList>; /** * List all invoices tied to an account. * * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: teamId, aggregationId, type, amount, currency, from, to, dueAt, attempts, status, grossAmount + * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise<Models.InvoiceList>} * @deprecated Use the object parameter style method for a better developer experience. */ - listInvoices(queries?: string[]): Promise<Models.InvoiceList>; listInvoices( - paramsOrFirst?: { queries?: string[] } | string[], + queries?: string[], + total?: boolean, + ): Promise<Models.InvoiceList>; + listInvoices( + paramsOrFirst?: { queries?: string[]; total?: boolean } | string[], + ...rest: [boolean?] ): Promise<Models.InvoiceList> { - let params: { queries?: string[] }; + let params: { queries?: string[]; total?: boolean }; if ( - typeof paramsOrFirst === 'undefined' || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) ) { - params = (paramsOrFirst || {}) as { queries?: string[] }; + params = (paramsOrFirst || {}) as { + queries?: string[]; + total?: boolean; + }; } else { params = { queries: paramsOrFirst as string[], + total: rest[0] as boolean, }; } const queries = params.queries; + const total = params.total; const apiPath = '/account/invoices'; const apiPayload: Payload = {}; if (typeof queries !== 'undefined') { apiPayload['queries'] = queries; } + if (typeof total !== 'undefined') { + apiPayload['total'] = total; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -1926,6 +1969,7 @@ export class Account { $createdAt: '', $updatedAt: '', name: '', + description: '', expire: '', scopes: [], secret: '', @@ -1944,21 +1988,21 @@ export class Account { * * @param {string} params.name - Key name. Max length: 128 chars. * @param {AccountKeyScopes[]} params.scopes - Key scopes list. Maximum of 200 scopes are allowed. - * @param {string} params.expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. + * @param {string | null} params.expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. * @throws {AppwriteException} * @returns {Promise<Models.Key>} */ createKey(params: { name: string; scopes: AccountKeyScopes[]; - expire?: string; + expire?: string | null; }): Promise<Models.Key>; /** * Create a new account API key. * * @param {string} name - Key name. Max length: 128 chars. * @param {AccountKeyScopes[]} scopes - Key scopes list. Maximum of 200 scopes are allowed. - * @param {string} expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. + * @param {string | null} expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. * @throws {AppwriteException} * @returns {Promise<Models.Key>} * @deprecated Use the object parameter style method for a better developer experience. @@ -1966,18 +2010,22 @@ export class Account { createKey( name: string, scopes: AccountKeyScopes[], - expire?: string, + expire?: string | null, ): Promise<Models.Key>; createKey( paramsOrFirst: - | { name: string; scopes: AccountKeyScopes[]; expire?: string } + | { + name: string; + scopes: AccountKeyScopes[]; + expire?: string | null; + } | string, - ...rest: [AccountKeyScopes[]?, string?] + ...rest: [AccountKeyScopes[]?, (string | null)?] ): Promise<Models.Key> { let params: { name: string; scopes: AccountKeyScopes[]; - expire?: string; + expire?: string | null; }; if ( @@ -1988,13 +2036,13 @@ export class Account { params = (paramsOrFirst || {}) as { name: string; scopes: AccountKeyScopes[]; - expire?: string; + expire?: string | null; }; } else { params = { name: paramsOrFirst as string, scopes: rest[0] as AccountKeyScopes[], - expire: rest[1] as string, + expire: rest[1] as string | null, }; } @@ -2037,6 +2085,7 @@ export class Account { $createdAt: '', $updatedAt: '', name: '', + description: '', expire: '', scopes: [], secret: '', @@ -2109,6 +2158,7 @@ export class Account { $createdAt: '', $updatedAt: '', name: '', + description: '', expire: '', scopes: [], secret: '', @@ -2128,7 +2178,7 @@ export class Account { * @param {string} params.keyId - Key unique ID. * @param {string} params.name - Key name. Max length: 128 chars. * @param {AccountKeyScopes[]} params.scopes - Key scopes list. Maximum of 200 scopes are allowed. - * @param {string} params.expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. + * @param {string | null} params.expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. * @throws {AppwriteException} * @returns {Promise<Models.Key>} */ @@ -2136,7 +2186,7 @@ export class Account { keyId: string; name: string; scopes: AccountKeyScopes[]; - expire?: string; + expire?: string | null; }): Promise<Models.Key>; /** * Update a key by its unique ID. Use this endpoint to update the name, scopes, or expiration time of an API key. @@ -2144,7 +2194,7 @@ export class Account { * @param {string} keyId - Key unique ID. * @param {string} name - Key name. Max length: 128 chars. * @param {AccountKeyScopes[]} scopes - Key scopes list. Maximum of 200 scopes are allowed. - * @param {string} expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. + * @param {string | null} expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. * @throws {AppwriteException} * @returns {Promise<Models.Key>} * @deprecated Use the object parameter style method for a better developer experience. @@ -2153,7 +2203,7 @@ export class Account { keyId: string, name: string, scopes: AccountKeyScopes[], - expire?: string, + expire?: string | null, ): Promise<Models.Key>; updateKey( paramsOrFirst: @@ -2161,16 +2211,16 @@ export class Account { keyId: string; name: string; scopes: AccountKeyScopes[]; - expire?: string; + expire?: string | null; } | string, - ...rest: [string?, AccountKeyScopes[]?, string?] + ...rest: [string?, AccountKeyScopes[]?, (string | null)?] ): Promise<Models.Key> { let params: { keyId: string; name: string; scopes: AccountKeyScopes[]; - expire?: string; + expire?: string | null; }; if ( @@ -2182,14 +2232,14 @@ export class Account { keyId: string; name: string; scopes: AccountKeyScopes[]; - expire?: string; + expire?: string | null; }; } else { params = { keyId: paramsOrFirst as string, name: rest[0] as string, scopes: rest[1] as AccountKeyScopes[], - expire: rest[2] as string, + expire: rest[2] as string | null, }; } @@ -2239,6 +2289,7 @@ export class Account { $createdAt: '', $updatedAt: '', name: '', + description: '', expire: '', scopes: [], secret: '', @@ -3839,7 +3890,7 @@ export class Account { $createdAt: '', passkeyId: '', expire: '', - publicKey: [], + publicKey: {}, }, }, }, @@ -4287,46 +4338,61 @@ export class Account { * List payment methods for this account. * * @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/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, expired, failed + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise<Models.PaymentMethodList>} */ listPaymentMethods(params?: { queries?: string[]; + total?: boolean; }): Promise<Models.PaymentMethodList>; /** * List payment methods for this account. * * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, expired, failed + * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise<Models.PaymentMethodList>} * @deprecated Use the object parameter style method for a better developer experience. */ - listPaymentMethods(queries?: string[]): Promise<Models.PaymentMethodList>; listPaymentMethods( - paramsOrFirst?: { queries?: string[] } | string[], + queries?: string[], + total?: boolean, + ): Promise<Models.PaymentMethodList>; + listPaymentMethods( + paramsOrFirst?: { queries?: string[]; total?: boolean } | string[], + ...rest: [boolean?] ): Promise<Models.PaymentMethodList> { - let params: { queries?: string[] }; + let params: { queries?: string[]; total?: boolean }; if ( - typeof paramsOrFirst === 'undefined' || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) ) { - params = (paramsOrFirst || {}) as { queries?: string[] }; + params = (paramsOrFirst || {}) as { + queries?: string[]; + total?: boolean; + }; } else { params = { queries: paramsOrFirst as string[], + total: rest[0] as boolean, }; } const queries = params.queries; + const total = params.total; const apiPath = '/account/payment-methods'; const apiPayload: Payload = {}; if (typeof queries !== 'undefined') { apiPayload['queries'] = queries; } + if (typeof total !== 'undefined') { + apiPayload['total'] = total; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -4685,7 +4751,7 @@ export class Account { * @param {string} params.paymentMethodId - Unique ID of payment method * @param {string} params.providerMethodId - Payment method ID from the payment provider * @param {string} params.name - Name in the payment method - * @param {string} params.state - State of the payment method country + * @param {string | null} params.state - State of the payment method country * @throws {AppwriteException} * @returns {Promise<Models.PaymentMethod>} */ @@ -4693,7 +4759,7 @@ export class Account { paymentMethodId: string; providerMethodId: string; name: string; - state?: string; + state?: string | null; }): Promise<Models.PaymentMethod>; /** * Update payment method provider. @@ -4701,7 +4767,7 @@ export class Account { * @param {string} paymentMethodId - Unique ID of payment method * @param {string} providerMethodId - Payment method ID from the payment provider * @param {string} name - Name in the payment method - * @param {string} state - State of the payment method country + * @param {string | null} state - State of the payment method country * @throws {AppwriteException} * @returns {Promise<Models.PaymentMethod>} * @deprecated Use the object parameter style method for a better developer experience. @@ -4710,7 +4776,7 @@ export class Account { paymentMethodId: string, providerMethodId: string, name: string, - state?: string, + state?: string | null, ): Promise<Models.PaymentMethod>; updatePaymentMethodProvider( paramsOrFirst: @@ -4718,16 +4784,16 @@ export class Account { paymentMethodId: string; providerMethodId: string; name: string; - state?: string; + state?: string | null; } | string, - ...rest: [string?, string?, string?] + ...rest: [string?, string?, (string | null)?] ): Promise<Models.PaymentMethod> { let params: { paymentMethodId: string; providerMethodId: string; name: string; - state?: string; + state?: string | null; }; if ( @@ -4739,14 +4805,14 @@ export class Account { paymentMethodId: string; providerMethodId: string; name: string; - state?: string; + state?: string | null; }; } else { params = { paymentMethodId: paramsOrFirst as string, providerMethodId: rest[0] as string, name: rest[1] as string, - state: rest[2] as string, + state: rest[2] as string | null, }; } @@ -5238,6 +5304,9 @@ export class Account { * * Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface. * + * The new password must satisfy the project's enabled password policies, including custom deny lists. Dictionary entries match the entire password case-sensitively; personal-data terms match substrings case-insensitively. Personal-data validation runs after token verification against the recovered user's ID, name, email, and phone, closing the previous recovery gap for profile-based checks. A rejected password leaves the existing credentials unchanged and the recovery token usable. + * + * * @param {string} params.userId - User ID. * @param {string} params.secret - Valid reset token. * @param {string} params.password - New user password. Must be between 8 and 256 chars. @@ -5254,6 +5323,9 @@ export class Account { * * Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface. * + * The new password must satisfy the project's enabled password policies, including custom deny lists. Dictionary entries match the entire password case-sensitively; personal-data terms match substrings case-insensitively. Personal-data validation runs after token verification against the recovered user's ID, name, email, and phone, closing the previous recovery gap for profile-based checks. A rejected password leaves the existing credentials unchanged and the recovery token usable. + * + * * @param {string} userId - User ID. * @param {string} secret - Valid reset token. * @param {string} password - New user password. Must be between 8 and 256 chars. @@ -5440,6 +5512,8 @@ export class Account { /** * Use this endpoint to complete the user password recovery process using the 6-digit code that was emailed by [createRecoveryOTP](https://appwrite.io/docs/references/cloud/client-web/account#createRecoveryOTP). Pass the **userId** of the user along with the **secret** code from the email and the new **password** to set. If confirmed, this route will return a 200 status code, the code is consumed and the user's password is updated. * + * The new password must satisfy the project's enabled password policies, including custom deny lists. Dictionary entries match the entire password case-sensitively; personal-data terms match substrings case-insensitively. Personal-data validation runs after token verification against the recovered user's ID, name, email, and phone, closing the previous recovery gap for profile-based checks. A rejected password leaves the existing credentials unchanged and the recovery token usable. + * * * @param {string} params.userId - User ID. * @param {string} params.secret - Valid recovery OTP code. @@ -5455,6 +5529,8 @@ export class Account { /** * Use this endpoint to complete the user password recovery process using the 6-digit code that was emailed by [createRecoveryOTP](https://appwrite.io/docs/references/cloud/client-web/account#createRecoveryOTP). Pass the **userId** of the user along with the **secret** code from the email and the new **password** to set. If confirmed, this route will return a 200 status code, the code is consumed and the user's password is updated. * + * The new password must satisfy the project's enabled password policies, including custom deny lists. Dictionary entries match the entire password case-sensitively; personal-data terms match substrings case-insensitively. Personal-data validation runs after token verification against the recovered user's ID, name, email, and phone, closing the previous recovery gap for profile-based checks. A rejected password leaves the existing credentials unchanged and the recovery token usable. + * * * @param {string} userId - User ID. * @param {string} secret - Valid recovery OTP code. @@ -5770,14 +5846,14 @@ export class Account { * * @param {string} params.email - User email. * @param {string} params.password - User password. Must be at least 8 chars. - * @param {number} params.duration - Session length in seconds. Minimum is 60 seconds, and it cannot exceed the project maximum session length. Defaults to the project maximum session length. + * @param {number | null} params.duration - Session length in seconds. Minimum is 60 seconds, and it cannot exceed the project maximum session length. Defaults to the project maximum session length. * @throws {AppwriteException} * @returns {Promise<Models.Session>} */ createEmailPasswordSession(params: { email: string; password: string; - duration?: number; + duration?: number | null; }): Promise<Models.Session>; /** * Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user. Use the optional `duration` parameter to create a shorter session, for example when the user doesn't choose "remember me". It must be at least 60 seconds and cannot exceed the project maximum session length. @@ -5786,7 +5862,7 @@ export class Account { * * @param {string} email - User email. * @param {string} password - User password. Must be at least 8 chars. - * @param {number} duration - Session length in seconds. Minimum is 60 seconds, and it cannot exceed the project maximum session length. Defaults to the project maximum session length. + * @param {number | null} duration - Session length in seconds. Minimum is 60 seconds, and it cannot exceed the project maximum session length. Defaults to the project maximum session length. * @throws {AppwriteException} * @returns {Promise<Models.Session>} * @deprecated Use the object parameter style method for a better developer experience. @@ -5794,14 +5870,19 @@ export class Account { createEmailPasswordSession( email: string, password: string, - duration?: number, + duration?: number | null, ): Promise<Models.Session>; createEmailPasswordSession( paramsOrFirst: - { email: string; password: string; duration?: number } | string, - ...rest: [string?, number?] + | { email: string; password: string; duration?: number | null } + | string, + ...rest: [string?, (number | null)?] ): Promise<Models.Session> { - let params: { email: string; password: string; duration?: number }; + let params: { + email: string; + password: string; + duration?: number | null; + }; if ( paramsOrFirst && @@ -5811,13 +5892,13 @@ export class Account { params = (paramsOrFirst || {}) as { email: string; password: string; - duration?: number; + duration?: number | null; }; } else { params = { email: paramsOrFirst as string, password: rest[0] as string, - duration: rest[1] as number, + duration: rest[1] as number | null, }; } @@ -6896,6 +6977,8 @@ export class Account { * @param {string} params.targetId - Target 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.identifier - The target identifier (token, email, phone etc.) * @param {string} params.providerId - Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used. + * @param {string} params.bundleId - App bundle ID of the device registering an APNs token. Without `providerId`, routes the target to the enabled APNs provider for this bundle ID and `environment`. + * @param {string} params.environment - APNs environment the token belongs to, `sandbox` or `production`. Used with `bundleId`. * @throws {AppwriteException} * @returns {Promise<Models.Target>} */ @@ -6903,6 +6986,8 @@ export class Account { targetId: string; identifier: string; providerId?: string; + bundleId?: string; + environment?: string; }): Promise<Models.Target>; /** * Use this endpoint to register a device for push notifications. Provide a target ID (custom or generated using ID.unique()), a device identifier (usually a device token), and optionally specify which provider should send notifications to this target. The target is automatically linked to the current session and includes device information like brand and model. A session holds one push target per provider, so if one already exists this endpoint updates and returns that target instead of creating a second one, and a device that rotates its token is never notified twice. @@ -6910,6 +6995,8 @@ export class Account { * @param {string} targetId - Target 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} identifier - The target identifier (token, email, phone etc.) * @param {string} providerId - Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used. + * @param {string} bundleId - App bundle ID of the device registering an APNs token. Without `providerId`, routes the target to the enabled APNs provider for this bundle ID and `environment`. + * @param {string} environment - APNs environment the token belongs to, `sandbox` or `production`. Used with `bundleId`. * @throws {AppwriteException} * @returns {Promise<Models.Target>} * @deprecated Use the object parameter style method for a better developer experience. @@ -6918,17 +7005,27 @@ export class Account { targetId: string, identifier: string, providerId?: string, + bundleId?: string, + environment?: string, ): Promise<Models.Target>; createPushTarget( paramsOrFirst: - | { targetId: string; identifier: string; providerId?: string } + | { + targetId: string; + identifier: string; + providerId?: string; + bundleId?: string; + environment?: string; + } | string, - ...rest: [string?, string?] + ...rest: [string?, string?, string?, string?] ): Promise<Models.Target> { let params: { targetId: string; identifier: string; providerId?: string; + bundleId?: string; + environment?: string; }; if ( @@ -6940,18 +7037,24 @@ export class Account { targetId: string; identifier: string; providerId?: string; + bundleId?: string; + environment?: string; }; } else { params = { targetId: paramsOrFirst as string, identifier: rest[0] as string, providerId: rest[1] as string, + bundleId: rest[2] as string, + environment: rest[3] as string, }; } const targetId = params.targetId; const identifier = params.identifier; const providerId = params.providerId; + const bundleId = params.bundleId; + const environment = params.environment; if (typeof targetId === 'undefined') { throw new AppwriteException( @@ -6974,6 +7077,12 @@ export class Account { if (typeof providerId !== 'undefined') { apiPayload['providerId'] = providerId; } + if (typeof bundleId !== 'undefined') { + apiPayload['bundleId'] = bundleId; + } + if (typeof environment !== 'undefined') { + apiPayload['environment'] = environment; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -7009,18 +7118,24 @@ export class Account { * * @param {string} params.targetId - Target ID. * @param {string} params.identifier - The target identifier (token, email, phone etc.) + * @param {string} params.bundleId - App bundle ID of the device registering an APNs token. Routes an APNs target to the enabled APNs provider for this bundle ID and `environment`. + * @param {string} params.environment - APNs environment the token belongs to, `sandbox` or `production`. Used with `bundleId`. * @throws {AppwriteException} * @returns {Promise<Models.Target>} */ updatePushTarget(params: { targetId: string; identifier: string; + bundleId?: string; + environment?: string; }): Promise<Models.Target>; /** * Update the currently logged in user's push notification target. You can modify the target's identifier (device token) and provider ID (token, email, phone etc.). The target must exist and belong to the current user. If you change the provider ID, notifications will be sent through the new messaging provider instead. * * @param {string} targetId - Target ID. * @param {string} identifier - The target identifier (token, email, phone etc.) + * @param {string} bundleId - App bundle ID of the device registering an APNs token. Routes an APNs target to the enabled APNs provider for this bundle ID and `environment`. + * @param {string} environment - APNs environment the token belongs to, `sandbox` or `production`. Used with `bundleId`. * @throws {AppwriteException} * @returns {Promise<Models.Target>} * @deprecated Use the object parameter style method for a better developer experience. @@ -7028,12 +7143,26 @@ export class Account { updatePushTarget( targetId: string, identifier: string, + bundleId?: string, + environment?: string, ): Promise<Models.Target>; updatePushTarget( - paramsOrFirst: { targetId: string; identifier: string } | string, - ...rest: [string?] + paramsOrFirst: + | { + targetId: string; + identifier: string; + bundleId?: string; + environment?: string; + } + | string, + ...rest: [string?, string?, string?] ): Promise<Models.Target> { - let params: { targetId: string; identifier: string }; + let params: { + targetId: string; + identifier: string; + bundleId?: string; + environment?: string; + }; if ( paramsOrFirst && @@ -7043,16 +7172,22 @@ export class Account { params = (paramsOrFirst || {}) as { targetId: string; identifier: string; + bundleId?: string; + environment?: string; }; } else { params = { targetId: paramsOrFirst as string, identifier: rest[0] as string, + bundleId: rest[1] as string, + environment: rest[2] as string, }; } const targetId = params.targetId; const identifier = params.identifier; + const bundleId = params.bundleId; + const environment = params.environment; if (typeof targetId === 'undefined' || targetId === '') { throw new AppwriteException( @@ -7072,6 +7207,12 @@ export class Account { if (typeof identifier !== 'undefined') { apiPayload['identifier'] = identifier; } + if (typeof bundleId !== 'undefined') { + apiPayload['bundleId'] = bundleId; + } + if (typeof environment !== 'undefined') { + apiPayload['environment'] = environment; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -7560,7 +7701,7 @@ export class Account { $createdAt: '', passkeyId: '', expire: '', - publicKey: [], + publicKey: {}, }, }, }, diff --git a/src/services/activities.ts b/src/services/activities.ts index 9092534d..3ddd88cc 100644 --- a/src/services/activities.ts +++ b/src/services/activities.ts @@ -17,46 +17,61 @@ export class Activities { * List all events for selected filters. * * @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/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on attributes such as userId, teamId, etc. + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise<Models.ActivityEventList>} */ listEvents(params?: { queries?: string[]; + total?: boolean; }): Promise<Models.ActivityEventList>; /** * List all events for selected filters. * * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on attributes such as userId, teamId, etc. + * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise<Models.ActivityEventList>} * @deprecated Use the object parameter style method for a better developer experience. */ - listEvents(queries?: string[]): Promise<Models.ActivityEventList>; listEvents( - paramsOrFirst?: { queries?: string[] } | string[], + queries?: string[], + total?: boolean, + ): Promise<Models.ActivityEventList>; + listEvents( + paramsOrFirst?: { queries?: string[]; total?: boolean } | string[], + ...rest: [boolean?] ): Promise<Models.ActivityEventList> { - let params: { queries?: string[] }; + let params: { queries?: string[]; total?: boolean }; if ( - typeof paramsOrFirst === 'undefined' || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) ) { - params = (paramsOrFirst || {}) as { queries?: string[] }; + params = (paramsOrFirst || {}) as { + queries?: string[]; + total?: boolean; + }; } else { params = { queries: paramsOrFirst as string[], + total: rest[0] as boolean, }; } const queries = params.queries; + const total = params.total; const apiPath = '/activities/events'; const apiPayload: Payload = {}; if (typeof queries !== 'undefined') { apiPayload['queries'] = queries; } + if (typeof total !== 'undefined') { + apiPayload['total'] = total; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { diff --git a/src/services/admin.ts b/src/services/admin.ts index df1d92e3..799e9087 100644 --- a/src/services/admin.ts +++ b/src/services/admin.ts @@ -18,7 +18,7 @@ export class Admin { } /** - * Delete everything cached from the platform database in the region serving the request. + * Delete everything cached from the platform database, in every region. * * @throws {AppwriteException} * @returns {Promise<{}>} @@ -38,7 +38,7 @@ export class Admin { } /** - * Delete the cache of one platform resource, or of every resource of a type, in the region serving the request. + * Delete the cache of one platform resource, or of every resource of a type, in every region. * * @param {PlatformResourceType} params.resourceType - Resource type. * @param {string} params.resourceId - Resource ID. Leave empty to delete the cache of every resource of this type. @@ -50,7 +50,7 @@ export class Admin { resourceId?: string; }): Promise<{}>; /** - * Delete the cache of one platform resource, or of every resource of a type, in the region serving the request. + * Delete the cache of one platform resource, or of every resource of a type, in every region. * * @param {PlatformResourceType} resourceType - Resource type. * @param {string} resourceId - Resource ID. Leave empty to delete the cache of every resource of this type. @@ -115,7 +115,7 @@ export class Admin { } /** - * Delete everything cached for a project. Send the request to the project's region. + * Delete everything cached for a project, in the project's region. * * @param {string} params.projectId - Project ID. * @throws {AppwriteException} @@ -123,7 +123,7 @@ export class Admin { */ deleteProjectCache(params: { projectId: string }): Promise<{}>; /** - * Delete everything cached for a project. Send the request to the project's region. + * Delete everything cached for a project, in the project's region. * * @param {string} projectId - Project ID. * @throws {AppwriteException} @@ -172,7 +172,7 @@ export class Admin { } /** - * Delete the cache of one project resource, or of every resource of a type. Send the request to the project's region. + * Delete the cache of one project resource, or of every resource of a type, in the project's region. * * @param {string} params.projectId - Project ID. * @param {ProjectResourceType} params.resourceType - Resource type. @@ -186,7 +186,7 @@ export class Admin { resourceId?: string; }): Promise<{}>; /** - * Delete the cache of one project resource, or of every resource of a type. Send the request to the project's region. + * Delete the cache of one project resource, or of every resource of a type, in the project's region. * * @param {string} projectId - Project ID. * @param {ProjectResourceType} resourceType - Resource type. @@ -793,4 +793,125 @@ export class Admin { return request.then((response) => applyDefaults(response, defaults)); } + + /** + * Mark a console user as a platform admin, giving them access to the admin API, or unmark them to remove it. + * + * @param {string} params.userId - Console user ID. + * @param {boolean} params.admin - Whether the user is a platform admin. When true, the user can call the admin API. + * @throws {AppwriteException} + * @returns {Promise<Models.User<Preferences>>} + */ + updateUserAdmin< + Preferences extends Models.Preferences = Models.DefaultPreferences, + >(params: { + userId: string; + admin: boolean; + }): Promise<Models.User<Preferences>>; + /** + * Mark a console user as a platform admin, giving them access to the admin API, or unmark them to remove it. + * + * @param {string} userId - Console user ID. + * @param {boolean} admin - Whether the user is a platform admin. When true, the user can call the admin API. + * @throws {AppwriteException} + * @returns {Promise<Models.User<Preferences>>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateUserAdmin< + Preferences extends Models.Preferences = Models.DefaultPreferences, + >(userId: string, admin: boolean): Promise<Models.User<Preferences>>; + updateUserAdmin< + Preferences extends Models.Preferences = Models.DefaultPreferences, + >( + paramsOrFirst: { userId: string; admin: boolean } | string, + ...rest: [boolean?] + ): Promise<Models.User<Preferences>> { + let params: { userId: string; admin: boolean }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + userId: string; + admin: boolean; + }; + } else { + params = { + userId: paramsOrFirst as string, + admin: rest[0] as boolean, + }; + } + + const userId = params.userId; + const admin = params.admin; + + if (typeof userId === 'undefined' || userId === '') { + throw new AppwriteException('Missing required parameter: "userId"'); + } + if (typeof admin === 'undefined') { + throw new AppwriteException('Missing required parameter: "admin"'); + } + const apiPath = '/admin/users/{userId}/admin'.replace( + '{userId}', + encodeURIComponent(String(userId)), + ); + const apiPayload: Payload = {}; + if (typeof admin !== 'undefined') { + apiPayload['admin'] = admin; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }; + + const request = this.client.call('patch', uri, apiHeaders, apiPayload); + const defaults = { + root: 'user', + models: { + user: { + defaults: { + $id: '', + $createdAt: '', + $updatedAt: '', + name: '', + registration: '', + status: true, + labels: [], + passwordUpdate: '', + email: '', + phone: '', + emailVerification: false, + phoneVerification: false, + mfa: false, + targets: [], + accessedAt: '', + }, + properties: { + targets: { + items: 'target', + }, + }, + }, + target: { + defaults: { + $id: '', + $createdAt: '', + $updatedAt: '', + name: '', + userId: '', + providerType: '', + identifier: '', + expired: false, + }, + }, + }, + }; + + return request.then((response) => applyDefaults(response, defaults)); + } } diff --git a/src/services/advisor.ts b/src/services/advisor.ts index efece509..a62329ee 100644 --- a/src/services/advisor.ts +++ b/src/services/advisor.ts @@ -144,7 +144,7 @@ export class Advisor { label: '', service: '', method: '', - params: [], + params: {}, }, }, }, @@ -260,7 +260,7 @@ export class Advisor { label: '', service: '', method: '', - params: [], + params: {}, }, }, }, @@ -452,7 +452,7 @@ export class Advisor { label: '', service: '', method: '', - params: [], + params: {}, }, }, }, @@ -563,7 +563,7 @@ export class Advisor { label: '', service: '', method: '', - params: [], + params: {}, }, }, }, diff --git a/src/services/affiliates.ts b/src/services/affiliates.ts index 10ed7d0c..cd2dc87b 100644 --- a/src/services/affiliates.ts +++ b/src/services/affiliates.ts @@ -18,47 +18,62 @@ export class Affiliates { * * * @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/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, status + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise<Models.AffiliateLinkList>} */ listLinks(params?: { queries?: string[]; + total?: boolean; }): Promise<Models.AffiliateLinkList>; /** * List affiliate links for the current account. * * * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, status + * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise<Models.AffiliateLinkList>} * @deprecated Use the object parameter style method for a better developer experience. */ - listLinks(queries?: string[]): Promise<Models.AffiliateLinkList>; listLinks( - paramsOrFirst?: { queries?: string[] } | string[], + queries?: string[], + total?: boolean, + ): Promise<Models.AffiliateLinkList>; + listLinks( + paramsOrFirst?: { queries?: string[]; total?: boolean } | string[], + ...rest: [boolean?] ): Promise<Models.AffiliateLinkList> { - let params: { queries?: string[] }; + let params: { queries?: string[]; total?: boolean }; if ( - typeof paramsOrFirst === 'undefined' || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) ) { - params = (paramsOrFirst || {}) as { queries?: string[] }; + params = (paramsOrFirst || {}) as { + queries?: string[]; + total?: boolean; + }; } else { params = { queries: paramsOrFirst as string[], + total: rest[0] as boolean, }; } const queries = params.queries; + const total = params.total; const apiPath = '/affiliates/links'; const apiPayload: Payload = {}; if (typeof queries !== 'undefined') { apiPayload['queries'] = queries; } + if (typeof total !== 'undefined') { + apiPayload['total'] = total; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -315,47 +330,62 @@ export class Affiliates { * * * @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/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: linkId, referredUserMaskedId, referredUserCountry, status, attributedAt, expiresAt, convertedAt + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise<Models.AffiliateReferralList>} */ listReferrals(params?: { queries?: string[]; + total?: boolean; }): Promise<Models.AffiliateReferralList>; /** * List referrals attributed to the current account's affiliate links. Responses include privacy-safe metadata only (truncated user ID and signup country), never email or name. Referrals are created automatically on signup when the invite cookie is present. * * * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: linkId, referredUserMaskedId, referredUserCountry, status, attributedAt, expiresAt, convertedAt + * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise<Models.AffiliateReferralList>} * @deprecated Use the object parameter style method for a better developer experience. */ - listReferrals(queries?: string[]): Promise<Models.AffiliateReferralList>; listReferrals( - paramsOrFirst?: { queries?: string[] } | string[], + queries?: string[], + total?: boolean, + ): Promise<Models.AffiliateReferralList>; + listReferrals( + paramsOrFirst?: { queries?: string[]; total?: boolean } | string[], + ...rest: [boolean?] ): Promise<Models.AffiliateReferralList> { - let params: { queries?: string[] }; + let params: { queries?: string[]; total?: boolean }; if ( - typeof paramsOrFirst === 'undefined' || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) ) { - params = (paramsOrFirst || {}) as { queries?: string[] }; + params = (paramsOrFirst || {}) as { + queries?: string[]; + total?: boolean; + }; } else { params = { queries: paramsOrFirst as string[], + total: rest[0] as boolean, }; } const queries = params.queries; + const total = params.total; const apiPath = '/affiliates/referrals'; const apiPayload: Payload = {}; if (typeof queries !== 'undefined') { apiPayload['queries'] = queries; } + if (typeof total !== 'undefined') { + apiPayload['total'] = total; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -402,47 +432,62 @@ export class Affiliates { * * * @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/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: linkId, referralId, amount, status, teamId, creditId + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise<Models.AffiliateRewardList>} */ listRewards(params?: { queries?: string[]; + total?: boolean; }): Promise<Models.AffiliateRewardList>; /** * List rewards earned by the current account from affiliate link conversions. * * * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: linkId, referralId, amount, status, teamId, creditId + * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise<Models.AffiliateRewardList>} * @deprecated Use the object parameter style method for a better developer experience. */ - listRewards(queries?: string[]): Promise<Models.AffiliateRewardList>; listRewards( - paramsOrFirst?: { queries?: string[] } | string[], + queries?: string[], + total?: boolean, + ): Promise<Models.AffiliateRewardList>; + listRewards( + paramsOrFirst?: { queries?: string[]; total?: boolean } | string[], + ...rest: [boolean?] ): Promise<Models.AffiliateRewardList> { - let params: { queries?: string[] }; + let params: { queries?: string[]; total?: boolean }; if ( - typeof paramsOrFirst === 'undefined' || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) ) { - params = (paramsOrFirst || {}) as { queries?: string[] }; + params = (paramsOrFirst || {}) as { + queries?: string[]; + total?: boolean; + }; } else { params = { queries: paramsOrFirst as string[], + total: rest[0] as boolean, }; } const queries = params.queries; + const total = params.total; const apiPath = '/affiliates/rewards'; const apiPayload: Payload = {}; if (typeof queries !== 'undefined') { apiPayload['queries'] = queries; } + if (typeof total !== 'undefined') { + apiPayload['total'] = total; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { diff --git a/src/services/analytics.ts b/src/services/analytics.ts index 5cf7f54a..2991e88e 100644 --- a/src/services/analytics.ts +++ b/src/services/analytics.ts @@ -349,57 +349,62 @@ export class Analytics { * Update an analytics property. Only the attributes you pass are changed; omitted attributes keep their current value. * * @param {string} params.propertyId - Analytics property unique ID. - * @param {string} params.name - Human-readable name for this property. - * @param {string} params.domain - Primary domain to track (e.g. example.com). Pass an empty string to clear it. - * @param {boolean} params.enabled - Whether the property accepts events. Events sent to a disabled property are rejected as not found. - * @param {string[]} params.allowedOrigins - Allowed origins for tracking. Use ["*"] to allow all. + * @param {string | null} params.name - Human-readable name for this property. + * @param {string | null} params.domain - Primary domain to track (e.g. example.com). Pass an empty string to clear it. + * @param {boolean | null} params.enabled - Whether the property accepts events. Events sent to a disabled property are rejected as not found. + * @param {string[] | null} params.allowedOrigins - Allowed origins for tracking. Use ["*"] to allow all. * @throws {AppwriteException} * @returns {Promise<Models.AnalyticsProperty>} */ updateProperty(params: { propertyId: string; - name?: string; - domain?: string; - enabled?: boolean; - allowedOrigins?: string[]; + name?: string | null; + domain?: string | null; + enabled?: boolean | null; + allowedOrigins?: string[] | null; }): Promise<Models.AnalyticsProperty>; /** * Update an analytics property. Only the attributes you pass are changed; omitted attributes keep their current value. * * @param {string} propertyId - Analytics property unique ID. - * @param {string} name - Human-readable name for this property. - * @param {string} domain - Primary domain to track (e.g. example.com). Pass an empty string to clear it. - * @param {boolean} enabled - Whether the property accepts events. Events sent to a disabled property are rejected as not found. - * @param {string[]} allowedOrigins - Allowed origins for tracking. Use ["*"] to allow all. + * @param {string | null} name - Human-readable name for this property. + * @param {string | null} domain - Primary domain to track (e.g. example.com). Pass an empty string to clear it. + * @param {boolean | null} enabled - Whether the property accepts events. Events sent to a disabled property are rejected as not found. + * @param {string[] | null} allowedOrigins - Allowed origins for tracking. Use ["*"] to allow all. * @throws {AppwriteException} * @returns {Promise<Models.AnalyticsProperty>} * @deprecated Use the object parameter style method for a better developer experience. */ updateProperty( propertyId: string, - name?: string, - domain?: string, - enabled?: boolean, - allowedOrigins?: string[], + name?: string | null, + domain?: string | null, + enabled?: boolean | null, + allowedOrigins?: string[] | null, ): Promise<Models.AnalyticsProperty>; updateProperty( paramsOrFirst: | { propertyId: string; - name?: string; - domain?: string; - enabled?: boolean; - allowedOrigins?: string[]; + name?: string | null; + domain?: string | null; + enabled?: boolean | null; + allowedOrigins?: string[] | null; } | string, - ...rest: [string?, string?, boolean?, string[]?] + ...rest: [ + (string | null)?, + (string | null)?, + (boolean | null)?, + (string[] | null)?, + ] ): Promise<Models.AnalyticsProperty> { let params: { propertyId: string; - name?: string; - domain?: string; - enabled?: boolean; - allowedOrigins?: string[]; + name?: string | null; + domain?: string | null; + enabled?: boolean | null; + allowedOrigins?: string[] | null; }; if ( @@ -409,18 +414,18 @@ export class Analytics { ) { params = (paramsOrFirst || {}) as { propertyId: string; - name?: string; - domain?: string; - enabled?: boolean; - allowedOrigins?: string[]; + name?: string | null; + domain?: string | null; + enabled?: boolean | null; + allowedOrigins?: string[] | null; }; } else { params = { propertyId: paramsOrFirst as string, - name: rest[0] as string, - domain: rest[1] as string, - enabled: rest[2] as boolean, - allowedOrigins: rest[3] as string[], + name: rest[0] as string | null, + domain: rest[1] as string | null, + enabled: rest[2] as boolean | null, + allowedOrigins: rest[3] as string[] | null, }; } @@ -791,6 +796,7 @@ export class Analytics { * @param {string} params.startAt - Explicit window start in ISO 8601. Defaults to endAt minus dateRange. * @param {string} params.endAt - Explicit window end in ISO 8601. Defaults to the current time. * @param {number} params.limit - Maximum number of ranked values to return. + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise<Models.AnalyticsMetricList>} */ @@ -803,6 +809,7 @@ export class Analytics { startAt?: string; endAt?: string; limit?: number; + total?: boolean; }): Promise<Models.AnalyticsMetricList>; /** * Read analytics metrics (visitors, sessions, pageviews, events, bounceRate, …) for a property over a date range. @@ -822,6 +829,7 @@ export class Analytics { * @param {string} startAt - Explicit window start in ISO 8601. Defaults to endAt minus dateRange. * @param {string} endAt - Explicit window end in ISO 8601. Defaults to the current time. * @param {number} limit - Maximum number of ranked values to return. + * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise<Models.AnalyticsMetricList>} * @deprecated Use the object parameter style method for a better developer experience. @@ -835,6 +843,7 @@ export class Analytics { startAt?: string, endAt?: string, limit?: number, + total?: boolean, ): Promise<Models.AnalyticsMetricList>; listMetrics( paramsOrFirst: @@ -847,6 +856,7 @@ export class Analytics { startAt?: string; endAt?: string; limit?: number; + total?: boolean; } | string, ...rest: [ @@ -857,6 +867,7 @@ export class Analytics { string?, string?, number?, + boolean?, ] ): Promise<Models.AnalyticsMetricList> { let params: { @@ -868,6 +879,7 @@ export class Analytics { startAt?: string; endAt?: string; limit?: number; + total?: boolean; }; if ( @@ -884,6 +896,7 @@ export class Analytics { startAt?: string; endAt?: string; limit?: number; + total?: boolean; }; } else { params = { @@ -895,6 +908,7 @@ export class Analytics { startAt: rest[4] as string, endAt: rest[5] as string, limit: rest[6] as number, + total: rest[7] as boolean, }; } @@ -906,6 +920,7 @@ export class Analytics { const startAt = params.startAt; const endAt = params.endAt; const limit = params.limit; + const total = params.total; if (typeof propertyId === 'undefined' || propertyId === '') { throw new AppwriteException( @@ -938,6 +953,9 @@ export class Analytics { if (typeof limit !== 'undefined') { apiPayload['limit'] = limit; } + if (typeof total !== 'undefined') { + apiPayload['total'] = total; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { diff --git a/src/services/backups.ts b/src/services/backups.ts index 89949631..4c4f5942 100644 --- a/src/services/backups.ts +++ b/src/services/backups.ts @@ -18,46 +18,61 @@ export class Backups { * 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. + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise<Models.BackupArchiveList>} */ listArchives(params?: { queries?: string[]; + total?: boolean; }): Promise<Models.BackupArchiveList>; /** * 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. + * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise<Models.BackupArchiveList>} * @deprecated Use the object parameter style method for a better developer experience. */ - listArchives(queries?: string[]): Promise<Models.BackupArchiveList>; listArchives( - paramsOrFirst?: { queries?: string[] } | string[], + queries?: string[], + total?: boolean, + ): Promise<Models.BackupArchiveList>; + listArchives( + paramsOrFirst?: { queries?: string[]; total?: boolean } | string[], + ...rest: [boolean?] ): Promise<Models.BackupArchiveList> { - let params: { queries?: string[] }; + let params: { queries?: string[]; total?: boolean }; if ( - typeof paramsOrFirst === 'undefined' || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) ) { - params = (paramsOrFirst || {}) as { queries?: string[] }; + params = (paramsOrFirst || {}) as { + queries?: string[]; + total?: boolean; + }; } else { params = { queries: paramsOrFirst as string[], + total: rest[0] as boolean, }; } const queries = params.queries; + const total = params.total; const apiPath = '/backups/archives'; const apiPayload: Payload = {}; if (typeof queries !== 'undefined') { apiPayload['queries'] = queries; } + if (typeof total !== 'undefined') { + apiPayload['total'] = total; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -102,34 +117,34 @@ export class Backups { * Create a new archive asynchronously for a project. * * @param {BackupServices[]} params.services - Array of services to backup - * @param {string} params.resourceId - Resource ID. When set, only this single resource will be backed up. + * @param {string | null} params.resourceId - Resource ID. When set, only this single resource will be backed up. * @throws {AppwriteException} * @returns {Promise<Models.BackupArchive>} */ createArchive(params: { services: BackupServices[]; - resourceId?: string; + resourceId?: string | null; }): Promise<Models.BackupArchive>; /** * Create a new archive asynchronously for a project. * * @param {BackupServices[]} services - Array of services to backup - * @param {string} resourceId - Resource ID. When set, only this single resource will be backed up. + * @param {string | null} resourceId - Resource ID. When set, only this single resource will be backed up. * @throws {AppwriteException} * @returns {Promise<Models.BackupArchive>} * @deprecated Use the object parameter style method for a better developer experience. */ createArchive( services: BackupServices[], - resourceId?: string, + resourceId?: string | null, ): Promise<Models.BackupArchive>; createArchive( paramsOrFirst: - | { services: BackupServices[]; resourceId?: string } + | { services: BackupServices[]; resourceId?: string | null } | BackupServices[], - ...rest: [string?] + ...rest: [(string | null)?] ): Promise<Models.BackupArchive> { - let params: { services: BackupServices[]; resourceId?: string }; + let params: { services: BackupServices[]; resourceId?: string | null }; if ( paramsOrFirst && @@ -139,12 +154,12 @@ export class Backups { ) { params = (paramsOrFirst || {}) as { services: BackupServices[]; - resourceId?: string; + resourceId?: string | null; }; } else { params = { services: paramsOrFirst as BackupServices[], - resourceId: rest[0] as string, + resourceId: rest[0] as string | null, }; } @@ -328,46 +343,61 @@ export class Backups { * 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. + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise<Models.BackupPolicyList>} */ listPolicies(params?: { queries?: string[]; + total?: boolean; }): Promise<Models.BackupPolicyList>; /** * 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. + * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise<Models.BackupPolicyList>} * @deprecated Use the object parameter style method for a better developer experience. */ - listPolicies(queries?: string[]): Promise<Models.BackupPolicyList>; listPolicies( - paramsOrFirst?: { queries?: string[] } | string[], + queries?: string[], + total?: boolean, + ): Promise<Models.BackupPolicyList>; + listPolicies( + paramsOrFirst?: { queries?: string[]; total?: boolean } | string[], + ...rest: [boolean?] ): Promise<Models.BackupPolicyList> { - let params: { queries?: string[] }; + let params: { queries?: string[]; total?: boolean }; if ( - typeof paramsOrFirst === 'undefined' || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) ) { - params = (paramsOrFirst || {}) as { queries?: string[] }; + params = (paramsOrFirst || {}) as { + queries?: string[]; + total?: boolean; + }; } else { params = { queries: paramsOrFirst as string[], + total: rest[0] as boolean, }; } const queries = params.queries; + const total = params.total; const apiPath = '/backups/policies'; const apiPayload: Payload = {}; if (typeof queries !== 'undefined') { apiPayload['queries'] = queries; } + if (typeof total !== 'undefined') { + apiPayload['total'] = total; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -418,7 +448,7 @@ export class Backups { * @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. + * @param {string | null} 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<Models.BackupPolicy>} @@ -429,7 +459,7 @@ export class Backups { retention: number; schedule: string; name?: string; - resourceId?: string; + resourceId?: string | null; enabled?: boolean; }): Promise<Models.BackupPolicy>; /** @@ -440,7 +470,7 @@ export class Backups { * @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. + * @param {string | null} 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<Models.BackupPolicy>} @@ -452,7 +482,7 @@ export class Backups { retention: number, schedule: string, name?: string, - resourceId?: string, + resourceId?: string | null, enabled?: boolean, ): Promise<Models.BackupPolicy>; createPolicy( @@ -463,7 +493,7 @@ export class Backups { retention: number; schedule: string; name?: string; - resourceId?: string; + resourceId?: string | null; enabled?: boolean; } | string, @@ -472,7 +502,7 @@ export class Backups { number?, string?, string?, - string?, + (string | null)?, boolean?, ] ): Promise<Models.BackupPolicy> { @@ -482,7 +512,7 @@ export class Backups { retention: number; schedule: string; name?: string; - resourceId?: string; + resourceId?: string | null; enabled?: boolean; }; @@ -497,7 +527,7 @@ export class Backups { retention: number; schedule: string; name?: string; - resourceId?: string; + resourceId?: string | null; enabled?: boolean; }; } else { @@ -507,7 +537,7 @@ export class Backups { retention: rest[1] as number, schedule: rest[2] as string, name: rest[3] as string, - resourceId: rest[4] as string, + resourceId: rest[4] as string | null, enabled: rest[5] as boolean, }; } @@ -676,57 +706,62 @@ export class Backups { * 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} params.retention - Days to keep backups before deletion + * @param {string | null} params.name - Policy name. Max length: 128 chars. + * @param {number | null} 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 + * @param {boolean | null} params.enabled - Is Backup enabled? When set to 'disabled', No backup will be taken * @throws {AppwriteException} * @returns {Promise<Models.BackupPolicy>} */ updatePolicy(params: { policyId: string; - name?: string; - retention?: number; + name?: string | null; + retention?: number | null; schedule?: string; - enabled?: boolean; + enabled?: boolean | null; }): Promise<Models.BackupPolicy>; /** * 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} retention - Days to keep backups before deletion + * @param {string | null} name - Policy name. Max length: 128 chars. + * @param {number | null} 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 + * @param {boolean | null} enabled - Is Backup enabled? When set to 'disabled', No backup will be taken * @throws {AppwriteException} * @returns {Promise<Models.BackupPolicy>} * @deprecated Use the object parameter style method for a better developer experience. */ updatePolicy( policyId: string, - name?: string, - retention?: number, + name?: string | null, + retention?: number | null, schedule?: string, - enabled?: boolean, + enabled?: boolean | null, ): Promise<Models.BackupPolicy>; updatePolicy( paramsOrFirst: | { policyId: string; - name?: string; - retention?: number; + name?: string | null; + retention?: number | null; schedule?: string; - enabled?: boolean; + enabled?: boolean | null; } | string, - ...rest: [string?, number?, string?, boolean?] + ...rest: [ + (string | null)?, + (number | null)?, + string?, + (boolean | null)?, + ] ): Promise<Models.BackupPolicy> { let params: { policyId: string; - name?: string; - retention?: number; + name?: string | null; + retention?: number | null; schedule?: string; - enabled?: boolean; + enabled?: boolean | null; }; if ( @@ -736,18 +771,18 @@ export class Backups { ) { params = (paramsOrFirst || {}) as { policyId: string; - name?: string; - retention?: number; + name?: string | null; + retention?: number | null; schedule?: string; - enabled?: boolean; + enabled?: boolean | null; }; } else { params = { policyId: paramsOrFirst as string, - name: rest[0] as string, - retention: rest[1] as number, + name: rest[0] as string | null, + retention: rest[1] as number | null, schedule: rest[2] as string, - enabled: rest[3] as boolean, + enabled: rest[3] as boolean | null, }; } @@ -1007,7 +1042,7 @@ export class Backups { migrationId: '', services: [], resources: [], - options: [], + options: {}, }, }, }, @@ -1020,46 +1055,61 @@ export class Backups { * 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. + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise<Models.BackupRestorationList>} */ listRestorations(params?: { queries?: string[]; + total?: boolean; }): Promise<Models.BackupRestorationList>; /** * 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. + * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise<Models.BackupRestorationList>} * @deprecated Use the object parameter style method for a better developer experience. */ - listRestorations(queries?: string[]): Promise<Models.BackupRestorationList>; listRestorations( - paramsOrFirst?: { queries?: string[] } | string[], + queries?: string[], + total?: boolean, + ): Promise<Models.BackupRestorationList>; + listRestorations( + paramsOrFirst?: { queries?: string[]; total?: boolean } | string[], + ...rest: [boolean?] ): Promise<Models.BackupRestorationList> { - let params: { queries?: string[] }; + let params: { queries?: string[]; total?: boolean }; if ( - typeof paramsOrFirst === 'undefined' || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) ) { - params = (paramsOrFirst || {}) as { queries?: string[] }; + params = (paramsOrFirst || {}) as { + queries?: string[]; + total?: boolean; + }; } else { params = { queries: paramsOrFirst as string[], + total: rest[0] as boolean, }; } const queries = params.queries; + const total = params.total; const apiPath = '/backups/restorations'; const apiPayload: Payload = {}; if (typeof queries !== 'undefined') { apiPayload['queries'] = queries; } + if (typeof total !== 'undefined') { + apiPayload['total'] = total; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -1093,7 +1143,7 @@ export class Backups { migrationId: '', services: [], resources: [], - options: [], + options: {}, }, }, }, @@ -1172,7 +1222,7 @@ export class Backups { migrationId: '', services: [], resources: [], - options: [], + options: {}, }, }, }, diff --git a/src/services/console.ts b/src/services/console.ts index 021e6458..bc5e9ce1 100644 --- a/src/services/console.ts +++ b/src/services/console.ts @@ -274,6 +274,7 @@ export class Console { defaults: { $id: '', name: '', + description: '', $createdAt: '', $updatedAt: '', enabled: true, @@ -539,6 +540,7 @@ export class Console { deploymentSize: 0, buildSize: 0, functionsIntervalMinimum: 0, + functionsAllowCron: true, databasesAllowEncrypt: false, databaseComputeCredit: 0, }, @@ -665,6 +667,7 @@ export class Console { deploymentSize: 0, buildSize: 0, functionsIntervalMinimum: 0, + functionsAllowCron: true, databasesAllowEncrypt: false, databaseComputeCredit: 0, }, @@ -1166,58 +1169,64 @@ export class Console { /** * Create a new source. * - * @param {string} params.ref - Ref param - * @param {string} params.referrer - Referrer - * @param {string} params.utmSource - Utm source - * @param {string} params.utmCampaign - Utm campaign - * @param {string} params.utmMedium - Utm medium + * @param {string | null} params.ref - Ref param + * @param {string | null} params.referrer - Referrer + * @param {string | null} params.utmSource - Utm source + * @param {string | null} params.utmCampaign - Utm campaign + * @param {string | null} params.utmMedium - Utm medium * @throws {AppwriteException} * @returns {Promise<{}>} */ createSource(params?: { - ref?: string; - referrer?: string; - utmSource?: string; - utmCampaign?: string; - utmMedium?: string; + ref?: string | null; + referrer?: string | null; + utmSource?: string | null; + utmCampaign?: string | null; + utmMedium?: string | null; }): Promise<{}>; /** * Create a new source. * - * @param {string} ref - Ref param - * @param {string} referrer - Referrer - * @param {string} utmSource - Utm source - * @param {string} utmCampaign - Utm campaign - * @param {string} utmMedium - Utm medium + * @param {string | null} ref - Ref param + * @param {string | null} referrer - Referrer + * @param {string | null} utmSource - Utm source + * @param {string | null} utmCampaign - Utm campaign + * @param {string | null} utmMedium - Utm medium * @throws {AppwriteException} * @returns {Promise<{}>} * @deprecated Use the object parameter style method for a better developer experience. */ createSource( - ref?: string, - referrer?: string, - utmSource?: string, - utmCampaign?: string, - utmMedium?: string, + ref?: string | null, + referrer?: string | null, + utmSource?: string | null, + utmCampaign?: string | null, + utmMedium?: string | null, ): Promise<{}>; createSource( paramsOrFirst?: | { - ref?: string; - referrer?: string; - utmSource?: string; - utmCampaign?: string; - utmMedium?: string; + ref?: string | null; + referrer?: string | null; + utmSource?: string | null; + utmCampaign?: string | null; + utmMedium?: string | null; } - | string, - ...rest: [string?, string?, string?, string?] + | string + | null, + ...rest: [ + (string | null)?, + (string | null)?, + (string | null)?, + (string | null)?, + ] ): Promise<{}> { let params: { - ref?: string; - referrer?: string; - utmSource?: string; - utmCampaign?: string; - utmMedium?: string; + ref?: string | null; + referrer?: string | null; + utmSource?: string | null; + utmCampaign?: string | null; + utmMedium?: string | null; }; if ( @@ -1227,19 +1236,19 @@ export class Console { !Array.isArray(paramsOrFirst)) ) { params = (paramsOrFirst || {}) as { - ref?: string; - referrer?: string; - utmSource?: string; - utmCampaign?: string; - utmMedium?: string; + ref?: string | null; + referrer?: string | null; + utmSource?: string | null; + utmCampaign?: string | null; + utmMedium?: string | null; }; } else { params = { - ref: paramsOrFirst as string, - referrer: rest[0] as string, - utmSource: rest[1] as string, - utmCampaign: rest[2] as string, - utmMedium: rest[3] as string, + ref: paramsOrFirst as string | null, + referrer: rest[0] as string | null, + utmSource: rest[1] as string | null, + utmCampaign: rest[2] as string | null, + utmMedium: rest[3] as string | null, }; } @@ -1540,6 +1549,7 @@ export class Console { $createdAt: '', $updatedAt: '', key: '', + description: '', type: '', status: '', error: '', @@ -1805,9 +1815,12 @@ export class Console { _APP_OPTIONS_FORCE_HTTPS: '', _APP_DOMAINS_NAMESERVERS: '', _APP_DB_ADAPTER: 'mariadb', + supportForAttributes: true, supportForRelationships: true, supportForOperators: true, supportForSpatials: true, + supportForAggregations: true, + supportForJoins: true, supportForSpatialIndexNull: false, supportForFulltextWildcard: true, supportForMultipleFulltextIndexes: true, @@ -1817,6 +1830,7 @@ export class Console { maxIndexLength: 768, supportForIntegerIds: true, _APP_CONSOLE_EMAIL_VERIFICATION: '', + _APP_DOMAIN_EMAIL: '', }, }, }, diff --git a/src/services/databases.ts b/src/services/databases.ts index 76c33984..02f78ef5 100644 --- a/src/services/databases.ts +++ b/src/services/databases.ts @@ -114,6 +114,7 @@ export class Databases { defaults: { $id: '', name: '', + description: '', $createdAt: '', $updatedAt: '', enabled: true, @@ -167,6 +168,7 @@ export class Databases { * @param {string} params.databaseId - 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.name - Database name. Max length: 128 chars. * @param {boolean} params.enabled - Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. + * @param {string} params.description - Optional description for the database. * @throws {AppwriteException} * @returns {Promise<Models.Database>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.create` instead. @@ -175,6 +177,7 @@ export class Databases { databaseId: string; name: string; enabled?: boolean; + description?: string; }): Promise<Models.Database>; /** * Create a new Database. @@ -183,6 +186,7 @@ export class Databases { * @param {string} databaseId - 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} name - Database name. Max length: 128 chars. * @param {boolean} enabled - Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. + * @param {string} description - Optional description for the database. * @throws {AppwriteException} * @returns {Promise<Models.Database>} * @deprecated Use the object parameter style method for a better developer experience. @@ -191,13 +195,25 @@ export class Databases { databaseId: string, name: string, enabled?: boolean, + description?: string, ): Promise<Models.Database>; create( paramsOrFirst: - { databaseId: string; name: string; enabled?: boolean } | string, - ...rest: [string?, boolean?] + | { + databaseId: string; + name: string; + enabled?: boolean; + description?: string; + } + | string, + ...rest: [string?, boolean?, string?] ): Promise<Models.Database> { - let params: { databaseId: string; name: string; enabled?: boolean }; + let params: { + databaseId: string; + name: string; + enabled?: boolean; + description?: string; + }; if ( paramsOrFirst && @@ -208,18 +224,21 @@ export class Databases { databaseId: string; name: string; enabled?: boolean; + description?: string; }; } else { params = { databaseId: paramsOrFirst as string, name: rest[0] as string, enabled: rest[1] as boolean, + description: rest[2] as string, }; } const databaseId = params.databaseId; const name = params.name; const enabled = params.enabled; + const description = params.description; if (typeof databaseId === 'undefined') { throw new AppwriteException( @@ -240,6 +259,9 @@ export class Databases { if (typeof enabled !== 'undefined') { apiPayload['enabled'] = enabled; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -256,6 +278,7 @@ export class Databases { defaults: { $id: '', name: '', + description: '', $createdAt: '', $updatedAt: '', enabled: true, @@ -869,6 +892,7 @@ export class Databases { defaults: { $id: '', name: '', + description: '', $createdAt: '', $updatedAt: '', enabled: true, @@ -921,6 +945,7 @@ export class Databases { * @param {string} params.databaseId - Database ID. * @param {string} params.name - Database name. Max length: 128 chars. * @param {boolean} params.enabled - Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. + * @param {string | null} params.description - Optional description for the database. * @throws {AppwriteException} * @returns {Promise<Models.Database>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.update` instead. @@ -929,6 +954,7 @@ export class Databases { databaseId: string; name?: string; enabled?: boolean; + description?: string | null; }): Promise<Models.Database>; /** * Update a database by its unique ID. @@ -936,6 +962,7 @@ export class Databases { * @param {string} databaseId - Database ID. * @param {string} name - Database name. Max length: 128 chars. * @param {boolean} enabled - Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. + * @param {string | null} description - Optional description for the database. * @throws {AppwriteException} * @returns {Promise<Models.Database>} * @deprecated Use the object parameter style method for a better developer experience. @@ -944,13 +971,25 @@ export class Databases { databaseId: string, name?: string, enabled?: boolean, + description?: string | null, ): Promise<Models.Database>; update( paramsOrFirst: - { databaseId: string; name?: string; enabled?: boolean } | string, - ...rest: [string?, boolean?] + | { + databaseId: string; + name?: string; + enabled?: boolean; + description?: string | null; + } + | string, + ...rest: [string?, boolean?, (string | null)?] ): Promise<Models.Database> { - let params: { databaseId: string; name?: string; enabled?: boolean }; + let params: { + databaseId: string; + name?: string; + enabled?: boolean; + description?: string | null; + }; if ( paramsOrFirst && @@ -961,18 +1000,21 @@ export class Databases { databaseId: string; name?: string; enabled?: boolean; + description?: string | null; }; } else { params = { databaseId: paramsOrFirst as string, name: rest[0] as string, enabled: rest[1] as boolean, + description: rest[2] as string | null, }; } const databaseId = params.databaseId; const name = params.name; const enabled = params.enabled; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -990,6 +1032,9 @@ export class Databases { if (typeof enabled !== 'undefined') { apiPayload['enabled'] = enabled; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -1006,6 +1051,7 @@ export class Databases { defaults: { $id: '', name: '', + description: '', $createdAt: '', $updatedAt: '', enabled: true, @@ -1234,6 +1280,7 @@ export class Databases { $permissions: [], databaseId: '', name: '', + description: '', enabled: true, documentSecurity: false, attributes: [], @@ -1253,6 +1300,7 @@ export class Databases { $createdAt: '', $updatedAt: '', key: '', + description: '', type: '', error: '', attributes: [], @@ -1271,11 +1319,12 @@ export class Databases { * @param {string} params.databaseId - Database ID. * @param {string} params.collectionId - 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.name - Collection name. Max length: 128 chars. - * @param {string[]} params.permissions - An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {string[] | null} params.permissions - An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} params.documentSecurity - Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} params.enabled - Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled. * @param {object[]} params.attributes - Array of attribute definitions to create. Each attribute should contain: key (string), type (string: string, varchar, text, mediumtext, longtext, integer, bigint, double, boolean, datetime, point, linestring, polygon, email, url, ip, enum), size (integer, required for string and varchar types), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options. * @param {object[]} params.indexes - Array of index definitions to create. Each index should contain: key (string), type (string: key, fulltext, unique, spatial, trigram), attributes (array of attribute keys), orders (array of ASC/DESC, optional), and lengths (array of integers, optional). + * @param {string} params.description - Optional description for the collection. * @throws {AppwriteException} * @returns {Promise<Models.Collection>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createTable` instead. @@ -1284,11 +1333,12 @@ export class Databases { databaseId: string; collectionId: string; name: string; - permissions?: string[]; + permissions?: string[] | null; documentSecurity?: boolean; enabled?: boolean; attributes?: object[]; indexes?: object[]; + description?: string; }): Promise<Models.Collection>; /** * Create a new Collection. Before using this route, you should create a new database resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. @@ -1296,11 +1346,12 @@ export class Databases { * @param {string} databaseId - Database ID. * @param {string} collectionId - 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} name - Collection name. Max length: 128 chars. - * @param {string[]} permissions - An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {string[] | null} permissions - An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} documentSecurity - Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} enabled - Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled. * @param {object[]} attributes - Array of attribute definitions to create. Each attribute should contain: key (string), type (string: string, varchar, text, mediumtext, longtext, integer, bigint, double, boolean, datetime, point, linestring, polygon, email, url, ip, enum), size (integer, required for string and varchar types), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options. * @param {object[]} indexes - Array of index definitions to create. Each index should contain: key (string), type (string: key, fulltext, unique, spatial, trigram), attributes (array of attribute keys), orders (array of ASC/DESC, optional), and lengths (array of integers, optional). + * @param {string} description - Optional description for the collection. * @throws {AppwriteException} * @returns {Promise<Models.Collection>} * @deprecated Use the object parameter style method for a better developer experience. @@ -1309,11 +1360,12 @@ export class Databases { databaseId: string, collectionId: string, name: string, - permissions?: string[], + permissions?: string[] | null, documentSecurity?: boolean, enabled?: boolean, attributes?: object[], indexes?: object[], + description?: string, ): Promise<Models.Collection>; createCollection( paramsOrFirst: @@ -1321,32 +1373,35 @@ export class Databases { databaseId: string; collectionId: string; name: string; - permissions?: string[]; + permissions?: string[] | null; documentSecurity?: boolean; enabled?: boolean; attributes?: object[]; indexes?: object[]; + description?: string; } | string, ...rest: [ string?, string?, - string[]?, + (string[] | null)?, boolean?, boolean?, object[]?, object[]?, + string?, ] ): Promise<Models.Collection> { let params: { databaseId: string; collectionId: string; name: string; - permissions?: string[]; + permissions?: string[] | null; documentSecurity?: boolean; enabled?: boolean; attributes?: object[]; indexes?: object[]; + description?: string; }; if ( @@ -1358,22 +1413,24 @@ export class Databases { databaseId: string; collectionId: string; name: string; - permissions?: string[]; + permissions?: string[] | null; documentSecurity?: boolean; enabled?: boolean; attributes?: object[]; indexes?: object[]; + description?: string; }; } else { params = { databaseId: paramsOrFirst as string, collectionId: rest[0] as string, name: rest[1] as string, - permissions: rest[2] as string[], + permissions: rest[2] as string[] | null, documentSecurity: rest[3] as boolean, enabled: rest[4] as boolean, attributes: rest[5] as object[], indexes: rest[6] as object[], + description: rest[7] as string, }; } @@ -1385,6 +1442,7 @@ export class Databases { const enabled = params.enabled; const attributes = params.attributes; const indexes = params.indexes; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -1425,6 +1483,9 @@ export class Databases { if (typeof indexes !== 'undefined') { apiPayload['indexes'] = indexes; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -1445,6 +1506,7 @@ export class Databases { $permissions: [], databaseId: '', name: '', + description: '', enabled: true, documentSecurity: false, attributes: [], @@ -1464,6 +1526,7 @@ export class Databases { $createdAt: '', $updatedAt: '', key: '', + description: '', type: '', error: '', attributes: [], @@ -1563,6 +1626,7 @@ export class Databases { $permissions: [], databaseId: '', name: '', + description: '', enabled: true, documentSecurity: false, attributes: [], @@ -1582,6 +1646,7 @@ export class Databases { $createdAt: '', $updatedAt: '', key: '', + description: '', type: '', error: '', attributes: [], @@ -1600,10 +1665,11 @@ export class Databases { * @param {string} params.databaseId - Database ID. * @param {string} params.collectionId - Collection ID. * @param {string} params.name - Collection name. Max length: 128 chars. - * @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 {string[] | null} 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.documentSecurity - Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} params.enabled - Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled. * @param {boolean} params.purge - When true, purge all cached list responses for this collection as part of the update. Use this to force readers to see fresh data immediately instead of waiting for the cache TTL to expire. + * @param {string | null} params.description - Optional description for the collection. * @throws {AppwriteException} * @returns {Promise<Models.Collection>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateTable` instead. @@ -1612,10 +1678,11 @@ export class Databases { databaseId: string; collectionId: string; name?: string; - permissions?: string[]; + permissions?: string[] | null; documentSecurity?: boolean; enabled?: boolean; purge?: boolean; + description?: string | null; }): Promise<Models.Collection>; /** * Update a collection by its unique ID. @@ -1623,10 +1690,11 @@ export class Databases { * @param {string} databaseId - Database ID. * @param {string} collectionId - Collection ID. * @param {string} name - Collection name. Max length: 128 chars. - * @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 {string[] | null} permissions - An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} documentSecurity - Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} enabled - Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled. * @param {boolean} purge - When true, purge all cached list responses for this collection as part of the update. Use this to force readers to see fresh data immediately instead of waiting for the cache TTL to expire. + * @param {string | null} description - Optional description for the collection. * @throws {AppwriteException} * @returns {Promise<Models.Collection>} * @deprecated Use the object parameter style method for a better developer experience. @@ -1635,10 +1703,11 @@ export class Databases { databaseId: string, collectionId: string, name?: string, - permissions?: string[], + permissions?: string[] | null, documentSecurity?: boolean, enabled?: boolean, purge?: boolean, + description?: string | null, ): Promise<Models.Collection>; updateCollection( paramsOrFirst: @@ -1646,22 +1715,32 @@ export class Databases { databaseId: string; collectionId: string; name?: string; - permissions?: string[]; + permissions?: string[] | null; documentSecurity?: boolean; enabled?: boolean; purge?: boolean; + description?: string | null; } | string, - ...rest: [string?, string?, string[]?, boolean?, boolean?, boolean?] + ...rest: [ + string?, + string?, + (string[] | null)?, + boolean?, + boolean?, + boolean?, + (string | null)?, + ] ): Promise<Models.Collection> { let params: { databaseId: string; collectionId: string; name?: string; - permissions?: string[]; + permissions?: string[] | null; documentSecurity?: boolean; enabled?: boolean; purge?: boolean; + description?: string | null; }; if ( @@ -1673,20 +1752,22 @@ export class Databases { databaseId: string; collectionId: string; name?: string; - permissions?: string[]; + permissions?: string[] | null; documentSecurity?: boolean; enabled?: boolean; purge?: boolean; + description?: string | null; }; } else { params = { databaseId: paramsOrFirst as string, collectionId: rest[0] as string, name: rest[1] as string, - permissions: rest[2] as string[], + permissions: rest[2] as string[] | null, documentSecurity: rest[3] as boolean, enabled: rest[4] as boolean, purge: rest[5] as boolean, + description: rest[6] as string | null, }; } @@ -1697,6 +1778,7 @@ export class Databases { const documentSecurity = params.documentSecurity; const enabled = params.enabled; const purge = params.purge; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -1730,6 +1812,9 @@ export class Databases { if (typeof purge !== 'undefined') { apiPayload['purge'] = purge; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -1750,6 +1835,7 @@ export class Databases { $permissions: [], databaseId: '', name: '', + description: '', enabled: true, documentSecurity: false, attributes: [], @@ -1769,6 +1855,7 @@ export class Databases { $createdAt: '', $updatedAt: '', key: '', + description: '', type: '', error: '', attributes: [], @@ -1989,10 +2076,11 @@ 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 attribute is required. + * @param {number | bigint | null} params.min - Minimum value + * @param {number | bigint | null} params.max - Maximum value + * @param {number | bigint | null} params.xdefault - Default value. Cannot be set when attribute is required. * @param {boolean} params.array - Is attribute an array? + * @param {string} params.description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeBigint>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createBigIntColumn` instead. @@ -2002,10 +2090,11 @@ export class Databases { collectionId: string; key: string; required: boolean; - min?: number | bigint; - max?: number | bigint; - xdefault?: number | bigint; + min?: number | bigint | null; + max?: number | bigint | null; + xdefault?: number | bigint | null; array?: boolean; + description?: string; }): Promise<Models.AttributeBigint>; /** * Create a bigint attribute. Optionally, minimum and maximum values can be provided. @@ -2015,10 +2104,11 @@ 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 attribute is required. + * @param {number | bigint | null} min - Minimum value + * @param {number | bigint | null} max - Maximum value + * @param {number | bigint | null} xdefault - Default value. Cannot be set when attribute is required. * @param {boolean} array - Is attribute an array? + * @param {string} description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeBigint>} * @deprecated Use the object parameter style method for a better developer experience. @@ -2028,10 +2118,11 @@ export class Databases { collectionId: string, key: string, required: boolean, - min?: number | bigint, - max?: number | bigint, - xdefault?: number | bigint, + min?: number | bigint | null, + max?: number | bigint | null, + xdefault?: number | bigint | null, array?: boolean, + description?: string, ): Promise<Models.AttributeBigint>; createBigIntAttribute( paramsOrFirst: @@ -2040,20 +2131,22 @@ export class Databases { collectionId: string; key: string; required: boolean; - min?: number | bigint; - max?: number | bigint; - xdefault?: number | bigint; + min?: number | bigint | null; + max?: number | bigint | null; + xdefault?: number | bigint | null; array?: boolean; + description?: string; } | string, ...rest: [ string?, string?, boolean?, - (number | bigint)?, - (number | bigint)?, - (number | bigint)?, + (number | bigint | null)?, + (number | bigint | null)?, + (number | bigint | null)?, boolean?, + string?, ] ): Promise<Models.AttributeBigint> { let params: { @@ -2061,10 +2154,11 @@ export class Databases { collectionId: string; key: string; required: boolean; - min?: number | bigint; - max?: number | bigint; - xdefault?: number | bigint; + min?: number | bigint | null; + max?: number | bigint | null; + xdefault?: number | bigint | null; array?: boolean; + description?: string; }; if ( @@ -2077,10 +2171,11 @@ export class Databases { collectionId: string; key: string; required: boolean; - min?: number | bigint; - max?: number | bigint; - xdefault?: number | bigint; + min?: number | bigint | null; + max?: number | bigint | null; + xdefault?: number | bigint | null; array?: boolean; + description?: string; }; } else { params = { @@ -2088,10 +2183,11 @@ export class Databases { 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 | bigint | null, + max: rest[4] as number | bigint | null, + xdefault: rest[5] as number | bigint | null, array: rest[6] as boolean, + description: rest[7] as string, }; } @@ -2103,6 +2199,7 @@ export class Databases { const max = params.max; const xdefault = params.xdefault; const array = params.array; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -2148,6 +2245,9 @@ export class Databases { if (typeof array !== 'undefined') { apiPayload['array'] = array; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -2163,6 +2263,7 @@ export class Databases { attributeBigint: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -2184,10 +2285,11 @@ 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 attribute is required. - * @param {number | bigint} params.min - Minimum value - * @param {number | bigint} params.max - Maximum value - * @param {string} params.newKey - New Attribute Key. + * @param {number | bigint | null} params.xdefault - Default value. Cannot be set when attribute is required. + * @param {number | bigint | null} params.min - Minimum value + * @param {number | bigint | null} params.max - Maximum value + * @param {string | null} params.newKey - New Attribute Key. + * @param {string | null} params.description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeBigint>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateBigIntColumn` instead. @@ -2197,10 +2299,11 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: number | bigint; - min?: number | bigint; - max?: number | bigint; - newKey?: string; + xdefault?: number | bigint | null; + min?: number | bigint | null; + max?: number | bigint | null; + newKey?: string | null; + description?: string | null; }): Promise<Models.AttributeBigint>; /** * Update a bigint attribute. Changing the `default` value will not update already existing documents. @@ -2210,10 +2313,11 @@ 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 attribute is required. - * @param {number | bigint} min - Minimum value - * @param {number | bigint} max - Maximum value - * @param {string} newKey - New Attribute Key. + * @param {number | bigint | null} xdefault - Default value. Cannot be set when attribute is required. + * @param {number | bigint | null} min - Minimum value + * @param {number | bigint | null} max - Maximum value + * @param {string | null} newKey - New Attribute Key. + * @param {string | null} description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeBigint>} * @deprecated Use the object parameter style method for a better developer experience. @@ -2223,10 +2327,11 @@ export class Databases { collectionId: string, key: string, required: boolean, - xdefault?: number | bigint, - min?: number | bigint, - max?: number | bigint, - newKey?: string, + xdefault?: number | bigint | null, + min?: number | bigint | null, + max?: number | bigint | null, + newKey?: string | null, + description?: string | null, ): Promise<Models.AttributeBigint>; updateBigIntAttribute( paramsOrFirst: @@ -2235,20 +2340,22 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: number | bigint; - min?: number | bigint; - max?: number | bigint; - newKey?: string; + xdefault?: number | bigint | null; + min?: number | bigint | null; + max?: number | bigint | null; + newKey?: string | null; + description?: string | null; } | string, ...rest: [ string?, string?, boolean?, - (number | bigint)?, - (number | bigint)?, - (number | bigint)?, - string?, + (number | bigint | null)?, + (number | bigint | null)?, + (number | bigint | null)?, + (string | null)?, + (string | null)?, ] ): Promise<Models.AttributeBigint> { let params: { @@ -2256,10 +2363,11 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: number | bigint; - min?: number | bigint; - max?: number | bigint; - newKey?: string; + xdefault?: number | bigint | null; + min?: number | bigint | null; + max?: number | bigint | null; + newKey?: string | null; + description?: string | null; }; if ( @@ -2272,10 +2380,11 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: number | bigint; - min?: number | bigint; - max?: number | bigint; - newKey?: string; + xdefault?: number | bigint | null; + min?: number | bigint | null; + max?: number | bigint | null; + newKey?: string | null; + description?: string | null; }; } else { params = { @@ -2283,10 +2392,11 @@ export class Databases { 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, - newKey: rest[6] as string, + xdefault: rest[3] as number | bigint | null, + min: rest[4] as number | bigint | null, + max: rest[5] as number | bigint | null, + newKey: rest[6] as string | null, + description: rest[7] as string | null, }; } @@ -2298,6 +2408,7 @@ export class Databases { const min = params.min; const max = params.max; const newKey = params.newKey; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -2346,6 +2457,9 @@ export class Databases { if (typeof newKey !== 'undefined') { apiPayload['newKey'] = newKey; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -2361,6 +2475,7 @@ export class Databases { attributeBigint: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -2382,8 +2497,9 @@ export class Databases { * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @param {string} params.key - Attribute Key. * @param {boolean} params.required - Is attribute required? - * @param {boolean} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. + * @param {boolean | null} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. * @param {boolean} params.array - Is attribute an array? + * @param {string} params.description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeBoolean>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createBooleanColumn` instead. @@ -2393,8 +2509,9 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: boolean; + xdefault?: boolean | null; array?: boolean; + description?: string; }): Promise<Models.AttributeBoolean>; /** * Create a boolean attribute. @@ -2404,8 +2521,9 @@ export class Databases { * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @param {string} key - Attribute Key. * @param {boolean} required - Is attribute required? - * @param {boolean} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. + * @param {boolean | null} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. * @param {boolean} array - Is attribute an array? + * @param {string} description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeBoolean>} * @deprecated Use the object parameter style method for a better developer experience. @@ -2415,8 +2533,9 @@ export class Databases { collectionId: string, key: string, required: boolean, - xdefault?: boolean, + xdefault?: boolean | null, array?: boolean, + description?: string, ): Promise<Models.AttributeBoolean>; createBooleanAttribute( paramsOrFirst: @@ -2425,19 +2544,28 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: boolean; + xdefault?: boolean | null; array?: boolean; + description?: string; } | string, - ...rest: [string?, string?, boolean?, boolean?, boolean?] + ...rest: [ + string?, + string?, + boolean?, + (boolean | null)?, + boolean?, + string?, + ] ): Promise<Models.AttributeBoolean> { let params: { databaseId: string; collectionId: string; key: string; required: boolean; - xdefault?: boolean; + xdefault?: boolean | null; array?: boolean; + description?: string; }; if ( @@ -2450,8 +2578,9 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: boolean; + xdefault?: boolean | null; array?: boolean; + description?: string; }; } else { params = { @@ -2459,8 +2588,9 @@ export class Databases { collectionId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as boolean, + xdefault: rest[3] as boolean | null, array: rest[4] as boolean, + description: rest[5] as string, }; } @@ -2470,6 +2600,7 @@ export class Databases { const required = params.required; const xdefault = params.xdefault; const array = params.array; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -2509,6 +2640,9 @@ export class Databases { if (typeof array !== 'undefined') { apiPayload['array'] = array; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -2524,6 +2658,7 @@ export class Databases { attributeBoolean: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -2544,8 +2679,9 @@ export class Databases { * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection). * @param {string} params.key - Attribute Key. * @param {boolean} params.required - Is attribute required? - * @param {boolean} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. - * @param {string} params.newKey - New attribute key. + * @param {boolean | null} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. + * @param {string | null} params.newKey - New attribute key. + * @param {string | null} params.description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeBoolean>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateBooleanColumn` instead. @@ -2555,8 +2691,9 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: boolean; - newKey?: string; + xdefault?: boolean | null; + newKey?: string | null; + description?: string | null; }): Promise<Models.AttributeBoolean>; /** * Update a boolean attribute. Changing the `default` value will not update already existing documents. @@ -2565,8 +2702,9 @@ export class Databases { * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection). * @param {string} key - Attribute Key. * @param {boolean} required - Is attribute required? - * @param {boolean} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. - * @param {string} newKey - New attribute key. + * @param {boolean | null} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. + * @param {string | null} newKey - New attribute key. + * @param {string | null} description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeBoolean>} * @deprecated Use the object parameter style method for a better developer experience. @@ -2576,8 +2714,9 @@ export class Databases { collectionId: string, key: string, required: boolean, - xdefault?: boolean, - newKey?: string, + xdefault?: boolean | null, + newKey?: string | null, + description?: string | null, ): Promise<Models.AttributeBoolean>; updateBooleanAttribute( paramsOrFirst: @@ -2586,19 +2725,28 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: boolean; - newKey?: string; + xdefault?: boolean | null; + newKey?: string | null; + description?: string | null; } | string, - ...rest: [string?, string?, boolean?, boolean?, string?] + ...rest: [ + string?, + string?, + boolean?, + (boolean | null)?, + (string | null)?, + (string | null)?, + ] ): Promise<Models.AttributeBoolean> { let params: { databaseId: string; collectionId: string; key: string; required: boolean; - xdefault?: boolean; - newKey?: string; + xdefault?: boolean | null; + newKey?: string | null; + description?: string | null; }; if ( @@ -2611,8 +2759,9 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: boolean; - newKey?: string; + xdefault?: boolean | null; + newKey?: string | null; + description?: string | null; }; } else { params = { @@ -2620,8 +2769,9 @@ export class Databases { collectionId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as boolean, - newKey: rest[4] as string, + xdefault: rest[3] as boolean | null, + newKey: rest[4] as string | null, + description: rest[5] as string | null, }; } @@ -2631,6 +2781,7 @@ export class Databases { const required = params.required; const xdefault = params.xdefault; const newKey = params.newKey; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -2673,6 +2824,9 @@ export class Databases { if (typeof newKey !== 'undefined') { apiPayload['newKey'] = newKey; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -2688,6 +2842,7 @@ export class Databases { attributeBoolean: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -2708,8 +2863,9 @@ export class Databases { * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection). * @param {string} params.key - Attribute Key. * @param {boolean} params.required - Is attribute required? - * @param {string} params.xdefault - Default value for the attribute in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Cannot be set when attribute is required. + * @param {string | null} params.xdefault - Default value for the attribute in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Cannot be set when attribute is required. * @param {boolean} params.array - Is attribute an array? + * @param {string} params.description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeDatetime>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createDatetimeColumn` instead. @@ -2719,8 +2875,9 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; + description?: string; }): Promise<Models.AttributeDatetime>; /** * Create a date time attribute according to the ISO 8601 standard. @@ -2729,8 +2886,9 @@ export class Databases { * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection). * @param {string} key - Attribute Key. * @param {boolean} required - Is attribute required? - * @param {string} xdefault - Default value for the attribute in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Cannot be set when attribute is required. + * @param {string | null} xdefault - Default value for the attribute in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Cannot be set when attribute is required. * @param {boolean} array - Is attribute an array? + * @param {string} description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeDatetime>} * @deprecated Use the object parameter style method for a better developer experience. @@ -2740,8 +2898,9 @@ export class Databases { collectionId: string, key: string, required: boolean, - xdefault?: string, + xdefault?: string | null, array?: boolean, + description?: string, ): Promise<Models.AttributeDatetime>; createDatetimeAttribute( paramsOrFirst: @@ -2750,19 +2909,28 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; + description?: string; } | string, - ...rest: [string?, string?, boolean?, string?, boolean?] + ...rest: [ + string?, + string?, + boolean?, + (string | null)?, + boolean?, + string?, + ] ): Promise<Models.AttributeDatetime> { let params: { databaseId: string; collectionId: string; key: string; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; + description?: string; }; if ( @@ -2775,8 +2943,9 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; + description?: string; }; } else { params = { @@ -2784,8 +2953,9 @@ export class Databases { collectionId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as string, + xdefault: rest[3] as string | null, array: rest[4] as boolean, + description: rest[5] as string, }; } @@ -2795,6 +2965,7 @@ export class Databases { const required = params.required; const xdefault = params.xdefault; const array = params.array; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -2834,6 +3005,9 @@ export class Databases { if (typeof array !== 'undefined') { apiPayload['array'] = array; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -2849,6 +3023,7 @@ export class Databases { attributeDatetime: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -2869,8 +3044,9 @@ export class Databases { * @param {string} params.collectionId - Collection ID. * @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 {string} params.newKey - New attribute key. + * @param {string | null} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. + * @param {string | null} params.newKey - New attribute key. + * @param {string | null} params.description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeDatetime>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateDatetimeColumn` instead. @@ -2880,8 +3056,9 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; }): Promise<Models.AttributeDatetime>; /** * Update a date time attribute. Changing the `default` value will not update already existing documents. @@ -2890,8 +3067,9 @@ export class Databases { * @param {string} collectionId - Collection ID. * @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 {string} newKey - New attribute key. + * @param {string | null} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. + * @param {string | null} newKey - New attribute key. + * @param {string | null} description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeDatetime>} * @deprecated Use the object parameter style method for a better developer experience. @@ -2901,8 +3079,9 @@ export class Databases { collectionId: string, key: string, required: boolean, - xdefault?: string, - newKey?: string, + xdefault?: string | null, + newKey?: string | null, + description?: string | null, ): Promise<Models.AttributeDatetime>; updateDatetimeAttribute( paramsOrFirst: @@ -2911,19 +3090,28 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; } | string, - ...rest: [string?, string?, boolean?, string?, string?] + ...rest: [ + string?, + string?, + boolean?, + (string | null)?, + (string | null)?, + (string | null)?, + ] ): Promise<Models.AttributeDatetime> { let params: { databaseId: string; collectionId: string; key: string; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; }; if ( @@ -2936,8 +3124,9 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; }; } else { params = { @@ -2945,8 +3134,9 @@ export class Databases { collectionId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as string, - newKey: rest[4] as string, + xdefault: rest[3] as string | null, + newKey: rest[4] as string | null, + description: rest[5] as string | null, }; } @@ -2956,6 +3146,7 @@ export class Databases { const required = params.required; const xdefault = params.xdefault; const newKey = params.newKey; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -2998,6 +3189,9 @@ export class Databases { if (typeof newKey !== 'undefined') { apiPayload['newKey'] = newKey; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -3013,6 +3207,7 @@ export class Databases { attributeDatetime: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -3034,8 +3229,9 @@ export class Databases { * @param {string} params.collectionId - Collection ID. * @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 {string | null} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. * @param {boolean} params.array - Is attribute an array? + * @param {string} params.description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeEmail>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createEmailColumn` instead. @@ -3045,8 +3241,9 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; + description?: string; }): Promise<Models.AttributeEmail>; /** * Create an email attribute. @@ -3056,8 +3253,9 @@ export class Databases { * @param {string} collectionId - Collection ID. * @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 {string | null} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. * @param {boolean} array - Is attribute an array? + * @param {string} description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeEmail>} * @deprecated Use the object parameter style method for a better developer experience. @@ -3067,8 +3265,9 @@ export class Databases { collectionId: string, key: string, required: boolean, - xdefault?: string, + xdefault?: string | null, array?: boolean, + description?: string, ): Promise<Models.AttributeEmail>; createEmailAttribute( paramsOrFirst: @@ -3077,19 +3276,28 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; + description?: string; } | string, - ...rest: [string?, string?, boolean?, string?, boolean?] + ...rest: [ + string?, + string?, + boolean?, + (string | null)?, + boolean?, + string?, + ] ): Promise<Models.AttributeEmail> { let params: { databaseId: string; collectionId: string; key: string; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; + description?: string; }; if ( @@ -3102,8 +3310,9 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; + description?: string; }; } else { params = { @@ -3111,8 +3320,9 @@ export class Databases { collectionId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as string, + xdefault: rest[3] as string | null, array: rest[4] as boolean, + description: rest[5] as string, }; } @@ -3122,6 +3332,7 @@ export class Databases { const required = params.required; const xdefault = params.xdefault; const array = params.array; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -3161,6 +3372,9 @@ export class Databases { if (typeof array !== 'undefined') { apiPayload['array'] = array; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -3176,6 +3390,7 @@ export class Databases { attributeEmail: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -3198,8 +3413,9 @@ export class Databases { * @param {string} params.collectionId - Collection ID. * @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 {string} params.newKey - New Attribute Key. + * @param {string | null} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. + * @param {string | null} params.newKey - New Attribute Key. + * @param {string | null} params.description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeEmail>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateEmailColumn` instead. @@ -3209,8 +3425,9 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; }): Promise<Models.AttributeEmail>; /** * Update an email attribute. Changing the `default` value will not update already existing documents. @@ -3220,8 +3437,9 @@ export class Databases { * @param {string} collectionId - Collection ID. * @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 {string} newKey - New Attribute Key. + * @param {string | null} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. + * @param {string | null} newKey - New Attribute Key. + * @param {string | null} description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeEmail>} * @deprecated Use the object parameter style method for a better developer experience. @@ -3231,8 +3449,9 @@ export class Databases { collectionId: string, key: string, required: boolean, - xdefault?: string, - newKey?: string, + xdefault?: string | null, + newKey?: string | null, + description?: string | null, ): Promise<Models.AttributeEmail>; updateEmailAttribute( paramsOrFirst: @@ -3241,19 +3460,28 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; } | string, - ...rest: [string?, string?, boolean?, string?, string?] + ...rest: [ + string?, + string?, + boolean?, + (string | null)?, + (string | null)?, + (string | null)?, + ] ): Promise<Models.AttributeEmail> { let params: { databaseId: string; collectionId: string; key: string; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; }; if ( @@ -3266,8 +3494,9 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; }; } else { params = { @@ -3275,8 +3504,9 @@ export class Databases { collectionId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as string, - newKey: rest[4] as string, + xdefault: rest[3] as string | null, + newKey: rest[4] as string | null, + description: rest[5] as string | null, }; } @@ -3286,6 +3516,7 @@ export class Databases { const required = params.required; const xdefault = params.xdefault; const newKey = params.newKey; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -3328,6 +3559,9 @@ export class Databases { if (typeof newKey !== 'undefined') { apiPayload['newKey'] = newKey; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -3343,6 +3577,7 @@ export class Databases { attributeEmail: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -3366,8 +3601,9 @@ export class Databases { * @param {string} params.key - Attribute Key. * @param {string[]} params.elements - Array of enum values. * @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 {string | null} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. * @param {boolean} params.array - Is attribute an array? + * @param {string} params.description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeEnum>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createEnumColumn` instead. @@ -3378,8 +3614,9 @@ export class Databases { key: string; elements: string[]; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; + description?: string; }): Promise<Models.AttributeEnum>; /** * Create an enum attribute. The `elements` param acts as a white-list of accepted values for this attribute. @@ -3390,8 +3627,9 @@ export class Databases { * @param {string} key - Attribute Key. * @param {string[]} elements - Array of enum values. * @param {boolean} required - Is attribute required? - * @param {string} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. + * @param {string | null} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. * @param {boolean} array - Is attribute an array? + * @param {string} description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeEnum>} * @deprecated Use the object parameter style method for a better developer experience. @@ -3402,8 +3640,9 @@ export class Databases { key: string, elements: string[], required: boolean, - xdefault?: string, + xdefault?: string | null, array?: boolean, + description?: string, ): Promise<Models.AttributeEnum>; createEnumAttribute( paramsOrFirst: @@ -3413,11 +3652,20 @@ export class Databases { key: string; elements: string[]; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; + description?: string; } | string, - ...rest: [string?, string?, string[]?, boolean?, string?, boolean?] + ...rest: [ + string?, + string?, + string[]?, + boolean?, + (string | null)?, + boolean?, + string?, + ] ): Promise<Models.AttributeEnum> { let params: { databaseId: string; @@ -3425,8 +3673,9 @@ export class Databases { key: string; elements: string[]; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; + description?: string; }; if ( @@ -3440,8 +3689,9 @@ export class Databases { key: string; elements: string[]; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; + description?: string; }; } else { params = { @@ -3450,8 +3700,9 @@ export class Databases { key: rest[1] as string, elements: rest[2] as string[], required: rest[3] as boolean, - xdefault: rest[4] as string, + xdefault: rest[4] as string | null, array: rest[5] as boolean, + description: rest[6] as string, }; } @@ -3462,6 +3713,7 @@ export class Databases { const required = params.required; const xdefault = params.xdefault; const array = params.array; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -3509,6 +3761,9 @@ export class Databases { if (typeof array !== 'undefined') { apiPayload['array'] = array; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -3524,6 +3779,7 @@ export class Databases { attributeEnum: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -3548,8 +3804,9 @@ export class Databases { * @param {string} params.key - Attribute Key. * @param {string[]} params.elements - Updated list of enum values. * @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 {string} params.newKey - New Attribute Key. + * @param {string | null} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. + * @param {string | null} params.newKey - New Attribute Key. + * @param {string | null} params.description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeEnum>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateEnumColumn` instead. @@ -3560,8 +3817,9 @@ export class Databases { key: string; elements: string[]; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; }): Promise<Models.AttributeEnum>; /** * Update an enum attribute. Changing the `default` value will not update already existing documents. @@ -3572,8 +3830,9 @@ export class Databases { * @param {string} key - Attribute Key. * @param {string[]} elements - Updated list of enum values. * @param {boolean} required - Is attribute required? - * @param {string} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. - * @param {string} newKey - New Attribute Key. + * @param {string | null} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. + * @param {string | null} newKey - New Attribute Key. + * @param {string | null} description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeEnum>} * @deprecated Use the object parameter style method for a better developer experience. @@ -3584,8 +3843,9 @@ export class Databases { key: string, elements: string[], required: boolean, - xdefault?: string, - newKey?: string, + xdefault?: string | null, + newKey?: string | null, + description?: string | null, ): Promise<Models.AttributeEnum>; updateEnumAttribute( paramsOrFirst: @@ -3595,11 +3855,20 @@ export class Databases { key: string; elements: string[]; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; } | string, - ...rest: [string?, string?, string[]?, boolean?, string?, string?] + ...rest: [ + string?, + string?, + string[]?, + boolean?, + (string | null)?, + (string | null)?, + (string | null)?, + ] ): Promise<Models.AttributeEnum> { let params: { databaseId: string; @@ -3607,8 +3876,9 @@ export class Databases { key: string; elements: string[]; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; }; if ( @@ -3622,8 +3892,9 @@ export class Databases { key: string; elements: string[]; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; }; } else { params = { @@ -3632,8 +3903,9 @@ export class Databases { key: rest[1] as string, elements: rest[2] as string[], required: rest[3] as boolean, - xdefault: rest[4] as string, - newKey: rest[5] as string, + xdefault: rest[4] as string | null, + newKey: rest[5] as string | null, + description: rest[6] as string | null, }; } @@ -3644,6 +3916,7 @@ export class Databases { const required = params.required; const xdefault = params.xdefault; const newKey = params.newKey; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -3694,6 +3967,9 @@ export class Databases { if (typeof newKey !== 'undefined') { apiPayload['newKey'] = newKey; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -3709,6 +3985,7 @@ export class Databases { attributeEnum: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -3732,10 +4009,11 @@ 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 | null} params.min - Minimum value. + * @param {number | null} params.max - Maximum value. + * @param {number | null} params.xdefault - Default value. Cannot be set when required. * @param {boolean} params.array - Is attribute an array? + * @param {string} params.description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeFloat>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createFloatColumn` instead. @@ -3745,10 +4023,11 @@ export class Databases { collectionId: string; key: string; required: boolean; - min?: number; - max?: number; - xdefault?: number; + min?: number | null; + max?: number | null; + xdefault?: number | null; array?: boolean; + description?: string; }): Promise<Models.AttributeFloat>; /** * Create a float attribute. Optionally, minimum and maximum values can be provided. @@ -3758,10 +4037,11 @@ 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 | null} min - Minimum value. + * @param {number | null} max - Maximum value. + * @param {number | null} xdefault - Default value. Cannot be set when required. * @param {boolean} array - Is attribute an array? + * @param {string} description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeFloat>} * @deprecated Use the object parameter style method for a better developer experience. @@ -3771,10 +4051,11 @@ export class Databases { collectionId: string, key: string, required: boolean, - min?: number, - max?: number, - xdefault?: number, + min?: number | null, + max?: number | null, + xdefault?: number | null, array?: boolean, + description?: string, ): Promise<Models.AttributeFloat>; createFloatAttribute( paramsOrFirst: @@ -3783,20 +4064,22 @@ export class Databases { collectionId: string; key: string; required: boolean; - min?: number; - max?: number; - xdefault?: number; + min?: number | null; + max?: number | null; + xdefault?: number | null; array?: boolean; + description?: string; } | string, ...rest: [ string?, string?, boolean?, - number?, - number?, - number?, + (number | null)?, + (number | null)?, + (number | null)?, boolean?, + string?, ] ): Promise<Models.AttributeFloat> { let params: { @@ -3804,10 +4087,11 @@ export class Databases { collectionId: string; key: string; required: boolean; - min?: number; - max?: number; - xdefault?: number; + min?: number | null; + max?: number | null; + xdefault?: number | null; array?: boolean; + description?: string; }; if ( @@ -3820,10 +4104,11 @@ export class Databases { collectionId: string; key: string; required: boolean; - min?: number; - max?: number; - xdefault?: number; + min?: number | null; + max?: number | null; + xdefault?: number | null; array?: boolean; + description?: string; }; } else { params = { @@ -3831,10 +4116,11 @@ export class Databases { 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 | null, + max: rest[4] as number | null, + xdefault: rest[5] as number | null, array: rest[6] as boolean, + description: rest[7] as string, }; } @@ -3846,6 +4132,7 @@ export class Databases { const max = params.max; const xdefault = params.xdefault; const array = params.array; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -3891,6 +4178,9 @@ export class Databases { if (typeof array !== 'undefined') { apiPayload['array'] = array; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -3906,6 +4196,7 @@ export class Databases { attributeFloat: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -3927,10 +4218,11 @@ 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 {string} params.newKey - New Attribute Key. + * @param {number | null} params.xdefault - Default value. Cannot be set when required. + * @param {number | null} params.min - Minimum value. + * @param {number | null} params.max - Maximum value. + * @param {string | null} params.newKey - New Attribute Key. + * @param {string | null} params.description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeFloat>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateFloatColumn` instead. @@ -3940,10 +4232,11 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: number; - min?: number; - max?: number; - newKey?: string; + xdefault?: number | null; + min?: number | null; + max?: number | null; + newKey?: string | null; + description?: string | null; }): Promise<Models.AttributeFloat>; /** * Update a float attribute. Changing the `default` value will not update already existing documents. @@ -3953,10 +4246,11 @@ 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 {string} newKey - New Attribute Key. + * @param {number | null} xdefault - Default value. Cannot be set when required. + * @param {number | null} min - Minimum value. + * @param {number | null} max - Maximum value. + * @param {string | null} newKey - New Attribute Key. + * @param {string | null} description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeFloat>} * @deprecated Use the object parameter style method for a better developer experience. @@ -3966,10 +4260,11 @@ export class Databases { collectionId: string, key: string, required: boolean, - xdefault?: number, - min?: number, - max?: number, - newKey?: string, + xdefault?: number | null, + min?: number | null, + max?: number | null, + newKey?: string | null, + description?: string | null, ): Promise<Models.AttributeFloat>; updateFloatAttribute( paramsOrFirst: @@ -3978,20 +4273,22 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: number; - min?: number; - max?: number; - newKey?: string; + xdefault?: number | null; + min?: number | null; + max?: number | null; + newKey?: string | null; + description?: string | null; } | string, ...rest: [ string?, string?, boolean?, - number?, - number?, - number?, - string?, + (number | null)?, + (number | null)?, + (number | null)?, + (string | null)?, + (string | null)?, ] ): Promise<Models.AttributeFloat> { let params: { @@ -3999,10 +4296,11 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: number; - min?: number; - max?: number; - newKey?: string; + xdefault?: number | null; + min?: number | null; + max?: number | null; + newKey?: string | null; + description?: string | null; }; if ( @@ -4015,10 +4313,11 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: number; - min?: number; - max?: number; - newKey?: string; + xdefault?: number | null; + min?: number | null; + max?: number | null; + newKey?: string | null; + description?: string | null; }; } else { params = { @@ -4026,10 +4325,11 @@ export class Databases { 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, - newKey: rest[6] as string, + xdefault: rest[3] as number | null, + min: rest[4] as number | null, + max: rest[5] as number | null, + newKey: rest[6] as string | null, + description: rest[7] as string | null, }; } @@ -4041,6 +4341,7 @@ export class Databases { const min = params.min; const max = params.max; const newKey = params.newKey; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -4089,6 +4390,9 @@ export class Databases { if (typeof newKey !== 'undefined') { apiPayload['newKey'] = newKey; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -4104,6 +4408,7 @@ export class Databases { attributeFloat: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -4125,10 +4430,11 @@ 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 attribute is required. + * @param {number | bigint | null} params.min - Minimum value + * @param {number | bigint | null} params.max - Maximum value + * @param {number | bigint | null} params.xdefault - Default value. Cannot be set when attribute is required. * @param {boolean} params.array - Is attribute an array? + * @param {string} params.description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeInteger>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createIntegerColumn` instead. @@ -4138,10 +4444,11 @@ export class Databases { collectionId: string; key: string; required: boolean; - min?: number | bigint; - max?: number | bigint; - xdefault?: number | bigint; + min?: number | bigint | null; + max?: number | bigint | null; + xdefault?: number | bigint | null; array?: boolean; + description?: string; }): Promise<Models.AttributeInteger>; /** * Create an integer attribute. Optionally, minimum and maximum values can be provided. @@ -4151,10 +4458,11 @@ 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 attribute is required. + * @param {number | bigint | null} min - Minimum value + * @param {number | bigint | null} max - Maximum value + * @param {number | bigint | null} xdefault - Default value. Cannot be set when attribute is required. * @param {boolean} array - Is attribute an array? + * @param {string} description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeInteger>} * @deprecated Use the object parameter style method for a better developer experience. @@ -4164,10 +4472,11 @@ export class Databases { collectionId: string, key: string, required: boolean, - min?: number | bigint, - max?: number | bigint, - xdefault?: number | bigint, + min?: number | bigint | null, + max?: number | bigint | null, + xdefault?: number | bigint | null, array?: boolean, + description?: string, ): Promise<Models.AttributeInteger>; createIntegerAttribute( paramsOrFirst: @@ -4176,20 +4485,22 @@ export class Databases { collectionId: string; key: string; required: boolean; - min?: number | bigint; - max?: number | bigint; - xdefault?: number | bigint; + min?: number | bigint | null; + max?: number | bigint | null; + xdefault?: number | bigint | null; array?: boolean; + description?: string; } | string, ...rest: [ string?, string?, boolean?, - (number | bigint)?, - (number | bigint)?, - (number | bigint)?, + (number | bigint | null)?, + (number | bigint | null)?, + (number | bigint | null)?, boolean?, + string?, ] ): Promise<Models.AttributeInteger> { let params: { @@ -4197,10 +4508,11 @@ export class Databases { collectionId: string; key: string; required: boolean; - min?: number | bigint; - max?: number | bigint; - xdefault?: number | bigint; + min?: number | bigint | null; + max?: number | bigint | null; + xdefault?: number | bigint | null; array?: boolean; + description?: string; }; if ( @@ -4213,10 +4525,11 @@ export class Databases { collectionId: string; key: string; required: boolean; - min?: number | bigint; - max?: number | bigint; - xdefault?: number | bigint; + min?: number | bigint | null; + max?: number | bigint | null; + xdefault?: number | bigint | null; array?: boolean; + description?: string; }; } else { params = { @@ -4224,10 +4537,11 @@ export class Databases { 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 | bigint | null, + max: rest[4] as number | bigint | null, + xdefault: rest[5] as number | bigint | null, array: rest[6] as boolean, + description: rest[7] as string, }; } @@ -4239,6 +4553,7 @@ export class Databases { const max = params.max; const xdefault = params.xdefault; const array = params.array; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -4284,6 +4599,9 @@ export class Databases { if (typeof array !== 'undefined') { apiPayload['array'] = array; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -4299,6 +4617,7 @@ export class Databases { attributeInteger: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -4320,10 +4639,11 @@ 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 attribute is required. - * @param {number | bigint} params.min - Minimum value - * @param {number | bigint} params.max - Maximum value - * @param {string} params.newKey - New Attribute Key. + * @param {number | bigint | null} params.xdefault - Default value. Cannot be set when attribute is required. + * @param {number | bigint | null} params.min - Minimum value + * @param {number | bigint | null} params.max - Maximum value + * @param {string | null} params.newKey - New Attribute Key. + * @param {string | null} params.description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeInteger>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateIntegerColumn` instead. @@ -4333,10 +4653,11 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: number | bigint; - min?: number | bigint; - max?: number | bigint; - newKey?: string; + xdefault?: number | bigint | null; + min?: number | bigint | null; + max?: number | bigint | null; + newKey?: string | null; + description?: string | null; }): Promise<Models.AttributeInteger>; /** * Update an integer attribute. Changing the `default` value will not update already existing documents. @@ -4346,10 +4667,11 @@ 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 attribute is required. - * @param {number | bigint} min - Minimum value - * @param {number | bigint} max - Maximum value - * @param {string} newKey - New Attribute Key. + * @param {number | bigint | null} xdefault - Default value. Cannot be set when attribute is required. + * @param {number | bigint | null} min - Minimum value + * @param {number | bigint | null} max - Maximum value + * @param {string | null} newKey - New Attribute Key. + * @param {string | null} description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeInteger>} * @deprecated Use the object parameter style method for a better developer experience. @@ -4359,10 +4681,11 @@ export class Databases { collectionId: string, key: string, required: boolean, - xdefault?: number | bigint, - min?: number | bigint, - max?: number | bigint, - newKey?: string, + xdefault?: number | bigint | null, + min?: number | bigint | null, + max?: number | bigint | null, + newKey?: string | null, + description?: string | null, ): Promise<Models.AttributeInteger>; updateIntegerAttribute( paramsOrFirst: @@ -4371,20 +4694,22 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: number | bigint; - min?: number | bigint; - max?: number | bigint; - newKey?: string; + xdefault?: number | bigint | null; + min?: number | bigint | null; + max?: number | bigint | null; + newKey?: string | null; + description?: string | null; } | string, ...rest: [ string?, string?, boolean?, - (number | bigint)?, - (number | bigint)?, - (number | bigint)?, - string?, + (number | bigint | null)?, + (number | bigint | null)?, + (number | bigint | null)?, + (string | null)?, + (string | null)?, ] ): Promise<Models.AttributeInteger> { let params: { @@ -4392,10 +4717,11 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: number | bigint; - min?: number | bigint; - max?: number | bigint; - newKey?: string; + xdefault?: number | bigint | null; + min?: number | bigint | null; + max?: number | bigint | null; + newKey?: string | null; + description?: string | null; }; if ( @@ -4408,10 +4734,11 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: number | bigint; - min?: number | bigint; - max?: number | bigint; - newKey?: string; + xdefault?: number | bigint | null; + min?: number | bigint | null; + max?: number | bigint | null; + newKey?: string | null; + description?: string | null; }; } else { params = { @@ -4419,10 +4746,11 @@ export class Databases { 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, - newKey: rest[6] as string, + xdefault: rest[3] as number | bigint | null, + min: rest[4] as number | bigint | null, + max: rest[5] as number | bigint | null, + newKey: rest[6] as string | null, + description: rest[7] as string | null, }; } @@ -4434,6 +4762,7 @@ export class Databases { const min = params.min; const max = params.max; const newKey = params.newKey; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -4482,6 +4811,9 @@ export class Databases { if (typeof newKey !== 'undefined') { apiPayload['newKey'] = newKey; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -4497,6 +4829,7 @@ export class Databases { attributeInteger: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -4518,8 +4851,9 @@ export class Databases { * @param {string} params.collectionId - Collection ID. * @param {string} params.key - Attribute Key. * @param {boolean} params.required - Is attribute required? - * @param {string} params.xdefault - Default value. Cannot be set when attribute is required. + * @param {string | null} params.xdefault - Default value. Cannot be set when attribute is required. * @param {boolean} params.array - Is attribute an array? + * @param {string} params.description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeIp>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createIpColumn` instead. @@ -4529,8 +4863,9 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; + description?: string; }): Promise<Models.AttributeIp>; /** * Create IP address attribute. @@ -4540,8 +4875,9 @@ export class Databases { * @param {string} collectionId - Collection ID. * @param {string} key - Attribute Key. * @param {boolean} required - Is attribute required? - * @param {string} xdefault - Default value. Cannot be set when attribute is required. + * @param {string | null} xdefault - Default value. Cannot be set when attribute is required. * @param {boolean} array - Is attribute an array? + * @param {string} description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeIp>} * @deprecated Use the object parameter style method for a better developer experience. @@ -4551,8 +4887,9 @@ export class Databases { collectionId: string, key: string, required: boolean, - xdefault?: string, + xdefault?: string | null, array?: boolean, + description?: string, ): Promise<Models.AttributeIp>; createIpAttribute( paramsOrFirst: @@ -4561,19 +4898,28 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; + description?: string; } | string, - ...rest: [string?, string?, boolean?, string?, boolean?] + ...rest: [ + string?, + string?, + boolean?, + (string | null)?, + boolean?, + string?, + ] ): Promise<Models.AttributeIp> { let params: { databaseId: string; collectionId: string; key: string; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; + description?: string; }; if ( @@ -4586,8 +4932,9 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; + description?: string; }; } else { params = { @@ -4595,8 +4942,9 @@ export class Databases { collectionId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as string, + xdefault: rest[3] as string | null, array: rest[4] as boolean, + description: rest[5] as string, }; } @@ -4606,6 +4954,7 @@ export class Databases { const required = params.required; const xdefault = params.xdefault; const array = params.array; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -4645,6 +4994,9 @@ export class Databases { if (typeof array !== 'undefined') { apiPayload['array'] = array; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -4660,6 +5012,7 @@ export class Databases { attributeIp: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -4682,8 +5035,9 @@ export class Databases { * @param {string} params.collectionId - Collection ID. * @param {string} params.key - Attribute Key. * @param {boolean} params.required - Is attribute required? - * @param {string} params.xdefault - Default value. Cannot be set when attribute is required. - * @param {string} params.newKey - New Attribute Key. + * @param {string | null} params.xdefault - Default value. Cannot be set when attribute is required. + * @param {string | null} params.newKey - New Attribute Key. + * @param {string | null} params.description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeIp>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateIpColumn` instead. @@ -4693,8 +5047,9 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; }): Promise<Models.AttributeIp>; /** * Update an ip attribute. Changing the `default` value will not update already existing documents. @@ -4704,8 +5059,9 @@ export class Databases { * @param {string} collectionId - Collection ID. * @param {string} key - Attribute Key. * @param {boolean} required - Is attribute required? - * @param {string} xdefault - Default value. Cannot be set when attribute is required. - * @param {string} newKey - New Attribute Key. + * @param {string | null} xdefault - Default value. Cannot be set when attribute is required. + * @param {string | null} newKey - New Attribute Key. + * @param {string | null} description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeIp>} * @deprecated Use the object parameter style method for a better developer experience. @@ -4715,8 +5071,9 @@ export class Databases { collectionId: string, key: string, required: boolean, - xdefault?: string, - newKey?: string, + xdefault?: string | null, + newKey?: string | null, + description?: string | null, ): Promise<Models.AttributeIp>; updateIpAttribute( paramsOrFirst: @@ -4725,19 +5082,28 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; } | string, - ...rest: [string?, string?, boolean?, string?, string?] + ...rest: [ + string?, + string?, + boolean?, + (string | null)?, + (string | null)?, + (string | null)?, + ] ): Promise<Models.AttributeIp> { let params: { databaseId: string; collectionId: string; key: string; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; }; if ( @@ -4750,8 +5116,9 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; }; } else { params = { @@ -4759,8 +5126,9 @@ export class Databases { collectionId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as string, - newKey: rest[4] as string, + xdefault: rest[3] as string | null, + newKey: rest[4] as string | null, + description: rest[5] as string | null, }; } @@ -4770,6 +5138,7 @@ export class Databases { const required = params.required; const xdefault = params.xdefault; const newKey = params.newKey; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -4812,6 +5181,9 @@ export class Databases { if (typeof newKey !== 'undefined') { apiPayload['newKey'] = newKey; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -4827,6 +5199,7 @@ export class Databases { attributeIp: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -4848,7 +5221,8 @@ export class Databases { * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @param {string} params.key - Attribute Key. * @param {boolean} params.required - Is attribute required? - * @param {any[][]} params.xdefault - Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required. + * @param {any[][] | null} params.xdefault - Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required. + * @param {string} params.description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeLine>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createLineColumn` instead. @@ -4858,7 +5232,8 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: any[][]; + xdefault?: any[][] | null; + description?: string; }): Promise<Models.AttributeLine>; /** * Create a geometric line attribute. @@ -4867,7 +5242,8 @@ export class Databases { * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @param {string} key - Attribute Key. * @param {boolean} required - Is attribute required? - * @param {any[][]} xdefault - Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required. + * @param {any[][] | null} xdefault - Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required. + * @param {string} description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeLine>} * @deprecated Use the object parameter style method for a better developer experience. @@ -4877,7 +5253,8 @@ export class Databases { collectionId: string, key: string, required: boolean, - xdefault?: any[][], + xdefault?: any[][] | null, + description?: string, ): Promise<Models.AttributeLine>; createLineAttribute( paramsOrFirst: @@ -4886,17 +5263,19 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: any[][]; + xdefault?: any[][] | null; + description?: string; } | string, - ...rest: [string?, string?, boolean?, any[][]?] + ...rest: [string?, string?, boolean?, (any[][] | null)?, string?] ): Promise<Models.AttributeLine> { let params: { databaseId: string; collectionId: string; key: string; required: boolean; - xdefault?: any[][]; + xdefault?: any[][] | null; + description?: string; }; if ( @@ -4909,7 +5288,8 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: any[][]; + xdefault?: any[][] | null; + description?: string; }; } else { params = { @@ -4917,7 +5297,8 @@ export class Databases { collectionId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as any[][], + xdefault: rest[3] as any[][] | null, + description: rest[4] as string, }; } @@ -4926,6 +5307,7 @@ export class Databases { const key = params.key; const required = params.required; const xdefault = params.xdefault; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -4962,6 +5344,9 @@ export class Databases { if (typeof xdefault !== 'undefined') { apiPayload['default'] = xdefault; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -4977,6 +5362,7 @@ export class Databases { attributeLine: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -4997,8 +5383,9 @@ export class Databases { * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection). * @param {string} params.key - Attribute Key. * @param {boolean} params.required - Is attribute required? - * @param {any[][]} params.xdefault - Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required. - * @param {string} params.newKey - New attribute key. + * @param {any[][] | null} params.xdefault - Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required. + * @param {string | null} params.newKey - New attribute key. + * @param {string | null} params.description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeLine>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateLineColumn` instead. @@ -5008,8 +5395,9 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: any[][]; - newKey?: string; + xdefault?: any[][] | null; + newKey?: string | null; + description?: string | null; }): Promise<Models.AttributeLine>; /** * Update a line attribute. Changing the `default` value will not update already existing documents. @@ -5018,8 +5406,9 @@ export class Databases { * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection). * @param {string} key - Attribute Key. * @param {boolean} required - Is attribute required? - * @param {any[][]} xdefault - Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required. - * @param {string} newKey - New attribute key. + * @param {any[][] | null} xdefault - Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required. + * @param {string | null} newKey - New attribute key. + * @param {string | null} description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeLine>} * @deprecated Use the object parameter style method for a better developer experience. @@ -5029,8 +5418,9 @@ export class Databases { collectionId: string, key: string, required: boolean, - xdefault?: any[][], - newKey?: string, + xdefault?: any[][] | null, + newKey?: string | null, + description?: string | null, ): Promise<Models.AttributeLine>; updateLineAttribute( paramsOrFirst: @@ -5039,19 +5429,28 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: any[][]; - newKey?: string; + xdefault?: any[][] | null; + newKey?: string | null; + description?: string | null; } | string, - ...rest: [string?, string?, boolean?, any[][]?, string?] + ...rest: [ + string?, + string?, + boolean?, + (any[][] | null)?, + (string | null)?, + (string | null)?, + ] ): Promise<Models.AttributeLine> { let params: { databaseId: string; collectionId: string; key: string; required: boolean; - xdefault?: any[][]; - newKey?: string; + xdefault?: any[][] | null; + newKey?: string | null; + description?: string | null; }; if ( @@ -5064,8 +5463,9 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: any[][]; - newKey?: string; + xdefault?: any[][] | null; + newKey?: string | null; + description?: string | null; }; } else { params = { @@ -5073,8 +5473,9 @@ export class Databases { collectionId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as any[][], - newKey: rest[4] as string, + xdefault: rest[3] as any[][] | null, + newKey: rest[4] as string | null, + description: rest[5] as string | null, }; } @@ -5084,6 +5485,7 @@ export class Databases { const required = params.required; const xdefault = params.xdefault; const newKey = params.newKey; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -5121,6 +5523,9 @@ export class Databases { if (typeof newKey !== 'undefined') { apiPayload['newKey'] = newKey; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -5136,6 +5541,7 @@ export class Databases { attributeLine: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -5157,9 +5563,10 @@ export class Databases { * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @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 {string | null} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. * @param {boolean} params.array - Is attribute an array? * @param {boolean} params.encrypt - Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried. + * @param {string} params.description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeLongtext>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createLongtextColumn` instead. @@ -5169,9 +5576,10 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; encrypt?: boolean; + description?: string; }): Promise<Models.AttributeLongtext>; /** * Create a longtext attribute. @@ -5181,9 +5589,10 @@ export class Databases { * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @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 {string | null} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. * @param {boolean} array - Is attribute an array? * @param {boolean} encrypt - Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried. + * @param {string} description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeLongtext>} * @deprecated Use the object parameter style method for a better developer experience. @@ -5193,9 +5602,10 @@ export class Databases { collectionId: string, key: string, required: boolean, - xdefault?: string, + xdefault?: string | null, array?: boolean, encrypt?: boolean, + description?: string, ): Promise<Models.AttributeLongtext>; createLongtextAttribute( paramsOrFirst: @@ -5204,21 +5614,31 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; encrypt?: boolean; + description?: string; } | string, - ...rest: [string?, string?, boolean?, string?, boolean?, boolean?] + ...rest: [ + string?, + string?, + boolean?, + (string | null)?, + boolean?, + boolean?, + string?, + ] ): Promise<Models.AttributeLongtext> { let params: { databaseId: string; collectionId: string; key: string; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; encrypt?: boolean; + description?: string; }; if ( @@ -5231,9 +5651,10 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; encrypt?: boolean; + description?: string; }; } else { params = { @@ -5241,9 +5662,10 @@ export class Databases { collectionId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as string, + xdefault: rest[3] as string | null, array: rest[4] as boolean, encrypt: rest[5] as boolean, + description: rest[6] as string, }; } @@ -5254,6 +5676,7 @@ export class Databases { const xdefault = params.xdefault; const array = params.array; const encrypt = params.encrypt; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -5296,6 +5719,9 @@ export class Databases { if (typeof encrypt !== 'undefined') { apiPayload['encrypt'] = encrypt; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -5311,6 +5737,7 @@ export class Databases { attributeLongtext: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -5332,8 +5759,9 @@ export class Databases { * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @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 {string} params.newKey - New Attribute Key. + * @param {string | null} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. + * @param {string | null} params.newKey - New Attribute Key. + * @param {string | null} params.description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeLongtext>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateLongtextColumn` instead. @@ -5343,8 +5771,9 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; }): Promise<Models.AttributeLongtext>; /** * Update a longtext attribute. Changing the `default` value will not update already existing documents. @@ -5354,8 +5783,9 @@ export class Databases { * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @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 {string} newKey - New Attribute Key. + * @param {string | null} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. + * @param {string | null} newKey - New Attribute Key. + * @param {string | null} description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeLongtext>} * @deprecated Use the object parameter style method for a better developer experience. @@ -5365,8 +5795,9 @@ export class Databases { collectionId: string, key: string, required: boolean, - xdefault?: string, - newKey?: string, + xdefault?: string | null, + newKey?: string | null, + description?: string | null, ): Promise<Models.AttributeLongtext>; updateLongtextAttribute( paramsOrFirst: @@ -5375,19 +5806,28 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; } | string, - ...rest: [string?, string?, boolean?, string?, string?] + ...rest: [ + string?, + string?, + boolean?, + (string | null)?, + (string | null)?, + (string | null)?, + ] ): Promise<Models.AttributeLongtext> { let params: { databaseId: string; collectionId: string; key: string; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; }; if ( @@ -5400,8 +5840,9 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; }; } else { params = { @@ -5409,8 +5850,9 @@ export class Databases { collectionId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as string, - newKey: rest[4] as string, + xdefault: rest[3] as string | null, + newKey: rest[4] as string | null, + description: rest[5] as string | null, }; } @@ -5420,6 +5862,7 @@ export class Databases { const required = params.required; const xdefault = params.xdefault; const newKey = params.newKey; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -5462,6 +5905,9 @@ export class Databases { if (typeof newKey !== 'undefined') { apiPayload['newKey'] = newKey; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -5477,6 +5923,7 @@ export class Databases { attributeLongtext: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -5498,9 +5945,10 @@ export class Databases { * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @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 {string | null} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. * @param {boolean} params.array - Is attribute an array? * @param {boolean} params.encrypt - Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried. + * @param {string} params.description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeMediumtext>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createMediumtextColumn` instead. @@ -5510,9 +5958,10 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; encrypt?: boolean; + description?: string; }): Promise<Models.AttributeMediumtext>; /** * Create a mediumtext attribute. @@ -5522,9 +5971,10 @@ export class Databases { * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @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 {string | null} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. * @param {boolean} array - Is attribute an array? * @param {boolean} encrypt - Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried. + * @param {string} description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeMediumtext>} * @deprecated Use the object parameter style method for a better developer experience. @@ -5534,9 +5984,10 @@ export class Databases { collectionId: string, key: string, required: boolean, - xdefault?: string, + xdefault?: string | null, array?: boolean, encrypt?: boolean, + description?: string, ): Promise<Models.AttributeMediumtext>; createMediumtextAttribute( paramsOrFirst: @@ -5545,21 +5996,31 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; encrypt?: boolean; + description?: string; } | string, - ...rest: [string?, string?, boolean?, string?, boolean?, boolean?] + ...rest: [ + string?, + string?, + boolean?, + (string | null)?, + boolean?, + boolean?, + string?, + ] ): Promise<Models.AttributeMediumtext> { let params: { databaseId: string; collectionId: string; key: string; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; encrypt?: boolean; + description?: string; }; if ( @@ -5572,9 +6033,10 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; encrypt?: boolean; + description?: string; }; } else { params = { @@ -5582,9 +6044,10 @@ export class Databases { collectionId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as string, + xdefault: rest[3] as string | null, array: rest[4] as boolean, encrypt: rest[5] as boolean, + description: rest[6] as string, }; } @@ -5595,6 +6058,7 @@ export class Databases { const xdefault = params.xdefault; const array = params.array; const encrypt = params.encrypt; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -5637,6 +6101,9 @@ export class Databases { if (typeof encrypt !== 'undefined') { apiPayload['encrypt'] = encrypt; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -5652,6 +6119,7 @@ export class Databases { attributeMediumtext: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -5673,8 +6141,9 @@ export class Databases { * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @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 {string} params.newKey - New Attribute Key. + * @param {string | null} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. + * @param {string | null} params.newKey - New Attribute Key. + * @param {string | null} params.description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeMediumtext>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateMediumtextColumn` instead. @@ -5684,8 +6153,9 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; }): Promise<Models.AttributeMediumtext>; /** * Update a mediumtext attribute. Changing the `default` value will not update already existing documents. @@ -5695,8 +6165,9 @@ export class Databases { * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @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 {string} newKey - New Attribute Key. + * @param {string | null} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. + * @param {string | null} newKey - New Attribute Key. + * @param {string | null} description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeMediumtext>} * @deprecated Use the object parameter style method for a better developer experience. @@ -5706,8 +6177,9 @@ export class Databases { collectionId: string, key: string, required: boolean, - xdefault?: string, - newKey?: string, + xdefault?: string | null, + newKey?: string | null, + description?: string | null, ): Promise<Models.AttributeMediumtext>; updateMediumtextAttribute( paramsOrFirst: @@ -5716,19 +6188,28 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; } | string, - ...rest: [string?, string?, boolean?, string?, string?] + ...rest: [ + string?, + string?, + boolean?, + (string | null)?, + (string | null)?, + (string | null)?, + ] ): Promise<Models.AttributeMediumtext> { let params: { databaseId: string; collectionId: string; key: string; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; }; if ( @@ -5741,8 +6222,9 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; }; } else { params = { @@ -5750,8 +6232,9 @@ export class Databases { collectionId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as string, - newKey: rest[4] as string, + xdefault: rest[3] as string | null, + newKey: rest[4] as string | null, + description: rest[5] as string | null, }; } @@ -5761,6 +6244,7 @@ export class Databases { const required = params.required; const xdefault = params.xdefault; const newKey = params.newKey; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -5803,6 +6287,9 @@ export class Databases { if (typeof newKey !== 'undefined') { apiPayload['newKey'] = newKey; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -5818,6 +6305,7 @@ export class Databases { attributeMediumtext: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -5838,7 +6326,8 @@ export class Databases { * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @param {string} params.key - Attribute Key. * @param {boolean} params.required - Is attribute required? - * @param {number[]} params.xdefault - Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required. + * @param {number[] | null} params.xdefault - Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required. + * @param {string} params.description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributePoint>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createPointColumn` instead. @@ -5848,7 +6337,8 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: number[]; + xdefault?: number[] | null; + description?: string; }): Promise<Models.AttributePoint>; /** * Create a geometric point attribute. @@ -5857,7 +6347,8 @@ export class Databases { * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @param {string} key - Attribute Key. * @param {boolean} required - Is attribute required? - * @param {number[]} xdefault - Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required. + * @param {number[] | null} xdefault - Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required. + * @param {string} description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributePoint>} * @deprecated Use the object parameter style method for a better developer experience. @@ -5867,7 +6358,8 @@ export class Databases { collectionId: string, key: string, required: boolean, - xdefault?: number[], + xdefault?: number[] | null, + description?: string, ): Promise<Models.AttributePoint>; createPointAttribute( paramsOrFirst: @@ -5876,17 +6368,19 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: number[]; + xdefault?: number[] | null; + description?: string; } | string, - ...rest: [string?, string?, boolean?, number[]?] + ...rest: [string?, string?, boolean?, (number[] | null)?, string?] ): Promise<Models.AttributePoint> { let params: { databaseId: string; collectionId: string; key: string; required: boolean; - xdefault?: number[]; + xdefault?: number[] | null; + description?: string; }; if ( @@ -5899,7 +6393,8 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: number[]; + xdefault?: number[] | null; + description?: string; }; } else { params = { @@ -5907,7 +6402,8 @@ export class Databases { collectionId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as number[], + xdefault: rest[3] as number[] | null, + description: rest[4] as string, }; } @@ -5916,6 +6412,7 @@ export class Databases { const key = params.key; const required = params.required; const xdefault = params.xdefault; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -5952,6 +6449,9 @@ export class Databases { if (typeof xdefault !== 'undefined') { apiPayload['default'] = xdefault; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -5967,6 +6467,7 @@ export class Databases { attributePoint: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -5987,8 +6488,9 @@ export class Databases { * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection). * @param {string} params.key - Attribute Key. * @param {boolean} params.required - Is attribute required? - * @param {number[]} params.xdefault - Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required. - * @param {string} params.newKey - New attribute key. + * @param {number[] | null} params.xdefault - Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required. + * @param {string | null} params.newKey - New attribute key. + * @param {string | null} params.description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributePoint>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updatePointColumn` instead. @@ -5998,8 +6500,9 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: number[]; - newKey?: string; + xdefault?: number[] | null; + newKey?: string | null; + description?: string | null; }): Promise<Models.AttributePoint>; /** * Update a point attribute. Changing the `default` value will not update already existing documents. @@ -6008,8 +6511,9 @@ export class Databases { * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection). * @param {string} key - Attribute Key. * @param {boolean} required - Is attribute required? - * @param {number[]} xdefault - Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required. - * @param {string} newKey - New attribute key. + * @param {number[] | null} xdefault - Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required. + * @param {string | null} newKey - New attribute key. + * @param {string | null} description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributePoint>} * @deprecated Use the object parameter style method for a better developer experience. @@ -6019,8 +6523,9 @@ export class Databases { collectionId: string, key: string, required: boolean, - xdefault?: number[], - newKey?: string, + xdefault?: number[] | null, + newKey?: string | null, + description?: string | null, ): Promise<Models.AttributePoint>; updatePointAttribute( paramsOrFirst: @@ -6029,19 +6534,28 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: number[]; - newKey?: string; + xdefault?: number[] | null; + newKey?: string | null; + description?: string | null; } | string, - ...rest: [string?, string?, boolean?, number[]?, string?] + ...rest: [ + string?, + string?, + boolean?, + (number[] | null)?, + (string | null)?, + (string | null)?, + ] ): Promise<Models.AttributePoint> { let params: { databaseId: string; collectionId: string; key: string; required: boolean; - xdefault?: number[]; - newKey?: string; + xdefault?: number[] | null; + newKey?: string | null; + description?: string | null; }; if ( @@ -6054,8 +6568,9 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: number[]; - newKey?: string; + xdefault?: number[] | null; + newKey?: string | null; + description?: string | null; }; } else { params = { @@ -6063,8 +6578,9 @@ export class Databases { collectionId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as number[], - newKey: rest[4] as string, + xdefault: rest[3] as number[] | null, + newKey: rest[4] as string | null, + description: rest[5] as string | null, }; } @@ -6074,6 +6590,7 @@ export class Databases { const required = params.required; const xdefault = params.xdefault; const newKey = params.newKey; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -6111,6 +6628,9 @@ export class Databases { if (typeof newKey !== 'undefined') { apiPayload['newKey'] = newKey; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -6126,6 +6646,7 @@ export class Databases { attributePoint: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -6146,7 +6667,8 @@ export class Databases { * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @param {string} params.key - Attribute Key. * @param {boolean} params.required - Is attribute required? - * @param {any[][]} params.xdefault - Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required. + * @param {any[][] | null} params.xdefault - Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required. + * @param {string} params.description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributePolygon>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createPolygonColumn` instead. @@ -6156,7 +6678,8 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: any[][]; + xdefault?: any[][] | null; + description?: string; }): Promise<Models.AttributePolygon>; /** * Create a geometric polygon attribute. @@ -6165,7 +6688,8 @@ export class Databases { * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @param {string} key - Attribute Key. * @param {boolean} required - Is attribute required? - * @param {any[][]} xdefault - Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required. + * @param {any[][] | null} xdefault - Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required. + * @param {string} description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributePolygon>} * @deprecated Use the object parameter style method for a better developer experience. @@ -6175,7 +6699,8 @@ export class Databases { collectionId: string, key: string, required: boolean, - xdefault?: any[][], + xdefault?: any[][] | null, + description?: string, ): Promise<Models.AttributePolygon>; createPolygonAttribute( paramsOrFirst: @@ -6184,17 +6709,19 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: any[][]; + xdefault?: any[][] | null; + description?: string; } | string, - ...rest: [string?, string?, boolean?, any[][]?] + ...rest: [string?, string?, boolean?, (any[][] | null)?, string?] ): Promise<Models.AttributePolygon> { let params: { databaseId: string; collectionId: string; key: string; required: boolean; - xdefault?: any[][]; + xdefault?: any[][] | null; + description?: string; }; if ( @@ -6207,7 +6734,8 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: any[][]; + xdefault?: any[][] | null; + description?: string; }; } else { params = { @@ -6215,7 +6743,8 @@ export class Databases { collectionId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as any[][], + xdefault: rest[3] as any[][] | null, + description: rest[4] as string, }; } @@ -6224,6 +6753,7 @@ export class Databases { const key = params.key; const required = params.required; const xdefault = params.xdefault; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -6260,6 +6790,9 @@ export class Databases { if (typeof xdefault !== 'undefined') { apiPayload['default'] = xdefault; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -6275,6 +6808,7 @@ export class Databases { attributePolygon: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -6295,8 +6829,9 @@ export class Databases { * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection). * @param {string} params.key - Attribute Key. * @param {boolean} params.required - Is attribute required? - * @param {any[][]} params.xdefault - Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required. - * @param {string} params.newKey - New attribute key. + * @param {any[][] | null} params.xdefault - Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required. + * @param {string | null} params.newKey - New attribute key. + * @param {string | null} params.description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributePolygon>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updatePolygonColumn` instead. @@ -6306,8 +6841,9 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: any[][]; - newKey?: string; + xdefault?: any[][] | null; + newKey?: string | null; + description?: string | null; }): Promise<Models.AttributePolygon>; /** * Update a polygon attribute. Changing the `default` value will not update already existing documents. @@ -6316,8 +6852,9 @@ export class Databases { * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection). * @param {string} key - Attribute Key. * @param {boolean} required - Is attribute required? - * @param {any[][]} xdefault - Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required. - * @param {string} newKey - New attribute key. + * @param {any[][] | null} xdefault - Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required. + * @param {string | null} newKey - New attribute key. + * @param {string | null} description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributePolygon>} * @deprecated Use the object parameter style method for a better developer experience. @@ -6327,8 +6864,9 @@ export class Databases { collectionId: string, key: string, required: boolean, - xdefault?: any[][], - newKey?: string, + xdefault?: any[][] | null, + newKey?: string | null, + description?: string | null, ): Promise<Models.AttributePolygon>; updatePolygonAttribute( paramsOrFirst: @@ -6337,19 +6875,28 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: any[][]; - newKey?: string; + xdefault?: any[][] | null; + newKey?: string | null; + description?: string | null; } | string, - ...rest: [string?, string?, boolean?, any[][]?, string?] + ...rest: [ + string?, + string?, + boolean?, + (any[][] | null)?, + (string | null)?, + (string | null)?, + ] ): Promise<Models.AttributePolygon> { let params: { databaseId: string; collectionId: string; key: string; required: boolean; - xdefault?: any[][]; - newKey?: string; + xdefault?: any[][] | null; + newKey?: string | null; + description?: string | null; }; if ( @@ -6362,8 +6909,9 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: any[][]; - newKey?: string; + xdefault?: any[][] | null; + newKey?: string | null; + description?: string | null; }; } else { params = { @@ -6371,8 +6919,9 @@ export class Databases { collectionId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as any[][], - newKey: rest[4] as string, + xdefault: rest[3] as any[][] | null, + newKey: rest[4] as string | null, + description: rest[5] as string | null, }; } @@ -6382,6 +6931,7 @@ export class Databases { const required = params.required; const xdefault = params.xdefault; const newKey = params.newKey; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -6419,6 +6969,9 @@ export class Databases { if (typeof newKey !== 'undefined') { apiPayload['newKey'] = newKey; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -6434,6 +6987,7 @@ export class Databases { attributePolygon: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -6456,9 +7010,10 @@ export class Databases { * @param {string} params.relatedCollectionId - Related Collection ID. * @param {RelationshipType} params.type - Relationship type. Possible values are: oneToOne, oneToMany, manyToOne, manyToMany. * @param {boolean} params.twoWay - Is Two Way? - * @param {string} params.key - Attribute Key. - * @param {string} params.twoWayKey - Two Way Attribute Key. + * @param {string | null} params.key - Attribute Key. + * @param {string | null} params.twoWayKey - Two Way Attribute Key. * @param {RelationMutate} params.onDelete - Delete constraint. Possible values are: cascade, restrict, setNull. + * @param {string} params.description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeRelationship>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createRelationshipColumn` instead. @@ -6469,9 +7024,10 @@ export class Databases { relatedCollectionId: string; type: RelationshipType; twoWay?: boolean; - key?: string; - twoWayKey?: string; + key?: string | null; + twoWayKey?: string | null; onDelete?: RelationMutate; + description?: string; }): Promise<Models.AttributeRelationship>; /** * Create relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes). @@ -6482,9 +7038,10 @@ export class Databases { * @param {string} relatedCollectionId - Related Collection ID. * @param {RelationshipType} type - Relationship type. Possible values are: oneToOne, oneToMany, manyToOne, manyToMany. * @param {boolean} twoWay - Is Two Way? - * @param {string} key - Attribute Key. - * @param {string} twoWayKey - Two Way Attribute Key. + * @param {string | null} key - Attribute Key. + * @param {string | null} twoWayKey - Two Way Attribute Key. * @param {RelationMutate} onDelete - Delete constraint. Possible values are: cascade, restrict, setNull. + * @param {string} description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeRelationship>} * @deprecated Use the object parameter style method for a better developer experience. @@ -6495,9 +7052,10 @@ export class Databases { relatedCollectionId: string, type: RelationshipType, twoWay?: boolean, - key?: string, - twoWayKey?: string, + key?: string | null, + twoWayKey?: string | null, onDelete?: RelationMutate, + description?: string, ): Promise<Models.AttributeRelationship>; createRelationshipAttribute( paramsOrFirst: @@ -6507,9 +7065,10 @@ export class Databases { relatedCollectionId: string; type: RelationshipType; twoWay?: boolean; - key?: string; - twoWayKey?: string; + key?: string | null; + twoWayKey?: string | null; onDelete?: RelationMutate; + description?: string; } | string, ...rest: [ @@ -6517,9 +7076,10 @@ export class Databases { string?, RelationshipType?, boolean?, - string?, - string?, + (string | null)?, + (string | null)?, RelationMutate?, + string?, ] ): Promise<Models.AttributeRelationship> { let params: { @@ -6528,9 +7088,10 @@ export class Databases { relatedCollectionId: string; type: RelationshipType; twoWay?: boolean; - key?: string; - twoWayKey?: string; + key?: string | null; + twoWayKey?: string | null; onDelete?: RelationMutate; + description?: string; }; if ( @@ -6544,9 +7105,10 @@ export class Databases { relatedCollectionId: string; type: RelationshipType; twoWay?: boolean; - key?: string; - twoWayKey?: string; + key?: string | null; + twoWayKey?: string | null; onDelete?: RelationMutate; + description?: string; }; } else { params = { @@ -6555,9 +7117,10 @@ export class Databases { relatedCollectionId: rest[1] as string, type: rest[2] as RelationshipType, twoWay: rest[3] as boolean, - key: rest[4] as string, - twoWayKey: rest[5] as string, + key: rest[4] as string | null, + twoWayKey: rest[5] as string | null, onDelete: rest[6] as RelationMutate, + description: rest[7] as string, }; } @@ -6569,6 +7132,7 @@ export class Databases { const key = params.key; const twoWayKey = params.twoWayKey; const onDelete = params.onDelete; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -6614,6 +7178,9 @@ export class Databases { if (typeof onDelete !== 'undefined') { apiPayload['onDelete'] = onDelete; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -6629,6 +7196,7 @@ export class Databases { attributeRelationship: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -6655,7 +7223,8 @@ export class Databases { * @param {string} params.collectionId - Collection ID. * @param {string} params.key - Attribute Key. * @param {RelationMutate} params.onDelete - Delete constraint. Possible values are: cascade, restrict, setNull. - * @param {string} params.newKey - New Attribute Key. + * @param {string | null} params.newKey - New Attribute Key. + * @param {string | null} params.description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeRelationship>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateRelationshipColumn` instead. @@ -6665,7 +7234,8 @@ export class Databases { collectionId: string; key: string; onDelete?: RelationMutate; - newKey?: string; + newKey?: string | null; + description?: string | null; }): Promise<Models.AttributeRelationship>; /** * Update relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes). @@ -6675,7 +7245,8 @@ export class Databases { * @param {string} collectionId - Collection ID. * @param {string} key - Attribute Key. * @param {RelationMutate} onDelete - Delete constraint. Possible values are: cascade, restrict, setNull. - * @param {string} newKey - New Attribute Key. + * @param {string | null} newKey - New Attribute Key. + * @param {string | null} description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeRelationship>} * @deprecated Use the object parameter style method for a better developer experience. @@ -6685,7 +7256,8 @@ export class Databases { collectionId: string, key: string, onDelete?: RelationMutate, - newKey?: string, + newKey?: string | null, + description?: string | null, ): Promise<Models.AttributeRelationship>; updateRelationshipAttribute( paramsOrFirst: @@ -6694,17 +7266,25 @@ export class Databases { collectionId: string; key: string; onDelete?: RelationMutate; - newKey?: string; + newKey?: string | null; + description?: string | null; } | string, - ...rest: [string?, string?, RelationMutate?, string?] + ...rest: [ + string?, + string?, + RelationMutate?, + (string | null)?, + (string | null)?, + ] ): Promise<Models.AttributeRelationship> { let params: { databaseId: string; collectionId: string; key: string; onDelete?: RelationMutate; - newKey?: string; + newKey?: string | null; + description?: string | null; }; if ( @@ -6717,7 +7297,8 @@ export class Databases { collectionId: string; key: string; onDelete?: RelationMutate; - newKey?: string; + newKey?: string | null; + description?: string | null; }; } else { params = { @@ -6725,7 +7306,8 @@ export class Databases { collectionId: rest[0] as string, key: rest[1] as string, onDelete: rest[2] as RelationMutate, - newKey: rest[3] as string, + newKey: rest[3] as string | null, + description: rest[4] as string | null, }; } @@ -6734,6 +7316,7 @@ export class Databases { const key = params.key; const onDelete = params.onDelete; const newKey = params.newKey; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -6763,6 +7346,9 @@ export class Databases { if (typeof newKey !== 'undefined') { apiPayload['newKey'] = newKey; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -6778,6 +7364,7 @@ export class Databases { attributeRelationship: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -6805,9 +7392,10 @@ export class Databases { * @param {string} params.key - Attribute Key. * @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 {string | null} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. * @param {boolean} params.array - Is attribute an array? * @param {boolean} params.encrypt - Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried. + * @param {string} params.description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeString>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createStringColumn` instead. @@ -6818,9 +7406,10 @@ export class Databases { key: string; size: number; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; encrypt?: boolean; + description?: string; }): Promise<Models.AttributeString>; /** * Create a string attribute. @@ -6831,9 +7420,10 @@ export class Databases { * @param {string} key - Attribute Key. * @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 {string | null} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. * @param {boolean} array - Is attribute an array? * @param {boolean} encrypt - Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried. + * @param {string} description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeString>} * @deprecated Use the object parameter style method for a better developer experience. @@ -6844,9 +7434,10 @@ export class Databases { key: string, size: number, required: boolean, - xdefault?: string, + xdefault?: string | null, array?: boolean, encrypt?: boolean, + description?: string, ): Promise<Models.AttributeString>; createStringAttribute( paramsOrFirst: @@ -6856,9 +7447,10 @@ export class Databases { key: string; size: number; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; encrypt?: boolean; + description?: string; } | string, ...rest: [ @@ -6866,9 +7458,10 @@ export class Databases { string?, number?, boolean?, - string?, + (string | null)?, boolean?, boolean?, + string?, ] ): Promise<Models.AttributeString> { let params: { @@ -6877,9 +7470,10 @@ export class Databases { key: string; size: number; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; encrypt?: boolean; + description?: string; }; if ( @@ -6893,9 +7487,10 @@ export class Databases { key: string; size: number; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; encrypt?: boolean; + description?: string; }; } else { params = { @@ -6904,9 +7499,10 @@ export class Databases { key: rest[1] as string, size: rest[2] as number, required: rest[3] as boolean, - xdefault: rest[4] as string, + xdefault: rest[4] as string | null, array: rest[5] as boolean, encrypt: rest[6] as boolean, + description: rest[7] as string, }; } @@ -6918,6 +7514,7 @@ export class Databases { const xdefault = params.xdefault; const array = params.array; const encrypt = params.encrypt; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -6966,6 +7563,9 @@ export class Databases { if (typeof encrypt !== 'undefined') { apiPayload['encrypt'] = encrypt; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -6981,6 +7581,7 @@ export class Databases { attributeString: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -7003,9 +7604,10 @@ export class Databases { * @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 {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 {string} params.newKey - New Attribute Key. + * @param {string | null} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. + * @param {number | null} params.size - Maximum size of the string attribute. + * @param {string | null} params.newKey - New Attribute Key. + * @param {string | null} params.description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeString>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateStringColumn` instead. @@ -7015,9 +7617,10 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: string; - size?: number; - newKey?: string; + xdefault?: string | null; + size?: number | null; + newKey?: string | null; + description?: string | null; }): Promise<Models.AttributeString>; /** * Update a string attribute. Changing the `default` value will not update already existing documents. @@ -7027,9 +7630,10 @@ export class Databases { * @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 {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 {string} newKey - New Attribute Key. + * @param {string | null} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. + * @param {number | null} size - Maximum size of the string attribute. + * @param {string | null} newKey - New Attribute Key. + * @param {string | null} description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeString>} * @deprecated Use the object parameter style method for a better developer experience. @@ -7039,9 +7643,10 @@ export class Databases { collectionId: string, key: string, required: boolean, - xdefault?: string, - size?: number, - newKey?: string, + xdefault?: string | null, + size?: number | null, + newKey?: string | null, + description?: string | null, ): Promise<Models.AttributeString>; updateStringAttribute( paramsOrFirst: @@ -7050,21 +7655,31 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: string; - size?: number; - newKey?: string; + xdefault?: string | null; + size?: number | null; + newKey?: string | null; + description?: string | null; } | string, - ...rest: [string?, string?, boolean?, string?, number?, string?] + ...rest: [ + string?, + string?, + boolean?, + (string | null)?, + (number | null)?, + (string | null)?, + (string | null)?, + ] ): Promise<Models.AttributeString> { let params: { databaseId: string; collectionId: string; key: string; required: boolean; - xdefault?: string; - size?: number; - newKey?: string; + xdefault?: string | null; + size?: number | null; + newKey?: string | null; + description?: string | null; }; if ( @@ -7077,9 +7692,10 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: string; - size?: number; - newKey?: string; + xdefault?: string | null; + size?: number | null; + newKey?: string | null; + description?: string | null; }; } else { params = { @@ -7087,9 +7703,10 @@ export class Databases { collectionId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as string, - size: rest[4] as number, - newKey: rest[5] as string, + xdefault: rest[3] as string | null, + size: rest[4] as number | null, + newKey: rest[5] as string | null, + description: rest[6] as string | null, }; } @@ -7100,6 +7717,7 @@ export class Databases { const xdefault = params.xdefault; const size = params.size; const newKey = params.newKey; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -7145,6 +7763,9 @@ export class Databases { if (typeof newKey !== 'undefined') { apiPayload['newKey'] = newKey; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -7160,6 +7781,7 @@ export class Databases { attributeString: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -7182,9 +7804,10 @@ export class Databases { * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @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 {string | null} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. * @param {boolean} params.array - Is attribute an array? * @param {boolean} params.encrypt - Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried. + * @param {string} params.description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeText>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createTextColumn` instead. @@ -7194,9 +7817,10 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; encrypt?: boolean; + description?: string; }): Promise<Models.AttributeText>; /** * Create a text attribute. @@ -7206,9 +7830,10 @@ export class Databases { * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @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 {string | null} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. * @param {boolean} array - Is attribute an array? * @param {boolean} encrypt - Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried. + * @param {string} description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeText>} * @deprecated Use the object parameter style method for a better developer experience. @@ -7218,9 +7843,10 @@ export class Databases { collectionId: string, key: string, required: boolean, - xdefault?: string, + xdefault?: string | null, array?: boolean, encrypt?: boolean, + description?: string, ): Promise<Models.AttributeText>; createTextAttribute( paramsOrFirst: @@ -7229,21 +7855,31 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; encrypt?: boolean; + description?: string; } | string, - ...rest: [string?, string?, boolean?, string?, boolean?, boolean?] + ...rest: [ + string?, + string?, + boolean?, + (string | null)?, + boolean?, + boolean?, + string?, + ] ): Promise<Models.AttributeText> { let params: { databaseId: string; collectionId: string; key: string; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; encrypt?: boolean; + description?: string; }; if ( @@ -7256,9 +7892,10 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; encrypt?: boolean; + description?: string; }; } else { params = { @@ -7266,9 +7903,10 @@ export class Databases { collectionId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as string, + xdefault: rest[3] as string | null, array: rest[4] as boolean, encrypt: rest[5] as boolean, + description: rest[6] as string, }; } @@ -7279,6 +7917,7 @@ export class Databases { const xdefault = params.xdefault; const array = params.array; const encrypt = params.encrypt; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -7321,6 +7960,9 @@ export class Databases { if (typeof encrypt !== 'undefined') { apiPayload['encrypt'] = encrypt; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -7336,6 +7978,7 @@ export class Databases { attributeText: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -7357,8 +8000,9 @@ export class Databases { * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @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 {string} params.newKey - New Attribute Key. + * @param {string | null} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. + * @param {string | null} params.newKey - New Attribute Key. + * @param {string | null} params.description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeText>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateTextColumn` instead. @@ -7368,8 +8012,9 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; }): Promise<Models.AttributeText>; /** * Update a text attribute. Changing the `default` value will not update already existing documents. @@ -7379,8 +8024,9 @@ export class Databases { * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @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 {string} newKey - New Attribute Key. + * @param {string | null} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. + * @param {string | null} newKey - New Attribute Key. + * @param {string | null} description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeText>} * @deprecated Use the object parameter style method for a better developer experience. @@ -7390,8 +8036,9 @@ export class Databases { collectionId: string, key: string, required: boolean, - xdefault?: string, - newKey?: string, + xdefault?: string | null, + newKey?: string | null, + description?: string | null, ): Promise<Models.AttributeText>; updateTextAttribute( paramsOrFirst: @@ -7400,19 +8047,28 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; } | string, - ...rest: [string?, string?, boolean?, string?, string?] + ...rest: [ + string?, + string?, + boolean?, + (string | null)?, + (string | null)?, + (string | null)?, + ] ): Promise<Models.AttributeText> { let params: { databaseId: string; collectionId: string; key: string; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; }; if ( @@ -7425,8 +8081,9 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; }; } else { params = { @@ -7434,8 +8091,9 @@ export class Databases { collectionId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as string, - newKey: rest[4] as string, + xdefault: rest[3] as string | null, + newKey: rest[4] as string | null, + description: rest[5] as string | null, }; } @@ -7445,6 +8103,7 @@ export class Databases { const required = params.required; const xdefault = params.xdefault; const newKey = params.newKey; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -7487,6 +8146,9 @@ export class Databases { if (typeof newKey !== 'undefined') { apiPayload['newKey'] = newKey; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -7502,6 +8164,7 @@ export class Databases { attributeText: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -7523,8 +8186,9 @@ export class Databases { * @param {string} params.collectionId - Collection ID. * @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 {string | null} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. * @param {boolean} params.array - Is attribute an array? + * @param {string} params.description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeUrl>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createUrlColumn` instead. @@ -7534,8 +8198,9 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; + description?: string; }): Promise<Models.AttributeUrl>; /** * Create a URL attribute. @@ -7545,8 +8210,9 @@ export class Databases { * @param {string} collectionId - Collection ID. * @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 {string | null} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. * @param {boolean} array - Is attribute an array? + * @param {string} description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeUrl>} * @deprecated Use the object parameter style method for a better developer experience. @@ -7556,8 +8222,9 @@ export class Databases { collectionId: string, key: string, required: boolean, - xdefault?: string, + xdefault?: string | null, array?: boolean, + description?: string, ): Promise<Models.AttributeUrl>; createUrlAttribute( paramsOrFirst: @@ -7566,19 +8233,28 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; + description?: string; } | string, - ...rest: [string?, string?, boolean?, string?, boolean?] + ...rest: [ + string?, + string?, + boolean?, + (string | null)?, + boolean?, + string?, + ] ): Promise<Models.AttributeUrl> { let params: { databaseId: string; collectionId: string; key: string; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; + description?: string; }; if ( @@ -7591,8 +8267,9 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; + description?: string; }; } else { params = { @@ -7600,8 +8277,9 @@ export class Databases { collectionId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as string, + xdefault: rest[3] as string | null, array: rest[4] as boolean, + description: rest[5] as string, }; } @@ -7611,6 +8289,7 @@ export class Databases { const required = params.required; const xdefault = params.xdefault; const array = params.array; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -7650,6 +8329,9 @@ export class Databases { if (typeof array !== 'undefined') { apiPayload['array'] = array; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -7665,6 +8347,7 @@ export class Databases { attributeUrl: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -7687,8 +8370,9 @@ export class Databases { * @param {string} params.collectionId - Collection ID. * @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 {string} params.newKey - New Attribute Key. + * @param {string | null} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. + * @param {string | null} params.newKey - New Attribute Key. + * @param {string | null} params.description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeUrl>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateUrlColumn` instead. @@ -7698,8 +8382,9 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; }): Promise<Models.AttributeUrl>; /** * Update an url attribute. Changing the `default` value will not update already existing documents. @@ -7709,8 +8394,9 @@ export class Databases { * @param {string} collectionId - Collection ID. * @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 {string} newKey - New Attribute Key. + * @param {string | null} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. + * @param {string | null} newKey - New Attribute Key. + * @param {string | null} description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeUrl>} * @deprecated Use the object parameter style method for a better developer experience. @@ -7720,8 +8406,9 @@ export class Databases { collectionId: string, key: string, required: boolean, - xdefault?: string, - newKey?: string, + xdefault?: string | null, + newKey?: string | null, + description?: string | null, ): Promise<Models.AttributeUrl>; updateUrlAttribute( paramsOrFirst: @@ -7730,19 +8417,28 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; } | string, - ...rest: [string?, string?, boolean?, string?, string?] + ...rest: [ + string?, + string?, + boolean?, + (string | null)?, + (string | null)?, + (string | null)?, + ] ): Promise<Models.AttributeUrl> { let params: { databaseId: string; collectionId: string; key: string; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; }; if ( @@ -7755,8 +8451,9 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; }; } else { params = { @@ -7764,8 +8461,9 @@ export class Databases { collectionId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as string, - newKey: rest[4] as string, + xdefault: rest[3] as string | null, + newKey: rest[4] as string | null, + description: rest[5] as string | null, }; } @@ -7775,6 +8473,7 @@ export class Databases { const required = params.required; const xdefault = params.xdefault; const newKey = params.newKey; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -7817,6 +8516,9 @@ export class Databases { if (typeof newKey !== 'undefined') { apiPayload['newKey'] = newKey; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -7832,6 +8534,7 @@ export class Databases { attributeUrl: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -7855,9 +8558,10 @@ export class Databases { * @param {string} params.key - Attribute Key. * @param {number} params.size - Attribute size for varchar attributes, in number of characters. Maximum size is 16381. * @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 {string | null} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. * @param {boolean} params.array - Is attribute an array? * @param {boolean} params.encrypt - Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried. + * @param {string} params.description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeVarchar>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createVarcharColumn` instead. @@ -7868,9 +8572,10 @@ export class Databases { key: string; size: number; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; encrypt?: boolean; + description?: string; }): Promise<Models.AttributeVarchar>; /** * Create a varchar attribute. @@ -7881,9 +8586,10 @@ export class Databases { * @param {string} key - Attribute Key. * @param {number} size - Attribute size for varchar attributes, in number of characters. Maximum size is 16381. * @param {boolean} required - Is attribute required? - * @param {string} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. + * @param {string | null} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. * @param {boolean} array - Is attribute an array? * @param {boolean} encrypt - Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried. + * @param {string} description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeVarchar>} * @deprecated Use the object parameter style method for a better developer experience. @@ -7894,9 +8600,10 @@ export class Databases { key: string, size: number, required: boolean, - xdefault?: string, + xdefault?: string | null, array?: boolean, encrypt?: boolean, + description?: string, ): Promise<Models.AttributeVarchar>; createVarcharAttribute( paramsOrFirst: @@ -7906,9 +8613,10 @@ export class Databases { key: string; size: number; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; encrypt?: boolean; + description?: string; } | string, ...rest: [ @@ -7916,9 +8624,10 @@ export class Databases { string?, number?, boolean?, - string?, + (string | null)?, boolean?, boolean?, + string?, ] ): Promise<Models.AttributeVarchar> { let params: { @@ -7927,9 +8636,10 @@ export class Databases { key: string; size: number; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; encrypt?: boolean; + description?: string; }; if ( @@ -7943,9 +8653,10 @@ export class Databases { key: string; size: number; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; encrypt?: boolean; + description?: string; }; } else { params = { @@ -7954,9 +8665,10 @@ export class Databases { key: rest[1] as string, size: rest[2] as number, required: rest[3] as boolean, - xdefault: rest[4] as string, + xdefault: rest[4] as string | null, array: rest[5] as boolean, encrypt: rest[6] as boolean, + description: rest[7] as string, }; } @@ -7968,6 +8680,7 @@ export class Databases { const xdefault = params.xdefault; const array = params.array; const encrypt = params.encrypt; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -8016,6 +8729,9 @@ export class Databases { if (typeof encrypt !== 'undefined') { apiPayload['encrypt'] = encrypt; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -8031,6 +8747,7 @@ export class Databases { attributeVarchar: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -8053,9 +8770,10 @@ export class Databases { * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @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 varchar attribute. - * @param {string} params.newKey - New Attribute Key. + * @param {string | null} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. + * @param {number | null} params.size - Maximum size of the varchar attribute. + * @param {string | null} params.newKey - New Attribute Key. + * @param {string | null} params.description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeVarchar>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateVarcharColumn` instead. @@ -8065,9 +8783,10 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: string; - size?: number; - newKey?: string; + xdefault?: string | null; + size?: number | null; + newKey?: string | null; + description?: string | null; }): Promise<Models.AttributeVarchar>; /** * Update a varchar attribute. Changing the `default` value will not update already existing documents. @@ -8077,9 +8796,10 @@ export class Databases { * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @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 varchar attribute. - * @param {string} newKey - New Attribute Key. + * @param {string | null} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required. + * @param {number | null} size - Maximum size of the varchar attribute. + * @param {string | null} newKey - New Attribute Key. + * @param {string | null} description - Optional description for the attribute. * @throws {AppwriteException} * @returns {Promise<Models.AttributeVarchar>} * @deprecated Use the object parameter style method for a better developer experience. @@ -8089,9 +8809,10 @@ export class Databases { collectionId: string, key: string, required: boolean, - xdefault?: string, - size?: number, - newKey?: string, + xdefault?: string | null, + size?: number | null, + newKey?: string | null, + description?: string | null, ): Promise<Models.AttributeVarchar>; updateVarcharAttribute( paramsOrFirst: @@ -8100,21 +8821,31 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: string; - size?: number; - newKey?: string; + xdefault?: string | null; + size?: number | null; + newKey?: string | null; + description?: string | null; } | string, - ...rest: [string?, string?, boolean?, string?, number?, string?] + ...rest: [ + string?, + string?, + boolean?, + (string | null)?, + (number | null)?, + (string | null)?, + (string | null)?, + ] ): Promise<Models.AttributeVarchar> { let params: { databaseId: string; collectionId: string; key: string; required: boolean; - xdefault?: string; - size?: number; - newKey?: string; + xdefault?: string | null; + size?: number | null; + newKey?: string | null; + description?: string | null; }; if ( @@ -8127,9 +8858,10 @@ export class Databases { collectionId: string; key: string; required: boolean; - xdefault?: string; - size?: number; - newKey?: string; + xdefault?: string | null; + size?: number | null; + newKey?: string | null; + description?: string | null; }; } else { params = { @@ -8137,9 +8869,10 @@ export class Databases { collectionId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as string, - size: rest[4] as number, - newKey: rest[5] as string, + xdefault: rest[3] as string | null, + size: rest[4] as number | null, + newKey: rest[5] as string | null, + description: rest[6] as string | null, }; } @@ -8150,6 +8883,7 @@ export class Databases { const xdefault = params.xdefault; const size = params.size; const newKey = params.newKey; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -8195,6 +8929,9 @@ export class Databases { if (typeof newKey !== 'undefined') { apiPayload['newKey'] = newKey; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -8210,6 +8947,7 @@ export class Databases { attributeVarchar: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -8467,12 +9205,14 @@ export class Databases { /** * Get a list of all the user's documents in a given collection. You can use the query params to filter your results. * + * Documents returned by aggregate, groupBy or distinct queries hold only the attributes they select, group or aggregate, typed as a document types them, with a joined attribute named by its join alias (`alias.attribute`). They have no `$id`, `$sequence`, `$createdAt`, `$updatedAt`, `$permissions`, `$databaseId` or `$collectionId` unless they select or group it, and neither does a right or full join document that no document of this collection matched. + * * @param {string} params.databaseId - Database ID. * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @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. * @param {string} params.transactionId - Transaction ID to read uncommitted changes within the transaction. * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. - * @param {number} params.ttl - TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, collection, schema version (attributes and indexes), caller authorization roles, and the exact query — so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; document writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Must be between 0 and 86400 (24 hours). + * @param {number} params.ttl - TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, collection, schema version (attributes and indexes), caller authorization roles, and the exact query — so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; document writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Lists with join queries are not cached. Must be between 0 and 86400 (24 hours). * @throws {AppwriteException} * @returns {Promise<Models.DocumentList<Document>>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.listRows` instead. @@ -8490,12 +9230,14 @@ export class Databases { /** * Get a list of all the user's documents in a given collection. You can use the query params to filter your results. * + * Documents returned by aggregate, groupBy or distinct queries hold only the attributes they select, group or aggregate, typed as a document types them, with a joined attribute named by its join alias (`alias.attribute`). They have no `$id`, `$sequence`, `$createdAt`, `$updatedAt`, `$permissions`, `$databaseId` or `$collectionId` unless they select or group it, and neither does a right or full join document that no document of this collection matched. + * * @param {string} databaseId - Database ID. * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @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. * @param {string} transactionId - Transaction ID to read uncommitted changes within the transaction. * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. - * @param {number} ttl - TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, collection, schema version (attributes and indexes), caller authorization roles, and the exact query — so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; document writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Must be between 0 and 86400 (24 hours). + * @param {number} ttl - TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, collection, schema version (attributes and indexes), caller authorization roles, and the exact query — so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; document writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Lists with join queries are not cached. Must be between 0 and 86400 (24 hours). * @throws {AppwriteException} * @returns {Promise<Models.DocumentList<Document>>} * @deprecated Use the object parameter style method for a better developer experience. @@ -8637,8 +9379,8 @@ export class Databases { * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents. * @param {string} params.documentId - Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. * @param {Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Omit<Document, keyof Models.Document>} params.data - Document data as JSON object. - * @param {string[]} params.permissions - An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param {string} params.transactionId - Transaction ID for staging the operation. + * @param {string[] | null} params.permissions - An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {string | null} params.transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise<Document>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createRow` instead. @@ -8652,8 +9394,8 @@ export class Databases { data: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Omit<Document, keyof Models.Document>; - permissions?: string[]; - transactionId?: string; + permissions?: string[] | null; + transactionId?: string | null; }): Promise<Document>; /** * Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. @@ -8662,8 +9404,8 @@ export class Databases { * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents. * @param {string} documentId - Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. * @param {Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Omit<Document, keyof Models.Document>} data - Document data as JSON object. - * @param {string[]} permissions - An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param {string} transactionId - Transaction ID for staging the operation. + * @param {string[] | null} permissions - An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {string | null} transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise<Document>} * @deprecated Use the object parameter style method for a better developer experience. @@ -8675,8 +9417,8 @@ export class Databases { data: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Omit<Document, keyof Models.Document>, - permissions?: string[], - transactionId?: string, + permissions?: string[] | null, + transactionId?: string | null, ): Promise<Document>; createDocument<Document extends Models.Document = Models.DefaultDocument>( paramsOrFirst: @@ -8688,8 +9430,8 @@ export class Databases { ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Omit<Document, keyof Models.Document>; - permissions?: string[]; - transactionId?: string; + permissions?: string[] | null; + transactionId?: string | null; } | string, ...rest: [ @@ -8699,8 +9441,8 @@ export class Databases { ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Omit<Document, keyof Models.Document>)?, - string[]?, - string?, + (string[] | null)?, + (string | null)?, ] ): Promise<Document> { let params: { @@ -8711,8 +9453,8 @@ export class Databases { ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Omit<Document, keyof Models.Document>; - permissions?: string[]; - transactionId?: string; + permissions?: string[] | null; + transactionId?: string | null; }; if ( @@ -8728,8 +9470,8 @@ export class Databases { ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Omit<Document, keyof Models.Document>; - permissions?: string[]; - transactionId?: string; + permissions?: string[] | null; + transactionId?: string | null; }; } else { params = { @@ -8740,8 +9482,8 @@ export class Databases { ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Omit<Document, keyof Models.Document>, - permissions: rest[3] as string[], - transactionId: rest[4] as string, + permissions: rest[3] as string[] | null, + transactionId: rest[4] as string | null, }; } @@ -8825,7 +9567,7 @@ export class Databases { * @param {string} params.databaseId - Database ID. * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents. * @param {object[]} params.documents - Array of documents data as JSON objects. - * @param {string} params.transactionId - Transaction ID for staging the operation. + * @param {string | null} params.transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise<Models.DocumentList<Document>>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createRows` instead. @@ -8836,7 +9578,7 @@ export class Databases { databaseId: string; collectionId: string; documents: object[]; - transactionId?: string; + transactionId?: string | null; }): Promise<Models.DocumentList<Document>>; /** * Create new Documents. 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. @@ -8844,7 +9586,7 @@ export class Databases { * @param {string} databaseId - Database ID. * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents. * @param {object[]} documents - Array of documents data as JSON objects. - * @param {string} transactionId - Transaction ID for staging the operation. + * @param {string | null} transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise<Models.DocumentList<Document>>} * @deprecated Use the object parameter style method for a better developer experience. @@ -8853,7 +9595,7 @@ export class Databases { databaseId: string, collectionId: string, documents: object[], - transactionId?: string, + transactionId?: string | null, ): Promise<Models.DocumentList<Document>>; createDocuments<Document extends Models.Document = Models.DefaultDocument>( paramsOrFirst: @@ -8861,16 +9603,16 @@ export class Databases { databaseId: string; collectionId: string; documents: object[]; - transactionId?: string; + transactionId?: string | null; } | string, - ...rest: [string?, object[]?, string?] + ...rest: [string?, object[]?, (string | null)?] ): Promise<Models.DocumentList<Document>> { let params: { databaseId: string; collectionId: string; documents: object[]; - transactionId?: string; + transactionId?: string | null; }; if ( @@ -8882,14 +9624,14 @@ export class Databases { databaseId: string; collectionId: string; documents: object[]; - transactionId?: string; + transactionId?: string | null; }; } else { params = { databaseId: paramsOrFirst as string, collectionId: rest[0] as string, documents: rest[1] as object[], - transactionId: rest[2] as string, + transactionId: rest[2] as string | null, }; } @@ -8974,7 +9716,7 @@ export class Databases { * @param {string} params.databaseId - Database ID. * @param {string} params.collectionId - Collection ID. * @param {object[]} params.documents - Array of document data as JSON objects. May contain partial documents. - * @param {string} params.transactionId - Transaction ID for staging the operation. + * @param {string | null} params.transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise<Models.DocumentList<Document>>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.upsertRows` instead. @@ -8985,7 +9727,7 @@ export class Databases { databaseId: string; collectionId: string; documents: object[]; - transactionId?: string; + transactionId?: string | null; }): Promise<Models.DocumentList<Document>>; /** * Create or update Documents. 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. @@ -8994,7 +9736,7 @@ export class Databases { * @param {string} databaseId - Database ID. * @param {string} collectionId - Collection ID. * @param {object[]} documents - Array of document data as JSON objects. May contain partial documents. - * @param {string} transactionId - Transaction ID for staging the operation. + * @param {string | null} transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise<Models.DocumentList<Document>>} * @deprecated Use the object parameter style method for a better developer experience. @@ -9003,7 +9745,7 @@ export class Databases { databaseId: string, collectionId: string, documents: object[], - transactionId?: string, + transactionId?: string | null, ): Promise<Models.DocumentList<Document>>; upsertDocuments<Document extends Models.Document = Models.DefaultDocument>( paramsOrFirst: @@ -9011,16 +9753,16 @@ export class Databases { databaseId: string; collectionId: string; documents: object[]; - transactionId?: string; + transactionId?: string | null; } | string, - ...rest: [string?, object[]?, string?] + ...rest: [string?, object[]?, (string | null)?] ): Promise<Models.DocumentList<Document>> { let params: { databaseId: string; collectionId: string; documents: object[]; - transactionId?: string; + transactionId?: string | null; }; if ( @@ -9032,14 +9774,14 @@ export class Databases { databaseId: string; collectionId: string; documents: object[]; - transactionId?: string; + transactionId?: string | null; }; } else { params = { databaseId: paramsOrFirst as string, collectionId: rest[0] as string, documents: rest[1] as object[], - transactionId: rest[2] as string, + transactionId: rest[2] as string | null, }; } @@ -9124,7 +9866,7 @@ export class Databases { * @param {string} params.collectionId - Collection ID. * @param {object} params.data - Document data as JSON object. Include only attribute and value pairs to be updated. * @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. - * @param {string} params.transactionId - Transaction ID for staging the operation. + * @param {string | null} params.transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise<Models.DocumentList<Document>>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateRows` instead. @@ -9136,7 +9878,7 @@ export class Databases { collectionId: string; data?: object; queries?: string[]; - transactionId?: string; + transactionId?: string | null; }): Promise<Models.DocumentList<Document>>; /** * Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated. @@ -9145,7 +9887,7 @@ export class Databases { * @param {string} collectionId - Collection ID. * @param {object} data - Document data as JSON object. Include only attribute and value pairs to be updated. * @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. - * @param {string} transactionId - Transaction ID for staging the operation. + * @param {string | null} transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise<Models.DocumentList<Document>>} * @deprecated Use the object parameter style method for a better developer experience. @@ -9155,7 +9897,7 @@ export class Databases { collectionId: string, data?: object, queries?: string[], - transactionId?: string, + transactionId?: string | null, ): Promise<Models.DocumentList<Document>>; updateDocuments<Document extends Models.Document = Models.DefaultDocument>( paramsOrFirst: @@ -9164,17 +9906,17 @@ export class Databases { collectionId: string; data?: object; queries?: string[]; - transactionId?: string; + transactionId?: string | null; } | string, - ...rest: [string?, object?, string[]?, string?] + ...rest: [string?, object?, string[]?, (string | null)?] ): Promise<Models.DocumentList<Document>> { let params: { databaseId: string; collectionId: string; data?: object; queries?: string[]; - transactionId?: string; + transactionId?: string | null; }; if ( @@ -9187,7 +9929,7 @@ export class Databases { collectionId: string; data?: object; queries?: string[]; - transactionId?: string; + transactionId?: string | null; }; } else { params = { @@ -9195,7 +9937,7 @@ export class Databases { collectionId: rest[0] as string, data: rest[1] as object, queries: rest[2] as string[], - transactionId: rest[3] as string, + transactionId: rest[3] as string | null, }; } @@ -9415,6 +10157,175 @@ export class Databases { return request.then((response) => applyDefaults(response, defaults)); } + /** + * Get a list of all the user's documents in a given collection using a POST request. This behaves identically to the list documents endpoint but accepts the queries in the request body, allowing much larger `queries` arrays than can fit in a URL query string. + * + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @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. + * @param {string | null} params.transactionId - Transaction ID to read uncommitted changes within the transaction. + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. + * @param {number} params.ttl - TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, collection, schema version (attributes and indexes), caller authorization roles, and the exact query — so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; document writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Lists with join queries are not cached. Must be between 0 and 86400 (24 hours). + * @throws {AppwriteException} + * @returns {Promise<Models.DocumentList<Document>>} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createQuery` instead. + */ + createQuery< + Document extends Models.Document = Models.DefaultDocument, + >(params: { + databaseId: string; + collectionId: string; + queries?: string[]; + transactionId?: string | null; + total?: boolean; + ttl?: number; + }): Promise<Models.DocumentList<Document>>; + /** + * Get a list of all the user's documents in a given collection using a POST request. This behaves identically to the list documents endpoint but accepts the queries in the request body, allowing much larger `queries` arrays than can fit in a URL query string. + * + * + * @param {string} databaseId - Database ID. + * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @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. + * @param {string | null} transactionId - Transaction ID to read uncommitted changes within the transaction. + * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. + * @param {number} ttl - TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, collection, schema version (attributes and indexes), caller authorization roles, and the exact query — so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; document writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Lists with join queries are not cached. Must be between 0 and 86400 (24 hours). + * @throws {AppwriteException} + * @returns {Promise<Models.DocumentList<Document>>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createQuery<Document extends Models.Document = Models.DefaultDocument>( + databaseId: string, + collectionId: string, + queries?: string[], + transactionId?: string | null, + total?: boolean, + ttl?: number, + ): Promise<Models.DocumentList<Document>>; + createQuery<Document extends Models.Document = Models.DefaultDocument>( + paramsOrFirst: + | { + databaseId: string; + collectionId: string; + queries?: string[]; + transactionId?: string | null; + total?: boolean; + ttl?: number; + } + | string, + ...rest: [string?, string[]?, (string | null)?, boolean?, number?] + ): Promise<Models.DocumentList<Document>> { + let params: { + databaseId: string; + collectionId: string; + queries?: string[]; + transactionId?: string | null; + total?: boolean; + ttl?: number; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + databaseId: string; + collectionId: string; + queries?: string[]; + transactionId?: string | null; + total?: boolean; + ttl?: number; + }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + queries: rest[1] as string[], + transactionId: rest[2] as string | null, + total: rest[3] as boolean, + ttl: rest[4] as number, + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const queries = params.queries; + const transactionId = params.transactionId; + const total = params.total; + const ttl = params.ttl; + + if (typeof databaseId === 'undefined' || databaseId === '') { + throw new AppwriteException( + 'Missing required parameter: "databaseId"', + ); + } + if (typeof collectionId === 'undefined' || collectionId === '') { + throw new AppwriteException( + 'Missing required parameter: "collectionId"', + ); + } + const apiPath = + '/databases/{databaseId}/collections/{collectionId}/documents/query' + .replace('{databaseId}', encodeURIComponent(String(databaseId))) + .replace( + '{collectionId}', + encodeURIComponent(String(collectionId)), + ); + const apiPayload: Payload = {}; + if (typeof queries !== 'undefined') { + apiPayload['queries'] = queries; + } + if (typeof transactionId !== 'undefined') { + apiPayload['transactionId'] = transactionId; + } + if (typeof total !== 'undefined') { + apiPayload['total'] = total; + } + if (typeof ttl !== 'undefined') { + apiPayload['ttl'] = ttl; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }; + + const request = this.client.call('post', uri, apiHeaders, apiPayload); + const defaults = { + root: 'documentList', + models: { + documentList: { + defaults: { + total: 0, + documents: [], + }, + properties: { + documents: { + items: 'document', + }, + }, + }, + document: { + defaults: { + $id: '', + $sequence: '', + $collectionId: '', + $databaseId: '', + $createdAt: '', + $updatedAt: '', + $permissions: [], + }, + }, + }, + }; + + return request.then((response) => applyDefaults(response, defaults)); + } + /** * Get a document by its unique ID. This endpoint response returns a JSON object with the document data. * @@ -9571,8 +10482,8 @@ export class Databases { * @param {string} params.collectionId - Collection ID. * @param {string} params.documentId - Document ID. * @param {Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>} params.data - Document data as JSON object. Include all required attributes of the document to be created or updated. - * @param {string[]} params.permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param {string} params.transactionId - Transaction ID for staging the operation. + * @param {string[] | null} params.permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {string | null} params.transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise<Document>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.upsertRow` instead. @@ -9587,8 +10498,8 @@ export class Databases { ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>; - permissions?: string[]; - transactionId?: string; + permissions?: string[] | null; + transactionId?: string | null; }): Promise<Document>; /** * 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. @@ -9597,8 +10508,8 @@ export class Databases { * @param {string} collectionId - Collection ID. * @param {string} documentId - Document ID. * @param {Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>} data - Document data as JSON object. Include all required attributes of the document to be created or updated. - * @param {string[]} permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param {string} transactionId - Transaction ID for staging the operation. + * @param {string[] | null} permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {string | null} transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise<Document>} * @deprecated Use the object parameter style method for a better developer experience. @@ -9611,8 +10522,8 @@ export class Databases { ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>, - permissions?: string[], - transactionId?: string, + permissions?: string[] | null, + transactionId?: string | null, ): Promise<Document>; upsertDocument<Document extends Models.Document = Models.DefaultDocument>( paramsOrFirst: @@ -9624,8 +10535,8 @@ export class Databases { ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>; - permissions?: string[]; - transactionId?: string; + permissions?: string[] | null; + transactionId?: string | null; } | string, ...rest: [ @@ -9635,8 +10546,8 @@ export class Databases { ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>)?, - string[]?, - string?, + (string[] | null)?, + (string | null)?, ] ): Promise<Document> { let params: { @@ -9647,8 +10558,8 @@ export class Databases { ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>; - permissions?: string[]; - transactionId?: string; + permissions?: string[] | null; + transactionId?: string | null; }; if ( @@ -9664,8 +10575,8 @@ export class Databases { ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>; - permissions?: string[]; - transactionId?: string; + permissions?: string[] | null; + transactionId?: string | null; }; } else { params = { @@ -9676,8 +10587,8 @@ export class Databases { ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>, - permissions: rest[3] as string[], - transactionId: rest[4] as string, + permissions: rest[3] as string[] | null, + transactionId: rest[4] as string | null, }; } @@ -9760,8 +10671,8 @@ export class Databases { * @param {string} params.collectionId - Collection ID. * @param {string} params.documentId - Document ID. * @param {Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>} params.data - Document data as JSON object. Include only attribute and value pairs to be updated. - * @param {string[]} params.permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param {string} params.transactionId - Transaction ID for staging the operation. + * @param {string[] | null} params.permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {string | null} params.transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise<Document>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateRow` instead. @@ -9776,8 +10687,8 @@ export class Databases { ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>; - permissions?: string[]; - transactionId?: string; + permissions?: string[] | null; + transactionId?: string | null; }): Promise<Document>; /** * Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated. @@ -9786,8 +10697,8 @@ export class Databases { * @param {string} collectionId - Collection ID. * @param {string} documentId - Document ID. * @param {Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>} data - Document data as JSON object. Include only attribute and value pairs to be updated. - * @param {string[]} permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param {string} transactionId - Transaction ID for staging the operation. + * @param {string[] | null} permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {string | null} transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise<Document>} * @deprecated Use the object parameter style method for a better developer experience. @@ -9800,8 +10711,8 @@ export class Databases { ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>, - permissions?: string[], - transactionId?: string, + permissions?: string[] | null, + transactionId?: string | null, ): Promise<Document>; updateDocument<Document extends Models.Document = Models.DefaultDocument>( paramsOrFirst: @@ -9813,8 +10724,8 @@ export class Databases { ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>; - permissions?: string[]; - transactionId?: string; + permissions?: string[] | null; + transactionId?: string | null; } | string, ...rest: [ @@ -9824,8 +10735,8 @@ export class Databases { ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>)?, - string[]?, - string?, + (string[] | null)?, + (string | null)?, ] ): Promise<Document> { let params: { @@ -9836,8 +10747,8 @@ export class Databases { ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>; - permissions?: string[]; - transactionId?: string; + permissions?: string[] | null; + transactionId?: string | null; }; if ( @@ -9853,8 +10764,8 @@ export class Databases { ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>; - permissions?: string[]; - transactionId?: string; + permissions?: string[] | null; + transactionId?: string | null; }; } else { params = { @@ -9865,8 +10776,8 @@ export class Databases { ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>, - permissions: rest[3] as string[], - transactionId: rest[4] as string, + permissions: rest[3] as string[] | null, + transactionId: rest[4] as string | null, }; } @@ -10068,8 +10979,8 @@ export class Databases { * @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 {string} params.transactionId - Transaction ID for staging the operation. + * @param {number | null} params.min - Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown. + * @param {string | null} params.transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise<Document>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.decrementRowColumn` instead. @@ -10082,8 +10993,8 @@ export class Databases { documentId: string; attribute: string; value?: number; - min?: number; - transactionId?: string; + min?: number | null; + transactionId?: string | null; }): Promise<Document>; /** * Decrement a specific attribute of a document by a given value. @@ -10093,8 +11004,8 @@ export class Databases { * @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 {string} transactionId - Transaction ID for staging the operation. + * @param {number | null} min - Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown. + * @param {string | null} transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise<Document>} * @deprecated Use the object parameter style method for a better developer experience. @@ -10107,8 +11018,8 @@ export class Databases { documentId: string, attribute: string, value?: number, - min?: number, - transactionId?: string, + min?: number | null, + transactionId?: string | null, ): Promise<Document>; decrementDocumentAttribute< Document extends Models.Document = Models.DefaultDocument, @@ -10120,11 +11031,18 @@ export class Databases { documentId: string; attribute: string; value?: number; - min?: number; - transactionId?: string; + min?: number | null; + transactionId?: string | null; } | string, - ...rest: [string?, string?, string?, number?, number?, string?] + ...rest: [ + string?, + string?, + string?, + number?, + (number | null)?, + (string | null)?, + ] ): Promise<Document> { let params: { databaseId: string; @@ -10132,8 +11050,8 @@ export class Databases { documentId: string; attribute: string; value?: number; - min?: number; - transactionId?: string; + min?: number | null; + transactionId?: string | null; }; if ( @@ -10147,8 +11065,8 @@ export class Databases { documentId: string; attribute: string; value?: number; - min?: number; - transactionId?: string; + min?: number | null; + transactionId?: string | null; }; } else { params = { @@ -10157,8 +11075,8 @@ export class Databases { documentId: rest[1] as string, attribute: rest[2] as string, value: rest[3] as number, - min: rest[4] as number, - transactionId: rest[5] as string, + min: rest[4] as number | null, + transactionId: rest[5] as string | null, }; } @@ -10246,8 +11164,8 @@ export class Databases { * @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 {string} params.transactionId - Transaction ID for staging the operation. + * @param {number | null} params.max - Maximum value for the attribute. If the current value is greater than this value, an error will be thrown. + * @param {string | null} params.transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise<Document>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.incrementRowColumn` instead. @@ -10260,8 +11178,8 @@ export class Databases { documentId: string; attribute: string; value?: number; - max?: number; - transactionId?: string; + max?: number | null; + transactionId?: string | null; }): Promise<Document>; /** * Increment a specific attribute of a document by a given value. @@ -10271,8 +11189,8 @@ export class Databases { * @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 {string} transactionId - Transaction ID for staging the operation. + * @param {number | null} max - Maximum value for the attribute. If the current value is greater than this value, an error will be thrown. + * @param {string | null} transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise<Document>} * @deprecated Use the object parameter style method for a better developer experience. @@ -10285,8 +11203,8 @@ export class Databases { documentId: string, attribute: string, value?: number, - max?: number, - transactionId?: string, + max?: number | null, + transactionId?: string | null, ): Promise<Document>; incrementDocumentAttribute< Document extends Models.Document = Models.DefaultDocument, @@ -10298,11 +11216,18 @@ export class Databases { documentId: string; attribute: string; value?: number; - max?: number; - transactionId?: string; + max?: number | null; + transactionId?: string | null; } | string, - ...rest: [string?, string?, string?, number?, number?, string?] + ...rest: [ + string?, + string?, + string?, + number?, + (number | null)?, + (string | null)?, + ] ): Promise<Document> { let params: { databaseId: string; @@ -10310,8 +11235,8 @@ export class Databases { documentId: string; attribute: string; value?: number; - max?: number; - transactionId?: string; + max?: number | null; + transactionId?: string | null; }; if ( @@ -10325,8 +11250,8 @@ export class Databases { documentId: string; attribute: string; value?: number; - max?: number; - transactionId?: string; + max?: number | null; + transactionId?: string | null; }; } else { params = { @@ -10335,8 +11260,8 @@ export class Databases { documentId: rest[1] as string, attribute: rest[2] as string, value: rest[3] as number, - max: rest[4] as number, - transactionId: rest[5] as string, + max: rest[4] as number | null, + transactionId: rest[5] as string | null, }; } @@ -10545,6 +11470,7 @@ export class Databases { $createdAt: '', $updatedAt: '', key: '', + description: '', type: '', error: '', attributes: [], @@ -10568,6 +11494,7 @@ export class Databases { * @param {string[]} params.attributes - Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long. * @param {OrderBy[]} params.orders - Array of index orders. Maximum of 100 orders are allowed. * @param {number[]} params.lengths - Length of index. Maximum of 100 + * @param {string} params.description - Optional description for the index. * @throws {AppwriteException} * @returns {Promise<Models.Index>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createIndex` instead. @@ -10580,6 +11507,7 @@ export class Databases { attributes: string[]; orders?: OrderBy[]; lengths?: number[]; + description?: string; }): Promise<Models.Index>; /** * Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request. @@ -10592,6 +11520,7 @@ export class Databases { * @param {string[]} attributes - Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long. * @param {OrderBy[]} orders - Array of index orders. Maximum of 100 orders are allowed. * @param {number[]} lengths - Length of index. Maximum of 100 + * @param {string} description - Optional description for the index. * @throws {AppwriteException} * @returns {Promise<Models.Index>} * @deprecated Use the object parameter style method for a better developer experience. @@ -10604,6 +11533,7 @@ export class Databases { attributes: string[], orders?: OrderBy[], lengths?: number[], + description?: string, ): Promise<Models.Index>; createIndex( paramsOrFirst: @@ -10615,6 +11545,7 @@ export class Databases { attributes: string[]; orders?: OrderBy[]; lengths?: number[]; + description?: string; } | string, ...rest: [ @@ -10624,6 +11555,7 @@ export class Databases { string[]?, OrderBy[]?, number[]?, + string?, ] ): Promise<Models.Index> { let params: { @@ -10634,6 +11566,7 @@ export class Databases { attributes: string[]; orders?: OrderBy[]; lengths?: number[]; + description?: string; }; if ( @@ -10649,6 +11582,7 @@ export class Databases { attributes: string[]; orders?: OrderBy[]; lengths?: number[]; + description?: string; }; } else { params = { @@ -10659,6 +11593,7 @@ export class Databases { attributes: rest[3] as string[], orders: rest[4] as OrderBy[], lengths: rest[5] as number[], + description: rest[6] as string, }; } @@ -10669,6 +11604,7 @@ export class Databases { const attributes = params.attributes; const orders = params.orders; const lengths = params.lengths; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -10714,6 +11650,9 @@ export class Databases { if (typeof lengths !== 'undefined') { apiPayload['lengths'] = lengths; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -10732,6 +11671,7 @@ export class Databases { $createdAt: '', $updatedAt: '', key: '', + description: '', type: '', error: '', attributes: [], @@ -10842,6 +11782,7 @@ export class Databases { $createdAt: '', $updatedAt: '', key: '', + description: '', type: '', error: '', attributes: [], diff --git a/src/services/documents-db.ts b/src/services/documents-db.ts index 06731379..9faca461 100644 --- a/src/services/documents-db.ts +++ b/src/services/documents-db.ts @@ -97,6 +97,7 @@ export class DocumentsDB { defaults: { $id: '', name: '', + description: '', $createdAt: '', $updatedAt: '', enabled: true, @@ -150,9 +151,10 @@ export class DocumentsDB { * @param {string} params.databaseId - 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.name - Database name. Max length: 128 chars. * @param {boolean} params.enabled - Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. + * @param {string} params.description - Optional description for the database. * @param {string} params.specification - Database specification. Defaults to `serverless`, which creates the database on the shared pool. Any other value provisions a dedicated database on that specification. * @param {number} params.replicas - Number of high availability replicas (0-5) for the dedicated database backing this database. Requires a dedicated `specification`; must be 0 for a serverless database. High availability is enabled when greater than 0. - * @param {string} params.syncMode - Replication sync mode for the dedicated database backing this database. Requires a dedicated `specification`; the mode is only in force once there is at least one replica. Allowed values: async, sync, quorum. + * @param {string | null} params.syncMode - Replication sync mode for the dedicated database backing this database. Requires a dedicated `specification`; the mode is only in force once there is at least one replica. Allowed values: async, sync, quorum. * @throws {AppwriteException} * @returns {Promise<Models.Database>} */ @@ -160,9 +162,10 @@ export class DocumentsDB { databaseId: string; name: string; enabled?: boolean; + description?: string; specification?: string; replicas?: number; - syncMode?: string; + syncMode?: string | null; }): Promise<Models.Database>; /** * Create a new Database. @@ -171,9 +174,10 @@ export class DocumentsDB { * @param {string} databaseId - 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} name - Database name. Max length: 128 chars. * @param {boolean} enabled - Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. + * @param {string} description - Optional description for the database. * @param {string} specification - Database specification. Defaults to `serverless`, which creates the database on the shared pool. Any other value provisions a dedicated database on that specification. * @param {number} replicas - Number of high availability replicas (0-5) for the dedicated database backing this database. Requires a dedicated `specification`; must be 0 for a serverless database. High availability is enabled when greater than 0. - * @param {string} syncMode - Replication sync mode for the dedicated database backing this database. Requires a dedicated `specification`; the mode is only in force once there is at least one replica. Allowed values: async, sync, quorum. + * @param {string | null} syncMode - Replication sync mode for the dedicated database backing this database. Requires a dedicated `specification`; the mode is only in force once there is at least one replica. Allowed values: async, sync, quorum. * @throws {AppwriteException} * @returns {Promise<Models.Database>} * @deprecated Use the object parameter style method for a better developer experience. @@ -182,9 +186,10 @@ export class DocumentsDB { databaseId: string, name: string, enabled?: boolean, + description?: string, specification?: string, replicas?: number, - syncMode?: string, + syncMode?: string | null, ): Promise<Models.Database>; create( paramsOrFirst: @@ -192,20 +197,29 @@ export class DocumentsDB { databaseId: string; name: string; enabled?: boolean; + description?: string; specification?: string; replicas?: number; - syncMode?: string; + syncMode?: string | null; } | string, - ...rest: [string?, boolean?, string?, number?, string?] + ...rest: [ + string?, + boolean?, + string?, + string?, + number?, + (string | null)?, + ] ): Promise<Models.Database> { let params: { databaseId: string; name: string; enabled?: boolean; + description?: string; specification?: string; replicas?: number; - syncMode?: string; + syncMode?: string | null; }; if ( @@ -217,24 +231,27 @@ export class DocumentsDB { databaseId: string; name: string; enabled?: boolean; + description?: string; specification?: string; replicas?: number; - syncMode?: string; + syncMode?: string | null; }; } else { params = { databaseId: paramsOrFirst as string, name: rest[0] as string, enabled: rest[1] as boolean, - specification: rest[2] as string, - replicas: rest[3] as number, - syncMode: rest[4] as string, + description: rest[2] as string, + specification: rest[3] as string, + replicas: rest[4] as number, + syncMode: rest[5] as string | null, }; } const databaseId = params.databaseId; const name = params.name; const enabled = params.enabled; + const description = params.description; const specification = params.specification; const replicas = params.replicas; const syncMode = params.syncMode; @@ -258,6 +275,9 @@ export class DocumentsDB { if (typeof enabled !== 'undefined') { apiPayload['enabled'] = enabled; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } if (typeof specification !== 'undefined') { apiPayload['specification'] = specification; } @@ -283,6 +303,7 @@ export class DocumentsDB { defaults: { $id: '', name: '', + description: '', $createdAt: '', $updatedAt: '', enabled: true, @@ -850,6 +871,7 @@ export class DocumentsDB { defaults: { $id: '', name: '', + description: '', $createdAt: '', $updatedAt: '', enabled: true, @@ -902,9 +924,10 @@ export class DocumentsDB { * @param {string} params.databaseId - Database ID. * @param {string} params.name - Database name. Max length: 128 chars. * @param {boolean} params.enabled - Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. - * @param {string} params.specification - Database specification. Resizing between dedicated specifications changes cpu, memory, storage and the connection ceiling via a rolling cutover with zero downtime. Moving a `serverless` database onto a dedicated specification is a data migration, not a resize. - * @param {number} params.replicas - Number of high availability replicas (0-5) for the dedicated database backing this database. Only valid when the database is backed by a dedicated specification. High availability is enabled when greater than 0. - * @param {string} params.syncMode - Replication sync mode for the dedicated database backing this database. Only valid when the database is backed by a dedicated specification; the mode is only in force once there is at least one replica. Allowed values: async, sync, quorum. + * @param {string | null} params.description - Optional description for the database. + * @param {string | null} params.specification - Database specification. Resizing between dedicated specifications changes cpu, memory, storage and the connection ceiling via a rolling cutover with zero downtime. Moving a `serverless` database onto a dedicated specification is a data migration, not a resize. + * @param {number | null} params.replicas - Number of high availability replicas (0-5) for the dedicated database backing this database. Only valid when the database is backed by a dedicated specification. High availability is enabled when greater than 0. + * @param {string | null} params.syncMode - Replication sync mode for the dedicated database backing this database. Only valid when the database is backed by a dedicated specification; the mode is only in force once there is at least one replica. Allowed values: async, sync, quorum. * @throws {AppwriteException} * @returns {Promise<Models.Database>} */ @@ -912,9 +935,10 @@ export class DocumentsDB { databaseId: string; name: string; enabled?: boolean; - specification?: string; - replicas?: number; - syncMode?: string; + description?: string | null; + specification?: string | null; + replicas?: number | null; + syncMode?: string | null; }): Promise<Models.Database>; /** * Update a database by its unique ID. @@ -922,9 +946,10 @@ export class DocumentsDB { * @param {string} databaseId - Database ID. * @param {string} name - Database name. Max length: 128 chars. * @param {boolean} enabled - Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. - * @param {string} specification - Database specification. Resizing between dedicated specifications changes cpu, memory, storage and the connection ceiling via a rolling cutover with zero downtime. Moving a `serverless` database onto a dedicated specification is a data migration, not a resize. - * @param {number} replicas - Number of high availability replicas (0-5) for the dedicated database backing this database. Only valid when the database is backed by a dedicated specification. High availability is enabled when greater than 0. - * @param {string} syncMode - Replication sync mode for the dedicated database backing this database. Only valid when the database is backed by a dedicated specification; the mode is only in force once there is at least one replica. Allowed values: async, sync, quorum. + * @param {string | null} description - Optional description for the database. + * @param {string | null} specification - Database specification. Resizing between dedicated specifications changes cpu, memory, storage and the connection ceiling via a rolling cutover with zero downtime. Moving a `serverless` database onto a dedicated specification is a data migration, not a resize. + * @param {number | null} replicas - Number of high availability replicas (0-5) for the dedicated database backing this database. Only valid when the database is backed by a dedicated specification. High availability is enabled when greater than 0. + * @param {string | null} syncMode - Replication sync mode for the dedicated database backing this database. Only valid when the database is backed by a dedicated specification; the mode is only in force once there is at least one replica. Allowed values: async, sync, quorum. * @throws {AppwriteException} * @returns {Promise<Models.Database>} * @deprecated Use the object parameter style method for a better developer experience. @@ -933,9 +958,10 @@ export class DocumentsDB { databaseId: string, name: string, enabled?: boolean, - specification?: string, - replicas?: number, - syncMode?: string, + description?: string | null, + specification?: string | null, + replicas?: number | null, + syncMode?: string | null, ): Promise<Models.Database>; update( paramsOrFirst: @@ -943,20 +969,29 @@ export class DocumentsDB { databaseId: string; name: string; enabled?: boolean; - specification?: string; - replicas?: number; - syncMode?: string; + description?: string | null; + specification?: string | null; + replicas?: number | null; + syncMode?: string | null; } | string, - ...rest: [string?, boolean?, string?, number?, string?] + ...rest: [ + string?, + boolean?, + (string | null)?, + (string | null)?, + (number | null)?, + (string | null)?, + ] ): Promise<Models.Database> { let params: { databaseId: string; name: string; enabled?: boolean; - specification?: string; - replicas?: number; - syncMode?: string; + description?: string | null; + specification?: string | null; + replicas?: number | null; + syncMode?: string | null; }; if ( @@ -968,24 +1003,27 @@ export class DocumentsDB { databaseId: string; name: string; enabled?: boolean; - specification?: string; - replicas?: number; - syncMode?: string; + description?: string | null; + specification?: string | null; + replicas?: number | null; + syncMode?: string | null; }; } else { params = { databaseId: paramsOrFirst as string, name: rest[0] as string, enabled: rest[1] as boolean, - specification: rest[2] as string, - replicas: rest[3] as number, - syncMode: rest[4] as string, + description: rest[2] as string | null, + specification: rest[3] as string | null, + replicas: rest[4] as number | null, + syncMode: rest[5] as string | null, }; } const databaseId = params.databaseId; const name = params.name; const enabled = params.enabled; + const description = params.description; const specification = params.specification; const replicas = params.replicas; const syncMode = params.syncMode; @@ -1009,6 +1047,9 @@ export class DocumentsDB { if (typeof enabled !== 'undefined') { apiPayload['enabled'] = enabled; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } if (typeof specification !== 'undefined') { apiPayload['specification'] = specification; } @@ -1034,6 +1075,7 @@ export class DocumentsDB { defaults: { $id: '', name: '', + description: '', $createdAt: '', $updatedAt: '', enabled: true, @@ -1260,6 +1302,7 @@ export class DocumentsDB { $permissions: [], databaseId: '', name: '', + description: '', enabled: true, documentSecurity: false, attributes: [], @@ -1279,6 +1322,7 @@ export class DocumentsDB { $createdAt: '', $updatedAt: '', key: '', + description: '', type: '', error: '', attributes: [], @@ -1297,11 +1341,12 @@ export class DocumentsDB { * @param {string} params.databaseId - Database ID. * @param {string} params.collectionId - 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.name - Collection name. Max length: 128 chars. - * @param {string[]} params.permissions - An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {string[] | null} params.permissions - An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} params.documentSecurity - Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} params.enabled - Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled. * @param {object[]} params.attributes - Array of attribute definitions to create. Each attribute should contain: key (string), type (string: string, varchar, text, mediumtext, longtext, integer, bigint, double, boolean, datetime, point, linestring, polygon, email, url, ip, enum), size (integer, required for string and varchar types), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options. * @param {object[]} params.indexes - Array of index definitions to create. Each index should contain: key (string), type (string: key, fulltext, unique, spatial), attributes (array of attribute keys), orders (array of ASC/DESC, optional), and lengths (array of integers, optional). + * @param {string} params.description - Optional description for the collection. * @throws {AppwriteException} * @returns {Promise<Models.Collection>} */ @@ -1309,11 +1354,12 @@ export class DocumentsDB { databaseId: string; collectionId: string; name: string; - permissions?: string[]; + permissions?: string[] | null; documentSecurity?: boolean; enabled?: boolean; attributes?: object[]; indexes?: object[]; + description?: string; }): Promise<Models.Collection>; /** * Create a new Collection. Before using this route, you should create a new database resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. @@ -1321,11 +1367,12 @@ export class DocumentsDB { * @param {string} databaseId - Database ID. * @param {string} collectionId - 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} name - Collection name. Max length: 128 chars. - * @param {string[]} permissions - An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {string[] | null} permissions - An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} documentSecurity - Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} enabled - Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled. * @param {object[]} attributes - Array of attribute definitions to create. Each attribute should contain: key (string), type (string: string, varchar, text, mediumtext, longtext, integer, bigint, double, boolean, datetime, point, linestring, polygon, email, url, ip, enum), size (integer, required for string and varchar types), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options. * @param {object[]} indexes - Array of index definitions to create. Each index should contain: key (string), type (string: key, fulltext, unique, spatial), attributes (array of attribute keys), orders (array of ASC/DESC, optional), and lengths (array of integers, optional). + * @param {string} description - Optional description for the collection. * @throws {AppwriteException} * @returns {Promise<Models.Collection>} * @deprecated Use the object parameter style method for a better developer experience. @@ -1334,11 +1381,12 @@ export class DocumentsDB { databaseId: string, collectionId: string, name: string, - permissions?: string[], + permissions?: string[] | null, documentSecurity?: boolean, enabled?: boolean, attributes?: object[], indexes?: object[], + description?: string, ): Promise<Models.Collection>; createCollection( paramsOrFirst: @@ -1346,32 +1394,35 @@ export class DocumentsDB { databaseId: string; collectionId: string; name: string; - permissions?: string[]; + permissions?: string[] | null; documentSecurity?: boolean; enabled?: boolean; attributes?: object[]; indexes?: object[]; + description?: string; } | string, ...rest: [ string?, string?, - string[]?, + (string[] | null)?, boolean?, boolean?, object[]?, object[]?, + string?, ] ): Promise<Models.Collection> { let params: { databaseId: string; collectionId: string; name: string; - permissions?: string[]; + permissions?: string[] | null; documentSecurity?: boolean; enabled?: boolean; attributes?: object[]; indexes?: object[]; + description?: string; }; if ( @@ -1383,22 +1434,24 @@ export class DocumentsDB { databaseId: string; collectionId: string; name: string; - permissions?: string[]; + permissions?: string[] | null; documentSecurity?: boolean; enabled?: boolean; attributes?: object[]; indexes?: object[]; + description?: string; }; } else { params = { databaseId: paramsOrFirst as string, collectionId: rest[0] as string, name: rest[1] as string, - permissions: rest[2] as string[], + permissions: rest[2] as string[] | null, documentSecurity: rest[3] as boolean, enabled: rest[4] as boolean, attributes: rest[5] as object[], indexes: rest[6] as object[], + description: rest[7] as string, }; } @@ -1410,6 +1463,7 @@ export class DocumentsDB { const enabled = params.enabled; const attributes = params.attributes; const indexes = params.indexes; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -1450,6 +1504,9 @@ export class DocumentsDB { if (typeof indexes !== 'undefined') { apiPayload['indexes'] = indexes; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -1470,6 +1527,7 @@ export class DocumentsDB { $permissions: [], databaseId: '', name: '', + description: '', enabled: true, documentSecurity: false, attributes: [], @@ -1489,6 +1547,7 @@ export class DocumentsDB { $createdAt: '', $updatedAt: '', key: '', + description: '', type: '', error: '', attributes: [], @@ -1587,6 +1646,7 @@ export class DocumentsDB { $permissions: [], databaseId: '', name: '', + description: '', enabled: true, documentSecurity: false, attributes: [], @@ -1606,6 +1666,7 @@ export class DocumentsDB { $createdAt: '', $updatedAt: '', key: '', + description: '', type: '', error: '', attributes: [], @@ -1628,6 +1689,7 @@ export class DocumentsDB { * @param {boolean} params.documentSecurity - Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} params.enabled - Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled. * @param {boolean} params.purge - When true, purge all cached list responses for this collection as part of the update. Use this to force readers to see fresh data immediately instead of waiting for the cache TTL to expire. + * @param {string | null} params.description - Optional description for the collection. * @throws {AppwriteException} * @returns {Promise<Models.Collection>} */ @@ -1639,6 +1701,7 @@ export class DocumentsDB { documentSecurity?: boolean; enabled?: boolean; purge?: boolean; + description?: string | null; }): Promise<Models.Collection>; /** * Update a collection by its unique ID. @@ -1650,6 +1713,7 @@ export class DocumentsDB { * @param {boolean} documentSecurity - Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} enabled - Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled. * @param {boolean} purge - When true, purge all cached list responses for this collection as part of the update. Use this to force readers to see fresh data immediately instead of waiting for the cache TTL to expire. + * @param {string | null} description - Optional description for the collection. * @throws {AppwriteException} * @returns {Promise<Models.Collection>} * @deprecated Use the object parameter style method for a better developer experience. @@ -1662,6 +1726,7 @@ export class DocumentsDB { documentSecurity?: boolean, enabled?: boolean, purge?: boolean, + description?: string | null, ): Promise<Models.Collection>; updateCollection( paramsOrFirst: @@ -1673,9 +1738,18 @@ export class DocumentsDB { documentSecurity?: boolean; enabled?: boolean; purge?: boolean; + description?: string | null; } | string, - ...rest: [string?, string?, string[]?, boolean?, boolean?, boolean?] + ...rest: [ + string?, + string?, + string[]?, + boolean?, + boolean?, + boolean?, + (string | null)?, + ] ): Promise<Models.Collection> { let params: { databaseId: string; @@ -1685,6 +1759,7 @@ export class DocumentsDB { documentSecurity?: boolean; enabled?: boolean; purge?: boolean; + description?: string | null; }; if ( @@ -1700,6 +1775,7 @@ export class DocumentsDB { documentSecurity?: boolean; enabled?: boolean; purge?: boolean; + description?: string | null; }; } else { params = { @@ -1710,6 +1786,7 @@ export class DocumentsDB { documentSecurity: rest[3] as boolean, enabled: rest[4] as boolean, purge: rest[5] as boolean, + description: rest[6] as string | null, }; } @@ -1720,6 +1797,7 @@ export class DocumentsDB { const documentSecurity = params.documentSecurity; const enabled = params.enabled; const purge = params.purge; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -1756,6 +1834,9 @@ export class DocumentsDB { if (typeof purge !== 'undefined') { apiPayload['purge'] = purge; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -1776,6 +1857,7 @@ export class DocumentsDB { $permissions: [], databaseId: '', name: '', + description: '', enabled: true, documentSecurity: false, attributes: [], @@ -1795,6 +1877,7 @@ export class DocumentsDB { $createdAt: '', $updatedAt: '', key: '', + description: '', type: '', error: '', attributes: [], @@ -2827,6 +2910,174 @@ export class DocumentsDB { return request.then((response) => applyDefaults(response, defaults)); } + /** + * Get a list of all the user's documents in a given collection using a POST request. This behaves identically to the list documents endpoint but accepts the queries in the request body, allowing much larger `queries` arrays than can fit in a URL query string. + * + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @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. + * @param {string} params.transactionId - Transaction ID to read uncommitted changes within the transaction. + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. + * @param {number} params.ttl - TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours). + * @throws {AppwriteException} + * @returns {Promise<Models.DocumentList<Document>>} + */ + createQuery< + Document extends Models.Document = Models.DefaultDocument, + >(params: { + databaseId: string; + collectionId: string; + queries?: string[]; + transactionId?: string; + total?: boolean; + ttl?: number; + }): Promise<Models.DocumentList<Document>>; + /** + * Get a list of all the user's documents in a given collection using a POST request. This behaves identically to the list documents endpoint but accepts the queries in the request body, allowing much larger `queries` arrays than can fit in a URL query string. + * + * + * @param {string} databaseId - Database ID. + * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @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. + * @param {string} transactionId - Transaction ID to read uncommitted changes within the transaction. + * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. + * @param {number} ttl - TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours). + * @throws {AppwriteException} + * @returns {Promise<Models.DocumentList<Document>>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createQuery<Document extends Models.Document = Models.DefaultDocument>( + databaseId: string, + collectionId: string, + queries?: string[], + transactionId?: string, + total?: boolean, + ttl?: number, + ): Promise<Models.DocumentList<Document>>; + createQuery<Document extends Models.Document = Models.DefaultDocument>( + paramsOrFirst: + | { + databaseId: string; + collectionId: string; + queries?: string[]; + transactionId?: string; + total?: boolean; + ttl?: number; + } + | string, + ...rest: [string?, string[]?, string?, boolean?, number?] + ): Promise<Models.DocumentList<Document>> { + let params: { + databaseId: string; + collectionId: string; + queries?: string[]; + transactionId?: string; + total?: boolean; + ttl?: number; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + databaseId: string; + collectionId: string; + queries?: string[]; + transactionId?: string; + total?: boolean; + ttl?: number; + }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + queries: rest[1] as string[], + transactionId: rest[2] as string, + total: rest[3] as boolean, + ttl: rest[4] as number, + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const queries = params.queries; + const transactionId = params.transactionId; + const total = params.total; + const ttl = params.ttl; + + if (typeof databaseId === 'undefined' || databaseId === '') { + throw new AppwriteException( + 'Missing required parameter: "databaseId"', + ); + } + if (typeof collectionId === 'undefined' || collectionId === '') { + throw new AppwriteException( + 'Missing required parameter: "collectionId"', + ); + } + const apiPath = + '/documentsdb/{databaseId}/collections/{collectionId}/documents/query' + .replace('{databaseId}', encodeURIComponent(String(databaseId))) + .replace( + '{collectionId}', + encodeURIComponent(String(collectionId)), + ); + const apiPayload: Payload = {}; + if (typeof queries !== 'undefined') { + apiPayload['queries'] = queries; + } + if (typeof transactionId !== 'undefined') { + apiPayload['transactionId'] = transactionId; + } + if (typeof total !== 'undefined') { + apiPayload['total'] = total; + } + if (typeof ttl !== 'undefined') { + apiPayload['ttl'] = ttl; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }; + + const request = this.client.call('post', uri, apiHeaders, apiPayload); + const defaults = { + root: 'documentList', + models: { + documentList: { + defaults: { + total: 0, + documents: [], + }, + properties: { + documents: { + items: 'document', + }, + }, + }, + document: { + defaults: { + $id: '', + $sequence: '', + $collectionId: '', + $databaseId: '', + $createdAt: '', + $updatedAt: '', + $permissions: [], + }, + }, + }, + }; + + return request.then((response) => applyDefaults(response, defaults)); + } + /** * Get a document by its unique ID. This endpoint response returns a JSON object with the document data. * @@ -3950,6 +4201,7 @@ export class DocumentsDB { $createdAt: '', $updatedAt: '', key: '', + description: '', type: '', error: '', attributes: [], @@ -3973,6 +4225,7 @@ export class DocumentsDB { * @param {string[]} params.attributes - Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long. * @param {OrderBy[]} params.orders - Array of index orders. Maximum of 100 orders are allowed. * @param {number[]} params.lengths - Length of index. Maximum of 100 + * @param {string} params.description - Optional description for the index. * @throws {AppwriteException} * @returns {Promise<Models.Index>} */ @@ -3984,6 +4237,7 @@ export class DocumentsDB { attributes: string[]; orders?: OrderBy[]; lengths?: number[]; + description?: string; }): Promise<Models.Index>; /** * Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request. @@ -3996,6 +4250,7 @@ export class DocumentsDB { * @param {string[]} attributes - Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long. * @param {OrderBy[]} orders - Array of index orders. Maximum of 100 orders are allowed. * @param {number[]} lengths - Length of index. Maximum of 100 + * @param {string} description - Optional description for the index. * @throws {AppwriteException} * @returns {Promise<Models.Index>} * @deprecated Use the object parameter style method for a better developer experience. @@ -4008,6 +4263,7 @@ export class DocumentsDB { attributes: string[], orders?: OrderBy[], lengths?: number[], + description?: string, ): Promise<Models.Index>; createIndex( paramsOrFirst: @@ -4019,6 +4275,7 @@ export class DocumentsDB { attributes: string[]; orders?: OrderBy[]; lengths?: number[]; + description?: string; } | string, ...rest: [ @@ -4028,6 +4285,7 @@ export class DocumentsDB { string[]?, OrderBy[]?, number[]?, + string?, ] ): Promise<Models.Index> { let params: { @@ -4038,6 +4296,7 @@ export class DocumentsDB { attributes: string[]; orders?: OrderBy[]; lengths?: number[]; + description?: string; }; if ( @@ -4053,6 +4312,7 @@ export class DocumentsDB { attributes: string[]; orders?: OrderBy[]; lengths?: number[]; + description?: string; }; } else { params = { @@ -4063,6 +4323,7 @@ export class DocumentsDB { attributes: rest[3] as string[], orders: rest[4] as OrderBy[], lengths: rest[5] as number[], + description: rest[6] as string, }; } @@ -4073,6 +4334,7 @@ export class DocumentsDB { const attributes = params.attributes; const orders = params.orders; const lengths = params.lengths; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -4118,6 +4380,9 @@ export class DocumentsDB { if (typeof lengths !== 'undefined') { apiPayload['lengths'] = lengths; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -4136,6 +4401,7 @@ export class DocumentsDB { $createdAt: '', $updatedAt: '', key: '', + description: '', type: '', error: '', attributes: [], @@ -4245,6 +4511,7 @@ export class DocumentsDB { $createdAt: '', $updatedAt: '', key: '', + description: '', type: '', error: '', attributes: [], @@ -4352,33 +4619,33 @@ export class DocumentsDB { * Trigger a manual failover for a dedicated database with high availability enabled. Promotes a replica to primary. The failover runs asynchronously; poll the database document for status updates. A database left mid-operation also accepts this call as a repair once nothing is driving the operation it is stuck in. Repairing a failover that did not finish, a `failed` database, a stranded upgrade or migrate, or a stranded compute resize additionally requires `targetReplicaId` to name the member to promote, because the default target may be the member that operation already promoted. * * @param {string} params.databaseId - Database ID. - * @param {string} params.targetReplicaId - Target replica ID to promote. If not specified, the healthiest replica is selected. + * @param {string | null} params.targetReplicaId - Target replica ID to promote. If not specified, the healthiest replica is selected. * @throws {AppwriteException} * @returns {Promise<Models.DedicatedDatabase>} */ createFailover(params: { databaseId: string; - targetReplicaId?: string; + targetReplicaId?: string | null; }): Promise<Models.DedicatedDatabase>; /** * Trigger a manual failover for a dedicated database with high availability enabled. Promotes a replica to primary. The failover runs asynchronously; poll the database document for status updates. A database left mid-operation also accepts this call as a repair once nothing is driving the operation it is stuck in. Repairing a failover that did not finish, a `failed` database, a stranded upgrade or migrate, or a stranded compute resize additionally requires `targetReplicaId` to name the member to promote, because the default target may be the member that operation already promoted. * * @param {string} databaseId - Database ID. - * @param {string} targetReplicaId - Target replica ID to promote. If not specified, the healthiest replica is selected. + * @param {string | null} targetReplicaId - Target replica ID to promote. If not specified, the healthiest replica is selected. * @throws {AppwriteException} * @returns {Promise<Models.DedicatedDatabase>} * @deprecated Use the object parameter style method for a better developer experience. */ createFailover( databaseId: string, - targetReplicaId?: string, + targetReplicaId?: string | null, ): Promise<Models.DedicatedDatabase>; createFailover( paramsOrFirst: - { databaseId: string; targetReplicaId?: string } | string, - ...rest: [string?] + { databaseId: string; targetReplicaId?: string | null } | string, + ...rest: [(string | null)?] ): Promise<Models.DedicatedDatabase> { - let params: { databaseId: string; targetReplicaId?: string }; + let params: { databaseId: string; targetReplicaId?: string | null }; if ( paramsOrFirst && @@ -4387,12 +4654,12 @@ export class DocumentsDB { ) { params = (paramsOrFirst || {}) as { databaseId: string; - targetReplicaId?: string; + targetReplicaId?: string | null; }; } else { params = { databaseId: paramsOrFirst as string, - targetReplicaId: rest[0] as string, + targetReplicaId: rest[0] as string | null, }; } diff --git a/src/services/domains.ts b/src/services/domains.ts index 3cc041d9..bf9ff9a0 100644 --- a/src/services/domains.ts +++ b/src/services/domains.ts @@ -20,28 +20,36 @@ export class Domains { * * @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/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on attributes such as domain name, teamInternalId, expiration, etc. * @param {string} params.search - Search term to filter your list results. Max length: 256 chars. + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise<Models.DomainsList>} */ list(params?: { queries?: string[]; search?: string; + total?: boolean; }): Promise<Models.DomainsList>; /** * List all domains registered for this project. This endpoint supports pagination. * * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on attributes such as domain name, teamInternalId, expiration, etc. * @param {string} search - Search term to filter your list results. Max length: 256 chars. + * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise<Models.DomainsList>} * @deprecated Use the object parameter style method for a better developer experience. */ - list(queries?: string[], search?: string): Promise<Models.DomainsList>; list( - paramsOrFirst?: { queries?: string[]; search?: string } | string[], - ...rest: [string?] + queries?: string[], + search?: string, + total?: boolean, + ): Promise<Models.DomainsList>; + list( + paramsOrFirst?: + { queries?: string[]; search?: string; total?: boolean } | string[], + ...rest: [string?, boolean?] ): Promise<Models.DomainsList> { - let params: { queries?: string[]; search?: string }; + let params: { queries?: string[]; search?: string; total?: boolean }; if ( (typeof paramsOrFirst === 'undefined' && rest.length === 0) || @@ -52,16 +60,19 @@ export class Domains { params = (paramsOrFirst || {}) as { queries?: string[]; search?: string; + total?: boolean; }; } else { params = { queries: paramsOrFirst as string[], search: rest[0] as string, + total: rest[1] as boolean, }; } const queries = params.queries; const search = params.search; + const total = params.total; const apiPath = '/domains'; const apiPayload: Payload = {}; @@ -71,6 +82,9 @@ export class Domains { if (typeof search !== 'undefined') { apiPayload['search'] = search; } + if (typeof total !== 'undefined') { + apiPayload['total'] = total; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -2969,12 +2983,14 @@ export class Domains { * * @param {string} params.domainId - Domain unique ID. * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. You may filter on attributes such as type, name, value, etc. Maximum of 100 queries are allowed, each 4096 characters long. + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise<Models.DnsRecordsList>} */ listRecords(params: { domainId: string; queries?: string[]; + total?: boolean; }): Promise<Models.DnsRecordsList>; /** * List DNS records for a given domain. You can use this endpoint to list all the DNS records @@ -2982,6 +2998,7 @@ export class Domains { * * @param {string} domainId - Domain unique ID. * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. You may filter on attributes such as type, name, value, etc. Maximum of 100 queries are allowed, each 4096 characters long. + * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise<Models.DnsRecordsList>} * @deprecated Use the object parameter style method for a better developer experience. @@ -2989,12 +3006,14 @@ export class Domains { listRecords( domainId: string, queries?: string[], + total?: boolean, ): Promise<Models.DnsRecordsList>; listRecords( - paramsOrFirst: { domainId: string; queries?: string[] } | string, - ...rest: [string[]?] + paramsOrFirst: + { domainId: string; queries?: string[]; total?: boolean } | string, + ...rest: [string[]?, boolean?] ): Promise<Models.DnsRecordsList> { - let params: { domainId: string; queries?: string[] }; + let params: { domainId: string; queries?: string[]; total?: boolean }; if ( paramsOrFirst && @@ -3004,16 +3023,19 @@ export class Domains { params = (paramsOrFirst || {}) as { domainId: string; queries?: string[]; + total?: boolean; }; } else { params = { domainId: paramsOrFirst as string, queries: rest[0] as string[], + total: rest[1] as boolean, }; } const domainId = params.domainId; const queries = params.queries; + const total = params.total; if (typeof domainId === 'undefined' || domainId === '') { throw new AppwriteException( @@ -3028,6 +3050,9 @@ export class Domains { if (typeof queries !== 'undefined') { apiPayload['queries'] = queries; } + if (typeof total !== 'undefined') { + apiPayload['total'] = total; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { diff --git a/src/services/functions.ts b/src/services/functions.ts index 7ec2e474..80fb4585 100644 --- a/src/services/functions.ts +++ b/src/services/functions.ts @@ -120,6 +120,7 @@ export class Functions { $updatedAt: '', execute: [], name: '', + description: '', enabled: true, live: true, logging: true, @@ -147,6 +148,7 @@ export class Functions { providerPaths: [], buildSpecification: 's-1vcpu-512mb', runtimeSpecification: 's-1vcpu-512mb', + emailEnabled: false, }, properties: { vars: { @@ -160,6 +162,7 @@ export class Functions { $createdAt: '', $updatedAt: '', key: '', + description: '', value: '', secret: false, resourceType: '', @@ -198,6 +201,7 @@ export class Functions { * @param {string} params.runtimeSpecification - Runtime specification for the function executions. * @param {number} params.deploymentRetention - Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept. * @param {number} params.interval - Minutes between scheduled executions. Appwrite picks when within each interval the function runs. Use 0 to disable. Cannot be combined with schedule. + * @param {string} params.description - Optional description for the function. * @throws {AppwriteException} * @returns {Promise<Models.Function>} */ @@ -225,6 +229,7 @@ export class Functions { runtimeSpecification?: string; deploymentRetention?: number; interval?: number; + description?: string; }): Promise<Models.Function>; /** * 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. @@ -252,6 +257,7 @@ export class Functions { * @param {string} runtimeSpecification - Runtime specification for the function executions. * @param {number} deploymentRetention - Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept. * @param {number} interval - Minutes between scheduled executions. Appwrite picks when within each interval the function runs. Use 0 to disable. Cannot be combined with schedule. + * @param {string} description - Optional description for the function. * @throws {AppwriteException} * @returns {Promise<Models.Function>} * @deprecated Use the object parameter style method for a better developer experience. @@ -280,6 +286,7 @@ export class Functions { runtimeSpecification?: string, deploymentRetention?: number, interval?: number, + description?: string, ): Promise<Models.Function>; create( paramsOrFirst: @@ -307,6 +314,7 @@ export class Functions { runtimeSpecification?: string; deploymentRetention?: number; interval?: number; + description?: string; } | string, ...rest: [ @@ -332,6 +340,7 @@ export class Functions { string?, number?, number?, + string?, ] ): Promise<Models.Function> { let params: { @@ -358,6 +367,7 @@ export class Functions { runtimeSpecification?: string; deploymentRetention?: number; interval?: number; + description?: string; }; if ( @@ -389,6 +399,7 @@ export class Functions { runtimeSpecification?: string; deploymentRetention?: number; interval?: number; + description?: string; }; } else { params = { @@ -415,6 +426,7 @@ export class Functions { runtimeSpecification: rest[19] as string, deploymentRetention: rest[20] as number, interval: rest[21] as number, + description: rest[22] as string, }; } @@ -441,6 +453,7 @@ export class Functions { const runtimeSpecification = params.runtimeSpecification; const deploymentRetention = params.deploymentRetention; const interval = params.interval; + const description = params.description; if (typeof functionId === 'undefined') { throw new AppwriteException( @@ -526,6 +539,9 @@ export class Functions { if (typeof interval !== 'undefined') { apiPayload['interval'] = interval; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -545,6 +561,7 @@ export class Functions { $updatedAt: '', execute: [], name: '', + description: '', enabled: true, live: true, logging: true, @@ -572,6 +589,7 @@ export class Functions { providerPaths: [], buildSpecification: 's-1vcpu-512mb', runtimeSpecification: 's-1vcpu-512mb', + emailEnabled: false, }, properties: { vars: { @@ -585,6 +603,7 @@ export class Functions { $createdAt: '', $updatedAt: '', key: '', + description: '', value: '', secret: false, resourceType: '', @@ -1135,6 +1154,7 @@ export class Functions { $updatedAt: '', execute: [], name: '', + description: '', enabled: true, live: true, logging: true, @@ -1162,6 +1182,7 @@ export class Functions { providerPaths: [], buildSpecification: 's-1vcpu-512mb', runtimeSpecification: 's-1vcpu-512mb', + emailEnabled: false, }, properties: { vars: { @@ -1175,6 +1196,7 @@ export class Functions { $createdAt: '', $updatedAt: '', key: '', + description: '', value: '', secret: false, resourceType: '', @@ -1203,16 +1225,18 @@ export class Functions { * @param {string} params.commands - Build Commands. * @param {ProjectKeyScopes[]} params.scopes - List of scopes allowed for API Key auto-generated for every execution. Maximum of 200 scopes are allowed. * @param {string} params.installationId - Appwrite Installation ID for VCS (Version Controle System) deployment. - * @param {string} params.providerRepositoryId - Repository ID of the repo linked to the function + * @param {string | null} params.providerRepositoryId - Repository ID of the repo linked to the function * @param {string} params.providerBranch - Production branch for the repo linked to the function * @param {boolean} params.providerSilentMode - Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests. * @param {string} params.providerRootDirectory - Path to function code in the linked repo. - * @param {string[]} params.providerBranches - List of branch name patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all branches. - * @param {string[]} params.providerPaths - List of file path patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all file changes. - * @param {string} params.buildSpecification - Build specification for the function deployments. - * @param {string} params.runtimeSpecification - Runtime specification for the function executions. + * @param {string[] | null} params.providerBranches - List of branch name patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all branches. + * @param {string[] | null} params.providerPaths - List of file path patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all file changes. + * @param {string | null} params.buildSpecification - Build specification for the function deployments. + * @param {string | null} params.runtimeSpecification - Runtime specification for the function executions. * @param {number} params.deploymentRetention - Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept. - * @param {number} params.interval - Minutes between scheduled executions. Appwrite picks when within each interval the function runs. Use 0 to disable. Cannot be combined with schedule. When omitted, the current interval is kept unless schedule is set. + * @param {number | null} params.interval - Minutes between scheduled executions. Appwrite picks when within each interval the function runs. Use 0 to disable. Cannot be combined with schedule. When omitted, the current interval is kept unless schedule is set. + * @param {string | null} params.description - Optional description for the function. + * @param {boolean | null} params.emailEnabled - Enable inbound email triggering for this function. When false or omitted on create, SMTP recipients are rejected. Opt-in; default is off. * @throws {AppwriteException} * @returns {Promise<Models.Function>} */ @@ -1230,16 +1254,18 @@ export class Functions { commands?: string; scopes?: ProjectKeyScopes[]; installationId?: string; - providerRepositoryId?: string; + providerRepositoryId?: string | null; providerBranch?: string; providerSilentMode?: boolean; providerRootDirectory?: string; - providerBranches?: string[]; - providerPaths?: string[]; - buildSpecification?: string; - runtimeSpecification?: string; + providerBranches?: string[] | null; + providerPaths?: string[] | null; + buildSpecification?: string | null; + runtimeSpecification?: string | null; deploymentRetention?: number; - interval?: number; + interval?: number | null; + description?: string | null; + emailEnabled?: boolean | null; }): Promise<Models.Function>; /** * Update function by its unique ID. @@ -1257,16 +1283,18 @@ export class Functions { * @param {string} commands - Build Commands. * @param {ProjectKeyScopes[]} scopes - List of scopes allowed for API Key auto-generated for every execution. Maximum of 200 scopes are allowed. * @param {string} installationId - Appwrite Installation ID for VCS (Version Controle System) deployment. - * @param {string} providerRepositoryId - Repository ID of the repo linked to the function + * @param {string | null} providerRepositoryId - Repository ID of the repo linked to the function * @param {string} providerBranch - Production branch for the repo linked to the function * @param {boolean} providerSilentMode - Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests. * @param {string} providerRootDirectory - Path to function code in the linked repo. - * @param {string[]} providerBranches - List of branch name patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all branches. - * @param {string[]} providerPaths - List of file path patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all file changes. - * @param {string} buildSpecification - Build specification for the function deployments. - * @param {string} runtimeSpecification - Runtime specification for the function executions. + * @param {string[] | null} providerBranches - List of branch name patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all branches. + * @param {string[] | null} providerPaths - List of file path patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all file changes. + * @param {string | null} buildSpecification - Build specification for the function deployments. + * @param {string | null} runtimeSpecification - Runtime specification for the function executions. * @param {number} deploymentRetention - Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept. - * @param {number} interval - Minutes between scheduled executions. Appwrite picks when within each interval the function runs. Use 0 to disable. Cannot be combined with schedule. When omitted, the current interval is kept unless schedule is set. + * @param {number | null} interval - Minutes between scheduled executions. Appwrite picks when within each interval the function runs. Use 0 to disable. Cannot be combined with schedule. When omitted, the current interval is kept unless schedule is set. + * @param {string | null} description - Optional description for the function. + * @param {boolean | null} emailEnabled - Enable inbound email triggering for this function. When false or omitted on create, SMTP recipients are rejected. Opt-in; default is off. * @throws {AppwriteException} * @returns {Promise<Models.Function>} * @deprecated Use the object parameter style method for a better developer experience. @@ -1285,16 +1313,18 @@ export class Functions { commands?: string, scopes?: ProjectKeyScopes[], installationId?: string, - providerRepositoryId?: string, + providerRepositoryId?: string | null, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, - providerBranches?: string[], - providerPaths?: string[], - buildSpecification?: string, - runtimeSpecification?: string, + providerBranches?: string[] | null, + providerPaths?: string[] | null, + buildSpecification?: string | null, + runtimeSpecification?: string | null, deploymentRetention?: number, - interval?: number, + interval?: number | null, + description?: string | null, + emailEnabled?: boolean | null, ): Promise<Models.Function>; update( paramsOrFirst: @@ -1312,16 +1342,18 @@ export class Functions { commands?: string; scopes?: ProjectKeyScopes[]; installationId?: string; - providerRepositoryId?: string; + providerRepositoryId?: string | null; providerBranch?: string; providerSilentMode?: boolean; providerRootDirectory?: string; - providerBranches?: string[]; - providerPaths?: string[]; - buildSpecification?: string; - runtimeSpecification?: string; + providerBranches?: string[] | null; + providerPaths?: string[] | null; + buildSpecification?: string | null; + runtimeSpecification?: string | null; deploymentRetention?: number; - interval?: number; + interval?: number | null; + description?: string | null; + emailEnabled?: boolean | null; } | string, ...rest: [ @@ -1337,16 +1369,18 @@ export class Functions { string?, ProjectKeyScopes[]?, string?, - string?, + (string | null)?, string?, boolean?, string?, - string[]?, - string[]?, - string?, - string?, - number?, + (string[] | null)?, + (string[] | null)?, + (string | null)?, + (string | null)?, number?, + (number | null)?, + (string | null)?, + (boolean | null)?, ] ): Promise<Models.Function> { let params: { @@ -1363,16 +1397,18 @@ export class Functions { commands?: string; scopes?: ProjectKeyScopes[]; installationId?: string; - providerRepositoryId?: string; + providerRepositoryId?: string | null; providerBranch?: string; providerSilentMode?: boolean; providerRootDirectory?: string; - providerBranches?: string[]; - providerPaths?: string[]; - buildSpecification?: string; - runtimeSpecification?: string; + providerBranches?: string[] | null; + providerPaths?: string[] | null; + buildSpecification?: string | null; + runtimeSpecification?: string | null; deploymentRetention?: number; - interval?: number; + interval?: number | null; + description?: string | null; + emailEnabled?: boolean | null; }; if ( @@ -1394,16 +1430,18 @@ export class Functions { commands?: string; scopes?: ProjectKeyScopes[]; installationId?: string; - providerRepositoryId?: string; + providerRepositoryId?: string | null; providerBranch?: string; providerSilentMode?: boolean; providerRootDirectory?: string; - providerBranches?: string[]; - providerPaths?: string[]; - buildSpecification?: string; - runtimeSpecification?: string; + providerBranches?: string[] | null; + providerPaths?: string[] | null; + buildSpecification?: string | null; + runtimeSpecification?: string | null; deploymentRetention?: number; - interval?: number; + interval?: number | null; + description?: string | null; + emailEnabled?: boolean | null; }; } else { params = { @@ -1420,16 +1458,18 @@ export class Functions { commands: rest[9] as string, scopes: rest[10] as ProjectKeyScopes[], installationId: rest[11] as string, - providerRepositoryId: rest[12] as string, + providerRepositoryId: rest[12] as string | null, providerBranch: rest[13] as string, providerSilentMode: rest[14] as boolean, providerRootDirectory: rest[15] as string, - providerBranches: rest[16] as string[], - providerPaths: rest[17] as string[], - buildSpecification: rest[18] as string, - runtimeSpecification: rest[19] as string, + providerBranches: rest[16] as string[] | null, + providerPaths: rest[17] as string[] | null, + buildSpecification: rest[18] as string | null, + runtimeSpecification: rest[19] as string | null, deploymentRetention: rest[20] as number, - interval: rest[21] as number, + interval: rest[21] as number | null, + description: rest[22] as string | null, + emailEnabled: rest[23] as boolean | null, }; } @@ -1456,6 +1496,8 @@ export class Functions { const runtimeSpecification = params.runtimeSpecification; const deploymentRetention = params.deploymentRetention; const interval = params.interval; + const description = params.description; + const emailEnabled = params.emailEnabled; if (typeof functionId === 'undefined' || functionId === '') { throw new AppwriteException( @@ -1536,6 +1578,12 @@ export class Functions { if (typeof interval !== 'undefined') { apiPayload['interval'] = interval; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } + if (typeof emailEnabled !== 'undefined') { + apiPayload['emailEnabled'] = emailEnabled; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -1555,6 +1603,7 @@ export class Functions { $updatedAt: '', execute: [], name: '', + description: '', enabled: true, live: true, logging: true, @@ -1582,6 +1631,7 @@ export class Functions { providerPaths: [], buildSpecification: 's-1vcpu-512mb', runtimeSpecification: 's-1vcpu-512mb', + emailEnabled: false, }, properties: { vars: { @@ -1595,6 +1645,7 @@ export class Functions { $createdAt: '', $updatedAt: '', key: '', + description: '', value: '', secret: false, resourceType: '', @@ -1749,6 +1800,7 @@ export class Functions { $updatedAt: '', execute: [], name: '', + description: '', enabled: true, live: true, logging: true, @@ -1776,6 +1828,7 @@ export class Functions { providerPaths: [], buildSpecification: 's-1vcpu-512mb', runtimeSpecification: 's-1vcpu-512mb', + emailEnabled: false, }, properties: { vars: { @@ -1789,6 +1842,7 @@ export class Functions { $createdAt: '', $updatedAt: '', key: '', + description: '', value: '', secret: false, resourceType: '', @@ -3169,7 +3223,7 @@ export class Functions { * @param {string} params.xpath - HTTP path of execution. Path can include query params. Default value is / * @param {ExecutionMethod} params.method - HTTP method of execution. Default value is POST. * @param {object} params.headers - HTTP headers of execution. Defaults to empty. - * @param {string} params.scheduledAt - Scheduled execution time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes. + * @param {string | null} params.scheduledAt - Scheduled execution time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes. * @throws {AppwriteException} * @returns {Promise<Models.Execution>} */ @@ -3180,7 +3234,7 @@ export class Functions { xpath?: string; method?: ExecutionMethod; headers?: object; - scheduledAt?: string; + scheduledAt?: string | null; }): Promise<Models.Execution>; /** * Trigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously. @@ -3191,7 +3245,7 @@ export class Functions { * @param {string} xpath - HTTP path of execution. Path can include query params. Default value is / * @param {ExecutionMethod} method - HTTP method of execution. Default value is POST. * @param {object} headers - HTTP headers of execution. Defaults to empty. - * @param {string} scheduledAt - Scheduled execution time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes. + * @param {string | null} scheduledAt - Scheduled execution time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes. * @throws {AppwriteException} * @returns {Promise<Models.Execution>} * @deprecated Use the object parameter style method for a better developer experience. @@ -3203,7 +3257,7 @@ export class Functions { xpath?: string, method?: ExecutionMethod, headers?: object, - scheduledAt?: string, + scheduledAt?: string | null, ): Promise<Models.Execution>; createExecution( paramsOrFirst: @@ -3214,7 +3268,7 @@ export class Functions { xpath?: string; method?: ExecutionMethod; headers?: object; - scheduledAt?: string; + scheduledAt?: string | null; } | string, ...rest: [ @@ -3223,7 +3277,7 @@ export class Functions { string?, ExecutionMethod?, object?, - string?, + (string | null)?, ] ): Promise<Models.Execution> { let params: { @@ -3233,7 +3287,7 @@ export class Functions { xpath?: string; method?: ExecutionMethod; headers?: object; - scheduledAt?: string; + scheduledAt?: string | null; }; if ( @@ -3248,7 +3302,7 @@ export class Functions { xpath?: string; method?: ExecutionMethod; headers?: object; - scheduledAt?: string; + scheduledAt?: string | null; }; } else { params = { @@ -3258,7 +3312,7 @@ export class Functions { xpath: rest[2] as string, method: rest[3] as ExecutionMethod, headers: rest[4] as object, - scheduledAt: rest[5] as string, + scheduledAt: rest[5] as string | null, }; } @@ -3640,6 +3694,7 @@ export class Functions { $createdAt: '', $updatedAt: '', key: '', + description: '', value: '', secret: false, resourceType: '', @@ -3660,6 +3715,7 @@ export class Functions { * @param {string} params.key - Variable key. Letters, digits and underscores only, must not start with a digit. Max length: 255 chars. * @param {string} params.value - Variable value. Max length: 8192 chars. * @param {boolean} params.secret - Secret variables can be updated or deleted, but only functions can read them during build and runtime. + * @param {string} params.description - Optional description for the variable. * @throws {AppwriteException} * @returns {Promise<Models.Variable>} */ @@ -3669,6 +3725,7 @@ export class Functions { key: string; value: string; secret?: boolean; + description?: string; }): Promise<Models.Variable>; /** * Create a new function environment variable. These variables can be accessed in the function at runtime as environment variables. @@ -3678,6 +3735,7 @@ export class Functions { * @param {string} key - Variable key. Letters, digits and underscores only, must not start with a digit. Max length: 255 chars. * @param {string} value - Variable value. Max length: 8192 chars. * @param {boolean} secret - Secret variables can be updated or deleted, but only functions can read them during build and runtime. + * @param {string} description - Optional description for the variable. * @throws {AppwriteException} * @returns {Promise<Models.Variable>} * @deprecated Use the object parameter style method for a better developer experience. @@ -3688,6 +3746,7 @@ export class Functions { key: string, value: string, secret?: boolean, + description?: string, ): Promise<Models.Variable>; createVariable( paramsOrFirst: @@ -3697,9 +3756,10 @@ export class Functions { key: string; value: string; secret?: boolean; + description?: string; } | string, - ...rest: [string?, string?, string?, boolean?] + ...rest: [string?, string?, string?, boolean?, string?] ): Promise<Models.Variable> { let params: { functionId: string; @@ -3707,6 +3767,7 @@ export class Functions { key: string; value: string; secret?: boolean; + description?: string; }; if ( @@ -3720,6 +3781,7 @@ export class Functions { key: string; value: string; secret?: boolean; + description?: string; }; } else { params = { @@ -3728,6 +3790,7 @@ export class Functions { key: rest[1] as string, value: rest[2] as string, secret: rest[3] as boolean, + description: rest[4] as string, }; } @@ -3736,6 +3799,7 @@ export class Functions { const key = params.key; const value = params.value; const secret = params.secret; + const description = params.description; if (typeof functionId === 'undefined' || functionId === '') { throw new AppwriteException( @@ -3770,6 +3834,9 @@ export class Functions { if (typeof secret !== 'undefined') { apiPayload['secret'] = secret; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -3788,6 +3855,7 @@ export class Functions { $createdAt: '', $updatedAt: '', key: '', + description: '', value: '', secret: false, resourceType: '', @@ -3881,6 +3949,7 @@ export class Functions { $createdAt: '', $updatedAt: '', key: '', + description: '', value: '', secret: false, resourceType: '', @@ -3898,27 +3967,30 @@ export class Functions { * * @param {string} params.functionId - Function unique ID. * @param {string} params.variableId - Variable unique ID. - * @param {string} params.key - Variable key. Letters, digits and underscores only, must not start with a digit. Max length: 255 chars. - * @param {string} params.value - Variable value. Max length: 8192 chars. - * @param {boolean} params.secret - Secret variables can be updated or deleted, but only functions can read them during build and runtime. + * @param {string | null} params.key - Variable key. Letters, digits and underscores only, must not start with a digit. Max length: 255 chars. + * @param {string | null} params.value - Variable value. Max length: 8192 chars. + * @param {boolean | null} params.secret - Secret variables can be updated or deleted, but only functions can read them during build and runtime. + * @param {string | null} params.description - Optional description for the variable. * @throws {AppwriteException} * @returns {Promise<Models.Variable>} */ updateVariable(params: { functionId: string; variableId: string; - key?: string; - value?: string; - secret?: boolean; + key?: string | null; + value?: string | null; + secret?: boolean | null; + description?: string | null; }): Promise<Models.Variable>; /** * Update variable by its unique ID. * * @param {string} functionId - Function unique ID. * @param {string} variableId - Variable unique ID. - * @param {string} key - Variable key. Letters, digits and underscores only, must not start with a digit. Max length: 255 chars. - * @param {string} value - Variable value. Max length: 8192 chars. - * @param {boolean} secret - Secret variables can be updated or deleted, but only functions can read them during build and runtime. + * @param {string | null} key - Variable key. Letters, digits and underscores only, must not start with a digit. Max length: 255 chars. + * @param {string | null} value - Variable value. Max length: 8192 chars. + * @param {boolean | null} secret - Secret variables can be updated or deleted, but only functions can read them during build and runtime. + * @param {string | null} description - Optional description for the variable. * @throws {AppwriteException} * @returns {Promise<Models.Variable>} * @deprecated Use the object parameter style method for a better developer experience. @@ -3926,28 +3998,37 @@ export class Functions { updateVariable( functionId: string, variableId: string, - key?: string, - value?: string, - secret?: boolean, + key?: string | null, + value?: string | null, + secret?: boolean | null, + description?: string | null, ): Promise<Models.Variable>; updateVariable( paramsOrFirst: | { functionId: string; variableId: string; - key?: string; - value?: string; - secret?: boolean; + key?: string | null; + value?: string | null; + secret?: boolean | null; + description?: string | null; } | string, - ...rest: [string?, string?, string?, boolean?] + ...rest: [ + string?, + (string | null)?, + (string | null)?, + (boolean | null)?, + (string | null)?, + ] ): Promise<Models.Variable> { let params: { functionId: string; variableId: string; - key?: string; - value?: string; - secret?: boolean; + key?: string | null; + value?: string | null; + secret?: boolean | null; + description?: string | null; }; if ( @@ -3958,17 +4039,19 @@ export class Functions { params = (paramsOrFirst || {}) as { functionId: string; variableId: string; - key?: string; - value?: string; - secret?: boolean; + key?: string | null; + value?: string | null; + secret?: boolean | null; + description?: string | null; }; } else { params = { functionId: paramsOrFirst as string, variableId: rest[0] as string, - key: rest[1] as string, - value: rest[2] as string, - secret: rest[3] as boolean, + key: rest[1] as string | null, + value: rest[2] as string | null, + secret: rest[3] as boolean | null, + description: rest[4] as string | null, }; } @@ -3977,6 +4060,7 @@ export class Functions { const key = params.key; const value = params.value; const secret = params.secret; + const description = params.description; if (typeof functionId === 'undefined' || functionId === '') { throw new AppwriteException( @@ -4001,6 +4085,9 @@ export class Functions { if (typeof secret !== 'undefined') { apiPayload['secret'] = secret; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -4019,6 +4106,7 @@ export class Functions { $createdAt: '', $updatedAt: '', key: '', + description: '', value: '', secret: false, resourceType: '', diff --git a/src/services/growth.ts b/src/services/growth.ts index bb72c8fe..4043bd36 100644 --- a/src/services/growth.ts +++ b/src/services/growth.ts @@ -215,7 +215,7 @@ export class Growth { /** * Record a self-hosted installation. Every report is stored as its own row; the admin email is optional because headless CLI installs create no account. * - * @param {string} params.email - Admin email from the installation, when an account was created. + * @param {string | null} params.email - Admin email from the installation, when an account was created. * @param {string} params.name - Admin name. * @param {string} params.version - Appwrite version. * @param {string} params.domain - Installation domain. @@ -230,7 +230,7 @@ export class Growth { * @returns {Promise<{}>} */ createInstallation(params?: { - email?: string; + email?: string | null; name?: string; version?: string; domain?: string; @@ -245,7 +245,7 @@ export class Growth { /** * Record a self-hosted installation. Every report is stored as its own row; the admin email is optional because headless CLI installs create no account. * - * @param {string} email - Admin email from the installation, when an account was created. + * @param {string | null} email - Admin email from the installation, when an account was created. * @param {string} name - Admin name. * @param {string} version - Appwrite version. * @param {string} domain - Installation domain. @@ -261,7 +261,7 @@ export class Growth { * @deprecated Use the object parameter style method for a better developer experience. */ createInstallation( - email?: string, + email?: string | null, name?: string, version?: string, domain?: string, @@ -276,7 +276,7 @@ export class Growth { createInstallation( paramsOrFirst?: | { - email?: string; + email?: string | null; name?: string; version?: string; domain?: string; @@ -288,7 +288,8 @@ export class Growth { cpus?: number; ram?: number; } - | string, + | string + | null, ...rest: [ string?, string?, @@ -303,7 +304,7 @@ export class Growth { ] ): Promise<{}> { let params: { - email?: string; + email?: string | null; name?: string; version?: string; domain?: string; @@ -323,7 +324,7 @@ export class Growth { !Array.isArray(paramsOrFirst)) ) { params = (paramsOrFirst || {}) as { - email?: string; + email?: string | null; name?: string; version?: string; domain?: string; @@ -337,7 +338,7 @@ export class Growth { }; } else { params = { - email: paramsOrFirst as string, + email: paramsOrFirst as string | null, name: rest[0] as string, version: rest[1] as string, domain: rest[2] as string, diff --git a/src/services/messaging.ts b/src/services/messaging.ts index 7da6693e..3e3f3c4c 100644 --- a/src/services/messaging.ts +++ b/src/services/messaging.ts @@ -117,7 +117,7 @@ export class Messaging { users: [], targets: [], deliveredTotal: 0, - data: [], + data: {}, status: 'draft', }, }, @@ -138,12 +138,13 @@ export class Messaging { * @param {string[]} params.targets - List of Targets IDs. * @param {string[]} params.cc - Array of target IDs to be added as CC. * @param {string[]} params.bcc - Array of target IDs to be added as BCC. - * @param {string[]} params.attachments - Array of compound ID strings of bucket IDs and file IDs to be attached to the email. They should be formatted as <BUCKET_ID>:<FILE_ID>. - * @param {string} params.replyToEmail - Email address to reply to. If not set, defaults to the sender email address. - * @param {string} params.replyToName - Name of the reply to recipient. If not set, defaults to the sender name. + * @param {string[] | null} params.attachments - Array of compound ID strings of bucket IDs and file IDs to be attached to the email. They should be formatted as <BUCKET_ID>:<FILE_ID>. * @param {boolean} params.draft - Is message a draft * @param {boolean} params.html - Is content of type HTML - * @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 {string | null} 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 {string} params.replyToEmail - Email address to reply to. If not set, defaults to the sender email address. + * @param {string} params.replyToName - Name of the reply to recipient. If not set, defaults to the sender name. + * @param {string[]} params.emails - List of email addresses to send the message to. Use this to deliver to recipients that are not backed by an Appwrite user, target, or topic. * @throws {AppwriteException} * @returns {Promise<Models.Message>} */ @@ -156,12 +157,13 @@ export class Messaging { targets?: string[]; cc?: string[]; bcc?: string[]; - attachments?: string[]; - replyToEmail?: string; - replyToName?: string; + attachments?: string[] | null; draft?: boolean; html?: boolean; - scheduledAt?: string; + scheduledAt?: string | null; + replyToEmail?: string; + replyToName?: string; + emails?: string[]; }): Promise<Models.Message>; /** * Create a new email message. @@ -174,12 +176,13 @@ export class Messaging { * @param {string[]} targets - List of Targets IDs. * @param {string[]} cc - Array of target IDs to be added as CC. * @param {string[]} bcc - Array of target IDs to be added as BCC. - * @param {string[]} attachments - Array of compound ID strings of bucket IDs and file IDs to be attached to the email. They should be formatted as <BUCKET_ID>:<FILE_ID>. - * @param {string} replyToEmail - Email address to reply to. If not set, defaults to the sender email address. - * @param {string} replyToName - Name of the reply to recipient. If not set, defaults to the sender name. + * @param {string[] | null} attachments - Array of compound ID strings of bucket IDs and file IDs to be attached to the email. They should be formatted as <BUCKET_ID>:<FILE_ID>. * @param {boolean} draft - Is message a draft * @param {boolean} html - Is content of type HTML - * @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 {string | null} 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 {string} replyToEmail - Email address to reply to. If not set, defaults to the sender email address. + * @param {string} replyToName - Name of the reply to recipient. If not set, defaults to the sender name. + * @param {string[]} emails - List of email addresses to send the message to. Use this to deliver to recipients that are not backed by an Appwrite user, target, or topic. * @throws {AppwriteException} * @returns {Promise<Models.Message>} * @deprecated Use the object parameter style method for a better developer experience. @@ -193,12 +196,13 @@ export class Messaging { targets?: string[], cc?: string[], bcc?: string[], - attachments?: string[], - replyToEmail?: string, - replyToName?: string, + attachments?: string[] | null, draft?: boolean, html?: boolean, - scheduledAt?: string, + scheduledAt?: string | null, + replyToEmail?: string, + replyToName?: string, + emails?: string[], ): Promise<Models.Message>; createEmail( paramsOrFirst: @@ -211,12 +215,13 @@ export class Messaging { targets?: string[]; cc?: string[]; bcc?: string[]; - attachments?: string[]; - replyToEmail?: string; - replyToName?: string; + attachments?: string[] | null; draft?: boolean; html?: boolean; - scheduledAt?: string; + scheduledAt?: string | null; + replyToEmail?: string; + replyToName?: string; + emails?: string[]; } | string, ...rest: [ @@ -227,12 +232,13 @@ export class Messaging { string[]?, string[]?, string[]?, - string[]?, - string?, - string?, + (string[] | null)?, boolean?, boolean?, + (string | null)?, string?, + string?, + string[]?, ] ): Promise<Models.Message> { let params: { @@ -244,12 +250,13 @@ export class Messaging { targets?: string[]; cc?: string[]; bcc?: string[]; - attachments?: string[]; - replyToEmail?: string; - replyToName?: string; + attachments?: string[] | null; draft?: boolean; html?: boolean; - scheduledAt?: string; + scheduledAt?: string | null; + replyToEmail?: string; + replyToName?: string; + emails?: string[]; }; if ( @@ -266,12 +273,13 @@ export class Messaging { targets?: string[]; cc?: string[]; bcc?: string[]; - attachments?: string[]; - replyToEmail?: string; - replyToName?: string; + attachments?: string[] | null; draft?: boolean; html?: boolean; - scheduledAt?: string; + scheduledAt?: string | null; + replyToEmail?: string; + replyToName?: string; + emails?: string[]; }; } else { params = { @@ -283,12 +291,13 @@ export class Messaging { targets: rest[4] as string[], cc: rest[5] as string[], bcc: rest[6] as string[], - attachments: rest[7] as string[], - replyToEmail: rest[8] as string, - replyToName: rest[9] as string, - draft: rest[10] as boolean, - html: rest[11] as boolean, - scheduledAt: rest[12] as string, + attachments: rest[7] as string[] | null, + draft: rest[8] as boolean, + html: rest[9] as boolean, + scheduledAt: rest[10] as string | null, + replyToEmail: rest[11] as string, + replyToName: rest[12] as string, + emails: rest[13] as string[], }; } @@ -301,11 +310,12 @@ export class Messaging { const cc = params.cc; const bcc = params.bcc; const attachments = params.attachments; - const replyToEmail = params.replyToEmail; - const replyToName = params.replyToName; const draft = params.draft; const html = params.html; const scheduledAt = params.scheduledAt; + const replyToEmail = params.replyToEmail; + const replyToName = params.replyToName; + const emails = params.emails; if (typeof messageId === 'undefined') { throw new AppwriteException( @@ -351,12 +361,6 @@ export class Messaging { if (typeof attachments !== 'undefined') { apiPayload['attachments'] = attachments; } - if (typeof replyToEmail !== 'undefined') { - apiPayload['replyToEmail'] = replyToEmail; - } - if (typeof replyToName !== 'undefined') { - apiPayload['replyToName'] = replyToName; - } if (typeof draft !== 'undefined') { apiPayload['draft'] = draft; } @@ -366,6 +370,15 @@ export class Messaging { if (typeof scheduledAt !== 'undefined') { apiPayload['scheduledAt'] = scheduledAt; } + if (typeof replyToEmail !== 'undefined') { + apiPayload['replyToEmail'] = replyToEmail; + } + if (typeof replyToName !== 'undefined') { + apiPayload['replyToName'] = replyToName; + } + if (typeof emails !== 'undefined') { + apiPayload['emails'] = emails; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -388,7 +401,7 @@ export class Messaging { users: [], targets: [], deliveredTotal: 0, - data: [], + data: {}, status: 'draft', }, }, @@ -403,126 +416,133 @@ export class Messaging { * * * @param {string} params.messageId - Message ID. - * @param {string} params.subject - Email Subject. - * @param {string} params.content - Email Content. - * @param {string[]} params.topics - List of Topic IDs. - * @param {string[]} params.users - List of User IDs. - * @param {string[]} params.targets - List of Targets IDs. - * @param {string[]} params.cc - Array of target IDs to be added as CC. - * @param {string[]} params.bcc - Array of target IDs to be added as BCC. - * @param {string[]} params.attachments - Array of compound ID strings of bucket IDs and file IDs to be attached to the email. They should be formatted as <BUCKET_ID>:<FILE_ID>. - * @param {string} params.replyToEmail - Email address to reply to. Pass an empty string to restore the provider or sender default. - * @param {string} params.replyToName - Name of the reply to recipient. Pass an empty string to restore the provider or sender default. - * @param {boolean} params.draft - Is message a draft - * @param {boolean} params.html - Is content of type HTML - * @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 {string[] | null} params.topics - List of Topic IDs. + * @param {string[] | null} params.users - List of User IDs. + * @param {string[] | null} params.targets - List of Targets IDs. + * @param {string | null} params.subject - Email Subject. + * @param {string | null} params.content - Email Content. + * @param {boolean | null} params.draft - Is message a draft + * @param {boolean | null} params.html - Is content of type HTML + * @param {string[] | null} params.cc - Array of target IDs to be added as CC. + * @param {string[] | null} params.bcc - Array of target IDs to be added as BCC. + * @param {string | null} 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 {string[] | null} params.attachments - Array of compound ID strings of bucket IDs and file IDs to be attached to the email. They should be formatted as <BUCKET_ID>:<FILE_ID>. + * @param {string | null} params.replyToEmail - Email address to reply to. Pass an empty string to restore the provider or sender default. + * @param {string | null} params.replyToName - Name of the reply to recipient. Pass an empty string to restore the provider or sender default. + * @param {string[] | null} params.emails - List of email addresses to send the message to. Use this to deliver to recipients that are not backed by an Appwrite user, target, or topic. * @throws {AppwriteException} * @returns {Promise<Models.Message>} */ updateEmail(params: { messageId: string; - subject?: string; - content?: string; - topics?: string[]; - users?: string[]; - targets?: string[]; - cc?: string[]; - bcc?: string[]; - attachments?: string[]; - replyToEmail?: string; - replyToName?: string; - draft?: boolean; - html?: boolean; - scheduledAt?: string; + topics?: string[] | null; + users?: string[] | null; + targets?: string[] | null; + subject?: string | null; + content?: string | null; + draft?: boolean | null; + html?: boolean | null; + cc?: string[] | null; + bcc?: string[] | null; + scheduledAt?: string | null; + attachments?: string[] | null; + replyToEmail?: string | null; + replyToName?: string | null; + emails?: string[] | null; }): Promise<Models.Message>; /** * Update an email message 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. * * * @param {string} messageId - Message ID. - * @param {string} subject - Email Subject. - * @param {string} content - Email Content. - * @param {string[]} topics - List of Topic IDs. - * @param {string[]} users - List of User IDs. - * @param {string[]} targets - List of Targets IDs. - * @param {string[]} cc - Array of target IDs to be added as CC. - * @param {string[]} bcc - Array of target IDs to be added as BCC. - * @param {string[]} attachments - Array of compound ID strings of bucket IDs and file IDs to be attached to the email. They should be formatted as <BUCKET_ID>:<FILE_ID>. - * @param {string} replyToEmail - Email address to reply to. Pass an empty string to restore the provider or sender default. - * @param {string} replyToName - Name of the reply to recipient. Pass an empty string to restore the provider or sender default. - * @param {boolean} draft - Is message a draft - * @param {boolean} html - Is content of type HTML - * @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 {string[] | null} topics - List of Topic IDs. + * @param {string[] | null} users - List of User IDs. + * @param {string[] | null} targets - List of Targets IDs. + * @param {string | null} subject - Email Subject. + * @param {string | null} content - Email Content. + * @param {boolean | null} draft - Is message a draft + * @param {boolean | null} html - Is content of type HTML + * @param {string[] | null} cc - Array of target IDs to be added as CC. + * @param {string[] | null} bcc - Array of target IDs to be added as BCC. + * @param {string | null} 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 {string[] | null} attachments - Array of compound ID strings of bucket IDs and file IDs to be attached to the email. They should be formatted as <BUCKET_ID>:<FILE_ID>. + * @param {string | null} replyToEmail - Email address to reply to. Pass an empty string to restore the provider or sender default. + * @param {string | null} replyToName - Name of the reply to recipient. Pass an empty string to restore the provider or sender default. + * @param {string[] | null} emails - List of email addresses to send the message to. Use this to deliver to recipients that are not backed by an Appwrite user, target, or topic. * @throws {AppwriteException} * @returns {Promise<Models.Message>} * @deprecated Use the object parameter style method for a better developer experience. */ updateEmail( messageId: string, - subject?: string, - content?: string, - topics?: string[], - users?: string[], - targets?: string[], - cc?: string[], - bcc?: string[], - attachments?: string[], - replyToEmail?: string, - replyToName?: string, - draft?: boolean, - html?: boolean, - scheduledAt?: string, + topics?: string[] | null, + users?: string[] | null, + targets?: string[] | null, + subject?: string | null, + content?: string | null, + draft?: boolean | null, + html?: boolean | null, + cc?: string[] | null, + bcc?: string[] | null, + scheduledAt?: string | null, + attachments?: string[] | null, + replyToEmail?: string | null, + replyToName?: string | null, + emails?: string[] | null, ): Promise<Models.Message>; updateEmail( paramsOrFirst: | { messageId: string; - subject?: string; - content?: string; - topics?: string[]; - users?: string[]; - targets?: string[]; - cc?: string[]; - bcc?: string[]; - attachments?: string[]; - replyToEmail?: string; - replyToName?: string; - draft?: boolean; - html?: boolean; - scheduledAt?: string; + topics?: string[] | null; + users?: string[] | null; + targets?: string[] | null; + subject?: string | null; + content?: string | null; + draft?: boolean | null; + html?: boolean | null; + cc?: string[] | null; + bcc?: string[] | null; + scheduledAt?: string | null; + attachments?: string[] | null; + replyToEmail?: string | null; + replyToName?: string | null; + emails?: string[] | null; } | string, ...rest: [ - string?, - string?, - string[]?, - string[]?, - string[]?, - string[]?, - string[]?, - string[]?, - string?, - string?, - boolean?, - boolean?, - string?, + (string[] | null)?, + (string[] | null)?, + (string[] | null)?, + (string | null)?, + (string | null)?, + (boolean | null)?, + (boolean | null)?, + (string[] | null)?, + (string[] | null)?, + (string | null)?, + (string[] | null)?, + (string | null)?, + (string | null)?, + (string[] | null)?, ] ): Promise<Models.Message> { let params: { messageId: string; - subject?: string; - content?: string; - topics?: string[]; - users?: string[]; - targets?: string[]; - cc?: string[]; - bcc?: string[]; - attachments?: string[]; - replyToEmail?: string; - replyToName?: string; - draft?: boolean; - html?: boolean; - scheduledAt?: string; + topics?: string[] | null; + users?: string[] | null; + targets?: string[] | null; + subject?: string | null; + content?: string | null; + draft?: boolean | null; + html?: boolean | null; + cc?: string[] | null; + bcc?: string[] | null; + scheduledAt?: string | null; + attachments?: string[] | null; + replyToEmail?: string | null; + replyToName?: string | null; + emails?: string[] | null; }; if ( @@ -532,53 +552,56 @@ export class Messaging { ) { params = (paramsOrFirst || {}) as { messageId: string; - subject?: string; - content?: string; - topics?: string[]; - users?: string[]; - targets?: string[]; - cc?: string[]; - bcc?: string[]; - attachments?: string[]; - replyToEmail?: string; - replyToName?: string; - draft?: boolean; - html?: boolean; - scheduledAt?: string; + topics?: string[] | null; + users?: string[] | null; + targets?: string[] | null; + subject?: string | null; + content?: string | null; + draft?: boolean | null; + html?: boolean | null; + cc?: string[] | null; + bcc?: string[] | null; + scheduledAt?: string | null; + attachments?: string[] | null; + replyToEmail?: string | null; + replyToName?: string | null; + emails?: string[] | null; }; } else { params = { messageId: paramsOrFirst as string, - subject: rest[0] as string, - content: rest[1] as string, - topics: rest[2] as string[], - users: rest[3] as string[], - targets: rest[4] as string[], - cc: rest[5] as string[], - bcc: rest[6] as string[], - attachments: rest[7] as string[], - replyToEmail: rest[8] as string, - replyToName: rest[9] as string, - draft: rest[10] as boolean, - html: rest[11] as boolean, - scheduledAt: rest[12] as string, + topics: rest[0] as string[] | null, + users: rest[1] as string[] | null, + targets: rest[2] as string[] | null, + subject: rest[3] as string | null, + content: rest[4] as string | null, + draft: rest[5] as boolean | null, + html: rest[6] as boolean | null, + cc: rest[7] as string[] | null, + bcc: rest[8] as string[] | null, + scheduledAt: rest[9] as string | null, + attachments: rest[10] as string[] | null, + replyToEmail: rest[11] as string | null, + replyToName: rest[12] as string | null, + emails: rest[13] as string[] | null, }; } const messageId = params.messageId; - const subject = params.subject; - const content = params.content; const topics = params.topics; const users = params.users; const targets = params.targets; + const subject = params.subject; + const content = params.content; + const draft = params.draft; + const html = params.html; const cc = params.cc; const bcc = params.bcc; + const scheduledAt = params.scheduledAt; const attachments = params.attachments; const replyToEmail = params.replyToEmail; const replyToName = params.replyToName; - const draft = params.draft; - const html = params.html; - const scheduledAt = params.scheduledAt; + const emails = params.emails; if (typeof messageId === 'undefined' || messageId === '') { throw new AppwriteException( @@ -590,12 +613,6 @@ export class Messaging { encodeURIComponent(String(messageId)), ); const apiPayload: Payload = {}; - if (typeof subject !== 'undefined') { - apiPayload['subject'] = subject; - } - if (typeof content !== 'undefined') { - apiPayload['content'] = content; - } if (typeof topics !== 'undefined') { apiPayload['topics'] = topics; } @@ -605,12 +622,27 @@ export class Messaging { if (typeof targets !== 'undefined') { apiPayload['targets'] = targets; } + if (typeof subject !== 'undefined') { + apiPayload['subject'] = subject; + } + if (typeof content !== 'undefined') { + apiPayload['content'] = content; + } + if (typeof draft !== 'undefined') { + apiPayload['draft'] = draft; + } + if (typeof html !== 'undefined') { + apiPayload['html'] = html; + } if (typeof cc !== 'undefined') { apiPayload['cc'] = cc; } if (typeof bcc !== 'undefined') { apiPayload['bcc'] = bcc; } + if (typeof scheduledAt !== 'undefined') { + apiPayload['scheduledAt'] = scheduledAt; + } if (typeof attachments !== 'undefined') { apiPayload['attachments'] = attachments; } @@ -620,14 +652,8 @@ export class Messaging { if (typeof replyToName !== 'undefined') { apiPayload['replyToName'] = replyToName; } - if (typeof draft !== 'undefined') { - apiPayload['draft'] = draft; - } - if (typeof html !== 'undefined') { - apiPayload['html'] = html; - } - if (typeof scheduledAt !== 'undefined') { - apiPayload['scheduledAt'] = scheduledAt; + if (typeof emails !== 'undefined') { + apiPayload['emails'] = emails; } const uri = new URL(this.client.config.endpoint + apiPath); @@ -651,7 +677,7 @@ export class Messaging { users: [], targets: [], deliveredTotal: 0, - data: [], + data: {}, status: 'draft', }, }, @@ -670,7 +696,7 @@ export class Messaging { * @param {string[]} params.topics - List of Topic IDs. * @param {string[]} params.users - List of User IDs. * @param {string[]} params.targets - List of Targets IDs. - * @param {object} params.data - Additional key-value pair data for push notification. + * @param {object | null} params.data - Additional key-value pair data for push notification. * @param {string} params.action - Action for push notification. * @param {string} params.image - Image for push notification. Must be a compound bucket ID to file ID of a jpeg, png, or bmp image in Appwrite Storage. It should be formatted as <BUCKET_ID>:<FILE_ID>. * @param {string} params.icon - Icon for push notification. Available only for Android and Web Platform. @@ -679,7 +705,7 @@ export class Messaging { * @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 {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 {string | null} 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. * @param {boolean} params.critical - If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform. * @param {MessagePriority} params.priority - Set the notification priority. "normal" will consider device state and may not deliver notifications immediately. "high" will always attempt to immediately deliver the notification. @@ -694,7 +720,7 @@ export class Messaging { topics?: string[]; users?: string[]; targets?: string[]; - data?: object; + data?: object | null; action?: string; image?: string; icon?: string; @@ -703,7 +729,7 @@ export class Messaging { tag?: string; badge?: number; draft?: boolean; - scheduledAt?: string; + scheduledAt?: string | null; contentAvailable?: boolean; critical?: boolean; priority?: MessagePriority; @@ -718,7 +744,7 @@ export class Messaging { * @param {string[]} topics - List of Topic IDs. * @param {string[]} users - List of User IDs. * @param {string[]} targets - List of Targets IDs. - * @param {object} data - Additional key-value pair data for push notification. + * @param {object | null} data - Additional key-value pair data for push notification. * @param {string} action - Action for push notification. * @param {string} image - Image for push notification. Must be a compound bucket ID to file ID of a jpeg, png, or bmp image in Appwrite Storage. It should be formatted as <BUCKET_ID>:<FILE_ID>. * @param {string} icon - Icon for push notification. Available only for Android and Web Platform. @@ -727,7 +753,7 @@ export class Messaging { * @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 {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 {string | null} 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. * @param {boolean} critical - If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform. * @param {MessagePriority} priority - Set the notification priority. "normal" will consider device state and may not deliver notifications immediately. "high" will always attempt to immediately deliver the notification. @@ -743,7 +769,7 @@ export class Messaging { topics?: string[], users?: string[], targets?: string[], - data?: object, + data?: object | null, action?: string, image?: string, icon?: string, @@ -752,7 +778,7 @@ export class Messaging { tag?: string, badge?: number, draft?: boolean, - scheduledAt?: string, + scheduledAt?: string | null, contentAvailable?: boolean, critical?: boolean, priority?: MessagePriority, @@ -767,7 +793,7 @@ export class Messaging { topics?: string[]; users?: string[]; targets?: string[]; - data?: object; + data?: object | null; action?: string; image?: string; icon?: string; @@ -776,7 +802,7 @@ export class Messaging { tag?: string; badge?: number; draft?: boolean; - scheduledAt?: string; + scheduledAt?: string | null; contentAvailable?: boolean; critical?: boolean; priority?: MessagePriority; @@ -789,7 +815,7 @@ export class Messaging { string[]?, string[]?, string[]?, - object?, + (object | null)?, string?, string?, string?, @@ -798,7 +824,7 @@ export class Messaging { string?, number?, boolean?, - string?, + (string | null)?, boolean?, boolean?, MessagePriority?, @@ -812,7 +838,7 @@ export class Messaging { topics?: string[]; users?: string[]; targets?: string[]; - data?: object; + data?: object | null; action?: string; image?: string; icon?: string; @@ -821,7 +847,7 @@ export class Messaging { tag?: string; badge?: number; draft?: boolean; - scheduledAt?: string; + scheduledAt?: string | null; contentAvailable?: boolean; critical?: boolean; priority?: MessagePriority; @@ -840,7 +866,7 @@ export class Messaging { topics?: string[]; users?: string[]; targets?: string[]; - data?: object; + data?: object | null; action?: string; image?: string; icon?: string; @@ -849,7 +875,7 @@ export class Messaging { tag?: string; badge?: number; draft?: boolean; - scheduledAt?: string; + scheduledAt?: string | null; contentAvailable?: boolean; critical?: boolean; priority?: MessagePriority; @@ -863,7 +889,7 @@ export class Messaging { topics: rest[2] as string[], users: rest[3] as string[], targets: rest[4] as string[], - data: rest[5] as object, + data: rest[5] as object | null, action: rest[6] as string, image: rest[7] as string, icon: rest[8] as string, @@ -872,7 +898,7 @@ export class Messaging { tag: rest[11] as string, badge: rest[12] as number, draft: rest[13] as boolean, - scheduledAt: rest[14] as string, + scheduledAt: rest[14] as string | null, contentAvailable: rest[15] as boolean, critical: rest[16] as boolean, priority: rest[17] as MessagePriority, @@ -990,7 +1016,7 @@ export class Messaging { users: [], targets: [], deliveredTotal: 0, - data: [], + data: {}, status: 'draft', }, }, @@ -1005,168 +1031,168 @@ export class Messaging { * * * @param {string} params.messageId - Message ID. - * @param {string} params.title - Title for push notification. - * @param {string} params.body - Body for push notification. - * @param {string[]} params.topics - List of Topic IDs. - * @param {string[]} params.users - List of User IDs. - * @param {string[]} params.targets - List of Targets IDs. - * @param {object} params.data - Additional Data for push notification. - * @param {string} params.action - Action for push notification. - * @param {string} params.image - Image for push notification. Must be a compound bucket ID to file ID of a jpeg, png, or bmp image in Appwrite Storage. It should be formatted as <BUCKET_ID>:<FILE_ID>. - * @param {string} params.icon - Icon for push notification. Available only for Android and Web platforms. - * @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 {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. - * @param {boolean} params.critical - If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform. - * @param {MessagePriority} params.priority - Set the notification priority. "normal" will consider device battery state and may send notifications later. "high" will always attempt to immediately deliver the notification. - * @param {string} params.channelId - ID of the notification channel to deliver the notification on. The app must have already created a channel with this ID, otherwise the channel from the app manifest is used. Pass an empty string to clear it. Available only for Android platforms. + * @param {string[] | null} params.topics - List of Topic IDs. + * @param {string[] | null} params.users - List of User IDs. + * @param {string[] | null} params.targets - List of Targets IDs. + * @param {string | null} params.title - Title for push notification. + * @param {string | null} params.body - Body for push notification. + * @param {object | null} params.data - Additional Data for push notification. + * @param {string | null} params.action - Action for push notification. + * @param {string | null} params.image - Image for push notification. Must be a compound bucket ID to file ID of a jpeg, png, or bmp image in Appwrite Storage. It should be formatted as <BUCKET_ID>:<FILE_ID>. + * @param {string | null} params.icon - Icon for push notification. Available only for Android and Web platforms. + * @param {string | null} params.sound - Sound for push notification. Available only for Android and iOS platforms. + * @param {string | null} params.color - Color for push notification. Available only for Android platforms. + * @param {string | null} params.tag - Tag for push notification. Available only for Android platforms. + * @param {number | null} params.badge - Badge for push notification. Available only for iOS platforms. + * @param {boolean | null} params.draft - Is message a draft + * @param {string | null} 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 | null} params.contentAvailable - If set to true, the notification will be delivered in the background. Available only for iOS Platform. + * @param {boolean | null} params.critical - If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform. + * @param {MessagePriority | null} params.priority - Set the notification priority. "normal" will consider device battery state and may send notifications later. "high" will always attempt to immediately deliver the notification. + * @param {string | null} params.channelId - ID of the notification channel to deliver the notification on. The app must have already created a channel with this ID, otherwise the channel from the app manifest is used. Pass an empty string to clear it. Available only for Android platforms. * @throws {AppwriteException} * @returns {Promise<Models.Message>} */ updatePush(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; - channelId?: string; + topics?: string[] | null; + users?: string[] | null; + targets?: string[] | null; + title?: string | null; + body?: string | null; + data?: object | null; + action?: string | null; + image?: string | null; + icon?: string | null; + sound?: string | null; + color?: string | null; + tag?: string | null; + badge?: number | null; + draft?: boolean | null; + scheduledAt?: string | null; + contentAvailable?: boolean | null; + critical?: boolean | null; + priority?: MessagePriority | null; + channelId?: string | null; }): Promise<Models.Message>; /** * 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. * * * @param {string} messageId - Message ID. - * @param {string} title - Title for push notification. - * @param {string} body - Body for push notification. - * @param {string[]} topics - List of Topic IDs. - * @param {string[]} users - List of User IDs. - * @param {string[]} targets - List of Targets IDs. - * @param {object} data - Additional Data for push notification. - * @param {string} action - Action for push notification. - * @param {string} image - Image for push notification. Must be a compound bucket ID to file ID of a jpeg, png, or bmp image in Appwrite Storage. It should be formatted as <BUCKET_ID>:<FILE_ID>. - * @param {string} icon - Icon for push notification. Available only for Android and Web platforms. - * @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 {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. - * @param {boolean} critical - If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform. - * @param {MessagePriority} priority - Set the notification priority. "normal" will consider device battery state and may send notifications later. "high" will always attempt to immediately deliver the notification. - * @param {string} channelId - ID of the notification channel to deliver the notification on. The app must have already created a channel with this ID, otherwise the channel from the app manifest is used. Pass an empty string to clear it. Available only for Android platforms. + * @param {string[] | null} topics - List of Topic IDs. + * @param {string[] | null} users - List of User IDs. + * @param {string[] | null} targets - List of Targets IDs. + * @param {string | null} title - Title for push notification. + * @param {string | null} body - Body for push notification. + * @param {object | null} data - Additional Data for push notification. + * @param {string | null} action - Action for push notification. + * @param {string | null} image - Image for push notification. Must be a compound bucket ID to file ID of a jpeg, png, or bmp image in Appwrite Storage. It should be formatted as <BUCKET_ID>:<FILE_ID>. + * @param {string | null} icon - Icon for push notification. Available only for Android and Web platforms. + * @param {string | null} sound - Sound for push notification. Available only for Android and iOS platforms. + * @param {string | null} color - Color for push notification. Available only for Android platforms. + * @param {string | null} tag - Tag for push notification. Available only for Android platforms. + * @param {number | null} badge - Badge for push notification. Available only for iOS platforms. + * @param {boolean | null} draft - Is message a draft + * @param {string | null} 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 | null} contentAvailable - If set to true, the notification will be delivered in the background. Available only for iOS Platform. + * @param {boolean | null} critical - If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform. + * @param {MessagePriority | null} priority - Set the notification priority. "normal" will consider device battery state and may send notifications later. "high" will always attempt to immediately deliver the notification. + * @param {string | null} channelId - ID of the notification channel to deliver the notification on. The app must have already created a channel with this ID, otherwise the channel from the app manifest is used. Pass an empty string to clear it. Available only for Android platforms. * @throws {AppwriteException} * @returns {Promise<Models.Message>} * @deprecated Use the object parameter style method for a better developer experience. */ updatePush( 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, - channelId?: string, + topics?: string[] | null, + users?: string[] | null, + targets?: string[] | null, + title?: string | null, + body?: string | null, + data?: object | null, + action?: string | null, + image?: string | null, + icon?: string | null, + sound?: string | null, + color?: string | null, + tag?: string | null, + badge?: number | null, + draft?: boolean | null, + scheduledAt?: string | null, + contentAvailable?: boolean | null, + critical?: boolean | null, + priority?: MessagePriority | null, + channelId?: string | null, ): Promise<Models.Message>; updatePush( 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; - channelId?: string; + topics?: string[] | null; + users?: string[] | null; + targets?: string[] | null; + title?: string | null; + body?: string | null; + data?: object | null; + action?: string | null; + image?: string | null; + icon?: string | null; + sound?: string | null; + color?: string | null; + tag?: string | null; + badge?: number | null; + draft?: boolean | null; + scheduledAt?: string | null; + contentAvailable?: boolean | null; + critical?: boolean | null; + priority?: MessagePriority | null; + channelId?: string | null; } | string, - ...rest: [ - string?, - string?, - string[]?, - string[]?, - string[]?, - object?, - string?, - string?, - string?, - string?, - string?, - string?, - number?, - boolean?, - string?, - boolean?, - boolean?, - MessagePriority?, - string?, - ] - ): Promise<Models.Message> { - 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; - channelId?: string; + ...rest: [ + (string[] | null)?, + (string[] | null)?, + (string[] | null)?, + (string | null)?, + (string | null)?, + (object | null)?, + (string | null)?, + (string | null)?, + (string | null)?, + (string | null)?, + (string | null)?, + (string | null)?, + (number | null)?, + (boolean | null)?, + (string | null)?, + (boolean | null)?, + (boolean | null)?, + (MessagePriority | null)?, + (string | null)?, + ] + ): Promise<Models.Message> { + let params: { + messageId: string; + topics?: string[] | null; + users?: string[] | null; + targets?: string[] | null; + title?: string | null; + body?: string | null; + data?: object | null; + action?: string | null; + image?: string | null; + icon?: string | null; + sound?: string | null; + color?: string | null; + tag?: string | null; + badge?: number | null; + draft?: boolean | null; + scheduledAt?: string | null; + contentAvailable?: boolean | null; + critical?: boolean | null; + priority?: MessagePriority | null; + channelId?: string | null; }; if ( @@ -1176,57 +1202,57 @@ export class Messaging { ) { 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; - channelId?: string; + topics?: string[] | null; + users?: string[] | null; + targets?: string[] | null; + title?: string | null; + body?: string | null; + data?: object | null; + action?: string | null; + image?: string | null; + icon?: string | null; + sound?: string | null; + color?: string | null; + tag?: string | null; + badge?: number | null; + draft?: boolean | null; + scheduledAt?: string | null; + contentAvailable?: boolean | null; + critical?: boolean | null; + priority?: MessagePriority | null; + channelId?: string | null; }; } else { params = { messageId: paramsOrFirst as string, - title: rest[0] as string, - body: rest[1] as string, - topics: rest[2] as string[], - users: rest[3] as string[], - targets: rest[4] as string[], - data: rest[5] as object, - action: rest[6] as string, - image: rest[7] as string, - icon: rest[8] as string, - sound: rest[9] as string, - color: rest[10] as string, - tag: rest[11] as string, - badge: rest[12] as number, - draft: rest[13] as boolean, - scheduledAt: rest[14] as string, - contentAvailable: rest[15] as boolean, - critical: rest[16] as boolean, - priority: rest[17] as MessagePriority, - channelId: rest[18] as string, + topics: rest[0] as string[] | null, + users: rest[1] as string[] | null, + targets: rest[2] as string[] | null, + title: rest[3] as string | null, + body: rest[4] as string | null, + data: rest[5] as object | null, + action: rest[6] as string | null, + image: rest[7] as string | null, + icon: rest[8] as string | null, + sound: rest[9] as string | null, + color: rest[10] as string | null, + tag: rest[11] as string | null, + badge: rest[12] as number | null, + draft: rest[13] as boolean | null, + scheduledAt: rest[14] as string | null, + contentAvailable: rest[15] as boolean | null, + critical: rest[16] as boolean | null, + priority: rest[17] as MessagePriority | null, + channelId: rest[18] as string | null, }; } const messageId = params.messageId; - const title = params.title; - const body = params.body; const topics = params.topics; const users = params.users; const targets = params.targets; + const title = params.title; + const body = params.body; const data = params.data; const action = params.action; const image = params.image; @@ -1252,12 +1278,6 @@ export class Messaging { encodeURIComponent(String(messageId)), ); const apiPayload: Payload = {}; - if (typeof title !== 'undefined') { - apiPayload['title'] = title; - } - if (typeof body !== 'undefined') { - apiPayload['body'] = body; - } if (typeof topics !== 'undefined') { apiPayload['topics'] = topics; } @@ -1267,6 +1287,12 @@ export class Messaging { if (typeof targets !== 'undefined') { apiPayload['targets'] = targets; } + if (typeof title !== 'undefined') { + apiPayload['title'] = title; + } + if (typeof body !== 'undefined') { + apiPayload['body'] = body; + } if (typeof data !== 'undefined') { apiPayload['data'] = data; } @@ -1331,7 +1357,7 @@ export class Messaging { users: [], targets: [], deliveredTotal: 0, - data: [], + data: {}, status: 'draft', }, }, @@ -1350,7 +1376,7 @@ export class Messaging { * @param {string[]} params.users - List of User IDs. * @param {string[]} params.targets - List of Targets IDs. * @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 {string | null} 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. * @throws {AppwriteException} * @returns {Promise<Models.Message>} * @deprecated This API has been deprecated since 1.8.0. Please use `Messaging.createSMS` instead. @@ -1362,7 +1388,7 @@ export class Messaging { users?: string[]; targets?: string[]; draft?: boolean; - scheduledAt?: string; + scheduledAt?: string | null; }): Promise<Models.Message>; /** * Create a new SMS message. @@ -1373,7 +1399,7 @@ export class Messaging { * @param {string[]} users - List of User IDs. * @param {string[]} targets - List of Targets IDs. * @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 {string | null} 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. * @throws {AppwriteException} * @returns {Promise<Models.Message>} * @deprecated Use the object parameter style method for a better developer experience. @@ -1385,7 +1411,7 @@ export class Messaging { users?: string[], targets?: string[], draft?: boolean, - scheduledAt?: string, + scheduledAt?: string | null, ): Promise<Models.Message>; createSms( paramsOrFirst: @@ -1396,10 +1422,17 @@ export class Messaging { users?: string[]; targets?: string[]; draft?: boolean; - scheduledAt?: string; + scheduledAt?: string | null; } | string, - ...rest: [string?, string[]?, string[]?, string[]?, boolean?, string?] + ...rest: [ + string?, + string[]?, + string[]?, + string[]?, + boolean?, + (string | null)?, + ] ): Promise<Models.Message> { let params: { messageId: string; @@ -1408,7 +1441,7 @@ export class Messaging { users?: string[]; targets?: string[]; draft?: boolean; - scheduledAt?: string; + scheduledAt?: string | null; }; if ( @@ -1423,7 +1456,7 @@ export class Messaging { users?: string[]; targets?: string[]; draft?: boolean; - scheduledAt?: string; + scheduledAt?: string | null; }; } else { params = { @@ -1433,7 +1466,7 @@ export class Messaging { users: rest[2] as string[], targets: rest[3] as string[], draft: rest[4] as boolean, - scheduledAt: rest[5] as string, + scheduledAt: rest[5] as string | null, }; } @@ -1500,7 +1533,7 @@ export class Messaging { users: [], targets: [], deliveredTotal: 0, - data: [], + data: {}, status: 'draft', }, }, @@ -1519,7 +1552,7 @@ export class Messaging { * @param {string[]} params.users - List of User IDs. * @param {string[]} params.targets - List of Targets IDs. * @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 {string | null} 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. * @throws {AppwriteException} * @returns {Promise<Models.Message>} */ @@ -1530,7 +1563,7 @@ export class Messaging { users?: string[]; targets?: string[]; draft?: boolean; - scheduledAt?: string; + scheduledAt?: string | null; }): Promise<Models.Message>; /** * Create a new SMS message. @@ -1541,7 +1574,7 @@ export class Messaging { * @param {string[]} users - List of User IDs. * @param {string[]} targets - List of Targets IDs. * @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 {string | null} 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. * @throws {AppwriteException} * @returns {Promise<Models.Message>} * @deprecated Use the object parameter style method for a better developer experience. @@ -1553,7 +1586,7 @@ export class Messaging { users?: string[], targets?: string[], draft?: boolean, - scheduledAt?: string, + scheduledAt?: string | null, ): Promise<Models.Message>; createSMS( paramsOrFirst: @@ -1564,10 +1597,17 @@ export class Messaging { users?: string[]; targets?: string[]; draft?: boolean; - scheduledAt?: string; + scheduledAt?: string | null; } | string, - ...rest: [string?, string[]?, string[]?, string[]?, boolean?, string?] + ...rest: [ + string?, + string[]?, + string[]?, + string[]?, + boolean?, + (string | null)?, + ] ): Promise<Models.Message> { let params: { messageId: string; @@ -1576,7 +1616,7 @@ export class Messaging { users?: string[]; targets?: string[]; draft?: boolean; - scheduledAt?: string; + scheduledAt?: string | null; }; if ( @@ -1591,7 +1631,7 @@ export class Messaging { users?: string[]; targets?: string[]; draft?: boolean; - scheduledAt?: string; + scheduledAt?: string | null; }; } else { params = { @@ -1601,7 +1641,7 @@ export class Messaging { users: rest[2] as string[], targets: rest[3] as string[], draft: rest[4] as boolean, - scheduledAt: rest[5] as string, + scheduledAt: rest[5] as string | null, }; } @@ -1668,7 +1708,7 @@ export class Messaging { users: [], targets: [], deliveredTotal: 0, - data: [], + data: {}, status: 'draft', }, }, @@ -1683,71 +1723,78 @@ export class Messaging { * * * @param {string} params.messageId - Message ID. - * @param {string} params.content - Email Content. - * @param {string[]} params.topics - List of Topic IDs. - * @param {string[]} params.users - List of User IDs. - * @param {string[]} params.targets - List of Targets IDs. - * @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 {string[] | null} params.topics - List of Topic IDs. + * @param {string[] | null} params.users - List of User IDs. + * @param {string[] | null} params.targets - List of Targets IDs. + * @param {string | null} params.content - Email Content. + * @param {boolean | null} params.draft - Is message a draft + * @param {string | null} 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. * @throws {AppwriteException} * @returns {Promise<Models.Message>} * @deprecated This API has been deprecated since 1.8.0. Please use `Messaging.updateSMS` instead. */ updateSms(params: { messageId: string; - content?: string; - topics?: string[]; - users?: string[]; - targets?: string[]; - draft?: boolean; - scheduledAt?: string; + topics?: string[] | null; + users?: string[] | null; + targets?: string[] | null; + content?: string | null; + draft?: boolean | null; + scheduledAt?: string | null; }): Promise<Models.Message>; /** * Update an SMS message 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. * * * @param {string} messageId - Message ID. - * @param {string} content - Email Content. - * @param {string[]} topics - List of Topic IDs. - * @param {string[]} users - List of User IDs. - * @param {string[]} targets - List of Targets IDs. - * @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 {string[] | null} topics - List of Topic IDs. + * @param {string[] | null} users - List of User IDs. + * @param {string[] | null} targets - List of Targets IDs. + * @param {string | null} content - Email Content. + * @param {boolean | null} draft - Is message a draft + * @param {string | null} 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. * @throws {AppwriteException} * @returns {Promise<Models.Message>} * @deprecated Use the object parameter style method for a better developer experience. */ updateSms( messageId: string, - content?: string, - topics?: string[], - users?: string[], - targets?: string[], - draft?: boolean, - scheduledAt?: string, + topics?: string[] | null, + users?: string[] | null, + targets?: string[] | null, + content?: string | null, + draft?: boolean | null, + scheduledAt?: string | null, ): Promise<Models.Message>; updateSms( paramsOrFirst: | { messageId: string; - content?: string; - topics?: string[]; - users?: string[]; - targets?: string[]; - draft?: boolean; - scheduledAt?: string; + topics?: string[] | null; + users?: string[] | null; + targets?: string[] | null; + content?: string | null; + draft?: boolean | null; + scheduledAt?: string | null; } | string, - ...rest: [string?, string[]?, string[]?, string[]?, boolean?, string?] + ...rest: [ + (string[] | null)?, + (string[] | null)?, + (string[] | null)?, + (string | null)?, + (boolean | null)?, + (string | null)?, + ] ): Promise<Models.Message> { let params: { messageId: string; - content?: string; - topics?: string[]; - users?: string[]; - targets?: string[]; - draft?: boolean; - scheduledAt?: string; + topics?: string[] | null; + users?: string[] | null; + targets?: string[] | null; + content?: string | null; + draft?: boolean | null; + scheduledAt?: string | null; }; if ( @@ -1757,30 +1804,30 @@ export class Messaging { ) { params = (paramsOrFirst || {}) as { messageId: string; - content?: string; - topics?: string[]; - users?: string[]; - targets?: string[]; - draft?: boolean; - scheduledAt?: string; + topics?: string[] | null; + users?: string[] | null; + targets?: string[] | null; + content?: string | null; + draft?: boolean | null; + scheduledAt?: string | null; }; } else { params = { messageId: paramsOrFirst as string, - content: rest[0] as string, - topics: rest[1] as string[], - users: rest[2] as string[], - targets: rest[3] as string[], - draft: rest[4] as boolean, - scheduledAt: rest[5] as string, + topics: rest[0] as string[] | null, + users: rest[1] as string[] | null, + targets: rest[2] as string[] | null, + content: rest[3] as string | null, + draft: rest[4] as boolean | null, + scheduledAt: rest[5] as string | null, }; } const messageId = params.messageId; - const content = params.content; const topics = params.topics; const users = params.users; const targets = params.targets; + const content = params.content; const draft = params.draft; const scheduledAt = params.scheduledAt; @@ -1794,9 +1841,6 @@ export class Messaging { encodeURIComponent(String(messageId)), ); const apiPayload: Payload = {}; - if (typeof content !== 'undefined') { - apiPayload['content'] = content; - } if (typeof topics !== 'undefined') { apiPayload['topics'] = topics; } @@ -1806,6 +1850,9 @@ export class Messaging { if (typeof targets !== 'undefined') { apiPayload['targets'] = targets; } + if (typeof content !== 'undefined') { + apiPayload['content'] = content; + } if (typeof draft !== 'undefined') { apiPayload['draft'] = draft; } @@ -1834,7 +1881,7 @@ export class Messaging { users: [], targets: [], deliveredTotal: 0, - data: [], + data: {}, status: 'draft', }, }, @@ -1849,70 +1896,77 @@ export class Messaging { * * * @param {string} params.messageId - Message ID. - * @param {string} params.content - Email Content. - * @param {string[]} params.topics - List of Topic IDs. - * @param {string[]} params.users - List of User IDs. - * @param {string[]} params.targets - List of Targets IDs. - * @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 {string[] | null} params.topics - List of Topic IDs. + * @param {string[] | null} params.users - List of User IDs. + * @param {string[] | null} params.targets - List of Targets IDs. + * @param {string | null} params.content - Email Content. + * @param {boolean | null} params.draft - Is message a draft + * @param {string | null} 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. * @throws {AppwriteException} * @returns {Promise<Models.Message>} */ updateSMS(params: { messageId: string; - content?: string; - topics?: string[]; - users?: string[]; - targets?: string[]; - draft?: boolean; - scheduledAt?: string; + topics?: string[] | null; + users?: string[] | null; + targets?: string[] | null; + content?: string | null; + draft?: boolean | null; + scheduledAt?: string | null; }): Promise<Models.Message>; /** * Update an SMS message 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. * * * @param {string} messageId - Message ID. - * @param {string} content - Email Content. - * @param {string[]} topics - List of Topic IDs. - * @param {string[]} users - List of User IDs. - * @param {string[]} targets - List of Targets IDs. - * @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 {string[] | null} topics - List of Topic IDs. + * @param {string[] | null} users - List of User IDs. + * @param {string[] | null} targets - List of Targets IDs. + * @param {string | null} content - Email Content. + * @param {boolean | null} draft - Is message a draft + * @param {string | null} 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. * @throws {AppwriteException} * @returns {Promise<Models.Message>} * @deprecated Use the object parameter style method for a better developer experience. */ updateSMS( messageId: string, - content?: string, - topics?: string[], - users?: string[], - targets?: string[], - draft?: boolean, - scheduledAt?: string, + topics?: string[] | null, + users?: string[] | null, + targets?: string[] | null, + content?: string | null, + draft?: boolean | null, + scheduledAt?: string | null, ): Promise<Models.Message>; updateSMS( paramsOrFirst: | { messageId: string; - content?: string; - topics?: string[]; - users?: string[]; - targets?: string[]; - draft?: boolean; - scheduledAt?: string; + topics?: string[] | null; + users?: string[] | null; + targets?: string[] | null; + content?: string | null; + draft?: boolean | null; + scheduledAt?: string | null; } | string, - ...rest: [string?, string[]?, string[]?, string[]?, boolean?, string?] + ...rest: [ + (string[] | null)?, + (string[] | null)?, + (string[] | null)?, + (string | null)?, + (boolean | null)?, + (string | null)?, + ] ): Promise<Models.Message> { let params: { messageId: string; - content?: string; - topics?: string[]; - users?: string[]; - targets?: string[]; - draft?: boolean; - scheduledAt?: string; + topics?: string[] | null; + users?: string[] | null; + targets?: string[] | null; + content?: string | null; + draft?: boolean | null; + scheduledAt?: string | null; }; if ( @@ -1922,30 +1976,30 @@ export class Messaging { ) { params = (paramsOrFirst || {}) as { messageId: string; - content?: string; - topics?: string[]; - users?: string[]; - targets?: string[]; - draft?: boolean; - scheduledAt?: string; + topics?: string[] | null; + users?: string[] | null; + targets?: string[] | null; + content?: string | null; + draft?: boolean | null; + scheduledAt?: string | null; }; } else { params = { messageId: paramsOrFirst as string, - content: rest[0] as string, - topics: rest[1] as string[], - users: rest[2] as string[], - targets: rest[3] as string[], - draft: rest[4] as boolean, - scheduledAt: rest[5] as string, + topics: rest[0] as string[] | null, + users: rest[1] as string[] | null, + targets: rest[2] as string[] | null, + content: rest[3] as string | null, + draft: rest[4] as boolean | null, + scheduledAt: rest[5] as string | null, }; } const messageId = params.messageId; - const content = params.content; const topics = params.topics; const users = params.users; const targets = params.targets; + const content = params.content; const draft = params.draft; const scheduledAt = params.scheduledAt; @@ -1959,9 +2013,6 @@ export class Messaging { encodeURIComponent(String(messageId)), ); const apiPayload: Payload = {}; - if (typeof content !== 'undefined') { - apiPayload['content'] = content; - } if (typeof topics !== 'undefined') { apiPayload['topics'] = topics; } @@ -1971,6 +2022,9 @@ export class Messaging { if (typeof targets !== 'undefined') { apiPayload['targets'] = targets; } + if (typeof content !== 'undefined') { + apiPayload['content'] = content; + } if (typeof draft !== 'undefined') { apiPayload['draft'] = draft; } @@ -1999,7 +2053,7 @@ export class Messaging { users: [], targets: [], deliveredTotal: 0, - data: [], + data: {}, status: 'draft', }, }, @@ -2078,7 +2132,7 @@ export class Messaging { users: [], targets: [], deliveredTotal: 0, - data: [], + data: {}, status: 'draft', }, }, @@ -2358,7 +2412,7 @@ export class Messaging { provider: '', enabled: true, type: '', - credentials: [], + credentials: {}, }, }, }, @@ -2377,7 +2431,7 @@ export class Messaging { * @param {string} params.teamId - APNS team ID. * @param {string} params.bundleId - APNS bundle ID. * @param {boolean} params.sandbox - Use APNS sandbox environment. - * @param {boolean} params.enabled - Set as enabled. + * @param {boolean | null} params.enabled - Set as enabled. * @throws {AppwriteException} * @returns {Promise<Models.Provider>} * @deprecated This API has been deprecated since 1.8.0. Please use `Messaging.createAPNSProvider` instead. @@ -2390,7 +2444,7 @@ export class Messaging { teamId?: string; bundleId?: string; sandbox?: boolean; - enabled?: boolean; + enabled?: boolean | null; }): Promise<Models.Provider>; /** * Create a new Apple Push Notification service provider. @@ -2402,7 +2456,7 @@ export class Messaging { * @param {string} teamId - APNS team ID. * @param {string} bundleId - APNS bundle ID. * @param {boolean} sandbox - Use APNS sandbox environment. - * @param {boolean} enabled - Set as enabled. + * @param {boolean | null} enabled - Set as enabled. * @throws {AppwriteException} * @returns {Promise<Models.Provider>} * @deprecated Use the object parameter style method for a better developer experience. @@ -2415,7 +2469,7 @@ export class Messaging { teamId?: string, bundleId?: string, sandbox?: boolean, - enabled?: boolean, + enabled?: boolean | null, ): Promise<Models.Provider>; createApnsProvider( paramsOrFirst: @@ -2427,7 +2481,7 @@ export class Messaging { teamId?: string; bundleId?: string; sandbox?: boolean; - enabled?: boolean; + enabled?: boolean | null; } | string, ...rest: [ @@ -2437,7 +2491,7 @@ export class Messaging { string?, string?, boolean?, - boolean?, + (boolean | null)?, ] ): Promise<Models.Provider> { let params: { @@ -2448,7 +2502,7 @@ export class Messaging { teamId?: string; bundleId?: string; sandbox?: boolean; - enabled?: boolean; + enabled?: boolean | null; }; if ( @@ -2464,7 +2518,7 @@ export class Messaging { teamId?: string; bundleId?: string; sandbox?: boolean; - enabled?: boolean; + enabled?: boolean | null; }; } else { params = { @@ -2475,7 +2529,7 @@ export class Messaging { teamId: rest[3] as string, bundleId: rest[4] as string, sandbox: rest[5] as boolean, - enabled: rest[6] as boolean, + enabled: rest[6] as boolean | null, }; } @@ -2543,7 +2597,7 @@ export class Messaging { provider: '', enabled: true, type: '', - credentials: [], + credentials: {}, }, }, }, @@ -2562,7 +2616,7 @@ export class Messaging { * @param {string} params.teamId - APNS team ID. * @param {string} params.bundleId - APNS bundle ID. * @param {boolean} params.sandbox - Use APNS sandbox environment. - * @param {boolean} params.enabled - Set as enabled. + * @param {boolean | null} params.enabled - Set as enabled. * @throws {AppwriteException} * @returns {Promise<Models.Provider>} */ @@ -2574,7 +2628,7 @@ export class Messaging { teamId?: string; bundleId?: string; sandbox?: boolean; - enabled?: boolean; + enabled?: boolean | null; }): Promise<Models.Provider>; /** * Create a new Apple Push Notification service provider. @@ -2586,7 +2640,7 @@ export class Messaging { * @param {string} teamId - APNS team ID. * @param {string} bundleId - APNS bundle ID. * @param {boolean} sandbox - Use APNS sandbox environment. - * @param {boolean} enabled - Set as enabled. + * @param {boolean | null} enabled - Set as enabled. * @throws {AppwriteException} * @returns {Promise<Models.Provider>} * @deprecated Use the object parameter style method for a better developer experience. @@ -2599,7 +2653,7 @@ export class Messaging { teamId?: string, bundleId?: string, sandbox?: boolean, - enabled?: boolean, + enabled?: boolean | null, ): Promise<Models.Provider>; createAPNSProvider( paramsOrFirst: @@ -2611,7 +2665,7 @@ export class Messaging { teamId?: string; bundleId?: string; sandbox?: boolean; - enabled?: boolean; + enabled?: boolean | null; } | string, ...rest: [ @@ -2621,7 +2675,7 @@ export class Messaging { string?, string?, boolean?, - boolean?, + (boolean | null)?, ] ): Promise<Models.Provider> { let params: { @@ -2632,7 +2686,7 @@ export class Messaging { teamId?: string; bundleId?: string; sandbox?: boolean; - enabled?: boolean; + enabled?: boolean | null; }; if ( @@ -2648,7 +2702,7 @@ export class Messaging { teamId?: string; bundleId?: string; sandbox?: boolean; - enabled?: boolean; + enabled?: boolean | null; }; } else { params = { @@ -2659,7 +2713,7 @@ export class Messaging { teamId: rest[3] as string, bundleId: rest[4] as string, sandbox: rest[5] as boolean, - enabled: rest[6] as boolean, + enabled: rest[6] as boolean | null, }; } @@ -2727,7 +2781,7 @@ export class Messaging { provider: '', enabled: true, type: '', - credentials: [], + credentials: {}, }, }, }, @@ -2741,12 +2795,12 @@ export class Messaging { * * @param {string} params.providerId - Provider ID. * @param {string} params.name - Provider name. - * @param {boolean} params.enabled - Set as enabled. + * @param {boolean | null} params.enabled - Set as enabled. * @param {string} params.authKey - APNS authentication key. * @param {string} params.authKeyId - APNS authentication key ID. * @param {string} params.teamId - APNS team ID. * @param {string} params.bundleId - APNS bundle ID. - * @param {boolean} params.sandbox - Use APNS sandbox environment. + * @param {boolean | null} params.sandbox - Use APNS sandbox environment. * @throws {AppwriteException} * @returns {Promise<Models.Provider>} * @deprecated This API has been deprecated since 1.8.0. Please use `Messaging.updateAPNSProvider` instead. @@ -2754,24 +2808,24 @@ export class Messaging { updateApnsProvider(params: { providerId: string; name?: string; - enabled?: boolean; + enabled?: boolean | null; authKey?: string; authKeyId?: string; teamId?: string; bundleId?: string; - sandbox?: boolean; + sandbox?: boolean | null; }): Promise<Models.Provider>; /** * Update a Apple Push Notification service provider by its unique ID. * * @param {string} providerId - Provider ID. * @param {string} name - Provider name. - * @param {boolean} enabled - Set as enabled. + * @param {boolean | null} enabled - Set as enabled. * @param {string} authKey - APNS authentication key. * @param {string} authKeyId - APNS authentication key ID. * @param {string} teamId - APNS team ID. * @param {string} bundleId - APNS bundle ID. - * @param {boolean} sandbox - Use APNS sandbox environment. + * @param {boolean | null} sandbox - Use APNS sandbox environment. * @throws {AppwriteException} * @returns {Promise<Models.Provider>} * @deprecated Use the object parameter style method for a better developer experience. @@ -2779,45 +2833,45 @@ export class Messaging { updateApnsProvider( providerId: string, name?: string, - enabled?: boolean, + enabled?: boolean | null, authKey?: string, authKeyId?: string, teamId?: string, bundleId?: string, - sandbox?: boolean, + sandbox?: boolean | null, ): Promise<Models.Provider>; updateApnsProvider( paramsOrFirst: | { providerId: string; name?: string; - enabled?: boolean; + enabled?: boolean | null; authKey?: string; authKeyId?: string; teamId?: string; bundleId?: string; - sandbox?: boolean; + sandbox?: boolean | null; } | string, ...rest: [ string?, - boolean?, + (boolean | null)?, string?, string?, string?, string?, - boolean?, + (boolean | null)?, ] ): Promise<Models.Provider> { let params: { providerId: string; name?: string; - enabled?: boolean; + enabled?: boolean | null; authKey?: string; authKeyId?: string; teamId?: string; bundleId?: string; - sandbox?: boolean; + sandbox?: boolean | null; }; if ( @@ -2828,23 +2882,23 @@ export class Messaging { params = (paramsOrFirst || {}) as { providerId: string; name?: string; - enabled?: boolean; + enabled?: boolean | null; authKey?: string; authKeyId?: string; teamId?: string; bundleId?: string; - sandbox?: boolean; + sandbox?: boolean | null; }; } else { params = { providerId: paramsOrFirst as string, name: rest[0] as string, - enabled: rest[1] as boolean, + enabled: rest[1] as boolean | null, authKey: rest[2] as string, authKeyId: rest[3] as string, teamId: rest[4] as string, bundleId: rest[5] as string, - sandbox: rest[6] as boolean, + sandbox: rest[6] as boolean | null, }; } @@ -2909,7 +2963,7 @@ export class Messaging { provider: '', enabled: true, type: '', - credentials: [], + credentials: {}, }, }, }, @@ -2923,36 +2977,36 @@ export class Messaging { * * @param {string} params.providerId - Provider ID. * @param {string} params.name - Provider name. - * @param {boolean} params.enabled - Set as enabled. + * @param {boolean | null} params.enabled - Set as enabled. * @param {string} params.authKey - APNS authentication key. * @param {string} params.authKeyId - APNS authentication key ID. * @param {string} params.teamId - APNS team ID. * @param {string} params.bundleId - APNS bundle ID. - * @param {boolean} params.sandbox - Use APNS sandbox environment. + * @param {boolean | null} params.sandbox - Use APNS sandbox environment. * @throws {AppwriteException} * @returns {Promise<Models.Provider>} */ updateAPNSProvider(params: { providerId: string; name?: string; - enabled?: boolean; + enabled?: boolean | null; authKey?: string; authKeyId?: string; teamId?: string; bundleId?: string; - sandbox?: boolean; + sandbox?: boolean | null; }): Promise<Models.Provider>; /** * Update a Apple Push Notification service provider by its unique ID. * * @param {string} providerId - Provider ID. * @param {string} name - Provider name. - * @param {boolean} enabled - Set as enabled. + * @param {boolean | null} enabled - Set as enabled. * @param {string} authKey - APNS authentication key. * @param {string} authKeyId - APNS authentication key ID. * @param {string} teamId - APNS team ID. * @param {string} bundleId - APNS bundle ID. - * @param {boolean} sandbox - Use APNS sandbox environment. + * @param {boolean | null} sandbox - Use APNS sandbox environment. * @throws {AppwriteException} * @returns {Promise<Models.Provider>} * @deprecated Use the object parameter style method for a better developer experience. @@ -2960,45 +3014,45 @@ export class Messaging { updateAPNSProvider( providerId: string, name?: string, - enabled?: boolean, + enabled?: boolean | null, authKey?: string, authKeyId?: string, teamId?: string, bundleId?: string, - sandbox?: boolean, + sandbox?: boolean | null, ): Promise<Models.Provider>; updateAPNSProvider( paramsOrFirst: | { providerId: string; name?: string; - enabled?: boolean; + enabled?: boolean | null; authKey?: string; authKeyId?: string; teamId?: string; bundleId?: string; - sandbox?: boolean; + sandbox?: boolean | null; } | string, ...rest: [ string?, - boolean?, + (boolean | null)?, string?, string?, string?, string?, - boolean?, + (boolean | null)?, ] ): Promise<Models.Provider> { let params: { providerId: string; name?: string; - enabled?: boolean; + enabled?: boolean | null; authKey?: string; authKeyId?: string; teamId?: string; bundleId?: string; - sandbox?: boolean; + sandbox?: boolean | null; }; if ( @@ -3009,23 +3063,23 @@ export class Messaging { params = (paramsOrFirst || {}) as { providerId: string; name?: string; - enabled?: boolean; + enabled?: boolean | null; authKey?: string; authKeyId?: string; teamId?: string; bundleId?: string; - sandbox?: boolean; + sandbox?: boolean | null; }; } else { params = { providerId: paramsOrFirst as string, name: rest[0] as string, - enabled: rest[1] as boolean, + enabled: rest[1] as boolean | null, authKey: rest[2] as string, authKeyId: rest[3] as string, teamId: rest[4] as string, bundleId: rest[5] as string, - sandbox: rest[6] as boolean, + sandbox: rest[6] as boolean | null, }; } @@ -3090,7 +3144,7 @@ export class Messaging { provider: '', enabled: true, type: '', - credentials: [], + credentials: {}, }, }, }, @@ -3104,27 +3158,27 @@ 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 {boolean} params.enabled - Set as enabled. - * @param {number} params.qos - Default QoS for topics on this provider (0 or 1). Null lets the subscriber choose. - * @param {number} params.expiry - Default message retention in seconds for offline delivery. Max 7 days (604800). + * @param {boolean | null} params.enabled - Set as enabled. + * @param {number | null} params.qos - Default QoS for topics on this provider (0 or 1). Null lets the subscriber choose. + * @param {number | null} params.expiry - Default message retention in seconds for offline delivery. Max 7 days (604800). Applies to topics with a null expiry; the lowest across enabled Appwrite providers wins. * @throws {AppwriteException} * @returns {Promise<Models.Provider>} */ createAppwriteProvider(params: { providerId: string; name: string; - enabled?: boolean; - qos?: number; - expiry?: number; + enabled?: boolean | null; + qos?: number | null; + expiry?: number | null; }): Promise<Models.Provider>; /** * Create a new Appwrite push 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 {boolean} enabled - Set as enabled. - * @param {number} qos - Default QoS for topics on this provider (0 or 1). Null lets the subscriber choose. - * @param {number} expiry - Default message retention in seconds for offline delivery. Max 7 days (604800). + * @param {boolean | null} enabled - Set as enabled. + * @param {number | null} qos - Default QoS for topics on this provider (0 or 1). Null lets the subscriber choose. + * @param {number | null} expiry - Default message retention in seconds for offline delivery. Max 7 days (604800). Applies to topics with a null expiry; the lowest across enabled Appwrite providers wins. * @throws {AppwriteException} * @returns {Promise<Models.Provider>} * @deprecated Use the object parameter style method for a better developer experience. @@ -3132,28 +3186,33 @@ export class Messaging { createAppwriteProvider( providerId: string, name: string, - enabled?: boolean, - qos?: number, - expiry?: number, + enabled?: boolean | null, + qos?: number | null, + expiry?: number | null, ): Promise<Models.Provider>; createAppwriteProvider( paramsOrFirst: | { providerId: string; name: string; - enabled?: boolean; - qos?: number; - expiry?: number; + enabled?: boolean | null; + qos?: number | null; + expiry?: number | null; } | string, - ...rest: [string?, boolean?, number?, number?] + ...rest: [ + string?, + (boolean | null)?, + (number | null)?, + (number | null)?, + ] ): Promise<Models.Provider> { let params: { providerId: string; name: string; - enabled?: boolean; - qos?: number; - expiry?: number; + enabled?: boolean | null; + qos?: number | null; + expiry?: number | null; }; if ( @@ -3164,17 +3223,17 @@ export class Messaging { params = (paramsOrFirst || {}) as { providerId: string; name: string; - enabled?: boolean; - qos?: number; - expiry?: number; + enabled?: boolean | null; + qos?: number | null; + expiry?: number | null; }; } else { params = { providerId: paramsOrFirst as string, name: rest[0] as string, - enabled: rest[1] as boolean, - qos: rest[2] as number, - expiry: rest[3] as number, + enabled: rest[1] as boolean | null, + qos: rest[2] as number | null, + expiry: rest[3] as number | null, }; } @@ -3230,7 +3289,7 @@ export class Messaging { provider: '', enabled: true, type: '', - credentials: [], + credentials: {}, }, }, }, @@ -3244,27 +3303,27 @@ export class Messaging { * * @param {string} params.providerId - Provider ID. * @param {string} params.name - Provider name. - * @param {boolean} params.enabled - Set as enabled. - * @param {number} params.qos - Default QoS for topics on this provider (0 or 1). Null lets the subscriber choose. - * @param {number} params.expiry - Default message retention in seconds for offline delivery. Max 7 days (604800). + * @param {boolean | null} params.enabled - Set as enabled. + * @param {number | null} params.qos - Default QoS for topics on this provider (0 or 1). Null lets the subscriber choose. + * @param {number | null} params.expiry - Default message retention in seconds for offline delivery. Max 7 days (604800). Applies to topics with a null expiry; the lowest across enabled Appwrite providers wins. * @throws {AppwriteException} * @returns {Promise<Models.Provider>} */ updateAppwriteProvider(params: { providerId: string; name?: string; - enabled?: boolean; - qos?: number; - expiry?: number; + enabled?: boolean | null; + qos?: number | null; + expiry?: number | null; }): Promise<Models.Provider>; /** * Update an Appwrite push provider by its unique ID. * * @param {string} providerId - Provider ID. * @param {string} name - Provider name. - * @param {boolean} enabled - Set as enabled. - * @param {number} qos - Default QoS for topics on this provider (0 or 1). Null lets the subscriber choose. - * @param {number} expiry - Default message retention in seconds for offline delivery. Max 7 days (604800). + * @param {boolean | null} enabled - Set as enabled. + * @param {number | null} qos - Default QoS for topics on this provider (0 or 1). Null lets the subscriber choose. + * @param {number | null} expiry - Default message retention in seconds for offline delivery. Max 7 days (604800). Applies to topics with a null expiry; the lowest across enabled Appwrite providers wins. * @throws {AppwriteException} * @returns {Promise<Models.Provider>} * @deprecated Use the object parameter style method for a better developer experience. @@ -3272,28 +3331,33 @@ export class Messaging { updateAppwriteProvider( providerId: string, name?: string, - enabled?: boolean, - qos?: number, - expiry?: number, + enabled?: boolean | null, + qos?: number | null, + expiry?: number | null, ): Promise<Models.Provider>; updateAppwriteProvider( paramsOrFirst: | { providerId: string; name?: string; - enabled?: boolean; - qos?: number; - expiry?: number; + enabled?: boolean | null; + qos?: number | null; + expiry?: number | null; } | string, - ...rest: [string?, boolean?, number?, number?] + ...rest: [ + string?, + (boolean | null)?, + (number | null)?, + (number | null)?, + ] ): Promise<Models.Provider> { let params: { providerId: string; name?: string; - enabled?: boolean; - qos?: number; - expiry?: number; + enabled?: boolean | null; + qos?: number | null; + expiry?: number | null; }; if ( @@ -3304,17 +3368,17 @@ export class Messaging { params = (paramsOrFirst || {}) as { providerId: string; name?: string; - enabled?: boolean; - qos?: number; - expiry?: number; + enabled?: boolean | null; + qos?: number | null; + expiry?: number | null; }; } else { params = { providerId: paramsOrFirst as string, name: rest[0] as string, - enabled: rest[1] as boolean, - qos: rest[2] as number, - expiry: rest[3] as number, + enabled: rest[1] as boolean | null, + qos: rest[2] as number | null, + expiry: rest[3] as number | null, }; } @@ -3367,7 +3431,7 @@ export class Messaging { provider: '', enabled: true, type: '', - credentials: [], + credentials: {}, }, }, }, @@ -3381,8 +3445,8 @@ 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 {object} params.serviceAccountJSON - FCM service account JSON. - * @param {boolean} params.enabled - Set as enabled. + * @param {object | null} params.serviceAccountJSON - FCM service account JSON. + * @param {boolean | null} params.enabled - Set as enabled. * @throws {AppwriteException} * @returns {Promise<Models.Provider>} * @deprecated This API has been deprecated since 1.8.0. Please use `Messaging.createFCMProvider` instead. @@ -3390,16 +3454,16 @@ export class Messaging { createFcmProvider(params: { providerId: string; name: string; - serviceAccountJSON?: object; - enabled?: boolean; + serviceAccountJSON?: object | null; + enabled?: boolean | null; }): Promise<Models.Provider>; /** * Create a new Firebase Cloud Messaging 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 {object} serviceAccountJSON - FCM service account JSON. - * @param {boolean} enabled - Set as enabled. + * @param {object | null} serviceAccountJSON - FCM service account JSON. + * @param {boolean | null} enabled - Set as enabled. * @throws {AppwriteException} * @returns {Promise<Models.Provider>} * @deprecated Use the object parameter style method for a better developer experience. @@ -3407,25 +3471,25 @@ export class Messaging { createFcmProvider( providerId: string, name: string, - serviceAccountJSON?: object, - enabled?: boolean, + serviceAccountJSON?: object | null, + enabled?: boolean | null, ): Promise<Models.Provider>; createFcmProvider( paramsOrFirst: | { providerId: string; name: string; - serviceAccountJSON?: object; - enabled?: boolean; + serviceAccountJSON?: object | null; + enabled?: boolean | null; } | string, - ...rest: [string?, object?, boolean?] + ...rest: [string?, (object | null)?, (boolean | null)?] ): Promise<Models.Provider> { let params: { providerId: string; name: string; - serviceAccountJSON?: object; - enabled?: boolean; + serviceAccountJSON?: object | null; + enabled?: boolean | null; }; if ( @@ -3436,15 +3500,15 @@ export class Messaging { params = (paramsOrFirst || {}) as { providerId: string; name: string; - serviceAccountJSON?: object; - enabled?: boolean; + serviceAccountJSON?: object | null; + enabled?: boolean | null; }; } else { params = { providerId: paramsOrFirst as string, name: rest[0] as string, - serviceAccountJSON: rest[1] as object, - enabled: rest[2] as boolean, + serviceAccountJSON: rest[1] as object | null, + enabled: rest[2] as boolean | null, }; } @@ -3496,7 +3560,7 @@ export class Messaging { provider: '', enabled: true, type: '', - credentials: [], + credentials: {}, }, }, }, @@ -3510,24 +3574,24 @@ 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 {object} params.serviceAccountJSON - FCM service account JSON. - * @param {boolean} params.enabled - Set as enabled. + * @param {object | null} params.serviceAccountJSON - FCM service account JSON. + * @param {boolean | null} params.enabled - Set as enabled. * @throws {AppwriteException} * @returns {Promise<Models.Provider>} */ createFCMProvider(params: { providerId: string; name: string; - serviceAccountJSON?: object; - enabled?: boolean; + serviceAccountJSON?: object | null; + enabled?: boolean | null; }): Promise<Models.Provider>; /** * Create a new Firebase Cloud Messaging 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 {object} serviceAccountJSON - FCM service account JSON. - * @param {boolean} enabled - Set as enabled. + * @param {object | null} serviceAccountJSON - FCM service account JSON. + * @param {boolean | null} enabled - Set as enabled. * @throws {AppwriteException} * @returns {Promise<Models.Provider>} * @deprecated Use the object parameter style method for a better developer experience. @@ -3535,25 +3599,25 @@ export class Messaging { createFCMProvider( providerId: string, name: string, - serviceAccountJSON?: object, - enabled?: boolean, + serviceAccountJSON?: object | null, + enabled?: boolean | null, ): Promise<Models.Provider>; createFCMProvider( paramsOrFirst: | { providerId: string; name: string; - serviceAccountJSON?: object; - enabled?: boolean; + serviceAccountJSON?: object | null; + enabled?: boolean | null; } | string, - ...rest: [string?, object?, boolean?] + ...rest: [string?, (object | null)?, (boolean | null)?] ): Promise<Models.Provider> { let params: { providerId: string; name: string; - serviceAccountJSON?: object; - enabled?: boolean; + serviceAccountJSON?: object | null; + enabled?: boolean | null; }; if ( @@ -3564,15 +3628,15 @@ export class Messaging { params = (paramsOrFirst || {}) as { providerId: string; name: string; - serviceAccountJSON?: object; - enabled?: boolean; + serviceAccountJSON?: object | null; + enabled?: boolean | null; }; } else { params = { providerId: paramsOrFirst as string, name: rest[0] as string, - serviceAccountJSON: rest[1] as object, - enabled: rest[2] as boolean, + serviceAccountJSON: rest[1] as object | null, + enabled: rest[2] as boolean | null, }; } @@ -3624,7 +3688,7 @@ export class Messaging { provider: '', enabled: true, type: '', - credentials: [], + credentials: {}, }, }, }, @@ -3638,8 +3702,8 @@ export class Messaging { * * @param {string} params.providerId - Provider ID. * @param {string} params.name - Provider name. - * @param {boolean} params.enabled - Set as enabled. - * @param {object} params.serviceAccountJSON - FCM service account JSON. + * @param {boolean | null} params.enabled - Set as enabled. + * @param {object | null} params.serviceAccountJSON - FCM service account JSON. * @throws {AppwriteException} * @returns {Promise<Models.Provider>} * @deprecated This API has been deprecated since 1.8.0. Please use `Messaging.updateFCMProvider` instead. @@ -3647,16 +3711,16 @@ export class Messaging { updateFcmProvider(params: { providerId: string; name?: string; - enabled?: boolean; - serviceAccountJSON?: object; + enabled?: boolean | null; + serviceAccountJSON?: object | null; }): Promise<Models.Provider>; /** * Update a Firebase Cloud Messaging provider by its unique ID. * * @param {string} providerId - Provider ID. * @param {string} name - Provider name. - * @param {boolean} enabled - Set as enabled. - * @param {object} serviceAccountJSON - FCM service account JSON. + * @param {boolean | null} enabled - Set as enabled. + * @param {object | null} serviceAccountJSON - FCM service account JSON. * @throws {AppwriteException} * @returns {Promise<Models.Provider>} * @deprecated Use the object parameter style method for a better developer experience. @@ -3664,25 +3728,25 @@ export class Messaging { updateFcmProvider( providerId: string, name?: string, - enabled?: boolean, - serviceAccountJSON?: object, + enabled?: boolean | null, + serviceAccountJSON?: object | null, ): Promise<Models.Provider>; updateFcmProvider( paramsOrFirst: | { providerId: string; name?: string; - enabled?: boolean; - serviceAccountJSON?: object; + enabled?: boolean | null; + serviceAccountJSON?: object | null; } | string, - ...rest: [string?, boolean?, object?] + ...rest: [string?, (boolean | null)?, (object | null)?] ): Promise<Models.Provider> { let params: { providerId: string; name?: string; - enabled?: boolean; - serviceAccountJSON?: object; + enabled?: boolean | null; + serviceAccountJSON?: object | null; }; if ( @@ -3693,15 +3757,15 @@ export class Messaging { params = (paramsOrFirst || {}) as { providerId: string; name?: string; - enabled?: boolean; - serviceAccountJSON?: object; + enabled?: boolean | null; + serviceAccountJSON?: object | null; }; } else { params = { providerId: paramsOrFirst as string, name: rest[0] as string, - enabled: rest[1] as boolean, - serviceAccountJSON: rest[2] as object, + enabled: rest[1] as boolean | null, + serviceAccountJSON: rest[2] as object | null, }; } @@ -3750,7 +3814,7 @@ export class Messaging { provider: '', enabled: true, type: '', - credentials: [], + credentials: {}, }, }, }, @@ -3764,24 +3828,24 @@ export class Messaging { * * @param {string} params.providerId - Provider ID. * @param {string} params.name - Provider name. - * @param {boolean} params.enabled - Set as enabled. - * @param {object} params.serviceAccountJSON - FCM service account JSON. + * @param {boolean | null} params.enabled - Set as enabled. + * @param {object | null} params.serviceAccountJSON - FCM service account JSON. * @throws {AppwriteException} * @returns {Promise<Models.Provider>} */ updateFCMProvider(params: { providerId: string; name?: string; - enabled?: boolean; - serviceAccountJSON?: object; + enabled?: boolean | null; + serviceAccountJSON?: object | null; }): Promise<Models.Provider>; /** * Update a Firebase Cloud Messaging provider by its unique ID. * * @param {string} providerId - Provider ID. * @param {string} name - Provider name. - * @param {boolean} enabled - Set as enabled. - * @param {object} serviceAccountJSON - FCM service account JSON. + * @param {boolean | null} enabled - Set as enabled. + * @param {object | null} serviceAccountJSON - FCM service account JSON. * @throws {AppwriteException} * @returns {Promise<Models.Provider>} * @deprecated Use the object parameter style method for a better developer experience. @@ -3789,25 +3853,25 @@ export class Messaging { updateFCMProvider( providerId: string, name?: string, - enabled?: boolean, - serviceAccountJSON?: object, + enabled?: boolean | null, + serviceAccountJSON?: object | null, ): Promise<Models.Provider>; updateFCMProvider( paramsOrFirst: | { providerId: string; name?: string; - enabled?: boolean; - serviceAccountJSON?: object; + enabled?: boolean | null; + serviceAccountJSON?: object | null; } | string, - ...rest: [string?, boolean?, object?] + ...rest: [string?, (boolean | null)?, (object | null)?] ): Promise<Models.Provider> { let params: { providerId: string; name?: string; - enabled?: boolean; - serviceAccountJSON?: object; + enabled?: boolean | null; + serviceAccountJSON?: object | null; }; if ( @@ -3818,15 +3882,15 @@ export class Messaging { params = (paramsOrFirst || {}) as { providerId: string; name?: string; - enabled?: boolean; - serviceAccountJSON?: object; + enabled?: boolean | null; + serviceAccountJSON?: object | null; }; } else { params = { providerId: paramsOrFirst as string, name: rest[0] as string, - enabled: rest[1] as boolean, - serviceAccountJSON: rest[2] as object, + enabled: rest[1] as boolean | null, + serviceAccountJSON: rest[2] as object | null, }; } @@ -3875,7 +3939,7 @@ export class Messaging { provider: '', enabled: true, type: '', - credentials: [], + credentials: {}, }, }, }, @@ -3891,12 +3955,12 @@ export class Messaging { * @param {string} params.name - Provider name. * @param {string} params.apiKey - Mailgun API Key. * @param {string} params.domain - Mailgun Domain. - * @param {boolean} params.isEuRegion - Set as EU region. + * @param {boolean | null} params.isEuRegion - Set as EU region. * @param {string} params.fromName - Sender Name. * @param {string} params.fromEmail - Sender email address. * @param {string} params.replyToName - Name set in the reply to field for the mail. Default value is sender name. Reply to name must have reply to email as well. * @param {string} params.replyToEmail - Email set in the reply to field for the mail. Default value is sender email. Reply to email must have reply to name as well. - * @param {boolean} params.enabled - Set as enabled. + * @param {boolean | null} params.enabled - Set as enabled. * @throws {AppwriteException} * @returns {Promise<Models.Provider>} */ @@ -3905,12 +3969,12 @@ export class Messaging { name: string; apiKey?: string; domain?: string; - isEuRegion?: boolean; + isEuRegion?: boolean | null; fromName?: string; fromEmail?: string; replyToName?: string; replyToEmail?: string; - enabled?: boolean; + enabled?: boolean | null; }): Promise<Models.Provider>; /** * Create a new Mailgun provider. @@ -3919,12 +3983,12 @@ export class Messaging { * @param {string} name - Provider name. * @param {string} apiKey - Mailgun API Key. * @param {string} domain - Mailgun Domain. - * @param {boolean} isEuRegion - Set as EU region. + * @param {boolean | null} isEuRegion - Set as EU region. * @param {string} fromName - Sender Name. * @param {string} fromEmail - Sender email address. * @param {string} replyToName - Name set in the reply to field for the mail. Default value is sender name. Reply to name must have reply to email as well. * @param {string} replyToEmail - Email set in the reply to field for the mail. Default value is sender email. Reply to email must have reply to name as well. - * @param {boolean} enabled - Set as enabled. + * @param {boolean | null} enabled - Set as enabled. * @throws {AppwriteException} * @returns {Promise<Models.Provider>} * @deprecated Use the object parameter style method for a better developer experience. @@ -3934,12 +3998,12 @@ export class Messaging { name: string, apiKey?: string, domain?: string, - isEuRegion?: boolean, + isEuRegion?: boolean | null, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, - enabled?: boolean, + enabled?: boolean | null, ): Promise<Models.Provider>; createMailgunProvider( paramsOrFirst: @@ -3948,24 +4012,24 @@ export class Messaging { name: string; apiKey?: string; domain?: string; - isEuRegion?: boolean; + isEuRegion?: boolean | null; fromName?: string; fromEmail?: string; replyToName?: string; replyToEmail?: string; - enabled?: boolean; + enabled?: boolean | null; } | string, ...rest: [ string?, string?, string?, - boolean?, + (boolean | null)?, string?, string?, string?, string?, - boolean?, + (boolean | null)?, ] ): Promise<Models.Provider> { let params: { @@ -3973,12 +4037,12 @@ export class Messaging { name: string; apiKey?: string; domain?: string; - isEuRegion?: boolean; + isEuRegion?: boolean | null; fromName?: string; fromEmail?: string; replyToName?: string; replyToEmail?: string; - enabled?: boolean; + enabled?: boolean | null; }; if ( @@ -3991,12 +4055,12 @@ export class Messaging { name: string; apiKey?: string; domain?: string; - isEuRegion?: boolean; + isEuRegion?: boolean | null; fromName?: string; fromEmail?: string; replyToName?: string; replyToEmail?: string; - enabled?: boolean; + enabled?: boolean | null; }; } else { params = { @@ -4004,12 +4068,12 @@ export class Messaging { name: rest[0] as string, apiKey: rest[1] as string, domain: rest[2] as string, - isEuRegion: rest[3] as boolean, + isEuRegion: rest[3] as boolean | null, fromName: rest[4] as string, fromEmail: rest[5] as string, replyToName: rest[6] as string, replyToEmail: rest[7] as string, - enabled: rest[8] as boolean, + enabled: rest[8] as boolean | null, }; } @@ -4085,7 +4149,7 @@ export class Messaging { provider: '', enabled: true, type: '', - credentials: [], + credentials: {}, }, }, }, @@ -4101,8 +4165,8 @@ export class Messaging { * @param {string} params.name - Provider name. * @param {string} params.apiKey - Mailgun API Key. * @param {string} params.domain - Mailgun Domain. - * @param {boolean} params.isEuRegion - Set as EU region. - * @param {boolean} params.enabled - Set as enabled. + * @param {boolean | null} params.isEuRegion - Set as EU region. + * @param {boolean | null} params.enabled - Set as enabled. * @param {string} params.fromName - Sender Name. * @param {string} params.fromEmail - Sender email address. * @param {string} params.replyToName - Name set in the reply to field for the mail. Default value is sender name. @@ -4115,8 +4179,8 @@ export class Messaging { name?: string; apiKey?: string; domain?: string; - isEuRegion?: boolean; - enabled?: boolean; + isEuRegion?: boolean | null; + enabled?: boolean | null; fromName?: string; fromEmail?: string; replyToName?: string; @@ -4129,8 +4193,8 @@ export class Messaging { * @param {string} name - Provider name. * @param {string} apiKey - Mailgun API Key. * @param {string} domain - Mailgun Domain. - * @param {boolean} isEuRegion - Set as EU region. - * @param {boolean} enabled - Set as enabled. + * @param {boolean | null} isEuRegion - Set as EU region. + * @param {boolean | null} enabled - Set as enabled. * @param {string} fromName - Sender Name. * @param {string} fromEmail - Sender email address. * @param {string} replyToName - Name set in the reply to field for the mail. Default value is sender name. @@ -4144,8 +4208,8 @@ export class Messaging { name?: string, apiKey?: string, domain?: string, - isEuRegion?: boolean, - enabled?: boolean, + isEuRegion?: boolean | null, + enabled?: boolean | null, fromName?: string, fromEmail?: string, replyToName?: string, @@ -4158,8 +4222,8 @@ export class Messaging { name?: string; apiKey?: string; domain?: string; - isEuRegion?: boolean; - enabled?: boolean; + isEuRegion?: boolean | null; + enabled?: boolean | null; fromName?: string; fromEmail?: string; replyToName?: string; @@ -4170,8 +4234,8 @@ export class Messaging { string?, string?, string?, - boolean?, - boolean?, + (boolean | null)?, + (boolean | null)?, string?, string?, string?, @@ -4183,8 +4247,8 @@ export class Messaging { name?: string; apiKey?: string; domain?: string; - isEuRegion?: boolean; - enabled?: boolean; + isEuRegion?: boolean | null; + enabled?: boolean | null; fromName?: string; fromEmail?: string; replyToName?: string; @@ -4201,8 +4265,8 @@ export class Messaging { name?: string; apiKey?: string; domain?: string; - isEuRegion?: boolean; - enabled?: boolean; + isEuRegion?: boolean | null; + enabled?: boolean | null; fromName?: string; fromEmail?: string; replyToName?: string; @@ -4214,8 +4278,8 @@ export class Messaging { name: rest[0] as string, apiKey: rest[1] as string, domain: rest[2] as string, - isEuRegion: rest[3] as boolean, - enabled: rest[4] as boolean, + isEuRegion: rest[3] as boolean | null, + enabled: rest[4] as boolean | null, fromName: rest[5] as string, fromEmail: rest[6] as string, replyToName: rest[7] as string, @@ -4292,7 +4356,7 @@ export class Messaging { provider: '', enabled: true, type: '', - credentials: [], + credentials: {}, }, }, }, @@ -4309,7 +4373,7 @@ export class Messaging { * @param {string} params.templateId - Msg91 template ID * @param {string} params.senderId - Msg91 sender ID. * @param {string} params.authKey - Msg91 auth key. - * @param {boolean} params.enabled - Set as enabled. + * @param {boolean | null} params.enabled - Set as enabled. * @throws {AppwriteException} * @returns {Promise<Models.Provider>} */ @@ -4319,7 +4383,7 @@ export class Messaging { templateId?: string; senderId?: string; authKey?: string; - enabled?: boolean; + enabled?: boolean | null; }): Promise<Models.Provider>; /** * Create a new MSG91 provider. @@ -4329,7 +4393,7 @@ export class Messaging { * @param {string} templateId - Msg91 template ID * @param {string} senderId - Msg91 sender ID. * @param {string} authKey - Msg91 auth key. - * @param {boolean} enabled - Set as enabled. + * @param {boolean | null} enabled - Set as enabled. * @throws {AppwriteException} * @returns {Promise<Models.Provider>} * @deprecated Use the object parameter style method for a better developer experience. @@ -4340,7 +4404,7 @@ export class Messaging { templateId?: string, senderId?: string, authKey?: string, - enabled?: boolean, + enabled?: boolean | null, ): Promise<Models.Provider>; createMsg91Provider( paramsOrFirst: @@ -4350,10 +4414,10 @@ export class Messaging { templateId?: string; senderId?: string; authKey?: string; - enabled?: boolean; + enabled?: boolean | null; } | string, - ...rest: [string?, string?, string?, string?, boolean?] + ...rest: [string?, string?, string?, string?, (boolean | null)?] ): Promise<Models.Provider> { let params: { providerId: string; @@ -4361,7 +4425,7 @@ export class Messaging { templateId?: string; senderId?: string; authKey?: string; - enabled?: boolean; + enabled?: boolean | null; }; if ( @@ -4375,7 +4439,7 @@ export class Messaging { templateId?: string; senderId?: string; authKey?: string; - enabled?: boolean; + enabled?: boolean | null; }; } else { params = { @@ -4384,7 +4448,7 @@ export class Messaging { templateId: rest[1] as string, senderId: rest[2] as string, authKey: rest[3] as string, - enabled: rest[4] as boolean, + enabled: rest[4] as boolean | null, }; } @@ -4444,7 +4508,7 @@ export class Messaging { provider: '', enabled: true, type: '', - credentials: [], + credentials: {}, }, }, }, @@ -4458,7 +4522,7 @@ export class Messaging { * * @param {string} params.providerId - Provider ID. * @param {string} params.name - Provider name. - * @param {boolean} params.enabled - Set as enabled. + * @param {boolean | null} params.enabled - Set as enabled. * @param {string} params.templateId - Msg91 template ID. * @param {string} params.senderId - Msg91 sender ID. * @param {string} params.authKey - Msg91 auth key. @@ -4468,7 +4532,7 @@ export class Messaging { updateMsg91Provider(params: { providerId: string; name?: string; - enabled?: boolean; + enabled?: boolean | null; templateId?: string; senderId?: string; authKey?: string; @@ -4478,7 +4542,7 @@ export class Messaging { * * @param {string} providerId - Provider ID. * @param {string} name - Provider name. - * @param {boolean} enabled - Set as enabled. + * @param {boolean | null} enabled - Set as enabled. * @param {string} templateId - Msg91 template ID. * @param {string} senderId - Msg91 sender ID. * @param {string} authKey - Msg91 auth key. @@ -4489,7 +4553,7 @@ export class Messaging { updateMsg91Provider( providerId: string, name?: string, - enabled?: boolean, + enabled?: boolean | null, templateId?: string, senderId?: string, authKey?: string, @@ -4499,18 +4563,18 @@ export class Messaging { | { providerId: string; name?: string; - enabled?: boolean; + enabled?: boolean | null; templateId?: string; senderId?: string; authKey?: string; } | string, - ...rest: [string?, boolean?, string?, string?, string?] + ...rest: [string?, (boolean | null)?, string?, string?, string?] ): Promise<Models.Provider> { let params: { providerId: string; name?: string; - enabled?: boolean; + enabled?: boolean | null; templateId?: string; senderId?: string; authKey?: string; @@ -4524,7 +4588,7 @@ export class Messaging { params = (paramsOrFirst || {}) as { providerId: string; name?: string; - enabled?: boolean; + enabled?: boolean | null; templateId?: string; senderId?: string; authKey?: string; @@ -4533,7 +4597,7 @@ export class Messaging { params = { providerId: paramsOrFirst as string, name: rest[0] as string, - enabled: rest[1] as boolean, + enabled: rest[1] as boolean | null, templateId: rest[2] as string, senderId: rest[3] as string, authKey: rest[4] as string, @@ -4593,7 +4657,7 @@ export class Messaging { provider: '', enabled: true, type: '', - credentials: [], + credentials: {}, }, }, }, @@ -4612,7 +4676,7 @@ export class Messaging { * @param {string} params.fromEmail - Sender email address. * @param {string} params.replyToName - Name set in the reply to field for the mail. Default value is sender name. * @param {string} params.replyToEmail - Email set in the reply to field for the mail. Default value is sender email. - * @param {boolean} params.enabled - Set as enabled. + * @param {boolean | null} params.enabled - Set as enabled. * @throws {AppwriteException} * @returns {Promise<Models.Provider>} */ @@ -4624,7 +4688,7 @@ export class Messaging { fromEmail?: string; replyToName?: string; replyToEmail?: string; - enabled?: boolean; + enabled?: boolean | null; }): Promise<Models.Provider>; /** * Create a new Resend provider. @@ -4636,7 +4700,7 @@ export class Messaging { * @param {string} fromEmail - Sender email address. * @param {string} replyToName - Name set in the reply to field for the mail. Default value is sender name. * @param {string} replyToEmail - Email set in the reply to field for the mail. Default value is sender email. - * @param {boolean} enabled - Set as enabled. + * @param {boolean | null} enabled - Set as enabled. * @throws {AppwriteException} * @returns {Promise<Models.Provider>} * @deprecated Use the object parameter style method for a better developer experience. @@ -4649,7 +4713,7 @@ export class Messaging { fromEmail?: string, replyToName?: string, replyToEmail?: string, - enabled?: boolean, + enabled?: boolean | null, ): Promise<Models.Provider>; createResendProvider( paramsOrFirst: @@ -4661,7 +4725,7 @@ export class Messaging { fromEmail?: string; replyToName?: string; replyToEmail?: string; - enabled?: boolean; + enabled?: boolean | null; } | string, ...rest: [ @@ -4671,7 +4735,7 @@ export class Messaging { string?, string?, string?, - boolean?, + (boolean | null)?, ] ): Promise<Models.Provider> { let params: { @@ -4682,7 +4746,7 @@ export class Messaging { fromEmail?: string; replyToName?: string; replyToEmail?: string; - enabled?: boolean; + enabled?: boolean | null; }; if ( @@ -4698,7 +4762,7 @@ export class Messaging { fromEmail?: string; replyToName?: string; replyToEmail?: string; - enabled?: boolean; + enabled?: boolean | null; }; } else { params = { @@ -4709,7 +4773,7 @@ export class Messaging { fromEmail: rest[3] as string, replyToName: rest[4] as string, replyToEmail: rest[5] as string, - enabled: rest[6] as boolean, + enabled: rest[6] as boolean | null, }; } @@ -4777,7 +4841,7 @@ export class Messaging { provider: '', enabled: true, type: '', - credentials: [], + credentials: {}, }, }, }, @@ -4791,7 +4855,7 @@ export class Messaging { * * @param {string} params.providerId - Provider ID. * @param {string} params.name - Provider name. - * @param {boolean} params.enabled - Set as enabled. + * @param {boolean | null} params.enabled - Set as enabled. * @param {string} params.apiKey - Resend API key. * @param {string} params.fromName - Sender Name. * @param {string} params.fromEmail - Sender email address. @@ -4803,7 +4867,7 @@ export class Messaging { updateResendProvider(params: { providerId: string; name?: string; - enabled?: boolean; + enabled?: boolean | null; apiKey?: string; fromName?: string; fromEmail?: string; @@ -4815,7 +4879,7 @@ export class Messaging { * * @param {string} providerId - Provider ID. * @param {string} name - Provider name. - * @param {boolean} enabled - Set as enabled. + * @param {boolean | null} enabled - Set as enabled. * @param {string} apiKey - Resend API key. * @param {string} fromName - Sender Name. * @param {string} fromEmail - Sender email address. @@ -4828,7 +4892,7 @@ export class Messaging { updateResendProvider( providerId: string, name?: string, - enabled?: boolean, + enabled?: boolean | null, apiKey?: string, fromName?: string, fromEmail?: string, @@ -4840,7 +4904,7 @@ export class Messaging { | { providerId: string; name?: string; - enabled?: boolean; + enabled?: boolean | null; apiKey?: string; fromName?: string; fromEmail?: string; @@ -4850,7 +4914,7 @@ export class Messaging { | string, ...rest: [ string?, - boolean?, + (boolean | null)?, string?, string?, string?, @@ -4861,7 +4925,7 @@ export class Messaging { let params: { providerId: string; name?: string; - enabled?: boolean; + enabled?: boolean | null; apiKey?: string; fromName?: string; fromEmail?: string; @@ -4877,7 +4941,7 @@ export class Messaging { params = (paramsOrFirst || {}) as { providerId: string; name?: string; - enabled?: boolean; + enabled?: boolean | null; apiKey?: string; fromName?: string; fromEmail?: string; @@ -4888,7 +4952,7 @@ export class Messaging { params = { providerId: paramsOrFirst as string, name: rest[0] as string, - enabled: rest[1] as boolean, + enabled: rest[1] as boolean | null, apiKey: rest[2] as string, fromName: rest[3] as string, fromEmail: rest[4] as string, @@ -4958,7 +5022,7 @@ export class Messaging { provider: '', enabled: true, type: '', - credentials: [], + credentials: {}, }, }, }, @@ -4977,7 +5041,7 @@ export class Messaging { * @param {string} params.fromEmail - Sender email address. * @param {string} params.replyToName - Name set in the reply to field for the mail. Default value is sender name. * @param {string} params.replyToEmail - Email set in the reply to field for the mail. Default value is sender email. - * @param {boolean} params.enabled - Set as enabled. + * @param {boolean | null} params.enabled - Set as enabled. * @throws {AppwriteException} * @returns {Promise<Models.Provider>} */ @@ -4989,7 +5053,7 @@ export class Messaging { fromEmail?: string; replyToName?: string; replyToEmail?: string; - enabled?: boolean; + enabled?: boolean | null; }): Promise<Models.Provider>; /** * Create a new Sendgrid provider. @@ -5001,7 +5065,7 @@ export class Messaging { * @param {string} fromEmail - Sender email address. * @param {string} replyToName - Name set in the reply to field for the mail. Default value is sender name. * @param {string} replyToEmail - Email set in the reply to field for the mail. Default value is sender email. - * @param {boolean} enabled - Set as enabled. + * @param {boolean | null} enabled - Set as enabled. * @throws {AppwriteException} * @returns {Promise<Models.Provider>} * @deprecated Use the object parameter style method for a better developer experience. @@ -5014,7 +5078,7 @@ export class Messaging { fromEmail?: string, replyToName?: string, replyToEmail?: string, - enabled?: boolean, + enabled?: boolean | null, ): Promise<Models.Provider>; createSendgridProvider( paramsOrFirst: @@ -5026,7 +5090,7 @@ export class Messaging { fromEmail?: string; replyToName?: string; replyToEmail?: string; - enabled?: boolean; + enabled?: boolean | null; } | string, ...rest: [ @@ -5036,7 +5100,7 @@ export class Messaging { string?, string?, string?, - boolean?, + (boolean | null)?, ] ): Promise<Models.Provider> { let params: { @@ -5047,7 +5111,7 @@ export class Messaging { fromEmail?: string; replyToName?: string; replyToEmail?: string; - enabled?: boolean; + enabled?: boolean | null; }; if ( @@ -5063,7 +5127,7 @@ export class Messaging { fromEmail?: string; replyToName?: string; replyToEmail?: string; - enabled?: boolean; + enabled?: boolean | null; }; } else { params = { @@ -5074,7 +5138,7 @@ export class Messaging { fromEmail: rest[3] as string, replyToName: rest[4] as string, replyToEmail: rest[5] as string, - enabled: rest[6] as boolean, + enabled: rest[6] as boolean | null, }; } @@ -5142,7 +5206,7 @@ export class Messaging { provider: '', enabled: true, type: '', - credentials: [], + credentials: {}, }, }, }, @@ -5156,7 +5220,7 @@ export class Messaging { * * @param {string} params.providerId - Provider ID. * @param {string} params.name - Provider name. - * @param {boolean} params.enabled - Set as enabled. + * @param {boolean | null} params.enabled - Set as enabled. * @param {string} params.apiKey - Sendgrid API key. * @param {string} params.fromName - Sender Name. * @param {string} params.fromEmail - Sender email address. @@ -5168,7 +5232,7 @@ export class Messaging { updateSendgridProvider(params: { providerId: string; name?: string; - enabled?: boolean; + enabled?: boolean | null; apiKey?: string; fromName?: string; fromEmail?: string; @@ -5180,7 +5244,7 @@ export class Messaging { * * @param {string} providerId - Provider ID. * @param {string} name - Provider name. - * @param {boolean} enabled - Set as enabled. + * @param {boolean | null} enabled - Set as enabled. * @param {string} apiKey - Sendgrid API key. * @param {string} fromName - Sender Name. * @param {string} fromEmail - Sender email address. @@ -5193,7 +5257,7 @@ export class Messaging { updateSendgridProvider( providerId: string, name?: string, - enabled?: boolean, + enabled?: boolean | null, apiKey?: string, fromName?: string, fromEmail?: string, @@ -5205,7 +5269,7 @@ export class Messaging { | { providerId: string; name?: string; - enabled?: boolean; + enabled?: boolean | null; apiKey?: string; fromName?: string; fromEmail?: string; @@ -5215,7 +5279,7 @@ export class Messaging { | string, ...rest: [ string?, - boolean?, + (boolean | null)?, string?, string?, string?, @@ -5226,7 +5290,7 @@ export class Messaging { let params: { providerId: string; name?: string; - enabled?: boolean; + enabled?: boolean | null; apiKey?: string; fromName?: string; fromEmail?: string; @@ -5242,7 +5306,7 @@ export class Messaging { params = (paramsOrFirst || {}) as { providerId: string; name?: string; - enabled?: boolean; + enabled?: boolean | null; apiKey?: string; fromName?: string; fromEmail?: string; @@ -5253,7 +5317,7 @@ export class Messaging { params = { providerId: paramsOrFirst as string, name: rest[0] as string, - enabled: rest[1] as boolean, + enabled: rest[1] as boolean | null, apiKey: rest[2] as string, fromName: rest[3] as string, fromEmail: rest[4] as string, @@ -5323,7 +5387,7 @@ export class Messaging { provider: '', enabled: true, type: '', - credentials: [], + credentials: {}, }, }, }, @@ -5344,7 +5408,7 @@ export class Messaging { * @param {string} params.fromEmail - Sender email address. * @param {string} params.replyToName - Name set in the reply to field for the mail. Default value is sender name. * @param {string} params.replyToEmail - Email set in the reply to field for the mail. Default value is sender email. - * @param {boolean} params.enabled - Set as enabled. + * @param {boolean | null} params.enabled - Set as enabled. * @throws {AppwriteException} * @returns {Promise<Models.Provider>} */ @@ -5358,7 +5422,7 @@ export class Messaging { fromEmail?: string; replyToName?: string; replyToEmail?: string; - enabled?: boolean; + enabled?: boolean | null; }): Promise<Models.Provider>; /** * Create a new Amazon SES provider. @@ -5372,7 +5436,7 @@ export class Messaging { * @param {string} fromEmail - Sender email address. * @param {string} replyToName - Name set in the reply to field for the mail. Default value is sender name. * @param {string} replyToEmail - Email set in the reply to field for the mail. Default value is sender email. - * @param {boolean} enabled - Set as enabled. + * @param {boolean | null} enabled - Set as enabled. * @throws {AppwriteException} * @returns {Promise<Models.Provider>} * @deprecated Use the object parameter style method for a better developer experience. @@ -5387,7 +5451,7 @@ export class Messaging { fromEmail?: string, replyToName?: string, replyToEmail?: string, - enabled?: boolean, + enabled?: boolean | null, ): Promise<Models.Provider>; createSesProvider( paramsOrFirst: @@ -5401,7 +5465,7 @@ export class Messaging { fromEmail?: string; replyToName?: string; replyToEmail?: string; - enabled?: boolean; + enabled?: boolean | null; } | string, ...rest: [ @@ -5413,7 +5477,7 @@ export class Messaging { string?, string?, string?, - boolean?, + (boolean | null)?, ] ): Promise<Models.Provider> { let params: { @@ -5426,7 +5490,7 @@ export class Messaging { fromEmail?: string; replyToName?: string; replyToEmail?: string; - enabled?: boolean; + enabled?: boolean | null; }; if ( @@ -5444,7 +5508,7 @@ export class Messaging { fromEmail?: string; replyToName?: string; replyToEmail?: string; - enabled?: boolean; + enabled?: boolean | null; }; } else { params = { @@ -5457,7 +5521,7 @@ export class Messaging { fromEmail: rest[5] as string, replyToName: rest[6] as string, replyToEmail: rest[7] as string, - enabled: rest[8] as boolean, + enabled: rest[8] as boolean | null, }; } @@ -5533,7 +5597,7 @@ export class Messaging { provider: '', enabled: true, type: '', - credentials: [], + credentials: {}, }, }, }, @@ -5547,7 +5611,7 @@ export class Messaging { * * @param {string} params.providerId - Provider ID. * @param {string} params.name - Provider name. - * @param {boolean} params.enabled - Set as enabled. + * @param {boolean | null} params.enabled - Set as enabled. * @param {string} params.accessKey - AWS access key ID. * @param {string} params.secretKey - AWS secret access key. * @param {string} params.region - AWS region, for example us-east-1. @@ -5561,7 +5625,7 @@ export class Messaging { updateSesProvider(params: { providerId: string; name?: string; - enabled?: boolean; + enabled?: boolean | null; accessKey?: string; secretKey?: string; region?: string; @@ -5575,7 +5639,7 @@ export class Messaging { * * @param {string} providerId - Provider ID. * @param {string} name - Provider name. - * @param {boolean} enabled - Set as enabled. + * @param {boolean | null} enabled - Set as enabled. * @param {string} accessKey - AWS access key ID. * @param {string} secretKey - AWS secret access key. * @param {string} region - AWS region, for example us-east-1. @@ -5590,7 +5654,7 @@ export class Messaging { updateSesProvider( providerId: string, name?: string, - enabled?: boolean, + enabled?: boolean | null, accessKey?: string, secretKey?: string, region?: string, @@ -5604,7 +5668,7 @@ export class Messaging { | { providerId: string; name?: string; - enabled?: boolean; + enabled?: boolean | null; accessKey?: string; secretKey?: string; region?: string; @@ -5616,7 +5680,7 @@ export class Messaging { | string, ...rest: [ string?, - boolean?, + (boolean | null)?, string?, string?, string?, @@ -5629,7 +5693,7 @@ export class Messaging { let params: { providerId: string; name?: string; - enabled?: boolean; + enabled?: boolean | null; accessKey?: string; secretKey?: string; region?: string; @@ -5647,7 +5711,7 @@ export class Messaging { params = (paramsOrFirst || {}) as { providerId: string; name?: string; - enabled?: boolean; + enabled?: boolean | null; accessKey?: string; secretKey?: string; region?: string; @@ -5660,7 +5724,7 @@ export class Messaging { params = { providerId: paramsOrFirst as string, name: rest[0] as string, - enabled: rest[1] as boolean, + enabled: rest[1] as boolean | null, accessKey: rest[2] as string, secretKey: rest[3] as string, region: rest[4] as string, @@ -5740,7 +5804,7 @@ export class Messaging { provider: '', enabled: true, type: '', - credentials: [], + credentials: {}, }, }, }, @@ -5765,7 +5829,7 @@ export class Messaging { * @param {string} params.fromEmail - Sender email address. * @param {string} params.replyToName - Name set in the reply to field for the mail. Default value is sender name. * @param {string} params.replyToEmail - Email set in the reply to field for the mail. Default value is sender email. - * @param {boolean} params.enabled - Set as enabled. + * @param {boolean | null} params.enabled - Set as enabled. * @throws {AppwriteException} * @returns {Promise<Models.Provider>} * @deprecated This API has been deprecated since 1.8.0. Please use `Messaging.createSMTPProvider` instead. @@ -5784,7 +5848,7 @@ export class Messaging { fromEmail?: string; replyToName?: string; replyToEmail?: string; - enabled?: boolean; + enabled?: boolean | null; }): Promise<Models.Provider>; /** * Create a new SMTP provider. @@ -5802,7 +5866,7 @@ export class Messaging { * @param {string} fromEmail - Sender email address. * @param {string} replyToName - Name set in the reply to field for the mail. Default value is sender name. * @param {string} replyToEmail - Email set in the reply to field for the mail. Default value is sender email. - * @param {boolean} enabled - Set as enabled. + * @param {boolean | null} enabled - Set as enabled. * @throws {AppwriteException} * @returns {Promise<Models.Provider>} * @deprecated Use the object parameter style method for a better developer experience. @@ -5821,7 +5885,7 @@ export class Messaging { fromEmail?: string, replyToName?: string, replyToEmail?: string, - enabled?: boolean, + enabled?: boolean | null, ): Promise<Models.Provider>; createSmtpProvider( paramsOrFirst: @@ -5839,7 +5903,7 @@ export class Messaging { fromEmail?: string; replyToName?: string; replyToEmail?: string; - enabled?: boolean; + enabled?: boolean | null; } | string, ...rest: [ @@ -5855,7 +5919,7 @@ export class Messaging { string?, string?, string?, - boolean?, + (boolean | null)?, ] ): Promise<Models.Provider> { let params: { @@ -5872,7 +5936,7 @@ export class Messaging { fromEmail?: string; replyToName?: string; replyToEmail?: string; - enabled?: boolean; + enabled?: boolean | null; }; if ( @@ -5894,7 +5958,7 @@ export class Messaging { fromEmail?: string; replyToName?: string; replyToEmail?: string; - enabled?: boolean; + enabled?: boolean | null; }; } else { params = { @@ -5911,7 +5975,7 @@ export class Messaging { fromEmail: rest[9] as string, replyToName: rest[10] as string, replyToEmail: rest[11] as string, - enabled: rest[12] as boolean, + enabled: rest[12] as boolean | null, }; } @@ -6006,7 +6070,7 @@ export class Messaging { provider: '', enabled: true, type: '', - credentials: [], + credentials: {}, }, }, }, @@ -6031,7 +6095,7 @@ export class Messaging { * @param {string} params.fromEmail - Sender email address. * @param {string} params.replyToName - Name set in the reply to field for the mail. Default value is sender name. * @param {string} params.replyToEmail - Email set in the reply to field for the mail. Default value is sender email. - * @param {boolean} params.enabled - Set as enabled. + * @param {boolean | null} params.enabled - Set as enabled. * @throws {AppwriteException} * @returns {Promise<Models.Provider>} */ @@ -6049,7 +6113,7 @@ export class Messaging { fromEmail?: string; replyToName?: string; replyToEmail?: string; - enabled?: boolean; + enabled?: boolean | null; }): Promise<Models.Provider>; /** * Create a new SMTP provider. @@ -6067,7 +6131,7 @@ export class Messaging { * @param {string} fromEmail - Sender email address. * @param {string} replyToName - Name set in the reply to field for the mail. Default value is sender name. * @param {string} replyToEmail - Email set in the reply to field for the mail. Default value is sender email. - * @param {boolean} enabled - Set as enabled. + * @param {boolean | null} enabled - Set as enabled. * @throws {AppwriteException} * @returns {Promise<Models.Provider>} * @deprecated Use the object parameter style method for a better developer experience. @@ -6086,7 +6150,7 @@ export class Messaging { fromEmail?: string, replyToName?: string, replyToEmail?: string, - enabled?: boolean, + enabled?: boolean | null, ): Promise<Models.Provider>; createSMTPProvider( paramsOrFirst: @@ -6104,7 +6168,7 @@ export class Messaging { fromEmail?: string; replyToName?: string; replyToEmail?: string; - enabled?: boolean; + enabled?: boolean | null; } | string, ...rest: [ @@ -6120,7 +6184,7 @@ export class Messaging { string?, string?, string?, - boolean?, + (boolean | null)?, ] ): Promise<Models.Provider> { let params: { @@ -6137,7 +6201,7 @@ export class Messaging { fromEmail?: string; replyToName?: string; replyToEmail?: string; - enabled?: boolean; + enabled?: boolean | null; }; if ( @@ -6159,7 +6223,7 @@ export class Messaging { fromEmail?: string; replyToName?: string; replyToEmail?: string; - enabled?: boolean; + enabled?: boolean | null; }; } else { params = { @@ -6176,7 +6240,7 @@ export class Messaging { fromEmail: rest[9] as string, replyToName: rest[10] as string, replyToEmail: rest[11] as string, - enabled: rest[12] as boolean, + enabled: rest[12] as boolean | null, }; } @@ -6271,7 +6335,7 @@ export class Messaging { provider: '', enabled: true, type: '', - credentials: [], + credentials: {}, }, }, }, @@ -6286,17 +6350,17 @@ 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 | null} 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' - * @param {boolean} params.autoTLS - Enable SMTP AutoTLS feature. + * @param {boolean | null} params.autoTLS - Enable SMTP AutoTLS feature. * @param {string} params.mailer - The value to use for the X-Mailer header. * @param {string} params.fromName - Sender Name. * @param {string} params.fromEmail - Sender email address. * @param {string} params.replyToName - Name set in the Reply To field for the mail. Default value is Sender Name. * @param {string} params.replyToEmail - Email set in the Reply To field for the mail. Default value is Sender Email. - * @param {boolean} params.enabled - Set as enabled. + * @param {boolean | null} params.enabled - Set as enabled. * @throws {AppwriteException} * @returns {Promise<Models.Provider>} * @deprecated This API has been deprecated since 1.8.0. Please use `Messaging.updateSMTPProvider` instead. @@ -6305,17 +6369,17 @@ export class Messaging { providerId: string; name?: string; host?: string; - port?: number; + port?: number | null; username?: string; password?: string; encryption?: SmtpEncryption; - autoTLS?: boolean; + autoTLS?: boolean | null; mailer?: string; fromName?: string; fromEmail?: string; replyToName?: string; replyToEmail?: string; - enabled?: boolean; + enabled?: boolean | null; }): Promise<Models.Provider>; /** * Update a SMTP provider by its unique ID. @@ -6323,17 +6387,17 @@ export class Messaging { * @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 | null} port - SMTP port. * @param {string} username - Authentication username. * @param {string} password - Authentication password. * @param {SmtpEncryption} encryption - Encryption type. Can be 'ssl' or 'tls' - * @param {boolean} autoTLS - Enable SMTP AutoTLS feature. + * @param {boolean | null} autoTLS - Enable SMTP AutoTLS feature. * @param {string} mailer - The value to use for the X-Mailer header. * @param {string} fromName - Sender Name. * @param {string} fromEmail - Sender email address. * @param {string} replyToName - Name set in the Reply To field for the mail. Default value is Sender Name. * @param {string} replyToEmail - Email set in the Reply To field for the mail. Default value is Sender Email. - * @param {boolean} enabled - Set as enabled. + * @param {boolean | null} enabled - Set as enabled. * @throws {AppwriteException} * @returns {Promise<Models.Provider>} * @deprecated Use the object parameter style method for a better developer experience. @@ -6342,17 +6406,17 @@ export class Messaging { providerId: string, name?: string, host?: string, - port?: number, + port?: number | null, username?: string, password?: string, encryption?: SmtpEncryption, - autoTLS?: boolean, + autoTLS?: boolean | null, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, - enabled?: boolean, + enabled?: boolean | null, ): Promise<Models.Provider>; updateSmtpProvider( paramsOrFirst: @@ -6360,50 +6424,50 @@ export class Messaging { providerId: string; name?: string; host?: string; - port?: number; + port?: number | null; username?: string; password?: string; encryption?: SmtpEncryption; - autoTLS?: boolean; + autoTLS?: boolean | null; mailer?: string; fromName?: string; fromEmail?: string; replyToName?: string; replyToEmail?: string; - enabled?: boolean; + enabled?: boolean | null; } | string, ...rest: [ string?, string?, - number?, + (number | null)?, string?, string?, SmtpEncryption?, - boolean?, + (boolean | null)?, string?, string?, string?, string?, string?, - boolean?, + (boolean | null)?, ] ): Promise<Models.Provider> { let params: { providerId: string; name?: string; host?: string; - port?: number; + port?: number | null; username?: string; password?: string; encryption?: SmtpEncryption; - autoTLS?: boolean; + autoTLS?: boolean | null; mailer?: string; fromName?: string; fromEmail?: string; replyToName?: string; replyToEmail?: string; - enabled?: boolean; + enabled?: boolean | null; }; if ( @@ -6415,34 +6479,34 @@ export class Messaging { providerId: string; name?: string; host?: string; - port?: number; + port?: number | null; username?: string; password?: string; encryption?: SmtpEncryption; - autoTLS?: boolean; + autoTLS?: boolean | null; mailer?: string; fromName?: string; fromEmail?: string; replyToName?: string; replyToEmail?: string; - enabled?: boolean; + enabled?: boolean | null; }; } 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 | null, username: rest[3] as string, password: rest[4] as string, encryption: rest[5] as SmtpEncryption, - autoTLS: rest[6] as boolean, + autoTLS: rest[6] as boolean | null, mailer: rest[7] as string, fromName: rest[8] as string, fromEmail: rest[9] as string, replyToName: rest[10] as string, replyToEmail: rest[11] as string, - enabled: rest[12] as boolean, + enabled: rest[12] as boolean | null, }; } @@ -6531,7 +6595,7 @@ export class Messaging { provider: '', enabled: true, type: '', - credentials: [], + credentials: {}, }, }, }, @@ -6546,17 +6610,17 @@ 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 | null} 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' - * @param {boolean} params.autoTLS - Enable SMTP AutoTLS feature. + * @param {boolean | null} params.autoTLS - Enable SMTP AutoTLS feature. * @param {string} params.mailer - The value to use for the X-Mailer header. * @param {string} params.fromName - Sender Name. * @param {string} params.fromEmail - Sender email address. * @param {string} params.replyToName - Name set in the Reply To field for the mail. Default value is Sender Name. * @param {string} params.replyToEmail - Email set in the Reply To field for the mail. Default value is Sender Email. - * @param {boolean} params.enabled - Set as enabled. + * @param {boolean | null} params.enabled - Set as enabled. * @throws {AppwriteException} * @returns {Promise<Models.Provider>} */ @@ -6564,17 +6628,17 @@ export class Messaging { providerId: string; name?: string; host?: string; - port?: number; + port?: number | null; username?: string; password?: string; encryption?: SmtpEncryption; - autoTLS?: boolean; + autoTLS?: boolean | null; mailer?: string; fromName?: string; fromEmail?: string; replyToName?: string; replyToEmail?: string; - enabled?: boolean; + enabled?: boolean | null; }): Promise<Models.Provider>; /** * Update a SMTP provider by its unique ID. @@ -6582,17 +6646,17 @@ export class Messaging { * @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 | null} port - SMTP port. * @param {string} username - Authentication username. * @param {string} password - Authentication password. * @param {SmtpEncryption} encryption - Encryption type. Can be 'ssl' or 'tls' - * @param {boolean} autoTLS - Enable SMTP AutoTLS feature. + * @param {boolean | null} autoTLS - Enable SMTP AutoTLS feature. * @param {string} mailer - The value to use for the X-Mailer header. * @param {string} fromName - Sender Name. * @param {string} fromEmail - Sender email address. * @param {string} replyToName - Name set in the Reply To field for the mail. Default value is Sender Name. * @param {string} replyToEmail - Email set in the Reply To field for the mail. Default value is Sender Email. - * @param {boolean} enabled - Set as enabled. + * @param {boolean | null} enabled - Set as enabled. * @throws {AppwriteException} * @returns {Promise<Models.Provider>} * @deprecated Use the object parameter style method for a better developer experience. @@ -6601,17 +6665,17 @@ export class Messaging { providerId: string, name?: string, host?: string, - port?: number, + port?: number | null, username?: string, password?: string, encryption?: SmtpEncryption, - autoTLS?: boolean, + autoTLS?: boolean | null, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, - enabled?: boolean, + enabled?: boolean | null, ): Promise<Models.Provider>; updateSMTPProvider( paramsOrFirst: @@ -6619,50 +6683,50 @@ export class Messaging { providerId: string; name?: string; host?: string; - port?: number; + port?: number | null; username?: string; password?: string; encryption?: SmtpEncryption; - autoTLS?: boolean; + autoTLS?: boolean | null; mailer?: string; fromName?: string; fromEmail?: string; replyToName?: string; replyToEmail?: string; - enabled?: boolean; + enabled?: boolean | null; } | string, ...rest: [ string?, string?, - number?, + (number | null)?, string?, string?, SmtpEncryption?, - boolean?, + (boolean | null)?, string?, string?, string?, string?, string?, - boolean?, + (boolean | null)?, ] ): Promise<Models.Provider> { let params: { providerId: string; name?: string; host?: string; - port?: number; + port?: number | null; username?: string; password?: string; encryption?: SmtpEncryption; - autoTLS?: boolean; + autoTLS?: boolean | null; mailer?: string; fromName?: string; fromEmail?: string; replyToName?: string; replyToEmail?: string; - enabled?: boolean; + enabled?: boolean | null; }; if ( @@ -6674,34 +6738,34 @@ export class Messaging { providerId: string; name?: string; host?: string; - port?: number; + port?: number | null; username?: string; password?: string; encryption?: SmtpEncryption; - autoTLS?: boolean; + autoTLS?: boolean | null; mailer?: string; fromName?: string; fromEmail?: string; replyToName?: string; replyToEmail?: string; - enabled?: boolean; + enabled?: boolean | null; }; } 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 | null, username: rest[3] as string, password: rest[4] as string, encryption: rest[5] as SmtpEncryption, - autoTLS: rest[6] as boolean, + autoTLS: rest[6] as boolean | null, mailer: rest[7] as string, fromName: rest[8] as string, fromEmail: rest[9] as string, replyToName: rest[10] as string, replyToEmail: rest[11] as string, - enabled: rest[12] as boolean, + enabled: rest[12] as boolean | null, }; } @@ -6790,7 +6854,7 @@ export class Messaging { provider: '', enabled: true, type: '', - credentials: [], + credentials: {}, }, }, }, @@ -6807,7 +6871,7 @@ export class Messaging { * @param {string} params.from - Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212. * @param {string} params.customerId - Telesign customer ID. * @param {string} params.apiKey - Telesign API key. - * @param {boolean} params.enabled - Set as enabled. + * @param {boolean | null} params.enabled - Set as enabled. * @throws {AppwriteException} * @returns {Promise<Models.Provider>} */ @@ -6817,7 +6881,7 @@ export class Messaging { from?: string; customerId?: string; apiKey?: string; - enabled?: boolean; + enabled?: boolean | null; }): Promise<Models.Provider>; /** * Create a new Telesign provider. @@ -6827,7 +6891,7 @@ export class Messaging { * @param {string} from - Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212. * @param {string} customerId - Telesign customer ID. * @param {string} apiKey - Telesign API key. - * @param {boolean} enabled - Set as enabled. + * @param {boolean | null} enabled - Set as enabled. * @throws {AppwriteException} * @returns {Promise<Models.Provider>} * @deprecated Use the object parameter style method for a better developer experience. @@ -6838,7 +6902,7 @@ export class Messaging { from?: string, customerId?: string, apiKey?: string, - enabled?: boolean, + enabled?: boolean | null, ): Promise<Models.Provider>; createTelesignProvider( paramsOrFirst: @@ -6848,10 +6912,10 @@ export class Messaging { from?: string; customerId?: string; apiKey?: string; - enabled?: boolean; + enabled?: boolean | null; } | string, - ...rest: [string?, string?, string?, string?, boolean?] + ...rest: [string?, string?, string?, string?, (boolean | null)?] ): Promise<Models.Provider> { let params: { providerId: string; @@ -6859,7 +6923,7 @@ export class Messaging { from?: string; customerId?: string; apiKey?: string; - enabled?: boolean; + enabled?: boolean | null; }; if ( @@ -6873,7 +6937,7 @@ export class Messaging { from?: string; customerId?: string; apiKey?: string; - enabled?: boolean; + enabled?: boolean | null; }; } else { params = { @@ -6882,7 +6946,7 @@ export class Messaging { from: rest[1] as string, customerId: rest[2] as string, apiKey: rest[3] as string, - enabled: rest[4] as boolean, + enabled: rest[4] as boolean | null, }; } @@ -6942,7 +7006,7 @@ export class Messaging { provider: '', enabled: true, type: '', - credentials: [], + credentials: {}, }, }, }, @@ -6956,7 +7020,7 @@ export class Messaging { * * @param {string} params.providerId - Provider ID. * @param {string} params.name - Provider name. - * @param {boolean} params.enabled - Set as enabled. + * @param {boolean | null} params.enabled - Set as enabled. * @param {string} params.customerId - Telesign customer ID. * @param {string} params.apiKey - Telesign API key. * @param {string} params.from - Sender number. @@ -6966,7 +7030,7 @@ export class Messaging { updateTelesignProvider(params: { providerId: string; name?: string; - enabled?: boolean; + enabled?: boolean | null; customerId?: string; apiKey?: string; from?: string; @@ -6976,7 +7040,7 @@ export class Messaging { * * @param {string} providerId - Provider ID. * @param {string} name - Provider name. - * @param {boolean} enabled - Set as enabled. + * @param {boolean | null} enabled - Set as enabled. * @param {string} customerId - Telesign customer ID. * @param {string} apiKey - Telesign API key. * @param {string} from - Sender number. @@ -6987,7 +7051,7 @@ export class Messaging { updateTelesignProvider( providerId: string, name?: string, - enabled?: boolean, + enabled?: boolean | null, customerId?: string, apiKey?: string, from?: string, @@ -6997,18 +7061,18 @@ export class Messaging { | { providerId: string; name?: string; - enabled?: boolean; + enabled?: boolean | null; customerId?: string; apiKey?: string; from?: string; } | string, - ...rest: [string?, boolean?, string?, string?, string?] + ...rest: [string?, (boolean | null)?, string?, string?, string?] ): Promise<Models.Provider> { let params: { providerId: string; name?: string; - enabled?: boolean; + enabled?: boolean | null; customerId?: string; apiKey?: string; from?: string; @@ -7022,7 +7086,7 @@ export class Messaging { params = (paramsOrFirst || {}) as { providerId: string; name?: string; - enabled?: boolean; + enabled?: boolean | null; customerId?: string; apiKey?: string; from?: string; @@ -7031,7 +7095,7 @@ export class Messaging { params = { providerId: paramsOrFirst as string, name: rest[0] as string, - enabled: rest[1] as boolean, + enabled: rest[1] as boolean | null, customerId: rest[2] as string, apiKey: rest[3] as string, from: rest[4] as string, @@ -7091,7 +7155,7 @@ export class Messaging { provider: '', enabled: true, type: '', - credentials: [], + credentials: {}, }, }, }, @@ -7108,7 +7172,7 @@ export class Messaging { * @param {string} params.from - Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212. * @param {string} params.username - Textmagic username. * @param {string} params.apiKey - Textmagic apiKey. - * @param {boolean} params.enabled - Set as enabled. + * @param {boolean | null} params.enabled - Set as enabled. * @throws {AppwriteException} * @returns {Promise<Models.Provider>} */ @@ -7118,7 +7182,7 @@ export class Messaging { from?: string; username?: string; apiKey?: string; - enabled?: boolean; + enabled?: boolean | null; }): Promise<Models.Provider>; /** * Create a new Textmagic provider. @@ -7128,7 +7192,7 @@ export class Messaging { * @param {string} from - Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212. * @param {string} username - Textmagic username. * @param {string} apiKey - Textmagic apiKey. - * @param {boolean} enabled - Set as enabled. + * @param {boolean | null} enabled - Set as enabled. * @throws {AppwriteException} * @returns {Promise<Models.Provider>} * @deprecated Use the object parameter style method for a better developer experience. @@ -7139,7 +7203,7 @@ export class Messaging { from?: string, username?: string, apiKey?: string, - enabled?: boolean, + enabled?: boolean | null, ): Promise<Models.Provider>; createTextmagicProvider( paramsOrFirst: @@ -7149,10 +7213,10 @@ export class Messaging { from?: string; username?: string; apiKey?: string; - enabled?: boolean; + enabled?: boolean | null; } | string, - ...rest: [string?, string?, string?, string?, boolean?] + ...rest: [string?, string?, string?, string?, (boolean | null)?] ): Promise<Models.Provider> { let params: { providerId: string; @@ -7160,7 +7224,7 @@ export class Messaging { from?: string; username?: string; apiKey?: string; - enabled?: boolean; + enabled?: boolean | null; }; if ( @@ -7174,7 +7238,7 @@ export class Messaging { from?: string; username?: string; apiKey?: string; - enabled?: boolean; + enabled?: boolean | null; }; } else { params = { @@ -7183,7 +7247,7 @@ export class Messaging { from: rest[1] as string, username: rest[2] as string, apiKey: rest[3] as string, - enabled: rest[4] as boolean, + enabled: rest[4] as boolean | null, }; } @@ -7243,7 +7307,7 @@ export class Messaging { provider: '', enabled: true, type: '', - credentials: [], + credentials: {}, }, }, }, @@ -7257,7 +7321,7 @@ export class Messaging { * * @param {string} params.providerId - Provider ID. * @param {string} params.name - Provider name. - * @param {boolean} params.enabled - Set as enabled. + * @param {boolean | null} params.enabled - Set as enabled. * @param {string} params.username - Textmagic username. * @param {string} params.apiKey - Textmagic apiKey. * @param {string} params.from - Sender number. @@ -7267,7 +7331,7 @@ export class Messaging { updateTextmagicProvider(params: { providerId: string; name?: string; - enabled?: boolean; + enabled?: boolean | null; username?: string; apiKey?: string; from?: string; @@ -7277,7 +7341,7 @@ export class Messaging { * * @param {string} providerId - Provider ID. * @param {string} name - Provider name. - * @param {boolean} enabled - Set as enabled. + * @param {boolean | null} enabled - Set as enabled. * @param {string} username - Textmagic username. * @param {string} apiKey - Textmagic apiKey. * @param {string} from - Sender number. @@ -7288,7 +7352,7 @@ export class Messaging { updateTextmagicProvider( providerId: string, name?: string, - enabled?: boolean, + enabled?: boolean | null, username?: string, apiKey?: string, from?: string, @@ -7298,18 +7362,18 @@ export class Messaging { | { providerId: string; name?: string; - enabled?: boolean; + enabled?: boolean | null; username?: string; apiKey?: string; from?: string; } | string, - ...rest: [string?, boolean?, string?, string?, string?] + ...rest: [string?, (boolean | null)?, string?, string?, string?] ): Promise<Models.Provider> { let params: { providerId: string; name?: string; - enabled?: boolean; + enabled?: boolean | null; username?: string; apiKey?: string; from?: string; @@ -7323,7 +7387,7 @@ export class Messaging { params = (paramsOrFirst || {}) as { providerId: string; name?: string; - enabled?: boolean; + enabled?: boolean | null; username?: string; apiKey?: string; from?: string; @@ -7332,7 +7396,7 @@ export class Messaging { params = { providerId: paramsOrFirst as string, name: rest[0] as string, - enabled: rest[1] as boolean, + enabled: rest[1] as boolean | null, username: rest[2] as string, apiKey: rest[3] as string, from: rest[4] as string, @@ -7392,7 +7456,7 @@ export class Messaging { provider: '', enabled: true, type: '', - credentials: [], + credentials: {}, }, }, }, @@ -7409,7 +7473,7 @@ export class Messaging { * @param {string} params.from - Sender phone number or alphanumeric sender ID. Format phone numbers with a leading '+' and a country code, e.g., +16175551212. * @param {string} params.accountSid - Twilio account secret ID. * @param {string} params.authToken - Twilio authentication token. - * @param {boolean} params.enabled - Set as enabled. + * @param {boolean | null} params.enabled - Set as enabled. * @throws {AppwriteException} * @returns {Promise<Models.Provider>} */ @@ -7419,7 +7483,7 @@ export class Messaging { from?: string; accountSid?: string; authToken?: string; - enabled?: boolean; + enabled?: boolean | null; }): Promise<Models.Provider>; /** * Create a new Twilio provider. @@ -7429,7 +7493,7 @@ export class Messaging { * @param {string} from - Sender phone number or alphanumeric sender ID. Format phone numbers with a leading '+' and a country code, e.g., +16175551212. * @param {string} accountSid - Twilio account secret ID. * @param {string} authToken - Twilio authentication token. - * @param {boolean} enabled - Set as enabled. + * @param {boolean | null} enabled - Set as enabled. * @throws {AppwriteException} * @returns {Promise<Models.Provider>} * @deprecated Use the object parameter style method for a better developer experience. @@ -7440,7 +7504,7 @@ export class Messaging { from?: string, accountSid?: string, authToken?: string, - enabled?: boolean, + enabled?: boolean | null, ): Promise<Models.Provider>; createTwilioProvider( paramsOrFirst: @@ -7450,10 +7514,10 @@ export class Messaging { from?: string; accountSid?: string; authToken?: string; - enabled?: boolean; + enabled?: boolean | null; } | string, - ...rest: [string?, string?, string?, string?, boolean?] + ...rest: [string?, string?, string?, string?, (boolean | null)?] ): Promise<Models.Provider> { let params: { providerId: string; @@ -7461,7 +7525,7 @@ export class Messaging { from?: string; accountSid?: string; authToken?: string; - enabled?: boolean; + enabled?: boolean | null; }; if ( @@ -7475,7 +7539,7 @@ export class Messaging { from?: string; accountSid?: string; authToken?: string; - enabled?: boolean; + enabled?: boolean | null; }; } else { params = { @@ -7484,7 +7548,7 @@ export class Messaging { from: rest[1] as string, accountSid: rest[2] as string, authToken: rest[3] as string, - enabled: rest[4] as boolean, + enabled: rest[4] as boolean | null, }; } @@ -7544,7 +7608,7 @@ export class Messaging { provider: '', enabled: true, type: '', - credentials: [], + credentials: {}, }, }, }, @@ -7558,7 +7622,7 @@ export class Messaging { * * @param {string} params.providerId - Provider ID. * @param {string} params.name - Provider name. - * @param {boolean} params.enabled - Set as enabled. + * @param {boolean | null} params.enabled - Set as enabled. * @param {string} params.accountSid - Twilio account secret ID. * @param {string} params.authToken - Twilio authentication token. * @param {string} params.from - Sender phone number or alphanumeric sender ID. Format phone numbers with a leading '+' and a country code, e.g., +16175551212. @@ -7568,7 +7632,7 @@ export class Messaging { updateTwilioProvider(params: { providerId: string; name?: string; - enabled?: boolean; + enabled?: boolean | null; accountSid?: string; authToken?: string; from?: string; @@ -7578,7 +7642,7 @@ export class Messaging { * * @param {string} providerId - Provider ID. * @param {string} name - Provider name. - * @param {boolean} enabled - Set as enabled. + * @param {boolean | null} enabled - Set as enabled. * @param {string} accountSid - Twilio account secret ID. * @param {string} authToken - Twilio authentication token. * @param {string} from - Sender phone number or alphanumeric sender ID. Format phone numbers with a leading '+' and a country code, e.g., +16175551212. @@ -7589,7 +7653,7 @@ export class Messaging { updateTwilioProvider( providerId: string, name?: string, - enabled?: boolean, + enabled?: boolean | null, accountSid?: string, authToken?: string, from?: string, @@ -7599,18 +7663,18 @@ export class Messaging { | { providerId: string; name?: string; - enabled?: boolean; + enabled?: boolean | null; accountSid?: string; authToken?: string; from?: string; } | string, - ...rest: [string?, boolean?, string?, string?, string?] + ...rest: [string?, (boolean | null)?, string?, string?, string?] ): Promise<Models.Provider> { let params: { providerId: string; name?: string; - enabled?: boolean; + enabled?: boolean | null; accountSid?: string; authToken?: string; from?: string; @@ -7624,7 +7688,7 @@ export class Messaging { params = (paramsOrFirst || {}) as { providerId: string; name?: string; - enabled?: boolean; + enabled?: boolean | null; accountSid?: string; authToken?: string; from?: string; @@ -7633,7 +7697,7 @@ export class Messaging { params = { providerId: paramsOrFirst as string, name: rest[0] as string, - enabled: rest[1] as boolean, + enabled: rest[1] as boolean | null, accountSid: rest[2] as string, authToken: rest[3] as string, from: rest[4] as string, @@ -7693,7 +7757,7 @@ export class Messaging { provider: '', enabled: true, type: '', - credentials: [], + credentials: {}, }, }, }, @@ -7710,7 +7774,7 @@ export class Messaging { * @param {string} params.from - Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212. * @param {string} params.apiKey - Vonage API key. * @param {string} params.apiSecret - Vonage API secret. - * @param {boolean} params.enabled - Set as enabled. + * @param {boolean | null} params.enabled - Set as enabled. * @throws {AppwriteException} * @returns {Promise<Models.Provider>} */ @@ -7720,7 +7784,7 @@ export class Messaging { from?: string; apiKey?: string; apiSecret?: string; - enabled?: boolean; + enabled?: boolean | null; }): Promise<Models.Provider>; /** * Create a new Vonage provider. @@ -7730,7 +7794,7 @@ export class Messaging { * @param {string} from - Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212. * @param {string} apiKey - Vonage API key. * @param {string} apiSecret - Vonage API secret. - * @param {boolean} enabled - Set as enabled. + * @param {boolean | null} enabled - Set as enabled. * @throws {AppwriteException} * @returns {Promise<Models.Provider>} * @deprecated Use the object parameter style method for a better developer experience. @@ -7741,7 +7805,7 @@ export class Messaging { from?: string, apiKey?: string, apiSecret?: string, - enabled?: boolean, + enabled?: boolean | null, ): Promise<Models.Provider>; createVonageProvider( paramsOrFirst: @@ -7751,10 +7815,10 @@ export class Messaging { from?: string; apiKey?: string; apiSecret?: string; - enabled?: boolean; + enabled?: boolean | null; } | string, - ...rest: [string?, string?, string?, string?, boolean?] + ...rest: [string?, string?, string?, string?, (boolean | null)?] ): Promise<Models.Provider> { let params: { providerId: string; @@ -7762,7 +7826,7 @@ export class Messaging { from?: string; apiKey?: string; apiSecret?: string; - enabled?: boolean; + enabled?: boolean | null; }; if ( @@ -7776,7 +7840,7 @@ export class Messaging { from?: string; apiKey?: string; apiSecret?: string; - enabled?: boolean; + enabled?: boolean | null; }; } else { params = { @@ -7785,7 +7849,7 @@ export class Messaging { from: rest[1] as string, apiKey: rest[2] as string, apiSecret: rest[3] as string, - enabled: rest[4] as boolean, + enabled: rest[4] as boolean | null, }; } @@ -7845,7 +7909,7 @@ export class Messaging { provider: '', enabled: true, type: '', - credentials: [], + credentials: {}, }, }, }, @@ -7859,7 +7923,7 @@ export class Messaging { * * @param {string} params.providerId - Provider ID. * @param {string} params.name - Provider name. - * @param {boolean} params.enabled - Set as enabled. + * @param {boolean | null} params.enabled - Set as enabled. * @param {string} params.apiKey - Vonage API key. * @param {string} params.apiSecret - Vonage API secret. * @param {string} params.from - Sender number. @@ -7869,7 +7933,7 @@ export class Messaging { updateVonageProvider(params: { providerId: string; name?: string; - enabled?: boolean; + enabled?: boolean | null; apiKey?: string; apiSecret?: string; from?: string; @@ -7879,7 +7943,7 @@ export class Messaging { * * @param {string} providerId - Provider ID. * @param {string} name - Provider name. - * @param {boolean} enabled - Set as enabled. + * @param {boolean | null} enabled - Set as enabled. * @param {string} apiKey - Vonage API key. * @param {string} apiSecret - Vonage API secret. * @param {string} from - Sender number. @@ -7890,7 +7954,7 @@ export class Messaging { updateVonageProvider( providerId: string, name?: string, - enabled?: boolean, + enabled?: boolean | null, apiKey?: string, apiSecret?: string, from?: string, @@ -7900,18 +7964,18 @@ export class Messaging { | { providerId: string; name?: string; - enabled?: boolean; + enabled?: boolean | null; apiKey?: string; apiSecret?: string; from?: string; } | string, - ...rest: [string?, boolean?, string?, string?, string?] + ...rest: [string?, (boolean | null)?, string?, string?, string?] ): Promise<Models.Provider> { let params: { providerId: string; name?: string; - enabled?: boolean; + enabled?: boolean | null; apiKey?: string; apiSecret?: string; from?: string; @@ -7925,7 +7989,7 @@ export class Messaging { params = (paramsOrFirst || {}) as { providerId: string; name?: string; - enabled?: boolean; + enabled?: boolean | null; apiKey?: string; apiSecret?: string; from?: string; @@ -7934,7 +7998,7 @@ export class Messaging { params = { providerId: paramsOrFirst as string, name: rest[0] as string, - enabled: rest[1] as boolean, + enabled: rest[1] as boolean | null, apiKey: rest[2] as string, apiSecret: rest[3] as string, from: rest[4] as string, @@ -7994,7 +8058,7 @@ export class Messaging { provider: '', enabled: true, type: '', - credentials: [], + credentials: {}, }, }, }, @@ -8071,7 +8135,7 @@ export class Messaging { provider: '', enabled: true, type: '', - credentials: [], + credentials: {}, }, }, }, @@ -8235,6 +8299,7 @@ export class Messaging { $createdAt: '', $updatedAt: '', name: '', + description: '', emailTotal: 0, smsTotal: 0, pushTotal: 0, @@ -8253,8 +8318,9 @@ export class Messaging { * @param {string} params.topicId - Topic ID. Choose a custom Topic ID or a new Topic ID. * @param {string} params.name - Topic Name. * @param {string[]} params.subscribe - An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long. - * @param {number} params.qos - MQTT delivery quality of service for this topic. 0 is fire-and-forget (delivered only to clients connected at publish time). 1 persists each message and replays it when a client reconnects without having acknowledged it. Null lets the subscriber choose. - * @param {number} params.expiry - Message retention in seconds for offline delivery. Max 7 days (604800). + * @param {number | null} params.qos - MQTT delivery quality of service for this topic. 0 is fire-and-forget (delivered only to clients connected at publish time). 1 persists each message and replays it when a client reconnects without having acknowledged it. Null lets the subscriber choose. + * @param {number | null} params.expiry - Message retention in seconds for offline delivery. Max 7 days (604800). Null inherits the lowest expiry of the project's enabled Appwrite providers, or the 7-day ledger window if none sets one. + * @param {string} params.description - Optional description for the topic. * @throws {AppwriteException} * @returns {Promise<Models.Topic>} */ @@ -8262,8 +8328,9 @@ export class Messaging { topicId: string; name: string; subscribe?: string[]; - qos?: number; - expiry?: number; + qos?: number | null; + expiry?: number | null; + description?: string; }): Promise<Models.Topic>; /** * Create a new topic. @@ -8271,8 +8338,9 @@ export class Messaging { * @param {string} topicId - Topic ID. Choose a custom Topic ID or a new Topic ID. * @param {string} name - Topic Name. * @param {string[]} subscribe - An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long. - * @param {number} qos - MQTT delivery quality of service for this topic. 0 is fire-and-forget (delivered only to clients connected at publish time). 1 persists each message and replays it when a client reconnects without having acknowledged it. Null lets the subscriber choose. - * @param {number} expiry - Message retention in seconds for offline delivery. Max 7 days (604800). + * @param {number | null} qos - MQTT delivery quality of service for this topic. 0 is fire-and-forget (delivered only to clients connected at publish time). 1 persists each message and replays it when a client reconnects without having acknowledged it. Null lets the subscriber choose. + * @param {number | null} expiry - Message retention in seconds for offline delivery. Max 7 days (604800). Null inherits the lowest expiry of the project's enabled Appwrite providers, or the 7-day ledger window if none sets one. + * @param {string} description - Optional description for the topic. * @throws {AppwriteException} * @returns {Promise<Models.Topic>} * @deprecated Use the object parameter style method for a better developer experience. @@ -8281,8 +8349,9 @@ export class Messaging { topicId: string, name: string, subscribe?: string[], - qos?: number, - expiry?: number, + qos?: number | null, + expiry?: number | null, + description?: string, ): Promise<Models.Topic>; createTopic( paramsOrFirst: @@ -8290,18 +8359,26 @@ export class Messaging { topicId: string; name: string; subscribe?: string[]; - qos?: number; - expiry?: number; + qos?: number | null; + expiry?: number | null; + description?: string; } | string, - ...rest: [string?, string[]?, number?, number?] + ...rest: [ + string?, + string[]?, + (number | null)?, + (number | null)?, + string?, + ] ): Promise<Models.Topic> { let params: { topicId: string; name: string; subscribe?: string[]; - qos?: number; - expiry?: number; + qos?: number | null; + expiry?: number | null; + description?: string; }; if ( @@ -8313,16 +8390,18 @@ export class Messaging { topicId: string; name: string; subscribe?: string[]; - qos?: number; - expiry?: number; + qos?: number | null; + expiry?: number | null; + description?: string; }; } else { params = { topicId: paramsOrFirst as string, name: rest[0] as string, subscribe: rest[1] as string[], - qos: rest[2] as number, - expiry: rest[3] as number, + qos: rest[2] as number | null, + expiry: rest[3] as number | null, + description: rest[4] as string, }; } @@ -8331,6 +8410,7 @@ export class Messaging { const subscribe = params.subscribe; const qos = params.qos; const expiry = params.expiry; + const description = params.description; if (typeof topicId === 'undefined') { throw new AppwriteException( @@ -8357,6 +8437,9 @@ export class Messaging { if (typeof expiry !== 'undefined') { apiPayload['expiry'] = expiry; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -8375,6 +8458,7 @@ export class Messaging { $createdAt: '', $updatedAt: '', name: '', + description: '', emailTotal: 0, smsTotal: 0, pushTotal: 0, @@ -8452,6 +8536,7 @@ export class Messaging { $createdAt: '', $updatedAt: '', name: '', + description: '', emailTotal: 0, smsTotal: 0, pushTotal: 0, @@ -8469,58 +8554,70 @@ export class Messaging { * * * @param {string} params.topicId - Topic ID. - * @param {string} params.name - Topic Name. - * @param {string[]} params.subscribe - An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long. - * @param {number} params.qos - MQTT delivery quality of service for this topic. 0 is fire-and-forget (delivered only to clients connected at publish time). 1 persists each message and replays it when a client reconnects without having acknowledged it. Null lets the subscriber choose. - * @param {number} params.expiry - Message retention in seconds for offline delivery. Max 7 days (604800). + * @param {string | null} params.name - Topic Name. + * @param {string[] | null} params.subscribe - An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long. + * @param {number | null} params.qos - MQTT delivery quality of service for this topic. 0 is fire-and-forget (delivered only to clients connected at publish time). 1 persists each message and replays it when a client reconnects without having acknowledged it. Null lets the subscriber choose. + * @param {number | null} params.expiry - Message retention in seconds for offline delivery. Max 7 days (604800). Null inherits the lowest expiry of the project's enabled Appwrite providers, or the 7-day ledger window if none sets one. + * @param {string | null} params.description - Optional description for the topic. * @throws {AppwriteException} * @returns {Promise<Models.Topic>} */ updateTopic(params: { topicId: string; - name?: string; - subscribe?: string[]; - qos?: number; - expiry?: number; + name?: string | null; + subscribe?: string[] | null; + qos?: number | null; + expiry?: number | null; + description?: string | null; }): Promise<Models.Topic>; /** * Update a topic by its unique ID. * * * @param {string} topicId - Topic ID. - * @param {string} name - Topic Name. - * @param {string[]} subscribe - An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long. - * @param {number} qos - MQTT delivery quality of service for this topic. 0 is fire-and-forget (delivered only to clients connected at publish time). 1 persists each message and replays it when a client reconnects without having acknowledged it. Null lets the subscriber choose. - * @param {number} expiry - Message retention in seconds for offline delivery. Max 7 days (604800). + * @param {string | null} name - Topic Name. + * @param {string[] | null} subscribe - An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long. + * @param {number | null} qos - MQTT delivery quality of service for this topic. 0 is fire-and-forget (delivered only to clients connected at publish time). 1 persists each message and replays it when a client reconnects without having acknowledged it. Null lets the subscriber choose. + * @param {number | null} expiry - Message retention in seconds for offline delivery. Max 7 days (604800). Null inherits the lowest expiry of the project's enabled Appwrite providers, or the 7-day ledger window if none sets one. + * @param {string | null} description - Optional description for the topic. * @throws {AppwriteException} * @returns {Promise<Models.Topic>} * @deprecated Use the object parameter style method for a better developer experience. */ updateTopic( topicId: string, - name?: string, - subscribe?: string[], - qos?: number, - expiry?: number, + name?: string | null, + subscribe?: string[] | null, + qos?: number | null, + expiry?: number | null, + description?: string | null, ): Promise<Models.Topic>; updateTopic( paramsOrFirst: | { topicId: string; - name?: string; - subscribe?: string[]; - qos?: number; - expiry?: number; + name?: string | null; + subscribe?: string[] | null; + qos?: number | null; + expiry?: number | null; + description?: string | null; } | string, - ...rest: [string?, string[]?, number?, number?] + ...rest: [ + (string | null)?, + (string[] | null)?, + (number | null)?, + (number | null)?, + (string | null)?, + ] ): Promise<Models.Topic> { let params: { topicId: string; - name?: string; - subscribe?: string[]; - qos?: number; - expiry?: number; + name?: string | null; + subscribe?: string[] | null; + qos?: number | null; + expiry?: number | null; + description?: string | null; }; if ( @@ -8530,18 +8627,20 @@ export class Messaging { ) { params = (paramsOrFirst || {}) as { topicId: string; - name?: string; - subscribe?: string[]; - qos?: number; - expiry?: number; + name?: string | null; + subscribe?: string[] | null; + qos?: number | null; + expiry?: number | null; + description?: string | null; }; } else { params = { topicId: paramsOrFirst as string, - name: rest[0] as string, - subscribe: rest[1] as string[], - qos: rest[2] as number, - expiry: rest[3] as number, + name: rest[0] as string | null, + subscribe: rest[1] as string[] | null, + qos: rest[2] as number | null, + expiry: rest[3] as number | null, + description: rest[4] as string | null, }; } @@ -8550,6 +8649,7 @@ export class Messaging { const subscribe = params.subscribe; const qos = params.qos; const expiry = params.expiry; + const description = params.description; if (typeof topicId === 'undefined' || topicId === '') { throw new AppwriteException( @@ -8573,6 +8673,9 @@ export class Messaging { if (typeof expiry !== 'undefined') { apiPayload['expiry'] = expiry; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -8591,6 +8694,7 @@ export class Messaging { $createdAt: '', $updatedAt: '', name: '', + description: '', emailTotal: 0, smsTotal: 0, pushTotal: 0, diff --git a/src/services/migrations.ts b/src/services/migrations.ts index 80e35717..a52c0a44 100644 --- a/src/services/migrations.ts +++ b/src/services/migrations.ts @@ -129,10 +129,10 @@ export class Migrations { destinationResourceId: '', destinationResourceInternalId: '', destinationResourceType: '', - statusCounters: [], + statusCounters: {}, resourceData: [], errors: [], - options: [], + options: {}, }, }, }, @@ -297,10 +297,10 @@ export class Migrations { destinationResourceId: '', destinationResourceInternalId: '', destinationResourceType: '', - statusCounters: [], + statusCounters: {}, resourceData: [], errors: [], - options: [], + options: {}, }, }, }, @@ -453,6 +453,7 @@ export class Migrations { smtp: 0, rule: 0, 'project-email-template': 0, + 'project-environment': 0, site: 0, provider: 0, topic: 0, @@ -688,10 +689,10 @@ export class Migrations { destinationResourceId: '', destinationResourceInternalId: '', destinationResourceType: '', - statusCounters: [], + statusCounters: {}, resourceData: [], errors: [], - options: [], + options: {}, }, }, }, @@ -863,10 +864,10 @@ export class Migrations { destinationResourceId: '', destinationResourceInternalId: '', destinationResourceType: '', - statusCounters: [], + statusCounters: {}, resourceData: [], errors: [], - options: [], + options: {}, }, }, }, @@ -980,10 +981,10 @@ export class Migrations { destinationResourceId: '', destinationResourceInternalId: '', destinationResourceType: '', - statusCounters: [], + statusCounters: {}, resourceData: [], errors: [], - options: [], + options: {}, }, }, }, @@ -1098,6 +1099,7 @@ export class Migrations { smtp: 0, rule: 0, 'project-email-template': 0, + 'project-environment': 0, site: 0, provider: 0, topic: 0, @@ -1277,10 +1279,10 @@ export class Migrations { destinationResourceId: '', destinationResourceInternalId: '', destinationResourceType: '', - statusCounters: [], + statusCounters: {}, resourceData: [], errors: [], - options: [], + options: {}, }, }, }, @@ -1454,10 +1456,10 @@ export class Migrations { destinationResourceId: '', destinationResourceInternalId: '', destinationResourceType: '', - statusCounters: [], + statusCounters: {}, resourceData: [], errors: [], - options: [], + options: {}, }, }, }, @@ -1676,10 +1678,10 @@ export class Migrations { destinationResourceId: '', destinationResourceInternalId: '', destinationResourceType: '', - statusCounters: [], + statusCounters: {}, resourceData: [], errors: [], - options: [], + options: {}, }, }, }, @@ -1899,6 +1901,7 @@ export class Migrations { smtp: 0, rule: 0, 'project-email-template': 0, + 'project-environment': 0, site: 0, provider: 0, topic: 0, @@ -2108,10 +2111,10 @@ export class Migrations { destinationResourceId: '', destinationResourceInternalId: '', destinationResourceType: '', - statusCounters: [], + statusCounters: {}, resourceData: [], errors: [], - options: [], + options: {}, }, }, }, @@ -2313,6 +2316,7 @@ export class Migrations { smtp: 0, rule: 0, 'project-email-template': 0, + 'project-environment': 0, site: 0, provider: 0, topic: 0, @@ -2406,10 +2410,10 @@ export class Migrations { destinationResourceId: '', destinationResourceInternalId: '', destinationResourceType: '', - statusCounters: [], + statusCounters: {}, resourceData: [], errors: [], - options: [], + options: {}, }, }, }, @@ -2495,10 +2499,10 @@ export class Migrations { destinationResourceId: '', destinationResourceInternalId: '', destinationResourceType: '', - statusCounters: [], + statusCounters: {}, resourceData: [], errors: [], - options: [], + options: {}, }, }, }, diff --git a/src/services/mongo.ts b/src/services/mongo.ts index b5d4852f..7a027e6f 100644 --- a/src/services/mongo.ts +++ b/src/services/mongo.ts @@ -17,46 +17,61 @@ export class Mongo { * List all dedicated databases. Results support pagination. * * @param {string[]} params.queries - Array of query strings. + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise<Models.DedicatedDatabaseList>} */ list(params?: { queries?: string[]; + total?: boolean; }): Promise<Models.DedicatedDatabaseList>; /** * List all dedicated databases. Results support pagination. * * @param {string[]} queries - Array of query strings. + * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise<Models.DedicatedDatabaseList>} * @deprecated Use the object parameter style method for a better developer experience. */ - list(queries?: string[]): Promise<Models.DedicatedDatabaseList>; list( - paramsOrFirst?: { queries?: string[] } | string[], + queries?: string[], + total?: boolean, + ): Promise<Models.DedicatedDatabaseList>; + list( + paramsOrFirst?: { queries?: string[]; total?: boolean } | string[], + ...rest: [boolean?] ): Promise<Models.DedicatedDatabaseList> { - let params: { queries?: string[] }; + let params: { queries?: string[]; total?: boolean }; if ( - typeof paramsOrFirst === 'undefined' || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) ) { - params = (paramsOrFirst || {}) as { queries?: string[] }; + params = (paramsOrFirst || {}) as { + queries?: string[]; + total?: boolean; + }; } else { params = { queries: paramsOrFirst as string[], + total: rest[0] as boolean, }; } const queries = params.queries; + const total = params.total; const apiPath = '/mongo'; const apiPayload: Payload = {}; if (typeof queries !== 'undefined') { apiPayload['queries'] = queries; } + if (typeof total !== 'undefined') { + apiPayload['total'] = total; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -139,54 +154,54 @@ export class Mongo { * * @param {string} params.databaseId - Database 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 - Database display name. Max length: 128 chars. - * @param {string} params.version - Database engine version. Defaults to latest for selected engine. + * @param {string | null} params.version - Database engine version. Defaults to latest for selected engine. * @param {string} params.specification - Specification identifier. Drives the allocated CPU, memory, storage, storage class, and connection ceiling. * @param {number} params.replicas - Number of high availability replicas (0-5). High availability is enabled when greater than 0. - * @param {string} params.syncMode - Replication sync mode preference. Allowed values: async, sync, quorum. + * @param {string | null} params.syncMode - Replication sync mode preference. Allowed values: async, sync, quorum. * @param {number} params.networkIdleTimeoutSeconds - Connection idle timeout in seconds. - * @param {string[]} params.networkIPAllowlist - IP addresses/CIDR ranges allowed to connect. + * @param {string[] | null} params.networkIPAllowlist - IP addresses/CIDR ranges allowed to connect. * @param {number} params.idleTimeoutMinutes - Minutes of inactivity before container scales to zero. * @param {boolean} params.pitr - Enable point-in-time recovery (PITR). Continuously archives changes so the database can be restored to any moment within the retention window. * @param {number} params.pitrRetentionDays - Number of days to retain PITR data. * @param {boolean} params.storageAutoscaling - Enable automatic storage expansion when usage exceeds threshold. * @param {number} params.storageAutoscalingThresholdPercent - Storage usage percentage (50-95) that triggers automatic expansion. - * @param {number} params.storageAutoscalingMaxGb - Maximum storage size in GB for autoscaling. Defaults to 3 times the specification's storage. 0 means no limit. + * @param {number | null} params.storageAutoscalingMaxGb - Maximum storage size in GB for autoscaling. Defaults to 3 times the specification's storage. 0 means no limit. * @throws {AppwriteException} * @returns {Promise<Models.DedicatedDatabase>} */ create(params: { databaseId: string; name: string; - version?: string; + version?: string | null; specification?: string; replicas?: number; - syncMode?: string; + syncMode?: string | null; networkIdleTimeoutSeconds?: number; - networkIPAllowlist?: string[]; + networkIPAllowlist?: string[] | null; idleTimeoutMinutes?: number; pitr?: boolean; pitrRetentionDays?: number; storageAutoscaling?: boolean; storageAutoscalingThresholdPercent?: number; - storageAutoscalingMaxGb?: number; + storageAutoscalingMaxGb?: number | null; }): Promise<Models.DedicatedDatabase>; /** * Create a new dedicated database with the chosen engine and configuration. Status will be 'provisioning' until the database is ready. * * @param {string} databaseId - Database 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 - Database display name. Max length: 128 chars. - * @param {string} version - Database engine version. Defaults to latest for selected engine. + * @param {string | null} version - Database engine version. Defaults to latest for selected engine. * @param {string} specification - Specification identifier. Drives the allocated CPU, memory, storage, storage class, and connection ceiling. * @param {number} replicas - Number of high availability replicas (0-5). High availability is enabled when greater than 0. - * @param {string} syncMode - Replication sync mode preference. Allowed values: async, sync, quorum. + * @param {string | null} syncMode - Replication sync mode preference. Allowed values: async, sync, quorum. * @param {number} networkIdleTimeoutSeconds - Connection idle timeout in seconds. - * @param {string[]} networkIPAllowlist - IP addresses/CIDR ranges allowed to connect. + * @param {string[] | null} networkIPAllowlist - IP addresses/CIDR ranges allowed to connect. * @param {number} idleTimeoutMinutes - Minutes of inactivity before container scales to zero. * @param {boolean} pitr - Enable point-in-time recovery (PITR). Continuously archives changes so the database can be restored to any moment within the retention window. * @param {number} pitrRetentionDays - Number of days to retain PITR data. * @param {boolean} storageAutoscaling - Enable automatic storage expansion when usage exceeds threshold. * @param {number} storageAutoscalingThresholdPercent - Storage usage percentage (50-95) that triggers automatic expansion. - * @param {number} storageAutoscalingMaxGb - Maximum storage size in GB for autoscaling. Defaults to 3 times the specification's storage. 0 means no limit. + * @param {number | null} storageAutoscalingMaxGb - Maximum storage size in GB for autoscaling. Defaults to 3 times the specification's storage. 0 means no limit. * @throws {AppwriteException} * @returns {Promise<Models.DedicatedDatabase>} * @deprecated Use the object parameter style method for a better developer experience. @@ -194,69 +209,69 @@ export class Mongo { create( databaseId: string, name: string, - version?: string, + version?: string | null, specification?: string, replicas?: number, - syncMode?: string, + syncMode?: string | null, networkIdleTimeoutSeconds?: number, - networkIPAllowlist?: string[], + networkIPAllowlist?: string[] | null, idleTimeoutMinutes?: number, pitr?: boolean, pitrRetentionDays?: number, storageAutoscaling?: boolean, storageAutoscalingThresholdPercent?: number, - storageAutoscalingMaxGb?: number, + storageAutoscalingMaxGb?: number | null, ): Promise<Models.DedicatedDatabase>; create( paramsOrFirst: | { databaseId: string; name: string; - version?: string; + version?: string | null; specification?: string; replicas?: number; - syncMode?: string; + syncMode?: string | null; networkIdleTimeoutSeconds?: number; - networkIPAllowlist?: string[]; + networkIPAllowlist?: string[] | null; idleTimeoutMinutes?: number; pitr?: boolean; pitrRetentionDays?: number; storageAutoscaling?: boolean; storageAutoscalingThresholdPercent?: number; - storageAutoscalingMaxGb?: number; + storageAutoscalingMaxGb?: number | null; } | string, ...rest: [ string?, - string?, + (string | null)?, string?, number?, - string?, + (string | null)?, number?, - string[]?, + (string[] | null)?, number?, boolean?, number?, boolean?, number?, - number?, + (number | null)?, ] ): Promise<Models.DedicatedDatabase> { let params: { databaseId: string; name: string; - version?: string; + version?: string | null; specification?: string; replicas?: number; - syncMode?: string; + syncMode?: string | null; networkIdleTimeoutSeconds?: number; - networkIPAllowlist?: string[]; + networkIPAllowlist?: string[] | null; idleTimeoutMinutes?: number; pitr?: boolean; pitrRetentionDays?: number; storageAutoscaling?: boolean; storageAutoscalingThresholdPercent?: number; - storageAutoscalingMaxGb?: number; + storageAutoscalingMaxGb?: number | null; }; if ( @@ -267,35 +282,35 @@ export class Mongo { params = (paramsOrFirst || {}) as { databaseId: string; name: string; - version?: string; + version?: string | null; specification?: string; replicas?: number; - syncMode?: string; + syncMode?: string | null; networkIdleTimeoutSeconds?: number; - networkIPAllowlist?: string[]; + networkIPAllowlist?: string[] | null; idleTimeoutMinutes?: number; pitr?: boolean; pitrRetentionDays?: number; storageAutoscaling?: boolean; storageAutoscalingThresholdPercent?: number; - storageAutoscalingMaxGb?: number; + storageAutoscalingMaxGb?: number | null; }; } else { params = { databaseId: paramsOrFirst as string, name: rest[0] as string, - version: rest[1] as string, + version: rest[1] as string | null, specification: rest[2] as string, replicas: rest[3] as number, - syncMode: rest[4] as string, + syncMode: rest[4] as string | null, networkIdleTimeoutSeconds: rest[5] as number, - networkIPAllowlist: rest[6] as string[], + networkIPAllowlist: rest[6] as string[] | null, idleTimeoutMinutes: rest[7] as number, pitr: rest[8] as boolean, pitrRetentionDays: rest[9] as number, storageAutoscaling: rest[10] as boolean, storageAutoscalingThresholdPercent: rest[11] as number, - storageAutoscalingMaxGb: rest[12] as number, + storageAutoscalingMaxGb: rest[12] as number | null, }; } @@ -605,174 +620,174 @@ export class Mongo { * Update a dedicated database configuration. All changes are applied with zero downtime. Specification changes (cpu, memory, storage) are handled via rolling cutover. Storage expansion is done online. All other settings are applied in-place. * * @param {string} params.databaseId - Database ID. - * @param {string} params.name - Database display name. - * @param {string} params.status - Database status. Allowed values: ready, paused, inactive. Set to "paused" to pause, "ready" to resume (also recovers a failed database whose infrastructure is healthy), or "inactive" to spin down a shared-pool database. - * @param {string} params.specification - Specification. Changes cpu, memory, storage, connection ceiling, and node pool based on specification config. Resource changes are applied via rolling cutover with zero downtime. - * @param {number} params.replicas - Number of high availability replicas (0-5). High availability is enabled when greater than 0. - * @param {string} params.syncMode - Replication sync mode preference. Allowed values: async, sync, quorum. - * @param {number} params.networkIdleTimeoutSeconds - Connection idle timeout in seconds (60-86400). - * @param {string[]} params.networkIPAllowlist - IP addresses/CIDR ranges allowed to connect. - * @param {number} params.idleTimeoutMinutes - Minutes before container scales to zero. - * @param {boolean} params.pitr - Enable or disable point-in-time recovery (PITR). - * @param {number} params.pitrRetentionDays - Days to retain PITR data. - * @param {boolean} params.storageAutoscaling - Enable automatic storage expansion when usage exceeds threshold. - * @param {number} params.storageAutoscalingThresholdPercent - Storage usage percentage (50-95) that triggers automatic expansion. - * @param {number} params.storageAutoscalingMaxGb - Maximum storage size in GB for autoscaling. 0 means no limit. - * @param {number} params.metricsTraceSampleRate - Fraction of queries to trace (0.0–1.0). Forwarded to the sidecar. - * @param {number} params.metricsSlowQueryLogThresholdMs - Threshold in ms above which queries are logged as slow. Forwarded to the sidecar. - * @param {boolean} params.sqlApiEnabled - Enable the SQL API sidecar for this database. - * @param {string[]} params.sqlApiAllowedStatements - Statement types the SQL API accepts. Allowed values: SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, TRUNCATE, GRANT, REVOKE. - * @param {number} params.sqlApiMaxRows - Maximum rows returned per SQL API execution (1-1000000). - * @param {number} params.sqlApiMaxBytes - Maximum serialised SQL API result payload in bytes (1024-104857600). - * @param {number} params.sqlApiTimeoutSeconds - Per-call SQL API execution timeout in seconds (1-300). + * @param {string | null} params.name - Database display name. + * @param {string | null} params.status - Database status. Allowed values: ready, paused, inactive. Set to "paused" to pause, "ready" to resume (also recovers a failed database whose infrastructure is healthy), or "inactive" to spin down a shared-pool database. + * @param {string | null} params.specification - Specification. Changes cpu, memory, storage, connection ceiling, and node pool based on specification config. Resource changes are applied via rolling cutover with zero downtime. + * @param {number | null} params.replicas - Number of high availability replicas (0-5). High availability is enabled when greater than 0. + * @param {string | null} params.syncMode - Replication sync mode preference. Allowed values: async, sync, quorum. + * @param {number | null} params.networkIdleTimeoutSeconds - Connection idle timeout in seconds (60-86400). + * @param {string[] | null} params.networkIPAllowlist - IP addresses/CIDR ranges allowed to connect. + * @param {number | null} params.idleTimeoutMinutes - Minutes before container scales to zero. + * @param {boolean | null} params.pitr - Enable or disable point-in-time recovery (PITR). + * @param {number | null} params.pitrRetentionDays - Days to retain PITR data. + * @param {boolean | null} params.storageAutoscaling - Enable automatic storage expansion when usage exceeds threshold. + * @param {number | null} params.storageAutoscalingThresholdPercent - Storage usage percentage (50-95) that triggers automatic expansion. + * @param {number | null} params.storageAutoscalingMaxGb - Maximum storage size in GB for autoscaling. 0 means no limit. + * @param {number | null} params.metricsTraceSampleRate - Fraction of queries to trace (0.0–1.0). Forwarded to the sidecar. + * @param {number | null} params.metricsSlowQueryLogThresholdMs - Threshold in ms above which queries are logged as slow. Forwarded to the sidecar. + * @param {boolean | null} params.sqlApiEnabled - Enable the SQL API sidecar for this database. + * @param {string[] | null} params.sqlApiAllowedStatements - Statement types the SQL API accepts. Allowed values: SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, TRUNCATE, GRANT, REVOKE. + * @param {number | null} params.sqlApiMaxRows - Maximum rows returned per SQL API execution (1-1000000). + * @param {number | null} params.sqlApiMaxBytes - Maximum serialised SQL API result payload in bytes (1024-104857600). + * @param {number | null} params.sqlApiTimeoutSeconds - Per-call SQL API execution timeout in seconds (1-300). * @throws {AppwriteException} * @returns {Promise<Models.DedicatedDatabase>} */ update(params: { databaseId: string; - name?: string; - status?: string; - specification?: string; - replicas?: number; - syncMode?: string; - networkIdleTimeoutSeconds?: number; - networkIPAllowlist?: string[]; - idleTimeoutMinutes?: number; - pitr?: boolean; - pitrRetentionDays?: number; - storageAutoscaling?: boolean; - storageAutoscalingThresholdPercent?: number; - storageAutoscalingMaxGb?: number; - metricsTraceSampleRate?: number; - metricsSlowQueryLogThresholdMs?: number; - sqlApiEnabled?: boolean; - sqlApiAllowedStatements?: string[]; - sqlApiMaxRows?: number; - sqlApiMaxBytes?: number; - sqlApiTimeoutSeconds?: number; + name?: string | null; + status?: string | null; + specification?: string | null; + replicas?: number | null; + syncMode?: string | null; + networkIdleTimeoutSeconds?: number | null; + networkIPAllowlist?: string[] | null; + idleTimeoutMinutes?: number | null; + pitr?: boolean | null; + pitrRetentionDays?: number | null; + storageAutoscaling?: boolean | null; + storageAutoscalingThresholdPercent?: number | null; + storageAutoscalingMaxGb?: number | null; + metricsTraceSampleRate?: number | null; + metricsSlowQueryLogThresholdMs?: number | null; + sqlApiEnabled?: boolean | null; + sqlApiAllowedStatements?: string[] | null; + sqlApiMaxRows?: number | null; + sqlApiMaxBytes?: number | null; + sqlApiTimeoutSeconds?: number | null; }): Promise<Models.DedicatedDatabase>; /** * Update a dedicated database configuration. All changes are applied with zero downtime. Specification changes (cpu, memory, storage) are handled via rolling cutover. Storage expansion is done online. All other settings are applied in-place. * * @param {string} databaseId - Database ID. - * @param {string} name - Database display name. - * @param {string} status - Database status. Allowed values: ready, paused, inactive. Set to "paused" to pause, "ready" to resume (also recovers a failed database whose infrastructure is healthy), or "inactive" to spin down a shared-pool database. - * @param {string} specification - Specification. Changes cpu, memory, storage, connection ceiling, and node pool based on specification config. Resource changes are applied via rolling cutover with zero downtime. - * @param {number} replicas - Number of high availability replicas (0-5). High availability is enabled when greater than 0. - * @param {string} syncMode - Replication sync mode preference. Allowed values: async, sync, quorum. - * @param {number} networkIdleTimeoutSeconds - Connection idle timeout in seconds (60-86400). - * @param {string[]} networkIPAllowlist - IP addresses/CIDR ranges allowed to connect. - * @param {number} idleTimeoutMinutes - Minutes before container scales to zero. - * @param {boolean} pitr - Enable or disable point-in-time recovery (PITR). - * @param {number} pitrRetentionDays - Days to retain PITR data. - * @param {boolean} storageAutoscaling - Enable automatic storage expansion when usage exceeds threshold. - * @param {number} storageAutoscalingThresholdPercent - Storage usage percentage (50-95) that triggers automatic expansion. - * @param {number} storageAutoscalingMaxGb - Maximum storage size in GB for autoscaling. 0 means no limit. - * @param {number} metricsTraceSampleRate - Fraction of queries to trace (0.0–1.0). Forwarded to the sidecar. - * @param {number} metricsSlowQueryLogThresholdMs - Threshold in ms above which queries are logged as slow. Forwarded to the sidecar. - * @param {boolean} sqlApiEnabled - Enable the SQL API sidecar for this database. - * @param {string[]} sqlApiAllowedStatements - Statement types the SQL API accepts. Allowed values: SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, TRUNCATE, GRANT, REVOKE. - * @param {number} sqlApiMaxRows - Maximum rows returned per SQL API execution (1-1000000). - * @param {number} sqlApiMaxBytes - Maximum serialised SQL API result payload in bytes (1024-104857600). - * @param {number} sqlApiTimeoutSeconds - Per-call SQL API execution timeout in seconds (1-300). + * @param {string | null} name - Database display name. + * @param {string | null} status - Database status. Allowed values: ready, paused, inactive. Set to "paused" to pause, "ready" to resume (also recovers a failed database whose infrastructure is healthy), or "inactive" to spin down a shared-pool database. + * @param {string | null} specification - Specification. Changes cpu, memory, storage, connection ceiling, and node pool based on specification config. Resource changes are applied via rolling cutover with zero downtime. + * @param {number | null} replicas - Number of high availability replicas (0-5). High availability is enabled when greater than 0. + * @param {string | null} syncMode - Replication sync mode preference. Allowed values: async, sync, quorum. + * @param {number | null} networkIdleTimeoutSeconds - Connection idle timeout in seconds (60-86400). + * @param {string[] | null} networkIPAllowlist - IP addresses/CIDR ranges allowed to connect. + * @param {number | null} idleTimeoutMinutes - Minutes before container scales to zero. + * @param {boolean | null} pitr - Enable or disable point-in-time recovery (PITR). + * @param {number | null} pitrRetentionDays - Days to retain PITR data. + * @param {boolean | null} storageAutoscaling - Enable automatic storage expansion when usage exceeds threshold. + * @param {number | null} storageAutoscalingThresholdPercent - Storage usage percentage (50-95) that triggers automatic expansion. + * @param {number | null} storageAutoscalingMaxGb - Maximum storage size in GB for autoscaling. 0 means no limit. + * @param {number | null} metricsTraceSampleRate - Fraction of queries to trace (0.0–1.0). Forwarded to the sidecar. + * @param {number | null} metricsSlowQueryLogThresholdMs - Threshold in ms above which queries are logged as slow. Forwarded to the sidecar. + * @param {boolean | null} sqlApiEnabled - Enable the SQL API sidecar for this database. + * @param {string[] | null} sqlApiAllowedStatements - Statement types the SQL API accepts. Allowed values: SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, TRUNCATE, GRANT, REVOKE. + * @param {number | null} sqlApiMaxRows - Maximum rows returned per SQL API execution (1-1000000). + * @param {number | null} sqlApiMaxBytes - Maximum serialised SQL API result payload in bytes (1024-104857600). + * @param {number | null} sqlApiTimeoutSeconds - Per-call SQL API execution timeout in seconds (1-300). * @throws {AppwriteException} * @returns {Promise<Models.DedicatedDatabase>} * @deprecated Use the object parameter style method for a better developer experience. */ update( databaseId: string, - name?: string, - status?: string, - specification?: string, - replicas?: number, - syncMode?: string, - networkIdleTimeoutSeconds?: number, - networkIPAllowlist?: string[], - idleTimeoutMinutes?: number, - pitr?: boolean, - pitrRetentionDays?: number, - storageAutoscaling?: boolean, - storageAutoscalingThresholdPercent?: number, - storageAutoscalingMaxGb?: number, - metricsTraceSampleRate?: number, - metricsSlowQueryLogThresholdMs?: number, - sqlApiEnabled?: boolean, - sqlApiAllowedStatements?: string[], - sqlApiMaxRows?: number, - sqlApiMaxBytes?: number, - sqlApiTimeoutSeconds?: number, + name?: string | null, + status?: string | null, + specification?: string | null, + replicas?: number | null, + syncMode?: string | null, + networkIdleTimeoutSeconds?: number | null, + networkIPAllowlist?: string[] | null, + idleTimeoutMinutes?: number | null, + pitr?: boolean | null, + pitrRetentionDays?: number | null, + storageAutoscaling?: boolean | null, + storageAutoscalingThresholdPercent?: number | null, + storageAutoscalingMaxGb?: number | null, + metricsTraceSampleRate?: number | null, + metricsSlowQueryLogThresholdMs?: number | null, + sqlApiEnabled?: boolean | null, + sqlApiAllowedStatements?: string[] | null, + sqlApiMaxRows?: number | null, + sqlApiMaxBytes?: number | null, + sqlApiTimeoutSeconds?: number | null, ): Promise<Models.DedicatedDatabase>; update( paramsOrFirst: | { databaseId: string; - name?: string; - status?: string; - specification?: string; - replicas?: number; - syncMode?: string; - networkIdleTimeoutSeconds?: number; - networkIPAllowlist?: string[]; - idleTimeoutMinutes?: number; - pitr?: boolean; - pitrRetentionDays?: number; - storageAutoscaling?: boolean; - storageAutoscalingThresholdPercent?: number; - storageAutoscalingMaxGb?: number; - metricsTraceSampleRate?: number; - metricsSlowQueryLogThresholdMs?: number; - sqlApiEnabled?: boolean; - sqlApiAllowedStatements?: string[]; - sqlApiMaxRows?: number; - sqlApiMaxBytes?: number; - sqlApiTimeoutSeconds?: number; + name?: string | null; + status?: string | null; + specification?: string | null; + replicas?: number | null; + syncMode?: string | null; + networkIdleTimeoutSeconds?: number | null; + networkIPAllowlist?: string[] | null; + idleTimeoutMinutes?: number | null; + pitr?: boolean | null; + pitrRetentionDays?: number | null; + storageAutoscaling?: boolean | null; + storageAutoscalingThresholdPercent?: number | null; + storageAutoscalingMaxGb?: number | null; + metricsTraceSampleRate?: number | null; + metricsSlowQueryLogThresholdMs?: number | null; + sqlApiEnabled?: boolean | null; + sqlApiAllowedStatements?: string[] | null; + sqlApiMaxRows?: number | null; + sqlApiMaxBytes?: number | null; + sqlApiTimeoutSeconds?: number | null; } | string, ...rest: [ - string?, - string?, - string?, - number?, - string?, - number?, - string[]?, - number?, - boolean?, - number?, - boolean?, - number?, - number?, - number?, - number?, - boolean?, - string[]?, - number?, - number?, - number?, + (string | null)?, + (string | null)?, + (string | null)?, + (number | null)?, + (string | null)?, + (number | null)?, + (string[] | null)?, + (number | null)?, + (boolean | null)?, + (number | null)?, + (boolean | null)?, + (number | null)?, + (number | null)?, + (number | null)?, + (number | null)?, + (boolean | null)?, + (string[] | null)?, + (number | null)?, + (number | null)?, + (number | null)?, ] ): Promise<Models.DedicatedDatabase> { let params: { databaseId: string; - name?: string; - status?: string; - specification?: string; - replicas?: number; - syncMode?: string; - networkIdleTimeoutSeconds?: number; - networkIPAllowlist?: string[]; - idleTimeoutMinutes?: number; - pitr?: boolean; - pitrRetentionDays?: number; - storageAutoscaling?: boolean; - storageAutoscalingThresholdPercent?: number; - storageAutoscalingMaxGb?: number; - metricsTraceSampleRate?: number; - metricsSlowQueryLogThresholdMs?: number; - sqlApiEnabled?: boolean; - sqlApiAllowedStatements?: string[]; - sqlApiMaxRows?: number; - sqlApiMaxBytes?: number; - sqlApiTimeoutSeconds?: number; + name?: string | null; + status?: string | null; + specification?: string | null; + replicas?: number | null; + syncMode?: string | null; + networkIdleTimeoutSeconds?: number | null; + networkIPAllowlist?: string[] | null; + idleTimeoutMinutes?: number | null; + pitr?: boolean | null; + pitrRetentionDays?: number | null; + storageAutoscaling?: boolean | null; + storageAutoscalingThresholdPercent?: number | null; + storageAutoscalingMaxGb?: number | null; + metricsTraceSampleRate?: number | null; + metricsSlowQueryLogThresholdMs?: number | null; + sqlApiEnabled?: boolean | null; + sqlApiAllowedStatements?: string[] | null; + sqlApiMaxRows?: number | null; + sqlApiMaxBytes?: number | null; + sqlApiTimeoutSeconds?: number | null; }; if ( @@ -782,50 +797,50 @@ export class Mongo { ) { params = (paramsOrFirst || {}) as { databaseId: string; - name?: string; - status?: string; - specification?: string; - replicas?: number; - syncMode?: string; - networkIdleTimeoutSeconds?: number; - networkIPAllowlist?: string[]; - idleTimeoutMinutes?: number; - pitr?: boolean; - pitrRetentionDays?: number; - storageAutoscaling?: boolean; - storageAutoscalingThresholdPercent?: number; - storageAutoscalingMaxGb?: number; - metricsTraceSampleRate?: number; - metricsSlowQueryLogThresholdMs?: number; - sqlApiEnabled?: boolean; - sqlApiAllowedStatements?: string[]; - sqlApiMaxRows?: number; - sqlApiMaxBytes?: number; - sqlApiTimeoutSeconds?: number; + name?: string | null; + status?: string | null; + specification?: string | null; + replicas?: number | null; + syncMode?: string | null; + networkIdleTimeoutSeconds?: number | null; + networkIPAllowlist?: string[] | null; + idleTimeoutMinutes?: number | null; + pitr?: boolean | null; + pitrRetentionDays?: number | null; + storageAutoscaling?: boolean | null; + storageAutoscalingThresholdPercent?: number | null; + storageAutoscalingMaxGb?: number | null; + metricsTraceSampleRate?: number | null; + metricsSlowQueryLogThresholdMs?: number | null; + sqlApiEnabled?: boolean | null; + sqlApiAllowedStatements?: string[] | null; + sqlApiMaxRows?: number | null; + sqlApiMaxBytes?: number | null; + sqlApiTimeoutSeconds?: number | null; }; } else { params = { databaseId: paramsOrFirst as string, - name: rest[0] as string, - status: rest[1] as string, - specification: rest[2] as string, - replicas: rest[3] as number, - syncMode: rest[4] as string, - networkIdleTimeoutSeconds: rest[5] as number, - networkIPAllowlist: rest[6] as string[], - idleTimeoutMinutes: rest[7] as number, - pitr: rest[8] as boolean, - pitrRetentionDays: rest[9] as number, - storageAutoscaling: rest[10] as boolean, - storageAutoscalingThresholdPercent: rest[11] as number, - storageAutoscalingMaxGb: rest[12] as number, - metricsTraceSampleRate: rest[13] as number, - metricsSlowQueryLogThresholdMs: rest[14] as number, - sqlApiEnabled: rest[15] as boolean, - sqlApiAllowedStatements: rest[16] as string[], - sqlApiMaxRows: rest[17] as number, - sqlApiMaxBytes: rest[18] as number, - sqlApiTimeoutSeconds: rest[19] as number, + name: rest[0] as string | null, + status: rest[1] as string | null, + specification: rest[2] as string | null, + replicas: rest[3] as number | null, + syncMode: rest[4] as string | null, + networkIdleTimeoutSeconds: rest[5] as number | null, + networkIPAllowlist: rest[6] as string[] | null, + idleTimeoutMinutes: rest[7] as number | null, + pitr: rest[8] as boolean | null, + pitrRetentionDays: rest[9] as number | null, + storageAutoscaling: rest[10] as boolean | null, + storageAutoscalingThresholdPercent: rest[11] as number | null, + storageAutoscalingMaxGb: rest[12] as number | null, + metricsTraceSampleRate: rest[13] as number | null, + metricsSlowQueryLogThresholdMs: rest[14] as number | null, + sqlApiEnabled: rest[15] as boolean | null, + sqlApiAllowedStatements: rest[16] as string[] | null, + sqlApiMaxRows: rest[17] as number | null, + sqlApiMaxBytes: rest[18] as number | null, + sqlApiTimeoutSeconds: rest[19] as number | null, }; } @@ -1052,18 +1067,21 @@ export class Mongo { * * @param {string} params.databaseId - Database ID. * @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. You may filter on the following attributes: status, type, databaseId + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise<Models.DedicatedDatabaseBackupList>} */ listBackups(params: { databaseId: string; queries?: string[]; + total?: boolean; }): Promise<Models.DedicatedDatabaseBackupList>; /** * List all backups for a dedicated database. Results can be filtered by status and type. * * @param {string} databaseId - Database ID. * @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. You may filter on the following attributes: status, type, databaseId + * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise<Models.DedicatedDatabaseBackupList>} * @deprecated Use the object parameter style method for a better developer experience. @@ -1071,12 +1089,15 @@ export class Mongo { listBackups( databaseId: string, queries?: string[], + total?: boolean, ): Promise<Models.DedicatedDatabaseBackupList>; listBackups( - paramsOrFirst: { databaseId: string; queries?: string[] } | string, - ...rest: [string[]?] + paramsOrFirst: + | { databaseId: string; queries?: string[]; total?: boolean } + | string, + ...rest: [string[]?, boolean?] ): Promise<Models.DedicatedDatabaseBackupList> { - let params: { databaseId: string; queries?: string[] }; + let params: { databaseId: string; queries?: string[]; total?: boolean }; if ( paramsOrFirst && @@ -1086,16 +1107,19 @@ export class Mongo { params = (paramsOrFirst || {}) as { databaseId: string; queries?: string[]; + total?: boolean; }; } else { params = { databaseId: paramsOrFirst as string, queries: rest[0] as string[], + total: rest[1] as boolean, }; } const databaseId = params.databaseId; const queries = params.queries; + const total = params.total; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -1110,6 +1134,9 @@ export class Mongo { if (typeof queries !== 'undefined') { apiPayload['queries'] = queries; } + if (typeof total !== 'undefined') { + apiPayload['total'] = total; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -1256,18 +1283,21 @@ export class Mongo { * * @param {string} params.databaseId - Database ID. * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise<Models.BackupPolicyList>} */ listBackupPolicies(params: { databaseId: string; queries?: string[]; + total?: boolean; }): Promise<Models.BackupPolicyList>; /** * List scheduled backup policies for a dedicated database. * * @param {string} databaseId - Database ID. * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. + * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise<Models.BackupPolicyList>} * @deprecated Use the object parameter style method for a better developer experience. @@ -1275,12 +1305,15 @@ export class Mongo { listBackupPolicies( databaseId: string, queries?: string[], + total?: boolean, ): Promise<Models.BackupPolicyList>; listBackupPolicies( - paramsOrFirst: { databaseId: string; queries?: string[] } | string, - ...rest: [string[]?] + paramsOrFirst: + | { databaseId: string; queries?: string[]; total?: boolean } + | string, + ...rest: [string[]?, boolean?] ): Promise<Models.BackupPolicyList> { - let params: { databaseId: string; queries?: string[] }; + let params: { databaseId: string; queries?: string[]; total?: boolean }; if ( paramsOrFirst && @@ -1290,16 +1323,19 @@ export class Mongo { params = (paramsOrFirst || {}) as { databaseId: string; queries?: string[]; + total?: boolean; }; } else { params = { databaseId: paramsOrFirst as string, queries: rest[0] as string[], + total: rest[1] as boolean, }; } const databaseId = params.databaseId; const queries = params.queries; + const total = params.total; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -1314,6 +1350,9 @@ export class Mongo { if (typeof queries !== 'undefined') { apiPayload['queries'] = queries; } + if (typeof total !== 'undefined') { + apiPayload['total'] = total; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -1637,30 +1676,30 @@ export class Mongo { * * @param {string} params.databaseId - Database ID. * @param {string} params.policyId - Policy ID. - * @param {string} params.name - Policy name. Max length: 128 chars. + * @param {string | null} params.name - Policy name. Max length: 128 chars. * @param {string} params.schedule - Schedule CRON syntax. - * @param {number} params.retention - Days to keep backups before deletion. - * @param {boolean} params.enabled - Is policy enabled? When disabled, no backups will be taken. + * @param {number | null} params.retention - Days to keep backups before deletion. + * @param {boolean | null} params.enabled - Is policy enabled? When disabled, no backups will be taken. * @throws {AppwriteException} * @returns {Promise<Models.BackupPolicy>} */ updateBackupPolicy(params: { databaseId: string; policyId: string; - name?: string; + name?: string | null; schedule?: string; - retention?: number; - enabled?: boolean; + retention?: number | null; + enabled?: boolean | null; }): Promise<Models.BackupPolicy>; /** * Update a scheduled backup policy for a dedicated database. * * @param {string} databaseId - Database ID. * @param {string} policyId - Policy ID. - * @param {string} name - Policy name. Max length: 128 chars. + * @param {string | null} name - Policy name. Max length: 128 chars. * @param {string} schedule - Schedule CRON syntax. - * @param {number} retention - Days to keep backups before deletion. - * @param {boolean} enabled - Is policy enabled? When disabled, no backups will be taken. + * @param {number | null} retention - Days to keep backups before deletion. + * @param {boolean | null} enabled - Is policy enabled? When disabled, no backups will be taken. * @throws {AppwriteException} * @returns {Promise<Models.BackupPolicy>} * @deprecated Use the object parameter style method for a better developer experience. @@ -1668,31 +1707,37 @@ export class Mongo { updateBackupPolicy( databaseId: string, policyId: string, - name?: string, + name?: string | null, schedule?: string, - retention?: number, - enabled?: boolean, + retention?: number | null, + enabled?: boolean | null, ): Promise<Models.BackupPolicy>; updateBackupPolicy( paramsOrFirst: | { databaseId: string; policyId: string; - name?: string; + name?: string | null; schedule?: string; - retention?: number; - enabled?: boolean; + retention?: number | null; + enabled?: boolean | null; } | string, - ...rest: [string?, string?, string?, number?, boolean?] + ...rest: [ + string?, + (string | null)?, + string?, + (number | null)?, + (boolean | null)?, + ] ): Promise<Models.BackupPolicy> { let params: { databaseId: string; policyId: string; - name?: string; + name?: string | null; schedule?: string; - retention?: number; - enabled?: boolean; + retention?: number | null; + enabled?: boolean | null; }; if ( @@ -1703,19 +1748,19 @@ export class Mongo { params = (paramsOrFirst || {}) as { databaseId: string; policyId: string; - name?: string; + name?: string | null; schedule?: string; - retention?: number; - enabled?: boolean; + retention?: number | null; + enabled?: boolean | null; }; } else { params = { databaseId: paramsOrFirst as string, policyId: rest[0] as string, - name: rest[1] as string, + name: rest[1] as string | null, schedule: rest[2] as string, - retention: rest[3] as number, - enabled: rest[4] as boolean, + retention: rest[3] as number | null, + enabled: rest[4] as boolean | null, }; } @@ -2659,33 +2704,33 @@ export class Mongo { * Trigger a manual failover for a dedicated database with high availability enabled. Promotes a replica to primary. The failover runs asynchronously; poll the database document for status updates. A database left mid-operation also accepts this call as a repair once nothing is driving the operation it is stuck in. Repairing a failover that did not finish, a `failed` database, a stranded upgrade or migrate, or a stranded compute resize additionally requires `targetReplicaId` to name the member to promote, because the default target may be the member that operation already promoted. * * @param {string} params.databaseId - Database ID. - * @param {string} params.targetReplicaId - Target replica ID to promote. If not specified, the healthiest replica is selected. + * @param {string | null} params.targetReplicaId - Target replica ID to promote. If not specified, the healthiest replica is selected. * @throws {AppwriteException} * @returns {Promise<Models.DedicatedDatabase>} */ createFailover(params: { databaseId: string; - targetReplicaId?: string; + targetReplicaId?: string | null; }): Promise<Models.DedicatedDatabase>; /** * Trigger a manual failover for a dedicated database with high availability enabled. Promotes a replica to primary. The failover runs asynchronously; poll the database document for status updates. A database left mid-operation also accepts this call as a repair once nothing is driving the operation it is stuck in. Repairing a failover that did not finish, a `failed` database, a stranded upgrade or migrate, or a stranded compute resize additionally requires `targetReplicaId` to name the member to promote, because the default target may be the member that operation already promoted. * * @param {string} databaseId - Database ID. - * @param {string} targetReplicaId - Target replica ID to promote. If not specified, the healthiest replica is selected. + * @param {string | null} targetReplicaId - Target replica ID to promote. If not specified, the healthiest replica is selected. * @throws {AppwriteException} * @returns {Promise<Models.DedicatedDatabase>} * @deprecated Use the object parameter style method for a better developer experience. */ createFailover( databaseId: string, - targetReplicaId?: string, + targetReplicaId?: string | null, ): Promise<Models.DedicatedDatabase>; createFailover( paramsOrFirst: - { databaseId: string; targetReplicaId?: string } | string, - ...rest: [string?] + { databaseId: string; targetReplicaId?: string | null } | string, + ...rest: [(string | null)?] ): Promise<Models.DedicatedDatabase> { - let params: { databaseId: string; targetReplicaId?: string }; + let params: { databaseId: string; targetReplicaId?: string | null }; if ( paramsOrFirst && @@ -2694,12 +2739,12 @@ export class Mongo { ) { params = (paramsOrFirst || {}) as { databaseId: string; - targetReplicaId?: string; + targetReplicaId?: string | null; }; } else { params = { databaseId: paramsOrFirst as string, - targetReplicaId: rest[0] as string, + targetReplicaId: rest[0] as string | null, }; } @@ -2940,21 +2985,21 @@ export class Mongo { * * @param {string} params.databaseId - Database ID. * @param {string} params.targetType - Target database type to migrate to. Allowed values: shared (serverless, scales to zero when idle), dedicated (always-on with persistent resources). - * @param {string} params.specification - Target specification to provision when migrating to dedicated. Ignored for shared. Defaults to the database's current specification. + * @param {string | null} params.specification - Target specification to provision when migrating to dedicated. Ignored for shared. Defaults to the database's current specification. * @throws {AppwriteException} * @returns {Promise<Models.DedicatedDatabase>} */ createMigration(params: { databaseId: string; targetType: string; - specification?: string; + specification?: string | null; }): Promise<Models.DedicatedDatabase>; /** * Migrate a database between shared and dedicated types. Shared to dedicated provisions an always-on dedicated instance; dedicated to shared converts to a serverless instance that scales to zero when idle. Data is copied to the target with a brief read-only window during cutover. * * @param {string} databaseId - Database ID. * @param {string} targetType - Target database type to migrate to. Allowed values: shared (serverless, scales to zero when idle), dedicated (always-on with persistent resources). - * @param {string} specification - Target specification to provision when migrating to dedicated. Ignored for shared. Defaults to the database's current specification. + * @param {string | null} specification - Target specification to provision when migrating to dedicated. Ignored for shared. Defaults to the database's current specification. * @throws {AppwriteException} * @returns {Promise<Models.DedicatedDatabase>} * @deprecated Use the object parameter style method for a better developer experience. @@ -2962,18 +3007,22 @@ export class Mongo { createMigration( databaseId: string, targetType: string, - specification?: string, + specification?: string | null, ): Promise<Models.DedicatedDatabase>; createMigration( paramsOrFirst: - | { databaseId: string; targetType: string; specification?: string } + | { + databaseId: string; + targetType: string; + specification?: string | null; + } | string, - ...rest: [string?, string?] + ...rest: [string?, (string | null)?] ): Promise<Models.DedicatedDatabase> { let params: { databaseId: string; targetType: string; - specification?: string; + specification?: string | null; }; if ( @@ -2984,13 +3033,13 @@ export class Mongo { params = (paramsOrFirst || {}) as { databaseId: string; targetType: string; - specification?: string; + specification?: string | null; }; } else { params = { databaseId: paramsOrFirst as string, targetType: rest[0] as string, - specification: rest[1] as string, + specification: rest[1] as string | null, }; } @@ -3515,6 +3564,7 @@ export class Mongo { databaseId: '', projectId: '', type: 'backup', + restoreMode: 'in_place', status: 'pending', error: '', }, @@ -3528,29 +3578,42 @@ export class Mongo { /** * Restore a database from a backup or to a specific point in time (PITR). For backup restoration, provide a backupId. For PITR, provide a targetTime as an ISO 8601 datetime. PITR requires the database to have PITR enabled and is only available for enterprise databases. * + * By default the backup is replayed over the database it was taken from. Pass `restoreMode` as `clone` to recover it onto a second workload beside this database instead: this database keeps serving its own data while the clone is filled, and the switch happens as soon as the clone is ready, on the endpoint and credentials it already had. Pass `autoPromote` as false to hold the clone until you promote it yourself. Pass `restoreMode` as `copy` to recover onto a separate database with its own endpoint, either one you name with `targetDatabaseId` or one provisioned as a copy of this database's engine, version, specification and replicas. Neither mode is available for a point-in-time recovery or an incremental backup. + * * @param {string} params.databaseId - Database ID. * @param {string} params.type - Restoration type. Allowed values: backup, pitr. Use "backup" to restore from a specific backup, or "pitr" for point-in-time recovery. - * @param {string} params.backupId - Backup ID to restore from (required for backup type). - * @param {string} params.targetDatabaseId - Existing database ID to restore into. The target must be distinct, ready, and use the same engine and version. - * @param {string} params.targetTime - Target time for PITR (required for pitr type) as an [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) datetime. + * @param {string | null} params.backupId - Backup ID to restore from (required for backup type). + * @param {string | null} params.targetDatabaseId - Existing database ID to restore into. The target must be distinct, ready, and use the same engine and version. Omit it on a copy restoration to have one provisioned. Not accepted for a clone, which is recovered inside this database. + * @param {string | null} params.targetTime - Target time for PITR (required for pitr type) as an [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) datetime. + * @param {string | null} params.restoreMode - Where the backup is restored. Allowed values: in_place, clone, copy. Use "clone" to recover onto a second workload beside this database and leave it serving until you promote — the endpoint and credentials do not change. Use "copy" to recover onto a separate database with its own endpoint, either one you name with targetDatabaseId or one Cloud provisions. Use "in_place" to replay the backup over this database. Defaults to "copy" when a targetDatabaseId is given, "in_place" otherwise. + * @param {string | null} params.targetName - Display name for the database a copy restoration provisions. Defaults to this database's name followed by "(restored)". Max length: 128 chars. + * @param {boolean} params.autoPromote - Whether a clone restoration switches the database over as soon as the recovery is ready. Default true: the restore finishes with the database serving the recovery point on the endpoint it already had, and the side it replaced kept briefly so the switch can be reversed. Pass false to hold the recovery until you call the promotion endpoint yourself. * @throws {AppwriteException} * @returns {Promise<Models.DedicatedDatabaseRestoration>} */ createRestoration(params: { databaseId: string; type?: string; - backupId?: string; - targetDatabaseId?: string; - targetTime?: string; + backupId?: string | null; + targetDatabaseId?: string | null; + targetTime?: string | null; + restoreMode?: string | null; + targetName?: string | null; + autoPromote?: boolean; }): Promise<Models.DedicatedDatabaseRestoration>; /** * Restore a database from a backup or to a specific point in time (PITR). For backup restoration, provide a backupId. For PITR, provide a targetTime as an ISO 8601 datetime. PITR requires the database to have PITR enabled and is only available for enterprise databases. * + * By default the backup is replayed over the database it was taken from. Pass `restoreMode` as `clone` to recover it onto a second workload beside this database instead: this database keeps serving its own data while the clone is filled, and the switch happens as soon as the clone is ready, on the endpoint and credentials it already had. Pass `autoPromote` as false to hold the clone until you promote it yourself. Pass `restoreMode` as `copy` to recover onto a separate database with its own endpoint, either one you name with `targetDatabaseId` or one provisioned as a copy of this database's engine, version, specification and replicas. Neither mode is available for a point-in-time recovery or an incremental backup. + * * @param {string} databaseId - Database ID. * @param {string} type - Restoration type. Allowed values: backup, pitr. Use "backup" to restore from a specific backup, or "pitr" for point-in-time recovery. - * @param {string} backupId - Backup ID to restore from (required for backup type). - * @param {string} targetDatabaseId - Existing database ID to restore into. The target must be distinct, ready, and use the same engine and version. - * @param {string} targetTime - Target time for PITR (required for pitr type) as an [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) datetime. + * @param {string | null} backupId - Backup ID to restore from (required for backup type). + * @param {string | null} targetDatabaseId - Existing database ID to restore into. The target must be distinct, ready, and use the same engine and version. Omit it on a copy restoration to have one provisioned. Not accepted for a clone, which is recovered inside this database. + * @param {string | null} targetTime - Target time for PITR (required for pitr type) as an [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) datetime. + * @param {string | null} restoreMode - Where the backup is restored. Allowed values: in_place, clone, copy. Use "clone" to recover onto a second workload beside this database and leave it serving until you promote — the endpoint and credentials do not change. Use "copy" to recover onto a separate database with its own endpoint, either one you name with targetDatabaseId or one Cloud provisions. Use "in_place" to replay the backup over this database. Defaults to "copy" when a targetDatabaseId is given, "in_place" otherwise. + * @param {string | null} targetName - Display name for the database a copy restoration provisions. Defaults to this database's name followed by "(restored)". Max length: 128 chars. + * @param {boolean} autoPromote - Whether a clone restoration switches the database over as soon as the recovery is ready. Default true: the restore finishes with the database serving the recovery point on the endpoint it already had, and the side it replaced kept briefly so the switch can be reversed. Pass false to hold the recovery until you call the promotion endpoint yourself. * @throws {AppwriteException} * @returns {Promise<Models.DedicatedDatabaseRestoration>} * @deprecated Use the object parameter style method for a better developer experience. @@ -3558,28 +3621,45 @@ export class Mongo { createRestoration( databaseId: string, type?: string, - backupId?: string, - targetDatabaseId?: string, - targetTime?: string, + backupId?: string | null, + targetDatabaseId?: string | null, + targetTime?: string | null, + restoreMode?: string | null, + targetName?: string | null, + autoPromote?: boolean, ): Promise<Models.DedicatedDatabaseRestoration>; createRestoration( paramsOrFirst: | { databaseId: string; type?: string; - backupId?: string; - targetDatabaseId?: string; - targetTime?: string; + backupId?: string | null; + targetDatabaseId?: string | null; + targetTime?: string | null; + restoreMode?: string | null; + targetName?: string | null; + autoPromote?: boolean; } | string, - ...rest: [string?, string?, string?, string?] + ...rest: [ + string?, + (string | null)?, + (string | null)?, + (string | null)?, + (string | null)?, + (string | null)?, + boolean?, + ] ): Promise<Models.DedicatedDatabaseRestoration> { let params: { databaseId: string; type?: string; - backupId?: string; - targetDatabaseId?: string; - targetTime?: string; + backupId?: string | null; + targetDatabaseId?: string | null; + targetTime?: string | null; + restoreMode?: string | null; + targetName?: string | null; + autoPromote?: boolean; }; if ( @@ -3590,17 +3670,23 @@ export class Mongo { params = (paramsOrFirst || {}) as { databaseId: string; type?: string; - backupId?: string; - targetDatabaseId?: string; - targetTime?: string; + backupId?: string | null; + targetDatabaseId?: string | null; + targetTime?: string | null; + restoreMode?: string | null; + targetName?: string | null; + autoPromote?: boolean; }; } else { params = { databaseId: paramsOrFirst as string, type: rest[0] as string, - backupId: rest[1] as string, - targetDatabaseId: rest[2] as string, - targetTime: rest[3] as string, + backupId: rest[1] as string | null, + targetDatabaseId: rest[2] as string | null, + targetTime: rest[3] as string | null, + restoreMode: rest[4] as string | null, + targetName: rest[5] as string | null, + autoPromote: rest[6] as boolean, }; } @@ -3609,6 +3695,9 @@ export class Mongo { const backupId = params.backupId; const targetDatabaseId = params.targetDatabaseId; const targetTime = params.targetTime; + const restoreMode = params.restoreMode; + const targetName = params.targetName; + const autoPromote = params.autoPromote; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -3632,6 +3721,15 @@ export class Mongo { if (typeof targetTime !== 'undefined') { apiPayload['targetTime'] = targetTime; } + if (typeof restoreMode !== 'undefined') { + apiPayload['restoreMode'] = restoreMode; + } + if (typeof targetName !== 'undefined') { + apiPayload['targetName'] = targetName; + } + if (typeof autoPromote !== 'undefined') { + apiPayload['autoPromote'] = autoPromote; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -3651,6 +3749,7 @@ export class Mongo { databaseId: '', projectId: '', type: 'backup', + restoreMode: 'in_place', status: 'pending', error: '', }, @@ -3746,6 +3845,111 @@ export class Mongo { databaseId: '', projectId: '', type: 'backup', + restoreMode: 'in_place', + status: 'pending', + error: '', + }, + }, + }, + }; + + return request.then((response) => applyDefaults(response, defaults)); + } + + /** + * Switch the database over to the clone a restoration recovered. The database keeps + * its endpoint and credentials; clients reconnect once. Writes made after the + * recovery point are discarded, and the side being replaced is retained briefly so + * the switch can be reversed. + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.restorationId - Restoration ID. + * @throws {AppwriteException} + * @returns {Promise<Models.DedicatedDatabaseRestoration>} + */ + promoteRestoration(params: { + databaseId: string; + restorationId: string; + }): Promise<Models.DedicatedDatabaseRestoration>; + /** + * Switch the database over to the clone a restoration recovered. The database keeps + * its endpoint and credentials; clients reconnect once. Writes made after the + * recovery point are discarded, and the side being replaced is retained briefly so + * the switch can be reversed. + * + * @param {string} databaseId - Database ID. + * @param {string} restorationId - Restoration ID. + * @throws {AppwriteException} + * @returns {Promise<Models.DedicatedDatabaseRestoration>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + promoteRestoration( + databaseId: string, + restorationId: string, + ): Promise<Models.DedicatedDatabaseRestoration>; + promoteRestoration( + paramsOrFirst: { databaseId: string; restorationId: string } | string, + ...rest: [string?] + ): Promise<Models.DedicatedDatabaseRestoration> { + let params: { databaseId: string; restorationId: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + databaseId: string; + restorationId: string; + }; + } else { + params = { + databaseId: paramsOrFirst as string, + restorationId: rest[0] as string, + }; + } + + const databaseId = params.databaseId; + const restorationId = params.restorationId; + + if (typeof databaseId === 'undefined' || databaseId === '') { + throw new AppwriteException( + 'Missing required parameter: "databaseId"', + ); + } + if (typeof restorationId === 'undefined' || restorationId === '') { + throw new AppwriteException( + 'Missing required parameter: "restorationId"', + ); + } + const apiPath = + '/mongo/{databaseId}/restorations/{restorationId}/promotions' + .replace('{databaseId}', encodeURIComponent(String(databaseId))) + .replace( + '{restorationId}', + encodeURIComponent(String(restorationId)), + ); + const apiPayload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }; + + const request = this.client.call('post', uri, apiHeaders, apiPayload); + const defaults = { + root: 'dedicatedDatabaseRestoration', + models: { + dedicatedDatabaseRestoration: { + defaults: { + $id: '', + $createdAt: '', + databaseId: '', + projectId: '', + type: 'backup', + restoreMode: 'in_place', status: 'pending', error: '', }, diff --git a/src/services/mysql.ts b/src/services/mysql.ts index d8fdad80..52510de9 100644 --- a/src/services/mysql.ts +++ b/src/services/mysql.ts @@ -17,46 +17,61 @@ export class Mysql { * List all dedicated databases. Results support pagination. * * @param {string[]} params.queries - Array of query strings. + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise<Models.DedicatedDatabaseList>} */ list(params?: { queries?: string[]; + total?: boolean; }): Promise<Models.DedicatedDatabaseList>; /** * List all dedicated databases. Results support pagination. * * @param {string[]} queries - Array of query strings. + * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise<Models.DedicatedDatabaseList>} * @deprecated Use the object parameter style method for a better developer experience. */ - list(queries?: string[]): Promise<Models.DedicatedDatabaseList>; list( - paramsOrFirst?: { queries?: string[] } | string[], + queries?: string[], + total?: boolean, + ): Promise<Models.DedicatedDatabaseList>; + list( + paramsOrFirst?: { queries?: string[]; total?: boolean } | string[], + ...rest: [boolean?] ): Promise<Models.DedicatedDatabaseList> { - let params: { queries?: string[] }; + let params: { queries?: string[]; total?: boolean }; if ( - typeof paramsOrFirst === 'undefined' || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) ) { - params = (paramsOrFirst || {}) as { queries?: string[] }; + params = (paramsOrFirst || {}) as { + queries?: string[]; + total?: boolean; + }; } else { params = { queries: paramsOrFirst as string[], + total: rest[0] as boolean, }; } const queries = params.queries; + const total = params.total; const apiPath = '/mysql'; const apiPayload: Payload = {}; if (typeof queries !== 'undefined') { apiPayload['queries'] = queries; } + if (typeof total !== 'undefined') { + apiPayload['total'] = total; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -139,54 +154,54 @@ export class Mysql { * * @param {string} params.databaseId - Database 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 - Database display name. Max length: 128 chars. - * @param {string} params.version - Database engine version. Defaults to latest for selected engine. + * @param {string | null} params.version - Database engine version. Defaults to latest for selected engine. * @param {string} params.specification - Specification identifier. Drives the allocated CPU, memory, storage, storage class, and connection ceiling. * @param {number} params.replicas - Number of high availability replicas (0-5). High availability is enabled when greater than 0. - * @param {string} params.syncMode - Replication sync mode preference. Allowed values: async, sync, quorum. + * @param {string | null} params.syncMode - Replication sync mode preference. Allowed values: async, sync, quorum. * @param {number} params.networkIdleTimeoutSeconds - Connection idle timeout in seconds. - * @param {string[]} params.networkIPAllowlist - IP addresses/CIDR ranges allowed to connect. + * @param {string[] | null} params.networkIPAllowlist - IP addresses/CIDR ranges allowed to connect. * @param {number} params.idleTimeoutMinutes - Minutes of inactivity before container scales to zero. * @param {boolean} params.pitr - Enable point-in-time recovery (PITR). Continuously archives changes so the database can be restored to any moment within the retention window. * @param {number} params.pitrRetentionDays - Number of days to retain PITR data. * @param {boolean} params.storageAutoscaling - Enable automatic storage expansion when usage exceeds threshold. * @param {number} params.storageAutoscalingThresholdPercent - Storage usage percentage (50-95) that triggers automatic expansion. - * @param {number} params.storageAutoscalingMaxGb - Maximum storage size in GB for autoscaling. Defaults to 3 times the specification's storage. 0 means no limit. + * @param {number | null} params.storageAutoscalingMaxGb - Maximum storage size in GB for autoscaling. Defaults to 3 times the specification's storage. 0 means no limit. * @throws {AppwriteException} * @returns {Promise<Models.DedicatedDatabase>} */ create(params: { databaseId: string; name: string; - version?: string; + version?: string | null; specification?: string; replicas?: number; - syncMode?: string; + syncMode?: string | null; networkIdleTimeoutSeconds?: number; - networkIPAllowlist?: string[]; + networkIPAllowlist?: string[] | null; idleTimeoutMinutes?: number; pitr?: boolean; pitrRetentionDays?: number; storageAutoscaling?: boolean; storageAutoscalingThresholdPercent?: number; - storageAutoscalingMaxGb?: number; + storageAutoscalingMaxGb?: number | null; }): Promise<Models.DedicatedDatabase>; /** * Create a new dedicated database with the chosen engine and configuration. Status will be 'provisioning' until the database is ready. * * @param {string} databaseId - Database 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 - Database display name. Max length: 128 chars. - * @param {string} version - Database engine version. Defaults to latest for selected engine. + * @param {string | null} version - Database engine version. Defaults to latest for selected engine. * @param {string} specification - Specification identifier. Drives the allocated CPU, memory, storage, storage class, and connection ceiling. * @param {number} replicas - Number of high availability replicas (0-5). High availability is enabled when greater than 0. - * @param {string} syncMode - Replication sync mode preference. Allowed values: async, sync, quorum. + * @param {string | null} syncMode - Replication sync mode preference. Allowed values: async, sync, quorum. * @param {number} networkIdleTimeoutSeconds - Connection idle timeout in seconds. - * @param {string[]} networkIPAllowlist - IP addresses/CIDR ranges allowed to connect. + * @param {string[] | null} networkIPAllowlist - IP addresses/CIDR ranges allowed to connect. * @param {number} idleTimeoutMinutes - Minutes of inactivity before container scales to zero. * @param {boolean} pitr - Enable point-in-time recovery (PITR). Continuously archives changes so the database can be restored to any moment within the retention window. * @param {number} pitrRetentionDays - Number of days to retain PITR data. * @param {boolean} storageAutoscaling - Enable automatic storage expansion when usage exceeds threshold. * @param {number} storageAutoscalingThresholdPercent - Storage usage percentage (50-95) that triggers automatic expansion. - * @param {number} storageAutoscalingMaxGb - Maximum storage size in GB for autoscaling. Defaults to 3 times the specification's storage. 0 means no limit. + * @param {number | null} storageAutoscalingMaxGb - Maximum storage size in GB for autoscaling. Defaults to 3 times the specification's storage. 0 means no limit. * @throws {AppwriteException} * @returns {Promise<Models.DedicatedDatabase>} * @deprecated Use the object parameter style method for a better developer experience. @@ -194,69 +209,69 @@ export class Mysql { create( databaseId: string, name: string, - version?: string, + version?: string | null, specification?: string, replicas?: number, - syncMode?: string, + syncMode?: string | null, networkIdleTimeoutSeconds?: number, - networkIPAllowlist?: string[], + networkIPAllowlist?: string[] | null, idleTimeoutMinutes?: number, pitr?: boolean, pitrRetentionDays?: number, storageAutoscaling?: boolean, storageAutoscalingThresholdPercent?: number, - storageAutoscalingMaxGb?: number, + storageAutoscalingMaxGb?: number | null, ): Promise<Models.DedicatedDatabase>; create( paramsOrFirst: | { databaseId: string; name: string; - version?: string; + version?: string | null; specification?: string; replicas?: number; - syncMode?: string; + syncMode?: string | null; networkIdleTimeoutSeconds?: number; - networkIPAllowlist?: string[]; + networkIPAllowlist?: string[] | null; idleTimeoutMinutes?: number; pitr?: boolean; pitrRetentionDays?: number; storageAutoscaling?: boolean; storageAutoscalingThresholdPercent?: number; - storageAutoscalingMaxGb?: number; + storageAutoscalingMaxGb?: number | null; } | string, ...rest: [ string?, - string?, + (string | null)?, string?, number?, - string?, + (string | null)?, number?, - string[]?, + (string[] | null)?, number?, boolean?, number?, boolean?, number?, - number?, + (number | null)?, ] ): Promise<Models.DedicatedDatabase> { let params: { databaseId: string; name: string; - version?: string; + version?: string | null; specification?: string; replicas?: number; - syncMode?: string; + syncMode?: string | null; networkIdleTimeoutSeconds?: number; - networkIPAllowlist?: string[]; + networkIPAllowlist?: string[] | null; idleTimeoutMinutes?: number; pitr?: boolean; pitrRetentionDays?: number; storageAutoscaling?: boolean; storageAutoscalingThresholdPercent?: number; - storageAutoscalingMaxGb?: number; + storageAutoscalingMaxGb?: number | null; }; if ( @@ -267,35 +282,35 @@ export class Mysql { params = (paramsOrFirst || {}) as { databaseId: string; name: string; - version?: string; + version?: string | null; specification?: string; replicas?: number; - syncMode?: string; + syncMode?: string | null; networkIdleTimeoutSeconds?: number; - networkIPAllowlist?: string[]; + networkIPAllowlist?: string[] | null; idleTimeoutMinutes?: number; pitr?: boolean; pitrRetentionDays?: number; storageAutoscaling?: boolean; storageAutoscalingThresholdPercent?: number; - storageAutoscalingMaxGb?: number; + storageAutoscalingMaxGb?: number | null; }; } else { params = { databaseId: paramsOrFirst as string, name: rest[0] as string, - version: rest[1] as string, + version: rest[1] as string | null, specification: rest[2] as string, replicas: rest[3] as number, - syncMode: rest[4] as string, + syncMode: rest[4] as string | null, networkIdleTimeoutSeconds: rest[5] as number, - networkIPAllowlist: rest[6] as string[], + networkIPAllowlist: rest[6] as string[] | null, idleTimeoutMinutes: rest[7] as number, pitr: rest[8] as boolean, pitrRetentionDays: rest[9] as number, storageAutoscaling: rest[10] as boolean, storageAutoscalingThresholdPercent: rest[11] as number, - storageAutoscalingMaxGb: rest[12] as number, + storageAutoscalingMaxGb: rest[12] as number | null, }; } @@ -605,174 +620,174 @@ export class Mysql { * Update a dedicated database configuration. All changes are applied with zero downtime. Specification changes (cpu, memory, storage) are handled via rolling cutover. Storage expansion is done online. All other settings are applied in-place. * * @param {string} params.databaseId - Database ID. - * @param {string} params.name - Database display name. - * @param {string} params.status - Database status. Allowed values: ready, paused, inactive. Set to "paused" to pause, "ready" to resume (also recovers a failed database whose infrastructure is healthy), or "inactive" to spin down a shared-pool database. - * @param {string} params.specification - Specification. Changes cpu, memory, storage, connection ceiling, and node pool based on specification config. Resource changes are applied via rolling cutover with zero downtime. - * @param {number} params.replicas - Number of high availability replicas (0-5). High availability is enabled when greater than 0. - * @param {string} params.syncMode - Replication sync mode preference. Allowed values: async, sync, quorum. - * @param {number} params.networkIdleTimeoutSeconds - Connection idle timeout in seconds (60-86400). - * @param {string[]} params.networkIPAllowlist - IP addresses/CIDR ranges allowed to connect. - * @param {number} params.idleTimeoutMinutes - Minutes before container scales to zero. - * @param {boolean} params.pitr - Enable or disable point-in-time recovery (PITR). - * @param {number} params.pitrRetentionDays - Days to retain PITR data. - * @param {boolean} params.storageAutoscaling - Enable automatic storage expansion when usage exceeds threshold. - * @param {number} params.storageAutoscalingThresholdPercent - Storage usage percentage (50-95) that triggers automatic expansion. - * @param {number} params.storageAutoscalingMaxGb - Maximum storage size in GB for autoscaling. 0 means no limit. - * @param {number} params.metricsTraceSampleRate - Fraction of queries to trace (0.0–1.0). Forwarded to the sidecar. - * @param {number} params.metricsSlowQueryLogThresholdMs - Threshold in ms above which queries are logged as slow. Forwarded to the sidecar. - * @param {boolean} params.sqlApiEnabled - Enable the SQL API sidecar for this database. - * @param {string[]} params.sqlApiAllowedStatements - Statement types the SQL API accepts. Allowed values: SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, TRUNCATE, GRANT, REVOKE. - * @param {number} params.sqlApiMaxRows - Maximum rows returned per SQL API execution (1-1000000). - * @param {number} params.sqlApiMaxBytes - Maximum serialised SQL API result payload in bytes (1024-104857600). - * @param {number} params.sqlApiTimeoutSeconds - Per-call SQL API execution timeout in seconds (1-300). + * @param {string | null} params.name - Database display name. + * @param {string | null} params.status - Database status. Allowed values: ready, paused, inactive. Set to "paused" to pause, "ready" to resume (also recovers a failed database whose infrastructure is healthy), or "inactive" to spin down a shared-pool database. + * @param {string | null} params.specification - Specification. Changes cpu, memory, storage, connection ceiling, and node pool based on specification config. Resource changes are applied via rolling cutover with zero downtime. + * @param {number | null} params.replicas - Number of high availability replicas (0-5). High availability is enabled when greater than 0. + * @param {string | null} params.syncMode - Replication sync mode preference. Allowed values: async, sync, quorum. + * @param {number | null} params.networkIdleTimeoutSeconds - Connection idle timeout in seconds (60-86400). + * @param {string[] | null} params.networkIPAllowlist - IP addresses/CIDR ranges allowed to connect. + * @param {number | null} params.idleTimeoutMinutes - Minutes before container scales to zero. + * @param {boolean | null} params.pitr - Enable or disable point-in-time recovery (PITR). + * @param {number | null} params.pitrRetentionDays - Days to retain PITR data. + * @param {boolean | null} params.storageAutoscaling - Enable automatic storage expansion when usage exceeds threshold. + * @param {number | null} params.storageAutoscalingThresholdPercent - Storage usage percentage (50-95) that triggers automatic expansion. + * @param {number | null} params.storageAutoscalingMaxGb - Maximum storage size in GB for autoscaling. 0 means no limit. + * @param {number | null} params.metricsTraceSampleRate - Fraction of queries to trace (0.0–1.0). Forwarded to the sidecar. + * @param {number | null} params.metricsSlowQueryLogThresholdMs - Threshold in ms above which queries are logged as slow. Forwarded to the sidecar. + * @param {boolean | null} params.sqlApiEnabled - Enable the SQL API sidecar for this database. + * @param {string[] | null} params.sqlApiAllowedStatements - Statement types the SQL API accepts. Allowed values: SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, TRUNCATE, GRANT, REVOKE. + * @param {number | null} params.sqlApiMaxRows - Maximum rows returned per SQL API execution (1-1000000). + * @param {number | null} params.sqlApiMaxBytes - Maximum serialised SQL API result payload in bytes (1024-104857600). + * @param {number | null} params.sqlApiTimeoutSeconds - Per-call SQL API execution timeout in seconds (1-300). * @throws {AppwriteException} * @returns {Promise<Models.DedicatedDatabase>} */ update(params: { databaseId: string; - name?: string; - status?: string; - specification?: string; - replicas?: number; - syncMode?: string; - networkIdleTimeoutSeconds?: number; - networkIPAllowlist?: string[]; - idleTimeoutMinutes?: number; - pitr?: boolean; - pitrRetentionDays?: number; - storageAutoscaling?: boolean; - storageAutoscalingThresholdPercent?: number; - storageAutoscalingMaxGb?: number; - metricsTraceSampleRate?: number; - metricsSlowQueryLogThresholdMs?: number; - sqlApiEnabled?: boolean; - sqlApiAllowedStatements?: string[]; - sqlApiMaxRows?: number; - sqlApiMaxBytes?: number; - sqlApiTimeoutSeconds?: number; + name?: string | null; + status?: string | null; + specification?: string | null; + replicas?: number | null; + syncMode?: string | null; + networkIdleTimeoutSeconds?: number | null; + networkIPAllowlist?: string[] | null; + idleTimeoutMinutes?: number | null; + pitr?: boolean | null; + pitrRetentionDays?: number | null; + storageAutoscaling?: boolean | null; + storageAutoscalingThresholdPercent?: number | null; + storageAutoscalingMaxGb?: number | null; + metricsTraceSampleRate?: number | null; + metricsSlowQueryLogThresholdMs?: number | null; + sqlApiEnabled?: boolean | null; + sqlApiAllowedStatements?: string[] | null; + sqlApiMaxRows?: number | null; + sqlApiMaxBytes?: number | null; + sqlApiTimeoutSeconds?: number | null; }): Promise<Models.DedicatedDatabase>; /** * Update a dedicated database configuration. All changes are applied with zero downtime. Specification changes (cpu, memory, storage) are handled via rolling cutover. Storage expansion is done online. All other settings are applied in-place. * * @param {string} databaseId - Database ID. - * @param {string} name - Database display name. - * @param {string} status - Database status. Allowed values: ready, paused, inactive. Set to "paused" to pause, "ready" to resume (also recovers a failed database whose infrastructure is healthy), or "inactive" to spin down a shared-pool database. - * @param {string} specification - Specification. Changes cpu, memory, storage, connection ceiling, and node pool based on specification config. Resource changes are applied via rolling cutover with zero downtime. - * @param {number} replicas - Number of high availability replicas (0-5). High availability is enabled when greater than 0. - * @param {string} syncMode - Replication sync mode preference. Allowed values: async, sync, quorum. - * @param {number} networkIdleTimeoutSeconds - Connection idle timeout in seconds (60-86400). - * @param {string[]} networkIPAllowlist - IP addresses/CIDR ranges allowed to connect. - * @param {number} idleTimeoutMinutes - Minutes before container scales to zero. - * @param {boolean} pitr - Enable or disable point-in-time recovery (PITR). - * @param {number} pitrRetentionDays - Days to retain PITR data. - * @param {boolean} storageAutoscaling - Enable automatic storage expansion when usage exceeds threshold. - * @param {number} storageAutoscalingThresholdPercent - Storage usage percentage (50-95) that triggers automatic expansion. - * @param {number} storageAutoscalingMaxGb - Maximum storage size in GB for autoscaling. 0 means no limit. - * @param {number} metricsTraceSampleRate - Fraction of queries to trace (0.0–1.0). Forwarded to the sidecar. - * @param {number} metricsSlowQueryLogThresholdMs - Threshold in ms above which queries are logged as slow. Forwarded to the sidecar. - * @param {boolean} sqlApiEnabled - Enable the SQL API sidecar for this database. - * @param {string[]} sqlApiAllowedStatements - Statement types the SQL API accepts. Allowed values: SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, TRUNCATE, GRANT, REVOKE. - * @param {number} sqlApiMaxRows - Maximum rows returned per SQL API execution (1-1000000). - * @param {number} sqlApiMaxBytes - Maximum serialised SQL API result payload in bytes (1024-104857600). - * @param {number} sqlApiTimeoutSeconds - Per-call SQL API execution timeout in seconds (1-300). + * @param {string | null} name - Database display name. + * @param {string | null} status - Database status. Allowed values: ready, paused, inactive. Set to "paused" to pause, "ready" to resume (also recovers a failed database whose infrastructure is healthy), or "inactive" to spin down a shared-pool database. + * @param {string | null} specification - Specification. Changes cpu, memory, storage, connection ceiling, and node pool based on specification config. Resource changes are applied via rolling cutover with zero downtime. + * @param {number | null} replicas - Number of high availability replicas (0-5). High availability is enabled when greater than 0. + * @param {string | null} syncMode - Replication sync mode preference. Allowed values: async, sync, quorum. + * @param {number | null} networkIdleTimeoutSeconds - Connection idle timeout in seconds (60-86400). + * @param {string[] | null} networkIPAllowlist - IP addresses/CIDR ranges allowed to connect. + * @param {number | null} idleTimeoutMinutes - Minutes before container scales to zero. + * @param {boolean | null} pitr - Enable or disable point-in-time recovery (PITR). + * @param {number | null} pitrRetentionDays - Days to retain PITR data. + * @param {boolean | null} storageAutoscaling - Enable automatic storage expansion when usage exceeds threshold. + * @param {number | null} storageAutoscalingThresholdPercent - Storage usage percentage (50-95) that triggers automatic expansion. + * @param {number | null} storageAutoscalingMaxGb - Maximum storage size in GB for autoscaling. 0 means no limit. + * @param {number | null} metricsTraceSampleRate - Fraction of queries to trace (0.0–1.0). Forwarded to the sidecar. + * @param {number | null} metricsSlowQueryLogThresholdMs - Threshold in ms above which queries are logged as slow. Forwarded to the sidecar. + * @param {boolean | null} sqlApiEnabled - Enable the SQL API sidecar for this database. + * @param {string[] | null} sqlApiAllowedStatements - Statement types the SQL API accepts. Allowed values: SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, TRUNCATE, GRANT, REVOKE. + * @param {number | null} sqlApiMaxRows - Maximum rows returned per SQL API execution (1-1000000). + * @param {number | null} sqlApiMaxBytes - Maximum serialised SQL API result payload in bytes (1024-104857600). + * @param {number | null} sqlApiTimeoutSeconds - Per-call SQL API execution timeout in seconds (1-300). * @throws {AppwriteException} * @returns {Promise<Models.DedicatedDatabase>} * @deprecated Use the object parameter style method for a better developer experience. */ update( databaseId: string, - name?: string, - status?: string, - specification?: string, - replicas?: number, - syncMode?: string, - networkIdleTimeoutSeconds?: number, - networkIPAllowlist?: string[], - idleTimeoutMinutes?: number, - pitr?: boolean, - pitrRetentionDays?: number, - storageAutoscaling?: boolean, - storageAutoscalingThresholdPercent?: number, - storageAutoscalingMaxGb?: number, - metricsTraceSampleRate?: number, - metricsSlowQueryLogThresholdMs?: number, - sqlApiEnabled?: boolean, - sqlApiAllowedStatements?: string[], - sqlApiMaxRows?: number, - sqlApiMaxBytes?: number, - sqlApiTimeoutSeconds?: number, + name?: string | null, + status?: string | null, + specification?: string | null, + replicas?: number | null, + syncMode?: string | null, + networkIdleTimeoutSeconds?: number | null, + networkIPAllowlist?: string[] | null, + idleTimeoutMinutes?: number | null, + pitr?: boolean | null, + pitrRetentionDays?: number | null, + storageAutoscaling?: boolean | null, + storageAutoscalingThresholdPercent?: number | null, + storageAutoscalingMaxGb?: number | null, + metricsTraceSampleRate?: number | null, + metricsSlowQueryLogThresholdMs?: number | null, + sqlApiEnabled?: boolean | null, + sqlApiAllowedStatements?: string[] | null, + sqlApiMaxRows?: number | null, + sqlApiMaxBytes?: number | null, + sqlApiTimeoutSeconds?: number | null, ): Promise<Models.DedicatedDatabase>; update( paramsOrFirst: | { databaseId: string; - name?: string; - status?: string; - specification?: string; - replicas?: number; - syncMode?: string; - networkIdleTimeoutSeconds?: number; - networkIPAllowlist?: string[]; - idleTimeoutMinutes?: number; - pitr?: boolean; - pitrRetentionDays?: number; - storageAutoscaling?: boolean; - storageAutoscalingThresholdPercent?: number; - storageAutoscalingMaxGb?: number; - metricsTraceSampleRate?: number; - metricsSlowQueryLogThresholdMs?: number; - sqlApiEnabled?: boolean; - sqlApiAllowedStatements?: string[]; - sqlApiMaxRows?: number; - sqlApiMaxBytes?: number; - sqlApiTimeoutSeconds?: number; + name?: string | null; + status?: string | null; + specification?: string | null; + replicas?: number | null; + syncMode?: string | null; + networkIdleTimeoutSeconds?: number | null; + networkIPAllowlist?: string[] | null; + idleTimeoutMinutes?: number | null; + pitr?: boolean | null; + pitrRetentionDays?: number | null; + storageAutoscaling?: boolean | null; + storageAutoscalingThresholdPercent?: number | null; + storageAutoscalingMaxGb?: number | null; + metricsTraceSampleRate?: number | null; + metricsSlowQueryLogThresholdMs?: number | null; + sqlApiEnabled?: boolean | null; + sqlApiAllowedStatements?: string[] | null; + sqlApiMaxRows?: number | null; + sqlApiMaxBytes?: number | null; + sqlApiTimeoutSeconds?: number | null; } | string, ...rest: [ - string?, - string?, - string?, - number?, - string?, - number?, - string[]?, - number?, - boolean?, - number?, - boolean?, - number?, - number?, - number?, - number?, - boolean?, - string[]?, - number?, - number?, - number?, + (string | null)?, + (string | null)?, + (string | null)?, + (number | null)?, + (string | null)?, + (number | null)?, + (string[] | null)?, + (number | null)?, + (boolean | null)?, + (number | null)?, + (boolean | null)?, + (number | null)?, + (number | null)?, + (number | null)?, + (number | null)?, + (boolean | null)?, + (string[] | null)?, + (number | null)?, + (number | null)?, + (number | null)?, ] ): Promise<Models.DedicatedDatabase> { let params: { databaseId: string; - name?: string; - status?: string; - specification?: string; - replicas?: number; - syncMode?: string; - networkIdleTimeoutSeconds?: number; - networkIPAllowlist?: string[]; - idleTimeoutMinutes?: number; - pitr?: boolean; - pitrRetentionDays?: number; - storageAutoscaling?: boolean; - storageAutoscalingThresholdPercent?: number; - storageAutoscalingMaxGb?: number; - metricsTraceSampleRate?: number; - metricsSlowQueryLogThresholdMs?: number; - sqlApiEnabled?: boolean; - sqlApiAllowedStatements?: string[]; - sqlApiMaxRows?: number; - sqlApiMaxBytes?: number; - sqlApiTimeoutSeconds?: number; + name?: string | null; + status?: string | null; + specification?: string | null; + replicas?: number | null; + syncMode?: string | null; + networkIdleTimeoutSeconds?: number | null; + networkIPAllowlist?: string[] | null; + idleTimeoutMinutes?: number | null; + pitr?: boolean | null; + pitrRetentionDays?: number | null; + storageAutoscaling?: boolean | null; + storageAutoscalingThresholdPercent?: number | null; + storageAutoscalingMaxGb?: number | null; + metricsTraceSampleRate?: number | null; + metricsSlowQueryLogThresholdMs?: number | null; + sqlApiEnabled?: boolean | null; + sqlApiAllowedStatements?: string[] | null; + sqlApiMaxRows?: number | null; + sqlApiMaxBytes?: number | null; + sqlApiTimeoutSeconds?: number | null; }; if ( @@ -782,50 +797,50 @@ export class Mysql { ) { params = (paramsOrFirst || {}) as { databaseId: string; - name?: string; - status?: string; - specification?: string; - replicas?: number; - syncMode?: string; - networkIdleTimeoutSeconds?: number; - networkIPAllowlist?: string[]; - idleTimeoutMinutes?: number; - pitr?: boolean; - pitrRetentionDays?: number; - storageAutoscaling?: boolean; - storageAutoscalingThresholdPercent?: number; - storageAutoscalingMaxGb?: number; - metricsTraceSampleRate?: number; - metricsSlowQueryLogThresholdMs?: number; - sqlApiEnabled?: boolean; - sqlApiAllowedStatements?: string[]; - sqlApiMaxRows?: number; - sqlApiMaxBytes?: number; - sqlApiTimeoutSeconds?: number; + name?: string | null; + status?: string | null; + specification?: string | null; + replicas?: number | null; + syncMode?: string | null; + networkIdleTimeoutSeconds?: number | null; + networkIPAllowlist?: string[] | null; + idleTimeoutMinutes?: number | null; + pitr?: boolean | null; + pitrRetentionDays?: number | null; + storageAutoscaling?: boolean | null; + storageAutoscalingThresholdPercent?: number | null; + storageAutoscalingMaxGb?: number | null; + metricsTraceSampleRate?: number | null; + metricsSlowQueryLogThresholdMs?: number | null; + sqlApiEnabled?: boolean | null; + sqlApiAllowedStatements?: string[] | null; + sqlApiMaxRows?: number | null; + sqlApiMaxBytes?: number | null; + sqlApiTimeoutSeconds?: number | null; }; } else { params = { databaseId: paramsOrFirst as string, - name: rest[0] as string, - status: rest[1] as string, - specification: rest[2] as string, - replicas: rest[3] as number, - syncMode: rest[4] as string, - networkIdleTimeoutSeconds: rest[5] as number, - networkIPAllowlist: rest[6] as string[], - idleTimeoutMinutes: rest[7] as number, - pitr: rest[8] as boolean, - pitrRetentionDays: rest[9] as number, - storageAutoscaling: rest[10] as boolean, - storageAutoscalingThresholdPercent: rest[11] as number, - storageAutoscalingMaxGb: rest[12] as number, - metricsTraceSampleRate: rest[13] as number, - metricsSlowQueryLogThresholdMs: rest[14] as number, - sqlApiEnabled: rest[15] as boolean, - sqlApiAllowedStatements: rest[16] as string[], - sqlApiMaxRows: rest[17] as number, - sqlApiMaxBytes: rest[18] as number, - sqlApiTimeoutSeconds: rest[19] as number, + name: rest[0] as string | null, + status: rest[1] as string | null, + specification: rest[2] as string | null, + replicas: rest[3] as number | null, + syncMode: rest[4] as string | null, + networkIdleTimeoutSeconds: rest[5] as number | null, + networkIPAllowlist: rest[6] as string[] | null, + idleTimeoutMinutes: rest[7] as number | null, + pitr: rest[8] as boolean | null, + pitrRetentionDays: rest[9] as number | null, + storageAutoscaling: rest[10] as boolean | null, + storageAutoscalingThresholdPercent: rest[11] as number | null, + storageAutoscalingMaxGb: rest[12] as number | null, + metricsTraceSampleRate: rest[13] as number | null, + metricsSlowQueryLogThresholdMs: rest[14] as number | null, + sqlApiEnabled: rest[15] as boolean | null, + sqlApiAllowedStatements: rest[16] as string[] | null, + sqlApiMaxRows: rest[17] as number | null, + sqlApiMaxBytes: rest[18] as number | null, + sqlApiTimeoutSeconds: rest[19] as number | null, }; } @@ -1052,18 +1067,21 @@ export class Mysql { * * @param {string} params.databaseId - Database ID. * @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. You may filter on the following attributes: status, type, databaseId + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise<Models.DedicatedDatabaseBackupList>} */ listBackups(params: { databaseId: string; queries?: string[]; + total?: boolean; }): Promise<Models.DedicatedDatabaseBackupList>; /** * List all backups for a dedicated database. Results can be filtered by status and type. * * @param {string} databaseId - Database ID. * @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. You may filter on the following attributes: status, type, databaseId + * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise<Models.DedicatedDatabaseBackupList>} * @deprecated Use the object parameter style method for a better developer experience. @@ -1071,12 +1089,15 @@ export class Mysql { listBackups( databaseId: string, queries?: string[], + total?: boolean, ): Promise<Models.DedicatedDatabaseBackupList>; listBackups( - paramsOrFirst: { databaseId: string; queries?: string[] } | string, - ...rest: [string[]?] + paramsOrFirst: + | { databaseId: string; queries?: string[]; total?: boolean } + | string, + ...rest: [string[]?, boolean?] ): Promise<Models.DedicatedDatabaseBackupList> { - let params: { databaseId: string; queries?: string[] }; + let params: { databaseId: string; queries?: string[]; total?: boolean }; if ( paramsOrFirst && @@ -1086,16 +1107,19 @@ export class Mysql { params = (paramsOrFirst || {}) as { databaseId: string; queries?: string[]; + total?: boolean; }; } else { params = { databaseId: paramsOrFirst as string, queries: rest[0] as string[], + total: rest[1] as boolean, }; } const databaseId = params.databaseId; const queries = params.queries; + const total = params.total; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -1110,6 +1134,9 @@ export class Mysql { if (typeof queries !== 'undefined') { apiPayload['queries'] = queries; } + if (typeof total !== 'undefined') { + apiPayload['total'] = total; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -1256,18 +1283,21 @@ export class Mysql { * * @param {string} params.databaseId - Database ID. * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise<Models.BackupPolicyList>} */ listBackupPolicies(params: { databaseId: string; queries?: string[]; + total?: boolean; }): Promise<Models.BackupPolicyList>; /** * List scheduled backup policies for a dedicated database. * * @param {string} databaseId - Database ID. * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. + * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise<Models.BackupPolicyList>} * @deprecated Use the object parameter style method for a better developer experience. @@ -1275,12 +1305,15 @@ export class Mysql { listBackupPolicies( databaseId: string, queries?: string[], + total?: boolean, ): Promise<Models.BackupPolicyList>; listBackupPolicies( - paramsOrFirst: { databaseId: string; queries?: string[] } | string, - ...rest: [string[]?] + paramsOrFirst: + | { databaseId: string; queries?: string[]; total?: boolean } + | string, + ...rest: [string[]?, boolean?] ): Promise<Models.BackupPolicyList> { - let params: { databaseId: string; queries?: string[] }; + let params: { databaseId: string; queries?: string[]; total?: boolean }; if ( paramsOrFirst && @@ -1290,16 +1323,19 @@ export class Mysql { params = (paramsOrFirst || {}) as { databaseId: string; queries?: string[]; + total?: boolean; }; } else { params = { databaseId: paramsOrFirst as string, queries: rest[0] as string[], + total: rest[1] as boolean, }; } const databaseId = params.databaseId; const queries = params.queries; + const total = params.total; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -1314,6 +1350,9 @@ export class Mysql { if (typeof queries !== 'undefined') { apiPayload['queries'] = queries; } + if (typeof total !== 'undefined') { + apiPayload['total'] = total; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -1637,30 +1676,30 @@ export class Mysql { * * @param {string} params.databaseId - Database ID. * @param {string} params.policyId - Policy ID. - * @param {string} params.name - Policy name. Max length: 128 chars. + * @param {string | null} params.name - Policy name. Max length: 128 chars. * @param {string} params.schedule - Schedule CRON syntax. - * @param {number} params.retention - Days to keep backups before deletion. - * @param {boolean} params.enabled - Is policy enabled? When disabled, no backups will be taken. + * @param {number | null} params.retention - Days to keep backups before deletion. + * @param {boolean | null} params.enabled - Is policy enabled? When disabled, no backups will be taken. * @throws {AppwriteException} * @returns {Promise<Models.BackupPolicy>} */ updateBackupPolicy(params: { databaseId: string; policyId: string; - name?: string; + name?: string | null; schedule?: string; - retention?: number; - enabled?: boolean; + retention?: number | null; + enabled?: boolean | null; }): Promise<Models.BackupPolicy>; /** * Update a scheduled backup policy for a dedicated database. * * @param {string} databaseId - Database ID. * @param {string} policyId - Policy ID. - * @param {string} name - Policy name. Max length: 128 chars. + * @param {string | null} name - Policy name. Max length: 128 chars. * @param {string} schedule - Schedule CRON syntax. - * @param {number} retention - Days to keep backups before deletion. - * @param {boolean} enabled - Is policy enabled? When disabled, no backups will be taken. + * @param {number | null} retention - Days to keep backups before deletion. + * @param {boolean | null} enabled - Is policy enabled? When disabled, no backups will be taken. * @throws {AppwriteException} * @returns {Promise<Models.BackupPolicy>} * @deprecated Use the object parameter style method for a better developer experience. @@ -1668,31 +1707,37 @@ export class Mysql { updateBackupPolicy( databaseId: string, policyId: string, - name?: string, + name?: string | null, schedule?: string, - retention?: number, - enabled?: boolean, + retention?: number | null, + enabled?: boolean | null, ): Promise<Models.BackupPolicy>; updateBackupPolicy( paramsOrFirst: | { databaseId: string; policyId: string; - name?: string; + name?: string | null; schedule?: string; - retention?: number; - enabled?: boolean; + retention?: number | null; + enabled?: boolean | null; } | string, - ...rest: [string?, string?, string?, number?, boolean?] + ...rest: [ + string?, + (string | null)?, + string?, + (number | null)?, + (boolean | null)?, + ] ): Promise<Models.BackupPolicy> { let params: { databaseId: string; policyId: string; - name?: string; + name?: string | null; schedule?: string; - retention?: number; - enabled?: boolean; + retention?: number | null; + enabled?: boolean | null; }; if ( @@ -1703,19 +1748,19 @@ export class Mysql { params = (paramsOrFirst || {}) as { databaseId: string; policyId: string; - name?: string; + name?: string | null; schedule?: string; - retention?: number; - enabled?: boolean; + retention?: number | null; + enabled?: boolean | null; }; } else { params = { databaseId: paramsOrFirst as string, policyId: rest[0] as string, - name: rest[1] as string, + name: rest[1] as string | null, schedule: rest[2] as string, - retention: rest[3] as number, - enabled: rest[4] as boolean, + retention: rest[3] as number | null, + enabled: rest[4] as boolean | null, }; } @@ -2656,28 +2701,28 @@ export class Mysql { } /** - * Execute SQL through the console-facing Cloud endpoint. Cloud proxies through the edge platform to the per-database SQL API sidecar. Application traffic should bypass cloud entirely and POST directly to the per-database hostname: `https://db-{project}-{db}.{region}.appwrite.center/v1/sql/executions` with an `X-Appwrite-Key` header — that path scales to the whole DB fleet without a per-query cloud round-trip. The statement type must be on the database's configured allow-list. Use bound parameters for any user-supplied values — the API does not interpolate raw strings. + * Execute SQL through the console-facing Cloud endpoint. Cloud proxies through the edge platform to the per-database SQL API sidecar. Application traffic should bypass cloud entirely and POST directly to the per-database hostname: `https://db-{project}-{db}.{region}.appwrite.center/v1/sql/executions` with an `X-Appwrite-Key` header — that path scales to the whole DB fleet without a per-query cloud round-trip. The statement type must be on the database's configured allow-list. Use bound parameters for any user-supplied values — the API does not interpolate raw strings. Long-running statements (for example CREATE INDEX) can outlive the HTTP request: if the request ends before a result is returned, check the database before retrying, and prefer a direct connection for work that may take minutes. * * @param {string} params.databaseId - Database ID. * @param {string} params.sql - SQL statement to execute. Exactly one statement per request. - * @param {object} params.bindings - Optional bound parameters. Pass either a positional list or a name => value map matching the placeholder style used in the SQL. - * @param {number} params.timeoutSeconds - Per-call execution timeout override. Must be less than or equal to the database's configured sqlApiTimeoutSeconds. + * @param {object | null} params.bindings - Optional bound parameters. Pass either a positional list or a name => value map matching the placeholder style used in the SQL. + * @param {number | null} params.timeoutSeconds - Per-call execution timeout override. Must be less than or equal to the database's configured sqlApiTimeoutSeconds. Statements that may exceed this — or the HTTP request timeout in front of Cloud — should use a direct connection instead. * @throws {AppwriteException} * @returns {Promise<Models.DedicatedDatabaseExecution>} */ createExecution(params: { databaseId: string; sql: string; - bindings?: object; - timeoutSeconds?: number; + bindings?: object | null; + timeoutSeconds?: number | null; }): Promise<Models.DedicatedDatabaseExecution>; /** - * Execute SQL through the console-facing Cloud endpoint. Cloud proxies through the edge platform to the per-database SQL API sidecar. Application traffic should bypass cloud entirely and POST directly to the per-database hostname: `https://db-{project}-{db}.{region}.appwrite.center/v1/sql/executions` with an `X-Appwrite-Key` header — that path scales to the whole DB fleet without a per-query cloud round-trip. The statement type must be on the database's configured allow-list. Use bound parameters for any user-supplied values — the API does not interpolate raw strings. + * Execute SQL through the console-facing Cloud endpoint. Cloud proxies through the edge platform to the per-database SQL API sidecar. Application traffic should bypass cloud entirely and POST directly to the per-database hostname: `https://db-{project}-{db}.{region}.appwrite.center/v1/sql/executions` with an `X-Appwrite-Key` header — that path scales to the whole DB fleet without a per-query cloud round-trip. The statement type must be on the database's configured allow-list. Use bound parameters for any user-supplied values — the API does not interpolate raw strings. Long-running statements (for example CREATE INDEX) can outlive the HTTP request: if the request ends before a result is returned, check the database before retrying, and prefer a direct connection for work that may take minutes. * * @param {string} databaseId - Database ID. * @param {string} sql - SQL statement to execute. Exactly one statement per request. - * @param {object} bindings - Optional bound parameters. Pass either a positional list or a name => value map matching the placeholder style used in the SQL. - * @param {number} timeoutSeconds - Per-call execution timeout override. Must be less than or equal to the database's configured sqlApiTimeoutSeconds. + * @param {object | null} bindings - Optional bound parameters. Pass either a positional list or a name => value map matching the placeholder style used in the SQL. + * @param {number | null} timeoutSeconds - Per-call execution timeout override. Must be less than or equal to the database's configured sqlApiTimeoutSeconds. Statements that may exceed this — or the HTTP request timeout in front of Cloud — should use a direct connection instead. * @throws {AppwriteException} * @returns {Promise<Models.DedicatedDatabaseExecution>} * @deprecated Use the object parameter style method for a better developer experience. @@ -2685,25 +2730,25 @@ export class Mysql { createExecution( databaseId: string, sql: string, - bindings?: object, - timeoutSeconds?: number, + bindings?: object | null, + timeoutSeconds?: number | null, ): Promise<Models.DedicatedDatabaseExecution>; createExecution( paramsOrFirst: | { databaseId: string; sql: string; - bindings?: object; - timeoutSeconds?: number; + bindings?: object | null; + timeoutSeconds?: number | null; } | string, - ...rest: [string?, object?, number?] + ...rest: [string?, (object | null)?, (number | null)?] ): Promise<Models.DedicatedDatabaseExecution> { let params: { databaseId: string; sql: string; - bindings?: object; - timeoutSeconds?: number; + bindings?: object | null; + timeoutSeconds?: number | null; }; if ( @@ -2714,15 +2759,15 @@ export class Mysql { params = (paramsOrFirst || {}) as { databaseId: string; sql: string; - bindings?: object; - timeoutSeconds?: number; + bindings?: object | null; + timeoutSeconds?: number | null; }; } else { params = { databaseId: paramsOrFirst as string, sql: rest[0] as string, - bindings: rest[1] as object, - timeoutSeconds: rest[2] as number, + bindings: rest[1] as object | null, + timeoutSeconds: rest[2] as number | null, }; } @@ -2796,33 +2841,33 @@ export class Mysql { * Trigger a manual failover for a dedicated database with high availability enabled. Promotes a replica to primary. The failover runs asynchronously; poll the database document for status updates. A database left mid-operation also accepts this call as a repair once nothing is driving the operation it is stuck in. Repairing a failover that did not finish, a `failed` database, a stranded upgrade or migrate, or a stranded compute resize additionally requires `targetReplicaId` to name the member to promote, because the default target may be the member that operation already promoted. * * @param {string} params.databaseId - Database ID. - * @param {string} params.targetReplicaId - Target replica ID to promote. If not specified, the healthiest replica is selected. + * @param {string | null} params.targetReplicaId - Target replica ID to promote. If not specified, the healthiest replica is selected. * @throws {AppwriteException} * @returns {Promise<Models.DedicatedDatabase>} */ createFailover(params: { databaseId: string; - targetReplicaId?: string; + targetReplicaId?: string | null; }): Promise<Models.DedicatedDatabase>; /** * Trigger a manual failover for a dedicated database with high availability enabled. Promotes a replica to primary. The failover runs asynchronously; poll the database document for status updates. A database left mid-operation also accepts this call as a repair once nothing is driving the operation it is stuck in. Repairing a failover that did not finish, a `failed` database, a stranded upgrade or migrate, or a stranded compute resize additionally requires `targetReplicaId` to name the member to promote, because the default target may be the member that operation already promoted. * * @param {string} databaseId - Database ID. - * @param {string} targetReplicaId - Target replica ID to promote. If not specified, the healthiest replica is selected. + * @param {string | null} targetReplicaId - Target replica ID to promote. If not specified, the healthiest replica is selected. * @throws {AppwriteException} * @returns {Promise<Models.DedicatedDatabase>} * @deprecated Use the object parameter style method for a better developer experience. */ createFailover( databaseId: string, - targetReplicaId?: string, + targetReplicaId?: string | null, ): Promise<Models.DedicatedDatabase>; createFailover( paramsOrFirst: - { databaseId: string; targetReplicaId?: string } | string, - ...rest: [string?] + { databaseId: string; targetReplicaId?: string | null } | string, + ...rest: [(string | null)?] ): Promise<Models.DedicatedDatabase> { - let params: { databaseId: string; targetReplicaId?: string }; + let params: { databaseId: string; targetReplicaId?: string | null }; if ( paramsOrFirst && @@ -2831,12 +2876,12 @@ export class Mysql { ) { params = (paramsOrFirst || {}) as { databaseId: string; - targetReplicaId?: string; + targetReplicaId?: string | null; }; } else { params = { databaseId: paramsOrFirst as string, - targetReplicaId: rest[0] as string, + targetReplicaId: rest[0] as string | null, }; } @@ -3077,21 +3122,21 @@ export class Mysql { * * @param {string} params.databaseId - Database ID. * @param {string} params.targetType - Target database type to migrate to. Allowed values: shared (serverless, scales to zero when idle), dedicated (always-on with persistent resources). - * @param {string} params.specification - Target specification to provision when migrating to dedicated. Ignored for shared. Defaults to the database's current specification. + * @param {string | null} params.specification - Target specification to provision when migrating to dedicated. Ignored for shared. Defaults to the database's current specification. * @throws {AppwriteException} * @returns {Promise<Models.DedicatedDatabase>} */ createMigration(params: { databaseId: string; targetType: string; - specification?: string; + specification?: string | null; }): Promise<Models.DedicatedDatabase>; /** * Migrate a database between shared and dedicated types. Shared to dedicated provisions an always-on dedicated instance; dedicated to shared converts to a serverless instance that scales to zero when idle. Data is copied to the target with a brief read-only window during cutover. * * @param {string} databaseId - Database ID. * @param {string} targetType - Target database type to migrate to. Allowed values: shared (serverless, scales to zero when idle), dedicated (always-on with persistent resources). - * @param {string} specification - Target specification to provision when migrating to dedicated. Ignored for shared. Defaults to the database's current specification. + * @param {string | null} specification - Target specification to provision when migrating to dedicated. Ignored for shared. Defaults to the database's current specification. * @throws {AppwriteException} * @returns {Promise<Models.DedicatedDatabase>} * @deprecated Use the object parameter style method for a better developer experience. @@ -3099,18 +3144,22 @@ export class Mysql { createMigration( databaseId: string, targetType: string, - specification?: string, + specification?: string | null, ): Promise<Models.DedicatedDatabase>; createMigration( paramsOrFirst: - | { databaseId: string; targetType: string; specification?: string } + | { + databaseId: string; + targetType: string; + specification?: string | null; + } | string, - ...rest: [string?, string?] + ...rest: [string?, (string | null)?] ): Promise<Models.DedicatedDatabase> { let params: { databaseId: string; targetType: string; - specification?: string; + specification?: string | null; }; if ( @@ -3121,13 +3170,13 @@ export class Mysql { params = (paramsOrFirst || {}) as { databaseId: string; targetType: string; - specification?: string; + specification?: string | null; }; } else { params = { databaseId: paramsOrFirst as string, targetType: rest[0] as string, - specification: rest[1] as string, + specification: rest[1] as string | null, }; } @@ -3512,90 +3561,90 @@ export class Mysql { * Update the connection pooler configuration for a dedicated database. Configure pool mode, max connections, and pool sizes. * * @param {string} params.databaseId - Database ID. - * @param {string} params.mode - Connection pool mode. Allowed values: transaction, session. Transaction mode returns connections to the pool after each transaction; session mode holds connections for the entire session lifetime. - * @param {number} params.maxConnections - Client-connection ceiling the pooler accepts. Supported on MySQL and MariaDB only; the PostgreSQL pooler has no client cap, so set networkMaxConnections on the database instead. - * @param {number} params.defaultPoolSize - Default pool size per user. - * @param {boolean} params.readWriteSplitting - Route SELECTs to HA replicas, writes and locked reads to the primary. Defaults to true when HA is enabled. - * @param {string} params.poolerCpuRequest - Pooler sidecar CPU request override (Kubernetes quantity, e.g. "250m" or "1"). Leave null for the proportional default (5% of DB CPU, floor 100m). - * @param {string} params.poolerCpuLimit - Pooler sidecar CPU limit override (Kubernetes quantity, e.g. "500m" or "1"). Leave null for the proportional default (10% of DB CPU, floor 200m). Changing this field rolls the database pod. - * @param {string} params.poolerMemoryRequest - Pooler sidecar memory request override (Kubernetes quantity, e.g. "128Mi" or "1Gi"). Leave null for the proportional default (7.5% of DB memory, floor 64Mi). - * @param {string} params.poolerMemoryLimit - Pooler sidecar memory limit override (Kubernetes quantity, e.g. "256Mi" or "1Gi"). Leave null for the proportional default (15% of DB memory, floor 128Mi). Changing this field rolls the database pod. + * @param {string | null} params.mode - Connection pool mode. Allowed values: transaction, session. Transaction mode returns connections to the pool after each transaction; session mode holds connections for the entire session lifetime. + * @param {number | null} params.maxConnections - Client-connection ceiling the pooler accepts. Supported on MySQL and MariaDB only; the PostgreSQL pooler has no client cap, so set networkMaxConnections on the database instead. + * @param {number | null} params.defaultPoolSize - Default pool size per user. + * @param {boolean | null} params.readWriteSplitting - Route SELECTs to HA replicas, writes and locked reads to the primary. Off by default, and only takes effect while HA is enabled. Replication is asynchronous, so a read issued immediately after a write may not observe it. + * @param {string | null} params.poolerCpuRequest - Pooler sidecar CPU request override (Kubernetes quantity, e.g. "250m" or "1"). Leave null for the proportional default (5% of DB CPU, floor 100m). + * @param {string | null} params.poolerCpuLimit - Pooler sidecar CPU limit override (Kubernetes quantity, e.g. "500m" or "1"). Leave null for the proportional default (10% of DB CPU, floor 200m). Changing this field rolls the database pod. + * @param {string | null} params.poolerMemoryRequest - Pooler sidecar memory request override (Kubernetes quantity, e.g. "128Mi" or "1Gi"). Leave null for the proportional default (7.5% of DB memory, floor 64Mi). + * @param {string | null} params.poolerMemoryLimit - Pooler sidecar memory limit override (Kubernetes quantity, e.g. "256Mi" or "1Gi"). Leave null for the proportional default (15% of DB memory, floor 128Mi). Changing this field rolls the database pod. * @throws {AppwriteException} * @returns {Promise<Models.DedicatedDatabasePooler>} */ updatePooler(params: { databaseId: string; - mode?: string; - maxConnections?: number; - defaultPoolSize?: number; - readWriteSplitting?: boolean; - poolerCpuRequest?: string; - poolerCpuLimit?: string; - poolerMemoryRequest?: string; - poolerMemoryLimit?: string; + mode?: string | null; + maxConnections?: number | null; + defaultPoolSize?: number | null; + readWriteSplitting?: boolean | null; + poolerCpuRequest?: string | null; + poolerCpuLimit?: string | null; + poolerMemoryRequest?: string | null; + poolerMemoryLimit?: string | null; }): Promise<Models.DedicatedDatabasePooler>; /** * Update the connection pooler configuration for a dedicated database. Configure pool mode, max connections, and pool sizes. * * @param {string} databaseId - Database ID. - * @param {string} mode - Connection pool mode. Allowed values: transaction, session. Transaction mode returns connections to the pool after each transaction; session mode holds connections for the entire session lifetime. - * @param {number} maxConnections - Client-connection ceiling the pooler accepts. Supported on MySQL and MariaDB only; the PostgreSQL pooler has no client cap, so set networkMaxConnections on the database instead. - * @param {number} defaultPoolSize - Default pool size per user. - * @param {boolean} readWriteSplitting - Route SELECTs to HA replicas, writes and locked reads to the primary. Defaults to true when HA is enabled. - * @param {string} poolerCpuRequest - Pooler sidecar CPU request override (Kubernetes quantity, e.g. "250m" or "1"). Leave null for the proportional default (5% of DB CPU, floor 100m). - * @param {string} poolerCpuLimit - Pooler sidecar CPU limit override (Kubernetes quantity, e.g. "500m" or "1"). Leave null for the proportional default (10% of DB CPU, floor 200m). Changing this field rolls the database pod. - * @param {string} poolerMemoryRequest - Pooler sidecar memory request override (Kubernetes quantity, e.g. "128Mi" or "1Gi"). Leave null for the proportional default (7.5% of DB memory, floor 64Mi). - * @param {string} poolerMemoryLimit - Pooler sidecar memory limit override (Kubernetes quantity, e.g. "256Mi" or "1Gi"). Leave null for the proportional default (15% of DB memory, floor 128Mi). Changing this field rolls the database pod. + * @param {string | null} mode - Connection pool mode. Allowed values: transaction, session. Transaction mode returns connections to the pool after each transaction; session mode holds connections for the entire session lifetime. + * @param {number | null} maxConnections - Client-connection ceiling the pooler accepts. Supported on MySQL and MariaDB only; the PostgreSQL pooler has no client cap, so set networkMaxConnections on the database instead. + * @param {number | null} defaultPoolSize - Default pool size per user. + * @param {boolean | null} readWriteSplitting - Route SELECTs to HA replicas, writes and locked reads to the primary. Off by default, and only takes effect while HA is enabled. Replication is asynchronous, so a read issued immediately after a write may not observe it. + * @param {string | null} poolerCpuRequest - Pooler sidecar CPU request override (Kubernetes quantity, e.g. "250m" or "1"). Leave null for the proportional default (5% of DB CPU, floor 100m). + * @param {string | null} poolerCpuLimit - Pooler sidecar CPU limit override (Kubernetes quantity, e.g. "500m" or "1"). Leave null for the proportional default (10% of DB CPU, floor 200m). Changing this field rolls the database pod. + * @param {string | null} poolerMemoryRequest - Pooler sidecar memory request override (Kubernetes quantity, e.g. "128Mi" or "1Gi"). Leave null for the proportional default (7.5% of DB memory, floor 64Mi). + * @param {string | null} poolerMemoryLimit - Pooler sidecar memory limit override (Kubernetes quantity, e.g. "256Mi" or "1Gi"). Leave null for the proportional default (15% of DB memory, floor 128Mi). Changing this field rolls the database pod. * @throws {AppwriteException} * @returns {Promise<Models.DedicatedDatabasePooler>} * @deprecated Use the object parameter style method for a better developer experience. */ updatePooler( databaseId: string, - mode?: string, - maxConnections?: number, - defaultPoolSize?: number, - readWriteSplitting?: boolean, - poolerCpuRequest?: string, - poolerCpuLimit?: string, - poolerMemoryRequest?: string, - poolerMemoryLimit?: string, + mode?: string | null, + maxConnections?: number | null, + defaultPoolSize?: number | null, + readWriteSplitting?: boolean | null, + poolerCpuRequest?: string | null, + poolerCpuLimit?: string | null, + poolerMemoryRequest?: string | null, + poolerMemoryLimit?: string | null, ): Promise<Models.DedicatedDatabasePooler>; updatePooler( paramsOrFirst: | { databaseId: string; - mode?: string; - maxConnections?: number; - defaultPoolSize?: number; - readWriteSplitting?: boolean; - poolerCpuRequest?: string; - poolerCpuLimit?: string; - poolerMemoryRequest?: string; - poolerMemoryLimit?: string; + mode?: string | null; + maxConnections?: number | null; + defaultPoolSize?: number | null; + readWriteSplitting?: boolean | null; + poolerCpuRequest?: string | null; + poolerCpuLimit?: string | null; + poolerMemoryRequest?: string | null; + poolerMemoryLimit?: string | null; } | string, ...rest: [ - string?, - number?, - number?, - boolean?, - string?, - string?, - string?, - string?, + (string | null)?, + (number | null)?, + (number | null)?, + (boolean | null)?, + (string | null)?, + (string | null)?, + (string | null)?, + (string | null)?, ] ): Promise<Models.DedicatedDatabasePooler> { let params: { databaseId: string; - mode?: string; - maxConnections?: number; - defaultPoolSize?: number; - readWriteSplitting?: boolean; - poolerCpuRequest?: string; - poolerCpuLimit?: string; - poolerMemoryRequest?: string; - poolerMemoryLimit?: string; + mode?: string | null; + maxConnections?: number | null; + defaultPoolSize?: number | null; + readWriteSplitting?: boolean | null; + poolerCpuRequest?: string | null; + poolerCpuLimit?: string | null; + poolerMemoryRequest?: string | null; + poolerMemoryLimit?: string | null; }; if ( @@ -3605,26 +3654,26 @@ export class Mysql { ) { params = (paramsOrFirst || {}) as { databaseId: string; - mode?: string; - maxConnections?: number; - defaultPoolSize?: number; - readWriteSplitting?: boolean; - poolerCpuRequest?: string; - poolerCpuLimit?: string; - poolerMemoryRequest?: string; - poolerMemoryLimit?: string; + mode?: string | null; + maxConnections?: number | null; + defaultPoolSize?: number | null; + readWriteSplitting?: boolean | null; + poolerCpuRequest?: string | null; + poolerCpuLimit?: string | null; + poolerMemoryRequest?: string | null; + poolerMemoryLimit?: string | null; }; } else { params = { databaseId: paramsOrFirst as string, - mode: rest[0] as string, - maxConnections: rest[1] as number, - defaultPoolSize: rest[2] as number, - readWriteSplitting: rest[3] as boolean, - poolerCpuRequest: rest[4] as string, - poolerCpuLimit: rest[5] as string, - poolerMemoryRequest: rest[6] as string, - poolerMemoryLimit: rest[7] as string, + mode: rest[0] as string | null, + maxConnections: rest[1] as number | null, + defaultPoolSize: rest[2] as number | null, + readWriteSplitting: rest[3] as boolean | null, + poolerCpuRequest: rest[4] as string | null, + poolerCpuLimit: rest[5] as string | null, + poolerMemoryRequest: rest[6] as string | null, + poolerMemoryLimit: rest[7] as string | null, }; } @@ -3927,6 +3976,7 @@ export class Mysql { databaseId: '', projectId: '', type: 'backup', + restoreMode: 'in_place', status: 'pending', error: '', }, @@ -3940,29 +3990,42 @@ export class Mysql { /** * Restore a database from a backup or to a specific point in time (PITR). For backup restoration, provide a backupId. For PITR, provide a targetTime as an ISO 8601 datetime. PITR requires the database to have PITR enabled and is only available for enterprise databases. * + * By default the backup is replayed over the database it was taken from. Pass `restoreMode` as `clone` to recover it onto a second workload beside this database instead: this database keeps serving its own data while the clone is filled, and the switch happens as soon as the clone is ready, on the endpoint and credentials it already had. Pass `autoPromote` as false to hold the clone until you promote it yourself. Pass `restoreMode` as `copy` to recover onto a separate database with its own endpoint, either one you name with `targetDatabaseId` or one provisioned as a copy of this database's engine, version, specification and replicas. Neither mode is available for a point-in-time recovery or an incremental backup. + * * @param {string} params.databaseId - Database ID. * @param {string} params.type - Restoration type. Allowed values: backup, pitr. Use "backup" to restore from a specific backup, or "pitr" for point-in-time recovery. - * @param {string} params.backupId - Backup ID to restore from (required for backup type). - * @param {string} params.targetDatabaseId - Existing database ID to restore into. The target must be distinct, ready, and use the same engine and version. - * @param {string} params.targetTime - Target time for PITR (required for pitr type) as an [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) datetime. + * @param {string | null} params.backupId - Backup ID to restore from (required for backup type). + * @param {string | null} params.targetDatabaseId - Existing database ID to restore into. The target must be distinct, ready, and use the same engine and version. Omit it on a copy restoration to have one provisioned. Not accepted for a clone, which is recovered inside this database. + * @param {string | null} params.targetTime - Target time for PITR (required for pitr type) as an [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) datetime. + * @param {string | null} params.restoreMode - Where the backup is restored. Allowed values: in_place, clone, copy. Use "clone" to recover onto a second workload beside this database and leave it serving until you promote — the endpoint and credentials do not change. Use "copy" to recover onto a separate database with its own endpoint, either one you name with targetDatabaseId or one Cloud provisions. Use "in_place" to replay the backup over this database. Defaults to "copy" when a targetDatabaseId is given, "in_place" otherwise. + * @param {string | null} params.targetName - Display name for the database a copy restoration provisions. Defaults to this database's name followed by "(restored)". Max length: 128 chars. + * @param {boolean} params.autoPromote - Whether a clone restoration switches the database over as soon as the recovery is ready. Default true: the restore finishes with the database serving the recovery point on the endpoint it already had, and the side it replaced kept briefly so the switch can be reversed. Pass false to hold the recovery until you call the promotion endpoint yourself. * @throws {AppwriteException} * @returns {Promise<Models.DedicatedDatabaseRestoration>} */ createRestoration(params: { databaseId: string; type?: string; - backupId?: string; - targetDatabaseId?: string; - targetTime?: string; + backupId?: string | null; + targetDatabaseId?: string | null; + targetTime?: string | null; + restoreMode?: string | null; + targetName?: string | null; + autoPromote?: boolean; }): Promise<Models.DedicatedDatabaseRestoration>; /** * Restore a database from a backup or to a specific point in time (PITR). For backup restoration, provide a backupId. For PITR, provide a targetTime as an ISO 8601 datetime. PITR requires the database to have PITR enabled and is only available for enterprise databases. * + * By default the backup is replayed over the database it was taken from. Pass `restoreMode` as `clone` to recover it onto a second workload beside this database instead: this database keeps serving its own data while the clone is filled, and the switch happens as soon as the clone is ready, on the endpoint and credentials it already had. Pass `autoPromote` as false to hold the clone until you promote it yourself. Pass `restoreMode` as `copy` to recover onto a separate database with its own endpoint, either one you name with `targetDatabaseId` or one provisioned as a copy of this database's engine, version, specification and replicas. Neither mode is available for a point-in-time recovery or an incremental backup. + * * @param {string} databaseId - Database ID. * @param {string} type - Restoration type. Allowed values: backup, pitr. Use "backup" to restore from a specific backup, or "pitr" for point-in-time recovery. - * @param {string} backupId - Backup ID to restore from (required for backup type). - * @param {string} targetDatabaseId - Existing database ID to restore into. The target must be distinct, ready, and use the same engine and version. - * @param {string} targetTime - Target time for PITR (required for pitr type) as an [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) datetime. + * @param {string | null} backupId - Backup ID to restore from (required for backup type). + * @param {string | null} targetDatabaseId - Existing database ID to restore into. The target must be distinct, ready, and use the same engine and version. Omit it on a copy restoration to have one provisioned. Not accepted for a clone, which is recovered inside this database. + * @param {string | null} targetTime - Target time for PITR (required for pitr type) as an [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) datetime. + * @param {string | null} restoreMode - Where the backup is restored. Allowed values: in_place, clone, copy. Use "clone" to recover onto a second workload beside this database and leave it serving until you promote — the endpoint and credentials do not change. Use "copy" to recover onto a separate database with its own endpoint, either one you name with targetDatabaseId or one Cloud provisions. Use "in_place" to replay the backup over this database. Defaults to "copy" when a targetDatabaseId is given, "in_place" otherwise. + * @param {string | null} targetName - Display name for the database a copy restoration provisions. Defaults to this database's name followed by "(restored)". Max length: 128 chars. + * @param {boolean} autoPromote - Whether a clone restoration switches the database over as soon as the recovery is ready. Default true: the restore finishes with the database serving the recovery point on the endpoint it already had, and the side it replaced kept briefly so the switch can be reversed. Pass false to hold the recovery until you call the promotion endpoint yourself. * @throws {AppwriteException} * @returns {Promise<Models.DedicatedDatabaseRestoration>} * @deprecated Use the object parameter style method for a better developer experience. @@ -3970,28 +4033,45 @@ export class Mysql { createRestoration( databaseId: string, type?: string, - backupId?: string, - targetDatabaseId?: string, - targetTime?: string, + backupId?: string | null, + targetDatabaseId?: string | null, + targetTime?: string | null, + restoreMode?: string | null, + targetName?: string | null, + autoPromote?: boolean, ): Promise<Models.DedicatedDatabaseRestoration>; createRestoration( paramsOrFirst: | { databaseId: string; type?: string; - backupId?: string; - targetDatabaseId?: string; - targetTime?: string; + backupId?: string | null; + targetDatabaseId?: string | null; + targetTime?: string | null; + restoreMode?: string | null; + targetName?: string | null; + autoPromote?: boolean; } | string, - ...rest: [string?, string?, string?, string?] + ...rest: [ + string?, + (string | null)?, + (string | null)?, + (string | null)?, + (string | null)?, + (string | null)?, + boolean?, + ] ): Promise<Models.DedicatedDatabaseRestoration> { let params: { databaseId: string; type?: string; - backupId?: string; - targetDatabaseId?: string; - targetTime?: string; + backupId?: string | null; + targetDatabaseId?: string | null; + targetTime?: string | null; + restoreMode?: string | null; + targetName?: string | null; + autoPromote?: boolean; }; if ( @@ -4002,17 +4082,23 @@ export class Mysql { params = (paramsOrFirst || {}) as { databaseId: string; type?: string; - backupId?: string; - targetDatabaseId?: string; - targetTime?: string; + backupId?: string | null; + targetDatabaseId?: string | null; + targetTime?: string | null; + restoreMode?: string | null; + targetName?: string | null; + autoPromote?: boolean; }; } else { params = { databaseId: paramsOrFirst as string, type: rest[0] as string, - backupId: rest[1] as string, - targetDatabaseId: rest[2] as string, - targetTime: rest[3] as string, + backupId: rest[1] as string | null, + targetDatabaseId: rest[2] as string | null, + targetTime: rest[3] as string | null, + restoreMode: rest[4] as string | null, + targetName: rest[5] as string | null, + autoPromote: rest[6] as boolean, }; } @@ -4021,6 +4107,9 @@ export class Mysql { const backupId = params.backupId; const targetDatabaseId = params.targetDatabaseId; const targetTime = params.targetTime; + const restoreMode = params.restoreMode; + const targetName = params.targetName; + const autoPromote = params.autoPromote; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -4044,6 +4133,15 @@ export class Mysql { if (typeof targetTime !== 'undefined') { apiPayload['targetTime'] = targetTime; } + if (typeof restoreMode !== 'undefined') { + apiPayload['restoreMode'] = restoreMode; + } + if (typeof targetName !== 'undefined') { + apiPayload['targetName'] = targetName; + } + if (typeof autoPromote !== 'undefined') { + apiPayload['autoPromote'] = autoPromote; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -4063,6 +4161,7 @@ export class Mysql { databaseId: '', projectId: '', type: 'backup', + restoreMode: 'in_place', status: 'pending', error: '', }, @@ -4158,6 +4257,111 @@ export class Mysql { databaseId: '', projectId: '', type: 'backup', + restoreMode: 'in_place', + status: 'pending', + error: '', + }, + }, + }, + }; + + return request.then((response) => applyDefaults(response, defaults)); + } + + /** + * Switch the database over to the clone a restoration recovered. The database keeps + * its endpoint and credentials; clients reconnect once. Writes made after the + * recovery point are discarded, and the side being replaced is retained briefly so + * the switch can be reversed. + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.restorationId - Restoration ID. + * @throws {AppwriteException} + * @returns {Promise<Models.DedicatedDatabaseRestoration>} + */ + promoteRestoration(params: { + databaseId: string; + restorationId: string; + }): Promise<Models.DedicatedDatabaseRestoration>; + /** + * Switch the database over to the clone a restoration recovered. The database keeps + * its endpoint and credentials; clients reconnect once. Writes made after the + * recovery point are discarded, and the side being replaced is retained briefly so + * the switch can be reversed. + * + * @param {string} databaseId - Database ID. + * @param {string} restorationId - Restoration ID. + * @throws {AppwriteException} + * @returns {Promise<Models.DedicatedDatabaseRestoration>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + promoteRestoration( + databaseId: string, + restorationId: string, + ): Promise<Models.DedicatedDatabaseRestoration>; + promoteRestoration( + paramsOrFirst: { databaseId: string; restorationId: string } | string, + ...rest: [string?] + ): Promise<Models.DedicatedDatabaseRestoration> { + let params: { databaseId: string; restorationId: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + databaseId: string; + restorationId: string; + }; + } else { + params = { + databaseId: paramsOrFirst as string, + restorationId: rest[0] as string, + }; + } + + const databaseId = params.databaseId; + const restorationId = params.restorationId; + + if (typeof databaseId === 'undefined' || databaseId === '') { + throw new AppwriteException( + 'Missing required parameter: "databaseId"', + ); + } + if (typeof restorationId === 'undefined' || restorationId === '') { + throw new AppwriteException( + 'Missing required parameter: "restorationId"', + ); + } + const apiPath = + '/mysql/{databaseId}/restorations/{restorationId}/promotions' + .replace('{databaseId}', encodeURIComponent(String(databaseId))) + .replace( + '{restorationId}', + encodeURIComponent(String(restorationId)), + ); + const apiPayload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }; + + const request = this.client.call('post', uri, apiHeaders, apiPayload); + const defaults = { + root: 'dedicatedDatabaseRestoration', + models: { + dedicatedDatabaseRestoration: { + defaults: { + $id: '', + $createdAt: '', + databaseId: '', + projectId: '', + type: 'backup', + restoreMode: 'in_place', status: 'pending', error: '', }, diff --git a/src/services/oauth-2.ts b/src/services/oauth-2.ts index b757116c..6b176f68 100644 --- a/src/services/oauth-2.ts +++ b/src/services/oauth-2.ts @@ -379,7 +379,7 @@ export class Oauth2 { * @param {string} params.codeChallenge - PKCE code challenge. Required when OAuth2 app is public. * @param {string} params.codeChallengeMethod - PKCE code challenge method. Required when OAuth2 app is public. * @param {string} params.prompt - OIDC prompt parameter for customization of consent screen. Space-separated list of: none, login, consent, select_account. - * @param {number} params.maxAge - OIDC max_age paraleter for customization of consent screen. Maximum allowable elapsed time in seconds since the user last authenticated. If exceeded, re-authentication is required. + * @param {number | null} params.maxAge - OIDC max_age paraleter for customization of consent screen. Maximum allowable elapsed time in seconds since the user last authenticated. If exceeded, re-authentication is required. * @param {string} params.authorizationDetails - Rich authorization request. JSON array of objects, each with a `type` and project-defined fields * @param {string[]} params.resource - RFC 8707 resource indicator URI or URI list. Each value must be an absolute URI without a fragment. * @param {string} params.audience - Compatibility alias for a single OAuth2 resource indicator URI. @@ -397,7 +397,7 @@ export class Oauth2 { codeChallenge?: string; codeChallengeMethod?: string; prompt?: string; - maxAge?: number; + maxAge?: number | null; authorizationDetails?: string; resource?: string[]; audience?: string; @@ -415,7 +415,7 @@ export class Oauth2 { * @param {string} codeChallenge - PKCE code challenge. Required when OAuth2 app is public. * @param {string} codeChallengeMethod - PKCE code challenge method. Required when OAuth2 app is public. * @param {string} prompt - OIDC prompt parameter for customization of consent screen. Space-separated list of: none, login, consent, select_account. - * @param {number} maxAge - OIDC max_age paraleter for customization of consent screen. Maximum allowable elapsed time in seconds since the user last authenticated. If exceeded, re-authentication is required. + * @param {number | null} maxAge - OIDC max_age paraleter for customization of consent screen. Maximum allowable elapsed time in seconds since the user last authenticated. If exceeded, re-authentication is required. * @param {string} authorizationDetails - Rich authorization request. JSON array of objects, each with a `type` and project-defined fields * @param {string[]} resource - RFC 8707 resource indicator URI or URI list. Each value must be an absolute URI without a fragment. * @param {string} audience - Compatibility alias for a single OAuth2 resource indicator URI. @@ -434,7 +434,7 @@ export class Oauth2 { codeChallenge?: string, codeChallengeMethod?: string, prompt?: string, - maxAge?: number, + maxAge?: number | null, authorizationDetails?: string, resource?: string[], audience?: string, @@ -452,7 +452,7 @@ export class Oauth2 { codeChallenge?: string; codeChallengeMethod?: string; prompt?: string; - maxAge?: number; + maxAge?: number | null; authorizationDetails?: string; resource?: string[]; audience?: string; @@ -468,7 +468,7 @@ export class Oauth2 { string?, string?, string?, - number?, + (number | null)?, string?, string[]?, string?, @@ -485,7 +485,7 @@ export class Oauth2 { codeChallenge?: string; codeChallengeMethod?: string; prompt?: string; - maxAge?: number; + maxAge?: number | null; authorizationDetails?: string; resource?: string[]; audience?: string; @@ -508,7 +508,7 @@ export class Oauth2 { codeChallenge?: string; codeChallengeMethod?: string; prompt?: string; - maxAge?: number; + maxAge?: number | null; authorizationDetails?: string; resource?: string[]; audience?: string; @@ -525,7 +525,7 @@ export class Oauth2 { codeChallenge: rest[5] as string, codeChallengeMethod: rest[6] as string, prompt: rest[7] as string, - maxAge: rest[8] as number, + maxAge: rest[8] as number | null, authorizationDetails: rest[9] as string, resource: rest[10] as string[], audience: rest[11] as string, @@ -1285,7 +1285,7 @@ export class Oauth2 { * @param {string} params.codeChallenge - PKCE code challenge. Required when OAuth2 app is public. * @param {string} params.codeChallengeMethod - PKCE code challenge method. Required when OAuth2 app is public. * @param {string} params.prompt - OIDC prompt parameter for customization of consent screen. Space-separated list of: none, login, consent, select_account. - * @param {number} params.maxAge - OIDC max_age parameter for customization of consent screen. + * @param {number | null} params.maxAge - OIDC max_age parameter for customization of consent screen. * @param {string} params.authorizationDetails - Rich authorization request. JSON array of objects, each with a `type` and project-defined fields * @param {string[]} params.resource - RFC 8707 resource indicator URI or URI list. Each value must be an absolute URI without a fragment. * @param {string} params.audience - Compatibility alias for a single OAuth2 resource indicator URI. @@ -1302,7 +1302,7 @@ export class Oauth2 { codeChallenge?: string; codeChallengeMethod?: string; prompt?: string; - maxAge?: number; + maxAge?: number | null; authorizationDetails?: string; resource?: string[]; audience?: string; @@ -1319,7 +1319,7 @@ export class Oauth2 { * @param {string} codeChallenge - PKCE code challenge. Required when OAuth2 app is public. * @param {string} codeChallengeMethod - PKCE code challenge method. Required when OAuth2 app is public. * @param {string} prompt - OIDC prompt parameter for customization of consent screen. Space-separated list of: none, login, consent, select_account. - * @param {number} maxAge - OIDC max_age parameter for customization of consent screen. + * @param {number | null} maxAge - OIDC max_age parameter for customization of consent screen. * @param {string} authorizationDetails - Rich authorization request. JSON array of objects, each with a `type` and project-defined fields * @param {string[]} resource - RFC 8707 resource indicator URI or URI list. Each value must be an absolute URI without a fragment. * @param {string} audience - Compatibility alias for a single OAuth2 resource indicator URI. @@ -1337,7 +1337,7 @@ export class Oauth2 { codeChallenge?: string, codeChallengeMethod?: string, prompt?: string, - maxAge?: number, + maxAge?: number | null, authorizationDetails?: string, resource?: string[], audience?: string, @@ -1354,7 +1354,7 @@ export class Oauth2 { codeChallenge?: string; codeChallengeMethod?: string; prompt?: string; - maxAge?: number; + maxAge?: number | null; authorizationDetails?: string; resource?: string[]; audience?: string; @@ -1369,7 +1369,7 @@ export class Oauth2 { string?, string?, string?, - number?, + (number | null)?, string?, string[]?, string?, @@ -1385,7 +1385,7 @@ export class Oauth2 { codeChallenge?: string; codeChallengeMethod?: string; prompt?: string; - maxAge?: number; + maxAge?: number | null; authorizationDetails?: string; resource?: string[]; audience?: string; @@ -1406,7 +1406,7 @@ export class Oauth2 { codeChallenge?: string; codeChallengeMethod?: string; prompt?: string; - maxAge?: number; + maxAge?: number | null; authorizationDetails?: string; resource?: string[]; audience?: string; @@ -1422,7 +1422,7 @@ export class Oauth2 { codeChallenge: rest[5] as string, codeChallengeMethod: rest[6] as string, prompt: rest[7] as string, - maxAge: rest[8] as number, + maxAge: rest[8] as number | null, authorizationDetails: rest[9] as string, resource: rest[10] as string[], audience: rest[11] as string, diff --git a/src/services/organization.ts b/src/services/organization.ts index 80eb1236..a319e703 100644 --- a/src/services/organization.ts +++ b/src/services/organization.ts @@ -439,33 +439,37 @@ export class Organization { * Update an app installation on the organization. Only organization members with the owner role can update installations. The installation's granted scopes are refreshed to the scopes the app currently requests; previously issued installation access tokens are revoked. * * @param {string} params.installationId - Installation unique ID. - * @param {string} params.authorizationDetails - Authorization details granted to the installation as a JSON array of objects, each with a `type` and app-defined fields. Omit to keep the current value. + * @param {string | null} params.authorizationDetails - Authorization details granted to the installation as a JSON array of objects, each with a `type` and app-defined fields. Omit to keep the current value. * @throws {AppwriteException} * @returns {Promise<Models.AppInstallation>} */ updateInstallation(params: { installationId: string; - authorizationDetails?: string; + authorizationDetails?: string | null; }): Promise<Models.AppInstallation>; /** * Update an app installation on the organization. Only organization members with the owner role can update installations. The installation's granted scopes are refreshed to the scopes the app currently requests; previously issued installation access tokens are revoked. * * @param {string} installationId - Installation unique ID. - * @param {string} authorizationDetails - Authorization details granted to the installation as a JSON array of objects, each with a `type` and app-defined fields. Omit to keep the current value. + * @param {string | null} authorizationDetails - Authorization details granted to the installation as a JSON array of objects, each with a `type` and app-defined fields. Omit to keep the current value. * @throws {AppwriteException} * @returns {Promise<Models.AppInstallation>} * @deprecated Use the object parameter style method for a better developer experience. */ updateInstallation( installationId: string, - authorizationDetails?: string, + authorizationDetails?: string | null, ): Promise<Models.AppInstallation>; updateInstallation( paramsOrFirst: - { installationId: string; authorizationDetails?: string } | string, - ...rest: [string?] + | { installationId: string; authorizationDetails?: string | null } + | string, + ...rest: [(string | null)?] ): Promise<Models.AppInstallation> { - let params: { installationId: string; authorizationDetails?: string }; + let params: { + installationId: string; + authorizationDetails?: string | null; + }; if ( paramsOrFirst && @@ -474,12 +478,12 @@ export class Organization { ) { params = (paramsOrFirst || {}) as { installationId: string; - authorizationDetails?: string; + authorizationDetails?: string | null; }; } else { params = { installationId: paramsOrFirst as string, - authorizationDetails: rest[0] as string, + authorizationDetails: rest[0] as string | null, }; } @@ -671,6 +675,7 @@ export class Organization { $createdAt: '', $updatedAt: '', name: '', + description: '', expire: '', scopes: [], secret: '', @@ -690,7 +695,7 @@ export class Organization { * @param {string} params.keyId - Key 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 - Key name. Max length: 128 chars. * @param {OrganizationKeyScopes[]} params.scopes - Key scopes list. Maximum of 200 scopes are allowed. - * @param {string} params.expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. + * @param {string | null} params.expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. * @throws {AppwriteException} * @returns {Promise<Models.Key>} */ @@ -698,7 +703,7 @@ export class Organization { keyId: string; name: string; scopes: OrganizationKeyScopes[]; - expire?: string; + expire?: string | null; }): Promise<Models.Key>; /** * Create a new organization API key. @@ -706,7 +711,7 @@ export class Organization { * @param {string} keyId - Key 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 - Key name. Max length: 128 chars. * @param {OrganizationKeyScopes[]} scopes - Key scopes list. Maximum of 200 scopes are allowed. - * @param {string} expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. + * @param {string | null} expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. * @throws {AppwriteException} * @returns {Promise<Models.Key>} * @deprecated Use the object parameter style method for a better developer experience. @@ -715,7 +720,7 @@ export class Organization { keyId: string, name: string, scopes: OrganizationKeyScopes[], - expire?: string, + expire?: string | null, ): Promise<Models.Key>; createKey( paramsOrFirst: @@ -723,16 +728,16 @@ export class Organization { keyId: string; name: string; scopes: OrganizationKeyScopes[]; - expire?: string; + expire?: string | null; } | string, - ...rest: [string?, OrganizationKeyScopes[]?, string?] + ...rest: [string?, OrganizationKeyScopes[]?, (string | null)?] ): Promise<Models.Key> { let params: { keyId: string; name: string; scopes: OrganizationKeyScopes[]; - expire?: string; + expire?: string | null; }; if ( @@ -744,14 +749,14 @@ export class Organization { keyId: string; name: string; scopes: OrganizationKeyScopes[]; - expire?: string; + expire?: string | null; }; } else { params = { keyId: paramsOrFirst as string, name: rest[0] as string, scopes: rest[1] as OrganizationKeyScopes[], - expire: rest[2] as string, + expire: rest[2] as string | null, }; } @@ -801,6 +806,7 @@ export class Organization { $createdAt: '', $updatedAt: '', name: '', + description: '', expire: '', scopes: [], secret: '', @@ -873,6 +879,7 @@ export class Organization { $createdAt: '', $updatedAt: '', name: '', + description: '', expire: '', scopes: [], secret: '', @@ -892,7 +899,7 @@ export class Organization { * @param {string} params.keyId - Key unique ID. * @param {string} params.name - Key name. Max length: 128 chars. * @param {OrganizationKeyScopes[]} params.scopes - Key scopes list. Maximum of 200 scopes are allowed. - * @param {string} params.expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. + * @param {string | null} params.expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. * @throws {AppwriteException} * @returns {Promise<Models.Key>} */ @@ -900,7 +907,7 @@ export class Organization { keyId: string; name: string; scopes: OrganizationKeyScopes[]; - expire?: string; + expire?: string | null; }): Promise<Models.Key>; /** * Update a key by its unique ID. Use this endpoint to update the name, scopes, or expiration time of an API key. @@ -908,7 +915,7 @@ export class Organization { * @param {string} keyId - Key unique ID. * @param {string} name - Key name. Max length: 128 chars. * @param {OrganizationKeyScopes[]} scopes - Key scopes list. Maximum of 200 scopes are allowed. - * @param {string} expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. + * @param {string | null} expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. * @throws {AppwriteException} * @returns {Promise<Models.Key>} * @deprecated Use the object parameter style method for a better developer experience. @@ -917,7 +924,7 @@ export class Organization { keyId: string, name: string, scopes: OrganizationKeyScopes[], - expire?: string, + expire?: string | null, ): Promise<Models.Key>; updateKey( paramsOrFirst: @@ -925,16 +932,16 @@ export class Organization { keyId: string; name: string; scopes: OrganizationKeyScopes[]; - expire?: string; + expire?: string | null; } | string, - ...rest: [string?, OrganizationKeyScopes[]?, string?] + ...rest: [string?, OrganizationKeyScopes[]?, (string | null)?] ): Promise<Models.Key> { let params: { keyId: string; name: string; scopes: OrganizationKeyScopes[]; - expire?: string; + expire?: string | null; }; if ( @@ -946,14 +953,14 @@ export class Organization { keyId: string; name: string; scopes: OrganizationKeyScopes[]; - expire?: string; + expire?: string | null; }; } else { params = { keyId: paramsOrFirst as string, name: rest[0] as string, scopes: rest[1] as OrganizationKeyScopes[], - expire: rest[2] as string, + expire: rest[2] as string | null, }; } @@ -1003,6 +1010,7 @@ export class Organization { $createdAt: '', $updatedAt: '', name: '', + description: '', expire: '', scopes: [], secret: '', @@ -1696,7 +1704,7 @@ export class Organization { pingedAt: '', labels: [], status: 'active', - onboarding: [], + onboarding: {}, authMethods: [], services: [], protocols: [], @@ -1858,7 +1866,7 @@ export class Organization { pingedAt: '', labels: [], status: 'active', - onboarding: [], + onboarding: {}, authMethods: [], services: [], protocols: [], @@ -1988,7 +1996,7 @@ export class Organization { pingedAt: '', labels: [], status: 'active', - onboarding: [], + onboarding: {}, authMethods: [], services: [], protocols: [], @@ -2136,7 +2144,7 @@ export class Organization { pingedAt: '', labels: [], status: 'active', - onboarding: [], + onboarding: {}, authMethods: [], services: [], protocols: [], @@ -2344,6 +2352,7 @@ export class Organization { $createdAt: '', $updatedAt: '', name: '', + description: '', expire: '', scopes: [], secret: '', @@ -2366,7 +2375,8 @@ export class Organization { * @param {string} params.keyId - Key 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 - Key name. Max length: 128 chars. * @param {ProjectKeyScopes[]} params.scopes - Key scopes list. Maximum of 200 scopes are allowed. - * @param {string} params.expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. + * @param {string | null} params.expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. + * @param {string} params.description - Optional description for the key. * @throws {AppwriteException} * @returns {Promise<Models.Key>} */ @@ -2375,7 +2385,8 @@ export class Organization { keyId: string; name: string; scopes: ProjectKeyScopes[]; - expire?: string; + expire?: string | null; + description?: string; }): Promise<Models.Key>; /** * Create a new API key for a project in your organization. It's recommended to have multiple API keys with strict scopes for separate functions within your project. @@ -2386,7 +2397,8 @@ export class Organization { * @param {string} keyId - Key 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 - Key name. Max length: 128 chars. * @param {ProjectKeyScopes[]} scopes - Key scopes list. Maximum of 200 scopes are allowed. - * @param {string} expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. + * @param {string | null} expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. + * @param {string} description - Optional description for the key. * @throws {AppwriteException} * @returns {Promise<Models.Key>} * @deprecated Use the object parameter style method for a better developer experience. @@ -2396,7 +2408,8 @@ export class Organization { keyId: string, name: string, scopes: ProjectKeyScopes[], - expire?: string, + expire?: string | null, + description?: string, ): Promise<Models.Key>; createProjectKey( paramsOrFirst: @@ -2405,17 +2418,25 @@ export class Organization { keyId: string; name: string; scopes: ProjectKeyScopes[]; - expire?: string; + expire?: string | null; + description?: string; } | string, - ...rest: [string?, string?, ProjectKeyScopes[]?, string?] + ...rest: [ + string?, + string?, + ProjectKeyScopes[]?, + (string | null)?, + string?, + ] ): Promise<Models.Key> { let params: { projectId: string; keyId: string; name: string; scopes: ProjectKeyScopes[]; - expire?: string; + expire?: string | null; + description?: string; }; if ( @@ -2428,7 +2449,8 @@ export class Organization { keyId: string; name: string; scopes: ProjectKeyScopes[]; - expire?: string; + expire?: string | null; + description?: string; }; } else { params = { @@ -2436,7 +2458,8 @@ export class Organization { keyId: rest[0] as string, name: rest[1] as string, scopes: rest[2] as ProjectKeyScopes[], - expire: rest[3] as string, + expire: rest[3] as string | null, + description: rest[4] as string, }; } @@ -2445,6 +2468,7 @@ export class Organization { const name = params.name; const scopes = params.scopes; const expire = params.expire; + const description = params.description; if (typeof projectId === 'undefined' || projectId === '') { throw new AppwriteException( @@ -2477,6 +2501,9 @@ export class Organization { if (typeof expire !== 'undefined') { apiPayload['expire'] = expire; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -2495,6 +2522,7 @@ export class Organization { $createdAt: '', $updatedAt: '', name: '', + description: '', expire: '', scopes: [], secret: '', @@ -2622,6 +2650,7 @@ export class Organization { $createdAt: '', $updatedAt: '', name: '', + description: '', expire: '', scopes: [], secret: '', @@ -2711,6 +2740,7 @@ export class Organization { $createdAt: '', $updatedAt: '', name: '', + description: '', expire: '', scopes: [], secret: '', @@ -2731,7 +2761,8 @@ export class Organization { * @param {string} params.keyId - Key ID. * @param {string} params.name - Key name. Max length: 128 chars. * @param {ProjectKeyScopes[]} params.scopes - Key scopes list. Maximum of 200 scopes are allowed. - * @param {string} params.expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. + * @param {string | null} params.expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. + * @param {string | null} params.description - Optional description for the key. * @throws {AppwriteException} * @returns {Promise<Models.Key>} */ @@ -2740,7 +2771,8 @@ export class Organization { keyId: string; name: string; scopes: ProjectKeyScopes[]; - expire?: string; + expire?: string | null; + description?: string | null; }): Promise<Models.Key>; /** * Update a project key by its unique ID. Use this endpoint to update the name, scopes, or expiration time of an API key. @@ -2749,7 +2781,8 @@ export class Organization { * @param {string} keyId - Key ID. * @param {string} name - Key name. Max length: 128 chars. * @param {ProjectKeyScopes[]} scopes - Key scopes list. Maximum of 200 scopes are allowed. - * @param {string} expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. + * @param {string | null} expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. + * @param {string | null} description - Optional description for the key. * @throws {AppwriteException} * @returns {Promise<Models.Key>} * @deprecated Use the object parameter style method for a better developer experience. @@ -2759,7 +2792,8 @@ export class Organization { keyId: string, name: string, scopes: ProjectKeyScopes[], - expire?: string, + expire?: string | null, + description?: string | null, ): Promise<Models.Key>; updateProjectKey( paramsOrFirst: @@ -2768,17 +2802,25 @@ export class Organization { keyId: string; name: string; scopes: ProjectKeyScopes[]; - expire?: string; + expire?: string | null; + description?: string | null; } | string, - ...rest: [string?, string?, ProjectKeyScopes[]?, string?] + ...rest: [ + string?, + string?, + ProjectKeyScopes[]?, + (string | null)?, + (string | null)?, + ] ): Promise<Models.Key> { let params: { projectId: string; keyId: string; name: string; scopes: ProjectKeyScopes[]; - expire?: string; + expire?: string | null; + description?: string | null; }; if ( @@ -2791,7 +2833,8 @@ export class Organization { keyId: string; name: string; scopes: ProjectKeyScopes[]; - expire?: string; + expire?: string | null; + description?: string | null; }; } else { params = { @@ -2799,7 +2842,8 @@ export class Organization { keyId: rest[0] as string, name: rest[1] as string, scopes: rest[2] as ProjectKeyScopes[], - expire: rest[3] as string, + expire: rest[3] as string | null, + description: rest[4] as string | null, }; } @@ -2808,6 +2852,7 @@ export class Organization { const name = params.name; const scopes = params.scopes; const expire = params.expire; + const description = params.description; if (typeof projectId === 'undefined' || projectId === '') { throw new AppwriteException( @@ -2836,6 +2881,9 @@ export class Organization { if (typeof expire !== 'undefined') { apiPayload['expire'] = expire; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -2854,6 +2902,7 @@ export class Organization { $createdAt: '', $updatedAt: '', name: '', + description: '', expire: '', scopes: [], secret: '', diff --git a/src/services/organizations.ts b/src/services/organizations.ts index 6d9b119a..b2b8f52b 100644 --- a/src/services/organizations.ts +++ b/src/services/organizations.ts @@ -20,6 +20,7 @@ export class Organizations { * * @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. You may filter on the following attributes: name, total, billingPlan, paymentMethodId, backupPaymentMethodId, platform * @param {string} params.search - Search term to filter your list results. Max length: 256 chars. + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise<Models.OrganizationList<Preferences>>} */ @@ -28,12 +29,14 @@ export class Organizations { >(params?: { queries?: string[]; search?: string; + total?: boolean; }): Promise<Models.OrganizationList<Preferences>>; /** * Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results. * * @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. You may filter on the following attributes: name, total, billingPlan, paymentMethodId, backupPaymentMethodId, platform * @param {string} search - Search term to filter your list results. Max length: 256 chars. + * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise<Models.OrganizationList<Preferences>>} * @deprecated Use the object parameter style method for a better developer experience. @@ -41,12 +44,14 @@ export class Organizations { list<Preferences extends Models.Preferences = Models.DefaultPreferences>( queries?: string[], search?: string, + total?: boolean, ): Promise<Models.OrganizationList<Preferences>>; list<Preferences extends Models.Preferences = Models.DefaultPreferences>( - paramsOrFirst?: { queries?: string[]; search?: string } | string[], - ...rest: [string?] + paramsOrFirst?: + { queries?: string[]; search?: string; total?: boolean } | string[], + ...rest: [string?, boolean?] ): Promise<Models.OrganizationList<Preferences>> { - let params: { queries?: string[]; search?: string }; + let params: { queries?: string[]; search?: string; total?: boolean }; if ( (typeof paramsOrFirst === 'undefined' && rest.length === 0) || @@ -57,16 +62,19 @@ export class Organizations { params = (paramsOrFirst || {}) as { queries?: string[]; search?: string; + total?: boolean; }; } else { params = { queries: paramsOrFirst as string[], search: rest[0] as string, + total: rest[1] as boolean, }; } const queries = params.queries; const search = params.search; + const total = params.total; const apiPath = '/organizations'; const apiPayload: Payload = {}; @@ -76,6 +84,9 @@ export class Organizations { if (typeof search !== 'undefined') { apiPayload['search'] = search; } + if (typeof total !== 'undefined') { + apiPayload['total'] = total; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -128,12 +139,12 @@ export class Organizations { * @param {string} params.organizationId - Organization 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 - Organization name. Max length: 128 chars. * @param {string} params.billingPlan - Organization billing plan chosen - * @param {string} params.paymentMethodId - Payment method ID. Required for pro plans when trial is not available and user doesn't have default payment method set. - * @param {string} params.billingAddressId - Unique ID of billing address + * @param {string | null} params.paymentMethodId - Payment method ID. Required for pro plans when trial is not available and user doesn't have default payment method set. + * @param {string | null} params.billingAddressId - Unique ID of billing address * @param {string[]} params.invites - Additional member invites - * @param {string} params.couponId - Coupon id - * @param {string} params.taxId - Tax Id associated to billing. - * @param {number} params.budget - Budget limit for additional usage set for the organization + * @param {string | null} params.couponId - Coupon id + * @param {string | null} params.taxId - Tax Id associated to billing. + * @param {number | null} params.budget - Budget limit for additional usage set for the organization * @param {Platform} params.platform - Platform type * @throws {AppwriteException} * @returns {Promise<Models.Organization<Preferences> | Models.PaymentAuthentication>} @@ -144,12 +155,12 @@ export class Organizations { organizationId: string; name: string; billingPlan: string; - paymentMethodId?: string; - billingAddressId?: string; + paymentMethodId?: string | null; + billingAddressId?: string | null; invites?: string[]; - couponId?: string; - taxId?: string; - budget?: number; + couponId?: string | null; + taxId?: string | null; + budget?: number | null; platform?: Platform; }): Promise< Models.Organization<Preferences> | Models.PaymentAuthentication @@ -161,12 +172,12 @@ export class Organizations { * @param {string} organizationId - Organization 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 - Organization name. Max length: 128 chars. * @param {string} billingPlan - Organization billing plan chosen - * @param {string} paymentMethodId - Payment method ID. Required for pro plans when trial is not available and user doesn't have default payment method set. - * @param {string} billingAddressId - Unique ID of billing address + * @param {string | null} paymentMethodId - Payment method ID. Required for pro plans when trial is not available and user doesn't have default payment method set. + * @param {string | null} billingAddressId - Unique ID of billing address * @param {string[]} invites - Additional member invites - * @param {string} couponId - Coupon id - * @param {string} taxId - Tax Id associated to billing. - * @param {number} budget - Budget limit for additional usage set for the organization + * @param {string | null} couponId - Coupon id + * @param {string | null} taxId - Tax Id associated to billing. + * @param {number | null} budget - Budget limit for additional usage set for the organization * @param {Platform} platform - Platform type * @throws {AppwriteException} * @returns {Promise<Models.Organization<Preferences> | Models.PaymentAuthentication>} @@ -176,12 +187,12 @@ export class Organizations { organizationId: string, name: string, billingPlan: string, - paymentMethodId?: string, - billingAddressId?: string, + paymentMethodId?: string | null, + billingAddressId?: string | null, invites?: string[], - couponId?: string, - taxId?: string, - budget?: number, + couponId?: string | null, + taxId?: string | null, + budget?: number | null, platform?: Platform, ): Promise<Models.Organization<Preferences> | Models.PaymentAuthentication>; create<Preferences extends Models.Preferences = Models.DefaultPreferences>( @@ -190,24 +201,24 @@ export class Organizations { organizationId: string; name: string; billingPlan: string; - paymentMethodId?: string; - billingAddressId?: string; + paymentMethodId?: string | null; + billingAddressId?: string | null; invites?: string[]; - couponId?: string; - taxId?: string; - budget?: number; + couponId?: string | null; + taxId?: string | null; + budget?: number | null; platform?: Platform; } | string, ...rest: [ string?, string?, - string?, - string?, + (string | null)?, + (string | null)?, string[]?, - string?, - string?, - number?, + (string | null)?, + (string | null)?, + (number | null)?, Platform?, ] ): Promise< @@ -217,12 +228,12 @@ export class Organizations { organizationId: string; name: string; billingPlan: string; - paymentMethodId?: string; - billingAddressId?: string; + paymentMethodId?: string | null; + billingAddressId?: string | null; invites?: string[]; - couponId?: string; - taxId?: string; - budget?: number; + couponId?: string | null; + taxId?: string | null; + budget?: number | null; platform?: Platform; }; @@ -235,12 +246,12 @@ export class Organizations { organizationId: string; name: string; billingPlan: string; - paymentMethodId?: string; - billingAddressId?: string; + paymentMethodId?: string | null; + billingAddressId?: string | null; invites?: string[]; - couponId?: string; - taxId?: string; - budget?: number; + couponId?: string | null; + taxId?: string | null; + budget?: number | null; platform?: Platform; }; } else { @@ -248,12 +259,12 @@ export class Organizations { organizationId: paramsOrFirst as string, name: rest[0] as string, billingPlan: rest[1] as string, - paymentMethodId: rest[2] as string, - billingAddressId: rest[3] as string, + paymentMethodId: rest[2] as string | null, + billingAddressId: rest[3] as string | null, invites: rest[4] as string[], - couponId: rest[5] as string, - taxId: rest[6] as string, - budget: rest[7] as number, + couponId: rest[5] as string | null, + taxId: rest[6] as string | null, + budget: rest[7] as number | null, platform: rest[8] as Platform, }; } @@ -329,27 +340,27 @@ export class Organizations { * Get estimation for creating an organization. * * @param {string} params.billingPlan - Organization billing plan chosen - * @param {string} params.paymentMethodId - Payment method ID. Required for pro plans when trial is not available and user doesn't have default payment method set. + * @param {string | null} params.paymentMethodId - Payment method ID. Required for pro plans when trial is not available and user doesn't have default payment method set. * @param {string[]} params.invites - Additional member invites - * @param {string} params.couponId - Coupon id + * @param {string | null} params.couponId - Coupon id * @param {Platform} params.platform - Platform type * @throws {AppwriteException} * @returns {Promise<Models.Estimation>} */ estimationCreateOrganization(params: { billingPlan: string; - paymentMethodId?: string; + paymentMethodId?: string | null; invites?: string[]; - couponId?: string; + couponId?: string | null; platform?: Platform; }): Promise<Models.Estimation>; /** * Get estimation for creating an organization. * * @param {string} billingPlan - Organization billing plan chosen - * @param {string} paymentMethodId - Payment method ID. Required for pro plans when trial is not available and user doesn't have default payment method set. + * @param {string | null} paymentMethodId - Payment method ID. Required for pro plans when trial is not available and user doesn't have default payment method set. * @param {string[]} invites - Additional member invites - * @param {string} couponId - Coupon id + * @param {string | null} couponId - Coupon id * @param {Platform} platform - Platform type * @throws {AppwriteException} * @returns {Promise<Models.Estimation>} @@ -357,28 +368,28 @@ export class Organizations { */ estimationCreateOrganization( billingPlan: string, - paymentMethodId?: string, + paymentMethodId?: string | null, invites?: string[], - couponId?: string, + couponId?: string | null, platform?: Platform, ): Promise<Models.Estimation>; estimationCreateOrganization( paramsOrFirst: | { billingPlan: string; - paymentMethodId?: string; + paymentMethodId?: string | null; invites?: string[]; - couponId?: string; + couponId?: string | null; platform?: Platform; } | string, - ...rest: [string?, string[]?, string?, Platform?] + ...rest: [(string | null)?, string[]?, (string | null)?, Platform?] ): Promise<Models.Estimation> { let params: { billingPlan: string; - paymentMethodId?: string; + paymentMethodId?: string | null; invites?: string[]; - couponId?: string; + couponId?: string | null; platform?: Platform; }; @@ -389,17 +400,17 @@ export class Organizations { ) { params = (paramsOrFirst || {}) as { billingPlan: string; - paymentMethodId?: string; + paymentMethodId?: string | null; invites?: string[]; - couponId?: string; + couponId?: string | null; platform?: Platform; }; } else { params = { billingPlan: paramsOrFirst as string, - paymentMethodId: rest[0] as string, + paymentMethodId: rest[0] as string | null, invites: rest[1] as string[], - couponId: rest[2] as string, + couponId: rest[2] as string | null, platform: rest[3] as Platform, }; } @@ -1154,18 +1165,21 @@ export class Organizations { * * @param {string} params.organizationId - Organization ID * @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/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: teamId, aggregationId, from, to + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise<Models.AggregationTeamList>} */ listAggregations(params: { organizationId: string; queries?: string[]; + total?: boolean; }): Promise<Models.AggregationTeamList>; /** * Get a list of all aggregations for an organization. * * @param {string} organizationId - Organization ID * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: teamId, aggregationId, from, to + * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise<Models.AggregationTeamList>} * @deprecated Use the object parameter style method for a better developer experience. @@ -1173,12 +1187,19 @@ export class Organizations { listAggregations( organizationId: string, queries?: string[], + total?: boolean, ): Promise<Models.AggregationTeamList>; listAggregations( - paramsOrFirst: { organizationId: string; queries?: string[] } | string, - ...rest: [string[]?] + paramsOrFirst: + | { organizationId: string; queries?: string[]; total?: boolean } + | string, + ...rest: [string[]?, boolean?] ): Promise<Models.AggregationTeamList> { - let params: { organizationId: string; queries?: string[] }; + let params: { + organizationId: string; + queries?: string[]; + total?: boolean; + }; if ( paramsOrFirst && @@ -1188,16 +1209,19 @@ export class Organizations { params = (paramsOrFirst || {}) as { organizationId: string; queries?: string[]; + total?: boolean; }; } else { params = { organizationId: paramsOrFirst as string, queries: rest[0] as string[], + total: rest[1] as boolean, }; } const organizationId = params.organizationId; const queries = params.queries; + const total = params.total; if (typeof organizationId === 'undefined' || organizationId === '') { throw new AppwriteException( @@ -1212,6 +1236,9 @@ export class Organizations { if (typeof queries !== 'undefined') { apiPayload['queries'] = queries; } + if (typeof total !== 'undefined') { + apiPayload['total'] = total; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -1882,7 +1909,7 @@ export class Organizations { * Update the budget limit for an organization. * * @param {string} params.organizationId - Organization Unique ID - * @param {number} params.budget - Budget limit for additional usage set for the organization + * @param {number | null} params.budget - Budget limit for additional usage set for the organization * @param {number[]} params.alerts - Budget alert limit percentage * @throws {AppwriteException} * @returns {Promise<Models.Organization<Preferences>>} @@ -1891,14 +1918,14 @@ export class Organizations { Preferences extends Models.Preferences = Models.DefaultPreferences, >(params: { organizationId: string; - budget?: number; + budget?: number | null; alerts?: number[]; }): Promise<Models.Organization<Preferences>>; /** * Update the budget limit for an organization. * * @param {string} organizationId - Organization Unique ID - * @param {number} budget - Budget limit for additional usage set for the organization + * @param {number | null} budget - Budget limit for additional usage set for the organization * @param {number[]} alerts - Budget alert limit percentage * @throws {AppwriteException} * @returns {Promise<Models.Organization<Preferences>>} @@ -1908,20 +1935,24 @@ export class Organizations { Preferences extends Models.Preferences = Models.DefaultPreferences, >( organizationId: string, - budget?: number, + budget?: number | null, alerts?: number[], ): Promise<Models.Organization<Preferences>>; updateBudget< Preferences extends Models.Preferences = Models.DefaultPreferences, >( paramsOrFirst: - | { organizationId: string; budget?: number; alerts?: number[] } + | { + organizationId: string; + budget?: number | null; + alerts?: number[]; + } | string, - ...rest: [number?, number[]?] + ...rest: [(number | null)?, number[]?] ): Promise<Models.Organization<Preferences>> { let params: { organizationId: string; - budget?: number; + budget?: number | null; alerts?: number[]; }; @@ -1932,13 +1963,13 @@ export class Organizations { ) { params = (paramsOrFirst || {}) as { organizationId: string; - budget?: number; + budget?: number | null; alerts?: number[]; }; } else { params = { organizationId: paramsOrFirst as string, - budget: rest[0] as number, + budget: rest[0] as number | null, alerts: rest[1] as number[], }; } @@ -2007,12 +2038,14 @@ export class Organizations { * * @param {string} params.organizationId - Organization ID * @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/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: teamId, couponId, credits, expiration, status + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise<Models.CreditList>} */ listCredits(params: { organizationId: string; queries?: string[]; + total?: boolean; }): Promise<Models.CreditList>; /** * List all credits for an organization. @@ -2020,6 +2053,7 @@ export class Organizations { * * @param {string} organizationId - Organization ID * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: teamId, couponId, credits, expiration, status + * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise<Models.CreditList>} * @deprecated Use the object parameter style method for a better developer experience. @@ -2027,12 +2061,19 @@ export class Organizations { listCredits( organizationId: string, queries?: string[], + total?: boolean, ): Promise<Models.CreditList>; listCredits( - paramsOrFirst: { organizationId: string; queries?: string[] } | string, - ...rest: [string[]?] + paramsOrFirst: + | { organizationId: string; queries?: string[]; total?: boolean } + | string, + ...rest: [string[]?, boolean?] ): Promise<Models.CreditList> { - let params: { organizationId: string; queries?: string[] }; + let params: { + organizationId: string; + queries?: string[]; + total?: boolean; + }; if ( paramsOrFirst && @@ -2042,16 +2083,19 @@ export class Organizations { params = (paramsOrFirst || {}) as { organizationId: string; queries?: string[]; + total?: boolean; }; } else { params = { organizationId: paramsOrFirst as string, queries: rest[0] as string[], + total: rest[1] as boolean, }; } const organizationId = params.organizationId; const queries = params.queries; + const total = params.total; if (typeof organizationId === 'undefined' || organizationId === '') { throw new AppwriteException( @@ -2066,6 +2110,9 @@ export class Organizations { if (typeof queries !== 'undefined') { apiPayload['queries'] = queries; } + if (typeof total !== 'undefined') { + apiPayload['total'] = total; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -2503,7 +2550,7 @@ export class Organizations { * @param {string} params.organizationId - Organization ID * @param {string} params.billingPlan - Organization billing plan chosen * @param {string[]} params.invites - Additional member invites - * @param {string} params.couponId - Coupon id + * @param {string | null} params.couponId - Coupon id * @throws {AppwriteException} * @returns {Promise<Models.EstimationUpdatePlan>} */ @@ -2511,7 +2558,7 @@ export class Organizations { organizationId: string; billingPlan: string; invites?: string[]; - couponId?: string; + couponId?: string | null; }): Promise<Models.EstimationUpdatePlan>; /** * Get estimation for updating the organization plan. @@ -2519,7 +2566,7 @@ export class Organizations { * @param {string} organizationId - Organization ID * @param {string} billingPlan - Organization billing plan chosen * @param {string[]} invites - Additional member invites - * @param {string} couponId - Coupon id + * @param {string | null} couponId - Coupon id * @throws {AppwriteException} * @returns {Promise<Models.EstimationUpdatePlan>} * @deprecated Use the object parameter style method for a better developer experience. @@ -2528,7 +2575,7 @@ export class Organizations { organizationId: string, billingPlan: string, invites?: string[], - couponId?: string, + couponId?: string | null, ): Promise<Models.EstimationUpdatePlan>; estimationUpdatePlan( paramsOrFirst: @@ -2536,16 +2583,16 @@ export class Organizations { organizationId: string; billingPlan: string; invites?: string[]; - couponId?: string; + couponId?: string | null; } | string, - ...rest: [string?, string[]?, string?] + ...rest: [string?, string[]?, (string | null)?] ): Promise<Models.EstimationUpdatePlan> { let params: { organizationId: string; billingPlan: string; invites?: string[]; - couponId?: string; + couponId?: string | null; }; if ( @@ -2557,14 +2604,14 @@ export class Organizations { organizationId: string; billingPlan: string; invites?: string[]; - couponId?: string; + couponId?: string | null; }; } else { params = { organizationId: paramsOrFirst as string, billingPlan: rest[0] as string, invites: rest[1] as string[], - couponId: rest[2] as string, + couponId: rest[2] as string | null, }; } @@ -2806,18 +2853,21 @@ export class Organizations { * * @param {string} params.organizationId - Organization ID * @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/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: teamId, aggregationId, type, amount, currency, from, to, dueAt, attempts, status, grossAmount + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise<Models.InvoiceList>} */ listInvoices(params: { organizationId: string; queries?: string[]; + total?: boolean; }): Promise<Models.InvoiceList>; /** * List all invoices for an organization. * * @param {string} organizationId - Organization ID * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: teamId, aggregationId, type, amount, currency, from, to, dueAt, attempts, status, grossAmount + * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise<Models.InvoiceList>} * @deprecated Use the object parameter style method for a better developer experience. @@ -2825,12 +2875,19 @@ export class Organizations { listInvoices( organizationId: string, queries?: string[], + total?: boolean, ): Promise<Models.InvoiceList>; listInvoices( - paramsOrFirst: { organizationId: string; queries?: string[] } | string, - ...rest: [string[]?] + paramsOrFirst: + | { organizationId: string; queries?: string[]; total?: boolean } + | string, + ...rest: [string[]?, boolean?] ): Promise<Models.InvoiceList> { - let params: { organizationId: string; queries?: string[] }; + let params: { + organizationId: string; + queries?: string[]; + total?: boolean; + }; if ( paramsOrFirst && @@ -2840,16 +2897,19 @@ export class Organizations { params = (paramsOrFirst || {}) as { organizationId: string; queries?: string[]; + total?: boolean; }; } else { params = { organizationId: paramsOrFirst as string, queries: rest[0] as string[], + total: rest[1] as boolean, }; } const organizationId = params.organizationId; const queries = params.queries; + const total = params.total; if (typeof organizationId === 'undefined' || organizationId === '') { throw new AppwriteException( @@ -2864,6 +2924,9 @@ export class Organizations { if (typeof queries !== 'undefined') { apiPayload['queries'] = queries; } + if (typeof total !== 'undefined') { + apiPayload['total'] = total; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -4115,6 +4178,7 @@ export class Organizations { deploymentSize: 0, buildSize: 0, functionsIntervalMinimum: 0, + functionsAllowCron: true, databasesAllowEncrypt: false, databaseComputeCredit: 0, }, @@ -4130,12 +4194,12 @@ export class Organizations { * * @param {string} params.organizationId - Organization Unique ID * @param {string} params.billingPlan - Organization billing plan chosen - * @param {string} params.paymentMethodId - Payment method ID. Required for pro plans when trial is not available and user doesn't have default payment method set. + * @param {string | null} params.paymentMethodId - Payment method ID. Required for pro plans when trial is not available and user doesn't have default payment method set. * @param {string} params.billingAddressId - Unique ID of billing address * @param {string[]} params.invites - Additional member invites - * @param {string} params.couponId - Coupon id - * @param {string} params.taxId - Tax Id associated to billing. - * @param {number} params.budget - Budget limit for additional usage set for the organization + * @param {string | null} params.couponId - Coupon id + * @param {string | null} params.taxId - Tax Id associated to billing. + * @param {number | null} params.budget - Budget limit for additional usage set for the organization * @throws {AppwriteException} * @returns {Promise<Models.Organization<Preferences>>} */ @@ -4144,24 +4208,24 @@ export class Organizations { >(params: { organizationId: string; billingPlan: string; - paymentMethodId?: string; + paymentMethodId?: string | null; billingAddressId?: string; invites?: string[]; - couponId?: string; - taxId?: string; - budget?: number; + couponId?: string | null; + taxId?: string | null; + budget?: number | null; }): Promise<Models.Organization<Preferences>>; /** * Update the billing plan for an organization. * * @param {string} organizationId - Organization Unique ID * @param {string} billingPlan - Organization billing plan chosen - * @param {string} paymentMethodId - Payment method ID. Required for pro plans when trial is not available and user doesn't have default payment method set. + * @param {string | null} paymentMethodId - Payment method ID. Required for pro plans when trial is not available and user doesn't have default payment method set. * @param {string} billingAddressId - Unique ID of billing address * @param {string[]} invites - Additional member invites - * @param {string} couponId - Coupon id - * @param {string} taxId - Tax Id associated to billing. - * @param {number} budget - Budget limit for additional usage set for the organization + * @param {string | null} couponId - Coupon id + * @param {string | null} taxId - Tax Id associated to billing. + * @param {number | null} budget - Budget limit for additional usage set for the organization * @throws {AppwriteException} * @returns {Promise<Models.Organization<Preferences>>} * @deprecated Use the object parameter style method for a better developer experience. @@ -4171,12 +4235,12 @@ export class Organizations { >( organizationId: string, billingPlan: string, - paymentMethodId?: string, + paymentMethodId?: string | null, billingAddressId?: string, invites?: string[], - couponId?: string, - taxId?: string, - budget?: number, + couponId?: string | null, + taxId?: string | null, + budget?: number | null, ): Promise<Models.Organization<Preferences>>; updatePlan< Preferences extends Models.Preferences = Models.DefaultPreferences, @@ -4185,33 +4249,33 @@ export class Organizations { | { organizationId: string; billingPlan: string; - paymentMethodId?: string; + paymentMethodId?: string | null; billingAddressId?: string; invites?: string[]; - couponId?: string; - taxId?: string; - budget?: number; + couponId?: string | null; + taxId?: string | null; + budget?: number | null; } | string, ...rest: [ string?, - string?, + (string | null)?, string?, string[]?, - string?, - string?, - number?, + (string | null)?, + (string | null)?, + (number | null)?, ] ): Promise<Models.Organization<Preferences>> { let params: { organizationId: string; billingPlan: string; - paymentMethodId?: string; + paymentMethodId?: string | null; billingAddressId?: string; invites?: string[]; - couponId?: string; - taxId?: string; - budget?: number; + couponId?: string | null; + taxId?: string | null; + budget?: number | null; }; if ( @@ -4222,23 +4286,23 @@ export class Organizations { params = (paramsOrFirst || {}) as { organizationId: string; billingPlan: string; - paymentMethodId?: string; + paymentMethodId?: string | null; billingAddressId?: string; invites?: string[]; - couponId?: string; - taxId?: string; - budget?: number; + couponId?: string | null; + taxId?: string | null; + budget?: number | null; }; } else { params = { organizationId: paramsOrFirst as string, billingPlan: rest[0] as string, - paymentMethodId: rest[1] as string, + paymentMethodId: rest[1] as string | null, billingAddressId: rest[2] as string, invites: rest[3] as string[], - couponId: rest[4] as string, - taxId: rest[5] as string, - budget: rest[6] as number, + couponId: rest[4] as string | null, + taxId: rest[5] as string | null, + budget: rest[6] as number | null, }; } @@ -4329,7 +4393,7 @@ export class Organizations { * @param {string} params.organizationId - Organization ID * @param {string} params.billingPlan - Target billing plan * @param {string[]} params.invites - Additional member invites - * @param {string} params.couponId - Coupon id + * @param {string | null} params.couponId - Coupon id * @throws {AppwriteException} * @returns {Promise<Models.EstimationPlanChange>} */ @@ -4337,7 +4401,7 @@ export class Organizations { organizationId: string; billingPlan: string; invites?: string[]; - couponId?: string; + couponId?: string | null; }): Promise<Models.EstimationPlanChange>; /** * Create a billing plan estimation for upgrading or downgrading an organization plan. @@ -4346,7 +4410,7 @@ export class Organizations { * @param {string} organizationId - Organization ID * @param {string} billingPlan - Target billing plan * @param {string[]} invites - Additional member invites - * @param {string} couponId - Coupon id + * @param {string | null} couponId - Coupon id * @throws {AppwriteException} * @returns {Promise<Models.EstimationPlanChange>} * @deprecated Use the object parameter style method for a better developer experience. @@ -4355,7 +4419,7 @@ export class Organizations { organizationId: string, billingPlan: string, invites?: string[], - couponId?: string, + couponId?: string | null, ): Promise<Models.EstimationPlanChange>; createPlanEstimation( paramsOrFirst: @@ -4363,16 +4427,16 @@ export class Organizations { organizationId: string; billingPlan: string; invites?: string[]; - couponId?: string; + couponId?: string | null; } | string, - ...rest: [string?, string[]?, string?] + ...rest: [string?, string[]?, (string | null)?] ): Promise<Models.EstimationPlanChange> { let params: { organizationId: string; billingPlan: string; invites?: string[]; - couponId?: string; + couponId?: string | null; }; if ( @@ -4384,14 +4448,14 @@ export class Organizations { organizationId: string; billingPlan: string; invites?: string[]; - couponId?: string; + couponId?: string | null; }; } else { params = { organizationId: paramsOrFirst as string, billingPlan: rest[0] as string, invites: rest[1] as string[], - couponId: rest[2] as string, + couponId: rest[2] as string | null, }; } @@ -4625,7 +4689,7 @@ export class Organizations { * Set an organization's billing tax ID. * * @param {string} params.organizationId - Organization ID - * @param {string} params.taxId - Tax Id associated to billing. + * @param {string | null} params.taxId - Tax Id associated to billing. * @throws {AppwriteException} * @returns {Promise<Models.Organization<Preferences>>} */ @@ -4633,13 +4697,13 @@ export class Organizations { Preferences extends Models.Preferences = Models.DefaultPreferences, >(params: { organizationId: string; - taxId?: string; + taxId?: string | null; }): Promise<Models.Organization<Preferences>>; /** * Set an organization's billing tax ID. * * @param {string} organizationId - Organization ID - * @param {string} taxId - Tax Id associated to billing. + * @param {string | null} taxId - Tax Id associated to billing. * @throws {AppwriteException} * @returns {Promise<Models.Organization<Preferences>>} * @deprecated Use the object parameter style method for a better developer experience. @@ -4648,15 +4712,16 @@ export class Organizations { Preferences extends Models.Preferences = Models.DefaultPreferences, >( organizationId: string, - taxId?: string, + taxId?: string | null, ): Promise<Models.Organization<Preferences>>; setBillingTaxId< Preferences extends Models.Preferences = Models.DefaultPreferences, >( - paramsOrFirst: { organizationId: string; taxId?: string } | string, - ...rest: [string?] + paramsOrFirst: + { organizationId: string; taxId?: string | null } | string, + ...rest: [(string | null)?] ): Promise<Models.Organization<Preferences>> { - let params: { organizationId: string; taxId?: string }; + let params: { organizationId: string; taxId?: string | null }; if ( paramsOrFirst && @@ -4665,12 +4730,12 @@ export class Organizations { ) { params = (paramsOrFirst || {}) as { organizationId: string; - taxId?: string; + taxId?: string | null; }; } else { params = { organizationId: paramsOrFirst as string, - taxId: rest[0] as string, + taxId: rest[0] as string | null, }; } diff --git a/src/services/postgresql.ts b/src/services/postgresql.ts index 60aa6541..aaa5a436 100644 --- a/src/services/postgresql.ts +++ b/src/services/postgresql.ts @@ -17,46 +17,61 @@ export class Postgresql { * List all dedicated databases. Results support pagination. * * @param {string[]} params.queries - Array of query strings. + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise<Models.DedicatedDatabaseList>} */ list(params?: { queries?: string[]; + total?: boolean; }): Promise<Models.DedicatedDatabaseList>; /** * List all dedicated databases. Results support pagination. * * @param {string[]} queries - Array of query strings. + * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise<Models.DedicatedDatabaseList>} * @deprecated Use the object parameter style method for a better developer experience. */ - list(queries?: string[]): Promise<Models.DedicatedDatabaseList>; list( - paramsOrFirst?: { queries?: string[] } | string[], + queries?: string[], + total?: boolean, + ): Promise<Models.DedicatedDatabaseList>; + list( + paramsOrFirst?: { queries?: string[]; total?: boolean } | string[], + ...rest: [boolean?] ): Promise<Models.DedicatedDatabaseList> { - let params: { queries?: string[] }; + let params: { queries?: string[]; total?: boolean }; if ( - typeof paramsOrFirst === 'undefined' || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) ) { - params = (paramsOrFirst || {}) as { queries?: string[] }; + params = (paramsOrFirst || {}) as { + queries?: string[]; + total?: boolean; + }; } else { params = { queries: paramsOrFirst as string[], + total: rest[0] as boolean, }; } const queries = params.queries; + const total = params.total; const apiPath = '/postgresql'; const apiPayload: Payload = {}; if (typeof queries !== 'undefined') { apiPayload['queries'] = queries; } + if (typeof total !== 'undefined') { + apiPayload['total'] = total; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -139,54 +154,54 @@ export class Postgresql { * * @param {string} params.databaseId - Database 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 - Database display name. Max length: 128 chars. - * @param {string} params.version - Database engine version. Defaults to latest for selected engine. + * @param {string | null} params.version - Database engine version. Defaults to latest for selected engine. * @param {string} params.specification - Specification identifier. Drives the allocated CPU, memory, storage, storage class, and connection ceiling. * @param {number} params.replicas - Number of high availability replicas (0-5). High availability is enabled when greater than 0. - * @param {string} params.syncMode - Replication sync mode preference. Allowed values: async, sync, quorum. + * @param {string | null} params.syncMode - Replication sync mode preference. Allowed values: async, sync, quorum. * @param {number} params.networkIdleTimeoutSeconds - Connection idle timeout in seconds. - * @param {string[]} params.networkIPAllowlist - IP addresses/CIDR ranges allowed to connect. + * @param {string[] | null} params.networkIPAllowlist - IP addresses/CIDR ranges allowed to connect. * @param {number} params.idleTimeoutMinutes - Minutes of inactivity before container scales to zero. * @param {boolean} params.pitr - Enable point-in-time recovery (PITR). Continuously archives changes so the database can be restored to any moment within the retention window. * @param {number} params.pitrRetentionDays - Number of days to retain PITR data. * @param {boolean} params.storageAutoscaling - Enable automatic storage expansion when usage exceeds threshold. * @param {number} params.storageAutoscalingThresholdPercent - Storage usage percentage (50-95) that triggers automatic expansion. - * @param {number} params.storageAutoscalingMaxGb - Maximum storage size in GB for autoscaling. Defaults to 3 times the specification's storage. 0 means no limit. + * @param {number | null} params.storageAutoscalingMaxGb - Maximum storage size in GB for autoscaling. Defaults to 3 times the specification's storage. 0 means no limit. * @throws {AppwriteException} * @returns {Promise<Models.DedicatedDatabase>} */ create(params: { databaseId: string; name: string; - version?: string; + version?: string | null; specification?: string; replicas?: number; - syncMode?: string; + syncMode?: string | null; networkIdleTimeoutSeconds?: number; - networkIPAllowlist?: string[]; + networkIPAllowlist?: string[] | null; idleTimeoutMinutes?: number; pitr?: boolean; pitrRetentionDays?: number; storageAutoscaling?: boolean; storageAutoscalingThresholdPercent?: number; - storageAutoscalingMaxGb?: number; + storageAutoscalingMaxGb?: number | null; }): Promise<Models.DedicatedDatabase>; /** * Create a new dedicated database with the chosen engine and configuration. Status will be 'provisioning' until the database is ready. * * @param {string} databaseId - Database 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 - Database display name. Max length: 128 chars. - * @param {string} version - Database engine version. Defaults to latest for selected engine. + * @param {string | null} version - Database engine version. Defaults to latest for selected engine. * @param {string} specification - Specification identifier. Drives the allocated CPU, memory, storage, storage class, and connection ceiling. * @param {number} replicas - Number of high availability replicas (0-5). High availability is enabled when greater than 0. - * @param {string} syncMode - Replication sync mode preference. Allowed values: async, sync, quorum. + * @param {string | null} syncMode - Replication sync mode preference. Allowed values: async, sync, quorum. * @param {number} networkIdleTimeoutSeconds - Connection idle timeout in seconds. - * @param {string[]} networkIPAllowlist - IP addresses/CIDR ranges allowed to connect. + * @param {string[] | null} networkIPAllowlist - IP addresses/CIDR ranges allowed to connect. * @param {number} idleTimeoutMinutes - Minutes of inactivity before container scales to zero. * @param {boolean} pitr - Enable point-in-time recovery (PITR). Continuously archives changes so the database can be restored to any moment within the retention window. * @param {number} pitrRetentionDays - Number of days to retain PITR data. * @param {boolean} storageAutoscaling - Enable automatic storage expansion when usage exceeds threshold. * @param {number} storageAutoscalingThresholdPercent - Storage usage percentage (50-95) that triggers automatic expansion. - * @param {number} storageAutoscalingMaxGb - Maximum storage size in GB for autoscaling. Defaults to 3 times the specification's storage. 0 means no limit. + * @param {number | null} storageAutoscalingMaxGb - Maximum storage size in GB for autoscaling. Defaults to 3 times the specification's storage. 0 means no limit. * @throws {AppwriteException} * @returns {Promise<Models.DedicatedDatabase>} * @deprecated Use the object parameter style method for a better developer experience. @@ -194,69 +209,69 @@ export class Postgresql { create( databaseId: string, name: string, - version?: string, + version?: string | null, specification?: string, replicas?: number, - syncMode?: string, + syncMode?: string | null, networkIdleTimeoutSeconds?: number, - networkIPAllowlist?: string[], + networkIPAllowlist?: string[] | null, idleTimeoutMinutes?: number, pitr?: boolean, pitrRetentionDays?: number, storageAutoscaling?: boolean, storageAutoscalingThresholdPercent?: number, - storageAutoscalingMaxGb?: number, + storageAutoscalingMaxGb?: number | null, ): Promise<Models.DedicatedDatabase>; create( paramsOrFirst: | { databaseId: string; name: string; - version?: string; + version?: string | null; specification?: string; replicas?: number; - syncMode?: string; + syncMode?: string | null; networkIdleTimeoutSeconds?: number; - networkIPAllowlist?: string[]; + networkIPAllowlist?: string[] | null; idleTimeoutMinutes?: number; pitr?: boolean; pitrRetentionDays?: number; storageAutoscaling?: boolean; storageAutoscalingThresholdPercent?: number; - storageAutoscalingMaxGb?: number; + storageAutoscalingMaxGb?: number | null; } | string, ...rest: [ string?, - string?, + (string | null)?, string?, number?, - string?, + (string | null)?, number?, - string[]?, + (string[] | null)?, number?, boolean?, number?, boolean?, number?, - number?, + (number | null)?, ] ): Promise<Models.DedicatedDatabase> { let params: { databaseId: string; name: string; - version?: string; + version?: string | null; specification?: string; replicas?: number; - syncMode?: string; + syncMode?: string | null; networkIdleTimeoutSeconds?: number; - networkIPAllowlist?: string[]; + networkIPAllowlist?: string[] | null; idleTimeoutMinutes?: number; pitr?: boolean; pitrRetentionDays?: number; storageAutoscaling?: boolean; storageAutoscalingThresholdPercent?: number; - storageAutoscalingMaxGb?: number; + storageAutoscalingMaxGb?: number | null; }; if ( @@ -267,35 +282,35 @@ export class Postgresql { params = (paramsOrFirst || {}) as { databaseId: string; name: string; - version?: string; + version?: string | null; specification?: string; replicas?: number; - syncMode?: string; + syncMode?: string | null; networkIdleTimeoutSeconds?: number; - networkIPAllowlist?: string[]; + networkIPAllowlist?: string[] | null; idleTimeoutMinutes?: number; pitr?: boolean; pitrRetentionDays?: number; storageAutoscaling?: boolean; storageAutoscalingThresholdPercent?: number; - storageAutoscalingMaxGb?: number; + storageAutoscalingMaxGb?: number | null; }; } else { params = { databaseId: paramsOrFirst as string, name: rest[0] as string, - version: rest[1] as string, + version: rest[1] as string | null, specification: rest[2] as string, replicas: rest[3] as number, - syncMode: rest[4] as string, + syncMode: rest[4] as string | null, networkIdleTimeoutSeconds: rest[5] as number, - networkIPAllowlist: rest[6] as string[], + networkIPAllowlist: rest[6] as string[] | null, idleTimeoutMinutes: rest[7] as number, pitr: rest[8] as boolean, pitrRetentionDays: rest[9] as number, storageAutoscaling: rest[10] as boolean, storageAutoscalingThresholdPercent: rest[11] as number, - storageAutoscalingMaxGb: rest[12] as number, + storageAutoscalingMaxGb: rest[12] as number | null, }; } @@ -605,174 +620,174 @@ export class Postgresql { * Update a dedicated database configuration. All changes are applied with zero downtime. Specification changes (cpu, memory, storage) are handled via rolling cutover. Storage expansion is done online. All other settings are applied in-place. * * @param {string} params.databaseId - Database ID. - * @param {string} params.name - Database display name. - * @param {string} params.status - Database status. Allowed values: ready, paused, inactive. Set to "paused" to pause, "ready" to resume (also recovers a failed database whose infrastructure is healthy), or "inactive" to spin down a shared-pool database. - * @param {string} params.specification - Specification. Changes cpu, memory, storage, connection ceiling, and node pool based on specification config. Resource changes are applied via rolling cutover with zero downtime. - * @param {number} params.replicas - Number of high availability replicas (0-5). High availability is enabled when greater than 0. - * @param {string} params.syncMode - Replication sync mode preference. Allowed values: async, sync, quorum. - * @param {number} params.networkIdleTimeoutSeconds - Connection idle timeout in seconds (60-86400). - * @param {string[]} params.networkIPAllowlist - IP addresses/CIDR ranges allowed to connect. - * @param {number} params.idleTimeoutMinutes - Minutes before container scales to zero. - * @param {boolean} params.pitr - Enable or disable point-in-time recovery (PITR). - * @param {number} params.pitrRetentionDays - Days to retain PITR data. - * @param {boolean} params.storageAutoscaling - Enable automatic storage expansion when usage exceeds threshold. - * @param {number} params.storageAutoscalingThresholdPercent - Storage usage percentage (50-95) that triggers automatic expansion. - * @param {number} params.storageAutoscalingMaxGb - Maximum storage size in GB for autoscaling. 0 means no limit. - * @param {number} params.metricsTraceSampleRate - Fraction of queries to trace (0.0–1.0). Forwarded to the sidecar. - * @param {number} params.metricsSlowQueryLogThresholdMs - Threshold in ms above which queries are logged as slow. Forwarded to the sidecar. - * @param {boolean} params.sqlApiEnabled - Enable the SQL API sidecar for this database. - * @param {string[]} params.sqlApiAllowedStatements - Statement types the SQL API accepts. Allowed values: SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, TRUNCATE, GRANT, REVOKE. - * @param {number} params.sqlApiMaxRows - Maximum rows returned per SQL API execution (1-1000000). - * @param {number} params.sqlApiMaxBytes - Maximum serialised SQL API result payload in bytes (1024-104857600). - * @param {number} params.sqlApiTimeoutSeconds - Per-call SQL API execution timeout in seconds (1-300). + * @param {string | null} params.name - Database display name. + * @param {string | null} params.status - Database status. Allowed values: ready, paused, inactive. Set to "paused" to pause, "ready" to resume (also recovers a failed database whose infrastructure is healthy), or "inactive" to spin down a shared-pool database. + * @param {string | null} params.specification - Specification. Changes cpu, memory, storage, connection ceiling, and node pool based on specification config. Resource changes are applied via rolling cutover with zero downtime. + * @param {number | null} params.replicas - Number of high availability replicas (0-5). High availability is enabled when greater than 0. + * @param {string | null} params.syncMode - Replication sync mode preference. Allowed values: async, sync, quorum. + * @param {number | null} params.networkIdleTimeoutSeconds - Connection idle timeout in seconds (60-86400). + * @param {string[] | null} params.networkIPAllowlist - IP addresses/CIDR ranges allowed to connect. + * @param {number | null} params.idleTimeoutMinutes - Minutes before container scales to zero. + * @param {boolean | null} params.pitr - Enable or disable point-in-time recovery (PITR). + * @param {number | null} params.pitrRetentionDays - Days to retain PITR data. + * @param {boolean | null} params.storageAutoscaling - Enable automatic storage expansion when usage exceeds threshold. + * @param {number | null} params.storageAutoscalingThresholdPercent - Storage usage percentage (50-95) that triggers automatic expansion. + * @param {number | null} params.storageAutoscalingMaxGb - Maximum storage size in GB for autoscaling. 0 means no limit. + * @param {number | null} params.metricsTraceSampleRate - Fraction of queries to trace (0.0–1.0). Forwarded to the sidecar. + * @param {number | null} params.metricsSlowQueryLogThresholdMs - Threshold in ms above which queries are logged as slow. Forwarded to the sidecar. + * @param {boolean | null} params.sqlApiEnabled - Enable the SQL API sidecar for this database. + * @param {string[] | null} params.sqlApiAllowedStatements - Statement types the SQL API accepts. Allowed values: SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, TRUNCATE, GRANT, REVOKE. + * @param {number | null} params.sqlApiMaxRows - Maximum rows returned per SQL API execution (1-1000000). + * @param {number | null} params.sqlApiMaxBytes - Maximum serialised SQL API result payload in bytes (1024-104857600). + * @param {number | null} params.sqlApiTimeoutSeconds - Per-call SQL API execution timeout in seconds (1-300). * @throws {AppwriteException} * @returns {Promise<Models.DedicatedDatabase>} */ update(params: { databaseId: string; - name?: string; - status?: string; - specification?: string; - replicas?: number; - syncMode?: string; - networkIdleTimeoutSeconds?: number; - networkIPAllowlist?: string[]; - idleTimeoutMinutes?: number; - pitr?: boolean; - pitrRetentionDays?: number; - storageAutoscaling?: boolean; - storageAutoscalingThresholdPercent?: number; - storageAutoscalingMaxGb?: number; - metricsTraceSampleRate?: number; - metricsSlowQueryLogThresholdMs?: number; - sqlApiEnabled?: boolean; - sqlApiAllowedStatements?: string[]; - sqlApiMaxRows?: number; - sqlApiMaxBytes?: number; - sqlApiTimeoutSeconds?: number; + name?: string | null; + status?: string | null; + specification?: string | null; + replicas?: number | null; + syncMode?: string | null; + networkIdleTimeoutSeconds?: number | null; + networkIPAllowlist?: string[] | null; + idleTimeoutMinutes?: number | null; + pitr?: boolean | null; + pitrRetentionDays?: number | null; + storageAutoscaling?: boolean | null; + storageAutoscalingThresholdPercent?: number | null; + storageAutoscalingMaxGb?: number | null; + metricsTraceSampleRate?: number | null; + metricsSlowQueryLogThresholdMs?: number | null; + sqlApiEnabled?: boolean | null; + sqlApiAllowedStatements?: string[] | null; + sqlApiMaxRows?: number | null; + sqlApiMaxBytes?: number | null; + sqlApiTimeoutSeconds?: number | null; }): Promise<Models.DedicatedDatabase>; /** * Update a dedicated database configuration. All changes are applied with zero downtime. Specification changes (cpu, memory, storage) are handled via rolling cutover. Storage expansion is done online. All other settings are applied in-place. * * @param {string} databaseId - Database ID. - * @param {string} name - Database display name. - * @param {string} status - Database status. Allowed values: ready, paused, inactive. Set to "paused" to pause, "ready" to resume (also recovers a failed database whose infrastructure is healthy), or "inactive" to spin down a shared-pool database. - * @param {string} specification - Specification. Changes cpu, memory, storage, connection ceiling, and node pool based on specification config. Resource changes are applied via rolling cutover with zero downtime. - * @param {number} replicas - Number of high availability replicas (0-5). High availability is enabled when greater than 0. - * @param {string} syncMode - Replication sync mode preference. Allowed values: async, sync, quorum. - * @param {number} networkIdleTimeoutSeconds - Connection idle timeout in seconds (60-86400). - * @param {string[]} networkIPAllowlist - IP addresses/CIDR ranges allowed to connect. - * @param {number} idleTimeoutMinutes - Minutes before container scales to zero. - * @param {boolean} pitr - Enable or disable point-in-time recovery (PITR). - * @param {number} pitrRetentionDays - Days to retain PITR data. - * @param {boolean} storageAutoscaling - Enable automatic storage expansion when usage exceeds threshold. - * @param {number} storageAutoscalingThresholdPercent - Storage usage percentage (50-95) that triggers automatic expansion. - * @param {number} storageAutoscalingMaxGb - Maximum storage size in GB for autoscaling. 0 means no limit. - * @param {number} metricsTraceSampleRate - Fraction of queries to trace (0.0–1.0). Forwarded to the sidecar. - * @param {number} metricsSlowQueryLogThresholdMs - Threshold in ms above which queries are logged as slow. Forwarded to the sidecar. - * @param {boolean} sqlApiEnabled - Enable the SQL API sidecar for this database. - * @param {string[]} sqlApiAllowedStatements - Statement types the SQL API accepts. Allowed values: SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, TRUNCATE, GRANT, REVOKE. - * @param {number} sqlApiMaxRows - Maximum rows returned per SQL API execution (1-1000000). - * @param {number} sqlApiMaxBytes - Maximum serialised SQL API result payload in bytes (1024-104857600). - * @param {number} sqlApiTimeoutSeconds - Per-call SQL API execution timeout in seconds (1-300). + * @param {string | null} name - Database display name. + * @param {string | null} status - Database status. Allowed values: ready, paused, inactive. Set to "paused" to pause, "ready" to resume (also recovers a failed database whose infrastructure is healthy), or "inactive" to spin down a shared-pool database. + * @param {string | null} specification - Specification. Changes cpu, memory, storage, connection ceiling, and node pool based on specification config. Resource changes are applied via rolling cutover with zero downtime. + * @param {number | null} replicas - Number of high availability replicas (0-5). High availability is enabled when greater than 0. + * @param {string | null} syncMode - Replication sync mode preference. Allowed values: async, sync, quorum. + * @param {number | null} networkIdleTimeoutSeconds - Connection idle timeout in seconds (60-86400). + * @param {string[] | null} networkIPAllowlist - IP addresses/CIDR ranges allowed to connect. + * @param {number | null} idleTimeoutMinutes - Minutes before container scales to zero. + * @param {boolean | null} pitr - Enable or disable point-in-time recovery (PITR). + * @param {number | null} pitrRetentionDays - Days to retain PITR data. + * @param {boolean | null} storageAutoscaling - Enable automatic storage expansion when usage exceeds threshold. + * @param {number | null} storageAutoscalingThresholdPercent - Storage usage percentage (50-95) that triggers automatic expansion. + * @param {number | null} storageAutoscalingMaxGb - Maximum storage size in GB for autoscaling. 0 means no limit. + * @param {number | null} metricsTraceSampleRate - Fraction of queries to trace (0.0–1.0). Forwarded to the sidecar. + * @param {number | null} metricsSlowQueryLogThresholdMs - Threshold in ms above which queries are logged as slow. Forwarded to the sidecar. + * @param {boolean | null} sqlApiEnabled - Enable the SQL API sidecar for this database. + * @param {string[] | null} sqlApiAllowedStatements - Statement types the SQL API accepts. Allowed values: SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, TRUNCATE, GRANT, REVOKE. + * @param {number | null} sqlApiMaxRows - Maximum rows returned per SQL API execution (1-1000000). + * @param {number | null} sqlApiMaxBytes - Maximum serialised SQL API result payload in bytes (1024-104857600). + * @param {number | null} sqlApiTimeoutSeconds - Per-call SQL API execution timeout in seconds (1-300). * @throws {AppwriteException} * @returns {Promise<Models.DedicatedDatabase>} * @deprecated Use the object parameter style method for a better developer experience. */ update( databaseId: string, - name?: string, - status?: string, - specification?: string, - replicas?: number, - syncMode?: string, - networkIdleTimeoutSeconds?: number, - networkIPAllowlist?: string[], - idleTimeoutMinutes?: number, - pitr?: boolean, - pitrRetentionDays?: number, - storageAutoscaling?: boolean, - storageAutoscalingThresholdPercent?: number, - storageAutoscalingMaxGb?: number, - metricsTraceSampleRate?: number, - metricsSlowQueryLogThresholdMs?: number, - sqlApiEnabled?: boolean, - sqlApiAllowedStatements?: string[], - sqlApiMaxRows?: number, - sqlApiMaxBytes?: number, - sqlApiTimeoutSeconds?: number, + name?: string | null, + status?: string | null, + specification?: string | null, + replicas?: number | null, + syncMode?: string | null, + networkIdleTimeoutSeconds?: number | null, + networkIPAllowlist?: string[] | null, + idleTimeoutMinutes?: number | null, + pitr?: boolean | null, + pitrRetentionDays?: number | null, + storageAutoscaling?: boolean | null, + storageAutoscalingThresholdPercent?: number | null, + storageAutoscalingMaxGb?: number | null, + metricsTraceSampleRate?: number | null, + metricsSlowQueryLogThresholdMs?: number | null, + sqlApiEnabled?: boolean | null, + sqlApiAllowedStatements?: string[] | null, + sqlApiMaxRows?: number | null, + sqlApiMaxBytes?: number | null, + sqlApiTimeoutSeconds?: number | null, ): Promise<Models.DedicatedDatabase>; update( paramsOrFirst: | { databaseId: string; - name?: string; - status?: string; - specification?: string; - replicas?: number; - syncMode?: string; - networkIdleTimeoutSeconds?: number; - networkIPAllowlist?: string[]; - idleTimeoutMinutes?: number; - pitr?: boolean; - pitrRetentionDays?: number; - storageAutoscaling?: boolean; - storageAutoscalingThresholdPercent?: number; - storageAutoscalingMaxGb?: number; - metricsTraceSampleRate?: number; - metricsSlowQueryLogThresholdMs?: number; - sqlApiEnabled?: boolean; - sqlApiAllowedStatements?: string[]; - sqlApiMaxRows?: number; - sqlApiMaxBytes?: number; - sqlApiTimeoutSeconds?: number; + name?: string | null; + status?: string | null; + specification?: string | null; + replicas?: number | null; + syncMode?: string | null; + networkIdleTimeoutSeconds?: number | null; + networkIPAllowlist?: string[] | null; + idleTimeoutMinutes?: number | null; + pitr?: boolean | null; + pitrRetentionDays?: number | null; + storageAutoscaling?: boolean | null; + storageAutoscalingThresholdPercent?: number | null; + storageAutoscalingMaxGb?: number | null; + metricsTraceSampleRate?: number | null; + metricsSlowQueryLogThresholdMs?: number | null; + sqlApiEnabled?: boolean | null; + sqlApiAllowedStatements?: string[] | null; + sqlApiMaxRows?: number | null; + sqlApiMaxBytes?: number | null; + sqlApiTimeoutSeconds?: number | null; } | string, ...rest: [ - string?, - string?, - string?, - number?, - string?, - number?, - string[]?, - number?, - boolean?, - number?, - boolean?, - number?, - number?, - number?, - number?, - boolean?, - string[]?, - number?, - number?, - number?, + (string | null)?, + (string | null)?, + (string | null)?, + (number | null)?, + (string | null)?, + (number | null)?, + (string[] | null)?, + (number | null)?, + (boolean | null)?, + (number | null)?, + (boolean | null)?, + (number | null)?, + (number | null)?, + (number | null)?, + (number | null)?, + (boolean | null)?, + (string[] | null)?, + (number | null)?, + (number | null)?, + (number | null)?, ] ): Promise<Models.DedicatedDatabase> { let params: { databaseId: string; - name?: string; - status?: string; - specification?: string; - replicas?: number; - syncMode?: string; - networkIdleTimeoutSeconds?: number; - networkIPAllowlist?: string[]; - idleTimeoutMinutes?: number; - pitr?: boolean; - pitrRetentionDays?: number; - storageAutoscaling?: boolean; - storageAutoscalingThresholdPercent?: number; - storageAutoscalingMaxGb?: number; - metricsTraceSampleRate?: number; - metricsSlowQueryLogThresholdMs?: number; - sqlApiEnabled?: boolean; - sqlApiAllowedStatements?: string[]; - sqlApiMaxRows?: number; - sqlApiMaxBytes?: number; - sqlApiTimeoutSeconds?: number; + name?: string | null; + status?: string | null; + specification?: string | null; + replicas?: number | null; + syncMode?: string | null; + networkIdleTimeoutSeconds?: number | null; + networkIPAllowlist?: string[] | null; + idleTimeoutMinutes?: number | null; + pitr?: boolean | null; + pitrRetentionDays?: number | null; + storageAutoscaling?: boolean | null; + storageAutoscalingThresholdPercent?: number | null; + storageAutoscalingMaxGb?: number | null; + metricsTraceSampleRate?: number | null; + metricsSlowQueryLogThresholdMs?: number | null; + sqlApiEnabled?: boolean | null; + sqlApiAllowedStatements?: string[] | null; + sqlApiMaxRows?: number | null; + sqlApiMaxBytes?: number | null; + sqlApiTimeoutSeconds?: number | null; }; if ( @@ -782,50 +797,50 @@ export class Postgresql { ) { params = (paramsOrFirst || {}) as { databaseId: string; - name?: string; - status?: string; - specification?: string; - replicas?: number; - syncMode?: string; - networkIdleTimeoutSeconds?: number; - networkIPAllowlist?: string[]; - idleTimeoutMinutes?: number; - pitr?: boolean; - pitrRetentionDays?: number; - storageAutoscaling?: boolean; - storageAutoscalingThresholdPercent?: number; - storageAutoscalingMaxGb?: number; - metricsTraceSampleRate?: number; - metricsSlowQueryLogThresholdMs?: number; - sqlApiEnabled?: boolean; - sqlApiAllowedStatements?: string[]; - sqlApiMaxRows?: number; - sqlApiMaxBytes?: number; - sqlApiTimeoutSeconds?: number; + name?: string | null; + status?: string | null; + specification?: string | null; + replicas?: number | null; + syncMode?: string | null; + networkIdleTimeoutSeconds?: number | null; + networkIPAllowlist?: string[] | null; + idleTimeoutMinutes?: number | null; + pitr?: boolean | null; + pitrRetentionDays?: number | null; + storageAutoscaling?: boolean | null; + storageAutoscalingThresholdPercent?: number | null; + storageAutoscalingMaxGb?: number | null; + metricsTraceSampleRate?: number | null; + metricsSlowQueryLogThresholdMs?: number | null; + sqlApiEnabled?: boolean | null; + sqlApiAllowedStatements?: string[] | null; + sqlApiMaxRows?: number | null; + sqlApiMaxBytes?: number | null; + sqlApiTimeoutSeconds?: number | null; }; } else { params = { databaseId: paramsOrFirst as string, - name: rest[0] as string, - status: rest[1] as string, - specification: rest[2] as string, - replicas: rest[3] as number, - syncMode: rest[4] as string, - networkIdleTimeoutSeconds: rest[5] as number, - networkIPAllowlist: rest[6] as string[], - idleTimeoutMinutes: rest[7] as number, - pitr: rest[8] as boolean, - pitrRetentionDays: rest[9] as number, - storageAutoscaling: rest[10] as boolean, - storageAutoscalingThresholdPercent: rest[11] as number, - storageAutoscalingMaxGb: rest[12] as number, - metricsTraceSampleRate: rest[13] as number, - metricsSlowQueryLogThresholdMs: rest[14] as number, - sqlApiEnabled: rest[15] as boolean, - sqlApiAllowedStatements: rest[16] as string[], - sqlApiMaxRows: rest[17] as number, - sqlApiMaxBytes: rest[18] as number, - sqlApiTimeoutSeconds: rest[19] as number, + name: rest[0] as string | null, + status: rest[1] as string | null, + specification: rest[2] as string | null, + replicas: rest[3] as number | null, + syncMode: rest[4] as string | null, + networkIdleTimeoutSeconds: rest[5] as number | null, + networkIPAllowlist: rest[6] as string[] | null, + idleTimeoutMinutes: rest[7] as number | null, + pitr: rest[8] as boolean | null, + pitrRetentionDays: rest[9] as number | null, + storageAutoscaling: rest[10] as boolean | null, + storageAutoscalingThresholdPercent: rest[11] as number | null, + storageAutoscalingMaxGb: rest[12] as number | null, + metricsTraceSampleRate: rest[13] as number | null, + metricsSlowQueryLogThresholdMs: rest[14] as number | null, + sqlApiEnabled: rest[15] as boolean | null, + sqlApiAllowedStatements: rest[16] as string[] | null, + sqlApiMaxRows: rest[17] as number | null, + sqlApiMaxBytes: rest[18] as number | null, + sqlApiTimeoutSeconds: rest[19] as number | null, }; } @@ -1052,18 +1067,21 @@ export class Postgresql { * * @param {string} params.databaseId - Database ID. * @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. You may filter on the following attributes: status, type, databaseId + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise<Models.DedicatedDatabaseBackupList>} */ listBackups(params: { databaseId: string; queries?: string[]; + total?: boolean; }): Promise<Models.DedicatedDatabaseBackupList>; /** * List all backups for a dedicated database. Results can be filtered by status and type. * * @param {string} databaseId - Database ID. * @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. You may filter on the following attributes: status, type, databaseId + * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise<Models.DedicatedDatabaseBackupList>} * @deprecated Use the object parameter style method for a better developer experience. @@ -1071,12 +1089,15 @@ export class Postgresql { listBackups( databaseId: string, queries?: string[], + total?: boolean, ): Promise<Models.DedicatedDatabaseBackupList>; listBackups( - paramsOrFirst: { databaseId: string; queries?: string[] } | string, - ...rest: [string[]?] + paramsOrFirst: + | { databaseId: string; queries?: string[]; total?: boolean } + | string, + ...rest: [string[]?, boolean?] ): Promise<Models.DedicatedDatabaseBackupList> { - let params: { databaseId: string; queries?: string[] }; + let params: { databaseId: string; queries?: string[]; total?: boolean }; if ( paramsOrFirst && @@ -1086,16 +1107,19 @@ export class Postgresql { params = (paramsOrFirst || {}) as { databaseId: string; queries?: string[]; + total?: boolean; }; } else { params = { databaseId: paramsOrFirst as string, queries: rest[0] as string[], + total: rest[1] as boolean, }; } const databaseId = params.databaseId; const queries = params.queries; + const total = params.total; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -1110,6 +1134,9 @@ export class Postgresql { if (typeof queries !== 'undefined') { apiPayload['queries'] = queries; } + if (typeof total !== 'undefined') { + apiPayload['total'] = total; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -1256,18 +1283,21 @@ export class Postgresql { * * @param {string} params.databaseId - Database ID. * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise<Models.BackupPolicyList>} */ listBackupPolicies(params: { databaseId: string; queries?: string[]; + total?: boolean; }): Promise<Models.BackupPolicyList>; /** * List scheduled backup policies for a dedicated database. * * @param {string} databaseId - Database ID. * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. + * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise<Models.BackupPolicyList>} * @deprecated Use the object parameter style method for a better developer experience. @@ -1275,12 +1305,15 @@ export class Postgresql { listBackupPolicies( databaseId: string, queries?: string[], + total?: boolean, ): Promise<Models.BackupPolicyList>; listBackupPolicies( - paramsOrFirst: { databaseId: string; queries?: string[] } | string, - ...rest: [string[]?] + paramsOrFirst: + | { databaseId: string; queries?: string[]; total?: boolean } + | string, + ...rest: [string[]?, boolean?] ): Promise<Models.BackupPolicyList> { - let params: { databaseId: string; queries?: string[] }; + let params: { databaseId: string; queries?: string[]; total?: boolean }; if ( paramsOrFirst && @@ -1290,16 +1323,19 @@ export class Postgresql { params = (paramsOrFirst || {}) as { databaseId: string; queries?: string[]; + total?: boolean; }; } else { params = { databaseId: paramsOrFirst as string, queries: rest[0] as string[], + total: rest[1] as boolean, }; } const databaseId = params.databaseId; const queries = params.queries; + const total = params.total; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -1314,6 +1350,9 @@ export class Postgresql { if (typeof queries !== 'undefined') { apiPayload['queries'] = queries; } + if (typeof total !== 'undefined') { + apiPayload['total'] = total; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -1637,30 +1676,30 @@ export class Postgresql { * * @param {string} params.databaseId - Database ID. * @param {string} params.policyId - Policy ID. - * @param {string} params.name - Policy name. Max length: 128 chars. + * @param {string | null} params.name - Policy name. Max length: 128 chars. * @param {string} params.schedule - Schedule CRON syntax. - * @param {number} params.retention - Days to keep backups before deletion. - * @param {boolean} params.enabled - Is policy enabled? When disabled, no backups will be taken. + * @param {number | null} params.retention - Days to keep backups before deletion. + * @param {boolean | null} params.enabled - Is policy enabled? When disabled, no backups will be taken. * @throws {AppwriteException} * @returns {Promise<Models.BackupPolicy>} */ updateBackupPolicy(params: { databaseId: string; policyId: string; - name?: string; + name?: string | null; schedule?: string; - retention?: number; - enabled?: boolean; + retention?: number | null; + enabled?: boolean | null; }): Promise<Models.BackupPolicy>; /** * Update a scheduled backup policy for a dedicated database. * * @param {string} databaseId - Database ID. * @param {string} policyId - Policy ID. - * @param {string} name - Policy name. Max length: 128 chars. + * @param {string | null} name - Policy name. Max length: 128 chars. * @param {string} schedule - Schedule CRON syntax. - * @param {number} retention - Days to keep backups before deletion. - * @param {boolean} enabled - Is policy enabled? When disabled, no backups will be taken. + * @param {number | null} retention - Days to keep backups before deletion. + * @param {boolean | null} enabled - Is policy enabled? When disabled, no backups will be taken. * @throws {AppwriteException} * @returns {Promise<Models.BackupPolicy>} * @deprecated Use the object parameter style method for a better developer experience. @@ -1668,31 +1707,37 @@ export class Postgresql { updateBackupPolicy( databaseId: string, policyId: string, - name?: string, + name?: string | null, schedule?: string, - retention?: number, - enabled?: boolean, + retention?: number | null, + enabled?: boolean | null, ): Promise<Models.BackupPolicy>; updateBackupPolicy( paramsOrFirst: | { databaseId: string; policyId: string; - name?: string; + name?: string | null; schedule?: string; - retention?: number; - enabled?: boolean; + retention?: number | null; + enabled?: boolean | null; } | string, - ...rest: [string?, string?, string?, number?, boolean?] + ...rest: [ + string?, + (string | null)?, + string?, + (number | null)?, + (boolean | null)?, + ] ): Promise<Models.BackupPolicy> { let params: { databaseId: string; policyId: string; - name?: string; + name?: string | null; schedule?: string; - retention?: number; - enabled?: boolean; + retention?: number | null; + enabled?: boolean | null; }; if ( @@ -1703,19 +1748,19 @@ export class Postgresql { params = (paramsOrFirst || {}) as { databaseId: string; policyId: string; - name?: string; + name?: string | null; schedule?: string; - retention?: number; - enabled?: boolean; + retention?: number | null; + enabled?: boolean | null; }; } else { params = { databaseId: paramsOrFirst as string, policyId: rest[0] as string, - name: rest[1] as string, + name: rest[1] as string | null, schedule: rest[2] as string, - retention: rest[3] as number, - enabled: rest[4] as boolean, + retention: rest[3] as number | null, + enabled: rest[4] as boolean | null, }; } @@ -2656,28 +2701,28 @@ export class Postgresql { } /** - * Execute SQL through the console-facing Cloud endpoint. Cloud proxies through the edge platform to the per-database SQL API sidecar. Application traffic should bypass cloud entirely and POST directly to the per-database hostname: `https://db-{project}-{db}.{region}.appwrite.center/v1/sql/executions` with an `X-Appwrite-Key` header — that path scales to the whole DB fleet without a per-query cloud round-trip. The statement type must be on the database's configured allow-list. Use bound parameters for any user-supplied values — the API does not interpolate raw strings. + * Execute SQL through the console-facing Cloud endpoint. Cloud proxies through the edge platform to the per-database SQL API sidecar. Application traffic should bypass cloud entirely and POST directly to the per-database hostname: `https://db-{project}-{db}.{region}.appwrite.center/v1/sql/executions` with an `X-Appwrite-Key` header — that path scales to the whole DB fleet without a per-query cloud round-trip. The statement type must be on the database's configured allow-list. Use bound parameters for any user-supplied values — the API does not interpolate raw strings. Long-running statements (for example CREATE INDEX) can outlive the HTTP request: if the request ends before a result is returned, check the database before retrying, and prefer a direct connection for work that may take minutes. * * @param {string} params.databaseId - Database ID. * @param {string} params.sql - SQL statement to execute. Exactly one statement per request. - * @param {object} params.bindings - Optional bound parameters. Pass either a positional list or a name => value map matching the placeholder style used in the SQL. - * @param {number} params.timeoutSeconds - Per-call execution timeout override. Must be less than or equal to the database's configured sqlApiTimeoutSeconds. + * @param {object | null} params.bindings - Optional bound parameters. Pass either a positional list or a name => value map matching the placeholder style used in the SQL. + * @param {number | null} params.timeoutSeconds - Per-call execution timeout override. Must be less than or equal to the database's configured sqlApiTimeoutSeconds. Statements that may exceed this — or the HTTP request timeout in front of Cloud — should use a direct connection instead. * @throws {AppwriteException} * @returns {Promise<Models.DedicatedDatabaseExecution>} */ createExecution(params: { databaseId: string; sql: string; - bindings?: object; - timeoutSeconds?: number; + bindings?: object | null; + timeoutSeconds?: number | null; }): Promise<Models.DedicatedDatabaseExecution>; /** - * Execute SQL through the console-facing Cloud endpoint. Cloud proxies through the edge platform to the per-database SQL API sidecar. Application traffic should bypass cloud entirely and POST directly to the per-database hostname: `https://db-{project}-{db}.{region}.appwrite.center/v1/sql/executions` with an `X-Appwrite-Key` header — that path scales to the whole DB fleet without a per-query cloud round-trip. The statement type must be on the database's configured allow-list. Use bound parameters for any user-supplied values — the API does not interpolate raw strings. + * Execute SQL through the console-facing Cloud endpoint. Cloud proxies through the edge platform to the per-database SQL API sidecar. Application traffic should bypass cloud entirely and POST directly to the per-database hostname: `https://db-{project}-{db}.{region}.appwrite.center/v1/sql/executions` with an `X-Appwrite-Key` header — that path scales to the whole DB fleet without a per-query cloud round-trip. The statement type must be on the database's configured allow-list. Use bound parameters for any user-supplied values — the API does not interpolate raw strings. Long-running statements (for example CREATE INDEX) can outlive the HTTP request: if the request ends before a result is returned, check the database before retrying, and prefer a direct connection for work that may take minutes. * * @param {string} databaseId - Database ID. * @param {string} sql - SQL statement to execute. Exactly one statement per request. - * @param {object} bindings - Optional bound parameters. Pass either a positional list or a name => value map matching the placeholder style used in the SQL. - * @param {number} timeoutSeconds - Per-call execution timeout override. Must be less than or equal to the database's configured sqlApiTimeoutSeconds. + * @param {object | null} bindings - Optional bound parameters. Pass either a positional list or a name => value map matching the placeholder style used in the SQL. + * @param {number | null} timeoutSeconds - Per-call execution timeout override. Must be less than or equal to the database's configured sqlApiTimeoutSeconds. Statements that may exceed this — or the HTTP request timeout in front of Cloud — should use a direct connection instead. * @throws {AppwriteException} * @returns {Promise<Models.DedicatedDatabaseExecution>} * @deprecated Use the object parameter style method for a better developer experience. @@ -2685,25 +2730,25 @@ export class Postgresql { createExecution( databaseId: string, sql: string, - bindings?: object, - timeoutSeconds?: number, + bindings?: object | null, + timeoutSeconds?: number | null, ): Promise<Models.DedicatedDatabaseExecution>; createExecution( paramsOrFirst: | { databaseId: string; sql: string; - bindings?: object; - timeoutSeconds?: number; + bindings?: object | null; + timeoutSeconds?: number | null; } | string, - ...rest: [string?, object?, number?] + ...rest: [string?, (object | null)?, (number | null)?] ): Promise<Models.DedicatedDatabaseExecution> { let params: { databaseId: string; sql: string; - bindings?: object; - timeoutSeconds?: number; + bindings?: object | null; + timeoutSeconds?: number | null; }; if ( @@ -2714,15 +2759,15 @@ export class Postgresql { params = (paramsOrFirst || {}) as { databaseId: string; sql: string; - bindings?: object; - timeoutSeconds?: number; + bindings?: object | null; + timeoutSeconds?: number | null; }; } else { params = { databaseId: paramsOrFirst as string, sql: rest[0] as string, - bindings: rest[1] as object, - timeoutSeconds: rest[2] as number, + bindings: rest[1] as object | null, + timeoutSeconds: rest[2] as number | null, }; } @@ -3150,33 +3195,33 @@ export class Postgresql { * Trigger a manual failover for a dedicated database with high availability enabled. Promotes a replica to primary. The failover runs asynchronously; poll the database document for status updates. A database left mid-operation also accepts this call as a repair once nothing is driving the operation it is stuck in. Repairing a failover that did not finish, a `failed` database, a stranded upgrade or migrate, or a stranded compute resize additionally requires `targetReplicaId` to name the member to promote, because the default target may be the member that operation already promoted. * * @param {string} params.databaseId - Database ID. - * @param {string} params.targetReplicaId - Target replica ID to promote. If not specified, the healthiest replica is selected. + * @param {string | null} params.targetReplicaId - Target replica ID to promote. If not specified, the healthiest replica is selected. * @throws {AppwriteException} * @returns {Promise<Models.DedicatedDatabase>} */ createFailover(params: { databaseId: string; - targetReplicaId?: string; + targetReplicaId?: string | null; }): Promise<Models.DedicatedDatabase>; /** * Trigger a manual failover for a dedicated database with high availability enabled. Promotes a replica to primary. The failover runs asynchronously; poll the database document for status updates. A database left mid-operation also accepts this call as a repair once nothing is driving the operation it is stuck in. Repairing a failover that did not finish, a `failed` database, a stranded upgrade or migrate, or a stranded compute resize additionally requires `targetReplicaId` to name the member to promote, because the default target may be the member that operation already promoted. * * @param {string} databaseId - Database ID. - * @param {string} targetReplicaId - Target replica ID to promote. If not specified, the healthiest replica is selected. + * @param {string | null} targetReplicaId - Target replica ID to promote. If not specified, the healthiest replica is selected. * @throws {AppwriteException} * @returns {Promise<Models.DedicatedDatabase>} * @deprecated Use the object parameter style method for a better developer experience. */ createFailover( databaseId: string, - targetReplicaId?: string, + targetReplicaId?: string | null, ): Promise<Models.DedicatedDatabase>; createFailover( paramsOrFirst: - { databaseId: string; targetReplicaId?: string } | string, - ...rest: [string?] + { databaseId: string; targetReplicaId?: string | null } | string, + ...rest: [(string | null)?] ): Promise<Models.DedicatedDatabase> { - let params: { databaseId: string; targetReplicaId?: string }; + let params: { databaseId: string; targetReplicaId?: string | null }; if ( paramsOrFirst && @@ -3185,12 +3230,12 @@ export class Postgresql { ) { params = (paramsOrFirst || {}) as { databaseId: string; - targetReplicaId?: string; + targetReplicaId?: string | null; }; } else { params = { databaseId: paramsOrFirst as string, - targetReplicaId: rest[0] as string, + targetReplicaId: rest[0] as string | null, }; } @@ -3431,21 +3476,21 @@ export class Postgresql { * * @param {string} params.databaseId - Database ID. * @param {string} params.targetType - Target database type to migrate to. Allowed values: shared (serverless, scales to zero when idle), dedicated (always-on with persistent resources). - * @param {string} params.specification - Target specification to provision when migrating to dedicated. Ignored for shared. Defaults to the database's current specification. + * @param {string | null} params.specification - Target specification to provision when migrating to dedicated. Ignored for shared. Defaults to the database's current specification. * @throws {AppwriteException} * @returns {Promise<Models.DedicatedDatabase>} */ createMigration(params: { databaseId: string; targetType: string; - specification?: string; + specification?: string | null; }): Promise<Models.DedicatedDatabase>; /** * Migrate a database between shared and dedicated types. Shared to dedicated provisions an always-on dedicated instance; dedicated to shared converts to a serverless instance that scales to zero when idle. Data is copied to the target with a brief read-only window during cutover. * * @param {string} databaseId - Database ID. * @param {string} targetType - Target database type to migrate to. Allowed values: shared (serverless, scales to zero when idle), dedicated (always-on with persistent resources). - * @param {string} specification - Target specification to provision when migrating to dedicated. Ignored for shared. Defaults to the database's current specification. + * @param {string | null} specification - Target specification to provision when migrating to dedicated. Ignored for shared. Defaults to the database's current specification. * @throws {AppwriteException} * @returns {Promise<Models.DedicatedDatabase>} * @deprecated Use the object parameter style method for a better developer experience. @@ -3453,18 +3498,22 @@ export class Postgresql { createMigration( databaseId: string, targetType: string, - specification?: string, + specification?: string | null, ): Promise<Models.DedicatedDatabase>; createMigration( paramsOrFirst: - | { databaseId: string; targetType: string; specification?: string } + | { + databaseId: string; + targetType: string; + specification?: string | null; + } | string, - ...rest: [string?, string?] + ...rest: [string?, (string | null)?] ): Promise<Models.DedicatedDatabase> { let params: { databaseId: string; targetType: string; - specification?: string; + specification?: string | null; }; if ( @@ -3475,13 +3524,13 @@ export class Postgresql { params = (paramsOrFirst || {}) as { databaseId: string; targetType: string; - specification?: string; + specification?: string | null; }; } else { params = { databaseId: paramsOrFirst as string, targetType: rest[0] as string, - specification: rest[1] as string, + specification: rest[1] as string | null, }; } @@ -3866,90 +3915,90 @@ export class Postgresql { * Update the connection pooler configuration for a dedicated database. Configure pool mode, max connections, and pool sizes. * * @param {string} params.databaseId - Database ID. - * @param {string} params.mode - Connection pool mode. Allowed values: transaction, session. Transaction mode returns connections to the pool after each transaction; session mode holds connections for the entire session lifetime. - * @param {number} params.maxConnections - Client-connection ceiling the pooler accepts. Supported on MySQL and MariaDB only; the PostgreSQL pooler has no client cap, so set networkMaxConnections on the database instead. - * @param {number} params.defaultPoolSize - Default pool size per user. - * @param {boolean} params.readWriteSplitting - Route SELECTs to HA replicas, writes and locked reads to the primary. Defaults to true when HA is enabled. - * @param {string} params.poolerCpuRequest - Pooler sidecar CPU request override (Kubernetes quantity, e.g. "250m" or "1"). Leave null for the proportional default (5% of DB CPU, floor 100m). - * @param {string} params.poolerCpuLimit - Pooler sidecar CPU limit override (Kubernetes quantity, e.g. "500m" or "1"). Leave null for the proportional default (10% of DB CPU, floor 200m). Changing this field rolls the database pod. - * @param {string} params.poolerMemoryRequest - Pooler sidecar memory request override (Kubernetes quantity, e.g. "128Mi" or "1Gi"). Leave null for the proportional default (7.5% of DB memory, floor 64Mi). - * @param {string} params.poolerMemoryLimit - Pooler sidecar memory limit override (Kubernetes quantity, e.g. "256Mi" or "1Gi"). Leave null for the proportional default (15% of DB memory, floor 128Mi). Changing this field rolls the database pod. + * @param {string | null} params.mode - Connection pool mode. Allowed values: transaction, session. Transaction mode returns connections to the pool after each transaction; session mode holds connections for the entire session lifetime. + * @param {number | null} params.maxConnections - Client-connection ceiling the pooler accepts. Supported on MySQL and MariaDB only; the PostgreSQL pooler has no client cap, so set networkMaxConnections on the database instead. + * @param {number | null} params.defaultPoolSize - Default pool size per user. + * @param {boolean | null} params.readWriteSplitting - Route SELECTs to HA replicas, writes and locked reads to the primary. Off by default, and only takes effect while HA is enabled. Replication is asynchronous, so a read issued immediately after a write may not observe it. + * @param {string | null} params.poolerCpuRequest - Pooler sidecar CPU request override (Kubernetes quantity, e.g. "250m" or "1"). Leave null for the proportional default (5% of DB CPU, floor 100m). + * @param {string | null} params.poolerCpuLimit - Pooler sidecar CPU limit override (Kubernetes quantity, e.g. "500m" or "1"). Leave null for the proportional default (10% of DB CPU, floor 200m). Changing this field rolls the database pod. + * @param {string | null} params.poolerMemoryRequest - Pooler sidecar memory request override (Kubernetes quantity, e.g. "128Mi" or "1Gi"). Leave null for the proportional default (7.5% of DB memory, floor 64Mi). + * @param {string | null} params.poolerMemoryLimit - Pooler sidecar memory limit override (Kubernetes quantity, e.g. "256Mi" or "1Gi"). Leave null for the proportional default (15% of DB memory, floor 128Mi). Changing this field rolls the database pod. * @throws {AppwriteException} * @returns {Promise<Models.DedicatedDatabasePooler>} */ updatePooler(params: { databaseId: string; - mode?: string; - maxConnections?: number; - defaultPoolSize?: number; - readWriteSplitting?: boolean; - poolerCpuRequest?: string; - poolerCpuLimit?: string; - poolerMemoryRequest?: string; - poolerMemoryLimit?: string; + mode?: string | null; + maxConnections?: number | null; + defaultPoolSize?: number | null; + readWriteSplitting?: boolean | null; + poolerCpuRequest?: string | null; + poolerCpuLimit?: string | null; + poolerMemoryRequest?: string | null; + poolerMemoryLimit?: string | null; }): Promise<Models.DedicatedDatabasePooler>; /** * Update the connection pooler configuration for a dedicated database. Configure pool mode, max connections, and pool sizes. * * @param {string} databaseId - Database ID. - * @param {string} mode - Connection pool mode. Allowed values: transaction, session. Transaction mode returns connections to the pool after each transaction; session mode holds connections for the entire session lifetime. - * @param {number} maxConnections - Client-connection ceiling the pooler accepts. Supported on MySQL and MariaDB only; the PostgreSQL pooler has no client cap, so set networkMaxConnections on the database instead. - * @param {number} defaultPoolSize - Default pool size per user. - * @param {boolean} readWriteSplitting - Route SELECTs to HA replicas, writes and locked reads to the primary. Defaults to true when HA is enabled. - * @param {string} poolerCpuRequest - Pooler sidecar CPU request override (Kubernetes quantity, e.g. "250m" or "1"). Leave null for the proportional default (5% of DB CPU, floor 100m). - * @param {string} poolerCpuLimit - Pooler sidecar CPU limit override (Kubernetes quantity, e.g. "500m" or "1"). Leave null for the proportional default (10% of DB CPU, floor 200m). Changing this field rolls the database pod. - * @param {string} poolerMemoryRequest - Pooler sidecar memory request override (Kubernetes quantity, e.g. "128Mi" or "1Gi"). Leave null for the proportional default (7.5% of DB memory, floor 64Mi). - * @param {string} poolerMemoryLimit - Pooler sidecar memory limit override (Kubernetes quantity, e.g. "256Mi" or "1Gi"). Leave null for the proportional default (15% of DB memory, floor 128Mi). Changing this field rolls the database pod. + * @param {string | null} mode - Connection pool mode. Allowed values: transaction, session. Transaction mode returns connections to the pool after each transaction; session mode holds connections for the entire session lifetime. + * @param {number | null} maxConnections - Client-connection ceiling the pooler accepts. Supported on MySQL and MariaDB only; the PostgreSQL pooler has no client cap, so set networkMaxConnections on the database instead. + * @param {number | null} defaultPoolSize - Default pool size per user. + * @param {boolean | null} readWriteSplitting - Route SELECTs to HA replicas, writes and locked reads to the primary. Off by default, and only takes effect while HA is enabled. Replication is asynchronous, so a read issued immediately after a write may not observe it. + * @param {string | null} poolerCpuRequest - Pooler sidecar CPU request override (Kubernetes quantity, e.g. "250m" or "1"). Leave null for the proportional default (5% of DB CPU, floor 100m). + * @param {string | null} poolerCpuLimit - Pooler sidecar CPU limit override (Kubernetes quantity, e.g. "500m" or "1"). Leave null for the proportional default (10% of DB CPU, floor 200m). Changing this field rolls the database pod. + * @param {string | null} poolerMemoryRequest - Pooler sidecar memory request override (Kubernetes quantity, e.g. "128Mi" or "1Gi"). Leave null for the proportional default (7.5% of DB memory, floor 64Mi). + * @param {string | null} poolerMemoryLimit - Pooler sidecar memory limit override (Kubernetes quantity, e.g. "256Mi" or "1Gi"). Leave null for the proportional default (15% of DB memory, floor 128Mi). Changing this field rolls the database pod. * @throws {AppwriteException} * @returns {Promise<Models.DedicatedDatabasePooler>} * @deprecated Use the object parameter style method for a better developer experience. */ updatePooler( databaseId: string, - mode?: string, - maxConnections?: number, - defaultPoolSize?: number, - readWriteSplitting?: boolean, - poolerCpuRequest?: string, - poolerCpuLimit?: string, - poolerMemoryRequest?: string, - poolerMemoryLimit?: string, + mode?: string | null, + maxConnections?: number | null, + defaultPoolSize?: number | null, + readWriteSplitting?: boolean | null, + poolerCpuRequest?: string | null, + poolerCpuLimit?: string | null, + poolerMemoryRequest?: string | null, + poolerMemoryLimit?: string | null, ): Promise<Models.DedicatedDatabasePooler>; updatePooler( paramsOrFirst: | { databaseId: string; - mode?: string; - maxConnections?: number; - defaultPoolSize?: number; - readWriteSplitting?: boolean; - poolerCpuRequest?: string; - poolerCpuLimit?: string; - poolerMemoryRequest?: string; - poolerMemoryLimit?: string; + mode?: string | null; + maxConnections?: number | null; + defaultPoolSize?: number | null; + readWriteSplitting?: boolean | null; + poolerCpuRequest?: string | null; + poolerCpuLimit?: string | null; + poolerMemoryRequest?: string | null; + poolerMemoryLimit?: string | null; } | string, ...rest: [ - string?, - number?, - number?, - boolean?, - string?, - string?, - string?, - string?, + (string | null)?, + (number | null)?, + (number | null)?, + (boolean | null)?, + (string | null)?, + (string | null)?, + (string | null)?, + (string | null)?, ] ): Promise<Models.DedicatedDatabasePooler> { let params: { databaseId: string; - mode?: string; - maxConnections?: number; - defaultPoolSize?: number; - readWriteSplitting?: boolean; - poolerCpuRequest?: string; - poolerCpuLimit?: string; - poolerMemoryRequest?: string; - poolerMemoryLimit?: string; + mode?: string | null; + maxConnections?: number | null; + defaultPoolSize?: number | null; + readWriteSplitting?: boolean | null; + poolerCpuRequest?: string | null; + poolerCpuLimit?: string | null; + poolerMemoryRequest?: string | null; + poolerMemoryLimit?: string | null; }; if ( @@ -3959,26 +4008,26 @@ export class Postgresql { ) { params = (paramsOrFirst || {}) as { databaseId: string; - mode?: string; - maxConnections?: number; - defaultPoolSize?: number; - readWriteSplitting?: boolean; - poolerCpuRequest?: string; - poolerCpuLimit?: string; - poolerMemoryRequest?: string; - poolerMemoryLimit?: string; + mode?: string | null; + maxConnections?: number | null; + defaultPoolSize?: number | null; + readWriteSplitting?: boolean | null; + poolerCpuRequest?: string | null; + poolerCpuLimit?: string | null; + poolerMemoryRequest?: string | null; + poolerMemoryLimit?: string | null; }; } else { params = { databaseId: paramsOrFirst as string, - mode: rest[0] as string, - maxConnections: rest[1] as number, - defaultPoolSize: rest[2] as number, - readWriteSplitting: rest[3] as boolean, - poolerCpuRequest: rest[4] as string, - poolerCpuLimit: rest[5] as string, - poolerMemoryRequest: rest[6] as string, - poolerMemoryLimit: rest[7] as string, + mode: rest[0] as string | null, + maxConnections: rest[1] as number | null, + defaultPoolSize: rest[2] as number | null, + readWriteSplitting: rest[3] as boolean | null, + poolerCpuRequest: rest[4] as string | null, + poolerCpuLimit: rest[5] as string | null, + poolerMemoryRequest: rest[6] as string | null, + poolerMemoryLimit: rest[7] as string | null, }; } @@ -4281,6 +4330,7 @@ export class Postgresql { databaseId: '', projectId: '', type: 'backup', + restoreMode: 'in_place', status: 'pending', error: '', }, @@ -4294,29 +4344,42 @@ export class Postgresql { /** * Restore a database from a backup or to a specific point in time (PITR). For backup restoration, provide a backupId. For PITR, provide a targetTime as an ISO 8601 datetime. PITR requires the database to have PITR enabled and is only available for enterprise databases. * + * By default the backup is replayed over the database it was taken from. Pass `restoreMode` as `clone` to recover it onto a second workload beside this database instead: this database keeps serving its own data while the clone is filled, and the switch happens as soon as the clone is ready, on the endpoint and credentials it already had. Pass `autoPromote` as false to hold the clone until you promote it yourself. Pass `restoreMode` as `copy` to recover onto a separate database with its own endpoint, either one you name with `targetDatabaseId` or one provisioned as a copy of this database's engine, version, specification and replicas. Neither mode is available for a point-in-time recovery or an incremental backup. + * * @param {string} params.databaseId - Database ID. * @param {string} params.type - Restoration type. Allowed values: backup, pitr. Use "backup" to restore from a specific backup, or "pitr" for point-in-time recovery. - * @param {string} params.backupId - Backup ID to restore from (required for backup type). - * @param {string} params.targetDatabaseId - Existing database ID to restore into. The target must be distinct, ready, and use the same engine and version. - * @param {string} params.targetTime - Target time for PITR (required for pitr type) as an [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) datetime. + * @param {string | null} params.backupId - Backup ID to restore from (required for backup type). + * @param {string | null} params.targetDatabaseId - Existing database ID to restore into. The target must be distinct, ready, and use the same engine and version. Omit it on a copy restoration to have one provisioned. Not accepted for a clone, which is recovered inside this database. + * @param {string | null} params.targetTime - Target time for PITR (required for pitr type) as an [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) datetime. + * @param {string | null} params.restoreMode - Where the backup is restored. Allowed values: in_place, clone, copy. Use "clone" to recover onto a second workload beside this database and leave it serving until you promote — the endpoint and credentials do not change. Use "copy" to recover onto a separate database with its own endpoint, either one you name with targetDatabaseId or one Cloud provisions. Use "in_place" to replay the backup over this database. Defaults to "copy" when a targetDatabaseId is given, "in_place" otherwise. + * @param {string | null} params.targetName - Display name for the database a copy restoration provisions. Defaults to this database's name followed by "(restored)". Max length: 128 chars. + * @param {boolean} params.autoPromote - Whether a clone restoration switches the database over as soon as the recovery is ready. Default true: the restore finishes with the database serving the recovery point on the endpoint it already had, and the side it replaced kept briefly so the switch can be reversed. Pass false to hold the recovery until you call the promotion endpoint yourself. * @throws {AppwriteException} * @returns {Promise<Models.DedicatedDatabaseRestoration>} */ createRestoration(params: { databaseId: string; type?: string; - backupId?: string; - targetDatabaseId?: string; - targetTime?: string; + backupId?: string | null; + targetDatabaseId?: string | null; + targetTime?: string | null; + restoreMode?: string | null; + targetName?: string | null; + autoPromote?: boolean; }): Promise<Models.DedicatedDatabaseRestoration>; /** * Restore a database from a backup or to a specific point in time (PITR). For backup restoration, provide a backupId. For PITR, provide a targetTime as an ISO 8601 datetime. PITR requires the database to have PITR enabled and is only available for enterprise databases. * + * By default the backup is replayed over the database it was taken from. Pass `restoreMode` as `clone` to recover it onto a second workload beside this database instead: this database keeps serving its own data while the clone is filled, and the switch happens as soon as the clone is ready, on the endpoint and credentials it already had. Pass `autoPromote` as false to hold the clone until you promote it yourself. Pass `restoreMode` as `copy` to recover onto a separate database with its own endpoint, either one you name with `targetDatabaseId` or one provisioned as a copy of this database's engine, version, specification and replicas. Neither mode is available for a point-in-time recovery or an incremental backup. + * * @param {string} databaseId - Database ID. * @param {string} type - Restoration type. Allowed values: backup, pitr. Use "backup" to restore from a specific backup, or "pitr" for point-in-time recovery. - * @param {string} backupId - Backup ID to restore from (required for backup type). - * @param {string} targetDatabaseId - Existing database ID to restore into. The target must be distinct, ready, and use the same engine and version. - * @param {string} targetTime - Target time for PITR (required for pitr type) as an [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) datetime. + * @param {string | null} backupId - Backup ID to restore from (required for backup type). + * @param {string | null} targetDatabaseId - Existing database ID to restore into. The target must be distinct, ready, and use the same engine and version. Omit it on a copy restoration to have one provisioned. Not accepted for a clone, which is recovered inside this database. + * @param {string | null} targetTime - Target time for PITR (required for pitr type) as an [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) datetime. + * @param {string | null} restoreMode - Where the backup is restored. Allowed values: in_place, clone, copy. Use "clone" to recover onto a second workload beside this database and leave it serving until you promote — the endpoint and credentials do not change. Use "copy" to recover onto a separate database with its own endpoint, either one you name with targetDatabaseId or one Cloud provisions. Use "in_place" to replay the backup over this database. Defaults to "copy" when a targetDatabaseId is given, "in_place" otherwise. + * @param {string | null} targetName - Display name for the database a copy restoration provisions. Defaults to this database's name followed by "(restored)". Max length: 128 chars. + * @param {boolean} autoPromote - Whether a clone restoration switches the database over as soon as the recovery is ready. Default true: the restore finishes with the database serving the recovery point on the endpoint it already had, and the side it replaced kept briefly so the switch can be reversed. Pass false to hold the recovery until you call the promotion endpoint yourself. * @throws {AppwriteException} * @returns {Promise<Models.DedicatedDatabaseRestoration>} * @deprecated Use the object parameter style method for a better developer experience. @@ -4324,28 +4387,45 @@ export class Postgresql { createRestoration( databaseId: string, type?: string, - backupId?: string, - targetDatabaseId?: string, - targetTime?: string, + backupId?: string | null, + targetDatabaseId?: string | null, + targetTime?: string | null, + restoreMode?: string | null, + targetName?: string | null, + autoPromote?: boolean, ): Promise<Models.DedicatedDatabaseRestoration>; createRestoration( paramsOrFirst: | { databaseId: string; type?: string; - backupId?: string; - targetDatabaseId?: string; - targetTime?: string; + backupId?: string | null; + targetDatabaseId?: string | null; + targetTime?: string | null; + restoreMode?: string | null; + targetName?: string | null; + autoPromote?: boolean; } | string, - ...rest: [string?, string?, string?, string?] + ...rest: [ + string?, + (string | null)?, + (string | null)?, + (string | null)?, + (string | null)?, + (string | null)?, + boolean?, + ] ): Promise<Models.DedicatedDatabaseRestoration> { let params: { databaseId: string; type?: string; - backupId?: string; - targetDatabaseId?: string; - targetTime?: string; + backupId?: string | null; + targetDatabaseId?: string | null; + targetTime?: string | null; + restoreMode?: string | null; + targetName?: string | null; + autoPromote?: boolean; }; if ( @@ -4356,17 +4436,23 @@ export class Postgresql { params = (paramsOrFirst || {}) as { databaseId: string; type?: string; - backupId?: string; - targetDatabaseId?: string; - targetTime?: string; + backupId?: string | null; + targetDatabaseId?: string | null; + targetTime?: string | null; + restoreMode?: string | null; + targetName?: string | null; + autoPromote?: boolean; }; } else { params = { databaseId: paramsOrFirst as string, type: rest[0] as string, - backupId: rest[1] as string, - targetDatabaseId: rest[2] as string, - targetTime: rest[3] as string, + backupId: rest[1] as string | null, + targetDatabaseId: rest[2] as string | null, + targetTime: rest[3] as string | null, + restoreMode: rest[4] as string | null, + targetName: rest[5] as string | null, + autoPromote: rest[6] as boolean, }; } @@ -4375,6 +4461,9 @@ export class Postgresql { const backupId = params.backupId; const targetDatabaseId = params.targetDatabaseId; const targetTime = params.targetTime; + const restoreMode = params.restoreMode; + const targetName = params.targetName; + const autoPromote = params.autoPromote; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -4398,6 +4487,15 @@ export class Postgresql { if (typeof targetTime !== 'undefined') { apiPayload['targetTime'] = targetTime; } + if (typeof restoreMode !== 'undefined') { + apiPayload['restoreMode'] = restoreMode; + } + if (typeof targetName !== 'undefined') { + apiPayload['targetName'] = targetName; + } + if (typeof autoPromote !== 'undefined') { + apiPayload['autoPromote'] = autoPromote; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -4417,6 +4515,7 @@ export class Postgresql { databaseId: '', projectId: '', type: 'backup', + restoreMode: 'in_place', status: 'pending', error: '', }, @@ -4512,6 +4611,111 @@ export class Postgresql { databaseId: '', projectId: '', type: 'backup', + restoreMode: 'in_place', + status: 'pending', + error: '', + }, + }, + }, + }; + + return request.then((response) => applyDefaults(response, defaults)); + } + + /** + * Switch the database over to the clone a restoration recovered. The database keeps + * its endpoint and credentials; clients reconnect once. Writes made after the + * recovery point are discarded, and the side being replaced is retained briefly so + * the switch can be reversed. + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.restorationId - Restoration ID. + * @throws {AppwriteException} + * @returns {Promise<Models.DedicatedDatabaseRestoration>} + */ + promoteRestoration(params: { + databaseId: string; + restorationId: string; + }): Promise<Models.DedicatedDatabaseRestoration>; + /** + * Switch the database over to the clone a restoration recovered. The database keeps + * its endpoint and credentials; clients reconnect once. Writes made after the + * recovery point are discarded, and the side being replaced is retained briefly so + * the switch can be reversed. + * + * @param {string} databaseId - Database ID. + * @param {string} restorationId - Restoration ID. + * @throws {AppwriteException} + * @returns {Promise<Models.DedicatedDatabaseRestoration>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + promoteRestoration( + databaseId: string, + restorationId: string, + ): Promise<Models.DedicatedDatabaseRestoration>; + promoteRestoration( + paramsOrFirst: { databaseId: string; restorationId: string } | string, + ...rest: [string?] + ): Promise<Models.DedicatedDatabaseRestoration> { + let params: { databaseId: string; restorationId: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + databaseId: string; + restorationId: string; + }; + } else { + params = { + databaseId: paramsOrFirst as string, + restorationId: rest[0] as string, + }; + } + + const databaseId = params.databaseId; + const restorationId = params.restorationId; + + if (typeof databaseId === 'undefined' || databaseId === '') { + throw new AppwriteException( + 'Missing required parameter: "databaseId"', + ); + } + if (typeof restorationId === 'undefined' || restorationId === '') { + throw new AppwriteException( + 'Missing required parameter: "restorationId"', + ); + } + const apiPath = + '/postgresql/{databaseId}/restorations/{restorationId}/promotions' + .replace('{databaseId}', encodeURIComponent(String(databaseId))) + .replace( + '{restorationId}', + encodeURIComponent(String(restorationId)), + ); + const apiPayload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }; + + const request = this.client.call('post', uri, apiHeaders, apiPayload); + const defaults = { + root: 'dedicatedDatabaseRestoration', + models: { + dedicatedDatabaseRestoration: { + defaults: { + $id: '', + $createdAt: '', + databaseId: '', + projectId: '', + type: 'backup', + restoreMode: 'in_place', status: 'pending', error: '', }, diff --git a/src/services/project.ts b/src/services/project.ts index 33d09079..7e58e847 100644 --- a/src/services/project.ts +++ b/src/services/project.ts @@ -74,7 +74,7 @@ export class Project { pingedAt: '', labels: [], status: 'active', - onboarding: [], + onboarding: {}, authMethods: [], services: [], protocols: [], @@ -250,7 +250,7 @@ export class Project { pingedAt: '', labels: [], status: 'active', - onboarding: [], + onboarding: {}, authMethods: [], services: [], protocols: [], @@ -404,7 +404,7 @@ export class Project { pingedAt: '', labels: [], status: 'active', - onboarding: [], + onboarding: {}, authMethods: [], services: [], protocols: [], @@ -555,7 +555,7 @@ export class Project { pingedAt: '', labels: [], status: 'active', - onboarding: [], + onboarding: {}, authMethods: [], services: [], protocols: [], @@ -685,7 +685,7 @@ export class Project { pingedAt: '', labels: [], status: 'active', - onboarding: [], + onboarding: {}, authMethods: [], services: [], protocols: [], @@ -836,7 +836,7 @@ export class Project { pingedAt: '', labels: [], status: 'active', - onboarding: [], + onboarding: {}, authMethods: [], services: [], protocols: [], @@ -1028,6 +1028,7 @@ export class Project { $createdAt: '', $updatedAt: '', name: '', + description: '', expire: '', scopes: [], secret: '', @@ -1049,7 +1050,8 @@ export class Project { * @param {string} params.keyId - Key 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 - Key name. Max length: 128 chars. * @param {ProjectKeyScopes[]} params.scopes - Key scopes list. Maximum of 200 scopes are allowed. - * @param {string} params.expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. + * @param {string | null} params.expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. + * @param {string} params.description - Optional description for the key. * @throws {AppwriteException} * @returns {Promise<Models.Key>} */ @@ -1057,7 +1059,8 @@ export class Project { keyId: string; name: string; scopes: ProjectKeyScopes[]; - expire?: string; + expire?: string | null; + description?: string; }): Promise<Models.Key>; /** * Create a new API key. It's recommended to have multiple API keys with strict scopes for separate functions within your project. @@ -1067,7 +1070,8 @@ export class Project { * @param {string} keyId - Key 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 - Key name. Max length: 128 chars. * @param {ProjectKeyScopes[]} scopes - Key scopes list. Maximum of 200 scopes are allowed. - * @param {string} expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. + * @param {string | null} expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. + * @param {string} description - Optional description for the key. * @throws {AppwriteException} * @returns {Promise<Models.Key>} * @deprecated Use the object parameter style method for a better developer experience. @@ -1076,7 +1080,8 @@ export class Project { keyId: string, name: string, scopes: ProjectKeyScopes[], - expire?: string, + expire?: string | null, + description?: string, ): Promise<Models.Key>; createKey( paramsOrFirst: @@ -1084,16 +1089,18 @@ export class Project { keyId: string; name: string; scopes: ProjectKeyScopes[]; - expire?: string; + expire?: string | null; + description?: string; } | string, - ...rest: [string?, ProjectKeyScopes[]?, string?] + ...rest: [string?, ProjectKeyScopes[]?, (string | null)?, string?] ): Promise<Models.Key> { let params: { keyId: string; name: string; scopes: ProjectKeyScopes[]; - expire?: string; + expire?: string | null; + description?: string; }; if ( @@ -1105,14 +1112,16 @@ export class Project { keyId: string; name: string; scopes: ProjectKeyScopes[]; - expire?: string; + expire?: string | null; + description?: string; }; } else { params = { keyId: paramsOrFirst as string, name: rest[0] as string, scopes: rest[1] as ProjectKeyScopes[], - expire: rest[2] as string, + expire: rest[2] as string | null, + description: rest[3] as string, }; } @@ -1120,6 +1129,7 @@ export class Project { const name = params.name; const scopes = params.scopes; const expire = params.expire; + const description = params.description; if (typeof keyId === 'undefined') { throw new AppwriteException('Missing required parameter: "keyId"'); @@ -1144,6 +1154,9 @@ export class Project { if (typeof expire !== 'undefined') { apiPayload['expire'] = expire; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -1162,6 +1175,7 @@ export class Project { $createdAt: '', $updatedAt: '', name: '', + description: '', expire: '', scopes: [], secret: '', @@ -1266,6 +1280,7 @@ export class Project { $createdAt: '', $updatedAt: '', name: '', + description: '', expire: '', scopes: [], secret: '', @@ -1338,6 +1353,7 @@ export class Project { $createdAt: '', $updatedAt: '', name: '', + description: '', expire: '', scopes: [], secret: '', @@ -1357,7 +1373,8 @@ export class Project { * @param {string} params.keyId - Key ID. * @param {string} params.name - Key name. Max length: 128 chars. * @param {ProjectKeyScopes[]} params.scopes - Key scopes list. Maximum of 200 scopes are allowed. - * @param {string} params.expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. + * @param {string | null} params.expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. + * @param {string | null} params.description - Optional description for the key. * @throws {AppwriteException} * @returns {Promise<Models.Key>} */ @@ -1365,7 +1382,8 @@ export class Project { keyId: string; name: string; scopes: ProjectKeyScopes[]; - expire?: string; + expire?: string | null; + description?: string | null; }): Promise<Models.Key>; /** * Update a key by its unique ID. Use this endpoint to update the name, scopes, or expiration time of an API key. @@ -1373,7 +1391,8 @@ export class Project { * @param {string} keyId - Key ID. * @param {string} name - Key name. Max length: 128 chars. * @param {ProjectKeyScopes[]} scopes - Key scopes list. Maximum of 200 scopes are allowed. - * @param {string} expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. + * @param {string | null} expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. + * @param {string | null} description - Optional description for the key. * @throws {AppwriteException} * @returns {Promise<Models.Key>} * @deprecated Use the object parameter style method for a better developer experience. @@ -1382,7 +1401,8 @@ export class Project { keyId: string, name: string, scopes: ProjectKeyScopes[], - expire?: string, + expire?: string | null, + description?: string | null, ): Promise<Models.Key>; updateKey( paramsOrFirst: @@ -1390,16 +1410,23 @@ export class Project { keyId: string; name: string; scopes: ProjectKeyScopes[]; - expire?: string; + expire?: string | null; + description?: string | null; } | string, - ...rest: [string?, ProjectKeyScopes[]?, string?] + ...rest: [ + string?, + ProjectKeyScopes[]?, + (string | null)?, + (string | null)?, + ] ): Promise<Models.Key> { let params: { keyId: string; name: string; scopes: ProjectKeyScopes[]; - expire?: string; + expire?: string | null; + description?: string | null; }; if ( @@ -1411,14 +1438,16 @@ export class Project { keyId: string; name: string; scopes: ProjectKeyScopes[]; - expire?: string; + expire?: string | null; + description?: string | null; }; } else { params = { keyId: paramsOrFirst as string, name: rest[0] as string, scopes: rest[1] as ProjectKeyScopes[], - expire: rest[2] as string, + expire: rest[2] as string | null, + description: rest[3] as string | null, }; } @@ -1426,6 +1455,7 @@ export class Project { const name = params.name; const scopes = params.scopes; const expire = params.expire; + const description = params.description; if (typeof keyId === 'undefined' || keyId === '') { throw new AppwriteException('Missing required parameter: "keyId"'); @@ -1450,6 +1480,9 @@ export class Project { if (typeof expire !== 'undefined') { apiPayload['expire'] = expire; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -1468,6 +1501,7 @@ export class Project { $createdAt: '', $updatedAt: '', name: '', + description: '', expire: '', scopes: [], secret: '', @@ -1612,7 +1646,7 @@ export class Project { pingedAt: '', labels: [], status: 'active', - onboarding: [], + onboarding: {}, authMethods: [], services: [], protocols: [], @@ -2137,16 +2171,16 @@ export class Project { * @param {string} params.authorizationUrl - URL to your application with consent screen. * @param {string[]} params.scopes - List of allowed OAuth2 scopes. Maximum of 100 scopes are allowed, each up to 128 characters long. * @param {string[]} params.authorizationDetailsTypes - List of accepted `authorization_details` types. Maximum of 100 types are allowed, each up to 128 characters long. - * @param {number} params.accessTokenDuration - Access token duration in seconds for confidential clients (server-side apps that authenticate with a client secret). Leave empty to use default 8 hours. - * @param {number} params.refreshTokenDuration - Refresh token duration in seconds for confidential clients (server-side apps that authenticate with a client secret). Leave empty to use default 1 year. - * @param {number} params.publicAccessTokenDuration - Access token duration in seconds for public clients (SPAs, mobile, and native apps that cannot keep a client secret). Leave empty to use default 1 hour. - * @param {number} params.publicRefreshTokenDuration - Refresh token duration in seconds for public clients (SPAs, mobile, and native apps that cannot keep a client secret). Leave empty to use default 30 days. - * @param {number} params.installationAccessTokenDuration - Access token duration in seconds for app installation access tokens. Leave empty to use default 1 hour. - * @param {boolean} params.confidentialPkce - When enabled, PKCE is required for confidential clients (server-side flows using client_secret). PKCE is always required for public clients regardless of this setting. + * @param {number | null} params.accessTokenDuration - Access token duration in seconds for confidential clients (server-side apps that authenticate with a client secret). Leave empty to use default 8 hours. + * @param {number | null} params.refreshTokenDuration - Refresh token duration in seconds for confidential clients (server-side apps that authenticate with a client secret). Leave empty to use default 1 year. + * @param {number | null} params.publicAccessTokenDuration - Access token duration in seconds for public clients (SPAs, mobile, and native apps that cannot keep a client secret). Leave empty to use default 1 hour. + * @param {number | null} params.publicRefreshTokenDuration - Refresh token duration in seconds for public clients (SPAs, mobile, and native apps that cannot keep a client secret). Leave empty to use default 30 days. + * @param {number | null} params.installationAccessTokenDuration - Access token duration in seconds for app installation access tokens. Leave empty to use default 1 hour. + * @param {boolean | null} params.confidentialPkce - When enabled, PKCE is required for confidential clients (server-side flows using client_secret). PKCE is always required for public clients regardless of this setting. * @param {string} params.verificationUrl - URL to your application page where users enter the device flow user code. Required to enable the Device Authorization Grant. - * @param {number} params.userCodeLength - Number of characters in the device flow user code, excluding the formatting separator. Shorter codes are easier to type but weaker; pair short codes with short expiry. Leave empty to use default 8. + * @param {number | null} params.userCodeLength - Number of characters in the device flow user code, excluding the formatting separator. Shorter codes are easier to type but weaker; pair short codes with short expiry. Leave empty to use default 8. * @param {string} params.userCodeFormat - Character set for device flow user codes: `numeric` (digits only — best for numeric keypads and TV remotes), `alphabetic` (letters only), or `alphanumeric` (letters and digits — highest entropy per character). Defaults to `alphanumeric`. - * @param {number} params.deviceCodeDuration - Lifetime in seconds of device flow device codes and user codes. Device codes are intentionally short-lived. Leave empty to use default 600. + * @param {number | null} params.deviceCodeDuration - Lifetime in seconds of device flow device codes and user codes. Device codes are intentionally short-lived. Leave empty to use default 600. * @param {string[]} params.defaultScopes - List of OAuth2 scopes used when an authorization request omits the scope parameter. Every default scope must also be allowed by the OAuth2 server. Maximum of 100 scopes are allowed, each up to 128 characters long. * @param {string[]} params.installationScopes - List of scopes an application may request when installed on a team. Omitting the parameter clears the list, so no installation scopes can be granted. Maximum of 100 scopes are allowed, each up to 128 characters long. * @throws {AppwriteException} @@ -2157,16 +2191,16 @@ export class Project { authorizationUrl: string; scopes?: string[]; authorizationDetailsTypes?: string[]; - accessTokenDuration?: number; - refreshTokenDuration?: number; - publicAccessTokenDuration?: number; - publicRefreshTokenDuration?: number; - installationAccessTokenDuration?: number; - confidentialPkce?: boolean; + accessTokenDuration?: number | null; + refreshTokenDuration?: number | null; + publicAccessTokenDuration?: number | null; + publicRefreshTokenDuration?: number | null; + installationAccessTokenDuration?: number | null; + confidentialPkce?: boolean | null; verificationUrl?: string; - userCodeLength?: number; + userCodeLength?: number | null; userCodeFormat?: string; - deviceCodeDuration?: number; + deviceCodeDuration?: number | null; defaultScopes?: string[]; installationScopes?: string[]; }): Promise<Models.Project>; @@ -2177,16 +2211,16 @@ export class Project { * @param {string} authorizationUrl - URL to your application with consent screen. * @param {string[]} scopes - List of allowed OAuth2 scopes. Maximum of 100 scopes are allowed, each up to 128 characters long. * @param {string[]} authorizationDetailsTypes - List of accepted `authorization_details` types. Maximum of 100 types are allowed, each up to 128 characters long. - * @param {number} accessTokenDuration - Access token duration in seconds for confidential clients (server-side apps that authenticate with a client secret). Leave empty to use default 8 hours. - * @param {number} refreshTokenDuration - Refresh token duration in seconds for confidential clients (server-side apps that authenticate with a client secret). Leave empty to use default 1 year. - * @param {number} publicAccessTokenDuration - Access token duration in seconds for public clients (SPAs, mobile, and native apps that cannot keep a client secret). Leave empty to use default 1 hour. - * @param {number} publicRefreshTokenDuration - Refresh token duration in seconds for public clients (SPAs, mobile, and native apps that cannot keep a client secret). Leave empty to use default 30 days. - * @param {number} installationAccessTokenDuration - Access token duration in seconds for app installation access tokens. Leave empty to use default 1 hour. - * @param {boolean} confidentialPkce - When enabled, PKCE is required for confidential clients (server-side flows using client_secret). PKCE is always required for public clients regardless of this setting. + * @param {number | null} accessTokenDuration - Access token duration in seconds for confidential clients (server-side apps that authenticate with a client secret). Leave empty to use default 8 hours. + * @param {number | null} refreshTokenDuration - Refresh token duration in seconds for confidential clients (server-side apps that authenticate with a client secret). Leave empty to use default 1 year. + * @param {number | null} publicAccessTokenDuration - Access token duration in seconds for public clients (SPAs, mobile, and native apps that cannot keep a client secret). Leave empty to use default 1 hour. + * @param {number | null} publicRefreshTokenDuration - Refresh token duration in seconds for public clients (SPAs, mobile, and native apps that cannot keep a client secret). Leave empty to use default 30 days. + * @param {number | null} installationAccessTokenDuration - Access token duration in seconds for app installation access tokens. Leave empty to use default 1 hour. + * @param {boolean | null} confidentialPkce - When enabled, PKCE is required for confidential clients (server-side flows using client_secret). PKCE is always required for public clients regardless of this setting. * @param {string} verificationUrl - URL to your application page where users enter the device flow user code. Required to enable the Device Authorization Grant. - * @param {number} userCodeLength - Number of characters in the device flow user code, excluding the formatting separator. Shorter codes are easier to type but weaker; pair short codes with short expiry. Leave empty to use default 8. + * @param {number | null} userCodeLength - Number of characters in the device flow user code, excluding the formatting separator. Shorter codes are easier to type but weaker; pair short codes with short expiry. Leave empty to use default 8. * @param {string} userCodeFormat - Character set for device flow user codes: `numeric` (digits only — best for numeric keypads and TV remotes), `alphabetic` (letters only), or `alphanumeric` (letters and digits — highest entropy per character). Defaults to `alphanumeric`. - * @param {number} deviceCodeDuration - Lifetime in seconds of device flow device codes and user codes. Device codes are intentionally short-lived. Leave empty to use default 600. + * @param {number | null} deviceCodeDuration - Lifetime in seconds of device flow device codes and user codes. Device codes are intentionally short-lived. Leave empty to use default 600. * @param {string[]} defaultScopes - List of OAuth2 scopes used when an authorization request omits the scope parameter. Every default scope must also be allowed by the OAuth2 server. Maximum of 100 scopes are allowed, each up to 128 characters long. * @param {string[]} installationScopes - List of scopes an application may request when installed on a team. Omitting the parameter clears the list, so no installation scopes can be granted. Maximum of 100 scopes are allowed, each up to 128 characters long. * @throws {AppwriteException} @@ -2198,16 +2232,16 @@ export class Project { authorizationUrl: string, scopes?: string[], authorizationDetailsTypes?: string[], - accessTokenDuration?: number, - refreshTokenDuration?: number, - publicAccessTokenDuration?: number, - publicRefreshTokenDuration?: number, - installationAccessTokenDuration?: number, - confidentialPkce?: boolean, + accessTokenDuration?: number | null, + refreshTokenDuration?: number | null, + publicAccessTokenDuration?: number | null, + publicRefreshTokenDuration?: number | null, + installationAccessTokenDuration?: number | null, + confidentialPkce?: boolean | null, verificationUrl?: string, - userCodeLength?: number, + userCodeLength?: number | null, userCodeFormat?: string, - deviceCodeDuration?: number, + deviceCodeDuration?: number | null, defaultScopes?: string[], installationScopes?: string[], ): Promise<Models.Project>; @@ -2218,16 +2252,16 @@ export class Project { authorizationUrl: string; scopes?: string[]; authorizationDetailsTypes?: string[]; - accessTokenDuration?: number; - refreshTokenDuration?: number; - publicAccessTokenDuration?: number; - publicRefreshTokenDuration?: number; - installationAccessTokenDuration?: number; - confidentialPkce?: boolean; + accessTokenDuration?: number | null; + refreshTokenDuration?: number | null; + publicAccessTokenDuration?: number | null; + publicRefreshTokenDuration?: number | null; + installationAccessTokenDuration?: number | null; + confidentialPkce?: boolean | null; verificationUrl?: string; - userCodeLength?: number; + userCodeLength?: number | null; userCodeFormat?: string; - deviceCodeDuration?: number; + deviceCodeDuration?: number | null; defaultScopes?: string[]; installationScopes?: string[]; } @@ -2236,16 +2270,16 @@ export class Project { string?, string[]?, string[]?, - number?, - number?, - number?, - number?, - number?, - boolean?, + (number | null)?, + (number | null)?, + (number | null)?, + (number | null)?, + (number | null)?, + (boolean | null)?, string?, - number?, + (number | null)?, string?, - number?, + (number | null)?, string[]?, string[]?, ] @@ -2255,16 +2289,16 @@ export class Project { authorizationUrl: string; scopes?: string[]; authorizationDetailsTypes?: string[]; - accessTokenDuration?: number; - refreshTokenDuration?: number; - publicAccessTokenDuration?: number; - publicRefreshTokenDuration?: number; - installationAccessTokenDuration?: number; - confidentialPkce?: boolean; + accessTokenDuration?: number | null; + refreshTokenDuration?: number | null; + publicAccessTokenDuration?: number | null; + publicRefreshTokenDuration?: number | null; + installationAccessTokenDuration?: number | null; + confidentialPkce?: boolean | null; verificationUrl?: string; - userCodeLength?: number; + userCodeLength?: number | null; userCodeFormat?: string; - deviceCodeDuration?: number; + deviceCodeDuration?: number | null; defaultScopes?: string[]; installationScopes?: string[]; }; @@ -2279,16 +2313,16 @@ export class Project { authorizationUrl: string; scopes?: string[]; authorizationDetailsTypes?: string[]; - accessTokenDuration?: number; - refreshTokenDuration?: number; - publicAccessTokenDuration?: number; - publicRefreshTokenDuration?: number; - installationAccessTokenDuration?: number; - confidentialPkce?: boolean; + accessTokenDuration?: number | null; + refreshTokenDuration?: number | null; + publicAccessTokenDuration?: number | null; + publicRefreshTokenDuration?: number | null; + installationAccessTokenDuration?: number | null; + confidentialPkce?: boolean | null; verificationUrl?: string; - userCodeLength?: number; + userCodeLength?: number | null; userCodeFormat?: string; - deviceCodeDuration?: number; + deviceCodeDuration?: number | null; defaultScopes?: string[]; installationScopes?: string[]; }; @@ -2298,16 +2332,16 @@ export class Project { authorizationUrl: rest[0] as string, scopes: rest[1] as string[], authorizationDetailsTypes: rest[2] as string[], - accessTokenDuration: rest[3] as number, - refreshTokenDuration: rest[4] as number, - publicAccessTokenDuration: rest[5] as number, - publicRefreshTokenDuration: rest[6] as number, - installationAccessTokenDuration: rest[7] as number, - confidentialPkce: rest[8] as boolean, + accessTokenDuration: rest[3] as number | null, + refreshTokenDuration: rest[4] as number | null, + publicAccessTokenDuration: rest[5] as number | null, + publicRefreshTokenDuration: rest[6] as number | null, + installationAccessTokenDuration: rest[7] as number | null, + confidentialPkce: rest[8] as boolean | null, verificationUrl: rest[9] as string, - userCodeLength: rest[10] as number, + userCodeLength: rest[10] as number | null, userCodeFormat: rest[11] as string, - deviceCodeDuration: rest[12] as number, + deviceCodeDuration: rest[12] as number | null, defaultScopes: rest[13] as string[], installationScopes: rest[14] as string[], }; @@ -2427,7 +2461,7 @@ export class Project { pingedAt: '', labels: [], status: 'active', - onboarding: [], + onboarding: {}, authMethods: [], services: [], protocols: [], @@ -2481,42 +2515,47 @@ export class Project { /** * Update the project OAuth2 Amazon configuration. * - * @param {string} params.clientId - 'Client ID' of Amazon OAuth2 app. For example: amzn1.application-oa2-client.87400c00000000000000000000063d5b2 - * @param {string} params.clientSecret - 'Client Secret' of Amazon OAuth2 app. For example: 79ffe4000000000000000000000000000000000000000000000000000002de55 - * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} params.clientId - 'Client ID' of Amazon OAuth2 app. For example: amzn1.application-oa2-client.87400c00000000000000000000063d5b2 + * @param {string | null} params.clientSecret - 'Client Secret' of Amazon OAuth2 app. For example: 79ffe4000000000000000000000000000000000000000000000000000002de55 + * @param {boolean | null} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Amazon>} */ updateOAuth2Amazon(params?: { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }): Promise<Models.OAuth2Amazon>; /** * Update the project OAuth2 Amazon configuration. * - * @param {string} clientId - 'Client ID' of Amazon OAuth2 app. For example: amzn1.application-oa2-client.87400c00000000000000000000063d5b2 - * @param {string} clientSecret - 'Client Secret' of Amazon OAuth2 app. For example: 79ffe4000000000000000000000000000000000000000000000000000002de55 - * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} clientId - 'Client ID' of Amazon OAuth2 app. For example: amzn1.application-oa2-client.87400c00000000000000000000063d5b2 + * @param {string | null} clientSecret - 'Client Secret' of Amazon OAuth2 app. For example: 79ffe4000000000000000000000000000000000000000000000000000002de55 + * @param {boolean | null} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Amazon>} * @deprecated Use the object parameter style method for a better developer experience. */ updateOAuth2Amazon( - clientId?: string, - clientSecret?: string, - enabled?: boolean, + clientId?: string | null, + clientSecret?: string | null, + enabled?: boolean | null, ): Promise<Models.OAuth2Amazon>; updateOAuth2Amazon( paramsOrFirst?: - | { clientId?: string; clientSecret?: string; enabled?: boolean } - | string, - ...rest: [string?, boolean?] + | { + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; + } + | string + | null, + ...rest: [(string | null)?, (boolean | null)?] ): Promise<Models.OAuth2Amazon> { let params: { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }; if ( @@ -2526,15 +2565,15 @@ export class Project { !Array.isArray(paramsOrFirst)) ) { params = (paramsOrFirst || {}) as { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }; } else { params = { - clientId: paramsOrFirst as string, - clientSecret: rest[0] as string, - enabled: rest[1] as boolean, + clientId: paramsOrFirst as string | null, + clientSecret: rest[0] as string | null, + enabled: rest[1] as boolean | null, }; } @@ -2582,70 +2621,78 @@ export class Project { /** * Update the project OAuth2 Apple configuration. * - * @param {string} params.serviceId - 'Service ID' of Apple OAuth2 app. For example: ip.appwrite.app.web - * @param {string} params.keyId - 'Key ID' of Apple OAuth2 app. For example: P4000000N8 - * @param {string} params.teamId - 'Team ID' of Apple OAuth2 app. For example: D4000000R6 - * @param {string} params.p8File - Contents of the Apple OAuth2 app .p8 private key file. The secret key wrapped by the PEM markers is 200 characters long. For example: -----BEGIN PRIVATE KEY-----MIGTAg...jy2Xbna-----END PRIVATE KEY----- - * @param {string[]} params.nativeClientIds - App bundle IDs accepted as ID token audiences for native Sign in with Apple. For example: com.example.app. Together with the Services ID, these are the only client IDs whose tokens are trusted. Pass an empty array to clear the list. - * @param {boolean} params.enabled - Browser-based OAuth2 sign-in status. Set to true to enable new session creation through the redirect flow. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. Has no effect on native sign-in, which is controlled by nativeEnabled only. - * @param {boolean} params.nativeEnabled - Native Sign in with Apple status. This is the only switch for creating sessions from ID tokens obtained on device and is independent of enabled. Needs a Services ID or at least one native client ID to match tokens against, but no key or team ID: this method verifies a signature rather than redeeming an authorization code. + * @param {string | null} params.serviceId - 'Service ID' of Apple OAuth2 app. For example: ip.appwrite.app.web + * @param {string | null} params.keyId - 'Key ID' of Apple OAuth2 app. For example: P4000000N8 + * @param {string | null} params.teamId - 'Team ID' of Apple OAuth2 app. For example: D4000000R6 + * @param {string | null} params.p8File - Contents of the Apple OAuth2 app .p8 private key file. The secret key wrapped by the PEM markers is 200 characters long. For example: -----BEGIN PRIVATE KEY-----MIGTAg...jy2Xbna-----END PRIVATE KEY----- + * @param {boolean | null} params.enabled - Browser-based OAuth2 sign-in status. Set to true to enable new session creation through the redirect flow. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. Has no effect on native sign-in, which is controlled by nativeEnabled only. + * @param {string[] | null} params.nativeClientIds - App bundle IDs accepted as ID token audiences for native Sign in with Apple. For example: com.example.app. Together with the Services ID, these are the only client IDs whose tokens are trusted. Pass an empty array to clear the list. + * @param {boolean | null} params.nativeEnabled - Native Sign in with Apple status. This is the only switch for creating sessions from ID tokens obtained on device and is independent of enabled. Needs a Services ID or at least one native client ID to match tokens against, but no key or team ID: this method verifies a signature rather than redeeming an authorization code. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Apple>} */ updateOAuth2Apple(params?: { - serviceId?: string; - keyId?: string; - teamId?: string; - p8File?: string; - nativeClientIds?: string[]; - enabled?: boolean; - nativeEnabled?: boolean; + serviceId?: string | null; + keyId?: string | null; + teamId?: string | null; + p8File?: string | null; + enabled?: boolean | null; + nativeClientIds?: string[] | null; + nativeEnabled?: boolean | null; }): Promise<Models.OAuth2Apple>; /** * Update the project OAuth2 Apple configuration. * - * @param {string} serviceId - 'Service ID' of Apple OAuth2 app. For example: ip.appwrite.app.web - * @param {string} keyId - 'Key ID' of Apple OAuth2 app. For example: P4000000N8 - * @param {string} teamId - 'Team ID' of Apple OAuth2 app. For example: D4000000R6 - * @param {string} p8File - Contents of the Apple OAuth2 app .p8 private key file. The secret key wrapped by the PEM markers is 200 characters long. For example: -----BEGIN PRIVATE KEY-----MIGTAg...jy2Xbna-----END PRIVATE KEY----- - * @param {string[]} nativeClientIds - App bundle IDs accepted as ID token audiences for native Sign in with Apple. For example: com.example.app. Together with the Services ID, these are the only client IDs whose tokens are trusted. Pass an empty array to clear the list. - * @param {boolean} enabled - Browser-based OAuth2 sign-in status. Set to true to enable new session creation through the redirect flow. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. Has no effect on native sign-in, which is controlled by nativeEnabled only. - * @param {boolean} nativeEnabled - Native Sign in with Apple status. This is the only switch for creating sessions from ID tokens obtained on device and is independent of enabled. Needs a Services ID or at least one native client ID to match tokens against, but no key or team ID: this method verifies a signature rather than redeeming an authorization code. + * @param {string | null} serviceId - 'Service ID' of Apple OAuth2 app. For example: ip.appwrite.app.web + * @param {string | null} keyId - 'Key ID' of Apple OAuth2 app. For example: P4000000N8 + * @param {string | null} teamId - 'Team ID' of Apple OAuth2 app. For example: D4000000R6 + * @param {string | null} p8File - Contents of the Apple OAuth2 app .p8 private key file. The secret key wrapped by the PEM markers is 200 characters long. For example: -----BEGIN PRIVATE KEY-----MIGTAg...jy2Xbna-----END PRIVATE KEY----- + * @param {boolean | null} enabled - Browser-based OAuth2 sign-in status. Set to true to enable new session creation through the redirect flow. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. Has no effect on native sign-in, which is controlled by nativeEnabled only. + * @param {string[] | null} nativeClientIds - App bundle IDs accepted as ID token audiences for native Sign in with Apple. For example: com.example.app. Together with the Services ID, these are the only client IDs whose tokens are trusted. Pass an empty array to clear the list. + * @param {boolean | null} nativeEnabled - Native Sign in with Apple status. This is the only switch for creating sessions from ID tokens obtained on device and is independent of enabled. Needs a Services ID or at least one native client ID to match tokens against, but no key or team ID: this method verifies a signature rather than redeeming an authorization code. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Apple>} * @deprecated Use the object parameter style method for a better developer experience. */ updateOAuth2Apple( - serviceId?: string, - keyId?: string, - teamId?: string, - p8File?: string, - nativeClientIds?: string[], - enabled?: boolean, - nativeEnabled?: boolean, + serviceId?: string | null, + keyId?: string | null, + teamId?: string | null, + p8File?: string | null, + enabled?: boolean | null, + nativeClientIds?: string[] | null, + nativeEnabled?: boolean | null, ): Promise<Models.OAuth2Apple>; updateOAuth2Apple( paramsOrFirst?: | { - serviceId?: string; - keyId?: string; - teamId?: string; - p8File?: string; - nativeClientIds?: string[]; - enabled?: boolean; - nativeEnabled?: boolean; + serviceId?: string | null; + keyId?: string | null; + teamId?: string | null; + p8File?: string | null; + enabled?: boolean | null; + nativeClientIds?: string[] | null; + nativeEnabled?: boolean | null; } - | string, - ...rest: [string?, string?, string?, string[]?, boolean?, boolean?] + | string + | null, + ...rest: [ + (string | null)?, + (string | null)?, + (string | null)?, + (boolean | null)?, + (string[] | null)?, + (boolean | null)?, + ] ): Promise<Models.OAuth2Apple> { let params: { - serviceId?: string; - keyId?: string; - teamId?: string; - p8File?: string; - nativeClientIds?: string[]; - enabled?: boolean; - nativeEnabled?: boolean; + serviceId?: string | null; + keyId?: string | null; + teamId?: string | null; + p8File?: string | null; + enabled?: boolean | null; + nativeClientIds?: string[] | null; + nativeEnabled?: boolean | null; }; if ( @@ -2655,23 +2702,23 @@ export class Project { !Array.isArray(paramsOrFirst)) ) { params = (paramsOrFirst || {}) as { - serviceId?: string; - keyId?: string; - teamId?: string; - p8File?: string; - nativeClientIds?: string[]; - enabled?: boolean; - nativeEnabled?: boolean; + serviceId?: string | null; + keyId?: string | null; + teamId?: string | null; + p8File?: string | null; + enabled?: boolean | null; + nativeClientIds?: string[] | null; + nativeEnabled?: boolean | null; }; } else { params = { - serviceId: paramsOrFirst as string, - keyId: rest[0] as string, - teamId: rest[1] as string, - p8File: rest[2] as string, - nativeClientIds: rest[3] as string[], - enabled: rest[4] as boolean, - nativeEnabled: rest[5] as boolean, + serviceId: paramsOrFirst as string | null, + keyId: rest[0] as string | null, + teamId: rest[1] as string | null, + p8File: rest[2] as string | null, + enabled: rest[3] as boolean | null, + nativeClientIds: rest[4] as string[] | null, + nativeEnabled: rest[5] as boolean | null, }; } @@ -2679,8 +2726,8 @@ export class Project { const keyId = params.keyId; const teamId = params.teamId; const p8File = params.p8File; - const nativeClientIds = params.nativeClientIds; const enabled = params.enabled; + const nativeClientIds = params.nativeClientIds; const nativeEnabled = params.nativeEnabled; const apiPath = '/project/oauth2/apple'; @@ -2697,12 +2744,12 @@ export class Project { if (typeof p8File !== 'undefined') { apiPayload['p8File'] = p8File; } - if (typeof nativeClientIds !== 'undefined') { - apiPayload['nativeClientIds'] = nativeClientIds; - } if (typeof enabled !== 'undefined') { apiPayload['enabled'] = enabled; } + if (typeof nativeClientIds !== 'undefined') { + apiPayload['nativeClientIds'] = nativeClientIds; + } if (typeof nativeEnabled !== 'undefined') { apiPayload['nativeEnabled'] = nativeEnabled; } @@ -2739,42 +2786,47 @@ export class Project { /** * Update the project OAuth2 Appwrite configuration. * - * @param {string} params.clientId - 'Client ID' of Appwrite OAuth2 app. For example: 6a42000000000000b5a0 - * @param {string} params.clientSecret - 'Client Secret' of Appwrite OAuth2 app. For example: b86afd000000000000000000000000000000000000000000000000000ced5f93 - * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} params.clientId - 'Client ID' of Appwrite OAuth2 app. For example: 6a42000000000000b5a0 + * @param {string | null} params.clientSecret - 'Client Secret' of Appwrite OAuth2 app. For example: b86afd000000000000000000000000000000000000000000000000000ced5f93 + * @param {boolean | null} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Appwrite>} */ updateOAuth2Appwrite(params?: { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }): Promise<Models.OAuth2Appwrite>; /** * Update the project OAuth2 Appwrite configuration. * - * @param {string} clientId - 'Client ID' of Appwrite OAuth2 app. For example: 6a42000000000000b5a0 - * @param {string} clientSecret - 'Client Secret' of Appwrite OAuth2 app. For example: b86afd000000000000000000000000000000000000000000000000000ced5f93 - * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} clientId - 'Client ID' of Appwrite OAuth2 app. For example: 6a42000000000000b5a0 + * @param {string | null} clientSecret - 'Client Secret' of Appwrite OAuth2 app. For example: b86afd000000000000000000000000000000000000000000000000000ced5f93 + * @param {boolean | null} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Appwrite>} * @deprecated Use the object parameter style method for a better developer experience. */ updateOAuth2Appwrite( - clientId?: string, - clientSecret?: string, - enabled?: boolean, + clientId?: string | null, + clientSecret?: string | null, + enabled?: boolean | null, ): Promise<Models.OAuth2Appwrite>; updateOAuth2Appwrite( paramsOrFirst?: - | { clientId?: string; clientSecret?: string; enabled?: boolean } - | string, - ...rest: [string?, boolean?] + | { + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; + } + | string + | null, + ...rest: [(string | null)?, (boolean | null)?] ): Promise<Models.OAuth2Appwrite> { let params: { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }; if ( @@ -2784,15 +2836,15 @@ export class Project { !Array.isArray(paramsOrFirst)) ) { params = (paramsOrFirst || {}) as { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }; } else { params = { - clientId: paramsOrFirst as string, - clientSecret: rest[0] as string, - enabled: rest[1] as boolean, + clientId: paramsOrFirst as string | null, + clientSecret: rest[0] as string | null, + enabled: rest[1] as boolean | null, }; } @@ -2840,58 +2892,64 @@ export class Project { /** * Update the project OAuth2 Auth0 configuration. * - * @param {string} params.clientId - 'Client ID' of Auth0 OAuth2 app. For example: OaOkIA000000000000000000005KLSYq - * @param {string} params.clientSecret - 'Client Secret' of Auth0 OAuth2 app. For example: zXz0000-00000000000000000000000000000-00000000000000000000PJafnF - * @param {string} params.endpoint - Domain of Auth0 instance. For example: example.us.auth0.com - * @param {ProjectOAuth2Auth0Prompt[]} params.prompt - Array of Auth0 OAuth2 prompt values. If "none" is included, it must be the only element. "none" means: don't display any authentication or consent screens. "login" means: prompt the user to re-authenticate. "consent" means: prompt the user for consent. Pass an empty array to use the Auth0 default. - * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} params.clientId - 'Client ID' of Auth0 OAuth2 app. For example: OaOkIA000000000000000000005KLSYq + * @param {string | null} params.clientSecret - 'Client Secret' of Auth0 OAuth2 app. For example: zXz0000-00000000000000000000000000000-00000000000000000000PJafnF + * @param {string | null} params.endpoint - Domain of Auth0 instance. For example: example.us.auth0.com + * @param {boolean | null} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {ProjectOAuth2Auth0Prompt[] | null} params.prompt - Array of Auth0 OAuth2 prompt values. If "none" is included, it must be the only element. "none" means: don't display any authentication or consent screens. "login" means: prompt the user to re-authenticate. "consent" means: prompt the user for consent. Pass an empty array to use the Auth0 default. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Auth0>} */ updateOAuth2Auth0(params?: { - clientId?: string; - clientSecret?: string; - endpoint?: string; - prompt?: ProjectOAuth2Auth0Prompt[]; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + endpoint?: string | null; + enabled?: boolean | null; + prompt?: ProjectOAuth2Auth0Prompt[] | null; }): Promise<Models.OAuth2Auth0>; /** * Update the project OAuth2 Auth0 configuration. * - * @param {string} clientId - 'Client ID' of Auth0 OAuth2 app. For example: OaOkIA000000000000000000005KLSYq - * @param {string} clientSecret - 'Client Secret' of Auth0 OAuth2 app. For example: zXz0000-00000000000000000000000000000-00000000000000000000PJafnF - * @param {string} endpoint - Domain of Auth0 instance. For example: example.us.auth0.com - * @param {ProjectOAuth2Auth0Prompt[]} prompt - Array of Auth0 OAuth2 prompt values. If "none" is included, it must be the only element. "none" means: don't display any authentication or consent screens. "login" means: prompt the user to re-authenticate. "consent" means: prompt the user for consent. Pass an empty array to use the Auth0 default. - * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} clientId - 'Client ID' of Auth0 OAuth2 app. For example: OaOkIA000000000000000000005KLSYq + * @param {string | null} clientSecret - 'Client Secret' of Auth0 OAuth2 app. For example: zXz0000-00000000000000000000000000000-00000000000000000000PJafnF + * @param {string | null} endpoint - Domain of Auth0 instance. For example: example.us.auth0.com + * @param {boolean | null} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {ProjectOAuth2Auth0Prompt[] | null} prompt - Array of Auth0 OAuth2 prompt values. If "none" is included, it must be the only element. "none" means: don't display any authentication or consent screens. "login" means: prompt the user to re-authenticate. "consent" means: prompt the user for consent. Pass an empty array to use the Auth0 default. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Auth0>} * @deprecated Use the object parameter style method for a better developer experience. */ updateOAuth2Auth0( - clientId?: string, - clientSecret?: string, - endpoint?: string, - prompt?: ProjectOAuth2Auth0Prompt[], - enabled?: boolean, + clientId?: string | null, + clientSecret?: string | null, + endpoint?: string | null, + enabled?: boolean | null, + prompt?: ProjectOAuth2Auth0Prompt[] | null, ): Promise<Models.OAuth2Auth0>; updateOAuth2Auth0( paramsOrFirst?: | { - clientId?: string; - clientSecret?: string; - endpoint?: string; - prompt?: ProjectOAuth2Auth0Prompt[]; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + endpoint?: string | null; + enabled?: boolean | null; + prompt?: ProjectOAuth2Auth0Prompt[] | null; } - | string, - ...rest: [string?, string?, ProjectOAuth2Auth0Prompt[]?, boolean?] + | string + | null, + ...rest: [ + (string | null)?, + (string | null)?, + (boolean | null)?, + (ProjectOAuth2Auth0Prompt[] | null)?, + ] ): Promise<Models.OAuth2Auth0> { let params: { - clientId?: string; - clientSecret?: string; - endpoint?: string; - prompt?: ProjectOAuth2Auth0Prompt[]; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + endpoint?: string | null; + enabled?: boolean | null; + prompt?: ProjectOAuth2Auth0Prompt[] | null; }; if ( @@ -2901,27 +2959,27 @@ export class Project { !Array.isArray(paramsOrFirst)) ) { params = (paramsOrFirst || {}) as { - clientId?: string; - clientSecret?: string; - endpoint?: string; - prompt?: ProjectOAuth2Auth0Prompt[]; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + endpoint?: string | null; + enabled?: boolean | null; + prompt?: ProjectOAuth2Auth0Prompt[] | null; }; } else { params = { - clientId: paramsOrFirst as string, - clientSecret: rest[0] as string, - endpoint: rest[1] as string, - prompt: rest[2] as ProjectOAuth2Auth0Prompt[], - enabled: rest[3] as boolean, + clientId: paramsOrFirst as string | null, + clientSecret: rest[0] as string | null, + endpoint: rest[1] as string | null, + enabled: rest[2] as boolean | null, + prompt: rest[3] as ProjectOAuth2Auth0Prompt[] | null, }; } const clientId = params.clientId; const clientSecret = params.clientSecret; const endpoint = params.endpoint; - const prompt = params.prompt; const enabled = params.enabled; + const prompt = params.prompt; const apiPath = '/project/oauth2/auth0'; const apiPayload: Payload = {}; @@ -2934,12 +2992,12 @@ export class Project { if (typeof endpoint !== 'undefined') { apiPayload['endpoint'] = endpoint; } - if (typeof prompt !== 'undefined') { - apiPayload['prompt'] = prompt; - } if (typeof enabled !== 'undefined') { apiPayload['enabled'] = enabled; } + if (typeof prompt !== 'undefined') { + apiPayload['prompt'] = prompt; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -2971,52 +3029,53 @@ export class Project { /** * Update the project OAuth2 Authentik configuration. * - * @param {string} params.clientId - 'Client ID' of Authentik OAuth2 app. For example: dTKOPa0000000000000000000000000000e7G8hv - * @param {string} params.clientSecret - 'Client Secret' of Authentik OAuth2 app. For example: ntQadq000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000Hp5WK - * @param {string} params.endpoint - Domain of Authentik instance. For example: example.authentik.com - * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} params.clientId - 'Client ID' of Authentik OAuth2 app. For example: dTKOPa0000000000000000000000000000e7G8hv + * @param {string | null} params.clientSecret - 'Client Secret' of Authentik OAuth2 app. For example: ntQadq000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000Hp5WK + * @param {string | null} params.endpoint - Domain of Authentik instance. For example: example.authentik.com + * @param {boolean | null} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Authentik>} */ updateOAuth2Authentik(params?: { - clientId?: string; - clientSecret?: string; - endpoint?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + endpoint?: string | null; + enabled?: boolean | null; }): Promise<Models.OAuth2Authentik>; /** * Update the project OAuth2 Authentik configuration. * - * @param {string} clientId - 'Client ID' of Authentik OAuth2 app. For example: dTKOPa0000000000000000000000000000e7G8hv - * @param {string} clientSecret - 'Client Secret' of Authentik OAuth2 app. For example: ntQadq000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000Hp5WK - * @param {string} endpoint - Domain of Authentik instance. For example: example.authentik.com - * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} clientId - 'Client ID' of Authentik OAuth2 app. For example: dTKOPa0000000000000000000000000000e7G8hv + * @param {string | null} clientSecret - 'Client Secret' of Authentik OAuth2 app. For example: ntQadq000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000Hp5WK + * @param {string | null} endpoint - Domain of Authentik instance. For example: example.authentik.com + * @param {boolean | null} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Authentik>} * @deprecated Use the object parameter style method for a better developer experience. */ updateOAuth2Authentik( - clientId?: string, - clientSecret?: string, - endpoint?: string, - enabled?: boolean, + clientId?: string | null, + clientSecret?: string | null, + endpoint?: string | null, + enabled?: boolean | null, ): Promise<Models.OAuth2Authentik>; updateOAuth2Authentik( paramsOrFirst?: | { - clientId?: string; - clientSecret?: string; - endpoint?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + endpoint?: string | null; + enabled?: boolean | null; } - | string, - ...rest: [string?, string?, boolean?] + | string + | null, + ...rest: [(string | null)?, (string | null)?, (boolean | null)?] ): Promise<Models.OAuth2Authentik> { let params: { - clientId?: string; - clientSecret?: string; - endpoint?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + endpoint?: string | null; + enabled?: boolean | null; }; if ( @@ -3026,17 +3085,17 @@ export class Project { !Array.isArray(paramsOrFirst)) ) { params = (paramsOrFirst || {}) as { - clientId?: string; - clientSecret?: string; - endpoint?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + endpoint?: string | null; + enabled?: boolean | null; }; } else { params = { - clientId: paramsOrFirst as string, - clientSecret: rest[0] as string, - endpoint: rest[1] as string, - enabled: rest[2] as boolean, + clientId: paramsOrFirst as string | null, + clientSecret: rest[0] as string | null, + endpoint: rest[1] as string | null, + enabled: rest[2] as boolean | null, }; } @@ -3089,42 +3148,47 @@ export class Project { /** * Update the project OAuth2 Autodesk configuration. * - * @param {string} params.clientId - 'Client ID' of Autodesk OAuth2 app. For example: 5zw90v00000000000000000000kVYXN7 - * @param {string} params.clientSecret - 'Client Secret' of Autodesk OAuth2 app. For example: 7I000000000000MW - * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} params.clientId - 'Client ID' of Autodesk OAuth2 app. For example: 5zw90v00000000000000000000kVYXN7 + * @param {string | null} params.clientSecret - 'Client Secret' of Autodesk OAuth2 app. For example: 7I000000000000MW + * @param {boolean | null} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Autodesk>} */ updateOAuth2Autodesk(params?: { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }): Promise<Models.OAuth2Autodesk>; /** * Update the project OAuth2 Autodesk configuration. * - * @param {string} clientId - 'Client ID' of Autodesk OAuth2 app. For example: 5zw90v00000000000000000000kVYXN7 - * @param {string} clientSecret - 'Client Secret' of Autodesk OAuth2 app. For example: 7I000000000000MW - * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} clientId - 'Client ID' of Autodesk OAuth2 app. For example: 5zw90v00000000000000000000kVYXN7 + * @param {string | null} clientSecret - 'Client Secret' of Autodesk OAuth2 app. For example: 7I000000000000MW + * @param {boolean | null} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Autodesk>} * @deprecated Use the object parameter style method for a better developer experience. */ updateOAuth2Autodesk( - clientId?: string, - clientSecret?: string, - enabled?: boolean, + clientId?: string | null, + clientSecret?: string | null, + enabled?: boolean | null, ): Promise<Models.OAuth2Autodesk>; updateOAuth2Autodesk( paramsOrFirst?: - | { clientId?: string; clientSecret?: string; enabled?: boolean } - | string, - ...rest: [string?, boolean?] + | { + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; + } + | string + | null, + ...rest: [(string | null)?, (boolean | null)?] ): Promise<Models.OAuth2Autodesk> { let params: { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }; if ( @@ -3134,15 +3198,15 @@ export class Project { !Array.isArray(paramsOrFirst)) ) { params = (paramsOrFirst || {}) as { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }; } else { params = { - clientId: paramsOrFirst as string, - clientSecret: rest[0] as string, - enabled: rest[1] as boolean, + clientId: paramsOrFirst as string | null, + clientSecret: rest[0] as string | null, + enabled: rest[1] as boolean | null, }; } @@ -3190,38 +3254,48 @@ export class Project { /** * Update the project OAuth2 Bitbucket configuration. * - * @param {string} params.key - 'Key' of Bitbucket OAuth2 app. For example: Knt70000000000ByRc - * @param {string} params.secret - 'Secret' of Bitbucket OAuth2 app. For example: NMfLZJ00000000000000000000TLQdDx - * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} params.key - 'Key' of Bitbucket OAuth2 app. For example: Knt70000000000ByRc + * @param {string | null} params.secret - 'Secret' of Bitbucket OAuth2 app. For example: NMfLZJ00000000000000000000TLQdDx + * @param {boolean | null} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Bitbucket>} */ updateOAuth2Bitbucket(params?: { - key?: string; - secret?: string; - enabled?: boolean; + key?: string | null; + secret?: string | null; + enabled?: boolean | null; }): Promise<Models.OAuth2Bitbucket>; /** * Update the project OAuth2 Bitbucket configuration. * - * @param {string} key - 'Key' of Bitbucket OAuth2 app. For example: Knt70000000000ByRc - * @param {string} secret - 'Secret' of Bitbucket OAuth2 app. For example: NMfLZJ00000000000000000000TLQdDx - * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} key - 'Key' of Bitbucket OAuth2 app. For example: Knt70000000000ByRc + * @param {string | null} secret - 'Secret' of Bitbucket OAuth2 app. For example: NMfLZJ00000000000000000000TLQdDx + * @param {boolean | null} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Bitbucket>} * @deprecated Use the object parameter style method for a better developer experience. */ updateOAuth2Bitbucket( - key?: string, - secret?: string, - enabled?: boolean, + key?: string | null, + secret?: string | null, + enabled?: boolean | null, ): Promise<Models.OAuth2Bitbucket>; updateOAuth2Bitbucket( paramsOrFirst?: - { key?: string; secret?: string; enabled?: boolean } | string, - ...rest: [string?, boolean?] + | { + key?: string | null; + secret?: string | null; + enabled?: boolean | null; + } + | string + | null, + ...rest: [(string | null)?, (boolean | null)?] ): Promise<Models.OAuth2Bitbucket> { - let params: { key?: string; secret?: string; enabled?: boolean }; + let params: { + key?: string | null; + secret?: string | null; + enabled?: boolean | null; + }; if ( (typeof paramsOrFirst === 'undefined' && rest.length === 0) || @@ -3230,15 +3304,15 @@ export class Project { !Array.isArray(paramsOrFirst)) ) { params = (paramsOrFirst || {}) as { - key?: string; - secret?: string; - enabled?: boolean; + key?: string | null; + secret?: string | null; + enabled?: boolean | null; }; } else { params = { - key: paramsOrFirst as string, - secret: rest[0] as string, - enabled: rest[1] as boolean, + key: paramsOrFirst as string | null, + secret: rest[0] as string | null, + enabled: rest[1] as boolean | null, }; } @@ -3286,42 +3360,47 @@ export class Project { /** * Update the project OAuth2 Bitly configuration. * - * @param {string} params.clientId - 'Client ID' of Bitly OAuth2 app. For example: d95151000000000000000000000000000067af9b - * @param {string} params.clientSecret - 'Client Secret' of Bitly OAuth2 app. For example: a13e250000000000000000000000000000d73095 - * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} params.clientId - 'Client ID' of Bitly OAuth2 app. For example: d95151000000000000000000000000000067af9b + * @param {string | null} params.clientSecret - 'Client Secret' of Bitly OAuth2 app. For example: a13e250000000000000000000000000000d73095 + * @param {boolean | null} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Bitly>} */ updateOAuth2Bitly(params?: { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }): Promise<Models.OAuth2Bitly>; /** * Update the project OAuth2 Bitly configuration. * - * @param {string} clientId - 'Client ID' of Bitly OAuth2 app. For example: d95151000000000000000000000000000067af9b - * @param {string} clientSecret - 'Client Secret' of Bitly OAuth2 app. For example: a13e250000000000000000000000000000d73095 - * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} clientId - 'Client ID' of Bitly OAuth2 app. For example: d95151000000000000000000000000000067af9b + * @param {string | null} clientSecret - 'Client Secret' of Bitly OAuth2 app. For example: a13e250000000000000000000000000000d73095 + * @param {boolean | null} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Bitly>} * @deprecated Use the object parameter style method for a better developer experience. */ updateOAuth2Bitly( - clientId?: string, - clientSecret?: string, - enabled?: boolean, + clientId?: string | null, + clientSecret?: string | null, + enabled?: boolean | null, ): Promise<Models.OAuth2Bitly>; updateOAuth2Bitly( paramsOrFirst?: - | { clientId?: string; clientSecret?: string; enabled?: boolean } - | string, - ...rest: [string?, boolean?] + | { + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; + } + | string + | null, + ...rest: [(string | null)?, (boolean | null)?] ): Promise<Models.OAuth2Bitly> { let params: { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }; if ( @@ -3331,15 +3410,15 @@ export class Project { !Array.isArray(paramsOrFirst)) ) { params = (paramsOrFirst || {}) as { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }; } else { params = { - clientId: paramsOrFirst as string, - clientSecret: rest[0] as string, - enabled: rest[1] as boolean, + clientId: paramsOrFirst as string | null, + clientSecret: rest[0] as string | null, + enabled: rest[1] as boolean | null, }; } @@ -3387,42 +3466,47 @@ export class Project { /** * Update the project OAuth2 Box configuration. * - * @param {string} params.clientId - 'Client ID' of Box OAuth2 app. For example: deglcs00000000000000000000x2og6y - * @param {string} params.clientSecret - 'Client Secret' of Box OAuth2 app. For example: OKM1f100000000000000000000eshEif - * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} params.clientId - 'Client ID' of Box OAuth2 app. For example: deglcs00000000000000000000x2og6y + * @param {string | null} params.clientSecret - 'Client Secret' of Box OAuth2 app. For example: OKM1f100000000000000000000eshEif + * @param {boolean | null} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Box>} */ updateOAuth2Box(params?: { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }): Promise<Models.OAuth2Box>; /** * Update the project OAuth2 Box configuration. * - * @param {string} clientId - 'Client ID' of Box OAuth2 app. For example: deglcs00000000000000000000x2og6y - * @param {string} clientSecret - 'Client Secret' of Box OAuth2 app. For example: OKM1f100000000000000000000eshEif - * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} clientId - 'Client ID' of Box OAuth2 app. For example: deglcs00000000000000000000x2og6y + * @param {string | null} clientSecret - 'Client Secret' of Box OAuth2 app. For example: OKM1f100000000000000000000eshEif + * @param {boolean | null} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Box>} * @deprecated Use the object parameter style method for a better developer experience. */ updateOAuth2Box( - clientId?: string, - clientSecret?: string, - enabled?: boolean, + clientId?: string | null, + clientSecret?: string | null, + enabled?: boolean | null, ): Promise<Models.OAuth2Box>; updateOAuth2Box( paramsOrFirst?: - | { clientId?: string; clientSecret?: string; enabled?: boolean } - | string, - ...rest: [string?, boolean?] + | { + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; + } + | string + | null, + ...rest: [(string | null)?, (boolean | null)?] ): Promise<Models.OAuth2Box> { let params: { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }; if ( @@ -3432,15 +3516,15 @@ export class Project { !Array.isArray(paramsOrFirst)) ) { params = (paramsOrFirst || {}) as { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }; } else { params = { - clientId: paramsOrFirst as string, - clientSecret: rest[0] as string, - enabled: rest[1] as boolean, + clientId: paramsOrFirst as string | null, + clientSecret: rest[0] as string | null, + enabled: rest[1] as boolean | null, }; } @@ -3488,42 +3572,47 @@ export class Project { /** * Update the project OAuth2 Cloudflare configuration. * - * @param {string} params.clientId - 'Client ID' of Cloudflare OAuth2 app. For example: 4b866000000000000000000000c9e4e2 - * @param {string} params.clientSecret - 'Client Secret' of Cloudflare OAuth2 app. For example: cfoc_5Q6YRl0000000000000000000000000000000000003d214f - * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} params.clientId - 'Client ID' of Cloudflare OAuth2 app. For example: 4b866000000000000000000000c9e4e2 + * @param {string | null} params.clientSecret - 'Client Secret' of Cloudflare OAuth2 app. For example: cfoc_5Q6YRl0000000000000000000000000000000000003d214f + * @param {boolean | null} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Cloudflare>} */ updateOAuth2Cloudflare(params?: { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }): Promise<Models.OAuth2Cloudflare>; /** * Update the project OAuth2 Cloudflare configuration. * - * @param {string} clientId - 'Client ID' of Cloudflare OAuth2 app. For example: 4b866000000000000000000000c9e4e2 - * @param {string} clientSecret - 'Client Secret' of Cloudflare OAuth2 app. For example: cfoc_5Q6YRl0000000000000000000000000000000000003d214f - * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} clientId - 'Client ID' of Cloudflare OAuth2 app. For example: 4b866000000000000000000000c9e4e2 + * @param {string | null} clientSecret - 'Client Secret' of Cloudflare OAuth2 app. For example: cfoc_5Q6YRl0000000000000000000000000000000000003d214f + * @param {boolean | null} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Cloudflare>} * @deprecated Use the object parameter style method for a better developer experience. */ updateOAuth2Cloudflare( - clientId?: string, - clientSecret?: string, - enabled?: boolean, + clientId?: string | null, + clientSecret?: string | null, + enabled?: boolean | null, ): Promise<Models.OAuth2Cloudflare>; updateOAuth2Cloudflare( paramsOrFirst?: - | { clientId?: string; clientSecret?: string; enabled?: boolean } - | string, - ...rest: [string?, boolean?] + | { + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; + } + | string + | null, + ...rest: [(string | null)?, (boolean | null)?] ): Promise<Models.OAuth2Cloudflare> { let params: { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }; if ( @@ -3533,15 +3622,15 @@ export class Project { !Array.isArray(paramsOrFirst)) ) { params = (paramsOrFirst || {}) as { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }; } else { params = { - clientId: paramsOrFirst as string, - clientSecret: rest[0] as string, - enabled: rest[1] as boolean, + clientId: paramsOrFirst as string | null, + clientSecret: rest[0] as string | null, + enabled: rest[1] as boolean | null, }; } @@ -3589,38 +3678,48 @@ export class Project { /** * Update the project OAuth2 Dailymotion configuration. * - * @param {string} params.apiKey - 'API Key' of Dailymotion OAuth2 app. For example: 07a9000000000000067f - * @param {string} params.apiSecret - 'API Secret' of Dailymotion OAuth2 app. For example: a399a90000000000000000000000000000d90639 - * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} params.apiKey - 'API Key' of Dailymotion OAuth2 app. For example: 07a9000000000000067f + * @param {string | null} params.apiSecret - 'API Secret' of Dailymotion OAuth2 app. For example: a399a90000000000000000000000000000d90639 + * @param {boolean | null} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Dailymotion>} */ updateOAuth2Dailymotion(params?: { - apiKey?: string; - apiSecret?: string; - enabled?: boolean; + apiKey?: string | null; + apiSecret?: string | null; + enabled?: boolean | null; }): Promise<Models.OAuth2Dailymotion>; /** * Update the project OAuth2 Dailymotion configuration. * - * @param {string} apiKey - 'API Key' of Dailymotion OAuth2 app. For example: 07a9000000000000067f - * @param {string} apiSecret - 'API Secret' of Dailymotion OAuth2 app. For example: a399a90000000000000000000000000000d90639 - * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} apiKey - 'API Key' of Dailymotion OAuth2 app. For example: 07a9000000000000067f + * @param {string | null} apiSecret - 'API Secret' of Dailymotion OAuth2 app. For example: a399a90000000000000000000000000000d90639 + * @param {boolean | null} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Dailymotion>} * @deprecated Use the object parameter style method for a better developer experience. */ updateOAuth2Dailymotion( - apiKey?: string, - apiSecret?: string, - enabled?: boolean, + apiKey?: string | null, + apiSecret?: string | null, + enabled?: boolean | null, ): Promise<Models.OAuth2Dailymotion>; updateOAuth2Dailymotion( paramsOrFirst?: - { apiKey?: string; apiSecret?: string; enabled?: boolean } | string, - ...rest: [string?, boolean?] + | { + apiKey?: string | null; + apiSecret?: string | null; + enabled?: boolean | null; + } + | string + | null, + ...rest: [(string | null)?, (boolean | null)?] ): Promise<Models.OAuth2Dailymotion> { - let params: { apiKey?: string; apiSecret?: string; enabled?: boolean }; + let params: { + apiKey?: string | null; + apiSecret?: string | null; + enabled?: boolean | null; + }; if ( (typeof paramsOrFirst === 'undefined' && rest.length === 0) || @@ -3629,15 +3728,15 @@ export class Project { !Array.isArray(paramsOrFirst)) ) { params = (paramsOrFirst || {}) as { - apiKey?: string; - apiSecret?: string; - enabled?: boolean; + apiKey?: string | null; + apiSecret?: string | null; + enabled?: boolean | null; }; } else { params = { - apiKey: paramsOrFirst as string, - apiSecret: rest[0] as string, - enabled: rest[1] as boolean, + apiKey: paramsOrFirst as string | null, + apiSecret: rest[0] as string | null, + enabled: rest[1] as boolean | null, }; } @@ -3685,52 +3784,57 @@ export class Project { /** * Update the project OAuth2 Discord configuration. * - * @param {string} params.clientId - 'Client ID' of Discord OAuth2 app. For example: 950722000000343754 - * @param {string} params.clientSecret - 'Client Secret' of Discord OAuth2 app. For example: YmPXnM000000000000000000002zFg5D - * @param {ProjectOAuth2DiscordPrompt[]} params.prompt - Array with at most one Discord OAuth2 prompt value. "none" means: skip the authorization screen for users who already authorized the app with the requested scopes. "consent" means: ask users who already authorized the app to approve it again. Pass an empty array to use the Discord default. - * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} params.clientId - 'Client ID' of Discord OAuth2 app. For example: 950722000000343754 + * @param {string | null} params.clientSecret - 'Client Secret' of Discord OAuth2 app. For example: YmPXnM000000000000000000002zFg5D + * @param {boolean | null} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {ProjectOAuth2DiscordPrompt[] | null} params.prompt - Array with at most one Discord OAuth2 prompt value. "none" means: skip the authorization screen for users who already authorized the app with the requested scopes. "consent" means: ask users who already authorized the app to approve it again. Pass an empty array to use the Discord default. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Discord>} */ updateOAuth2Discord(params?: { - clientId?: string; - clientSecret?: string; - prompt?: ProjectOAuth2DiscordPrompt[]; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; + prompt?: ProjectOAuth2DiscordPrompt[] | null; }): Promise<Models.OAuth2Discord>; /** * Update the project OAuth2 Discord configuration. * - * @param {string} clientId - 'Client ID' of Discord OAuth2 app. For example: 950722000000343754 - * @param {string} clientSecret - 'Client Secret' of Discord OAuth2 app. For example: YmPXnM000000000000000000002zFg5D - * @param {ProjectOAuth2DiscordPrompt[]} prompt - Array with at most one Discord OAuth2 prompt value. "none" means: skip the authorization screen for users who already authorized the app with the requested scopes. "consent" means: ask users who already authorized the app to approve it again. Pass an empty array to use the Discord default. - * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} clientId - 'Client ID' of Discord OAuth2 app. For example: 950722000000343754 + * @param {string | null} clientSecret - 'Client Secret' of Discord OAuth2 app. For example: YmPXnM000000000000000000002zFg5D + * @param {boolean | null} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {ProjectOAuth2DiscordPrompt[] | null} prompt - Array with at most one Discord OAuth2 prompt value. "none" means: skip the authorization screen for users who already authorized the app with the requested scopes. "consent" means: ask users who already authorized the app to approve it again. Pass an empty array to use the Discord default. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Discord>} * @deprecated Use the object parameter style method for a better developer experience. */ updateOAuth2Discord( - clientId?: string, - clientSecret?: string, - prompt?: ProjectOAuth2DiscordPrompt[], - enabled?: boolean, + clientId?: string | null, + clientSecret?: string | null, + enabled?: boolean | null, + prompt?: ProjectOAuth2DiscordPrompt[] | null, ): Promise<Models.OAuth2Discord>; updateOAuth2Discord( paramsOrFirst?: | { - clientId?: string; - clientSecret?: string; - prompt?: ProjectOAuth2DiscordPrompt[]; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; + prompt?: ProjectOAuth2DiscordPrompt[] | null; } - | string, - ...rest: [string?, ProjectOAuth2DiscordPrompt[]?, boolean?] + | string + | null, + ...rest: [ + (string | null)?, + (boolean | null)?, + (ProjectOAuth2DiscordPrompt[] | null)?, + ] ): Promise<Models.OAuth2Discord> { let params: { - clientId?: string; - clientSecret?: string; - prompt?: ProjectOAuth2DiscordPrompt[]; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; + prompt?: ProjectOAuth2DiscordPrompt[] | null; }; if ( @@ -3740,24 +3844,24 @@ export class Project { !Array.isArray(paramsOrFirst)) ) { params = (paramsOrFirst || {}) as { - clientId?: string; - clientSecret?: string; - prompt?: ProjectOAuth2DiscordPrompt[]; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; + prompt?: ProjectOAuth2DiscordPrompt[] | null; }; } else { params = { - clientId: paramsOrFirst as string, - clientSecret: rest[0] as string, - prompt: rest[1] as ProjectOAuth2DiscordPrompt[], - enabled: rest[2] as boolean, + clientId: paramsOrFirst as string | null, + clientSecret: rest[0] as string | null, + enabled: rest[1] as boolean | null, + prompt: rest[2] as ProjectOAuth2DiscordPrompt[] | null, }; } const clientId = params.clientId; const clientSecret = params.clientSecret; - const prompt = params.prompt; const enabled = params.enabled; + const prompt = params.prompt; const apiPath = '/project/oauth2/discord'; const apiPayload: Payload = {}; @@ -3767,12 +3871,12 @@ export class Project { if (typeof clientSecret !== 'undefined') { apiPayload['clientSecret'] = clientSecret; } - if (typeof prompt !== 'undefined') { - apiPayload['prompt'] = prompt; - } if (typeof enabled !== 'undefined') { apiPayload['enabled'] = enabled; } + if (typeof prompt !== 'undefined') { + apiPayload['prompt'] = prompt; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -3803,42 +3907,47 @@ export class Project { /** * Update the project OAuth2 Disqus configuration. * - * @param {string} params.publicKey - 'Public Key, also known as API Key' of Disqus OAuth2 app. For example: cgegH70000000000000000000000000000000000000000000000000000Hr1nYX - * @param {string} params.secretKey - 'Secret Key, also known as API Secret' of Disqus OAuth2 app. For example: W7Bykj00000000000000000000000000000000000000000000000000003o43w9 - * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} params.publicKey - 'Public Key, also known as API Key' of Disqus OAuth2 app. For example: cgegH70000000000000000000000000000000000000000000000000000Hr1nYX + * @param {string | null} params.secretKey - 'Secret Key, also known as API Secret' of Disqus OAuth2 app. For example: W7Bykj00000000000000000000000000000000000000000000000000003o43w9 + * @param {boolean | null} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Disqus>} */ updateOAuth2Disqus(params?: { - publicKey?: string; - secretKey?: string; - enabled?: boolean; + publicKey?: string | null; + secretKey?: string | null; + enabled?: boolean | null; }): Promise<Models.OAuth2Disqus>; /** * Update the project OAuth2 Disqus configuration. * - * @param {string} publicKey - 'Public Key, also known as API Key' of Disqus OAuth2 app. For example: cgegH70000000000000000000000000000000000000000000000000000Hr1nYX - * @param {string} secretKey - 'Secret Key, also known as API Secret' of Disqus OAuth2 app. For example: W7Bykj00000000000000000000000000000000000000000000000000003o43w9 - * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} publicKey - 'Public Key, also known as API Key' of Disqus OAuth2 app. For example: cgegH70000000000000000000000000000000000000000000000000000Hr1nYX + * @param {string | null} secretKey - 'Secret Key, also known as API Secret' of Disqus OAuth2 app. For example: W7Bykj00000000000000000000000000000000000000000000000000003o43w9 + * @param {boolean | null} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Disqus>} * @deprecated Use the object parameter style method for a better developer experience. */ updateOAuth2Disqus( - publicKey?: string, - secretKey?: string, - enabled?: boolean, + publicKey?: string | null, + secretKey?: string | null, + enabled?: boolean | null, ): Promise<Models.OAuth2Disqus>; updateOAuth2Disqus( paramsOrFirst?: - | { publicKey?: string; secretKey?: string; enabled?: boolean } - | string, - ...rest: [string?, boolean?] + | { + publicKey?: string | null; + secretKey?: string | null; + enabled?: boolean | null; + } + | string + | null, + ...rest: [(string | null)?, (boolean | null)?] ): Promise<Models.OAuth2Disqus> { let params: { - publicKey?: string; - secretKey?: string; - enabled?: boolean; + publicKey?: string | null; + secretKey?: string | null; + enabled?: boolean | null; }; if ( @@ -3848,15 +3957,15 @@ export class Project { !Array.isArray(paramsOrFirst)) ) { params = (paramsOrFirst || {}) as { - publicKey?: string; - secretKey?: string; - enabled?: boolean; + publicKey?: string | null; + secretKey?: string | null; + enabled?: boolean | null; }; } else { params = { - publicKey: paramsOrFirst as string, - secretKey: rest[0] as string, - enabled: rest[1] as boolean, + publicKey: paramsOrFirst as string | null, + secretKey: rest[0] as string | null, + enabled: rest[1] as boolean | null, }; } @@ -3904,38 +4013,48 @@ export class Project { /** * Update the project OAuth2 Dropbox configuration. * - * @param {string} params.appKey - 'App Key' of Dropbox OAuth2 app. For example: jl000000000009t - * @param {string} params.appSecret - 'App Secret' of Dropbox OAuth2 app. For example: g200000000000vw - * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} params.appKey - 'App Key' of Dropbox OAuth2 app. For example: jl000000000009t + * @param {string | null} params.appSecret - 'App Secret' of Dropbox OAuth2 app. For example: g200000000000vw + * @param {boolean | null} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Dropbox>} */ updateOAuth2Dropbox(params?: { - appKey?: string; - appSecret?: string; - enabled?: boolean; + appKey?: string | null; + appSecret?: string | null; + enabled?: boolean | null; }): Promise<Models.OAuth2Dropbox>; /** * Update the project OAuth2 Dropbox configuration. * - * @param {string} appKey - 'App Key' of Dropbox OAuth2 app. For example: jl000000000009t - * @param {string} appSecret - 'App Secret' of Dropbox OAuth2 app. For example: g200000000000vw - * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} appKey - 'App Key' of Dropbox OAuth2 app. For example: jl000000000009t + * @param {string | null} appSecret - 'App Secret' of Dropbox OAuth2 app. For example: g200000000000vw + * @param {boolean | null} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Dropbox>} * @deprecated Use the object parameter style method for a better developer experience. */ updateOAuth2Dropbox( - appKey?: string, - appSecret?: string, - enabled?: boolean, + appKey?: string | null, + appSecret?: string | null, + enabled?: boolean | null, ): Promise<Models.OAuth2Dropbox>; updateOAuth2Dropbox( paramsOrFirst?: - { appKey?: string; appSecret?: string; enabled?: boolean } | string, - ...rest: [string?, boolean?] + | { + appKey?: string | null; + appSecret?: string | null; + enabled?: boolean | null; + } + | string + | null, + ...rest: [(string | null)?, (boolean | null)?] ): Promise<Models.OAuth2Dropbox> { - let params: { appKey?: string; appSecret?: string; enabled?: boolean }; + let params: { + appKey?: string | null; + appSecret?: string | null; + enabled?: boolean | null; + }; if ( (typeof paramsOrFirst === 'undefined' && rest.length === 0) || @@ -3944,15 +4063,15 @@ export class Project { !Array.isArray(paramsOrFirst)) ) { params = (paramsOrFirst || {}) as { - appKey?: string; - appSecret?: string; - enabled?: boolean; + appKey?: string | null; + appSecret?: string | null; + enabled?: boolean | null; }; } else { params = { - appKey: paramsOrFirst as string, - appSecret: rest[0] as string, - enabled: rest[1] as boolean, + appKey: paramsOrFirst as string | null, + appSecret: rest[0] as string | null, + enabled: rest[1] as boolean | null, }; } @@ -4000,42 +4119,47 @@ export class Project { /** * Update the project OAuth2 Etsy configuration. * - * @param {string} params.keyString - 'Keystring' of Etsy OAuth2 app. For example: nsgzxh0000000000008j85a2 - * @param {string} params.sharedSecret - 'Shared Secret' of Etsy OAuth2 app. For example: tp000000ru - * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} params.keyString - 'Keystring' of Etsy OAuth2 app. For example: nsgzxh0000000000008j85a2 + * @param {string | null} params.sharedSecret - 'Shared Secret' of Etsy OAuth2 app. For example: tp000000ru + * @param {boolean | null} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Etsy>} */ updateOAuth2Etsy(params?: { - keyString?: string; - sharedSecret?: string; - enabled?: boolean; + keyString?: string | null; + sharedSecret?: string | null; + enabled?: boolean | null; }): Promise<Models.OAuth2Etsy>; /** * Update the project OAuth2 Etsy configuration. * - * @param {string} keyString - 'Keystring' of Etsy OAuth2 app. For example: nsgzxh0000000000008j85a2 - * @param {string} sharedSecret - 'Shared Secret' of Etsy OAuth2 app. For example: tp000000ru - * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} keyString - 'Keystring' of Etsy OAuth2 app. For example: nsgzxh0000000000008j85a2 + * @param {string | null} sharedSecret - 'Shared Secret' of Etsy OAuth2 app. For example: tp000000ru + * @param {boolean | null} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Etsy>} * @deprecated Use the object parameter style method for a better developer experience. */ updateOAuth2Etsy( - keyString?: string, - sharedSecret?: string, - enabled?: boolean, + keyString?: string | null, + sharedSecret?: string | null, + enabled?: boolean | null, ): Promise<Models.OAuth2Etsy>; updateOAuth2Etsy( paramsOrFirst?: - | { keyString?: string; sharedSecret?: string; enabled?: boolean } - | string, - ...rest: [string?, boolean?] + | { + keyString?: string | null; + sharedSecret?: string | null; + enabled?: boolean | null; + } + | string + | null, + ...rest: [(string | null)?, (boolean | null)?] ): Promise<Models.OAuth2Etsy> { let params: { - keyString?: string; - sharedSecret?: string; - enabled?: boolean; + keyString?: string | null; + sharedSecret?: string | null; + enabled?: boolean | null; }; if ( @@ -4045,15 +4169,15 @@ export class Project { !Array.isArray(paramsOrFirst)) ) { params = (paramsOrFirst || {}) as { - keyString?: string; - sharedSecret?: string; - enabled?: boolean; + keyString?: string | null; + sharedSecret?: string | null; + enabled?: boolean | null; }; } else { params = { - keyString: paramsOrFirst as string, - sharedSecret: rest[0] as string, - enabled: rest[1] as boolean, + keyString: paramsOrFirst as string | null, + sharedSecret: rest[0] as string | null, + enabled: rest[1] as boolean | null, }; } @@ -4101,38 +4225,48 @@ export class Project { /** * Update the project OAuth2 Facebook configuration. * - * @param {string} params.appId - 'App ID' of Facebook OAuth2 app. For example: 260600000007694 - * @param {string} params.appSecret - 'App Secret' of Facebook OAuth2 app. For example: 2d0b2800000000000000000000d38af4 - * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} params.appId - 'App ID' of Facebook OAuth2 app. For example: 260600000007694 + * @param {string | null} params.appSecret - 'App Secret' of Facebook OAuth2 app. For example: 2d0b2800000000000000000000d38af4 + * @param {boolean | null} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Facebook>} */ updateOAuth2Facebook(params?: { - appId?: string; - appSecret?: string; - enabled?: boolean; + appId?: string | null; + appSecret?: string | null; + enabled?: boolean | null; }): Promise<Models.OAuth2Facebook>; /** * Update the project OAuth2 Facebook configuration. * - * @param {string} appId - 'App ID' of Facebook OAuth2 app. For example: 260600000007694 - * @param {string} appSecret - 'App Secret' of Facebook OAuth2 app. For example: 2d0b2800000000000000000000d38af4 - * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} appId - 'App ID' of Facebook OAuth2 app. For example: 260600000007694 + * @param {string | null} appSecret - 'App Secret' of Facebook OAuth2 app. For example: 2d0b2800000000000000000000d38af4 + * @param {boolean | null} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Facebook>} * @deprecated Use the object parameter style method for a better developer experience. */ updateOAuth2Facebook( - appId?: string, - appSecret?: string, - enabled?: boolean, + appId?: string | null, + appSecret?: string | null, + enabled?: boolean | null, ): Promise<Models.OAuth2Facebook>; updateOAuth2Facebook( paramsOrFirst?: - { appId?: string; appSecret?: string; enabled?: boolean } | string, - ...rest: [string?, boolean?] + | { + appId?: string | null; + appSecret?: string | null; + enabled?: boolean | null; + } + | string + | null, + ...rest: [(string | null)?, (boolean | null)?] ): Promise<Models.OAuth2Facebook> { - let params: { appId?: string; appSecret?: string; enabled?: boolean }; + let params: { + appId?: string | null; + appSecret?: string | null; + enabled?: boolean | null; + }; if ( (typeof paramsOrFirst === 'undefined' && rest.length === 0) || @@ -4141,15 +4275,15 @@ export class Project { !Array.isArray(paramsOrFirst)) ) { params = (paramsOrFirst || {}) as { - appId?: string; - appSecret?: string; - enabled?: boolean; + appId?: string | null; + appSecret?: string | null; + enabled?: boolean | null; }; } else { params = { - appId: paramsOrFirst as string, - appSecret: rest[0] as string, - enabled: rest[1] as boolean, + appId: paramsOrFirst as string | null, + appSecret: rest[0] as string | null, + enabled: rest[1] as boolean | null, }; } @@ -4197,42 +4331,47 @@ export class Project { /** * Update the project OAuth2 Figma configuration. * - * @param {string} params.clientId - 'Client ID' of Figma OAuth2 app. For example: byay5H0000000000VtiI40 - * @param {string} params.clientSecret - 'Client Secret' of Figma OAuth2 app. For example: yEpOYn0000000000000000004iIsU5 - * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} params.clientId - 'Client ID' of Figma OAuth2 app. For example: byay5H0000000000VtiI40 + * @param {string | null} params.clientSecret - 'Client Secret' of Figma OAuth2 app. For example: yEpOYn0000000000000000004iIsU5 + * @param {boolean | null} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Figma>} */ updateOAuth2Figma(params?: { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }): Promise<Models.OAuth2Figma>; /** * Update the project OAuth2 Figma configuration. * - * @param {string} clientId - 'Client ID' of Figma OAuth2 app. For example: byay5H0000000000VtiI40 - * @param {string} clientSecret - 'Client Secret' of Figma OAuth2 app. For example: yEpOYn0000000000000000004iIsU5 - * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} clientId - 'Client ID' of Figma OAuth2 app. For example: byay5H0000000000VtiI40 + * @param {string | null} clientSecret - 'Client Secret' of Figma OAuth2 app. For example: yEpOYn0000000000000000004iIsU5 + * @param {boolean | null} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Figma>} * @deprecated Use the object parameter style method for a better developer experience. */ updateOAuth2Figma( - clientId?: string, - clientSecret?: string, - enabled?: boolean, + clientId?: string | null, + clientSecret?: string | null, + enabled?: boolean | null, ): Promise<Models.OAuth2Figma>; updateOAuth2Figma( paramsOrFirst?: - | { clientId?: string; clientSecret?: string; enabled?: boolean } - | string, - ...rest: [string?, boolean?] + | { + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; + } + | string + | null, + ...rest: [(string | null)?, (boolean | null)?] ): Promise<Models.OAuth2Figma> { let params: { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }; if ( @@ -4242,15 +4381,15 @@ export class Project { !Array.isArray(paramsOrFirst)) ) { params = (paramsOrFirst || {}) as { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }; } else { params = { - clientId: paramsOrFirst as string, - clientSecret: rest[0] as string, - enabled: rest[1] as boolean, + clientId: paramsOrFirst as string | null, + clientSecret: rest[0] as string | null, + enabled: rest[1] as boolean | null, }; } @@ -4298,52 +4437,53 @@ export class Project { /** * Update the project OAuth2 FusionAuth configuration. * - * @param {string} params.clientId - 'Client ID' of FusionAuth OAuth2 app. For example: b2222c00-0000-0000-0000-000000862097 - * @param {string} params.clientSecret - 'Client Secret' of FusionAuth OAuth2 app. For example: Jx4s0C0000000000000000000000000000000wGqLsc - * @param {string} params.endpoint - Domain of FusionAuth instance. For example: example.fusionauth.io - * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} params.clientId - 'Client ID' of FusionAuth OAuth2 app. For example: b2222c00-0000-0000-0000-000000862097 + * @param {string | null} params.clientSecret - 'Client Secret' of FusionAuth OAuth2 app. For example: Jx4s0C0000000000000000000000000000000wGqLsc + * @param {string | null} params.endpoint - Domain of FusionAuth instance. For example: example.fusionauth.io + * @param {boolean | null} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2FusionAuth>} */ updateOAuth2FusionAuth(params?: { - clientId?: string; - clientSecret?: string; - endpoint?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + endpoint?: string | null; + enabled?: boolean | null; }): Promise<Models.OAuth2FusionAuth>; /** * Update the project OAuth2 FusionAuth configuration. * - * @param {string} clientId - 'Client ID' of FusionAuth OAuth2 app. For example: b2222c00-0000-0000-0000-000000862097 - * @param {string} clientSecret - 'Client Secret' of FusionAuth OAuth2 app. For example: Jx4s0C0000000000000000000000000000000wGqLsc - * @param {string} endpoint - Domain of FusionAuth instance. For example: example.fusionauth.io - * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} clientId - 'Client ID' of FusionAuth OAuth2 app. For example: b2222c00-0000-0000-0000-000000862097 + * @param {string | null} clientSecret - 'Client Secret' of FusionAuth OAuth2 app. For example: Jx4s0C0000000000000000000000000000000wGqLsc + * @param {string | null} endpoint - Domain of FusionAuth instance. For example: example.fusionauth.io + * @param {boolean | null} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2FusionAuth>} * @deprecated Use the object parameter style method for a better developer experience. */ updateOAuth2FusionAuth( - clientId?: string, - clientSecret?: string, - endpoint?: string, - enabled?: boolean, + clientId?: string | null, + clientSecret?: string | null, + endpoint?: string | null, + enabled?: boolean | null, ): Promise<Models.OAuth2FusionAuth>; updateOAuth2FusionAuth( paramsOrFirst?: | { - clientId?: string; - clientSecret?: string; - endpoint?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + endpoint?: string | null; + enabled?: boolean | null; } - | string, - ...rest: [string?, string?, boolean?] + | string + | null, + ...rest: [(string | null)?, (string | null)?, (boolean | null)?] ): Promise<Models.OAuth2FusionAuth> { let params: { - clientId?: string; - clientSecret?: string; - endpoint?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + endpoint?: string | null; + enabled?: boolean | null; }; if ( @@ -4353,17 +4493,17 @@ export class Project { !Array.isArray(paramsOrFirst)) ) { params = (paramsOrFirst || {}) as { - clientId?: string; - clientSecret?: string; - endpoint?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + endpoint?: string | null; + enabled?: boolean | null; }; } else { params = { - clientId: paramsOrFirst as string, - clientSecret: rest[0] as string, - endpoint: rest[1] as string, - enabled: rest[2] as boolean, + clientId: paramsOrFirst as string | null, + clientSecret: rest[0] as string | null, + endpoint: rest[1] as string | null, + enabled: rest[2] as boolean | null, }; } @@ -4416,52 +4556,57 @@ export class Project { /** * Update the project OAuth2 GitHub configuration. * - * @param {string} params.clientId - 'OAuth2 app Client ID, or App ID' of GitHub OAuth2 app. For example: e4d87900000000540733. Example of wrong value: 370006 - * @param {string} params.clientSecret - 'Client Secret' of GitHub OAuth2 app. For example: 5e07c00000000000000000000000000000198bcc - * @param {ProjectOAuth2GitHubPrompt[]} params.prompt - Array of GitHub OAuth2 prompt values. "select_account" means: prompt the user to select an account. Pass an empty array to use the GitHub default. - * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} params.clientId - 'OAuth2 app Client ID, or App ID' of GitHub OAuth2 app. For example: e4d87900000000540733. Example of wrong value: 370006 + * @param {string | null} params.clientSecret - 'Client Secret' of GitHub OAuth2 app. For example: 5e07c00000000000000000000000000000198bcc + * @param {boolean | null} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {ProjectOAuth2GitHubPrompt[] | null} params.prompt - Array of GitHub OAuth2 prompt values. "select_account" means: prompt the user to select an account. Pass an empty array to use the GitHub default. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Github>} */ updateOAuth2GitHub(params?: { - clientId?: string; - clientSecret?: string; - prompt?: ProjectOAuth2GitHubPrompt[]; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; + prompt?: ProjectOAuth2GitHubPrompt[] | null; }): Promise<Models.OAuth2Github>; /** * Update the project OAuth2 GitHub configuration. * - * @param {string} clientId - 'OAuth2 app Client ID, or App ID' of GitHub OAuth2 app. For example: e4d87900000000540733. Example of wrong value: 370006 - * @param {string} clientSecret - 'Client Secret' of GitHub OAuth2 app. For example: 5e07c00000000000000000000000000000198bcc - * @param {ProjectOAuth2GitHubPrompt[]} prompt - Array of GitHub OAuth2 prompt values. "select_account" means: prompt the user to select an account. Pass an empty array to use the GitHub default. - * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} clientId - 'OAuth2 app Client ID, or App ID' of GitHub OAuth2 app. For example: e4d87900000000540733. Example of wrong value: 370006 + * @param {string | null} clientSecret - 'Client Secret' of GitHub OAuth2 app. For example: 5e07c00000000000000000000000000000198bcc + * @param {boolean | null} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {ProjectOAuth2GitHubPrompt[] | null} prompt - Array of GitHub OAuth2 prompt values. "select_account" means: prompt the user to select an account. Pass an empty array to use the GitHub default. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Github>} * @deprecated Use the object parameter style method for a better developer experience. */ updateOAuth2GitHub( - clientId?: string, - clientSecret?: string, - prompt?: ProjectOAuth2GitHubPrompt[], - enabled?: boolean, + clientId?: string | null, + clientSecret?: string | null, + enabled?: boolean | null, + prompt?: ProjectOAuth2GitHubPrompt[] | null, ): Promise<Models.OAuth2Github>; updateOAuth2GitHub( paramsOrFirst?: | { - clientId?: string; - clientSecret?: string; - prompt?: ProjectOAuth2GitHubPrompt[]; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; + prompt?: ProjectOAuth2GitHubPrompt[] | null; } - | string, - ...rest: [string?, ProjectOAuth2GitHubPrompt[]?, boolean?] + | string + | null, + ...rest: [ + (string | null)?, + (boolean | null)?, + (ProjectOAuth2GitHubPrompt[] | null)?, + ] ): Promise<Models.OAuth2Github> { let params: { - clientId?: string; - clientSecret?: string; - prompt?: ProjectOAuth2GitHubPrompt[]; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; + prompt?: ProjectOAuth2GitHubPrompt[] | null; }; if ( @@ -4471,24 +4616,24 @@ export class Project { !Array.isArray(paramsOrFirst)) ) { params = (paramsOrFirst || {}) as { - clientId?: string; - clientSecret?: string; - prompt?: ProjectOAuth2GitHubPrompt[]; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; + prompt?: ProjectOAuth2GitHubPrompt[] | null; }; } else { params = { - clientId: paramsOrFirst as string, - clientSecret: rest[0] as string, - prompt: rest[1] as ProjectOAuth2GitHubPrompt[], - enabled: rest[2] as boolean, + clientId: paramsOrFirst as string | null, + clientSecret: rest[0] as string | null, + enabled: rest[1] as boolean | null, + prompt: rest[2] as ProjectOAuth2GitHubPrompt[] | null, }; } const clientId = params.clientId; const clientSecret = params.clientSecret; - const prompt = params.prompt; const enabled = params.enabled; + const prompt = params.prompt; const apiPath = '/project/oauth2/github'; const apiPayload: Payload = {}; @@ -4498,12 +4643,12 @@ export class Project { if (typeof clientSecret !== 'undefined') { apiPayload['clientSecret'] = clientSecret; } - if (typeof prompt !== 'undefined') { - apiPayload['prompt'] = prompt; - } if (typeof enabled !== 'undefined') { apiPayload['enabled'] = enabled; } + if (typeof prompt !== 'undefined') { + apiPayload['prompt'] = prompt; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -4534,52 +4679,53 @@ export class Project { /** * Update the project OAuth2 Gitlab configuration. * - * @param {string} params.applicationId - 'Application ID' of Gitlab OAuth2 app. For example: d41ffe0000000000000000000000000000000000000000000000000000d5e252 - * @param {string} params.secret - 'Secret' of Gitlab OAuth2 app. For example: gloas-838cfa0000000000000000000000000000000000000000000000000000ecbb38 - * @param {string} params.endpoint - Endpoint URL of self-hosted GitLab instance. For example: https://gitlab.com - * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} params.applicationId - 'Application ID' of Gitlab OAuth2 app. For example: d41ffe0000000000000000000000000000000000000000000000000000d5e252 + * @param {string | null} params.secret - 'Secret' of Gitlab OAuth2 app. For example: gloas-838cfa0000000000000000000000000000000000000000000000000000ecbb38 + * @param {string | null} params.endpoint - Endpoint URL of self-hosted GitLab instance. For example: https://gitlab.com + * @param {boolean | null} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Gitlab>} */ updateOAuth2Gitlab(params?: { - applicationId?: string; - secret?: string; - endpoint?: string; - enabled?: boolean; + applicationId?: string | null; + secret?: string | null; + endpoint?: string | null; + enabled?: boolean | null; }): Promise<Models.OAuth2Gitlab>; /** * Update the project OAuth2 Gitlab configuration. * - * @param {string} applicationId - 'Application ID' of Gitlab OAuth2 app. For example: d41ffe0000000000000000000000000000000000000000000000000000d5e252 - * @param {string} secret - 'Secret' of Gitlab OAuth2 app. For example: gloas-838cfa0000000000000000000000000000000000000000000000000000ecbb38 - * @param {string} endpoint - Endpoint URL of self-hosted GitLab instance. For example: https://gitlab.com - * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} applicationId - 'Application ID' of Gitlab OAuth2 app. For example: d41ffe0000000000000000000000000000000000000000000000000000d5e252 + * @param {string | null} secret - 'Secret' of Gitlab OAuth2 app. For example: gloas-838cfa0000000000000000000000000000000000000000000000000000ecbb38 + * @param {string | null} endpoint - Endpoint URL of self-hosted GitLab instance. For example: https://gitlab.com + * @param {boolean | null} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Gitlab>} * @deprecated Use the object parameter style method for a better developer experience. */ updateOAuth2Gitlab( - applicationId?: string, - secret?: string, - endpoint?: string, - enabled?: boolean, + applicationId?: string | null, + secret?: string | null, + endpoint?: string | null, + enabled?: boolean | null, ): Promise<Models.OAuth2Gitlab>; updateOAuth2Gitlab( paramsOrFirst?: | { - applicationId?: string; - secret?: string; - endpoint?: string; - enabled?: boolean; + applicationId?: string | null; + secret?: string | null; + endpoint?: string | null; + enabled?: boolean | null; } - | string, - ...rest: [string?, string?, boolean?] + | string + | null, + ...rest: [(string | null)?, (string | null)?, (boolean | null)?] ): Promise<Models.OAuth2Gitlab> { let params: { - applicationId?: string; - secret?: string; - endpoint?: string; - enabled?: boolean; + applicationId?: string | null; + secret?: string | null; + endpoint?: string | null; + enabled?: boolean | null; }; if ( @@ -4589,17 +4735,17 @@ export class Project { !Array.isArray(paramsOrFirst)) ) { params = (paramsOrFirst || {}) as { - applicationId?: string; - secret?: string; - endpoint?: string; - enabled?: boolean; + applicationId?: string | null; + secret?: string | null; + endpoint?: string | null; + enabled?: boolean | null; }; } else { params = { - applicationId: paramsOrFirst as string, - secret: rest[0] as string, - endpoint: rest[1] as string, - enabled: rest[2] as boolean, + applicationId: paramsOrFirst as string | null, + secret: rest[0] as string | null, + endpoint: rest[1] as string | null, + enabled: rest[2] as boolean | null, }; } @@ -4652,70 +4798,71 @@ export class Project { /** * Update the project OAuth2 Google configuration. * - * @param {string} params.clientId - 'Client ID' of Google OAuth2 app. For example: 120000000095-92ifjb00000000000000000000g7ijfb.apps.googleusercontent.com - * @param {string} params.clientSecret - 'Client Secret' of Google OAuth2 app. For example: GOCSPX-2k8gsR0000000000000000VNahJj - * @param {ProjectOAuth2GooglePrompt[]} params.prompt - Array of Google OAuth2 prompt values. If "none" is included, it must be the only element. "none" means: don't display any authentication or consent screens. Must not be specified with other values. "consent" means: prompt the user for consent. "select_account" means: prompt the user to select an account. - * @param {string[]} params.nativeClientIds - Additional OAuth2 client IDs accepted as ID token audiences for native sign-in (Android and iOS client IDs). Together with the client ID, which is always accepted, these are the only client IDs whose tokens are trusted. Pass an empty array to clear the list. - * @param {boolean} params.enabled - Browser-based OAuth2 sign-in status. Set to true to enable new session creation through the redirect flow. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. Has no effect on native sign-in, which is controlled by nativeEnabled only. - * @param {boolean} params.nativeEnabled - Native Google sign-in status. This is the only switch for creating sessions from ID tokens obtained on device and is independent of enabled. Needs a client ID or at least one native client ID to match tokens against, but no client secret: this method verifies a signature rather than redeeming an authorization code. + * @param {string | null} params.clientId - 'Client ID' of Google OAuth2 app. For example: 120000000095-92ifjb00000000000000000000g7ijfb.apps.googleusercontent.com + * @param {string | null} params.clientSecret - 'Client Secret' of Google OAuth2 app. For example: GOCSPX-2k8gsR0000000000000000VNahJj + * @param {ProjectOAuth2GooglePrompt[] | null} params.prompt - Array of Google OAuth2 prompt values. If "none" is included, it must be the only element. "none" means: don't display any authentication or consent screens. Must not be specified with other values. "consent" means: prompt the user for consent. "select_account" means: prompt the user to select an account. + * @param {boolean | null} params.enabled - Browser-based OAuth2 sign-in status. Set to true to enable new session creation through the redirect flow. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. Has no effect on native sign-in, which is controlled by nativeEnabled only. + * @param {string[] | null} params.nativeClientIds - Additional OAuth2 client IDs accepted as ID token audiences for native sign-in (Android and iOS client IDs). Together with the client ID, which is always accepted, these are the only client IDs whose tokens are trusted. Pass an empty array to clear the list. + * @param {boolean | null} params.nativeEnabled - Native Google sign-in status. This is the only switch for creating sessions from ID tokens obtained on device and is independent of enabled. Needs a client ID or at least one native client ID to match tokens against, but no client secret: this method verifies a signature rather than redeeming an authorization code. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Google>} */ updateOAuth2Google(params?: { - clientId?: string; - clientSecret?: string; - prompt?: ProjectOAuth2GooglePrompt[]; - nativeClientIds?: string[]; - enabled?: boolean; - nativeEnabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + prompt?: ProjectOAuth2GooglePrompt[] | null; + enabled?: boolean | null; + nativeClientIds?: string[] | null; + nativeEnabled?: boolean | null; }): Promise<Models.OAuth2Google>; /** * Update the project OAuth2 Google configuration. * - * @param {string} clientId - 'Client ID' of Google OAuth2 app. For example: 120000000095-92ifjb00000000000000000000g7ijfb.apps.googleusercontent.com - * @param {string} clientSecret - 'Client Secret' of Google OAuth2 app. For example: GOCSPX-2k8gsR0000000000000000VNahJj - * @param {ProjectOAuth2GooglePrompt[]} prompt - Array of Google OAuth2 prompt values. If "none" is included, it must be the only element. "none" means: don't display any authentication or consent screens. Must not be specified with other values. "consent" means: prompt the user for consent. "select_account" means: prompt the user to select an account. - * @param {string[]} nativeClientIds - Additional OAuth2 client IDs accepted as ID token audiences for native sign-in (Android and iOS client IDs). Together with the client ID, which is always accepted, these are the only client IDs whose tokens are trusted. Pass an empty array to clear the list. - * @param {boolean} enabled - Browser-based OAuth2 sign-in status. Set to true to enable new session creation through the redirect flow. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. Has no effect on native sign-in, which is controlled by nativeEnabled only. - * @param {boolean} nativeEnabled - Native Google sign-in status. This is the only switch for creating sessions from ID tokens obtained on device and is independent of enabled. Needs a client ID or at least one native client ID to match tokens against, but no client secret: this method verifies a signature rather than redeeming an authorization code. + * @param {string | null} clientId - 'Client ID' of Google OAuth2 app. For example: 120000000095-92ifjb00000000000000000000g7ijfb.apps.googleusercontent.com + * @param {string | null} clientSecret - 'Client Secret' of Google OAuth2 app. For example: GOCSPX-2k8gsR0000000000000000VNahJj + * @param {ProjectOAuth2GooglePrompt[] | null} prompt - Array of Google OAuth2 prompt values. If "none" is included, it must be the only element. "none" means: don't display any authentication or consent screens. Must not be specified with other values. "consent" means: prompt the user for consent. "select_account" means: prompt the user to select an account. + * @param {boolean | null} enabled - Browser-based OAuth2 sign-in status. Set to true to enable new session creation through the redirect flow. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. Has no effect on native sign-in, which is controlled by nativeEnabled only. + * @param {string[] | null} nativeClientIds - Additional OAuth2 client IDs accepted as ID token audiences for native sign-in (Android and iOS client IDs). Together with the client ID, which is always accepted, these are the only client IDs whose tokens are trusted. Pass an empty array to clear the list. + * @param {boolean | null} nativeEnabled - Native Google sign-in status. This is the only switch for creating sessions from ID tokens obtained on device and is independent of enabled. Needs a client ID or at least one native client ID to match tokens against, but no client secret: this method verifies a signature rather than redeeming an authorization code. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Google>} * @deprecated Use the object parameter style method for a better developer experience. */ updateOAuth2Google( - clientId?: string, - clientSecret?: string, - prompt?: ProjectOAuth2GooglePrompt[], - nativeClientIds?: string[], - enabled?: boolean, - nativeEnabled?: boolean, + clientId?: string | null, + clientSecret?: string | null, + prompt?: ProjectOAuth2GooglePrompt[] | null, + enabled?: boolean | null, + nativeClientIds?: string[] | null, + nativeEnabled?: boolean | null, ): Promise<Models.OAuth2Google>; updateOAuth2Google( paramsOrFirst?: | { - clientId?: string; - clientSecret?: string; - prompt?: ProjectOAuth2GooglePrompt[]; - nativeClientIds?: string[]; - enabled?: boolean; - nativeEnabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + prompt?: ProjectOAuth2GooglePrompt[] | null; + enabled?: boolean | null; + nativeClientIds?: string[] | null; + nativeEnabled?: boolean | null; } - | string, + | string + | null, ...rest: [ - string?, - ProjectOAuth2GooglePrompt[]?, - string[]?, - boolean?, - boolean?, + (string | null)?, + (ProjectOAuth2GooglePrompt[] | null)?, + (boolean | null)?, + (string[] | null)?, + (boolean | null)?, ] ): Promise<Models.OAuth2Google> { let params: { - clientId?: string; - clientSecret?: string; - prompt?: ProjectOAuth2GooglePrompt[]; - nativeClientIds?: string[]; - enabled?: boolean; - nativeEnabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + prompt?: ProjectOAuth2GooglePrompt[] | null; + enabled?: boolean | null; + nativeClientIds?: string[] | null; + nativeEnabled?: boolean | null; }; if ( @@ -4725,29 +4872,29 @@ export class Project { !Array.isArray(paramsOrFirst)) ) { params = (paramsOrFirst || {}) as { - clientId?: string; - clientSecret?: string; - prompt?: ProjectOAuth2GooglePrompt[]; - nativeClientIds?: string[]; - enabled?: boolean; - nativeEnabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + prompt?: ProjectOAuth2GooglePrompt[] | null; + enabled?: boolean | null; + nativeClientIds?: string[] | null; + nativeEnabled?: boolean | null; }; } else { params = { - clientId: paramsOrFirst as string, - clientSecret: rest[0] as string, - prompt: rest[1] as ProjectOAuth2GooglePrompt[], - nativeClientIds: rest[2] as string[], - enabled: rest[3] as boolean, - nativeEnabled: rest[4] as boolean, + clientId: paramsOrFirst as string | null, + clientSecret: rest[0] as string | null, + prompt: rest[1] as ProjectOAuth2GooglePrompt[] | null, + enabled: rest[2] as boolean | null, + nativeClientIds: rest[3] as string[] | null, + nativeEnabled: rest[4] as boolean | null, }; } const clientId = params.clientId; const clientSecret = params.clientSecret; const prompt = params.prompt; - const nativeClientIds = params.nativeClientIds; const enabled = params.enabled; + const nativeClientIds = params.nativeClientIds; const nativeEnabled = params.nativeEnabled; const apiPath = '/project/oauth2/google'; @@ -4761,12 +4908,12 @@ export class Project { if (typeof prompt !== 'undefined') { apiPayload['prompt'] = prompt; } - if (typeof nativeClientIds !== 'undefined') { - apiPayload['nativeClientIds'] = nativeClientIds; - } if (typeof enabled !== 'undefined') { apiPayload['enabled'] = enabled; } + if (typeof nativeClientIds !== 'undefined') { + apiPayload['nativeClientIds'] = nativeClientIds; + } if (typeof nativeEnabled !== 'undefined') { apiPayload['nativeEnabled'] = nativeEnabled; } @@ -4802,42 +4949,47 @@ export class Project { /** * Update the project OAuth2 Hugging Face configuration. * - * @param {string} params.clientId - 'Client ID' of Hugging Face OAuth2 app. For example: 2ab9cff9-d711-40ad-a91e-b08a49c42d24 - * @param {string} params.clientSecret - 'Client Secret' of Hugging Face OAuth2 app. For example: oauth_app_secret_wcLhRtl000000000000000000000xbNdLt - * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} params.clientId - 'Client ID' of Hugging Face OAuth2 app. For example: 2ab9cff9-d711-40ad-a91e-b08a49c42d24 + * @param {string | null} params.clientSecret - 'Client Secret' of Hugging Face OAuth2 app. For example: oauth_app_secret_wcLhRtl000000000000000000000xbNdLt + * @param {boolean | null} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2HuggingFace>} */ updateOAuth2HuggingFace(params?: { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }): Promise<Models.OAuth2HuggingFace>; /** * Update the project OAuth2 Hugging Face configuration. * - * @param {string} clientId - 'Client ID' of Hugging Face OAuth2 app. For example: 2ab9cff9-d711-40ad-a91e-b08a49c42d24 - * @param {string} clientSecret - 'Client Secret' of Hugging Face OAuth2 app. For example: oauth_app_secret_wcLhRtl000000000000000000000xbNdLt - * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} clientId - 'Client ID' of Hugging Face OAuth2 app. For example: 2ab9cff9-d711-40ad-a91e-b08a49c42d24 + * @param {string | null} clientSecret - 'Client Secret' of Hugging Face OAuth2 app. For example: oauth_app_secret_wcLhRtl000000000000000000000xbNdLt + * @param {boolean | null} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2HuggingFace>} * @deprecated Use the object parameter style method for a better developer experience. */ updateOAuth2HuggingFace( - clientId?: string, - clientSecret?: string, - enabled?: boolean, + clientId?: string | null, + clientSecret?: string | null, + enabled?: boolean | null, ): Promise<Models.OAuth2HuggingFace>; updateOAuth2HuggingFace( paramsOrFirst?: - | { clientId?: string; clientSecret?: string; enabled?: boolean } - | string, - ...rest: [string?, boolean?] + | { + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; + } + | string + | null, + ...rest: [(string | null)?, (boolean | null)?] ): Promise<Models.OAuth2HuggingFace> { let params: { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }; if ( @@ -4847,15 +4999,15 @@ export class Project { !Array.isArray(paramsOrFirst)) ) { params = (paramsOrFirst || {}) as { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }; } else { params = { - clientId: paramsOrFirst as string, - clientSecret: rest[0] as string, - enabled: rest[1] as boolean, + clientId: paramsOrFirst as string | null, + clientSecret: rest[0] as string | null, + enabled: rest[1] as boolean | null, }; } @@ -4903,52 +5055,57 @@ export class Project { /** * Update the project OAuth2 Kakao configuration. * - * @param {string} params.clientId - 'REST API key' of Kakao OAuth2 app. For example: 839ff5000000000000000000013206de - * @param {string} params.clientSecret - 'Client Secret' of Kakao OAuth2 app. For example: jLNVOK00000000000000000000yJebea. Generate it under Kakao Login > Security and set its status to enabled - * @param {ProjectOAuth2KakaoPrompt[]} params.prompt - Array of Kakao OAuth2 prompt values. If "none" is included, it must be the only element. "none" means: don't display any authentication or consent screens. "login" means: prompt the user to re-authenticate. "create" means: prompt the user to sign up. "select_account" means: prompt the user to select an account. Pass an empty array to use the Kakao default. - * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} params.clientId - 'REST API key' of Kakao OAuth2 app. For example: 839ff5000000000000000000013206de + * @param {string | null} params.clientSecret - 'Client Secret' of Kakao OAuth2 app. For example: jLNVOK00000000000000000000yJebea. Generate it under Kakao Login > Security and set its status to enabled + * @param {boolean | null} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {ProjectOAuth2KakaoPrompt[] | null} params.prompt - Array of Kakao OAuth2 prompt values. If "none" is included, it must be the only element. "none" means: don't display any authentication or consent screens. "login" means: prompt the user to re-authenticate. "create" means: prompt the user to sign up. "select_account" means: prompt the user to select an account. Pass an empty array to use the Kakao default. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Kakao>} */ updateOAuth2Kakao(params?: { - clientId?: string; - clientSecret?: string; - prompt?: ProjectOAuth2KakaoPrompt[]; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; + prompt?: ProjectOAuth2KakaoPrompt[] | null; }): Promise<Models.OAuth2Kakao>; /** * Update the project OAuth2 Kakao configuration. * - * @param {string} clientId - 'REST API key' of Kakao OAuth2 app. For example: 839ff5000000000000000000013206de - * @param {string} clientSecret - 'Client Secret' of Kakao OAuth2 app. For example: jLNVOK00000000000000000000yJebea. Generate it under Kakao Login > Security and set its status to enabled - * @param {ProjectOAuth2KakaoPrompt[]} prompt - Array of Kakao OAuth2 prompt values. If "none" is included, it must be the only element. "none" means: don't display any authentication or consent screens. "login" means: prompt the user to re-authenticate. "create" means: prompt the user to sign up. "select_account" means: prompt the user to select an account. Pass an empty array to use the Kakao default. - * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} clientId - 'REST API key' of Kakao OAuth2 app. For example: 839ff5000000000000000000013206de + * @param {string | null} clientSecret - 'Client Secret' of Kakao OAuth2 app. For example: jLNVOK00000000000000000000yJebea. Generate it under Kakao Login > Security and set its status to enabled + * @param {boolean | null} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {ProjectOAuth2KakaoPrompt[] | null} prompt - Array of Kakao OAuth2 prompt values. If "none" is included, it must be the only element. "none" means: don't display any authentication or consent screens. "login" means: prompt the user to re-authenticate. "create" means: prompt the user to sign up. "select_account" means: prompt the user to select an account. Pass an empty array to use the Kakao default. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Kakao>} * @deprecated Use the object parameter style method for a better developer experience. */ updateOAuth2Kakao( - clientId?: string, - clientSecret?: string, - prompt?: ProjectOAuth2KakaoPrompt[], - enabled?: boolean, + clientId?: string | null, + clientSecret?: string | null, + enabled?: boolean | null, + prompt?: ProjectOAuth2KakaoPrompt[] | null, ): Promise<Models.OAuth2Kakao>; updateOAuth2Kakao( paramsOrFirst?: | { - clientId?: string; - clientSecret?: string; - prompt?: ProjectOAuth2KakaoPrompt[]; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; + prompt?: ProjectOAuth2KakaoPrompt[] | null; } - | string, - ...rest: [string?, ProjectOAuth2KakaoPrompt[]?, boolean?] + | string + | null, + ...rest: [ + (string | null)?, + (boolean | null)?, + (ProjectOAuth2KakaoPrompt[] | null)?, + ] ): Promise<Models.OAuth2Kakao> { let params: { - clientId?: string; - clientSecret?: string; - prompt?: ProjectOAuth2KakaoPrompt[]; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; + prompt?: ProjectOAuth2KakaoPrompt[] | null; }; if ( @@ -4958,24 +5115,24 @@ export class Project { !Array.isArray(paramsOrFirst)) ) { params = (paramsOrFirst || {}) as { - clientId?: string; - clientSecret?: string; - prompt?: ProjectOAuth2KakaoPrompt[]; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; + prompt?: ProjectOAuth2KakaoPrompt[] | null; }; } else { params = { - clientId: paramsOrFirst as string, - clientSecret: rest[0] as string, - prompt: rest[1] as ProjectOAuth2KakaoPrompt[], - enabled: rest[2] as boolean, + clientId: paramsOrFirst as string | null, + clientSecret: rest[0] as string | null, + enabled: rest[1] as boolean | null, + prompt: rest[2] as ProjectOAuth2KakaoPrompt[] | null, }; } const clientId = params.clientId; const clientSecret = params.clientSecret; - const prompt = params.prompt; const enabled = params.enabled; + const prompt = params.prompt; const apiPath = '/project/oauth2/kakao'; const apiPayload: Payload = {}; @@ -4985,12 +5142,12 @@ export class Project { if (typeof clientSecret !== 'undefined') { apiPayload['clientSecret'] = clientSecret; } - if (typeof prompt !== 'undefined') { - apiPayload['prompt'] = prompt; - } if (typeof enabled !== 'undefined') { apiPayload['enabled'] = enabled; } + if (typeof prompt !== 'undefined') { + apiPayload['prompt'] = prompt; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -5021,58 +5178,64 @@ export class Project { /** * Update the project OAuth2 Keycloak configuration. * - * @param {string} params.clientId - 'Client ID' of Keycloak OAuth2 app. For example: appwrite-o0000000st-app - * @param {string} params.clientSecret - 'Client Secret' of Keycloak OAuth2 app. For example: jdjrJd00000000000000000000HUsaZO - * @param {string} params.endpoint - Domain of Keycloak instance. For example: keycloak.example.com - * @param {string} params.realmName - Keycloak realm name. For example: appwrite-realm - * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} params.clientId - 'Client ID' of Keycloak OAuth2 app. For example: appwrite-o0000000st-app + * @param {string | null} params.clientSecret - 'Client Secret' of Keycloak OAuth2 app. For example: jdjrJd00000000000000000000HUsaZO + * @param {string | null} params.endpoint - Domain of Keycloak instance. For example: keycloak.example.com + * @param {string | null} params.realmName - Keycloak realm name. For example: appwrite-realm + * @param {boolean | null} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Keycloak>} */ updateOAuth2Keycloak(params?: { - clientId?: string; - clientSecret?: string; - endpoint?: string; - realmName?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + endpoint?: string | null; + realmName?: string | null; + enabled?: boolean | null; }): Promise<Models.OAuth2Keycloak>; /** * Update the project OAuth2 Keycloak configuration. * - * @param {string} clientId - 'Client ID' of Keycloak OAuth2 app. For example: appwrite-o0000000st-app - * @param {string} clientSecret - 'Client Secret' of Keycloak OAuth2 app. For example: jdjrJd00000000000000000000HUsaZO - * @param {string} endpoint - Domain of Keycloak instance. For example: keycloak.example.com - * @param {string} realmName - Keycloak realm name. For example: appwrite-realm - * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} clientId - 'Client ID' of Keycloak OAuth2 app. For example: appwrite-o0000000st-app + * @param {string | null} clientSecret - 'Client Secret' of Keycloak OAuth2 app. For example: jdjrJd00000000000000000000HUsaZO + * @param {string | null} endpoint - Domain of Keycloak instance. For example: keycloak.example.com + * @param {string | null} realmName - Keycloak realm name. For example: appwrite-realm + * @param {boolean | null} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Keycloak>} * @deprecated Use the object parameter style method for a better developer experience. */ updateOAuth2Keycloak( - clientId?: string, - clientSecret?: string, - endpoint?: string, - realmName?: string, - enabled?: boolean, + clientId?: string | null, + clientSecret?: string | null, + endpoint?: string | null, + realmName?: string | null, + enabled?: boolean | null, ): Promise<Models.OAuth2Keycloak>; updateOAuth2Keycloak( paramsOrFirst?: | { - clientId?: string; - clientSecret?: string; - endpoint?: string; - realmName?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + endpoint?: string | null; + realmName?: string | null; + enabled?: boolean | null; } - | string, - ...rest: [string?, string?, string?, boolean?] + | string + | null, + ...rest: [ + (string | null)?, + (string | null)?, + (string | null)?, + (boolean | null)?, + ] ): Promise<Models.OAuth2Keycloak> { let params: { - clientId?: string; - clientSecret?: string; - endpoint?: string; - realmName?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + endpoint?: string | null; + realmName?: string | null; + enabled?: boolean | null; }; if ( @@ -5082,19 +5245,19 @@ export class Project { !Array.isArray(paramsOrFirst)) ) { params = (paramsOrFirst || {}) as { - clientId?: string; - clientSecret?: string; - endpoint?: string; - realmName?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + endpoint?: string | null; + realmName?: string | null; + enabled?: boolean | null; }; } else { params = { - clientId: paramsOrFirst as string, - clientSecret: rest[0] as string, - endpoint: rest[1] as string, - realmName: rest[2] as string, - enabled: rest[3] as boolean, + clientId: paramsOrFirst as string | null, + clientSecret: rest[0] as string | null, + endpoint: rest[1] as string | null, + realmName: rest[2] as string | null, + enabled: rest[3] as boolean | null, }; } @@ -5152,42 +5315,47 @@ export class Project { /** * Update the project OAuth2 Kick configuration. * - * @param {string} params.clientId - 'Client ID' of Kick OAuth2 app. For example: 01KQ7C00000000000001MFHS32 - * @param {string} params.clientSecret - 'Client Secret' of Kick OAuth2 app. For example: 34ac5600000000000000000000000000000000000000000000000000e830c8b - * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} params.clientId - 'Client ID' of Kick OAuth2 app. For example: 01KQ7C00000000000001MFHS32 + * @param {string | null} params.clientSecret - 'Client Secret' of Kick OAuth2 app. For example: 34ac5600000000000000000000000000000000000000000000000000e830c8b + * @param {boolean | null} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Kick>} */ updateOAuth2Kick(params?: { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }): Promise<Models.OAuth2Kick>; /** * Update the project OAuth2 Kick configuration. * - * @param {string} clientId - 'Client ID' of Kick OAuth2 app. For example: 01KQ7C00000000000001MFHS32 - * @param {string} clientSecret - 'Client Secret' of Kick OAuth2 app. For example: 34ac5600000000000000000000000000000000000000000000000000e830c8b - * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} clientId - 'Client ID' of Kick OAuth2 app. For example: 01KQ7C00000000000001MFHS32 + * @param {string | null} clientSecret - 'Client Secret' of Kick OAuth2 app. For example: 34ac5600000000000000000000000000000000000000000000000000e830c8b + * @param {boolean | null} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Kick>} * @deprecated Use the object parameter style method for a better developer experience. */ updateOAuth2Kick( - clientId?: string, - clientSecret?: string, - enabled?: boolean, + clientId?: string | null, + clientSecret?: string | null, + enabled?: boolean | null, ): Promise<Models.OAuth2Kick>; updateOAuth2Kick( paramsOrFirst?: - | { clientId?: string; clientSecret?: string; enabled?: boolean } - | string, - ...rest: [string?, boolean?] + | { + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; + } + | string + | null, + ...rest: [(string | null)?, (boolean | null)?] ): Promise<Models.OAuth2Kick> { let params: { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }; if ( @@ -5197,15 +5365,15 @@ export class Project { !Array.isArray(paramsOrFirst)) ) { params = (paramsOrFirst || {}) as { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }; } else { params = { - clientId: paramsOrFirst as string, - clientSecret: rest[0] as string, - enabled: rest[1] as boolean, + clientId: paramsOrFirst as string | null, + clientSecret: rest[0] as string | null, + enabled: rest[1] as boolean | null, }; } @@ -5253,46 +5421,47 @@ export class Project { /** * Update the project OAuth2 Linkedin configuration. * - * @param {string} params.clientId - 'Client ID' of Linkedin OAuth2 app. For example: 770000000000dv - * @param {string} params.primaryClientSecret - 'Primary Client Secret or Secondary Client Secret' of Linkedin OAuth2 app. For example: WPL_AP1.2Bf0000000000000./HtlYw== - * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} params.clientId - 'Client ID' of Linkedin OAuth2 app. For example: 770000000000dv + * @param {string | null} params.primaryClientSecret - 'Primary Client Secret or Secondary Client Secret' of Linkedin OAuth2 app. For example: WPL_AP1.2Bf0000000000000./HtlYw== + * @param {boolean | null} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Linkedin>} */ updateOAuth2Linkedin(params?: { - clientId?: string; - primaryClientSecret?: string; - enabled?: boolean; + clientId?: string | null; + primaryClientSecret?: string | null; + enabled?: boolean | null; }): Promise<Models.OAuth2Linkedin>; /** * Update the project OAuth2 Linkedin configuration. * - * @param {string} clientId - 'Client ID' of Linkedin OAuth2 app. For example: 770000000000dv - * @param {string} primaryClientSecret - 'Primary Client Secret or Secondary Client Secret' of Linkedin OAuth2 app. For example: WPL_AP1.2Bf0000000000000./HtlYw== - * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} clientId - 'Client ID' of Linkedin OAuth2 app. For example: 770000000000dv + * @param {string | null} primaryClientSecret - 'Primary Client Secret or Secondary Client Secret' of Linkedin OAuth2 app. For example: WPL_AP1.2Bf0000000000000./HtlYw== + * @param {boolean | null} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Linkedin>} * @deprecated Use the object parameter style method for a better developer experience. */ updateOAuth2Linkedin( - clientId?: string, - primaryClientSecret?: string, - enabled?: boolean, + clientId?: string | null, + primaryClientSecret?: string | null, + enabled?: boolean | null, ): Promise<Models.OAuth2Linkedin>; updateOAuth2Linkedin( paramsOrFirst?: | { - clientId?: string; - primaryClientSecret?: string; - enabled?: boolean; + clientId?: string | null; + primaryClientSecret?: string | null; + enabled?: boolean | null; } - | string, - ...rest: [string?, boolean?] + | string + | null, + ...rest: [(string | null)?, (boolean | null)?] ): Promise<Models.OAuth2Linkedin> { let params: { - clientId?: string; - primaryClientSecret?: string; - enabled?: boolean; + clientId?: string | null; + primaryClientSecret?: string | null; + enabled?: boolean | null; }; if ( @@ -5302,15 +5471,15 @@ export class Project { !Array.isArray(paramsOrFirst)) ) { params = (paramsOrFirst || {}) as { - clientId?: string; - primaryClientSecret?: string; - enabled?: boolean; + clientId?: string | null; + primaryClientSecret?: string | null; + enabled?: boolean | null; }; } else { params = { - clientId: paramsOrFirst as string, - primaryClientSecret: rest[0] as string, - enabled: rest[1] as boolean, + clientId: paramsOrFirst as string | null, + primaryClientSecret: rest[0] as string | null, + enabled: rest[1] as boolean | null, }; } @@ -5358,58 +5527,64 @@ export class Project { /** * Update the project OAuth2 Microsoft configuration. * - * @param {string} params.applicationId - 'Entra ID Application ID, also known as Client ID' of Microsoft OAuth2 app. For example: 00001111-aaaa-2222-bbbb-3333cccc4444 - * @param {string} params.applicationSecret - 'Entra ID Application Secret, also known as Client Secret' of Microsoft OAuth2 app. For example: A1bC2dE3fH4iJ5kL6mN7oP8qR9sT0u - * @param {string} params.tenant - Microsoft Entra ID tenant identifier. Use 'common', 'organizations', 'consumers' or a specific tenant ID. For example: common - * @param {ProjectOAuth2MicrosoftPrompt[]} params.prompt - Array of Microsoft OAuth2 prompt values. "none" means: don't display any authentication or consent screens. "login" means: prompt the user to re-authenticate. "consent" means: prompt the user for consent. "select_account" means: prompt the user to select an account. Pass an empty array to use the Microsoft default. - * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} params.applicationId - 'Entra ID Application ID, also known as Client ID' of Microsoft OAuth2 app. For example: 00001111-aaaa-2222-bbbb-3333cccc4444 + * @param {string | null} params.applicationSecret - 'Entra ID Application Secret, also known as Client Secret' of Microsoft OAuth2 app. For example: A1bC2dE3fH4iJ5kL6mN7oP8qR9sT0u + * @param {string | null} params.tenant - Microsoft Entra ID tenant identifier. Use 'common', 'organizations', 'consumers' or a specific tenant ID. For example: common + * @param {boolean | null} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {ProjectOAuth2MicrosoftPrompt[] | null} params.prompt - Array of Microsoft OAuth2 prompt values. "none" means: don't display any authentication or consent screens. "login" means: prompt the user to re-authenticate. "consent" means: prompt the user for consent. "select_account" means: prompt the user to select an account. Pass an empty array to use the Microsoft default. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Microsoft>} */ updateOAuth2Microsoft(params?: { - applicationId?: string; - applicationSecret?: string; - tenant?: string; - prompt?: ProjectOAuth2MicrosoftPrompt[]; - enabled?: boolean; + applicationId?: string | null; + applicationSecret?: string | null; + tenant?: string | null; + enabled?: boolean | null; + prompt?: ProjectOAuth2MicrosoftPrompt[] | null; }): Promise<Models.OAuth2Microsoft>; /** * Update the project OAuth2 Microsoft configuration. * - * @param {string} applicationId - 'Entra ID Application ID, also known as Client ID' of Microsoft OAuth2 app. For example: 00001111-aaaa-2222-bbbb-3333cccc4444 - * @param {string} applicationSecret - 'Entra ID Application Secret, also known as Client Secret' of Microsoft OAuth2 app. For example: A1bC2dE3fH4iJ5kL6mN7oP8qR9sT0u - * @param {string} tenant - Microsoft Entra ID tenant identifier. Use 'common', 'organizations', 'consumers' or a specific tenant ID. For example: common - * @param {ProjectOAuth2MicrosoftPrompt[]} prompt - Array of Microsoft OAuth2 prompt values. "none" means: don't display any authentication or consent screens. "login" means: prompt the user to re-authenticate. "consent" means: prompt the user for consent. "select_account" means: prompt the user to select an account. Pass an empty array to use the Microsoft default. - * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} applicationId - 'Entra ID Application ID, also known as Client ID' of Microsoft OAuth2 app. For example: 00001111-aaaa-2222-bbbb-3333cccc4444 + * @param {string | null} applicationSecret - 'Entra ID Application Secret, also known as Client Secret' of Microsoft OAuth2 app. For example: A1bC2dE3fH4iJ5kL6mN7oP8qR9sT0u + * @param {string | null} tenant - Microsoft Entra ID tenant identifier. Use 'common', 'organizations', 'consumers' or a specific tenant ID. For example: common + * @param {boolean | null} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {ProjectOAuth2MicrosoftPrompt[] | null} prompt - Array of Microsoft OAuth2 prompt values. "none" means: don't display any authentication or consent screens. "login" means: prompt the user to re-authenticate. "consent" means: prompt the user for consent. "select_account" means: prompt the user to select an account. Pass an empty array to use the Microsoft default. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Microsoft>} * @deprecated Use the object parameter style method for a better developer experience. */ updateOAuth2Microsoft( - applicationId?: string, - applicationSecret?: string, - tenant?: string, - prompt?: ProjectOAuth2MicrosoftPrompt[], - enabled?: boolean, + applicationId?: string | null, + applicationSecret?: string | null, + tenant?: string | null, + enabled?: boolean | null, + prompt?: ProjectOAuth2MicrosoftPrompt[] | null, ): Promise<Models.OAuth2Microsoft>; updateOAuth2Microsoft( paramsOrFirst?: | { - applicationId?: string; - applicationSecret?: string; - tenant?: string; - prompt?: ProjectOAuth2MicrosoftPrompt[]; - enabled?: boolean; + applicationId?: string | null; + applicationSecret?: string | null; + tenant?: string | null; + enabled?: boolean | null; + prompt?: ProjectOAuth2MicrosoftPrompt[] | null; } - | string, - ...rest: [string?, string?, ProjectOAuth2MicrosoftPrompt[]?, boolean?] + | string + | null, + ...rest: [ + (string | null)?, + (string | null)?, + (boolean | null)?, + (ProjectOAuth2MicrosoftPrompt[] | null)?, + ] ): Promise<Models.OAuth2Microsoft> { let params: { - applicationId?: string; - applicationSecret?: string; - tenant?: string; - prompt?: ProjectOAuth2MicrosoftPrompt[]; - enabled?: boolean; + applicationId?: string | null; + applicationSecret?: string | null; + tenant?: string | null; + enabled?: boolean | null; + prompt?: ProjectOAuth2MicrosoftPrompt[] | null; }; if ( @@ -5419,27 +5594,27 @@ export class Project { !Array.isArray(paramsOrFirst)) ) { params = (paramsOrFirst || {}) as { - applicationId?: string; - applicationSecret?: string; - tenant?: string; - prompt?: ProjectOAuth2MicrosoftPrompt[]; - enabled?: boolean; + applicationId?: string | null; + applicationSecret?: string | null; + tenant?: string | null; + enabled?: boolean | null; + prompt?: ProjectOAuth2MicrosoftPrompt[] | null; }; } else { params = { - applicationId: paramsOrFirst as string, - applicationSecret: rest[0] as string, - tenant: rest[1] as string, - prompt: rest[2] as ProjectOAuth2MicrosoftPrompt[], - enabled: rest[3] as boolean, + applicationId: paramsOrFirst as string | null, + applicationSecret: rest[0] as string | null, + tenant: rest[1] as string | null, + enabled: rest[2] as boolean | null, + prompt: rest[3] as ProjectOAuth2MicrosoftPrompt[] | null, }; } const applicationId = params.applicationId; const applicationSecret = params.applicationSecret; const tenant = params.tenant; - const prompt = params.prompt; const enabled = params.enabled; + const prompt = params.prompt; const apiPath = '/project/oauth2/microsoft'; const apiPayload: Payload = {}; @@ -5452,12 +5627,12 @@ export class Project { if (typeof tenant !== 'undefined') { apiPayload['tenant'] = tenant; } - if (typeof prompt !== 'undefined') { - apiPayload['prompt'] = prompt; - } if (typeof enabled !== 'undefined') { apiPayload['enabled'] = enabled; } + if (typeof prompt !== 'undefined') { + apiPayload['prompt'] = prompt; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -5489,46 +5664,47 @@ export class Project { /** * Update the project OAuth2 Notion configuration. * - * @param {string} params.oauthClientId - 'OAuth Client ID' of Notion OAuth2 app. For example: 341d8700-0000-0000-0000-000000446ee3 - * @param {string} params.oauthClientSecret - 'OAuth Client Secret' of Notion OAuth2 app. For example: secret_dLUr4b000000000000000000000000000000lFHAa9 - * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} params.oauthClientId - 'OAuth Client ID' of Notion OAuth2 app. For example: 341d8700-0000-0000-0000-000000446ee3 + * @param {string | null} params.oauthClientSecret - 'OAuth Client Secret' of Notion OAuth2 app. For example: secret_dLUr4b000000000000000000000000000000lFHAa9 + * @param {boolean | null} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Notion>} */ updateOAuth2Notion(params?: { - oauthClientId?: string; - oauthClientSecret?: string; - enabled?: boolean; + oauthClientId?: string | null; + oauthClientSecret?: string | null; + enabled?: boolean | null; }): Promise<Models.OAuth2Notion>; /** * Update the project OAuth2 Notion configuration. * - * @param {string} oauthClientId - 'OAuth Client ID' of Notion OAuth2 app. For example: 341d8700-0000-0000-0000-000000446ee3 - * @param {string} oauthClientSecret - 'OAuth Client Secret' of Notion OAuth2 app. For example: secret_dLUr4b000000000000000000000000000000lFHAa9 - * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} oauthClientId - 'OAuth Client ID' of Notion OAuth2 app. For example: 341d8700-0000-0000-0000-000000446ee3 + * @param {string | null} oauthClientSecret - 'OAuth Client Secret' of Notion OAuth2 app. For example: secret_dLUr4b000000000000000000000000000000lFHAa9 + * @param {boolean | null} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Notion>} * @deprecated Use the object parameter style method for a better developer experience. */ updateOAuth2Notion( - oauthClientId?: string, - oauthClientSecret?: string, - enabled?: boolean, + oauthClientId?: string | null, + oauthClientSecret?: string | null, + enabled?: boolean | null, ): Promise<Models.OAuth2Notion>; updateOAuth2Notion( paramsOrFirst?: | { - oauthClientId?: string; - oauthClientSecret?: string; - enabled?: boolean; + oauthClientId?: string | null; + oauthClientSecret?: string | null; + enabled?: boolean | null; } - | string, - ...rest: [string?, boolean?] + | string + | null, + ...rest: [(string | null)?, (boolean | null)?] ): Promise<Models.OAuth2Notion> { let params: { - oauthClientId?: string; - oauthClientSecret?: string; - enabled?: boolean; + oauthClientId?: string | null; + oauthClientSecret?: string | null; + enabled?: boolean | null; }; if ( @@ -5538,15 +5714,15 @@ export class Project { !Array.isArray(paramsOrFirst)) ) { params = (paramsOrFirst || {}) as { - oauthClientId?: string; - oauthClientSecret?: string; - enabled?: boolean; + oauthClientId?: string | null; + oauthClientSecret?: string | null; + enabled?: boolean | null; }; } else { params = { - oauthClientId: paramsOrFirst as string, - oauthClientSecret: rest[0] as string, - enabled: rest[1] as boolean, + oauthClientId: paramsOrFirst as string | null, + oauthClientSecret: rest[0] as string | null, + enabled: rest[1] as boolean | null, }; } @@ -5594,91 +5770,92 @@ export class Project { /** * Update the project OAuth2 Oidc configuration. * - * @param {string} params.clientId - 'Client ID' of Oidc OAuth2 app. For example: qibI2x0000000000000000000000000006L2YFoG - * @param {string} params.clientSecret - 'Client Secret' of Oidc OAuth2 app. For example: Ah68ed000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003qpcHV - * @param {string} params.wellKnownURL - OpenID Connect well-known configuration URL. When provided, authorization, token, and user info endpoints can be discovered automatically. For example: https://myoauth.com/.well-known/openid-configuration - * @param {string} params.authorizationURL - OpenID Connect authorization endpoint URL. Required when wellKnownURL is not provided. For example: https://myoauth.com/oauth2/authorize - * @param {string} params.tokenURL - OpenID Connect token endpoint URL. Required when wellKnownURL is not provided. For example: https://myoauth.com/oauth2/token - * @param {string} params.userInfoURL - OpenID Connect user info endpoint URL. Required when wellKnownURL is not provided. For example: https://myoauth.com/oauth2/userinfo - * @param {ProjectOAuth2OidcPrompt[]} params.prompt - Array of OpenID Connect prompt values controlling the authentication and consent screens. If "none" is included, it must be the only element. "none" means: don't display any authentication or consent screens. "login" means: prompt the user to re-authenticate. "consent" means: prompt the user for consent. "select_account" means: prompt the user to select an account. - * @param {number} params.maxAge - Maximum authentication age in seconds. When set, the user must have authenticated within this many seconds, otherwise they are prompted to re-authenticate. - * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} params.clientId - 'Client ID' of Oidc OAuth2 app. For example: qibI2x0000000000000000000000000006L2YFoG + * @param {string | null} params.clientSecret - 'Client Secret' of Oidc OAuth2 app. For example: Ah68ed000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003qpcHV + * @param {string | null} params.wellKnownURL - OpenID Connect well-known configuration URL. When provided, authorization, token, and user info endpoints can be discovered automatically. For example: https://myoauth.com/.well-known/openid-configuration + * @param {string | null} params.authorizationURL - OpenID Connect authorization endpoint URL. Required when wellKnownURL is not provided. For example: https://myoauth.com/oauth2/authorize + * @param {string | null} params.tokenURL - OpenID Connect token endpoint URL. Required when wellKnownURL is not provided. For example: https://myoauth.com/oauth2/token + * @param {string | null} params.userInfoURL - OpenID Connect user info endpoint URL. Required when wellKnownURL is not provided. For example: https://myoauth.com/oauth2/userinfo + * @param {ProjectOAuth2OidcPrompt[] | null} params.prompt - Array of OpenID Connect prompt values controlling the authentication and consent screens. If "none" is included, it must be the only element. "none" means: don't display any authentication or consent screens. "login" means: prompt the user to re-authenticate. "consent" means: prompt the user for consent. "select_account" means: prompt the user to select an account. + * @param {number | null} params.maxAge - Maximum authentication age in seconds. When set, the user must have authenticated within this many seconds, otherwise they are prompted to re-authenticate. + * @param {boolean | null} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Oidc>} */ updateOAuth2Oidc(params?: { - clientId?: string; - clientSecret?: string; - wellKnownURL?: string; - authorizationURL?: string; - tokenURL?: string; - userInfoURL?: string; - prompt?: ProjectOAuth2OidcPrompt[]; - maxAge?: number; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + wellKnownURL?: string | null; + authorizationURL?: string | null; + tokenURL?: string | null; + userInfoURL?: string | null; + prompt?: ProjectOAuth2OidcPrompt[] | null; + maxAge?: number | null; + enabled?: boolean | null; }): Promise<Models.OAuth2Oidc>; /** * Update the project OAuth2 Oidc configuration. * - * @param {string} clientId - 'Client ID' of Oidc OAuth2 app. For example: qibI2x0000000000000000000000000006L2YFoG - * @param {string} clientSecret - 'Client Secret' of Oidc OAuth2 app. For example: Ah68ed000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003qpcHV - * @param {string} wellKnownURL - OpenID Connect well-known configuration URL. When provided, authorization, token, and user info endpoints can be discovered automatically. For example: https://myoauth.com/.well-known/openid-configuration - * @param {string} authorizationURL - OpenID Connect authorization endpoint URL. Required when wellKnownURL is not provided. For example: https://myoauth.com/oauth2/authorize - * @param {string} tokenURL - OpenID Connect token endpoint URL. Required when wellKnownURL is not provided. For example: https://myoauth.com/oauth2/token - * @param {string} userInfoURL - OpenID Connect user info endpoint URL. Required when wellKnownURL is not provided. For example: https://myoauth.com/oauth2/userinfo - * @param {ProjectOAuth2OidcPrompt[]} prompt - Array of OpenID Connect prompt values controlling the authentication and consent screens. If "none" is included, it must be the only element. "none" means: don't display any authentication or consent screens. "login" means: prompt the user to re-authenticate. "consent" means: prompt the user for consent. "select_account" means: prompt the user to select an account. - * @param {number} maxAge - Maximum authentication age in seconds. When set, the user must have authenticated within this many seconds, otherwise they are prompted to re-authenticate. - * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} clientId - 'Client ID' of Oidc OAuth2 app. For example: qibI2x0000000000000000000000000006L2YFoG + * @param {string | null} clientSecret - 'Client Secret' of Oidc OAuth2 app. For example: Ah68ed000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003qpcHV + * @param {string | null} wellKnownURL - OpenID Connect well-known configuration URL. When provided, authorization, token, and user info endpoints can be discovered automatically. For example: https://myoauth.com/.well-known/openid-configuration + * @param {string | null} authorizationURL - OpenID Connect authorization endpoint URL. Required when wellKnownURL is not provided. For example: https://myoauth.com/oauth2/authorize + * @param {string | null} tokenURL - OpenID Connect token endpoint URL. Required when wellKnownURL is not provided. For example: https://myoauth.com/oauth2/token + * @param {string | null} userInfoURL - OpenID Connect user info endpoint URL. Required when wellKnownURL is not provided. For example: https://myoauth.com/oauth2/userinfo + * @param {ProjectOAuth2OidcPrompt[] | null} prompt - Array of OpenID Connect prompt values controlling the authentication and consent screens. If "none" is included, it must be the only element. "none" means: don't display any authentication or consent screens. "login" means: prompt the user to re-authenticate. "consent" means: prompt the user for consent. "select_account" means: prompt the user to select an account. + * @param {number | null} maxAge - Maximum authentication age in seconds. When set, the user must have authenticated within this many seconds, otherwise they are prompted to re-authenticate. + * @param {boolean | null} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Oidc>} * @deprecated Use the object parameter style method for a better developer experience. */ updateOAuth2Oidc( - clientId?: string, - clientSecret?: string, - wellKnownURL?: string, - authorizationURL?: string, - tokenURL?: string, - userInfoURL?: string, - prompt?: ProjectOAuth2OidcPrompt[], - maxAge?: number, - enabled?: boolean, + clientId?: string | null, + clientSecret?: string | null, + wellKnownURL?: string | null, + authorizationURL?: string | null, + tokenURL?: string | null, + userInfoURL?: string | null, + prompt?: ProjectOAuth2OidcPrompt[] | null, + maxAge?: number | null, + enabled?: boolean | null, ): Promise<Models.OAuth2Oidc>; updateOAuth2Oidc( paramsOrFirst?: | { - clientId?: string; - clientSecret?: string; - wellKnownURL?: string; - authorizationURL?: string; - tokenURL?: string; - userInfoURL?: string; - prompt?: ProjectOAuth2OidcPrompt[]; - maxAge?: number; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + wellKnownURL?: string | null; + authorizationURL?: string | null; + tokenURL?: string | null; + userInfoURL?: string | null; + prompt?: ProjectOAuth2OidcPrompt[] | null; + maxAge?: number | null; + enabled?: boolean | null; } - | string, + | string + | null, ...rest: [ - string?, - string?, - string?, - string?, - string?, - ProjectOAuth2OidcPrompt[]?, - number?, - boolean?, + (string | null)?, + (string | null)?, + (string | null)?, + (string | null)?, + (string | null)?, + (ProjectOAuth2OidcPrompt[] | null)?, + (number | null)?, + (boolean | null)?, ] ): Promise<Models.OAuth2Oidc> { let params: { - clientId?: string; - clientSecret?: string; - wellKnownURL?: string; - authorizationURL?: string; - tokenURL?: string; - userInfoURL?: string; - prompt?: ProjectOAuth2OidcPrompt[]; - maxAge?: number; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + wellKnownURL?: string | null; + authorizationURL?: string | null; + tokenURL?: string | null; + userInfoURL?: string | null; + prompt?: ProjectOAuth2OidcPrompt[] | null; + maxAge?: number | null; + enabled?: boolean | null; }; if ( @@ -5688,27 +5865,27 @@ export class Project { !Array.isArray(paramsOrFirst)) ) { params = (paramsOrFirst || {}) as { - clientId?: string; - clientSecret?: string; - wellKnownURL?: string; - authorizationURL?: string; - tokenURL?: string; - userInfoURL?: string; - prompt?: ProjectOAuth2OidcPrompt[]; - maxAge?: number; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + wellKnownURL?: string | null; + authorizationURL?: string | null; + tokenURL?: string | null; + userInfoURL?: string | null; + prompt?: ProjectOAuth2OidcPrompt[] | null; + maxAge?: number | null; + enabled?: boolean | null; }; } else { params = { - clientId: paramsOrFirst as string, - clientSecret: rest[0] as string, - wellKnownURL: rest[1] as string, - authorizationURL: rest[2] as string, - tokenURL: rest[3] as string, - userInfoURL: rest[4] as string, - prompt: rest[5] as ProjectOAuth2OidcPrompt[], - maxAge: rest[6] as number, - enabled: rest[7] as boolean, + clientId: paramsOrFirst as string | null, + clientSecret: rest[0] as string | null, + wellKnownURL: rest[1] as string | null, + authorizationURL: rest[2] as string | null, + tokenURL: rest[3] as string | null, + userInfoURL: rest[4] as string | null, + prompt: rest[5] as ProjectOAuth2OidcPrompt[] | null, + maxAge: rest[6] as number | null, + enabled: rest[7] as boolean | null, }; } @@ -5785,70 +5962,71 @@ export class Project { /** * Update the project OAuth2 Okta configuration. * - * @param {string} params.clientId - 'Client ID' of Okta OAuth2 app. For example: 0oa00000000000000698 - * @param {string} params.clientSecret - 'Client Secret' of Okta OAuth2 app. For example: Kiq0000000000000000000000000000000000000-00000000000H2L5-3SJ-vRV - * @param {string} params.domain - Okta company domain. Required when enabling the provider. For example: trial-6400025.okta.com. Example of wrong value: trial-6400025-admin.okta.com, or https://trial-6400025.okta.com/ - * @param {string} params.authorizationServerId - Custom Authorization Servers. Optional, can be left empty or unconfigured. For example: aus000000000000000h7z - * @param {ProjectOAuth2OktaPrompt[]} params.prompt - Array of Okta OAuth2 prompt values. If "none" is included, it must be the only element. "none" means: don't display any authentication or consent screens. "login" means: prompt the user to re-authenticate. "consent" means: prompt the user for consent. Pass an empty array to use the Okta default. - * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} params.clientId - 'Client ID' of Okta OAuth2 app. For example: 0oa00000000000000698 + * @param {string | null} params.clientSecret - 'Client Secret' of Okta OAuth2 app. For example: Kiq0000000000000000000000000000000000000-00000000000H2L5-3SJ-vRV + * @param {string | null} params.domain - Okta company domain. Required when enabling the provider. For example: trial-6400025.okta.com. Example of wrong value: trial-6400025-admin.okta.com, or https://trial-6400025.okta.com/ + * @param {string | null} params.authorizationServerId - Custom Authorization Servers. Optional, can be left empty or unconfigured. For example: aus000000000000000h7z + * @param {boolean | null} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {ProjectOAuth2OktaPrompt[] | null} params.prompt - Array of Okta OAuth2 prompt values. If "none" is included, it must be the only element. "none" means: don't display any authentication or consent screens. "login" means: prompt the user to re-authenticate. "consent" means: prompt the user for consent. Pass an empty array to use the Okta default. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Okta>} */ updateOAuth2Okta(params?: { - clientId?: string; - clientSecret?: string; - domain?: string; - authorizationServerId?: string; - prompt?: ProjectOAuth2OktaPrompt[]; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + domain?: string | null; + authorizationServerId?: string | null; + enabled?: boolean | null; + prompt?: ProjectOAuth2OktaPrompt[] | null; }): Promise<Models.OAuth2Okta>; /** * Update the project OAuth2 Okta configuration. * - * @param {string} clientId - 'Client ID' of Okta OAuth2 app. For example: 0oa00000000000000698 - * @param {string} clientSecret - 'Client Secret' of Okta OAuth2 app. For example: Kiq0000000000000000000000000000000000000-00000000000H2L5-3SJ-vRV - * @param {string} domain - Okta company domain. Required when enabling the provider. For example: trial-6400025.okta.com. Example of wrong value: trial-6400025-admin.okta.com, or https://trial-6400025.okta.com/ - * @param {string} authorizationServerId - Custom Authorization Servers. Optional, can be left empty or unconfigured. For example: aus000000000000000h7z - * @param {ProjectOAuth2OktaPrompt[]} prompt - Array of Okta OAuth2 prompt values. If "none" is included, it must be the only element. "none" means: don't display any authentication or consent screens. "login" means: prompt the user to re-authenticate. "consent" means: prompt the user for consent. Pass an empty array to use the Okta default. - * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} clientId - 'Client ID' of Okta OAuth2 app. For example: 0oa00000000000000698 + * @param {string | null} clientSecret - 'Client Secret' of Okta OAuth2 app. For example: Kiq0000000000000000000000000000000000000-00000000000H2L5-3SJ-vRV + * @param {string | null} domain - Okta company domain. Required when enabling the provider. For example: trial-6400025.okta.com. Example of wrong value: trial-6400025-admin.okta.com, or https://trial-6400025.okta.com/ + * @param {string | null} authorizationServerId - Custom Authorization Servers. Optional, can be left empty or unconfigured. For example: aus000000000000000h7z + * @param {boolean | null} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {ProjectOAuth2OktaPrompt[] | null} prompt - Array of Okta OAuth2 prompt values. If "none" is included, it must be the only element. "none" means: don't display any authentication or consent screens. "login" means: prompt the user to re-authenticate. "consent" means: prompt the user for consent. Pass an empty array to use the Okta default. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Okta>} * @deprecated Use the object parameter style method for a better developer experience. */ updateOAuth2Okta( - clientId?: string, - clientSecret?: string, - domain?: string, - authorizationServerId?: string, - prompt?: ProjectOAuth2OktaPrompt[], - enabled?: boolean, + clientId?: string | null, + clientSecret?: string | null, + domain?: string | null, + authorizationServerId?: string | null, + enabled?: boolean | null, + prompt?: ProjectOAuth2OktaPrompt[] | null, ): Promise<Models.OAuth2Okta>; updateOAuth2Okta( paramsOrFirst?: | { - clientId?: string; - clientSecret?: string; - domain?: string; - authorizationServerId?: string; - prompt?: ProjectOAuth2OktaPrompt[]; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + domain?: string | null; + authorizationServerId?: string | null; + enabled?: boolean | null; + prompt?: ProjectOAuth2OktaPrompt[] | null; } - | string, + | string + | null, ...rest: [ - string?, - string?, - string?, - ProjectOAuth2OktaPrompt[]?, - boolean?, + (string | null)?, + (string | null)?, + (string | null)?, + (boolean | null)?, + (ProjectOAuth2OktaPrompt[] | null)?, ] ): Promise<Models.OAuth2Okta> { let params: { - clientId?: string; - clientSecret?: string; - domain?: string; - authorizationServerId?: string; - prompt?: ProjectOAuth2OktaPrompt[]; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + domain?: string | null; + authorizationServerId?: string | null; + enabled?: boolean | null; + prompt?: ProjectOAuth2OktaPrompt[] | null; }; if ( @@ -5858,21 +6036,21 @@ export class Project { !Array.isArray(paramsOrFirst)) ) { params = (paramsOrFirst || {}) as { - clientId?: string; - clientSecret?: string; - domain?: string; - authorizationServerId?: string; - prompt?: ProjectOAuth2OktaPrompt[]; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + domain?: string | null; + authorizationServerId?: string | null; + enabled?: boolean | null; + prompt?: ProjectOAuth2OktaPrompt[] | null; }; } else { params = { - clientId: paramsOrFirst as string, - clientSecret: rest[0] as string, - domain: rest[1] as string, - authorizationServerId: rest[2] as string, - prompt: rest[3] as ProjectOAuth2OktaPrompt[], - enabled: rest[4] as boolean, + clientId: paramsOrFirst as string | null, + clientSecret: rest[0] as string | null, + domain: rest[1] as string | null, + authorizationServerId: rest[2] as string | null, + enabled: rest[3] as boolean | null, + prompt: rest[4] as ProjectOAuth2OktaPrompt[] | null, }; } @@ -5880,8 +6058,8 @@ export class Project { const clientSecret = params.clientSecret; const domain = params.domain; const authorizationServerId = params.authorizationServerId; - const prompt = params.prompt; const enabled = params.enabled; + const prompt = params.prompt; const apiPath = '/project/oauth2/okta'; const apiPayload: Payload = {}; @@ -5897,12 +6075,12 @@ export class Project { if (typeof authorizationServerId !== 'undefined') { apiPayload['authorizationServerId'] = authorizationServerId; } - if (typeof prompt !== 'undefined') { - apiPayload['prompt'] = prompt; - } if (typeof enabled !== 'undefined') { apiPayload['enabled'] = enabled; } + if (typeof prompt !== 'undefined') { + apiPayload['prompt'] = prompt; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -5935,42 +6113,47 @@ export class Project { /** * Update the project OAuth2 Paypal configuration. * - * @param {string} params.clientId - 'Client ID' of Paypal OAuth2 app. For example: AdhIEG7-000000000000-0000000000000000000000000000000-0000000000000000000000-2pyB - * @param {string} params.secretKey - 'Secret Key 1 or Secret Key 2' of Paypal OAuth2 app. For example: EH8KCXtew--000000000000000000000000000000000000000_C-1_5UP_000000000000000CB7KDp - * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} params.clientId - 'Client ID' of Paypal OAuth2 app. For example: AdhIEG7-000000000000-0000000000000000000000000000000-0000000000000000000000-2pyB + * @param {string | null} params.secretKey - 'Secret Key 1 or Secret Key 2' of Paypal OAuth2 app. For example: EH8KCXtew--000000000000000000000000000000000000000_C-1_5UP_000000000000000CB7KDp + * @param {boolean | null} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Paypal>} */ updateOAuth2Paypal(params?: { - clientId?: string; - secretKey?: string; - enabled?: boolean; + clientId?: string | null; + secretKey?: string | null; + enabled?: boolean | null; }): Promise<Models.OAuth2Paypal>; /** * Update the project OAuth2 Paypal configuration. * - * @param {string} clientId - 'Client ID' of Paypal OAuth2 app. For example: AdhIEG7-000000000000-0000000000000000000000000000000-0000000000000000000000-2pyB - * @param {string} secretKey - 'Secret Key 1 or Secret Key 2' of Paypal OAuth2 app. For example: EH8KCXtew--000000000000000000000000000000000000000_C-1_5UP_000000000000000CB7KDp - * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} clientId - 'Client ID' of Paypal OAuth2 app. For example: AdhIEG7-000000000000-0000000000000000000000000000000-0000000000000000000000-2pyB + * @param {string | null} secretKey - 'Secret Key 1 or Secret Key 2' of Paypal OAuth2 app. For example: EH8KCXtew--000000000000000000000000000000000000000_C-1_5UP_000000000000000CB7KDp + * @param {boolean | null} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Paypal>} * @deprecated Use the object parameter style method for a better developer experience. */ updateOAuth2Paypal( - clientId?: string, - secretKey?: string, - enabled?: boolean, + clientId?: string | null, + secretKey?: string | null, + enabled?: boolean | null, ): Promise<Models.OAuth2Paypal>; updateOAuth2Paypal( paramsOrFirst?: - | { clientId?: string; secretKey?: string; enabled?: boolean } - | string, - ...rest: [string?, boolean?] + | { + clientId?: string | null; + secretKey?: string | null; + enabled?: boolean | null; + } + | string + | null, + ...rest: [(string | null)?, (boolean | null)?] ): Promise<Models.OAuth2Paypal> { let params: { - clientId?: string; - secretKey?: string; - enabled?: boolean; + clientId?: string | null; + secretKey?: string | null; + enabled?: boolean | null; }; if ( @@ -5980,15 +6163,15 @@ export class Project { !Array.isArray(paramsOrFirst)) ) { params = (paramsOrFirst || {}) as { - clientId?: string; - secretKey?: string; - enabled?: boolean; + clientId?: string | null; + secretKey?: string | null; + enabled?: boolean | null; }; } else { params = { - clientId: paramsOrFirst as string, - secretKey: rest[0] as string, - enabled: rest[1] as boolean, + clientId: paramsOrFirst as string | null, + secretKey: rest[0] as string | null, + enabled: rest[1] as boolean | null, }; } @@ -6036,42 +6219,47 @@ export class Project { /** * Update the project OAuth2 PaypalSandbox configuration. * - * @param {string} params.clientId - 'Client ID' of PaypalSandbox OAuth2 app. For example: AdhIEG7-000000000000-0000000000000000000000000000000-0000000000000000000000-2pyB - * @param {string} params.secretKey - 'Secret Key 1 or Secret Key 2' of PaypalSandbox OAuth2 app. For example: EH8KCXtew--000000000000000000000000000000000000000_C-1_5UP_000000000000000CB7KDp - * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} params.clientId - 'Client ID' of PaypalSandbox OAuth2 app. For example: AdhIEG7-000000000000-0000000000000000000000000000000-0000000000000000000000-2pyB + * @param {string | null} params.secretKey - 'Secret Key 1 or Secret Key 2' of PaypalSandbox OAuth2 app. For example: EH8KCXtew--000000000000000000000000000000000000000_C-1_5UP_000000000000000CB7KDp + * @param {boolean | null} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Paypal>} */ updateOAuth2PaypalSandbox(params?: { - clientId?: string; - secretKey?: string; - enabled?: boolean; + clientId?: string | null; + secretKey?: string | null; + enabled?: boolean | null; }): Promise<Models.OAuth2Paypal>; /** * Update the project OAuth2 PaypalSandbox configuration. * - * @param {string} clientId - 'Client ID' of PaypalSandbox OAuth2 app. For example: AdhIEG7-000000000000-0000000000000000000000000000000-0000000000000000000000-2pyB - * @param {string} secretKey - 'Secret Key 1 or Secret Key 2' of PaypalSandbox OAuth2 app. For example: EH8KCXtew--000000000000000000000000000000000000000_C-1_5UP_000000000000000CB7KDp - * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} clientId - 'Client ID' of PaypalSandbox OAuth2 app. For example: AdhIEG7-000000000000-0000000000000000000000000000000-0000000000000000000000-2pyB + * @param {string | null} secretKey - 'Secret Key 1 or Secret Key 2' of PaypalSandbox OAuth2 app. For example: EH8KCXtew--000000000000000000000000000000000000000_C-1_5UP_000000000000000CB7KDp + * @param {boolean | null} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Paypal>} * @deprecated Use the object parameter style method for a better developer experience. */ updateOAuth2PaypalSandbox( - clientId?: string, - secretKey?: string, - enabled?: boolean, + clientId?: string | null, + secretKey?: string | null, + enabled?: boolean | null, ): Promise<Models.OAuth2Paypal>; updateOAuth2PaypalSandbox( paramsOrFirst?: - | { clientId?: string; secretKey?: string; enabled?: boolean } - | string, - ...rest: [string?, boolean?] + | { + clientId?: string | null; + secretKey?: string | null; + enabled?: boolean | null; + } + | string + | null, + ...rest: [(string | null)?, (boolean | null)?] ): Promise<Models.OAuth2Paypal> { let params: { - clientId?: string; - secretKey?: string; - enabled?: boolean; + clientId?: string | null; + secretKey?: string | null; + enabled?: boolean | null; }; if ( @@ -6081,15 +6269,15 @@ export class Project { !Array.isArray(paramsOrFirst)) ) { params = (paramsOrFirst || {}) as { - clientId?: string; - secretKey?: string; - enabled?: boolean; + clientId?: string | null; + secretKey?: string | null; + enabled?: boolean | null; }; } else { params = { - clientId: paramsOrFirst as string, - secretKey: rest[0] as string, - enabled: rest[1] as boolean, + clientId: paramsOrFirst as string | null, + secretKey: rest[0] as string | null, + enabled: rest[1] as boolean | null, }; } @@ -6137,42 +6325,47 @@ export class Project { /** * Update the project OAuth2 Podio configuration. * - * @param {string} params.clientId - 'Client ID' of Podio OAuth2 app. For example: appwrite-o0000000st-app - * @param {string} params.clientSecret - 'Client Secret' of Podio OAuth2 app. For example: Rn247T0000000000000000000000000000000000000000000000000000W2zWTN - * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} params.clientId - 'Client ID' of Podio OAuth2 app. For example: appwrite-o0000000st-app + * @param {string | null} params.clientSecret - 'Client Secret' of Podio OAuth2 app. For example: Rn247T0000000000000000000000000000000000000000000000000000W2zWTN + * @param {boolean | null} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Podio>} */ updateOAuth2Podio(params?: { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }): Promise<Models.OAuth2Podio>; /** * Update the project OAuth2 Podio configuration. * - * @param {string} clientId - 'Client ID' of Podio OAuth2 app. For example: appwrite-o0000000st-app - * @param {string} clientSecret - 'Client Secret' of Podio OAuth2 app. For example: Rn247T0000000000000000000000000000000000000000000000000000W2zWTN - * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} clientId - 'Client ID' of Podio OAuth2 app. For example: appwrite-o0000000st-app + * @param {string | null} clientSecret - 'Client Secret' of Podio OAuth2 app. For example: Rn247T0000000000000000000000000000000000000000000000000000W2zWTN + * @param {boolean | null} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Podio>} * @deprecated Use the object parameter style method for a better developer experience. */ updateOAuth2Podio( - clientId?: string, - clientSecret?: string, - enabled?: boolean, + clientId?: string | null, + clientSecret?: string | null, + enabled?: boolean | null, ): Promise<Models.OAuth2Podio>; updateOAuth2Podio( paramsOrFirst?: - | { clientId?: string; clientSecret?: string; enabled?: boolean } - | string, - ...rest: [string?, boolean?] + | { + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; + } + | string + | null, + ...rest: [(string | null)?, (boolean | null)?] ): Promise<Models.OAuth2Podio> { let params: { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }; if ( @@ -6182,15 +6375,15 @@ export class Project { !Array.isArray(paramsOrFirst)) ) { params = (paramsOrFirst || {}) as { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }; } else { params = { - clientId: paramsOrFirst as string, - clientSecret: rest[0] as string, - enabled: rest[1] as boolean, + clientId: paramsOrFirst as string | null, + clientSecret: rest[0] as string | null, + enabled: rest[1] as boolean | null, }; } @@ -6238,42 +6431,47 @@ export class Project { /** * Update the project OAuth2 Resend configuration. * - * @param {string} params.clientId - 'Client ID' of Resend OAuth2 app. For example: f47ac10b-58cc-4372-a567-0e02b2c3d479 - * @param {string} params.clientSecret - 'Client Secret' of Resend OAuth2 app. For example: 9c1e4b00000000000000000000000000000000000000000000000000a72d5f4 - * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} params.clientId - 'Client ID' of Resend OAuth2 app. For example: f47ac10b-58cc-4372-a567-0e02b2c3d479 + * @param {string | null} params.clientSecret - 'Client Secret' of Resend OAuth2 app. For example: 9c1e4b00000000000000000000000000000000000000000000000000a72d5f4 + * @param {boolean | null} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Resend>} */ updateOAuth2Resend(params?: { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }): Promise<Models.OAuth2Resend>; /** * Update the project OAuth2 Resend configuration. * - * @param {string} clientId - 'Client ID' of Resend OAuth2 app. For example: f47ac10b-58cc-4372-a567-0e02b2c3d479 - * @param {string} clientSecret - 'Client Secret' of Resend OAuth2 app. For example: 9c1e4b00000000000000000000000000000000000000000000000000a72d5f4 - * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} clientId - 'Client ID' of Resend OAuth2 app. For example: f47ac10b-58cc-4372-a567-0e02b2c3d479 + * @param {string | null} clientSecret - 'Client Secret' of Resend OAuth2 app. For example: 9c1e4b00000000000000000000000000000000000000000000000000a72d5f4 + * @param {boolean | null} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Resend>} * @deprecated Use the object parameter style method for a better developer experience. */ updateOAuth2Resend( - clientId?: string, - clientSecret?: string, - enabled?: boolean, + clientId?: string | null, + clientSecret?: string | null, + enabled?: boolean | null, ): Promise<Models.OAuth2Resend>; updateOAuth2Resend( paramsOrFirst?: - | { clientId?: string; clientSecret?: string; enabled?: boolean } - | string, - ...rest: [string?, boolean?] + | { + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; + } + | string + | null, + ...rest: [(string | null)?, (boolean | null)?] ): Promise<Models.OAuth2Resend> { let params: { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }; if ( @@ -6283,15 +6481,15 @@ export class Project { !Array.isArray(paramsOrFirst)) ) { params = (paramsOrFirst || {}) as { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }; } else { params = { - clientId: paramsOrFirst as string, - clientSecret: rest[0] as string, - enabled: rest[1] as boolean, + clientId: paramsOrFirst as string | null, + clientSecret: rest[0] as string | null, + enabled: rest[1] as boolean | null, }; } @@ -6339,52 +6537,57 @@ export class Project { /** * Update the project OAuth2 Salesforce configuration. * - * @param {string} params.customerKey - 'Consumer Key' of Salesforce OAuth2 app. For example: 3MVG9I0000000000000000000000000000000000000000000000000000000000000000000000000C5Aejq - * @param {string} params.customerSecret - 'Consumer Secret' of Salesforce OAuth2 app. For example: 3w000000000000e2 - * @param {ProjectOAuth2SalesforcePrompt[]} params.prompt - Array of Salesforce OAuth2 prompt values. "login" means: prompt the user to re-authenticate. "consent" means: prompt the user for consent. Pass an empty array to use the Salesforce default. - * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} params.customerKey - 'Consumer Key' of Salesforce OAuth2 app. For example: 3MVG9I0000000000000000000000000000000000000000000000000000000000000000000000000C5Aejq + * @param {string | null} params.customerSecret - 'Consumer Secret' of Salesforce OAuth2 app. For example: 3w000000000000e2 + * @param {boolean | null} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {ProjectOAuth2SalesforcePrompt[] | null} params.prompt - Array of Salesforce OAuth2 prompt values. "login" means: prompt the user to re-authenticate. "consent" means: prompt the user for consent. Pass an empty array to use the Salesforce default. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Salesforce>} */ updateOAuth2Salesforce(params?: { - customerKey?: string; - customerSecret?: string; - prompt?: ProjectOAuth2SalesforcePrompt[]; - enabled?: boolean; + customerKey?: string | null; + customerSecret?: string | null; + enabled?: boolean | null; + prompt?: ProjectOAuth2SalesforcePrompt[] | null; }): Promise<Models.OAuth2Salesforce>; /** * Update the project OAuth2 Salesforce configuration. * - * @param {string} customerKey - 'Consumer Key' of Salesforce OAuth2 app. For example: 3MVG9I0000000000000000000000000000000000000000000000000000000000000000000000000C5Aejq - * @param {string} customerSecret - 'Consumer Secret' of Salesforce OAuth2 app. For example: 3w000000000000e2 - * @param {ProjectOAuth2SalesforcePrompt[]} prompt - Array of Salesforce OAuth2 prompt values. "login" means: prompt the user to re-authenticate. "consent" means: prompt the user for consent. Pass an empty array to use the Salesforce default. - * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} customerKey - 'Consumer Key' of Salesforce OAuth2 app. For example: 3MVG9I0000000000000000000000000000000000000000000000000000000000000000000000000C5Aejq + * @param {string | null} customerSecret - 'Consumer Secret' of Salesforce OAuth2 app. For example: 3w000000000000e2 + * @param {boolean | null} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {ProjectOAuth2SalesforcePrompt[] | null} prompt - Array of Salesforce OAuth2 prompt values. "login" means: prompt the user to re-authenticate. "consent" means: prompt the user for consent. Pass an empty array to use the Salesforce default. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Salesforce>} * @deprecated Use the object parameter style method for a better developer experience. */ updateOAuth2Salesforce( - customerKey?: string, - customerSecret?: string, - prompt?: ProjectOAuth2SalesforcePrompt[], - enabled?: boolean, + customerKey?: string | null, + customerSecret?: string | null, + enabled?: boolean | null, + prompt?: ProjectOAuth2SalesforcePrompt[] | null, ): Promise<Models.OAuth2Salesforce>; updateOAuth2Salesforce( paramsOrFirst?: | { - customerKey?: string; - customerSecret?: string; - prompt?: ProjectOAuth2SalesforcePrompt[]; - enabled?: boolean; + customerKey?: string | null; + customerSecret?: string | null; + enabled?: boolean | null; + prompt?: ProjectOAuth2SalesforcePrompt[] | null; } - | string, - ...rest: [string?, ProjectOAuth2SalesforcePrompt[]?, boolean?] + | string + | null, + ...rest: [ + (string | null)?, + (boolean | null)?, + (ProjectOAuth2SalesforcePrompt[] | null)?, + ] ): Promise<Models.OAuth2Salesforce> { let params: { - customerKey?: string; - customerSecret?: string; - prompt?: ProjectOAuth2SalesforcePrompt[]; - enabled?: boolean; + customerKey?: string | null; + customerSecret?: string | null; + enabled?: boolean | null; + prompt?: ProjectOAuth2SalesforcePrompt[] | null; }; if ( @@ -6394,24 +6597,24 @@ export class Project { !Array.isArray(paramsOrFirst)) ) { params = (paramsOrFirst || {}) as { - customerKey?: string; - customerSecret?: string; - prompt?: ProjectOAuth2SalesforcePrompt[]; - enabled?: boolean; + customerKey?: string | null; + customerSecret?: string | null; + enabled?: boolean | null; + prompt?: ProjectOAuth2SalesforcePrompt[] | null; }; } else { params = { - customerKey: paramsOrFirst as string, - customerSecret: rest[0] as string, - prompt: rest[1] as ProjectOAuth2SalesforcePrompt[], - enabled: rest[2] as boolean, + customerKey: paramsOrFirst as string | null, + customerSecret: rest[0] as string | null, + enabled: rest[1] as boolean | null, + prompt: rest[2] as ProjectOAuth2SalesforcePrompt[] | null, }; } const customerKey = params.customerKey; const customerSecret = params.customerSecret; - const prompt = params.prompt; const enabled = params.enabled; + const prompt = params.prompt; const apiPath = '/project/oauth2/salesforce'; const apiPayload: Payload = {}; @@ -6421,12 +6624,12 @@ export class Project { if (typeof customerSecret !== 'undefined') { apiPayload['customerSecret'] = customerSecret; } - if (typeof prompt !== 'undefined') { - apiPayload['prompt'] = prompt; - } if (typeof enabled !== 'undefined') { apiPayload['enabled'] = enabled; } + if (typeof prompt !== 'undefined') { + apiPayload['prompt'] = prompt; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -6457,42 +6660,47 @@ export class Project { /** * Update the project OAuth2 Slack configuration. * - * @param {string} params.clientId - 'Client ID' of Slack OAuth2 app. For example: 23000000089.15000000000023 - * @param {string} params.clientSecret - 'Client Secret' of Slack OAuth2 app. For example: 81656000000000000000000000f3d2fd - * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} params.clientId - 'Client ID' of Slack OAuth2 app. For example: 23000000089.15000000000023 + * @param {string | null} params.clientSecret - 'Client Secret' of Slack OAuth2 app. For example: 81656000000000000000000000f3d2fd + * @param {boolean | null} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Slack>} */ updateOAuth2Slack(params?: { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }): Promise<Models.OAuth2Slack>; /** * Update the project OAuth2 Slack configuration. * - * @param {string} clientId - 'Client ID' of Slack OAuth2 app. For example: 23000000089.15000000000023 - * @param {string} clientSecret - 'Client Secret' of Slack OAuth2 app. For example: 81656000000000000000000000f3d2fd - * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} clientId - 'Client ID' of Slack OAuth2 app. For example: 23000000089.15000000000023 + * @param {string | null} clientSecret - 'Client Secret' of Slack OAuth2 app. For example: 81656000000000000000000000f3d2fd + * @param {boolean | null} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Slack>} * @deprecated Use the object parameter style method for a better developer experience. */ updateOAuth2Slack( - clientId?: string, - clientSecret?: string, - enabled?: boolean, + clientId?: string | null, + clientSecret?: string | null, + enabled?: boolean | null, ): Promise<Models.OAuth2Slack>; updateOAuth2Slack( paramsOrFirst?: - | { clientId?: string; clientSecret?: string; enabled?: boolean } - | string, - ...rest: [string?, boolean?] + | { + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; + } + | string + | null, + ...rest: [(string | null)?, (boolean | null)?] ): Promise<Models.OAuth2Slack> { let params: { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }; if ( @@ -6502,15 +6710,15 @@ export class Project { !Array.isArray(paramsOrFirst)) ) { params = (paramsOrFirst || {}) as { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }; } else { params = { - clientId: paramsOrFirst as string, - clientSecret: rest[0] as string, - enabled: rest[1] as boolean, + clientId: paramsOrFirst as string | null, + clientSecret: rest[0] as string | null, + enabled: rest[1] as boolean | null, }; } @@ -6558,42 +6766,47 @@ export class Project { /** * Update the project OAuth2 Spotify configuration. * - * @param {string} params.clientId - 'Client ID' of Spotify OAuth2 app. For example: 6ec271000000000000000000009beace - * @param {string} params.clientSecret - 'Client Secret' of Spotify OAuth2 app. For example: db068a000000000000000000008b5b9f - * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} params.clientId - 'Client ID' of Spotify OAuth2 app. For example: 6ec271000000000000000000009beace + * @param {string | null} params.clientSecret - 'Client Secret' of Spotify OAuth2 app. For example: db068a000000000000000000008b5b9f + * @param {boolean | null} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Spotify>} */ updateOAuth2Spotify(params?: { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }): Promise<Models.OAuth2Spotify>; /** * Update the project OAuth2 Spotify configuration. * - * @param {string} clientId - 'Client ID' of Spotify OAuth2 app. For example: 6ec271000000000000000000009beace - * @param {string} clientSecret - 'Client Secret' of Spotify OAuth2 app. For example: db068a000000000000000000008b5b9f - * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} clientId - 'Client ID' of Spotify OAuth2 app. For example: 6ec271000000000000000000009beace + * @param {string | null} clientSecret - 'Client Secret' of Spotify OAuth2 app. For example: db068a000000000000000000008b5b9f + * @param {boolean | null} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Spotify>} * @deprecated Use the object parameter style method for a better developer experience. */ updateOAuth2Spotify( - clientId?: string, - clientSecret?: string, - enabled?: boolean, + clientId?: string | null, + clientSecret?: string | null, + enabled?: boolean | null, ): Promise<Models.OAuth2Spotify>; updateOAuth2Spotify( paramsOrFirst?: - | { clientId?: string; clientSecret?: string; enabled?: boolean } - | string, - ...rest: [string?, boolean?] + | { + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; + } + | string + | null, + ...rest: [(string | null)?, (boolean | null)?] ): Promise<Models.OAuth2Spotify> { let params: { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }; if ( @@ -6603,15 +6816,15 @@ export class Project { !Array.isArray(paramsOrFirst)) ) { params = (paramsOrFirst || {}) as { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }; } else { params = { - clientId: paramsOrFirst as string, - clientSecret: rest[0] as string, - enabled: rest[1] as boolean, + clientId: paramsOrFirst as string | null, + clientSecret: rest[0] as string | null, + enabled: rest[1] as boolean | null, }; } @@ -6659,42 +6872,47 @@ export class Project { /** * Update the project OAuth2 Stripe configuration. * - * @param {string} params.clientId - 'Client ID' of Stripe OAuth2 app. For example: ca_UKibXX0000000000000000000006byvR - * @param {string} params.apiSecretKey - 'API Secret Key' of Stripe OAuth2 app. For example: sk_51SfOd000000000000000000000000000000000000000000000000000000000000000000000000000000000000000QGWYfp - * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} params.clientId - 'Client ID' of Stripe OAuth2 app. For example: ca_UKibXX0000000000000000000006byvR + * @param {string | null} params.apiSecretKey - 'API Secret Key' of Stripe OAuth2 app. For example: sk_51SfOd000000000000000000000000000000000000000000000000000000000000000000000000000000000000000QGWYfp + * @param {boolean | null} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Stripe>} */ updateOAuth2Stripe(params?: { - clientId?: string; - apiSecretKey?: string; - enabled?: boolean; + clientId?: string | null; + apiSecretKey?: string | null; + enabled?: boolean | null; }): Promise<Models.OAuth2Stripe>; /** * Update the project OAuth2 Stripe configuration. * - * @param {string} clientId - 'Client ID' of Stripe OAuth2 app. For example: ca_UKibXX0000000000000000000006byvR - * @param {string} apiSecretKey - 'API Secret Key' of Stripe OAuth2 app. For example: sk_51SfOd000000000000000000000000000000000000000000000000000000000000000000000000000000000000000QGWYfp - * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} clientId - 'Client ID' of Stripe OAuth2 app. For example: ca_UKibXX0000000000000000000006byvR + * @param {string | null} apiSecretKey - 'API Secret Key' of Stripe OAuth2 app. For example: sk_51SfOd000000000000000000000000000000000000000000000000000000000000000000000000000000000000000QGWYfp + * @param {boolean | null} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Stripe>} * @deprecated Use the object parameter style method for a better developer experience. */ updateOAuth2Stripe( - clientId?: string, - apiSecretKey?: string, - enabled?: boolean, + clientId?: string | null, + apiSecretKey?: string | null, + enabled?: boolean | null, ): Promise<Models.OAuth2Stripe>; updateOAuth2Stripe( paramsOrFirst?: - | { clientId?: string; apiSecretKey?: string; enabled?: boolean } - | string, - ...rest: [string?, boolean?] + | { + clientId?: string | null; + apiSecretKey?: string | null; + enabled?: boolean | null; + } + | string + | null, + ...rest: [(string | null)?, (boolean | null)?] ): Promise<Models.OAuth2Stripe> { let params: { - clientId?: string; - apiSecretKey?: string; - enabled?: boolean; + clientId?: string | null; + apiSecretKey?: string | null; + enabled?: boolean | null; }; if ( @@ -6704,15 +6922,15 @@ export class Project { !Array.isArray(paramsOrFirst)) ) { params = (paramsOrFirst || {}) as { - clientId?: string; - apiSecretKey?: string; - enabled?: boolean; + clientId?: string | null; + apiSecretKey?: string | null; + enabled?: boolean | null; }; } else { params = { - clientId: paramsOrFirst as string, - apiSecretKey: rest[0] as string, - enabled: rest[1] as boolean, + clientId: paramsOrFirst as string | null, + apiSecretKey: rest[0] as string | null, + enabled: rest[1] as boolean | null, }; } @@ -6760,42 +6978,47 @@ export class Project { /** * Update the project OAuth2 TikTok configuration. * - * @param {string} params.clientId - 'Client key' of TikTok OAuth2 app. For example: awz000000000tyw0 - * @param {string} params.clientSecret - 'Client secret' of TikTok OAuth2 app. For example: 6wXewM00000000000000000000yXnite - * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} params.clientId - 'Client key' of TikTok OAuth2 app. For example: awz000000000tyw0 + * @param {string | null} params.clientSecret - 'Client secret' of TikTok OAuth2 app. For example: 6wXewM00000000000000000000yXnite + * @param {boolean | null} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2TikTok>} */ updateOAuth2TikTok(params?: { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }): Promise<Models.OAuth2TikTok>; /** * Update the project OAuth2 TikTok configuration. * - * @param {string} clientId - 'Client key' of TikTok OAuth2 app. For example: awz000000000tyw0 - * @param {string} clientSecret - 'Client secret' of TikTok OAuth2 app. For example: 6wXewM00000000000000000000yXnite - * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} clientId - 'Client key' of TikTok OAuth2 app. For example: awz000000000tyw0 + * @param {string | null} clientSecret - 'Client secret' of TikTok OAuth2 app. For example: 6wXewM00000000000000000000yXnite + * @param {boolean | null} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2TikTok>} * @deprecated Use the object parameter style method for a better developer experience. */ updateOAuth2TikTok( - clientId?: string, - clientSecret?: string, - enabled?: boolean, + clientId?: string | null, + clientSecret?: string | null, + enabled?: boolean | null, ): Promise<Models.OAuth2TikTok>; updateOAuth2TikTok( paramsOrFirst?: - | { clientId?: string; clientSecret?: string; enabled?: boolean } - | string, - ...rest: [string?, boolean?] + | { + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; + } + | string + | null, + ...rest: [(string | null)?, (boolean | null)?] ): Promise<Models.OAuth2TikTok> { let params: { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }; if ( @@ -6805,15 +7028,15 @@ export class Project { !Array.isArray(paramsOrFirst)) ) { params = (paramsOrFirst || {}) as { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }; } else { params = { - clientId: paramsOrFirst as string, - clientSecret: rest[0] as string, - enabled: rest[1] as boolean, + clientId: paramsOrFirst as string | null, + clientSecret: rest[0] as string | null, + enabled: rest[1] as boolean | null, }; } @@ -6861,46 +7084,47 @@ export class Project { /** * Update the project OAuth2 Tradeshift configuration. * - * @param {string} params.oauth2ClientId - 'OAuth2 Client ID' of Tradeshift OAuth2 app. For example: appwrite-tes00000.0000000000est-app - * @param {string} params.oauth2ClientSecret - 'OAuth2 Client Secret' of Tradeshift OAuth2 app. For example: 7cb52700-0000-0000-0000-000000ca5b83 - * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} params.oauth2ClientId - 'OAuth2 Client ID' of Tradeshift OAuth2 app. For example: appwrite-tes00000.0000000000est-app + * @param {string | null} params.oauth2ClientSecret - 'OAuth2 Client Secret' of Tradeshift OAuth2 app. For example: 7cb52700-0000-0000-0000-000000ca5b83 + * @param {boolean | null} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Tradeshift>} */ updateOAuth2Tradeshift(params?: { - oauth2ClientId?: string; - oauth2ClientSecret?: string; - enabled?: boolean; + oauth2ClientId?: string | null; + oauth2ClientSecret?: string | null; + enabled?: boolean | null; }): Promise<Models.OAuth2Tradeshift>; /** * Update the project OAuth2 Tradeshift configuration. * - * @param {string} oauth2ClientId - 'OAuth2 Client ID' of Tradeshift OAuth2 app. For example: appwrite-tes00000.0000000000est-app - * @param {string} oauth2ClientSecret - 'OAuth2 Client Secret' of Tradeshift OAuth2 app. For example: 7cb52700-0000-0000-0000-000000ca5b83 - * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} oauth2ClientId - 'OAuth2 Client ID' of Tradeshift OAuth2 app. For example: appwrite-tes00000.0000000000est-app + * @param {string | null} oauth2ClientSecret - 'OAuth2 Client Secret' of Tradeshift OAuth2 app. For example: 7cb52700-0000-0000-0000-000000ca5b83 + * @param {boolean | null} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Tradeshift>} * @deprecated Use the object parameter style method for a better developer experience. */ updateOAuth2Tradeshift( - oauth2ClientId?: string, - oauth2ClientSecret?: string, - enabled?: boolean, + oauth2ClientId?: string | null, + oauth2ClientSecret?: string | null, + enabled?: boolean | null, ): Promise<Models.OAuth2Tradeshift>; updateOAuth2Tradeshift( paramsOrFirst?: | { - oauth2ClientId?: string; - oauth2ClientSecret?: string; - enabled?: boolean; + oauth2ClientId?: string | null; + oauth2ClientSecret?: string | null; + enabled?: boolean | null; } - | string, - ...rest: [string?, boolean?] + | string + | null, + ...rest: [(string | null)?, (boolean | null)?] ): Promise<Models.OAuth2Tradeshift> { let params: { - oauth2ClientId?: string; - oauth2ClientSecret?: string; - enabled?: boolean; + oauth2ClientId?: string | null; + oauth2ClientSecret?: string | null; + enabled?: boolean | null; }; if ( @@ -6910,15 +7134,15 @@ export class Project { !Array.isArray(paramsOrFirst)) ) { params = (paramsOrFirst || {}) as { - oauth2ClientId?: string; - oauth2ClientSecret?: string; - enabled?: boolean; + oauth2ClientId?: string | null; + oauth2ClientSecret?: string | null; + enabled?: boolean | null; }; } else { params = { - oauth2ClientId: paramsOrFirst as string, - oauth2ClientSecret: rest[0] as string, - enabled: rest[1] as boolean, + oauth2ClientId: paramsOrFirst as string | null, + oauth2ClientSecret: rest[0] as string | null, + enabled: rest[1] as boolean | null, }; } @@ -6966,46 +7190,47 @@ export class Project { /** * Update the project OAuth2 Tradeshift Sandbox configuration. * - * @param {string} params.oauth2ClientId - 'OAuth2 Client ID' of Tradeshift Sandbox OAuth2 app. For example: appwrite-tes00000.0000000000est-app - * @param {string} params.oauth2ClientSecret - 'OAuth2 Client Secret' of Tradeshift Sandbox OAuth2 app. For example: 7cb52700-0000-0000-0000-000000ca5b83 - * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} params.oauth2ClientId - 'OAuth2 Client ID' of Tradeshift Sandbox OAuth2 app. For example: appwrite-tes00000.0000000000est-app + * @param {string | null} params.oauth2ClientSecret - 'OAuth2 Client Secret' of Tradeshift Sandbox OAuth2 app. For example: 7cb52700-0000-0000-0000-000000ca5b83 + * @param {boolean | null} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Tradeshift>} */ updateOAuth2TradeshiftSandbox(params?: { - oauth2ClientId?: string; - oauth2ClientSecret?: string; - enabled?: boolean; + oauth2ClientId?: string | null; + oauth2ClientSecret?: string | null; + enabled?: boolean | null; }): Promise<Models.OAuth2Tradeshift>; /** * Update the project OAuth2 Tradeshift Sandbox configuration. * - * @param {string} oauth2ClientId - 'OAuth2 Client ID' of Tradeshift Sandbox OAuth2 app. For example: appwrite-tes00000.0000000000est-app - * @param {string} oauth2ClientSecret - 'OAuth2 Client Secret' of Tradeshift Sandbox OAuth2 app. For example: 7cb52700-0000-0000-0000-000000ca5b83 - * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} oauth2ClientId - 'OAuth2 Client ID' of Tradeshift Sandbox OAuth2 app. For example: appwrite-tes00000.0000000000est-app + * @param {string | null} oauth2ClientSecret - 'OAuth2 Client Secret' of Tradeshift Sandbox OAuth2 app. For example: 7cb52700-0000-0000-0000-000000ca5b83 + * @param {boolean | null} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Tradeshift>} * @deprecated Use the object parameter style method for a better developer experience. */ updateOAuth2TradeshiftSandbox( - oauth2ClientId?: string, - oauth2ClientSecret?: string, - enabled?: boolean, + oauth2ClientId?: string | null, + oauth2ClientSecret?: string | null, + enabled?: boolean | null, ): Promise<Models.OAuth2Tradeshift>; updateOAuth2TradeshiftSandbox( paramsOrFirst?: | { - oauth2ClientId?: string; - oauth2ClientSecret?: string; - enabled?: boolean; + oauth2ClientId?: string | null; + oauth2ClientSecret?: string | null; + enabled?: boolean | null; } - | string, - ...rest: [string?, boolean?] + | string + | null, + ...rest: [(string | null)?, (boolean | null)?] ): Promise<Models.OAuth2Tradeshift> { let params: { - oauth2ClientId?: string; - oauth2ClientSecret?: string; - enabled?: boolean; + oauth2ClientId?: string | null; + oauth2ClientSecret?: string | null; + enabled?: boolean | null; }; if ( @@ -7015,15 +7240,15 @@ export class Project { !Array.isArray(paramsOrFirst)) ) { params = (paramsOrFirst || {}) as { - oauth2ClientId?: string; - oauth2ClientSecret?: string; - enabled?: boolean; + oauth2ClientId?: string | null; + oauth2ClientSecret?: string | null; + enabled?: boolean | null; }; } else { params = { - oauth2ClientId: paramsOrFirst as string, - oauth2ClientSecret: rest[0] as string, - enabled: rest[1] as boolean, + oauth2ClientId: paramsOrFirst as string | null, + oauth2ClientSecret: rest[0] as string | null, + enabled: rest[1] as boolean | null, }; } @@ -7071,42 +7296,47 @@ export class Project { /** * Update the project OAuth2 Twitch configuration. * - * @param {string} params.clientId - 'Client ID' of Twitch OAuth2 app. For example: vvi0in000000000000000000ikmt9p - * @param {string} params.clientSecret - 'Client Secret' of Twitch OAuth2 app. For example: pmapue000000000000000000zylw3v - * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} params.clientId - 'Client ID' of Twitch OAuth2 app. For example: vvi0in000000000000000000ikmt9p + * @param {string | null} params.clientSecret - 'Client Secret' of Twitch OAuth2 app. For example: pmapue000000000000000000zylw3v + * @param {boolean | null} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Twitch>} */ updateOAuth2Twitch(params?: { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }): Promise<Models.OAuth2Twitch>; /** * Update the project OAuth2 Twitch configuration. * - * @param {string} clientId - 'Client ID' of Twitch OAuth2 app. For example: vvi0in000000000000000000ikmt9p - * @param {string} clientSecret - 'Client Secret' of Twitch OAuth2 app. For example: pmapue000000000000000000zylw3v - * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} clientId - 'Client ID' of Twitch OAuth2 app. For example: vvi0in000000000000000000ikmt9p + * @param {string | null} clientSecret - 'Client Secret' of Twitch OAuth2 app. For example: pmapue000000000000000000zylw3v + * @param {boolean | null} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Twitch>} * @deprecated Use the object parameter style method for a better developer experience. */ updateOAuth2Twitch( - clientId?: string, - clientSecret?: string, - enabled?: boolean, + clientId?: string | null, + clientSecret?: string | null, + enabled?: boolean | null, ): Promise<Models.OAuth2Twitch>; updateOAuth2Twitch( paramsOrFirst?: - | { clientId?: string; clientSecret?: string; enabled?: boolean } - | string, - ...rest: [string?, boolean?] + | { + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; + } + | string + | null, + ...rest: [(string | null)?, (boolean | null)?] ): Promise<Models.OAuth2Twitch> { let params: { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }; if ( @@ -7116,15 +7346,15 @@ export class Project { !Array.isArray(paramsOrFirst)) ) { params = (paramsOrFirst || {}) as { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }; } else { params = { - clientId: paramsOrFirst as string, - clientSecret: rest[0] as string, - enabled: rest[1] as boolean, + clientId: paramsOrFirst as string | null, + clientSecret: rest[0] as string | null, + enabled: rest[1] as boolean | null, }; } @@ -7172,42 +7402,47 @@ export class Project { /** * Update the project OAuth2 Webflow configuration. * - * @param {string} params.clientId - 'Client ID' of Webflow OAuth2 app. For example: 8bb20000000000000000000000000000000000000000000000000000000040dd - * @param {string} params.clientSecret - 'Client Secret' of Webflow OAuth2 app. For example: 59bf00000000000000000000000000000000000000000000000000000000fe59 - * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} params.clientId - 'Client ID' of Webflow OAuth2 app. For example: 8bb20000000000000000000000000000000000000000000000000000000040dd + * @param {string | null} params.clientSecret - 'Client Secret' of Webflow OAuth2 app. For example: 59bf00000000000000000000000000000000000000000000000000000000fe59 + * @param {boolean | null} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Webflow>} */ updateOAuth2Webflow(params?: { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }): Promise<Models.OAuth2Webflow>; /** * Update the project OAuth2 Webflow configuration. * - * @param {string} clientId - 'Client ID' of Webflow OAuth2 app. For example: 8bb20000000000000000000000000000000000000000000000000000000040dd - * @param {string} clientSecret - 'Client Secret' of Webflow OAuth2 app. For example: 59bf00000000000000000000000000000000000000000000000000000000fe59 - * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} clientId - 'Client ID' of Webflow OAuth2 app. For example: 8bb20000000000000000000000000000000000000000000000000000000040dd + * @param {string | null} clientSecret - 'Client Secret' of Webflow OAuth2 app. For example: 59bf00000000000000000000000000000000000000000000000000000000fe59 + * @param {boolean | null} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Webflow>} * @deprecated Use the object parameter style method for a better developer experience. */ updateOAuth2Webflow( - clientId?: string, - clientSecret?: string, - enabled?: boolean, + clientId?: string | null, + clientSecret?: string | null, + enabled?: boolean | null, ): Promise<Models.OAuth2Webflow>; updateOAuth2Webflow( paramsOrFirst?: - | { clientId?: string; clientSecret?: string; enabled?: boolean } - | string, - ...rest: [string?, boolean?] + | { + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; + } + | string + | null, + ...rest: [(string | null)?, (boolean | null)?] ): Promise<Models.OAuth2Webflow> { let params: { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }; if ( @@ -7217,15 +7452,15 @@ export class Project { !Array.isArray(paramsOrFirst)) ) { params = (paramsOrFirst || {}) as { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }; } else { params = { - clientId: paramsOrFirst as string, - clientSecret: rest[0] as string, - enabled: rest[1] as boolean, + clientId: paramsOrFirst as string | null, + clientSecret: rest[0] as string | null, + enabled: rest[1] as boolean | null, }; } @@ -7273,42 +7508,47 @@ export class Project { /** * Update the project OAuth2 WordPress configuration. * - * @param {string} params.clientId - 'Client ID' of WordPress OAuth2 app. For example: 130005 - * @param {string} params.clientSecret - 'Client Secret' of WordPress OAuth2 app. For example: PlBfJS0000000000000000000000000000000000000000000000000000EdUZJk - * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} params.clientId - 'Client ID' of WordPress OAuth2 app. For example: 130005 + * @param {string | null} params.clientSecret - 'Client Secret' of WordPress OAuth2 app. For example: PlBfJS0000000000000000000000000000000000000000000000000000EdUZJk + * @param {boolean | null} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2WordPress>} */ updateOAuth2WordPress(params?: { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }): Promise<Models.OAuth2WordPress>; /** * Update the project OAuth2 WordPress configuration. * - * @param {string} clientId - 'Client ID' of WordPress OAuth2 app. For example: 130005 - * @param {string} clientSecret - 'Client Secret' of WordPress OAuth2 app. For example: PlBfJS0000000000000000000000000000000000000000000000000000EdUZJk - * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} clientId - 'Client ID' of WordPress OAuth2 app. For example: 130005 + * @param {string | null} clientSecret - 'Client Secret' of WordPress OAuth2 app. For example: PlBfJS0000000000000000000000000000000000000000000000000000EdUZJk + * @param {boolean | null} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2WordPress>} * @deprecated Use the object parameter style method for a better developer experience. */ updateOAuth2WordPress( - clientId?: string, - clientSecret?: string, - enabled?: boolean, + clientId?: string | null, + clientSecret?: string | null, + enabled?: boolean | null, ): Promise<Models.OAuth2WordPress>; updateOAuth2WordPress( paramsOrFirst?: - | { clientId?: string; clientSecret?: string; enabled?: boolean } - | string, - ...rest: [string?, boolean?] + | { + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; + } + | string + | null, + ...rest: [(string | null)?, (boolean | null)?] ): Promise<Models.OAuth2WordPress> { let params: { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }; if ( @@ -7318,15 +7558,15 @@ export class Project { !Array.isArray(paramsOrFirst)) ) { params = (paramsOrFirst || {}) as { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }; } else { params = { - clientId: paramsOrFirst as string, - clientSecret: rest[0] as string, - enabled: rest[1] as boolean, + clientId: paramsOrFirst as string | null, + clientSecret: rest[0] as string | null, + enabled: rest[1] as boolean | null, }; } @@ -7374,42 +7614,47 @@ export class Project { /** * Update the project OAuth2 X configuration. * - * @param {string} params.customerKey - 'Customer Key' of X OAuth2 app. For example: slzZV0000000000000NFLaWT - * @param {string} params.secretKey - 'Secret Key' of X OAuth2 app. For example: tkEPkp00000000000000000000000000000000000000FTxbI9 - * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} params.customerKey - 'Customer Key' of X OAuth2 app. For example: slzZV0000000000000NFLaWT + * @param {string | null} params.secretKey - 'Secret Key' of X OAuth2 app. For example: tkEPkp00000000000000000000000000000000000000FTxbI9 + * @param {boolean | null} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2X>} */ updateOAuth2X(params?: { - customerKey?: string; - secretKey?: string; - enabled?: boolean; + customerKey?: string | null; + secretKey?: string | null; + enabled?: boolean | null; }): Promise<Models.OAuth2X>; /** * Update the project OAuth2 X configuration. * - * @param {string} customerKey - 'Customer Key' of X OAuth2 app. For example: slzZV0000000000000NFLaWT - * @param {string} secretKey - 'Secret Key' of X OAuth2 app. For example: tkEPkp00000000000000000000000000000000000000FTxbI9 - * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} customerKey - 'Customer Key' of X OAuth2 app. For example: slzZV0000000000000NFLaWT + * @param {string | null} secretKey - 'Secret Key' of X OAuth2 app. For example: tkEPkp00000000000000000000000000000000000000FTxbI9 + * @param {boolean | null} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2X>} * @deprecated Use the object parameter style method for a better developer experience. */ updateOAuth2X( - customerKey?: string, - secretKey?: string, - enabled?: boolean, + customerKey?: string | null, + secretKey?: string | null, + enabled?: boolean | null, ): Promise<Models.OAuth2X>; updateOAuth2X( paramsOrFirst?: - | { customerKey?: string; secretKey?: string; enabled?: boolean } - | string, - ...rest: [string?, boolean?] + | { + customerKey?: string | null; + secretKey?: string | null; + enabled?: boolean | null; + } + | string + | null, + ...rest: [(string | null)?, (boolean | null)?] ): Promise<Models.OAuth2X> { let params: { - customerKey?: string; - secretKey?: string; - enabled?: boolean; + customerKey?: string | null; + secretKey?: string | null; + enabled?: boolean | null; }; if ( @@ -7419,15 +7664,15 @@ export class Project { !Array.isArray(paramsOrFirst)) ) { params = (paramsOrFirst || {}) as { - customerKey?: string; - secretKey?: string; - enabled?: boolean; + customerKey?: string | null; + secretKey?: string | null; + enabled?: boolean | null; }; } else { params = { - customerKey: paramsOrFirst as string, - secretKey: rest[0] as string, - enabled: rest[1] as boolean, + customerKey: paramsOrFirst as string | null, + secretKey: rest[0] as string | null, + enabled: rest[1] as boolean | null, }; } @@ -7475,42 +7720,47 @@ export class Project { /** * Update the project OAuth2 Yahoo configuration. * - * @param {string} params.clientId - 'Client ID, also known as Customer Key' of Yahoo OAuth2 app. For example: dj0yJm000000000000000000000000000000000000000000000000000000000000000000000000000000000000Z4PWRm - * @param {string} params.clientSecret - 'Client Secret, also known as Customer Secret' of Yahoo OAuth2 app. For example: cf978f0000000000000000000000000000c5e2e9 - * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} params.clientId - 'Client ID, also known as Customer Key' of Yahoo OAuth2 app. For example: dj0yJm000000000000000000000000000000000000000000000000000000000000000000000000000000000000Z4PWRm + * @param {string | null} params.clientSecret - 'Client Secret, also known as Customer Secret' of Yahoo OAuth2 app. For example: cf978f0000000000000000000000000000c5e2e9 + * @param {boolean | null} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Yahoo>} */ updateOAuth2Yahoo(params?: { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }): Promise<Models.OAuth2Yahoo>; /** * Update the project OAuth2 Yahoo configuration. * - * @param {string} clientId - 'Client ID, also known as Customer Key' of Yahoo OAuth2 app. For example: dj0yJm000000000000000000000000000000000000000000000000000000000000000000000000000000000000Z4PWRm - * @param {string} clientSecret - 'Client Secret, also known as Customer Secret' of Yahoo OAuth2 app. For example: cf978f0000000000000000000000000000c5e2e9 - * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} clientId - 'Client ID, also known as Customer Key' of Yahoo OAuth2 app. For example: dj0yJm000000000000000000000000000000000000000000000000000000000000000000000000000000000000Z4PWRm + * @param {string | null} clientSecret - 'Client Secret, also known as Customer Secret' of Yahoo OAuth2 app. For example: cf978f0000000000000000000000000000c5e2e9 + * @param {boolean | null} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Yahoo>} * @deprecated Use the object parameter style method for a better developer experience. */ updateOAuth2Yahoo( - clientId?: string, - clientSecret?: string, - enabled?: boolean, + clientId?: string | null, + clientSecret?: string | null, + enabled?: boolean | null, ): Promise<Models.OAuth2Yahoo>; updateOAuth2Yahoo( paramsOrFirst?: - | { clientId?: string; clientSecret?: string; enabled?: boolean } - | string, - ...rest: [string?, boolean?] + | { + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; + } + | string + | null, + ...rest: [(string | null)?, (boolean | null)?] ): Promise<Models.OAuth2Yahoo> { let params: { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }; if ( @@ -7520,15 +7770,15 @@ export class Project { !Array.isArray(paramsOrFirst)) ) { params = (paramsOrFirst || {}) as { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }; } else { params = { - clientId: paramsOrFirst as string, - clientSecret: rest[0] as string, - enabled: rest[1] as boolean, + clientId: paramsOrFirst as string | null, + clientSecret: rest[0] as string | null, + enabled: rest[1] as boolean | null, }; } @@ -7576,42 +7826,47 @@ export class Project { /** * Update the project OAuth2 Yandex configuration. * - * @param {string} params.clientId - 'Client ID' of Yandex OAuth2 app. For example: 6a8a6a0000000000000000000091483c - * @param {string} params.clientSecret - 'Client Secret' of Yandex OAuth2 app. For example: bbf98500000000000000000000c75a63 - * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} params.clientId - 'Client ID' of Yandex OAuth2 app. For example: 6a8a6a0000000000000000000091483c + * @param {string | null} params.clientSecret - 'Client Secret' of Yandex OAuth2 app. For example: bbf98500000000000000000000c75a63 + * @param {boolean | null} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Yandex>} */ updateOAuth2Yandex(params?: { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }): Promise<Models.OAuth2Yandex>; /** * Update the project OAuth2 Yandex configuration. * - * @param {string} clientId - 'Client ID' of Yandex OAuth2 app. For example: 6a8a6a0000000000000000000091483c - * @param {string} clientSecret - 'Client Secret' of Yandex OAuth2 app. For example: bbf98500000000000000000000c75a63 - * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} clientId - 'Client ID' of Yandex OAuth2 app. For example: 6a8a6a0000000000000000000091483c + * @param {string | null} clientSecret - 'Client Secret' of Yandex OAuth2 app. For example: bbf98500000000000000000000c75a63 + * @param {boolean | null} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Yandex>} * @deprecated Use the object parameter style method for a better developer experience. */ updateOAuth2Yandex( - clientId?: string, - clientSecret?: string, - enabled?: boolean, + clientId?: string | null, + clientSecret?: string | null, + enabled?: boolean | null, ): Promise<Models.OAuth2Yandex>; updateOAuth2Yandex( paramsOrFirst?: - | { clientId?: string; clientSecret?: string; enabled?: boolean } - | string, - ...rest: [string?, boolean?] + | { + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; + } + | string + | null, + ...rest: [(string | null)?, (boolean | null)?] ): Promise<Models.OAuth2Yandex> { let params: { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }; if ( @@ -7621,15 +7876,15 @@ export class Project { !Array.isArray(paramsOrFirst)) ) { params = (paramsOrFirst || {}) as { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }; } else { params = { - clientId: paramsOrFirst as string, - clientSecret: rest[0] as string, - enabled: rest[1] as boolean, + clientId: paramsOrFirst as string | null, + clientSecret: rest[0] as string | null, + enabled: rest[1] as boolean | null, }; } @@ -7677,52 +7932,57 @@ export class Project { /** * Update the project OAuth2 Zoho configuration. * - * @param {string} params.clientId - 'Client ID' of Zoho OAuth2 app. For example: 1000.83C178000000000000000000RPNX0B - * @param {string} params.clientSecret - 'Client Secret' of Zoho OAuth2 app. For example: fb5cac000000000000000000000000000000a68f6e - * @param {ProjectOAuth2ZohoPrompt[]} params.prompt - Array of Zoho OAuth2 prompt values. "consent" means: prompt the user for consent. Pass an empty array to use the Zoho default. - * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} params.clientId - 'Client ID' of Zoho OAuth2 app. For example: 1000.83C178000000000000000000RPNX0B + * @param {string | null} params.clientSecret - 'Client Secret' of Zoho OAuth2 app. For example: fb5cac000000000000000000000000000000a68f6e + * @param {boolean | null} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {ProjectOAuth2ZohoPrompt[] | null} params.prompt - Array of Zoho OAuth2 prompt values. "consent" means: prompt the user for consent. Pass an empty array to use the Zoho default. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Zoho>} */ updateOAuth2Zoho(params?: { - clientId?: string; - clientSecret?: string; - prompt?: ProjectOAuth2ZohoPrompt[]; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; + prompt?: ProjectOAuth2ZohoPrompt[] | null; }): Promise<Models.OAuth2Zoho>; /** * Update the project OAuth2 Zoho configuration. * - * @param {string} clientId - 'Client ID' of Zoho OAuth2 app. For example: 1000.83C178000000000000000000RPNX0B - * @param {string} clientSecret - 'Client Secret' of Zoho OAuth2 app. For example: fb5cac000000000000000000000000000000a68f6e - * @param {ProjectOAuth2ZohoPrompt[]} prompt - Array of Zoho OAuth2 prompt values. "consent" means: prompt the user for consent. Pass an empty array to use the Zoho default. - * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} clientId - 'Client ID' of Zoho OAuth2 app. For example: 1000.83C178000000000000000000RPNX0B + * @param {string | null} clientSecret - 'Client Secret' of Zoho OAuth2 app. For example: fb5cac000000000000000000000000000000a68f6e + * @param {boolean | null} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {ProjectOAuth2ZohoPrompt[] | null} prompt - Array of Zoho OAuth2 prompt values. "consent" means: prompt the user for consent. Pass an empty array to use the Zoho default. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Zoho>} * @deprecated Use the object parameter style method for a better developer experience. */ updateOAuth2Zoho( - clientId?: string, - clientSecret?: string, - prompt?: ProjectOAuth2ZohoPrompt[], - enabled?: boolean, + clientId?: string | null, + clientSecret?: string | null, + enabled?: boolean | null, + prompt?: ProjectOAuth2ZohoPrompt[] | null, ): Promise<Models.OAuth2Zoho>; updateOAuth2Zoho( paramsOrFirst?: | { - clientId?: string; - clientSecret?: string; - prompt?: ProjectOAuth2ZohoPrompt[]; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; + prompt?: ProjectOAuth2ZohoPrompt[] | null; } - | string, - ...rest: [string?, ProjectOAuth2ZohoPrompt[]?, boolean?] + | string + | null, + ...rest: [ + (string | null)?, + (boolean | null)?, + (ProjectOAuth2ZohoPrompt[] | null)?, + ] ): Promise<Models.OAuth2Zoho> { let params: { - clientId?: string; - clientSecret?: string; - prompt?: ProjectOAuth2ZohoPrompt[]; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; + prompt?: ProjectOAuth2ZohoPrompt[] | null; }; if ( @@ -7732,24 +7992,24 @@ export class Project { !Array.isArray(paramsOrFirst)) ) { params = (paramsOrFirst || {}) as { - clientId?: string; - clientSecret?: string; - prompt?: ProjectOAuth2ZohoPrompt[]; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; + prompt?: ProjectOAuth2ZohoPrompt[] | null; }; } else { params = { - clientId: paramsOrFirst as string, - clientSecret: rest[0] as string, - prompt: rest[1] as ProjectOAuth2ZohoPrompt[], - enabled: rest[2] as boolean, + clientId: paramsOrFirst as string | null, + clientSecret: rest[0] as string | null, + enabled: rest[1] as boolean | null, + prompt: rest[2] as ProjectOAuth2ZohoPrompt[] | null, }; } const clientId = params.clientId; const clientSecret = params.clientSecret; - const prompt = params.prompt; const enabled = params.enabled; + const prompt = params.prompt; const apiPath = '/project/oauth2/zoho'; const apiPayload: Payload = {}; @@ -7759,12 +8019,12 @@ export class Project { if (typeof clientSecret !== 'undefined') { apiPayload['clientSecret'] = clientSecret; } - if (typeof prompt !== 'undefined') { - apiPayload['prompt'] = prompt; - } if (typeof enabled !== 'undefined') { apiPayload['enabled'] = enabled; } + if (typeof prompt !== 'undefined') { + apiPayload['prompt'] = prompt; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -7795,42 +8055,47 @@ export class Project { /** * Update the project OAuth2 Zoom configuration. * - * @param {string} params.clientId - 'Client ID' of Zoom OAuth2 app. For example: QMAC00000000000000w0AQ - * @param {string} params.clientSecret - 'Client Secret' of Zoom OAuth2 app. For example: GAWsG4000000000000000000007U01ON - * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} params.clientId - 'Client ID' of Zoom OAuth2 app. For example: QMAC00000000000000w0AQ + * @param {string | null} params.clientSecret - 'Client Secret' of Zoom OAuth2 app. For example: GAWsG4000000000000000000007U01ON + * @param {boolean | null} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Zoom>} */ updateOAuth2Zoom(params?: { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }): Promise<Models.OAuth2Zoom>; /** * Update the project OAuth2 Zoom configuration. * - * @param {string} clientId - 'Client ID' of Zoom OAuth2 app. For example: QMAC00000000000000w0AQ - * @param {string} clientSecret - 'Client Secret' of Zoom OAuth2 app. For example: GAWsG4000000000000000000007U01ON - * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string | null} clientId - 'Client ID' of Zoom OAuth2 app. For example: QMAC00000000000000w0AQ + * @param {string | null} clientSecret - 'Client Secret' of Zoom OAuth2 app. For example: GAWsG4000000000000000000007U01ON + * @param {boolean | null} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise<Models.OAuth2Zoom>} * @deprecated Use the object parameter style method for a better developer experience. */ updateOAuth2Zoom( - clientId?: string, - clientSecret?: string, - enabled?: boolean, + clientId?: string | null, + clientSecret?: string | null, + enabled?: boolean | null, ): Promise<Models.OAuth2Zoom>; updateOAuth2Zoom( paramsOrFirst?: - | { clientId?: string; clientSecret?: string; enabled?: boolean } - | string, - ...rest: [string?, boolean?] + | { + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; + } + | string + | null, + ...rest: [(string | null)?, (boolean | null)?] ): Promise<Models.OAuth2Zoom> { let params: { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }; if ( @@ -7840,15 +8105,15 @@ export class Project { !Array.isArray(paramsOrFirst)) ) { params = (paramsOrFirst || {}) as { - clientId?: string; - clientSecret?: string; - enabled?: boolean; + clientId?: string | null; + clientSecret?: string | null; + enabled?: boolean | null; }; } else { params = { - clientId: paramsOrFirst as string, - clientSecret: rest[0] as string, - enabled: rest[1] as boolean, + clientId: paramsOrFirst as string | null, + clientSecret: rest[0] as string | null, + enabled: rest[1] as boolean | null, }; } @@ -8317,7 +8582,7 @@ export class Project { * @param {string} params.platformId - Platform ID. * @param {string} params.name - Platform name. Max length: 128 chars. * @param {string} params.applicationId - Android application ID. Max length: 256 chars. - * @param {string[]} params.fingerprints - SHA-256 fingerprints of the certificates your app is signed with, such as "14:6D:E9:...:2B:6A". Passkeys created in the app are accepted when its signature matches one. Find them under App signing in Play Console, or with `./gradlew signingReport`. Omit to keep the current list, or pass an empty array to clear it. + * @param {string[] | null} params.fingerprints - SHA-256 fingerprints of the certificates your app is signed with, such as "14:6D:E9:...:2B:6A". Passkeys created in the app are accepted when its signature matches one. Find them under App signing in Play Console, or with `./gradlew signingReport`. Omit to keep the current list, or pass an empty array to clear it. * @throws {AppwriteException} * @returns {Promise<Models.PlatformAndroid>} */ @@ -8325,7 +8590,7 @@ export class Project { platformId: string; name: string; applicationId: string; - fingerprints?: string[]; + fingerprints?: string[] | null; }): Promise<Models.PlatformAndroid>; /** * Update an Android platform by its unique ID. Use this endpoint to update the platform's name, application ID or signing certificate fingerprints. @@ -8333,7 +8598,7 @@ export class Project { * @param {string} platformId - Platform ID. * @param {string} name - Platform name. Max length: 128 chars. * @param {string} applicationId - Android application ID. Max length: 256 chars. - * @param {string[]} fingerprints - SHA-256 fingerprints of the certificates your app is signed with, such as "14:6D:E9:...:2B:6A". Passkeys created in the app are accepted when its signature matches one. Find them under App signing in Play Console, or with `./gradlew signingReport`. Omit to keep the current list, or pass an empty array to clear it. + * @param {string[] | null} fingerprints - SHA-256 fingerprints of the certificates your app is signed with, such as "14:6D:E9:...:2B:6A". Passkeys created in the app are accepted when its signature matches one. Find them under App signing in Play Console, or with `./gradlew signingReport`. Omit to keep the current list, or pass an empty array to clear it. * @throws {AppwriteException} * @returns {Promise<Models.PlatformAndroid>} * @deprecated Use the object parameter style method for a better developer experience. @@ -8342,7 +8607,7 @@ export class Project { platformId: string, name: string, applicationId: string, - fingerprints?: string[], + fingerprints?: string[] | null, ): Promise<Models.PlatformAndroid>; updateAndroidPlatform( paramsOrFirst: @@ -8350,16 +8615,16 @@ export class Project { platformId: string; name: string; applicationId: string; - fingerprints?: string[]; + fingerprints?: string[] | null; } | string, - ...rest: [string?, string?, string[]?] + ...rest: [string?, string?, (string[] | null)?] ): Promise<Models.PlatformAndroid> { let params: { platformId: string; name: string; applicationId: string; - fingerprints?: string[]; + fingerprints?: string[] | null; }; if ( @@ -8371,14 +8636,14 @@ export class Project { platformId: string; name: string; applicationId: string; - fingerprints?: string[]; + fingerprints?: string[] | null; }; } else { params = { platformId: paramsOrFirst as string, name: rest[0] as string, applicationId: rest[1] as string, - fingerprints: rest[2] as string[], + fingerprints: rest[2] as string[] | null, }; } @@ -9641,7 +9906,7 @@ export class Project { pingedAt: '', labels: [], status: 'active', - onboarding: [], + onboarding: {}, authMethods: [], services: [], protocols: [], @@ -9774,7 +10039,7 @@ export class Project { pingedAt: '', labels: [], status: 'active', - onboarding: [], + onboarding: {}, authMethods: [], services: [], protocols: [], @@ -9907,7 +10172,7 @@ export class Project { pingedAt: '', labels: [], status: 'active', - onboarding: [], + onboarding: {}, authMethods: [], services: [], protocols: [], @@ -10040,7 +10305,7 @@ export class Project { pingedAt: '', labels: [], status: 'active', - onboarding: [], + onboarding: {}, authMethods: [], services: [], protocols: [], @@ -10240,7 +10505,7 @@ export class Project { pingedAt: '', labels: [], status: 'active', - onboarding: [], + onboarding: {}, authMethods: [], services: [], protocols: [], @@ -10416,7 +10681,7 @@ export class Project { pingedAt: '', labels: [], status: 'active', - onboarding: [], + onboarding: {}, authMethods: [], services: [], protocols: [], @@ -10545,7 +10810,7 @@ export class Project { pingedAt: '', labels: [], status: 'active', - onboarding: [], + onboarding: {}, authMethods: [], services: [], protocols: [], @@ -10599,40 +10864,57 @@ export class Project { /** * Updating this policy allows you to control if new passwords are checked against most common passwords dictionary. When enabled, and user changes their password, password must not be contained in the dictionary. * + * Custom denyList entries use case-sensitive equality and apply only while this policy is enabled. Omit denyList or pass null to preserve it, pass an array to replace it, or pass [] to clear it. Entries are stored without trimming or deduplication. Existing passwords remain valid for sign-in and password confirmation. The combined serialized project authentication configuration must fit within 16,384 characters, even when each list meets its entry limits. + * * @param {boolean} params.enabled - Toggle password dictionary policy. Set to true if you want password change to block passwords in the dictionary, or false to allow them. When changing this policy, existing passwords remain valid. + * @param {string[] | null} params.denyList - Custom blocked values using case-sensitive equality. Up to 100 entries of 1 to 256 characters. Omit or pass null to preserve, an array to replace, or [] to clear. Combined authentication settings must fit within 16,384 characters. * @throws {AppwriteException} * @returns {Promise<Models.Project>} */ updatePasswordDictionaryPolicy(params: { enabled: boolean; + denyList?: string[] | null; }): Promise<Models.Project>; /** * Updating this policy allows you to control if new passwords are checked against most common passwords dictionary. When enabled, and user changes their password, password must not be contained in the dictionary. * + * Custom denyList entries use case-sensitive equality and apply only while this policy is enabled. Omit denyList or pass null to preserve it, pass an array to replace it, or pass [] to clear it. Entries are stored without trimming or deduplication. Existing passwords remain valid for sign-in and password confirmation. The combined serialized project authentication configuration must fit within 16,384 characters, even when each list meets its entry limits. + * * @param {boolean} enabled - Toggle password dictionary policy. Set to true if you want password change to block passwords in the dictionary, or false to allow them. When changing this policy, existing passwords remain valid. + * @param {string[] | null} denyList - Custom blocked values using case-sensitive equality. Up to 100 entries of 1 to 256 characters. Omit or pass null to preserve, an array to replace, or [] to clear. Combined authentication settings must fit within 16,384 characters. * @throws {AppwriteException} * @returns {Promise<Models.Project>} * @deprecated Use the object parameter style method for a better developer experience. */ - updatePasswordDictionaryPolicy(enabled: boolean): Promise<Models.Project>; updatePasswordDictionaryPolicy( - paramsOrFirst: { enabled: boolean } | boolean, + enabled: boolean, + denyList?: string[] | null, + ): Promise<Models.Project>; + updatePasswordDictionaryPolicy( + paramsOrFirst: + { enabled: boolean; denyList?: string[] | null } | boolean, + ...rest: [(string[] | null)?] ): Promise<Models.Project> { - let params: { enabled: boolean }; + let params: { enabled: boolean; denyList?: string[] | null }; if ( paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) ) { - params = (paramsOrFirst || {}) as { enabled: boolean }; + params = (paramsOrFirst || {}) as { + enabled: boolean; + denyList?: string[] | null; + }; } else { params = { enabled: paramsOrFirst as boolean, + denyList: rest[0] as string[] | null, }; } const enabled = params.enabled; + const denyList = params.denyList; if (typeof enabled === 'undefined') { throw new AppwriteException( @@ -10644,6 +10926,9 @@ export class Project { if (typeof enabled !== 'undefined') { apiPayload['enabled'] = enabled; } + if (typeof denyList !== 'undefined') { + apiPayload['denyList'] = denyList; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -10678,7 +10963,7 @@ export class Project { pingedAt: '', labels: [], status: 'active', - onboarding: [], + onboarding: {}, authMethods: [], services: [], protocols: [], @@ -10734,38 +11019,38 @@ export class Project { * * Keep in mind, while password history policy is disabled, the history is not being stored. Enabling the policy will not have any history on existing users, and it will only start to collect and enforce the policy on password changes since the policy is enabled. * - * @param {number} params.total - Set the password history length per user. Value can be between 1 and 20, or null to disable the limit. + * @param {number | null} params.total - Set the password history length per user. Value can be between 1 and 20, or null to disable the limit. * @throws {AppwriteException} * @returns {Promise<Models.Project>} */ updatePasswordHistoryPolicy(params: { - total?: number; + total?: number | null; }): Promise<Models.Project>; /** * Updates one of password strength policies. Based on total length configured, previous password hashes are stored, and users cannot choose a new password that is already stored in the passwird history list, when updating an user password, or setting new one through password recovery. * * Keep in mind, while password history policy is disabled, the history is not being stored. Enabling the policy will not have any history on existing users, and it will only start to collect and enforce the policy on password changes since the policy is enabled. * - * @param {number} total - Set the password history length per user. Value can be between 1 and 20, or null to disable the limit. + * @param {number | null} total - Set the password history length per user. Value can be between 1 and 20, or null to disable the limit. * @throws {AppwriteException} * @returns {Promise<Models.Project>} * @deprecated Use the object parameter style method for a better developer experience. */ - updatePasswordHistoryPolicy(total?: number): Promise<Models.Project>; + updatePasswordHistoryPolicy(total?: number | null): Promise<Models.Project>; updatePasswordHistoryPolicy( - paramsOrFirst?: { total?: number } | number, + paramsOrFirst?: { total?: number | null } | number | null, ): Promise<Models.Project> { - let params: { total?: number }; + let params: { total?: number | null }; if ( paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) ) { - params = (paramsOrFirst || {}) as { total?: number }; + params = (paramsOrFirst || {}) as { total?: number | null }; } else { params = { - total: paramsOrFirst as number, + total: paramsOrFirst as number | null, }; } @@ -10813,7 +11098,7 @@ export class Project { pingedAt: '', labels: [], status: 'active', - onboarding: [], + onboarding: {}, authMethods: [], services: [], protocols: [], @@ -10867,40 +11152,59 @@ export class Project { /** * Updating this policy allows you to control if password strength is checked against personal data. When enabled, and user sets or changes their password, the password must not contain user ID, name, email or phone number. * + * Custom denyList entries use case-insensitive substring matching and apply only while this policy is enabled. Omit denyList or pass null to preserve it, pass an array to replace it, or pass [] to clear it. Entries are stored without trimming or deduplication. Existing passwords remain valid for sign-in and password confirmation. The combined serialized project authentication configuration must fit within 16,384 characters, even when each list meets its entry limits. + * Password recovery also checks the recovered user profile, closing the previous gap in profile-based personal-data validation. + * * @param {boolean} params.enabled - Toggle password personal data policy. Set to true if you want to block passwords including user's personal data, or false to allow it. When changing this policy, existing passwords remain valid. + * @param {string[] | null} params.denyList - Custom blocked values using case-insensitive substring matching. Up to 100 entries of 1 to 256 characters. Omit or pass null to preserve, an array to replace, or [] to clear. Combined authentication settings must fit within 16,384 characters. * @throws {AppwriteException} * @returns {Promise<Models.Project>} */ updatePasswordPersonalDataPolicy(params: { enabled: boolean; + denyList?: string[] | null; }): Promise<Models.Project>; /** * Updating this policy allows you to control if password strength is checked against personal data. When enabled, and user sets or changes their password, the password must not contain user ID, name, email or phone number. * + * Custom denyList entries use case-insensitive substring matching and apply only while this policy is enabled. Omit denyList or pass null to preserve it, pass an array to replace it, or pass [] to clear it. Entries are stored without trimming or deduplication. Existing passwords remain valid for sign-in and password confirmation. The combined serialized project authentication configuration must fit within 16,384 characters, even when each list meets its entry limits. + * Password recovery also checks the recovered user profile, closing the previous gap in profile-based personal-data validation. + * * @param {boolean} enabled - Toggle password personal data policy. Set to true if you want to block passwords including user's personal data, or false to allow it. When changing this policy, existing passwords remain valid. + * @param {string[] | null} denyList - Custom blocked values using case-insensitive substring matching. Up to 100 entries of 1 to 256 characters. Omit or pass null to preserve, an array to replace, or [] to clear. Combined authentication settings must fit within 16,384 characters. * @throws {AppwriteException} * @returns {Promise<Models.Project>} * @deprecated Use the object parameter style method for a better developer experience. */ - updatePasswordPersonalDataPolicy(enabled: boolean): Promise<Models.Project>; updatePasswordPersonalDataPolicy( - paramsOrFirst: { enabled: boolean } | boolean, + enabled: boolean, + denyList?: string[] | null, + ): Promise<Models.Project>; + updatePasswordPersonalDataPolicy( + paramsOrFirst: + { enabled: boolean; denyList?: string[] | null } | boolean, + ...rest: [(string[] | null)?] ): Promise<Models.Project> { - let params: { enabled: boolean }; + let params: { enabled: boolean; denyList?: string[] | null }; if ( paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) ) { - params = (paramsOrFirst || {}) as { enabled: boolean }; + params = (paramsOrFirst || {}) as { + enabled: boolean; + denyList?: string[] | null; + }; } else { params = { enabled: paramsOrFirst as boolean, + denyList: rest[0] as string[] | null, }; } const enabled = params.enabled; + const denyList = params.denyList; if (typeof enabled === 'undefined') { throw new AppwriteException( @@ -10912,6 +11216,9 @@ export class Project { if (typeof enabled !== 'undefined') { apiPayload['enabled'] = enabled; } + if (typeof denyList !== 'undefined') { + apiPayload['denyList'] = denyList; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -10946,7 +11253,7 @@ export class Project { pingedAt: '', labels: [], status: 'active', - onboarding: [], + onboarding: {}, authMethods: [], services: [], protocols: [], @@ -11102,7 +11409,7 @@ export class Project { pingedAt: '', labels: [], status: 'active', - onboarding: [], + onboarding: {}, authMethods: [], services: [], protocols: [], @@ -11246,7 +11553,7 @@ export class Project { pingedAt: '', labels: [], status: 'active', - onboarding: [], + onboarding: {}, authMethods: [], services: [], protocols: [], @@ -11510,7 +11817,7 @@ export class Project { pingedAt: '', labels: [], status: 'active', - onboarding: [], + onboarding: {}, authMethods: [], services: [], protocols: [], @@ -11643,7 +11950,7 @@ export class Project { pingedAt: '', labels: [], status: 'active', - onboarding: [], + onboarding: {}, authMethods: [], services: [], protocols: [], @@ -11776,7 +12083,7 @@ export class Project { pingedAt: '', labels: [], status: 'active', - onboarding: [], + onboarding: {}, authMethods: [], services: [], protocols: [], @@ -11907,7 +12214,7 @@ export class Project { pingedAt: '', labels: [], status: 'active', - onboarding: [], + onboarding: {}, authMethods: [], services: [], protocols: [], @@ -11961,34 +12268,36 @@ export class Project { /** * Update the maximum number of users in the project. When the limit is hit or amount of existing users already exceeded the limit, all users remain active, but new user sign up will be prohibited. * - * @param {number} params.total - Set the maximum number of users allowed in the project. Value can be between 0 and 10000. Use 0 or null to disable the limit. + * @param {number | null} params.total - Set the maximum number of users allowed in the project. Value can be between 0 and 10000. Use 0 or null to disable the limit. * @throws {AppwriteException} * @returns {Promise<Models.Project>} */ - updateUserLimitPolicy(params: { total?: number }): Promise<Models.Project>; + updateUserLimitPolicy(params: { + total?: number | null; + }): Promise<Models.Project>; /** * Update the maximum number of users in the project. When the limit is hit or amount of existing users already exceeded the limit, all users remain active, but new user sign up will be prohibited. * - * @param {number} total - Set the maximum number of users allowed in the project. Value can be between 0 and 10000. Use 0 or null to disable the limit. + * @param {number | null} total - Set the maximum number of users allowed in the project. Value can be between 0 and 10000. Use 0 or null to disable the limit. * @throws {AppwriteException} * @returns {Promise<Models.Project>} * @deprecated Use the object parameter style method for a better developer experience. */ - updateUserLimitPolicy(total?: number): Promise<Models.Project>; + updateUserLimitPolicy(total?: number | null): Promise<Models.Project>; updateUserLimitPolicy( - paramsOrFirst?: { total?: number } | number, + paramsOrFirst?: { total?: number | null } | number | null, ): Promise<Models.Project> { - let params: { total?: number }; + let params: { total?: number | null }; if ( paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) ) { - params = (paramsOrFirst || {}) as { total?: number }; + params = (paramsOrFirst || {}) as { total?: number | null }; } else { params = { - total: paramsOrFirst as number, + total: paramsOrFirst as number | null, }; } @@ -12036,7 +12345,7 @@ export class Project { pingedAt: '', labels: [], status: 'active', - onboarding: [], + onboarding: {}, authMethods: [], services: [], protocols: [], @@ -12310,7 +12619,7 @@ export class Project { pingedAt: '', labels: [], status: 'active', - onboarding: [], + onboarding: {}, authMethods: [], services: [], protocols: [], @@ -12466,7 +12775,7 @@ export class Project { pingedAt: '', labels: [], status: 'active', - onboarding: [], + onboarding: {}, authMethods: [], services: [], protocols: [], @@ -12520,98 +12829,99 @@ export class Project { /** * Update the SMTP configuration for your project. Use this endpoint to configure your project's SMTP provider with your custom settings for sending transactional emails. * - * @param {string} params.host - SMTP server hostname (domain) - * @param {number} params.port - SMTP server port - * @param {string} params.username - SMTP server username. Pass an empty string to clear a previously set value. - * @param {string} params.password - SMTP server password. Pass an empty string to clear a previously set value. This property is stored securely and cannot be read in future (write-only). - * @param {string} params.senderEmail - Email address shown in inbox as the sender of the email. Pass an empty string to clear a previously set value. - * @param {string} params.senderName - Name shown in inbox as the sender of the email. Pass an empty string to clear a previously set value. - * @param {string} params.replyToEmail - Email used when user replies to the email. Pass an empty string to clear a previously set value. - * @param {string} params.replyToName - Name used when user replies to the email. Pass an empty string to clear a previously set value. - * @param {ProjectSMTPSecure} params.secure - Configures if communication with SMTP server is encrypted. Allowed values are: tls, ssl. Leave empty for no encryption. - * @param {boolean} params.enabled - Enable or disable custom SMTP. Custom SMTP is useful for branding purposes, but also allows use of custom email templates. + * @param {string | null} params.host - SMTP server hostname (domain) + * @param {number | null} params.port - SMTP server port + * @param {string | null} params.username - SMTP server username. Pass an empty string to clear a previously set value. + * @param {string | null} params.password - SMTP server password. Pass an empty string to clear a previously set value. This property is stored securely and cannot be read in future (write-only). + * @param {string | null} params.senderEmail - Email address shown in inbox as the sender of the email. Pass an empty string to clear a previously set value. + * @param {string | null} params.senderName - Name shown in inbox as the sender of the email. Pass an empty string to clear a previously set value. + * @param {string | null} params.replyToEmail - Email used when user replies to the email. Pass an empty string to clear a previously set value. + * @param {string | null} params.replyToName - Name used when user replies to the email. Pass an empty string to clear a previously set value. + * @param {ProjectSMTPSecure | null} params.secure - Configures if communication with SMTP server is encrypted. Allowed values are: tls, ssl. Leave empty for no encryption. + * @param {boolean | null} params.enabled - Enable or disable custom SMTP. Custom SMTP is useful for branding purposes, but also allows use of custom email templates. * @throws {AppwriteException} * @returns {Promise<Models.Project>} */ updateSMTP(params?: { - host?: string; - port?: number; - username?: string; - password?: string; - senderEmail?: string; - senderName?: string; - replyToEmail?: string; - replyToName?: string; - secure?: ProjectSMTPSecure; - enabled?: boolean; + host?: string | null; + port?: number | null; + username?: string | null; + password?: string | null; + senderEmail?: string | null; + senderName?: string | null; + replyToEmail?: string | null; + replyToName?: string | null; + secure?: ProjectSMTPSecure | null; + enabled?: boolean | null; }): Promise<Models.Project>; /** * Update the SMTP configuration for your project. Use this endpoint to configure your project's SMTP provider with your custom settings for sending transactional emails. * - * @param {string} host - SMTP server hostname (domain) - * @param {number} port - SMTP server port - * @param {string} username - SMTP server username. Pass an empty string to clear a previously set value. - * @param {string} password - SMTP server password. Pass an empty string to clear a previously set value. This property is stored securely and cannot be read in future (write-only). - * @param {string} senderEmail - Email address shown in inbox as the sender of the email. Pass an empty string to clear a previously set value. - * @param {string} senderName - Name shown in inbox as the sender of the email. Pass an empty string to clear a previously set value. - * @param {string} replyToEmail - Email used when user replies to the email. Pass an empty string to clear a previously set value. - * @param {string} replyToName - Name used when user replies to the email. Pass an empty string to clear a previously set value. - * @param {ProjectSMTPSecure} secure - Configures if communication with SMTP server is encrypted. Allowed values are: tls, ssl. Leave empty for no encryption. - * @param {boolean} enabled - Enable or disable custom SMTP. Custom SMTP is useful for branding purposes, but also allows use of custom email templates. + * @param {string | null} host - SMTP server hostname (domain) + * @param {number | null} port - SMTP server port + * @param {string | null} username - SMTP server username. Pass an empty string to clear a previously set value. + * @param {string | null} password - SMTP server password. Pass an empty string to clear a previously set value. This property is stored securely and cannot be read in future (write-only). + * @param {string | null} senderEmail - Email address shown in inbox as the sender of the email. Pass an empty string to clear a previously set value. + * @param {string | null} senderName - Name shown in inbox as the sender of the email. Pass an empty string to clear a previously set value. + * @param {string | null} replyToEmail - Email used when user replies to the email. Pass an empty string to clear a previously set value. + * @param {string | null} replyToName - Name used when user replies to the email. Pass an empty string to clear a previously set value. + * @param {ProjectSMTPSecure | null} secure - Configures if communication with SMTP server is encrypted. Allowed values are: tls, ssl. Leave empty for no encryption. + * @param {boolean | null} enabled - Enable or disable custom SMTP. Custom SMTP is useful for branding purposes, but also allows use of custom email templates. * @throws {AppwriteException} * @returns {Promise<Models.Project>} * @deprecated Use the object parameter style method for a better developer experience. */ updateSMTP( - host?: string, - port?: number, - username?: string, - password?: string, - senderEmail?: string, - senderName?: string, - replyToEmail?: string, - replyToName?: string, - secure?: ProjectSMTPSecure, - enabled?: boolean, + host?: string | null, + port?: number | null, + username?: string | null, + password?: string | null, + senderEmail?: string | null, + senderName?: string | null, + replyToEmail?: string | null, + replyToName?: string | null, + secure?: ProjectSMTPSecure | null, + enabled?: boolean | null, ): Promise<Models.Project>; updateSMTP( paramsOrFirst?: | { - host?: string; - port?: number; - username?: string; - password?: string; - senderEmail?: string; - senderName?: string; - replyToEmail?: string; - replyToName?: string; - secure?: ProjectSMTPSecure; - enabled?: boolean; + host?: string | null; + port?: number | null; + username?: string | null; + password?: string | null; + senderEmail?: string | null; + senderName?: string | null; + replyToEmail?: string | null; + replyToName?: string | null; + secure?: ProjectSMTPSecure | null; + enabled?: boolean | null; } - | string, + | string + | null, ...rest: [ - number?, - string?, - string?, - string?, - string?, - string?, - string?, - ProjectSMTPSecure?, - boolean?, + (number | null)?, + (string | null)?, + (string | null)?, + (string | null)?, + (string | null)?, + (string | null)?, + (string | null)?, + (ProjectSMTPSecure | null)?, + (boolean | null)?, ] ): Promise<Models.Project> { let params: { - host?: string; - port?: number; - username?: string; - password?: string; - senderEmail?: string; - senderName?: string; - replyToEmail?: string; - replyToName?: string; - secure?: ProjectSMTPSecure; - enabled?: boolean; + host?: string | null; + port?: number | null; + username?: string | null; + password?: string | null; + senderEmail?: string | null; + senderName?: string | null; + replyToEmail?: string | null; + replyToName?: string | null; + secure?: ProjectSMTPSecure | null; + enabled?: boolean | null; }; if ( @@ -12621,29 +12931,29 @@ export class Project { !Array.isArray(paramsOrFirst)) ) { params = (paramsOrFirst || {}) as { - host?: string; - port?: number; - username?: string; - password?: string; - senderEmail?: string; - senderName?: string; - replyToEmail?: string; - replyToName?: string; - secure?: ProjectSMTPSecure; - enabled?: boolean; + host?: string | null; + port?: number | null; + username?: string | null; + password?: string | null; + senderEmail?: string | null; + senderName?: string | null; + replyToEmail?: string | null; + replyToName?: string | null; + secure?: ProjectSMTPSecure | null; + enabled?: boolean | null; }; } else { params = { - host: paramsOrFirst as string, - port: rest[0] as number, - username: rest[1] as string, - password: rest[2] as string, - senderEmail: rest[3] as string, - senderName: rest[4] as string, - replyToEmail: rest[5] as string, - replyToName: rest[6] as string, - secure: rest[7] as ProjectSMTPSecure, - enabled: rest[8] as boolean, + host: paramsOrFirst as string | null, + port: rest[0] as number | null, + username: rest[1] as string | null, + password: rest[2] as string | null, + senderEmail: rest[3] as string | null, + senderName: rest[4] as string | null, + replyToEmail: rest[5] as string | null, + replyToName: rest[6] as string | null, + secure: rest[7] as ProjectSMTPSecure | null, + enabled: rest[8] as boolean | null, }; } @@ -12724,7 +13034,7 @@ export class Project { pingedAt: '', labels: [], status: 'active', - onboarding: [], + onboarding: {}, authMethods: [], services: [], protocols: [], @@ -12934,36 +13244,36 @@ export class Project { * * @param {ProjectEmailTemplateId} params.templateId - Custom email template type. Can be one of: verification, magicSession, recovery, invitation, mfaChallenge, sessionAlert, otpSession, otpVerification, otpRecovery * @param {ProjectEmailTemplateLocale} params.locale - Custom email template locale. If left empty, the fallback locale (en) will be used. - * @param {string} params.subject - Subject of the email template. Can be up to 255 characters. - * @param {string} params.message - Plain or HTML body of the email template message. Can be up to 10MB of content. - * @param {string} params.senderName - Name of the email sender. - * @param {string} params.senderEmail - Email of the sender. Pass an empty string to clear a previously set value. - * @param {string} params.replyToEmail - Reply to email. Pass an empty string to clear a previously set value. - * @param {string} params.replyToName - Reply to name. + * @param {string | null} params.subject - Subject of the email template. Can be up to 255 characters. + * @param {string | null} params.message - Plain or HTML body of the email template message. Can be up to 10MB of content. + * @param {string | null} params.senderName - Name of the email sender. + * @param {string | null} params.senderEmail - Email of the sender. Pass an empty string to clear a previously set value. + * @param {string | null} params.replyToEmail - Reply to email. Pass an empty string to clear a previously set value. + * @param {string | null} params.replyToName - Reply to name. * @throws {AppwriteException} * @returns {Promise<Models.EmailTemplate>} */ updateEmailTemplate(params: { templateId: ProjectEmailTemplateId; locale?: ProjectEmailTemplateLocale; - subject?: string; - message?: string; - senderName?: string; - senderEmail?: string; - replyToEmail?: string; - replyToName?: string; + subject?: string | null; + message?: string | null; + senderName?: string | null; + senderEmail?: string | null; + replyToEmail?: string | null; + replyToName?: string | null; }): Promise<Models.EmailTemplate>; /** * Update a custom email template for the specified locale and type. Use this endpoint to modify the content of your email templates. * * @param {ProjectEmailTemplateId} templateId - Custom email template type. Can be one of: verification, magicSession, recovery, invitation, mfaChallenge, sessionAlert, otpSession, otpVerification, otpRecovery * @param {ProjectEmailTemplateLocale} locale - Custom email template locale. If left empty, the fallback locale (en) will be used. - * @param {string} subject - Subject of the email template. Can be up to 255 characters. - * @param {string} message - Plain or HTML body of the email template message. Can be up to 10MB of content. - * @param {string} senderName - Name of the email sender. - * @param {string} senderEmail - Email of the sender. Pass an empty string to clear a previously set value. - * @param {string} replyToEmail - Reply to email. Pass an empty string to clear a previously set value. - * @param {string} replyToName - Reply to name. + * @param {string | null} subject - Subject of the email template. Can be up to 255 characters. + * @param {string | null} message - Plain or HTML body of the email template message. Can be up to 10MB of content. + * @param {string | null} senderName - Name of the email sender. + * @param {string | null} senderEmail - Email of the sender. Pass an empty string to clear a previously set value. + * @param {string | null} replyToEmail - Reply to email. Pass an empty string to clear a previously set value. + * @param {string | null} replyToName - Reply to name. * @throws {AppwriteException} * @returns {Promise<Models.EmailTemplate>} * @deprecated Use the object parameter style method for a better developer experience. @@ -12971,45 +13281,45 @@ export class Project { updateEmailTemplate( templateId: ProjectEmailTemplateId, locale?: ProjectEmailTemplateLocale, - subject?: string, - message?: string, - senderName?: string, - senderEmail?: string, - replyToEmail?: string, - replyToName?: string, + subject?: string | null, + message?: string | null, + senderName?: string | null, + senderEmail?: string | null, + replyToEmail?: string | null, + replyToName?: string | null, ): Promise<Models.EmailTemplate>; updateEmailTemplate( paramsOrFirst: | { templateId: ProjectEmailTemplateId; locale?: ProjectEmailTemplateLocale; - subject?: string; - message?: string; - senderName?: string; - senderEmail?: string; - replyToEmail?: string; - replyToName?: string; + subject?: string | null; + message?: string | null; + senderName?: string | null; + senderEmail?: string | null; + replyToEmail?: string | null; + replyToName?: string | null; } | ProjectEmailTemplateId, ...rest: [ ProjectEmailTemplateLocale?, - string?, - string?, - string?, - string?, - string?, - string?, + (string | null)?, + (string | null)?, + (string | null)?, + (string | null)?, + (string | null)?, + (string | null)?, ] ): Promise<Models.EmailTemplate> { let params: { templateId: ProjectEmailTemplateId; locale?: ProjectEmailTemplateLocale; - subject?: string; - message?: string; - senderName?: string; - senderEmail?: string; - replyToEmail?: string; - replyToName?: string; + subject?: string | null; + message?: string | null; + senderName?: string | null; + senderEmail?: string | null; + replyToEmail?: string | null; + replyToName?: string | null; }; if ( @@ -13028,23 +13338,23 @@ export class Project { params = (paramsOrFirst || {}) as { templateId: ProjectEmailTemplateId; locale?: ProjectEmailTemplateLocale; - subject?: string; - message?: string; - senderName?: string; - senderEmail?: string; - replyToEmail?: string; - replyToName?: string; + subject?: string | null; + message?: string | null; + senderName?: string | null; + senderEmail?: string | null; + replyToEmail?: string | null; + replyToName?: string | null; }; } else { params = { templateId: paramsOrFirst as ProjectEmailTemplateId, locale: rest[0] as ProjectEmailTemplateLocale, - subject: rest[1] as string, - message: rest[2] as string, - senderName: rest[3] as string, - senderEmail: rest[4] as string, - replyToEmail: rest[5] as string, - replyToName: rest[6] as string, + subject: rest[1] as string | null, + message: rest[2] as string | null, + senderName: rest[3] as string | null, + senderEmail: rest[4] as string | null, + replyToEmail: rest[5] as string | null, + replyToName: rest[6] as string | null, }; } @@ -13306,6 +13616,7 @@ export class Project { $createdAt: '', $updatedAt: '', key: '', + description: '', value: '', secret: false, resourceType: '', @@ -13325,6 +13636,7 @@ export class Project { * @param {string} params.key - Variable key. Letters, digits and underscores only, must not start with a digit. Max length: 255 chars. * @param {string} params.value - Variable value. Max length: 8192 chars. * @param {boolean} params.secret - Secret variables can be updated or deleted, but only projects can read them during build and runtime. + * @param {string} params.description - Optional description for the variable. * @throws {AppwriteException} * @returns {Promise<Models.Variable>} */ @@ -13333,6 +13645,7 @@ export class Project { key: string; value: string; secret?: boolean; + description?: string; }): Promise<Models.Variable>; /** * Create a new project environment variable. These variables can be accessed by all functions and sites in the project. @@ -13341,6 +13654,7 @@ export class Project { * @param {string} key - Variable key. Letters, digits and underscores only, must not start with a digit. Max length: 255 chars. * @param {string} value - Variable value. Max length: 8192 chars. * @param {boolean} secret - Secret variables can be updated or deleted, but only projects can read them during build and runtime. + * @param {string} description - Optional description for the variable. * @throws {AppwriteException} * @returns {Promise<Models.Variable>} * @deprecated Use the object parameter style method for a better developer experience. @@ -13350,6 +13664,7 @@ export class Project { key: string, value: string, secret?: boolean, + description?: string, ): Promise<Models.Variable>; createVariable( paramsOrFirst: @@ -13358,15 +13673,17 @@ export class Project { key: string; value: string; secret?: boolean; + description?: string; } | string, - ...rest: [string?, string?, boolean?] + ...rest: [string?, string?, boolean?, string?] ): Promise<Models.Variable> { let params: { variableId: string; key: string; value: string; secret?: boolean; + description?: string; }; if ( @@ -13379,6 +13696,7 @@ export class Project { key: string; value: string; secret?: boolean; + description?: string; }; } else { params = { @@ -13386,6 +13704,7 @@ export class Project { key: rest[0] as string, value: rest[1] as string, secret: rest[2] as boolean, + description: rest[3] as string, }; } @@ -13393,6 +13712,7 @@ export class Project { const key = params.key; const value = params.value; const secret = params.secret; + const description = params.description; if (typeof variableId === 'undefined') { throw new AppwriteException( @@ -13419,6 +13739,9 @@ export class Project { if (typeof secret !== 'undefined') { apiPayload['secret'] = secret; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -13437,6 +13760,7 @@ export class Project { $createdAt: '', $updatedAt: '', key: '', + description: '', value: '', secret: false, resourceType: '', @@ -13512,6 +13836,7 @@ export class Project { $createdAt: '', $updatedAt: '', key: '', + description: '', value: '', secret: false, resourceType: '', @@ -13528,51 +13853,62 @@ export class Project { * Update variable by its unique ID. * * @param {string} params.variableId - Variable unique ID. - * @param {string} params.key - Variable key. Letters, digits and underscores only, must not start with a digit. Max length: 255 chars. - * @param {string} params.value - Variable value. Max length: 8192 chars. - * @param {boolean} params.secret - Secret variables can be updated or deleted, but only projects can read them during build and runtime. + * @param {string | null} params.key - Variable key. Letters, digits and underscores only, must not start with a digit. Max length: 255 chars. + * @param {string | null} params.value - Variable value. Max length: 8192 chars. + * @param {boolean | null} params.secret - Secret variables can be updated or deleted, but only projects can read them during build and runtime. + * @param {string | null} params.description - Optional description for the variable. * @throws {AppwriteException} * @returns {Promise<Models.Variable>} */ updateVariable(params: { variableId: string; - key?: string; - value?: string; - secret?: boolean; + key?: string | null; + value?: string | null; + secret?: boolean | null; + description?: string | null; }): Promise<Models.Variable>; /** * Update variable by its unique ID. * * @param {string} variableId - Variable unique ID. - * @param {string} key - Variable key. Letters, digits and underscores only, must not start with a digit. Max length: 255 chars. - * @param {string} value - Variable value. Max length: 8192 chars. - * @param {boolean} secret - Secret variables can be updated or deleted, but only projects can read them during build and runtime. + * @param {string | null} key - Variable key. Letters, digits and underscores only, must not start with a digit. Max length: 255 chars. + * @param {string | null} value - Variable value. Max length: 8192 chars. + * @param {boolean | null} secret - Secret variables can be updated or deleted, but only projects can read them during build and runtime. + * @param {string | null} description - Optional description for the variable. * @throws {AppwriteException} * @returns {Promise<Models.Variable>} * @deprecated Use the object parameter style method for a better developer experience. */ updateVariable( variableId: string, - key?: string, - value?: string, - secret?: boolean, + key?: string | null, + value?: string | null, + secret?: boolean | null, + description?: string | null, ): Promise<Models.Variable>; updateVariable( paramsOrFirst: | { variableId: string; - key?: string; - value?: string; - secret?: boolean; + key?: string | null; + value?: string | null; + secret?: boolean | null; + description?: string | null; } | string, - ...rest: [string?, string?, boolean?] + ...rest: [ + (string | null)?, + (string | null)?, + (boolean | null)?, + (string | null)?, + ] ): Promise<Models.Variable> { let params: { variableId: string; - key?: string; - value?: string; - secret?: boolean; + key?: string | null; + value?: string | null; + secret?: boolean | null; + description?: string | null; }; if ( @@ -13582,16 +13918,18 @@ export class Project { ) { params = (paramsOrFirst || {}) as { variableId: string; - key?: string; - value?: string; - secret?: boolean; + key?: string | null; + value?: string | null; + secret?: boolean | null; + description?: string | null; }; } else { params = { variableId: paramsOrFirst as string, - key: rest[0] as string, - value: rest[1] as string, - secret: rest[2] as boolean, + key: rest[0] as string | null, + value: rest[1] as string | null, + secret: rest[2] as boolean | null, + description: rest[3] as string | null, }; } @@ -13599,6 +13937,7 @@ export class Project { const key = params.key; const value = params.value; const secret = params.secret; + const description = params.description; if (typeof variableId === 'undefined' || variableId === '') { throw new AppwriteException( @@ -13619,6 +13958,9 @@ export class Project { if (typeof secret !== 'undefined') { apiPayload['secret'] = secret; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -13637,6 +13979,7 @@ export class Project { $createdAt: '', $updatedAt: '', key: '', + description: '', value: '', secret: false, resourceType: '', diff --git a/src/services/projects.ts b/src/services/projects.ts index 712c7eaf..19aa1d62 100644 --- a/src/services/projects.ts +++ b/src/services/projects.ts @@ -701,7 +701,7 @@ export class Projects { resourceUpdatedAt: '', projectId: '', schedule: '', - data: [], + data: {}, active: false, region: '', }, @@ -882,7 +882,7 @@ export class Projects { resourceUpdatedAt: '', projectId: '', schedule: '', - data: [], + data: {}, active: false, region: '', }, @@ -978,7 +978,7 @@ export class Projects { resourceUpdatedAt: '', projectId: '', schedule: '', - data: [], + data: {}, active: false, region: '', }, @@ -1347,7 +1347,7 @@ export class Projects { pingedAt: '', labels: [], status: 'active', - onboarding: [], + onboarding: {}, authMethods: [], services: [], protocols: [], diff --git a/src/services/proxy.ts b/src/services/proxy.ts index 1c63d094..d2bd78a4 100644 --- a/src/services/proxy.ts +++ b/src/services/proxy.ts @@ -133,7 +133,7 @@ export class Proxy { /** * Get a list of all the proxy rules. You can use the query params to filter your results. * - * @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/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: domain, type, trigger, deploymentResourceType, deploymentResourceId, deploymentId, deploymentVcsProviderBranch + * @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/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: domain, type, trigger, deploymentResourceType, deploymentResourceId, deploymentId, deploymentVcsProviderBranch, protocol * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise<Models.ProxyRuleList>} @@ -145,7 +145,7 @@ export class Proxy { /** * Get a list of all the proxy rules. You can use the query params to filter your results. * - * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: domain, type, trigger, deploymentResourceType, deploymentResourceId, deploymentId, deploymentVcsProviderBranch + * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: domain, type, trigger, deploymentResourceType, deploymentResourceId, deploymentId, deploymentVcsProviderBranch, protocol * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise<Models.ProxyRuleList>} @@ -226,6 +226,7 @@ export class Proxy { deploymentVcsProviderBranch: '', status: 'unverified', logs: '', + protocol: 'http', }, }, }, @@ -309,6 +310,7 @@ export class Proxy { deploymentVcsProviderBranch: '', status: 'unverified', logs: '', + protocol: 'http', }, }, }, @@ -425,6 +427,7 @@ export class Proxy { deploymentVcsProviderBranch: '', status: 'unverified', logs: '', + protocol: 'http', }, }, }, @@ -587,6 +590,7 @@ export class Proxy { deploymentVcsProviderBranch: '', status: 'unverified', logs: '', + protocol: 'http', }, }, }, @@ -701,6 +705,120 @@ export class Proxy { deploymentVcsProviderBranch: '', status: 'unverified', logs: '', + protocol: 'http', + }, + }, + }, + }; + + return request.then((response) => applyDefaults(response, defaults)); + } + + /** + * Create an SMTP ingress rule that asynchronously executes an Appwrite Function for incoming email. + * + * @param {string} params.domain - Domain that receives email. + * @param {string} params.functionId - ID of function to execute. + * @param {string} params.branch - Name of VCS branch to deploy changes automatically. + * @throws {AppwriteException} + * @returns {Promise<Models.ProxyRule>} + */ + createSMTPRule(params: { + domain: string; + functionId: string; + branch?: string; + }): Promise<Models.ProxyRule>; + /** + * Create an SMTP ingress rule that asynchronously executes an Appwrite Function for incoming email. + * + * @param {string} domain - Domain that receives email. + * @param {string} functionId - ID of function to execute. + * @param {string} branch - Name of VCS branch to deploy changes automatically. + * @throws {AppwriteException} + * @returns {Promise<Models.ProxyRule>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createSMTPRule( + domain: string, + functionId: string, + branch?: string, + ): Promise<Models.ProxyRule>; + createSMTPRule( + paramsOrFirst: + { domain: string; functionId: string; branch?: string } | string, + ...rest: [string?, string?] + ): Promise<Models.ProxyRule> { + let params: { domain: string; functionId: string; branch?: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + domain: string; + functionId: string; + branch?: string; + }; + } else { + params = { + domain: paramsOrFirst as string, + functionId: rest[0] as string, + branch: rest[1] as string, + }; + } + + const domain = params.domain; + const functionId = params.functionId; + const branch = params.branch; + + if (typeof domain === 'undefined') { + throw new AppwriteException('Missing required parameter: "domain"'); + } + if (typeof functionId === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "functionId"', + ); + } + const apiPath = '/proxy/rules/smtp'; + const apiPayload: Payload = {}; + if (typeof domain !== 'undefined') { + apiPayload['domain'] = domain; + } + if (typeof functionId !== 'undefined') { + apiPayload['functionId'] = functionId; + } + if (typeof branch !== 'undefined') { + apiPayload['branch'] = branch; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }; + + const request = this.client.call('post', uri, apiHeaders, apiPayload); + const defaults = { + root: 'proxyRule', + models: { + proxyRule: { + defaults: { + $id: '', + $createdAt: '', + $updatedAt: '', + domain: '', + type: '', + trigger: '', + redirectUrl: '', + redirectStatusCode: 301, + deploymentId: '', + deploymentResourceId: '', + deploymentVcsProviderBranch: '', + status: 'unverified', + logs: '', + protocol: 'http', }, }, }, @@ -779,6 +897,7 @@ export class Proxy { deploymentVcsProviderBranch: '', status: 'unverified', logs: '', + protocol: 'http', }, }, }, @@ -911,6 +1030,7 @@ export class Proxy { deploymentVcsProviderBranch: '', status: 'unverified', logs: '', + protocol: 'http', }, }, }, diff --git a/src/services/push.ts b/src/services/push.ts index 93d5d3ac..c93628aa 100644 --- a/src/services/push.ts +++ b/src/services/push.ts @@ -6,7 +6,7 @@ import type { } from 'mqtt'; import { Client } from '../client'; -import type { ResolvedTopic, Topic } from '../topic'; +import type { Topic } from '../topic'; /** A message delivered on a subscribed topic (the MQTT analog of a Realtime event). */ export interface PushMessage { @@ -253,7 +253,7 @@ export class Push { * Subscribe to one or more topics. Resolves to a {@link PushSubscription} handle. * * Each topic is a string or a `Topic` builder, e.g. - * `Topic.path(['user', userId]).all()`. + * `Topic.path(['user', userId])`. * * Called with only a callback, `subscribe((message) => {...}, options)` subscribes to the * signed-in user's own topic, `users/<userId>`, like FCM/APNs delivery to a device. The @@ -275,18 +275,12 @@ export class Push { options?: SubscribeOptions, ): Promise<PushSubscription>; subscribe( - topics: - string | Topic | ResolvedTopic | (string | Topic | ResolvedTopic)[], + topics: string | Topic | (string | Topic)[], callback: MessageCallback, options?: SubscribeOptions, ): Promise<PushSubscription>; async subscribe( - topicsOrCallback: - | string - | Topic - | ResolvedTopic - | (string | Topic | ResolvedTopic)[] - | MessageCallback, + topicsOrCallback: string | Topic | (string | Topic)[] | MessageCallback, callbackOrOptions?: MessageCallback | SubscribeOptions, topicOptions: SubscribeOptions = {}, ): Promise<PushSubscription> { @@ -303,12 +297,7 @@ export class Push { } private async subscribeWith( - topicsOrCallback: - | string - | Topic - | ResolvedTopic - | (string | Topic | ResolvedTopic)[] - | MessageCallback, + topicsOrCallback: string | Topic | (string | Topic)[] | MessageCallback, callbackOrOptions: MessageCallback | SubscribeOptions | undefined, topicOptions: SubscribeOptions, ): Promise<PushSubscription> { diff --git a/src/services/realtime.ts b/src/services/realtime.ts index 91aff434..59dc761a 100644 --- a/src/services/realtime.ts +++ b/src/services/realtime.ts @@ -1,10 +1,11 @@ import { AppwriteException, Client, JSONbig } from '../client'; import { Channel, ActionableChannel, ResolvedChannel } from '../channel'; -import { Query } from '../query'; +import { normalizeQueries, type QueryInput } from '../query'; import { ID } from '../id'; + export type RealtimeSubscriptionUpdate = { channels?: (string | Channel<any> | ActionableChannel | ResolvedChannel)[]; - queries?: (string | Query)[]; + queries?: QueryInput; }; export type RealtimeSubscription = { @@ -214,6 +215,7 @@ export class Realtime { if (jwt) { queryParams += `&jwt=${encodeURIComponent(jwt)}`; } + const endpoint = this.client.config.endpointRealtime !== '' ? this.client.config.endpointRealtime @@ -245,6 +247,7 @@ export class Realtime { try { const connectionId = ++this.connectionId; const socket = (this.socket = new WebSocket(url)); + socket.addEventListener('open', () => { if (connectionId !== this.connectionId) { return; @@ -500,7 +503,7 @@ export class Realtime { public async subscribe( channel: string | Channel<any> | ActionableChannel | ResolvedChannel, callback: (event: RealtimeResponseEvent<any>) => void, - queries?: (string | Query)[], + queries?: QueryInput, ): Promise<RealtimeSubscription>; /** @@ -515,7 +518,7 @@ export class Realtime { string | Channel<any> | ActionableChannel | ResolvedChannel )[], callback: (event: RealtimeResponseEvent<any>) => void, - queries?: (string | Query)[], + queries?: QueryInput, ): Promise<RealtimeSubscription>; /** @@ -528,7 +531,7 @@ export class Realtime { public async subscribe<T>( channel: string | Channel<any> | ActionableChannel | ResolvedChannel, callback: (event: RealtimeResponseEvent<T>) => void, - queries?: (string | Query)[], + queries?: QueryInput, ): Promise<RealtimeSubscription>; /** @@ -543,7 +546,7 @@ export class Realtime { string | Channel<any> | ActionableChannel | ResolvedChannel )[], callback: (event: RealtimeResponseEvent<T>) => void, - queries?: (string | Query)[], + queries?: QueryInput, ): Promise<RealtimeSubscription>; public async subscribe<T = any>( @@ -554,7 +557,7 @@ export class Realtime { | ResolvedChannel | (string | Channel<any> | ActionableChannel | ResolvedChannel)[], callback: (event: RealtimeResponseEvent<T>) => void, - queries: (string | Query)[] = [], + queries: QueryInput = [], ): Promise<RealtimeSubscription> { const channelArray = Array.isArray(channelsOrChannel) ? channelsOrChannel @@ -566,21 +569,7 @@ export class Realtime { ); const channels = new Set(channelStrings); - // Convert queries to array of strings - // Ensure each query is a separate string in the array - const queryStrings: string[] = []; - for (const q of queries ?? []) { - if (Array.isArray(q)) { - // Handle nested arrays: [[q1, q2]] -> [q1, q2] - for (const inner of q) { - queryStrings.push( - typeof inner === 'string' ? inner : inner.toString(), - ); - } - } else { - queryStrings.push(typeof q === 'string' ? q : q.toString()); - } - } + const queryStrings = normalizeQueries(queries); const subscriptionId = this.generateUniqueSubscriptionId(); @@ -631,23 +620,7 @@ export class Realtime { } if (changes.queries !== undefined) { - const nextQueries: string[] = []; - for (const q of changes.queries) { - if (Array.isArray(q)) { - for (const inner of q) { - nextQueries.push( - typeof inner === 'string' - ? inner - : (inner as Query).toString(), - ); - } - } else { - nextQueries.push( - typeof q === 'string' ? q : q.toString(), - ); - } - } - subscription.queries = nextQueries; + subscription.queries = normalizeQueries(changes.queries); } this.enqueuePendingSubscribe(subscriptionId); diff --git a/src/services/sites.ts b/src/services/sites.ts index 662b4485..c2771dd3 100644 --- a/src/services/sites.ts +++ b/src/services/sites.ts @@ -120,6 +120,7 @@ export class Sites { $createdAt: '', $updatedAt: '', name: '', + description: '', enabled: true, live: true, logging: true, @@ -162,6 +163,7 @@ export class Sites { $createdAt: '', $updatedAt: '', key: '', + description: '', value: '', secret: false, resourceType: '', @@ -201,6 +203,7 @@ export class Sites { * @param {string} params.runtimeSpecification - Runtime specification for the SSR executions. * @param {number} params.deploymentRetention - Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept. * @param {ProjectKeyScopes[]} params.scopes - List of scopes allowed for API key auto-generated for every site build and SSR execution. Maximum of 200 scopes are allowed. + * @param {string} params.description - Optional description for the site. * @throws {AppwriteException} * @returns {Promise<Models.Site>} */ @@ -229,6 +232,7 @@ export class Sites { runtimeSpecification?: string; deploymentRetention?: number; scopes?: ProjectKeyScopes[]; + description?: string; }): Promise<Models.Site>; /** * Create a new site. @@ -257,6 +261,7 @@ export class Sites { * @param {string} runtimeSpecification - Runtime specification for the SSR executions. * @param {number} deploymentRetention - Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept. * @param {ProjectKeyScopes[]} scopes - List of scopes allowed for API key auto-generated for every site build and SSR execution. Maximum of 200 scopes are allowed. + * @param {string} description - Optional description for the site. * @throws {AppwriteException} * @returns {Promise<Models.Site>} * @deprecated Use the object parameter style method for a better developer experience. @@ -286,6 +291,7 @@ export class Sites { runtimeSpecification?: string, deploymentRetention?: number, scopes?: ProjectKeyScopes[], + description?: string, ): Promise<Models.Site>; create( paramsOrFirst: @@ -314,6 +320,7 @@ export class Sites { runtimeSpecification?: string; deploymentRetention?: number; scopes?: ProjectKeyScopes[]; + description?: string; } | string, ...rest: [ @@ -340,6 +347,7 @@ export class Sites { string?, number?, ProjectKeyScopes[]?, + string?, ] ): Promise<Models.Site> { let params: { @@ -367,6 +375,7 @@ export class Sites { runtimeSpecification?: string; deploymentRetention?: number; scopes?: ProjectKeyScopes[]; + description?: string; }; if ( @@ -399,6 +408,7 @@ export class Sites { runtimeSpecification?: string; deploymentRetention?: number; scopes?: ProjectKeyScopes[]; + description?: string; }; } else { params = { @@ -426,6 +436,7 @@ export class Sites { runtimeSpecification: rest[20] as string, deploymentRetention: rest[21] as number, scopes: rest[22] as ProjectKeyScopes[], + description: rest[23] as string, }; } @@ -453,6 +464,7 @@ export class Sites { const runtimeSpecification = params.runtimeSpecification; const deploymentRetention = params.deploymentRetention; const scopes = params.scopes; + const description = params.description; if (typeof siteId === 'undefined') { throw new AppwriteException('Missing required parameter: "siteId"'); @@ -544,6 +556,9 @@ export class Sites { if (typeof scopes !== 'undefined') { apiPayload['scopes'] = scopes; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -562,6 +577,7 @@ export class Sites { $createdAt: '', $updatedAt: '', name: '', + description: '', enabled: true, live: true, logging: true, @@ -604,6 +620,7 @@ export class Sites { $createdAt: '', $updatedAt: '', key: '', + description: '', value: '', secret: false, resourceType: '', @@ -1155,6 +1172,7 @@ export class Sites { $createdAt: '', $updatedAt: '', name: '', + description: '', enabled: true, live: true, logging: true, @@ -1197,6 +1215,7 @@ export class Sites { $createdAt: '', $updatedAt: '', key: '', + description: '', value: '', secret: false, resourceType: '', @@ -1226,16 +1245,17 @@ export class Sites { * @param {Adapter} params.adapter - Framework adapter defining rendering strategy. Allowed values are: static, ssr * @param {string} params.fallbackFile - Fallback file for single page application sites. * @param {string} params.installationId - Appwrite Installation ID for VCS (Version Control System) deployment. - * @param {string} params.providerRepositoryId - Repository ID of the repo linked to the site. + * @param {string | null} params.providerRepositoryId - Repository ID of the repo linked to the site. * @param {string} params.providerBranch - Production branch for the repo linked to the site. * @param {boolean} params.providerSilentMode - Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests. * @param {string} params.providerRootDirectory - Path to site code in the linked repo. - * @param {string[]} params.providerBranches - List of branch name patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all branches. - * @param {string[]} params.providerPaths - List of file path patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all file changes. - * @param {string} params.buildSpecification - Build specification for the site deployments. + * @param {string[] | null} params.providerBranches - List of branch name patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all branches. + * @param {string[] | null} params.providerPaths - List of file path patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all file changes. + * @param {string | null} params.buildSpecification - Build specification for the site deployments. * @param {string} params.runtimeSpecification - Runtime specification for the SSR executions. * @param {number} params.deploymentRetention - Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept. - * @param {ProjectKeyScopes[]} params.scopes - List of scopes allowed for API key auto-generated for every site build and SSR execution. Maximum of 200 scopes are allowed. + * @param {ProjectKeyScopes[] | null} params.scopes - List of scopes allowed for API key auto-generated for every site build and SSR execution. Maximum of 200 scopes are allowed. + * @param {string | null} params.description - Optional description for the site. * @throws {AppwriteException} * @returns {Promise<Models.Site>} */ @@ -1254,16 +1274,17 @@ export class Sites { adapter?: Adapter; fallbackFile?: string; installationId?: string; - providerRepositoryId?: string; + providerRepositoryId?: string | null; providerBranch?: string; providerSilentMode?: boolean; providerRootDirectory?: string; - providerBranches?: string[]; - providerPaths?: string[]; - buildSpecification?: string; + providerBranches?: string[] | null; + providerPaths?: string[] | null; + buildSpecification?: string | null; runtimeSpecification?: string; deploymentRetention?: number; - scopes?: ProjectKeyScopes[]; + scopes?: ProjectKeyScopes[] | null; + description?: string | null; }): Promise<Models.Site>; /** * Update site by its unique ID. @@ -1282,16 +1303,17 @@ export class Sites { * @param {Adapter} adapter - Framework adapter defining rendering strategy. Allowed values are: static, ssr * @param {string} fallbackFile - Fallback file for single page application sites. * @param {string} installationId - Appwrite Installation ID for VCS (Version Control System) deployment. - * @param {string} providerRepositoryId - Repository ID of the repo linked to the site. + * @param {string | null} providerRepositoryId - Repository ID of the repo linked to the site. * @param {string} providerBranch - Production branch for the repo linked to the site. * @param {boolean} providerSilentMode - Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests. * @param {string} providerRootDirectory - Path to site code in the linked repo. - * @param {string[]} providerBranches - List of branch name patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all branches. - * @param {string[]} providerPaths - List of file path patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all file changes. - * @param {string} buildSpecification - Build specification for the site deployments. + * @param {string[] | null} providerBranches - List of branch name patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all branches. + * @param {string[] | null} providerPaths - List of file path patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all file changes. + * @param {string | null} buildSpecification - Build specification for the site deployments. * @param {string} runtimeSpecification - Runtime specification for the SSR executions. * @param {number} deploymentRetention - Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept. - * @param {ProjectKeyScopes[]} scopes - List of scopes allowed for API key auto-generated for every site build and SSR execution. Maximum of 200 scopes are allowed. + * @param {ProjectKeyScopes[] | null} scopes - List of scopes allowed for API key auto-generated for every site build and SSR execution. Maximum of 200 scopes are allowed. + * @param {string | null} description - Optional description for the site. * @throws {AppwriteException} * @returns {Promise<Models.Site>} * @deprecated Use the object parameter style method for a better developer experience. @@ -1311,16 +1333,17 @@ export class Sites { adapter?: Adapter, fallbackFile?: string, installationId?: string, - providerRepositoryId?: string, + providerRepositoryId?: string | null, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, - providerBranches?: string[], - providerPaths?: string[], - buildSpecification?: string, + providerBranches?: string[] | null, + providerPaths?: string[] | null, + buildSpecification?: string | null, runtimeSpecification?: string, deploymentRetention?: number, - scopes?: ProjectKeyScopes[], + scopes?: ProjectKeyScopes[] | null, + description?: string | null, ): Promise<Models.Site>; update( paramsOrFirst: @@ -1339,16 +1362,17 @@ export class Sites { adapter?: Adapter; fallbackFile?: string; installationId?: string; - providerRepositoryId?: string; + providerRepositoryId?: string | null; providerBranch?: string; providerSilentMode?: boolean; providerRootDirectory?: string; - providerBranches?: string[]; - providerPaths?: string[]; - buildSpecification?: string; + providerBranches?: string[] | null; + providerPaths?: string[] | null; + buildSpecification?: string | null; runtimeSpecification?: string; deploymentRetention?: number; - scopes?: ProjectKeyScopes[]; + scopes?: ProjectKeyScopes[] | null; + description?: string | null; } | string, ...rest: [ @@ -1365,16 +1389,17 @@ export class Sites { Adapter?, string?, string?, - string?, + (string | null)?, string?, boolean?, string?, - string[]?, - string[]?, - string?, + (string[] | null)?, + (string[] | null)?, + (string | null)?, string?, number?, - ProjectKeyScopes[]?, + (ProjectKeyScopes[] | null)?, + (string | null)?, ] ): Promise<Models.Site> { let params: { @@ -1392,16 +1417,17 @@ export class Sites { adapter?: Adapter; fallbackFile?: string; installationId?: string; - providerRepositoryId?: string; + providerRepositoryId?: string | null; providerBranch?: string; providerSilentMode?: boolean; providerRootDirectory?: string; - providerBranches?: string[]; - providerPaths?: string[]; - buildSpecification?: string; + providerBranches?: string[] | null; + providerPaths?: string[] | null; + buildSpecification?: string | null; runtimeSpecification?: string; deploymentRetention?: number; - scopes?: ProjectKeyScopes[]; + scopes?: ProjectKeyScopes[] | null; + description?: string | null; }; if ( @@ -1424,16 +1450,17 @@ export class Sites { adapter?: Adapter; fallbackFile?: string; installationId?: string; - providerRepositoryId?: string; + providerRepositoryId?: string | null; providerBranch?: string; providerSilentMode?: boolean; providerRootDirectory?: string; - providerBranches?: string[]; - providerPaths?: string[]; - buildSpecification?: string; + providerBranches?: string[] | null; + providerPaths?: string[] | null; + buildSpecification?: string | null; runtimeSpecification?: string; deploymentRetention?: number; - scopes?: ProjectKeyScopes[]; + scopes?: ProjectKeyScopes[] | null; + description?: string | null; }; } else { params = { @@ -1451,16 +1478,17 @@ export class Sites { adapter: rest[10] as Adapter, fallbackFile: rest[11] as string, installationId: rest[12] as string, - providerRepositoryId: rest[13] as string, + providerRepositoryId: rest[13] as string | null, providerBranch: rest[14] as string, providerSilentMode: rest[15] as boolean, providerRootDirectory: rest[16] as string, - providerBranches: rest[17] as string[], - providerPaths: rest[18] as string[], - buildSpecification: rest[19] as string, + providerBranches: rest[17] as string[] | null, + providerPaths: rest[18] as string[] | null, + buildSpecification: rest[19] as string | null, runtimeSpecification: rest[20] as string, deploymentRetention: rest[21] as number, - scopes: rest[22] as ProjectKeyScopes[], + scopes: rest[22] as ProjectKeyScopes[] | null, + description: rest[23] as string | null, }; } @@ -1488,6 +1516,7 @@ export class Sites { const runtimeSpecification = params.runtimeSpecification; const deploymentRetention = params.deploymentRetention; const scopes = params.scopes; + const description = params.description; if (typeof siteId === 'undefined' || siteId === '') { throw new AppwriteException('Missing required parameter: "siteId"'); @@ -1574,6 +1603,9 @@ export class Sites { if (typeof scopes !== 'undefined') { apiPayload['scopes'] = scopes; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -1592,6 +1624,7 @@ export class Sites { $createdAt: '', $updatedAt: '', name: '', + description: '', enabled: true, live: true, logging: true, @@ -1634,6 +1667,7 @@ export class Sites { $createdAt: '', $updatedAt: '', key: '', + description: '', value: '', secret: false, resourceType: '', @@ -1783,6 +1817,7 @@ export class Sites { $createdAt: '', $updatedAt: '', name: '', + description: '', enabled: true, live: true, logging: true, @@ -1825,6 +1860,7 @@ export class Sites { $createdAt: '', $updatedAt: '', key: '', + description: '', value: '', secret: false, resourceType: '', @@ -3424,6 +3460,7 @@ export class Sites { $createdAt: '', $updatedAt: '', key: '', + description: '', value: '', secret: false, resourceType: '', @@ -3444,6 +3481,7 @@ export class Sites { * @param {string} params.key - Variable key. Letters, digits and underscores only, must not start with a digit. Max length: 255 chars. * @param {string} params.value - Variable value. Max length: 8192 chars. * @param {boolean} params.secret - Secret variables can be updated or deleted, but only sites can read them during build and runtime. + * @param {string} params.description - Optional description for the variable. * @throws {AppwriteException} * @returns {Promise<Models.Variable>} */ @@ -3453,6 +3491,7 @@ export class Sites { key: string; value: string; secret?: boolean; + description?: string; }): Promise<Models.Variable>; /** * Create a new site variable. These variables can be accessed during build and runtime (server-side rendering) as environment variables. @@ -3462,6 +3501,7 @@ export class Sites { * @param {string} key - Variable key. Letters, digits and underscores only, must not start with a digit. Max length: 255 chars. * @param {string} value - Variable value. Max length: 8192 chars. * @param {boolean} secret - Secret variables can be updated or deleted, but only sites can read them during build and runtime. + * @param {string} description - Optional description for the variable. * @throws {AppwriteException} * @returns {Promise<Models.Variable>} * @deprecated Use the object parameter style method for a better developer experience. @@ -3472,6 +3512,7 @@ export class Sites { key: string, value: string, secret?: boolean, + description?: string, ): Promise<Models.Variable>; createVariable( paramsOrFirst: @@ -3481,9 +3522,10 @@ export class Sites { key: string; value: string; secret?: boolean; + description?: string; } | string, - ...rest: [string?, string?, string?, boolean?] + ...rest: [string?, string?, string?, boolean?, string?] ): Promise<Models.Variable> { let params: { siteId: string; @@ -3491,6 +3533,7 @@ export class Sites { key: string; value: string; secret?: boolean; + description?: string; }; if ( @@ -3504,6 +3547,7 @@ export class Sites { key: string; value: string; secret?: boolean; + description?: string; }; } else { params = { @@ -3512,6 +3556,7 @@ export class Sites { key: rest[1] as string, value: rest[2] as string, secret: rest[3] as boolean, + description: rest[4] as string, }; } @@ -3520,6 +3565,7 @@ export class Sites { const key = params.key; const value = params.value; const secret = params.secret; + const description = params.description; if (typeof siteId === 'undefined' || siteId === '') { throw new AppwriteException('Missing required parameter: "siteId"'); @@ -3552,6 +3598,9 @@ export class Sites { if (typeof secret !== 'undefined') { apiPayload['secret'] = secret; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -3570,6 +3619,7 @@ export class Sites { $createdAt: '', $updatedAt: '', key: '', + description: '', value: '', secret: false, resourceType: '', @@ -3658,6 +3708,7 @@ export class Sites { $createdAt: '', $updatedAt: '', key: '', + description: '', value: '', secret: false, resourceType: '', @@ -3675,27 +3726,30 @@ export class Sites { * * @param {string} params.siteId - Site unique ID. * @param {string} params.variableId - Variable unique ID. - * @param {string} params.key - Variable key. Letters, digits and underscores only, must not start with a digit. Max length: 255 chars. - * @param {string} params.value - Variable value. Max length: 8192 chars. - * @param {boolean} params.secret - Secret variables can be updated or deleted, but only sites can read them during build and runtime. + * @param {string | null} params.key - Variable key. Letters, digits and underscores only, must not start with a digit. Max length: 255 chars. + * @param {string | null} params.value - Variable value. Max length: 8192 chars. + * @param {boolean | null} params.secret - Secret variables can be updated or deleted, but only sites can read them during build and runtime. + * @param {string | null} params.description - Optional description for the variable. * @throws {AppwriteException} * @returns {Promise<Models.Variable>} */ updateVariable(params: { siteId: string; variableId: string; - key?: string; - value?: string; - secret?: boolean; + key?: string | null; + value?: string | null; + secret?: boolean | null; + description?: string | null; }): Promise<Models.Variable>; /** * Update variable by its unique ID. * * @param {string} siteId - Site unique ID. * @param {string} variableId - Variable unique ID. - * @param {string} key - Variable key. Letters, digits and underscores only, must not start with a digit. Max length: 255 chars. - * @param {string} value - Variable value. Max length: 8192 chars. - * @param {boolean} secret - Secret variables can be updated or deleted, but only sites can read them during build and runtime. + * @param {string | null} key - Variable key. Letters, digits and underscores only, must not start with a digit. Max length: 255 chars. + * @param {string | null} value - Variable value. Max length: 8192 chars. + * @param {boolean | null} secret - Secret variables can be updated or deleted, but only sites can read them during build and runtime. + * @param {string | null} description - Optional description for the variable. * @throws {AppwriteException} * @returns {Promise<Models.Variable>} * @deprecated Use the object parameter style method for a better developer experience. @@ -3703,28 +3757,37 @@ export class Sites { updateVariable( siteId: string, variableId: string, - key?: string, - value?: string, - secret?: boolean, + key?: string | null, + value?: string | null, + secret?: boolean | null, + description?: string | null, ): Promise<Models.Variable>; updateVariable( paramsOrFirst: | { siteId: string; variableId: string; - key?: string; - value?: string; - secret?: boolean; + key?: string | null; + value?: string | null; + secret?: boolean | null; + description?: string | null; } | string, - ...rest: [string?, string?, string?, boolean?] + ...rest: [ + string?, + (string | null)?, + (string | null)?, + (boolean | null)?, + (string | null)?, + ] ): Promise<Models.Variable> { let params: { siteId: string; variableId: string; - key?: string; - value?: string; - secret?: boolean; + key?: string | null; + value?: string | null; + secret?: boolean | null; + description?: string | null; }; if ( @@ -3735,17 +3798,19 @@ export class Sites { params = (paramsOrFirst || {}) as { siteId: string; variableId: string; - key?: string; - value?: string; - secret?: boolean; + key?: string | null; + value?: string | null; + secret?: boolean | null; + description?: string | null; }; } else { params = { siteId: paramsOrFirst as string, variableId: rest[0] as string, - key: rest[1] as string, - value: rest[2] as string, - secret: rest[3] as boolean, + key: rest[1] as string | null, + value: rest[2] as string | null, + secret: rest[3] as boolean | null, + description: rest[4] as string | null, }; } @@ -3754,6 +3819,7 @@ export class Sites { const key = params.key; const value = params.value; const secret = params.secret; + const description = params.description; if (typeof siteId === 'undefined' || siteId === '') { throw new AppwriteException('Missing required parameter: "siteId"'); @@ -3776,6 +3842,9 @@ export class Sites { if (typeof secret !== 'undefined') { apiPayload['secret'] = secret; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -3794,6 +3863,7 @@ export class Sites { $createdAt: '', $updatedAt: '', key: '', + description: '', value: '', secret: false, resourceType: '', diff --git a/src/services/storage.ts b/src/services/storage.ts index ca9ec050..ff53b0de 100644 --- a/src/services/storage.ts +++ b/src/services/storage.ts @@ -117,6 +117,7 @@ export class Storage { $permissions: [], fileSecurity: false, name: '', + description: '', enabled: true, maximumFileSize: 0, allowedFileExtensions: [], @@ -138,7 +139,7 @@ export class Storage { * * @param {string} params.bucketId - 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.name - Bucket name - * @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 {string[] | null} 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 5GB. @@ -147,13 +148,14 @@ export class Storage { * @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? + * @param {string} params.description - Optional description for the bucket. * @throws {AppwriteException} * @returns {Promise<Models.Bucket>} */ createBucket(params: { bucketId: string; name: string; - permissions?: string[]; + permissions?: string[] | null; fileSecurity?: boolean; enabled?: boolean; maximumFileSize?: number; @@ -162,13 +164,14 @@ export class Storage { encryption?: boolean; antivirus?: boolean; transformations?: boolean; + description?: string; }): Promise<Models.Bucket>; /** * Create a new storage bucket. * * @param {string} bucketId - 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} name - Bucket name - * @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 {string[] | null} 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 5GB. @@ -177,6 +180,7 @@ export class Storage { * @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? + * @param {string} description - Optional description for the bucket. * @throws {AppwriteException} * @returns {Promise<Models.Bucket>} * @deprecated Use the object parameter style method for a better developer experience. @@ -184,7 +188,7 @@ export class Storage { createBucket( bucketId: string, name: string, - permissions?: string[], + permissions?: string[] | null, fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, @@ -193,13 +197,14 @@ export class Storage { encryption?: boolean, antivirus?: boolean, transformations?: boolean, + description?: string, ): Promise<Models.Bucket>; createBucket( paramsOrFirst: | { bucketId: string; name: string; - permissions?: string[]; + permissions?: string[] | null; fileSecurity?: boolean; enabled?: boolean; maximumFileSize?: number; @@ -208,11 +213,12 @@ export class Storage { encryption?: boolean; antivirus?: boolean; transformations?: boolean; + description?: string; } | string, ...rest: [ string?, - string[]?, + (string[] | null)?, boolean?, boolean?, number?, @@ -221,12 +227,13 @@ export class Storage { boolean?, boolean?, boolean?, + string?, ] ): Promise<Models.Bucket> { let params: { bucketId: string; name: string; - permissions?: string[]; + permissions?: string[] | null; fileSecurity?: boolean; enabled?: boolean; maximumFileSize?: number; @@ -235,6 +242,7 @@ export class Storage { encryption?: boolean; antivirus?: boolean; transformations?: boolean; + description?: string; }; if ( @@ -245,7 +253,7 @@ export class Storage { params = (paramsOrFirst || {}) as { bucketId: string; name: string; - permissions?: string[]; + permissions?: string[] | null; fileSecurity?: boolean; enabled?: boolean; maximumFileSize?: number; @@ -254,12 +262,13 @@ export class Storage { encryption?: boolean; antivirus?: boolean; transformations?: boolean; + description?: string; }; } else { params = { bucketId: paramsOrFirst as string, name: rest[0] as string, - permissions: rest[1] as string[], + permissions: rest[1] as string[] | null, fileSecurity: rest[2] as boolean, enabled: rest[3] as boolean, maximumFileSize: rest[4] as number, @@ -268,6 +277,7 @@ export class Storage { encryption: rest[7] as boolean, antivirus: rest[8] as boolean, transformations: rest[9] as boolean, + description: rest[10] as string, }; } @@ -282,6 +292,7 @@ export class Storage { const encryption = params.encryption; const antivirus = params.antivirus; const transformations = params.transformations; + const description = params.description; if (typeof bucketId === 'undefined') { throw new AppwriteException( @@ -326,6 +337,9 @@ export class Storage { if (typeof transformations !== 'undefined') { apiPayload['transformations'] = transformations; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -346,6 +360,7 @@ export class Storage { $permissions: [], fileSecurity: false, name: '', + description: '', enabled: true, maximumFileSize: 0, allowedFileExtensions: [], @@ -427,6 +442,7 @@ export class Storage { $permissions: [], fileSecurity: false, name: '', + description: '', enabled: true, maximumFileSize: 0, allowedFileExtensions: [], @@ -448,45 +464,48 @@ export class Storage { * * @param {string} params.bucketId - Bucket unique ID. * @param {string} params.name - Bucket 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). + * @param {string[] | null} 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 5GB. + * @param {number | null} 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 + * @param {Compression | null} 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 | null} 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? + * @param {string | null} params.description - Optional description for the bucket. * @throws {AppwriteException} * @returns {Promise<Models.Bucket>} */ updateBucket(params: { bucketId: string; name: string; - permissions?: string[]; + permissions?: string[] | null; fileSecurity?: boolean; enabled?: boolean; - maximumFileSize?: number; + maximumFileSize?: number | null; allowedFileExtensions?: string[]; - compression?: Compression; - encryption?: boolean; + compression?: Compression | null; + encryption?: boolean | null; antivirus?: boolean; transformations?: boolean; + description?: string | null; }): Promise<Models.Bucket>; /** * Update a storage bucket by its unique ID. * * @param {string} bucketId - Bucket unique ID. * @param {string} name - Bucket 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). + * @param {string[] | null} 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 5GB. + * @param {number | null} 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 + * @param {Compression | null} 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 | null} 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? + * @param {string | null} description - Optional description for the bucket. * @throws {AppwriteException} * @returns {Promise<Models.Bucket>} * @deprecated Use the object parameter style method for a better developer experience. @@ -494,57 +513,61 @@ export class Storage { updateBucket( bucketId: string, name: string, - permissions?: string[], + permissions?: string[] | null, fileSecurity?: boolean, enabled?: boolean, - maximumFileSize?: number, + maximumFileSize?: number | null, allowedFileExtensions?: string[], - compression?: Compression, - encryption?: boolean, + compression?: Compression | null, + encryption?: boolean | null, antivirus?: boolean, transformations?: boolean, + description?: string | null, ): Promise<Models.Bucket>; updateBucket( paramsOrFirst: | { bucketId: string; name: string; - permissions?: string[]; + permissions?: string[] | null; fileSecurity?: boolean; enabled?: boolean; - maximumFileSize?: number; + maximumFileSize?: number | null; allowedFileExtensions?: string[]; - compression?: Compression; - encryption?: boolean; + compression?: Compression | null; + encryption?: boolean | null; antivirus?: boolean; transformations?: boolean; + description?: string | null; } | string, ...rest: [ string?, - string[]?, + (string[] | null)?, boolean?, boolean?, - number?, + (number | null)?, string[]?, - Compression?, - boolean?, + (Compression | null)?, + (boolean | null)?, boolean?, boolean?, + (string | null)?, ] ): Promise<Models.Bucket> { let params: { bucketId: string; name: string; - permissions?: string[]; + permissions?: string[] | null; fileSecurity?: boolean; enabled?: boolean; - maximumFileSize?: number; + maximumFileSize?: number | null; allowedFileExtensions?: string[]; - compression?: Compression; - encryption?: boolean; + compression?: Compression | null; + encryption?: boolean | null; antivirus?: boolean; transformations?: boolean; + description?: string | null; }; if ( @@ -555,29 +578,31 @@ export class Storage { params = (paramsOrFirst || {}) as { bucketId: string; name: string; - permissions?: string[]; + permissions?: string[] | null; fileSecurity?: boolean; enabled?: boolean; - maximumFileSize?: number; + maximumFileSize?: number | null; allowedFileExtensions?: string[]; - compression?: Compression; - encryption?: boolean; + compression?: Compression | null; + encryption?: boolean | null; antivirus?: boolean; transformations?: boolean; + description?: string | null; }; } else { params = { bucketId: paramsOrFirst as string, name: rest[0] as string, - permissions: rest[1] as string[], + permissions: rest[1] as string[] | null, fileSecurity: rest[2] as boolean, enabled: rest[3] as boolean, - maximumFileSize: rest[4] as number, + maximumFileSize: rest[4] as number | null, allowedFileExtensions: rest[5] as string[], - compression: rest[6] as Compression, - encryption: rest[7] as boolean, + compression: rest[6] as Compression | null, + encryption: rest[7] as boolean | null, antivirus: rest[8] as boolean, transformations: rest[9] as boolean, + description: rest[10] as string | null, }; } @@ -592,6 +617,7 @@ export class Storage { const encryption = params.encryption; const antivirus = params.antivirus; const transformations = params.transformations; + const description = params.description; if (typeof bucketId === 'undefined' || bucketId === '') { throw new AppwriteException( @@ -636,6 +662,9 @@ export class Storage { if (typeof transformations !== 'undefined') { apiPayload['transformations'] = transformations; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -656,6 +685,7 @@ export class Storage { $permissions: [], fileSecurity: false, name: '', + description: '', enabled: true, maximumFileSize: 0, allowedFileExtensions: [], @@ -1127,7 +1157,7 @@ export class Storage { * @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). + * @param {string[] | null} 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<Models.File>} */ @@ -1135,7 +1165,7 @@ export class Storage { bucketId: string; fileId: string; name?: string; - permissions?: string[]; + permissions?: string[] | null; }): Promise<Models.File>; /** * Update a file by its unique ID. Only users with write permissions have access to update this resource. @@ -1143,7 +1173,7 @@ export class Storage { * @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). + * @param {string[] | null} 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<Models.File>} * @deprecated Use the object parameter style method for a better developer experience. @@ -1152,7 +1182,7 @@ export class Storage { bucketId: string, fileId: string, name?: string, - permissions?: string[], + permissions?: string[] | null, ): Promise<Models.File>; updateFile( paramsOrFirst: @@ -1160,16 +1190,16 @@ export class Storage { bucketId: string; fileId: string; name?: string; - permissions?: string[]; + permissions?: string[] | null; } | string, - ...rest: [string?, string?, string[]?] + ...rest: [string?, string?, (string[] | null)?] ): Promise<Models.File> { let params: { bucketId: string; fileId: string; name?: string; - permissions?: string[]; + permissions?: string[] | null; }; if ( @@ -1181,14 +1211,14 @@ export class Storage { bucketId: string; fileId: string; name?: string; - permissions?: string[]; + permissions?: string[] | null; }; } else { params = { bucketId: paramsOrFirst as string, fileId: rest[0] as string, name: rest[1] as string, - permissions: rest[2] as string[], + permissions: rest[2] as string[] | null, }; } diff --git a/src/services/tables-db.ts b/src/services/tables-db.ts index 41533346..06d1fbbf 100644 --- a/src/services/tables-db.ts +++ b/src/services/tables-db.ts @@ -113,6 +113,7 @@ export class TablesDB { defaults: { $id: '', name: '', + description: '', $createdAt: '', $updatedAt: '', enabled: true, @@ -166,9 +167,10 @@ export class TablesDB { * @param {string} params.databaseId - 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.name - Database name. Max length: 128 chars. * @param {boolean} params.enabled - Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. + * @param {string} params.description - Optional description for the database. * @param {string} params.specification - Database specification. Defaults to `serverless`, which creates the database on the shared pool. Any other value provisions a dedicated database on that specification. * @param {number} params.replicas - Number of high availability replicas (0-5) for the dedicated database backing this database. Requires a dedicated `specification`; must be 0 for a serverless database. High availability is enabled when greater than 0. - * @param {string} params.syncMode - Replication sync mode for the dedicated database backing this database. Requires a dedicated `specification`; the mode is only in force once there is at least one replica. Allowed values: async, sync, quorum. + * @param {string | null} params.syncMode - Replication sync mode for the dedicated database backing this database. Requires a dedicated `specification`; the mode is only in force once there is at least one replica. Allowed values: async, sync, quorum. * @throws {AppwriteException} * @returns {Promise<Models.Database>} */ @@ -176,9 +178,10 @@ export class TablesDB { databaseId: string; name: string; enabled?: boolean; + description?: string; specification?: string; replicas?: number; - syncMode?: string; + syncMode?: string | null; }): Promise<Models.Database>; /** * Create a new Database. @@ -187,9 +190,10 @@ export class TablesDB { * @param {string} databaseId - 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} name - Database name. Max length: 128 chars. * @param {boolean} enabled - Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. + * @param {string} description - Optional description for the database. * @param {string} specification - Database specification. Defaults to `serverless`, which creates the database on the shared pool. Any other value provisions a dedicated database on that specification. * @param {number} replicas - Number of high availability replicas (0-5) for the dedicated database backing this database. Requires a dedicated `specification`; must be 0 for a serverless database. High availability is enabled when greater than 0. - * @param {string} syncMode - Replication sync mode for the dedicated database backing this database. Requires a dedicated `specification`; the mode is only in force once there is at least one replica. Allowed values: async, sync, quorum. + * @param {string | null} syncMode - Replication sync mode for the dedicated database backing this database. Requires a dedicated `specification`; the mode is only in force once there is at least one replica. Allowed values: async, sync, quorum. * @throws {AppwriteException} * @returns {Promise<Models.Database>} * @deprecated Use the object parameter style method for a better developer experience. @@ -198,9 +202,10 @@ export class TablesDB { databaseId: string, name: string, enabled?: boolean, + description?: string, specification?: string, replicas?: number, - syncMode?: string, + syncMode?: string | null, ): Promise<Models.Database>; create( paramsOrFirst: @@ -208,20 +213,29 @@ export class TablesDB { databaseId: string; name: string; enabled?: boolean; + description?: string; specification?: string; replicas?: number; - syncMode?: string; + syncMode?: string | null; } | string, - ...rest: [string?, boolean?, string?, number?, string?] + ...rest: [ + string?, + boolean?, + string?, + string?, + number?, + (string | null)?, + ] ): Promise<Models.Database> { let params: { databaseId: string; name: string; enabled?: boolean; + description?: string; specification?: string; replicas?: number; - syncMode?: string; + syncMode?: string | null; }; if ( @@ -233,24 +247,27 @@ export class TablesDB { databaseId: string; name: string; enabled?: boolean; + description?: string; specification?: string; replicas?: number; - syncMode?: string; + syncMode?: string | null; }; } else { params = { databaseId: paramsOrFirst as string, name: rest[0] as string, enabled: rest[1] as boolean, - specification: rest[2] as string, - replicas: rest[3] as number, - syncMode: rest[4] as string, + description: rest[2] as string, + specification: rest[3] as string, + replicas: rest[4] as number, + syncMode: rest[5] as string | null, }; } const databaseId = params.databaseId; const name = params.name; const enabled = params.enabled; + const description = params.description; const specification = params.specification; const replicas = params.replicas; const syncMode = params.syncMode; @@ -274,6 +291,9 @@ export class TablesDB { if (typeof enabled !== 'undefined') { apiPayload['enabled'] = enabled; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } if (typeof specification !== 'undefined') { apiPayload['specification'] = specification; } @@ -299,6 +319,7 @@ export class TablesDB { defaults: { $id: '', name: '', + description: '', $createdAt: '', $updatedAt: '', enabled: true, @@ -959,6 +980,7 @@ export class TablesDB { defaults: { $id: '', name: '', + description: '', $createdAt: '', $updatedAt: '', enabled: true, @@ -1011,9 +1033,10 @@ export class TablesDB { * @param {string} params.databaseId - Database ID. * @param {string} params.name - Database name. Max length: 128 chars. * @param {boolean} params.enabled - Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. - * @param {string} params.specification - Database specification. Resizing between dedicated specifications changes cpu, memory, storage and the connection ceiling via a rolling cutover with zero downtime. Moving a `serverless` database onto a dedicated specification is a data migration, not a resize. - * @param {number} params.replicas - Number of high availability replicas (0-5) for the dedicated database backing this database. Only valid when the database is backed by a dedicated specification. High availability is enabled when greater than 0. - * @param {string} params.syncMode - Replication sync mode for the dedicated database backing this database. Only valid when the database is backed by a dedicated specification; the mode is only in force once there is at least one replica. Allowed values: async, sync, quorum. + * @param {string | null} params.description - Optional description for the database. + * @param {string | null} params.specification - Database specification. Resizing between dedicated specifications changes cpu, memory, storage and the connection ceiling via a rolling cutover with zero downtime. Moving a `serverless` database onto a dedicated specification is a data migration, not a resize. + * @param {number | null} params.replicas - Number of high availability replicas (0-5) for the dedicated database backing this database. Only valid when the database is backed by a dedicated specification. High availability is enabled when greater than 0. + * @param {string | null} params.syncMode - Replication sync mode for the dedicated database backing this database. Only valid when the database is backed by a dedicated specification; the mode is only in force once there is at least one replica. Allowed values: async, sync, quorum. * @throws {AppwriteException} * @returns {Promise<Models.Database>} */ @@ -1021,9 +1044,10 @@ export class TablesDB { databaseId: string; name?: string; enabled?: boolean; - specification?: string; - replicas?: number; - syncMode?: string; + description?: string | null; + specification?: string | null; + replicas?: number | null; + syncMode?: string | null; }): Promise<Models.Database>; /** * Update a database by its unique ID. @@ -1031,9 +1055,10 @@ export class TablesDB { * @param {string} databaseId - Database ID. * @param {string} name - Database name. Max length: 128 chars. * @param {boolean} enabled - Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. - * @param {string} specification - Database specification. Resizing between dedicated specifications changes cpu, memory, storage and the connection ceiling via a rolling cutover with zero downtime. Moving a `serverless` database onto a dedicated specification is a data migration, not a resize. - * @param {number} replicas - Number of high availability replicas (0-5) for the dedicated database backing this database. Only valid when the database is backed by a dedicated specification. High availability is enabled when greater than 0. - * @param {string} syncMode - Replication sync mode for the dedicated database backing this database. Only valid when the database is backed by a dedicated specification; the mode is only in force once there is at least one replica. Allowed values: async, sync, quorum. + * @param {string | null} description - Optional description for the database. + * @param {string | null} specification - Database specification. Resizing between dedicated specifications changes cpu, memory, storage and the connection ceiling via a rolling cutover with zero downtime. Moving a `serverless` database onto a dedicated specification is a data migration, not a resize. + * @param {number | null} replicas - Number of high availability replicas (0-5) for the dedicated database backing this database. Only valid when the database is backed by a dedicated specification. High availability is enabled when greater than 0. + * @param {string | null} syncMode - Replication sync mode for the dedicated database backing this database. Only valid when the database is backed by a dedicated specification; the mode is only in force once there is at least one replica. Allowed values: async, sync, quorum. * @throws {AppwriteException} * @returns {Promise<Models.Database>} * @deprecated Use the object parameter style method for a better developer experience. @@ -1042,9 +1067,10 @@ export class TablesDB { databaseId: string, name?: string, enabled?: boolean, - specification?: string, - replicas?: number, - syncMode?: string, + description?: string | null, + specification?: string | null, + replicas?: number | null, + syncMode?: string | null, ): Promise<Models.Database>; update( paramsOrFirst: @@ -1052,20 +1078,29 @@ export class TablesDB { databaseId: string; name?: string; enabled?: boolean; - specification?: string; - replicas?: number; - syncMode?: string; + description?: string | null; + specification?: string | null; + replicas?: number | null; + syncMode?: string | null; } | string, - ...rest: [string?, boolean?, string?, number?, string?] + ...rest: [ + string?, + boolean?, + (string | null)?, + (string | null)?, + (number | null)?, + (string | null)?, + ] ): Promise<Models.Database> { let params: { databaseId: string; name?: string; enabled?: boolean; - specification?: string; - replicas?: number; - syncMode?: string; + description?: string | null; + specification?: string | null; + replicas?: number | null; + syncMode?: string | null; }; if ( @@ -1077,24 +1112,27 @@ export class TablesDB { databaseId: string; name?: string; enabled?: boolean; - specification?: string; - replicas?: number; - syncMode?: string; + description?: string | null; + specification?: string | null; + replicas?: number | null; + syncMode?: string | null; }; } else { params = { databaseId: paramsOrFirst as string, name: rest[0] as string, enabled: rest[1] as boolean, - specification: rest[2] as string, - replicas: rest[3] as number, - syncMode: rest[4] as string, + description: rest[2] as string | null, + specification: rest[3] as string | null, + replicas: rest[4] as number | null, + syncMode: rest[5] as string | null, }; } const databaseId = params.databaseId; const name = params.name; const enabled = params.enabled; + const description = params.description; const specification = params.specification; const replicas = params.replicas; const syncMode = params.syncMode; @@ -1115,6 +1153,9 @@ export class TablesDB { if (typeof enabled !== 'undefined') { apiPayload['enabled'] = enabled; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } if (typeof specification !== 'undefined') { apiPayload['specification'] = specification; } @@ -1140,6 +1181,7 @@ export class TablesDB { defaults: { $id: '', name: '', + description: '', $createdAt: '', $updatedAt: '', enabled: true, @@ -1245,33 +1287,33 @@ export class TablesDB { * Trigger a manual failover for a dedicated database with high availability enabled. Promotes a replica to primary. The failover runs asynchronously; poll the database document for status updates. A database left mid-operation also accepts this call as a repair once nothing is driving the operation it is stuck in. Repairing a failover that did not finish, a `failed` database, a stranded upgrade or migrate, or a stranded compute resize additionally requires `targetReplicaId` to name the member to promote, because the default target may be the member that operation already promoted. * * @param {string} params.databaseId - Database ID. - * @param {string} params.targetReplicaId - Target replica ID to promote. If not specified, the healthiest replica is selected. + * @param {string | null} params.targetReplicaId - Target replica ID to promote. If not specified, the healthiest replica is selected. * @throws {AppwriteException} * @returns {Promise<Models.DedicatedDatabase>} */ createFailover(params: { databaseId: string; - targetReplicaId?: string; + targetReplicaId?: string | null; }): Promise<Models.DedicatedDatabase>; /** * Trigger a manual failover for a dedicated database with high availability enabled. Promotes a replica to primary. The failover runs asynchronously; poll the database document for status updates. A database left mid-operation also accepts this call as a repair once nothing is driving the operation it is stuck in. Repairing a failover that did not finish, a `failed` database, a stranded upgrade or migrate, or a stranded compute resize additionally requires `targetReplicaId` to name the member to promote, because the default target may be the member that operation already promoted. * * @param {string} databaseId - Database ID. - * @param {string} targetReplicaId - Target replica ID to promote. If not specified, the healthiest replica is selected. + * @param {string | null} targetReplicaId - Target replica ID to promote. If not specified, the healthiest replica is selected. * @throws {AppwriteException} * @returns {Promise<Models.DedicatedDatabase>} * @deprecated Use the object parameter style method for a better developer experience. */ createFailover( databaseId: string, - targetReplicaId?: string, + targetReplicaId?: string | null, ): Promise<Models.DedicatedDatabase>; createFailover( paramsOrFirst: - { databaseId: string; targetReplicaId?: string } | string, - ...rest: [string?] + { databaseId: string; targetReplicaId?: string | null } | string, + ...rest: [(string | null)?] ): Promise<Models.DedicatedDatabase> { - let params: { databaseId: string; targetReplicaId?: string }; + let params: { databaseId: string; targetReplicaId?: string | null }; if ( paramsOrFirst && @@ -1280,12 +1322,12 @@ export class TablesDB { ) { params = (paramsOrFirst || {}) as { databaseId: string; - targetReplicaId?: string; + targetReplicaId?: string | null; }; } else { params = { databaseId: paramsOrFirst as string, - targetReplicaId: rest[0] as string, + targetReplicaId: rest[0] as string | null, }; } @@ -1470,7 +1512,7 @@ export class TablesDB { } /** - * Start migrating a serverless TablesDB database onto a dedicated MySQL compute. Data is copied to the target while the source stays live, with a brief read-only window during cutover. + * Start migrating a serverless TablesDB database onto a dedicated MySQL compute. Data is copied to the target while the source stays live. Reads continue throughout. Row writes are held for up to a few seconds while routing switches to the dedicated compute; a write the switch has not absorbed within that hold is refused with `database_migration_cutover` and can be retried. Schema changes (tables, columns, indexes) are refused from creation until the cutover completes, and resume once the migration is `soaking`. * * @param {string} params.databaseId - Database ID. * @param {string} params.specification - Dedicated compute specification to provision as the migration target (e.g. s-2vcpu-4gb). The migration always targets a dedicated compute, so `serverless` is not accepted. @@ -1484,7 +1526,7 @@ export class TablesDB { autoCutover?: boolean; }): Promise<Models.DatabaseMigration>; /** - * Start migrating a serverless TablesDB database onto a dedicated MySQL compute. Data is copied to the target while the source stays live, with a brief read-only window during cutover. + * Start migrating a serverless TablesDB database onto a dedicated MySQL compute. Data is copied to the target while the source stays live. Reads continue throughout. Row writes are held for up to a few seconds while routing switches to the dedicated compute; a write the switch has not absorbed within that hold is refused with `database_migration_cutover` and can be retried. Schema changes (tables, columns, indexes) are refused from creation until the cutover completes, and resume once the migration is `soaking`. * * @param {string} databaseId - Database ID. * @param {string} specification - Dedicated compute specification to provision as the migration target (e.g. s-2vcpu-4gb). The migration always targets a dedicated compute, so `serverless` is not accepted. @@ -1771,7 +1813,7 @@ export class TablesDB { } /** - * Cut a verified TablesDB migration over to its dedicated compute. Only applies to a migration created with `autoCutover` disabled, which waits at `ready_to_cutover` until this is called. The routing flip happens shortly after this returns, with a brief read-only window. One call buys one attempt: a cutover that fails a check returns the migration to `verifying` and parks it again, so call this once more to retry. + * Cut a verified TablesDB migration over to its dedicated compute. Only applies to a migration created with `autoCutover` disabled, which waits at `ready_to_cutover` until this is called. The routing flip happens shortly after this returns. Reads are unaffected; row writes are held for up to a few seconds while it lands, and a write the flip has not absorbed within that hold is refused with `database_migration_cutover` and can be retried. One call buys one attempt: a cutover that fails a check returns the migration to `verifying` and parks it again, so call this once more to retry. * * @param {string} params.databaseId - Database ID. * @param {string} params.migrationId - Migration ID. @@ -1783,7 +1825,7 @@ export class TablesDB { migrationId: string; }): Promise<Models.DatabaseMigration>; /** - * Cut a verified TablesDB migration over to its dedicated compute. Only applies to a migration created with `autoCutover` disabled, which waits at `ready_to_cutover` until this is called. The routing flip happens shortly after this returns, with a brief read-only window. One call buys one attempt: a cutover that fails a check returns the migration to `verifying` and parks it again, so call this once more to retry. + * Cut a verified TablesDB migration over to its dedicated compute. Only applies to a migration created with `autoCutover` disabled, which waits at `ready_to_cutover` until this is called. The routing flip happens shortly after this returns. Reads are unaffected; row writes are held for up to a few seconds while it lands, and a write the flip has not absorbed within that hold is refused with `database_migration_cutover` and can be retried. One call buys one attempt: a cutover that fails a check returns the migration to `verifying` and parks it again, so call this once more to retry. * * @param {string} databaseId - Database ID. * @param {string} migrationId - Migration ID. @@ -2325,6 +2367,7 @@ export class TablesDB { $permissions: [], databaseId: '', name: '', + description: '', enabled: true, rowSecurity: false, columns: [], @@ -2344,6 +2387,7 @@ export class TablesDB { $createdAt: '', $updatedAt: '', key: '', + description: '', type: '', status: '', error: '', @@ -2363,11 +2407,12 @@ export class TablesDB { * @param {string} params.databaseId - Database ID. * @param {string} params.tableId - 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.name - Table name. Max length: 128 chars. - * @param {string[]} params.permissions - An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {string[] | null} params.permissions - An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} params.rowSecurity - Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a row. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} params.enabled - Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled. * @param {object[]} params.columns - Array of column definitions to create. Each column should contain: key (string), type (string: string, varchar, text, mediumtext, longtext, integer, bigint, double, boolean, datetime, point, linestring, polygon, email, url, ip, enum), size (integer, required for string and varchar types), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options. * @param {object[]} params.indexes - Array of index definitions to create. Each index should contain: key (string), type (string: key, fulltext, unique, spatial, trigram), attributes (array of column keys), orders (array of ASC/DESC, optional), and lengths (array of integers, optional). + * @param {string} params.description - Optional description for the table. * @throws {AppwriteException} * @returns {Promise<Models.Table>} */ @@ -2375,11 +2420,12 @@ export class TablesDB { databaseId: string; tableId: string; name: string; - permissions?: string[]; + permissions?: string[] | null; rowSecurity?: boolean; enabled?: boolean; columns?: object[]; indexes?: object[]; + description?: string; }): Promise<Models.Table>; /** * Create a new Table. Before using this route, you should create a new database resource using either a [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable) API or directly from your database console. @@ -2387,11 +2433,12 @@ export class TablesDB { * @param {string} databaseId - Database ID. * @param {string} tableId - 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} name - Table name. Max length: 128 chars. - * @param {string[]} permissions - An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {string[] | null} permissions - An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} rowSecurity - Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a row. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} enabled - Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled. * @param {object[]} columns - Array of column definitions to create. Each column should contain: key (string), type (string: string, varchar, text, mediumtext, longtext, integer, bigint, double, boolean, datetime, point, linestring, polygon, email, url, ip, enum), size (integer, required for string and varchar types), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options. * @param {object[]} indexes - Array of index definitions to create. Each index should contain: key (string), type (string: key, fulltext, unique, spatial, trigram), attributes (array of column keys), orders (array of ASC/DESC, optional), and lengths (array of integers, optional). + * @param {string} description - Optional description for the table. * @throws {AppwriteException} * @returns {Promise<Models.Table>} * @deprecated Use the object parameter style method for a better developer experience. @@ -2400,11 +2447,12 @@ export class TablesDB { databaseId: string, tableId: string, name: string, - permissions?: string[], + permissions?: string[] | null, rowSecurity?: boolean, enabled?: boolean, columns?: object[], indexes?: object[], + description?: string, ): Promise<Models.Table>; createTable( paramsOrFirst: @@ -2412,32 +2460,35 @@ export class TablesDB { databaseId: string; tableId: string; name: string; - permissions?: string[]; + permissions?: string[] | null; rowSecurity?: boolean; enabled?: boolean; columns?: object[]; indexes?: object[]; + description?: string; } | string, ...rest: [ string?, string?, - string[]?, + (string[] | null)?, boolean?, boolean?, object[]?, object[]?, + string?, ] ): Promise<Models.Table> { let params: { databaseId: string; tableId: string; name: string; - permissions?: string[]; + permissions?: string[] | null; rowSecurity?: boolean; enabled?: boolean; columns?: object[]; indexes?: object[]; + description?: string; }; if ( @@ -2449,22 +2500,24 @@ export class TablesDB { databaseId: string; tableId: string; name: string; - permissions?: string[]; + permissions?: string[] | null; rowSecurity?: boolean; enabled?: boolean; columns?: object[]; indexes?: object[]; + description?: string; }; } else { params = { databaseId: paramsOrFirst as string, tableId: rest[0] as string, name: rest[1] as string, - permissions: rest[2] as string[], + permissions: rest[2] as string[] | null, rowSecurity: rest[3] as boolean, enabled: rest[4] as boolean, columns: rest[5] as object[], indexes: rest[6] as object[], + description: rest[7] as string, }; } @@ -2476,6 +2529,7 @@ export class TablesDB { const enabled = params.enabled; const columns = params.columns; const indexes = params.indexes; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -2516,6 +2570,9 @@ export class TablesDB { if (typeof indexes !== 'undefined') { apiPayload['indexes'] = indexes; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -2536,6 +2593,7 @@ export class TablesDB { $permissions: [], databaseId: '', name: '', + description: '', enabled: true, rowSecurity: false, columns: [], @@ -2555,6 +2613,7 @@ export class TablesDB { $createdAt: '', $updatedAt: '', key: '', + description: '', type: '', status: '', error: '', @@ -2648,6 +2707,7 @@ export class TablesDB { $permissions: [], databaseId: '', name: '', + description: '', enabled: true, rowSecurity: false, columns: [], @@ -2667,6 +2727,7 @@ export class TablesDB { $createdAt: '', $updatedAt: '', key: '', + description: '', type: '', status: '', error: '', @@ -2686,10 +2747,11 @@ export class TablesDB { * @param {string} params.databaseId - Database ID. * @param {string} params.tableId - Table ID. * @param {string} params.name - Table name. Max length: 128 chars. - * @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 {string[] | null} 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.rowSecurity - Enables configuring permissions for individual rows. A user needs one of row or table-level permissions to access a row. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} params.enabled - Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled. * @param {boolean} params.purge - When true, purge all cached list responses for this table as part of the update. Use this to force readers to see fresh data immediately instead of waiting for the cache TTL to expire. + * @param {string | null} params.description - Optional description for the table. * @throws {AppwriteException} * @returns {Promise<Models.Table>} */ @@ -2697,10 +2759,11 @@ export class TablesDB { databaseId: string; tableId: string; name?: string; - permissions?: string[]; + permissions?: string[] | null; rowSecurity?: boolean; enabled?: boolean; purge?: boolean; + description?: string | null; }): Promise<Models.Table>; /** * Update a table by its unique ID. @@ -2708,10 +2771,11 @@ export class TablesDB { * @param {string} databaseId - Database ID. * @param {string} tableId - Table ID. * @param {string} name - Table name. Max length: 128 chars. - * @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 {string[] | null} permissions - An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} rowSecurity - Enables configuring permissions for individual rows. A user needs one of row or table-level permissions to access a row. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} enabled - Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled. * @param {boolean} purge - When true, purge all cached list responses for this table as part of the update. Use this to force readers to see fresh data immediately instead of waiting for the cache TTL to expire. + * @param {string | null} description - Optional description for the table. * @throws {AppwriteException} * @returns {Promise<Models.Table>} * @deprecated Use the object parameter style method for a better developer experience. @@ -2720,10 +2784,11 @@ export class TablesDB { databaseId: string, tableId: string, name?: string, - permissions?: string[], + permissions?: string[] | null, rowSecurity?: boolean, enabled?: boolean, purge?: boolean, + description?: string | null, ): Promise<Models.Table>; updateTable( paramsOrFirst: @@ -2731,22 +2796,32 @@ export class TablesDB { databaseId: string; tableId: string; name?: string; - permissions?: string[]; + permissions?: string[] | null; rowSecurity?: boolean; enabled?: boolean; purge?: boolean; + description?: string | null; } | string, - ...rest: [string?, string?, string[]?, boolean?, boolean?, boolean?] + ...rest: [ + string?, + string?, + (string[] | null)?, + boolean?, + boolean?, + boolean?, + (string | null)?, + ] ): Promise<Models.Table> { let params: { databaseId: string; tableId: string; name?: string; - permissions?: string[]; + permissions?: string[] | null; rowSecurity?: boolean; enabled?: boolean; purge?: boolean; + description?: string | null; }; if ( @@ -2758,20 +2833,22 @@ export class TablesDB { databaseId: string; tableId: string; name?: string; - permissions?: string[]; + permissions?: string[] | null; rowSecurity?: boolean; enabled?: boolean; purge?: boolean; + description?: string | null; }; } else { params = { databaseId: paramsOrFirst as string, tableId: rest[0] as string, name: rest[1] as string, - permissions: rest[2] as string[], + permissions: rest[2] as string[] | null, rowSecurity: rest[3] as boolean, enabled: rest[4] as boolean, purge: rest[5] as boolean, + description: rest[6] as string | null, }; } @@ -2782,6 +2859,7 @@ export class TablesDB { const rowSecurity = params.rowSecurity; const enabled = params.enabled; const purge = params.purge; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -2812,6 +2890,9 @@ export class TablesDB { if (typeof purge !== 'undefined') { apiPayload['purge'] = purge; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -2832,6 +2913,7 @@ export class TablesDB { $permissions: [], databaseId: '', name: '', + description: '', enabled: true, rowSecurity: false, columns: [], @@ -2851,6 +2933,7 @@ export class TablesDB { $createdAt: '', $updatedAt: '', key: '', + description: '', type: '', status: '', error: '', @@ -3060,10 +3143,11 @@ 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 column is required. + * @param {number | bigint | null} params.min - Minimum value + * @param {number | bigint | null} params.max - Maximum value + * @param {number | bigint | null} params.xdefault - Default value. Cannot be set when column is required. * @param {boolean} params.array - Is column an array? + * @param {string} params.description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnBigint>} */ @@ -3072,10 +3156,11 @@ export class TablesDB { tableId: string; key: string; required: boolean; - min?: number | bigint; - max?: number | bigint; - xdefault?: number | bigint; + min?: number | bigint | null; + max?: number | bigint | null; + xdefault?: number | bigint | null; array?: boolean; + description?: string; }): Promise<Models.ColumnBigint>; /** * Create a bigint column. Optionally, minimum and maximum values can be provided. @@ -3085,10 +3170,11 @@ 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 column is required. + * @param {number | bigint | null} min - Minimum value + * @param {number | bigint | null} max - Maximum value + * @param {number | bigint | null} xdefault - Default value. Cannot be set when column is required. * @param {boolean} array - Is column an array? + * @param {string} description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnBigint>} * @deprecated Use the object parameter style method for a better developer experience. @@ -3098,10 +3184,11 @@ export class TablesDB { tableId: string, key: string, required: boolean, - min?: number | bigint, - max?: number | bigint, - xdefault?: number | bigint, + min?: number | bigint | null, + max?: number | bigint | null, + xdefault?: number | bigint | null, array?: boolean, + description?: string, ): Promise<Models.ColumnBigint>; createBigIntColumn( paramsOrFirst: @@ -3110,20 +3197,22 @@ export class TablesDB { tableId: string; key: string; required: boolean; - min?: number | bigint; - max?: number | bigint; - xdefault?: number | bigint; + min?: number | bigint | null; + max?: number | bigint | null; + xdefault?: number | bigint | null; array?: boolean; + description?: string; } | string, ...rest: [ string?, string?, boolean?, - (number | bigint)?, - (number | bigint)?, - (number | bigint)?, + (number | bigint | null)?, + (number | bigint | null)?, + (number | bigint | null)?, boolean?, + string?, ] ): Promise<Models.ColumnBigint> { let params: { @@ -3131,10 +3220,11 @@ export class TablesDB { tableId: string; key: string; required: boolean; - min?: number | bigint; - max?: number | bigint; - xdefault?: number | bigint; + min?: number | bigint | null; + max?: number | bigint | null; + xdefault?: number | bigint | null; array?: boolean; + description?: string; }; if ( @@ -3147,10 +3237,11 @@ export class TablesDB { tableId: string; key: string; required: boolean; - min?: number | bigint; - max?: number | bigint; - xdefault?: number | bigint; + min?: number | bigint | null; + max?: number | bigint | null; + xdefault?: number | bigint | null; array?: boolean; + description?: string; }; } else { params = { @@ -3158,10 +3249,11 @@ export class TablesDB { 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 | bigint | null, + max: rest[4] as number | bigint | null, + xdefault: rest[5] as number | bigint | null, array: rest[6] as boolean, + description: rest[7] as string, }; } @@ -3173,6 +3265,7 @@ export class TablesDB { const max = params.max; const xdefault = params.xdefault; const array = params.array; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -3214,6 +3307,9 @@ export class TablesDB { if (typeof array !== 'undefined') { apiPayload['array'] = array; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -3229,6 +3325,7 @@ export class TablesDB { columnBigint: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -3250,10 +3347,11 @@ 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 column is required. - * @param {number | bigint} params.min - Minimum value - * @param {number | bigint} params.max - Maximum value - * @param {string} params.newKey - New Column Key. + * @param {number | bigint | null} params.xdefault - Default value. Cannot be set when column is required. + * @param {number | bigint | null} params.min - Minimum value + * @param {number | bigint | null} params.max - Maximum value + * @param {string | null} params.newKey - New Column Key. + * @param {string | null} params.description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnBigint>} */ @@ -3262,10 +3360,11 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: number | bigint; - min?: number | bigint; - max?: number | bigint; - newKey?: string; + xdefault?: number | bigint | null; + min?: number | bigint | null; + max?: number | bigint | null; + newKey?: string | null; + description?: string | null; }): Promise<Models.ColumnBigint>; /** * Update a bigint column. Changing the `default` value will not update already existing rows. @@ -3275,10 +3374,11 @@ 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 column is required. - * @param {number | bigint} min - Minimum value - * @param {number | bigint} max - Maximum value - * @param {string} newKey - New Column Key. + * @param {number | bigint | null} xdefault - Default value. Cannot be set when column is required. + * @param {number | bigint | null} min - Minimum value + * @param {number | bigint | null} max - Maximum value + * @param {string | null} newKey - New Column Key. + * @param {string | null} description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnBigint>} * @deprecated Use the object parameter style method for a better developer experience. @@ -3288,10 +3388,11 @@ export class TablesDB { tableId: string, key: string, required: boolean, - xdefault?: number | bigint, - min?: number | bigint, - max?: number | bigint, - newKey?: string, + xdefault?: number | bigint | null, + min?: number | bigint | null, + max?: number | bigint | null, + newKey?: string | null, + description?: string | null, ): Promise<Models.ColumnBigint>; updateBigIntColumn( paramsOrFirst: @@ -3300,20 +3401,22 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: number | bigint; - min?: number | bigint; - max?: number | bigint; - newKey?: string; + xdefault?: number | bigint | null; + min?: number | bigint | null; + max?: number | bigint | null; + newKey?: string | null; + description?: string | null; } | string, ...rest: [ string?, string?, boolean?, - (number | bigint)?, - (number | bigint)?, - (number | bigint)?, - string?, + (number | bigint | null)?, + (number | bigint | null)?, + (number | bigint | null)?, + (string | null)?, + (string | null)?, ] ): Promise<Models.ColumnBigint> { let params: { @@ -3321,10 +3424,11 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: number | bigint; - min?: number | bigint; - max?: number | bigint; - newKey?: string; + xdefault?: number | bigint | null; + min?: number | bigint | null; + max?: number | bigint | null; + newKey?: string | null; + description?: string | null; }; if ( @@ -3337,10 +3441,11 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: number | bigint; - min?: number | bigint; - max?: number | bigint; - newKey?: string; + xdefault?: number | bigint | null; + min?: number | bigint | null; + max?: number | bigint | null; + newKey?: string | null; + description?: string | null; }; } else { params = { @@ -3348,10 +3453,11 @@ export class TablesDB { 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, - newKey: rest[6] as string, + xdefault: rest[3] as number | bigint | null, + min: rest[4] as number | bigint | null, + max: rest[5] as number | bigint | null, + newKey: rest[6] as string | null, + description: rest[7] as string | null, }; } @@ -3363,6 +3469,7 @@ export class TablesDB { const min = params.min; const max = params.max; const newKey = params.newKey; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -3408,6 +3515,9 @@ export class TablesDB { if (typeof newKey !== 'undefined') { apiPayload['newKey'] = newKey; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -3423,6 +3533,7 @@ export class TablesDB { columnBigint: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -3444,8 +3555,9 @@ export class TablesDB { * @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 {boolean} params.required - Is column required? - * @param {boolean} params.xdefault - Default value for column when not provided. Cannot be set when column is required. + * @param {boolean | null} params.xdefault - Default value for column when not provided. Cannot be set when column is required. * @param {boolean} params.array - Is column an array? + * @param {string} params.description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnBoolean>} */ @@ -3454,8 +3566,9 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: boolean; + xdefault?: boolean | null; array?: boolean; + description?: string; }): Promise<Models.ColumnBoolean>; /** * Create a boolean column. @@ -3465,8 +3578,9 @@ export class TablesDB { * @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 {boolean} required - Is column required? - * @param {boolean} xdefault - Default value for column when not provided. Cannot be set when column is required. + * @param {boolean | null} xdefault - Default value for column when not provided. Cannot be set when column is required. * @param {boolean} array - Is column an array? + * @param {string} description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnBoolean>} * @deprecated Use the object parameter style method for a better developer experience. @@ -3476,8 +3590,9 @@ export class TablesDB { tableId: string, key: string, required: boolean, - xdefault?: boolean, + xdefault?: boolean | null, array?: boolean, + description?: string, ): Promise<Models.ColumnBoolean>; createBooleanColumn( paramsOrFirst: @@ -3486,19 +3601,28 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: boolean; + xdefault?: boolean | null; array?: boolean; + description?: string; } | string, - ...rest: [string?, string?, boolean?, boolean?, boolean?] + ...rest: [ + string?, + string?, + boolean?, + (boolean | null)?, + boolean?, + string?, + ] ): Promise<Models.ColumnBoolean> { let params: { databaseId: string; tableId: string; key: string; required: boolean; - xdefault?: boolean; + xdefault?: boolean | null; array?: boolean; + description?: string; }; if ( @@ -3511,8 +3635,9 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: boolean; + xdefault?: boolean | null; array?: boolean; + description?: string; }; } else { params = { @@ -3520,8 +3645,9 @@ export class TablesDB { tableId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as boolean, + xdefault: rest[3] as boolean | null, array: rest[4] as boolean, + description: rest[5] as string, }; } @@ -3531,6 +3657,7 @@ export class TablesDB { const required = params.required; const xdefault = params.xdefault; const array = params.array; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -3567,6 +3694,9 @@ export class TablesDB { if (typeof array !== 'undefined') { apiPayload['array'] = array; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -3582,6 +3712,7 @@ export class TablesDB { columnBoolean: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -3602,8 +3733,9 @@ export class TablesDB { * @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 {boolean} params.required - Is column required? - * @param {boolean} params.xdefault - Default value for column when not provided. Cannot be set when column is required. - * @param {string} params.newKey - New Column Key. + * @param {boolean | null} params.xdefault - Default value for column when not provided. Cannot be set when column is required. + * @param {string | null} params.newKey - New Column Key. + * @param {string | null} params.description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnBoolean>} */ @@ -3612,8 +3744,9 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: boolean; - newKey?: string; + xdefault?: boolean | null; + newKey?: string | null; + description?: string | null; }): Promise<Models.ColumnBoolean>; /** * Update a boolean column. Changing the `default` value will not update already existing rows. @@ -3622,8 +3755,9 @@ export class TablesDB { * @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 {boolean} required - Is column required? - * @param {boolean} xdefault - Default value for column when not provided. Cannot be set when column is required. - * @param {string} newKey - New Column Key. + * @param {boolean | null} xdefault - Default value for column when not provided. Cannot be set when column is required. + * @param {string | null} newKey - New Column Key. + * @param {string | null} description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnBoolean>} * @deprecated Use the object parameter style method for a better developer experience. @@ -3633,8 +3767,9 @@ export class TablesDB { tableId: string, key: string, required: boolean, - xdefault?: boolean, - newKey?: string, + xdefault?: boolean | null, + newKey?: string | null, + description?: string | null, ): Promise<Models.ColumnBoolean>; updateBooleanColumn( paramsOrFirst: @@ -3643,19 +3778,28 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: boolean; - newKey?: string; + xdefault?: boolean | null; + newKey?: string | null; + description?: string | null; } | string, - ...rest: [string?, string?, boolean?, boolean?, string?] + ...rest: [ + string?, + string?, + boolean?, + (boolean | null)?, + (string | null)?, + (string | null)?, + ] ): Promise<Models.ColumnBoolean> { let params: { databaseId: string; tableId: string; key: string; required: boolean; - xdefault?: boolean; - newKey?: string; + xdefault?: boolean | null; + newKey?: string | null; + description?: string | null; }; if ( @@ -3668,8 +3812,9 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: boolean; - newKey?: string; + xdefault?: boolean | null; + newKey?: string | null; + description?: string | null; }; } else { params = { @@ -3677,8 +3822,9 @@ export class TablesDB { tableId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as boolean, - newKey: rest[4] as string, + xdefault: rest[3] as boolean | null, + newKey: rest[4] as string | null, + description: rest[5] as string | null, }; } @@ -3688,6 +3834,7 @@ export class TablesDB { const required = params.required; const xdefault = params.xdefault; const newKey = params.newKey; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -3727,6 +3874,9 @@ export class TablesDB { if (typeof newKey !== 'undefined') { apiPayload['newKey'] = newKey; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -3742,6 +3892,7 @@ export class TablesDB { columnBoolean: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -3762,8 +3913,9 @@ export class TablesDB { * @param {string} params.tableId - Table ID. * @param {string} params.key - Column Key. * @param {boolean} params.required - Is column required? - * @param {string} params.xdefault - Default value for the column in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Cannot be set when column is required. + * @param {string | null} params.xdefault - Default value for the column in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Cannot be set when column is required. * @param {boolean} params.array - Is column an array? + * @param {string} params.description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnDatetime>} */ @@ -3772,8 +3924,9 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; + description?: string; }): Promise<Models.ColumnDatetime>; /** * Create a date time column according to the ISO 8601 standard. @@ -3782,8 +3935,9 @@ export class TablesDB { * @param {string} tableId - Table ID. * @param {string} key - Column Key. * @param {boolean} required - Is column required? - * @param {string} xdefault - Default value for the column in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Cannot be set when column is required. + * @param {string | null} xdefault - Default value for the column in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Cannot be set when column is required. * @param {boolean} array - Is column an array? + * @param {string} description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnDatetime>} * @deprecated Use the object parameter style method for a better developer experience. @@ -3793,8 +3947,9 @@ export class TablesDB { tableId: string, key: string, required: boolean, - xdefault?: string, + xdefault?: string | null, array?: boolean, + description?: string, ): Promise<Models.ColumnDatetime>; createDatetimeColumn( paramsOrFirst: @@ -3803,19 +3958,28 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; + description?: string; } | string, - ...rest: [string?, string?, boolean?, string?, boolean?] + ...rest: [ + string?, + string?, + boolean?, + (string | null)?, + boolean?, + string?, + ] ): Promise<Models.ColumnDatetime> { let params: { databaseId: string; tableId: string; key: string; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; + description?: string; }; if ( @@ -3828,8 +3992,9 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; + description?: string; }; } else { params = { @@ -3837,8 +4002,9 @@ export class TablesDB { tableId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as string, + xdefault: rest[3] as string | null, array: rest[4] as boolean, + description: rest[5] as string, }; } @@ -3848,6 +4014,7 @@ export class TablesDB { const required = params.required; const xdefault = params.xdefault; const array = params.array; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -3884,6 +4051,9 @@ export class TablesDB { if (typeof array !== 'undefined') { apiPayload['array'] = array; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -3899,6 +4069,7 @@ export class TablesDB { columnDatetime: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -3919,8 +4090,9 @@ export class TablesDB { * @param {string} params.tableId - Table ID. * @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 {string} params.newKey - New Column Key. + * @param {string | null} params.xdefault - Default value for column when not provided. Cannot be set when column is required. + * @param {string | null} params.newKey - New Column Key. + * @param {string | null} params.description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnDatetime>} */ @@ -3929,8 +4101,9 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; }): Promise<Models.ColumnDatetime>; /** * Update a date time column. Changing the `default` value will not update already existing rows. @@ -3939,8 +4112,9 @@ export class TablesDB { * @param {string} tableId - Table ID. * @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 {string} newKey - New Column Key. + * @param {string | null} xdefault - Default value for column when not provided. Cannot be set when column is required. + * @param {string | null} newKey - New Column Key. + * @param {string | null} description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnDatetime>} * @deprecated Use the object parameter style method for a better developer experience. @@ -3950,8 +4124,9 @@ export class TablesDB { tableId: string, key: string, required: boolean, - xdefault?: string, - newKey?: string, + xdefault?: string | null, + newKey?: string | null, + description?: string | null, ): Promise<Models.ColumnDatetime>; updateDatetimeColumn( paramsOrFirst: @@ -3960,19 +4135,28 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; } | string, - ...rest: [string?, string?, boolean?, string?, string?] + ...rest: [ + string?, + string?, + boolean?, + (string | null)?, + (string | null)?, + (string | null)?, + ] ): Promise<Models.ColumnDatetime> { let params: { databaseId: string; tableId: string; key: string; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; }; if ( @@ -3985,8 +4169,9 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; }; } else { params = { @@ -3994,8 +4179,9 @@ export class TablesDB { tableId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as string, - newKey: rest[4] as string, + xdefault: rest[3] as string | null, + newKey: rest[4] as string | null, + description: rest[5] as string | null, }; } @@ -4005,6 +4191,7 @@ export class TablesDB { const required = params.required; const xdefault = params.xdefault; const newKey = params.newKey; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -4044,6 +4231,9 @@ export class TablesDB { if (typeof newKey !== 'undefined') { apiPayload['newKey'] = newKey; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -4059,6 +4249,7 @@ export class TablesDB { columnDatetime: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -4080,8 +4271,9 @@ export class TablesDB { * @param {string} params.tableId - Table ID. * @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 {string | null} params.xdefault - Default value for column when not provided. Cannot be set when column is required. * @param {boolean} params.array - Is column an array? + * @param {string} params.description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnEmail>} */ @@ -4090,8 +4282,9 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; + description?: string; }): Promise<Models.ColumnEmail>; /** * Create an email column. @@ -4101,8 +4294,9 @@ export class TablesDB { * @param {string} tableId - Table ID. * @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 {string | null} xdefault - Default value for column when not provided. Cannot be set when column is required. * @param {boolean} array - Is column an array? + * @param {string} description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnEmail>} * @deprecated Use the object parameter style method for a better developer experience. @@ -4112,8 +4306,9 @@ export class TablesDB { tableId: string, key: string, required: boolean, - xdefault?: string, + xdefault?: string | null, array?: boolean, + description?: string, ): Promise<Models.ColumnEmail>; createEmailColumn( paramsOrFirst: @@ -4122,19 +4317,28 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; + description?: string; } | string, - ...rest: [string?, string?, boolean?, string?, boolean?] + ...rest: [ + string?, + string?, + boolean?, + (string | null)?, + boolean?, + string?, + ] ): Promise<Models.ColumnEmail> { let params: { databaseId: string; tableId: string; key: string; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; + description?: string; }; if ( @@ -4147,8 +4351,9 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; + description?: string; }; } else { params = { @@ -4156,8 +4361,9 @@ export class TablesDB { tableId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as string, + xdefault: rest[3] as string | null, array: rest[4] as boolean, + description: rest[5] as string, }; } @@ -4167,6 +4373,7 @@ export class TablesDB { const required = params.required; const xdefault = params.xdefault; const array = params.array; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -4202,6 +4409,9 @@ export class TablesDB { if (typeof array !== 'undefined') { apiPayload['array'] = array; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -4217,6 +4427,7 @@ export class TablesDB { columnEmail: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -4239,8 +4450,9 @@ export class TablesDB { * @param {string} params.tableId - Table ID. * @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 {string} params.newKey - New Column Key. + * @param {string | null} params.xdefault - Default value for column when not provided. Cannot be set when column is required. + * @param {string | null} params.newKey - New Column Key. + * @param {string | null} params.description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnEmail>} */ @@ -4249,8 +4461,9 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; }): Promise<Models.ColumnEmail>; /** * Update an email column. Changing the `default` value will not update already existing rows. @@ -4260,8 +4473,9 @@ export class TablesDB { * @param {string} tableId - Table ID. * @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 {string} newKey - New Column Key. + * @param {string | null} xdefault - Default value for column when not provided. Cannot be set when column is required. + * @param {string | null} newKey - New Column Key. + * @param {string | null} description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnEmail>} * @deprecated Use the object parameter style method for a better developer experience. @@ -4271,8 +4485,9 @@ export class TablesDB { tableId: string, key: string, required: boolean, - xdefault?: string, - newKey?: string, + xdefault?: string | null, + newKey?: string | null, + description?: string | null, ): Promise<Models.ColumnEmail>; updateEmailColumn( paramsOrFirst: @@ -4281,19 +4496,28 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; } | string, - ...rest: [string?, string?, boolean?, string?, string?] + ...rest: [ + string?, + string?, + boolean?, + (string | null)?, + (string | null)?, + (string | null)?, + ] ): Promise<Models.ColumnEmail> { let params: { databaseId: string; tableId: string; key: string; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; }; if ( @@ -4306,8 +4530,9 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; }; } else { params = { @@ -4315,8 +4540,9 @@ export class TablesDB { tableId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as string, - newKey: rest[4] as string, + xdefault: rest[3] as string | null, + newKey: rest[4] as string | null, + description: rest[5] as string | null, }; } @@ -4326,6 +4552,7 @@ export class TablesDB { const required = params.required; const xdefault = params.xdefault; const newKey = params.newKey; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -4365,6 +4592,9 @@ export class TablesDB { if (typeof newKey !== 'undefined') { apiPayload['newKey'] = newKey; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -4380,6 +4610,7 @@ export class TablesDB { columnEmail: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -4402,8 +4633,9 @@ export class TablesDB { * @param {string} params.key - Column Key. * @param {string[]} params.elements - Array of enum values. * @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 {string | null} params.xdefault - Default value for column when not provided. Cannot be set when column is required. * @param {boolean} params.array - Is column an array? + * @param {string} params.description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnEnum>} */ @@ -4413,8 +4645,9 @@ export class TablesDB { key: string; elements: string[]; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; + description?: string; }): Promise<Models.ColumnEnum>; /** * Create an enumeration column. The `elements` param acts as a white-list of accepted values for this column. @@ -4424,8 +4657,9 @@ export class TablesDB { * @param {string} key - Column Key. * @param {string[]} elements - Array of enum values. * @param {boolean} required - Is column required? - * @param {string} xdefault - Default value for column when not provided. Cannot be set when column is required. + * @param {string | null} xdefault - Default value for column when not provided. Cannot be set when column is required. * @param {boolean} array - Is column an array? + * @param {string} description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnEnum>} * @deprecated Use the object parameter style method for a better developer experience. @@ -4436,8 +4670,9 @@ export class TablesDB { key: string, elements: string[], required: boolean, - xdefault?: string, + xdefault?: string | null, array?: boolean, + description?: string, ): Promise<Models.ColumnEnum>; createEnumColumn( paramsOrFirst: @@ -4447,11 +4682,20 @@ export class TablesDB { key: string; elements: string[]; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; + description?: string; } | string, - ...rest: [string?, string?, string[]?, boolean?, string?, boolean?] + ...rest: [ + string?, + string?, + string[]?, + boolean?, + (string | null)?, + boolean?, + string?, + ] ): Promise<Models.ColumnEnum> { let params: { databaseId: string; @@ -4459,8 +4703,9 @@ export class TablesDB { key: string; elements: string[]; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; + description?: string; }; if ( @@ -4474,8 +4719,9 @@ export class TablesDB { key: string; elements: string[]; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; + description?: string; }; } else { params = { @@ -4484,8 +4730,9 @@ export class TablesDB { key: rest[1] as string, elements: rest[2] as string[], required: rest[3] as boolean, - xdefault: rest[4] as string, + xdefault: rest[4] as string | null, array: rest[5] as boolean, + description: rest[6] as string, }; } @@ -4496,6 +4743,7 @@ export class TablesDB { const required = params.required; const xdefault = params.xdefault; const array = params.array; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -4539,6 +4787,9 @@ export class TablesDB { if (typeof array !== 'undefined') { apiPayload['array'] = array; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -4554,6 +4805,7 @@ export class TablesDB { columnEnum: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -4578,8 +4830,9 @@ export class TablesDB { * @param {string} params.key - Column Key. * @param {string[]} params.elements - Updated list of enum values. * @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 {string} params.newKey - New Column Key. + * @param {string | null} params.xdefault - Default value for column when not provided. Cannot be set when column is required. + * @param {string | null} params.newKey - New Column Key. + * @param {string | null} params.description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnEnum>} */ @@ -4589,8 +4842,9 @@ export class TablesDB { key: string; elements: string[]; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; }): Promise<Models.ColumnEnum>; /** * Update an enum column. Changing the `default` value will not update already existing rows. @@ -4601,8 +4855,9 @@ export class TablesDB { * @param {string} key - Column Key. * @param {string[]} elements - Updated list of enum values. * @param {boolean} required - Is column required? - * @param {string} xdefault - Default value for column when not provided. Cannot be set when column is required. - * @param {string} newKey - New Column Key. + * @param {string | null} xdefault - Default value for column when not provided. Cannot be set when column is required. + * @param {string | null} newKey - New Column Key. + * @param {string | null} description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnEnum>} * @deprecated Use the object parameter style method for a better developer experience. @@ -4613,8 +4868,9 @@ export class TablesDB { key: string, elements: string[], required: boolean, - xdefault?: string, - newKey?: string, + xdefault?: string | null, + newKey?: string | null, + description?: string | null, ): Promise<Models.ColumnEnum>; updateEnumColumn( paramsOrFirst: @@ -4624,11 +4880,20 @@ export class TablesDB { key: string; elements: string[]; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; } | string, - ...rest: [string?, string?, string[]?, boolean?, string?, string?] + ...rest: [ + string?, + string?, + string[]?, + boolean?, + (string | null)?, + (string | null)?, + (string | null)?, + ] ): Promise<Models.ColumnEnum> { let params: { databaseId: string; @@ -4636,8 +4901,9 @@ export class TablesDB { key: string; elements: string[]; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; }; if ( @@ -4651,8 +4917,9 @@ export class TablesDB { key: string; elements: string[]; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; }; } else { params = { @@ -4661,8 +4928,9 @@ export class TablesDB { key: rest[1] as string, elements: rest[2] as string[], required: rest[3] as boolean, - xdefault: rest[4] as string, - newKey: rest[5] as string, + xdefault: rest[4] as string | null, + newKey: rest[5] as string | null, + description: rest[6] as string | null, }; } @@ -4673,6 +4941,7 @@ export class TablesDB { const required = params.required; const xdefault = params.xdefault; const newKey = params.newKey; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -4720,6 +4989,9 @@ export class TablesDB { if (typeof newKey !== 'undefined') { apiPayload['newKey'] = newKey; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -4735,6 +5007,7 @@ export class TablesDB { columnEnum: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -4758,10 +5031,11 @@ 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 | null} params.min - Minimum value + * @param {number | null} params.max - Maximum value + * @param {number | null} params.xdefault - Default value. Cannot be set when required. * @param {boolean} params.array - Is column an array? + * @param {string} params.description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnFloat>} */ @@ -4770,10 +5044,11 @@ export class TablesDB { tableId: string; key: string; required: boolean; - min?: number; - max?: number; - xdefault?: number; + min?: number | null; + max?: number | null; + xdefault?: number | null; array?: boolean; + description?: string; }): Promise<Models.ColumnFloat>; /** * Create a float column. Optionally, minimum and maximum values can be provided. @@ -4783,10 +5058,11 @@ 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 | null} min - Minimum value + * @param {number | null} max - Maximum value + * @param {number | null} xdefault - Default value. Cannot be set when required. * @param {boolean} array - Is column an array? + * @param {string} description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnFloat>} * @deprecated Use the object parameter style method for a better developer experience. @@ -4796,10 +5072,11 @@ export class TablesDB { tableId: string, key: string, required: boolean, - min?: number, - max?: number, - xdefault?: number, + min?: number | null, + max?: number | null, + xdefault?: number | null, array?: boolean, + description?: string, ): Promise<Models.ColumnFloat>; createFloatColumn( paramsOrFirst: @@ -4808,20 +5085,22 @@ export class TablesDB { tableId: string; key: string; required: boolean; - min?: number; - max?: number; - xdefault?: number; + min?: number | null; + max?: number | null; + xdefault?: number | null; array?: boolean; + description?: string; } | string, ...rest: [ string?, string?, boolean?, - number?, - number?, - number?, + (number | null)?, + (number | null)?, + (number | null)?, boolean?, + string?, ] ): Promise<Models.ColumnFloat> { let params: { @@ -4829,10 +5108,11 @@ export class TablesDB { tableId: string; key: string; required: boolean; - min?: number; - max?: number; - xdefault?: number; + min?: number | null; + max?: number | null; + xdefault?: number | null; array?: boolean; + description?: string; }; if ( @@ -4845,10 +5125,11 @@ export class TablesDB { tableId: string; key: string; required: boolean; - min?: number; - max?: number; - xdefault?: number; + min?: number | null; + max?: number | null; + xdefault?: number | null; array?: boolean; + description?: string; }; } else { params = { @@ -4856,10 +5137,11 @@ export class TablesDB { 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 | null, + max: rest[4] as number | null, + xdefault: rest[5] as number | null, array: rest[6] as boolean, + description: rest[7] as string, }; } @@ -4871,6 +5153,7 @@ export class TablesDB { const max = params.max; const xdefault = params.xdefault; const array = params.array; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -4912,6 +5195,9 @@ export class TablesDB { if (typeof array !== 'undefined') { apiPayload['array'] = array; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -4927,6 +5213,7 @@ export class TablesDB { columnFloat: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -4948,10 +5235,11 @@ 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 {string} params.newKey - New Column Key. + * @param {number | null} params.xdefault - Default value. Cannot be set when required. + * @param {number | null} params.min - Minimum value + * @param {number | null} params.max - Maximum value + * @param {string | null} params.newKey - New Column Key. + * @param {string | null} params.description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnFloat>} */ @@ -4960,10 +5248,11 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: number; - min?: number; - max?: number; - newKey?: string; + xdefault?: number | null; + min?: number | null; + max?: number | null; + newKey?: string | null; + description?: string | null; }): Promise<Models.ColumnFloat>; /** * Update a float column. Changing the `default` value will not update already existing rows. @@ -4973,10 +5262,11 @@ 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 {string} newKey - New Column Key. + * @param {number | null} xdefault - Default value. Cannot be set when required. + * @param {number | null} min - Minimum value + * @param {number | null} max - Maximum value + * @param {string | null} newKey - New Column Key. + * @param {string | null} description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnFloat>} * @deprecated Use the object parameter style method for a better developer experience. @@ -4986,10 +5276,11 @@ export class TablesDB { tableId: string, key: string, required: boolean, - xdefault?: number, - min?: number, - max?: number, - newKey?: string, + xdefault?: number | null, + min?: number | null, + max?: number | null, + newKey?: string | null, + description?: string | null, ): Promise<Models.ColumnFloat>; updateFloatColumn( paramsOrFirst: @@ -4998,20 +5289,22 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: number; - min?: number; - max?: number; - newKey?: string; + xdefault?: number | null; + min?: number | null; + max?: number | null; + newKey?: string | null; + description?: string | null; } | string, ...rest: [ string?, string?, boolean?, - number?, - number?, - number?, - string?, + (number | null)?, + (number | null)?, + (number | null)?, + (string | null)?, + (string | null)?, ] ): Promise<Models.ColumnFloat> { let params: { @@ -5019,10 +5312,11 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: number; - min?: number; - max?: number; - newKey?: string; + xdefault?: number | null; + min?: number | null; + max?: number | null; + newKey?: string | null; + description?: string | null; }; if ( @@ -5035,10 +5329,11 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: number; - min?: number; - max?: number; - newKey?: string; + xdefault?: number | null; + min?: number | null; + max?: number | null; + newKey?: string | null; + description?: string | null; }; } else { params = { @@ -5046,10 +5341,11 @@ export class TablesDB { 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, - newKey: rest[6] as string, + xdefault: rest[3] as number | null, + min: rest[4] as number | null, + max: rest[5] as number | null, + newKey: rest[6] as string | null, + description: rest[7] as string | null, }; } @@ -5061,6 +5357,7 @@ export class TablesDB { const min = params.min; const max = params.max; const newKey = params.newKey; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -5106,6 +5403,9 @@ export class TablesDB { if (typeof newKey !== 'undefined') { apiPayload['newKey'] = newKey; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -5121,6 +5421,7 @@ export class TablesDB { columnFloat: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -5142,10 +5443,11 @@ 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 column is required. + * @param {number | bigint | null} params.min - Minimum value + * @param {number | bigint | null} params.max - Maximum value + * @param {number | bigint | null} params.xdefault - Default value. Cannot be set when column is required. * @param {boolean} params.array - Is column an array? + * @param {string} params.description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnInteger>} */ @@ -5154,10 +5456,11 @@ export class TablesDB { tableId: string; key: string; required: boolean; - min?: number | bigint; - max?: number | bigint; - xdefault?: number | bigint; + min?: number | bigint | null; + max?: number | bigint | null; + xdefault?: number | bigint | null; array?: boolean; + description?: string; }): Promise<Models.ColumnInteger>; /** * Create an integer column. Optionally, minimum and maximum values can be provided. @@ -5167,10 +5470,11 @@ 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 column is required. + * @param {number | bigint | null} min - Minimum value + * @param {number | bigint | null} max - Maximum value + * @param {number | bigint | null} xdefault - Default value. Cannot be set when column is required. * @param {boolean} array - Is column an array? + * @param {string} description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnInteger>} * @deprecated Use the object parameter style method for a better developer experience. @@ -5180,10 +5484,11 @@ export class TablesDB { tableId: string, key: string, required: boolean, - min?: number | bigint, - max?: number | bigint, - xdefault?: number | bigint, + min?: number | bigint | null, + max?: number | bigint | null, + xdefault?: number | bigint | null, array?: boolean, + description?: string, ): Promise<Models.ColumnInteger>; createIntegerColumn( paramsOrFirst: @@ -5192,20 +5497,22 @@ export class TablesDB { tableId: string; key: string; required: boolean; - min?: number | bigint; - max?: number | bigint; - xdefault?: number | bigint; + min?: number | bigint | null; + max?: number | bigint | null; + xdefault?: number | bigint | null; array?: boolean; + description?: string; } | string, ...rest: [ string?, string?, boolean?, - (number | bigint)?, - (number | bigint)?, - (number | bigint)?, + (number | bigint | null)?, + (number | bigint | null)?, + (number | bigint | null)?, boolean?, + string?, ] ): Promise<Models.ColumnInteger> { let params: { @@ -5213,10 +5520,11 @@ export class TablesDB { tableId: string; key: string; required: boolean; - min?: number | bigint; - max?: number | bigint; - xdefault?: number | bigint; + min?: number | bigint | null; + max?: number | bigint | null; + xdefault?: number | bigint | null; array?: boolean; + description?: string; }; if ( @@ -5229,10 +5537,11 @@ export class TablesDB { tableId: string; key: string; required: boolean; - min?: number | bigint; - max?: number | bigint; - xdefault?: number | bigint; + min?: number | bigint | null; + max?: number | bigint | null; + xdefault?: number | bigint | null; array?: boolean; + description?: string; }; } else { params = { @@ -5240,10 +5549,11 @@ export class TablesDB { 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 | bigint | null, + max: rest[4] as number | bigint | null, + xdefault: rest[5] as number | bigint | null, array: rest[6] as boolean, + description: rest[7] as string, }; } @@ -5255,6 +5565,7 @@ export class TablesDB { const max = params.max; const xdefault = params.xdefault; const array = params.array; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -5297,6 +5608,9 @@ export class TablesDB { if (typeof array !== 'undefined') { apiPayload['array'] = array; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -5312,6 +5626,7 @@ export class TablesDB { columnInteger: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -5333,10 +5648,11 @@ 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 column is required. - * @param {number | bigint} params.min - Minimum value - * @param {number | bigint} params.max - Maximum value - * @param {string} params.newKey - New Column Key. + * @param {number | bigint | null} params.xdefault - Default value. Cannot be set when column is required. + * @param {number | bigint | null} params.min - Minimum value + * @param {number | bigint | null} params.max - Maximum value + * @param {string | null} params.newKey - New Column Key. + * @param {string | null} params.description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnInteger>} */ @@ -5345,10 +5661,11 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: number | bigint; - min?: number | bigint; - max?: number | bigint; - newKey?: string; + xdefault?: number | bigint | null; + min?: number | bigint | null; + max?: number | bigint | null; + newKey?: string | null; + description?: string | null; }): Promise<Models.ColumnInteger>; /** * Update an integer column. Changing the `default` value will not update already existing rows. @@ -5358,10 +5675,11 @@ 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 column is required. - * @param {number | bigint} min - Minimum value - * @param {number | bigint} max - Maximum value - * @param {string} newKey - New Column Key. + * @param {number | bigint | null} xdefault - Default value. Cannot be set when column is required. + * @param {number | bigint | null} min - Minimum value + * @param {number | bigint | null} max - Maximum value + * @param {string | null} newKey - New Column Key. + * @param {string | null} description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnInteger>} * @deprecated Use the object parameter style method for a better developer experience. @@ -5371,10 +5689,11 @@ export class TablesDB { tableId: string, key: string, required: boolean, - xdefault?: number | bigint, - min?: number | bigint, - max?: number | bigint, - newKey?: string, + xdefault?: number | bigint | null, + min?: number | bigint | null, + max?: number | bigint | null, + newKey?: string | null, + description?: string | null, ): Promise<Models.ColumnInteger>; updateIntegerColumn( paramsOrFirst: @@ -5383,20 +5702,22 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: number | bigint; - min?: number | bigint; - max?: number | bigint; - newKey?: string; + xdefault?: number | bigint | null; + min?: number | bigint | null; + max?: number | bigint | null; + newKey?: string | null; + description?: string | null; } | string, ...rest: [ string?, string?, boolean?, - (number | bigint)?, - (number | bigint)?, - (number | bigint)?, - string?, + (number | bigint | null)?, + (number | bigint | null)?, + (number | bigint | null)?, + (string | null)?, + (string | null)?, ] ): Promise<Models.ColumnInteger> { let params: { @@ -5404,10 +5725,11 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: number | bigint; - min?: number | bigint; - max?: number | bigint; - newKey?: string; + xdefault?: number | bigint | null; + min?: number | bigint | null; + max?: number | bigint | null; + newKey?: string | null; + description?: string | null; }; if ( @@ -5420,10 +5742,11 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: number | bigint; - min?: number | bigint; - max?: number | bigint; - newKey?: string; + xdefault?: number | bigint | null; + min?: number | bigint | null; + max?: number | bigint | null; + newKey?: string | null; + description?: string | null; }; } else { params = { @@ -5431,10 +5754,11 @@ export class TablesDB { 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, - newKey: rest[6] as string, + xdefault: rest[3] as number | bigint | null, + min: rest[4] as number | bigint | null, + max: rest[5] as number | bigint | null, + newKey: rest[6] as string | null, + description: rest[7] as string | null, }; } @@ -5446,6 +5770,7 @@ export class TablesDB { const min = params.min; const max = params.max; const newKey = params.newKey; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -5491,6 +5816,9 @@ export class TablesDB { if (typeof newKey !== 'undefined') { apiPayload['newKey'] = newKey; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -5506,6 +5834,7 @@ export class TablesDB { columnInteger: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -5527,8 +5856,9 @@ export class TablesDB { * @param {string} params.tableId - Table ID. * @param {string} params.key - Column Key. * @param {boolean} params.required - Is column required? - * @param {string} params.xdefault - Default value. Cannot be set when column is required. + * @param {string | null} params.xdefault - Default value. Cannot be set when column is required. * @param {boolean} params.array - Is column an array? + * @param {string} params.description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnIp>} */ @@ -5537,8 +5867,9 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; + description?: string; }): Promise<Models.ColumnIp>; /** * Create IP address column. @@ -5548,8 +5879,9 @@ export class TablesDB { * @param {string} tableId - Table ID. * @param {string} key - Column Key. * @param {boolean} required - Is column required? - * @param {string} xdefault - Default value. Cannot be set when column is required. + * @param {string | null} xdefault - Default value. Cannot be set when column is required. * @param {boolean} array - Is column an array? + * @param {string} description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnIp>} * @deprecated Use the object parameter style method for a better developer experience. @@ -5559,8 +5891,9 @@ export class TablesDB { tableId: string, key: string, required: boolean, - xdefault?: string, + xdefault?: string | null, array?: boolean, + description?: string, ): Promise<Models.ColumnIp>; createIpColumn( paramsOrFirst: @@ -5569,19 +5902,28 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; + description?: string; } | string, - ...rest: [string?, string?, boolean?, string?, boolean?] + ...rest: [ + string?, + string?, + boolean?, + (string | null)?, + boolean?, + string?, + ] ): Promise<Models.ColumnIp> { let params: { databaseId: string; tableId: string; key: string; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; + description?: string; }; if ( @@ -5594,8 +5936,9 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; + description?: string; }; } else { params = { @@ -5603,8 +5946,9 @@ export class TablesDB { tableId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as string, + xdefault: rest[3] as string | null, array: rest[4] as boolean, + description: rest[5] as string, }; } @@ -5614,6 +5958,7 @@ export class TablesDB { const required = params.required; const xdefault = params.xdefault; const array = params.array; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -5649,6 +5994,9 @@ export class TablesDB { if (typeof array !== 'undefined') { apiPayload['array'] = array; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -5664,6 +6012,7 @@ export class TablesDB { columnIp: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -5686,8 +6035,9 @@ export class TablesDB { * @param {string} params.tableId - Table ID. * @param {string} params.key - Column Key. * @param {boolean} params.required - Is column required? - * @param {string} params.xdefault - Default value. Cannot be set when column is required. - * @param {string} params.newKey - New Column Key. + * @param {string | null} params.xdefault - Default value. Cannot be set when column is required. + * @param {string | null} params.newKey - New Column Key. + * @param {string | null} params.description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnIp>} */ @@ -5696,8 +6046,9 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; }): Promise<Models.ColumnIp>; /** * Update an ip column. Changing the `default` value will not update already existing rows. @@ -5707,8 +6058,9 @@ export class TablesDB { * @param {string} tableId - Table ID. * @param {string} key - Column Key. * @param {boolean} required - Is column required? - * @param {string} xdefault - Default value. Cannot be set when column is required. - * @param {string} newKey - New Column Key. + * @param {string | null} xdefault - Default value. Cannot be set when column is required. + * @param {string | null} newKey - New Column Key. + * @param {string | null} description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnIp>} * @deprecated Use the object parameter style method for a better developer experience. @@ -5718,8 +6070,9 @@ export class TablesDB { tableId: string, key: string, required: boolean, - xdefault?: string, - newKey?: string, + xdefault?: string | null, + newKey?: string | null, + description?: string | null, ): Promise<Models.ColumnIp>; updateIpColumn( paramsOrFirst: @@ -5728,19 +6081,28 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; } | string, - ...rest: [string?, string?, boolean?, string?, string?] + ...rest: [ + string?, + string?, + boolean?, + (string | null)?, + (string | null)?, + (string | null)?, + ] ): Promise<Models.ColumnIp> { let params: { databaseId: string; tableId: string; key: string; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; }; if ( @@ -5753,8 +6115,9 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; }; } else { params = { @@ -5762,8 +6125,9 @@ export class TablesDB { tableId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as string, - newKey: rest[4] as string, + xdefault: rest[3] as string | null, + newKey: rest[4] as string | null, + description: rest[5] as string | null, }; } @@ -5773,6 +6137,7 @@ export class TablesDB { const required = params.required; const xdefault = params.xdefault; const newKey = params.newKey; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -5812,6 +6177,9 @@ export class TablesDB { if (typeof newKey !== 'undefined') { apiPayload['newKey'] = newKey; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -5827,6 +6195,7 @@ export class TablesDB { columnIp: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -5848,7 +6217,8 @@ export class TablesDB { * @param {string} params.tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} params.key - Column Key. * @param {boolean} params.required - Is column required? - * @param {any[][]} params.xdefault - Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when column is required. + * @param {any[][] | null} params.xdefault - Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when column is required. + * @param {string} params.description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnLine>} */ @@ -5857,7 +6227,8 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: any[][]; + xdefault?: any[][] | null; + description?: string; }): Promise<Models.ColumnLine>; /** * Create a geometric line column. @@ -5866,7 +6237,8 @@ export class TablesDB { * @param {string} tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} key - Column Key. * @param {boolean} required - Is column required? - * @param {any[][]} xdefault - Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when column is required. + * @param {any[][] | null} xdefault - Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when column is required. + * @param {string} description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnLine>} * @deprecated Use the object parameter style method for a better developer experience. @@ -5876,7 +6248,8 @@ export class TablesDB { tableId: string, key: string, required: boolean, - xdefault?: any[][], + xdefault?: any[][] | null, + description?: string, ): Promise<Models.ColumnLine>; createLineColumn( paramsOrFirst: @@ -5885,17 +6258,19 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: any[][]; + xdefault?: any[][] | null; + description?: string; } | string, - ...rest: [string?, string?, boolean?, any[][]?] + ...rest: [string?, string?, boolean?, (any[][] | null)?, string?] ): Promise<Models.ColumnLine> { let params: { databaseId: string; tableId: string; key: string; required: boolean; - xdefault?: any[][]; + xdefault?: any[][] | null; + description?: string; }; if ( @@ -5908,7 +6283,8 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: any[][]; + xdefault?: any[][] | null; + description?: string; }; } else { params = { @@ -5916,7 +6292,8 @@ export class TablesDB { tableId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as any[][], + xdefault: rest[3] as any[][] | null, + description: rest[4] as string, }; } @@ -5925,6 +6302,7 @@ export class TablesDB { const key = params.key; const required = params.required; const xdefault = params.xdefault; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -5957,6 +6335,9 @@ export class TablesDB { if (typeof xdefault !== 'undefined') { apiPayload['default'] = xdefault; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -5972,6 +6353,7 @@ export class TablesDB { columnLine: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -5992,8 +6374,9 @@ export class TablesDB { * @param {string} params.tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} params.key - Column Key. * @param {boolean} params.required - Is column required? - * @param {any[][]} params.xdefault - Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when column is required. - * @param {string} params.newKey - New Column Key. + * @param {any[][] | null} params.xdefault - Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when column is required. + * @param {string | null} params.newKey - New Column Key. + * @param {string | null} params.description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnLine>} */ @@ -6002,8 +6385,9 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: any[][]; - newKey?: string; + xdefault?: any[][] | null; + newKey?: string | null; + description?: string | null; }): Promise<Models.ColumnLine>; /** * Update a line column. Changing the `default` value will not update already existing rows. @@ -6012,8 +6396,9 @@ export class TablesDB { * @param {string} tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} key - Column Key. * @param {boolean} required - Is column required? - * @param {any[][]} xdefault - Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when column is required. - * @param {string} newKey - New Column Key. + * @param {any[][] | null} xdefault - Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when column is required. + * @param {string | null} newKey - New Column Key. + * @param {string | null} description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnLine>} * @deprecated Use the object parameter style method for a better developer experience. @@ -6023,8 +6408,9 @@ export class TablesDB { tableId: string, key: string, required: boolean, - xdefault?: any[][], - newKey?: string, + xdefault?: any[][] | null, + newKey?: string | null, + description?: string | null, ): Promise<Models.ColumnLine>; updateLineColumn( paramsOrFirst: @@ -6033,19 +6419,28 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: any[][]; - newKey?: string; + xdefault?: any[][] | null; + newKey?: string | null; + description?: string | null; } | string, - ...rest: [string?, string?, boolean?, any[][]?, string?] + ...rest: [ + string?, + string?, + boolean?, + (any[][] | null)?, + (string | null)?, + (string | null)?, + ] ): Promise<Models.ColumnLine> { let params: { databaseId: string; tableId: string; key: string; required: boolean; - xdefault?: any[][]; - newKey?: string; + xdefault?: any[][] | null; + newKey?: string | null; + description?: string | null; }; if ( @@ -6058,8 +6453,9 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: any[][]; - newKey?: string; + xdefault?: any[][] | null; + newKey?: string | null; + description?: string | null; }; } else { params = { @@ -6067,8 +6463,9 @@ export class TablesDB { tableId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as any[][], - newKey: rest[4] as string, + xdefault: rest[3] as any[][] | null, + newKey: rest[4] as string | null, + description: rest[5] as string | null, }; } @@ -6078,6 +6475,7 @@ export class TablesDB { const required = params.required; const xdefault = params.xdefault; const newKey = params.newKey; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -6112,6 +6510,9 @@ export class TablesDB { if (typeof newKey !== 'undefined') { apiPayload['newKey'] = newKey; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -6127,6 +6528,7 @@ export class TablesDB { columnLine: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -6148,9 +6550,10 @@ export class TablesDB { * @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 {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 {string | null} params.xdefault - Default value for column when not provided. Cannot be set when column is required. * @param {boolean} params.array - Is column an array? * @param {boolean} params.encrypt - Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried. + * @param {string} params.description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnLongtext>} */ @@ -6159,9 +6562,10 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; encrypt?: boolean; + description?: string; }): Promise<Models.ColumnLongtext>; /** * Create a longtext column. @@ -6171,9 +6575,10 @@ export class TablesDB { * @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 {boolean} required - Is column required? - * @param {string} xdefault - Default value for column when not provided. Cannot be set when column is required. + * @param {string | null} xdefault - Default value for column when not provided. Cannot be set when column is required. * @param {boolean} array - Is column an array? * @param {boolean} encrypt - Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried. + * @param {string} description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnLongtext>} * @deprecated Use the object parameter style method for a better developer experience. @@ -6183,9 +6588,10 @@ export class TablesDB { tableId: string, key: string, required: boolean, - xdefault?: string, + xdefault?: string | null, array?: boolean, encrypt?: boolean, + description?: string, ): Promise<Models.ColumnLongtext>; createLongtextColumn( paramsOrFirst: @@ -6194,21 +6600,31 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; encrypt?: boolean; + description?: string; } | string, - ...rest: [string?, string?, boolean?, string?, boolean?, boolean?] + ...rest: [ + string?, + string?, + boolean?, + (string | null)?, + boolean?, + boolean?, + string?, + ] ): Promise<Models.ColumnLongtext> { let params: { databaseId: string; tableId: string; key: string; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; encrypt?: boolean; + description?: string; }; if ( @@ -6221,9 +6637,10 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; encrypt?: boolean; + description?: string; }; } else { params = { @@ -6231,9 +6648,10 @@ export class TablesDB { tableId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as string, + xdefault: rest[3] as string | null, array: rest[4] as boolean, encrypt: rest[5] as boolean, + description: rest[6] as string, }; } @@ -6244,6 +6662,7 @@ export class TablesDB { const xdefault = params.xdefault; const array = params.array; const encrypt = params.encrypt; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -6283,6 +6702,9 @@ export class TablesDB { if (typeof encrypt !== 'undefined') { apiPayload['encrypt'] = encrypt; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -6298,6 +6720,7 @@ export class TablesDB { columnLongtext: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -6319,8 +6742,9 @@ export class TablesDB { * @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 {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 {string} params.newKey - New Column Key. + * @param {string | null} params.xdefault - Default value for column when not provided. Cannot be set when column is required. + * @param {string | null} params.newKey - New Column Key. + * @param {string | null} params.description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnLongtext>} */ @@ -6329,8 +6753,9 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; }): Promise<Models.ColumnLongtext>; /** * Update a longtext column. Changing the `default` value will not update already existing rows. @@ -6340,8 +6765,9 @@ export class TablesDB { * @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 {boolean} required - Is column required? - * @param {string} xdefault - Default value for column when not provided. Cannot be set when column is required. - * @param {string} newKey - New Column Key. + * @param {string | null} xdefault - Default value for column when not provided. Cannot be set when column is required. + * @param {string | null} newKey - New Column Key. + * @param {string | null} description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnLongtext>} * @deprecated Use the object parameter style method for a better developer experience. @@ -6351,8 +6777,9 @@ export class TablesDB { tableId: string, key: string, required: boolean, - xdefault?: string, - newKey?: string, + xdefault?: string | null, + newKey?: string | null, + description?: string | null, ): Promise<Models.ColumnLongtext>; updateLongtextColumn( paramsOrFirst: @@ -6361,19 +6788,28 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; } | string, - ...rest: [string?, string?, boolean?, string?, string?] + ...rest: [ + string?, + string?, + boolean?, + (string | null)?, + (string | null)?, + (string | null)?, + ] ): Promise<Models.ColumnLongtext> { let params: { databaseId: string; tableId: string; key: string; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; }; if ( @@ -6386,8 +6822,9 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; }; } else { params = { @@ -6395,8 +6832,9 @@ export class TablesDB { tableId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as string, - newKey: rest[4] as string, + xdefault: rest[3] as string | null, + newKey: rest[4] as string | null, + description: rest[5] as string | null, }; } @@ -6406,6 +6844,7 @@ export class TablesDB { const required = params.required; const xdefault = params.xdefault; const newKey = params.newKey; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -6445,6 +6884,9 @@ export class TablesDB { if (typeof newKey !== 'undefined') { apiPayload['newKey'] = newKey; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -6460,6 +6902,7 @@ export class TablesDB { columnLongtext: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -6481,9 +6924,10 @@ export class TablesDB { * @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 {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 {string | null} params.xdefault - Default value for column when not provided. Cannot be set when column is required. * @param {boolean} params.array - Is column an array? * @param {boolean} params.encrypt - Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried. + * @param {string} params.description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnMediumtext>} */ @@ -6492,9 +6936,10 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; encrypt?: boolean; + description?: string; }): Promise<Models.ColumnMediumtext>; /** * Create a mediumtext column. @@ -6504,9 +6949,10 @@ export class TablesDB { * @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 {boolean} required - Is column required? - * @param {string} xdefault - Default value for column when not provided. Cannot be set when column is required. + * @param {string | null} xdefault - Default value for column when not provided. Cannot be set when column is required. * @param {boolean} array - Is column an array? * @param {boolean} encrypt - Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried. + * @param {string} description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnMediumtext>} * @deprecated Use the object parameter style method for a better developer experience. @@ -6516,9 +6962,10 @@ export class TablesDB { tableId: string, key: string, required: boolean, - xdefault?: string, + xdefault?: string | null, array?: boolean, encrypt?: boolean, + description?: string, ): Promise<Models.ColumnMediumtext>; createMediumtextColumn( paramsOrFirst: @@ -6527,21 +6974,31 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; encrypt?: boolean; + description?: string; } | string, - ...rest: [string?, string?, boolean?, string?, boolean?, boolean?] + ...rest: [ + string?, + string?, + boolean?, + (string | null)?, + boolean?, + boolean?, + string?, + ] ): Promise<Models.ColumnMediumtext> { let params: { databaseId: string; tableId: string; key: string; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; encrypt?: boolean; + description?: string; }; if ( @@ -6554,9 +7011,10 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; encrypt?: boolean; + description?: string; }; } else { params = { @@ -6564,9 +7022,10 @@ export class TablesDB { tableId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as string, + xdefault: rest[3] as string | null, array: rest[4] as boolean, encrypt: rest[5] as boolean, + description: rest[6] as string, }; } @@ -6577,6 +7036,7 @@ export class TablesDB { const xdefault = params.xdefault; const array = params.array; const encrypt = params.encrypt; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -6616,6 +7076,9 @@ export class TablesDB { if (typeof encrypt !== 'undefined') { apiPayload['encrypt'] = encrypt; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -6631,6 +7094,7 @@ export class TablesDB { columnMediumtext: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -6652,8 +7116,9 @@ export class TablesDB { * @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 {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 {string} params.newKey - New Column Key. + * @param {string | null} params.xdefault - Default value for column when not provided. Cannot be set when column is required. + * @param {string | null} params.newKey - New Column Key. + * @param {string | null} params.description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnMediumtext>} */ @@ -6662,8 +7127,9 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; }): Promise<Models.ColumnMediumtext>; /** * Update a mediumtext column. Changing the `default` value will not update already existing rows. @@ -6673,8 +7139,9 @@ export class TablesDB { * @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 {boolean} required - Is column required? - * @param {string} xdefault - Default value for column when not provided. Cannot be set when column is required. - * @param {string} newKey - New Column Key. + * @param {string | null} xdefault - Default value for column when not provided. Cannot be set when column is required. + * @param {string | null} newKey - New Column Key. + * @param {string | null} description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnMediumtext>} * @deprecated Use the object parameter style method for a better developer experience. @@ -6684,8 +7151,9 @@ export class TablesDB { tableId: string, key: string, required: boolean, - xdefault?: string, - newKey?: string, + xdefault?: string | null, + newKey?: string | null, + description?: string | null, ): Promise<Models.ColumnMediumtext>; updateMediumtextColumn( paramsOrFirst: @@ -6694,19 +7162,28 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; } | string, - ...rest: [string?, string?, boolean?, string?, string?] + ...rest: [ + string?, + string?, + boolean?, + (string | null)?, + (string | null)?, + (string | null)?, + ] ): Promise<Models.ColumnMediumtext> { let params: { databaseId: string; tableId: string; key: string; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; }; if ( @@ -6719,8 +7196,9 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; }; } else { params = { @@ -6728,8 +7206,9 @@ export class TablesDB { tableId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as string, - newKey: rest[4] as string, + xdefault: rest[3] as string | null, + newKey: rest[4] as string | null, + description: rest[5] as string | null, }; } @@ -6739,6 +7218,7 @@ export class TablesDB { const required = params.required; const xdefault = params.xdefault; const newKey = params.newKey; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -6778,6 +7258,9 @@ export class TablesDB { if (typeof newKey !== 'undefined') { apiPayload['newKey'] = newKey; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -6793,6 +7276,7 @@ export class TablesDB { columnMediumtext: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -6813,7 +7297,8 @@ export class TablesDB { * @param {string} params.tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} params.key - Column Key. * @param {boolean} params.required - Is column required? - * @param {number[]} params.xdefault - Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required. + * @param {number[] | null} params.xdefault - Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required. + * @param {string} params.description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnPoint>} */ @@ -6822,7 +7307,8 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: number[]; + xdefault?: number[] | null; + description?: string; }): Promise<Models.ColumnPoint>; /** * Create a geometric point column. @@ -6831,7 +7317,8 @@ export class TablesDB { * @param {string} tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} key - Column Key. * @param {boolean} required - Is column required? - * @param {number[]} xdefault - Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required. + * @param {number[] | null} xdefault - Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required. + * @param {string} description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnPoint>} * @deprecated Use the object parameter style method for a better developer experience. @@ -6841,7 +7328,8 @@ export class TablesDB { tableId: string, key: string, required: boolean, - xdefault?: number[], + xdefault?: number[] | null, + description?: string, ): Promise<Models.ColumnPoint>; createPointColumn( paramsOrFirst: @@ -6850,17 +7338,19 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: number[]; + xdefault?: number[] | null; + description?: string; } | string, - ...rest: [string?, string?, boolean?, number[]?] + ...rest: [string?, string?, boolean?, (number[] | null)?, string?] ): Promise<Models.ColumnPoint> { let params: { databaseId: string; tableId: string; key: string; required: boolean; - xdefault?: number[]; + xdefault?: number[] | null; + description?: string; }; if ( @@ -6873,7 +7363,8 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: number[]; + xdefault?: number[] | null; + description?: string; }; } else { params = { @@ -6881,7 +7372,8 @@ export class TablesDB { tableId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as number[], + xdefault: rest[3] as number[] | null, + description: rest[4] as string, }; } @@ -6890,6 +7382,7 @@ export class TablesDB { const key = params.key; const required = params.required; const xdefault = params.xdefault; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -6922,6 +7415,9 @@ export class TablesDB { if (typeof xdefault !== 'undefined') { apiPayload['default'] = xdefault; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -6937,6 +7433,7 @@ export class TablesDB { columnPoint: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -6957,8 +7454,9 @@ export class TablesDB { * @param {string} params.tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} params.key - Column Key. * @param {boolean} params.required - Is column required? - * @param {number[]} params.xdefault - Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required. - * @param {string} params.newKey - New Column Key. + * @param {number[] | null} params.xdefault - Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required. + * @param {string | null} params.newKey - New Column Key. + * @param {string | null} params.description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnPoint>} */ @@ -6967,8 +7465,9 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: number[]; - newKey?: string; + xdefault?: number[] | null; + newKey?: string | null; + description?: string | null; }): Promise<Models.ColumnPoint>; /** * Update a point column. Changing the `default` value will not update already existing rows. @@ -6977,8 +7476,9 @@ export class TablesDB { * @param {string} tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} key - Column Key. * @param {boolean} required - Is column required? - * @param {number[]} xdefault - Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required. - * @param {string} newKey - New Column Key. + * @param {number[] | null} xdefault - Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required. + * @param {string | null} newKey - New Column Key. + * @param {string | null} description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnPoint>} * @deprecated Use the object parameter style method for a better developer experience. @@ -6988,8 +7488,9 @@ export class TablesDB { tableId: string, key: string, required: boolean, - xdefault?: number[], - newKey?: string, + xdefault?: number[] | null, + newKey?: string | null, + description?: string | null, ): Promise<Models.ColumnPoint>; updatePointColumn( paramsOrFirst: @@ -6998,19 +7499,28 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: number[]; - newKey?: string; + xdefault?: number[] | null; + newKey?: string | null; + description?: string | null; } | string, - ...rest: [string?, string?, boolean?, number[]?, string?] + ...rest: [ + string?, + string?, + boolean?, + (number[] | null)?, + (string | null)?, + (string | null)?, + ] ): Promise<Models.ColumnPoint> { let params: { databaseId: string; tableId: string; key: string; required: boolean; - xdefault?: number[]; - newKey?: string; + xdefault?: number[] | null; + newKey?: string | null; + description?: string | null; }; if ( @@ -7023,8 +7533,9 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: number[]; - newKey?: string; + xdefault?: number[] | null; + newKey?: string | null; + description?: string | null; }; } else { params = { @@ -7032,8 +7543,9 @@ export class TablesDB { tableId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as number[], - newKey: rest[4] as string, + xdefault: rest[3] as number[] | null, + newKey: rest[4] as string | null, + description: rest[5] as string | null, }; } @@ -7043,6 +7555,7 @@ export class TablesDB { const required = params.required; const xdefault = params.xdefault; const newKey = params.newKey; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -7077,6 +7590,9 @@ export class TablesDB { if (typeof newKey !== 'undefined') { apiPayload['newKey'] = newKey; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -7092,6 +7608,7 @@ export class TablesDB { columnPoint: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -7112,7 +7629,8 @@ export class TablesDB { * @param {string} params.tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} params.key - Column Key. * @param {boolean} params.required - Is column required? - * @param {any[][]} params.xdefault - Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required. + * @param {any[][] | null} params.xdefault - Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required. + * @param {string} params.description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnPolygon>} */ @@ -7121,7 +7639,8 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: any[][]; + xdefault?: any[][] | null; + description?: string; }): Promise<Models.ColumnPolygon>; /** * Create a geometric polygon column. @@ -7130,7 +7649,8 @@ export class TablesDB { * @param {string} tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} key - Column Key. * @param {boolean} required - Is column required? - * @param {any[][]} xdefault - Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required. + * @param {any[][] | null} xdefault - Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required. + * @param {string} description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnPolygon>} * @deprecated Use the object parameter style method for a better developer experience. @@ -7140,7 +7660,8 @@ export class TablesDB { tableId: string, key: string, required: boolean, - xdefault?: any[][], + xdefault?: any[][] | null, + description?: string, ): Promise<Models.ColumnPolygon>; createPolygonColumn( paramsOrFirst: @@ -7149,17 +7670,19 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: any[][]; + xdefault?: any[][] | null; + description?: string; } | string, - ...rest: [string?, string?, boolean?, any[][]?] + ...rest: [string?, string?, boolean?, (any[][] | null)?, string?] ): Promise<Models.ColumnPolygon> { let params: { databaseId: string; tableId: string; key: string; required: boolean; - xdefault?: any[][]; + xdefault?: any[][] | null; + description?: string; }; if ( @@ -7172,7 +7695,8 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: any[][]; + xdefault?: any[][] | null; + description?: string; }; } else { params = { @@ -7180,7 +7704,8 @@ export class TablesDB { tableId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as any[][], + xdefault: rest[3] as any[][] | null, + description: rest[4] as string, }; } @@ -7189,6 +7714,7 @@ export class TablesDB { const key = params.key; const required = params.required; const xdefault = params.xdefault; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -7222,6 +7748,9 @@ export class TablesDB { if (typeof xdefault !== 'undefined') { apiPayload['default'] = xdefault; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -7237,6 +7766,7 @@ export class TablesDB { columnPolygon: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -7257,8 +7787,9 @@ export class TablesDB { * @param {string} params.tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} params.key - Column Key. * @param {boolean} params.required - Is column required? - * @param {any[][]} params.xdefault - Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required. - * @param {string} params.newKey - New Column Key. + * @param {any[][] | null} params.xdefault - Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required. + * @param {string | null} params.newKey - New Column Key. + * @param {string | null} params.description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnPolygon>} */ @@ -7267,8 +7798,9 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: any[][]; - newKey?: string; + xdefault?: any[][] | null; + newKey?: string | null; + description?: string | null; }): Promise<Models.ColumnPolygon>; /** * Update a polygon column. Changing the `default` value will not update already existing rows. @@ -7277,8 +7809,9 @@ export class TablesDB { * @param {string} tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} key - Column Key. * @param {boolean} required - Is column required? - * @param {any[][]} xdefault - Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required. - * @param {string} newKey - New Column Key. + * @param {any[][] | null} xdefault - Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required. + * @param {string | null} newKey - New Column Key. + * @param {string | null} description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnPolygon>} * @deprecated Use the object parameter style method for a better developer experience. @@ -7288,8 +7821,9 @@ export class TablesDB { tableId: string, key: string, required: boolean, - xdefault?: any[][], - newKey?: string, + xdefault?: any[][] | null, + newKey?: string | null, + description?: string | null, ): Promise<Models.ColumnPolygon>; updatePolygonColumn( paramsOrFirst: @@ -7298,19 +7832,28 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: any[][]; - newKey?: string; + xdefault?: any[][] | null; + newKey?: string | null; + description?: string | null; } | string, - ...rest: [string?, string?, boolean?, any[][]?, string?] + ...rest: [ + string?, + string?, + boolean?, + (any[][] | null)?, + (string | null)?, + (string | null)?, + ] ): Promise<Models.ColumnPolygon> { let params: { databaseId: string; tableId: string; key: string; required: boolean; - xdefault?: any[][]; - newKey?: string; + xdefault?: any[][] | null; + newKey?: string | null; + description?: string | null; }; if ( @@ -7323,8 +7866,9 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: any[][]; - newKey?: string; + xdefault?: any[][] | null; + newKey?: string | null; + description?: string | null; }; } else { params = { @@ -7332,8 +7876,9 @@ export class TablesDB { tableId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as any[][], - newKey: rest[4] as string, + xdefault: rest[3] as any[][] | null, + newKey: rest[4] as string | null, + description: rest[5] as string | null, }; } @@ -7343,6 +7888,7 @@ export class TablesDB { const required = params.required; const xdefault = params.xdefault; const newKey = params.newKey; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -7377,6 +7923,9 @@ export class TablesDB { if (typeof newKey !== 'undefined') { apiPayload['newKey'] = newKey; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -7392,6 +7941,7 @@ export class TablesDB { columnPolygon: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -7414,9 +7964,10 @@ export class TablesDB { * @param {string} params.relatedTableId - Related Table ID. * @param {RelationshipType} params.type - Relationship type. Possible values are: oneToOne, oneToMany, manyToOne, manyToMany. * @param {boolean} params.twoWay - Is Two Way? - * @param {string} params.key - Column Key. - * @param {string} params.twoWayKey - Two Way Column Key. + * @param {string | null} params.key - Column Key. + * @param {string | null} params.twoWayKey - Two Way Column Key. * @param {RelationMutate} params.onDelete - Delete constraint. Possible values are: cascade, restrict, setNull. + * @param {string} params.description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnRelationship>} */ @@ -7426,9 +7977,10 @@ export class TablesDB { relatedTableId: string; type: RelationshipType; twoWay?: boolean; - key?: string; - twoWayKey?: string; + key?: string | null; + twoWayKey?: string | null; onDelete?: RelationMutate; + description?: string; }): Promise<Models.ColumnRelationship>; /** * Create relationship column. [Learn more about relationship columns](https://appwrite.io/docs/databases-relationships#relationship-columns). @@ -7439,9 +7991,10 @@ export class TablesDB { * @param {string} relatedTableId - Related Table ID. * @param {RelationshipType} type - Relationship type. Possible values are: oneToOne, oneToMany, manyToOne, manyToMany. * @param {boolean} twoWay - Is Two Way? - * @param {string} key - Column Key. - * @param {string} twoWayKey - Two Way Column Key. + * @param {string | null} key - Column Key. + * @param {string | null} twoWayKey - Two Way Column Key. * @param {RelationMutate} onDelete - Delete constraint. Possible values are: cascade, restrict, setNull. + * @param {string} description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnRelationship>} * @deprecated Use the object parameter style method for a better developer experience. @@ -7452,9 +8005,10 @@ export class TablesDB { relatedTableId: string, type: RelationshipType, twoWay?: boolean, - key?: string, - twoWayKey?: string, + key?: string | null, + twoWayKey?: string | null, onDelete?: RelationMutate, + description?: string, ): Promise<Models.ColumnRelationship>; createRelationshipColumn( paramsOrFirst: @@ -7464,9 +8018,10 @@ export class TablesDB { relatedTableId: string; type: RelationshipType; twoWay?: boolean; - key?: string; - twoWayKey?: string; + key?: string | null; + twoWayKey?: string | null; onDelete?: RelationMutate; + description?: string; } | string, ...rest: [ @@ -7474,9 +8029,10 @@ export class TablesDB { string?, RelationshipType?, boolean?, - string?, - string?, + (string | null)?, + (string | null)?, RelationMutate?, + string?, ] ): Promise<Models.ColumnRelationship> { let params: { @@ -7485,9 +8041,10 @@ export class TablesDB { relatedTableId: string; type: RelationshipType; twoWay?: boolean; - key?: string; - twoWayKey?: string; + key?: string | null; + twoWayKey?: string | null; onDelete?: RelationMutate; + description?: string; }; if ( @@ -7501,9 +8058,10 @@ export class TablesDB { relatedTableId: string; type: RelationshipType; twoWay?: boolean; - key?: string; - twoWayKey?: string; + key?: string | null; + twoWayKey?: string | null; onDelete?: RelationMutate; + description?: string; }; } else { params = { @@ -7512,9 +8070,10 @@ export class TablesDB { relatedTableId: rest[1] as string, type: rest[2] as RelationshipType, twoWay: rest[3] as boolean, - key: rest[4] as string, - twoWayKey: rest[5] as string, + key: rest[4] as string | null, + twoWayKey: rest[5] as string | null, onDelete: rest[6] as RelationMutate, + description: rest[7] as string, }; } @@ -7526,6 +8085,7 @@ export class TablesDB { const key = params.key; const twoWayKey = params.twoWayKey; const onDelete = params.onDelete; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -7568,6 +8128,9 @@ export class TablesDB { if (typeof onDelete !== 'undefined') { apiPayload['onDelete'] = onDelete; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -7583,6 +8146,7 @@ export class TablesDB { columnRelationship: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -7608,8 +8172,9 @@ export class TablesDB { * @param {string} params.databaseId - Database ID. * @param {string} params.tableId - Table ID. * @param {string} params.key - Column Key. - * @param {RelationMutate} params.onDelete - Delete constraint. Possible values are: cascade, restrict, setNull. - * @param {string} params.newKey - New Column Key. + * @param {RelationMutate | null} params.onDelete - Delete constraint. Possible values are: cascade, restrict, setNull. + * @param {string | null} params.newKey - New Column Key. + * @param {string | null} params.description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnRelationship>} */ @@ -7617,8 +8182,9 @@ export class TablesDB { databaseId: string; tableId: string; key: string; - onDelete?: RelationMutate; - newKey?: string; + onDelete?: RelationMutate | null; + newKey?: string | null; + description?: string | null; }): Promise<Models.ColumnRelationship>; /** * Update relationship column. [Learn more about relationship columns](https://appwrite.io/docs/databases-relationships#relationship-columns). @@ -7627,8 +8193,9 @@ export class TablesDB { * @param {string} databaseId - Database ID. * @param {string} tableId - Table ID. * @param {string} key - Column Key. - * @param {RelationMutate} onDelete - Delete constraint. Possible values are: cascade, restrict, setNull. - * @param {string} newKey - New Column Key. + * @param {RelationMutate | null} onDelete - Delete constraint. Possible values are: cascade, restrict, setNull. + * @param {string | null} newKey - New Column Key. + * @param {string | null} description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnRelationship>} * @deprecated Use the object parameter style method for a better developer experience. @@ -7637,8 +8204,9 @@ export class TablesDB { databaseId: string, tableId: string, key: string, - onDelete?: RelationMutate, - newKey?: string, + onDelete?: RelationMutate | null, + newKey?: string | null, + description?: string | null, ): Promise<Models.ColumnRelationship>; updateRelationshipColumn( paramsOrFirst: @@ -7646,18 +8214,26 @@ export class TablesDB { databaseId: string; tableId: string; key: string; - onDelete?: RelationMutate; - newKey?: string; + onDelete?: RelationMutate | null; + newKey?: string | null; + description?: string | null; } | string, - ...rest: [string?, string?, RelationMutate?, string?] + ...rest: [ + string?, + string?, + (RelationMutate | null)?, + (string | null)?, + (string | null)?, + ] ): Promise<Models.ColumnRelationship> { let params: { databaseId: string; tableId: string; key: string; - onDelete?: RelationMutate; - newKey?: string; + onDelete?: RelationMutate | null; + newKey?: string | null; + description?: string | null; }; if ( @@ -7669,16 +8245,18 @@ export class TablesDB { databaseId: string; tableId: string; key: string; - onDelete?: RelationMutate; - newKey?: string; + onDelete?: RelationMutate | null; + newKey?: string | null; + description?: string | null; }; } else { params = { databaseId: paramsOrFirst as string, tableId: rest[0] as string, key: rest[1] as string, - onDelete: rest[2] as RelationMutate, - newKey: rest[3] as string, + onDelete: rest[2] as RelationMutate | null, + newKey: rest[3] as string | null, + description: rest[4] as string | null, }; } @@ -7687,6 +8265,7 @@ export class TablesDB { const key = params.key; const onDelete = params.onDelete; const newKey = params.newKey; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -7713,6 +8292,9 @@ export class TablesDB { if (typeof newKey !== 'undefined') { apiPayload['newKey'] = newKey; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -7728,6 +8310,7 @@ export class TablesDB { columnRelationship: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -7755,9 +8338,10 @@ export class TablesDB { * @param {string} params.key - Column Key. * @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 {string | null} params.xdefault - Default value for column when not provided. Cannot be set when column is required. * @param {boolean} params.array - Is column an array? * @param {boolean} params.encrypt - Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried. + * @param {string} params.description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnString>} * @deprecated This API has been deprecated since 1.9.0. Please use `TablesDB.createTextColumn` instead. @@ -7768,9 +8352,10 @@ export class TablesDB { key: string; size: number; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; encrypt?: boolean; + description?: string; }): Promise<Models.ColumnString>; /** * Create a string column. @@ -7781,9 +8366,10 @@ export class TablesDB { * @param {string} key - Column Key. * @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 {string | null} xdefault - Default value for column when not provided. Cannot be set when column is required. * @param {boolean} array - Is column an array? * @param {boolean} encrypt - Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried. + * @param {string} description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnString>} * @deprecated Use the object parameter style method for a better developer experience. @@ -7794,9 +8380,10 @@ export class TablesDB { key: string, size: number, required: boolean, - xdefault?: string, + xdefault?: string | null, array?: boolean, encrypt?: boolean, + description?: string, ): Promise<Models.ColumnString>; createStringColumn( paramsOrFirst: @@ -7806,9 +8393,10 @@ export class TablesDB { key: string; size: number; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; encrypt?: boolean; + description?: string; } | string, ...rest: [ @@ -7816,9 +8404,10 @@ export class TablesDB { string?, number?, boolean?, - string?, + (string | null)?, boolean?, boolean?, + string?, ] ): Promise<Models.ColumnString> { let params: { @@ -7827,9 +8416,10 @@ export class TablesDB { key: string; size: number; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; encrypt?: boolean; + description?: string; }; if ( @@ -7843,9 +8433,10 @@ export class TablesDB { key: string; size: number; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; encrypt?: boolean; + description?: string; }; } else { params = { @@ -7854,9 +8445,10 @@ export class TablesDB { key: rest[1] as string, size: rest[2] as number, required: rest[3] as boolean, - xdefault: rest[4] as string, + xdefault: rest[4] as string | null, array: rest[5] as boolean, encrypt: rest[6] as boolean, + description: rest[7] as string, }; } @@ -7868,6 +8460,7 @@ export class TablesDB { const xdefault = params.xdefault; const array = params.array; const encrypt = params.encrypt; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -7912,6 +8505,9 @@ export class TablesDB { if (typeof encrypt !== 'undefined') { apiPayload['encrypt'] = encrypt; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -7927,6 +8523,7 @@ export class TablesDB { columnString: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -7949,9 +8546,10 @@ export class TablesDB { * @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 {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 {string} params.newKey - New Column Key. + * @param {string | null} params.xdefault - Default value for column when not provided. Cannot be set when column is required. + * @param {number | null} params.size - Maximum size of the string column. + * @param {string | null} params.newKey - New Column Key. + * @param {string | null} params.description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnString>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateTextColumn` instead. @@ -7961,9 +8559,10 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: string; - size?: number; - newKey?: string; + xdefault?: string | null; + size?: number | null; + newKey?: string | null; + description?: string | null; }): Promise<Models.ColumnString>; /** * Update a string column. Changing the `default` value will not update already existing rows. @@ -7973,9 +8572,10 @@ export class TablesDB { * @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 {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 {string} newKey - New Column Key. + * @param {string | null} xdefault - Default value for column when not provided. Cannot be set when column is required. + * @param {number | null} size - Maximum size of the string column. + * @param {string | null} newKey - New Column Key. + * @param {string | null} description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnString>} * @deprecated Use the object parameter style method for a better developer experience. @@ -7985,9 +8585,10 @@ export class TablesDB { tableId: string, key: string, required: boolean, - xdefault?: string, - size?: number, - newKey?: string, + xdefault?: string | null, + size?: number | null, + newKey?: string | null, + description?: string | null, ): Promise<Models.ColumnString>; updateStringColumn( paramsOrFirst: @@ -7996,21 +8597,31 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: string; - size?: number; - newKey?: string; + xdefault?: string | null; + size?: number | null; + newKey?: string | null; + description?: string | null; } | string, - ...rest: [string?, string?, boolean?, string?, number?, string?] + ...rest: [ + string?, + string?, + boolean?, + (string | null)?, + (number | null)?, + (string | null)?, + (string | null)?, + ] ): Promise<Models.ColumnString> { let params: { databaseId: string; tableId: string; key: string; required: boolean; - xdefault?: string; - size?: number; - newKey?: string; + xdefault?: string | null; + size?: number | null; + newKey?: string | null; + description?: string | null; }; if ( @@ -8023,9 +8634,10 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: string; - size?: number; - newKey?: string; + xdefault?: string | null; + size?: number | null; + newKey?: string | null; + description?: string | null; }; } else { params = { @@ -8033,9 +8645,10 @@ export class TablesDB { tableId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as string, - size: rest[4] as number, - newKey: rest[5] as string, + xdefault: rest[3] as string | null, + size: rest[4] as number | null, + newKey: rest[5] as string | null, + description: rest[6] as string | null, }; } @@ -8046,6 +8659,7 @@ export class TablesDB { const xdefault = params.xdefault; const size = params.size; const newKey = params.newKey; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -8088,6 +8702,9 @@ export class TablesDB { if (typeof newKey !== 'undefined') { apiPayload['newKey'] = newKey; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -8103,6 +8720,7 @@ export class TablesDB { columnString: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -8125,9 +8743,10 @@ export class TablesDB { * @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 {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 {string | null} params.xdefault - Default value for column when not provided. Cannot be set when column is required. * @param {boolean} params.array - Is column an array? * @param {boolean} params.encrypt - Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried. + * @param {string} params.description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnText>} */ @@ -8136,9 +8755,10 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; encrypt?: boolean; + description?: string; }): Promise<Models.ColumnText>; /** * Create a text column. @@ -8148,9 +8768,10 @@ export class TablesDB { * @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 {boolean} required - Is column required? - * @param {string} xdefault - Default value for column when not provided. Cannot be set when column is required. + * @param {string | null} xdefault - Default value for column when not provided. Cannot be set when column is required. * @param {boolean} array - Is column an array? * @param {boolean} encrypt - Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried. + * @param {string} description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnText>} * @deprecated Use the object parameter style method for a better developer experience. @@ -8160,9 +8781,10 @@ export class TablesDB { tableId: string, key: string, required: boolean, - xdefault?: string, + xdefault?: string | null, array?: boolean, encrypt?: boolean, + description?: string, ): Promise<Models.ColumnText>; createTextColumn( paramsOrFirst: @@ -8171,21 +8793,31 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; encrypt?: boolean; + description?: string; } | string, - ...rest: [string?, string?, boolean?, string?, boolean?, boolean?] + ...rest: [ + string?, + string?, + boolean?, + (string | null)?, + boolean?, + boolean?, + string?, + ] ): Promise<Models.ColumnText> { let params: { databaseId: string; tableId: string; key: string; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; encrypt?: boolean; + description?: string; }; if ( @@ -8198,9 +8830,10 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; encrypt?: boolean; + description?: string; }; } else { params = { @@ -8208,9 +8841,10 @@ export class TablesDB { tableId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as string, + xdefault: rest[3] as string | null, array: rest[4] as boolean, encrypt: rest[5] as boolean, + description: rest[6] as string, }; } @@ -8221,6 +8855,7 @@ export class TablesDB { const xdefault = params.xdefault; const array = params.array; const encrypt = params.encrypt; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -8259,6 +8894,9 @@ export class TablesDB { if (typeof encrypt !== 'undefined') { apiPayload['encrypt'] = encrypt; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -8274,6 +8912,7 @@ export class TablesDB { columnText: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -8295,8 +8934,9 @@ export class TablesDB { * @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 {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 {string} params.newKey - New Column Key. + * @param {string | null} params.xdefault - Default value for column when not provided. Cannot be set when column is required. + * @param {string | null} params.newKey - New Column Key. + * @param {string | null} params.description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnText>} */ @@ -8305,8 +8945,9 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; }): Promise<Models.ColumnText>; /** * Update a text column. Changing the `default` value will not update already existing rows. @@ -8316,8 +8957,9 @@ export class TablesDB { * @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 {boolean} required - Is column required? - * @param {string} xdefault - Default value for column when not provided. Cannot be set when column is required. - * @param {string} newKey - New Column Key. + * @param {string | null} xdefault - Default value for column when not provided. Cannot be set when column is required. + * @param {string | null} newKey - New Column Key. + * @param {string | null} description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnText>} * @deprecated Use the object parameter style method for a better developer experience. @@ -8327,8 +8969,9 @@ export class TablesDB { tableId: string, key: string, required: boolean, - xdefault?: string, - newKey?: string, + xdefault?: string | null, + newKey?: string | null, + description?: string | null, ): Promise<Models.ColumnText>; updateTextColumn( paramsOrFirst: @@ -8337,19 +8980,28 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; } | string, - ...rest: [string?, string?, boolean?, string?, string?] + ...rest: [ + string?, + string?, + boolean?, + (string | null)?, + (string | null)?, + (string | null)?, + ] ): Promise<Models.ColumnText> { let params: { databaseId: string; tableId: string; key: string; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; }; if ( @@ -8362,8 +9014,9 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; }; } else { params = { @@ -8371,8 +9024,9 @@ export class TablesDB { tableId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as string, - newKey: rest[4] as string, + xdefault: rest[3] as string | null, + newKey: rest[4] as string | null, + description: rest[5] as string | null, }; } @@ -8382,6 +9036,7 @@ export class TablesDB { const required = params.required; const xdefault = params.xdefault; const newKey = params.newKey; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -8421,6 +9076,9 @@ export class TablesDB { if (typeof newKey !== 'undefined') { apiPayload['newKey'] = newKey; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -8436,6 +9094,7 @@ export class TablesDB { columnText: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -8457,8 +9116,9 @@ export class TablesDB { * @param {string} params.tableId - Table ID. * @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 {string | null} params.xdefault - Default value for column when not provided. Cannot be set when column is required. * @param {boolean} params.array - Is column an array? + * @param {string} params.description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnUrl>} */ @@ -8467,8 +9127,9 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; + description?: string; }): Promise<Models.ColumnUrl>; /** * Create a URL column. @@ -8478,8 +9139,9 @@ export class TablesDB { * @param {string} tableId - Table ID. * @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 {string | null} xdefault - Default value for column when not provided. Cannot be set when column is required. * @param {boolean} array - Is column an array? + * @param {string} description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnUrl>} * @deprecated Use the object parameter style method for a better developer experience. @@ -8489,8 +9151,9 @@ export class TablesDB { tableId: string, key: string, required: boolean, - xdefault?: string, + xdefault?: string | null, array?: boolean, + description?: string, ): Promise<Models.ColumnUrl>; createUrlColumn( paramsOrFirst: @@ -8499,19 +9162,28 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; + description?: string; } | string, - ...rest: [string?, string?, boolean?, string?, boolean?] + ...rest: [ + string?, + string?, + boolean?, + (string | null)?, + boolean?, + string?, + ] ): Promise<Models.ColumnUrl> { let params: { databaseId: string; tableId: string; key: string; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; + description?: string; }; if ( @@ -8524,8 +9196,9 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; + description?: string; }; } else { params = { @@ -8533,8 +9206,9 @@ export class TablesDB { tableId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as string, + xdefault: rest[3] as string | null, array: rest[4] as boolean, + description: rest[5] as string, }; } @@ -8544,6 +9218,7 @@ export class TablesDB { const required = params.required; const xdefault = params.xdefault; const array = params.array; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -8579,6 +9254,9 @@ export class TablesDB { if (typeof array !== 'undefined') { apiPayload['array'] = array; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -8594,6 +9272,7 @@ export class TablesDB { columnUrl: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -8616,8 +9295,9 @@ export class TablesDB { * @param {string} params.tableId - Table ID. * @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 {string} params.newKey - New Column Key. + * @param {string | null} params.xdefault - Default value for column when not provided. Cannot be set when column is required. + * @param {string | null} params.newKey - New Column Key. + * @param {string | null} params.description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnUrl>} */ @@ -8626,8 +9306,9 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; }): Promise<Models.ColumnUrl>; /** * Update an url column. Changing the `default` value will not update already existing rows. @@ -8637,8 +9318,9 @@ export class TablesDB { * @param {string} tableId - Table ID. * @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 {string} newKey - New Column Key. + * @param {string | null} xdefault - Default value for column when not provided. Cannot be set when column is required. + * @param {string | null} newKey - New Column Key. + * @param {string | null} description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnUrl>} * @deprecated Use the object parameter style method for a better developer experience. @@ -8648,8 +9330,9 @@ export class TablesDB { tableId: string, key: string, required: boolean, - xdefault?: string, - newKey?: string, + xdefault?: string | null, + newKey?: string | null, + description?: string | null, ): Promise<Models.ColumnUrl>; updateUrlColumn( paramsOrFirst: @@ -8658,19 +9341,28 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; } | string, - ...rest: [string?, string?, boolean?, string?, string?] + ...rest: [ + string?, + string?, + boolean?, + (string | null)?, + (string | null)?, + (string | null)?, + ] ): Promise<Models.ColumnUrl> { let params: { databaseId: string; tableId: string; key: string; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; }; if ( @@ -8683,8 +9375,9 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: string; - newKey?: string; + xdefault?: string | null; + newKey?: string | null; + description?: string | null; }; } else { params = { @@ -8692,8 +9385,9 @@ export class TablesDB { tableId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as string, - newKey: rest[4] as string, + xdefault: rest[3] as string | null, + newKey: rest[4] as string | null, + description: rest[5] as string | null, }; } @@ -8703,6 +9397,7 @@ export class TablesDB { const required = params.required; const xdefault = params.xdefault; const newKey = params.newKey; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -8742,6 +9437,9 @@ export class TablesDB { if (typeof newKey !== 'undefined') { apiPayload['newKey'] = newKey; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -8757,6 +9455,7 @@ export class TablesDB { columnUrl: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -8780,9 +9479,10 @@ export class TablesDB { * @param {string} params.key - Column Key. * @param {number} params.size - Column size for varchar columns, in number of characters. Maximum size is 16381. * @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 {string | null} params.xdefault - Default value for column when not provided. Cannot be set when column is required. * @param {boolean} params.array - Is column an array? * @param {boolean} params.encrypt - Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried. + * @param {string} params.description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnVarchar>} */ @@ -8792,9 +9492,10 @@ export class TablesDB { key: string; size: number; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; encrypt?: boolean; + description?: string; }): Promise<Models.ColumnVarchar>; /** * Create a varchar column. @@ -8805,9 +9506,10 @@ export class TablesDB { * @param {string} key - Column Key. * @param {number} size - Column size for varchar columns, in number of characters. Maximum size is 16381. * @param {boolean} required - Is column required? - * @param {string} xdefault - Default value for column when not provided. Cannot be set when column is required. + * @param {string | null} xdefault - Default value for column when not provided. Cannot be set when column is required. * @param {boolean} array - Is column an array? * @param {boolean} encrypt - Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried. + * @param {string} description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnVarchar>} * @deprecated Use the object parameter style method for a better developer experience. @@ -8818,9 +9520,10 @@ export class TablesDB { key: string, size: number, required: boolean, - xdefault?: string, + xdefault?: string | null, array?: boolean, encrypt?: boolean, + description?: string, ): Promise<Models.ColumnVarchar>; createVarcharColumn( paramsOrFirst: @@ -8830,9 +9533,10 @@ export class TablesDB { key: string; size: number; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; encrypt?: boolean; + description?: string; } | string, ...rest: [ @@ -8840,9 +9544,10 @@ export class TablesDB { string?, number?, boolean?, - string?, + (string | null)?, boolean?, boolean?, + string?, ] ): Promise<Models.ColumnVarchar> { let params: { @@ -8851,9 +9556,10 @@ export class TablesDB { key: string; size: number; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; encrypt?: boolean; + description?: string; }; if ( @@ -8867,9 +9573,10 @@ export class TablesDB { key: string; size: number; required: boolean; - xdefault?: string; + xdefault?: string | null; array?: boolean; encrypt?: boolean; + description?: string; }; } else { params = { @@ -8878,9 +9585,10 @@ export class TablesDB { key: rest[1] as string, size: rest[2] as number, required: rest[3] as boolean, - xdefault: rest[4] as string, + xdefault: rest[4] as string | null, array: rest[5] as boolean, encrypt: rest[6] as boolean, + description: rest[7] as string, }; } @@ -8892,6 +9600,7 @@ export class TablesDB { const xdefault = params.xdefault; const array = params.array; const encrypt = params.encrypt; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -8937,6 +9646,9 @@ export class TablesDB { if (typeof encrypt !== 'undefined') { apiPayload['encrypt'] = encrypt; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -8952,6 +9664,7 @@ export class TablesDB { columnVarchar: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -8974,9 +9687,10 @@ export class TablesDB { * @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 {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 varchar column. - * @param {string} params.newKey - New Column Key. + * @param {string | null} params.xdefault - Default value for column when not provided. Cannot be set when column is required. + * @param {number | null} params.size - Maximum size of the varchar column. + * @param {string | null} params.newKey - New Column Key. + * @param {string | null} params.description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnVarchar>} */ @@ -8985,9 +9699,10 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: string; - size?: number; - newKey?: string; + xdefault?: string | null; + size?: number | null; + newKey?: string | null; + description?: string | null; }): Promise<Models.ColumnVarchar>; /** * Update a varchar column. Changing the `default` value will not update already existing rows. @@ -8997,9 +9712,10 @@ export class TablesDB { * @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 {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 varchar column. - * @param {string} newKey - New Column Key. + * @param {string | null} xdefault - Default value for column when not provided. Cannot be set when column is required. + * @param {number | null} size - Maximum size of the varchar column. + * @param {string | null} newKey - New Column Key. + * @param {string | null} description - Optional description for the column. * @throws {AppwriteException} * @returns {Promise<Models.ColumnVarchar>} * @deprecated Use the object parameter style method for a better developer experience. @@ -9009,9 +9725,10 @@ export class TablesDB { tableId: string, key: string, required: boolean, - xdefault?: string, - size?: number, - newKey?: string, + xdefault?: string | null, + size?: number | null, + newKey?: string | null, + description?: string | null, ): Promise<Models.ColumnVarchar>; updateVarcharColumn( paramsOrFirst: @@ -9020,21 +9737,31 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: string; - size?: number; - newKey?: string; + xdefault?: string | null; + size?: number | null; + newKey?: string | null; + description?: string | null; } | string, - ...rest: [string?, string?, boolean?, string?, number?, string?] + ...rest: [ + string?, + string?, + boolean?, + (string | null)?, + (number | null)?, + (string | null)?, + (string | null)?, + ] ): Promise<Models.ColumnVarchar> { let params: { databaseId: string; tableId: string; key: string; required: boolean; - xdefault?: string; - size?: number; - newKey?: string; + xdefault?: string | null; + size?: number | null; + newKey?: string | null; + description?: string | null; }; if ( @@ -9047,9 +9774,10 @@ export class TablesDB { tableId: string; key: string; required: boolean; - xdefault?: string; - size?: number; - newKey?: string; + xdefault?: string | null; + size?: number | null; + newKey?: string | null; + description?: string | null; }; } else { params = { @@ -9057,9 +9785,10 @@ export class TablesDB { tableId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as string, - size: rest[4] as number, - newKey: rest[5] as string, + xdefault: rest[3] as string | null, + size: rest[4] as number | null, + newKey: rest[5] as string | null, + description: rest[6] as string | null, }; } @@ -9070,6 +9799,7 @@ export class TablesDB { const xdefault = params.xdefault; const size = params.size; const newKey = params.newKey; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -9112,6 +9842,9 @@ export class TablesDB { if (typeof newKey !== 'undefined') { apiPayload['newKey'] = newKey; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -9127,6 +9860,7 @@ export class TablesDB { columnVarchar: { defaults: { key: '', + description: '', type: '', error: '', required: false, @@ -9491,6 +10225,7 @@ export class TablesDB { $createdAt: '', $updatedAt: '', key: '', + description: '', type: '', status: '', error: '', @@ -9515,6 +10250,7 @@ export class TablesDB { * @param {string[]} params.columns - Array of columns to index. Maximum of 100 columns are allowed, each 32 characters long. * @param {OrderBy[]} params.orders - Array of index orders. Maximum of 100 orders are allowed. * @param {number[]} params.lengths - Length of index. Maximum of 100 + * @param {string} params.description - Optional description for the index. * @throws {AppwriteException} * @returns {Promise<Models.ColumnIndex>} */ @@ -9526,6 +10262,7 @@ export class TablesDB { columns: string[]; orders?: OrderBy[]; lengths?: number[]; + description?: string; }): Promise<Models.ColumnIndex>; /** * Creates an index on the columns listed. Your index should include all the columns you will query in a single request. @@ -9538,6 +10275,7 @@ export class TablesDB { * @param {string[]} columns - Array of columns to index. Maximum of 100 columns are allowed, each 32 characters long. * @param {OrderBy[]} orders - Array of index orders. Maximum of 100 orders are allowed. * @param {number[]} lengths - Length of index. Maximum of 100 + * @param {string} description - Optional description for the index. * @throws {AppwriteException} * @returns {Promise<Models.ColumnIndex>} * @deprecated Use the object parameter style method for a better developer experience. @@ -9550,6 +10288,7 @@ export class TablesDB { columns: string[], orders?: OrderBy[], lengths?: number[], + description?: string, ): Promise<Models.ColumnIndex>; createIndex( paramsOrFirst: @@ -9561,6 +10300,7 @@ export class TablesDB { columns: string[]; orders?: OrderBy[]; lengths?: number[]; + description?: string; } | string, ...rest: [ @@ -9570,6 +10310,7 @@ export class TablesDB { string[]?, OrderBy[]?, number[]?, + string?, ] ): Promise<Models.ColumnIndex> { let params: { @@ -9580,6 +10321,7 @@ export class TablesDB { columns: string[]; orders?: OrderBy[]; lengths?: number[]; + description?: string; }; if ( @@ -9595,6 +10337,7 @@ export class TablesDB { columns: string[]; orders?: OrderBy[]; lengths?: number[]; + description?: string; }; } else { params = { @@ -9605,6 +10348,7 @@ export class TablesDB { columns: rest[3] as string[], orders: rest[4] as OrderBy[], lengths: rest[5] as number[], + description: rest[6] as string, }; } @@ -9615,6 +10359,7 @@ export class TablesDB { const columns = params.columns; const orders = params.orders; const lengths = params.lengths; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -9656,6 +10401,9 @@ export class TablesDB { if (typeof lengths !== 'undefined') { apiPayload['lengths'] = lengths; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -9674,6 +10422,7 @@ export class TablesDB { $createdAt: '', $updatedAt: '', key: '', + description: '', type: '', status: '', error: '', @@ -9780,6 +10529,7 @@ export class TablesDB { $createdAt: '', $updatedAt: '', key: '', + description: '', type: '', status: '', error: '', @@ -9879,12 +10629,14 @@ export class TablesDB { /** * Get a list of all the user's rows in a given table. You can use the query params to filter your results. * + * Rows returned by aggregate, groupBy or distinct queries hold only the columns they select, group or aggregate, typed as a row types them, with a joined column named by its join alias (`alias.column`). They have no `$id`, `$sequence`, `$createdAt`, `$updatedAt`, `$permissions`, `$databaseId` or `$tableId` unless they select or group it, and neither does a right or full join row that no row of this table matched. + * * @param {string} params.databaseId - Database ID. * @param {string} params.tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/products/databases/tables#create-table). * @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. * @param {string} params.transactionId - Transaction ID to read uncommitted changes within the transaction. * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. - * @param {number} params.ttl - TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, table, schema version (columns and indexes), caller authorization roles, and the exact query — so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; row writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Must be between 0 and 86400 (24 hours). + * @param {number} params.ttl - TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, table, schema version (columns and indexes), caller authorization roles, and the exact query — so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; row writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Lists with join queries are not cached. Must be between 0 and 86400 (24 hours). * @throws {AppwriteException} * @returns {Promise<Models.RowList<Row>>} */ @@ -9899,12 +10651,14 @@ export class TablesDB { /** * Get a list of all the user's rows in a given table. You can use the query params to filter your results. * + * Rows returned by aggregate, groupBy or distinct queries hold only the columns they select, group or aggregate, typed as a row types them, with a joined column named by its join alias (`alias.column`). They have no `$id`, `$sequence`, `$createdAt`, `$updatedAt`, `$permissions`, `$databaseId` or `$tableId` unless they select or group it, and neither does a right or full join row that no row of this table matched. + * * @param {string} databaseId - Database ID. * @param {string} tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/products/databases/tables#create-table). * @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. * @param {string} transactionId - Transaction ID to read uncommitted changes within the transaction. * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. - * @param {number} ttl - TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, table, schema version (columns and indexes), caller authorization roles, and the exact query — so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; row writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Must be between 0 and 86400 (24 hours). + * @param {number} ttl - TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, table, schema version (columns and indexes), caller authorization roles, and the exact query — so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; row writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Lists with join queries are not cached. Must be between 0 and 86400 (24 hours). * @throws {AppwriteException} * @returns {Promise<Models.RowList<Row>>} * @deprecated Use the object parameter style method for a better developer experience. @@ -10042,8 +10796,8 @@ export class TablesDB { * @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). Make sure to define columns before creating rows. * @param {string} params.rowId - Row 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 {Row extends Models.DefaultRow ? Partial<Models.Row> & Record<string, any> : Partial<Models.Row> & Omit<Row, keyof Models.Row>} params.data - Row data as JSON object. - * @param {string[]} params.permissions - An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param {string} params.transactionId - Transaction ID for staging the operation. + * @param {string[] | null} params.permissions - An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {string | null} params.transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise<Row>} */ @@ -10054,8 +10808,8 @@ export class TablesDB { data: Row extends Models.DefaultRow ? Partial<Models.Row> & Record<string, any> : Partial<Models.Row> & Omit<Row, keyof Models.Row>; - permissions?: string[]; - transactionId?: string; + permissions?: string[] | null; + transactionId?: string | null; }): Promise<Row>; /** * Create a new Row. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable) API or directly from your database console. @@ -10064,8 +10818,8 @@ export class TablesDB { * @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). Make sure to define columns before creating rows. * @param {string} rowId - Row 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 {Row extends Models.DefaultRow ? Partial<Models.Row> & Record<string, any> : Partial<Models.Row> & Omit<Row, keyof Models.Row>} data - Row data as JSON object. - * @param {string[]} permissions - An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param {string} transactionId - Transaction ID for staging the operation. + * @param {string[] | null} permissions - An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {string | null} transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise<Row>} * @deprecated Use the object parameter style method for a better developer experience. @@ -10077,8 +10831,8 @@ export class TablesDB { data: Row extends Models.DefaultRow ? Partial<Models.Row> & Record<string, any> : Partial<Models.Row> & Omit<Row, keyof Models.Row>, - permissions?: string[], - transactionId?: string, + permissions?: string[] | null, + transactionId?: string | null, ): Promise<Row>; createRow<Row extends Models.Row = Models.DefaultRow>( paramsOrFirst: @@ -10089,8 +10843,8 @@ export class TablesDB { data: Row extends Models.DefaultRow ? Partial<Models.Row> & Record<string, any> : Partial<Models.Row> & Omit<Row, keyof Models.Row>; - permissions?: string[]; - transactionId?: string; + permissions?: string[] | null; + transactionId?: string | null; } | string, ...rest: [ @@ -10099,8 +10853,8 @@ export class TablesDB { (Row extends Models.DefaultRow ? Partial<Models.Row> & Record<string, any> : Partial<Models.Row> & Omit<Row, keyof Models.Row>)?, - string[]?, - string?, + (string[] | null)?, + (string | null)?, ] ): Promise<Row> { let params: { @@ -10110,8 +10864,8 @@ export class TablesDB { data: Row extends Models.DefaultRow ? Partial<Models.Row> & Record<string, any> : Partial<Models.Row> & Omit<Row, keyof Models.Row>; - permissions?: string[]; - transactionId?: string; + permissions?: string[] | null; + transactionId?: string | null; }; if ( @@ -10126,8 +10880,8 @@ export class TablesDB { data: Row extends Models.DefaultRow ? Partial<Models.Row> & Record<string, any> : Partial<Models.Row> & Omit<Row, keyof Models.Row>; - permissions?: string[]; - transactionId?: string; + permissions?: string[] | null; + transactionId?: string | null; }; } else { params = { @@ -10137,8 +10891,8 @@ export class TablesDB { data: rest[2] as Row extends Models.DefaultRow ? Partial<Models.Row> & Record<string, any> : Partial<Models.Row> & Omit<Row, keyof Models.Row>, - permissions: rest[3] as string[], - transactionId: rest[4] as string, + permissions: rest[3] as string[] | null, + transactionId: rest[4] as string | null, }; } @@ -10216,7 +10970,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). Make sure to define columns before creating rows. * @param {object[]} params.rows - Array of rows data as JSON objects. - * @param {string} params.transactionId - Transaction ID for staging the operation. + * @param {string | null} params.transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise<Models.RowList<Row>>} */ @@ -10224,7 +10978,7 @@ export class TablesDB { databaseId: string; tableId: string; rows: object[]; - transactionId?: string; + transactionId?: string | null; }): Promise<Models.RowList<Row>>; /** * Create new Rows. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable) API or directly from your database console. @@ -10232,7 +10986,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). Make sure to define columns before creating rows. * @param {object[]} rows - Array of rows data as JSON objects. - * @param {string} transactionId - Transaction ID for staging the operation. + * @param {string | null} transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise<Models.RowList<Row>>} * @deprecated Use the object parameter style method for a better developer experience. @@ -10241,7 +10995,7 @@ export class TablesDB { databaseId: string, tableId: string, rows: object[], - transactionId?: string, + transactionId?: string | null, ): Promise<Models.RowList<Row>>; createRows<Row extends Models.Row = Models.DefaultRow>( paramsOrFirst: @@ -10249,16 +11003,16 @@ export class TablesDB { databaseId: string; tableId: string; rows: object[]; - transactionId?: string; + transactionId?: string | null; } | string, - ...rest: [string?, object[]?, string?] + ...rest: [string?, object[]?, (string | null)?] ): Promise<Models.RowList<Row>> { let params: { databaseId: string; tableId: string; rows: object[]; - transactionId?: string; + transactionId?: string | null; }; if ( @@ -10270,14 +11024,14 @@ export class TablesDB { databaseId: string; tableId: string; rows: object[]; - transactionId?: string; + transactionId?: string | null; }; } else { params = { databaseId: paramsOrFirst as string, tableId: rest[0] as string, rows: rest[1] as object[], - transactionId: rest[2] as string, + transactionId: rest[2] as string | null, }; } @@ -10356,7 +11110,7 @@ export class TablesDB { * @param {string} params.databaseId - Database ID. * @param {string} params.tableId - Table ID. * @param {object[]} params.rows - Array of row data as JSON objects. May contain partial rows. - * @param {string} params.transactionId - Transaction ID for staging the operation. + * @param {string | null} params.transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise<Models.RowList<Row>>} */ @@ -10364,7 +11118,7 @@ export class TablesDB { databaseId: string; tableId: string; rows: object[]; - transactionId?: string; + transactionId?: string | null; }): Promise<Models.RowList<Row>>; /** * Create or update Rows. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable) API or directly from your database console. @@ -10373,7 +11127,7 @@ export class TablesDB { * @param {string} databaseId - Database ID. * @param {string} tableId - Table ID. * @param {object[]} rows - Array of row data as JSON objects. May contain partial rows. - * @param {string} transactionId - Transaction ID for staging the operation. + * @param {string | null} transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise<Models.RowList<Row>>} * @deprecated Use the object parameter style method for a better developer experience. @@ -10382,7 +11136,7 @@ export class TablesDB { databaseId: string, tableId: string, rows: object[], - transactionId?: string, + transactionId?: string | null, ): Promise<Models.RowList<Row>>; upsertRows<Row extends Models.Row = Models.DefaultRow>( paramsOrFirst: @@ -10390,16 +11144,16 @@ export class TablesDB { databaseId: string; tableId: string; rows: object[]; - transactionId?: string; + transactionId?: string | null; } | string, - ...rest: [string?, object[]?, string?] + ...rest: [string?, object[]?, (string | null)?] ): Promise<Models.RowList<Row>> { let params: { databaseId: string; tableId: string; rows: object[]; - transactionId?: string; + transactionId?: string | null; }; if ( @@ -10411,14 +11165,14 @@ export class TablesDB { databaseId: string; tableId: string; rows: object[]; - transactionId?: string; + transactionId?: string | null; }; } else { params = { databaseId: paramsOrFirst as string, tableId: rest[0] as string, rows: rest[1] as object[], - transactionId: rest[2] as string, + transactionId: rest[2] as string | null, }; } @@ -10497,7 +11251,7 @@ export class TablesDB { * @param {string} params.tableId - Table ID. * @param {object} params.data - Row data as JSON object. Include only column and value pairs to be updated. * @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. - * @param {string} params.transactionId - Transaction ID for staging the operation. + * @param {string | null} params.transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise<Models.RowList<Row>>} */ @@ -10506,7 +11260,7 @@ export class TablesDB { tableId: string; data?: object; queries?: string[]; - transactionId?: string; + transactionId?: string | null; }): Promise<Models.RowList<Row>>; /** * Update all rows that match your queries, if no queries are submitted then all rows are updated. You can pass only specific fields to be updated. @@ -10515,7 +11269,7 @@ export class TablesDB { * @param {string} tableId - Table ID. * @param {object} data - Row data as JSON object. Include only column and value pairs to be updated. * @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. - * @param {string} transactionId - Transaction ID for staging the operation. + * @param {string | null} transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise<Models.RowList<Row>>} * @deprecated Use the object parameter style method for a better developer experience. @@ -10525,7 +11279,7 @@ export class TablesDB { tableId: string, data?: object, queries?: string[], - transactionId?: string, + transactionId?: string | null, ): Promise<Models.RowList<Row>>; updateRows<Row extends Models.Row = Models.DefaultRow>( paramsOrFirst: @@ -10534,17 +11288,17 @@ export class TablesDB { tableId: string; data?: object; queries?: string[]; - transactionId?: string; + transactionId?: string | null; } | string, - ...rest: [string?, object?, string[]?, string?] + ...rest: [string?, object?, string[]?, (string | null)?] ): Promise<Models.RowList<Row>> { let params: { databaseId: string; tableId: string; data?: object; queries?: string[]; - transactionId?: string; + transactionId?: string | null; }; if ( @@ -10557,7 +11311,7 @@ export class TablesDB { tableId: string; data?: object; queries?: string[]; - transactionId?: string; + transactionId?: string | null; }; } else { params = { @@ -10565,7 +11319,7 @@ export class TablesDB { tableId: rest[0] as string, data: rest[1] as object, queries: rest[2] as string[], - transactionId: rest[3] as string, + transactionId: rest[3] as string | null, }; } @@ -10774,6 +11528,168 @@ export class TablesDB { return request.then((response) => applyDefaults(response, defaults)); } + /** + * Get a list of all the user's rows in a given table using a POST request. This behaves identically to the list rows endpoint but accepts the queries in the request body, allowing much larger `queries` arrays than can fit in a URL query string. + * + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/products/databases/tables#create-table). + * @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. + * @param {string | null} params.transactionId - Transaction ID to read uncommitted changes within the transaction. + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. + * @param {number} params.ttl - TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, table, schema version (columns and indexes), caller authorization roles, and the exact query — so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; row writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Lists with join queries are not cached. Must be between 0 and 86400 (24 hours). + * @throws {AppwriteException} + * @returns {Promise<Models.RowList<Row>>} + */ + createQuery<Row extends Models.Row = Models.DefaultRow>(params: { + databaseId: string; + tableId: string; + queries?: string[]; + transactionId?: string | null; + total?: boolean; + ttl?: number; + }): Promise<Models.RowList<Row>>; + /** + * Get a list of all the user's rows in a given table using a POST request. This behaves identically to the list rows endpoint but accepts the queries in the request body, allowing much larger `queries` arrays than can fit in a URL query string. + * + * + * @param {string} databaseId - Database ID. + * @param {string} tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/products/databases/tables#create-table). + * @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. + * @param {string | null} transactionId - Transaction ID to read uncommitted changes within the transaction. + * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. + * @param {number} ttl - TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, table, schema version (columns and indexes), caller authorization roles, and the exact query — so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; row writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Lists with join queries are not cached. Must be between 0 and 86400 (24 hours). + * @throws {AppwriteException} + * @returns {Promise<Models.RowList<Row>>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createQuery<Row extends Models.Row = Models.DefaultRow>( + databaseId: string, + tableId: string, + queries?: string[], + transactionId?: string | null, + total?: boolean, + ttl?: number, + ): Promise<Models.RowList<Row>>; + createQuery<Row extends Models.Row = Models.DefaultRow>( + paramsOrFirst: + | { + databaseId: string; + tableId: string; + queries?: string[]; + transactionId?: string | null; + total?: boolean; + ttl?: number; + } + | string, + ...rest: [string?, string[]?, (string | null)?, boolean?, number?] + ): Promise<Models.RowList<Row>> { + let params: { + databaseId: string; + tableId: string; + queries?: string[]; + transactionId?: string | null; + total?: boolean; + ttl?: number; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + databaseId: string; + tableId: string; + queries?: string[]; + transactionId?: string | null; + total?: boolean; + ttl?: number; + }; + } else { + params = { + databaseId: paramsOrFirst as string, + tableId: rest[0] as string, + queries: rest[1] as string[], + transactionId: rest[2] as string | null, + total: rest[3] as boolean, + ttl: rest[4] as number, + }; + } + + const databaseId = params.databaseId; + const tableId = params.tableId; + const queries = params.queries; + const transactionId = params.transactionId; + const total = params.total; + const ttl = params.ttl; + + if (typeof databaseId === 'undefined' || databaseId === '') { + throw new AppwriteException( + 'Missing required parameter: "databaseId"', + ); + } + if (typeof tableId === 'undefined' || tableId === '') { + throw new AppwriteException( + 'Missing required parameter: "tableId"', + ); + } + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/query' + .replace('{databaseId}', encodeURIComponent(String(databaseId))) + .replace('{tableId}', encodeURIComponent(String(tableId))); + const apiPayload: Payload = {}; + if (typeof queries !== 'undefined') { + apiPayload['queries'] = queries; + } + if (typeof transactionId !== 'undefined') { + apiPayload['transactionId'] = transactionId; + } + if (typeof total !== 'undefined') { + apiPayload['total'] = total; + } + if (typeof ttl !== 'undefined') { + apiPayload['ttl'] = ttl; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }; + + const request = this.client.call('post', uri, apiHeaders, apiPayload); + const defaults = { + root: 'rowList', + models: { + rowList: { + defaults: { + total: 0, + rows: [], + }, + properties: { + rows: { + items: 'row', + }, + }, + }, + row: { + defaults: { + $id: '', + $sequence: '', + $tableId: '', + $databaseId: '', + $createdAt: '', + $updatedAt: '', + $permissions: [], + }, + }, + }, + }; + + return request.then((response) => applyDefaults(response, defaults)); + } + /** * Get a row by its unique ID. This endpoint response returns a JSON object with the row data. * @@ -10918,8 +11834,8 @@ export class TablesDB { * @param {string} params.tableId - Table ID. * @param {string} params.rowId - Row ID. * @param {Row extends Models.DefaultRow ? Partial<Models.Row> & Record<string, any> : Partial<Models.Row> & Partial<Omit<Row, keyof Models.Row>>} params.data - Row data as JSON object. Include all required columns of the row to be created or updated. - * @param {string[]} params.permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param {string} params.transactionId - Transaction ID for staging the operation. + * @param {string[] | null} params.permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {string | null} params.transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise<Row>} */ @@ -10930,8 +11846,8 @@ export class TablesDB { data?: Row extends Models.DefaultRow ? Partial<Models.Row> & Record<string, any> : Partial<Models.Row> & Partial<Omit<Row, keyof Models.Row>>; - permissions?: string[]; - transactionId?: string; + permissions?: string[] | null; + transactionId?: string | null; }): Promise<Row>; /** * Create or update a Row. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable) API or directly from your database console. @@ -10940,8 +11856,8 @@ export class TablesDB { * @param {string} tableId - Table ID. * @param {string} rowId - Row ID. * @param {Row extends Models.DefaultRow ? Partial<Models.Row> & Record<string, any> : Partial<Models.Row> & Partial<Omit<Row, keyof Models.Row>>} data - Row data as JSON object. Include all required columns of the row to be created or updated. - * @param {string[]} permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param {string} transactionId - Transaction ID for staging the operation. + * @param {string[] | null} permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {string | null} transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise<Row>} * @deprecated Use the object parameter style method for a better developer experience. @@ -10953,8 +11869,8 @@ export class TablesDB { data?: Row extends Models.DefaultRow ? Partial<Models.Row> & Record<string, any> : Partial<Models.Row> & Partial<Omit<Row, keyof Models.Row>>, - permissions?: string[], - transactionId?: string, + permissions?: string[] | null, + transactionId?: string | null, ): Promise<Row>; upsertRow<Row extends Models.Row = Models.DefaultRow>( paramsOrFirst: @@ -10966,8 +11882,8 @@ export class TablesDB { ? Partial<Models.Row> & Record<string, any> : Partial<Models.Row> & Partial<Omit<Row, keyof Models.Row>>; - permissions?: string[]; - transactionId?: string; + permissions?: string[] | null; + transactionId?: string | null; } | string, ...rest: [ @@ -10976,8 +11892,8 @@ export class TablesDB { (Row extends Models.DefaultRow ? Partial<Models.Row> & Record<string, any> : Partial<Models.Row> & Partial<Omit<Row, keyof Models.Row>>)?, - string[]?, - string?, + (string[] | null)?, + (string | null)?, ] ): Promise<Row> { let params: { @@ -10987,8 +11903,8 @@ export class TablesDB { data?: Row extends Models.DefaultRow ? Partial<Models.Row> & Record<string, any> : Partial<Models.Row> & Partial<Omit<Row, keyof Models.Row>>; - permissions?: string[]; - transactionId?: string; + permissions?: string[] | null; + transactionId?: string | null; }; if ( @@ -11004,8 +11920,8 @@ export class TablesDB { ? Partial<Models.Row> & Record<string, any> : Partial<Models.Row> & Partial<Omit<Row, keyof Models.Row>>; - permissions?: string[]; - transactionId?: string; + permissions?: string[] | null; + transactionId?: string | null; }; } else { params = { @@ -11016,8 +11932,8 @@ export class TablesDB { ? Partial<Models.Row> & Record<string, any> : Partial<Models.Row> & Partial<Omit<Row, keyof Models.Row>>, - permissions: rest[3] as string[], - transactionId: rest[4] as string, + permissions: rest[3] as string[] | null, + transactionId: rest[4] as string | null, }; } @@ -11091,8 +12007,8 @@ export class TablesDB { * @param {string} params.tableId - Table ID. * @param {string} params.rowId - Row ID. * @param {Row extends Models.DefaultRow ? Partial<Models.Row> & Record<string, any> : Partial<Models.Row> & Partial<Omit<Row, keyof Models.Row>>} params.data - Row data as JSON object. Include only columns and value pairs to be updated. - * @param {string[]} params.permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param {string} params.transactionId - Transaction ID for staging the operation. + * @param {string[] | null} params.permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {string | null} params.transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise<Row>} */ @@ -11103,8 +12019,8 @@ export class TablesDB { data?: Row extends Models.DefaultRow ? Partial<Models.Row> & Record<string, any> : Partial<Models.Row> & Partial<Omit<Row, keyof Models.Row>>; - permissions?: string[]; - transactionId?: string; + permissions?: string[] | null; + transactionId?: string | null; }): Promise<Row>; /** * Update a row by its unique ID. Using the patch method you can pass only specific fields that will get updated. @@ -11113,8 +12029,8 @@ export class TablesDB { * @param {string} tableId - Table ID. * @param {string} rowId - Row ID. * @param {Row extends Models.DefaultRow ? Partial<Models.Row> & Record<string, any> : Partial<Models.Row> & Partial<Omit<Row, keyof Models.Row>>} data - Row data as JSON object. Include only columns and value pairs to be updated. - * @param {string[]} permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param {string} transactionId - Transaction ID for staging the operation. + * @param {string[] | null} permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {string | null} transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise<Row>} * @deprecated Use the object parameter style method for a better developer experience. @@ -11126,8 +12042,8 @@ export class TablesDB { data?: Row extends Models.DefaultRow ? Partial<Models.Row> & Record<string, any> : Partial<Models.Row> & Partial<Omit<Row, keyof Models.Row>>, - permissions?: string[], - transactionId?: string, + permissions?: string[] | null, + transactionId?: string | null, ): Promise<Row>; updateRow<Row extends Models.Row = Models.DefaultRow>( paramsOrFirst: @@ -11139,8 +12055,8 @@ export class TablesDB { ? Partial<Models.Row> & Record<string, any> : Partial<Models.Row> & Partial<Omit<Row, keyof Models.Row>>; - permissions?: string[]; - transactionId?: string; + permissions?: string[] | null; + transactionId?: string | null; } | string, ...rest: [ @@ -11149,8 +12065,8 @@ export class TablesDB { (Row extends Models.DefaultRow ? Partial<Models.Row> & Record<string, any> : Partial<Models.Row> & Partial<Omit<Row, keyof Models.Row>>)?, - string[]?, - string?, + (string[] | null)?, + (string | null)?, ] ): Promise<Row> { let params: { @@ -11160,8 +12076,8 @@ export class TablesDB { data?: Row extends Models.DefaultRow ? Partial<Models.Row> & Record<string, any> : Partial<Models.Row> & Partial<Omit<Row, keyof Models.Row>>; - permissions?: string[]; - transactionId?: string; + permissions?: string[] | null; + transactionId?: string | null; }; if ( @@ -11177,8 +12093,8 @@ export class TablesDB { ? Partial<Models.Row> & Record<string, any> : Partial<Models.Row> & Partial<Omit<Row, keyof Models.Row>>; - permissions?: string[]; - transactionId?: string; + permissions?: string[] | null; + transactionId?: string | null; }; } else { params = { @@ -11189,8 +12105,8 @@ export class TablesDB { ? Partial<Models.Row> & Record<string, any> : Partial<Models.Row> & Partial<Omit<Row, keyof Models.Row>>, - permissions: rest[3] as string[], - transactionId: rest[4] as string, + permissions: rest[3] as string[] | null, + transactionId: rest[4] as string | null, }; } @@ -11373,8 +12289,8 @@ export class TablesDB { * @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 {string} params.transactionId - Transaction ID for staging the operation. + * @param {number | null} params.min - Minimum value for the column. If the current value is lesser than this value, an exception will be thrown. + * @param {string | null} params.transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise<Row>} */ @@ -11384,8 +12300,8 @@ export class TablesDB { rowId: string; column: string; value?: number; - min?: number; - transactionId?: string; + min?: number | null; + transactionId?: string | null; }): Promise<Row>; /** * Decrement a specific column of a row by a given value. @@ -11395,8 +12311,8 @@ export class TablesDB { * @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 {string} transactionId - Transaction ID for staging the operation. + * @param {number | null} min - Minimum value for the column. If the current value is lesser than this value, an exception will be thrown. + * @param {string | null} transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise<Row>} * @deprecated Use the object parameter style method for a better developer experience. @@ -11407,8 +12323,8 @@ export class TablesDB { rowId: string, column: string, value?: number, - min?: number, - transactionId?: string, + min?: number | null, + transactionId?: string | null, ): Promise<Row>; decrementRowColumn<Row extends Models.Row = Models.DefaultRow>( paramsOrFirst: @@ -11418,11 +12334,18 @@ export class TablesDB { rowId: string; column: string; value?: number; - min?: number; - transactionId?: string; + min?: number | null; + transactionId?: string | null; } | string, - ...rest: [string?, string?, string?, number?, number?, string?] + ...rest: [ + string?, + string?, + string?, + number?, + (number | null)?, + (string | null)?, + ] ): Promise<Row> { let params: { databaseId: string; @@ -11430,8 +12353,8 @@ export class TablesDB { rowId: string; column: string; value?: number; - min?: number; - transactionId?: string; + min?: number | null; + transactionId?: string | null; }; if ( @@ -11445,8 +12368,8 @@ export class TablesDB { rowId: string; column: string; value?: number; - min?: number; - transactionId?: string; + min?: number | null; + transactionId?: string | null; }; } else { params = { @@ -11455,8 +12378,8 @@ export class TablesDB { rowId: rest[1] as string, column: rest[2] as string, value: rest[3] as number, - min: rest[4] as number, - transactionId: rest[5] as string, + min: rest[4] as number | null, + transactionId: rest[5] as string | null, }; } @@ -11537,8 +12460,8 @@ export class TablesDB { * @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 {string} params.transactionId - Transaction ID for staging the operation. + * @param {number | null} params.max - Maximum value for the column. If the current value is greater than this value, an error will be thrown. + * @param {string | null} params.transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise<Row>} */ @@ -11548,8 +12471,8 @@ export class TablesDB { rowId: string; column: string; value?: number; - max?: number; - transactionId?: string; + max?: number | null; + transactionId?: string | null; }): Promise<Row>; /** * Increment a specific column of a row by a given value. @@ -11559,8 +12482,8 @@ export class TablesDB { * @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 {string} transactionId - Transaction ID for staging the operation. + * @param {number | null} max - Maximum value for the column. If the current value is greater than this value, an error will be thrown. + * @param {string | null} transactionId - Transaction ID for staging the operation. * @throws {AppwriteException} * @returns {Promise<Row>} * @deprecated Use the object parameter style method for a better developer experience. @@ -11571,8 +12494,8 @@ export class TablesDB { rowId: string, column: string, value?: number, - max?: number, - transactionId?: string, + max?: number | null, + transactionId?: string | null, ): Promise<Row>; incrementRowColumn<Row extends Models.Row = Models.DefaultRow>( paramsOrFirst: @@ -11582,11 +12505,18 @@ export class TablesDB { rowId: string; column: string; value?: number; - max?: number; - transactionId?: string; + max?: number | null; + transactionId?: string | null; } | string, - ...rest: [string?, string?, string?, number?, number?, string?] + ...rest: [ + string?, + string?, + string?, + number?, + (number | null)?, + (string | null)?, + ] ): Promise<Row> { let params: { databaseId: string; @@ -11594,8 +12524,8 @@ export class TablesDB { rowId: string; column: string; value?: number; - max?: number; - transactionId?: string; + max?: number | null; + transactionId?: string | null; }; if ( @@ -11609,8 +12539,8 @@ export class TablesDB { rowId: string; column: string; value?: number; - max?: number; - transactionId?: string; + max?: number | null; + transactionId?: string | null; }; } else { params = { @@ -11619,8 +12549,8 @@ export class TablesDB { rowId: rest[1] as string, column: rest[2] as string, value: rest[3] as number, - max: rest[4] as number, - transactionId: rest[5] as string, + max: rest[4] as number | null, + transactionId: rest[5] as string | null, }; } diff --git a/src/services/teams.ts b/src/services/teams.ts index 04524e39..66cf6dc9 100644 --- a/src/services/teams.ts +++ b/src/services/teams.ts @@ -768,21 +768,21 @@ export class Teams { * * @param {string} params.teamId - Team ID. * @param {string} params.installationId - Installation unique ID. - * @param {string} params.authorizationDetails - Authorization details granted to the installation as a JSON array of objects, each with a `type` and app-defined fields. Omit to keep the current value. + * @param {string | null} params.authorizationDetails - Authorization details granted to the installation as a JSON array of objects, each with a `type` and app-defined fields. Omit to keep the current value. * @throws {AppwriteException} * @returns {Promise<Models.AppInstallation>} */ updateInstallation(params: { teamId: string; installationId: string; - authorizationDetails?: string; + authorizationDetails?: string | null; }): Promise<Models.AppInstallation>; /** * Update an app installation on a team. Only team members with the owner role can update installations. The installation's granted scopes are refreshed to the scopes the app currently requests; previously issued installation access tokens are revoked. * * @param {string} teamId - Team ID. * @param {string} installationId - Installation unique ID. - * @param {string} authorizationDetails - Authorization details granted to the installation as a JSON array of objects, each with a `type` and app-defined fields. Omit to keep the current value. + * @param {string | null} authorizationDetails - Authorization details granted to the installation as a JSON array of objects, each with a `type` and app-defined fields. Omit to keep the current value. * @throws {AppwriteException} * @returns {Promise<Models.AppInstallation>} * @deprecated Use the object parameter style method for a better developer experience. @@ -790,22 +790,22 @@ export class Teams { updateInstallation( teamId: string, installationId: string, - authorizationDetails?: string, + authorizationDetails?: string | null, ): Promise<Models.AppInstallation>; updateInstallation( paramsOrFirst: | { teamId: string; installationId: string; - authorizationDetails?: string; + authorizationDetails?: string | null; } | string, - ...rest: [string?, string?] + ...rest: [string?, (string | null)?] ): Promise<Models.AppInstallation> { let params: { teamId: string; installationId: string; - authorizationDetails?: string; + authorizationDetails?: string | null; }; if ( @@ -816,13 +816,13 @@ export class Teams { params = (paramsOrFirst || {}) as { teamId: string; installationId: string; - authorizationDetails?: string; + authorizationDetails?: string | null; }; } else { params = { teamId: paramsOrFirst as string, installationId: rest[0] as string, - authorizationDetails: rest[1] as string, + authorizationDetails: rest[1] as string | null, }; } diff --git a/src/services/tokens.ts b/src/services/tokens.ts index c30dc692..d031c347 100644 --- a/src/services/tokens.ts +++ b/src/services/tokens.ts @@ -151,21 +151,21 @@ export class Tokens { * * @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.expire - Token expiry date + * @param {string | null} params.expire - Token expiry date * @throws {AppwriteException} * @returns {Promise<Models.ResourceToken>} */ createFileToken(params: { bucketId: string; fileId: string; - expire?: string; + expire?: string | null; }): Promise<Models.ResourceToken>; /** * Create a new token. A token is linked to a file. Token can be passed as a request URL search parameter. * * @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} expire - Token expiry date + * @param {string | null} expire - Token expiry date * @throws {AppwriteException} * @returns {Promise<Models.ResourceToken>} * @deprecated Use the object parameter style method for a better developer experience. @@ -173,14 +173,19 @@ export class Tokens { createFileToken( bucketId: string, fileId: string, - expire?: string, + expire?: string | null, ): Promise<Models.ResourceToken>; createFileToken( paramsOrFirst: - { bucketId: string; fileId: string; expire?: string } | string, - ...rest: [string?, string?] + | { bucketId: string; fileId: string; expire?: string | null } + | string, + ...rest: [string?, (string | null)?] ): Promise<Models.ResourceToken> { - let params: { bucketId: string; fileId: string; expire?: string }; + let params: { + bucketId: string; + fileId: string; + expire?: string | null; + }; if ( paramsOrFirst && @@ -190,13 +195,13 @@ export class Tokens { params = (paramsOrFirst || {}) as { bucketId: string; fileId: string; - expire?: string; + expire?: string | null; }; } else { params = { bucketId: paramsOrFirst as string, fileId: rest[0] as string, - expire: rest[1] as string, + expire: rest[1] as string | null, }; } @@ -326,29 +331,32 @@ export class Tokens { * Update a token by its unique ID. Use this endpoint to update a token's expiry date. * * @param {string} params.tokenId - Token unique ID. - * @param {string} params.expire - File token expiry date + * @param {string | null} params.expire - File token expiry date * @throws {AppwriteException} * @returns {Promise<Models.ResourceToken>} */ update(params: { tokenId: string; - expire?: string; + expire?: string | null; }): Promise<Models.ResourceToken>; /** * Update a token by its unique ID. Use this endpoint to update a token's expiry date. * * @param {string} tokenId - Token unique ID. - * @param {string} expire - File token expiry date + * @param {string | null} expire - File token expiry date * @throws {AppwriteException} * @returns {Promise<Models.ResourceToken>} * @deprecated Use the object parameter style method for a better developer experience. */ - update(tokenId: string, expire?: string): Promise<Models.ResourceToken>; update( - paramsOrFirst: { tokenId: string; expire?: string } | string, - ...rest: [string?] + tokenId: string, + expire?: string | null, + ): Promise<Models.ResourceToken>; + update( + paramsOrFirst: { tokenId: string; expire?: string | null } | string, + ...rest: [(string | null)?] ): Promise<Models.ResourceToken> { - let params: { tokenId: string; expire?: string }; + let params: { tokenId: string; expire?: string | null }; if ( paramsOrFirst && @@ -357,12 +365,12 @@ export class Tokens { ) { params = (paramsOrFirst || {}) as { tokenId: string; - expire?: string; + expire?: string | null; }; } else { params = { tokenId: paramsOrFirst as string, - expire: rest[0] as string, + expire: rest[0] as string | null, }; } diff --git a/src/services/users.ts b/src/services/users.ts index b10116d5..091daa1f 100644 --- a/src/services/users.ts +++ b/src/services/users.ts @@ -157,9 +157,9 @@ export class Users { * Create a new user. * * @param {string} params.userId - User 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.email - User email. - * @param {string} params.phone - Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212. - * @param {string} params.password - Plain text user password. Must be at least 8 chars. + * @param {string | null} params.email - User email. + * @param {string | null} params.phone - Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212. + * @param {string | null} params.password - Plain text user password. Must be at least 8 chars. * @param {string} params.name - User name. Max length: 128 chars. * @throws {AppwriteException} * @returns {Promise<Models.User<Preferences>>} @@ -168,18 +168,18 @@ export class Users { Preferences extends Models.Preferences = Models.DefaultPreferences, >(params: { userId: string; - email?: string; - phone?: string; - password?: string; + email?: string | null; + phone?: string | null; + password?: string | null; name?: string; }): Promise<Models.User<Preferences>>; /** * Create a new user. * * @param {string} userId - User 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} email - User email. - * @param {string} phone - Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212. - * @param {string} password - Plain text user password. Must be at least 8 chars. + * @param {string | null} email - User email. + * @param {string | null} phone - Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212. + * @param {string | null} password - Plain text user password. Must be at least 8 chars. * @param {string} name - User name. Max length: 128 chars. * @throws {AppwriteException} * @returns {Promise<Models.User<Preferences>>} @@ -187,28 +187,28 @@ export class Users { */ create<Preferences extends Models.Preferences = Models.DefaultPreferences>( userId: string, - email?: string, - phone?: string, - password?: string, + email?: string | null, + phone?: string | null, + password?: string | null, name?: string, ): Promise<Models.User<Preferences>>; create<Preferences extends Models.Preferences = Models.DefaultPreferences>( paramsOrFirst: | { userId: string; - email?: string; - phone?: string; - password?: string; + email?: string | null; + phone?: string | null; + password?: string | null; name?: string; } | string, - ...rest: [string?, string?, string?, string?] + ...rest: [(string | null)?, (string | null)?, (string | null)?, string?] ): Promise<Models.User<Preferences>> { let params: { userId: string; - email?: string; - phone?: string; - password?: string; + email?: string | null; + phone?: string | null; + password?: string | null; name?: string; }; @@ -219,17 +219,17 @@ export class Users { ) { params = (paramsOrFirst || {}) as { userId: string; - email?: string; - phone?: string; - password?: string; + email?: string | null; + phone?: string | null; + password?: string | null; name?: string; }; } else { params = { userId: paramsOrFirst as string, - email: rest[0] as string, - phone: rest[1] as string, - password: rest[2] as string, + email: rest[0] as string | null, + phone: rest[1] as string | null, + password: rest[2] as string | null, name: rest[3] as string, }; } diff --git a/src/services/vectors-db.ts b/src/services/vectors-db.ts index 54a2550b..43ab2660 100644 --- a/src/services/vectors-db.ts +++ b/src/services/vectors-db.ts @@ -97,6 +97,7 @@ export class VectorsDB { defaults: { $id: '', name: '', + description: '', $createdAt: '', $updatedAt: '', enabled: true, @@ -150,9 +151,10 @@ export class VectorsDB { * @param {string} params.databaseId - 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.name - Database name. Max length: 128 chars. * @param {boolean} params.enabled - Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. + * @param {string} params.description - Optional description for the database. * @param {string} params.specification - Database specification. Defaults to `serverless`, which creates the database on the shared pool. Any other value provisions a dedicated database on that specification. * @param {number} params.replicas - Number of high availability replicas (0-5) for the dedicated database backing this database. Requires a dedicated `specification`; must be 0 for a serverless database. High availability is enabled when greater than 0. - * @param {string} params.syncMode - Replication sync mode for the dedicated database backing this database. Requires a dedicated `specification`; the mode is only in force once there is at least one replica. Allowed values: async, sync, quorum. + * @param {string | null} params.syncMode - Replication sync mode for the dedicated database backing this database. Requires a dedicated `specification`; the mode is only in force once there is at least one replica. Allowed values: async, sync, quorum. * @throws {AppwriteException} * @returns {Promise<Models.Database>} */ @@ -160,9 +162,10 @@ export class VectorsDB { databaseId: string; name: string; enabled?: boolean; + description?: string; specification?: string; replicas?: number; - syncMode?: string; + syncMode?: string | null; }): Promise<Models.Database>; /** * Create a new Database. @@ -171,9 +174,10 @@ export class VectorsDB { * @param {string} databaseId - 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} name - Database name. Max length: 128 chars. * @param {boolean} enabled - Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. + * @param {string} description - Optional description for the database. * @param {string} specification - Database specification. Defaults to `serverless`, which creates the database on the shared pool. Any other value provisions a dedicated database on that specification. * @param {number} replicas - Number of high availability replicas (0-5) for the dedicated database backing this database. Requires a dedicated `specification`; must be 0 for a serverless database. High availability is enabled when greater than 0. - * @param {string} syncMode - Replication sync mode for the dedicated database backing this database. Requires a dedicated `specification`; the mode is only in force once there is at least one replica. Allowed values: async, sync, quorum. + * @param {string | null} syncMode - Replication sync mode for the dedicated database backing this database. Requires a dedicated `specification`; the mode is only in force once there is at least one replica. Allowed values: async, sync, quorum. * @throws {AppwriteException} * @returns {Promise<Models.Database>} * @deprecated Use the object parameter style method for a better developer experience. @@ -182,9 +186,10 @@ export class VectorsDB { databaseId: string, name: string, enabled?: boolean, + description?: string, specification?: string, replicas?: number, - syncMode?: string, + syncMode?: string | null, ): Promise<Models.Database>; create( paramsOrFirst: @@ -192,20 +197,29 @@ export class VectorsDB { databaseId: string; name: string; enabled?: boolean; + description?: string; specification?: string; replicas?: number; - syncMode?: string; + syncMode?: string | null; } | string, - ...rest: [string?, boolean?, string?, number?, string?] + ...rest: [ + string?, + boolean?, + string?, + string?, + number?, + (string | null)?, + ] ): Promise<Models.Database> { let params: { databaseId: string; name: string; enabled?: boolean; + description?: string; specification?: string; replicas?: number; - syncMode?: string; + syncMode?: string | null; }; if ( @@ -217,24 +231,27 @@ export class VectorsDB { databaseId: string; name: string; enabled?: boolean; + description?: string; specification?: string; replicas?: number; - syncMode?: string; + syncMode?: string | null; }; } else { params = { databaseId: paramsOrFirst as string, name: rest[0] as string, enabled: rest[1] as boolean, - specification: rest[2] as string, - replicas: rest[3] as number, - syncMode: rest[4] as string, + description: rest[2] as string, + specification: rest[3] as string, + replicas: rest[4] as number, + syncMode: rest[5] as string | null, }; } const databaseId = params.databaseId; const name = params.name; const enabled = params.enabled; + const description = params.description; const specification = params.specification; const replicas = params.replicas; const syncMode = params.syncMode; @@ -258,6 +275,9 @@ export class VectorsDB { if (typeof enabled !== 'undefined') { apiPayload['enabled'] = enabled; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } if (typeof specification !== 'undefined') { apiPayload['specification'] = specification; } @@ -283,6 +303,7 @@ export class VectorsDB { defaults: { $id: '', name: '', + description: '', $createdAt: '', $updatedAt: '', enabled: true, @@ -943,6 +964,7 @@ export class VectorsDB { defaults: { $id: '', name: '', + description: '', $createdAt: '', $updatedAt: '', enabled: true, @@ -995,9 +1017,10 @@ export class VectorsDB { * @param {string} params.databaseId - Database ID. * @param {string} params.name - Database name. Max length: 128 chars. * @param {boolean} params.enabled - Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. - * @param {string} params.specification - Database specification. Resizing between dedicated specifications changes cpu, memory, storage and the connection ceiling via a rolling cutover with zero downtime. Moving a `serverless` database onto a dedicated specification is a data migration, not a resize. - * @param {number} params.replicas - Number of high availability replicas (0-5) for the dedicated database backing this database. Only valid when the database is backed by a dedicated specification. High availability is enabled when greater than 0. - * @param {string} params.syncMode - Replication sync mode for the dedicated database backing this database. Only valid when the database is backed by a dedicated specification; the mode is only in force once there is at least one replica. Allowed values: async, sync, quorum. + * @param {string | null} params.description - Optional description for the database. + * @param {string | null} params.specification - Database specification. Resizing between dedicated specifications changes cpu, memory, storage and the connection ceiling via a rolling cutover with zero downtime. Moving a `serverless` database onto a dedicated specification is a data migration, not a resize. + * @param {number | null} params.replicas - Number of high availability replicas (0-5) for the dedicated database backing this database. Only valid when the database is backed by a dedicated specification. High availability is enabled when greater than 0. + * @param {string | null} params.syncMode - Replication sync mode for the dedicated database backing this database. Only valid when the database is backed by a dedicated specification; the mode is only in force once there is at least one replica. Allowed values: async, sync, quorum. * @throws {AppwriteException} * @returns {Promise<Models.Database>} */ @@ -1005,9 +1028,10 @@ export class VectorsDB { databaseId: string; name: string; enabled?: boolean; - specification?: string; - replicas?: number; - syncMode?: string; + description?: string | null; + specification?: string | null; + replicas?: number | null; + syncMode?: string | null; }): Promise<Models.Database>; /** * Update a database by its unique ID. @@ -1015,9 +1039,10 @@ export class VectorsDB { * @param {string} databaseId - Database ID. * @param {string} name - Database name. Max length: 128 chars. * @param {boolean} enabled - Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. - * @param {string} specification - Database specification. Resizing between dedicated specifications changes cpu, memory, storage and the connection ceiling via a rolling cutover with zero downtime. Moving a `serverless` database onto a dedicated specification is a data migration, not a resize. - * @param {number} replicas - Number of high availability replicas (0-5) for the dedicated database backing this database. Only valid when the database is backed by a dedicated specification. High availability is enabled when greater than 0. - * @param {string} syncMode - Replication sync mode for the dedicated database backing this database. Only valid when the database is backed by a dedicated specification; the mode is only in force once there is at least one replica. Allowed values: async, sync, quorum. + * @param {string | null} description - Optional description for the database. + * @param {string | null} specification - Database specification. Resizing between dedicated specifications changes cpu, memory, storage and the connection ceiling via a rolling cutover with zero downtime. Moving a `serverless` database onto a dedicated specification is a data migration, not a resize. + * @param {number | null} replicas - Number of high availability replicas (0-5) for the dedicated database backing this database. Only valid when the database is backed by a dedicated specification. High availability is enabled when greater than 0. + * @param {string | null} syncMode - Replication sync mode for the dedicated database backing this database. Only valid when the database is backed by a dedicated specification; the mode is only in force once there is at least one replica. Allowed values: async, sync, quorum. * @throws {AppwriteException} * @returns {Promise<Models.Database>} * @deprecated Use the object parameter style method for a better developer experience. @@ -1026,9 +1051,10 @@ export class VectorsDB { databaseId: string, name: string, enabled?: boolean, - specification?: string, - replicas?: number, - syncMode?: string, + description?: string | null, + specification?: string | null, + replicas?: number | null, + syncMode?: string | null, ): Promise<Models.Database>; update( paramsOrFirst: @@ -1036,20 +1062,29 @@ export class VectorsDB { databaseId: string; name: string; enabled?: boolean; - specification?: string; - replicas?: number; - syncMode?: string; + description?: string | null; + specification?: string | null; + replicas?: number | null; + syncMode?: string | null; } | string, - ...rest: [string?, boolean?, string?, number?, string?] + ...rest: [ + string?, + boolean?, + (string | null)?, + (string | null)?, + (number | null)?, + (string | null)?, + ] ): Promise<Models.Database> { let params: { databaseId: string; name: string; enabled?: boolean; - specification?: string; - replicas?: number; - syncMode?: string; + description?: string | null; + specification?: string | null; + replicas?: number | null; + syncMode?: string | null; }; if ( @@ -1061,24 +1096,27 @@ export class VectorsDB { databaseId: string; name: string; enabled?: boolean; - specification?: string; - replicas?: number; - syncMode?: string; + description?: string | null; + specification?: string | null; + replicas?: number | null; + syncMode?: string | null; }; } else { params = { databaseId: paramsOrFirst as string, name: rest[0] as string, enabled: rest[1] as boolean, - specification: rest[2] as string, - replicas: rest[3] as number, - syncMode: rest[4] as string, + description: rest[2] as string | null, + specification: rest[3] as string | null, + replicas: rest[4] as number | null, + syncMode: rest[5] as string | null, }; } const databaseId = params.databaseId; const name = params.name; const enabled = params.enabled; + const description = params.description; const specification = params.specification; const replicas = params.replicas; const syncMode = params.syncMode; @@ -1102,6 +1140,9 @@ export class VectorsDB { if (typeof enabled !== 'undefined') { apiPayload['enabled'] = enabled; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } if (typeof specification !== 'undefined') { apiPayload['specification'] = specification; } @@ -1127,6 +1168,7 @@ export class VectorsDB { defaults: { $id: '', name: '', + description: '', $createdAt: '', $updatedAt: '', enabled: true, @@ -1353,6 +1395,7 @@ export class VectorsDB { $permissions: [], databaseId: '', name: '', + description: '', enabled: true, documentSecurity: false, attributes: [], @@ -1373,6 +1416,7 @@ export class VectorsDB { $createdAt: '', $updatedAt: '', key: '', + description: '', type: '', error: '', attributes: [], @@ -1395,6 +1439,7 @@ export class VectorsDB { * @param {string[]} params.permissions - An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} params.documentSecurity - Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} params.enabled - Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled. + * @param {string} params.description - Optional description for the collection. * @throws {AppwriteException} * @returns {Promise<Models.VectorsdbCollection>} */ @@ -1406,6 +1451,7 @@ export class VectorsDB { permissions?: string[]; documentSecurity?: boolean; enabled?: boolean; + description?: string; }): Promise<Models.VectorsdbCollection>; /** * Create a new Collection. Before using this route, you should create a new database resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. @@ -1417,6 +1463,7 @@ export class VectorsDB { * @param {string[]} permissions - An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} documentSecurity - Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} enabled - Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled. + * @param {string} description - Optional description for the collection. * @throws {AppwriteException} * @returns {Promise<Models.VectorsdbCollection>} * @deprecated Use the object parameter style method for a better developer experience. @@ -1429,6 +1476,7 @@ export class VectorsDB { permissions?: string[], documentSecurity?: boolean, enabled?: boolean, + description?: string, ): Promise<Models.VectorsdbCollection>; createCollection( paramsOrFirst: @@ -1440,9 +1488,18 @@ export class VectorsDB { permissions?: string[]; documentSecurity?: boolean; enabled?: boolean; + description?: string; } | string, - ...rest: [string?, string?, number?, string[]?, boolean?, boolean?] + ...rest: [ + string?, + string?, + number?, + string[]?, + boolean?, + boolean?, + string?, + ] ): Promise<Models.VectorsdbCollection> { let params: { databaseId: string; @@ -1452,6 +1509,7 @@ export class VectorsDB { permissions?: string[]; documentSecurity?: boolean; enabled?: boolean; + description?: string; }; if ( @@ -1467,6 +1525,7 @@ export class VectorsDB { permissions?: string[]; documentSecurity?: boolean; enabled?: boolean; + description?: string; }; } else { params = { @@ -1477,6 +1536,7 @@ export class VectorsDB { permissions: rest[3] as string[], documentSecurity: rest[4] as boolean, enabled: rest[5] as boolean, + description: rest[6] as string, }; } @@ -1487,6 +1547,7 @@ export class VectorsDB { const permissions = params.permissions; const documentSecurity = params.documentSecurity; const enabled = params.enabled; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -1529,6 +1590,9 @@ export class VectorsDB { if (typeof enabled !== 'undefined') { apiPayload['enabled'] = enabled; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -1549,6 +1613,7 @@ export class VectorsDB { $permissions: [], databaseId: '', name: '', + description: '', enabled: true, documentSecurity: false, attributes: [], @@ -1569,6 +1634,7 @@ export class VectorsDB { $createdAt: '', $updatedAt: '', key: '', + description: '', type: '', error: '', attributes: [], @@ -1667,6 +1733,7 @@ export class VectorsDB { $permissions: [], databaseId: '', name: '', + description: '', enabled: true, documentSecurity: false, attributes: [], @@ -1687,6 +1754,7 @@ export class VectorsDB { $createdAt: '', $updatedAt: '', key: '', + description: '', type: '', error: '', attributes: [], @@ -1708,7 +1776,8 @@ export class VectorsDB { * @param {number} params.dimension - Embedding dimensions. * @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.documentSecurity - Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param {boolean} params.enabled - Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled. + * @param {boolean | null} params.enabled - Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled. + * @param {string | null} params.description - Optional description for the collection. * @throws {AppwriteException} * @returns {Promise<Models.VectorsdbCollection>} */ @@ -1719,7 +1788,8 @@ export class VectorsDB { dimension?: number; permissions?: string[]; documentSecurity?: boolean; - enabled?: boolean; + enabled?: boolean | null; + description?: string | null; }): Promise<Models.VectorsdbCollection>; /** * Update a collection by its unique ID. @@ -1730,7 +1800,8 @@ export class VectorsDB { * @param {number} dimension - Embedding dimensions. * @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} documentSecurity - Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param {boolean} enabled - Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled. + * @param {boolean | null} enabled - Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled. + * @param {string | null} description - Optional description for the collection. * @throws {AppwriteException} * @returns {Promise<Models.VectorsdbCollection>} * @deprecated Use the object parameter style method for a better developer experience. @@ -1742,7 +1813,8 @@ export class VectorsDB { dimension?: number, permissions?: string[], documentSecurity?: boolean, - enabled?: boolean, + enabled?: boolean | null, + description?: string | null, ): Promise<Models.VectorsdbCollection>; updateCollection( paramsOrFirst: @@ -1753,10 +1825,19 @@ export class VectorsDB { dimension?: number; permissions?: string[]; documentSecurity?: boolean; - enabled?: boolean; + enabled?: boolean | null; + description?: string | null; } | string, - ...rest: [string?, string?, number?, string[]?, boolean?, boolean?] + ...rest: [ + string?, + string?, + number?, + string[]?, + boolean?, + (boolean | null)?, + (string | null)?, + ] ): Promise<Models.VectorsdbCollection> { let params: { databaseId: string; @@ -1765,7 +1846,8 @@ export class VectorsDB { dimension?: number; permissions?: string[]; documentSecurity?: boolean; - enabled?: boolean; + enabled?: boolean | null; + description?: string | null; }; if ( @@ -1780,7 +1862,8 @@ export class VectorsDB { dimension?: number; permissions?: string[]; documentSecurity?: boolean; - enabled?: boolean; + enabled?: boolean | null; + description?: string | null; }; } else { params = { @@ -1790,7 +1873,8 @@ export class VectorsDB { dimension: rest[2] as number, permissions: rest[3] as string[], documentSecurity: rest[4] as boolean, - enabled: rest[5] as boolean, + enabled: rest[5] as boolean | null, + description: rest[6] as string | null, }; } @@ -1801,6 +1885,7 @@ export class VectorsDB { const permissions = params.permissions; const documentSecurity = params.documentSecurity; const enabled = params.enabled; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -1837,6 +1922,9 @@ export class VectorsDB { if (typeof enabled !== 'undefined') { apiPayload['enabled'] = enabled; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -1857,6 +1945,7 @@ export class VectorsDB { $permissions: [], databaseId: '', name: '', + description: '', enabled: true, documentSecurity: false, attributes: [], @@ -1877,6 +1966,7 @@ export class VectorsDB { $createdAt: '', $updatedAt: '', key: '', + description: '', type: '', error: '', attributes: [], @@ -3846,6 +3936,7 @@ export class VectorsDB { $createdAt: '', $updatedAt: '', key: '', + description: '', type: '', error: '', attributes: [], @@ -3869,6 +3960,7 @@ export class VectorsDB { * @param {string[]} params.attributes - Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long. * @param {OrderBy[]} params.orders - Array of index orders. Maximum of 100 orders are allowed. * @param {number[]} params.lengths - Length of index. Maximum of 100 + * @param {string} params.description - Optional description for the index. * @throws {AppwriteException} * @returns {Promise<Models.Index>} */ @@ -3880,6 +3972,7 @@ export class VectorsDB { attributes: string[]; orders?: OrderBy[]; lengths?: number[]; + description?: string; }): Promise<Models.Index>; /** * Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request. @@ -3892,6 +3985,7 @@ export class VectorsDB { * @param {string[]} attributes - Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long. * @param {OrderBy[]} orders - Array of index orders. Maximum of 100 orders are allowed. * @param {number[]} lengths - Length of index. Maximum of 100 + * @param {string} description - Optional description for the index. * @throws {AppwriteException} * @returns {Promise<Models.Index>} * @deprecated Use the object parameter style method for a better developer experience. @@ -3904,6 +3998,7 @@ export class VectorsDB { attributes: string[], orders?: OrderBy[], lengths?: number[], + description?: string, ): Promise<Models.Index>; createIndex( paramsOrFirst: @@ -3915,6 +4010,7 @@ export class VectorsDB { attributes: string[]; orders?: OrderBy[]; lengths?: number[]; + description?: string; } | string, ...rest: [ @@ -3924,6 +4020,7 @@ export class VectorsDB { string[]?, OrderBy[]?, number[]?, + string?, ] ): Promise<Models.Index> { let params: { @@ -3934,6 +4031,7 @@ export class VectorsDB { attributes: string[]; orders?: OrderBy[]; lengths?: number[]; + description?: string; }; if ( @@ -3949,6 +4047,7 @@ export class VectorsDB { attributes: string[]; orders?: OrderBy[]; lengths?: number[]; + description?: string; }; } else { params = { @@ -3959,6 +4058,7 @@ export class VectorsDB { attributes: rest[3] as string[], orders: rest[4] as OrderBy[], lengths: rest[5] as number[], + description: rest[6] as string, }; } @@ -3969,6 +4069,7 @@ export class VectorsDB { const attributes = params.attributes; const orders = params.orders; const lengths = params.lengths; + const description = params.description; if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( @@ -4014,6 +4115,9 @@ export class VectorsDB { if (typeof lengths !== 'undefined') { apiPayload['lengths'] = lengths; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -4032,6 +4136,7 @@ export class VectorsDB { $createdAt: '', $updatedAt: '', key: '', + description: '', type: '', error: '', attributes: [], @@ -4141,6 +4246,7 @@ export class VectorsDB { $createdAt: '', $updatedAt: '', key: '', + description: '', type: '', error: '', attributes: [], @@ -4248,33 +4354,33 @@ export class VectorsDB { * Trigger a manual failover for a dedicated database with high availability enabled. Promotes a replica to primary. The failover runs asynchronously; poll the database document for status updates. A database left mid-operation also accepts this call as a repair once nothing is driving the operation it is stuck in. Repairing a failover that did not finish, a `failed` database, a stranded upgrade or migrate, or a stranded compute resize additionally requires `targetReplicaId` to name the member to promote, because the default target may be the member that operation already promoted. * * @param {string} params.databaseId - Database ID. - * @param {string} params.targetReplicaId - Target replica ID to promote. If not specified, the healthiest replica is selected. + * @param {string | null} params.targetReplicaId - Target replica ID to promote. If not specified, the healthiest replica is selected. * @throws {AppwriteException} * @returns {Promise<Models.DedicatedDatabase>} */ createFailover(params: { databaseId: string; - targetReplicaId?: string; + targetReplicaId?: string | null; }): Promise<Models.DedicatedDatabase>; /** * Trigger a manual failover for a dedicated database with high availability enabled. Promotes a replica to primary. The failover runs asynchronously; poll the database document for status updates. A database left mid-operation also accepts this call as a repair once nothing is driving the operation it is stuck in. Repairing a failover that did not finish, a `failed` database, a stranded upgrade or migrate, or a stranded compute resize additionally requires `targetReplicaId` to name the member to promote, because the default target may be the member that operation already promoted. * * @param {string} databaseId - Database ID. - * @param {string} targetReplicaId - Target replica ID to promote. If not specified, the healthiest replica is selected. + * @param {string | null} targetReplicaId - Target replica ID to promote. If not specified, the healthiest replica is selected. * @throws {AppwriteException} * @returns {Promise<Models.DedicatedDatabase>} * @deprecated Use the object parameter style method for a better developer experience. */ createFailover( databaseId: string, - targetReplicaId?: string, + targetReplicaId?: string | null, ): Promise<Models.DedicatedDatabase>; createFailover( paramsOrFirst: - { databaseId: string; targetReplicaId?: string } | string, - ...rest: [string?] + { databaseId: string; targetReplicaId?: string | null } | string, + ...rest: [(string | null)?] ): Promise<Models.DedicatedDatabase> { - let params: { databaseId: string; targetReplicaId?: string }; + let params: { databaseId: string; targetReplicaId?: string | null }; if ( paramsOrFirst && @@ -4283,12 +4389,12 @@ export class VectorsDB { ) { params = (paramsOrFirst || {}) as { databaseId: string; - targetReplicaId?: string; + targetReplicaId?: string | null; }; } else { params = { databaseId: paramsOrFirst as string, - targetReplicaId: rest[0] as string, + targetReplicaId: rest[0] as string | null, }; } diff --git a/src/services/waf.ts b/src/services/waf.ts index 90bf89b0..3c3d7977 100644 --- a/src/services/waf.ts +++ b/src/services/waf.ts @@ -115,7 +115,7 @@ export class Waf { * @param {string} params.ruleId - Rule ID. Choose a custom ID or pass `ID.unique()` to generate a unique one. * @param {string} params.resourceType - Resource type the rule applies to. * @param {string} params.name - Rule name. - * @param {string} params.resourceId - Resource identifier. Leave empty for the API resource type. + * @param {string | null} params.resourceId - Resource identifier. Leave empty for the API resource type. * @param {string} params.description - Optional description for the rule. * @param {number} params.priority - Evaluation priority. Lower numbers run earlier. * @param {boolean} params.enabled - Set to false to create the rule in a disabled state. @@ -127,7 +127,7 @@ export class Waf { ruleId: string; resourceType: string; name: string; - resourceId?: string; + resourceId?: string | null; description?: string; priority?: number; enabled?: boolean; @@ -140,7 +140,7 @@ export class Waf { * @param {string} ruleId - Rule ID. Choose a custom ID or pass `ID.unique()` to generate a unique one. * @param {string} resourceType - Resource type the rule applies to. * @param {string} name - Rule name. - * @param {string} resourceId - Resource identifier. Leave empty for the API resource type. + * @param {string | null} resourceId - Resource identifier. Leave empty for the API resource type. * @param {string} description - Optional description for the rule. * @param {number} priority - Evaluation priority. Lower numbers run earlier. * @param {boolean} enabled - Set to false to create the rule in a disabled state. @@ -153,7 +153,7 @@ export class Waf { ruleId: string, resourceType: string, name: string, - resourceId?: string, + resourceId?: string | null, description?: string, priority?: number, enabled?: boolean, @@ -165,7 +165,7 @@ export class Waf { ruleId: string; resourceType: string; name: string; - resourceId?: string; + resourceId?: string | null; description?: string; priority?: number; enabled?: boolean; @@ -175,7 +175,7 @@ export class Waf { ...rest: [ string?, string?, - string?, + (string | null)?, string?, number?, boolean?, @@ -186,7 +186,7 @@ export class Waf { ruleId: string; resourceType: string; name: string; - resourceId?: string; + resourceId?: string | null; description?: string; priority?: number; enabled?: boolean; @@ -202,7 +202,7 @@ export class Waf { ruleId: string; resourceType: string; name: string; - resourceId?: string; + resourceId?: string | null; description?: string; priority?: number; enabled?: boolean; @@ -213,7 +213,7 @@ export class Waf { ruleId: paramsOrFirst as string, resourceType: rest[0] as string, name: rest[1] as string, - resourceId: rest[2] as string, + resourceId: rest[2] as string | null, description: rest[3] as string, priority: rest[4] as number, enabled: rest[5] as boolean, @@ -293,7 +293,7 @@ export class Waf { priority: 0, enabled: true, conditions: [], - config: [], + config: {}, }, }, }, @@ -307,84 +307,84 @@ export class Waf { * * * @param {string} params.ruleId - Rule ID. - * @param {string} params.resourceType - Resource type the rule applies to. - * @param {string} params.resourceId - Resource identifier. Required for functions and sites. - * @param {string} params.name - Rule name. - * @param {string} params.description - Optional description for the rule. - * @param {number} params.priority - Evaluation priority. Lower numbers run earlier. - * @param {boolean} params.enabled - Set to false to disable the rule. - * @param {string[]} params.conditions - Array of condition strings generated using the WAF Condition builder. Maximum of 100 conditions are allowed, each 4096 characters long. + * @param {string | null} params.resourceType - Resource type the rule applies to. + * @param {string | null} params.resourceId - Resource identifier. Required for functions and sites. + * @param {string | null} params.name - Rule name. + * @param {string | null} params.description - Optional description for the rule. + * @param {number | null} params.priority - Evaluation priority. Lower numbers run earlier. + * @param {boolean | null} params.enabled - Set to false to disable the rule. + * @param {string[] | null} params.conditions - Array of condition strings generated using the WAF Condition builder. Maximum of 100 conditions are allowed, each 4096 characters long. * @throws {AppwriteException} * @returns {Promise<Models.WafRuleBypass>} */ updateBypassRule(params: { ruleId: string; - resourceType?: string; - resourceId?: string; - name?: string; - description?: string; - priority?: number; - enabled?: boolean; - conditions?: string[]; + resourceType?: string | null; + resourceId?: string | null; + name?: string | null; + description?: string | null; + priority?: number | null; + enabled?: boolean | null; + conditions?: string[] | null; }): Promise<Models.WafRuleBypass>; /** * Update a bypass WAF rule. Conditions can match request attributes including `ip` (plain IPs or CIDR blocks like `10.0.0.0/8`), `method`, `path`, `host`, `country`, `continent`, `headers.<name>`, `query.<key>`, `queryKeys`, `userAgent`, `os`, `osVersion`, `browser`, and `browserVersion`. Conditions on `city` and `state` require the premium Geo DB addon. * * * @param {string} ruleId - Rule ID. - * @param {string} resourceType - Resource type the rule applies to. - * @param {string} resourceId - Resource identifier. Required for functions and sites. - * @param {string} name - Rule name. - * @param {string} description - Optional description for the rule. - * @param {number} priority - Evaluation priority. Lower numbers run earlier. - * @param {boolean} enabled - Set to false to disable the rule. - * @param {string[]} conditions - Array of condition strings generated using the WAF Condition builder. Maximum of 100 conditions are allowed, each 4096 characters long. + * @param {string | null} resourceType - Resource type the rule applies to. + * @param {string | null} resourceId - Resource identifier. Required for functions and sites. + * @param {string | null} name - Rule name. + * @param {string | null} description - Optional description for the rule. + * @param {number | null} priority - Evaluation priority. Lower numbers run earlier. + * @param {boolean | null} enabled - Set to false to disable the rule. + * @param {string[] | null} conditions - Array of condition strings generated using the WAF Condition builder. Maximum of 100 conditions are allowed, each 4096 characters long. * @throws {AppwriteException} * @returns {Promise<Models.WafRuleBypass>} * @deprecated Use the object parameter style method for a better developer experience. */ updateBypassRule( ruleId: string, - resourceType?: string, - resourceId?: string, - name?: string, - description?: string, - priority?: number, - enabled?: boolean, - conditions?: string[], + resourceType?: string | null, + resourceId?: string | null, + name?: string | null, + description?: string | null, + priority?: number | null, + enabled?: boolean | null, + conditions?: string[] | null, ): Promise<Models.WafRuleBypass>; updateBypassRule( paramsOrFirst: | { ruleId: string; - resourceType?: string; - resourceId?: string; - name?: string; - description?: string; - priority?: number; - enabled?: boolean; - conditions?: string[]; + resourceType?: string | null; + resourceId?: string | null; + name?: string | null; + description?: string | null; + priority?: number | null; + enabled?: boolean | null; + conditions?: string[] | null; } | string, ...rest: [ - string?, - string?, - string?, - string?, - number?, - boolean?, - string[]?, + (string | null)?, + (string | null)?, + (string | null)?, + (string | null)?, + (number | null)?, + (boolean | null)?, + (string[] | null)?, ] ): Promise<Models.WafRuleBypass> { let params: { ruleId: string; - resourceType?: string; - resourceId?: string; - name?: string; - description?: string; - priority?: number; - enabled?: boolean; - conditions?: string[]; + resourceType?: string | null; + resourceId?: string | null; + name?: string | null; + description?: string | null; + priority?: number | null; + enabled?: boolean | null; + conditions?: string[] | null; }; if ( @@ -394,24 +394,24 @@ export class Waf { ) { params = (paramsOrFirst || {}) as { ruleId: string; - resourceType?: string; - resourceId?: string; - name?: string; - description?: string; - priority?: number; - enabled?: boolean; - conditions?: string[]; + resourceType?: string | null; + resourceId?: string | null; + name?: string | null; + description?: string | null; + priority?: number | null; + enabled?: boolean | null; + conditions?: string[] | null; }; } else { params = { ruleId: paramsOrFirst as string, - resourceType: rest[0] as string, - resourceId: rest[1] as string, - name: rest[2] as string, - description: rest[3] as string, - priority: rest[4] as number, - enabled: rest[5] as boolean, - conditions: rest[6] as string[], + resourceType: rest[0] as string | null, + resourceId: rest[1] as string | null, + name: rest[2] as string | null, + description: rest[3] as string | null, + priority: rest[4] as number | null, + enabled: rest[5] as boolean | null, + conditions: rest[6] as string[] | null, }; } @@ -479,7 +479,7 @@ export class Waf { priority: 0, enabled: true, conditions: [], - config: [], + config: {}, }, }, }, @@ -495,7 +495,7 @@ export class Waf { * @param {string} params.ruleId - Rule ID. Choose a custom ID or pass `ID.unique()` to generate a unique one. * @param {string} params.resourceType - Resource type the rule applies to. * @param {string} params.name - Rule name. - * @param {string} params.resourceId - Resource identifier. Required for functions and sites. + * @param {string | null} params.resourceId - Resource identifier. Required for functions and sites. * @param {string} params.description - Optional description for the rule. * @param {string} params.challengeType - Challenge type enforced by the rule. * @param {number} params.priority - Evaluation priority. Lower numbers run earlier. @@ -510,7 +510,7 @@ export class Waf { ruleId: string; resourceType: string; name: string; - resourceId?: string; + resourceId?: string | null; description?: string; challengeType?: string; priority?: number; @@ -526,7 +526,7 @@ export class Waf { * @param {string} ruleId - Rule ID. Choose a custom ID or pass `ID.unique()` to generate a unique one. * @param {string} resourceType - Resource type the rule applies to. * @param {string} name - Rule name. - * @param {string} resourceId - Resource identifier. Required for functions and sites. + * @param {string | null} resourceId - Resource identifier. Required for functions and sites. * @param {string} description - Optional description for the rule. * @param {string} challengeType - Challenge type enforced by the rule. * @param {number} priority - Evaluation priority. Lower numbers run earlier. @@ -542,7 +542,7 @@ export class Waf { ruleId: string, resourceType: string, name: string, - resourceId?: string, + resourceId?: string | null, description?: string, challengeType?: string, priority?: number, @@ -557,7 +557,7 @@ export class Waf { ruleId: string; resourceType: string; name: string; - resourceId?: string; + resourceId?: string | null; description?: string; challengeType?: string; priority?: number; @@ -570,7 +570,7 @@ export class Waf { ...rest: [ string?, string?, - string?, + (string | null)?, string?, string?, number?, @@ -584,7 +584,7 @@ export class Waf { ruleId: string; resourceType: string; name: string; - resourceId?: string; + resourceId?: string | null; description?: string; challengeType?: string; priority?: number; @@ -603,7 +603,7 @@ export class Waf { ruleId: string; resourceType: string; name: string; - resourceId?: string; + resourceId?: string | null; description?: string; challengeType?: string; priority?: number; @@ -617,7 +617,7 @@ export class Waf { ruleId: paramsOrFirst as string, resourceType: rest[0] as string, name: rest[1] as string, - resourceId: rest[2] as string, + resourceId: rest[2] as string | null, description: rest[3] as string, challengeType: rest[4] as string, priority: rest[5] as number, @@ -712,7 +712,7 @@ export class Waf { priority: 0, enabled: true, conditions: [], - config: [], + config: {}, challengeType: 'compute', difficulty: 3, ttl: 1800, @@ -729,105 +729,105 @@ export class Waf { * * * @param {string} params.ruleId - Rule ID. - * @param {string} params.resourceType - Resource type the rule applies to. - * @param {string} params.resourceId - Resource identifier. Required for functions and sites. - * @param {string} params.name - Rule name. - * @param {string} params.description - Optional description for the rule. - * @param {string} params.challengeType - Challenge type enforced by the rule. - * @param {number} params.priority - Evaluation priority. Lower numbers run earlier. - * @param {boolean} params.enabled - Set to false to disable the rule. - * @param {string[]} params.conditions - Array of condition strings generated using the WAF Condition builder. Maximum of 100 conditions are allowed, each 4096 characters long. - * @param {number} params.difficulty - Challenge difficulty from 1 (easiest) to 5 (hardest). Higher values demand more client-side proof-of-work. - * @param {number} params.ttl - How long, in seconds, a visitor stays cleared after passing the challenge before being challenged again. + * @param {string | null} params.resourceType - Resource type the rule applies to. + * @param {string | null} params.resourceId - Resource identifier. Required for functions and sites. + * @param {string | null} params.name - Rule name. + * @param {string | null} params.description - Optional description for the rule. + * @param {string | null} params.challengeType - Challenge type enforced by the rule. + * @param {number | null} params.priority - Evaluation priority. Lower numbers run earlier. + * @param {boolean | null} params.enabled - Set to false to disable the rule. + * @param {string[] | null} params.conditions - Array of condition strings generated using the WAF Condition builder. Maximum of 100 conditions are allowed, each 4096 characters long. + * @param {number | null} params.difficulty - Challenge difficulty from 1 (easiest) to 5 (hardest). Higher values demand more client-side proof-of-work. + * @param {number | null} params.ttl - How long, in seconds, a visitor stays cleared after passing the challenge before being challenged again. * @throws {AppwriteException} * @returns {Promise<Models.WafRuleChallenge>} */ updateChallengeRule(params: { ruleId: string; - resourceType?: string; - resourceId?: string; - name?: string; - description?: string; - challengeType?: string; - priority?: number; - enabled?: boolean; - conditions?: string[]; - difficulty?: number; - ttl?: number; + resourceType?: string | null; + resourceId?: string | null; + name?: string | null; + description?: string | null; + challengeType?: string | null; + priority?: number | null; + enabled?: boolean | null; + conditions?: string[] | null; + difficulty?: number | null; + ttl?: number | null; }): Promise<Models.WafRuleChallenge>; /** * Update a challenge WAF rule. Use `difficulty` (1 easiest to 5 hardest) to tune the client-side proof-of-work cost, and `ttl` to control how long, in seconds, a visitor stays cleared after passing the challenge before being challenged again. Conditions can match request attributes including `ip` (plain IPs or CIDR blocks like `10.0.0.0/8`), `method`, `path`, `host`, `country`, `continent`, `headers.<name>`, `query.<key>`, `queryKeys`, `userAgent`, `os`, `osVersion`, `browser`, and `browserVersion`. Conditions on `city` and `state` require the premium Geo DB addon. * * * @param {string} ruleId - Rule ID. - * @param {string} resourceType - Resource type the rule applies to. - * @param {string} resourceId - Resource identifier. Required for functions and sites. - * @param {string} name - Rule name. - * @param {string} description - Optional description for the rule. - * @param {string} challengeType - Challenge type enforced by the rule. - * @param {number} priority - Evaluation priority. Lower numbers run earlier. - * @param {boolean} enabled - Set to false to disable the rule. - * @param {string[]} conditions - Array of condition strings generated using the WAF Condition builder. Maximum of 100 conditions are allowed, each 4096 characters long. - * @param {number} difficulty - Challenge difficulty from 1 (easiest) to 5 (hardest). Higher values demand more client-side proof-of-work. - * @param {number} ttl - How long, in seconds, a visitor stays cleared after passing the challenge before being challenged again. + * @param {string | null} resourceType - Resource type the rule applies to. + * @param {string | null} resourceId - Resource identifier. Required for functions and sites. + * @param {string | null} name - Rule name. + * @param {string | null} description - Optional description for the rule. + * @param {string | null} challengeType - Challenge type enforced by the rule. + * @param {number | null} priority - Evaluation priority. Lower numbers run earlier. + * @param {boolean | null} enabled - Set to false to disable the rule. + * @param {string[] | null} conditions - Array of condition strings generated using the WAF Condition builder. Maximum of 100 conditions are allowed, each 4096 characters long. + * @param {number | null} difficulty - Challenge difficulty from 1 (easiest) to 5 (hardest). Higher values demand more client-side proof-of-work. + * @param {number | null} ttl - How long, in seconds, a visitor stays cleared after passing the challenge before being challenged again. * @throws {AppwriteException} * @returns {Promise<Models.WafRuleChallenge>} * @deprecated Use the object parameter style method for a better developer experience. */ updateChallengeRule( ruleId: string, - resourceType?: string, - resourceId?: string, - name?: string, - description?: string, - challengeType?: string, - priority?: number, - enabled?: boolean, - conditions?: string[], - difficulty?: number, - ttl?: number, + resourceType?: string | null, + resourceId?: string | null, + name?: string | null, + description?: string | null, + challengeType?: string | null, + priority?: number | null, + enabled?: boolean | null, + conditions?: string[] | null, + difficulty?: number | null, + ttl?: number | null, ): Promise<Models.WafRuleChallenge>; updateChallengeRule( paramsOrFirst: | { ruleId: string; - resourceType?: string; - resourceId?: string; - name?: string; - description?: string; - challengeType?: string; - priority?: number; - enabled?: boolean; - conditions?: string[]; - difficulty?: number; - ttl?: number; + resourceType?: string | null; + resourceId?: string | null; + name?: string | null; + description?: string | null; + challengeType?: string | null; + priority?: number | null; + enabled?: boolean | null; + conditions?: string[] | null; + difficulty?: number | null; + ttl?: number | null; } | string, ...rest: [ - string?, - string?, - string?, - string?, - string?, - number?, - boolean?, - string[]?, - number?, - number?, + (string | null)?, + (string | null)?, + (string | null)?, + (string | null)?, + (string | null)?, + (number | null)?, + (boolean | null)?, + (string[] | null)?, + (number | null)?, + (number | null)?, ] ): Promise<Models.WafRuleChallenge> { let params: { ruleId: string; - resourceType?: string; - resourceId?: string; - name?: string; - description?: string; - challengeType?: string; - priority?: number; - enabled?: boolean; - conditions?: string[]; - difficulty?: number; - ttl?: number; + resourceType?: string | null; + resourceId?: string | null; + name?: string | null; + description?: string | null; + challengeType?: string | null; + priority?: number | null; + enabled?: boolean | null; + conditions?: string[] | null; + difficulty?: number | null; + ttl?: number | null; }; if ( @@ -837,30 +837,30 @@ export class Waf { ) { params = (paramsOrFirst || {}) as { ruleId: string; - resourceType?: string; - resourceId?: string; - name?: string; - description?: string; - challengeType?: string; - priority?: number; - enabled?: boolean; - conditions?: string[]; - difficulty?: number; - ttl?: number; + resourceType?: string | null; + resourceId?: string | null; + name?: string | null; + description?: string | null; + challengeType?: string | null; + priority?: number | null; + enabled?: boolean | null; + conditions?: string[] | null; + difficulty?: number | null; + ttl?: number | null; }; } else { params = { ruleId: paramsOrFirst as string, - resourceType: rest[0] as string, - resourceId: rest[1] as string, - name: rest[2] as string, - description: rest[3] as string, - challengeType: rest[4] as string, - priority: rest[5] as number, - enabled: rest[6] as boolean, - conditions: rest[7] as string[], - difficulty: rest[8] as number, - ttl: rest[9] as number, + resourceType: rest[0] as string | null, + resourceId: rest[1] as string | null, + name: rest[2] as string | null, + description: rest[3] as string | null, + challengeType: rest[4] as string | null, + priority: rest[5] as number | null, + enabled: rest[6] as boolean | null, + conditions: rest[7] as string[] | null, + difficulty: rest[8] as number | null, + ttl: rest[9] as number | null, }; } @@ -940,7 +940,7 @@ export class Waf { priority: 0, enabled: true, conditions: [], - config: [], + config: {}, challengeType: 'compute', difficulty: 3, ttl: 1800, @@ -959,7 +959,7 @@ export class Waf { * @param {string} params.ruleId - Rule ID. Choose a custom ID or pass `ID.unique()` to generate a unique one. * @param {string} params.resourceType - Resource type the rule applies to. * @param {string} params.name - Rule name. - * @param {string} params.resourceId - Resource identifier. Required for functions and sites. + * @param {string | null} params.resourceId - Resource identifier. Required for functions and sites. * @param {string} params.description - Optional description for the rule. * @param {number} params.priority - Evaluation priority. Lower numbers run earlier. * @param {boolean} params.enabled - Set to false to create the rule in a disabled state. @@ -971,7 +971,7 @@ export class Waf { ruleId: string; resourceType: string; name: string; - resourceId?: string; + resourceId?: string | null; description?: string; priority?: number; enabled?: boolean; @@ -984,7 +984,7 @@ export class Waf { * @param {string} ruleId - Rule ID. Choose a custom ID or pass `ID.unique()` to generate a unique one. * @param {string} resourceType - Resource type the rule applies to. * @param {string} name - Rule name. - * @param {string} resourceId - Resource identifier. Required for functions and sites. + * @param {string | null} resourceId - Resource identifier. Required for functions and sites. * @param {string} description - Optional description for the rule. * @param {number} priority - Evaluation priority. Lower numbers run earlier. * @param {boolean} enabled - Set to false to create the rule in a disabled state. @@ -997,7 +997,7 @@ export class Waf { ruleId: string, resourceType: string, name: string, - resourceId?: string, + resourceId?: string | null, description?: string, priority?: number, enabled?: boolean, @@ -1009,7 +1009,7 @@ export class Waf { ruleId: string; resourceType: string; name: string; - resourceId?: string; + resourceId?: string | null; description?: string; priority?: number; enabled?: boolean; @@ -1019,7 +1019,7 @@ export class Waf { ...rest: [ string?, string?, - string?, + (string | null)?, string?, number?, boolean?, @@ -1030,7 +1030,7 @@ export class Waf { ruleId: string; resourceType: string; name: string; - resourceId?: string; + resourceId?: string | null; description?: string; priority?: number; enabled?: boolean; @@ -1046,7 +1046,7 @@ export class Waf { ruleId: string; resourceType: string; name: string; - resourceId?: string; + resourceId?: string | null; description?: string; priority?: number; enabled?: boolean; @@ -1057,7 +1057,7 @@ export class Waf { ruleId: paramsOrFirst as string, resourceType: rest[0] as string, name: rest[1] as string, - resourceId: rest[2] as string, + resourceId: rest[2] as string | null, description: rest[3] as string, priority: rest[4] as number, enabled: rest[5] as boolean, @@ -1137,7 +1137,7 @@ export class Waf { priority: 0, enabled: true, conditions: [], - config: [], + config: {}, }, }, }, @@ -1151,84 +1151,84 @@ export class Waf { * * * @param {string} params.ruleId - Rule ID. - * @param {string} params.resourceType - Resource type the rule applies to. - * @param {string} params.resourceId - Resource identifier. Required for functions and sites. - * @param {string} params.name - Rule name. - * @param {string} params.description - Optional description for the rule. - * @param {number} params.priority - Evaluation priority. Lower numbers run earlier. - * @param {boolean} params.enabled - Set to false to disable the rule. - * @param {string[]} params.conditions - Array of condition strings generated using the WAF Condition builder. Maximum of 100 conditions are allowed, each 4096 characters long. + * @param {string | null} params.resourceType - Resource type the rule applies to. + * @param {string | null} params.resourceId - Resource identifier. Required for functions and sites. + * @param {string | null} params.name - Rule name. + * @param {string | null} params.description - Optional description for the rule. + * @param {number | null} params.priority - Evaluation priority. Lower numbers run earlier. + * @param {boolean | null} params.enabled - Set to false to disable the rule. + * @param {string[] | null} params.conditions - Array of condition strings generated using the WAF Condition builder. Maximum of 100 conditions are allowed, each 4096 characters long. * @throws {AppwriteException} * @returns {Promise<Models.WafRuleDeny>} */ updateDenyRule(params: { ruleId: string; - resourceType?: string; - resourceId?: string; - name?: string; - description?: string; - priority?: number; - enabled?: boolean; - conditions?: string[]; + resourceType?: string | null; + resourceId?: string | null; + name?: string | null; + description?: string | null; + priority?: number | null; + enabled?: boolean | null; + conditions?: string[] | null; }): Promise<Models.WafRuleDeny>; /** * Update a deny WAF rule. Conditions can match request attributes including `ip` (plain IPs or CIDR blocks like `10.0.0.0/8`), `method`, `path`, `host`, `country`, `continent`, `headers.<name>`, `query.<key>`, `queryKeys`, `userAgent`, `os`, `osVersion`, `browser`, and `browserVersion`. Conditions on `city` and `state` require the premium Geo DB addon. * * * @param {string} ruleId - Rule ID. - * @param {string} resourceType - Resource type the rule applies to. - * @param {string} resourceId - Resource identifier. Required for functions and sites. - * @param {string} name - Rule name. - * @param {string} description - Optional description for the rule. - * @param {number} priority - Evaluation priority. Lower numbers run earlier. - * @param {boolean} enabled - Set to false to disable the rule. - * @param {string[]} conditions - Array of condition strings generated using the WAF Condition builder. Maximum of 100 conditions are allowed, each 4096 characters long. + * @param {string | null} resourceType - Resource type the rule applies to. + * @param {string | null} resourceId - Resource identifier. Required for functions and sites. + * @param {string | null} name - Rule name. + * @param {string | null} description - Optional description for the rule. + * @param {number | null} priority - Evaluation priority. Lower numbers run earlier. + * @param {boolean | null} enabled - Set to false to disable the rule. + * @param {string[] | null} conditions - Array of condition strings generated using the WAF Condition builder. Maximum of 100 conditions are allowed, each 4096 characters long. * @throws {AppwriteException} * @returns {Promise<Models.WafRuleDeny>} * @deprecated Use the object parameter style method for a better developer experience. */ updateDenyRule( ruleId: string, - resourceType?: string, - resourceId?: string, - name?: string, - description?: string, - priority?: number, - enabled?: boolean, - conditions?: string[], + resourceType?: string | null, + resourceId?: string | null, + name?: string | null, + description?: string | null, + priority?: number | null, + enabled?: boolean | null, + conditions?: string[] | null, ): Promise<Models.WafRuleDeny>; updateDenyRule( paramsOrFirst: | { ruleId: string; - resourceType?: string; - resourceId?: string; - name?: string; - description?: string; - priority?: number; - enabled?: boolean; - conditions?: string[]; + resourceType?: string | null; + resourceId?: string | null; + name?: string | null; + description?: string | null; + priority?: number | null; + enabled?: boolean | null; + conditions?: string[] | null; } | string, ...rest: [ - string?, - string?, - string?, - string?, - number?, - boolean?, - string[]?, + (string | null)?, + (string | null)?, + (string | null)?, + (string | null)?, + (number | null)?, + (boolean | null)?, + (string[] | null)?, ] ): Promise<Models.WafRuleDeny> { let params: { ruleId: string; - resourceType?: string; - resourceId?: string; - name?: string; - description?: string; - priority?: number; - enabled?: boolean; - conditions?: string[]; + resourceType?: string | null; + resourceId?: string | null; + name?: string | null; + description?: string | null; + priority?: number | null; + enabled?: boolean | null; + conditions?: string[] | null; }; if ( @@ -1238,24 +1238,24 @@ export class Waf { ) { params = (paramsOrFirst || {}) as { ruleId: string; - resourceType?: string; - resourceId?: string; - name?: string; - description?: string; - priority?: number; - enabled?: boolean; - conditions?: string[]; + resourceType?: string | null; + resourceId?: string | null; + name?: string | null; + description?: string | null; + priority?: number | null; + enabled?: boolean | null; + conditions?: string[] | null; }; } else { params = { ruleId: paramsOrFirst as string, - resourceType: rest[0] as string, - resourceId: rest[1] as string, - name: rest[2] as string, - description: rest[3] as string, - priority: rest[4] as number, - enabled: rest[5] as boolean, - conditions: rest[6] as string[], + resourceType: rest[0] as string | null, + resourceId: rest[1] as string | null, + name: rest[2] as string | null, + description: rest[3] as string | null, + priority: rest[4] as number | null, + enabled: rest[5] as boolean | null, + conditions: rest[6] as string[] | null, }; } @@ -1323,7 +1323,7 @@ export class Waf { priority: 0, enabled: true, conditions: [], - config: [], + config: {}, }, }, }, @@ -1341,11 +1341,11 @@ export class Waf { * @param {string} params.name - Rule name. * @param {number} params.limit - Maximum number of matching requests allowed in the configured interval. * @param {number} params.interval - Interval in seconds used for rate limiting. - * @param {string} params.resourceId - Resource identifier. Required for functions and sites. + * @param {string | null} params.resourceId - Resource identifier. Required for functions and sites. * @param {string} params.description - Optional description for the rule. * @param {string} params.key - Rate limit key. Use `ip` to limit per client IP or `userId` to limit per authenticated user. Requests without an authenticated user skip `userId` rules. * @param {string} params.strategy - Rate limit strategy. `fixedWindow` counts requests in discrete intervals, `slidingWindow` weights the previous interval for smoother limiting, and `tokenBucket` refills allowance continuously to permit short bursts. - * @param {number} params.maxBucketSize - Maximum number of tokens the bucket can hold for the `tokenBucket` strategy, controlling how large a burst is allowed. The sustained refill rate is `limit / interval`. Defaults to `limit` when omitted. Ignored by other strategies. + * @param {number | null} params.maxBucketSize - Maximum number of tokens the bucket can hold for the `tokenBucket` strategy, controlling how large a burst is allowed. The sustained refill rate is `limit / interval`. Defaults to `limit` when omitted. Ignored by other strategies. * @param {number} params.priority - Evaluation priority. Lower numbers run earlier. * @param {boolean} params.enabled - Set to false to create the rule in a disabled state. * @param {string[]} params.conditions - Array of condition strings generated using the WAF Condition builder. Maximum of 100 conditions are allowed, each 4096 characters long. @@ -1358,11 +1358,11 @@ export class Waf { name: string; limit: number; interval: number; - resourceId?: string; + resourceId?: string | null; description?: string; key?: string; strategy?: string; - maxBucketSize?: number; + maxBucketSize?: number | null; priority?: number; enabled?: boolean; conditions?: string[]; @@ -1376,11 +1376,11 @@ export class Waf { * @param {string} name - Rule name. * @param {number} limit - Maximum number of matching requests allowed in the configured interval. * @param {number} interval - Interval in seconds used for rate limiting. - * @param {string} resourceId - Resource identifier. Required for functions and sites. + * @param {string | null} resourceId - Resource identifier. Required for functions and sites. * @param {string} description - Optional description for the rule. * @param {string} key - Rate limit key. Use `ip` to limit per client IP or `userId` to limit per authenticated user. Requests without an authenticated user skip `userId` rules. * @param {string} strategy - Rate limit strategy. `fixedWindow` counts requests in discrete intervals, `slidingWindow` weights the previous interval for smoother limiting, and `tokenBucket` refills allowance continuously to permit short bursts. - * @param {number} maxBucketSize - Maximum number of tokens the bucket can hold for the `tokenBucket` strategy, controlling how large a burst is allowed. The sustained refill rate is `limit / interval`. Defaults to `limit` when omitted. Ignored by other strategies. + * @param {number | null} maxBucketSize - Maximum number of tokens the bucket can hold for the `tokenBucket` strategy, controlling how large a burst is allowed. The sustained refill rate is `limit / interval`. Defaults to `limit` when omitted. Ignored by other strategies. * @param {number} priority - Evaluation priority. Lower numbers run earlier. * @param {boolean} enabled - Set to false to create the rule in a disabled state. * @param {string[]} conditions - Array of condition strings generated using the WAF Condition builder. Maximum of 100 conditions are allowed, each 4096 characters long. @@ -1394,11 +1394,11 @@ export class Waf { name: string, limit: number, interval: number, - resourceId?: string, + resourceId?: string | null, description?: string, key?: string, strategy?: string, - maxBucketSize?: number, + maxBucketSize?: number | null, priority?: number, enabled?: boolean, conditions?: string[], @@ -1411,11 +1411,11 @@ export class Waf { name: string; limit: number; interval: number; - resourceId?: string; + resourceId?: string | null; description?: string; key?: string; strategy?: string; - maxBucketSize?: number; + maxBucketSize?: number | null; priority?: number; enabled?: boolean; conditions?: string[]; @@ -1426,11 +1426,11 @@ export class Waf { string?, number?, number?, + (string | null)?, string?, string?, string?, - string?, - number?, + (number | null)?, number?, boolean?, string[]?, @@ -1442,11 +1442,11 @@ export class Waf { name: string; limit: number; interval: number; - resourceId?: string; + resourceId?: string | null; description?: string; key?: string; strategy?: string; - maxBucketSize?: number; + maxBucketSize?: number | null; priority?: number; enabled?: boolean; conditions?: string[]; @@ -1463,11 +1463,11 @@ export class Waf { name: string; limit: number; interval: number; - resourceId?: string; + resourceId?: string | null; description?: string; key?: string; strategy?: string; - maxBucketSize?: number; + maxBucketSize?: number | null; priority?: number; enabled?: boolean; conditions?: string[]; @@ -1479,11 +1479,11 @@ export class Waf { name: rest[1] as string, limit: rest[2] as number, interval: rest[3] as number, - resourceId: rest[4] as string, + resourceId: rest[4] as string | null, description: rest[5] as string, key: rest[6] as string, strategy: rest[7] as string, - maxBucketSize: rest[8] as number, + maxBucketSize: rest[8] as number | null, priority: rest[9] as number, enabled: rest[10] as boolean, conditions: rest[11] as string[], @@ -1590,7 +1590,7 @@ export class Waf { priority: 0, enabled: true, conditions: [], - config: [], + config: {}, limit: 100, interval: 3600, key: 'ip', @@ -1609,112 +1609,112 @@ export class Waf { * * * @param {string} params.ruleId - Rule ID. - * @param {string} params.resourceType - Resource type the rule applies to. - * @param {string} params.resourceId - Resource identifier. Required for functions and sites. - * @param {string} params.name - Rule name. - * @param {string} params.description - Optional description for the rule. - * @param {number} params.limit - Maximum number of matching requests allowed in the configured interval. - * @param {number} params.interval - Interval in seconds used for rate limiting. - * @param {string} params.key - Rate limit key. Use `ip` to limit per client IP or `userId` to limit per authenticated user. Requests without an authenticated user skip `userId` rules. - * @param {number} params.maxBucketSize - Maximum number of tokens the bucket can hold for the `tokenBucket` strategy, controlling how large a burst is allowed. The sustained refill rate is `limit / interval`. Ignored by other strategies. The strategy itself cannot be changed after creation. - * @param {number} params.priority - Evaluation priority. Lower numbers run earlier. - * @param {boolean} params.enabled - Set to false to disable the rule. - * @param {string[]} params.conditions - Array of condition strings generated using the WAF Condition builder. Maximum of 100 conditions are allowed, each 4096 characters long. + * @param {string | null} params.resourceType - Resource type the rule applies to. + * @param {string | null} params.resourceId - Resource identifier. Required for functions and sites. + * @param {string | null} params.name - Rule name. + * @param {string | null} params.description - Optional description for the rule. + * @param {number | null} params.limit - Maximum number of matching requests allowed in the configured interval. + * @param {number | null} params.interval - Interval in seconds used for rate limiting. + * @param {string | null} params.key - Rate limit key. Use `ip` to limit per client IP or `userId` to limit per authenticated user. Requests without an authenticated user skip `userId` rules. + * @param {number | null} params.maxBucketSize - Maximum number of tokens the bucket can hold for the `tokenBucket` strategy, controlling how large a burst is allowed. The sustained refill rate is `limit / interval`. Ignored by other strategies. The strategy itself cannot be changed after creation. + * @param {number | null} params.priority - Evaluation priority. Lower numbers run earlier. + * @param {boolean | null} params.enabled - Set to false to disable the rule. + * @param {string[] | null} params.conditions - Array of condition strings generated using the WAF Condition builder. Maximum of 100 conditions are allowed, each 4096 characters long. * @throws {AppwriteException} * @returns {Promise<Models.WafRuleRateLimit>} */ updateRateLimitRule(params: { ruleId: string; - resourceType?: string; - resourceId?: string; - name?: string; - description?: string; - limit?: number; - interval?: number; - key?: string; - maxBucketSize?: number; - priority?: number; - enabled?: boolean; - conditions?: string[]; + resourceType?: string | null; + resourceId?: string | null; + name?: string | null; + description?: string | null; + limit?: number | null; + interval?: number | null; + key?: string | null; + maxBucketSize?: number | null; + priority?: number | null; + enabled?: boolean | null; + conditions?: string[] | null; }): Promise<Models.WafRuleRateLimit>; /** * Update a rate limit WAF rule. Use `key` to choose the counter: `ip` limits per client IP, while `userId` limits per authenticated user (requests without an authenticated user skip `userId` rules). Conditions can match request attributes including `ip` (plain IPs or CIDR blocks like `10.0.0.0/8`), `method`, `path`, `host`, `country`, `continent`, `headers.<name>`, `query.<key>`, `queryKeys`, `userAgent`, `os`, `osVersion`, `browser`, and `browserVersion`. Conditions on `city` and `state` require the premium Geo DB addon. * * * @param {string} ruleId - Rule ID. - * @param {string} resourceType - Resource type the rule applies to. - * @param {string} resourceId - Resource identifier. Required for functions and sites. - * @param {string} name - Rule name. - * @param {string} description - Optional description for the rule. - * @param {number} limit - Maximum number of matching requests allowed in the configured interval. - * @param {number} interval - Interval in seconds used for rate limiting. - * @param {string} key - Rate limit key. Use `ip` to limit per client IP or `userId` to limit per authenticated user. Requests without an authenticated user skip `userId` rules. - * @param {number} maxBucketSize - Maximum number of tokens the bucket can hold for the `tokenBucket` strategy, controlling how large a burst is allowed. The sustained refill rate is `limit / interval`. Ignored by other strategies. The strategy itself cannot be changed after creation. - * @param {number} priority - Evaluation priority. Lower numbers run earlier. - * @param {boolean} enabled - Set to false to disable the rule. - * @param {string[]} conditions - Array of condition strings generated using the WAF Condition builder. Maximum of 100 conditions are allowed, each 4096 characters long. + * @param {string | null} resourceType - Resource type the rule applies to. + * @param {string | null} resourceId - Resource identifier. Required for functions and sites. + * @param {string | null} name - Rule name. + * @param {string | null} description - Optional description for the rule. + * @param {number | null} limit - Maximum number of matching requests allowed in the configured interval. + * @param {number | null} interval - Interval in seconds used for rate limiting. + * @param {string | null} key - Rate limit key. Use `ip` to limit per client IP or `userId` to limit per authenticated user. Requests without an authenticated user skip `userId` rules. + * @param {number | null} maxBucketSize - Maximum number of tokens the bucket can hold for the `tokenBucket` strategy, controlling how large a burst is allowed. The sustained refill rate is `limit / interval`. Ignored by other strategies. The strategy itself cannot be changed after creation. + * @param {number | null} priority - Evaluation priority. Lower numbers run earlier. + * @param {boolean | null} enabled - Set to false to disable the rule. + * @param {string[] | null} conditions - Array of condition strings generated using the WAF Condition builder. Maximum of 100 conditions are allowed, each 4096 characters long. * @throws {AppwriteException} * @returns {Promise<Models.WafRuleRateLimit>} * @deprecated Use the object parameter style method for a better developer experience. */ updateRateLimitRule( ruleId: string, - resourceType?: string, - resourceId?: string, - name?: string, - description?: string, - limit?: number, - interval?: number, - key?: string, - maxBucketSize?: number, - priority?: number, - enabled?: boolean, - conditions?: string[], + resourceType?: string | null, + resourceId?: string | null, + name?: string | null, + description?: string | null, + limit?: number | null, + interval?: number | null, + key?: string | null, + maxBucketSize?: number | null, + priority?: number | null, + enabled?: boolean | null, + conditions?: string[] | null, ): Promise<Models.WafRuleRateLimit>; updateRateLimitRule( paramsOrFirst: | { ruleId: string; - resourceType?: string; - resourceId?: string; - name?: string; - description?: string; - limit?: number; - interval?: number; - key?: string; - maxBucketSize?: number; - priority?: number; - enabled?: boolean; - conditions?: string[]; + resourceType?: string | null; + resourceId?: string | null; + name?: string | null; + description?: string | null; + limit?: number | null; + interval?: number | null; + key?: string | null; + maxBucketSize?: number | null; + priority?: number | null; + enabled?: boolean | null; + conditions?: string[] | null; } | string, ...rest: [ - string?, - string?, - string?, - string?, - number?, - number?, - string?, - number?, - number?, - boolean?, - string[]?, + (string | null)?, + (string | null)?, + (string | null)?, + (string | null)?, + (number | null)?, + (number | null)?, + (string | null)?, + (number | null)?, + (number | null)?, + (boolean | null)?, + (string[] | null)?, ] ): Promise<Models.WafRuleRateLimit> { let params: { ruleId: string; - resourceType?: string; - resourceId?: string; - name?: string; - description?: string; - limit?: number; - interval?: number; - key?: string; - maxBucketSize?: number; - priority?: number; - enabled?: boolean; - conditions?: string[]; + resourceType?: string | null; + resourceId?: string | null; + name?: string | null; + description?: string | null; + limit?: number | null; + interval?: number | null; + key?: string | null; + maxBucketSize?: number | null; + priority?: number | null; + enabled?: boolean | null; + conditions?: string[] | null; }; if ( @@ -1724,32 +1724,32 @@ export class Waf { ) { params = (paramsOrFirst || {}) as { ruleId: string; - resourceType?: string; - resourceId?: string; - name?: string; - description?: string; - limit?: number; - interval?: number; - key?: string; - maxBucketSize?: number; - priority?: number; - enabled?: boolean; - conditions?: string[]; + resourceType?: string | null; + resourceId?: string | null; + name?: string | null; + description?: string | null; + limit?: number | null; + interval?: number | null; + key?: string | null; + maxBucketSize?: number | null; + priority?: number | null; + enabled?: boolean | null; + conditions?: string[] | null; }; } else { params = { ruleId: paramsOrFirst as string, - resourceType: rest[0] as string, - resourceId: rest[1] as string, - name: rest[2] as string, - description: rest[3] as string, - limit: rest[4] as number, - interval: rest[5] as number, - key: rest[6] as string, - maxBucketSize: rest[7] as number, - priority: rest[8] as number, - enabled: rest[9] as boolean, - conditions: rest[10] as string[], + resourceType: rest[0] as string | null, + resourceId: rest[1] as string | null, + name: rest[2] as string | null, + description: rest[3] as string | null, + limit: rest[4] as number | null, + interval: rest[5] as number | null, + key: rest[6] as string | null, + maxBucketSize: rest[7] as number | null, + priority: rest[8] as number | null, + enabled: rest[9] as boolean | null, + conditions: rest[10] as string[] | null, }; } @@ -1833,7 +1833,7 @@ export class Waf { priority: 0, enabled: true, conditions: [], - config: [], + config: {}, limit: 100, interval: 3600, key: 'ip', @@ -1856,7 +1856,7 @@ export class Waf { * @param {string} params.name - Rule name. * @param {string} params.location - Location used for redirect responses. * @param {number} params.statusCode - Integer status code used for redirect responses. - * @param {string} params.resourceId - Resource identifier. Required for functions and sites. + * @param {string | null} params.resourceId - Resource identifier. Required for functions and sites. * @param {string} params.description - Optional description for the rule. * @param {number} params.priority - Evaluation priority. Lower numbers run earlier. * @param {boolean} params.enabled - Set to false to create the rule in a disabled state. @@ -1870,7 +1870,7 @@ export class Waf { name: string; location: string; statusCode: number; - resourceId?: string; + resourceId?: string | null; description?: string; priority?: number; enabled?: boolean; @@ -1885,7 +1885,7 @@ export class Waf { * @param {string} name - Rule name. * @param {string} location - Location used for redirect responses. * @param {number} statusCode - Integer status code used for redirect responses. - * @param {string} resourceId - Resource identifier. Required for functions and sites. + * @param {string | null} resourceId - Resource identifier. Required for functions and sites. * @param {string} description - Optional description for the rule. * @param {number} priority - Evaluation priority. Lower numbers run earlier. * @param {boolean} enabled - Set to false to create the rule in a disabled state. @@ -1900,7 +1900,7 @@ export class Waf { name: string, location: string, statusCode: number, - resourceId?: string, + resourceId?: string | null, description?: string, priority?: number, enabled?: boolean, @@ -1914,7 +1914,7 @@ export class Waf { name: string; location: string; statusCode: number; - resourceId?: string; + resourceId?: string | null; description?: string; priority?: number; enabled?: boolean; @@ -1926,7 +1926,7 @@ export class Waf { string?, string?, number?, - string?, + (string | null)?, string?, number?, boolean?, @@ -1939,7 +1939,7 @@ export class Waf { name: string; location: string; statusCode: number; - resourceId?: string; + resourceId?: string | null; description?: string; priority?: number; enabled?: boolean; @@ -1957,7 +1957,7 @@ export class Waf { name: string; location: string; statusCode: number; - resourceId?: string; + resourceId?: string | null; description?: string; priority?: number; enabled?: boolean; @@ -1970,7 +1970,7 @@ export class Waf { name: rest[1] as string, location: rest[2] as string, statusCode: rest[3] as number, - resourceId: rest[4] as string, + resourceId: rest[4] as string | null, description: rest[5] as string, priority: rest[6] as number, enabled: rest[7] as boolean, @@ -2068,7 +2068,7 @@ export class Waf { priority: 0, enabled: true, conditions: [], - config: [], + config: {}, location: '/', statusCode: 302, }, @@ -2084,98 +2084,98 @@ export class Waf { * * * @param {string} params.ruleId - Rule ID. - * @param {string} params.resourceType - Resource type the rule applies to. - * @param {string} params.resourceId - Resource identifier. Required for functions and sites. - * @param {string} params.name - Rule name. - * @param {string} params.description - Optional description for the rule. - * @param {string} params.location - Location used for redirect responses. - * @param {number} params.statusCode - Integer status code used for redirect responses. - * @param {number} params.priority - Evaluation priority. Lower numbers run earlier. - * @param {boolean} params.enabled - Set to false to disable the rule. - * @param {string[]} params.conditions - Array of condition strings generated using the WAF Condition builder. Maximum of 100 conditions are allowed, each 4096 characters long. + * @param {string | null} params.resourceType - Resource type the rule applies to. + * @param {string | null} params.resourceId - Resource identifier. Required for functions and sites. + * @param {string | null} params.name - Rule name. + * @param {string | null} params.description - Optional description for the rule. + * @param {string | null} params.location - Location used for redirect responses. + * @param {number | null} params.statusCode - Integer status code used for redirect responses. + * @param {number | null} params.priority - Evaluation priority. Lower numbers run earlier. + * @param {boolean | null} params.enabled - Set to false to disable the rule. + * @param {string[] | null} params.conditions - Array of condition strings generated using the WAF Condition builder. Maximum of 100 conditions are allowed, each 4096 characters long. * @throws {AppwriteException} * @returns {Promise<Models.WafRuleRedirect>} */ updateRedirectRule(params: { ruleId: string; - resourceType?: string; - resourceId?: string; - name?: string; - description?: string; - location?: string; - statusCode?: number; - priority?: number; - enabled?: boolean; - conditions?: string[]; + resourceType?: string | null; + resourceId?: string | null; + name?: string | null; + description?: string | null; + location?: string | null; + statusCode?: number | null; + priority?: number | null; + enabled?: boolean | null; + conditions?: string[] | null; }): Promise<Models.WafRuleRedirect>; /** * Update a redirect WAF rule. Conditions can match request attributes including `ip` (plain IPs or CIDR blocks like `10.0.0.0/8`), `method`, `path`, `host`, `country`, `continent`, `headers.<name>`, `query.<key>`, `queryKeys`, `userAgent`, `os`, `osVersion`, `browser`, and `browserVersion`. Conditions on `city` and `state` require the premium Geo DB addon. * * * @param {string} ruleId - Rule ID. - * @param {string} resourceType - Resource type the rule applies to. - * @param {string} resourceId - Resource identifier. Required for functions and sites. - * @param {string} name - Rule name. - * @param {string} description - Optional description for the rule. - * @param {string} location - Location used for redirect responses. - * @param {number} statusCode - Integer status code used for redirect responses. - * @param {number} priority - Evaluation priority. Lower numbers run earlier. - * @param {boolean} enabled - Set to false to disable the rule. - * @param {string[]} conditions - Array of condition strings generated using the WAF Condition builder. Maximum of 100 conditions are allowed, each 4096 characters long. + * @param {string | null} resourceType - Resource type the rule applies to. + * @param {string | null} resourceId - Resource identifier. Required for functions and sites. + * @param {string | null} name - Rule name. + * @param {string | null} description - Optional description for the rule. + * @param {string | null} location - Location used for redirect responses. + * @param {number | null} statusCode - Integer status code used for redirect responses. + * @param {number | null} priority - Evaluation priority. Lower numbers run earlier. + * @param {boolean | null} enabled - Set to false to disable the rule. + * @param {string[] | null} conditions - Array of condition strings generated using the WAF Condition builder. Maximum of 100 conditions are allowed, each 4096 characters long. * @throws {AppwriteException} * @returns {Promise<Models.WafRuleRedirect>} * @deprecated Use the object parameter style method for a better developer experience. */ updateRedirectRule( ruleId: string, - resourceType?: string, - resourceId?: string, - name?: string, - description?: string, - location?: string, - statusCode?: number, - priority?: number, - enabled?: boolean, - conditions?: string[], + resourceType?: string | null, + resourceId?: string | null, + name?: string | null, + description?: string | null, + location?: string | null, + statusCode?: number | null, + priority?: number | null, + enabled?: boolean | null, + conditions?: string[] | null, ): Promise<Models.WafRuleRedirect>; updateRedirectRule( paramsOrFirst: | { ruleId: string; - resourceType?: string; - resourceId?: string; - name?: string; - description?: string; - location?: string; - statusCode?: number; - priority?: number; - enabled?: boolean; - conditions?: string[]; + resourceType?: string | null; + resourceId?: string | null; + name?: string | null; + description?: string | null; + location?: string | null; + statusCode?: number | null; + priority?: number | null; + enabled?: boolean | null; + conditions?: string[] | null; } | string, ...rest: [ - string?, - string?, - string?, - string?, - string?, - number?, - number?, - boolean?, - string[]?, + (string | null)?, + (string | null)?, + (string | null)?, + (string | null)?, + (string | null)?, + (number | null)?, + (number | null)?, + (boolean | null)?, + (string[] | null)?, ] ): Promise<Models.WafRuleRedirect> { let params: { ruleId: string; - resourceType?: string; - resourceId?: string; - name?: string; - description?: string; - location?: string; - statusCode?: number; - priority?: number; - enabled?: boolean; - conditions?: string[]; + resourceType?: string | null; + resourceId?: string | null; + name?: string | null; + description?: string | null; + location?: string | null; + statusCode?: number | null; + priority?: number | null; + enabled?: boolean | null; + conditions?: string[] | null; }; if ( @@ -2185,28 +2185,28 @@ export class Waf { ) { params = (paramsOrFirst || {}) as { ruleId: string; - resourceType?: string; - resourceId?: string; - name?: string; - description?: string; - location?: string; - statusCode?: number; - priority?: number; - enabled?: boolean; - conditions?: string[]; + resourceType?: string | null; + resourceId?: string | null; + name?: string | null; + description?: string | null; + location?: string | null; + statusCode?: number | null; + priority?: number | null; + enabled?: boolean | null; + conditions?: string[] | null; }; } else { params = { ruleId: paramsOrFirst as string, - resourceType: rest[0] as string, - resourceId: rest[1] as string, - name: rest[2] as string, - description: rest[3] as string, - location: rest[4] as string, - statusCode: rest[5] as number, - priority: rest[6] as number, - enabled: rest[7] as boolean, - conditions: rest[8] as string[], + resourceType: rest[0] as string | null, + resourceId: rest[1] as string | null, + name: rest[2] as string | null, + description: rest[3] as string | null, + location: rest[4] as string | null, + statusCode: rest[5] as number | null, + priority: rest[6] as number | null, + enabled: rest[7] as boolean | null, + conditions: rest[8] as string[] | null, }; } @@ -2282,7 +2282,7 @@ export class Waf { priority: 0, enabled: true, conditions: [], - config: [], + config: {}, location: '/', statusCode: 302, }, diff --git a/src/services/webhooks.ts b/src/services/webhooks.ts index 354d2a06..3f5bfe6f 100644 --- a/src/services/webhooks.ts +++ b/src/services/webhooks.ts @@ -97,6 +97,7 @@ export class Webhooks { $createdAt: '', $updatedAt: '', name: '', + description: '', url: '', events: [], tls: true, @@ -125,7 +126,8 @@ export class Webhooks { * @param {boolean} params.tls - Certificate verification, false for disabled or true for enabled. * @param {string} params.authUsername - Webhook HTTP user. Max length: 255 chars. * @param {string} params.authPassword - Webhook HTTP password. Max length: 2048 chars. - * @param {string} params.secret - Webhook secret key. If not provided, a new key will be generated automatically. Key must be at least 8 characters long, and at max 256 characters. + * @param {string | null} params.secret - Webhook secret key. If not provided, a new key will be generated automatically. Key must be at least 8 characters long, and at max 256 characters. + * @param {string} params.description - Optional description for the webhook. * @throws {AppwriteException} * @returns {Promise<Models.Webhook>} */ @@ -138,7 +140,8 @@ export class Webhooks { tls?: boolean; authUsername?: string; authPassword?: string; - secret?: string; + secret?: string | null; + description?: string; }): Promise<Models.Webhook>; /** * Create a new webhook. Use this endpoint to configure a URL that will receive events from Appwrite when specific events occur. @@ -151,7 +154,8 @@ export class Webhooks { * @param {boolean} tls - Certificate verification, false for disabled or true for enabled. * @param {string} authUsername - Webhook HTTP user. Max length: 255 chars. * @param {string} authPassword - Webhook HTTP password. Max length: 2048 chars. - * @param {string} secret - Webhook secret key. If not provided, a new key will be generated automatically. Key must be at least 8 characters long, and at max 256 characters. + * @param {string | null} secret - Webhook secret key. If not provided, a new key will be generated automatically. Key must be at least 8 characters long, and at max 256 characters. + * @param {string} description - Optional description for the webhook. * @throws {AppwriteException} * @returns {Promise<Models.Webhook>} * @deprecated Use the object parameter style method for a better developer experience. @@ -165,7 +169,8 @@ export class Webhooks { tls?: boolean, authUsername?: string, authPassword?: string, - secret?: string, + secret?: string | null, + description?: string, ): Promise<Models.Webhook>; create( paramsOrFirst: @@ -178,7 +183,8 @@ export class Webhooks { tls?: boolean; authUsername?: string; authPassword?: string; - secret?: string; + secret?: string | null; + description?: string; } | string, ...rest: [ @@ -189,6 +195,7 @@ export class Webhooks { boolean?, string?, string?, + (string | null)?, string?, ] ): Promise<Models.Webhook> { @@ -201,7 +208,8 @@ export class Webhooks { tls?: boolean; authUsername?: string; authPassword?: string; - secret?: string; + secret?: string | null; + description?: string; }; if ( @@ -218,7 +226,8 @@ export class Webhooks { tls?: boolean; authUsername?: string; authPassword?: string; - secret?: string; + secret?: string | null; + description?: string; }; } else { params = { @@ -230,7 +239,8 @@ export class Webhooks { tls: rest[4] as boolean, authUsername: rest[5] as string, authPassword: rest[6] as string, - secret: rest[7] as string, + secret: rest[7] as string | null, + description: rest[8] as string, }; } @@ -243,6 +253,7 @@ export class Webhooks { const authUsername = params.authUsername; const authPassword = params.authPassword; const secret = params.secret; + const description = params.description; if (typeof webhookId === 'undefined') { throw new AppwriteException( @@ -287,6 +298,9 @@ export class Webhooks { if (typeof secret !== 'undefined') { apiPayload['secret'] = secret; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -305,6 +319,7 @@ export class Webhooks { $createdAt: '', $updatedAt: '', name: '', + description: '', url: '', events: [], tls: true, @@ -385,6 +400,7 @@ export class Webhooks { $createdAt: '', $updatedAt: '', name: '', + description: '', url: '', events: [], tls: true, @@ -412,7 +428,8 @@ export class Webhooks { * @param {boolean} params.enabled - Enable or disable a webhook. * @param {boolean} params.tls - Certificate verification, false for disabled or true for enabled. * @param {string} params.authUsername - Webhook HTTP user. Max length: 255 chars. - * @param {string} params.authPassword - Webhook HTTP password. Max length: 2048 chars. Omit to keep the current password; it is cleared when the URL changes or TLS verification is disabled. + * @param {string | null} params.authPassword - Webhook HTTP password. Max length: 2048 chars. Omit to keep the current password; it is cleared when the URL changes or TLS verification is disabled. + * @param {string | null} params.description - Optional description for the webhook. * @throws {AppwriteException} * @returns {Promise<Models.Webhook>} */ @@ -424,7 +441,8 @@ export class Webhooks { enabled?: boolean; tls?: boolean; authUsername?: string; - authPassword?: string; + authPassword?: string | null; + description?: string | null; }): Promise<Models.Webhook>; /** * Update a webhook by its unique ID. Use this endpoint to update the URL, events, or status of an existing webhook. @@ -436,7 +454,8 @@ export class Webhooks { * @param {boolean} enabled - Enable or disable a webhook. * @param {boolean} tls - Certificate verification, false for disabled or true for enabled. * @param {string} authUsername - Webhook HTTP user. Max length: 255 chars. - * @param {string} authPassword - Webhook HTTP password. Max length: 2048 chars. Omit to keep the current password; it is cleared when the URL changes or TLS verification is disabled. + * @param {string | null} authPassword - Webhook HTTP password. Max length: 2048 chars. Omit to keep the current password; it is cleared when the URL changes or TLS verification is disabled. + * @param {string | null} description - Optional description for the webhook. * @throws {AppwriteException} * @returns {Promise<Models.Webhook>} * @deprecated Use the object parameter style method for a better developer experience. @@ -449,7 +468,8 @@ export class Webhooks { enabled?: boolean, tls?: boolean, authUsername?: string, - authPassword?: string, + authPassword?: string | null, + description?: string | null, ): Promise<Models.Webhook>; update( paramsOrFirst: @@ -461,7 +481,8 @@ export class Webhooks { enabled?: boolean; tls?: boolean; authUsername?: string; - authPassword?: string; + authPassword?: string | null; + description?: string | null; } | string, ...rest: [ @@ -471,7 +492,8 @@ export class Webhooks { boolean?, boolean?, string?, - string?, + (string | null)?, + (string | null)?, ] ): Promise<Models.Webhook> { let params: { @@ -482,7 +504,8 @@ export class Webhooks { enabled?: boolean; tls?: boolean; authUsername?: string; - authPassword?: string; + authPassword?: string | null; + description?: string | null; }; if ( @@ -498,7 +521,8 @@ export class Webhooks { enabled?: boolean; tls?: boolean; authUsername?: string; - authPassword?: string; + authPassword?: string | null; + description?: string | null; }; } else { params = { @@ -509,7 +533,8 @@ export class Webhooks { enabled: rest[3] as boolean, tls: rest[4] as boolean, authUsername: rest[5] as string, - authPassword: rest[6] as string, + authPassword: rest[6] as string | null, + description: rest[7] as string | null, }; } @@ -521,6 +546,7 @@ export class Webhooks { const tls = params.tls; const authUsername = params.authUsername; const authPassword = params.authPassword; + const description = params.description; if (typeof webhookId === 'undefined' || webhookId === '') { throw new AppwriteException( @@ -562,6 +588,9 @@ export class Webhooks { if (typeof authPassword !== 'undefined') { apiPayload['authPassword'] = authPassword; } + if (typeof description !== 'undefined') { + apiPayload['description'] = description; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -580,6 +609,7 @@ export class Webhooks { $createdAt: '', $updatedAt: '', name: '', + description: '', url: '', events: [], tls: true, @@ -656,29 +686,32 @@ export class Webhooks { * Update the webhook signing key. This endpoint can be used to regenerate the signing key used to sign and validate payload deliveries for a specific webhook. * * @param {string} params.webhookId - Webhook ID. - * @param {string} params.secret - Webhook secret key. If not provided, a new key will be generated automatically. Key must be at least 8 characters long, and at max 256 characters. + * @param {string | null} params.secret - Webhook secret key. If not provided, a new key will be generated automatically. Key must be at least 8 characters long, and at max 256 characters. * @throws {AppwriteException} * @returns {Promise<Models.Webhook>} */ updateSecret(params: { webhookId: string; - secret?: string; + secret?: string | null; }): Promise<Models.Webhook>; /** * Update the webhook signing key. This endpoint can be used to regenerate the signing key used to sign and validate payload deliveries for a specific webhook. * * @param {string} webhookId - Webhook ID. - * @param {string} secret - Webhook secret key. If not provided, a new key will be generated automatically. Key must be at least 8 characters long, and at max 256 characters. + * @param {string | null} secret - Webhook secret key. If not provided, a new key will be generated automatically. Key must be at least 8 characters long, and at max 256 characters. * @throws {AppwriteException} * @returns {Promise<Models.Webhook>} * @deprecated Use the object parameter style method for a better developer experience. */ - updateSecret(webhookId: string, secret?: string): Promise<Models.Webhook>; updateSecret( - paramsOrFirst: { webhookId: string; secret?: string } | string, - ...rest: [string?] + webhookId: string, + secret?: string | null, + ): Promise<Models.Webhook>; + updateSecret( + paramsOrFirst: { webhookId: string; secret?: string | null } | string, + ...rest: [(string | null)?] ): Promise<Models.Webhook> { - let params: { webhookId: string; secret?: string }; + let params: { webhookId: string; secret?: string | null }; if ( paramsOrFirst && @@ -687,12 +720,12 @@ export class Webhooks { ) { params = (paramsOrFirst || {}) as { webhookId: string; - secret?: string; + secret?: string | null; }; } else { params = { webhookId: paramsOrFirst as string, - secret: rest[0] as string, + secret: rest[0] as string | null, }; } @@ -730,6 +763,7 @@ export class Webhooks { $createdAt: '', $updatedAt: '', name: '', + description: '', url: '', events: [], tls: true, diff --git a/src/topic.ts b/src/topic.ts index cd6cea01..071d5aec 100644 --- a/src/topic.ts +++ b/src/topic.ts @@ -1,6 +1,6 @@ /** * Validate the levels passed to `path()`: a non-empty array of non-empty strings, none holding - * the level separator `/` or the wildcards `+` and `#` (use `any()` and `all()` for those). + * the level separator `/` or the MQTT wildcards `+` and `#`. */ function levelsOf(levels: unknown): string[] { if (!Array.isArray(levels)) { @@ -28,17 +28,14 @@ function levelsOf(levels: unknown): string[] { `"${level}" contains "/", split it: path([${parts}])`, ); } - if (level === '+') { - throw new Error('"+" is reserved, use any()'); - } if (level.includes('+')) { - throw new Error(`"${level}" contains "+", use any() for wildcards`); - } - if (level === '#') { - throw new Error('"#" is reserved, use all()'); + throw new Error(`"${level}" contains "+", not allowed in a topic`); } if (level.includes('#')) { - throw new Error(`"${level}" contains "#", use all() for wildcards`); + throw new Error(`"${level}" contains "#", not allowed in a topic`); + } + if (level.includes('\0')) { + throw new Error(`level at index ${index} contains a NUL character`); } return level; }); @@ -48,11 +45,7 @@ function levelsOf(levels: unknown): string[] { * Helper to build MQTT topics for `Push`, level by level. * * Topic.path(['user', userId, 'notification']); // "user/123/notification" - * Topic.path(['user']).any().path(['notification']); // "user/+/notification" - * Topic.path(['org']).any().path(['logs']).all(); // "org/+/logs/#" - * - * `any()` matches exactly one level and `all()` everything below, at any depth (including the - * parent itself). `all()` ends the topic, so it returns a {@link ResolvedTopic}. + * Topic.path(['org', orgId]).path(['logs']); // "org/42/logs" */ export class Topic { private constructor(private readonly levels: readonly string[]) {} @@ -62,41 +55,11 @@ export class Topic { return new Topic(levelsOf(levels)); } - /** Start a topic with a single-level wildcard (`+`). */ - static any(): Topic { - return new Topic(['+']); - } - - /** The multi-level wildcard alone (`#`): matches every topic. */ - static all(): ResolvedTopic { - return new ResolvedTopic(['#']); - } - /** Append the given levels. */ path(levels: string[]): Topic { return new Topic([...this.levels, ...levelsOf(levels)]); } - /** Append a single-level wildcard (`+`): matches exactly one level. */ - any(): Topic { - return new Topic([...this.levels, '+']); - } - - /** Append the multi-level wildcard (`#`) and end the topic. */ - all(): ResolvedTopic { - return new ResolvedTopic([...this.levels, '#']); - } - - toString(): string { - return this.levels.join('/'); - } -} - -/** A topic ended by `all()`: nothing can be appended after the `#` wildcard. */ -export class ResolvedTopic { - /** @internal Created by {@link Topic.all}. */ - constructor(private readonly levels: readonly string[]) {} - toString(): string { return this.levels.join('/'); }