react-native-appwrite 0.11.0 → 0.12.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 (125) hide show
  1. package/README.md +84 -3
  2. package/dist/cjs/sdk.js +1741 -1120
  3. package/dist/cjs/sdk.js.map +1 -1
  4. package/dist/esm/sdk.js +1741 -1121
  5. package/dist/esm/sdk.js.map +1 -1
  6. package/docs/examples/account/create-email-password-session.md +4 -4
  7. package/docs/examples/account/create-email-token.md +5 -5
  8. package/docs/examples/account/{create-magic-u-r-l-token.md → create-magic-url-token.md} +6 -6
  9. package/docs/examples/account/create-mfa-authenticator.md +3 -3
  10. package/docs/examples/account/create-mfa-challenge.md +3 -3
  11. package/docs/examples/account/create-mfa-recovery-codes.md +1 -1
  12. package/docs/examples/account/{create-o-auth2token.md → create-o-auth-2-session.md} +6 -6
  13. package/docs/examples/account/{create-o-auth2session.md → create-o-auth-2-token.md} +6 -6
  14. package/docs/examples/account/create-phone-token.md +4 -4
  15. package/docs/examples/account/create-push-target.md +5 -5
  16. package/docs/examples/account/create-recovery.md +4 -4
  17. package/docs/examples/account/create-session.md +4 -4
  18. package/docs/examples/account/create-verification.md +3 -3
  19. package/docs/examples/account/create.md +6 -6
  20. package/docs/examples/account/delete-identity.md +3 -3
  21. package/docs/examples/account/delete-mfa-authenticator.md +3 -3
  22. package/docs/examples/account/delete-push-target.md +3 -3
  23. package/docs/examples/account/delete-session.md +3 -3
  24. package/docs/examples/account/get-mfa-recovery-codes.md +1 -1
  25. package/docs/examples/account/get-session.md +3 -3
  26. package/docs/examples/account/list-identities.md +3 -3
  27. package/docs/examples/account/list-logs.md +3 -3
  28. package/docs/examples/account/list-mfa-factors.md +1 -1
  29. package/docs/examples/account/update-email.md +4 -4
  30. package/docs/examples/account/{update-magic-u-r-l-session.md → update-magic-url-session.md} +4 -4
  31. package/docs/examples/account/update-mfa-authenticator.md +4 -4
  32. package/docs/examples/account/update-mfa-challenge.md +4 -4
  33. package/docs/examples/account/update-mfa-recovery-codes.md +1 -1
  34. package/docs/examples/account/{update-m-f-a.md → update-mfa.md} +3 -3
  35. package/docs/examples/account/update-name.md +3 -3
  36. package/docs/examples/account/update-password.md +4 -4
  37. package/docs/examples/account/update-phone-session.md +4 -4
  38. package/docs/examples/account/update-phone-verification.md +4 -4
  39. package/docs/examples/account/update-phone.md +4 -4
  40. package/docs/examples/account/update-prefs.md +3 -3
  41. package/docs/examples/account/update-push-target.md +4 -4
  42. package/docs/examples/account/update-recovery.md +5 -5
  43. package/docs/examples/account/update-session.md +3 -3
  44. package/docs/examples/account/update-verification.md +4 -4
  45. package/docs/examples/avatars/get-browser.md +6 -6
  46. package/docs/examples/avatars/get-credit-card.md +6 -6
  47. package/docs/examples/avatars/get-favicon.md +3 -3
  48. package/docs/examples/avatars/get-flag.md +6 -6
  49. package/docs/examples/avatars/get-image.md +5 -5
  50. package/docs/examples/avatars/get-initials.md +6 -6
  51. package/docs/examples/avatars/{get-q-r.md → get-qr.md} +6 -6
  52. package/docs/examples/databases/create-document.md +7 -7
  53. package/docs/examples/databases/decrement-document-attribute.md +8 -8
  54. package/docs/examples/databases/delete-document.md +5 -5
  55. package/docs/examples/databases/get-document.md +6 -6
  56. package/docs/examples/databases/increment-document-attribute.md +8 -8
  57. package/docs/examples/databases/list-documents.md +5 -5
  58. package/docs/examples/databases/update-document.md +7 -7
  59. package/docs/examples/databases/upsert-document.md +7 -7
  60. package/docs/examples/functions/create-execution.md +9 -9
  61. package/docs/examples/functions/get-execution.md +4 -4
  62. package/docs/examples/functions/list-executions.md +4 -4
  63. package/docs/examples/graphql/mutation.md +3 -3
  64. package/docs/examples/graphql/query.md +3 -3
  65. package/docs/examples/messaging/create-subscriber.md +5 -5
  66. package/docs/examples/messaging/delete-subscriber.md +4 -4
  67. package/docs/examples/storage/create-file.md +6 -6
  68. package/docs/examples/storage/delete-file.md +4 -4
  69. package/docs/examples/storage/get-file-download.md +5 -5
  70. package/docs/examples/storage/get-file-preview.md +16 -16
  71. package/docs/examples/storage/get-file-view.md +5 -5
  72. package/docs/examples/storage/get-file.md +4 -4
  73. package/docs/examples/storage/list-files.md +5 -5
  74. package/docs/examples/storage/update-file.md +6 -6
  75. package/docs/examples/tablesdb/create-row.md +17 -0
  76. package/docs/examples/tablesdb/decrement-row-column.md +18 -0
  77. package/docs/examples/tablesdb/delete-row.md +15 -0
  78. package/docs/examples/tablesdb/get-row.md +16 -0
  79. package/docs/examples/tablesdb/increment-row-column.md +18 -0
  80. package/docs/examples/tablesdb/list-rows.md +15 -0
  81. package/docs/examples/tablesdb/update-row.md +17 -0
  82. package/docs/examples/tablesdb/upsert-row.md +17 -0
  83. package/docs/examples/teams/create-membership.md +9 -9
  84. package/docs/examples/teams/create.md +5 -5
  85. package/docs/examples/teams/delete-membership.md +4 -4
  86. package/docs/examples/teams/delete.md +3 -3
  87. package/docs/examples/teams/get-membership.md +4 -4
  88. package/docs/examples/teams/get-prefs.md +3 -3
  89. package/docs/examples/teams/get.md +3 -3
  90. package/docs/examples/teams/list-memberships.md +5 -5
  91. package/docs/examples/teams/list.md +4 -4
  92. package/docs/examples/teams/update-membership-status.md +6 -6
  93. package/docs/examples/teams/update-membership.md +5 -5
  94. package/docs/examples/teams/update-name.md +4 -4
  95. package/docs/examples/teams/update-prefs.md +4 -4
  96. package/package.json +1 -1
  97. package/src/client.ts +2 -2
  98. package/src/index.ts +1 -0
  99. package/src/models.ts +72 -27
  100. package/src/query.ts +95 -0
  101. package/src/services/account.ts +1469 -315
  102. package/src/services/avatars.ts +289 -80
  103. package/src/services/databases.ts +354 -63
  104. package/src/services/functions.ts +115 -20
  105. package/src/services/graphql.ts +52 -4
  106. package/src/services/locale.ts +8 -19
  107. package/src/services/messaging.ts +66 -7
  108. package/src/services/storage.ts +345 -76
  109. package/src/services/tables-db.ts +621 -0
  110. package/src/services/teams.ts +454 -93
  111. package/types/index.d.ts +1 -0
  112. package/types/models.d.ts +69 -25
  113. package/types/query.d.ts +77 -0
  114. package/types/services/account.d.ts +734 -280
  115. package/types/services/avatars.d.ts +168 -73
  116. package/types/services/databases.d.ts +199 -58
  117. package/types/services/functions.d.ts +62 -17
  118. package/types/services/graphql.d.ts +24 -2
  119. package/types/services/locale.d.ts +8 -19
  120. package/types/services/messaging.d.ts +33 -5
  121. package/types/services/storage.d.ts +201 -68
  122. package/types/services/tables-db.d.ts +245 -0
  123. package/types/services/teams.d.ts +242 -80
  124. /package/docs/examples/account/{create-j-w-t.md → create-jwt.md} +0 -0
  125. /package/docs/examples/locale/{list-countries-e-u.md → list-countries-eu.md} +0 -0
