@appwrite.io/console 16.1.0 → 17.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/cjs/sdk.js +597 -346
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +598 -347
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +597 -346
- package/package.json +1 -1
- package/types/client.d.ts +0 -11
- package/types/enums/billing-plan-group.d.ts +2 -1
- package/types/enums/cache-database.d.ts +1 -2
- package/types/enums/framework.d.ts +1 -0
- package/types/enums/id-token-provider.d.ts +4 -0
- package/types/enums/organization-key-scopes.d.ts +2 -4
- package/types/enums/project-email-template-id.d.ts +2 -1
- package/types/enums/project-key-scopes.d.ts +1 -0
- package/types/enums/project-policy-id.d.ts +1 -0
- package/types/enums/query-suggestion-resource.d.ts +1 -3
- package/types/index.d.ts +2 -2
- package/types/models.d.ts +214 -566
- package/types/services/account.d.ts +110 -22
- package/types/services/console.d.ts +2 -2
- package/types/services/manager.d.ts +14 -14
- package/types/services/messaging.d.ts +80 -6
- package/types/services/organization.d.ts +165 -0
- package/types/services/organizations.d.ts +19 -19
- package/types/services/project.d.ts +53 -42
- package/types/services/projects.d.ts +0 -94
- package/types/services/storage.d.ts +4 -4
- package/types/services/teams.d.ts +0 -25
- package/types/services/users.d.ts +2 -27
- package/types/enums/project-usage-range.d.ts +0 -4
|
@@ -3,6 +3,7 @@ import type { Models } from '../models';
|
|
|
3
3
|
import { AccountKeyScopes } from '../enums/account-key-scopes';
|
|
4
4
|
import { AuthenticatorType } from '../enums/authenticator-type';
|
|
5
5
|
import { AuthenticationFactor } from '../enums/authentication-factor';
|
|
6
|
+
import { IdTokenProvider } from '../enums/id-token-provider';
|
|
6
7
|
import { OAuthProvider } from '../enums/o-auth-provider';
|
|
7
8
|
export declare class Account {
|
|
8
9
|
client: Client;
|
|
@@ -540,28 +541,6 @@ export declare class Account {
|
|
|
540
541
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
541
542
|
*/
|
|
542
543
|
deleteKey(keyId: string): Promise<{}>;
|
|
543
|
-
/**
|
|
544
|
-
* Get the list of latest security activity logs for the currently logged in user. Each log returns user IP address, location and date and time of log.
|
|
545
|
-
*
|
|
546
|
-
* @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). Only supported methods are limit and offset
|
|
547
|
-
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
548
|
-
* @throws {AppwriteException}
|
|
549
|
-
* @returns {Promise<Models.LogList>}
|
|
550
|
-
*/
|
|
551
|
-
listLogs(params?: {
|
|
552
|
-
queries?: string[];
|
|
553
|
-
total?: boolean;
|
|
554
|
-
}): Promise<Models.LogList>;
|
|
555
|
-
/**
|
|
556
|
-
* Get the list of latest security activity logs for the currently logged in user. Each log returns user IP address, location and date and time of log.
|
|
557
|
-
*
|
|
558
|
-
* @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). Only supported methods are limit and offset
|
|
559
|
-
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
560
|
-
* @throws {AppwriteException}
|
|
561
|
-
* @returns {Promise<Models.LogList>}
|
|
562
|
-
* @deprecated Use the object parameter style method for a better developer experience.
|
|
563
|
-
*/
|
|
564
|
-
listLogs(queries?: string[], total?: boolean): Promise<Models.LogList>;
|
|
565
544
|
/**
|
|
566
545
|
* Enable or disable MFA on an account.
|
|
567
546
|
*
|
|
@@ -1174,6 +1153,62 @@ export declare class Account {
|
|
|
1174
1153
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1175
1154
|
*/
|
|
1176
1155
|
createEmailPasswordSession(email: string, password: string): Promise<Models.Session>;
|
|
1156
|
+
/**
|
|
1157
|
+
* Allow the user to login to their account using an OpenID Connect ID token obtained natively from the OAuth2 provider, for example via Google Credential Manager on Android or Sign in with Apple on iOS. No browser or redirect is involved: the ID token is verified against the provider's published signing keys and a session is created in a single request.
|
|
1158
|
+
*
|
|
1159
|
+
* Native sign-in is switched on per provider with its nativeEnabled setting. It is independent of the browser-based flow's enabled setting, which has no effect on this endpoint. The token's audience must match the provider's configured client ID or one of its native client IDs; tokens issued for any other client ID are rejected. For Sign in with Apple, register your app's bundle ID as a native client ID. For Google, the web client ID used by Credential Manager is usually the configured client ID; add your Android and iOS client IDs as native client IDs if your app requests tokens for them.
|
|
1160
|
+
*
|
|
1161
|
+
* Pass the raw nonce used when requesting the ID token so it can be validated against the token's nonce claim. When signing in with Apple, the nonce is required: hash it with SHA-256 before passing it to the Apple SDK, and send the raw value here - Apple tokens requested without a nonce are rejected. For Google the nonce is optional: it is validated whenever the token carries one, and ignored when the provider issued the token without one. Apple only returns the user's name on the first authorization, and never inside the ID token - capture it on the client and pass it via the name parameter.
|
|
1162
|
+
*
|
|
1163
|
+
* If there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the verified email received from the provider and attach the new session to the existing user. If no matching user is found - the server will create a new user.
|
|
1164
|
+
*
|
|
1165
|
+
* This flow does not return provider refresh tokens. You may pass an access token the provider handed your client, along with its lifetime, to store it on the session - but Appwrite cannot renew it once it expires. If your app needs long-lived access to provider APIs, use the browser-based OAuth2 flow instead.
|
|
1166
|
+
*
|
|
1167
|
+
* A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits).
|
|
1168
|
+
*
|
|
1169
|
+
*
|
|
1170
|
+
* @param {IdTokenProvider} params.provider - OAuth2 provider that issued the ID token. Currently, supported providers are: apple, google.
|
|
1171
|
+
* @param {string} params.idToken - OpenID Connect ID token (JWT) obtained natively from the provider, for example via Google Credential Manager or Sign in with Apple.
|
|
1172
|
+
* @param {string} params.nonce - Raw nonce used when requesting the ID token. Required for Apple, and whenever the token carries a nonce claim, which must match it. Ignored when the provider issued the token without a nonce.
|
|
1173
|
+
* @param {string} params.accessToken - Provider access token to store alongside the session for calling provider APIs. Never used for authentication.
|
|
1174
|
+
* @param {number} params.accessTokenExpiry - Seconds until the provider access token expires, as reported by the provider. Stored so clients can tell when the stored token goes stale.
|
|
1175
|
+
* @param {string} params.name - User name. Only used when creating a new user and the ID token has no name claim, such as on the first Sign in with Apple authorization.
|
|
1176
|
+
* @throws {AppwriteException}
|
|
1177
|
+
* @returns {Promise<Models.Session>}
|
|
1178
|
+
*/
|
|
1179
|
+
createIdTokenSession(params: {
|
|
1180
|
+
provider: IdTokenProvider;
|
|
1181
|
+
idToken: string;
|
|
1182
|
+
nonce?: string;
|
|
1183
|
+
accessToken?: string;
|
|
1184
|
+
accessTokenExpiry?: number;
|
|
1185
|
+
name?: string;
|
|
1186
|
+
}): Promise<Models.Session>;
|
|
1187
|
+
/**
|
|
1188
|
+
* Allow the user to login to their account using an OpenID Connect ID token obtained natively from the OAuth2 provider, for example via Google Credential Manager on Android or Sign in with Apple on iOS. No browser or redirect is involved: the ID token is verified against the provider's published signing keys and a session is created in a single request.
|
|
1189
|
+
*
|
|
1190
|
+
* Native sign-in is switched on per provider with its nativeEnabled setting. It is independent of the browser-based flow's enabled setting, which has no effect on this endpoint. The token's audience must match the provider's configured client ID or one of its native client IDs; tokens issued for any other client ID are rejected. For Sign in with Apple, register your app's bundle ID as a native client ID. For Google, the web client ID used by Credential Manager is usually the configured client ID; add your Android and iOS client IDs as native client IDs if your app requests tokens for them.
|
|
1191
|
+
*
|
|
1192
|
+
* Pass the raw nonce used when requesting the ID token so it can be validated against the token's nonce claim. When signing in with Apple, the nonce is required: hash it with SHA-256 before passing it to the Apple SDK, and send the raw value here - Apple tokens requested without a nonce are rejected. For Google the nonce is optional: it is validated whenever the token carries one, and ignored when the provider issued the token without one. Apple only returns the user's name on the first authorization, and never inside the ID token - capture it on the client and pass it via the name parameter.
|
|
1193
|
+
*
|
|
1194
|
+
* If there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the verified email received from the provider and attach the new session to the existing user. If no matching user is found - the server will create a new user.
|
|
1195
|
+
*
|
|
1196
|
+
* This flow does not return provider refresh tokens. You may pass an access token the provider handed your client, along with its lifetime, to store it on the session - but Appwrite cannot renew it once it expires. If your app needs long-lived access to provider APIs, use the browser-based OAuth2 flow instead.
|
|
1197
|
+
*
|
|
1198
|
+
* A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits).
|
|
1199
|
+
*
|
|
1200
|
+
*
|
|
1201
|
+
* @param {IdTokenProvider} provider - OAuth2 provider that issued the ID token. Currently, supported providers are: apple, google.
|
|
1202
|
+
* @param {string} idToken - OpenID Connect ID token (JWT) obtained natively from the provider, for example via Google Credential Manager or Sign in with Apple.
|
|
1203
|
+
* @param {string} nonce - Raw nonce used when requesting the ID token. Required for Apple, and whenever the token carries a nonce claim, which must match it. Ignored when the provider issued the token without a nonce.
|
|
1204
|
+
* @param {string} accessToken - Provider access token to store alongside the session for calling provider APIs. Never used for authentication.
|
|
1205
|
+
* @param {number} accessTokenExpiry - Seconds until the provider access token expires, as reported by the provider. Stored so clients can tell when the stored token goes stale.
|
|
1206
|
+
* @param {string} name - User name. Only used when creating a new user and the ID token has no name claim, such as on the first Sign in with Apple authorization.
|
|
1207
|
+
* @throws {AppwriteException}
|
|
1208
|
+
* @returns {Promise<Models.Session>}
|
|
1209
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1210
|
+
*/
|
|
1211
|
+
createIdTokenSession(provider: IdTokenProvider, idToken: string, nonce?: string, accessToken?: string, accessTokenExpiry?: number, name?: string): Promise<Models.Session>;
|
|
1177
1212
|
/**
|
|
1178
1213
|
* Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.
|
|
1179
1214
|
*
|
|
@@ -1480,6 +1515,8 @@ export declare class Account {
|
|
|
1480
1515
|
*
|
|
1481
1516
|
* If authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint.
|
|
1482
1517
|
*
|
|
1518
|
+
* If there is already an active session, the OAuth2 identity is attached to the logged-in account and that session stays active until the token is exchanged for a new one.
|
|
1519
|
+
*
|
|
1483
1520
|
* A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits).
|
|
1484
1521
|
*
|
|
1485
1522
|
* @param {OAuthProvider} params.provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, appwrite, auth0, authentik, autodesk, bitbucket, bitly, box, cloudflare, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, fusionauth, github, gitlab, google, huggingface, kakao, keycloak, kick, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, resend, salesforce, slack, spotify, stripe, tiktok, tradeshift, tradeshiftBox, twitch, wordpress, x, yahoo, yammer, yandex, zoho, zoom.
|
|
@@ -1500,6 +1537,8 @@ export declare class Account {
|
|
|
1500
1537
|
*
|
|
1501
1538
|
* If authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint.
|
|
1502
1539
|
*
|
|
1540
|
+
* If there is already an active session, the OAuth2 identity is attached to the logged-in account and that session stays active until the token is exchanged for a new one.
|
|
1541
|
+
*
|
|
1503
1542
|
* A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits).
|
|
1504
1543
|
*
|
|
1505
1544
|
* @param {OAuthProvider} provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, appwrite, auth0, authentik, autodesk, bitbucket, bitly, box, cloudflare, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, fusionauth, github, gitlab, google, huggingface, kakao, keycloak, kick, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, resend, salesforce, slack, spotify, stripe, tiktok, tradeshift, tradeshiftBox, twitch, wordpress, x, yahoo, yammer, yandex, zoho, zoom.
|
|
@@ -1633,6 +1672,55 @@ export declare class Account {
|
|
|
1633
1672
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1634
1673
|
*/
|
|
1635
1674
|
updateVerification(userId: string, secret: string): Promise<Models.Token>;
|
|
1675
|
+
/**
|
|
1676
|
+
* Use this endpoint to send a 6-digit verification code to the currently logged in user's email address. Unlike [createEmailVerification](https://appwrite.io/docs/references/cloud/client-web/account#createEmailVerification), this method requires no redirect URL, which makes it suitable for mobile and desktop apps that cannot host a verification page. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updateEmailVerificationOTP). The code sent to the user's email address is valid for 15 minutes.
|
|
1677
|
+
*
|
|
1678
|
+
* Enable the **phrase** parameter to include a randomly generated security phrase in both the email and the response. Showing that phrase in your app lets the user confirm the email genuinely came from your request, which helps protect against phishing.
|
|
1679
|
+
*
|
|
1680
|
+
*
|
|
1681
|
+
* @param {boolean} params.phrase - Toggle for security phrase. If enabled, email will be sent with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.
|
|
1682
|
+
* @throws {AppwriteException}
|
|
1683
|
+
* @returns {Promise<Models.Token>}
|
|
1684
|
+
*/
|
|
1685
|
+
createEmailVerificationOTP(params?: {
|
|
1686
|
+
phrase?: boolean;
|
|
1687
|
+
}): Promise<Models.Token>;
|
|
1688
|
+
/**
|
|
1689
|
+
* Use this endpoint to send a 6-digit verification code to the currently logged in user's email address. Unlike [createEmailVerification](https://appwrite.io/docs/references/cloud/client-web/account#createEmailVerification), this method requires no redirect URL, which makes it suitable for mobile and desktop apps that cannot host a verification page. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updateEmailVerificationOTP). The code sent to the user's email address is valid for 15 minutes.
|
|
1690
|
+
*
|
|
1691
|
+
* Enable the **phrase** parameter to include a randomly generated security phrase in both the email and the response. Showing that phrase in your app lets the user confirm the email genuinely came from your request, which helps protect against phishing.
|
|
1692
|
+
*
|
|
1693
|
+
*
|
|
1694
|
+
* @param {boolean} phrase - Toggle for security phrase. If enabled, email will be sent with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.
|
|
1695
|
+
* @throws {AppwriteException}
|
|
1696
|
+
* @returns {Promise<Models.Token>}
|
|
1697
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1698
|
+
*/
|
|
1699
|
+
createEmailVerificationOTP(phrase?: boolean): Promise<Models.Token>;
|
|
1700
|
+
/**
|
|
1701
|
+
* Use this endpoint to complete the user email verification process using the 6-digit code that was emailed by [createEmailVerificationOTP](https://appwrite.io/docs/references/cloud/client-web/account#createEmailVerificationOTP). Pass the **userId** of the user being verified along with the **secret** code from the email. If confirmed, this route will return a 200 status code and the code is consumed.
|
|
1702
|
+
*
|
|
1703
|
+
*
|
|
1704
|
+
* @param {string} params.userId - User ID.
|
|
1705
|
+
* @param {string} params.secret - Valid verification OTP code.
|
|
1706
|
+
* @throws {AppwriteException}
|
|
1707
|
+
* @returns {Promise<Models.Token>}
|
|
1708
|
+
*/
|
|
1709
|
+
updateEmailVerificationOTP(params: {
|
|
1710
|
+
userId: string;
|
|
1711
|
+
secret: string;
|
|
1712
|
+
}): Promise<Models.Token>;
|
|
1713
|
+
/**
|
|
1714
|
+
* Use this endpoint to complete the user email verification process using the 6-digit code that was emailed by [createEmailVerificationOTP](https://appwrite.io/docs/references/cloud/client-web/account#createEmailVerificationOTP). Pass the **userId** of the user being verified along with the **secret** code from the email. If confirmed, this route will return a 200 status code and the code is consumed.
|
|
1715
|
+
*
|
|
1716
|
+
*
|
|
1717
|
+
* @param {string} userId - User ID.
|
|
1718
|
+
* @param {string} secret - Valid verification OTP code.
|
|
1719
|
+
* @throws {AppwriteException}
|
|
1720
|
+
* @returns {Promise<Models.Token>}
|
|
1721
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1722
|
+
*/
|
|
1723
|
+
updateEmailVerificationOTP(userId: string, secret: string): Promise<Models.Token>;
|
|
1636
1724
|
/**
|
|
1637
1725
|
* Use this endpoint to send a verification SMS to the currently logged in user. This endpoint is meant for use after updating a user's phone number using the [accountUpdatePhone](https://appwrite.io/docs/references/cloud/client-web/account#updatePhone) endpoint. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updatePhoneVerification). The verification code sent to the user's phone number is valid for 15 minutes.
|
|
1638
1726
|
*
|
|
@@ -330,7 +330,7 @@ export declare class Console {
|
|
|
330
330
|
/**
|
|
331
331
|
* Get the Appwrite built-in default email template for the specified type and locale. Always returns the unmodified default, ignoring any custom project overrides.
|
|
332
332
|
*
|
|
333
|
-
* @param {ProjectEmailTemplateId} params.templateId - Email template type. Can be one of: verification, magicSession, recovery, invitation, mfaChallenge, sessionAlert, otpSession
|
|
333
|
+
* @param {ProjectEmailTemplateId} params.templateId - Email template type. Can be one of: verification, magicSession, recovery, invitation, mfaChallenge, sessionAlert, otpSession, otpVerification
|
|
334
334
|
* @param {ProjectEmailTemplateLocale} params.locale - Template locale. If left empty, the fallback locale (en) will be used.
|
|
335
335
|
* @throws {AppwriteException}
|
|
336
336
|
* @returns {Promise<Models.EmailTemplate>}
|
|
@@ -342,7 +342,7 @@ export declare class Console {
|
|
|
342
342
|
/**
|
|
343
343
|
* Get the Appwrite built-in default email template for the specified type and locale. Always returns the unmodified default, ignoring any custom project overrides.
|
|
344
344
|
*
|
|
345
|
-
* @param {ProjectEmailTemplateId} templateId - Email template type. Can be one of: verification, magicSession, recovery, invitation, mfaChallenge, sessionAlert, otpSession
|
|
345
|
+
* @param {ProjectEmailTemplateId} templateId - Email template type. Can be one of: verification, magicSession, recovery, invitation, mfaChallenge, sessionAlert, otpSession, otpVerification
|
|
346
346
|
* @param {ProjectEmailTemplateLocale} locale - Template locale. If left empty, the fallback locale (en) will be used.
|
|
347
347
|
* @throws {AppwriteException}
|
|
348
348
|
* @returns {Promise<Models.EmailTemplate>}
|
|
@@ -18,7 +18,7 @@ export declare class Manager {
|
|
|
18
18
|
* @param {string} params.reason - Optional reason why the resource is blocked
|
|
19
19
|
* @param {string} params.expiredAt - Optional expiration date for the block
|
|
20
20
|
* @throws {AppwriteException}
|
|
21
|
-
* @returns {Promise<Models.
|
|
21
|
+
* @returns {Promise<Models.ManagerBlock>}
|
|
22
22
|
*/
|
|
23
23
|
createBlock(params: {
|
|
24
24
|
projectId: string;
|
|
@@ -27,7 +27,7 @@ export declare class Manager {
|
|
|
27
27
|
mode?: BlockMode;
|
|
28
28
|
reason?: string;
|
|
29
29
|
expiredAt?: string;
|
|
30
|
-
}): Promise<Models.
|
|
30
|
+
}): Promise<Models.ManagerBlock>;
|
|
31
31
|
/**
|
|
32
32
|
* Creates a new resource block.
|
|
33
33
|
*
|
|
@@ -38,10 +38,10 @@ export declare class Manager {
|
|
|
38
38
|
* @param {string} reason - Optional reason why the resource is blocked
|
|
39
39
|
* @param {string} expiredAt - Optional expiration date for the block
|
|
40
40
|
* @throws {AppwriteException}
|
|
41
|
-
* @returns {Promise<Models.
|
|
41
|
+
* @returns {Promise<Models.ManagerBlock>}
|
|
42
42
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
43
43
|
*/
|
|
44
|
-
createBlock(projectId: string, resourceType: BlockResourceType, resourceId?: string, mode?: BlockMode, reason?: string, expiredAt?: string): Promise<Models.
|
|
44
|
+
createBlock(projectId: string, resourceType: BlockResourceType, resourceId?: string, mode?: BlockMode, reason?: string, expiredAt?: string): Promise<Models.ManagerBlock>;
|
|
45
45
|
/**
|
|
46
46
|
* Deletes resource blocks for a project.
|
|
47
47
|
*
|
|
@@ -49,13 +49,13 @@ export declare class Manager {
|
|
|
49
49
|
* @param {BlockResourceType} params.resourceType - Resource type to unblock
|
|
50
50
|
* @param {string} params.resourceId - Optional resource ID (if omitted, all blocks of this type will be removed)
|
|
51
51
|
* @throws {AppwriteException}
|
|
52
|
-
* @returns {Promise<Models.
|
|
52
|
+
* @returns {Promise<Models.ManagerBlockDelete>}
|
|
53
53
|
*/
|
|
54
54
|
deleteBlock(params: {
|
|
55
55
|
projectId: string;
|
|
56
56
|
resourceType: BlockResourceType;
|
|
57
57
|
resourceId?: string;
|
|
58
|
-
}): Promise<Models.
|
|
58
|
+
}): Promise<Models.ManagerBlockDelete>;
|
|
59
59
|
/**
|
|
60
60
|
* Deletes resource blocks for a project.
|
|
61
61
|
*
|
|
@@ -63,29 +63,29 @@ export declare class Manager {
|
|
|
63
63
|
* @param {BlockResourceType} resourceType - Resource type to unblock
|
|
64
64
|
* @param {string} resourceId - Optional resource ID (if omitted, all blocks of this type will be removed)
|
|
65
65
|
* @throws {AppwriteException}
|
|
66
|
-
* @returns {Promise<Models.
|
|
66
|
+
* @returns {Promise<Models.ManagerBlockDelete>}
|
|
67
67
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
68
68
|
*/
|
|
69
|
-
deleteBlock(projectId: string, resourceType: BlockResourceType, resourceId?: string): Promise<Models.
|
|
69
|
+
deleteBlock(projectId: string, resourceType: BlockResourceType, resourceId?: string): Promise<Models.ManagerBlockDelete>;
|
|
70
70
|
/**
|
|
71
71
|
* Lists all resource blocks for a project.
|
|
72
72
|
*
|
|
73
73
|
* @param {string} params.projectId - Project ID
|
|
74
74
|
* @throws {AppwriteException}
|
|
75
|
-
* @returns {Promise<Models.
|
|
75
|
+
* @returns {Promise<Models.ManagerBlockList>}
|
|
76
76
|
*/
|
|
77
77
|
listBlocks(params: {
|
|
78
78
|
projectId: string;
|
|
79
|
-
}): Promise<Models.
|
|
79
|
+
}): Promise<Models.ManagerBlockList>;
|
|
80
80
|
/**
|
|
81
81
|
* Lists all resource blocks for a project.
|
|
82
82
|
*
|
|
83
83
|
* @param {string} projectId - Project ID
|
|
84
84
|
* @throws {AppwriteException}
|
|
85
|
-
* @returns {Promise<Models.
|
|
85
|
+
* @returns {Promise<Models.ManagerBlockList>}
|
|
86
86
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
87
87
|
*/
|
|
88
|
-
listBlocks(projectId: string): Promise<Models.
|
|
88
|
+
listBlocks(projectId: string): Promise<Models.ManagerBlockList>;
|
|
89
89
|
/**
|
|
90
90
|
* Clears internal cache.
|
|
91
91
|
*
|
|
@@ -93,7 +93,7 @@ export declare class Manager {
|
|
|
93
93
|
* @param {CacheTarget} params.cache - Cache target.
|
|
94
94
|
* @param {boolean} params.all - Clear the entire selected cache target.
|
|
95
95
|
* @param {CacheDatabase} params.database - Database cache scope.
|
|
96
|
-
* @param {string} params.projectId - Project ID for project
|
|
96
|
+
* @param {string} params.projectId - Project ID for project database cache.
|
|
97
97
|
* @param {string} params.collectionId - Collection ID.
|
|
98
98
|
* @param {string} params.documentId - Document ID.
|
|
99
99
|
* @throws {AppwriteException}
|
|
@@ -115,7 +115,7 @@ export declare class Manager {
|
|
|
115
115
|
* @param {CacheTarget} cache - Cache target.
|
|
116
116
|
* @param {boolean} all - Clear the entire selected cache target.
|
|
117
117
|
* @param {CacheDatabase} database - Database cache scope.
|
|
118
|
-
* @param {string} projectId - Project ID for project
|
|
118
|
+
* @param {string} projectId - Project ID for project database cache.
|
|
119
119
|
* @param {string} collectionId - Collection ID.
|
|
120
120
|
* @param {string} documentId - Document ID.
|
|
121
121
|
* @throws {AppwriteException}
|
|
@@ -690,6 +690,68 @@ export declare class Messaging {
|
|
|
690
690
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
691
691
|
*/
|
|
692
692
|
updateAPNSProvider(providerId: string, name?: string, enabled?: boolean, authKey?: string, authKeyId?: string, teamId?: string, bundleId?: string, sandbox?: boolean): Promise<Models.Provider>;
|
|
693
|
+
/**
|
|
694
|
+
* Create a new Appwrite push provider.
|
|
695
|
+
*
|
|
696
|
+
* @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.
|
|
697
|
+
* @param {string} params.name - Provider name.
|
|
698
|
+
* @param {boolean} params.enabled - Set as enabled.
|
|
699
|
+
* @param {number} params.qos - Default QoS for topics on this provider (0 or 1). Null lets the subscriber choose.
|
|
700
|
+
* @param {number} params.expiry - Default message retention in seconds for offline delivery. Max 7 days (604800).
|
|
701
|
+
* @throws {AppwriteException}
|
|
702
|
+
* @returns {Promise<Models.Provider>}
|
|
703
|
+
*/
|
|
704
|
+
createAppwriteProvider(params: {
|
|
705
|
+
providerId: string;
|
|
706
|
+
name: string;
|
|
707
|
+
enabled?: boolean;
|
|
708
|
+
qos?: number;
|
|
709
|
+
expiry?: number;
|
|
710
|
+
}): Promise<Models.Provider>;
|
|
711
|
+
/**
|
|
712
|
+
* Create a new Appwrite push provider.
|
|
713
|
+
*
|
|
714
|
+
* @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.
|
|
715
|
+
* @param {string} name - Provider name.
|
|
716
|
+
* @param {boolean} enabled - Set as enabled.
|
|
717
|
+
* @param {number} qos - Default QoS for topics on this provider (0 or 1). Null lets the subscriber choose.
|
|
718
|
+
* @param {number} expiry - Default message retention in seconds for offline delivery. Max 7 days (604800).
|
|
719
|
+
* @throws {AppwriteException}
|
|
720
|
+
* @returns {Promise<Models.Provider>}
|
|
721
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
722
|
+
*/
|
|
723
|
+
createAppwriteProvider(providerId: string, name: string, enabled?: boolean, qos?: number, expiry?: number): Promise<Models.Provider>;
|
|
724
|
+
/**
|
|
725
|
+
* Update an Appwrite push provider by its unique ID.
|
|
726
|
+
*
|
|
727
|
+
* @param {string} params.providerId - Provider ID.
|
|
728
|
+
* @param {string} params.name - Provider name.
|
|
729
|
+
* @param {boolean} params.enabled - Set as enabled.
|
|
730
|
+
* @param {number} params.qos - Default QoS for topics on this provider (0 or 1). Null lets the subscriber choose.
|
|
731
|
+
* @param {number} params.expiry - Default message retention in seconds for offline delivery. Max 7 days (604800).
|
|
732
|
+
* @throws {AppwriteException}
|
|
733
|
+
* @returns {Promise<Models.Provider>}
|
|
734
|
+
*/
|
|
735
|
+
updateAppwriteProvider(params: {
|
|
736
|
+
providerId: string;
|
|
737
|
+
name?: string;
|
|
738
|
+
enabled?: boolean;
|
|
739
|
+
qos?: number;
|
|
740
|
+
expiry?: number;
|
|
741
|
+
}): Promise<Models.Provider>;
|
|
742
|
+
/**
|
|
743
|
+
* Update an Appwrite push provider by its unique ID.
|
|
744
|
+
*
|
|
745
|
+
* @param {string} providerId - Provider ID.
|
|
746
|
+
* @param {string} name - Provider name.
|
|
747
|
+
* @param {boolean} enabled - Set as enabled.
|
|
748
|
+
* @param {number} qos - Default QoS for topics on this provider (0 or 1). Null lets the subscriber choose.
|
|
749
|
+
* @param {number} expiry - Default message retention in seconds for offline delivery. Max 7 days (604800).
|
|
750
|
+
* @throws {AppwriteException}
|
|
751
|
+
* @returns {Promise<Models.Provider>}
|
|
752
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
753
|
+
*/
|
|
754
|
+
updateAppwriteProvider(providerId: string, name?: string, enabled?: boolean, qos?: number, expiry?: number): Promise<Models.Provider>;
|
|
693
755
|
/**
|
|
694
756
|
* Create a new Firebase Cloud Messaging provider.
|
|
695
757
|
*
|
|
@@ -1591,7 +1653,7 @@ export declare class Messaging {
|
|
|
1591
1653
|
*
|
|
1592
1654
|
* @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.
|
|
1593
1655
|
* @param {string} params.name - Provider name.
|
|
1594
|
-
* @param {string} params.from - Sender
|
|
1656
|
+
* @param {string} params.from - Sender phone number or alphanumeric sender ID. Format phone numbers with a leading '+' and a country code, e.g., +16175551212.
|
|
1595
1657
|
* @param {string} params.accountSid - Twilio account secret ID.
|
|
1596
1658
|
* @param {string} params.authToken - Twilio authentication token.
|
|
1597
1659
|
* @param {boolean} params.enabled - Set as enabled.
|
|
@@ -1611,7 +1673,7 @@ export declare class Messaging {
|
|
|
1611
1673
|
*
|
|
1612
1674
|
* @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.
|
|
1613
1675
|
* @param {string} name - Provider name.
|
|
1614
|
-
* @param {string} from - Sender
|
|
1676
|
+
* @param {string} from - Sender phone number or alphanumeric sender ID. Format phone numbers with a leading '+' and a country code, e.g., +16175551212.
|
|
1615
1677
|
* @param {string} accountSid - Twilio account secret ID.
|
|
1616
1678
|
* @param {string} authToken - Twilio authentication token.
|
|
1617
1679
|
* @param {boolean} enabled - Set as enabled.
|
|
@@ -1628,7 +1690,7 @@ export declare class Messaging {
|
|
|
1628
1690
|
* @param {boolean} params.enabled - Set as enabled.
|
|
1629
1691
|
* @param {string} params.accountSid - Twilio account secret ID.
|
|
1630
1692
|
* @param {string} params.authToken - Twilio authentication token.
|
|
1631
|
-
* @param {string} params.from - Sender number.
|
|
1693
|
+
* @param {string} params.from - Sender phone number or alphanumeric sender ID. Format phone numbers with a leading '+' and a country code, e.g., +16175551212.
|
|
1632
1694
|
* @throws {AppwriteException}
|
|
1633
1695
|
* @returns {Promise<Models.Provider>}
|
|
1634
1696
|
*/
|
|
@@ -1648,7 +1710,7 @@ export declare class Messaging {
|
|
|
1648
1710
|
* @param {boolean} enabled - Set as enabled.
|
|
1649
1711
|
* @param {string} accountSid - Twilio account secret ID.
|
|
1650
1712
|
* @param {string} authToken - Twilio authentication token.
|
|
1651
|
-
* @param {string} from - Sender number.
|
|
1713
|
+
* @param {string} from - Sender phone number or alphanumeric sender ID. Format phone numbers with a leading '+' and a country code, e.g., +16175551212.
|
|
1652
1714
|
* @throws {AppwriteException}
|
|
1653
1715
|
* @returns {Promise<Models.Provider>}
|
|
1654
1716
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
@@ -1793,6 +1855,8 @@ export declare class Messaging {
|
|
|
1793
1855
|
* @param {string} params.topicId - Topic ID. Choose a custom Topic ID or a new Topic ID.
|
|
1794
1856
|
* @param {string} params.name - Topic Name.
|
|
1795
1857
|
* @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.
|
|
1858
|
+
* @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.
|
|
1859
|
+
* @param {number} params.expiry - Message retention in seconds for offline delivery. Max 7 days (604800).
|
|
1796
1860
|
* @throws {AppwriteException}
|
|
1797
1861
|
* @returns {Promise<Models.Topic>}
|
|
1798
1862
|
*/
|
|
@@ -1800,6 +1864,8 @@ export declare class Messaging {
|
|
|
1800
1864
|
topicId: string;
|
|
1801
1865
|
name: string;
|
|
1802
1866
|
subscribe?: string[];
|
|
1867
|
+
qos?: number;
|
|
1868
|
+
expiry?: number;
|
|
1803
1869
|
}): Promise<Models.Topic>;
|
|
1804
1870
|
/**
|
|
1805
1871
|
* Create a new topic.
|
|
@@ -1807,11 +1873,13 @@ export declare class Messaging {
|
|
|
1807
1873
|
* @param {string} topicId - Topic ID. Choose a custom Topic ID or a new Topic ID.
|
|
1808
1874
|
* @param {string} name - Topic Name.
|
|
1809
1875
|
* @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.
|
|
1876
|
+
* @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.
|
|
1877
|
+
* @param {number} expiry - Message retention in seconds for offline delivery. Max 7 days (604800).
|
|
1810
1878
|
* @throws {AppwriteException}
|
|
1811
1879
|
* @returns {Promise<Models.Topic>}
|
|
1812
1880
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1813
1881
|
*/
|
|
1814
|
-
createTopic(topicId: string, name: string, subscribe?: string[]): Promise<Models.Topic>;
|
|
1882
|
+
createTopic(topicId: string, name: string, subscribe?: string[], qos?: number, expiry?: number): Promise<Models.Topic>;
|
|
1815
1883
|
/**
|
|
1816
1884
|
* Get a topic by its unique ID.
|
|
1817
1885
|
*
|
|
@@ -1840,6 +1908,8 @@ export declare class Messaging {
|
|
|
1840
1908
|
* @param {string} params.topicId - Topic ID.
|
|
1841
1909
|
* @param {string} params.name - Topic Name.
|
|
1842
1910
|
* @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.
|
|
1911
|
+
* @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.
|
|
1912
|
+
* @param {number} params.expiry - Message retention in seconds for offline delivery. Max 7 days (604800).
|
|
1843
1913
|
* @throws {AppwriteException}
|
|
1844
1914
|
* @returns {Promise<Models.Topic>}
|
|
1845
1915
|
*/
|
|
@@ -1847,6 +1917,8 @@ export declare class Messaging {
|
|
|
1847
1917
|
topicId: string;
|
|
1848
1918
|
name?: string;
|
|
1849
1919
|
subscribe?: string[];
|
|
1920
|
+
qos?: number;
|
|
1921
|
+
expiry?: number;
|
|
1850
1922
|
}): Promise<Models.Topic>;
|
|
1851
1923
|
/**
|
|
1852
1924
|
* Update a topic by its unique ID.
|
|
@@ -1855,11 +1927,13 @@ export declare class Messaging {
|
|
|
1855
1927
|
* @param {string} topicId - Topic ID.
|
|
1856
1928
|
* @param {string} name - Topic Name.
|
|
1857
1929
|
* @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.
|
|
1930
|
+
* @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.
|
|
1931
|
+
* @param {number} expiry - Message retention in seconds for offline delivery. Max 7 days (604800).
|
|
1858
1932
|
* @throws {AppwriteException}
|
|
1859
1933
|
* @returns {Promise<Models.Topic>}
|
|
1860
1934
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1861
1935
|
*/
|
|
1862
|
-
updateTopic(topicId: string, name?: string, subscribe?: string[]): Promise<Models.Topic>;
|
|
1936
|
+
updateTopic(topicId: string, name?: string, subscribe?: string[], qos?: number, expiry?: number): Promise<Models.Topic>;
|
|
1863
1937
|
/**
|
|
1864
1938
|
* Delete a topic by its unique ID.
|
|
1865
1939
|
*
|
|
@@ -2,6 +2,7 @@ import { Client } from '../client';
|
|
|
2
2
|
import type { Models } from '../models';
|
|
3
3
|
import { OrganizationKeyScopes } from '../enums/organization-key-scopes';
|
|
4
4
|
import { Region } from '../enums/region';
|
|
5
|
+
import { ProjectKeyScopes } from '../enums/project-key-scopes';
|
|
5
6
|
export declare class Organization {
|
|
6
7
|
client: Client;
|
|
7
8
|
constructor(client: Client);
|
|
@@ -487,4 +488,168 @@ export declare class Organization {
|
|
|
487
488
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
488
489
|
*/
|
|
489
490
|
deleteProject(projectId: string): Promise<{}>;
|
|
491
|
+
/**
|
|
492
|
+
* Get a list of all API keys of a project in your organization.
|
|
493
|
+
*
|
|
494
|
+
* @param {string} params.projectId - Project unique ID.
|
|
495
|
+
* @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
|
|
496
|
+
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
497
|
+
* @throws {AppwriteException}
|
|
498
|
+
* @returns {Promise<Models.KeyList>}
|
|
499
|
+
*/
|
|
500
|
+
listProjectKeys(params: {
|
|
501
|
+
projectId: string;
|
|
502
|
+
queries?: string[];
|
|
503
|
+
total?: boolean;
|
|
504
|
+
}): Promise<Models.KeyList>;
|
|
505
|
+
/**
|
|
506
|
+
* Get a list of all API keys of a project in your organization.
|
|
507
|
+
*
|
|
508
|
+
* @param {string} projectId - Project unique ID.
|
|
509
|
+
* @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
|
|
510
|
+
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
511
|
+
* @throws {AppwriteException}
|
|
512
|
+
* @returns {Promise<Models.KeyList>}
|
|
513
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
514
|
+
*/
|
|
515
|
+
listProjectKeys(projectId: string, queries?: string[], total?: boolean): Promise<Models.KeyList>;
|
|
516
|
+
/**
|
|
517
|
+
* 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.
|
|
518
|
+
*
|
|
519
|
+
* You can also create an ephemeral API key if you need a short-lived key instead.
|
|
520
|
+
*
|
|
521
|
+
* @param {string} params.projectId - Project unique ID.
|
|
522
|
+
* @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.
|
|
523
|
+
* @param {string} params.name - Key name. Max length: 128 chars.
|
|
524
|
+
* @param {ProjectKeyScopes[]} params.scopes - Key scopes list. Maximum of 200 scopes are allowed.
|
|
525
|
+
* @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.
|
|
526
|
+
* @throws {AppwriteException}
|
|
527
|
+
* @returns {Promise<Models.Key>}
|
|
528
|
+
*/
|
|
529
|
+
createProjectKey(params: {
|
|
530
|
+
projectId: string;
|
|
531
|
+
keyId: string;
|
|
532
|
+
name: string;
|
|
533
|
+
scopes: ProjectKeyScopes[];
|
|
534
|
+
expire?: string;
|
|
535
|
+
}): Promise<Models.Key>;
|
|
536
|
+
/**
|
|
537
|
+
* 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.
|
|
538
|
+
*
|
|
539
|
+
* You can also create an ephemeral API key if you need a short-lived key instead.
|
|
540
|
+
*
|
|
541
|
+
* @param {string} projectId - Project unique ID.
|
|
542
|
+
* @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.
|
|
543
|
+
* @param {string} name - Key name. Max length: 128 chars.
|
|
544
|
+
* @param {ProjectKeyScopes[]} scopes - Key scopes list. Maximum of 200 scopes are allowed.
|
|
545
|
+
* @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.
|
|
546
|
+
* @throws {AppwriteException}
|
|
547
|
+
* @returns {Promise<Models.Key>}
|
|
548
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
549
|
+
*/
|
|
550
|
+
createProjectKey(projectId: string, keyId: string, name: string, scopes: ProjectKeyScopes[], expire?: string): Promise<Models.Key>;
|
|
551
|
+
/**
|
|
552
|
+
* Create a new ephemeral 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.
|
|
553
|
+
*
|
|
554
|
+
* You can also create a standard API key if you need a longer-lived key instead.
|
|
555
|
+
*
|
|
556
|
+
* @param {string} params.projectId - Project unique ID.
|
|
557
|
+
* @param {ProjectKeyScopes[]} params.scopes - Key scopes list. Maximum of 200 scopes are allowed.
|
|
558
|
+
* @param {number} params.duration - Time in seconds before ephemeral key expires. Maximum duration is 3600 seconds.
|
|
559
|
+
* @throws {AppwriteException}
|
|
560
|
+
* @returns {Promise<Models.EphemeralKey>}
|
|
561
|
+
*/
|
|
562
|
+
createEphemeralProjectKey(params: {
|
|
563
|
+
projectId: string;
|
|
564
|
+
scopes: ProjectKeyScopes[];
|
|
565
|
+
duration: number;
|
|
566
|
+
}): Promise<Models.EphemeralKey>;
|
|
567
|
+
/**
|
|
568
|
+
* Create a new ephemeral 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.
|
|
569
|
+
*
|
|
570
|
+
* You can also create a standard API key if you need a longer-lived key instead.
|
|
571
|
+
*
|
|
572
|
+
* @param {string} projectId - Project unique ID.
|
|
573
|
+
* @param {ProjectKeyScopes[]} scopes - Key scopes list. Maximum of 200 scopes are allowed.
|
|
574
|
+
* @param {number} duration - Time in seconds before ephemeral key expires. Maximum duration is 3600 seconds.
|
|
575
|
+
* @throws {AppwriteException}
|
|
576
|
+
* @returns {Promise<Models.EphemeralKey>}
|
|
577
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
578
|
+
*/
|
|
579
|
+
createEphemeralProjectKey(projectId: string, scopes: ProjectKeyScopes[], duration: number): Promise<Models.EphemeralKey>;
|
|
580
|
+
/**
|
|
581
|
+
* Get a project key by its unique ID.
|
|
582
|
+
*
|
|
583
|
+
* @param {string} params.projectId - Project unique ID.
|
|
584
|
+
* @param {string} params.keyId - Key ID.
|
|
585
|
+
* @throws {AppwriteException}
|
|
586
|
+
* @returns {Promise<Models.Key>}
|
|
587
|
+
*/
|
|
588
|
+
getProjectKey(params: {
|
|
589
|
+
projectId: string;
|
|
590
|
+
keyId: string;
|
|
591
|
+
}): Promise<Models.Key>;
|
|
592
|
+
/**
|
|
593
|
+
* Get a project key by its unique ID.
|
|
594
|
+
*
|
|
595
|
+
* @param {string} projectId - Project unique ID.
|
|
596
|
+
* @param {string} keyId - Key ID.
|
|
597
|
+
* @throws {AppwriteException}
|
|
598
|
+
* @returns {Promise<Models.Key>}
|
|
599
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
600
|
+
*/
|
|
601
|
+
getProjectKey(projectId: string, keyId: string): Promise<Models.Key>;
|
|
602
|
+
/**
|
|
603
|
+
* Update a project key by its unique ID. Use this endpoint to update the name, scopes, or expiration time of an API key.
|
|
604
|
+
*
|
|
605
|
+
* @param {string} params.projectId - Project unique ID.
|
|
606
|
+
* @param {string} params.keyId - Key ID.
|
|
607
|
+
* @param {string} params.name - Key name. Max length: 128 chars.
|
|
608
|
+
* @param {ProjectKeyScopes[]} params.scopes - Key scopes list. Maximum of 200 scopes are allowed.
|
|
609
|
+
* @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.
|
|
610
|
+
* @throws {AppwriteException}
|
|
611
|
+
* @returns {Promise<Models.Key>}
|
|
612
|
+
*/
|
|
613
|
+
updateProjectKey(params: {
|
|
614
|
+
projectId: string;
|
|
615
|
+
keyId: string;
|
|
616
|
+
name: string;
|
|
617
|
+
scopes: ProjectKeyScopes[];
|
|
618
|
+
expire?: string;
|
|
619
|
+
}): Promise<Models.Key>;
|
|
620
|
+
/**
|
|
621
|
+
* Update a project key by its unique ID. Use this endpoint to update the name, scopes, or expiration time of an API key.
|
|
622
|
+
*
|
|
623
|
+
* @param {string} projectId - Project unique ID.
|
|
624
|
+
* @param {string} keyId - Key ID.
|
|
625
|
+
* @param {string} name - Key name. Max length: 128 chars.
|
|
626
|
+
* @param {ProjectKeyScopes[]} scopes - Key scopes list. Maximum of 200 scopes are allowed.
|
|
627
|
+
* @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.
|
|
628
|
+
* @throws {AppwriteException}
|
|
629
|
+
* @returns {Promise<Models.Key>}
|
|
630
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
631
|
+
*/
|
|
632
|
+
updateProjectKey(projectId: string, keyId: string, name: string, scopes: ProjectKeyScopes[], expire?: string): Promise<Models.Key>;
|
|
633
|
+
/**
|
|
634
|
+
* Delete a project key by its unique ID. Once deleted, the key can no longer be used to authenticate API calls.
|
|
635
|
+
*
|
|
636
|
+
* @param {string} params.projectId - Project unique ID.
|
|
637
|
+
* @param {string} params.keyId - Key ID.
|
|
638
|
+
* @throws {AppwriteException}
|
|
639
|
+
* @returns {Promise<{}>}
|
|
640
|
+
*/
|
|
641
|
+
deleteProjectKey(params: {
|
|
642
|
+
projectId: string;
|
|
643
|
+
keyId: string;
|
|
644
|
+
}): Promise<{}>;
|
|
645
|
+
/**
|
|
646
|
+
* Delete a project key by its unique ID. Once deleted, the key can no longer be used to authenticate API calls.
|
|
647
|
+
*
|
|
648
|
+
* @param {string} projectId - Project unique ID.
|
|
649
|
+
* @param {string} keyId - Key ID.
|
|
650
|
+
* @throws {AppwriteException}
|
|
651
|
+
* @returns {Promise<{}>}
|
|
652
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
653
|
+
*/
|
|
654
|
+
deleteProjectKey(projectId: string, keyId: string): Promise<{}>;
|
|
490
655
|
}
|