import { Client } from '../client.js'; import { Models } from '../models.js'; import { OrganizationKeyScopes } from '../enums/organization-key-scopes.js'; import { Region } from '../enums/region.js'; import 'undici'; import '../query.js'; import '../enums/database-type.js'; import '../enums/attribute-status.js'; import '../enums/column-status.js'; import '../enums/index-status.js'; import '../enums/deployment-status.js'; import '../enums/execution-resource-type.js'; import '../enums/execution-trigger.js'; import '../enums/execution-status.js'; import '../enums/project-auth-method-id.js'; import '../enums/project-service-id.js'; import '../enums/project-protocol-id.js'; import '../enums/o-auth-2-google-prompt.js'; import '../enums/o-auth-2-oidc-prompt.js'; import '../enums/platform-type.js'; import '../enums/proxy-rule-deployment-resource-type.js'; import '../enums/proxy-rule-status.js'; import '../enums/message-status.js'; import '../enums/billing-plan-group.js'; declare class Organization { client: Client; constructor(client: Client); /** * Get the current organization. * * @throws {AppwriteException} * @returns {Promise>} */ get(): Promise>; /** * Update the current organization's name. * * @param {string} params.name - New organization name. Max length: 128 chars. * @throws {AppwriteException} * @returns {Promise>} */ update(params: { name: string; }): Promise>; /** * Update the current organization's name. * * @param {string} name - New organization name. Max length: 128 chars. * @throws {AppwriteException} * @returns {Promise>} * @deprecated Use the object parameter style method for a better developer experience. */ update(name: string): Promise>; /** * Delete the current organization. All projects that belong to the organization are deleted as well. * * @throws {AppwriteException} * @returns {Promise<{}>} */ delete(): Promise<{}>; /** * List app installations on the organization. Any organization member can read installations. * * @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} */ listInstallations(params?: { queries?: string[]; total?: boolean; }): Promise; /** * List app installations on the organization. Any organization member can read installations. * * @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} * @deprecated Use the object parameter style method for a better developer experience. */ listInstallations(queries?: string[], total?: boolean): Promise; /** * Install an app on the organization. Only organization members with the owner role can install apps. The installation is granted the scopes the app currently requests. * * @param {string} params.appId - Application 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. The Appwrite Console stores authorized project IDs here. * @throws {AppwriteException} * @returns {Promise} */ createInstallation(params: { appId: string; authorizationDetails?: string; }): Promise; /** * Install an app on the organization. Only organization members with the owner role can install apps. The installation is granted the scopes the app currently requests. * * @param {string} appId - Application 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. The Appwrite Console stores authorized project IDs here. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ createInstallation(appId: string, authorizationDetails?: string): Promise; /** * Get an app installation on the organization by its unique ID. Any organization member can read installations. * * @param {string} params.installationId - Installation unique ID. * @throws {AppwriteException} * @returns {Promise} */ getInstallation(params: { installationId: string; }): Promise; /** * Get an app installation on the organization by its unique ID. Any organization member can read installations. * * @param {string} installationId - Installation unique ID. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ getInstallation(installationId: string): Promise; /** * 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. * @throws {AppwriteException} * @returns {Promise} */ updateInstallation(params: { installationId: string; authorizationDetails?: string; }): Promise; /** * 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. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ updateInstallation(installationId: string, authorizationDetails?: string): Promise; /** * Uninstall an app from the organization by its installation ID. Only organization members with the owner role can remove installations. Previously issued installation access tokens are revoked. * * @param {string} params.installationId - Installation unique ID. * @throws {AppwriteException} * @returns {Promise<{}>} */ deleteInstallation(params: { installationId: string; }): Promise<{}>; /** * Uninstall an app from the organization by its installation ID. Only organization members with the owner role can remove installations. Previously issued installation access tokens are revoked. * * @param {string} installationId - Installation unique ID. * @throws {AppwriteException} * @returns {Promise<{}>} * @deprecated Use the object parameter style method for a better developer experience. */ deleteInstallation(installationId: string): Promise<{}>; /** * Get a list of all API keys from the current organization. * * @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: expire, accessedAt, name, scopes * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise} */ listKeys(params?: { queries?: string[]; total?: boolean; }): Promise; /** * Get a list of all API keys from the current organization. * * @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: expire, accessedAt, name, scopes * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ listKeys(queries?: string[], total?: boolean): Promise; /** * Create a new organization API key. * * @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. * @throws {AppwriteException} * @returns {Promise} */ createKey(params: { keyId: string; name: string; scopes: OrganizationKeyScopes[]; expire?: string; }): Promise; /** * Create a new organization API key. * * @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. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ createKey(keyId: string, name: string, scopes: OrganizationKeyScopes[], expire?: string): Promise; /** * Get a key by its unique ID. This endpoint returns details about a specific API key in your organization including its scopes. * * @param {string} params.keyId - Key unique ID. * @throws {AppwriteException} * @returns {Promise} */ getKey(params: { keyId: string; }): Promise; /** * Get a key by its unique ID. This endpoint returns details about a specific API key in your organization including its scopes. * * @param {string} keyId - Key unique ID. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ getKey(keyId: string): Promise; /** * Update a key by its unique ID. Use this endpoint to update the name, scopes, or expiration time of an API key. * * @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. * @throws {AppwriteException} * @returns {Promise} */ updateKey(params: { keyId: string; name: string; scopes: OrganizationKeyScopes[]; expire?: string; }): Promise; /** * Update a key by its unique ID. Use this endpoint to update the name, scopes, or expiration time of an API key. * * @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. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ updateKey(keyId: string, name: string, scopes: OrganizationKeyScopes[], expire?: string): Promise; /** * Delete a key by its unique ID. Once deleted, the key can no longer be used to authenticate API calls. * * @param {string} params.keyId - Key unique ID. * @throws {AppwriteException} * @returns {Promise<{}>} */ deleteKey(params: { keyId: string; }): Promise<{}>; /** * Delete a key by its unique ID. Once deleted, the key can no longer be used to authenticate API calls. * * @param {string} keyId - Key unique ID. * @throws {AppwriteException} * @returns {Promise<{}>} * @deprecated Use the object parameter style method for a better developer experience. */ deleteKey(keyId: string): Promise<{}>; /** * Get a list of all memberships from the current organization. * * @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: userId, teamId, invited, joined, confirm, roles * @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} */ listMemberships(params?: { queries?: string[]; search?: string; total?: boolean; }): Promise; /** * Get a list of all memberships from the current organization. * * @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: userId, teamId, invited, joined, confirm, roles * @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} * @deprecated Use the object parameter style method for a better developer experience. */ listMemberships(queries?: string[], search?: string, total?: boolean): Promise; /** * Invite a new member to join the current organization. An email with a link to join the organization will be sent to the new member's email address. If member doesn't exist in the project it will be automatically created. * * @param {string[]} params.roles - Array of strings. Use this param to set the user roles in the organization. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 81 characters long. * @param {string} params.email - Email of the new organization member. * @param {string} params.userId - ID of the user to be added to the organization. * @param {string} params.phone - Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212. * @param {string} params.url - URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. * @param {string} params.name - Name of the new organization member. Max length: 128 chars. * @throws {AppwriteException} * @returns {Promise} */ createMembership(params: { roles: string[]; email?: string; userId?: string; phone?: string; url?: string; name?: string; }): Promise; /** * Invite a new member to join the current organization. An email with a link to join the organization will be sent to the new member's email address. If member doesn't exist in the project it will be automatically created. * * @param {string[]} roles - Array of strings. Use this param to set the user roles in the organization. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 81 characters long. * @param {string} email - Email of the new organization member. * @param {string} userId - ID of the user to be added to the organization. * @param {string} phone - Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212. * @param {string} url - URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. * @param {string} name - Name of the new organization member. Max length: 128 chars. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ createMembership(roles: string[], email?: string, userId?: string, phone?: string, url?: string, name?: string): Promise; /** * Get a membership from the current organization by its unique ID. * * @param {string} params.membershipId - Membership ID. * @throws {AppwriteException} * @returns {Promise} */ getMembership(params: { membershipId: string; }): Promise; /** * Get a membership from the current organization by its unique ID. * * @param {string} membershipId - Membership ID. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ getMembership(membershipId: string): Promise; /** * Modify the roles of a member in the current organization. * * @param {string} params.membershipId - Membership ID. * @param {string[]} params.roles - An array of strings. Use this param to set the user's roles in the organization. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 81 characters long. * @throws {AppwriteException} * @returns {Promise} */ updateMembership(params: { membershipId: string; roles: string[]; }): Promise; /** * Modify the roles of a member in the current organization. * * @param {string} membershipId - Membership ID. * @param {string[]} roles - An array of strings. Use this param to set the user's roles in the organization. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 81 characters long. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ updateMembership(membershipId: string, roles: string[]): Promise; /** * Remove a member from the current organization. The member is removed whether they accepted the invitation or not; a pending invitation is revoked. * * @param {string} params.membershipId - Membership ID. * @throws {AppwriteException} * @returns {Promise<{}>} */ deleteMembership(params: { membershipId: string; }): Promise<{}>; /** * Remove a member from the current organization. The member is removed whether they accepted the invitation or not; a pending invitation is revoked. * * @param {string} membershipId - Membership ID. * @throws {AppwriteException} * @returns {Promise<{}>} * @deprecated Use the object parameter style method for a better developer experience. */ deleteMembership(membershipId: string): Promise<{}>; /** * Get a list of all projects. 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/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, teamId, labels, search, accessedAt * @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} */ listProjects(params?: { queries?: string[]; search?: string; total?: boolean; }): Promise; /** * Get a list of all projects. 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/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, teamId, labels, search, accessedAt * @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} * @deprecated Use the object parameter style method for a better developer experience. */ listProjects(queries?: string[], search?: string, total?: boolean): Promise; /** * Create a new project. * * @param {string} params.projectId - Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, and hyphen. Can't start with a special char. Max length is 36 chars. * @param {string} params.name - Project name. Max length: 128 chars. * @param {Region} params.region - Project Region. * @throws {AppwriteException} * @returns {Promise} */ createProject(params: { projectId: string; name: string; region?: Region; }): Promise; /** * Create a new project. * * @param {string} projectId - Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, and hyphen. Can't start with a special char. Max length is 36 chars. * @param {string} name - Project name. Max length: 128 chars. * @param {Region} region - Project Region. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ createProject(projectId: string, name: string, region?: Region): Promise; /** * Get a project. * * @param {string} params.projectId - Project unique ID. * @throws {AppwriteException} * @returns {Promise} */ getProject(params: { projectId: string; }): Promise; /** * Get a project. * * @param {string} projectId - Project unique ID. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ getProject(projectId: string): Promise; /** * Update a project by its unique ID. * * @param {string} params.projectId - Project unique ID. * @param {string} params.name - Project name. Max length: 128 chars. * @throws {AppwriteException} * @returns {Promise} */ updateProject(params: { projectId: string; name: string; }): Promise; /** * Update a project by its unique ID. * * @param {string} projectId - Project unique ID. * @param {string} name - Project name. Max length: 128 chars. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ updateProject(projectId: string, name: string): Promise; /** * Delete a project by its unique ID. * * @param {string} params.projectId - Project unique ID. * @throws {AppwriteException} * @returns {Promise<{}>} */ deleteProject(params: { projectId: string; }): Promise<{}>; /** * Delete a project by its unique ID. * * @param {string} projectId - Project unique ID. * @throws {AppwriteException} * @returns {Promise<{}>} * @deprecated Use the object parameter style method for a better developer experience. */ deleteProject(projectId: string): Promise<{}>; } export { Organization };