@@ -20,6 +20,7 @@ import {
2020  CheckRequest , 
2121  CheckRequestTupleKey , 
2222  CheckResponse , 
23+   ConsistencyPreference , 
2324  CreateStoreRequest , 
2425  CreateStoreResponse , 
2526  ExpandRequestTupleKey , 
@@ -111,9 +112,15 @@ export interface AuthorizationModelIdOpts {
111112  authorizationModelId ?: string ; 
112113} 
113114
115+ export  interface  ConsistencyOpts  { 
116+   consistency ?: ConsistencyPreference 
117+ } 
118+ 
114119export  type  ClientRequestOptsWithStoreId  =  ClientRequestOpts  &  StoreIdOpts ; 
115120export  type  ClientRequestOptsWithAuthZModelId  =  ClientRequestOpts  &  StoreIdOpts  &  AuthorizationModelIdOpts ; 
116121
122+ export  type  ClientRequestOptsWithConsistency  =  ClientRequestOpts  &  StoreIdOpts  &  AuthorizationModelIdOpts  &  ConsistencyOpts ; 
123+ 
117124export  type  PaginationOptions  =  {  pageSize ?: number ,  continuationToken ?: string ;  } ; 
118125
119126export  type  ClientCheckRequest  =  CheckRequestTupleKey  & 
@@ -179,13 +186,13 @@ export interface ClientReadChangesRequest {
179186
180187export  type  ClientExpandRequest  =  ExpandRequestTupleKey ; 
181188export  type  ClientReadRequest  =  ReadRequestTupleKey ; 
182- export  type  ClientListObjectsRequest  =  Omit < ListObjectsRequest ,  "authorization_model_id"  |  "contextual_tuples" >  &  { 
189+ export  type  ClientListObjectsRequest  =  Omit < ListObjectsRequest ,  "authorization_model_id"  |  "contextual_tuples"   |   "consistency" >  &  { 
183190    contextualTuples ?: Array < TupleKey > 
184191} ; 
185- export  type  ClientListUsersRequest  =  Omit < ListUsersRequest ,  "authorization_model_id"  |  "contextual_tuples" >  &  { 
192+ export  type  ClientListUsersRequest  =  Omit < ListUsersRequest ,  "authorization_model_id"  |  "contextual_tuples"   |   "consistency" >  &  { 
186193    contextualTuples ?: Array < TupleKey > 
187194} ; 
188- export  type  ClientListRelationsRequest  =  Omit < ClientCheckRequest ,  "relation" >  &  { 
195+ export  type  ClientListRelationsRequest  =  Omit < ClientCheckRequest ,  "relation"   |   "consistency" >  &  { 
189196    relations ?: string [ ] , 
190197} ; 
191198export  type  ClientWriteAssertionsRequest  =  ( CheckRequestTupleKey  &  Pick < Assertion ,  "expectation" > ) [ ] ; 
@@ -398,15 +405,15 @@ export class OpenFgaClient extends BaseAPI {
398405  /** 
399406   * Read - Read tuples previously written to the store (does not evaluate) 
400407   * @param  {ClientReadRequest } body 
401-    * @param  {ClientRequestOpts  & PaginationOptions 
408+    * @param  {ClientRequestOptsWithConsistency  & PaginationOptions 
402409   * @param  {number } [options.pageSize] 
403410   * @param  {string } [options.continuationToken] 
404411   * @param  {object } [options.headers] - Custom headers to send alongside the request 
405412   * @param  {object } [options.retryParams] - Override the retry parameters for this request 
406413   * @param  {number } [options.retryParams.maxRetry] - Override the max number of retries on each API request 
407414   * @param  {number } [options.retryParams.minWaitInMs] - Override the minimum wait before a retry is initiated 
408415   */ 
409-   async  read ( body : ClientReadRequest  =  { } ,  options : ClientRequestOptsWithStoreId  &  PaginationOptions  =  { } ) : PromiseResult < ReadResponse >  { 
416+   async  read ( body : ClientReadRequest  =  { } ,  options : ClientRequestOptsWithConsistency  &  PaginationOptions  =  { } ) : PromiseResult < ReadResponse >  { 
410417    const  readRequest : ReadRequest  =  { 
411418      page_size : options . pageSize , 
412419      continuation_token : options . continuationToken , 
@@ -556,14 +563,15 @@ export class OpenFgaClient extends BaseAPI {
556563  /** 
557564   * Check - Check if a user has a particular relation with an object (evaluates) 
558565   * @param  {ClientCheckRequest } body 
559-    * @param  {ClientRequestOptsWithAuthZModelId } [options] 
566+    * @param  {ClientRequestOptsWithConsistency } [options] 
560567   * @param  {string } [options.authorizationModelId] - Overrides the authorization model id in the configuration 
561568   * @param  {object } [options.headers] - Custom headers to send alongside the request 
569+    * @param  {ConsistencyPreference } [options.consistency] - The consistency preference to use 
562570   * @param  {object } [options.retryParams] - Override the retry parameters for this request 
563571   * @param  {number } [options.retryParams.maxRetry] - Override the max number of retries on each API request 
564572   * @param  {number } [options.retryParams.minWaitInMs] - Override the minimum wait before a retry is initiated 
565573   */ 
566-   async  check ( body : ClientCheckRequest ,  options : ClientRequestOptsWithAuthZModelId  =  { } ) : PromiseResult < CheckResponse >  { 
574+   async  check ( body : ClientCheckRequest ,  options : ClientRequestOptsWithConsistency  =  { } ) : PromiseResult < CheckResponse >  { 
567575    return  this . api . check ( this . getStoreId ( options ) ! ,  { 
568576      tuple_key : { 
569577        user : body . user , 
@@ -621,14 +629,15 @@ export class OpenFgaClient extends BaseAPI {
621629   * @param  {ClientExpandRequest } body 
622630   * @param  {string } body.relation The relation 
623631   * @param  {string } body.object The object, must be of the form: `<type>:<id>` 
624-    * @param  {ClientRequestOptsWithAuthZModelId } [options] 
632+    * @param  {ClientRequestOptsWithConsistency } [options] 
625633   * @param  {string } [options.authorizationModelId] - Overrides the authorization model id in the configuration 
626634   * @param  {object } [options.headers] - Custom headers to send alongside the request 
635+    * @param  {ConsistencyPreference } [options.consistency] - The consistency preference to use 
627636   * @param  {object } [options.retryParams] - Override the retry parameters for this request 
628637   * @param  {number } [options.retryParams.maxRetry] - Override the max number of retries on each API request 
629638   * @param  {number } [options.retryParams.minWaitInMs] - Override the minimum wait before a retry is initiated 
630639   */ 
631-   async  expand ( body : ClientExpandRequest ,  options : ClientRequestOptsWithAuthZModelId  =  { } ) : PromiseResult < ExpandResponse >  { 
640+   async  expand ( body : ClientExpandRequest ,  options : ClientRequestOptsWithConsistency  =  { } ) : PromiseResult < ExpandResponse >  { 
632641    return  this . api . expand ( this . getStoreId ( options ) ! ,  { 
633642      authorization_model_id : this . getAuthorizationModelId ( options ) , 
634643      tuple_key : body , 
@@ -638,14 +647,15 @@ export class OpenFgaClient extends BaseAPI {
638647  /** 
639648   * ListObjects - List the objects of a particular type that the user has a certain relation to (evaluates) 
640649   * @param  {ClientListObjectsRequest } body 
641-    * @param  {ClientRequestOptsWithAuthZModelId } [options] 
650+    * @param  {ClientRequestOptsWithConsistency } [options] 
642651   * @param  {string } [options.authorizationModelId] - Overrides the authorization model id in the configuration 
643652   * @param  {object } [options.headers] - Custom headers to send alongside the request 
653+    * @param  {ConsistencyPreference } [options.consistency] - The consistency preference to use 
644654   * @param  {object } [options.retryParams] - Override the retry parameters for this request 
645655   * @param  {number } [options.retryParams.maxRetry] - Override the max number of retries on each API request 
646656   * @param  {number } [options.retryParams.minWaitInMs] - Override the minimum wait before a retry is initiated 
647657   */ 
648-   async  listObjects ( body : ClientListObjectsRequest ,  options : ClientRequestOptsWithAuthZModelId  =  { } ) : PromiseResult < ListObjectsResponse >  { 
658+   async  listObjects ( body : ClientListObjectsRequest ,  options : ClientRequestOptsWithConsistency  =  { } ) : PromiseResult < ListObjectsResponse >  { 
649659    return  this . api . listObjects ( this . getStoreId ( options ) ! ,  { 
650660      authorization_model_id : this . getAuthorizationModelId ( options ) , 
651661      user : body . user , 
@@ -666,7 +676,7 @@ export class OpenFgaClient extends BaseAPI {
666676   * @param  {object } listRelationsRequest.context The contextual tuples to send 
667677   * @param  options 
668678   */ 
669-   async  listRelations ( listRelationsRequest : ClientListRelationsRequest ,  options : ClientRequestOptsWithAuthZModelId  &  BatchCheckRequestOpts  =  { } ) : Promise < ClientListRelationsResponse >  { 
679+   async  listRelations ( listRelationsRequest : ClientListRelationsRequest ,  options : ClientRequestOptsWithConsistency  &  BatchCheckRequestOpts  =  { } ) : Promise < ClientListRelationsResponse >  { 
670680    const  {  user,  object,  relations,  contextualTuples,  context }  =  listRelationsRequest ; 
671681    const  {  headers =  { } ,  maxParallelRequests =  DEFAULT_MAX_METHOD_PARALLEL_REQS  }  =  options ; 
672682    setHeaderIfNotSet ( headers ,  CLIENT_METHOD_HEADER ,  "ListRelations" ) ; 
@@ -695,14 +705,14 @@ export class OpenFgaClient extends BaseAPI {
695705  /** 
696706   * ListUsers - List the objects of a particular type that the user has a certain relation to (evaluates) 
697707   * @param  {ClientListUsersRequest } body 
698-    * @param  {ClientRequestOptsWithAuthZModelId } [options] 
708+    * @param  {ClientRequestOptsWithConsistency } [options] 
699709   * @param  {string } [options.authorizationModelId] - Overrides the authorization model id in the configuration 
700710   * @param  {object } [options.headers] - Custom headers to send alongside the request 
701711   * @param  {object } [options.retryParams] - Override the retry parameters for this request 
702712   * @param  {number } [options.retryParams.maxRetry] - Override the max number of retries on each API request 
703713   * @param  {number } [options.retryParams.minWaitInMs] - Override the minimum wait before a retry is initiated 
704714   */ 
705-   async  listUsers ( body : ClientListUsersRequest ,  options : ClientRequestOptsWithAuthZModelId  =  { } ) : PromiseResult < ListUsersResponse >  { 
715+   async  listUsers ( body : ClientListUsersRequest ,  options : ClientRequestOptsWithConsistency  =  { } ) : PromiseResult < ListUsersResponse >  { 
706716    return  this . api . listUsers ( this . getStoreId ( options ) ! ,  { 
707717      authorization_model_id : this . getAuthorizationModelId ( options ) , 
708718      relation : body . relation , 
0 commit comments