react-native-appwrite 0.2.1 → 0.3.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.
Files changed (131) 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 +1196 -273
  6. package/dist/cjs/sdk.js.map +1 -1
  7. package/dist/esm/sdk.js +1196 -273
  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 +4 -3
  105. package/src/client.ts +39 -13
  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 +13 -7
  128. package/src/services/teams.ts +3 -0
  129. package/docs/examples/account/create-email-session.md +0 -18
  130. package/docs/examples/account/create-magic-u-r-l-session.md +0 -18
  131. package/docs/examples/account/create-phone-session.md +0 -18
@@ -0,0 +1,16 @@
1
+ export enum Browser {
2
+ AvantBrowser = 'aa',
3
+ AndroidWebViewBeta = 'an',
4
+ GoogleChrome = 'ch',
5
+ GoogleChromeIOS = 'ci',
6
+ GoogleChromeMobile = 'cm',
7
+ Chromium = 'cr',
8
+ MozillaFirefox = 'ff',
9
+ Safari = 'sf',
10
+ MobileSafari = 'mf',
11
+ MicrosoftEdge = 'ps',
12
+ MicrosoftEdgeIOS = 'oi',
13
+ OperaMini = 'om',
14
+ Opera = 'op',
15
+ OperaNext = 'on',
16
+ }
@@ -0,0 +1,18 @@
1
+ export enum CreditCard {
2
+ AmericanExpress = 'amex',
3
+ Argencard = 'argencard',
4
+ Cabal = 'cabal',
5
+ Consosud = 'censosud',
6
+ DinersClub = 'diners',
7
+ Discover = 'discover',
8
+ Elo = 'elo',
9
+ Hipercard = 'hipercard',
10
+ JCB = 'jcb',
11
+ Mastercard = 'mastercard',
12
+ Naranja = 'naranja',
13
+ TarjetaShopping = 'targeta-shopping',
14
+ UnionChinaPay = 'union-china-pay',
15
+ Visa = 'visa',
16
+ MIR = 'mir',
17
+ Maestro = 'maestro',
18
+ }
@@ -0,0 +1,8 @@
1
+ export enum ExecutionMethod {
2
+ GET = 'GET',
3
+ POST = 'POST',
4
+ PUT = 'PUT',
5
+ PATCH = 'PATCH',
6
+ DELETE = 'DELETE',
7
+ OPTIONS = 'OPTIONS',
8
+ }
@@ -0,0 +1,197 @@
1
+ export enum Flag {
2
+ Afghanistan = 'af',
3
+ Angola = 'ao',
4
+ Albania = 'al',
5
+ Andorra = 'ad',
6
+ UnitedArabEmirates = 'ae',
7
+ Argentina = 'ar',
8
+ Armenia = 'am',
9
+ AntiguaAndBarbuda = 'ag',
10
+ Australia = 'au',
11
+ Austria = 'at',
12
+ Azerbaijan = 'az',
13
+ Burundi = 'bi',
14
+ Belgium = 'be',
15
+ Benin = 'bj',
16
+ BurkinaFaso = 'bf',
17
+ Bangladesh = 'bd',
18
+ Bulgaria = 'bg',
19
+ Bahrain = 'bh',
20
+ Bahamas = 'bs',
21
+ BosniaAndHerzegovina = 'ba',
22
+ Belarus = 'by',
23
+ Belize = 'bz',
24
+ Bolivia = 'bo',
25
+ Brazil = 'br',
26
+ Barbados = 'bb',
27
+ BruneiDarussalam = 'bn',
28
+ Bhutan = 'bt',
29
+ Botswana = 'bw',
30
+ CentralAfricanRepublic = 'cf',
31
+ Canada = 'ca',
32
+ Switzerland = 'ch',
33
+ Chile = 'cl',
34
+ China = 'cn',
35
+ CoteDIvoire = 'ci',
36
+ Cameroon = 'cm',
37
+ DemocraticRepublicOfTheCongo = 'cd',
38
+ RepublicOfTheCongo = 'cg',
39
+ Colombia = 'co',
40
+ Comoros = 'km',
41
+ CapeVerde = 'cv',
42
+ CostaRica = 'cr',
43
+ Cuba = 'cu',
44
+ Cyprus = 'cy',
45
+ CzechRepublic = 'cz',
46
+ Germany = 'de',
47
+ Djibouti = 'dj',
48
+ Dominica = 'dm',
49
+ Denmark = 'dk',
50
+ DominicanRepublic = 'do',
51
+ Algeria = 'dz',
52
+ Ecuador = 'ec',
53
+ Egypt = 'eg',
54
+ Eritrea = 'er',
55
+ Spain = 'es',
56
+ Estonia = 'ee',
57
+ Ethiopia = 'et',
58
+ Finland = 'fi',
59
+ Fiji = 'fj',
60
+ France = 'fr',
61
+ MicronesiaFederatedStatesOf = 'fm',
62
+ Gabon = 'ga',
63
+ UnitedKingdom = 'gb',
64
+ Georgia = 'ge',
65
+ Ghana = 'gh',
66
+ Guinea = 'gn',
67
+ Gambia = 'gm',
68
+ GuineaBissau = 'gw',
69
+ EquatorialGuinea = 'gq',
70
+ Greece = 'gr',
71
+ Grenada = 'gd',
72
+ Guatemala = 'gt',
73
+ Guyana = 'gy',
74
+ Honduras = 'hn',
75
+ Croatia = 'hr',
76
+ Haiti = 'ht',
77
+ Hungary = 'hu',
78
+ Indonesia = 'id',
79
+ India = 'in',
80
+ Ireland = 'ie',
81
+ IranIslamicRepublicOf = 'ir',
82
+ Iraq = 'iq',
83
+ Iceland = 'is',
84
+ Israel = 'il',
85
+ Italy = 'it',
86
+ Jamaica = 'jm',
87
+ Jordan = 'jo',
88
+ Japan = 'jp',
89
+ Kazakhstan = 'kz',
90
+ Kenya = 'ke',
91
+ Kyrgyzstan = 'kg',
92
+ Cambodia = 'kh',
93
+ Kiribati = 'ki',
94
+ SaintKittsAndNevis = 'kn',
95
+ SouthKorea = 'kr',
96
+ Kuwait = 'kw',
97
+ LaoPeopleSDemocraticRepublic = 'la',
98
+ Lebanon = 'lb',
99
+ Liberia = 'lr',
100
+ Libya = 'ly',
101
+ SaintLucia = 'lc',
102
+ Liechtenstein = 'li',
103
+ SriLanka = 'lk',
104
+ Lesotho = 'ls',
105
+ Lithuania = 'lt',
106
+ Luxembourg = 'lu',
107
+ Latvia = 'lv',
108
+ Morocco = 'ma',
109
+ Monaco = 'mc',
110
+ Moldova = 'md',
111
+ Madagascar = 'mg',
112
+ Maldives = 'mv',
113
+ Mexico = 'mx',
114
+ MarshallIslands = 'mh',
115
+ NorthMacedonia = 'mk',
116
+ Mali = 'ml',
117
+ Malta = 'mt',
118
+ Myanmar = 'mm',
119
+ Montenegro = 'me',
120
+ Mongolia = 'mn',
121
+ Mozambique = 'mz',
122
+ Mauritania = 'mr',
123
+ Mauritius = 'mu',
124
+ Malawi = 'mw',
125
+ Malaysia = 'my',
126
+ Namibia = 'na',
127
+ Niger = 'ne',
128
+ Nigeria = 'ng',
129
+ Nicaragua = 'ni',
130
+ Netherlands = 'nl',
131
+ Norway = 'no',
132
+ Nepal = 'np',
133
+ Nauru = 'nr',
134
+ NewZealand = 'nz',
135
+ Oman = 'om',
136
+ Pakistan = 'pk',
137
+ Panama = 'pa',
138
+ Peru = 'pe',
139
+ Philippines = 'ph',
140
+ Palau = 'pw',
141
+ PapuaNewGuinea = 'pg',
142
+ Poland = 'pl',
143
+ FrenchPolynesia = 'pf',
144
+ NorthKorea = 'kp',
145
+ Portugal = 'pt',
146
+ Paraguay = 'py',
147
+ Qatar = 'qa',
148
+ Romania = 'ro',
149
+ Russia = 'ru',
150
+ Rwanda = 'rw',
151
+ SaudiArabia = 'sa',
152
+ Sudan = 'sd',
153
+ Senegal = 'sn',
154
+ Singapore = 'sg',
155
+ SolomonIslands = 'sb',
156
+ SierraLeone = 'sl',
157
+ ElSalvador = 'sv',
158
+ SanMarino = 'sm',
159
+ Somalia = 'so',
160
+ Serbia = 'rs',
161
+ SouthSudan = 'ss',
162
+ SaoTomeAndPrincipe = 'st',
163
+ Suriname = 'sr',
164
+ Slovakia = 'sk',
165
+ Slovenia = 'si',
166
+ Sweden = 'se',
167
+ Eswatini = 'sz',
168
+ Seychelles = 'sc',
169
+ Syria = 'sy',
170
+ Chad = 'td',
171
+ Togo = 'tg',
172
+ Thailand = 'th',
173
+ Tajikistan = 'tj',
174
+ Turkmenistan = 'tm',
175
+ TimorLeste = 'tl',
176
+ Tonga = 'to',
177
+ TrinidadAndTobago = 'tt',
178
+ Tunisia = 'tn',
179
+ Turkey = 'tr',
180
+ Tuvalu = 'tv',
181
+ Tanzania = 'tz',
182
+ Uganda = 'ug',
183
+ Ukraine = 'ua',
184
+ Uruguay = 'uy',
185
+ UnitedStates = 'us',
186
+ Uzbekistan = 'uz',
187
+ VaticanCity = 'va',
188
+ SaintVincentAndTheGrenadines = 'vc',
189
+ Venezuela = 've',
190
+ Vietnam = 'vn',
191
+ Vanuatu = 'vu',
192
+ Samoa = 'ws',
193
+ Yemen = 'ye',
194
+ SouthAfrica = 'za',
195
+ Zambia = 'zm',
196
+ Zimbabwe = 'zw',
197
+ }
@@ -0,0 +1,7 @@
1
+ export enum ImageFormat {
2
+ Jpg = 'jpg',
3
+ Jpeg = 'jpeg',
4
+ Gif = 'gif',
5
+ Png = 'png',
6
+ Webp = 'webp',
7
+ }
@@ -0,0 +1,11 @@
1
+ export enum ImageGravity {
2
+ Center = 'center',
3
+ TopLeft = 'top-left',
4
+ Top = 'top',
5
+ TopRight = 'top-right',
6
+ Left = 'left',
7
+ Right = 'right',
8
+ BottomLeft = 'bottom-left',
9
+ Bottom = 'bottom',
10
+ BottomRight = 'bottom-right',
11
+ }
@@ -0,0 +1,41 @@
1
+ export enum OAuthProvider {
2
+ Amazon = 'amazon',
3
+ Apple = 'apple',
4
+ Auth0 = 'auth0',
5
+ Authentik = 'authentik',
6
+ Autodesk = 'autodesk',
7
+ Bitbucket = 'bitbucket',
8
+ Bitly = 'bitly',
9
+ Box = 'box',
10
+ Dailymotion = 'dailymotion',
11
+ Discord = 'discord',
12
+ Disqus = 'disqus',
13
+ Dropbox = 'dropbox',
14
+ Etsy = 'etsy',
15
+ Facebook = 'facebook',
16
+ Github = 'github',
17
+ Gitlab = 'gitlab',
18
+ Google = 'google',
19
+ Linkedin = 'linkedin',
20
+ Microsoft = 'microsoft',
21
+ Notion = 'notion',
22
+ Oidc = 'oidc',
23
+ Okta = 'okta',
24
+ Paypal = 'paypal',
25
+ PaypalSandbox = 'paypalSandbox',
26
+ Podio = 'podio',
27
+ Salesforce = 'salesforce',
28
+ Slack = 'slack',
29
+ Spotify = 'spotify',
30
+ Stripe = 'stripe',
31
+ Tradeshift = 'tradeshift',
32
+ TradeshiftBox = 'tradeshiftBox',
33
+ Twitch = 'twitch',
34
+ Wordpress = 'wordpress',
35
+ Yahoo = 'yahoo',
36
+ Yammer = 'yammer',
37
+ Yandex = 'yandex',
38
+ Zoho = 'zoho',
39
+ Zoom = 'zoom',
40
+ Mock = 'mock',
41
+ }
package/src/id.ts CHANGED
@@ -1,9 +1,28 @@
1
1
  export class ID {
2
+ // Generate an hex ID based on timestamp
3
+ // Recreated from https://www.php.net/manual/en/function.uniqid.php
4
+ static #hexTimestamp(): string {
5
+ const now = new Date();
6
+ const sec = Math.floor(now.getTime() / 1000);
7
+ const msec = now.getMilliseconds();
8
+
9
+ // Convert to hexadecimal
10
+ const hexTimestamp = sec.toString(16) + msec.toString(16).padStart(5, '0');
11
+ return hexTimestamp;
12
+ }
13
+
2
14
  public static custom(id: string): string {
3
15
  return id
4
16
  }
