@odla-ai/chapter 0.25.8 → 0.26.1

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.
@@ -2,15 +2,16 @@ import { CrmConfig, Crm } from '@odla-ai/crm';
2
2
  import * as preact from 'preact';
3
3
  import { ComponentChildren } from 'preact';
4
4
 
5
+ type TextFields$1<Key extends string> = {
6
+ [Field in Key]: string;
7
+ };
8
+ /** User-visible language for sharing, delivery state, and leader rollups. */
9
+ type AdminNetworkCopy = TextFields$1<"title" | "allowlistDescription" | "sharing" | "shareWith" | "shared" | "shareFailed" | "deliveryFailed" | "loadingRollup" | "loadRollupFailed" | "overview" | "configuredFollowers" | "reachableFollowers" | "recordsAcrossFollowers" | "noFollowers" | "followers" | "available" | "unavailable" | "recordTotals" | "noRecordTotals">;
10
+
5
11
  type TextFields<Key extends string> = {
6
12
  [Field in Key]: string;
7
13
  };
8
- /**
9
- * Complete user-visible language owned by Chapter's packaged surfaces.
10
- *
11
- * Copy is serializable text; use render slots when presentation needs markup and
12
- * `formatChapterCopy()` for typed placeholders.
13
- */
14
+ /** Complete serializable language for Chapter surfaces; use render slots for markup and `formatChapterCopy()` for placeholders. */
14
15
  interface ChapterCopy {
15
16
  common: TextFields<"loading" | "saved" | "unknown">;
16
17
  join: {
@@ -36,7 +37,7 @@ interface ChapterCopy {
36
37
  admin: {
37
38
  auth: TextFields<"checking" | "notAuthorized" | "accountNotAuthorized" | "thisAccount" | "signOut" | "loading" | "signInNotConfigured" | "missingPublishableKey" | "noWorkspaces" | "signInTagline">;
38
39
  shell: TextFields<"adminRole" | "adminConsole" | "adminName" | "navigationLabel">;
39
- workspaces: TextFields<"dashboard" | "overview" | "billing" | "people" | "settings" | "calendar" | "email" | "dashboardViewsLabel" | "settingsViewsLabel" | "collectionsLabel">;
40
+ workspaces: TextFields<"dashboard" | "overview" | "billing" | "people" | "portfolio" | "settings" | "calendar" | "email" | "chapters" | "formations" | "dealFlow" | "dashboardViewsLabel" | "settingsViewsLabel" | "collectionsLabel" | "portfolioViewsLabel">;
40
41
  dashboard: TextFields<"loading" | "loadFailed" | "upcomingCalls" | "callsNeedAttention" | "noUpcomingCalls" | "drift" | "open" | "meet" | "applications" | "newMembers" | "newMembersUnavailable" | "revenueAdded" | "revenue" | "revenueUnavailable" | "pipeline" | "pipelineLabel" | "thisWeek" | "noChange" | "activeMemberships" | "annualRunRate" | "testMode">;
41
42
  billing: TextFields<"loading" | "loadFailed" | "notConfigured" | "active" | "annualized" | "renewingSoon" | "pastDue" | "subscriptions" | "testMode" | "truncated" | "name" | "email" | "application" | "subscription" | "cancelling" | "amount" | "renews">;
42
43
  availability: TextFields<"loading" | "loadFailed" | "saved" | "title" | "days" | "startHour" | "endHour" | "slotMinutes" | "minNoticeHours" | "windowDays" | "timezone" | "summaryTemplate" | "save"> & {
@@ -44,7 +45,7 @@ interface ChapterCopy {
44
45
  };
45
46
  email: TextFields<"loading" | "loadFailed" | "saved" | "sent" | "testFailed" | "delivery" | "notificationAddress" | "replyTo" | "debugInbox" | "debugInboxHint" | "sendTest" | "enabled" | "subject" | "body" | "save" | "sendLog" | "sentColumn" | "templateColumn" | "statusColumn" | "toColumn" | "failed" | "redirected" | "delivered">;
46
47
  meetings: TextFields<"loading" | "loadFailed" | "cancelConfirm" | "newStartPrompt" | "parseFailed" | "agenda" | "empty" | "unknown" | "drift" | "meet" | "reschedule" | "cancel">;
47
- network: TextFields<"title" | "allowlistDescription" | "sharing" | "shareWith" | "shared" | "shareFailed" | "deliveryFailed">;
48
+ network: AdminNetworkCopy;
48
49
  records: TextFields<"workflowMissing" | "comms" | "commsHistory" | "scheduling" | "billing" | "notes" | "access" | "sharing" | "lifecycle" | "role" | "superAdminHint" | "noAccount" | "approve" | "refund" | "approved" | "refunded" | "roleSet" | "messageSent" | "messageNotSent" | "loadingTemplates" | "template" | "chooseTemplate" | "sending" | "send" | "noMessages" | "message" | "newStartPrompt" | "parseFailed" | "cancelConfirm" | "callCancelled" | "callRescheduled" | "noApplication" | "loadingMeetings" | "noMeetings" | "joinMeeting" | "openCalendar" | "reschedule" | "cancel">;
49
50
  };
50
51
  }
@@ -54,6 +55,71 @@ type DeepPartial<T> = T extends readonly (infer Item)[] ? readonly Item[] : T ex
54
55
  /** Recursively partial copy overrides accepted by `defineChapter({ copy })`. */
55
56
  type ChapterCopyInput = DeepPartial<ChapterCopy>;
56
57
 
58
+ /** One follower site a leader can push CRM records to. The secret VALUE never
59
+ * lives in config: `secretName` names the leader tenant's vaulted copy of the
60
+ * follower's `network_share_secret`. */
61
+ interface ChapterNetworkTarget {
62
+ /** Stable lowercase slug used by the UI, audit tags, and default secret name. */
63
+ id: string;
64
+ /** Human-facing site name. Defaults to `id`. */
65
+ name?: string;
66
+ /** Absolute follower origin, e.g. `https://chapter.example.com`. */
67
+ url: string;
68
+ /** Optional Cloudflare service-binding name for Worker-to-Worker delivery.
69
+ * The URL still defines the signed request origin; the binding only supplies
70
+ * the transport when a `workers.dev` subrequest cannot enter another Worker. */
71
+ binding?: string;
72
+ /** Leader-vault key holding this follower's share secret. Defaults to
73
+ * `network_share_<id-with-underscores>`. */
74
+ secretName?: string;
75
+ /** Per-record-type field allowlist. If present, omitted types cannot be sent
76
+ * to this target. Without it, package-safe person/company defaults apply. */
77
+ fields?: Record<string, readonly string[]>;
78
+ }
79
+ /** Leader/follower network configuration. Followers need no code config to
80
+ * receive records; they only vault `network_share_secret`. */
81
+ interface ChapterNetwork {
82
+ targets?: readonly ChapterNetworkTarget[];
83
+ }
84
+ /** Public chapter-formation intake backed by one CRM record type. The host owns
85
+ * the branded form; Chapter owns the bounded, idempotent write contract. */
86
+ interface LeaderFormationConfig {
87
+ /** CRM type receiving submissions. Default `"chapter_application"`. */
88
+ type?: string;
89
+ /** Public fields that must be non-empty strings. */
90
+ required?: readonly string[];
91
+ /** Additional public fields accepted by the route. */
92
+ optional?: readonly string[];
93
+ maxLen?: Record<string, number>;
94
+ /** Per-string cap when `maxLen` has no field override. Default 4000. */
95
+ defaultMaxLen?: number;
96
+ /** Maximum JSON request size in characters. Default 32768. */
97
+ bodyCap?: number;
98
+ }
99
+ /** Fully resolved formation intake policy. */
100
+ interface ResolvedLeaderFormation {
101
+ enabled: boolean;
102
+ type: string;
103
+ required: readonly string[];
104
+ optional: readonly string[];
105
+ maxLen: Record<string, number>;
106
+ defaultMaxLen: number;
107
+ bodyCap: number;
108
+ }
109
+ /** A validated network target carried on the resolved chapter engine. */
110
+ interface ResolvedNetworkTarget {
111
+ id: string;
112
+ name: string;
113
+ url: string;
114
+ binding?: string;
115
+ secretName: string;
116
+ fields?: Record<string, readonly string[]>;
117
+ }
118
+ /** Fully-resolved leader network configuration. */
119
+ interface ResolvedNetwork {
120
+ targets: readonly ResolvedNetworkTarget[];
121
+ }
122
+
57
123
  /** Which feature profile a site runs. `chapter` is the full public member site
58
124
  * (join, Stripe membership, booking, member area, admin, CRM); `hub` is
59
125
  * admin-only and CRM-focused (a directory/registry over the same CRM). */
@@ -159,40 +225,6 @@ interface ChapterBrand {
159
225
  }>>;
160
226
  logos?: string;
161
227
  }
162
- /** One follower site a leader can push CRM records to. The secret VALUE never
163
- * lives in config: `secretName` names the leader tenant's vaulted copy of the
164
- * follower's `network_share_secret`. */
165
- interface ChapterNetworkTarget {
166
- /** Stable lowercase slug used by the UI, audit tags, and default secret name. */
167
- id: string;
168
- /** Human-facing site name. Defaults to `id`. */
169
- name?: string;
170
- /** Absolute follower origin, e.g. `https://chapter.example.com`. */
171
- url: string;
172
- /** Leader-vault key holding this follower's share secret. Defaults to
173
- * `network_share_<id-with-underscores>`. */
174
- secretName?: string;
175
- /** Per-record-type field allowlist. If present, omitted types cannot be sent
176
- * to this target. Without it, package-safe person/company defaults apply. */
177
- fields?: Record<string, readonly string[]>;
178
- }
179
- /** Leader/follower network configuration. Followers need no code config to
180
- * receive records; they only vault `network_share_secret`. */
181
- interface ChapterNetwork {
182
- targets?: readonly ChapterNetworkTarget[];
183
- }
184
- /** A validated network target carried on the resolved chapter engine. */
185
- interface ResolvedNetworkTarget {
186
- id: string;
187
- name: string;
188
- url: string;
189
- secretName: string;
190
- fields?: Record<string, readonly string[]>;
191
- }
192
- /** Fully-resolved leader network configuration. */
193
- interface ResolvedNetwork {
194
- targets: readonly ResolvedNetworkTarget[];
195
- }
196
228
  /** Membership pricing for the group row (chapter mode). */
197
229
  interface ChapterPrices {
198
230
  standardCents: number;
@@ -349,6 +381,8 @@ interface ChapterConfig {
349
381
  /** Leader → follower delivery targets. Secret values stay in the leader
350
382
  * tenant vault; see {@link ChapterNetworkTarget}. */
351
383
  network?: ChapterNetwork;
384
+ /** Enable a public, host-rendered formation application workflow. */
385
+ formation?: LeaderFormationConfig;
352
386
  thesis?: unknown;
353
387
  /** Required in `chapter` mode. */
354
388
  prices?: ChapterPrices;
@@ -439,6 +473,8 @@ interface Chapter {
439
473
  copy: ChapterCopy;
440
474
  /** Validated follower targets for leader-driven record pushes. */
441
475
  network: ResolvedNetwork;
476
+ /** Resolved public formation intake contract (disabled when omitted). */
477
+ formation: ResolvedLeaderFormation;
442
478
  /** Resolved CRM engine (from `defineCrm`). */
443
479
  crm: Crm;
444
480
  /** Resolved auth policy (source, claim, ladder, super-admin tier). */