@@ -6,9 +6,9 @@ const client = new Client()
6
6
 
7
7
  const account = new Account(client);
8
8
 
9
- const result = await account.createEmailPasswordSession(
10
- 'email@example.com', // email
11
- 'password' // password
12
- );
9
+ const result = await account.createEmailPasswordSession({
10
+ email: 'email@example.com',
11
+ password: 'password'
12
+ });
13
13
 
14
14
  console.log(result);
@@ -6,10 +6,10 @@ const client = new Client()
6
6
 
7
7
  const account = new Account(client);
8
8
 
9
- const result = await account.createEmailToken(
10
- '<USER_ID>', // userId
11
- 'email@example.com', // email
12
- false // phrase (optional)
13
- );
9
+ const result = await account.createEmailToken({
10
+ userId: '<USER_ID>',
11
+ email: 'email@example.com',
12
+ phrase: false // optional
13
+ });
14
14
 
15
15
  console.log(result);
@@ -6,11 +6,11 @@ const client = new Client()
6
6
 
7
7
  const account = new Account(client);
8
8
 
9
- const result = await account.createMagicURLToken(
10
- '<USER_ID>', // userId
11
- 'email@example.com', // email
12
- 'https://example.com', // url (optional)
13
- false // phrase (optional)
14
- );
9
+ const result = await account.createMagicURLToken({
10
+ userId: '<USER_ID>',
11
+ email: 'email@example.com',
12
+ url: 'https://example.com', // optional
13
+ phrase: false // optional
14
+ });
15
15
 
