@anchrd/intel-contract 0.15.0 → 0.17.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.
@@ -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>;
@@ -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).
@@ -105,6 +105,25 @@ 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
+ idempotencyKey: z.ZodString;
111
+ }, z.core.$strict>;
112
+ export type PurgeNodeInput = z.infer<typeof PurgeNodeInput>;
113
+ export declare const PurgeNodePreviewInput: z.ZodObject<{
114
+ nodeId: z.ZodString;
115
+ }, z.core.$strict>;
116
+ export type PurgeNodePreviewInput = z.infer<typeof PurgeNodePreviewInput>;
117
+ export declare const PurgeNodePreview: z.ZodObject<{
118
+ inboundLinks: z.ZodNumber;
119
+ totalItems: z.ZodNumber;
120
+ }, z.core.$strict>;
121
+ export type PurgeNodePreview = z.infer<typeof PurgeNodePreview>;
122
+ export declare const PurgeNodeResult: z.ZodObject<{
123
+ purged: z.ZodLiteral<true>;
124
+ title: z.ZodString;
125
+ }, z.core.$strict>;
126
+ export type PurgeNodeResult = z.infer<typeof PurgeNodeResult>;
108
127
  export declare const NodeList: z.ZodObject<{
109
128
  items: z.ZodArray<z.ZodObject<{
110
129
  id: z.ZodString;
@@ -181,6 +181,30 @@ 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
+ idempotencyKey: IdempotencyKey,
196
+ });
197
+ export const PurgeNodePreviewInput = z.strictObject({ nodeId: IntelId });
198
+ export const PurgeNodePreview = z.strictObject({
199
+ inboundLinks: z.number().int().nonnegative(),
200
+ totalItems: z.number().int().positive(),
201
+ });
202
+ // The title travels back because after this call nothing can look it up any more — not the row, not
203
+ // a version, not the index. A caller that wants to say what it just deleted has this one chance.
204
+ export const PurgeNodeResult = z.strictObject({
205
+ purged: z.literal(true),
206
+ title: z.string(),
207
+ });
184
208
  // ⚠️ `withChildren` belongs to the LEVEL, not to the node (#59). Whether something has children
185
209
  // THIS reader may see is not a property of the thing — two readers get different answers. As a
186
210
  // field on the node, every other place that returns a node would have to compute it as well or
@@ -136,6 +136,33 @@ export declare const ResourceGrantList: z.ZodObject<{
136
136
  }, z.core.$strict>>;
137
137
  }, z.core.$strict>;
138
138
  export type ResourceGrantList = z.infer<typeof ResourceGrantList>;
139
+ export declare const ResourceAccessList: z.ZodObject<{
140
+ resourceId: z.ZodString;
141
+ ownerIds: z.ZodArray<z.ZodString>;
142
+ items: z.ZodArray<z.ZodObject<{
143
+ id: z.ZodString;
144
+ resourceId: z.ZodString;
145
+ principal: z.ZodDiscriminatedUnion<[z.ZodObject<{
146
+ type: z.ZodLiteral<"user">;
147
+ id: z.ZodString;
148
+ }, z.core.$strict>, z.ZodObject<{
149
+ type: z.ZodLiteral<"email">;
150
+ email: z.ZodEmail;
151
+ }, z.core.$strict>, z.ZodObject<{
152
+ type: z.ZodLiteral<"organization">;
153
+ }, z.core.$strict>], "type">;
154
+ verb: z.ZodEnum<{
155
+ read: "read";
156
+ write: "write";
157
+ execute: "execute";
158
+ share: "share";
159
+ }>;
160
+ expiresAt: z.ZodNullable<z.ZodISODateTime>;
161
+ createdBy: z.ZodString;
162
+ createdAt: z.ZodISODateTime;
163
+ }, z.core.$strict>>;
164
+ }, z.core.$strict>;
165
+ export type ResourceAccessList = z.infer<typeof ResourceAccessList>;
139
166
  export declare const RevokeGrantResult: z.ZodObject<{
140
167
  revoked: z.ZodBoolean;
141
168
  }, z.core.$strict>;
@@ -64,4 +64,11 @@ export const ResourceGrantList = z.strictObject({
64
64
  applicableVerbs: z.array(ResourceVerb).min(1),
65
65
  items: z.array(ResourceGrant),
66
66
  });
67
+ // A display-only, effective view. Unlike ResourceGrantList it crosses ancestor folders and names
68
+ // owners, because ownership grants access without creating a revocable grant row.
69
+ export const ResourceAccessList = z.strictObject({
70
+ resourceId: IntelId,
71
+ ownerIds: z.array(IntelId),
72
+ items: z.array(ResourceGrant),
73
+ });
67
74
  export const RevokeGrantResult = z.strictObject({ revoked: z.boolean() });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anchrd/intel-contract",
3
- "version": "0.15.0",
3
+ "version": "0.17.0",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {