@zachariaz/strapi-plugin-experience-context 0.0.0-stage → 0.1.0-dev.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 (69) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +78 -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 +3694 -0
  24. package/dist/server/index.mjs +3695 -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 +765 -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,765 @@
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 declare function validateMapping(strapi: Core.Strapi, args: {
226
+ targetUid?: string;
227
+ targetDocumentId?: string;
228
+ locale?: string | null;
229
+ }): Promise<{
230
+ ok: boolean;
231
+ targets: {
232
+ ok: boolean;
233
+ errors: import("@zachariaz/experience-context-core").ValidationIssue[];
234
+ warnings: import("@zachariaz/experience-context-core").ValidationIssue[];
235
+ checklist: string[];
236
+ items: import("../model/mapping").ChecklistItem[];
237
+ target: {
238
+ uid: string;
239
+ documentId: string;
240
+ kind: "collectionType" | "singleType";
241
+ localized: boolean;
242
+ locale: string | null;
243
+ };
244
+ }[];
245
+ experiments: {
246
+ ok: boolean;
247
+ errors: import("@zachariaz/experience-context-core").ValidationIssue[];
248
+ warnings: import("@zachariaz/experience-context-core").ValidationIssue[];
249
+ checklist: string[];
250
+ items: import("../model/mapping").ChecklistItem[];
251
+ key: string;
252
+ status: import("@zachariaz/experience-context-core").ExperimentStatus;
253
+ }[];
254
+ }>;
255
+ export declare function explainVariantResolution(strapi: Core.Strapi, args: TargetArgs & {
256
+ status?: 'draft' | 'published';
257
+ context?: Record<string, unknown>;
258
+ preview?: boolean;
259
+ }): Promise<{
260
+ context: import("@zachariaz/experience-context-core").EffectiveContext;
261
+ rendered: (string | null)[];
262
+ sections: Record<string, import("@zachariaz/experience-context-core").SectionResolution>;
263
+ experiments: Record<string, import("@zachariaz/experience-context-core").ExperimentResolution>;
264
+ explanation: import("@zachariaz/experience-context-core").ResolutionExplanation;
265
+ target: {
266
+ uid: string;
267
+ documentId: string;
268
+ kind: "collectionType" | "singleType";
269
+ localized: boolean;
270
+ locale: string | null;
271
+ };
272
+ status: "draft" | "published";
273
+ }>;
274
+ export interface CreateVariantArgs extends TargetArgs, WriteArgs {
275
+ sectionKey: string;
276
+ variantKey: string;
277
+ displayName?: string | null;
278
+ description?: string | null;
279
+ sourceBlockKey?: string;
280
+ content?: Record<string, unknown>;
281
+ /** Register this block, already in the draft, as the variation instead of copying one. */
282
+ existingBlockKey?: string;
283
+ defaultBlockKey?: string;
284
+ defaultVariantKey?: string;
285
+ defaultDisplayName?: string | null;
286
+ defaultOutcome?: string;
287
+ targetAudiences?: string[];
288
+ traits?: string[];
289
+ affinities?: string[];
290
+ experiment?: {
291
+ key: string;
292
+ outcome: string;
293
+ } | null;
294
+ status?: 'active' | 'inactive';
295
+ priority?: number;
296
+ validity?: Validity | null;
297
+ }
298
+ export declare function createContentVariant(strapi: Core.Strapi, args: CreateVariantArgs, caller: Caller): Promise<{
299
+ validation: import("../model/mapping").ValidationReport;
300
+ section: {
301
+ sectionKey: string;
302
+ created: boolean;
303
+ default: string;
304
+ };
305
+ block: {
306
+ blockKey: string | null | undefined;
307
+ componentUid: string;
308
+ index: number;
309
+ copiedFrom: string | null;
310
+ adopted: boolean;
311
+ };
312
+ variation: import("@zachariaz/experience-context-core").Variation;
313
+ dryRun: boolean;
314
+ target: {
315
+ uid: string;
316
+ documentId: string;
317
+ kind: "collectionType" | "singleType";
318
+ localized: boolean;
319
+ locale: string | null;
320
+ };
321
+ } | {
322
+ validation: import("../model/mapping").ValidationReport;
323
+ next: string[];
324
+ section: {
325
+ sectionKey: string;
326
+ created: boolean;
327
+ default: string;
328
+ };
329
+ block: {
330
+ blockKey: string | null | undefined;
331
+ componentUid: string;
332
+ index: number;
333
+ copiedFrom: string | null;
334
+ adopted: boolean;
335
+ };
336
+ variation: import("@zachariaz/experience-context-core").Variation;
337
+ dryRun: boolean;
338
+ target: {
339
+ uid: string;
340
+ documentId: string;
341
+ kind: "collectionType" | "singleType";
342
+ localized: boolean;
343
+ locale: string | null;
344
+ };
345
+ }>;
346
+ export interface UpdateVariantArgs extends TargetArgs, WriteArgs {
347
+ sectionKey: string;
348
+ variantKey: string;
349
+ newVariantKey?: string;
350
+ displayName?: string | null;
351
+ description?: string | null;
352
+ status?: 'active' | 'inactive';
353
+ priority?: number;
354
+ validity?: Validity | null;
355
+ }
356
+ export declare function updateContentVariant(strapi: Core.Strapi, args: UpdateVariantArgs, caller: Caller): Promise<{
357
+ dryRun: boolean;
358
+ target: {
359
+ uid: string;
360
+ documentId: string;
361
+ kind: "collectionType" | "singleType";
362
+ localized: boolean;
363
+ locale: string | null;
364
+ };
365
+ before: {
366
+ id: string | null;
367
+ locale: string | null;
368
+ orphaned: boolean;
369
+ source: string | null;
370
+ createdBy: string | null;
371
+ correlationId: string | null;
372
+ createdAt: string | null;
373
+ updatedAt: string | null;
374
+ sectionKey: string;
375
+ variantKey: string;
376
+ blockKey: string;
377
+ isDefault: boolean;
378
+ displayName?: string | null | undefined;
379
+ description?: string | null | undefined;
380
+ status?: import("@zachariaz/experience-context-core").VariationStatus | undefined;
381
+ targetAudiences?: string[] | undefined;
382
+ traits?: string[] | undefined;
383
+ affinities?: string[] | undefined;
384
+ experiment?: {
385
+ key: string;
386
+ outcome: string;
387
+ } | null | undefined;
388
+ priority?: number | null | undefined;
389
+ validity?: Validity | null | undefined;
390
+ componentUid?: string | null | undefined;
391
+ };
392
+ after: {
393
+ id: string | null;
394
+ locale: string | null;
395
+ orphaned: boolean;
396
+ source: string | null;
397
+ createdBy: string | null;
398
+ correlationId: string | null;
399
+ createdAt: string | null;
400
+ updatedAt: string | null;
401
+ sectionKey: string;
402
+ variantKey: string;
403
+ blockKey: string;
404
+ isDefault: boolean;
405
+ displayName?: string | null | undefined;
406
+ description?: string | null | undefined;
407
+ status?: import("@zachariaz/experience-context-core").VariationStatus | undefined;
408
+ targetAudiences?: string[] | undefined;
409
+ traits?: string[] | undefined;
410
+ affinities?: string[] | undefined;
411
+ experiment?: {
412
+ key: string;
413
+ outcome: string;
414
+ } | null | undefined;
415
+ priority?: number | null | undefined;
416
+ validity?: Validity | null | undefined;
417
+ componentUid?: string | null | undefined;
418
+ };
419
+ validation: import("../model/mapping").ValidationReport;
420
+ }>;
421
+ export interface AssociateAudienceArgs extends TargetArgs, WriteArgs {
422
+ sectionKey: string;
423
+ variantKey: string;
424
+ targetAudiences?: string[];
425
+ traits?: string[];
426
+ affinities?: string[];
427
+ mode?: 'replace' | 'add';
428
+ }
429
+ export declare function associateVariantWithAudience(strapi: Core.Strapi, args: AssociateAudienceArgs, caller: Caller): Promise<{
430
+ dryRun: boolean;
431
+ target: {
432
+ uid: string;
433
+ documentId: string;
434
+ kind: "collectionType" | "singleType";
435
+ localized: boolean;
436
+ locale: string | null;
437
+ };
438
+ before: {
439
+ id: string | null;
440
+ locale: string | null;
441
+ orphaned: boolean;
442
+ source: string | null;
443
+ createdBy: string | null;
444
+ correlationId: string | null;
445
+ createdAt: string | null;
446
+ updatedAt: string | null;
447
+ sectionKey: string;
448
+ variantKey: string;
449
+ blockKey: string;
450
+ isDefault: boolean;
451
+ displayName?: string | null | undefined;
452
+ description?: string | null | undefined;
453
+ status?: import("@zachariaz/experience-context-core").VariationStatus | undefined;
454
+ targetAudiences?: string[] | undefined;
455
+ traits?: string[] | undefined;
456
+ affinities?: string[] | undefined;
457
+ experiment?: {
458
+ key: string;
459
+ outcome: string;
460
+ } | null | undefined;
461
+ priority?: number | null | undefined;
462
+ validity?: Validity | null | undefined;
463
+ componentUid?: string | null | undefined;
464
+ };
465
+ after: {
466
+ id: string | null;
467
+ locale: string | null;
468
+ orphaned: boolean;
469
+ source: string | null;
470
+ createdBy: string | null;
471
+ correlationId: string | null;
472
+ createdAt: string | null;
473
+ updatedAt: string | null;
474
+ sectionKey: string;
475
+ variantKey: string;
476
+ blockKey: string;
477
+ isDefault: boolean;
478
+ displayName?: string | null | undefined;
479
+ description?: string | null | undefined;
480
+ status?: import("@zachariaz/experience-context-core").VariationStatus | undefined;
481
+ targetAudiences?: string[] | undefined;
482
+ traits?: string[] | undefined;
483
+ affinities?: string[] | undefined;
484
+ experiment?: {
485
+ key: string;
486
+ outcome: string;
487
+ } | null | undefined;
488
+ priority?: number | null | undefined;
489
+ validity?: Validity | null | undefined;
490
+ componentUid?: string | null | undefined;
491
+ };
492
+ validation: import("../model/mapping").ValidationReport;
493
+ }>;
494
+ export interface AssociateExperimentArgs extends TargetArgs, WriteArgs {
495
+ sectionKey?: string;
496
+ variantKey?: string;
497
+ blockKey?: string;
498
+ experimentKey: string | null;
499
+ outcome?: string;
500
+ }
501
+ export declare function associateVariantWithExperiment(strapi: Core.Strapi, args: AssociateExperimentArgs, caller: Caller): Promise<{
502
+ dryRun: boolean;
503
+ target: {
504
+ uid: string;
505
+ documentId: string;
506
+ kind: "collectionType" | "singleType";
507
+ localized: boolean;
508
+ locale: string | null;
509
+ };
510
+ before: {
511
+ id: string | null;
512
+ locale: string | null;
513
+ orphaned: boolean;
514
+ source: string | null;
515
+ createdBy: string | null;
516
+ correlationId: string | null;
517
+ createdAt: string | null;
518
+ updatedAt: string | null;
519
+ sectionKey: string;
520
+ variantKey: string;
521
+ blockKey: string;
522
+ isDefault: boolean;
523
+ displayName?: string | null | undefined;
524
+ description?: string | null | undefined;
525
+ status?: import("@zachariaz/experience-context-core").VariationStatus | undefined;
526
+ targetAudiences?: string[] | undefined;
527
+ traits?: string[] | undefined;
528
+ affinities?: string[] | undefined;
529
+ experiment?: {
530
+ key: string;
531
+ outcome: string;
532
+ } | null | undefined;
533
+ priority?: number | null | undefined;
534
+ validity?: Validity | null | undefined;
535
+ componentUid?: string | null | undefined;
536
+ };
537
+ after: {
538
+ id: string | null;
539
+ locale: string | null;
540
+ orphaned: boolean;
541
+ source: string | null;
542
+ createdBy: string | null;
543
+ correlationId: string | null;
544
+ createdAt: string | null;
545
+ updatedAt: string | null;
546
+ sectionKey: string;
547
+ variantKey: string;
548
+ blockKey: string;
549
+ isDefault: boolean;
550
+ displayName?: string | null | undefined;
551
+ description?: string | null | undefined;
552
+ status?: import("@zachariaz/experience-context-core").VariationStatus | undefined;
553
+ targetAudiences?: string[] | undefined;
554
+ traits?: string[] | undefined;
555
+ affinities?: string[] | undefined;
556
+ experiment?: {
557
+ key: string;
558
+ outcome: string;
559
+ } | null | undefined;
560
+ priority?: number | null | undefined;
561
+ validity?: Validity | null | undefined;
562
+ componentUid?: string | null | undefined;
563
+ };
564
+ validation: import("../model/mapping").ValidationReport;
565
+ } | {
566
+ dryRun: boolean;
567
+ target: {
568
+ uid: string;
569
+ documentId: string;
570
+ kind: "collectionType" | "singleType";
571
+ localized: boolean;
572
+ locale: string | null;
573
+ };
574
+ before: null;
575
+ after: {
576
+ id: string | null;
577
+ locale: string | null;
578
+ orphaned: boolean;
579
+ source: string | null;
580
+ createdBy: string | null;
581
+ correlationId: string | null;
582
+ createdAt: string | null;
583
+ updatedAt: string | null;
584
+ sectionKey: string;
585
+ variantKey: string;
586
+ blockKey: string;
587
+ isDefault: boolean;
588
+ displayName?: string | null | undefined;
589
+ description?: string | null | undefined;
590
+ status?: import("@zachariaz/experience-context-core").VariationStatus | undefined;
591
+ targetAudiences?: string[] | undefined;
592
+ traits?: string[] | undefined;
593
+ affinities?: string[] | undefined;
594
+ experiment?: {
595
+ key: string;
596
+ outcome: string;
597
+ } | null | undefined;
598
+ priority?: number | null | undefined;
599
+ validity?: Validity | null | undefined;
600
+ componentUid?: string | null | undefined;
601
+ };
602
+ validation: import("../model/mapping").ValidationReport;
603
+ }>;
604
+ export interface SetExperimentArgs extends WriteArgs {
605
+ key: string;
606
+ newKey?: string;
607
+ name?: string | null;
608
+ description?: string | null;
609
+ outcomes?: ExperimentOutcome[];
610
+ controlOutcome?: string;
611
+ status?: 'draft' | 'running' | 'paused' | 'concluded';
612
+ validity?: Validity | null;
613
+ externalId?: string | null;
614
+ }
615
+ export declare function setExperiment(strapi: Core.Strapi, args: SetExperimentArgs, caller: Caller): Promise<{
616
+ dryRun: boolean;
617
+ action: string;
618
+ experiment: import("@zachariaz/experience-context-core").Experiment;
619
+ previous: import("@zachariaz/experience-context-core").Experiment | null;
620
+ mappedBlocks: number;
621
+ validation: {
622
+ ok: boolean;
623
+ errors: import("@zachariaz/experience-context-core").ValidationIssue[];
624
+ warnings: import("@zachariaz/experience-context-core").ValidationIssue[];
625
+ };
626
+ warnings: string[];
627
+ next?: undefined;
628
+ } | {
629
+ dryRun: boolean;
630
+ action: string;
631
+ experiment: import("@zachariaz/experience-context-core").Experiment;
632
+ previous: import("@zachariaz/experience-context-core").Experiment | null;
633
+ mappedBlocks: number;
634
+ validation: {
635
+ ok: boolean;
636
+ errors: import("@zachariaz/experience-context-core").ValidationIssue[];
637
+ warnings: import("@zachariaz/experience-context-core").ValidationIssue[];
638
+ };
639
+ warnings: string[];
640
+ next: string[];
641
+ }>;
642
+ export interface ConcludeArgs extends WriteArgs {
643
+ key: string;
644
+ winner: string;
645
+ cleanup?: boolean;
646
+ }
647
+ export declare function concludeExperiment(strapi: Core.Strapi, args: ConcludeArgs, caller: Caller): Promise<{
648
+ dryRun: boolean;
649
+ experiment: import("@zachariaz/experience-context-core").Experiment;
650
+ previous: import("@zachariaz/experience-context-core").Experiment;
651
+ cleanup: {
652
+ targetUid: string;
653
+ targetDocumentId: string;
654
+ locale: string | null;
655
+ removedBlocks: {
656
+ sectionKey: string;
657
+ variantKey: string;
658
+ blockKey: string;
659
+ outcome: string;
660
+ }[];
661
+ keptBlocks: {
662
+ sectionKey: string;
663
+ variantKey: string;
664
+ blockKey: string;
665
+ isDefault: boolean;
666
+ }[];
667
+ }[];
668
+ warnings: import("@zachariaz/experience-context-core").ValidationIssue[];
669
+ }>;
670
+ export interface AnnotateArgs extends TargetArgs, WriteArgs {
671
+ blockKey?: string | null;
672
+ concepts: string[];
673
+ mode?: 'replace' | 'add' | 'remove';
674
+ }
675
+ export declare function annotateContentWithConcepts(strapi: Core.Strapi, args: AnnotateArgs, caller: Caller): Promise<{
676
+ target: {
677
+ uid: string;
678
+ documentId: string;
679
+ kind: "collectionType" | "singleType";
680
+ localized: boolean;
681
+ locale: string | null;
682
+ };
683
+ locale: string | null;
684
+ blockKey: string | null;
685
+ before: string[];
686
+ concepts: string[];
687
+ validation: import("../model/mapping").ValidationReport;
688
+ dryRun: boolean;
689
+ }>;
690
+ export interface RemoveArgs extends WriteArgs {
691
+ kind: 'variation' | 'section' | 'annotation' | 'experiment';
692
+ targetUid?: string;
693
+ targetDocumentId?: string;
694
+ locale?: string | null;
695
+ sectionKey?: string;
696
+ variantKey?: string;
697
+ blockKey?: string | null;
698
+ experimentKey?: string;
699
+ deleteBlocks?: boolean;
700
+ }
701
+ export declare function removeMapping(strapi: Core.Strapi, args: RemoveArgs, caller: Caller): Promise<{
702
+ dryRun: boolean;
703
+ removed: {
704
+ experiment: import("@zachariaz/experience-context-core").Experiment;
705
+ annotation?: undefined;
706
+ };
707
+ } | {
708
+ dryRun: boolean;
709
+ removed: {
710
+ annotation: {
711
+ blockKey: string | null;
712
+ locale: string | null;
713
+ concepts: string[];
714
+ };
715
+ experiment?: undefined;
716
+ };
717
+ } | {
718
+ target: {
719
+ uid: string;
720
+ documentId: string;
721
+ kind: "collectionType" | "singleType";
722
+ localized: boolean;
723
+ locale: string | null;
724
+ };
725
+ removed: {
726
+ variations: {
727
+ id: string | null;
728
+ locale: string | null;
729
+ orphaned: boolean;
730
+ source: string | null;
731
+ createdBy: string | null;
732
+ correlationId: string | null;
733
+ createdAt: string | null;
734
+ updatedAt: string | null;
735
+ sectionKey: string;
736
+ variantKey: string;
737
+ blockKey: string;
738
+ isDefault: boolean;
739
+ displayName?: string | null | undefined;
740
+ description?: string | null | undefined;
741
+ status?: import("@zachariaz/experience-context-core").VariationStatus | undefined;
742
+ targetAudiences?: string[] | undefined;
743
+ traits?: string[] | undefined;
744
+ affinities?: string[] | undefined;
745
+ experiment?: {
746
+ key: string;
747
+ outcome: string;
748
+ } | null | undefined;
749
+ priority?: number | null | undefined;
750
+ validity?: Validity | null | undefined;
751
+ componentUid?: string | null | undefined;
752
+ }[];
753
+ blocks: string[];
754
+ };
755
+ keptBlocks: string[];
756
+ validation: import("../model/mapping").ValidationReport;
757
+ dryRun: boolean;
758
+ }>;
759
+ export declare function backfillBlockKeys(strapi: Core.Strapi, args: {
760
+ dryRun?: boolean;
761
+ contentTypes?: string[];
762
+ documentId?: string;
763
+ locales?: string[];
764
+ }): Promise<import("../block-keys").BackfillReport>;
765
+ export {};