16
16
  console.log(result);
@@ -6,8 +6,8 @@ const client = new Client()
6
6
 
7
7
  const account = new Account(client);
8
8
 
9
- const result = await account.createMfaAuthenticator(
10
- AuthenticatorType.Totp // type
11
- );
9
+ const result = await account.createMFAAuthenticator({
10
+ type: AuthenticatorType.Totp
11
+ });
12
12
 
13
13
  console.log(result);
@@ -6,8 +6,8 @@ const client = new Client()
6
6
 
7
7
  const account = new Account(client);
8
8
 
9
- const result = await account.createMfaChallenge(
10
- AuthenticationFactor.Email // factor
11
- );
9
+ const result = await account.createMFAChallenge({
10
+ factor: AuthenticationFactor.Email
11
+ });
12
12
 
13
13
  console.log(result);
@@ -6,6 +6,6 @@ const client = new Client()
6
6
 
7
7
  const account = new Account(client);
8
8
 
9
- const result = await account.createMfaRecoveryCodes();
9
+ const result = await account.createMFARecoveryCodes();
10
10
 
11
11
  console.log(result);
@@ -6,10 +6,10 @@ const client = new Client()
6
6
 
7
7
  const account = new Account(client);
8
8
 
9
- account.createOAuth2Token(
10
- OAuthProvider.Amazon, // provider
11
- 'https://example.com', // success (optional)
12
- 'https://example.com', // failure (optional)
13
- [] // scopes (optional)
14
- );
9
+ account.createOAuth2Session({
10
+ provider: OAuthProvider.Amazon,
11
+ success: 'https://example.com', // optional
12
+ failure: 'https://example.com', // optional
13
+ scopes: [] // optional
14
+ });
15
15
 
@@ -6,10 +6,10 @@ const client = new Client()
6
6
 
7
7
  const account = new Account(client);
8
8
 
