clivly 0.10.9 → 0.11.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 (127) hide show
  1. package/adapter-BWrOtOw5.d.mts +83 -0
  2. package/adapter-Bd5HjLYa.d.cts +83 -0
  3. package/{auth-adapter-CXTiW3Mb.d.cts → auth-adapter-C3BQpc-q.d.cts} +1 -1
  4. package/{auth-adapter-DSuYwv1c.d.mts → auth-adapter-D54ajbl7.d.mts} +1 -1
  5. package/auth-better-auth.d.cts +6 -6
  6. package/auth-better-auth.d.mts +6 -6
  7. package/auth-clerk.d.cts +5 -5
  8. package/auth-clerk.d.mts +5 -5
  9. package/auth-workos.d.cts +5 -5
  10. package/auth-workos.d.mts +5 -5
  11. package/core-adapter.d.cts +1 -1
  12. package/core-adapter.d.mts +1 -1
  13. package/core-auth-adapter.d.cts +1 -1
  14. package/core-auth-adapter.d.mts +1 -1
  15. package/core-drizzle.d.cts +1 -1
  16. package/core-drizzle.d.mts +1 -1
  17. package/core-entity-config.cjs +1 -1
  18. package/core-entity-config.d.cts +1 -1
  19. package/core-entity-config.d.mts +1 -1
  20. package/core-entity-config.mjs +1 -1
  21. package/core-entity-heuristics.d.cts +1 -1
  22. package/core-entity-heuristics.d.mts +1 -1
  23. package/core-mapping-form.d.cts +1 -1
  24. package/core-mapping-form.d.mts +1 -1
  25. package/core-mappings-config.cjs +1 -1
  26. package/core-mappings-config.d.cts +1 -1
  27. package/core-mappings-config.d.mts +1 -1
  28. package/core-mappings-config.mjs +1 -1
  29. package/core-sync-engine.cjs +1 -1
  30. package/core-sync-engine.d.cts +1 -1
  31. package/core-sync-engine.d.mts +1 -1
  32. package/core-sync-engine.mjs +1 -1
  33. package/core-types.d.cts +2 -2
  34. package/core-types.d.mts +2 -2
  35. package/core-view-compiler.cjs +1 -1
  36. package/core-view-compiler.d.cts +1 -1
  37. package/core-view-compiler.d.mts +1 -1
  38. package/core-view-compiler.mjs +1 -1
  39. package/core.cjs +11 -7
  40. package/core.d.cts +10 -10
  41. package/core.d.mts +10 -10
  42. package/core.mjs +8 -8
  43. package/{drizzle-SD8WCvYj.d.cts → drizzle-CiK37zJm.d.cts} +1 -1
  44. package/{drizzle-axugRJ0u.d.mts → drizzle-ehVWLSrN.d.mts} +1 -1
  45. package/drizzle.cjs +2 -2
  46. package/drizzle.d.cts +9 -9
  47. package/drizzle.d.mts +9 -9
  48. package/drizzle.mjs +2 -2
  49. package/{entity-config-w8oMBWf8.d.cts → entity-config-ApnT5j3X.d.cts} +1735 -17
  50. package/{entity-config-C2MfIDL2.cjs → entity-config-BI4RYNKL.cjs} +19 -2
  51. package/{entity-config-w8oMBWf8.d.mts → entity-config-CKcj4-M_.d.mts} +1736 -17
  52. package/{entity-config-bC3DX9f1.mjs → entity-config-Ccfb2IL9.mjs} +28 -3
  53. package/index.cjs +15 -11
  54. package/index.d.cts +10 -11
  55. package/index.d.mts +10 -11
  56. package/index.mjs +15 -11
  57. package/{internal-CHvZMvxC.d.cts → internal-Bjpq7S2G.d.mts} +69 -2
  58. package/{internal-Cz59xMj8.cjs → internal-CRIgf9jS.cjs} +102 -0
  59. package/{internal-WximMGmH.d.mts → internal-D9kqkhPs.d.cts} +69 -2
  60. package/internal-adapter.d.cts +1 -1
  61. package/internal-adapter.d.mts +1 -1
  62. package/internal-auth-adapter.d.cts +1 -1
  63. package/internal-auth-adapter.d.mts +1 -1
  64. package/internal-drizzle.d.cts +1 -1
  65. package/internal-drizzle.d.mts +1 -1
  66. package/internal-entity-config.cjs +1 -1
  67. package/internal-entity-config.d.cts +1 -1
  68. package/internal-entity-config.d.mts +1 -1
  69. package/internal-entity-config.mjs +1 -1
  70. package/internal-entity-heuristics.cjs +43 -24
  71. package/internal-entity-heuristics.d.cts +21 -21
  72. package/internal-entity-heuristics.d.mts +21 -21
  73. package/internal-entity-heuristics.mjs +43 -24
  74. package/internal-mapping-form.d.cts +1 -1
  75. package/internal-mapping-form.d.mts +1 -1
  76. package/internal-mappings-config.cjs +1 -1
  77. package/internal-mappings-config.d.cts +1 -1
  78. package/internal-mappings-config.d.mts +1 -1
  79. package/internal-mappings-config.mjs +1 -1
  80. package/internal-sync-engine.cjs +1 -1
  81. package/internal-sync-engine.d.cts +1 -1
  82. package/internal-sync-engine.d.mts +1 -1
  83. package/internal-sync-engine.mjs +1 -1
  84. package/internal-types.d.cts +2 -2
  85. package/internal-types.d.mts +2 -2
  86. package/{internal-Bgiimp5D.mjs → internal-v6P9MZY1.mjs} +79 -1
  87. package/internal-view-compiler.cjs +1 -1
  88. package/internal-view-compiler.d.cts +1 -1
  89. package/internal-view-compiler.d.mts +1 -1
  90. package/internal-view-compiler.mjs +1 -1
  91. package/internal.cjs +11 -7
  92. package/internal.d.cts +10 -10
  93. package/internal.d.mts +10 -10
  94. package/internal.mjs +8 -8
  95. package/{mapping-form-BsTxv8w3.d.cts → mapping-form-Btn-7gzv.d.mts} +1 -1
  96. package/{mapping-form-OTFwr1sN.d.mts → mapping-form-XsLLCqW_.d.cts} +1 -1
  97. package/{mappings-config-Dpv08-x4.cjs → mappings-config-BCsRLohT.cjs} +2 -1
  98. package/{mappings-config-CRSL9dzw.mjs → mappings-config-CwQNQ6bA.mjs} +2 -1
  99. package/{mappings-config-DbznSjTX.d.cts → mappings-config-D6_oCi2Q.d.mts} +3 -1
  100. package/{mappings-config-SXu_zlmp.d.mts → mappings-config-iJzbcUMp.d.cts} +3 -1
  101. package/{namespace-probe-C3xMOqWE.d.cts → namespace-probe-C5RLl74M.d.cts} +1 -1
  102. package/{namespace-probe-BmxtnOfc.d.mts → namespace-probe-CNQKSmxz.d.mts} +1 -1
  103. package/package.json +1 -1
  104. package/{projection-Dz6_i1-w.cjs → projection-BELgANG2.cjs} +32 -23
  105. package/{projection-CSGJbZlZ.mjs → projection-DvNewmI1.mjs} +32 -23
  106. package/{projection-sql-CbXCKt3s.cjs → projection-sql-DuCtFE9t.cjs} +1 -1
  107. package/{projection-sql-iHoiYr1R.mjs → projection-sql-DweUaWRc.mjs} +1 -1
  108. package/{sdk-BIYu0N3V.cjs → sdk-BvGSxBQc.cjs} +3 -3
  109. package/{sdk-DofHordq.mjs → sdk-C-Pjxj2y.mjs} +3 -3
  110. package/sdk.cjs +2 -2
  111. package/sdk.d.cts +10 -10
  112. package/sdk.d.mts +10 -10
  113. package/sdk.mjs +2 -2
  114. package/{sync-engine-CUKWXUv7.d.mts → sync-engine--M9EaONC.d.mts} +2 -2
  115. package/{sync-engine-CTSIcLlZ.mjs → sync-engine-Df2MCs_n.mjs} +1 -1
  116. package/{sync-engine-B0FT1ax6.cjs → sync-engine-Dwm_KDUS.cjs} +1 -1
  117. package/{sync-engine-D2YlIHZB.d.cts → sync-engine-V3_UutGv.d.cts} +2 -2
  118. package/{types-Cq1uHUKp.d.mts → types-D08UzDqe.d.cts} +69 -2
  119. package/{types-Cq1uHUKp.d.cts → types-D08UzDqe.d.mts} +69 -2
  120. package/{view-compiler-BzKk8nY3.mjs → view-compiler-C-6RydKK.mjs} +2 -2
  121. package/{view-compiler-BO4CKamn.d.cts → view-compiler-Cq8apvZ4.d.cts} +1 -1
  122. package/{view-compiler-iEwUOuba.d.mts → view-compiler-CwKVoK1w.d.mts} +1 -1
  123. package/{view-compiler-ZKZbd3SK.cjs → view-compiler-xiwm5iar.cjs} +2 -2
  124. package/vite.d.cts +4 -5
  125. package/vite.d.mts +4 -5
  126. package/adapter-1TN0zohk.d.cts +0 -45
  127. package/adapter-uxirB88i.d.mts +0 -45
