@@ -52,6 +52,7 @@ type AppwriteOperationObject = OpenAPIV3.OperationObject & {
5252 scope : string ;
5353 platforms : string [ ] ;
5454 packaging : boolean ;
55+ public : boolean ;
5556 methods ?: AppwriteAdditionalMethod [ ] ;
5657 } ;
5758} ;
@@ -65,6 +66,7 @@ type AppwriteAdditionalMethod = {
6566 responses : { code : number ; model : string } [ ] ;
6667 description : string ;
6768 demo : string ;
69+ public : boolean ;
6870 deprecated ?: AppwriteDeprecated ;
6971} ;
7072
@@ -208,6 +210,11 @@ function* processAdditionalMethods(
208210 const additionalMethods = appwriteMethod [ 'x-appwrite' ] . methods ! ;
209211
210212 for ( const additionalMethod of additionalMethods ) {
213+ // Skip methods where public is false
214+ if ( additionalMethod . public === false ) {
215+ continue ;
216+ }
217+
211218 yield {
212219 method : httpMethod ,
213220 value : {
@@ -221,7 +228,8 @@ function* processAdditionalMethods(
221228 'x-appwrite' : {
222229 ...appwriteMethod [ 'x-appwrite' ] ,
223230 method : additionalMethod . name ,
224- demo : additionalMethod . demo
231+ demo : additionalMethod . demo ,
232+ public : additionalMethod . public
225233 } ,
226234 responses : {
227235 ...appwriteMethod . responses ,
@@ -257,28 +265,43 @@ function* iterateAllMethods(
257265
258266 // Handle non-additional methods
259267 if ( methods ?. get ?. tags ?. includes ( service ) && ! hasAdditionalMethods ( methods . get , service ) ) {
260- yield { method : OpenAPIV3 . HttpMethods . GET , value : methods . get , url } ;
268+ const operation = methods . get as AppwriteOperationObject ;
269+ if ( operation [ 'x-appwrite' ] ?. public !== false ) {
270+ yield { method : OpenAPIV3 . HttpMethods . GET , value : methods . get , url } ;
271+ }
261272 }
262273 if (
263274 methods ?. post ?. tags ?. includes ( service ) &&
264275 ! hasAdditionalMethods ( methods . post , service )
265276 ) {
266- yield { method : OpenAPIV3 . HttpMethods . POST , value : methods . post , url } ;
277+ const operation = methods . post as AppwriteOperationObject ;
278+ if ( operation [ 'x-appwrite' ] ?. public !== false ) {
279+ yield { method : OpenAPIV3 . HttpMethods . POST , value : methods . post , url } ;
280+ }
267281 }
268282 if ( methods ?. put ?. tags ?. includes ( service ) && ! hasAdditionalMethods ( methods . put , service ) ) {
269- yield { method : OpenAPIV3 . HttpMethods . PUT , value : methods . put , url } ;
283+ const operation = methods . put as AppwriteOperationObject ;
284+ if ( operation [ 'x-appwrite' ] ?. public !== false ) {
285+ yield { method : OpenAPIV3 . HttpMethods . PUT , value : methods . put , url } ;
286+ }
270287 }
271288 if (
272289 methods ?. patch ?. tags ?. includes ( service ) &&
273290 ! hasAdditionalMethods ( methods . patch , service )
274291 ) {
275- yield { method : OpenAPIV3 . HttpMethods . PATCH , value : methods . patch , url } ;
292+ const operation = methods . patch as AppwriteOperationObject ;
293+ if ( operation [ 'x-appwrite' ] ?. public !== false ) {
294+ yield { method : OpenAPIV3 . HttpMethods . PATCH , value : methods . patch , url } ;
295+ }
276296 }
277297 if (
278298 methods ?. delete ?. tags ?. includes ( service ) &&
279299 ! hasAdditionalMethods ( methods . delete , service )
280300 ) {
281- yield { method : OpenAPIV3 . HttpMethods . DELETE , value : methods . delete , url } ;
301+ const operation = methods . delete as AppwriteOperationObject ;
302+ if ( operation [ 'x-appwrite' ] ?. public !== false ) {
303+ yield { method : OpenAPIV3 . HttpMethods . DELETE , value : methods . delete , url } ;
304+ }
282305 }
283306
284307 // Process additional methods
0 commit comments