5
-
6
- public static unique(): string {
7
- return 'unique()'
17
+
18
+ public static unique(padding: number = 7): string {
19
+ // Generate a unique ID with padding to have a longer ID
20
+ const baseId = ID.#hexTimestamp();
21
+ let randomPadding = '';
22
+ for (let i = 0; i < padding; i++) {
23
+ const randomHexDigit = Math.floor(Math.random() * 16).toString(16);
24
+ randomPadding += randomHexDigit;
25
+ }
26
+ return baseId + randomPadding;
8
27
  }
9
- }
28
+ }
package/src/index.ts CHANGED
@@ -1,14 +1,25 @@
1
- export { Client, Query, AppwriteException } from './client';
1
+ export { Client, AppwriteException } from './client';
2
2
  export { Account } from './services/account';
3
3
  export { Avatars } from './services/avatars';
4
4
  export { Databases } from './services/databases';
5
5
  export { Functions } from './services/functions';
6
6
  export { Graphql } from './services/graphql';
7
7
  export { Locale } from './services/locale';
8
+ export { Messaging } from './services/messaging';
8
9
  export { Storage } from './services/storage';
9
10
  export { Teams } from './services/teams';
10
11
  export type { Models, Payload, RealtimeResponseEvent, UploadProgress } from './client';
