clivly 0.21.0 → 0.22.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/core.cjs CHANGED
@@ -3,7 +3,7 @@ const require_projection = require("./projection-w4Z6vSL2.cjs");
3
3
  const require_entity_config = require("./entity-config-BP8Cc_nC.cjs");
4
4
  const require_mappings_config = require("./mappings-config-CC-vltWb.cjs");
5
5
  const require_auth_adapter = require("./auth-adapter-CNVuxT9W.cjs");
6
- const require_internal = require("./internal-G5tXjqwl.cjs");
6
+ const require_internal = require("./internal-D88LTRlu.cjs");
7
7
  const require_mapping_form = require("./mapping-form-Bs6JQurC.cjs");
8
8
  const require_projection_sql = require("./projection-sql-BkrHR2ea.cjs");
9
9
  const require_view_compiler = require("./view-compiler-NqiortOA.cjs");
package/core.d.cts CHANGED
@@ -6,6 +6,6 @@ import { i as relationshipViaSignature, n as buildFilterFromDiscriminator, r as
6
6
  import { i as mappingsToEntitiesConfig, t as EntityMappingRow } from "./mappings-config-DNo_Cum_.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-BDD93Luw.cjs";
8
8
  import { c as SyncAction, f as isRemovalAction, g as runSync, h as resolveActions, l as SyncResult, m as reconcile, n as MirrorRecord, o as ResolvedMembership, r as PersistAction, s as SourceRow, t as EntitySyncResult, u as SyncStore } from "./sync-engine-DCjTr2XQ.cjs";
9
- import { a as matchesCondition, c as HostOwnedCompanyField, d as hostOwnedFieldMessage, f as isHostOwned, g as computeDealValue, h as PerSeatValueSource, i as evaluateStage, l as HostOwnedContactField, m as rejectedContactFields, n as ConditionOp, o as slugify, p as rejectedCompanyFields, r as EvaluableRule, s as toObjectTypeSlug, t as Condition, u as SourcedRecord } from "./internal-Nrhf76Jn.cjs";
9
+ import { _ as PerSeatValueSource, a as matchesCondition, c as HostOwnedCompanyField, d as hostOwnedFieldMessage, f as isHostOwned, g as MappedAmountValueSource, h as DealValueSource, i as evaluateStage, l as HostOwnedContactField, m as rejectedContactFields, n as ConditionOp, o as slugify, p as rejectedCompanyFields, r as EvaluableRule, s as toObjectTypeSlug, t as Condition, u as SourcedRecord, v as computeDealValue } from "./internal-D7qVRIFb.cjs";
10
10
  import { C as StepProblem, S as StepId, _ as IntegrationFacts, a as validateProjection, b as IntegrationStep, c as compileProjectionFrom, d as compileProjectionPreview, f as compileProjectionSelect, g as ConnectionLiveness, h as joinFansOut, i as primaryKeyColumns, l as compileProjectionIdentity, m as fanOutJoins, n as coversUniqueKey, o as validateProjectionFilter, p as quoteIdent, r as hasRichMeta, s as PREVIEW_MAX_ROWS, t as columnMetaFor, u as compileProjectionJoins, v as IntegrationState, w as StepState, x as NextAction, y as IntegrationStatus } from "./index-DRRTE5IJ.cjs";
11
- export { type Activity, type ActivityType, BASE_REF, CANONICAL_FIELDS, type CRMAdapter, CRM_CONCEPTS, type ClivlyAuthAdapter, ClivlyConfigError, type ClivlyEntitiesConfig, type ClivlyEntityConfig, type ClivlyUser, type Company, type CompanyFilters, type CompileOptions, type CompiledView, type Condition, type ConditionOp, type ConfigValidationError, type ConfigValidationResult, type ConnectionLiveness, type Contact, type ContactFilters, type ContactSegment, type ContactSource, type ContactStatus, type CreateActivityInput, type CreateCompanyInput, type CreateContactInput, type CreateDealInput, type CreateTaskInput, type CrmConcept, type CrmMembership, type CrmRole, DEFAULT_VIEW_PREFIX, type Deal, type DealStage, type 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 ResolvedMembership, type SourceRow, type SourcedRecord, type StageType, type StepId, type StepProblem, type StepState, type SyncAction, type SyncResult, type SyncStore, type Task, type TaskEntityType, type TaskFilters, type TaskPriority, type TaskStatus, type UpdateCompanyInput, type UpdateContactInput, type UpdateDealInput, type UpdateTaskInput, type ValueInterval, authCustom, buildFilterFromDiscriminator, buildRelationships, columnMetaFor, compileEntityView, compileEntityViews, compileProjectionFrom, compileProjectionIdentity, compileProjectionJoins, compileProjectionPreview, compileProjectionSelect, computeDealValue, contactSegmentSchema, coversUniqueKey, defineClivlyConfig, entitiesConfigSchema, evaluateStage, explainEntitiesConfig, fanOutJoins, filterSchema, hasRichMeta, hostOwnedFieldMessage, identityRefs, isClosedStageType, isHostOwned, isRemovalAction, joinFansOut, mappingsToEntitiesConfig, matchesCondition, missingRequiredFields, primaryKeyColumns, projectionFields, projectionSchema, quoteIdent, reconcile, rejectedCompanyFields, rejectedContactFields, relationshipSchema, relationshipViaSignature, relationshipsSchema, requiredFieldsFor, resolveActions, runSync, slugify, toObjectTypeSlug, validateEntitiesConfig, validateProjection, validateProjectionFilter };
11
+ export { type Activity, type ActivityType, BASE_REF, CANONICAL_FIELDS, type CRMAdapter, CRM_CONCEPTS, type ClivlyAuthAdapter, ClivlyConfigError, type ClivlyEntitiesConfig, type ClivlyEntityConfig, type ClivlyUser, type Company, type CompanyFilters, type CompileOptions, type CompiledView, type Condition, type ConditionOp, type ConfigValidationError, type ConfigValidationResult, type ConnectionLiveness, type Contact, type ContactFilters, type ContactSegment, type ContactSource, type ContactStatus, type CreateActivityInput, type CreateCompanyInput, type CreateContactInput, type CreateDealInput, type CreateTaskInput, type CrmConcept, type CrmMembership, type CrmRole, DEFAULT_VIEW_PREFIX, type Deal, type DealStage, type DealValueSource, type DiscoveredColumnMeta, type DiscoveredSchemaTable, type EntityMappingRow, type EntitySyncResult, type EvaluableRule, type ExplainResult, type FilterExpr, type FilterValue, type HostOwnedCompanyField, type HostOwnedContactField, type IntegrationFacts, type IntegrationState, type IntegrationStatus, type IntegrationStep, MATERIALIZING_CONCEPTS, type MappedAmountValueSource, type MaterializingConcept, type MembershipResolver, type MirrorRecord, type NextAction, type Note, OPEN_STAGE_TYPE, PREVIEW_MAX_ROWS, PROJECTION_KEY_PATTERN, type Page, type PageRequest, type PerSeatValueSource, type PersistAction, type PipelineConfig, type PipelineKind, type PipelineStageConfig, type ProjectionFieldBinding, type ProjectionIdentity, type ProjectionJoin, type ProjectionMapping, type ProjectionRef, REQUIRED_FIELDS, type RecordSource, type RelationshipCandidate, type RelationshipSpec, type RelationshipVia, type RelationshipsMap, type ResolvedMembership, type SourceRow, type SourcedRecord, type StageType, type StepId, type StepProblem, type StepState, type SyncAction, type SyncResult, type SyncStore, type Task, type TaskEntityType, type TaskFilters, type TaskPriority, type TaskStatus, type UpdateCompanyInput, type UpdateContactInput, type UpdateDealInput, type UpdateTaskInput, type ValueInterval, authCustom, buildFilterFromDiscriminator, buildRelationships, columnMetaFor, compileEntityView, compileEntityViews, compileProjectionFrom, compileProjectionIdentity, compileProjectionJoins, compileProjectionPreview, compileProjectionSelect, computeDealValue, contactSegmentSchema, coversUniqueKey, defineClivlyConfig, entitiesConfigSchema, evaluateStage, explainEntitiesConfig, fanOutJoins, filterSchema, hasRichMeta, hostOwnedFieldMessage, identityRefs, isClosedStageType, isHostOwned, isRemovalAction, joinFansOut, mappingsToEntitiesConfig, matchesCondition, missingRequiredFields, primaryKeyColumns, projectionFields, projectionSchema, quoteIdent, reconcile, rejectedCompanyFields, rejectedContactFields, relationshipSchema, relationshipViaSignature, relationshipsSchema, requiredFieldsFor, resolveActions, runSync, slugify, toObjectTypeSlug, validateEntitiesConfig, validateProjection, validateProjectionFilter };
package/core.d.mts CHANGED
@@ -6,6 +6,6 @@ import { i as relationshipViaSignature, n as buildFilterFromDiscriminator, r as
6
6
  import { i as mappingsToEntitiesConfig, t as EntityMappingRow } from "./mappings-config-wAe-p1rG.mjs";
7
7
  import { a as compileEntityView, i as ExplainResult, n as CompiledView, o as compileEntityViews, r as DEFAULT_VIEW_PREFIX, s as explainEntitiesConfig, t as CompileOptions } from "./view-compiler-CSNhmCY2.mjs";
8
8
  import { c as SyncAction, f as isRemovalAction, g as runSync, h as resolveActions, l as SyncResult, m as reconcile, n as MirrorRecord, o as ResolvedMembership, r as PersistAction, s as SourceRow, t as EntitySyncResult, u as SyncStore } from "./sync-engine-UNORma7f.mjs";
9
- import { a as matchesCondition, c as HostOwnedCompanyField, d as hostOwnedFieldMessage, f as isHostOwned, g as computeDealValue, h as PerSeatValueSource, i as evaluateStage, l as HostOwnedContactField, m as rejectedContactFields, n as ConditionOp, o as slugify, p as rejectedCompanyFields, r as EvaluableRule, s as toObjectTypeSlug, t as Condition, u as SourcedRecord } from "./internal-C8TGcv_X.mjs";
9
+ import { _ as PerSeatValueSource, a as matchesCondition, c as HostOwnedCompanyField, d as hostOwnedFieldMessage, f as isHostOwned, g as MappedAmountValueSource, h as DealValueSource, i as evaluateStage, l as HostOwnedContactField, m as rejectedContactFields, n as ConditionOp, o as slugify, p as rejectedCompanyFields, r as EvaluableRule, s as toObjectTypeSlug, t as Condition, u as SourcedRecord, v as computeDealValue } from "./internal-CdfVkh4O.mjs";
10
10
  import { C as StepProblem, S as StepId, _ as IntegrationFacts, a as validateProjection, b as IntegrationStep, c as compileProjectionFrom, d as compileProjectionPreview, f as compileProjectionSelect, g as ConnectionLiveness, h as joinFansOut, i as primaryKeyColumns, l as compileProjectionIdentity, m as fanOutJoins, n as coversUniqueKey, o as validateProjectionFilter, p as quoteIdent, r as hasRichMeta, s as PREVIEW_MAX_ROWS, t as columnMetaFor, u as compileProjectionJoins, v as IntegrationState, w as StepState, x as NextAction, y as IntegrationStatus } from "./index-Bh7o2J7K.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 ContactSegment, type ContactSource, type ContactStatus, type CreateActivityInput, type CreateCompanyInput, type CreateContactInput, type CreateDealInput, type CreateTaskInput, type CrmConcept, type CrmMembership, type CrmRole, DEFAULT_VIEW_PREFIX, type Deal, type DealStage, type 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 ResolvedMembership, type SourceRow, type SourcedRecord, type StageType, type StepId, type StepProblem, type StepState, type SyncAction, type SyncResult, type SyncStore, type Task, type TaskEntityType, type TaskFilters, type TaskPriority, type TaskStatus, type UpdateCompanyInput, type UpdateContactInput, type UpdateDealInput, type UpdateTaskInput, type ValueInterval, authCustom, buildFilterFromDiscriminator, buildRelationships, columnMetaFor, compileEntityView, compileEntityViews, compileProjectionFrom, compileProjectionIdentity, compileProjectionJoins, compileProjectionPreview, compileProjectionSelect, computeDealValue, contactSegmentSchema, coversUniqueKey, defineClivlyConfig, entitiesConfigSchema, evaluateStage, explainEntitiesConfig, fanOutJoins, filterSchema, hasRichMeta, hostOwnedFieldMessage, identityRefs, isClosedStageType, isHostOwned, isRemovalAction, joinFansOut, mappingsToEntitiesConfig, matchesCondition, missingRequiredFields, primaryKeyColumns, projectionFields, projectionSchema, quoteIdent, reconcile, rejectedCompanyFields, rejectedContactFields, relationshipSchema, relationshipViaSignature, relationshipsSchema, requiredFieldsFor, resolveActions, runSync, slugify, toObjectTypeSlug, validateEntitiesConfig, validateProjection, validateProjectionFilter };
11
+ export { type Activity, type ActivityType, BASE_REF, CANONICAL_FIELDS, type CRMAdapter, CRM_CONCEPTS, type ClivlyAuthAdapter, ClivlyConfigError, type ClivlyEntitiesConfig, type ClivlyEntityConfig, type ClivlyUser, type Company, type CompanyFilters, type CompileOptions, type CompiledView, type Condition, type ConditionOp, type ConfigValidationError, type ConfigValidationResult, type ConnectionLiveness, type Contact, type ContactFilters, type ContactSegment, type ContactSource, type ContactStatus, type CreateActivityInput, type CreateCompanyInput, type CreateContactInput, type CreateDealInput, type CreateTaskInput, type CrmConcept, type CrmMembership, type CrmRole, DEFAULT_VIEW_PREFIX, type Deal, type DealStage, type DealValueSource, type DiscoveredColumnMeta, type DiscoveredSchemaTable, type EntityMappingRow, type EntitySyncResult, type EvaluableRule, type ExplainResult, type FilterExpr, type FilterValue, type HostOwnedCompanyField, type HostOwnedContactField, type IntegrationFacts, type IntegrationState, type IntegrationStatus, type IntegrationStep, MATERIALIZING_CONCEPTS, type MappedAmountValueSource, type MaterializingConcept, type MembershipResolver, type MirrorRecord, type NextAction, type Note, OPEN_STAGE_TYPE, PREVIEW_MAX_ROWS, PROJECTION_KEY_PATTERN, type Page, type PageRequest, type PerSeatValueSource, type PersistAction, type PipelineConfig, type PipelineKind, type PipelineStageConfig, type ProjectionFieldBinding, type ProjectionIdentity, type ProjectionJoin, type ProjectionMapping, type ProjectionRef, REQUIRED_FIELDS, type RecordSource, type RelationshipCandidate, type RelationshipSpec, type RelationshipVia, type RelationshipsMap, type ResolvedMembership, type SourceRow, type SourcedRecord, type StageType, type StepId, type StepProblem, type StepState, type SyncAction, type SyncResult, type SyncStore, type Task, type TaskEntityType, type TaskFilters, type TaskPriority, type TaskStatus, type UpdateCompanyInput, type UpdateContactInput, type UpdateDealInput, type UpdateTaskInput, type ValueInterval, authCustom, buildFilterFromDiscriminator, buildRelationships, columnMetaFor, compileEntityView, compileEntityViews, compileProjectionFrom, compileProjectionIdentity, compileProjectionJoins, compileProjectionPreview, compileProjectionSelect, computeDealValue, contactSegmentSchema, coversUniqueKey, defineClivlyConfig, entitiesConfigSchema, evaluateStage, explainEntitiesConfig, fanOutJoins, filterSchema, hasRichMeta, hostOwnedFieldMessage, identityRefs, isClosedStageType, isHostOwned, isRemovalAction, joinFansOut, mappingsToEntitiesConfig, matchesCondition, missingRequiredFields, primaryKeyColumns, projectionFields, projectionSchema, quoteIdent, reconcile, rejectedCompanyFields, rejectedContactFields, relationshipSchema, relationshipViaSignature, relationshipsSchema, requiredFieldsFor, resolveActions, runSync, slugify, toObjectTypeSlug, validateEntitiesConfig, validateProjection, validateProjectionFilter };
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-CI5CGfaN.mjs";
3
3
  import { n as mappingsToEntitiesConfig } from "./mappings-config-Opw7ZM6Y.mjs";
4
4
  import { t as authCustom } from "./auth-adapter-u91PByaw.mjs";
5
- import { a as hostOwnedFieldMessage, c as rejectedContactFields, i as toObjectTypeSlug, l as computeDealValue, n as matchesCondition, o as isHostOwned, r as slugify, s as rejectedCompanyFields, t as evaluateStage, u as contactSegmentSchema } from "./internal-DWpLw0t5.mjs";
5
+ import { a as hostOwnedFieldMessage, c as rejectedContactFields, i as toObjectTypeSlug, l as computeDealValue, n as matchesCondition, o as isHostOwned, r as slugify, s as rejectedCompanyFields, t as evaluateStage, u as contactSegmentSchema } from "./internal-BAw1MCMV.mjs";
6
6
  import { n as buildRelationships, r as relationshipViaSignature, t as buildFilterFromDiscriminator } from "./mapping-form-C7kDMWzp.mjs";
7
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-DQQdjw9I.mjs";
8
8
  import { i as explainEntitiesConfig, n as compileEntityView, r as compileEntityViews, t as DEFAULT_VIEW_PREFIX } from "./view-compiler-CSHSqZl7.mjs";
package/index.cjs CHANGED
@@ -2193,6 +2193,30 @@ function nodeOnlyDrivers(dependencies) {
2193
2193
  if (!dependencies) return [];
2194
2194
  return Object.keys(dependencies).filter((name) => NODE_ONLY_DRIVERS.has(name)).sort();
2195
2195
  }
2196
+ const NEXT_EDGE_BUNDLES_DRIVERS_MAJOR = 16;
2197
+ /**
2198
+ * Does this Next.js version need the edge-externals step?
2199
+ *
2200
+ * Only Next <= 15. Next 16 builds with Turbopack by default, and a post-init
2201
+ * Next 16.3 + `pg` app builds clean under Turbopack AND under `next build
2202
+ * --webpack` with no next.config help (verified 2026-11-12). Worse, handing
2203
+ * Turbopack a `webpack` block with no `turbopack` block FAILS the build, so on
2204
+ * 16 the step would break the very app it meant to fix. A version we cannot
2205
+ * read ("latest", "canary") resolves to 16 or later today, so it gets no step.
2206
+ */
2207
+ function nextNeedsEdgeExternals(versionRange) {
2208
+ const major = versionRange ? LEADING_MAJOR.exec(versionRange)?.[1] : void 0;
2209
+ return major !== void 0 && Number(major) < NEXT_EDGE_BUNDLES_DRIVERS_MAJOR;
2210
+ }
2211
+ /**
2212
+ * Does this next.config already externalise every driver on the edge pass?
2213
+ * A text check, not a parse: the developer owns the file and its shape varies,
2214
+ * so it asks only whether the edge branch is there and names each driver.
2215
+ */
2216
+ function nextConfigExternalisesDrivers(source, drivers) {
2217
+ if (!(source?.includes("nextRuntime") && source.includes("externals"))) return false;
2218
+ return drivers.every((d) => source.includes(`"${d}"`) || source.includes(`'${d}'`));
2219
+ }
2196
2220
  /** The next.config step an app needs when its config reaches a Node driver. */
2197
2221
  function nextEdgeExternalsStep(drivers) {
2198
2222
  const list = drivers.map((d) => `"${d}"`).join(", ");
@@ -2773,16 +2797,37 @@ function declaredNextVersion(args) {
2773
2797
  function declaredDependencies(args) {
2774
2798
  return hostManifest(args).dependencies;
2775
2799
  }
2776
- /** The edge-externals step, or null when no Node-only driver is declared. */
2777
- function edgeExternalsStepFor(dependencies) {
2778
- const drivers = nodeOnlyDrivers(dependencies);
2779
- return drivers.length > 0 ? nextEdgeExternalsStep(drivers) : null;
2800
+ const NEXT_CONFIG_CANDIDATES$1 = [
2801
+ "next.config.ts",
2802
+ "next.config.mjs",
2803
+ "next.config.js",
2804
+ "next.config.cjs",
2805
+ "next.config.mts"
2806
+ ];
2807
+ function nextConfigSource(args) {
2808
+ for (const candidate of NEXT_CONFIG_CANDIDATES$1) {
2809
+ const source = args.readFile((0, node_path.join)(args.cwd, candidate));
2810
+ if (source !== null) return source;
2811
+ }
2812
+ return null;
2813
+ }
2814
+ /**
2815
+ * The edge-externals step, or null when it does not apply: no Node-only driver,
2816
+ * Next >= 16 (whose edge pass bundles the driver unaided), or a next.config that already has
2817
+ * the edge externals in place.
2818
+ */
2819
+ function edgeExternalsStepFor(args) {
2820
+ const drivers = nodeOnlyDrivers(declaredDependencies(args));
2821
+ if (drivers.length === 0) return null;
2822
+ if (!nextNeedsEdgeExternals(declaredNextVersion(args))) return null;
2823
+ if (nextConfigExternalisesDrivers(nextConfigSource(args), drivers)) return null;
2824
+ return nextEdgeExternalsStep(drivers);
2780
2825
  }
2781
2826
  function planBootPatch(args) {
2782
2827
  if (bootHookPath(args.framework, args.layout) !== null) return {
2783
2828
  file: null,
2784
2829
  manual: args.framework === "nextjs" && nextNeedsInstrumentationFlag(declaredNextVersion(args)) ? NEXT_INSTRUMENTATION_FLAG_STEP : null,
2785
- extra: args.framework === "nextjs" ? edgeExternalsStepFor(declaredDependencies(args)) : null
2830
+ extra: args.framework === "nextjs" ? edgeExternalsStepFor(args) : null
2786
2831
  };
2787
2832
  if (args.framework === "remix") return {
2788
2833
  file: null,
package/index.mjs CHANGED
@@ -2192,6 +2192,30 @@ function nodeOnlyDrivers(dependencies) {
2192
2192
  if (!dependencies) return [];
2193
2193
  return Object.keys(dependencies).filter((name) => NODE_ONLY_DRIVERS.has(name)).sort();
2194
2194
  }
2195
+ const NEXT_EDGE_BUNDLES_DRIVERS_MAJOR = 16;
2196
+ /**
2197
+ * Does this Next.js version need the edge-externals step?
2198
+ *
2199
+ * Only Next <= 15. Next 16 builds with Turbopack by default, and a post-init
2200
+ * Next 16.3 + `pg` app builds clean under Turbopack AND under `next build
2201
+ * --webpack` with no next.config help (verified 2026-11-12). Worse, handing
2202
+ * Turbopack a `webpack` block with no `turbopack` block FAILS the build, so on
2203
+ * 16 the step would break the very app it meant to fix. A version we cannot
2204
+ * read ("latest", "canary") resolves to 16 or later today, so it gets no step.
2205
+ */
2206
+ function nextNeedsEdgeExternals(versionRange) {
2207
+ const major = versionRange ? LEADING_MAJOR.exec(versionRange)?.[1] : void 0;
2208
+ return major !== void 0 && Number(major) < NEXT_EDGE_BUNDLES_DRIVERS_MAJOR;
2209
+ }
2210
+ /**
2211
+ * Does this next.config already externalise every driver on the edge pass?
2212
+ * A text check, not a parse: the developer owns the file and its shape varies,
2213
+ * so it asks only whether the edge branch is there and names each driver.
2214
+ */
2215
+ function nextConfigExternalisesDrivers(source, drivers) {
2216
+ if (!(source?.includes("nextRuntime") && source.includes("externals"))) return false;
2217
+ return drivers.every((d) => source.includes(`"${d}"`) || source.includes(`'${d}'`));
2218
+ }
2195
2219
  /** The next.config step an app needs when its config reaches a Node driver. */
2196
2220
  function nextEdgeExternalsStep(drivers) {
2197
2221
  const list = drivers.map((d) => `"${d}"`).join(", ");
@@ -2772,16 +2796,37 @@ function declaredNextVersion(args) {
2772
2796
  function declaredDependencies(args) {
2773
2797
  return hostManifest(args).dependencies;
2774
2798
  }
2775
- /** The edge-externals step, or null when no Node-only driver is declared. */
2776
- function edgeExternalsStepFor(dependencies) {
2777
- const drivers = nodeOnlyDrivers(dependencies);
2778
- return drivers.length > 0 ? nextEdgeExternalsStep(drivers) : null;
2799
+ const NEXT_CONFIG_CANDIDATES$1 = [
2800
+ "next.config.ts",
2801
+ "next.config.mjs",
2802
+ "next.config.js",
2803
+ "next.config.cjs",
2804
+ "next.config.mts"
2805
+ ];
2806
+ function nextConfigSource(args) {
2807
+ for (const candidate of NEXT_CONFIG_CANDIDATES$1) {
2808
+ const source = args.readFile(join(args.cwd, candidate));
2809
+ if (source !== null) return source;
2810
+ }
2811
+ return null;
2812
+ }
2813
+ /**
2814
+ * The edge-externals step, or null when it does not apply: no Node-only driver,
2815
+ * Next >= 16 (whose edge pass bundles the driver unaided), or a next.config that already has
2816
+ * the edge externals in place.
2817
+ */
2818
+ function edgeExternalsStepFor(args) {
2819
+ const drivers = nodeOnlyDrivers(declaredDependencies(args));
2820
+ if (drivers.length === 0) return null;
2821
+ if (!nextNeedsEdgeExternals(declaredNextVersion(args))) return null;
2822
+ if (nextConfigExternalisesDrivers(nextConfigSource(args), drivers)) return null;
2823
+ return nextEdgeExternalsStep(drivers);
2779
2824
  }
2780
2825
  function planBootPatch(args) {
2781
2826
  if (bootHookPath(args.framework, args.layout) !== null) return {
2782
2827
  file: null,
2783
2828
  manual: args.framework === "nextjs" && nextNeedsInstrumentationFlag(declaredNextVersion(args)) ? NEXT_INSTRUMENTATION_FLAG_STEP : null,
2784
- extra: args.framework === "nextjs" ? edgeExternalsStepFor(declaredDependencies(args)) : null
2829
+ extra: args.framework === "nextjs" ? edgeExternalsStepFor(args) : null
2785
2830
  };
2786
2831
  if (args.framework === "remix") return {
2787
2832
  file: null,
@@ -32,8 +32,57 @@ const contactSegmentSchema = z.array(z.object({
32
32
  })).max(20);
33
33
  // ../core/src/deal-value.ts
34
34
  const MONTHS_PER_YEAR = 12;
35
+ const MONTHS_PER_QUARTER = 3;
36
+ const WEEKS_PER_YEAR = 52;
35
37
  /** Only two decimal-free seat counts make sense; anything else is bad data. */
36
38
  const SEAT_COUNT_REGEX = /^\d+$/;
39
+ const WHOLE_NUMBER_REGEX = /^\d+$/;
40
+ const DECIMAL_AMOUNT_REGEX = /^(\d+)(?:\.(\d{1,2}))?$/;
41
+ const INTERVAL_SYNONYMS = {
42
+ annual: "year",
43
+ annually: "year",
44
+ month: "month",
45
+ monthly: "month",
46
+ quarter: "quarter",
47
+ quarterly: "quarter",
48
+ week: "week",
49
+ weekly: "week",
50
+ year: "year",
51
+ yearly: "year"
52
+ };
53
+ /**
54
+ * Monthly share of one charge, as a fraction so the division happens once.
55
+ * A week is 52/12 of a month's worth per month: 52 charges a year, spread
56
+ * over twelve months.
57
+ */
58
+ const MONTHLY_FRACTION = {
59
+ month: {
60
+ denominator: 1,
61
+ numerator: 1
62
+ },
63
+ quarter: {
64
+ denominator: MONTHS_PER_QUARTER,
65
+ numerator: 1
66
+ },
67
+ week: {
68
+ denominator: MONTHS_PER_YEAR,
69
+ numerator: WEEKS_PER_YEAR
70
+ },
71
+ year: {
72
+ denominator: MONTHS_PER_YEAR,
73
+ numerator: 1
74
+ }
75
+ };
76
+ /**
77
+ * The billing interval a row names. `undefined` when no interval column is
78
+ * configured or mapped; `null` when it holds something unrecognised.
79
+ */
80
+ function readInterval(intervalField, fields, mappedFields) {
81
+ if (intervalField === void 0 || !mappedFields.has(intervalField)) return;
82
+ const raw = fields[intervalField]?.trim().toLowerCase();
83
+ if (!raw) return null;
84
+ return INTERVAL_SYNONYMS[raw] ?? null;
85
+ }
37
86
  /**
38
87
  * The value one deal should have, in cents, or null to leave it alone.
39
88
  *
@@ -45,15 +94,25 @@ const SEAT_COUNT_REGEX = /^\d+$/;
45
94
  */
46
95
  function computeDealValue(source, fields, mappedFields, stageType) {
47
96
  if (source.zeroInStageTypes?.includes(stageType)) return 0;
97
+ if (source.kind === "mapped_amount") return computeMappedAmount(source, fields, mappedFields);
98
+ return computePerSeat(source, fields, mappedFields);
99
+ }
100
+ function computePerSeat(source, fields, mappedFields) {
48
101
  if (!(mappedFields.has(source.seatField) && mappedFields.has(source.planField))) return null;
49
102
  const planKey = fields[source.planField];
50
103
  if (planKey == null || planKey === "") return null;
51
- const unitPriceCents = source.plans[planKey];
52
- if (unitPriceCents === void 0) return null;
53
104
  const rawSeats = fields[source.seatField];
54
105
  if (rawSeats == null || !SEAT_COUNT_REGEX.test(rawSeats)) return null;
55
106
  const seats = Number(rawSeats);
56
107
  if (!Number.isSafeInteger(seats)) return null;
108
+ const yearlyPrice = source.yearlyPlans?.[planKey];
109
+ if (yearlyPrice !== void 0 && readInterval(source.intervalField, fields, mappedFields) === "year") {
110
+ const yearly = (source.yearlyBaseFeeCents ?? (source.baseFeeCents ?? 0) * MONTHS_PER_YEAR) + seats * yearlyPrice;
111
+ if (!Number.isSafeInteger(yearly) || yearly < 0) return null;
112
+ return Math.round(yearly / MONTHS_PER_YEAR);
113
+ }
114
+ const unitPriceCents = source.plans[planKey];
115
+ if (unitPriceCents === void 0) return null;
57
116
  const monthly = (source.baseFeeCents ?? 0) + seats * unitPriceCents;
58
117
  if (!Number.isSafeInteger(monthly) || monthly < 0) return null;
59
118
  return normalizePrice(monthly, source, fields, mappedFields);
@@ -62,13 +121,43 @@ function computeDealValue(source, fields, mappedFields, stageType) {
62
121
  function normalizePrice(monthly, source, fields, mappedFields) {
63
122
  if (source.priceBasis === "monthly") return monthly;
64
123
  if (source.priceBasis === "billing_interval") {
65
- const interval = source.intervalField && mappedFields.has(source.intervalField) ? fields[source.intervalField]?.trim().toLowerCase() : null;
66
- if (interval === "month" || interval === "monthly") return monthly;
67
- if (interval === "year" || interval === "annual" || interval === "annually" || interval === "yearly") return Math.round(monthly / MONTHS_PER_YEAR);
124
+ const interval = readInterval(source.intervalField, fields, mappedFields);
125
+ if (interval === "month") return monthly;
126
+ if (interval === "year") return Math.round(monthly / MONTHS_PER_YEAR);
68
127
  return null;
69
128
  }
70
129
  return source.intervalField !== void 0 && mappedFields.has(source.intervalField) && fields[source.intervalField] === "year" ? Math.round(monthly / MONTHS_PER_YEAR) : monthly;
71
130
  }
131
+ /** A host amount in cents, or null when it is not one. */
132
+ function parseAmount(raw, unit) {
133
+ const text = raw?.trim();
134
+ if (!text) return null;
135
+ if (unit === "cents") return WHOLE_NUMBER_REGEX.test(text) ? Number(text) : null;
136
+ const match = DECIMAL_AMOUNT_REGEX.exec(text);
137
+ if (!match) return null;
138
+ const [, whole, fraction = ""] = match;
139
+ return Number(whole) * 100 + Number(fraction.padEnd(2, "0"));
140
+ }
141
+ function computeMappedAmount(source, fields, mappedFields) {
142
+ if (!mappedFields.has(source.amountField)) return null;
143
+ const amount = parseAmount(fields[source.amountField], source.amountUnit);
144
+ if (amount === null || !Number.isSafeInteger(amount)) return null;
145
+ const interval = source.intervalField === void 0 ? "month" : readInterval(source.intervalField, fields, mappedFields);
146
+ if (!interval) return null;
147
+ let count = 1;
148
+ if (source.intervalCountField !== void 0) {
149
+ if (!mappedFields.has(source.intervalCountField)) return null;
150
+ const rawCount = fields[source.intervalCountField]?.trim();
151
+ if (rawCount) {
152
+ if (!WHOLE_NUMBER_REGEX.test(rawCount) || Number(rawCount) < 1) return null;
153
+ count = Number(rawCount);
154
+ }
155
+ }
156
+ const { denominator, numerator } = MONTHLY_FRACTION[interval];
157
+ const scaled = amount * numerator;
158
+ if (!Number.isSafeInteger(scaled)) return null;
159
+ return Math.round(scaled / (denominator * count));
160
+ }
72
161
  // ../core/src/host-owned-fields.ts
73
162
  /**
74
163
  * Which fields a CRM record lets a user edit.
@@ -21,9 +21,52 @@ interface PerSeatValueSource {
21
21
  priceBasis?: "monthly" | "billing_interval";
22
22
  /** Mapped column holding the seat count. */
23
23
  seatField: string;
24
+ /**
25
+ * Annual flat fee in cents, for rows billed yearly at a yearly price. When
26
+ * absent, an annual row with a yearly plan price uses twelve times
27
+ * `baseFeeCents`, which is a monthly fee.
28
+ */
29
+ yearlyBaseFeeCents?: number;
30
+ /**
31
+ * Annual list price per seat in cents, keyed like `plans`. A row billed
32
+ * yearly whose plan has one is valued at (annual fee + seats × this) ÷ 12.
33
+ * One `plans` map cannot be both a monthly and a yearly price, which is why
34
+ * an annual plan that is not simply twelve months needs its own number.
35
+ */
36
+ yearlyPlans?: Record<string, number>;
24
37
  /** Stage types whose deals are worth nothing (usually `["lost"]`). */
25
38
  zeroInStageTypes?: string[];
26
39
  }
40
+ /**
41
+ * Value read from an amount the host's billing system already knows.
42
+ *
43
+ * The recommended source whenever the host has it: negotiated prices,
44
+ * discounts and multi-item subscriptions are all already in the billed
45
+ * amount, so Clivly does not have to model a price book to get them right.
46
+ */
47
+ interface MappedAmountValueSource {
48
+ /** Mapped column holding the amount charged each billing period. */
49
+ amountField: string;
50
+ /**
51
+ * How the amount is written: `cents` for minor units (Stripe's `amount`,
52
+ * `1250`), `units` for a decimal amount (`12.50`).
53
+ */
54
+ amountUnit: "cents" | "units";
55
+ /**
56
+ * Mapped column holding how many intervals one charge covers (Stripe's
57
+ * `interval_count`: 3 with `month` is quarterly). Absent means 1.
58
+ */
59
+ intervalCountField?: string;
60
+ /**
61
+ * Mapped column holding the billing interval: month, quarter, year or week.
62
+ * Absent means every amount is already monthly.
63
+ */
64
+ intervalField?: string;
65
+ kind: "mapped_amount";
66
+ /** Stage types whose deals are worth nothing (usually `["lost"]`). */
67
+ zeroInStageTypes?: string[];
68
+ }
69
+ type DealValueSource = PerSeatValueSource | MappedAmountValueSource;
27
70
  /**
28
71
  * The value one deal should have, in cents, or null to leave it alone.
29
72
  *
@@ -33,7 +76,7 @@ interface PerSeatValueSource {
33
76
  * unmapped case is surfaced through the rule-health warning surface instead of
34
77
  * being written into the data — the same fail-safe `matchesCondition` applies.
35
78
  */
36
- declare function computeDealValue(source: PerSeatValueSource, fields: Record<string, string | null>, mappedFields: Set<string>, stageType: string): number | null;
79
+ declare function computeDealValue(source: DealValueSource, fields: Record<string, string | null>, mappedFields: Set<string>, stageType: string): number | null;
37
80
  /**
38
81
  * Which fields a CRM record lets a user edit.
39
82
  *
@@ -182,4 +225,4 @@ declare function matchesCondition(condition: Condition, fields: Record<string, s
182
225
  * a half-written rule should do.
183
226
  */
184
227
  declare function evaluateStage(rules: EvaluableRule[], fields: Record<string, string | null>, mappedFields: Set<string>): string | null;
185
- export { matchesCondition as a, HostOwnedCompanyField as c, hostOwnedFieldMessage as d, isHostOwned as f, computeDealValue as g, PerSeatValueSource as h, evaluateStage as i, HostOwnedContactField as l, rejectedContactFields as m, ConditionOp as n, slugify as o, rejectedCompanyFields as p, EvaluableRule as r, toObjectTypeSlug as s, Condition as t, SourcedRecord as u };
228
+ export { PerSeatValueSource as _, matchesCondition as a, HostOwnedCompanyField as c, hostOwnedFieldMessage as d, isHostOwned as f, MappedAmountValueSource as g, DealValueSource as h, evaluateStage as i, HostOwnedContactField as l, rejectedContactFields as m, ConditionOp as n, slugify as o, rejectedCompanyFields as p, EvaluableRule as r, toObjectTypeSlug as s, Condition as t, SourcedRecord as u, computeDealValue as v };
@@ -21,9 +21,52 @@ interface PerSeatValueSource {
21
21
  priceBasis?: "monthly" | "billing_interval";
22
22
  /** Mapped column holding the seat count. */
23
23
  seatField: string;
24
+ /**
25
+ * Annual flat fee in cents, for rows billed yearly at a yearly price. When
26
+ * absent, an annual row with a yearly plan price uses twelve times
27
+ * `baseFeeCents`, which is a monthly fee.
28
+ */
29
+ yearlyBaseFeeCents?: number;
30
+ /**
31
+ * Annual list price per seat in cents, keyed like `plans`. A row billed
32
+ * yearly whose plan has one is valued at (annual fee + seats × this) ÷ 12.
33
+ * One `plans` map cannot be both a monthly and a yearly price, which is why
34
+ * an annual plan that is not simply twelve months needs its own number.
35
+ */
36
+ yearlyPlans?: Record<string, number>;
24
37
  /** Stage types whose deals are worth nothing (usually `["lost"]`). */
25
38
  zeroInStageTypes?: string[];
26
39
  }
40
+ /**
41
+ * Value read from an amount the host's billing system already knows.
42
+ *
43
+ * The recommended source whenever the host has it: negotiated prices,
44
+ * discounts and multi-item subscriptions are all already in the billed
45
+ * amount, so Clivly does not have to model a price book to get them right.
46
+ */
47
+ interface MappedAmountValueSource {
48
+ /** Mapped column holding the amount charged each billing period. */
49
+ amountField: string;
50
+ /**
51
+ * How the amount is written: `cents` for minor units (Stripe's `amount`,
52
+ * `1250`), `units` for a decimal amount (`12.50`).
53
+ */
54
+ amountUnit: "cents" | "units";
55
+ /**
56
+ * Mapped column holding how many intervals one charge covers (Stripe's
57
+ * `interval_count`: 3 with `month` is quarterly). Absent means 1.
58
+ */
59
+ intervalCountField?: string;
60
+ /**
61
+ * Mapped column holding the billing interval: month, quarter, year or week.
62
+ * Absent means every amount is already monthly.
63
+ */
64
+ intervalField?: string;
65
+ kind: "mapped_amount";
66
+ /** Stage types whose deals are worth nothing (usually `["lost"]`). */
67
+ zeroInStageTypes?: string[];
68
+ }
69
+ type DealValueSource = PerSeatValueSource | MappedAmountValueSource;
27
70
  /**
28
71
  * The value one deal should have, in cents, or null to leave it alone.
29
72
  *
@@ -33,7 +76,7 @@ interface PerSeatValueSource {
33
76
  * unmapped case is surfaced through the rule-health warning surface instead of
34
77
  * being written into the data — the same fail-safe `matchesCondition` applies.
35
78
  */
36
- declare function computeDealValue(source: PerSeatValueSource, fields: Record<string, string | null>, mappedFields: Set<string>, stageType: string): number | null;
79
+ declare function computeDealValue(source: DealValueSource, fields: Record<string, string | null>, mappedFields: Set<string>, stageType: string): number | null;
37
80
  /**
38
81
  * Which fields a CRM record lets a user edit.
39
82
  *
@@ -182,4 +225,4 @@ declare function matchesCondition(condition: Condition, fields: Record<string, s
182
225
  * a half-written rule should do.
183
226
  */
184
227
  declare function evaluateStage(rules: EvaluableRule[], fields: Record<string, string | null>, mappedFields: Set<string>): string | null;
185
- export { matchesCondition as a, HostOwnedCompanyField as c, hostOwnedFieldMessage as d, isHostOwned as f, computeDealValue as g, PerSeatValueSource as h, evaluateStage as i, HostOwnedContactField as l, rejectedContactFields as m, ConditionOp as n, slugify as o, rejectedCompanyFields as p, EvaluableRule as r, toObjectTypeSlug as s, Condition as t, SourcedRecord as u };
228
+ export { PerSeatValueSource as _, matchesCondition as a, HostOwnedCompanyField as c, hostOwnedFieldMessage as d, isHostOwned as f, MappedAmountValueSource as g, DealValueSource as h, evaluateStage as i, HostOwnedContactField as l, rejectedContactFields as m, ConditionOp as n, slugify as o, rejectedCompanyFields as p, EvaluableRule as r, toObjectTypeSlug as s, Condition as t, SourcedRecord as u, computeDealValue as v };
@@ -32,8 +32,57 @@ const contactSegmentSchema = zod.z.array(zod.z.object({
32
32
  })).max(20);
33
33
  // ../core/src/deal-value.ts
34
34
  const MONTHS_PER_YEAR = 12;
35
+ const MONTHS_PER_QUARTER = 3;
36
+ const WEEKS_PER_YEAR = 52;
35
37
  /** Only two decimal-free seat counts make sense; anything else is bad data. */
36
38
  const SEAT_COUNT_REGEX = /^\d+$/;
39
+ const WHOLE_NUMBER_REGEX = /^\d+$/;
40
+ const DECIMAL_AMOUNT_REGEX = /^(\d+)(?:\.(\d{1,2}))?$/;
41
+ const INTERVAL_SYNONYMS = {
42
+ annual: "year",
43
+ annually: "year",
44
+ month: "month",
45
+ monthly: "month",
46
+ quarter: "quarter",
47
+ quarterly: "quarter",
48
+ week: "week",
49
+ weekly: "week",
50
+ year: "year",
51
+ yearly: "year"
52
+ };
53
+ /**
54
+ * Monthly share of one charge, as a fraction so the division happens once.
55
+ * A week is 52/12 of a month's worth per month: 52 charges a year, spread
56
+ * over twelve months.
57
+ */
58
+ const MONTHLY_FRACTION = {
59
+ month: {
60
+ denominator: 1,
61
+ numerator: 1
62
+ },
63
+ quarter: {
64
+ denominator: MONTHS_PER_QUARTER,
65
+ numerator: 1
66
+ },
67
+ week: {
68
+ denominator: MONTHS_PER_YEAR,
69
+ numerator: WEEKS_PER_YEAR
70
+ },
71
+ year: {
72
+ denominator: MONTHS_PER_YEAR,
73
+ numerator: 1
74
+ }
75
+ };
76
+ /**
77
+ * The billing interval a row names. `undefined` when no interval column is
78
+ * configured or mapped; `null` when it holds something unrecognised.
79
+ */
80
+ function readInterval(intervalField, fields, mappedFields) {
81
+ if (intervalField === void 0 || !mappedFields.has(intervalField)) return;
82
+ const raw = fields[intervalField]?.trim().toLowerCase();
83
+ if (!raw) return null;
84
+ return INTERVAL_SYNONYMS[raw] ?? null;
85
+ }
37
86
  /**
38
87
  * The value one deal should have, in cents, or null to leave it alone.
39
88
  *
@@ -45,15 +94,25 @@ const SEAT_COUNT_REGEX = /^\d+$/;
45
94
  */
46
95
  function computeDealValue(source, fields, mappedFields, stageType) {
47
96
  if (source.zeroInStageTypes?.includes(stageType)) return 0;
97
+ if (source.kind === "mapped_amount") return computeMappedAmount(source, fields, mappedFields);
98
+ return computePerSeat(source, fields, mappedFields);
99
+ }
100
+ function computePerSeat(source, fields, mappedFields) {
48
101
  if (!(mappedFields.has(source.seatField) && mappedFields.has(source.planField))) return null;
49
102
  const planKey = fields[source.planField];
50
103
  if (planKey == null || planKey === "") return null;
51
- const unitPriceCents = source.plans[planKey];
52
- if (unitPriceCents === void 0) return null;
53
104
  const rawSeats = fields[source.seatField];
54
105
  if (rawSeats == null || !SEAT_COUNT_REGEX.test(rawSeats)) return null;
55
106
  const seats = Number(rawSeats);
56
107
  if (!Number.isSafeInteger(seats)) return null;
108
+ const yearlyPrice = source.yearlyPlans?.[planKey];
109
+ if (yearlyPrice !== void 0 && readInterval(source.intervalField, fields, mappedFields) === "year") {
110
+ const yearly = (source.yearlyBaseFeeCents ?? (source.baseFeeCents ?? 0) * MONTHS_PER_YEAR) + seats * yearlyPrice;
111
+ if (!Number.isSafeInteger(yearly) || yearly < 0) return null;
112
+ return Math.round(yearly / MONTHS_PER_YEAR);
113
+ }
114
+ const unitPriceCents = source.plans[planKey];
115
+ if (unitPriceCents === void 0) return null;
57
116
  const monthly = (source.baseFeeCents ?? 0) + seats * unitPriceCents;
58
117
  if (!Number.isSafeInteger(monthly) || monthly < 0) return null;
59
118
  return normalizePrice(monthly, source, fields, mappedFields);
@@ -62,13 +121,43 @@ function computeDealValue(source, fields, mappedFields, stageType) {
62
121
  function normalizePrice(monthly, source, fields, mappedFields) {
63
122
  if (source.priceBasis === "monthly") return monthly;
64
123
  if (source.priceBasis === "billing_interval") {
65
- const interval = source.intervalField && mappedFields.has(source.intervalField) ? fields[source.intervalField]?.trim().toLowerCase() : null;
66
- if (interval === "month" || interval === "monthly") return monthly;
67
- if (interval === "year" || interval === "annual" || interval === "annually" || interval === "yearly") return Math.round(monthly / MONTHS_PER_YEAR);
124
+ const interval = readInterval(source.intervalField, fields, mappedFields);
125
+ if (interval === "month") return monthly;
126
+ if (interval === "year") return Math.round(monthly / MONTHS_PER_YEAR);
68
127
  return null;
69
128
  }
70
129
  return source.intervalField !== void 0 && mappedFields.has(source.intervalField) && fields[source.intervalField] === "year" ? Math.round(monthly / MONTHS_PER_YEAR) : monthly;
71
130
  }
131
+ /** A host amount in cents, or null when it is not one. */
132
+ function parseAmount(raw, unit) {
133
+ const text = raw?.trim();
134
+ if (!text) return null;
135
+ if (unit === "cents") return WHOLE_NUMBER_REGEX.test(text) ? Number(text) : null;
136
+ const match = DECIMAL_AMOUNT_REGEX.exec(text);
137
+ if (!match) return null;
138
+ const [, whole, fraction = ""] = match;
139
+ return Number(whole) * 100 + Number(fraction.padEnd(2, "0"));
140
+ }
141
+ function computeMappedAmount(source, fields, mappedFields) {
142
+ if (!mappedFields.has(source.amountField)) return null;
143
+ const amount = parseAmount(fields[source.amountField], source.amountUnit);
144
+ if (amount === null || !Number.isSafeInteger(amount)) return null;
145
+ const interval = source.intervalField === void 0 ? "month" : readInterval(source.intervalField, fields, mappedFields);
146
+ if (!interval) return null;
147
+ let count = 1;
148
+ if (source.intervalCountField !== void 0) {
149
+ if (!mappedFields.has(source.intervalCountField)) return null;
150
+ const rawCount = fields[source.intervalCountField]?.trim();
151
+ if (rawCount) {
152
+ if (!WHOLE_NUMBER_REGEX.test(rawCount) || Number(rawCount) < 1) return null;
153
+ count = Number(rawCount);
154
+ }
155
+ }
156
+ const { denominator, numerator } = MONTHLY_FRACTION[interval];
157
+ const scaled = amount * numerator;
158
+ if (!Number.isSafeInteger(scaled)) return null;
159
+ return Math.round(scaled / (denominator * count));
160
+ }
72
161
  // ../core/src/host-owned-fields.ts
73
162
  /**
74
163
  * Which fields a CRM record lets a user edit.
package/internal.cjs CHANGED
@@ -3,7 +3,7 @@ const require_projection = require("./projection-w4Z6vSL2.cjs");
3
3
  const require_entity_config = require("./entity-config-BP8Cc_nC.cjs");
4
4
  const require_mappings_config = require("./mappings-config-CC-vltWb.cjs");
5
5
  const require_auth_adapter = require("./auth-adapter-CNVuxT9W.cjs");
6
- const require_internal = require("./internal-G5tXjqwl.cjs");
6
+ const require_internal = require("./internal-D88LTRlu.cjs");
7
7
  const require_mapping_form = require("./mapping-form-Bs6JQurC.cjs");
8
8
  const require_projection_sql = require("./projection-sql-BkrHR2ea.cjs");
9
9
  const require_view_compiler = require("./view-compiler-NqiortOA.cjs");
package/internal.d.cts CHANGED
@@ -6,6 +6,6 @@ import { i as relationshipViaSignature, n as buildFilterFromDiscriminator, r as
6
6
  import { i as mappingsToEntitiesConfig, t as EntityMappingRow } from "./mappings-config-DNo_Cum_.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-BDD93Luw.cjs";
8
8
  import { c as SyncAction, f as isRemovalAction, g as runSync, h as resolveActions, l as SyncResult, m as reconcile, n as MirrorRecord, o as ResolvedMembership, r as PersistAction, s as SourceRow, t as EntitySyncResult, u as SyncStore } from "./sync-engine-DCjTr2XQ.cjs";
9
- import { a as matchesCondition, c as HostOwnedCompanyField, d as hostOwnedFieldMessage, f as isHostOwned, g as computeDealValue, h as PerSeatValueSource, i as evaluateStage, l as HostOwnedContactField, m as rejectedContactFields, n as ConditionOp, o as slugify, p as rejectedCompanyFields, r as EvaluableRule, s as toObjectTypeSlug, t as Condition, u as SourcedRecord } from "./internal-Nrhf76Jn.cjs";
9
+ import { _ as PerSeatValueSource, a as matchesCondition, c as HostOwnedCompanyField, d as hostOwnedFieldMessage, f as isHostOwned, g as MappedAmountValueSource, h as DealValueSource, i as evaluateStage, l as HostOwnedContactField, m as rejectedContactFields, n as ConditionOp, o as slugify, p as rejectedCompanyFields, r as EvaluableRule, s as toObjectTypeSlug, t as Condition, u as SourcedRecord, v as computeDealValue } from "./internal-D7qVRIFb.cjs";
10
10
  import { C as StepProblem, S as StepId, _ as IntegrationFacts, a as validateProjection, b as IntegrationStep, c as compileProjectionFrom, d as compileProjectionPreview, f as compileProjectionSelect, g as ConnectionLiveness, h as joinFansOut, i as primaryKeyColumns, l as compileProjectionIdentity, m as fanOutJoins, n as coversUniqueKey, o as validateProjectionFilter, p as quoteIdent, r as hasRichMeta, s as PREVIEW_MAX_ROWS, t as columnMetaFor, u as compileProjectionJoins, v as IntegrationState, w as StepState, x as NextAction, y as IntegrationStatus } from "./index-DRRTE5IJ.cjs";
11
- export { type Activity, type ActivityType, BASE_REF, CANONICAL_FIELDS, type CRMAdapter, CRM_CONCEPTS, type ClivlyAuthAdapter, ClivlyConfigError, type ClivlyEntitiesConfig, type ClivlyEntityConfig, type ClivlyUser, type Company, type CompanyFilters, type CompileOptions, type CompiledView, type Condition, type ConditionOp, type ConfigValidationError, type ConfigValidationResult, type ConnectionLiveness, type Contact, type ContactFilters, type ContactSegment, type ContactSource, type ContactStatus, type CreateActivityInput, type CreateCompanyInput, type CreateContactInput, type CreateDealInput, type CreateTaskInput, type CrmConcept, type CrmMembership, type CrmRole, DEFAULT_VIEW_PREFIX, type Deal, type DealStage, type 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 ResolvedMembership, type SourceRow, type SourcedRecord, type StageType, type StepId, type StepProblem, type StepState, type SyncAction, type SyncResult, type SyncStore, type Task, type TaskEntityType, type TaskFilters, type TaskPriority, type TaskStatus, type UpdateCompanyInput, type UpdateContactInput, type UpdateDealInput, type UpdateTaskInput, type ValueInterval, authCustom, buildFilterFromDiscriminator, buildRelationships, columnMetaFor, compileEntityView, compileEntityViews, compileProjectionFrom, compileProjectionIdentity, compileProjectionJoins, compileProjectionPreview, compileProjectionSelect, computeDealValue, contactSegmentSchema, coversUniqueKey, defineClivlyConfig, entitiesConfigSchema, evaluateStage, explainEntitiesConfig, fanOutJoins, filterSchema, hasRichMeta, hostOwnedFieldMessage, identityRefs, isClosedStageType, isHostOwned, isRemovalAction, joinFansOut, mappingsToEntitiesConfig, matchesCondition, missingRequiredFields, primaryKeyColumns, projectionFields, projectionSchema, quoteIdent, reconcile, rejectedCompanyFields, rejectedContactFields, relationshipSchema, relationshipViaSignature, relationshipsSchema, requiredFieldsFor, resolveActions, runSync, slugify, toObjectTypeSlug, validateEntitiesConfig, validateProjection, validateProjectionFilter };
11
+ export { type Activity, type ActivityType, BASE_REF, CANONICAL_FIELDS, type CRMAdapter, CRM_CONCEPTS, type ClivlyAuthAdapter, ClivlyConfigError, type ClivlyEntitiesConfig, type ClivlyEntityConfig, type ClivlyUser, type Company, type CompanyFilters, type CompileOptions, type CompiledView, type Condition, type ConditionOp, type ConfigValidationError, type ConfigValidationResult, type ConnectionLiveness, type Contact, type ContactFilters, type ContactSegment, type ContactSource, type ContactStatus, type CreateActivityInput, type CreateCompanyInput, type CreateContactInput, type CreateDealInput, type CreateTaskInput, type CrmConcept, type CrmMembership, type CrmRole, DEFAULT_VIEW_PREFIX, type Deal, type DealStage, type DealValueSource, type DiscoveredColumnMeta, type DiscoveredSchemaTable, type EntityMappingRow, type EntitySyncResult, type EvaluableRule, type ExplainResult, type FilterExpr, type FilterValue, type HostOwnedCompanyField, type HostOwnedContactField, type IntegrationFacts, type IntegrationState, type IntegrationStatus, type IntegrationStep, MATERIALIZING_CONCEPTS, type MappedAmountValueSource, type MaterializingConcept, type MembershipResolver, type MirrorRecord, type NextAction, type Note, OPEN_STAGE_TYPE, PREVIEW_MAX_ROWS, PROJECTION_KEY_PATTERN, type Page, type PageRequest, type PerSeatValueSource, type PersistAction, type PipelineConfig, type PipelineKind, type PipelineStageConfig, type ProjectionFieldBinding, type ProjectionIdentity, type ProjectionJoin, type ProjectionMapping, type ProjectionRef, REQUIRED_FIELDS, type RecordSource, type RelationshipCandidate, type RelationshipSpec, type RelationshipVia, type RelationshipsMap, type ResolvedMembership, type SourceRow, type SourcedRecord, type StageType, type StepId, type StepProblem, type StepState, type SyncAction, type SyncResult, type SyncStore, type Task, type TaskEntityType, type TaskFilters, type TaskPriority, type TaskStatus, type UpdateCompanyInput, type UpdateContactInput, type UpdateDealInput, type UpdateTaskInput, type ValueInterval, authCustom, buildFilterFromDiscriminator, buildRelationships, columnMetaFor, compileEntityView, compileEntityViews, compileProjectionFrom, compileProjectionIdentity, compileProjectionJoins, compileProjectionPreview, compileProjectionSelect, computeDealValue, contactSegmentSchema, coversUniqueKey, defineClivlyConfig, entitiesConfigSchema, evaluateStage, explainEntitiesConfig, fanOutJoins, filterSchema, hasRichMeta, hostOwnedFieldMessage, identityRefs, isClosedStageType, isHostOwned, isRemovalAction, joinFansOut, mappingsToEntitiesConfig, matchesCondition, missingRequiredFields, primaryKeyColumns, projectionFields, projectionSchema, quoteIdent, reconcile, rejectedCompanyFields, rejectedContactFields, relationshipSchema, relationshipViaSignature, relationshipsSchema, requiredFieldsFor, resolveActions, runSync, slugify, toObjectTypeSlug, validateEntitiesConfig, validateProjection, validateProjectionFilter };
package/internal.d.mts CHANGED
@@ -6,6 +6,6 @@ import { i as relationshipViaSignature, n as buildFilterFromDiscriminator, r as
6
6
  import { i as mappingsToEntitiesConfig, t as EntityMappingRow } from "./mappings-config-wAe-p1rG.mjs";
7
7
  import { a as compileEntityView, i as ExplainResult, n as CompiledView, o as compileEntityViews, r as DEFAULT_VIEW_PREFIX, s as explainEntitiesConfig, t as CompileOptions } from "./view-compiler-CSNhmCY2.mjs";
8
8
  import { c as SyncAction, f as isRemovalAction, g as runSync, h as resolveActions, l as SyncResult, m as reconcile, n as MirrorRecord, o as ResolvedMembership, r as PersistAction, s as SourceRow, t as EntitySyncResult, u as SyncStore } from "./sync-engine-UNORma7f.mjs";
9
- import { a as matchesCondition, c as HostOwnedCompanyField, d as hostOwnedFieldMessage, f as isHostOwned, g as computeDealValue, h as PerSeatValueSource, i as evaluateStage, l as HostOwnedContactField, m as rejectedContactFields, n as ConditionOp, o as slugify, p as rejectedCompanyFields, r as EvaluableRule, s as toObjectTypeSlug, t as Condition, u as SourcedRecord } from "./internal-C8TGcv_X.mjs";
9
+ import { _ as PerSeatValueSource, a as matchesCondition, c as HostOwnedCompanyField, d as hostOwnedFieldMessage, f as isHostOwned, g as MappedAmountValueSource, h as DealValueSource, i as evaluateStage, l as HostOwnedContactField, m as rejectedContactFields, n as ConditionOp, o as slugify, p as rejectedCompanyFields, r as EvaluableRule, s as toObjectTypeSlug, t as Condition, u as SourcedRecord, v as computeDealValue } from "./internal-CdfVkh4O.mjs";
10
10
  import { C as StepProblem, S as StepId, _ as IntegrationFacts, a as validateProjection, b as IntegrationStep, c as compileProjectionFrom, d as compileProjectionPreview, f as compileProjectionSelect, g as ConnectionLiveness, h as joinFansOut, i as primaryKeyColumns, l as compileProjectionIdentity, m as fanOutJoins, n as coversUniqueKey, o as validateProjectionFilter, p as quoteIdent, r as hasRichMeta, s as PREVIEW_MAX_ROWS, t as columnMetaFor, u as compileProjectionJoins, v as IntegrationState, w as StepState, x as NextAction, y as IntegrationStatus } from "./index-Bh7o2J7K.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 ContactSegment, type ContactSource, type ContactStatus, type CreateActivityInput, type CreateCompanyInput, type CreateContactInput, type CreateDealInput, type CreateTaskInput, type CrmConcept, type CrmMembership, type CrmRole, DEFAULT_VIEW_PREFIX, type Deal, type DealStage, type 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 ResolvedMembership, type SourceRow, type SourcedRecord, type StageType, type StepId, type StepProblem, type StepState, type SyncAction, type SyncResult, type SyncStore, type Task, type TaskEntityType, type TaskFilters, type TaskPriority, type TaskStatus, type UpdateCompanyInput, type UpdateContactInput, type UpdateDealInput, type UpdateTaskInput, type ValueInterval, authCustom, buildFilterFromDiscriminator, buildRelationships, columnMetaFor, compileEntityView, compileEntityViews, compileProjectionFrom, compileProjectionIdentity, compileProjectionJoins, compileProjectionPreview, compileProjectionSelect, computeDealValue, contactSegmentSchema, coversUniqueKey, defineClivlyConfig, entitiesConfigSchema, evaluateStage, explainEntitiesConfig, fanOutJoins, filterSchema, hasRichMeta, hostOwnedFieldMessage, identityRefs, isClosedStageType, isHostOwned, isRemovalAction, joinFansOut, mappingsToEntitiesConfig, matchesCondition, missingRequiredFields, primaryKeyColumns, projectionFields, projectionSchema, quoteIdent, reconcile, rejectedCompanyFields, rejectedContactFields, relationshipSchema, relationshipViaSignature, relationshipsSchema, requiredFieldsFor, resolveActions, runSync, slugify, toObjectTypeSlug, validateEntitiesConfig, validateProjection, validateProjectionFilter };
11
+ export { type Activity, type ActivityType, BASE_REF, CANONICAL_FIELDS, type CRMAdapter, CRM_CONCEPTS, type ClivlyAuthAdapter, ClivlyConfigError, type ClivlyEntitiesConfig, type ClivlyEntityConfig, type ClivlyUser, type Company, type CompanyFilters, type CompileOptions, type CompiledView, type Condition, type ConditionOp, type ConfigValidationError, type ConfigValidationResult, type ConnectionLiveness, type Contact, type ContactFilters, type ContactSegment, type ContactSource, type ContactStatus, type CreateActivityInput, type CreateCompanyInput, type CreateContactInput, type CreateDealInput, type CreateTaskInput, type CrmConcept, type CrmMembership, type CrmRole, DEFAULT_VIEW_PREFIX, type Deal, type DealStage, type DealValueSource, type DiscoveredColumnMeta, type DiscoveredSchemaTable, type EntityMappingRow, type EntitySyncResult, type EvaluableRule, type ExplainResult, type FilterExpr, type FilterValue, type HostOwnedCompanyField, type HostOwnedContactField, type IntegrationFacts, type IntegrationState, type IntegrationStatus, type IntegrationStep, MATERIALIZING_CONCEPTS, type MappedAmountValueSource, type MaterializingConcept, type MembershipResolver, type MirrorRecord, type NextAction, type Note, OPEN_STAGE_TYPE, PREVIEW_MAX_ROWS, PROJECTION_KEY_PATTERN, type Page, type PageRequest, type PerSeatValueSource, type PersistAction, type PipelineConfig, type PipelineKind, type PipelineStageConfig, type ProjectionFieldBinding, type ProjectionIdentity, type ProjectionJoin, type ProjectionMapping, type ProjectionRef, REQUIRED_FIELDS, type RecordSource, type RelationshipCandidate, type RelationshipSpec, type RelationshipVia, type RelationshipsMap, type ResolvedMembership, type SourceRow, type SourcedRecord, type StageType, type StepId, type StepProblem, type StepState, type SyncAction, type SyncResult, type SyncStore, type Task, type TaskEntityType, type TaskFilters, type TaskPriority, type TaskStatus, type UpdateCompanyInput, type UpdateContactInput, type UpdateDealInput, type UpdateTaskInput, type ValueInterval, authCustom, buildFilterFromDiscriminator, buildRelationships, columnMetaFor, compileEntityView, compileEntityViews, compileProjectionFrom, compileProjectionIdentity, compileProjectionJoins, compileProjectionPreview, compileProjectionSelect, computeDealValue, contactSegmentSchema, coversUniqueKey, defineClivlyConfig, entitiesConfigSchema, evaluateStage, explainEntitiesConfig, fanOutJoins, filterSchema, hasRichMeta, hostOwnedFieldMessage, identityRefs, isClosedStageType, isHostOwned, isRemovalAction, joinFansOut, mappingsToEntitiesConfig, matchesCondition, missingRequiredFields, primaryKeyColumns, projectionFields, projectionSchema, quoteIdent, reconcile, rejectedCompanyFields, rejectedContactFields, relationshipSchema, relationshipViaSignature, relationshipsSchema, requiredFieldsFor, resolveActions, runSync, slugify, toObjectTypeSlug, validateEntitiesConfig, validateProjection, validateProjectionFilter };
package/internal.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-CI5CGfaN.mjs";
3
3
  import { n as mappingsToEntitiesConfig } from "./mappings-config-Opw7ZM6Y.mjs";
4
4
  import { t as authCustom } from "./auth-adapter-u91PByaw.mjs";
5
- import { a as hostOwnedFieldMessage, c as rejectedContactFields, i as toObjectTypeSlug, l as computeDealValue, n as matchesCondition, o as isHostOwned, r as slugify, s as rejectedCompanyFields, t as evaluateStage, u as contactSegmentSchema } from "./internal-DWpLw0t5.mjs";
5
+ import { a as hostOwnedFieldMessage, c as rejectedContactFields, i as toObjectTypeSlug, l as computeDealValue, n as matchesCondition, o as isHostOwned, r as slugify, s as rejectedCompanyFields, t as evaluateStage, u as contactSegmentSchema } from "./internal-BAw1MCMV.mjs";
6
6
  import { n as buildRelationships, r as relationshipViaSignature, t as buildFilterFromDiscriminator } from "./mapping-form-C7kDMWzp.mjs";
7
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-DQQdjw9I.mjs";
8
8
  import { i as explainEntitiesConfig, n as compileEntityView, r as compileEntityViews, t as DEFAULT_VIEW_PREFIX } from "./view-compiler-CSHSqZl7.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clivly",
3
- "version": "0.21.0",
3
+ "version": "0.22.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Clivly CLI — scaffold a CRM into your app (clivly init).",