@redonvn/redai-openapi-wp-content-post 0.1.1

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,1690 @@
1
+ var pluginId = "redai-openapi-wp-content-post";
2
+ var pluginName = "RedAI User API Export - WP Content Post";
3
+ var version = "0.1.0";
4
+ var description = "OpenAPI export cho nhóm API user đã chọn: WP Content Post.";
5
+ var serverUrl = "https://v2.redai.vn/api";
6
+ var optional = true;
7
+ var tools = [
8
+ {
9
+ name: "redai_openapi_wp_content_post_wpcontentpostusercontroller_bulkdelete_v1",
10
+ description: "Xóa nhiều bài viết. Xóa nhiều bài viết cùng lúc (soft delete hoặc hard delete)",
11
+ method: "DELETE",
12
+ path: "/v1/user/posts",
13
+ operationId: "wpcontentpostusercontroller_bulkdelete_v1",
14
+ parameters: {
15
+ type: "object",
16
+ properties: {
17
+ headers: {
18
+ type: "object",
19
+ properties: {
20
+ "x-workspace-id": {
21
+ type: "string",
22
+ description: "Workspace ID của tenant hiện tại (UUID)"
23
+ },
24
+ "x-base-id": {
25
+ type: "string",
26
+ description: "Base ID của tenant hiện tại (UUID, optional)"
27
+ }
28
+ },
29
+ required: [
30
+ "x-workspace-id"
31
+ ],
32
+ additionalProperties: false
33
+ },
34
+ body: {
35
+ type: "object",
36
+ properties: {
37
+ ids: {
38
+ type: "array",
39
+ description: "Array of post IDs to delete",
40
+ items: {
41
+ type: "string"
42
+ }
43
+ },
44
+ permanent: {
45
+ type: "boolean",
46
+ description: "Permanent delete (hard delete) or soft delete (status=trash)",
47
+ "default": false
48
+ }
49
+ },
50
+ required: [
51
+ "ids"
52
+ ]
53
+ }
54
+ },
55
+ required: [
56
+ "headers",
57
+ "body"
58
+ ],
59
+ additionalProperties: false,
60
+ description: "Xóa nhiều bài viết tool arguments"
61
+ },
62
+ tags: [
63
+ "User - WP Content Post"
64
+ ]
65
+ },
66
+ {
67
+ name: "redai_openapi_wp_content_post_wpcontentpostusercontroller_create_v1",
68
+ description: "Tạo bài viết mới. User hoặc Employee tạo bài viết mới (draft hoặc publish)",
69
+ method: "POST",
70
+ path: "/v1/user/posts",
71
+ operationId: "wpcontentpostusercontroller_create_v1",
72
+ parameters: {
73
+ type: "object",
74
+ properties: {
75
+ headers: {
76
+ type: "object",
77
+ properties: {
78
+ "x-workspace-id": {
79
+ type: "string",
80
+ description: "Workspace ID của tenant hiện tại (UUID)"
81
+ },
82
+ "x-base-id": {
83
+ type: "string",
84
+ description: "Base ID của tenant hiện tại (UUID, optional)"
85
+ }
86
+ },
87
+ required: [
88
+ "x-workspace-id"
89
+ ],
90
+ additionalProperties: false
91
+ },
92
+ body: {
93
+ type: "object",
94
+ properties: {
95
+ title: {
96
+ type: "string",
97
+ description: "Tiêu đề bài viết"
98
+ },
99
+ slug: {
100
+ type: "string",
101
+ description: "Slug (friendly URL) - auto-generate nếu không nhập"
102
+ },
103
+ excerpt: {
104
+ type: "string",
105
+ description: "Mô tả ngắn"
106
+ },
107
+ content: {
108
+ description: "Nội dung bài viết (Gutenberg blocks)",
109
+ allOf: [
110
+ {
111
+ type: "object",
112
+ properties: {
113
+ blocks: {
114
+ type: "array",
115
+ description: "Array of Gutenberg blocks",
116
+ items: {
117
+ type: "array",
118
+ items: {
119
+ type: "a"
120
+ }
121
+ }
122
+ },
123
+ meta: {
124
+ type: "object",
125
+ description: "Additional metadata"
126
+ },
127
+ settings: {
128
+ type: "object",
129
+ description: "Content settings"
130
+ }
131
+ },
132
+ required: [
133
+ "blocks"
134
+ ]
135
+ }
136
+ ]
137
+ },
138
+ featuredImageId: {
139
+ type: "string",
140
+ description: "ID ảnh đại diện (UUID)"
141
+ },
142
+ status: {
143
+ type: "string",
144
+ description: "Trạng thái bài viết",
145
+ "default": "draft",
146
+ "enum": [
147
+ "draft",
148
+ "pending",
149
+ "private",
150
+ "publish",
151
+ "future",
152
+ "trash",
153
+ "archived"
154
+ ]
155
+ },
156
+ type: {
157
+ type: "string",
158
+ description: "Loại bài viết",
159
+ "default": "post"
160
+ },
161
+ metaTitle: {
162
+ type: "string",
163
+ description: "SEO: Meta title (max 70 chars)"
164
+ },
165
+ metaDescription: {
166
+ type: "string",
167
+ description: "SEO: Meta description (max 160 chars)"
168
+ },
169
+ metaKeywords: {
170
+ type: "array",
171
+ description: "SEO: Meta keywords",
172
+ items: {
173
+ type: "string"
174
+ }
175
+ },
176
+ commentStatus: {
177
+ type: "string",
178
+ description: "Trạng thái comment",
179
+ "default": "open"
180
+ },
181
+ sticky: {
182
+ type: "boolean",
183
+ description: "Đánh dấu sticky post",
184
+ "default": false
185
+ },
186
+ password: {
187
+ type: "string",
188
+ description: "Mật khẩu bảo vệ bài viết (plaintext)"
189
+ },
190
+ menuOrder: {
191
+ type: "number",
192
+ description: "Thứ tự hiển thị",
193
+ "default": 0
194
+ }
195
+ },
196
+ required: [
197
+ "title",
198
+ "content"
199
+ ]
200
+ }
201
+ },
202
+ required: [
203
+ "headers",
204
+ "body"
205
+ ],
206
+ additionalProperties: false,
207
+ description: "Tạo bài viết mới tool arguments"
208
+ },
209
+ tags: [
210
+ "User - WP Content Post"
211
+ ]
212
+ },
213
+ {
214
+ name: "redai_openapi_wp_content_post_wpcontentpostusercontroller_findall_v1",
215
+ description: "Lấy danh sách bài viết. Lấy danh sách bài viết của user/employee với filters và pagination",
216
+ method: "GET",
217
+ path: "/v1/user/posts",
218
+ operationId: "wpcontentpostusercontroller_findall_v1",
219
+ parameters: {
220
+ type: "object",
221
+ properties: {
222
+ query: {
223
+ type: "object",
224
+ properties: {
225
+ status: {
226
+ type: "string",
227
+ "enum": [
228
+ "draft",
229
+ "pending",
230
+ "private",
231
+ "publish",
232
+ "future",
233
+ "trash",
234
+ "archived"
235
+ ],
236
+ description: "Filter by status"
237
+ },
238
+ type: {
239
+ type: "string",
240
+ description: "Filter by type"
241
+ },
242
+ search: {
243
+ type: "string",
244
+ description: "Search in title, excerpt, content"
245
+ },
246
+ sticky: {
247
+ type: "boolean",
248
+ "default": false,
249
+ description: "Filter sticky posts only"
250
+ },
251
+ sortBy: {
252
+ type: "string",
253
+ "default": "createdAt",
254
+ description: "Sort field"
255
+ },
256
+ sortOrder: {
257
+ type: "string",
258
+ "default": "DESC",
259
+ "enum": [
260
+ "ASC",
261
+ "DESC"
262
+ ],
263
+ description: "Sort order"
264
+ },
265
+ page: {
266
+ type: "number",
267
+ "default": 1,
268
+ description: "Page number"
269
+ },
270
+ limit: {
271
+ type: "number",
272
+ "default": 10,
273
+ description: "Items per page"
274
+ }
275
+ },
276
+ additionalProperties: false
277
+ },
278
+ headers: {
279
+ type: "object",
280
+ properties: {
281
+ "x-workspace-id": {
282
+ type: "string",
283
+ description: "Workspace ID của tenant hiện tại (UUID)"
284
+ },
285
+ "x-base-id": {
286
+ type: "string",
287
+ description: "Base ID của tenant hiện tại (UUID, optional)"
288
+ }
289
+ },
290
+ required: [
291
+ "x-workspace-id"
292
+ ],
293
+ additionalProperties: false
294
+ }
295
+ },
296
+ required: [
297
+ "headers"
298
+ ],
299
+ additionalProperties: false,
300
+ description: "Lấy danh sách bài viết tool arguments"
301
+ },
302
+ tags: [
303
+ "User - WP Content Post"
304
+ ]
305
+ },
306
+ {
307
+ name: "redai_openapi_wp_content_post_wpcontentpostusercontroller_findone_v1",
308
+ description: "Lấy chi tiết bài viết. Lấy thông tin chi tiết của một bài viết (chỉ bài viết của chính user/employee)",
309
+ method: "GET",
310
+ path: "/v1/user/posts/{id}",
311
+ operationId: "wpcontentpostusercontroller_findone_v1",
312
+ parameters: {
313
+ type: "object",
314
+ properties: {
315
+ path: {
316
+ type: "object",
317
+ properties: {
318
+ id: {
319
+ type: "string",
320
+ description: "Post ID (UUID)"
321
+ }
322
+ },
323
+ required: [
324
+ "id"
325
+ ],
326
+ additionalProperties: false
327
+ },
328
+ headers: {
329
+ type: "object",
330
+ properties: {
331
+ "x-workspace-id": {
332
+ type: "string",
333
+ description: "Workspace ID của tenant hiện tại (UUID)"
334
+ },
335
+ "x-base-id": {
336
+ type: "string",
337
+ description: "Base ID của tenant hiện tại (UUID, optional)"
338
+ }
339
+ },
340
+ required: [
341
+ "x-workspace-id"
342
+ ],
343
+ additionalProperties: false
344
+ }
345
+ },
346
+ required: [
347
+ "path",
348
+ "headers"
349
+ ],
350
+ additionalProperties: false,
351
+ description: "Lấy chi tiết bài viết tool arguments"
352
+ },
353
+ tags: [
354
+ "User - WP Content Post"
355
+ ]
356
+ },
357
+ {
358
+ name: "redai_openapi_wp_content_post_wpcontentpostusercontroller_submitforreview_v1",
359
+ description: "Gửi bài viết đi duyệt. Chuyển trạng thái bài viết sang pending để chờ admin duyệt",
360
+ method: "POST",
361
+ path: "/v1/user/posts/{id}/submit-for-review",
362
+ operationId: "wpcontentpostusercontroller_submitforreview_v1",
363
+ parameters: {
364
+ type: "object",
365
+ properties: {
366
+ path: {
367
+ type: "object",
368
+ properties: {
369
+ id: {
370
+ type: "string",
371
+ description: "Post ID (UUID)"
372
+ }
373
+ },
374
+ required: [
375
+ "id"
376
+ ],
377
+ additionalProperties: false
378
+ },
379
+ headers: {
380
+ type: "object",
381
+ properties: {
382
+ "x-workspace-id": {
383
+ type: "string",
384
+ description: "Workspace ID của tenant hiện tại (UUID)"
385
+ },
386
+ "x-base-id": {
387
+ type: "string",
388
+ description: "Base ID của tenant hiện tại (UUID, optional)"
389
+ }
390
+ },
391
+ required: [
392
+ "x-workspace-id"
393
+ ],
394
+ additionalProperties: false
395
+ }
396
+ },
397
+ required: [
398
+ "path",
399
+ "headers"
400
+ ],
401
+ additionalProperties: false,
402
+ description: "Gửi bài viết đi duyệt tool arguments"
403
+ },
404
+ tags: [
405
+ "User - WP Content Post"
406
+ ]
407
+ },
408
+ {
409
+ name: "redai_openapi_wp_content_post_wpcontentpostusercontroller_togglesticky_v1",
410
+ description: "Toggle sticky status. Đảo trạng thái sticky của bài viết (true → false hoặc false → true)",
411
+ method: "PATCH",
412
+ path: "/v1/user/posts/{id}/toggle-sticky",
413
+ operationId: "wpcontentpostusercontroller_togglesticky_v1",
414
+ parameters: {
415
+ type: "object",
416
+ properties: {
417
+ path: {
418
+ type: "object",
419
+ properties: {
420
+ id: {
421
+ type: "string",
422
+ description: "Post ID (UUID)"
423
+ }
424
+ },
425
+ required: [
426
+ "id"
427
+ ],
428
+ additionalProperties: false
429
+ },
430
+ headers: {
431
+ type: "object",
432
+ properties: {
433
+ "x-workspace-id": {
434
+ type: "string",
435
+ description: "Workspace ID của tenant hiện tại (UUID)"
436
+ },
437
+ "x-base-id": {
438
+ type: "string",
439
+ description: "Base ID của tenant hiện tại (UUID, optional)"
440
+ }
441
+ },
442
+ required: [
443
+ "x-workspace-id"
444
+ ],
445
+ additionalProperties: false
446
+ }
447
+ },
448
+ required: [
449
+ "path",
450
+ "headers"
451
+ ],
452
+ additionalProperties: false,
453
+ description: "Toggle sticky status tool arguments"
454
+ },
455
+ tags: [
456
+ "User - WP Content Post"
457
+ ]
458
+ },
459
+ {
460
+ name: "redai_openapi_wp_content_post_wpcontentpostusercontroller_update_v1",
461
+ description: "Cập nhật bài viết. Cập nhật thông tin bài viết (chỉ bài viết của chính user/employee)",
462
+ method: "PUT",
463
+ path: "/v1/user/posts/{id}",
464
+ operationId: "wpcontentpostusercontroller_update_v1",
465
+ parameters: {
466
+ type: "object",
467
+ properties: {
468
+ path: {
469
+ type: "object",
470
+ properties: {
471
+ id: {
472
+ type: "string",
473
+ description: "Post ID (UUID)"
474
+ }
475
+ },
476
+ required: [
477
+ "id"
478
+ ],
479
+ additionalProperties: false
480
+ },
481
+ headers: {
482
+ type: "object",
483
+ properties: {
484
+ "x-workspace-id": {
485
+ type: "string",
486
+ description: "Workspace ID của tenant hiện tại (UUID)"
487
+ },
488
+ "x-base-id": {
489
+ type: "string",
490
+ description: "Base ID của tenant hiện tại (UUID, optional)"
491
+ }
492
+ },
493
+ required: [
494
+ "x-workspace-id"
495
+ ],
496
+ additionalProperties: false
497
+ },
498
+ body: {
499
+ type: "object",
500
+ properties: {
501
+ title: {
502
+ type: "string",
503
+ description: "Tiêu đề bài viết"
504
+ },
505
+ slug: {
506
+ type: "string",
507
+ description: "Slug (friendly URL) - auto-generate nếu không nhập"
508
+ },
509
+ excerpt: {
510
+ type: "string",
511
+ description: "Mô tả ngắn"
512
+ },
513
+ content: {
514
+ description: "Nội dung bài viết (Gutenberg blocks)",
515
+ allOf: [
516
+ {
517
+ type: "object",
518
+ properties: {
519
+ blocks: {
520
+ type: "array",
521
+ description: "Array of Gutenberg blocks",
522
+ items: {
523
+ type: "array",
524
+ items: {
525
+ type: "a"
526
+ }
527
+ }
528
+ },
529
+ meta: {
530
+ type: "object",
531
+ description: "Additional metadata"
532
+ },
533
+ settings: {
534
+ type: "object",
535
+ description: "Content settings"
536
+ }
537
+ },
538
+ required: [
539
+ "blocks"
540
+ ]
541
+ }
542
+ ]
543
+ },
544
+ featuredImageId: {
545
+ type: "string",
546
+ description: "ID ảnh đại diện (UUID)"
547
+ },
548
+ status: {
549
+ type: "string",
550
+ description: "Trạng thái bài viết",
551
+ "default": "draft",
552
+ "enum": [
553
+ "draft",
554
+ "pending",
555
+ "private",
556
+ "publish",
557
+ "future",
558
+ "trash",
559
+ "archived"
560
+ ]
561
+ },
562
+ type: {
563
+ type: "string",
564
+ description: "Loại bài viết",
565
+ "default": "post"
566
+ },
567
+ metaTitle: {
568
+ type: "string",
569
+ description: "SEO: Meta title (max 70 chars)"
570
+ },
571
+ metaDescription: {
572
+ type: "string",
573
+ description: "SEO: Meta description (max 160 chars)"
574
+ },
575
+ metaKeywords: {
576
+ type: "array",
577
+ description: "SEO: Meta keywords",
578
+ items: {
579
+ type: "string"
580
+ }
581
+ },
582
+ commentStatus: {
583
+ type: "string",
584
+ description: "Trạng thái comment",
585
+ "default": "open"
586
+ },
587
+ sticky: {
588
+ type: "boolean",
589
+ description: "Đánh dấu sticky post",
590
+ "default": false
591
+ },
592
+ password: {
593
+ type: "string",
594
+ description: "Mật khẩu bảo vệ bài viết (plaintext)"
595
+ },
596
+ menuOrder: {
597
+ type: "number",
598
+ description: "Thứ tự hiển thị",
599
+ "default": 0
600
+ }
601
+ }
602
+ }
603
+ },
604
+ required: [
605
+ "path",
606
+ "headers",
607
+ "body"
608
+ ],
609
+ additionalProperties: false,
610
+ description: "Cập nhật bài viết tool arguments"
611
+ },
612
+ tags: [
613
+ "User - WP Content Post"
614
+ ]
615
+ }
616
+ ];
617
+ var toolCatalog = {
618
+ pluginId: pluginId,
619
+ pluginName: pluginName,
620
+ version: version,
621
+ description: description,
622
+ serverUrl: serverUrl,
623
+ optional: optional,
624
+ tools: tools
625
+ };
626
+
627
+ var openapi = "3.0.0";
628
+ var paths = {
629
+ "/v1/user/posts": {
630
+ post: {
631
+ description: "User hoặc Employee tạo bài viết mới (draft hoặc publish)",
632
+ operationId: "WpContentPostUserController_create_v1",
633
+ parameters: [
634
+ {
635
+ name: "x-workspace-id",
636
+ "in": "header",
637
+ description: "Workspace ID của tenant hiện tại (UUID)",
638
+ required: true,
639
+ schema: {
640
+ type: "string",
641
+ format: "uuid"
642
+ }
643
+ },
644
+ {
645
+ name: "x-base-id",
646
+ "in": "header",
647
+ description: "Base ID của tenant hiện tại (UUID, optional)",
648
+ required: false,
649
+ schema: {
650
+ type: "string",
651
+ format: "uuid"
652
+ }
653
+ }
654
+ ],
655
+ requestBody: {
656
+ required: true,
657
+ content: {
658
+ "application/json": {
659
+ schema: {
660
+ $ref: "#/components/schemas/CreatePostDto"
661
+ }
662
+ }
663
+ }
664
+ },
665
+ responses: {
666
+ "201": {
667
+ description: "Bài viết đã được tạo thành công",
668
+ content: {
669
+ "application/json": {
670
+ schema: {
671
+ $ref: "#/components/schemas/PostResponseDto"
672
+ }
673
+ }
674
+ }
675
+ },
676
+ "400": {
677
+ description: "Dữ liệu đầu vào không hợp lệ"
678
+ }
679
+ },
680
+ security: [
681
+ {
682
+ "JWT-auth": [
683
+ ]
684
+ }
685
+ ],
686
+ summary: "Tạo bài viết mới",
687
+ tags: [
688
+ "User - WP Content Post"
689
+ ]
690
+ },
691
+ get: {
692
+ description: "Lấy danh sách bài viết của user/employee với filters và pagination",
693
+ operationId: "WpContentPostUserController_findAll_v1",
694
+ parameters: [
695
+ {
696
+ name: "x-workspace-id",
697
+ "in": "header",
698
+ description: "Workspace ID của tenant hiện tại (UUID)",
699
+ required: true,
700
+ schema: {
701
+ type: "string",
702
+ format: "uuid"
703
+ }
704
+ },
705
+ {
706
+ name: "x-base-id",
707
+ "in": "header",
708
+ description: "Base ID của tenant hiện tại (UUID, optional)",
709
+ required: false,
710
+ schema: {
711
+ type: "string",
712
+ format: "uuid"
713
+ }
714
+ },
715
+ {
716
+ name: "status",
717
+ required: false,
718
+ "in": "query",
719
+ description: "Filter by status",
720
+ schema: {
721
+ type: "string",
722
+ "enum": [
723
+ "draft",
724
+ "pending",
725
+ "private",
726
+ "publish",
727
+ "future",
728
+ "trash",
729
+ "archived"
730
+ ]
731
+ }
732
+ },
733
+ {
734
+ name: "type",
735
+ required: false,
736
+ "in": "query",
737
+ description: "Filter by type",
738
+ schema: {
739
+ example: "post",
740
+ type: "string"
741
+ }
742
+ },
743
+ {
744
+ name: "search",
745
+ required: false,
746
+ "in": "query",
747
+ description: "Search in title, excerpt, content",
748
+ schema: {
749
+ example: "hello",
750
+ type: "string"
751
+ }
752
+ },
753
+ {
754
+ name: "sticky",
755
+ required: false,
756
+ "in": "query",
757
+ description: "Filter sticky posts only",
758
+ schema: {
759
+ "default": false,
760
+ type: "boolean"
761
+ }
762
+ },
763
+ {
764
+ name: "sortBy",
765
+ required: false,
766
+ "in": "query",
767
+ description: "Sort field",
768
+ schema: {
769
+ "default": "createdAt",
770
+ example: "createdAt",
771
+ type: "string"
772
+ }
773
+ },
774
+ {
775
+ name: "sortOrder",
776
+ required: false,
777
+ "in": "query",
778
+ description: "Sort order",
779
+ schema: {
780
+ "default": "DESC",
781
+ type: "string",
782
+ "enum": [
783
+ "ASC",
784
+ "DESC"
785
+ ]
786
+ }
787
+ },
788
+ {
789
+ name: "page",
790
+ required: false,
791
+ "in": "query",
792
+ description: "Page number",
793
+ schema: {
794
+ minimum: 1,
795
+ "default": 1,
796
+ type: "number"
797
+ }
798
+ },
799
+ {
800
+ name: "limit",
801
+ required: false,
802
+ "in": "query",
803
+ description: "Items per page",
804
+ schema: {
805
+ minimum: 1,
806
+ maximum: 100,
807
+ "default": 10,
808
+ type: "number"
809
+ }
810
+ }
811
+ ],
812
+ responses: {
813
+ "200": {
814
+ description: "Danh sách bài viết",
815
+ content: {
816
+ "application/json": {
817
+ schema: {
818
+ type: "object",
819
+ properties: {
820
+ data: {
821
+ type: "array",
822
+ items: {
823
+ $ref: "#/components/schemas/PostResponseDto"
824
+ }
825
+ },
826
+ total: {
827
+ type: "number",
828
+ example: 100
829
+ },
830
+ page: {
831
+ type: "number",
832
+ example: 1
833
+ },
834
+ limit: {
835
+ type: "number",
836
+ example: 10
837
+ }
838
+ }
839
+ }
840
+ }
841
+ }
842
+ }
843
+ },
844
+ security: [
845
+ {
846
+ "JWT-auth": [
847
+ ]
848
+ }
849
+ ],
850
+ summary: "Lấy danh sách bài viết",
851
+ tags: [
852
+ "User - WP Content Post"
853
+ ]
854
+ },
855
+ "delete": {
856
+ description: "Xóa nhiều bài viết cùng lúc (soft delete hoặc hard delete)",
857
+ operationId: "WpContentPostUserController_bulkDelete_v1",
858
+ parameters: [
859
+ {
860
+ name: "x-workspace-id",
861
+ "in": "header",
862
+ description: "Workspace ID của tenant hiện tại (UUID)",
863
+ required: true,
864
+ schema: {
865
+ type: "string",
866
+ format: "uuid"
867
+ }
868
+ },
869
+ {
870
+ name: "x-base-id",
871
+ "in": "header",
872
+ description: "Base ID của tenant hiện tại (UUID, optional)",
873
+ required: false,
874
+ schema: {
875
+ type: "string",
876
+ format: "uuid"
877
+ }
878
+ }
879
+ ],
880
+ requestBody: {
881
+ required: true,
882
+ content: {
883
+ "application/json": {
884
+ schema: {
885
+ $ref: "#/components/schemas/BulkDeletePostDto"
886
+ }
887
+ }
888
+ }
889
+ },
890
+ responses: {
891
+ "200": {
892
+ description: "Kết quả bulk delete",
893
+ content: {
894
+ "application/json": {
895
+ schema: {
896
+ type: "object",
897
+ properties: {
898
+ deleted: {
899
+ type: "number",
900
+ example: 5
901
+ },
902
+ failed: {
903
+ type: "array",
904
+ items: {
905
+ type: "string"
906
+ },
907
+ example: [
908
+ "uuid-1",
909
+ "uuid-2"
910
+ ]
911
+ }
912
+ }
913
+ }
914
+ }
915
+ }
916
+ }
917
+ },
918
+ security: [
919
+ {
920
+ "JWT-auth": [
921
+ ]
922
+ }
923
+ ],
924
+ summary: "Xóa nhiều bài viết",
925
+ tags: [
926
+ "User - WP Content Post"
927
+ ]
928
+ }
929
+ },
930
+ "/v1/user/posts/{id}": {
931
+ get: {
932
+ description: "Lấy thông tin chi tiết của một bài viết (chỉ bài viết của chính user/employee)",
933
+ operationId: "WpContentPostUserController_findOne_v1",
934
+ parameters: [
935
+ {
936
+ name: "x-workspace-id",
937
+ "in": "header",
938
+ description: "Workspace ID của tenant hiện tại (UUID)",
939
+ required: true,
940
+ schema: {
941
+ type: "string",
942
+ format: "uuid"
943
+ }
944
+ },
945
+ {
946
+ name: "x-base-id",
947
+ "in": "header",
948
+ description: "Base ID của tenant hiện tại (UUID, optional)",
949
+ required: false,
950
+ schema: {
951
+ type: "string",
952
+ format: "uuid"
953
+ }
954
+ },
955
+ {
956
+ name: "id",
957
+ required: true,
958
+ "in": "path",
959
+ description: "Post ID (UUID)",
960
+ schema: {
961
+ example: "123e4567-e89b-12d3-a456-426614174000",
962
+ type: "string"
963
+ }
964
+ }
965
+ ],
966
+ responses: {
967
+ "200": {
968
+ description: "Chi tiết bài viết",
969
+ content: {
970
+ "application/json": {
971
+ schema: {
972
+ $ref: "#/components/schemas/PostResponseDto"
973
+ }
974
+ }
975
+ }
976
+ },
977
+ "403": {
978
+ description: "Không có quyền truy cập bài viết này"
979
+ },
980
+ "404": {
981
+ description: "Không tìm thấy bài viết"
982
+ }
983
+ },
984
+ security: [
985
+ {
986
+ "JWT-auth": [
987
+ ]
988
+ }
989
+ ],
990
+ summary: "Lấy chi tiết bài viết",
991
+ tags: [
992
+ "User - WP Content Post"
993
+ ]
994
+ },
995
+ put: {
996
+ description: "Cập nhật thông tin bài viết (chỉ bài viết của chính user/employee)",
997
+ operationId: "WpContentPostUserController_update_v1",
998
+ parameters: [
999
+ {
1000
+ name: "x-workspace-id",
1001
+ "in": "header",
1002
+ description: "Workspace ID của tenant hiện tại (UUID)",
1003
+ required: true,
1004
+ schema: {
1005
+ type: "string",
1006
+ format: "uuid"
1007
+ }
1008
+ },
1009
+ {
1010
+ name: "x-base-id",
1011
+ "in": "header",
1012
+ description: "Base ID của tenant hiện tại (UUID, optional)",
1013
+ required: false,
1014
+ schema: {
1015
+ type: "string",
1016
+ format: "uuid"
1017
+ }
1018
+ },
1019
+ {
1020
+ name: "id",
1021
+ required: true,
1022
+ "in": "path",
1023
+ description: "Post ID (UUID)",
1024
+ schema: {
1025
+ example: "123e4567-e89b-12d3-a456-426614174000",
1026
+ type: "string"
1027
+ }
1028
+ }
1029
+ ],
1030
+ requestBody: {
1031
+ required: true,
1032
+ content: {
1033
+ "application/json": {
1034
+ schema: {
1035
+ $ref: "#/components/schemas/UpdatePostDto"
1036
+ }
1037
+ }
1038
+ }
1039
+ },
1040
+ responses: {
1041
+ "200": {
1042
+ description: "Bài viết đã được cập nhật",
1043
+ content: {
1044
+ "application/json": {
1045
+ schema: {
1046
+ $ref: "#/components/schemas/PostResponseDto"
1047
+ }
1048
+ }
1049
+ }
1050
+ },
1051
+ "403": {
1052
+ description: "Không có quyền cập nhật bài viết này"
1053
+ },
1054
+ "404": {
1055
+ description: "Không tìm thấy bài viết"
1056
+ }
1057
+ },
1058
+ security: [
1059
+ {
1060
+ "JWT-auth": [
1061
+ ]
1062
+ }
1063
+ ],
1064
+ summary: "Cập nhật bài viết",
1065
+ tags: [
1066
+ "User - WP Content Post"
1067
+ ]
1068
+ }
1069
+ },
1070
+ "/v1/user/posts/{id}/submit-for-review": {
1071
+ post: {
1072
+ description: "Chuyển trạng thái bài viết sang pending để chờ admin duyệt",
1073
+ operationId: "WpContentPostUserController_submitForReview_v1",
1074
+ parameters: [
1075
+ {
1076
+ name: "x-workspace-id",
1077
+ "in": "header",
1078
+ description: "Workspace ID của tenant hiện tại (UUID)",
1079
+ required: true,
1080
+ schema: {
1081
+ type: "string",
1082
+ format: "uuid"
1083
+ }
1084
+ },
1085
+ {
1086
+ name: "x-base-id",
1087
+ "in": "header",
1088
+ description: "Base ID của tenant hiện tại (UUID, optional)",
1089
+ required: false,
1090
+ schema: {
1091
+ type: "string",
1092
+ format: "uuid"
1093
+ }
1094
+ },
1095
+ {
1096
+ name: "id",
1097
+ required: true,
1098
+ "in": "path",
1099
+ description: "Post ID (UUID)",
1100
+ schema: {
1101
+ example: "123e4567-e89b-12d3-a456-426614174000",
1102
+ type: "string"
1103
+ }
1104
+ }
1105
+ ],
1106
+ responses: {
1107
+ "200": {
1108
+ description: "Bài viết đã được gửi đi duyệt",
1109
+ content: {
1110
+ "application/json": {
1111
+ schema: {
1112
+ $ref: "#/components/schemas/PostResponseDto"
1113
+ }
1114
+ }
1115
+ }
1116
+ },
1117
+ "400": {
1118
+ description: "Bài viết chưa đủ thông tin bắt buộc"
1119
+ },
1120
+ "403": {
1121
+ description: "Không có quyền gửi duyệt bài viết này"
1122
+ },
1123
+ "404": {
1124
+ description: "Không tìm thấy bài viết"
1125
+ }
1126
+ },
1127
+ security: [
1128
+ {
1129
+ "JWT-auth": [
1130
+ ]
1131
+ }
1132
+ ],
1133
+ summary: "Gửi bài viết đi duyệt",
1134
+ tags: [
1135
+ "User - WP Content Post"
1136
+ ]
1137
+ }
1138
+ },
1139
+ "/v1/user/posts/{id}/toggle-sticky": {
1140
+ patch: {
1141
+ description: "Đảo trạng thái sticky của bài viết (true → false hoặc false → true)",
1142
+ operationId: "WpContentPostUserController_toggleSticky_v1",
1143
+ parameters: [
1144
+ {
1145
+ name: "x-workspace-id",
1146
+ "in": "header",
1147
+ description: "Workspace ID của tenant hiện tại (UUID)",
1148
+ required: true,
1149
+ schema: {
1150
+ type: "string",
1151
+ format: "uuid"
1152
+ }
1153
+ },
1154
+ {
1155
+ name: "x-base-id",
1156
+ "in": "header",
1157
+ description: "Base ID của tenant hiện tại (UUID, optional)",
1158
+ required: false,
1159
+ schema: {
1160
+ type: "string",
1161
+ format: "uuid"
1162
+ }
1163
+ },
1164
+ {
1165
+ name: "id",
1166
+ required: true,
1167
+ "in": "path",
1168
+ description: "Post ID (UUID)",
1169
+ schema: {
1170
+ example: "123e4567-e89b-12d3-a456-426614174000",
1171
+ type: "string"
1172
+ }
1173
+ }
1174
+ ],
1175
+ responses: {
1176
+ "200": {
1177
+ description: "Sticky status đã được cập nhật",
1178
+ content: {
1179
+ "application/json": {
1180
+ schema: {
1181
+ $ref: "#/components/schemas/PostResponseDto"
1182
+ }
1183
+ }
1184
+ }
1185
+ },
1186
+ "403": {
1187
+ description: "Không có quyền chỉnh sửa bài viết này"
1188
+ },
1189
+ "404": {
1190
+ description: "Không tìm thấy bài viết"
1191
+ }
1192
+ },
1193
+ security: [
1194
+ {
1195
+ "JWT-auth": [
1196
+ ]
1197
+ }
1198
+ ],
1199
+ summary: "Toggle sticky status",
1200
+ tags: [
1201
+ "User - WP Content Post"
1202
+ ]
1203
+ }
1204
+ }
1205
+ };
1206
+ var info = {
1207
+ title: "RedAI User API Export - WP Content Post",
1208
+ description: "OpenAPI export cho nhóm API user đã chọn: WP Content Post.",
1209
+ version: "1.0",
1210
+ contact: {
1211
+ name: "RedAI Support",
1212
+ url: "https://redai.com/support",
1213
+ email: "support@redai.com"
1214
+ },
1215
+ license: {
1216
+ name: "MIT",
1217
+ url: "https://opensource.org/licenses/MIT"
1218
+ }
1219
+ };
1220
+ var tags = [
1221
+ {
1222
+ name: "User - WP Content Post",
1223
+ description: "User - WP Content Post endpoints"
1224
+ }
1225
+ ];
1226
+ var servers = [
1227
+ {
1228
+ url: "http://localhost:3000",
1229
+ description: "Local Server"
1230
+ },
1231
+ {
1232
+ url: "http://localhost:3003",
1233
+ description: "Development Server"
1234
+ },
1235
+ {
1236
+ url: "http://14.225.29.196:3003",
1237
+ description: "Test Server"
1238
+ },
1239
+ {
1240
+ url: "https://api-staging.redai.vn",
1241
+ description: "Staging Server"
1242
+ },
1243
+ {
1244
+ url: "https://v2.redai.vn/api",
1245
+ description: "Production Server"
1246
+ }
1247
+ ];
1248
+ var components = {
1249
+ schemas: {
1250
+ CreatePostDto: {
1251
+ type: "object",
1252
+ properties: {
1253
+ title: {
1254
+ type: "string",
1255
+ description: "Tiêu đề bài viết",
1256
+ example: "Hello World"
1257
+ },
1258
+ slug: {
1259
+ type: "string",
1260
+ description: "Slug (friendly URL) - auto-generate nếu không nhập",
1261
+ example: "hello-world"
1262
+ },
1263
+ excerpt: {
1264
+ type: "string",
1265
+ description: "Mô tả ngắn",
1266
+ example: "This is a short excerpt..."
1267
+ },
1268
+ content: {
1269
+ description: "Nội dung bài viết (Gutenberg blocks)",
1270
+ allOf: [
1271
+ {
1272
+ $ref: "#/components/schemas/WpContentDto"
1273
+ }
1274
+ ]
1275
+ },
1276
+ featuredImageId: {
1277
+ type: "string",
1278
+ description: "ID ảnh đại diện (UUID)",
1279
+ example: "123e4567-e89b-12d3-a456-426614174000"
1280
+ },
1281
+ status: {
1282
+ type: "string",
1283
+ description: "Trạng thái bài viết",
1284
+ "enum": [
1285
+ "draft",
1286
+ "pending",
1287
+ "private",
1288
+ "publish",
1289
+ "future",
1290
+ "trash",
1291
+ "archived"
1292
+ ],
1293
+ "default": "draft"
1294
+ },
1295
+ type: {
1296
+ type: "string",
1297
+ description: "Loại bài viết",
1298
+ example: "post",
1299
+ "default": "post"
1300
+ },
1301
+ metaTitle: {
1302
+ type: "string",
1303
+ description: "SEO: Meta title (max 70 chars)",
1304
+ example: "Hello World - My Blog",
1305
+ maxLength: 70
1306
+ },
1307
+ metaDescription: {
1308
+ type: "string",
1309
+ description: "SEO: Meta description (max 160 chars)",
1310
+ maxLength: 160
1311
+ },
1312
+ metaKeywords: {
1313
+ description: "SEO: Meta keywords",
1314
+ example: [
1315
+ "wordpress",
1316
+ "cms",
1317
+ "blog"
1318
+ ],
1319
+ type: "array",
1320
+ items: {
1321
+ type: "string"
1322
+ }
1323
+ },
1324
+ commentStatus: {
1325
+ type: "string",
1326
+ description: "Trạng thái comment",
1327
+ example: "open",
1328
+ "default": "open"
1329
+ },
1330
+ sticky: {
1331
+ type: "boolean",
1332
+ description: "Đánh dấu sticky post",
1333
+ "default": false
1334
+ },
1335
+ password: {
1336
+ type: "string",
1337
+ description: "Mật khẩu bảo vệ bài viết (plaintext)",
1338
+ maxLength: 255
1339
+ },
1340
+ menuOrder: {
1341
+ type: "number",
1342
+ description: "Thứ tự hiển thị",
1343
+ example: 0,
1344
+ "default": 0
1345
+ }
1346
+ },
1347
+ required: [
1348
+ "title",
1349
+ "content"
1350
+ ]
1351
+ },
1352
+ PostResponseDto: {
1353
+ type: "object",
1354
+ properties: {
1355
+ id: {
1356
+ type: "string",
1357
+ description: "Post ID (UUID)",
1358
+ example: "123e4567-e89b-12d3-a456-426614174000"
1359
+ },
1360
+ title: {
1361
+ type: "string",
1362
+ description: "Tiêu đề bài viết",
1363
+ example: "Hello World"
1364
+ },
1365
+ slug: {
1366
+ type: "string",
1367
+ description: "Slug (friendly URL)",
1368
+ example: "hello-world"
1369
+ },
1370
+ excerpt: {
1371
+ type: "string",
1372
+ description: "Mô tả ngắn"
1373
+ },
1374
+ content: {
1375
+ type: "object",
1376
+ description: "Nội dung bài viết (rendered HTML + blocks)"
1377
+ },
1378
+ featuredImageId: {
1379
+ type: "string",
1380
+ description: "ID ảnh đại diện"
1381
+ },
1382
+ status: {
1383
+ type: "string",
1384
+ description: "Trạng thái bài viết",
1385
+ "enum": [
1386
+ "draft",
1387
+ "pending",
1388
+ "private",
1389
+ "publish",
1390
+ "future",
1391
+ "trash",
1392
+ "archived"
1393
+ ]
1394
+ },
1395
+ type: {
1396
+ type: "string",
1397
+ description: "Loại bài viết",
1398
+ example: "post"
1399
+ },
1400
+ authorId: {
1401
+ type: "number",
1402
+ description: "ID người dùng (author)"
1403
+ },
1404
+ employeeId: {
1405
+ type: "number",
1406
+ description: "ID nhân viên"
1407
+ },
1408
+ createdAt: {
1409
+ type: "number",
1410
+ description: "Thời gian tạo (unix timestamp ms)"
1411
+ },
1412
+ updatedAt: {
1413
+ type: "number",
1414
+ description: "Thời gian cập nhật (unix timestamp ms)"
1415
+ },
1416
+ publishedAt: {
1417
+ type: "number",
1418
+ description: "Thời gian xuất bản (unix timestamp ms)"
1419
+ },
1420
+ metaTitle: {
1421
+ type: "string",
1422
+ description: "SEO: Meta title"
1423
+ },
1424
+ metaDescription: {
1425
+ type: "string",
1426
+ description: "SEO: Meta description"
1427
+ },
1428
+ metaKeywords: {
1429
+ description: "SEO: Meta keywords",
1430
+ type: "array",
1431
+ items: {
1432
+ type: "string"
1433
+ }
1434
+ },
1435
+ commentStatus: {
1436
+ type: "string",
1437
+ description: "Trạng thái comment",
1438
+ example: "open"
1439
+ },
1440
+ pingStatus: {
1441
+ type: "string",
1442
+ description: "Trạng thái ping",
1443
+ example: "open"
1444
+ },
1445
+ sticky: {
1446
+ type: "boolean",
1447
+ description: "Đánh dấu sticky post"
1448
+ },
1449
+ isPasswordProtected: {
1450
+ type: "boolean",
1451
+ description: "Password protected (có mật khẩu hay không)",
1452
+ example: false
1453
+ },
1454
+ menuOrder: {
1455
+ type: "number",
1456
+ description: "Thứ tự hiển thị"
1457
+ }
1458
+ },
1459
+ required: [
1460
+ "id",
1461
+ "title",
1462
+ "slug",
1463
+ "content",
1464
+ "status",
1465
+ "type",
1466
+ "createdAt",
1467
+ "updatedAt",
1468
+ "commentStatus",
1469
+ "pingStatus",
1470
+ "sticky",
1471
+ "menuOrder"
1472
+ ]
1473
+ },
1474
+ BulkDeletePostDto: {
1475
+ type: "object",
1476
+ properties: {
1477
+ ids: {
1478
+ description: "Array of post IDs to delete",
1479
+ example: [
1480
+ "uuid-1",
1481
+ "uuid-2"
1482
+ ],
1483
+ type: "array",
1484
+ items: {
1485
+ type: "string"
1486
+ }
1487
+ },
1488
+ permanent: {
1489
+ type: "boolean",
1490
+ description: "Permanent delete (hard delete) or soft delete (status=trash)",
1491
+ "default": false
1492
+ }
1493
+ },
1494
+ required: [
1495
+ "ids"
1496
+ ]
1497
+ },
1498
+ UpdatePostDto: {
1499
+ type: "object",
1500
+ properties: {
1501
+ title: {
1502
+ type: "string",
1503
+ description: "Tiêu đề bài viết",
1504
+ example: "Hello World"
1505
+ },
1506
+ slug: {
1507
+ type: "string",
1508
+ description: "Slug (friendly URL) - auto-generate nếu không nhập",
1509
+ example: "hello-world"
1510
+ },
1511
+ excerpt: {
1512
+ type: "string",
1513
+ description: "Mô tả ngắn",
1514
+ example: "This is a short excerpt..."
1515
+ },
1516
+ content: {
1517
+ description: "Nội dung bài viết (Gutenberg blocks)",
1518
+ allOf: [
1519
+ {
1520
+ $ref: "#/components/schemas/WpContentDto"
1521
+ }
1522
+ ]
1523
+ },
1524
+ featuredImageId: {
1525
+ type: "string",
1526
+ description: "ID ảnh đại diện (UUID)",
1527
+ example: "123e4567-e89b-12d3-a456-426614174000"
1528
+ },
1529
+ status: {
1530
+ type: "string",
1531
+ description: "Trạng thái bài viết",
1532
+ "enum": [
1533
+ "draft",
1534
+ "pending",
1535
+ "private",
1536
+ "publish",
1537
+ "future",
1538
+ "trash",
1539
+ "archived"
1540
+ ],
1541
+ "default": "draft"
1542
+ },
1543
+ type: {
1544
+ type: "string",
1545
+ description: "Loại bài viết",
1546
+ example: "post",
1547
+ "default": "post"
1548
+ },
1549
+ metaTitle: {
1550
+ type: "string",
1551
+ description: "SEO: Meta title (max 70 chars)",
1552
+ example: "Hello World - My Blog",
1553
+ maxLength: 70
1554
+ },
1555
+ metaDescription: {
1556
+ type: "string",
1557
+ description: "SEO: Meta description (max 160 chars)",
1558
+ maxLength: 160
1559
+ },
1560
+ metaKeywords: {
1561
+ description: "SEO: Meta keywords",
1562
+ example: [
1563
+ "wordpress",
1564
+ "cms",
1565
+ "blog"
1566
+ ],
1567
+ type: "array",
1568
+ items: {
1569
+ type: "string"
1570
+ }
1571
+ },
1572
+ commentStatus: {
1573
+ type: "string",
1574
+ description: "Trạng thái comment",
1575
+ example: "open",
1576
+ "default": "open"
1577
+ },
1578
+ sticky: {
1579
+ type: "boolean",
1580
+ description: "Đánh dấu sticky post",
1581
+ "default": false
1582
+ },
1583
+ password: {
1584
+ type: "string",
1585
+ description: "Mật khẩu bảo vệ bài viết (plaintext)",
1586
+ maxLength: 255
1587
+ },
1588
+ menuOrder: {
1589
+ type: "number",
1590
+ description: "Thứ tự hiển thị",
1591
+ example: 0,
1592
+ "default": 0
1593
+ }
1594
+ }
1595
+ },
1596
+ WpContentDto: {
1597
+ type: "object",
1598
+ properties: {
1599
+ blocks: {
1600
+ description: "Array of Gutenberg blocks",
1601
+ items: {
1602
+ type: "array",
1603
+ items: {
1604
+ type: "a"
1605
+ }
1606
+ },
1607
+ type: "array"
1608
+ },
1609
+ meta: {
1610
+ type: "object",
1611
+ description: "Additional metadata"
1612
+ },
1613
+ settings: {
1614
+ type: "object",
1615
+ description: "Content settings"
1616
+ }
1617
+ },
1618
+ required: [
1619
+ "blocks"
1620
+ ]
1621
+ }
1622
+ },
1623
+ securitySchemes: {
1624
+ "JWT-auth": {
1625
+ scheme: "bearer",
1626
+ bearerFormat: "JWT",
1627
+ type: "http",
1628
+ name: "JWT",
1629
+ description: "Enter JWT token",
1630
+ "in": "header"
1631
+ }
1632
+ }
1633
+ };
1634
+ var externalDocs = {
1635
+ description: "Additional Documentation",
1636
+ url: "https://redai.com/docs"
1637
+ };
1638
+ var generatedAt = "2026-03-16T08:19:38.217Z";
1639
+ var wpContentPost = {
1640
+ openapi: openapi,
1641
+ paths: paths,
1642
+ info: info,
1643
+ tags: tags,
1644
+ servers: servers,
1645
+ components: components,
1646
+ externalDocs: externalDocs,
1647
+ generatedAt: generatedAt,
1648
+ "x-redai-export-modules": [
1649
+ "wp-content-post"
1650
+ ],
1651
+ "x-redai-export-scope": "user"
1652
+ };
1653
+
1654
+ type PluginRuntimeConfig = {
1655
+ baseUrl?: string;
1656
+ bearerToken?: string;
1657
+ apiKey?: string;
1658
+ apiKeyHeader?: string;
1659
+ defaultHeaders?: Record<string, string>;
1660
+ timeoutMs?: number;
1661
+ workspaceId?: string;
1662
+ baseId?: string;
1663
+ authStorePath?: string;
1664
+ };
1665
+ type ToolResult = {
1666
+ content: Array<{
1667
+ type: "text";
1668
+ text: string;
1669
+ }>;
1670
+ };
1671
+ type OpenClawApiLike = {
1672
+ config?: {
1673
+ plugins?: {
1674
+ entries?: Record<string, {
1675
+ config?: PluginRuntimeConfig;
1676
+ }>;
1677
+ };
1678
+ };
1679
+ registerTool: (definition: {
1680
+ name: string;
1681
+ description: string;
1682
+ parameters: unknown;
1683
+ execute: (id: string, params: unknown) => Promise<ToolResult>;
1684
+ }, options?: {
1685
+ optional?: boolean;
1686
+ }) => void;
1687
+ };
1688
+ declare function register(api: OpenClawApiLike): void;
1689
+
1690
+ export { toolCatalog as catalog, register as default, wpContentPost as spec };