@supabase/auth-js 2.73.0-rc.5 → 2.80.1-canary.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 (89) hide show
  1. package/README.md +95 -3
  2. package/dist/main/GoTrueAdminApi.js.map +1 -1
  3. package/dist/main/GoTrueClient.d.ts.map +1 -1
  4. package/dist/main/GoTrueClient.js +18 -18
  5. package/dist/main/GoTrueClient.js.map +1 -1
  6. package/dist/main/lib/base64url.js +10 -11
  7. package/dist/main/lib/base64url.js.map +1 -1
  8. package/dist/main/lib/error-codes.d.ts +1 -1
  9. package/dist/main/lib/error-codes.d.ts.map +1 -1
  10. package/dist/main/lib/errors.d.ts.map +1 -1
  11. package/dist/main/lib/errors.js +7 -7
  12. package/dist/main/lib/errors.js.map +1 -1
  13. package/dist/main/lib/fetch.d.ts +2 -2
  14. package/dist/main/lib/fetch.d.ts.map +1 -1
  15. package/dist/main/lib/fetch.js +8 -9
  16. package/dist/main/lib/fetch.js.map +1 -1
  17. package/dist/main/lib/helpers.d.ts +1 -1
  18. package/dist/main/lib/helpers.d.ts.map +1 -1
  19. package/dist/main/lib/helpers.js +34 -24
  20. package/dist/main/lib/helpers.js.map +1 -1
  21. package/dist/main/lib/local-storage.js +1 -2
  22. package/dist/main/lib/local-storage.js.map +1 -1
  23. package/dist/main/lib/locks.js +3 -3
  24. package/dist/main/lib/locks.js.map +1 -1
  25. package/dist/main/lib/polyfills.js +1 -2
  26. package/dist/main/lib/polyfills.js.map +1 -1
  27. package/dist/main/lib/types.d.ts +122 -122
  28. package/dist/main/lib/types.d.ts.map +1 -1
  29. package/dist/main/lib/version.d.ts +1 -1
  30. package/dist/main/lib/version.d.ts.map +1 -1
  31. package/dist/main/lib/version.js +7 -1
  32. package/dist/main/lib/version.js.map +1 -1
  33. package/dist/main/lib/web3/ethereum.d.ts +9 -9
  34. package/dist/main/lib/web3/ethereum.d.ts.map +1 -1
  35. package/dist/main/lib/web3/ethereum.js +4 -5
  36. package/dist/main/lib/web3/ethereum.js.map +1 -1
  37. package/dist/main/lib/web3/solana.d.ts +4 -4
  38. package/dist/main/lib/web3/solana.d.ts.map +1 -1
  39. package/dist/main/lib/webauthn.d.ts +3 -3
  40. package/dist/main/lib/webauthn.d.ts.map +1 -1
  41. package/dist/main/lib/webauthn.dom.d.ts +9 -9
  42. package/dist/main/lib/webauthn.dom.d.ts.map +1 -1
  43. package/dist/main/lib/webauthn.errors.d.ts +1 -1
  44. package/dist/main/lib/webauthn.errors.d.ts.map +1 -1
  45. package/dist/main/lib/webauthn.errors.js +4 -4
  46. package/dist/main/lib/webauthn.errors.js.map +1 -1
  47. package/dist/main/lib/webauthn.js +11 -11
  48. package/dist/main/lib/webauthn.js.map +1 -1
  49. package/dist/module/GoTrueAdminApi.js.map +1 -1
  50. package/dist/module/GoTrueClient.d.ts.map +1 -1
  51. package/dist/module/GoTrueClient.js +19 -18
  52. package/dist/module/GoTrueClient.js.map +1 -1
  53. package/dist/module/lib/base64url.js.map +1 -1
  54. package/dist/module/lib/error-codes.d.ts +1 -1
  55. package/dist/module/lib/error-codes.d.ts.map +1 -1
  56. package/dist/module/lib/errors.d.ts.map +1 -1
  57. package/dist/module/lib/fetch.d.ts +2 -2
  58. package/dist/module/lib/fetch.d.ts.map +1 -1
  59. package/dist/module/lib/fetch.js.map +1 -1
  60. package/dist/module/lib/helpers.d.ts +1 -1
  61. package/dist/module/lib/helpers.d.ts.map +1 -1
  62. package/dist/module/lib/helpers.js.map +1 -1
  63. package/dist/module/lib/locks.js.map +1 -1
  64. package/dist/module/lib/polyfills.js.map +1 -1
  65. package/dist/module/lib/types.d.ts +122 -122
  66. package/dist/module/lib/types.d.ts.map +1 -1
  67. package/dist/module/lib/version.d.ts +1 -1
  68. package/dist/module/lib/version.d.ts.map +1 -1
  69. package/dist/module/lib/version.js +7 -1
  70. package/dist/module/lib/version.js.map +1 -1
  71. package/dist/module/lib/web3/ethereum.d.ts +9 -9
  72. package/dist/module/lib/web3/ethereum.d.ts.map +1 -1
  73. package/dist/module/lib/web3/ethereum.js.map +1 -1
  74. package/dist/module/lib/web3/solana.d.ts +4 -4
  75. package/dist/module/lib/web3/solana.d.ts.map +1 -1
  76. package/dist/module/lib/webauthn.d.ts +3 -3
  77. package/dist/module/lib/webauthn.d.ts.map +1 -1
  78. package/dist/module/lib/webauthn.dom.d.ts +9 -9
  79. package/dist/module/lib/webauthn.dom.d.ts.map +1 -1
  80. package/dist/module/lib/webauthn.errors.d.ts +1 -1
  81. package/dist/module/lib/webauthn.errors.d.ts.map +1 -1
  82. package/dist/module/lib/webauthn.errors.js.map +1 -1
  83. package/dist/module/lib/webauthn.js +1 -1
  84. package/dist/module/lib/webauthn.js.map +1 -1
  85. package/package.json +13 -34
  86. package/src/GoTrueClient.ts +6 -9
  87. package/src/lib/types.ts +7 -7
  88. package/src/lib/version.ts +7 -1
  89. package/src/lib/webauthn.dom.ts +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supabase/auth-js",
3
- "version": "2.73.0-rc.5",
3
+ "version": "2.80.1-canary.0",
4
4
  "private": false,
5
5
  "description": "Official client library for Supabase Auth",
6
6
  "keywords": [
@@ -9,8 +9,8 @@
9
9
  "auth",
10
10
  "authentication"
11
11
  ],
12
- "homepage": "https://github.com/supabase/auth-js",
13
- "bugs": "https://github.com/supabase/auth-js/issues",
12
+ "homepage": "https://github.com/supabase/js-client-libs/tree/main/packages/core/auth-js",
13
+ "bugs": "https://github.com/supabase/js-client-libs/issues",
14
14
  "license": "MIT",
15
15
  "author": "Supabase",
16
16
  "files": [
@@ -20,16 +20,19 @@
20
20
  "main": "dist/main/index.js",
21
21
  "module": "dist/module/index.js",
22
22
  "types": "dist/module/index.d.ts",
23
- "repository": "github:supabase/auth-js",
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "https://github.com/supabase/js-client-libs.git",
26
+ "directory": "packages/core/auth-js"
27
+ },
24
28
  "scripts": {
25
29
  "clean": "rimraf dist docs",
26
30
  "coverage": "echo \"run npm test\"",
27
- "format": "prettier --write \"{src,test}/**/*.ts\"",
28
- "build": "genversion src/lib/version.ts --es6 && run-s clean format build:* && run-s lint",
31
+ "build:node18": "npm run clean && npm run build:main && npm run build:module",
32
+ "build": "npm run clean && npx nx build:main auth-js && npx nx build:module auth-js",
29
33
  "build:main": "tsc -p tsconfig.json",
30
34
  "build:module": "tsc -p tsconfig.module.json",
31
- "lint": "eslint ./src/**/* test/**/*.test.ts",
32
- "test": "run-s test:clean test:infra test:suite test:clean",
35
+ "test:auth": "npm run test:clean && npm run test:infra && npm run test:suite && npm run test:clean",
33
36
  "test:suite": "npm --prefix ./test run test",
34
37
  "test:infra": "cd infra && docker compose down && docker compose pull && docker compose up -d && sleep 30",
35
38
  "test:clean": "cd infra && docker compose down",
@@ -37,34 +40,10 @@
37
40
  "docs:json": "typedoc --json docs/v2/spec.json --excludeExternals --excludePrivate --excludeProtected src/index.ts"
38
41
  },