@@ -1,5 +1,5 @@
1
- import { a as ClivlyEntitiesConfig } from "./entity-config-w8oMBWf8.mjs";
2
- import { n as CompiledView, t as CompileOptions } from "./view-compiler-iEwUOuba.mjs";
1
+ import { a as ClivlyEntitiesConfig } from "./entity-config-CKcj4-M_.mjs";
2
+ import { n as CompiledView, t as CompileOptions } from "./view-compiler-CwKVoK1w.mjs";
3
3
  //#region ../core/src/sync-engine.d.ts
4
4
  /**
5
5
  * Sync engine (Phase 3) — materializes the read-only entity views into Clivly's
@@ -1,4 +1,4 @@
1
- import { r as compileEntityViews } from "./view-compiler-BzKk8nY3.mjs";
1
+ import { r as compileEntityViews } from "./view-compiler-C-6RydKK.mjs";
2
2
  //#region ../core/src/sync-engine.ts
3
3
  /**
4
4
  * Diff a view's rows against the current mirror population for one entity.
@@ -1,4 +1,4 @@
1
- const require_view_compiler = require("./view-compiler-ZKZbd3SK.cjs");
1
+ const require_view_compiler = require("./view-compiler-xiwm5iar.cjs");
2
2
  //#region ../core/src/sync-engine.ts
3
3
  /**
4
4
  * Diff a view's rows against the current mirror population for one entity.
@@ -1,5 +1,5 @@
1
- import { a as ClivlyEntitiesConfig } from "./entity-config-w8oMBWf8.cjs";
2
- import { n as CompiledView, t as CompileOptions } from "./view-compiler-BO4CKamn.cjs";
1
+ import { a as ClivlyEntitiesConfig } from "./entity-config-ApnT5j3X.cjs";
2
+ import { n as CompiledView, t as CompileOptions } from "./view-compiler-Cq8apvZ4.cjs";
3
3
  //#region ../core/src/sync-engine.d.ts
4
4
  /**
5
5
  * Sync engine (Phase 3) — materializes the read-only entity views into Clivly's
@@ -28,7 +28,7 @@ interface PipelineConfig {
28
28
  }
29
29
  type TaskStatus = "todo" | "in_progress" | "done" | "cancelled";
30
30
  type TaskPriority = "low" | "medium" | "high";
31
- type TaskEntityType = "contact" | "company" | "deal";
31
+ type TaskEntityType = "contact" | "company" | "custom" | "deal";
32
32
  type ActivityType = "note" | "email" | "task" | "deal" | "call";
33
33
  type CrmRole = "owner" | "admin" | "member" | "developer" | "support_agent";
34
34
  interface Contact {
@@ -39,17 +39,48 @@ interface Contact {
39
39
  lastActivityAt: Date | null;
40
40
  name: string;
41
41
  orgId: string;
42
+ phone: string | null;
43
+ /**
44
+ * The host row this contact mirrors, or null when it was created in the CRM.
45
+ *
46
+ * Carried on the domain type because it decides whether a user may edit the
47
+ * identity fields: sync rewrites them from the host view on every run, so an
48
+ * edit to a sourced row would be silently reverted. See `host-owned-fields`.
49
+ */
50
+ sourceRef: string | null;
42
51
  status: ContactStatus;
