Skip to content

Commit b9cbafa

Browse files
committed
Add 1.8.x support
1 parent d552d4d commit b9cbafa

File tree

12 files changed

+62
-56
lines changed

12 files changed

+62
-56
lines changed

src/models.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3034,6 +3034,10 @@ export namespace Models {
30343034
* Function ID.
30353035
*/
30363036
functionId: string;
3037+
/**
3038+
* Function's deployment ID used to create the execution.
3039+
*/
3040+
deploymentId: string;
30373041
/**
30383042
* The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.
30393043
*/

src/services/account.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ export class Account {
195195
* @throws {AppwriteException}
196196
* @returns {Promise<Models.IdentityList>}
197197
*/
198-
listIdentities(params: { queries?: string[] }): Promise<Models.IdentityList>;
198+
listIdentities(params?: { queries?: string[] }): Promise<Models.IdentityList>;
199199
/**
200200
* Get the list of identities for the currently logged in user.
201201
*
@@ -322,7 +322,7 @@ export class Account {
322322
* @throws {AppwriteException}
323323
* @returns {Promise<Models.LogList>}
324324
*/
325-
listLogs(params: { queries?: string[] }): Promise<Models.LogList>;
325+
listLogs(params?: { queries?: string[] }): Promise<Models.LogList>;
326326
/**
327327
* 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.
328328
*
@@ -2123,23 +2123,25 @@ export class Account {
21232123
}
21242124

21252125
/**
2126-
* 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.
2126+
* 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.
21272127
*
21282128
* 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).
2129+
*
21292130
*
2130-
* @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.
2131+
* @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.
21312132
* @param {string} params.email - User email.
21322133
* @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.
21332134
* @throws {AppwriteException}
21342135
* @returns {Promise<Models.Token>}
21352136
*/
21362137
createEmailToken(params: { userId: string, email: string, phrase?: boolean }): Promise<Models.Token>;
21372138
/**
2138-
* 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.
2139+
* 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.
21392140
*
21402141
* 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).
2142+
*
21412143
*
2142-
* @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.
2144+
* @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.
21432145
* @param {string} email - User email.
21442146
* @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.
21452147
* @throws {AppwriteException}
@@ -2205,7 +2207,7 @@ export class Account {
22052207
* 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).
22062208
*
22072209
*
2208-
* @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.
2210+
* @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.
22092211
* @param {string} params.email - User email.
22102212
* @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.
22112213
* @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.
@@ -2219,7 +2221,7 @@ export class Account {
22192221
* 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).
22202222
*
22212223
*
2222-
* @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.
2224+
* @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.
22232225
* @param {string} email - User email.
22242226
* @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.
22252227
* @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.
@@ -2371,7 +2373,7 @@ export class Account {
23712373
*
23722374
* 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).
23732375
*
2374-
* @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.
2376+
* @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.
23752377
* @param {string} params.phone - Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
23762378
* @throws {AppwriteException}
23772379
* @returns {Promise<Models.Token>}
@@ -2382,7 +2384,7 @@ export class Account {
23822384
*
23832385
* 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).
23842386
*
2385-
* @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.
2387+
* @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.
23862388
* @param {string} phone - Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
23872389
* @throws {AppwriteException}
23882390
* @returns {Promise<Models.Token>}

src/services/avatars.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ export class Avatars {
402402
* @throws {AppwriteException}
403403
* @returns {Promise<ArrayBuffer>}
404404
*/
405-
getInitials(params: { name?: string, width?: number, height?: number, background?: string }): Promise<ArrayBuffer>;
405+
getInitials(params?: { name?: string, width?: number, height?: number, background?: string }): Promise<ArrayBuffer>;
406406
/**
407407
* 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.
408408
*

src/services/databases.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export class Databases {
2121
* @returns {Promise<Models.DatabaseList>}
2222
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.list` instead.
2323
*/
24-
list(params: { queries?: string[], search?: string }): Promise<Models.DatabaseList>;
24+
list(params?: { queries?: string[], search?: string }): Promise<Models.DatabaseList>;
2525
/**
2626
* Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.
2727
*

src/services/functions.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export class Functions {
2121
* @throws {AppwriteException}
2222
* @returns {Promise<Models.FunctionList>}
2323
*/
24-
list(params: { queries?: string[], search?: string }): Promise<Models.FunctionList>;
24+
list(params?: { queries?: string[], search?: string }): Promise<Models.FunctionList>;
2525
/**
2626
* Get a list of all the project's functions. You can use the query params to filter your results.
2727
*
@@ -721,7 +721,7 @@ export class Functions {
721721
* @throws {AppwriteException}
722722
* @returns {Promise<Models.Deployment>}
723723
*/
724-
createDeployment(params: { functionId: string, code: File, activate: boolean, entrypoint?: string, commands?: string , onProgress?: (progress: UploadProgress) => {} }): Promise<Models.Deployment>;
724+
createDeployment(params: { functionId: string, code: File, activate: boolean, entrypoint?: string, commands?: string , onProgress?: (progress: UploadProgress) => void }): Promise<Models.Deployment>;
725725
/**
726726
* Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.
727727
*
@@ -738,17 +738,17 @@ export class Functions {
738738
* @returns {Promise<Models.Deployment>}
739739
* @deprecated Use the object parameter style method for a better developer experience.
740740
*/
741-
createDeployment(functionId: string, code: File, activate: boolean, entrypoint?: string, commands?: string, onProgress?: (progress: UploadProgress) => {}): Promise<Models.Deployment>;
741+
createDeployment(functionId: string, code: File, activate: boolean, entrypoint?: string, commands?: string, onProgress?: (progress: UploadProgress) => void): Promise<Models.Deployment>;
742742
createDeployment(
743-
paramsOrFirst: { functionId: string, code: File, activate: boolean, entrypoint?: string, commands?: string, onProgress?: (progress: UploadProgress) => {} } | string,
744-
...rest: [(File)?, (boolean)?, (string)?, (string)?,((progress: UploadProgress) => {})?]
743+
paramsOrFirst: { functionId: string, code: File, activate: boolean, entrypoint?: string, commands?: string, onProgress?: (progress: UploadProgress) => void } | string,
744+
...rest: [(File)?, (boolean)?, (string)?, (string)?,((progress: UploadProgress) => void)?]
745745
): Promise<Models.Deployment> {
746746
let params: { functionId: string, code: File, activate: boolean, entrypoint?: string, commands?: string };
747-
let onProgress: ((progress: UploadProgress) => {});
747+
let onProgress: ((progress: UploadProgress) => void);
748748

749749
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
750750
params = (paramsOrFirst || {}) as { functionId: string, code: File, activate: boolean, entrypoint?: string, commands?: string };
751-
onProgress = paramsOrFirst?.onProgress as ((progress: UploadProgress) => {});
751+
onProgress = paramsOrFirst?.onProgress as ((progress: UploadProgress) => void);
752752
} else {
753753
params = {
754754
functionId: paramsOrFirst as string,
@@ -757,7 +757,7 @@ export class Functions {
757757
entrypoint: rest[2] as string,
758758
commands: rest[3] as string
759759
};
760-
onProgress = rest[4] as ((progress: UploadProgress) => {});
760+
onProgress = rest[4] as ((progress: UploadProgress) => void);
761761
}
762762

763763
const functionId = params.functionId;

0 commit comments

Comments
 (0)