@anchrd/intel-contract 0.3.0 → 0.4.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.
@@ -146,6 +146,7 @@ export declare const KnowledgeNodeList: z.ZodObject<{
146
146
  updatedAt: z.ZodISODateTime;
147
147
  archivedAt: z.ZodNullable<z.ZodISODateTime>;
148
148
  }, z.core.$strict>>;
149
+ withChildren: z.ZodDefault<z.ZodArray<z.ZodString>>;
149
150
  }, z.core.$strict>;
150
151
  export type KnowledgeNodeList = z.infer<typeof KnowledgeNodeList>;
151
152
  export declare const KnowledgeVersionList: z.ZodObject<{
@@ -1274,6 +1275,7 @@ export declare const FlowList: z.ZodObject<{
1274
1275
  updatedAt: z.ZodISODateTime;
1275
1276
  archivedAt: z.ZodNullable<z.ZodISODateTime>;
1276
1277
  }, z.core.$strict>>;
1278
+ withCalls: z.ZodDefault<z.ZodArray<z.ZodString>>;
1277
1279
  }, z.core.$strict>;
1278
1280
  export type FlowList = z.infer<typeof FlowList>;
1279
1281
  export declare const FlowKnowledgeReference: z.ZodObject<{
@@ -1318,8 +1320,16 @@ export declare const UpdateFlowInput: z.ZodObject<{
1318
1320
  idempotencyKey: z.ZodString;
1319
1321
  }, z.core.$strict>;
1320
1322
  export type UpdateFlowInput = z.infer<typeof UpdateFlowInput>;
1323
+ export declare const ArchiveFlowInput: z.ZodObject<{
1324
+ flowId: z.ZodString;
1325
+ baseUpdatedAt: z.ZodISODateTime;
1326
+ archived: z.ZodBoolean;
1327
+ idempotencyKey: z.ZodString;
1328
+ }, z.core.$strict>;
1329
+ export type ArchiveFlowInput = z.infer<typeof ArchiveFlowInput>;
1321
1330
  export declare const ListFlowsInput: z.ZodObject<{
1322
1331
  parentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1332
+ includeArchived: z.ZodOptional<z.ZodBoolean>;
1323
1333
  }, z.core.$strict>;
1324
1334
  export type ListFlowsInput = z.infer<typeof ListFlowsInput>;
1325
1335
  export declare const GetFlowInput: z.ZodObject<{
@@ -100,7 +100,14 @@ export const ArchiveKnowledgeNodeInput = z.strictObject({
100
100
  archived: z.boolean(),
101
101
  idempotencyKey: z.string().min(8).max(200),
102
102
  });
103
- export const KnowledgeNodeList = z.strictObject({ items: z.array(KnowledgeNode) });
103
+ // ⚠️ `withChildren` gehört zur EBENE, nicht zum Knoten (#59). Ob etwas Kinder hat, die DIESER
104
+ // Leser sehen darf, ist keine Eigenschaft der Sache — zwei Leser bekommen verschiedene Antworten.
105
+ // Als Feld am Knoten müsste jede andere Stelle, die einen Knoten zurückgibt, es mitberechnen oder
106
+ // lügen; als Liste neben den Einträgen kostet es nur die eine Antwort, die es braucht.
107
+ export const KnowledgeNodeList = z.strictObject({
108
+ items: z.array(KnowledgeNode),
109
+ withChildren: z.array(IntelId).default([]),
110
+ });
104
111
  export const KnowledgeVersionList = z.strictObject({ items: z.array(KnowledgeVersion) });
105
112
  export const KnowledgeDocument = z.strictObject({
106
113
  node: KnowledgeNode,
@@ -536,7 +543,13 @@ export const FlowDocument = z.strictObject({
536
543
  flow: Flow,
537
544
  version: FlowVersion.nullable(),
538
545
  });
539
- export const FlowList = z.strictObject({ items: z.array(Flow) });
546
+ // Dasselbe für Flows: welche von ihnen einen anderen Flow rufen, den dieser Leser auch sehen darf
547
+ // (#59). Ein Aufklapp-Pfeil an einem Flow, dessen Aufrufe alle verborgen sind, verspricht Inhalt,
548
+ // den das Aufklappen nicht liefern kann.
549
+ export const FlowList = z.strictObject({
550
+ items: z.array(Flow),
551
+ withCalls: z.array(IntelId).default([]),
552
+ });
540
553
  export const FlowKnowledgeReference = z.strictObject({
541
554
  id: IntelId,
542
555
  title: z.string().min(1).max(240),
@@ -591,11 +604,29 @@ export const UpdateFlowInput = z
591
604
  idempotencyKey: z.string().min(8).max(200),
592
605
  })
593
606
  .refine((input) => input.title !== undefined || input.description !== undefined || input.parentId !== undefined, { error: "At least one change is required" });
607
+ // Archiving a flow is the same shape as archiving a document, deliberately: `archived` is a boolean
608
+ // rather than a one-way verb, because an archive nothing returns from is a delete under a friendlier
609
+ // name. Restoring is the same call with `false`.
610
+ export const ArchiveFlowInput = z.strictObject({
611
+ flowId: IntelId,
612
+ baseUpdatedAt: IsoDateTime,
613
+ archived: z.boolean(),
614
+ idempotencyKey: z.string().min(8).max(200),
615
+ });
594
616
  // Three answers, not two: an absent `parentId` lists every visible flow (the search dialog asks
595
617
  // that), `null` lists the root of the shared tree and an ID lists one folder (the sidebar tree asks
596
618
  // per level, which is what keeps the tree off the N+1 it used to load with).
597
619
  export const ListFlowsInput = z.strictObject({
598
620
  parentId: IntelId.nullable().optional(),
621
+ // The only way back to an archived flow, and the only place that asks for one: the bounded read
622
+ // behind the relation graph has no such flag on purpose (#30). A drawing that includes what was
623
+ // archived says the tidying up never happened.
624
+ //
625
+ // ⚠️ `.optional()` rather than `.default(false)`, unlike `ListKnowledgeNodesInput`. This schema is
626
+ // the argument type of `listFlows` on three layers, and a default makes the field required in the
627
+ // *parsed* type — every existing caller that lists a folder would have to spell out the answer to
628
+ // a question it is not asking. Absent means "without the archive" everywhere it is read.
629
+ includeArchived: z.boolean().optional(),
599
630
  });
600
631
  export const GetFlowInput = z.strictObject({ flowId: IntelId });
601
632
  export const SaveFlowVersionInput = z.strictObject({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anchrd/intel-contract",
3
- "version": "0.3.0",
3
+ "version": "0.4.1",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {