@odla-ai/chapter 0.42.1 → 0.42.2
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 +13 -1
- package/dist/{chunk-MMDWXTJU.js → chunk-HWUTCXBV.js} +44 -1
- package/dist/chunk-HWUTCXBV.js.map +1 -0
- package/dist/{copy-context-BNUzbL5g.d.ts → copy-context-BBPsYe24.d.ts} +9 -1
- package/dist/index.cjs +88 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -2
- package/dist/index.d.ts +10 -2
- package/dist/index.js +88 -10
- package/dist/index.js.map +1 -1
- package/dist/ui/admin/index.d.ts +14 -3
- package/dist/ui/admin/index.js +3 -1
- package/dist/ui/index.d.ts +2 -2
- package/dist/ui/index.js +3 -1
- package/dist/ui/member/index.d.ts +2 -2
- package/dist/worker/index.cjs +477 -144
- package/dist/worker/index.cjs.map +1 -1
- package/dist/worker/index.d.cts +55 -2
- package/dist/worker/index.d.ts +55 -2
- package/dist/worker/index.js +453 -120
- package/dist/worker/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-MMDWXTJU.js.map +0 -1
package/dist/worker/index.d.cts
CHANGED
|
@@ -192,6 +192,9 @@ interface ChapterNetworkTarget {
|
|
|
192
192
|
/** Record types on which this leader permits remote lifecycle transitions.
|
|
193
193
|
* The follower must independently opt in and remains pipeline authority. */
|
|
194
194
|
stageTransitions?: readonly string[];
|
|
195
|
+
/** Allow package-owned desired admission decisions for existing leader CRM
|
|
196
|
+
* people to be delivered to this target. Omitted means default deny. */
|
|
197
|
+
admissionGrants?: boolean;
|
|
195
198
|
}
|
|
196
199
|
/** One signed peer allowed to browse a privacy-bounded projection of this
|
|
197
200
|
* site's CRM. The follower owns this allowlist; a leader target declaration
|
|
@@ -201,7 +204,7 @@ interface ChapterNetworkReader {
|
|
|
201
204
|
id: string;
|
|
202
205
|
/** Per-record-type field allowlist. Omitted types and fields never leave
|
|
203
206
|
* this site. Record id, name, stage, and timestamps are bounded metadata. */
|
|
204
|
-
fields
|
|
207
|
+
fields?: Record<string, readonly string[]>;
|
|
205
208
|
/** Record types on which this reader may append an explicitly shared note.
|
|
206
209
|
* Omitted by default: browse permission never silently grants write access.
|
|
207
210
|
* Shared notes land in the follower CRM activity feed. */
|
|
@@ -213,6 +216,9 @@ interface ChapterNetworkReader {
|
|
|
213
216
|
/** Local CRM record types on which this reader may request a lifecycle
|
|
214
217
|
* transition. Chapter still enforces the local pipeline and gates. */
|
|
215
218
|
stageTransitions?: readonly string[];
|
|
219
|
+
/** Accept signed desired admission decisions from this reader. Independent
|
|
220
|
+
* of record browsing; an admission-only reader may omit `fields`. */
|
|
221
|
+
admissionGrants?: boolean;
|
|
216
222
|
}
|
|
217
223
|
/** Leader/follower network configuration. A follower needs no code config to
|
|
218
224
|
* receive pushed records. It must explicitly declare `readers` before any peer
|
|
@@ -257,6 +263,7 @@ interface ResolvedNetworkTarget {
|
|
|
257
263
|
sharedNotes: readonly string[];
|
|
258
264
|
editableFields: Record<string, readonly string[]>;
|
|
259
265
|
stageTransitions: readonly string[];
|
|
266
|
+
admissionGrants?: boolean;
|
|
260
267
|
}
|
|
261
268
|
/** A validated follower-owned record projection for one signed reader. */
|
|
262
269
|
interface ResolvedNetworkReader {
|
|
@@ -265,6 +272,7 @@ interface ResolvedNetworkReader {
|
|
|
265
272
|
sharedNotes: readonly string[];
|
|
266
273
|
editableFields: Record<string, readonly string[]>;
|
|
267
274
|
stageTransitions: readonly string[];
|
|
275
|
+
admissionGrants?: boolean;
|
|
268
276
|
}
|
|
269
277
|
/** Fully-resolved leader network configuration. */
|
|
270
278
|
interface ResolvedNetwork {
|
|
@@ -1210,9 +1218,54 @@ interface AdmissionGrantDeliveryOptions {
|
|
|
1210
1218
|
envelope: AdmissionGrantEnvelope;
|
|
1211
1219
|
fetch?: typeof globalThis.fetch;
|
|
1212
1220
|
}
|
|
1221
|
+
/** Structured follower rejection retained by the durable leader outbox. */
|
|
1222
|
+
declare class AdmissionGrantDeliveryError extends Error {
|
|
1223
|
+
readonly status: number;
|
|
1224
|
+
readonly reason: string;
|
|
1225
|
+
constructor(status: number, reason: string);
|
|
1226
|
+
}
|
|
1213
1227
|
/** Deliver one signed Parent admission revision. Durable retry belongs upstream. */
|
|
1214
1228
|
declare function deliverAdmissionGrants(options: AdmissionGrantDeliveryOptions): Promise<AdmissionGrantReceipt>;
|
|
1215
1229
|
|
|
1230
|
+
/** Durable state of the latest desired admission document for one target. */
|
|
1231
|
+
type LeaderAdmissionDeliveryStatus = "saved" | "pending" | "acknowledged" | "retrying" | "rejected";
|
|
1232
|
+
/** Leader-owned desired admission decision for one authoritative CRM person. */
|
|
1233
|
+
interface LeaderAdmissionAssignment {
|
|
1234
|
+
id: string;
|
|
1235
|
+
targetId: string;
|
|
1236
|
+
personId: string;
|
|
1237
|
+
grantId: string;
|
|
1238
|
+
decision: AdmissionDecision;
|
|
1239
|
+
note?: string;
|
|
1240
|
+
expiresAt?: number;
|
|
1241
|
+
active: boolean;
|
|
1242
|
+
lastMutationId: string;
|
|
1243
|
+
lastRequestDigest: string;
|
|
1244
|
+
createdAt: number;
|
|
1245
|
+
createdBy: string;
|
|
1246
|
+
updatedAt: number;
|
|
1247
|
+
updatedBy: string;
|
|
1248
|
+
}
|
|
1249
|
+
/** Persisted desired admission envelope and its latest delivery evidence. */
|
|
1250
|
+
interface LeaderAdmissionDelivery {
|
|
1251
|
+
id: string;
|
|
1252
|
+
targetId: string;
|
|
1253
|
+
environment: string;
|
|
1254
|
+
revision: number;
|
|
1255
|
+
digest: string;
|
|
1256
|
+
envelope: AdmissionGrantEnvelope;
|
|
1257
|
+
status: LeaderAdmissionDeliveryStatus;
|
|
1258
|
+
attempts: number;
|
|
1259
|
+
lastAttemptAt?: number;
|
|
1260
|
+
lastError?: string;
|
|
1261
|
+
acknowledgedAt?: number;
|
|
1262
|
+
updatedAt: number;
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1265
|
+
/** Retry every non-final saved delivery. Hosts may call this from a cron using
|
|
1266
|
+
* the same Worker context; request retries use the packaged admin route. */
|
|
1267
|
+
declare function retryLeaderAdmissionDeliveries(env: ChapterEnv, ctx: WorkerContext, limit?: number): Promise<LeaderAdmissionDelivery[]>;
|
|
1268
|
+
|
|
1216
1269
|
/** Identity shared by initial HTML, response caching, and client hydration. */
|
|
1217
1270
|
interface SignupControlThemeMetadata {
|
|
1218
1271
|
source: "active" | "bootstrap";
|
|
@@ -1283,4 +1336,4 @@ declare function chapterWorker(options: ChapterWorkerOptions): {
|
|
|
1283
1336
|
fetch(req: Request, env: ChapterEnv): Promise<Response>;
|
|
1284
1337
|
};
|
|
1285
1338
|
|
|
1286
|
-
export { type ActiveSignupControlHtml, type ActiveSignupControlThemeOptions, type AdmissionGrantDeliveryOptions, type BuilderLibraryDeliveryOptions, type ChapterEnv, type ChapterWorkerOptions, type MemberContentDeliveryOptions, type Route, type SignupControlDeliveryOptions, type WorkerContext, chapterWorker, createWorkerContext, deliverAdmissionGrants, deliverBuilderLibrary, deliverMemberContent, deliverSignupControl, renderActiveSignupControlHtml, withActiveSignupControlTheme };
|
|
1339
|
+
export { type ActiveSignupControlHtml, type ActiveSignupControlThemeOptions, AdmissionGrantDeliveryError, type AdmissionGrantDeliveryOptions, type BuilderLibraryDeliveryOptions, type ChapterEnv, type ChapterWorkerOptions, type LeaderAdmissionAssignment, type LeaderAdmissionDelivery, type LeaderAdmissionDeliveryStatus, type MemberContentDeliveryOptions, type Route, type SignupControlDeliveryOptions, type WorkerContext, chapterWorker, createWorkerContext, deliverAdmissionGrants, deliverBuilderLibrary, deliverMemberContent, deliverSignupControl, renderActiveSignupControlHtml, retryLeaderAdmissionDeliveries, withActiveSignupControlTheme };
|
package/dist/worker/index.d.ts
CHANGED
|
@@ -192,6 +192,9 @@ interface ChapterNetworkTarget {
|
|
|
192
192
|
/** Record types on which this leader permits remote lifecycle transitions.
|
|
193
193
|
* The follower must independently opt in and remains pipeline authority. */
|
|
194
194
|
stageTransitions?: readonly string[];
|
|
195
|
+
/** Allow package-owned desired admission decisions for existing leader CRM
|
|
196
|
+
* people to be delivered to this target. Omitted means default deny. */
|
|
197
|
+
admissionGrants?: boolean;
|
|
195
198
|
}
|
|
196
199
|
/** One signed peer allowed to browse a privacy-bounded projection of this
|
|
197
200
|
* site's CRM. The follower owns this allowlist; a leader target declaration
|
|
@@ -201,7 +204,7 @@ interface ChapterNetworkReader {
|
|
|
201
204
|
id: string;
|
|
202
205
|
/** Per-record-type field allowlist. Omitted types and fields never leave
|
|
203
206
|
* this site. Record id, name, stage, and timestamps are bounded metadata. */
|
|
204
|
-
fields
|
|
207
|
+
fields?: Record<string, readonly string[]>;
|
|
205
208
|
/** Record types on which this reader may append an explicitly shared note.
|
|
206
209
|
* Omitted by default: browse permission never silently grants write access.
|
|
207
210
|
* Shared notes land in the follower CRM activity feed. */
|
|
@@ -213,6 +216,9 @@ interface ChapterNetworkReader {
|
|
|
213
216
|
/** Local CRM record types on which this reader may request a lifecycle
|
|
214
217
|
* transition. Chapter still enforces the local pipeline and gates. */
|
|
215
218
|
stageTransitions?: readonly string[];
|
|
219
|
+
/** Accept signed desired admission decisions from this reader. Independent
|
|
220
|
+
* of record browsing; an admission-only reader may omit `fields`. */
|
|
221
|
+
admissionGrants?: boolean;
|
|
216
222
|
}
|
|
217
223
|
/** Leader/follower network configuration. A follower needs no code config to
|
|
218
224
|
* receive pushed records. It must explicitly declare `readers` before any peer
|
|
@@ -257,6 +263,7 @@ interface ResolvedNetworkTarget {
|
|
|
257
263
|
sharedNotes: readonly string[];
|
|
258
264
|
editableFields: Record<string, readonly string[]>;
|
|
259
265
|
stageTransitions: readonly string[];
|
|
266
|
+
admissionGrants?: boolean;
|
|
260
267
|
}
|
|
261
268
|
/** A validated follower-owned record projection for one signed reader. */
|
|
262
269
|
interface ResolvedNetworkReader {
|
|
@@ -265,6 +272,7 @@ interface ResolvedNetworkReader {
|
|
|
265
272
|
sharedNotes: readonly string[];
|
|
266
273
|
editableFields: Record<string, readonly string[]>;
|
|
267
274
|
stageTransitions: readonly string[];
|
|
275
|
+
admissionGrants?: boolean;
|
|
268
276
|
}
|
|
269
277
|
/** Fully-resolved leader network configuration. */
|
|
270
278
|
interface ResolvedNetwork {
|
|
@@ -1210,9 +1218,54 @@ interface AdmissionGrantDeliveryOptions {
|
|
|
1210
1218
|
envelope: AdmissionGrantEnvelope;
|
|
1211
1219
|
fetch?: typeof globalThis.fetch;
|
|
1212
1220
|
}
|
|
1221
|
+
/** Structured follower rejection retained by the durable leader outbox. */
|
|
1222
|
+
declare class AdmissionGrantDeliveryError extends Error {
|
|
1223
|
+
readonly status: number;
|
|
1224
|
+
readonly reason: string;
|
|
1225
|
+
constructor(status: number, reason: string);
|
|
1226
|
+
}
|
|
1213
1227
|
/** Deliver one signed Parent admission revision. Durable retry belongs upstream. */
|
|
1214
1228
|
declare function deliverAdmissionGrants(options: AdmissionGrantDeliveryOptions): Promise<AdmissionGrantReceipt>;
|
|
1215
1229
|
|
|
1230
|
+
/** Durable state of the latest desired admission document for one target. */
|
|
1231
|
+
type LeaderAdmissionDeliveryStatus = "saved" | "pending" | "acknowledged" | "retrying" | "rejected";
|
|
1232
|
+
/** Leader-owned desired admission decision for one authoritative CRM person. */
|
|
1233
|
+
interface LeaderAdmissionAssignment {
|
|
1234
|
+
id: string;
|
|
1235
|
+
targetId: string;
|
|
1236
|
+
personId: string;
|
|
1237
|
+
grantId: string;
|
|
1238
|
+
decision: AdmissionDecision;
|
|
1239
|
+
note?: string;
|
|
1240
|
+
expiresAt?: number;
|
|
1241
|
+
active: boolean;
|
|
1242
|
+
lastMutationId: string;
|
|
1243
|
+
lastRequestDigest: string;
|
|
1244
|
+
createdAt: number;
|
|
1245
|
+
createdBy: string;
|
|
1246
|
+
updatedAt: number;
|
|
1247
|
+
updatedBy: string;
|
|
1248
|
+
}
|
|
1249
|
+
/** Persisted desired admission envelope and its latest delivery evidence. */
|
|
1250
|
+
interface LeaderAdmissionDelivery {
|
|
1251
|
+
id: string;
|
|
1252
|
+
targetId: string;
|
|
1253
|
+
environment: string;
|
|
1254
|
+
revision: number;
|
|
1255
|
+
digest: string;
|
|
1256
|
+
envelope: AdmissionGrantEnvelope;
|
|
1257
|
+
status: LeaderAdmissionDeliveryStatus;
|
|
1258
|
+
attempts: number;
|
|
1259
|
+
lastAttemptAt?: number;
|
|
1260
|
+
lastError?: string;
|
|
1261
|
+
acknowledgedAt?: number;
|
|
1262
|
+
updatedAt: number;
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1265
|
+
/** Retry every non-final saved delivery. Hosts may call this from a cron using
|
|
1266
|
+
* the same Worker context; request retries use the packaged admin route. */
|
|
1267
|
+
declare function retryLeaderAdmissionDeliveries(env: ChapterEnv, ctx: WorkerContext, limit?: number): Promise<LeaderAdmissionDelivery[]>;
|
|
1268
|
+
|
|
1216
1269
|
/** Identity shared by initial HTML, response caching, and client hydration. */
|
|
1217
1270
|
interface SignupControlThemeMetadata {
|
|
1218
1271
|
source: "active" | "bootstrap";
|
|
@@ -1283,4 +1336,4 @@ declare function chapterWorker(options: ChapterWorkerOptions): {
|
|
|
1283
1336
|
fetch(req: Request, env: ChapterEnv): Promise<Response>;
|
|
1284
1337
|
};
|
|
1285
1338
|
|
|
1286
|
-
export { type ActiveSignupControlHtml, type ActiveSignupControlThemeOptions, type AdmissionGrantDeliveryOptions, type BuilderLibraryDeliveryOptions, type ChapterEnv, type ChapterWorkerOptions, type MemberContentDeliveryOptions, type Route, type SignupControlDeliveryOptions, type WorkerContext, chapterWorker, createWorkerContext, deliverAdmissionGrants, deliverBuilderLibrary, deliverMemberContent, deliverSignupControl, renderActiveSignupControlHtml, withActiveSignupControlTheme };
|
|
1339
|
+
export { type ActiveSignupControlHtml, type ActiveSignupControlThemeOptions, AdmissionGrantDeliveryError, type AdmissionGrantDeliveryOptions, type BuilderLibraryDeliveryOptions, type ChapterEnv, type ChapterWorkerOptions, type LeaderAdmissionAssignment, type LeaderAdmissionDelivery, type LeaderAdmissionDeliveryStatus, type MemberContentDeliveryOptions, type Route, type SignupControlDeliveryOptions, type WorkerContext, chapterWorker, createWorkerContext, deliverAdmissionGrants, deliverBuilderLibrary, deliverMemberContent, deliverSignupControl, renderActiveSignupControlHtml, retryLeaderAdmissionDeliveries, withActiveSignupControlTheme };
|