43
52
  title: string | null;
44
53
  }
45
54
  interface Company {
55
+ /**
56
+ * How many non-archived contacts are attached to this company.
57
+ *
58
+ * Derived per read, never stored — distinct from {@link Company.size}, which
59
+ * is the mappable headcount of the business itself. A provider with 400 staff
60
+ * and 4 CRM contacts has `size: "400"` and `contactCount: 4`; conflating them
61
+ * would state a falsehood in the authoritative-looking direction.
62
+ */
63
+ contactCount: number;
46
64
  createdAt: Date;
47
65
  domain: string | null;
66
+ email: string | null;
48
67
  id: string;
49
68
  industry: string | null;
50
69
  name: string;
51
70
  orgId: string;
71
+ phone: string | null;
72
+ /**
73
+ * The one contact to talk to at this company, if chosen.
74
+ *
75
+ * Constrained to a contact of this same company, and cleared when that
76
+ * contact is archived — so a non-null value always names someone live and
77
+ * attached here. Unlike the other fields it is never host-owned: it is a CRM
78
+ * judgement, so it stays editable on synced rows.
79
+ */
80
+ primaryContactId: string | null;
52
81
  size: string | null;
82
+ /** See {@link Contact.sourceRef}. */
83
+ sourceRef: string | null;
53
84
  }
