Skip to content

Commit ac734b7

Browse files
committed
Add 1.8.x support
1 parent fd8fcb8 commit ac734b7

File tree

5 files changed

+25
-19
lines changed

5 files changed

+25
-19
lines changed

src/models.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,6 +1004,10 @@ export namespace Models {
10041004
* Function ID.
10051005
*/
10061006
functionId: string;
1007+
/**
1008+
* Function's deployment ID used to create the execution.
1009+
*/
1010+
deploymentId: string;
10071011
/**
10081012
* The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.
10091013
*/

src/services/account.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ export class Account {
196196
* @throws {AppwriteException}
197197
* @returns {Promise<Models.IdentityList>}
198198
*/
199-
listIdentities(params: { queries?: string[] }): Promise<Models.IdentityList>;
199+
listIdentities(params?: { queries?: string[] }): Promise<Models.IdentityList>;
200200
/**
201201
* Get the list of identities for the currently logged in user.
202202
*
@@ -323,7 +323,7 @@ export class Account {
323323
* @throws {AppwriteException}
324324
* @returns {Promise<Models.LogList>}
325325
*/
326-
listLogs(params: { queries?: string[] }): Promise<Models.LogList>;
326+
listLogs(params?: { queries?: string[] }): Promise<Models.LogList>;
327327
/**
328328
* 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.
329329
*
@@ -2401,23 +2401,25 @@ export class Account {
24012401
}
24022402

24032403
/**
2404-
* Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.
2404+
* Sends the user an email with a secret key for creating a session. If the email address has never been used, a **new account is created** using the provided `userId`. Otherwise, if the email address is already attached to an account, the **user ID is ignored**. Then, the user will receive an email with the one-time password. Use the returned user ID and secret and submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.
24052405
*
24062406
* 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).
2407+
*
24072408
*
2408-
* @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.
2409+
* @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. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.
24092410
* @param {string} params.email - User email.
24102411
* @param {boolean} params.phrase - Toggle for security phrase. If enabled, email will be send 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.
24112412
* @throws {AppwriteException}
24122413
* @returns {Promise<Models.Token>}
24132414
*/
24142415
createEmailToken(params: { userId: string, email: string, phrase?: boolean }): Promise<Models.Token>;
24152416
/**
2416-
* Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.
2417+
* Sends the user an email with a secret key for creating a session. If the email address has never been used, a **new account is created** using the provided `userId`. Otherwise, if the email address is already attached to an account, the **user ID is ignored**. Then, the user will receive an email with the one-time password. Use the returned user ID and secret and submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.
24172418
*
24182419
* 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).
2420+
*
24192421
*
2420-
* @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.
2422+
* @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. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.
24212423
* @param {string} email - User email.
24222424
* @param {boolean} phrase - Toggle for security phrase. If enabled, email will be send 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.
24232425
* @throws {AppwriteException}
@@ -2483,7 +2485,7 @@ export class Account {
24832485
* 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).
24842486
*
24852487
*
2486-
* @param {string} params.userId - 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.
2488+
* @param {string} params.userId - 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. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.
24872489
* @param {string} params.email - User email.
24882490
* @param {string} params.url - URL to redirect the user back to your app from the magic URL login. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
24892491
* @param {boolean} params.phrase - Toggle for security phrase. If enabled, email will be send 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.
@@ -2497,7 +2499,7 @@ export class Account {
24972499
* 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).
24982500
*
24992501
*
2500-
* @param {string} userId - 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.
2502+
* @param {string} userId - 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. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.
25012503
* @param {string} email - User email.
25022504
* @param {string} url - URL to redirect the user back to your app from the magic URL login. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
25032505
* @param {boolean} phrase - Toggle for security phrase. If enabled, email will be send 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.
@@ -2655,7 +2657,7 @@ export class Account {
26552657
*
26562658
* 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).
26572659
*
2658-
* @param {string} params.userId - 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.
2660+
* @param {string} params.userId - 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. If the phone number has never been used, a new account is created using the provided userId. Otherwise, if the phone number is already attached to an account, the user ID is ignored.
26592661
* @param {string} params.phone - Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
26602662
* @throws {AppwriteException}
26612663
* @returns {Promise<Models.Token>}
@@ -2666,7 +2668,7 @@ export class Account {
26662668
*
26672669
* 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).
26682670
*
2669-
* @param {string} userId - 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.
2671+
* @param {string} userId - 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. If the phone number has never been used, a new account is created using the provided userId. Otherwise, if the phone number is already attached to an account, the user ID is ignored.
26702672
* @param {string} phone - Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
26712673
* @throws {AppwriteException}
26722674
* @returns {Promise<Models.Token>}

src/services/avatars.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ export class Avatars {
403403
* @throws {AppwriteException}
404404
* @returns {string}
405405
*/
406-
getInitials(params: { name?: string, width?: number, height?: number, background?: string }): string;
406+
getInitials(params?: { name?: string, width?: number, height?: number, background?: string }): string;
407407
/**
408408
* Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.
409409
*

src/services/storage.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export class Storage {
9595
* @throws {AppwriteException}
9696
* @returns {Promise<Models.File>}
9797
*/
98-
createFile(params: { bucketId: string, fileId: string, file: File, permissions?: string[] , onProgress?: (progress: UploadProgress) => {} }): Promise<Models.File>;
98+
createFile(params: { bucketId: string, fileId: string, file: File, permissions?: string[] , onProgress?: (progress: UploadProgress) => void }): Promise<Models.File>;
9999
/**
100100
* Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https://appwrite.io/docs/server/storage#storageCreateBucket) API or directly from your Appwrite console.
101101
*
@@ -114,25 +114,25 @@ export class Storage {
114114
* @returns {Promise<Models.File>}
115115
* @deprecated Use the object parameter style method for a better developer experience.
116116
*/
117-
createFile(bucketId: string, fileId: string, file: File, permissions?: string[], onProgress?: (progress: UploadProgress) => {}): Promise<Models.File>;
117+
createFile(bucketId: string, fileId: string, file: File, permissions?: string[], onProgress?: (progress: UploadProgress) => void): Promise<Models.File>;
118118
createFile(
119-
paramsOrFirst: { bucketId: string, fileId: string, file: File, permissions?: string[], onProgress?: (progress: UploadProgress) => {} } | string,
120-
...rest: [(string)?, (File)?, (string[])?,((progress: UploadProgress) => {})?]
119+
paramsOrFirst: { bucketId: string, fileId: string, file: File, permissions?: string[], onProgress?: (progress: UploadProgress) => void } | string,
120+
...rest: [(string)?, (File)?, (string[])?,((progress: UploadProgress) => void)?]
121121
): Promise<Models.File> {
122122
let params: { bucketId: string, fileId: string, file: File, permissions?: string[] };
123-
let onProgress: ((progress: UploadProgress) => {});
123+
let onProgress: ((progress: UploadProgress) => void);
124124

125125
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
126126
params = (paramsOrFirst || {}) as { bucketId: string, fileId: string, file: File, permissions?: string[] };
127-
onProgress = paramsOrFirst?.onProgress as ((progress: UploadProgress) => {});
127+
onProgress = paramsOrFirst?.onProgress as ((progress: UploadProgress) => void);
128128
} else {
129129
params = {
130130
bucketId: paramsOrFirst as string,
131131
fileId: rest[0] as string,
132132
file: rest[1] as File,
133133
permissions: rest[2] as string[]
134134
};
135-
onProgress = rest[3] as ((progress: UploadProgress) => {});
135+
onProgress = rest[3] as ((progress: UploadProgress) => void);
136136
}
137137

138138
const bucketId = params.bucketId;

src/services/teams.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export class Teams {
1818
* @throws {AppwriteException}
1919
* @returns {Promise<Models.TeamList<Preferences>>}
2020
*/
21-
list<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: { queries?: string[], search?: string }): Promise<Models.TeamList<Preferences>>;
21+
list<Preferences extends Models.Preferences = Models.DefaultPreferences>(params?: { queries?: string[], search?: string }): Promise<Models.TeamList<Preferences>>;
2222
/**
2323
* Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.
2424
*

0 commit comments

Comments
 (0)