9
- account.createOAuth2Session(
10
- OAuthProvider.Amazon, // provider
11
- 'https://example.com', // success (optional)
12
- 'https://example.com', // failure (optional)
13
- [] // scopes (optional)
14
- );
9
+ account.createOAuth2Token({
10
+ provider: OAuthProvider.Amazon,
11
+ success: 'https://example.com', // optional
12
+ failure: 'https://example.com', // optional
13
+ scopes: [] // optional
14
+ });
15
15
 
@@ -6,9 +6,9 @@ const client = new Client()
6
6
 
7
7
  const account = new Account(client);
8
8
 
9
- const result = await account.createPhoneToken(
10
- '<USER_ID>', // userId
11
- '+12065550100' // phone
12
- );
9
+ const result = await account.createPhoneToken({
10
+ userId: '<USER_ID>',
11
+ phone: '+12065550100'
12
+ });
13
13
 
14
14
  console.log(result);
@@ -6,10 +6,10 @@ const client = new Client()
6
6
 
7
7
  const account = new Account(client);
8
8
 
9
- const result = await account.createPushTarget(
10
- '<TARGET_ID>', // targetId
11
- '<IDENTIFIER>', // identifier
12
- '<PROVIDER_ID>' // providerId (optional)
13
- );
9
+ const result = await account.createPushTarget({
10
+ targetId: '<TARGET_ID>',
11
+ identifier: '<IDENTIFIER>',
12
+ providerId: '<PROVIDER_ID>' // optional
13
+ });
14
14
 
15
15
  console.log(result);
@@ -6,9 +6,9 @@ const client = new Client()
6
6
 
7
7
  const account = new Account(client);
8
8
 
9
- const result = await account.createRecovery(
10
- 'email@example.com', // email
11
- 'https://example.com' // url
12
- );
9
+ const result = await account.createRecovery({
10
+ email: 'email@example.com',
11
+ url: 'https://example.com'
12
+ });
13
13
 
14
14
  console.log(result);
@@ -6,9 +6,9 @@ const client = new Client()
6
6
 
7
7
  const account = new Account(client);
8
8
 
9
- const result = await account.createSession(
10
- '<USER_ID>', // userId
11
- '<SECRET>' // secret
12
- );
9
+ const result = await account.createSession({
10
+ userId: '<USER_ID>',
11
+ secret: '<SECRET>'
12
+ });
13
13
 
14
14
  console.log(result);
@@ -6,8 +6,8 @@ const client = new Client()
6
6
 
7
7
  const account = new Account(client);
8
8
 
9
- const result = await account.createVerification(
10
- 'https://example.com' // url
11
- );
9
+ const result = await account.createVerification({
10
+ url: 'https://example.com'
11
+ });
12
12
 
13
13
  console.log(result);
@@ -6,11 +6,11 @@ const client = new Client()
6
6
 
7
7
  const account = new Account(client);
8
8
 
9
- const result = await account.create(
10
- '<USER_ID>', // userId
11
- 'email@example.com', // email
12
- '', // password
13
- '<NAME>' // name (optional)
14
- );
9
+ const result = await account.create({
10
+ userId: '<USER_ID>',
11
+ email: 'email@example.com',
12
+ password: '',
13
+ name: '<NAME>' // optional
14
+ });
15
15
 
16
16
  console.log(result);
@@ -6,8 +6,8 @@ const client = new Client()
6
6
 
7
7
  const account = new Account(client);
8
8
 
9
- const result = await account.deleteIdentity(
10
- '<IDENTITY_ID>' // identityId
11
- );
9
+ const result = await account.deleteIdentity({
10
+ identityId: '<IDENTITY_ID>'
11
+ });
12
12
 
13
13
  console.log(result);
@@ -6,8 +6,8 @@ const client = new Client()
6
6
 
7
7
  const account = new Account(client);
8
8
 
9
- const result = await account.deleteMfaAuthenticator(
10
- AuthenticatorType.Totp // type
11
- );
9
+ const result = await account.deleteMFAAuthenticator({
10
+ type: AuthenticatorType.Totp
11
+ });
12
12
 
