@substrat-run/contract-tests 0.144.0 → 0.146.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.
Files changed (61) hide show
  1. package/dist/async-log-suite.d.ts.map +1 -1
  2. package/dist/async-log-suite.js +5 -0
  3. package/dist/async-log-suite.js.map +1 -1
  4. package/dist/bind-module.d.ts +22 -1
  5. package/dist/bind-module.d.ts.map +1 -1
  6. package/dist/bind-module.js +32 -1
  7. package/dist/bind-module.js.map +1 -1
  8. package/dist/binding-invite-suite.d.ts.map +1 -1
  9. package/dist/binding-invite-suite.js +53 -0
  10. package/dist/binding-invite-suite.js.map +1 -1
  11. package/dist/derived-module.d.ts +72 -1
  12. package/dist/derived-module.d.ts.map +1 -1
  13. package/dist/derived-module.js +31 -3
  14. package/dist/derived-module.js.map +1 -1
  15. package/dist/derived-suite.d.ts.map +1 -1
  16. package/dist/derived-suite.js +91 -0
  17. package/dist/derived-suite.js.map +1 -1
  18. package/dist/entity-state-module.d.ts +16 -0
  19. package/dist/entity-state-module.d.ts.map +1 -1
  20. package/dist/entity-trash-module.d.ts +80 -0
  21. package/dist/entity-trash-module.d.ts.map +1 -1
  22. package/dist/entity-trash-module.js +73 -0
  23. package/dist/entity-trash-module.js.map +1 -1
  24. package/dist/entity-trash-suite.d.ts.map +1 -1
  25. package/dist/entity-trash-suite.js +94 -2
  26. package/dist/entity-trash-suite.js.map +1 -1
  27. package/dist/erasure-module.d.ts +8 -0
  28. package/dist/erasure-module.d.ts.map +1 -1
  29. package/dist/findings-suite.d.ts.map +1 -1
  30. package/dist/findings-suite.js +55 -1
  31. package/dist/findings-suite.js.map +1 -1
  32. package/dist/index.d.ts +2 -1
  33. package/dist/index.d.ts.map +1 -1
  34. package/dist/index.js +2 -1
  35. package/dist/index.js.map +1 -1
  36. package/dist/module-log-suite.d.ts.map +1 -1
  37. package/dist/module-log-suite.js +12 -0
  38. package/dist/module-log-suite.js.map +1 -1
  39. package/dist/modules.d.ts +253 -1
  40. package/dist/modules.d.ts.map +1 -1
  41. package/dist/modules.js +17 -5
  42. package/dist/modules.js.map +1 -1
  43. package/dist/peer-suite.d.ts.map +1 -1
  44. package/dist/peer-suite.js +75 -1
  45. package/dist/peer-suite.js.map +1 -1
  46. package/dist/scope-host-suite.d.ts.map +1 -1
  47. package/dist/scope-host-suite.js +501 -0
  48. package/dist/scope-host-suite.js.map +1 -1
  49. package/dist/stamps-module.d.ts +462 -0
  50. package/dist/stamps-module.d.ts.map +1 -0
  51. package/dist/stamps-module.js +242 -0
  52. package/dist/stamps-module.js.map +1 -0
  53. package/dist/stamps-suite.d.ts +3 -0
  54. package/dist/stamps-suite.d.ts.map +1 -0
  55. package/dist/stamps-suite.js +170 -0
  56. package/dist/stamps-suite.js.map +1 -0
  57. package/dist/vertical-events-suite.d.ts +16 -0
  58. package/dist/vertical-events-suite.d.ts.map +1 -1
  59. package/dist/vertical-events-suite.js +30 -3
  60. package/dist/vertical-events-suite.js.map +1 -1
  61. package/package.json +3 -3
