react-native-appwrite 0.2.2 → 0.3.1

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.
Files changed (157) hide show
  1. package/.github/workflows/publish.yml +13 -4
  2. package/CHANGELOG.md +1 -1
  3. package/LICENSE +1 -1
  4. package/README.md +22 -9
  5. package/dist/cjs/sdk.js +1193 -269
  6. package/dist/cjs/sdk.js.map +1 -1
  7. package/dist/esm/sdk.js +1193 -270
  8. package/dist/esm/sdk.js.map +1 -1
  9. package/docs/examples/account/create-anonymous-session.md +6 -13
  10. package/docs/examples/account/create-email-password-session.md +14 -0
  11. package/docs/examples/account/create-email-token.md +15 -0
  12. package/docs/examples/account/create-j-w-t.md +6 -13
  13. package/docs/examples/account/create-magic-u-r-l-token.md +16 -0
  14. package/docs/examples/account/create-mfa-authenticator.md +13 -0
  15. package/docs/examples/account/create-mfa-challenge.md +13 -0
  16. package/docs/examples/account/create-mfa-recovery-codes.md +11 -0
  17. package/docs/examples/account/create-o-auth2session.md +10 -9
  18. package/docs/examples/account/create-o-auth2token.md +15 -0
  19. package/docs/examples/account/create-phone-token.md +14 -0
  20. package/docs/examples/account/create-phone-verification.md +6 -13
  21. package/docs/examples/account/create-push-target.md +15 -0
  22. package/docs/examples/account/create-recovery.md +9 -13
  23. package/docs/examples/account/create-session.md +14 -0
  24. package/docs/examples/account/create-verification.md +8 -13
  25. package/docs/examples/account/create.md +11 -13
  26. package/docs/examples/account/delete-identity.md +8 -13
  27. package/docs/examples/account/delete-mfa-authenticator.md +14 -0
  28. package/docs/examples/account/delete-push-target.md +13 -0
  29. package/docs/examples/account/delete-session.md +8 -13
  30. package/docs/examples/account/delete-sessions.md +6 -13
  31. package/docs/examples/account/get-mfa-recovery-codes.md +11 -0
  32. package/docs/examples/account/get-prefs.md +6 -13
  33. package/docs/examples/account/get-session.md +8 -13
  34. package/docs/examples/account/get.md +6 -13
  35. package/docs/examples/account/list-identities.md +8 -13
  36. package/docs/examples/account/list-logs.md +8 -13
  37. package/docs/examples/account/list-mfa-factors.md +11 -0
  38. package/docs/examples/account/list-sessions.md +6 -13
  39. package/docs/examples/account/update-email.md +9 -13
  40. package/docs/examples/account/update-m-f-a.md +13 -0
  41. package/docs/examples/account/update-magic-u-r-l-session.md +9 -13
  42. package/docs/examples/account/update-mfa-authenticator.md +14 -0
  43. package/docs/examples/account/update-mfa-challenge.md +14 -0
  44. package/docs/examples/account/update-mfa-recovery-codes.md +11 -0
  45. package/docs/examples/account/update-name.md +8 -13
  46. package/docs/examples/account/update-password.md +9 -13
  47. package/docs/examples/account/update-phone-session.md +9 -13
  48. package/docs/examples/account/update-phone-verification.md +9 -13
  49. package/docs/examples/account/update-phone.md +9 -13
  50. package/docs/examples/account/update-prefs.md +8 -13
  51. package/docs/examples/account/update-push-target.md +14 -0
  52. package/docs/examples/account/update-recovery.md +10 -13
  53. package/docs/examples/account/update-session.md +8 -13
  54. package/docs/examples/account/update-status.md +6 -13
  55. package/docs/examples/account/update-verification.md +9 -13
  56. package/docs/examples/avatars/get-browser.md +11 -9
  57. package/docs/examples/avatars/get-credit-card.md +11 -9
  58. package/docs/examples/avatars/get-favicon.md +8 -9
  59. package/docs/examples/avatars/get-flag.md +11 -9
  60. package/docs/examples/avatars/get-image.md +10 -9
  61. package/docs/examples/avatars/get-initials.md +11 -9
  62. package/docs/examples/avatars/get-q-r.md +11 -9
  63. package/docs/examples/databases/create-document.md +12 -13
  64. package/docs/examples/databases/delete-document.md +10 -13
  65. package/docs/examples/databases/get-document.md +11 -13
  66. package/docs/examples/databases/list-documents.md +10 -13
  67. package/docs/examples/databases/update-document.md +12 -13
  68. package/docs/examples/functions/create-execution.md +13 -13
  69. package/docs/examples/functions/get-execution.md +9 -13
  70. package/docs/examples/functions/list-executions.md +10 -13
  71. package/docs/examples/graphql/mutation.md +8 -13
  72. package/docs/examples/graphql/query.md +8 -13
  73. package/docs/examples/locale/get.md +6 -13
  74. package/docs/examples/locale/list-codes.md +6 -13
  75. package/docs/examples/locale/list-continents.md +6 -13
  76. package/docs/examples/locale/list-countries-e-u.md +6 -13
  77. package/docs/examples/locale/list-countries-phones.md +6 -13
  78. package/docs/examples/locale/list-countries.md +6 -13
  79. package/docs/examples/locale/list-currencies.md +6 -13
  80. package/docs/examples/locale/list-languages.md +6 -13
  81. package/docs/examples/messaging/create-subscriber.md +15 -0
  82. package/docs/examples/messaging/delete-subscriber.md +14 -0
  83. package/docs/examples/storage/create-file.md +11 -13
  84. package/docs/examples/storage/delete-file.md +9 -13
  85. package/docs/examples/storage/get-file-download.md +9 -9
  86. package/docs/examples/storage/get-file-preview.md +20 -9
  87. package/docs/examples/storage/get-file-view.md +9 -9
  88. package/docs/examples/storage/get-file.md +9 -13
  89. package/docs/examples/storage/list-files.md +10 -13
  90. package/docs/examples/storage/update-file.md +11 -13
  91. package/docs/examples/teams/create-membership.md +14 -13
  92. package/docs/examples/teams/create.md +10 -13
  93. package/docs/examples/teams/delete-membership.md +9 -13
  94. package/docs/examples/teams/delete.md +8 -13
  95. package/docs/examples/teams/get-membership.md +9 -13
  96. package/docs/examples/teams/get-prefs.md +8 -13
  97. package/docs/examples/teams/get.md +8 -13
  98. package/docs/examples/teams/list-memberships.md +10 -13
  99. package/docs/examples/teams/list.md +9 -13
  100. package/docs/examples/teams/update-membership-status.md +11 -13
  101. package/docs/examples/teams/update-membership.md +10 -13
  102. package/docs/examples/teams/update-name.md +9 -13
  103. package/docs/examples/teams/update-prefs.md +9 -13
  104. package/package.json +1 -1
  105. package/src/client.ts +37 -11
  106. package/src/enums/authentication-factor.ts +6 -0
  107. package/src/enums/authenticator-type.ts +3 -0
  108. package/src/enums/browser.ts +16 -0
  109. package/src/enums/credit-card.ts +18 -0
  110. package/src/enums/execution-method.ts +8 -0
  111. package/src/enums/flag.ts +197 -0
  112. package/src/enums/image-format.ts +7 -0
  113. package/src/enums/image-gravity.ts +11 -0
  114. package/src/enums/o-auth-provider.ts +41 -0
  115. package/src/id.ts +23 -4
  116. package/src/index.ts +13 -2
  117. package/src/models.ts +174 -0
  118. package/src/query.ts +61 -34
  119. package/src/service.ts +4 -7
  120. package/src/services/account.ts +643 -119
  121. package/src/services/avatars.ts +12 -6
  122. package/src/services/databases.ts +7 -4
  123. package/src/services/functions.ts +6 -2
  124. package/src/services/graphql.ts +3 -0
  125. package/src/services/locale.ts +3 -0
  126. package/src/services/messaging.ts +84 -0
  127. package/src/services/storage.ts +12 -6
  128. package/src/services/teams.ts +3 -0
  129. package/types/client.d.ts +133 -0
  130. package/types/enums/authentication-factor.d.ts +6 -0
  131. package/types/enums/authenticator-type.d.ts +3 -0
  132. package/types/enums/browser.d.ts +16 -0
  133. package/types/enums/credit-card.d.ts +18 -0
  134. package/types/enums/execution-method.d.ts +8 -0
  135. package/types/enums/flag.d.ts +197 -0
  136. package/types/enums/image-format.d.ts +7 -0
  137. package/types/enums/image-gravity.d.ts +11 -0
  138. package/types/enums/o-auth-provider.d.ts +41 -0
  139. package/types/id.d.ts +5 -0
  140. package/types/index.d.ts +25 -0
  141. package/types/models.d.ts +1195 -0
  142. package/types/permission.d.ts +7 -0
  143. package/types/query.d.ts +34 -0
  144. package/types/role.d.ts +70 -0
  145. package/types/service.d.ts +8 -0
  146. package/types/services/account.d.ts +676 -0
  147. package/types/services/avatars.d.ts +149 -0
  148. package/types/services/databases.d.ts +77 -0
  149. package/types/services/functions.d.ts +49 -0
  150. package/types/services/graphql.d.ts +25 -0
  151. package/types/services/locale.d.ts +91 -0
  152. package/types/services/messaging.d.ts +29 -0
  153. package/types/services/storage.d.ts +147 -0
  154. package/types/services/teams.d.ts +197 -0
  155. package/docs/examples/account/create-email-session.md +0 -18
  156. package/docs/examples/account/create-magic-u-r-l-session.md +0 -18
  157. package/docs/examples/account/create-phone-session.md +0 -18
