clivly 0.11.0-next.0 → 0.12.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-DTMeGGsl.d.cts +101 -0
- package/adapter-DhPBRNpi.d.mts +101 -0
- package/{auth-adapter-B4vVyUiX.d.mts → auth-adapter-C6rDx3XH.d.mts} +1 -1
- package/{auth-adapter-Cvc_sOpY.d.cts → auth-adapter-Csk9KkvI.d.cts} +1 -1
- package/auth-better-auth.d.cts +6 -6
- package/auth-better-auth.d.mts +6 -6
- package/auth-clerk.d.cts +5 -5
- package/auth-clerk.d.mts +5 -5
- package/auth-workos.d.cts +5 -5
- package/auth-workos.d.mts +5 -5
- 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-drizzle.d.cts +1 -1
- package/core-drizzle.d.mts +1 -1
- package/core-entity-config.cjs +1 -1
- package/core-entity-config.d.cts +1 -1
- package/core-entity-config.d.mts +1 -1
- package/core-entity-config.mjs +1 -1
- package/core-entity-heuristics.d.cts +1 -1
- package/core-entity-heuristics.d.mts +1 -1
- package/core-mapping-form.d.cts +1 -1
- package/core-mapping-form.d.mts +1 -1
- package/core-mappings-config.cjs +1 -1
- package/core-mappings-config.d.cts +1 -1
- package/core-mappings-config.d.mts +1 -1
- package/core-mappings-config.mjs +1 -1
- package/core-sync-engine.cjs +1 -1
- package/core-sync-engine.d.cts +1 -1
- package/core-sync-engine.d.mts +1 -1
- package/core-sync-engine.mjs +1 -1
- package/core-types.d.cts +2 -2
- package/core-types.d.mts +2 -2
- package/core-view-compiler.cjs +1 -1
- package/core-view-compiler.d.cts +1 -1
- package/core-view-compiler.d.mts +1 -1
- package/core-view-compiler.mjs +1 -1
- package/core.cjs +12 -7
- package/core.d.cts +10 -10
- package/core.d.mts +10 -10
- package/core.mjs +8 -8
- package/{drizzle-C_0pIDpx.d.mts → drizzle-CiK37zJm.d.cts} +1 -1
- package/{drizzle-D3DcaC2d.d.cts → drizzle-ehVWLSrN.d.mts} +1 -1
- package/drizzle.cjs +3 -2
- package/drizzle.d.cts +24 -9
- package/drizzle.d.mts +24 -9
- package/drizzle.mjs +3 -2
- package/{entity-config-CbS2DGmA.d.cts → entity-config-ApnT5j3X.d.cts} +1734 -16
- package/{entity-config-EZg9BtqD.cjs → entity-config-BI4RYNKL.cjs} +18 -2
- package/{entity-config-CbS2DGmA.d.mts → entity-config-CKcj4-M_.d.mts} +1735 -16
- package/{entity-config-CO0TEwZC.mjs → entity-config-Ccfb2IL9.mjs} +27 -3
- package/index.cjs +15 -11
- package/index.d.cts +10 -11
- package/index.d.mts +10 -11
- package/index.mjs +15 -11
- package/{internal-Cz59xMj8.cjs → internal-BxtvxF7Z.cjs} +136 -0
- package/{internal-B8cq-xP-.d.cts → internal-Cmx7Zevf.d.mts} +104 -2
- 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-drizzle.d.cts +1 -1
- package/internal-drizzle.d.mts +1 -1
- 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 -1
- package/internal-entity-heuristics.cjs +9 -7
- package/internal-entity-heuristics.d.cts +21 -21
- package/internal-entity-heuristics.d.mts +21 -21
- package/internal-entity-heuristics.mjs +9 -7
- package/internal-mapping-form.d.cts +1 -1
- package/internal-mapping-form.d.mts +1 -1
- 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 -1
- 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 -1
- package/internal-types.d.cts +2 -2
- package/internal-types.d.mts +2 -2
- package/{internal-Bgiimp5D.mjs → internal-u0Bks5Gr.mjs} +107 -1
- package/{internal-DEV1NCQc.d.mts → internal-vH5Rlg6Q.d.cts} +104 -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 -1
- package/internal.cjs +12 -7
- package/internal.d.cts +10 -10
- package/internal.d.mts +10 -10
- package/internal.mjs +8 -8
- package/{mapping-form-BBgP1iEf.d.cts → mapping-form-Btn-7gzv.d.mts} +1 -1
- package/{mapping-form-B_vX_kZJ.d.mts → mapping-form-XsLLCqW_.d.cts} +1 -1
- package/{mappings-config-BRP_Dev5.cjs → mappings-config-BCsRLohT.cjs} +2 -1
- package/{mappings-config-fAfUoVuD.mjs → mappings-config-CwQNQ6bA.mjs} +2 -1
- package/{mappings-config-BXdSUl-K.d.mts → mappings-config-D6_oCi2Q.d.mts} +3 -1
- package/{mappings-config-Cvw7RDSb.d.cts → mappings-config-iJzbcUMp.d.cts} +3 -1
- package/{namespace-probe-DC4YsI6m.d.cts → namespace-probe-C5RLl74M.d.cts} +1 -1
- package/{namespace-probe-BWZ7f1fg.d.mts → namespace-probe-CNQKSmxz.d.mts} +1 -1
- package/package.json +1 -1
- package/{projection-Dz6_i1-w.cjs → projection-BELgANG2.cjs} +32 -23
- package/{projection-CSGJbZlZ.mjs → projection-DvNewmI1.mjs} +32 -23
- package/{projection-sql-CbXCKt3s.cjs → projection-sql-DuCtFE9t.cjs} +1 -1
- package/{projection-sql-iHoiYr1R.mjs → projection-sql-DweUaWRc.mjs} +1 -1
- package/{sdk-UCBezLoT.cjs → sdk-BvGSxBQc.cjs} +3 -3
- package/{sdk-CsR4W9QQ.mjs → sdk-C-Pjxj2y.mjs} +3 -3
- package/sdk.cjs +2 -2
- package/sdk.d.cts +10 -10
- package/sdk.d.mts +10 -10
- package/sdk.mjs +2 -2
- package/{sync-engine-BQRApDAG.d.mts → sync-engine--M9EaONC.d.mts} +2 -2
- package/{sync-engine-CTSIcLlZ.mjs → sync-engine-Df2MCs_n.mjs} +1 -1
- package/{sync-engine-B0FT1ax6.cjs → sync-engine-Dwm_KDUS.cjs} +1 -1
- package/{sync-engine-qxbrOEJX.d.cts → sync-engine-V3_UutGv.d.cts} +2 -2
- package/types-B17TWEOL.d.cts +288 -0
- package/types-B17TWEOL.d.mts +288 -0
- package/{view-compiler-BzKk8nY3.mjs → view-compiler-C-6RydKK.mjs} +2 -2
- package/{view-compiler-CdnLqPQx.d.mts → view-compiler-Cq8apvZ4.d.cts} +1 -1
- package/{view-compiler-P4GHpOHt.d.cts → view-compiler-CwKVoK1w.d.mts} +1 -1
- package/{view-compiler-ZKZbd3SK.cjs → view-compiler-xiwm5iar.cjs} +2 -2
- package/vite.d.cts +4 -5
- package/vite.d.mts +4 -5
- package/adapter-BQl13eS3.d.mts +0 -45
- package/adapter-CA8bA6o-.d.cts +0 -45
- package/types-S0N0hqOV.d.cts +0 -188
- package/types-S0N0hqOV.d.mts +0 -188
package/core.cjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_projection = require("./projection-
|
|
3
|
-
const require_entity_config = require("./entity-config-
|
|
4
|
-
const require_mappings_config = require("./mappings-config-
|
|
2
|
+
const require_projection = require("./projection-BELgANG2.cjs");
|
|
3
|
+
const require_entity_config = require("./entity-config-BI4RYNKL.cjs");
|
|
4
|
+
const require_mappings_config = require("./mappings-config-BCsRLohT.cjs");
|
|
5
5
|
const require_auth_adapter = require("./auth-adapter-CiEXcweZ.cjs");
|
|
6
|
+
const require_internal = require("./internal-BxtvxF7Z.cjs");
|
|
6
7
|
const require_mapping_form = require("./mapping-form-BpfON_ME.cjs");
|
|
7
|
-
const require_projection_sql = require("./projection-sql-
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const require_sync_engine = require("./sync-engine-B0FT1ax6.cjs");
|
|
8
|
+
const require_projection_sql = require("./projection-sql-DuCtFE9t.cjs");
|
|
9
|
+
const require_view_compiler = require("./view-compiler-xiwm5iar.cjs");
|
|
10
|
+
const require_sync_engine = require("./sync-engine-Dwm_KDUS.cjs");
|
|
11
11
|
const require_types = require("./types-Cq5gHCTq.cjs");
|
|
12
12
|
//#region src/core.ts
|
|
13
13
|
require("./deprecate-subpath-B9ngvizt.cjs").warnDeprecatedSubpath("clivly/core", "clivly/sdk", "Import \"defineClivlyConfig\" and its config types from \"clivly/sdk\"; import everything else from \"clivly/internal\" (no stability guarantee — see STABILITY.md).");
|
|
@@ -33,6 +33,7 @@ exports.compileProjectionIdentity = require_projection_sql.compileProjectionIden
|
|
|
33
33
|
exports.compileProjectionJoins = require_projection_sql.compileProjectionJoins;
|
|
34
34
|
exports.compileProjectionPreview = require_projection_sql.compileProjectionPreview;
|
|
35
35
|
exports.compileProjectionSelect = require_projection_sql.compileProjectionSelect;
|
|
36
|
+
exports.computeDealValue = require_internal.computeDealValue;
|
|
36
37
|
exports.coversUniqueKey = require_entity_config.coversUniqueKey;
|
|
37
38
|
exports.defineClivlyConfig = require_entity_config.defineClivlyConfig;
|
|
38
39
|
exports.entitiesConfigSchema = require_entity_config.entitiesConfigSchema;
|
|
@@ -41,8 +42,10 @@ exports.explainEntitiesConfig = require_view_compiler.explainEntitiesConfig;
|
|
|
41
42
|
exports.fanOutJoins = require_entity_config.fanOutJoins;
|
|
42
43
|
exports.filterSchema = require_entity_config.filterSchema;
|
|
43
44
|
exports.hasRichMeta = require_entity_config.hasRichMeta;
|
|
45
|
+
exports.hostOwnedFieldMessage = require_internal.hostOwnedFieldMessage;
|
|
44
46
|
exports.identityRefs = require_projection.identityRefs;
|
|
45
47
|
exports.isClosedStageType = require_types.isClosedStageType;
|
|
48
|
+
exports.isHostOwned = require_internal.isHostOwned;
|
|
46
49
|
exports.joinFansOut = require_entity_config.joinFansOut;
|
|
47
50
|
exports.mappingsToEntitiesConfig = require_mappings_config.mappingsToEntitiesConfig;
|
|
48
51
|
exports.matchesCondition = require_internal.matchesCondition;
|
|
@@ -52,6 +55,8 @@ exports.projectionFields = require_entity_config.projectionFields;
|
|
|
52
55
|
exports.projectionSchema = require_projection.projectionSchema;
|
|
53
56
|
exports.quoteIdent = require_projection_sql.quoteIdent;
|
|
54
57
|
exports.reconcile = require_sync_engine.reconcile;
|
|
58
|
+
exports.rejectedCompanyFields = require_internal.rejectedCompanyFields;
|
|
59
|
+
exports.rejectedContactFields = require_internal.rejectedContactFields;
|
|
55
60
|
exports.relationshipSchema = require_entity_config.relationshipSchema;
|
|
56
61
|
exports.relationshipViaSignature = require_mapping_form.relationshipViaSignature;
|
|
57
62
|
exports.relationshipsSchema = require_entity_config.relationshipsSchema;
|
package/core.d.cts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { a as
|
|
3
|
-
import { t as
|
|
4
|
-
import {
|
|
5
|
-
import { i as relationshipViaSignature, n as buildFilterFromDiscriminator, r as buildRelationships, t as RelationshipCandidate } from "./mapping-form-
|
|
6
|
-
import { i as mappingsToEntitiesConfig, t as EntityMappingRow } from "./mappings-config-
|
|
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-
|
|
8
|
-
import { c as SyncResult, f as reconcile, l as SyncStore, n as MirrorRecord, o as SourceRow, p as runSync, r as PersistAction, s as SyncAction, t as EntitySyncResult } from "./sync-engine-
|
|
1
|
+
import { A as relationshipsSchema, B as identityRefs, D as missingRequiredFields, E as filterSchema, F as ProjectionFieldBinding, I as ProjectionIdentity, L as ProjectionJoin, M as validateEntitiesConfig, N as BASE_REF, O as projectionFields, P as PROJECTION_KEY_PATTERN, R as ProjectionMapping, S as RelationshipsMap, T as entitiesConfigSchema, V as projectionSchema, _ as MATERIALIZING_CONCEPTS, a as ClivlyEntitiesConfig, b as RelationshipSpec, d as CrmConcept, g as FilterValue, h as FilterExpr, i as ClivlyConfigError, j as requiredFieldsFor, k as relationshipSchema, l as ConfigValidationError, m as DiscoveredSchemaTable, n as CRM_CONCEPTS, p as DiscoveredColumnMeta, s as ClivlyEntityConfig, t as CANONICAL_FIELDS, u as ConfigValidationResult, v as MaterializingConcept, w as defineClivlyConfig, x as RelationshipVia, y as REQUIRED_FIELDS, z as ProjectionRef } from "./entity-config-ApnT5j3X.cjs";
|
|
2
|
+
import { A as UpdateCompanyInput, C as RecordSource, D as TaskFilters, E as TaskEntityType, F as isClosedStageType, M as UpdateDealInput, N as UpdateTaskInput, O as TaskPriority, P as ValueInterval, S as PipelineStageConfig, T as Task, _ as OPEN_STAGE_TYPE, a as Contact, b as PipelineConfig, c as CreateActivityInput, d as CreateDealInput, f as CreateTaskInput, g as Note, h as DealStage, i as CompanyFilters, j as UpdateContactInput, k as TaskStatus, l as CreateCompanyInput, m as Deal, n as ActivityType, o as ContactFilters, p as CrmRole, r as Company, s as ContactStatus, t as Activity, u as CreateContactInput, v as Page, w as StageType, x as PipelineKind, y as PageRequest } from "./types-B17TWEOL.cjs";
|
|
3
|
+
import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-Csk9KkvI.cjs";
|
|
4
|
+
import { t as CRMAdapter } from "./adapter-DTMeGGsl.cjs";
|
|
5
|
+
import { i as relationshipViaSignature, n as buildFilterFromDiscriminator, r as buildRelationships, t as RelationshipCandidate } from "./mapping-form-XsLLCqW_.cjs";
|
|
6
|
+
import { i as mappingsToEntitiesConfig, t as EntityMappingRow } from "./mappings-config-iJzbcUMp.cjs";
|
|
7
|
+
import { a as compileEntityView, i as ExplainResult, n as CompiledView, o as compileEntityViews, r as DEFAULT_VIEW_PREFIX, s as explainEntitiesConfig, t as CompileOptions } from "./view-compiler-Cq8apvZ4.cjs";
|
|
8
|
+
import { c as SyncResult, f as reconcile, l as SyncStore, n as MirrorRecord, o as SourceRow, p as runSync, r as PersistAction, s as SyncAction, t as EntitySyncResult } from "./sync-engine-V3_UutGv.cjs";
|
|
9
|
+
import { A as PerSeatValueSource, C as HostOwnedCompanyField, D as isHostOwned, E as hostOwnedFieldMessage, O as rejectedCompanyFields, S as joinFansOut, T as SourcedRecord, _ as compileProjectionJoins, a as matchesCondition, b as quoteIdent, c as columnMetaFor, d as primaryKeyColumns, f as validateProjection, g as compileProjectionIdentity, h as compileProjectionFrom, i as evaluateStage, j as computeDealValue, k as rejectedContactFields, l as coversUniqueKey, m as PREVIEW_MAX_ROWS, n as ConditionOp, o as slugify, p as validateProjectionFilter, r as EvaluableRule, s as toObjectTypeSlug, t as Condition, u as hasRichMeta, v as compileProjectionPreview, w as HostOwnedContactField, x as fanOutJoins, y as compileProjectionSelect } from "./internal-vH5Rlg6Q.cjs";
|
|
9
10
|
import { a as IntegrationStep, c as StepProblem, i as IntegrationStatus, l as StepState, n as IntegrationFacts, o as NextAction, r as IntegrationState, s as StepId, t as ConnectionLiveness } from "./integration-state-BA4c0RbD.cjs";
|
|
10
|
-
|
|
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 CompileOptions, type CompiledView, type Condition, type ConditionOp, type ConfigValidationError, type ConfigValidationResult, type ConnectionLiveness, type Contact, type ContactFilters, type ContactStatus, type CreateActivityInput, type CreateCompanyInput, type CreateContactInput, type CreateDealInput, type CreateTaskInput, type CrmConcept, type CrmMembership, type CrmRole, DEFAULT_VIEW_PREFIX, type Deal, type DealStage, type DiscoveredColumnMeta, type DiscoveredSchemaTable, type EntityMappingRow, type EntitySyncResult, type EvaluableRule, type ExplainResult, type FilterExpr, type FilterValue, type IntegrationFacts, type IntegrationState, type IntegrationStatus, type IntegrationStep, MATERIALIZING_CONCEPTS, type MaterializingConcept, type MembershipResolver, type MirrorRecord, type NextAction, type Note, OPEN_STAGE_TYPE, PREVIEW_MAX_ROWS, PROJECTION_KEY_PATTERN, type PersistAction, type PipelineConfig, type PipelineKind, type PipelineStageConfig, type ProjectionFieldBinding, type ProjectionIdentity, type ProjectionJoin, type ProjectionMapping, type ProjectionRef, REQUIRED_FIELDS, type RecordSource, type RelationshipCandidate, type RelationshipSpec, type RelationshipVia, type RelationshipsMap, type SourceRow, type StageType, type StepId, type StepProblem, type StepState, type SyncAction, type SyncResult, type SyncStore, type Task, type TaskEntityType, type TaskFilters, type TaskPriority, type TaskStatus, type UpdateContactInput, type UpdateDealInput, type UpdateTaskInput, type ValueInterval, authCustom, buildFilterFromDiscriminator, buildRelationships, columnMetaFor, compileEntityView, compileEntityViews, compileProjectionFrom, compileProjectionIdentity, compileProjectionJoins, compileProjectionPreview, compileProjectionSelect, coversUniqueKey, defineClivlyConfig, entitiesConfigSchema, evaluateStage, explainEntitiesConfig, fanOutJoins, filterSchema, hasRichMeta, identityRefs, isClosedStageType, joinFansOut, mappingsToEntitiesConfig, matchesCondition, missingRequiredFields, primaryKeyColumns, projectionFields, projectionSchema, quoteIdent, reconcile, relationshipSchema, relationshipViaSignature, relationshipsSchema, requiredFieldsFor, runSync, slugify, toObjectTypeSlug, validateEntitiesConfig, validateProjection, validateProjectionFilter };
|
|
11
|
+
export { type Activity, type ActivityType, BASE_REF, CANONICAL_FIELDS, type CRMAdapter, CRM_CONCEPTS, type ClivlyAuthAdapter, ClivlyConfigError, type ClivlyEntitiesConfig, type ClivlyEntityConfig, type ClivlyUser, type Company, type CompanyFilters, type CompileOptions, type CompiledView, type Condition, type ConditionOp, type ConfigValidationError, type ConfigValidationResult, type ConnectionLiveness, type Contact, type ContactFilters, type ContactStatus, type CreateActivityInput, type CreateCompanyInput, type CreateContactInput, type CreateDealInput, type CreateTaskInput, type CrmConcept, type CrmMembership, type CrmRole, DEFAULT_VIEW_PREFIX, type Deal, type DealStage, type DiscoveredColumnMeta, type DiscoveredSchemaTable, type EntityMappingRow, type EntitySyncResult, type EvaluableRule, type ExplainResult, type FilterExpr, type FilterValue, type HostOwnedCompanyField, type HostOwnedContactField, type IntegrationFacts, type IntegrationState, type IntegrationStatus, type IntegrationStep, MATERIALIZING_CONCEPTS, type MaterializingConcept, type MembershipResolver, type MirrorRecord, type NextAction, type Note, OPEN_STAGE_TYPE, PREVIEW_MAX_ROWS, PROJECTION_KEY_PATTERN, type Page, type PageRequest, type PerSeatValueSource, type PersistAction, type PipelineConfig, type PipelineKind, type PipelineStageConfig, type ProjectionFieldBinding, type ProjectionIdentity, type ProjectionJoin, type ProjectionMapping, type ProjectionRef, REQUIRED_FIELDS, type RecordSource, type RelationshipCandidate, type RelationshipSpec, type RelationshipVia, type RelationshipsMap, type SourceRow, type SourcedRecord, type StageType, type StepId, type StepProblem, type StepState, type SyncAction, type SyncResult, type SyncStore, type Task, type TaskEntityType, type TaskFilters, type TaskPriority, type TaskStatus, type UpdateCompanyInput, type UpdateContactInput, type UpdateDealInput, type UpdateTaskInput, type ValueInterval, authCustom, buildFilterFromDiscriminator, buildRelationships, columnMetaFor, compileEntityView, compileEntityViews, compileProjectionFrom, compileProjectionIdentity, compileProjectionJoins, compileProjectionPreview, compileProjectionSelect, computeDealValue, coversUniqueKey, defineClivlyConfig, entitiesConfigSchema, evaluateStage, explainEntitiesConfig, fanOutJoins, filterSchema, hasRichMeta, hostOwnedFieldMessage, identityRefs, isClosedStageType, isHostOwned, joinFansOut, mappingsToEntitiesConfig, matchesCondition, missingRequiredFields, primaryKeyColumns, projectionFields, projectionSchema, quoteIdent, reconcile, rejectedCompanyFields, rejectedContactFields, relationshipSchema, relationshipViaSignature, relationshipsSchema, requiredFieldsFor, runSync, slugify, toObjectTypeSlug, validateEntitiesConfig, validateProjection, validateProjectionFilter };
|
package/core.d.mts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { a as
|
|
3
|
-
import { t as
|
|
4
|
-
import {
|
|
5
|
-
import { i as relationshipViaSignature, n as buildFilterFromDiscriminator, r as buildRelationships, t as RelationshipCandidate } from "./mapping-form-
|
|
6
|
-
import { i as mappingsToEntitiesConfig, t as EntityMappingRow } from "./mappings-config-
|
|
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-
|
|
8
|
-
import { c as SyncResult, f as reconcile, l as SyncStore, n as MirrorRecord, o as SourceRow, p as runSync, r as PersistAction, s as SyncAction, t as EntitySyncResult } from "./sync-engine
|
|
1
|
+
import { A as relationshipsSchema, B as identityRefs, D as missingRequiredFields, E as filterSchema, F as ProjectionFieldBinding, I as ProjectionIdentity, L as ProjectionJoin, M as validateEntitiesConfig, N as BASE_REF, O as projectionFields, P as PROJECTION_KEY_PATTERN, R as ProjectionMapping, S as RelationshipsMap, T as entitiesConfigSchema, V as projectionSchema, _ as MATERIALIZING_CONCEPTS, a as ClivlyEntitiesConfig, b as RelationshipSpec, d as CrmConcept, g as FilterValue, h as FilterExpr, i as ClivlyConfigError, j as requiredFieldsFor, k as relationshipSchema, l as ConfigValidationError, m as DiscoveredSchemaTable, n as CRM_CONCEPTS, p as DiscoveredColumnMeta, s as ClivlyEntityConfig, t as CANONICAL_FIELDS, u as ConfigValidationResult, v as MaterializingConcept, w as defineClivlyConfig, x as RelationshipVia, y as REQUIRED_FIELDS, z as ProjectionRef } from "./entity-config-CKcj4-M_.mjs";
|
|
2
|
+
import { A as UpdateCompanyInput, C as RecordSource, D as TaskFilters, E as TaskEntityType, F as isClosedStageType, M as UpdateDealInput, N as UpdateTaskInput, O as TaskPriority, P as ValueInterval, S as PipelineStageConfig, T as Task, _ as OPEN_STAGE_TYPE, a as Contact, b as PipelineConfig, c as CreateActivityInput, d as CreateDealInput, f as CreateTaskInput, g as Note, h as DealStage, i as CompanyFilters, j as UpdateContactInput, k as TaskStatus, l as CreateCompanyInput, m as Deal, n as ActivityType, o as ContactFilters, p as CrmRole, r as Company, s as ContactStatus, t as Activity, u as CreateContactInput, v as Page, w as StageType, x as PipelineKind, y as PageRequest } from "./types-B17TWEOL.mjs";
|
|
3
|
+
import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-C6rDx3XH.mjs";
|
|
4
|
+
import { t as CRMAdapter } from "./adapter-DhPBRNpi.mjs";
|
|
5
|
+
import { i as relationshipViaSignature, n as buildFilterFromDiscriminator, r as buildRelationships, t as RelationshipCandidate } from "./mapping-form-Btn-7gzv.mjs";
|
|
6
|
+
import { i as mappingsToEntitiesConfig, t as EntityMappingRow } from "./mappings-config-D6_oCi2Q.mjs";
|
|
7
|
+
import { a as compileEntityView, i as ExplainResult, n as CompiledView, o as compileEntityViews, r as DEFAULT_VIEW_PREFIX, s as explainEntitiesConfig, t as CompileOptions } from "./view-compiler-CwKVoK1w.mjs";
|
|
8
|
+
import { c as SyncResult, f as reconcile, l as SyncStore, n as MirrorRecord, o as SourceRow, p as runSync, r as PersistAction, s as SyncAction, t as EntitySyncResult } from "./sync-engine--M9EaONC.mjs";
|
|
9
|
+
import { A as PerSeatValueSource, C as HostOwnedCompanyField, D as isHostOwned, E as hostOwnedFieldMessage, O as rejectedCompanyFields, S as joinFansOut, T as SourcedRecord, _ as compileProjectionJoins, a as matchesCondition, b as quoteIdent, c as columnMetaFor, d as primaryKeyColumns, f as validateProjection, g as compileProjectionIdentity, h as compileProjectionFrom, i as evaluateStage, j as computeDealValue, k as rejectedContactFields, l as coversUniqueKey, m as PREVIEW_MAX_ROWS, n as ConditionOp, o as slugify, p as validateProjectionFilter, r as EvaluableRule, s as toObjectTypeSlug, t as Condition, u as hasRichMeta, v as compileProjectionPreview, w as HostOwnedContactField, x as fanOutJoins, y as compileProjectionSelect } from "./internal-Cmx7Zevf.mjs";
|
|
9
10
|
import { a as IntegrationStep, c as StepProblem, i as IntegrationStatus, l as StepState, n as IntegrationFacts, o as NextAction, r as IntegrationState, s as StepId, t as ConnectionLiveness } from "./integration-state-BA4c0RbD.mjs";
|
|
10
|
-
|
|
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 CompileOptions, type CompiledView, type Condition, type ConditionOp, type ConfigValidationError, type ConfigValidationResult, type ConnectionLiveness, type Contact, type ContactFilters, type ContactStatus, type CreateActivityInput, type CreateCompanyInput, type CreateContactInput, type CreateDealInput, type CreateTaskInput, type CrmConcept, type CrmMembership, type CrmRole, DEFAULT_VIEW_PREFIX, type Deal, type DealStage, type DiscoveredColumnMeta, type DiscoveredSchemaTable, type EntityMappingRow, type EntitySyncResult, type EvaluableRule, type ExplainResult, type FilterExpr, type FilterValue, type IntegrationFacts, type IntegrationState, type IntegrationStatus, type IntegrationStep, MATERIALIZING_CONCEPTS, type MaterializingConcept, type MembershipResolver, type MirrorRecord, type NextAction, type Note, OPEN_STAGE_TYPE, PREVIEW_MAX_ROWS, PROJECTION_KEY_PATTERN, type PersistAction, type PipelineConfig, type PipelineKind, type PipelineStageConfig, type ProjectionFieldBinding, type ProjectionIdentity, type ProjectionJoin, type ProjectionMapping, type ProjectionRef, REQUIRED_FIELDS, type RecordSource, type RelationshipCandidate, type RelationshipSpec, type RelationshipVia, type RelationshipsMap, type SourceRow, type StageType, type StepId, type StepProblem, type StepState, type SyncAction, type SyncResult, type SyncStore, type Task, type TaskEntityType, type TaskFilters, type TaskPriority, type TaskStatus, type UpdateContactInput, type UpdateDealInput, type UpdateTaskInput, type ValueInterval, authCustom, buildFilterFromDiscriminator, buildRelationships, columnMetaFor, compileEntityView, compileEntityViews, compileProjectionFrom, compileProjectionIdentity, compileProjectionJoins, compileProjectionPreview, compileProjectionSelect, coversUniqueKey, defineClivlyConfig, entitiesConfigSchema, evaluateStage, explainEntitiesConfig, fanOutJoins, filterSchema, hasRichMeta, identityRefs, isClosedStageType, joinFansOut, mappingsToEntitiesConfig, matchesCondition, missingRequiredFields, primaryKeyColumns, projectionFields, projectionSchema, quoteIdent, reconcile, relationshipSchema, relationshipViaSignature, relationshipsSchema, requiredFieldsFor, runSync, slugify, toObjectTypeSlug, validateEntitiesConfig, validateProjection, validateProjectionFilter };
|
|
11
|
+
export { type Activity, type ActivityType, BASE_REF, CANONICAL_FIELDS, type CRMAdapter, CRM_CONCEPTS, type ClivlyAuthAdapter, ClivlyConfigError, type ClivlyEntitiesConfig, type ClivlyEntityConfig, type ClivlyUser, type Company, type CompanyFilters, type CompileOptions, type CompiledView, type Condition, type ConditionOp, type ConfigValidationError, type ConfigValidationResult, type ConnectionLiveness, type Contact, type ContactFilters, type ContactStatus, type CreateActivityInput, type CreateCompanyInput, type CreateContactInput, type CreateDealInput, type CreateTaskInput, type CrmConcept, type CrmMembership, type CrmRole, DEFAULT_VIEW_PREFIX, type Deal, type DealStage, type DiscoveredColumnMeta, type DiscoveredSchemaTable, type EntityMappingRow, type EntitySyncResult, type EvaluableRule, type ExplainResult, type FilterExpr, type FilterValue, type HostOwnedCompanyField, type HostOwnedContactField, type IntegrationFacts, type IntegrationState, type IntegrationStatus, type IntegrationStep, MATERIALIZING_CONCEPTS, type MaterializingConcept, type MembershipResolver, type MirrorRecord, type NextAction, type Note, OPEN_STAGE_TYPE, PREVIEW_MAX_ROWS, PROJECTION_KEY_PATTERN, type Page, type PageRequest, type PerSeatValueSource, type PersistAction, type PipelineConfig, type PipelineKind, type PipelineStageConfig, type ProjectionFieldBinding, type ProjectionIdentity, type ProjectionJoin, type ProjectionMapping, type ProjectionRef, REQUIRED_FIELDS, type RecordSource, type RelationshipCandidate, type RelationshipSpec, type RelationshipVia, type RelationshipsMap, type SourceRow, type SourcedRecord, type StageType, type StepId, type StepProblem, type StepState, type SyncAction, type SyncResult, type SyncStore, type Task, type TaskEntityType, type TaskFilters, type TaskPriority, type TaskStatus, type UpdateCompanyInput, type UpdateContactInput, type UpdateDealInput, type UpdateTaskInput, type ValueInterval, authCustom, buildFilterFromDiscriminator, buildRelationships, columnMetaFor, compileEntityView, compileEntityViews, compileProjectionFrom, compileProjectionIdentity, compileProjectionJoins, compileProjectionPreview, compileProjectionSelect, computeDealValue, coversUniqueKey, defineClivlyConfig, entitiesConfigSchema, evaluateStage, explainEntitiesConfig, fanOutJoins, filterSchema, hasRichMeta, hostOwnedFieldMessage, identityRefs, isClosedStageType, isHostOwned, joinFansOut, mappingsToEntitiesConfig, matchesCondition, missingRequiredFields, primaryKeyColumns, projectionFields, projectionSchema, quoteIdent, reconcile, rejectedCompanyFields, rejectedContactFields, relationshipSchema, relationshipViaSignature, relationshipsSchema, requiredFieldsFor, runSync, slugify, toObjectTypeSlug, validateEntitiesConfig, validateProjection, validateProjectionFilter };
|
package/core.mjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { i as projectionSchema, n as PROJECTION_KEY_PATTERN, r as identityRefs, t as BASE_REF } from "./projection-
|
|
2
|
-
import { C as hasRichMeta, S as coversUniqueKey, _ as validateProjection, a as MATERIALIZING_CONCEPTS, b as joinFansOut, c as defineClivlyConfig, d as missingRequiredFields, f as projectionFields, g as validateEntitiesConfig, h as requiredFieldsFor, i as ClivlyConfigError, l as entitiesConfigSchema, m as relationshipsSchema, n as CRM_CONCEPTS, o as REQUIRED_FIELDS, p as relationshipSchema, t as CANONICAL_FIELDS, u as filterSchema, v as validateProjectionFilter, w as primaryKeyColumns, x as columnMetaFor, y as fanOutJoins } from "./entity-config-
|
|
3
|
-
import { n as mappingsToEntitiesConfig } from "./mappings-config-
|
|
1
|
+
import { i as projectionSchema, n as PROJECTION_KEY_PATTERN, r as identityRefs, t as BASE_REF } from "./projection-DvNewmI1.mjs";
|
|
2
|
+
import { C as hasRichMeta, S as coversUniqueKey, _ as validateProjection, a as MATERIALIZING_CONCEPTS, b as joinFansOut, c as defineClivlyConfig, d as missingRequiredFields, f as projectionFields, g as validateEntitiesConfig, h as requiredFieldsFor, i as ClivlyConfigError, l as entitiesConfigSchema, m as relationshipsSchema, n as CRM_CONCEPTS, o as REQUIRED_FIELDS, p as relationshipSchema, t as CANONICAL_FIELDS, u as filterSchema, v as validateProjectionFilter, w as primaryKeyColumns, x as columnMetaFor, y as fanOutJoins } from "./entity-config-Ccfb2IL9.mjs";
|
|
3
|
+
import { n as mappingsToEntitiesConfig } from "./mappings-config-CwQNQ6bA.mjs";
|
|
4
4
|
import { t as authCustom } from "./auth-adapter-gfVDxf3d.mjs";
|
|
5
|
+
import { a as hostOwnedFieldMessage, c as rejectedContactFields, i as toObjectTypeSlug, l as computeDealValue, n as matchesCondition, o as isHostOwned, r as slugify, s as rejectedCompanyFields, t as evaluateStage } from "./internal-u0Bks5Gr.mjs";
|
|
5
6
|
import { n as buildRelationships, r as relationshipViaSignature, t as buildFilterFromDiscriminator } from "./mapping-form-DigkuvFc.mjs";
|
|
6
|
-
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-
|
|
7
|
-
import { i as
|
|
8
|
-
import { i as
|
|
9
|
-
import { i as runSync, r as reconcile } from "./sync-engine-CTSIcLlZ.mjs";
|
|
7
|
+
import { a as compileProjectionPreview, i as compileProjectionJoins, n as compileProjectionFrom, o as compileProjectionSelect, r as compileProjectionIdentity, s as quoteIdent, t as PREVIEW_MAX_ROWS } from "./projection-sql-DweUaWRc.mjs";
|
|
8
|
+
import { i as explainEntitiesConfig, n as compileEntityView, r as compileEntityViews, t as DEFAULT_VIEW_PREFIX } from "./view-compiler-C-6RydKK.mjs";
|
|
9
|
+
import { i as runSync, r as reconcile } from "./sync-engine-Df2MCs_n.mjs";
|
|
10
10
|
import { n as isClosedStageType, t as OPEN_STAGE_TYPE } from "./types-YJTkXKzU.mjs";
|
|
11
11
|
import { t as warnDeprecatedSubpath } from "./deprecate-subpath-CmvZtCpE.mjs";
|
|
12
12
|
//#region src/core.ts
|
|
13
13
|
warnDeprecatedSubpath("clivly/core", "clivly/sdk", "Import \"defineClivlyConfig\" and its config types from \"clivly/sdk\"; import everything else from \"clivly/internal\" (no stability guarantee — see STABILITY.md).");
|
|
14
14
|
//#endregion
|
|
15
|
-
export { BASE_REF, CANONICAL_FIELDS, CRM_CONCEPTS, ClivlyConfigError, DEFAULT_VIEW_PREFIX, MATERIALIZING_CONCEPTS, OPEN_STAGE_TYPE, PREVIEW_MAX_ROWS, PROJECTION_KEY_PATTERN, REQUIRED_FIELDS, authCustom, buildFilterFromDiscriminator, buildRelationships, columnMetaFor, compileEntityView, compileEntityViews, compileProjectionFrom, compileProjectionIdentity, compileProjectionJoins, compileProjectionPreview, compileProjectionSelect, coversUniqueKey, defineClivlyConfig, entitiesConfigSchema, evaluateStage, explainEntitiesConfig, fanOutJoins, filterSchema, hasRichMeta, identityRefs, isClosedStageType, joinFansOut, mappingsToEntitiesConfig, matchesCondition, missingRequiredFields, primaryKeyColumns, projectionFields, projectionSchema, quoteIdent, reconcile, relationshipSchema, relationshipViaSignature, relationshipsSchema, requiredFieldsFor, runSync, slugify, toObjectTypeSlug, validateEntitiesConfig, validateProjection, validateProjectionFilter };
|
|
15
|
+
export { BASE_REF, CANONICAL_FIELDS, CRM_CONCEPTS, ClivlyConfigError, DEFAULT_VIEW_PREFIX, MATERIALIZING_CONCEPTS, OPEN_STAGE_TYPE, PREVIEW_MAX_ROWS, PROJECTION_KEY_PATTERN, REQUIRED_FIELDS, authCustom, buildFilterFromDiscriminator, buildRelationships, columnMetaFor, compileEntityView, compileEntityViews, compileProjectionFrom, compileProjectionIdentity, compileProjectionJoins, compileProjectionPreview, compileProjectionSelect, computeDealValue, coversUniqueKey, defineClivlyConfig, entitiesConfigSchema, evaluateStage, explainEntitiesConfig, fanOutJoins, filterSchema, hasRichMeta, hostOwnedFieldMessage, identityRefs, isClosedStageType, isHostOwned, joinFansOut, mappingsToEntitiesConfig, matchesCondition, missingRequiredFields, primaryKeyColumns, projectionFields, projectionSchema, quoteIdent, reconcile, rejectedCompanyFields, rejectedContactFields, relationshipSchema, relationshipViaSignature, relationshipsSchema, requiredFieldsFor, runSync, slugify, toObjectTypeSlug, validateEntitiesConfig, validateProjection, validateProjectionFilter };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { m as DiscoveredSchemaTable, p as DiscoveredColumnMeta } from "./entity-config-
|
|
1
|
+
import { m as DiscoveredSchemaTable, p as DiscoveredColumnMeta } from "./entity-config-ApnT5j3X.cjs";
|
|
2
2
|
import { Table } from "drizzle-orm";
|
|
3
3
|
//#region ../core/src/drizzle.d.ts
|
|
4
4
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { m as DiscoveredSchemaTable, p as DiscoveredColumnMeta } from "./entity-config-
|
|
1
|
+
import { m as DiscoveredSchemaTable, p as DiscoveredColumnMeta } from "./entity-config-CKcj4-M_.mjs";
|
|
2
2
|
import { Table } from "drizzle-orm";
|
|
3
3
|
//#region ../core/src/drizzle.d.ts
|
|
4
4
|
/**
|
package/drizzle.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_projection = require("./projection-
|
|
2
|
+
const require_projection = require("./projection-BELgANG2.cjs");
|
|
3
3
|
const require_drizzle_meta = require("./drizzle-meta-Bb1JWYqf.cjs");
|
|
4
|
-
const require_projection_sql = require("./projection-sql-
|
|
4
|
+
const require_projection_sql = require("./projection-sql-DuCtFE9t.cjs");
|
|
5
5
|
const require_drizzle = require("./drizzle-DcB7OfBp.cjs");
|
|
6
6
|
let drizzle_orm = require("drizzle-orm");
|
|
7
7
|
//#region ../sdk/src/drizzle-projection.ts
|
|
@@ -142,6 +142,7 @@ function fromDrizzle(db, table, opts) {
|
|
|
142
142
|
const idColumnName = idColumn.name;
|
|
143
143
|
const source = {
|
|
144
144
|
entity: opts.entity,
|
|
145
|
+
...opts.pushSource === void 0 ? {} : { pushSource: opts.pushSource },
|
|
145
146
|
cursorField: cursorColumnName,
|
|
146
147
|
idField: idColumnName,
|
|
147
148
|
fetchPage: ({ since, limit }) => drizzleDb.select(projection).from(table).where(since ? drizzle_orm.sql`(${cursorColumn}, ${idColumn}) > (${since.time}, ${since.id})` : void 0).orderBy((0, drizzle_orm.asc)(cursorColumn), (0, drizzle_orm.asc)(idColumn)).limit(limit),
|
package/drizzle.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { R as ProjectionMapping, z as ProjectionRef } from "./entity-config-
|
|
2
|
-
import { n as buildUniqueConstraints, r as discoverFromDrizzle } from "./drizzle-
|
|
3
|
-
import { t as NamespaceIntrospector, v as SyncSource } from "./namespace-probe-
|
|
1
|
+
import { R as ProjectionMapping, z as ProjectionRef } from "./entity-config-ApnT5j3X.cjs";
|
|
2
|
+
import { n as buildUniqueConstraints, r as discoverFromDrizzle } from "./drizzle-CiK37zJm.cjs";
|
|
3
|
+
import { t as NamespaceIntrospector, v as SyncSource } from "./namespace-probe-C5RLl74M.cjs";
|
|
4
4
|
import { Table } from "drizzle-orm";
|
|
5
5
|
//#region ../sdk/src/drizzle-projection.d.ts
|
|
6
6
|
/**
|
|
@@ -54,12 +54,12 @@ interface FromDrizzleProjectionOptions {
|
|
|
54
54
|
*/
|
|
55
55
|
objectType?: string;
|
|
56
56
|
}
|
|
57
|
-
declare function fromDrizzleProjection(db: unknown, projection: ProjectionMapping, opts: FromDrizzleProjectionOptions & {
|
|
57
|
+
export declare function fromDrizzleProjection(db: unknown, projection: ProjectionMapping, opts: FromDrizzleProjectionOptions & {
|
|
58
58
|
objectType: string;
|
|
59
59
|
}): SyncSource & {
|
|
60
60
|
objectType: string;
|
|
61
61
|
};
|
|
62
|
-
declare function fromDrizzleProjection(db: unknown, projection: ProjectionMapping, opts: FromDrizzleProjectionOptions): SyncSource;
|
|
62
|
+
export declare function fromDrizzleProjection(db: unknown, projection: ProjectionMapping, opts: FromDrizzleProjectionOptions): SyncSource;
|
|
63
63
|
//#endregion
|
|
64
64
|
//#region ../sdk/src/drizzle.d.ts
|
|
65
65
|
interface DrizzleDb {
|
|
@@ -82,6 +82,21 @@ interface FromDrizzleOptions {
|
|
|
82
82
|
* check and a false explanation.
|
|
83
83
|
*/
|
|
84
84
|
objectType?: string;
|
|
85
|
+
/**
|
|
86
|
+
* The label this source's pushes carry, when it differs from `entity`.
|
|
87
|
+
*
|
|
88
|
+
* `entity` is the CURSOR KEY — two sources sharing it share a cursor, so the
|
|
89
|
+
* first to run advances it and the second silently pushes nothing. The push
|
|
90
|
+
* LABEL is matched against a mapping's `sourceTable`, which is the host
|
|
91
|
+
* table name. Those two requirements conflict whenever one table feeds two
|
|
92
|
+
* concepts: an `organization` table mapped as both a company and a
|
|
93
|
+
* subscription deal needs distinct cursors but the same table name on the
|
|
94
|
+
* wire.
|
|
95
|
+
*
|
|
96
|
+
* `fromDrizzleProjection` stamps this itself for the projection case. This
|
|
97
|
+
* is the same escape hatch for a plain single-table source.
|
|
98
|
+
*/
|
|
99
|
+
pushSource?: string;
|
|
85
100
|
}
|
|
86
101
|
/**
|
|
87
102
|
* Build a `SyncSource` from a Drizzle table, generating the keyset-paginated
|
|
@@ -94,17 +109,17 @@ interface FromDrizzleOptions {
|
|
|
94
109
|
* `drizzle-orm` is an optional peer dependency — installed only when you import
|
|
95
110
|
* `@clivly/sdk/drizzle`.
|
|
96
111
|
*/
|
|
97
|
-
declare function fromDrizzle(db: DrizzleDb, table: Table, opts: FromDrizzleOptions & {
|
|
112
|
+
export declare function fromDrizzle(db: DrizzleDb, table: Table, opts: FromDrizzleOptions & {
|
|
98
113
|
objectType: string;
|
|
99
114
|
}): SyncSource & {
|
|
100
115
|
objectType: string;
|
|
101
116
|
};
|
|
102
|
-
declare function fromDrizzle(db: DrizzleDb, table: Table, opts: FromDrizzleOptions): SyncSource;
|
|
117
|
+
export declare function fromDrizzle(db: DrizzleDb, table: Table, opts: FromDrizzleOptions): SyncSource;
|
|
103
118
|
/**
|
|
104
119
|
* Build a `NamespaceIntrospector` from any Drizzle client that exposes
|
|
105
120
|
* `.execute()`. Reads `information_schema` in the connection's default schema
|
|
106
121
|
* (`current_schema()`), so it reports exactly the tables the app can reach.
|
|
107
122
|
*/
|
|
108
|
-
declare function drizzleIntrospector(db: unknown): NamespaceIntrospector;
|
|
123
|
+
export declare function drizzleIntrospector(db: unknown): NamespaceIntrospector;
|
|
109
124
|
//#endregion
|
|
110
|
-
export { type FromDrizzleProjectionOptions, buildUniqueConstraints, discoverFromDrizzle
|
|
125
|
+
export { type FromDrizzleProjectionOptions, buildUniqueConstraints, discoverFromDrizzle };
|
package/drizzle.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { R as ProjectionMapping, z as ProjectionRef } from "./entity-config-
|
|
2
|
-
import { n as buildUniqueConstraints, r as discoverFromDrizzle } from "./drizzle-
|
|
3
|
-
import { t as NamespaceIntrospector, v as SyncSource } from "./namespace-probe-
|
|
1
|
+
import { R as ProjectionMapping, z as ProjectionRef } from "./entity-config-CKcj4-M_.mjs";
|
|
2
|
+
import { n as buildUniqueConstraints, r as discoverFromDrizzle } from "./drizzle-ehVWLSrN.mjs";
|
|
3
|
+
import { t as NamespaceIntrospector, v as SyncSource } from "./namespace-probe-CNQKSmxz.mjs";
|
|
4
4
|
import { Table } from "drizzle-orm";
|
|
5
5
|
//#region ../sdk/src/drizzle-projection.d.ts
|
|
6
6
|
/**
|
|
@@ -54,12 +54,12 @@ interface FromDrizzleProjectionOptions {
|
|
|
54
54
|
*/
|
|
55
55
|
objectType?: string;
|
|
56
56
|
}
|
|
57
|
-
declare function fromDrizzleProjection(db: unknown, projection: ProjectionMapping, opts: FromDrizzleProjectionOptions & {
|
|
57
|
+
export declare function fromDrizzleProjection(db: unknown, projection: ProjectionMapping, opts: FromDrizzleProjectionOptions & {
|
|
58
58
|
objectType: string;
|
|
59
59
|
}): SyncSource & {
|
|
60
60
|
objectType: string;
|
|
61
61
|
};
|
|
62
|
-
declare function fromDrizzleProjection(db: unknown, projection: ProjectionMapping, opts: FromDrizzleProjectionOptions): SyncSource;
|
|
62
|
+
export declare function fromDrizzleProjection(db: unknown, projection: ProjectionMapping, opts: FromDrizzleProjectionOptions): SyncSource;
|
|
63
63
|
//#endregion
|
|
64
64
|
//#region ../sdk/src/drizzle.d.ts
|
|
65
65
|
interface DrizzleDb {
|
|
@@ -82,6 +82,21 @@ interface FromDrizzleOptions {
|
|
|
82
82
|
* check and a false explanation.
|
|
83
83
|
*/
|
|
84
84
|
objectType?: string;
|
|
85
|
+
/**
|
|
86
|
+
* The label this source's pushes carry, when it differs from `entity`.
|
|
87
|
+
*
|
|
88
|
+
* `entity` is the CURSOR KEY — two sources sharing it share a cursor, so the
|
|
89
|
+
* first to run advances it and the second silently pushes nothing. The push
|
|
90
|
+
* LABEL is matched against a mapping's `sourceTable`, which is the host
|
|
91
|
+
* table name. Those two requirements conflict whenever one table feeds two
|
|
92
|
+
* concepts: an `organization` table mapped as both a company and a
|
|
93
|
+
* subscription deal needs distinct cursors but the same table name on the
|
|
94
|
+
* wire.
|
|
95
|
+
*
|
|
96
|
+
* `fromDrizzleProjection` stamps this itself for the projection case. This
|
|
97
|
+
* is the same escape hatch for a plain single-table source.
|
|
98
|
+
*/
|
|
99
|
+
pushSource?: string;
|
|
85
100
|
}
|
|
86
101
|
/**
|
|
87
102
|
* Build a `SyncSource` from a Drizzle table, generating the keyset-paginated
|
|
@@ -94,17 +109,17 @@ interface FromDrizzleOptions {
|
|
|
94
109
|
* `drizzle-orm` is an optional peer dependency — installed only when you import
|
|
95
110
|
* `@clivly/sdk/drizzle`.
|
|
96
111
|
*/
|
|
97
|
-
declare function fromDrizzle(db: DrizzleDb, table: Table, opts: FromDrizzleOptions & {
|
|
112
|
+
export declare function fromDrizzle(db: DrizzleDb, table: Table, opts: FromDrizzleOptions & {
|
|
98
113
|
objectType: string;
|
|
99
114
|
}): SyncSource & {
|
|
100
115
|
objectType: string;
|
|
101
116
|
};
|
|
102
|
-
declare function fromDrizzle(db: DrizzleDb, table: Table, opts: FromDrizzleOptions): SyncSource;
|
|
117
|
+
export declare function fromDrizzle(db: DrizzleDb, table: Table, opts: FromDrizzleOptions): SyncSource;
|
|
103
118
|
/**
|
|
104
119
|
* Build a `NamespaceIntrospector` from any Drizzle client that exposes
|
|
105
120
|
* `.execute()`. Reads `information_schema` in the connection's default schema
|
|
106
121
|
* (`current_schema()`), so it reports exactly the tables the app can reach.
|
|
107
122
|
*/
|
|
108
|
-
declare function drizzleIntrospector(db: unknown): NamespaceIntrospector;
|
|
123
|
+
export declare function drizzleIntrospector(db: unknown): NamespaceIntrospector;
|
|
109
124
|
//#endregion
|
|
110
|
-
export { type FromDrizzleProjectionOptions, buildUniqueConstraints, discoverFromDrizzle
|
|
125
|
+
export { type FromDrizzleProjectionOptions, buildUniqueConstraints, discoverFromDrizzle };
|
package/drizzle.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as BASE_REF } from "./projection-
|
|
1
|
+
import { t as BASE_REF } from "./projection-DvNewmI1.mjs";
|
|
2
2
|
import { t as DRIZZLE_META } from "./drizzle-meta-D-5k3n0i.mjs";
|
|
3
|
-
import { a as compileProjectionPreview, i as compileProjectionJoins, n as compileProjectionFrom, r as compileProjectionIdentity, s as quoteIdent } from "./projection-sql-
|
|
3
|
+
import { a as compileProjectionPreview, i as compileProjectionJoins, n as compileProjectionFrom, r as compileProjectionIdentity, s as quoteIdent } from "./projection-sql-DweUaWRc.mjs";
|
|
4
4
|
import { n as buildUniqueConstraints, r as discoverFromDrizzle, t as buildColumnsMeta } from "./drizzle-wbcuG-cy.mjs";
|
|
5
5
|
import { asc, getTableColumns, getTableName, sql } from "drizzle-orm";
|
|
6
6
|
//#region ../sdk/src/drizzle-projection.ts
|
|
@@ -141,6 +141,7 @@ function fromDrizzle(db, table, opts) {
|
|
|
141
141
|
const idColumnName = idColumn.name;
|
|
142
142
|
const source = {
|
|
143
143
|
entity: opts.entity,
|
|
144
|
+
...opts.pushSource === void 0 ? {} : { pushSource: opts.pushSource },
|
|
144
145
|
cursorField: cursorColumnName,
|
|
145
146
|
idField: idColumnName,
|
|
146
147
|
fetchPage: ({ since, limit }) => drizzleDb.select(projection).from(table).where(since ? sql`(${cursorColumn}, ${idColumn}) > (${since.time}, ${since.id})` : void 0).orderBy(asc(cursorColumn), asc(idColumn)).limit(limit),
|