Skip to content

Commit 5d1cea7

Browse files
committed
Add time between queries
1 parent 9efde82 commit 5d1cea7

File tree

11 files changed

+37
-25
lines changed

11 files changed

+37
-25
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import { Client, Account } from "appwrite";
3333
To install with a CDN (content delivery network) add the following scripts to the bottom of your <body> tag, but before you use any Appwrite services:
3434

3535
```html
36-
<script src="https://cdn.jsdelivr.net/npm/appwrite@19.0.0"></script>
36+
<script src="https://cdn.jsdelivr.net/npm/appwrite@19.1.0"></script>
3737
```
3838

3939

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "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": "19.0.0",
5+
"version": "19.1.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
@@ -316,7 +316,7 @@ class Client {
316316
'x-sdk-name': 'Web',
317317
'x-sdk-platform': 'client',
318318
'x-sdk-language': 'web',
319-
'x-sdk-version': '19.0.0',
319+
'x-sdk-version': '19.1.0',
320320
'X-Appwrite-Response-Format': '1.8.0',
321321
};
322322

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
@@ -226,15 +226,15 @@ export namespace Models {
226226
/**
227227
* Row automatically incrementing ID.
228228
*/
229-
$sequence: number;
229+
readonly $sequence: number;
230230
/**
231231
* Table ID.
232232
*/
233-
$tableId: string;
233+
readonly $tableId: string;
234234
/**
235235
* Database ID.
236236
*/
237-
$databaseId: string;
237+
readonly $databaseId: string;
238238
/**
239239
* Row creation date in ISO 8601 format.
240240
*/
@@ -265,15 +265,15 @@ export namespace Models {
265265
/**
266266
* Document automatically incrementing ID.
267267
*/
268-
$sequence: number;
268+
readonly $sequence: number;
269269
/**
270270
* Collection ID.
271271
*/
272-
$collectionId: string;
272+
readonly $collectionId: string;
273273
/**
274274
* Database ID.
275275
*/
276-
$databaseId: string;
276+
readonly $databaseId: string;
277277
/**
278278
* Document creation date in ISO 8601 format.
279279
*/

src/query.ts

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

314+
/**
315+
* Filter resources where document was created between dates.
316+
*
317+
* @param {string} start
318+
* @param {string} end
319+
* @returns {string}
320+
*/
321+
static createdBetween = (start: string, end: string): string =>
322+
new Query("createdBetween", undefined, [start, end] as QueryTypesList).toString();
323+
314324
/**
315325
* Filter resources where document was updated before date.
316326
*
@@ -329,6 +339,16 @@ export class Query {
329339
static updatedAfter = (value: string): string =>
330340
new Query("updatedAfter", undefined, value).toString();
331341

342+
/**
343+
* Filter resources where document was updated between dates.
344+
*
345+
* @param {string} start
346+
* @param {string} end
347+
* @returns {string}
348+
*/
349+
static updatedBetween = (start: string, end: string): string =>
350+
new Query("updatedBetween", undefined, [start, end] as QueryTypesList).toString();
351+
332352
/**
333353
* Combine multiple queries using logical OR operator.
334354
*

src/services/account.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1751,7 +1751,7 @@ export class Account {
17511751
* @param {string} params.secret - Valid verification token.
17521752
* @throws {AppwriteException}
17531753
* @returns {Promise<Models.Session>}
1754-
* @deprecated This API has been deprecated.
1754+
* @deprecated This API has been deprecated since 1.6.0. Please use `Account.createSession` instead.
17551755
*/
17561756
updateMagicURLSession(params: { userId: string, secret: string }): Promise<Models.Session>;
17571757
/**
@@ -1907,7 +1907,7 @@ export class Account {
19071907
* @param {string} params.secret - Valid verification token.
19081908
* @throws {AppwriteException}
19091909
* @returns {Promise<Models.Session>}
1910-
* @deprecated This API has been deprecated.
1910+
* @deprecated This API has been deprecated since 1.6.0. Please use `Account.createSession` instead.
19111911
*/
19121912
updatePhoneSession(params: { userId: string, secret: string }): Promise<Models.Session>;
19131913
/**

src/services/avatars.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export class Avatars {
9797
* 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.
9898
*
9999
*
100-
* @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.
100+
* @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.
101101
* @param {number} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100.
102102
* @param {number} params.height - Image height. Pass an integer between 0 to 2000. Defaults to 100.
103103
* @param {number} params.quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
@@ -111,7 +111,7 @@ export class Avatars {
111111
* 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.
112112
*
113113
*
114-
* @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.
114+
* @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.
115115
* @param {number} width - Image width. Pass an integer between 0 to 2000. Defaults to 100.
116116
* @param {number} height - Image height. Pass an integer between 0 to 2000. Defaults to 100.
117117
* @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
@@ -139,9 +139,6 @@ export class Databases {
139139
if (typeof data === 'undefined') {
140140
throw new AppwriteException('Missing required parameter: "data"');
141141
}
142-
delete data?.$sequence;
143-
delete data?.$collectionId;
144-
delete data?.$databaseId;
145142

146143
const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
147144
const payload: Payload = {};
@@ -304,9 +301,6 @@ export class Databases {
304301
if (typeof data === 'undefined') {
305302
throw new AppwriteException('Missing required parameter: "data"');
306303
}
307-
delete data?.$sequence;
308-
delete data?.$collectionId;
309-
delete data?.$databaseId;
310304

311305
const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId);
312306
const payload: Payload = {};
@@ -389,9 +383,6 @@ export class Databases {
389383
if (typeof documentId === 'undefined') {
390384
throw new AppwriteException('Missing required parameter: "documentId"');
391385
}
392-
delete data?.$sequence;
393-
delete data?.$collectionId;
394-
delete data?.$databaseId;
395386

396387
const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId);
397388
const payload: Payload = {};

0 commit comments

Comments
 (0)