54
85
  interface Deal {
55
86
  closeDate: Date | null;
@@ -108,6 +139,7 @@ interface CreateContactInput {
108
139
  companyId?: string;
109
140
  email: string;
110
141
  name: string;
142
+ phone?: string;
111
143
  status?: ContactStatus;
112
144
  title?: string;
113
145
  }
@@ -115,15 +147,28 @@ interface UpdateContactInput {
115
147
  companyId?: string | null;
116
148
  email?: string;
117
149
  name?: string;
150
+ phone?: string | null;
118
151
  status?: ContactStatus;
119
152
  title?: string | null;
120
153
  }
121
154
  interface CreateCompanyInput {
122
155
  domain?: string;
156
+ email?: string;
123
157
  industry?: string;
124
158
  name: string;
159
+ phone?: string;
125
160
  size?: string;
126
161
  }
162
+ interface UpdateCompanyInput {
163
+ domain?: string | null;
164
+ email?: string | null;
165
+ industry?: string | null;
166
+ name?: string;
167
+ phone?: string | null;
168
+ /** Null clears the point of contact; see {@link Company.primaryContactId}. */
169
+ primaryContactId?: string | null;
170
+ size?: string | null;
171
+ }
127
172
  interface CreateDealInput {
128
173
  contactId?: string;
129
174
  name: string;
@@ -168,10 +213,32 @@ interface CreateActivityInput {
168
213
  type RecordSource = "all" | "synced";
169
214
  interface ContactFilters {
170
215
  companyId?: string;
216
+ /**
217
+ * Exclude archived rows. Defaults to false — the adapter returns everything
218
+ * — because most callers are lookup maps, not user-facing lists:
219
+ * `importContacts` builds its dedup set from this (hiding archived rows
220
+ * would resurrect a contact the user archived as a duplicate) and
221
+ * `deals.list` builds its contact-name map from it (an archived contact on
222
+ * a live deal would render blank).
223
+ *
224
+ * The user-facing `contacts.list` / `companies.list` routes opt in, because
225
+ * there `archiveContact` is the delete affordance and a row still visible
226
+ * after archiving reads as a failed delete.
227
+ *
228
+ * Independent of `source`: `source: "synced"` already excludes archived
229
+ * rows, since sync archives a row when it leaves the host view and such a
230
+ * row is no longer sync-provenanced.
231
+ */
232
+ excludeArchived?: boolean;
171
233
  search?: string;
172
234
  source?: RecordSource;
173
235
  status?: ContactStatus;
174
236
  }
237
+ interface CompanyFilters {
238
+ /** See {@link ContactFilters.excludeArchived}. */
239
+ excludeArchived?: boolean;
240
+ source?: RecordSource;
241
+ }
175
242
  interface TaskFilters {
176
243
  assignee?: string;
177
244
  entityId?: string;
@@ -182,4 +249,4 @@ interface TaskFilters {
182
249
  status?: TaskStatus;
183
250
  }
184
251
  //#endregion
185
- export { ValueInterval as A, TaskEntityType as C, UpdateContactInput as D, TaskStatus as E, UpdateDealInput as O, Task as S, TaskPriority as T, PipelineConfig as _, ContactFilters as a, RecordSource as b, CreateCompanyInput as c, CreateTaskInput as d, CrmRole as f, OPEN_STAGE_TYPE as g, Note as h, Contact as i, isClosedStageType as j, UpdateTaskInput as k, CreateContactInput as l, DealStage as m, ActivityType as n, ContactStatus as o, Deal as p, Company as r, CreateActivityInput as s, Activity as t, CreateDealInput as u, PipelineKind as v, TaskFilters as w, StageType as x, PipelineStageConfig as y };
252
+ export { UpdateDealInput as A, Task as C, TaskStatus as D, TaskPriority as E, ValueInterval as M, isClosedStageType as N, UpdateCompanyInput as O, StageType as S, TaskFilters as T, OPEN_STAGE_TYPE as _, Contact as a, PipelineStageConfig as b, CreateActivityInput as c, CreateDealInput as d, CreateTaskInput as f, Note as g, DealStage as h, CompanyFilters as i, UpdateTaskInput as j, UpdateContactInput as k, CreateCompanyInput as l, Deal as m, ActivityType as n, ContactFilters as o, CrmRole as p, Company as r, ContactStatus as s, Activity as t, CreateContactInput as u, PipelineConfig as v, TaskEntityType as w, RecordSource as x, PipelineKind as y };
@@ -28,7 +28,7 @@ interface PipelineConfig {
28
28
  }
29
29
  type TaskStatus = "todo" | "in_progress" | "done" | "cancelled";
30
30
  type TaskPriority = "low" | "medium" | "high";
31
- type TaskEntityType = "contact" | "company" | "deal";
31
+ type TaskEntityType = "contact" | "company" | "custom" | "deal";
32
32
  type ActivityType = "note" | "email" | "task" | "deal" | "call";
33
33
  type CrmRole = "owner" | "admin" | "member" | "developer" | "support_agent";
34
34
  interface Contact {
@@ -39,17 +39,48 @@ interface Contact {
39
39
  lastActivityAt: Date | null;
40
40
  name: string;
41
41
  orgId: string;
42
+ phone: string | null;
43
+ /**
44
+ * The host row this contact mirrors, or null when it was created in the CRM.
45
+ *
46
+ * Carried on the domain type because it decides whether a user may edit the
47
+ * identity fields: sync rewrites them from the host view on every run, so an
48
+ * edit to a sourced row would be silently reverted. See `host-owned-fields`.
49
+ */
50
+ sourceRef: string | null;
42
51
  status: ContactStatus;
43
52
  title: string | null;
44
53
  }
45
54
  interface Company {
55
+ /**
56
+ * How many non-archived contacts are attached to this company.
57
+ *
58
+ * Derived per read, never stored — distinct from {@link Company.size}, which
59
+ * is the mappable headcount of the business itself. A provider with 400 staff
60
+ * and 4 CRM contacts has `size: "400"` and `contactCount: 4`; conflating them
61
+ * would state a falsehood in the authoritative-looking direction.
62
+ */
63
+ contactCount: number;
46
64
  createdAt: Date;
47
65
  domain: string | null;
66
+ email: string | null;
48
67
  id: string;
49
68
  industry: string | null;
50
69
  name: string;
51
70
  orgId: string;
71
+ phone: string | null;
72
+ /**
73
+ * The one contact to talk to at this company, if chosen.
74
+ *
75
+ * Constrained to a contact of this same company, and cleared when that
76
+ * contact is archived — so a non-null value always names someone live and
77
+ * attached here. Unlike the other fields it is never host-owned: it is a CRM
78
+ * judgement, so it stays editable on synced rows.
79
+ */
80
+ primaryContactId: string | null;
52
81
  size: string | null;
82
+ /** See {@link Contact.sourceRef}. */
83
+ sourceRef: string | null;
53
84
  }
54
85
  interface Deal {
55
86
  closeDate: Date | null;
@@ -108,6 +139,7 @@ interface CreateContactInput {
108
139
  companyId?: string;
109
140
  email: string;
110
141
  name: string;
142
+ phone?: string;
111
143
  status?: ContactStatus;
112
144
  title?: string;
113
145
  }
@@ -115,15 +147,28 @@ interface UpdateContactInput {
115
147
  companyId?: string | null;
116
148
  email?: string;
117
149
  name?: string;
150
+ phone?: string | null;
118
151
  status?: ContactStatus;
119
152
  title?: string | null;
120
153
  }
121
154
  interface CreateCompanyInput {
122
155
  domain?: string;
156
+ email?: string;
123
157
  industry?: string;
124
158
  name: string;
159
+ phone?: string;
125
160
  size?: string;
126
161
  }
162
+ interface UpdateCompanyInput {
163
+ domain?: string | null;
164
+ email?: string | null;
165
+ industry?: string | null;
166
+ name?: string;
167
+ phone?: string | null;
168
+ /** Null clears the point of contact; see {@link Company.primaryContactId}. */
169
+ primaryContactId?: string | null;
170
+ size?: string | null;
171
+ }
127
172
  interface CreateDealInput {
128
173
  contactId?: string;
129
174
  name: string;
@@ -168,10 +213,32 @@ interface CreateActivityInput {
168
213
  type RecordSource = "all" | "synced";
169
214
  interface ContactFilters {
170
215
  companyId?: string;
216
+ /**
217
+ * Exclude archived rows. Defaults to false — the adapter returns everything
218
+ * — because most callers are lookup maps, not user-facing lists:
219
+ * `importContacts` builds its dedup set from this (hiding archived rows
220
+ * would resurrect a contact the user archived as a duplicate) and
221
+ * `deals.list` builds its contact-name map from it (an archived contact on
222
+ * a live deal would render blank).
223
+ *
224
+ * The user-facing `contacts.list` / `companies.list` routes opt in, because
225
+ * there `archiveContact` is the delete affordance and a row still visible
226
+ * after archiving reads as a failed delete.
227
+ *
228
+ * Independent of `source`: `source: "synced"` already excludes archived
229
+ * rows, since sync archives a row when it leaves the host view and such a
230
+ * row is no longer sync-provenanced.
231
+ */
232
+ excludeArchived?: boolean;
171
233
  search?: string;
172
234
  source?: RecordSource;
173
235
  status?: ContactStatus;
174
236
  }
237
+ interface CompanyFilters {
238
+ /** See {@link ContactFilters.excludeArchived}. */
239
+ excludeArchived?: boolean;
240
+ source?: RecordSource;
241
+ }
175
242
  interface TaskFilters {
176
243
  assignee?: string;
177
244
  entityId?: string;
@@ -182,4 +249,4 @@ interface TaskFilters {
182
249
  status?: TaskStatus;
183
250
  }
184
251
  //#endregion
185
- export { ValueInterval as A, TaskEntityType as C, UpdateContactInput as D, TaskStatus as E, UpdateDealInput as O, Task as S, TaskPriority as T, PipelineConfig as _, ContactFilters as a, RecordSource as b, CreateCompanyInput as c, CreateTaskInput as d, CrmRole as f, OPEN_STAGE_TYPE as g, Note as h, Contact as i, isClosedStageType as j, UpdateTaskInput as k, CreateContactInput as l, DealStage as m, ActivityType as n, ContactStatus as o, Deal as p, Company as r, CreateActivityInput as s, Activity as t, CreateDealInput as u, PipelineKind as v, TaskFilters as w, StageType as x, PipelineStageConfig as y };
252
+ export { UpdateDealInput as A, Task as C, TaskStatus as D, TaskPriority as E, ValueInterval as M, isClosedStageType as N, UpdateCompanyInput as O, StageType as S, TaskFilters as T, OPEN_STAGE_TYPE as _, Contact as a, PipelineStageConfig as b, CreateActivityInput as c, CreateDealInput as d, CreateTaskInput as f, Note as g, DealStage as h, CompanyFilters as i, UpdateTaskInput as j, UpdateContactInput as k, CreateCompanyInput as l, Deal as m, ActivityType as n, ContactFilters as o, CrmRole as p, Company as r, ContactStatus as s, Activity as t, CreateContactInput as u, PipelineConfig as v, TaskEntityType as w, RecordSource as x, PipelineKind as y };
@@ -1,5 +1,5 @@
1
- import { t as BASE_REF } from "./projection-CSGJbZlZ.mjs";
2
- import { i as compileProjectionJoins, n as compileProjectionFrom, o as compileProjectionSelect, s as quoteIdent } from "./projection-sql-iHoiYr1R.mjs";
1
+ import { t as BASE_REF } from "./projection-DvNewmI1.mjs";
2
+ import { i as compileProjectionJoins, n as compileProjectionFrom, o as compileProjectionSelect, s as quoteIdent } from "./projection-sql-DweUaWRc.mjs";
3
3
  //#region ../core/src/view-compiler.ts
4
4
  /**
5
5
  * View compiler (Phase 2) — turns a validated entity config into read-only
@@ -1,4 +1,4 @@
1
- import { a as ClivlyEntitiesConfig } from "./entity-config-w8oMBWf8.cjs";
1
+ import { a as ClivlyEntitiesConfig } from "./entity-config-ApnT5j3X.cjs";
2
2
  //#region ../core/src/view-compiler.d.ts
3
3
  declare const DEFAULT_VIEW_PREFIX = "crm_src_";
4
4
  interface CompileOptions {
@@ -1,4 +1,4 @@
1
- import { a as ClivlyEntitiesConfig } from "./entity-config-w8oMBWf8.mjs";
1
+ import { a as ClivlyEntitiesConfig } from "./entity-config-CKcj4-M_.mjs";
2
2
  //#region ../core/src/view-compiler.d.ts
3
3
  declare const DEFAULT_VIEW_PREFIX = "crm_src_";
4
4
  interface CompileOptions {
@@ -1,5 +1,5 @@
1
- const require_projection = require("./projection-Dz6_i1-w.cjs");
2
- const require_projection_sql = require("./projection-sql-CbXCKt3s.cjs");
1
+ const require_projection = require("./projection-BELgANG2.cjs");
2
+ const require_projection_sql = require("./projection-sql-DuCtFE9t.cjs");
3
3
  //#region ../core/src/view-compiler.ts
4
4
  /**
5
5
  * View compiler (Phase 2) — turns a validated entity config into read-only
package/vite.d.cts CHANGED
@@ -1,7 +1,7 @@
1
- import { o as ClivlySDK } from "./namespace-probe-C3xMOqWE.cjs";
1
+ import { o as ClivlySDK } from "./namespace-probe-C5RLl74M.cjs";
2
2
  import { Plugin } from "vite";
3
3
  //#region ../sdk/src/vite.d.ts
4
- interface ClivlyViteOptions {
4
+ export interface ClivlyViteOptions {
5
5
  /** Log prefix for Clivly's boot lines. Defaults to "clivly". */
6
6
  name?: string;
7
7
  }
@@ -17,6 +17,5 @@ interface ClivlyViteOptions {
17
17
  * Vite is an optional peer dependency imported type-only (`import type`), so
18
18
  * the built bundle carries no runtime dependency on Vite.
19
19
  */
20
- declare function clivlyVite(sdk: ClivlySDK, options?: ClivlyViteOptions): Plugin;
21
- //#endregion
22
- export { ClivlyViteOptions, clivlyVite };
20
+ export declare function clivlyVite(sdk: ClivlySDK, options?: ClivlyViteOptions): Plugin;
21
+ //#endregion
package/vite.d.mts CHANGED
@@ -1,7 +1,7 @@
1
- import { o as ClivlySDK } from "./namespace-probe-BmxtnOfc.mjs";
1
+ import { o as ClivlySDK } from "./namespace-probe-CNQKSmxz.mjs";
2
2
  import { Plugin } from "vite";
3
3
  //#region ../sdk/src/vite.d.ts
4
- interface ClivlyViteOptions {
4
+ export interface ClivlyViteOptions {
5
5
  /** Log prefix for Clivly's boot lines. Defaults to "clivly". */
6
6
  name?: string;
7
7
  }
@@ -17,6 +17,5 @@ interface ClivlyViteOptions {
17
17
  * Vite is an optional peer dependency imported type-only (`import type`), so
18
18
  * the built bundle carries no runtime dependency on Vite.
19
19
  */
20
- declare function clivlyVite(sdk: ClivlySDK, options?: ClivlyViteOptions): Plugin;
21
- //#endregion
22
- export { ClivlyViteOptions, clivlyVite };
20
+ export declare function clivlyVite(sdk: ClivlySDK, options?: ClivlyViteOptions): Plugin;
21
+ //#endregion
@@ -1,45 +0,0 @@
1
- import { D as UpdateContactInput, O as UpdateDealInput, S as Task, a as ContactFilters, b as RecordSource, c as CreateCompanyInput, d as CreateTaskInput, i as Contact, k as UpdateTaskInput, l as CreateContactInput, p as Deal, r as Company, s as CreateActivityInput, t as Activity, u as CreateDealInput, w as TaskFilters } from "./types-Cq1uHUKp.cjs";
2
- //#region ../core/src/adapter.d.ts
3
- /**
4
- * The contract every ORM implementation fulfils. `packages/drizzle` is the first
5
- * implementation; Prisma/Kysely/TypeORM can follow without changes to consumers.
6
- *
7
- * Every method is scoped to a single organization (`orgId`) — the adapter is the
8
- * one place tenant isolation is enforced for CRM data. Implementations only ever
9
- * read/write Clivly-owned `crm_*` tables; they never mutate host business tables.
10
- */
11
- interface CRMAdapter {
12
- archiveTask(orgId: string, id: string): Promise<Task>;
13
- completeTask(orgId: string, id: string): Promise<Task>;
14
- createActivity(orgId: string, data: CreateActivityInput): Promise<Activity>;
15
- createCompany(orgId: string, data: CreateCompanyInput): Promise<Company>;
16
- createContact(orgId: string, data: CreateContactInput): Promise<Contact>;
17
- createDeal(orgId: string, data: CreateDealInput): Promise<Deal>;
18
- createTask(orgId: string, data: CreateTaskInput): Promise<Task>;
19
- deleteDeal(orgId: string, id: string): Promise<Deal | null>;
20
- getActivities(orgId: string, contactId: string): Promise<Activity[]>;
21
- getCompanies(orgId: string, filters?: {
22
- source?: RecordSource;
23
- }): Promise<Company[]>;
24
- getContact(orgId: string, id: string): Promise<Contact | null>;
25
- getContacts(orgId: string, filters?: ContactFilters): Promise<Contact[]>;
26
- getDeal(orgId: string, id: string): Promise<Deal | null>;
27
- getDeals(orgId: string, filters?: {
28
- source?: RecordSource;
29
- }): Promise<Deal[]>;
30
- getTasks(orgId: string, filters?: TaskFilters): Promise<Task[]>;
31
- /**
32
- * Move a deal to `stage` and reorder it directly after `afterId` (null = top
33
- * of the column). The adapter computes the fractional `position` from the
34
- * target column's current order; callers never pass a numeric position.
35
- */
36
- moveDeal(orgId: string, id: string, stage: Deal["stage"], afterId: string | null): Promise<Deal>;
37
- reopenTask(orgId: string, id: string): Promise<Task>;
38
- updateContact(orgId: string, id: string, data: UpdateContactInput): Promise<Contact>;
39
- updateDeal(orgId: string, id: string, data: UpdateDealInput): Promise<Deal>;
40
- updateDealStage(orgId: string, id: string, stage: Deal["stage"]): Promise<Deal>;
41
- updateTask(orgId: string, id: string, data: UpdateTaskInput): Promise<Task>;
42
- updateTaskStatus(orgId: string, id: string, status: Task["status"]): Promise<Task>;
43
- }
44
- //#endregion
45
- export { CRMAdapter as t };
@@ -1,45 +0,0 @@
1
- import { D as UpdateContactInput, O as UpdateDealInput, S as Task, a as ContactFilters, b as RecordSource, c as CreateCompanyInput, d as CreateTaskInput, i as Contact, k as UpdateTaskInput, l as CreateContactInput, p as Deal, r as Company, s as CreateActivityInput, t as Activity, u as CreateDealInput, w as TaskFilters } from "./types-Cq1uHUKp.mjs";
2
- //#region ../core/src/adapter.d.ts
3
- /**
4
- * The contract every ORM implementation fulfils. `packages/drizzle` is the first
5
- * implementation; Prisma/Kysely/TypeORM can follow without changes to consumers.
6
- *
7
- * Every method is scoped to a single organization (`orgId`) — the adapter is the
8
- * one place tenant isolation is enforced for CRM data. Implementations only ever
9
- * read/write Clivly-owned `crm_*` tables; they never mutate host business tables.
10
- */
11
- interface CRMAdapter {
12
- archiveTask(orgId: string, id: string): Promise<Task>;
13
- completeTask(orgId: string, id: string): Promise<Task>;
14
- createActivity(orgId: string, data: CreateActivityInput): Promise<Activity>;
15
- createCompany(orgId: string, data: CreateCompanyInput): Promise<Company>;
16
- createContact(orgId: string, data: CreateContactInput): Promise<Contact>;
17
- createDeal(orgId: string, data: CreateDealInput): Promise<Deal>;
18
- createTask(orgId: string, data: CreateTaskInput): Promise<Task>;
19
- deleteDeal(orgId: string, id: string): Promise<Deal | null>;
20
- getActivities(orgId: string, contactId: string): Promise<Activity[]>;
21
- getCompanies(orgId: string, filters?: {
22
- source?: RecordSource;
23
- }): Promise<Company[]>;
24
- getContact(orgId: string, id: string): Promise<Contact | null>;
25
- getContacts(orgId: string, filters?: ContactFilters): Promise<Contact[]>;
26
- getDeal(orgId: string, id: string): Promise<Deal | null>;
27
- getDeals(orgId: string, filters?: {
28
- source?: RecordSource;
29
- }): Promise<Deal[]>;
30
- getTasks(orgId: string, filters?: TaskFilters): Promise<Task[]>;
31
- /**
32
- * Move a deal to `stage` and reorder it directly after `afterId` (null = top
33
- * of the column). The adapter computes the fractional `position` from the
34
- * target column's current order; callers never pass a numeric position.
35
- */
36
- moveDeal(orgId: string, id: string, stage: Deal["stage"], afterId: string | null): Promise<Deal>;
37
- reopenTask(orgId: string, id: string): Promise<Task>;
38
- updateContact(orgId: string, id: string, data: UpdateContactInput): Promise<Contact>;
39
- updateDeal(orgId: string, id: string, data: UpdateDealInput): Promise<Deal>;
40
- updateDealStage(orgId: string, id: string, stage: Deal["stage"]): Promise<Deal>;
41
- updateTask(orgId: string, id: string, data: UpdateTaskInput): Promise<Task>;
42
- updateTaskStatus(orgId: string, id: string, status: Task["status"]): Promise<Task>;
43
- }
44
- //#endregion
45
- export { CRMAdapter as t };