@@ -22,7 +22,8 @@ import {
22
22
createRequestFunction ,
23
23
RequestArgs ,
24
24
CallResult ,
25
- PromiseResult } from "./common" ;
25
+ PromiseResult
26
+ } from "./common" ;
26
27
import { attributeNames } from "./telemetry" ;
27
28
import { Configuration } from "./configuration" ;
28
29
import { Credentials } from "./credentials" ;
@@ -757,8 +758,8 @@ export const OpenFgaApiFp = function(configuration: Configuration, credentials:
757
758
async check ( storeId : string , body : CheckRequest , options ?: any ) : Promise < ( axios ?: AxiosInstance ) => PromiseResult < CheckResponse > > {
758
759
const localVarAxiosArgs = await localVarAxiosParamCreator . check ( storeId , body , options ) ;
759
760
return createRequestFunction ( localVarAxiosArgs , globalAxios , configuration , credentials , {
760
- [ attributeNames . requestStoreId ] : storeId ,
761
761
[ attributeNames . requestMethod ] : "check" ,
762
+ [ attributeNames . requestStoreId ] : storeId ,
762
763
[ attributeNames . user ] : body . tuple_key . user
763
764
} ) ;
764
765
} ,
@@ -771,8 +772,8 @@ export const OpenFgaApiFp = function(configuration: Configuration, credentials:
771
772
*/
772
773
async createStore ( body : CreateStoreRequest , options ?: any ) : Promise < ( axios ?: AxiosInstance ) => PromiseResult < CreateStoreResponse > > {
773
774
const localVarAxiosArgs = await localVarAxiosParamCreator . createStore ( body , options ) ;
774
- return createRequestFunction ( localVarAxiosArgs , globalAxios , configuration , credentials , {
775
- [ attributeNames . requestMethod ] : "createStore"
775
+ return createRequestFunction ( localVarAxiosArgs , globalAxios , configuration , credentials , {
776
+ [ attributeNames . requestMethod ] : "createStore" ,
776
777
} ) ;
777
778
} ,
778
779
/**
@@ -784,7 +785,10 @@ export const OpenFgaApiFp = function(configuration: Configuration, credentials:
784
785
*/
785
786
async deleteStore ( storeId : string , options ?: any ) : Promise < ( axios ?: AxiosInstance ) => PromiseResult < void > > {
786
787
const localVarAxiosArgs = await localVarAxiosParamCreator . deleteStore ( storeId , options ) ;
787
- return createRequestFunction ( localVarAxiosArgs , globalAxios , configuration , credentials ) ;
788
+ return createRequestFunction ( localVarAxiosArgs , globalAxios , configuration , credentials , {
789
+ [ attributeNames . requestMethod ] : "deleteStore" ,
790
+ [ attributeNames . requestStoreId ] : storeId ,
791
+ } ) ;
788
792
} ,
789
793
/**
790
794
* The Expand API will return all users and usersets that have certain relationship with an object in a certain store. This is different from the `/stores/{store_id}/read` API in that both users and computed usersets are returned. Body parameters `tuple_key.object` and `tuple_key.relation` are all required. The response will return a tree whose leaves are the specific users and usersets. Union, intersection and difference operator are located in the intermediate nodes. ## Example To expand all users that have the `reader` relationship with object `document:2021-budget`, use the Expand API with the following request body ```json { \"tuple_key\": { \"object\": \"document:2021-budget\", \"relation\": \"reader\" }, \"authorization_model_id\": \"01G50QVV17PECNVAHX1GG4Y5NC\" } ``` OpenFGA\'s response will be a userset tree of the users and usersets that have read access to the document. ```json { \"tree\":{ \"root\":{ \"type\":\"document:2021-budget#reader\", \"union\":{ \"nodes\":[ { \"type\":\"document:2021-budget#reader\", \"leaf\":{ \"users\":{ \"users\":[ \"user:bob\" ] } } }, { \"type\":\"document:2021-budget#reader\", \"leaf\":{ \"computed\":{ \"userset\":\"document:2021-budget#writer\" } } } ] } } } } ``` The caller can then call expand API for the `writer` relationship for the `document:2021-budget`.
@@ -797,8 +801,8 @@ export const OpenFgaApiFp = function(configuration: Configuration, credentials:
797
801
async expand ( storeId : string , body : ExpandRequest , options ?: any ) : Promise < ( axios ?: AxiosInstance ) => PromiseResult < ExpandResponse > > {
798
802
const localVarAxiosArgs = await localVarAxiosParamCreator . expand ( storeId , body , options ) ;
799
803
return createRequestFunction ( localVarAxiosArgs , globalAxios , configuration , credentials , {
804
+ [ attributeNames . requestMethod ] : "expand" ,
800
805
[ attributeNames . requestStoreId ] : storeId ,
801
- [ attributeNames . requestMethod ] : "expand"
802
806
} ) ;
803
807
} ,
804
808
/**
@@ -811,8 +815,8 @@ export const OpenFgaApiFp = function(configuration: Configuration, credentials:
811
815
async getStore ( storeId : string , options ?: any ) : Promise < ( axios ?: AxiosInstance ) => PromiseResult < GetStoreResponse > > {
812
816
const localVarAxiosArgs = await localVarAxiosParamCreator . getStore ( storeId , options ) ;
813
817
return createRequestFunction ( localVarAxiosArgs , globalAxios , configuration , credentials , {
814
- [ attributeNames . requestStoreId ] : storeId ,
815
- [ attributeNames . requestMethod ] : "getStore"
818
+ [ attributeNames . requestMethod ] : "getStore" ,
819
+ [ attributeNames . requestStoreId ] : storeId ,
816
820
} ) ;
817
821
} ,
818
822
/**
@@ -826,8 +830,8 @@ export const OpenFgaApiFp = function(configuration: Configuration, credentials:
826
830
async listObjects ( storeId : string , body : ListObjectsRequest , options ?: any ) : Promise < ( axios ?: AxiosInstance ) => PromiseResult < ListObjectsResponse > > {
827
831
const localVarAxiosArgs = await localVarAxiosParamCreator . listObjects ( storeId , body , options ) ;
828
832
return createRequestFunction ( localVarAxiosArgs , globalAxios , configuration , credentials , {
829
- [ attributeNames . requestStoreId ] : storeId ,
830
833
[ attributeNames . requestMethod ] : "listObjects" ,
834
+ [ attributeNames . requestStoreId ] : storeId ,
831
835
[ attributeNames . user ] : body . user
832
836
} ) ;
833
837
} ,
@@ -841,8 +845,8 @@ export const OpenFgaApiFp = function(configuration: Configuration, credentials:
841
845
*/
842
846
async listStores ( pageSize ?: number , continuationToken ?: string , options ?: any ) : Promise < ( axios ?: AxiosInstance ) => PromiseResult < ListStoresResponse > > {
843
847
const localVarAxiosArgs = await localVarAxiosParamCreator . listStores ( pageSize , continuationToken , options ) ;
844
- return createRequestFunction ( localVarAxiosArgs , globalAxios , configuration , credentials , {
845
- [ attributeNames . requestMethod ] : "listStores"
848
+ return createRequestFunction ( localVarAxiosArgs , globalAxios , configuration , credentials , {
849
+ [ attributeNames . requestMethod ] : "listStores" ,
846
850
} ) ;
847
851
} ,
848
852
/**
@@ -856,8 +860,8 @@ export const OpenFgaApiFp = function(configuration: Configuration, credentials:
856
860
async listUsers ( storeId : string , body : ListUsersRequest , options ?: any ) : Promise < ( axios ?: AxiosInstance ) => PromiseResult < ListUsersResponse > > {
857
861
const localVarAxiosArgs = await localVarAxiosParamCreator . listUsers ( storeId , body , options ) ;
858
862
return createRequestFunction ( localVarAxiosArgs , globalAxios , configuration , credentials , {
859
- [ attributeNames . requestStoreId ] : storeId ,
860
- [ attributeNames . requestMethod ] : "listUsers"
863
+ [ attributeNames . requestMethod ] : "listUsers" ,
864
+ [ attributeNames . requestStoreId ] : storeId ,
861
865
} ) ;
862
866
} ,
863
867
/**
@@ -871,8 +875,8 @@ export const OpenFgaApiFp = function(configuration: Configuration, credentials:
871
875
async read ( storeId : string , body : ReadRequest , options ?: any ) : Promise < ( axios ?: AxiosInstance ) => PromiseResult < ReadResponse > > {
872
876
const localVarAxiosArgs = await localVarAxiosParamCreator . read ( storeId , body , options ) ;
873
877
return createRequestFunction ( localVarAxiosArgs , globalAxios , configuration , credentials , {
874
- [ attributeNames . requestStoreId ] : storeId ,
875
- [ attributeNames . requestMethod ] : "read"
878
+ [ attributeNames . requestMethod ] : "read" ,
879
+ [ attributeNames . requestStoreId ] : storeId ,
876
880
} ) ;
877
881
} ,
878
882
/**
@@ -886,8 +890,8 @@ export const OpenFgaApiFp = function(configuration: Configuration, credentials:
886
890
async readAssertions ( storeId : string , authorizationModelId : string , options ?: any ) : Promise < ( axios ?: AxiosInstance ) => PromiseResult < ReadAssertionsResponse > > {
887
891
const localVarAxiosArgs = await localVarAxiosParamCreator . readAssertions ( storeId , authorizationModelId , options ) ;
888
892
return createRequestFunction ( localVarAxiosArgs , globalAxios , configuration , credentials , {
889
- [ attributeNames . requestStoreId ] : storeId ,
890
- [ attributeNames . requestMethod ] : "readAssertions"
893
+ [ attributeNames . requestMethod ] : "readAssertions" ,
894
+ [ attributeNames . requestStoreId ] : storeId ,
891
895
} ) ;
892
896
} ,
893
897
/**
@@ -901,8 +905,8 @@ export const OpenFgaApiFp = function(configuration: Configuration, credentials:
901
905
async readAuthorizationModel ( storeId : string , id : string , options ?: any ) : Promise < ( axios ?: AxiosInstance ) => PromiseResult < ReadAuthorizationModelResponse > > {
902
906
const localVarAxiosArgs = await localVarAxiosParamCreator . readAuthorizationModel ( storeId , id , options ) ;
903
907
return createRequestFunction ( localVarAxiosArgs , globalAxios , configuration , credentials , {
904
- [ attributeNames . requestStoreId ] : storeId ,
905
- [ attributeNames . requestMethod ] : "readAuthorizationModel"
908
+ [ attributeNames . requestMethod ] : "readAuthorizationModel" ,
909
+ [ attributeNames . requestStoreId ] : storeId ,
906
910
} ) ;
907
911
} ,
908
912
/**
@@ -917,8 +921,8 @@ export const OpenFgaApiFp = function(configuration: Configuration, credentials:
917
921
async readAuthorizationModels ( storeId : string , pageSize ?: number , continuationToken ?: string , options ?: any ) : Promise < ( axios ?: AxiosInstance ) => PromiseResult < ReadAuthorizationModelsResponse > > {
918
922
const localVarAxiosArgs = await localVarAxiosParamCreator . readAuthorizationModels ( storeId , pageSize , continuationToken , options ) ;
919
923
return createRequestFunction ( localVarAxiosArgs , globalAxios , configuration , credentials , {
920
- [ attributeNames . requestStoreId ] : storeId ,
921
- [ attributeNames . requestMethod ] : "readAuthorizationModels"
924
+ [ attributeNames . requestMethod ] : "readAuthorizationModels" ,
925
+ [ attributeNames . requestStoreId ] : storeId ,
922
926
} ) ;
923
927
} ,
924
928
/**
@@ -934,8 +938,8 @@ export const OpenFgaApiFp = function(configuration: Configuration, credentials:
934
938
async readChanges ( storeId : string , type ?: string , pageSize ?: number , continuationToken ?: string , options ?: any ) : Promise < ( axios ?: AxiosInstance ) => PromiseResult < ReadChangesResponse > > {
935
939
const localVarAxiosArgs = await localVarAxiosParamCreator . readChanges ( storeId , type , pageSize , continuationToken , options ) ;
936
940
return createRequestFunction ( localVarAxiosArgs , globalAxios , configuration , credentials , {
937
- [ attributeNames . requestStoreId ] : storeId ,
938
- [ attributeNames . requestMethod ] : "readChanges"
941
+ [ attributeNames . requestMethod ] : "readChanges" ,
942
+ [ attributeNames . requestStoreId ] : storeId ,
939
943
} ) ;
940
944
} ,
941
945
/**
@@ -949,8 +953,8 @@ export const OpenFgaApiFp = function(configuration: Configuration, credentials:
949
953
async write ( storeId : string , body : WriteRequest , options ?: any ) : Promise < ( axios ?: AxiosInstance ) => PromiseResult < object > > {
950
954
const localVarAxiosArgs = await localVarAxiosParamCreator . write ( storeId , body , options ) ;
951
955
return createRequestFunction ( localVarAxiosArgs , globalAxios , configuration , credentials , {
952
- [ attributeNames . requestStoreId ] : storeId ,
953
- [ attributeNames . requestMethod ] : "write"
956
+ [ attributeNames . requestMethod ] : "write" ,
957
+ [ attributeNames . requestStoreId ] : storeId ,
954
958
} ) ;
955
959
} ,
956
960
/**
@@ -965,8 +969,8 @@ export const OpenFgaApiFp = function(configuration: Configuration, credentials:
965
969
async writeAssertions ( storeId : string , authorizationModelId : string , body : WriteAssertionsRequest , options ?: any ) : Promise < ( axios ?: AxiosInstance ) => PromiseResult < void > > {
966
970
const localVarAxiosArgs = await localVarAxiosParamCreator . writeAssertions ( storeId , authorizationModelId , body , options ) ;
967
971
return createRequestFunction ( localVarAxiosArgs , globalAxios , configuration , credentials , {
968
- [ attributeNames . requestStoreId ] : storeId ,
969
- [ attributeNames . requestMethod ] : "writeAssertions"
972
+ [ attributeNames . requestMethod ] : "writeAssertions" ,
973
+ [ attributeNames . requestStoreId ] : storeId ,
970
974
} ) ;
971
975
} ,
972
976
/**
@@ -980,8 +984,8 @@ export const OpenFgaApiFp = function(configuration: Configuration, credentials:
980
984
async writeAuthorizationModel ( storeId : string , body : WriteAuthorizationModelRequest , options ?: any ) : Promise < ( axios ?: AxiosInstance ) => PromiseResult < WriteAuthorizationModelResponse > > {
981
985
const localVarAxiosArgs = await localVarAxiosParamCreator . writeAuthorizationModel ( storeId , body , options ) ;
982
986
return createRequestFunction ( localVarAxiosArgs , globalAxios , configuration , credentials , {
983
- [ attributeNames . requestStoreId ] : storeId ,
984
- [ attributeNames . requestMethod ] : "writeAuthorizationModel"
987
+ [ attributeNames . requestMethod ] : "writeAuthorizationModel" ,
988
+ [ attributeNames . requestStoreId ] : storeId ,
985
989
} ) ;
986
990
} ,
987
991
} ;
0 commit comments