feat: add axios
This commit is contained in:
-327
@@ -1,327 +0,0 @@
|
||||
/**
|
||||
* Generated by orval v6.31.0 🍺
|
||||
* Do not edit manually.
|
||||
* main.proto
|
||||
* OpenAPI spec version: version not set
|
||||
*/
|
||||
import {
|
||||
useMutation,
|
||||
useQuery,
|
||||
} from '@tanstack/vue-query'
|
||||
import type {
|
||||
MutationFunction,
|
||||
QueryFunction,
|
||||
QueryKey,
|
||||
UseMutationOptions,
|
||||
UseMutationReturnType,
|
||||
UseQueryOptions,
|
||||
UseQueryReturnType,
|
||||
} from '@tanstack/vue-query'
|
||||
import axios from 'axios'
|
||||
import type {
|
||||
AxiosError,
|
||||
AxiosRequestConfig,
|
||||
AxiosResponse,
|
||||
} from 'axios'
|
||||
import {
|
||||
computed,
|
||||
unref,
|
||||
} from 'vue'
|
||||
import type {
|
||||
MaybeRef,
|
||||
} from 'vue'
|
||||
import type {
|
||||
ApiHttpBody,
|
||||
CRMSearchParams,
|
||||
CrabscrmOrder,
|
||||
CrmBreadcrumbsRsp,
|
||||
CrmCartRsp,
|
||||
CrmCatalogRsp,
|
||||
CrmOrderItem,
|
||||
CrmOrderRsp,
|
||||
CrmPositionsRsp,
|
||||
CrmProductRsp,
|
||||
RpcStatus,
|
||||
} from '.././shared/model'
|
||||
|
||||
export function cRMGetCart(crmOrderItem: MaybeRef<CrmOrderItem[]>, options?: AxiosRequestConfig): Promise<AxiosResponse<CrmCartRsp>> {
|
||||
crmOrderItem = unref(crmOrderItem)
|
||||
return axios.post(
|
||||
`/cart`,
|
||||
crmOrderItem,
|
||||
options,
|
||||
)
|
||||
}
|
||||
|
||||
export function getCRMGetCartMutationOptions<TError = AxiosError<RpcStatus>, TContext = unknown>(options?: { mutation?: UseMutationOptions<Awaited<ReturnType<typeof cRMGetCart>>, TError, { data: CrmOrderItem[] }, TContext>, axios?: AxiosRequestConfig }): UseMutationOptions<Awaited<ReturnType<typeof cRMGetCart>>, TError, { data: CrmOrderItem[] }, TContext> {
|
||||
const { mutation: mutationOptions, axios: axiosOptions } = options ?? {}
|
||||
|
||||
const mutationFn: MutationFunction<Awaited<ReturnType<typeof cRMGetCart>>, { data: CrmOrderItem[] }> = (props) => {
|
||||
const { data } = props ?? {}
|
||||
|
||||
return cRMGetCart(data, axiosOptions)
|
||||
}
|
||||
|
||||
return { mutationFn, ...mutationOptions }
|
||||
}
|
||||
|
||||
export type CRMGetCartMutationResult = NonNullable<Awaited<ReturnType<typeof cRMGetCart>>>
|
||||
export type CRMGetCartMutationBody = CrmOrderItem[]
|
||||
export type CRMGetCartMutationError = AxiosError<RpcStatus>
|
||||
|
||||
export function useCRMGetCart<TError = AxiosError<RpcStatus>, TContext = unknown>(options?: { mutation?: UseMutationOptions<Awaited<ReturnType<typeof cRMGetCart>>, TError, { data: CrmOrderItem[] }, TContext>, axios?: AxiosRequestConfig }): UseMutationReturnType<
|
||||
Awaited<ReturnType<typeof cRMGetCart>>,
|
||||
TError,
|
||||
{ data: CrmOrderItem[] },
|
||||
TContext
|
||||
> {
|
||||
const mutationOptions = getCRMGetCartMutationOptions(options)
|
||||
|
||||
return useMutation(mutationOptions)
|
||||
}
|
||||
export function cRMGetCatalog(options?: AxiosRequestConfig): Promise<AxiosResponse<CrmCatalogRsp>> {
|
||||
return axios.get(
|
||||
`/catalog`,
|
||||
options,
|
||||
)
|
||||
}
|
||||
|
||||
export function getCRMGetCatalogQueryKey() {
|
||||
return ['catalog'] as const
|
||||
}
|
||||
|
||||
export function getCRMGetCatalogQueryOptions<TData = Awaited<ReturnType<typeof cRMGetCatalog>>, TError = AxiosError<RpcStatus>>(options?: { query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof cRMGetCatalog>>, TError, TData>>, axios?: AxiosRequestConfig }) {
|
||||
const { query: queryOptions, axios: axiosOptions } = options ?? {}
|
||||
|
||||
const queryKey = getCRMGetCatalogQueryKey()
|
||||
|
||||
const queryFn: QueryFunction<Awaited<ReturnType<typeof cRMGetCatalog>>> = ({ signal }) => cRMGetCatalog({ signal, ...axiosOptions })
|
||||
|
||||
return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<Awaited<ReturnType<typeof cRMGetCatalog>>, TError, TData>
|
||||
}
|
||||
|
||||
export type CRMGetCatalogQueryResult = NonNullable<Awaited<ReturnType<typeof cRMGetCatalog>>>
|
||||
export type CRMGetCatalogQueryError = AxiosError<RpcStatus>
|
||||
|
||||
export function useCRMGetCatalog<TData = Awaited<ReturnType<typeof cRMGetCatalog>>, TError = AxiosError<RpcStatus>>(options?: { query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof cRMGetCatalog>>, TError, TData>>, axios?: AxiosRequestConfig }): UseQueryReturnType<TData, TError> & { queryKey: QueryKey } {
|
||||
const queryOptions = getCRMGetCatalogQueryOptions(options)
|
||||
|
||||
const query = useQuery(queryOptions) as UseQueryReturnType<TData, TError> & { queryKey: QueryKey }
|
||||
|
||||
query.queryKey = unref(queryOptions).queryKey as QueryKey
|
||||
|
||||
return query
|
||||
}
|
||||
|
||||
export function cRMGetImage(name: MaybeRef<string>, options?: AxiosRequestConfig): Promise<AxiosResponse<ApiHttpBody>> {
|
||||
name = unref(name)
|
||||
return axios.get(
|
||||
`/images/${name}`,
|
||||
options,
|
||||
)
|
||||
}
|
||||
|
||||
export function getCRMGetImageQueryKey(name: MaybeRef<string>) {
|
||||
return ['images', name] as const
|
||||
}
|
||||
|
||||
export function getCRMGetImageQueryOptions<TData = Awaited<ReturnType<typeof cRMGetImage>>, TError = AxiosError<RpcStatus>>(name: MaybeRef<string>, options?: { query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof cRMGetImage>>, TError, TData>>, axios?: AxiosRequestConfig }) {
|
||||
const { query: queryOptions, axios: axiosOptions } = options ?? {}
|
||||
|
||||
const queryKey = getCRMGetImageQueryKey(name)
|
||||
|
||||
const queryFn: QueryFunction<Awaited<ReturnType<typeof cRMGetImage>>> = ({ signal }) => cRMGetImage(name, { signal, ...axiosOptions })
|
||||
|
||||
return { queryKey, queryFn, enabled: computed(() => !!(unref(name))), ...queryOptions } as UseQueryOptions<Awaited<ReturnType<typeof cRMGetImage>>, TError, TData>
|
||||
}
|
||||
|
||||
export type CRMGetImageQueryResult = NonNullable<Awaited<ReturnType<typeof cRMGetImage>>>
|
||||
export type CRMGetImageQueryError = AxiosError<RpcStatus>
|
||||
|
||||
export function useCRMGetImage<TData = Awaited<ReturnType<typeof cRMGetImage>>, TError = AxiosError<RpcStatus>>(name: MaybeRef<string>, options?: { query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof cRMGetImage>>, TError, TData>>, axios?: AxiosRequestConfig }): UseQueryReturnType<TData, TError> & { queryKey: QueryKey } {
|
||||
const queryOptions = getCRMGetImageQueryOptions(name, options)
|
||||
|
||||
const query = useQuery(queryOptions) as UseQueryReturnType<TData, TError> & { queryKey: QueryKey }
|
||||
|
||||
query.queryKey = unref(queryOptions).queryKey as QueryKey
|
||||
|
||||
return query
|
||||
}
|
||||
|
||||
export function cRMOrder(crabscrmOrder: MaybeRef<CrabscrmOrder>, options?: AxiosRequestConfig): Promise<AxiosResponse<CrmOrderRsp>> {
|
||||
crabscrmOrder = unref(crabscrmOrder)
|
||||
return axios.post(
|
||||
`/orders`,
|
||||
crabscrmOrder,
|
||||
options,
|
||||
)
|
||||
}
|
||||
|
||||
export function getCRMOrderMutationOptions<TError = AxiosError<RpcStatus>, TContext = unknown>(options?: { mutation?: UseMutationOptions<Awaited<ReturnType<typeof cRMOrder>>, TError, { data: CrabscrmOrder }, TContext>, axios?: AxiosRequestConfig }): UseMutationOptions<Awaited<ReturnType<typeof cRMOrder>>, TError, { data: CrabscrmOrder }, TContext> {
|
||||
const { mutation: mutationOptions, axios: axiosOptions } = options ?? {}
|
||||
|
||||
const mutationFn: MutationFunction<Awaited<ReturnType<typeof cRMOrder>>, { data: CrabscrmOrder }> = (props) => {
|
||||
const { data } = props ?? {}
|
||||
|
||||
return cRMOrder(data, axiosOptions)
|
||||
}
|
||||
|
||||
return { mutationFn, ...mutationOptions }
|
||||
}
|
||||
|
||||
export type CRMOrderMutationResult = NonNullable<Awaited<ReturnType<typeof cRMOrder>>>
|
||||
export type CRMOrderMutationBody = CrabscrmOrder
|
||||
export type CRMOrderMutationError = AxiosError<RpcStatus>
|
||||
|
||||
export function useCRMOrder<TError = AxiosError<RpcStatus>, TContext = unknown>(options?: { mutation?: UseMutationOptions<Awaited<ReturnType<typeof cRMOrder>>, TError, { data: CrabscrmOrder }, TContext>, axios?: AxiosRequestConfig }): UseMutationReturnType<
|
||||
Awaited<ReturnType<typeof cRMOrder>>,
|
||||
TError,
|
||||
{ data: CrabscrmOrder },
|
||||
TContext
|
||||
> {
|
||||
const mutationOptions = getCRMOrderMutationOptions(options)
|
||||
|
||||
return useMutation(mutationOptions)
|
||||
}
|
||||
export function cRMGetPositions(id: MaybeRef<string>, options?: AxiosRequestConfig): Promise<AxiosResponse<CrmPositionsRsp>> {
|
||||
id = unref(id)
|
||||
return axios.get(
|
||||
`/positions/${id}`,
|
||||
options,
|
||||
)
|
||||
}
|
||||
|
||||
export function getCRMGetPositionsQueryKey(id: MaybeRef<string>) {
|
||||
return ['positions', id] as const
|
||||
}
|
||||
|
||||
export function getCRMGetPositionsQueryOptions<TData = Awaited<ReturnType<typeof cRMGetPositions>>, TError = AxiosError<RpcStatus>>(id: MaybeRef<string>, options?: { query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof cRMGetPositions>>, TError, TData>>, axios?: AxiosRequestConfig }) {
|
||||
const { query: queryOptions, axios: axiosOptions } = options ?? {}
|
||||
|
||||
const queryKey = getCRMGetPositionsQueryKey(id)
|
||||
|
||||
const queryFn: QueryFunction<Awaited<ReturnType<typeof cRMGetPositions>>> = ({ signal }) => cRMGetPositions(id, { signal, ...axiosOptions })
|
||||
|
||||
return { queryKey, queryFn, enabled: computed(() => !!(unref(id))), ...queryOptions } as UseQueryOptions<Awaited<ReturnType<typeof cRMGetPositions>>, TError, TData>
|
||||
}
|
||||
|
||||
export type CRMGetPositionsQueryResult = NonNullable<Awaited<ReturnType<typeof cRMGetPositions>>>
|
||||
export type CRMGetPositionsQueryError = AxiosError<RpcStatus>
|
||||
|
||||
export function useCRMGetPositions<TData = Awaited<ReturnType<typeof cRMGetPositions>>, TError = AxiosError<RpcStatus>>(id: MaybeRef<string>, options?: { query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof cRMGetPositions>>, TError, TData>>, axios?: AxiosRequestConfig }): UseQueryReturnType<TData, TError> & { queryKey: QueryKey } {
|
||||
const queryOptions = getCRMGetPositionsQueryOptions(id, options)
|
||||
|
||||
const query = useQuery(queryOptions) as UseQueryReturnType<TData, TError> & { queryKey: QueryKey }
|
||||
|
||||
query.queryKey = unref(queryOptions).queryKey as QueryKey
|
||||
|
||||
return query
|
||||
}
|
||||
|
||||
export function cRMGetProduct(id: MaybeRef<string>, options?: AxiosRequestConfig): Promise<AxiosResponse<CrmProductRsp>> {
|
||||
id = unref(id)
|
||||
return axios.get(
|
||||
`/products/${id}`,
|
||||
options,
|
||||
)
|
||||
}
|
||||
|
||||
export function getCRMGetProductQueryKey(id: MaybeRef<string>) {
|
||||
return ['products', id] as const
|
||||
}
|
||||
|
||||
export function getCRMGetProductQueryOptions<TData = Awaited<ReturnType<typeof cRMGetProduct>>, TError = AxiosError<RpcStatus>>(id: MaybeRef<string>, options?: { query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof cRMGetProduct>>, TError, TData>>, axios?: AxiosRequestConfig }) {
|
||||
const { query: queryOptions, axios: axiosOptions } = options ?? {}
|
||||
|
||||
const queryKey = getCRMGetProductQueryKey(id)
|
||||
|
||||
const queryFn: QueryFunction<Awaited<ReturnType<typeof cRMGetProduct>>> = ({ signal }) => cRMGetProduct(id, { signal, ...axiosOptions })
|
||||
|
||||
return { queryKey, queryFn, enabled: computed(() => !!(unref(id))), ...queryOptions } as UseQueryOptions<Awaited<ReturnType<typeof cRMGetProduct>>, TError, TData>
|
||||
}
|
||||
|
||||
export type CRMGetProductQueryResult = NonNullable<Awaited<ReturnType<typeof cRMGetProduct>>>
|
||||
export type CRMGetProductQueryError = AxiosError<RpcStatus>
|
||||
|
||||
export function useCRMGetProduct<TData = Awaited<ReturnType<typeof cRMGetProduct>>, TError = AxiosError<RpcStatus>>(id: MaybeRef<string>, options?: { query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof cRMGetProduct>>, TError, TData>>, axios?: AxiosRequestConfig }): UseQueryReturnType<TData, TError> & { queryKey: QueryKey } {
|
||||
const queryOptions = getCRMGetProductQueryOptions(id, options)
|
||||
|
||||
const query = useQuery(queryOptions) as UseQueryReturnType<TData, TError> & { queryKey: QueryKey }
|
||||
|
||||
query.queryKey = unref(queryOptions).queryKey as QueryKey
|
||||
|
||||
return query
|
||||
}
|
||||
|
||||
export function cRMGetBreadcrumbs(id: MaybeRef<string>, options?: AxiosRequestConfig): Promise<AxiosResponse<CrmBreadcrumbsRsp>> {
|
||||
id = unref(id)
|
||||
return axios.get(
|
||||
`/products/${id}/breadcrumbs`,
|
||||
options,
|
||||
)
|
||||
}
|
||||
|
||||
export function getCRMGetBreadcrumbsQueryKey(id: MaybeRef<string>) {
|
||||
return ['products', id, 'breadcrumbs'] as const
|
||||
}
|
||||
|
||||
export function getCRMGetBreadcrumbsQueryOptions<TData = Awaited<ReturnType<typeof cRMGetBreadcrumbs>>, TError = AxiosError<RpcStatus>>(id: MaybeRef<string>, options?: { query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof cRMGetBreadcrumbs>>, TError, TData>>, axios?: AxiosRequestConfig }) {
|
||||
const { query: queryOptions, axios: axiosOptions } = options ?? {}
|
||||
|
||||
const queryKey = getCRMGetBreadcrumbsQueryKey(id)
|
||||
|
||||
const queryFn: QueryFunction<Awaited<ReturnType<typeof cRMGetBreadcrumbs>>> = ({ signal }) => cRMGetBreadcrumbs(id, { signal, ...axiosOptions })
|
||||
|
||||
return { queryKey, queryFn, enabled: computed(() => !!(unref(id))), ...queryOptions } as UseQueryOptions<Awaited<ReturnType<typeof cRMGetBreadcrumbs>>, TError, TData>
|
||||
}
|
||||
|
||||
export type CRMGetBreadcrumbsQueryResult = NonNullable<Awaited<ReturnType<typeof cRMGetBreadcrumbs>>>
|
||||
export type CRMGetBreadcrumbsQueryError = AxiosError<RpcStatus>
|
||||
|
||||
export function useCRMGetBreadcrumbs<TData = Awaited<ReturnType<typeof cRMGetBreadcrumbs>>, TError = AxiosError<RpcStatus>>(id: MaybeRef<string>, options?: { query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof cRMGetBreadcrumbs>>, TError, TData>>, axios?: AxiosRequestConfig }): UseQueryReturnType<TData, TError> & { queryKey: QueryKey } {
|
||||
const queryOptions = getCRMGetBreadcrumbsQueryOptions(id, options)
|
||||
|
||||
const query = useQuery(queryOptions) as UseQueryReturnType<TData, TError> & { queryKey: QueryKey }
|
||||
|
||||
query.queryKey = unref(queryOptions).queryKey as QueryKey
|
||||
|
||||
return query
|
||||
}
|
||||
|
||||
export function cRMSearch(params?: MaybeRef<CRMSearchParams>, options?: AxiosRequestConfig): Promise<AxiosResponse<CrmPositionsRsp>> {
|
||||
params = unref(params)
|
||||
return axios.get(
|
||||
`/search`,
|
||||
{
|
||||
...options,
|
||||
params: { ...unref(params), ...options?.params },
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
export function getCRMSearchQueryKey(params?: MaybeRef<CRMSearchParams>) {
|
||||
return ['search', ...(params ? [params] : [])] as const
|
||||
}
|
||||
|
||||
export function getCRMSearchQueryOptions<TData = Awaited<ReturnType<typeof cRMSearch>>, TError = AxiosError<RpcStatus>>(params?: MaybeRef<CRMSearchParams>, options?: { query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof cRMSearch>>, TError, TData>>, axios?: AxiosRequestConfig }) {
|
||||
const { query: queryOptions, axios: axiosOptions } = options ?? {}
|
||||
|
||||
const queryKey = getCRMSearchQueryKey(params)
|
||||
|
||||
const queryFn: QueryFunction<Awaited<ReturnType<typeof cRMSearch>>> = ({ signal }) => cRMSearch(params, { signal, ...axiosOptions })
|
||||
|
||||
return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<Awaited<ReturnType<typeof cRMSearch>>, TError, TData>
|
||||
}
|
||||
|
||||
export type CRMSearchQueryResult = NonNullable<Awaited<ReturnType<typeof cRMSearch>>>
|
||||
export type CRMSearchQueryError = AxiosError<RpcStatus>
|
||||
|
||||
export function useCRMSearch<TData = Awaited<ReturnType<typeof cRMSearch>>, TError = AxiosError<RpcStatus>>(params?: MaybeRef<CRMSearchParams>, options?: { query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof cRMSearch>>, TError, TData>>, axios?: AxiosRequestConfig }): UseQueryReturnType<TData, TError> & { queryKey: QueryKey } {
|
||||
const queryOptions = getCRMSearchQueryOptions(params, options)
|
||||
|
||||
const query = useQuery(queryOptions) as UseQueryReturnType<TData, TError> & { queryKey: QueryKey }
|
||||
|
||||
query.queryKey = unref(queryOptions).queryKey as QueryKey
|
||||
|
||||
return query
|
||||
}
|
||||
@@ -0,0 +1,458 @@
|
||||
/**
|
||||
* Generated by orval v6.31.0 🍺
|
||||
* Do not edit manually.
|
||||
* main.proto
|
||||
* OpenAPI spec version: version not set
|
||||
*/
|
||||
import {
|
||||
useMutation,
|
||||
useQuery
|
||||
} from '@tanstack/vue-query'
|
||||
import type {
|
||||
MutationFunction,
|
||||
QueryFunction,
|
||||
QueryKey,
|
||||
UseMutationOptions,
|
||||
UseMutationReturnType,
|
||||
UseQueryOptions,
|
||||
UseQueryReturnType
|
||||
} from '@tanstack/vue-query'
|
||||
import axios from 'axios'
|
||||
import type {
|
||||
AxiosError,
|
||||
AxiosRequestConfig,
|
||||
AxiosResponse
|
||||
} from 'axios'
|
||||
import {
|
||||
computed,
|
||||
unref
|
||||
} from 'vue'
|
||||
import type {
|
||||
MaybeRef
|
||||
} from 'vue'
|
||||
import type {
|
||||
ApiHttpBody,
|
||||
CRMSearchParams,
|
||||
CrabscrmOrder,
|
||||
CrmBreadcrumbsRsp,
|
||||
CrmCartRsp,
|
||||
CrmCatalogRsp,
|
||||
CrmOrderItem,
|
||||
CrmOrderRsp,
|
||||
CrmPositionsRsp,
|
||||
CrmProductRsp,
|
||||
RpcStatus
|
||||
} from '../../model'
|
||||
|
||||
|
||||
|
||||
export const cRMGetCart = (
|
||||
crmOrderItem: MaybeRef<CrmOrderItem[]>, options?: AxiosRequestConfig
|
||||
): Promise<AxiosResponse<CrmCartRsp>> => {
|
||||
crmOrderItem = unref(crmOrderItem);
|
||||
return axios.post(
|
||||
`/cart`,
|
||||
crmOrderItem,options
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
export const getCRMGetCartMutationOptions = <TError = AxiosError<RpcStatus>,
|
||||
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof cRMGetCart>>, TError,{data: CrmOrderItem[]}, TContext>, axios?: AxiosRequestConfig}
|
||||
): UseMutationOptions<Awaited<ReturnType<typeof cRMGetCart>>, TError,{data: CrmOrderItem[]}, TContext> => {
|
||||
const {mutation: mutationOptions, axios: axiosOptions} = options ?? {};
|
||||
|
||||
|
||||
|
||||
|
||||
const mutationFn: MutationFunction<Awaited<ReturnType<typeof cRMGetCart>>, {data: CrmOrderItem[]}> = (props) => {
|
||||
const {data} = props ?? {};
|
||||
|
||||
return cRMGetCart(data,axiosOptions)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return { mutationFn, ...mutationOptions }}
|
||||
|
||||
export type CRMGetCartMutationResult = NonNullable<Awaited<ReturnType<typeof cRMGetCart>>>
|
||||
export type CRMGetCartMutationBody = CrmOrderItem[]
|
||||
export type CRMGetCartMutationError = AxiosError<RpcStatus>
|
||||
|
||||
export const useCRMGetCart = <TError = AxiosError<RpcStatus>,
|
||||
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof cRMGetCart>>, TError,{data: CrmOrderItem[]}, TContext>, axios?: AxiosRequestConfig}
|
||||
): UseMutationReturnType<
|
||||
Awaited<ReturnType<typeof cRMGetCart>>,
|
||||
TError,
|
||||
{data: CrmOrderItem[]},
|
||||
TContext
|
||||
> => {
|
||||
|
||||
const mutationOptions = getCRMGetCartMutationOptions(options);
|
||||
|
||||
return useMutation(mutationOptions);
|
||||
}
|
||||
export const cRMGetCatalog = (
|
||||
options?: AxiosRequestConfig
|
||||
): Promise<AxiosResponse<CrmCatalogRsp>> => {
|
||||
|
||||
return axios.get(
|
||||
`/catalog`,options
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
export const getCRMGetCatalogQueryKey = () => {
|
||||
return ['catalog'] as const;
|
||||
}
|
||||
|
||||
|
||||
export const getCRMGetCatalogQueryOptions = <TData = Awaited<ReturnType<typeof cRMGetCatalog>>, TError = AxiosError<RpcStatus>>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof cRMGetCatalog>>, TError, TData>>, axios?: AxiosRequestConfig}
|
||||
) => {
|
||||
|
||||
const {query: queryOptions, axios: axiosOptions} = options ?? {};
|
||||
|
||||
const queryKey = getCRMGetCatalogQueryKey();
|
||||
|
||||
|
||||
|
||||
const queryFn: QueryFunction<Awaited<ReturnType<typeof cRMGetCatalog>>> = ({ signal }) => cRMGetCatalog({ signal, ...axiosOptions });
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof cRMGetCatalog>>, TError, TData>
|
||||
}
|
||||
|
||||
export type CRMGetCatalogQueryResult = NonNullable<Awaited<ReturnType<typeof cRMGetCatalog>>>
|
||||
export type CRMGetCatalogQueryError = AxiosError<RpcStatus>
|
||||
|
||||
export const useCRMGetCatalog = <TData = Awaited<ReturnType<typeof cRMGetCatalog>>, TError = AxiosError<RpcStatus>>(
|
||||
options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof cRMGetCatalog>>, TError, TData>>, axios?: AxiosRequestConfig}
|
||||
|
||||
): UseQueryReturnType<TData, TError> & { queryKey: QueryKey } => {
|
||||
|
||||
const queryOptions = getCRMGetCatalogQueryOptions(options)
|
||||
|
||||
const query = useQuery(queryOptions) as UseQueryReturnType<TData, TError> & { queryKey: QueryKey };
|
||||
|
||||
query.queryKey = unref(queryOptions).queryKey as QueryKey;
|
||||
|
||||
return query;
|
||||
}
|
||||
|
||||
|
||||
|
||||
export const cRMGetImage = (
|
||||
name: MaybeRef<string>, options?: AxiosRequestConfig
|
||||
): Promise<AxiosResponse<ApiHttpBody>> => {
|
||||
name = unref(name);
|
||||
return axios.get(
|
||||
`/images/${name}`,options
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
export const getCRMGetImageQueryKey = (name: MaybeRef<string>,) => {
|
||||
return ['images',name] as const;
|
||||
}
|
||||
|
||||
|
||||
export const getCRMGetImageQueryOptions = <TData = Awaited<ReturnType<typeof cRMGetImage>>, TError = AxiosError<RpcStatus>>(name: MaybeRef<string>, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof cRMGetImage>>, TError, TData>>, axios?: AxiosRequestConfig}
|
||||
) => {
|
||||
|
||||
const {query: queryOptions, axios: axiosOptions} = options ?? {};
|
||||
|
||||
const queryKey = getCRMGetImageQueryKey(name);
|
||||
|
||||
|
||||
|
||||
const queryFn: QueryFunction<Awaited<ReturnType<typeof cRMGetImage>>> = ({ signal }) => cRMGetImage(name, { signal, ...axiosOptions });
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return { queryKey, queryFn, enabled: computed(() => !!(unref(name))), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof cRMGetImage>>, TError, TData>
|
||||
}
|
||||
|
||||
export type CRMGetImageQueryResult = NonNullable<Awaited<ReturnType<typeof cRMGetImage>>>
|
||||
export type CRMGetImageQueryError = AxiosError<RpcStatus>
|
||||
|
||||
export const useCRMGetImage = <TData = Awaited<ReturnType<typeof cRMGetImage>>, TError = AxiosError<RpcStatus>>(
|
||||
name: MaybeRef<string>, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof cRMGetImage>>, TError, TData>>, axios?: AxiosRequestConfig}
|
||||
|
||||
): UseQueryReturnType<TData, TError> & { queryKey: QueryKey } => {
|
||||
|
||||
const queryOptions = getCRMGetImageQueryOptions(name,options)
|
||||
|
||||
const query = useQuery(queryOptions) as UseQueryReturnType<TData, TError> & { queryKey: QueryKey };
|
||||
|
||||
query.queryKey = unref(queryOptions).queryKey as QueryKey;
|
||||
|
||||
return query;
|
||||
}
|
||||
|
||||
|
||||
|
||||
export const cRMOrder = (
|
||||
crabscrmOrder: MaybeRef<CrabscrmOrder>, options?: AxiosRequestConfig
|
||||
): Promise<AxiosResponse<CrmOrderRsp>> => {
|
||||
crabscrmOrder = unref(crabscrmOrder);
|
||||
return axios.post(
|
||||
`/orders`,
|
||||
crabscrmOrder,options
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
export const getCRMOrderMutationOptions = <TError = AxiosError<RpcStatus>,
|
||||
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof cRMOrder>>, TError,{data: CrabscrmOrder}, TContext>, axios?: AxiosRequestConfig}
|
||||
): UseMutationOptions<Awaited<ReturnType<typeof cRMOrder>>, TError,{data: CrabscrmOrder}, TContext> => {
|
||||
const {mutation: mutationOptions, axios: axiosOptions} = options ?? {};
|
||||
|
||||
|
||||
|
||||
|
||||
const mutationFn: MutationFunction<Awaited<ReturnType<typeof cRMOrder>>, {data: CrabscrmOrder}> = (props) => {
|
||||
const {data} = props ?? {};
|
||||
|
||||
return cRMOrder(data,axiosOptions)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return { mutationFn, ...mutationOptions }}
|
||||
|
||||
export type CRMOrderMutationResult = NonNullable<Awaited<ReturnType<typeof cRMOrder>>>
|
||||
export type CRMOrderMutationBody = CrabscrmOrder
|
||||
export type CRMOrderMutationError = AxiosError<RpcStatus>
|
||||
|
||||
export const useCRMOrder = <TError = AxiosError<RpcStatus>,
|
||||
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof cRMOrder>>, TError,{data: CrabscrmOrder}, TContext>, axios?: AxiosRequestConfig}
|
||||
): UseMutationReturnType<
|
||||
Awaited<ReturnType<typeof cRMOrder>>,
|
||||
TError,
|
||||
{data: CrabscrmOrder},
|
||||
TContext
|
||||
> => {
|
||||
|
||||
const mutationOptions = getCRMOrderMutationOptions(options);
|
||||
|
||||
return useMutation(mutationOptions);
|
||||
}
|
||||
export const cRMGetPositions = (
|
||||
id: MaybeRef<string>, options?: AxiosRequestConfig
|
||||
): Promise<AxiosResponse<CrmPositionsRsp>> => {
|
||||
id = unref(id);
|
||||
return axios.get(
|
||||
`/positions/${id}`,options
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
export const getCRMGetPositionsQueryKey = (id: MaybeRef<string>,) => {
|
||||
return ['positions',id] as const;
|
||||
}
|
||||
|
||||
|
||||
export const getCRMGetPositionsQueryOptions = <TData = Awaited<ReturnType<typeof cRMGetPositions>>, TError = AxiosError<RpcStatus>>(id: MaybeRef<string>, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof cRMGetPositions>>, TError, TData>>, axios?: AxiosRequestConfig}
|
||||
) => {
|
||||
|
||||
const {query: queryOptions, axios: axiosOptions} = options ?? {};
|
||||
|
||||
const queryKey = getCRMGetPositionsQueryKey(id);
|
||||
|
||||
|
||||
|
||||
const queryFn: QueryFunction<Awaited<ReturnType<typeof cRMGetPositions>>> = ({ signal }) => cRMGetPositions(id, { signal, ...axiosOptions });
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return { queryKey, queryFn, enabled: computed(() => !!(unref(id))), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof cRMGetPositions>>, TError, TData>
|
||||
}
|
||||
|
||||
export type CRMGetPositionsQueryResult = NonNullable<Awaited<ReturnType<typeof cRMGetPositions>>>
|
||||
export type CRMGetPositionsQueryError = AxiosError<RpcStatus>
|
||||
|
||||
export const useCRMGetPositions = <TData = Awaited<ReturnType<typeof cRMGetPositions>>, TError = AxiosError<RpcStatus>>(
|
||||
id: MaybeRef<string>, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof cRMGetPositions>>, TError, TData>>, axios?: AxiosRequestConfig}
|
||||
|
||||
): UseQueryReturnType<TData, TError> & { queryKey: QueryKey } => {
|
||||
|
||||
const queryOptions = getCRMGetPositionsQueryOptions(id,options)
|
||||
|
||||
const query = useQuery(queryOptions) as UseQueryReturnType<TData, TError> & { queryKey: QueryKey };
|
||||
|
||||
query.queryKey = unref(queryOptions).queryKey as QueryKey;
|
||||
|
||||
return query;
|
||||
}
|
||||
|
||||
|
||||
|
||||
export const cRMGetProduct = (
|
||||
id: MaybeRef<string>, options?: AxiosRequestConfig
|
||||
): Promise<AxiosResponse<CrmProductRsp>> => {
|
||||
id = unref(id);
|
||||
return axios.get(
|
||||
`/products/${id}`,options
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
export const getCRMGetProductQueryKey = (id: MaybeRef<string>,) => {
|
||||
return ['products',id] as const;
|
||||
}
|
||||
|
||||
|
||||
export const getCRMGetProductQueryOptions = <TData = Awaited<ReturnType<typeof cRMGetProduct>>, TError = AxiosError<RpcStatus>>(id: MaybeRef<string>, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof cRMGetProduct>>, TError, TData>>, axios?: AxiosRequestConfig}
|
||||
) => {
|
||||
|
||||
const {query: queryOptions, axios: axiosOptions} = options ?? {};
|
||||
|
||||
const queryKey = getCRMGetProductQueryKey(id);
|
||||
|
||||
|
||||
|
||||
const queryFn: QueryFunction<Awaited<ReturnType<typeof cRMGetProduct>>> = ({ signal }) => cRMGetProduct(id, { signal, ...axiosOptions });
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return { queryKey, queryFn, enabled: computed(() => !!(unref(id))), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof cRMGetProduct>>, TError, TData>
|
||||
}
|
||||
|
||||
export type CRMGetProductQueryResult = NonNullable<Awaited<ReturnType<typeof cRMGetProduct>>>
|
||||
export type CRMGetProductQueryError = AxiosError<RpcStatus>
|
||||
|
||||
export const useCRMGetProduct = <TData = Awaited<ReturnType<typeof cRMGetProduct>>, TError = AxiosError<RpcStatus>>(
|
||||
id: MaybeRef<string>, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof cRMGetProduct>>, TError, TData>>, axios?: AxiosRequestConfig}
|
||||
|
||||
): UseQueryReturnType<TData, TError> & { queryKey: QueryKey } => {
|
||||
|
||||
const queryOptions = getCRMGetProductQueryOptions(id,options)
|
||||
|
||||
const query = useQuery(queryOptions) as UseQueryReturnType<TData, TError> & { queryKey: QueryKey };
|
||||
|
||||
query.queryKey = unref(queryOptions).queryKey as QueryKey;
|
||||
|
||||
return query;
|
||||
}
|
||||
|
||||
|
||||
|
||||
export const cRMGetBreadcrumbs = (
|
||||
id: MaybeRef<string>, options?: AxiosRequestConfig
|
||||
): Promise<AxiosResponse<CrmBreadcrumbsRsp>> => {
|
||||
id = unref(id);
|
||||
return axios.get(
|
||||
`/products/${id}/breadcrumbs`,options
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
export const getCRMGetBreadcrumbsQueryKey = (id: MaybeRef<string>,) => {
|
||||
return ['products',id,'breadcrumbs'] as const;
|
||||
}
|
||||
|
||||
|
||||
export const getCRMGetBreadcrumbsQueryOptions = <TData = Awaited<ReturnType<typeof cRMGetBreadcrumbs>>, TError = AxiosError<RpcStatus>>(id: MaybeRef<string>, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof cRMGetBreadcrumbs>>, TError, TData>>, axios?: AxiosRequestConfig}
|
||||
) => {
|
||||
|
||||
const {query: queryOptions, axios: axiosOptions} = options ?? {};
|
||||
|
||||
const queryKey = getCRMGetBreadcrumbsQueryKey(id);
|
||||
|
||||
|
||||
|
||||
const queryFn: QueryFunction<Awaited<ReturnType<typeof cRMGetBreadcrumbs>>> = ({ signal }) => cRMGetBreadcrumbs(id, { signal, ...axiosOptions });
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return { queryKey, queryFn, enabled: computed(() => !!(unref(id))), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof cRMGetBreadcrumbs>>, TError, TData>
|
||||
}
|
||||
|
||||
export type CRMGetBreadcrumbsQueryResult = NonNullable<Awaited<ReturnType<typeof cRMGetBreadcrumbs>>>
|
||||
export type CRMGetBreadcrumbsQueryError = AxiosError<RpcStatus>
|
||||
|
||||
export const useCRMGetBreadcrumbs = <TData = Awaited<ReturnType<typeof cRMGetBreadcrumbs>>, TError = AxiosError<RpcStatus>>(
|
||||
id: MaybeRef<string>, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof cRMGetBreadcrumbs>>, TError, TData>>, axios?: AxiosRequestConfig}
|
||||
|
||||
): UseQueryReturnType<TData, TError> & { queryKey: QueryKey } => {
|
||||
|
||||
const queryOptions = getCRMGetBreadcrumbsQueryOptions(id,options)
|
||||
|
||||
const query = useQuery(queryOptions) as UseQueryReturnType<TData, TError> & { queryKey: QueryKey };
|
||||
|
||||
query.queryKey = unref(queryOptions).queryKey as QueryKey;
|
||||
|
||||
return query;
|
||||
}
|
||||
|
||||
|
||||
|
||||
export const cRMSearch = (
|
||||
params?: MaybeRef<CRMSearchParams>, options?: AxiosRequestConfig
|
||||
): Promise<AxiosResponse<CrmPositionsRsp>> => {
|
||||
params = unref(params);
|
||||
return axios.get(
|
||||
`/search`,{
|
||||
...options,
|
||||
params: {...unref(params), ...options?.params},}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
export const getCRMSearchQueryKey = (params?: MaybeRef<CRMSearchParams>,) => {
|
||||
return ['search', ...(params ? [params]: [])] as const;
|
||||
}
|
||||
|
||||
|
||||
export const getCRMSearchQueryOptions = <TData = Awaited<ReturnType<typeof cRMSearch>>, TError = AxiosError<RpcStatus>>(params?: MaybeRef<CRMSearchParams>, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof cRMSearch>>, TError, TData>>, axios?: AxiosRequestConfig}
|
||||
) => {
|
||||
|
||||
const {query: queryOptions, axios: axiosOptions} = options ?? {};
|
||||
|
||||
const queryKey = getCRMSearchQueryKey(params);
|
||||
|
||||
|
||||
|
||||
const queryFn: QueryFunction<Awaited<ReturnType<typeof cRMSearch>>> = ({ signal }) => cRMSearch(params, { signal, ...axiosOptions });
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof cRMSearch>>, TError, TData>
|
||||
}
|
||||
|
||||
export type CRMSearchQueryResult = NonNullable<Awaited<ReturnType<typeof cRMSearch>>>
|
||||
export type CRMSearchQueryError = AxiosError<RpcStatus>
|
||||
|
||||
export const useCRMSearch = <TData = Awaited<ReturnType<typeof cRMSearch>>, TError = AxiosError<RpcStatus>>(
|
||||
params?: MaybeRef<CRMSearchParams>, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof cRMSearch>>, TError, TData>>, axios?: AxiosRequestConfig}
|
||||
|
||||
): UseQueryReturnType<TData, TError> & { queryKey: QueryKey } => {
|
||||
|
||||
const queryOptions = getCRMSearchQueryOptions(params,options)
|
||||
|
||||
const query = useQuery(queryOptions) as UseQueryReturnType<TData, TError> & { queryKey: QueryKey };
|
||||
|
||||
query.queryKey = unref(queryOptions).queryKey as QueryKey;
|
||||
|
||||
return query;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -4,61 +4,59 @@
|
||||
* main.proto
|
||||
* OpenAPI spec version: version not set
|
||||
*/
|
||||
import type { ProtobufAny } from './protobufAny'
|
||||
import type { ProtobufAny } from './protobufAny';
|
||||
|
||||
/**
|
||||
* Message that represents an arbitrary HTTP body. It should only be used for
|
||||
payload formats that can't be represented as JSON, such as raw binary or
|
||||
an HTML page.
|
||||
|
||||
|
||||
|
||||
|
||||
This message can be used both in streaming and non-streaming API methods in
|
||||
the request as well as the response.
|
||||
|
||||
|
||||
It can be used as a top-level request field, which is convenient if one
|
||||
wants to extract parameters from either the URL or HTTP template into the
|
||||
request fields and also want access to the raw HTTP body.
|
||||
|
||||
|
||||
Example:
|
||||
|
||||
|
||||
message GetResourceRequest {
|
||||
// A unique request id.
|
||||
string request_id = 1;
|
||||
|
||||
|
||||
// The raw HTTP body is bound to this field.
|
||||
google.api.HttpBody http_body = 2;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
service ResourceService {
|
||||
rpc GetResource(GetResourceRequest)
|
||||
returns (google.api.HttpBody);
|
||||
rpc UpdateResource(google.api.HttpBody)
|
||||
returns (google.protobuf.Empty);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
Example with streaming methods:
|
||||
|
||||
|
||||
service CaldavService {
|
||||
rpc GetCalendar(stream google.api.HttpBody)
|
||||
returns (stream google.api.HttpBody);
|
||||
rpc UpdateCalendar(stream google.api.HttpBody)
|
||||
returns (stream google.api.HttpBody);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
Use of this type only changes how the request and response bodies are
|
||||
handled, all other features will continue to work unchanged.
|
||||
*/
|
||||
export interface ApiHttpBody {
|
||||
/** The HTTP Content-Type header value specifying the content type of the body. */
|
||||
contentType?: string
|
||||
contentType?: string;
|
||||
/** The HTTP request/response body as raw binary. */
|
||||
data?: string
|
||||
/**
|
||||
Application specific response metadata. Must be set in the first response
|
||||
for streaming APIs.
|
||||
*/
|
||||
extensions?: ProtobufAny[]
|
||||
data?: string;
|
||||
/** Application specific response metadata. Must be set in the first response
|
||||
for streaming APIs. */
|
||||
extensions?: ProtobufAny[];
|
||||
}
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
* OpenAPI spec version: version not set
|
||||
*/
|
||||
|
||||
export interface CRMSearchParams {
|
||||
text?: string
|
||||
}
|
||||
export type CRMSearchParams = {
|
||||
text?: string;
|
||||
};
|
||||
|
||||
@@ -6,5 +6,5 @@
|
||||
*/
|
||||
|
||||
export interface CrabscrmLabel {
|
||||
name?: string
|
||||
name?: string;
|
||||
}
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
* main.proto
|
||||
* OpenAPI spec version: version not set
|
||||
*/
|
||||
import type { CrmOrderItem } from './crmOrderItem'
|
||||
import type { CrmOrderItem } from './crmOrderItem';
|
||||
|
||||
export interface CrabscrmOrder {
|
||||
items?: CrmOrderItem[]
|
||||
name?: string
|
||||
phone?: string
|
||||
items?: CrmOrderItem[];
|
||||
name?: string;
|
||||
phone?: string;
|
||||
}
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
* main.proto
|
||||
* OpenAPI spec version: version not set
|
||||
*/
|
||||
import type { CrmCategory } from './crmCategory'
|
||||
import type { CrmCategory } from './crmCategory';
|
||||
|
||||
export interface CrmBreadcrumbsRsp {
|
||||
categories?: CrmCategory[]
|
||||
categories?: CrmCategory[];
|
||||
}
|
||||
|
||||
@@ -4,20 +4,20 @@
|
||||
* main.proto
|
||||
* OpenAPI spec version: version not set
|
||||
*/
|
||||
import type { CrabscrmLabel } from './crabscrmLabel'
|
||||
import type { CrmVariant } from './crmVariant'
|
||||
import type { CrabscrmLabel } from './crabscrmLabel';
|
||||
import type { CrmVariant } from './crmVariant';
|
||||
|
||||
export interface CrmCartItem {
|
||||
amount?: string
|
||||
amountOld?: string
|
||||
article?: string
|
||||
count?: string
|
||||
id?: string
|
||||
images?: string[]
|
||||
inventory?: number
|
||||
labels?: CrabscrmLabel[]
|
||||
name?: string
|
||||
unit?: string
|
||||
uri?: string
|
||||
variants?: CrmVariant[]
|
||||
amount?: string;
|
||||
amountOld?: string;
|
||||
article?: string;
|
||||
count?: string;
|
||||
id?: string;
|
||||
images?: string[];
|
||||
inventory?: number;
|
||||
labels?: CrabscrmLabel[];
|
||||
name?: string;
|
||||
unit?: string;
|
||||
uri?: string;
|
||||
variants?: CrmVariant[];
|
||||
}
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
* main.proto
|
||||
* OpenAPI spec version: version not set
|
||||
*/
|
||||
import type { CrmCartItem } from './crmCartItem'
|
||||
import type { CrmCartItem } from './crmCartItem';
|
||||
|
||||
export interface CrmCartRsp {
|
||||
amount?: string
|
||||
amountOld?: string
|
||||
items?: CrmCartItem[]
|
||||
amount?: string;
|
||||
amountOld?: string;
|
||||
items?: CrmCartItem[];
|
||||
}
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
* main.proto
|
||||
* OpenAPI spec version: version not set
|
||||
*/
|
||||
import type { CrmCategory } from './crmCategory'
|
||||
import type { CrmCategory } from './crmCategory';
|
||||
|
||||
export interface CrmCatalogRsp {
|
||||
categories?: CrmCategory[]
|
||||
categories?: CrmCategory[];
|
||||
}
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
*/
|
||||
|
||||
export interface CrmCategory {
|
||||
children?: CrmCategory[]
|
||||
id?: string
|
||||
name?: string
|
||||
uri?: string
|
||||
children?: CrmCategory[];
|
||||
id?: string;
|
||||
name?: string;
|
||||
uri?: string;
|
||||
}
|
||||
|
||||
@@ -6,6 +6,6 @@
|
||||
*/
|
||||
|
||||
export interface CrmCharacteristic {
|
||||
name?: string
|
||||
value?: string
|
||||
name?: string;
|
||||
value?: string;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
export interface CrmGroupedProduct {
|
||||
image?: string
|
||||
name?: string
|
||||
uri?: string
|
||||
image?: string;
|
||||
name?: string;
|
||||
uri?: string;
|
||||
}
|
||||
|
||||
@@ -6,6 +6,6 @@
|
||||
*/
|
||||
|
||||
export interface CrmOrderItem {
|
||||
count?: string
|
||||
productId?: string
|
||||
count?: string;
|
||||
productId?: string;
|
||||
}
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
* main.proto
|
||||
* OpenAPI spec version: version not set
|
||||
*/
|
||||
import type { CrmProduct } from './crmProduct'
|
||||
import type { CrmProduct } from './crmProduct';
|
||||
|
||||
export interface CrmPositionsRsp {
|
||||
products?: CrmProduct[]
|
||||
products?: CrmProduct[];
|
||||
}
|
||||
|
||||
@@ -4,23 +4,23 @@
|
||||
* main.proto
|
||||
* OpenAPI spec version: version not set
|
||||
*/
|
||||
import type { CrmCharacteristic } from './crmCharacteristic'
|
||||
import type { CrmGroupedProduct } from './crmGroupedProduct'
|
||||
import type { CrabscrmLabel } from './crabscrmLabel'
|
||||
import type { CrmVariant } from './crmVariant'
|
||||
import type { CrmCharacteristic } from './crmCharacteristic';
|
||||
import type { CrmGroupedProduct } from './crmGroupedProduct';
|
||||
import type { CrabscrmLabel } from './crabscrmLabel';
|
||||
import type { CrmVariant } from './crmVariant';
|
||||
|
||||
export interface CrmProduct {
|
||||
article?: string
|
||||
category?: string
|
||||
characteristics?: CrmCharacteristic[]
|
||||
description?: string
|
||||
groupedProducts?: CrmGroupedProduct[]
|
||||
id?: string
|
||||
images?: string[]
|
||||
inventory?: number
|
||||
labels?: CrabscrmLabel[]
|
||||
name?: string
|
||||
unit?: string
|
||||
uri?: string
|
||||
variants?: CrmVariant[]
|
||||
article?: string;
|
||||
category?: string;
|
||||
characteristics?: CrmCharacteristic[];
|
||||
description?: string;
|
||||
groupedProducts?: CrmGroupedProduct[];
|
||||
id?: string;
|
||||
images?: string[];
|
||||
inventory?: number;
|
||||
labels?: CrabscrmLabel[];
|
||||
name?: string;
|
||||
unit?: string;
|
||||
uri?: string;
|
||||
variants?: CrmVariant[];
|
||||
}
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
* main.proto
|
||||
* OpenAPI spec version: version not set
|
||||
*/
|
||||
import type { CrmProduct } from './crmProduct'
|
||||
import type { CrmProduct } from './crmProduct';
|
||||
|
||||
export interface CrmProductRsp {
|
||||
product?: CrmProduct
|
||||
product?: CrmProduct;
|
||||
}
|
||||
|
||||
@@ -6,6 +6,6 @@
|
||||
*/
|
||||
|
||||
export interface CrmProperty {
|
||||
name?: string
|
||||
value?: string
|
||||
name?: string;
|
||||
value?: string;
|
||||
}
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
* main.proto
|
||||
* OpenAPI spec version: version not set
|
||||
*/
|
||||
import type { CrmProperty } from './crmProperty'
|
||||
import type { CrmProperty } from './crmProperty';
|
||||
|
||||
export interface CrmVariant {
|
||||
active?: boolean
|
||||
price?: string
|
||||
properties?: CrmProperty[]
|
||||
active?: boolean;
|
||||
price?: string;
|
||||
properties?: CrmProperty[];
|
||||
}
|
||||
|
||||
+20
-20
@@ -5,23 +5,23 @@
|
||||
* OpenAPI spec version: version not set
|
||||
*/
|
||||
|
||||
export * from './apiHttpBody'
|
||||
export * from './cRMSearchParams'
|
||||
export * from './crabscrmLabel'
|
||||
export * from './crabscrmOrder'
|
||||
export * from './crmBreadcrumbsRsp'
|
||||
export * from './crmCartItem'
|
||||
export * from './crmCartRsp'
|
||||
export * from './crmCatalogRsp'
|
||||
export * from './crmCategory'
|
||||
export * from './crmCharacteristic'
|
||||
export * from './crmGroupedProduct'
|
||||
export * from './crmOrderItem'
|
||||
export * from './crmOrderRsp'
|
||||
export * from './crmPositionsRsp'
|
||||
export * from './crmProduct'
|
||||
export * from './crmProductRsp'
|
||||
export * from './crmProperty'
|
||||
export * from './crmVariant'
|
||||
export * from './protobufAny'
|
||||
export * from './rpcStatus'
|
||||
export * from './apiHttpBody';
|
||||
export * from './cRMSearchParams';
|
||||
export * from './crabscrmLabel';
|
||||
export * from './crabscrmOrder';
|
||||
export * from './crmBreadcrumbsRsp';
|
||||
export * from './crmCartItem';
|
||||
export * from './crmCartRsp';
|
||||
export * from './crmCatalogRsp';
|
||||
export * from './crmCategory';
|
||||
export * from './crmCharacteristic';
|
||||
export * from './crmGroupedProduct';
|
||||
export * from './crmOrderItem';
|
||||
export * from './crmOrderRsp';
|
||||
export * from './crmPositionsRsp';
|
||||
export * from './crmProduct';
|
||||
export * from './crmProductRsp';
|
||||
export * from './crmProperty';
|
||||
export * from './crmVariant';
|
||||
export * from './protobufAny';
|
||||
export * from './rpcStatus';
|
||||
@@ -93,8 +93,7 @@ field. Example (for message [google.protobuf.Duration][]):
|
||||
}
|
||||
*/
|
||||
export interface ProtobufAny {
|
||||
/**
|
||||
A URL/resource name that uniquely identifies the type of the serialized
|
||||
/** A URL/resource name that uniquely identifies the type of the serialized
|
||||
protocol buffer message. This string must contain at least
|
||||
one "/" character. The last segment of the URL's path must represent
|
||||
the fully qualified name of the type (as in
|
||||
@@ -106,10 +105,10 @@ expect it to use in the context of Any. However, for URLs which use the
|
||||
scheme `http`, `https`, or no scheme, one can optionally set up a type
|
||||
server that maps type URLs to message definitions as follows:
|
||||
|
||||
* If no scheme is provided, `https` is assumed.
|
||||
* An HTTP GET on the URL must yield a [google.protobuf.Type][]
|
||||
* If no scheme is provided, `https` is assumed.
|
||||
* An HTTP GET on the URL must yield a [google.protobuf.Type][]
|
||||
value in binary format, or produce an error.
|
||||
* Applications are allowed to cache lookup results based on the
|
||||
* Applications are allowed to cache lookup results based on the
|
||||
URL, or have them precompiled into a binary to avoid any
|
||||
lookup. Therefore, binary compatibility needs to be preserved
|
||||
on changes to types. (Use versioned type names to manage
|
||||
@@ -121,8 +120,7 @@ type.googleapis.com. As of May 2023, there are no widely used type server
|
||||
implementations and no plans to implement one.
|
||||
|
||||
Schemes other than `http`, `https` (or the empty scheme) might be
|
||||
used with implementation specific semantics.
|
||||
*/
|
||||
'@type'?: string
|
||||
[key: string]: unknown
|
||||
used with implementation specific semantics. */
|
||||
'@type'?: string;
|
||||
[key: string]: unknown;
|
||||
}
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
* main.proto
|
||||
* OpenAPI spec version: version not set
|
||||
*/
|
||||
import type { ProtobufAny } from './protobufAny'
|
||||
import type { ProtobufAny } from './protobufAny';
|
||||
|
||||
export interface RpcStatus {
|
||||
code?: number
|
||||
details?: ProtobufAny[]
|
||||
message?: string
|
||||
code?: number;
|
||||
details?: ProtobufAny[];
|
||||
message?: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user