clivly 0.23.1 → 0.24.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/README.md +28 -0
  2. package/{adapter-B4v4dwgD.d.mts → adapter--YV7du3i.d.cts} +1 -1
  3. package/{adapter-BK3gsby5.d.cts → adapter-DD3K3dCW.d.mts} +1 -1
  4. package/{auth-adapter-BIa-ZyVV.d.mts → auth-adapter-C17dzlzF.d.cts} +1 -1
  5. package/{auth-adapter-DwtMJb7D.d.cts → auth-adapter-CizFv7oU.d.mts} +1 -1
  6. package/auth-better-auth.d.cts +1 -1
  7. package/auth-better-auth.d.mts +1 -1
  8. package/auth-clerk.d.cts +1 -1
  9. package/auth-clerk.d.mts +1 -1
  10. package/auth-supabase.cjs +121 -0
  11. package/auth-supabase.d.cts +23 -0
  12. package/auth-supabase.d.mts +23 -0
  13. package/auth-supabase.mjs +119 -0
  14. package/auth-workos.d.cts +1 -1
  15. package/auth-workos.d.mts +1 -1
  16. package/core-adapter.d.cts +1 -1
  17. package/core-adapter.d.mts +1 -1
  18. package/core-auth-adapter.d.cts +1 -1
  19. package/core-auth-adapter.d.mts +1 -1
  20. package/core-mapping-score.d.cts +1 -0
  21. package/core-sync-engine.cjs +1 -1
  22. package/core-sync-engine.mjs +1 -1
  23. package/core-types.cjs +5 -1
  24. package/core-types.d.cts +2 -2
  25. package/core-types.d.mts +2 -2
  26. package/core-types.mjs +1 -1
  27. package/core-view-compiler.cjs +1 -1
  28. package/core-view-compiler.mjs +1 -1
  29. package/core.cjs +9 -5
  30. package/core.d.cts +6 -6
  31. package/core.d.mts +6 -6
  32. package/core.mjs +6 -6
  33. package/discover-BZIPXl23.cjs +200 -0
  34. package/discover-CFIi43Qn.mjs +195 -0
  35. package/drizzle.cjs +1 -1
  36. package/drizzle.d.cts +2 -2
  37. package/drizzle.d.mts +2 -2
  38. package/drizzle.mjs +1 -1
  39. package/executor-CJEWurjZ.mjs +23 -0
  40. package/executor-CU-jRgpC.cjs +40 -0
  41. package/index-CZkp8TV4.d.cts +108 -0
  42. package/index-Cnrz4ywf.d.mts +108 -0
  43. package/{index-Bh7o2J7K.d.mts → index-DOoX2GgI.d.mts} +3 -3
  44. package/{index-DRRTE5IJ.d.cts → index-uFDiQEjj.d.cts} +231 -5
  45. package/index.cjs +903 -30
  46. package/index.d.cts +27 -0
  47. package/index.d.mts +26 -0
  48. package/index.mjs +901 -28
  49. package/{internal-CdfVkh4O.d.mts → internal-D_2q2BOB.d.mts} +1 -1
  50. package/internal-adapter.d.cts +1 -1
  51. package/internal-adapter.d.mts +1 -1
  52. package/internal-auth-adapter.d.cts +1 -1
  53. package/internal-auth-adapter.d.mts +1 -1
  54. package/internal-sync-engine.cjs +1 -1
  55. package/internal-sync-engine.mjs +1 -1
  56. package/internal-types.cjs +5 -1
  57. package/internal-types.d.cts +2 -2
  58. package/internal-types.d.mts +2 -2
  59. package/internal-types.mjs +1 -1
  60. package/internal-view-compiler.cjs +1 -1
  61. package/internal-view-compiler.mjs +1 -1
  62. package/internal.cjs +9 -5
  63. package/internal.d.cts +5 -6
  64. package/internal.d.mts +6 -6
  65. package/internal.mjs +6 -6
  66. package/introspector-BwYgHGcS.cjs +363 -0
  67. package/introspector-Bz52xOUr.mjs +334 -0
  68. package/{namespace-probe-JuHriruA.d.mts → namespace-probe--GvxJ06J.d.mts} +8 -1
  69. package/package.json +31 -1
  70. package/projection-guard-7AMY0aCk.mjs +389 -0
  71. package/projection-guard-D8VUhCz7.cjs +508 -0
  72. package/{projection-sql-DQQdjw9I.mjs → projection-sql-2joBkLz2.mjs} +13 -3
  73. package/{projection-sql-BkrHR2ea.cjs → projection-sql-DS5sVTY-.cjs} +18 -2
  74. package/sdk-Bzkr24NW.cjs +207 -0
  75. package/sdk-D2WwGBzk.mjs +178 -0
  76. package/sdk.cjs +8 -6
  77. package/sdk.d.cts +7 -1
  78. package/sdk.d.mts +7 -1
  79. package/sdk.mjs +3 -2
  80. package/sql.cjs +13 -0
  81. package/sql.d.cts +2 -0
  82. package/sql.d.mts +2 -0
  83. package/sql.mjs +4 -0
  84. package/{sdk-BkMDOfCk.mjs → src-Dq2nY1Sj.mjs} +36 -495
  85. package/{sdk-BOarpe5I.cjs → src-X0-yIA3O.cjs} +63 -546
  86. package/supabase.cjs +255 -0
  87. package/supabase.d.cts +19 -0
  88. package/supabase.d.mts +19 -0
  89. package/supabase.mjs +254 -0
  90. package/{sync-engine-yFLEyId3.mjs → sync-engine-D0mJUeqP.mjs} +1 -1
  91. package/{sync-engine-DNSoZeo0.cjs → sync-engine-hU041kXO.cjs} +1 -1
  92. package/types-KMH5D5Lg.mjs +32 -0
  93. package/{namespace-probe-CcL6Wj8E.d.cts → types-UR-tT4c1.d.cts} +52 -45
  94. package/{types-BBfwsDxe.d.cts → types-f-Vcv-pl.d.cts} +18 -2
  95. package/{types-BBfwsDxe.d.mts → types-f-Vcv-pl.d.mts} +18 -2
  96. package/types-kR1kUlmz.cjs +67 -0
  97. package/{view-compiler-CSHSqZl7.mjs → view-compiler-BhKiezRH.mjs} +1 -1
  98. package/{view-compiler-NqiortOA.cjs → view-compiler-DgZadq1F.cjs} +1 -1
  99. package/vite.d.cts +1 -1
  100. package/vite.d.mts +1 -1
  101. package/internal-D7qVRIFb.d.cts +0 -228
  102. package/types-8KSw2AWg.mjs +0 -8
  103. package/types-B8m39L1s.cjs +0 -19
package/README.md CHANGED
@@ -178,6 +178,32 @@ section of the guide.
178
178
  Use `--schema` when your Drizzle schema is not in a common location or in
179
179
  `drizzle.config.ts`.
180
180
 
181
+ #### Apps without an ORM (Supabase, raw SQL)
182
+
183
+ When the app has no Drizzle schema, `init` takes one of two paths.
184
+
185
+ - **Server apps** (Next.js, TanStack Start and others), when `init` can read the
186
+ schema: it writes `clivly.config.ts` using `fromSql`, `discoverFromSql`,
187
+ `sqlIntrospector` and `sqlAppIdStore` from `clivly/sql`. It reads the schema
188
+ from `DATABASE_URL` or `SUPABASE_DB_URL` (environment, `.env.local` or
189
+ `.env`; never printed or stored), or from the linked Supabase CLI
190
+ (`supabase db query --linked --output json`), and needs your app's own
191
+ `postgres` or `pg` package. The config reads `DATABASE_URL || SUPABASE_DB_URL`;
192
+ with neither set the app builds, but at runtime it logs one error and never
193
+ contacts Clivly.
194
+ - **Browser-only apps** (Vite SPA, Lovable, Bolt), or when no schema could be
195
+ read: it writes `supabase/functions/clivly/index.ts`, `deno.json` and a
196
+ `[functions.clivly] verify_jwt = false` block in `supabase/config.toml`. Set
197
+ `CLIVLY_SECRET_KEY` and `CLIVLY_SYNC_TRIGGER_SECRET` as function secrets,
198
+ deploy with `supabase functions deploy clivly`, then run
199
+ `npx clivly connect --supabase` (`--project-url` overrides detection). It
200
+ succeeds only when at least one contact would sync.
201
+
202
+ `auth.users` contributes only `id`, `email`, `phone`, `created_at`,
203
+ `updated_at`, `last_sign_in_at` and `full_name`, `name` and `avatar_url` from
204
+ `raw_user_meta_data`; anonymous users are excluded. See
205
+ [Connect a Supabase app](https://clivly.com/docs/guides/connect-a-supabase-app).
206
+
181
207
  #### Monorepos
182
208
 
183
209
  In a workspace, `init` reads your `pnpm-workspace.yaml` (or `workspaces` array)
@@ -567,6 +593,7 @@ import {
567
593
  import { clivlyVite } from "clivly/vite";
568
594
  import { createClerkAuthAdapter } from "clivly/auth/clerk";
569
595
  import { createWorkOSAuthAdapter } from "clivly/auth/workos";
596
+ import { createSupabaseAuthAdapter } from "clivly/auth/supabase";
570
597
  import { createBetterAuthAdapter } from "clivly/auth/better-auth";
571
598
  ```
572
599
 
@@ -610,6 +637,7 @@ only what your app actually uses:
610
637
  | `clivly/vite` | `vite` |
611
638
  | `clivly/auth/clerk` | `@clerk/backend` |
612
639
  | `clivly/auth/workos` | `@workos-inc/node` |
640
+ | `clivly/auth/supabase` | none — uses `fetch` only |
613
641
  | `clivly/auth/better-auth` | none — you pass your own `betterAuth({...})` instance |
614
642
 
615
643
  `clivly/core/*` is deprecated in favour of `clivly/internal/*`. It still
@@ -1,4 +1,4 @@
1
- import { E as Task, M as UpdateContactInput, N as UpdateDealInput, O as TaskFilters, P as UpdateTaskInput, a as Contact, b as PageRequest, d as CreateContactInput, f as CreateDealInput, h as Deal, i as CompanyFilters, j as UpdateCompanyInput, l as CreateActivityInput, o as ContactFilters, p as CreateTaskInput, r as Company, t as Activity, u as CreateCompanyInput, w as RecordSource, y as Page } from "./types-BBfwsDxe.mjs";
1
+ import { A as TaskFilters, E as RecordSource, F as UpdateDealInput, I as UpdateTaskInput, N as UpdateCompanyInput, O as Task, P as UpdateContactInput, S as PageRequest, a as CompanyFilters, d as CreateCompanyInput, f as CreateContactInput, g as Deal, i as Company, m as CreateTaskInput, o as Contact, p as CreateDealInput, s as ContactFilters, t as Activity, u as CreateActivityInput, x as Page } from "./types-f-Vcv-pl.cjs";
2
2
  /**
3
3
  * The contract every ORM implementation fulfils. `packages/drizzle` is the first
4
4
  * implementation; Prisma/Kysely/TypeORM can follow without changes to consumers.
@@ -1,4 +1,4 @@
1
- import { E as Task, M as UpdateContactInput, N as UpdateDealInput, O as TaskFilters, P as UpdateTaskInput, a as Contact, b as PageRequest, d as CreateContactInput, f as CreateDealInput, h as Deal, i as CompanyFilters, j as UpdateCompanyInput, l as CreateActivityInput, o as ContactFilters, p as CreateTaskInput, r as Company, t as Activity, u as CreateCompanyInput, w as RecordSource, y as Page } from "./types-BBfwsDxe.cjs";
1
+ import { A as TaskFilters, E as RecordSource, F as UpdateDealInput, I as UpdateTaskInput, N as UpdateCompanyInput, O as Task, P as UpdateContactInput, S as PageRequest, a as CompanyFilters, d as CreateCompanyInput, f as CreateContactInput, g as Deal, i as Company, m as CreateTaskInput, o as Contact, p as CreateDealInput, s as ContactFilters, t as Activity, u as CreateActivityInput, x as Page } from "./types-f-Vcv-pl.mjs";
2
2
  /**
3
3
  * The contract every ORM implementation fulfils. `packages/drizzle` is the first
4
4
  * implementation; Prisma/Kysely/TypeORM can follow without changes to consumers.
@@ -1,4 +1,4 @@
1
- import { m as CrmRole } from "./types-BBfwsDxe.mjs";
1
+ import { h as CrmRole } from "./types-f-Vcv-pl.cjs";
2
2
  interface ClivlyUser {
3
3
  email: string;
4
4
  id: string;
@@ -1,4 +1,4 @@
1
- import { m as CrmRole } from "./types-BBfwsDxe.cjs";
1
+ import { h as CrmRole } from "./types-f-Vcv-pl.mjs";
2
2
  interface ClivlyUser {
3
3
  email: string;
4
4
  id: string;
@@ -1,4 +1,4 @@
1
- import { n as ClivlyUser, t as ClivlyAuthAdapter } from "./auth-adapter-DwtMJb7D.cjs";
1
+ import { n as ClivlyUser, t as ClivlyAuthAdapter } from "./auth-adapter-C17dzlzF.cjs";
2
2
  interface BetterAuthLikeUser {
3
3
  email?: string | null;
4
4
  id: string;
@@ -1,4 +1,4 @@
1
- import { n as ClivlyUser, t as ClivlyAuthAdapter } from "./auth-adapter-BIa-ZyVV.mjs";
1
+ import { n as ClivlyUser, t as ClivlyAuthAdapter } from "./auth-adapter-CizFv7oU.mjs";
2
2
  interface BetterAuthLikeUser {
3
3
  email?: string | null;
4
4
  id: string;
package/auth-clerk.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { n as ClivlyUser, t as ClivlyAuthAdapter } from "./auth-adapter-DwtMJb7D.cjs";
1
+ import { n as ClivlyUser, t as ClivlyAuthAdapter } from "./auth-adapter-C17dzlzF.cjs";
2
2
  interface ClerkLikeUser {
3
3
  emailAddresses?: Array<{
4
4
  id: string;
package/auth-clerk.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { n as ClivlyUser, t as ClivlyAuthAdapter } from "./auth-adapter-BIa-ZyVV.mjs";
1
+ import { n as ClivlyUser, t as ClivlyAuthAdapter } from "./auth-adapter-CizFv7oU.mjs";
2
2
  interface ClerkLikeUser {
3
3
  emailAddresses?: Array<{
4
4
  id: string;
@@ -0,0 +1,121 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ // ../auth-supabase/src/map.ts
3
+ const asNonEmptyString = (value) => typeof value === "string" && value.length > 0 ? value : void 0;
4
+ function supabaseUserToClivlyUser(user) {
5
+ if (!(user.email && user.id)) return null;
6
+ const meta = user.user_metadata ?? {};
7
+ const name = asNonEmptyString(meta.full_name) ?? asNonEmptyString(meta.name);
8
+ return {
9
+ id: user.id,
10
+ email: user.email,
11
+ name
12
+ };
13
+ }
14
+ // ../auth-supabase/src/index.ts
15
+ const BEARER = /^Bearer\s+(\S+)$/i;
16
+ const SUPABASE_HOST = /^([a-z0-9]+)\.supabase\.(?:co|in)$/i;
17
+ const AUTH_COOKIE = /^sb-.+-auth-token$/;
18
+ const CHUNKED_COOKIE = /^(sb-.+-auth-token)\.(\d+)$/;
19
+ const BASE64_PREFIX = "base64-";
20
+ const TRAILING_SLASHES = /\/+$/;
21
+ const DASH = /-/g;
22
+ const UNDERSCORE = /_/g;
23
+ const BASE64_CHARS = /^[A-Za-z0-9+/]*={0,2}$/;
24
+ function projectRef(supabaseUrl) {
25
+ try {
26
+ return SUPABASE_HOST.exec(new URL(supabaseUrl).hostname)?.[1];
27
+ } catch {
28
+ return;
29
+ }
30
+ }
31
+ function parseCookies(header) {
32
+ const jar = /* @__PURE__ */ new Map();
33
+ for (const part of header.split(";")) {
34
+ const eq = part.indexOf("=");
35
+ if (eq > 0) jar.set(part.slice(0, eq).trim(), part.slice(eq + 1).trim());
36
+ }
37
+ return jar;
38
+ }
39
+ function joinCookie(jar, base) {
40
+ const whole = jar.get(base);
41
+ if (whole !== void 0) return whole;
42
+ let out = "";
43
+ for (let i = 0; jar.has(`${base}.${i}`); i++) out += jar.get(`${base}.${i}`);
44
+ return out || null;
45
+ }
46
+ function candidateBases(jar, ref) {
47
+ if (ref) return [`sb-${ref}-auth-token`];
48
+ const bases = /* @__PURE__ */ new Set();
49
+ for (const key of jar.keys()) {
50
+ const chunk = CHUNKED_COOKIE.exec(key);
51
+ if (chunk?.[1]) bases.add(chunk[1]);
52
+ else if (AUTH_COOKIE.test(key)) bases.add(key);
53
+ }
54
+ return [...bases];
55
+ }
56
+ function decodeCookieValue(raw) {
57
+ let value = raw;
58
+ try {
59
+ value = decodeURIComponent(raw);
60
+ } catch {}
61
+ if (!value.startsWith(BASE64_PREFIX)) return value;
62
+ const b64 = value.slice(7).replace(DASH, "+").replace(UNDERSCORE, "/");
63
+ if (!BASE64_CHARS.test(b64)) return null;
64
+ try {
65
+ return new TextDecoder().decode(Uint8Array.from(atob(b64), (c) => c.charCodeAt(0)));
66
+ } catch {
67
+ return null;
68
+ }
69
+ }
70
+ function tokenFromCookies(header, ref) {
71
+ const jar = parseCookies(header);
72
+ for (const base of candidateBases(jar, ref)) {
73
+ const raw = joinCookie(jar, base);
74
+ const json = raw === null ? null : decodeCookieValue(raw);
75
+ if (json === null) continue;
76
+ try {
77
+ const parsed = JSON.parse(json);
78
+ const token = parsed && typeof parsed === "object" ? parsed.access_token : void 0;
79
+ if (typeof token === "string" && token.length > 0) return token;
80
+ } catch {}
81
+ }
82
+ return null;
83
+ }
84
+ function extractToken(req, ref) {
85
+ const bearer = BEARER.exec(req.headers.get("authorization") ?? "");
86
+ if (bearer?.[1]) return bearer[1];
87
+ const cookie = req.headers.get("cookie");
88
+ return cookie ? tokenFromCookies(cookie, ref) : null;
89
+ }
90
+ /**
91
+ * Supabase Auth → ClivlyAuthAdapter. Takes the access token from an
92
+ * `Authorization: Bearer` header, else the `sb-<ref>-auth-token` cookie, and
93
+ * verifies it by asking Supabase (`GET /auth/v1/user`). The JWT is never
94
+ * decoded or trusted locally. Answers "who is this person?" only.
95
+ */
96
+ function createSupabaseAuthAdapter(options) {
97
+ const base = options.supabaseUrl.replace(TRAILING_SLASHES, "");
98
+ const ref = projectRef(base);
99
+ const doFetch = options.fetch ?? fetch;
100
+ return { async getUser(req) {
101
+ const token = extractToken(req, ref);
102
+ if (!token) return null;
103
+ let res;
104
+ try {
105
+ res = await doFetch(`${base}/auth/v1/user`, { headers: {
106
+ apikey: options.anonKey,
107
+ authorization: `Bearer ${token}`
108
+ } });
109
+ } catch {
110
+ return null;
111
+ }
112
+ if (res.status !== 200) return null;
113
+ try {
114
+ return supabaseUserToClivlyUser(await res.json());
115
+ } catch {
116
+ return null;
117
+ }
118
+ } };
119
+ }
120
+ exports.createSupabaseAuthAdapter = createSupabaseAuthAdapter;
121
+ exports.supabaseUserToClivlyUser = supabaseUserToClivlyUser;
@@ -0,0 +1,23 @@
1
+ import { n as ClivlyUser, t as ClivlyAuthAdapter } from "./auth-adapter-C17dzlzF.cjs";
2
+ interface SupabaseLikeUser {
3
+ email?: string | null;
4
+ id: string;
5
+ user_metadata?: Record<string, unknown> | null;
6
+ }
7
+ export declare function supabaseUserToClivlyUser(user: SupabaseLikeUser): ClivlyUser | null;
8
+ export interface SupabaseAuthAdapterOptions {
9
+ /** The project's anon (publishable) key, sent as the `apikey` header. */
10
+ anonKey: string;
11
+ /** Override fetch (tests, custom runtimes). */
12
+ fetch?: typeof fetch;
13
+ /** Project URL, e.g. https://<ref>.supabase.co (or a custom domain). */
14
+ supabaseUrl: string;
15
+ }
16
+ /**
17
+ * Supabase Auth → ClivlyAuthAdapter. Takes the access token from an
18
+ * `Authorization: Bearer` header, else the `sb-<ref>-auth-token` cookie, and
19
+ * verifies it by asking Supabase (`GET /auth/v1/user`). The JWT is never
20
+ * decoded or trusted locally. Answers "who is this person?" only.
21
+ */
22
+ export declare function createSupabaseAuthAdapter(options: SupabaseAuthAdapterOptions): ClivlyAuthAdapter;
23
+ export type { SupabaseLikeUser };
@@ -0,0 +1,23 @@
1
+ import { n as ClivlyUser, t as ClivlyAuthAdapter } from "./auth-adapter-CizFv7oU.mjs";
2
+ interface SupabaseLikeUser {
3
+ email?: string | null;
4
+ id: string;
5
+ user_metadata?: Record<string, unknown> | null;
6
+ }
7
+ export declare function supabaseUserToClivlyUser(user: SupabaseLikeUser): ClivlyUser | null;
8
+ export interface SupabaseAuthAdapterOptions {
9
+ /** The project's anon (publishable) key, sent as the `apikey` header. */
10
+ anonKey: string;
11
+ /** Override fetch (tests, custom runtimes). */
12
+ fetch?: typeof fetch;
13
+ /** Project URL, e.g. https://<ref>.supabase.co (or a custom domain). */
14
+ supabaseUrl: string;
15
+ }
16
+ /**
17
+ * Supabase Auth → ClivlyAuthAdapter. Takes the access token from an
18
+ * `Authorization: Bearer` header, else the `sb-<ref>-auth-token` cookie, and
19
+ * verifies it by asking Supabase (`GET /auth/v1/user`). The JWT is never
20
+ * decoded or trusted locally. Answers "who is this person?" only.
21
+ */
22
+ export declare function createSupabaseAuthAdapter(options: SupabaseAuthAdapterOptions): ClivlyAuthAdapter;
23
+ export type { SupabaseLikeUser };
@@ -0,0 +1,119 @@
1
+ // ../auth-supabase/src/map.ts
2
+ const asNonEmptyString = (value) => typeof value === "string" && value.length > 0 ? value : void 0;
3
+ function supabaseUserToClivlyUser(user) {
4
+ if (!(user.email && user.id)) return null;
5
+ const meta = user.user_metadata ?? {};
6
+ const name = asNonEmptyString(meta.full_name) ?? asNonEmptyString(meta.name);
7
+ return {
8
+ id: user.id,
9
+ email: user.email,
10
+ name
11
+ };
12
+ }
13
+ // ../auth-supabase/src/index.ts
14
+ const BEARER = /^Bearer\s+(\S+)$/i;
15
+ const SUPABASE_HOST = /^([a-z0-9]+)\.supabase\.(?:co|in)$/i;
16
+ const AUTH_COOKIE = /^sb-.+-auth-token$/;
17
+ const CHUNKED_COOKIE = /^(sb-.+-auth-token)\.(\d+)$/;
18
+ const BASE64_PREFIX = "base64-";
19
+ const TRAILING_SLASHES = /\/+$/;
20
+ const DASH = /-/g;
21
+ const UNDERSCORE = /_/g;
22
+ const BASE64_CHARS = /^[A-Za-z0-9+/]*={0,2}$/;
23
+ function projectRef(supabaseUrl) {
24
+ try {
25
+ return SUPABASE_HOST.exec(new URL(supabaseUrl).hostname)?.[1];
26
+ } catch {
27
+ return;
28
+ }
29
+ }
30
+ function parseCookies(header) {
31
+ const jar = /* @__PURE__ */ new Map();
32
+ for (const part of header.split(";")) {
33
+ const eq = part.indexOf("=");
34
+ if (eq > 0) jar.set(part.slice(0, eq).trim(), part.slice(eq + 1).trim());
35
+ }
36
+ return jar;
37
+ }
38
+ function joinCookie(jar, base) {
39
+ const whole = jar.get(base);
40
+ if (whole !== void 0) return whole;
41
+ let out = "";
42
+ for (let i = 0; jar.has(`${base}.${i}`); i++) out += jar.get(`${base}.${i}`);
43
+ return out || null;
44
+ }
45
+ function candidateBases(jar, ref) {
46
+ if (ref) return [`sb-${ref}-auth-token`];
47
+ const bases = /* @__PURE__ */ new Set();
48
+ for (const key of jar.keys()) {
49
+ const chunk = CHUNKED_COOKIE.exec(key);
50
+ if (chunk?.[1]) bases.add(chunk[1]);
51
+ else if (AUTH_COOKIE.test(key)) bases.add(key);
52
+ }
53
+ return [...bases];
54
+ }
55
+ function decodeCookieValue(raw) {
56
+ let value = raw;
57
+ try {
58
+ value = decodeURIComponent(raw);
59
+ } catch {}
60
+ if (!value.startsWith(BASE64_PREFIX)) return value;
61
+ const b64 = value.slice(7).replace(DASH, "+").replace(UNDERSCORE, "/");
62
+ if (!BASE64_CHARS.test(b64)) return null;
63
+ try {
64
+ return new TextDecoder().decode(Uint8Array.from(atob(b64), (c) => c.charCodeAt(0)));
65
+ } catch {
66
+ return null;
67
+ }
68
+ }
69
+ function tokenFromCookies(header, ref) {
70
+ const jar = parseCookies(header);
71
+ for (const base of candidateBases(jar, ref)) {
72
+ const raw = joinCookie(jar, base);
73
+ const json = raw === null ? null : decodeCookieValue(raw);
74
+ if (json === null) continue;
75
+ try {
76
+ const parsed = JSON.parse(json);
77
+ const token = parsed && typeof parsed === "object" ? parsed.access_token : void 0;
78
+ if (typeof token === "string" && token.length > 0) return token;
79
+ } catch {}
80
+ }
81
+ return null;
82
+ }
83
+ function extractToken(req, ref) {
84
+ const bearer = BEARER.exec(req.headers.get("authorization") ?? "");
85
+ if (bearer?.[1]) return bearer[1];
86
+ const cookie = req.headers.get("cookie");
87
+ return cookie ? tokenFromCookies(cookie, ref) : null;
88
+ }
89
+ /**
90
+ * Supabase Auth → ClivlyAuthAdapter. Takes the access token from an
91
+ * `Authorization: Bearer` header, else the `sb-<ref>-auth-token` cookie, and
92
+ * verifies it by asking Supabase (`GET /auth/v1/user`). The JWT is never
93
+ * decoded or trusted locally. Answers "who is this person?" only.
94
+ */
95
+ function createSupabaseAuthAdapter(options) {
96
+ const base = options.supabaseUrl.replace(TRAILING_SLASHES, "");
97
+ const ref = projectRef(base);
98
+ const doFetch = options.fetch ?? fetch;
99
+ return { async getUser(req) {
100
+ const token = extractToken(req, ref);
101
+ if (!token) return null;
102
+ let res;
103
+ try {
104
+ res = await doFetch(`${base}/auth/v1/user`, { headers: {
105
+ apikey: options.anonKey,
106
+ authorization: `Bearer ${token}`
107
+ } });
108
+ } catch {
109
+ return null;
110
+ }
111
+ if (res.status !== 200) return null;
112
+ try {
113
+ return supabaseUserToClivlyUser(await res.json());
114
+ } catch {
115
+ return null;
116
+ }
117
+ } };
118
+ }
119
+ export { createSupabaseAuthAdapter, supabaseUserToClivlyUser };
package/auth-workos.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { n as ClivlyUser, t as ClivlyAuthAdapter } from "./auth-adapter-DwtMJb7D.cjs";
1
+ import { n as ClivlyUser, t as ClivlyAuthAdapter } from "./auth-adapter-C17dzlzF.cjs";
2
2
  interface WorkOSLikeUser {
3
3
  email: string;
4
4
  firstName?: string | null;
package/auth-workos.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { n as ClivlyUser, t as ClivlyAuthAdapter } from "./auth-adapter-BIa-ZyVV.mjs";
1
+ import { n as ClivlyUser, t as ClivlyAuthAdapter } from "./auth-adapter-CizFv7oU.mjs";
2
2
  interface WorkOSLikeUser {
3
3
  email: string;
4
4
  firstName?: string | null;
@@ -1,3 +1,3 @@
1
- import { t as CRMAdapter } from "./adapter-BK3gsby5.cjs";
1
+ import { t as CRMAdapter } from "./adapter--YV7du3i.cjs";
2
2
  import "./internal-adapter.cjs";
3
3
  export { CRMAdapter };
@@ -1,3 +1,3 @@
1
- import { t as CRMAdapter } from "./adapter-B4v4dwgD.mjs";
1
+ import { t as CRMAdapter } from "./adapter-DD3K3dCW.mjs";
2
2
  import "./internal-adapter.mjs";
3
3
  export { CRMAdapter };
@@ -1,3 +1,3 @@
1
- import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-DwtMJb7D.cjs";
1
+ import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-C17dzlzF.cjs";
2
2
  import "./internal-auth-adapter.cjs";
3
3
  export { ClivlyAuthAdapter, ClivlyUser, CrmMembership, MembershipResolver, authCustom };
@@ -1,3 +1,3 @@
1
- import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-BIa-ZyVV.mjs";
1
+ import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-CizFv7oU.mjs";
2
2
  import "./internal-auth-adapter.mjs";
3
3
  export { ClivlyAuthAdapter, ClivlyUser, CrmMembership, MembershipResolver, authCustom };
@@ -1,2 +1,3 @@
1
1
  import { a as Scored, c as W, d as isTextLike, f as isTimestampLike, i as RELATIONSHIP_TIERS, l as isAmbiguous, n as CONCEPT_TIERS, o as Thresholds, p as tierFor, r as FIELD_TIERS, s as Tier, t as AMBIGUITY_MARGIN, u as isNumericLike } from "./mapping-score-BKrxddz0.cjs";
2
+ import "./internal-mapping-score.cjs";
2
3
  export { AMBIGUITY_MARGIN, CONCEPT_TIERS, FIELD_TIERS, RELATIONSHIP_TIERS, Scored, Thresholds, Tier, W, isAmbiguous, isNumericLike, isTextLike, isTimestampLike, tierFor };
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_sync_engine = require("./sync-engine-DNSoZeo0.cjs");
2
+ const require_sync_engine = require("./sync-engine-hU041kXO.cjs");
3
3
  const require_deprecate_subpath = require("./deprecate-subpath-dGwDiHKV.cjs");
4
4
  require("./internal-sync-engine.cjs");
5
5
  // src/core-sync-engine.ts
@@ -1,4 +1,4 @@
1
- export { t as computeSampleWarnings, n as isRemovalAction, r as previewSync, i as reconcile, a as resolveActions, o as runSync } from "./sync-engine-yFLEyId3.mjs";
1
+ export { t as computeSampleWarnings, n as isRemovalAction, r as previewSync, i as reconcile, a as resolveActions, o as runSync } from "./sync-engine-D0mJUeqP.mjs";
2
2
  import { t as warnDeprecatedSubpath } from "./deprecate-subpath-CK37DKXH.mjs";
3
3
  import "./internal-sync-engine.mjs";
4
4
  // src/core-sync-engine.ts
package/core-types.cjs CHANGED
@@ -1,8 +1,12 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_types = require("./types-B8m39L1s.cjs");
2
+ const require_types = require("./types-kR1kUlmz.cjs");
3
3
  const require_deprecate_subpath = require("./deprecate-subpath-dGwDiHKV.cjs");
4
4
  require("./internal-types.cjs");
5
5
  // src/core-types.ts
6
6
  require_deprecate_subpath.warnDeprecatedSubpath("clivly/core/types", "clivly/internal/types");
7
+ exports.CONTACT_STATUSES = require_types.CONTACT_STATUSES;
8
+ exports.LIFECYCLE_STATUSES = require_types.LIFECYCLE_STATUSES;
7
9
  exports.OPEN_STAGE_TYPE = require_types.OPEN_STAGE_TYPE;
10
+ exports.VENDOR_STATUS = require_types.VENDOR_STATUS;
8
11
  exports.isClosedStageType = require_types.isClosedStageType;
12
+ exports.isContactStatus = require_types.isContactStatus;
package/core-types.d.cts CHANGED
@@ -1,3 +1,3 @@
1
- import { A as TaskStatus, C as PipelineStageConfig, D as TaskEntityType, E as Task, F as ValueInterval, I as isClosedStageType, M as UpdateContactInput, N as UpdateDealInput, O as TaskFilters, P as UpdateTaskInput, S as PipelineKind, T as StageType, _ as Note, a as Contact, b as PageRequest, c as ContactStatus, d as CreateContactInput, f as CreateDealInput, g as DealStage, h as Deal, i as CompanyFilters, j as UpdateCompanyInput, k as TaskPriority, l as CreateActivityInput, m as CrmRole, n as ActivityType, o as ContactFilters, p as CreateTaskInput, r as Company, s as ContactSource, t as Activity, u as CreateCompanyInput, v as OPEN_STAGE_TYPE, w as RecordSource, x as PipelineConfig, y as Page } from "./types-BBfwsDxe.cjs";
1
+ import { A as TaskFilters, B as isContactStatus, C as PipelineConfig, D as StageType, E as RecordSource, F as UpdateDealInput, I as UpdateTaskInput, L as VENDOR_STATUS, M as TaskStatus, N as UpdateCompanyInput, O as Task, P as UpdateContactInput, R as ValueInterval, S as PageRequest, T as PipelineStageConfig, _ as DealStage, a as CompanyFilters, b as OPEN_STAGE_TYPE, c as ContactSource, d as CreateCompanyInput, f as CreateContactInput, g as Deal, h as CrmRole, i as Company, j as TaskPriority, k as TaskEntityType, l as ContactStatus, m as CreateTaskInput, n as ActivityType, o as Contact, p as CreateDealInput, r as CONTACT_STATUSES, s as ContactFilters, t as Activity, u as CreateActivityInput, v as LIFECYCLE_STATUSES, w as PipelineKind, x as Page, y as Note, z as isClosedStageType } from "./types-f-Vcv-pl.cjs";
2
2
  import "./internal-types.cjs";
3
- export { Activity, ActivityType, Company, CompanyFilters, Contact, ContactFilters, ContactSource, ContactStatus, CreateActivityInput, CreateCompanyInput, CreateContactInput, CreateDealInput, CreateTaskInput, CrmRole, Deal, DealStage, Note, OPEN_STAGE_TYPE, Page, PageRequest, PipelineConfig, PipelineKind, PipelineStageConfig, RecordSource, StageType, Task, TaskEntityType, TaskFilters, TaskPriority, TaskStatus, UpdateCompanyInput, UpdateContactInput, UpdateDealInput, UpdateTaskInput, ValueInterval, isClosedStageType };
3
+ export { Activity, ActivityType, CONTACT_STATUSES, Company, CompanyFilters, Contact, ContactFilters, ContactSource, ContactStatus, CreateActivityInput, CreateCompanyInput, CreateContactInput, CreateDealInput, CreateTaskInput, CrmRole, Deal, DealStage, LIFECYCLE_STATUSES, Note, OPEN_STAGE_TYPE, Page, PageRequest, PipelineConfig, PipelineKind, PipelineStageConfig, RecordSource, StageType, Task, TaskEntityType, TaskFilters, TaskPriority, TaskStatus, UpdateCompanyInput, UpdateContactInput, UpdateDealInput, UpdateTaskInput, VENDOR_STATUS, ValueInterval, isClosedStageType, isContactStatus };
package/core-types.d.mts CHANGED
@@ -1,3 +1,3 @@
1
- import { A as TaskStatus, C as PipelineStageConfig, D as TaskEntityType, E as Task, F as ValueInterval, I as isClosedStageType, M as UpdateContactInput, N as UpdateDealInput, O as TaskFilters, P as UpdateTaskInput, S as PipelineKind, T as StageType, _ as Note, a as Contact, b as PageRequest, c as ContactStatus, d as CreateContactInput, f as CreateDealInput, g as DealStage, h as Deal, i as CompanyFilters, j as UpdateCompanyInput, k as TaskPriority, l as CreateActivityInput, m as CrmRole, n as ActivityType, o as ContactFilters, p as CreateTaskInput, r as Company, s as ContactSource, t as Activity, u as CreateCompanyInput, v as OPEN_STAGE_TYPE, w as RecordSource, x as PipelineConfig, y as Page } from "./types-BBfwsDxe.mjs";
1
+ import { A as TaskFilters, B as isContactStatus, C as PipelineConfig, D as StageType, E as RecordSource, F as UpdateDealInput, I as UpdateTaskInput, L as VENDOR_STATUS, M as TaskStatus, N as UpdateCompanyInput, O as Task, P as UpdateContactInput, R as ValueInterval, S as PageRequest, T as PipelineStageConfig, _ as DealStage, a as CompanyFilters, b as OPEN_STAGE_TYPE, c as ContactSource, d as CreateCompanyInput, f as CreateContactInput, g as Deal, h as CrmRole, i as Company, j as TaskPriority, k as TaskEntityType, l as ContactStatus, m as CreateTaskInput, n as ActivityType, o as Contact, p as CreateDealInput, r as CONTACT_STATUSES, s as ContactFilters, t as Activity, u as CreateActivityInput, v as LIFECYCLE_STATUSES, w as PipelineKind, x as Page, y as Note, z as isClosedStageType } from "./types-f-Vcv-pl.mjs";
2
2
  import "./internal-types.mjs";
3
- export { Activity, ActivityType, Company, CompanyFilters, Contact, ContactFilters, ContactSource, ContactStatus, CreateActivityInput, CreateCompanyInput, CreateContactInput, CreateDealInput, CreateTaskInput, CrmRole, Deal, DealStage, Note, OPEN_STAGE_TYPE, Page, PageRequest, PipelineConfig, PipelineKind, PipelineStageConfig, RecordSource, StageType, Task, TaskEntityType, TaskFilters, TaskPriority, TaskStatus, UpdateCompanyInput, UpdateContactInput, UpdateDealInput, UpdateTaskInput, ValueInterval, isClosedStageType };
3
+ export { Activity, ActivityType, CONTACT_STATUSES, Company, CompanyFilters, Contact, ContactFilters, ContactSource, ContactStatus, CreateActivityInput, CreateCompanyInput, CreateContactInput, CreateDealInput, CreateTaskInput, CrmRole, Deal, DealStage, LIFECYCLE_STATUSES, Note, OPEN_STAGE_TYPE, Page, PageRequest, PipelineConfig, PipelineKind, PipelineStageConfig, RecordSource, StageType, Task, TaskEntityType, TaskFilters, TaskPriority, TaskStatus, UpdateCompanyInput, UpdateContactInput, UpdateDealInput, UpdateTaskInput, VENDOR_STATUS, ValueInterval, isClosedStageType, isContactStatus };
package/core-types.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { t as OPEN_STAGE_TYPE, n as isClosedStageType } from "./types-8KSw2AWg.mjs";
1
+ export { t as CONTACT_STATUSES, n as LIFECYCLE_STATUSES, r as OPEN_STAGE_TYPE, i as VENDOR_STATUS, a as isClosedStageType, o as isContactStatus } from "./types-KMH5D5Lg.mjs";
2
2
  import { t as warnDeprecatedSubpath } from "./deprecate-subpath-CK37DKXH.mjs";
3
3
  import "./internal-types.mjs";
4
4
  // src/core-types.ts
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_view_compiler = require("./view-compiler-NqiortOA.cjs");
2
+ const require_view_compiler = require("./view-compiler-DgZadq1F.cjs");
3
3
  const require_deprecate_subpath = require("./deprecate-subpath-dGwDiHKV.cjs");
4
4
  require("./internal-view-compiler.cjs");
5
5
  // src/core-view-compiler.ts
@@ -1,4 +1,4 @@
1
- export { t as DEFAULT_VIEW_PREFIX, n as compileEntityView, r as compileEntityViews, i as explainEntitiesConfig, a as explainViewExecutionError } from "./view-compiler-CSHSqZl7.mjs";
1
+ export { t as DEFAULT_VIEW_PREFIX, n as compileEntityView, r as compileEntityViews, i as explainEntitiesConfig, a as explainViewExecutionError } from "./view-compiler-BhKiezRH.mjs";
2
2
  import { t as warnDeprecatedSubpath } from "./deprecate-subpath-CK37DKXH.mjs";
3
3
  import "./internal-view-compiler.mjs";
4
4
  // src/core-view-compiler.ts
package/core.cjs CHANGED
@@ -1,26 +1,29 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_projection = require("./projection-w4Z6vSL2.cjs");
3
+ const require_projection_sql = require("./projection-sql-DS5sVTY-.cjs");
3
4
  const require_entity_config = require("./entity-config-BP8Cc_nC.cjs");
4
- const require_mappings_config = require("./mappings-config-CC-vltWb.cjs");
5
5
  const require_auth_adapter = require("./auth-adapter-CNVuxT9W.cjs");
6
6
  const require_internal = require("./internal-D88LTRlu.cjs");
7
7
  const require_mapping_form = require("./mapping-form-Bs6JQurC.cjs");
8
- const require_projection_sql = require("./projection-sql-BkrHR2ea.cjs");
9
- const require_view_compiler = require("./view-compiler-NqiortOA.cjs");
10
- const require_sync_engine = require("./sync-engine-DNSoZeo0.cjs");
11
- const require_types = require("./types-B8m39L1s.cjs");
8
+ const require_mappings_config = require("./mappings-config-CC-vltWb.cjs");
9
+ const require_view_compiler = require("./view-compiler-DgZadq1F.cjs");
10
+ const require_sync_engine = require("./sync-engine-hU041kXO.cjs");
11
+ const require_types = require("./types-kR1kUlmz.cjs");
12
12
  // src/core.ts
13
13
  require("./deprecate-subpath-dGwDiHKV.cjs").warnDeprecatedSubpath("clivly/core", "clivly/sdk", "Import \"defineClivlyConfig\" and its config types from \"clivly/sdk\"; import everything else from \"clivly/internal\" (no stability guarantee — see STABILITY.md).");
14
14
  exports.BASE_REF = require_projection.BASE_REF;
15
15
  exports.CANONICAL_FIELDS = require_entity_config.CANONICAL_FIELDS;
16
+ exports.CONTACT_STATUSES = require_types.CONTACT_STATUSES;
16
17
  exports.CRM_CONCEPTS = require_entity_config.CRM_CONCEPTS;
17
18
  exports.ClivlyConfigError = require_entity_config.ClivlyConfigError;
18
19
  exports.DEFAULT_VIEW_PREFIX = require_view_compiler.DEFAULT_VIEW_PREFIX;
20
+ exports.LIFECYCLE_STATUSES = require_types.LIFECYCLE_STATUSES;
19
21
  exports.MATERIALIZING_CONCEPTS = require_entity_config.MATERIALIZING_CONCEPTS;
20
22
  exports.OPEN_STAGE_TYPE = require_types.OPEN_STAGE_TYPE;
21
23
  exports.PREVIEW_MAX_ROWS = require_projection_sql.PREVIEW_MAX_ROWS;
22
24
  exports.PROJECTION_KEY_PATTERN = require_projection.PROJECTION_KEY_PATTERN;
23
25
  exports.REQUIRED_FIELDS = require_entity_config.REQUIRED_FIELDS;
26
+ exports.VENDOR_STATUS = require_types.VENDOR_STATUS;
24
27
  exports.authCustom = require_auth_adapter.authCustom;
25
28
  exports.buildFilterFromDiscriminator = require_mapping_form.buildFilterFromDiscriminator;
26
29
  exports.buildRelationships = require_mapping_form.buildRelationships;
@@ -45,6 +48,7 @@ exports.hasRichMeta = require_entity_config.hasRichMeta;
45
48
  exports.hostOwnedFieldMessage = require_internal.hostOwnedFieldMessage;
46
49
  exports.identityRefs = require_projection.identityRefs;
47
50
  exports.isClosedStageType = require_types.isClosedStageType;
51
+ exports.isContactStatus = require_types.isContactStatus;
48
52
  exports.isHostOwned = require_internal.isHostOwned;
49
53
  exports.isRemovalAction = require_sync_engine.isRemovalAction;
50
54
  exports.joinFansOut = require_entity_config.joinFansOut;
package/core.d.cts CHANGED
@@ -1,11 +1,11 @@
1
- import { A as TaskStatus, C as PipelineStageConfig, D as TaskEntityType, E as Task, F as ValueInterval, I as isClosedStageType, L as ContactSegment, M as UpdateContactInput, N as UpdateDealInput, O as TaskFilters, P as UpdateTaskInput, R as contactSegmentSchema, S as PipelineKind, T as StageType, _ as Note, a as Contact, b as PageRequest, c as ContactStatus, d as CreateContactInput, f as CreateDealInput, g as DealStage, h as Deal, i as CompanyFilters, j as UpdateCompanyInput, k as TaskPriority, l as CreateActivityInput, m as CrmRole, n as ActivityType, o as ContactFilters, p as CreateTaskInput, r as Company, s as ContactSource, t as Activity, u as CreateCompanyInput, v as OPEN_STAGE_TYPE, w as RecordSource, x as PipelineConfig, y as Page } from "./types-BBfwsDxe.cjs";
2
- import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-DwtMJb7D.cjs";
3
- import { t as CRMAdapter } from "./adapter-BK3gsby5.cjs";
4
1
  import { A as relationshipsSchema, B as identityRefs, D as missingRequiredFields, E as filterSchema, F as ProjectionFieldBinding, I as ProjectionIdentity, L as ProjectionJoin, M as validateEntitiesConfig, N as BASE_REF, O as projectionFields, P as PROJECTION_KEY_PATTERN, R as ProjectionMapping, S as RelationshipsMap, T as entitiesConfigSchema, V as projectionSchema, _ as MATERIALIZING_CONCEPTS, a as ClivlyEntitiesConfig, b as RelationshipSpec, d as CrmConcept, g as FilterValue, h as FilterExpr, i as ClivlyConfigError, j as requiredFieldsFor, k as relationshipSchema, l as ConfigValidationError, m as DiscoveredSchemaTable, n as CRM_CONCEPTS, p as DiscoveredColumnMeta, s as ClivlyEntityConfig, t as CANONICAL_FIELDS, u as ConfigValidationResult, v as MaterializingConcept, w as defineClivlyConfig, x as RelationshipVia, y as REQUIRED_FIELDS, z as ProjectionRef } from "./entity-config-CXpGowQa.cjs";
2
+ import { A as TaskFilters, B as isContactStatus, C as PipelineConfig, D as StageType, E as RecordSource, F as UpdateDealInput, H as contactSegmentSchema, I as UpdateTaskInput, L as VENDOR_STATUS, M as TaskStatus, N as UpdateCompanyInput, O as Task, P as UpdateContactInput, R as ValueInterval, S as PageRequest, T as PipelineStageConfig, V as ContactSegment, _ as DealStage, a as CompanyFilters, b as OPEN_STAGE_TYPE, c as ContactSource, d as CreateCompanyInput, f as CreateContactInput, g as Deal, h as CrmRole, i as Company, j as TaskPriority, k as TaskEntityType, l as ContactStatus, m as CreateTaskInput, n as ActivityType, o as Contact, p as CreateDealInput, r as CONTACT_STATUSES, s as ContactFilters, t as Activity, u as CreateActivityInput, v as LIFECYCLE_STATUSES, w as PipelineKind, x as Page, y as Note, z as isClosedStageType } from "./types-f-Vcv-pl.cjs";
3
+ import { t as CRMAdapter } from "./adapter--YV7du3i.cjs";
4
+ import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-C17dzlzF.cjs";
5
+ import { A as StepProblem, B as MappedAmountValueSource, C as ConnectionLiveness, D as IntegrationStep, E as IntegrationStatus, F as hostOwnedFieldMessage, H as computeDealValue, I as isHostOwned, L as rejectedCompanyFields, M as HostOwnedCompanyField, N as HostOwnedContactField, O as NextAction, P as SourcedRecord, R as rejectedContactFields, S as joinFansOut, T as IntegrationState, V as PerSeatValueSource, _ as compileProjectionJoins, a as matchesCondition, b as quoteIdent, c as columnMetaFor, d as primaryKeyColumns, f as validateProjection, g as compileProjectionIdentity, h as compileProjectionFrom, i as evaluateStage, j as StepState, k as StepId, l as coversUniqueKey, m as PREVIEW_MAX_ROWS, n as ConditionOp, o as slugify, p as validateProjectionFilter, r as EvaluableRule, s as toObjectTypeSlug, t as Condition, u as hasRichMeta, v as compileProjectionPreview, w as IntegrationFacts, x as fanOutJoins, y as compileProjectionSelect, z as DealValueSource } from "./index-uFDiQEjj.cjs";
5
6
  import { i as relationshipViaSignature, n as buildFilterFromDiscriminator, r as buildRelationships, t as RelationshipCandidate } from "./mapping-form-Bg_hgNoL.cjs";
6
7
  import { i as mappingsToEntitiesConfig, t as EntityMappingRow } from "./mappings-config-DNo_Cum_.cjs";
7
8
  import { a as compileEntityView, i as ExplainResult, n as CompiledView, o as compileEntityViews, r as DEFAULT_VIEW_PREFIX, s as explainEntitiesConfig, t as CompileOptions } from "./view-compiler-BDD93Luw.cjs";
8
9
  import { c as SyncAction, f as isRemovalAction, g as runSync, h as resolveActions, l as SyncResult, m as reconcile, n as MirrorRecord, o as ResolvedMembership, r as PersistAction, s as SourceRow, t as EntitySyncResult, u as SyncStore } from "./sync-engine-DCjTr2XQ.cjs";
9
- import { _ as PerSeatValueSource, a as matchesCondition, c as HostOwnedCompanyField, d as hostOwnedFieldMessage, f as isHostOwned, g as MappedAmountValueSource, h as DealValueSource, i as evaluateStage, l as HostOwnedContactField, m as rejectedContactFields, n as ConditionOp, o as slugify, p as rejectedCompanyFields, r as EvaluableRule, s as toObjectTypeSlug, t as Condition, u as SourcedRecord, v as computeDealValue } from "./internal-D7qVRIFb.cjs";
10
- import { C as StepProblem, S as StepId, _ as IntegrationFacts, a as validateProjection, b as IntegrationStep, c as compileProjectionFrom, d as compileProjectionPreview, f as compileProjectionSelect, g as ConnectionLiveness, h as joinFansOut, i as primaryKeyColumns, l as compileProjectionIdentity, m as fanOutJoins, n as coversUniqueKey, o as validateProjectionFilter, p as quoteIdent, r as hasRichMeta, s as PREVIEW_MAX_ROWS, t as columnMetaFor, u as compileProjectionJoins, v as IntegrationState, w as StepState, x as NextAction, y as IntegrationStatus } from "./index-DRRTE5IJ.cjs";
11
- export { type Activity, type ActivityType, BASE_REF, CANONICAL_FIELDS, type CRMAdapter, CRM_CONCEPTS, type ClivlyAuthAdapter, ClivlyConfigError, type ClivlyEntitiesConfig, type ClivlyEntityConfig, type ClivlyUser, type Company, type CompanyFilters, type CompileOptions, type CompiledView, type Condition, type ConditionOp, type ConfigValidationError, type ConfigValidationResult, type ConnectionLiveness, type Contact, type ContactFilters, type ContactSegment, type ContactSource, type ContactStatus, type CreateActivityInput, type CreateCompanyInput, type CreateContactInput, type CreateDealInput, type CreateTaskInput, type CrmConcept, type CrmMembership, type CrmRole, DEFAULT_VIEW_PREFIX, type Deal, type DealStage, type DealValueSource, type DiscoveredColumnMeta, type DiscoveredSchemaTable, type EntityMappingRow, type EntitySyncResult, type EvaluableRule, type ExplainResult, type FilterExpr, type FilterValue, type HostOwnedCompanyField, type HostOwnedContactField, type IntegrationFacts, type IntegrationState, type IntegrationStatus, type IntegrationStep, MATERIALIZING_CONCEPTS, type MappedAmountValueSource, type MaterializingConcept, type MembershipResolver, type MirrorRecord, type NextAction, type Note, OPEN_STAGE_TYPE, PREVIEW_MAX_ROWS, PROJECTION_KEY_PATTERN, type Page, type PageRequest, type PerSeatValueSource, type PersistAction, type PipelineConfig, type PipelineKind, type PipelineStageConfig, type ProjectionFieldBinding, type ProjectionIdentity, type ProjectionJoin, type ProjectionMapping, type ProjectionRef, REQUIRED_FIELDS, type RecordSource, type RelationshipCandidate, type RelationshipSpec, type RelationshipVia, type RelationshipsMap, type ResolvedMembership, type SourceRow, type SourcedRecord, type StageType, type StepId, type StepProblem, type StepState, type SyncAction, type SyncResult, type SyncStore, type Task, type TaskEntityType, type TaskFilters, type TaskPriority, type TaskStatus, type UpdateCompanyInput, type UpdateContactInput, type UpdateDealInput, type UpdateTaskInput, type ValueInterval, authCustom, buildFilterFromDiscriminator, buildRelationships, columnMetaFor, compileEntityView, compileEntityViews, compileProjectionFrom, compileProjectionIdentity, compileProjectionJoins, compileProjectionPreview, compileProjectionSelect, computeDealValue, contactSegmentSchema, coversUniqueKey, defineClivlyConfig, entitiesConfigSchema, evaluateStage, explainEntitiesConfig, fanOutJoins, filterSchema, hasRichMeta, hostOwnedFieldMessage, identityRefs, isClosedStageType, isHostOwned, isRemovalAction, joinFansOut, mappingsToEntitiesConfig, matchesCondition, missingRequiredFields, primaryKeyColumns, projectionFields, projectionSchema, quoteIdent, reconcile, rejectedCompanyFields, rejectedContactFields, relationshipSchema, relationshipViaSignature, relationshipsSchema, requiredFieldsFor, resolveActions, runSync, slugify, toObjectTypeSlug, validateEntitiesConfig, validateProjection, validateProjectionFilter };
10
+ import "./internal.cjs";
11
+ export { type Activity, type ActivityType, BASE_REF, CANONICAL_FIELDS, CONTACT_STATUSES, type CRMAdapter, CRM_CONCEPTS, type ClivlyAuthAdapter, ClivlyConfigError, type ClivlyEntitiesConfig, type ClivlyEntityConfig, type ClivlyUser, type Company, type CompanyFilters, type CompileOptions, type CompiledView, type Condition, type ConditionOp, type ConfigValidationError, type ConfigValidationResult, type ConnectionLiveness, type Contact, type ContactFilters, type ContactSegment, type ContactSource, type ContactStatus, type CreateActivityInput, type CreateCompanyInput, type CreateContactInput, type CreateDealInput, type CreateTaskInput, type CrmConcept, type CrmMembership, type CrmRole, DEFAULT_VIEW_PREFIX, type Deal, type DealStage, type DealValueSource, type DiscoveredColumnMeta, type DiscoveredSchemaTable, type EntityMappingRow, type EntitySyncResult, type EvaluableRule, type ExplainResult, type FilterExpr, type FilterValue, type HostOwnedCompanyField, type HostOwnedContactField, type IntegrationFacts, type IntegrationState, type IntegrationStatus, type IntegrationStep, LIFECYCLE_STATUSES, MATERIALIZING_CONCEPTS, type MappedAmountValueSource, type MaterializingConcept, type MembershipResolver, type MirrorRecord, type NextAction, type Note, OPEN_STAGE_TYPE, PREVIEW_MAX_ROWS, PROJECTION_KEY_PATTERN, type Page, type PageRequest, type PerSeatValueSource, type PersistAction, type PipelineConfig, type PipelineKind, type PipelineStageConfig, type ProjectionFieldBinding, type ProjectionIdentity, type ProjectionJoin, type ProjectionMapping, type ProjectionRef, REQUIRED_FIELDS, type RecordSource, type RelationshipCandidate, type RelationshipSpec, type RelationshipVia, type RelationshipsMap, type ResolvedMembership, type SourceRow, type SourcedRecord, type StageType, type StepId, type StepProblem, type StepState, type SyncAction, type SyncResult, type SyncStore, type Task, type TaskEntityType, type TaskFilters, type TaskPriority, type TaskStatus, type UpdateCompanyInput, type UpdateContactInput, type UpdateDealInput, type UpdateTaskInput, VENDOR_STATUS, type ValueInterval, authCustom, buildFilterFromDiscriminator, buildRelationships, columnMetaFor, compileEntityView, compileEntityViews, compileProjectionFrom, compileProjectionIdentity, compileProjectionJoins, compileProjectionPreview, compileProjectionSelect, computeDealValue, contactSegmentSchema, coversUniqueKey, defineClivlyConfig, entitiesConfigSchema, evaluateStage, explainEntitiesConfig, fanOutJoins, filterSchema, hasRichMeta, hostOwnedFieldMessage, identityRefs, isClosedStageType, isContactStatus, isHostOwned, isRemovalAction, joinFansOut, mappingsToEntitiesConfig, matchesCondition, missingRequiredFields, primaryKeyColumns, projectionFields, projectionSchema, quoteIdent, reconcile, rejectedCompanyFields, rejectedContactFields, relationshipSchema, relationshipViaSignature, relationshipsSchema, requiredFieldsFor, resolveActions, runSync, slugify, toObjectTypeSlug, validateEntitiesConfig, validateProjection, validateProjectionFilter };