clivly 0.11.0 → 0.13.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 (53) hide show
  1. package/{adapter-BWrOtOw5.d.mts → adapter-DTMeGGsl.d.cts} +19 -1
  2. package/{adapter-Bd5HjLYa.d.cts → adapter-DhPBRNpi.d.mts} +19 -1
  3. package/{auth-adapter-C3BQpc-q.d.cts → auth-adapter-C6rDx3XH.d.mts} +1 -1
  4. package/{auth-adapter-D54ajbl7.d.mts → auth-adapter-Csk9KkvI.d.cts} +1 -1
  5. package/auth-better-auth.d.cts +1 -1
  6. package/auth-better-auth.d.mts +1 -1
  7. package/auth-clerk.d.cts +1 -1
  8. package/auth-clerk.d.mts +1 -1
  9. package/auth-workos.d.cts +1 -1
  10. package/auth-workos.d.mts +1 -1
  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-types.d.cts +2 -2
  16. package/core-types.d.mts +2 -2
  17. package/core.cjs +2 -1
  18. package/core.d.cts +5 -5
  19. package/core.d.mts +5 -5
  20. package/core.mjs +2 -2
  21. package/drizzle.cjs +66 -0
  22. package/drizzle.d.cts +66 -1
  23. package/drizzle.d.mts +66 -1
  24. package/drizzle.mjs +65 -1
  25. package/index.cjs +1 -1
  26. package/index.mjs +1 -1
  27. package/{internal-CRIgf9jS.cjs → internal-BxtvxF7Z.cjs} +34 -0
  28. package/{internal-Bjpq7S2G.d.mts → internal-Cmx7Zevf.d.mts} +36 -1
  29. package/internal-adapter.d.cts +1 -1
  30. package/internal-adapter.d.mts +1 -1
  31. package/internal-auth-adapter.d.cts +1 -1
  32. package/internal-auth-adapter.d.mts +1 -1
  33. package/internal-types.d.cts +2 -2
  34. package/internal-types.d.mts +2 -2
  35. package/{internal-v6P9MZY1.mjs → internal-u0Bks5Gr.mjs} +29 -1
  36. package/{internal-D9kqkhPs.d.cts → internal-vH5Rlg6Q.d.cts} +36 -1
  37. package/internal.cjs +2 -1
  38. package/internal.d.cts +5 -5
  39. package/internal.d.mts +5 -5
  40. package/internal.mjs +2 -2
  41. package/{namespace-probe-CNQKSmxz.d.mts → namespace-probe-DykR0kgh.d.mts} +42 -0
  42. package/{namespace-probe-C5RLl74M.d.cts → namespace-probe-H7yWc0JV.d.cts} +42 -0
  43. package/package.json +1 -1
  44. package/{sdk-C-Pjxj2y.mjs → sdk-B-dp1tZN.mjs} +38 -1
  45. package/{sdk-BvGSxBQc.cjs → sdk-DKfKhJD_.cjs} +38 -1
  46. package/sdk.cjs +1 -1
  47. package/sdk.d.cts +1 -1
  48. package/sdk.d.mts +1 -1
  49. package/sdk.mjs +1 -1
  50. package/{types-D08UzDqe.d.mts → types-B17TWEOL.d.cts} +37 -1
  51. package/{types-D08UzDqe.d.cts → types-B17TWEOL.d.mts} +37 -1
  52. package/vite.d.cts +1 -1
  53. package/vite.d.mts +1 -1
package/sdk.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { C as customObjectDeclarations, M as validateEntitiesConfig, a as ClivlyEntitiesConfig, f as CustomObjectDeclaration, l as ConfigValidationError, m as DiscoveredSchemaTable, u as ConfigValidationResult, w as defineClivlyConfig } from "./entity-config-CKcj4-M_.mjs";
2
- import { _ as RemoteProjectionsDescription, a as ClivlyConnectResult, c as ClivlyUser, d as DiscoveredTable, f as DoctorCheck, g as EnsuredObjectTypeResult, h as EnsuredMappingResult, i as ClivlyConnectReason, l as CreateChatSessionHandlerOptions, m as EnsureSchemaResult, n as ChatSessionRequestBody, o as ClivlySDK, p as DoctorReport, r as ChatWidgetVisitor, s as ClivlySDKConfig, u as CursorStore, y as SyncTriggerDescription } from "./namespace-probe-CNQKSmxz.mjs";
2
+ import { _ as RemoteProjectionsDescription, a as ClivlyConnectResult, c as ClivlyUser, d as DiscoveredTable, f as DoctorCheck, g as EnsuredObjectTypeResult, h as EnsuredMappingResult, i as ClivlyConnectReason, l as CreateChatSessionHandlerOptions, m as EnsureSchemaResult, n as ChatSessionRequestBody, o as ClivlySDK, p as DoctorReport, r as ChatWidgetVisitor, s as ClivlySDKConfig, u as CursorStore, y as SyncTriggerDescription } from "./namespace-probe-DykR0kgh.mjs";
3
3
  //#region ../sdk/src/trigger-url.d.ts
