@clivly/auth-clerk 0.16.0 → 0.17.1

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/README.md CHANGED
@@ -75,9 +75,9 @@ const authAdapter = createClerkAuthAdapter({
75
75
 
76
76
  ## Related documentation
77
77
 
78
- - **[Connecting to Clivly Cloud](https://github.com/amani-joseph/clivly.com/blob/master/docs/guides/connecting-to-clivly-cloud.md#auth-adapters-optional)** — where auth adapters fit in the setup
79
- - [`@clivly/core` README](https://github.com/amani-joseph/clivly.com/blob/master/packages/core/README.md) — the `ClivlyAuthAdapter` contract
80
- - [`clivly` CLI README](https://github.com/amani-joseph/clivly.com/blob/master/packages/cli/README.md)
78
+ - **[Auth adapters](https://clivly.com/docs/guides/auth)** — where auth adapters fit in the setup
79
+ - [`@clivly/core` reference](https://clivly.com/docs/reference/packages) — the `ClivlyAuthAdapter` contract
80
+ - [`clivly` CLI reference](https://clivly.com/docs/reference/cli)
81
81
 
82
82
  ## License
83
83
 
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
- //#region src/map.ts
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
- //#endregion
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
- //#region src/map.ts
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
- //#endregion
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.16.0",
3
+ "version": "0.17.1",
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.16.0"
26
+ "@clivly/core": "0.17.1"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@clerk/backend": "^3.16.1",
30
- "tsdown": "^0.23.0",
30
+ "tsdown": "^0.23.2",
31
31
  "typescript": "^6",
32
32
  "vitest": "3.2.7"
33
33
  },