@@ -0,0 +1,7 @@
1
+ export declare class Permission {
2
+ static read: (role: string) => string;
3
+ static write: (role: string) => string;
4
+ static create: (role: string) => string;
5
+ static update: (role: string) => string;
6
+ static delete: (role: string) => string;
7
+ }
@@ -0,0 +1,34 @@
1
+ declare type QueryTypesSingle = string | number | boolean;
2
+ export declare type QueryTypesList = string[] | number[] | boolean[] | Query[];
3
+ export declare type QueryTypes = QueryTypesSingle | QueryTypesList;
4
+ declare type AttributesTypes = string | string[];
5
+ export declare class Query {
6
+ method: string;
7
+ attribute: AttributesTypes | undefined;
8
+ values: QueryTypesList | undefined;
9
+ constructor(method: string, attribute?: AttributesTypes, values?: QueryTypes);
10
+ toString(): string;
11
+ static equal: (attribute: string, value: QueryTypes) => string;
12
+ static notEqual: (attribute: string, value: QueryTypes) => string;
13
+ static lessThan: (attribute: string, value: QueryTypes) => string;
14
+ static lessThanEqual: (attribute: string, value: QueryTypes) => string;
15
+ static greaterThan: (attribute: string, value: QueryTypes) => string;
16
+ static greaterThanEqual: (attribute: string, value: QueryTypes) => string;
17
+ static isNull: (attribute: string) => string;
18
+ static isNotNull: (attribute: string) => string;
19
+ static between: (attribute: string, start: string | number, end: string | number) => string;
20
+ static startsWith: (attribute: string, value: string) => string;
21
+ static endsWith: (attribute: string, value: string) => string;
22
+ static select: (attributes: string[]) => string;
23
+ static search: (attribute: string, value: string) => string;
24
+ static orderDesc: (attribute: string) => string;
25
+ static orderAsc: (attribute: string) => string;
26
+ static cursorAfter: (documentId: string) => string;
27
+ static cursorBefore: (documentId: string) => string;
28
+ static limit: (limit: number) => string;
29
+ static offset: (offset: number) => string;
30
+ static contains: (attribute: string, value: string | string[]) => string;
31
+ static or: (queries: string[]) => string;
32
+ static and: (queries: string[]) => string;
33
+ }
34
+ export {};
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Helper class to generate role strings for `Permission`.
3
+ */
4
+ export declare class Role {
5
+ /**
6
+ * Grants access to anyone.
7
+ *
8
+ * This includes authenticated and unauthenticated users.
9
+ *
10
+ * @returns {string}
11
+ */
12
+ static any(): string;
13
+ /**
14
+ * Grants access to a specific user by user ID.
15
+ *
16
+ * You can optionally pass verified or unverified for
17
+ * `status` to target specific types of users.
18
+ *
19
+ * @param {string} id
20
+ * @param {string} status
21
+ * @returns {string}
22
+ */
23
+ static user(id: string, status?: string): string;
24
+ /**
25
+ * Grants access to any authenticated or anonymous user.
26
+ *
27
+ * You can optionally pass verified or unverified for
28
+ * `status` to target specific types of users.
29
+ *
30
+ * @param {string} status
31
+ * @returns {string}
32
+ */
33
+ static users(status?: string): string;
34
+ /**
35
+ * Grants access to any guest user without a session.
36
+ *
37
+ * Authenticated users don't have access to this role.
38
+ *
39
+ * @returns {string}
40
+ */
41
+ static guests(): string;
42
+ /**
43
+ * Grants access to a team by team ID.
44
+ *
45
+ * You can optionally pass a role for `role` to target
46
+ * team members with the specified role.
47
+ *
48
+ * @param {string} id
49
+ * @param {string} role
50
+ * @returns {string}
51
+ */
52
+ static team(id: string, role?: string): string;
53
+ /**
54
+ * Grants access to a specific member of a team.
55
+ *
56
+ * When the member is removed from the team, they will
57
+ * no longer have access.
58
+ *
59
+ * @param {string} id
60
+ * @returns {string}
61
+ */
62
+ static member(id: string): string;
63
+ /**
64
+ * Grants access to a user with the specified label.
65
+ *
66
+ * @param {string} name
67
+ * @returns {string}
68
+ */
69
+ static label(name: string): string;
70
+ }
@@ -0,0 +1,8 @@
1
+ import { Client } from './client';
2
+ import type { Payload } from './client';
3
+ export declare class Service {
4
+ static CHUNK_SIZE: number;
5
+ client: Client;
6
+ constructor(client: Client);
7
+ static flatten(data: Payload, prefix?: string): Payload;
8
+ }