4
4
  export declare function isPlaceholderUrl(value: string): boolean;
5
5
  //#endregion
package/sdk.mjs CHANGED
@@ -1,3 +1,3 @@
1
1
  import { c as defineClivlyConfig, g as validateEntitiesConfig, s as customObjectDeclarations } from "./entity-config-Ccfb2IL9.mjs";
2
- import { a as ClivlyRateLimitError, i as ClivlyNetworkError, n as ClivlyAuthError, o as createChatSessionHandler, r as ClivlyError, s as isPlaceholderUrl, t as createClivlySDK } from "./sdk-C-Pjxj2y.mjs";
2
+ import { a as ClivlyRateLimitError, i as ClivlyNetworkError, n as ClivlyAuthError, o as createChatSessionHandler, r as ClivlyError, s as isPlaceholderUrl, t as createClivlySDK } from "./sdk-B-dp1tZN.mjs";
3
3
  export { ClivlyAuthError, ClivlyError, ClivlyNetworkError, ClivlyRateLimitError, createChatSessionHandler, createClivlySDK, customObjectDeclarations, defineClivlyConfig, isPlaceholderUrl, validateEntitiesConfig };
@@ -92,7 +92,21 @@ interface Deal {
92
92
  owner: string | null;
93
93
  position: number | null;
94
94
  stage: DealStage;
95
+ /**
96
+ * When a human last moved this deal by hand. Non-null means stage derivation
97
+ * no longer touches it, so a board must be able to mark it as overridden and
98
+ * offer a way back — otherwise an overridden deal is indistinguishable from
99
+ * one the rules simply never matched.
100
+ */
101
+ stageOverrideAt: Date | null;
95
102
  value: number;
103
+ /**
104
+ * When a human last set this deal's value by hand. Non-null means value
105
+ * derivation no longer touches it. Mirrors {@link Deal.stageOverrideAt} — and
106
+ * needs the same visibility, since an honoured-but-invisible override reads
107
+ * as a stuck deal rather than a pinned one.
108
+ */
109
+ valueOverrideAt: Date | null;
96
110
  }
