@zachariaz/strapi-plugin-experience-context 0.0.0-stage → 0.1.0-dev.2

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 (69) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +86 -2
  3. package/dist/_chunks/en-8ms9Hfxr.mjs +27 -0
  4. package/dist/_chunks/en-yERKDiB0.js +27 -0
  5. package/dist/admin/index.js +464 -0
  6. package/dist/admin/index.mjs +448 -0
  7. package/dist/admin/src/api/client.d.ts +13 -0
  8. package/dist/admin/src/api/types.d.ts +93 -0
  9. package/dist/admin/src/api/useInspect.d.ts +3 -0
  10. package/dist/admin/src/components/BlockMarkers.d.ts +12 -0
  11. package/dist/admin/src/components/ExperienceModal.d.ts +28 -0
  12. package/dist/admin/src/components/HeaderBadge.d.ts +19 -0
  13. package/dist/admin/src/components/Initializer.d.ts +5 -0
  14. package/dist/admin/src/components/ModalTrigger.d.ts +10 -0
  15. package/dist/admin/src/contentManagerHooks/editView.d.ts +7 -0
  16. package/dist/admin/src/index.d.ts +17 -0
  17. package/dist/admin/src/pluginId.d.ts +2 -0
  18. package/dist/admin/src/utils/dzSlots.d.ts +16 -0
  19. package/dist/admin/src/utils/labels.d.ts +30 -0
  20. package/dist/admin/src/utils/markers.d.ts +12 -0
  21. package/dist/admin/src/utils/modal.d.ts +10 -0
  22. package/dist/admin/src/utils/targets.d.ts +12 -0
  23. package/dist/server/index.js +3780 -0
  24. package/dist/server/index.mjs +3781 -0
  25. package/dist/server/src/admin-api/access.d.ts +40 -0
  26. package/dist/server/src/admin-api/inspect.d.ts +132 -0
  27. package/dist/server/src/admin-api/mark.d.ts +9 -0
  28. package/dist/server/src/block-keys/index.d.ts +16 -0
  29. package/dist/server/src/block-keys/middleware.d.ts +17 -0
  30. package/dist/server/src/block-keys/stamp.d.ts +55 -0
  31. package/dist/server/src/block-keys/store.d.ts +33 -0
  32. package/dist/server/src/block-keys/targets.d.ts +43 -0
  33. package/dist/server/src/bootstrap.d.ts +16 -0
  34. package/dist/server/src/changes.d.ts +80 -0
  35. package/dist/server/src/config/index.d.ts +67 -0
  36. package/dist/server/src/constants.d.ts +18 -0
  37. package/dist/server/src/content-types/index.d.ts +309 -0
  38. package/dist/server/src/controllers/admin.d.ts +10 -0
  39. package/dist/server/src/controllers/experience.d.ts +15 -0
  40. package/dist/server/src/controllers/index.d.ts +16 -0
  41. package/dist/server/src/destroy.d.ts +5 -0
  42. package/dist/server/src/index.d.ts +441 -0
  43. package/dist/server/src/integrity/index.d.ts +34 -0
  44. package/dist/server/src/integrity/orphans.d.ts +40 -0
  45. package/dist/server/src/mcp/index.d.ts +2 -0
  46. package/dist/server/src/mcp/operations.d.ts +815 -0
  47. package/dist/server/src/mcp/permissions.d.ts +56 -0
  48. package/dist/server/src/mcp/tools.d.ts +59 -0
  49. package/dist/server/src/model/content.d.ts +32 -0
  50. package/dist/server/src/model/mapping.d.ts +90 -0
  51. package/dist/server/src/model/records.d.ts +132 -0
  52. package/dist/server/src/model/store.d.ts +44 -0
  53. package/dist/server/src/model/target.d.ts +40 -0
  54. package/dist/server/src/policies/index.d.ts +4 -0
  55. package/dist/server/src/rbac/index.d.ts +24 -0
  56. package/dist/server/src/read-path/editor.d.ts +28 -0
  57. package/dist/server/src/read-path/gate.d.ts +26 -0
  58. package/dist/server/src/read-path/index.d.ts +12 -0
  59. package/dist/server/src/read-path/loader.d.ts +31 -0
  60. package/dist/server/src/read-path/middleware.d.ts +32 -0
  61. package/dist/server/src/read-path/payload.d.ts +34 -0
  62. package/dist/server/src/read-path/populate.d.ts +6 -0
  63. package/dist/server/src/register.d.ts +14 -0
  64. package/dist/server/src/registry/index.d.ts +29 -0
  65. package/dist/server/src/registry/unomi.d.ts +53 -0
  66. package/dist/server/src/routes/index.d.ts +25 -0
  67. package/dist/server/src/services/index.d.ts +79 -0
  68. package/package.json +140 -4
  69. package/scripts/experience-smoke.mjs +430 -0
@@ -0,0 +1,815 @@
1
+ import type { Core } from '@strapi/strapi';
2
+ import { type ExperimentOutcome, type Validity } from '@zachariaz/experience-context-core';
3
+ import { type RegistryKind } from '../registry';
4
+ import { type ExperienceAction } from './permissions';
5
+ /**
6
+ * The MCP tool operations, independent of the MCP transport so they can be
7
+ * unit-tested with a mocked Strapi. Each takes validated arguments and
8
+ * returns plain JSON (the tool's structuredContent), or throws a
9
+ * {@link ToolError} whose message the agent reads.
10
+ *
11
+ * Every write: resolves the target, builds the final state, validates it
12
+ * with the shared `validateExperienceMapping` (errors block the write and
13
+ * name the path), returns the plan without writing on `dryRun`, and
14
+ * otherwise writes in one transaction with a change-log row per change
15
+ * (actor, source `mcp`, `correlationId`) and one `experience.update` webhook.
16
+ */
17
+ export interface Caller {
18
+ actor: string;
19
+ /** Throws a ToolError when the caller lacks `action` (checks a call needs beyond the tool's policies). */
20
+ require?: (action: ExperienceAction, why: string) => void;
21
+ }
22
+ interface WriteArgs {
23
+ dryRun?: boolean;
24
+ correlationId?: string | null;
25
+ reason?: string | null;
26
+ }
27
+ interface TargetArgs {
28
+ targetUid: string;
29
+ targetDocumentId?: string;
30
+ locale?: string | null;
31
+ }
32
+ export declare function describeTarget(strapi: Core.Strapi, args: TargetArgs & {
33
+ status?: 'draft' | 'published';
34
+ }): Promise<{
35
+ target: {
36
+ title: string | null;
37
+ uid: string;
38
+ documentId: string;
39
+ kind: "collectionType" | "singleType";
40
+ localized: boolean;
41
+ locale: string | null;
42
+ };
43
+ locale: string | null;
44
+ status: "draft" | "published";
45
+ page: {
46
+ concepts: string[];
47
+ };
48
+ blocks: {
49
+ concepts: string[];
50
+ section: {
51
+ sectionKey: string;
52
+ variantKey: string;
53
+ isDefault: boolean;
54
+ displayName: string | null;
55
+ status: string;
56
+ targetAudiences: string[];
57
+ traits: string[];
58
+ affinities: string[];
59
+ priority: number;
60
+ validity: Validity | null;
61
+ } | null;
62
+ experiment: {
63
+ key: string;
64
+ outcome: string;
65
+ } | null;
66
+ index: number;
67
+ blockKey: string | null;
68
+ componentUid: string;
69
+ summary: string;
70
+ title: string | null;
71
+ }[];
72
+ sections: {
73
+ sectionKey: string;
74
+ default: {
75
+ id: string | null;
76
+ locale: string | null;
77
+ orphaned: boolean;
78
+ source: string | null;
79
+ createdBy: string | null;
80
+ correlationId: string | null;
81
+ createdAt: string | null;
82
+ updatedAt: string | null;
83
+ sectionKey: string;
84
+ variantKey: string;
85
+ blockKey: string;
86
+ isDefault: boolean;
87
+ displayName?: string | null | undefined;
88
+ description?: string | null | undefined;
89
+ status?: import("@zachariaz/experience-context-core").VariationStatus | undefined;
90
+ targetAudiences?: string[] | undefined;
91
+ traits?: string[] | undefined;
92
+ affinities?: string[] | undefined;
93
+ experiment?: {
94
+ key: string;
95
+ outcome: string;
96
+ } | null | undefined;
97
+ priority?: number | null | undefined;
98
+ validity?: Validity | null | undefined;
99
+ componentUid?: string | null | undefined;
100
+ } | null;
101
+ variations: {
102
+ id: string | null;
103
+ locale: string | null;
104
+ orphaned: boolean;
105
+ source: string | null;
106
+ createdBy: string | null;
107
+ correlationId: string | null;
108
+ createdAt: string | null;
109
+ updatedAt: string | null;
110
+ sectionKey: string;
111
+ variantKey: string;
112
+ blockKey: string;
113
+ isDefault: boolean;
114
+ displayName?: string | null | undefined;
115
+ description?: string | null | undefined;
116
+ status?: import("@zachariaz/experience-context-core").VariationStatus | undefined;
117
+ targetAudiences?: string[] | undefined;
118
+ traits?: string[] | undefined;
119
+ affinities?: string[] | undefined;
120
+ experiment?: {
121
+ key: string;
122
+ outcome: string;
123
+ } | null | undefined;
124
+ priority?: number | null | undefined;
125
+ validity?: Validity | null | undefined;
126
+ componentUid?: string | null | undefined;
127
+ }[];
128
+ }[];
129
+ experiments: import("@zachariaz/experience-context-core").Experiment[];
130
+ coverage: {
131
+ locale: string | null;
132
+ exists: boolean;
133
+ blocks: number;
134
+ unkeyedBlocks: number;
135
+ mappedBlocks: number;
136
+ mappingsWithoutBlock: {
137
+ sectionKey: string;
138
+ variantKey: string;
139
+ blockKey: string;
140
+ }[];
141
+ }[];
142
+ validation: import("../model/mapping").ValidationReport;
143
+ warnings: string[];
144
+ }>;
145
+ export declare function listRegistry(strapi: Core.Strapi, args: {
146
+ kind?: RegistryKind;
147
+ }): Promise<{
148
+ counts: {
149
+ [k: string]: number;
150
+ };
151
+ }>;
152
+ export declare function listContentVariants(strapi: Core.Strapi, args: {
153
+ targetUid?: string;
154
+ targetDocumentId?: string;
155
+ locale?: string | null;
156
+ sectionKey?: string;
157
+ audience?: string;
158
+ experimentKey?: string;
159
+ includeInactive?: boolean;
160
+ }): Promise<{
161
+ count: number;
162
+ targets: {
163
+ targetUid: string;
164
+ targetDocumentId: string;
165
+ locale: string | null;
166
+ sections: {
167
+ sectionKey: string;
168
+ default: {
169
+ id: string | null;
170
+ locale: string | null;
171
+ orphaned: boolean;
172
+ source: string | null;
173
+ createdBy: string | null;
174
+ correlationId: string | null;
175
+ createdAt: string | null;
176
+ updatedAt: string | null;
177
+ sectionKey: string;
178
+ variantKey: string;
179
+ blockKey: string;
180
+ isDefault: boolean;
181
+ displayName?: string | null | undefined;
182
+ description?: string | null | undefined;
183
+ status?: import("@zachariaz/experience-context-core").VariationStatus | undefined;
184
+ targetAudiences?: string[] | undefined;
185
+ traits?: string[] | undefined;
186
+ affinities?: string[] | undefined;
187
+ experiment?: {
188
+ key: string;
189
+ outcome: string;
190
+ } | null | undefined;
191
+ priority?: number | null | undefined;
192
+ validity?: Validity | null | undefined;
193
+ componentUid?: string | null | undefined;
194
+ } | null;
195
+ variations: {
196
+ id: string | null;
197
+ locale: string | null;
198
+ orphaned: boolean;
199
+ source: string | null;
200
+ createdBy: string | null;
201
+ correlationId: string | null;
202
+ createdAt: string | null;
203
+ updatedAt: string | null;
204
+ sectionKey: string;
205
+ variantKey: string;
206
+ blockKey: string;
207
+ isDefault: boolean;
208
+ displayName?: string | null | undefined;
209
+ description?: string | null | undefined;
210
+ status?: import("@zachariaz/experience-context-core").VariationStatus | undefined;
211
+ targetAudiences?: string[] | undefined;
212
+ traits?: string[] | undefined;
213
+ affinities?: string[] | undefined;
214
+ experiment?: {
215
+ key: string;
216
+ outcome: string;
217
+ } | null | undefined;
218
+ priority?: number | null | undefined;
219
+ validity?: Validity | null | undefined;
220
+ componentUid?: string | null | undefined;
221
+ }[];
222
+ }[];
223
+ }[];
224
+ }>;
225
+ export interface ListChangesArgs {
226
+ targetUid?: string;
227
+ targetDocumentId?: string;
228
+ locale?: string | null;
229
+ sectionKey?: string;
230
+ variantKey?: string;
231
+ blockKey?: string;
232
+ experimentKey?: string;
233
+ entity?: 'annotation' | 'variation' | 'experiment' | 'block';
234
+ action?: 'create' | 'update' | 'delete' | 'orphaned' | 'reactivated';
235
+ actor?: string;
236
+ source?: 'mcp' | 'api' | 'system';
237
+ correlationId?: string;
238
+ since?: string;
239
+ until?: string;
240
+ beforeId?: number;
241
+ limit?: number;
242
+ includeValues?: boolean;
243
+ }
244
+ /**
245
+ * The change log (plan §5.4), newest first: who changed which mapping or
246
+ * block, when, how (source) and in which run (correlationId), with the
247
+ * before/after records. Page with `beforeId` (the last id of a page).
248
+ */
249
+ export declare function listChanges(strapi: Core.Strapi, args: ListChangesArgs): Promise<{
250
+ count: number;
251
+ hasMore: boolean;
252
+ nextBeforeId: any;
253
+ changes: {
254
+ before?: any;
255
+ after?: any;
256
+ id: any;
257
+ at: any;
258
+ action: any;
259
+ entity: any;
260
+ entityDocumentId: any;
261
+ targetUid: any;
262
+ targetDocumentId: any;
263
+ locale: any;
264
+ sectionKey: any;
265
+ variantKey: any;
266
+ blockKey: any;
267
+ componentUid: any;
268
+ experimentKey: any;
269
+ actor: any;
270
+ source: any;
271
+ reason: any;
272
+ correlationId: any;
273
+ }[];
274
+ }>;
275
+ export declare function validateMapping(strapi: Core.Strapi, args: {
276
+ targetUid?: string;
277
+ targetDocumentId?: string;
278
+ locale?: string | null;
279
+ }): Promise<{
280
+ ok: boolean;
281
+ targets: {
282
+ ok: boolean;
283
+ errors: import("@zachariaz/experience-context-core").ValidationIssue[];
284
+ warnings: import("@zachariaz/experience-context-core").ValidationIssue[];
285
+ checklist: string[];
286
+ items: import("../model/mapping").ChecklistItem[];
287
+ target: {
288
+ uid: string;
289
+ documentId: string;
290
+ kind: "collectionType" | "singleType";
291
+ localized: boolean;
292
+ locale: string | null;
293
+ };
294
+ }[];
295
+ experiments: {
296
+ ok: boolean;
297
+ errors: import("@zachariaz/experience-context-core").ValidationIssue[];
298
+ warnings: import("@zachariaz/experience-context-core").ValidationIssue[];
299
+ checklist: string[];
300
+ items: import("../model/mapping").ChecklistItem[];
301
+ key: string;
302
+ status: import("@zachariaz/experience-context-core").ExperimentStatus;
303
+ }[];
304
+ }>;
305
+ export declare function explainVariantResolution(strapi: Core.Strapi, args: TargetArgs & {
306
+ status?: 'draft' | 'published';
307
+ context?: Record<string, unknown>;
308
+ preview?: boolean;
309
+ }): Promise<{
310
+ context: import("@zachariaz/experience-context-core").EffectiveContext;
311
+ rendered: (string | null)[];
312
+ sections: Record<string, import("@zachariaz/experience-context-core").SectionResolution>;
313
+ experiments: Record<string, import("@zachariaz/experience-context-core").ExperimentResolution>;
314
+ explanation: import("@zachariaz/experience-context-core").ResolutionExplanation;
315
+ target: {
316
+ uid: string;
317
+ documentId: string;
318
+ kind: "collectionType" | "singleType";
319
+ localized: boolean;
320
+ locale: string | null;
321
+ };
322
+ status: "draft" | "published";
323
+ }>;
324
+ export interface CreateVariantArgs extends TargetArgs, WriteArgs {
325
+ sectionKey: string;
326
+ variantKey: string;
327
+ displayName?: string | null;
328
+ description?: string | null;
329
+ sourceBlockKey?: string;
330
+ content?: Record<string, unknown>;
331
+ /** Register this block, already in the draft, as the variation instead of copying one. */
332
+ existingBlockKey?: string;
333
+ defaultBlockKey?: string;
334
+ defaultVariantKey?: string;
335
+ defaultDisplayName?: string | null;
336
+ defaultOutcome?: string;
337
+ targetAudiences?: string[];
338
+ traits?: string[];
339
+ affinities?: string[];
340
+ experiment?: {
341
+ key: string;
342
+ outcome: string;
343
+ } | null;
344
+ status?: 'active' | 'inactive';
345
+ priority?: number;
346
+ validity?: Validity | null;
347
+ }
348
+ export declare function createContentVariant(strapi: Core.Strapi, args: CreateVariantArgs, caller: Caller): Promise<{
349
+ validation: import("../model/mapping").ValidationReport;
350
+ section: {
351
+ sectionKey: string;
352
+ created: boolean;
353
+ default: string;
354
+ };
355
+ block: {
356
+ blockKey: string | null | undefined;
357
+ componentUid: string;
358
+ index: number;
359
+ copiedFrom: string | null;
360
+ adopted: boolean;
361
+ };
362
+ variation: import("@zachariaz/experience-context-core").Variation;
363
+ dryRun: boolean;
364
+ target: {
365
+ uid: string;
366
+ documentId: string;
367
+ kind: "collectionType" | "singleType";
368
+ localized: boolean;
369
+ locale: string | null;
370
+ };
371
+ } | {
372
+ validation: import("../model/mapping").ValidationReport;
373
+ next: string[];
374
+ section: {
375
+ sectionKey: string;
376
+ created: boolean;
377
+ default: string;
378
+ };
379
+ block: {
380
+ blockKey: string | null | undefined;
381
+ componentUid: string;
382
+ index: number;
383
+ copiedFrom: string | null;
384
+ adopted: boolean;
385
+ };
386
+ variation: import("@zachariaz/experience-context-core").Variation;
387
+ dryRun: boolean;
388
+ target: {
389
+ uid: string;
390
+ documentId: string;
391
+ kind: "collectionType" | "singleType";
392
+ localized: boolean;
393
+ locale: string | null;
394
+ };
395
+ }>;
396
+ export interface UpdateVariantArgs extends TargetArgs, WriteArgs {
397
+ sectionKey: string;
398
+ variantKey: string;
399
+ newVariantKey?: string;
400
+ displayName?: string | null;
401
+ description?: string | null;
402
+ status?: 'active' | 'inactive';
403
+ priority?: number;
404
+ validity?: Validity | null;
405
+ }
406
+ export declare function updateContentVariant(strapi: Core.Strapi, args: UpdateVariantArgs, caller: Caller): Promise<{
407
+ dryRun: boolean;
408
+ target: {
409
+ uid: string;
410
+ documentId: string;
411
+ kind: "collectionType" | "singleType";
412
+ localized: boolean;
413
+ locale: string | null;
414
+ };
415
+ before: {
416
+ id: string | null;
417
+ locale: string | null;
418
+ orphaned: boolean;
419
+ source: string | null;
420
+ createdBy: string | null;
421
+ correlationId: string | null;
422
+ createdAt: string | null;
423
+ updatedAt: string | null;
424
+ sectionKey: string;
425
+ variantKey: string;
426
+ blockKey: string;
427
+ isDefault: boolean;
428
+ displayName?: string | null | undefined;
429
+ description?: string | null | undefined;
430
+ status?: import("@zachariaz/experience-context-core").VariationStatus | undefined;
431
+ targetAudiences?: string[] | undefined;
432
+ traits?: string[] | undefined;
433
+ affinities?: string[] | undefined;
434
+ experiment?: {
435
+ key: string;
436
+ outcome: string;
437
+ } | null | undefined;
438
+ priority?: number | null | undefined;
439
+ validity?: Validity | null | undefined;
440
+ componentUid?: string | null | undefined;
441
+ };
442
+ after: {
443
+ id: string | null;
444
+ locale: string | null;
445
+ orphaned: boolean;
446
+ source: string | null;
447
+ createdBy: string | null;
448
+ correlationId: string | null;
449
+ createdAt: string | null;
450
+ updatedAt: string | null;
451
+ sectionKey: string;
452
+ variantKey: string;
453
+ blockKey: string;
454
+ isDefault: boolean;
455
+ displayName?: string | null | undefined;
456
+ description?: string | null | undefined;
457
+ status?: import("@zachariaz/experience-context-core").VariationStatus | undefined;
458
+ targetAudiences?: string[] | undefined;
459
+ traits?: string[] | undefined;
460
+ affinities?: string[] | undefined;
461
+ experiment?: {
462
+ key: string;
463
+ outcome: string;
464
+ } | null | undefined;
465
+ priority?: number | null | undefined;
466
+ validity?: Validity | null | undefined;
467
+ componentUid?: string | null | undefined;
468
+ };
469
+ validation: import("../model/mapping").ValidationReport;
470
+ }>;
471
+ export interface AssociateAudienceArgs extends TargetArgs, WriteArgs {
472
+ sectionKey: string;
473
+ variantKey: string;
474
+ targetAudiences?: string[];
475
+ traits?: string[];
476
+ affinities?: string[];
477
+ mode?: 'replace' | 'add';
478
+ }
479
+ export declare function associateVariantWithAudience(strapi: Core.Strapi, args: AssociateAudienceArgs, caller: Caller): Promise<{
480
+ dryRun: boolean;
481
+ target: {
482
+ uid: string;
483
+ documentId: string;
484
+ kind: "collectionType" | "singleType";
485
+ localized: boolean;
486
+ locale: string | null;
487
+ };
488
+ before: {
489
+ id: string | null;
490
+ locale: string | null;
491
+ orphaned: boolean;
492
+ source: string | null;
493
+ createdBy: string | null;
494
+ correlationId: string | null;
495
+ createdAt: string | null;
496
+ updatedAt: string | null;
497
+ sectionKey: string;
498
+ variantKey: string;
499
+ blockKey: string;
500
+ isDefault: boolean;
501
+ displayName?: string | null | undefined;
502
+ description?: string | null | undefined;
503
+ status?: import("@zachariaz/experience-context-core").VariationStatus | undefined;
504
+ targetAudiences?: string[] | undefined;
505
+ traits?: string[] | undefined;
506
+ affinities?: string[] | undefined;
507
+ experiment?: {
508
+ key: string;
509
+ outcome: string;
510
+ } | null | undefined;
511
+ priority?: number | null | undefined;
512
+ validity?: Validity | null | undefined;
513
+ componentUid?: string | null | undefined;
514
+ };
515
+ after: {
516
+ id: string | null;
517
+ locale: string | null;
518
+ orphaned: boolean;
519
+ source: string | null;
520
+ createdBy: string | null;
521
+ correlationId: string | null;
522
+ createdAt: string | null;
523
+ updatedAt: string | null;
524
+ sectionKey: string;
525
+ variantKey: string;
526
+ blockKey: string;
527
+ isDefault: boolean;
528
+ displayName?: string | null | undefined;
529
+ description?: string | null | undefined;
530
+ status?: import("@zachariaz/experience-context-core").VariationStatus | undefined;
531
+ targetAudiences?: string[] | undefined;
532
+ traits?: string[] | undefined;
533
+ affinities?: string[] | undefined;
534
+ experiment?: {
535
+ key: string;
536
+ outcome: string;
537
+ } | null | undefined;
538
+ priority?: number | null | undefined;
539
+ validity?: Validity | null | undefined;
540
+ componentUid?: string | null | undefined;
541
+ };
542
+ validation: import("../model/mapping").ValidationReport;
543
+ }>;
544
+ export interface AssociateExperimentArgs extends TargetArgs, WriteArgs {
545
+ sectionKey?: string;
546
+ variantKey?: string;
547
+ blockKey?: string;
548
+ experimentKey: string | null;
549
+ outcome?: string;
550
+ }
551
+ export declare function associateVariantWithExperiment(strapi: Core.Strapi, args: AssociateExperimentArgs, caller: Caller): Promise<{
552
+ dryRun: boolean;
553
+ target: {
554
+ uid: string;
555
+ documentId: string;
556
+ kind: "collectionType" | "singleType";
557
+ localized: boolean;
558
+ locale: string | null;
559
+ };
560
+ before: {
561
+ id: string | null;
562
+ locale: string | null;
563
+ orphaned: boolean;
564
+ source: string | null;
565
+ createdBy: string | null;
566
+ correlationId: string | null;
567
+ createdAt: string | null;
568
+ updatedAt: string | null;
569
+ sectionKey: string;
570
+ variantKey: string;
571
+ blockKey: string;
572
+ isDefault: boolean;
573
+ displayName?: string | null | undefined;
574
+ description?: string | null | undefined;
575
+ status?: import("@zachariaz/experience-context-core").VariationStatus | undefined;
576
+ targetAudiences?: string[] | undefined;
577
+ traits?: string[] | undefined;
578
+ affinities?: string[] | undefined;
579
+ experiment?: {
580
+ key: string;
581
+ outcome: string;
582
+ } | null | undefined;
583
+ priority?: number | null | undefined;
584
+ validity?: Validity | null | undefined;
585
+ componentUid?: string | null | undefined;
586
+ };
587
+ after: {
588
+ id: string | null;
589
+ locale: string | null;
590
+ orphaned: boolean;
591
+ source: string | null;
592
+ createdBy: string | null;
593
+ correlationId: string | null;
594
+ createdAt: string | null;
595
+ updatedAt: string | null;
596
+ sectionKey: string;
597
+ variantKey: string;
598
+ blockKey: string;
599
+ isDefault: boolean;
600
+ displayName?: string | null | undefined;
601
+ description?: string | null | undefined;
602
+ status?: import("@zachariaz/experience-context-core").VariationStatus | undefined;
603
+ targetAudiences?: string[] | undefined;
604
+ traits?: string[] | undefined;
605
+ affinities?: string[] | undefined;
606
+ experiment?: {
607
+ key: string;
608
+ outcome: string;
609
+ } | null | undefined;
610
+ priority?: number | null | undefined;
611
+ validity?: Validity | null | undefined;
612
+ componentUid?: string | null | undefined;
613
+ };
614
+ validation: import("../model/mapping").ValidationReport;
615
+ } | {
616
+ dryRun: boolean;
617
+ target: {
618
+ uid: string;
619
+ documentId: string;
620
+ kind: "collectionType" | "singleType";
621
+ localized: boolean;
622
+ locale: string | null;
623
+ };
624
+ before: null;
625
+ after: {
626
+ id: string | null;
627
+ locale: string | null;
628
+ orphaned: boolean;
629
+ source: string | null;
630
+ createdBy: string | null;
631
+ correlationId: string | null;
632
+ createdAt: string | null;
633
+ updatedAt: string | null;
634
+ sectionKey: string;
635
+ variantKey: string;
636
+ blockKey: string;
637
+ isDefault: boolean;
638
+ displayName?: string | null | undefined;
639
+ description?: string | null | undefined;
640
+ status?: import("@zachariaz/experience-context-core").VariationStatus | undefined;
641
+ targetAudiences?: string[] | undefined;
642
+ traits?: string[] | undefined;
643
+ affinities?: string[] | undefined;
644
+ experiment?: {
645
+ key: string;
646
+ outcome: string;
647
+ } | null | undefined;
648
+ priority?: number | null | undefined;
649
+ validity?: Validity | null | undefined;
650
+ componentUid?: string | null | undefined;
651
+ };
652
+ validation: import("../model/mapping").ValidationReport;
653
+ }>;
654
+ export interface SetExperimentArgs extends WriteArgs {
655
+ key: string;
656
+ newKey?: string;
657
+ name?: string | null;
658
+ description?: string | null;
659
+ outcomes?: ExperimentOutcome[];
660
+ controlOutcome?: string;
661
+ status?: 'draft' | 'running' | 'paused' | 'concluded';
662
+ validity?: Validity | null;
663
+ externalId?: string | null;
664
+ }
665
+ export declare function setExperiment(strapi: Core.Strapi, args: SetExperimentArgs, caller: Caller): Promise<{
666
+ dryRun: boolean;
667
+ action: string;
668
+ experiment: import("@zachariaz/experience-context-core").Experiment;
669
+ previous: import("@zachariaz/experience-context-core").Experiment | null;
670
+ mappedBlocks: number;
671
+ validation: {
672
+ ok: boolean;
673
+ errors: import("@zachariaz/experience-context-core").ValidationIssue[];
674
+ warnings: import("@zachariaz/experience-context-core").ValidationIssue[];
675
+ };
676
+ warnings: string[];
677
+ next?: undefined;
678
+ } | {
679
+ dryRun: boolean;
680
+ action: string;
681
+ experiment: import("@zachariaz/experience-context-core").Experiment;
682
+ previous: import("@zachariaz/experience-context-core").Experiment | null;
683
+ mappedBlocks: number;
684
+ validation: {
685
+ ok: boolean;
686
+ errors: import("@zachariaz/experience-context-core").ValidationIssue[];
687
+ warnings: import("@zachariaz/experience-context-core").ValidationIssue[];
688
+ };
689
+ warnings: string[];
690
+ next: string[];
691
+ }>;
692
+ export interface ConcludeArgs extends WriteArgs {
693
+ key: string;
694
+ winner: string;
695
+ cleanup?: boolean;
696
+ }
697
+ export declare function concludeExperiment(strapi: Core.Strapi, args: ConcludeArgs, caller: Caller): Promise<{
698
+ dryRun: boolean;
699
+ experiment: import("@zachariaz/experience-context-core").Experiment;
700
+ previous: import("@zachariaz/experience-context-core").Experiment;
701
+ cleanup: {
702
+ targetUid: string;
703
+ targetDocumentId: string;
704
+ locale: string | null;
705
+ removedBlocks: {
706
+ sectionKey: string;
707
+ variantKey: string;
708
+ blockKey: string;
709
+ outcome: string;
710
+ }[];
711
+ keptBlocks: {
712
+ sectionKey: string;
713
+ variantKey: string;
714
+ blockKey: string;
715
+ isDefault: boolean;
716
+ }[];
717
+ }[];
718
+ warnings: import("@zachariaz/experience-context-core").ValidationIssue[];
719
+ }>;
720
+ export interface AnnotateArgs extends TargetArgs, WriteArgs {
721
+ blockKey?: string | null;
722
+ concepts: string[];
723
+ mode?: 'replace' | 'add' | 'remove';
724
+ }
725
+ export declare function annotateContentWithConcepts(strapi: Core.Strapi, args: AnnotateArgs, caller: Caller): Promise<{
726
+ target: {
727
+ uid: string;
728
+ documentId: string;
729
+ kind: "collectionType" | "singleType";
730
+ localized: boolean;
731
+ locale: string | null;
732
+ };
733
+ locale: string | null;
734
+ blockKey: string | null;
735
+ before: string[];
736
+ concepts: string[];
737
+ validation: import("../model/mapping").ValidationReport;
738
+ dryRun: boolean;
739
+ }>;
740
+ export interface RemoveArgs extends WriteArgs {
741
+ kind: 'variation' | 'section' | 'annotation' | 'experiment';
742
+ targetUid?: string;
743
+ targetDocumentId?: string;
744
+ locale?: string | null;
745
+ sectionKey?: string;
746
+ variantKey?: string;
747
+ blockKey?: string | null;
748
+ experimentKey?: string;
749
+ deleteBlocks?: boolean;
750
+ }
751
+ export declare function removeMapping(strapi: Core.Strapi, args: RemoveArgs, caller: Caller): Promise<{
752
+ dryRun: boolean;
753
+ removed: {
754
+ experiment: import("@zachariaz/experience-context-core").Experiment;
755
+ annotation?: undefined;
756
+ };
757
+ } | {
758
+ dryRun: boolean;
759
+ removed: {
760
+ annotation: {
761
+ blockKey: string | null;
762
+ locale: string | null;
763
+ concepts: string[];
764
+ };
765
+ experiment?: undefined;
766
+ };
767
+ } | {
768
+ target: {
769
+ uid: string;
770
+ documentId: string;
771
+ kind: "collectionType" | "singleType";
772
+ localized: boolean;
773
+ locale: string | null;
774
+ };
775
+ removed: {
776
+ variations: {
777
+ id: string | null;
778
+ locale: string | null;
779
+ orphaned: boolean;
780
+ source: string | null;
781
+ createdBy: string | null;
782
+ correlationId: string | null;
783
+ createdAt: string | null;
784
+ updatedAt: string | null;
785
+ sectionKey: string;
786
+ variantKey: string;
787
+ blockKey: string;
788
+ isDefault: boolean;
789
+ displayName?: string | null | undefined;
790
+ description?: string | null | undefined;
791
+ status?: import("@zachariaz/experience-context-core").VariationStatus | undefined;
792
+ targetAudiences?: string[] | undefined;
793
+ traits?: string[] | undefined;
794
+ affinities?: string[] | undefined;
795
+ experiment?: {
796
+ key: string;
797
+ outcome: string;
798
+ } | null | undefined;
799
+ priority?: number | null | undefined;
800
+ validity?: Validity | null | undefined;
801
+ componentUid?: string | null | undefined;
802
+ }[];
803
+ blocks: string[];
804
+ };
805
+ keptBlocks: string[];
806
+ validation: import("../model/mapping").ValidationReport;
807
+ dryRun: boolean;
808
+ }>;
809
+ export declare function backfillBlockKeys(strapi: Core.Strapi, args: {
810
+ dryRun?: boolean;
811
+ contentTypes?: string[];
812
+ documentId?: string;
813
+ locales?: string[];
814
+ }): Promise<import("../block-keys").BackfillReport>;
815
+ export {};