clivly 0.9.7 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -9
- package/{adapter-C2eRbBfo.d.cts → adapter-1TN0zohk.d.cts} +1 -1
- package/{adapter-D5LRa-NA.d.mts → adapter-uxirB88i.d.mts} +1 -1
- package/{auth-adapter-Bjgo8LhN.d.mts → auth-adapter-CXTiW3Mb.d.cts} +1 -1
- package/{auth-adapter-DWzgl5Yq.d.cts → auth-adapter-DSuYwv1c.d.mts} +1 -1
- package/auth-better-auth.d.cts +1 -1
- package/auth-better-auth.d.mts +1 -1
- package/auth-clerk.d.cts +1 -1
- package/auth-clerk.d.mts +1 -1
- package/auth-workos.d.cts +1 -1
- package/auth-workos.d.mts +1 -1
- package/core-adapter.d.cts +1 -1
- package/core-adapter.d.mts +1 -1
- package/core-auth-adapter.d.cts +1 -1
- package/core-auth-adapter.d.mts +1 -1
- package/core-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.cjs +1 -0
- package/core-entity-heuristics.d.cts +3 -3
- package/core-entity-heuristics.d.mts +3 -3
- package/core-entity-heuristics.mjs +2 -2
- 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.cjs +4 -0
- package/core-types.d.cts +2 -2
- package/core-types.d.mts +2 -2
- package/core-types.mjs +2 -1
- 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 +17 -15
- package/core.d.cts +10 -10
- package/core.d.mts +10 -10
- package/core.mjs +9 -8
- package/{drizzle-BmDDgAIF.d.mts → drizzle-DTOuGXEn.d.cts} +1 -1
- package/{drizzle-ixVV4pPN.d.cts → drizzle-SGapoly2.d.mts} +1 -1
- package/drizzle.cjs +2 -2
- package/drizzle.d.cts +3 -3
- package/drizzle.d.mts +3 -3
- package/drizzle.mjs +2 -2
- package/{entity-config-C8IIkrmX.mjs → entity-config-C4d3K9CP.mjs} +81 -4
- package/{entity-config-B2RA53nw.d.cts → entity-config-DNQAMbMS.d.cts} +27 -1
- package/{entity-config-B2RA53nw.d.mts → entity-config-DNQAMbMS.d.mts} +27 -1
- package/{entity-config-CPM-Tp-d.cjs → entity-config-DgAe0_YD.cjs} +86 -3
- package/index.cjs +24 -14
- package/index.mjs +24 -14
- package/internal-BAOG5eE4.d.mts +226 -0
- package/internal-BHJ0X3fC.d.cts +226 -0
- package/internal-Bgiimp5D.mjs +144 -0
- package/internal-Cz59xMj8.cjs +167 -0
- package/internal-adapter.d.cts +1 -1
- package/internal-adapter.d.mts +1 -1
- package/internal-auth-adapter.d.cts +1 -1
- package/internal-auth-adapter.d.mts +1 -1
- package/internal-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 +34 -1
- package/internal-entity-heuristics.d.cts +8 -2
- package/internal-entity-heuristics.d.mts +8 -2
- package/internal-entity-heuristics.mjs +34 -2
- 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.cjs +4 -0
- package/internal-types.d.cts +2 -2
- package/internal-types.d.mts +2 -2
- package/internal-types.mjs +2 -1
- 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 +17 -15
- package/internal.d.cts +10 -10
- package/internal.d.mts +10 -10
- package/internal.mjs +9 -8
- package/{mapping-form-DH77BXLv.d.mts → mapping-form-Cc7Ewv8c.d.mts} +1 -1
- package/{mapping-form-J0aU6O7l.d.cts → mapping-form-DwdbYAfR.d.cts} +1 -1
- package/{mappings-config-D9dsonoi.d.mts → mappings-config-Be9D43Np.d.mts} +1 -1
- package/{mappings-config-RQLGx8ub.d.cts → mappings-config-DUt4-9iO.d.cts} +1 -1
- package/{mappings-config-CBwL3FVh.cjs → mappings-config-Dx9ldgdf.cjs} +2 -16
- package/{mappings-config-DUKBe6OS.mjs → mappings-config-MoXBeI8p.mjs} +1 -15
- package/{namespace-probe-BQ4imnV7.d.mts → namespace-probe-9ScMDR0t.d.mts} +1 -1
- package/{namespace-probe-DZIGdvlm.d.cts → namespace-probe-DC4tbmLj.d.cts} +1 -1
- package/package.json +1 -1
- package/{projection-hnPSgH6G.mjs → projection-CSGJbZlZ.mjs} +1 -1
- package/{projection-DEwL-D8R.cjs → projection-Dz6_i1-w.cjs} +0 -6
- package/{projection-sql-iHy-Cx6V.cjs → projection-sql-CbXCKt3s.cjs} +1 -1
- package/{projection-sql-9zzTVGvf.mjs → projection-sql-iHoiYr1R.mjs} +1 -1
- package/{sdk-BL9BCzyD.cjs → sdk-B1vX4kUJ.cjs} +26 -6
- package/{sdk-CubnsyD9.mjs → sdk-D6gX0TXS.mjs} +26 -6
- package/sdk.cjs +2 -2
- package/sdk.d.cts +2 -2
- package/sdk.d.mts +2 -2
- package/sdk.mjs +2 -2
- package/{sync-engine-BLgwLpR6.cjs → sync-engine-B0FT1ax6.cjs} +1 -1
- package/{sync-engine-B_IzoUSx.mjs → sync-engine-CTSIcLlZ.mjs} +1 -1
- package/{sync-engine-BG2O1an2.d.cts → sync-engine-Df0kHAoJ.d.cts} +2 -2
- package/{sync-engine-DgQbrJON.d.mts → sync-engine-ugFacJ6G.d.mts} +2 -2
- package/{types-B1oRXdNP.d.mts → types-Cq1uHUKp.d.cts} +28 -2
- package/{types-B1oRXdNP.d.cts → types-Cq1uHUKp.d.mts} +28 -2
- package/types-Cq5gHCTq.cjs +20 -0
- package/types-YJTkXKzU.mjs +9 -0
- package/{view-compiler-D_6gfXFr.mjs → view-compiler-BzKk8nY3.mjs} +2 -2
- package/{view-compiler-Bo7pqXW3.d.mts → view-compiler-D3zp9S3K.d.cts} +1 -1
- package/{view-compiler-CmEdAMwj.d.cts → view-compiler-TpzDTu7z.d.mts} +1 -1
- package/{view-compiler-BHI5E4QI.cjs → view-compiler-ZKZbd3SK.cjs} +2 -2
- package/vite.d.cts +1 -1
- package/vite.d.mts +1 -1
- package/internal-BLKMnIIZ.cjs +0 -259
- package/internal-BpVh_J77.mjs +0 -212
- package/internal-CvlFk3KC.d.mts +0 -180
- package/internal-DGUOLQAq.d.cts +0 -180
package/internal.d.mts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { C as UpdateDealInput, S 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-
|
|
4
|
-
import { A as BASE_REF, C as defineClivlyConfig, D as relationshipSchema, F as
|
|
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 ValueInterval, C as TaskEntityType, D as UpdateContactInput, E as TaskStatus, O as UpdateDealInput, S as Task, T as TaskPriority, _ as PipelineConfig, a as ContactFilters, b as RecordSource, c as CreateCompanyInput, d as CreateTaskInput, f as CrmRole, g as OPEN_STAGE_TYPE, h as Note, i as Contact, j as isClosedStageType, k as UpdateTaskInput, l as CreateContactInput, m as DealStage, n as ActivityType, o as ContactStatus, p as Deal, r as Company, s as CreateActivityInput, t as Activity, u as CreateDealInput, v as PipelineKind, w as TaskFilters, x as StageType, y as PipelineStageConfig } from "./types-Cq1uHUKp.mjs";
|
|
2
|
+
import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-DSuYwv1c.mjs";
|
|
3
|
+
import { t as CRMAdapter } from "./adapter-uxirB88i.mjs";
|
|
4
|
+
import { A as BASE_REF, C as defineClivlyConfig, D as relationshipSchema, E as projectionFields, F as ProjectionMapping, I as ProjectionRef, L as identityRefs, M as ProjectionFieldBinding, N as ProjectionIdentity, O as relationshipsSchema, P as ProjectionJoin, R as projectionSchema, T as filterSchema, _ as MATERIALIZING_CONCEPTS, a as ClivlyEntitiesConfig, b as RelationshipVia, d as CrmConcept, g as FilterValue, h as FilterExpr, i as ClivlyConfigError, j as PROJECTION_KEY_PATTERN, k as validateEntitiesConfig, 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 entitiesConfigSchema, x as RelationshipsMap, y as RelationshipSpec } from "./entity-config-DNQAMbMS.mjs";
|
|
5
|
+
import { i as relationshipViaSignature, n as buildFilterFromDiscriminator, r as buildRelationships, t as RelationshipCandidate } from "./mapping-form-Cc7Ewv8c.mjs";
|
|
6
|
+
import { i as mappingsToEntitiesConfig, t as EntityMappingRow } from "./mappings-config-Be9D43Np.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-TpzDTu7z.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-ugFacJ6G.mjs";
|
|
9
9
|
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-BK-riZnm.mjs";
|
|
10
|
-
import {
|
|
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 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
|
|
10
|
+
import { S as joinFansOut, _ 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, 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, x as fanOutJoins, y as compileProjectionSelect } from "./internal-BAOG5eE4.mjs";
|
|
11
|
+
export { type Activity, type ActivityType, BASE_REF, CANONICAL_FIELDS, type CRMAdapter, CRM_CONCEPTS, type ClivlyAuthAdapter, ClivlyConfigError, type ClivlyEntitiesConfig, type ClivlyEntityConfig, type ClivlyUser, type Company, type 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, 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, primaryKeyColumns, projectionFields, projectionSchema, quoteIdent, reconcile, relationshipSchema, relationshipViaSignature, relationshipsSchema, runSync, slugify, toObjectTypeSlug, validateEntitiesConfig, validateProjection, validateProjectionFilter };
|
package/internal.mjs
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { _ as
|
|
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-CSGJbZlZ.mjs";
|
|
2
|
+
import { _ as joinFansOut, a as MATERIALIZING_CONCEPTS, b as hasRichMeta, c as entitiesConfigSchema, d as relationshipSchema, f as relationshipsSchema, g as fanOutJoins, h as validateProjectionFilter, i as ClivlyConfigError, l as filterSchema, m as validateProjection, n as CRM_CONCEPTS, p as validateEntitiesConfig, s as defineClivlyConfig, t as CANONICAL_FIELDS, u as projectionFields, v as columnMetaFor, x as primaryKeyColumns, y as coversUniqueKey } from "./entity-config-C4d3K9CP.mjs";
|
|
3
|
+
import { n as mappingsToEntitiesConfig } from "./mappings-config-MoXBeI8p.mjs";
|
|
4
4
|
import { t as authCustom } from "./auth-adapter-gfVDxf3d.mjs";
|
|
5
5
|
import { n as buildRelationships, r as relationshipViaSignature, t as buildFilterFromDiscriminator } from "./mapping-form-DigkuvFc.mjs";
|
|
6
|
-
import { a as
|
|
7
|
-
import {
|
|
8
|
-
import { i as explainEntitiesConfig, n as compileEntityView, r as compileEntityViews, t as DEFAULT_VIEW_PREFIX } from "./view-compiler-
|
|
9
|
-
import { i as runSync, r as reconcile } from "./sync-engine-
|
|
10
|
-
|
|
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-iHoiYr1R.mjs";
|
|
7
|
+
import { i as toObjectTypeSlug, n as matchesCondition, r as slugify, t as evaluateStage } from "./internal-Bgiimp5D.mjs";
|
|
8
|
+
import { i as explainEntitiesConfig, n as compileEntityView, r as compileEntityViews, t as DEFAULT_VIEW_PREFIX } from "./view-compiler-BzKk8nY3.mjs";
|
|
9
|
+
import { i as runSync, r as reconcile } from "./sync-engine-CTSIcLlZ.mjs";
|
|
10
|
+
import { n as isClosedStageType, t as OPEN_STAGE_TYPE } from "./types-YJTkXKzU.mjs";
|
|
11
|
+
export { BASE_REF, CANONICAL_FIELDS, CRM_CONCEPTS, ClivlyConfigError, DEFAULT_VIEW_PREFIX, MATERIALIZING_CONCEPTS, OPEN_STAGE_TYPE, PREVIEW_MAX_ROWS, PROJECTION_KEY_PATTERN, authCustom, buildFilterFromDiscriminator, buildRelationships, columnMetaFor, compileEntityView, compileEntityViews, compileProjectionFrom, compileProjectionIdentity, compileProjectionJoins, compileProjectionPreview, compileProjectionSelect, coversUniqueKey, defineClivlyConfig, entitiesConfigSchema, evaluateStage, explainEntitiesConfig, fanOutJoins, filterSchema, hasRichMeta, identityRefs, isClosedStageType, joinFansOut, mappingsToEntitiesConfig, matchesCondition, primaryKeyColumns, projectionFields, projectionSchema, quoteIdent, reconcile, relationshipSchema, relationshipViaSignature, relationshipsSchema, runSync, slugify, toObjectTypeSlug, validateEntitiesConfig, validateProjection, validateProjectionFilter };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as RelationshipVia, h as FilterExpr, x as RelationshipsMap } from "./entity-config-
|
|
1
|
+
import { b as RelationshipVia, h as FilterExpr, x as RelationshipsMap } from "./entity-config-DNQAMbMS.mjs";
|
|
2
2
|
//#region ../core/src/mapping-form.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* A relationship the mapping UI can offer or has configured, in the shape the
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as RelationshipVia, h as FilterExpr, x as RelationshipsMap } from "./entity-config-
|
|
1
|
+
import { b as RelationshipVia, h as FilterExpr, x as RelationshipsMap } from "./entity-config-DNQAMbMS.cjs";
|
|
2
2
|
//#region ../core/src/mapping-form.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* A relationship the mapping UI can offer or has configured, in the shape the
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { F as ProjectionMapping, a as ClivlyEntitiesConfig, h as FilterExpr, x as RelationshipsMap } from "./entity-config-DNQAMbMS.mjs";
|
|
2
2
|
//#region ../core/src/mappings-config.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* Mappings → Entity Config bridge.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { F as ProjectionMapping, a as ClivlyEntitiesConfig, h as FilterExpr, x as RelationshipsMap } from "./entity-config-DNQAMbMS.cjs";
|
|
2
2
|
//#region ../core/src/mappings-config.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* Mappings → Entity Config bridge.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_entity_config = require("./entity-config-
|
|
1
|
+
const require_entity_config = require("./entity-config-DgAe0_YD.cjs");
|
|
2
2
|
//#region ../core/src/mappings-config.ts
|
|
3
3
|
const RESERVED_FIELD = "id";
|
|
4
4
|
/**
|
|
@@ -47,26 +47,12 @@ function uniquify(base, used) {
|
|
|
47
47
|
used.add(key);
|
|
48
48
|
return key;
|
|
49
49
|
}
|
|
50
|
-
/**
|
|
51
|
-
* A projection's `fields` map, derived mechanically from its bindings.
|
|
52
|
-
*
|
|
53
|
-
* `ClivlyEntityConfig.fields` is required and read by existing consumers, so a
|
|
54
|
-
* projection entity must populate it. The values are ref *tokens*
|
|
55
|
-
* (`"base.full_name"`), never host column names — the compiler reads
|
|
56
|
-
* `projection.fieldBindings`, and `validateEntitiesConfig` skips the legacy
|
|
57
|
-
* column check for projection entities precisely because of this.
|
|
58
|
-
*/
|
|
59
|
-
function projectionFields(projection) {
|
|
60
|
-
const fields = {};
|
|
61
|
-
for (const [field, binding] of Object.entries(projection.fieldBindings)) fields[field] = `${binding.from.table}.${binding.from.column}`;
|
|
62
|
-
return fields;
|
|
63
|
-
}
|
|
64
50
|
function buildEntity(row, refIndex) {
|
|
65
51
|
const entity = {
|
|
66
52
|
concept: row.targetConcept,
|
|
67
53
|
source: row.projection?.baseTable ?? row.sourceTable,
|
|
68
54
|
role: row.role ?? DEFAULT_ROLE,
|
|
69
|
-
fields: row.projection ? projectionFields(row.projection) : canonicalFields(row.targetConcept, row.fieldMap)
|
|
55
|
+
fields: row.projection ? require_entity_config.projectionFields(row.projection) : canonicalFields(row.targetConcept, row.fieldMap)
|
|
70
56
|
};
|
|
71
57
|
if (row.projection) entity.projection = row.projection;
|
|
72
58
|
if (row.targetConcept === "custom" && row.targetObjectTypeId) entity.targetObjectTypeId = row.targetObjectTypeId;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as CANONICAL_FIELDS } from "./entity-config-
|
|
1
|
+
import { t as CANONICAL_FIELDS, u as projectionFields } from "./entity-config-C4d3K9CP.mjs";
|
|
2
2
|
//#region ../core/src/mappings-config.ts
|
|
3
3
|
const RESERVED_FIELD = "id";
|
|
4
4
|
/**
|
|
@@ -47,20 +47,6 @@ function uniquify(base, used) {
|
|
|
47
47
|
used.add(key);
|
|
48
48
|
return key;
|
|
49
49
|
}
|
|
50
|
-
/**
|
|
51
|
-
* A projection's `fields` map, derived mechanically from its bindings.
|
|
52
|
-
*
|
|
53
|
-
* `ClivlyEntityConfig.fields` is required and read by existing consumers, so a
|
|
54
|
-
* projection entity must populate it. The values are ref *tokens*
|
|
55
|
-
* (`"base.full_name"`), never host column names — the compiler reads
|
|
56
|
-
* `projection.fieldBindings`, and `validateEntitiesConfig` skips the legacy
|
|
57
|
-
* column check for projection entities precisely because of this.
|
|
58
|
-
*/
|
|
59
|
-
function projectionFields(projection) {
|
|
60
|
-
const fields = {};
|
|
61
|
-
for (const [field, binding] of Object.entries(projection.fieldBindings)) fields[field] = `${binding.from.table}.${binding.from.column}`;
|
|
62
|
-
return fields;
|
|
63
|
-
}
|
|
64
50
|
function buildEntity(row, refIndex) {
|
|
65
51
|
const entity = {
|
|
66
52
|
concept: row.targetConcept,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { F as ProjectionMapping, a as ClivlyEntitiesConfig } from "./entity-config-DNQAMbMS.mjs";
|
|
2
2
|
import { r as IntegrationState } from "./integration-state-BK-riZnm.mjs";
|
|
3
3
|
//#region ../sdk/src/drizzle-meta.d.ts
|
|
4
4
|
declare const DRIZZLE_META: "__clivly_drizzle_source_meta__";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { F as ProjectionMapping, a as ClivlyEntitiesConfig } from "./entity-config-DNQAMbMS.cjs";
|
|
2
2
|
import { r as IntegrationState } from "./integration-state-BK-riZnm.cjs";
|
|
3
3
|
//#region ../sdk/src/drizzle-meta.d.ts
|
|
4
4
|
declare const DRIZZLE_META: "__clivly_drizzle_source_meta__";
|
package/package.json
CHANGED
|
@@ -4297,4 +4297,4 @@ function identityRefs(identity, basePkColumn) {
|
|
|
4297
4297
|
return identity.parts;
|
|
4298
4298
|
}
|
|
4299
4299
|
//#endregion
|
|
4300
|
-
export {
|
|
4300
|
+
export { _enum as a, literal as c, strictObject as d, string as f, projectionSchema as i, number as l, PROJECTION_KEY_PATTERN as n, array as o, union as p, identityRefs as r, boolean as s, BASE_REF as t, record as u };
|
|
@@ -4303,12 +4303,6 @@ Object.defineProperty(exports, "BASE_REF", {
|
|
|
4303
4303
|
return BASE_REF;
|
|
4304
4304
|
}
|
|
4305
4305
|
});
|
|
4306
|
-
Object.defineProperty(exports, "PROJECTION_KEY_MESSAGE", {
|
|
4307
|
-
enumerable: true,
|
|
4308
|
-
get: function() {
|
|
4309
|
-
return PROJECTION_KEY_MESSAGE;
|
|
4310
|
-
}
|
|
4311
|
-
});
|
|
4312
4306
|
Object.defineProperty(exports, "PROJECTION_KEY_PATTERN", {
|
|
4313
4307
|
enumerable: true,
|
|
4314
4308
|
get: function() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const require_projection = require("./projection-
|
|
2
|
-
const require_entity_config = require("./entity-config-
|
|
3
|
-
const require_mappings_config = require("./mappings-config-
|
|
1
|
+
const require_projection = require("./projection-Dz6_i1-w.cjs");
|
|
2
|
+
const require_entity_config = require("./entity-config-DgAe0_YD.cjs");
|
|
3
|
+
const require_mappings_config = require("./mappings-config-Dx9ldgdf.cjs");
|
|
4
4
|
const require_drizzle_meta = require("./drizzle-meta-Bb1JWYqf.cjs");
|
|
5
5
|
//#region ../sdk/src/deployment-identity.ts
|
|
6
6
|
const MAX_DEPLOYMENT_ID_LENGTH = 128;
|
|
@@ -1646,6 +1646,24 @@ function timingSafeEqual(a, b) {
|
|
|
1646
1646
|
}
|
|
1647
1647
|
const RUN_ID_HEADER = "x-clivly-run-id";
|
|
1648
1648
|
const SIGNATURE_HEADER = "x-clivly-signature";
|
|
1649
|
+
/**
|
|
1650
|
+
* An error the mounted trigger route should answer with a specific HTTP
|
|
1651
|
+
* status, rather than the generic 500 it uses for a genuinely unhandled
|
|
1652
|
+
* error. A fail-safe rejection (e.g. an unresolvable sample `entityKey`) is a
|
|
1653
|
+
* configuration mismatch the caller can fix — surfacing it as "your app
|
|
1654
|
+
* crashed" sends a developer hunting through their own sync handler instead.
|
|
1655
|
+
*/
|
|
1656
|
+
var TriggerRequestError = class extends Error {
|
|
1657
|
+
status;
|
|
1658
|
+
constructor(status, message) {
|
|
1659
|
+
super(message);
|
|
1660
|
+
this.name = new.target.name;
|
|
1661
|
+
this.status = status;
|
|
1662
|
+
}
|
|
1663
|
+
};
|
|
1664
|
+
function triggerErrorStatus(error) {
|
|
1665
|
+
return error instanceof TriggerRequestError ? error.status : 500;
|
|
1666
|
+
}
|
|
1649
1667
|
const SIGNATURE_TOLERANCE_SECONDS = 300;
|
|
1650
1668
|
const SIGNATURE_HEADER_RE = /^t=(\d+),v1=([0-9a-f]+)$/;
|
|
1651
1669
|
const SECONDS_PER_MS = 1e3;
|
|
@@ -1971,7 +1989,7 @@ function createClivlySDK(config) {
|
|
|
1971
1989
|
};
|
|
1972
1990
|
const runSampleSync = async (entityKey, runId) => {
|
|
1973
1991
|
const resolved = resolveSampleSource(config, entityKey);
|
|
1974
|
-
if (!resolved) throw new
|
|
1992
|
+
if (!resolved) throw new TriggerRequestError(400, `Clivly sync: no source is configured for entity "${entityKey}". The dashboard maps this table, but clivly.config declares no matching entity — add it to \`entities\`, or remove the mapping in Integrations → Mapping.`);
|
|
1975
1993
|
lastPushFailure = null;
|
|
1976
1994
|
if (!await syncOne(resolved.source, resolved.path, "delta", resolved.objectType, runId, SAMPLE_BATCH_SIZE, SAMPLE_BATCH_SIZE, false)) throw new Error(describePushFailure([resolved.source.entity]));
|
|
1977
1995
|
};
|
|
@@ -2210,7 +2228,9 @@ function createClivlySDK(config) {
|
|
|
2210
2228
|
const parseTriggerBody = (rawBody) => {
|
|
2211
2229
|
if (!rawBody) return {};
|
|
2212
2230
|
try {
|
|
2213
|
-
|
|
2231
|
+
const parsed = JSON.parse(rawBody);
|
|
2232
|
+
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) return {};
|
|
2233
|
+
return parsed;
|
|
2214
2234
|
} catch {
|
|
2215
2235
|
return {};
|
|
2216
2236
|
}
|
|
@@ -2243,7 +2263,7 @@ function createClivlySDK(config) {
|
|
|
2243
2263
|
ok: false,
|
|
2244
2264
|
runId,
|
|
2245
2265
|
error: error instanceof Error ? error.message : String(error)
|
|
2246
|
-
},
|
|
2266
|
+
}, triggerErrorStatus(error));
|
|
2247
2267
|
}
|
|
2248
2268
|
};
|
|
2249
2269
|
const start = async () => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { t as entitiesToMappings } from "./mappings-config-
|
|
1
|
+
import { i as projectionSchema } from "./projection-CSGJbZlZ.mjs";
|
|
2
|
+
import { m as validateProjection, o as customObjectDeclarations, x as primaryKeyColumns } from "./entity-config-C4d3K9CP.mjs";
|
|
3
|
+
import { t as entitiesToMappings } from "./mappings-config-MoXBeI8p.mjs";
|
|
4
4
|
import { t as DRIZZLE_META } from "./drizzle-meta-D-5k3n0i.mjs";
|
|
5
5
|
//#region ../sdk/src/deployment-identity.ts
|
|
6
6
|
const MAX_DEPLOYMENT_ID_LENGTH = 128;
|
|
@@ -1646,6 +1646,24 @@ function timingSafeEqual(a, b) {
|
|
|
1646
1646
|
}
|
|
1647
1647
|
const RUN_ID_HEADER = "x-clivly-run-id";
|
|
1648
1648
|
const SIGNATURE_HEADER = "x-clivly-signature";
|
|
1649
|
+
/**
|
|
1650
|
+
* An error the mounted trigger route should answer with a specific HTTP
|
|
1651
|
+
* status, rather than the generic 500 it uses for a genuinely unhandled
|
|
1652
|
+
* error. A fail-safe rejection (e.g. an unresolvable sample `entityKey`) is a
|
|
1653
|
+
* configuration mismatch the caller can fix — surfacing it as "your app
|
|
1654
|
+
* crashed" sends a developer hunting through their own sync handler instead.
|
|
1655
|
+
*/
|
|
1656
|
+
var TriggerRequestError = class extends Error {
|
|
1657
|
+
status;
|
|
1658
|
+
constructor(status, message) {
|
|
1659
|
+
super(message);
|
|
1660
|
+
this.name = new.target.name;
|
|
1661
|
+
this.status = status;
|
|
1662
|
+
}
|
|
1663
|
+
};
|
|
1664
|
+
function triggerErrorStatus(error) {
|
|
1665
|
+
return error instanceof TriggerRequestError ? error.status : 500;
|
|
1666
|
+
}
|
|
1649
1667
|
const SIGNATURE_TOLERANCE_SECONDS = 300;
|
|
1650
1668
|
const SIGNATURE_HEADER_RE = /^t=(\d+),v1=([0-9a-f]+)$/;
|
|
1651
1669
|
const SECONDS_PER_MS = 1e3;
|
|
@@ -1971,7 +1989,7 @@ function createClivlySDK(config) {
|
|
|
1971
1989
|
};
|
|
1972
1990
|
const runSampleSync = async (entityKey, runId) => {
|
|
1973
1991
|
const resolved = resolveSampleSource(config, entityKey);
|
|
1974
|
-
if (!resolved) throw new
|
|
1992
|
+
if (!resolved) throw new TriggerRequestError(400, `Clivly sync: no source is configured for entity "${entityKey}". The dashboard maps this table, but clivly.config declares no matching entity — add it to \`entities\`, or remove the mapping in Integrations → Mapping.`);
|
|
1975
1993
|
lastPushFailure = null;
|
|
1976
1994
|
if (!await syncOne(resolved.source, resolved.path, "delta", resolved.objectType, runId, SAMPLE_BATCH_SIZE, SAMPLE_BATCH_SIZE, false)) throw new Error(describePushFailure([resolved.source.entity]));
|
|
1977
1995
|
};
|
|
@@ -2210,7 +2228,9 @@ function createClivlySDK(config) {
|
|
|
2210
2228
|
const parseTriggerBody = (rawBody) => {
|
|
2211
2229
|
if (!rawBody) return {};
|
|
2212
2230
|
try {
|
|
2213
|
-
|
|
2231
|
+
const parsed = JSON.parse(rawBody);
|
|
2232
|
+
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) return {};
|
|
2233
|
+
return parsed;
|
|
2214
2234
|
} catch {
|
|
2215
2235
|
return {};
|
|
2216
2236
|
}
|
|
@@ -2243,7 +2263,7 @@ function createClivlySDK(config) {
|
|
|
2243
2263
|
ok: false,
|
|
2244
2264
|
runId,
|
|
2245
2265
|
error: error instanceof Error ? error.message : String(error)
|
|
2246
|
-
},
|
|
2266
|
+
}, triggerErrorStatus(error));
|
|
2247
2267
|
}
|
|
2248
2268
|
};
|
|
2249
2269
|
const start = async () => {
|
package/sdk.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_entity_config = require("./entity-config-
|
|
3
|
-
const require_sdk = require("./sdk-
|
|
2
|
+
const require_entity_config = require("./entity-config-DgAe0_YD.cjs");
|
|
3
|
+
const require_sdk = require("./sdk-B1vX4kUJ.cjs");
|
|
4
4
|
exports.ClivlyAuthError = require_sdk.ClivlyAuthError;
|
|
5
5
|
exports.ClivlyError = require_sdk.ClivlyError;
|
|
6
6
|
exports.ClivlyNetworkError = require_sdk.ClivlyNetworkError;
|
package/sdk.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as defineClivlyConfig, S as customObjectDeclarations, a as ClivlyEntitiesConfig, f as CustomObjectDeclaration, k as validateEntitiesConfig, l as ConfigValidationError, m as DiscoveredSchemaTable, u as ConfigValidationResult } from "./entity-config-
|
|
2
|
-
import { _ as RemoteProjectionsDescription, a as ClivlyConnectResult, c as ClivlyUser, d as DiscoveredTable, f as DoctorCheck, g as EnsuredObjectTypeResult, h as EnsuredMappingResult, i as ClivlyConnectReason, l as CreateChatSessionHandlerOptions, m as EnsureSchemaResult, n as ChatSessionRequestBody, o as ClivlySDK, p as DoctorReport, r as ChatWidgetVisitor, s as ClivlySDKConfig, u as CursorStore, y as SyncTriggerDescription } from "./namespace-probe-
|
|
1
|
+
import { C as defineClivlyConfig, S as customObjectDeclarations, a as ClivlyEntitiesConfig, f as CustomObjectDeclaration, k as validateEntitiesConfig, l as ConfigValidationError, m as DiscoveredSchemaTable, u as ConfigValidationResult } from "./entity-config-DNQAMbMS.cjs";
|
|
2
|
+
import { _ as RemoteProjectionsDescription, a as ClivlyConnectResult, c as ClivlyUser, d as DiscoveredTable, f as DoctorCheck, g as EnsuredObjectTypeResult, h as EnsuredMappingResult, i as ClivlyConnectReason, l as CreateChatSessionHandlerOptions, m as EnsureSchemaResult, n as ChatSessionRequestBody, o as ClivlySDK, p as DoctorReport, r as ChatWidgetVisitor, s as ClivlySDKConfig, u as CursorStore, y as SyncTriggerDescription } from "./namespace-probe-DC4tbmLj.cjs";
|
|
3
3
|
//#region ../sdk/src/trigger-url.d.ts
|
|
4
4
|
declare function isPlaceholderUrl(value: string): boolean;
|
|
5
5
|
//#endregion
|
package/sdk.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as defineClivlyConfig, S as customObjectDeclarations, a as ClivlyEntitiesConfig, f as CustomObjectDeclaration, k as validateEntitiesConfig, l as ConfigValidationError, m as DiscoveredSchemaTable, u as ConfigValidationResult } from "./entity-config-
|
|
2
|
-
import { _ as RemoteProjectionsDescription, a as ClivlyConnectResult, c as ClivlyUser, d as DiscoveredTable, f as DoctorCheck, g as EnsuredObjectTypeResult, h as EnsuredMappingResult, i as ClivlyConnectReason, l as CreateChatSessionHandlerOptions, m as EnsureSchemaResult, n as ChatSessionRequestBody, o as ClivlySDK, p as DoctorReport, r as ChatWidgetVisitor, s as ClivlySDKConfig, u as CursorStore, y as SyncTriggerDescription } from "./namespace-probe-
|
|
1
|
+
import { C as defineClivlyConfig, S as customObjectDeclarations, a as ClivlyEntitiesConfig, f as CustomObjectDeclaration, k as validateEntitiesConfig, l as ConfigValidationError, m as DiscoveredSchemaTable, u as ConfigValidationResult } from "./entity-config-DNQAMbMS.mjs";
|
|
2
|
+
import { _ as RemoteProjectionsDescription, a as ClivlyConnectResult, c as ClivlyUser, d as DiscoveredTable, f as DoctorCheck, g as EnsuredObjectTypeResult, h as EnsuredMappingResult, i as ClivlyConnectReason, l as CreateChatSessionHandlerOptions, m as EnsureSchemaResult, n as ChatSessionRequestBody, o as ClivlySDK, p as DoctorReport, r as ChatWidgetVisitor, s as ClivlySDKConfig, u as CursorStore, y as SyncTriggerDescription } from "./namespace-probe-9ScMDR0t.mjs";
|
|
3
3
|
//#region ../sdk/src/trigger-url.d.ts
|
|
4
4
|
declare function isPlaceholderUrl(value: string): boolean;
|
|
5
5
|
//#endregion
|
package/sdk.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { o as customObjectDeclarations, p as validateEntitiesConfig, s as defineClivlyConfig } from "./entity-config-
|
|
2
|
-
import { a as ClivlyRateLimitError, i as ClivlyNetworkError, n as ClivlyAuthError, o as createChatSessionHandler, r as ClivlyError, s as isPlaceholderUrl, t as createClivlySDK } from "./sdk-
|
|
1
|
+
import { o as customObjectDeclarations, p as validateEntitiesConfig, s as defineClivlyConfig } from "./entity-config-C4d3K9CP.mjs";
|
|
2
|
+
import { a as ClivlyRateLimitError, i as ClivlyNetworkError, n as ClivlyAuthError, o as createChatSessionHandler, r as ClivlyError, s as isPlaceholderUrl, t as createClivlySDK } from "./sdk-D6gX0TXS.mjs";
|
|
3
3
|
export { ClivlyAuthError, ClivlyError, ClivlyNetworkError, ClivlyRateLimitError, createChatSessionHandler, createClivlySDK, customObjectDeclarations, defineClivlyConfig, isPlaceholderUrl, validateEntitiesConfig };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as ClivlyEntitiesConfig } from "./entity-config-
|
|
2
|
-
import { n as CompiledView, t as CompileOptions } from "./view-compiler-
|
|
1
|
+
import { a as ClivlyEntitiesConfig } from "./entity-config-DNQAMbMS.cjs";
|
|
2
|
+
import { n as CompiledView, t as CompileOptions } from "./view-compiler-D3zp9S3K.cjs";
|
|
3
3
|
//#region ../core/src/sync-engine.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Sync engine (Phase 3) — materializes the read-only entity views into Clivly's
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as ClivlyEntitiesConfig } from "./entity-config-
|
|
2
|
-
import { n as CompiledView, t as CompileOptions } from "./view-compiler-
|
|
1
|
+
import { a as ClivlyEntitiesConfig } from "./entity-config-DNQAMbMS.mjs";
|
|
2
|
+
import { n as CompiledView, t as CompileOptions } from "./view-compiler-TpzDTu7z.mjs";
|
|
3
3
|
//#region ../core/src/sync-engine.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Sync engine (Phase 3) — materializes the read-only entity views into Clivly's
|
|
@@ -1,6 +1,31 @@
|
|
|
1
1
|
//#region ../core/src/types.d.ts
|
|
2
2
|
type ContactStatus = "lead" | "active" | "customer" | "churned";
|
|
3
|
-
type DealStage =
|
|
3
|
+
type DealStage = string;
|
|
4
|
+
type StageType = "open" | "won" | "lost";
|
|
5
|
+
type PipelineKind = "standard" | "recurring";
|
|
6
|
+
type ValueInterval = "one_time" | "monthly" | "annual";
|
|
7
|
+
/** Named once so SQL predicates and UI fallbacks cannot drift apart. */
|
|
8
|
+
declare const OPEN_STAGE_TYPE: "open";
|
|
9
|
+
/** A closed deal is a historical fact: automation never reopens one. */
|
|
10
|
+
declare function isClosedStageType(type: StageType): boolean;
|
|
11
|
+
interface PipelineStageConfig {
|
|
12
|
+
color: string | null;
|
|
13
|
+
id: string;
|
|
14
|
+
key: DealStage;
|
|
15
|
+
label: string;
|
|
16
|
+
position: number;
|
|
17
|
+
type: StageType;
|
|
18
|
+
valueFixed: number | null;
|
|
19
|
+
}
|
|
20
|
+
interface PipelineConfig {
|
|
21
|
+
id: string;
|
|
22
|
+
isDefault: boolean;
|
|
23
|
+
kind: PipelineKind;
|
|
24
|
+
name: string;
|
|
25
|
+
slug: string;
|
|
26
|
+
sourceMappingId: string | null;
|
|
27
|
+
stages: PipelineStageConfig[];
|
|
28
|
+
}
|
|
4
29
|
type TaskStatus = "todo" | "in_progress" | "done" | "cancelled";
|
|
5
30
|
type TaskPriority = "low" | "medium" | "high";
|
|
6
31
|
type TaskEntityType = "contact" | "company" | "deal";
|
|
@@ -103,6 +128,7 @@ interface CreateDealInput {
|
|
|
103
128
|
contactId?: string;
|
|
104
129
|
name: string;
|
|
105
130
|
owner?: string;
|
|
131
|
+
pipelineId?: string;
|
|
106
132
|
stage?: DealStage;
|
|
107
133
|
value?: number;
|
|
108
134
|
}
|
|
@@ -156,4 +182,4 @@ interface TaskFilters {
|
|
|
156
182
|
status?: TaskStatus;
|
|
157
183
|
}
|
|
158
184
|
//#endregion
|
|
159
|
-
export {
|
|
185
|
+
export { ValueInterval as A, TaskEntityType as C, UpdateContactInput as D, TaskStatus as E, UpdateDealInput as O, Task as S, TaskPriority as T, PipelineConfig as _, ContactFilters as a, RecordSource as b, CreateCompanyInput as c, CreateTaskInput as d, CrmRole as f, OPEN_STAGE_TYPE as g, Note as h, Contact as i, isClosedStageType as j, UpdateTaskInput as k, CreateContactInput as l, DealStage as m, ActivityType as n, ContactStatus as o, Deal as p, Company as r, CreateActivityInput as s, Activity as t, CreateDealInput as u, PipelineKind as v, TaskFilters as w, StageType as x, PipelineStageConfig as y };
|
|
@@ -1,6 +1,31 @@
|
|
|
1
1
|
//#region ../core/src/types.d.ts
|
|
2
2
|
type ContactStatus = "lead" | "active" | "customer" | "churned";
|
|
3
|
-
type DealStage =
|
|
3
|
+
type DealStage = string;
|
|
4
|
+
type StageType = "open" | "won" | "lost";
|
|
5
|
+
type PipelineKind = "standard" | "recurring";
|
|
6
|
+
type ValueInterval = "one_time" | "monthly" | "annual";
|
|
7
|
+
/** Named once so SQL predicates and UI fallbacks cannot drift apart. */
|
|
8
|
+
declare const OPEN_STAGE_TYPE: "open";
|
|
9
|
+
/** A closed deal is a historical fact: automation never reopens one. */
|
|
10
|
+
declare function isClosedStageType(type: StageType): boolean;
|
|
11
|
+
interface PipelineStageConfig {
|
|
12
|
+
color: string | null;
|
|
13
|
+
id: string;
|
|
14
|
+
key: DealStage;
|
|
15
|
+
label: string;
|
|
16
|
+
position: number;
|
|
17
|
+
type: StageType;
|
|
18
|
+
valueFixed: number | null;
|
|
19
|
+
}
|
|
20
|
+
interface PipelineConfig {
|
|
21
|
+
id: string;
|
|
22
|
+
isDefault: boolean;
|
|
23
|
+
kind: PipelineKind;
|
|
24
|
+
name: string;
|
|
25
|
+
slug: string;
|
|
26
|
+
sourceMappingId: string | null;
|
|
27
|
+
stages: PipelineStageConfig[];
|
|
28
|
+
}
|
|
4
29
|
type TaskStatus = "todo" | "in_progress" | "done" | "cancelled";
|
|
5
30
|
type TaskPriority = "low" | "medium" | "high";
|
|
6
31
|
type TaskEntityType = "contact" | "company" | "deal";
|
|
@@ -103,6 +128,7 @@ interface CreateDealInput {
|
|
|
103
128
|
contactId?: string;
|
|
104
129
|
name: string;
|
|
105
130
|
owner?: string;
|
|
131
|
+
pipelineId?: string;
|
|
106
132
|
stage?: DealStage;
|
|
107
133
|
value?: number;
|
|
108
134
|
}
|
|
@@ -156,4 +182,4 @@ interface TaskFilters {
|
|
|
156
182
|
status?: TaskStatus;
|
|
157
183
|
}
|
|
158
184
|
//#endregion
|
|
159
|
-
export {
|
|
185
|
+
export { ValueInterval as A, TaskEntityType as C, UpdateContactInput as D, TaskStatus as E, UpdateDealInput as O, Task as S, TaskPriority as T, PipelineConfig as _, ContactFilters as a, RecordSource as b, CreateCompanyInput as c, CreateTaskInput as d, CrmRole as f, OPEN_STAGE_TYPE as g, Note as h, Contact as i, isClosedStageType as j, UpdateTaskInput as k, CreateContactInput as l, DealStage as m, ActivityType as n, ContactStatus as o, Deal as p, Company as r, CreateActivityInput as s, Activity as t, CreateDealInput as u, PipelineKind as v, TaskFilters as w, StageType as x, PipelineStageConfig as y };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//#region ../core/src/types.ts
|
|
2
|
+
/** Named once so SQL predicates and UI fallbacks cannot drift apart. */
|
|
3
|
+
const OPEN_STAGE_TYPE = "open";
|
|
4
|
+
/** A closed deal is a historical fact: automation never reopens one. */
|
|
5
|
+
function isClosedStageType(type) {
|
|
6
|
+
return type === "won" || type === "lost";
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
Object.defineProperty(exports, "OPEN_STAGE_TYPE", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function() {
|
|
12
|
+
return OPEN_STAGE_TYPE;
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
Object.defineProperty(exports, "isClosedStageType", {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function() {
|
|
18
|
+
return isClosedStageType;
|
|
19
|
+
}
|
|
20
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//#region ../core/src/types.ts
|
|
2
|
+
/** Named once so SQL predicates and UI fallbacks cannot drift apart. */
|
|
3
|
+
const OPEN_STAGE_TYPE = "open";
|
|
4
|
+
/** A closed deal is a historical fact: automation never reopens one. */
|
|
5
|
+
function isClosedStageType(type) {
|
|
6
|
+
return type === "won" || type === "lost";
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
export { isClosedStageType as n, OPEN_STAGE_TYPE as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as BASE_REF } from "./projection-
|
|
2
|
-
import { i as compileProjectionJoins, n as compileProjectionFrom, o as compileProjectionSelect, s as quoteIdent } from "./projection-sql-
|
|
1
|
+
import { t as BASE_REF } from "./projection-CSGJbZlZ.mjs";
|
|
2
|
+
import { i as compileProjectionJoins, n as compileProjectionFrom, o as compileProjectionSelect, s as quoteIdent } from "./projection-sql-iHoiYr1R.mjs";
|
|
3
3
|
//#region ../core/src/view-compiler.ts
|
|
4
4
|
/**
|
|
5
5
|
* View compiler (Phase 2) — turns a validated entity config into read-only
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_projection = require("./projection-
|
|
2
|
-
const require_projection_sql = require("./projection-sql-
|
|
1
|
+
const require_projection = require("./projection-Dz6_i1-w.cjs");
|
|
2
|
+
const require_projection_sql = require("./projection-sql-CbXCKt3s.cjs");
|
|
3
3
|
//#region ../core/src/view-compiler.ts
|
|
4
4
|
/**
|
|
5
5
|
* View compiler (Phase 2) — turns a validated entity config into read-only
|
package/vite.d.cts
CHANGED
package/vite.d.mts
CHANGED