@odla-ai/chapter 0.35.0 → 0.37.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.
@@ -44,18 +44,21 @@ interface ChapterCopy {
44
44
  */
45
45
  payment: TextFields<"setupFailed" | "preparing" | "pending" | "processing" | "payAndContinue" | "incomplete" | "consent">;
46
46
  done: TextFields<"label" | "calendarInvite" | "memberArea">;
47
+ accepted: TextFields<"label" | "body">;
48
+ gift: TextFields<"chooseSelf" | "optionsLabel" | "label" | "body" | "save" | "rotate" | "rotateFailed">;
47
49
  };
48
50
  members: {
49
51
  loadFailed: string;
50
52
  account: TextFields<"signOut" | "adminConsole">;
51
53
  provisional: TextFields<"cardLabel" | "applicationNeeded" | "applicationNeededBody" | "apply" | "refunded" | "refundedBody" | "active" | "renews" | "introductionCall" | "calendarInvite" | "joinCall" | "bookCall" | "bookCallBody" | "chooseTime">;
52
54
  full: TextFields<"welcome">;
55
+ gifts: TextFields<"title" | "body" | "noneAvailable" | "paid" | "saveCode" | "purchases" | "noPurchases" | "pending" | "redeemed" | "expired" | "revoked" | "rotate" | "rotated" | "rotateFailed" | "redeemTitle" | "code" | "redeem" | "redeemFailed">;
53
56
  reschedule: TextFields<"changeTime" | "unavailable" | "loadFailed" | "slotGone" | "loading" | "noTimes" | "rescheduling" | "keepTime">;
54
57
  };
55
58
  admin: {
56
59
  auth: TextFields<"checking" | "notAuthorized" | "accountNotAuthorized" | "thisAccount" | "signOut" | "loading" | "signInNotConfigured" | "missingPublishableKey" | "noWorkspaces" | "signInTagline">;
57
60
  shell: TextFields<"adminRole" | "adminConsole" | "adminName" | "navigationLabel">;
58
- workspaces: TextFields<"dashboard" | "overview" | "billing" | "people" | "network" | "portfolio" | "settings" | "calendar" | "email" | "chapters" | "formations" | "dealFlow" | "dashboardViewsLabel" | "settingsViewsLabel" | "collectionsLabel" | "portfolioViewsLabel">;
61
+ workspaces: TextFields<"dashboard" | "overview" | "billing" | "people" | "admission" | "network" | "portfolio" | "settings" | "calendar" | "email" | "chapters" | "formations" | "dealFlow" | "dashboardViewsLabel" | "settingsViewsLabel" | "collectionsLabel" | "portfolioViewsLabel">;
59
62
  dashboard: TextFields<"loading" | "loadFailed" | "upcomingCalls" | "callsNeedAttention" | "noUpcomingCalls" | "drift" | "open" | "meet" | "applications" | "newMembers" | "newMembersUnavailable" | "revenueAdded" | "revenue" | "revenueUnavailable" | "pipeline" | "pipelineLabel" | "thisWeek" | "noChange" | "activeMemberships" | "annualRunRate" | "testMode">;
60
63
  billing: TextFields<"loading" | "loadFailed" | "notConfigured" | "active" | "annualized" | "renewingSoon" | "pastDue" | "subscriptions" | "testMode" | "truncated" | "name" | "email" | "application" | "subscription" | "cancelling" | "amount" | "renews">;
61
64
  availability: TextFields<"loading" | "loadFailed" | "saved" | "title" | "days" | "startHour" | "endHour" | "slotMinutes" | "minNoticeHours" | "windowDays" | "timezone" | "summaryTemplate" | "save"> & {
@@ -63,6 +66,7 @@ interface ChapterCopy {
63
66
  };
64
67
  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">;
65
68
  meetings: TextFields<"loading" | "loadFailed" | "cancelConfirm" | "newStartPrompt" | "parseFailed" | "agenda" | "empty" | "unknown" | "drift" | "meet" | "reschedule" | "cancel">;
69
+ admission: TextFields<"title" | "description" | "email" | "decision" | "expires" | "note" | "waive" | "require" | "add" | "ledger" | "loading" | "consumed" | "revoked" | "expired" | "active" | "local" | "parent" | "revoke">;
66
70
  network: AdminNetworkCopy;
67
71
  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">;
68
72
  };
@@ -89,6 +93,55 @@ interface ResolvedSignupControl {
89
93
  stripeMode: "test" | "live";
90
94
  }
91
95
 
96
+ /** Optional authenticated member-content surface for a chapter site. */
97
+ interface ChapterMemberContent {
98
+ /** Keep Chapter-admin authoring enabled. Defaults to true. */
99
+ localAuthoring?: boolean;
100
+ /** Optional Parent/Built Not Found authority for signed inherited revisions. */
101
+ parent?: {
102
+ sourceId: string;
103
+ /** Follower-vault key holding the dedicated content edge secret. */
104
+ secretName?: string;
105
+ };
106
+ }
107
+ /** Validated member-content settings carried on a resolved Chapter. */
108
+ interface ResolvedMemberContent {
109
+ enabled: true;
110
+ localAuthoring: boolean;
111
+ parent: {
112
+ sourceId: string;
113
+ secretName: string;
114
+ } | null;
115
+ }
116
+
117
+ /** Scalar kinds accepted by the Chapter schema adapter. */
118
+ type AttrType = "string" | "number" | "boolean" | "json";
119
+ /** One odla-db attribute: its type and index/uniqueness/optionality flags. */
120
+ interface Attr {
121
+ type: AttrType;
122
+ unique: boolean;
123
+ indexed: boolean;
124
+ optional: boolean;
125
+ }
126
+ /** One odla-db namespace: its attribute map. */
127
+ interface Entity {
128
+ attrs: Record<string, Attr>;
129
+ }
130
+ /** A serialized odla-db schema fragment (namespaces + links). */
131
+ interface DbSchema {
132
+ entities: Record<string, Entity>;
133
+ links: Record<string, unknown>;
134
+ }
135
+ /** Per-namespace CEL rule strings (deny-all is `"false"` for each action). */
136
+ interface Rule {
137
+ view: string;
138
+ create: string;
139
+ update: string;
140
+ delete: string;
141
+ }
142
+ /** Namespace → rule set. */
143
+ type DbRules = Record<string, Rule>;
144
+
92
145
  /** One follower site a leader can push CRM records to. The secret VALUE never
93
146
  * lives in config: `secretName` names the leader tenant's vaulted copy of the
94
147
  * follower's `network_share_secret`. */
@@ -210,33 +263,6 @@ interface ChapterPolicy {
210
263
  * (join, Stripe membership, booking, member area, admin, CRM); `hub` is
211
264
  * admin-only and CRM-focused (a directory/registry over the same CRM). */
212
265
  type ChapterMode = "chapter" | "hub";
213
- /** The scalar kinds an odla-db attribute can hold. */
214
- type AttrType = "string" | "number" | "boolean" | "json";
215
- /** One odla-db attribute: its type and index/uniqueness/optionality flags. */
216
- interface Attr {
217
- type: AttrType;
218
- unique: boolean;
219
- indexed: boolean;
220
- optional: boolean;
221
- }
222
- /** One odla-db namespace: its attribute map. */
223
- interface Entity {
224
- attrs: Record<string, Attr>;
225
- }
226
- /** A serialized odla-db schema fragment (namespaces + links). */
227
- interface DbSchema {
228
- entities: Record<string, Entity>;
229
- links: Record<string, unknown>;
230
- }
231
- /** Per-namespace CEL rule strings (deny-all is `"false"` for each action). */
232
- interface Rule {
233
- view: string;
234
- create: string;
235
- update: string;
236
- delete: string;
237
- }
238
- /** Namespace → rule set. */
239
- type DbRules = Record<string, Rule>;
240
266
  /** Typed semantic roles shared by the public site and application surfaces. */
241
267
  interface ChapterBrandTokens {
242
268
  background?: string;
@@ -460,6 +486,8 @@ interface ChapterConfig {
460
486
  network?: ChapterNetwork;
461
487
  /** A separate signed edge that may control this chapter's complete signup. */
462
488
  signupControl?: ChapterSignupControl;
489
+ /** Authenticated parent + chapter member pages with server-enforced tier access. */
490
+ memberContent?: ChapterMemberContent;
463
491
  /** Enable a public, host-rendered formation application workflow. */
464
492
  formation?: LeaderFormationConfig;
465
493
  thesis?: unknown;
@@ -556,6 +584,8 @@ interface Chapter {
556
584
  network: ResolvedNetwork;
557
585
  /** Null unless this follower explicitly delegates signup authority. */
558
586
  signupControl: ResolvedSignupControl | null;
587
+ /** Null unless the standard authenticated member-content surface is enabled. */
588
+ memberContent: ResolvedMemberContent | null;
559
589
  /** Resolved public formation intake contract (disabled when omitted). */
560
590
  formation: ResolvedLeaderFormation;
561
591
  /** Resolved CRM engine (from `defineCrm`). */
@@ -580,6 +610,126 @@ interface Chapter {
580
610
  groupSeed(): Record<string, unknown> | null;
581
611
  }
582
612
 
613
+ /** Versioned contract for authenticated member content. */
614
+ declare const MEMBER_CONTENT_SCHEMA_VERSION: 1;
615
+ /** Authority that authored one independently stored member-content layer. */
616
+ type MemberContentSourceType = "parent" | "chapter";
617
+ /** Stable author identity attached to every member-content document and page. */
618
+ interface MemberContentSource {
619
+ type: MemberContentSourceType;
620
+ appId: string;
621
+ }
622
+ /** Chapter deployment that a parent member-content revision is intended for. */
623
+ interface MemberContentTarget {
624
+ chapterId: string;
625
+ environment: string;
626
+ }
627
+ /** Navigation is data, so agents do not have to coordinate route code. */
628
+ interface MemberPageNavigation {
629
+ section: string;
630
+ order: number;
631
+ parentId?: string;
632
+ }
633
+ /** Explicit sets avoid unsafe assumptions that commercial tiers form a ladder. */
634
+ type MemberPageAudience = {
635
+ kind: "all-members";
636
+ } | {
637
+ kind: "tiers";
638
+ tierIds: readonly string[];
639
+ };
640
+ /** Authored offer copy. Price and provider identity deliberately do not live here. */
641
+ interface MemberPageUpsellOffer {
642
+ tierId: string;
643
+ label?: string;
644
+ bodyMarkdown?: string;
645
+ ctaLabel?: string;
646
+ }
647
+ /** Parent offer authority is explicit; a Chapter can edit only a delegated offer. */
648
+ type MemberPageUpsell = {
649
+ owner: "parent";
650
+ offer: MemberPageUpsellOffer;
651
+ } | {
652
+ owner: "chapter";
653
+ offer?: MemberPageUpsellOffer;
654
+ };
655
+ /** Authored member page whose body is disclosed only after server-side projection. */
656
+ interface MemberContentPage {
657
+ id: string;
658
+ slug: string;
659
+ title: string;
660
+ summary?: string;
661
+ navigation: MemberPageNavigation;
662
+ audience: MemberPageAudience;
663
+ /** Safe Markdown shown while the body is withheld. */
664
+ teaserMarkdown?: string;
665
+ /** Never serialized to a viewer whose audience does not match. */
666
+ bodyMarkdown: string;
667
+ upsell?: MemberPageUpsell;
668
+ }
669
+ /** Chapter-owned offer attached to a Parent page that delegated offer authority. */
670
+ interface MemberPageUpsellOverride {
671
+ pageId: string;
672
+ offer: MemberPageUpsellOffer;
673
+ }
674
+ /** One complete source layer. Parent and Chapter layers are stored independently. */
675
+ interface MemberContentDocument {
676
+ schemaVersion: typeof MEMBER_CONTENT_SCHEMA_VERSION;
677
+ revision: number;
678
+ generatedAt: number;
679
+ source: MemberContentSource;
680
+ target?: MemberContentTarget;
681
+ pages: readonly MemberContentPage[];
682
+ upsellOverrides?: readonly MemberPageUpsellOverride[];
683
+ }
684
+ /** Provider-neutral tier facts used to validate access and resolve safe offers. */
685
+ interface MemberContentTierAuthority {
686
+ id: string;
687
+ name?: string;
688
+ priceCents?: number;
689
+ active?: boolean;
690
+ }
691
+ /** Composed member page retaining the identity of its authoring layer. */
692
+ interface EffectiveMemberContentPage extends MemberContentPage {
693
+ source: MemberContentSource;
694
+ }
695
+ /** Deterministically ordered parent and chapter layers with their source revisions. */
696
+ interface EffectiveMemberContent {
697
+ pages: readonly EffectiveMemberContentPage[];
698
+ parentRevision: number | null;
699
+ chapterRevision: number | null;
700
+ }
701
+ /** Authored upsell joined to active chapter tier name and price authority. */
702
+ interface ResolvedMemberPageUpsell extends MemberPageUpsellOffer {
703
+ tierName: string;
704
+ priceCents: number;
705
+ }
706
+ /** Viewer-safe page result; locked projections never carry bodyMarkdown. */
707
+ interface MemberContentPageProjection {
708
+ id: string;
709
+ slug: string;
710
+ title: string;
711
+ summary?: string;
712
+ navigation: MemberPageNavigation;
713
+ audience: MemberPageAudience;
714
+ source: MemberContentSource;
715
+ access: "allowed" | "locked";
716
+ teaserMarkdown?: string;
717
+ bodyMarkdown?: string;
718
+ upsell?: ResolvedMemberPageUpsell;
719
+ }
720
+ /** Complete viewer-safe member navigation and revision projection. */
721
+ interface MemberContentProjection {
722
+ pages: readonly MemberContentPageProjection[];
723
+ viewer: {
724
+ tierId: string | null;
725
+ admin: boolean;
726
+ };
727
+ revisions: {
728
+ parent: number | null;
729
+ chapter: number | null;
730
+ };
731
+ }
732
+
583
733
  /** Place a resolved or partial copy contract around any Chapter UI surface. */
584
734
  declare function ChapterCopyProvider(props: {
585
735
  copy?: ChapterCopy | ChapterCopyInput;
@@ -588,4 +738,4 @@ declare function ChapterCopyProvider(props: {
588
738
  /** Read the nearest complete Chapter copy contract. */
589
739
  declare function useChapterCopy(): ChapterCopy;
590
740
 
591
- export { ChapterCopyProvider as C, type Chapter as a, type ChapterCopy as b, type ChapterBrand as c, useChapterCopy as u };
741
+ export { ChapterCopyProvider as C, type EffectiveMemberContent as E, type MemberContentDocument as M, type Chapter as a, type ChapterCopy as b, type MemberContentTierAuthority as c, type MemberContentProjection as d, type MemberContentPageProjection as e, type ChapterBrand as f, useChapterCopy as u };