@anchrd/intel-contract 0.26.0 → 0.27.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.
@@ -120,9 +120,31 @@ export declare const PurgeNodePreviewInput: z.ZodObject<{
120
120
  nodeId: z.ZodString;
121
121
  }, z.core.$strict>;
122
122
  export type PurgeNodePreviewInput = z.infer<typeof PurgeNodePreviewInput>;
123
+ /**
124
+ * ⚠️ **A count is not an answer before a deletion that cannot be undone** (D71, #733). `totalItems`
125
+ * alone reads as "82 items" for a folder holding somebody's whole memory, and `destructive.md` asks
126
+ * for the number to be named BEFORE the confirmation — one step more precise is the difference
127
+ * between a number and something a person can decide on.
128
+ *
129
+ * `items` is capped, and the cap is visible rather than silent: `totalItems` keeps counting past it,
130
+ * so a caller can always say "and 40 more". A list of ten thousand rows would be an answer nobody
131
+ * reads and a response nobody can render.
132
+ */
123
133
  export declare const PurgeNodePreview: z.ZodObject<{
124
134
  inboundLinks: z.ZodNumber;
125
135
  totalItems: z.ZodNumber;
136
+ items: z.ZodArray<z.ZodObject<{
137
+ id: z.ZodString;
138
+ kind: z.ZodUnion<readonly [z.ZodEnum<{
139
+ folder: "folder";
140
+ document: "document";
141
+ table: "table";
142
+ attachment: "attachment";
143
+ board: "board";
144
+ task: "task";
145
+ }>, z.ZodLiteral<"flow">]>;
146
+ title: z.ZodString;
147
+ }, z.core.$strict>>;
126
148
  }, z.core.$strict>;
127
149
  export type PurgeNodePreview = z.infer<typeof PurgeNodePreview>;
128
150
  export declare const PurgeNodeResult: z.ZodObject<{
@@ -187,9 +187,27 @@ export const PurgeNodeInput = z.strictObject({
187
187
  export const PurgeNodePreviewInput = z.strictObject({
188
188
  nodeId: IntelId.describe("Archived node a purge would delete. Answers how many items would go with it and how many documents link to it from outside, and changes nothing. A node that is not archived is refused here for the same reason node_purge refuses it."),
189
189
  });
190
+ /**
191
+ * ⚠️ **A count is not an answer before a deletion that cannot be undone** (D71, #733). `totalItems`
192
+ * alone reads as "82 items" for a folder holding somebody's whole memory, and `destructive.md` asks
193
+ * for the number to be named BEFORE the confirmation — one step more precise is the difference
194
+ * between a number and something a person can decide on.
195
+ *
196
+ * `items` is capped, and the cap is visible rather than silent: `totalItems` keeps counting past it,
197
+ * so a caller can always say "and 40 more". A list of ten thousand rows would be an answer nobody
198
+ * reads and a response nobody can render.
199
+ */
190
200
  export const PurgeNodePreview = z.strictObject({
191
201
  inboundLinks: z.number().int().nonnegative(),
192
202
  totalItems: z.number().int().positive(),
203
+ // ⚠️ `flow` beside the node kinds, because a flow filed in the folder goes with it and is counted
204
+ // in `totalItems`. Naming everything except flows would leave out the one thing the cascade had to
205
+ // be widened for (#733).
206
+ items: z.array(z.strictObject({
207
+ id: IntelId,
208
+ kind: z.union([NodeKind, z.literal("flow")]),
209
+ title: z.string(),
210
+ })),
193
211
  });
194
212
  // The title travels back because after this call nothing can look it up any more — not the row, not
195
213
  // a version, not the index. A caller that wants to say what it just deleted has this one chance.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anchrd/intel-contract",
3
- "version": "0.26.0",
3
+ "version": "0.27.0",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {