diff --git a/package-lock.json b/package-lock.json index eda16b99c43..e66bf6588da 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23020,7 +23020,7 @@ }, "packages/backend-core": { "name": "@clerk/backend-core", - "version": "0.6.4-staging.0", + "version": "0.6.4-alpha.0", "license": "MIT", "dependencies": { "camelcase-keys": "^7.0.1", @@ -23049,10 +23049,10 @@ }, "packages/clerk-js": { "name": "@clerk/clerk-js", - "version": "3.0.1-staging.0", + "version": "3.0.1-alpha.0", "license": "MIT", "dependencies": { - "@clerk/types": "^2.0.1-staging.0", + "@clerk/types": "^2.0.1-alpha.0", "@popperjs/core": "^2.4.4", "browser-tabs-lock": "^1.2.15", "classnames": "^2.3.1", @@ -23072,7 +23072,7 @@ "@babel/preset-env": "^7.12.1", "@babel/preset-react": "^7.12.5", "@babel/preset-typescript": "^7.12.1", - "@clerk/shared": "^0.0.16-staging.0", + "@clerk/shared": "^0.0.16-alpha.0", "@pmmmwh/react-refresh-webpack-plugin": "^0.5.2", "@svgr/webpack": "^6.2.1", "@testing-library/dom": "^7.28.1", @@ -23155,10 +23155,10 @@ }, "packages/edge": { "name": "@clerk/edge", - "version": "1.0.1-staging.0", + "version": "1.0.1-alpha.0", "license": "MIT", "dependencies": { - "@clerk/backend-core": "^0.6.4-staging.0", + "@clerk/backend-core": "^0.6.4-alpha.0", "@peculiar/webcrypto": "^1.2.3", "next": "^12.0.7" }, @@ -23181,15 +23181,15 @@ }, "packages/expo": { "name": "@clerk/clerk-expo", - "version": "0.8.18-staging.0", + "version": "0.8.18-alpha.0", "license": "MIT", "dependencies": { - "@clerk/clerk-js": "^3.0.1-staging.0", - "@clerk/clerk-react": "^3.0.1-staging.0", + "@clerk/clerk-js": "^3.0.1-alpha.0", + "@clerk/clerk-react": "^3.0.1-alpha.0", "base-64": "^1.0.0" }, "devDependencies": { - "@clerk/types": "^2.0.1-staging.0", + "@clerk/types": "^2.0.1-alpha.0", "@types/jest": "^27.4.0", "@types/node": "^16.11.9", "@types/react": "^17.0.39", @@ -23216,13 +23216,13 @@ }, "packages/nextjs": { "name": "@clerk/nextjs", - "version": "3.0.1-staging.0", + "version": "3.0.1-alpha.0", "license": "MIT", "dependencies": { - "@clerk/clerk-react": "^3.0.1-staging.0", - "@clerk/clerk-sdk-node": "^3.0.1-staging.0", - "@clerk/edge": "^1.0.1-staging.0", - "@clerk/types": "^2.0.1-staging.0", + "@clerk/clerk-react": "^3.0.1-alpha.0", + "@clerk/clerk-sdk-node": "^3.0.1-alpha.0", + "@clerk/edge": "^1.0.1-alpha.0", + "@clerk/types": "^2.0.1-alpha.0", "tslib": "^2.3.1" }, "devDependencies": { @@ -23252,10 +23252,10 @@ }, "packages/react": { "name": "@clerk/clerk-react", - "version": "3.0.1-staging.0", + "version": "3.0.1-alpha.0", "license": "MIT", "dependencies": { - "@clerk/types": "^2.0.1-staging.0", + "@clerk/types": "^2.0.1-alpha.0", "tslib": "^2.3.1" }, "devDependencies": { @@ -23292,12 +23292,12 @@ }, "packages/remix": { "name": "@clerk/remix", - "version": "0.1.1-staging.0", + "version": "0.1.1-alpha.0", "license": "MIT", "dependencies": { - "@clerk/clerk-react": "^3.0.1-staging.0", - "@clerk/clerk-sdk-node": "^3.0.1-staging.0", - "@clerk/types": "^2.0.1-staging.0", + "@clerk/clerk-react": "^3.0.1-alpha.0", + "@clerk/clerk-sdk-node": "^3.0.1-alpha.0", + "@clerk/types": "^2.0.1-alpha.0", "cookie": "^0.4.2", "tslib": "^2.3.1" }, @@ -23338,10 +23338,10 @@ }, "packages/sdk-node": { "name": "@clerk/clerk-sdk-node", - "version": "3.0.1-staging.0", + "version": "3.0.1-alpha.0", "license": "MIT", "dependencies": { - "@clerk/backend-core": "^0.6.4-staging.0", + "@clerk/backend-core": "^0.6.4-alpha.0", "@peculiar/webcrypto": "^1.2.3", "camelcase-keys": "^6.2.2", "cookies": "^0.8.0", @@ -23418,12 +23418,12 @@ }, "packages/shared": { "name": "@clerk/shared", - "version": "0.0.16-staging.0", + "version": "0.0.16-alpha.0", "devDependencies": { "@babel/core": "^7.13.14", "@babel/preset-env": "^7.13.12", "@babel/preset-react": "^7.13.13", - "@clerk/types": "^2.0.1-staging.0", + "@clerk/types": "^2.0.1-alpha.0", "@popperjs/core": "^2.5.4", "@sentry/browser": "^6.3.0", "@svgr/webpack": "^6.2.1", @@ -23477,7 +23477,7 @@ }, "packages/types": { "name": "@clerk/types", - "version": "2.0.1-staging.0", + "version": "2.0.1-alpha.0", "license": "MIT", "devDependencies": { "@types/jest": "^27.4.0", @@ -24806,9 +24806,9 @@ "@clerk/clerk-expo": { "version": "file:packages/expo", "requires": { - "@clerk/clerk-js": "^3.0.1-staging.0", - "@clerk/clerk-react": "^3.0.1-staging.0", - "@clerk/types": "^2.0.1-staging.0", + "@clerk/clerk-js": "^3.0.1-alpha.0", + "@clerk/clerk-react": "^3.0.1-alpha.0", + "@clerk/types": "^2.0.1-alpha.0", "@types/jest": "^27.4.0", "@types/node": "^16.11.9", "@types/react": "^17.0.39", @@ -24839,8 +24839,8 @@ "@babel/preset-env": "^7.12.1", "@babel/preset-react": "^7.12.5", "@babel/preset-typescript": "^7.12.1", - "@clerk/shared": "^0.0.16-staging.0", - "@clerk/types": "^2.0.1-staging.0", + "@clerk/shared": "^0.0.16-alpha.0", + "@clerk/types": "^2.0.1-alpha.0", "@pmmmwh/react-refresh-webpack-plugin": "^0.5.2", "@popperjs/core": "^2.4.4", "@svgr/webpack": "^6.2.1", @@ -24924,7 +24924,7 @@ "@clerk/clerk-react": { "version": "file:packages/react", "requires": { - "@clerk/types": "^2.0.1-staging.0", + "@clerk/types": "^2.0.1-alpha.0", "@testing-library/dom": "^7.28.1", "@testing-library/jest-dom": "^5.11.6", "@testing-library/react": "^11.2.1", @@ -24956,7 +24956,7 @@ "@clerk/clerk-sdk-node": { "version": "file:packages/sdk-node", "requires": { - "@clerk/backend-core": "^0.6.4-staging.0", + "@clerk/backend-core": "^0.6.4-alpha.0", "@peculiar/webcrypto": "^1.2.3", "@types/cookies": "^0.7.7", "@types/express": "^4.17.11", @@ -25016,7 +25016,7 @@ "@clerk/edge": { "version": "file:packages/edge", "requires": { - "@clerk/backend-core": "^0.6.4-staging.0", + "@clerk/backend-core": "^0.6.4-alpha.0", "@peculiar/webcrypto": "^1.2.3", "@types/jest": "^27.4.0", "@types/node": "^16.11.12", @@ -25037,10 +25037,10 @@ "@clerk/nextjs": { "version": "file:packages/nextjs", "requires": { - "@clerk/clerk-react": "^3.0.1-staging.0", - "@clerk/clerk-sdk-node": "^3.0.1-staging.0", - "@clerk/edge": "^1.0.1-staging.0", - "@clerk/types": "^2.0.1-staging.0", + "@clerk/clerk-react": "^3.0.1-alpha.0", + "@clerk/clerk-sdk-node": "^3.0.1-alpha.0", + "@clerk/edge": "^1.0.1-alpha.0", + "@clerk/types": "^2.0.1-alpha.0", "@types/jest": "^27.4.0", "@types/node": "^16.11.9", "@types/react": "^17.0.39", @@ -25065,9 +25065,9 @@ "@clerk/remix": { "version": "file:packages/remix", "requires": { - "@clerk/clerk-react": "^3.0.1-staging.0", - "@clerk/clerk-sdk-node": "^3.0.1-staging.0", - "@clerk/types": "^2.0.1-staging.0", + "@clerk/clerk-react": "^3.0.1-alpha.0", + "@clerk/clerk-sdk-node": "^3.0.1-alpha.0", + "@clerk/types": "^2.0.1-alpha.0", "@types/cookie": "^0.4.1", "@types/jest": "^27.4.0", "@types/node": "^16.11.9", @@ -25101,7 +25101,7 @@ "@babel/core": "^7.13.14", "@babel/preset-env": "^7.13.12", "@babel/preset-react": "^7.13.13", - "@clerk/types": "^2.0.1-staging.0", + "@clerk/types": "^2.0.1-alpha.0", "@popperjs/core": "^2.5.4", "@sentry/browser": "^6.3.0", "@svgr/webpack": "^6.2.1", diff --git a/packages/backend-core/CHANGELOG.md b/packages/backend-core/CHANGELOG.md index d61d068674f..f6c427e43b7 100644 --- a/packages/backend-core/CHANGELOG.md +++ b/packages/backend-core/CHANGELOG.md @@ -3,250 +3,176 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. -### [0.6.1](https://github.com/clerkinc/javascript/compare/@clerk/backend-core@0.6.0...@clerk/backend-core@0.6.1) (2022-03-14) - +### [0.6.4-alpha.0](https://github.com/clerkinc/javascript/compare/@clerk/backend-core@0.6.4-staging.0...@clerk/backend-core@0.6.4-alpha.0) (2022-03-19) -### Bug Fixes +**Note:** Version bump only for package @clerk/backend-core -* **clerk-sdk-node:** Properly stringify metadata params in InvitationsAPI ([5fde7cb](https://github.com/clerkinc/javascript/commit/5fde7cbfe2f439d7531a937651351f29523b0dd7)) +### [0.6.1](https://github.com/clerkinc/javascript/compare/@clerk/backend-core@0.6.0...@clerk/backend-core@0.6.1) (2022-03-14) +### Bug Fixes +- **clerk-sdk-node:** Properly stringify metadata params in InvitationsAPI ([5fde7cb](https://github.com/clerkinc/javascript/commit/5fde7cbfe2f439d7531a937651351f29523b0dd7)) ## [0.6.0](https://github.com/clerkinc/javascript/compare/@clerk/backend-core@0.5.2...@clerk/backend-core@0.6.0) (2022-03-11) - ### Features -* **types:** Support for oauth_apple ([57b675c](https://github.com/clerkinc/javascript/commit/57b675c762187d1f16cde6d2577bac71f7993438)) - +- **types:** Support for oauth_apple ([57b675c](https://github.com/clerkinc/javascript/commit/57b675c762187d1f16cde6d2577bac71f7993438)) ### Bug Fixes -* **backend-core:** Correctly use the forwarded-proto value ([1dddf13](https://github.com/clerkinc/javascript/commit/1dddf134c2342480d2b406220acffb5fdd54a400)) -* **backend-core:** Make sure to check cross-origin in more cases ([db2360d](https://github.com/clerkinc/javascript/commit/db2360d84fbc9ce4cf62e0698099b59ad4bfc83c)) -* **backend-core:** More robust cross-origin check for dev/prod ([234ac48](https://github.com/clerkinc/javascript/commit/234ac487f56f235760449c755ed29869b511acab)) - - +- **backend-core:** Correctly use the forwarded-proto value ([1dddf13](https://github.com/clerkinc/javascript/commit/1dddf134c2342480d2b406220acffb5fdd54a400)) +- **backend-core:** Make sure to check cross-origin in more cases ([db2360d](https://github.com/clerkinc/javascript/commit/db2360d84fbc9ce4cf62e0698099b59ad4bfc83c)) +- **backend-core:** More robust cross-origin check for dev/prod ([234ac48](https://github.com/clerkinc/javascript/commit/234ac487f56f235760449c755ed29869b511acab)) ### [0.5.2](https://github.com/clerkinc/javascript/compare/@clerk/backend-core@0.5.2-staging.0...@clerk/backend-core@0.5.2) (2022-03-09) **Note:** Version bump only for package @clerk/backend-core - - - - ### [0.5.1](https://github.com/clerkinc/javascript/compare/@clerk/backend-core@0.5.0...@clerk/backend-core@0.5.1) (2022-03-04) - ### Bug Fixes -* **backend-core:** Add JWTPayload orgs claim type ([32bb54d](https://github.com/clerkinc/javascript/commit/32bb54d76339e3fbef6ce29bc9e77dd6ebc51b3b)) - - +- **backend-core:** Add JWTPayload orgs claim type ([32bb54d](https://github.com/clerkinc/javascript/commit/32bb54d76339e3fbef6ce29bc9e77dd6ebc51b3b)) ## [0.5.0](https://github.com/clerkinc/javascript/compare/@clerk/backend-core@0.4.4...@clerk/backend-core@0.5.0) (2022-03-04) - ### Features -* **backend-core:** Organizations API ([f4dde55](https://github.com/clerkinc/javascript/commit/f4dde550190d3b4f894e17f5784c29f934daab40)) - - +- **backend-core:** Organizations API ([f4dde55](https://github.com/clerkinc/javascript/commit/f4dde550190d3b4f894e17f5784c29f934daab40)) ### [0.4.4](https://github.com/clerkinc/javascript/compare/@clerk/backend-core@0.4.4-staging.0...@clerk/backend-core@0.4.4) (2022-02-24) **Note:** Version bump only for package @clerk/backend-core - - - - ### [0.4.4-staging.0](https://github.com/clerkinc/javascript/compare/@clerk/backend-core@0.4.3...@clerk/backend-core@0.4.4-staging.0) (2022-02-17) **Note:** Version bump only for package @clerk/backend-core - - - - ### [0.4.3](https://github.com/clerkinc/javascript/compare/@clerk/backend-core@0.4.2...@clerk/backend-core@0.4.3) (2022-02-16) - ### Bug Fixes -* **backend-core:** Include tslib independently ([9511d3e](https://github.com/clerkinc/javascript/commit/9511d3ef5c1f3e862926ee764134056274e1334a)) - - +- **backend-core:** Include tslib independently ([9511d3e](https://github.com/clerkinc/javascript/commit/9511d3ef5c1f3e862926ee764134056274e1334a)) ### [0.4.2](https://github.com/clerkinc/javascript/compare/@clerk/backend-core@0.4.1...@clerk/backend-core@0.4.2) (2022-02-16) - ### Bug Fixes -* **backend-core:** Allow username and unsafeMetadata updates via BAPI ([#45](https://github.com/clerkinc/javascript/issues/45)) ([bc89674](https://github.com/clerkinc/javascript/commit/bc8967405ff7ce51bbce32a4686aa64c87c12fed)) - - +- **backend-core:** Allow username and unsafeMetadata updates via BAPI ([#45](https://github.com/clerkinc/javascript/issues/45)) ([bc89674](https://github.com/clerkinc/javascript/commit/bc8967405ff7ce51bbce32a4686aa64c87c12fed)) ### [0.4.1](https://github.com/clerkinc/javascript/compare/@clerk/backend-core@0.4.1-staging.0...@clerk/backend-core@0.4.1) (2022-02-14) **Note:** Version bump only for package @clerk/backend-core - - - - ### [0.4.1-staging.0](https://github.com/clerkinc/javascript/compare/@clerk/backend-core@0.4.0...@clerk/backend-core@0.4.1-staging.0) (2022-02-11) - ### Features -* **clerk-sdk-node:** Deprecate Session named middleware, introduce withAuth, requireAuth ([4e69553](https://github.com/clerkinc/javascript/commit/4e695535e41fe7c135cbf303a0d021e7b7d30f7d)) - - +- **clerk-sdk-node:** Deprecate Session named middleware, introduce withAuth, requireAuth ([4e69553](https://github.com/clerkinc/javascript/commit/4e695535e41fe7c135cbf303a0d021e7b7d30f7d)) ## [0.4.0](https://github.com/clerkinc/javascript/compare/@clerk/backend-core@0.3.0...@clerk/backend-core@0.4.0) (2022-02-03) - ### Features -* **backend-core:** Support for skipPasswordChecks param during user creation ([79798ce](https://github.com/clerkinc/javascript/commit/79798ce1deab13e2272579919848a81c682a0590)) - - +- **backend-core:** Support for skipPasswordChecks param during user creation ([79798ce](https://github.com/clerkinc/javascript/commit/79798ce1deab13e2272579919848a81c682a0590)) ## [0.3.0](https://github.com/clerkinc/javascript/compare/@clerk/backend-core@0.2.2...@clerk/backend-core@0.3.0) (2022-02-02) - ### Features -* **backend-core,clerk-sdk-node,edge:** Add support to verify azp session token claim ([eab1c8c](https://github.com/clerkinc/javascript/commit/eab1c8c8a43960fee2da9c10a52c3915cd37f45c)) - +- **backend-core,clerk-sdk-node,edge:** Add support to verify azp session token claim ([eab1c8c](https://github.com/clerkinc/javascript/commit/eab1c8c8a43960fee2da9c10a52c3915cd37f45c)) ### Bug Fixes -* **backend-core:** Add [@throws](https://github.com/throws) jsdoc ([a7edf92](https://github.com/clerkinc/javascript/commit/a7edf923b4fe0bd1bbbfff540c1c870b6aa081b0)) -* **backend-core:** Correct handling of expired tokens ([bf7ed36](https://github.com/clerkinc/javascript/commit/bf7ed361e0a8ee4bf1fb539fd98e8e650cae6209)) - - +- **backend-core:** Add [@throws](https://github.com/throws) jsdoc ([a7edf92](https://github.com/clerkinc/javascript/commit/a7edf923b4fe0bd1bbbfff540c1c870b6aa081b0)) +- **backend-core:** Correct handling of expired tokens ([bf7ed36](https://github.com/clerkinc/javascript/commit/bf7ed361e0a8ee4bf1fb539fd98e8e650cae6209)) ### [0.2.2](https://github.com/clerkinc/javascript/compare/@clerk/backend-core@0.2.1...@clerk/backend-core@0.2.2) (2022-01-28) - ### Bug Fixes -* **backend-core:** Remove the no-referrer check for interstitial ([4853caa](https://github.com/clerkinc/javascript/commit/4853caaf859b918faea66d83ec5c8aa430f09d9a)) - - +- **backend-core:** Remove the no-referrer check for interstitial ([4853caa](https://github.com/clerkinc/javascript/commit/4853caaf859b918faea66d83ec5c8aa430f09d9a)) ### [0.2.1](https://github.com/clerkinc/javascript/compare/@clerk/backend-core@0.2.0...@clerk/backend-core@0.2.1) (2022-01-26) - ### Bug Fixes -* **backend-core:** Address the case for cross-origin development in authState ([fd6dc37](https://github.com/clerkinc/javascript/commit/fd6dc37a49c04b191889d32441bc9345bee01362)) -* **backend-core:** Enhancement of the auth state algorithm ([27caa19](https://github.com/clerkinc/javascript/commit/27caa1988e12d0b2562bb97c04439adc0467983d)) - - +- **backend-core:** Address the case for cross-origin development in authState ([fd6dc37](https://github.com/clerkinc/javascript/commit/fd6dc37a49c04b191889d32441bc9345bee01362)) +- **backend-core:** Enhancement of the auth state algorithm ([27caa19](https://github.com/clerkinc/javascript/commit/27caa1988e12d0b2562bb97c04439adc0467983d)) ## [0.2.0](https://github.com/clerkinc/javascript/compare/@clerk/backend-core@0.1.1...@clerk/backend-core@0.2.0) (2022-01-25) - ### Features -* **backend-core:** Add Web3Wallet support ([220e438](https://github.com/clerkinc/javascript/commit/220e438e6b7be2bb39849dfd8492b3dbf4909f43)) - +- **backend-core:** Add Web3Wallet support ([220e438](https://github.com/clerkinc/javascript/commit/220e438e6b7be2bb39849dfd8492b3dbf4909f43)) ### Bug Fixes -* **backend-core:** Additional exp skew checks ([4ebfcc9](https://github.com/clerkinc/javascript/commit/4ebfcc9bc1852230e57671b02d3f57b9b6ef04c9)) -* **backend-core:** Consistent error messages ([f4a4805](https://github.com/clerkinc/javascript/commit/f4a4805136233a9d491be1ae8691091151418107)) -* **backend-core:** Correct Nullable export ([1395691](https://github.com/clerkinc/javascript/commit/1395691360ad52fb236ea1f2917289c9e317751d)) -* **backend-core:** Remove nbf check temporarily ([1a6229a](https://github.com/clerkinc/javascript/commit/1a6229a66ed980fddc60ee5cbd026cb5cf6cf7bb)) - +- **backend-core:** Additional exp skew checks ([4ebfcc9](https://github.com/clerkinc/javascript/commit/4ebfcc9bc1852230e57671b02d3f57b9b6ef04c9)) +- **backend-core:** Consistent error messages ([f4a4805](https://github.com/clerkinc/javascript/commit/f4a4805136233a9d491be1ae8691091151418107)) +- **backend-core:** Correct Nullable export ([1395691](https://github.com/clerkinc/javascript/commit/1395691360ad52fb236ea1f2917289c9e317751d)) +- **backend-core:** Remove nbf check temporarily ([1a6229a](https://github.com/clerkinc/javascript/commit/1a6229a66ed980fddc60ee5cbd026cb5cf6cf7bb)) ### Reverts -* Revert "chore(release): Publish" ([df705e0](https://github.com/clerkinc/javascript/commit/df705e011f025e044c61aad2983e90afd94d5662)) - - +- Revert "chore(release): Publish" ([df705e0](https://github.com/clerkinc/javascript/commit/df705e011f025e044c61aad2983e90afd94d5662)) ### [0.1.1](https://github.com/clerkinc/javascript/compare/@clerk/backend-core@0.1.0...@clerk/backend-core@0.1.1) (2022-01-20) - ### Bug Fixes -* **backend-core:** Fix User resource attributes - unsafeMetadata ([c566647](https://github.com/clerkinc/javascript/commit/c5666476908f0b4477f277d8e26bc53c28da8249)) - - +- **backend-core:** Fix User resource attributes - unsafeMetadata ([c566647](https://github.com/clerkinc/javascript/commit/c5666476908f0b4477f277d8e26bc53c28da8249)) ## [0.1.0](https://github.com/clerkinc/javascript/compare/@clerk/backend-core@0.1.0-alpha.3...@clerk/backend-core@0.1.0) (2022-01-20) **Note:** Version bump only for package @clerk/backend-core - - - - ## [0.1.0-alpha.3](https://github.com/clerkinc/javascript/compare/@clerk/backend-core@0.1.0-alpha.2...@clerk/backend-core@0.1.0-alpha.3) (2022-01-20) - ### Bug Fixes -* **backend-core:** Fix build issue ([2b60c40](https://github.com/clerkinc/javascript/commit/2b60c409fc450c77aa9585e96131de11f5924f50)) - - +- **backend-core:** Fix build issue ([2b60c40](https://github.com/clerkinc/javascript/commit/2b60c409fc450c77aa9585e96131de11f5924f50)) ## [0.1.0-alpha.2](https://github.com/clerkinc/javascript/compare/@clerk/backend-core@0.1.0-alpha.1...@clerk/backend-core@0.1.0-alpha.2) (2022-01-20) - ### Bug Fixes -* **backend-core:** Add Readme links ([12509e3](https://github.com/clerkinc/javascript/commit/12509e32f6da37902cce94949459edffa4a63718)) - - +- **backend-core:** Add Readme links ([12509e3](https://github.com/clerkinc/javascript/commit/12509e32f6da37902cce94949459edffa4a63718)) ## 0.1.0-alpha.1 (2022-01-20) - ### Features -* Add injectable loadCryptoKeyFunction ([637b854](https://github.com/clerkinc/javascript/commit/637b8547447bdfb5f1cac8718d007e665b433f70)) -* Consistent imports rule ([fb81176](https://github.com/clerkinc/javascript/commit/fb81176b9db0a95a84d19f61e15a9c65a12fc98e)) -* Init ([bd27622](https://github.com/clerkinc/javascript/commit/bd2762201f2771f137ddddd50487813c3154938e)) -* Init :fire: ([ce185fe](https://github.com/clerkinc/javascript/commit/ce185fefe20f9dcbc17e36506287af224f2cfc2e)) -* SDK Node resource and APIs from @clerk/backend-core ([6a32317](https://github.com/clerkinc/javascript/commit/6a323175f9361c32192a4a6be4139b88945a857c)) -* Update READMEs, API reference for @clerk/backend-core, minor fixes ([529c2f6](https://github.com/clerkinc/javascript/commit/529c2f629ec02895f9f049d29b5775f16ef5c6e9)) - +- Add injectable loadCryptoKeyFunction ([637b854](https://github.com/clerkinc/javascript/commit/637b8547447bdfb5f1cac8718d007e665b433f70)) +- Consistent imports rule ([fb81176](https://github.com/clerkinc/javascript/commit/fb81176b9db0a95a84d19f61e15a9c65a12fc98e)) +- Init ([bd27622](https://github.com/clerkinc/javascript/commit/bd2762201f2771f137ddddd50487813c3154938e)) +- Init :fire: ([ce185fe](https://github.com/clerkinc/javascript/commit/ce185fefe20f9dcbc17e36506287af224f2cfc2e)) +- SDK Node resource and APIs from @clerk/backend-core ([6a32317](https://github.com/clerkinc/javascript/commit/6a323175f9361c32192a4a6be4139b88945a857c)) +- Update READMEs, API reference for @clerk/backend-core, minor fixes ([529c2f6](https://github.com/clerkinc/javascript/commit/529c2f629ec02895f9f049d29b5775f16ef5c6e9)) ### Bug Fixes -* **backend-core:** Fix cross-origin detection algorithm ([fd99eae](https://github.com/clerkinc/javascript/commit/fd99eae111469c5d0028fd46b8bcbf1c5a8325b0)) -* Remove coverage folder ([e009e7d](https://github.com/clerkinc/javascript/commit/e009e7d794db052cbf74433fb0cf01203cecce4d)) - - +- **backend-core:** Fix cross-origin detection algorithm ([fd99eae](https://github.com/clerkinc/javascript/commit/fd99eae111469c5d0028fd46b8bcbf1c5a8325b0)) +- Remove coverage folder ([e009e7d](https://github.com/clerkinc/javascript/commit/e009e7d794db052cbf74433fb0cf01203cecce4d)) ## 0.1.0-alpha.0 (2022-01-20) - ### Features -* Add injectable loadCryptoKeyFunction ([637b854](https://github.com/clerkinc/javascript/commit/637b8547447bdfb5f1cac8718d007e665b433f70)) -* Consistent imports rule ([fb81176](https://github.com/clerkinc/javascript/commit/fb81176b9db0a95a84d19f61e15a9c65a12fc98e)) -* Init ([bd27622](https://github.com/clerkinc/javascript/commit/bd2762201f2771f137ddddd50487813c3154938e)) -* Init :fire: ([ce185fe](https://github.com/clerkinc/javascript/commit/ce185fefe20f9dcbc17e36506287af224f2cfc2e)) -* SDK Node resource and APIs from @clerk/backend-core ([6a32317](https://github.com/clerkinc/javascript/commit/6a323175f9361c32192a4a6be4139b88945a857c)) -* Update READMEs, API reference for @clerk/backend-core, minor fixes ([529c2f6](https://github.com/clerkinc/javascript/commit/529c2f629ec02895f9f049d29b5775f16ef5c6e9)) - +- Add injectable loadCryptoKeyFunction ([637b854](https://github.com/clerkinc/javascript/commit/637b8547447bdfb5f1cac8718d007e665b433f70)) +- Consistent imports rule ([fb81176](https://github.com/clerkinc/javascript/commit/fb81176b9db0a95a84d19f61e15a9c65a12fc98e)) +- Init ([bd27622](https://github.com/clerkinc/javascript/commit/bd2762201f2771f137ddddd50487813c3154938e)) +- Init :fire: ([ce185fe](https://github.com/clerkinc/javascript/commit/ce185fefe20f9dcbc17e36506287af224f2cfc2e)) +- SDK Node resource and APIs from @clerk/backend-core ([6a32317](https://github.com/clerkinc/javascript/commit/6a323175f9361c32192a4a6be4139b88945a857c)) +- Update READMEs, API reference for @clerk/backend-core, minor fixes ([529c2f6](https://github.com/clerkinc/javascript/commit/529c2f629ec02895f9f049d29b5775f16ef5c6e9)) ### Bug Fixes -* Remove coverage folder ([e009e7d](https://github.com/clerkinc/javascript/commit/e009e7d794db052cbf74433fb0cf01203cecce4d)) - - +- Remove coverage folder ([e009e7d](https://github.com/clerkinc/javascript/commit/e009e7d794db052cbf74433fb0cf01203cecce4d)) ## 0.0.1 (2022-01-20) - ### Features -* First version 🎊 +- First version 🎊 diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 33457f6c2bf..1e1ef723ccb 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@clerk/backend-core", - "version": "0.6.4-staging.0", + "version": "0.6.4-alpha.0", "license": "MIT", "description": "Clerk Backend API core resources and authentication utilities for JavaScript environments.", "scripts": { diff --git a/packages/clerk-js/CHANGELOG.md b/packages/clerk-js/CHANGELOG.md index 8d8dddfae48..a14ff96af21 100644 --- a/packages/clerk-js/CHANGELOG.md +++ b/packages/clerk-js/CHANGELOG.md @@ -3,219 +3,150 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. -## [3.0.0-alpha.9](https://github.com/clerkinc/javascript/compare/@clerk/clerk-js@2.17.3...@clerk/clerk-js@3.0.0-alpha.9) (2022-03-11) - -**Note:** Version bump only for package @clerk/clerk-js +### [3.0.1-alpha.0](https://github.com/clerkinc/javascript/compare/@clerk/clerk-js@3.0.1-staging.0...@clerk/clerk-js@3.0.1-alpha.0) (2022-03-19) +### Bug Fixes +- **clerk-js,clerk-react:** Move error to getToken ([84d21ce](https://github.com/clerkinc/javascript/commit/84d21ceac26843a1caa9d9d58f9c10ea2da6395e)) +- **clerk-js:** Fix signIn.prepareFirstFactor params ([e435245](https://github.com/clerkinc/javascript/commit/e4352454028099f0973203aa79e548890c6327bd)) +- **clerk-js:** Make getToken use /user endpoint for integration tokens ([b61213b](https://github.com/clerkinc/javascript/commit/b61213b4c94952e6f21dd8e036aa6815c5c38c06)) +## [3.0.0-alpha.9](https://github.com/clerkinc/javascript/compare/@clerk/clerk-js@2.17.3...@clerk/clerk-js@3.0.0-alpha.9) (2022-03-11) +**Note:** Version bump only for package @clerk/clerk-js ## [3.0.0-alpha.8](https://github.com/clerkinc/javascript/compare/@clerk/clerk-js@2.14.3...@clerk/clerk-js@3.0.0-alpha.8) (2022-02-28) - ### Features -* **types:** Add support for oauth_microsoft ([96c1cc6](https://github.com/clerkinc/javascript/commit/96c1cc6817b9bbc6917ea2773498299c1ff9b951)) - - +- **types:** Add support for oauth_microsoft ([96c1cc6](https://github.com/clerkinc/javascript/commit/96c1cc6817b9bbc6917ea2773498299c1ff9b951)) ## [3.0.0-alpha.7](https://github.com/clerkinc/javascript/compare/@clerk/clerk-js@2.14.3...@clerk/clerk-js@3.0.0-alpha.7) (2022-02-25) **Note:** Version bump only for package @clerk/clerk-js - - - - ## [3.0.0-alpha.6](https://github.com/clerkinc/javascript/compare/@clerk/clerk-js@2.13.2...@clerk/clerk-js@3.0.0-alpha.6) (2022-02-18) **Note:** Version bump only for package @clerk/clerk-js - - - - ### [2.17.6](https://github.com/clerkinc/javascript/compare/@clerk/clerk-js@2.17.6-staging.1...@clerk/clerk-js@2.17.6) (2022-03-17) **Note:** Version bump only for package @clerk/clerk-js - - - - ### [2.17.6-staging.1](https://github.com/clerkinc/javascript/compare/@clerk/clerk-js@2.17.6-staging.0...@clerk/clerk-js@2.17.6-staging.1) (2022-03-17) **Note:** Version bump only for package @clerk/clerk-js - - - - ### [2.17.4](https://github.com/clerkinc/javascript/compare/@clerk/clerk-js@2.17.3...@clerk/clerk-js@2.17.4) (2022-03-11) **Note:** Version bump only for package @clerk/clerk-js - - - - ### [2.17.3](https://github.com/clerkinc/javascript/compare/@clerk/clerk-js@2.17.3-staging.0...@clerk/clerk-js@2.17.3) (2022-03-09) **Note:** Version bump only for package @clerk/clerk-js - - - - ### [2.17.1](https://github.com/clerkinc/javascript/compare/@clerk/clerk-js@2.17.0...@clerk/clerk-js@2.17.1) (2022-03-04) - ### Bug Fixes -* **clerk-react,clerk-js,types:** Crate of API feedback fixes ([721ce72](https://github.com/clerkinc/javascript/commit/721ce7228c37b012891b2bec8caf290239164d05)) - - +- **clerk-react,clerk-js,types:** Crate of API feedback fixes ([721ce72](https://github.com/clerkinc/javascript/commit/721ce7228c37b012891b2bec8caf290239164d05)) ## [2.17.0](https://github.com/clerkinc/javascript/compare/@clerk/clerk-js@2.16.1...@clerk/clerk-js@2.17.0) (2022-03-04) - ### Features -* **clerk-js,clerk-react:** GetOrganization/s hook methods, fetching mechanism alignment ([fc11087](https://github.com/clerkinc/javascript/commit/fc110874f9a3e056cd43c773c267409dd9b318d6)) -* **clerk-js:** Add more attributes on organization models ([af010ba](https://github.com/clerkinc/javascript/commit/af010bac4b6e0519eff42d210049c7b3a6bda203)) -* **clerk-js:** Add organization basic resources ([09f9012](https://github.com/clerkinc/javascript/commit/09f90126282f757cee6f97e7eae8747abc641bb0)) -* **clerk-js:** Add useOrganization hook ([480c422](https://github.com/clerkinc/javascript/commit/480c422774472fc712afdfe6ded2677b458d3ef0)) -* **clerk-js:** Basic organization data shape tests ([0ca9a31](https://github.com/clerkinc/javascript/commit/0ca9a3114b34bfaa338e6e90f1b0d57e02b7dd58)) -* **clerk-js:** Invitation flow draft ([d6faaab](https://github.com/clerkinc/javascript/commit/d6faaabb7efec09a699c7e83ba24fd4bad199d6b)) -* **clerk-js:** Sign up next draft and fixes ([e2eef78](https://github.com/clerkinc/javascript/commit/e2eef782d644f7fd1925fee67ee81d27473255fc)) -* **clerk-js:** SignUp with organization invitation flow draft ([2a9edbd](https://github.com/clerkinc/javascript/commit/2a9edbd52916f9bc037f266d1f96269cf54023cb)) -* **clerk-react,clerk-js:** Add useOrganization hook using __unstable attribute ([1635132](https://github.com/clerkinc/javascript/commit/16351321a99945d167cbf6e6ca0efdbbbf7efe5a)) - +- **clerk-js,clerk-react:** GetOrganization/s hook methods, fetching mechanism alignment ([fc11087](https://github.com/clerkinc/javascript/commit/fc110874f9a3e056cd43c773c267409dd9b318d6)) +- **clerk-js:** Add more attributes on organization models ([af010ba](https://github.com/clerkinc/javascript/commit/af010bac4b6e0519eff42d210049c7b3a6bda203)) +- **clerk-js:** Add organization basic resources ([09f9012](https://github.com/clerkinc/javascript/commit/09f90126282f757cee6f97e7eae8747abc641bb0)) +- **clerk-js:** Add useOrganization hook ([480c422](https://github.com/clerkinc/javascript/commit/480c422774472fc712afdfe6ded2677b458d3ef0)) +- **clerk-js:** Basic organization data shape tests ([0ca9a31](https://github.com/clerkinc/javascript/commit/0ca9a3114b34bfaa338e6e90f1b0d57e02b7dd58)) +- **clerk-js:** Invitation flow draft ([d6faaab](https://github.com/clerkinc/javascript/commit/d6faaabb7efec09a699c7e83ba24fd4bad199d6b)) +- **clerk-js:** Sign up next draft and fixes ([e2eef78](https://github.com/clerkinc/javascript/commit/e2eef782d644f7fd1925fee67ee81d27473255fc)) +- **clerk-js:** SignUp with organization invitation flow draft ([2a9edbd](https://github.com/clerkinc/javascript/commit/2a9edbd52916f9bc037f266d1f96269cf54023cb)) +- **clerk-react,clerk-js:** Add useOrganization hook using \_\_unstable attribute ([1635132](https://github.com/clerkinc/javascript/commit/16351321a99945d167cbf6e6ca0efdbbbf7efe5a)) ### Bug Fixes -* **clerk-js:** Don't use ResizeObserver on old browsers ([581c5cd](https://github.com/clerkinc/javascript/commit/581c5cde9df542b7dcb6d69f61feaf480f7a0075)) -* **types:** Guarantee elements not in oauth sorting array will be sorted last ([f3c2869](https://github.com/clerkinc/javascript/commit/f3c2869bc244fc594522ef8f889055f82d31463f)) - - +- **clerk-js:** Don't use ResizeObserver on old browsers ([581c5cd](https://github.com/clerkinc/javascript/commit/581c5cde9df542b7dcb6d69f61feaf480f7a0075)) +- **types:** Guarantee elements not in oauth sorting array will be sorted last ([f3c2869](https://github.com/clerkinc/javascript/commit/f3c2869bc244fc594522ef8f889055f82d31463f)) ### [2.16.1](https://github.com/clerkinc/javascript/compare/@clerk/clerk-js@2.16.0...@clerk/clerk-js@2.16.1) (2022-03-03) - ### Bug Fixes -* **types:** Consolidate oauth provider types ([bce9ef5](https://github.com/clerkinc/javascript/commit/bce9ef5cbfe02e11fe71db3e34dbf4fd9be9c3ed)) - - +- **types:** Consolidate oauth provider types ([bce9ef5](https://github.com/clerkinc/javascript/commit/bce9ef5cbfe02e11fe71db3e34dbf4fd9be9c3ed)) ## [2.16.0](https://github.com/clerkinc/javascript/compare/@clerk/clerk-js@2.15.0...@clerk/clerk-js@2.16.0) (2022-03-02) - ### Features -* **types,clerk-js:** Introduce Notion OAuth ([#72](https://github.com/clerkinc/javascript/issues/72)) ([9e556d0](https://github.com/clerkinc/javascript/commit/9e556d00fb41dedbbd05de59947d00c720bb3d95)) - +- **types,clerk-js:** Introduce Notion OAuth ([#72](https://github.com/clerkinc/javascript/issues/72)) ([9e556d0](https://github.com/clerkinc/javascript/commit/9e556d00fb41dedbbd05de59947d00c720bb3d95)) ### Bug Fixes -* **clerk-js:** Clear invalid invitation token value ([0c5dc85](https://github.com/clerkinc/javascript/commit/0c5dc85bd69b1050bf36e7108b38868e22022e61)) - - +- **clerk-js:** Clear invalid invitation token value ([0c5dc85](https://github.com/clerkinc/javascript/commit/0c5dc85bd69b1050bf36e7108b38868e22022e61)) ## [2.15.0](https://github.com/clerkinc/javascript/compare/@clerk/clerk-js@2.14.3...@clerk/clerk-js@2.15.0) (2022-03-01) - ### Features -* **types:** Add support for oauth_microsoft ([96c1cc6](https://github.com/clerkinc/javascript/commit/96c1cc6817b9bbc6917ea2773498299c1ff9b951)) - - +- **types:** Add support for oauth_microsoft ([96c1cc6](https://github.com/clerkinc/javascript/commit/96c1cc6817b9bbc6917ea2773498299c1ff9b951)) ### [2.14.3](https://github.com/clerkinc/javascript/compare/@clerk/clerk-js@2.14.3-staging.0...@clerk/clerk-js@2.14.3) (2022-02-24) **Note:** Version bump only for package @clerk/clerk-js - - - - ### [2.14.3-staging.0](https://github.com/clerkinc/javascript/compare/@clerk/clerk-js@2.14.2-staging.0...@clerk/clerk-js@2.14.3-staging.0) (2022-02-24) - ### Features -* **clerk-js:** Introduce `UserSettings.instanceIsPasswordBased` ([f72a555](https://github.com/clerkinc/javascript/commit/f72a555f6adb38870539e9bab63cb638c04517d6)) - +- **clerk-js:** Introduce `UserSettings.instanceIsPasswordBased` ([f72a555](https://github.com/clerkinc/javascript/commit/f72a555f6adb38870539e9bab63cb638c04517d6)) ### Bug Fixes -* **clerk-js,clerk-react:** Revert user settings work ([9a70576](https://github.com/clerkinc/javascript/commit/9a70576d1a47f01e6dbbfd8704f321daddcfe590)) -* **clerk-js:** Helpful error message for sign in without factors ([9d8a050](https://github.com/clerkinc/javascript/commit/9d8a050d975fddb3e3163781d010138a888b7bf2)) -* **clerk-js:** Import Clerk CSS after shared css modules/ components ([dde2f3b](https://github.com/clerkinc/javascript/commit/dde2f3b87a0e177967ce13f087806ebff2084ff5)) -* **clerk-js:** Render instant password field for password-based instances only ([586437f](https://github.com/clerkinc/javascript/commit/586437f238723da6f03119e2069989eaabe48ddd)) -* **clerk-js:** Render instant password field for password-based instances only ([a9eefc9](https://github.com/clerkinc/javascript/commit/a9eefc967d4745a54aee0c917ce707b1a51df1be)) - - +- **clerk-js,clerk-react:** Revert user settings work ([9a70576](https://github.com/clerkinc/javascript/commit/9a70576d1a47f01e6dbbfd8704f321daddcfe590)) +- **clerk-js:** Helpful error message for sign in without factors ([9d8a050](https://github.com/clerkinc/javascript/commit/9d8a050d975fddb3e3163781d010138a888b7bf2)) +- **clerk-js:** Import Clerk CSS after shared css modules/ components ([dde2f3b](https://github.com/clerkinc/javascript/commit/dde2f3b87a0e177967ce13f087806ebff2084ff5)) +- **clerk-js:** Render instant password field for password-based instances only ([586437f](https://github.com/clerkinc/javascript/commit/586437f238723da6f03119e2069989eaabe48ddd)) +- **clerk-js:** Render instant password field for password-based instances only ([a9eefc9](https://github.com/clerkinc/javascript/commit/a9eefc967d4745a54aee0c917ce707b1a51df1be)) ### [2.14.2-staging.0](https://github.com/clerkinc/javascript/compare/@clerk/clerk-js@2.14.1-staging.0...@clerk/clerk-js@2.14.2-staging.0) (2022-02-22) - ### Features -* **clerk-js:** Allow passing of object style search params on fapiclient ([8144779](https://github.com/clerkinc/javascript/commit/8144779e37ca4b0a61ac1d452ddd0ab7ccf40f27)) - - +- **clerk-js:** Allow passing of object style search params on fapiclient ([8144779](https://github.com/clerkinc/javascript/commit/8144779e37ca4b0a61ac1d452ddd0ab7ccf40f27)) ### [2.14.1-staging.0](https://github.com/clerkinc/javascript/compare/@clerk/clerk-js@2.14.0-staging.0...@clerk/clerk-js@2.14.1-staging.0) (2022-02-17) **Note:** Version bump only for package @clerk/clerk-js - - - - ## [2.14.0-staging.0](https://github.com/clerkinc/javascript/compare/@clerk/clerk-js@2.13.3-staging.0...@clerk/clerk-js@2.14.0-staging.0) (2022-02-16) - ### Features -* **clerk-js:** Import all resources from internal.ts ([#44](https://github.com/clerkinc/javascript/issues/44)) ([5b8f6f8](https://github.com/clerkinc/javascript/commit/5b8f6f81ed3d823840a0c4d3edcbd3c8298d7d42)) - - +- **clerk-js:** Import all resources from internal.ts ([#44](https://github.com/clerkinc/javascript/issues/44)) ([5b8f6f8](https://github.com/clerkinc/javascript/commit/5b8f6f81ed3d823840a0c4d3edcbd3c8298d7d42)) ### [2.13.3-staging.0](https://github.com/clerkinc/javascript/compare/@clerk/clerk-js@2.13.2...@clerk/clerk-js@2.13.3-staging.0) (2022-02-15) - ### Features -* **clerk-js:** Introduce with `userSettings` in `SignIn` ([adccb35](https://github.com/clerkinc/javascript/commit/adccb35377b6455285dc11cbfabe0710c9035c3f)) -* **clerk-js:** Introduce with `userSettings` in `UserProfile` ([62dff26](https://github.com/clerkinc/javascript/commit/62dff26d56c7a699d0db074e863a89ddf2ee86a7)) -* **clerk-js:** Refactor signUp utils to work with userSettings ([0eb3352](https://github.com/clerkinc/javascript/commit/0eb3352cf93c35eb5de162822802124248cef840)) -* **types:** Introduce 'UserSettingsResource' ([32fcf04](https://github.com/clerkinc/javascript/commit/32fcf0477e6db4851f4de50904c02868ba1790ee)) - - +- **clerk-js:** Introduce with `userSettings` in `SignIn` ([adccb35](https://github.com/clerkinc/javascript/commit/adccb35377b6455285dc11cbfabe0710c9035c3f)) +- **clerk-js:** Introduce with `userSettings` in `UserProfile` ([62dff26](https://github.com/clerkinc/javascript/commit/62dff26d56c7a699d0db074e863a89ddf2ee86a7)) +- **clerk-js:** Refactor signUp utils to work with userSettings ([0eb3352](https://github.com/clerkinc/javascript/commit/0eb3352cf93c35eb5de162822802124248cef840)) +- **types:** Introduce 'UserSettingsResource' ([32fcf04](https://github.com/clerkinc/javascript/commit/32fcf0477e6db4851f4de50904c02868ba1790ee)) ### [2.13.2](https://github.com/clerkinc/javascript/compare/@clerk/clerk-js@2.13.1...@clerk/clerk-js@2.13.2) (2022-02-14) - ### Bug Fixes -* **clerk-js:** Remove unnecessary type assertions ([f580d4a](https://github.com/clerkinc/javascript/commit/f580d4aebfc3938ca152e7cbc529a8c948e0c311)) - - +- **clerk-js:** Remove unnecessary type assertions ([f580d4a](https://github.com/clerkinc/javascript/commit/f580d4aebfc3938ca152e7cbc529a8c948e0c311)) ### [2.13.1](https://github.com/clerkinc/javascript/compare/@clerk/clerk-js@2.13.1-staging.0...@clerk/clerk-js@2.13.1) (2022-02-14) **Note:** Version bump only for package @clerk/clerk-js - - - - ### 2.13.1-staging.0 (2022-02-11) - ### Bug Fixes -* **clerk-js:** Prevent post auth redirects in Metamask flow ([#31](https://github.com/clerkinc/javascript/issues/31)) ([052ff1e](https://github.com/clerkinc/javascript/commit/052ff1e74ad76fd97010e6d899e0eb2acb1d717c)) +- **clerk-js:** Prevent post auth redirects in Metamask flow ([#31](https://github.com/clerkinc/javascript/issues/31)) ([052ff1e](https://github.com/clerkinc/javascript/commit/052ff1e74ad76fd97010e6d899e0eb2acb1d717c)) diff --git a/packages/clerk-js/package.json b/packages/clerk-js/package.json index 3bca71e2d24..ad42414c771 100644 --- a/packages/clerk-js/package.json +++ b/packages/clerk-js/package.json @@ -1,6 +1,6 @@ { "name": "@clerk/clerk-js", - "version": "3.0.1-staging.0", + "version": "3.0.1-alpha.0", "license": "MIT", "description": "Clerk.dev JS library", "keywords": [ @@ -38,7 +38,7 @@ "test:coverage": "jest --collectCoverage" }, "dependencies": { - "@clerk/types": "^2.0.1-staging.0", + "@clerk/types": "^2.0.1-alpha.0", "@popperjs/core": "^2.4.4", "browser-tabs-lock": "^1.2.15", "classnames": "^2.3.1", @@ -58,7 +58,7 @@ "@babel/preset-env": "^7.12.1", "@babel/preset-react": "^7.12.5", "@babel/preset-typescript": "^7.12.1", - "@clerk/shared": "^0.0.16-staging.0", + "@clerk/shared": "^0.0.16-alpha.0", "@pmmmwh/react-refresh-webpack-plugin": "^0.5.2", "@svgr/webpack": "^6.2.1", "@testing-library/dom": "^7.28.1", diff --git a/packages/clerk-js/src/core/constants.ts b/packages/clerk-js/src/core/constants.ts index 962f4ed47db..fbc2e983577 100644 --- a/packages/clerk-js/src/core/constants.ts +++ b/packages/clerk-js/src/core/constants.ts @@ -8,5 +8,3 @@ export const DEV_BROWSER_SSO_JWT_KEY = 'clerk-db-jwt'; // TODO: Align these too namings as they both apply during the dev init dev browser flow. export const DEV_BROWSER_SSO_JWT_PARAMETER = '__dev_session'; export const DEV_BROWSER_SSO_JWT_HTTP_HEADER = 'Clerk-Cookie'; - -export const STRATEGY_WEB3_METAMASK_SIGNATURE = 'web3_metamask_signature'; diff --git a/packages/clerk-js/src/core/resources/Session.ts b/packages/clerk-js/src/core/resources/Session.ts index 3bc35e58453..3f799c8888f 100644 --- a/packages/clerk-js/src/core/resources/Session.ts +++ b/packages/clerk-js/src/core/resources/Session.ts @@ -1,15 +1,15 @@ +import { deepSnakeToCamel } from '@clerk/shared/utils'; import type { - GetSessionTokenOptions, PublicUserData, SessionJSON, SessionResource, SessionStatus, } from '@clerk/types'; +import { GetToken, GetTokenOptions, UserResource } from '@clerk/types/src'; import { unixEpochToDate } from 'utils/date'; import { SessionTokenCache } from '../tokenCache'; import { BaseResource, Token, User } from './internal'; -import { deepSnakeToCamel } from '@clerk/shared/utils'; export class Session extends BaseResource implements SessionResource { pathRoot = '/client/sessions'; @@ -18,7 +18,7 @@ export class Session extends BaseResource implements SessionResource { status!: SessionStatus; lastActiveAt!: Date; lastActiveToken!: Token | null; - user!: any; + user!: UserResource | null; publicUserData!: PublicUserData; expireAt!: Date; abandonAt!: Date; @@ -33,7 +33,7 @@ export class Session extends BaseResource implements SessionResource { super(); this.fromJSON(data); - this.hydrateCache(this.lastActiveToken); + this.#hydrateCache(this.lastActiveToken); } end = (): Promise => { @@ -56,53 +56,45 @@ export class Session extends BaseResource implements SessionResource { }); }; - getToken = async (options?: GetSessionTokenOptions): Promise => { - const { - leewayInSeconds = 10, - throwOnError = true, - template, - skipCache = false, - } = options || {}; + getToken: GetToken = async (options?: GetTokenOptions): Promise => { + if (!this.user) { + throw new Error('You cannot call getToken when user is null'); + } + const { leewayInSeconds = 10, template, skipCache = false } = options || {}; if (!template && leewayInSeconds >= 60) { - throw 'Leeway can not exceed the token lifespan (60 seconds)'; + throw new Error('Leeway can not exceed the token lifespan (60 seconds)'); + } + + if (!!template && this.#isLegacyIntegrationRequest(template)) { + return this.#handleLegacyIntegrationToken({ + template, + leewayInSeconds, + skipCache, + }); } // If it's a session token, retrieve it with their session id, otherwise it's a jwt template token // and retrieve it using the session id concatenated with the jwt template name. // e.g. session id is 'sess_abc12345' and jwt template name is 'haris' // The session token ID will be 'sess_abc12345' and the jwt template token ID will be 'sess_abc12345-haris' - const tokenId = template ? `${this.id}-${template}` : this.id; - const cachedEntry = skipCache ? undefined : SessionTokenCache.get({ tokenId }, leewayInSeconds); - let tokenResolver; - if (cachedEntry) { - tokenResolver = cachedEntry.tokenResolver; - } else { - const path = template - ? `${this.path()}/tokens/${template}` - : `${this.path()}/tokens`; - - tokenResolver = Token.create(path); - SessionTokenCache.set({ tokenId, tokenResolver }); + return cachedEntry.tokenResolver.then(res => res.getRawString()); } - - return tokenResolver - .then(res => res.getRawString()) - .catch(err => { - if (throwOnError) { - throw err; - } - return ''; - }); + const path = template + ? `${this.path()}/tokens/${template}` + : `${this.path()}/tokens`; + const tokenResolver = Token.create(path); + SessionTokenCache.set({ tokenId, tokenResolver }); + return tokenResolver.then(res => res.getRawString()); }; - private hydrateCache = (token: Token | null) => { + #hydrateCache = (token: Token | null) => { if (token && SessionTokenCache.size() === 0) { SessionTokenCache.set({ tokenId: this.id, @@ -111,6 +103,34 @@ export class Session extends BaseResource implements SessionResource { } }; + #isLegacyIntegrationRequest = (template: string | undefined): boolean => { + return (template || '').startsWith('integration_'); + }; + + // Can be removed once `integration_firebase` and `integration_hasura` + // are no longer supported + #handleLegacyIntegrationToken = async ( + options: GetTokenOptions, + ): Promise => { + const { template, leewayInSeconds } = options; + const cachedEntry = SessionTokenCache.get( + { tokenId: this.user!.id, audience: template }, + leewayInSeconds, + ); + if (cachedEntry) { + return cachedEntry.tokenResolver.then(res => res.getRawString()); + } + const resolver = Token.create(this.user!.pathRoot + '/tokens', { + service: template, + }); + SessionTokenCache.set({ + tokenId: this.user!.id, + audience: template, + tokenResolver: resolver, + }); + return resolver.then(res => res.getRawString()); + }; + protected fromJSON(data: SessionJSON): this { this.id = data.id; this.status = data.status; diff --git a/packages/clerk-js/src/core/resources/SignIn.ts b/packages/clerk-js/src/core/resources/SignIn.ts index 32de935800b..24d940e8117 100644 --- a/packages/clerk-js/src/core/resources/SignIn.ts +++ b/packages/clerk-js/src/core/resources/SignIn.ts @@ -1,10 +1,13 @@ -import { deepCamelToSnake, deepSnakeToCamel } from '@clerk/shared/utils/object'; +import { deepSnakeToCamel } from '@clerk/shared/utils/object'; import { Poller } from '@clerk/shared/utils/poller'; import type { AttemptFirstFactorParams, AttemptSecondFactorParams, AuthenticateWithRedirectParams, CreateMagicLinkFlowReturn, + EmailCodeConfig, + EmailLinkConfig, + PhoneCodeConfig, PrepareFirstFactorParams, PrepareSecondFactorParams, SignInCreateParams, @@ -17,6 +20,7 @@ import type { SignInStatus, UserData, VerificationResource, + Web3SignatureConfig, Web3SignatureFactor, } from '@clerk/types'; import { @@ -25,9 +29,13 @@ import { clerkVerifyEmailAddressCalledBeforeCreate, clerkVerifyWeb3WalletCalledBeforeCreate, } from 'core/errors'; -import { GenerateSignatureParams, generateSignatureWithMetamask, getMetamaskIdentifier, windowNavigate } from 'utils'; +import { + GenerateSignatureParams, + generateSignatureWithMetamask, + getMetamaskIdentifier, + windowNavigate, +} from 'utils'; -import { STRATEGY_WEB3_METAMASK_SIGNATURE } from '../constants'; import { BaseResource, Verification } from './internal'; export class SignIn extends BaseResource implements SignInResource { @@ -52,56 +60,55 @@ export class SignIn extends BaseResource implements SignInResource { create = (params: SignInCreateParams): Promise => { return this._basePost({ path: this.pathRoot, - body: deepCamelToSnake(params), + body: params, }); }; - prepareFirstFactor = (factor: PrepareFirstFactorParams): Promise => { - factor = deepCamelToSnake(factor); - let params: { - strategy: string; - email_address_id?: string; - phone_number_id?: string; - web3_wallet_id?: string; - redirect_url?: string; - } = { strategy: factor.strategy }; - + prepareFirstFactor = ( + factor: PrepareFirstFactorParams, + ): Promise => { + let config; switch (factor.strategy) { case 'email_link': - params = { - ...params, - email_address_id: factor.emailAddressId, - redirect_url: factor.redirectUrl, - }; + config = { + emailAddressId: factor.emailAddressId, + redirectUrl: factor.redirectUrl, + } as EmailLinkConfig; break; case 'email_code': - params = { ...params, email_address_id: factor.emailAddressId }; + config = { emailAddressId: factor.emailAddressId } as EmailCodeConfig; break; case 'phone_code': - params = { ...params, phone_number_id: factor.phoneNumberId }; + config = { + phoneNumberId: factor.phoneNumberId, + default: factor.default, + } as PhoneCodeConfig; break; - case STRATEGY_WEB3_METAMASK_SIGNATURE: - params = { ...params, web3_wallet_id: factor.web3WalletId }; + case 'web3_metamask_signature': + config = { web3WalletId: factor.web3WalletId } as Web3SignatureConfig; break; default: clerkInvalidStrategy('SignIn.prepareFirstFactor', factor.strategy); } - return this._basePost({ - body: params, + body: { ...config, strategy: factor.strategy }, action: 'prepare_first_factor', }); }; - attemptFirstFactor = (params: AttemptFirstFactorParams): Promise => { - params = deepCamelToSnake(params); + attemptFirstFactor = ( + params: AttemptFirstFactorParams, + ): Promise => { return this._basePost({ body: params, action: 'attempt_first_factor', }); }; - createMagicLinkFlow = (): CreateMagicLinkFlowReturn => { + createMagicLinkFlow = (): CreateMagicLinkFlowReturn< + SignInStartMagicLinkFlowParams, + SignInResource + > => { const { run, stop } = Poller(); const startMagicLinkFlow = async ({ @@ -137,16 +144,18 @@ export class SignIn extends BaseResource implements SignInResource { return { startMagicLinkFlow, cancelMagicLinkFlow: stop }; }; - prepareSecondFactor = (params: PrepareSecondFactorParams): Promise => { - params = deepCamelToSnake(params); + prepareSecondFactor = ( + params: PrepareSecondFactorParams, + ): Promise => { return this._basePost({ body: params, action: 'prepare_second_factor', }); }; - attemptSecondFactor = (params: AttemptSecondFactorParams): Promise => { - params = deepCamelToSnake(params); + attemptSecondFactor = ( + params: AttemptSecondFactorParams, + ): Promise => { return this._basePost({ body: params, action: 'attempt_second_factor', @@ -188,7 +197,7 @@ export class SignIn extends BaseResource implements SignInResource { await this.create({ identifier }); const web3FirstFactor = this.supportedFirstFactors.find( - f => f.strategy === STRATEGY_WEB3_METAMASK_SIGNATURE, + f => f.strategy === 'web3_metamask_signature', ) as Web3SignatureFactor; if (!web3FirstFactor) { @@ -205,7 +214,7 @@ export class SignIn extends BaseResource implements SignInResource { return this.attemptFirstFactor({ signature, - strategy: STRATEGY_WEB3_METAMASK_SIGNATURE, + strategy: 'web3_metamask_signature', }); }; @@ -223,10 +232,18 @@ export class SignIn extends BaseResource implements SignInResource { this.status = data.status; this.supportedIdentifiers = data.supported_identifiers; this.identifier = data.identifier; - this.supportedFirstFactors = deepSnakeToCamel(data.supported_first_factors) as SignInFirstFactor[]; - this.supportedSecondFactors = deepSnakeToCamel(data.supported_second_factors) as SignInSecondFactor[]; - this.firstFactorVerification = new Verification(data.first_factor_verification); - this.secondFactorVerification = new Verification(data.second_factor_verification); + this.supportedFirstFactors = deepSnakeToCamel( + data.supported_first_factors, + ) as SignInFirstFactor[]; + this.supportedSecondFactors = deepSnakeToCamel( + data.supported_second_factors, + ) as SignInSecondFactor[]; + this.firstFactorVerification = new Verification( + data.first_factor_verification, + ); + this.secondFactorVerification = new Verification( + data.second_factor_verification, + ); this.createdSessionId = data.created_session_id; this.userData = deepSnakeToCamel(data.user_data) as UserData; } diff --git a/packages/clerk-js/src/ui/signIn/factorOne/SignInFactorOneInputBased.tsx b/packages/clerk-js/src/ui/signIn/factorOne/SignInFactorOneInputBased.tsx index 58b3d11cf24..54cb5db7766 100644 --- a/packages/clerk-js/src/ui/signIn/factorOne/SignInFactorOneInputBased.tsx +++ b/packages/clerk-js/src/ui/signIn/factorOne/SignInFactorOneInputBased.tsx @@ -96,7 +96,9 @@ export function SignInFactorOneInputBased({ if (shouldPrepare) { setLastUsedFactor(currentFactor); - signIn.prepareFirstFactor(currentFactor as any); + signIn.prepareFirstFactor( + currentFactor as EmailCodeFactor | PhoneCodeFactor, + ); } }, [currentFactor]); diff --git a/packages/clerk-js/src/utils/resourceParams.test.ts b/packages/clerk-js/src/utils/resourceParams.test.ts index 256ce1590e2..52600fb8a78 100644 --- a/packages/clerk-js/src/utils/resourceParams.test.ts +++ b/packages/clerk-js/src/utils/resourceParams.test.ts @@ -3,7 +3,7 @@ import { UpdateUserParams } from '@clerk/types'; import { normalizeUnsafeMetadata } from './resourceParams'; describe('normalizeUnsafeMetadata', () => { - it('handles unsafe_metadata', () => { + it('handles unsafeMetadata', () => { const params: UpdateUserParams = { firstName: 'clerk', unsafeMetadata: { @@ -13,21 +13,21 @@ describe('normalizeUnsafeMetadata', () => { const res = normalizeUnsafeMetadata(params); expect(res).toEqual({ - first_name: 'clerk', - unsafe_metadata: JSON.stringify({ + firstName: 'clerk', + unsafeMetadata: JSON.stringify({ role: 'admin', }), }); }); - it('handles params without unsafe_metadata', () => { + it('handles params without unsafeMetadata', () => { const params: UpdateUserParams = { firstName: 'clerk', }; const res = normalizeUnsafeMetadata(params); expect(res).toEqual({ - first_name: 'clerk', + firstName: 'clerk', }); }); @@ -38,7 +38,7 @@ describe('normalizeUnsafeMetadata', () => { expect(res).toEqual({}); }); - it('handles unsafe_metadata passed as string', () => { + it('handles unsafeMetadata passed as string', () => { const params: UpdateUserParams = { firstName: 'clerk', unsafeMetadata: JSON.stringify({ @@ -48,8 +48,8 @@ describe('normalizeUnsafeMetadata', () => { const res = normalizeUnsafeMetadata(params); expect(res).toEqual({ - first_name: 'clerk', - unsafe_metadata: JSON.stringify({ + firstName: 'clerk', + unsafeMetadata: JSON.stringify({ role: 'admin', }), }); diff --git a/packages/clerk-js/src/utils/resourceParams.ts b/packages/clerk-js/src/utils/resourceParams.ts index b463bc98ae4..4b794bf2628 100644 --- a/packages/clerk-js/src/utils/resourceParams.ts +++ b/packages/clerk-js/src/utils/resourceParams.ts @@ -1,19 +1,16 @@ -import { deepCamelToSnake } from '@clerk/shared/utils'; - export function normalizeUnsafeMetadata< T extends Record & { - unsafe_metadata?: Record; + unsafeMetadata?: Record; }, >(params: T) { - params = deepCamelToSnake(params); - const { unsafe_metadata } = { ...params }; - const unsafeMetadataJSON = unsafe_metadata - ? typeof unsafe_metadata === 'object' - ? JSON.stringify(unsafe_metadata) - : unsafe_metadata + const { unsafeMetadata } = { ...params }; + const unsafeMetadataJSON = unsafeMetadata + ? typeof unsafeMetadata === 'object' + ? JSON.stringify(unsafeMetadata) + : unsafeMetadata : ''; return { ...params, - ...(unsafe_metadata ? { unsafe_metadata: unsafeMetadataJSON } : {}), + ...(unsafeMetadata ? { unsafeMetadata: unsafeMetadataJSON } : {}), }; } diff --git a/packages/edge/CHANGELOG.md b/packages/edge/CHANGELOG.md index c5a98c3eab4..1b8bb6f9bc1 100644 --- a/packages/edge/CHANGELOG.md +++ b/packages/edge/CHANGELOG.md @@ -3,239 +3,152 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. -## [0.4.0](https://github.com/clerkinc/javascript/compare/@clerk/edge@0.3.9...@clerk/edge@0.4.0) (2022-03-17) +### [1.0.1-alpha.0](https://github.com/clerkinc/javascript/compare/@clerk/edge@1.0.1-staging.0...@clerk/edge@1.0.1-alpha.0) (2022-03-19) +### Bug Fixes -### Features +- **edge:** Align edge getToken ([0348929](https://github.com/clerkinc/javascript/commit/0348929bf5e329ad53690b81b1f8c50727e8c7e5)) -* **edge:** First version of new withAuth ([4ef853c](https://github.com/clerkinc/javascript/commit/4ef853c4d2837dfc4a49d3ab6f435e50cca28dc8)) +## [0.4.0](https://github.com/clerkinc/javascript/compare/@clerk/edge@0.3.9...@clerk/edge@0.4.0) (2022-03-17) +### Features +- **edge:** First version of new withAuth ([4ef853c](https://github.com/clerkinc/javascript/commit/4ef853c4d2837dfc4a49d3ab6f435e50cca28dc8)) ### [0.3.9](https://github.com/clerkinc/javascript/compare/@clerk/edge@0.3.8...@clerk/edge@0.3.9) (2022-03-14) **Note:** Version bump only for package @clerk/edge - - - - ### [0.3.8-alpha.0](https://github.com/clerkinc/javascript/compare/@clerk/edge@0.3.7...@clerk/edge@0.3.8-alpha.0) (2022-03-11) **Note:** Version bump only for package @clerk/edge - - - - ### [0.3.8](https://github.com/clerkinc/javascript/compare/@clerk/edge@0.3.7...@clerk/edge@0.3.8) (2022-03-11) **Note:** Version bump only for package @clerk/edge - - - - ### [0.3.7](https://github.com/clerkinc/javascript/compare/@clerk/edge@0.3.7-staging.0...@clerk/edge@0.3.7) (2022-03-09) **Note:** Version bump only for package @clerk/edge - - - - ### [0.3.6](https://github.com/clerkinc/javascript/compare/@clerk/edge@0.3.5...@clerk/edge@0.3.6) (2022-03-04) **Note:** Version bump only for package @clerk/edge - - - - ### [0.3.5](https://github.com/clerkinc/javascript/compare/@clerk/edge@0.3.4...@clerk/edge@0.3.5) (2022-03-04) **Note:** Version bump only for package @clerk/edge - - - - ### [0.3.4](https://github.com/clerkinc/javascript/compare/@clerk/edge@0.3.4-staging.0...@clerk/edge@0.3.4) (2022-02-24) **Note:** Version bump only for package @clerk/edge - - - - ### [0.3.4-staging.0](https://github.com/clerkinc/javascript/compare/@clerk/edge@0.3.3...@clerk/edge@0.3.4-staging.0) (2022-02-17) **Note:** Version bump only for package @clerk/edge - - - - ### [0.3.3](https://github.com/clerkinc/javascript/compare/@clerk/edge@0.3.2...@clerk/edge@0.3.3) (2022-02-16) **Note:** Version bump only for package @clerk/edge - - - - ### [0.3.2](https://github.com/clerkinc/javascript/compare/@clerk/edge@0.3.1...@clerk/edge@0.3.2) (2022-02-16) **Note:** Version bump only for package @clerk/edge - - - - ### [0.3.1](https://github.com/clerkinc/javascript/compare/@clerk/edge@0.3.1-staging.0...@clerk/edge@0.3.1) (2022-02-14) **Note:** Version bump only for package @clerk/edge - - - - ### [0.3.1-staging.0](https://github.com/clerkinc/javascript/compare/@clerk/edge@0.3.0...@clerk/edge@0.3.1-staging.0) (2022-02-11) - ### Features -* **clerk-sdk-node:** Deprecate Session named middleware, introduce withAuth, requireAuth ([4e69553](https://github.com/clerkinc/javascript/commit/4e695535e41fe7c135cbf303a0d021e7b7d30f7d)) - +- **clerk-sdk-node:** Deprecate Session named middleware, introduce withAuth, requireAuth ([4e69553](https://github.com/clerkinc/javascript/commit/4e695535e41fe7c135cbf303a0d021e7b7d30f7d)) ### Bug Fixes -* **edge:** Correct interstitial Content-Type and User-Agent ([12ad4d5](https://github.com/clerkinc/javascript/commit/12ad4d5e2a92c2fdeca733f1f8f4cbbb3b458fbc)) - - +- **edge:** Correct interstitial Content-Type and User-Agent ([12ad4d5](https://github.com/clerkinc/javascript/commit/12ad4d5e2a92c2fdeca733f1f8f4cbbb3b458fbc)) ## [0.3.0](https://github.com/clerkinc/javascript/compare/@clerk/edge@0.2.1...@clerk/edge@0.3.0) (2022-02-04) - ### Features -* **edge:** Add custom header X-Clerk-SDK in request for SDK version ([3f4c1a1](https://github.com/clerkinc/javascript/commit/3f4c1a1a5c4dc99cf3971edbf4d3715e212d91d1)) - - +- **edge:** Add custom header X-Clerk-SDK in request for SDK version ([3f4c1a1](https://github.com/clerkinc/javascript/commit/3f4c1a1a5c4dc99cf3971edbf4d3715e212d91d1)) ### [0.2.1](https://github.com/clerkinc/javascript/compare/@clerk/edge@0.2.0...@clerk/edge@0.2.1) (2022-02-03) **Note:** Version bump only for package @clerk/edge - - - - ## [0.2.0](https://github.com/clerkinc/javascript/compare/@clerk/edge@0.1.4...@clerk/edge@0.2.0) (2022-02-02) - ### Features -* **backend-core,clerk-sdk-node,edge:** Add support to verify azp session token claim ([eab1c8c](https://github.com/clerkinc/javascript/commit/eab1c8c8a43960fee2da9c10a52c3915cd37f45c)) - - +- **backend-core,clerk-sdk-node,edge:** Add support to verify azp session token claim ([eab1c8c](https://github.com/clerkinc/javascript/commit/eab1c8c8a43960fee2da9c10a52c3915cd37f45c)) ### [0.1.4](https://github.com/clerkinc/javascript/compare/@clerk/edge@0.1.3...@clerk/edge@0.1.4) (2022-01-28) **Note:** Version bump only for package @clerk/edge - - - - ### [0.1.3](https://github.com/clerkinc/javascript/compare/@clerk/edge@0.1.2...@clerk/edge@0.1.3) (2022-01-26) - ### Reverts -* Revert "chore(release): Publish" ([df705e0](https://github.com/clerkinc/javascript/commit/df705e011f025e044c61aad2983e90afd94d5662)) - - +- Revert "chore(release): Publish" ([df705e0](https://github.com/clerkinc/javascript/commit/df705e011f025e044c61aad2983e90afd94d5662)) ### [0.1.2](https://github.com/clerkinc/javascript/compare/@clerk/edge@0.1.1...@clerk/edge@0.1.2) (2022-01-25) - ### Reverts -* Revert "chore(release): Publish" ([df705e0](https://github.com/clerkinc/javascript/commit/df705e011f025e044c61aad2983e90afd94d5662)) - - +- Revert "chore(release): Publish" ([df705e0](https://github.com/clerkinc/javascript/commit/df705e011f025e044c61aad2983e90afd94d5662)) ### [0.1.1](https://github.com/clerkinc/javascript/compare/@clerk/edge@0.1.0...@clerk/edge@0.1.1) (2022-01-20) **Note:** Version bump only for package @clerk/edge - - - - ## [0.1.0](https://github.com/clerkinc/javascript/compare/@clerk/edge@0.1.0-alpha.3...@clerk/edge@0.1.0) (2022-01-20) **Note:** Version bump only for package @clerk/edge - - - - ## [0.1.0-alpha.3](https://github.com/clerkinc/javascript/compare/@clerk/edge@0.1.0-alpha.2...@clerk/edge@0.1.0-alpha.3) (2022-01-20) - ### Bug Fixes -* **backend-core:** Fix build issue ([2b60c40](https://github.com/clerkinc/javascript/commit/2b60c409fc450c77aa9585e96131de11f5924f50)) - - +- **backend-core:** Fix build issue ([2b60c40](https://github.com/clerkinc/javascript/commit/2b60c409fc450c77aa9585e96131de11f5924f50)) ## [0.1.0-alpha.2](https://github.com/clerkinc/javascript/compare/@clerk/edge@0.1.0-alpha.1...@clerk/edge@0.1.0-alpha.2) (2022-01-20) - ### Bug Fixes -* **backend-core:** Add Readme links ([12509e3](https://github.com/clerkinc/javascript/commit/12509e32f6da37902cce94949459edffa4a63718)) - - +- **backend-core:** Add Readme links ([12509e3](https://github.com/clerkinc/javascript/commit/12509e32f6da37902cce94949459edffa4a63718)) ## 0.1.0-alpha.1 (2022-01-20) - ### Features -* Consistent imports rule ([fb81176](https://github.com/clerkinc/javascript/commit/fb81176b9db0a95a84d19f61e15a9c65a12fc98e)) -* Init ([bd27622](https://github.com/clerkinc/javascript/commit/bd2762201f2771f137ddddd50487813c3154938e)) -* Init :fire: ([ce185fe](https://github.com/clerkinc/javascript/commit/ce185fefe20f9dcbc17e36506287af224f2cfc2e)) -* npm workspaces and lerna setup ([cfbfebf](https://github.com/clerkinc/javascript/commit/cfbfebfd0d5f88a96b4715e4be52bff7f37cc3db)) -* SDK Node resource and APIs from @clerk/backend-core ([6a32317](https://github.com/clerkinc/javascript/commit/6a323175f9361c32192a4a6be4139b88945a857c)) -* Update READMEs, API reference for @clerk/backend-core, minor fixes ([529c2f6](https://github.com/clerkinc/javascript/commit/529c2f629ec02895f9f049d29b5775f16ef5c6e9)) - +- Consistent imports rule ([fb81176](https://github.com/clerkinc/javascript/commit/fb81176b9db0a95a84d19f61e15a9c65a12fc98e)) +- Init ([bd27622](https://github.com/clerkinc/javascript/commit/bd2762201f2771f137ddddd50487813c3154938e)) +- Init :fire: ([ce185fe](https://github.com/clerkinc/javascript/commit/ce185fefe20f9dcbc17e36506287af224f2cfc2e)) +- npm workspaces and lerna setup ([cfbfebf](https://github.com/clerkinc/javascript/commit/cfbfebfd0d5f88a96b4715e4be52bff7f37cc3db)) +- SDK Node resource and APIs from @clerk/backend-core ([6a32317](https://github.com/clerkinc/javascript/commit/6a323175f9361c32192a4a6be4139b88945a857c)) +- Update READMEs, API reference for @clerk/backend-core, minor fixes ([529c2f6](https://github.com/clerkinc/javascript/commit/529c2f629ec02895f9f049d29b5775f16ef5c6e9)) ### Bug Fixes -* **backend-core:** Fix cross-origin detection algorithm ([fd99eae](https://github.com/clerkinc/javascript/commit/fd99eae111469c5d0028fd46b8bcbf1c5a8325b0)) - - +- **backend-core:** Fix cross-origin detection algorithm ([fd99eae](https://github.com/clerkinc/javascript/commit/fd99eae111469c5d0028fd46b8bcbf1c5a8325b0)) ## 0.1.0-alpha.0 (2022-01-20) - ### Features -* Consistent imports rule ([fb81176](https://github.com/clerkinc/javascript/commit/fb81176b9db0a95a84d19f61e15a9c65a12fc98e)) -* Init ([bd27622](https://github.com/clerkinc/javascript/commit/bd2762201f2771f137ddddd50487813c3154938e)) -* Init :fire: ([ce185fe](https://github.com/clerkinc/javascript/commit/ce185fefe20f9dcbc17e36506287af224f2cfc2e)) -* npm workspaces and lerna setup ([cfbfebf](https://github.com/clerkinc/javascript/commit/cfbfebfd0d5f88a96b4715e4be52bff7f37cc3db)) -* SDK Node resource and APIs from @clerk/backend-core ([6a32317](https://github.com/clerkinc/javascript/commit/6a323175f9361c32192a4a6be4139b88945a857c)) -* Update READMEs, API reference for @clerk/backend-core, minor fixes ([529c2f6](https://github.com/clerkinc/javascript/commit/529c2f629ec02895f9f049d29b5775f16ef5c6e9)) - - +- Consistent imports rule ([fb81176](https://github.com/clerkinc/javascript/commit/fb81176b9db0a95a84d19f61e15a9c65a12fc98e)) +- Init ([bd27622](https://github.com/clerkinc/javascript/commit/bd2762201f2771f137ddddd50487813c3154938e)) +- Init :fire: ([ce185fe](https://github.com/clerkinc/javascript/commit/ce185fefe20f9dcbc17e36506287af224f2cfc2e)) +- npm workspaces and lerna setup ([cfbfebf](https://github.com/clerkinc/javascript/commit/cfbfebfd0d5f88a96b4715e4be52bff7f37cc3db)) +- SDK Node resource and APIs from @clerk/backend-core ([6a32317](https://github.com/clerkinc/javascript/commit/6a323175f9361c32192a4a6be4139b88945a857c)) +- Update READMEs, API reference for @clerk/backend-core, minor fixes ([529c2f6](https://github.com/clerkinc/javascript/commit/529c2f629ec02895f9f049d29b5775f16ef5c6e9)) ## 0.0.6 (2022-01-20) - ### Features -* First open version 🎊 +- First open version 🎊 diff --git a/packages/edge/package.json b/packages/edge/package.json index a0c65811df8..f6de671e621 100644 --- a/packages/edge/package.json +++ b/packages/edge/package.json @@ -1,6 +1,6 @@ { "name": "@clerk/edge", - "version": "1.0.1-staging.0", + "version": "1.0.1-alpha.0", "license": "MIT", "description": "Clerk SDK for serverless and edge environments", "keywords": [ @@ -36,7 +36,7 @@ "build": "node ./scripts/info.cjs && tsc -p tsconfig.esm.json && tsc -p tsconfig.cjs.json && ./moduleTypeFix" }, "dependencies": { - "@clerk/backend-core": "^0.6.4-staging.0", + "@clerk/backend-core": "^0.6.4-alpha.0", "@peculiar/webcrypto": "^1.2.3", "next": "^12.0.7" }, diff --git a/packages/edge/src/info.ts b/packages/edge/src/info.ts index 1461f0a4142..e3bdbfbabfc 100644 --- a/packages/edge/src/info.ts +++ b/packages/edge/src/info.ts @@ -1,3 +1,3 @@ /** DO NOT EDIT: This file is automatically generated by ../scripts/info.js */ -export const LIB_VERSION = '1.0.1-staging.0'; +export const LIB_VERSION = '1.0.1-alpha.0'; export const LIB_NAME = '@clerk/edge'; diff --git a/packages/edge/src/vercel-edge/index.ts b/packages/edge/src/vercel-edge/index.ts index 8e8e74fc8f1..5c338daca9a 100644 --- a/packages/edge/src/vercel-edge/index.ts +++ b/packages/edge/src/vercel-edge/index.ts @@ -1,5 +1,4 @@ import { AuthStatus, Base } from '@clerk/backend-core'; -import { GetSessionTokenOptions } from '@clerk/types'; import { NextFetchEvent, NextRequest, NextResponse } from 'next/server'; import { ClerkAPI } from './ClerkAPI'; @@ -10,6 +9,7 @@ import { WithEdgeMiddlewareAuthOptions, } from './types'; import { injectAuthIntoRequest } from './utils'; +import { ServerGetTokenOptions } from '@clerk/types/src'; /** * @@ -113,13 +113,13 @@ export function withEdgeMiddlewareAuth( }); } - const getToken = (options: GetSessionTokenOptions = {}) => { + const getToken = (options: ServerGetTokenOptions = {}) => { if (options.template) { throw new Error( 'Retrieving a JWT template during edge runtime will be supported soon.', ); } - return req.cookies['__session'] || null; + return Promise.resolve(req.cookies['__session']); }; /* In both SignedIn and SignedOut states, we just add the attributes to the request object and passthrough. */ diff --git a/packages/edge/src/vercel-edge/types.ts b/packages/edge/src/vercel-edge/types.ts index 5a73c6d368e..37b0f4a097f 100644 --- a/packages/edge/src/vercel-edge/types.ts +++ b/packages/edge/src/vercel-edge/types.ts @@ -1,6 +1,6 @@ import type { Session, User } from '@clerk/backend-core'; -import type { GetSessionTokenOptions } from '@clerk/types'; import type { NextFetchEvent, NextRequest, NextResponse } from 'next/server'; +import { ServerGetToken } from '@clerk/types'; export type WithEdgeMiddlewareAuthOptions = { loadUser?: boolean; @@ -36,9 +36,7 @@ export type WithAuthNextMiddlewareHandler = ( export type EdgeMiddlewareAuth = { sessionId: string | null; userId: string | null; - getToken: ( - options?: GetSessionTokenOptions, - ) => Promise | string | null; + getToken: ServerGetToken; }; export type AuthData = { @@ -46,7 +44,5 @@ export type AuthData = { session: Session | undefined | null; userId: string | null; user: User | undefined | null; - getToken: ( - options?: GetSessionTokenOptions, - ) => Promise | string | null; + getToken: ServerGetToken; }; diff --git a/packages/edge/src/vercel-edge/utils/getAuthData.ts b/packages/edge/src/vercel-edge/utils/getAuthData.ts index 763924c0493..254d0179cc0 100644 --- a/packages/edge/src/vercel-edge/utils/getAuthData.ts +++ b/packages/edge/src/vercel-edge/utils/getAuthData.ts @@ -1,5 +1,5 @@ import { JWTPayload } from '@clerk/backend-core'; -import { GetSessionTokenOptions } from '@clerk/types'; +import { ServerGetTokenOptions } from '@clerk/types'; import { NextRequest } from 'next/server'; import { ClerkAPI } from '../ClerkAPI'; @@ -14,13 +14,13 @@ export async function getAuthData( loadUser, }: WithEdgeMiddlewareAuthOptions & JWTPayload, ): Promise { - const getToken = (options: GetSessionTokenOptions = {}) => { + const getToken = (options: ServerGetTokenOptions = {}) => { if (options.template) { throw new Error( 'Retrieving a JWT template during edge runtime will be supported soon.', ); } - return req.cookies['__session'] || null; + return Promise.resolve(req.cookies['__session']); }; const [user, session] = await Promise.all([ diff --git a/packages/expo/CHANGELOG.md b/packages/expo/CHANGELOG.md index b056c5cb756..2b4c03b7884 100644 --- a/packages/expo/CHANGELOG.md +++ b/packages/expo/CHANGELOG.md @@ -3,164 +3,93 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. -### [0.8.16](https://github.com/clerkinc/javascript/compare/@clerk/clerk-expo@0.8.16-staging.1...@clerk/clerk-expo@0.8.16) (2022-03-17) +### [0.8.18-alpha.0](https://github.com/clerkinc/javascript/compare/@clerk/clerk-expo@0.8.18-staging.0...@clerk/clerk-expo@0.8.18-alpha.0) (2022-03-19) **Note:** Version bump only for package @clerk/clerk-expo +### [0.8.16](https://github.com/clerkinc/javascript/compare/@clerk/clerk-expo@0.8.16-staging.1...@clerk/clerk-expo@0.8.16) (2022-03-17) - - +**Note:** Version bump only for package @clerk/clerk-expo ### [0.8.16-staging.1](https://github.com/clerkinc/javascript/compare/@clerk/clerk-expo@0.8.16-staging.0...@clerk/clerk-expo@0.8.16-staging.1) (2022-03-17) **Note:** Version bump only for package @clerk/clerk-expo - - - ### [0.8.13-alpha.1](https://github.com/clerkinc/javascript/compare/@clerk/clerk-expo@0.8.13...@clerk/clerk-expo@0.8.13-alpha.1) (2022-03-11) **Note:** Version bump only for package @clerk/clerk-expo - - - - ### [0.8.3-alpha.2](https://github.com/clerkinc/javascript/compare/@clerk/clerk-expo@0.8.6...@clerk/clerk-expo@0.8.3-alpha.2) (2022-02-28) **Note:** Version bump only for package @clerk/clerk-expo - - - - ### [0.8.3-alpha.1](https://github.com/clerkinc/javascript/compare/@clerk/clerk-expo@0.8.6...@clerk/clerk-expo@0.8.3-alpha.1) (2022-02-25) **Note:** Version bump only for package @clerk/clerk-expo - ### [0.8.14](https://github.com/clerkinc/javascript/compare/@clerk/clerk-expo@0.8.13...@clerk/clerk-expo@0.8.14) (2022-03-11) **Note:** Version bump only for package @clerk/clerk-expo - - - - ### [0.8.13](https://github.com/clerkinc/javascript/compare/@clerk/clerk-expo@0.8.13-staging.0...@clerk/clerk-expo@0.8.13) (2022-03-09) **Note:** Version bump only for package @clerk/clerk-expo - - - - ### [0.8.11](https://github.com/clerkinc/javascript/compare/@clerk/clerk-expo@0.8.10...@clerk/clerk-expo@0.8.11) (2022-03-04) - ### Bug Fixes -* **clerk-expo:** Add early return if tokenCache is not provided ([7a69d87](https://github.com/clerkinc/javascript/commit/7a69d870e5a6a73f34d6989643b55d2ff131536e)) -* **clerk-expo:** Add guard clause for tokenCache methods ([4c0bd54](https://github.com/clerkinc/javascript/commit/4c0bd54248a7248c844f8255120adadea57b5bee)) - - +- **clerk-expo:** Add early return if tokenCache is not provided ([7a69d87](https://github.com/clerkinc/javascript/commit/7a69d870e5a6a73f34d6989643b55d2ff131536e)) +- **clerk-expo:** Add guard clause for tokenCache methods ([4c0bd54](https://github.com/clerkinc/javascript/commit/4c0bd54248a7248c844f8255120adadea57b5bee)) ### [0.8.10](https://github.com/clerkinc/javascript/compare/@clerk/clerk-expo@0.8.9...@clerk/clerk-expo@0.8.10) (2022-03-04) **Note:** Version bump only for package @clerk/clerk-expo - - - - ### [0.8.9](https://github.com/clerkinc/javascript/compare/@clerk/clerk-expo@0.8.8...@clerk/clerk-expo@0.8.9) (2022-03-03) **Note:** Version bump only for package @clerk/clerk-expo - - - - ### [0.8.8](https://github.com/clerkinc/javascript/compare/@clerk/clerk-expo@0.8.7...@clerk/clerk-expo@0.8.8) (2022-03-02) **Note:** Version bump only for package @clerk/clerk-expo - - - - ### [0.8.7](https://github.com/clerkinc/javascript/compare/@clerk/clerk-expo@0.8.6...@clerk/clerk-expo@0.8.7) (2022-03-01) **Note:** Version bump only for package @clerk/clerk-expo - - - - ### [0.8.6](https://github.com/clerkinc/javascript/compare/@clerk/clerk-expo@0.8.6-staging.0...@clerk/clerk-expo@0.8.6) (2022-02-24) **Note:** Version bump only for package @clerk/clerk-expo - - - - ### [0.8.6-staging.0](https://github.com/clerkinc/javascript/compare/@clerk/clerk-expo@0.8.5-staging.0...@clerk/clerk-expo@0.8.6-staging.0) (2022-02-24) **Note:** Version bump only for package @clerk/clerk-expo - - - - ### [0.8.5-staging.0](https://github.com/clerkinc/javascript/compare/@clerk/clerk-expo@0.8.4-staging.0...@clerk/clerk-expo@0.8.5-staging.0) (2022-02-22) **Note:** Version bump only for package @clerk/clerk-expo - - - - ### [0.8.4-staging.0](https://github.com/clerkinc/javascript/compare/@clerk/clerk-expo@0.8.3-staging.1...@clerk/clerk-expo@0.8.4-staging.0) (2022-02-17) **Note:** Version bump only for package @clerk/clerk-expo - - - - ### [0.8.3-staging.1](https://github.com/clerkinc/javascript/compare/@clerk/clerk-expo@0.8.3-staging.0...@clerk/clerk-expo@0.8.3-staging.1) (2022-02-16) **Note:** Version bump only for package @clerk/clerk-expo - - - - ### [0.8.3-staging.0](https://github.com/clerkinc/javascript/compare/@clerk/clerk-expo@0.8.2...@clerk/clerk-expo@0.8.3-staging.0) (2022-02-15) **Note:** Version bump only for package @clerk/clerk-expo - - - - ### [0.8.2](https://github.com/clerkinc/javascript/compare/@clerk/clerk-expo@0.8.1...@clerk/clerk-expo@0.8.2) (2022-02-14) **Note:** Version bump only for package @clerk/clerk-expo - - - - ### [0.8.1](https://github.com/clerkinc/javascript/compare/@clerk/clerk-expo@0.8.1-staging.0...@clerk/clerk-expo@0.8.1) (2022-02-14) **Note:** Version bump only for package @clerk/clerk-expo - - - - ### 0.8.1-staging.0 (2022-02-11) **Note:** Version bump only for package @clerk/clerk-expo diff --git a/packages/expo/package.json b/packages/expo/package.json index 79db00329de..825dd04319f 100644 --- a/packages/expo/package.json +++ b/packages/expo/package.json @@ -1,6 +1,6 @@ { "name": "@clerk/clerk-expo", - "version": "0.8.18-staging.0", + "version": "0.8.18-alpha.0", "license": "MIT", "description": "Clerk.dev React Native/Expo library", "keywords": [ @@ -26,12 +26,12 @@ "dev": "tsc -p tsconfig.build.json --watch" }, "dependencies": { - "@clerk/clerk-js": "^3.0.1-staging.0", - "@clerk/clerk-react": "^3.0.1-staging.0", + "@clerk/clerk-js": "^3.0.1-alpha.0", + "@clerk/clerk-react": "^3.0.1-alpha.0", "base-64": "^1.0.0" }, "devDependencies": { - "@clerk/types": "^2.0.1-staging.0", + "@clerk/types": "^2.0.1-alpha.0", "@types/jest": "^27.4.0", "@types/node": "^16.11.9", "@types/react": "^17.0.39", diff --git a/packages/nextjs/CHANGELOG.md b/packages/nextjs/CHANGELOG.md index 7c5faa01874..1764693fceb 100644 --- a/packages/nextjs/CHANGELOG.md +++ b/packages/nextjs/CHANGELOG.md @@ -2,210 +2,128 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. -## [3.0.0-alpha.9](https://github.com/clerkinc/javascript/compare/@clerk/nextjs@2.11.13...@clerk/nextjs@3.0.0-alpha.9) (2022-03-11) +### [3.0.1-alpha.0](https://github.com/clerkinc/javascript/compare/@clerk/nextjs@3.0.1-staging.0...@clerk/nextjs@3.0.1-alpha.0) (2022-03-19) -### Features +### Bug Fixes -* **clerk-remix:** Remove load options from `getAuth` ([246fe76](https://github.com/clerkinc/javascript/commit/246fe76943aedc07bed8510761a286ef324049ec)) -* **nextjs:** Enforce withServerSideAuth callback return type ([3766a49](https://github.com/clerkinc/javascript/commit/3766a4938641de36f953ec49f45d539f971d778c)) -* **nextjs:** Fetch user and session in parallel ([#49](https://github.com/clerkinc/javascript/issues/49)) ([fb89732](https://github.com/clerkinc/javascript/commit/fb89732952fba2d45fe9ea73820b6264f5e02dbc)) -* **nextjs:** Move shared NextJS SSR types to types package ([78d8c7c](https://github.com/clerkinc/javascript/commit/78d8c7c3e84f3926127e48c655793a0fca3cdc2c)) -* **nextjs:** Strictly type all possible withServerSideAuth return value combinations ([beba831](https://github.com/clerkinc/javascript/commit/beba83195828737ef20ca4450badded92d95d098)) +- **nextjs,remix:** Make server getToken throw if called with no session ([f7736c1](https://github.com/clerkinc/javascript/commit/f7736c1f4730d713f3fbcedd73e2ef5a1ceee605)) +# [3.0.0-alpha.9](https://github.com/clerkinc/javascript/compare/@clerk/nextjs@2.11.13...@clerk/nextjs@3.0.0-alpha.9) (2022-03-11) +### Features -## [3.0.0-alpha.8](https://github.com/clerkinc/javascript/compare/@clerk/nextjs@2.11.4...@clerk/nextjs@3.0.0-alpha.8) (2022-02-28) +- **clerk-remix:** Remove load options from `getAuth` ([246fe76](https://github.com/clerkinc/javascript/commit/246fe76943aedc07bed8510761a286ef324049ec)) +- **nextjs:** Enforce withServerSideAuth callback return type ([3766a49](https://github.com/clerkinc/javascript/commit/3766a4938641de36f953ec49f45d539f971d778c)) +- **nextjs:** Fetch user and session in parallel ([#49](https://github.com/clerkinc/javascript/issues/49)) ([fb89732](https://github.com/clerkinc/javascript/commit/fb89732952fba2d45fe9ea73820b6264f5e02dbc)) +- **nextjs:** Move shared NextJS SSR types to types package ([78d8c7c](https://github.com/clerkinc/javascript/commit/78d8c7c3e84f3926127e48c655793a0fca3cdc2c)) +- **nextjs:** Strictly type all possible withServerSideAuth return value combinations ([beba831](https://github.com/clerkinc/javascript/commit/beba83195828737ef20ca4450badded92d95d098)) +## [3.0.0-alpha.8](https://github.com/clerkinc/javascript/compare/@clerk/nextjs@2.11.4...@clerk/nextjs@3.0.0-alpha.8) (2022-02-28) ### Features -* **clerk-remix:** Remove load options from `getAuth` ([246fe76](https://github.com/clerkinc/javascript/commit/246fe76943aedc07bed8510761a286ef324049ec)) -* **nextjs:** Enforce withServerSideAuth callback return type ([3766a49](https://github.com/clerkinc/javascript/commit/3766a4938641de36f953ec49f45d539f971d778c)) -* **nextjs:** Fetch user and session in parallel ([#49](https://github.com/clerkinc/javascript/issues/49)) ([fb89732](https://github.com/clerkinc/javascript/commit/fb89732952fba2d45fe9ea73820b6264f5e02dbc)) -* **nextjs:** Move shared NextJS SSR types to types package ([78d8c7c](https://github.com/clerkinc/javascript/commit/78d8c7c3e84f3926127e48c655793a0fca3cdc2c)) -* **nextjs:** Strictly type all possible withServerSideAuth return value combinations ([beba831](https://github.com/clerkinc/javascript/commit/beba83195828737ef20ca4450badded92d95d098)) - - +- **clerk-remix:** Remove load options from `getAuth` ([246fe76](https://github.com/clerkinc/javascript/commit/246fe76943aedc07bed8510761a286ef324049ec)) +- **nextjs:** Enforce withServerSideAuth callback return type ([3766a49](https://github.com/clerkinc/javascript/commit/3766a4938641de36f953ec49f45d539f971d778c)) +- **nextjs:** Fetch user and session in parallel ([#49](https://github.com/clerkinc/javascript/issues/49)) ([fb89732](https://github.com/clerkinc/javascript/commit/fb89732952fba2d45fe9ea73820b6264f5e02dbc)) +- **nextjs:** Move shared NextJS SSR types to types package ([78d8c7c](https://github.com/clerkinc/javascript/commit/78d8c7c3e84f3926127e48c655793a0fca3cdc2c)) +- **nextjs:** Strictly type all possible withServerSideAuth return value combinations ([beba831](https://github.com/clerkinc/javascript/commit/beba83195828737ef20ca4450badded92d95d098)) ## [3.0.0-alpha.7](https://github.com/clerkinc/javascript/compare/@clerk/nextjs@2.11.4...@clerk/nextjs@3.0.0-alpha.7) (2022-02-25) - ### Features -* **clerk-remix:** Remove load options from `getAuth` ([5c1e23d](https://github.com/clerkinc/javascript/commit/5c1e23db40b7a49b7cec5a1d8206daad160e6361)) -* **nextjs:** Enforce withServerSideAuth callback return type ([260d7cf](https://github.com/clerkinc/javascript/commit/260d7cfd255d6f6ff8d0dc2d32fb490008146804)) -* **nextjs:** Fetch user and session in parallel ([#49](https://github.com/clerkinc/javascript/issues/49)) ([e5c2620](https://github.com/clerkinc/javascript/commit/e5c2620695d489b14e3c513d6773c4527c9baf8b)) -* **nextjs:** Move shared NextJS SSR types to types package ([8b898a1](https://github.com/clerkinc/javascript/commit/8b898a1aa503889921180850292fbfa3c8133ef5)) -* **nextjs:** Strictly type all possible withServerSideAuth return value combinations ([e99c57a](https://github.com/clerkinc/javascript/commit/e99c57adc816a42137c781477e43fe4f372d9d1e)) - - +- **clerk-remix:** Remove load options from `getAuth` ([5c1e23d](https://github.com/clerkinc/javascript/commit/5c1e23db40b7a49b7cec5a1d8206daad160e6361)) +- **nextjs:** Enforce withServerSideAuth callback return type ([260d7cf](https://github.com/clerkinc/javascript/commit/260d7cfd255d6f6ff8d0dc2d32fb490008146804)) +- **nextjs:** Fetch user and session in parallel ([#49](https://github.com/clerkinc/javascript/issues/49)) ([e5c2620](https://github.com/clerkinc/javascript/commit/e5c2620695d489b14e3c513d6773c4527c9baf8b)) +- **nextjs:** Move shared NextJS SSR types to types package ([8b898a1](https://github.com/clerkinc/javascript/commit/8b898a1aa503889921180850292fbfa3c8133ef5)) +- **nextjs:** Strictly type all possible withServerSideAuth return value combinations ([e99c57a](https://github.com/clerkinc/javascript/commit/e99c57adc816a42137c781477e43fe4f372d9d1e)) ## [3.0.0-alpha.6](https://github.com/clerkinc/javascript/compare/@clerk/nextjs@2.11.1-staging.0...@clerk/nextjs@3.0.0-alpha.6) (2022-02-18) - ### Features -* **clerk-remix:** Remove load options from `getAuth` ([5f4cedc](https://github.com/clerkinc/javascript/commit/5f4cedc70db8398eb196ca769db41ebadb15ab12)) -* **nextjs:** Enforce withServerSideAuth callback return type ([a45f28a](https://github.com/clerkinc/javascript/commit/a45f28ac0bcd357c36759112a73737487499ef3f)) -* **nextjs:** Fetch user and session in parallel ([#49](https://github.com/clerkinc/javascript/issues/49)) ([ef58027](https://github.com/clerkinc/javascript/commit/ef58027b6d18c880074e1a55d0f2cfe4d83ab614)) -* **nextjs:** Move shared NextJS SSR types to types package ([757dc2e](https://github.com/clerkinc/javascript/commit/757dc2ef1acf32f31bdad8bcab076bb710723781)) - - - +- **clerk-remix:** Remove load options from `getAuth` ([5f4cedc](https://github.com/clerkinc/javascript/commit/5f4cedc70db8398eb196ca769db41ebadb15ab12)) +- **nextjs:** Enforce withServerSideAuth callback return type ([a45f28a](https://github.com/clerkinc/javascript/commit/a45f28ac0bcd357c36759112a73737487499ef3f)) +- **nextjs:** Fetch user and session in parallel ([#49](https://github.com/clerkinc/javascript/issues/49)) ([ef58027](https://github.com/clerkinc/javascript/commit/ef58027b6d18c880074e1a55d0f2cfe4d83ab614)) +- **nextjs:** Move shared NextJS SSR types to types package ([757dc2e](https://github.com/clerkinc/javascript/commit/757dc2ef1acf32f31bdad8bcab076bb710723781)) ### [2.11.17](https://github.com/clerkinc/javascript/compare/@clerk/nextjs@2.11.17-staging.1...@clerk/nextjs@2.11.17) (2022-03-17) **Note:** Version bump only for package @clerk/nextjs - - - - ### [2.11.17-staging.1](https://github.com/clerkinc/javascript/compare/@clerk/nextjs@2.11.17-staging.0...@clerk/nextjs@2.11.17-staging.1) (2022-03-17) **Note:** Version bump only for package @clerk/nextjs - - - - ### [2.11.15](https://github.com/clerkinc/javascript/compare/@clerk/nextjs@2.11.14...@clerk/nextjs@2.11.15) (2022-03-14) **Note:** Version bump only for package @clerk/nextjs - - - - ### [2.11.14](https://github.com/clerkinc/javascript/compare/@clerk/nextjs@2.11.13...@clerk/nextjs@2.11.14) (2022-03-11) **Note:** Version bump only for package @clerk/nextjs - - - - ### [2.11.13](https://github.com/clerkinc/javascript/compare/@clerk/nextjs@2.11.12...@clerk/nextjs@2.11.13) (2022-03-09) **Note:** Version bump only for package @clerk/nextjs - - - - ### [2.11.12](https://github.com/clerkinc/javascript/compare/@clerk/nextjs@2.11.12-staging.0...@clerk/nextjs@2.11.12) (2022-03-09) **Note:** Version bump only for package @clerk/nextjs - - - - ### [2.11.10](https://github.com/clerkinc/javascript/compare/@clerk/nextjs@2.11.9...@clerk/nextjs@2.11.10) (2022-03-04) **Note:** Version bump only for package @clerk/nextjs - - - - ### [2.11.9](https://github.com/clerkinc/javascript/compare/@clerk/nextjs@2.11.8...@clerk/nextjs@2.11.9) (2022-03-04) **Note:** Version bump only for package @clerk/nextjs - - - - ### [2.11.8](https://github.com/clerkinc/javascript/compare/@clerk/nextjs@2.11.7...@clerk/nextjs@2.11.8) (2022-03-04) **Note:** Version bump only for package @clerk/nextjs - - - - ### [2.11.7](https://github.com/clerkinc/javascript/compare/@clerk/nextjs@2.11.6...@clerk/nextjs@2.11.7) (2022-03-03) **Note:** Version bump only for package @clerk/nextjs - - - - ### [2.11.6](https://github.com/clerkinc/javascript/compare/@clerk/nextjs@2.11.5...@clerk/nextjs@2.11.6) (2022-03-02) **Note:** Version bump only for package @clerk/nextjs - - - - ### [2.11.5](https://github.com/clerkinc/javascript/compare/@clerk/nextjs@2.11.4...@clerk/nextjs@2.11.5) (2022-03-01) **Note:** Version bump only for package @clerk/nextjs - - - - ### [2.11.4](https://github.com/clerkinc/javascript/compare/@clerk/nextjs@2.11.4-staging.0...@clerk/nextjs@2.11.4) (2022-02-24) **Note:** Version bump only for package @clerk/nextjs - - - - ### [2.11.4-staging.0](https://github.com/clerkinc/javascript/compare/@clerk/nextjs@2.11.3-staging.0...@clerk/nextjs@2.11.4-staging.0) (2022-02-24) **Note:** Version bump only for package @clerk/nextjs - - - - ### [2.11.3-staging.0](https://github.com/clerkinc/javascript/compare/@clerk/nextjs@2.11.2-staging.2...@clerk/nextjs@2.11.3-staging.0) (2022-02-17) **Note:** Version bump only for package @clerk/nextjs - - - - ### [2.11.2-staging.2](https://github.com/clerkinc/javascript/compare/@clerk/nextjs@2.11.2-staging.1...@clerk/nextjs@2.11.2-staging.2) (2022-02-16) **Note:** Version bump only for package @clerk/nextjs - - - - ### [2.11.2-staging.1](https://github.com/clerkinc/javascript/compare/@clerk/nextjs@2.11.2-staging.0...@clerk/nextjs@2.11.2-staging.1) (2022-02-16) **Note:** Version bump only for package @clerk/nextjs - - - - ### [2.11.2-staging.0](https://github.com/clerkinc/javascript/compare/@clerk/nextjs@2.11.1...@clerk/nextjs@2.11.2-staging.0) (2022-02-15) **Note:** Version bump only for package @clerk/nextjs - - - - ### [2.11.1](https://github.com/clerkinc/javascript/compare/@clerk/nextjs@2.11.1-staging.0...@clerk/nextjs@2.11.1) (2022-02-14) **Note:** Version bump only for package @clerk/nextjs - - - - ### 2.11.1-staging.0 (2022-02-11) **Note:** Version bump only for package @clerk/nextjs diff --git a/packages/nextjs/package.json b/packages/nextjs/package.json index 095918995e1..63f13fb8e25 100644 --- a/packages/nextjs/package.json +++ b/packages/nextjs/package.json @@ -1,6 +1,6 @@ { "name": "@clerk/nextjs", - "version": "3.0.1-staging.0", + "version": "3.0.1-alpha.0", "license": "MIT", "description": "Clerk.dev SDK for NextJS", "keywords": [ @@ -32,10 +32,10 @@ "dev": "tsc -p tsconfig.build.json --watch" }, "dependencies": { - "@clerk/clerk-react": "^3.0.1-staging.0", - "@clerk/clerk-sdk-node": "^3.0.1-staging.0", - "@clerk/edge": "^1.0.1-staging.0", - "@clerk/types": "^2.0.1-staging.0", + "@clerk/clerk-react": "^3.0.1-alpha.0", + "@clerk/clerk-sdk-node": "^3.0.1-alpha.0", + "@clerk/edge": "^1.0.1-alpha.0", + "@clerk/types": "^2.0.1-alpha.0", "tslib": "^2.3.1" }, "devDependencies": { diff --git a/packages/nextjs/src/middleware/utils/getAuthData.ts b/packages/nextjs/src/middleware/utils/getAuthData.ts index ddcb80de695..3155ae2627d 100644 --- a/packages/nextjs/src/middleware/utils/getAuthData.ts +++ b/packages/nextjs/src/middleware/utils/getAuthData.ts @@ -1,6 +1,6 @@ import { AuthStatus } from '@clerk/backend-core'; import Clerk, { sessions, users } from '@clerk/clerk-sdk-node'; -import { GetToken, GetTokenOptions } from '@clerk/types'; +import { ServerGetToken, ServerGetTokenOptions } from '@clerk/types'; import { GetServerSidePropsContext } from 'next'; import { AuthData, WithServerSideAuthOptions } from '../types'; @@ -10,15 +10,15 @@ import { AuthData, WithServerSideAuthOptions } from '../types'; * TODO: Share the same impl between nextjs/remix packages */ const createGetToken = - (sessionId?: string, sessionToken?: string): GetToken => - async (options: GetTokenOptions = {}) => { + (sessionId?: string, sessionToken?: string): ServerGetToken => + async (options: ServerGetTokenOptions = {}) => { if (!sessionId) { - return Promise.resolve(null); + throw new Error('getToken cannot be called without a session'); } if (options.template) { return sessions.getToken(sessionId, options.template); } - return Promise.resolve(sessionToken || null); + return Promise.resolve(sessionToken); }; /** diff --git a/packages/react/CHANGELOG.md b/packages/react/CHANGELOG.md index fb5ffe584f4..c5f4d989c7b 100644 --- a/packages/react/CHANGELOG.md +++ b/packages/react/CHANGELOG.md @@ -3,162 +3,102 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. -## [3.0.0-alpha.10](https://github.com/clerkinc/javascript/compare/@clerk/clerk-react@2.12.3...@clerk/clerk-react@3.0.0-alpha.10) (2022-03-11) +### [3.0.1-alpha.0](https://github.com/clerkinc/javascript/compare/@clerk/clerk-react@3.0.1-staging.0...@clerk/clerk-react@3.0.1-alpha.0) (2022-03-19) +### Bug Fixes -### Features +- **clerk-js,clerk-react:** Move error to getToken ([84d21ce](https://github.com/clerkinc/javascript/commit/84d21ceac26843a1caa9d9d58f9c10ea2da6395e)) +- **edge:** Align react getToken ([37a03de](https://github.com/clerkinc/javascript/commit/37a03de81148294909719d4476b0a2ac3642813c)) -* **clerk-react:** Add isLoaded to `useOrganizations` hook ([#92](https://github.com/clerkinc/javascript/issues/92)) ([a316c7a](https://github.com/clerkinc/javascript/commit/a316c7a9d66f356639038ce89b5853625e44d4b7)) -* **clerk-remix:** Mark clerk-remix as side-effect free to fix Remix bundling ([c57a902](https://github.com/clerkinc/javascript/commit/c57a9024674a61aa3f2b7e359935e42fc034ffdd)) +## [3.0.0-alpha.10](https://github.com/clerkinc/javascript/compare/@clerk/clerk-react@2.12.3...@clerk/clerk-react@3.0.0-alpha.10) (2022-03-11) +### Features +- **clerk-react:** Add isLoaded to `useOrganizations` hook ([#92](https://github.com/clerkinc/javascript/issues/92)) ([a316c7a](https://github.com/clerkinc/javascript/commit/a316c7a9d66f356639038ce89b5853625e44d4b7)) +- **clerk-remix:** Mark clerk-remix as side-effect free to fix Remix bundling ([c57a902](https://github.com/clerkinc/javascript/commit/c57a9024674a61aa3f2b7e359935e42fc034ffdd)) ## [3.0.0-alpha.9](https://github.com/clerkinc/javascript/compare/@clerk/clerk-react@2.11.4...@clerk/clerk-react@3.0.0-alpha.9) (2022-02-28) - ### Features -* **clerk-remix:** Mark clerk-remix as side-effect free to fix Remix bundling ([c57a902](https://github.com/clerkinc/javascript/commit/c57a9024674a61aa3f2b7e359935e42fc034ffdd)) - - +- **clerk-remix:** Mark clerk-remix as side-effect free to fix Remix bundling ([c57a902](https://github.com/clerkinc/javascript/commit/c57a9024674a61aa3f2b7e359935e42fc034ffdd)) ## [3.0.0-alpha.8](https://github.com/clerkinc/javascript/compare/@clerk/clerk-react@2.11.4...@clerk/clerk-react@3.0.0-alpha.8) (2022-02-25) - ### Features -* **clerk-remix:** Mark clerk-remix as side-effect free to fix Remix bundling ([287a438](https://github.com/clerkinc/javascript/commit/287a4381d7ebefdf8704e2e29a75ac93f57794c8)) - - +- **clerk-remix:** Mark clerk-remix as side-effect free to fix Remix bundling ([287a438](https://github.com/clerkinc/javascript/commit/287a4381d7ebefdf8704e2e29a75ac93f57794c8)) ## [3.0.0-alpha.7](https://github.com/clerkinc/javascript/compare/@clerk/clerk-react@2.11.1...@clerk/clerk-react@3.0.0-alpha.7) (2022-02-18) - ### Features -* **clerk-remix:** Mark clerk-remix as side-effect free to fix Remix bundling ([0d22857](https://github.com/clerkinc/javascript/commit/0d22857197e5d1d2edc4d4df55916009f404dbdd)) - - +- **clerk-remix:** Mark clerk-remix as side-effect free to fix Remix bundling ([0d22857](https://github.com/clerkinc/javascript/commit/0d22857197e5d1d2edc4d4df55916009f404dbdd)) ### [2.12.6](https://github.com/clerkinc/javascript/compare/@clerk/clerk-react@2.12.6-staging.1...@clerk/clerk-react@2.12.6) (2022-03-17) **Note:** Version bump only for package @clerk/clerk-react - - - - ### [2.12.6-staging.1](https://github.com/clerkinc/javascript/compare/@clerk/clerk-react@2.12.6-staging.0...@clerk/clerk-react@2.12.6-staging.1) (2022-03-17) **Note:** Version bump only for package @clerk/clerk-react - - - - ### [2.12.4](https://github.com/clerkinc/javascript/compare/@clerk/clerk-react@2.12.3...@clerk/clerk-react@2.12.4) (2022-03-11) **Note:** Version bump only for package @clerk/clerk-react - - - - ### [2.12.3](https://github.com/clerkinc/javascript/compare/@clerk/clerk-react@2.12.3-staging.0...@clerk/clerk-react@2.12.3) (2022-03-09) **Note:** Version bump only for package @clerk/clerk-react - - - - ### [2.12.1](https://github.com/clerkinc/javascript/compare/@clerk/clerk-react@2.12.0...@clerk/clerk-react@2.12.1) (2022-03-04) - ### Bug Fixes -* **clerk-react,clerk-js,types:** Crate of API feedback fixes ([721ce72](https://github.com/clerkinc/javascript/commit/721ce7228c37b012891b2bec8caf290239164d05)) - - +- **clerk-react,clerk-js,types:** Crate of API feedback fixes ([721ce72](https://github.com/clerkinc/javascript/commit/721ce7228c37b012891b2bec8caf290239164d05)) ## [2.12.0](https://github.com/clerkinc/javascript/compare/@clerk/clerk-react@2.11.7...@clerk/clerk-react@2.12.0) (2022-03-04) - ### Features -* **clerk-js,clerk-react:** GetOrganization/s hook methods, fetching mechanism alignment ([fc11087](https://github.com/clerkinc/javascript/commit/fc110874f9a3e056cd43c773c267409dd9b318d6)) -* **clerk-js:** Add useOrganization hook ([480c422](https://github.com/clerkinc/javascript/commit/480c422774472fc712afdfe6ded2677b458d3ef0)) -* **clerk-react,clerk-js:** Add useOrganization hook using __unstable attribute ([1635132](https://github.com/clerkinc/javascript/commit/16351321a99945d167cbf6e6ca0efdbbbf7efe5a)) - - +- **clerk-js,clerk-react:** GetOrganization/s hook methods, fetching mechanism alignment ([fc11087](https://github.com/clerkinc/javascript/commit/fc110874f9a3e056cd43c773c267409dd9b318d6)) +- **clerk-js:** Add useOrganization hook ([480c422](https://github.com/clerkinc/javascript/commit/480c422774472fc712afdfe6ded2677b458d3ef0)) +- **clerk-react,clerk-js:** Add useOrganization hook using \_\_unstable attribute ([1635132](https://github.com/clerkinc/javascript/commit/16351321a99945d167cbf6e6ca0efdbbbf7efe5a)) ### [2.11.7](https://github.com/clerkinc/javascript/compare/@clerk/clerk-react@2.11.6...@clerk/clerk-react@2.11.7) (2022-03-03) **Note:** Version bump only for package @clerk/clerk-react - - - - ### [2.11.6](https://github.com/clerkinc/javascript/compare/@clerk/clerk-react@2.11.5...@clerk/clerk-react@2.11.6) (2022-03-02) **Note:** Version bump only for package @clerk/clerk-react - - - - ### [2.11.5](https://github.com/clerkinc/javascript/compare/@clerk/clerk-react@2.11.4...@clerk/clerk-react@2.11.5) (2022-03-01) **Note:** Version bump only for package @clerk/clerk-react - - - - ### [2.11.4](https://github.com/clerkinc/javascript/compare/@clerk/clerk-react@2.11.4-staging.0...@clerk/clerk-react@2.11.4) (2022-02-24) **Note:** Version bump only for package @clerk/clerk-react - - - - ### [2.11.4-staging.0](https://github.com/clerkinc/javascript/compare/@clerk/clerk-react@2.11.3-staging.0...@clerk/clerk-react@2.11.4-staging.0) (2022-02-24) **Note:** Version bump only for package @clerk/clerk-react - - - - ### [2.11.3-staging.0](https://github.com/clerkinc/javascript/compare/@clerk/clerk-react@2.11.2-staging.0...@clerk/clerk-react@2.11.3-staging.0) (2022-02-17) **Note:** Version bump only for package @clerk/clerk-react - - - - ### [2.11.2-staging.0](https://github.com/clerkinc/javascript/compare/@clerk/clerk-react@2.11.1...@clerk/clerk-react@2.11.2-staging.0) (2022-02-15) **Note:** Version bump only for package @clerk/clerk-react - - - - ### [2.11.1](https://github.com/clerkinc/javascript/compare/@clerk/clerk-react@2.11.1-staging.0...@clerk/clerk-react@2.11.1) (2022-02-14) **Note:** Version bump only for package @clerk/clerk-react - - - - ### 2.11.1-staging.0 (2022-02-11) - ### Features -* **clerk-sdk-node:** Deprecate Session named middleware, introduce withAuth, requireAuth ([4e69553](https://github.com/clerkinc/javascript/commit/4e695535e41fe7c135cbf303a0d021e7b7d30f7d)) +- **clerk-sdk-node:** Deprecate Session named middleware, introduce withAuth, requireAuth ([4e69553](https://github.com/clerkinc/javascript/commit/4e695535e41fe7c135cbf303a0d021e7b7d30f7d)) diff --git a/packages/react/package.json b/packages/react/package.json index 5dbb4c621d4..9bcf4fd563b 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,6 +1,6 @@ { "name": "@clerk/clerk-react", - "version": "3.0.1-staging.0", + "version": "3.0.1-alpha.0", "license": "MIT", "description": "Clerk.dev React library", "keywords": [ @@ -28,7 +28,7 @@ "test": "jest" }, "dependencies": { - "@clerk/types": "^2.0.1-staging.0", + "@clerk/types": "^2.0.1-alpha.0", "tslib": "^2.3.1" }, "devDependencies": { diff --git a/packages/react/src/hooks/useAuth.ts b/packages/react/src/hooks/useAuth.ts index 8134e850c80..0252cb69dfa 100644 --- a/packages/react/src/hooks/useAuth.ts +++ b/packages/react/src/hooks/useAuth.ts @@ -1,12 +1,10 @@ -import { GetSessionTokenOptions, SignOut } from '@clerk/types'; +import { GetToken, SignOut } from '@clerk/types'; import { useAuthContext } from '../contexts/AuthContext'; import { useIsomorphicClerkContext } from '../contexts/IsomorphicClerkContext'; import { invalidStateError } from '../errors'; import { createGetToken, createSignOut } from './utils'; -type GetToken = (options?: GetSessionTokenOptions) => Promise; - type UseAuthReturn = | { isLoaded: false; @@ -82,15 +80,36 @@ export const useAuth: UseAuth = () => { const signOut: SignOut = createSignOut(isomorphicClerk); if (sessionId === undefined && userId === undefined) { - return { isLoaded: false, isSignedIn: undefined, sessionId, userId, signOut, getToken }; + return { + isLoaded: false, + isSignedIn: undefined, + sessionId, + userId, + signOut, + getToken, + }; } if (sessionId === null && userId === null) { - return { isLoaded: true, isSignedIn: false, sessionId, userId, signOut, getToken }; + return { + isLoaded: true, + isSignedIn: false, + sessionId, + userId, + signOut, + getToken, + }; } if (!!sessionId && !!userId) { - return { isLoaded: true, isSignedIn: true, sessionId, userId, signOut, getToken }; + return { + isLoaded: true, + isSignedIn: true, + sessionId, + userId, + signOut, + getToken, + }; } throw new Error(invalidStateError); diff --git a/packages/react/src/hooks/utils.ts b/packages/react/src/hooks/utils.ts index 3feedc54bf5..3e55135c99b 100644 --- a/packages/react/src/hooks/utils.ts +++ b/packages/react/src/hooks/utils.ts @@ -15,13 +15,16 @@ const clerkLoaded = (isomorphicClerk: IsomorphicClerk) => { /** * @internal */ -export const createGetToken = (isomorphicClerk: IsomorphicClerk) => async (options: any) => { - await clerkLoaded(isomorphicClerk); - if (isomorphicClerk.session) { +export const createGetToken = + (isomorphicClerk: IsomorphicClerk) => async (options: any) => { + await clerkLoaded(isomorphicClerk); + if (!isomorphicClerk.session) { + throw new Error( + 'getToken cannot be called without a session. Check if sessionId has a value before calling getToken', + ); + } return isomorphicClerk.session.getToken(options); - } - return null; -}; + }; /** * @internal diff --git a/packages/react/src/info.ts b/packages/react/src/info.ts index 589ef06c9fc..162d09f0bf3 100644 --- a/packages/react/src/info.ts +++ b/packages/react/src/info.ts @@ -1,3 +1,3 @@ /** DO NOT EDIT: This file is automatically generated by ../scripts/info.js */ -export const LIB_VERSION = '3.0.1-staging.0'; +export const LIB_VERSION = '3.0.1-alpha.0'; export const LIB_NAME = '@clerk/clerk-react'; diff --git a/packages/remix/CHANGELOG.md b/packages/remix/CHANGELOG.md index cf808ff56ba..c97ef8eaa21 100644 --- a/packages/remix/CHANGELOG.md +++ b/packages/remix/CHANGELOG.md @@ -3,113 +3,97 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. -## [0.1.0-alpha.6](https://github.com/clerkinc/javascript/compare/@clerk/remix@0.1.0-alpha.5...@clerk/remix@0.1.0-alpha.6) (2022-03-11) - +### [0.1.1-alpha.0](https://github.com/clerkinc/javascript/compare/@clerk/remix@0.1.1-staging.0...@clerk/remix@0.1.1-alpha.0) (2022-03-19) -### Features +### Bug Fixes -* **remix:** Better server error handling ([#95](https://github.com/clerkinc/javascript/issues/95)) ([4046b29](https://github.com/clerkinc/javascript/commit/4046b291bb93d0f7471138c067cce8cf84cac265)) -* **remix:** Build interstitial locally instead of fetching ([2dd5bb3](https://github.com/clerkinc/javascript/commit/2dd5bb35d532ce6c0d9f19d66d68672e748d4ed8)) -* **remix:** Pass frontendApi from rootAuthLoader ([46a6c47](https://github.com/clerkinc/javascript/commit/46a6c47e0a977219c403327416e6f885ce7cfa4e)) -* **remix:** Throw the insterstitial from ConnectClerkCatchBoundary ([7b07bf0](https://github.com/clerkinc/javascript/commit/7b07bf02c6d9cad695e184a473ba507271f61fc3)) +- **nextjs,remix:** Make server getToken throw if called with no session ([f7736c1](https://github.com/clerkinc/javascript/commit/f7736c1f4730d713f3fbcedd73e2ef5a1ceee605)) +## [0.1.0-alpha.6](https://github.com/clerkinc/javascript/compare/@clerk/remix@0.1.0-alpha.5...@clerk/remix@0.1.0-alpha.6) (2022-03-11) -### Reverts +### Features -* Revert "Revert "fix(remix): Make `getAuth` stop loader execution during interstitial"" ([a0935f3](https://github.com/clerkinc/javascript/commit/a0935f355ff403b10a7f9d3e76957ff39f98f779)) +- **remix:** Better server error handling ([#95](https://github.com/clerkinc/javascript/issues/95)) ([4046b29](https://github.com/clerkinc/javascript/commit/4046b291bb93d0f7471138c067cce8cf84cac265)) +- **remix:** Build interstitial locally instead of fetching ([2dd5bb3](https://github.com/clerkinc/javascript/commit/2dd5bb35d532ce6c0d9f19d66d68672e748d4ed8)) +- **remix:** Pass frontendApi from rootAuthLoader ([46a6c47](https://github.com/clerkinc/javascript/commit/46a6c47e0a977219c403327416e6f885ce7cfa4e)) +- **remix:** Throw the insterstitial from ConnectClerkCatchBoundary ([7b07bf0](https://github.com/clerkinc/javascript/commit/7b07bf02c6d9cad695e184a473ba507271f61fc3)) +### Reverts +- Revert "Revert "fix(remix): Make `getAuth` stop loader execution during interstitial"" ([a0935f3](https://github.com/clerkinc/javascript/commit/a0935f355ff403b10a7f9d3e76957ff39f98f779)) ## [0.1.0-alpha.5](https://github.com/clerkinc/javascript/compare/@clerk/remix@0.1.0-alpha.4...@clerk/remix@0.1.0-alpha.5) (2022-02-28) - ### Reverts -* Revert "fix(remix): Make `getAuth` stop loader execution during interstitial" ([93d3c9b](https://github.com/clerkinc/javascript/commit/93d3c9b13ff225b066fae47f7c15735aef750036)) - - +- Revert "fix(remix): Make `getAuth` stop loader execution during interstitial" ([93d3c9b](https://github.com/clerkinc/javascript/commit/93d3c9b13ff225b066fae47f7c15735aef750036)) ## 0.1.0-alpha.4 (2022-02-28) - ### Features -* **clerk-remix:** Introduce basic clerk-remix structure ([f1ba9bd](https://github.com/clerkinc/javascript/commit/f1ba9bd02c5f107ff9993b120954cc62886d9c04)) -* **clerk-remix:** Introduce ClerkProvider for Remix ([edb0cee](https://github.com/clerkinc/javascript/commit/edb0cee6a5eb5124e0fb3a08d8554c6da9b69899)) -* **clerk-remix:** Introduce global polyfill ([5236bed](https://github.com/clerkinc/javascript/commit/5236bedd39e3d2fccd9466ac4dae715131293e4d)) -* **clerk-remix:** Introduce SSR getAuth for Remix ([bae06b8](https://github.com/clerkinc/javascript/commit/bae06b8846dfafe3b57036efc457435799bfa677)) -* **clerk-remix:** Introduce SSR rootAuthLoader for Remix ([23a10c7](https://github.com/clerkinc/javascript/commit/23a10c75c7590660aea7e8b261b0856affd8d01f)) -* **clerk-remix:** Remove load options from `getAuth` ([246fe76](https://github.com/clerkinc/javascript/commit/246fe76943aedc07bed8510761a286ef324049ec)) -* **clerk-remix:** Rename InferLoaderData to InferRootLoaderData ([e9eb81c](https://github.com/clerkinc/javascript/commit/e9eb81c092999614c1325bc2f196bcbf79f8360c)) -* **remix:** Depend on @remix-run/runtime only ([c5c53cd](https://github.com/clerkinc/javascript/commit/c5c53cd2202924a183b2ba77ef136e2aabab32c1)) -* **remix:** Introduce `ConnectClerk` HOC ([3f020ca](https://github.com/clerkinc/javascript/commit/3f020ca8f41632a24a7dd56caef3872a7b56c054)) -* **remix:** Make `rootAuthLoader` require a Response or object return value ([bf53db5](https://github.com/clerkinc/javascript/commit/bf53db5243542e44db39b6422e3f2ffd6765cd79)) -* **remix:** Move Remix dependencies to `peerDependencies` ([0ee115d](https://github.com/clerkinc/javascript/commit/0ee115db783f2ce10db196fdf5d9933481e7872e)) - +- **clerk-remix:** Introduce basic clerk-remix structure ([f1ba9bd](https://github.com/clerkinc/javascript/commit/f1ba9bd02c5f107ff9993b120954cc62886d9c04)) +- **clerk-remix:** Introduce ClerkProvider for Remix ([edb0cee](https://github.com/clerkinc/javascript/commit/edb0cee6a5eb5124e0fb3a08d8554c6da9b69899)) +- **clerk-remix:** Introduce global polyfill ([5236bed](https://github.com/clerkinc/javascript/commit/5236bedd39e3d2fccd9466ac4dae715131293e4d)) +- **clerk-remix:** Introduce SSR getAuth for Remix ([bae06b8](https://github.com/clerkinc/javascript/commit/bae06b8846dfafe3b57036efc457435799bfa677)) +- **clerk-remix:** Introduce SSR rootAuthLoader for Remix ([23a10c7](https://github.com/clerkinc/javascript/commit/23a10c75c7590660aea7e8b261b0856affd8d01f)) +- **clerk-remix:** Remove load options from `getAuth` ([246fe76](https://github.com/clerkinc/javascript/commit/246fe76943aedc07bed8510761a286ef324049ec)) +- **clerk-remix:** Rename InferLoaderData to InferRootLoaderData ([e9eb81c](https://github.com/clerkinc/javascript/commit/e9eb81c092999614c1325bc2f196bcbf79f8360c)) +- **remix:** Depend on @remix-run/runtime only ([c5c53cd](https://github.com/clerkinc/javascript/commit/c5c53cd2202924a183b2ba77ef136e2aabab32c1)) +- **remix:** Introduce `ConnectClerk` HOC ([3f020ca](https://github.com/clerkinc/javascript/commit/3f020ca8f41632a24a7dd56caef3872a7b56c054)) +- **remix:** Make `rootAuthLoader` require a Response or object return value ([bf53db5](https://github.com/clerkinc/javascript/commit/bf53db5243542e44db39b6422e3f2ffd6765cd79)) +- **remix:** Move Remix dependencies to `peerDependencies` ([0ee115d](https://github.com/clerkinc/javascript/commit/0ee115db783f2ce10db196fdf5d9933481e7872e)) ### Bug Fixes -* **remix:** Allow no return from `rootAuthLoader` callback ([4768aa6](https://github.com/clerkinc/javascript/commit/4768aa6bcf19e3a6d1a6d86a26f89b7351927673)) -* **remix:** Make `clerkState` required ([677a255](https://github.com/clerkinc/javascript/commit/677a2556846845e52839b5324a6031edc98dc093)) -* **remix:** Make `getAuth` stop loader execution during interstitial ([16a1be3](https://github.com/clerkinc/javascript/commit/16a1be34cce5c8a5027d957669e0176540e58d3a)) -* **remix:** Make `rootAuthLoader` only throw if a callback exists ([2689f6c](https://github.com/clerkinc/javascript/commit/2689f6ce858cd08365a37678d817e60e889e1acb)) - - +- **remix:** Allow no return from `rootAuthLoader` callback ([4768aa6](https://github.com/clerkinc/javascript/commit/4768aa6bcf19e3a6d1a6d86a26f89b7351927673)) +- **remix:** Make `clerkState` required ([677a255](https://github.com/clerkinc/javascript/commit/677a2556846845e52839b5324a6031edc98dc093)) +- **remix:** Make `getAuth` stop loader execution during interstitial ([16a1be3](https://github.com/clerkinc/javascript/commit/16a1be34cce5c8a5027d957669e0176540e58d3a)) +- **remix:** Make `rootAuthLoader` only throw if a callback exists ([2689f6c](https://github.com/clerkinc/javascript/commit/2689f6ce858cd08365a37678d817e60e889e1acb)) ## [0.1.0-alpha.3](https://github.com/clerkinc/javascript/compare/@clerk/remix@0.1.0-alpha.2...@clerk/remix@0.1.0-alpha.3) (2022-02-25) - ### Bug Fixes -* **remix:** Make `rootAuthLoader` only throw if a callback exists ([cec342f](https://github.com/clerkinc/javascript/commit/cec342f36d09d7f829589e145e7f4be60aea5d13)) - - +- **remix:** Make `rootAuthLoader` only throw if a callback exists ([cec342f](https://github.com/clerkinc/javascript/commit/cec342f36d09d7f829589e145e7f4be60aea5d13)) ## 0.1.0-alpha.2 (2022-02-25) - ### Features -* **clerk-remix:** Introduce basic clerk-remix structure ([f4f8e06](https://github.com/clerkinc/javascript/commit/f4f8e06385acb8fb5f142808309a95586660d76e)) -* **clerk-remix:** Introduce ClerkProvider for Remix ([d63e4bf](https://github.com/clerkinc/javascript/commit/d63e4bff960729977997d7cc0011ad90ea794225)) -* **clerk-remix:** Introduce global polyfill ([c3df5af](https://github.com/clerkinc/javascript/commit/c3df5afe5998a4872d7a617a18161c98e6753483)) -* **clerk-remix:** Introduce SSR getAuth for Remix ([8ee0eaf](https://github.com/clerkinc/javascript/commit/8ee0eafc8409d1a947daab3c677331fbded24dba)) -* **clerk-remix:** Introduce SSR rootAuthLoader for Remix ([693f79b](https://github.com/clerkinc/javascript/commit/693f79beda21108f1f1a67dd612c1eca6506d788)) -* **clerk-remix:** Remove load options from `getAuth` ([5c1e23d](https://github.com/clerkinc/javascript/commit/5c1e23db40b7a49b7cec5a1d8206daad160e6361)) -* **clerk-remix:** Rename InferLoaderData to InferRootLoaderData ([d753291](https://github.com/clerkinc/javascript/commit/d753291f5f61222dc189fded7341cfcce04de20c)) -* **remix:** Depend on @remix-run/runtime only ([c5d4c45](https://github.com/clerkinc/javascript/commit/c5d4c4535f8ff7f2a89ec0cf5e1e941ed40b2238)) -* **remix:** Introduce `ConnectClerk` HOC ([ea99273](https://github.com/clerkinc/javascript/commit/ea9927366d9591b2aa4a86b94eb2b1e05b505f6c)) -* **remix:** Make `rootAuthLoader` require a Response or object return value ([2aab7db](https://github.com/clerkinc/javascript/commit/2aab7dbcf97facfddc42e1694c859fbae76b95db)) -* **remix:** Move Remix dependencies to `peerDependencies` ([1ce0ce3](https://github.com/clerkinc/javascript/commit/1ce0ce38f13bf8b0c4255f97507b42cf8e793fde)) - +- **clerk-remix:** Introduce basic clerk-remix structure ([f4f8e06](https://github.com/clerkinc/javascript/commit/f4f8e06385acb8fb5f142808309a95586660d76e)) +- **clerk-remix:** Introduce ClerkProvider for Remix ([d63e4bf](https://github.com/clerkinc/javascript/commit/d63e4bff960729977997d7cc0011ad90ea794225)) +- **clerk-remix:** Introduce global polyfill ([c3df5af](https://github.com/clerkinc/javascript/commit/c3df5afe5998a4872d7a617a18161c98e6753483)) +- **clerk-remix:** Introduce SSR getAuth for Remix ([8ee0eaf](https://github.com/clerkinc/javascript/commit/8ee0eafc8409d1a947daab3c677331fbded24dba)) +- **clerk-remix:** Introduce SSR rootAuthLoader for Remix ([693f79b](https://github.com/clerkinc/javascript/commit/693f79beda21108f1f1a67dd612c1eca6506d788)) +- **clerk-remix:** Remove load options from `getAuth` ([5c1e23d](https://github.com/clerkinc/javascript/commit/5c1e23db40b7a49b7cec5a1d8206daad160e6361)) +- **clerk-remix:** Rename InferLoaderData to InferRootLoaderData ([d753291](https://github.com/clerkinc/javascript/commit/d753291f5f61222dc189fded7341cfcce04de20c)) +- **remix:** Depend on @remix-run/runtime only ([c5d4c45](https://github.com/clerkinc/javascript/commit/c5d4c4535f8ff7f2a89ec0cf5e1e941ed40b2238)) +- **remix:** Introduce `ConnectClerk` HOC ([ea99273](https://github.com/clerkinc/javascript/commit/ea9927366d9591b2aa4a86b94eb2b1e05b505f6c)) +- **remix:** Make `rootAuthLoader` require a Response or object return value ([2aab7db](https://github.com/clerkinc/javascript/commit/2aab7dbcf97facfddc42e1694c859fbae76b95db)) +- **remix:** Move Remix dependencies to `peerDependencies` ([1ce0ce3](https://github.com/clerkinc/javascript/commit/1ce0ce38f13bf8b0c4255f97507b42cf8e793fde)) ### Bug Fixes -* **remix:** Allow no return from `rootAuthLoader` callback ([5e708fd](https://github.com/clerkinc/javascript/commit/5e708fd798181fd0c3f917cc9f431d97d682b3c6)) -* **remix:** Make `clerkState` required ([22d2aff](https://github.com/clerkinc/javascript/commit/22d2affd2801f9623257b905aa0687e7ef43ff59)) - - +- **remix:** Allow no return from `rootAuthLoader` callback ([5e708fd](https://github.com/clerkinc/javascript/commit/5e708fd798181fd0c3f917cc9f431d97d682b3c6)) +- **remix:** Make `clerkState` required ([22d2aff](https://github.com/clerkinc/javascript/commit/22d2affd2801f9623257b905aa0687e7ef43ff59)) ## [0.1.0-alpha.1](https://github.com/clerkinc/javascript/compare/@clerk/remix@0.1.0-alpha.0...@clerk/remix@0.1.0-alpha.1) (2022-02-18) - ### Bug Fixes -* **remix:** Allow no return from `rootAuthLoader` callback ([55f14e0](https://github.com/clerkinc/javascript/commit/55f14e0706eb45b8e6808e7f33d7b430cf3d2afd)) -* **remix:** Make `clerkState` required ([df88977](https://github.com/clerkinc/javascript/commit/df88977531b12d15f245ff2cbc8ce360e4d52b91)) - - +- **remix:** Allow no return from `rootAuthLoader` callback ([55f14e0](https://github.com/clerkinc/javascript/commit/55f14e0706eb45b8e6808e7f33d7b430cf3d2afd)) +- **remix:** Make `clerkState` required ([df88977](https://github.com/clerkinc/javascript/commit/df88977531b12d15f245ff2cbc8ce360e4d52b91)) ## 0.1.0-alpha.0 (2022-02-18) - ### Features -* **clerk-remix:** Introduce basic clerk-remix structure ([ef91121](https://github.com/clerkinc/javascript/commit/ef9112144b47714a5a380bcccab9961f91ec17c9)) -* **clerk-remix:** Introduce ClerkProvider for Remix ([07abb99](https://github.com/clerkinc/javascript/commit/07abb99111a884e2e22f55a5101292595c066507)) -* **clerk-remix:** Introduce global polyfill ([78435ca](https://github.com/clerkinc/javascript/commit/78435ca008a32aa1c2546bc333a5e28e3d5079df)) -* **clerk-remix:** Introduce SSR getAuth for Remix ([e9ca753](https://github.com/clerkinc/javascript/commit/e9ca7534e2df55e5d1928d4a1f3a53eca3397252)) -* **clerk-remix:** Introduce SSR rootAuthLoader for Remix ([c7a61aa](https://github.com/clerkinc/javascript/commit/c7a61aab89dad2a1c0cde0d658ce4a50f0eb3cd4)) -* **clerk-remix:** Remove load options from `getAuth` ([5f4cedc](https://github.com/clerkinc/javascript/commit/5f4cedc70db8398eb196ca769db41ebadb15ab12)) -* **clerk-remix:** Rename InferLoaderData to InferRootLoaderData ([aa0c720](https://github.com/clerkinc/javascript/commit/aa0c7208bf8490f24b5b10527c4bb88cf07b79fc)) -* **remix:** Depend on @remix-run/runtime only ([7c014f4](https://github.com/clerkinc/javascript/commit/7c014f4327ce46cc7e74a0f637dd7b100baa672b)) +- **clerk-remix:** Introduce basic clerk-remix structure ([ef91121](https://github.com/clerkinc/javascript/commit/ef9112144b47714a5a380bcccab9961f91ec17c9)) +- **clerk-remix:** Introduce ClerkProvider for Remix ([07abb99](https://github.com/clerkinc/javascript/commit/07abb99111a884e2e22f55a5101292595c066507)) +- **clerk-remix:** Introduce global polyfill ([78435ca](https://github.com/clerkinc/javascript/commit/78435ca008a32aa1c2546bc333a5e28e3d5079df)) +- **clerk-remix:** Introduce SSR getAuth for Remix ([e9ca753](https://github.com/clerkinc/javascript/commit/e9ca7534e2df55e5d1928d4a1f3a53eca3397252)) +- **clerk-remix:** Introduce SSR rootAuthLoader for Remix ([c7a61aa](https://github.com/clerkinc/javascript/commit/c7a61aab89dad2a1c0cde0d658ce4a50f0eb3cd4)) +- **clerk-remix:** Remove load options from `getAuth` ([5f4cedc](https://github.com/clerkinc/javascript/commit/5f4cedc70db8398eb196ca769db41ebadb15ab12)) +- **clerk-remix:** Rename InferLoaderData to InferRootLoaderData ([aa0c720](https://github.com/clerkinc/javascript/commit/aa0c7208bf8490f24b5b10527c4bb88cf07b79fc)) +- **remix:** Depend on @remix-run/runtime only ([7c014f4](https://github.com/clerkinc/javascript/commit/7c014f4327ce46cc7e74a0f637dd7b100baa672b)) diff --git a/packages/remix/package.json b/packages/remix/package.json index 14c55e49255..d773c97ffaa 100644 --- a/packages/remix/package.json +++ b/packages/remix/package.json @@ -1,6 +1,6 @@ { "name": "@clerk/remix", - "version": "0.1.1-staging.0", + "version": "0.1.1-alpha.0", "license": "MIT", "description": "Clerk.dev SDK for Remix", "keywords": [ @@ -32,9 +32,9 @@ "dev": "tsc -p tsconfig.build.json --watch" }, "dependencies": { - "@clerk/clerk-react": "^3.0.1-staging.0", - "@clerk/clerk-sdk-node": "^3.0.1-staging.0", - "@clerk/types": "^2.0.1-staging.0", + "@clerk/clerk-react": "^3.0.1-alpha.0", + "@clerk/clerk-sdk-node": "^3.0.1-alpha.0", + "@clerk/types": "^2.0.1-alpha.0", "cookie": "^0.4.2", "tslib": "^2.3.1" }, diff --git a/packages/remix/src/ssr/getAuthData.ts b/packages/remix/src/ssr/getAuthData.ts index 3be830404ba..13cd1bd170d 100644 --- a/packages/remix/src/ssr/getAuthData.ts +++ b/packages/remix/src/ssr/getAuthData.ts @@ -1,6 +1,6 @@ import { AuthStatus, Session, User } from '@clerk/backend-core'; import Clerk, { sessions, users } from '@clerk/clerk-sdk-node'; -import { GetToken, GetTokenOptions } from '@clerk/types'; +import { ServerGetToken, ServerGetTokenOptions } from '@clerk/types'; import { RootAuthLoaderOptions } from './types'; import { parseCookies } from './utils'; @@ -10,7 +10,7 @@ export type AuthData = { session: Session | undefined | null; userId: string | null; user: User | undefined | null; - getToken: GetToken; + getToken: ServerGetToken; }; /** @@ -18,15 +18,15 @@ export type AuthData = { * TODO: Share the same impl between nextjs/remix packages */ const createGetToken = - (sessionId?: string, sessionToken?: string): GetToken => - async (options: GetTokenOptions = {}) => { + (sessionId?: string, sessionToken?: string): ServerGetToken => + async (options: ServerGetTokenOptions = {}) => { if (!sessionId) { - return Promise.resolve(null); + throw new Error('getToken cannot be called without a session'); } if (options.template) { return sessions.getToken(sessionId, options.template); } - return Promise.resolve(sessionToken || null); + return Promise.resolve(sessionToken); }; /** diff --git a/packages/sdk-node/CHANGELOG.md b/packages/sdk-node/CHANGELOG.md index 2d5ca3541a2..06f263d6265 100644 --- a/packages/sdk-node/CHANGELOG.md +++ b/packages/sdk-node/CHANGELOG.md @@ -3,263 +3,171 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +### [3.0.1-alpha.0](https://github.com/clerkinc/javascript/compare/@clerk/clerk-sdk-node@3.0.1-staging.0...@clerk/clerk-sdk-node@3.0.1-alpha.0) (2022-03-19) -### [2.9.10](https://github.com/clerkinc/javascript/compare/@clerk/clerk-sdk-node@2.9.9...@clerk/clerk-sdk-node@2.9.10) (2022-03-14) +**Note:** Version bump only for package @clerk/clerk-sdk-node +### [2.9.10](https://github.com/clerkinc/javascript/compare/@clerk/clerk-sdk-node@2.9.9...@clerk/clerk-sdk-node@2.9.10) (2022-03-14) ### Bug Fixes -* **clerk-sdk-node:** Properly stringify metadata params in InvitationsAPI ([5fde7cb](https://github.com/clerkinc/javascript/commit/5fde7cbfe2f439d7531a937651351f29523b0dd7)) - - - +- **clerk-sdk-node:** Properly stringify metadata params in InvitationsAPI ([5fde7cb](https://github.com/clerkinc/javascript/commit/5fde7cbfe2f439d7531a937651351f29523b0dd7)) ### [2.9.9-alpha.0](https://github.com/clerkinc/javascript/compare/@clerk/clerk-sdk-node@2.9.8...@clerk/clerk-sdk-node@2.9.9-alpha.0) (2022-03-11) **Note:** Version bump only for package @clerk/clerk-sdk-node - - - ### [2.9.9](https://github.com/clerkinc/javascript/compare/@clerk/clerk-sdk-node@2.9.8...@clerk/clerk-sdk-node@2.9.9) (2022-03-11) **Note:** Version bump only for package @clerk/clerk-sdk-node - - - - ### [2.9.8](https://github.com/clerkinc/javascript/compare/@clerk/clerk-sdk-node@2.9.7...@clerk/clerk-sdk-node@2.9.8) (2022-03-09) - ### Bug Fixes -* **clerk-sdk-node:** Correct initialization params override on custom instance ([4feb7eb](https://github.com/clerkinc/javascript/commit/4feb7eb8be87b2a03c6f5cdd1499982ce7020961)) - - +- **clerk-sdk-node:** Correct initialization params override on custom instance ([4feb7eb](https://github.com/clerkinc/javascript/commit/4feb7eb8be87b2a03c6f5cdd1499982ce7020961)) ### [2.9.7](https://github.com/clerkinc/javascript/compare/@clerk/clerk-sdk-node@2.9.7-staging.0...@clerk/clerk-sdk-node@2.9.7) (2022-03-09) **Note:** Version bump only for package @clerk/clerk-sdk-node - - - - ### [2.9.6](https://github.com/clerkinc/javascript/compare/@clerk/clerk-sdk-node@2.9.5...@clerk/clerk-sdk-node@2.9.6) (2022-03-04) **Note:** Version bump only for package @clerk/clerk-sdk-node - - - - ### [2.9.5](https://github.com/clerkinc/javascript/compare/@clerk/clerk-sdk-node@2.9.4...@clerk/clerk-sdk-node@2.9.5) (2022-03-04) **Note:** Version bump only for package @clerk/clerk-sdk-node - - - - ### [2.9.4](https://github.com/clerkinc/javascript/compare/@clerk/clerk-sdk-node@2.9.4-staging.0...@clerk/clerk-sdk-node@2.9.4) (2022-02-24) **Note:** Version bump only for package @clerk/clerk-sdk-node - - - - ### [2.9.4-staging.0](https://github.com/clerkinc/javascript/compare/@clerk/clerk-sdk-node@2.9.3...@clerk/clerk-sdk-node@2.9.4-staging.0) (2022-02-17) **Note:** Version bump only for package @clerk/clerk-sdk-node - - - - ### [2.9.3](https://github.com/clerkinc/javascript/compare/@clerk/clerk-sdk-node@2.9.2...@clerk/clerk-sdk-node@2.9.3) (2022-02-16) **Note:** Version bump only for package @clerk/clerk-sdk-node - - - - ### [2.9.2](https://github.com/clerkinc/javascript/compare/@clerk/clerk-sdk-node@2.9.1...@clerk/clerk-sdk-node@2.9.2) (2022-02-16) **Note:** Version bump only for package @clerk/clerk-sdk-node - - - - ### [2.9.1](https://github.com/clerkinc/javascript/compare/@clerk/clerk-sdk-node@2.9.1-staging.0...@clerk/clerk-sdk-node@2.9.1) (2022-02-14) **Note:** Version bump only for package @clerk/clerk-sdk-node - - - - ### [2.9.1-staging.0](https://github.com/clerkinc/javascript/compare/@clerk/clerk-sdk-node@2.9.0...@clerk/clerk-sdk-node@2.9.1-staging.0) (2022-02-11) - ### Features -* **clerk-sdk-node:** Deprecate Session named middleware, introduce withAuth, requireAuth ([4e69553](https://github.com/clerkinc/javascript/commit/4e695535e41fe7c135cbf303a0d021e7b7d30f7d)) - - +- **clerk-sdk-node:** Deprecate Session named middleware, introduce withAuth, requireAuth ([4e69553](https://github.com/clerkinc/javascript/commit/4e695535e41fe7c135cbf303a0d021e7b7d30f7d)) ## [2.9.0](https://github.com/clerkinc/javascript/compare/@clerk/clerk-sdk-node@2.8.1...@clerk/clerk-sdk-node@2.9.0) (2022-02-04) - ### Features -* **clerk-sdk-node:** Add custom header X-Clerk-SDK in request for SDK version ([84986d8](https://github.com/clerkinc/javascript/commit/84986d8522c00da3671a19dec7b914f99c3cc133)) - - +- **clerk-sdk-node:** Add custom header X-Clerk-SDK in request for SDK version ([84986d8](https://github.com/clerkinc/javascript/commit/84986d8522c00da3671a19dec7b914f99c3cc133)) ### [2.8.1](https://github.com/clerkinc/javascript/compare/@clerk/clerk-sdk-node@2.8.0...@clerk/clerk-sdk-node@2.8.1) (2022-02-03) **Note:** Version bump only for package @clerk/clerk-sdk-node - - - - ## [2.8.0](https://github.com/clerkinc/javascript/compare/@clerk/clerk-sdk-node@2.7.5...@clerk/clerk-sdk-node@2.8.0) (2022-02-02) - ### Features -* **backend-core,clerk-sdk-node,edge:** Add support to verify azp session token claim ([eab1c8c](https://github.com/clerkinc/javascript/commit/eab1c8c8a43960fee2da9c10a52c3915cd37f45c)) - - +- **backend-core,clerk-sdk-node,edge:** Add support to verify azp session token claim ([eab1c8c](https://github.com/clerkinc/javascript/commit/eab1c8c8a43960fee2da9c10a52c3915cd37f45c)) ### [2.7.5](https://github.com/clerkinc/javascript/compare/@clerk/clerk-sdk-node@2.7.4...@clerk/clerk-sdk-node@2.7.5) (2022-01-28) - ### Bug Fixes -* **clerk-sdk-node:** Restore the setClerkHttpOptions capability ([ff9f518](https://github.com/clerkinc/javascript/commit/ff9f51860895033f5fe8a4fc12a18b0b204ad472)) - - +- **clerk-sdk-node:** Restore the setClerkHttpOptions capability ([ff9f518](https://github.com/clerkinc/javascript/commit/ff9f51860895033f5fe8a4fc12a18b0b204ad472)) ### [2.7.4](https://github.com/clerkinc/javascript/compare/@clerk/clerk-sdk-node@2.7.3...@clerk/clerk-sdk-node@2.7.4) (2022-01-26) - ### Reverts -* Revert "chore(release): Publish" ([df705e0](https://github.com/clerkinc/javascript/commit/df705e011f025e044c61aad2983e90afd94d5662)) - - +- Revert "chore(release): Publish" ([df705e0](https://github.com/clerkinc/javascript/commit/df705e011f025e044c61aad2983e90afd94d5662)) ### [2.7.3](https://github.com/clerkinc/javascript/compare/@clerk/clerk-sdk-node@2.7.2...@clerk/clerk-sdk-node@2.7.3) (2022-01-25) - ### Bug Fixes -* **clerk-sdk-node:** Correctly pass responseType on got options for interstitial logic ([6fd58bb](https://github.com/clerkinc/javascript/commit/6fd58bb31083fd28bba06b7224e1d5f30df68bbb)) - +- **clerk-sdk-node:** Correctly pass responseType on got options for interstitial logic ([6fd58bb](https://github.com/clerkinc/javascript/commit/6fd58bb31083fd28bba06b7224e1d5f30df68bbb)) ### Reverts -* Revert "chore(release): Publish" ([df705e0](https://github.com/clerkinc/javascript/commit/df705e011f025e044c61aad2983e90afd94d5662)) - - +- Revert "chore(release): Publish" ([df705e0](https://github.com/clerkinc/javascript/commit/df705e011f025e044c61aad2983e90afd94d5662)) ### [2.7.2](https://github.com/clerkinc/javascript/compare/@clerk/clerk-sdk-node@2.7.1...@clerk/clerk-sdk-node@2.7.2) (2022-01-20) **Note:** Version bump only for package @clerk/clerk-sdk-node - - - - ### [2.7.1](https://github.com/clerkinc/javascript/compare/@clerk/clerk-sdk-node@2.7.0...@clerk/clerk-sdk-node@2.7.1) (2022-01-20) - ### Bug Fixes -* **clerk-sdk-node:** Restore verifyToken utility ([e22ef8a](https://github.com/clerkinc/javascript/commit/e22ef8aa3f4db1e14391f88bb924a82f6b17ba6a)) - - +- **clerk-sdk-node:** Restore verifyToken utility ([e22ef8a](https://github.com/clerkinc/javascript/commit/e22ef8aa3f4db1e14391f88bb924a82f6b17ba6a)) ## [2.7.0](https://github.com/clerkinc/javascript/compare/@clerk/clerk-sdk-node@2.7.0-alpha.3...@clerk/clerk-sdk-node@2.7.0) (2022-01-20) **Note:** Version bump only for package @clerk/clerk-sdk-node - - - - ## [2.7.0-alpha.3](https://github.com/clerkinc/javascript/compare/@clerk/clerk-sdk-node@2.7.0-alpha.2...@clerk/clerk-sdk-node@2.7.0-alpha.3) (2022-01-20) - ### Bug Fixes -* **backend-core:** Fix build issue ([2b60c40](https://github.com/clerkinc/javascript/commit/2b60c409fc450c77aa9585e96131de11f5924f50)) - - +- **backend-core:** Fix build issue ([2b60c40](https://github.com/clerkinc/javascript/commit/2b60c409fc450c77aa9585e96131de11f5924f50)) ## [2.7.0-alpha.2](https://github.com/clerkinc/javascript/compare/@clerk/clerk-sdk-node@2.7.0-alpha.1...@clerk/clerk-sdk-node@2.7.0-alpha.2) (2022-01-20) - ### Bug Fixes -* **backend-core:** Add Readme links ([12509e3](https://github.com/clerkinc/javascript/commit/12509e32f6da37902cce94949459edffa4a63718)) - - +- **backend-core:** Add Readme links ([12509e3](https://github.com/clerkinc/javascript/commit/12509e32f6da37902cce94949459edffa4a63718)) ## 2.7.0-alpha.1 (2022-01-20) - ### Features -* Add injectable loadCryptoKeyFunction ([637b854](https://github.com/clerkinc/javascript/commit/637b8547447bdfb5f1cac8718d007e665b433f70)) -* Consistent imports rule ([fb81176](https://github.com/clerkinc/javascript/commit/fb81176b9db0a95a84d19f61e15a9c65a12fc98e)) -* npm workspaces and lerna setup ([cfbfebf](https://github.com/clerkinc/javascript/commit/cfbfebfd0d5f88a96b4715e4be52bff7f37cc3db)) -* SDK Node resource and APIs from @clerk/backend-core ([6a32317](https://github.com/clerkinc/javascript/commit/6a323175f9361c32192a4a6be4139b88945a857c)) -* Update READMEs, API reference for @clerk/backend-core, minor fixes ([529c2f6](https://github.com/clerkinc/javascript/commit/529c2f629ec02895f9f049d29b5775f16ef5c6e9)) - +- Add injectable loadCryptoKeyFunction ([637b854](https://github.com/clerkinc/javascript/commit/637b8547447bdfb5f1cac8718d007e665b433f70)) +- Consistent imports rule ([fb81176](https://github.com/clerkinc/javascript/commit/fb81176b9db0a95a84d19f61e15a9c65a12fc98e)) +- npm workspaces and lerna setup ([cfbfebf](https://github.com/clerkinc/javascript/commit/cfbfebfd0d5f88a96b4715e4be52bff7f37cc3db)) +- SDK Node resource and APIs from @clerk/backend-core ([6a32317](https://github.com/clerkinc/javascript/commit/6a323175f9361c32192a4a6be4139b88945a857c)) +- Update READMEs, API reference for @clerk/backend-core, minor fixes ([529c2f6](https://github.com/clerkinc/javascript/commit/529c2f629ec02895f9f049d29b5775f16ef5c6e9)) ### Bug Fixes -* **backend-core:** Fix cross-origin detection algorithm ([fd99eae](https://github.com/clerkinc/javascript/commit/fd99eae111469c5d0028fd46b8bcbf1c5a8325b0)) -* **clerk-sdk-node:** Correctly apply body deserialization ([fefc084](https://github.com/clerkinc/javascript/commit/fefc084a3680c071a62dfe573cd5e6e2d5d769f3)) -* **clerk-sdk-node:** Fix string minor typing ([219c1a1](https://github.com/clerkinc/javascript/commit/219c1a1b9c4cf49cc02c132986db5f08088fafdd)) -* **clerk-sdk-node:** Fix version file ([88b4897](https://github.com/clerkinc/javascript/commit/88b4897d74a30cb67b0e39c72eac9e263030f3b2)) -* **clerk-sdk-node:** Properly import key from jwk ([e982fd0](https://github.com/clerkinc/javascript/commit/e982fd07bfd3354c108efc14775d03087e816651)) -* Remove coverage folder ([e009e7d](https://github.com/clerkinc/javascript/commit/e009e7d794db052cbf74433fb0cf01203cecce4d)) - - +- **backend-core:** Fix cross-origin detection algorithm ([fd99eae](https://github.com/clerkinc/javascript/commit/fd99eae111469c5d0028fd46b8bcbf1c5a8325b0)) +- **clerk-sdk-node:** Correctly apply body deserialization ([fefc084](https://github.com/clerkinc/javascript/commit/fefc084a3680c071a62dfe573cd5e6e2d5d769f3)) +- **clerk-sdk-node:** Fix string minor typing ([219c1a1](https://github.com/clerkinc/javascript/commit/219c1a1b9c4cf49cc02c132986db5f08088fafdd)) +- **clerk-sdk-node:** Fix version file ([88b4897](https://github.com/clerkinc/javascript/commit/88b4897d74a30cb67b0e39c72eac9e263030f3b2)) +- **clerk-sdk-node:** Properly import key from jwk ([e982fd0](https://github.com/clerkinc/javascript/commit/e982fd07bfd3354c108efc14775d03087e816651)) +- Remove coverage folder ([e009e7d](https://github.com/clerkinc/javascript/commit/e009e7d794db052cbf74433fb0cf01203cecce4d)) ## 2.7.0-alpha.0 (2022-01-20) - ### Features -* Add injectable loadCryptoKeyFunction ([637b854](https://github.com/clerkinc/clerk-sdk-node/commit/637b8547447bdfb5f1cac8718d007e665b433f70)) -* Consistent imports rule ([fb81176](https://github.com/clerkinc/clerk-sdk-node/commit/fb81176b9db0a95a84d19f61e15a9c65a12fc98e)) -* npm workspaces and lerna setup ([cfbfebf](https://github.com/clerkinc/clerk-sdk-node/commit/cfbfebfd0d5f88a96b4715e4be52bff7f37cc3db)) -* SDK Node resource and APIs from @clerk/backend-core ([6a32317](https://github.com/clerkinc/clerk-sdk-node/commit/6a323175f9361c32192a4a6be4139b88945a857c)) -* Update READMEs, API reference for @clerk/backend-core, minor fixes ([529c2f6](https://github.com/clerkinc/clerk-sdk-node/commit/529c2f629ec02895f9f049d29b5775f16ef5c6e9)) - +- Add injectable loadCryptoKeyFunction ([637b854](https://github.com/clerkinc/clerk-sdk-node/commit/637b8547447bdfb5f1cac8718d007e665b433f70)) +- Consistent imports rule ([fb81176](https://github.com/clerkinc/clerk-sdk-node/commit/fb81176b9db0a95a84d19f61e15a9c65a12fc98e)) +- npm workspaces and lerna setup ([cfbfebf](https://github.com/clerkinc/clerk-sdk-node/commit/cfbfebfd0d5f88a96b4715e4be52bff7f37cc3db)) +- SDK Node resource and APIs from @clerk/backend-core ([6a32317](https://github.com/clerkinc/clerk-sdk-node/commit/6a323175f9361c32192a4a6be4139b88945a857c)) +- Update READMEs, API reference for @clerk/backend-core, minor fixes ([529c2f6](https://github.com/clerkinc/clerk-sdk-node/commit/529c2f629ec02895f9f049d29b5775f16ef5c6e9)) ### Bug Fixes -* **clerk-sdk-node:** Correctly apply body deserialization ([fefc084](https://github.com/clerkinc/clerk-sdk-node/commit/fefc084a3680c071a62dfe573cd5e6e2d5d769f3)) -* **clerk-sdk-node:** Fix string minor typing ([219c1a1](https://github.com/clerkinc/clerk-sdk-node/commit/219c1a1b9c4cf49cc02c132986db5f08088fafdd)) -* **clerk-sdk-node:** Fix version file ([88b4897](https://github.com/clerkinc/clerk-sdk-node/commit/88b4897d74a30cb67b0e39c72eac9e263030f3b2)) -* **clerk-sdk-node:** Properly import key from jwk ([e982fd0](https://github.com/clerkinc/clerk-sdk-node/commit/e982fd07bfd3354c108efc14775d03087e816651)) -* Remove coverage folder ([e009e7d](https://github.com/clerkinc/clerk-sdk-node/commit/e009e7d794db052cbf74433fb0cf01203cecce4d)) - - +- **clerk-sdk-node:** Correctly apply body deserialization ([fefc084](https://github.com/clerkinc/clerk-sdk-node/commit/fefc084a3680c071a62dfe573cd5e6e2d5d769f3)) +- **clerk-sdk-node:** Fix string minor typing ([219c1a1](https://github.com/clerkinc/clerk-sdk-node/commit/219c1a1b9c4cf49cc02c132986db5f08088fafdd)) +- **clerk-sdk-node:** Fix version file ([88b4897](https://github.com/clerkinc/clerk-sdk-node/commit/88b4897d74a30cb67b0e39c72eac9e263030f3b2)) +- **clerk-sdk-node:** Properly import key from jwk ([e982fd0](https://github.com/clerkinc/clerk-sdk-node/commit/e982fd07bfd3354c108efc14775d03087e816651)) +- Remove coverage folder ([e009e7d](https://github.com/clerkinc/clerk-sdk-node/commit/e009e7d794db052cbf74433fb0cf01203cecce4d)) ## 2.6.3 (2022-01-20) - ### Features -* Switch repo from [https://github.com/clerkinc/clerk-sdk-node/](https://github.com/clerkinc/clerk-sdk-node/) 🎊 +- Switch repo from [https://github.com/clerkinc/clerk-sdk-node/](https://github.com/clerkinc/clerk-sdk-node/) 🎊 diff --git a/packages/sdk-node/package.json b/packages/sdk-node/package.json index 7b1d608edce..a9a144c6d26 100644 --- a/packages/sdk-node/package.json +++ b/packages/sdk-node/package.json @@ -1,5 +1,5 @@ { - "version": "3.0.1-staging.0", + "version": "3.0.1-alpha.0", "license": "MIT", "main": "dist/index.js", "module": "esm/index.js", @@ -51,7 +51,7 @@ "typescript": "^4.6.2" }, "dependencies": { - "@clerk/backend-core": "^0.6.4-staging.0", + "@clerk/backend-core": "^0.6.4-alpha.0", "@peculiar/webcrypto": "^1.2.3", "camelcase-keys": "^6.2.2", "cookies": "^0.8.0", diff --git a/packages/sdk-node/src/info.ts b/packages/sdk-node/src/info.ts index c4b0e6661a5..c7819aaa72c 100644 --- a/packages/sdk-node/src/info.ts +++ b/packages/sdk-node/src/info.ts @@ -1,3 +1,3 @@ /** DO NOT EDIT: This file is automatically generated by ../scripts/info.js */ -export const LIB_VERSION = '3.0.1-staging.0'; +export const LIB_VERSION = '3.0.1-alpha.0'; export const LIB_NAME = '@clerk/clerk-sdk-node'; diff --git a/packages/shared/CHANGELOG.md b/packages/shared/CHANGELOG.md index c8ab6cccdca..ae681aa35d9 100644 --- a/packages/shared/CHANGELOG.md +++ b/packages/shared/CHANGELOG.md @@ -3,119 +3,68 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. -### [0.0.15](https://github.com/clerkinc/clerk_docker/compare/@clerk/shared@0.0.15-staging.1...@clerk/shared@0.0.15) (2022-03-17) +### [0.0.16-alpha.0](https://github.com/clerkinc/clerk_docker/compare/@clerk/shared@0.0.16-staging.0...@clerk/shared@0.0.16-alpha.0) (2022-03-19) **Note:** Version bump only for package @clerk/shared +### [0.0.15](https://github.com/clerkinc/clerk_docker/compare/@clerk/shared@0.0.15-staging.1...@clerk/shared@0.0.15) (2022-03-17) - - +**Note:** Version bump only for package @clerk/shared ### [0.0.15-staging.1](https://github.com/clerkinc/clerk_docker/compare/@clerk/shared@0.0.15-staging.0...@clerk/shared@0.0.15-staging.1) (2022-03-17) **Note:** Version bump only for package @clerk/shared - - - - ### [0.0.13](https://github.com/clerkinc/clerk_docker/compare/@clerk/shared@0.0.12...@clerk/shared@0.0.13) (2022-03-11) **Note:** Version bump only for package @clerk/shared - - - - ### [0.0.12](https://github.com/clerkinc/clerk_docker/compare/@clerk/shared@0.0.12-staging.0...@clerk/shared@0.0.12) (2022-03-09) **Note:** Version bump only for package @clerk/shared - - - - ### [0.0.10](https://github.com/clerkinc/clerk_docker/compare/@clerk/shared@0.0.9...@clerk/shared@0.0.10) (2022-03-04) **Note:** Version bump only for package @clerk/shared - - - - ### [0.0.9](https://github.com/clerkinc/clerk_docker/compare/@clerk/shared@0.0.8...@clerk/shared@0.0.9) (2022-03-04) **Note:** Version bump only for package @clerk/shared - - - - ### [0.0.8](https://github.com/clerkinc/clerk_docker/compare/@clerk/shared@0.0.7...@clerk/shared@0.0.8) (2022-03-03) **Note:** Version bump only for package @clerk/shared - - - - ### [0.0.7](https://github.com/clerkinc/clerk_docker/compare/@clerk/shared@0.0.6...@clerk/shared@0.0.7) (2022-03-02) **Note:** Version bump only for package @clerk/shared - - - - ### [0.0.6](https://github.com/clerkinc/clerk_docker/compare/@clerk/shared@0.0.5...@clerk/shared@0.0.6) (2022-03-01) - ### Bug Fixes -* **shared:** Phone input should start blank ([43f0b06](https://github.com/clerkinc/clerk_docker/commit/43f0b0603608866f6b9e0a37a284c0ea72c0004b)) - - +- **shared:** Phone input should start blank ([43f0b06](https://github.com/clerkinc/clerk_docker/commit/43f0b0603608866f6b9e0a37a284c0ea72c0004b)) ### [0.0.5](https://github.com/clerkinc/clerk_docker/compare/@clerk/shared@0.0.5-staging.0...@clerk/shared@0.0.5) (2022-02-24) **Note:** Version bump only for package @clerk/shared - - - - ### [0.0.5-staging.0](https://github.com/clerkinc/clerk_docker/compare/@clerk/shared@0.0.4-staging.0...@clerk/shared@0.0.5-staging.0) (2022-02-24) **Note:** Version bump only for package @clerk/shared - - - - ### [0.0.4-staging.0](https://github.com/clerkinc/clerk_docker/compare/@clerk/shared@0.0.3-staging.0...@clerk/shared@0.0.4-staging.0) (2022-02-17) **Note:** Version bump only for package @clerk/shared - - - - ### [0.0.3-staging.0](https://github.com/clerkinc/clerk_docker/compare/@clerk/shared@0.0.2...@clerk/shared@0.0.3-staging.0) (2022-02-15) **Note:** Version bump only for package @clerk/shared - - - - ### [0.0.2](https://github.com/clerkinc/clerk_docker/compare/@clerk/shared@0.0.2-staging.0...@clerk/shared@0.0.2) (2022-02-14) **Note:** Version bump only for package @clerk/shared - - - - ### 0.0.2-staging.0 (2022-02-11) **Note:** Version bump only for package @clerk/shared diff --git a/packages/shared/package.json b/packages/shared/package.json index ce00a97ae94..8bc7d5232b4 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@clerk/shared", - "version": "0.0.16-staging.0", + "version": "0.0.16-alpha.0", "private": true, "main": "index.js", "module": "index.js", @@ -26,7 +26,7 @@ "@babel/core": "^7.13.14", "@babel/preset-env": "^7.13.12", "@babel/preset-react": "^7.13.13", - "@clerk/types": "^2.0.1-staging.0", + "@clerk/types": "^2.0.1-alpha.0", "@popperjs/core": "^2.5.4", "@sentry/browser": "^6.3.0", "@svgr/webpack": "^6.2.1", diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index 59672c05818..fe0c532fd7b 100644 --- a/packages/types/CHANGELOG.md +++ b/packages/types/CHANGELOG.md @@ -3,185 +3,129 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. -## [2.0.0-alpha.9](https://github.com/clerkinc/javascript/compare/@clerk/types@1.28.3...@clerk/types@2.0.0-alpha.9) (2022-03-11) +### [2.0.1-alpha.0](https://github.com/clerkinc/javascript/compare/@clerk/types@2.0.1-staging.0...@clerk/types@2.0.1-alpha.0) (2022-03-19) +### Bug Fixes -### Features +- **clerk-js:** Fix signIn.prepareFirstFactor params ([e435245](https://github.com/clerkinc/javascript/commit/e4352454028099f0973203aa79e548890c6327bd)) +- **clerk-js:** Make getToken use /user endpoint for integration tokens ([b61213b](https://github.com/clerkinc/javascript/commit/b61213b4c94952e6f21dd8e036aa6815c5c38c06)) -* **nextjs:** Move shared NextJS SSR types to types package ([78d8c7c](https://github.com/clerkinc/javascript/commit/78d8c7c3e84f3926127e48c655793a0fca3cdc2c)) -* **types:** Support for oauth_apple ([57b675c](https://github.com/clerkinc/javascript/commit/57b675c762187d1f16cde6d2577bac71f7993438)) +## [2.0.0-alpha.9](https://github.com/clerkinc/javascript/compare/@clerk/types@1.28.3...@clerk/types@2.0.0-alpha.9) (2022-03-11) +### Features +- **nextjs:** Move shared NextJS SSR types to types package ([78d8c7c](https://github.com/clerkinc/javascript/commit/78d8c7c3e84f3926127e48c655793a0fca3cdc2c)) +- **types:** Support for oauth_apple ([57b675c](https://github.com/clerkinc/javascript/commit/57b675c762187d1f16cde6d2577bac71f7993438)) ## [2.0.0-alpha.8](https://github.com/clerkinc/javascript/compare/@clerk/types@1.25.4...@clerk/types@2.0.0-alpha.8) (2022-02-28) - ### Features -* **nextjs:** Move shared NextJS SSR types to types package ([78d8c7c](https://github.com/clerkinc/javascript/commit/78d8c7c3e84f3926127e48c655793a0fca3cdc2c)) -* **types:** Add support for oauth_microsoft ([96c1cc6](https://github.com/clerkinc/javascript/commit/96c1cc6817b9bbc6917ea2773498299c1ff9b951)) - - +- **nextjs:** Move shared NextJS SSR types to types package ([78d8c7c](https://github.com/clerkinc/javascript/commit/78d8c7c3e84f3926127e48c655793a0fca3cdc2c)) +- **types:** Add support for oauth_microsoft ([96c1cc6](https://github.com/clerkinc/javascript/commit/96c1cc6817b9bbc6917ea2773498299c1ff9b951)) ## [2.0.0-alpha.7](https://github.com/clerkinc/javascript/compare/@clerk/types@1.25.4...@clerk/types@2.0.0-alpha.7) (2022-02-25) - ### Features -* **nextjs:** Move shared NextJS SSR types to types package ([8b898a1](https://github.com/clerkinc/javascript/commit/8b898a1aa503889921180850292fbfa3c8133ef5)) - - +- **nextjs:** Move shared NextJS SSR types to types package ([8b898a1](https://github.com/clerkinc/javascript/commit/8b898a1aa503889921180850292fbfa3c8133ef5)) ## [2.0.0-alpha.6](https://github.com/clerkinc/javascript/compare/@clerk/types@1.25.1-staging.0...@clerk/types@2.0.0-alpha.6) (2022-02-18) - ### Features -* **nextjs:** Move shared NextJS SSR types to types package ([757dc2e](https://github.com/clerkinc/javascript/commit/757dc2ef1acf32f31bdad8bcab076bb710723781)) - - - +- **nextjs:** Move shared NextJS SSR types to types package ([757dc2e](https://github.com/clerkinc/javascript/commit/757dc2ef1acf32f31bdad8bcab076bb710723781)) ### [1.29.2](https://github.com/clerkinc/javascript/compare/@clerk/types@1.29.2-staging.1...@clerk/types@1.29.2) (2022-03-17) **Note:** Version bump only for package @clerk/types - - - - ### [1.29.2-staging.1](https://github.com/clerkinc/javascript/compare/@clerk/types@1.29.2-staging.0...@clerk/types@1.29.2-staging.1) (2022-03-17) **Note:** Version bump only for package @clerk/types - - - - ## [1.29.0](https://github.com/clerkinc/javascript/compare/@clerk/types@1.28.3...@clerk/types@1.29.0) (2022-03-11) - ### Features -* **types:** Support for oauth_apple ([57b675c](https://github.com/clerkinc/javascript/commit/57b675c762187d1f16cde6d2577bac71f7993438)) - - +- **types:** Support for oauth_apple ([57b675c](https://github.com/clerkinc/javascript/commit/57b675c762187d1f16cde6d2577bac71f7993438)) ### [1.28.3](https://github.com/clerkinc/javascript/compare/@clerk/types@1.28.3-staging.0...@clerk/types@1.28.3) (2022-03-09) **Note:** Version bump only for package @clerk/types - - - - ### [1.28.1](https://github.com/clerkinc/javascript/compare/@clerk/types@1.28.0...@clerk/types@1.28.1) (2022-03-04) - ### Bug Fixes -* **clerk-react,clerk-js,types:** Crate of API feedback fixes ([721ce72](https://github.com/clerkinc/javascript/commit/721ce7228c37b012891b2bec8caf290239164d05)) -* **types:** Add OrganizationMembership methods on types ([8bac04c](https://github.com/clerkinc/javascript/commit/8bac04c90ab79c6fb2e319f5c566f421e5984fa7)) -* **types:** Change type import from dot ([a1cdb79](https://github.com/clerkinc/javascript/commit/a1cdb79f9abde74b92911394b50e7d75107a9cfd)) - - +- **clerk-react,clerk-js,types:** Crate of API feedback fixes ([721ce72](https://github.com/clerkinc/javascript/commit/721ce7228c37b012891b2bec8caf290239164d05)) +- **types:** Add OrganizationMembership methods on types ([8bac04c](https://github.com/clerkinc/javascript/commit/8bac04c90ab79c6fb2e319f5c566f421e5984fa7)) +- **types:** Change type import from dot ([a1cdb79](https://github.com/clerkinc/javascript/commit/a1cdb79f9abde74b92911394b50e7d75107a9cfd)) ## [1.28.0](https://github.com/clerkinc/javascript/compare/@clerk/types@1.27.1...@clerk/types@1.28.0) (2022-03-04) - ### Features -* **clerk-js,clerk-react:** GetOrganization/s hook methods, fetching mechanism alignment ([fc11087](https://github.com/clerkinc/javascript/commit/fc110874f9a3e056cd43c773c267409dd9b318d6)) -* **clerk-js:** Add more attributes on organization models ([af010ba](https://github.com/clerkinc/javascript/commit/af010bac4b6e0519eff42d210049c7b3a6bda203)) -* **clerk-js:** Add organization basic resources ([09f9012](https://github.com/clerkinc/javascript/commit/09f90126282f757cee6f97e7eae8747abc641bb0)) -* **clerk-js:** Basic organization data shape tests ([0ca9a31](https://github.com/clerkinc/javascript/commit/0ca9a3114b34bfaa338e6e90f1b0d57e02b7dd58)) -* **clerk-js:** Invitation flow draft ([d6faaab](https://github.com/clerkinc/javascript/commit/d6faaabb7efec09a699c7e83ba24fd4bad199d6b)) -* **clerk-js:** Sign up next draft and fixes ([e2eef78](https://github.com/clerkinc/javascript/commit/e2eef782d644f7fd1925fee67ee81d27473255fc)) -* **clerk-js:** SignUp with organization invitation flow draft ([2a9edbd](https://github.com/clerkinc/javascript/commit/2a9edbd52916f9bc037f266d1f96269cf54023cb)) -* **clerk-react,clerk-js:** Add useOrganization hook using __unstable attribute ([1635132](https://github.com/clerkinc/javascript/commit/16351321a99945d167cbf6e6ca0efdbbbf7efe5a)) - +- **clerk-js,clerk-react:** GetOrganization/s hook methods, fetching mechanism alignment ([fc11087](https://github.com/clerkinc/javascript/commit/fc110874f9a3e056cd43c773c267409dd9b318d6)) +- **clerk-js:** Add more attributes on organization models ([af010ba](https://github.com/clerkinc/javascript/commit/af010bac4b6e0519eff42d210049c7b3a6bda203)) +- **clerk-js:** Add organization basic resources ([09f9012](https://github.com/clerkinc/javascript/commit/09f90126282f757cee6f97e7eae8747abc641bb0)) +- **clerk-js:** Basic organization data shape tests ([0ca9a31](https://github.com/clerkinc/javascript/commit/0ca9a3114b34bfaa338e6e90f1b0d57e02b7dd58)) +- **clerk-js:** Invitation flow draft ([d6faaab](https://github.com/clerkinc/javascript/commit/d6faaabb7efec09a699c7e83ba24fd4bad199d6b)) +- **clerk-js:** Sign up next draft and fixes ([e2eef78](https://github.com/clerkinc/javascript/commit/e2eef782d644f7fd1925fee67ee81d27473255fc)) +- **clerk-js:** SignUp with organization invitation flow draft ([2a9edbd](https://github.com/clerkinc/javascript/commit/2a9edbd52916f9bc037f266d1f96269cf54023cb)) +- **clerk-react,clerk-js:** Add useOrganization hook using \_\_unstable attribute ([1635132](https://github.com/clerkinc/javascript/commit/16351321a99945d167cbf6e6ca0efdbbbf7efe5a)) ### Bug Fixes -* **types:** Guarantee elements not in oauth sorting array will be sorted last ([f3c2869](https://github.com/clerkinc/javascript/commit/f3c2869bc244fc594522ef8f889055f82d31463f)) - - +- **types:** Guarantee elements not in oauth sorting array will be sorted last ([f3c2869](https://github.com/clerkinc/javascript/commit/f3c2869bc244fc594522ef8f889055f82d31463f)) ### [1.27.1](https://github.com/clerkinc/javascript/compare/@clerk/types@1.27.0...@clerk/types@1.27.1) (2022-03-03) - ### Bug Fixes -* **types:** Consolidate oauth provider types ([bce9ef5](https://github.com/clerkinc/javascript/commit/bce9ef5cbfe02e11fe71db3e34dbf4fd9be9c3ed)) - - +- **types:** Consolidate oauth provider types ([bce9ef5](https://github.com/clerkinc/javascript/commit/bce9ef5cbfe02e11fe71db3e34dbf4fd9be9c3ed)) ## [1.27.0](https://github.com/clerkinc/javascript/compare/@clerk/types@1.26.0...@clerk/types@1.27.0) (2022-03-02) - ### Features -* **types,clerk-js:** Introduce Notion OAuth ([#72](https://github.com/clerkinc/javascript/issues/72)) ([9e556d0](https://github.com/clerkinc/javascript/commit/9e556d00fb41dedbbd05de59947d00c720bb3d95)) - - +- **types,clerk-js:** Introduce Notion OAuth ([#72](https://github.com/clerkinc/javascript/issues/72)) ([9e556d0](https://github.com/clerkinc/javascript/commit/9e556d00fb41dedbbd05de59947d00c720bb3d95)) ## [1.26.0](https://github.com/clerkinc/javascript/compare/@clerk/types@1.25.4...@clerk/types@1.26.0) (2022-03-01) - ### Features -* **types:** Add support for oauth_microsoft ([96c1cc6](https://github.com/clerkinc/javascript/commit/96c1cc6817b9bbc6917ea2773498299c1ff9b951)) - - +- **types:** Add support for oauth_microsoft ([96c1cc6](https://github.com/clerkinc/javascript/commit/96c1cc6817b9bbc6917ea2773498299c1ff9b951)) ### [1.25.4](https://github.com/clerkinc/javascript/compare/@clerk/types@1.25.4-staging.0...@clerk/types@1.25.4) (2022-02-24) **Note:** Version bump only for package @clerk/types - - - - ### [1.25.4-staging.0](https://github.com/clerkinc/javascript/compare/@clerk/types@1.25.3-staging.0...@clerk/types@1.25.4-staging.0) (2022-02-24) - ### Features -* **clerk-js:** Introduce `UserSettings.instanceIsPasswordBased` ([f72a555](https://github.com/clerkinc/javascript/commit/f72a555f6adb38870539e9bab63cb638c04517d6)) - +- **clerk-js:** Introduce `UserSettings.instanceIsPasswordBased` ([f72a555](https://github.com/clerkinc/javascript/commit/f72a555f6adb38870539e9bab63cb638c04517d6)) ### Bug Fixes -* **clerk-js,clerk-react:** Revert user settings work ([9a70576](https://github.com/clerkinc/javascript/commit/9a70576d1a47f01e6dbbfd8704f321daddcfe590)) - - +- **clerk-js,clerk-react:** Revert user settings work ([9a70576](https://github.com/clerkinc/javascript/commit/9a70576d1a47f01e6dbbfd8704f321daddcfe590)) ### [1.25.3-staging.0](https://github.com/clerkinc/javascript/compare/@clerk/types@1.25.2-staging.0...@clerk/types@1.25.3-staging.0) (2022-02-17) **Note:** Version bump only for package @clerk/types - - - - ### [1.25.2-staging.0](https://github.com/clerkinc/javascript/compare/@clerk/types@1.25.1...@clerk/types@1.25.2-staging.0) (2022-02-15) - ### Features -* **clerk-js:** Refactor signUp utils to work with userSettings ([0eb3352](https://github.com/clerkinc/javascript/commit/0eb3352cf93c35eb5de162822802124248cef840)) -* **types:** Introduce 'UserSettingsResource' ([32fcf04](https://github.com/clerkinc/javascript/commit/32fcf0477e6db4851f4de50904c02868ba1790ee)) - - +- **clerk-js:** Refactor signUp utils to work with userSettings ([0eb3352](https://github.com/clerkinc/javascript/commit/0eb3352cf93c35eb5de162822802124248cef840)) +- **types:** Introduce 'UserSettingsResource' ([32fcf04](https://github.com/clerkinc/javascript/commit/32fcf0477e6db4851f4de50904c02868ba1790ee)) ### [1.25.1](https://github.com/clerkinc/javascript/compare/@clerk/types@1.25.1-staging.0...@clerk/types@1.25.1) (2022-02-14) **Note:** Version bump only for package @clerk/types - - - - ### 1.25.1-staging.0 (2022-02-11) **Note:** Version bump only for package @clerk/types diff --git a/packages/types/package.json b/packages/types/package.json index 9165d9c42ea..959d74ac783 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@clerk/types", - "version": "2.0.1-staging.0", + "version": "2.0.1-alpha.0", "license": "MIT", "description": "Typings for Clerk libraries.", "keywords": [ diff --git a/packages/types/src/factors.ts b/packages/types/src/factors.ts index a1ddfd57829..a5967f1924e 100644 --- a/packages/types/src/factors.ts +++ b/packages/types/src/factors.ts @@ -40,10 +40,15 @@ export type OauthFactor = { }; export type EmailCodeConfig = Omit; -export type EmailLinkConfig = Omit & { redirectUrl: string }; +export type EmailLinkConfig = Omit & { + redirectUrl: string; +}; export type PhoneCodeConfig = Omit; export type Web3SignatureConfig = Web3SignatureFactor; -export type OAuthConfig = OauthFactor & { redirectUrl: string; actionCompleteRedirect_url: string }; +export type OAuthConfig = OauthFactor & { + redirectUrl: string; + actionCompleteRedirectUrl: string; +}; export type PhoneCodeSecondFactorConfig = { strategy: PhoneCodeStrategy; diff --git a/packages/types/src/session.ts b/packages/types/src/session.ts index d68bec2cf40..054fd5ff180 100644 --- a/packages/types/src/session.ts +++ b/packages/types/src/session.ts @@ -1,5 +1,5 @@ import { ClerkResource } from './resource'; -import { GetSessionTokenOptions, TokenResource } from './token'; +import { TokenResource } from './token'; import { UserResource } from './user'; export interface SessionResource extends ClerkResource { @@ -13,7 +13,7 @@ export interface SessionResource extends ClerkResource { end: () => Promise; remove: () => Promise; touch: () => Promise; - getToken: (options?: GetSessionTokenOptions) => Promise; + getToken: GetToken; createdAt: Date; updatedAt: Date; } @@ -60,3 +60,6 @@ export interface PublicUserData { identifier: string; userId?: string; } + +export type GetTokenOptions = { template: string; leewayInSeconds?: number; skipCache?: boolean }; +export type GetToken = (options?: GetTokenOptions) => Promise; diff --git a/packages/types/src/ssr.ts b/packages/types/src/ssr.ts index 5d6cb47ccc0..d2253c79bb0 100644 --- a/packages/types/src/ssr.ts +++ b/packages/types/src/ssr.ts @@ -2,13 +2,13 @@ import { SessionJSON, UserJSON } from './json'; import { SessionResource } from './session'; import { UserResource } from './user'; -export type GetTokenOptions = { template?: string }; -export type GetToken = (options?: GetTokenOptions) => Promise; +export type ServerGetTokenOptions = { template?: string }; +export type ServerGetToken = (options?: ServerGetTokenOptions) => Promise; export type ServerSideAuth = { sessionId: string | null; userId: string | null; - getToken: GetToken; + getToken: ServerGetToken; }; type SsrSessionState = diff --git a/packages/types/src/token.ts b/packages/types/src/token.ts index dc8ac2dc221..5af2f6beffd 100644 --- a/packages/types/src/token.ts +++ b/packages/types/src/token.ts @@ -1,19 +1,6 @@ import { JWT } from './jwt'; import { ClerkResource } from './resource'; -export type JWTService = 'clerk' | 'hasura' | 'firebase'; - -export type GetUserTokenOptions = { - leewayInSeconds?: number; -}; - -export type GetSessionTokenOptions = { - leewayInSeconds?: number; - template?: string; - throwOnError?: boolean; - skipCache?: boolean; -}; - export interface TokenResource extends ClerkResource { jwt: JWT; getRawString: () => string;