@odla-ai/chapter 0.51.0 → 0.52.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.
- package/README.md +110 -8
- package/dist/{chunk-JXX4BFDP.js → chunk-4M2PN5K3.js} +8 -2
- package/dist/chunk-4M2PN5K3.js.map +1 -0
- package/dist/{chunk-UAXWA5BL.js → chunk-TEHCORNC.js} +31 -12
- package/dist/chunk-TEHCORNC.js.map +1 -0
- package/dist/{chunk-4EA5V4JE.js → chunk-WWF2TO3H.js} +239 -136
- package/dist/chunk-WWF2TO3H.js.map +1 -0
- package/dist/{copy-context-Ddat__H5.d.ts → copy-context-qvFo6eA7.d.ts} +12 -6
- package/dist/index.cjs +91 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +71 -13
- package/dist/index.d.ts +71 -13
- package/dist/index.js +91 -8
- package/dist/index.js.map +1 -1
- package/dist/ui/admin/index.d.ts +14 -3
- package/dist/ui/admin/index.js +4 -2
- package/dist/ui/index.d.ts +2 -2
- package/dist/ui/index.js +5 -3
- package/dist/ui/member/index.d.ts +20 -14
- package/dist/ui/member/index.js +2 -2
- package/dist/worker/index.cjs +912 -354
- package/dist/worker/index.cjs.map +1 -1
- package/dist/worker/index.d.cts +48 -10
- package/dist/worker/index.d.ts +48 -10
- package/dist/worker/index.js +912 -354
- package/dist/worker/index.js.map +1 -1
- package/package.json +2 -1
- package/dist/chunk-4EA5V4JE.js.map +0 -1
- package/dist/chunk-JXX4BFDP.js.map +0 -1
- package/dist/chunk-UAXWA5BL.js.map +0 -1
package/dist/worker/index.d.cts
CHANGED
|
@@ -25,7 +25,7 @@ type TextFields$1<Key extends string> = {
|
|
|
25
25
|
[Field in Key]: string;
|
|
26
26
|
};
|
|
27
27
|
/** User-visible language for sharing, delivery state, and leader rollups. */
|
|
28
|
-
type AdminNetworkCopy = TextFields$1<"title" | "allowlistDescription" | "sharing" | "shareWith" | "shared" | "shareFailed" | "deliveryFailed" | "loadingRollup" | "loadRollupFailed" | "overview" | "configuredFollowers" | "reachableFollowers" | "recordsAcrossFollowers" | "noFollowers" | "followers" | "available" | "unavailable" | "transportReachable" | "transportUnavailable" | "transportNotChecked" | "bindingTransport" | "urlTransport" | "activeConfiguration" | "noActiveConfiguration" | "publicSiteAvailable" | "publicSiteUnavailable" | "publicSiteNotChecked" | "recordTotals" | "noRecordTotals">;
|
|
28
|
+
type AdminNetworkCopy = TextFields$1<"title" | "allowlistDescription" | "sharing" | "shareWith" | "shared" | "shareFailed" | "deliveryFailed" | "loadingRollup" | "loadRollupFailed" | "overview" | "configuredFollowers" | "reachableFollowers" | "recordsAcrossFollowers" | "noFollowers" | "followers" | "available" | "unavailable" | "transportReachable" | "transportUnavailable" | "transportNotChecked" | "edgeUnpaired" | "edgeUnpairedHint" | "bindingTransport" | "urlTransport" | "activeConfiguration" | "noActiveConfiguration" | "publicSiteAvailable" | "publicSiteUnavailable" | "publicSiteNotChecked" | "recordTotals" | "noRecordTotals">;
|
|
29
29
|
|
|
30
30
|
/** Copy for the person record panels: lifecycle actions, comms, scheduling, billing and meetings. */
|
|
31
31
|
type AdminRecordsCopy = {
|
|
@@ -56,7 +56,7 @@ interface ChapterCopy {
|
|
|
56
56
|
* agree rather than merely restating the policy. Set it to an empty string
|
|
57
57
|
* to render the checkbox with the policy as its only label.
|
|
58
58
|
*/
|
|
59
|
-
payment: TextFields<"setupFailed" | "preparing" | "pending" | "processing" | "payAndContinue" | "incomplete" | "consent" | "foundingMember" | "foundingDiscount">;
|
|
59
|
+
payment: TextFields<"setupFailed" | "preparing" | "pending" | "processing" | "payAndContinue" | "incomplete" | "consent" | "foundingMember" | "foundingDiscount" | "standardRate" | "yourRate">;
|
|
60
60
|
done: TextFields<"label" | "calendarInvite" | "memberArea">;
|
|
61
61
|
accepted: TextFields<"label" | "body">;
|
|
62
62
|
gift: TextFields<"chooseSelf" | "optionsLabel" | "label" | "body" | "save" | "rotate" | "rotateFailed" | "claimTitle" | "claimBody" | "code" | "redeem" | "redeemed" | "redeemFailed">;
|
|
@@ -78,7 +78,7 @@ interface ChapterCopy {
|
|
|
78
78
|
availability: TextFields<"loading" | "loadFailed" | "saved" | "title" | "days" | "startHour" | "endHour" | "slotMinutes" | "minNoticeHours" | "windowDays" | "timezone" | "summaryTemplate" | "save"> & {
|
|
79
79
|
dayLabels: readonly string[];
|
|
80
80
|
};
|
|
81
|
-
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">;
|
|
81
|
+
email: TextFields<"loading" | "loadFailed" | "saved" | "sent" | "testFailed" | "delivery" | "notificationAddress" | "replyTo" | "fromName" | "fromNameHint" | "debugInbox" | "debugInboxHint" | "sendTest" | "enabled" | "subject" | "body" | "save" | "sendLog" | "sentColumn" | "templateColumn" | "statusColumn" | "toColumn" | "failed" | "redirected" | "delivered">;
|
|
82
82
|
meetings: TextFields<"loading" | "loadFailed" | "cancelConfirm" | "newStartPrompt" | "parseFailed" | "agenda" | "empty" | "unknown" | "drift" | "meet" | "reschedule" | "cancel">;
|
|
83
83
|
admission: TextFields<"title" | "description" | "email" | "decision" | "expires" | "note" | "waive" | "require" | "add" | "ledger" | "loading" | "consumed" | "revoked" | "expired" | "active" | "local" | "parent" | "revoke">;
|
|
84
84
|
network: AdminNetworkCopy;
|
|
@@ -214,7 +214,10 @@ type DbRules = Record<string, Rule>;
|
|
|
214
214
|
|
|
215
215
|
/** One follower site a leader can push CRM records to. The secret VALUE never
|
|
216
216
|
* lives in config: `secretName` names the leader tenant's vaulted copy of the
|
|
217
|
-
* follower's `network_share_secret`.
|
|
217
|
+
* follower's `network_share_secret`. Both slots are declared by
|
|
218
|
+
* `createChapterIntegration` and filled together by
|
|
219
|
+
* `odla-ai chapter edge pair --leader <leader> --follower <id>`; until then
|
|
220
|
+
* every leader-side surface reports the edge as `edge_unpaired`. */
|
|
218
221
|
interface ChapterNetworkTarget {
|
|
219
222
|
/** Stable lowercase slug used by the UI, audit tags, and default secret name. */
|
|
220
223
|
id: string;
|
|
@@ -516,9 +519,12 @@ interface EmailTemplate {
|
|
|
516
519
|
interface ChapterEmails {
|
|
517
520
|
notificationEmail: string;
|
|
518
521
|
replyTo?: string;
|
|
522
|
+
/** Display name on outbound lifecycle mail (`Tori Horton <from@…>`); the
|
|
523
|
+
* address itself stays the Worker's `EMAIL_FROM`. Absent ⇒ bare address. */
|
|
524
|
+
fromName?: string;
|
|
519
525
|
debugEmail?: string;
|
|
520
|
-
/** Operational lifecycle templates: adminNotification /
|
|
521
|
-
* prepEmail / onboardingInvite, each `{ subject, text, enabled? }`. */
|
|
526
|
+
/** Operational lifecycle templates: adminNotification / submitConfirmation /
|
|
527
|
+
* paymentConfirmation / prepEmail / onboardingInvite, each `{ subject, text, enabled? }`. */
|
|
522
528
|
templates?: Record<string, EmailTemplate>;
|
|
523
529
|
}
|
|
524
530
|
/** Booking rules for the intro-call scheduler (stored as schedulingJson). */
|
|
@@ -1134,9 +1140,31 @@ type NamedSeatEvidenceRequest = MembershipQuoteTarget & {
|
|
|
1134
1140
|
eventId: string;
|
|
1135
1141
|
};
|
|
1136
1142
|
|
|
1143
|
+
/** Content-free operator alert attached to an error report. Its shape is a subset of
|
|
1144
|
+
* the `ErrorReport` that `recordError` from `@odla-ai/o11y` accepts, so a host passes
|
|
1145
|
+
* that function straight through as `ChapterWorkerOptions.recordError`. */
|
|
1146
|
+
interface ChapterErrorReport {
|
|
1147
|
+
/** Stable, low-cardinality alert code, for example `stripe_webhook_quarantined`. */
|
|
1148
|
+
code: string;
|
|
1149
|
+
/** Route or step the alert belongs to. */
|
|
1150
|
+
route?: string;
|
|
1151
|
+
/** Low-cardinality index attributes: counts and dispositions, never ids. */
|
|
1152
|
+
attributes?: Record<string, string | number | boolean>;
|
|
1153
|
+
/** Bounded triage context kept out of the index: provider event ids, never PII. */
|
|
1154
|
+
artifacts?: Record<string, unknown>;
|
|
1155
|
+
/** Optional dedup key; the collector falls back to type + code + route. */
|
|
1156
|
+
fingerprint?: string;
|
|
1157
|
+
}
|
|
1158
|
+
/** Records one structured error. `recordError` from `@odla-ai/o11y` satisfies it. */
|
|
1159
|
+
type ChapterErrorRecorder = (error: Error, report: ChapterErrorReport) => unknown;
|
|
1160
|
+
|
|
1137
1161
|
/** The Cloudflare SEND_EMAIL binding payload. */
|
|
1138
1162
|
interface EmailPayload {
|
|
1139
|
-
|
|
1163
|
+
/** A bare address, or `{ name, email }` when the group sets a From display name. */
|
|
1164
|
+
from: string | {
|
|
1165
|
+
name: string;
|
|
1166
|
+
email: string;
|
|
1167
|
+
};
|
|
1140
1168
|
to: string[];
|
|
1141
1169
|
subject: string;
|
|
1142
1170
|
text?: string;
|
|
@@ -1232,6 +1260,12 @@ interface ChapterWorkerOptions {
|
|
|
1232
1260
|
};
|
|
1233
1261
|
/** CRM mount point. Default "/api/crm". */
|
|
1234
1262
|
crmBasePath?: string;
|
|
1263
|
+
/** Structured error recorder for operator alerts: a quarantined Stripe webhook, a
|
|
1264
|
+
* network commercial exception becoming active. Pass `recordError` from
|
|
1265
|
+
* `@odla-ai/o11y` when the Worker is wrapped in `withObservability`; the default
|
|
1266
|
+
* writes one JSON line to `console.error`, which Workers Logs retains. Reports carry
|
|
1267
|
+
* counts and provider event ids only, never payloads or PII. */
|
|
1268
|
+
recordError?: ChapterErrorRecorder;
|
|
1235
1269
|
/** Host routes, tried BEFORE the built-ins — so a wrapping site can add its own
|
|
1236
1270
|
* routes (or override/alias a built-in path) and reuse chapter's auth via the
|
|
1237
1271
|
* shared {@link WorkerContext}, instead of re-verifying JWTs itself. */
|
|
@@ -1308,6 +1342,7 @@ declare function createWorkerContext(options: ChapterWorkerOptions): {
|
|
|
1308
1342
|
makeDb: (env: ChapterEnv) => ChapterDb;
|
|
1309
1343
|
stripeSecretName?: string;
|
|
1310
1344
|
} | undefined;
|
|
1345
|
+
recordError: ChapterErrorRecorder;
|
|
1311
1346
|
getPublicConfig: (env: ChapterEnv) => Promise<PublicConfig>;
|
|
1312
1347
|
verifyUser: (req: Request, env: ChapterEnv) => Promise<Verified | null>;
|
|
1313
1348
|
makeDb: (env: ChapterEnv) => Db;
|
|
@@ -1993,11 +2028,14 @@ declare function withActiveSignupControlTheme(response: Response, options: Activ
|
|
|
1993
2028
|
*
|
|
1994
2029
|
* Observability is a host concern, not a chapter dependency. To trace, wrap the
|
|
1995
2030
|
* result in your worker entry — `export default withObservability(chapterWorker(
|
|
1996
|
-
* { chapter }))` — with `withObservability`
|
|
1997
|
-
*
|
|
2031
|
+
* { chapter, recordError }))` — with `withObservability` and `recordError` from
|
|
2032
|
+
* `@odla-ai/o11y`; `recordError` turns the Worker's operator alerts (quarantined
|
|
2033
|
+
* webhooks, commercial exceptions) into error-level o11y reports. Sites that
|
|
2034
|
+
* don't run o11y bundle `@odla-ai/chapter/worker` without installing it and
|
|
2035
|
+
* keep those alerts as structured `console.error` lines.
|
|
1998
2036
|
*/
|
|
1999
2037
|
declare function chapterWorker(options: ChapterWorkerOptions): {
|
|
2000
2038
|
fetch(req: Request, env: ChapterEnv): Promise<Response>;
|
|
2001
2039
|
};
|
|
2002
2040
|
|
|
2003
|
-
export { type ActiveSignupControlHtml, type ActiveSignupControlThemeOptions, AdmissionGrantDeliveryError, type AdmissionGrantDeliveryOptions, type BuilderLibraryDeliveryOptions, type ChapterEnv, type ChapterWorkerOptions, type LeaderAdmissionAssignment, type LeaderAdmissionDelivery, type LeaderAdmissionDeliveryStatus, MEMBERSHIP_AUTHORITY_PATH, type MemberContentDeliveryOptions, type MembershipAuthorityHandlerOptions, type MembershipAuthorityPeer, type MembershipChapterEffect, type MembershipEffectScope, type MembershipWorkerAdapter, type MembershipWorkerAdapterOptions, type NamedSeatOperatorRefundInput, type NamedSeatRefundReason, type NetworkTargetTransport, NetworkTargetTransportError, type Route, type SignupControlDeliveryOptions, type WorkerContext, chapterMembershipAccess, chapterWorker, createMembershipAuthorityHandler, createMembershipAuthorityStorage, createMembershipChapterEffectRoute, createMembershipWorkerAdapter, createWorkerContext, deliverAdmissionGrants, deliverBuilderLibrary, deliverMemberContent, deliverMembershipChapterEffect, deliverSignupControl, drainMembershipEffects, refundNamedSeatByOperator, renderActiveSignupControlHtml, resolveNetworkTargetTransport, retryChapterApprovalEffects, retryLeaderAdmissionDeliveries, withActiveSignupControlTheme };
|
|
2041
|
+
export { type ActiveSignupControlHtml, type ActiveSignupControlThemeOptions, AdmissionGrantDeliveryError, type AdmissionGrantDeliveryOptions, type BuilderLibraryDeliveryOptions, type ChapterEnv, type ChapterErrorRecorder, type ChapterErrorReport, type ChapterWorkerOptions, type LeaderAdmissionAssignment, type LeaderAdmissionDelivery, type LeaderAdmissionDeliveryStatus, MEMBERSHIP_AUTHORITY_PATH, type MemberContentDeliveryOptions, type MembershipAuthorityHandlerOptions, type MembershipAuthorityPeer, type MembershipChapterEffect, type MembershipEffectScope, type MembershipWorkerAdapter, type MembershipWorkerAdapterOptions, type NamedSeatOperatorRefundInput, type NamedSeatRefundReason, type NetworkTargetTransport, NetworkTargetTransportError, type Route, type SignupControlDeliveryOptions, type WorkerContext, chapterMembershipAccess, chapterWorker, createMembershipAuthorityHandler, createMembershipAuthorityStorage, createMembershipChapterEffectRoute, createMembershipWorkerAdapter, createWorkerContext, deliverAdmissionGrants, deliverBuilderLibrary, deliverMemberContent, deliverMembershipChapterEffect, deliverSignupControl, drainMembershipEffects, refundNamedSeatByOperator, renderActiveSignupControlHtml, resolveNetworkTargetTransport, retryChapterApprovalEffects, retryLeaderAdmissionDeliveries, withActiveSignupControlTheme };
|
package/dist/worker/index.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ type TextFields$1<Key extends string> = {
|
|
|
25
25
|
[Field in Key]: string;
|
|
26
26
|
};
|
|
27
27
|
/** User-visible language for sharing, delivery state, and leader rollups. */
|
|
28
|
-
type AdminNetworkCopy = TextFields$1<"title" | "allowlistDescription" | "sharing" | "shareWith" | "shared" | "shareFailed" | "deliveryFailed" | "loadingRollup" | "loadRollupFailed" | "overview" | "configuredFollowers" | "reachableFollowers" | "recordsAcrossFollowers" | "noFollowers" | "followers" | "available" | "unavailable" | "transportReachable" | "transportUnavailable" | "transportNotChecked" | "bindingTransport" | "urlTransport" | "activeConfiguration" | "noActiveConfiguration" | "publicSiteAvailable" | "publicSiteUnavailable" | "publicSiteNotChecked" | "recordTotals" | "noRecordTotals">;
|
|
28
|
+
type AdminNetworkCopy = TextFields$1<"title" | "allowlistDescription" | "sharing" | "shareWith" | "shared" | "shareFailed" | "deliveryFailed" | "loadingRollup" | "loadRollupFailed" | "overview" | "configuredFollowers" | "reachableFollowers" | "recordsAcrossFollowers" | "noFollowers" | "followers" | "available" | "unavailable" | "transportReachable" | "transportUnavailable" | "transportNotChecked" | "edgeUnpaired" | "edgeUnpairedHint" | "bindingTransport" | "urlTransport" | "activeConfiguration" | "noActiveConfiguration" | "publicSiteAvailable" | "publicSiteUnavailable" | "publicSiteNotChecked" | "recordTotals" | "noRecordTotals">;
|
|
29
29
|
|
|
30
30
|
/** Copy for the person record panels: lifecycle actions, comms, scheduling, billing and meetings. */
|
|
31
31
|
type AdminRecordsCopy = {
|
|
@@ -56,7 +56,7 @@ interface ChapterCopy {
|
|
|
56
56
|
* agree rather than merely restating the policy. Set it to an empty string
|
|
57
57
|
* to render the checkbox with the policy as its only label.
|
|
58
58
|
*/
|
|
59
|
-
payment: TextFields<"setupFailed" | "preparing" | "pending" | "processing" | "payAndContinue" | "incomplete" | "consent" | "foundingMember" | "foundingDiscount">;
|
|
59
|
+
payment: TextFields<"setupFailed" | "preparing" | "pending" | "processing" | "payAndContinue" | "incomplete" | "consent" | "foundingMember" | "foundingDiscount" | "standardRate" | "yourRate">;
|
|
60
60
|
done: TextFields<"label" | "calendarInvite" | "memberArea">;
|
|
61
61
|
accepted: TextFields<"label" | "body">;
|
|
62
62
|
gift: TextFields<"chooseSelf" | "optionsLabel" | "label" | "body" | "save" | "rotate" | "rotateFailed" | "claimTitle" | "claimBody" | "code" | "redeem" | "redeemed" | "redeemFailed">;
|
|
@@ -78,7 +78,7 @@ interface ChapterCopy {
|
|
|
78
78
|
availability: TextFields<"loading" | "loadFailed" | "saved" | "title" | "days" | "startHour" | "endHour" | "slotMinutes" | "minNoticeHours" | "windowDays" | "timezone" | "summaryTemplate" | "save"> & {
|
|
79
79
|
dayLabels: readonly string[];
|
|
80
80
|
};
|
|
81
|
-
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">;
|
|
81
|
+
email: TextFields<"loading" | "loadFailed" | "saved" | "sent" | "testFailed" | "delivery" | "notificationAddress" | "replyTo" | "fromName" | "fromNameHint" | "debugInbox" | "debugInboxHint" | "sendTest" | "enabled" | "subject" | "body" | "save" | "sendLog" | "sentColumn" | "templateColumn" | "statusColumn" | "toColumn" | "failed" | "redirected" | "delivered">;
|
|
82
82
|
meetings: TextFields<"loading" | "loadFailed" | "cancelConfirm" | "newStartPrompt" | "parseFailed" | "agenda" | "empty" | "unknown" | "drift" | "meet" | "reschedule" | "cancel">;
|
|
83
83
|
admission: TextFields<"title" | "description" | "email" | "decision" | "expires" | "note" | "waive" | "require" | "add" | "ledger" | "loading" | "consumed" | "revoked" | "expired" | "active" | "local" | "parent" | "revoke">;
|
|
84
84
|
network: AdminNetworkCopy;
|
|
@@ -214,7 +214,10 @@ type DbRules = Record<string, Rule>;
|
|
|
214
214
|
|
|
215
215
|
/** One follower site a leader can push CRM records to. The secret VALUE never
|
|
216
216
|
* lives in config: `secretName` names the leader tenant's vaulted copy of the
|
|
217
|
-
* follower's `network_share_secret`.
|
|
217
|
+
* follower's `network_share_secret`. Both slots are declared by
|
|
218
|
+
* `createChapterIntegration` and filled together by
|
|
219
|
+
* `odla-ai chapter edge pair --leader <leader> --follower <id>`; until then
|
|
220
|
+
* every leader-side surface reports the edge as `edge_unpaired`. */
|
|
218
221
|
interface ChapterNetworkTarget {
|
|
219
222
|
/** Stable lowercase slug used by the UI, audit tags, and default secret name. */
|
|
220
223
|
id: string;
|
|
@@ -516,9 +519,12 @@ interface EmailTemplate {
|
|
|
516
519
|
interface ChapterEmails {
|
|
517
520
|
notificationEmail: string;
|
|
518
521
|
replyTo?: string;
|
|
522
|
+
/** Display name on outbound lifecycle mail (`Tori Horton <from@…>`); the
|
|
523
|
+
* address itself stays the Worker's `EMAIL_FROM`. Absent ⇒ bare address. */
|
|
524
|
+
fromName?: string;
|
|
519
525
|
debugEmail?: string;
|
|
520
|
-
/** Operational lifecycle templates: adminNotification /
|
|
521
|
-
* prepEmail / onboardingInvite, each `{ subject, text, enabled? }`. */
|
|
526
|
+
/** Operational lifecycle templates: adminNotification / submitConfirmation /
|
|
527
|
+
* paymentConfirmation / prepEmail / onboardingInvite, each `{ subject, text, enabled? }`. */
|
|
522
528
|
templates?: Record<string, EmailTemplate>;
|
|
523
529
|
}
|
|
524
530
|
/** Booking rules for the intro-call scheduler (stored as schedulingJson). */
|
|
@@ -1134,9 +1140,31 @@ type NamedSeatEvidenceRequest = MembershipQuoteTarget & {
|
|
|
1134
1140
|
eventId: string;
|
|
1135
1141
|
};
|
|
1136
1142
|
|
|
1143
|
+
/** Content-free operator alert attached to an error report. Its shape is a subset of
|
|
1144
|
+
* the `ErrorReport` that `recordError` from `@odla-ai/o11y` accepts, so a host passes
|
|
1145
|
+
* that function straight through as `ChapterWorkerOptions.recordError`. */
|
|
1146
|
+
interface ChapterErrorReport {
|
|
1147
|
+
/** Stable, low-cardinality alert code, for example `stripe_webhook_quarantined`. */
|
|
1148
|
+
code: string;
|
|
1149
|
+
/** Route or step the alert belongs to. */
|
|
1150
|
+
route?: string;
|
|
1151
|
+
/** Low-cardinality index attributes: counts and dispositions, never ids. */
|
|
1152
|
+
attributes?: Record<string, string | number | boolean>;
|
|
1153
|
+
/** Bounded triage context kept out of the index: provider event ids, never PII. */
|
|
1154
|
+
artifacts?: Record<string, unknown>;
|
|
1155
|
+
/** Optional dedup key; the collector falls back to type + code + route. */
|
|
1156
|
+
fingerprint?: string;
|
|
1157
|
+
}
|
|
1158
|
+
/** Records one structured error. `recordError` from `@odla-ai/o11y` satisfies it. */
|
|
1159
|
+
type ChapterErrorRecorder = (error: Error, report: ChapterErrorReport) => unknown;
|
|
1160
|
+
|
|
1137
1161
|
/** The Cloudflare SEND_EMAIL binding payload. */
|
|
1138
1162
|
interface EmailPayload {
|
|
1139
|
-
|
|
1163
|
+
/** A bare address, or `{ name, email }` when the group sets a From display name. */
|
|
1164
|
+
from: string | {
|
|
1165
|
+
name: string;
|
|
1166
|
+
email: string;
|
|
1167
|
+
};
|
|
1140
1168
|
to: string[];
|
|
1141
1169
|
subject: string;
|
|
1142
1170
|
text?: string;
|
|
@@ -1232,6 +1260,12 @@ interface ChapterWorkerOptions {
|
|
|
1232
1260
|
};
|
|
1233
1261
|
/** CRM mount point. Default "/api/crm". */
|
|
1234
1262
|
crmBasePath?: string;
|
|
1263
|
+
/** Structured error recorder for operator alerts: a quarantined Stripe webhook, a
|
|
1264
|
+
* network commercial exception becoming active. Pass `recordError` from
|
|
1265
|
+
* `@odla-ai/o11y` when the Worker is wrapped in `withObservability`; the default
|
|
1266
|
+
* writes one JSON line to `console.error`, which Workers Logs retains. Reports carry
|
|
1267
|
+
* counts and provider event ids only, never payloads or PII. */
|
|
1268
|
+
recordError?: ChapterErrorRecorder;
|
|
1235
1269
|
/** Host routes, tried BEFORE the built-ins — so a wrapping site can add its own
|
|
1236
1270
|
* routes (or override/alias a built-in path) and reuse chapter's auth via the
|
|
1237
1271
|
* shared {@link WorkerContext}, instead of re-verifying JWTs itself. */
|
|
@@ -1308,6 +1342,7 @@ declare function createWorkerContext(options: ChapterWorkerOptions): {
|
|
|
1308
1342
|
makeDb: (env: ChapterEnv) => ChapterDb;
|
|
1309
1343
|
stripeSecretName?: string;
|
|
1310
1344
|
} | undefined;
|
|
1345
|
+
recordError: ChapterErrorRecorder;
|
|
1311
1346
|
getPublicConfig: (env: ChapterEnv) => Promise<PublicConfig>;
|
|
1312
1347
|
verifyUser: (req: Request, env: ChapterEnv) => Promise<Verified | null>;
|
|
1313
1348
|
makeDb: (env: ChapterEnv) => Db;
|
|
@@ -1993,11 +2028,14 @@ declare function withActiveSignupControlTheme(response: Response, options: Activ
|
|
|
1993
2028
|
*
|
|
1994
2029
|
* Observability is a host concern, not a chapter dependency. To trace, wrap the
|
|
1995
2030
|
* result in your worker entry — `export default withObservability(chapterWorker(
|
|
1996
|
-
* { chapter }))` — with `withObservability`
|
|
1997
|
-
*
|
|
2031
|
+
* { chapter, recordError }))` — with `withObservability` and `recordError` from
|
|
2032
|
+
* `@odla-ai/o11y`; `recordError` turns the Worker's operator alerts (quarantined
|
|
2033
|
+
* webhooks, commercial exceptions) into error-level o11y reports. Sites that
|
|
2034
|
+
* don't run o11y bundle `@odla-ai/chapter/worker` without installing it and
|
|
2035
|
+
* keep those alerts as structured `console.error` lines.
|
|
1998
2036
|
*/
|
|
1999
2037
|
declare function chapterWorker(options: ChapterWorkerOptions): {
|
|
2000
2038
|
fetch(req: Request, env: ChapterEnv): Promise<Response>;
|
|
2001
2039
|
};
|
|
2002
2040
|
|
|
2003
|
-
export { type ActiveSignupControlHtml, type ActiveSignupControlThemeOptions, AdmissionGrantDeliveryError, type AdmissionGrantDeliveryOptions, type BuilderLibraryDeliveryOptions, type ChapterEnv, type ChapterWorkerOptions, type LeaderAdmissionAssignment, type LeaderAdmissionDelivery, type LeaderAdmissionDeliveryStatus, MEMBERSHIP_AUTHORITY_PATH, type MemberContentDeliveryOptions, type MembershipAuthorityHandlerOptions, type MembershipAuthorityPeer, type MembershipChapterEffect, type MembershipEffectScope, type MembershipWorkerAdapter, type MembershipWorkerAdapterOptions, type NamedSeatOperatorRefundInput, type NamedSeatRefundReason, type NetworkTargetTransport, NetworkTargetTransportError, type Route, type SignupControlDeliveryOptions, type WorkerContext, chapterMembershipAccess, chapterWorker, createMembershipAuthorityHandler, createMembershipAuthorityStorage, createMembershipChapterEffectRoute, createMembershipWorkerAdapter, createWorkerContext, deliverAdmissionGrants, deliverBuilderLibrary, deliverMemberContent, deliverMembershipChapterEffect, deliverSignupControl, drainMembershipEffects, refundNamedSeatByOperator, renderActiveSignupControlHtml, resolveNetworkTargetTransport, retryChapterApprovalEffects, retryLeaderAdmissionDeliveries, withActiveSignupControlTheme };
|
|
2041
|
+
export { type ActiveSignupControlHtml, type ActiveSignupControlThemeOptions, AdmissionGrantDeliveryError, type AdmissionGrantDeliveryOptions, type BuilderLibraryDeliveryOptions, type ChapterEnv, type ChapterErrorRecorder, type ChapterErrorReport, type ChapterWorkerOptions, type LeaderAdmissionAssignment, type LeaderAdmissionDelivery, type LeaderAdmissionDeliveryStatus, MEMBERSHIP_AUTHORITY_PATH, type MemberContentDeliveryOptions, type MembershipAuthorityHandlerOptions, type MembershipAuthorityPeer, type MembershipChapterEffect, type MembershipEffectScope, type MembershipWorkerAdapter, type MembershipWorkerAdapterOptions, type NamedSeatOperatorRefundInput, type NamedSeatRefundReason, type NetworkTargetTransport, NetworkTargetTransportError, type Route, type SignupControlDeliveryOptions, type WorkerContext, chapterMembershipAccess, chapterWorker, createMembershipAuthorityHandler, createMembershipAuthorityStorage, createMembershipChapterEffectRoute, createMembershipWorkerAdapter, createWorkerContext, deliverAdmissionGrants, deliverBuilderLibrary, deliverMemberContent, deliverMembershipChapterEffect, deliverSignupControl, drainMembershipEffects, refundNamedSeatByOperator, renderActiveSignupControlHtml, resolveNetworkTargetTransport, retryChapterApprovalEffects, retryLeaderAdmissionDeliveries, withActiveSignupControlTheme };
|