@@ -0,0 +1,462 @@
1
+ /**
2
+ * The fixture behind `updatedStampsContractSuite` (#2166): an entity that declares all four stamps,
3
+ * written by derived and authored handlers alike, and one that declares only `createdAt`.
4
+ *
5
+ * - `sdoc` — every stamp, and archivable: a derived create, get, update and archive, plus authored
6
+ * writes that stamp the updated pair right or wrong on purpose (`stamp`), an authored delete, a
7
+ * write inside a `ctx.atomic` that is rolled back, and a consumer that writes the row.
8
+ * - `splain` — the created stamp only: an authored write that stamps nothing is never checked.
9
+ *
10
+ * Inert for every other suite: nothing else invokes a `stamps/*` operation or reads its tables.
11
+ */
12
+ import { z } from 'zod';
13
+ import { type ModuleRegistration } from '@substrat-run/kernel';
14
+ export declare const STAMPS_MODULE_ID = "@test/stamps";
15
+ /** A time no call is ever made at. */
16
+ export declare const STALE_TIME = "2000-01-01T00:00:00.000Z";
17
+ export declare const stampsEntities: {
18
+ readonly sdoc: {
19
+ readonly table: "stamped_docs";
20
+ readonly fields: z.ZodObject<{
21
+ id: z.ZodString;
22
+ title: z.ZodString;
23
+ created_at: z.ZodString;
24
+ created_by: z.ZodString;
25
+ updated_at: z.ZodString;
26
+ updated_by: z.ZodString;
27
+ }, z.core.$strip>;
28
+ readonly archive: {
29
+ readonly permission: "sdoc:archive";
30
+ };
31
+ readonly stamps: {
32
+ readonly created_at: "createdAt";
33
+ readonly created_by: "createdBy";
34
+ readonly updated_at: "updatedAt";
35
+ readonly updated_by: "updatedBy";
36
+ };
37
+ };
38
+ readonly splain: {
39
+ readonly table: "stamped_plain";
40
+ readonly fields: z.ZodObject<{
41
+ id: z.ZodString;
42
+ title: z.ZodString;
43
+ created_at: z.ZodString;
44
+ }, z.core.$strip>;
45
+ readonly stamps: {
46
+ readonly created_at: "createdAt";
47
+ };
48
+ };
49
+ };
50
+ /** How an authored write stamps the updated pair: right, or wrong in one particular way. */
51
+ export declare const STAMP_MODES: readonly ['both', 'skip-at', 'skip-by', 'constant', 'other'];
52
+ export type StampMode = (typeof STAMP_MODES)[number];
53
+ export declare const stampsOperations: {
54
+ readonly 'stamps/create-doc': {
55
+ readonly summary: "Add a doc, every stamp written by the platform";
56
+ readonly derive: "create";
57
+ readonly permission: "sdoc:write";
58
+ readonly input: z.ZodObject<{
59
+ title: z.ZodString;
60
+ }, z.core.$strip>;
61
+ readonly output: z.ZodObject<{
62
+ id: z.ZodString;
63
+ title: z.ZodString;
64
+ created_at: z.ZodString;
65
+ created_by: z.ZodString;
66
+ updated_at: z.ZodString;
67
+ updated_by: z.ZodString;
68
+ }, z.core.$strip>;
69
+ readonly http: {
70
+ readonly method: "POST";
71
+ readonly path: "/docs";
72
+ };
73
+ readonly emits: {
74
+ readonly entity: "sdoc";
75
+ readonly entityIdFrom: "id";
76
+ readonly type: "sdoc.created";
77
+ readonly schemaVersion: 1;
78
+ readonly piiClass: "none";
79
+ readonly payload: readonly ["id", "title"];
80
+ };
81
+ };
82
+ readonly 'stamps/get-doc': {
83
+ readonly summary: "One doc";
84
+ readonly derive: "get";
85
+ readonly permission: {
86
+ readonly key: "sdoc:archive" | "sdoc:read" | "sdoc:write";
87
+ readonly entity: 'sdoc';
88
+ readonly idFrom: 'docId';
89
+ };
90
+ readonly input: z.ZodObject<{
91
+ docId: z.ZodString;
92
+ }, z.core.$strip>;
93
+ readonly output: z.ZodObject<{
94
+ id: z.ZodString;
95
+ title: z.ZodString;
96
+ created_at: z.ZodString;
97
+ created_by: z.ZodString;
98
+ updated_at: z.ZodString;
99
+ updated_by: z.ZodString;
100
+ }, z.core.$strip>;
101
+ readonly http: {
102
+ readonly method: "GET";
103
+ readonly path: "/docs/{docId}";
104
+ };
105
+ };
106
+ readonly 'stamps/update-doc': {
107
+ readonly summary: "Change a doc's title";
108
+ readonly derive: "update";
109
+ readonly permission: {
110
+ readonly key: "sdoc:archive" | "sdoc:read" | "sdoc:write";
111
+ readonly entity: 'sdoc';
112
+ readonly idFrom: 'docId';
113
+ };
114
+ readonly input: z.ZodObject<{
115
+ docId: z.ZodString;
116
+ title: z.ZodOptional<z.ZodString>;
117
+ }, z.core.$strip>;
118
+ readonly output: z.ZodObject<{
119
+ id: z.ZodString;
120
+ title: z.ZodString;
121
+ created_at: z.ZodString;
122
+ created_by: z.ZodString;
123
+ updated_at: z.ZodString;
124
+ updated_by: z.ZodString;
125
+ }, z.core.$strip>;
126
+ readonly http: {
127
+ readonly method: "PATCH";
128
+ readonly path: "/docs/{docId}";
129
+ };
130
+ readonly concurrency: {
131
+ readonly over: "sdoc";
132
+ readonly idFrom: "docId";
133
+ };
134
+ readonly emits: {
135
+ readonly entity: "sdoc";
136
+ readonly entityIdFrom: "id";
137
+ readonly type: "sdoc.updated";
138
+ readonly schemaVersion: 1;
139
+ readonly piiClass: "none";
140
+ readonly payload: readonly ["id", "title"];
141
+ };
142
+ };
143
+ readonly 'stamps/archive-doc': {
144
+ readonly summary: "File a doc away — a kernel move";
145
+ readonly derive: "archive";
146
+ readonly permission: {
147
+ readonly key: "sdoc:archive" | "sdoc:read" | "sdoc:write";
148
+ readonly entity: 'sdoc';
149
+ readonly idFrom: 'docId';
150
+ };
151
+ readonly input: z.ZodObject<{
152
+ docId: z.ZodString;
153
+ }, z.core.$strip>;
154
+ readonly output: z.ZodObject<{
155
+ id: z.ZodString;
156
+ state: z.ZodEnum<{
157
+ active: "active";
158
+ archived: "archived";
159
+ trashed: "trashed";
160
+ }>;
161
+ }, z.core.$strip>;
162
+ readonly http: {
163
+ readonly method: "POST";
164
+ readonly path: "/docs/{docId}/archive";
165
+ };
166
+ };
167
+ readonly 'stamps/add-doc': {
168
+ readonly summary: "Add a doc by hand, with or without the updated pair";
169
+ readonly permission: "sdoc:write";
170
+ readonly input: z.ZodObject<{
171
+ id: z.ZodString;
172
+ title: z.ZodString;
173
+ stampUpdated: z.ZodBoolean;
174
+ }, z.core.$strip>;
175
+ readonly output: z.ZodObject<{
176
+ id: z.ZodString;
177
+ }, z.core.$strip>;
178
+ readonly emits: {
179
+ readonly entity: "sdoc";
180
+ readonly entityIdFrom: "id";
181
+ readonly type: "sdoc.added";
182
+ readonly schemaVersion: 1;
183
+ readonly piiClass: "none";
184
+ readonly payload: readonly ["id"];
185
+ };
186
+ };
187
+ readonly 'stamps/touch-doc': {
188
+ readonly summary: "Change a doc's title by hand, stamping as told";
189
+ readonly permission: "sdoc:write";
190
+ readonly input: z.ZodObject<{
191
+ id: z.ZodString;
192
+ title: z.ZodString;
193
+ stamp: z.ZodEnum<{
194
+ both: "both";
195
+ constant: "constant";
196
+ other: "other";
197
+ "skip-at": "skip-at";
198
+ "skip-by": "skip-by";
199
+ }>;
200
+ }, z.core.$strip>;
201
+ readonly output: z.ZodObject<{
202
+ id: z.ZodString;
203
+ }, z.core.$strip>;
204
+ readonly emits: {
205
+ readonly entity: 'sdoc';
206
+ readonly entityIdFrom: 'id';
207
+ readonly type: 'sdoc.touched';
208
+ readonly schemaVersion: 1;
209
+ readonly piiClass: 'none';
210
+ readonly payload: readonly ['id'];
211
+ };
212
+ };
213
+ readonly 'stamps/atomic-touch': {
214
+ readonly summary: "Write a doc without its stamps inside a ctx.atomic that is rolled back";
215
+ readonly permission: "sdoc:write";
216
+ readonly input: z.ZodObject<{
217
+ id: z.ZodString;
218
+ title: z.ZodString;
219
+ }, z.core.$strip>;
220
+ readonly output: z.ZodObject<{
221
+ id: z.ZodString;
222
+ }, z.core.$strip>;
223
+ readonly emits: {
224
+ readonly entity: 'sdoc';
225
+ readonly entityIdFrom: 'id';
226
+ readonly type: 'sdoc.touched';
227
+ readonly schemaVersion: 1;
228
+ readonly piiClass: 'none';
229
+ readonly payload: readonly ['id'];
230
+ };
231
+ };
232
+ readonly 'stamps/remove-doc': {
233
+ readonly summary: "Delete a doc by hand";
234
+ readonly permission: "sdoc:write";
235
+ readonly input: z.ZodObject<{
236
+ id: z.ZodString;
237
+ }, z.core.$strip>;
238
+ readonly output: z.ZodObject<{
239
+ id: z.ZodString;
240
+ }, z.core.$strip>;
241
+ readonly emits: {
242
+ readonly entity: "sdoc";
243
+ readonly entityIdFrom: "id";
244
+ readonly type: "sdoc.removed";
245
+ readonly schemaVersion: 1;
246
+ readonly piiClass: "none";
247
+ readonly payload: readonly ["id"];
248
+ };
249
+ };
250
+ readonly 'stamps/poke': {
251
+ readonly summary: "Ask the consumer to write a doc, stamping as told — the event is about the plain row";
252
+ readonly permission: "sdoc:write";
253
+ readonly input: z.ZodObject<{
254
+ id: z.ZodString;
255
+ stamp: z.ZodEnum<{
256
+ both: "both";
257
+ constant: "constant";
258
+ other: "other";
259
+ "skip-at": "skip-at";
260
+ "skip-by": "skip-by";
261
+ }>;
262
+ }, z.core.$strip>;
263
+ readonly output: z.ZodObject<{
264
+ id: z.ZodString;
265
+ }, z.core.$strip>;
266
+ readonly emits: {
267
+ readonly entity: "splain";
268
+ readonly entityIdFrom: "id";
269
+ readonly type: "sdoc.poked";
270
+ readonly schemaVersion: 1;
271
+ readonly piiClass: "none";
272
+ readonly payload: readonly ["id"];
273
+ };
274
+ };
275
+ readonly 'stamps/history': {
276
+ readonly summary: "How many events name a doc — what a rolled-back write must leave unchanged";
277
+ readonly permission: "sdoc:read";
278
+ readonly input: z.ZodObject<{
279
+ id: z.ZodString;
280
+ }, z.core.$strip>;
281
+ readonly output: z.ZodObject<{
282
+ events: z.ZodNumber;
283
+ }, z.core.$strip>;
284
+ };
285
+ readonly 'stamps/touch-plain': {
286
+ readonly summary: "Write a plain row, which declares no updated stamp";
287
+ readonly permission: "sdoc:write";
288
+ readonly input: z.ZodObject<{
289
+ id: z.ZodString;
290
+ title: z.ZodString;
291
+ }, z.core.$strip>;
292
+ readonly output: z.ZodObject<{
293
+ id: z.ZodString;
294
+ }, z.core.$strip>;
295
+ readonly emits: {
296
+ readonly entity: "splain";
297
+ readonly entityIdFrom: "id";
298
+ readonly type: "splain.touched";
299
+ readonly schemaVersion: 1;
300
+ readonly piiClass: "none";
301
+ readonly payload: readonly ["id"];
302
+ };
303
+ };
304
+ };
305
+ export declare const stampsManifest: {
306
+ id: string & z.$brand<"ModuleId">;
307
+ version: string;
308
+ kernelContract: string;
309
+ permissions: {
310
+ key: string & z.$brand<"PermissionKey">;
311
+ description: string;
312
+ }[];
313
+ events: {
314
+ emits: {
315
+ type: string;
316
+ schemaVersion: number;
317
+ }[];
318
+ consumes: {
319
+ type: string;
320
+ schemaVersion: number;
321
+ from?: string | undefined;
322
+ }[];
323
+ exports?: {
324
+ type: string;
325
+ schemaVersion: number;
326
+ readPermission: string & z.$brand<"PermissionKey">;
327
+ }[] | undefined;
328
+ };
329
+ migrations: {
330
+ journalDir: string;
331
+ compatibleFrom: string;
332
+ };
333
+ attachmentTargets: {
334
+ entityType: string;
335
+ readPermission: string & z.$brand<"PermissionKey">;
336
+ writePermission?: (string & z.$brand<"PermissionKey">) | undefined;
337
+ }[];
338
+ liveTargets?: {
339
+ entityType: string;
340
+ readPermission: string & z.$brand<"PermissionKey">;
341
+ }[] | undefined;
342
+ entityRelations?: {
343
+ entityType: string;
344
+ parentType: string;
345
+ }[] | undefined;
346
+ guards?: {
347
+ before: string;
348
+ predicate: string;
349
+ config: Record<string, unknown>;
350
+ }[] | undefined;
351
+ schedules?: {
352
+ operation: string;
353
+ cadence: {
354
+ everyMinutes: number;
355
+ };
356
+ input?: Record<string, unknown> | undefined;
357
+ permissions: (string & z.$brand<"PermissionKey">)[];
358
+ purge?: {
359
+ entityType: string;
360
+ } | undefined;
361
+ }[] | undefined;
362
+ peers?: {
363
+ vertical: string;
364
+ operations: string[];
365
+ permissions: (string & z.$brand<"PermissionKey">)[];
366
+ }[] | undefined;
367
+ freshness?: {
368
+ eventType: string;
369
+ within: {
370
+ hours: number;
371
+ };
372
+ }[] | undefined;
373
+ withdraws?: string[] | undefined;
374
+ entitlementKey: string;
375
+ envSpec?: {
376
+ key: string;
377
+ label?: string | undefined;
378
+ description: string;
379
+ placeholder?: string | undefined;
380
+ required: boolean;
381
+ secret: boolean;
382
+ default?: string | undefined;
383
+ group?: string | undefined;
384
+ }[] | undefined;
385
+ ownerGrants?: (string & z.$brand<"PermissionKey">)[] | undefined;
386
+ entitlements?: string[] | undefined;
387
+ provides?: string[] | undefined;
388
+ requires?: string[] | undefined;
389
+ api?: string | undefined;
390
+ searchables?: {
391
+ entityType: string;
392
+ fields: string[];
393
+ table?: string | undefined;
394
+ idColumn?: string | undefined;
395
+ tokenizer?: "prefix" | "substring" | undefined;
396
+ }[] | undefined;
397
+ lists?: {
398
+ entityType: string;
399
+ sortable: string[];
400
+ filterable?: string[] | undefined;
401
+ table?: string | undefined;
402
+ idColumn?: string | undefined;
403
+ }[] | undefined;
404
+ entityStates?: {
405
+ archivePermission?: (string & z.$brand<"PermissionKey">) | undefined;
406
+ trashPermission?: (string & z.$brand<"PermissionKey">) | undefined;
407
+ purgeAfterDays?: number | undefined;
408
+ purgeEarly?: boolean | undefined;
409
+ table?: string | undefined;
410
+ idColumn?: string | undefined;
411
+ entityType: string;
412
+ }[] | undefined;
413
+ erasure?: {
414
+ tables: string[];
415
+ entities: {
416
+ entityType: string;
417
+ table: string;
418
+ mode: "blank" | "custom" | "delete" | "unreached";
419
+ subjects?: string[] | undefined;
420
+ fields: {
421
+ name: string;
422
+ blank: "" | null;
423
+ }[];
424
+ }[];
425
+ } | undefined;
426
+ updatedStamps?: {
427
+ table: string;
428
+ idColumn: string;
429
+ at?: string | undefined;
430
+ by?: string | undefined;
431
+ entityType: string;
432
+ }[] | undefined;
433
+ ui?: {
434
+ routes?: {
435
+ path: string;
436
+ screen: string;
437
+ permission: string & z.$brand<"PermissionKey">;
438
+ }[] | undefined;
439
+ nav?: {
440
+ label: string;
441
+ icon?: string | undefined;
442
+ to: string;
443
+ permission: string & z.$brand<"PermissionKey">;
444
+ }[] | undefined;
445
+ entityViews?: {
446
+ entityType: string;
447
+ view: string;
448
+ }[] | undefined;
449
+ widgets?: {
450
+ slot: string;
451
+ component: string;
452
+ permission: string & z.$brand<"PermissionKey">;
453
+ }[] | undefined;
454
+ settingsPanels?: {
455
+ label: string;
456
+ component: string;
457
+ permission: string & z.$brand<"PermissionKey">;
458
+ }[] | undefined;
459
+ } | undefined;
460
+ };
461
+ export declare const stampsMod: ModuleRegistration;
462
+ //# sourceMappingURL=stamps-module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stamps-module.d.ts","sourceRoot":"","sources":["../src/stamps-module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,OAAO,EAA6C,KAAK,kBAAkB,EAAyB,MAAM,sBAAsB,CAAC;AAEjI,eAAO,MAAM,gBAAgB,iBAAiB,CAAC;AAE/C,sCAAsC;AACtC,eAAO,MAAM,UAAU,6BAA6B,CAAC;AAErD,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmBzB,CAAC;AAEH,4FAA4F;AAC5F,eAAO,MAAM,WAAW,YAAI,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,CAAU,CAAC;AACxF,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAOrD,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAJsC,MAAM;6BAAU,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAEhE,MAAM;mCAAgB,IAAI;2BAAQ,cAAc;oCAAiB,CAAC;+BAAY,MAAM;wCAAY,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsF5H,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWzB,CAAC;AA8BH,eAAO,MAAM,SAAS,EAAE,kBAgFvB,CAAC"}