@anchrd/intel-contract 0.15.0 → 0.16.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/dist/contract/flow.d.ts +9 -0
- package/dist/contract/flow.js +10 -0
- package/dist/contract/node.d.ts +9 -0
- package/dist/contract/node.js +18 -0
- package/package.json +1 -1
package/dist/contract/flow.d.ts
CHANGED
|
@@ -709,6 +709,15 @@ export declare const ArchiveFlowInput: z.ZodObject<{
|
|
|
709
709
|
idempotencyKey: z.ZodString;
|
|
710
710
|
}, z.core.$strict>;
|
|
711
711
|
export type ArchiveFlowInput = z.infer<typeof ArchiveFlowInput>;
|
|
712
|
+
export declare const PurgeFlowInput: z.ZodObject<{
|
|
713
|
+
flowId: z.ZodString;
|
|
714
|
+
}, z.core.$strict>;
|
|
715
|
+
export type PurgeFlowInput = z.infer<typeof PurgeFlowInput>;
|
|
716
|
+
export declare const PurgeFlowResult: z.ZodObject<{
|
|
717
|
+
purged: z.ZodLiteral<true>;
|
|
718
|
+
title: z.ZodString;
|
|
719
|
+
}, z.core.$strict>;
|
|
720
|
+
export type PurgeFlowResult = z.infer<typeof PurgeFlowResult>;
|
|
712
721
|
export declare const ListFlowsInput: z.ZodObject<{
|
|
713
722
|
parentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
714
723
|
includeArchived: z.ZodOptional<z.ZodBoolean>;
|
package/dist/contract/flow.js
CHANGED
|
@@ -292,6 +292,16 @@ export const ArchiveFlowInput = z.strictObject({
|
|
|
292
292
|
.describe("`true` archives the flow, `false` restores it. Nothing is deleted and every version stays readable."),
|
|
293
293
|
idempotencyKey: IdempotencyKey,
|
|
294
294
|
});
|
|
295
|
+
// ⚠️ The flow half of the one irreversible act in Intel (#457). No `baseUpdatedAt`, no
|
|
296
|
+
// `idempotencyKey`, for the same two reasons the node's has neither: an archived flow is not being
|
|
297
|
+
// edited, and a replay has nothing to replay — deleting twice deletes once and then answers 404.
|
|
298
|
+
export const PurgeFlowInput = z.strictObject({
|
|
299
|
+
flowId: IntelId.describe("Flow to delete for good. It must already be archived — a living flow has no path into nothing."),
|
|
300
|
+
});
|
|
301
|
+
export const PurgeFlowResult = z.strictObject({
|
|
302
|
+
purged: z.literal(true),
|
|
303
|
+
title: z.string(),
|
|
304
|
+
});
|
|
295
305
|
// Three answers, not two: an absent `parentId` lists every visible flow (the search dialog asks
|
|
296
306
|
// that), `null` lists the root of the shared tree and an ID lists one folder (the sidebar tree asks
|
|
297
307
|
// per level, which is what keeps the tree off the N+1 it used to load with).
|
package/dist/contract/node.d.ts
CHANGED
|
@@ -105,6 +105,15 @@ export declare const ArchiveNodeInput: z.ZodObject<{
|
|
|
105
105
|
idempotencyKey: z.ZodString;
|
|
106
106
|
}, z.core.$strict>;
|
|
107
107
|
export type ArchiveNodeInput = z.infer<typeof ArchiveNodeInput>;
|
|
108
|
+
export declare const PurgeNodeInput: z.ZodObject<{
|
|
109
|
+
nodeId: z.ZodString;
|
|
110
|
+
}, z.core.$strict>;
|
|
111
|
+
export type PurgeNodeInput = z.infer<typeof PurgeNodeInput>;
|
|
112
|
+
export declare const PurgeNodeResult: z.ZodObject<{
|
|
113
|
+
purged: z.ZodLiteral<true>;
|
|
114
|
+
title: z.ZodString;
|
|
115
|
+
}, z.core.$strict>;
|
|
116
|
+
export type PurgeNodeResult = z.infer<typeof PurgeNodeResult>;
|
|
108
117
|
export declare const NodeList: z.ZodObject<{
|
|
109
118
|
items: z.ZodArray<z.ZodObject<{
|
|
110
119
|
id: z.ZodString;
|
package/dist/contract/node.js
CHANGED
|
@@ -181,6 +181,24 @@ export const ArchiveNodeInput = z.strictObject({
|
|
|
181
181
|
.describe("`true` archives the node, `false` restores it. Archiving hides a node from listings and search; nothing is deleted and every version stays readable."),
|
|
182
182
|
idempotencyKey: IdempotencyKey,
|
|
183
183
|
});
|
|
184
|
+
// ⚠️ The one input in this contract that describes an IRREVERSIBLE act (#457). Everything else
|
|
185
|
+
// called "delete" in Intel means `archived_at`.
|
|
186
|
+
//
|
|
187
|
+
// It carries no `baseUpdatedAt` and no `idempotencyKey`, and both absences are decisions:
|
|
188
|
+
// · There is nothing to conflict with. The node must already be archived — an archived node is
|
|
189
|
+
// not being edited by anybody, and a restore between the read and the call is caught by the
|
|
190
|
+
// statement itself rather than by a timestamp the caller had to carry.
|
|
191
|
+
// · A replay has nothing to replay. Deleting twice is deleting once and then a 404, which is the
|
|
192
|
+
// honest answer: the second caller really did not delete anything.
|
|
193
|
+
export const PurgeNodeInput = z.strictObject({
|
|
194
|
+
nodeId: IntelId.describe("Node to delete for good. It must already be archived — a living node has no path into nothing."),
|
|
195
|
+
});
|
|
196
|
+
// The title travels back because after this call nothing can look it up any more — not the row, not
|
|
197
|
+
// a version, not the index. A caller that wants to say what it just deleted has this one chance.
|
|
198
|
+
export const PurgeNodeResult = z.strictObject({
|
|
199
|
+
purged: z.literal(true),
|
|
200
|
+
title: z.string(),
|
|
201
|
+
});
|
|
184
202
|
// ⚠️ `withChildren` belongs to the LEVEL, not to the node (#59). Whether something has children
|
|
185
203
|
// THIS reader may see is not a property of the thing — two readers get different answers. As a
|
|
186
204
|
// field on the node, every other place that returns a node would have to compute it as well or
|