Skip to content

Commit ca828b9

Browse files
committed
Add 1.8.x support
1 parent 56bb039 commit ca828b9

File tree

10 files changed

+111
-105
lines changed

10 files changed

+111
-105
lines changed

src/models.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,6 +1001,10 @@ export namespace Models {
10011001
* Function ID.
10021002
*/
10031003
functionId: string;
1004+
/**
1005+
* Function's deployment ID used to create the execution.
1006+
*/
1007+
deploymentId: string;
10041008
/**
10051009
* The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.
10061010
*/

src/services/account.ts

Lines changed: 50 additions & 48 deletions
Large diffs are not rendered by default.

src/services/avatars.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export class Avatars extends Service {
2828
* @throws {AppwriteException}
2929
* @returns {ArrayBuffer}
3030
*/
31-
getBrowser(params: { code: Browser, width?: number, height?: number, quality?: number }): Promise<ArrayBuffer>;
31+
getBrowser(params?: { code: Browser, width?: number, height?: number, quality?: number }): Promise<ArrayBuffer>;
3232
/**
3333
* You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET /account/sessions](https://appwrite.io/docs/references/cloud/client-web/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.
3434
*
@@ -108,7 +108,7 @@ export class Avatars extends Service {
108108
* @throws {AppwriteException}
109109
* @returns {ArrayBuffer}
110110
*/
111-
getCreditCard(params: { code: CreditCard, width?: number, height?: number, quality?: number }): Promise<ArrayBuffer>;
111+
getCreditCard(params?: { code: CreditCard, width?: number, height?: number, quality?: number }): Promise<ArrayBuffer>;
112112
/**
113113
* The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.
114114
*
@@ -185,7 +185,7 @@ export class Avatars extends Service {
185185
* @throws {AppwriteException}
186186
* @returns {ArrayBuffer}
187187
*/
188-
getFavicon(params: { url: string }): Promise<ArrayBuffer>;
188+
getFavicon(params?: { url: string }): Promise<ArrayBuffer>;
189189
/**
190190
* Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.
191191
*
@@ -247,7 +247,7 @@ export class Avatars extends Service {
247247
* @throws {AppwriteException}
248248
* @returns {ArrayBuffer}
249249
*/
250-
getFlag(params: { code: Flag, width?: number, height?: number, quality?: number }): Promise<ArrayBuffer>;
250+
getFlag(params?: { code: Flag, width?: number, height?: number, quality?: number }): Promise<ArrayBuffer>;
251251
/**
252252
* You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard.
253253
*
@@ -328,7 +328,7 @@ export class Avatars extends Service {
328328
* @throws {AppwriteException}
329329
* @returns {ArrayBuffer}
330330
*/
331-
getImage(params: { url: string, width?: number, height?: number }): Promise<ArrayBuffer>;
331+
getImage(params?: { url: string, width?: number, height?: number }): Promise<ArrayBuffer>;
332332
/**
333333
* Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.
334334
*
@@ -409,7 +409,7 @@ export class Avatars extends Service {
409409
* @throws {AppwriteException}
410410
* @returns {ArrayBuffer}
411411
*/
412-
getInitials(params: { name?: string, width?: number, height?: number, background?: string }): Promise<ArrayBuffer>;
412+
getInitials(params?: { name?: string, width?: number, height?: number, background?: string }): Promise<ArrayBuffer>;
413413
/**
414414
* 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.
415415
*
@@ -490,7 +490,7 @@ export class Avatars extends Service {
490490
* @throws {AppwriteException}
491491
* @returns {ArrayBuffer}
492492
*/
493-
getQR(params: { text: string, size?: number, margin?: number, download?: boolean }): Promise<ArrayBuffer>;
493+
getQR(params?: { text: string, size?: number, margin?: number, download?: boolean }): Promise<ArrayBuffer>;
494494
/**
495495
* Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.
496496
*

src/services/databases.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export class Databases extends Service {
2323
* @returns {Promise}
2424
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.listRows` instead.
2525
*/
26-
listDocuments<Document extends Models.Document = Models.DefaultDocument>(params: { databaseId: string, collectionId: string, queries?: string[] }): Promise<Models.DocumentList<Document>>;
26+
listDocuments<Document extends Models.Document = Models.DefaultDocument>(params?: { databaseId: string, collectionId: string, queries?: string[] }): Promise<Models.DocumentList<Document>>;
2727
/**
2828
* Get a list of all the user's documents in a given collection. You can use the query params to filter your results.
2929
*
@@ -87,7 +87,7 @@ export class Databases extends Service {
8787
* @returns {Promise}
8888
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createRow` instead.
8989
*/
90-
createDocument<Document extends Models.Document = Models.DefaultDocument>(params: { databaseId: string, collectionId: string, documentId: string, data: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Omit<Document, keyof Models.Document>, permissions?: string[] }): Promise<Document>;
90+
createDocument<Document extends Models.Document = Models.DefaultDocument>(params?: { databaseId: string, collectionId: string, documentId: string, data: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Omit<Document, keyof Models.Document>, permissions?: string[] }): Promise<Document>;
9191
/**
9292
* Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console.
9393
*
@@ -176,7 +176,7 @@ export class Databases extends Service {
176176
* @returns {Promise}
177177
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.getRow` instead.
178178
*/
179-
getDocument<Document extends Models.Document = Models.DefaultDocument>(params: { databaseId: string, collectionId: string, documentId: string, queries?: string[] }): Promise<Document>;
179+
getDocument<Document extends Models.Document = Models.DefaultDocument>(params?: { databaseId: string, collectionId: string, documentId: string, queries?: string[] }): Promise<Document>;
180180
/**
181181
* Get a document by its unique ID. This endpoint response returns a JSON object with the document data.
182182
*
@@ -247,7 +247,7 @@ export class Databases extends Service {
247247
* @returns {Promise}
248248
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.upsertRow` instead.
249249
*/
250-
upsertDocument<Document extends Models.Document = Models.DefaultDocument>(params: { databaseId: string, collectionId: string, documentId: string, data: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>, permissions?: string[] }): Promise<Document>;
250+
upsertDocument<Document extends Models.Document = Models.DefaultDocument>(params?: { databaseId: string, collectionId: string, documentId: string, data: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>, permissions?: string[] }): Promise<Document>;
251251
/**
252252
* Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console.
253253
*
@@ -333,7 +333,7 @@ export class Databases extends Service {
333333
* @returns {Promise}
334334
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateRow` instead.
335335
*/
336-
updateDocument<Document extends Models.Document = Models.DefaultDocument>(params: { databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>, permissions?: string[] }): Promise<Document>;
336+
updateDocument<Document extends Models.Document = Models.DefaultDocument>(params?: { databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>, permissions?: string[] }): Promise<Document>;
337337
/**
338338
* Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.
339339
*
@@ -413,7 +413,7 @@ export class Databases extends Service {
413413
* @returns {Promise}
414414
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.deleteRow` instead.
415415
*/
416-
deleteDocument(params: { databaseId: string, collectionId: string, documentId: string }): Promise<{}>;
416+
deleteDocument(params?: { databaseId: string, collectionId: string, documentId: string }): Promise<{}>;
417417
/**
418418
* Delete a document by its unique ID.
419419
*
@@ -479,7 +479,7 @@ export class Databases extends Service {
479479
* @returns {Promise}
480480
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.decrementRowColumn` instead.
481481
*/
482-
decrementDocumentAttribute<Document extends Models.Document = Models.DefaultDocument>(params: { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, min?: number }): Promise<Document>;
482+
decrementDocumentAttribute<Document extends Models.Document = Models.DefaultDocument>(params?: { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, min?: number }): Promise<Document>;
483483
/**
484484
* Decrement a specific attribute of a document by a given value.
485485
*
@@ -566,7 +566,7 @@ export class Databases extends Service {
566566
* @returns {Promise}
567567
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.incrementRowColumn` instead.
568568
*/
569-
incrementDocumentAttribute<Document extends Models.Document = Models.DefaultDocument>(params: { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, max?: number }): Promise<Document>;
569+
incrementDocumentAttribute<Document extends Models.Document = Models.DefaultDocument>(params?: { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, max?: number }): Promise<Document>;
570570
/**
571571
* Increment a specific attribute of a document by a given value.
572572
*

src/services/functions.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export class Functions extends Service {
2222
* @throws {AppwriteException}
2323
* @returns {Promise}
2424
*/
25-
listExecutions(params: { functionId: string, queries?: string[] }): Promise<Models.ExecutionList>;
25+
listExecutions(params?: { functionId: string, queries?: string[] }): Promise<Models.ExecutionList>;
2626
/**
2727
* Get a list of all the current user function execution logs. You can use the query params to filter your results.
2828
*
@@ -80,7 +80,7 @@ export class Functions extends Service {
8080
* @throws {AppwriteException}
8181
* @returns {Promise}
8282
*/
83-
createExecution(params: { functionId: string, body?: string, async?: boolean, xpath?: string, method?: ExecutionMethod, headers?: object, scheduledAt?: string }): Promise<Models.Execution>;
83+
createExecution(params?: { functionId: string, body?: string, async?: boolean, xpath?: string, method?: ExecutionMethod, headers?: object, scheduledAt?: string }): Promise<Models.Execution>;
8484
/**
8585
* Trigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.
8686
*
@@ -169,7 +169,7 @@ export class Functions extends Service {
169169
* @throws {AppwriteException}
170170
* @returns {Promise}
171171
*/
172-
getExecution(params: { functionId: string, executionId: string }): Promise<Models.Execution>;
172+
getExecution(params?: { functionId: string, executionId: string }): Promise<Models.Execution>;
173173
/**
174174
* Get a function execution log by its unique ID.
175175
*

src/services/graphql.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export class Graphql extends Service {
2020
* @throws {AppwriteException}
2121
* @returns {Promise}
2222
*/
23-
query(params: { query: object }): Promise<{}>;
23+
query(params?: { query: object }): Promise<{}>;
2424
/**
2525
* Execute a GraphQL mutation.
2626
*
@@ -70,7 +70,7 @@ export class Graphql extends Service {
7070
* @throws {AppwriteException}
7171
* @returns {Promise}
7272
*/
73-
mutation(params: { query: object }): Promise<{}>;
73+
mutation(params?: { query: object }): Promise<{}>;
7474
/**
7575
* Execute a GraphQL mutation.
7676
*

src/services/messaging.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export class Messaging extends Service {
2222
* @throws {AppwriteException}
2323
* @returns {Promise}
2424
*/
25-
createSubscriber(params: { topicId: string, subscriberId: string, targetId: string }): Promise<Models.Subscriber>;
25+
createSubscriber(params?: { topicId: string, subscriberId: string, targetId: string }): Promise<Models.Subscriber>;
2626
/**
2727
* Create a new subscriber.
2828
*
@@ -91,7 +91,7 @@ export class Messaging extends Service {
9191
* @throws {AppwriteException}
9292
* @returns {Promise}
9393
*/
94-
deleteSubscriber(params: { topicId: string, subscriberId: string }): Promise<{}>;
94+
deleteSubscriber(params?: { topicId: string, subscriberId: string }): Promise<{}>;
9595
/**
9696
* Delete a subscriber by its unique ID.
9797
*

0 commit comments

Comments
 (0)