11
12
  export type { QueryTypes, QueryTypesList } from './query';
13
+ export { Query } from './query';
12
14
  export { Permission } from './permission';
13
15
  export { Role } from './role';
14
- export { ID } from './id';
16
+ export { ID } from './id';
17
+ export { AuthenticatorType } from './enums/authenticator-type';
18
+ export { AuthenticationFactor } from './enums/authentication-factor';
19
+ export { OAuthProvider } from './enums/o-auth-provider';
20
+ export { Browser } from './enums/browser';
21
+ export { CreditCard } from './enums/credit-card';
22
+ export { Flag } from './enums/flag';
23
+ export { ExecutionMethod } from './enums/execution-method';
24
+ export { ImageGravity } from './enums/image-gravity';
25
+ export { ImageFormat } from './enums/image-format';
package/src/models.ts CHANGED
@@ -364,10 +364,18 @@ export namespace Models {
364
364
  * Phone verification status.
365
365
  */
366
366
  phoneVerification: boolean;
367
+ /**
368
+ * Multi factor authentication status.
369
+ */
370
+ mfa: boolean;
367
371
  /**
368
372
  * User preferences as a key-value object
369
373
  */
370
374
  prefs: Preferences;
375
+ /**
376
+ * A user-owned message receiver. A single user may have multiple e.g. emails, phones, and a browser. Each target is registered with a single provider.
377
+ */
378
+ targets: Target[];
371
379
  /**
372
380
  * Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.
373
381
  */
@@ -494,6 +502,10 @@ export namespace Models {
494
502
  * Session creation date in ISO 8601 format.
495
503
  */
496
504
  $createdAt: string;
505
+ /**
506
+ * Session update date in ISO 8601 format.
507
+ */
508
+ $updatedAt: string;
497
509
  /**
498
510
  * User ID.
499
511
  */
@@ -586,6 +598,18 @@ export namespace Models {
586
598
  * Returns true if this the current user session.
587
599
  */
588
600
  current: boolean;
601
+ /**
602
+ * Returns a list of active session factors.
603
+ */
604
+ factors: string[];
605
+ /**
606
+ * Secret used to authenticate the user. Only included if the request was made with an API key
607
+ */
608
+ secret: string;
609
+ /**
610
+ * Most recent date in ISO 8601 format when the session successfully passed MFA challenge.
611
+ */
612
+ mfaUpdatedAt: string;
589
613
  }
590
614
  /**
591
615
  * Identity
@@ -656,6 +680,10 @@ export namespace Models {
656
680
  * Token expiration date in ISO 8601 format.
657
681
  */
658
682
  expire: string;
683
+ /**
684
+ * Security phrase of a token. Empty if security phrase was not requested when creating a token. It includes randomly generated phrase which is also sent in the external resource such as email.
685
+ */
686
+ phrase: string;
659
687
  }
660
688
  /**
661
689
  * JWT
@@ -838,6 +866,10 @@ export namespace Models {
838
866
  * User confirmation status, true if the user has joined the team or false otherwise.
839
867
  */
840
868
  confirm: boolean;
869
+ /**
870
+ * Multi factor authentication status, true if the user has MFA enabled or false otherwise.
871
+ */
872
+ mfa: boolean;
841
873
  /**
842
874
  * User list of roles
843
875
  */
@@ -1018,4 +1050,146 @@ export namespace Models {
1018
1050
  */
1019
1051
  value: string;
1020
1052
  }
1053
+ /**
1054
+ * MFA Challenge
1055
+ */
1056
+ export type MfaChallenge = {
1057
+ /**
1058
+ * Token ID.
1059
+ */
1060
+ $id: string;
1061
+ /**
1062
+ * Token creation date in ISO 8601 format.
1063
+ */
1064
+ $createdAt: string;
1065
+ /**
1066
+ * User ID.
1067
+ */
1068
+ userId: string;
1069
+ /**
1070
+ * Token expiration date in ISO 8601 format.
1071
+ */
1072
+ expire: string;
1073
+ }
1074
+ /**
1075
+ * MFA Recovery Codes
1076
+ */
1077
+ export type MfaRecoveryCodes = {
1078
+ /**
1079
+ * Recovery codes.
1080
+ */
1081
+ recoveryCodes: string[];
1082
+ }
1083
+ /**
1084
+ * MFAType
1085
+ */
1086
+ export type MfaType = {
1087
+ /**
1088
+ * Secret token used for TOTP factor.
1089
+ */
1090
+ secret: string;
1091
+ /**
1092
+ * URI for authenticator apps.
1093
+ */
1094
+ uri: string;
1095
+ }
1096
+ /**
1097
+ * MFAFactors
1098
+ */
1099
+ export type MfaFactors = {
1100
+ /**
1101
+ * Can TOTP be used for MFA challenge for this account.
1102
+ */
1103
+ totp: boolean;
1104
+ /**
1105
+ * Can phone (SMS) be used for MFA challenge for this account.
1106
+ */
1107
+ phone: boolean;
1108
+ /**
1109
+ * Can email be used for MFA challenge for this account.
1110
+ */
1111
+ email: boolean;
1112
+ /**
1113
+ * Can recovery code be used for MFA challenge for this account.
1114
+ */
1115
+ recoveryCode: boolean;
1116
+ }
1117
+ /**
1118
+ * Subscriber
1119
+ */
1120
+ export type Subscriber = {
1121
+ /**
1122
+ * Subscriber ID.
1123
+ */
1124
+ $id: string;
1125
+ /**
1126
+ * Subscriber creation time in ISO 8601 format.
1127
+ */
1128
+ $createdAt: string;
1129
+ /**
1130
+ * Subscriber update date in ISO 8601 format.
1131
+ */
1132
+ $updatedAt: string;
1133
+ /**
1134
+ * Target ID.
1135
+ */
1136
+ targetId: string;
1137
+ /**
1138
+ * Target.
1139
+ */
1140
+ target: Target;
1141
+ /**
1142
+ * Topic ID.
1143
+ */
1144
+ userId: string;
1145
+ /**
1146
+ * User Name.
1147
+ */
1148
+ userName: string;
1149
+ /**
1150
+ * Topic ID.
1151
+ */
1152
+ topicId: string;
1153
+ /**
1154
+ * The target provider type. Can be one of the following: `email`, `sms` or `push`.
1155
+ */
1156
+ providerType: string;
1157
+ }
1158
+ /**
1159
+ * Target
1160
+ */
1161
+ export type Target = {
1162
+ /**
1163
+ * Target ID.
1164
+ */
1165
+ $id: string;
1166
+ /**
1167
+ * Target creation time in ISO 8601 format.
1168
+ */
1169
+ $createdAt: string;
1170
+ /**
1171
+ * Target update date in ISO 8601 format.
1172
+ */
1173
+ $updatedAt: string;
1174
+ /**
1175
+ * Target Name.
1176
+ */
1177
+ name: string;
1178
+ /**
1179
+ * User ID.
1180
+ */
1181
+ userId: string;
1182
+ /**
1183
+ * Provider ID.
1184
+ */
1185
+ providerId?: string;
1186
+ /**
1187
+ * The target provider type. Can be one of the following: `email`, `sms` or `push`.
1188
+ */
1189
+ providerType: string;
1190
+ /**
1191
+ * The target identifier.
1192
+ */
1193
+ identifier: string;
1194
+ }
1021
1195
  }