clivly 0.23.1 → 0.24.0-next.1
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 +42 -2
- package/{adapter-B4v4dwgD.d.mts → adapter--YV7du3i.d.cts} +1 -1
- package/{adapter-BK3gsby5.d.cts → adapter-DD3K3dCW.d.mts} +1 -1
- package/app-id-5cB6yioz.mjs +53 -0
- package/app-id-DcQ4u1c8.cjs +70 -0
- package/{auth-adapter-BIa-ZyVV.d.mts → auth-adapter-C17dzlzF.d.cts} +1 -1
- package/{auth-adapter-DwtMJb7D.d.cts → auth-adapter-CizFv7oU.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-supabase.cjs +121 -0
- package/auth-supabase.d.cts +23 -0
- package/auth-supabase.d.mts +23 -0
- package/auth-supabase.mjs +119 -0
- 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-mapping-score.d.cts +1 -0
- package/core-sync-engine.cjs +1 -1
- package/core-sync-engine.mjs +1 -1
- package/core-types.cjs +5 -1
- package/core-types.d.cts +2 -2
- package/core-types.d.mts +2 -2
- package/core-types.mjs +1 -1
- package/core-view-compiler.cjs +1 -1
- package/core-view-compiler.mjs +1 -1
- package/core.cjs +9 -5
- package/core.d.cts +6 -6
- package/core.d.mts +6 -6
- package/core.mjs +6 -6
- package/drizzle.cjs +121 -14
- package/drizzle.d.cts +8 -2
- package/drizzle.d.mts +8 -2
- package/drizzle.mjs +126 -19
- package/executor-CJEWurjZ.mjs +23 -0
- package/executor-CU-jRgpC.cjs +40 -0
- package/from-sql-BD7gR4bC.mjs +282 -0
- package/from-sql-CFgXkCe2.cjs +347 -0
- package/from-sql-CpGP7K3J.d.mts +70 -0
- package/from-sql-S8dSvU-e.d.cts +70 -0
- package/index-BoemTWH4.d.mts +134 -0
- package/index-CIupXz_w.d.cts +134 -0
- package/{index-Bh7o2J7K.d.mts → index-DOoX2GgI.d.mts} +3 -3
- package/{index-DRRTE5IJ.d.cts → index-uFDiQEjj.d.cts} +231 -5
- package/index.cjs +1079 -36
- package/index.d.cts +36 -0
- package/index.d.mts +35 -0
- package/index.mjs +1077 -34
- package/{internal-CdfVkh4O.d.mts → internal-D_2q2BOB.d.mts} +1 -1
- 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 +1 -1
- package/internal-sync-engine.mjs +1 -1
- package/internal-types.cjs +5 -1
- package/internal-types.d.cts +2 -2
- package/internal-types.d.mts +2 -2
- package/internal-types.mjs +1 -1
- package/internal-view-compiler.cjs +1 -1
- package/internal-view-compiler.mjs +1 -1
- package/internal.cjs +9 -5
- package/internal.d.cts +5 -6
- package/internal.d.mts +6 -6
- package/internal.mjs +6 -6
- package/introspector-5w2x89RD.mjs +55 -0
- package/introspector-DT_Ma59k.cjs +60 -0
- package/kysely.cjs +56 -0
- package/kysely.d.cts +45 -0
- package/kysely.d.mts +45 -0
- package/kysely.mjs +54 -0
- package/{namespace-probe-JuHriruA.d.mts → namespace-probe-CUR2zG2l.d.mts} +41 -4
- package/package.json +45 -1
- package/projection-guard-C70l5U24.cjs +170 -0
- package/projection-guard-DOt_nbGn.mjs +147 -0
- package/{projection-sql-DQQdjw9I.mjs → projection-sql-2joBkLz2.mjs} +13 -3
- package/{projection-sql-BkrHR2ea.cjs → projection-sql-DS5sVTY-.cjs} +18 -2
- package/sdk-Bzkr24NW.cjs +207 -0
- package/sdk-D2WwGBzk.mjs +178 -0
- package/sdk.cjs +8 -6
- package/sdk.d.cts +7 -1
- package/sdk.d.mts +7 -1
- package/sdk.mjs +3 -2
- package/sql.cjs +20 -0
- package/sql.d.cts +3 -0
- package/sql.d.mts +3 -0
- package/sql.mjs +7 -0
- package/{sdk-BOarpe5I.cjs → src-CZIdwwI2.cjs} +203 -583
- package/{sdk-BkMDOfCk.mjs → src-tFhC1Ru2.mjs} +175 -531
- package/supabase-contact-3ke1KKUs.mjs +595 -0
- package/supabase-contact-BXQ0nnLq.cjs +624 -0
- package/supabase.cjs +165 -0
- package/supabase.d.cts +20 -0
- package/supabase.d.mts +20 -0
- package/supabase.mjs +164 -0
- package/sync-CdA9dgZz.cjs +519 -0
- package/sync-Q0O-2kFI.mjs +382 -0
- package/{sync-engine-yFLEyId3.mjs → sync-engine-D0mJUeqP.mjs} +1 -1
- package/{sync-engine-DNSoZeo0.cjs → sync-engine-hU041kXO.cjs} +1 -1
- package/{namespace-probe-CcL6Wj8E.d.cts → types-CzL7lUH9.d.cts} +84 -47
- package/types-KMH5D5Lg.mjs +32 -0
- package/{types-BBfwsDxe.d.cts → types-f-Vcv-pl.d.cts} +18 -2
- package/{types-BBfwsDxe.d.mts → types-f-Vcv-pl.d.mts} +18 -2
- package/types-kR1kUlmz.cjs +67 -0
- package/{view-compiler-CSHSqZl7.mjs → view-compiler-BhKiezRH.mjs} +1 -1
- package/{view-compiler-NqiortOA.cjs → view-compiler-DgZadq1F.cjs} +1 -1
- package/vite.d.cts +1 -1
- package/vite.d.mts +1 -1
- package/drizzle-meta-BPnRLpsB.cjs +0 -8
- package/drizzle-meta-D00lFvAk.mjs +0 -3
- package/internal-D7qVRIFb.d.cts +0 -228
- package/types-8KSw2AWg.mjs +0 -8
- package/types-B8m39L1s.cjs +0 -19
package/internal-adapter.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as CRMAdapter } from "./adapter
|
|
1
|
+
import { t as CRMAdapter } from "./adapter--YV7du3i.cjs";
|
|
2
2
|
export { CRMAdapter };
|
package/internal-adapter.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as CRMAdapter } from "./adapter-
|
|
1
|
+
import { t as CRMAdapter } from "./adapter-DD3K3dCW.mjs";
|
|
2
2
|
export { CRMAdapter };
|
|
@@ -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-C17dzlzF.cjs";
|
|
2
2
|
export { ClivlyAuthAdapter, ClivlyUser, CrmMembership, MembershipResolver, authCustom };
|
|
@@ -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-CizFv7oU.mjs";
|
|
2
2
|
export { ClivlyAuthAdapter, ClivlyUser, CrmMembership, MembershipResolver, authCustom };
|
package/internal-sync-engine.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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-hU041kXO.cjs");
|
|
3
3
|
exports.computeSampleWarnings = require_sync_engine.computeSampleWarnings;
|
|
4
4
|
exports.isRemovalAction = require_sync_engine.isRemovalAction;
|
|
5
5
|
exports.previewSync = require_sync_engine.previewSync;
|
package/internal-sync-engine.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as computeSampleWarnings, n as isRemovalAction, r as previewSync, i as reconcile, a as resolveActions, o as runSync } from "./sync-engine-
|
|
1
|
+
export { t as computeSampleWarnings, n as isRemovalAction, r as previewSync, i as reconcile, a as resolveActions, o as runSync } from "./sync-engine-D0mJUeqP.mjs";
|
package/internal-types.cjs
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_types = require("./types-
|
|
2
|
+
const require_types = require("./types-kR1kUlmz.cjs");
|
|
3
|
+
exports.CONTACT_STATUSES = require_types.CONTACT_STATUSES;
|
|
4
|
+
exports.LIFECYCLE_STATUSES = require_types.LIFECYCLE_STATUSES;
|
|
3
5
|
exports.OPEN_STAGE_TYPE = require_types.OPEN_STAGE_TYPE;
|
|
6
|
+
exports.VENDOR_STATUS = require_types.VENDOR_STATUS;
|
|
4
7
|
exports.isClosedStageType = require_types.isClosedStageType;
|
|
8
|
+
exports.isContactStatus = require_types.isContactStatus;
|
package/internal-types.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
export { Activity, ActivityType, Company, CompanyFilters, Contact, ContactFilters, ContactSource, ContactStatus, CreateActivityInput, CreateCompanyInput, CreateContactInput, CreateDealInput, CreateTaskInput, CrmRole, Deal, DealStage, Note, OPEN_STAGE_TYPE, Page, PageRequest, PipelineConfig, PipelineKind, PipelineStageConfig, RecordSource, StageType, Task, TaskEntityType, TaskFilters, TaskPriority, TaskStatus, UpdateCompanyInput, UpdateContactInput, UpdateDealInput, UpdateTaskInput, ValueInterval, isClosedStageType };
|
|
1
|
+
import { A as TaskFilters, B as isContactStatus, C as PipelineConfig, D as StageType, E as RecordSource, F as UpdateDealInput, I as UpdateTaskInput, L as VENDOR_STATUS, M as TaskStatus, N as UpdateCompanyInput, O as Task, P as UpdateContactInput, R as ValueInterval, S as PageRequest, T as PipelineStageConfig, _ as DealStage, a as CompanyFilters, b as OPEN_STAGE_TYPE, c as ContactSource, d as CreateCompanyInput, f as CreateContactInput, g as Deal, h as CrmRole, i as Company, j as TaskPriority, k as TaskEntityType, l as ContactStatus, m as CreateTaskInput, n as ActivityType, o as Contact, p as CreateDealInput, r as CONTACT_STATUSES, s as ContactFilters, t as Activity, u as CreateActivityInput, v as LIFECYCLE_STATUSES, w as PipelineKind, x as Page, y as Note, z as isClosedStageType } from "./types-f-Vcv-pl.cjs";
|
|
2
|
+
export { Activity, ActivityType, CONTACT_STATUSES, Company, CompanyFilters, Contact, ContactFilters, ContactSource, ContactStatus, CreateActivityInput, CreateCompanyInput, CreateContactInput, CreateDealInput, CreateTaskInput, CrmRole, Deal, DealStage, LIFECYCLE_STATUSES, Note, OPEN_STAGE_TYPE, Page, PageRequest, PipelineConfig, PipelineKind, PipelineStageConfig, RecordSource, StageType, Task, TaskEntityType, TaskFilters, TaskPriority, TaskStatus, UpdateCompanyInput, UpdateContactInput, UpdateDealInput, UpdateTaskInput, VENDOR_STATUS, ValueInterval, isClosedStageType, isContactStatus };
|
package/internal-types.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
export { Activity, ActivityType, Company, CompanyFilters, Contact, ContactFilters, ContactSource, ContactStatus, CreateActivityInput, CreateCompanyInput, CreateContactInput, CreateDealInput, CreateTaskInput, CrmRole, Deal, DealStage, Note, OPEN_STAGE_TYPE, Page, PageRequest, PipelineConfig, PipelineKind, PipelineStageConfig, RecordSource, StageType, Task, TaskEntityType, TaskFilters, TaskPriority, TaskStatus, UpdateCompanyInput, UpdateContactInput, UpdateDealInput, UpdateTaskInput, ValueInterval, isClosedStageType };
|
|
1
|
+
import { A as TaskFilters, B as isContactStatus, C as PipelineConfig, D as StageType, E as RecordSource, F as UpdateDealInput, I as UpdateTaskInput, L as VENDOR_STATUS, M as TaskStatus, N as UpdateCompanyInput, O as Task, P as UpdateContactInput, R as ValueInterval, S as PageRequest, T as PipelineStageConfig, _ as DealStage, a as CompanyFilters, b as OPEN_STAGE_TYPE, c as ContactSource, d as CreateCompanyInput, f as CreateContactInput, g as Deal, h as CrmRole, i as Company, j as TaskPriority, k as TaskEntityType, l as ContactStatus, m as CreateTaskInput, n as ActivityType, o as Contact, p as CreateDealInput, r as CONTACT_STATUSES, s as ContactFilters, t as Activity, u as CreateActivityInput, v as LIFECYCLE_STATUSES, w as PipelineKind, x as Page, y as Note, z as isClosedStageType } from "./types-f-Vcv-pl.mjs";
|
|
2
|
+
export { Activity, ActivityType, CONTACT_STATUSES, Company, CompanyFilters, Contact, ContactFilters, ContactSource, ContactStatus, CreateActivityInput, CreateCompanyInput, CreateContactInput, CreateDealInput, CreateTaskInput, CrmRole, Deal, DealStage, LIFECYCLE_STATUSES, Note, OPEN_STAGE_TYPE, Page, PageRequest, PipelineConfig, PipelineKind, PipelineStageConfig, RecordSource, StageType, Task, TaskEntityType, TaskFilters, TaskPriority, TaskStatus, UpdateCompanyInput, UpdateContactInput, UpdateDealInput, UpdateTaskInput, VENDOR_STATUS, ValueInterval, isClosedStageType, isContactStatus };
|
package/internal-types.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as
|
|
1
|
+
export { t as CONTACT_STATUSES, n as LIFECYCLE_STATUSES, r as OPEN_STAGE_TYPE, i as VENDOR_STATUS, a as isClosedStageType, o as isContactStatus } from "./types-KMH5D5Lg.mjs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_view_compiler = require("./view-compiler-
|
|
2
|
+
const require_view_compiler = require("./view-compiler-DgZadq1F.cjs");
|
|
3
3
|
exports.DEFAULT_VIEW_PREFIX = require_view_compiler.DEFAULT_VIEW_PREFIX;
|
|
4
4
|
exports.compileEntityView = require_view_compiler.compileEntityView;
|
|
5
5
|
exports.compileEntityViews = require_view_compiler.compileEntityViews;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as DEFAULT_VIEW_PREFIX, n as compileEntityView, r as compileEntityViews, i as explainEntitiesConfig, a as explainViewExecutionError } from "./view-compiler-
|
|
1
|
+
export { t as DEFAULT_VIEW_PREFIX, n as compileEntityView, r as compileEntityViews, i as explainEntitiesConfig, a as explainViewExecutionError } from "./view-compiler-BhKiezRH.mjs";
|
package/internal.cjs
CHANGED
|
@@ -1,24 +1,27 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_projection = require("./projection-w4Z6vSL2.cjs");
|
|
3
|
+
const require_projection_sql = require("./projection-sql-DS5sVTY-.cjs");
|
|
3
4
|
const require_entity_config = require("./entity-config-BP8Cc_nC.cjs");
|
|
4
|
-
const require_mappings_config = require("./mappings-config-CC-vltWb.cjs");
|
|
5
5
|
const require_auth_adapter = require("./auth-adapter-CNVuxT9W.cjs");
|
|
6
6
|
const require_internal = require("./internal-D88LTRlu.cjs");
|
|
7
7
|
const require_mapping_form = require("./mapping-form-Bs6JQurC.cjs");
|
|
8
|
-
const
|
|
9
|
-
const require_view_compiler = require("./view-compiler-
|
|
10
|
-
const require_sync_engine = require("./sync-engine-
|
|
11
|
-
const require_types = require("./types-
|
|
8
|
+
const require_mappings_config = require("./mappings-config-CC-vltWb.cjs");
|
|
9
|
+
const require_view_compiler = require("./view-compiler-DgZadq1F.cjs");
|
|
10
|
+
const require_sync_engine = require("./sync-engine-hU041kXO.cjs");
|
|
11
|
+
const require_types = require("./types-kR1kUlmz.cjs");
|
|
12
12
|
exports.BASE_REF = require_projection.BASE_REF;
|
|
13
13
|
exports.CANONICAL_FIELDS = require_entity_config.CANONICAL_FIELDS;
|
|
14
|
+
exports.CONTACT_STATUSES = require_types.CONTACT_STATUSES;
|
|
14
15
|
exports.CRM_CONCEPTS = require_entity_config.CRM_CONCEPTS;
|
|
15
16
|
exports.ClivlyConfigError = require_entity_config.ClivlyConfigError;
|
|
16
17
|
exports.DEFAULT_VIEW_PREFIX = require_view_compiler.DEFAULT_VIEW_PREFIX;
|
|
18
|
+
exports.LIFECYCLE_STATUSES = require_types.LIFECYCLE_STATUSES;
|
|
17
19
|
exports.MATERIALIZING_CONCEPTS = require_entity_config.MATERIALIZING_CONCEPTS;
|
|
18
20
|
exports.OPEN_STAGE_TYPE = require_types.OPEN_STAGE_TYPE;
|
|
19
21
|
exports.PREVIEW_MAX_ROWS = require_projection_sql.PREVIEW_MAX_ROWS;
|
|
20
22
|
exports.PROJECTION_KEY_PATTERN = require_projection.PROJECTION_KEY_PATTERN;
|
|
21
23
|
exports.REQUIRED_FIELDS = require_entity_config.REQUIRED_FIELDS;
|
|
24
|
+
exports.VENDOR_STATUS = require_types.VENDOR_STATUS;
|
|
22
25
|
exports.authCustom = require_auth_adapter.authCustom;
|
|
23
26
|
exports.buildFilterFromDiscriminator = require_mapping_form.buildFilterFromDiscriminator;
|
|
24
27
|
exports.buildRelationships = require_mapping_form.buildRelationships;
|
|
@@ -43,6 +46,7 @@ exports.hasRichMeta = require_entity_config.hasRichMeta;
|
|
|
43
46
|
exports.hostOwnedFieldMessage = require_internal.hostOwnedFieldMessage;
|
|
44
47
|
exports.identityRefs = require_projection.identityRefs;
|
|
45
48
|
exports.isClosedStageType = require_types.isClosedStageType;
|
|
49
|
+
exports.isContactStatus = require_types.isContactStatus;
|
|
46
50
|
exports.isHostOwned = require_internal.isHostOwned;
|
|
47
51
|
exports.isRemovalAction = require_sync_engine.isRemovalAction;
|
|
48
52
|
exports.joinFansOut = require_entity_config.joinFansOut;
|
package/internal.d.cts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { A as TaskStatus, C as PipelineStageConfig, D as TaskEntityType, E as Task, F as ValueInterval, I as isClosedStageType, L as ContactSegment, M as UpdateContactInput, N as UpdateDealInput, O as TaskFilters, P as UpdateTaskInput, R as contactSegmentSchema, S as PipelineKind, T as StageType, _ as Note, a as Contact, b as PageRequest, c as ContactStatus, d as CreateContactInput, f as CreateDealInput, g as DealStage, h as Deal, i as CompanyFilters, j as UpdateCompanyInput, k as TaskPriority, l as CreateActivityInput, m as CrmRole, n as ActivityType, o as ContactFilters, p as CreateTaskInput, r as Company, s as ContactSource, t as Activity, u as CreateCompanyInput, v as OPEN_STAGE_TYPE, w as RecordSource, x as PipelineConfig, y as Page } from "./types-BBfwsDxe.cjs";
|
|
2
|
-
import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-DwtMJb7D.cjs";
|
|
3
|
-
import { t as CRMAdapter } from "./adapter-BK3gsby5.cjs";
|
|
4
1
|
import { A as relationshipsSchema, B as identityRefs, D as missingRequiredFields, E as filterSchema, F as ProjectionFieldBinding, I as ProjectionIdentity, L as ProjectionJoin, M as validateEntitiesConfig, N as BASE_REF, O as projectionFields, P as PROJECTION_KEY_PATTERN, R as ProjectionMapping, S as RelationshipsMap, T as entitiesConfigSchema, V as projectionSchema, _ as MATERIALIZING_CONCEPTS, a as ClivlyEntitiesConfig, b as RelationshipSpec, d as CrmConcept, g as FilterValue, h as FilterExpr, i as ClivlyConfigError, j as requiredFieldsFor, k as relationshipSchema, l as ConfigValidationError, m as DiscoveredSchemaTable, n as CRM_CONCEPTS, p as DiscoveredColumnMeta, s as ClivlyEntityConfig, t as CANONICAL_FIELDS, u as ConfigValidationResult, v as MaterializingConcept, w as defineClivlyConfig, x as RelationshipVia, y as REQUIRED_FIELDS, z as ProjectionRef } from "./entity-config-CXpGowQa.cjs";
|
|
2
|
+
import { A as TaskFilters, B as isContactStatus, C as PipelineConfig, D as StageType, E as RecordSource, F as UpdateDealInput, H as contactSegmentSchema, I as UpdateTaskInput, L as VENDOR_STATUS, M as TaskStatus, N as UpdateCompanyInput, O as Task, P as UpdateContactInput, R as ValueInterval, S as PageRequest, T as PipelineStageConfig, V as ContactSegment, _ as DealStage, a as CompanyFilters, b as OPEN_STAGE_TYPE, c as ContactSource, d as CreateCompanyInput, f as CreateContactInput, g as Deal, h as CrmRole, i as Company, j as TaskPriority, k as TaskEntityType, l as ContactStatus, m as CreateTaskInput, n as ActivityType, o as Contact, p as CreateDealInput, r as CONTACT_STATUSES, s as ContactFilters, t as Activity, u as CreateActivityInput, v as LIFECYCLE_STATUSES, w as PipelineKind, x as Page, y as Note, z as isClosedStageType } from "./types-f-Vcv-pl.cjs";
|
|
3
|
+
import { t as CRMAdapter } from "./adapter--YV7du3i.cjs";
|
|
4
|
+
import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-C17dzlzF.cjs";
|
|
5
|
+
import { A as StepProblem, B as MappedAmountValueSource, C as ConnectionLiveness, D as IntegrationStep, E as IntegrationStatus, F as hostOwnedFieldMessage, H as computeDealValue, I as isHostOwned, L as rejectedCompanyFields, M as HostOwnedCompanyField, N as HostOwnedContactField, O as NextAction, P as SourcedRecord, R as rejectedContactFields, S as joinFansOut, T as IntegrationState, V as PerSeatValueSource, _ as compileProjectionJoins, a as matchesCondition, b as quoteIdent, c as columnMetaFor, d as primaryKeyColumns, f as validateProjection, g as compileProjectionIdentity, h as compileProjectionFrom, i as evaluateStage, j as StepState, k as StepId, l as coversUniqueKey, m as PREVIEW_MAX_ROWS, n as ConditionOp, o as slugify, p as validateProjectionFilter, r as EvaluableRule, s as toObjectTypeSlug, t as Condition, u as hasRichMeta, v as compileProjectionPreview, w as IntegrationFacts, x as fanOutJoins, y as compileProjectionSelect, z as DealValueSource } from "./index-uFDiQEjj.cjs";
|
|
5
6
|
import { i as relationshipViaSignature, n as buildFilterFromDiscriminator, r as buildRelationships, t as RelationshipCandidate } from "./mapping-form-Bg_hgNoL.cjs";
|
|
6
7
|
import { i as mappingsToEntitiesConfig, t as EntityMappingRow } from "./mappings-config-DNo_Cum_.cjs";
|
|
7
8
|
import { a as compileEntityView, i as ExplainResult, n as CompiledView, o as compileEntityViews, r as DEFAULT_VIEW_PREFIX, s as explainEntitiesConfig, t as CompileOptions } from "./view-compiler-BDD93Luw.cjs";
|
|
8
9
|
import { c as SyncAction, f as isRemovalAction, g as runSync, h as resolveActions, l as SyncResult, m as reconcile, n as MirrorRecord, o as ResolvedMembership, r as PersistAction, s as SourceRow, t as EntitySyncResult, u as SyncStore } from "./sync-engine-DCjTr2XQ.cjs";
|
|
9
|
-
|
|
10
|
-
import { C as StepProblem, S as StepId, _ as IntegrationFacts, a as validateProjection, b as IntegrationStep, c as compileProjectionFrom, d as compileProjectionPreview, f as compileProjectionSelect, g as ConnectionLiveness, h as joinFansOut, i as primaryKeyColumns, l as compileProjectionIdentity, m as fanOutJoins, n as coversUniqueKey, o as validateProjectionFilter, p as quoteIdent, r as hasRichMeta, s as PREVIEW_MAX_ROWS, t as columnMetaFor, u as compileProjectionJoins, v as IntegrationState, w as StepState, x as NextAction, y as IntegrationStatus } from "./index-DRRTE5IJ.cjs";
|
|
11
|
-
export { type Activity, type ActivityType, BASE_REF, CANONICAL_FIELDS, type CRMAdapter, CRM_CONCEPTS, type ClivlyAuthAdapter, ClivlyConfigError, type ClivlyEntitiesConfig, type ClivlyEntityConfig, type ClivlyUser, type Company, type CompanyFilters, type CompileOptions, type CompiledView, type Condition, type ConditionOp, type ConfigValidationError, type ConfigValidationResult, type ConnectionLiveness, type Contact, type ContactFilters, type ContactSegment, type ContactSource, type ContactStatus, type CreateActivityInput, type CreateCompanyInput, type CreateContactInput, type CreateDealInput, type CreateTaskInput, type CrmConcept, type CrmMembership, type CrmRole, DEFAULT_VIEW_PREFIX, type Deal, type DealStage, type DealValueSource, type DiscoveredColumnMeta, type DiscoveredSchemaTable, type EntityMappingRow, type EntitySyncResult, type EvaluableRule, type ExplainResult, type FilterExpr, type FilterValue, type HostOwnedCompanyField, type HostOwnedContactField, type IntegrationFacts, type IntegrationState, type IntegrationStatus, type IntegrationStep, MATERIALIZING_CONCEPTS, type MappedAmountValueSource, type MaterializingConcept, type MembershipResolver, type MirrorRecord, type NextAction, type Note, OPEN_STAGE_TYPE, PREVIEW_MAX_ROWS, PROJECTION_KEY_PATTERN, type Page, type PageRequest, type PerSeatValueSource, type PersistAction, type PipelineConfig, type PipelineKind, type PipelineStageConfig, type ProjectionFieldBinding, type ProjectionIdentity, type ProjectionJoin, type ProjectionMapping, type ProjectionRef, REQUIRED_FIELDS, type RecordSource, type RelationshipCandidate, type RelationshipSpec, type RelationshipVia, type RelationshipsMap, type ResolvedMembership, type SourceRow, type SourcedRecord, type StageType, type StepId, type StepProblem, type StepState, type SyncAction, type SyncResult, type SyncStore, type Task, type TaskEntityType, type TaskFilters, type TaskPriority, type TaskStatus, type UpdateCompanyInput, type UpdateContactInput, type UpdateDealInput, type UpdateTaskInput, type ValueInterval, authCustom, buildFilterFromDiscriminator, buildRelationships, columnMetaFor, compileEntityView, compileEntityViews, compileProjectionFrom, compileProjectionIdentity, compileProjectionJoins, compileProjectionPreview, compileProjectionSelect, computeDealValue, contactSegmentSchema, coversUniqueKey, defineClivlyConfig, entitiesConfigSchema, evaluateStage, explainEntitiesConfig, fanOutJoins, filterSchema, hasRichMeta, hostOwnedFieldMessage, identityRefs, isClosedStageType, isHostOwned, isRemovalAction, joinFansOut, mappingsToEntitiesConfig, matchesCondition, missingRequiredFields, primaryKeyColumns, projectionFields, projectionSchema, quoteIdent, reconcile, rejectedCompanyFields, rejectedContactFields, relationshipSchema, relationshipViaSignature, relationshipsSchema, requiredFieldsFor, resolveActions, runSync, slugify, toObjectTypeSlug, validateEntitiesConfig, validateProjection, validateProjectionFilter };
|
|
10
|
+
export { type Activity, type ActivityType, BASE_REF, CANONICAL_FIELDS, CONTACT_STATUSES, type CRMAdapter, CRM_CONCEPTS, type ClivlyAuthAdapter, ClivlyConfigError, type ClivlyEntitiesConfig, type ClivlyEntityConfig, type ClivlyUser, type Company, type CompanyFilters, type CompileOptions, type CompiledView, type Condition, type ConditionOp, type ConfigValidationError, type ConfigValidationResult, type ConnectionLiveness, type Contact, type ContactFilters, type ContactSegment, type ContactSource, type ContactStatus, type CreateActivityInput, type CreateCompanyInput, type CreateContactInput, type CreateDealInput, type CreateTaskInput, type CrmConcept, type CrmMembership, type CrmRole, DEFAULT_VIEW_PREFIX, type Deal, type DealStage, type DealValueSource, type DiscoveredColumnMeta, type DiscoveredSchemaTable, type EntityMappingRow, type EntitySyncResult, type EvaluableRule, type ExplainResult, type FilterExpr, type FilterValue, type HostOwnedCompanyField, type HostOwnedContactField, type IntegrationFacts, type IntegrationState, type IntegrationStatus, type IntegrationStep, LIFECYCLE_STATUSES, MATERIALIZING_CONCEPTS, type MappedAmountValueSource, type MaterializingConcept, type MembershipResolver, type MirrorRecord, type NextAction, type Note, OPEN_STAGE_TYPE, PREVIEW_MAX_ROWS, PROJECTION_KEY_PATTERN, type Page, type PageRequest, type PerSeatValueSource, type PersistAction, type PipelineConfig, type PipelineKind, type PipelineStageConfig, type ProjectionFieldBinding, type ProjectionIdentity, type ProjectionJoin, type ProjectionMapping, type ProjectionRef, REQUIRED_FIELDS, type RecordSource, type RelationshipCandidate, type RelationshipSpec, type RelationshipVia, type RelationshipsMap, type ResolvedMembership, type SourceRow, type SourcedRecord, type StageType, type StepId, type StepProblem, type StepState, type SyncAction, type SyncResult, type SyncStore, type Task, type TaskEntityType, type TaskFilters, type TaskPriority, type TaskStatus, type UpdateCompanyInput, type UpdateContactInput, type UpdateDealInput, type UpdateTaskInput, VENDOR_STATUS, type ValueInterval, authCustom, buildFilterFromDiscriminator, buildRelationships, columnMetaFor, compileEntityView, compileEntityViews, compileProjectionFrom, compileProjectionIdentity, compileProjectionJoins, compileProjectionPreview, compileProjectionSelect, computeDealValue, contactSegmentSchema, coversUniqueKey, defineClivlyConfig, entitiesConfigSchema, evaluateStage, explainEntitiesConfig, fanOutJoins, filterSchema, hasRichMeta, hostOwnedFieldMessage, identityRefs, isClosedStageType, isContactStatus, isHostOwned, isRemovalAction, joinFansOut, mappingsToEntitiesConfig, matchesCondition, missingRequiredFields, primaryKeyColumns, projectionFields, projectionSchema, quoteIdent, reconcile, rejectedCompanyFields, rejectedContactFields, relationshipSchema, relationshipViaSignature, relationshipsSchema, requiredFieldsFor, resolveActions, runSync, slugify, toObjectTypeSlug, validateEntitiesConfig, validateProjection, validateProjectionFilter };
|
package/internal.d.mts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-
|
|
3
|
-
import { t as CRMAdapter } from "./adapter-
|
|
1
|
+
import { A as TaskFilters, B as isContactStatus, C as PipelineConfig, D as StageType, E as RecordSource, F as UpdateDealInput, H as contactSegmentSchema, I as UpdateTaskInput, L as VENDOR_STATUS, M as TaskStatus, N as UpdateCompanyInput, O as Task, P as UpdateContactInput, R as ValueInterval, S as PageRequest, T as PipelineStageConfig, V as ContactSegment, _ as DealStage, a as CompanyFilters, b as OPEN_STAGE_TYPE, c as ContactSource, d as CreateCompanyInput, f as CreateContactInput, g as Deal, h as CrmRole, i as Company, j as TaskPriority, k as TaskEntityType, l as ContactStatus, m as CreateTaskInput, n as ActivityType, o as Contact, p as CreateDealInput, r as CONTACT_STATUSES, s as ContactFilters, t as Activity, u as CreateActivityInput, v as LIFECYCLE_STATUSES, w as PipelineKind, x as Page, y as Note, z as isClosedStageType } from "./types-f-Vcv-pl.mjs";
|
|
2
|
+
import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-CizFv7oU.mjs";
|
|
3
|
+
import { t as CRMAdapter } from "./adapter-DD3K3dCW.mjs";
|
|
4
4
|
import { A as relationshipsSchema, B as identityRefs, D as missingRequiredFields, E as filterSchema, F as ProjectionFieldBinding, I as ProjectionIdentity, L as ProjectionJoin, M as validateEntitiesConfig, N as BASE_REF, O as projectionFields, P as PROJECTION_KEY_PATTERN, R as ProjectionMapping, S as RelationshipsMap, T as entitiesConfigSchema, V as projectionSchema, _ as MATERIALIZING_CONCEPTS, a as ClivlyEntitiesConfig, b as RelationshipSpec, d as CrmConcept, g as FilterValue, h as FilterExpr, i as ClivlyConfigError, j as requiredFieldsFor, k as relationshipSchema, l as ConfigValidationError, m as DiscoveredSchemaTable, n as CRM_CONCEPTS, p as DiscoveredColumnMeta, s as ClivlyEntityConfig, t as CANONICAL_FIELDS, u as ConfigValidationResult, v as MaterializingConcept, w as defineClivlyConfig, x as RelationshipVia, y as REQUIRED_FIELDS, z as ProjectionRef } from "./entity-config-CXpGowQa.mjs";
|
|
5
5
|
import { i as relationshipViaSignature, n as buildFilterFromDiscriminator, r as buildRelationships, t as RelationshipCandidate } from "./mapping-form-KHUlnC7A.mjs";
|
|
6
6
|
import { i as mappingsToEntitiesConfig, t as EntityMappingRow } from "./mappings-config-wAe-p1rG.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-CSNhmCY2.mjs";
|
|
8
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-UNORma7f.mjs";
|
|
9
|
-
import { _ as PerSeatValueSource, a as matchesCondition, c as HostOwnedCompanyField, d as hostOwnedFieldMessage, f as isHostOwned, g as MappedAmountValueSource, h as DealValueSource, i as evaluateStage, l as HostOwnedContactField, m as rejectedContactFields, n as ConditionOp, o as slugify, p as rejectedCompanyFields, r as EvaluableRule, s as toObjectTypeSlug, t as Condition, u as SourcedRecord, v as computeDealValue } from "./internal-
|
|
10
|
-
import { C as StepProblem, S as StepId, _ as IntegrationFacts, a as validateProjection, b as IntegrationStep, c as compileProjectionFrom, d as compileProjectionPreview, f as compileProjectionSelect, g as ConnectionLiveness, h as joinFansOut, i as primaryKeyColumns, l as compileProjectionIdentity, m as fanOutJoins, n as coversUniqueKey, o as validateProjectionFilter, p as quoteIdent, r as hasRichMeta, s as PREVIEW_MAX_ROWS, t as columnMetaFor, u as compileProjectionJoins, v as IntegrationState, w as StepState, x as NextAction, y as IntegrationStatus } from "./index-
|
|
11
|
-
export { type Activity, type ActivityType, BASE_REF, CANONICAL_FIELDS, type CRMAdapter, CRM_CONCEPTS, type ClivlyAuthAdapter, ClivlyConfigError, type ClivlyEntitiesConfig, type ClivlyEntityConfig, type ClivlyUser, type Company, type CompanyFilters, type CompileOptions, type CompiledView, type Condition, type ConditionOp, type ConfigValidationError, type ConfigValidationResult, type ConnectionLiveness, type Contact, type ContactFilters, type ContactSegment, type ContactSource, type ContactStatus, type CreateActivityInput, type CreateCompanyInput, type CreateContactInput, type CreateDealInput, type CreateTaskInput, type CrmConcept, type CrmMembership, type CrmRole, DEFAULT_VIEW_PREFIX, type Deal, type DealStage, type DealValueSource, type DiscoveredColumnMeta, type DiscoveredSchemaTable, type EntityMappingRow, type EntitySyncResult, type EvaluableRule, type ExplainResult, type FilterExpr, type FilterValue, type HostOwnedCompanyField, type HostOwnedContactField, type IntegrationFacts, type IntegrationState, type IntegrationStatus, type IntegrationStep, MATERIALIZING_CONCEPTS, type MappedAmountValueSource, type MaterializingConcept, type MembershipResolver, type MirrorRecord, type NextAction, type Note, OPEN_STAGE_TYPE, PREVIEW_MAX_ROWS, PROJECTION_KEY_PATTERN, type Page, type PageRequest, type PerSeatValueSource, type PersistAction, type PipelineConfig, type PipelineKind, type PipelineStageConfig, type ProjectionFieldBinding, type ProjectionIdentity, type ProjectionJoin, type ProjectionMapping, type ProjectionRef, REQUIRED_FIELDS, type RecordSource, type RelationshipCandidate, type RelationshipSpec, type RelationshipVia, type RelationshipsMap, type ResolvedMembership, type SourceRow, type SourcedRecord, type StageType, type StepId, type StepProblem, type StepState, type SyncAction, type SyncResult, type SyncStore, type Task, type TaskEntityType, type TaskFilters, type TaskPriority, type TaskStatus, type UpdateCompanyInput, type UpdateContactInput, type UpdateDealInput, type UpdateTaskInput, type ValueInterval, authCustom, buildFilterFromDiscriminator, buildRelationships, columnMetaFor, compileEntityView, compileEntityViews, compileProjectionFrom, compileProjectionIdentity, compileProjectionJoins, compileProjectionPreview, compileProjectionSelect, computeDealValue, contactSegmentSchema, coversUniqueKey, defineClivlyConfig, entitiesConfigSchema, evaluateStage, explainEntitiesConfig, fanOutJoins, filterSchema, hasRichMeta, hostOwnedFieldMessage, identityRefs, isClosedStageType, isHostOwned, isRemovalAction, joinFansOut, mappingsToEntitiesConfig, matchesCondition, missingRequiredFields, primaryKeyColumns, projectionFields, projectionSchema, quoteIdent, reconcile, rejectedCompanyFields, rejectedContactFields, relationshipSchema, relationshipViaSignature, relationshipsSchema, requiredFieldsFor, resolveActions, runSync, slugify, toObjectTypeSlug, validateEntitiesConfig, validateProjection, validateProjectionFilter };
|
|
9
|
+
import { _ as PerSeatValueSource, a as matchesCondition, c as HostOwnedCompanyField, d as hostOwnedFieldMessage, f as isHostOwned, g as MappedAmountValueSource, h as DealValueSource, i as evaluateStage, l as HostOwnedContactField, m as rejectedContactFields, n as ConditionOp, o as slugify, p as rejectedCompanyFields, r as EvaluableRule, s as toObjectTypeSlug, t as Condition, u as SourcedRecord, v as computeDealValue } from "./internal-D_2q2BOB.mjs";
|
|
10
|
+
import { C as StepProblem, S as StepId, _ as IntegrationFacts, a as validateProjection, b as IntegrationStep, c as compileProjectionFrom, d as compileProjectionPreview, f as compileProjectionSelect, g as ConnectionLiveness, h as joinFansOut, i as primaryKeyColumns, l as compileProjectionIdentity, m as fanOutJoins, n as coversUniqueKey, o as validateProjectionFilter, p as quoteIdent, r as hasRichMeta, s as PREVIEW_MAX_ROWS, t as columnMetaFor, u as compileProjectionJoins, v as IntegrationState, w as StepState, x as NextAction, y as IntegrationStatus } from "./index-DOoX2GgI.mjs";
|
|
11
|
+
export { type Activity, type ActivityType, BASE_REF, CANONICAL_FIELDS, CONTACT_STATUSES, type CRMAdapter, CRM_CONCEPTS, type ClivlyAuthAdapter, ClivlyConfigError, type ClivlyEntitiesConfig, type ClivlyEntityConfig, type ClivlyUser, type Company, type CompanyFilters, type CompileOptions, type CompiledView, type Condition, type ConditionOp, type ConfigValidationError, type ConfigValidationResult, type ConnectionLiveness, type Contact, type ContactFilters, type ContactSegment, type ContactSource, type ContactStatus, type CreateActivityInput, type CreateCompanyInput, type CreateContactInput, type CreateDealInput, type CreateTaskInput, type CrmConcept, type CrmMembership, type CrmRole, DEFAULT_VIEW_PREFIX, type Deal, type DealStage, type DealValueSource, type DiscoveredColumnMeta, type DiscoveredSchemaTable, type EntityMappingRow, type EntitySyncResult, type EvaluableRule, type ExplainResult, type FilterExpr, type FilterValue, type HostOwnedCompanyField, type HostOwnedContactField, type IntegrationFacts, type IntegrationState, type IntegrationStatus, type IntegrationStep, LIFECYCLE_STATUSES, MATERIALIZING_CONCEPTS, type MappedAmountValueSource, type MaterializingConcept, type MembershipResolver, type MirrorRecord, type NextAction, type Note, OPEN_STAGE_TYPE, PREVIEW_MAX_ROWS, PROJECTION_KEY_PATTERN, type Page, type PageRequest, type PerSeatValueSource, type PersistAction, type PipelineConfig, type PipelineKind, type PipelineStageConfig, type ProjectionFieldBinding, type ProjectionIdentity, type ProjectionJoin, type ProjectionMapping, type ProjectionRef, REQUIRED_FIELDS, type RecordSource, type RelationshipCandidate, type RelationshipSpec, type RelationshipVia, type RelationshipsMap, type ResolvedMembership, type SourceRow, type SourcedRecord, type StageType, type StepId, type StepProblem, type StepState, type SyncAction, type SyncResult, type SyncStore, type Task, type TaskEntityType, type TaskFilters, type TaskPriority, type TaskStatus, type UpdateCompanyInput, type UpdateContactInput, type UpdateDealInput, type UpdateTaskInput, VENDOR_STATUS, type ValueInterval, authCustom, buildFilterFromDiscriminator, buildRelationships, columnMetaFor, compileEntityView, compileEntityViews, compileProjectionFrom, compileProjectionIdentity, compileProjectionJoins, compileProjectionPreview, compileProjectionSelect, computeDealValue, contactSegmentSchema, coversUniqueKey, defineClivlyConfig, entitiesConfigSchema, evaluateStage, explainEntitiesConfig, fanOutJoins, filterSchema, hasRichMeta, hostOwnedFieldMessage, identityRefs, isClosedStageType, isContactStatus, isHostOwned, isRemovalAction, joinFansOut, mappingsToEntitiesConfig, matchesCondition, missingRequiredFields, primaryKeyColumns, projectionFields, projectionSchema, quoteIdent, reconcile, rejectedCompanyFields, rejectedContactFields, relationshipSchema, relationshipViaSignature, relationshipsSchema, requiredFieldsFor, resolveActions, runSync, slugify, toObjectTypeSlug, validateEntitiesConfig, validateProjection, validateProjectionFilter };
|
package/internal.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { i as projectionSchema, n as PROJECTION_KEY_PATTERN, r as identityRefs, t as BASE_REF } from "./projection-CzBI2NL8.mjs";
|
|
2
|
+
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-2joBkLz2.mjs";
|
|
2
3
|
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-CI5CGfaN.mjs";
|
|
3
|
-
import { n as mappingsToEntitiesConfig } from "./mappings-config-Opw7ZM6Y.mjs";
|
|
4
4
|
import { t as authCustom } from "./auth-adapter-u91PByaw.mjs";
|
|
5
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, u as contactSegmentSchema } from "./internal-BAw1MCMV.mjs";
|
|
6
6
|
import { n as buildRelationships, r as relationshipViaSignature, t as buildFilterFromDiscriminator } from "./mapping-form-C7kDMWzp.mjs";
|
|
7
|
-
import {
|
|
8
|
-
import { i as explainEntitiesConfig, n as compileEntityView, r as compileEntityViews, t as DEFAULT_VIEW_PREFIX } from "./view-compiler-
|
|
9
|
-
import { a as resolveActions, i as reconcile, n as isRemovalAction, o as runSync } from "./sync-engine-
|
|
10
|
-
import {
|
|
11
|
-
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, contactSegmentSchema, coversUniqueKey, defineClivlyConfig, entitiesConfigSchema, evaluateStage, explainEntitiesConfig, fanOutJoins, filterSchema, hasRichMeta, hostOwnedFieldMessage, identityRefs, isClosedStageType, isHostOwned, isRemovalAction, joinFansOut, mappingsToEntitiesConfig, matchesCondition, missingRequiredFields, primaryKeyColumns, projectionFields, projectionSchema, quoteIdent, reconcile, rejectedCompanyFields, rejectedContactFields, relationshipSchema, relationshipViaSignature, relationshipsSchema, requiredFieldsFor, resolveActions, runSync, slugify, toObjectTypeSlug, validateEntitiesConfig, validateProjection, validateProjectionFilter };
|
|
7
|
+
import { n as mappingsToEntitiesConfig } from "./mappings-config-Opw7ZM6Y.mjs";
|
|
8
|
+
import { i as explainEntitiesConfig, n as compileEntityView, r as compileEntityViews, t as DEFAULT_VIEW_PREFIX } from "./view-compiler-BhKiezRH.mjs";
|
|
9
|
+
import { a as resolveActions, i as reconcile, n as isRemovalAction, o as runSync } from "./sync-engine-D0mJUeqP.mjs";
|
|
10
|
+
import { a as isClosedStageType, i as VENDOR_STATUS, n as LIFECYCLE_STATUSES, o as isContactStatus, r as OPEN_STAGE_TYPE, t as CONTACT_STATUSES } from "./types-KMH5D5Lg.mjs";
|
|
11
|
+
export { BASE_REF, CANONICAL_FIELDS, CONTACT_STATUSES, CRM_CONCEPTS, ClivlyConfigError, DEFAULT_VIEW_PREFIX, LIFECYCLE_STATUSES, MATERIALIZING_CONCEPTS, OPEN_STAGE_TYPE, PREVIEW_MAX_ROWS, PROJECTION_KEY_PATTERN, REQUIRED_FIELDS, VENDOR_STATUS, authCustom, buildFilterFromDiscriminator, buildRelationships, columnMetaFor, compileEntityView, compileEntityViews, compileProjectionFrom, compileProjectionIdentity, compileProjectionJoins, compileProjectionPreview, compileProjectionSelect, computeDealValue, contactSegmentSchema, coversUniqueKey, defineClivlyConfig, entitiesConfigSchema, evaluateStage, explainEntitiesConfig, fanOutJoins, filterSchema, hasRichMeta, hostOwnedFieldMessage, identityRefs, isClosedStageType, isContactStatus, isHostOwned, isRemovalAction, joinFansOut, mappingsToEntitiesConfig, matchesCondition, missingRequiredFields, primaryKeyColumns, projectionFields, projectionSchema, quoteIdent, reconcile, rejectedCompanyFields, rejectedContactFields, relationshipSchema, relationshipViaSignature, relationshipsSchema, requiredFieldsFor, resolveActions, runSync, slugify, toObjectTypeSlug, validateEntitiesConfig, validateProjection, validateProjectionFilter };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { a as compileProjectionPreview } from "./projection-sql-2joBkLz2.mjs";
|
|
2
|
+
import { n as authExposureErrors, t as ProjectionRefusedError } from "./projection-guard-DOt_nbGn.mjs";
|
|
3
|
+
import { d as postgresDialect } from "./from-sql-BD7gR4bC.mjs";
|
|
4
|
+
import { a as discoverFromSql, i as fromSqlProjection } from "./supabase-contact-3ke1KKUs.mjs";
|
|
5
|
+
import { b as authTableKind } from "./sync-Q0O-2kFI.mjs";
|
|
6
|
+
// ../sdk/src/sql/introspector.ts
|
|
7
|
+
function assertAuthRule(projection) {
|
|
8
|
+
const refused = authExposureErrors(projection);
|
|
9
|
+
if (refused.length > 0) throw new ProjectionRefusedError(refused);
|
|
10
|
+
}
|
|
11
|
+
const PREVIEW_ENTITY = "preview";
|
|
12
|
+
function touchesAuthUsers(projection) {
|
|
13
|
+
return [projection.baseTable, ...projection.joins.map((j) => j.table)].some((table) => authTableKind(table) === "users");
|
|
14
|
+
}
|
|
15
|
+
async function previewThroughSource(executor, projection, limit, basePkColumn = "id") {
|
|
16
|
+
return (await fromSqlProjection(executor, projection, {
|
|
17
|
+
entity: PREVIEW_ENTITY,
|
|
18
|
+
objectType: PREVIEW_ENTITY,
|
|
19
|
+
basePkColumn
|
|
20
|
+
}).fetchPage({
|
|
21
|
+
since: null,
|
|
22
|
+
limit: Math.max(1, Math.min(Math.floor(limit), 50))
|
|
23
|
+
})).map((row) => ({
|
|
24
|
+
id: row.id,
|
|
25
|
+
...Object.fromEntries(Object.entries(projection.fieldBindings).map(([field, binding]) => [field, row[`${binding.from.table}.${binding.from.column}`]]))
|
|
26
|
+
}));
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* The raw-SQL twin of `drizzleIntrospector`, for apps with no ORM.
|
|
30
|
+
* Read-only: every statement here is a SELECT.
|
|
31
|
+
*/
|
|
32
|
+
function sqlIntrospector(executor) {
|
|
33
|
+
return {
|
|
34
|
+
async listTables() {
|
|
35
|
+
return (await discoverFromSql(executor)).map((t) => t.name);
|
|
36
|
+
},
|
|
37
|
+
async sampleSelect(table) {
|
|
38
|
+
await executor.query(`select 1 from ${postgresDialect.quoteTableRef(table)} limit 1`);
|
|
39
|
+
},
|
|
40
|
+
async runProjection(projection, previewOpts) {
|
|
41
|
+
assertAuthRule(projection);
|
|
42
|
+
if (touchesAuthUsers(projection)) return await previewThroughSource(executor, projection, previewOpts.limit, previewOpts.basePkColumn);
|
|
43
|
+
return await executor.query(compileProjectionPreview(projection, previewOpts.limit));
|
|
44
|
+
},
|
|
45
|
+
projectionSource(projection, sourceOpts) {
|
|
46
|
+
assertAuthRule(projection);
|
|
47
|
+
return fromSqlProjection(executor, projection, {
|
|
48
|
+
entity: sourceOpts.objectType,
|
|
49
|
+
objectType: sourceOpts.objectType,
|
|
50
|
+
...sourceOpts.basePkColumn ? { basePkColumn: sourceOpts.basePkColumn } : {}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
export { sqlIntrospector as t };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
const require_projection_sql = require("./projection-sql-DS5sVTY-.cjs");
|
|
2
|
+
const require_projection_guard = require("./projection-guard-C70l5U24.cjs");
|
|
3
|
+
const require_from_sql = require("./from-sql-CFgXkCe2.cjs");
|
|
4
|
+
const require_supabase_contact = require("./supabase-contact-BXQ0nnLq.cjs");
|
|
5
|
+
const require_sync = require("./sync-CdA9dgZz.cjs");
|
|
6
|
+
// ../sdk/src/sql/introspector.ts
|
|
7
|
+
function assertAuthRule(projection) {
|
|
8
|
+
const refused = require_projection_guard.authExposureErrors(projection);
|
|
9
|
+
if (refused.length > 0) throw new require_projection_guard.ProjectionRefusedError(refused);
|
|
10
|
+
}
|
|
11
|
+
const PREVIEW_ENTITY = "preview";
|
|
12
|
+
function touchesAuthUsers(projection) {
|
|
13
|
+
return [projection.baseTable, ...projection.joins.map((j) => j.table)].some((table) => require_sync.authTableKind(table) === "users");
|
|
14
|
+
}
|
|
15
|
+
async function previewThroughSource(executor, projection, limit, basePkColumn = "id") {
|
|
16
|
+
return (await require_supabase_contact.fromSqlProjection(executor, projection, {
|
|
17
|
+
entity: PREVIEW_ENTITY,
|
|
18
|
+
objectType: PREVIEW_ENTITY,
|
|
19
|
+
basePkColumn
|
|
20
|
+
}).fetchPage({
|
|
21
|
+
since: null,
|
|
22
|
+
limit: Math.max(1, Math.min(Math.floor(limit), 50))
|
|
23
|
+
})).map((row) => ({
|
|
24
|
+
id: row.id,
|
|
25
|
+
...Object.fromEntries(Object.entries(projection.fieldBindings).map(([field, binding]) => [field, row[`${binding.from.table}.${binding.from.column}`]]))
|
|
26
|
+
}));
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* The raw-SQL twin of `drizzleIntrospector`, for apps with no ORM.
|
|
30
|
+
* Read-only: every statement here is a SELECT.
|
|
31
|
+
*/
|
|
32
|
+
function sqlIntrospector(executor) {
|
|
33
|
+
return {
|
|
34
|
+
async listTables() {
|
|
35
|
+
return (await require_supabase_contact.discoverFromSql(executor)).map((t) => t.name);
|
|
36
|
+
},
|
|
37
|
+
async sampleSelect(table) {
|
|
38
|
+
await executor.query(`select 1 from ${require_from_sql.postgresDialect.quoteTableRef(table)} limit 1`);
|
|
39
|
+
},
|
|
40
|
+
async runProjection(projection, previewOpts) {
|
|
41
|
+
assertAuthRule(projection);
|
|
42
|
+
if (touchesAuthUsers(projection)) return await previewThroughSource(executor, projection, previewOpts.limit, previewOpts.basePkColumn);
|
|
43
|
+
return await executor.query(require_projection_sql.compileProjectionPreview(projection, previewOpts.limit));
|
|
44
|
+
},
|
|
45
|
+
projectionSource(projection, sourceOpts) {
|
|
46
|
+
assertAuthRule(projection);
|
|
47
|
+
return require_supabase_contact.fromSqlProjection(executor, projection, {
|
|
48
|
+
entity: sourceOpts.objectType,
|
|
49
|
+
objectType: sourceOpts.objectType,
|
|
50
|
+
...sourceOpts.basePkColumn ? { basePkColumn: sourceOpts.basePkColumn } : {}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
Object.defineProperty(exports, "sqlIntrospector", {
|
|
56
|
+
enumerable: true,
|
|
57
|
+
get: function() {
|
|
58
|
+
return sqlIntrospector;
|
|
59
|
+
}
|
|
60
|
+
});
|
package/kysely.cjs
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_from_sql = require("./from-sql-CFgXkCe2.cjs");
|
|
3
|
+
let kysely = require("kysely");
|
|
4
|
+
// ../sdk/src/kysely/executor.ts
|
|
5
|
+
const NOT_POSTGRES_PREFIX = "kyselyExecutor: only Postgres is supported";
|
|
6
|
+
const PROBE_SQL = "select version() as version";
|
|
7
|
+
const POSTGRES_VERSION_PREFIX = "PostgreSQL";
|
|
8
|
+
const FOUND_PREVIEW_LENGTH = 40;
|
|
9
|
+
const checks = /* @__PURE__ */ new WeakMap();
|
|
10
|
+
async function runRaw(db, text, params) {
|
|
11
|
+
return (await db.executeQuery(kysely.CompiledQuery.raw(text, [...params]))).rows;
|
|
12
|
+
}
|
|
13
|
+
async function confirmPostgres(db) {
|
|
14
|
+
let version;
|
|
15
|
+
try {
|
|
16
|
+
const [row] = await runRaw(db, PROBE_SQL, []);
|
|
17
|
+
version = row?.version;
|
|
18
|
+
} catch (cause) {
|
|
19
|
+
const message = cause instanceof Error ? cause.message : String(cause);
|
|
20
|
+
throw new Error(`${NOT_POSTGRES_PREFIX}, and checking the database version failed: ${message}`, { cause });
|
|
21
|
+
}
|
|
22
|
+
if (typeof version === "string" && version.startsWith(POSTGRES_VERSION_PREFIX)) return;
|
|
23
|
+
const found = String(version).slice(0, FOUND_PREVIEW_LENGTH);
|
|
24
|
+
throw new Error(`${NOT_POSTGRES_PREFIX} (found "${found}"); MySQL support is planned.`);
|
|
25
|
+
}
|
|
26
|
+
function ensurePostgres(db, raw) {
|
|
27
|
+
let check = checks.get(db);
|
|
28
|
+
if (!check) {
|
|
29
|
+
check = confirmPostgres(raw);
|
|
30
|
+
checks.set(db, check);
|
|
31
|
+
check.catch(() => checks.delete(db));
|
|
32
|
+
}
|
|
33
|
+
return check;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Adapts a Kysely instance to Clivly's raw-SQL seam, so `fromSql`,
|
|
37
|
+
* `discoverFromSql`, `sqlIntrospector` and `sqlAppIdStore` run through the
|
|
38
|
+
* app's own Kysely connection and its `log` config. Host plugins are bypassed
|
|
39
|
+
* (as Kysely's own `db.introspection` does): a result-rewriting plugin such as
|
|
40
|
+
* `CamelCasePlugin` would rename the column-keyed rows and internal aliases
|
|
41
|
+
* Clivly's SQL relies on. Postgres only: the first query checks `version()`
|
|
42
|
+
* once per Kysely instance.
|
|
43
|
+
*/
|
|
44
|
+
function kyselyExecutor(db) {
|
|
45
|
+
const raw = db.withoutPlugins();
|
|
46
|
+
return { async query(text, params) {
|
|
47
|
+
await ensurePostgres(db, raw);
|
|
48
|
+
return runRaw(raw, text, params ?? []);
|
|
49
|
+
} };
|
|
50
|
+
}
|
|
51
|
+
// ../sdk/src/kysely/from-kysely.ts
|
|
52
|
+
function fromKysely(db, opts) {
|
|
53
|
+
return require_from_sql.fromSql(kyselyExecutor(db), opts);
|
|
54
|
+
}
|
|
55
|
+
exports.fromKysely = fromKysely;
|
|
56
|
+
exports.kyselyExecutor = kyselyExecutor;
|
package/kysely.d.cts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { i as SqlExecutor, t as FromSqlOptions } from "./from-sql-S8dSvU-e.cjs";
|
|
2
|
+
import { b as SyncSource } from "./types-CzL7lUH9.cjs";
|
|
3
|
+
import { Kysely } from "kysely";
|
|
4
|
+
/**
|
|
5
|
+
* The Kysely methods the adapter uses. Structural on purpose: apps often
|
|
6
|
+
* carry two copies of Kysely (better-auth bundles its own), so nothing here
|
|
7
|
+
* may rely on `instanceof` a Kysely class.
|
|
8
|
+
*/
|
|
9
|
+
type AnyKysely = Kysely<any>;
|
|
10
|
+
type KyselyQueryRunner = Pick<AnyKysely, "executeQuery" | "withoutPlugins">;
|
|
11
|
+
/**
|
|
12
|
+
* Adapts a Kysely instance to Clivly's raw-SQL seam, so `fromSql`,
|
|
13
|
+
* `discoverFromSql`, `sqlIntrospector` and `sqlAppIdStore` run through the
|
|
14
|
+
* app's own Kysely connection and its `log` config. Host plugins are bypassed
|
|
15
|
+
* (as Kysely's own `db.introspection` does): a result-rewriting plugin such as
|
|
16
|
+
* `CamelCasePlugin` would rename the column-keyed rows and internal aliases
|
|
17
|
+
* Clivly's SQL relies on. Postgres only: the first query checks `version()`
|
|
18
|
+
* once per Kysely instance.
|
|
19
|
+
*/
|
|
20
|
+
export declare function kyselyExecutor(db: KyselyQueryRunner): SqlExecutor;
|
|
21
|
+
/** A table in Kysely's `DB` type. `Kysely<any>` widens this to `string`. */
|
|
22
|
+
type TableName<DB> = keyof DB & string;
|
|
23
|
+
type ColumnName<DB, T extends TableName<DB>> = keyof DB[T] & string;
|
|
24
|
+
interface FromKyselyOptions<DB, T extends TableName<DB>> extends Omit<FromSqlOptions, "table" | "columns" | "cursorField" | "idField"> {
|
|
25
|
+
/** Columns to read; defaults to every column. Ignored for `auth.users`. */
|
|
26
|
+
columns?: ColumnName<DB, T>[];
|
|
27
|
+
/** Column holding when a row changed; defaults to `updated_at` when present. */
|
|
28
|
+
cursorField?: ColumnName<DB, T>;
|
|
29
|
+
/** Unique tie-breaker column; defaults to the table's single-column PK. */
|
|
30
|
+
idField?: ColumnName<DB, T>;
|
|
31
|
+
/** A table in `DB`, schema-qualified (`"auth.users"`) outside the default schema. */
|
|
32
|
+
table: T;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* The Kysely twin of `fromDrizzle`: a read-only, keyset-paginated `SyncSource`
|
|
36
|
+
* over one Postgres table, with table and column names checked against the
|
|
37
|
+
* app's Kysely `DB` type. `meta` is this table's entry from `discoverFromSql`.
|
|
38
|
+
*/
|
|
39
|
+
export declare function fromKysely<DB, T extends TableName<DB>>(db: Kysely<DB>, opts: FromKyselyOptions<DB, T> & {
|
|
40
|
+
objectType: string;
|
|
41
|
+
}): SyncSource & {
|
|
42
|
+
objectType: string;
|
|
43
|
+
};
|
|
44
|
+
export declare function fromKysely<DB, T extends TableName<DB>>(db: Kysely<DB>, opts: FromKyselyOptions<DB, T>): SyncSource;
|
|
45
|
+
export type { FromKyselyOptions, KyselyQueryRunner };
|
package/kysely.d.mts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { i as SqlExecutor, t as FromSqlOptions } from "./from-sql-CpGP7K3J.mjs";
|
|
2
|
+
import { x as SyncSource } from "./namespace-probe-CUR2zG2l.mjs";
|
|
3
|
+
import { Kysely } from "kysely";
|
|
4
|
+
/**
|
|
5
|
+
* The Kysely methods the adapter uses. Structural on purpose: apps often
|
|
6
|
+
* carry two copies of Kysely (better-auth bundles its own), so nothing here
|
|
7
|
+
* may rely on `instanceof` a Kysely class.
|
|
8
|
+
*/
|
|
9
|
+
type AnyKysely = Kysely<any>;
|
|
10
|
+
type KyselyQueryRunner = Pick<AnyKysely, "executeQuery" | "withoutPlugins">;
|
|
11
|
+
/**
|
|
12
|
+
* Adapts a Kysely instance to Clivly's raw-SQL seam, so `fromSql`,
|
|
13
|
+
* `discoverFromSql`, `sqlIntrospector` and `sqlAppIdStore` run through the
|
|
14
|
+
* app's own Kysely connection and its `log` config. Host plugins are bypassed
|
|
15
|
+
* (as Kysely's own `db.introspection` does): a result-rewriting plugin such as
|
|
16
|
+
* `CamelCasePlugin` would rename the column-keyed rows and internal aliases
|
|
17
|
+
* Clivly's SQL relies on. Postgres only: the first query checks `version()`
|
|
18
|
+
* once per Kysely instance.
|
|
19
|
+
*/
|
|
20
|
+
export declare function kyselyExecutor(db: KyselyQueryRunner): SqlExecutor;
|
|
21
|
+
/** A table in Kysely's `DB` type. `Kysely<any>` widens this to `string`. */
|
|
22
|
+
type TableName<DB> = keyof DB & string;
|
|
23
|
+
type ColumnName<DB, T extends TableName<DB>> = keyof DB[T] & string;
|
|
24
|
+
interface FromKyselyOptions<DB, T extends TableName<DB>> extends Omit<FromSqlOptions, "table" | "columns" | "cursorField" | "idField"> {
|
|
25
|
+
/** Columns to read; defaults to every column. Ignored for `auth.users`. */
|
|
26
|
+
columns?: ColumnName<DB, T>[];
|
|
27
|
+
/** Column holding when a row changed; defaults to `updated_at` when present. */
|
|
28
|
+
cursorField?: ColumnName<DB, T>;
|
|
29
|
+
/** Unique tie-breaker column; defaults to the table's single-column PK. */
|
|
30
|
+
idField?: ColumnName<DB, T>;
|
|
31
|
+
/** A table in `DB`, schema-qualified (`"auth.users"`) outside the default schema. */
|
|
32
|
+
table: T;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* The Kysely twin of `fromDrizzle`: a read-only, keyset-paginated `SyncSource`
|
|
36
|
+
* over one Postgres table, with table and column names checked against the
|
|
37
|
+
* app's Kysely `DB` type. `meta` is this table's entry from `discoverFromSql`.
|
|
38
|
+
*/
|
|
39
|
+
export declare function fromKysely<DB, T extends TableName<DB>>(db: Kysely<DB>, opts: FromKyselyOptions<DB, T> & {
|
|
40
|
+
objectType: string;
|
|
41
|
+
}): SyncSource & {
|
|
42
|
+
objectType: string;
|
|
43
|
+
};
|
|
44
|
+
export declare function fromKysely<DB, T extends TableName<DB>>(db: Kysely<DB>, opts: FromKyselyOptions<DB, T>): SyncSource;
|
|
45
|
+
export type { FromKyselyOptions, KyselyQueryRunner };
|
package/kysely.mjs
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { n as fromSql } from "./from-sql-BD7gR4bC.mjs";
|
|
2
|
+
import { CompiledQuery } from "kysely";
|
|
3
|
+
// ../sdk/src/kysely/executor.ts
|
|
4
|
+
const NOT_POSTGRES_PREFIX = "kyselyExecutor: only Postgres is supported";
|
|
5
|
+
const PROBE_SQL = "select version() as version";
|
|
6
|
+
const POSTGRES_VERSION_PREFIX = "PostgreSQL";
|
|
7
|
+
const FOUND_PREVIEW_LENGTH = 40;
|
|
8
|
+
const checks = /* @__PURE__ */ new WeakMap();
|
|
9
|
+
async function runRaw(db, text, params) {
|
|
10
|
+
return (await db.executeQuery(CompiledQuery.raw(text, [...params]))).rows;
|
|
11
|
+
}
|
|
12
|
+
async function confirmPostgres(db) {
|
|
13
|
+
let version;
|
|
14
|
+
try {
|
|
15
|
+
const [row] = await runRaw(db, PROBE_SQL, []);
|
|
16
|
+
version = row?.version;
|
|
17
|
+
} catch (cause) {
|
|
18
|
+
const message = cause instanceof Error ? cause.message : String(cause);
|
|
19
|
+
throw new Error(`${NOT_POSTGRES_PREFIX}, and checking the database version failed: ${message}`, { cause });
|
|
20
|
+
}
|
|
21
|
+
if (typeof version === "string" && version.startsWith(POSTGRES_VERSION_PREFIX)) return;
|
|
22
|
+
const found = String(version).slice(0, FOUND_PREVIEW_LENGTH);
|
|
23
|
+
throw new Error(`${NOT_POSTGRES_PREFIX} (found "${found}"); MySQL support is planned.`);
|
|
24
|
+
}
|
|
25
|
+
function ensurePostgres(db, raw) {
|
|
26
|
+
let check = checks.get(db);
|
|
27
|
+
if (!check) {
|
|
28
|
+
check = confirmPostgres(raw);
|
|
29
|
+
checks.set(db, check);
|
|
30
|
+
check.catch(() => checks.delete(db));
|
|
31
|
+
}
|
|
32
|
+
return check;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Adapts a Kysely instance to Clivly's raw-SQL seam, so `fromSql`,
|
|
36
|
+
* `discoverFromSql`, `sqlIntrospector` and `sqlAppIdStore` run through the
|
|
37
|
+
* app's own Kysely connection and its `log` config. Host plugins are bypassed
|
|
38
|
+
* (as Kysely's own `db.introspection` does): a result-rewriting plugin such as
|
|
39
|
+
* `CamelCasePlugin` would rename the column-keyed rows and internal aliases
|
|
40
|
+
* Clivly's SQL relies on. Postgres only: the first query checks `version()`
|
|
41
|
+
* once per Kysely instance.
|
|
42
|
+
*/
|
|
43
|
+
function kyselyExecutor(db) {
|
|
44
|
+
const raw = db.withoutPlugins();
|
|
45
|
+
return { async query(text, params) {
|
|
46
|
+
await ensurePostgres(db, raw);
|
|
47
|
+
return runRaw(raw, text, params ?? []);
|
|
48
|
+
} };
|
|
49
|
+
}
|
|
50
|
+
// ../sdk/src/kysely/from-kysely.ts
|
|
51
|
+
function fromKysely(db, opts) {
|
|
52
|
+
return fromSql(kyselyExecutor(db), opts);
|
|
53
|
+
}
|
|
54
|
+
export { fromKysely, kyselyExecutor };
|