@bernierllc/content-management-suite 0.6.0 → 0.7.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,1234 @@
1
+ import { z } from 'zod';
2
+
3
+ declare const ContentManagementConfigSchema: z.ZodObject<{
4
+ content: z.ZodDefault<z.ZodObject<{
5
+ defaultWorkflow: z.ZodDefault<z.ZodObject<{
6
+ id: z.ZodDefault<z.ZodString>;
7
+ name: z.ZodDefault<z.ZodString>;
8
+ description: z.ZodDefault<z.ZodString>;
9
+ stages: z.ZodDefault<z.ZodArray<z.ZodObject<{
10
+ id: z.ZodString;
11
+ name: z.ZodString;
12
+ order: z.ZodNumber;
13
+ isPublishStage: z.ZodDefault<z.ZodBoolean>;
14
+ allowsScheduling: z.ZodDefault<z.ZodBoolean>;
15
+ description: z.ZodOptional<z.ZodString>;
16
+ permissions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
17
+ }, "strip", z.ZodTypeAny, {
18
+ id: string;
19
+ name: string;
20
+ order: number;
21
+ isPublishStage: boolean;
22
+ allowsScheduling: boolean;
23
+ permissions: string[];
24
+ description?: string | undefined;
25
+ }, {
26
+ id: string;
27
+ name: string;
28
+ order: number;
29
+ description?: string | undefined;
30
+ isPublishStage?: boolean | undefined;
31
+ allowsScheduling?: boolean | undefined;
32
+ permissions?: string[] | undefined;
33
+ }>, "many">>;
34
+ transitions: z.ZodDefault<z.ZodArray<z.ZodObject<{
35
+ id: z.ZodString;
36
+ from: z.ZodString;
37
+ to: z.ZodString;
38
+ description: z.ZodOptional<z.ZodString>;
39
+ permissions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
40
+ }, "strip", z.ZodTypeAny, {
41
+ id: string;
42
+ permissions: string[];
43
+ from: string;
44
+ to: string;
45
+ description?: string | undefined;
46
+ }, {
47
+ id: string;
48
+ from: string;
49
+ to: string;
50
+ description?: string | undefined;
51
+ permissions?: string[] | undefined;
52
+ }>, "many">>;
53
+ }, "strip", z.ZodTypeAny, {
54
+ id: string;
55
+ name: string;
56
+ description: string;
57
+ stages: {
58
+ id: string;
59
+ name: string;
60
+ order: number;
61
+ isPublishStage: boolean;
62
+ allowsScheduling: boolean;
63
+ permissions: string[];
64
+ description?: string | undefined;
65
+ }[];
66
+ transitions: {
67
+ id: string;
68
+ permissions: string[];
69
+ from: string;
70
+ to: string;
71
+ description?: string | undefined;
72
+ }[];
73
+ }, {
74
+ id?: string | undefined;
75
+ name?: string | undefined;
76
+ description?: string | undefined;
77
+ stages?: {
78
+ id: string;
79
+ name: string;
80
+ order: number;
81
+ description?: string | undefined;
82
+ isPublishStage?: boolean | undefined;
83
+ allowsScheduling?: boolean | undefined;
84
+ permissions?: string[] | undefined;
85
+ }[] | undefined;
86
+ transitions?: {
87
+ id: string;
88
+ from: string;
89
+ to: string;
90
+ description?: string | undefined;
91
+ permissions?: string[] | undefined;
92
+ }[] | undefined;
93
+ }>>;
94
+ contentTypes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
95
+ autoSave: z.ZodDefault<z.ZodObject<{
96
+ enabled: z.ZodDefault<z.ZodBoolean>;
97
+ debounceMs: z.ZodDefault<z.ZodNumber>;
98
+ maxRetries: z.ZodDefault<z.ZodNumber>;
99
+ backoffMs: z.ZodDefault<z.ZodNumber>;
100
+ }, "strip", z.ZodTypeAny, {
101
+ enabled: boolean;
102
+ debounceMs: number;
103
+ maxRetries: number;
104
+ backoffMs: number;
105
+ }, {
106
+ enabled?: boolean | undefined;
107
+ debounceMs?: number | undefined;
108
+ maxRetries?: number | undefined;
109
+ backoffMs?: number | undefined;
110
+ }>>;
111
+ softDelete: z.ZodDefault<z.ZodObject<{
112
+ enabled: z.ZodDefault<z.ZodBoolean>;
113
+ showDeletedToUsers: z.ZodDefault<z.ZodBoolean>;
114
+ retentionDays: z.ZodDefault<z.ZodNumber>;
115
+ }, "strip", z.ZodTypeAny, {
116
+ enabled: boolean;
117
+ showDeletedToUsers: boolean;
118
+ retentionDays: number;
119
+ }, {
120
+ enabled?: boolean | undefined;
121
+ showDeletedToUsers?: boolean | undefined;
122
+ retentionDays?: number | undefined;
123
+ }>>;
124
+ upload: z.ZodDefault<z.ZodObject<{
125
+ maxFileSize: z.ZodDefault<z.ZodNumber>;
126
+ allowedTypes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
127
+ storage: z.ZodOptional<z.ZodDefault<z.ZodObject<{
128
+ type: z.ZodDefault<z.ZodEnum<["local", "s3"]>>;
129
+ path: z.ZodDefault<z.ZodString>;
130
+ bucket: z.ZodOptional<z.ZodString>;
131
+ region: z.ZodOptional<z.ZodString>;
132
+ }, "strip", z.ZodTypeAny, {
133
+ path: string;
134
+ type: "local" | "s3";
135
+ bucket?: string | undefined;
136
+ region?: string | undefined;
137
+ }, {
138
+ path?: string | undefined;
139
+ type?: "local" | "s3" | undefined;
140
+ bucket?: string | undefined;
141
+ region?: string | undefined;
142
+ }>>>;
143
+ }, "strip", z.ZodTypeAny, {
144
+ maxFileSize: number;
145
+ allowedTypes: string[];
146
+ storage?: {
147
+ path: string;
148
+ type: "local" | "s3";
149
+ bucket?: string | undefined;
150
+ region?: string | undefined;
151
+ } | undefined;
152
+ }, {
153
+ maxFileSize?: number | undefined;
154
+ allowedTypes?: string[] | undefined;
155
+ storage?: {
156
+ path?: string | undefined;
157
+ type?: "local" | "s3" | undefined;
158
+ bucket?: string | undefined;
159
+ region?: string | undefined;
160
+ } | undefined;
161
+ }>>;
162
+ }, "strip", z.ZodTypeAny, {
163
+ defaultWorkflow: {
164
+ id: string;
165
+ name: string;
166
+ description: string;
167
+ stages: {
168
+ id: string;
169
+ name: string;
170
+ order: number;
171
+ isPublishStage: boolean;
172
+ allowsScheduling: boolean;
173
+ permissions: string[];
174
+ description?: string | undefined;
175
+ }[];
176
+ transitions: {
177
+ id: string;
178
+ permissions: string[];
179
+ from: string;
180
+ to: string;
181
+ description?: string | undefined;
182
+ }[];
183
+ };
184
+ contentTypes: string[];
185
+ autoSave: {
186
+ enabled: boolean;
187
+ debounceMs: number;
188
+ maxRetries: number;
189
+ backoffMs: number;
190
+ };
191
+ softDelete: {
192
+ enabled: boolean;
193
+ showDeletedToUsers: boolean;
194
+ retentionDays: number;
195
+ };
196
+ upload: {
197
+ maxFileSize: number;
198
+ allowedTypes: string[];
199
+ storage?: {
200
+ path: string;
201
+ type: "local" | "s3";
202
+ bucket?: string | undefined;
203
+ region?: string | undefined;
204
+ } | undefined;
205
+ };
206
+ }, {
207
+ defaultWorkflow?: {
208
+ id?: string | undefined;
209
+ name?: string | undefined;
210
+ description?: string | undefined;
211
+ stages?: {
212
+ id: string;
213
+ name: string;
214
+ order: number;
215
+ description?: string | undefined;
216
+ isPublishStage?: boolean | undefined;
217
+ allowsScheduling?: boolean | undefined;
218
+ permissions?: string[] | undefined;
219
+ }[] | undefined;
220
+ transitions?: {
221
+ id: string;
222
+ from: string;
223
+ to: string;
224
+ description?: string | undefined;
225
+ permissions?: string[] | undefined;
226
+ }[] | undefined;
227
+ } | undefined;
228
+ contentTypes?: string[] | undefined;
229
+ autoSave?: {
230
+ enabled?: boolean | undefined;
231
+ debounceMs?: number | undefined;
232
+ maxRetries?: number | undefined;
233
+ backoffMs?: number | undefined;
234
+ } | undefined;
235
+ softDelete?: {
236
+ enabled?: boolean | undefined;
237
+ showDeletedToUsers?: boolean | undefined;
238
+ retentionDays?: number | undefined;
239
+ } | undefined;
240
+ upload?: {
241
+ maxFileSize?: number | undefined;
242
+ allowedTypes?: string[] | undefined;
243
+ storage?: {
244
+ path?: string | undefined;
245
+ type?: "local" | "s3" | undefined;
246
+ bucket?: string | undefined;
247
+ region?: string | undefined;
248
+ } | undefined;
249
+ } | undefined;
250
+ }>>;
251
+ database: z.ZodDefault<z.ZodObject<{
252
+ type: z.ZodDefault<z.ZodEnum<["sqlite", "postgresql", "mysql", "mongodb"]>>;
253
+ url: z.ZodOptional<z.ZodString>;
254
+ host: z.ZodDefault<z.ZodString>;
255
+ port: z.ZodOptional<z.ZodNumber>;
256
+ name: z.ZodDefault<z.ZodString>;
257
+ username: z.ZodOptional<z.ZodString>;
258
+ password: z.ZodOptional<z.ZodString>;
259
+ ssl: z.ZodDefault<z.ZodBoolean>;
260
+ pool: z.ZodDefault<z.ZodObject<{
261
+ min: z.ZodDefault<z.ZodNumber>;
262
+ max: z.ZodDefault<z.ZodNumber>;
263
+ idleTimeoutMs: z.ZodOptional<z.ZodNumber>;
264
+ }, "strip", z.ZodTypeAny, {
265
+ min: number;
266
+ max: number;
267
+ idleTimeoutMs?: number | undefined;
268
+ }, {
269
+ min?: number | undefined;
270
+ max?: number | undefined;
271
+ idleTimeoutMs?: number | undefined;
272
+ }>>;
273
+ }, "strip", z.ZodTypeAny, {
274
+ name: string;
275
+ type: "sqlite" | "postgresql" | "mysql" | "mongodb";
276
+ host: string;
277
+ ssl: boolean;
278
+ pool: {
279
+ min: number;
280
+ max: number;
281
+ idleTimeoutMs?: number | undefined;
282
+ };
283
+ url?: string | undefined;
284
+ port?: number | undefined;
285
+ username?: string | undefined;
286
+ password?: string | undefined;
287
+ }, {
288
+ name?: string | undefined;
289
+ type?: "sqlite" | "postgresql" | "mysql" | "mongodb" | undefined;
290
+ url?: string | undefined;
291
+ host?: string | undefined;
292
+ port?: number | undefined;
293
+ username?: string | undefined;
294
+ password?: string | undefined;
295
+ ssl?: boolean | undefined;
296
+ pool?: {
297
+ min?: number | undefined;
298
+ max?: number | undefined;
299
+ idleTimeoutMs?: number | undefined;
300
+ } | undefined;
301
+ }>>;
302
+ integrations: z.ZodDefault<z.ZodObject<{
303
+ neverAdmin: z.ZodDefault<z.ZodObject<{
304
+ enabled: z.ZodDefault<z.ZodBoolean>;
305
+ endpoint: z.ZodOptional<z.ZodString>;
306
+ }, "strip", z.ZodTypeAny, {
307
+ enabled: boolean;
308
+ endpoint?: string | undefined;
309
+ }, {
310
+ enabled?: boolean | undefined;
311
+ endpoint?: string | undefined;
312
+ }>>;
313
+ neverHub: z.ZodDefault<z.ZodObject<{
314
+ enabled: z.ZodDefault<z.ZodBoolean>;
315
+ endpoint: z.ZodOptional<z.ZodString>;
316
+ }, "strip", z.ZodTypeAny, {
317
+ enabled: boolean;
318
+ endpoint?: string | undefined;
319
+ }, {
320
+ enabled?: boolean | undefined;
321
+ endpoint?: string | undefined;
322
+ }>>;
323
+ analytics: z.ZodDefault<z.ZodObject<{
324
+ enabled: z.ZodDefault<z.ZodBoolean>;
325
+ provider: z.ZodOptional<z.ZodString>;
326
+ }, "strip", z.ZodTypeAny, {
327
+ enabled: boolean;
328
+ provider?: string | undefined;
329
+ }, {
330
+ enabled?: boolean | undefined;
331
+ provider?: string | undefined;
332
+ }>>;
333
+ }, "strip", z.ZodTypeAny, {
334
+ neverAdmin: {
335
+ enabled: boolean;
336
+ endpoint?: string | undefined;
337
+ };
338
+ neverHub: {
339
+ enabled: boolean;
340
+ endpoint?: string | undefined;
341
+ };
342
+ analytics: {
343
+ enabled: boolean;
344
+ provider?: string | undefined;
345
+ };
346
+ }, {
347
+ neverAdmin?: {
348
+ enabled?: boolean | undefined;
349
+ endpoint?: string | undefined;
350
+ } | undefined;
351
+ neverHub?: {
352
+ enabled?: boolean | undefined;
353
+ endpoint?: string | undefined;
354
+ } | undefined;
355
+ analytics?: {
356
+ enabled?: boolean | undefined;
357
+ provider?: string | undefined;
358
+ } | undefined;
359
+ }>>;
360
+ security: z.ZodDefault<z.ZodObject<{
361
+ permissions: z.ZodDefault<z.ZodObject<{
362
+ enabled: z.ZodDefault<z.ZodBoolean>;
363
+ defaultRole: z.ZodDefault<z.ZodString>;
364
+ }, "strip", z.ZodTypeAny, {
365
+ enabled: boolean;
366
+ defaultRole: string;
367
+ }, {
368
+ enabled?: boolean | undefined;
369
+ defaultRole?: string | undefined;
370
+ }>>;
371
+ roles: z.ZodDefault<z.ZodArray<z.ZodObject<{
372
+ name: z.ZodString;
373
+ permissions: z.ZodArray<z.ZodString, "many">;
374
+ description: z.ZodOptional<z.ZodString>;
375
+ }, "strip", z.ZodTypeAny, {
376
+ name: string;
377
+ permissions: string[];
378
+ description?: string | undefined;
379
+ }, {
380
+ name: string;
381
+ permissions: string[];
382
+ description?: string | undefined;
383
+ }>, "many">>;
384
+ }, "strip", z.ZodTypeAny, {
385
+ permissions: {
386
+ enabled: boolean;
387
+ defaultRole: string;
388
+ };
389
+ roles: {
390
+ name: string;
391
+ permissions: string[];
392
+ description?: string | undefined;
393
+ }[];
394
+ }, {
395
+ permissions?: {
396
+ enabled?: boolean | undefined;
397
+ defaultRole?: string | undefined;
398
+ } | undefined;
399
+ roles?: {
400
+ name: string;
401
+ permissions: string[];
402
+ description?: string | undefined;
403
+ }[] | undefined;
404
+ }>>;
405
+ workflows: z.ZodDefault<z.ZodObject<{
406
+ defaults: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
407
+ }, "strip", z.ZodTypeAny, {
408
+ defaults: Record<string, string>;
409
+ }, {
410
+ defaults?: Record<string, string> | undefined;
411
+ }>>;
412
+ logging: z.ZodDefault<z.ZodObject<{
413
+ level: z.ZodDefault<z.ZodEnum<["error", "warn", "info", "debug"]>>;
414
+ }, "strip", z.ZodTypeAny, {
415
+ level: "error" | "warn" | "info" | "debug";
416
+ }, {
417
+ level?: "error" | "warn" | "info" | "debug" | undefined;
418
+ }>>;
419
+ performance: z.ZodDefault<z.ZodObject<{
420
+ cache: z.ZodDefault<z.ZodObject<{
421
+ enabled: z.ZodDefault<z.ZodBoolean>;
422
+ ttl: z.ZodDefault<z.ZodNumber>;
423
+ maxSize: z.ZodDefault<z.ZodNumber>;
424
+ }, "strip", z.ZodTypeAny, {
425
+ enabled: boolean;
426
+ ttl: number;
427
+ maxSize: number;
428
+ }, {
429
+ enabled?: boolean | undefined;
430
+ ttl?: number | undefined;
431
+ maxSize?: number | undefined;
432
+ }>>;
433
+ }, "strip", z.ZodTypeAny, {
434
+ cache: {
435
+ enabled: boolean;
436
+ ttl: number;
437
+ maxSize: number;
438
+ };
439
+ }, {
440
+ cache?: {
441
+ enabled?: boolean | undefined;
442
+ ttl?: number | undefined;
443
+ maxSize?: number | undefined;
444
+ } | undefined;
445
+ }>>;
446
+ }, "strip", z.ZodTypeAny, {
447
+ content: {
448
+ defaultWorkflow: {
449
+ id: string;
450
+ name: string;
451
+ description: string;
452
+ stages: {
453
+ id: string;
454
+ name: string;
455
+ order: number;
456
+ isPublishStage: boolean;
457
+ allowsScheduling: boolean;
458
+ permissions: string[];
459
+ description?: string | undefined;
460
+ }[];
461
+ transitions: {
462
+ id: string;
463
+ permissions: string[];
464
+ from: string;
465
+ to: string;
466
+ description?: string | undefined;
467
+ }[];
468
+ };
469
+ contentTypes: string[];
470
+ autoSave: {
471
+ enabled: boolean;
472
+ debounceMs: number;
473
+ maxRetries: number;
474
+ backoffMs: number;
475
+ };
476
+ softDelete: {
477
+ enabled: boolean;
478
+ showDeletedToUsers: boolean;
479
+ retentionDays: number;
480
+ };
481
+ upload: {
482
+ maxFileSize: number;
483
+ allowedTypes: string[];
484
+ storage?: {
485
+ path: string;
486
+ type: "local" | "s3";
487
+ bucket?: string | undefined;
488
+ region?: string | undefined;
489
+ } | undefined;
490
+ };
491
+ };
492
+ database: {
493
+ name: string;
494
+ type: "sqlite" | "postgresql" | "mysql" | "mongodb";
495
+ host: string;
496
+ ssl: boolean;
497
+ pool: {
498
+ min: number;
499
+ max: number;
500
+ idleTimeoutMs?: number | undefined;
501
+ };
502
+ url?: string | undefined;
503
+ port?: number | undefined;
504
+ username?: string | undefined;
505
+ password?: string | undefined;
506
+ };
507
+ integrations: {
508
+ neverAdmin: {
509
+ enabled: boolean;
510
+ endpoint?: string | undefined;
511
+ };
512
+ neverHub: {
513
+ enabled: boolean;
514
+ endpoint?: string | undefined;
515
+ };
516
+ analytics: {
517
+ enabled: boolean;
518
+ provider?: string | undefined;
519
+ };
520
+ };
521
+ security: {
522
+ permissions: {
523
+ enabled: boolean;
524
+ defaultRole: string;
525
+ };
526
+ roles: {
527
+ name: string;
528
+ permissions: string[];
529
+ description?: string | undefined;
530
+ }[];
531
+ };
532
+ workflows: {
533
+ defaults: Record<string, string>;
534
+ };
535
+ logging: {
536
+ level: "error" | "warn" | "info" | "debug";
537
+ };
538
+ performance: {
539
+ cache: {
540
+ enabled: boolean;
541
+ ttl: number;
542
+ maxSize: number;
543
+ };
544
+ };
545
+ }, {
546
+ content?: {
547
+ defaultWorkflow?: {
548
+ id?: string | undefined;
549
+ name?: string | undefined;
550
+ description?: string | undefined;
551
+ stages?: {
552
+ id: string;
553
+ name: string;
554
+ order: number;
555
+ description?: string | undefined;
556
+ isPublishStage?: boolean | undefined;
557
+ allowsScheduling?: boolean | undefined;
558
+ permissions?: string[] | undefined;
559
+ }[] | undefined;
560
+ transitions?: {
561
+ id: string;
562
+ from: string;
563
+ to: string;
564
+ description?: string | undefined;
565
+ permissions?: string[] | undefined;
566
+ }[] | undefined;
567
+ } | undefined;
568
+ contentTypes?: string[] | undefined;
569
+ autoSave?: {
570
+ enabled?: boolean | undefined;
571
+ debounceMs?: number | undefined;
572
+ maxRetries?: number | undefined;
573
+ backoffMs?: number | undefined;
574
+ } | undefined;
575
+ softDelete?: {
576
+ enabled?: boolean | undefined;
577
+ showDeletedToUsers?: boolean | undefined;
578
+ retentionDays?: number | undefined;
579
+ } | undefined;
580
+ upload?: {
581
+ maxFileSize?: number | undefined;
582
+ allowedTypes?: string[] | undefined;
583
+ storage?: {
584
+ path?: string | undefined;
585
+ type?: "local" | "s3" | undefined;
586
+ bucket?: string | undefined;
587
+ region?: string | undefined;
588
+ } | undefined;
589
+ } | undefined;
590
+ } | undefined;
591
+ database?: {
592
+ name?: string | undefined;
593
+ type?: "sqlite" | "postgresql" | "mysql" | "mongodb" | undefined;
594
+ url?: string | undefined;
595
+ host?: string | undefined;
596
+ port?: number | undefined;
597
+ username?: string | undefined;
598
+ password?: string | undefined;
599
+ ssl?: boolean | undefined;
600
+ pool?: {
601
+ min?: number | undefined;
602
+ max?: number | undefined;
603
+ idleTimeoutMs?: number | undefined;
604
+ } | undefined;
605
+ } | undefined;
606
+ integrations?: {
607
+ neverAdmin?: {
608
+ enabled?: boolean | undefined;
609
+ endpoint?: string | undefined;
610
+ } | undefined;
611
+ neverHub?: {
612
+ enabled?: boolean | undefined;
613
+ endpoint?: string | undefined;
614
+ } | undefined;
615
+ analytics?: {
616
+ enabled?: boolean | undefined;
617
+ provider?: string | undefined;
618
+ } | undefined;
619
+ } | undefined;
620
+ security?: {
621
+ permissions?: {
622
+ enabled?: boolean | undefined;
623
+ defaultRole?: string | undefined;
624
+ } | undefined;
625
+ roles?: {
626
+ name: string;
627
+ permissions: string[];
628
+ description?: string | undefined;
629
+ }[] | undefined;
630
+ } | undefined;
631
+ workflows?: {
632
+ defaults?: Record<string, string> | undefined;
633
+ } | undefined;
634
+ logging?: {
635
+ level?: "error" | "warn" | "info" | "debug" | undefined;
636
+ } | undefined;
637
+ performance?: {
638
+ cache?: {
639
+ enabled?: boolean | undefined;
640
+ ttl?: number | undefined;
641
+ maxSize?: number | undefined;
642
+ } | undefined;
643
+ } | undefined;
644
+ }>;
645
+ type ContentManagementConfig = z.infer<typeof ContentManagementConfigSchema>;
646
+
647
+ declare class ContentManagementError extends Error {
648
+ readonly code: string;
649
+ readonly details?: Record<string, unknown>;
650
+ constructor(message: string, options?: {
651
+ cause?: Error;
652
+ code?: string;
653
+ details?: Record<string, unknown>;
654
+ });
655
+ }
656
+ declare class ValidationError extends ContentManagementError {
657
+ constructor(message: string, options?: {
658
+ cause?: Error;
659
+ details?: Record<string, unknown>;
660
+ });
661
+ }
662
+ declare class NotFoundError extends ContentManagementError {
663
+ constructor(message: string, options?: {
664
+ cause?: Error;
665
+ details?: Record<string, unknown>;
666
+ });
667
+ }
668
+ declare class UnauthorizedError extends ContentManagementError {
669
+ constructor(message: string, options?: {
670
+ cause?: Error;
671
+ details?: Record<string, unknown>;
672
+ });
673
+ }
674
+ declare class ForbiddenError extends ContentManagementError {
675
+ constructor(message: string, options?: {
676
+ cause?: Error;
677
+ details?: Record<string, unknown>;
678
+ });
679
+ }
680
+ declare class ConflictError extends ContentManagementError {
681
+ constructor(message: string, options?: {
682
+ cause?: Error;
683
+ details?: Record<string, unknown>;
684
+ });
685
+ }
686
+ declare class InternalError extends ContentManagementError {
687
+ constructor(message: string, options?: {
688
+ cause?: Error;
689
+ details?: Record<string, unknown>;
690
+ });
691
+ }
692
+
693
+ interface AIReviewServiceResult {
694
+ overallScore: number;
695
+ issues: Array<{
696
+ category: string;
697
+ severity: string;
698
+ message: string;
699
+ originalText?: string;
700
+ suggestedFix?: string;
701
+ }>;
702
+ passesThreshold: boolean;
703
+ raw: Record<string, unknown>;
704
+ }
705
+ interface AIReviewService {
706
+ review(content: string, options?: Record<string, unknown>): Promise<AIReviewServiceResult>;
707
+ }
708
+ interface AISocialGeneratorService {
709
+ generate(content: string, platforms: string[]): Promise<Array<{
710
+ platform: string;
711
+ body: string;
712
+ }>>;
713
+ }
714
+ interface EnhanceOptions {
715
+ tone?: string;
716
+ style?: string;
717
+ instructions?: string;
718
+ }
719
+ interface EnhancedContent {
720
+ original: string;
721
+ enhanced: string;
722
+ changes: Array<{
723
+ type: string;
724
+ description: string;
725
+ }>;
726
+ }
727
+ interface Suggestion {
728
+ category: string;
729
+ severity: 'info' | 'warning' | 'error';
730
+ message: string;
731
+ suggestedFix?: string;
732
+ }
733
+ interface AIEnhanceService {
734
+ enhance(content: string, opts?: EnhanceOptions): Promise<EnhancedContent>;
735
+ suggest(content: string): Promise<Suggestion[]>;
736
+ }
737
+ interface PublishResult {
738
+ channelId: string;
739
+ success: boolean;
740
+ url?: string;
741
+ error?: string;
742
+ }
743
+ interface ContentPublishResult {
744
+ item: ContentItem;
745
+ results: PublishResult[];
746
+ }
747
+ interface PreviewResult {
748
+ html?: string;
749
+ url?: string;
750
+ text?: string;
751
+ }
752
+ interface ContentPublisher {
753
+ id: string;
754
+ name: string;
755
+ acceptedTypes: string[];
756
+ publish(content: ContentItem): Promise<PublishResult>;
757
+ validate?(content: ContentItem): Promise<Array<{
758
+ field: string;
759
+ message: string;
760
+ }>>;
761
+ preview?(content: ContentItem): Promise<PreviewResult>;
762
+ }
763
+ interface IngestResult {
764
+ created: boolean;
765
+ content: ContentItem;
766
+ }
767
+ interface ContentSource {
768
+ id: string;
769
+ name: string;
770
+ outputTypes: string[];
771
+ ingest(rawPayload: unknown): Promise<ContentItem>;
772
+ validate?(rawPayload: unknown): Promise<Array<{
773
+ field: string;
774
+ message: string;
775
+ }>>;
776
+ }
777
+ interface PlatformPublishResult {
778
+ platform: string;
779
+ success: boolean;
780
+ platformPostId?: string;
781
+ url?: string;
782
+ error?: string;
783
+ }
784
+ interface SocialMetrics {
785
+ platform: string;
786
+ platformPostId: string;
787
+ impressions?: number;
788
+ engagement?: number;
789
+ clicks?: number;
790
+ shares?: number;
791
+ raw?: Record<string, unknown>;
792
+ }
793
+ interface PlatformInfo {
794
+ id: string;
795
+ name: string;
796
+ acceptedTypes: string[];
797
+ hasPreview: boolean;
798
+ hasMetrics: boolean;
799
+ }
800
+ interface SocialPlatformAdapter {
801
+ id: string;
802
+ name: string;
803
+ acceptedTypes: string[];
804
+ publish(post: SocialPost): Promise<PlatformPublishResult>;
805
+ preview?(post: SocialPost): Promise<PreviewResult>;
806
+ getMetrics?(platformPostId: string): Promise<SocialMetrics>;
807
+ }
808
+ interface SchemaValidationResult {
809
+ valid: boolean;
810
+ errors?: Array<{
811
+ message: string;
812
+ path?: string[];
813
+ }>;
814
+ }
815
+ interface AIReviewSuggestion$1 {
816
+ category: string;
817
+ severity: 'info' | 'warning' | 'error';
818
+ message: string;
819
+ originalText?: string;
820
+ suggestedFix?: string;
821
+ }
822
+ interface ContentTypeDefinition {
823
+ id: string;
824
+ name: string;
825
+ schema: unknown;
826
+ defaults?: Record<string, unknown>;
827
+ description?: string;
828
+ }
829
+ interface StageConditions {
830
+ autoAdvance?: boolean;
831
+ minScore?: number;
832
+ requiresHumanReview?: boolean;
833
+ }
834
+
835
+ interface StoredContentTypeDefinition {
836
+ id: string;
837
+ name: string;
838
+ jsonSchema: Record<string, unknown>;
839
+ defaults?: Record<string, unknown>;
840
+ description?: string;
841
+ }
842
+ interface ContentStorageNamespace {
843
+ list(filters?: ContentFilters): Promise<PaginatedResult<ContentItem>>;
844
+ get(id: string): Promise<ContentItem | null>;
845
+ create(item: ContentItem): Promise<ContentItem>;
846
+ update(id: string, partial: Partial<ContentItem>): Promise<ContentItem>;
847
+ delete(id: string): Promise<void>;
848
+ findBySource(sourceType: string, sourceId: string): Promise<ContentItem | null>;
849
+ search(query: string, options?: SearchOptions): Promise<PaginatedResult<ContentItem>>;
850
+ }
851
+ interface WorkflowStorageNamespace {
852
+ list(): Promise<Workflow[]>;
853
+ get(id: string): Promise<Workflow | null>;
854
+ create(workflow: Workflow): Promise<Workflow>;
855
+ update(id: string, partial: Partial<Workflow>): Promise<Workflow>;
856
+ delete(id: string): Promise<void>;
857
+ findByContentType(contentType: string): Promise<Workflow | null>;
858
+ }
859
+ interface ContentTypeStorageNamespace {
860
+ list(): Promise<StoredContentTypeDefinition[]>;
861
+ get(id: string): Promise<StoredContentTypeDefinition | null>;
862
+ create(def: StoredContentTypeDefinition): Promise<StoredContentTypeDefinition>;
863
+ update(id: string, partial: Partial<StoredContentTypeDefinition>): Promise<StoredContentTypeDefinition>;
864
+ delete(id: string): Promise<void>;
865
+ }
866
+ interface SocialPostStorageNamespace {
867
+ list(filters?: {
868
+ contentId?: string;
869
+ platform?: string;
870
+ status?: string;
871
+ }): Promise<SocialPost[]>;
872
+ get(id: string): Promise<SocialPost | null>;
873
+ create(post: SocialPost): Promise<SocialPost>;
874
+ update(id: string, partial: Partial<SocialPost>): Promise<SocialPost>;
875
+ delete(id: string): Promise<void>;
876
+ findByContent(contentId: string): Promise<SocialPost[]>;
877
+ }
878
+ interface AIReviewStorageNamespace {
879
+ list(filters?: {
880
+ contentId?: string;
881
+ }): Promise<AIReview[]>;
882
+ get(id: string): Promise<AIReview | null>;
883
+ create(review: AIReview): Promise<AIReview>;
884
+ findByContent(contentId: string): Promise<AIReview[]>;
885
+ getLatestForContent(contentId: string): Promise<AIReview | null>;
886
+ }
887
+ interface ScheduleStorageNamespace {
888
+ list(): Promise<unknown[]>;
889
+ get(id: string): Promise<unknown | null>;
890
+ create(schedule: unknown): Promise<unknown>;
891
+ update(id: string, partial: unknown): Promise<unknown>;
892
+ delete(id: string): Promise<void>;
893
+ }
894
+ interface MediaStorageNamespace {
895
+ list(): Promise<unknown[]>;
896
+ get(id: string): Promise<unknown | null>;
897
+ create(media: unknown): Promise<unknown>;
898
+ delete(id: string): Promise<void>;
899
+ }
900
+ interface AnalyticsStorageNamespace {
901
+ record(event: unknown): Promise<void>;
902
+ query(filter: unknown): Promise<unknown[]>;
903
+ }
904
+ interface ContentStorageAdapter {
905
+ content: ContentStorageNamespace;
906
+ workflows: WorkflowStorageNamespace;
907
+ contentTypes: ContentTypeStorageNamespace;
908
+ socialPosts: SocialPostStorageNamespace;
909
+ aiReviews: AIReviewStorageNamespace;
910
+ schedules?: ScheduleStorageNamespace;
911
+ media?: MediaStorageNamespace;
912
+ analytics?: AnalyticsStorageNamespace;
913
+ }
914
+
915
+ interface ContentItem {
916
+ id: string;
917
+ type: string;
918
+ createdAt: string;
919
+ title?: string;
920
+ body?: string;
921
+ data?: Record<string, unknown>;
922
+ status?: string;
923
+ channels?: string[];
924
+ metadata?: Record<string, unknown>;
925
+ updatedAt?: string;
926
+ publishedAt?: string;
927
+ scheduledFor?: Date;
928
+ workflowId?: string;
929
+ workflowStage?: string;
930
+ sourceType?: string | null;
931
+ sourceId?: string | null;
932
+ }
933
+ interface CreateContentInput {
934
+ type: string;
935
+ title?: string;
936
+ body?: string;
937
+ data?: Record<string, unknown>;
938
+ channels?: string[];
939
+ metadata?: Record<string, unknown>;
940
+ }
941
+ interface UpdateContentInput {
942
+ title?: string;
943
+ body?: string;
944
+ data?: Record<string, unknown>;
945
+ channels?: string[];
946
+ metadata?: Record<string, unknown>;
947
+ status?: string;
948
+ }
949
+ interface ContentFilters {
950
+ type?: string;
951
+ status?: string;
952
+ page?: number;
953
+ limit?: number;
954
+ }
955
+ interface SearchOptions {
956
+ type?: string;
957
+ status?: string;
958
+ page?: number;
959
+ limit?: number;
960
+ }
961
+ interface PaginatedResult<T> {
962
+ items: T[];
963
+ total: number;
964
+ page?: number;
965
+ limit?: number;
966
+ }
967
+ interface ContentTypeInfo {
968
+ id: string;
969
+ contentType: unknown;
970
+ }
971
+ interface AIReview {
972
+ id: string;
973
+ contentId: string;
974
+ score: number;
975
+ suggestions: AIReviewSuggestion[];
976
+ passesThreshold: boolean;
977
+ rawResult: Record<string, unknown>;
978
+ createdAt: string;
979
+ }
980
+ interface AIReviewSuggestion {
981
+ category: string;
982
+ severity: 'info' | 'warning' | 'error';
983
+ message: string;
984
+ originalText?: string;
985
+ suggestedFix?: string;
986
+ }
987
+ interface SocialPost {
988
+ id: string;
989
+ contentId: string;
990
+ platform: string;
991
+ body: string;
992
+ status: 'draft' | 'published' | 'failed';
993
+ platformPostId?: string | null;
994
+ publishedAt?: string | null;
995
+ workflowId?: string;
996
+ workflowStage?: string;
997
+ createdAt: string;
998
+ }
999
+ interface Workflow {
1000
+ id: string;
1001
+ name: string;
1002
+ description?: string;
1003
+ stages?: WorkflowStage[];
1004
+ transitions?: WorkflowTransition[];
1005
+ }
1006
+ interface WorkflowStage {
1007
+ id: string;
1008
+ name: string;
1009
+ order: number;
1010
+ isPublishStage?: boolean;
1011
+ allowsScheduling?: boolean;
1012
+ description?: string;
1013
+ permissions?: string[];
1014
+ conditions?: StageConditions;
1015
+ }
1016
+ interface WorkflowTransition {
1017
+ id: string;
1018
+ from: string;
1019
+ to: string;
1020
+ description?: string;
1021
+ permissions?: string[];
1022
+ }
1023
+ interface CreateWorkflowInput {
1024
+ name: string;
1025
+ description?: string;
1026
+ stages?: WorkflowStage[];
1027
+ transitions?: WorkflowTransition[];
1028
+ }
1029
+ interface UpdateWorkflowInput {
1030
+ name?: string;
1031
+ description?: string;
1032
+ stages?: WorkflowStage[];
1033
+ transitions?: WorkflowTransition[];
1034
+ }
1035
+ interface User {
1036
+ id: string;
1037
+ name: string;
1038
+ email?: string;
1039
+ role?: string;
1040
+ permissions?: string[];
1041
+ createdAt?: string;
1042
+ updatedAt?: string;
1043
+ }
1044
+ interface CreateUserInput {
1045
+ name: string;
1046
+ email?: string;
1047
+ role?: string;
1048
+ }
1049
+ interface UpdateUserInput {
1050
+ name?: string;
1051
+ email?: string;
1052
+ role?: string;
1053
+ }
1054
+ interface SuitePlugin {
1055
+ name: string;
1056
+ version: string;
1057
+ setup(suite: ContentManagementSuite): Promise<void>;
1058
+ teardown?(suite: ContentManagementSuite): Promise<void>;
1059
+ }
1060
+ interface ContentManagementLogger {
1061
+ error(message: string, ...args: unknown[]): void;
1062
+ warn(message: string, ...args: unknown[]): void;
1063
+ info(message: string, ...args: unknown[]): void;
1064
+ debug(message: string, ...args: unknown[]): void;
1065
+ }
1066
+ interface AIConfiguration {
1067
+ reviewService?: AIReviewService;
1068
+ socialGeneratorService?: AISocialGeneratorService;
1069
+ enhanceService?: AIEnhanceService;
1070
+ }
1071
+ interface WorkflowConfiguration {
1072
+ defaults?: Record<string, string>;
1073
+ }
1074
+ interface ContentManagementSuiteOptions {
1075
+ config?: Partial<ContentManagementConfig>;
1076
+ logger?: ContentManagementLogger;
1077
+ plugins?: SuitePlugin[];
1078
+ storage?: ContentStorageAdapter;
1079
+ ai?: AIConfiguration;
1080
+ workflows?: WorkflowConfiguration;
1081
+ }
1082
+ interface ContentNamespace {
1083
+ list(filters?: ContentFilters): Promise<PaginatedResult<ContentItem>>;
1084
+ get(id: string): Promise<ContentItem>;
1085
+ create(input: CreateContentInput): Promise<ContentItem>;
1086
+ update(id: string, input: UpdateContentInput): Promise<ContentItem>;
1087
+ delete(id: string, options?: {
1088
+ soft?: boolean;
1089
+ }): Promise<void>;
1090
+ publish(id: string, options?: {
1091
+ channels?: string[];
1092
+ }): Promise<ContentPublishResult>;
1093
+ unpublish(id: string): Promise<ContentItem>;
1094
+ schedule(id: string, date: Date): Promise<ContentItem>;
1095
+ search(query: string, options?: SearchOptions): Promise<PaginatedResult<ContentItem>>;
1096
+ }
1097
+ interface ContentTypesNamespace {
1098
+ list(): ContentTypeDefinition[];
1099
+ get(id: string): ContentTypeDefinition | undefined;
1100
+ register(definition: ContentTypeDefinition | {
1101
+ id?: string;
1102
+ name?: string;
1103
+ }): void;
1104
+ unregister(id: string): void;
1105
+ validate(type: string, data: Record<string, unknown>): SchemaValidationResult;
1106
+ }
1107
+ interface WorkflowsNamespace {
1108
+ list(): Promise<Workflow[]>;
1109
+ get(id: string): Promise<Workflow>;
1110
+ create(input: CreateWorkflowInput): Promise<Workflow>;
1111
+ update(id: string, input: UpdateWorkflowInput): Promise<Workflow>;
1112
+ delete(id: string): Promise<void>;
1113
+ }
1114
+ interface UsersNamespace {
1115
+ list(): Promise<PaginatedResult<User>>;
1116
+ get(id: string): Promise<User>;
1117
+ create(input: CreateUserInput): Promise<User>;
1118
+ update(id: string, input: UpdateUserInput): Promise<User>;
1119
+ delete(id: string): Promise<void>;
1120
+ }
1121
+ interface PermissionsNamespace {
1122
+ check(userId: string, permission: string): Promise<boolean>;
1123
+ grant(userId: string, permission: string): Promise<void>;
1124
+ revoke(userId: string, permission: string): Promise<void>;
1125
+ }
1126
+ interface ConfigNamespace {
1127
+ get(): ContentManagementConfig;
1128
+ update(partial: Partial<ContentManagementConfig>): ContentManagementConfig;
1129
+ }
1130
+ interface PluginsNamespace {
1131
+ register(plugin: SuitePlugin): Promise<void>;
1132
+ unregister(name: string): Promise<void>;
1133
+ }
1134
+ interface PublishersNamespace {
1135
+ register(publisher: ContentPublisher): void;
1136
+ unregister(id: string): void;
1137
+ list(): ContentPublisher[];
1138
+ get(id: string): ContentPublisher | undefined;
1139
+ }
1140
+ interface SourcesNamespace {
1141
+ register(source: ContentSource): void;
1142
+ unregister(id: string): void;
1143
+ list(): ContentSource[];
1144
+ get(id: string): ContentSource | undefined;
1145
+ ingest(sourceId: string, rawPayload: unknown): Promise<IngestResult>;
1146
+ }
1147
+ interface AINamespace {
1148
+ review(contentId: string): Promise<AIReview>;
1149
+ generateSocialPosts(contentId: string, platforms: string[]): Promise<SocialPost[]>;
1150
+ enhance(contentId: string, opts?: EnhanceOptions): Promise<EnhancedContent>;
1151
+ suggest(contentId: string): Promise<Suggestion[]>;
1152
+ }
1153
+ interface SocialNamespace {
1154
+ registerPlatform(adapter: SocialPlatformAdapter): void;
1155
+ unregisterPlatform(id: string): void;
1156
+ listPlatforms(): PlatformInfo[];
1157
+ publish(contentId: string, platforms: string[]): Promise<PlatformPublishResult[]>;
1158
+ preview(contentId: string, platform: string): Promise<PreviewResult>;
1159
+ getMetrics(contentId: string, platform: string): Promise<SocialMetrics>;
1160
+ }
1161
+ interface SuiteEventMap {
1162
+ 'content:created': ContentItem;
1163
+ 'content:updated': ContentItem;
1164
+ 'content:deleted': {
1165
+ id: string;
1166
+ };
1167
+ 'content:published': {
1168
+ item: ContentItem;
1169
+ results: PublishResult[];
1170
+ };
1171
+ 'content:unpublished': ContentItem;
1172
+ 'content:scheduled': {
1173
+ item: ContentItem;
1174
+ date: Date;
1175
+ };
1176
+ 'user:created': User;
1177
+ 'user:updated': User;
1178
+ 'user:deleted': {
1179
+ id: string;
1180
+ };
1181
+ 'workflow:transition': WorkflowTransition;
1182
+ 'config:updated': ContentManagementConfig;
1183
+ 'error': ContentManagementError;
1184
+ 'initialized': void;
1185
+ 'disposed': void;
1186
+ 'content:ingested': {
1187
+ item: ContentItem;
1188
+ sourceType: string;
1189
+ };
1190
+ 'ai:review:completed': {
1191
+ contentId: string;
1192
+ review: AIReview;
1193
+ };
1194
+ 'ai:social:generated': {
1195
+ contentId: string;
1196
+ posts: SocialPost[];
1197
+ };
1198
+ 'social:published': {
1199
+ contentId: string;
1200
+ platform: string;
1201
+ result: PlatformPublishResult;
1202
+ };
1203
+ 'workflow:stage:changed': {
1204
+ contentId: string;
1205
+ workflowId: string;
1206
+ from: string;
1207
+ to: string;
1208
+ };
1209
+ 'source:registered': {
1210
+ source: ContentSource;
1211
+ };
1212
+ 'publisher:registered': {
1213
+ publisher: ContentPublisher;
1214
+ };
1215
+ }
1216
+ interface ContentManagementSuite {
1217
+ readonly content: ContentNamespace;
1218
+ readonly contentTypes: ContentTypesNamespace;
1219
+ readonly workflows: WorkflowsNamespace;
1220
+ readonly users: UsersNamespace;
1221
+ readonly permissions: PermissionsNamespace;
1222
+ readonly config: ConfigNamespace;
1223
+ readonly plugins: PluginsNamespace;
1224
+ readonly publishers: PublishersNamespace;
1225
+ readonly sources: SourcesNamespace;
1226
+ readonly ai: AINamespace;
1227
+ readonly social: SocialNamespace;
1228
+ initialize(): Promise<void>;
1229
+ dispose(): Promise<void>;
1230
+ on<K extends keyof SuiteEventMap>(event: K, listener: (payload: SuiteEventMap[K]) => void): this;
1231
+ emit<K extends keyof SuiteEventMap>(event: K, payload: SuiteEventMap[K]): boolean;
1232
+ }
1233
+
1234
+ export { type UpdateWorkflowInput as $, type AIReviewStorageNamespace as A, type ContentTypeDefinition as B, type ContentStorageAdapter as C, type SchemaValidationResult as D, type EnhanceOptions as E, ForbiddenError as F, type StageConditions as G, type AIReviewSuggestion$1 as H, InternalError as I, type ContentItem as J, type CreateContentInput as K, type UpdateContentInput as L, type MediaStorageNamespace as M, NotFoundError as N, type ContentFilters as O, type PublishResult as P, type SearchOptions as Q, type PaginatedResult as R, type SocialPostStorageNamespace as S, type ContentTypeInfo as T, UnauthorizedError as U, ValidationError as V, type WorkflowStorageNamespace as W, type Workflow as X, type WorkflowStage as Y, type WorkflowTransition as Z, type CreateWorkflowInput as _, type ContentManagementSuiteOptions as a, type User as a0, type CreateUserInput as a1, type UpdateUserInput as a2, type SuitePlugin as a3, type ContentManagementLogger as a4, type SuiteEventMap as a5, type ContentNamespace as a6, type ContentTypesNamespace as a7, type WorkflowsNamespace as a8, type UsersNamespace as a9, type PermissionsNamespace as aa, type ConfigNamespace as ab, type PluginsNamespace as ac, type PublishersNamespace as ad, type SourcesNamespace as ae, type AINamespace as af, type SocialNamespace as ag, type AIReview as ah, type AIConfiguration as ai, type WorkflowConfiguration as aj, type SocialPost as ak, type ContentManagementSuite as b, ContentManagementConfigSchema as c, type ContentManagementConfig as d, ContentManagementError as e, ConflictError as f, type ContentStorageNamespace as g, type ContentTypeStorageNamespace as h, type StoredContentTypeDefinition as i, type ScheduleStorageNamespace as j, type AnalyticsStorageNamespace as k, type AIReviewService as l, type AIReviewServiceResult as m, type AISocialGeneratorService as n, type AIEnhanceService as o, type EnhancedContent as p, type Suggestion as q, type ContentPublisher as r, type ContentPublishResult as s, type PreviewResult as t, type ContentSource as u, type IngestResult as v, type SocialPlatformAdapter as w, type PlatformPublishResult as x, type SocialMetrics as y, type PlatformInfo as z };