clivly 0.15.0 → 0.17.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/{adapter-BMAUq4hf.d.mts → adapter-BpAfha3z.d.mts} +1 -3
- package/{adapter-IH3r_I8v.d.cts → adapter-BvSigBPG.d.cts} +1 -3
- package/{auth-adapter-CiEXcweZ.cjs → auth-adapter-CNVuxT9W.cjs} +1 -2
- package/{auth-adapter-Bt1GZiag.d.cts → auth-adapter-CsZE4ugg.d.cts} +1 -3
- package/{auth-adapter-CHy273qb.d.mts → auth-adapter-Q6CL2VHr.d.mts} +1 -3
- package/{auth-adapter-gfVDxf3d.mjs → auth-adapter-u91PByaw.mjs} +1 -2
- package/auth-better-auth.cjs +2 -4
- package/auth-better-auth.d.cts +1 -5
- package/auth-better-auth.d.mts +1 -5
- package/auth-better-auth.mjs +2 -4
- package/auth-clerk.cjs +2 -4
- package/auth-clerk.d.cts +1 -5
- package/auth-clerk.d.mts +1 -5
- package/auth-clerk.mjs +2 -4
- package/auth-workos.cjs +2 -4
- package/auth-workos.d.cts +1 -5
- package/auth-workos.d.mts +1 -5
- package/auth-workos.mjs +2 -4
- package/core-adapter.cjs +2 -3
- package/core-adapter.d.cts +1 -1
- package/core-adapter.d.mts +1 -1
- package/core-adapter.mjs +2 -3
- package/core-auth-adapter.cjs +3 -4
- package/core-auth-adapter.d.cts +1 -1
- package/core-auth-adapter.d.mts +1 -1
- package/core-auth-adapter.mjs +3 -5
- package/core-drizzle.cjs +3 -4
- package/core-drizzle.d.cts +1 -1
- package/core-drizzle.d.mts +1 -1
- package/core-drizzle.mjs +3 -5
- package/core-entity-config.cjs +3 -4
- package/core-entity-config.d.cts +1 -1
- package/core-entity-config.d.mts +1 -1
- package/core-entity-config.mjs +3 -5
- package/core-entity-heuristics.cjs +2 -3
- package/core-entity-heuristics.d.cts +1 -1
- package/core-entity-heuristics.d.mts +1 -1
- package/core-entity-heuristics.mjs +3 -5
- package/core-mapping-form.cjs +3 -4
- package/core-mapping-form.d.cts +1 -1
- package/core-mapping-form.d.mts +1 -1
- package/core-mapping-form.mjs +3 -5
- package/core-mapping-score.cjs +3 -4
- package/core-mapping-score.d.cts +1 -1
- package/core-mapping-score.d.mts +1 -1
- package/core-mapping-score.mjs +3 -5
- package/core-mappings-config.cjs +3 -4
- package/core-mappings-config.d.cts +1 -1
- package/core-mappings-config.d.mts +1 -1
- package/core-mappings-config.mjs +3 -5
- package/core-sync-engine.cjs +3 -4
- package/core-sync-engine.d.cts +1 -1
- package/core-sync-engine.d.mts +1 -1
- package/core-sync-engine.mjs +3 -5
- package/core-types.cjs +3 -4
- package/core-types.d.cts +1 -1
- package/core-types.d.mts +1 -1
- package/core-types.mjs +3 -5
- package/core-view-compiler.cjs +3 -4
- package/core-view-compiler.d.cts +1 -1
- package/core-view-compiler.d.mts +1 -1
- package/core-view-compiler.mjs +3 -5
- package/core.cjs +13 -13
- package/core.d.cts +11 -11
- package/core.d.mts +11 -11
- package/core.mjs +13 -14
- package/{deprecate-subpath-CmvZtCpE.mjs → deprecate-subpath-CK37DKXH.mjs} +1 -2
- package/{deprecate-subpath-B9ngvizt.cjs → deprecate-subpath-dGwDiHKV.cjs} +1 -2
- package/{drizzle-DcB7OfBp.cjs → drizzle-C0bfX-6a.cjs} +1 -2
- package/{drizzle-wbcuG-cy.mjs → drizzle-CZuOzIu4.mjs} +1 -2
- package/{drizzle-CiK37zJm.d.cts → drizzle-MUNZgh1l.d.cts} +1 -3
- package/{drizzle-ehVWLSrN.d.mts → drizzle-UJbPCzPJ.d.mts} +1 -3
- package/{drizzle-meta-Bb1JWYqf.cjs → drizzle-meta-BPnRLpsB.cjs} +1 -2
- package/{drizzle-meta-D-5k3n0i.mjs → drizzle-meta-D00lFvAk.mjs} +1 -2
- package/drizzle.cjs +7 -10
- package/drizzle.d.cts +3 -7
- package/drizzle.d.mts +3 -7
- package/drizzle.mjs +7 -10
- package/entity-config-BF7pcXFB.d.cts +632 -0
- package/{entity-config-Ccfb2IL9.mjs → entity-config-DQVSprlG.mjs} +8 -11
- package/{entity-config-BI4RYNKL.cjs → entity-config-nWWgJXLw.cjs} +8 -11
- package/entity-config-pzamFSKw.d.mts +632 -0
- package/index.cjs +51 -98
- package/index.d.cts +1 -12
- package/index.d.mts +1 -12
- package/index.mjs +51 -98
- package/{integration-state-BA4c0RbD.d.mts → integration-state-xK4PLm5T.d.cts} +0 -2
- package/{integration-state-BA4c0RbD.d.cts → integration-state-xK4PLm5T.d.mts} +0 -2
- package/{internal-C7NlPM3M.d.mts → internal-C-uvosSL.d.cts} +1 -17
- package/{internal-DsArcqkP.cjs → internal-CjJy-cy1.cjs} +42 -8
- package/{internal-CLvZdVj5.mjs → internal-DtLZyjf8.mjs} +37 -9
- package/{internal-D2J4VQWT.d.cts → internal-Gie7hCpK.d.mts} +1 -17
- package/internal-adapter.d.cts +1 -1
- package/internal-adapter.d.mts +1 -1
- package/internal-auth-adapter.cjs +1 -1
- package/internal-auth-adapter.d.cts +1 -1
- package/internal-auth-adapter.d.mts +1 -1
- package/internal-auth-adapter.mjs +1 -2
- package/internal-drizzle.cjs +1 -1
- package/internal-drizzle.d.cts +1 -1
- package/internal-drizzle.d.mts +1 -1
- package/internal-drizzle.mjs +1 -2
- package/internal-entity-config.cjs +1 -1
- package/internal-entity-config.d.cts +1 -1
- package/internal-entity-config.d.mts +1 -1
- package/internal-entity-config.mjs +1 -2
- package/internal-entity-heuristics.cjs +3 -4
- package/internal-entity-heuristics.d.cts +2 -4
- package/internal-entity-heuristics.d.mts +2 -4
- package/internal-entity-heuristics.mjs +3 -4
- package/internal-mapping-form.cjs +1 -1
- package/internal-mapping-form.d.cts +1 -1
- package/internal-mapping-form.d.mts +1 -1
- package/internal-mapping-form.mjs +1 -2
- package/internal-mapping-score.cjs +1 -1
- package/internal-mapping-score.d.cts +1 -1
- package/internal-mapping-score.d.mts +1 -1
- package/internal-mapping-score.mjs +1 -2
- package/internal-mappings-config.cjs +1 -1
- package/internal-mappings-config.d.cts +1 -1
- package/internal-mappings-config.d.mts +1 -1
- package/internal-mappings-config.mjs +1 -2
- package/internal-sync-engine.cjs +1 -1
- package/internal-sync-engine.d.cts +1 -1
- package/internal-sync-engine.d.mts +1 -1
- package/internal-sync-engine.mjs +1 -2
- package/internal-types.cjs +1 -1
- package/internal-types.d.cts +1 -1
- package/internal-types.d.mts +1 -1
- package/internal-types.mjs +1 -2
- package/internal-view-compiler.cjs +1 -1
- package/internal-view-compiler.d.cts +1 -1
- package/internal-view-compiler.d.mts +1 -1
- package/internal-view-compiler.mjs +1 -2
- package/internal.cjs +11 -10
- package/internal.d.cts +11 -11
- package/internal.d.mts +11 -11
- package/internal.mjs +11 -11
- package/{mapping-form-BpfON_ME.cjs → mapping-form-Bs6JQurC.cjs} +1 -2
- package/{mapping-form-XsLLCqW_.d.cts → mapping-form-BymksK7h.d.mts} +1 -3
- package/{mapping-form-DigkuvFc.mjs → mapping-form-C7kDMWzp.mjs} +1 -2
- package/{mapping-form-Btn-7gzv.d.mts → mapping-form-Cmf8y-1m.d.cts} +1 -3
- package/{mapping-score-D7Gzg7Ii.d.cts → mapping-score-BKrxddz0.d.cts} +0 -2
- package/{mapping-score-D7Gzg7Ii.d.mts → mapping-score-BKrxddz0.d.mts} +0 -2
- package/{mapping-score-C68uAqGB.mjs → mapping-score-CS-MTDL9.mjs} +1 -2
- package/{mapping-score-CaB3F4Uu.cjs → mapping-score-D2TCQiOr.cjs} +1 -2
- package/{mappings-config-CwQNQ6bA.mjs → mappings-config-C7FPwrJT.mjs} +3 -4
- package/{mappings-config-BCsRLohT.cjs → mappings-config-DBG-KnYl.cjs} +3 -4
- package/{mappings-config-D6_oCi2Q.d.mts → mappings-config-Dsz6rcJb.d.cts} +1 -3
- package/{mappings-config-iJzbcUMp.d.cts → mappings-config-ktJhxmHm.d.mts} +1 -3
- package/{namespace-probe-DykR0kgh.d.mts → namespace-probe-By8SCnym.d.mts} +2 -8
- package/{namespace-probe-H7yWc0JV.d.cts → namespace-probe-CTkb35Ro.d.cts} +2 -8
- package/package.json +1 -1
- package/{projection-BELgANG2.cjs → projection-B8RtxuEq.cjs} +35 -38
- package/{projection-DvNewmI1.mjs → projection-DNi_2dVa.mjs} +30 -39
- package/{projection-sql-DweUaWRc.mjs → projection-sql-BYv40Hen.mjs} +2 -3
- package/{projection-sql-DuCtFE9t.cjs → projection-sql-SuhzhsMe.cjs} +2 -3
- package/schemas-DySv963y.d.cts +2098 -0
- package/schemas-DySv963y.d.mts +2098 -0
- package/{sdk-ZMy4C4VK.cjs → sdk-BJ3OkhCq.cjs} +27 -50
- package/{sdk-DLoVPlGB.mjs → sdk-CXrarwvs.mjs} +27 -50
- package/sdk.cjs +2 -2
- package/sdk.d.cts +2 -10
- package/sdk.d.mts +2 -10
- package/sdk.mjs +2 -2
- package/{sync-engine-DH058G3w.mjs → sync-engine-BTUoH82k.mjs} +2 -3
- package/{sync-engine-C_5TpvfX.d.mts → sync-engine-C_SwnFgF.d.mts} +2 -4
- package/{sync-engine-CYsWOujz.d.cts → sync-engine-D9ltfqkD.d.cts} +2 -4
- package/{sync-engine-BGVDsrOQ.cjs → sync-engine-DBlSP9r2.cjs} +2 -3
- package/{types-YJTkXKzU.mjs → types-8KSw2AWg.mjs} +1 -2
- package/{types-Cq5gHCTq.cjs → types-B8m39L1s.cjs} +1 -2
- package/{types-CpAtAtxd.d.cts → types-BtQCi_qP.d.cts} +30 -3
- package/{types-CpAtAtxd.d.mts → types-CTOl3pAX.d.mts} +30 -3
- package/{view-compiler-C-6RydKK.mjs → view-compiler-B8tJ5IGw.mjs} +3 -4
- package/{view-compiler-CwKVoK1w.d.mts → view-compiler-BZgZisTG.d.mts} +1 -3
- package/{view-compiler-xiwm5iar.cjs → view-compiler-Ce_QE3dh.cjs} +3 -4
- package/{view-compiler-Cq8apvZ4.d.cts → view-compiler-D7GLf1n8.d.cts} +1 -3
- package/vite.cjs +1 -2
- package/vite.d.cts +2 -4
- package/vite.d.mts +2 -4
- package/vite.mjs +1 -2
- package/entity-config-ApnT5j3X.d.cts +0 -4472
- package/entity-config-CKcj4-M_.d.mts +0 -4473
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const require_projection = require("./projection-
|
|
2
|
-
const require_entity_config = require("./entity-config-
|
|
3
|
-
const require_mappings_config = require("./mappings-config-
|
|
4
|
-
const require_drizzle_meta = require("./drizzle-meta-
|
|
5
|
-
|
|
1
|
+
const require_projection = require("./projection-B8RtxuEq.cjs");
|
|
2
|
+
const require_entity_config = require("./entity-config-nWWgJXLw.cjs");
|
|
3
|
+
const require_mappings_config = require("./mappings-config-DBG-KnYl.cjs");
|
|
4
|
+
const require_drizzle_meta = require("./drizzle-meta-BPnRLpsB.cjs");
|
|
5
|
+
// ../sdk/src/deployment-identity.ts
|
|
6
6
|
const MAX_DEPLOYMENT_ID_LENGTH = 128;
|
|
7
7
|
const PLATFORM_DEPLOYMENT_KEYS = [
|
|
8
8
|
"VERCEL_DEPLOYMENT_ID",
|
|
@@ -43,8 +43,7 @@ function resolveDeploymentId(env, configured) {
|
|
|
43
43
|
if (deploymentId) return deploymentId.slice(0, MAX_DEPLOYMENT_ID_LENGTH);
|
|
44
44
|
return `local-${hashLocalIdentity(firstNonBlank([env.HOSTNAME]) ?? "unidentified-host")}`;
|
|
45
45
|
}
|
|
46
|
-
|
|
47
|
-
//#region ../sdk/src/entity-source.ts
|
|
46
|
+
// ../sdk/src/entity-source.ts
|
|
48
47
|
const CONCEPT_KEYS = {
|
|
49
48
|
contact: "contacts",
|
|
50
49
|
company: "companies",
|
|
@@ -114,8 +113,7 @@ function customPushSource(config, source) {
|
|
|
114
113
|
const entities = config.entities?.entities;
|
|
115
114
|
return (entities?.[source.entity] ?? Object.values(entities ?? {}).find((e) => e.source === source.entity))?.projection?.baseTable ?? source.entity;
|
|
116
115
|
}
|
|
117
|
-
|
|
118
|
-
//#region ../sdk/src/concept-coverage.ts
|
|
116
|
+
// ../sdk/src/concept-coverage.ts
|
|
119
117
|
const CHECK_NAME$1 = "Entity → source coverage";
|
|
120
118
|
function configuredKeys(config) {
|
|
121
119
|
const src = config.source;
|
|
@@ -159,8 +157,7 @@ function checkConceptCoverage(config) {
|
|
|
159
157
|
detail: `${problems.join(" ")} Configured source keys: ${listed}. \`source\` is keyed by CRM concept, not by entity key.`
|
|
160
158
|
};
|
|
161
159
|
}
|
|
162
|
-
|
|
163
|
-
//#region ../sdk/src/custom-slug.ts
|
|
160
|
+
// ../sdk/src/custom-slug.ts
|
|
164
161
|
const SLUG_PATTERN = /^[a-z][a-z0-9_-]*$/;
|
|
165
162
|
const NON_ALNUM = /[^a-z0-9]+/g;
|
|
166
163
|
const EDGE_HYPHENS = /(^-|-$)/g;
|
|
@@ -208,8 +205,7 @@ function checkCustomObjectSlugs(config) {
|
|
|
208
205
|
detail: `Ensure these object types exist in Clivly: ${undeclared.join(", ")}. Declare them with \`objectType\` in clivly.config and \`clivly push-schema\` will create them for you.`
|
|
209
206
|
};
|
|
210
207
|
}
|
|
211
|
-
|
|
212
|
-
//#region ../sdk/src/fetch-error.ts
|
|
208
|
+
// ../sdk/src/fetch-error.ts
|
|
213
209
|
/** Deepest `Error` reachable through the `.cause` chain (the original error if none). */
|
|
214
210
|
function rootError(error) {
|
|
215
211
|
let current = error;
|
|
@@ -251,8 +247,7 @@ function describeFetchError(entity, error) {
|
|
|
251
247
|
if (hint) return `Couldn't read "${entity}": ${hint}`;
|
|
252
248
|
return `Couldn't read "${entity}": ${firstLine(root instanceof Error ? root.message : String(root?.message ?? root ?? "unknown error"))}`;
|
|
253
249
|
}
|
|
254
|
-
|
|
255
|
-
//#region ../sdk/src/mapping-dry-run.ts
|
|
250
|
+
// ../sdk/src/mapping-dry-run.ts
|
|
256
251
|
/**
|
|
257
252
|
* Fetch one real row and push it through the entity's field map.
|
|
258
253
|
*
|
|
@@ -311,8 +306,7 @@ async function runMappingDryRun(config, entityKey) {
|
|
|
311
306
|
detail: `Row from "${resolved.source.entity}" is missing mapped column(s): ${missing.join(", ")}.`
|
|
312
307
|
};
|
|
313
308
|
}
|
|
314
|
-
|
|
315
|
-
//#region ../sdk/src/namespace-probe.ts
|
|
309
|
+
// ../sdk/src/namespace-probe.ts
|
|
316
310
|
/**
|
|
317
311
|
* Verify the tables the integration depends on are genuinely reachable:
|
|
318
312
|
* connect, list tables, confirm each required table exists, then prove it's
|
|
@@ -378,8 +372,7 @@ function requiredTablesFromConfig(config) {
|
|
|
378
372
|
function errorMessage(error) {
|
|
379
373
|
return error instanceof Error ? error.message : String(error);
|
|
380
374
|
}
|
|
381
|
-
|
|
382
|
-
//#region ../sdk/src/readiness.ts
|
|
375
|
+
// ../sdk/src/readiness.ts
|
|
383
376
|
/**
|
|
384
377
|
* Ask Clivly whether it can actually receive what this config pushes.
|
|
385
378
|
*
|
|
@@ -451,8 +444,7 @@ function mappingReadinessCheck(requested, result) {
|
|
|
451
444
|
detail: `No active mapping receives ${names}, so rows pushed for ${unmapped.length === 1 ? "it" : "them"} are dropped. Map them in Integrations → Mapping in Clivly, then sync again.`
|
|
452
445
|
};
|
|
453
446
|
}
|
|
454
|
-
|
|
455
|
-
//#region ../sdk/src/doctor.ts
|
|
447
|
+
// ../sdk/src/doctor.ts
|
|
456
448
|
const TEMPORAL_CURSOR_TYPES = [
|
|
457
449
|
"timestamp",
|
|
458
450
|
"timestamptz",
|
|
@@ -652,8 +644,7 @@ async function runDoctor(args) {
|
|
|
652
644
|
checks
|
|
653
645
|
};
|
|
654
646
|
}
|
|
655
|
-
|
|
656
|
-
//#region ../sdk/src/host-environment.ts
|
|
647
|
+
// ../sdk/src/host-environment.ts
|
|
657
648
|
const KNOWN = [
|
|
658
649
|
"local_dev",
|
|
659
650
|
"preview",
|
|
@@ -698,8 +689,7 @@ function detectHostEnvironment(env, configured) {
|
|
|
698
689
|
}
|
|
699
690
|
return fromNodeEnv(env.NODE_ENV?.trim());
|
|
700
691
|
}
|
|
701
|
-
|
|
702
|
-
//#region ../sdk/src/instant-push-support.ts
|
|
692
|
+
// ../sdk/src/instant-push-support.ts
|
|
703
693
|
/**
|
|
704
694
|
* The fast rollback switch for instant push (see
|
|
705
695
|
* docs/reviews/2026-09-19-near-real-time-sync-plan.md, question 5).
|
|
@@ -712,8 +702,7 @@ function detectHostEnvironment(env, configured) {
|
|
|
712
702
|
function isInstantPushDisabled(env) {
|
|
713
703
|
return env.CLIVLY_INSTANT_PUSH_DISABLED === "true";
|
|
714
704
|
}
|
|
715
|
-
|
|
716
|
-
//#region ../sdk/src/presence-machine.ts
|
|
705
|
+
// ../sdk/src/presence-machine.ts
|
|
717
706
|
const PRESENCE_BACKOFF_BASE_MS = 1e3;
|
|
718
707
|
const PRESENCE_BACKOFF_MAX_MS = 3e4;
|
|
719
708
|
function effectsFor(state, overrides = {}) {
|
|
@@ -795,8 +784,7 @@ function presenceReduce(context, event, jitter) {
|
|
|
795
784
|
effects: effectsFor(context.state)
|
|
796
785
|
};
|
|
797
786
|
}
|
|
798
|
-
|
|
799
|
-
//#region ../sdk/src/presence-client.ts
|
|
787
|
+
// ../sdk/src/presence-client.ts
|
|
800
788
|
const PRESENCE_PING_INTERVAL_MS = 3e4;
|
|
801
789
|
const UNSUPPORTED_TICKET_STATUSES = /* @__PURE__ */ new Set([404, 501]);
|
|
802
790
|
function ticketUrl(options) {
|
|
@@ -992,8 +980,7 @@ function createPresenceClient(options) {
|
|
|
992
980
|
}
|
|
993
981
|
};
|
|
994
982
|
}
|
|
995
|
-
|
|
996
|
-
//#region ../sdk/src/presence-support.ts
|
|
983
|
+
// ../sdk/src/presence-support.ts
|
|
997
984
|
/**
|
|
998
985
|
* This stays HTTP until the production gate in docs/presence-rollout-gate.md
|
|
999
986
|
* has recorded a passing seven-day window. The later default-on rollout is a
|
|
@@ -1023,8 +1010,7 @@ function resolvePresenceTransport(host, configured) {
|
|
|
1023
1010
|
transport: DEFAULT_TRANSPORT
|
|
1024
1011
|
};
|
|
1025
1012
|
}
|
|
1026
|
-
|
|
1027
|
-
//#region ../sdk/src/push-outcome.ts
|
|
1013
|
+
// ../sdk/src/push-outcome.ts
|
|
1028
1014
|
function isCount(value) {
|
|
1029
1015
|
return typeof value === "number" && Number.isFinite(value);
|
|
1030
1016
|
}
|
|
@@ -1044,8 +1030,7 @@ function describeSilentPush(target, body) {
|
|
|
1044
1030
|
if (received === 0 || upserted > 0 || archived > 0) return null;
|
|
1045
1031
|
return `Clivly sync: pushed ${received} row(s) for ${objectType ? `"${source}" → "${objectType}"` : `"${source}"`} and none were stored — no active mapping in this workspace targets it, so the rows were dropped. Map it in Integrations → Mapping, then sync again.`;
|
|
1046
1032
|
}
|
|
1047
|
-
|
|
1048
|
-
//#region ../sdk/src/remote-projections.ts
|
|
1033
|
+
// ../sdk/src/remote-projections.ts
|
|
1049
1034
|
const SYNC_CUSTOM_PATH$1 = "/clivly/sdk/sync/custom";
|
|
1050
1035
|
const MISSING_INTROSPECTOR = "this app cannot run dashboard-authored derived objects yet — add `introspector: drizzleIntrospector(db)` to clivly.config.ts";
|
|
1051
1036
|
/**
|
|
@@ -1278,8 +1263,7 @@ async function pushRemoteProjections(args) {
|
|
|
1278
1263
|
}
|
|
1279
1264
|
return pushed;
|
|
1280
1265
|
}
|
|
1281
|
-
|
|
1282
|
-
//#region ../sdk/src/self-check.ts
|
|
1266
|
+
// ../sdk/src/self-check.ts
|
|
1283
1267
|
function selfCheck(input) {
|
|
1284
1268
|
const issues = [];
|
|
1285
1269
|
if (input.reportsTriggerUrl && !input.hasTriggerSecret) issues.push({
|
|
@@ -1294,8 +1278,7 @@ function selfCheck(input) {
|
|
|
1294
1278
|
});
|
|
1295
1279
|
return issues;
|
|
1296
1280
|
}
|
|
1297
|
-
|
|
1298
|
-
//#region ../sdk/src/sync.ts
|
|
1281
|
+
// ../sdk/src/sync.ts
|
|
1299
1282
|
const DEFAULT_ID_FIELD = "id";
|
|
1300
1283
|
function isAfter(candidate, current) {
|
|
1301
1284
|
const ct = candidate.time.getTime();
|
|
@@ -1390,8 +1373,7 @@ async function fullSyncSource(args) {
|
|
|
1390
1373
|
ok
|
|
1391
1374
|
};
|
|
1392
1375
|
}
|
|
1393
|
-
|
|
1394
|
-
//#region ../sdk/src/trigger-method.ts
|
|
1376
|
+
// ../sdk/src/trigger-method.ts
|
|
1395
1377
|
/** Host-side override, mirroring `CLIVLY_INSTANT_PUSH_DISABLED`. */
|
|
1396
1378
|
const REQUIRE_POST_ENV_VAR = "CLIVLY_TRIGGER_REQUIRE_POST";
|
|
1397
1379
|
const NON_POST_DEPRECATION_WARNING = `Clivly: this sync trigger was called with GET. It still ran the sync, but a future release will refuse any method except POST with a 405. Change the caller — your cron job or uptime check — to POST. To adopt the new behaviour now, set ${REQUIRE_POST_ENV_VAR}=true.`;
|
|
@@ -1435,8 +1417,7 @@ function resolveTriggerMethod(input) {
|
|
|
1435
1417
|
warn: NON_POST_DEPRECATION_WARNING
|
|
1436
1418
|
};
|
|
1437
1419
|
}
|
|
1438
|
-
|
|
1439
|
-
//#region ../sdk/src/trigger-url.ts
|
|
1420
|
+
// ../sdk/src/trigger-url.ts
|
|
1440
1421
|
const SCHEME_REGEX = /^https?:\/\//;
|
|
1441
1422
|
const INVALID_HOST_CHARS_REGEX = /[/\\@?#\s]/;
|
|
1442
1423
|
const PLATFORM_ORIGIN_SOURCES = [
|
|
@@ -1517,8 +1498,7 @@ function resolveTriggerUrl(args) {
|
|
|
1517
1498
|
if (origin && args.configuredPath) return `${origin}${args.configuredPath.startsWith("/") ? args.configuredPath : `/${args.configuredPath}`}`;
|
|
1518
1499
|
return args.observedUrl;
|
|
1519
1500
|
}
|
|
1520
|
-
|
|
1521
|
-
//#region ../sdk/src/chat-session.ts
|
|
1501
|
+
// ../sdk/src/chat-session.ts
|
|
1522
1502
|
const DEFAULT_API_URL$1 = "https://api.clivly.com";
|
|
1523
1503
|
const JSON_HEADERS = { "content-type": "application/json" };
|
|
1524
1504
|
const TRAILING_SLASH$1 = /\/$/;
|
|
@@ -1637,8 +1617,7 @@ function createChatSessionHandler({ allowedOrigins, apiKey, apiUrl = DEFAULT_API
|
|
|
1637
1617
|
}
|
|
1638
1618
|
};
|
|
1639
1619
|
}
|
|
1640
|
-
|
|
1641
|
-
//#region ../sdk/src/errors.ts
|
|
1620
|
+
// ../sdk/src/errors.ts
|
|
1642
1621
|
var ClivlyError = class ClivlyError extends Error {
|
|
1643
1622
|
/** HTTP status, or null when the request never completed (network error). */
|
|
1644
1623
|
status;
|
|
@@ -1673,8 +1652,7 @@ var ClivlyAuthError = class extends ClivlyError {};
|
|
|
1673
1652
|
var ClivlyRateLimitError = class extends ClivlyError {};
|
|
1674
1653
|
/** The request never reached the server (network/DNS/TLS). Retryable. */
|
|
1675
1654
|
var ClivlyNetworkError = class extends ClivlyError {};
|
|
1676
|
-
|
|
1677
|
-
//#region ../sdk/src/index.ts
|
|
1655
|
+
// ../sdk/src/index.ts
|
|
1678
1656
|
const DEFAULT_API_URL = "https://api.clivly.com";
|
|
1679
1657
|
const DEFAULT_HEARTBEAT_MS = 6e4;
|
|
1680
1658
|
const DEFAULT_BATCH_SIZE = 500;
|
|
@@ -2619,7 +2597,6 @@ function createClivlySDK(config) {
|
|
|
2619
2597
|
pushOne
|
|
2620
2598
|
};
|
|
2621
2599
|
}
|
|
2622
|
-
//#endregion
|
|
2623
2600
|
Object.defineProperty(exports, "CURSOR_KEY_PREFIX", {
|
|
2624
2601
|
enumerable: true,
|
|
2625
2602
|
get: function() {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { i as projectionSchema } from "./projection-
|
|
2
|
-
import { _ as validateProjection, s as customObjectDeclarations, w as primaryKeyColumns } from "./entity-config-
|
|
3
|
-
import { t as entitiesToMappings } from "./mappings-config-
|
|
4
|
-
import { t as DRIZZLE_META } from "./drizzle-meta-
|
|
5
|
-
|
|
1
|
+
import { i as projectionSchema } from "./projection-DNi_2dVa.mjs";
|
|
2
|
+
import { _ as validateProjection, s as customObjectDeclarations, w as primaryKeyColumns } from "./entity-config-DQVSprlG.mjs";
|
|
3
|
+
import { t as entitiesToMappings } from "./mappings-config-C7FPwrJT.mjs";
|
|
4
|
+
import { t as DRIZZLE_META } from "./drizzle-meta-D00lFvAk.mjs";
|
|
5
|
+
// ../sdk/src/deployment-identity.ts
|
|
6
6
|
const MAX_DEPLOYMENT_ID_LENGTH = 128;
|
|
7
7
|
const PLATFORM_DEPLOYMENT_KEYS = [
|
|
8
8
|
"VERCEL_DEPLOYMENT_ID",
|
|
@@ -43,8 +43,7 @@ function resolveDeploymentId(env, configured) {
|
|
|
43
43
|
if (deploymentId) return deploymentId.slice(0, MAX_DEPLOYMENT_ID_LENGTH);
|
|
44
44
|
return `local-${hashLocalIdentity(firstNonBlank([env.HOSTNAME]) ?? "unidentified-host")}`;
|
|
45
45
|
}
|
|
46
|
-
|
|
47
|
-
//#region ../sdk/src/entity-source.ts
|
|
46
|
+
// ../sdk/src/entity-source.ts
|
|
48
47
|
const CONCEPT_KEYS = {
|
|
49
48
|
contact: "contacts",
|
|
50
49
|
company: "companies",
|
|
@@ -114,8 +113,7 @@ function customPushSource(config, source) {
|
|
|
114
113
|
const entities = config.entities?.entities;
|
|
115
114
|
return (entities?.[source.entity] ?? Object.values(entities ?? {}).find((e) => e.source === source.entity))?.projection?.baseTable ?? source.entity;
|
|
116
115
|
}
|
|
117
|
-
|
|
118
|
-
//#region ../sdk/src/concept-coverage.ts
|
|
116
|
+
// ../sdk/src/concept-coverage.ts
|
|
119
117
|
const CHECK_NAME$1 = "Entity → source coverage";
|
|
120
118
|
function configuredKeys(config) {
|
|
121
119
|
const src = config.source;
|
|
@@ -159,8 +157,7 @@ function checkConceptCoverage(config) {
|
|
|
159
157
|
detail: `${problems.join(" ")} Configured source keys: ${listed}. \`source\` is keyed by CRM concept, not by entity key.`
|
|
160
158
|
};
|
|
161
159
|
}
|
|
162
|
-
|
|
163
|
-
//#region ../sdk/src/custom-slug.ts
|
|
160
|
+
// ../sdk/src/custom-slug.ts
|
|
164
161
|
const SLUG_PATTERN = /^[a-z][a-z0-9_-]*$/;
|
|
165
162
|
const NON_ALNUM = /[^a-z0-9]+/g;
|
|
166
163
|
const EDGE_HYPHENS = /(^-|-$)/g;
|
|
@@ -208,8 +205,7 @@ function checkCustomObjectSlugs(config) {
|
|
|
208
205
|
detail: `Ensure these object types exist in Clivly: ${undeclared.join(", ")}. Declare them with \`objectType\` in clivly.config and \`clivly push-schema\` will create them for you.`
|
|
209
206
|
};
|
|
210
207
|
}
|
|
211
|
-
|
|
212
|
-
//#region ../sdk/src/fetch-error.ts
|
|
208
|
+
// ../sdk/src/fetch-error.ts
|
|
213
209
|
/** Deepest `Error` reachable through the `.cause` chain (the original error if none). */
|
|
214
210
|
function rootError(error) {
|
|
215
211
|
let current = error;
|
|
@@ -251,8 +247,7 @@ function describeFetchError(entity, error) {
|
|
|
251
247
|
if (hint) return `Couldn't read "${entity}": ${hint}`;
|
|
252
248
|
return `Couldn't read "${entity}": ${firstLine(root instanceof Error ? root.message : String(root?.message ?? root ?? "unknown error"))}`;
|
|
253
249
|
}
|
|
254
|
-
|
|
255
|
-
//#region ../sdk/src/mapping-dry-run.ts
|
|
250
|
+
// ../sdk/src/mapping-dry-run.ts
|
|
256
251
|
/**
|
|
257
252
|
* Fetch one real row and push it through the entity's field map.
|
|
258
253
|
*
|
|
@@ -311,8 +306,7 @@ async function runMappingDryRun(config, entityKey) {
|
|
|
311
306
|
detail: `Row from "${resolved.source.entity}" is missing mapped column(s): ${missing.join(", ")}.`
|
|
312
307
|
};
|
|
313
308
|
}
|
|
314
|
-
|
|
315
|
-
//#region ../sdk/src/namespace-probe.ts
|
|
309
|
+
// ../sdk/src/namespace-probe.ts
|
|
316
310
|
/**
|
|
317
311
|
* Verify the tables the integration depends on are genuinely reachable:
|
|
318
312
|
* connect, list tables, confirm each required table exists, then prove it's
|
|
@@ -378,8 +372,7 @@ function requiredTablesFromConfig(config) {
|
|
|
378
372
|
function errorMessage(error) {
|
|
379
373
|
return error instanceof Error ? error.message : String(error);
|
|
380
374
|
}
|
|
381
|
-
|
|
382
|
-
//#region ../sdk/src/readiness.ts
|
|
375
|
+
// ../sdk/src/readiness.ts
|
|
383
376
|
/**
|
|
384
377
|
* Ask Clivly whether it can actually receive what this config pushes.
|
|
385
378
|
*
|
|
@@ -451,8 +444,7 @@ function mappingReadinessCheck(requested, result) {
|
|
|
451
444
|
detail: `No active mapping receives ${names}, so rows pushed for ${unmapped.length === 1 ? "it" : "them"} are dropped. Map them in Integrations → Mapping in Clivly, then sync again.`
|
|
452
445
|
};
|
|
453
446
|
}
|
|
454
|
-
|
|
455
|
-
//#region ../sdk/src/doctor.ts
|
|
447
|
+
// ../sdk/src/doctor.ts
|
|
456
448
|
const TEMPORAL_CURSOR_TYPES = [
|
|
457
449
|
"timestamp",
|
|
458
450
|
"timestamptz",
|
|
@@ -652,8 +644,7 @@ async function runDoctor(args) {
|
|
|
652
644
|
checks
|
|
653
645
|
};
|
|
654
646
|
}
|
|
655
|
-
|
|
656
|
-
//#region ../sdk/src/host-environment.ts
|
|
647
|
+
// ../sdk/src/host-environment.ts
|
|
657
648
|
const KNOWN = [
|
|
658
649
|
"local_dev",
|
|
659
650
|
"preview",
|
|
@@ -698,8 +689,7 @@ function detectHostEnvironment(env, configured) {
|
|
|
698
689
|
}
|
|
699
690
|
return fromNodeEnv(env.NODE_ENV?.trim());
|
|
700
691
|
}
|
|
701
|
-
|
|
702
|
-
//#region ../sdk/src/instant-push-support.ts
|
|
692
|
+
// ../sdk/src/instant-push-support.ts
|
|
703
693
|
/**
|
|
704
694
|
* The fast rollback switch for instant push (see
|
|
705
695
|
* docs/reviews/2026-09-19-near-real-time-sync-plan.md, question 5).
|
|
@@ -712,8 +702,7 @@ function detectHostEnvironment(env, configured) {
|
|
|
712
702
|
function isInstantPushDisabled(env) {
|
|
713
703
|
return env.CLIVLY_INSTANT_PUSH_DISABLED === "true";
|
|
714
704
|
}
|
|
715
|
-
|
|
716
|
-
//#region ../sdk/src/presence-machine.ts
|
|
705
|
+
// ../sdk/src/presence-machine.ts
|
|
717
706
|
const PRESENCE_BACKOFF_BASE_MS = 1e3;
|
|
718
707
|
const PRESENCE_BACKOFF_MAX_MS = 3e4;
|
|
719
708
|
function effectsFor(state, overrides = {}) {
|
|
@@ -795,8 +784,7 @@ function presenceReduce(context, event, jitter) {
|
|
|
795
784
|
effects: effectsFor(context.state)
|
|
796
785
|
};
|
|
797
786
|
}
|
|
798
|
-
|
|
799
|
-
//#region ../sdk/src/presence-client.ts
|
|
787
|
+
// ../sdk/src/presence-client.ts
|
|
800
788
|
const PRESENCE_PING_INTERVAL_MS = 3e4;
|
|
801
789
|
const UNSUPPORTED_TICKET_STATUSES = /* @__PURE__ */ new Set([404, 501]);
|
|
802
790
|
function ticketUrl(options) {
|
|
@@ -992,8 +980,7 @@ function createPresenceClient(options) {
|
|
|
992
980
|
}
|
|
993
981
|
};
|
|
994
982
|
}
|
|
995
|
-
|
|
996
|
-
//#region ../sdk/src/presence-support.ts
|
|
983
|
+
// ../sdk/src/presence-support.ts
|
|
997
984
|
/**
|
|
998
985
|
* This stays HTTP until the production gate in docs/presence-rollout-gate.md
|
|
999
986
|
* has recorded a passing seven-day window. The later default-on rollout is a
|
|
@@ -1023,8 +1010,7 @@ function resolvePresenceTransport(host, configured) {
|
|
|
1023
1010
|
transport: DEFAULT_TRANSPORT
|
|
1024
1011
|
};
|
|
1025
1012
|
}
|
|
1026
|
-
|
|
1027
|
-
//#region ../sdk/src/push-outcome.ts
|
|
1013
|
+
// ../sdk/src/push-outcome.ts
|
|
1028
1014
|
function isCount(value) {
|
|
1029
1015
|
return typeof value === "number" && Number.isFinite(value);
|
|
1030
1016
|
}
|
|
@@ -1044,8 +1030,7 @@ function describeSilentPush(target, body) {
|
|
|
1044
1030
|
if (received === 0 || upserted > 0 || archived > 0) return null;
|
|
1045
1031
|
return `Clivly sync: pushed ${received} row(s) for ${objectType ? `"${source}" → "${objectType}"` : `"${source}"`} and none were stored — no active mapping in this workspace targets it, so the rows were dropped. Map it in Integrations → Mapping, then sync again.`;
|
|
1046
1032
|
}
|
|
1047
|
-
|
|
1048
|
-
//#region ../sdk/src/remote-projections.ts
|
|
1033
|
+
// ../sdk/src/remote-projections.ts
|
|
1049
1034
|
const SYNC_CUSTOM_PATH$1 = "/clivly/sdk/sync/custom";
|
|
1050
1035
|
const MISSING_INTROSPECTOR = "this app cannot run dashboard-authored derived objects yet — add `introspector: drizzleIntrospector(db)` to clivly.config.ts";
|
|
1051
1036
|
/**
|
|
@@ -1278,8 +1263,7 @@ async function pushRemoteProjections(args) {
|
|
|
1278
1263
|
}
|
|
1279
1264
|
return pushed;
|
|
1280
1265
|
}
|
|
1281
|
-
|
|
1282
|
-
//#region ../sdk/src/self-check.ts
|
|
1266
|
+
// ../sdk/src/self-check.ts
|
|
1283
1267
|
function selfCheck(input) {
|
|
1284
1268
|
const issues = [];
|
|
1285
1269
|
if (input.reportsTriggerUrl && !input.hasTriggerSecret) issues.push({
|
|
@@ -1294,8 +1278,7 @@ function selfCheck(input) {
|
|
|
1294
1278
|
});
|
|
1295
1279
|
return issues;
|
|
1296
1280
|
}
|
|
1297
|
-
|
|
1298
|
-
//#region ../sdk/src/sync.ts
|
|
1281
|
+
// ../sdk/src/sync.ts
|
|
1299
1282
|
const DEFAULT_ID_FIELD = "id";
|
|
1300
1283
|
function isAfter(candidate, current) {
|
|
1301
1284
|
const ct = candidate.time.getTime();
|
|
@@ -1390,8 +1373,7 @@ async function fullSyncSource(args) {
|
|
|
1390
1373
|
ok
|
|
1391
1374
|
};
|
|
1392
1375
|
}
|
|
1393
|
-
|
|
1394
|
-
//#region ../sdk/src/trigger-method.ts
|
|
1376
|
+
// ../sdk/src/trigger-method.ts
|
|
1395
1377
|
/** Host-side override, mirroring `CLIVLY_INSTANT_PUSH_DISABLED`. */
|
|
1396
1378
|
const REQUIRE_POST_ENV_VAR = "CLIVLY_TRIGGER_REQUIRE_POST";
|
|
1397
1379
|
const NON_POST_DEPRECATION_WARNING = `Clivly: this sync trigger was called with GET. It still ran the sync, but a future release will refuse any method except POST with a 405. Change the caller — your cron job or uptime check — to POST. To adopt the new behaviour now, set ${REQUIRE_POST_ENV_VAR}=true.`;
|
|
@@ -1435,8 +1417,7 @@ function resolveTriggerMethod(input) {
|
|
|
1435
1417
|
warn: NON_POST_DEPRECATION_WARNING
|
|
1436
1418
|
};
|
|
1437
1419
|
}
|
|
1438
|
-
|
|
1439
|
-
//#region ../sdk/src/trigger-url.ts
|
|
1420
|
+
// ../sdk/src/trigger-url.ts
|
|
1440
1421
|
const SCHEME_REGEX = /^https?:\/\//;
|
|
1441
1422
|
const INVALID_HOST_CHARS_REGEX = /[/\\@?#\s]/;
|
|
1442
1423
|
const PLATFORM_ORIGIN_SOURCES = [
|
|
@@ -1517,8 +1498,7 @@ function resolveTriggerUrl(args) {
|
|
|
1517
1498
|
if (origin && args.configuredPath) return `${origin}${args.configuredPath.startsWith("/") ? args.configuredPath : `/${args.configuredPath}`}`;
|
|
1518
1499
|
return args.observedUrl;
|
|
1519
1500
|
}
|
|
1520
|
-
|
|
1521
|
-
//#region ../sdk/src/chat-session.ts
|
|
1501
|
+
// ../sdk/src/chat-session.ts
|
|
1522
1502
|
const DEFAULT_API_URL$1 = "https://api.clivly.com";
|
|
1523
1503
|
const JSON_HEADERS = { "content-type": "application/json" };
|
|
1524
1504
|
const TRAILING_SLASH$1 = /\/$/;
|
|
@@ -1637,8 +1617,7 @@ function createChatSessionHandler({ allowedOrigins, apiKey, apiUrl = DEFAULT_API
|
|
|
1637
1617
|
}
|
|
1638
1618
|
};
|
|
1639
1619
|
}
|
|
1640
|
-
|
|
1641
|
-
//#region ../sdk/src/errors.ts
|
|
1620
|
+
// ../sdk/src/errors.ts
|
|
1642
1621
|
var ClivlyError = class ClivlyError extends Error {
|
|
1643
1622
|
/** HTTP status, or null when the request never completed (network error). */
|
|
1644
1623
|
status;
|
|
@@ -1673,8 +1652,7 @@ var ClivlyAuthError = class extends ClivlyError {};
|
|
|
1673
1652
|
var ClivlyRateLimitError = class extends ClivlyError {};
|
|
1674
1653
|
/** The request never reached the server (network/DNS/TLS). Retryable. */
|
|
1675
1654
|
var ClivlyNetworkError = class extends ClivlyError {};
|
|
1676
|
-
|
|
1677
|
-
//#region ../sdk/src/index.ts
|
|
1655
|
+
// ../sdk/src/index.ts
|
|
1678
1656
|
const DEFAULT_API_URL = "https://api.clivly.com";
|
|
1679
1657
|
const DEFAULT_HEARTBEAT_MS = 6e4;
|
|
1680
1658
|
const DEFAULT_BATCH_SIZE = 500;
|
|
@@ -2619,5 +2597,4 @@ function createClivlySDK(config) {
|
|
|
2619
2597
|
pushOne
|
|
2620
2598
|
};
|
|
2621
2599
|
}
|
|
2622
|
-
//#endregion
|
|
2623
2600
|
export { ClivlyAuthError as a, ClivlyRateLimitError as c, memoryCursorStore as i, createChatSessionHandler as l, createClivlySDK as n, ClivlyError as o, kvCursorStore as r, ClivlyNetworkError as s, CURSOR_KEY_PREFIX as t, isPlaceholderUrl as u };
|
package/sdk.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_entity_config = require("./entity-config-
|
|
3
|
-
const require_sdk = require("./sdk-
|
|
2
|
+
const require_entity_config = require("./entity-config-nWWgJXLw.cjs");
|
|
3
|
+
const require_sdk = require("./sdk-BJ3OkhCq.cjs");
|
|
4
4
|
exports.CURSOR_KEY_PREFIX = require_sdk.CURSOR_KEY_PREFIX;
|
|
5
5
|
exports.ClivlyAuthError = require_sdk.ClivlyAuthError;
|
|
6
6
|
exports.ClivlyError = require_sdk.ClivlyError;
|
package/sdk.d.cts
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
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-
|
|
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-
|
|
3
|
-
//#region ../sdk/src/trigger-url.d.ts
|
|
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-BF7pcXFB.cjs";
|
|
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-CTkb35Ro.cjs";
|
|
4
3
|
export declare function isPlaceholderUrl(value: string): boolean;
|
|
5
|
-
//#endregion
|
|
6
|
-
//#region ../sdk/src/chat-session.d.ts
|
|
7
4
|
export declare function createChatSessionHandler({ allowedOrigins, apiKey, apiUrl, fetchImpl, resolveUser }: CreateChatSessionHandlerOptions): (request: Request) => Promise<Response>;
|
|
8
|
-
//#endregion
|
|
9
|
-
//#region ../sdk/src/errors.d.ts
|
|
10
5
|
export declare class ClivlyError extends Error {
|
|
11
6
|
/** HTTP status, or null when the request never completed (network error). */
|
|
12
7
|
readonly status: number | null;
|
|
@@ -26,8 +21,6 @@ export declare class ClivlyAuthError extends ClivlyError {}
|
|
|
26
21
|
export declare class ClivlyRateLimitError extends ClivlyError {}
|
|
27
22
|
/** The request never reached the server (network/DNS/TLS). Retryable. */
|
|
28
23
|
export declare class ClivlyNetworkError extends ClivlyError {}
|
|
29
|
-
//#endregion
|
|
30
|
-
//#region ../sdk/src/index.d.ts
|
|
31
24
|
export declare function memoryCursorStore(): CursorStore;
|
|
32
25
|
/** The shape every key-value client shares: Workers KV, Upstash, node-redis. */
|
|
33
26
|
export interface CursorKV {
|
|
@@ -67,5 +60,4 @@ export declare function kvCursorStore(kv: CursorKV, options?: {
|
|
|
67
60
|
* clearly-marked TODOs) and land with the Cloudflare infrastructure.
|
|
68
61
|
*/
|
|
69
62
|
export declare function createClivlySDK(config: ClivlySDKConfig): ClivlySDK;
|
|
70
|
-
//#endregion
|
|
71
63
|
export { type ChatSessionRequestBody, type ChatWidgetVisitor, type ClivlyConnectReason, type ClivlyConnectResult, type ClivlyEntitiesConfig, type ClivlySDK, type ClivlySDKConfig, type ClivlyUser, type ConfigValidationError, type ConfigValidationResult, type CreateChatSessionHandlerOptions, type CursorStore, type CustomObjectDeclaration, type DiscoveredSchemaTable, type DiscoveredTable, type DoctorCheck, type DoctorReport, type EnsureSchemaResult, type EnsuredMappingResult, type EnsuredObjectTypeResult, type RemoteProjectionsDescription, type SyncTriggerDescription, customObjectDeclarations, defineClivlyConfig, validateEntitiesConfig };
|
package/sdk.d.mts
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
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-
|
|
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-
|
|
3
|
-
//#region ../sdk/src/trigger-url.d.ts
|
|
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-pzamFSKw.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-By8SCnym.mjs";
|
|
4
3
|
export declare function isPlaceholderUrl(value: string): boolean;
|
|
5
|
-
//#endregion
|
|
6
|
-
//#region ../sdk/src/chat-session.d.ts
|
|
7
4
|
export declare function createChatSessionHandler({ allowedOrigins, apiKey, apiUrl, fetchImpl, resolveUser }: CreateChatSessionHandlerOptions): (request: Request) => Promise<Response>;
|
|
8
|
-
//#endregion
|
|
9
|
-
//#region ../sdk/src/errors.d.ts
|
|
10
5
|
export declare class ClivlyError extends Error {
|
|
11
6
|
/** HTTP status, or null when the request never completed (network error). */
|
|
12
7
|
readonly status: number | null;
|
|
@@ -26,8 +21,6 @@ export declare class ClivlyAuthError extends ClivlyError {}
|
|
|
26
21
|
export declare class ClivlyRateLimitError extends ClivlyError {}
|
|
27
22
|
/** The request never reached the server (network/DNS/TLS). Retryable. */
|
|
28
23
|
export declare class ClivlyNetworkError extends ClivlyError {}
|
|
29
|
-
//#endregion
|
|
30
|
-
//#region ../sdk/src/index.d.ts
|
|
31
24
|
export declare function memoryCursorStore(): CursorStore;
|
|
32
25
|
/** The shape every key-value client shares: Workers KV, Upstash, node-redis. */
|
|
33
26
|
export interface CursorKV {
|
|
@@ -67,5 +60,4 @@ export declare function kvCursorStore(kv: CursorKV, options?: {
|
|
|
67
60
|
* clearly-marked TODOs) and land with the Cloudflare infrastructure.
|
|
68
61
|
*/
|
|
69
62
|
export declare function createClivlySDK(config: ClivlySDKConfig): ClivlySDK;
|
|
70
|
-
//#endregion
|
|
71
63
|
export { type ChatSessionRequestBody, type ChatWidgetVisitor, type ClivlyConnectReason, type ClivlyConnectResult, type ClivlyEntitiesConfig, type ClivlySDK, type ClivlySDKConfig, type ClivlyUser, type ConfigValidationError, type ConfigValidationResult, type CreateChatSessionHandlerOptions, type CursorStore, type CustomObjectDeclaration, type DiscoveredSchemaTable, type DiscoveredTable, type DoctorCheck, type DoctorReport, type EnsureSchemaResult, type EnsuredMappingResult, type EnsuredObjectTypeResult, type RemoteProjectionsDescription, type SyncTriggerDescription, customObjectDeclarations, defineClivlyConfig, validateEntitiesConfig };
|
package/sdk.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { c as defineClivlyConfig, g as validateEntitiesConfig, s as customObjectDeclarations } from "./entity-config-
|
|
2
|
-
import { a as ClivlyAuthError, c as ClivlyRateLimitError, i as memoryCursorStore, l as createChatSessionHandler, n as createClivlySDK, o as ClivlyError, r as kvCursorStore, s as ClivlyNetworkError, t as CURSOR_KEY_PREFIX, u as isPlaceholderUrl } from "./sdk-
|
|
1
|
+
import { c as defineClivlyConfig, g as validateEntitiesConfig, s as customObjectDeclarations } from "./entity-config-DQVSprlG.mjs";
|
|
2
|
+
import { a as ClivlyAuthError, c as ClivlyRateLimitError, i as memoryCursorStore, l as createChatSessionHandler, n as createClivlySDK, o as ClivlyError, r as kvCursorStore, s as ClivlyNetworkError, t as CURSOR_KEY_PREFIX, u as isPlaceholderUrl } from "./sdk-CXrarwvs.mjs";
|
|
3
3
|
export { CURSOR_KEY_PREFIX, ClivlyAuthError, ClivlyError, ClivlyNetworkError, ClivlyRateLimitError, createChatSessionHandler, createClivlySDK, customObjectDeclarations, defineClivlyConfig, isPlaceholderUrl, kvCursorStore, memoryCursorStore, validateEntitiesConfig };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as compileEntityViews } from "./view-compiler-
|
|
2
|
-
|
|
1
|
+
import { r as compileEntityViews } from "./view-compiler-B8tJ5IGw.mjs";
|
|
2
|
+
// ../core/src/sync-engine.ts
|
|
3
3
|
/** Actions that remove something — only safe when the source set is complete. */
|
|
4
4
|
function isRemovalAction(action) {
|
|
5
5
|
return action.kind === "archive" || action.kind === "endMembership";
|
|
@@ -258,5 +258,4 @@ async function previewSync(store, view, opts) {
|
|
|
258
258
|
warnings: computeSampleWarnings(rows, opts.requiredFields, opts.sourceTable)
|
|
259
259
|
};
|
|
260
260
|
}
|
|
261
|
-
//#endregion
|
|
262
261
|
export { resolveActions as a, reconcile as i, isRemovalAction as n, runSync as o, previewSync as r, computeSampleWarnings as t };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { a as ClivlyEntitiesConfig } from "./entity-config-
|
|
2
|
-
import { n as CompiledView, t as CompileOptions } from "./view-compiler-
|
|
3
|
-
//#region ../core/src/sync-engine.d.ts
|
|
1
|
+
import { a as ClivlyEntitiesConfig } from "./entity-config-pzamFSKw.mjs";
|
|
2
|
+
import { n as CompiledView, t as CompileOptions } from "./view-compiler-BZgZisTG.mjs";
|
|
4
3
|
/**
|
|
5
4
|
* Sync engine (Phase 3) — materializes the read-only entity views into Clivly's
|
|
6
5
|
* own mirror tables (`crm_companies`, `crm_contacts`).
|
|
@@ -221,5 +220,4 @@ declare function previewSync(store: SyncStore, view: CompiledView, opts: {
|
|
|
221
220
|
requiredFields: string[];
|
|
222
221
|
sourceTable: string;
|
|
223
222
|
}): Promise<PreviewResult>;
|
|
224
|
-
//#endregion
|
|
225
223
|
export { PreviewWarning as a, SyncAction as c, computeSampleWarnings as d, isRemovalAction as f, runSync as g, resolveActions as h, PreviewResult as i, SyncResult as l, reconcile as m, MirrorRecord as n, ResolvedMembership as o, previewSync as p, PersistAction as r, SourceRow as s, EntitySyncResult as t, SyncStore as u };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { a as ClivlyEntitiesConfig } from "./entity-config-
|
|
2
|
-
import { n as CompiledView, t as CompileOptions } from "./view-compiler-
|
|
3
|
-
//#region ../core/src/sync-engine.d.ts
|
|
1
|
+
import { a as ClivlyEntitiesConfig } from "./entity-config-BF7pcXFB.cjs";
|
|
2
|
+
import { n as CompiledView, t as CompileOptions } from "./view-compiler-D7GLf1n8.cjs";
|
|
4
3
|
/**
|
|
5
4
|
* Sync engine (Phase 3) — materializes the read-only entity views into Clivly's
|
|
6
5
|
* own mirror tables (`crm_companies`, `crm_contacts`).
|
|
@@ -221,5 +220,4 @@ declare function previewSync(store: SyncStore, view: CompiledView, opts: {
|
|
|
221
220
|
requiredFields: string[];
|
|
222
221
|
sourceTable: string;
|
|
223
222
|
}): Promise<PreviewResult>;
|
|
224
|
-
//#endregion
|
|
225
223
|
export { PreviewWarning as a, SyncAction as c, computeSampleWarnings as d, isRemovalAction as f, runSync as g, resolveActions as h, PreviewResult as i, SyncResult as l, reconcile as m, MirrorRecord as n, ResolvedMembership as o, previewSync as p, PersistAction as r, SourceRow as s, EntitySyncResult as t, SyncStore as u };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_view_compiler = require("./view-compiler-
|
|
2
|
-
|
|
1
|
+
const require_view_compiler = require("./view-compiler-Ce_QE3dh.cjs");
|
|
2
|
+
// ../core/src/sync-engine.ts
|
|
3
3
|
/** Actions that remove something — only safe when the source set is complete. */
|
|
4
4
|
function isRemovalAction(action) {
|
|
5
5
|
return action.kind === "archive" || action.kind === "endMembership";
|
|
@@ -258,7 +258,6 @@ async function previewSync(store, view, opts) {
|
|
|
258
258
|
warnings: computeSampleWarnings(rows, opts.requiredFields, opts.sourceTable)
|
|
259
259
|
};
|
|
260
260
|
}
|
|
261
|
-
//#endregion
|
|
262
261
|
Object.defineProperty(exports, "computeSampleWarnings", {
|
|
263
262
|
enumerable: true,
|
|
264
263
|
get: function() {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
// ../core/src/types.ts
|
|
2
2
|
/** Named once so SQL predicates and UI fallbacks cannot drift apart. */
|
|
3
3
|
const OPEN_STAGE_TYPE = "open";
|
|
4
4
|
/** A closed deal is a historical fact: automation never reopens one. */
|
|
5
5
|
function isClosedStageType(type) {
|
|
6
6
|
return type === "won" || type === "lost";
|
|
7
7
|
}
|
|
8
|
-
//#endregion
|
|
9
8
|
export { isClosedStageType as n, OPEN_STAGE_TYPE as t };
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
// ../core/src/types.ts
|
|
2
2
|
/** Named once so SQL predicates and UI fallbacks cannot drift apart. */
|
|
3
3
|
const OPEN_STAGE_TYPE = "open";
|
|
4
4
|
/** A closed deal is a historical fact: automation never reopens one. */
|
|
5
5
|
function isClosedStageType(type) {
|
|
6
6
|
return type === "won" || type === "lost";
|
|
7
7
|
}
|
|
8
|
-
//#endregion
|
|
9
8
|
Object.defineProperty(exports, "OPEN_STAGE_TYPE", {
|
|
10
9
|
enumerable: true,
|
|
11
10
|
get: function() {
|