react-native-appwrite 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/autoclose.yml +11 -0
- package/LICENSE +1 -1
- package/README.md +1 -1
- package/dist/cjs/sdk.js +23 -11
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +23 -11
- package/dist/esm/sdk.js.map +1 -1
- package/package.json +1 -1
- package/src/client.ts +5 -3
- package/src/enums/image-format.ts +1 -0
- package/src/services/account.ts +15 -4
- package/src/services/storage.ts +4 -6
- package/types/enums/image-format.d.ts +1 -0
- package/types/services/account.d.ts +15 -4
package/dist/esm/sdk.js
CHANGED
|
@@ -77,7 +77,7 @@ class Client {
|
|
|
77
77
|
'x-sdk-name': 'React Native',
|
|
78
78
|
'x-sdk-platform': 'client',
|
|
79
79
|
'x-sdk-language': 'reactnative',
|
|
80
|
-
'x-sdk-version': '0.
|
|
80
|
+
'x-sdk-version': '0.7.0',
|
|
81
81
|
'X-Appwrite-Response-Format': '1.6.0',
|
|
82
82
|
};
|
|
83
83
|
this.realtime = {
|
|
@@ -191,6 +191,8 @@ class Client {
|
|
|
191
191
|
});
|
|
192
192
|
}
|
|
193
193
|
break;
|
|
194
|
+
case 'pong':
|
|
195
|
+
break; // Handle pong response if needed
|
|
194
196
|
case 'error':
|
|
195
197
|
throw message.data;
|
|
196
198
|
default:
|
|
@@ -1436,6 +1438,11 @@ class Account extends Service {
|
|
|
1436
1438
|
/**
|
|
1437
1439
|
* Create push target
|
|
1438
1440
|
*
|
|
1441
|
+
* Use this endpoint to register a device for push notifications. Provide a
|
|
1442
|
+
* target ID (custom or generated using ID.unique()), a device identifier
|
|
1443
|
+
* (usually a device token), and optionally specify which provider should send
|
|
1444
|
+
* notifications to this target. The target is automatically linked to the
|
|
1445
|
+
* current session and includes device information like brand and model.
|
|
1439
1446
|
*
|
|
1440
1447
|
* @param {string} targetId
|
|
1441
1448
|
* @param {string} identifier
|
|
@@ -1471,6 +1478,11 @@ class Account extends Service {
|
|
|
1471
1478
|
/**
|
|
1472
1479
|
* Update push target
|
|
1473
1480
|
*
|
|
1481
|
+
* Update the currently logged in user's push notification target. You can
|
|
1482
|
+
* modify the target's identifier (device token) and provider ID (token,
|
|
1483
|
+
* email, phone etc.). The target must exist and belong to the current user.
|
|
1484
|
+
* If you change the provider ID, notifications will be sent through the new
|
|
1485
|
+
* messaging provider instead.
|
|
1474
1486
|
*
|
|
1475
1487
|
* @param {string} targetId
|
|
1476
1488
|
* @param {string} identifier
|
|
@@ -1499,6 +1511,9 @@ class Account extends Service {
|
|
|
1499
1511
|
/**
|
|
1500
1512
|
* Delete push target
|
|
1501
1513
|
*
|
|
1514
|
+
* Delete a push notification target for the currently logged in user. After
|
|
1515
|
+
* deletion, the device will no longer receive push notifications. The target
|
|
1516
|
+
* must exist and belong to the current user.
|
|
1502
1517
|
*
|
|
1503
1518
|
* @param {string} targetId
|
|
1504
1519
|
* @throws {AppwriteException}
|
|
@@ -1573,9 +1588,7 @@ class Account extends Service {
|
|
|
1573
1588
|
* [POST
|
|
1574
1589
|
* /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession)
|
|
1575
1590
|
* endpoint to complete the login process. The link sent to the user's email
|
|
1576
|
-
* address is valid for 1 hour.
|
|
1577
|
-
* the URL parameter empty, so that the login completion will be handled by
|
|
1578
|
-
* your Appwrite instance by default.
|
|
1591
|
+
* address is valid for 1 hour.
|
|
1579
1592
|
*
|
|
1580
1593
|
* A user is limited to 10 active sessions at a time by default. [Learn more
|
|
1581
1594
|
* about session
|
|
@@ -2821,13 +2834,11 @@ class Storage extends Service {
|
|
|
2821
2834
|
};
|
|
2822
2835
|
let offset = 0;
|
|
2823
2836
|
let response = undefined;
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
catch (e) {
|
|
2830
|
-
}
|
|
2837
|
+
try {
|
|
2838
|
+
response = yield this.client.call('GET', new URL(this.client.config.endpoint + apiPath + '/' + fileId), apiHeaders);
|
|
2839
|
+
offset = response.chunksUploaded * Service.CHUNK_SIZE;
|
|
2840
|
+
}
|
|
2841
|
+
catch (e) {
|
|
2831
2842
|
}
|
|
2832
2843
|
let timestamp = new Date().getTime();
|
|
2833
2844
|
while (offset < size) {
|
|
@@ -4026,6 +4037,7 @@ var ImageFormat;
|
|
|
4026
4037
|
ImageFormat["Gif"] = "gif";
|
|
4027
4038
|
ImageFormat["Png"] = "png";
|
|
4028
4039
|
ImageFormat["Webp"] = "webp";
|
|
4040
|
+
ImageFormat["Heic"] = "heic";
|
|
4029
4041
|
ImageFormat["Avif"] = "avif";
|
|
4030
4042
|
})(ImageFormat || (ImageFormat = {}));
|
|
4031
4043
|
|