13
13
  console.log(result);
@@ -6,8 +6,8 @@ const client = new Client()
6
6
 
7
7
  const account = new Account(client);
8
8
 
9
- const result = await account.deletePushTarget(
10
- '<TARGET_ID>' // targetId
11
- );
9
+ const result = await account.deletePushTarget({
10
+ targetId: '<TARGET_ID>'
11
+ });
12
12
 
13
13
  console.log(result);
@@ -6,8 +6,8 @@ const client = new Client()
6
6
 
7
7
  const account = new Account(client);
8
8
 
9
- const result = await account.deleteSession(
10
- '<SESSION_ID>' // sessionId
11
- );
9
+ const result = await account.deleteSession({
10
+ sessionId: '<SESSION_ID>'
11
+ });
12
12
 
13
13
  console.log(result);
@@ -6,6 +6,6 @@ const client = new Client()
6
6
 
7
7
  const account = new Account(client);
8
8
 
9
- const result = await account.getMfaRecoveryCodes();
9
+ const result = await account.getMFARecoveryCodes();
10
10
 
11
11
  console.log(result);
@@ -6,8 +6,8 @@ const client = new Client()
6
6
 
7
7
  const account = new Account(client);
8
8
 
9
- const result = await account.getSession(
10
- '<SESSION_ID>' // sessionId
11
- );
9
+ const result = await account.getSession({
10
+ sessionId: '<SESSION_ID>'
11
+ });
12
12
 
13
13
  console.log(result);
@@ -6,8 +6,8 @@ const client = new Client()
6
6
 
7
7
  const account = new Account(client);
8
8
 
9
- const result = await account.listIdentities(
10
- [] // queries (optional)
11
- );
9
+ const result = await account.listIdentities({
10
+ queries: [] // optional
11
+ });
12
12
 
13
13
  console.log(result);
@@ -6,8 +6,8 @@ const client = new Client()
6
6
 
7
7
  const account = new Account(client);
8
8
 
9
- const result = await account.listLogs(
10
- [] // queries (optional)
11
- );
9
+ const result = await account.listLogs({
10
+ queries: [] // optional
11
+ });
12
12
 
13
13
  console.log(result);
@@ -6,6 +6,6 @@ const client = new Client()
6
6
 
7
7
  const account = new Account(client);
8
8
 
9
- const result = await account.listMfaFactors();
9
+ const result = await account.listMFAFactors();
10
10
 
11
11
  console.log(result);
@@ -6,9 +6,9 @@ const client = new Client()
6
6
 
7
7
  const account = new Account(client);
8
8
 
9
- const result = await account.updateEmail(
10
- 'email@example.com', // email
11
- 'password' // password
12
- );
9
+ const result = await account.updateEmail({
10
+ email: 'email@example.com',
11
+ password: 'password'
12
+ });
13
13
 
14
14
  console.log(result);
@@ -6,9 +6,9 @@ const client = new Client()
6
6
 
7
7
  const account = new Account(client);
8
8
 
9
- const result = await account.updateMagicURLSession(
10
- '<USER_ID>', // userId
11
- '<SECRET>' // secret
12
- );
9
+ const result = await account.updateMagicURLSession({
10
+ userId: '<USER_ID>',
11
+ secret: '<SECRET>'
12
+ });
13
13
 
14
14
  console.log(result);
@@ -6,9 +6,9 @@ const client = new Client()
6
6
 
7
7
  const account = new Account(client);
8
8
 
9
- const result = await account.updateMfaAuthenticator(
10
- AuthenticatorType.Totp, // type
11
- '<OTP>' // otp
12
- );
9
+ const result = await account.updateMFAAuthenticator({
10
+ type: AuthenticatorType.Totp,
11
+ otp: '<OTP>'
12
+ });
13
13
 
14
14
  console.log(result);
@@ -6,9 +6,9 @@ const client = new Client()
6
6
 
7
7
  const account = new Account(client);
8
8
 
