@odla-ai/chapter 0.27.0 → 0.28.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 +22 -0
- package/dist/index.cjs +55 -33
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +55 -33
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -330,6 +330,28 @@ export const chapter = defineChapter({
|
|
|
330
330
|
});
|
|
331
331
|
```
|
|
332
332
|
|
|
333
|
+
The leader may make `chapter` its own durable aggregate while retaining the
|
|
334
|
+
preset's required identity and relations. `chapter.fields` and
|
|
335
|
+
`chapter.facets` merge with the defaults; `chapter.pipeline` replaces the
|
|
336
|
+
generic proposed/forming/active lifecycle. The final configuration is still
|
|
337
|
+
validated by `defineCrm()`:
|
|
338
|
+
|
|
339
|
+
```ts
|
|
340
|
+
crm: leaderCrmConfig({
|
|
341
|
+
base: existingCrmConfig,
|
|
342
|
+
chapter: {
|
|
343
|
+
fields: {
|
|
344
|
+
marketKey: { type: "string", label: "Market key", slot: "s3" },
|
|
345
|
+
signalScore: { type: "number", label: "Signal score", slot: "n1" },
|
|
346
|
+
},
|
|
347
|
+
pipeline: {
|
|
348
|
+
stages: [{ id: "investigation" }, { id: "growth" }],
|
|
349
|
+
transitions: { investigation: ["growth"] },
|
|
350
|
+
},
|
|
351
|
+
},
|
|
352
|
+
}),
|
|
353
|
+
```
|
|
354
|
+
|
|
333
355
|
The preset adds `chapter`, `chapter_application`, and `deal` record types in
|
|
334
356
|
the `portfolio` workspace, with formation, operating, and deal-flow pipelines.
|
|
335
357
|
It also composes relations to base `person` and `company` types when present.
|
package/dist/index.cjs
CHANGED
|
@@ -1246,39 +1246,61 @@ function defineChapter(config) {
|
|
|
1246
1246
|
var import_crm2 = require("@odla-ai/crm");
|
|
1247
1247
|
function leaderCrmConfig(options = {}) {
|
|
1248
1248
|
const base = options.base ?? defaultCrm("hub");
|
|
1249
|
+
const defaultChapter = {
|
|
1250
|
+
label: "Chapter",
|
|
1251
|
+
labelPlural: "Chapters",
|
|
1252
|
+
workspace: "portfolio",
|
|
1253
|
+
nameField: "name",
|
|
1254
|
+
fields: {
|
|
1255
|
+
name: { type: "string", label: "Name", required: true },
|
|
1256
|
+
slug: { type: "string", label: "Slug", slot: "s1" },
|
|
1257
|
+
region: { type: "string", label: "Region", slot: "s2" },
|
|
1258
|
+
url: { type: "url", label: "Website" },
|
|
1259
|
+
thesis: { type: "string", label: "Investment thesis" },
|
|
1260
|
+
launchedAt: { type: "date", label: "Launch date", slot: "d1" },
|
|
1261
|
+
notes: { type: "string", label: "Notes" }
|
|
1262
|
+
},
|
|
1263
|
+
pipeline: {
|
|
1264
|
+
stages: [
|
|
1265
|
+
{ id: "proposed", label: "Proposed" },
|
|
1266
|
+
{ id: "forming", label: "Forming" },
|
|
1267
|
+
{ id: "active", label: "Active" },
|
|
1268
|
+
{ id: "paused", label: "Paused" },
|
|
1269
|
+
{ id: "closed", label: "Closed", terminal: true }
|
|
1270
|
+
],
|
|
1271
|
+
transitions: {
|
|
1272
|
+
proposed: ["forming", "closed"],
|
|
1273
|
+
forming: ["active", "paused", "closed"],
|
|
1274
|
+
active: ["paused", "closed"],
|
|
1275
|
+
paused: ["forming", "active", "closed"]
|
|
1276
|
+
}
|
|
1277
|
+
},
|
|
1278
|
+
facets: { rank: "manual" }
|
|
1279
|
+
};
|
|
1280
|
+
const chapterOverride = options.chapter ?? {};
|
|
1281
|
+
const chapterType = {
|
|
1282
|
+
...defaultChapter,
|
|
1283
|
+
...chapterOverride,
|
|
1284
|
+
fields: {
|
|
1285
|
+
...defaultChapter.fields,
|
|
1286
|
+
...chapterOverride.fields ?? {},
|
|
1287
|
+
// The preset's natural identity is not optional even when the host adds
|
|
1288
|
+
// its own fields or relabels the name input.
|
|
1289
|
+
name: {
|
|
1290
|
+
...defaultChapter.fields.name,
|
|
1291
|
+
...chapterOverride.fields?.name ?? {},
|
|
1292
|
+
type: "string",
|
|
1293
|
+
required: true
|
|
1294
|
+
}
|
|
1295
|
+
},
|
|
1296
|
+
facets: {
|
|
1297
|
+
...defaultChapter.facets,
|
|
1298
|
+
...chapterOverride.facets ?? {}
|
|
1299
|
+
}
|
|
1300
|
+
};
|
|
1249
1301
|
const portfolio = {
|
|
1250
1302
|
types: {
|
|
1251
|
-
chapter:
|
|
1252
|
-
label: "Chapter",
|
|
1253
|
-
labelPlural: "Chapters",
|
|
1254
|
-
workspace: "portfolio",
|
|
1255
|
-
nameField: "name",
|
|
1256
|
-
fields: {
|
|
1257
|
-
name: { type: "string", label: "Name", required: true },
|
|
1258
|
-
slug: { type: "string", label: "Slug", slot: "s1" },
|
|
1259
|
-
region: { type: "string", label: "Region", slot: "s2" },
|
|
1260
|
-
url: { type: "url", label: "Website" },
|
|
1261
|
-
thesis: { type: "string", label: "Investment thesis" },
|
|
1262
|
-
launchedAt: { type: "date", label: "Launch date", slot: "d1" },
|
|
1263
|
-
notes: { type: "string", label: "Notes" }
|
|
1264
|
-
},
|
|
1265
|
-
pipeline: {
|
|
1266
|
-
stages: [
|
|
1267
|
-
{ id: "proposed", label: "Proposed" },
|
|
1268
|
-
{ id: "forming", label: "Forming" },
|
|
1269
|
-
{ id: "active", label: "Active" },
|
|
1270
|
-
{ id: "paused", label: "Paused" },
|
|
1271
|
-
{ id: "closed", label: "Closed", terminal: true }
|
|
1272
|
-
],
|
|
1273
|
-
transitions: {
|
|
1274
|
-
proposed: ["forming", "closed"],
|
|
1275
|
-
forming: ["active", "paused", "closed"],
|
|
1276
|
-
active: ["paused", "closed"],
|
|
1277
|
-
paused: ["forming", "active", "closed"]
|
|
1278
|
-
}
|
|
1279
|
-
},
|
|
1280
|
-
facets: { rank: "manual" }
|
|
1281
|
-
},
|
|
1303
|
+
chapter: chapterType,
|
|
1282
1304
|
chapter_application: {
|
|
1283
1305
|
label: "Chapter application",
|
|
1284
1306
|
labelPlural: "Formation applications",
|
|
@@ -1426,9 +1448,9 @@ function createChapterIntegration(chapter, options = {}) {
|
|
|
1426
1448
|
// The snapshot route is deliberately private. A credential-free smoke
|
|
1427
1449
|
// request must prove that the route is mounted and closed.
|
|
1428
1450
|
{ path: "/api/network/snapshot", expectedStatus: 401 },
|
|
1429
|
-
...chapter.network.readers.length > 0 ? [{ path: "/api/network/records
|
|
1451
|
+
...chapter.network.readers.length > 0 ? [{ path: "/api/network/records", expectedStatus: 401 }] : [],
|
|
1430
1452
|
...chapter.network.readers.some((reader) => reader.sharedNotes.length > 0) ? [{
|
|
1431
|
-
path: "/api/network/shared-notes
|
|
1453
|
+
path: "/api/network/shared-notes",
|
|
1432
1454
|
expectedStatus: 401
|
|
1433
1455
|
}] : [],
|
|
1434
1456
|
// Formation metadata is public only when the host explicitly enables
|