File tree Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Original file line number Diff line number Diff line change @@ -188,6 +188,11 @@ function getSSLPage($url) {
188
188
->setDefaultHeaders ([
189
189
'X-Appwrite-Response-Format ' => '1.7.0 ' ,
190
190
])
191
+ ->setExclude ([
192
+ 'services ' => [
193
+ ['name ' => 'assistant ' ],
194
+ ],
195
+ ])
191
196
;
192
197
193
198
$ sdk ->generate (__DIR__ . '/examples/cli ' );
Original file line number Diff line number Diff line change @@ -70,6 +70,15 @@ class SDK
70
70
'test ' => 'false '
71
71
];
72
72
73
+ /**
74
+ * @var array
75
+ */
76
+ protected array $ excludeRules = [
77
+ 'services ' => [],
78
+ 'methods ' => [],
79
+ 'definitions ' => []
80
+ ];
81
+
73
82
/**
74
83
* SDK constructor.
75
84
*
@@ -654,6 +663,28 @@ public function generate(string $target): void
654
663
}
655
664
}
656
665
666
+ /**
667
+ * Add additional exclusion rules for services, methods, or definitions.
668
+ *
669
+ * @param array $rules Array containing exclusion rules with format:
670
+ * [
671
+ * 'services' => [['name' => 'serviceName'], ['feature' => 'featureName']],
672
+ * 'methods' => [['name' => 'methodName'], ['type' => 'methodType']],
673
+ * 'definitions' => [['name' => 'definitionName']]
674
+ * ]
675
+ * @return $this
676
+ */
677
+ public function setExclude (array $ rules ): SDK
678
+ {
679
+ foreach (['services ' , 'methods ' , 'definitions ' ] as $ type ) {
680
+ if (isset ($ rules [$ type ]) && is_array ($ rules [$ type ])) {
681
+ $ this ->excludeRules [$ type ] = array_merge ($ this ->excludeRules [$ type ], $ rules [$ type ]);
682
+ }
683
+ }
684
+
685
+ return $ this ;
686
+ }
687
+
657
688
/**
658
689
* Determine if a file should be excluded from generation.
659
690
*
@@ -668,7 +699,7 @@ public function generate(string $target): void
668
699
*/
669
700
protected function exclude ($ file , $ params ): bool
670
701
{
671
- $ exclude = $ file ['exclude ' ] ?? [];
702
+ $ exclude = array_merge_recursive ( $ file ['exclude ' ] ?? [], $ this -> excludeRules ) ;
672
703
673
704
$ services = [];
674
705
$ features = [];
You can’t perform that action at this time.
0 commit comments