9
- const result = await account.updateMfaChallenge(
10
- '<CHALLENGE_ID>', // challengeId
11
- '<OTP>' // otp
12
- );
9
+ const result = await account.updateMFAChallenge({
10
+ challengeId: '<CHALLENGE_ID>',
11
+ otp: '<OTP>'
12
+ });
13
13
 
14
14
  console.log(result);
@@ -6,6 +6,6 @@ const client = new Client()
6
6
 
7
7
  const account = new Account(client);
8
8
 
9
- const result = await account.updateMfaRecoveryCodes();
9
+ const result = await account.updateMFARecoveryCodes();
10
10
 
11
11
  console.log(result);
@@ -6,8 +6,8 @@ const client = new Client()
6
6
 
7
7
  const account = new Account(client);
8
8
 
9
- const result = await account.updateMFA(
10
- false // mfa
11
- );
9
+ const result = await account.updateMFA({
10
+ mfa: false
11
+ });
12
12
 
13
13
  console.log(result);
@@ -6,8 +6,8 @@ const client = new Client()
6
6
 
7
7
  const account = new Account(client);
8
8
 
9
- const result = await account.updateName(
10
- '<NAME>' // name
11
- );
9
+ const result = await account.updateName({
10
+ name: '<NAME>'
11
+ });
12
12
 
13
13
  console.log(result);
@@ -6,9 +6,9 @@ const client = new Client()
6
6
 
7
7
  const account = new Account(client);
8
8
 
9
- const result = await account.updatePassword(
10
- '', // password
11
- 'password' // oldPassword (optional)
12
- );
9
+ const result = await account.updatePassword({
10
+ password: '',
11
+ oldPassword: 'password' // optional
12
+ });
13
13
 
14
14
  console.log(result);
@@ -6,9 +6,9 @@ const client = new Client()
6
6
 
7
7
  const account = new Account(client);
8
8
 
9
- const result = await account.updatePhoneSession(
10
- '<USER_ID>', // userId
11
- '<SECRET>' // secret
12
- );
9
+ const result = await account.updatePhoneSession({
10
+ userId: '<USER_ID>',
11
+ secret: '<SECRET>'
12
+ });
13
13
 
14
14
  console.log(result);
@@ -6,9 +6,9 @@ const client = new Client()
6
6
 
7
7
  const account = new Account(client);
8
8
 
9
- const result = await account.updatePhoneVerification(
10
- '<USER_ID>', // userId
11
- '<SECRET>' // secret
12
- );
9
+ const result = await account.updatePhoneVerification({
10
+ userId: '<USER_ID>',
11
+ secret: '<SECRET>'
12
+ });
13
13
 
14
14
  console.log(result);
@@ -6,9 +6,9 @@ const client = new Client()
6
6
 
7
7
  const account = new Account(client);
8
8
 
9
- const result = await account.updatePhone(
10
- '+12065550100', // phone
11
- 'password' // password
12
- );
9
+ const result = await account.updatePhone({
10
+ phone: '+12065550100',
11
+ password: 'password'
12
+ });
13
13
 
14
14
  console.log(result);
@@ -6,8 +6,8 @@ const client = new Client()
6
6
 
7
7
  const account = new Account(client);
8
8
 
9
- const result = await account.updatePrefs(
10
- {} // prefs
11
- );
9
+ const result = await account.updatePrefs({
10
+ prefs: {}
11
+ });
12
12
 
13
13
  console.log(result);
@@ -6,9 +6,9 @@ const client = new Client()
6
6
 
7
7
  const account = new Account(client);
8
8
 
9
- const result = await account.updatePushTarget(
10
- '<TARGET_ID>', // targetId
11
- '<IDENTIFIER>' // identifier
12
- );
9
+ const result = await account.updatePushTarget({
10
+ targetId: '<TARGET_ID>',
11
+ identifier: '<IDENTIFIER>'
12
+ });
13
13
 
14
14
  console.log(result);