39
42
  "dependencies": {
40
- "@supabase/node-fetch": "^2.6.14"
43
+ "@supabase/node-fetch": "2.6.15"
41
44
  },
42
45
  "devDependencies": {
43
- "@types/faker": "^5.1.6",
44
- "@types/jest": "^28.1.6",
45
- "@types/jsonwebtoken": "^8.5.6",
46
- "@types/node": "^18.16.19",
47
- "@types/node-fetch": "^2.6.4",
48
- "@typescript-eslint/eslint-plugin": "^5.30.7",
49
- "@typescript-eslint/parser": "^5.30.7",
50
- "eslint": "^8.20.0",
51
- "eslint-config-prettier": "^8.5.0",
52
- "eslint-config-standard": "^17.0.0",
53
- "eslint-plugin-import": "^2.26.0",
54
- "eslint-plugin-node": "^11.1.0",
55
- "eslint-plugin-promise": "^6.0.0",
56
- "faker": "^5.3.1",
57
- "genversion": "^3.1.1",
58
46
  "jest": "^28.1.3",
59
- "jest-environment-jsdom": "^28.1.3",
60
- "jest-mock-server": "^0.1.0",
61
- "jsonwebtoken": "^9.0.0",
62
- "npm-run-all": "^4.1.5",
63
- "prettier": "2.7.1",
64
- "rimraf": "^3.0.2",
65
- "semantic-release-plugin-update-version-in-files": "^1.1.0",
66
- "ts-jest": "^28.0.7",
67
- "typedoc": "^0.23.28",
68
- "typescript": "^4.7.4"
47
+ "ts-jest": "^28.0.7"
69
48
  }
70
49
  }
@@ -3022,8 +3022,8 @@ export default class GoTrueClient {
3022
3022
  ...(params.factorType === 'phone'
3023
3023
  ? { phone: params.phone }
3024
3024
  : params.factorType === 'totp'
3025
- ? { issuer: params.issuer }
3026
- : {}),
3025
+ ? { issuer: params.issuer }
3026
+ : {}),
3027
3027
  }
3028
3028
 
