clivly 0.11.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-BWrOtOw5.d.mts → adapter-DTMeGGsl.d.cts} +19 -1
- package/{adapter-Bd5HjLYa.d.cts → adapter-DhPBRNpi.d.mts} +19 -1
- package/{auth-adapter-C3BQpc-q.d.cts → auth-adapter-C6rDx3XH.d.mts} +1 -1
- package/{auth-adapter-D54ajbl7.d.mts → auth-adapter-Csk9KkvI.d.cts} +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-types.d.cts +2 -2
- package/core-types.d.mts +2 -2
- package/core.cjs +2 -1
- package/core.d.cts +5 -5
- package/core.d.mts +5 -5
- package/core.mjs +2 -2
- package/drizzle.cjs +1 -0
- package/drizzle.d.cts +15 -0
- package/drizzle.d.mts +15 -0
- package/drizzle.mjs +1 -0
- package/{internal-CRIgf9jS.cjs → internal-BxtvxF7Z.cjs} +34 -0
- package/{internal-Bjpq7S2G.d.mts → internal-Cmx7Zevf.d.mts} +36 -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-types.d.cts +2 -2
- package/internal-types.d.mts +2 -2
- package/{internal-v6P9MZY1.mjs → internal-u0Bks5Gr.mjs} +29 -1
- package/{internal-D9kqkhPs.d.cts → internal-vH5Rlg6Q.d.cts} +36 -1
- package/internal.cjs +2 -1
- package/internal.d.cts +5 -5
- package/internal.d.mts +5 -5
- package/internal.mjs +2 -2
- package/package.json +1 -1
- package/{types-D08UzDqe.d.mts → types-B17TWEOL.d.cts} +37 -1
- package/{types-D08UzDqe.d.cts → types-B17TWEOL.d.mts} +37 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { A as UpdateCompanyInput, C as RecordSource, D as TaskFilters, M as UpdateDealInput, N as UpdateTaskInput, T as Task, a as Contact, c as CreateActivityInput, d as CreateDealInput, f as CreateTaskInput, i as CompanyFilters, j as UpdateContactInput, l as CreateCompanyInput, m as Deal, o as ContactFilters, r as Company, t as Activity, u as CreateContactInput, v as Page, y as PageRequest } from "./types-B17TWEOL.cjs";
|
|
2
2
|
//#region ../core/src/adapter.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* The contract every ORM implementation fulfils. `packages/drizzle` is the first
|
|
@@ -58,6 +58,24 @@ interface CRMAdapter {
|
|
|
58
58
|
source?: RecordSource;
|
|
59
59
|
}): Promise<Deal[]>;
|
|
60
60
|
getTasks(orgId: string, filters?: TaskFilters): Promise<Task[]>;
|
|
61
|
+
/**
|
|
62
|
+
* One page of companies, newest first.
|
|
63
|
+
*
|
|
64
|
+
* Separate from `getCompanies` rather than a `limit` on `CompanyFilters`,
|
|
65
|
+
* and that is the whole point: an optional field on a shared filter type is
|
|
66
|
+
* silently inheritable, and the callers that must never inherit it are the
|
|
67
|
+
* ones where truncation corrupts data rather than merely hiding rows.
|
|
68
|
+
* `importContacts` builds its dedup set from the unpaged read — a truncated
|
|
69
|
+
* set resurrects a contact archived as a duplicate. A distinct method makes
|
|
70
|
+
* "this call is paginated" a decision at every call site.
|
|
71
|
+
*/
|
|
72
|
+
listCompaniesPage(orgId: string, filters?: CompanyFilters, page?: PageRequest): Promise<Page<Company>>;
|
|
73
|
+
/** One page of contacts, newest first. See {@link CRMAdapter.listCompaniesPage}. */
|
|
74
|
+
listContactsPage(orgId: string, filters?: ContactFilters, page?: PageRequest): Promise<Page<Contact>>;
|
|
75
|
+
/** One page of deals, newest first. See {@link CRMAdapter.listCompaniesPage}. */
|
|
76
|
+
listDealsPage(orgId: string, filters?: {
|
|
77
|
+
source?: RecordSource;
|
|
78
|
+
}, page?: PageRequest): Promise<Page<Deal>>;
|
|
61
79
|
/**
|
|
62
80
|
* Move a deal to `stage` and reorder it directly after `afterId` (null = top
|
|
63
81
|
* of the column). The adapter computes the fractional `position` from the
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { A as UpdateCompanyInput, C as RecordSource, D as TaskFilters, M as UpdateDealInput, N as UpdateTaskInput, T as Task, a as Contact, c as CreateActivityInput, d as CreateDealInput, f as CreateTaskInput, i as CompanyFilters, j as UpdateContactInput, l as CreateCompanyInput, m as Deal, o as ContactFilters, r as Company, t as Activity, u as CreateContactInput, v as Page, y as PageRequest } from "./types-B17TWEOL.mjs";
|
|
2
2
|
//#region ../core/src/adapter.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* The contract every ORM implementation fulfils. `packages/drizzle` is the first
|
|
@@ -58,6 +58,24 @@ interface CRMAdapter {
|
|
|
58
58
|
source?: RecordSource;
|
|
59
59
|
}): Promise<Deal[]>;
|
|
60
60
|
getTasks(orgId: string, filters?: TaskFilters): Promise<Task[]>;
|
|
61
|
+
/**
|
|
62
|
+
* One page of companies, newest first.
|
|
63
|
+
*
|
|
64
|
+
* Separate from `getCompanies` rather than a `limit` on `CompanyFilters`,
|
|
65
|
+
* and that is the whole point: an optional field on a shared filter type is
|
|
66
|
+
* silently inheritable, and the callers that must never inherit it are the
|
|
67
|
+
* ones where truncation corrupts data rather than merely hiding rows.
|
|
68
|
+
* `importContacts` builds its dedup set from the unpaged read — a truncated
|
|
69
|
+
* set resurrects a contact archived as a duplicate. A distinct method makes
|
|
70
|
+
* "this call is paginated" a decision at every call site.
|
|
71
|
+
*/
|
|
72
|
+
listCompaniesPage(orgId: string, filters?: CompanyFilters, page?: PageRequest): Promise<Page<Company>>;
|
|
73
|
+
/** One page of contacts, newest first. See {@link CRMAdapter.listCompaniesPage}. */
|
|
74
|
+
listContactsPage(orgId: string, filters?: ContactFilters, page?: PageRequest): Promise<Page<Contact>>;
|
|
75
|
+
/** One page of deals, newest first. See {@link CRMAdapter.listCompaniesPage}. */
|
|
76
|
+
listDealsPage(orgId: string, filters?: {
|
|
77
|
+
source?: RecordSource;
|
|
78
|
+
}, page?: PageRequest): Promise<Page<Deal>>;
|
|
61
79
|
/**
|
|
62
80
|
* Move a deal to `stage` and reorder it directly after `afterId` (null = top
|
|
63
81
|
* of the column). The adapter computes the fractional `position` from the
|
package/auth-better-auth.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as ClivlyUser, t as ClivlyAuthAdapter } from "./auth-adapter-
|
|
1
|
+
import { n as ClivlyUser, t as ClivlyAuthAdapter } from "./auth-adapter-Csk9KkvI.cjs";
|
|
2
2
|
//#region ../auth-better-auth/src/map.d.ts
|
|
3
3
|
interface BetterAuthLikeUser {
|
|
4
4
|
email?: string | null;
|
package/auth-better-auth.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as ClivlyUser, t as ClivlyAuthAdapter } from "./auth-adapter-
|
|
1
|
+
import { n as ClivlyUser, t as ClivlyAuthAdapter } from "./auth-adapter-C6rDx3XH.mjs";
|
|
2
2
|
//#region ../auth-better-auth/src/map.d.ts
|
|
3
3
|
interface BetterAuthLikeUser {
|
|
4
4
|
email?: string | null;
|
package/auth-clerk.d.cts
CHANGED
package/auth-clerk.d.mts
CHANGED
package/auth-workos.d.cts
CHANGED
package/auth-workos.d.mts
CHANGED
package/core-adapter.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as CRMAdapter } from "./adapter-
|
|
1
|
+
import { t as CRMAdapter } from "./adapter-DTMeGGsl.cjs";
|
|
2
2
|
export { CRMAdapter };
|
package/core-adapter.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as CRMAdapter } from "./adapter-
|
|
1
|
+
import { t as CRMAdapter } from "./adapter-DhPBRNpi.mjs";
|
|
2
2
|
export { CRMAdapter };
|
package/core-auth-adapter.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-
|
|
1
|
+
import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-Csk9KkvI.cjs";
|
|
2
2
|
export { ClivlyAuthAdapter, ClivlyUser, CrmMembership, MembershipResolver, authCustom };
|
package/core-auth-adapter.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-
|
|
1
|
+
import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-C6rDx3XH.mjs";
|
|
2
2
|
export { ClivlyAuthAdapter, ClivlyUser, CrmMembership, MembershipResolver, authCustom };
|
package/core-types.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
export { Activity, ActivityType, Company, CompanyFilters, Contact, ContactFilters, ContactStatus, CreateActivityInput, CreateCompanyInput, CreateContactInput, CreateDealInput, CreateTaskInput, CrmRole, Deal, DealStage, Note, OPEN_STAGE_TYPE, PipelineConfig, PipelineKind, PipelineStageConfig, RecordSource, StageType, Task, TaskEntityType, TaskFilters, TaskPriority, TaskStatus, UpdateCompanyInput, UpdateContactInput, UpdateDealInput, UpdateTaskInput, ValueInterval, isClosedStageType };
|
|
1
|
+
import { A as UpdateCompanyInput, C as RecordSource, D as TaskFilters, E as TaskEntityType, F as isClosedStageType, M as UpdateDealInput, N as UpdateTaskInput, O as TaskPriority, P as ValueInterval, S as PipelineStageConfig, T as Task, _ as OPEN_STAGE_TYPE, a as Contact, b as PipelineConfig, c as CreateActivityInput, d as CreateDealInput, f as CreateTaskInput, g as Note, h as DealStage, i as CompanyFilters, j as UpdateContactInput, k as TaskStatus, l as CreateCompanyInput, m as Deal, n as ActivityType, o as ContactFilters, p as CrmRole, r as Company, s as ContactStatus, t as Activity, u as CreateContactInput, v as Page, w as StageType, x as PipelineKind, y as PageRequest } from "./types-B17TWEOL.cjs";
|
|
2
|
+
export { Activity, ActivityType, Company, CompanyFilters, Contact, ContactFilters, ContactStatus, CreateActivityInput, CreateCompanyInput, CreateContactInput, CreateDealInput, CreateTaskInput, CrmRole, Deal, DealStage, Note, OPEN_STAGE_TYPE, Page, PageRequest, PipelineConfig, PipelineKind, PipelineStageConfig, RecordSource, StageType, Task, TaskEntityType, TaskFilters, TaskPriority, TaskStatus, UpdateCompanyInput, UpdateContactInput, UpdateDealInput, UpdateTaskInput, ValueInterval, isClosedStageType };
|
package/core-types.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
export { Activity, ActivityType, Company, CompanyFilters, Contact, ContactFilters, ContactStatus, CreateActivityInput, CreateCompanyInput, CreateContactInput, CreateDealInput, CreateTaskInput, CrmRole, Deal, DealStage, Note, OPEN_STAGE_TYPE, PipelineConfig, PipelineKind, PipelineStageConfig, RecordSource, StageType, Task, TaskEntityType, TaskFilters, TaskPriority, TaskStatus, UpdateCompanyInput, UpdateContactInput, UpdateDealInput, UpdateTaskInput, ValueInterval, isClosedStageType };
|
|
1
|
+
import { A as UpdateCompanyInput, C as RecordSource, D as TaskFilters, E as TaskEntityType, F as isClosedStageType, M as UpdateDealInput, N as UpdateTaskInput, O as TaskPriority, P as ValueInterval, S as PipelineStageConfig, T as Task, _ as OPEN_STAGE_TYPE, a as Contact, b as PipelineConfig, c as CreateActivityInput, d as CreateDealInput, f as CreateTaskInput, g as Note, h as DealStage, i as CompanyFilters, j as UpdateContactInput, k as TaskStatus, l as CreateCompanyInput, m as Deal, n as ActivityType, o as ContactFilters, p as CrmRole, r as Company, s as ContactStatus, t as Activity, u as CreateContactInput, v as Page, w as StageType, x as PipelineKind, y as PageRequest } from "./types-B17TWEOL.mjs";
|
|
2
|
+
export { Activity, ActivityType, Company, CompanyFilters, Contact, ContactFilters, ContactStatus, CreateActivityInput, CreateCompanyInput, CreateContactInput, CreateDealInput, CreateTaskInput, CrmRole, Deal, DealStage, Note, OPEN_STAGE_TYPE, Page, PageRequest, PipelineConfig, PipelineKind, PipelineStageConfig, RecordSource, StageType, Task, TaskEntityType, TaskFilters, TaskPriority, TaskStatus, UpdateCompanyInput, UpdateContactInput, UpdateDealInput, UpdateTaskInput, ValueInterval, isClosedStageType };
|
package/core.cjs
CHANGED
|
@@ -3,7 +3,7 @@ const require_projection = require("./projection-BELgANG2.cjs");
|
|
|
3
3
|
const require_entity_config = require("./entity-config-BI4RYNKL.cjs");
|
|
4
4
|
const require_mappings_config = require("./mappings-config-BCsRLohT.cjs");
|
|
5
5
|
const require_auth_adapter = require("./auth-adapter-CiEXcweZ.cjs");
|
|
6
|
-
const require_internal = require("./internal-
|
|
6
|
+
const require_internal = require("./internal-BxtvxF7Z.cjs");
|
|
7
7
|
const require_mapping_form = require("./mapping-form-BpfON_ME.cjs");
|
|
8
8
|
const require_projection_sql = require("./projection-sql-DuCtFE9t.cjs");
|
|
9
9
|
const require_view_compiler = require("./view-compiler-xiwm5iar.cjs");
|
|
@@ -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;
|
package/core.d.cts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { A as relationshipsSchema, B as identityRefs, D as missingRequiredFields, E as filterSchema, F as ProjectionFieldBinding, I as ProjectionIdentity, L as ProjectionJoin, M as validateEntitiesConfig, N as BASE_REF, O as projectionFields, P as PROJECTION_KEY_PATTERN, R as ProjectionMapping, S as RelationshipsMap, T as entitiesConfigSchema, V as projectionSchema, _ as MATERIALIZING_CONCEPTS, a as ClivlyEntitiesConfig, b as RelationshipSpec, d as CrmConcept, g as FilterValue, h as FilterExpr, i as ClivlyConfigError, j as requiredFieldsFor, k as relationshipSchema, l as ConfigValidationError, m as DiscoveredSchemaTable, n as CRM_CONCEPTS, p as DiscoveredColumnMeta, s as ClivlyEntityConfig, t as CANONICAL_FIELDS, u as ConfigValidationResult, v as MaterializingConcept, w as defineClivlyConfig, x as RelationshipVia, y as REQUIRED_FIELDS, z as ProjectionRef } from "./entity-config-ApnT5j3X.cjs";
|
|
2
|
-
import { A as
|
|
3
|
-
import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-
|
|
4
|
-
import { t as CRMAdapter } from "./adapter-
|
|
2
|
+
import { A as UpdateCompanyInput, C as RecordSource, D as TaskFilters, E as TaskEntityType, F as isClosedStageType, M as UpdateDealInput, N as UpdateTaskInput, O as TaskPriority, P as ValueInterval, S as PipelineStageConfig, T as Task, _ as OPEN_STAGE_TYPE, a as Contact, b as PipelineConfig, c as CreateActivityInput, d as CreateDealInput, f as CreateTaskInput, g as Note, h as DealStage, i as CompanyFilters, j as UpdateContactInput, k as TaskStatus, l as CreateCompanyInput, m as Deal, n as ActivityType, o as ContactFilters, p as CrmRole, r as Company, s as ContactStatus, t as Activity, u as CreateContactInput, v as Page, w as StageType, x as PipelineKind, y as PageRequest } from "./types-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
5
|
import { i as relationshipViaSignature, n as buildFilterFromDiscriminator, r as buildRelationships, t as RelationshipCandidate } from "./mapping-form-XsLLCqW_.cjs";
|
|
6
6
|
import { i as mappingsToEntitiesConfig, t as EntityMappingRow } from "./mappings-config-iJzbcUMp.cjs";
|
|
7
7
|
import { a as compileEntityView, i as ExplainResult, n as CompiledView, o as compileEntityViews, r as DEFAULT_VIEW_PREFIX, s as explainEntitiesConfig, t as CompileOptions } from "./view-compiler-Cq8apvZ4.cjs";
|
|
8
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 { 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, 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-
|
|
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";
|
|
10
10
|
import { a as IntegrationStep, c as StepProblem, i as IntegrationStatus, l as StepState, n as IntegrationFacts, o as NextAction, r as IntegrationState, s as StepId, t as ConnectionLiveness } from "./integration-state-BA4c0RbD.cjs";
|
|
11
|
-
export { type Activity, type ActivityType, BASE_REF, CANONICAL_FIELDS, type CRMAdapter, CRM_CONCEPTS, type ClivlyAuthAdapter, ClivlyConfigError, type ClivlyEntitiesConfig, type ClivlyEntityConfig, type ClivlyUser, type Company, type CompanyFilters, type CompileOptions, type CompiledView, type Condition, type ConditionOp, type ConfigValidationError, type ConfigValidationResult, type ConnectionLiveness, type Contact, type ContactFilters, type ContactStatus, type CreateActivityInput, type CreateCompanyInput, type CreateContactInput, type CreateDealInput, type CreateTaskInput, type CrmConcept, type CrmMembership, type CrmRole, DEFAULT_VIEW_PREFIX, type Deal, type DealStage, type DiscoveredColumnMeta, type DiscoveredSchemaTable, type EntityMappingRow, type EntitySyncResult, type EvaluableRule, type ExplainResult, type FilterExpr, type FilterValue, type HostOwnedCompanyField, type HostOwnedContactField, type IntegrationFacts, type IntegrationState, type IntegrationStatus, type IntegrationStep, MATERIALIZING_CONCEPTS, type MaterializingConcept, type MembershipResolver, type MirrorRecord, type NextAction, type Note, OPEN_STAGE_TYPE, PREVIEW_MAX_ROWS, PROJECTION_KEY_PATTERN, type 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, coversUniqueKey, defineClivlyConfig, entitiesConfigSchema, evaluateStage, explainEntitiesConfig, fanOutJoins, filterSchema, hasRichMeta, hostOwnedFieldMessage, identityRefs, isClosedStageType, isHostOwned, joinFansOut, mappingsToEntitiesConfig, matchesCondition, missingRequiredFields, primaryKeyColumns, projectionFields, projectionSchema, quoteIdent, reconcile, rejectedCompanyFields, rejectedContactFields, relationshipSchema, relationshipViaSignature, relationshipsSchema, requiredFieldsFor, runSync, slugify, toObjectTypeSlug, validateEntitiesConfig, validateProjection, validateProjectionFilter };
|
|
11
|
+
export { type Activity, type ActivityType, BASE_REF, CANONICAL_FIELDS, type CRMAdapter, CRM_CONCEPTS, type ClivlyAuthAdapter, ClivlyConfigError, type ClivlyEntitiesConfig, type ClivlyEntityConfig, type ClivlyUser, type Company, type CompanyFilters, type CompileOptions, type CompiledView, type Condition, type ConditionOp, type ConfigValidationError, type ConfigValidationResult, type ConnectionLiveness, type Contact, type ContactFilters, type ContactStatus, type CreateActivityInput, type CreateCompanyInput, type CreateContactInput, type CreateDealInput, type CreateTaskInput, type CrmConcept, type CrmMembership, type CrmRole, DEFAULT_VIEW_PREFIX, type Deal, type DealStage, type DiscoveredColumnMeta, type DiscoveredSchemaTable, type EntityMappingRow, type EntitySyncResult, type EvaluableRule, type ExplainResult, type FilterExpr, type FilterValue, type HostOwnedCompanyField, type HostOwnedContactField, type IntegrationFacts, type IntegrationState, type IntegrationStatus, type IntegrationStep, MATERIALIZING_CONCEPTS, type MaterializingConcept, type MembershipResolver, type MirrorRecord, type NextAction, type Note, OPEN_STAGE_TYPE, PREVIEW_MAX_ROWS, PROJECTION_KEY_PATTERN, type Page, type PageRequest, type PerSeatValueSource, type PersistAction, type PipelineConfig, type PipelineKind, type PipelineStageConfig, type ProjectionFieldBinding, type ProjectionIdentity, type ProjectionJoin, type ProjectionMapping, type ProjectionRef, REQUIRED_FIELDS, type RecordSource, type RelationshipCandidate, type RelationshipSpec, type RelationshipVia, type RelationshipsMap, type 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
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
|
|
3
|
-
import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-
|
|
4
|
-
import { t as CRMAdapter } from "./adapter-
|
|
2
|
+
import { A as UpdateCompanyInput, C as RecordSource, D as TaskFilters, E as TaskEntityType, F as isClosedStageType, M as UpdateDealInput, N as UpdateTaskInput, O as TaskPriority, P as ValueInterval, S as PipelineStageConfig, T as Task, _ as OPEN_STAGE_TYPE, a as Contact, b as PipelineConfig, c as CreateActivityInput, d as CreateDealInput, f as CreateTaskInput, g as Note, h as DealStage, i as CompanyFilters, j as UpdateContactInput, k as TaskStatus, l as CreateCompanyInput, m as Deal, n as ActivityType, o as ContactFilters, p as CrmRole, r as Company, s as ContactStatus, t as Activity, u as CreateContactInput, v as Page, w as StageType, x as PipelineKind, y as PageRequest } from "./types-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
5
|
import { i as relationshipViaSignature, n as buildFilterFromDiscriminator, r as buildRelationships, t as RelationshipCandidate } from "./mapping-form-Btn-7gzv.mjs";
|
|
6
6
|
import { i as mappingsToEntitiesConfig, t as EntityMappingRow } from "./mappings-config-D6_oCi2Q.mjs";
|
|
7
7
|
import { a as compileEntityView, i as ExplainResult, n as CompiledView, o as compileEntityViews, r as DEFAULT_VIEW_PREFIX, s as explainEntitiesConfig, t as CompileOptions } from "./view-compiler-CwKVoK1w.mjs";
|
|
8
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 { 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, 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-
|
|
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";
|
|
10
10
|
import { a as IntegrationStep, c as StepProblem, i as IntegrationStatus, l as StepState, n as IntegrationFacts, o as NextAction, r as IntegrationState, s as StepId, t as ConnectionLiveness } from "./integration-state-BA4c0RbD.mjs";
|
|
11
|
-
export { type Activity, type ActivityType, BASE_REF, CANONICAL_FIELDS, type CRMAdapter, CRM_CONCEPTS, type ClivlyAuthAdapter, ClivlyConfigError, type ClivlyEntitiesConfig, type ClivlyEntityConfig, type ClivlyUser, type Company, type CompanyFilters, type CompileOptions, type CompiledView, type Condition, type ConditionOp, type ConfigValidationError, type ConfigValidationResult, type ConnectionLiveness, type Contact, type ContactFilters, type ContactStatus, type CreateActivityInput, type CreateCompanyInput, type CreateContactInput, type CreateDealInput, type CreateTaskInput, type CrmConcept, type CrmMembership, type CrmRole, DEFAULT_VIEW_PREFIX, type Deal, type DealStage, type DiscoveredColumnMeta, type DiscoveredSchemaTable, type EntityMappingRow, type EntitySyncResult, type EvaluableRule, type ExplainResult, type FilterExpr, type FilterValue, type HostOwnedCompanyField, type HostOwnedContactField, type IntegrationFacts, type IntegrationState, type IntegrationStatus, type IntegrationStep, MATERIALIZING_CONCEPTS, type MaterializingConcept, type MembershipResolver, type MirrorRecord, type NextAction, type Note, OPEN_STAGE_TYPE, PREVIEW_MAX_ROWS, PROJECTION_KEY_PATTERN, type 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, coversUniqueKey, defineClivlyConfig, entitiesConfigSchema, evaluateStage, explainEntitiesConfig, fanOutJoins, filterSchema, hasRichMeta, hostOwnedFieldMessage, identityRefs, isClosedStageType, isHostOwned, joinFansOut, mappingsToEntitiesConfig, matchesCondition, missingRequiredFields, primaryKeyColumns, projectionFields, projectionSchema, quoteIdent, reconcile, rejectedCompanyFields, rejectedContactFields, relationshipSchema, relationshipViaSignature, relationshipsSchema, requiredFieldsFor, runSync, slugify, toObjectTypeSlug, validateEntitiesConfig, validateProjection, validateProjectionFilter };
|
|
11
|
+
export { type Activity, type ActivityType, BASE_REF, CANONICAL_FIELDS, type CRMAdapter, CRM_CONCEPTS, type ClivlyAuthAdapter, ClivlyConfigError, type ClivlyEntitiesConfig, type ClivlyEntityConfig, type ClivlyUser, type Company, type CompanyFilters, type CompileOptions, type CompiledView, type Condition, type ConditionOp, type ConfigValidationError, type ConfigValidationResult, type ConnectionLiveness, type Contact, type ContactFilters, type ContactStatus, type CreateActivityInput, type CreateCompanyInput, type CreateContactInput, type CreateDealInput, type CreateTaskInput, type CrmConcept, type CrmMembership, type CrmRole, DEFAULT_VIEW_PREFIX, type Deal, type DealStage, type DiscoveredColumnMeta, type DiscoveredSchemaTable, type EntityMappingRow, type EntitySyncResult, type EvaluableRule, type ExplainResult, type FilterExpr, type FilterValue, type HostOwnedCompanyField, type HostOwnedContactField, type IntegrationFacts, type IntegrationState, type IntegrationStatus, type IntegrationStep, MATERIALIZING_CONCEPTS, type MaterializingConcept, type MembershipResolver, type MirrorRecord, type NextAction, type Note, OPEN_STAGE_TYPE, PREVIEW_MAX_ROWS, PROJECTION_KEY_PATTERN, type Page, type PageRequest, type PerSeatValueSource, type PersistAction, type PipelineConfig, type PipelineKind, type PipelineStageConfig, type ProjectionFieldBinding, type ProjectionIdentity, type ProjectionJoin, type ProjectionMapping, type ProjectionRef, REQUIRED_FIELDS, type RecordSource, type RelationshipCandidate, type RelationshipSpec, type RelationshipVia, type RelationshipsMap, type 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
|
@@ -2,7 +2,7 @@ import { i as projectionSchema, n as PROJECTION_KEY_PATTERN, r as identityRefs,
|
|
|
2
2
|
import { C as hasRichMeta, S as coversUniqueKey, _ as validateProjection, a as MATERIALIZING_CONCEPTS, b as joinFansOut, c as defineClivlyConfig, d as missingRequiredFields, f as projectionFields, g as validateEntitiesConfig, h as requiredFieldsFor, i as ClivlyConfigError, l as entitiesConfigSchema, m as relationshipsSchema, n as CRM_CONCEPTS, o as REQUIRED_FIELDS, p as relationshipSchema, t as CANONICAL_FIELDS, u as filterSchema, v as validateProjectionFilter, w as primaryKeyColumns, x as columnMetaFor, y as fanOutJoins } from "./entity-config-Ccfb2IL9.mjs";
|
|
3
3
|
import { n as mappingsToEntitiesConfig } from "./mappings-config-CwQNQ6bA.mjs";
|
|
4
4
|
import { t as authCustom } from "./auth-adapter-gfVDxf3d.mjs";
|
|
5
|
-
import { a as hostOwnedFieldMessage, c as rejectedContactFields, i as toObjectTypeSlug, n as matchesCondition, o as isHostOwned, r as slugify, s as rejectedCompanyFields, t as evaluateStage } from "./internal-
|
|
5
|
+
import { a as hostOwnedFieldMessage, c as rejectedContactFields, i as toObjectTypeSlug, l as computeDealValue, n as matchesCondition, o as isHostOwned, r as slugify, s as rejectedCompanyFields, t as evaluateStage } from "./internal-u0Bks5Gr.mjs";
|
|
6
6
|
import { n as buildRelationships, r as relationshipViaSignature, t as buildFilterFromDiscriminator } from "./mapping-form-DigkuvFc.mjs";
|
|
7
7
|
import { a as compileProjectionPreview, i as compileProjectionJoins, n as compileProjectionFrom, o as compileProjectionSelect, r as compileProjectionIdentity, s as quoteIdent, t as PREVIEW_MAX_ROWS } from "./projection-sql-DweUaWRc.mjs";
|
|
8
8
|
import { i as explainEntitiesConfig, n as compileEntityView, r as compileEntityViews, t as DEFAULT_VIEW_PREFIX } from "./view-compiler-C-6RydKK.mjs";
|
|
@@ -12,4 +12,4 @@ 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, hostOwnedFieldMessage, identityRefs, isClosedStageType, isHostOwned, joinFansOut, mappingsToEntitiesConfig, matchesCondition, missingRequiredFields, primaryKeyColumns, projectionFields, projectionSchema, quoteIdent, reconcile, rejectedCompanyFields, rejectedContactFields, relationshipSchema, relationshipViaSignature, relationshipsSchema, requiredFieldsFor, runSync, slugify, toObjectTypeSlug, validateEntitiesConfig, validateProjection, validateProjectionFilter };
|
|
15
|
+
export { BASE_REF, CANONICAL_FIELDS, CRM_CONCEPTS, ClivlyConfigError, DEFAULT_VIEW_PREFIX, MATERIALIZING_CONCEPTS, OPEN_STAGE_TYPE, PREVIEW_MAX_ROWS, PROJECTION_KEY_PATTERN, REQUIRED_FIELDS, authCustom, buildFilterFromDiscriminator, buildRelationships, columnMetaFor, compileEntityView, compileEntityViews, compileProjectionFrom, compileProjectionIdentity, compileProjectionJoins, compileProjectionPreview, compileProjectionSelect, computeDealValue, coversUniqueKey, defineClivlyConfig, entitiesConfigSchema, evaluateStage, explainEntitiesConfig, fanOutJoins, filterSchema, hasRichMeta, hostOwnedFieldMessage, identityRefs, isClosedStageType, isHostOwned, joinFansOut, mappingsToEntitiesConfig, matchesCondition, missingRequiredFields, primaryKeyColumns, projectionFields, projectionSchema, quoteIdent, reconcile, rejectedCompanyFields, rejectedContactFields, relationshipSchema, relationshipViaSignature, relationshipsSchema, requiredFieldsFor, runSync, slugify, toObjectTypeSlug, validateEntitiesConfig, validateProjection, validateProjectionFilter };
|
package/drizzle.cjs
CHANGED
|
@@ -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
|
@@ -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
|
package/drizzle.d.mts
CHANGED
|
@@ -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
|
package/drizzle.mjs
CHANGED
|
@@ -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),
|
|
@@ -1,3 +1,31 @@
|
|
|
1
|
+
//#region ../core/src/deal-value.ts
|
|
2
|
+
const MONTHS_PER_YEAR = 12;
|
|
3
|
+
/** Only two decimal-free seat counts make sense; anything else is bad data. */
|
|
4
|
+
const SEAT_COUNT_REGEX = /^\d+$/;
|
|
5
|
+
/**
|
|
6
|
+
* The value one deal should have, in cents, or null to leave it alone.
|
|
7
|
+
*
|
|
8
|
+
* Returning null rather than 0 for unusable input is deliberate (D33). A
|
|
9
|
+
* renamed column would otherwise zero an entire pipeline silently, and a zeroed
|
|
10
|
+
* board reads as a business problem rather than a configuration problem. The
|
|
11
|
+
* unmapped case is surfaced through the rule-health warning surface instead of
|
|
12
|
+
* being written into the data — the same fail-safe `matchesCondition` applies.
|
|
13
|
+
*/
|
|
14
|
+
function computeDealValue(source, fields, mappedFields, stageType) {
|
|
15
|
+
if (source.zeroInStageTypes?.includes(stageType)) return 0;
|
|
16
|
+
if (!(mappedFields.has(source.seatField) && mappedFields.has(source.planField))) return null;
|
|
17
|
+
const planKey = fields[source.planField];
|
|
18
|
+
if (planKey == null || planKey === "") return null;
|
|
19
|
+
const unitPriceCents = source.plans[planKey];
|
|
20
|
+
if (unitPriceCents === void 0) return null;
|
|
21
|
+
const rawSeats = fields[source.seatField];
|
|
22
|
+
if (rawSeats == null || !SEAT_COUNT_REGEX.test(rawSeats)) return null;
|
|
23
|
+
const seats = Number(rawSeats);
|
|
24
|
+
if (!Number.isSafeInteger(seats)) return null;
|
|
25
|
+
const monthly = (source.baseFeeCents ?? 0) + seats * unitPriceCents;
|
|
26
|
+
return source.intervalField !== void 0 && mappedFields.has(source.intervalField) && fields[source.intervalField] === "year" ? Math.round(monthly / MONTHS_PER_YEAR) : monthly;
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
1
29
|
//#region ../core/src/host-owned-fields.ts
|
|
2
30
|
/**
|
|
3
31
|
* Which fields a CRM record lets a user edit.
|
|
@@ -219,6 +247,12 @@ function evaluateStage(rules, fields, mappedFields) {
|
|
|
219
247
|
return null;
|
|
220
248
|
}
|
|
221
249
|
//#endregion
|
|
250
|
+
Object.defineProperty(exports, "computeDealValue", {
|
|
251
|
+
enumerable: true,
|
|
252
|
+
get: function() {
|
|
253
|
+
return computeDealValue;
|
|
254
|
+
}
|
|
255
|
+
});
|
|
222
256
|
Object.defineProperty(exports, "evaluateStage", {
|
|
223
257
|
enumerable: true,
|
|
224
258
|
get: function() {
|
|
@@ -1,4 +1,39 @@
|
|
|
1
1
|
import { L as ProjectionJoin, R as ProjectionMapping, h as FilterExpr, l as ConfigValidationError, m as DiscoveredSchemaTable, p as DiscoveredColumnMeta } from "./entity-config-CKcj4-M_.mjs";
|
|
2
|
+
//#region ../core/src/deal-value.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Value derived as a flat fee plus a per-seat price that depends on the plan.
|
|
5
|
+
*
|
|
6
|
+
* Every field name is configuration and every plan key is data, so a second
|
|
7
|
+
* subscription business configures this without a code change. The formula is
|
|
8
|
+
* fixed with named slots rather than an expression language — the same choice
|
|
9
|
+
* D8 made for stage-rule conditions.
|
|
10
|
+
*/
|
|
11
|
+
interface PerSeatValueSource {
|
|
12
|
+
/** Flat monthly fee in cents, added before the interval is normalised. */
|
|
13
|
+
baseFeeCents?: number;
|
|
14
|
+
/** Mapped column holding "month" or "year". Absent means always monthly. */
|
|
15
|
+
intervalField?: string;
|
|
16
|
+
kind: "per_seat";
|
|
17
|
+
/** Mapped column holding the plan key. */
|
|
18
|
+
planField: string;
|
|
19
|
+
/** Unit price in cents, keyed by the value found in `planField`. */
|
|
20
|
+
plans: Record<string, number>;
|
|
21
|
+
/** Mapped column holding the seat count. */
|
|
22
|
+
seatField: string;
|
|
23
|
+
/** Stage types whose deals are worth nothing (usually `["lost"]`). */
|
|
24
|
+
zeroInStageTypes?: string[];
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The value one deal should have, in cents, or null to leave it alone.
|
|
28
|
+
*
|
|
29
|
+
* Returning null rather than 0 for unusable input is deliberate (D33). A
|
|
30
|
+
* renamed column would otherwise zero an entire pipeline silently, and a zeroed
|
|
31
|
+
* board reads as a business problem rather than a configuration problem. The
|
|
32
|
+
* unmapped case is surfaced through the rule-health warning surface instead of
|
|
33
|
+
* being written into the data — the same fail-safe `matchesCondition` applies.
|
|
34
|
+
*/
|
|
35
|
+
declare function computeDealValue(source: PerSeatValueSource, fields: Record<string, string | null>, mappedFields: Set<string>, stageType: string): number | null;
|
|
36
|
+
//#endregion
|
|
2
37
|
//#region ../core/src/host-owned-fields.d.ts
|
|
3
38
|
/**
|
|
4
39
|
* Which fields a CRM record lets a user edit.
|
|
@@ -290,4 +325,4 @@ declare function matchesCondition(condition: Condition, fields: Record<string, s
|
|
|
290
325
|
*/
|
|
291
326
|
declare function evaluateStage(rules: EvaluableRule[], fields: Record<string, string | null>, mappedFields: Set<string>): string | null;
|
|
292
327
|
//#endregion
|
|
293
|
-
export { HostOwnedCompanyField as C, isHostOwned as D, hostOwnedFieldMessage as E, rejectedCompanyFields as O, joinFansOut as S, SourcedRecord as T, compileProjectionJoins as _, matchesCondition as a, quoteIdent as b, columnMetaFor as c, primaryKeyColumns as d, validateProjection as f, compileProjectionIdentity as g, compileProjectionFrom as h, evaluateStage as i, rejectedContactFields as k, coversUniqueKey as l, PREVIEW_MAX_ROWS as m, ConditionOp as n, slugify as o, validateProjectionFilter as p, EvaluableRule as r, toObjectTypeSlug as s, Condition as t, hasRichMeta as u, compileProjectionPreview as v, HostOwnedContactField as w, fanOutJoins as x, compileProjectionSelect as y };
|
|
328
|
+
export { PerSeatValueSource as A, HostOwnedCompanyField as C, isHostOwned as D, hostOwnedFieldMessage as E, rejectedCompanyFields as O, joinFansOut as S, SourcedRecord as T, compileProjectionJoins as _, matchesCondition as a, quoteIdent as b, columnMetaFor as c, primaryKeyColumns as d, validateProjection as f, compileProjectionIdentity as g, compileProjectionFrom as h, evaluateStage as i, computeDealValue as j, rejectedContactFields as k, coversUniqueKey as l, PREVIEW_MAX_ROWS as m, ConditionOp as n, slugify as o, validateProjectionFilter as p, EvaluableRule as r, toObjectTypeSlug as s, Condition as t, hasRichMeta as u, compileProjectionPreview as v, HostOwnedContactField as w, fanOutJoins as x, compileProjectionSelect as y };
|
package/internal-adapter.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as CRMAdapter } from "./adapter-
|
|
1
|
+
import { t as CRMAdapter } from "./adapter-DTMeGGsl.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-DhPBRNpi.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-Csk9KkvI.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-C6rDx3XH.mjs";
|
|
2
2
|
export { ClivlyAuthAdapter, ClivlyUser, CrmMembership, MembershipResolver, authCustom };
|
package/internal-types.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
export { Activity, ActivityType, Company, CompanyFilters, Contact, ContactFilters, ContactStatus, CreateActivityInput, CreateCompanyInput, CreateContactInput, CreateDealInput, CreateTaskInput, CrmRole, Deal, DealStage, Note, OPEN_STAGE_TYPE, PipelineConfig, PipelineKind, PipelineStageConfig, RecordSource, StageType, Task, TaskEntityType, TaskFilters, TaskPriority, TaskStatus, UpdateCompanyInput, UpdateContactInput, UpdateDealInput, UpdateTaskInput, ValueInterval, isClosedStageType };
|
|
1
|
+
import { A as UpdateCompanyInput, C as RecordSource, D as TaskFilters, E as TaskEntityType, F as isClosedStageType, M as UpdateDealInput, N as UpdateTaskInput, O as TaskPriority, P as ValueInterval, S as PipelineStageConfig, T as Task, _ as OPEN_STAGE_TYPE, a as Contact, b as PipelineConfig, c as CreateActivityInput, d as CreateDealInput, f as CreateTaskInput, g as Note, h as DealStage, i as CompanyFilters, j as UpdateContactInput, k as TaskStatus, l as CreateCompanyInput, m as Deal, n as ActivityType, o as ContactFilters, p as CrmRole, r as Company, s as ContactStatus, t as Activity, u as CreateContactInput, v as Page, w as StageType, x as PipelineKind, y as PageRequest } from "./types-B17TWEOL.cjs";
|
|
2
|
+
export { Activity, ActivityType, Company, CompanyFilters, Contact, ContactFilters, ContactStatus, CreateActivityInput, CreateCompanyInput, CreateContactInput, CreateDealInput, CreateTaskInput, CrmRole, Deal, DealStage, Note, OPEN_STAGE_TYPE, Page, PageRequest, PipelineConfig, PipelineKind, PipelineStageConfig, RecordSource, StageType, Task, TaskEntityType, TaskFilters, TaskPriority, TaskStatus, UpdateCompanyInput, UpdateContactInput, UpdateDealInput, UpdateTaskInput, ValueInterval, isClosedStageType };
|
package/internal-types.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
export { Activity, ActivityType, Company, CompanyFilters, Contact, ContactFilters, ContactStatus, CreateActivityInput, CreateCompanyInput, CreateContactInput, CreateDealInput, CreateTaskInput, CrmRole, Deal, DealStage, Note, OPEN_STAGE_TYPE, PipelineConfig, PipelineKind, PipelineStageConfig, RecordSource, StageType, Task, TaskEntityType, TaskFilters, TaskPriority, TaskStatus, UpdateCompanyInput, UpdateContactInput, UpdateDealInput, UpdateTaskInput, ValueInterval, isClosedStageType };
|
|
1
|
+
import { A as UpdateCompanyInput, C as RecordSource, D as TaskFilters, E as TaskEntityType, F as isClosedStageType, M as UpdateDealInput, N as UpdateTaskInput, O as TaskPriority, P as ValueInterval, S as PipelineStageConfig, T as Task, _ as OPEN_STAGE_TYPE, a as Contact, b as PipelineConfig, c as CreateActivityInput, d as CreateDealInput, f as CreateTaskInput, g as Note, h as DealStage, i as CompanyFilters, j as UpdateContactInput, k as TaskStatus, l as CreateCompanyInput, m as Deal, n as ActivityType, o as ContactFilters, p as CrmRole, r as Company, s as ContactStatus, t as Activity, u as CreateContactInput, v as Page, w as StageType, x as PipelineKind, y as PageRequest } from "./types-B17TWEOL.mjs";
|
|
2
|
+
export { Activity, ActivityType, Company, CompanyFilters, Contact, ContactFilters, ContactStatus, CreateActivityInput, CreateCompanyInput, CreateContactInput, CreateDealInput, CreateTaskInput, CrmRole, Deal, DealStage, Note, OPEN_STAGE_TYPE, Page, PageRequest, PipelineConfig, PipelineKind, PipelineStageConfig, RecordSource, StageType, Task, TaskEntityType, TaskFilters, TaskPriority, TaskStatus, UpdateCompanyInput, UpdateContactInput, UpdateDealInput, UpdateTaskInput, ValueInterval, isClosedStageType };
|
|
@@ -1,3 +1,31 @@
|
|
|
1
|
+
//#region ../core/src/deal-value.ts
|
|
2
|
+
const MONTHS_PER_YEAR = 12;
|
|
3
|
+
/** Only two decimal-free seat counts make sense; anything else is bad data. */
|
|
4
|
+
const SEAT_COUNT_REGEX = /^\d+$/;
|
|
5
|
+
/**
|
|
6
|
+
* The value one deal should have, in cents, or null to leave it alone.
|
|
7
|
+
*
|
|
8
|
+
* Returning null rather than 0 for unusable input is deliberate (D33). A
|
|
9
|
+
* renamed column would otherwise zero an entire pipeline silently, and a zeroed
|
|
10
|
+
* board reads as a business problem rather than a configuration problem. The
|
|
11
|
+
* unmapped case is surfaced through the rule-health warning surface instead of
|
|
12
|
+
* being written into the data — the same fail-safe `matchesCondition` applies.
|
|
13
|
+
*/
|
|
14
|
+
function computeDealValue(source, fields, mappedFields, stageType) {
|
|
15
|
+
if (source.zeroInStageTypes?.includes(stageType)) return 0;
|
|
16
|
+
if (!(mappedFields.has(source.seatField) && mappedFields.has(source.planField))) return null;
|
|
17
|
+
const planKey = fields[source.planField];
|
|
18
|
+
if (planKey == null || planKey === "") return null;
|
|
19
|
+
const unitPriceCents = source.plans[planKey];
|
|
20
|
+
if (unitPriceCents === void 0) return null;
|
|
21
|
+
const rawSeats = fields[source.seatField];
|
|
22
|
+
if (rawSeats == null || !SEAT_COUNT_REGEX.test(rawSeats)) return null;
|
|
23
|
+
const seats = Number(rawSeats);
|
|
24
|
+
if (!Number.isSafeInteger(seats)) return null;
|
|
25
|
+
const monthly = (source.baseFeeCents ?? 0) + seats * unitPriceCents;
|
|
26
|
+
return source.intervalField !== void 0 && mappedFields.has(source.intervalField) && fields[source.intervalField] === "year" ? Math.round(monthly / MONTHS_PER_YEAR) : monthly;
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
1
29
|
//#region ../core/src/host-owned-fields.ts
|
|
2
30
|
/**
|
|
3
31
|
* Which fields a CRM record lets a user edit.
|
|
@@ -219,4 +247,4 @@ function evaluateStage(rules, fields, mappedFields) {
|
|
|
219
247
|
return null;
|
|
220
248
|
}
|
|
221
249
|
//#endregion
|
|
222
|
-
export { hostOwnedFieldMessage as a, rejectedContactFields as c, toObjectTypeSlug as i, matchesCondition as n, isHostOwned as o, slugify as r, rejectedCompanyFields as s, evaluateStage as t };
|
|
250
|
+
export { hostOwnedFieldMessage as a, rejectedContactFields as c, toObjectTypeSlug as i, computeDealValue as l, matchesCondition as n, isHostOwned as o, slugify as r, rejectedCompanyFields as s, evaluateStage as t };
|
|
@@ -1,4 +1,39 @@
|
|
|
1
1
|
import { L as ProjectionJoin, R as ProjectionMapping, h as FilterExpr, l as ConfigValidationError, m as DiscoveredSchemaTable, p as DiscoveredColumnMeta } from "./entity-config-ApnT5j3X.cjs";
|
|
2
|
+
//#region ../core/src/deal-value.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Value derived as a flat fee plus a per-seat price that depends on the plan.
|
|
5
|
+
*
|
|
6
|
+
* Every field name is configuration and every plan key is data, so a second
|
|
7
|
+
* subscription business configures this without a code change. The formula is
|
|
8
|
+
* fixed with named slots rather than an expression language — the same choice
|
|
9
|
+
* D8 made for stage-rule conditions.
|
|
10
|
+
*/
|
|
11
|
+
interface PerSeatValueSource {
|
|
12
|
+
/** Flat monthly fee in cents, added before the interval is normalised. */
|
|
13
|
+
baseFeeCents?: number;
|
|
14
|
+
/** Mapped column holding "month" or "year". Absent means always monthly. */
|
|
15
|
+
intervalField?: string;
|
|
16
|
+
kind: "per_seat";
|
|
17
|
+
/** Mapped column holding the plan key. */
|
|
18
|
+
planField: string;
|
|
19
|
+
/** Unit price in cents, keyed by the value found in `planField`. */
|
|
20
|
+
plans: Record<string, number>;
|
|
21
|
+
/** Mapped column holding the seat count. */
|
|
22
|
+
seatField: string;
|
|
23
|
+
/** Stage types whose deals are worth nothing (usually `["lost"]`). */
|
|
24
|
+
zeroInStageTypes?: string[];
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The value one deal should have, in cents, or null to leave it alone.
|
|
28
|
+
*
|
|
29
|
+
* Returning null rather than 0 for unusable input is deliberate (D33). A
|
|
30
|
+
* renamed column would otherwise zero an entire pipeline silently, and a zeroed
|
|
31
|
+
* board reads as a business problem rather than a configuration problem. The
|
|
32
|
+
* unmapped case is surfaced through the rule-health warning surface instead of
|
|
33
|
+
* being written into the data — the same fail-safe `matchesCondition` applies.
|
|
34
|
+
*/
|
|
35
|
+
declare function computeDealValue(source: PerSeatValueSource, fields: Record<string, string | null>, mappedFields: Set<string>, stageType: string): number | null;
|
|
36
|
+
//#endregion
|
|
2
37
|
//#region ../core/src/host-owned-fields.d.ts
|
|
3
38
|
/**
|
|
4
39
|
* Which fields a CRM record lets a user edit.
|
|
@@ -290,4 +325,4 @@ declare function matchesCondition(condition: Condition, fields: Record<string, s
|
|
|
290
325
|
*/
|
|
291
326
|
declare function evaluateStage(rules: EvaluableRule[], fields: Record<string, string | null>, mappedFields: Set<string>): string | null;
|
|
292
327
|
//#endregion
|
|
293
|
-
export { HostOwnedCompanyField as C, isHostOwned as D, hostOwnedFieldMessage as E, rejectedCompanyFields as O, joinFansOut as S, SourcedRecord as T, compileProjectionJoins as _, matchesCondition as a, quoteIdent as b, columnMetaFor as c, primaryKeyColumns as d, validateProjection as f, compileProjectionIdentity as g, compileProjectionFrom as h, evaluateStage as i, rejectedContactFields as k, coversUniqueKey as l, PREVIEW_MAX_ROWS as m, ConditionOp as n, slugify as o, validateProjectionFilter as p, EvaluableRule as r, toObjectTypeSlug as s, Condition as t, hasRichMeta as u, compileProjectionPreview as v, HostOwnedContactField as w, fanOutJoins as x, compileProjectionSelect as y };
|
|
328
|
+
export { PerSeatValueSource as A, HostOwnedCompanyField as C, isHostOwned as D, hostOwnedFieldMessage as E, rejectedCompanyFields as O, joinFansOut as S, SourcedRecord as T, compileProjectionJoins as _, matchesCondition as a, quoteIdent as b, columnMetaFor as c, primaryKeyColumns as d, validateProjection as f, compileProjectionIdentity as g, compileProjectionFrom as h, evaluateStage as i, computeDealValue as j, rejectedContactFields as k, coversUniqueKey as l, PREVIEW_MAX_ROWS as m, ConditionOp as n, slugify as o, validateProjectionFilter as p, EvaluableRule as r, toObjectTypeSlug as s, Condition as t, hasRichMeta as u, compileProjectionPreview as v, HostOwnedContactField as w, fanOutJoins as x, compileProjectionSelect as y };
|
package/internal.cjs
CHANGED
|
@@ -3,7 +3,7 @@ const require_projection = require("./projection-BELgANG2.cjs");
|
|
|
3
3
|
const require_entity_config = require("./entity-config-BI4RYNKL.cjs");
|
|
4
4
|
const require_mappings_config = require("./mappings-config-BCsRLohT.cjs");
|
|
5
5
|
const require_auth_adapter = require("./auth-adapter-CiEXcweZ.cjs");
|
|
6
|
-
const require_internal = require("./internal-
|
|
6
|
+
const require_internal = require("./internal-BxtvxF7Z.cjs");
|
|
7
7
|
const require_mapping_form = require("./mapping-form-BpfON_ME.cjs");
|
|
8
8
|
const require_projection_sql = require("./projection-sql-DuCtFE9t.cjs");
|
|
9
9
|
const require_view_compiler = require("./view-compiler-xiwm5iar.cjs");
|
|
@@ -30,6 +30,7 @@ exports.compileProjectionIdentity = require_projection_sql.compileProjectionIden
|
|
|
30
30
|
exports.compileProjectionJoins = require_projection_sql.compileProjectionJoins;
|
|
31
31
|
exports.compileProjectionPreview = require_projection_sql.compileProjectionPreview;
|
|
32
32
|
exports.compileProjectionSelect = require_projection_sql.compileProjectionSelect;
|
|
33
|
+
exports.computeDealValue = require_internal.computeDealValue;
|
|
33
34
|
exports.coversUniqueKey = require_entity_config.coversUniqueKey;
|
|
34
35
|
exports.defineClivlyConfig = require_entity_config.defineClivlyConfig;
|
|
35
36
|
exports.entitiesConfigSchema = require_entity_config.entitiesConfigSchema;
|
package/internal.d.cts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { A as relationshipsSchema, B as identityRefs, D as missingRequiredFields, E as filterSchema, F as ProjectionFieldBinding, I as ProjectionIdentity, L as ProjectionJoin, M as validateEntitiesConfig, N as BASE_REF, O as projectionFields, P as PROJECTION_KEY_PATTERN, R as ProjectionMapping, S as RelationshipsMap, T as entitiesConfigSchema, V as projectionSchema, _ as MATERIALIZING_CONCEPTS, a as ClivlyEntitiesConfig, b as RelationshipSpec, d as CrmConcept, g as FilterValue, h as FilterExpr, i as ClivlyConfigError, j as requiredFieldsFor, k as relationshipSchema, l as ConfigValidationError, m as DiscoveredSchemaTable, n as CRM_CONCEPTS, p as DiscoveredColumnMeta, s as ClivlyEntityConfig, t as CANONICAL_FIELDS, u as ConfigValidationResult, v as MaterializingConcept, w as defineClivlyConfig, x as RelationshipVia, y as REQUIRED_FIELDS, z as ProjectionRef } from "./entity-config-ApnT5j3X.cjs";
|
|
2
|
-
import { A as
|
|
3
|
-
import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-
|
|
4
|
-
import { t as CRMAdapter } from "./adapter-
|
|
2
|
+
import { A as UpdateCompanyInput, C as RecordSource, D as TaskFilters, E as TaskEntityType, F as isClosedStageType, M as UpdateDealInput, N as UpdateTaskInput, O as TaskPriority, P as ValueInterval, S as PipelineStageConfig, T as Task, _ as OPEN_STAGE_TYPE, a as Contact, b as PipelineConfig, c as CreateActivityInput, d as CreateDealInput, f as CreateTaskInput, g as Note, h as DealStage, i as CompanyFilters, j as UpdateContactInput, k as TaskStatus, l as CreateCompanyInput, m as Deal, n as ActivityType, o as ContactFilters, p as CrmRole, r as Company, s as ContactStatus, t as Activity, u as CreateContactInput, v as Page, w as StageType, x as PipelineKind, y as PageRequest } from "./types-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
5
|
import { i as relationshipViaSignature, n as buildFilterFromDiscriminator, r as buildRelationships, t as RelationshipCandidate } from "./mapping-form-XsLLCqW_.cjs";
|
|
6
6
|
import { i as mappingsToEntitiesConfig, t as EntityMappingRow } from "./mappings-config-iJzbcUMp.cjs";
|
|
7
7
|
import { a as compileEntityView, i as ExplainResult, n as CompiledView, o as compileEntityViews, r as DEFAULT_VIEW_PREFIX, s as explainEntitiesConfig, t as CompileOptions } from "./view-compiler-Cq8apvZ4.cjs";
|
|
8
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 { 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, 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-
|
|
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";
|
|
10
10
|
import { a as IntegrationStep, c as StepProblem, i as IntegrationStatus, l as StepState, n as IntegrationFacts, o as NextAction, r as IntegrationState, s as StepId, t as ConnectionLiveness } from "./integration-state-BA4c0RbD.cjs";
|
|
11
|
-
export { type Activity, type ActivityType, BASE_REF, CANONICAL_FIELDS, type CRMAdapter, CRM_CONCEPTS, type ClivlyAuthAdapter, ClivlyConfigError, type ClivlyEntitiesConfig, type ClivlyEntityConfig, type ClivlyUser, type Company, type CompanyFilters, type CompileOptions, type CompiledView, type Condition, type ConditionOp, type ConfigValidationError, type ConfigValidationResult, type ConnectionLiveness, type Contact, type ContactFilters, type ContactStatus, type CreateActivityInput, type CreateCompanyInput, type CreateContactInput, type CreateDealInput, type CreateTaskInput, type CrmConcept, type CrmMembership, type CrmRole, DEFAULT_VIEW_PREFIX, type Deal, type DealStage, type DiscoveredColumnMeta, type DiscoveredSchemaTable, type EntityMappingRow, type EntitySyncResult, type EvaluableRule, type ExplainResult, type FilterExpr, type FilterValue, type HostOwnedCompanyField, type HostOwnedContactField, type IntegrationFacts, type IntegrationState, type IntegrationStatus, type IntegrationStep, MATERIALIZING_CONCEPTS, type MaterializingConcept, type MembershipResolver, type MirrorRecord, type NextAction, type Note, OPEN_STAGE_TYPE, PREVIEW_MAX_ROWS, PROJECTION_KEY_PATTERN, type 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, coversUniqueKey, defineClivlyConfig, entitiesConfigSchema, evaluateStage, explainEntitiesConfig, fanOutJoins, filterSchema, hasRichMeta, hostOwnedFieldMessage, identityRefs, isClosedStageType, isHostOwned, joinFansOut, mappingsToEntitiesConfig, matchesCondition, missingRequiredFields, primaryKeyColumns, projectionFields, projectionSchema, quoteIdent, reconcile, rejectedCompanyFields, rejectedContactFields, relationshipSchema, relationshipViaSignature, relationshipsSchema, requiredFieldsFor, runSync, slugify, toObjectTypeSlug, validateEntitiesConfig, validateProjection, validateProjectionFilter };
|
|
11
|
+
export { type Activity, type ActivityType, BASE_REF, CANONICAL_FIELDS, type CRMAdapter, CRM_CONCEPTS, type ClivlyAuthAdapter, ClivlyConfigError, type ClivlyEntitiesConfig, type ClivlyEntityConfig, type ClivlyUser, type Company, type CompanyFilters, type CompileOptions, type CompiledView, type Condition, type ConditionOp, type ConfigValidationError, type ConfigValidationResult, type ConnectionLiveness, type Contact, type ContactFilters, type ContactStatus, type CreateActivityInput, type CreateCompanyInput, type CreateContactInput, type CreateDealInput, type CreateTaskInput, type CrmConcept, type CrmMembership, type CrmRole, DEFAULT_VIEW_PREFIX, type Deal, type DealStage, type DiscoveredColumnMeta, type DiscoveredSchemaTable, type EntityMappingRow, type EntitySyncResult, type EvaluableRule, type ExplainResult, type FilterExpr, type FilterValue, type HostOwnedCompanyField, type HostOwnedContactField, type IntegrationFacts, type IntegrationState, type IntegrationStatus, type IntegrationStep, MATERIALIZING_CONCEPTS, type MaterializingConcept, type MembershipResolver, type MirrorRecord, type NextAction, type Note, OPEN_STAGE_TYPE, PREVIEW_MAX_ROWS, PROJECTION_KEY_PATTERN, type Page, type PageRequest, type PerSeatValueSource, type PersistAction, type PipelineConfig, type PipelineKind, type PipelineStageConfig, type ProjectionFieldBinding, type ProjectionIdentity, type ProjectionJoin, type ProjectionMapping, type ProjectionRef, REQUIRED_FIELDS, type RecordSource, type RelationshipCandidate, type RelationshipSpec, type RelationshipVia, type RelationshipsMap, type 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/internal.d.mts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { A as relationshipsSchema, B as identityRefs, D as missingRequiredFields, E as filterSchema, F as ProjectionFieldBinding, I as ProjectionIdentity, L as ProjectionJoin, M as validateEntitiesConfig, N as BASE_REF, O as projectionFields, P as PROJECTION_KEY_PATTERN, R as ProjectionMapping, S as RelationshipsMap, T as entitiesConfigSchema, V as projectionSchema, _ as MATERIALIZING_CONCEPTS, a as ClivlyEntitiesConfig, b as RelationshipSpec, d as CrmConcept, g as FilterValue, h as FilterExpr, i as ClivlyConfigError, j as requiredFieldsFor, k as relationshipSchema, l as ConfigValidationError, m as DiscoveredSchemaTable, n as CRM_CONCEPTS, p as DiscoveredColumnMeta, s as ClivlyEntityConfig, t as CANONICAL_FIELDS, u as ConfigValidationResult, v as MaterializingConcept, w as defineClivlyConfig, x as RelationshipVia, y as REQUIRED_FIELDS, z as ProjectionRef } from "./entity-config-CKcj4-M_.mjs";
|
|
2
|
-
import { A as
|
|
3
|
-
import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-
|
|
4
|
-
import { t as CRMAdapter } from "./adapter-
|
|
2
|
+
import { A as UpdateCompanyInput, C as RecordSource, D as TaskFilters, E as TaskEntityType, F as isClosedStageType, M as UpdateDealInput, N as UpdateTaskInput, O as TaskPriority, P as ValueInterval, S as PipelineStageConfig, T as Task, _ as OPEN_STAGE_TYPE, a as Contact, b as PipelineConfig, c as CreateActivityInput, d as CreateDealInput, f as CreateTaskInput, g as Note, h as DealStage, i as CompanyFilters, j as UpdateContactInput, k as TaskStatus, l as CreateCompanyInput, m as Deal, n as ActivityType, o as ContactFilters, p as CrmRole, r as Company, s as ContactStatus, t as Activity, u as CreateContactInput, v as Page, w as StageType, x as PipelineKind, y as PageRequest } from "./types-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
5
|
import { i as relationshipViaSignature, n as buildFilterFromDiscriminator, r as buildRelationships, t as RelationshipCandidate } from "./mapping-form-Btn-7gzv.mjs";
|
|
6
6
|
import { i as mappingsToEntitiesConfig, t as EntityMappingRow } from "./mappings-config-D6_oCi2Q.mjs";
|
|
7
7
|
import { a as compileEntityView, i as ExplainResult, n as CompiledView, o as compileEntityViews, r as DEFAULT_VIEW_PREFIX, s as explainEntitiesConfig, t as CompileOptions } from "./view-compiler-CwKVoK1w.mjs";
|
|
8
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 { 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, 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-
|
|
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";
|
|
10
10
|
import { a as IntegrationStep, c as StepProblem, i as IntegrationStatus, l as StepState, n as IntegrationFacts, o as NextAction, r as IntegrationState, s as StepId, t as ConnectionLiveness } from "./integration-state-BA4c0RbD.mjs";
|
|
11
|
-
export { type Activity, type ActivityType, BASE_REF, CANONICAL_FIELDS, type CRMAdapter, CRM_CONCEPTS, type ClivlyAuthAdapter, ClivlyConfigError, type ClivlyEntitiesConfig, type ClivlyEntityConfig, type ClivlyUser, type Company, type CompanyFilters, type CompileOptions, type CompiledView, type Condition, type ConditionOp, type ConfigValidationError, type ConfigValidationResult, type ConnectionLiveness, type Contact, type ContactFilters, type ContactStatus, type CreateActivityInput, type CreateCompanyInput, type CreateContactInput, type CreateDealInput, type CreateTaskInput, type CrmConcept, type CrmMembership, type CrmRole, DEFAULT_VIEW_PREFIX, type Deal, type DealStage, type DiscoveredColumnMeta, type DiscoveredSchemaTable, type EntityMappingRow, type EntitySyncResult, type EvaluableRule, type ExplainResult, type FilterExpr, type FilterValue, type HostOwnedCompanyField, type HostOwnedContactField, type IntegrationFacts, type IntegrationState, type IntegrationStatus, type IntegrationStep, MATERIALIZING_CONCEPTS, type MaterializingConcept, type MembershipResolver, type MirrorRecord, type NextAction, type Note, OPEN_STAGE_TYPE, PREVIEW_MAX_ROWS, PROJECTION_KEY_PATTERN, type 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, coversUniqueKey, defineClivlyConfig, entitiesConfigSchema, evaluateStage, explainEntitiesConfig, fanOutJoins, filterSchema, hasRichMeta, hostOwnedFieldMessage, identityRefs, isClosedStageType, isHostOwned, joinFansOut, mappingsToEntitiesConfig, matchesCondition, missingRequiredFields, primaryKeyColumns, projectionFields, projectionSchema, quoteIdent, reconcile, rejectedCompanyFields, rejectedContactFields, relationshipSchema, relationshipViaSignature, relationshipsSchema, requiredFieldsFor, runSync, slugify, toObjectTypeSlug, validateEntitiesConfig, validateProjection, validateProjectionFilter };
|
|
11
|
+
export { type Activity, type ActivityType, BASE_REF, CANONICAL_FIELDS, type CRMAdapter, CRM_CONCEPTS, type ClivlyAuthAdapter, ClivlyConfigError, type ClivlyEntitiesConfig, type ClivlyEntityConfig, type ClivlyUser, type Company, type CompanyFilters, type CompileOptions, type CompiledView, type Condition, type ConditionOp, type ConfigValidationError, type ConfigValidationResult, type ConnectionLiveness, type Contact, type ContactFilters, type ContactStatus, type CreateActivityInput, type CreateCompanyInput, type CreateContactInput, type CreateDealInput, type CreateTaskInput, type CrmConcept, type CrmMembership, type CrmRole, DEFAULT_VIEW_PREFIX, type Deal, type DealStage, type DiscoveredColumnMeta, type DiscoveredSchemaTable, type EntityMappingRow, type EntitySyncResult, type EvaluableRule, type ExplainResult, type FilterExpr, type FilterValue, type HostOwnedCompanyField, type HostOwnedContactField, type IntegrationFacts, type IntegrationState, type IntegrationStatus, type IntegrationStep, MATERIALIZING_CONCEPTS, type MaterializingConcept, type MembershipResolver, type MirrorRecord, type NextAction, type Note, OPEN_STAGE_TYPE, PREVIEW_MAX_ROWS, PROJECTION_KEY_PATTERN, type Page, type PageRequest, type PerSeatValueSource, type PersistAction, type PipelineConfig, type PipelineKind, type PipelineStageConfig, type ProjectionFieldBinding, type ProjectionIdentity, type ProjectionJoin, type ProjectionMapping, type ProjectionRef, REQUIRED_FIELDS, type RecordSource, type RelationshipCandidate, type RelationshipSpec, type RelationshipVia, type RelationshipsMap, type 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/internal.mjs
CHANGED
|
@@ -2,10 +2,10 @@ import { i as projectionSchema, n as PROJECTION_KEY_PATTERN, r as identityRefs,
|
|
|
2
2
|
import { C as hasRichMeta, S as coversUniqueKey, _ as validateProjection, a as MATERIALIZING_CONCEPTS, b as joinFansOut, c as defineClivlyConfig, d as missingRequiredFields, f as projectionFields, g as validateEntitiesConfig, h as requiredFieldsFor, i as ClivlyConfigError, l as entitiesConfigSchema, m as relationshipsSchema, n as CRM_CONCEPTS, o as REQUIRED_FIELDS, p as relationshipSchema, t as CANONICAL_FIELDS, u as filterSchema, v as validateProjectionFilter, w as primaryKeyColumns, x as columnMetaFor, y as fanOutJoins } from "./entity-config-Ccfb2IL9.mjs";
|
|
3
3
|
import { n as mappingsToEntitiesConfig } from "./mappings-config-CwQNQ6bA.mjs";
|
|
4
4
|
import { t as authCustom } from "./auth-adapter-gfVDxf3d.mjs";
|
|
5
|
-
import { a as hostOwnedFieldMessage, c as rejectedContactFields, i as toObjectTypeSlug, n as matchesCondition, o as isHostOwned, r as slugify, s as rejectedCompanyFields, t as evaluateStage } from "./internal-
|
|
5
|
+
import { a as hostOwnedFieldMessage, c as rejectedContactFields, i as toObjectTypeSlug, l as computeDealValue, n as matchesCondition, o as isHostOwned, r as slugify, s as rejectedCompanyFields, t as evaluateStage } from "./internal-u0Bks5Gr.mjs";
|
|
6
6
|
import { n as buildRelationships, r as relationshipViaSignature, t as buildFilterFromDiscriminator } from "./mapping-form-DigkuvFc.mjs";
|
|
7
7
|
import { a as compileProjectionPreview, i as compileProjectionJoins, n as compileProjectionFrom, o as compileProjectionSelect, r as compileProjectionIdentity, s as quoteIdent, t as PREVIEW_MAX_ROWS } from "./projection-sql-DweUaWRc.mjs";
|
|
8
8
|
import { i as explainEntitiesConfig, n as compileEntityView, r as compileEntityViews, t as DEFAULT_VIEW_PREFIX } from "./view-compiler-C-6RydKK.mjs";
|
|
9
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
|
-
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, hostOwnedFieldMessage, identityRefs, isClosedStageType, isHostOwned, joinFansOut, mappingsToEntitiesConfig, matchesCondition, missingRequiredFields, primaryKeyColumns, projectionFields, projectionSchema, quoteIdent, reconcile, rejectedCompanyFields, rejectedContactFields, relationshipSchema, relationshipViaSignature, relationshipsSchema, requiredFieldsFor, runSync, slugify, toObjectTypeSlug, validateEntitiesConfig, validateProjection, validateProjectionFilter };
|
|
11
|
+
export { 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 };
|
package/package.json
CHANGED
|
@@ -92,7 +92,21 @@ interface Deal {
|
|
|
92
92
|
owner: string | null;
|
|
93
93
|
position: number | null;
|
|
94
94
|
stage: DealStage;
|
|
95
|
+
/**
|
|
96
|
+
* When a human last moved this deal by hand. Non-null means stage derivation
|
|
97
|
+
* no longer touches it, so a board must be able to mark it as overridden and
|
|
98
|
+
* offer a way back — otherwise an overridden deal is indistinguishable from
|
|
99
|
+
* one the rules simply never matched.
|
|
100
|
+
*/
|
|
101
|
+
stageOverrideAt: Date | null;
|
|
95
102
|
value: number;
|
|
103
|
+
/**
|
|
104
|
+
* When a human last set this deal's value by hand. Non-null means value
|
|
105
|
+
* derivation no longer touches it. Mirrors {@link Deal.stageOverrideAt} — and
|
|
106
|
+
* needs the same visibility, since an honoured-but-invisible override reads
|
|
107
|
+
* as a stuck deal rather than a pinned one.
|
|
108
|
+
*/
|
|
109
|
+
valueOverrideAt: Date | null;
|
|
96
110
|
}
|
|
97
111
|
interface Task {
|
|
98
112
|
archivedAt: Date | null;
|
|
@@ -234,6 +248,28 @@ interface ContactFilters {
|
|
|
234
248
|
source?: RecordSource;
|
|
235
249
|
status?: ContactStatus;
|
|
236
250
|
}
|
|
251
|
+
/**
|
|
252
|
+
* One page of a keyset-paginated read.
|
|
253
|
+
*
|
|
254
|
+
* Keyset, not offset: `LIMIT/OFFSET` re-scans every skipped row, so page 200
|
|
255
|
+
* costs 200 pages of work, and a row inserted mid-listing shifts everything
|
|
256
|
+
* after it — the reader sees a record twice or never. A cursor anchored to
|
|
257
|
+
* `(createdAt, id)` is stable under concurrent writes and costs the same at
|
|
258
|
+
* page 1 and page 200.
|
|
259
|
+
*
|
|
260
|
+
* `audit.list` already does this; these types generalise its shape so the CRM
|
|
261
|
+
* lists cannot drift into a second convention.
|
|
262
|
+
*/
|
|
263
|
+
interface PageRequest {
|
|
264
|
+
/** Opaque `${createdAtISO}|${id}`. Rows strictly older than this. */
|
|
265
|
+
cursor?: string;
|
|
266
|
+
limit?: number;
|
|
267
|
+
}
|
|
268
|
+
interface Page<T> {
|
|
269
|
+
/** Null when this is the last page. */
|
|
270
|
+
nextCursor: string | null;
|
|
271
|
+
rows: T[];
|
|
272
|
+
}
|
|
237
273
|
interface CompanyFilters {
|
|
238
274
|
/** See {@link ContactFilters.excludeArchived}. */
|
|
239
275
|
excludeArchived?: boolean;
|
|
@@ -249,4 +285,4 @@ interface TaskFilters {
|
|
|
249
285
|
status?: TaskStatus;
|
|
250
286
|
}
|
|
251
287
|
//#endregion
|
|
252
|
-
export {
|
|
288
|
+
export { UpdateCompanyInput as A, RecordSource as C, TaskFilters as D, TaskEntityType as E, isClosedStageType as F, UpdateDealInput as M, UpdateTaskInput as N, TaskPriority as O, ValueInterval as P, PipelineStageConfig as S, Task as T, OPEN_STAGE_TYPE as _, Contact as a, PipelineConfig as b, CreateActivityInput as c, CreateDealInput as d, CreateTaskInput as f, Note as g, DealStage as h, CompanyFilters as i, UpdateContactInput as j, TaskStatus as k, CreateCompanyInput as l, Deal as m, ActivityType as n, ContactFilters as o, CrmRole as p, Company as r, ContactStatus as s, Activity as t, CreateContactInput as u, Page as v, StageType as w, PipelineKind as x, PageRequest as y };
|
|
@@ -92,7 +92,21 @@ interface Deal {
|
|
|
92
92
|
owner: string | null;
|
|
93
93
|
position: number | null;
|
|
94
94
|
stage: DealStage;
|
|
95
|
+
/**
|
|
96
|
+
* When a human last moved this deal by hand. Non-null means stage derivation
|
|
97
|
+
* no longer touches it, so a board must be able to mark it as overridden and
|
|
98
|
+
* offer a way back — otherwise an overridden deal is indistinguishable from
|
|
99
|
+
* one the rules simply never matched.
|
|
100
|
+
*/
|
|
101
|
+
stageOverrideAt: Date | null;
|
|
95
102
|
value: number;
|
|
103
|
+
/**
|
|
104
|
+
* When a human last set this deal's value by hand. Non-null means value
|
|
105
|
+
* derivation no longer touches it. Mirrors {@link Deal.stageOverrideAt} — and
|
|
106
|
+
* needs the same visibility, since an honoured-but-invisible override reads
|
|
107
|
+
* as a stuck deal rather than a pinned one.
|
|
108
|
+
*/
|
|
109
|
+
valueOverrideAt: Date | null;
|
|
96
110
|
}
|
|
97
111
|
interface Task {
|
|
98
112
|
archivedAt: Date | null;
|
|
@@ -234,6 +248,28 @@ interface ContactFilters {
|
|
|
234
248
|
source?: RecordSource;
|
|
235
249
|
status?: ContactStatus;
|
|
236
250
|
}
|
|
251
|
+
/**
|
|
252
|
+
* One page of a keyset-paginated read.
|
|
253
|
+
*
|
|
254
|
+
* Keyset, not offset: `LIMIT/OFFSET` re-scans every skipped row, so page 200
|
|
255
|
+
* costs 200 pages of work, and a row inserted mid-listing shifts everything
|
|
256
|
+
* after it — the reader sees a record twice or never. A cursor anchored to
|
|
257
|
+
* `(createdAt, id)` is stable under concurrent writes and costs the same at
|
|
258
|
+
* page 1 and page 200.
|
|
259
|
+
*
|
|
260
|
+
* `audit.list` already does this; these types generalise its shape so the CRM
|
|
261
|
+
* lists cannot drift into a second convention.
|
|
262
|
+
*/
|
|
263
|
+
interface PageRequest {
|
|
264
|
+
/** Opaque `${createdAtISO}|${id}`. Rows strictly older than this. */
|
|
265
|
+
cursor?: string;
|
|
266
|
+
limit?: number;
|
|
267
|
+
}
|
|
268
|
+
interface Page<T> {
|
|
269
|
+
/** Null when this is the last page. */
|
|
270
|
+
nextCursor: string | null;
|
|
271
|
+
rows: T[];
|
|
272
|
+
}
|
|
237
273
|
interface CompanyFilters {
|
|
238
274
|
/** See {@link ContactFilters.excludeArchived}. */
|
|
239
275
|
excludeArchived?: boolean;
|
|
@@ -249,4 +285,4 @@ interface TaskFilters {
|
|
|
249
285
|
status?: TaskStatus;
|
|
250
286
|
}
|
|
251
287
|
//#endregion
|
|
252
|
-
export {
|
|
288
|
+
export { UpdateCompanyInput as A, RecordSource as C, TaskFilters as D, TaskEntityType as E, isClosedStageType as F, UpdateDealInput as M, UpdateTaskInput as N, TaskPriority as O, ValueInterval as P, PipelineStageConfig as S, Task as T, OPEN_STAGE_TYPE as _, Contact as a, PipelineConfig as b, CreateActivityInput as c, CreateDealInput as d, CreateTaskInput as f, Note as g, DealStage as h, CompanyFilters as i, UpdateContactInput as j, TaskStatus as k, CreateCompanyInput as l, Deal as m, ActivityType as n, ContactFilters as o, CrmRole as p, Company as r, ContactStatus as s, Activity as t, CreateContactInput as u, Page as v, StageType as w, PipelineKind as x, PageRequest as y };
|