@nocobase/server 2.1.0-beta.15 → 2.1.0-beta.16

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,1264 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ var __defProp = Object.defineProperty;
11
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
+ var __getOwnPropNames = Object.getOwnPropertyNames;
13
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
14
+ var __export = (target, all) => {
15
+ for (var name in all)
16
+ __defProp(target, name, { get: all[name], enumerable: true });
17
+ };
18
+ var __copyProps = (to, from, except, desc) => {
19
+ if (from && typeof from === "object" || typeof from === "function") {
20
+ for (let key of __getOwnPropNames(from))
21
+ if (!__hasOwnProp.call(to, key) && key !== except)
22
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
+ }
24
+ return to;
25
+ };
26
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
+ var collections_exports = {};
28
+ __export(collections_exports, {
29
+ default: () => collections_default
30
+ });
31
+ module.exports = __toCommonJS(collections_exports);
32
+ var collections_default = {
33
+ "/{collectionName}:list": {
34
+ get: {
35
+ tags: ["$collection"],
36
+ summary: "Returns a list of the collection",
37
+ description: "A list of the collection",
38
+ parameters: [
39
+ {
40
+ $ref: "#/components/parameters/collectionName"
41
+ },
42
+ {
43
+ $ref: "#/components/parameters/filter"
44
+ },
45
+ {
46
+ $ref: "#/components/parameters/fields"
47
+ },
48
+ {
49
+ $ref: "#/components/parameters/appends"
50
+ },
51
+ {
52
+ $ref: "#/components/parameters/except"
53
+ },
54
+ {
55
+ $ref: "#/components/parameters/page"
56
+ },
57
+ {
58
+ $ref: "#/components/parameters/pageSize"
59
+ },
60
+ {
61
+ $ref: "#/components/parameters/sort"
62
+ }
63
+ ],
64
+ responses: {
65
+ "200": {
66
+ description: "OK"
67
+ }
68
+ }
69
+ }
70
+ },
71
+ "/{collectionName}:get": {
72
+ get: {
73
+ tags: ["$collection"],
74
+ summary: "Returns a record",
75
+ parameters: [
76
+ {
77
+ $ref: "#/components/parameters/collectionName"
78
+ },
79
+ {
80
+ $ref: "#/components/parameters/filterByTk"
81
+ },
82
+ {
83
+ $ref: "#/components/parameters/filter"
84
+ },
85
+ {
86
+ $ref: "#/components/parameters/sort"
87
+ },
88
+ {
89
+ $ref: "#/components/parameters/fields"
90
+ },
91
+ {
92
+ $ref: "#/components/parameters/appends"
93
+ },
94
+ {
95
+ $ref: "#/components/parameters/except"
96
+ }
97
+ ],
98
+ responses: {
99
+ "200": {
100
+ description: "OK"
101
+ }
102
+ }
103
+ }
104
+ },
105
+ "/{collectionName}:create": {
106
+ post: {
107
+ tags: ["$collection"],
108
+ summary: "Create record",
109
+ parameters: [
110
+ {
111
+ $ref: "#/components/parameters/collectionName"
112
+ },
113
+ {
114
+ $ref: "#/components/parameters/whitelist"
115
+ },
116
+ {
117
+ $ref: "#/components/parameters/blacklist"
118
+ }
119
+ ],
120
+ requestBody: {
121
+ content: {
122
+ "application/json": {
123
+ schema: {
124
+ type: "object"
125
+ }
126
+ }
127
+ }
128
+ },
129
+ responses: {
130
+ "200": {
131
+ description: "OK"
132
+ }
133
+ }
134
+ }
135
+ },
136
+ "/{collectionName}:update": {
137
+ post: {
138
+ tags: ["$collection"],
139
+ summary: "Update record",
140
+ parameters: [
141
+ {
142
+ $ref: "#/components/parameters/collectionName"
143
+ },
144
+ {
145
+ $ref: "#/components/parameters/filterByTk"
146
+ },
147
+ {
148
+ $ref: "#/components/parameters/filter"
149
+ },
150
+ {
151
+ $ref: "#/components/parameters/whitelist"
152
+ },
153
+ {
154
+ $ref: "#/components/parameters/blacklist"
155
+ }
156
+ ],
157
+ requestBody: {
158
+ content: {
159
+ "application/json": {
160
+ schema: {
161
+ type: "object"
162
+ }
163
+ }
164
+ }
165
+ },
166
+ responses: {
167
+ "200": {
168
+ description: "OK"
169
+ }
170
+ }
171
+ }
172
+ },
173
+ "/{collectionName}:destroy": {
174
+ post: {
175
+ tags: ["$collection"],
176
+ summary: "Delete record",
177
+ parameters: [
178
+ {
179
+ $ref: "#/components/parameters/collectionName"
180
+ },
181
+ {
182
+ $ref: "#/components/parameters/filterByTk"
183
+ },
184
+ {
185
+ $ref: "#/components/parameters/filter"
186
+ }
187
+ ],
188
+ responses: {
189
+ "200": {
190
+ description: "OK"
191
+ }
192
+ }
193
+ }
194
+ },
195
+ "/{collectionName}:move": {
196
+ post: {
197
+ tags: ["$collection"],
198
+ summary: "Move record",
199
+ parameters: [
200
+ {
201
+ $ref: "#/components/parameters/collectionName"
202
+ },
203
+ {
204
+ name: "sourceId",
205
+ in: "query",
206
+ description: "source id",
207
+ schema: {
208
+ type: "string"
209
+ }
210
+ },
211
+ {
212
+ name: "targetId",
213
+ in: "query",
214
+ description: "move target id",
215
+ schema: {
216
+ type: "string"
217
+ }
218
+ },
219
+ {
220
+ name: "method",
221
+ in: "query",
222
+ description: "move method, insertAfter or insertBefore",
223
+ schema: {
224
+ type: "string"
225
+ }
226
+ },
227
+ {
228
+ name: "sortField",
229
+ in: "query",
230
+ description: "sort field name, default is sort",
231
+ schema: {
232
+ type: "string"
233
+ }
234
+ },
235
+ {
236
+ name: "targetScope",
237
+ in: "query",
238
+ description: "move target scope",
239
+ schema: {
240
+ type: "string"
241
+ }
242
+ },
243
+ {
244
+ name: "sticky",
245
+ in: "query",
246
+ description: "sticky to top",
247
+ schema: {
248
+ type: "boolean"
249
+ }
250
+ }
251
+ ],
252
+ responses: {
253
+ "200": {
254
+ description: "OK"
255
+ }
256
+ }
257
+ }
258
+ },
259
+ "/{collectionName}/{collectionIndex}/{oneToOneAssociation}:get": {
260
+ get: {
261
+ tags: ["$collection.$oneToOneAssociation"],
262
+ summary: "Returns the relationship record",
263
+ parameters: [
264
+ {
265
+ $ref: "#/components/parameters/collectionName"
266
+ },
267
+ {
268
+ $ref: "#/components/parameters/collectionIndex"
269
+ },
270
+ {
271
+ $ref: "#/components/parameters/oneToOneAssociation"
272
+ },
273
+ {
274
+ $ref: "#/components/parameters/fields"
275
+ },
276
+ {
277
+ $ref: "#/components/parameters/appends"
278
+ },
279
+ {
280
+ $ref: "#/components/parameters/except"
281
+ }
282
+ ],
283
+ responses: {
284
+ "200": {
285
+ description: "OK"
286
+ }
287
+ }
288
+ }
289
+ },
290
+ "/{collectionName}/{collectionIndex}/{oneToOneAssociation}:create": {
291
+ post: {
292
+ tags: ["$collection.$oneToOneAssociation"],
293
+ summary: "Create and associate a record",
294
+ parameters: [
295
+ {
296
+ $ref: "#/components/parameters/collectionName"
297
+ },
298
+ {
299
+ $ref: "#/components/parameters/collectionIndex"
300
+ },
301
+ {
302
+ $ref: "#/components/parameters/oneToOneAssociation"
303
+ },
304
+ {
305
+ $ref: "#/components/parameters/whitelist"
306
+ },
307
+ {
308
+ $ref: "#/components/parameters/blacklist"
309
+ }
310
+ ],
311
+ responses: {
312
+ "200": {
313
+ description: "OK"
314
+ }
315
+ }
316
+ }
317
+ },
318
+ "/{collectionName}/{collectionIndex}/{oneToOneAssociation}:update": {
319
+ post: {
320
+ tags: ["$collection.$oneToOneAssociation"],
321
+ summary: "Update the relationship record",
322
+ parameters: [
323
+ {
324
+ $ref: "#/components/parameters/collectionName"
325
+ },
326
+ {
327
+ $ref: "#/components/parameters/collectionIndex"
328
+ },
329
+ {
330
+ $ref: "#/components/parameters/oneToOneAssociation"
331
+ },
332
+ {
333
+ $ref: "#/components/parameters/whitelist"
334
+ },
335
+ {
336
+ $ref: "#/components/parameters/blacklist"
337
+ }
338
+ ],
339
+ responses: {
340
+ "200": {
341
+ description: "OK"
342
+ }
343
+ }
344
+ }
345
+ },
346
+ "/{collectionName}/{collectionIndex}/{oneToOneAssociation}:destroy": {
347
+ post: {
348
+ tags: ["$collection.$oneToOneAssociation"],
349
+ summary: "Delete and disassociate the relationship record",
350
+ parameters: [
351
+ {
352
+ $ref: "#/components/parameters/collectionName"
353
+ },
354
+ {
355
+ $ref: "#/components/parameters/collectionIndex"
356
+ },
357
+ {
358
+ $ref: "#/components/parameters/oneToOneAssociation"
359
+ }
360
+ ],
361
+ responses: {
362
+ "200": {
363
+ description: "OK"
364
+ }
365
+ }
366
+ }
367
+ },
368
+ "/{collectionName}/{collectionIndex}/{oneToOneAssociation}:set": {
369
+ post: {
370
+ tags: ["$collection.$oneToOneAssociation"],
371
+ summary: "Associate a record",
372
+ parameters: [
373
+ {
374
+ $ref: "#/components/parameters/collectionName"
375
+ },
376
+ {
377
+ $ref: "#/components/parameters/collectionIndex"
378
+ },
379
+ {
380
+ $ref: "#/components/parameters/oneToOneAssociation"
381
+ },
382
+ {
383
+ name: "filterByTk",
384
+ in: "query",
385
+ required: true,
386
+ description: "filter by tk",
387
+ schema: {
388
+ type: "integer",
389
+ format: "int64"
390
+ }
391
+ }
392
+ ],
393
+ responses: {
394
+ "200": {
395
+ description: "OK"
396
+ }
397
+ }
398
+ }
399
+ },
400
+ "/{collectionName}/{collectionIndex}/{oneToOneAssociation}:remove": {
401
+ post: {
402
+ tags: ["$collection.$oneToOneAssociation"],
403
+ summary: "Disassociate the relationship record",
404
+ parameters: [
405
+ {
406
+ $ref: "#/components/parameters/collectionName"
407
+ },
408
+ {
409
+ $ref: "#/components/parameters/collectionIndex"
410
+ },
411
+ {
412
+ $ref: "#/components/parameters/oneToOneAssociation"
413
+ }
414
+ ],
415
+ responses: {
416
+ "200": {
417
+ description: "OK"
418
+ }
419
+ }
420
+ }
421
+ },
422
+ "/{collectionName}/{collectionIndex}/{manyToOneAssociation}:get": {
423
+ get: {
424
+ tags: ["$collection.$manyToOneAssociation"],
425
+ summary: "Returns the relationship record",
426
+ parameters: [
427
+ {
428
+ $ref: "#/components/parameters/collectionName"
429
+ },
430
+ {
431
+ $ref: "#/components/parameters/collectionIndex"
432
+ },
433
+ {
434
+ $ref: "#/components/parameters/manyToOneAssociation"
435
+ },
436
+ {
437
+ $ref: "#/components/parameters/fields"
438
+ },
439
+ {
440
+ $ref: "#/components/parameters/appends"
441
+ },
442
+ {
443
+ $ref: "#/components/parameters/except"
444
+ }
445
+ ],
446
+ responses: {
447
+ "200": {
448
+ description: "OK"
449
+ }
450
+ }
451
+ }
452
+ },
453
+ "/{collectionName}/{collectionIndex}/{manyToOneAssociation}:create": {
454
+ post: {
455
+ tags: ["$collection.$manyToOneAssociation"],
456
+ summary: "Create and associate a record",
457
+ parameters: [
458
+ {
459
+ $ref: "#/components/parameters/collectionName"
460
+ },
461
+ {
462
+ $ref: "#/components/parameters/collectionIndex"
463
+ },
464
+ {
465
+ $ref: "#/components/parameters/manyToOneAssociation"
466
+ },
467
+ {
468
+ $ref: "#/components/parameters/whitelist"
469
+ },
470
+ {
471
+ $ref: "#/components/parameters/blacklist"
472
+ }
473
+ ],
474
+ responses: {
475
+ "200": {
476
+ description: "OK"
477
+ }
478
+ }
479
+ }
480
+ },
481
+ "/{collectionName}/{collectionIndex}/{manyToOneAssociation}:update": {
482
+ post: {
483
+ tags: ["$collection.$manyToOneAssociation"],
484
+ summary: "Update the relationship record",
485
+ parameters: [
486
+ {
487
+ $ref: "#/components/parameters/collectionName"
488
+ },
489
+ {
490
+ $ref: "#/components/parameters/collectionIndex"
491
+ },
492
+ {
493
+ $ref: "#/components/parameters/manyToOneAssociation"
494
+ },
495
+ {
496
+ $ref: "#/components/parameters/whitelist"
497
+ },
498
+ {
499
+ $ref: "#/components/parameters/blacklist"
500
+ }
501
+ ],
502
+ responses: {
503
+ "200": {
504
+ description: "OK"
505
+ }
506
+ }
507
+ }
508
+ },
509
+ "/{collectionName}/{collectionIndex}/{manyToOneAssociation}:destroy": {
510
+ post: {
511
+ tags: ["$collection.$manyToOneAssociation"],
512
+ summary: "Delete and disassociate the relationship record",
513
+ parameters: [
514
+ {
515
+ $ref: "#/components/parameters/collectionName"
516
+ },
517
+ {
518
+ $ref: "#/components/parameters/collectionIndex"
519
+ },
520
+ {
521
+ $ref: "#/components/parameters/manyToOneAssociation"
522
+ }
523
+ ],
524
+ responses: {
525
+ "200": {
526
+ description: "OK"
527
+ }
528
+ }
529
+ }
530
+ },
531
+ "/{collectionName}/{collectionIndex}/{manyToOneAssociation}:set": {
532
+ post: {
533
+ tags: ["$collection.$manyToOneAssociation"],
534
+ summary: "Associate a record",
535
+ parameters: [
536
+ {
537
+ $ref: "#/components/parameters/collectionName"
538
+ },
539
+ {
540
+ $ref: "#/components/parameters/collectionIndex"
541
+ },
542
+ {
543
+ $ref: "#/components/parameters/manyToOneAssociation"
544
+ },
545
+ {
546
+ name: "filterByTk",
547
+ in: "query",
548
+ required: true,
549
+ description: "filter by tk",
550
+ schema: {
551
+ type: "integer",
552
+ format: "int64"
553
+ }
554
+ }
555
+ ],
556
+ responses: {
557
+ "200": {
558
+ description: "OK"
559
+ }
560
+ }
561
+ }
562
+ },
563
+ "/{collectionName}/{collectionIndex}/{manyToOneAssociation}:remove": {
564
+ post: {
565
+ tags: ["$collection.$manyToOneAssociation"],
566
+ summary: "Disassociate the relationship record",
567
+ parameters: [
568
+ {
569
+ $ref: "#/components/parameters/collectionName"
570
+ },
571
+ {
572
+ $ref: "#/components/parameters/collectionIndex"
573
+ },
574
+ {
575
+ $ref: "#/components/parameters/manyToOneAssociation"
576
+ }
577
+ ],
578
+ responses: {
579
+ "200": {
580
+ description: "OK"
581
+ }
582
+ }
583
+ }
584
+ },
585
+ "/{collectionName}/{collectionIndex}/{oneToManyAssociation}:list": {
586
+ get: {
587
+ tags: ["$collection.$oneToManyAssociation"],
588
+ summary: "Returns a list of the one-to-many relationship",
589
+ parameters: [
590
+ {
591
+ $ref: "#/components/parameters/collectionName"
592
+ },
593
+ {
594
+ $ref: "#/components/parameters/collectionIndex"
595
+ },
596
+ {
597
+ $ref: "#/components/parameters/oneToManyAssociation"
598
+ },
599
+ {
600
+ $ref: "#/components/parameters/filter"
601
+ },
602
+ {
603
+ $ref: "#/components/parameters/fields"
604
+ },
605
+ {
606
+ $ref: "#/components/parameters/appends"
607
+ },
608
+ {
609
+ $ref: "#/components/parameters/except"
610
+ },
611
+ {
612
+ $ref: "#/components/parameters/page"
613
+ },
614
+ {
615
+ $ref: "#/components/parameters/pageSize"
616
+ },
617
+ {
618
+ $ref: "#/components/parameters/sort"
619
+ }
620
+ ],
621
+ responses: {
622
+ "200": {
623
+ description: "OK"
624
+ }
625
+ }
626
+ }
627
+ },
628
+ "/{collectionName}/{collectionIndex}/{oneToManyAssociation}:get": {
629
+ get: {
630
+ tags: ["$collection.$oneToManyAssociation"],
631
+ summary: "Returns a record of the one-to-many relationship",
632
+ parameters: [
633
+ {
634
+ $ref: "#/components/parameters/collectionName"
635
+ },
636
+ {
637
+ $ref: "#/components/parameters/collectionIndex"
638
+ },
639
+ {
640
+ $ref: "#/components/parameters/oneToManyAssociation"
641
+ },
642
+ {
643
+ $ref: "#/components/parameters/filterByTk"
644
+ },
645
+ {
646
+ $ref: "#/components/parameters/filter"
647
+ },
648
+ {
649
+ $ref: "#/components/parameters/fields"
650
+ },
651
+ {
652
+ $ref: "#/components/parameters/appends"
653
+ },
654
+ {
655
+ $ref: "#/components/parameters/except"
656
+ },
657
+ {
658
+ $ref: "#/components/parameters/sort"
659
+ }
660
+ ],
661
+ responses: {
662
+ "200": {
663
+ description: "OK"
664
+ }
665
+ }
666
+ }
667
+ },
668
+ "/{collectionName}/{collectionIndex}/{oneToManyAssociation}:create": {
669
+ post: {
670
+ tags: ["$collection.$oneToManyAssociation"],
671
+ summary: "Create and attach record of the one-to-many relationship",
672
+ parameters: [
673
+ {
674
+ $ref: "#/components/parameters/collectionName"
675
+ },
676
+ {
677
+ $ref: "#/components/parameters/collectionIndex"
678
+ },
679
+ {
680
+ $ref: "#/components/parameters/oneToManyAssociation"
681
+ },
682
+ {
683
+ $ref: "#/components/parameters/whitelist"
684
+ },
685
+ {
686
+ $ref: "#/components/parameters/blacklist"
687
+ }
688
+ ],
689
+ responses: {
690
+ "200": {
691
+ description: "OK"
692
+ }
693
+ }
694
+ }
695
+ },
696
+ "/{collectionName}/{collectionIndex}/{oneToManyAssociation}:update": {
697
+ post: {
698
+ tags: ["$collection.$oneToManyAssociation"],
699
+ summary: "Update record of the one-to-many relationship",
700
+ parameters: [
701
+ {
702
+ $ref: "#/components/parameters/collectionName"
703
+ },
704
+ {
705
+ $ref: "#/components/parameters/collectionIndex"
706
+ },
707
+ {
708
+ $ref: "#/components/parameters/oneToManyAssociation"
709
+ },
710
+ {
711
+ $ref: "#/components/parameters/filterByTk"
712
+ },
713
+ {
714
+ $ref: "#/components/parameters/filter"
715
+ },
716
+ {
717
+ $ref: "#/components/parameters/whitelist"
718
+ },
719
+ {
720
+ $ref: "#/components/parameters/blacklist"
721
+ }
722
+ ],
723
+ responses: {
724
+ "200": {
725
+ description: "OK"
726
+ }
727
+ }
728
+ }
729
+ },
730
+ "/{collectionName}/{collectionIndex}/{oneToManyAssociation}:destroy": {
731
+ post: {
732
+ tags: ["$collection.$oneToManyAssociation"],
733
+ summary: "Delete and detach record of the one-to-many relationship",
734
+ parameters: [
735
+ {
736
+ $ref: "#/components/parameters/collectionName"
737
+ },
738
+ {
739
+ $ref: "#/components/parameters/collectionIndex"
740
+ },
741
+ {
742
+ $ref: "#/components/parameters/oneToManyAssociation"
743
+ },
744
+ {
745
+ $ref: "#/components/parameters/filterByTk"
746
+ },
747
+ {
748
+ $ref: "#/components/parameters/filter"
749
+ }
750
+ ],
751
+ responses: {
752
+ "200": {
753
+ description: "OK"
754
+ }
755
+ }
756
+ }
757
+ },
758
+ "/{collectionName}/{collectionIndex}/{oneToManyAssociation}:move": {
759
+ post: {
760
+ tags: ["$collection.$oneToManyAssociation"],
761
+ summary: "Move record of the one-to-many relationship",
762
+ parameters: [
763
+ {
764
+ $ref: "#/components/parameters/collectionName"
765
+ },
766
+ {
767
+ $ref: "#/components/parameters/collectionIndex"
768
+ },
769
+ {
770
+ $ref: "#/components/parameters/oneToManyAssociation"
771
+ },
772
+ {
773
+ name: "sourceId",
774
+ in: "query",
775
+ description: "source id",
776
+ schema: {
777
+ type: "string"
778
+ }
779
+ },
780
+ {
781
+ name: "targetId",
782
+ in: "query",
783
+ description: "move target id",
784
+ schema: {
785
+ type: "string"
786
+ }
787
+ },
788
+ {
789
+ name: "method",
790
+ in: "query",
791
+ description: "move method, insertAfter or insertBefore",
792
+ schema: {
793
+ type: "string"
794
+ }
795
+ },
796
+ {
797
+ name: "sortField",
798
+ in: "query",
799
+ description: "sort field name, default is sort",
800
+ schema: {
801
+ type: "string"
802
+ }
803
+ },
804
+ {
805
+ name: "targetScope",
806
+ in: "query",
807
+ description: "move target scope",
808
+ schema: {
809
+ type: "string"
810
+ }
811
+ },
812
+ {
813
+ name: "sticky",
814
+ in: "query",
815
+ description: "sticky to top",
816
+ schema: {
817
+ type: "boolean"
818
+ }
819
+ }
820
+ ],
821
+ responses: {
822
+ "200": {
823
+ description: "OK"
824
+ }
825
+ }
826
+ }
827
+ },
828
+ "/{collectionName}/{collectionIndex}/{oneToManyAssociation}:set": {
829
+ post: {
830
+ tags: ["$collection.$oneToManyAssociation"],
831
+ summary: "Set or reset associations",
832
+ parameters: [
833
+ {
834
+ $ref: "#/components/parameters/collectionName"
835
+ },
836
+ {
837
+ $ref: "#/components/parameters/collectionIndex"
838
+ },
839
+ {
840
+ $ref: "#/components/parameters/oneToManyAssociation"
841
+ },
842
+ {
843
+ $ref: "#/components/parameters/filterByTk"
844
+ },
845
+ {
846
+ $ref: "#/components/parameters/filterByTks"
847
+ }
848
+ ],
849
+ responses: {
850
+ "200": {
851
+ description: "OK"
852
+ }
853
+ }
854
+ }
855
+ },
856
+ "/{collectionName}/{collectionIndex}/{oneToManyAssociation}:add": {
857
+ post: {
858
+ tags: ["$collection.$oneToManyAssociation"],
859
+ summary: "Attach record",
860
+ parameters: [
861
+ {
862
+ $ref: "#/components/parameters/collectionName"
863
+ },
864
+ {
865
+ $ref: "#/components/parameters/collectionIndex"
866
+ },
867
+ {
868
+ $ref: "#/components/parameters/oneToManyAssociation"
869
+ },
870
+ {
871
+ $ref: "#/components/parameters/filterByTk"
872
+ },
873
+ {
874
+ $ref: "#/components/parameters/filterByTks"
875
+ }
876
+ ],
877
+ responses: {
878
+ "200": {
879
+ description: "OK"
880
+ }
881
+ }
882
+ }
883
+ },
884
+ "/{collectionName}/{collectionIndex}/{oneToManyAssociation}:remove": {
885
+ post: {
886
+ tags: ["$collection.$oneToManyAssociation"],
887
+ summary: "Detach record",
888
+ parameters: [
889
+ {
890
+ $ref: "#/components/parameters/collectionName"
891
+ },
892
+ {
893
+ $ref: "#/components/parameters/collectionIndex"
894
+ },
895
+ {
896
+ $ref: "#/components/parameters/oneToManyAssociation"
897
+ },
898
+ {
899
+ $ref: "#/components/parameters/filterByTk"
900
+ },
901
+ {
902
+ $ref: "#/components/parameters/filterByTks"
903
+ }
904
+ ],
905
+ responses: {
906
+ "200": {
907
+ description: "OK"
908
+ }
909
+ }
910
+ }
911
+ },
912
+ "/{collectionName}/{collectionIndex}/{manyToManyAssociation}:list": {
913
+ get: {
914
+ tags: ["$collection.$manyToManyAssociation"],
915
+ summary: "Returns a list of the many-to-many relationship",
916
+ parameters: [
917
+ {
918
+ $ref: "#/components/parameters/collectionName"
919
+ },
920
+ {
921
+ $ref: "#/components/parameters/collectionIndex"
922
+ },
923
+ {
924
+ $ref: "#/components/parameters/manyToManyAssociation"
925
+ },
926
+ {
927
+ $ref: "#/components/parameters/filter"
928
+ },
929
+ {
930
+ $ref: "#/components/parameters/fields"
931
+ },
932
+ {
933
+ $ref: "#/components/parameters/appends"
934
+ },
935
+ {
936
+ $ref: "#/components/parameters/except"
937
+ },
938
+ {
939
+ $ref: "#/components/parameters/page"
940
+ },
941
+ {
942
+ $ref: "#/components/parameters/pageSize"
943
+ },
944
+ {
945
+ $ref: "#/components/parameters/sort"
946
+ }
947
+ ],
948
+ responses: {
949
+ "200": {
950
+ description: "OK"
951
+ }
952
+ }
953
+ }
954
+ },
955
+ "/{collectionName}/{collectionIndex}/{manyToManyAssociation}:get": {
956
+ get: {
957
+ tags: ["$collection.$manyToManyAssociation"],
958
+ summary: "Returns a record of the many-to-many relationship",
959
+ parameters: [
960
+ {
961
+ $ref: "#/components/parameters/collectionName"
962
+ },
963
+ {
964
+ $ref: "#/components/parameters/collectionIndex"
965
+ },
966
+ {
967
+ $ref: "#/components/parameters/manyToManyAssociation"
968
+ },
969
+ {
970
+ $ref: "#/components/parameters/filterByTk"
971
+ },
972
+ {
973
+ $ref: "#/components/parameters/filter"
974
+ },
975
+ {
976
+ $ref: "#/components/parameters/fields"
977
+ },
978
+ {
979
+ $ref: "#/components/parameters/appends"
980
+ },
981
+ {
982
+ $ref: "#/components/parameters/except"
983
+ },
984
+ {
985
+ $ref: "#/components/parameters/sort"
986
+ }
987
+ ],
988
+ responses: {
989
+ "200": {
990
+ description: "OK"
991
+ }
992
+ }
993
+ }
994
+ },
995
+ "/{collectionName}/{collectionIndex}/{manyToManyAssociation}:create": {
996
+ post: {
997
+ tags: ["$collection.$manyToManyAssociation"],
998
+ summary: "Create and attach record of the many-to-many relationship",
999
+ parameters: [
1000
+ {
1001
+ $ref: "#/components/parameters/collectionName"
1002
+ },
1003
+ {
1004
+ $ref: "#/components/parameters/collectionIndex"
1005
+ },
1006
+ {
1007
+ $ref: "#/components/parameters/manyToManyAssociation"
1008
+ },
1009
+ {
1010
+ $ref: "#/components/parameters/whitelist"
1011
+ },
1012
+ {
1013
+ $ref: "#/components/parameters/blacklist"
1014
+ }
1015
+ ],
1016
+ responses: {
1017
+ "200": {
1018
+ description: "OK"
1019
+ }
1020
+ }
1021
+ }
1022
+ },
1023
+ "/{collectionName}/{collectionIndex}/{manyToManyAssociation}:update": {
1024
+ post: {
1025
+ tags: ["$collection.$manyToManyAssociation"],
1026
+ summary: "Update record of the many-to-many relationship",
1027
+ parameters: [
1028
+ {
1029
+ $ref: "#/components/parameters/collectionName"
1030
+ },
1031
+ {
1032
+ $ref: "#/components/parameters/collectionIndex"
1033
+ },
1034
+ {
1035
+ $ref: "#/components/parameters/manyToManyAssociation"
1036
+ },
1037
+ {
1038
+ $ref: "#/components/parameters/filterByTk"
1039
+ },
1040
+ {
1041
+ $ref: "#/components/parameters/filter"
1042
+ },
1043
+ {
1044
+ $ref: "#/components/parameters/whitelist"
1045
+ },
1046
+ {
1047
+ $ref: "#/components/parameters/blacklist"
1048
+ }
1049
+ ],
1050
+ responses: {
1051
+ "200": {
1052
+ description: "OK"
1053
+ }
1054
+ }
1055
+ }
1056
+ },
1057
+ "/{collectionName}/{collectionIndex}/{manyToManyAssociation}:destroy": {
1058
+ post: {
1059
+ tags: ["$collection.$manyToManyAssociation"],
1060
+ summary: "Delete and detach record of the one-to-many relationship",
1061
+ parameters: [
1062
+ {
1063
+ $ref: "#/components/parameters/collectionName"
1064
+ },
1065
+ {
1066
+ $ref: "#/components/parameters/collectionIndex"
1067
+ },
1068
+ {
1069
+ $ref: "#/components/parameters/manyToManyAssociation"
1070
+ },
1071
+ {
1072
+ $ref: "#/components/parameters/filterByTk"
1073
+ },
1074
+ {
1075
+ $ref: "#/components/parameters/filter"
1076
+ }
1077
+ ],
1078
+ responses: {
1079
+ "200": {
1080
+ description: "OK"
1081
+ }
1082
+ }
1083
+ }
1084
+ },
1085
+ "/{collectionName}/{collectionIndex}/{manyToManyAssociation}:move": {
1086
+ post: {
1087
+ tags: ["$collection.$manyToManyAssociation"],
1088
+ summary: "Move record of the one-to-many relationship",
1089
+ parameters: [
1090
+ {
1091
+ $ref: "#/components/parameters/collectionName"
1092
+ },
1093
+ {
1094
+ $ref: "#/components/parameters/collectionIndex"
1095
+ },
1096
+ {
1097
+ $ref: "#/components/parameters/manyToManyAssociation"
1098
+ },
1099
+ {
1100
+ name: "sourceId",
1101
+ in: "query",
1102
+ description: "source id",
1103
+ schema: {
1104
+ type: "string"
1105
+ }
1106
+ },
1107
+ {
1108
+ name: "targetId",
1109
+ in: "query",
1110
+ description: "move target id",
1111
+ schema: {
1112
+ type: "string"
1113
+ }
1114
+ },
1115
+ {
1116
+ name: "method",
1117
+ in: "query",
1118
+ description: "move method, insertAfter or insertBefore",
1119
+ schema: {
1120
+ type: "string"
1121
+ }
1122
+ },
1123
+ {
1124
+ name: "sortField",
1125
+ in: "query",
1126
+ description: "sort field name, default is sort",
1127
+ schema: {
1128
+ type: "string"
1129
+ }
1130
+ },
1131
+ {
1132
+ name: "targetScope",
1133
+ in: "query",
1134
+ description: "move target scope",
1135
+ schema: {
1136
+ type: "string"
1137
+ }
1138
+ },
1139
+ {
1140
+ name: "sticky",
1141
+ in: "query",
1142
+ description: "sticky to top",
1143
+ schema: {
1144
+ type: "boolean"
1145
+ }
1146
+ }
1147
+ ],
1148
+ responses: {
1149
+ "200": {
1150
+ description: "OK"
1151
+ }
1152
+ }
1153
+ }
1154
+ },
1155
+ "/{collectionName}/{collectionIndex}/{manyToManyAssociation}:set": {
1156
+ post: {
1157
+ tags: ["$collection.$manyToManyAssociation"],
1158
+ summary: "Set or reset associations",
1159
+ parameters: [
1160
+ {
1161
+ $ref: "#/components/parameters/collectionName"
1162
+ },
1163
+ {
1164
+ $ref: "#/components/parameters/collectionIndex"
1165
+ },
1166
+ {
1167
+ $ref: "#/components/parameters/manyToManyAssociation"
1168
+ },
1169
+ {
1170
+ $ref: "#/components/parameters/filterByTk"
1171
+ },
1172
+ {
1173
+ $ref: "#/components/parameters/filterByTks"
1174
+ }
1175
+ ],
1176
+ responses: {
1177
+ "200": {
1178
+ description: "OK"
1179
+ }
1180
+ }
1181
+ }
1182
+ },
1183
+ "/{collectionName}/{collectionIndex}/{manyToManyAssociation}:add": {
1184
+ post: {
1185
+ tags: ["$collection.$manyToManyAssociation"],
1186
+ summary: "Attach record",
1187
+ parameters: [
1188
+ {
1189
+ $ref: "#/components/parameters/collectionName"
1190
+ },
1191
+ {
1192
+ $ref: "#/components/parameters/collectionIndex"
1193
+ },
1194
+ {
1195
+ $ref: "#/components/parameters/manyToManyAssociation"
1196
+ },
1197
+ {
1198
+ $ref: "#/components/parameters/filterByTk"
1199
+ },
1200
+ {
1201
+ $ref: "#/components/parameters/filterByTks"
1202
+ }
1203
+ ],
1204
+ responses: {
1205
+ "200": {
1206
+ description: "OK"
1207
+ }
1208
+ }
1209
+ }
1210
+ },
1211
+ "/{collectionName}/{collectionIndex}/{manyToManyAssociation}:remove": {
1212
+ post: {
1213
+ tags: ["$collection.$manyToManyAssociation"],
1214
+ summary: "Detach record",
1215
+ parameters: [
1216
+ {
1217
+ $ref: "#/components/parameters/collectionName"
1218
+ },
1219
+ {
1220
+ $ref: "#/components/parameters/collectionIndex"
1221
+ },
1222
+ {
1223
+ $ref: "#/components/parameters/manyToManyAssociation"
1224
+ },
1225
+ {
1226
+ $ref: "#/components/parameters/filterByTk"
1227
+ },
1228
+ {
1229
+ $ref: "#/components/parameters/filterByTks"
1230
+ }
1231
+ ],
1232
+ responses: {
1233
+ "200": {
1234
+ description: "OK"
1235
+ }
1236
+ }
1237
+ }
1238
+ },
1239
+ "/{collectionName}/{collectionIndex}/{manyToManyAssociation}:toggle": {
1240
+ post: {
1241
+ tags: ["$collection.$manyToManyAssociation"],
1242
+ summary: "Attach or detach record",
1243
+ parameters: [
1244
+ {
1245
+ $ref: "#/components/parameters/collectionName"
1246
+ },
1247
+ {
1248
+ $ref: "#/components/parameters/collectionIndex"
1249
+ },
1250
+ {
1251
+ $ref: "#/components/parameters/manyToManyAssociation"
1252
+ },
1253
+ {
1254
+ $ref: "#/components/parameters/filterByTk"
1255
+ }
1256
+ ],
1257
+ responses: {
1258
+ "200": {
1259
+ description: "OK"
1260
+ }
1261
+ }
1262
+ }
1263
+ }
1264
+ };