@substrat-run/contract-tests 0.118.0 → 0.119.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.
@@ -0,0 +1,282 @@
1
+ import { z } from '@substrat-run/contracts';
2
+ import { type ModuleRegistration, type ScopeHost } from '@substrat-run/kernel';
3
+ export declare const CRM_VERTICAL = "acme/crm";
4
+ export declare const BOARD_VERTICAL = "acme/board";
5
+ export declare const crmExportModManifest: {
6
+ id: string & z.$brand<"ModuleId">;
7
+ version: string;
8
+ kernelContract: string;
9
+ permissions: {
10
+ key: string & z.$brand<"PermissionKey">;
11
+ description: string;
12
+ }[];
13
+ events: {
14
+ emits: {
15
+ type: string;
16
+ schemaVersion: number;
17
+ }[];
18
+ consumes: {
19
+ type: string;
20
+ schemaVersion: number;
21
+ from?: string | undefined;
22
+ }[];
23
+ exports?: {
24
+ type: string;
25
+ schemaVersion: number;
26
+ readPermission: string & z.$brand<"PermissionKey">;
27
+ }[] | undefined;
28
+ };
29
+ migrations: {
30
+ journalDir: string;
31
+ compatibleFrom: string;
32
+ };
33
+ attachmentTargets: {
34
+ entityType: string;
35
+ readPermission: string & z.$brand<"PermissionKey">;
36
+ writePermission?: (string & z.$brand<"PermissionKey">) | undefined;
37
+ }[];
38
+ liveTargets?: {
39
+ entityType: string;
40
+ readPermission: string & z.$brand<"PermissionKey">;
41
+ }[] | undefined;
42
+ entityRelations?: {
43
+ entityType: string;
44
+ parentType: string;
45
+ }[] | undefined;
46
+ guards?: {
47
+ before: string;
48
+ predicate: string;
49
+ config: Record<string, unknown>;
50
+ }[] | undefined;
51
+ schedules?: {
52
+ operation: string;
53
+ cadence: {
54
+ everyMinutes: number;
55
+ };
56
+ input?: Record<string, unknown> | undefined;
57
+ permissions: (string & z.$brand<"PermissionKey">)[];
58
+ }[] | undefined;
59
+ peers?: {
60
+ vertical: string;
61
+ operations: string[];
62
+ permissions: (string & z.$brand<"PermissionKey">)[];
63
+ }[] | undefined;
64
+ freshness?: {
65
+ eventType: string;
66
+ within: {
67
+ hours: number;
68
+ };
69
+ }[] | undefined;
70
+ withdraws?: string[] | undefined;
71
+ entitlementKey: string;
72
+ envSpec?: {
73
+ key: string;
74
+ label?: string | undefined;
75
+ description: string;
76
+ placeholder?: string | undefined;
77
+ required: boolean;
78
+ secret: boolean;
79
+ default?: string | undefined;
80
+ group?: string | undefined;
81
+ }[] | undefined;
82
+ ownerGrants?: (string & z.$brand<"PermissionKey">)[] | undefined;
83
+ entitlements?: string[] | undefined;
84
+ provides?: string[] | undefined;
85
+ requires?: string[] | undefined;
86
+ api?: string | undefined;
87
+ searchables?: {
88
+ entityType: string;
89
+ fields: string[];
90
+ table?: string | undefined;
91
+ idColumn?: string | undefined;
92
+ tokenizer?: "prefix" | "substring" | undefined;
93
+ }[] | undefined;
94
+ lists?: {
95
+ entityType: string;
96
+ sortable: string[];
97
+ filterable?: string[] | undefined;
98
+ table?: string | undefined;
99
+ idColumn?: string | undefined;
100
+ }[] | undefined;
101
+ ui?: {
102
+ routes?: {
103
+ path: string;
104
+ screen: string;
105
+ permission: string & z.$brand<"PermissionKey">;
106
+ }[] | undefined;
107
+ nav?: {
108
+ label: string;
109
+ icon?: string | undefined;
110
+ to: string;
111
+ permission: string & z.$brand<"PermissionKey">;
112
+ }[] | undefined;
113
+ entityViews?: {
114
+ entityType: string;
115
+ view: string;
116
+ }[] | undefined;
117
+ widgets?: {
118
+ slot: string;
119
+ component: string;
120
+ permission: string & z.$brand<"PermissionKey">;
121
+ }[] | undefined;
122
+ settingsPanels?: {
123
+ label: string;
124
+ component: string;
125
+ permission: string & z.$brand<"PermissionKey">;
126
+ }[] | undefined;
127
+ } | undefined;
128
+ };
129
+ export declare const crmExportMod: ModuleRegistration;
130
+ export declare const boardImportModManifest: {
131
+ id: string & z.$brand<"ModuleId">;
132
+ version: string;
133
+ kernelContract: string;
134
+ permissions: {
135
+ key: string & z.$brand<"PermissionKey">;
136
+ description: string;
137
+ }[];
138
+ events: {
139
+ emits: {
140
+ type: string;
141
+ schemaVersion: number;
142
+ }[];
143
+ consumes: {
144
+ type: string;
145
+ schemaVersion: number;
146
+ from?: string | undefined;
147
+ }[];
148
+ exports?: {
149
+ type: string;
150
+ schemaVersion: number;
151
+ readPermission: string & z.$brand<"PermissionKey">;
152
+ }[] | undefined;
153
+ };
154
+ migrations: {
155
+ journalDir: string;
156
+ compatibleFrom: string;
157
+ };
158
+ attachmentTargets: {
159
+ entityType: string;
160
+ readPermission: string & z.$brand<"PermissionKey">;
161
+ writePermission?: (string & z.$brand<"PermissionKey">) | undefined;
162
+ }[];
163
+ liveTargets?: {
164
+ entityType: string;
165
+ readPermission: string & z.$brand<"PermissionKey">;
166
+ }[] | undefined;
167
+ entityRelations?: {
168
+ entityType: string;
169
+ parentType: string;
170
+ }[] | undefined;
171
+ guards?: {
172
+ before: string;
173
+ predicate: string;
174
+ config: Record<string, unknown>;
175
+ }[] | undefined;
176
+ schedules?: {
177
+ operation: string;
178
+ cadence: {
179
+ everyMinutes: number;
180
+ };
181
+ input?: Record<string, unknown> | undefined;
182
+ permissions: (string & z.$brand<"PermissionKey">)[];
183
+ }[] | undefined;
184
+ peers?: {
185
+ vertical: string;
186
+ operations: string[];
187
+ permissions: (string & z.$brand<"PermissionKey">)[];
188
+ }[] | undefined;
189
+ freshness?: {
190
+ eventType: string;
191
+ within: {
192
+ hours: number;
193
+ };
194
+ }[] | undefined;
195
+ withdraws?: string[] | undefined;
196
+ entitlementKey: string;
197
+ envSpec?: {
198
+ key: string;
199
+ label?: string | undefined;
200
+ description: string;
201
+ placeholder?: string | undefined;
202
+ required: boolean;
203
+ secret: boolean;
204
+ default?: string | undefined;
205
+ group?: string | undefined;
206
+ }[] | undefined;
207
+ ownerGrants?: (string & z.$brand<"PermissionKey">)[] | undefined;
208
+ entitlements?: string[] | undefined;
209
+ provides?: string[] | undefined;
210
+ requires?: string[] | undefined;
211
+ api?: string | undefined;
212
+ searchables?: {
213
+ entityType: string;
214
+ fields: string[];
215
+ table?: string | undefined;
216
+ idColumn?: string | undefined;
217
+ tokenizer?: "prefix" | "substring" | undefined;
218
+ }[] | undefined;
219
+ lists?: {
220
+ entityType: string;
221
+ sortable: string[];
222
+ filterable?: string[] | undefined;
223
+ table?: string | undefined;
224
+ idColumn?: string | undefined;
225
+ }[] | undefined;
226
+ ui?: {
227
+ routes?: {
228
+ path: string;
229
+ screen: string;
230
+ permission: string & z.$brand<"PermissionKey">;
231
+ }[] | undefined;
232
+ nav?: {
233
+ label: string;
234
+ icon?: string | undefined;
235
+ to: string;
236
+ permission: string & z.$brand<"PermissionKey">;
237
+ }[] | undefined;
238
+ entityViews?: {
239
+ entityType: string;
240
+ view: string;
241
+ }[] | undefined;
242
+ widgets?: {
243
+ slot: string;
244
+ component: string;
245
+ permission: string & z.$brand<"PermissionKey">;
246
+ }[] | undefined;
247
+ settingsPanels?: {
248
+ label: string;
249
+ component: string;
250
+ permission: string & z.$brand<"PermissionKey">;
251
+ }[] | undefined;
252
+ } | undefined;
253
+ };
254
+ export declare const boardImportMod: ModuleRegistration;
255
+ /**
256
+ * Two deployments over ONE directory: `producer` registers `crmExportMod` and serves every
257
+ * scope provisioned as `acme/crm`, `consumer` registers `boardImportMod` and serves every
258
+ * `acme/board` scope. That is the hosted shape (a vertical is its own deployment) without the
259
+ * `/internal` hop, which is the hosted transport's to prove.
260
+ */
261
+ export interface VerticalEventsFixture {
262
+ producer: ScopeHost;
263
+ consumer: ScopeHost;
264
+ cleanup: () => Promise<void>;
265
+ }
266
+ /**
267
+ * Cross-vertical event delivery (#1705), against a real pair of deployments. Every claim the
268
+ * design rests on is here with its positive twin:
269
+ *
270
+ * - same-tenant only: a consumer receives its own tenant's producer, never another's;
271
+ * - not exported, not delivered, whatever the consumer declares;
272
+ * - only `piiClass: 'none'` crosses, and a classified instance is named but never carried;
273
+ * - at-least-once across the edge, one effect per (event, module): a redelivered batch runs
274
+ * nothing twice, and a handler that throws does not stop the events behind it;
275
+ * - the watermark belongs to the consumer and moves only forward, under a compare-and-set;
276
+ * - backfill: a consumer installed after the producer receives the history;
277
+ * - `caused_by` crosses the edge and resolves to its source;
278
+ * - a P ↔ C loop is cut at the hop cap;
279
+ * - a fork is neither read nor fed, and two primary installs are refused, not guessed.
280
+ */
281
+ export declare function verticalEventsContractSuite(adapterName: string, makeFixture: () => Promise<VerticalEventsFixture>): void;
282
+ //# sourceMappingURL=vertical-events-suite.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vertical-events-suite.d.ts","sourceRoot":"","sources":["../src/vertical-events-suite.ts"],"names":[],"mappings":"AACA,OAAO,EASL,CAAC,EAMF,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAML,KAAK,kBAAkB,EAGvB,KAAK,SAAS,EAEf,MAAM,sBAAsB,CAAC;AAc9B,eAAO,MAAM,YAAY,aAAa,CAAC;AACvC,eAAO,MAAM,cAAc,eAAe,CAAC;AAI3C,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2B/B,CAAC;AAuDH,eAAO,MAAM,YAAY,EAAE,kBAwB1B,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BjC,CAAC;AA6BH,eAAO,MAAM,cAAc,EAAE,kBAgD5B,CAAC;AAIF;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B;AAID;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,2BAA2B,CACzC,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,OAAO,CAAC,qBAAqB,CAAC,GAChD,IAAI,CAuZN"}