react-native-appwrite 0.5.0 → 0.6.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/dist/cjs/sdk.js +31 -15
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +31 -15
- package/dist/esm/sdk.js.map +1 -1
- package/package.json +1 -1
- package/src/client.ts +25 -1
- package/src/enums/image-format.ts +1 -0
- package/src/models.ts +7 -3
- package/src/services/account.ts +10 -10
- package/src/services/locale.ts +1 -1
- package/src/services/storage.ts +1 -1
- package/src/services/teams.ts +4 -2
- package/types/enums/image-format.d.ts +2 -1
- package/types/models.d.ts +7 -3
- package/types/services/account.d.ts +10 -10
- package/types/services/locale.d.ts +1 -1
- package/types/services/storage.d.ts +1 -1
- package/types/services/teams.d.ts +4 -2
- package/.github/workflows/autoclose.yml +0 -11
package/dist/esm/sdk.js
CHANGED
|
@@ -77,12 +77,13 @@ 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.6.0',
|
|
81
81
|
'X-Appwrite-Response-Format': '1.6.0',
|
|
82
82
|
};
|
|
83
83
|
this.realtime = {
|
|
84
84
|
socket: undefined,
|
|
85
85
|
timeout: undefined,
|
|
86
|
+
heartbeat: undefined,
|
|
86
87
|
url: '',
|
|
87
88
|
channels: new Set(),
|
|
88
89
|
subscriptions: new Map(),
|
|
@@ -108,6 +109,17 @@ class Client {
|
|
|
108
109
|
return 60000;
|
|
109
110
|
}
|
|
110
111
|
},
|
|
112
|
+
createHeartbeat: () => {
|
|
113
|
+
if (this.realtime.heartbeat) {
|
|
114
|
+
clearTimeout(this.realtime.heartbeat);
|
|
115
|
+
}
|
|
116
|
+
this.realtime.heartbeat = window === null || window === void 0 ? void 0 : window.setInterval(() => {
|
|
117
|
+
var _a;
|
|
118
|
+
(_a = this.realtime.socket) === null || _a === void 0 ? void 0 : _a.send(JSON.stringify({
|
|
119
|
+
type: 'ping'
|
|
120
|
+
}));
|
|
121
|
+
}, 20000);
|
|
122
|
+
},
|
|
111
123
|
createSocket: () => {
|
|
112
124
|
var _a, _b, _c;
|
|
113
125
|
if (this.realtime.channels.size < 1) {
|
|
@@ -141,6 +153,7 @@ class Client {
|
|
|
141
153
|
this.realtime.socket.addEventListener('message', this.realtime.onMessage);
|
|
142
154
|
this.realtime.socket.addEventListener('open', _event => {
|
|
143
155
|
this.realtime.reconnectAttempts = 0;
|
|
156
|
+
this.realtime.createHeartbeat();
|
|
144
157
|
});
|
|
145
158
|
this.realtime.socket.addEventListener('close', event => {
|
|
146
159
|
var _a, _b, _c;
|
|
@@ -517,7 +530,7 @@ class Account extends Service {
|
|
|
517
530
|
});
|
|
518
531
|
}
|
|
519
532
|
/**
|
|
520
|
-
* List
|
|
533
|
+
* List identities
|
|
521
534
|
*
|
|
522
535
|
* Get the list of identities for the currently logged in user.
|
|
523
536
|
*
|
|
@@ -631,7 +644,7 @@ class Account extends Service {
|
|
|
631
644
|
});
|
|
632
645
|
}
|
|
633
646
|
/**
|
|
634
|
-
* Create
|
|
647
|
+
* Create authenticator
|
|
635
648
|
*
|
|
636
649
|
* Add an authenticator app to be used as an MFA factor. Verify the
|
|
637
650
|
* authenticator using the [verify
|
|
@@ -656,7 +669,7 @@ class Account extends Service {
|
|
|
656
669
|
});
|
|
657
670
|
}
|
|
658
671
|
/**
|
|
659
|
-
* Verify
|
|
672
|
+
* Verify authenticator
|
|
660
673
|
*
|
|
661
674
|
* Verify an authenticator app after adding it using the [add
|
|
662
675
|
* authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator)
|
|
@@ -687,7 +700,7 @@ class Account extends Service {
|
|
|
687
700
|
});
|
|
688
701
|
}
|
|
689
702
|
/**
|
|
690
|
-
* Delete
|
|
703
|
+
* Delete authenticator
|
|
691
704
|
*
|
|
692
705
|
* Delete an authenticator for a user by ID.
|
|
693
706
|
*
|
|
@@ -709,7 +722,7 @@ class Account extends Service {
|
|
|
709
722
|
});
|
|
710
723
|
}
|
|
711
724
|
/**
|
|
712
|
-
* Create MFA
|
|
725
|
+
* Create MFA challenge
|
|
713
726
|
*
|
|
714
727
|
* Begin the process of MFA verification after sign-in. Finish the flow with
|
|
715
728
|
* [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge)
|
|
@@ -736,7 +749,7 @@ class Account extends Service {
|
|
|
736
749
|
});
|
|
737
750
|
}
|
|
738
751
|
/**
|
|
739
|
-
* Create MFA
|
|
752
|
+
* Create MFA challenge (confirmation)
|
|
740
753
|
*
|
|
741
754
|
* Complete the MFA challenge by providing the one-time password. Finish the
|
|
742
755
|
* process of MFA verification by providing the one-time password. To begin
|
|
@@ -772,7 +785,7 @@ class Account extends Service {
|
|
|
772
785
|
});
|
|
773
786
|
}
|
|
774
787
|
/**
|
|
775
|
-
* List
|
|
788
|
+
* List factors
|
|
776
789
|
*
|
|
777
790
|
* List the factors available on the account to be used as a MFA challange.
|
|
778
791
|
*
|
|
@@ -790,7 +803,7 @@ class Account extends Service {
|
|
|
790
803
|
});
|
|
791
804
|
}
|
|
792
805
|
/**
|
|
793
|
-
* Get MFA
|
|
806
|
+
* Get MFA recovery codes
|
|
794
807
|
*
|
|
795
808
|
* Get recovery codes that can be used as backup for MFA flow. Before getting
|
|
796
809
|
* codes, they must be generated using
|
|
@@ -811,7 +824,7 @@ class Account extends Service {
|
|
|
811
824
|
});
|
|
812
825
|
}
|
|
813
826
|
/**
|
|
814
|
-
* Create MFA
|
|
827
|
+
* Create MFA recovery codes
|
|
815
828
|
*
|
|
816
829
|
* Generate recovery codes as backup for MFA flow. It's recommended to
|
|
817
830
|
* generate and show then immediately after user successfully adds their
|
|
@@ -833,7 +846,7 @@ class Account extends Service {
|
|
|
833
846
|
});
|
|
834
847
|
}
|
|
835
848
|
/**
|
|
836
|
-
* Regenerate MFA
|
|
849
|
+
* Regenerate MFA recovery codes
|
|
837
850
|
*
|
|
838
851
|
* Regenerate recovery codes that can be used as backup for MFA flow. Before
|
|
839
852
|
* regenerating codes, they must be first generated using
|
|
@@ -2507,7 +2520,7 @@ class Locale extends Service {
|
|
|
2507
2520
|
});
|
|
2508
2521
|
}
|
|
2509
2522
|
/**
|
|
2510
|
-
* List
|
|
2523
|
+
* List locale codes
|
|
2511
2524
|
*
|
|
2512
2525
|
* List of all locale codes in [ISO
|
|
2513
2526
|
* 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).
|
|
@@ -2912,7 +2925,7 @@ class Storage extends Service {
|
|
|
2912
2925
|
});
|
|
2913
2926
|
}
|
|
2914
2927
|
/**
|
|
2915
|
-
* Delete
|
|
2928
|
+
* Delete file
|
|
2916
2929
|
*
|
|
2917
2930
|
* Delete a file by its unique ID. Only users with write permissions have
|
|
2918
2931
|
* access to delete this resource.
|
|
@@ -3217,7 +3230,8 @@ class Teams extends Service {
|
|
|
3217
3230
|
* List team memberships
|
|
3218
3231
|
*
|
|
3219
3232
|
* Use this endpoint to list a team's members using the team's ID. All team
|
|
3220
|
-
* members have read access to this endpoint.
|
|
3233
|
+
* members have read access to this endpoint. Hide sensitive attributes from
|
|
3234
|
+
* the response by toggling membership privacy in the Console.
|
|
3221
3235
|
*
|
|
3222
3236
|
* @param {string} teamId
|
|
3223
3237
|
* @param {string[]} queries
|
|
@@ -3317,7 +3331,8 @@ class Teams extends Service {
|
|
|
3317
3331
|
* Get team membership
|
|
3318
3332
|
*
|
|
3319
3333
|
* Get a team member by the membership unique id. All team members have read
|
|
3320
|
-
* access for this resource.
|
|
3334
|
+
* access for this resource. Hide sensitive attributes from the response by
|
|
3335
|
+
* toggling membership privacy in the Console.
|
|
3321
3336
|
*
|
|
3322
3337
|
* @param {string} teamId
|
|
3323
3338
|
* @param {string} membershipId
|
|
@@ -4011,6 +4026,7 @@ var ImageFormat;
|
|
|
4011
4026
|
ImageFormat["Gif"] = "gif";
|
|
4012
4027
|
ImageFormat["Png"] = "png";
|
|
4013
4028
|
ImageFormat["Webp"] = "webp";
|
|
4029
|
+
ImageFormat["Avif"] = "avif";
|
|
4014
4030
|
})(ImageFormat || (ImageFormat = {}));
|
|
4015
4031
|
|
|
4016
4032
|
export { Account, AppwriteException, AuthenticationFactor, AuthenticatorType, Avatars, Browser, Client, CreditCard, Databases, ExecutionMethod, Flag, Functions, Graphql, ID, ImageFormat, ImageGravity, Locale, Messaging, OAuthProvider, Permission, Query, Role, Storage, Teams };
|