diff --git a/orval.config.ts b/orval.config.ts index 1d7d2d5..6b3443d 100644 --- a/orval.config.ts +++ b/orval.config.ts @@ -4,7 +4,7 @@ export default defineConfig({ cakes: { output: { mode: 'tags-split', - target: 'src/cakes.ts', + target: 'src/shared/api', schemas: 'src/shared/model', client: 'vue-query', // mock: true, diff --git a/package.json b/package.json index 92e0aed..0bf05e6 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,8 @@ "postinstall": "nuxt prepare" }, "dependencies": { - "@tanstack/vue-query": "^5.51.15" + "@tanstack/vue-query": "^5.51.15", + "axios": "^1.7.2" }, "devDependencies": { "@antfu/eslint-config": "^2.24.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 17f7c83..88857d0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,6 +8,9 @@ dependencies: '@tanstack/vue-query': specifier: ^5.51.15 version: 5.51.15(vue@3.4.34) + axios: + specifier: ^1.7.2 + version: 1.7.2 devDependencies: '@antfu/eslint-config': @@ -21,7 +24,7 @@ devDependencies: version: 0.4.0(eslint@9.5.0)(typescript@5.5.4)(vite@5.3.5) '@nuxt/ui': specifier: ^2.17.0 - version: 2.18.2(vite@5.3.5)(vue@3.4.34) + version: 2.18.2(axios@1.7.2)(vite@5.3.5)(vue@3.4.34) '@unocss/eslint-plugin': specifier: ^0.61.6 version: 0.61.7(eslint@9.5.0)(typescript@5.5.4) @@ -2123,7 +2126,7 @@ packages: - supports-color dev: true - /@nuxt/ui@2.18.2(vite@5.3.5)(vue@3.4.34): + /@nuxt/ui@2.18.2(axios@1.7.2)(vite@5.3.5)(vue@3.4.34): resolution: {integrity: sha512-azij3fV1FkEMG+sgTMEQiXkJMnII3HNQE+3r8g9QhUgO7iZ13TlUkXl0iYd+U/cGa4aZYki6WXJ45WyETtV/IA==} engines: {node: '>=v16.20.2'} dependencies: @@ -2140,7 +2143,7 @@ packages: '@tailwindcss/forms': 0.5.7(tailwindcss@3.4.7) '@tailwindcss/typography': 0.5.13(tailwindcss@3.4.7) '@vueuse/core': 10.11.0(vue@3.4.34) - '@vueuse/integrations': 10.11.0(fuse.js@6.6.2)(vue@3.4.34) + '@vueuse/integrations': 10.11.0(axios@1.7.2)(fuse.js@6.6.2)(vue@3.4.34) '@vueuse/math': 10.11.0(vue@3.4.34) defu: 6.1.4 fuse.js: 6.6.2 @@ -4239,7 +4242,7 @@ packages: - vue dev: true - /@vueuse/integrations@10.11.0(fuse.js@6.6.2)(vue@3.4.34): + /@vueuse/integrations@10.11.0(axios@1.7.2)(fuse.js@6.6.2)(vue@3.4.34): resolution: {integrity: sha512-Pp6MtWEIr+NDOccWd8j59Kpjy5YDXogXI61Kb1JxvSfVBO8NzFQkmrKmSZz47i+ZqHnIzxaT38L358yDHTncZg==} peerDependencies: async-validator: ^4 @@ -4282,6 +4285,7 @@ packages: dependencies: '@vueuse/core': 10.11.0(vue@3.4.34) '@vueuse/shared': 10.11.0(vue@3.4.34) + axios: 1.7.2 fuse.js: 6.6.2 vue-demi: 0.14.10(vue@3.4.34) transitivePeerDependencies: @@ -4713,6 +4717,9 @@ packages: resolution: {integrity: sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg==} dev: true + /asynckit@0.4.0: + resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} + /at-least-node@1.0.0: resolution: {integrity: sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==} engines: {node: '>= 4.0.0'} @@ -4741,6 +4748,15 @@ packages: possible-typed-array-names: 1.0.0 dev: true + /axios@1.7.2: + resolution: {integrity: sha512-2A8QhOMrbomlDuiLeK9XibIBzuHeRcqqNOHp0Cyp5EoJ1IFDh+XZH3A6BkXtv0K4gFGCI0Y4BM7B1wOEi0Rmgw==} + dependencies: + follow-redirects: 1.15.6 + form-data: 4.0.0 + proxy-from-env: 1.1.0 + transitivePeerDependencies: + - debug + /b4a@1.6.6: resolution: {integrity: sha512-5Tk1HLk6b6ctmjIkAcU/Ujv/1WqiDl0F0JdRCR80VsOcUlHcu7pWeWRlOqQLHfDEsVx9YH/aif5AG4ehoCtTmg==} dev: true @@ -5079,6 +5095,12 @@ packages: resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} dev: true + /combined-stream@1.0.8: + resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} + engines: {node: '>= 0.8'} + dependencies: + delayed-stream: 1.0.0 + /commander@2.20.3: resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} dev: true @@ -5496,6 +5518,10 @@ packages: resolution: {integrity: sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg==} dev: true + /delayed-stream@1.0.0: + resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} + engines: {node: '>=0.4.0'} + /delegates@1.0.0: resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} dev: true @@ -6609,6 +6635,15 @@ packages: resolution: {integrity: sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==} dev: true + /follow-redirects@1.15.6: + resolution: {integrity: sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==} + engines: {node: '>=4.0'} + peerDependencies: + debug: '*' + peerDependenciesMeta: + debug: + optional: true + /for-each@0.3.3: resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==} dependencies: @@ -6623,6 +6658,14 @@ packages: signal-exit: 4.1.0 dev: true + /form-data@4.0.0: + resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} + engines: {node: '>= 6'} + dependencies: + asynckit: 0.4.0 + combined-stream: 1.0.8 + mime-types: 2.1.35 + /fraction.js@4.3.7: resolution: {integrity: sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew==} dev: true @@ -7992,14 +8035,12 @@ packages: /mime-db@1.52.0: resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} engines: {node: '>= 0.6'} - dev: true /mime-types@2.1.35: resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} engines: {node: '>= 0.6'} dependencies: mime-db: 1.52.0 - dev: true /mime@1.6.0: resolution: {integrity: sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==} @@ -9391,6 +9432,9 @@ packages: resolution: {integrity: sha512-/XJ368cyBJ7fzLMwLKv1e4vLxOju2MNAIokcr7meSaNcVbWz/CPcW22cP04mwxOErdA5mwjA8Q6w/cdAQxVn7Q==} dev: true + /proxy-from-env@1.1.0: + resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} + /punycode@2.3.1: resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'} diff --git a/src/crm/crm.ts b/src/crm/crm.ts deleted file mode 100644 index ed7e141..0000000 --- a/src/crm/crm.ts +++ /dev/null @@ -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, options?: AxiosRequestConfig): Promise> { - crmOrderItem = unref(crmOrderItem) - return axios.post( - `/cart`, - crmOrderItem, - options, - ) -} - -export function getCRMGetCartMutationOptions, TContext = unknown>(options?: { mutation?: UseMutationOptions>, TError, { data: CrmOrderItem[] }, TContext>, axios?: AxiosRequestConfig }): UseMutationOptions>, TError, { data: CrmOrderItem[] }, TContext> { - const { mutation: mutationOptions, axios: axiosOptions } = options ?? {} - - const mutationFn: MutationFunction>, { data: CrmOrderItem[] }> = (props) => { - const { data } = props ?? {} - - return cRMGetCart(data, axiosOptions) - } - - return { mutationFn, ...mutationOptions } -} - -export type CRMGetCartMutationResult = NonNullable>> -export type CRMGetCartMutationBody = CrmOrderItem[] -export type CRMGetCartMutationError = AxiosError - -export function useCRMGetCart, TContext = unknown>(options?: { mutation?: UseMutationOptions>, TError, { data: CrmOrderItem[] }, TContext>, axios?: AxiosRequestConfig }): UseMutationReturnType< - Awaited>, - TError, - { data: CrmOrderItem[] }, - TContext -> { - const mutationOptions = getCRMGetCartMutationOptions(options) - - return useMutation(mutationOptions) -} -export function cRMGetCatalog(options?: AxiosRequestConfig): Promise> { - return axios.get( - `/catalog`, - options, - ) -} - -export function getCRMGetCatalogQueryKey() { - return ['catalog'] as const -} - -export function getCRMGetCatalogQueryOptions>, TError = AxiosError>(options?: { query?: Partial>, TError, TData>>, axios?: AxiosRequestConfig }) { - const { query: queryOptions, axios: axiosOptions } = options ?? {} - - const queryKey = getCRMGetCatalogQueryKey() - - const queryFn: QueryFunction>> = ({ signal }) => cRMGetCatalog({ signal, ...axiosOptions }) - - return { queryKey, queryFn, ...queryOptions } as UseQueryOptions>, TError, TData> -} - -export type CRMGetCatalogQueryResult = NonNullable>> -export type CRMGetCatalogQueryError = AxiosError - -export function useCRMGetCatalog>, TError = AxiosError>(options?: { query?: Partial>, TError, TData>>, axios?: AxiosRequestConfig }): UseQueryReturnType & { queryKey: QueryKey } { - const queryOptions = getCRMGetCatalogQueryOptions(options) - - const query = useQuery(queryOptions) as UseQueryReturnType & { queryKey: QueryKey } - - query.queryKey = unref(queryOptions).queryKey as QueryKey - - return query -} - -export function cRMGetImage(name: MaybeRef, options?: AxiosRequestConfig): Promise> { - name = unref(name) - return axios.get( - `/images/${name}`, - options, - ) -} - -export function getCRMGetImageQueryKey(name: MaybeRef) { - return ['images', name] as const -} - -export function getCRMGetImageQueryOptions>, TError = AxiosError>(name: MaybeRef, options?: { query?: Partial>, TError, TData>>, axios?: AxiosRequestConfig }) { - const { query: queryOptions, axios: axiosOptions } = options ?? {} - - const queryKey = getCRMGetImageQueryKey(name) - - const queryFn: QueryFunction>> = ({ signal }) => cRMGetImage(name, { signal, ...axiosOptions }) - - return { queryKey, queryFn, enabled: computed(() => !!(unref(name))), ...queryOptions } as UseQueryOptions>, TError, TData> -} - -export type CRMGetImageQueryResult = NonNullable>> -export type CRMGetImageQueryError = AxiosError - -export function useCRMGetImage>, TError = AxiosError>(name: MaybeRef, options?: { query?: Partial>, TError, TData>>, axios?: AxiosRequestConfig }): UseQueryReturnType & { queryKey: QueryKey } { - const queryOptions = getCRMGetImageQueryOptions(name, options) - - const query = useQuery(queryOptions) as UseQueryReturnType & { queryKey: QueryKey } - - query.queryKey = unref(queryOptions).queryKey as QueryKey - - return query -} - -export function cRMOrder(crabscrmOrder: MaybeRef, options?: AxiosRequestConfig): Promise> { - crabscrmOrder = unref(crabscrmOrder) - return axios.post( - `/orders`, - crabscrmOrder, - options, - ) -} - -export function getCRMOrderMutationOptions, TContext = unknown>(options?: { mutation?: UseMutationOptions>, TError, { data: CrabscrmOrder }, TContext>, axios?: AxiosRequestConfig }): UseMutationOptions>, TError, { data: CrabscrmOrder }, TContext> { - const { mutation: mutationOptions, axios: axiosOptions } = options ?? {} - - const mutationFn: MutationFunction>, { data: CrabscrmOrder }> = (props) => { - const { data } = props ?? {} - - return cRMOrder(data, axiosOptions) - } - - return { mutationFn, ...mutationOptions } -} - -export type CRMOrderMutationResult = NonNullable>> -export type CRMOrderMutationBody = CrabscrmOrder -export type CRMOrderMutationError = AxiosError - -export function useCRMOrder, TContext = unknown>(options?: { mutation?: UseMutationOptions>, TError, { data: CrabscrmOrder }, TContext>, axios?: AxiosRequestConfig }): UseMutationReturnType< - Awaited>, - TError, - { data: CrabscrmOrder }, - TContext -> { - const mutationOptions = getCRMOrderMutationOptions(options) - - return useMutation(mutationOptions) -} -export function cRMGetPositions(id: MaybeRef, options?: AxiosRequestConfig): Promise> { - id = unref(id) - return axios.get( - `/positions/${id}`, - options, - ) -} - -export function getCRMGetPositionsQueryKey(id: MaybeRef) { - return ['positions', id] as const -} - -export function getCRMGetPositionsQueryOptions>, TError = AxiosError>(id: MaybeRef, options?: { query?: Partial>, TError, TData>>, axios?: AxiosRequestConfig }) { - const { query: queryOptions, axios: axiosOptions } = options ?? {} - - const queryKey = getCRMGetPositionsQueryKey(id) - - const queryFn: QueryFunction>> = ({ signal }) => cRMGetPositions(id, { signal, ...axiosOptions }) - - return { queryKey, queryFn, enabled: computed(() => !!(unref(id))), ...queryOptions } as UseQueryOptions>, TError, TData> -} - -export type CRMGetPositionsQueryResult = NonNullable>> -export type CRMGetPositionsQueryError = AxiosError - -export function useCRMGetPositions>, TError = AxiosError>(id: MaybeRef, options?: { query?: Partial>, TError, TData>>, axios?: AxiosRequestConfig }): UseQueryReturnType & { queryKey: QueryKey } { - const queryOptions = getCRMGetPositionsQueryOptions(id, options) - - const query = useQuery(queryOptions) as UseQueryReturnType & { queryKey: QueryKey } - - query.queryKey = unref(queryOptions).queryKey as QueryKey - - return query -} - -export function cRMGetProduct(id: MaybeRef, options?: AxiosRequestConfig): Promise> { - id = unref(id) - return axios.get( - `/products/${id}`, - options, - ) -} - -export function getCRMGetProductQueryKey(id: MaybeRef) { - return ['products', id] as const -} - -export function getCRMGetProductQueryOptions>, TError = AxiosError>(id: MaybeRef, options?: { query?: Partial>, TError, TData>>, axios?: AxiosRequestConfig }) { - const { query: queryOptions, axios: axiosOptions } = options ?? {} - - const queryKey = getCRMGetProductQueryKey(id) - - const queryFn: QueryFunction>> = ({ signal }) => cRMGetProduct(id, { signal, ...axiosOptions }) - - return { queryKey, queryFn, enabled: computed(() => !!(unref(id))), ...queryOptions } as UseQueryOptions>, TError, TData> -} - -export type CRMGetProductQueryResult = NonNullable>> -export type CRMGetProductQueryError = AxiosError - -export function useCRMGetProduct>, TError = AxiosError>(id: MaybeRef, options?: { query?: Partial>, TError, TData>>, axios?: AxiosRequestConfig }): UseQueryReturnType & { queryKey: QueryKey } { - const queryOptions = getCRMGetProductQueryOptions(id, options) - - const query = useQuery(queryOptions) as UseQueryReturnType & { queryKey: QueryKey } - - query.queryKey = unref(queryOptions).queryKey as QueryKey - - return query -} - -export function cRMGetBreadcrumbs(id: MaybeRef, options?: AxiosRequestConfig): Promise> { - id = unref(id) - return axios.get( - `/products/${id}/breadcrumbs`, - options, - ) -} - -export function getCRMGetBreadcrumbsQueryKey(id: MaybeRef) { - return ['products', id, 'breadcrumbs'] as const -} - -export function getCRMGetBreadcrumbsQueryOptions>, TError = AxiosError>(id: MaybeRef, options?: { query?: Partial>, TError, TData>>, axios?: AxiosRequestConfig }) { - const { query: queryOptions, axios: axiosOptions } = options ?? {} - - const queryKey = getCRMGetBreadcrumbsQueryKey(id) - - const queryFn: QueryFunction>> = ({ signal }) => cRMGetBreadcrumbs(id, { signal, ...axiosOptions }) - - return { queryKey, queryFn, enabled: computed(() => !!(unref(id))), ...queryOptions } as UseQueryOptions>, TError, TData> -} - -export type CRMGetBreadcrumbsQueryResult = NonNullable>> -export type CRMGetBreadcrumbsQueryError = AxiosError - -export function useCRMGetBreadcrumbs>, TError = AxiosError>(id: MaybeRef, options?: { query?: Partial>, TError, TData>>, axios?: AxiosRequestConfig }): UseQueryReturnType & { queryKey: QueryKey } { - const queryOptions = getCRMGetBreadcrumbsQueryOptions(id, options) - - const query = useQuery(queryOptions) as UseQueryReturnType & { queryKey: QueryKey } - - query.queryKey = unref(queryOptions).queryKey as QueryKey - - return query -} - -export function cRMSearch(params?: MaybeRef, options?: AxiosRequestConfig): Promise> { - params = unref(params) - return axios.get( - `/search`, - { - ...options, - params: { ...unref(params), ...options?.params }, - }, - ) -} - -export function getCRMSearchQueryKey(params?: MaybeRef) { - return ['search', ...(params ? [params] : [])] as const -} - -export function getCRMSearchQueryOptions>, TError = AxiosError>(params?: MaybeRef, options?: { query?: Partial>, TError, TData>>, axios?: AxiosRequestConfig }) { - const { query: queryOptions, axios: axiosOptions } = options ?? {} - - const queryKey = getCRMSearchQueryKey(params) - - const queryFn: QueryFunction>> = ({ signal }) => cRMSearch(params, { signal, ...axiosOptions }) - - return { queryKey, queryFn, ...queryOptions } as UseQueryOptions>, TError, TData> -} - -export type CRMSearchQueryResult = NonNullable>> -export type CRMSearchQueryError = AxiosError - -export function useCRMSearch>, TError = AxiosError>(params?: MaybeRef, options?: { query?: Partial>, TError, TData>>, axios?: AxiosRequestConfig }): UseQueryReturnType & { queryKey: QueryKey } { - const queryOptions = getCRMSearchQueryOptions(params, options) - - const query = useQuery(queryOptions) as UseQueryReturnType & { queryKey: QueryKey } - - query.queryKey = unref(queryOptions).queryKey as QueryKey - - return query -} diff --git a/src/shared/api/crm/crm.ts b/src/shared/api/crm/crm.ts new file mode 100644 index 0000000..b0180d2 --- /dev/null +++ b/src/shared/api/crm/crm.ts @@ -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, options?: AxiosRequestConfig + ): Promise> => { + crmOrderItem = unref(crmOrderItem); + return axios.post( + `/cart`, + crmOrderItem,options + ); + } + + + +export const getCRMGetCartMutationOptions = , + TContext = unknown>(options?: { mutation?:UseMutationOptions>, TError,{data: CrmOrderItem[]}, TContext>, axios?: AxiosRequestConfig} +): UseMutationOptions>, TError,{data: CrmOrderItem[]}, TContext> => { +const {mutation: mutationOptions, axios: axiosOptions} = options ?? {}; + + + + + const mutationFn: MutationFunction>, {data: CrmOrderItem[]}> = (props) => { + const {data} = props ?? {}; + + return cRMGetCart(data,axiosOptions) + } + + + + + return { mutationFn, ...mutationOptions }} + + export type CRMGetCartMutationResult = NonNullable>> + export type CRMGetCartMutationBody = CrmOrderItem[] + export type CRMGetCartMutationError = AxiosError + + export const useCRMGetCart = , + TContext = unknown>(options?: { mutation?:UseMutationOptions>, TError,{data: CrmOrderItem[]}, TContext>, axios?: AxiosRequestConfig} +): UseMutationReturnType< + Awaited>, + TError, + {data: CrmOrderItem[]}, + TContext + > => { + + const mutationOptions = getCRMGetCartMutationOptions(options); + + return useMutation(mutationOptions); + } + export const cRMGetCatalog = ( + options?: AxiosRequestConfig + ): Promise> => { + + return axios.get( + `/catalog`,options + ); + } + + +export const getCRMGetCatalogQueryKey = () => { + return ['catalog'] as const; + } + + +export const getCRMGetCatalogQueryOptions = >, TError = AxiosError>( options?: { query?:Partial>, TError, TData>>, axios?: AxiosRequestConfig} +) => { + +const {query: queryOptions, axios: axiosOptions} = options ?? {}; + + const queryKey = getCRMGetCatalogQueryKey(); + + + + const queryFn: QueryFunction>> = ({ signal }) => cRMGetCatalog({ signal, ...axiosOptions }); + + + + + + return { queryKey, queryFn, ...queryOptions} as UseQueryOptions>, TError, TData> +} + +export type CRMGetCatalogQueryResult = NonNullable>> +export type CRMGetCatalogQueryError = AxiosError + +export const useCRMGetCatalog = >, TError = AxiosError>( + options?: { query?:Partial>, TError, TData>>, axios?: AxiosRequestConfig} + + ): UseQueryReturnType & { queryKey: QueryKey } => { + + const queryOptions = getCRMGetCatalogQueryOptions(options) + + const query = useQuery(queryOptions) as UseQueryReturnType & { queryKey: QueryKey }; + + query.queryKey = unref(queryOptions).queryKey as QueryKey; + + return query; +} + + + +export const cRMGetImage = ( + name: MaybeRef, options?: AxiosRequestConfig + ): Promise> => { + name = unref(name); + return axios.get( + `/images/${name}`,options + ); + } + + +export const getCRMGetImageQueryKey = (name: MaybeRef,) => { + return ['images',name] as const; + } + + +export const getCRMGetImageQueryOptions = >, TError = AxiosError>(name: MaybeRef, options?: { query?:Partial>, TError, TData>>, axios?: AxiosRequestConfig} +) => { + +const {query: queryOptions, axios: axiosOptions} = options ?? {}; + + const queryKey = getCRMGetImageQueryKey(name); + + + + const queryFn: QueryFunction>> = ({ signal }) => cRMGetImage(name, { signal, ...axiosOptions }); + + + + + + return { queryKey, queryFn, enabled: computed(() => !!(unref(name))), ...queryOptions} as UseQueryOptions>, TError, TData> +} + +export type CRMGetImageQueryResult = NonNullable>> +export type CRMGetImageQueryError = AxiosError + +export const useCRMGetImage = >, TError = AxiosError>( + name: MaybeRef, options?: { query?:Partial>, TError, TData>>, axios?: AxiosRequestConfig} + + ): UseQueryReturnType & { queryKey: QueryKey } => { + + const queryOptions = getCRMGetImageQueryOptions(name,options) + + const query = useQuery(queryOptions) as UseQueryReturnType & { queryKey: QueryKey }; + + query.queryKey = unref(queryOptions).queryKey as QueryKey; + + return query; +} + + + +export const cRMOrder = ( + crabscrmOrder: MaybeRef, options?: AxiosRequestConfig + ): Promise> => { + crabscrmOrder = unref(crabscrmOrder); + return axios.post( + `/orders`, + crabscrmOrder,options + ); + } + + + +export const getCRMOrderMutationOptions = , + TContext = unknown>(options?: { mutation?:UseMutationOptions>, TError,{data: CrabscrmOrder}, TContext>, axios?: AxiosRequestConfig} +): UseMutationOptions>, TError,{data: CrabscrmOrder}, TContext> => { +const {mutation: mutationOptions, axios: axiosOptions} = options ?? {}; + + + + + const mutationFn: MutationFunction>, {data: CrabscrmOrder}> = (props) => { + const {data} = props ?? {}; + + return cRMOrder(data,axiosOptions) + } + + + + + return { mutationFn, ...mutationOptions }} + + export type CRMOrderMutationResult = NonNullable>> + export type CRMOrderMutationBody = CrabscrmOrder + export type CRMOrderMutationError = AxiosError + + export const useCRMOrder = , + TContext = unknown>(options?: { mutation?:UseMutationOptions>, TError,{data: CrabscrmOrder}, TContext>, axios?: AxiosRequestConfig} +): UseMutationReturnType< + Awaited>, + TError, + {data: CrabscrmOrder}, + TContext + > => { + + const mutationOptions = getCRMOrderMutationOptions(options); + + return useMutation(mutationOptions); + } + export const cRMGetPositions = ( + id: MaybeRef, options?: AxiosRequestConfig + ): Promise> => { + id = unref(id); + return axios.get( + `/positions/${id}`,options + ); + } + + +export const getCRMGetPositionsQueryKey = (id: MaybeRef,) => { + return ['positions',id] as const; + } + + +export const getCRMGetPositionsQueryOptions = >, TError = AxiosError>(id: MaybeRef, options?: { query?:Partial>, TError, TData>>, axios?: AxiosRequestConfig} +) => { + +const {query: queryOptions, axios: axiosOptions} = options ?? {}; + + const queryKey = getCRMGetPositionsQueryKey(id); + + + + const queryFn: QueryFunction>> = ({ signal }) => cRMGetPositions(id, { signal, ...axiosOptions }); + + + + + + return { queryKey, queryFn, enabled: computed(() => !!(unref(id))), ...queryOptions} as UseQueryOptions>, TError, TData> +} + +export type CRMGetPositionsQueryResult = NonNullable>> +export type CRMGetPositionsQueryError = AxiosError + +export const useCRMGetPositions = >, TError = AxiosError>( + id: MaybeRef, options?: { query?:Partial>, TError, TData>>, axios?: AxiosRequestConfig} + + ): UseQueryReturnType & { queryKey: QueryKey } => { + + const queryOptions = getCRMGetPositionsQueryOptions(id,options) + + const query = useQuery(queryOptions) as UseQueryReturnType & { queryKey: QueryKey }; + + query.queryKey = unref(queryOptions).queryKey as QueryKey; + + return query; +} + + + +export const cRMGetProduct = ( + id: MaybeRef, options?: AxiosRequestConfig + ): Promise> => { + id = unref(id); + return axios.get( + `/products/${id}`,options + ); + } + + +export const getCRMGetProductQueryKey = (id: MaybeRef,) => { + return ['products',id] as const; + } + + +export const getCRMGetProductQueryOptions = >, TError = AxiosError>(id: MaybeRef, options?: { query?:Partial>, TError, TData>>, axios?: AxiosRequestConfig} +) => { + +const {query: queryOptions, axios: axiosOptions} = options ?? {}; + + const queryKey = getCRMGetProductQueryKey(id); + + + + const queryFn: QueryFunction>> = ({ signal }) => cRMGetProduct(id, { signal, ...axiosOptions }); + + + + + + return { queryKey, queryFn, enabled: computed(() => !!(unref(id))), ...queryOptions} as UseQueryOptions>, TError, TData> +} + +export type CRMGetProductQueryResult = NonNullable>> +export type CRMGetProductQueryError = AxiosError + +export const useCRMGetProduct = >, TError = AxiosError>( + id: MaybeRef, options?: { query?:Partial>, TError, TData>>, axios?: AxiosRequestConfig} + + ): UseQueryReturnType & { queryKey: QueryKey } => { + + const queryOptions = getCRMGetProductQueryOptions(id,options) + + const query = useQuery(queryOptions) as UseQueryReturnType & { queryKey: QueryKey }; + + query.queryKey = unref(queryOptions).queryKey as QueryKey; + + return query; +} + + + +export const cRMGetBreadcrumbs = ( + id: MaybeRef, options?: AxiosRequestConfig + ): Promise> => { + id = unref(id); + return axios.get( + `/products/${id}/breadcrumbs`,options + ); + } + + +export const getCRMGetBreadcrumbsQueryKey = (id: MaybeRef,) => { + return ['products',id,'breadcrumbs'] as const; + } + + +export const getCRMGetBreadcrumbsQueryOptions = >, TError = AxiosError>(id: MaybeRef, options?: { query?:Partial>, TError, TData>>, axios?: AxiosRequestConfig} +) => { + +const {query: queryOptions, axios: axiosOptions} = options ?? {}; + + const queryKey = getCRMGetBreadcrumbsQueryKey(id); + + + + const queryFn: QueryFunction>> = ({ signal }) => cRMGetBreadcrumbs(id, { signal, ...axiosOptions }); + + + + + + return { queryKey, queryFn, enabled: computed(() => !!(unref(id))), ...queryOptions} as UseQueryOptions>, TError, TData> +} + +export type CRMGetBreadcrumbsQueryResult = NonNullable>> +export type CRMGetBreadcrumbsQueryError = AxiosError + +export const useCRMGetBreadcrumbs = >, TError = AxiosError>( + id: MaybeRef, options?: { query?:Partial>, TError, TData>>, axios?: AxiosRequestConfig} + + ): UseQueryReturnType & { queryKey: QueryKey } => { + + const queryOptions = getCRMGetBreadcrumbsQueryOptions(id,options) + + const query = useQuery(queryOptions) as UseQueryReturnType & { queryKey: QueryKey }; + + query.queryKey = unref(queryOptions).queryKey as QueryKey; + + return query; +} + + + +export const cRMSearch = ( + params?: MaybeRef, options?: AxiosRequestConfig + ): Promise> => { + params = unref(params); + return axios.get( + `/search`,{ + ...options, + params: {...unref(params), ...options?.params},} + ); + } + + +export const getCRMSearchQueryKey = (params?: MaybeRef,) => { + return ['search', ...(params ? [params]: [])] as const; + } + + +export const getCRMSearchQueryOptions = >, TError = AxiosError>(params?: MaybeRef, options?: { query?:Partial>, TError, TData>>, axios?: AxiosRequestConfig} +) => { + +const {query: queryOptions, axios: axiosOptions} = options ?? {}; + + const queryKey = getCRMSearchQueryKey(params); + + + + const queryFn: QueryFunction>> = ({ signal }) => cRMSearch(params, { signal, ...axiosOptions }); + + + + + + return { queryKey, queryFn, ...queryOptions} as UseQueryOptions>, TError, TData> +} + +export type CRMSearchQueryResult = NonNullable>> +export type CRMSearchQueryError = AxiosError + +export const useCRMSearch = >, TError = AxiosError>( + params?: MaybeRef, options?: { query?:Partial>, TError, TData>>, axios?: AxiosRequestConfig} + + ): UseQueryReturnType & { queryKey: QueryKey } => { + + const queryOptions = getCRMSearchQueryOptions(params,options) + + const query = useQuery(queryOptions) as UseQueryReturnType & { queryKey: QueryKey }; + + query.queryKey = unref(queryOptions).queryKey as QueryKey; + + return query; +} + + + diff --git a/src/shared/model/apiHttpBody.ts b/src/shared/model/apiHttpBody.ts index e3334b9..30d6d1e 100644 --- a/src/shared/model/apiHttpBody.ts +++ b/src/shared/model/apiHttpBody.ts @@ -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[]; } diff --git a/src/shared/model/cRMSearchParams.ts b/src/shared/model/cRMSearchParams.ts index 66060a5..ffe9f6a 100644 --- a/src/shared/model/cRMSearchParams.ts +++ b/src/shared/model/cRMSearchParams.ts @@ -5,6 +5,6 @@ * OpenAPI spec version: version not set */ -export interface CRMSearchParams { - text?: string -} +export type CRMSearchParams = { +text?: string; +}; diff --git a/src/shared/model/crabscrmLabel.ts b/src/shared/model/crabscrmLabel.ts index fcfda52..1e41ee0 100644 --- a/src/shared/model/crabscrmLabel.ts +++ b/src/shared/model/crabscrmLabel.ts @@ -6,5 +6,5 @@ */ export interface CrabscrmLabel { - name?: string + name?: string; } diff --git a/src/shared/model/crabscrmOrder.ts b/src/shared/model/crabscrmOrder.ts index 5a70f8a..3fd05eb 100644 --- a/src/shared/model/crabscrmOrder.ts +++ b/src/shared/model/crabscrmOrder.ts @@ -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; } diff --git a/src/shared/model/crmBreadcrumbsRsp.ts b/src/shared/model/crmBreadcrumbsRsp.ts index 1f39aff..1605172 100644 --- a/src/shared/model/crmBreadcrumbsRsp.ts +++ b/src/shared/model/crmBreadcrumbsRsp.ts @@ -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[]; } diff --git a/src/shared/model/crmCartItem.ts b/src/shared/model/crmCartItem.ts index aa7ebf8..da51dfb 100644 --- a/src/shared/model/crmCartItem.ts +++ b/src/shared/model/crmCartItem.ts @@ -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[]; } diff --git a/src/shared/model/crmCartRsp.ts b/src/shared/model/crmCartRsp.ts index d5da5f3..9b0191f 100644 --- a/src/shared/model/crmCartRsp.ts +++ b/src/shared/model/crmCartRsp.ts @@ -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[]; } diff --git a/src/shared/model/crmCatalogRsp.ts b/src/shared/model/crmCatalogRsp.ts index b9d7611..b0fa175 100644 --- a/src/shared/model/crmCatalogRsp.ts +++ b/src/shared/model/crmCatalogRsp.ts @@ -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[]; } diff --git a/src/shared/model/crmCategory.ts b/src/shared/model/crmCategory.ts index 1e68b7a..b231c25 100644 --- a/src/shared/model/crmCategory.ts +++ b/src/shared/model/crmCategory.ts @@ -6,8 +6,8 @@ */ export interface CrmCategory { - children?: CrmCategory[] - id?: string - name?: string - uri?: string + children?: CrmCategory[]; + id?: string; + name?: string; + uri?: string; } diff --git a/src/shared/model/crmCharacteristic.ts b/src/shared/model/crmCharacteristic.ts index 5e30077..9f25c32 100644 --- a/src/shared/model/crmCharacteristic.ts +++ b/src/shared/model/crmCharacteristic.ts @@ -6,6 +6,6 @@ */ export interface CrmCharacteristic { - name?: string - value?: string + name?: string; + value?: string; } diff --git a/src/shared/model/crmGroupedProduct.ts b/src/shared/model/crmGroupedProduct.ts index 4ef0497..f5eb294 100644 --- a/src/shared/model/crmGroupedProduct.ts +++ b/src/shared/model/crmGroupedProduct.ts @@ -6,7 +6,7 @@ */ export interface CrmGroupedProduct { - image?: string - name?: string - uri?: string + image?: string; + name?: string; + uri?: string; } diff --git a/src/shared/model/crmOrderItem.ts b/src/shared/model/crmOrderItem.ts index f55fb6c..9645354 100644 --- a/src/shared/model/crmOrderItem.ts +++ b/src/shared/model/crmOrderItem.ts @@ -6,6 +6,6 @@ */ export interface CrmOrderItem { - count?: string - productId?: string + count?: string; + productId?: string; } diff --git a/src/shared/model/crmPositionsRsp.ts b/src/shared/model/crmPositionsRsp.ts index b9abd80..eac32f0 100644 --- a/src/shared/model/crmPositionsRsp.ts +++ b/src/shared/model/crmPositionsRsp.ts @@ -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[]; } diff --git a/src/shared/model/crmProduct.ts b/src/shared/model/crmProduct.ts index be8b947..10bff6f 100644 --- a/src/shared/model/crmProduct.ts +++ b/src/shared/model/crmProduct.ts @@ -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[]; } diff --git a/src/shared/model/crmProductRsp.ts b/src/shared/model/crmProductRsp.ts index 64f4c86..3df356f 100644 --- a/src/shared/model/crmProductRsp.ts +++ b/src/shared/model/crmProductRsp.ts @@ -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; } diff --git a/src/shared/model/crmProperty.ts b/src/shared/model/crmProperty.ts index 9475561..19ba5e0 100644 --- a/src/shared/model/crmProperty.ts +++ b/src/shared/model/crmProperty.ts @@ -6,6 +6,6 @@ */ export interface CrmProperty { - name?: string - value?: string + name?: string; + value?: string; } diff --git a/src/shared/model/crmVariant.ts b/src/shared/model/crmVariant.ts index 857c243..d82daee 100644 --- a/src/shared/model/crmVariant.ts +++ b/src/shared/model/crmVariant.ts @@ -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[]; } diff --git a/src/shared/model/index.ts b/src/shared/model/index.ts index 1d2d358..d947771 100644 --- a/src/shared/model/index.ts +++ b/src/shared/model/index.ts @@ -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'; \ No newline at end of file diff --git a/src/shared/model/protobufAny.ts b/src/shared/model/protobufAny.ts index 46a35e6..8701667 100644 --- a/src/shared/model/protobufAny.ts +++ b/src/shared/model/protobufAny.ts @@ -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; } diff --git a/src/shared/model/rpcStatus.ts b/src/shared/model/rpcStatus.ts index ad42c80..e3dda88 100644 --- a/src/shared/model/rpcStatus.ts +++ b/src/shared/model/rpcStatus.ts @@ -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; }