@bernierllc/content-management-suite 0.6.0 → 0.8.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.
package/dist/index.d.ts CHANGED
@@ -1,889 +1,12 @@
1
- import { z } from 'zod';
2
- export { ContentTypeRegistry } from '@bernierllc/content-type-registry';
3
- export { EditorialWorkflowEngine, WorkflowBuilder, WorkflowFactory, WorkflowTemplates } from '@bernierllc/content-editorial-workflow';
4
- export { AutosaveManager } from '@bernierllc/content-autosave-manager';
5
- export { ContentSoftDelete } from '@bernierllc/content-soft-delete';
6
- export { TextContentType } from '@bernierllc/content-type-text';
7
- export { ImageContentType } from '@bernierllc/content-type-image';
8
- export { AudioContentTypeManager } from '@bernierllc/content-type-audio';
9
- export { VideoContentType } from '@bernierllc/content-type-video';
10
-
11
- declare const ContentManagementConfigSchema: z.ZodObject<{
12
- content: z.ZodDefault<z.ZodObject<{
13
- defaultWorkflow: z.ZodDefault<z.ZodObject<{
14
- id: z.ZodDefault<z.ZodString>;
15
- name: z.ZodDefault<z.ZodString>;
16
- description: z.ZodDefault<z.ZodString>;
17
- stages: z.ZodDefault<z.ZodArray<z.ZodObject<{
18
- id: z.ZodString;
19
- name: z.ZodString;
20
- order: z.ZodNumber;
21
- isPublishStage: z.ZodDefault<z.ZodBoolean>;
22
- allowsScheduling: z.ZodDefault<z.ZodBoolean>;
23
- description: z.ZodOptional<z.ZodString>;
24
- permissions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
25
- }, "strip", z.ZodTypeAny, {
26
- id: string;
27
- name: string;
28
- order: number;
29
- isPublishStage: boolean;
30
- allowsScheduling: boolean;
31
- permissions: string[];
32
- description?: string | undefined;
33
- }, {
34
- id: string;
35
- name: string;
36
- order: number;
37
- description?: string | undefined;
38
- isPublishStage?: boolean | undefined;
39
- allowsScheduling?: boolean | undefined;
40
- permissions?: string[] | undefined;
41
- }>, "many">>;
42
- transitions: z.ZodDefault<z.ZodArray<z.ZodObject<{
43
- id: z.ZodString;
44
- from: z.ZodString;
45
- to: z.ZodString;
46
- description: z.ZodOptional<z.ZodString>;
47
- permissions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
48
- }, "strip", z.ZodTypeAny, {
49
- id: string;
50
- permissions: string[];
51
- from: string;
52
- to: string;
53
- description?: string | undefined;
54
- }, {
55
- id: string;
56
- from: string;
57
- to: string;
58
- description?: string | undefined;
59
- permissions?: string[] | undefined;
60
- }>, "many">>;
61
- }, "strip", z.ZodTypeAny, {
62
- id: string;
63
- name: string;
64
- description: string;
65
- stages: {
66
- id: string;
67
- name: string;
68
- order: number;
69
- isPublishStage: boolean;
70
- allowsScheduling: boolean;
71
- permissions: string[];
72
- description?: string | undefined;
73
- }[];
74
- transitions: {
75
- id: string;
76
- permissions: string[];
77
- from: string;
78
- to: string;
79
- description?: string | undefined;
80
- }[];
81
- }, {
82
- id?: string | undefined;
83
- name?: string | undefined;
84
- description?: string | undefined;
85
- stages?: {
86
- id: string;
87
- name: string;
88
- order: number;
89
- description?: string | undefined;
90
- isPublishStage?: boolean | undefined;
91
- allowsScheduling?: boolean | undefined;
92
- permissions?: string[] | undefined;
93
- }[] | undefined;
94
- transitions?: {
95
- id: string;
96
- from: string;
97
- to: string;
98
- description?: string | undefined;
99
- permissions?: string[] | undefined;
100
- }[] | undefined;
101
- }>>;
102
- contentTypes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
103
- autoSave: z.ZodDefault<z.ZodObject<{
104
- enabled: z.ZodDefault<z.ZodBoolean>;
105
- debounceMs: z.ZodDefault<z.ZodNumber>;
106
- maxRetries: z.ZodDefault<z.ZodNumber>;
107
- backoffMs: z.ZodDefault<z.ZodNumber>;
108
- }, "strip", z.ZodTypeAny, {
109
- enabled: boolean;
110
- debounceMs: number;
111
- maxRetries: number;
112
- backoffMs: number;
113
- }, {
114
- enabled?: boolean | undefined;
115
- debounceMs?: number | undefined;
116
- maxRetries?: number | undefined;
117
- backoffMs?: number | undefined;
118
- }>>;
119
- softDelete: z.ZodDefault<z.ZodObject<{
120
- enabled: z.ZodDefault<z.ZodBoolean>;
121
- showDeletedToUsers: z.ZodDefault<z.ZodBoolean>;
122
- retentionDays: z.ZodDefault<z.ZodNumber>;
123
- }, "strip", z.ZodTypeAny, {
124
- enabled: boolean;
125
- showDeletedToUsers: boolean;
126
- retentionDays: number;
127
- }, {
128
- enabled?: boolean | undefined;
129
- showDeletedToUsers?: boolean | undefined;
130
- retentionDays?: number | undefined;
131
- }>>;
132
- upload: z.ZodDefault<z.ZodObject<{
133
- maxFileSize: z.ZodDefault<z.ZodNumber>;
134
- allowedTypes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
135
- storage: z.ZodOptional<z.ZodDefault<z.ZodObject<{
136
- type: z.ZodDefault<z.ZodEnum<["local", "s3"]>>;
137
- path: z.ZodDefault<z.ZodString>;
138
- bucket: z.ZodOptional<z.ZodString>;
139
- region: z.ZodOptional<z.ZodString>;
140
- }, "strip", z.ZodTypeAny, {
141
- path: string;
142
- type: "local" | "s3";
143
- bucket?: string | undefined;
144
- region?: string | undefined;
145
- }, {
146
- path?: string | undefined;
147
- type?: "local" | "s3" | undefined;
148
- bucket?: string | undefined;
149
- region?: string | undefined;
150
- }>>>;
151
- }, "strip", z.ZodTypeAny, {
152
- maxFileSize: number;
153
- allowedTypes: string[];
154
- storage?: {
155
- path: string;
156
- type: "local" | "s3";
157
- bucket?: string | undefined;
158
- region?: string | undefined;
159
- } | undefined;
160
- }, {
161
- maxFileSize?: number | undefined;
162
- allowedTypes?: string[] | undefined;
163
- storage?: {
164
- path?: string | undefined;
165
- type?: "local" | "s3" | undefined;
166
- bucket?: string | undefined;
167
- region?: string | undefined;
168
- } | undefined;
169
- }>>;
170
- }, "strip", z.ZodTypeAny, {
171
- defaultWorkflow: {
172
- id: string;
173
- name: string;
174
- description: string;
175
- stages: {
176
- id: string;
177
- name: string;
178
- order: number;
179
- isPublishStage: boolean;
180
- allowsScheduling: boolean;
181
- permissions: string[];
182
- description?: string | undefined;
183
- }[];
184
- transitions: {
185
- id: string;
186
- permissions: string[];
187
- from: string;
188
- to: string;
189
- description?: string | undefined;
190
- }[];
191
- };
192
- contentTypes: string[];
193
- autoSave: {
194
- enabled: boolean;
195
- debounceMs: number;
196
- maxRetries: number;
197
- backoffMs: number;
198
- };
199
- softDelete: {
200
- enabled: boolean;
201
- showDeletedToUsers: boolean;
202
- retentionDays: number;
203
- };
204
- upload: {
205
- maxFileSize: number;
206
- allowedTypes: string[];
207
- storage?: {
208
- path: string;
209
- type: "local" | "s3";
210
- bucket?: string | undefined;
211
- region?: string | undefined;
212
- } | undefined;
213
- };
214
- }, {
215
- defaultWorkflow?: {
216
- id?: string | undefined;
217
- name?: string | undefined;
218
- description?: string | undefined;
219
- stages?: {
220
- id: string;
221
- name: string;
222
- order: number;
223
- description?: string | undefined;
224
- isPublishStage?: boolean | undefined;
225
- allowsScheduling?: boolean | undefined;
226
- permissions?: string[] | undefined;
227
- }[] | undefined;
228
- transitions?: {
229
- id: string;
230
- from: string;
231
- to: string;
232
- description?: string | undefined;
233
- permissions?: string[] | undefined;
234
- }[] | undefined;
235
- } | undefined;
236
- contentTypes?: string[] | undefined;
237
- autoSave?: {
238
- enabled?: boolean | undefined;
239
- debounceMs?: number | undefined;
240
- maxRetries?: number | undefined;
241
- backoffMs?: number | undefined;
242
- } | undefined;
243
- softDelete?: {
244
- enabled?: boolean | undefined;
245
- showDeletedToUsers?: boolean | undefined;
246
- retentionDays?: number | undefined;
247
- } | undefined;
248
- upload?: {
249
- maxFileSize?: number | undefined;
250
- allowedTypes?: string[] | undefined;
251
- storage?: {
252
- path?: string | undefined;
253
- type?: "local" | "s3" | undefined;
254
- bucket?: string | undefined;
255
- region?: string | undefined;
256
- } | undefined;
257
- } | undefined;
258
- }>>;
259
- database: z.ZodDefault<z.ZodObject<{
260
- type: z.ZodDefault<z.ZodEnum<["sqlite", "postgresql", "mysql", "mongodb"]>>;
261
- url: z.ZodOptional<z.ZodString>;
262
- host: z.ZodDefault<z.ZodString>;
263
- port: z.ZodOptional<z.ZodNumber>;
264
- name: z.ZodDefault<z.ZodString>;
265
- username: z.ZodOptional<z.ZodString>;
266
- password: z.ZodOptional<z.ZodString>;
267
- ssl: z.ZodDefault<z.ZodBoolean>;
268
- pool: z.ZodDefault<z.ZodObject<{
269
- min: z.ZodDefault<z.ZodNumber>;
270
- max: z.ZodDefault<z.ZodNumber>;
271
- idleTimeoutMs: z.ZodOptional<z.ZodNumber>;
272
- }, "strip", z.ZodTypeAny, {
273
- min: number;
274
- max: number;
275
- idleTimeoutMs?: number | undefined;
276
- }, {
277
- min?: number | undefined;
278
- max?: number | undefined;
279
- idleTimeoutMs?: number | undefined;
280
- }>>;
281
- }, "strip", z.ZodTypeAny, {
282
- name: string;
283
- type: "sqlite" | "postgresql" | "mysql" | "mongodb";
284
- host: string;
285
- ssl: boolean;
286
- pool: {
287
- min: number;
288
- max: number;
289
- idleTimeoutMs?: number | undefined;
290
- };
291
- url?: string | undefined;
292
- port?: number | undefined;
293
- username?: string | undefined;
294
- password?: string | undefined;
295
- }, {
296
- name?: string | undefined;
297
- type?: "sqlite" | "postgresql" | "mysql" | "mongodb" | undefined;
298
- url?: string | undefined;
299
- host?: string | undefined;
300
- port?: number | undefined;
301
- username?: string | undefined;
302
- password?: string | undefined;
303
- ssl?: boolean | undefined;
304
- pool?: {
305
- min?: number | undefined;
306
- max?: number | undefined;
307
- idleTimeoutMs?: number | undefined;
308
- } | undefined;
309
- }>>;
310
- integrations: z.ZodDefault<z.ZodObject<{
311
- neverAdmin: z.ZodDefault<z.ZodObject<{
312
- enabled: z.ZodDefault<z.ZodBoolean>;
313
- endpoint: z.ZodOptional<z.ZodString>;
314
- }, "strip", z.ZodTypeAny, {
315
- enabled: boolean;
316
- endpoint?: string | undefined;
317
- }, {
318
- enabled?: boolean | undefined;
319
- endpoint?: string | undefined;
320
- }>>;
321
- neverHub: z.ZodDefault<z.ZodObject<{
322
- enabled: z.ZodDefault<z.ZodBoolean>;
323
- endpoint: z.ZodOptional<z.ZodString>;
324
- }, "strip", z.ZodTypeAny, {
325
- enabled: boolean;
326
- endpoint?: string | undefined;
327
- }, {
328
- enabled?: boolean | undefined;
329
- endpoint?: string | undefined;
330
- }>>;
331
- analytics: z.ZodDefault<z.ZodObject<{
332
- enabled: z.ZodDefault<z.ZodBoolean>;
333
- provider: z.ZodOptional<z.ZodString>;
334
- }, "strip", z.ZodTypeAny, {
335
- enabled: boolean;
336
- provider?: string | undefined;
337
- }, {
338
- enabled?: boolean | undefined;
339
- provider?: string | undefined;
340
- }>>;
341
- }, "strip", z.ZodTypeAny, {
342
- neverAdmin: {
343
- enabled: boolean;
344
- endpoint?: string | undefined;
345
- };
346
- neverHub: {
347
- enabled: boolean;
348
- endpoint?: string | undefined;
349
- };
350
- analytics: {
351
- enabled: boolean;
352
- provider?: string | undefined;
353
- };
354
- }, {
355
- neverAdmin?: {
356
- enabled?: boolean | undefined;
357
- endpoint?: string | undefined;
358
- } | undefined;
359
- neverHub?: {
360
- enabled?: boolean | undefined;
361
- endpoint?: string | undefined;
362
- } | undefined;
363
- analytics?: {
364
- enabled?: boolean | undefined;
365
- provider?: string | undefined;
366
- } | undefined;
367
- }>>;
368
- security: z.ZodDefault<z.ZodObject<{
369
- permissions: z.ZodDefault<z.ZodObject<{
370
- enabled: z.ZodDefault<z.ZodBoolean>;
371
- defaultRole: z.ZodDefault<z.ZodString>;
372
- }, "strip", z.ZodTypeAny, {
373
- enabled: boolean;
374
- defaultRole: string;
375
- }, {
376
- enabled?: boolean | undefined;
377
- defaultRole?: string | undefined;
378
- }>>;
379
- roles: z.ZodDefault<z.ZodArray<z.ZodObject<{
380
- name: z.ZodString;
381
- permissions: z.ZodArray<z.ZodString, "many">;
382
- description: z.ZodOptional<z.ZodString>;
383
- }, "strip", z.ZodTypeAny, {
384
- name: string;
385
- permissions: string[];
386
- description?: string | undefined;
387
- }, {
388
- name: string;
389
- permissions: string[];
390
- description?: string | undefined;
391
- }>, "many">>;
392
- }, "strip", z.ZodTypeAny, {
393
- permissions: {
394
- enabled: boolean;
395
- defaultRole: string;
396
- };
397
- roles: {
398
- name: string;
399
- permissions: string[];
400
- description?: string | undefined;
401
- }[];
402
- }, {
403
- permissions?: {
404
- enabled?: boolean | undefined;
405
- defaultRole?: string | undefined;
406
- } | undefined;
407
- roles?: {
408
- name: string;
409
- permissions: string[];
410
- description?: string | undefined;
411
- }[] | undefined;
412
- }>>;
413
- logging: z.ZodDefault<z.ZodObject<{
414
- level: z.ZodDefault<z.ZodEnum<["error", "warn", "info", "debug"]>>;
415
- }, "strip", z.ZodTypeAny, {
416
- level: "error" | "warn" | "info" | "debug";
417
- }, {
418
- level?: "error" | "warn" | "info" | "debug" | undefined;
419
- }>>;
420
- performance: z.ZodDefault<z.ZodObject<{
421
- cache: z.ZodDefault<z.ZodObject<{
422
- enabled: z.ZodDefault<z.ZodBoolean>;
423
- ttl: z.ZodDefault<z.ZodNumber>;
424
- maxSize: z.ZodDefault<z.ZodNumber>;
425
- }, "strip", z.ZodTypeAny, {
426
- enabled: boolean;
427
- ttl: number;
428
- maxSize: number;
429
- }, {
430
- enabled?: boolean | undefined;
431
- ttl?: number | undefined;
432
- maxSize?: number | undefined;
433
- }>>;
434
- }, "strip", z.ZodTypeAny, {
435
- cache: {
436
- enabled: boolean;
437
- ttl: number;
438
- maxSize: number;
439
- };
440
- }, {
441
- cache?: {
442
- enabled?: boolean | undefined;
443
- ttl?: number | undefined;
444
- maxSize?: number | undefined;
445
- } | undefined;
446
- }>>;
447
- }, "strip", z.ZodTypeAny, {
448
- content: {
449
- defaultWorkflow: {
450
- id: string;
451
- name: string;
452
- description: string;
453
- stages: {
454
- id: string;
455
- name: string;
456
- order: number;
457
- isPublishStage: boolean;
458
- allowsScheduling: boolean;
459
- permissions: string[];
460
- description?: string | undefined;
461
- }[];
462
- transitions: {
463
- id: string;
464
- permissions: string[];
465
- from: string;
466
- to: string;
467
- description?: string | undefined;
468
- }[];
469
- };
470
- contentTypes: string[];
471
- autoSave: {
472
- enabled: boolean;
473
- debounceMs: number;
474
- maxRetries: number;
475
- backoffMs: number;
476
- };
477
- softDelete: {
478
- enabled: boolean;
479
- showDeletedToUsers: boolean;
480
- retentionDays: number;
481
- };
482
- upload: {
483
- maxFileSize: number;
484
- allowedTypes: string[];
485
- storage?: {
486
- path: string;
487
- type: "local" | "s3";
488
- bucket?: string | undefined;
489
- region?: string | undefined;
490
- } | undefined;
491
- };
492
- };
493
- database: {
494
- name: string;
495
- type: "sqlite" | "postgresql" | "mysql" | "mongodb";
496
- host: string;
497
- ssl: boolean;
498
- pool: {
499
- min: number;
500
- max: number;
501
- idleTimeoutMs?: number | undefined;
502
- };
503
- url?: string | undefined;
504
- port?: number | undefined;
505
- username?: string | undefined;
506
- password?: string | undefined;
507
- };
508
- integrations: {
509
- neverAdmin: {
510
- enabled: boolean;
511
- endpoint?: string | undefined;
512
- };
513
- neverHub: {
514
- enabled: boolean;
515
- endpoint?: string | undefined;
516
- };
517
- analytics: {
518
- enabled: boolean;
519
- provider?: string | undefined;
520
- };
521
- };
522
- security: {
523
- permissions: {
524
- enabled: boolean;
525
- defaultRole: string;
526
- };
527
- roles: {
528
- name: string;
529
- permissions: string[];
530
- description?: string | undefined;
531
- }[];
532
- };
533
- logging: {
534
- level: "error" | "warn" | "info" | "debug";
535
- };
536
- performance: {
537
- cache: {
538
- enabled: boolean;
539
- ttl: number;
540
- maxSize: number;
541
- };
542
- };
543
- }, {
544
- content?: {
545
- defaultWorkflow?: {
546
- id?: string | undefined;
547
- name?: string | undefined;
548
- description?: string | undefined;
549
- stages?: {
550
- id: string;
551
- name: string;
552
- order: number;
553
- description?: string | undefined;
554
- isPublishStage?: boolean | undefined;
555
- allowsScheduling?: boolean | undefined;
556
- permissions?: string[] | undefined;
557
- }[] | undefined;
558
- transitions?: {
559
- id: string;
560
- from: string;
561
- to: string;
562
- description?: string | undefined;
563
- permissions?: string[] | undefined;
564
- }[] | undefined;
565
- } | undefined;
566
- contentTypes?: string[] | undefined;
567
- autoSave?: {
568
- enabled?: boolean | undefined;
569
- debounceMs?: number | undefined;
570
- maxRetries?: number | undefined;
571
- backoffMs?: number | undefined;
572
- } | undefined;
573
- softDelete?: {
574
- enabled?: boolean | undefined;
575
- showDeletedToUsers?: boolean | undefined;
576
- retentionDays?: number | undefined;
577
- } | undefined;
578
- upload?: {
579
- maxFileSize?: number | undefined;
580
- allowedTypes?: string[] | undefined;
581
- storage?: {
582
- path?: string | undefined;
583
- type?: "local" | "s3" | undefined;
584
- bucket?: string | undefined;
585
- region?: string | undefined;
586
- } | undefined;
587
- } | undefined;
588
- } | undefined;
589
- database?: {
590
- name?: string | undefined;
591
- type?: "sqlite" | "postgresql" | "mysql" | "mongodb" | undefined;
592
- url?: string | undefined;
593
- host?: string | undefined;
594
- port?: number | undefined;
595
- username?: string | undefined;
596
- password?: string | undefined;
597
- ssl?: boolean | undefined;
598
- pool?: {
599
- min?: number | undefined;
600
- max?: number | undefined;
601
- idleTimeoutMs?: number | undefined;
602
- } | undefined;
603
- } | undefined;
604
- integrations?: {
605
- neverAdmin?: {
606
- enabled?: boolean | undefined;
607
- endpoint?: string | undefined;
608
- } | undefined;
609
- neverHub?: {
610
- enabled?: boolean | undefined;
611
- endpoint?: string | undefined;
612
- } | undefined;
613
- analytics?: {
614
- enabled?: boolean | undefined;
615
- provider?: string | undefined;
616
- } | undefined;
617
- } | undefined;
618
- security?: {
619
- permissions?: {
620
- enabled?: boolean | undefined;
621
- defaultRole?: string | undefined;
622
- } | undefined;
623
- roles?: {
624
- name: string;
625
- permissions: string[];
626
- description?: string | undefined;
627
- }[] | undefined;
628
- } | undefined;
629
- logging?: {
630
- level?: "error" | "warn" | "info" | "debug" | undefined;
631
- } | undefined;
632
- performance?: {
633
- cache?: {
634
- enabled?: boolean | undefined;
635
- ttl?: number | undefined;
636
- maxSize?: number | undefined;
637
- } | undefined;
638
- } | undefined;
639
- }>;
640
- type ContentManagementConfig = z.infer<typeof ContentManagementConfigSchema>;
641
-
642
- declare class ContentManagementError extends Error {
643
- readonly code: string;
644
- readonly details?: Record<string, unknown>;
645
- constructor(message: string, options?: {
646
- cause?: Error;
647
- code?: string;
648
- details?: Record<string, unknown>;
649
- });
650
- }
651
- declare class ValidationError extends ContentManagementError {
652
- constructor(message: string, options?: {
653
- cause?: Error;
654
- details?: Record<string, unknown>;
655
- });
656
- }
657
- declare class NotFoundError extends ContentManagementError {
658
- constructor(message: string, options?: {
659
- cause?: Error;
660
- details?: Record<string, unknown>;
661
- });
662
- }
663
- declare class UnauthorizedError extends ContentManagementError {
664
- constructor(message: string, options?: {
665
- cause?: Error;
666
- details?: Record<string, unknown>;
667
- });
668
- }
669
- declare class ForbiddenError extends ContentManagementError {
670
- constructor(message: string, options?: {
671
- cause?: Error;
672
- details?: Record<string, unknown>;
673
- });
674
- }
675
- declare class ConflictError extends ContentManagementError {
676
- constructor(message: string, options?: {
677
- cause?: Error;
678
- details?: Record<string, unknown>;
679
- });
680
- }
681
- declare class InternalError extends ContentManagementError {
682
- constructor(message: string, options?: {
683
- cause?: Error;
684
- details?: Record<string, unknown>;
685
- });
686
- }
687
-
688
- interface ContentItem {
689
- id: string;
690
- type: string;
691
- data: Record<string, unknown>;
692
- status?: string;
693
- createdAt: string;
694
- updatedAt?: string;
695
- publishedAt?: string;
696
- scheduledFor?: Date;
697
- }
698
- interface CreateContentInput {
699
- type: string;
700
- data: Record<string, unknown>;
701
- }
702
- interface UpdateContentInput {
703
- data: Record<string, unknown>;
704
- }
705
- interface ContentFilters {
706
- type?: string;
707
- status?: string;
708
- page?: number;
709
- limit?: number;
710
- }
711
- interface SearchOptions {
712
- type?: string;
713
- status?: string;
714
- page?: number;
715
- limit?: number;
716
- }
717
- interface PaginatedResult<T> {
718
- items: T[];
719
- total: number;
720
- page?: number;
721
- limit?: number;
722
- }
723
- interface ContentTypeInfo {
724
- id: string;
725
- contentType: unknown;
726
- }
727
- interface Workflow {
728
- id: string;
729
- name: string;
730
- description?: string;
731
- stages?: WorkflowStage[];
732
- transitions?: WorkflowTransition[];
733
- }
734
- interface WorkflowStage {
735
- id: string;
736
- name: string;
737
- order: number;
738
- isPublishStage?: boolean;
739
- allowsScheduling?: boolean;
740
- description?: string;
741
- permissions?: string[];
742
- }
743
- interface WorkflowTransition {
744
- id: string;
745
- from: string;
746
- to: string;
747
- description?: string;
748
- permissions?: string[];
749
- }
750
- interface CreateWorkflowInput {
751
- name: string;
752
- description?: string;
753
- stages?: WorkflowStage[];
754
- transitions?: WorkflowTransition[];
755
- }
756
- interface UpdateWorkflowInput {
757
- name?: string;
758
- description?: string;
759
- stages?: WorkflowStage[];
760
- transitions?: WorkflowTransition[];
761
- }
762
- interface User {
763
- id: string;
764
- name: string;
765
- email?: string;
766
- role?: string;
767
- permissions?: string[];
768
- createdAt?: string;
769
- updatedAt?: string;
770
- }
771
- interface CreateUserInput {
772
- name: string;
773
- email?: string;
774
- role?: string;
775
- }
776
- interface UpdateUserInput {
777
- name?: string;
778
- email?: string;
779
- role?: string;
780
- }
781
- interface SuitePlugin {
782
- name: string;
783
- version: string;
784
- setup(suite: ContentManagementSuite): Promise<void>;
785
- teardown?(suite: ContentManagementSuite): Promise<void>;
786
- }
787
- interface ContentManagementLogger {
788
- error(message: string, ...args: unknown[]): void;
789
- warn(message: string, ...args: unknown[]): void;
790
- info(message: string, ...args: unknown[]): void;
791
- debug(message: string, ...args: unknown[]): void;
792
- }
793
- interface ContentManagementSuiteOptions {
794
- config?: Partial<ContentManagementConfig>;
795
- logger?: ContentManagementLogger;
796
- plugins?: SuitePlugin[];
797
- }
798
- interface ContentNamespace {
799
- list(filters?: ContentFilters): Promise<PaginatedResult<ContentItem>>;
800
- get(id: string): Promise<ContentItem>;
801
- create(input: CreateContentInput): Promise<ContentItem>;
802
- update(id: string, input: UpdateContentInput): Promise<ContentItem>;
803
- delete(id: string, options?: {
804
- soft?: boolean;
805
- }): Promise<void>;
806
- publish(id: string): Promise<ContentItem>;
807
- unpublish(id: string): Promise<ContentItem>;
808
- schedule(id: string, date: Date): Promise<ContentItem>;
809
- search(query: string, options?: SearchOptions): Promise<PaginatedResult<ContentItem>>;
810
- }
811
- interface ContentTypesNamespace {
812
- list(): ContentTypeInfo[];
813
- get(id: string): ContentTypeInfo;
814
- register(contentType: {
815
- id?: string;
816
- name?: string;
817
- }): void;
818
- unregister(id: string): void;
819
- }
820
- interface WorkflowsNamespace {
821
- list(): Promise<Workflow[]>;
822
- get(id: string): Promise<Workflow>;
823
- create(input: CreateWorkflowInput): Promise<Workflow>;
824
- update(id: string, input: UpdateWorkflowInput): Promise<Workflow>;
825
- delete(id: string): Promise<void>;
826
- }
827
- interface UsersNamespace {
828
- list(): Promise<PaginatedResult<User>>;
829
- get(id: string): Promise<User>;
830
- create(input: CreateUserInput): Promise<User>;
831
- update(id: string, input: UpdateUserInput): Promise<User>;
832
- delete(id: string): Promise<void>;
833
- }
834
- interface PermissionsNamespace {
835
- check(userId: string, permission: string): Promise<boolean>;
836
- grant(userId: string, permission: string): Promise<void>;
837
- revoke(userId: string, permission: string): Promise<void>;
838
- }
839
- interface ConfigNamespace {
840
- get(): ContentManagementConfig;
841
- update(partial: Partial<ContentManagementConfig>): ContentManagementConfig;
842
- }
843
- interface PluginsNamespace {
844
- register(plugin: SuitePlugin): Promise<void>;
845
- unregister(name: string): Promise<void>;
846
- }
847
- interface SuiteEventMap {
848
- 'content:created': ContentItem;
849
- 'content:updated': ContentItem;
850
- 'content:deleted': {
851
- id: string;
852
- };
853
- 'content:published': ContentItem;
854
- 'content:unpublished': ContentItem;
855
- 'content:scheduled': {
856
- item: ContentItem;
857
- date: Date;
858
- };
859
- 'user:created': User;
860
- 'user:updated': User;
861
- 'user:deleted': {
862
- id: string;
863
- };
864
- 'workflow:transition': WorkflowTransition;
865
- 'config:updated': ContentManagementConfig;
866
- 'error': ContentManagementError;
867
- 'initialized': void;
868
- 'disposed': void;
869
- }
870
- interface ContentManagementSuite {
871
- readonly content: ContentNamespace;
872
- readonly contentTypes: ContentTypesNamespace;
873
- readonly workflows: WorkflowsNamespace;
874
- readonly users: UsersNamespace;
875
- readonly permissions: PermissionsNamespace;
876
- readonly config: ConfigNamespace;
877
- readonly plugins: PluginsNamespace;
878
- initialize(): Promise<void>;
879
- dispose(): Promise<void>;
880
- on<K extends keyof SuiteEventMap>(event: K, listener: (payload: SuiteEventMap[K]) => void): this;
881
- emit<K extends keyof SuiteEventMap>(event: K, payload: SuiteEventMap[K]): boolean;
882
- }
1
+ import { a as ContentManagementSuiteOptions, b as ContentManagementSuite, C as ContentStorageAdapter } from './types-DQpwJ5e3.js';
2
+ export { ai as AIConfiguration, o as AIEnhanceService, af as AINamespace, ah as AIReview, l as AIReviewService, m as AIReviewServiceResult, A as AIReviewStorageNamespace, H as AIReviewSuggestion, n as AISocialGeneratorService, k as AnalyticsStorageNamespace, ab as ConfigNamespace, f as ConflictError, O as ContentFilters, J as ContentItem, d as ContentManagementConfig, c as ContentManagementConfigSchema, e as ContentManagementError, a4 as ContentManagementLogger, a6 as ContentNamespace, s as ContentPublishResult, r as ContentPublisher, u as ContentSource, g as ContentStorageNamespace, B as ContentTypeDefinition, T as ContentTypeInfo, h as ContentTypeStorageNamespace, a7 as ContentTypesNamespace, K as CreateContentInput, a1 as CreateUserInput, _ as CreateWorkflowInput, E as EnhanceOptions, p as EnhancedContent, F as ForbiddenError, v as IngestResult, I as InternalError, M as MediaStorageNamespace, N as NotFoundError, R as PaginatedResult, aa as PermissionsNamespace, z as PlatformInfo, x as PlatformPublishResult, ac as PluginsNamespace, t as PreviewResult, P as PublishResult, ad as PublishersNamespace, j as ScheduleStorageNamespace, D as SchemaValidationResult, Q as SearchOptions, y as SocialMetrics, ag as SocialNamespace, w as SocialPlatformAdapter, ak as SocialPost, S as SocialPostStorageNamespace, ae as SourcesNamespace, G as StageConditions, i as StoredContentTypeDefinition, q as Suggestion, a5 as SuiteEventMap, a3 as SuitePlugin, U as UnauthorizedError, L as UpdateContentInput, a2 as UpdateUserInput, $ as UpdateWorkflowInput, a0 as User, a9 as UsersNamespace, V as ValidationError, X as Workflow, aj as WorkflowConfiguration, Y as WorkflowStage, W as WorkflowStorageNamespace, Z as WorkflowTransition, a8 as WorkflowsNamespace } from './types-DQpwJ5e3.js';
3
+ import 'zod';
883
4
 
