clivly 0.17.1 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -6
- package/{adapter-C63F9VZL.d.mts → adapter-BXykDFyG.d.mts} +1 -1
- package/{adapter-OO5g17qF.d.cts → adapter-BiUN_I3u.d.cts} +1 -1
- package/{auth-adapter-COMP0Fud.d.cts → auth-adapter-BNvri2gX.d.mts} +1 -1
- package/{auth-adapter-ZlhllVpm.d.mts → auth-adapter-D2MUT1Hk.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.d.cts +4 -4
- package/core.d.mts +4 -4
- package/drizzle.d.cts +1 -1
- package/drizzle.d.mts +1 -1
- package/index.cjs +54 -6
- package/index.mjs +54 -6
- 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.d.cts +4 -4
- package/internal.d.mts +4 -4
- package/{namespace-probe-Dt_HXcI-.d.mts → namespace-probe-BAXprXQh.d.mts} +18 -3
- package/{namespace-probe-BHk3NcyI.d.cts → namespace-probe-qgjiudCo.d.cts} +18 -3
- package/package.json +1 -1
- package/{sdk-BZSTXPyK.cjs → sdk-D53fH4uu.cjs} +10 -8
- package/{sdk-KzHpSf7F.mjs → sdk-D5J7kRQm.mjs} +10 -8
- package/sdk.cjs +1 -1
- package/sdk.d.cts +1 -1
- package/sdk.d.mts +1 -1
- package/sdk.mjs +1 -1
- package/{types-CQ2DgEH7.d.cts → types-C08UluBS.d.cts} +22 -1
- package/{types-C9_2vW5a.d.mts → types-CZsSYbeC.d.mts} +22 -1
- package/vite.d.cts +1 -1
- package/vite.d.mts +1 -1
package/README.md
CHANGED
|
@@ -286,7 +286,7 @@ It answers two questions under two headings:
|
|
|
286
286
|
- **This project** — the local ladder, run here on your machine: credential →
|
|
287
287
|
Clivly reachable → `clivly.config` loads → `clivly.config` is edge-safe →
|
|
288
288
|
sync cursor persists → boot hook wired → setup checks → dashboard-authored
|
|
289
|
-
objects → sync trigger URL.
|
|
289
|
+
objects → sync trigger URL → sync trigger secret.
|
|
290
290
|
|
|
291
291
|
```text
|
|
292
292
|
Clivly status
|
|
@@ -299,8 +299,8 @@ Workspace
|
|
|
299
299
|
🔒 Let Clivly start a sync
|
|
300
300
|
|
|
301
301
|
This project
|
|
302
|
-
✅ Step 1 of
|
|
303
|
-
✅ Step 2 of
|
|
302
|
+
✅ Step 1 of 10 · API key present
|
|
303
|
+
✅ Step 2 of 10 · Clivly reachable — Acme
|
|
304
304
|
...
|
|
305
305
|
```
|
|
306
306
|
|
|
@@ -334,6 +334,14 @@ reported as unusable. Fresh `init`/`login` env files leave the variable empty an
|
|
|
334
334
|
show the URL shape only in a comment, so the setup check agrees with the SDK's
|
|
335
335
|
platform discovery instead of treating documentation as configuration.
|
|
336
336
|
|
|
337
|
+
**Sync trigger secret** is new in `0.18.0`, and it **fails** when
|
|
338
|
+
`CLIVLY_SYNC_TRIGGER_SECRET` is not set. From 0.18.0 a route with no secret
|
|
339
|
+
refuses every request with `403 signature_required`, Clivly's "Run sync"
|
|
340
|
+
included, so a missing secret is a broken setup, not a risk. It warns instead
|
|
341
|
+
when `syncTrigger.allowUnsigned` is on, and is skipped against a host app whose
|
|
342
|
+
installed `clivly` is older than 0.18. `init` and `login` always name both
|
|
343
|
+
credentials together, so a deploy does not copy the key without the secret.
|
|
344
|
+
|
|
337
345
|
If the Workspace section reads
|
|
338
346
|
`⚠️ This Clivly server does not report setup progress`, or names a rejected key
|
|
339
347
|
or an unreachable host, that means the question could not be asked — not that
|
|
@@ -452,7 +460,8 @@ logs nothing, and the dashboard reports "Host app rejected the preview (500)"
|
|
|
452
460
|
against an app that never saw the request.
|
|
453
461
|
|
|
454
462
|
`clivly dev` checks for this before claiming the tunnel works: it sends an
|
|
455
|
-
unsigned request to the trigger path, which a Clivly route refuses with `401
|
|
463
|
+
unsigned request to the trigger path, which a Clivly route refuses with `401`
|
|
464
|
+
(or `403 signature_required` when the app has no signing secret yet).
|
|
456
465
|
Anything else means the tunnel reaches something that is not your app, and the
|
|
457
466
|
command warns instead of confirming:
|
|
458
467
|
|
|
@@ -503,8 +512,8 @@ work, and are kept because output and docs have recommended them — but prefer
|
|
|
503
512
|
| Alias | Equivalent scope |
|
|
504
513
|
| --- | --- |
|
|
505
514
|
| `clivly ping` | Credential + reachability |
|
|
506
|
-
| `clivly connect` | The above, plus config and trigger
|
|
507
|
-
| `clivly doctor` | Config, edge safety, boot hook
|
|
515
|
+
| `clivly connect` | The above, plus config, trigger URL and trigger secret |
|
|
516
|
+
| `clivly doctor` | Config, edge safety, boot hook, setup checks and trigger secret |
|
|
508
517
|
|
|
509
518
|
Each prints a deprecation notice, then the steps it covers, renumbered to its own
|
|
510
519
|
scope:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { E as Task, M as UpdateContactInput, N as UpdateDealInput, O as TaskFilters, P as UpdateTaskInput, a as Contact, b as PageRequest, d as CreateContactInput, f as CreateDealInput, h as Deal, i as CompanyFilters, j as UpdateCompanyInput, l as CreateActivityInput, o as ContactFilters, p as CreateTaskInput, r as Company, t as Activity, u as CreateCompanyInput, w as RecordSource, y as Page } from "./types-CZsSYbeC.mjs";
|
|
2
2
|
/**
|
|
3
3
|
* The contract every ORM implementation fulfils. `packages/drizzle` is the first
|
|
4
4
|
* implementation; Prisma/Kysely/TypeORM can follow without changes to consumers.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { E as Task, M as UpdateContactInput, N as UpdateDealInput, O as TaskFilters, P as UpdateTaskInput, a as Contact, b as PageRequest, d as CreateContactInput, f as CreateDealInput, h as Deal, i as CompanyFilters, j as UpdateCompanyInput, l as CreateActivityInput, o as ContactFilters, p as CreateTaskInput, r as Company, t as Activity, u as CreateCompanyInput, w as RecordSource, y as Page } from "./types-C08UluBS.cjs";
|
|
2
2
|
/**
|
|
3
3
|
* The contract every ORM implementation fulfils. `packages/drizzle` is the first
|
|
4
4
|
* implementation; Prisma/Kysely/TypeORM can follow without changes to consumers.
|
package/auth-better-auth.d.cts
CHANGED
package/auth-better-auth.d.mts
CHANGED
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-BiUN_I3u.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-BXykDFyG.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-D2MUT1Hk.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-BNvri2gX.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, Page, PageRequest, PipelineConfig, PipelineKind, PipelineStageConfig, RecordSource, StageType, Task, TaskEntityType, TaskFilters, TaskPriority, TaskStatus, UpdateCompanyInput, UpdateContactInput, UpdateDealInput, UpdateTaskInput, ValueInterval, isClosedStageType };
|
|
1
|
+
import { A as TaskStatus, C as PipelineStageConfig, D as TaskEntityType, E as Task, F as ValueInterval, I as isClosedStageType, M as UpdateContactInput, N as UpdateDealInput, O as TaskFilters, P as UpdateTaskInput, S as PipelineKind, T as StageType, _ as Note, a as Contact, b as PageRequest, c as ContactStatus, d as CreateContactInput, f as CreateDealInput, g as DealStage, h as Deal, i as CompanyFilters, j as UpdateCompanyInput, k as TaskPriority, l as CreateActivityInput, m as CrmRole, n as ActivityType, o as ContactFilters, p as CreateTaskInput, r as Company, s as ContactSource, t as Activity, u as CreateCompanyInput, v as OPEN_STAGE_TYPE, w as RecordSource, x as PipelineConfig, y as Page } from "./types-C08UluBS.cjs";
|
|
2
|
+
export { Activity, ActivityType, Company, CompanyFilters, Contact, ContactFilters, ContactSource, ContactStatus, CreateActivityInput, CreateCompanyInput, CreateContactInput, CreateDealInput, CreateTaskInput, CrmRole, Deal, DealStage, Note, OPEN_STAGE_TYPE, Page, PageRequest, PipelineConfig, PipelineKind, PipelineStageConfig, RecordSource, StageType, Task, TaskEntityType, TaskFilters, TaskPriority, TaskStatus, UpdateCompanyInput, UpdateContactInput, UpdateDealInput, UpdateTaskInput, ValueInterval, isClosedStageType };
|
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, Page, PageRequest, PipelineConfig, PipelineKind, PipelineStageConfig, RecordSource, StageType, Task, TaskEntityType, TaskFilters, TaskPriority, TaskStatus, UpdateCompanyInput, UpdateContactInput, UpdateDealInput, UpdateTaskInput, ValueInterval, isClosedStageType };
|
|
1
|
+
import { A as TaskStatus, C as PipelineStageConfig, D as TaskEntityType, E as Task, F as ValueInterval, I as isClosedStageType, M as UpdateContactInput, N as UpdateDealInput, O as TaskFilters, P as UpdateTaskInput, S as PipelineKind, T as StageType, _ as Note, a as Contact, b as PageRequest, c as ContactStatus, d as CreateContactInput, f as CreateDealInput, g as DealStage, h as Deal, i as CompanyFilters, j as UpdateCompanyInput, k as TaskPriority, l as CreateActivityInput, m as CrmRole, n as ActivityType, o as ContactFilters, p as CreateTaskInput, r as Company, s as ContactSource, t as Activity, u as CreateCompanyInput, v as OPEN_STAGE_TYPE, w as RecordSource, x as PipelineConfig, y as Page } from "./types-CZsSYbeC.mjs";
|
|
2
|
+
export { Activity, ActivityType, Company, CompanyFilters, Contact, ContactFilters, ContactSource, ContactStatus, CreateActivityInput, CreateCompanyInput, CreateContactInput, CreateDealInput, CreateTaskInput, CrmRole, Deal, DealStage, Note, OPEN_STAGE_TYPE, Page, PageRequest, PipelineConfig, PipelineKind, PipelineStageConfig, RecordSource, StageType, Task, TaskEntityType, TaskFilters, TaskPriority, TaskStatus, UpdateCompanyInput, UpdateContactInput, UpdateDealInput, UpdateTaskInput, ValueInterval, isClosedStageType };
|
package/core.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-
|
|
3
|
-
import { t as CRMAdapter } from "./adapter-
|
|
1
|
+
import { A as TaskStatus, C as PipelineStageConfig, D as TaskEntityType, E as Task, F as ValueInterval, I as isClosedStageType, L as ContactSegment, M as UpdateContactInput, N as UpdateDealInput, O as TaskFilters, P as UpdateTaskInput, R as contactSegmentSchema, S as PipelineKind, T as StageType, _ as Note, a as Contact, b as PageRequest, c as ContactStatus, d as CreateContactInput, f as CreateDealInput, g as DealStage, h as Deal, i as CompanyFilters, j as UpdateCompanyInput, k as TaskPriority, l as CreateActivityInput, m as CrmRole, n as ActivityType, o as ContactFilters, p as CreateTaskInput, r as Company, s as ContactSource, t as Activity, u as CreateCompanyInput, v as OPEN_STAGE_TYPE, w as RecordSource, x as PipelineConfig, y as Page } from "./types-C08UluBS.cjs";
|
|
2
|
+
import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-D2MUT1Hk.cjs";
|
|
3
|
+
import { t as CRMAdapter } from "./adapter-BiUN_I3u.cjs";
|
|
4
4
|
import { A as relationshipsSchema, B as identityRefs, D as missingRequiredFields, E as filterSchema, F as ProjectionFieldBinding, I as ProjectionIdentity, L as ProjectionJoin, M as validateEntitiesConfig, N as BASE_REF, O as projectionFields, P as PROJECTION_KEY_PATTERN, R as ProjectionMapping, S as RelationshipsMap, T as entitiesConfigSchema, V as projectionSchema, _ as MATERIALIZING_CONCEPTS, a as ClivlyEntitiesConfig, b as RelationshipSpec, d as CrmConcept, g as FilterValue, h as FilterExpr, i as ClivlyConfigError, j as requiredFieldsFor, k as relationshipSchema, l as ConfigValidationError, m as DiscoveredSchemaTable, n as CRM_CONCEPTS, p as DiscoveredColumnMeta, s as ClivlyEntityConfig, t as CANONICAL_FIELDS, u as ConfigValidationResult, v as MaterializingConcept, w as defineClivlyConfig, x as RelationshipVia, y as REQUIRED_FIELDS, z as ProjectionRef } from "./entity-config-dNclLyBM.cjs";
|
|
5
5
|
import { i as relationshipViaSignature, n as buildFilterFromDiscriminator, r as buildRelationships, t as RelationshipCandidate } from "./mapping-form-CV7y6qox.cjs";
|
|
6
6
|
import { i as mappingsToEntitiesConfig, t as EntityMappingRow } from "./mappings-config-BBppW9fp.cjs";
|
|
@@ -8,4 +8,4 @@ import { a as compileEntityView, i as ExplainResult, n as CompiledView, o as com
|
|
|
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-C7W0Gkq0.cjs";
|
|
9
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-COALpgov.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-xK4PLm5T.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 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 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 };
|
package/core.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-
|
|
3
|
-
import { t as CRMAdapter } from "./adapter-
|
|
1
|
+
import { A as TaskStatus, C as PipelineStageConfig, D as TaskEntityType, E as Task, F as ValueInterval, I as isClosedStageType, L as ContactSegment, M as UpdateContactInput, N as UpdateDealInput, O as TaskFilters, P as UpdateTaskInput, R as contactSegmentSchema, S as PipelineKind, T as StageType, _ as Note, a as Contact, b as PageRequest, c as ContactStatus, d as CreateContactInput, f as CreateDealInput, g as DealStage, h as Deal, i as CompanyFilters, j as UpdateCompanyInput, k as TaskPriority, l as CreateActivityInput, m as CrmRole, n as ActivityType, o as ContactFilters, p as CreateTaskInput, r as Company, s as ContactSource, t as Activity, u as CreateCompanyInput, v as OPEN_STAGE_TYPE, w as RecordSource, x as PipelineConfig, y as Page } from "./types-CZsSYbeC.mjs";
|
|
2
|
+
import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-BNvri2gX.mjs";
|
|
3
|
+
import { t as CRMAdapter } from "./adapter-BXykDFyG.mjs";
|
|
4
4
|
import { A as relationshipsSchema, B as identityRefs, D as missingRequiredFields, E as filterSchema, F as ProjectionFieldBinding, I as ProjectionIdentity, L as ProjectionJoin, M as validateEntitiesConfig, N as BASE_REF, O as projectionFields, P as PROJECTION_KEY_PATTERN, R as ProjectionMapping, S as RelationshipsMap, T as entitiesConfigSchema, V as projectionSchema, _ as MATERIALIZING_CONCEPTS, a as ClivlyEntitiesConfig, b as RelationshipSpec, d as CrmConcept, g as FilterValue, h as FilterExpr, i as ClivlyConfigError, j as requiredFieldsFor, k as relationshipSchema, l as ConfigValidationError, m as DiscoveredSchemaTable, n as CRM_CONCEPTS, p as DiscoveredColumnMeta, s as ClivlyEntityConfig, t as CANONICAL_FIELDS, u as ConfigValidationResult, v as MaterializingConcept, w as defineClivlyConfig, x as RelationshipVia, y as REQUIRED_FIELDS, z as ProjectionRef } from "./entity-config-X-KlnYXX.mjs";
|
|
5
5
|
import { i as relationshipViaSignature, n as buildFilterFromDiscriminator, r as buildRelationships, t as RelationshipCandidate } from "./mapping-form-Bpvgf5b8.mjs";
|
|
6
6
|
import { i as mappingsToEntitiesConfig, t as EntityMappingRow } from "./mappings-config-Dmm0H6p_.mjs";
|
|
@@ -8,4 +8,4 @@ import { a as compileEntityView, i as ExplainResult, n as CompiledView, o as com
|
|
|
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-C9Q2FkR9.mjs";
|
|
9
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-D3q4FPcA.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-xK4PLm5T.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 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 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 };
|
package/drizzle.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { R as ProjectionMapping, z as ProjectionRef } from "./entity-config-dNclLyBM.cjs";
|
|
2
2
|
import { n as buildUniqueConstraints, r as discoverFromDrizzle } from "./drizzle-B9cjBavj.cjs";
|
|
3
|
-
import { t as NamespaceIntrospector, v as SyncSource } from "./namespace-probe-
|
|
3
|
+
import { t as NamespaceIntrospector, v as SyncSource } from "./namespace-probe-qgjiudCo.cjs";
|
|
4
4
|
import { Table } from "drizzle-orm";
|
|
5
5
|
/**
|
|
6
6
|
* Build a `SyncSource` that actually executes a projection's joins.
|
package/drizzle.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { R as ProjectionMapping, z as ProjectionRef } from "./entity-config-X-KlnYXX.mjs";
|
|
2
2
|
import { n as buildUniqueConstraints, r as discoverFromDrizzle } from "./drizzle-L5FOGe_-.mjs";
|
|
3
|
-
import { t as NamespaceIntrospector, v as SyncSource } from "./namespace-probe-
|
|
3
|
+
import { t as NamespaceIntrospector, v as SyncSource } from "./namespace-probe-BAXprXQh.mjs";
|
|
4
4
|
import { Table } from "drizzle-orm";
|
|
5
5
|
/**
|
|
6
6
|
* Build a `SyncSource` that actually executes a projection's joins.
|
package/index.cjs
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const require_entity_config = require("./entity-config-DiCJ6mhI.cjs");
|
|
4
4
|
require("./mapping-score-D2TCQiOr.cjs");
|
|
5
5
|
const require_entity_heuristics = require("./entity-heuristics-CIParuQe.cjs");
|
|
6
|
-
const require_sdk = require("./sdk-
|
|
6
|
+
const require_sdk = require("./sdk-D53fH4uu.cjs");
|
|
7
7
|
let node_child_process = require("node:child_process");
|
|
8
8
|
let node_fs = require("node:fs");
|
|
9
9
|
let node_module = require("node:module");
|
|
@@ -606,6 +606,14 @@ const IDENTITY_RETRY_DELAY_MS = 2e3;
|
|
|
606
606
|
const sleep = (ms) => new Promise((resolve) => {
|
|
607
607
|
setTimeout(resolve, ms);
|
|
608
608
|
});
|
|
609
|
+
async function isSignatureRequired(response) {
|
|
610
|
+
try {
|
|
611
|
+
const body = await response.json();
|
|
612
|
+
return typeof body === "object" && body !== null && body.error === "signature_required";
|
|
613
|
+
} catch {
|
|
614
|
+
return false;
|
|
615
|
+
}
|
|
616
|
+
}
|
|
609
617
|
/** One attempt. Separated so the retry loop stays readable. */
|
|
610
618
|
async function attempt(triggerUrl, fetchImpl) {
|
|
611
619
|
const controller = new AbortController();
|
|
@@ -618,7 +626,7 @@ async function attempt(triggerUrl, fetchImpl) {
|
|
|
618
626
|
signal: controller.signal
|
|
619
627
|
});
|
|
620
628
|
if (response.status === 401) return "clivly";
|
|
621
|
-
if (response.status === 403) return "host-rejected";
|
|
629
|
+
if (response.status === 403) return await isSignatureRequired(response) ? "clivly" : "host-rejected";
|
|
622
630
|
if (response.status === 404 || response.status >= 500) return "unknown";
|
|
623
631
|
return "mismatch";
|
|
624
632
|
} catch {
|
|
@@ -1765,6 +1773,7 @@ function writeCredentials(options, credentials) {
|
|
|
1765
1773
|
};
|
|
1766
1774
|
for (const entry of entries) if (result.skipped.includes(entry.key)) deps.out(` • ${entry.key} already set — skipped (pass --force to overwrite)`);
|
|
1767
1775
|
else deps.out(` ✓ ${entry.key}=${maskSecret(valuesByKey[entry.key] ?? "")} written to ${envFile}`);
|
|
1776
|
+
deps.out(`\nDeploying? Copy ${SECRET_KEY_ENV} and CLIVLY_SYNC_TRIGGER_SECRET together into every environment your app runs in — without the second, its sync route refuses every request.`);
|
|
1768
1777
|
}
|
|
1769
1778
|
async function runLogin(options) {
|
|
1770
1779
|
const { deps } = options;
|
|
@@ -3695,6 +3704,41 @@ const triggerUrlStage = {
|
|
|
3695
3704
|
});
|
|
3696
3705
|
}
|
|
3697
3706
|
};
|
|
3707
|
+
const TRIGGER_SECRET_HINT = "Run `clivly login` to write CLIVLY_SECRET_KEY and CLIVLY_SYNC_TRIGGER_SECRET together, or copy the signing secret from Integrations → Remote sync. Every environment the app runs in needs both.";
|
|
3708
|
+
/**
|
|
3709
|
+
* Whether the trigger route can verify Clivly's requests.
|
|
3710
|
+
*
|
|
3711
|
+
* A `fail`, not a `warn`, since 0.18.0 (audit F-01): with no secret the route
|
|
3712
|
+
* refuses every request with a body, which is every request Clivly sends, so
|
|
3713
|
+
* "Run sync" cannot work at all. `allowUnsigned` without a secret is a warn —
|
|
3714
|
+
* the host chose to let its own cron in unsigned, but Clivly still cannot.
|
|
3715
|
+
*/
|
|
3716
|
+
const triggerSecretStage = {
|
|
3717
|
+
id: "trigger-secret",
|
|
3718
|
+
label: "Sync trigger secret",
|
|
3719
|
+
needs: [configStage.id],
|
|
3720
|
+
run(ctx) {
|
|
3721
|
+
const trigger = ctx.sdk?.describeSyncTrigger?.();
|
|
3722
|
+
if (trigger?.hasSecret === void 0) return Promise.resolve({
|
|
3723
|
+
state: "skip",
|
|
3724
|
+
detail: "This app's clivly is too old to report it — upgrade to 0.18."
|
|
3725
|
+
});
|
|
3726
|
+
if (trigger.hasSecret) return Promise.resolve({
|
|
3727
|
+
state: "pass",
|
|
3728
|
+
detail: "Secret is set — the route verifies every request."
|
|
3729
|
+
});
|
|
3730
|
+
if (trigger.allowUnsigned) return Promise.resolve({
|
|
3731
|
+
state: "warn",
|
|
3732
|
+
detail: "Not set, and `allowUnsigned` is on — anyone who finds the URL can start a sync, and Clivly cannot.",
|
|
3733
|
+
hint: TRIGGER_SECRET_HINT
|
|
3734
|
+
});
|
|
3735
|
+
return Promise.resolve({
|
|
3736
|
+
state: "fail",
|
|
3737
|
+
detail: "CLIVLY_SYNC_TRIGGER_SECRET is not set — the sync route refuses every request, Clivly's included.",
|
|
3738
|
+
hint: TRIGGER_SECRET_HINT
|
|
3739
|
+
});
|
|
3740
|
+
}
|
|
3741
|
+
};
|
|
3698
3742
|
/** The full ladder, in the order a developer completes setup. */
|
|
3699
3743
|
const STATUS_STAGES = [
|
|
3700
3744
|
apiKeyStage,
|
|
@@ -3804,7 +3848,8 @@ const STATUS_STAGES = [
|
|
|
3804
3848
|
});
|
|
3805
3849
|
}
|
|
3806
3850
|
},
|
|
3807
|
-
triggerUrlStage
|
|
3851
|
+
triggerUrlStage,
|
|
3852
|
+
triggerSecretStage
|
|
3808
3853
|
];
|
|
3809
3854
|
function defaultLoadSdk(path) {
|
|
3810
3855
|
return loadConfigSdk(path, "doctor");
|
|
@@ -3856,13 +3901,15 @@ const ALIAS_STAGE_IDS = {
|
|
|
3856
3901
|
"runtime",
|
|
3857
3902
|
"boot-hook",
|
|
3858
3903
|
"setup-checks",
|
|
3859
|
-
"derived-objects"
|
|
3904
|
+
"derived-objects",
|
|
3905
|
+
"trigger-secret"
|
|
3860
3906
|
],
|
|
3861
3907
|
connect: [
|
|
3862
3908
|
"api-key",
|
|
3863
3909
|
"reachable",
|
|
3864
3910
|
"config",
|
|
3865
|
-
"trigger-url"
|
|
3911
|
+
"trigger-url",
|
|
3912
|
+
"trigger-secret"
|
|
3866
3913
|
]
|
|
3867
3914
|
};
|
|
3868
3915
|
const MARK = {
|
|
@@ -4339,7 +4386,8 @@ function previewMutations(deps, mutations, options) {
|
|
|
4339
4386
|
}
|
|
4340
4387
|
function printNextSteps(out, authComplete, loginRan, envFile, needsViteDotenv = false) {
|
|
4341
4388
|
out("\nNext steps:\n");
|
|
4342
|
-
out(loginRan ? " 1. Credentials written by `clivly login`\n" : ` 1.
|
|
4389
|
+
out(loginRan ? " 1. Credentials written by `clivly login`\n" : ` 1. Run \`clivly login\`, or add both of these to ${envFile}:\n CLIVLY_SECRET_KEY ${CREDENTIALS_LOCATION}\n CLIVLY_SYNC_TRIGGER_SECRET ${SYNC_SECRET_LOCATION}\n (the legacy CLIVLY_API_KEY is still accepted)\n`);
|
|
4390
|
+
out(" Deploying? Set CLIVLY_SECRET_KEY and CLIVLY_SYNC_TRIGGER_SECRET together\n in every environment the app runs in — without the second, its sync\n route refuses every request.\n");
|
|
4343
4391
|
out(" 2. Local dev: run `clivly dev` for dashboard-triggered sync\n");
|
|
4344
4392
|
out(" It tunnels your app and registers the URL for you — remote sync is\n deploy-only otherwise, so nothing is broken if you skip it. Once deployed\n to Vercel/Cloudflare/Railway/Render/Fly the URL is detected automatically;\n set CLIVLY_SYNC_TRIGGER_URL by hand only for a custom domain.\n");
|
|
4345
4393
|
let step = authComplete ? 3 : 4;
|
package/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { t as CANONICAL_FIELDS } from "./entity-config-g_oMPXlN.mjs";
|
|
3
3
|
import "./mapping-score-CS-MTDL9.mjs";
|
|
4
4
|
import { d as suggestCursorField, i as isFrameworkTable, l as scoreFieldMap, n as hasDefiningColumn, o as matchesConcept, p as toFieldMap, s as requiredFieldsFor, u as scoreRelationships } from "./entity-heuristics-DE5ujoHw.mjs";
|
|
5
|
-
import { n as createClivlySDK, u as isPlaceholderUrl } from "./sdk-
|
|
5
|
+
import { n as createClivlySDK, u as isPlaceholderUrl } from "./sdk-D5J7kRQm.mjs";
|
|
6
6
|
import { createRequire } from "node:module";
|
|
7
7
|
import { spawn } from "node:child_process";
|
|
8
8
|
import { accessSync, constants, existsSync, mkdirSync, readFileSync, readdirSync, realpathSync, statSync, watch, writeFileSync } from "node:fs";
|
|
@@ -605,6 +605,14 @@ const IDENTITY_RETRY_DELAY_MS = 2e3;
|
|
|
605
605
|
const sleep = (ms) => new Promise((resolve) => {
|
|
606
606
|
setTimeout(resolve, ms);
|
|
607
607
|
});
|
|
608
|
+
async function isSignatureRequired(response) {
|
|
609
|
+
try {
|
|
610
|
+
const body = await response.json();
|
|
611
|
+
return typeof body === "object" && body !== null && body.error === "signature_required";
|
|
612
|
+
} catch {
|
|
613
|
+
return false;
|
|
614
|
+
}
|
|
615
|
+
}
|
|
608
616
|
/** One attempt. Separated so the retry loop stays readable. */
|
|
609
617
|
async function attempt(triggerUrl, fetchImpl) {
|
|
610
618
|
const controller = new AbortController();
|
|
@@ -617,7 +625,7 @@ async function attempt(triggerUrl, fetchImpl) {
|
|
|
617
625
|
signal: controller.signal
|
|
618
626
|
});
|
|
619
627
|
if (response.status === 401) return "clivly";
|
|
620
|
-
if (response.status === 403) return "host-rejected";
|
|
628
|
+
if (response.status === 403) return await isSignatureRequired(response) ? "clivly" : "host-rejected";
|
|
621
629
|
if (response.status === 404 || response.status >= 500) return "unknown";
|
|
622
630
|
return "mismatch";
|
|
623
631
|
} catch {
|
|
@@ -1764,6 +1772,7 @@ function writeCredentials(options, credentials) {
|
|
|
1764
1772
|
};
|
|
1765
1773
|
for (const entry of entries) if (result.skipped.includes(entry.key)) deps.out(` • ${entry.key} already set — skipped (pass --force to overwrite)`);
|
|
1766
1774
|
else deps.out(` ✓ ${entry.key}=${maskSecret(valuesByKey[entry.key] ?? "")} written to ${envFile}`);
|
|
1775
|
+
deps.out(`\nDeploying? Copy ${SECRET_KEY_ENV} and CLIVLY_SYNC_TRIGGER_SECRET together into every environment your app runs in — without the second, its sync route refuses every request.`);
|
|
1767
1776
|
}
|
|
1768
1777
|
async function runLogin(options) {
|
|
1769
1778
|
const { deps } = options;
|
|
@@ -3694,6 +3703,41 @@ const triggerUrlStage = {
|
|
|
3694
3703
|
});
|
|
3695
3704
|
}
|
|
3696
3705
|
};
|
|
3706
|
+
const TRIGGER_SECRET_HINT = "Run `clivly login` to write CLIVLY_SECRET_KEY and CLIVLY_SYNC_TRIGGER_SECRET together, or copy the signing secret from Integrations → Remote sync. Every environment the app runs in needs both.";
|
|
3707
|
+
/**
|
|
3708
|
+
* Whether the trigger route can verify Clivly's requests.
|
|
3709
|
+
*
|
|
3710
|
+
* A `fail`, not a `warn`, since 0.18.0 (audit F-01): with no secret the route
|
|
3711
|
+
* refuses every request with a body, which is every request Clivly sends, so
|
|
3712
|
+
* "Run sync" cannot work at all. `allowUnsigned` without a secret is a warn —
|
|
3713
|
+
* the host chose to let its own cron in unsigned, but Clivly still cannot.
|
|
3714
|
+
*/
|
|
3715
|
+
const triggerSecretStage = {
|
|
3716
|
+
id: "trigger-secret",
|
|
3717
|
+
label: "Sync trigger secret",
|
|
3718
|
+
needs: [configStage.id],
|
|
3719
|
+
run(ctx) {
|
|
3720
|
+
const trigger = ctx.sdk?.describeSyncTrigger?.();
|
|
3721
|
+
if (trigger?.hasSecret === void 0) return Promise.resolve({
|
|
3722
|
+
state: "skip",
|
|
3723
|
+
detail: "This app's clivly is too old to report it — upgrade to 0.18."
|
|
3724
|
+
});
|
|
3725
|
+
if (trigger.hasSecret) return Promise.resolve({
|
|
3726
|
+
state: "pass",
|
|
3727
|
+
detail: "Secret is set — the route verifies every request."
|
|
3728
|
+
});
|
|
3729
|
+
if (trigger.allowUnsigned) return Promise.resolve({
|
|
3730
|
+
state: "warn",
|
|
3731
|
+
detail: "Not set, and `allowUnsigned` is on — anyone who finds the URL can start a sync, and Clivly cannot.",
|
|
3732
|
+
hint: TRIGGER_SECRET_HINT
|
|
3733
|
+
});
|
|
3734
|
+
return Promise.resolve({
|
|
3735
|
+
state: "fail",
|
|
3736
|
+
detail: "CLIVLY_SYNC_TRIGGER_SECRET is not set — the sync route refuses every request, Clivly's included.",
|
|
3737
|
+
hint: TRIGGER_SECRET_HINT
|
|
3738
|
+
});
|
|
3739
|
+
}
|
|
3740
|
+
};
|
|
3697
3741
|
/** The full ladder, in the order a developer completes setup. */
|
|
3698
3742
|
const STATUS_STAGES = [
|
|
3699
3743
|
apiKeyStage,
|
|
@@ -3803,7 +3847,8 @@ const STATUS_STAGES = [
|
|
|
3803
3847
|
});
|
|
3804
3848
|
}
|
|
3805
3849
|
},
|
|
3806
|
-
triggerUrlStage
|
|
3850
|
+
triggerUrlStage,
|
|
3851
|
+
triggerSecretStage
|
|
3807
3852
|
];
|
|
3808
3853
|
function defaultLoadSdk(path) {
|
|
3809
3854
|
return loadConfigSdk(path, "doctor");
|
|
@@ -3855,13 +3900,15 @@ const ALIAS_STAGE_IDS = {
|
|
|
3855
3900
|
"runtime",
|
|
3856
3901
|
"boot-hook",
|
|
3857
3902
|
"setup-checks",
|
|
3858
|
-
"derived-objects"
|
|
3903
|
+
"derived-objects",
|
|
3904
|
+
"trigger-secret"
|
|
3859
3905
|
],
|
|
3860
3906
|
connect: [
|
|
3861
3907
|
"api-key",
|
|
3862
3908
|
"reachable",
|
|
3863
3909
|
"config",
|
|
3864
|
-
"trigger-url"
|
|
3910
|
+
"trigger-url",
|
|
3911
|
+
"trigger-secret"
|
|
3865
3912
|
]
|
|
3866
3913
|
};
|
|
3867
3914
|
const MARK = {
|
|
@@ -4338,7 +4385,8 @@ function previewMutations(deps, mutations, options) {
|
|
|
4338
4385
|
}
|
|
4339
4386
|
function printNextSteps(out, authComplete, loginRan, envFile, needsViteDotenv = false) {
|
|
4340
4387
|
out("\nNext steps:\n");
|
|
4341
|
-
out(loginRan ? " 1. Credentials written by `clivly login`\n" : ` 1.
|
|
4388
|
+
out(loginRan ? " 1. Credentials written by `clivly login`\n" : ` 1. Run \`clivly login\`, or add both of these to ${envFile}:\n CLIVLY_SECRET_KEY ${CREDENTIALS_LOCATION}\n CLIVLY_SYNC_TRIGGER_SECRET ${SYNC_SECRET_LOCATION}\n (the legacy CLIVLY_API_KEY is still accepted)\n`);
|
|
4389
|
+
out(" Deploying? Set CLIVLY_SECRET_KEY and CLIVLY_SYNC_TRIGGER_SECRET together\n in every environment the app runs in — without the second, its sync\n route refuses every request.\n");
|
|
4342
4390
|
out(" 2. Local dev: run `clivly dev` for dashboard-triggered sync\n");
|
|
4343
4391
|
out(" It tunnels your app and registers the URL for you — remote sync is\n deploy-only otherwise, so nothing is broken if you skip it. Once deployed\n to Vercel/Cloudflare/Railway/Render/Fly the URL is detected automatically;\n set CLIVLY_SYNC_TRIGGER_URL by hand only for a custom domain.\n");
|
|
4344
4392
|
let step = authComplete ? 3 : 4;
|
package/internal-adapter.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as CRMAdapter } from "./adapter-
|
|
1
|
+
import { t as CRMAdapter } from "./adapter-BiUN_I3u.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-BXykDFyG.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-D2MUT1Hk.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-BNvri2gX.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, Page, PageRequest, PipelineConfig, PipelineKind, PipelineStageConfig, RecordSource, StageType, Task, TaskEntityType, TaskFilters, TaskPriority, TaskStatus, UpdateCompanyInput, UpdateContactInput, UpdateDealInput, UpdateTaskInput, ValueInterval, isClosedStageType };
|
|
1
|
+
import { A as TaskStatus, C as PipelineStageConfig, D as TaskEntityType, E as Task, F as ValueInterval, I as isClosedStageType, M as UpdateContactInput, N as UpdateDealInput, O as TaskFilters, P as UpdateTaskInput, S as PipelineKind, T as StageType, _ as Note, a as Contact, b as PageRequest, c as ContactStatus, d as CreateContactInput, f as CreateDealInput, g as DealStage, h as Deal, i as CompanyFilters, j as UpdateCompanyInput, k as TaskPriority, l as CreateActivityInput, m as CrmRole, n as ActivityType, o as ContactFilters, p as CreateTaskInput, r as Company, s as ContactSource, t as Activity, u as CreateCompanyInput, v as OPEN_STAGE_TYPE, w as RecordSource, x as PipelineConfig, y as Page } from "./types-C08UluBS.cjs";
|
|
2
|
+
export { Activity, ActivityType, Company, CompanyFilters, Contact, ContactFilters, ContactSource, ContactStatus, CreateActivityInput, CreateCompanyInput, CreateContactInput, CreateDealInput, CreateTaskInput, CrmRole, Deal, DealStage, Note, OPEN_STAGE_TYPE, Page, PageRequest, PipelineConfig, PipelineKind, PipelineStageConfig, RecordSource, StageType, Task, TaskEntityType, TaskFilters, TaskPriority, TaskStatus, UpdateCompanyInput, UpdateContactInput, UpdateDealInput, UpdateTaskInput, ValueInterval, isClosedStageType };
|
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, Page, PageRequest, PipelineConfig, PipelineKind, PipelineStageConfig, RecordSource, StageType, Task, TaskEntityType, TaskFilters, TaskPriority, TaskStatus, UpdateCompanyInput, UpdateContactInput, UpdateDealInput, UpdateTaskInput, ValueInterval, isClosedStageType };
|
|
1
|
+
import { A as TaskStatus, C as PipelineStageConfig, D as TaskEntityType, E as Task, F as ValueInterval, I as isClosedStageType, M as UpdateContactInput, N as UpdateDealInput, O as TaskFilters, P as UpdateTaskInput, S as PipelineKind, T as StageType, _ as Note, a as Contact, b as PageRequest, c as ContactStatus, d as CreateContactInput, f as CreateDealInput, g as DealStage, h as Deal, i as CompanyFilters, j as UpdateCompanyInput, k as TaskPriority, l as CreateActivityInput, m as CrmRole, n as ActivityType, o as ContactFilters, p as CreateTaskInput, r as Company, s as ContactSource, t as Activity, u as CreateCompanyInput, v as OPEN_STAGE_TYPE, w as RecordSource, x as PipelineConfig, y as Page } from "./types-CZsSYbeC.mjs";
|
|
2
|
+
export { Activity, ActivityType, Company, CompanyFilters, Contact, ContactFilters, ContactSource, ContactStatus, CreateActivityInput, CreateCompanyInput, CreateContactInput, CreateDealInput, CreateTaskInput, CrmRole, Deal, DealStage, Note, OPEN_STAGE_TYPE, Page, PageRequest, PipelineConfig, PipelineKind, PipelineStageConfig, RecordSource, StageType, Task, TaskEntityType, TaskFilters, TaskPriority, TaskStatus, UpdateCompanyInput, UpdateContactInput, UpdateDealInput, UpdateTaskInput, ValueInterval, isClosedStageType };
|
package/internal.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-
|
|
3
|
-
import { t as CRMAdapter } from "./adapter-
|
|
1
|
+
import { A as TaskStatus, C as PipelineStageConfig, D as TaskEntityType, E as Task, F as ValueInterval, I as isClosedStageType, L as ContactSegment, M as UpdateContactInput, N as UpdateDealInput, O as TaskFilters, P as UpdateTaskInput, R as contactSegmentSchema, S as PipelineKind, T as StageType, _ as Note, a as Contact, b as PageRequest, c as ContactStatus, d as CreateContactInput, f as CreateDealInput, g as DealStage, h as Deal, i as CompanyFilters, j as UpdateCompanyInput, k as TaskPriority, l as CreateActivityInput, m as CrmRole, n as ActivityType, o as ContactFilters, p as CreateTaskInput, r as Company, s as ContactSource, t as Activity, u as CreateCompanyInput, v as OPEN_STAGE_TYPE, w as RecordSource, x as PipelineConfig, y as Page } from "./types-C08UluBS.cjs";
|
|
2
|
+
import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-D2MUT1Hk.cjs";
|
|
3
|
+
import { t as CRMAdapter } from "./adapter-BiUN_I3u.cjs";
|
|
4
4
|
import { A as relationshipsSchema, B as identityRefs, D as missingRequiredFields, E as filterSchema, F as ProjectionFieldBinding, I as ProjectionIdentity, L as ProjectionJoin, M as validateEntitiesConfig, N as BASE_REF, O as projectionFields, P as PROJECTION_KEY_PATTERN, R as ProjectionMapping, S as RelationshipsMap, T as entitiesConfigSchema, V as projectionSchema, _ as MATERIALIZING_CONCEPTS, a as ClivlyEntitiesConfig, b as RelationshipSpec, d as CrmConcept, g as FilterValue, h as FilterExpr, i as ClivlyConfigError, j as requiredFieldsFor, k as relationshipSchema, l as ConfigValidationError, m as DiscoveredSchemaTable, n as CRM_CONCEPTS, p as DiscoveredColumnMeta, s as ClivlyEntityConfig, t as CANONICAL_FIELDS, u as ConfigValidationResult, v as MaterializingConcept, w as defineClivlyConfig, x as RelationshipVia, y as REQUIRED_FIELDS, z as ProjectionRef } from "./entity-config-dNclLyBM.cjs";
|
|
5
5
|
import { i as relationshipViaSignature, n as buildFilterFromDiscriminator, r as buildRelationships, t as RelationshipCandidate } from "./mapping-form-CV7y6qox.cjs";
|
|
6
6
|
import { i as mappingsToEntitiesConfig, t as EntityMappingRow } from "./mappings-config-BBppW9fp.cjs";
|
|
@@ -8,4 +8,4 @@ import { a as compileEntityView, i as ExplainResult, n as CompiledView, o as com
|
|
|
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-C7W0Gkq0.cjs";
|
|
9
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-COALpgov.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-xK4PLm5T.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 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 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 };
|
package/internal.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-
|
|
3
|
-
import { t as CRMAdapter } from "./adapter-
|
|
1
|
+
import { A as TaskStatus, C as PipelineStageConfig, D as TaskEntityType, E as Task, F as ValueInterval, I as isClosedStageType, L as ContactSegment, M as UpdateContactInput, N as UpdateDealInput, O as TaskFilters, P as UpdateTaskInput, R as contactSegmentSchema, S as PipelineKind, T as StageType, _ as Note, a as Contact, b as PageRequest, c as ContactStatus, d as CreateContactInput, f as CreateDealInput, g as DealStage, h as Deal, i as CompanyFilters, j as UpdateCompanyInput, k as TaskPriority, l as CreateActivityInput, m as CrmRole, n as ActivityType, o as ContactFilters, p as CreateTaskInput, r as Company, s as ContactSource, t as Activity, u as CreateCompanyInput, v as OPEN_STAGE_TYPE, w as RecordSource, x as PipelineConfig, y as Page } from "./types-CZsSYbeC.mjs";
|
|
2
|
+
import { a as authCustom, i as MembershipResolver, n as ClivlyUser, r as CrmMembership, t as ClivlyAuthAdapter } from "./auth-adapter-BNvri2gX.mjs";
|
|
3
|
+
import { t as CRMAdapter } from "./adapter-BXykDFyG.mjs";
|
|
4
4
|
import { A as relationshipsSchema, B as identityRefs, D as missingRequiredFields, E as filterSchema, F as ProjectionFieldBinding, I as ProjectionIdentity, L as ProjectionJoin, M as validateEntitiesConfig, N as BASE_REF, O as projectionFields, P as PROJECTION_KEY_PATTERN, R as ProjectionMapping, S as RelationshipsMap, T as entitiesConfigSchema, V as projectionSchema, _ as MATERIALIZING_CONCEPTS, a as ClivlyEntitiesConfig, b as RelationshipSpec, d as CrmConcept, g as FilterValue, h as FilterExpr, i as ClivlyConfigError, j as requiredFieldsFor, k as relationshipSchema, l as ConfigValidationError, m as DiscoveredSchemaTable, n as CRM_CONCEPTS, p as DiscoveredColumnMeta, s as ClivlyEntityConfig, t as CANONICAL_FIELDS, u as ConfigValidationResult, v as MaterializingConcept, w as defineClivlyConfig, x as RelationshipVia, y as REQUIRED_FIELDS, z as ProjectionRef } from "./entity-config-X-KlnYXX.mjs";
|
|
5
5
|
import { i as relationshipViaSignature, n as buildFilterFromDiscriminator, r as buildRelationships, t as RelationshipCandidate } from "./mapping-form-Bpvgf5b8.mjs";
|
|
6
6
|
import { i as mappingsToEntitiesConfig, t as EntityMappingRow } from "./mappings-config-Dmm0H6p_.mjs";
|
|
@@ -8,4 +8,4 @@ import { a as compileEntityView, i as ExplainResult, n as CompiledView, o as com
|
|
|
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-C9Q2FkR9.mjs";
|
|
9
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-D3q4FPcA.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-xK4PLm5T.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 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 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 };
|
|
@@ -228,11 +228,19 @@ interface ClivlySDKConfig {
|
|
|
228
228
|
path?: string;
|
|
229
229
|
/**
|
|
230
230
|
* Signing secret (`whsec_…`) issued by Clivly under Integrations → Remote
|
|
231
|
-
* sync.
|
|
232
|
-
*
|
|
233
|
-
*
|
|
231
|
+
* sync. Required: without it `createClivlyHandler()` refuses every request
|
|
232
|
+
* (403 `signature_required`), including Clivly's own "Run sync". With it,
|
|
233
|
+
* any request that isn't validly signed is rejected.
|
|
234
234
|
*/
|
|
235
235
|
secret?: string;
|
|
236
|
+
/**
|
|
237
|
+
* Let an empty-body request run a tick without a signature when no
|
|
238
|
+
* `secret` is set — the shape a host's own cron or uptime ping sends.
|
|
239
|
+
* Off by default: an unsigned route lets anyone who finds the URL make
|
|
240
|
+
* this app scan its database. Requests with a body (everything Clivly
|
|
241
|
+
* sends) still need a signature. Ignored when `secret` is set.
|
|
242
|
+
*/
|
|
243
|
+
allowUnsigned?: boolean;
|
|
236
244
|
};
|
|
237
245
|
/**
|
|
238
246
|
* Shared secret Clivly Cloud presents (as `Authorization: Bearer <token>`) when
|
|
@@ -401,12 +409,19 @@ interface CursorStore {
|
|
|
401
409
|
}
|
|
402
410
|
/** @see ClivlySDK.describeSyncTrigger */
|
|
403
411
|
interface SyncTriggerDescription {
|
|
412
|
+
/** Is `syncTrigger.allowUnsigned` set? Meaningless when `hasSecret` is. */
|
|
413
|
+
allowUnsigned?: boolean;
|
|
404
414
|
/**
|
|
405
415
|
* `syncTrigger.url` exactly as configured, placeholder and all. The raw
|
|
406
416
|
* value, so a caller can say what is in the file rather than what survived
|
|
407
417
|
* resolution.
|
|
408
418
|
*/
|
|
409
419
|
configured?: string;
|
|
420
|
+
/**
|
|
421
|
+
* Is `syncTrigger.secret` set in this process? Optional only because an
|
|
422
|
+
* older SDK never reported it.
|
|
423
|
+
*/
|
|
424
|
+
hasSecret?: boolean;
|
|
410
425
|
/**
|
|
411
426
|
* The URL that would be reported to Clivly on the next heartbeat, or
|
|
412
427
|
* `undefined` when nothing resolves. An unedited placeholder never resolves.
|
|
@@ -228,11 +228,19 @@ interface ClivlySDKConfig {
|
|
|
228
228
|
path?: string;
|
|
229
229
|
/**
|
|
230
230
|
* Signing secret (`whsec_…`) issued by Clivly under Integrations → Remote
|
|
231
|
-
* sync.
|
|
232
|
-
*
|
|
233
|
-
*
|
|
231
|
+
* sync. Required: without it `createClivlyHandler()` refuses every request
|
|
232
|
+
* (403 `signature_required`), including Clivly's own "Run sync". With it,
|
|
233
|
+
* any request that isn't validly signed is rejected.
|
|
234
234
|
*/
|
|
235
235
|
secret?: string;
|
|
236
|
+
/**
|
|
237
|
+
* Let an empty-body request run a tick without a signature when no
|
|
238
|
+
* `secret` is set — the shape a host's own cron or uptime ping sends.
|
|
239
|
+
* Off by default: an unsigned route lets anyone who finds the URL make
|
|
240
|
+
* this app scan its database. Requests with a body (everything Clivly
|
|
241
|
+
* sends) still need a signature. Ignored when `secret` is set.
|
|
242
|
+
*/
|
|
243
|
+
allowUnsigned?: boolean;
|
|
236
244
|
};
|
|
237
245
|
/**
|
|
238
246
|
* Shared secret Clivly Cloud presents (as `Authorization: Bearer <token>`) when
|
|
@@ -401,12 +409,19 @@ interface CursorStore {
|
|
|
401
409
|
}
|
|
402
410
|
/** @see ClivlySDK.describeSyncTrigger */
|
|
403
411
|
interface SyncTriggerDescription {
|
|
412
|
+
/** Is `syncTrigger.allowUnsigned` set? Meaningless when `hasSecret` is. */
|
|
413
|
+
allowUnsigned?: boolean;
|
|
404
414
|
/**
|
|
405
415
|
* `syncTrigger.url` exactly as configured, placeholder and all. The raw
|
|
406
416
|
* value, so a caller can say what is in the file rather than what survived
|
|
407
417
|
* resolution.
|
|
408
418
|
*/
|
|
409
419
|
configured?: string;
|
|
420
|
+
/**
|
|
421
|
+
* Is `syncTrigger.secret` set in this process? Optional only because an
|
|
422
|
+
* older SDK never reported it.
|
|
423
|
+
*/
|
|
424
|
+
hasSecret?: boolean;
|
|
410
425
|
/**
|
|
411
426
|
* The URL that would be reported to Clivly on the next heartbeat, or
|
|
412
427
|
* `undefined` when nothing resolves. An unedited placeholder never resolves.
|
package/package.json
CHANGED
|
@@ -1347,7 +1347,7 @@ function selfCheck(input) {
|
|
|
1347
1347
|
const issues = [];
|
|
1348
1348
|
if (input.reportsTriggerUrl && !input.hasTriggerSecret) issues.push({
|
|
1349
1349
|
code: "trigger_route_unauthenticated",
|
|
1350
|
-
message: "Your app's sync route
|
|
1350
|
+
message: "Your app's sync route has no signing secret, so it refuses every sync Clivly starts.",
|
|
1351
1351
|
fix: "Set CLIVLY_SYNC_TRIGGER_SECRET in the environment your app runs in, then restart it."
|
|
1352
1352
|
});
|
|
1353
1353
|
if (input.lastPushFailed) issues.push({
|
|
@@ -2313,7 +2313,9 @@ function createClivlySDK(config) {
|
|
|
2313
2313
|
}
|
|
2314
2314
|
};
|
|
2315
2315
|
const describeSyncTrigger = () => ({
|
|
2316
|
+
allowUnsigned: config.syncTrigger?.allowUnsigned === true,
|
|
2316
2317
|
configured: config.syncTrigger?.url,
|
|
2318
|
+
hasSecret: Boolean(config.syncTrigger?.secret),
|
|
2317
2319
|
resolved: resolveTriggerUrl({
|
|
2318
2320
|
configuredUrl: config.syncTrigger?.url,
|
|
2319
2321
|
configuredPath: config.syncTrigger?.path,
|
|
@@ -2542,11 +2544,12 @@ function createClivlySDK(config) {
|
|
|
2542
2544
|
if (!(await verifyTriggerSignature(header, rawBody, secret) && header)) return "refused";
|
|
2543
2545
|
return claimSignature(header) ? "signed" : "refused";
|
|
2544
2546
|
}
|
|
2547
|
+
const allowUnsigned = config.syncTrigger?.allowUnsigned === true;
|
|
2545
2548
|
if (!warnedUnsignedTrigger) {
|
|
2546
2549
|
warnedUnsignedTrigger = true;
|
|
2547
|
-
console.
|
|
2550
|
+
console.error(allowUnsigned ? "Clivly: the sync trigger route is mounted without `syncTrigger.secret` and with `allowUnsigned`, so anyone who can reach the URL can start a sync. Set CLIVLY_SYNC_TRIGGER_SECRET; requests from Clivly are refused until you do." : "Clivly: the sync trigger route is mounted without `syncTrigger.secret`, so it refuses every request, including Clivly's. Set CLIVLY_SYNC_TRIGGER_SECRET in this app's environment.");
|
|
2548
2551
|
}
|
|
2549
|
-
return "unsigned";
|
|
2552
|
+
return allowUnsigned && rawBody === "" ? "unsigned" : "unsigned_refused";
|
|
2550
2553
|
};
|
|
2551
2554
|
const claimSignature = (header) => {
|
|
2552
2555
|
const now = Date.now();
|
|
@@ -2555,7 +2558,6 @@ function createClivlySDK(config) {
|
|
|
2555
2558
|
acceptedSignatures.set(header, now + SIGNATURE_TOLERANCE_SECONDS * SECONDS_PER_MS * 2);
|
|
2556
2559
|
return true;
|
|
2557
2560
|
};
|
|
2558
|
-
const requiresSignature = (payload) => Boolean(payload.preview || payload.previewProjection || payload.sample);
|
|
2559
2561
|
const parseTriggerBody = (rawBody) => {
|
|
2560
2562
|
if (!rawBody) return {};
|
|
2561
2563
|
try {
|
|
@@ -2601,15 +2603,15 @@ function createClivlySDK(config) {
|
|
|
2601
2603
|
if (payload.previewProjection) return await handleProjectionPreviewRequest(config, payload.previewProjection);
|
|
2602
2604
|
return null;
|
|
2603
2605
|
};
|
|
2604
|
-
const refuseUnauthorized = (auth
|
|
2606
|
+
const refuseUnauthorized = (auth) => {
|
|
2605
2607
|
if (auth === "refused") return jsonResponse({
|
|
2606
2608
|
ok: false,
|
|
2607
2609
|
error: "unauthorized"
|
|
2608
2610
|
}, UNAUTHORIZED_STATUS);
|
|
2609
|
-
if (auth === "
|
|
2611
|
+
if (auth === "unsigned_refused") return jsonResponse({
|
|
2610
2612
|
ok: false,
|
|
2611
2613
|
error: "signature_required",
|
|
2612
|
-
message: "
|
|
2614
|
+
message: "This route needs a signed request. Set CLIVLY_SYNC_TRIGGER_SECRET in this app's environment."
|
|
2613
2615
|
}, FORBIDDEN_STATUS);
|
|
2614
2616
|
return null;
|
|
2615
2617
|
};
|
|
@@ -2620,7 +2622,7 @@ function createClivlySDK(config) {
|
|
|
2620
2622
|
const rawBody = await req.text().catch(() => "");
|
|
2621
2623
|
const auth = await triggerRequestAuth(req, rawBody);
|
|
2622
2624
|
const payload = parseTriggerBody(rawBody);
|
|
2623
|
-
const denied = refuseUnauthorized(auth
|
|
2625
|
+
const denied = refuseUnauthorized(auth);
|
|
2624
2626
|
if (denied) return denied;
|
|
2625
2627
|
const runId = payload.runId ?? null;
|
|
2626
2628
|
const startedAt = Date.now();
|
|
@@ -1347,7 +1347,7 @@ function selfCheck(input) {
|
|
|
1347
1347
|
const issues = [];
|
|
1348
1348
|
if (input.reportsTriggerUrl && !input.hasTriggerSecret) issues.push({
|
|
1349
1349
|
code: "trigger_route_unauthenticated",
|
|
1350
|
-
message: "Your app's sync route
|
|
1350
|
+
message: "Your app's sync route has no signing secret, so it refuses every sync Clivly starts.",
|
|
1351
1351
|
fix: "Set CLIVLY_SYNC_TRIGGER_SECRET in the environment your app runs in, then restart it."
|
|
1352
1352
|
});
|
|
1353
1353
|
if (input.lastPushFailed) issues.push({
|
|
@@ -2313,7 +2313,9 @@ function createClivlySDK(config) {
|
|
|
2313
2313
|
}
|
|
2314
2314
|
};
|
|
2315
2315
|
const describeSyncTrigger = () => ({
|
|
2316
|
+
allowUnsigned: config.syncTrigger?.allowUnsigned === true,
|
|
2316
2317
|
configured: config.syncTrigger?.url,
|
|
2318
|
+
hasSecret: Boolean(config.syncTrigger?.secret),
|
|
2317
2319
|
resolved: resolveTriggerUrl({
|
|
2318
2320
|
configuredUrl: config.syncTrigger?.url,
|
|
2319
2321
|
configuredPath: config.syncTrigger?.path,
|
|
@@ -2542,11 +2544,12 @@ function createClivlySDK(config) {
|
|
|
2542
2544
|
if (!(await verifyTriggerSignature(header, rawBody, secret) && header)) return "refused";
|
|
2543
2545
|
return claimSignature(header) ? "signed" : "refused";
|
|
2544
2546
|
}
|
|
2547
|
+
const allowUnsigned = config.syncTrigger?.allowUnsigned === true;
|
|
2545
2548
|
if (!warnedUnsignedTrigger) {
|
|
2546
2549
|
warnedUnsignedTrigger = true;
|
|
2547
|
-
console.
|
|
2550
|
+
console.error(allowUnsigned ? "Clivly: the sync trigger route is mounted without `syncTrigger.secret` and with `allowUnsigned`, so anyone who can reach the URL can start a sync. Set CLIVLY_SYNC_TRIGGER_SECRET; requests from Clivly are refused until you do." : "Clivly: the sync trigger route is mounted without `syncTrigger.secret`, so it refuses every request, including Clivly's. Set CLIVLY_SYNC_TRIGGER_SECRET in this app's environment.");
|
|
2548
2551
|
}
|
|
2549
|
-
return "unsigned";
|
|
2552
|
+
return allowUnsigned && rawBody === "" ? "unsigned" : "unsigned_refused";
|
|
2550
2553
|
};
|
|
2551
2554
|
const claimSignature = (header) => {
|
|
2552
2555
|
const now = Date.now();
|
|
@@ -2555,7 +2558,6 @@ function createClivlySDK(config) {
|
|
|
2555
2558
|
acceptedSignatures.set(header, now + SIGNATURE_TOLERANCE_SECONDS * SECONDS_PER_MS * 2);
|
|
2556
2559
|
return true;
|
|
2557
2560
|
};
|
|
2558
|
-
const requiresSignature = (payload) => Boolean(payload.preview || payload.previewProjection || payload.sample);
|
|
2559
2561
|
const parseTriggerBody = (rawBody) => {
|
|
2560
2562
|
if (!rawBody) return {};
|
|
2561
2563
|
try {
|
|
@@ -2601,15 +2603,15 @@ function createClivlySDK(config) {
|
|
|
2601
2603
|
if (payload.previewProjection) return await handleProjectionPreviewRequest(config, payload.previewProjection);
|
|
2602
2604
|
return null;
|
|
2603
2605
|
};
|
|
2604
|
-
const refuseUnauthorized = (auth
|
|
2606
|
+
const refuseUnauthorized = (auth) => {
|
|
2605
2607
|
if (auth === "refused") return jsonResponse({
|
|
2606
2608
|
ok: false,
|
|
2607
2609
|
error: "unauthorized"
|
|
2608
2610
|
}, UNAUTHORIZED_STATUS);
|
|
2609
|
-
if (auth === "
|
|
2611
|
+
if (auth === "unsigned_refused") return jsonResponse({
|
|
2610
2612
|
ok: false,
|
|
2611
2613
|
error: "signature_required",
|
|
2612
|
-
message: "
|
|
2614
|
+
message: "This route needs a signed request. Set CLIVLY_SYNC_TRIGGER_SECRET in this app's environment."
|
|
2613
2615
|
}, FORBIDDEN_STATUS);
|
|
2614
2616
|
return null;
|
|
2615
2617
|
};
|
|
@@ -2620,7 +2622,7 @@ function createClivlySDK(config) {
|
|
|
2620
2622
|
const rawBody = await req.text().catch(() => "");
|
|
2621
2623
|
const auth = await triggerRequestAuth(req, rawBody);
|
|
2622
2624
|
const payload = parseTriggerBody(rawBody);
|
|
2623
|
-
const denied = refuseUnauthorized(auth
|
|
2625
|
+
const denied = refuseUnauthorized(auth);
|
|
2624
2626
|
if (denied) return denied;
|
|
2625
2627
|
const runId = payload.runId ?? null;
|
|
2626
2628
|
const startedAt = Date.now();
|
package/sdk.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_entity_config = require("./entity-config-DiCJ6mhI.cjs");
|
|
3
|
-
const require_sdk = require("./sdk-
|
|
3
|
+
const require_sdk = require("./sdk-D53fH4uu.cjs");
|
|
4
4
|
exports.CURSOR_KEY_PREFIX = require_sdk.CURSOR_KEY_PREFIX;
|
|
5
5
|
exports.ClivlyAuthError = require_sdk.ClivlyAuthError;
|
|
6
6
|
exports.ClivlyError = require_sdk.ClivlyError;
|
package/sdk.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { C as customObjectDeclarations, M as validateEntitiesConfig, a as ClivlyEntitiesConfig, f as CustomObjectDeclaration, l as ConfigValidationError, m as DiscoveredSchemaTable, u as ConfigValidationResult, w as defineClivlyConfig } from "./entity-config-dNclLyBM.cjs";
|
|
2
|
-
import { _ as RemoteProjectionsDescription, a as ClivlyConnectResult, b as ExposurePolicy, c as ClivlyUser, d as DiscoveredTable, f as DoctorCheck, g as EnsuredObjectTypeResult, h as EnsuredMappingResult, i as ClivlyConnectReason, l as CreateChatSessionHandlerOptions, m as EnsureSchemaResult, n as ChatSessionRequestBody, o as ClivlySDK, p as DoctorReport, r as ChatWidgetVisitor, s as ClivlySDKConfig, u as CursorStore, y as SyncTriggerDescription } from "./namespace-probe-
|
|
2
|
+
import { _ as RemoteProjectionsDescription, a as ClivlyConnectResult, b as ExposurePolicy, c as ClivlyUser, d as DiscoveredTable, f as DoctorCheck, g as EnsuredObjectTypeResult, h as EnsuredMappingResult, i as ClivlyConnectReason, l as CreateChatSessionHandlerOptions, m as EnsureSchemaResult, n as ChatSessionRequestBody, o as ClivlySDK, p as DoctorReport, r as ChatWidgetVisitor, s as ClivlySDKConfig, u as CursorStore, y as SyncTriggerDescription } from "./namespace-probe-qgjiudCo.cjs";
|
|
3
3
|
export declare function isPlaceholderUrl(value: string): boolean;
|
|
4
4
|
export declare function createChatSessionHandler({ allowedOrigins, apiKey, apiUrl, fetchImpl, resolveUser, resolveVisitorIp }: CreateChatSessionHandlerOptions): (request: Request) => Promise<Response>;
|
|
5
5
|
export declare class ClivlyError extends Error {
|
package/sdk.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { C as customObjectDeclarations, M as validateEntitiesConfig, a as ClivlyEntitiesConfig, f as CustomObjectDeclaration, l as ConfigValidationError, m as DiscoveredSchemaTable, u as ConfigValidationResult, w as defineClivlyConfig } from "./entity-config-X-KlnYXX.mjs";
|
|
2
|
-
import { _ as RemoteProjectionsDescription, a as ClivlyConnectResult, b as ExposurePolicy, c as ClivlyUser, d as DiscoveredTable, f as DoctorCheck, g as EnsuredObjectTypeResult, h as EnsuredMappingResult, i as ClivlyConnectReason, l as CreateChatSessionHandlerOptions, m as EnsureSchemaResult, n as ChatSessionRequestBody, o as ClivlySDK, p as DoctorReport, r as ChatWidgetVisitor, s as ClivlySDKConfig, u as CursorStore, y as SyncTriggerDescription } from "./namespace-probe-
|
|
2
|
+
import { _ as RemoteProjectionsDescription, a as ClivlyConnectResult, b as ExposurePolicy, c as ClivlyUser, d as DiscoveredTable, f as DoctorCheck, g as EnsuredObjectTypeResult, h as EnsuredMappingResult, i as ClivlyConnectReason, l as CreateChatSessionHandlerOptions, m as EnsureSchemaResult, n as ChatSessionRequestBody, o as ClivlySDK, p as DoctorReport, r as ChatWidgetVisitor, s as ClivlySDKConfig, u as CursorStore, y as SyncTriggerDescription } from "./namespace-probe-BAXprXQh.mjs";
|
|
3
3
|
export declare function isPlaceholderUrl(value: string): boolean;
|
|
4
4
|
export declare function createChatSessionHandler({ allowedOrigins, apiKey, apiUrl, fetchImpl, resolveUser, resolveVisitorIp }: CreateChatSessionHandlerOptions): (request: Request) => Promise<Response>;
|
|
5
5
|
export declare class ClivlyError extends Error {
|
package/sdk.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { c as defineClivlyConfig, g as validateEntitiesConfig, s as customObjectDeclarations } from "./entity-config-g_oMPXlN.mjs";
|
|
2
|
-
import { a as ClivlyAuthError, c as ClivlyRateLimitError, i as memoryCursorStore, l as createChatSessionHandler, n as createClivlySDK, o as ClivlyError, r as kvCursorStore, s as ClivlyNetworkError, t as CURSOR_KEY_PREFIX, u as isPlaceholderUrl } from "./sdk-
|
|
2
|
+
import { a as ClivlyAuthError, c as ClivlyRateLimitError, i as memoryCursorStore, l as createChatSessionHandler, n as createClivlySDK, o as ClivlyError, r as kvCursorStore, s as ClivlyNetworkError, t as CURSOR_KEY_PREFIX, u as isPlaceholderUrl } from "./sdk-D5J7kRQm.mjs";
|
|
3
3
|
export { CURSOR_KEY_PREFIX, ClivlyAuthError, ClivlyError, ClivlyNetworkError, ClivlyRateLimitError, createChatSessionHandler, createClivlySDK, customObjectDeclarations, defineClivlyConfig, isPlaceholderUrl, kvCursorStore, memoryCursorStore, validateEntitiesConfig };
|
|
@@ -57,6 +57,8 @@ interface Contact {
|
|
|
57
57
|
name: string;
|
|
58
58
|
orgId: string;
|
|
59
59
|
phone: string | null;
|
|
60
|
+
/** Where the contact came from, set once at creation; null if not recorded. */
|
|
61
|
+
source?: ContactSource | null;
|
|
60
62
|
/**
|
|
61
63
|
* The host row this contact mirrors, or null when it was created in the CRM.
|
|
62
64
|
*
|
|
@@ -156,6 +158,11 @@ interface Task {
|
|
|
156
158
|
*/
|
|
157
159
|
dueAllDay?: boolean | null;
|
|
158
160
|
dueAt: Date | null;
|
|
161
|
+
/**
|
|
162
|
+
* How long a timed task runs from `dueAt`, in minutes. Null: a point in
|
|
163
|
+
* time. Always null for an all-day or undated task.
|
|
164
|
+
*/
|
|
165
|
+
durationMinutes?: number | null;
|
|
159
166
|
entityId: string | null;
|
|
160
167
|
entityType: TaskEntityType | null;
|
|
161
168
|
id: string;
|
|
@@ -188,11 +195,15 @@ interface Activity {
|
|
|
188
195
|
summary: string;
|
|
189
196
|
type: ActivityType;
|
|
190
197
|
}
|
|
198
|
+
/** Where a contact came from; null when it was not recorded. */
|
|
199
|
+
type ContactSource = "agent" | "app_sync" | "chat" | "import" | "inbound_email" | "manual" | "outbound_email";
|
|
191
200
|
interface CreateContactInput {
|
|
192
201
|
companyId?: string;
|
|
193
202
|
email: string;
|
|
194
203
|
name: string;
|
|
195
204
|
phone?: string;
|
|
205
|
+
/** Defaults to `manual`: a person created it. */
|
|
206
|
+
source?: ContactSource;
|
|
196
207
|
status?: ContactStatus;
|
|
197
208
|
title?: string;
|
|
198
209
|
}
|
|
@@ -250,6 +261,11 @@ interface CreateTaskInput {
|
|
|
250
261
|
*/
|
|
251
262
|
dueAllDay?: boolean | null;
|
|
252
263
|
dueAt?: Date;
|
|
264
|
+
/**
|
|
265
|
+
* How long a timed task runs from `dueAt`, in minutes. Null: a point in
|
|
266
|
+
* time. Always null for an all-day or undated task.
|
|
267
|
+
*/
|
|
268
|
+
durationMinutes?: number | null;
|
|
253
269
|
entityId?: string;
|
|
254
270
|
entityType?: TaskEntityType;
|
|
255
271
|
priority?: TaskPriority;
|
|
@@ -264,6 +280,11 @@ interface UpdateTaskInput {
|
|
|
264
280
|
*/
|
|
265
281
|
dueAllDay?: boolean | null;
|
|
266
282
|
dueAt?: Date | null;
|
|
283
|
+
/**
|
|
284
|
+
* How long a timed task runs from `dueAt`, in minutes. Null: a point in
|
|
285
|
+
* time. Always null for an all-day or undated task.
|
|
286
|
+
*/
|
|
287
|
+
durationMinutes?: number | null;
|
|
267
288
|
entityId?: string | null;
|
|
268
289
|
entityType?: TaskEntityType | null;
|
|
269
290
|
priority?: TaskPriority;
|
|
@@ -347,4 +368,4 @@ interface TaskFilters {
|
|
|
347
368
|
priority?: TaskPriority;
|
|
348
369
|
status?: TaskStatus;
|
|
349
370
|
}
|
|
350
|
-
export {
|
|
371
|
+
export { TaskStatus as A, PipelineStageConfig as C, TaskEntityType as D, Task as E, ValueInterval as F, isClosedStageType as I, ContactSegment as L, UpdateContactInput as M, UpdateDealInput as N, TaskFilters as O, UpdateTaskInput as P, contactSegmentSchema as R, PipelineKind as S, StageType as T, Note as _, Contact as a, PageRequest as b, ContactStatus as c, CreateContactInput as d, CreateDealInput as f, DealStage as g, Deal as h, CompanyFilters as i, UpdateCompanyInput as j, TaskPriority as k, CreateActivityInput as l, CrmRole as m, ActivityType as n, ContactFilters as o, CreateTaskInput as p, Company as r, ContactSource as s, Activity as t, CreateCompanyInput as u, OPEN_STAGE_TYPE as v, RecordSource as w, PipelineConfig as x, Page as y };
|
|
@@ -57,6 +57,8 @@ interface Contact {
|
|
|
57
57
|
name: string;
|
|
58
58
|
orgId: string;
|
|
59
59
|
phone: string | null;
|
|
60
|
+
/** Where the contact came from, set once at creation; null if not recorded. */
|
|
61
|
+
source?: ContactSource | null;
|
|
60
62
|
/**
|
|
61
63
|
* The host row this contact mirrors, or null when it was created in the CRM.
|
|
62
64
|
*
|
|
@@ -156,6 +158,11 @@ interface Task {
|
|
|
156
158
|
*/
|
|
157
159
|
dueAllDay?: boolean | null;
|
|
158
160
|
dueAt: Date | null;
|
|
161
|
+
/**
|
|
162
|
+
* How long a timed task runs from `dueAt`, in minutes. Null: a point in
|
|
163
|
+
* time. Always null for an all-day or undated task.
|
|
164
|
+
*/
|
|
165
|
+
durationMinutes?: number | null;
|
|
159
166
|
entityId: string | null;
|
|
160
167
|
entityType: TaskEntityType | null;
|
|
161
168
|
id: string;
|
|
@@ -188,11 +195,15 @@ interface Activity {
|
|
|
188
195
|
summary: string;
|
|
189
196
|
type: ActivityType;
|
|
190
197
|
}
|
|
198
|
+
/** Where a contact came from; null when it was not recorded. */
|
|
199
|
+
type ContactSource = "agent" | "app_sync" | "chat" | "import" | "inbound_email" | "manual" | "outbound_email";
|
|
191
200
|
interface CreateContactInput {
|
|
192
201
|
companyId?: string;
|
|
193
202
|
email: string;
|
|
194
203
|
name: string;
|
|
195
204
|
phone?: string;
|
|
205
|
+
/** Defaults to `manual`: a person created it. */
|
|
206
|
+
source?: ContactSource;
|
|
196
207
|
status?: ContactStatus;
|
|
197
208
|
title?: string;
|
|
198
209
|
}
|
|
@@ -250,6 +261,11 @@ interface CreateTaskInput {
|
|
|
250
261
|
*/
|
|
251
262
|
dueAllDay?: boolean | null;
|
|
252
263
|
dueAt?: Date;
|
|
264
|
+
/**
|
|
265
|
+
* How long a timed task runs from `dueAt`, in minutes. Null: a point in
|
|
266
|
+
* time. Always null for an all-day or undated task.
|
|
267
|
+
*/
|
|
268
|
+
durationMinutes?: number | null;
|
|
253
269
|
entityId?: string;
|
|
254
270
|
entityType?: TaskEntityType;
|
|
255
271
|
priority?: TaskPriority;
|
|
@@ -264,6 +280,11 @@ interface UpdateTaskInput {
|
|
|
264
280
|
*/
|
|
265
281
|
dueAllDay?: boolean | null;
|
|
266
282
|
dueAt?: Date | null;
|
|
283
|
+
/**
|
|
284
|
+
* How long a timed task runs from `dueAt`, in minutes. Null: a point in
|
|
285
|
+
* time. Always null for an all-day or undated task.
|
|
286
|
+
*/
|
|
287
|
+
durationMinutes?: number | null;
|
|
267
288
|
entityId?: string | null;
|
|
268
289
|
entityType?: TaskEntityType | null;
|
|
269
290
|
priority?: TaskPriority;
|
|
@@ -347,4 +368,4 @@ interface TaskFilters {
|
|
|
347
368
|
priority?: TaskPriority;
|
|
348
369
|
status?: TaskStatus;
|
|
349
370
|
}
|
|
350
|
-
export {
|
|
371
|
+
export { TaskStatus as A, PipelineStageConfig as C, TaskEntityType as D, Task as E, ValueInterval as F, isClosedStageType as I, ContactSegment as L, UpdateContactInput as M, UpdateDealInput as N, TaskFilters as O, UpdateTaskInput as P, contactSegmentSchema as R, PipelineKind as S, StageType as T, Note as _, Contact as a, PageRequest as b, ContactStatus as c, CreateContactInput as d, CreateDealInput as f, DealStage as g, Deal as h, CompanyFilters as i, UpdateCompanyInput as j, TaskPriority as k, CreateActivityInput as l, CrmRole as m, ActivityType as n, ContactFilters as o, CreateTaskInput as p, Company as r, ContactSource as s, Activity as t, CreateCompanyInput as u, OPEN_STAGE_TYPE as v, RecordSource as w, PipelineConfig as x, Page as y };
|
package/vite.d.cts
CHANGED
package/vite.d.mts
CHANGED