@horpynka/api-sdk 1.0.10 → 1.0.11
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.
- package/dist/index.cjs +305 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +116 -5
- package/dist/index.d.ts +116 -5
- package/dist/index.js +302 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -690,6 +690,44 @@ declare class AuthApi extends BaseAPI {
|
|
|
690
690
|
*/
|
|
691
691
|
signUp(signUpUserDTO: SignUpUserDTO, options?: RawAxiosRequestConfig): Promise<axios.AxiosResponse<AccessTokenResponseDto, any, {}, any>>;
|
|
692
692
|
}
|
|
693
|
+
/**
|
|
694
|
+
* CategoriesApi - object-oriented interface
|
|
695
|
+
* @export
|
|
696
|
+
* @class CategoriesApi
|
|
697
|
+
* @extends {BaseAPI}
|
|
698
|
+
*/
|
|
699
|
+
declare class CategoriesApi extends BaseAPI {
|
|
700
|
+
/**
|
|
701
|
+
*
|
|
702
|
+
* @param {*} [options] Override http request option.
|
|
703
|
+
* @throws {RequiredError}
|
|
704
|
+
* @memberof CategoriesApi
|
|
705
|
+
*/
|
|
706
|
+
findAll(options?: RawAxiosRequestConfig): Promise<axios.AxiosResponse<object, any, {}, any>>;
|
|
707
|
+
}
|
|
708
|
+
/**
|
|
709
|
+
* DishesApi - object-oriented interface
|
|
710
|
+
* @export
|
|
711
|
+
* @class DishesApi
|
|
712
|
+
* @extends {BaseAPI}
|
|
713
|
+
*/
|
|
714
|
+
declare class DishesApi extends BaseAPI {
|
|
715
|
+
/**
|
|
716
|
+
*
|
|
717
|
+
* @param {*} [options] Override http request option.
|
|
718
|
+
* @throws {RequiredError}
|
|
719
|
+
* @memberof DishesApi
|
|
720
|
+
*/
|
|
721
|
+
findAll(options?: RawAxiosRequestConfig): Promise<axios.AxiosResponse<Dish[], any, {}, any>>;
|
|
722
|
+
/**
|
|
723
|
+
*
|
|
724
|
+
* @param {number} id
|
|
725
|
+
* @param {*} [options] Override http request option.
|
|
726
|
+
* @throws {RequiredError}
|
|
727
|
+
* @memberof DishesApi
|
|
728
|
+
*/
|
|
729
|
+
findOne(id: number, options?: RawAxiosRequestConfig): Promise<axios.AxiosResponse<Dish, any, {}, any>>;
|
|
730
|
+
}
|
|
693
731
|
/**
|
|
694
732
|
* OrdersApi - object-oriented interface
|
|
695
733
|
* @export
|
|
@@ -741,19 +779,64 @@ declare class OrdersApi extends BaseAPI {
|
|
|
741
779
|
*/
|
|
742
780
|
update(id: number, updateOrderDto: UpdateOrderDto, options?: RawAxiosRequestConfig): Promise<axios.AxiosResponse<Order, any, {}, any>>;
|
|
743
781
|
}
|
|
782
|
+
/**
|
|
783
|
+
* ProductsApi - object-oriented interface
|
|
784
|
+
* @export
|
|
785
|
+
* @class ProductsApi
|
|
786
|
+
* @extends {BaseAPI}
|
|
787
|
+
*/
|
|
788
|
+
declare class ProductsApi extends BaseAPI {
|
|
789
|
+
/**
|
|
790
|
+
*
|
|
791
|
+
* @param {*} [options] Override http request option.
|
|
792
|
+
* @throws {RequiredError}
|
|
793
|
+
* @memberof ProductsApi
|
|
794
|
+
*/
|
|
795
|
+
findAll(options?: RawAxiosRequestConfig): Promise<axios.AxiosResponse<Product[], any, {}, any>>;
|
|
796
|
+
}
|
|
744
797
|
|
|
745
798
|
declare let tanstackClient: QueryClient;
|
|
746
|
-
declare let ordersApi: OrdersApi;
|
|
747
799
|
declare let authApi: AuthApi;
|
|
800
|
+
declare let categoriesApi: CategoriesApi;
|
|
801
|
+
declare let dishesApi: DishesApi;
|
|
802
|
+
declare let ordersApi: OrdersApi;
|
|
803
|
+
declare let productsApi: ProductsApi;
|
|
748
804
|
declare function initApiClient(config: CreateAxiosDefaults): AxiosInstance;
|
|
749
805
|
|
|
750
|
-
declare const
|
|
751
|
-
|
|
806
|
+
declare const useAuthApi: () => {
|
|
807
|
+
mutateRefresh: _tanstack_react_query.UseMutationResult<axios.AxiosResponse<void, any, {}, any>, Error, {
|
|
808
|
+
onSettledCallback?: () => void;
|
|
809
|
+
}, unknown>;
|
|
810
|
+
mutateSignIn: _tanstack_react_query.UseMutationResult<axios.AxiosResponse<AccessTokenResponseDto, any, {}, any>, Error, {
|
|
752
811
|
params: {
|
|
753
|
-
|
|
812
|
+
signInUserDTO: SignInUserDTO;
|
|
813
|
+
};
|
|
814
|
+
onSettledCallback?: () => void;
|
|
815
|
+
}, unknown>;
|
|
816
|
+
mutateSignUp: _tanstack_react_query.UseMutationResult<axios.AxiosResponse<AccessTokenResponseDto, any, {}, any>, Error, {
|
|
817
|
+
params: {
|
|
818
|
+
signUpUserDTO: SignUpUserDTO;
|
|
754
819
|
};
|
|
755
820
|
onSettledCallback?: () => void;
|
|
756
821
|
}, unknown>;
|
|
822
|
+
};
|
|
823
|
+
|
|
824
|
+
declare const useCategoriesApi: () => {
|
|
825
|
+
getCategoriesQuery: () => _tanstack_query_core.OmitKeyof<_tanstack_react_query.UseQueryOptions<object, Error, object, string[]>, "queryFn"> & {
|
|
826
|
+
queryFn?: _tanstack_query_core.QueryFunction<object, string[], never> | undefined;
|
|
827
|
+
} & _tanstack_query_core.QueryKeyWithDataTag<string[], object, Error>;
|
|
828
|
+
};
|
|
829
|
+
|
|
830
|
+
declare const useDishesApi: () => {
|
|
831
|
+
getDishesQuery: () => _tanstack_query_core.OmitKeyof<_tanstack_react_query.UseQueryOptions<Dish[], Error, Dish[], string[]>, "queryFn"> & {
|
|
832
|
+
queryFn?: _tanstack_query_core.QueryFunction<Dish[], string[], never> | undefined;
|
|
833
|
+
} & _tanstack_query_core.QueryKeyWithDataTag<string[], Dish[], Error>;
|
|
834
|
+
getDishQuery: (id: number) => _tanstack_query_core.OmitKeyof<_tanstack_react_query.UseQueryOptions<Dish, Error, Dish, (string | number)[]>, "queryFn"> & {
|
|
835
|
+
queryFn?: _tanstack_query_core.QueryFunction<Dish, (string | number)[], never> | undefined;
|
|
836
|
+
} & _tanstack_query_core.QueryKeyWithDataTag<(string | number)[], Dish, Error>;
|
|
837
|
+
};
|
|
838
|
+
|
|
839
|
+
declare const useOrdersApi: () => {
|
|
757
840
|
getOrdersQuery: (params?: {
|
|
758
841
|
page?: number;
|
|
759
842
|
limit?: number;
|
|
@@ -773,6 +856,34 @@ declare const useOrdersApi: () => {
|
|
|
773
856
|
limit?: number;
|
|
774
857
|
status?: string;
|
|
775
858
|
} | undefined)[], Order[], Error>;
|
|
859
|
+
getOrderQuery: (id: number) => _tanstack_query_core.OmitKeyof<_tanstack_react_query.UseQueryOptions<Order, Error, Order, (string | number)[]>, "queryFn"> & {
|
|
860
|
+
queryFn?: _tanstack_query_core.QueryFunction<Order, (string | number)[], never> | undefined;
|
|
861
|
+
} & _tanstack_query_core.QueryKeyWithDataTag<(string | number)[], Order, Error>;
|
|
862
|
+
mutateCreateOrder: _tanstack_react_query.UseMutationResult<axios.AxiosResponse<Order, any, {}, any>, Error, {
|
|
863
|
+
params: {
|
|
864
|
+
createOrderDto: CreateOrderDto;
|
|
865
|
+
};
|
|
866
|
+
onSettledCallback?: () => void;
|
|
867
|
+
}, unknown>;
|
|
868
|
+
mutateUpdateOrder: _tanstack_react_query.UseMutationResult<axios.AxiosResponse<Order, any, {}, any>, Error, {
|
|
869
|
+
params: {
|
|
870
|
+
id: number;
|
|
871
|
+
updateOrderDto: UpdateOrderDto;
|
|
872
|
+
};
|
|
873
|
+
onSettledCallback?: () => void;
|
|
874
|
+
}, unknown>;
|
|
875
|
+
mutateDeleteReceipt: _tanstack_react_query.UseMutationResult<axios.AxiosResponse<Order, any, {}, any>, Error, {
|
|
876
|
+
params: {
|
|
877
|
+
id: number;
|
|
878
|
+
};
|
|
879
|
+
onSettledCallback?: () => void;
|
|
880
|
+
}, unknown>;
|
|
881
|
+
};
|
|
882
|
+
|
|
883
|
+
declare const useProductsApi: () => {
|
|
884
|
+
getProductsQuery: () => _tanstack_query_core.OmitKeyof<_tanstack_react_query.UseQueryOptions<Product[], Error, Product[], string[]>, "queryFn"> & {
|
|
885
|
+
queryFn?: _tanstack_query_core.QueryFunction<Product[], string[], never> | undefined;
|
|
886
|
+
} & _tanstack_query_core.QueryKeyWithDataTag<string[], Product[], Error>;
|
|
776
887
|
};
|
|
777
888
|
|
|
778
|
-
export { authApi, initApiClient, ordersApi, tanstackClient, useOrdersApi };
|
|
889
|
+
export { authApi, categoriesApi, dishesApi, initApiClient, ordersApi, productsApi, tanstackClient, useAuthApi, useCategoriesApi, useDishesApi, useOrdersApi, useProductsApi };
|
package/dist/index.d.ts
CHANGED
|
@@ -690,6 +690,44 @@ declare class AuthApi extends BaseAPI {
|
|
|
690
690
|
*/
|
|
691
691
|
signUp(signUpUserDTO: SignUpUserDTO, options?: RawAxiosRequestConfig): Promise<axios.AxiosResponse<AccessTokenResponseDto, any, {}, any>>;
|
|
692
692
|
}
|
|
693
|
+
/**
|
|
694
|
+
* CategoriesApi - object-oriented interface
|
|
695
|
+
* @export
|
|
696
|
+
* @class CategoriesApi
|
|
697
|
+
* @extends {BaseAPI}
|
|
698
|
+
*/
|
|
699
|
+
declare class CategoriesApi extends BaseAPI {
|
|
700
|
+
/**
|
|
701
|
+
*
|
|
702
|
+
* @param {*} [options] Override http request option.
|
|
703
|
+
* @throws {RequiredError}
|
|
704
|
+
* @memberof CategoriesApi
|
|
705
|
+
*/
|
|
706
|
+
findAll(options?: RawAxiosRequestConfig): Promise<axios.AxiosResponse<object, any, {}, any>>;
|
|
707
|
+
}
|
|
708
|
+
/**
|
|
709
|
+
* DishesApi - object-oriented interface
|
|
710
|
+
* @export
|
|
711
|
+
* @class DishesApi
|
|
712
|
+
* @extends {BaseAPI}
|
|
713
|
+
*/
|
|
714
|
+
declare class DishesApi extends BaseAPI {
|
|
715
|
+
/**
|
|
716
|
+
*
|
|
717
|
+
* @param {*} [options] Override http request option.
|
|
718
|
+
* @throws {RequiredError}
|
|
719
|
+
* @memberof DishesApi
|
|
720
|
+
*/
|
|
721
|
+
findAll(options?: RawAxiosRequestConfig): Promise<axios.AxiosResponse<Dish[], any, {}, any>>;
|
|
722
|
+
/**
|
|
723
|
+
*
|
|
724
|
+
* @param {number} id
|
|
725
|
+
* @param {*} [options] Override http request option.
|
|
726
|
+
* @throws {RequiredError}
|
|
727
|
+
* @memberof DishesApi
|
|
728
|
+
*/
|
|
729
|
+
findOne(id: number, options?: RawAxiosRequestConfig): Promise<axios.AxiosResponse<Dish, any, {}, any>>;
|
|
730
|
+
}
|
|
693
731
|
/**
|
|
694
732
|
* OrdersApi - object-oriented interface
|
|
695
733
|
* @export
|
|
@@ -741,19 +779,64 @@ declare class OrdersApi extends BaseAPI {
|
|
|
741
779
|
*/
|
|
742
780
|
update(id: number, updateOrderDto: UpdateOrderDto, options?: RawAxiosRequestConfig): Promise<axios.AxiosResponse<Order, any, {}, any>>;
|
|
743
781
|
}
|
|
782
|
+
/**
|
|
783
|
+
* ProductsApi - object-oriented interface
|
|
784
|
+
* @export
|
|
785
|
+
* @class ProductsApi
|
|
786
|
+
* @extends {BaseAPI}
|
|
787
|
+
*/
|
|
788
|
+
declare class ProductsApi extends BaseAPI {
|
|
789
|
+
/**
|
|
790
|
+
*
|
|
791
|
+
* @param {*} [options] Override http request option.
|
|
792
|
+
* @throws {RequiredError}
|
|
793
|
+
* @memberof ProductsApi
|
|
794
|
+
*/
|
|
795
|
+
findAll(options?: RawAxiosRequestConfig): Promise<axios.AxiosResponse<Product[], any, {}, any>>;
|
|
796
|
+
}
|
|
744
797
|
|
|
745
798
|
declare let tanstackClient: QueryClient;
|
|
746
|
-
declare let ordersApi: OrdersApi;
|
|
747
799
|
declare let authApi: AuthApi;
|
|
800
|
+
declare let categoriesApi: CategoriesApi;
|
|
801
|
+
declare let dishesApi: DishesApi;
|
|
802
|
+
declare let ordersApi: OrdersApi;
|
|
803
|
+
declare let productsApi: ProductsApi;
|
|
748
804
|
declare function initApiClient(config: CreateAxiosDefaults): AxiosInstance;
|
|
749
805
|
|
|
750
|
-
declare const
|
|
751
|
-
|
|
806
|
+
declare const useAuthApi: () => {
|
|
807
|
+
mutateRefresh: _tanstack_react_query.UseMutationResult<axios.AxiosResponse<void, any, {}, any>, Error, {
|
|
808
|
+
onSettledCallback?: () => void;
|
|
809
|
+
}, unknown>;
|
|
810
|
+
mutateSignIn: _tanstack_react_query.UseMutationResult<axios.AxiosResponse<AccessTokenResponseDto, any, {}, any>, Error, {
|
|
752
811
|
params: {
|
|
753
|
-
|
|
812
|
+
signInUserDTO: SignInUserDTO;
|
|
813
|
+
};
|
|
814
|
+
onSettledCallback?: () => void;
|
|
815
|
+
}, unknown>;
|
|
816
|
+
mutateSignUp: _tanstack_react_query.UseMutationResult<axios.AxiosResponse<AccessTokenResponseDto, any, {}, any>, Error, {
|
|
817
|
+
params: {
|
|
818
|
+
signUpUserDTO: SignUpUserDTO;
|
|
754
819
|
};
|
|
755
820
|
onSettledCallback?: () => void;
|
|
756
821
|
}, unknown>;
|
|
822
|
+
};
|
|
823
|
+
|
|
824
|
+
declare const useCategoriesApi: () => {
|
|
825
|
+
getCategoriesQuery: () => _tanstack_query_core.OmitKeyof<_tanstack_react_query.UseQueryOptions<object, Error, object, string[]>, "queryFn"> & {
|
|
826
|
+
queryFn?: _tanstack_query_core.QueryFunction<object, string[], never> | undefined;
|
|
827
|
+
} & _tanstack_query_core.QueryKeyWithDataTag<string[], object, Error>;
|
|
828
|
+
};
|
|
829
|
+
|
|
830
|
+
declare const useDishesApi: () => {
|
|
831
|
+
getDishesQuery: () => _tanstack_query_core.OmitKeyof<_tanstack_react_query.UseQueryOptions<Dish[], Error, Dish[], string[]>, "queryFn"> & {
|
|
832
|
+
queryFn?: _tanstack_query_core.QueryFunction<Dish[], string[], never> | undefined;
|
|
833
|
+
} & _tanstack_query_core.QueryKeyWithDataTag<string[], Dish[], Error>;
|
|
834
|
+
getDishQuery: (id: number) => _tanstack_query_core.OmitKeyof<_tanstack_react_query.UseQueryOptions<Dish, Error, Dish, (string | number)[]>, "queryFn"> & {
|
|
835
|
+
queryFn?: _tanstack_query_core.QueryFunction<Dish, (string | number)[], never> | undefined;
|
|
836
|
+
} & _tanstack_query_core.QueryKeyWithDataTag<(string | number)[], Dish, Error>;
|
|
837
|
+
};
|
|
838
|
+
|
|
839
|
+
declare const useOrdersApi: () => {
|
|
757
840
|
getOrdersQuery: (params?: {
|
|
758
841
|
page?: number;
|
|
759
842
|
limit?: number;
|
|
@@ -773,6 +856,34 @@ declare const useOrdersApi: () => {
|
|
|
773
856
|
limit?: number;
|
|
774
857
|
status?: string;
|
|
775
858
|
} | undefined)[], Order[], Error>;
|
|
859
|
+
getOrderQuery: (id: number) => _tanstack_query_core.OmitKeyof<_tanstack_react_query.UseQueryOptions<Order, Error, Order, (string | number)[]>, "queryFn"> & {
|
|
860
|
+
queryFn?: _tanstack_query_core.QueryFunction<Order, (string | number)[], never> | undefined;
|
|
861
|
+
} & _tanstack_query_core.QueryKeyWithDataTag<(string | number)[], Order, Error>;
|
|
862
|
+
mutateCreateOrder: _tanstack_react_query.UseMutationResult<axios.AxiosResponse<Order, any, {}, any>, Error, {
|
|
863
|
+
params: {
|
|
864
|
+
createOrderDto: CreateOrderDto;
|
|
865
|
+
};
|
|
866
|
+
onSettledCallback?: () => void;
|
|
867
|
+
}, unknown>;
|
|
868
|
+
mutateUpdateOrder: _tanstack_react_query.UseMutationResult<axios.AxiosResponse<Order, any, {}, any>, Error, {
|
|
869
|
+
params: {
|
|
870
|
+
id: number;
|
|
871
|
+
updateOrderDto: UpdateOrderDto;
|
|
872
|
+
};
|
|
873
|
+
onSettledCallback?: () => void;
|
|
874
|
+
}, unknown>;
|
|
875
|
+
mutateDeleteReceipt: _tanstack_react_query.UseMutationResult<axios.AxiosResponse<Order, any, {}, any>, Error, {
|
|
876
|
+
params: {
|
|
877
|
+
id: number;
|
|
878
|
+
};
|
|
879
|
+
onSettledCallback?: () => void;
|
|
880
|
+
}, unknown>;
|
|
881
|
+
};
|
|
882
|
+
|
|
883
|
+
declare const useProductsApi: () => {
|
|
884
|
+
getProductsQuery: () => _tanstack_query_core.OmitKeyof<_tanstack_react_query.UseQueryOptions<Product[], Error, Product[], string[]>, "queryFn"> & {
|
|
885
|
+
queryFn?: _tanstack_query_core.QueryFunction<Product[], string[], never> | undefined;
|
|
886
|
+
} & _tanstack_query_core.QueryKeyWithDataTag<string[], Product[], Error>;
|
|
776
887
|
};
|
|
777
888
|
|
|
778
|
-
export { authApi, initApiClient, ordersApi, tanstackClient, useOrdersApi };
|
|
889
|
+
export { authApi, categoriesApi, dishesApi, initApiClient, ordersApi, productsApi, tanstackClient, useAuthApi, useCategoriesApi, useDishesApi, useOrdersApi, useProductsApi };
|
package/dist/index.js
CHANGED
|
@@ -267,6 +267,161 @@ var AuthApi = class extends BaseAPI {
|
|
|
267
267
|
return AuthApiFp(this.configuration).signUp(signUpUserDTO, options).then((request) => request(this.axios, this.basePath));
|
|
268
268
|
}
|
|
269
269
|
};
|
|
270
|
+
var CategoriesApiAxiosParamCreator = function(configuration) {
|
|
271
|
+
return {
|
|
272
|
+
/**
|
|
273
|
+
*
|
|
274
|
+
* @param {*} [options] Override http request option.
|
|
275
|
+
* @throws {RequiredError}
|
|
276
|
+
*/
|
|
277
|
+
findAll: async (options = {}) => {
|
|
278
|
+
const localVarPath = `/categories`;
|
|
279
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
280
|
+
let baseOptions;
|
|
281
|
+
if (configuration) {
|
|
282
|
+
baseOptions = configuration.baseOptions;
|
|
283
|
+
}
|
|
284
|
+
const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
|
|
285
|
+
const localVarHeaderParameter = {};
|
|
286
|
+
const localVarQueryParameter = {};
|
|
287
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
288
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
289
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
290
|
+
return {
|
|
291
|
+
url: toPathString(localVarUrlObj),
|
|
292
|
+
options: localVarRequestOptions
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
};
|
|
296
|
+
};
|
|
297
|
+
var CategoriesApiFp = function(configuration) {
|
|
298
|
+
const localVarAxiosParamCreator = CategoriesApiAxiosParamCreator(configuration);
|
|
299
|
+
return {
|
|
300
|
+
/**
|
|
301
|
+
*
|
|
302
|
+
* @param {*} [options] Override http request option.
|
|
303
|
+
* @throws {RequiredError}
|
|
304
|
+
*/
|
|
305
|
+
async findAll(options) {
|
|
306
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.findAll(options);
|
|
307
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
308
|
+
const localVarOperationServerBasePath = operationServerMap["CategoriesApi.findAll"]?.[localVarOperationServerIndex]?.url;
|
|
309
|
+
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
310
|
+
}
|
|
311
|
+
};
|
|
312
|
+
};
|
|
313
|
+
var CategoriesApi = class extends BaseAPI {
|
|
314
|
+
/**
|
|
315
|
+
*
|
|
316
|
+
* @param {*} [options] Override http request option.
|
|
317
|
+
* @throws {RequiredError}
|
|
318
|
+
* @memberof CategoriesApi
|
|
319
|
+
*/
|
|
320
|
+
findAll(options) {
|
|
321
|
+
return CategoriesApiFp(this.configuration).findAll(options).then((request) => request(this.axios, this.basePath));
|
|
322
|
+
}
|
|
323
|
+
};
|
|
324
|
+
var DishesApiAxiosParamCreator = function(configuration) {
|
|
325
|
+
return {
|
|
326
|
+
/**
|
|
327
|
+
*
|
|
328
|
+
* @param {*} [options] Override http request option.
|
|
329
|
+
* @throws {RequiredError}
|
|
330
|
+
*/
|
|
331
|
+
findAll: async (options = {}) => {
|
|
332
|
+
const localVarPath = `/dishes`;
|
|
333
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
334
|
+
let baseOptions;
|
|
335
|
+
if (configuration) {
|
|
336
|
+
baseOptions = configuration.baseOptions;
|
|
337
|
+
}
|
|
338
|
+
const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
|
|
339
|
+
const localVarHeaderParameter = {};
|
|
340
|
+
const localVarQueryParameter = {};
|
|
341
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
342
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
343
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
344
|
+
return {
|
|
345
|
+
url: toPathString(localVarUrlObj),
|
|
346
|
+
options: localVarRequestOptions
|
|
347
|
+
};
|
|
348
|
+
},
|
|
349
|
+
/**
|
|
350
|
+
*
|
|
351
|
+
* @param {number} id
|
|
352
|
+
* @param {*} [options] Override http request option.
|
|
353
|
+
* @throws {RequiredError}
|
|
354
|
+
*/
|
|
355
|
+
findOne: async (id, options = {}) => {
|
|
356
|
+
assertParamExists("findOne", "id", id);
|
|
357
|
+
const localVarPath = `/dishes/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(id)));
|
|
358
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
359
|
+
let baseOptions;
|
|
360
|
+
if (configuration) {
|
|
361
|
+
baseOptions = configuration.baseOptions;
|
|
362
|
+
}
|
|
363
|
+
const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
|
|
364
|
+
const localVarHeaderParameter = {};
|
|
365
|
+
const localVarQueryParameter = {};
|
|
366
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
367
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
368
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
369
|
+
return {
|
|
370
|
+
url: toPathString(localVarUrlObj),
|
|
371
|
+
options: localVarRequestOptions
|
|
372
|
+
};
|
|
373
|
+
}
|
|
374
|
+
};
|
|
375
|
+
};
|
|
376
|
+
var DishesApiFp = function(configuration) {
|
|
377
|
+
const localVarAxiosParamCreator = DishesApiAxiosParamCreator(configuration);
|
|
378
|
+
return {
|
|
379
|
+
/**
|
|
380
|
+
*
|
|
381
|
+
* @param {*} [options] Override http request option.
|
|
382
|
+
* @throws {RequiredError}
|
|
383
|
+
*/
|
|
384
|
+
async findAll(options) {
|
|
385
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.findAll(options);
|
|
386
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
387
|
+
const localVarOperationServerBasePath = operationServerMap["DishesApi.findAll"]?.[localVarOperationServerIndex]?.url;
|
|
388
|
+
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
389
|
+
},
|
|
390
|
+
/**
|
|
391
|
+
*
|
|
392
|
+
* @param {number} id
|
|
393
|
+
* @param {*} [options] Override http request option.
|
|
394
|
+
* @throws {RequiredError}
|
|
395
|
+
*/
|
|
396
|
+
async findOne(id, options) {
|
|
397
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.findOne(id, options);
|
|
398
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
399
|
+
const localVarOperationServerBasePath = operationServerMap["DishesApi.findOne"]?.[localVarOperationServerIndex]?.url;
|
|
400
|
+
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
401
|
+
}
|
|
402
|
+
};
|
|
403
|
+
};
|
|
404
|
+
var DishesApi = class extends BaseAPI {
|
|
405
|
+
/**
|
|
406
|
+
*
|
|
407
|
+
* @param {*} [options] Override http request option.
|
|
408
|
+
* @throws {RequiredError}
|
|
409
|
+
* @memberof DishesApi
|
|
410
|
+
*/
|
|
411
|
+
findAll(options) {
|
|
412
|
+
return DishesApiFp(this.configuration).findAll(options).then((request) => request(this.axios, this.basePath));
|
|
413
|
+
}
|
|
414
|
+
/**
|
|
415
|
+
*
|
|
416
|
+
* @param {number} id
|
|
417
|
+
* @param {*} [options] Override http request option.
|
|
418
|
+
* @throws {RequiredError}
|
|
419
|
+
* @memberof DishesApi
|
|
420
|
+
*/
|
|
421
|
+
findOne(id, options) {
|
|
422
|
+
return DishesApiFp(this.configuration).findOne(id, options).then((request) => request(this.axios, this.basePath));
|
|
423
|
+
}
|
|
424
|
+
};
|
|
270
425
|
var OrdersApiAxiosParamCreator = function(configuration) {
|
|
271
426
|
return {
|
|
272
427
|
/**
|
|
@@ -535,6 +690,60 @@ var OrdersApi = class extends BaseAPI {
|
|
|
535
690
|
return OrdersApiFp(this.configuration).update(id, updateOrderDto, options).then((request) => request(this.axios, this.basePath));
|
|
536
691
|
}
|
|
537
692
|
};
|
|
693
|
+
var ProductsApiAxiosParamCreator = function(configuration) {
|
|
694
|
+
return {
|
|
695
|
+
/**
|
|
696
|
+
*
|
|
697
|
+
* @param {*} [options] Override http request option.
|
|
698
|
+
* @throws {RequiredError}
|
|
699
|
+
*/
|
|
700
|
+
findAll: async (options = {}) => {
|
|
701
|
+
const localVarPath = `/products`;
|
|
702
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
703
|
+
let baseOptions;
|
|
704
|
+
if (configuration) {
|
|
705
|
+
baseOptions = configuration.baseOptions;
|
|
706
|
+
}
|
|
707
|
+
const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
|
|
708
|
+
const localVarHeaderParameter = {};
|
|
709
|
+
const localVarQueryParameter = {};
|
|
710
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
711
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
712
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
713
|
+
return {
|
|
714
|
+
url: toPathString(localVarUrlObj),
|
|
715
|
+
options: localVarRequestOptions
|
|
716
|
+
};
|
|
717
|
+
}
|
|
718
|
+
};
|
|
719
|
+
};
|
|
720
|
+
var ProductsApiFp = function(configuration) {
|
|
721
|
+
const localVarAxiosParamCreator = ProductsApiAxiosParamCreator(configuration);
|
|
722
|
+
return {
|
|
723
|
+
/**
|
|
724
|
+
*
|
|
725
|
+
* @param {*} [options] Override http request option.
|
|
726
|
+
* @throws {RequiredError}
|
|
727
|
+
*/
|
|
728
|
+
async findAll(options) {
|
|
729
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.findAll(options);
|
|
730
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
731
|
+
const localVarOperationServerBasePath = operationServerMap["ProductsApi.findAll"]?.[localVarOperationServerIndex]?.url;
|
|
732
|
+
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
733
|
+
}
|
|
734
|
+
};
|
|
735
|
+
};
|
|
736
|
+
var ProductsApi = class extends BaseAPI {
|
|
737
|
+
/**
|
|
738
|
+
*
|
|
739
|
+
* @param {*} [options] Override http request option.
|
|
740
|
+
* @throws {RequiredError}
|
|
741
|
+
* @memberof ProductsApi
|
|
742
|
+
*/
|
|
743
|
+
findAll(options) {
|
|
744
|
+
return ProductsApiFp(this.configuration).findAll(options).then((request) => request(this.axios, this.basePath));
|
|
745
|
+
}
|
|
746
|
+
};
|
|
538
747
|
|
|
539
748
|
// src/api/generated/configuration.ts
|
|
540
749
|
var Configuration = class {
|
|
@@ -625,8 +834,11 @@ var Configuration = class {
|
|
|
625
834
|
}
|
|
626
835
|
};
|
|
627
836
|
var tanstackClient;
|
|
628
|
-
var ordersApi;
|
|
629
837
|
var authApi;
|
|
838
|
+
var categoriesApi;
|
|
839
|
+
var dishesApi;
|
|
840
|
+
var ordersApi;
|
|
841
|
+
var productsApi;
|
|
630
842
|
function initApiClient(config) {
|
|
631
843
|
const apiClient = globalAxios2.create({
|
|
632
844
|
baseURL: config.baseURL,
|
|
@@ -636,16 +848,89 @@ function initApiClient(config) {
|
|
|
636
848
|
basePath: config.baseURL
|
|
637
849
|
});
|
|
638
850
|
tanstackClient = new QueryClient();
|
|
639
|
-
ordersApi = new OrdersApi(configuration, void 0, apiClient);
|
|
640
851
|
authApi = new AuthApi(configuration, void 0, apiClient);
|
|
852
|
+
categoriesApi = new CategoriesApi(configuration, void 0, apiClient);
|
|
853
|
+
dishesApi = new DishesApi(configuration, void 0, apiClient);
|
|
854
|
+
ordersApi = new OrdersApi(configuration, void 0, apiClient);
|
|
855
|
+
productsApi = new ProductsApi(configuration, void 0, apiClient);
|
|
641
856
|
return apiClient;
|
|
642
857
|
}
|
|
858
|
+
var useAuthApi = () => {
|
|
859
|
+
const queryClient = useQueryClient();
|
|
860
|
+
const mutateRefresh = useMutation({
|
|
861
|
+
mutationFn: ({ onSettledCallback } = {}) => authApi.refresh(),
|
|
862
|
+
onSettled: (_data, _error, variables) => {
|
|
863
|
+
queryClient.invalidateQueries({ queryKey: ["auth"] });
|
|
864
|
+
variables?.onSettledCallback && variables.onSettledCallback();
|
|
865
|
+
}
|
|
866
|
+
});
|
|
867
|
+
const mutateSignIn = useMutation({
|
|
868
|
+
mutationFn: ({ params: { signInUserDTO } }) => authApi.signIn(signInUserDTO),
|
|
869
|
+
onSettled: (_data, _error, { onSettledCallback }) => {
|
|
870
|
+
queryClient.invalidateQueries({ queryKey: ["auth"] });
|
|
871
|
+
onSettledCallback && onSettledCallback();
|
|
872
|
+
}
|
|
873
|
+
});
|
|
874
|
+
const mutateSignUp = useMutation({
|
|
875
|
+
mutationFn: ({ params: { signUpUserDTO } }) => authApi.signUp(signUpUserDTO),
|
|
876
|
+
onSettled: (_data, _error, { onSettledCallback }) => {
|
|
877
|
+
queryClient.invalidateQueries({ queryKey: ["auth"] });
|
|
878
|
+
onSettledCallback && onSettledCallback();
|
|
879
|
+
}
|
|
880
|
+
});
|
|
881
|
+
return {
|
|
882
|
+
mutateRefresh,
|
|
883
|
+
mutateSignIn,
|
|
884
|
+
mutateSignUp
|
|
885
|
+
};
|
|
886
|
+
};
|
|
887
|
+
var getCategoriesQuery = () => queryOptions({
|
|
888
|
+
queryKey: ["categories"],
|
|
889
|
+
queryFn: () => categoriesApi.findAll().then((res) => res.data)
|
|
890
|
+
});
|
|
891
|
+
var useCategoriesApi = () => {
|
|
892
|
+
return {
|
|
893
|
+
getCategoriesQuery
|
|
894
|
+
};
|
|
895
|
+
};
|
|
896
|
+
var getDishesQuery = () => queryOptions({
|
|
897
|
+
queryKey: ["dishes"],
|
|
898
|
+
queryFn: () => dishesApi.findAll().then((res) => res.data)
|
|
899
|
+
});
|
|
900
|
+
var getDishQuery = (id) => queryOptions({
|
|
901
|
+
queryKey: ["dishes", id],
|
|
902
|
+
queryFn: () => dishesApi.findOne(id).then((res) => res.data)
|
|
903
|
+
});
|
|
904
|
+
var useDishesApi = () => {
|
|
905
|
+
return {
|
|
906
|
+
getDishesQuery,
|
|
907
|
+
getDishQuery
|
|
908
|
+
};
|
|
909
|
+
};
|
|
643
910
|
var getOrdersQuery = (params) => queryOptions({
|
|
644
911
|
queryKey: ["orders", params],
|
|
645
912
|
queryFn: () => ordersApi.findAll(params?.page, params?.limit, params?.status).then((res) => res.data)
|
|
646
913
|
});
|
|
914
|
+
var getOrderQuery = (id) => queryOptions({
|
|
915
|
+
queryKey: ["orders", id],
|
|
916
|
+
queryFn: () => ordersApi.findOne(id).then((res) => res.data)
|
|
917
|
+
});
|
|
647
918
|
var useOrdersApi = () => {
|
|
648
919
|
const queryClient = useQueryClient();
|
|
920
|
+
const mutateCreateOrder = useMutation({
|
|
921
|
+
mutationFn: ({ params: { createOrderDto } }) => ordersApi.create(createOrderDto),
|
|
922
|
+
onSettled: (_data, _error, { onSettledCallback }) => {
|
|
923
|
+
queryClient.invalidateQueries({ queryKey: ["orders"] });
|
|
924
|
+
onSettledCallback && onSettledCallback();
|
|
925
|
+
}
|
|
926
|
+
});
|
|
927
|
+
const mutateUpdateOrder = useMutation({
|
|
928
|
+
mutationFn: ({ params: { id, updateOrderDto } }) => ordersApi.update(id, updateOrderDto),
|
|
929
|
+
onSettled: (_data, _error, { onSettledCallback }) => {
|
|
930
|
+
queryClient.invalidateQueries({ queryKey: ["orders"] });
|
|
931
|
+
onSettledCallback && onSettledCallback();
|
|
932
|
+
}
|
|
933
|
+
});
|
|
649
934
|
const mutateDeleteReceipt = useMutation({
|
|
650
935
|
mutationFn: ({ params: { id } }) => ordersApi.removeActiveReceipt(id),
|
|
651
936
|
onSettled: (_data, _error, { onSettledCallback }) => {
|
|
@@ -654,11 +939,23 @@ var useOrdersApi = () => {
|
|
|
654
939
|
}
|
|
655
940
|
});
|
|
656
941
|
return {
|
|
657
|
-
|
|
658
|
-
|
|
942
|
+
getOrdersQuery,
|
|
943
|
+
getOrderQuery,
|
|
944
|
+
mutateCreateOrder,
|
|
945
|
+
mutateUpdateOrder,
|
|
946
|
+
mutateDeleteReceipt
|
|
947
|
+
};
|
|
948
|
+
};
|
|
949
|
+
var getProductsQuery = () => queryOptions({
|
|
950
|
+
queryKey: ["products"],
|
|
951
|
+
queryFn: () => productsApi.findAll().then((res) => res.data)
|
|
952
|
+
});
|
|
953
|
+
var useProductsApi = () => {
|
|
954
|
+
return {
|
|
955
|
+
getProductsQuery
|
|
659
956
|
};
|
|
660
957
|
};
|
|
661
958
|
|
|
662
|
-
export { authApi, initApiClient, ordersApi, tanstackClient, useOrdersApi };
|
|
959
|
+
export { authApi, categoriesApi, dishesApi, initApiClient, ordersApi, productsApi, tanstackClient, useAuthApi, useCategoriesApi, useDishesApi, useOrdersApi, useProductsApi };
|
|
663
960
|
//# sourceMappingURL=index.js.map
|
|
664
961
|
//# sourceMappingURL=index.js.map
|