3029
3029
  const { data, error } = (await _request(this.fetch, 'POST', `${this.url}/factors`, {
@@ -3072,12 +3072,9 @@ export default class GoTrueClient {
3072
3072
  | Prettify<
3073
3073
  StrictOmit<MFAVerifyWebauthnParams, 'webauthn'> & {
3074
3074
  webauthn: Prettify<
3075
- | StrictOmit<
3076
- MFAVerifyWebauthnParamFields['webauthn'],
3077
- 'credential_response'
3078
- > & {
3079
- credential_response: PublicKeyCredentialJSON
3080
- }
3075
+ StrictOmit<MFAVerifyWebauthnParamFields['webauthn'], 'credential_response'> & {
3076
+ credential_response: PublicKeyCredentialJSON
3077
+ }
3081
3078
  >
3082
3079
  }
3083
3080
  >,
@@ -3271,7 +3268,7 @@ export default class GoTrueClient {
3271
3268
  for (const factor of user?.factors ?? []) {
3272
3269
  data.all.push(factor)
3273
3270
  if (factor.status === 'verified') {
3274
- ;(data[factor.factor_type] as typeof factor[]).push(factor)
3271
+ ;(data[factor.factor_type] as (typeof factor)[]).push(factor)
3275
3272
  }
3276
3273
  }
3277
3274
 
package/src/lib/types.ts CHANGED
@@ -111,7 +111,7 @@ export type GoTrueClientOptions = {
111
111
 
112
112
  const WeakPasswordReasons = ['length', 'characters', 'pwned'] as const
113
113
 
114
- export type WeakPasswordReasons = typeof WeakPasswordReasons[number]
114
+ export type WeakPasswordReasons = (typeof WeakPasswordReasons)[number]
115
115
  export type WeakPassword = {
116
116
  reasons: WeakPasswordReasons[]
117
117
  message: string
@@ -266,7 +266,7 @@ const AMRMethods = [
266
266
  'web3',
267
267
  ] as const
268
268
 
269
- export type AMRMethod = typeof AMRMethods[number] | (string & {})
269
+ export type AMRMethod = (typeof AMRMethods)[number] | (string & {})
270
270
 
271
271
  /**
272
272
  * An authentication methord reference (AMR) entry.
@@ -305,14 +305,14 @@ const FactorTypes = ['totp', 'phone', 'webauthn'] as const
305
305
  /**
306
306
  * Type of factor. `totp` and `phone` supported with this version
307
307
  */
308
- export type FactorType = typeof FactorTypes[number]
308
+ export type FactorType = (typeof FactorTypes)[number]
309
309
 
310
310
  const FactorVerificationStatuses = ['verified', 'unverified'] as const
311
311
 
312
312
  /**
313
313
  * The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`
314
314
  */
315
- type FactorVerificationStatus = typeof FactorVerificationStatuses[number]
315
+ type FactorVerificationStatus = (typeof FactorVerificationStatuses)[number]
316
316
 
317
317
  /**
318
318
  * A MFA factor.
@@ -323,7 +323,7 @@ type FactorVerificationStatus = typeof FactorVerificationStatuses[number]
323
323
  */
324
324
  export type Factor<
325
325
  Type extends FactorType = FactorType,
326
- Status extends FactorVerificationStatus = typeof FactorVerificationStatuses[number]
326
+ Status extends FactorVerificationStatus = (typeof FactorVerificationStatuses)[number],
327
327
  > = {
328
328
  /** ID of the factor. */
329
329
  id: string
@@ -938,7 +938,7 @@ type MFAChallengeParamsBase = {
938
938
  }
939
939
 
940
940
  const MFATOTPChannels = ['sms', 'whatsapp'] as const
941
- export type MFATOTPChannel = typeof MFATOTPChannels[number]
941
+ export type MFATOTPChannel = (typeof MFATOTPChannels)[number]
942
942
 
943
943
  export type MFAChallengeTOTPParams = Prettify<MFAChallengeParamsBase>
944
944
 
@@ -1447,4 +1447,4 @@ export interface JWK {
1447
1447
  }
1448
1448
 
1449
1449
  export const SIGN_OUT_SCOPES = ['global', 'local', 'others'] as const
1450
- export type SignOutScope = typeof SIGN_OUT_SCOPES[number]
1450
+ export type SignOutScope = (typeof SIGN_OUT_SCOPES)[number]
@@ -1 +1,7 @@
1
- export const version = '2.73.0-rc.5'
1
+ // Generated automatically during releases by scripts/update-version-files.ts
2
+ // This file provides runtime access to the package version for:
3
+ // - HTTP request headers (e.g., X-Client-Info header for API requests)
4
+ // - Debugging and support (identifying which version is running)
5
+ // - Telemetry and logging (version reporting in errors/analytics)
6
+ // - Ensuring build artifacts match the published package version
7
+ export const version = '2.80.1-canary.0'
@@ -535,7 +535,7 @@ export type PublicKeyCredentialJSON = RegistrationResponseJSON | AuthenticationR
535
535
  * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/PublicKeyCredential MDN - PublicKeyCredential}
536
536
  */
537
537
  export interface PublicKeyCredentialFuture<
538
- T extends PublicKeyCredentialJSON = PublicKeyCredentialJSON
538
+ T extends PublicKeyCredentialJSON = PublicKeyCredentialJSON,
539
539
  > extends PublicKeyCredential {
540
540
  /**
541
541
  * The type of the credential (always "public-key").