@@ -6,10 +6,10 @@ const client = new Client()
6
6
 
7
7
  const account = new Account(client);
8
8
 
9
- const result = await account.updateRecovery(
10
- '<USER_ID>', // userId
11
- '<SECRET>', // secret
12
- '' // password
13
- );
9
+ const result = await account.updateRecovery({
10
+ userId: '<USER_ID>',
11
+ secret: '<SECRET>',
12
+ password: ''
13
+ });
14
14
 
15
15
  console.log(result);
@@ -6,8 +6,8 @@ const client = new Client()
6
6
 
7
7
  const account = new Account(client);
8
8
 
9
- const result = await account.updateSession(
10
- '<SESSION_ID>' // sessionId
11
- );
9
+ const result = await account.updateSession({
10
+ sessionId: '<SESSION_ID>'
11
+ });
12
12
 
13
13
  console.log(result);
@@ -6,9 +6,9 @@ const client = new Client()
6
6
 
7
7
  const account = new Account(client);
8
8
 
9
- const result = await account.updateVerification(
10
- '<USER_ID>', // userId
11
- '<SECRET>' // secret
12
- );
9
+ const result = await account.updateVerification({
10
+ userId: '<USER_ID>',
11
+ secret: '<SECRET>'
12
+ });
13
13
 
14
14
  console.log(result);
@@ -6,11 +6,11 @@ const client = new Client()
6
6
 
7
7
  const avatars = new Avatars(client);
8
8
 
9
- const result = avatars.getBrowser(
10
- Browser.AvantBrowser, // code
11
- 0, // width (optional)
12
- 0, // height (optional)
13
- -1 // quality (optional)
14
- );
9
+ const result = avatars.getBrowser({
10
+ code: Browser.AvantBrowser,
11
+ width: 0, // optional
12
+ height: 0, // optional
13
+ quality: -1 // optional
14
+ });
15
15
 
16
16
  console.log(result);
@@ -6,11 +6,11 @@ const client = new Client()
6
6
 
7
7
  const avatars = new Avatars(client);
8
8
 
9
- const result = avatars.getCreditCard(
10
- CreditCard.AmericanExpress, // code
11
- 0, // width (optional)
12
- 0, // height (optional)
13
- -1 // quality (optional)
14
- );
9
+ const result = avatars.getCreditCard({
10
+ code: CreditCard.AmericanExpress,
11
+ width: 0, // optional
12
+ height: 0, // optional
13
+ quality: -1 // optional
14
+ });
15
15
 
16
16
  console.log(result);
@@ -6,8 +6,8 @@ const client = new Client()
6
6
 
7
7
  const avatars = new Avatars(client);
8
8
 
9
- const result = avatars.getFavicon(
10
- 'https://example.com' // url
11
- );
9
+ const result = avatars.getFavicon({
10
+ url: 'https://example.com'
11
+ });
12
12
 
13
13
  console.log(result);
@@ -6,11 +6,11 @@ const client = new Client()
6
6
 
7
7
  const avatars = new Avatars(client);
8
8
 
9
- const result = avatars.getFlag(
10
- Flag.Afghanistan, // code
11
- 0, // width (optional)
12
- 0, // height (optional)
13
- -1 // quality (optional)
14
- );
9
+ const result = avatars.getFlag({
10
+ code: Flag.Afghanistan,
11
+ width: 0, // optional
12
+ height: 0, // optional
13
+ quality: -1 // optional
14
+ });
15
15
 
16
16
  console.log(result);
@@ -6,10 +6,10 @@ const client = new Client()
6
6
 
7
7
  const avatars = new Avatars(client);
8
8
 
9
- const result = avatars.getImage(
10
- 'https://example.com', // url
11
- 0, // width (optional)
12
- 0 // height (optional)
13
- );
9
+ const result = avatars.getImage({
10
+ url: 'https://example.com',
11
+ width: 0, // optional
12
+ height: 0 // optional
13
+ });
14
14
 
15
15
  console.log(result);