884
5
  /**
885
6
  * Factory function to create a new ContentManagementSuite instance.
886
7
  */
887
8
  declare function createContentManagementSuite(options?: ContentManagementSuiteOptions): ContentManagementSuite;
888
9
 
889
- export { type ConfigNamespace, ConflictError, type ContentFilters, type ContentItem, type ContentManagementConfig, ContentManagementConfigSchema, ContentManagementError, type ContentManagementLogger, type ContentManagementSuite, type ContentManagementSuiteOptions, type ContentNamespace, type ContentTypeInfo, type ContentTypesNamespace, type CreateContentInput, type CreateUserInput, type CreateWorkflowInput, ForbiddenError, InternalError, NotFoundError, type PaginatedResult, type PermissionsNamespace, type PluginsNamespace, type SearchOptions, type SuiteEventMap, type SuitePlugin, UnauthorizedError, type UpdateContentInput, type UpdateUserInput, type UpdateWorkflowInput, type User, type UsersNamespace, ValidationError, type Workflow, type WorkflowStage, type WorkflowTransition, type WorkflowsNamespace, createContentManagementSuite };
10
+ declare function createInMemoryAdapter(): ContentStorageAdapter;
11
+
12
+ export { ContentManagementSuite, ContentManagementSuiteOptions, ContentStorageAdapter, createContentManagementSuite, createInMemoryAdapter };