Skip to content

Commit 4636f9c

Browse files
committed
Add time between queries
1 parent 643454b commit 4636f9c

File tree

10 files changed

+36
-24
lines changed

10 files changed

+36
-24
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "react-native-appwrite",
33
"homepage": "https://appwrite.io/support",
44
"description": "Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API",
5-
"version": "0.12.0",
5+
"version": "0.13.0",
66
"license": "BSD-3-Clause",
77
"main": "dist/cjs/sdk.js",
88
"exports": {

src/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class Client {
115115
'x-sdk-name': 'React Native',
116116
'x-sdk-platform': 'client',
117117
'x-sdk-language': 'reactnative',
118-
'x-sdk-version': '0.12.0',
118+
'x-sdk-version': '0.13.0',
119119
'X-Appwrite-Response-Format': '1.8.0',
120120
};
121121

src/enums/credit-card.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export enum CreditCard {
1111
Mastercard = 'mastercard',
1212
Naranja = 'naranja',
1313
TarjetaShopping = 'targeta-shopping',
14-
UnionChinaPay = 'union-china-pay',
14+
UnionPay = 'unionpay',
1515
Visa = 'visa',
1616
MIR = 'mir',
1717
Maestro = 'maestro',

src/enums/execution-method.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ export enum ExecutionMethod {
55
PATCH = 'PATCH',
66
DELETE = 'DELETE',
77
OPTIONS = 'OPTIONS',
8+
HEAD = 'HEAD',
89
}

src/models.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -223,15 +223,15 @@ export namespace Models {
223223
/**
224224
* Row automatically incrementing ID.
225225
*/
226-
$sequence: number;
226+
readonly $sequence: number;
227227
/**
228228
* Table ID.
229229
*/
230-
$tableId: string;
230+
readonly $tableId: string;
231231
/**
232232
* Database ID.
233233
*/
234-
$databaseId: string;
234+
readonly $databaseId: string;
235235
/**
236236
* Row creation date in ISO 8601 format.
237237
*/
@@ -262,15 +262,15 @@ export namespace Models {
262262
/**
263263
* Document automatically incrementing ID.
264264
*/
265-
$sequence: number;
265+
readonly $sequence: number;
266266
/**
267267
* Collection ID.
268268
*/
269-
$collectionId: string;
269+
readonly $collectionId: string;
270270
/**
271271
* Database ID.
272272
*/
273-
$databaseId: string;
273+
readonly $databaseId: string;
274274
/**
275275
* Document creation date in ISO 8601 format.
276276
*/

src/query.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,16 @@ export class Query {
170170
static createdAfter = (value: string): string =>
171171
new Query("createdAfter", undefined, value).toString();
172172

173+
/**
174+
* Filter resources where document was created between dates.
175+
*
176+
* @param {string} start
177+
* @param {string} end
178+
* @returns {string}
179+
*/
180+
static createdBetween = (start: string, end: string): string =>
181+
new Query("createdBetween", undefined, [start, end] as QueryTypesList).toString();
182+
173183
/**
174184
* Filter resources where document was updated before date.
175185
*
@@ -188,6 +198,16 @@ export class Query {
188198
static updatedAfter = (value: string): string =>
189199
new Query("updatedAfter", undefined, value).toString();
190200

201+
/**
202+
* Filter resources where document was updated between dates.
203+
*
204+
* @param {string} start
205+
* @param {string} end
206+
* @returns {string}
207+
*/
208+
static updatedBetween = (start: string, end: string): string =>
209+
new Query("updatedBetween", undefined, [start, end] as QueryTypesList).toString();
210+
191211
static or = (queries: string[]) =>
192212
new Query("or", undefined, queries.map((query) => JSON.parse(query))).toString();
193213

src/services/account.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1521,7 +1521,7 @@ export class Account extends Service {
15211521
* @param {string} params.secret - Valid verification token.
15221522
* @throws {AppwriteException}
15231523
* @returns {Promise}
1524-
* @deprecated This API has been deprecated.
1524+
* @deprecated This API has been deprecated since 1.6.0. Please use `Account.createSession` instead.
15251525
*/
15261526
updateMagicURLSession(params: { userId: string, secret: string }): Promise<Models.Session>;
15271527
/**
@@ -1668,7 +1668,7 @@ export class Account extends Service {
16681668
* @param {string} params.secret - Valid verification token.
16691669
* @throws {AppwriteException}
16701670
* @returns {Promise}
1671-
* @deprecated This API has been deprecated.
1671+
* @deprecated This API has been deprecated since 1.6.0. Please use `Account.createSession` instead.
16721672
*/
16731673
updatePhoneSession(params: { userId: string, secret: string }): Promise<Models.Session>;
16741674
/**

src/services/avatars.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export class Avatars extends Service {
101101
* When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
102102
*
103103
*
104-
* @param {CreditCard} params.code - Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro, rupay.
104+
* @param {CreditCard} params.code - Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, unionpay, visa, mir, maestro, rupay.
105105
* @param {number} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100.
106106
* @param {number} params.height - Image height. Pass an integer between 0 to 2000. Defaults to 100.
107107
* @param {number} params.quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
@@ -115,7 +115,7 @@ export class Avatars extends Service {
115115
* When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
116116
*
117117
*
118-
* @param {CreditCard} code - Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro, rupay.
118+
* @param {CreditCard} code - Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, unionpay, visa, mir, maestro, rupay.
119119
* @param {number} width - Image width. Pass an integer between 0 to 2000. Defaults to 100.
120120
* @param {number} height - Image height. Pass an integer between 0 to 2000. Defaults to 100.
121121
* @param {number} quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.

src/services/databases.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,6 @@ export class Databases extends Service {
141141
throw new AppwriteException('Missing required parameter: "data"');
142142
}
143143

144-
delete data?.$sequence;
145-
delete data?.$collectionId;
146-
delete data?.$databaseId;
147144
const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
148145
const payload: Payload = {};
149146

@@ -301,9 +298,6 @@ export class Databases extends Service {
301298
throw new AppwriteException('Missing required parameter: "data"');
302299
}
303300

304-
delete data?.$sequence;
305-
delete data?.$collectionId;
306-
delete data?.$databaseId;
307301
const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId);
308302
const payload: Payload = {};
309303

@@ -383,9 +377,6 @@ export class Databases extends Service {
383377
throw new AppwriteException('Missing required parameter: "documentId"');
384378
}
385379

386-
delete data?.$sequence;
387-
delete data?.$collectionId;
388-
delete data?.$databaseId;
389380
const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId);
390381
const payload: Payload = {};
391382

src/services/functions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export class Functions extends Service {
7474
* @param {string} params.body - HTTP body of execution. Default value is empty string.
7575
* @param {boolean} params.async - Execute code in the background. Default value is false.
7676
* @param {string} params.xpath - HTTP path of execution. Path can include query params. Default value is /
77-
* @param {ExecutionMethod} params.method - HTTP method of execution. Default value is GET.
77+
* @param {ExecutionMethod} params.method - HTTP method of execution. Default value is POST.
7878
* @param {object} params.headers - HTTP headers of execution. Defaults to empty.
7979
* @param {string} params.scheduledAt - Scheduled execution time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.
8080
* @throws {AppwriteException}
@@ -88,7 +88,7 @@ export class Functions extends Service {
8888
* @param {string} body - HTTP body of execution. Default value is empty string.
8989
* @param {boolean} async - Execute code in the background. Default value is false.
9090
* @param {string} xpath - HTTP path of execution. Path can include query params. Default value is /
91-
* @param {ExecutionMethod} method - HTTP method of execution. Default value is GET.
91+
* @param {ExecutionMethod} method - HTTP method of execution. Default value is POST.
9292
* @param {object} headers - HTTP headers of execution. Defaults to empty.
9393
* @param {string} scheduledAt - Scheduled execution time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.
9494
* @throws {AppwriteException}

0 commit comments

Comments
 (0)