@clivly/auth-clerk 0.16.0 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2 -4
- package/dist/index.d.cts +0 -4
- package/dist/index.d.mts +0 -4
- package/dist/index.mjs +2 -4
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
let _clerk_backend = require("@clerk/backend");
|
|
3
|
-
|
|
3
|
+
// src/map.ts
|
|
4
4
|
function clerkUserToClivlyUser(user) {
|
|
5
5
|
const email = (user.emailAddresses?.find((address) => address.id === user.primaryEmailAddressId))?.emailAddress ?? user.emailAddresses?.[0]?.emailAddress;
|
|
6
6
|
if (!email) return null;
|
|
@@ -11,8 +11,7 @@ function clerkUserToClivlyUser(user) {
|
|
|
11
11
|
name
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
//#region src/index.ts
|
|
14
|
+
// src/index.ts
|
|
16
15
|
/**
|
|
17
16
|
* Clerk → ClivlyAuthAdapter. Resolves the CRM end-user's identity from the host
|
|
18
17
|
* app's Clerk session on each request. Answers "who is this person?" only —
|
|
@@ -29,6 +28,5 @@ function createClerkAuthAdapter(options) {
|
|
|
29
28
|
return clerkUserToClivlyUser(await client.users.getUser(auth.userId));
|
|
30
29
|
} };
|
|
31
30
|
}
|
|
32
|
-
//#endregion
|
|
33
31
|
exports.clerkUserToClivlyUser = clerkUserToClivlyUser;
|
|
34
32
|
exports.createClerkAuthAdapter = createClerkAuthAdapter;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ClivlyAuthAdapter, ClivlyUser } from "@clivly/core/auth-adapter";
|
|
2
|
-
//#region src/map.d.ts
|
|
3
2
|
interface ClerkLikeUser {
|
|
4
3
|
emailAddresses?: Array<{
|
|
5
4
|
id: string;
|
|
@@ -11,8 +10,6 @@ interface ClerkLikeUser {
|
|
|
11
10
|
primaryEmailAddressId?: string | null;
|
|
12
11
|
}
|
|
13
12
|
export declare function clerkUserToClivlyUser(user: ClerkLikeUser): ClivlyUser | null;
|
|
14
|
-
//#endregion
|
|
15
|
-
//#region src/index.d.ts
|
|
16
13
|
export interface ClerkAuthAdapterOptions {
|
|
17
14
|
/** Origins allowed to make authenticated requests (CSRF protection). */
|
|
18
15
|
authorizedParties?: string[];
|
|
@@ -27,5 +24,4 @@ export interface ClerkAuthAdapterOptions {
|
|
|
27
24
|
* CRM authorization lives in the separate `crm_members` layer.
|
|
28
25
|
*/
|
|
29
26
|
export declare function createClerkAuthAdapter(options: ClerkAuthAdapterOptions): ClivlyAuthAdapter;
|
|
30
|
-
//#endregion
|
|
31
27
|
export type { ClerkLikeUser };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ClivlyAuthAdapter, ClivlyUser } from "@clivly/core/auth-adapter";
|
|
2
|
-
//#region src/map.d.ts
|
|
3
2
|
interface ClerkLikeUser {
|
|
4
3
|
emailAddresses?: Array<{
|
|
5
4
|
id: string;
|
|
@@ -11,8 +10,6 @@ interface ClerkLikeUser {
|
|
|
11
10
|
primaryEmailAddressId?: string | null;
|
|
12
11
|
}
|
|
13
12
|
export declare function clerkUserToClivlyUser(user: ClerkLikeUser): ClivlyUser | null;
|
|
14
|
-
//#endregion
|
|
15
|
-
//#region src/index.d.ts
|
|
16
13
|
export interface ClerkAuthAdapterOptions {
|
|
17
14
|
/** Origins allowed to make authenticated requests (CSRF protection). */
|
|
18
15
|
authorizedParties?: string[];
|
|
@@ -27,5 +24,4 @@ export interface ClerkAuthAdapterOptions {
|
|
|
27
24
|
* CRM authorization lives in the separate `crm_members` layer.
|
|
28
25
|
*/
|
|
29
26
|
export declare function createClerkAuthAdapter(options: ClerkAuthAdapterOptions): ClivlyAuthAdapter;
|
|
30
|
-
//#endregion
|
|
31
27
|
export type { ClerkLikeUser };
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createClerkClient } from "@clerk/backend";
|
|
2
|
-
|
|
2
|
+
// src/map.ts
|
|
3
3
|
function clerkUserToClivlyUser(user) {
|
|
4
4
|
const email = (user.emailAddresses?.find((address) => address.id === user.primaryEmailAddressId))?.emailAddress ?? user.emailAddresses?.[0]?.emailAddress;
|
|
5
5
|
if (!email) return null;
|
|
@@ -10,8 +10,7 @@ function clerkUserToClivlyUser(user) {
|
|
|
10
10
|
name
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
|
-
|
|
14
|
-
//#region src/index.ts
|
|
13
|
+
// src/index.ts
|
|
15
14
|
/**
|
|
16
15
|
* Clerk → ClivlyAuthAdapter. Resolves the CRM end-user's identity from the host
|
|
17
16
|
* app's Clerk session on each request. Answers "who is this person?" only —
|
|
@@ -28,5 +27,4 @@ function createClerkAuthAdapter(options) {
|
|
|
28
27
|
return clerkUserToClivlyUser(await client.users.getUser(auth.userId));
|
|
29
28
|
} };
|
|
30
29
|
}
|
|
31
|
-
//#endregion
|
|
32
30
|
export { clerkUserToClivlyUser, createClerkAuthAdapter };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clivly/auth-clerk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Clerk implementation of Clivly's ClivlyAuthAdapter.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
"README.md"
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@clivly/core": "0.
|
|
26
|
+
"@clivly/core": "0.17.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@clerk/backend": "^3.16.1",
|
|
30
|
-
"tsdown": "^0.23.
|
|
30
|
+
"tsdown": "^0.23.2",
|
|
31
31
|
"typescript": "^6",
|
|
32
32
|
"vitest": "3.2.7"
|
|
33
33
|
},
|