clivly 0.13.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -6
- package/{adapter-DTMeGGsl.d.cts → adapter-BMAUq4hf.d.mts} +28 -1
- package/{adapter-DhPBRNpi.d.mts → adapter-IH3r_I8v.d.cts} +28 -1
- package/{auth-adapter-C6rDx3XH.d.mts → auth-adapter-Bt1GZiag.d.cts} +1 -1
- package/{auth-adapter-Csk9KkvI.d.cts → auth-adapter-CHy273qb.d.mts} +1 -1
- package/auth-better-auth.d.cts +1 -1
- package/auth-better-auth.d.mts +1 -1
- package/auth-clerk.d.cts +1 -1
- package/auth-clerk.d.mts +1 -1
- package/auth-workos.d.cts +1 -1
- package/auth-workos.d.mts +1 -1
- package/core-adapter.d.cts +1 -1
- package/core-adapter.d.mts +1 -1
- package/core-auth-adapter.d.cts +1 -1
- package/core-auth-adapter.d.mts +1 -1
- package/core-sync-engine.cjs +3 -1
- package/core-sync-engine.d.cts +2 -2
- package/core-sync-engine.d.mts +2 -2
- package/core-sync-engine.mjs +2 -2
- package/core-types.d.cts +1 -1
- package/core-types.d.mts +1 -1
- package/core.cjs +4 -2
- package/core.d.cts +6 -6
- package/core.d.mts +6 -6
- package/core.mjs +3 -3
- package/index.cjs +102 -1
- package/index.mjs +102 -1
- package/{internal-Cmx7Zevf.d.mts → internal-C7NlPM3M.d.mts} +3 -1
- package/{internal-u0Bks5Gr.mjs → internal-CLvZdVj5.mjs} +12 -0
- package/{internal-vH5Rlg6Q.d.cts → internal-D2J4VQWT.d.cts} +3 -1
- package/{internal-BxtvxF7Z.cjs → internal-DsArcqkP.cjs} +12 -0
- package/internal-adapter.d.cts +1 -1
- package/internal-adapter.d.mts +1 -1
- package/internal-auth-adapter.d.cts +1 -1
- package/internal-auth-adapter.d.mts +1 -1
- package/internal-sync-engine.cjs +3 -1
- package/internal-sync-engine.d.cts +2 -2
- package/internal-sync-engine.d.mts +2 -2
- package/internal-sync-engine.mjs +2 -2
- package/internal-types.d.cts +1 -1
- package/internal-types.d.mts +1 -1
- package/internal.cjs +4 -2
- package/internal.d.cts +6 -6
- package/internal.d.mts +6 -6
- package/internal.mjs +3 -3
- package/package.json +1 -1
- package/{sdk-B-dp1tZN.mjs → sdk-DLoVPlGB.mjs} +139 -5
- package/{sdk-DKfKhJD_.cjs → sdk-ZMy4C4VK.cjs} +156 -4
- package/sdk.cjs +4 -1
- package/sdk.d.cts +32 -0
- package/sdk.d.mts +32 -0
- package/sdk.mjs +2 -2
- package/{sync-engine-Dwm_KDUS.cjs → sync-engine-BGVDsrOQ.cjs} +131 -71
- package/{sync-engine-V3_UutGv.d.cts → sync-engine-CYsWOujz.d.cts} +63 -22
- package/{sync-engine--M9EaONC.d.mts → sync-engine-C_5TpvfX.d.mts} +63 -22
- package/{sync-engine-Df2MCs_n.mjs → sync-engine-DH058G3w.mjs} +120 -72
- package/{types-B17TWEOL.d.cts → types-CpAtAtxd.d.cts} +35 -0
- package/{types-B17TWEOL.d.mts → types-CpAtAtxd.d.mts} +35 -0
package/README.md
CHANGED
|
@@ -245,9 +245,9 @@ would never load.
|
|
|
245
245
|
|
|
246
246
|
The pairing endpoints are feature-flagged server-side
|
|
247
247
|
(`CLIVLY_CLI_PAIRING_ENABLED`). **Clivly Cloud has pairing enabled**, so
|
|
248
|
-
`clivly login` is the normal path there.
|
|
249
|
-
|
|
250
|
-
|
|
248
|
+
`clivly login` is the normal path there. Against a backend
|
|
249
|
+
with the flag off, `clivly login` says so and exits non-zero; use the manual
|
|
250
|
+
credential path below.
|
|
251
251
|
|
|
252
252
|
#### Manual credential path
|
|
253
253
|
|
|
@@ -290,7 +290,8 @@ It answers two questions under two headings:
|
|
|
290
290
|
scope; `clivly doctor` is local by definition and omits it.
|
|
291
291
|
- **This project** — the local ladder, run here on your machine: credential →
|
|
292
292
|
Clivly reachable → `clivly.config` loads → `clivly.config` is edge-safe →
|
|
293
|
-
boot hook wired → setup checks → dashboard-authored
|
|
293
|
+
sync cursor persists → boot hook wired → setup checks → dashboard-authored
|
|
294
|
+
objects → sync trigger URL.
|
|
294
295
|
|
|
295
296
|
```text
|
|
296
297
|
Clivly status
|
|
@@ -303,11 +304,17 @@ Workspace
|
|
|
303
304
|
🔒 Let Clivly start a sync
|
|
304
305
|
|
|
305
306
|
This project
|
|
306
|
-
✅ Step 1 of
|
|
307
|
-
✅ Step 2 of
|
|
307
|
+
✅ Step 1 of 9 · API key present
|
|
308
|
+
✅ Step 2 of 9 · Clivly reachable — Acme
|
|
308
309
|
...
|
|
309
310
|
```
|
|
310
311
|
|
|
312
|
+
**Sync cursor persists** warns when a config that targets an edge runtime sets
|
|
313
|
+
no `cursorStore`. Without one the in-memory default is discarded between
|
|
314
|
+
invocations, so every delta sync re-reads your entire source tables — a full
|
|
315
|
+
sync on every run, reported as a success. It is a warning, not a failure: a
|
|
316
|
+
long-lived Node host is correct with the in-memory default.
|
|
317
|
+
|
|
311
318
|
**Dashboard-authored objects** is new in `0.9.7`. It reports how many derived
|
|
312
319
|
objects authored in Clivly ran on the last sync and how many were quarantined —
|
|
313
320
|
and, when your config has no `introspector`, warns that such objects cannot run
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as UpdateCompanyInput, C as RecordSource, D as TaskFilters, M as UpdateDealInput, N as UpdateTaskInput, T as Task, a as Contact, c as CreateActivityInput, d as CreateDealInput, f as CreateTaskInput, i as CompanyFilters, j as UpdateContactInput, l as CreateCompanyInput, m as Deal, o as ContactFilters, r as Company, t as Activity, u as CreateContactInput, v as Page, y as PageRequest } from "./types-
|
|
1
|
+
import { A as UpdateCompanyInput, C as RecordSource, D as TaskFilters, M as UpdateDealInput, N as UpdateTaskInput, T as Task, a as Contact, c as CreateActivityInput, d as CreateDealInput, f as CreateTaskInput, i as CompanyFilters, j as UpdateContactInput, l as CreateCompanyInput, m as Deal, o as ContactFilters, r as Company, t as Activity, u as CreateContactInput, v as Page, y as PageRequest } from "./types-CpAtAtxd.mjs";
|
|
2
2
|
//#region ../core/src/adapter.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* The contract every ORM implementation fulfils. `packages/drizzle` is the first
|
|
@@ -19,6 +19,20 @@ interface CRMAdapter {
|
|
|
19
19
|
archiveContact(orgId: string, id: string): Promise<Contact>;
|
|
20
20
|
archiveTask(orgId: string, id: string): Promise<Task>;
|
|
21
21
|
completeTask(orgId: string, id: string): Promise<Task>;
|
|
22
|
+
/**
|
|
23
|
+
* How many contacts match `filters`, ignoring pagination entirely.
|
|
24
|
+
*
|
|
25
|
+
* Exists so a caller can state the size of a selection before acting on it —
|
|
26
|
+
* a bulk send has to say "this will go to N contacts", and the paged read
|
|
27
|
+
* cannot answer that: it knows only whether *another* page exists, never how
|
|
28
|
+
* many rows are behind it.
|
|
29
|
+
*
|
|
30
|
+
* Takes the same `ContactFilters` as {@link CRMAdapter.listContactsPage} and
|
|
31
|
+
* applies exactly the same predicates, so the count and the list can never
|
|
32
|
+
* disagree about what matches. It returns a number rather than rows, so it
|
|
33
|
+
* stays bounded however large the match is.
|
|
34
|
+
*/
|
|
35
|
+
countContacts(orgId: string, filters?: ContactFilters): Promise<number>;
|
|
22
36
|
createActivity(orgId: string, data: CreateActivityInput): Promise<Activity>;
|
|
23
37
|
createCompany(orgId: string, data: CreateCompanyInput): Promise<Company>;
|
|
24
38
|
createContact(orgId: string, data: CreateContactInput): Promise<Contact>;
|
|
@@ -76,6 +90,19 @@ interface CRMAdapter {
|
|
|
76
90
|
listDealsPage(orgId: string, filters?: {
|
|
77
91
|
source?: RecordSource;
|
|
78
92
|
}, page?: PageRequest): Promise<Page<Deal>>;
|
|
93
|
+
/**
|
|
94
|
+
* One page of tasks, newest-created first. See
|
|
95
|
+
* {@link CRMAdapter.listCompaniesPage}.
|
|
96
|
+
*
|
|
97
|
+
* `filters.entityType`/`entityId` match the task's own polymorphic-link
|
|
98
|
+
* columns. `filters.additionalIds`, when given, extends that match with an
|
|
99
|
+
* explicit id allowlist — `services/tasks.ts`'s `listTasks` uses it to fold
|
|
100
|
+
* in tasks linked only via `crm_record_links` (the multi-link table),
|
|
101
|
+
* without falling back to an unbounded read.
|
|
102
|
+
*/
|
|
103
|
+
listTasksPage(orgId: string, filters?: TaskFilters & {
|
|
104
|
+
additionalIds?: string[];
|
|
105
|
+
}, page?: PageRequest): Promise<Page<Task>>;
|
|
79
106
|
/**
|
|
80
107
|
* Move a deal to `stage` and reorder it directly after `afterId` (null = top
|
|
81
108
|
* of the column). The adapter computes the fractional `position` from the
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as UpdateCompanyInput, C as RecordSource, D as TaskFilters, M as UpdateDealInput, N as UpdateTaskInput, T as Task, a as Contact, c as CreateActivityInput, d as CreateDealInput, f as CreateTaskInput, i as CompanyFilters, j as UpdateContactInput, l as CreateCompanyInput, m as Deal, o as ContactFilters, r as Company, t as Activity, u as CreateContactInput, v as Page, y as PageRequest } from "./types-
|
|
1
|
+
import { A as UpdateCompanyInput, C as RecordSource, D as TaskFilters, M as UpdateDealInput, N as UpdateTaskInput, T as Task, a as Contact, c as CreateActivityInput, d as CreateDealInput, f as CreateTaskInput, i as CompanyFilters, j as UpdateContactInput, l as CreateCompanyInput, m as Deal, o as ContactFilters, r as Company, t as Activity, u as CreateContactInput, v as Page, y as PageRequest } from "./types-CpAtAtxd.cjs";
|
|
2
2
|
//#region ../core/src/adapter.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* The contract every ORM implementation fulfils. `packages/drizzle` is the first
|
|
@@ -19,6 +19,20 @@ interface CRMAdapter {
|
|
|
19
19
|
archiveContact(orgId: string, id: string): Promise<Contact>;
|
|
20
20
|
archiveTask(orgId: string, id: string): Promise<Task>;
|
|
21
21
|
completeTask(orgId: string, id: string): Promise<Task>;
|
|
22
|
+
/**
|
|
23
|
+
* How many contacts match `filters`, ignoring pagination entirely.
|
|
24
|
+
*
|
|
25
|
+
* Exists so a caller can state the size of a selection before acting on it —
|
|
26
|
+
* a bulk send has to say "this will go to N contacts", and the paged read
|
|
27
|
+
* cannot answer that: it knows only whether *another* page exists, never how
|
|
28
|
+
* many rows are behind it.
|
|
29
|
+
*
|
|
30
|
+
* Takes the same `ContactFilters` as {@link CRMAdapter.listContactsPage} and
|
|
31
|
+
* applies exactly the same predicates, so the count and the list can never
|
|
32
|
+
* disagree about what matches. It returns a number rather than rows, so it
|
|
33
|
+
* stays bounded however large the match is.
|
|
34
|
+
*/
|
|
35
|
+
countContacts(orgId: string, filters?: ContactFilters): Promise<number>;
|
|
22
36
|
createActivity(orgId: string, data: CreateActivityInput): Promise<Activity>;
|
|
23
37
|
createCompany(orgId: string, data: CreateCompanyInput): Promise<Company>;
|
|
24
38
|
createContact(orgId: string, data: CreateContactInput): Promise<Contact>;
|
|
@@ -76,6 +90,19 @@ interface CRMAdapter {
|
|
|
76
90
|
listDealsPage(orgId: string, filters?: {
|
|
77
91
|
source?: RecordSource;
|
|
78
92
|
}, page?: PageRequest): Promise<Page<Deal>>;
|
|
93
|
+
/**
|
|
94
|
+
* One page of tasks, newest-created first. See
|
|
95
|
+
* {@link CRMAdapter.listCompaniesPage}.
|
|
96
|
+
*
|
|
97
|
+
* `filters.entityType`/`entityId` match the task's own polymorphic-link
|
|
98
|
+
* columns. `filters.additionalIds`, when given, extends that match with an
|
|
99
|
+
* explicit id allowlist — `services/tasks.ts`'s `listTasks` uses it to fold
|
|
100
|
+
* in tasks linked only via `crm_record_links` (the multi-link table),
|
|
101
|
+
* without falling back to an unbounded read.
|
|
102
|
+
*/
|
|
103
|
+
listTasksPage(orgId: string, filters?: TaskFilters & {
|
|
104
|
+
additionalIds?: string[];
|
|
105
|
+
}, page?: PageRequest): Promise<Page<Task>>;
|
|
79
106
|
/**
|
|
80
107
|
* Move a deal to `stage` and reorder it directly after `afterId` (null = top
|
|
81
108
|
* of the column). The adapter computes the fractional `position` from the
|
package/auth-better-auth.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as ClivlyUser, t as ClivlyAuthAdapter } from "./auth-adapter-
|
|
1
|
+
import { n as ClivlyUser, t as ClivlyAuthAdapter } from "./auth-adapter-Bt1GZiag.cjs";
|
|
2
2
|
//#region ../auth-better-auth/src/map.d.ts
|
|
3
3
|
interface BetterAuthLikeUser {
|
|
4
4
|
email?: string | null;
|
package/auth-better-auth.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as ClivlyUser, t as ClivlyAuthAdapter } from "./auth-adapter-
|
|
1
|
+
import { n as ClivlyUser, t as ClivlyAuthAdapter } from "./auth-adapter-CHy273qb.mjs";
|
|
2
2
|
//#region ../auth-better-auth/src/map.d.ts
|
|
3
3
|
interface BetterAuthLikeUser {
|
|
4
4
|
email?: string | null;
|
package/auth-clerk.d.cts
CHANGED
package/auth-clerk.d.mts
CHANGED
package/auth-workos.d.cts
CHANGED
package/auth-workos.d.mts
CHANGED
package/core-adapter.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as CRMAdapter } from "./adapter-
|
|
1
|
+
import { t as CRMAdapter } from "./adapter-IH3r_I8v.cjs";
|
|
2
2
|
export { CRMAdapter };
|
package/core-adapter.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as CRMAdapter } from "./adapter-
|
|
1
|
+
import { t as CRMAdapter } from "./adapter-BMAUq4hf.mjs";
|
|
2
2
|
export { CRMAdapter };
|
package/core-auth-adapter.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-
|
|
1
|
+
import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-Bt1GZiag.cjs";
|
|
2
2
|
export { ClivlyAuthAdapter, ClivlyUser, CrmMembership, MembershipResolver, authCustom };
|
package/core-auth-adapter.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-
|
|
1
|
+
import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-CHy273qb.mjs";
|
|
2
2
|
export { ClivlyAuthAdapter, ClivlyUser, CrmMembership, MembershipResolver, authCustom };
|
package/core-sync-engine.cjs
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_sync_engine = require("./sync-engine-
|
|
2
|
+
const require_sync_engine = require("./sync-engine-BGVDsrOQ.cjs");
|
|
3
3
|
const require_deprecate_subpath = require("./deprecate-subpath-B9ngvizt.cjs");
|
|
4
4
|
require("./internal-sync-engine.cjs");
|
|
5
5
|
//#region src/core-sync-engine.ts
|
|
6
6
|
require_deprecate_subpath.warnDeprecatedSubpath("clivly/core/sync-engine", "clivly/internal/sync-engine");
|
|
7
7
|
//#endregion
|
|
8
8
|
exports.computeSampleWarnings = require_sync_engine.computeSampleWarnings;
|
|
9
|
+
exports.isRemovalAction = require_sync_engine.isRemovalAction;
|
|
9
10
|
exports.previewSync = require_sync_engine.previewSync;
|
|
10
11
|
exports.reconcile = require_sync_engine.reconcile;
|
|
12
|
+
exports.resolveActions = require_sync_engine.resolveActions;
|
|
11
13
|
exports.runSync = require_sync_engine.runSync;
|
package/core-sync-engine.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as PreviewWarning, c as
|
|
2
|
-
export { EntitySyncResult, MirrorRecord, PersistAction, PreviewResult, PreviewWarning, SourceRow, SyncAction, SyncResult, SyncStore, computeSampleWarnings, previewSync, reconcile, runSync };
|
|
1
|
+
import { a as PreviewWarning, c as SyncAction, d as computeSampleWarnings, f as isRemovalAction, g as runSync, h as resolveActions, i as PreviewResult, l as SyncResult, m as reconcile, n as MirrorRecord, o as ResolvedMembership, p as previewSync, r as PersistAction, s as SourceRow, t as EntitySyncResult, u as SyncStore } from "./sync-engine-CYsWOujz.cjs";
|
|
2
|
+
export { EntitySyncResult, MirrorRecord, PersistAction, PreviewResult, PreviewWarning, ResolvedMembership, SourceRow, SyncAction, SyncResult, SyncStore, computeSampleWarnings, isRemovalAction, previewSync, reconcile, resolveActions, runSync };
|
package/core-sync-engine.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as PreviewWarning, c as
|
|
2
|
-
export { EntitySyncResult, MirrorRecord, PersistAction, PreviewResult, PreviewWarning, SourceRow, SyncAction, SyncResult, SyncStore, computeSampleWarnings, previewSync, reconcile, runSync };
|
|
1
|
+
import { a as PreviewWarning, c as SyncAction, d as computeSampleWarnings, f as isRemovalAction, g as runSync, h as resolveActions, i as PreviewResult, l as SyncResult, m as reconcile, n as MirrorRecord, o as ResolvedMembership, p as previewSync, r as PersistAction, s as SourceRow, t as EntitySyncResult, u as SyncStore } from "./sync-engine-C_5TpvfX.mjs";
|
|
2
|
+
export { EntitySyncResult, MirrorRecord, PersistAction, PreviewResult, PreviewWarning, ResolvedMembership, SourceRow, SyncAction, SyncResult, SyncStore, computeSampleWarnings, isRemovalAction, previewSync, reconcile, resolveActions, runSync };
|
package/core-sync-engine.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { i as
|
|
1
|
+
import { a as resolveActions, i as reconcile, n as isRemovalAction, o as runSync, r as previewSync, t as computeSampleWarnings } from "./sync-engine-DH058G3w.mjs";
|
|
2
2
|
import { t as warnDeprecatedSubpath } from "./deprecate-subpath-CmvZtCpE.mjs";
|
|
3
3
|
import "./internal-sync-engine.mjs";
|
|
4
4
|
//#region src/core-sync-engine.ts
|
|
5
5
|
warnDeprecatedSubpath("clivly/core/sync-engine", "clivly/internal/sync-engine");
|
|
6
6
|
//#endregion
|
|
7
|
-
export { computeSampleWarnings, previewSync, reconcile, runSync };
|
|
7
|
+
export { computeSampleWarnings, isRemovalAction, previewSync, reconcile, resolveActions, runSync };
|
package/core-types.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as UpdateCompanyInput, C as RecordSource, D as TaskFilters, E as TaskEntityType, F as isClosedStageType, M as UpdateDealInput, N as UpdateTaskInput, O as TaskPriority, P as ValueInterval, S as PipelineStageConfig, T as Task, _ as OPEN_STAGE_TYPE, a as Contact, b as PipelineConfig, c as CreateActivityInput, d as CreateDealInput, f as CreateTaskInput, g as Note, h as DealStage, i as CompanyFilters, j as UpdateContactInput, k as TaskStatus, l as CreateCompanyInput, m as Deal, n as ActivityType, o as ContactFilters, p as CrmRole, r as Company, s as ContactStatus, t as Activity, u as CreateContactInput, v as Page, w as StageType, x as PipelineKind, y as PageRequest } from "./types-
|
|
1
|
+
import { A as UpdateCompanyInput, C as RecordSource, D as TaskFilters, E as TaskEntityType, F as isClosedStageType, M as UpdateDealInput, N as UpdateTaskInput, O as TaskPriority, P as ValueInterval, S as PipelineStageConfig, T as Task, _ as OPEN_STAGE_TYPE, a as Contact, b as PipelineConfig, c as CreateActivityInput, d as CreateDealInput, f as CreateTaskInput, g as Note, h as DealStage, i as CompanyFilters, j as UpdateContactInput, k as TaskStatus, l as CreateCompanyInput, m as Deal, n as ActivityType, o as ContactFilters, p as CrmRole, r as Company, s as ContactStatus, t as Activity, u as CreateContactInput, v as Page, w as StageType, x as PipelineKind, y as PageRequest } from "./types-CpAtAtxd.cjs";
|
|
2
2
|
export { Activity, ActivityType, Company, CompanyFilters, Contact, ContactFilters, 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 };
|
package/core-types.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as UpdateCompanyInput, C as RecordSource, D as TaskFilters, E as TaskEntityType, F as isClosedStageType, M as UpdateDealInput, N as UpdateTaskInput, O as TaskPriority, P as ValueInterval, S as PipelineStageConfig, T as Task, _ as OPEN_STAGE_TYPE, a as Contact, b as PipelineConfig, c as CreateActivityInput, d as CreateDealInput, f as CreateTaskInput, g as Note, h as DealStage, i as CompanyFilters, j as UpdateContactInput, k as TaskStatus, l as CreateCompanyInput, m as Deal, n as ActivityType, o as ContactFilters, p as CrmRole, r as Company, s as ContactStatus, t as Activity, u as CreateContactInput, v as Page, w as StageType, x as PipelineKind, y as PageRequest } from "./types-
|
|
1
|
+
import { A as UpdateCompanyInput, C as RecordSource, D as TaskFilters, E as TaskEntityType, F as isClosedStageType, M as UpdateDealInput, N as UpdateTaskInput, O as TaskPriority, P as ValueInterval, S as PipelineStageConfig, T as Task, _ as OPEN_STAGE_TYPE, a as Contact, b as PipelineConfig, c as CreateActivityInput, d as CreateDealInput, f as CreateTaskInput, g as Note, h as DealStage, i as CompanyFilters, j as UpdateContactInput, k as TaskStatus, l as CreateCompanyInput, m as Deal, n as ActivityType, o as ContactFilters, p as CrmRole, r as Company, s as ContactStatus, t as Activity, u as CreateContactInput, v as Page, w as StageType, x as PipelineKind, y as PageRequest } from "./types-CpAtAtxd.mjs";
|
|
2
2
|
export { Activity, ActivityType, Company, CompanyFilters, Contact, ContactFilters, 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 };
|
package/core.cjs
CHANGED
|
@@ -3,11 +3,11 @@ const require_projection = require("./projection-BELgANG2.cjs");
|
|
|
3
3
|
const require_entity_config = require("./entity-config-BI4RYNKL.cjs");
|
|
4
4
|
const require_mappings_config = require("./mappings-config-BCsRLohT.cjs");
|
|
5
5
|
const require_auth_adapter = require("./auth-adapter-CiEXcweZ.cjs");
|
|
6
|
-
const require_internal = require("./internal-
|
|
6
|
+
const require_internal = require("./internal-DsArcqkP.cjs");
|
|
7
7
|
const require_mapping_form = require("./mapping-form-BpfON_ME.cjs");
|
|
8
8
|
const require_projection_sql = require("./projection-sql-DuCtFE9t.cjs");
|
|
9
9
|
const require_view_compiler = require("./view-compiler-xiwm5iar.cjs");
|
|
10
|
-
const require_sync_engine = require("./sync-engine-
|
|
10
|
+
const require_sync_engine = require("./sync-engine-BGVDsrOQ.cjs");
|
|
11
11
|
const require_types = require("./types-Cq5gHCTq.cjs");
|
|
12
12
|
//#region src/core.ts
|
|
13
13
|
require("./deprecate-subpath-B9ngvizt.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).");
|
|
@@ -46,6 +46,7 @@ exports.hostOwnedFieldMessage = require_internal.hostOwnedFieldMessage;
|
|
|
46
46
|
exports.identityRefs = require_projection.identityRefs;
|
|
47
47
|
exports.isClosedStageType = require_types.isClosedStageType;
|
|
48
48
|
exports.isHostOwned = require_internal.isHostOwned;
|
|
49
|
+
exports.isRemovalAction = require_sync_engine.isRemovalAction;
|
|
49
50
|
exports.joinFansOut = require_entity_config.joinFansOut;
|
|
50
51
|
exports.mappingsToEntitiesConfig = require_mappings_config.mappingsToEntitiesConfig;
|
|
51
52
|
exports.matchesCondition = require_internal.matchesCondition;
|
|
@@ -61,6 +62,7 @@ exports.relationshipSchema = require_entity_config.relationshipSchema;
|
|
|
61
62
|
exports.relationshipViaSignature = require_mapping_form.relationshipViaSignature;
|
|
62
63
|
exports.relationshipsSchema = require_entity_config.relationshipsSchema;
|
|
63
64
|
exports.requiredFieldsFor = require_entity_config.requiredFieldsFor;
|
|
65
|
+
exports.resolveActions = require_sync_engine.resolveActions;
|
|
64
66
|
exports.runSync = require_sync_engine.runSync;
|
|
65
67
|
exports.slugify = require_internal.slugify;
|
|
66
68
|
exports.toObjectTypeSlug = require_internal.toObjectTypeSlug;
|
package/core.d.cts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
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-ApnT5j3X.cjs";
|
|
2
|
-
import { A as UpdateCompanyInput, C as RecordSource, D as TaskFilters, E as TaskEntityType, F as isClosedStageType, M as UpdateDealInput, N as UpdateTaskInput, O as TaskPriority, P as ValueInterval, S as PipelineStageConfig, T as Task, _ as OPEN_STAGE_TYPE, a as Contact, b as PipelineConfig, c as CreateActivityInput, d as CreateDealInput, f as CreateTaskInput, g as Note, h as DealStage, i as CompanyFilters, j as UpdateContactInput, k as TaskStatus, l as CreateCompanyInput, m as Deal, n as ActivityType, o as ContactFilters, p as CrmRole, r as Company, s as ContactStatus, t as Activity, u as CreateContactInput, v as Page, w as StageType, x as PipelineKind, y as PageRequest } from "./types-
|
|
3
|
-
import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-
|
|
4
|
-
import { t as CRMAdapter } from "./adapter-
|
|
2
|
+
import { A as UpdateCompanyInput, C as RecordSource, D as TaskFilters, E as TaskEntityType, F as isClosedStageType, M as UpdateDealInput, N as UpdateTaskInput, O as TaskPriority, P as ValueInterval, S as PipelineStageConfig, T as Task, _ as OPEN_STAGE_TYPE, a as Contact, b as PipelineConfig, c as CreateActivityInput, d as CreateDealInput, f as CreateTaskInput, g as Note, h as DealStage, i as CompanyFilters, j as UpdateContactInput, k as TaskStatus, l as CreateCompanyInput, m as Deal, n as ActivityType, o as ContactFilters, p as CrmRole, r as Company, s as ContactStatus, t as Activity, u as CreateContactInput, v as Page, w as StageType, x as PipelineKind, y as PageRequest } from "./types-CpAtAtxd.cjs";
|
|
3
|
+
import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-Bt1GZiag.cjs";
|
|
4
|
+
import { t as CRMAdapter } from "./adapter-IH3r_I8v.cjs";
|
|
5
5
|
import { i as relationshipViaSignature, n as buildFilterFromDiscriminator, r as buildRelationships, t as RelationshipCandidate } from "./mapping-form-XsLLCqW_.cjs";
|
|
6
6
|
import { i as mappingsToEntitiesConfig, t as EntityMappingRow } from "./mappings-config-iJzbcUMp.cjs";
|
|
7
7
|
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-Cq8apvZ4.cjs";
|
|
8
|
-
import { c as
|
|
9
|
-
import { A as PerSeatValueSource, C as HostOwnedCompanyField, D as isHostOwned, E as hostOwnedFieldMessage, O as rejectedCompanyFields, S as joinFansOut, T as SourcedRecord, _ 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 computeDealValue, k as rejectedContactFields, 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 HostOwnedContactField, x as fanOutJoins, y as compileProjectionSelect } from "./internal-
|
|
8
|
+
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-CYsWOujz.cjs";
|
|
9
|
+
import { A as PerSeatValueSource, C as HostOwnedCompanyField, D as isHostOwned, E as hostOwnedFieldMessage, O as rejectedCompanyFields, S as joinFansOut, T as SourcedRecord, _ 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 computeDealValue, k as rejectedContactFields, 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 HostOwnedContactField, x as fanOutJoins, y as compileProjectionSelect } from "./internal-D2J4VQWT.cjs";
|
|
10
10
|
import { a as IntegrationStep, c as StepProblem, i as IntegrationStatus, l as StepState, n as IntegrationFacts, o as NextAction, r as IntegrationState, s as StepId, t as ConnectionLiveness } from "./integration-state-BA4c0RbD.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 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 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 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 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, coversUniqueKey, defineClivlyConfig, entitiesConfigSchema, evaluateStage, explainEntitiesConfig, fanOutJoins, filterSchema, hasRichMeta, hostOwnedFieldMessage, identityRefs, isClosedStageType, isHostOwned, joinFansOut, mappingsToEntitiesConfig, matchesCondition, missingRequiredFields, primaryKeyColumns, projectionFields, projectionSchema, quoteIdent, reconcile, rejectedCompanyFields, rejectedContactFields, relationshipSchema, relationshipViaSignature, relationshipsSchema, requiredFieldsFor, runSync, slugify, toObjectTypeSlug, validateEntitiesConfig, validateProjection, validateProjectionFilter };
|
|
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 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 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 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, 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 };
|
package/core.d.mts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
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-CKcj4-M_.mjs";
|
|
2
|
-
import { A as UpdateCompanyInput, C as RecordSource, D as TaskFilters, E as TaskEntityType, F as isClosedStageType, M as UpdateDealInput, N as UpdateTaskInput, O as TaskPriority, P as ValueInterval, S as PipelineStageConfig, T as Task, _ as OPEN_STAGE_TYPE, a as Contact, b as PipelineConfig, c as CreateActivityInput, d as CreateDealInput, f as CreateTaskInput, g as Note, h as DealStage, i as CompanyFilters, j as UpdateContactInput, k as TaskStatus, l as CreateCompanyInput, m as Deal, n as ActivityType, o as ContactFilters, p as CrmRole, r as Company, s as ContactStatus, t as Activity, u as CreateContactInput, v as Page, w as StageType, x as PipelineKind, y as PageRequest } from "./types-
|
|
3
|
-
import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-
|
|
4
|
-
import { t as CRMAdapter } from "./adapter-
|
|
2
|
+
import { A as UpdateCompanyInput, C as RecordSource, D as TaskFilters, E as TaskEntityType, F as isClosedStageType, M as UpdateDealInput, N as UpdateTaskInput, O as TaskPriority, P as ValueInterval, S as PipelineStageConfig, T as Task, _ as OPEN_STAGE_TYPE, a as Contact, b as PipelineConfig, c as CreateActivityInput, d as CreateDealInput, f as CreateTaskInput, g as Note, h as DealStage, i as CompanyFilters, j as UpdateContactInput, k as TaskStatus, l as CreateCompanyInput, m as Deal, n as ActivityType, o as ContactFilters, p as CrmRole, r as Company, s as ContactStatus, t as Activity, u as CreateContactInput, v as Page, w as StageType, x as PipelineKind, y as PageRequest } from "./types-CpAtAtxd.mjs";
|
|
3
|
+
import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-CHy273qb.mjs";
|
|
4
|
+
import { t as CRMAdapter } from "./adapter-BMAUq4hf.mjs";
|
|
5
5
|
import { i as relationshipViaSignature, n as buildFilterFromDiscriminator, r as buildRelationships, t as RelationshipCandidate } from "./mapping-form-Btn-7gzv.mjs";
|
|
6
6
|
import { i as mappingsToEntitiesConfig, t as EntityMappingRow } from "./mappings-config-D6_oCi2Q.mjs";
|
|
7
7
|
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-CwKVoK1w.mjs";
|
|
8
|
-
import { c as
|
|
9
|
-
import { A as PerSeatValueSource, C as HostOwnedCompanyField, D as isHostOwned, E as hostOwnedFieldMessage, O as rejectedCompanyFields, S as joinFansOut, T as SourcedRecord, _ 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 computeDealValue, k as rejectedContactFields, 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 HostOwnedContactField, x as fanOutJoins, y as compileProjectionSelect } from "./internal-
|
|
8
|
+
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-C_5TpvfX.mjs";
|
|
9
|
+
import { A as PerSeatValueSource, C as HostOwnedCompanyField, D as isHostOwned, E as hostOwnedFieldMessage, O as rejectedCompanyFields, S as joinFansOut, T as SourcedRecord, _ 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 computeDealValue, k as rejectedContactFields, 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 HostOwnedContactField, x as fanOutJoins, y as compileProjectionSelect } from "./internal-C7NlPM3M.mjs";
|
|
10
10
|
import { a as IntegrationStep, c as StepProblem, i as IntegrationStatus, l as StepState, n as IntegrationFacts, o as NextAction, r as IntegrationState, s as StepId, t as ConnectionLiveness } from "./integration-state-BA4c0RbD.mjs";
|
|
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 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 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 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 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, coversUniqueKey, defineClivlyConfig, entitiesConfigSchema, evaluateStage, explainEntitiesConfig, fanOutJoins, filterSchema, hasRichMeta, hostOwnedFieldMessage, identityRefs, isClosedStageType, isHostOwned, joinFansOut, mappingsToEntitiesConfig, matchesCondition, missingRequiredFields, primaryKeyColumns, projectionFields, projectionSchema, quoteIdent, reconcile, rejectedCompanyFields, rejectedContactFields, relationshipSchema, relationshipViaSignature, relationshipsSchema, requiredFieldsFor, runSync, slugify, toObjectTypeSlug, validateEntitiesConfig, validateProjection, validateProjectionFilter };
|
|
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 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 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 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, 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 };
|
package/core.mjs
CHANGED
|
@@ -2,14 +2,14 @@ import { i as projectionSchema, n as PROJECTION_KEY_PATTERN, r as identityRefs,
|
|
|
2
2
|
import { C as hasRichMeta, S as coversUniqueKey, _ as validateProjection, a as MATERIALIZING_CONCEPTS, b as joinFansOut, c as defineClivlyConfig, d as missingRequiredFields, f as projectionFields, g as validateEntitiesConfig, h as requiredFieldsFor, i as ClivlyConfigError, l as entitiesConfigSchema, m as relationshipsSchema, n as CRM_CONCEPTS, o as REQUIRED_FIELDS, p as relationshipSchema, t as CANONICAL_FIELDS, u as filterSchema, v as validateProjectionFilter, w as primaryKeyColumns, x as columnMetaFor, y as fanOutJoins } from "./entity-config-Ccfb2IL9.mjs";
|
|
3
3
|
import { n as mappingsToEntitiesConfig } from "./mappings-config-CwQNQ6bA.mjs";
|
|
4
4
|
import { t as authCustom } from "./auth-adapter-gfVDxf3d.mjs";
|
|
5
|
-
import { a as hostOwnedFieldMessage, c as rejectedContactFields, i as toObjectTypeSlug, l as computeDealValue, n as matchesCondition, o as isHostOwned, r as slugify, s as rejectedCompanyFields, t as evaluateStage } from "./internal-
|
|
5
|
+
import { a as hostOwnedFieldMessage, c as rejectedContactFields, i as toObjectTypeSlug, l as computeDealValue, n as matchesCondition, o as isHostOwned, r as slugify, s as rejectedCompanyFields, t as evaluateStage } from "./internal-CLvZdVj5.mjs";
|
|
6
6
|
import { n as buildRelationships, r as relationshipViaSignature, t as buildFilterFromDiscriminator } from "./mapping-form-DigkuvFc.mjs";
|
|
7
7
|
import { a as compileProjectionPreview, i as compileProjectionJoins, n as compileProjectionFrom, o as compileProjectionSelect, r as compileProjectionIdentity, s as quoteIdent, t as PREVIEW_MAX_ROWS } from "./projection-sql-DweUaWRc.mjs";
|
|
8
8
|
import { i as explainEntitiesConfig, n as compileEntityView, r as compileEntityViews, t as DEFAULT_VIEW_PREFIX } from "./view-compiler-C-6RydKK.mjs";
|
|
9
|
-
import {
|
|
9
|
+
import { a as resolveActions, i as reconcile, n as isRemovalAction, o as runSync } from "./sync-engine-DH058G3w.mjs";
|
|
10
10
|
import { n as isClosedStageType, t as OPEN_STAGE_TYPE } from "./types-YJTkXKzU.mjs";
|
|
11
11
|
import { t as warnDeprecatedSubpath } from "./deprecate-subpath-CmvZtCpE.mjs";
|
|
12
12
|
//#region src/core.ts
|
|
13
13
|
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
|
//#endregion
|
|
15
|
-
export { BASE_REF, CANONICAL_FIELDS, CRM_CONCEPTS, ClivlyConfigError, DEFAULT_VIEW_PREFIX, MATERIALIZING_CONCEPTS, OPEN_STAGE_TYPE, PREVIEW_MAX_ROWS, PROJECTION_KEY_PATTERN, REQUIRED_FIELDS, authCustom, buildFilterFromDiscriminator, buildRelationships, columnMetaFor, compileEntityView, compileEntityViews, compileProjectionFrom, compileProjectionIdentity, compileProjectionJoins, compileProjectionPreview, compileProjectionSelect, computeDealValue, coversUniqueKey, defineClivlyConfig, entitiesConfigSchema, evaluateStage, explainEntitiesConfig, fanOutJoins, filterSchema, hasRichMeta, hostOwnedFieldMessage, identityRefs, isClosedStageType, isHostOwned, joinFansOut, mappingsToEntitiesConfig, matchesCondition, missingRequiredFields, primaryKeyColumns, projectionFields, projectionSchema, quoteIdent, reconcile, rejectedCompanyFields, rejectedContactFields, relationshipSchema, relationshipViaSignature, relationshipsSchema, requiredFieldsFor, runSync, slugify, toObjectTypeSlug, validateEntitiesConfig, validateProjection, validateProjectionFilter };
|
|
15
|
+
export { BASE_REF, CANONICAL_FIELDS, CRM_CONCEPTS, ClivlyConfigError, DEFAULT_VIEW_PREFIX, MATERIALIZING_CONCEPTS, OPEN_STAGE_TYPE, PREVIEW_MAX_ROWS, PROJECTION_KEY_PATTERN, REQUIRED_FIELDS, authCustom, buildFilterFromDiscriminator, buildRelationships, columnMetaFor, compileEntityView, compileEntityViews, compileProjectionFrom, compileProjectionIdentity, compileProjectionJoins, compileProjectionPreview, compileProjectionSelect, computeDealValue, 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 };
|
package/index.cjs
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const require_entity_config = require("./entity-config-BI4RYNKL.cjs");
|
|
4
4
|
require("./mapping-score-CaB3F4Uu.cjs");
|
|
5
5
|
const require_internal_entity_heuristics = require("./internal-entity-heuristics.cjs");
|
|
6
|
-
const require_sdk = require("./sdk-
|
|
6
|
+
const require_sdk = require("./sdk-ZMy4C4VK.cjs");
|
|
7
7
|
let node_child_process = require("node:child_process");
|
|
8
8
|
let node_fs = require("node:fs");
|
|
9
9
|
let node_module = require("node:module");
|
|
@@ -3357,6 +3357,87 @@ function checkBootHook(readFile) {
|
|
|
3357
3357
|
};
|
|
3358
3358
|
}
|
|
3359
3359
|
//#endregion
|
|
3360
|
+
//#region src/cursor-store-check.ts
|
|
3361
|
+
/**
|
|
3362
|
+
* Whether a config that will run on a serverless runtime persists its sync
|
|
3363
|
+
* cursor.
|
|
3364
|
+
*
|
|
3365
|
+
* Without a persisted cursor, every `delta` sync starts from `null` and
|
|
3366
|
+
* re-reads the whole source table — because the SDK's default store lives in
|
|
3367
|
+
* memory, and a request-scoped runtime discards memory between invocations.
|
|
3368
|
+
* Nothing about this is visible from the outside: the run reports success, the
|
|
3369
|
+
* row counts look plausible, and the only symptom is the database bill. One
|
|
3370
|
+
* deployment on Workers burned a 5 GB monthly network allowance before launch
|
|
3371
|
+
* with two users, and `clivly status` was green the whole time.
|
|
3372
|
+
*
|
|
3373
|
+
* Read from source text rather than by loading the config: an edge config
|
|
3374
|
+
* frequently cannot be imported in Node at all, and that is exactly the case
|
|
3375
|
+
* that most needs an answer here.
|
|
3376
|
+
*/
|
|
3377
|
+
/** `cursorStore:` or `cursorStore,` as a real property, not in a comment. */
|
|
3378
|
+
const CURSOR_STORE_PROPERTY = /(^|[{,\s])cursorStore\s*[:,}]/;
|
|
3379
|
+
/** Marker files that pin a project to a specific serverless platform. */
|
|
3380
|
+
const PLATFORM_MARKERS = [
|
|
3381
|
+
{
|
|
3382
|
+
file: "wrangler.jsonc",
|
|
3383
|
+
label: "Cloudflare Workers"
|
|
3384
|
+
},
|
|
3385
|
+
{
|
|
3386
|
+
file: "wrangler.json",
|
|
3387
|
+
label: "Cloudflare Workers"
|
|
3388
|
+
},
|
|
3389
|
+
{
|
|
3390
|
+
file: "wrangler.toml",
|
|
3391
|
+
label: "Cloudflare Workers"
|
|
3392
|
+
},
|
|
3393
|
+
{
|
|
3394
|
+
file: "vercel.json",
|
|
3395
|
+
label: "Vercel"
|
|
3396
|
+
},
|
|
3397
|
+
{
|
|
3398
|
+
file: "netlify.toml",
|
|
3399
|
+
label: "Netlify"
|
|
3400
|
+
}
|
|
3401
|
+
];
|
|
3402
|
+
/** Next.js and friends: `export const runtime = "edge"`. */
|
|
3403
|
+
const INLINE_EDGE_RUNTIME = /export\s+const\s+runtime\s*=\s*["']edge["']/;
|
|
3404
|
+
/**
|
|
3405
|
+
* Strip comments and string literals before looking for the property.
|
|
3406
|
+
*
|
|
3407
|
+
* The scaffolded config ships `cursorStore` commented out as an example, and a
|
|
3408
|
+
* scan that counted that as configured would hand back a green rung for the
|
|
3409
|
+
* precise setup it exists to catch.
|
|
3410
|
+
*/
|
|
3411
|
+
function stripCommentsAndStrings(source) {
|
|
3412
|
+
return source.replace(/\/\*[\s\S]*?\*\//g, " ").replace(/(^|[^:])\/\/[^\n]*/g, "$1 ").replace(/"(?:[^"\\]|\\.)*"/g, "\"\"").replace(/'(?:[^'\\]|\\.)*'/g, "''").replace(/`(?:[^`\\]|\\.)*`/g, "``");
|
|
3413
|
+
}
|
|
3414
|
+
function detectEdgeRuntime(source, readFile) {
|
|
3415
|
+
for (const { file, label } of PLATFORM_MARKERS) if (readFile(file) !== null) return label;
|
|
3416
|
+
return INLINE_EDGE_RUNTIME.test(source) ? "edge runtime" : null;
|
|
3417
|
+
}
|
|
3418
|
+
/**
|
|
3419
|
+
* `readFile` resolves paths against the project root and is used only to spot
|
|
3420
|
+
* platform marker files. A project with none is treated as a long-lived host —
|
|
3421
|
+
* the safe default, since warning a Node host would be noise, and noise is
|
|
3422
|
+
* what teaches people to ignore warnings.
|
|
3423
|
+
*/
|
|
3424
|
+
function detectCursorStore(source, readFile = () => null) {
|
|
3425
|
+
const configured = CURSOR_STORE_PROPERTY.test(stripCommentsAndStrings(source));
|
|
3426
|
+
const edgeRuntime = detectEdgeRuntime(source, readFile);
|
|
3427
|
+
return {
|
|
3428
|
+
configured,
|
|
3429
|
+
edgeRuntime,
|
|
3430
|
+
shouldWarn: edgeRuntime !== null && !configured
|
|
3431
|
+
};
|
|
3432
|
+
}
|
|
3433
|
+
/** The remediation shown under the warning. */
|
|
3434
|
+
const CURSOR_STORE_HINT = "Pass `cursorStore: kvCursorStore(env.MY_KV)` (exported from `@clivly/sdk`) so delta syncs resume instead of re-reading every table. See https://clivly.com/docs/concepts/sync#cursor-stores";
|
|
3435
|
+
function cursorStoreDetail(verdict) {
|
|
3436
|
+
if (verdict.configured) return "delta syncs resume from a persisted cursor";
|
|
3437
|
+
if (verdict.edgeRuntime === null) return "in-memory (fine on a long-lived host)";
|
|
3438
|
+
return `No \`cursorStore\` on ${verdict.edgeRuntime} — memory does not survive between invocations, so every delta sync re-reads your entire source tables.`;
|
|
3439
|
+
}
|
|
3440
|
+
//#endregion
|
|
3360
3441
|
//#region src/edge-safety.ts
|
|
3361
3442
|
const NODE_BUILTINS = /* @__PURE__ */ new Set([
|
|
3362
3443
|
"assert",
|
|
@@ -3700,6 +3781,26 @@ const STATUS_STAGES = [
|
|
|
3700
3781
|
});
|
|
3701
3782
|
}
|
|
3702
3783
|
},
|
|
3784
|
+
{
|
|
3785
|
+
id: "cursor-store",
|
|
3786
|
+
label: "Sync cursor persists",
|
|
3787
|
+
needs: [configStage.id],
|
|
3788
|
+
run(ctx) {
|
|
3789
|
+
const read = ctx.readConfigSource ?? defaultReadConfigSource;
|
|
3790
|
+
const source = read(ctx.configPath);
|
|
3791
|
+
if (source === null) return Promise.resolve({
|
|
3792
|
+
state: "skip",
|
|
3793
|
+
detail: "config not readable"
|
|
3794
|
+
});
|
|
3795
|
+
const root = (0, node_path.dirname)(ctx.configPath);
|
|
3796
|
+
const verdict = detectCursorStore(source, (relative) => read((0, node_path.resolve)(root, relative)));
|
|
3797
|
+
return Promise.resolve({
|
|
3798
|
+
state: verdict.shouldWarn ? "warn" : "pass",
|
|
3799
|
+
detail: cursorStoreDetail(verdict),
|
|
3800
|
+
...verdict.shouldWarn ? { hint: CURSOR_STORE_HINT } : {}
|
|
3801
|
+
});
|
|
3802
|
+
}
|
|
3803
|
+
},
|
|
3703
3804
|
{
|
|
3704
3805
|
id: "boot-hook",
|
|
3705
3806
|
label: "Boot hook wired",
|