97
111
  interface Task {
98
112
  archivedAt: Date | null;
@@ -234,6 +248,28 @@ interface ContactFilters {
234
248
  source?: RecordSource;
235
249
  status?: ContactStatus;
236
250
  }
251
+ /**
252
+ * One page of a keyset-paginated read.
253
+ *
254
+ * Keyset, not offset: `LIMIT/OFFSET` re-scans every skipped row, so page 200
255
+ * costs 200 pages of work, and a row inserted mid-listing shifts everything
256
+ * after it — the reader sees a record twice or never. A cursor anchored to
257
+ * `(createdAt, id)` is stable under concurrent writes and costs the same at
258
+ * page 1 and page 200.
259
+ *
260
+ * `audit.list` already does this; these types generalise its shape so the CRM
261
+ * lists cannot drift into a second convention.
262
+ */
263
+ interface PageRequest {
264
+ /** Opaque `${createdAtISO}|${id}`. Rows strictly older than this. */
265
+ cursor?: string;
266
+ limit?: number;
267
+ }
268
+ interface Page<T> {
269
+ /** Null when this is the last page. */
270
+ nextCursor: string | null;
271
+ rows: T[];
272
+ }
237
273
  interface CompanyFilters {
238
274
  /** See {@link ContactFilters.excludeArchived}. */
239
275
  excludeArchived?: boolean;
@@ -249,4 +285,4 @@ interface TaskFilters {
249
285
  status?: TaskStatus;
250
286
  }
251
287
  //#endregion
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 };
288
+ export { UpdateCompanyInput as A, RecordSource as C, TaskFilters as D, TaskEntityType as E, isClosedStageType as F, UpdateDealInput as M, UpdateTaskInput as N, TaskPriority as O, ValueInterval as P, PipelineStageConfig as S, Task as T, OPEN_STAGE_TYPE as _, Contact as a, PipelineConfig as b, CreateActivityInput as c, CreateDealInput as d, CreateTaskInput as f, Note as g, DealStage as h, CompanyFilters as i, UpdateContactInput as j, TaskStatus 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, Page as v, StageType as w, PipelineKind as x, PageRequest as y };
@@ -92,7 +92,21 @@ interface Deal {
92
92
  owner: string | null;
93
93
  position: number | null;
94
94
  stage: DealStage;
95
+ /**
96
+ * When a human last moved this deal by hand. Non-null means stage derivation
97
+ * no longer touches it, so a board must be able to mark it as overridden and
98
+ * offer a way back — otherwise an overridden deal is indistinguishable from
99
+ * one the rules simply never matched.
100
+ */
101
+ stageOverrideAt: Date | null;
95
102
  value: number;
103
+ /**
104
+ * When a human last set this deal's value by hand. Non-null means value
105
+ * derivation no longer touches it. Mirrors {@link Deal.stageOverrideAt} — and
106
+ * needs the same visibility, since an honoured-but-invisible override reads
107
+ * as a stuck deal rather than a pinned one.
108
+ */
109
+ valueOverrideAt: Date | null;
96
110
  }
97
111
  interface Task {
98
112
  archivedAt: Date | null;
@@ -234,6 +248,28 @@ interface ContactFilters {
234
248
  source?: RecordSource;
235
249
  status?: ContactStatus;
236
250
  }
251
+ /**
252
+ * One page of a keyset-paginated read.
253
+ *
254
+ * Keyset, not offset: `LIMIT/OFFSET` re-scans every skipped row, so page 200
255
+ * costs 200 pages of work, and a row inserted mid-listing shifts everything
256
+ * after it — the reader sees a record twice or never. A cursor anchored to
257
+ * `(createdAt, id)` is stable under concurrent writes and costs the same at
258
+ * page 1 and page 200.
259
+ *
260
+ * `audit.list` already does this; these types generalise its shape so the CRM
261
+ * lists cannot drift into a second convention.
262
+ */
263
+ interface PageRequest {
264
+ /** Opaque `${createdAtISO}|${id}`. Rows strictly older than this. */
265
+ cursor?: string;
266
+ limit?: number;
267
+ }
268
+ interface Page<T> {
269
+ /** Null when this is the last page. */
270
+ nextCursor: string | null;
271
+ rows: T[];
272
+ }
237
273
  interface CompanyFilters {
238
274
  /** See {@link ContactFilters.excludeArchived}. */
239
275
  excludeArchived?: boolean;
@@ -249,4 +285,4 @@ interface TaskFilters {
249
285
  status?: TaskStatus;
250
286
  }
251
287
  //#endregion
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 };
288
+ export { UpdateCompanyInput as A, RecordSource as C, TaskFilters as D, TaskEntityType as E, isClosedStageType as F, UpdateDealInput as M, UpdateTaskInput as N, TaskPriority as O, ValueInterval as P, PipelineStageConfig as S, Task as T, OPEN_STAGE_TYPE as _, Contact as a, PipelineConfig as b, CreateActivityInput as c, CreateDealInput as d, CreateTaskInput as f, Note as g, DealStage as h, CompanyFilters as i, UpdateContactInput as j, TaskStatus 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, Page as v, StageType as w, PipelineKind as x, PageRequest as y };
package/vite.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { o as ClivlySDK } from "./namespace-probe-C5RLl74M.cjs";
1
+ import { o as ClivlySDK } from "./namespace-probe-H7yWc0JV.cjs";
2
2
  import { Plugin } from "vite";
3
3
  //#region ../sdk/src/vite.d.ts
4
4
  export interface ClivlyViteOptions {
package/vite.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { o as ClivlySDK } from "./namespace-probe-CNQKSmxz.mjs";
1
+ import { o as ClivlySDK } from "./namespace-probe-DykR0kgh.mjs";
2
2
  import { Plugin } from "vite";
3
3
  //#region ../sdk/src/vite.d.ts
4
4
  export interface ClivlyViteOptions {